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

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 (36) hide show
  1. package/dist/.parachute/info +1 -1
  2. package/dist/assets/{Activity-bT-4Y6Hc.js → Activity-1x_gPzIq.js} +1 -1
  3. package/dist/assets/{AddVault-D-ahv-KW.js → AddVault-BFUfH1A-.js} +1 -1
  4. package/dist/assets/Calendar-DKvWPoOn.js +1 -0
  5. package/dist/assets/{Import-CZCd6DVe.js → Import-gYrPbftC.js} +4 -4
  6. package/dist/assets/NoteEditor-BNTbbQiq.js +1 -0
  7. package/dist/assets/NoteNew-DCWZJOnG.js +9 -0
  8. package/dist/assets/{NoteRenderer-B-t3iR2x.js → NoteRenderer-D2nj176-.js} +1 -1
  9. package/dist/assets/NoteView-CyhpDII4.js +3 -0
  10. package/dist/assets/OAuthCallback-C1TfZ2M_.js +1 -0
  11. package/dist/assets/PinArchiveButtons-BuU8vG74.js +1 -0
  12. package/dist/assets/Settings-CZVcMAE6.js +1 -0
  13. package/dist/assets/Tags-DWFKRTXQ.js +1 -0
  14. package/dist/assets/VaultGraph-C8wDjZmL.js +3 -0
  15. package/dist/assets/{Vaults-BfdAmD22.js → Vaults-CqhMGcCD.js} +1 -1
  16. package/dist/assets/{attachment-upload-DELsFKqW.js → attachment-upload-BMjVTZmk.js} +1 -1
  17. package/dist/assets/index-BdyNnuNw.js +70 -0
  18. package/dist/assets/index-C9Y7w-_L.css +1 -0
  19. package/dist/assets/{react-force-graph-2d-BD6TQ9hX.js → react-force-graph-2d-DF72c1gy.js} +1 -1
  20. package/dist/assets/{useAttachmentUploader-TbRdZxIB.js → useAttachmentUploader-DO981Zm0.js} +13 -13
  21. package/dist/index.html +2 -2
  22. package/dist/sw.js +1 -1
  23. package/package.json +2 -2
  24. package/dist/assets/Calendar-CYvQrwCA.js +0 -1
  25. package/dist/assets/NoteEditor-DejkUizg.js +0 -1
  26. package/dist/assets/NoteNew-BgEB8Ff1.js +0 -9
  27. package/dist/assets/NoteView-B0i46Tpn.js +0 -3
  28. package/dist/assets/OAuthCallback-C-st38Zr.js +0 -1
  29. package/dist/assets/PinArchiveButtons-BEmrCa2u.js +0 -1
  30. package/dist/assets/Settings-C04VDzuq.js +0 -1
  31. package/dist/assets/Tags-BcEIUux1.js +0 -1
  32. package/dist/assets/Today-Cz-OTXJ7.js +0 -1
  33. package/dist/assets/VaultGraph-D42L0Y2e.js +0 -3
  34. package/dist/assets/dates-BGZoWpL2.js +0 -1
  35. package/dist/assets/index--Z5j3NQq.css +0 -1
  36. package/dist/assets/index-DQ3LtJxh.js +0 -67
@@ -1,4 +1,4 @@
1
- import{h as te,j as ee,V as re,k as Mt,o as xt,t as ne,ai as se,K as ie,Z as ae,a8 as oe,ae as le,B as gt,v as D,N as Tt,L as ce}from"./index-DQ3LtJxh.js";import{f as ue,A as he}from"./attachment-upload-DELsFKqW.js";const de=new Set(["png","jpg","jpeg","gif","webp"]),fe=new Set(["wav","mp3","m4a","ogg","webm"]),pe=new Set(["mp4"]),me=new Set(["txt","json","csv","yaml","yml","svg","tsv","log"]);function ge(y){const S=y.toLowerCase();return de.has(S)?"image":S==="pdf"?"pdf":fe.has(S)?"audio":pe.has(S)?"video":me.has(S)?"text":"unsupported"}function _e(y){return ge(ue(y))}function be(y){return y==="image"||y==="pdf"||y==="audio"||y==="video"}function $t(y){return typeof y.text=="function"?y.text():new Promise((S,o)=>{const b=new FileReader;b.onload=()=>S(b.result),b.onerror=()=>o(b.error??new Error("FileReader failed")),b.readAsText(y)})}function ye(y){const S=new Map,o=new Map;for(const b of y){const h=b.filename.toLowerCase();S.has(h)||S.set(h,b),o.set(Nt(b.sourcePath),b)}return{byBasename:S,byPath:o}}function Nt(y){let S=y.trim();try{S=decodeURIComponent(S)}catch{}return S=S.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,""),S.toLowerCase()}function Ct(y){const S=Nt(y),o=S.lastIndexOf("/");return o>=0?S.slice(o+1):S}function Bt(y){return/\.[a-z0-9]+$/i.test(Ct(y))}function Dt(y,S){const o=Nt(S),b=y.byPath.get(o);if(b)return b;for(const[h,i]of y.byPath)if(h===o||h.endsWith(`/${o}`))return i;return y.byBasename.get(Ct(S))??null}function Ft(y,S){const o=`/api/storage/${y.storagePath}`,b=S||y.filename;return y.isImage?`![${b}](${o})`:`[${b}](${o})`}function ve(y,S){let o=0;const b=new Set,h=/(!?)\[\[([^\]|#]+)(?:[#|][^\]]*)?\]\]/g,i=y.replace(h,(c,m,v)=>{if(!Bt(v))return c;const _=Dt(S,v);return _?(o++,b.add(_.sourcePath),Ft(_,Ct(v))):c}),n=/(!?)\[([^\]]*)\]\(\s*(<[^>]+>|[^)\s]+)(\s+[^)]*)?\)/g;return{content:i.replace(n,(c,m,v,_,w)=>{const s=_.startsWith("<")&&_.endsWith(">")?_.slice(1,-1):_;if(/^(https?:|mailto:|tel:|#|\/api\/storage\/)/i.test(s.trim())||!Bt(s))return c;const d=Dt(S,s);if(!d)return c;o++,b.add(d.sourcePath);const a=v.trim()||Ct(s);return Ft(d,a)}),rewritten:o,referenced:b}}const we=5,xe=500;async function It(y){const{client:S,notes:o,onProgress:b,signal:h}=y,i=Math.max(1,y.concurrency??we),n=[];let r=0,c=0,m=!1;const v=o.map(ze);async function _(){for(;;){if(h!=null&&h.aborted||m)return;const l=r++;if(l>=o.length)return;const u=o[l],p=v[l],k=await ke(S,u,p,h);n[l]=k,c++,k.status==="errored"&&k.reason.startsWith("auth:")&&(m=!0),b==null||b({done:c,total:o.length})}}const w=Array.from({length:Math.min(i,o.length)},()=>_());await Promise.all(w);for(let l=0;l<o.length;l++)n[l]||(n[l]={status:"errored",sourcePath:o[l].sourcePath,reason:m?"Skipped — vault session ended before this note was reached.":"Skipped — import was cancelled."});let s=0,d=0,a=0;for(const l of n)l.status==="created"?s++:l.status==="skipped"?d++:a++;return{created:s,skipped:d,errored:a,outcomes:n}}async function ke(y,S,o,b){try{const h=await Se(y,o,b);return{status:"created",sourcePath:S.sourcePath,noteId:h.id}}catch(h){return h instanceof te||h instanceof ee?{status:"skipped",sourcePath:S.sourcePath,reason:h.message||"Already exists in vault"}:h instanceof re?{status:"errored",sourcePath:S.sourcePath,reason:`auth: ${h.message}`}:h instanceof Mt?{status:"errored",sourcePath:S.sourcePath,reason:`vault unreachable (${h.status}): ${h.message}`}:{status:"errored",sourcePath:S.sourcePath,reason:h instanceof Error?h.message:String(h)}}}async function Se(y,S,o){const b={};o&&(b.signal=o);try{return await y.createNote(S,b)}catch(h){if(!Ce(h)||o!=null&&o.aborted)throw h;return await Ee(xe,o),await y.createNote(S,b)}}function Ce(y){return y instanceof Mt}function Ee(y,S){return new Promise(o=>{const b=setTimeout(()=>{S==null||S.removeEventListener("abort",h),o()},y),h=()=>{clearTimeout(b),o()};S&&S.addEventListener("abort",h,{once:!0})})}function ze(y){const S={content:y.content};y.path&&(S.path=y.path),y.tags.length>0&&(S.tags=y.tags),Object.keys(y.metadata).length>0&&(S.metadata=y.metadata);const o=S;return y.id&&(o.id=y.id),y.createdAt&&(o.created_at=y.createdAt),S}const Lt="Imported files",Ae=20;async function Ie(y){const{client:S,parsed:o,signal:b}=y,h=[],i=[],n=[],r=[];for(const l of o.attachments)be(l.kind)?i.push(l):l.kind==="text"?n.push(l):r.push(l);const c=new Map;for(const l of i){if(b!=null&&b.aborted){h.push({status:"skipped",sourcePath:l.sourcePath,reason:"Skipped — import was cancelled."});continue}try{const u=new File([l.blob],l.filename,{type:l.blob.type||void 0}),p=await S.uploadStorageFile(u,{signal:b});c.set(l.sourcePath,{attachment:l,storagePath:p.path,mimeType:p.mimeType,isImage:p.mimeType.startsWith("image/")})}catch(u){h.push({status:"errored",sourcePath:l.sourcePath,reason:`Upload failed: ${u instanceof Error?u.message:String(u)}`})}}const m=Ne(c),v=new Map,_=o.notes.map(l=>{const{content:u,referenced:p}=ve(l.content,m);return v.set(l.sourcePath,p),{...l,content:u}}),w=await It({client:S,notes:_,...y.concurrency!==void 0?{concurrency:y.concurrency}:{},...y.onProgress?{onProgress:y.onProgress}:{},...b?{signal:b}:{}}),s=new Map;for(const l of w.outcomes)l.status==="created"&&s.set(l.sourcePath,l.noteId);const d=new Map;for(const[l,u]of v){const p=s.get(l);if(p)for(const k of u){let E=d.get(k);E||(E=new Set,d.set(k,E)),E.add(p)}}for(const[l,u]of c){const p=d.get(l);if(!p||p.size===0)continue;let k=0;for(const E of p){if(b!=null&&b.aborted)break;try{await S.linkAttachment(E,{path:u.storagePath,mimeType:u.mimeType}),k++}catch{}}h.push({status:"uploaded",sourcePath:l,storagePath:u.storagePath,references:k})}if(n.length>0&&!(b!=null&&b.aborted)){const l=[];for(const p of n)l.push(await je(p));const u=await It({client:S,notes:l,...y.concurrency!==void 0?{concurrency:y.concurrency}:{},...b?{signal:b}:{}});for(let p=0;p<n.length;p++){const k=n[p],E=u.outcomes[p];(E==null?void 0:E.status)==="created"?h.push({status:"uploaded",sourcePath:k.sourcePath,storagePath:`note:${E.noteId}`,references:1,asNote:!0}):h.push({status:"skipped",sourcePath:k.sourcePath,reason:(E==null?void 0:E.status)==="skipped"?`Imported as note, but ${E.reason}`:`Could not import as note: ${(E==null?void 0:E.status)==="errored"?E.reason:"unknown"}`})}}else if(n.length>0)for(const l of n)h.push({status:"skipped",sourcePath:l.sourcePath,reason:"Skipped — import was cancelled."});const a=[...c.entries()].filter(([l])=>{var u;return!(((u=d.get(l))==null?void 0:u.size)??0)}).map(([,l])=>l);if(a.length>0)if(b!=null&&b.aborted)for(const l of a)h.push({status:"uploaded",sourcePath:l.attachment.sourcePath,storagePath:l.storagePath,references:0});else await Re(S,a,h,y.concurrency,b);for(const l of r)h.push({status:"skipped",sourcePath:l.sourcePath,reason:`.${l.ext||"?"} is not a vault storage type — not imported. (Re-save it in a supported format to bring it across.)`});return Te(w,h)}function Ne(y){return ye([...y.values()].map(S=>({sourcePath:S.attachment.sourcePath,storagePath:S.storagePath,isImage:S.isImage,filename:S.attachment.filename})))}async function je(y){let S="";try{S=await $t(y.blob)}catch{S=""}const o=Pe(y.ext)?`\`\`\`${Oe(y.ext)}
1
+ import{h as te,j as ee,V as re,k as Mt,o as xt,v as ne,at as se,a1 as ie,a9 as ae,aj as oe,ap as le,M as gt,x as D,N as Tt,L as ce}from"./index-BdyNnuNw.js";import{f as ue,A as he}from"./attachment-upload-BMjVTZmk.js";const de=new Set(["png","jpg","jpeg","gif","webp"]),fe=new Set(["wav","mp3","m4a","ogg","webm"]),pe=new Set(["mp4"]),me=new Set(["txt","json","csv","yaml","yml","svg","tsv","log"]);function ge(y){const S=y.toLowerCase();return de.has(S)?"image":S==="pdf"?"pdf":fe.has(S)?"audio":pe.has(S)?"video":me.has(S)?"text":"unsupported"}function _e(y){return ge(ue(y))}function be(y){return y==="image"||y==="pdf"||y==="audio"||y==="video"}function $t(y){return typeof y.text=="function"?y.text():new Promise((S,o)=>{const b=new FileReader;b.onload=()=>S(b.result),b.onerror=()=>o(b.error??new Error("FileReader failed")),b.readAsText(y)})}function ye(y){const S=new Map,o=new Map;for(const b of y){const h=b.filename.toLowerCase();S.has(h)||S.set(h,b),o.set(Nt(b.sourcePath),b)}return{byBasename:S,byPath:o}}function Nt(y){let S=y.trim();try{S=decodeURIComponent(S)}catch{}return S=S.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,""),S.toLowerCase()}function Ct(y){const S=Nt(y),o=S.lastIndexOf("/");return o>=0?S.slice(o+1):S}function Bt(y){return/\.[a-z0-9]+$/i.test(Ct(y))}function Dt(y,S){const o=Nt(S),b=y.byPath.get(o);if(b)return b;for(const[h,i]of y.byPath)if(h===o||h.endsWith(`/${o}`))return i;return y.byBasename.get(Ct(S))??null}function Ft(y,S){const o=`/api/storage/${y.storagePath}`,b=S||y.filename;return y.isImage?`![${b}](${o})`:`[${b}](${o})`}function ve(y,S){let o=0;const b=new Set,h=/(!?)\[\[([^\]|#]+)(?:[#|][^\]]*)?\]\]/g,i=y.replace(h,(c,m,v)=>{if(!Bt(v))return c;const _=Dt(S,v);return _?(o++,b.add(_.sourcePath),Ft(_,Ct(v))):c}),n=/(!?)\[([^\]]*)\]\(\s*(<[^>]+>|[^)\s]+)(\s+[^)]*)?\)/g;return{content:i.replace(n,(c,m,v,_,w)=>{const s=_.startsWith("<")&&_.endsWith(">")?_.slice(1,-1):_;if(/^(https?:|mailto:|tel:|#|\/api\/storage\/)/i.test(s.trim())||!Bt(s))return c;const d=Dt(S,s);if(!d)return c;o++,b.add(d.sourcePath);const a=v.trim()||Ct(s);return Ft(d,a)}),rewritten:o,referenced:b}}const we=5,xe=500;async function It(y){const{client:S,notes:o,onProgress:b,signal:h}=y,i=Math.max(1,y.concurrency??we),n=[];let r=0,c=0,m=!1;const v=o.map(ze);async function _(){for(;;){if(h!=null&&h.aborted||m)return;const l=r++;if(l>=o.length)return;const u=o[l],p=v[l],k=await ke(S,u,p,h);n[l]=k,c++,k.status==="errored"&&k.reason.startsWith("auth:")&&(m=!0),b==null||b({done:c,total:o.length})}}const w=Array.from({length:Math.min(i,o.length)},()=>_());await Promise.all(w);for(let l=0;l<o.length;l++)n[l]||(n[l]={status:"errored",sourcePath:o[l].sourcePath,reason:m?"Skipped — vault session ended before this note was reached.":"Skipped — import was cancelled."});let s=0,d=0,a=0;for(const l of n)l.status==="created"?s++:l.status==="skipped"?d++:a++;return{created:s,skipped:d,errored:a,outcomes:n}}async function ke(y,S,o,b){try{const h=await Se(y,o,b);return{status:"created",sourcePath:S.sourcePath,noteId:h.id}}catch(h){return h instanceof te||h instanceof ee?{status:"skipped",sourcePath:S.sourcePath,reason:h.message||"Already exists in vault"}:h instanceof re?{status:"errored",sourcePath:S.sourcePath,reason:`auth: ${h.message}`}:h instanceof Mt?{status:"errored",sourcePath:S.sourcePath,reason:`vault unreachable (${h.status}): ${h.message}`}:{status:"errored",sourcePath:S.sourcePath,reason:h instanceof Error?h.message:String(h)}}}async function Se(y,S,o){const b={};o&&(b.signal=o);try{return await y.createNote(S,b)}catch(h){if(!Ce(h)||o!=null&&o.aborted)throw h;return await Ee(xe,o),await y.createNote(S,b)}}function Ce(y){return y instanceof Mt}function Ee(y,S){return new Promise(o=>{const b=setTimeout(()=>{S==null||S.removeEventListener("abort",h),o()},y),h=()=>{clearTimeout(b),o()};S&&S.addEventListener("abort",h,{once:!0})})}function ze(y){const S={content:y.content};y.path&&(S.path=y.path),y.tags.length>0&&(S.tags=y.tags),Object.keys(y.metadata).length>0&&(S.metadata=y.metadata);const o=S;return y.id&&(o.id=y.id),y.createdAt&&(o.created_at=y.createdAt),S}const Lt="Imported files",Ae=20;async function Ie(y){const{client:S,parsed:o,signal:b}=y,h=[],i=[],n=[],r=[];for(const l of o.attachments)be(l.kind)?i.push(l):l.kind==="text"?n.push(l):r.push(l);const c=new Map;for(const l of i){if(b!=null&&b.aborted){h.push({status:"skipped",sourcePath:l.sourcePath,reason:"Skipped — import was cancelled."});continue}try{const u=new File([l.blob],l.filename,{type:l.blob.type||void 0}),p=await S.uploadStorageFile(u,{signal:b});c.set(l.sourcePath,{attachment:l,storagePath:p.path,mimeType:p.mimeType,isImage:p.mimeType.startsWith("image/")})}catch(u){h.push({status:"errored",sourcePath:l.sourcePath,reason:`Upload failed: ${u instanceof Error?u.message:String(u)}`})}}const m=Ne(c),v=new Map,_=o.notes.map(l=>{const{content:u,referenced:p}=ve(l.content,m);return v.set(l.sourcePath,p),{...l,content:u}}),w=await It({client:S,notes:_,...y.concurrency!==void 0?{concurrency:y.concurrency}:{},...y.onProgress?{onProgress:y.onProgress}:{},...b?{signal:b}:{}}),s=new Map;for(const l of w.outcomes)l.status==="created"&&s.set(l.sourcePath,l.noteId);const d=new Map;for(const[l,u]of v){const p=s.get(l);if(p)for(const k of u){let E=d.get(k);E||(E=new Set,d.set(k,E)),E.add(p)}}for(const[l,u]of c){const p=d.get(l);if(!p||p.size===0)continue;let k=0;for(const E of p){if(b!=null&&b.aborted)break;try{await S.linkAttachment(E,{path:u.storagePath,mimeType:u.mimeType}),k++}catch{}}h.push({status:"uploaded",sourcePath:l,storagePath:u.storagePath,references:k})}if(n.length>0&&!(b!=null&&b.aborted)){const l=[];for(const p of n)l.push(await je(p));const u=await It({client:S,notes:l,...y.concurrency!==void 0?{concurrency:y.concurrency}:{},...b?{signal:b}:{}});for(let p=0;p<n.length;p++){const k=n[p],E=u.outcomes[p];(E==null?void 0:E.status)==="created"?h.push({status:"uploaded",sourcePath:k.sourcePath,storagePath:`note:${E.noteId}`,references:1,asNote:!0}):h.push({status:"skipped",sourcePath:k.sourcePath,reason:(E==null?void 0:E.status)==="skipped"?`Imported as note, but ${E.reason}`:`Could not import as note: ${(E==null?void 0:E.status)==="errored"?E.reason:"unknown"}`})}}else if(n.length>0)for(const l of n)h.push({status:"skipped",sourcePath:l.sourcePath,reason:"Skipped — import was cancelled."});const a=[...c.entries()].filter(([l])=>{var u;return!(((u=d.get(l))==null?void 0:u.size)??0)}).map(([,l])=>l);if(a.length>0)if(b!=null&&b.aborted)for(const l of a)h.push({status:"uploaded",sourcePath:l.attachment.sourcePath,storagePath:l.storagePath,references:0});else await Re(S,a,h,y.concurrency,b);for(const l of r)h.push({status:"skipped",sourcePath:l.sourcePath,reason:`.${l.ext||"?"} is not a vault storage type — not imported. (Re-save it in a supported format to bring it across.)`});return Te(w,h)}function Ne(y){return ye([...y.values()].map(S=>({sourcePath:S.attachment.sourcePath,storagePath:S.storagePath,isImage:S.isImage,filename:S.attachment.filename})))}async function je(y){let S="";try{S=await $t(y.blob)}catch{S=""}const o=Pe(y.ext)?`\`\`\`${Oe(y.ext)}
2
2
  ${S}
3
3
  \`\`\`
4
4
  `:`${S}
@@ -6,7 +6,7 @@ ${S}
6
6
  `)}
7
7
  `,tags:["imported-file"],metadata:{}},_=(await It({client:y,notes:[m],...b!==void 0?{concurrency:b}:{}})).outcomes[0];if((_==null?void 0:_.status)==="created")n=_.noteId;else if((_==null?void 0:_.status)!=="skipped")break}for(const r of S){if(n)try{await y.linkAttachment(n,{path:r.storagePath,mimeType:r.mimeType})}catch{}o.push({status:"uploaded",sourcePath:r.attachment.sourcePath,storagePath:r.storagePath,references:n?1:0})}}function Te(y,S){let o=0,b=0,h=0,i=0;for(const n of S)n.status==="uploaded"?n.asNote?b++:o++:n.status==="skipped"?h++:i++;return{...y,attachmentsUploaded:o,filesImportedAsNotes:b,attachmentsSkipped:h,attachmentsErrored:i,attachmentOutcomes:S}}function Be(y){return y.length===0?"unknown":y.some(Ht)?"obsidian-zip":y.some(jt)?"loose-markdown":"unknown"}function Ht(y){return y.name.toLowerCase().endsWith(".zip")}function jt(y){const S=y.name.toLowerCase();return S.endsWith(".md")||S.endsWith(".markdown")}function De(y){const S=y.charCodeAt(0)===65279?y.slice(1):y,o=S.split(/\r?\n/);if(o[0]!=="---")return{data:{},content:S};let b=-1;for(let n=1;n<o.length;n++)if(o[n]==="---"){b=n;break}if(b===-1)return{data:{},content:S};const h=o.slice(1,b).join(`
8
8
  `),i=o.slice(b+1).join(`
9
- `);return{data:Fe(h),content:i}}function Fe(y){const S=y.split(/\r?\n/),o={};let b=0;for(;b<S.length;){const h=S[b]??"";if(h.trim()===""||h.trimStart().startsWith("#")){b++;continue}const i=h.match(/^([\w][\w.-]*)\s*:\s*(.*)$/);if(!i){b++;continue}const n=i[1],r=(i[2]??"").trim();if(r===""){const c=Ue(S,b+1);if(c!=null&&c.line.trimStart().startsWith("- ")){const{items:m,consumed:v}=Le(S,b+1,c.indent);o[n]=m,b=b+1+v}else o[n]="",b++}else o[n]=Pt(r),b++}return o}function Le(y,S,o){const b=[];let h=S;for(;h<y.length;){const i=y[h]??"";if(i.trim()===""){h++;continue}const n=Gt(i);if(n<o||!i.slice(n).startsWith("- "))break;const r=i.slice(n+2).trim();b.push(Pt(r)),h++}return{items:b,consumed:h-S}}function Ue(y,S){for(let o=S;o<y.length;o++){const b=y[o]??"";if(b.trim()!=="")return{line:b,indent:Gt(b)}}return null}function Gt(y){let S=0;for(;S<y.length&&y[S]===" ";)S++;return S}function Pt(y){if(y.length===0)return"";if(y.startsWith("[")&&y.endsWith("]")){const S=y.slice(1,-1).trim();return S===""?[]:We(S).map(o=>Pt(o.trim()))}if(y.startsWith('"')&&y.endsWith('"')&&y.length>=2)return y.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\");if(y.startsWith("'")&&y.endsWith("'")&&y.length>=2)return y.slice(1,-1).replace(/''/g,"'");if(y==="true")return!0;if(y==="false")return!1;if(y==="null"||y==="~")return null;if(/^-?\d+(\.\d+)?$/.test(y)){const S=Number(y);return Number.isFinite(S)?S:y}return y}function We(y){const S=[];let o=0,b=null,h=0;for(let i=0;i<y.length;i++){const n=y[i];if(b){n===b&&(b=null);continue}if(n==='"'||n==="'"){b=n;continue}n==="["?o++:n==="]"?o--:n===","&&o===0&&(S.push(y.slice(h,i)),h=i+1)}return S.push(y.slice(h)),S}function Kt(y){const{sourcePath:S,raw:o}=y,{data:b,content:h}=De(o),i=Ze(b,S),n=Vt(b,"id"),r=kt(b,"created_at")??kt(b,"createdAt"),c=kt(b,"updated_at")??kt(b,"updatedAt"),m=He(b,h),v=new Set(["id","path","tags","created_at","createdAt","updated_at","updatedAt"]),_={};for(const[s,d]of Object.entries(b))v.has(s)||(_[s]=d);const w={sourcePath:S,path:i,content:h,tags:m,metadata:_};return n&&(w.id=n),r&&(w.createdAt=r),c&&(w.updatedAt=c),w}function Ze(y,S){const o=Vt(y,"path");return Wt(Ut(o||S))}function Vt(y,S){const o=y[S];if(typeof o=="string"&&o.trim()!=="")return o.trim()}function kt(y,S){const o=y[S];if(typeof o=="string"&&o.trim()!=="")return o.trim();if(typeof o=="number")return String(o)}function Ut(y){return y.replace(/\.(md|markdown)$/i,"")}function Wt(y){return y.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+|\/+$/g,"")}const Me=/(?:^|\s)#([A-Za-z0-9_/-]*[A-Za-z_/-][A-Za-z0-9_/-]*)/g;function $e(y){return y.replace(/```[\s\S]*?```/g,"").replace(/`[^`\n]+`/g,"")}function He(y,S){const o=new Set,b=y.tags;if(Array.isArray(b))for(const i of b){const n=zt(i);n&&o.add(n)}else if(typeof b=="string")for(const i of b.split(/[,\s]+/)){const n=zt(i);n&&o.add(n)}const h=$e(S);for(const i of h.matchAll(Me)){const n=zt(i[1]??"");n&&o.add(n)}return[...o]}function zt(y){if(typeof y!="string")return typeof y=="number"||typeof y=="boolean"?String(y).toLowerCase():null;const S=y.trim().replace(/^#/,"").toLowerCase();return!S||!/^[a-z0-9_/-]+$/.test(S)?null:S}async function Ge(y){const S=[],o=[];for(const b of y){if(!jt(b)){o.push({sourcePath:b.name,reason:"Not a markdown file (.md / .markdown) — skipped."});continue}try{const h=await $t(b),i=b.webkitRelativePath||b.name,n=Kt({sourcePath:i,raw:h});S.push(n)}catch(h){o.push({sourcePath:b.name,reason:h instanceof Error?h.message:String(h)})}}return{format:"loose-markdown",notes:S,errors:o,tags:Ke(S),attachments:[]}}function Ke(y){const S=new Set;for(const o of y)for(const b of o.tags)S.add(b);return[...S].sort()}function St(y){throw new Error('Could not dynamically require "'+y+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var At={exports:{}};/*!
9
+ `);return{data:Fe(h),content:i}}function Fe(y){const S=y.split(/\r?\n/),o={};let b=0;for(;b<S.length;){const h=S[b]??"";if(h.trim()===""||h.trimStart().startsWith("#")){b++;continue}const i=h.match(/^([\w][\w.-]*)\s*:\s*(.*)$/);if(!i){b++;continue}const n=i[1],r=(i[2]??"").trim();if(r===""){const c=Ue(S,b+1);if(c!=null&&c.line.trimStart().startsWith("- ")){const{items:m,consumed:v}=Le(S,b+1,c.indent);o[n]=m,b=b+1+v}else o[n]="",b++}else o[n]=Pt(r),b++}return o}function Le(y,S,o){const b=[];let h=S;for(;h<y.length;){const i=y[h]??"";if(i.trim()===""){h++;continue}const n=Gt(i);if(n<o||!i.slice(n).startsWith("- "))break;const r=i.slice(n+2).trim();b.push(Pt(r)),h++}return{items:b,consumed:h-S}}function Ue(y,S){for(let o=S;o<y.length;o++){const b=y[o]??"";if(b.trim()!=="")return{line:b,indent:Gt(b)}}return null}function Gt(y){let S=0;for(;S<y.length&&y[S]===" ";)S++;return S}function Pt(y){if(y.length===0)return"";if(y.startsWith("[")&&y.endsWith("]")){const S=y.slice(1,-1).trim();return S===""?[]:We(S).map(o=>Pt(o.trim()))}if(y.startsWith('"')&&y.endsWith('"')&&y.length>=2)return y.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\");if(y.startsWith("'")&&y.endsWith("'")&&y.length>=2)return y.slice(1,-1).replace(/''/g,"'");if(y==="true")return!0;if(y==="false")return!1;if(y==="null"||y==="~")return null;if(/^-?\d+(\.\d+)?$/.test(y)){const S=Number(y);return Number.isFinite(S)?S:y}return y}function We(y){const S=[];let o=0,b=null,h=0;for(let i=0;i<y.length;i++){const n=y[i];if(b){n===b&&(b=null);continue}if(n==='"'||n==="'"){b=n;continue}n==="["?o++:n==="]"?o--:n===","&&o===0&&(S.push(y.slice(h,i)),h=i+1)}return S.push(y.slice(h)),S}function Vt(y){const{sourcePath:S,raw:o}=y,{data:b,content:h}=De(o),i=Ze(b,S),n=Xt(b,"id"),r=kt(b,"created_at")??kt(b,"createdAt"),c=kt(b,"updated_at")??kt(b,"updatedAt"),m=He(b,h),v=new Set(["id","path","tags","created_at","createdAt","updated_at","updatedAt"]),_={};for(const[s,d]of Object.entries(b))v.has(s)||(_[s]=d);const w={sourcePath:S,path:i,content:h,tags:m,metadata:_};return n&&(w.id=n),r&&(w.createdAt=r),c&&(w.updatedAt=c),w}function Ze(y,S){const o=Xt(y,"path");return Wt(Ut(o||S))}function Xt(y,S){const o=y[S];if(typeof o=="string"&&o.trim()!=="")return o.trim()}function kt(y,S){const o=y[S];if(typeof o=="string"&&o.trim()!=="")return o.trim();if(typeof o=="number")return String(o)}function Ut(y){return y.replace(/\.(md|markdown)$/i,"")}function Wt(y){return y.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+|\/+$/g,"")}const Me=/(?:^|\s)#([A-Za-z0-9_/-]*[A-Za-z_/-][A-Za-z0-9_/-]*)/g;function $e(y){return y.replace(/```[\s\S]*?```/g,"").replace(/`[^`\n]+`/g,"")}function He(y,S){const o=new Set,b=y.tags;if(Array.isArray(b))for(const i of b){const n=zt(i);n&&o.add(n)}else if(typeof b=="string")for(const i of b.split(/[,\s]+/)){const n=zt(i);n&&o.add(n)}const h=$e(S);for(const i of h.matchAll(Me)){const n=zt(i[1]??"");n&&o.add(n)}return[...o]}function zt(y){if(typeof y!="string")return typeof y=="number"||typeof y=="boolean"?String(y).toLowerCase():null;const S=y.trim().replace(/^#/,"").toLowerCase();return!S||!/^[a-z0-9_/-]+$/.test(S)?null:S}async function Ge(y){const S=[],o=[];for(const b of y){if(!jt(b)){o.push({sourcePath:b.name,reason:"Not a markdown file (.md / .markdown) — skipped."});continue}try{const h=await $t(b),i=b.webkitRelativePath||b.name,n=Vt({sourcePath:i,raw:h});S.push(n)}catch(h){o.push({sourcePath:b.name,reason:h instanceof Error?h.message:String(h)})}}return{format:"loose-markdown",notes:S,errors:o,tags:Ve(S),attachments:[]}}function Ve(y){const S=new Set;for(const o of y)for(const b of o.tags)S.add(b);return[...S].sort()}function St(y){throw new Error('Could not dynamically require "'+y+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var At={exports:{}};/*!
10
10
 
11
11
  JSZip v3.10.1 - A JavaScript class for generating and reading zip files
12
12
  <http://stuartk.com/jszip>
@@ -16,5 +16,5 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js
16
16
 
17
17
  JSZip uses the library pako released under the MIT license :
18
18
  https://github.com/nodeca/pako/blob/main/LICENSE
19
- */var Zt;function Ve(){return Zt||(Zt=1,(function(y,S){(function(o){y.exports=o()})(function(){return(function o(b,h,i){function n(m,v){if(!h[m]){if(!b[m]){var _=typeof St=="function"&&St;if(!v&&_)return _(m,!0);if(r)return r(m,!0);var w=new Error("Cannot find module '"+m+"'");throw w.code="MODULE_NOT_FOUND",w}var s=h[m]={exports:{}};b[m][0].call(s.exports,function(d){var a=b[m][1][d];return n(a||d)},s,s.exports,o,b,h,i)}return h[m].exports}for(var r=typeof St=="function"&&St,c=0;c<i.length;c++)n(i[c]);return n})({1:[function(o,b,h){var i=o("./utils"),n=o("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";h.encode=function(c){for(var m,v,_,w,s,d,a,l=[],u=0,p=c.length,k=p,E=i.getTypeOf(c)!=="string";u<c.length;)k=p-u,_=E?(m=c[u++],v=u<p?c[u++]:0,u<p?c[u++]:0):(m=c.charCodeAt(u++),v=u<p?c.charCodeAt(u++):0,u<p?c.charCodeAt(u++):0),w=m>>2,s=(3&m)<<4|v>>4,d=1<k?(15&v)<<2|_>>6:64,a=2<k?63&_:64,l.push(r.charAt(w)+r.charAt(s)+r.charAt(d)+r.charAt(a));return l.join("")},h.decode=function(c){var m,v,_,w,s,d,a=0,l=0,u="data:";if(c.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var p,k=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===r.charAt(64)&&k--,c.charAt(c.length-2)===r.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=n.uint8array?new Uint8Array(0|k):new Array(0|k);a<c.length;)m=r.indexOf(c.charAt(a++))<<2|(w=r.indexOf(c.charAt(a++)))>>4,v=(15&w)<<4|(s=r.indexOf(c.charAt(a++)))>>2,_=(3&s)<<6|(d=r.indexOf(c.charAt(a++))),p[l++]=m,s!==64&&(p[l++]=v),d!==64&&(p[l++]=_);return p}},{"./support":30,"./utils":32}],2:[function(o,b,h){var i=o("./external"),n=o("./stream/DataWorker"),r=o("./stream/Crc32Probe"),c=o("./stream/DataLengthProbe");function m(v,_,w,s,d){this.compressedSize=v,this.uncompressedSize=_,this.crc32=w,this.compression=s,this.compressedContent=d}m.prototype={getContentWorker:function(){var v=new n(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("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 n(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},m.createWorkerFrom=function(v,_,w){return v.pipe(new r).pipe(new c("uncompressedSize")).pipe(_.compressWorker(w)).pipe(new c("compressedSize")).withStreamInfo("compression",_)},b.exports=m},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(o,b,h){var i=o("./stream/GenericWorker");h.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},h.DEFLATE=o("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(o,b,h){var i=o("./utils"),n=(function(){for(var r,c=[],m=0;m<256;m++){r=m;for(var v=0;v<8;v++)r=1&r?3988292384^r>>>1:r>>>1;c[m]=r}return c})();b.exports=function(r,c){return r!==void 0&&r.length?i.getTypeOf(r)!=="string"?(function(m,v,_,w){var s=n,d=w+_;m^=-1;for(var a=w;a<d;a++)m=m>>>8^s[255&(m^v[a])];return-1^m})(0|c,r,r.length,0):(function(m,v,_,w){var s=n,d=w+_;m^=-1;for(var a=w;a<d;a++)m=m>>>8^s[255&(m^v.charCodeAt(a))];return-1^m})(0|c,r,r.length,0):0}},{"./utils":32}],5:[function(o,b,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,b,h){var i=null;i=typeof Promise<"u"?Promise:o("lie"),b.exports={Promise:i}},{lie:37}],7:[function(o,b,h){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",n=o("pako"),r=o("./utils"),c=o("./stream/GenericWorker"),m=i?"uint8array":"array";function v(_,w){c.call(this,"FlateWorker/"+_),this._pako=null,this._pakoAction=_,this._pakoOptions=w,this.meta={}}h.magic="\b\0",r.inherits(v,c),v.prototype.processChunk=function(_){this.meta=_.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(m,_.data),!1)},v.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var _=this;this._pako.onData=function(w){_.push({data:w,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,b,h){function i(s,d){var a,l="";for(a=0;a<d;a++)l+=String.fromCharCode(255&s),s>>>=8;return l}function n(s,d,a,l,u,p){var k,E,z=s.file,F=s.compression,O=p!==m.utf8encode,Z=r.transformTo("string",p(z.name)),P=r.transformTo("string",m.utf8encode(z.name)),H=z.comment,J=r.transformTo("string",p(H)),x=r.transformTo("string",m.utf8encode(H)),R=P.length!==z.name.length,e=x.length!==H.length,B="",tt="",W="",et=z.dir,M=z.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};d&&!a||(Q.crc32=s.crc32,Q.compressedSize=s.compressedSize,Q.uncompressedSize=s.uncompressedSize);var N=0;d&&(N|=8),O||!R&&!e||(N|=2048);var I=0,q=0;et&&(I|=16),u==="UNIX"?(q=798,I|=(function(K,at){var ut=K;return K||(ut=at?16893:33204),(65535&ut)<<16})(z.unixPermissions,et)):(q=20,I|=(function(K){return 63&(K||0)})(z.dosPermissions)),k=M.getUTCHours(),k<<=6,k|=M.getUTCMinutes(),k<<=5,k|=M.getUTCSeconds()/2,E=M.getUTCFullYear()-1980,E<<=4,E|=M.getUTCMonth()+1,E<<=5,E|=M.getUTCDate(),R&&(tt=i(1,1)+i(v(Z),4)+P,B+="up"+i(tt.length,2)+tt),e&&(W=i(1,1)+i(v(J),4)+x,B+="uc"+i(W.length,2)+W);var V="";return V+=`
20
- \0`,V+=i(N,2),V+=F.magic,V+=i(k,2),V+=i(E,2),V+=i(Q.crc32,4),V+=i(Q.compressedSize,4),V+=i(Q.uncompressedSize,4),V+=i(Z.length,2),V+=i(B.length,2),{fileRecord:_.LOCAL_FILE_HEADER+V+Z+B,dirRecord:_.CENTRAL_FILE_HEADER+i(q,2)+V+i(J.length,2)+"\0\0\0\0"+i(I,4)+i(l,4)+Z+B+J}}var r=o("../utils"),c=o("../stream/GenericWorker"),m=o("../utf8"),v=o("../crc32"),_=o("../signature");function w(s,d,a,l){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=a,this.encodeFileName=l,this.streamFiles=s,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(w,c),w.prototype.push=function(s){var d=s.meta.percent||0,a=this.entriesCount,l=this._sources.length;this.accumulate?this.contentBuffer.push(s):(this.bytesWritten+=s.data.length,c.prototype.push.call(this,{data:s.data,meta:{currentFile:this.currentFile,percent:a?(d+100*(a-l-1))/a:100}}))},w.prototype.openedSource=function(s){this.currentSourceOffset=this.bytesWritten,this.currentFile=s.file.name;var d=this.streamFiles&&!s.file.dir;if(d){var a=n(s,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:a.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(s){this.accumulate=!1;var d=this.streamFiles&&!s.file.dir,a=n(s,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(a.dirRecord),d)this.push({data:(function(l){return _.DATA_DESCRIPTOR+i(l.crc32,4)+i(l.compressedSize,4)+i(l.uncompressedSize,4)})(s),meta:{percent:100}});else for(this.push({data:a.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var s=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var a=this.bytesWritten-s,l=(function(u,p,k,E,z){var F=r.transformTo("string",z(E));return _.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(u,2)+i(u,2)+i(p,4)+i(k,4)+i(F.length,2)+F})(this.dirRecords.length,a,s,this.zipComment,this.encodeFileName);this.push({data:l,meta:{percent:100}})},w.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},w.prototype.registerPrevious=function(s){this._sources.push(s);var d=this;return s.on("data",function(a){d.processChunk(a)}),s.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),s.on("error",function(a){d.error(a)}),this},w.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},w.prototype.error=function(s){var d=this._sources;if(!c.prototype.error.call(this,s))return!1;for(var a=0;a<d.length;a++)try{d[a].error(s)}catch{}return!0},w.prototype.lock=function(){c.prototype.lock.call(this);for(var s=this._sources,d=0;d<s.length;d++)s[d].lock()},b.exports=w},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(o,b,h){var i=o("../compressions"),n=o("./ZipFileWorker");h.generateWorker=function(r,c,m){var v=new n(c.streamFiles,m,c.platform,c.encodeFileName),_=0;try{r.forEach(function(w,s){_++;var d=(function(p,k){var E=p||k,z=i[E];if(!z)throw new Error(E+" is not a valid compression method !");return z})(s.options.compression,c.compression),a=s.options.compressionOptions||c.compressionOptions||{},l=s.dir,u=s.date;s._compressWorker(d,a).withStreamInfo("file",{name:w,dir:l,date:u,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(v)}),v.entriesCount=_}catch(w){v.error(w)}return v}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(o,b,h){function i(){if(!(this instanceof i))return new i;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 n=new i;for(var r in this)typeof this[r]!="function"&&(n[r]=this[r]);return n}}(i.prototype=o("./object")).loadAsync=o("./load"),i.support=o("./support"),i.defaults=o("./defaults"),i.version="3.10.1",i.loadAsync=function(n,r){return new i().loadAsync(n,r)},i.external=o("./external"),b.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(o,b,h){var i=o("./utils"),n=o("./external"),r=o("./utf8"),c=o("./zipEntries"),m=o("./stream/Crc32Probe"),v=o("./nodejsUtils");function _(w){return new n.Promise(function(s,d){var a=w.decompressed.getContentWorker().pipe(new m);a.on("error",function(l){d(l)}).on("end",function(){a.streamInfo.crc32!==w.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):s()}).resume()})}b.exports=function(w,s){var d=this;return s=i.extend(s||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),v.isNode&&v.isStream(w)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",w,!0,s.optimizedBinaryString,s.base64).then(function(a){var l=new c(s);return l.load(a),l}).then(function(a){var l=[n.Promise.resolve(a)],u=a.files;if(s.checkCRC32)for(var p=0;p<u.length;p++)l.push(_(u[p]));return n.Promise.all(l)}).then(function(a){for(var l=a.shift(),u=l.files,p=0;p<u.length;p++){var k=u[p],E=k.fileNameStr,z=i.resolve(k.fileNameStr);d.file(z,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:s.createFolders}),k.dir||(d.file(z).unsafeOriginalName=E)}return l.zipComment.length&&(d.comment=l.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(o,b,h){var i=o("../utils"),n=o("../stream/GenericWorker");function r(c,m){n.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(m)}i.inherits(r,n),r.prototype._bindStream=function(c){var m=this;(this._stream=c).pause(),c.on("data",function(v){m.push({data:v,meta:{percent:0}})}).on("error",function(v){m.isPaused?this.generatedError=v:m.error(v)}).on("end",function(){m.isPaused?m._upstreamEnded=!0:m.end()})},r.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},b.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(o,b,h){var i=o("readable-stream").Readable;function n(r,c,m){i.call(this,c),this._helper=r;var v=this;r.on("data",function(_,w){v.push(_)||v._helper.pause(),m&&m(w)}).on("error",function(_){v.emit("error",_)}).on("end",function(){v.push(null)})}o("../utils").inherits(n,i),n.prototype._read=function(){this._helper.resume()},b.exports=n},{"../utils":32,"readable-stream":16}],14:[function(o,b,h){b.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,n){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,n);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,n)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var n=new Buffer(i);return n.fill(0),n},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(o,b,h){function i(z,F,O){var Z,P=r.getTypeOf(F),H=r.extend(O||{},v);H.date=H.date||new Date,H.compression!==null&&(H.compression=H.compression.toUpperCase()),typeof H.unixPermissions=="string"&&(H.unixPermissions=parseInt(H.unixPermissions,8)),H.unixPermissions&&16384&H.unixPermissions&&(H.dir=!0),H.dosPermissions&&16&H.dosPermissions&&(H.dir=!0),H.dir&&(z=u(z)),H.createFolders&&(Z=l(z))&&p.call(this,Z,!0);var J=P==="string"&&H.binary===!1&&H.base64===!1;O&&O.binary!==void 0||(H.binary=!J),(F instanceof _&&F.uncompressedSize===0||H.dir||!F||F.length===0)&&(H.base64=!1,H.binary=!0,F="",H.compression="STORE",P="string");var x=null;x=F instanceof _||F instanceof c?F:d.isNode&&d.isStream(F)?new a(z,F):r.prepareContent(z,F,H.binary,H.optimizedBinaryString,H.base64);var R=new w(z,x,H);this.files[z]=R}var n=o("./utf8"),r=o("./utils"),c=o("./stream/GenericWorker"),m=o("./stream/StreamHelper"),v=o("./defaults"),_=o("./compressedObject"),w=o("./zipObject"),s=o("./generate"),d=o("./nodejsUtils"),a=o("./nodejs/NodejsStreamInputAdapter"),l=function(z){z.slice(-1)==="/"&&(z=z.substring(0,z.length-1));var F=z.lastIndexOf("/");return 0<F?z.substring(0,F):""},u=function(z){return z.slice(-1)!=="/"&&(z+="/"),z},p=function(z,F){return F=F!==void 0?F:v.createFolders,z=u(z),this.files[z]||i.call(this,z,null,{dir:!0,createFolders:F}),this.files[z]};function k(z){return Object.prototype.toString.call(z)==="[object RegExp]"}var E={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(z){var F,O,Z;for(F in this.files)Z=this.files[F],(O=F.slice(this.root.length,F.length))&&F.slice(0,this.root.length)===this.root&&z(O,Z)},filter:function(z){var F=[];return this.forEach(function(O,Z){z(O,Z)&&F.push(Z)}),F},file:function(z,F,O){if(arguments.length!==1)return z=this.root+z,i.call(this,z,F,O),this;if(k(z)){var Z=z;return this.filter(function(H,J){return!J.dir&&Z.test(H)})}var P=this.files[this.root+z];return P&&!P.dir?P:null},folder:function(z){if(!z)return this;if(k(z))return this.filter(function(P,H){return H.dir&&z.test(P)});var F=this.root+z,O=p.call(this,F),Z=this.clone();return Z.root=O.name,Z},remove:function(z){z=this.root+z;var F=this.files[z];if(F||(z.slice(-1)!=="/"&&(z+="/"),F=this.files[z]),F&&!F.dir)delete this.files[z];else for(var O=this.filter(function(P,H){return H.name.slice(0,z.length)===z}),Z=0;Z<O.length;Z++)delete this.files[O[Z].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(z){var F,O={};try{if((O=r.extend(z||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=O.type.toLowerCase(),O.compression=O.compression.toUpperCase(),O.type==="binarystring"&&(O.type="string"),!O.type)throw new Error("No output type specified.");r.checkSupport(O.type),O.platform!=="darwin"&&O.platform!=="freebsd"&&O.platform!=="linux"&&O.platform!=="sunos"||(O.platform="UNIX"),O.platform==="win32"&&(O.platform="DOS");var Z=O.comment||this.comment||"";F=s.generateWorker(this,O,Z)}catch(P){(F=new c("error")).error(P)}return new m(F,O.type||"string",O.mimeType)},generateAsync:function(z,F){return this.generateInternalStream(z).accumulate(F)},generateNodeStream:function(z,F){return(z=z||{}).type||(z.type="nodebuffer"),this.generateInternalStream(z).toNodejsStream(F)}};b.exports=E},{"./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,b,h){b.exports=o("stream")},{stream:void 0}],17:[function(o,b,h){var i=o("./DataReader");function n(r){i.call(this,r);for(var c=0;c<this.data.length;c++)r[c]=255&r[c]}o("../utils").inherits(n,i),n.prototype.byteAt=function(r){return this.data[this.zero+r]},n.prototype.lastIndexOfSignature=function(r){for(var c=r.charCodeAt(0),m=r.charCodeAt(1),v=r.charCodeAt(2),_=r.charCodeAt(3),w=this.length-4;0<=w;--w)if(this.data[w]===c&&this.data[w+1]===m&&this.data[w+2]===v&&this.data[w+3]===_)return w-this.zero;return-1},n.prototype.readAndCheckSignature=function(r){var c=r.charCodeAt(0),m=r.charCodeAt(1),v=r.charCodeAt(2),_=r.charCodeAt(3),w=this.readData(4);return c===w[0]&&m===w[1]&&v===w[2]&&_===w[3]},n.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},b.exports=n},{"../utils":32,"./DataReader":18}],18:[function(o,b,h){var i=o("../utils");function n(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var c,m=0;for(this.checkOffset(r),c=this.index+r-1;c>=this.index;c--)m=(m<<8)+this.byteAt(c);return this.index+=r,m},readString:function(r){return i.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},b.exports=n},{"../utils":32}],19:[function(o,b,h){var i=o("./Uint8ArrayReader");function n(r){i.call(this,r)}o("../utils").inherits(n,i),n.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},b.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(o,b,h){var i=o("./DataReader");function n(r){i.call(this,r)}o("../utils").inherits(n,i),n.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},n.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},n.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},n.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},b.exports=n},{"../utils":32,"./DataReader":18}],21:[function(o,b,h){var i=o("./ArrayReader");function n(r){i.call(this,r)}o("../utils").inherits(n,i),n.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},b.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(o,b,h){var i=o("../utils"),n=o("../support"),r=o("./ArrayReader"),c=o("./StringReader"),m=o("./NodeBufferReader"),v=o("./Uint8ArrayReader");b.exports=function(_){var w=i.getTypeOf(_);return i.checkSupport(w),w!=="string"||n.uint8array?w==="nodebuffer"?new m(_):n.uint8array?new v(i.transformTo("uint8array",_)):new r(i.transformTo("array",_)):new c(_)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(o,b,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,b,h){var i=o("./GenericWorker"),n=o("../utils");function r(c){i.call(this,"ConvertWorker to "+c),this.destType=c}n.inherits(r,i),r.prototype.processChunk=function(c){this.push({data:n.transformTo(this.destType,c.data),meta:c.meta})},b.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(o,b,h){var i=o("./GenericWorker"),n=o("../crc32");function r(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}o("../utils").inherits(r,i),r.prototype.processChunk=function(c){this.streamInfo.crc32=n(c.data,this.streamInfo.crc32||0),this.push(c)},b.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(o,b,h){var i=o("../utils"),n=o("./GenericWorker");function r(c){n.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}i.inherits(r,n),r.prototype.processChunk=function(c){if(c){var m=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=m+c.data.length}n.prototype.processChunk.call(this,c)},b.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(o,b,h){var i=o("../utils"),n=o("./GenericWorker");function r(c){n.call(this,"DataWorker");var m=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(v){m.dataIsReady=!0,m.data=v,m.max=v&&v.length||0,m.type=i.getTypeOf(v),m.isPaused||m._tickAndRepeat()},function(v){m.error(v)})}i.inherits(r,n),r.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,m=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,m);break;case"uint8array":c=this.data.subarray(this.index,m);break;case"array":case"nodebuffer":c=this.data.slice(this.index,m)}return this.index=m,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},b.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(o,b,h){function i(n){this.name=n||"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}i.prototype={push:function(n){this.emit("data",n)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(n){this.emit("error",n)}return!0},error:function(n){return!this.isFinished&&(this.isPaused?this.generatedError=n:(this.isFinished=!0,this.emit("error",n),this.previous&&this.previous.error(n),this.cleanUp()),!0)},on:function(n,r){return this._listeners[n].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(n,r){if(this._listeners[n])for(var c=0;c<this._listeners[n].length;c++)this._listeners[n][c].call(this,r)},pipe:function(n){return n.registerPrevious(this)},registerPrevious:function(n){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=n.streamInfo,this.mergeStreamInfo(),this.previous=n;var r=this;return n.on("data",function(c){r.processChunk(c)}),n.on("end",function(){r.end()}),n.on("error",function(c){r.error(c)}),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 n=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),n=!0),this.previous&&this.previous.resume(),!n},flush:function(){},processChunk:function(n){this.push(n)},withStreamInfo:function(n,r){return this.extraStreamInfo[n]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var n in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,n)&&(this.streamInfo[n]=this.extraStreamInfo[n])},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 n="Worker "+this.name;return this.previous?this.previous+" -> "+n:n}},b.exports=i},{}],29:[function(o,b,h){var i=o("../utils"),n=o("./ConvertWorker"),r=o("./GenericWorker"),c=o("../base64"),m=o("../support"),v=o("../external"),_=null;if(m.nodestream)try{_=o("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(d,a){return new v.Promise(function(l,u){var p=[],k=d._internalType,E=d._outputType,z=d._mimeType;d.on("data",function(F,O){p.push(F),a&&a(O)}).on("error",function(F){p=[],u(F)}).on("end",function(){try{var F=(function(O,Z,P){switch(O){case"blob":return i.newBlob(i.transformTo("arraybuffer",Z),P);case"base64":return c.encode(Z);default:return i.transformTo(O,Z)}})(E,(function(O,Z){var P,H=0,J=null,x=0;for(P=0;P<Z.length;P++)x+=Z[P].length;switch(O){case"string":return Z.join("");case"array":return Array.prototype.concat.apply([],Z);case"uint8array":for(J=new Uint8Array(x),P=0;P<Z.length;P++)J.set(Z[P],H),H+=Z[P].length;return J;case"nodebuffer":return Buffer.concat(Z);default:throw new Error("concat : unsupported type '"+O+"'")}})(k,p),z);l(F)}catch(O){u(O)}p=[]}).resume()})}function s(d,a,l){var u=a;switch(a){case"blob":case"arraybuffer":u="uint8array";break;case"base64":u="string"}try{this._internalType=u,this._outputType=a,this._mimeType=l,i.checkSupport(u),this._worker=d.pipe(new n(u)),d.lock()}catch(p){this._worker=new r("error"),this._worker.error(p)}}s.prototype={accumulate:function(d){return w(this,d)},on:function(d,a){var l=this;return d==="data"?this._worker.on(d,function(u){a.call(l,u.data,u.meta)}):this._worker.on(d,function(){i.delay(a,arguments,l)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new _(this,{objectMode:this._outputType!=="nodebuffer"},d)}},b.exports=s},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(o,b,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 i=new ArrayBuffer(0);try{h.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(i),h.blob=n.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,b,h){for(var i=o("./utils"),n=o("./support"),r=o("./nodejsUtils"),c=o("./stream/GenericWorker"),m=new Array(256),v=0;v<256;v++)m[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;m[254]=m[254]=1;function _(){c.call(this,"utf-8 decode"),this.leftOver=null}function w(){c.call(this,"utf-8 encode")}h.utf8encode=function(s){return n.nodebuffer?r.newBufferFrom(s,"utf-8"):(function(d){var a,l,u,p,k,E=d.length,z=0;for(p=0;p<E;p++)(64512&(l=d.charCodeAt(p)))==55296&&p+1<E&&(64512&(u=d.charCodeAt(p+1)))==56320&&(l=65536+(l-55296<<10)+(u-56320),p++),z+=l<128?1:l<2048?2:l<65536?3:4;for(a=n.uint8array?new Uint8Array(z):new Array(z),p=k=0;k<z;p++)(64512&(l=d.charCodeAt(p)))==55296&&p+1<E&&(64512&(u=d.charCodeAt(p+1)))==56320&&(l=65536+(l-55296<<10)+(u-56320),p++),l<128?a[k++]=l:(l<2048?a[k++]=192|l>>>6:(l<65536?a[k++]=224|l>>>12:(a[k++]=240|l>>>18,a[k++]=128|l>>>12&63),a[k++]=128|l>>>6&63),a[k++]=128|63&l);return a})(s)},h.utf8decode=function(s){return n.nodebuffer?i.transformTo("nodebuffer",s).toString("utf-8"):(function(d){var a,l,u,p,k=d.length,E=new Array(2*k);for(a=l=0;a<k;)if((u=d[a++])<128)E[l++]=u;else if(4<(p=m[u]))E[l++]=65533,a+=p-1;else{for(u&=p===2?31:p===3?15:7;1<p&&a<k;)u=u<<6|63&d[a++],p--;1<p?E[l++]=65533:u<65536?E[l++]=u:(u-=65536,E[l++]=55296|u>>10&1023,E[l++]=56320|1023&u)}return E.length!==l&&(E.subarray?E=E.subarray(0,l):E.length=l),i.applyFromCharCode(E)})(s=i.transformTo(n.uint8array?"uint8array":"array",s))},i.inherits(_,c),_.prototype.processChunk=function(s){var d=i.transformTo(n.uint8array?"uint8array":"array",s.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var a=d;(d=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),d.set(a,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var l=(function(p,k){var E;for((k=k||p.length)>p.length&&(k=p.length),E=k-1;0<=E&&(192&p[E])==128;)E--;return E<0||E===0?k:E+m[p[E]]>k?E:k})(d),u=d;l!==d.length&&(n.uint8array?(u=d.subarray(0,l),this.leftOver=d.subarray(l,d.length)):(u=d.slice(0,l),this.leftOver=d.slice(l,d.length))),this.push({data:h.utf8decode(u),meta:s.meta})},_.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:h.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},h.Utf8DecodeWorker=_,i.inherits(w,c),w.prototype.processChunk=function(s){this.push({data:h.utf8encode(s.data),meta:s.meta})},h.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(o,b,h){var i=o("./support"),n=o("./base64"),r=o("./nodejsUtils"),c=o("./external");function m(a){return a}function v(a,l){for(var u=0;u<a.length;++u)l[u]=255&a.charCodeAt(u);return l}o("setimmediate"),h.newBlob=function(a,l){h.checkSupport("blob");try{return new Blob([a],{type:l})}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return u.append(a),u.getBlob(l)}catch{throw new Error("Bug : can't construct the Blob.")}}};var _={stringifyByChunk:function(a,l,u){var p=[],k=0,E=a.length;if(E<=u)return String.fromCharCode.apply(null,a);for(;k<E;)l==="array"||l==="nodebuffer"?p.push(String.fromCharCode.apply(null,a.slice(k,Math.min(k+u,E)))):p.push(String.fromCharCode.apply(null,a.subarray(k,Math.min(k+u,E)))),k+=u;return p.join("")},stringifyByChar:function(a){for(var l="",u=0;u<a.length;u++)l+=String.fromCharCode(a[u]);return l},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function w(a){var l=65536,u=h.getTypeOf(a),p=!0;if(u==="uint8array"?p=_.applyCanBeUsed.uint8array:u==="nodebuffer"&&(p=_.applyCanBeUsed.nodebuffer),p)for(;1<l;)try{return _.stringifyByChunk(a,u,l)}catch{l=Math.floor(l/2)}return _.stringifyByChar(a)}function s(a,l){for(var u=0;u<a.length;u++)l[u]=a[u];return l}h.applyFromCharCode=w;var d={};d.string={string:m,array:function(a){return v(a,new Array(a.length))},arraybuffer:function(a){return d.string.uint8array(a).buffer},uint8array:function(a){return v(a,new Uint8Array(a.length))},nodebuffer:function(a){return v(a,r.allocBuffer(a.length))}},d.array={string:w,array:m,arraybuffer:function(a){return new Uint8Array(a).buffer},uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return r.newBufferFrom(a)}},d.arraybuffer={string:function(a){return w(new Uint8Array(a))},array:function(a){return s(new Uint8Array(a),new Array(a.byteLength))},arraybuffer:m,uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return r.newBufferFrom(new Uint8Array(a))}},d.uint8array={string:w,array:function(a){return s(a,new Array(a.length))},arraybuffer:function(a){return a.buffer},uint8array:m,nodebuffer:function(a){return r.newBufferFrom(a)}},d.nodebuffer={string:w,array:function(a){return s(a,new Array(a.length))},arraybuffer:function(a){return d.nodebuffer.uint8array(a).buffer},uint8array:function(a){return s(a,new Uint8Array(a.length))},nodebuffer:m},h.transformTo=function(a,l){if(l=l||"",!a)return l;h.checkSupport(a);var u=h.getTypeOf(l);return d[u][a](l)},h.resolve=function(a){for(var l=a.split("/"),u=[],p=0;p<l.length;p++){var k=l[p];k==="."||k===""&&p!==0&&p!==l.length-1||(k===".."?u.pop():u.push(k))}return u.join("/")},h.getTypeOf=function(a){return typeof a=="string"?"string":Object.prototype.toString.call(a)==="[object Array]"?"array":i.nodebuffer&&r.isBuffer(a)?"nodebuffer":i.uint8array&&a instanceof Uint8Array?"uint8array":i.arraybuffer&&a instanceof ArrayBuffer?"arraybuffer":void 0},h.checkSupport=function(a){if(!i[a.toLowerCase()])throw new Error(a+" is not supported by this platform")},h.MAX_VALUE_16BITS=65535,h.MAX_VALUE_32BITS=-1,h.pretty=function(a){var l,u,p="";for(u=0;u<(a||"").length;u++)p+="\\x"+((l=a.charCodeAt(u))<16?"0":"")+l.toString(16).toUpperCase();return p},h.delay=function(a,l,u){setImmediate(function(){a.apply(u||null,l||[])})},h.inherits=function(a,l){function u(){}u.prototype=l.prototype,a.prototype=new u},h.extend=function(){var a,l,u={};for(a=0;a<arguments.length;a++)for(l in arguments[a])Object.prototype.hasOwnProperty.call(arguments[a],l)&&u[l]===void 0&&(u[l]=arguments[a][l]);return u},h.prepareContent=function(a,l,u,p,k){return c.Promise.resolve(l).then(function(E){return i.blob&&(E instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(E))!==-1)&&typeof FileReader<"u"?new c.Promise(function(z,F){var O=new FileReader;O.onload=function(Z){z(Z.target.result)},O.onerror=function(Z){F(Z.target.error)},O.readAsArrayBuffer(E)}):E}).then(function(E){var z=h.getTypeOf(E);return z?(z==="arraybuffer"?E=h.transformTo("uint8array",E):z==="string"&&(k?E=n.decode(E):u&&p!==!0&&(E=(function(F){return v(F,i.uint8array?new Uint8Array(F.length):new Array(F.length))})(E))),E):c.Promise.reject(new Error("Can't read the data of '"+a+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(o,b,h){var i=o("./reader/readerFor"),n=o("./utils"),r=o("./signature"),c=o("./zipEntry"),m=o("./support");function v(_){this.files=[],this.loadOptions=_}v.prototype={checkSignature:function(_){if(!this.reader.readAndCheckSignature(_)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(w)+", expected "+n.pretty(_)+")")}},isSignature:function(_,w){var s=this.reader.index;this.reader.setIndex(_);var d=this.reader.readString(4)===w;return this.reader.setIndex(s),d},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),w=m.uint8array?"uint8array":"array",s=n.transformTo(w,_);this.zipComment=this.loadOptions.decodeFileName(s)},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 _,w,s,d=this.zip64EndOfCentralSize-44;0<d;)_=this.reader.readInt(2),w=this.reader.readInt(4),s=this.reader.readData(w),this.zip64ExtensibleData[_]={id:_,length:w,value:s}},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 _,w;for(_=0;_<this.files.length;_++)w=this.files[_],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var _;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(_=new c({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(r.CENTRAL_DIRECTORY_END);if(_<0)throw this.isSignature(0,r.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 w=_;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(_=this.reader.lastIndexOfSignature(r.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(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.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(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var s=this.centralDirOffset+this.centralDirSize;this.zip64&&(s+=20,s+=12+this.zip64EndOfCentralSize);var d=w-s;if(0<d)this.isSignature(w,r.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(_){this.reader=i(_)},load:function(_){this.prepareReader(_),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=v},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(o,b,h){var i=o("./reader/readerFor"),n=o("./utils"),r=o("./compressedObject"),c=o("./crc32"),m=o("./utf8"),v=o("./compressions"),_=o("./support");function w(s,d){this.options=s,this.loadOptions=d}w.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(s){var d,a;if(s.skip(22),this.fileNameLength=s.readInt(2),a=s.readInt(2),this.fileName=s.readData(this.fileNameLength),s.skip(a),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((d=(function(l){for(var u in v)if(Object.prototype.hasOwnProperty.call(v,u)&&v[u].magic===l)return v[u];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,d,s.readData(this.compressedSize))},readCentralPart:function(s){this.versionMadeBy=s.readInt(2),s.skip(2),this.bitFlag=s.readInt(2),this.compressionMethod=s.readString(2),this.date=s.readDate(),this.crc32=s.readInt(4),this.compressedSize=s.readInt(4),this.uncompressedSize=s.readInt(4);var d=s.readInt(2);if(this.extraFieldsLength=s.readInt(2),this.fileCommentLength=s.readInt(2),this.diskNumberStart=s.readInt(2),this.internalFileAttributes=s.readInt(2),this.externalFileAttributes=s.readInt(4),this.localHeaderOffset=s.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");s.skip(d),this.readExtraFields(s),this.parseZIP64ExtraField(s),this.fileComment=s.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var s=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),s==0&&(this.dosPermissions=63&this.externalFileAttributes),s==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var s=i(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=s.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=s.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=s.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=s.readInt(4))}},readExtraFields:function(s){var d,a,l,u=s.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});s.index+4<u;)d=s.readInt(2),a=s.readInt(2),l=s.readData(a),this.extraFields[d]={id:d,length:a,value:l};s.setIndex(u)},handleUTF8:function(){var s=_.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=m.utf8decode(this.fileName),this.fileCommentStr=m.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var a=n.transformTo(s,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(a)}var l=this.findExtraFieldUnicodeComment();if(l!==null)this.fileCommentStr=l;else{var u=n.transformTo(s,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(u)}}},findExtraFieldUnicodePath:function(){var s=this.extraFields[28789];if(s){var d=i(s.value);return d.readInt(1)!==1||c(this.fileName)!==d.readInt(4)?null:m.utf8decode(d.readData(s.length-5))}return null},findExtraFieldUnicodeComment:function(){var s=this.extraFields[25461];if(s){var d=i(s.value);return d.readInt(1)!==1||c(this.fileComment)!==d.readInt(4)?null:m.utf8decode(d.readData(s.length-5))}return null}},b.exports=w},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(o,b,h){function i(d,a,l){this.name=d,this.dir=l.dir,this.date=l.date,this.comment=l.comment,this.unixPermissions=l.unixPermissions,this.dosPermissions=l.dosPermissions,this._data=a,this._dataBinary=l.binary,this.options={compression:l.compression,compressionOptions:l.compressionOptions}}var n=o("./stream/StreamHelper"),r=o("./stream/DataWorker"),c=o("./utf8"),m=o("./compressedObject"),v=o("./stream/GenericWorker");i.prototype={internalStream:function(d){var a=null,l="string";try{if(!d)throw new Error("No output type specified.");var u=(l=d.toLowerCase())==="string"||l==="text";l!=="binarystring"&&l!=="text"||(l="string"),a=this._decompressWorker();var p=!this._dataBinary;p&&!u&&(a=a.pipe(new c.Utf8EncodeWorker)),!p&&u&&(a=a.pipe(new c.Utf8DecodeWorker))}catch(k){(a=new v("error")).error(k)}return new n(a,l,"")},async:function(d,a){return this.internalStream(d).accumulate(a)},nodeStream:function(d,a){return this.internalStream(d||"nodebuffer").toNodejsStream(a)},_compressWorker:function(d,a){if(this._data instanceof m&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var l=this._decompressWorker();return this._dataBinary||(l=l.pipe(new c.Utf8EncodeWorker)),m.createWorkerFrom(l,d,a)},_decompressWorker:function(){return this._data instanceof m?this._data.getContentWorker():this._data instanceof v?this._data:new r(this._data)}};for(var _=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],w=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},s=0;s<_.length;s++)i.prototype[_[s]]=w;b.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(o,b,h){(function(i){var n,r,c=i.MutationObserver||i.WebKitMutationObserver;if(c){var m=0,v=new c(d),_=i.document.createTextNode("");v.observe(_,{characterData:!0}),n=function(){_.data=m=++m%2}}else if(i.setImmediate||i.MessageChannel===void 0)n="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var a=i.document.createElement("script");a.onreadystatechange=function(){d(),a.onreadystatechange=null,a.parentNode.removeChild(a),a=null},i.document.documentElement.appendChild(a)}:function(){setTimeout(d,0)};else{var w=new i.MessageChannel;w.port1.onmessage=d,n=function(){w.port2.postMessage(0)}}var s=[];function d(){var a,l;r=!0;for(var u=s.length;u;){for(l=s,s=[],a=-1;++a<u;)l[a]();u=s.length}r=!1}b.exports=function(a){s.push(a)!==1||r||n()}}).call(this,typeof xt<"u"?xt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(o,b,h){var i=o("immediate");function n(){}var r={},c=["REJECTED"],m=["FULFILLED"],v=["PENDING"];function _(u){if(typeof u!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,u!==n&&a(this,u)}function w(u,p,k){this.promise=u,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function s(u,p,k){i(function(){var E;try{E=p(k)}catch(z){return r.reject(u,z)}E===u?r.reject(u,new TypeError("Cannot resolve promise with itself")):r.resolve(u,E)})}function d(u){var p=u&&u.then;if(u&&(typeof u=="object"||typeof u=="function")&&typeof p=="function")return function(){p.apply(u,arguments)}}function a(u,p){var k=!1;function E(O){k||(k=!0,r.reject(u,O))}function z(O){k||(k=!0,r.resolve(u,O))}var F=l(function(){p(z,E)});F.status==="error"&&E(F.value)}function l(u,p){var k={};try{k.value=u(p),k.status="success"}catch(E){k.status="error",k.value=E}return k}(b.exports=_).prototype.finally=function(u){if(typeof u!="function")return this;var p=this.constructor;return this.then(function(k){return p.resolve(u()).then(function(){return k})},function(k){return p.resolve(u()).then(function(){throw k})})},_.prototype.catch=function(u){return this.then(null,u)},_.prototype.then=function(u,p){if(typeof u!="function"&&this.state===m||typeof p!="function"&&this.state===c)return this;var k=new this.constructor(n);return this.state!==v?s(k,this.state===m?u:p,this.outcome):this.queue.push(new w(k,u,p)),k},w.prototype.callFulfilled=function(u){r.resolve(this.promise,u)},w.prototype.otherCallFulfilled=function(u){s(this.promise,this.onFulfilled,u)},w.prototype.callRejected=function(u){r.reject(this.promise,u)},w.prototype.otherCallRejected=function(u){s(this.promise,this.onRejected,u)},r.resolve=function(u,p){var k=l(d,p);if(k.status==="error")return r.reject(u,k.value);var E=k.value;if(E)a(u,E);else{u.state=m,u.outcome=p;for(var z=-1,F=u.queue.length;++z<F;)u.queue[z].callFulfilled(p)}return u},r.reject=function(u,p){u.state=c,u.outcome=p;for(var k=-1,E=u.queue.length;++k<E;)u.queue[k].callRejected(p);return u},_.resolve=function(u){return u instanceof this?u:r.resolve(new this(n),u)},_.reject=function(u){var p=new this(n);return r.reject(p,u)},_.all=function(u){var p=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=u.length,E=!1;if(!k)return this.resolve([]);for(var z=new Array(k),F=0,O=-1,Z=new this(n);++O<k;)P(u[O],O);return Z;function P(H,J){p.resolve(H).then(function(x){z[J]=x,++F!==k||E||(E=!0,r.resolve(Z,z))},function(x){E||(E=!0,r.reject(Z,x))})}},_.race=function(u){var p=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=u.length,E=!1;if(!k)return this.resolve([]);for(var z=-1,F=new this(n);++z<k;)O=u[z],p.resolve(O).then(function(Z){E||(E=!0,r.resolve(F,Z))},function(Z){E||(E=!0,r.reject(F,Z))});var O;return F}},{immediate:36}],38:[function(o,b,h){var i={};(0,o("./lib/utils/common").assign)(i,o("./lib/deflate"),o("./lib/inflate"),o("./lib/zlib/constants")),b.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(o,b,h){var i=o("./zlib/deflate"),n=o("./utils/common"),r=o("./utils/strings"),c=o("./zlib/messages"),m=o("./zlib/zstream"),v=Object.prototype.toString,_=0,w=-1,s=0,d=8;function a(u){if(!(this instanceof a))return new a(u);this.options=n.assign({level:w,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:s,to:""},u||{});var p=this.options;p.raw&&0<p.windowBits?p.windowBits=-p.windowBits:p.gzip&&0<p.windowBits&&p.windowBits<16&&(p.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,p.level,p.method,p.windowBits,p.memLevel,p.strategy);if(k!==_)throw new Error(c[k]);if(p.header&&i.deflateSetHeader(this.strm,p.header),p.dictionary){var E;if(E=typeof p.dictionary=="string"?r.string2buf(p.dictionary):v.call(p.dictionary)==="[object ArrayBuffer]"?new Uint8Array(p.dictionary):p.dictionary,(k=i.deflateSetDictionary(this.strm,E))!==_)throw new Error(c[k]);this._dict_set=!0}}function l(u,p){var k=new a(p);if(k.push(u,!0),k.err)throw k.msg||c[k.err];return k.result}a.prototype.push=function(u,p){var k,E,z=this.strm,F=this.options.chunkSize;if(this.ended)return!1;E=p===~~p?p:p===!0?4:0,typeof u=="string"?z.input=r.string2buf(u):v.call(u)==="[object ArrayBuffer]"?z.input=new Uint8Array(u):z.input=u,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new n.Buf8(F),z.next_out=0,z.avail_out=F),(k=i.deflate(z,E))!==1&&k!==_)return this.onEnd(k),!(this.ended=!0);z.avail_out!==0&&(z.avail_in!==0||E!==4&&E!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(n.shrinkBuf(z.output,z.next_out))):this.onData(n.shrinkBuf(z.output,z.next_out)))}while((0<z.avail_in||z.avail_out===0)&&k!==1);return E===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===_):E!==2||(this.onEnd(_),!(z.avail_out=0))},a.prototype.onData=function(u){this.chunks.push(u)},a.prototype.onEnd=function(u){u===_&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg},h.Deflate=a,h.deflate=l,h.deflateRaw=function(u,p){return(p=p||{}).raw=!0,l(u,p)},h.gzip=function(u,p){return(p=p||{}).gzip=!0,l(u,p)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(o,b,h){var i=o("./zlib/inflate"),n=o("./utils/common"),r=o("./utils/strings"),c=o("./zlib/constants"),m=o("./zlib/messages"),v=o("./zlib/zstream"),_=o("./zlib/gzheader"),w=Object.prototype.toString;function s(a){if(!(this instanceof s))return new s(a);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},a||{});var l=this.options;l.raw&&0<=l.windowBits&&l.windowBits<16&&(l.windowBits=-l.windowBits,l.windowBits===0&&(l.windowBits=-15)),!(0<=l.windowBits&&l.windowBits<16)||a&&a.windowBits||(l.windowBits+=32),15<l.windowBits&&l.windowBits<48&&(15&l.windowBits)==0&&(l.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v,this.strm.avail_out=0;var u=i.inflateInit2(this.strm,l.windowBits);if(u!==c.Z_OK)throw new Error(m[u]);this.header=new _,i.inflateGetHeader(this.strm,this.header)}function d(a,l){var u=new s(l);if(u.push(a,!0),u.err)throw u.msg||m[u.err];return u.result}s.prototype.push=function(a,l){var u,p,k,E,z,F,O=this.strm,Z=this.options.chunkSize,P=this.options.dictionary,H=!1;if(this.ended)return!1;p=l===~~l?l:l===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof a=="string"?O.input=r.binstring2buf(a):w.call(a)==="[object ArrayBuffer]"?O.input=new Uint8Array(a):O.input=a,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new n.Buf8(Z),O.next_out=0,O.avail_out=Z),(u=i.inflate(O,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&P&&(F=typeof P=="string"?r.string2buf(P):w.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,u=i.inflateSetDictionary(this.strm,F)),u===c.Z_BUF_ERROR&&H===!0&&(u=c.Z_OK,H=!1),u!==c.Z_STREAM_END&&u!==c.Z_OK)return this.onEnd(u),!(this.ended=!0);O.next_out&&(O.avail_out!==0&&u!==c.Z_STREAM_END&&(O.avail_in!==0||p!==c.Z_FINISH&&p!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=r.utf8border(O.output,O.next_out),E=O.next_out-k,z=r.buf2string(O.output,k),O.next_out=E,O.avail_out=Z-E,E&&n.arraySet(O.output,O.output,k,E,0),this.onData(z)):this.onData(n.shrinkBuf(O.output,O.next_out)))),O.avail_in===0&&O.avail_out===0&&(H=!0)}while((0<O.avail_in||O.avail_out===0)&&u!==c.Z_STREAM_END);return u===c.Z_STREAM_END&&(p=c.Z_FINISH),p===c.Z_FINISH?(u=i.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===c.Z_OK):p!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(O.avail_out=0))},s.prototype.onData=function(a){this.chunks.push(a)},s.prototype.onEnd=function(a){a===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},h.Inflate=s,h.inflate=d,h.inflateRaw=function(a,l){return(l=l||{}).raw=!0,d(a,l)},h.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(o,b,h){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";h.assign=function(c){for(var m=Array.prototype.slice.call(arguments,1);m.length;){var v=m.shift();if(v){if(typeof v!="object")throw new TypeError(v+"must be non-object");for(var _ in v)v.hasOwnProperty(_)&&(c[_]=v[_])}}return c},h.shrinkBuf=function(c,m){return c.length===m?c:c.subarray?c.subarray(0,m):(c.length=m,c)};var n={arraySet:function(c,m,v,_,w){if(m.subarray&&c.subarray)c.set(m.subarray(v,v+_),w);else for(var s=0;s<_;s++)c[w+s]=m[v+s]},flattenChunks:function(c){var m,v,_,w,s,d;for(m=_=0,v=c.length;m<v;m++)_+=c[m].length;for(d=new Uint8Array(_),m=w=0,v=c.length;m<v;m++)s=c[m],d.set(s,w),w+=s.length;return d}},r={arraySet:function(c,m,v,_,w){for(var s=0;s<_;s++)c[w+s]=m[v+s]},flattenChunks:function(c){return[].concat.apply([],c)}};h.setTyped=function(c){c?(h.Buf8=Uint8Array,h.Buf16=Uint16Array,h.Buf32=Int32Array,h.assign(h,n)):(h.Buf8=Array,h.Buf16=Array,h.Buf32=Array,h.assign(h,r))},h.setTyped(i)},{}],42:[function(o,b,h){var i=o("./common"),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var c=new i.Buf8(256),m=0;m<256;m++)c[m]=252<=m?6:248<=m?5:240<=m?4:224<=m?3:192<=m?2:1;function v(_,w){if(w<65537&&(_.subarray&&r||!_.subarray&&n))return String.fromCharCode.apply(null,i.shrinkBuf(_,w));for(var s="",d=0;d<w;d++)s+=String.fromCharCode(_[d]);return s}c[254]=c[254]=1,h.string2buf=function(_){var w,s,d,a,l,u=_.length,p=0;for(a=0;a<u;a++)(64512&(s=_.charCodeAt(a)))==55296&&a+1<u&&(64512&(d=_.charCodeAt(a+1)))==56320&&(s=65536+(s-55296<<10)+(d-56320),a++),p+=s<128?1:s<2048?2:s<65536?3:4;for(w=new i.Buf8(p),a=l=0;l<p;a++)(64512&(s=_.charCodeAt(a)))==55296&&a+1<u&&(64512&(d=_.charCodeAt(a+1)))==56320&&(s=65536+(s-55296<<10)+(d-56320),a++),s<128?w[l++]=s:(s<2048?w[l++]=192|s>>>6:(s<65536?w[l++]=224|s>>>12:(w[l++]=240|s>>>18,w[l++]=128|s>>>12&63),w[l++]=128|s>>>6&63),w[l++]=128|63&s);return w},h.buf2binstring=function(_){return v(_,_.length)},h.binstring2buf=function(_){for(var w=new i.Buf8(_.length),s=0,d=w.length;s<d;s++)w[s]=_.charCodeAt(s);return w},h.buf2string=function(_,w){var s,d,a,l,u=w||_.length,p=new Array(2*u);for(s=d=0;s<u;)if((a=_[s++])<128)p[d++]=a;else if(4<(l=c[a]))p[d++]=65533,s+=l-1;else{for(a&=l===2?31:l===3?15:7;1<l&&s<u;)a=a<<6|63&_[s++],l--;1<l?p[d++]=65533:a<65536?p[d++]=a:(a-=65536,p[d++]=55296|a>>10&1023,p[d++]=56320|1023&a)}return v(p,d)},h.utf8border=function(_,w){var s;for((w=w||_.length)>_.length&&(w=_.length),s=w-1;0<=s&&(192&_[s])==128;)s--;return s<0||s===0?w:s+c[_[s]]>w?s:w}},{"./common":41}],43:[function(o,b,h){b.exports=function(i,n,r,c){for(var m=65535&i|0,v=i>>>16&65535|0,_=0;r!==0;){for(r-=_=2e3<r?2e3:r;v=v+(m=m+n[c++]|0)|0,--_;);m%=65521,v%=65521}return m|v<<16|0}},{}],44:[function(o,b,h){b.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,b,h){var i=(function(){for(var n,r=[],c=0;c<256;c++){n=c;for(var m=0;m<8;m++)n=1&n?3988292384^n>>>1:n>>>1;r[c]=n}return r})();b.exports=function(n,r,c,m){var v=i,_=m+c;n^=-1;for(var w=m;w<_;w++)n=n>>>8^v[255&(n^r[w])];return-1^n}},{}],46:[function(o,b,h){var i,n=o("../utils/common"),r=o("./trees"),c=o("./adler32"),m=o("./crc32"),v=o("./messages"),_=0,w=4,s=0,d=-2,a=-1,l=4,u=2,p=8,k=9,E=286,z=30,F=19,O=2*E+1,Z=15,P=3,H=258,J=H+P+1,x=42,R=113,e=1,B=2,tt=3,W=4;function et(t,T){return t.msg=v[T],T}function M(t){return(t<<1)-(4<t?9:0)}function Q(t){for(var T=t.length;0<=--T;)t[T]=0}function N(t){var T=t.state,j=T.pending;j>t.avail_out&&(j=t.avail_out),j!==0&&(n.arraySet(t.output,T.pending_buf,T.pending_out,j,t.next_out),t.next_out+=j,T.pending_out+=j,t.total_out+=j,t.avail_out-=j,T.pending-=j,T.pending===0&&(T.pending_out=0))}function I(t,T){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,T),t.block_start=t.strstart,N(t.strm)}function q(t,T){t.pending_buf[t.pending++]=T}function V(t,T){t.pending_buf[t.pending++]=T>>>8&255,t.pending_buf[t.pending++]=255&T}function K(t,T){var j,g,f=t.max_chain_length,C=t.strstart,L=t.prev_length,U=t.nice_match,A=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,$=t.window,X=t.w_mask,G=t.prev,Y=t.strstart+H,it=$[C+L-1],nt=$[C+L];t.prev_length>=t.good_match&&(f>>=2),U>t.lookahead&&(U=t.lookahead);do if($[(j=T)+L]===nt&&$[j+L-1]===it&&$[j]===$[C]&&$[++j]===$[C+1]){C+=2,j++;do;while($[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&C<Y);if(g=H-(Y-C),C=Y-H,L<g){if(t.match_start=T,U<=(L=g))break;it=$[C+L-1],nt=$[C+L]}}while((T=G[T&X])>A&&--f!=0);return L<=t.lookahead?L:t.lookahead}function at(t){var T,j,g,f,C,L,U,A,$,X,G=t.w_size;do{if(f=t.window_size-t.lookahead-t.strstart,t.strstart>=G+(G-J)){for(n.arraySet(t.window,t.window,G,G,0),t.match_start-=G,t.strstart-=G,t.block_start-=G,T=j=t.hash_size;g=t.head[--T],t.head[T]=G<=g?g-G:0,--j;);for(T=j=G;g=t.prev[--T],t.prev[T]=G<=g?g-G:0,--j;);f+=G}if(t.strm.avail_in===0)break;if(L=t.strm,U=t.window,A=t.strstart+t.lookahead,$=f,X=void 0,X=L.avail_in,$<X&&(X=$),j=X===0?0:(L.avail_in-=X,n.arraySet(U,L.input,L.next_in,X,A),L.state.wrap===1?L.adler=c(L.adler,U,X,A):L.state.wrap===2&&(L.adler=m(L.adler,U,X,A)),L.next_in+=X,L.total_in+=X,X),t.lookahead+=j,t.lookahead+t.insert>=P)for(C=t.strstart-t.insert,t.ins_h=t.window[C],t.ins_h=(t.ins_h<<t.hash_shift^t.window[C+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[C+P-1])&t.hash_mask,t.prev[C&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=C,C++,t.insert--,!(t.lookahead+t.insert<P)););}while(t.lookahead<J&&t.strm.avail_in!==0)}function ut(t,T){for(var j,g;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&T===_)return e;if(t.lookahead===0)break}if(j=0,t.lookahead>=P&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+P-1])&t.hash_mask,j=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),j!==0&&t.strstart-j<=t.w_size-J&&(t.match_length=K(t,j)),t.match_length>=P)if(g=r._tr_tally(t,t.strstart-t.match_start,t.match_length-P),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=P){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+P-1])&t.hash_mask,j=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 g=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(g&&(I(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<P-1?t.strstart:P-1,T===w?(I(t,!0),t.strm.avail_out===0?tt:W):t.last_lit&&(I(t,!1),t.strm.avail_out===0)?e:B}function rt(t,T){for(var j,g,f;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&T===_)return e;if(t.lookahead===0)break}if(j=0,t.lookahead>=P&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+P-1])&t.hash_mask,j=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=P-1,j!==0&&t.prev_length<t.max_lazy_match&&t.strstart-j<=t.w_size-J&&(t.match_length=K(t,j),t.match_length<=5&&(t.strategy===1||t.match_length===P&&4096<t.strstart-t.match_start)&&(t.match_length=P-1)),t.prev_length>=P&&t.match_length<=t.prev_length){for(f=t.strstart+t.lookahead-P,g=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-P),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=f&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+P-1])&t.hash_mask,j=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=P-1,t.strstart++,g&&(I(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((g=r._tr_tally(t,0,t.window[t.strstart-1]))&&I(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&&(g=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<P-1?t.strstart:P-1,T===w?(I(t,!0),t.strm.avail_out===0?tt:W):t.last_lit&&(I(t,!1),t.strm.avail_out===0)?e:B}function st(t,T,j,g,f){this.good_length=t,this.max_lazy=T,this.nice_length=j,this.max_chain=g,this.func=f}function ct(){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=p,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 n.Buf16(2*O),this.dyn_dtree=new n.Buf16(2*(2*z+1)),this.bl_tree=new n.Buf16(2*(2*F+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 n.Buf16(Z+1),this.heap=new n.Buf16(2*E+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*E+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 T;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=u,(T=t.state).pending=0,T.pending_out=0,T.wrap<0&&(T.wrap=-T.wrap),T.status=T.wrap?x:R,t.adler=T.wrap===2?0:1,T.last_flush=_,r._tr_init(T),s):et(t,d)}function ft(t){var T=ot(t);return T===s&&(function(j){j.window_size=2*j.w_size,Q(j.head),j.max_lazy_match=i[j.level].max_lazy,j.good_match=i[j.level].good_length,j.nice_match=i[j.level].nice_length,j.max_chain_length=i[j.level].max_chain,j.strstart=0,j.block_start=0,j.lookahead=0,j.insert=0,j.match_length=j.prev_length=P-1,j.match_available=0,j.ins_h=0})(t.state),T}function dt(t,T,j,g,f,C){if(!t)return d;var L=1;if(T===a&&(T=6),g<0?(L=0,g=-g):15<g&&(L=2,g-=16),f<1||k<f||j!==p||g<8||15<g||T<0||9<T||C<0||l<C)return et(t,d);g===8&&(g=9);var U=new ct;return(t.state=U).strm=t,U.wrap=L,U.gzhead=null,U.w_bits=g,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=f+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+P-1)/P),U.window=new n.Buf8(2*U.w_size),U.head=new n.Buf16(U.hash_size),U.prev=new n.Buf16(U.w_size),U.lit_bufsize=1<<f+6,U.pending_buf_size=4*U.lit_bufsize,U.pending_buf=new n.Buf8(U.pending_buf_size),U.d_buf=1*U.lit_bufsize,U.l_buf=3*U.lit_bufsize,U.level=T,U.strategy=C,U.method=j,ft(t)}i=[new st(0,0,0,0,function(t,T){var j=65535;for(j>t.pending_buf_size-5&&(j=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),t.lookahead===0&&T===_)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var g=t.block_start+j;if((t.strstart===0||t.strstart>=g)&&(t.lookahead=t.strstart-g,t.strstart=g,I(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-J&&(I(t,!1),t.strm.avail_out===0))return e}return t.insert=0,T===w?(I(t,!0),t.strm.avail_out===0?tt:W):(t.strstart>t.block_start&&(I(t,!1),t.strm.avail_out),e)}),new st(4,4,8,4,ut),new st(4,5,16,8,ut),new st(4,6,32,32,ut),new st(4,4,16,16,rt),new st(8,16,32,32,rt),new st(8,16,128,128,rt),new st(8,32,128,256,rt),new st(32,128,258,1024,rt),new st(32,258,258,4096,rt)],h.deflateInit=function(t,T){return dt(t,T,p,15,8,0)},h.deflateInit2=dt,h.deflateReset=ft,h.deflateResetKeep=ot,h.deflateSetHeader=function(t,T){return t&&t.state?t.state.wrap!==2?d:(t.state.gzhead=T,s):d},h.deflate=function(t,T){var j,g,f,C;if(!t||!t.state||5<T||T<0)return t?et(t,d):d;if(g=t.state,!t.output||!t.input&&t.avail_in!==0||g.status===666&&T!==w)return et(t,t.avail_out===0?-5:d);if(g.strm=t,j=g.last_flush,g.last_flush=T,g.status===x)if(g.wrap===2)t.adler=0,q(g,31),q(g,139),q(g,8),g.gzhead?(q(g,(g.gzhead.text?1:0)+(g.gzhead.hcrc?2:0)+(g.gzhead.extra?4:0)+(g.gzhead.name?8:0)+(g.gzhead.comment?16:0)),q(g,255&g.gzhead.time),q(g,g.gzhead.time>>8&255),q(g,g.gzhead.time>>16&255),q(g,g.gzhead.time>>24&255),q(g,g.level===9?2:2<=g.strategy||g.level<2?4:0),q(g,255&g.gzhead.os),g.gzhead.extra&&g.gzhead.extra.length&&(q(g,255&g.gzhead.extra.length),q(g,g.gzhead.extra.length>>8&255)),g.gzhead.hcrc&&(t.adler=m(t.adler,g.pending_buf,g.pending,0)),g.gzindex=0,g.status=69):(q(g,0),q(g,0),q(g,0),q(g,0),q(g,0),q(g,g.level===9?2:2<=g.strategy||g.level<2?4:0),q(g,3),g.status=R);else{var L=p+(g.w_bits-8<<4)<<8;L|=(2<=g.strategy||g.level<2?0:g.level<6?1:g.level===6?2:3)<<6,g.strstart!==0&&(L|=32),L+=31-L%31,g.status=R,V(g,L),g.strstart!==0&&(V(g,t.adler>>>16),V(g,65535&t.adler)),t.adler=1}if(g.status===69)if(g.gzhead.extra){for(f=g.pending;g.gzindex<(65535&g.gzhead.extra.length)&&(g.pending!==g.pending_buf_size||(g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),N(t),f=g.pending,g.pending!==g.pending_buf_size));)q(g,255&g.gzhead.extra[g.gzindex]),g.gzindex++;g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),g.gzindex===g.gzhead.extra.length&&(g.gzindex=0,g.status=73)}else g.status=73;if(g.status===73)if(g.gzhead.name){f=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),N(t),f=g.pending,g.pending===g.pending_buf_size)){C=1;break}C=g.gzindex<g.gzhead.name.length?255&g.gzhead.name.charCodeAt(g.gzindex++):0,q(g,C)}while(C!==0);g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),C===0&&(g.gzindex=0,g.status=91)}else g.status=91;if(g.status===91)if(g.gzhead.comment){f=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),N(t),f=g.pending,g.pending===g.pending_buf_size)){C=1;break}C=g.gzindex<g.gzhead.comment.length?255&g.gzhead.comment.charCodeAt(g.gzindex++):0,q(g,C)}while(C!==0);g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),C===0&&(g.status=103)}else g.status=103;if(g.status===103&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&N(t),g.pending+2<=g.pending_buf_size&&(q(g,255&t.adler),q(g,t.adler>>8&255),t.adler=0,g.status=R)):g.status=R),g.pending!==0){if(N(t),t.avail_out===0)return g.last_flush=-1,s}else if(t.avail_in===0&&M(T)<=M(j)&&T!==w)return et(t,-5);if(g.status===666&&t.avail_in!==0)return et(t,-5);if(t.avail_in!==0||g.lookahead!==0||T!==_&&g.status!==666){var U=g.strategy===2?(function(A,$){for(var X;;){if(A.lookahead===0&&(at(A),A.lookahead===0)){if($===_)return e;break}if(A.match_length=0,X=r._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,X&&(I(A,!1),A.strm.avail_out===0))return e}return A.insert=0,$===w?(I(A,!0),A.strm.avail_out===0?tt:W):A.last_lit&&(I(A,!1),A.strm.avail_out===0)?e:B})(g,T):g.strategy===3?(function(A,$){for(var X,G,Y,it,nt=A.window;;){if(A.lookahead<=H){if(at(A),A.lookahead<=H&&$===_)return e;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=P&&0<A.strstart&&(G=nt[Y=A.strstart-1])===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]){it=A.strstart+H;do;while(G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&Y<it);A.match_length=H-(it-Y),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=P?(X=r._tr_tally(A,1,A.match_length-P),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(X=r._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),X&&(I(A,!1),A.strm.avail_out===0))return e}return A.insert=0,$===w?(I(A,!0),A.strm.avail_out===0?tt:W):A.last_lit&&(I(A,!1),A.strm.avail_out===0)?e:B})(g,T):i[g.level].func(g,T);if(U!==tt&&U!==W||(g.status=666),U===e||U===tt)return t.avail_out===0&&(g.last_flush=-1),s;if(U===B&&(T===1?r._tr_align(g):T!==5&&(r._tr_stored_block(g,0,0,!1),T===3&&(Q(g.head),g.lookahead===0&&(g.strstart=0,g.block_start=0,g.insert=0))),N(t),t.avail_out===0))return g.last_flush=-1,s}return T!==w?s:g.wrap<=0?1:(g.wrap===2?(q(g,255&t.adler),q(g,t.adler>>8&255),q(g,t.adler>>16&255),q(g,t.adler>>24&255),q(g,255&t.total_in),q(g,t.total_in>>8&255),q(g,t.total_in>>16&255),q(g,t.total_in>>24&255)):(V(g,t.adler>>>16),V(g,65535&t.adler)),N(t),0<g.wrap&&(g.wrap=-g.wrap),g.pending!==0?s:1)},h.deflateEnd=function(t){var T;return t&&t.state?(T=t.state.status)!==x&&T!==69&&T!==73&&T!==91&&T!==103&&T!==R&&T!==666?et(t,d):(t.state=null,T===R?et(t,-3):s):d},h.deflateSetDictionary=function(t,T){var j,g,f,C,L,U,A,$,X=T.length;if(!t||!t.state||(C=(j=t.state).wrap)===2||C===1&&j.status!==x||j.lookahead)return d;for(C===1&&(t.adler=c(t.adler,T,X,0)),j.wrap=0,X>=j.w_size&&(C===0&&(Q(j.head),j.strstart=0,j.block_start=0,j.insert=0),$=new n.Buf8(j.w_size),n.arraySet($,T,X-j.w_size,j.w_size,0),T=$,X=j.w_size),L=t.avail_in,U=t.next_in,A=t.input,t.avail_in=X,t.next_in=0,t.input=T,at(j);j.lookahead>=P;){for(g=j.strstart,f=j.lookahead-(P-1);j.ins_h=(j.ins_h<<j.hash_shift^j.window[g+P-1])&j.hash_mask,j.prev[g&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=g,g++,--f;);j.strstart=g,j.lookahead=P-1,at(j)}return j.strstart+=j.lookahead,j.block_start=j.strstart,j.insert=j.lookahead,j.lookahead=0,j.match_length=j.prev_length=P-1,j.match_available=0,t.next_in=U,t.input=A,t.avail_in=L,j.wrap=C,s},h.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(o,b,h){b.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,b,h){b.exports=function(i,n){var r,c,m,v,_,w,s,d,a,l,u,p,k,E,z,F,O,Z,P,H,J,x,R,e,B;r=i.state,c=i.next_in,e=i.input,m=c+(i.avail_in-5),v=i.next_out,B=i.output,_=v-(n-i.avail_out),w=v+(i.avail_out-257),s=r.dmax,d=r.wsize,a=r.whave,l=r.wnext,u=r.window,p=r.hold,k=r.bits,E=r.lencode,z=r.distcode,F=(1<<r.lenbits)-1,O=(1<<r.distbits)-1;t:do{k<15&&(p+=e[c++]<<k,k+=8,p+=e[c++]<<k,k+=8),Z=E[p&F];e:for(;;){if(p>>>=P=Z>>>24,k-=P,(P=Z>>>16&255)===0)B[v++]=65535&Z;else{if(!(16&P)){if((64&P)==0){Z=E[(65535&Z)+(p&(1<<P)-1)];continue e}if(32&P){r.mode=12;break t}i.msg="invalid literal/length code",r.mode=30;break t}H=65535&Z,(P&=15)&&(k<P&&(p+=e[c++]<<k,k+=8),H+=p&(1<<P)-1,p>>>=P,k-=P),k<15&&(p+=e[c++]<<k,k+=8,p+=e[c++]<<k,k+=8),Z=z[p&O];r:for(;;){if(p>>>=P=Z>>>24,k-=P,!(16&(P=Z>>>16&255))){if((64&P)==0){Z=z[(65535&Z)+(p&(1<<P)-1)];continue r}i.msg="invalid distance code",r.mode=30;break t}if(J=65535&Z,k<(P&=15)&&(p+=e[c++]<<k,(k+=8)<P&&(p+=e[c++]<<k,k+=8)),s<(J+=p&(1<<P)-1)){i.msg="invalid distance too far back",r.mode=30;break t}if(p>>>=P,k-=P,(P=v-_)<J){if(a<(P=J-P)&&r.sane){i.msg="invalid distance too far back",r.mode=30;break t}if(R=u,(x=0)===l){if(x+=d-P,P<H){for(H-=P;B[v++]=u[x++],--P;);x=v-J,R=B}}else if(l<P){if(x+=d+l-P,(P-=l)<H){for(H-=P;B[v++]=u[x++],--P;);if(x=0,l<H){for(H-=P=l;B[v++]=u[x++],--P;);x=v-J,R=B}}}else if(x+=l-P,P<H){for(H-=P;B[v++]=u[x++],--P;);x=v-J,R=B}for(;2<H;)B[v++]=R[x++],B[v++]=R[x++],B[v++]=R[x++],H-=3;H&&(B[v++]=R[x++],1<H&&(B[v++]=R[x++]))}else{for(x=v-J;B[v++]=B[x++],B[v++]=B[x++],B[v++]=B[x++],2<(H-=3););H&&(B[v++]=B[x++],1<H&&(B[v++]=B[x++]))}break}}break}}while(c<m&&v<w);c-=H=k>>3,p&=(1<<(k-=H<<3))-1,i.next_in=c,i.next_out=v,i.avail_in=c<m?m-c+5:5-(c-m),i.avail_out=v<w?w-v+257:257-(v-w),r.hold=p,r.bits=k}},{}],49:[function(o,b,h){var i=o("../utils/common"),n=o("./adler32"),r=o("./crc32"),c=o("./inffast"),m=o("./inftrees"),v=1,_=2,w=0,s=-2,d=1,a=852,l=592;function u(x){return(x>>>24&255)+(x>>>8&65280)+((65280&x)<<8)+((255&x)<<24)}function p(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(x){var R;return x&&x.state?(R=x.state,x.total_in=x.total_out=R.total=0,x.msg="",R.wrap&&(x.adler=1&R.wrap),R.mode=d,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new i.Buf32(a),R.distcode=R.distdyn=new i.Buf32(l),R.sane=1,R.back=-1,w):s}function E(x){var R;return x&&x.state?((R=x.state).wsize=0,R.whave=0,R.wnext=0,k(x)):s}function z(x,R){var e,B;return x&&x.state?(B=x.state,R<0?(e=0,R=-R):(e=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15<R)?s:(B.window!==null&&B.wbits!==R&&(B.window=null),B.wrap=e,B.wbits=R,E(x))):s}function F(x,R){var e,B;return x?(B=new p,(x.state=B).window=null,(e=z(x,R))!==w&&(x.state=null),e):s}var O,Z,P=!0;function H(x){if(P){var R;for(O=new i.Buf32(512),Z=new i.Buf32(32),R=0;R<144;)x.lens[R++]=8;for(;R<256;)x.lens[R++]=9;for(;R<280;)x.lens[R++]=7;for(;R<288;)x.lens[R++]=8;for(m(v,x.lens,0,288,O,0,x.work,{bits:9}),R=0;R<32;)x.lens[R++]=5;m(_,x.lens,0,32,Z,0,x.work,{bits:5}),P=!1}x.lencode=O,x.lenbits=9,x.distcode=Z,x.distbits=5}function J(x,R,e,B){var tt,W=x.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new i.Buf8(W.wsize)),B>=W.wsize?(i.arraySet(W.window,R,e-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(B<(tt=W.wsize-W.wnext)&&(tt=B),i.arraySet(W.window,R,e-B,tt,W.wnext),(B-=tt)?(i.arraySet(W.window,R,e-B,B,0),W.wnext=B,W.whave=W.wsize):(W.wnext+=tt,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=tt))),0}h.inflateReset=E,h.inflateReset2=z,h.inflateResetKeep=k,h.inflateInit=function(x){return F(x,15)},h.inflateInit2=F,h.inflate=function(x,R){var e,B,tt,W,et,M,Q,N,I,q,V,K,at,ut,rt,st,ct,ot,ft,dt,t,T,j,g,f=0,C=new i.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!x||!x.state||!x.output||!x.input&&x.avail_in!==0)return s;(e=x.state).mode===12&&(e.mode=13),et=x.next_out,tt=x.output,Q=x.avail_out,W=x.next_in,B=x.input,M=x.avail_in,N=e.hold,I=e.bits,q=M,V=Q,T=w;t:for(;;)switch(e.mode){case d:if(e.wrap===0){e.mode=13;break}for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(2&e.wrap&&N===35615){C[e.check=0]=255&N,C[1]=N>>>8&255,e.check=r(e.check,C,2,0),I=N=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&N)<<8)+(N>>8))%31){x.msg="incorrect header check",e.mode=30;break}if((15&N)!=8){x.msg="unknown compression method",e.mode=30;break}if(I-=4,t=8+(15&(N>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){x.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,x.adler=e.check=1,e.mode=512&N?10:12,I=N=0;break;case 2:for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(e.flags=N,(255&e.flags)!=8){x.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){x.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=N>>8&1),512&e.flags&&(C[0]=255&N,C[1]=N>>>8&255,e.check=r(e.check,C,2,0)),I=N=0,e.mode=3;case 3:for(;I<32;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.head&&(e.head.time=N),512&e.flags&&(C[0]=255&N,C[1]=N>>>8&255,C[2]=N>>>16&255,C[3]=N>>>24&255,e.check=r(e.check,C,4,0)),I=N=0,e.mode=4;case 4:for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.head&&(e.head.xflags=255&N,e.head.os=N>>8),512&e.flags&&(C[0]=255&N,C[1]=N>>>8&255,e.check=r(e.check,C,2,0)),I=N=0,e.mode=5;case 5:if(1024&e.flags){for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.length=N,e.head&&(e.head.extra_len=N),512&e.flags&&(C[0]=255&N,C[1]=N>>>8&255,e.check=r(e.check,C,2,0)),I=N=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(M<(K=e.length)&&(K=M),K&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),i.arraySet(e.head.extra,B,W,K,t)),512&e.flags&&(e.check=r(e.check,B,K,W)),M-=K,W+=K,e.length-=K),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(M===0)break t;for(K=0;t=B[W+K++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&K<M;);if(512&e.flags&&(e.check=r(e.check,B,K,W)),M-=K,W+=K,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(M===0)break t;for(K=0;t=B[W+K++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&K<M;);if(512&e.flags&&(e.check=r(e.check,B,K,W)),M-=K,W+=K,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(N!==(65535&e.check)){x.msg="header crc mismatch",e.mode=30;break}I=N=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),x.adler=e.check=0,e.mode=12;break;case 10:for(;I<32;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}x.adler=e.check=u(N),I=N=0,e.mode=11;case 11:if(e.havedict===0)return x.next_out=et,x.avail_out=Q,x.next_in=W,x.avail_in=M,e.hold=N,e.bits=I,2;x.adler=e.check=1,e.mode=12;case 12:if(R===5||R===6)break t;case 13:if(e.last){N>>>=7&I,I-=7&I,e.mode=27;break}for(;I<3;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}switch(e.last=1&N,I-=1,3&(N>>>=1)){case 0:e.mode=14;break;case 1:if(H(e),e.mode=20,R!==6)break;N>>>=2,I-=2;break t;case 2:e.mode=17;break;case 3:x.msg="invalid block type",e.mode=30}N>>>=2,I-=2;break;case 14:for(N>>>=7&I,I-=7&I;I<32;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if((65535&N)!=(N>>>16^65535)){x.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&N,I=N=0,e.mode=15,R===6)break t;case 15:e.mode=16;case 16:if(K=e.length){if(M<K&&(K=M),Q<K&&(K=Q),K===0)break t;i.arraySet(tt,B,W,K,et),M-=K,W+=K,Q-=K,et+=K,e.length-=K;break}e.mode=12;break;case 17:for(;I<14;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(e.nlen=257+(31&N),N>>>=5,I-=5,e.ndist=1+(31&N),N>>>=5,I-=5,e.ncode=4+(15&N),N>>>=4,I-=4,286<e.nlen||30<e.ndist){x.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(;I<3;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.lens[L[e.have++]]=7&N,N>>>=3,I-=3}for(;e.have<19;)e.lens[L[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,j={bits:e.lenbits},T=m(0,e.lens,0,19,e.lencode,0,e.work,j),e.lenbits=j.bits,T){x.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(;st=(f=e.lencode[N&(1<<e.lenbits)-1])>>>16&255,ct=65535&f,!((rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(ct<16)N>>>=rt,I-=rt,e.lens[e.have++]=ct;else{if(ct===16){for(g=rt+2;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(N>>>=rt,I-=rt,e.have===0){x.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],K=3+(3&N),N>>>=2,I-=2}else if(ct===17){for(g=rt+3;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}I-=rt,t=0,K=3+(7&(N>>>=rt)),N>>>=3,I-=3}else{for(g=rt+7;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}I-=rt,t=0,K=11+(127&(N>>>=rt)),N>>>=7,I-=7}if(e.have+K>e.nlen+e.ndist){x.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){x.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,j={bits:e.lenbits},T=m(v,e.lens,0,e.nlen,e.lencode,0,e.work,j),e.lenbits=j.bits,T){x.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,j={bits:e.distbits},T=m(_,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,j),e.distbits=j.bits,T){x.msg="invalid distances set",e.mode=30;break}if(e.mode=20,R===6)break t;case 20:e.mode=21;case 21:if(6<=M&&258<=Q){x.next_out=et,x.avail_out=Q,x.next_in=W,x.avail_in=M,e.hold=N,e.bits=I,c(x,V),et=x.next_out,tt=x.output,Q=x.avail_out,W=x.next_in,B=x.input,M=x.avail_in,N=e.hold,I=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;st=(f=e.lencode[N&(1<<e.lenbits)-1])>>>16&255,ct=65535&f,!((rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(st&&(240&st)==0){for(ot=rt,ft=st,dt=ct;st=(f=e.lencode[dt+((N&(1<<ot+ft)-1)>>ot)])>>>16&255,ct=65535&f,!(ot+(rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}N>>>=ot,I-=ot,e.back+=ot}if(N>>>=rt,I-=rt,e.back+=rt,e.length=ct,st===0){e.mode=26;break}if(32&st){e.back=-1,e.mode=12;break}if(64&st){x.msg="invalid literal/length code",e.mode=30;break}e.extra=15&st,e.mode=22;case 22:if(e.extra){for(g=e.extra;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.length+=N&(1<<e.extra)-1,N>>>=e.extra,I-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;st=(f=e.distcode[N&(1<<e.distbits)-1])>>>16&255,ct=65535&f,!((rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if((240&st)==0){for(ot=rt,ft=st,dt=ct;st=(f=e.distcode[dt+((N&(1<<ot+ft)-1)>>ot)])>>>16&255,ct=65535&f,!(ot+(rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}N>>>=ot,I-=ot,e.back+=ot}if(N>>>=rt,I-=rt,e.back+=rt,64&st){x.msg="invalid distance code",e.mode=30;break}e.offset=ct,e.extra=15&st,e.mode=24;case 24:if(e.extra){for(g=e.extra;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.offset+=N&(1<<e.extra)-1,N>>>=e.extra,I-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){x.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(Q===0)break t;if(K=V-Q,e.offset>K){if((K=e.offset-K)>e.whave&&e.sane){x.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),ut=e.window}else ut=tt,at=et-e.offset,K=e.length;for(Q<K&&(K=Q),Q-=K,e.length-=K;tt[et++]=ut[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(;I<32;){if(M===0)break t;M--,N|=B[W++]<<I,I+=8}if(V-=Q,x.total_out+=V,e.total+=V,V&&(x.adler=e.check=e.flags?r(e.check,tt,V,et-V):n(e.check,tt,V,et-V)),V=Q,(e.flags?N:u(N))!==e.check){x.msg="incorrect data check",e.mode=30;break}I=N=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;I<32;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(N!==(4294967295&e.total)){x.msg="incorrect length check",e.mode=30;break}I=N=0}e.mode=29;case 29:T=1;break t;case 30:T=-3;break t;case 31:return-4;case 32:default:return s}return x.next_out=et,x.avail_out=Q,x.next_in=W,x.avail_in=M,e.hold=N,e.bits=I,(e.wsize||V!==x.avail_out&&e.mode<30&&(e.mode<27||R!==4))&&J(x,x.output,x.next_out,V-x.avail_out)?(e.mode=31,-4):(q-=x.avail_in,V-=x.avail_out,x.total_in+=q,x.total_out+=V,e.total+=V,e.wrap&&V&&(x.adler=e.check=e.flags?r(e.check,tt,V,x.next_out-V):n(e.check,tt,V,x.next_out-V)),x.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(q==0&&V===0||R===4)&&T===w&&(T=-5),T)},h.inflateEnd=function(x){if(!x||!x.state)return s;var R=x.state;return R.window&&(R.window=null),x.state=null,w},h.inflateGetHeader=function(x,R){var e;return x&&x.state?(2&(e=x.state).wrap)==0?s:((e.head=R).done=!1,w):s},h.inflateSetDictionary=function(x,R){var e,B=R.length;return x&&x.state?(e=x.state).wrap!==0&&e.mode!==11?s:e.mode===11&&n(1,R,B,0)!==e.check?-3:J(x,R,B,B)?(e.mode=31,-4):(e.havedict=1,w):s},h.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(o,b,h){var i=o("../utils/common"),n=[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],r=[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],c=[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],m=[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];b.exports=function(v,_,w,s,d,a,l,u){var p,k,E,z,F,O,Z,P,H,J=u.bits,x=0,R=0,e=0,B=0,tt=0,W=0,et=0,M=0,Q=0,N=0,I=null,q=0,V=new i.Buf16(16),K=new i.Buf16(16),at=null,ut=0;for(x=0;x<=15;x++)V[x]=0;for(R=0;R<s;R++)V[_[w+R]]++;for(tt=J,B=15;1<=B&&V[B]===0;B--);if(B<tt&&(tt=B),B===0)return d[a++]=20971520,d[a++]=20971520,u.bits=1,0;for(e=1;e<B&&V[e]===0;e++);for(tt<e&&(tt=e),x=M=1;x<=15;x++)if(M<<=1,(M-=V[x])<0)return-1;if(0<M&&(v===0||B!==1))return-1;for(K[1]=0,x=1;x<15;x++)K[x+1]=K[x]+V[x];for(R=0;R<s;R++)_[w+R]!==0&&(l[K[_[w+R]]++]=R);if(O=v===0?(I=at=l,19):v===1?(I=n,q-=257,at=r,ut-=257,256):(I=c,at=m,-1),x=e,F=a,et=R=N=0,E=-1,z=(Q=1<<(W=tt))-1,v===1&&852<Q||v===2&&592<Q)return 1;for(;;){for(Z=x-et,H=l[R]<O?(P=0,l[R]):l[R]>O?(P=at[ut+l[R]],I[q+l[R]]):(P=96,0),p=1<<x-et,e=k=1<<W;d[F+(N>>et)+(k-=p)]=Z<<24|P<<16|H|0,k!==0;);for(p=1<<x-1;N&p;)p>>=1;if(p!==0?(N&=p-1,N+=p):N=0,R++,--V[x]==0){if(x===B)break;x=_[w+l[R]]}if(tt<x&&(N&z)!==E){for(et===0&&(et=tt),F+=e,M=1<<(W=x-et);W+et<B&&!((M-=V[W+et])<=0);)W++,M<<=1;if(Q+=1<<W,v===1&&852<Q||v===2&&592<Q)return 1;d[E=N&z]=tt<<24|W<<16|F-a|0}}return N!==0&&(d[F+N]=x-et<<24|64<<16|0),u.bits=tt,0}},{"../utils/common":41}],51:[function(o,b,h){b.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,b,h){var i=o("../utils/common"),n=0,r=1;function c(f){for(var C=f.length;0<=--C;)f[C]=0}var m=0,v=29,_=256,w=_+1+v,s=30,d=19,a=2*w+1,l=15,u=16,p=7,k=256,E=16,z=17,F=18,O=[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],Z=[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],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=new Array(2*(w+2));c(J);var x=new Array(2*s);c(x);var R=new Array(512);c(R);var e=new Array(256);c(e);var B=new Array(v);c(B);var tt,W,et,M=new Array(s);function Q(f,C,L,U,A){this.static_tree=f,this.extra_bits=C,this.extra_base=L,this.elems=U,this.max_length=A,this.has_stree=f&&f.length}function N(f,C){this.dyn_tree=f,this.max_code=0,this.stat_desc=C}function I(f){return f<256?R[f]:R[256+(f>>>7)]}function q(f,C){f.pending_buf[f.pending++]=255&C,f.pending_buf[f.pending++]=C>>>8&255}function V(f,C,L){f.bi_valid>u-L?(f.bi_buf|=C<<f.bi_valid&65535,q(f,f.bi_buf),f.bi_buf=C>>u-f.bi_valid,f.bi_valid+=L-u):(f.bi_buf|=C<<f.bi_valid&65535,f.bi_valid+=L)}function K(f,C,L){V(f,L[2*C],L[2*C+1])}function at(f,C){for(var L=0;L|=1&f,f>>>=1,L<<=1,0<--C;);return L>>>1}function ut(f,C,L){var U,A,$=new Array(l+1),X=0;for(U=1;U<=l;U++)$[U]=X=X+L[U-1]<<1;for(A=0;A<=C;A++){var G=f[2*A+1];G!==0&&(f[2*A]=at($[G]++,G))}}function rt(f){var C;for(C=0;C<w;C++)f.dyn_ltree[2*C]=0;for(C=0;C<s;C++)f.dyn_dtree[2*C]=0;for(C=0;C<d;C++)f.bl_tree[2*C]=0;f.dyn_ltree[2*k]=1,f.opt_len=f.static_len=0,f.last_lit=f.matches=0}function st(f){8<f.bi_valid?q(f,f.bi_buf):0<f.bi_valid&&(f.pending_buf[f.pending++]=f.bi_buf),f.bi_buf=0,f.bi_valid=0}function ct(f,C,L,U){var A=2*C,$=2*L;return f[A]<f[$]||f[A]===f[$]&&U[C]<=U[L]}function ot(f,C,L){for(var U=f.heap[L],A=L<<1;A<=f.heap_len&&(A<f.heap_len&&ct(C,f.heap[A+1],f.heap[A],f.depth)&&A++,!ct(C,U,f.heap[A],f.depth));)f.heap[L]=f.heap[A],L=A,A<<=1;f.heap[L]=U}function ft(f,C,L){var U,A,$,X,G=0;if(f.last_lit!==0)for(;U=f.pending_buf[f.d_buf+2*G]<<8|f.pending_buf[f.d_buf+2*G+1],A=f.pending_buf[f.l_buf+G],G++,U===0?K(f,A,C):(K(f,($=e[A])+_+1,C),(X=O[$])!==0&&V(f,A-=B[$],X),K(f,$=I(--U),L),(X=Z[$])!==0&&V(f,U-=M[$],X)),G<f.last_lit;);K(f,k,C)}function dt(f,C){var L,U,A,$=C.dyn_tree,X=C.stat_desc.static_tree,G=C.stat_desc.has_stree,Y=C.stat_desc.elems,it=-1;for(f.heap_len=0,f.heap_max=a,L=0;L<Y;L++)$[2*L]!==0?(f.heap[++f.heap_len]=it=L,f.depth[L]=0):$[2*L+1]=0;for(;f.heap_len<2;)$[2*(A=f.heap[++f.heap_len]=it<2?++it:0)]=1,f.depth[A]=0,f.opt_len--,G&&(f.static_len-=X[2*A+1]);for(C.max_code=it,L=f.heap_len>>1;1<=L;L--)ot(f,$,L);for(A=Y;L=f.heap[1],f.heap[1]=f.heap[f.heap_len--],ot(f,$,1),U=f.heap[1],f.heap[--f.heap_max]=L,f.heap[--f.heap_max]=U,$[2*A]=$[2*L]+$[2*U],f.depth[A]=(f.depth[L]>=f.depth[U]?f.depth[L]:f.depth[U])+1,$[2*L+1]=$[2*U+1]=A,f.heap[1]=A++,ot(f,$,1),2<=f.heap_len;);f.heap[--f.heap_max]=f.heap[1],(function(nt,ht){var _t,pt,bt,lt,vt,Et,mt=ht.dyn_tree,Ot=ht.max_code,qt=ht.stat_desc.static_tree,Jt=ht.stat_desc.has_stree,Qt=ht.stat_desc.extra_bits,Rt=ht.stat_desc.extra_base,yt=ht.stat_desc.max_length,wt=0;for(lt=0;lt<=l;lt++)nt.bl_count[lt]=0;for(mt[2*nt.heap[nt.heap_max]+1]=0,_t=nt.heap_max+1;_t<a;_t++)yt<(lt=mt[2*mt[2*(pt=nt.heap[_t])+1]+1]+1)&&(lt=yt,wt++),mt[2*pt+1]=lt,Ot<pt||(nt.bl_count[lt]++,vt=0,Rt<=pt&&(vt=Qt[pt-Rt]),Et=mt[2*pt],nt.opt_len+=Et*(lt+vt),Jt&&(nt.static_len+=Et*(qt[2*pt+1]+vt)));if(wt!==0){do{for(lt=yt-1;nt.bl_count[lt]===0;)lt--;nt.bl_count[lt]--,nt.bl_count[lt+1]+=2,nt.bl_count[yt]--,wt-=2}while(0<wt);for(lt=yt;lt!==0;lt--)for(pt=nt.bl_count[lt];pt!==0;)Ot<(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--)}})(f,C),ut($,it,f.bl_count)}function t(f,C,L){var U,A,$=-1,X=C[1],G=0,Y=7,it=4;for(X===0&&(Y=138,it=3),C[2*(L+1)+1]=65535,U=0;U<=L;U++)A=X,X=C[2*(U+1)+1],++G<Y&&A===X||(G<it?f.bl_tree[2*A]+=G:A!==0?(A!==$&&f.bl_tree[2*A]++,f.bl_tree[2*E]++):G<=10?f.bl_tree[2*z]++:f.bl_tree[2*F]++,$=A,it=(G=0)===X?(Y=138,3):A===X?(Y=6,3):(Y=7,4))}function T(f,C,L){var U,A,$=-1,X=C[1],G=0,Y=7,it=4;for(X===0&&(Y=138,it=3),U=0;U<=L;U++)if(A=X,X=C[2*(U+1)+1],!(++G<Y&&A===X)){if(G<it)for(;K(f,A,f.bl_tree),--G!=0;);else A!==0?(A!==$&&(K(f,A,f.bl_tree),G--),K(f,E,f.bl_tree),V(f,G-3,2)):G<=10?(K(f,z,f.bl_tree),V(f,G-3,3)):(K(f,F,f.bl_tree),V(f,G-11,7));$=A,it=(G=0)===X?(Y=138,3):A===X?(Y=6,3):(Y=7,4)}}c(M);var j=!1;function g(f,C,L,U){V(f,(m<<1)+(U?1:0),3),(function(A,$,X,G){st(A),q(A,X),q(A,~X),i.arraySet(A.pending_buf,A.window,$,X,A.pending),A.pending+=X})(f,C,L)}h._tr_init=function(f){j||((function(){var C,L,U,A,$,X=new Array(l+1);for(A=U=0;A<v-1;A++)for(B[A]=U,C=0;C<1<<O[A];C++)e[U++]=A;for(e[U-1]=A,A=$=0;A<16;A++)for(M[A]=$,C=0;C<1<<Z[A];C++)R[$++]=A;for($>>=7;A<s;A++)for(M[A]=$<<7,C=0;C<1<<Z[A]-7;C++)R[256+$++]=A;for(L=0;L<=l;L++)X[L]=0;for(C=0;C<=143;)J[2*C+1]=8,C++,X[8]++;for(;C<=255;)J[2*C+1]=9,C++,X[9]++;for(;C<=279;)J[2*C+1]=7,C++,X[7]++;for(;C<=287;)J[2*C+1]=8,C++,X[8]++;for(ut(J,w+1,X),C=0;C<s;C++)x[2*C+1]=5,x[2*C]=at(C,5);tt=new Q(J,O,_+1,w,l),W=new Q(x,Z,0,s,l),et=new Q(new Array(0),P,0,d,p)})(),j=!0),f.l_desc=new N(f.dyn_ltree,tt),f.d_desc=new N(f.dyn_dtree,W),f.bl_desc=new N(f.bl_tree,et),f.bi_buf=0,f.bi_valid=0,rt(f)},h._tr_stored_block=g,h._tr_flush_block=function(f,C,L,U){var A,$,X=0;0<f.level?(f.strm.data_type===2&&(f.strm.data_type=(function(G){var Y,it=4093624447;for(Y=0;Y<=31;Y++,it>>>=1)if(1&it&&G.dyn_ltree[2*Y]!==0)return n;if(G.dyn_ltree[18]!==0||G.dyn_ltree[20]!==0||G.dyn_ltree[26]!==0)return r;for(Y=32;Y<_;Y++)if(G.dyn_ltree[2*Y]!==0)return r;return n})(f)),dt(f,f.l_desc),dt(f,f.d_desc),X=(function(G){var Y;for(t(G,G.dyn_ltree,G.l_desc.max_code),t(G,G.dyn_dtree,G.d_desc.max_code),dt(G,G.bl_desc),Y=d-1;3<=Y&&G.bl_tree[2*H[Y]+1]===0;Y--);return G.opt_len+=3*(Y+1)+5+5+4,Y})(f),A=f.opt_len+3+7>>>3,($=f.static_len+3+7>>>3)<=A&&(A=$)):A=$=L+5,L+4<=A&&C!==-1?g(f,C,L,U):f.strategy===4||$===A?(V(f,2+(U?1:0),3),ft(f,J,x)):(V(f,4+(U?1:0),3),(function(G,Y,it,nt){var ht;for(V(G,Y-257,5),V(G,it-1,5),V(G,nt-4,4),ht=0;ht<nt;ht++)V(G,G.bl_tree[2*H[ht]+1],3);T(G,G.dyn_ltree,Y-1),T(G,G.dyn_dtree,it-1)})(f,f.l_desc.max_code+1,f.d_desc.max_code+1,X+1),ft(f,f.dyn_ltree,f.dyn_dtree)),rt(f),U&&st(f)},h._tr_tally=function(f,C,L){return f.pending_buf[f.d_buf+2*f.last_lit]=C>>>8&255,f.pending_buf[f.d_buf+2*f.last_lit+1]=255&C,f.pending_buf[f.l_buf+f.last_lit]=255&L,f.last_lit++,C===0?f.dyn_ltree[2*L]++:(f.matches++,C--,f.dyn_ltree[2*(e[L]+_+1)]++,f.dyn_dtree[2*I(C)]++),f.last_lit===f.lit_bufsize-1},h._tr_align=function(f){V(f,2,3),K(f,k,J),(function(C){C.bi_valid===16?(q(C,C.bi_buf),C.bi_buf=0,C.bi_valid=0):8<=C.bi_valid&&(C.pending_buf[C.pending++]=255&C.bi_buf,C.bi_buf>>=8,C.bi_valid-=8)})(f)}},{"../utils/common":41}],53:[function(o,b,h){b.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,b,h){(function(i){(function(n,r){if(!n.setImmediate){var c,m,v,_,w=1,s={},d=!1,a=n.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(n);l=l&&l.setTimeout?l:n,c={}.toString.call(n.process)==="[object process]"?function(E){process.nextTick(function(){p(E)})}:(function(){if(n.postMessage&&!n.importScripts){var E=!0,z=n.onmessage;return n.onmessage=function(){E=!1},n.postMessage("","*"),n.onmessage=z,E}})()?(_="setImmediate$"+Math.random()+"$",n.addEventListener?n.addEventListener("message",k,!1):n.attachEvent("onmessage",k),function(E){n.postMessage(_+E,"*")}):n.MessageChannel?((v=new MessageChannel).port1.onmessage=function(E){p(E.data)},function(E){v.port2.postMessage(E)}):a&&"onreadystatechange"in a.createElement("script")?(m=a.documentElement,function(E){var z=a.createElement("script");z.onreadystatechange=function(){p(E),z.onreadystatechange=null,m.removeChild(z),z=null},m.appendChild(z)}):function(E){setTimeout(p,0,E)},l.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var z=new Array(arguments.length-1),F=0;F<z.length;F++)z[F]=arguments[F+1];var O={callback:E,args:z};return s[w]=O,c(w),w++},l.clearImmediate=u}function u(E){delete s[E]}function p(E){if(d)setTimeout(p,0,E);else{var z=s[E];if(z){d=!0;try{(function(F){var O=F.callback,Z=F.args;switch(Z.length){case 0:O();break;case 1:O(Z[0]);break;case 2:O(Z[0],Z[1]);break;case 3:O(Z[0],Z[1],Z[2]);break;default:O.apply(r,Z)}})(z)}finally{u(E),d=!1}}}}function k(E){E.source===n&&typeof E.data=="string"&&E.data.indexOf(_)===0&&p(+E.data.slice(_.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof xt<"u"?xt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(At)),At.exports}var Xe=Ve();const Ye=ne(Xe);async function qe(y){let S;try{S=await Ye.loadAsync(y)}catch(r){return{format:"obsidian-zip",notes:[],errors:[{sourcePath:y.name,reason:`Could not read zip: ${r instanceof Error?r.message:String(r)}`}],tags:[],attachments:[]}}const o=[],b=[],h=[],i=[];S.forEach((r,c)=>{i.push({path:r,obj:c})}),i.sort((r,c)=>r.path.localeCompare(c.path));const n=er(i);for(const{path:r,obj:c}of i){if(c.dir||Xt(r))continue;const m=rr(r,n);if(Yt(r)){try{const v=await c.async("string"),_=Kt({sourcePath:m,raw:v});o.push(_)}catch(v){b.push({sourcePath:r,reason:v instanceof Error?v.message:String(v)})}continue}try{const v=await c.async("blob"),_=Je(m);h.push({sourcePath:m,filename:_,ext:Qe(_),kind:_e(_),blob:v})}catch(v){b.push({sourcePath:r,reason:v instanceof Error?v.message:String(v)})}}return{format:"obsidian-zip",notes:o,errors:b,tags:nr(o),attachments:h}}function Je(y){const S=y.lastIndexOf("/");return S>=0?y.slice(S+1):y}function Qe(y){const S=y.lastIndexOf(".");return S>=0?y.slice(S+1).toLowerCase():""}const tr=new Set([".obsidian",".trash",".git",".parachute","__MACOSX","node_modules"]);function Xt(y){return y.split("/").some(o=>tr.has(o)||o.startsWith("."))}function Yt(y){const S=y.toLowerCase();return S.endsWith(".md")||S.endsWith(".markdown")}function er(y){let S=null;for(const o of y){if(Xt(o.path)||!Yt(o.path))continue;const b=o.path.split("/")[0]??"";if(!o.path.includes("/"))return null;if(S===null)S=b;else if(b!==S)return null}return S}function rr(y,S){return S&&y.startsWith(`${S}/`)?y.slice(S.length+1):y}function nr(y){const S=new Set;for(const o of y)for(const b of o.tags)S.add(b);return[...S].sort()}function hr(){const y=se(s=>s.getActiveVault()),S=ie(),o=ae(),[b]=oe(),h=le(s=>s.push),[i,n]=gt.useState({kind:"pick"}),r=gt.useRef(null),c=gt.useRef(null);if(!y){const s=b.get("url");if(s){const d=`/add?url=${encodeURIComponent(s)}&redirect=${encodeURIComponent("/import")}`;return D.jsx(Tt,{to:d,replace:!0})}return D.jsx(Tt,{to:"/",replace:!0})}const m=gt.useCallback(async s=>{if(s.length===0)return;n({kind:"parsing"});const d=Be(s);try{let a;if(d==="obsidian-zip"){const l=s.find(Ht);if(!l){h("No zip file found in selection","error"),n({kind:"pick"});return}a=await qe(l)}else d==="loose-markdown"?a=await Ge(s.filter(jt)):a={format:d,notes:[],errors:s.map(l=>({sourcePath:l.name,reason:"Unrecognized format (expected .zip, .md, or .markdown)."})),tags:[],attachments:[]};n({kind:"review",parsed:a})}catch(a){h(a instanceof Error?a.message:"Parse failed","error"),n({kind:"pick"})}},[h]),v=gt.useCallback(async()=>{if(i.kind!=="review")return;if(!S){h("Vault session unavailable — reconnect first","error");return}const s=new AbortController;c.current=s,n({kind:"importing",parsed:i.parsed,progress:{done:0,total:i.parsed.notes.length}});const d=await Ie({client:S,parsed:i.parsed,signal:s.signal,onProgress:a=>{n(l=>l.kind==="importing"?{...l,progress:a}:l)}});c.current=null,n({kind:"done",report:d,parsed:i.parsed})},[i,S,h]),_=gt.useCallback(()=>{var s;(s=c.current)==null||s.abort()},[]),w=gt.useCallback(()=>{n({kind:"pick"}),r.current&&(r.current.value="")},[]);return D.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-7 md:px-6 md:py-10",children:[D.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:D.jsx(ce,{to:"/",className:"hover:text-accent",children:"← All notes"})}),D.jsxs("header",{className:"mb-6",children:[D.jsxs("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:["Import notes into ",D.jsx("span",{className:"text-accent",children:y.name})]}),D.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."})]}),i.kind==="pick"||i.kind==="parsing"?D.jsx(sr,{parsing:i.kind==="parsing",onFiles:m,inputRef:r}):null,i.kind==="review"?D.jsx(ir,{parsed:i.parsed,onConfirm:v,onBack:w}):null,i.kind==="importing"?D.jsx(ar,{progress:i.progress,onCancel:_}):null,i.kind==="done"?D.jsx(or,{report:i.report,parsed:i.parsed,onAnother:w,onHome:()=>o("/")}):null]})}function sr({parsing:y,onFiles:S,inputRef:o}){const b=h=>{const i=Array.from(h.target.files??[]);i.length>0&&S(i)};return D.jsx("section",{children:D.jsx(he,{onDropFiles:S,className:"rounded-md border border-border bg-card",hint:"zip or markdown",children:D.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-4 p-8 text-center",children:[D.jsx("p",{className:"font-serif text-lg",children:y?"Reading files…":"Drop a file here"}),D.jsx("p",{className:"text-sm text-fg-dim",children:"Accepts an Obsidian vault `.zip`, or one or more `.md` / `.markdown` files."}),D.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[D.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-[--color-on-accent] hover:bg-accent-hover",children:[y?"Reading…":"Choose files",D.jsx("input",{ref:o,type:"file",className:"sr-only",accept:".zip,.md,.markdown",multiple:!0,disabled:y,onChange:b})]}),D.jsx("span",{className:"text-xs text-fg-dim",children:"— or drag and drop above"})]}),D.jsxs("details",{className:"mt-2 text-left text-xs text-fg-dim",children:[D.jsx("summary",{className:"cursor-pointer text-fg-muted hover:text-accent",children:"What about other tools?"}),D.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"," ",D.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 ir({parsed:y,onConfirm:S,onBack:o}){const{notes:b,errors:h,tags:i,attachments:n}=y,r=b.length,c=n.filter(d=>["image","pdf","audio","video"].includes(d.kind)).length,m=n.filter(d=>d.kind==="text").length,v=n.filter(d=>d.kind==="unsupported").length,_=r>0||c>0||m>0,w=gt.useMemo(()=>b.slice(0,8),[b]),s=gt.useMemo(()=>i.slice(0,12),[i]);return D.jsxs("section",{className:"space-y-6",children:[D.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[D.jsx("h2",{className:"font-serif text-lg",children:"Dry run"}),D.jsxs("p",{className:"mt-1 text-sm text-fg-muted",children:["Detected format: ",D.jsx(lr,{format:y.format}),"."," ",D.jsx("strong",{className:"text-fg",children:r})," ",r===1?"note":"notes"," will be created."," ",c>0?D.jsxs("span",{className:"text-fg-muted",children:[D.jsx("strong",{className:"text-fg",children:c})," attachment",c===1?"":"s"," (images / PDFs / audio) will come across."," "]}):null,m>0?D.jsxs("span",{className:"text-fg-muted",children:[m," data file",m===1?"":"s"," (json / csv / yaml / txt) will be saved as notes."," "]}):null,v>0?D.jsxs("span",{className:"text-fg-dim",children:[v," file",v===1?"":"s"," can't be imported (not a vault file type)."," "]}):null,h.length>0?D.jsxs("span",{className:"text-fg-dim",children:[h.length," file(s) couldn't be parsed."]}):null]}),i.length>0?D.jsxs("p",{className:"mt-2 text-sm text-fg-muted",children:[D.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Tags found"})," ",s.map(d=>D.jsxs("span",{className:"ml-1 inline-block rounded bg-bg/60 px-1.5 py-0.5 font-mono text-xs text-fg",children:["#",d]},d)),i.length>s.length?D.jsxs("span",{className:"ml-2 text-fg-dim",children:["+",i.length-s.length," more"]}):null]}):null]}),w.length>0?D.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[D.jsxs("h3",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:["Preview (",w.length," of ",r,")"]}),D.jsx("ul",{className:"space-y-1.5 font-mono text-xs",children:w.map(d=>D.jsxs("li",{className:"flex items-center justify-between gap-3",children:[D.jsx("span",{className:"truncate text-fg",children:d.path||d.sourcePath}),D.jsx("span",{className:"shrink-0 text-fg-dim",children:d.tags.length>0?`${d.tags.length} tag${d.tags.length===1?"":"s"}`:""})]},d.sourcePath))})]}):null,h.length>0?D.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[D.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[h.length," file(s) skipped during parse"]}),D.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:h.map(d=>D.jsxs("li",{className:"flex flex-col gap-0.5",children:[D.jsx("span",{className:"font-mono text-fg",children:d.sourcePath}),D.jsx("span",{className:"text-fg-dim",children:d.reason})]},d.sourcePath))})]}):null,D.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[D.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"}),D.jsxs("button",{type:"button",onClick:S,disabled:!_,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:opacity-40",children:["Run import (",r," ",r===1?"note":"notes",c>0?` + ${c} attachment${c===1?"":"s"}`:"",")"]})]})]})}function ar({progress:y,onCancel:S}){const o=y.total===0?0:Math.round(y.done/y.total*100);return D.jsxs("section",{className:"space-y-4 rounded-md border border-border bg-card p-6",children:[D.jsx("h2",{className:"font-serif text-lg",children:"Importing…"}),D.jsxs("p",{className:"text-sm text-fg-muted",children:[y.done," / ",y.total," notes processed."]}),D.jsx("div",{className:"h-2 w-full overflow-hidden rounded bg-bg/60",role:"progressbar",tabIndex:0,"aria-label":"Import progress","aria-valuenow":y.done,"aria-valuemin":0,"aria-valuemax":y.total,children:D.jsx("div",{className:"h-full bg-accent transition-all",style:{width:`${o}%`}})}),D.jsx("div",{className:"flex justify-end",children:D.jsx("button",{type:"button",onClick:S,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 or({report:y,parsed:S,onAnother:o,onHome:b}){const h=y.outcomes.filter(m=>m.status==="errored"),i=y.outcomes.filter(m=>m.status==="skipped"),n=y.attachmentOutcomes.filter(m=>m.status==="skipped"),r=y.attachmentOutcomes.filter(m=>m.status==="errored"),c=y.attachmentOutcomes.length>0;return D.jsxs("section",{className:"space-y-6",children:[D.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[D.jsx("h2",{className:"font-serif text-lg",children:"Import complete"}),D.jsxs("ul",{className:"mt-3 space-y-1 text-sm",children:[D.jsxs("li",{children:[D.jsx("span",{className:"text-accent",children:y.created})," notes created"]}),D.jsxs("li",{children:[D.jsx("span",{className:"text-fg-muted",children:y.skipped})," notes skipped (already in vault)"]}),D.jsxs("li",{children:[D.jsx("span",{className:y.errored>0?"text-red-400":"text-fg-muted",children:y.errored})," ","notes errored"]}),c?D.jsxs(D.Fragment,{children:[D.jsxs("li",{className:"pt-1",children:[D.jsx("span",{className:"text-accent",children:y.attachmentsUploaded})," attachments imported"]}),y.filesImportedAsNotes>0?D.jsxs("li",{children:[D.jsx("span",{className:"text-accent",children:y.filesImportedAsNotes})," data files imported as notes"]}):null,y.attachmentsSkipped>0?D.jsxs("li",{children:[D.jsx("span",{className:"text-fg-muted",children:y.attachmentsSkipped})," attachments skipped (not a vault file type)"]}):null,y.attachmentsErrored>0?D.jsxs("li",{children:[D.jsx("span",{className:"text-red-400",children:y.attachmentsErrored})," attachments errored"]}):null]}):null]}),S.errors.length>0?D.jsxs("p",{className:"mt-2 text-xs text-fg-dim",children:["(Plus ",S.errors.length," file(s) skipped at the parse stage — see above.)"]}):null]}),n.length>0||r.length>0?D.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[D.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[n.length+r.length," attachment(s) not imported as files — why"]}),D.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:[...r,...n].map(m=>D.jsxs("li",{className:"flex flex-col gap-0.5",children:[D.jsx("span",{className:"font-mono text-fg",children:m.sourcePath}),D.jsx("span",{className:"text-fg-dim",children:m.status==="skipped"||m.status==="errored"?m.reason:""})]},`a-${m.sourcePath}`))})]}):null,i.length>0?D.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[D.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[i.length," skipped — vault already had a matching note"]}),D.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:i.map(m=>D.jsxs("li",{className:"flex flex-col gap-0.5",children:[D.jsx("span",{className:"font-mono text-fg",children:m.sourcePath}),D.jsx("span",{className:"text-fg-dim",children:m.status==="skipped"?m.reason:""})]},`s-${m.sourcePath}`))})]}):null,h.length>0?D.jsxs("details",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4",open:!0,children:[D.jsxs("summary",{className:"cursor-pointer text-sm font-medium text-red-400",children:[h.length," errored"]}),D.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:h.map(m=>D.jsxs("li",{className:"flex flex-col gap-0.5",children:[D.jsx("span",{className:"font-mono text-fg",children:m.sourcePath}),D.jsx("span",{className:"text-fg-dim",children:m.status==="errored"?m.reason:""})]},`e-${m.sourcePath}`))})]}):null,D.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[D.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"}),D.jsx("button",{type:"button",onClick:b,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Back to vault"})]})]})}function lr({format:y}){const S=y==="obsidian-zip"?"Obsidian vault (zip)":y==="loose-markdown"?"loose markdown":"unknown";return D.jsx("span",{className:"rounded bg-bg/60 px-1.5 py-0.5 font-mono text-xs text-fg",children:S})}export{hr as Import};
19
+ */var Zt;function Xe(){return Zt||(Zt=1,(function(y,S){(function(o){y.exports=o()})(function(){return(function o(b,h,i){function n(m,v){if(!h[m]){if(!b[m]){var _=typeof St=="function"&&St;if(!v&&_)return _(m,!0);if(r)return r(m,!0);var w=new Error("Cannot find module '"+m+"'");throw w.code="MODULE_NOT_FOUND",w}var s=h[m]={exports:{}};b[m][0].call(s.exports,function(d){var a=b[m][1][d];return n(a||d)},s,s.exports,o,b,h,i)}return h[m].exports}for(var r=typeof St=="function"&&St,c=0;c<i.length;c++)n(i[c]);return n})({1:[function(o,b,h){var i=o("./utils"),n=o("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";h.encode=function(c){for(var m,v,_,w,s,d,a,l=[],u=0,p=c.length,k=p,E=i.getTypeOf(c)!=="string";u<c.length;)k=p-u,_=E?(m=c[u++],v=u<p?c[u++]:0,u<p?c[u++]:0):(m=c.charCodeAt(u++),v=u<p?c.charCodeAt(u++):0,u<p?c.charCodeAt(u++):0),w=m>>2,s=(3&m)<<4|v>>4,d=1<k?(15&v)<<2|_>>6:64,a=2<k?63&_:64,l.push(r.charAt(w)+r.charAt(s)+r.charAt(d)+r.charAt(a));return l.join("")},h.decode=function(c){var m,v,_,w,s,d,a=0,l=0,u="data:";if(c.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var p,k=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===r.charAt(64)&&k--,c.charAt(c.length-2)===r.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=n.uint8array?new Uint8Array(0|k):new Array(0|k);a<c.length;)m=r.indexOf(c.charAt(a++))<<2|(w=r.indexOf(c.charAt(a++)))>>4,v=(15&w)<<4|(s=r.indexOf(c.charAt(a++)))>>2,_=(3&s)<<6|(d=r.indexOf(c.charAt(a++))),p[l++]=m,s!==64&&(p[l++]=v),d!==64&&(p[l++]=_);return p}},{"./support":30,"./utils":32}],2:[function(o,b,h){var i=o("./external"),n=o("./stream/DataWorker"),r=o("./stream/Crc32Probe"),c=o("./stream/DataLengthProbe");function m(v,_,w,s,d){this.compressedSize=v,this.uncompressedSize=_,this.crc32=w,this.compression=s,this.compressedContent=d}m.prototype={getContentWorker:function(){var v=new n(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("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 n(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},m.createWorkerFrom=function(v,_,w){return v.pipe(new r).pipe(new c("uncompressedSize")).pipe(_.compressWorker(w)).pipe(new c("compressedSize")).withStreamInfo("compression",_)},b.exports=m},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(o,b,h){var i=o("./stream/GenericWorker");h.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},h.DEFLATE=o("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(o,b,h){var i=o("./utils"),n=(function(){for(var r,c=[],m=0;m<256;m++){r=m;for(var v=0;v<8;v++)r=1&r?3988292384^r>>>1:r>>>1;c[m]=r}return c})();b.exports=function(r,c){return r!==void 0&&r.length?i.getTypeOf(r)!=="string"?(function(m,v,_,w){var s=n,d=w+_;m^=-1;for(var a=w;a<d;a++)m=m>>>8^s[255&(m^v[a])];return-1^m})(0|c,r,r.length,0):(function(m,v,_,w){var s=n,d=w+_;m^=-1;for(var a=w;a<d;a++)m=m>>>8^s[255&(m^v.charCodeAt(a))];return-1^m})(0|c,r,r.length,0):0}},{"./utils":32}],5:[function(o,b,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,b,h){var i=null;i=typeof Promise<"u"?Promise:o("lie"),b.exports={Promise:i}},{lie:37}],7:[function(o,b,h){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",n=o("pako"),r=o("./utils"),c=o("./stream/GenericWorker"),m=i?"uint8array":"array";function v(_,w){c.call(this,"FlateWorker/"+_),this._pako=null,this._pakoAction=_,this._pakoOptions=w,this.meta={}}h.magic="\b\0",r.inherits(v,c),v.prototype.processChunk=function(_){this.meta=_.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(m,_.data),!1)},v.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var _=this;this._pako.onData=function(w){_.push({data:w,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,b,h){function i(s,d){var a,l="";for(a=0;a<d;a++)l+=String.fromCharCode(255&s),s>>>=8;return l}function n(s,d,a,l,u,p){var k,E,z=s.file,F=s.compression,O=p!==m.utf8encode,Z=r.transformTo("string",p(z.name)),P=r.transformTo("string",m.utf8encode(z.name)),H=z.comment,J=r.transformTo("string",p(H)),x=r.transformTo("string",m.utf8encode(H)),R=P.length!==z.name.length,e=x.length!==H.length,B="",tt="",W="",et=z.dir,M=z.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};d&&!a||(Q.crc32=s.crc32,Q.compressedSize=s.compressedSize,Q.uncompressedSize=s.uncompressedSize);var N=0;d&&(N|=8),O||!R&&!e||(N|=2048);var I=0,q=0;et&&(I|=16),u==="UNIX"?(q=798,I|=(function(V,at){var ut=V;return V||(ut=at?16893:33204),(65535&ut)<<16})(z.unixPermissions,et)):(q=20,I|=(function(V){return 63&(V||0)})(z.dosPermissions)),k=M.getUTCHours(),k<<=6,k|=M.getUTCMinutes(),k<<=5,k|=M.getUTCSeconds()/2,E=M.getUTCFullYear()-1980,E<<=4,E|=M.getUTCMonth()+1,E<<=5,E|=M.getUTCDate(),R&&(tt=i(1,1)+i(v(Z),4)+P,B+="up"+i(tt.length,2)+tt),e&&(W=i(1,1)+i(v(J),4)+x,B+="uc"+i(W.length,2)+W);var X="";return X+=`
20
+ \0`,X+=i(N,2),X+=F.magic,X+=i(k,2),X+=i(E,2),X+=i(Q.crc32,4),X+=i(Q.compressedSize,4),X+=i(Q.uncompressedSize,4),X+=i(Z.length,2),X+=i(B.length,2),{fileRecord:_.LOCAL_FILE_HEADER+X+Z+B,dirRecord:_.CENTRAL_FILE_HEADER+i(q,2)+X+i(J.length,2)+"\0\0\0\0"+i(I,4)+i(l,4)+Z+B+J}}var r=o("../utils"),c=o("../stream/GenericWorker"),m=o("../utf8"),v=o("../crc32"),_=o("../signature");function w(s,d,a,l){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=a,this.encodeFileName=l,this.streamFiles=s,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(w,c),w.prototype.push=function(s){var d=s.meta.percent||0,a=this.entriesCount,l=this._sources.length;this.accumulate?this.contentBuffer.push(s):(this.bytesWritten+=s.data.length,c.prototype.push.call(this,{data:s.data,meta:{currentFile:this.currentFile,percent:a?(d+100*(a-l-1))/a:100}}))},w.prototype.openedSource=function(s){this.currentSourceOffset=this.bytesWritten,this.currentFile=s.file.name;var d=this.streamFiles&&!s.file.dir;if(d){var a=n(s,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:a.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(s){this.accumulate=!1;var d=this.streamFiles&&!s.file.dir,a=n(s,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(a.dirRecord),d)this.push({data:(function(l){return _.DATA_DESCRIPTOR+i(l.crc32,4)+i(l.compressedSize,4)+i(l.uncompressedSize,4)})(s),meta:{percent:100}});else for(this.push({data:a.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var s=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var a=this.bytesWritten-s,l=(function(u,p,k,E,z){var F=r.transformTo("string",z(E));return _.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(u,2)+i(u,2)+i(p,4)+i(k,4)+i(F.length,2)+F})(this.dirRecords.length,a,s,this.zipComment,this.encodeFileName);this.push({data:l,meta:{percent:100}})},w.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},w.prototype.registerPrevious=function(s){this._sources.push(s);var d=this;return s.on("data",function(a){d.processChunk(a)}),s.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),s.on("error",function(a){d.error(a)}),this},w.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},w.prototype.error=function(s){var d=this._sources;if(!c.prototype.error.call(this,s))return!1;for(var a=0;a<d.length;a++)try{d[a].error(s)}catch{}return!0},w.prototype.lock=function(){c.prototype.lock.call(this);for(var s=this._sources,d=0;d<s.length;d++)s[d].lock()},b.exports=w},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(o,b,h){var i=o("../compressions"),n=o("./ZipFileWorker");h.generateWorker=function(r,c,m){var v=new n(c.streamFiles,m,c.platform,c.encodeFileName),_=0;try{r.forEach(function(w,s){_++;var d=(function(p,k){var E=p||k,z=i[E];if(!z)throw new Error(E+" is not a valid compression method !");return z})(s.options.compression,c.compression),a=s.options.compressionOptions||c.compressionOptions||{},l=s.dir,u=s.date;s._compressWorker(d,a).withStreamInfo("file",{name:w,dir:l,date:u,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(v)}),v.entriesCount=_}catch(w){v.error(w)}return v}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(o,b,h){function i(){if(!(this instanceof i))return new i;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 n=new i;for(var r in this)typeof this[r]!="function"&&(n[r]=this[r]);return n}}(i.prototype=o("./object")).loadAsync=o("./load"),i.support=o("./support"),i.defaults=o("./defaults"),i.version="3.10.1",i.loadAsync=function(n,r){return new i().loadAsync(n,r)},i.external=o("./external"),b.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(o,b,h){var i=o("./utils"),n=o("./external"),r=o("./utf8"),c=o("./zipEntries"),m=o("./stream/Crc32Probe"),v=o("./nodejsUtils");function _(w){return new n.Promise(function(s,d){var a=w.decompressed.getContentWorker().pipe(new m);a.on("error",function(l){d(l)}).on("end",function(){a.streamInfo.crc32!==w.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):s()}).resume()})}b.exports=function(w,s){var d=this;return s=i.extend(s||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),v.isNode&&v.isStream(w)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",w,!0,s.optimizedBinaryString,s.base64).then(function(a){var l=new c(s);return l.load(a),l}).then(function(a){var l=[n.Promise.resolve(a)],u=a.files;if(s.checkCRC32)for(var p=0;p<u.length;p++)l.push(_(u[p]));return n.Promise.all(l)}).then(function(a){for(var l=a.shift(),u=l.files,p=0;p<u.length;p++){var k=u[p],E=k.fileNameStr,z=i.resolve(k.fileNameStr);d.file(z,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:s.createFolders}),k.dir||(d.file(z).unsafeOriginalName=E)}return l.zipComment.length&&(d.comment=l.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(o,b,h){var i=o("../utils"),n=o("../stream/GenericWorker");function r(c,m){n.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(m)}i.inherits(r,n),r.prototype._bindStream=function(c){var m=this;(this._stream=c).pause(),c.on("data",function(v){m.push({data:v,meta:{percent:0}})}).on("error",function(v){m.isPaused?this.generatedError=v:m.error(v)}).on("end",function(){m.isPaused?m._upstreamEnded=!0:m.end()})},r.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},b.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(o,b,h){var i=o("readable-stream").Readable;function n(r,c,m){i.call(this,c),this._helper=r;var v=this;r.on("data",function(_,w){v.push(_)||v._helper.pause(),m&&m(w)}).on("error",function(_){v.emit("error",_)}).on("end",function(){v.push(null)})}o("../utils").inherits(n,i),n.prototype._read=function(){this._helper.resume()},b.exports=n},{"../utils":32,"readable-stream":16}],14:[function(o,b,h){b.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,n){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,n);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,n)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var n=new Buffer(i);return n.fill(0),n},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(o,b,h){function i(z,F,O){var Z,P=r.getTypeOf(F),H=r.extend(O||{},v);H.date=H.date||new Date,H.compression!==null&&(H.compression=H.compression.toUpperCase()),typeof H.unixPermissions=="string"&&(H.unixPermissions=parseInt(H.unixPermissions,8)),H.unixPermissions&&16384&H.unixPermissions&&(H.dir=!0),H.dosPermissions&&16&H.dosPermissions&&(H.dir=!0),H.dir&&(z=u(z)),H.createFolders&&(Z=l(z))&&p.call(this,Z,!0);var J=P==="string"&&H.binary===!1&&H.base64===!1;O&&O.binary!==void 0||(H.binary=!J),(F instanceof _&&F.uncompressedSize===0||H.dir||!F||F.length===0)&&(H.base64=!1,H.binary=!0,F="",H.compression="STORE",P="string");var x=null;x=F instanceof _||F instanceof c?F:d.isNode&&d.isStream(F)?new a(z,F):r.prepareContent(z,F,H.binary,H.optimizedBinaryString,H.base64);var R=new w(z,x,H);this.files[z]=R}var n=o("./utf8"),r=o("./utils"),c=o("./stream/GenericWorker"),m=o("./stream/StreamHelper"),v=o("./defaults"),_=o("./compressedObject"),w=o("./zipObject"),s=o("./generate"),d=o("./nodejsUtils"),a=o("./nodejs/NodejsStreamInputAdapter"),l=function(z){z.slice(-1)==="/"&&(z=z.substring(0,z.length-1));var F=z.lastIndexOf("/");return 0<F?z.substring(0,F):""},u=function(z){return z.slice(-1)!=="/"&&(z+="/"),z},p=function(z,F){return F=F!==void 0?F:v.createFolders,z=u(z),this.files[z]||i.call(this,z,null,{dir:!0,createFolders:F}),this.files[z]};function k(z){return Object.prototype.toString.call(z)==="[object RegExp]"}var E={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(z){var F,O,Z;for(F in this.files)Z=this.files[F],(O=F.slice(this.root.length,F.length))&&F.slice(0,this.root.length)===this.root&&z(O,Z)},filter:function(z){var F=[];return this.forEach(function(O,Z){z(O,Z)&&F.push(Z)}),F},file:function(z,F,O){if(arguments.length!==1)return z=this.root+z,i.call(this,z,F,O),this;if(k(z)){var Z=z;return this.filter(function(H,J){return!J.dir&&Z.test(H)})}var P=this.files[this.root+z];return P&&!P.dir?P:null},folder:function(z){if(!z)return this;if(k(z))return this.filter(function(P,H){return H.dir&&z.test(P)});var F=this.root+z,O=p.call(this,F),Z=this.clone();return Z.root=O.name,Z},remove:function(z){z=this.root+z;var F=this.files[z];if(F||(z.slice(-1)!=="/"&&(z+="/"),F=this.files[z]),F&&!F.dir)delete this.files[z];else for(var O=this.filter(function(P,H){return H.name.slice(0,z.length)===z}),Z=0;Z<O.length;Z++)delete this.files[O[Z].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(z){var F,O={};try{if((O=r.extend(z||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=O.type.toLowerCase(),O.compression=O.compression.toUpperCase(),O.type==="binarystring"&&(O.type="string"),!O.type)throw new Error("No output type specified.");r.checkSupport(O.type),O.platform!=="darwin"&&O.platform!=="freebsd"&&O.platform!=="linux"&&O.platform!=="sunos"||(O.platform="UNIX"),O.platform==="win32"&&(O.platform="DOS");var Z=O.comment||this.comment||"";F=s.generateWorker(this,O,Z)}catch(P){(F=new c("error")).error(P)}return new m(F,O.type||"string",O.mimeType)},generateAsync:function(z,F){return this.generateInternalStream(z).accumulate(F)},generateNodeStream:function(z,F){return(z=z||{}).type||(z.type="nodebuffer"),this.generateInternalStream(z).toNodejsStream(F)}};b.exports=E},{"./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,b,h){b.exports=o("stream")},{stream:void 0}],17:[function(o,b,h){var i=o("./DataReader");function n(r){i.call(this,r);for(var c=0;c<this.data.length;c++)r[c]=255&r[c]}o("../utils").inherits(n,i),n.prototype.byteAt=function(r){return this.data[this.zero+r]},n.prototype.lastIndexOfSignature=function(r){for(var c=r.charCodeAt(0),m=r.charCodeAt(1),v=r.charCodeAt(2),_=r.charCodeAt(3),w=this.length-4;0<=w;--w)if(this.data[w]===c&&this.data[w+1]===m&&this.data[w+2]===v&&this.data[w+3]===_)return w-this.zero;return-1},n.prototype.readAndCheckSignature=function(r){var c=r.charCodeAt(0),m=r.charCodeAt(1),v=r.charCodeAt(2),_=r.charCodeAt(3),w=this.readData(4);return c===w[0]&&m===w[1]&&v===w[2]&&_===w[3]},n.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},b.exports=n},{"../utils":32,"./DataReader":18}],18:[function(o,b,h){var i=o("../utils");function n(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var c,m=0;for(this.checkOffset(r),c=this.index+r-1;c>=this.index;c--)m=(m<<8)+this.byteAt(c);return this.index+=r,m},readString:function(r){return i.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},b.exports=n},{"../utils":32}],19:[function(o,b,h){var i=o("./Uint8ArrayReader");function n(r){i.call(this,r)}o("../utils").inherits(n,i),n.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},b.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(o,b,h){var i=o("./DataReader");function n(r){i.call(this,r)}o("../utils").inherits(n,i),n.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},n.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},n.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},n.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},b.exports=n},{"../utils":32,"./DataReader":18}],21:[function(o,b,h){var i=o("./ArrayReader");function n(r){i.call(this,r)}o("../utils").inherits(n,i),n.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},b.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(o,b,h){var i=o("../utils"),n=o("../support"),r=o("./ArrayReader"),c=o("./StringReader"),m=o("./NodeBufferReader"),v=o("./Uint8ArrayReader");b.exports=function(_){var w=i.getTypeOf(_);return i.checkSupport(w),w!=="string"||n.uint8array?w==="nodebuffer"?new m(_):n.uint8array?new v(i.transformTo("uint8array",_)):new r(i.transformTo("array",_)):new c(_)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(o,b,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,b,h){var i=o("./GenericWorker"),n=o("../utils");function r(c){i.call(this,"ConvertWorker to "+c),this.destType=c}n.inherits(r,i),r.prototype.processChunk=function(c){this.push({data:n.transformTo(this.destType,c.data),meta:c.meta})},b.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(o,b,h){var i=o("./GenericWorker"),n=o("../crc32");function r(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}o("../utils").inherits(r,i),r.prototype.processChunk=function(c){this.streamInfo.crc32=n(c.data,this.streamInfo.crc32||0),this.push(c)},b.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(o,b,h){var i=o("../utils"),n=o("./GenericWorker");function r(c){n.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}i.inherits(r,n),r.prototype.processChunk=function(c){if(c){var m=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=m+c.data.length}n.prototype.processChunk.call(this,c)},b.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(o,b,h){var i=o("../utils"),n=o("./GenericWorker");function r(c){n.call(this,"DataWorker");var m=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(v){m.dataIsReady=!0,m.data=v,m.max=v&&v.length||0,m.type=i.getTypeOf(v),m.isPaused||m._tickAndRepeat()},function(v){m.error(v)})}i.inherits(r,n),r.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,m=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,m);break;case"uint8array":c=this.data.subarray(this.index,m);break;case"array":case"nodebuffer":c=this.data.slice(this.index,m)}return this.index=m,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},b.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(o,b,h){function i(n){this.name=n||"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}i.prototype={push:function(n){this.emit("data",n)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(n){this.emit("error",n)}return!0},error:function(n){return!this.isFinished&&(this.isPaused?this.generatedError=n:(this.isFinished=!0,this.emit("error",n),this.previous&&this.previous.error(n),this.cleanUp()),!0)},on:function(n,r){return this._listeners[n].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(n,r){if(this._listeners[n])for(var c=0;c<this._listeners[n].length;c++)this._listeners[n][c].call(this,r)},pipe:function(n){return n.registerPrevious(this)},registerPrevious:function(n){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=n.streamInfo,this.mergeStreamInfo(),this.previous=n;var r=this;return n.on("data",function(c){r.processChunk(c)}),n.on("end",function(){r.end()}),n.on("error",function(c){r.error(c)}),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 n=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),n=!0),this.previous&&this.previous.resume(),!n},flush:function(){},processChunk:function(n){this.push(n)},withStreamInfo:function(n,r){return this.extraStreamInfo[n]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var n in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,n)&&(this.streamInfo[n]=this.extraStreamInfo[n])},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 n="Worker "+this.name;return this.previous?this.previous+" -> "+n:n}},b.exports=i},{}],29:[function(o,b,h){var i=o("../utils"),n=o("./ConvertWorker"),r=o("./GenericWorker"),c=o("../base64"),m=o("../support"),v=o("../external"),_=null;if(m.nodestream)try{_=o("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(d,a){return new v.Promise(function(l,u){var p=[],k=d._internalType,E=d._outputType,z=d._mimeType;d.on("data",function(F,O){p.push(F),a&&a(O)}).on("error",function(F){p=[],u(F)}).on("end",function(){try{var F=(function(O,Z,P){switch(O){case"blob":return i.newBlob(i.transformTo("arraybuffer",Z),P);case"base64":return c.encode(Z);default:return i.transformTo(O,Z)}})(E,(function(O,Z){var P,H=0,J=null,x=0;for(P=0;P<Z.length;P++)x+=Z[P].length;switch(O){case"string":return Z.join("");case"array":return Array.prototype.concat.apply([],Z);case"uint8array":for(J=new Uint8Array(x),P=0;P<Z.length;P++)J.set(Z[P],H),H+=Z[P].length;return J;case"nodebuffer":return Buffer.concat(Z);default:throw new Error("concat : unsupported type '"+O+"'")}})(k,p),z);l(F)}catch(O){u(O)}p=[]}).resume()})}function s(d,a,l){var u=a;switch(a){case"blob":case"arraybuffer":u="uint8array";break;case"base64":u="string"}try{this._internalType=u,this._outputType=a,this._mimeType=l,i.checkSupport(u),this._worker=d.pipe(new n(u)),d.lock()}catch(p){this._worker=new r("error"),this._worker.error(p)}}s.prototype={accumulate:function(d){return w(this,d)},on:function(d,a){var l=this;return d==="data"?this._worker.on(d,function(u){a.call(l,u.data,u.meta)}):this._worker.on(d,function(){i.delay(a,arguments,l)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new _(this,{objectMode:this._outputType!=="nodebuffer"},d)}},b.exports=s},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(o,b,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 i=new ArrayBuffer(0);try{h.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(i),h.blob=n.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,b,h){for(var i=o("./utils"),n=o("./support"),r=o("./nodejsUtils"),c=o("./stream/GenericWorker"),m=new Array(256),v=0;v<256;v++)m[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;m[254]=m[254]=1;function _(){c.call(this,"utf-8 decode"),this.leftOver=null}function w(){c.call(this,"utf-8 encode")}h.utf8encode=function(s){return n.nodebuffer?r.newBufferFrom(s,"utf-8"):(function(d){var a,l,u,p,k,E=d.length,z=0;for(p=0;p<E;p++)(64512&(l=d.charCodeAt(p)))==55296&&p+1<E&&(64512&(u=d.charCodeAt(p+1)))==56320&&(l=65536+(l-55296<<10)+(u-56320),p++),z+=l<128?1:l<2048?2:l<65536?3:4;for(a=n.uint8array?new Uint8Array(z):new Array(z),p=k=0;k<z;p++)(64512&(l=d.charCodeAt(p)))==55296&&p+1<E&&(64512&(u=d.charCodeAt(p+1)))==56320&&(l=65536+(l-55296<<10)+(u-56320),p++),l<128?a[k++]=l:(l<2048?a[k++]=192|l>>>6:(l<65536?a[k++]=224|l>>>12:(a[k++]=240|l>>>18,a[k++]=128|l>>>12&63),a[k++]=128|l>>>6&63),a[k++]=128|63&l);return a})(s)},h.utf8decode=function(s){return n.nodebuffer?i.transformTo("nodebuffer",s).toString("utf-8"):(function(d){var a,l,u,p,k=d.length,E=new Array(2*k);for(a=l=0;a<k;)if((u=d[a++])<128)E[l++]=u;else if(4<(p=m[u]))E[l++]=65533,a+=p-1;else{for(u&=p===2?31:p===3?15:7;1<p&&a<k;)u=u<<6|63&d[a++],p--;1<p?E[l++]=65533:u<65536?E[l++]=u:(u-=65536,E[l++]=55296|u>>10&1023,E[l++]=56320|1023&u)}return E.length!==l&&(E.subarray?E=E.subarray(0,l):E.length=l),i.applyFromCharCode(E)})(s=i.transformTo(n.uint8array?"uint8array":"array",s))},i.inherits(_,c),_.prototype.processChunk=function(s){var d=i.transformTo(n.uint8array?"uint8array":"array",s.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var a=d;(d=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),d.set(a,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var l=(function(p,k){var E;for((k=k||p.length)>p.length&&(k=p.length),E=k-1;0<=E&&(192&p[E])==128;)E--;return E<0||E===0?k:E+m[p[E]]>k?E:k})(d),u=d;l!==d.length&&(n.uint8array?(u=d.subarray(0,l),this.leftOver=d.subarray(l,d.length)):(u=d.slice(0,l),this.leftOver=d.slice(l,d.length))),this.push({data:h.utf8decode(u),meta:s.meta})},_.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:h.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},h.Utf8DecodeWorker=_,i.inherits(w,c),w.prototype.processChunk=function(s){this.push({data:h.utf8encode(s.data),meta:s.meta})},h.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(o,b,h){var i=o("./support"),n=o("./base64"),r=o("./nodejsUtils"),c=o("./external");function m(a){return a}function v(a,l){for(var u=0;u<a.length;++u)l[u]=255&a.charCodeAt(u);return l}o("setimmediate"),h.newBlob=function(a,l){h.checkSupport("blob");try{return new Blob([a],{type:l})}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return u.append(a),u.getBlob(l)}catch{throw new Error("Bug : can't construct the Blob.")}}};var _={stringifyByChunk:function(a,l,u){var p=[],k=0,E=a.length;if(E<=u)return String.fromCharCode.apply(null,a);for(;k<E;)l==="array"||l==="nodebuffer"?p.push(String.fromCharCode.apply(null,a.slice(k,Math.min(k+u,E)))):p.push(String.fromCharCode.apply(null,a.subarray(k,Math.min(k+u,E)))),k+=u;return p.join("")},stringifyByChar:function(a){for(var l="",u=0;u<a.length;u++)l+=String.fromCharCode(a[u]);return l},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function w(a){var l=65536,u=h.getTypeOf(a),p=!0;if(u==="uint8array"?p=_.applyCanBeUsed.uint8array:u==="nodebuffer"&&(p=_.applyCanBeUsed.nodebuffer),p)for(;1<l;)try{return _.stringifyByChunk(a,u,l)}catch{l=Math.floor(l/2)}return _.stringifyByChar(a)}function s(a,l){for(var u=0;u<a.length;u++)l[u]=a[u];return l}h.applyFromCharCode=w;var d={};d.string={string:m,array:function(a){return v(a,new Array(a.length))},arraybuffer:function(a){return d.string.uint8array(a).buffer},uint8array:function(a){return v(a,new Uint8Array(a.length))},nodebuffer:function(a){return v(a,r.allocBuffer(a.length))}},d.array={string:w,array:m,arraybuffer:function(a){return new Uint8Array(a).buffer},uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return r.newBufferFrom(a)}},d.arraybuffer={string:function(a){return w(new Uint8Array(a))},array:function(a){return s(new Uint8Array(a),new Array(a.byteLength))},arraybuffer:m,uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return r.newBufferFrom(new Uint8Array(a))}},d.uint8array={string:w,array:function(a){return s(a,new Array(a.length))},arraybuffer:function(a){return a.buffer},uint8array:m,nodebuffer:function(a){return r.newBufferFrom(a)}},d.nodebuffer={string:w,array:function(a){return s(a,new Array(a.length))},arraybuffer:function(a){return d.nodebuffer.uint8array(a).buffer},uint8array:function(a){return s(a,new Uint8Array(a.length))},nodebuffer:m},h.transformTo=function(a,l){if(l=l||"",!a)return l;h.checkSupport(a);var u=h.getTypeOf(l);return d[u][a](l)},h.resolve=function(a){for(var l=a.split("/"),u=[],p=0;p<l.length;p++){var k=l[p];k==="."||k===""&&p!==0&&p!==l.length-1||(k===".."?u.pop():u.push(k))}return u.join("/")},h.getTypeOf=function(a){return typeof a=="string"?"string":Object.prototype.toString.call(a)==="[object Array]"?"array":i.nodebuffer&&r.isBuffer(a)?"nodebuffer":i.uint8array&&a instanceof Uint8Array?"uint8array":i.arraybuffer&&a instanceof ArrayBuffer?"arraybuffer":void 0},h.checkSupport=function(a){if(!i[a.toLowerCase()])throw new Error(a+" is not supported by this platform")},h.MAX_VALUE_16BITS=65535,h.MAX_VALUE_32BITS=-1,h.pretty=function(a){var l,u,p="";for(u=0;u<(a||"").length;u++)p+="\\x"+((l=a.charCodeAt(u))<16?"0":"")+l.toString(16).toUpperCase();return p},h.delay=function(a,l,u){setImmediate(function(){a.apply(u||null,l||[])})},h.inherits=function(a,l){function u(){}u.prototype=l.prototype,a.prototype=new u},h.extend=function(){var a,l,u={};for(a=0;a<arguments.length;a++)for(l in arguments[a])Object.prototype.hasOwnProperty.call(arguments[a],l)&&u[l]===void 0&&(u[l]=arguments[a][l]);return u},h.prepareContent=function(a,l,u,p,k){return c.Promise.resolve(l).then(function(E){return i.blob&&(E instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(E))!==-1)&&typeof FileReader<"u"?new c.Promise(function(z,F){var O=new FileReader;O.onload=function(Z){z(Z.target.result)},O.onerror=function(Z){F(Z.target.error)},O.readAsArrayBuffer(E)}):E}).then(function(E){var z=h.getTypeOf(E);return z?(z==="arraybuffer"?E=h.transformTo("uint8array",E):z==="string"&&(k?E=n.decode(E):u&&p!==!0&&(E=(function(F){return v(F,i.uint8array?new Uint8Array(F.length):new Array(F.length))})(E))),E):c.Promise.reject(new Error("Can't read the data of '"+a+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(o,b,h){var i=o("./reader/readerFor"),n=o("./utils"),r=o("./signature"),c=o("./zipEntry"),m=o("./support");function v(_){this.files=[],this.loadOptions=_}v.prototype={checkSignature:function(_){if(!this.reader.readAndCheckSignature(_)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(w)+", expected "+n.pretty(_)+")")}},isSignature:function(_,w){var s=this.reader.index;this.reader.setIndex(_);var d=this.reader.readString(4)===w;return this.reader.setIndex(s),d},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),w=m.uint8array?"uint8array":"array",s=n.transformTo(w,_);this.zipComment=this.loadOptions.decodeFileName(s)},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 _,w,s,d=this.zip64EndOfCentralSize-44;0<d;)_=this.reader.readInt(2),w=this.reader.readInt(4),s=this.reader.readData(w),this.zip64ExtensibleData[_]={id:_,length:w,value:s}},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 _,w;for(_=0;_<this.files.length;_++)w=this.files[_],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var _;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(_=new c({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(r.CENTRAL_DIRECTORY_END);if(_<0)throw this.isSignature(0,r.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 w=_;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(_=this.reader.lastIndexOfSignature(r.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(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.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(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var s=this.centralDirOffset+this.centralDirSize;this.zip64&&(s+=20,s+=12+this.zip64EndOfCentralSize);var d=w-s;if(0<d)this.isSignature(w,r.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(_){this.reader=i(_)},load:function(_){this.prepareReader(_),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=v},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(o,b,h){var i=o("./reader/readerFor"),n=o("./utils"),r=o("./compressedObject"),c=o("./crc32"),m=o("./utf8"),v=o("./compressions"),_=o("./support");function w(s,d){this.options=s,this.loadOptions=d}w.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(s){var d,a;if(s.skip(22),this.fileNameLength=s.readInt(2),a=s.readInt(2),this.fileName=s.readData(this.fileNameLength),s.skip(a),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((d=(function(l){for(var u in v)if(Object.prototype.hasOwnProperty.call(v,u)&&v[u].magic===l)return v[u];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,d,s.readData(this.compressedSize))},readCentralPart:function(s){this.versionMadeBy=s.readInt(2),s.skip(2),this.bitFlag=s.readInt(2),this.compressionMethod=s.readString(2),this.date=s.readDate(),this.crc32=s.readInt(4),this.compressedSize=s.readInt(4),this.uncompressedSize=s.readInt(4);var d=s.readInt(2);if(this.extraFieldsLength=s.readInt(2),this.fileCommentLength=s.readInt(2),this.diskNumberStart=s.readInt(2),this.internalFileAttributes=s.readInt(2),this.externalFileAttributes=s.readInt(4),this.localHeaderOffset=s.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");s.skip(d),this.readExtraFields(s),this.parseZIP64ExtraField(s),this.fileComment=s.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var s=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),s==0&&(this.dosPermissions=63&this.externalFileAttributes),s==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var s=i(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=s.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=s.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=s.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=s.readInt(4))}},readExtraFields:function(s){var d,a,l,u=s.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});s.index+4<u;)d=s.readInt(2),a=s.readInt(2),l=s.readData(a),this.extraFields[d]={id:d,length:a,value:l};s.setIndex(u)},handleUTF8:function(){var s=_.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=m.utf8decode(this.fileName),this.fileCommentStr=m.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var a=n.transformTo(s,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(a)}var l=this.findExtraFieldUnicodeComment();if(l!==null)this.fileCommentStr=l;else{var u=n.transformTo(s,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(u)}}},findExtraFieldUnicodePath:function(){var s=this.extraFields[28789];if(s){var d=i(s.value);return d.readInt(1)!==1||c(this.fileName)!==d.readInt(4)?null:m.utf8decode(d.readData(s.length-5))}return null},findExtraFieldUnicodeComment:function(){var s=this.extraFields[25461];if(s){var d=i(s.value);return d.readInt(1)!==1||c(this.fileComment)!==d.readInt(4)?null:m.utf8decode(d.readData(s.length-5))}return null}},b.exports=w},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(o,b,h){function i(d,a,l){this.name=d,this.dir=l.dir,this.date=l.date,this.comment=l.comment,this.unixPermissions=l.unixPermissions,this.dosPermissions=l.dosPermissions,this._data=a,this._dataBinary=l.binary,this.options={compression:l.compression,compressionOptions:l.compressionOptions}}var n=o("./stream/StreamHelper"),r=o("./stream/DataWorker"),c=o("./utf8"),m=o("./compressedObject"),v=o("./stream/GenericWorker");i.prototype={internalStream:function(d){var a=null,l="string";try{if(!d)throw new Error("No output type specified.");var u=(l=d.toLowerCase())==="string"||l==="text";l!=="binarystring"&&l!=="text"||(l="string"),a=this._decompressWorker();var p=!this._dataBinary;p&&!u&&(a=a.pipe(new c.Utf8EncodeWorker)),!p&&u&&(a=a.pipe(new c.Utf8DecodeWorker))}catch(k){(a=new v("error")).error(k)}return new n(a,l,"")},async:function(d,a){return this.internalStream(d).accumulate(a)},nodeStream:function(d,a){return this.internalStream(d||"nodebuffer").toNodejsStream(a)},_compressWorker:function(d,a){if(this._data instanceof m&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var l=this._decompressWorker();return this._dataBinary||(l=l.pipe(new c.Utf8EncodeWorker)),m.createWorkerFrom(l,d,a)},_decompressWorker:function(){return this._data instanceof m?this._data.getContentWorker():this._data instanceof v?this._data:new r(this._data)}};for(var _=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],w=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},s=0;s<_.length;s++)i.prototype[_[s]]=w;b.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(o,b,h){(function(i){var n,r,c=i.MutationObserver||i.WebKitMutationObserver;if(c){var m=0,v=new c(d),_=i.document.createTextNode("");v.observe(_,{characterData:!0}),n=function(){_.data=m=++m%2}}else if(i.setImmediate||i.MessageChannel===void 0)n="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var a=i.document.createElement("script");a.onreadystatechange=function(){d(),a.onreadystatechange=null,a.parentNode.removeChild(a),a=null},i.document.documentElement.appendChild(a)}:function(){setTimeout(d,0)};else{var w=new i.MessageChannel;w.port1.onmessage=d,n=function(){w.port2.postMessage(0)}}var s=[];function d(){var a,l;r=!0;for(var u=s.length;u;){for(l=s,s=[],a=-1;++a<u;)l[a]();u=s.length}r=!1}b.exports=function(a){s.push(a)!==1||r||n()}}).call(this,typeof xt<"u"?xt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(o,b,h){var i=o("immediate");function n(){}var r={},c=["REJECTED"],m=["FULFILLED"],v=["PENDING"];function _(u){if(typeof u!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,u!==n&&a(this,u)}function w(u,p,k){this.promise=u,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function s(u,p,k){i(function(){var E;try{E=p(k)}catch(z){return r.reject(u,z)}E===u?r.reject(u,new TypeError("Cannot resolve promise with itself")):r.resolve(u,E)})}function d(u){var p=u&&u.then;if(u&&(typeof u=="object"||typeof u=="function")&&typeof p=="function")return function(){p.apply(u,arguments)}}function a(u,p){var k=!1;function E(O){k||(k=!0,r.reject(u,O))}function z(O){k||(k=!0,r.resolve(u,O))}var F=l(function(){p(z,E)});F.status==="error"&&E(F.value)}function l(u,p){var k={};try{k.value=u(p),k.status="success"}catch(E){k.status="error",k.value=E}return k}(b.exports=_).prototype.finally=function(u){if(typeof u!="function")return this;var p=this.constructor;return this.then(function(k){return p.resolve(u()).then(function(){return k})},function(k){return p.resolve(u()).then(function(){throw k})})},_.prototype.catch=function(u){return this.then(null,u)},_.prototype.then=function(u,p){if(typeof u!="function"&&this.state===m||typeof p!="function"&&this.state===c)return this;var k=new this.constructor(n);return this.state!==v?s(k,this.state===m?u:p,this.outcome):this.queue.push(new w(k,u,p)),k},w.prototype.callFulfilled=function(u){r.resolve(this.promise,u)},w.prototype.otherCallFulfilled=function(u){s(this.promise,this.onFulfilled,u)},w.prototype.callRejected=function(u){r.reject(this.promise,u)},w.prototype.otherCallRejected=function(u){s(this.promise,this.onRejected,u)},r.resolve=function(u,p){var k=l(d,p);if(k.status==="error")return r.reject(u,k.value);var E=k.value;if(E)a(u,E);else{u.state=m,u.outcome=p;for(var z=-1,F=u.queue.length;++z<F;)u.queue[z].callFulfilled(p)}return u},r.reject=function(u,p){u.state=c,u.outcome=p;for(var k=-1,E=u.queue.length;++k<E;)u.queue[k].callRejected(p);return u},_.resolve=function(u){return u instanceof this?u:r.resolve(new this(n),u)},_.reject=function(u){var p=new this(n);return r.reject(p,u)},_.all=function(u){var p=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=u.length,E=!1;if(!k)return this.resolve([]);for(var z=new Array(k),F=0,O=-1,Z=new this(n);++O<k;)P(u[O],O);return Z;function P(H,J){p.resolve(H).then(function(x){z[J]=x,++F!==k||E||(E=!0,r.resolve(Z,z))},function(x){E||(E=!0,r.reject(Z,x))})}},_.race=function(u){var p=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=u.length,E=!1;if(!k)return this.resolve([]);for(var z=-1,F=new this(n);++z<k;)O=u[z],p.resolve(O).then(function(Z){E||(E=!0,r.resolve(F,Z))},function(Z){E||(E=!0,r.reject(F,Z))});var O;return F}},{immediate:36}],38:[function(o,b,h){var i={};(0,o("./lib/utils/common").assign)(i,o("./lib/deflate"),o("./lib/inflate"),o("./lib/zlib/constants")),b.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(o,b,h){var i=o("./zlib/deflate"),n=o("./utils/common"),r=o("./utils/strings"),c=o("./zlib/messages"),m=o("./zlib/zstream"),v=Object.prototype.toString,_=0,w=-1,s=0,d=8;function a(u){if(!(this instanceof a))return new a(u);this.options=n.assign({level:w,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:s,to:""},u||{});var p=this.options;p.raw&&0<p.windowBits?p.windowBits=-p.windowBits:p.gzip&&0<p.windowBits&&p.windowBits<16&&(p.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,p.level,p.method,p.windowBits,p.memLevel,p.strategy);if(k!==_)throw new Error(c[k]);if(p.header&&i.deflateSetHeader(this.strm,p.header),p.dictionary){var E;if(E=typeof p.dictionary=="string"?r.string2buf(p.dictionary):v.call(p.dictionary)==="[object ArrayBuffer]"?new Uint8Array(p.dictionary):p.dictionary,(k=i.deflateSetDictionary(this.strm,E))!==_)throw new Error(c[k]);this._dict_set=!0}}function l(u,p){var k=new a(p);if(k.push(u,!0),k.err)throw k.msg||c[k.err];return k.result}a.prototype.push=function(u,p){var k,E,z=this.strm,F=this.options.chunkSize;if(this.ended)return!1;E=p===~~p?p:p===!0?4:0,typeof u=="string"?z.input=r.string2buf(u):v.call(u)==="[object ArrayBuffer]"?z.input=new Uint8Array(u):z.input=u,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new n.Buf8(F),z.next_out=0,z.avail_out=F),(k=i.deflate(z,E))!==1&&k!==_)return this.onEnd(k),!(this.ended=!0);z.avail_out!==0&&(z.avail_in!==0||E!==4&&E!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(n.shrinkBuf(z.output,z.next_out))):this.onData(n.shrinkBuf(z.output,z.next_out)))}while((0<z.avail_in||z.avail_out===0)&&k!==1);return E===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===_):E!==2||(this.onEnd(_),!(z.avail_out=0))},a.prototype.onData=function(u){this.chunks.push(u)},a.prototype.onEnd=function(u){u===_&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg},h.Deflate=a,h.deflate=l,h.deflateRaw=function(u,p){return(p=p||{}).raw=!0,l(u,p)},h.gzip=function(u,p){return(p=p||{}).gzip=!0,l(u,p)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(o,b,h){var i=o("./zlib/inflate"),n=o("./utils/common"),r=o("./utils/strings"),c=o("./zlib/constants"),m=o("./zlib/messages"),v=o("./zlib/zstream"),_=o("./zlib/gzheader"),w=Object.prototype.toString;function s(a){if(!(this instanceof s))return new s(a);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},a||{});var l=this.options;l.raw&&0<=l.windowBits&&l.windowBits<16&&(l.windowBits=-l.windowBits,l.windowBits===0&&(l.windowBits=-15)),!(0<=l.windowBits&&l.windowBits<16)||a&&a.windowBits||(l.windowBits+=32),15<l.windowBits&&l.windowBits<48&&(15&l.windowBits)==0&&(l.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v,this.strm.avail_out=0;var u=i.inflateInit2(this.strm,l.windowBits);if(u!==c.Z_OK)throw new Error(m[u]);this.header=new _,i.inflateGetHeader(this.strm,this.header)}function d(a,l){var u=new s(l);if(u.push(a,!0),u.err)throw u.msg||m[u.err];return u.result}s.prototype.push=function(a,l){var u,p,k,E,z,F,O=this.strm,Z=this.options.chunkSize,P=this.options.dictionary,H=!1;if(this.ended)return!1;p=l===~~l?l:l===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof a=="string"?O.input=r.binstring2buf(a):w.call(a)==="[object ArrayBuffer]"?O.input=new Uint8Array(a):O.input=a,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new n.Buf8(Z),O.next_out=0,O.avail_out=Z),(u=i.inflate(O,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&P&&(F=typeof P=="string"?r.string2buf(P):w.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,u=i.inflateSetDictionary(this.strm,F)),u===c.Z_BUF_ERROR&&H===!0&&(u=c.Z_OK,H=!1),u!==c.Z_STREAM_END&&u!==c.Z_OK)return this.onEnd(u),!(this.ended=!0);O.next_out&&(O.avail_out!==0&&u!==c.Z_STREAM_END&&(O.avail_in!==0||p!==c.Z_FINISH&&p!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=r.utf8border(O.output,O.next_out),E=O.next_out-k,z=r.buf2string(O.output,k),O.next_out=E,O.avail_out=Z-E,E&&n.arraySet(O.output,O.output,k,E,0),this.onData(z)):this.onData(n.shrinkBuf(O.output,O.next_out)))),O.avail_in===0&&O.avail_out===0&&(H=!0)}while((0<O.avail_in||O.avail_out===0)&&u!==c.Z_STREAM_END);return u===c.Z_STREAM_END&&(p=c.Z_FINISH),p===c.Z_FINISH?(u=i.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===c.Z_OK):p!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(O.avail_out=0))},s.prototype.onData=function(a){this.chunks.push(a)},s.prototype.onEnd=function(a){a===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},h.Inflate=s,h.inflate=d,h.inflateRaw=function(a,l){return(l=l||{}).raw=!0,d(a,l)},h.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(o,b,h){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";h.assign=function(c){for(var m=Array.prototype.slice.call(arguments,1);m.length;){var v=m.shift();if(v){if(typeof v!="object")throw new TypeError(v+"must be non-object");for(var _ in v)v.hasOwnProperty(_)&&(c[_]=v[_])}}return c},h.shrinkBuf=function(c,m){return c.length===m?c:c.subarray?c.subarray(0,m):(c.length=m,c)};var n={arraySet:function(c,m,v,_,w){if(m.subarray&&c.subarray)c.set(m.subarray(v,v+_),w);else for(var s=0;s<_;s++)c[w+s]=m[v+s]},flattenChunks:function(c){var m,v,_,w,s,d;for(m=_=0,v=c.length;m<v;m++)_+=c[m].length;for(d=new Uint8Array(_),m=w=0,v=c.length;m<v;m++)s=c[m],d.set(s,w),w+=s.length;return d}},r={arraySet:function(c,m,v,_,w){for(var s=0;s<_;s++)c[w+s]=m[v+s]},flattenChunks:function(c){return[].concat.apply([],c)}};h.setTyped=function(c){c?(h.Buf8=Uint8Array,h.Buf16=Uint16Array,h.Buf32=Int32Array,h.assign(h,n)):(h.Buf8=Array,h.Buf16=Array,h.Buf32=Array,h.assign(h,r))},h.setTyped(i)},{}],42:[function(o,b,h){var i=o("./common"),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var c=new i.Buf8(256),m=0;m<256;m++)c[m]=252<=m?6:248<=m?5:240<=m?4:224<=m?3:192<=m?2:1;function v(_,w){if(w<65537&&(_.subarray&&r||!_.subarray&&n))return String.fromCharCode.apply(null,i.shrinkBuf(_,w));for(var s="",d=0;d<w;d++)s+=String.fromCharCode(_[d]);return s}c[254]=c[254]=1,h.string2buf=function(_){var w,s,d,a,l,u=_.length,p=0;for(a=0;a<u;a++)(64512&(s=_.charCodeAt(a)))==55296&&a+1<u&&(64512&(d=_.charCodeAt(a+1)))==56320&&(s=65536+(s-55296<<10)+(d-56320),a++),p+=s<128?1:s<2048?2:s<65536?3:4;for(w=new i.Buf8(p),a=l=0;l<p;a++)(64512&(s=_.charCodeAt(a)))==55296&&a+1<u&&(64512&(d=_.charCodeAt(a+1)))==56320&&(s=65536+(s-55296<<10)+(d-56320),a++),s<128?w[l++]=s:(s<2048?w[l++]=192|s>>>6:(s<65536?w[l++]=224|s>>>12:(w[l++]=240|s>>>18,w[l++]=128|s>>>12&63),w[l++]=128|s>>>6&63),w[l++]=128|63&s);return w},h.buf2binstring=function(_){return v(_,_.length)},h.binstring2buf=function(_){for(var w=new i.Buf8(_.length),s=0,d=w.length;s<d;s++)w[s]=_.charCodeAt(s);return w},h.buf2string=function(_,w){var s,d,a,l,u=w||_.length,p=new Array(2*u);for(s=d=0;s<u;)if((a=_[s++])<128)p[d++]=a;else if(4<(l=c[a]))p[d++]=65533,s+=l-1;else{for(a&=l===2?31:l===3?15:7;1<l&&s<u;)a=a<<6|63&_[s++],l--;1<l?p[d++]=65533:a<65536?p[d++]=a:(a-=65536,p[d++]=55296|a>>10&1023,p[d++]=56320|1023&a)}return v(p,d)},h.utf8border=function(_,w){var s;for((w=w||_.length)>_.length&&(w=_.length),s=w-1;0<=s&&(192&_[s])==128;)s--;return s<0||s===0?w:s+c[_[s]]>w?s:w}},{"./common":41}],43:[function(o,b,h){b.exports=function(i,n,r,c){for(var m=65535&i|0,v=i>>>16&65535|0,_=0;r!==0;){for(r-=_=2e3<r?2e3:r;v=v+(m=m+n[c++]|0)|0,--_;);m%=65521,v%=65521}return m|v<<16|0}},{}],44:[function(o,b,h){b.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,b,h){var i=(function(){for(var n,r=[],c=0;c<256;c++){n=c;for(var m=0;m<8;m++)n=1&n?3988292384^n>>>1:n>>>1;r[c]=n}return r})();b.exports=function(n,r,c,m){var v=i,_=m+c;n^=-1;for(var w=m;w<_;w++)n=n>>>8^v[255&(n^r[w])];return-1^n}},{}],46:[function(o,b,h){var i,n=o("../utils/common"),r=o("./trees"),c=o("./adler32"),m=o("./crc32"),v=o("./messages"),_=0,w=4,s=0,d=-2,a=-1,l=4,u=2,p=8,k=9,E=286,z=30,F=19,O=2*E+1,Z=15,P=3,H=258,J=H+P+1,x=42,R=113,e=1,B=2,tt=3,W=4;function et(t,T){return t.msg=v[T],T}function M(t){return(t<<1)-(4<t?9:0)}function Q(t){for(var T=t.length;0<=--T;)t[T]=0}function N(t){var T=t.state,j=T.pending;j>t.avail_out&&(j=t.avail_out),j!==0&&(n.arraySet(t.output,T.pending_buf,T.pending_out,j,t.next_out),t.next_out+=j,T.pending_out+=j,t.total_out+=j,t.avail_out-=j,T.pending-=j,T.pending===0&&(T.pending_out=0))}function I(t,T){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,T),t.block_start=t.strstart,N(t.strm)}function q(t,T){t.pending_buf[t.pending++]=T}function X(t,T){t.pending_buf[t.pending++]=T>>>8&255,t.pending_buf[t.pending++]=255&T}function V(t,T){var j,g,f=t.max_chain_length,C=t.strstart,L=t.prev_length,U=t.nice_match,A=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,$=t.window,K=t.w_mask,G=t.prev,Y=t.strstart+H,it=$[C+L-1],nt=$[C+L];t.prev_length>=t.good_match&&(f>>=2),U>t.lookahead&&(U=t.lookahead);do if($[(j=T)+L]===nt&&$[j+L-1]===it&&$[j]===$[C]&&$[++j]===$[C+1]){C+=2,j++;do;while($[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&$[++C]===$[++j]&&C<Y);if(g=H-(Y-C),C=Y-H,L<g){if(t.match_start=T,U<=(L=g))break;it=$[C+L-1],nt=$[C+L]}}while((T=G[T&K])>A&&--f!=0);return L<=t.lookahead?L:t.lookahead}function at(t){var T,j,g,f,C,L,U,A,$,K,G=t.w_size;do{if(f=t.window_size-t.lookahead-t.strstart,t.strstart>=G+(G-J)){for(n.arraySet(t.window,t.window,G,G,0),t.match_start-=G,t.strstart-=G,t.block_start-=G,T=j=t.hash_size;g=t.head[--T],t.head[T]=G<=g?g-G:0,--j;);for(T=j=G;g=t.prev[--T],t.prev[T]=G<=g?g-G:0,--j;);f+=G}if(t.strm.avail_in===0)break;if(L=t.strm,U=t.window,A=t.strstart+t.lookahead,$=f,K=void 0,K=L.avail_in,$<K&&(K=$),j=K===0?0:(L.avail_in-=K,n.arraySet(U,L.input,L.next_in,K,A),L.state.wrap===1?L.adler=c(L.adler,U,K,A):L.state.wrap===2&&(L.adler=m(L.adler,U,K,A)),L.next_in+=K,L.total_in+=K,K),t.lookahead+=j,t.lookahead+t.insert>=P)for(C=t.strstart-t.insert,t.ins_h=t.window[C],t.ins_h=(t.ins_h<<t.hash_shift^t.window[C+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[C+P-1])&t.hash_mask,t.prev[C&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=C,C++,t.insert--,!(t.lookahead+t.insert<P)););}while(t.lookahead<J&&t.strm.avail_in!==0)}function ut(t,T){for(var j,g;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&T===_)return e;if(t.lookahead===0)break}if(j=0,t.lookahead>=P&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+P-1])&t.hash_mask,j=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),j!==0&&t.strstart-j<=t.w_size-J&&(t.match_length=V(t,j)),t.match_length>=P)if(g=r._tr_tally(t,t.strstart-t.match_start,t.match_length-P),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=P){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+P-1])&t.hash_mask,j=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 g=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(g&&(I(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<P-1?t.strstart:P-1,T===w?(I(t,!0),t.strm.avail_out===0?tt:W):t.last_lit&&(I(t,!1),t.strm.avail_out===0)?e:B}function rt(t,T){for(var j,g,f;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&T===_)return e;if(t.lookahead===0)break}if(j=0,t.lookahead>=P&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+P-1])&t.hash_mask,j=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=P-1,j!==0&&t.prev_length<t.max_lazy_match&&t.strstart-j<=t.w_size-J&&(t.match_length=V(t,j),t.match_length<=5&&(t.strategy===1||t.match_length===P&&4096<t.strstart-t.match_start)&&(t.match_length=P-1)),t.prev_length>=P&&t.match_length<=t.prev_length){for(f=t.strstart+t.lookahead-P,g=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-P),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=f&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+P-1])&t.hash_mask,j=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=P-1,t.strstart++,g&&(I(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((g=r._tr_tally(t,0,t.window[t.strstart-1]))&&I(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&&(g=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<P-1?t.strstart:P-1,T===w?(I(t,!0),t.strm.avail_out===0?tt:W):t.last_lit&&(I(t,!1),t.strm.avail_out===0)?e:B}function st(t,T,j,g,f){this.good_length=t,this.max_lazy=T,this.nice_length=j,this.max_chain=g,this.func=f}function ct(){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=p,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 n.Buf16(2*O),this.dyn_dtree=new n.Buf16(2*(2*z+1)),this.bl_tree=new n.Buf16(2*(2*F+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 n.Buf16(Z+1),this.heap=new n.Buf16(2*E+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*E+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 T;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=u,(T=t.state).pending=0,T.pending_out=0,T.wrap<0&&(T.wrap=-T.wrap),T.status=T.wrap?x:R,t.adler=T.wrap===2?0:1,T.last_flush=_,r._tr_init(T),s):et(t,d)}function ft(t){var T=ot(t);return T===s&&(function(j){j.window_size=2*j.w_size,Q(j.head),j.max_lazy_match=i[j.level].max_lazy,j.good_match=i[j.level].good_length,j.nice_match=i[j.level].nice_length,j.max_chain_length=i[j.level].max_chain,j.strstart=0,j.block_start=0,j.lookahead=0,j.insert=0,j.match_length=j.prev_length=P-1,j.match_available=0,j.ins_h=0})(t.state),T}function dt(t,T,j,g,f,C){if(!t)return d;var L=1;if(T===a&&(T=6),g<0?(L=0,g=-g):15<g&&(L=2,g-=16),f<1||k<f||j!==p||g<8||15<g||T<0||9<T||C<0||l<C)return et(t,d);g===8&&(g=9);var U=new ct;return(t.state=U).strm=t,U.wrap=L,U.gzhead=null,U.w_bits=g,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=f+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+P-1)/P),U.window=new n.Buf8(2*U.w_size),U.head=new n.Buf16(U.hash_size),U.prev=new n.Buf16(U.w_size),U.lit_bufsize=1<<f+6,U.pending_buf_size=4*U.lit_bufsize,U.pending_buf=new n.Buf8(U.pending_buf_size),U.d_buf=1*U.lit_bufsize,U.l_buf=3*U.lit_bufsize,U.level=T,U.strategy=C,U.method=j,ft(t)}i=[new st(0,0,0,0,function(t,T){var j=65535;for(j>t.pending_buf_size-5&&(j=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),t.lookahead===0&&T===_)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var g=t.block_start+j;if((t.strstart===0||t.strstart>=g)&&(t.lookahead=t.strstart-g,t.strstart=g,I(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-J&&(I(t,!1),t.strm.avail_out===0))return e}return t.insert=0,T===w?(I(t,!0),t.strm.avail_out===0?tt:W):(t.strstart>t.block_start&&(I(t,!1),t.strm.avail_out),e)}),new st(4,4,8,4,ut),new st(4,5,16,8,ut),new st(4,6,32,32,ut),new st(4,4,16,16,rt),new st(8,16,32,32,rt),new st(8,16,128,128,rt),new st(8,32,128,256,rt),new st(32,128,258,1024,rt),new st(32,258,258,4096,rt)],h.deflateInit=function(t,T){return dt(t,T,p,15,8,0)},h.deflateInit2=dt,h.deflateReset=ft,h.deflateResetKeep=ot,h.deflateSetHeader=function(t,T){return t&&t.state?t.state.wrap!==2?d:(t.state.gzhead=T,s):d},h.deflate=function(t,T){var j,g,f,C;if(!t||!t.state||5<T||T<0)return t?et(t,d):d;if(g=t.state,!t.output||!t.input&&t.avail_in!==0||g.status===666&&T!==w)return et(t,t.avail_out===0?-5:d);if(g.strm=t,j=g.last_flush,g.last_flush=T,g.status===x)if(g.wrap===2)t.adler=0,q(g,31),q(g,139),q(g,8),g.gzhead?(q(g,(g.gzhead.text?1:0)+(g.gzhead.hcrc?2:0)+(g.gzhead.extra?4:0)+(g.gzhead.name?8:0)+(g.gzhead.comment?16:0)),q(g,255&g.gzhead.time),q(g,g.gzhead.time>>8&255),q(g,g.gzhead.time>>16&255),q(g,g.gzhead.time>>24&255),q(g,g.level===9?2:2<=g.strategy||g.level<2?4:0),q(g,255&g.gzhead.os),g.gzhead.extra&&g.gzhead.extra.length&&(q(g,255&g.gzhead.extra.length),q(g,g.gzhead.extra.length>>8&255)),g.gzhead.hcrc&&(t.adler=m(t.adler,g.pending_buf,g.pending,0)),g.gzindex=0,g.status=69):(q(g,0),q(g,0),q(g,0),q(g,0),q(g,0),q(g,g.level===9?2:2<=g.strategy||g.level<2?4:0),q(g,3),g.status=R);else{var L=p+(g.w_bits-8<<4)<<8;L|=(2<=g.strategy||g.level<2?0:g.level<6?1:g.level===6?2:3)<<6,g.strstart!==0&&(L|=32),L+=31-L%31,g.status=R,X(g,L),g.strstart!==0&&(X(g,t.adler>>>16),X(g,65535&t.adler)),t.adler=1}if(g.status===69)if(g.gzhead.extra){for(f=g.pending;g.gzindex<(65535&g.gzhead.extra.length)&&(g.pending!==g.pending_buf_size||(g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),N(t),f=g.pending,g.pending!==g.pending_buf_size));)q(g,255&g.gzhead.extra[g.gzindex]),g.gzindex++;g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),g.gzindex===g.gzhead.extra.length&&(g.gzindex=0,g.status=73)}else g.status=73;if(g.status===73)if(g.gzhead.name){f=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),N(t),f=g.pending,g.pending===g.pending_buf_size)){C=1;break}C=g.gzindex<g.gzhead.name.length?255&g.gzhead.name.charCodeAt(g.gzindex++):0,q(g,C)}while(C!==0);g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),C===0&&(g.gzindex=0,g.status=91)}else g.status=91;if(g.status===91)if(g.gzhead.comment){f=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),N(t),f=g.pending,g.pending===g.pending_buf_size)){C=1;break}C=g.gzindex<g.gzhead.comment.length?255&g.gzhead.comment.charCodeAt(g.gzindex++):0,q(g,C)}while(C!==0);g.gzhead.hcrc&&g.pending>f&&(t.adler=m(t.adler,g.pending_buf,g.pending-f,f)),C===0&&(g.status=103)}else g.status=103;if(g.status===103&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&N(t),g.pending+2<=g.pending_buf_size&&(q(g,255&t.adler),q(g,t.adler>>8&255),t.adler=0,g.status=R)):g.status=R),g.pending!==0){if(N(t),t.avail_out===0)return g.last_flush=-1,s}else if(t.avail_in===0&&M(T)<=M(j)&&T!==w)return et(t,-5);if(g.status===666&&t.avail_in!==0)return et(t,-5);if(t.avail_in!==0||g.lookahead!==0||T!==_&&g.status!==666){var U=g.strategy===2?(function(A,$){for(var K;;){if(A.lookahead===0&&(at(A),A.lookahead===0)){if($===_)return e;break}if(A.match_length=0,K=r._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,K&&(I(A,!1),A.strm.avail_out===0))return e}return A.insert=0,$===w?(I(A,!0),A.strm.avail_out===0?tt:W):A.last_lit&&(I(A,!1),A.strm.avail_out===0)?e:B})(g,T):g.strategy===3?(function(A,$){for(var K,G,Y,it,nt=A.window;;){if(A.lookahead<=H){if(at(A),A.lookahead<=H&&$===_)return e;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=P&&0<A.strstart&&(G=nt[Y=A.strstart-1])===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]){it=A.strstart+H;do;while(G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&G===nt[++Y]&&Y<it);A.match_length=H-(it-Y),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=P?(K=r._tr_tally(A,1,A.match_length-P),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(K=r._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),K&&(I(A,!1),A.strm.avail_out===0))return e}return A.insert=0,$===w?(I(A,!0),A.strm.avail_out===0?tt:W):A.last_lit&&(I(A,!1),A.strm.avail_out===0)?e:B})(g,T):i[g.level].func(g,T);if(U!==tt&&U!==W||(g.status=666),U===e||U===tt)return t.avail_out===0&&(g.last_flush=-1),s;if(U===B&&(T===1?r._tr_align(g):T!==5&&(r._tr_stored_block(g,0,0,!1),T===3&&(Q(g.head),g.lookahead===0&&(g.strstart=0,g.block_start=0,g.insert=0))),N(t),t.avail_out===0))return g.last_flush=-1,s}return T!==w?s:g.wrap<=0?1:(g.wrap===2?(q(g,255&t.adler),q(g,t.adler>>8&255),q(g,t.adler>>16&255),q(g,t.adler>>24&255),q(g,255&t.total_in),q(g,t.total_in>>8&255),q(g,t.total_in>>16&255),q(g,t.total_in>>24&255)):(X(g,t.adler>>>16),X(g,65535&t.adler)),N(t),0<g.wrap&&(g.wrap=-g.wrap),g.pending!==0?s:1)},h.deflateEnd=function(t){var T;return t&&t.state?(T=t.state.status)!==x&&T!==69&&T!==73&&T!==91&&T!==103&&T!==R&&T!==666?et(t,d):(t.state=null,T===R?et(t,-3):s):d},h.deflateSetDictionary=function(t,T){var j,g,f,C,L,U,A,$,K=T.length;if(!t||!t.state||(C=(j=t.state).wrap)===2||C===1&&j.status!==x||j.lookahead)return d;for(C===1&&(t.adler=c(t.adler,T,K,0)),j.wrap=0,K>=j.w_size&&(C===0&&(Q(j.head),j.strstart=0,j.block_start=0,j.insert=0),$=new n.Buf8(j.w_size),n.arraySet($,T,K-j.w_size,j.w_size,0),T=$,K=j.w_size),L=t.avail_in,U=t.next_in,A=t.input,t.avail_in=K,t.next_in=0,t.input=T,at(j);j.lookahead>=P;){for(g=j.strstart,f=j.lookahead-(P-1);j.ins_h=(j.ins_h<<j.hash_shift^j.window[g+P-1])&j.hash_mask,j.prev[g&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=g,g++,--f;);j.strstart=g,j.lookahead=P-1,at(j)}return j.strstart+=j.lookahead,j.block_start=j.strstart,j.insert=j.lookahead,j.lookahead=0,j.match_length=j.prev_length=P-1,j.match_available=0,t.next_in=U,t.input=A,t.avail_in=L,j.wrap=C,s},h.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(o,b,h){b.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,b,h){b.exports=function(i,n){var r,c,m,v,_,w,s,d,a,l,u,p,k,E,z,F,O,Z,P,H,J,x,R,e,B;r=i.state,c=i.next_in,e=i.input,m=c+(i.avail_in-5),v=i.next_out,B=i.output,_=v-(n-i.avail_out),w=v+(i.avail_out-257),s=r.dmax,d=r.wsize,a=r.whave,l=r.wnext,u=r.window,p=r.hold,k=r.bits,E=r.lencode,z=r.distcode,F=(1<<r.lenbits)-1,O=(1<<r.distbits)-1;t:do{k<15&&(p+=e[c++]<<k,k+=8,p+=e[c++]<<k,k+=8),Z=E[p&F];e:for(;;){if(p>>>=P=Z>>>24,k-=P,(P=Z>>>16&255)===0)B[v++]=65535&Z;else{if(!(16&P)){if((64&P)==0){Z=E[(65535&Z)+(p&(1<<P)-1)];continue e}if(32&P){r.mode=12;break t}i.msg="invalid literal/length code",r.mode=30;break t}H=65535&Z,(P&=15)&&(k<P&&(p+=e[c++]<<k,k+=8),H+=p&(1<<P)-1,p>>>=P,k-=P),k<15&&(p+=e[c++]<<k,k+=8,p+=e[c++]<<k,k+=8),Z=z[p&O];r:for(;;){if(p>>>=P=Z>>>24,k-=P,!(16&(P=Z>>>16&255))){if((64&P)==0){Z=z[(65535&Z)+(p&(1<<P)-1)];continue r}i.msg="invalid distance code",r.mode=30;break t}if(J=65535&Z,k<(P&=15)&&(p+=e[c++]<<k,(k+=8)<P&&(p+=e[c++]<<k,k+=8)),s<(J+=p&(1<<P)-1)){i.msg="invalid distance too far back",r.mode=30;break t}if(p>>>=P,k-=P,(P=v-_)<J){if(a<(P=J-P)&&r.sane){i.msg="invalid distance too far back",r.mode=30;break t}if(R=u,(x=0)===l){if(x+=d-P,P<H){for(H-=P;B[v++]=u[x++],--P;);x=v-J,R=B}}else if(l<P){if(x+=d+l-P,(P-=l)<H){for(H-=P;B[v++]=u[x++],--P;);if(x=0,l<H){for(H-=P=l;B[v++]=u[x++],--P;);x=v-J,R=B}}}else if(x+=l-P,P<H){for(H-=P;B[v++]=u[x++],--P;);x=v-J,R=B}for(;2<H;)B[v++]=R[x++],B[v++]=R[x++],B[v++]=R[x++],H-=3;H&&(B[v++]=R[x++],1<H&&(B[v++]=R[x++]))}else{for(x=v-J;B[v++]=B[x++],B[v++]=B[x++],B[v++]=B[x++],2<(H-=3););H&&(B[v++]=B[x++],1<H&&(B[v++]=B[x++]))}break}}break}}while(c<m&&v<w);c-=H=k>>3,p&=(1<<(k-=H<<3))-1,i.next_in=c,i.next_out=v,i.avail_in=c<m?m-c+5:5-(c-m),i.avail_out=v<w?w-v+257:257-(v-w),r.hold=p,r.bits=k}},{}],49:[function(o,b,h){var i=o("../utils/common"),n=o("./adler32"),r=o("./crc32"),c=o("./inffast"),m=o("./inftrees"),v=1,_=2,w=0,s=-2,d=1,a=852,l=592;function u(x){return(x>>>24&255)+(x>>>8&65280)+((65280&x)<<8)+((255&x)<<24)}function p(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(x){var R;return x&&x.state?(R=x.state,x.total_in=x.total_out=R.total=0,x.msg="",R.wrap&&(x.adler=1&R.wrap),R.mode=d,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new i.Buf32(a),R.distcode=R.distdyn=new i.Buf32(l),R.sane=1,R.back=-1,w):s}function E(x){var R;return x&&x.state?((R=x.state).wsize=0,R.whave=0,R.wnext=0,k(x)):s}function z(x,R){var e,B;return x&&x.state?(B=x.state,R<0?(e=0,R=-R):(e=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15<R)?s:(B.window!==null&&B.wbits!==R&&(B.window=null),B.wrap=e,B.wbits=R,E(x))):s}function F(x,R){var e,B;return x?(B=new p,(x.state=B).window=null,(e=z(x,R))!==w&&(x.state=null),e):s}var O,Z,P=!0;function H(x){if(P){var R;for(O=new i.Buf32(512),Z=new i.Buf32(32),R=0;R<144;)x.lens[R++]=8;for(;R<256;)x.lens[R++]=9;for(;R<280;)x.lens[R++]=7;for(;R<288;)x.lens[R++]=8;for(m(v,x.lens,0,288,O,0,x.work,{bits:9}),R=0;R<32;)x.lens[R++]=5;m(_,x.lens,0,32,Z,0,x.work,{bits:5}),P=!1}x.lencode=O,x.lenbits=9,x.distcode=Z,x.distbits=5}function J(x,R,e,B){var tt,W=x.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new i.Buf8(W.wsize)),B>=W.wsize?(i.arraySet(W.window,R,e-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(B<(tt=W.wsize-W.wnext)&&(tt=B),i.arraySet(W.window,R,e-B,tt,W.wnext),(B-=tt)?(i.arraySet(W.window,R,e-B,B,0),W.wnext=B,W.whave=W.wsize):(W.wnext+=tt,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=tt))),0}h.inflateReset=E,h.inflateReset2=z,h.inflateResetKeep=k,h.inflateInit=function(x){return F(x,15)},h.inflateInit2=F,h.inflate=function(x,R){var e,B,tt,W,et,M,Q,N,I,q,X,V,at,ut,rt,st,ct,ot,ft,dt,t,T,j,g,f=0,C=new i.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!x||!x.state||!x.output||!x.input&&x.avail_in!==0)return s;(e=x.state).mode===12&&(e.mode=13),et=x.next_out,tt=x.output,Q=x.avail_out,W=x.next_in,B=x.input,M=x.avail_in,N=e.hold,I=e.bits,q=M,X=Q,T=w;t:for(;;)switch(e.mode){case d:if(e.wrap===0){e.mode=13;break}for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(2&e.wrap&&N===35615){C[e.check=0]=255&N,C[1]=N>>>8&255,e.check=r(e.check,C,2,0),I=N=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&N)<<8)+(N>>8))%31){x.msg="incorrect header check",e.mode=30;break}if((15&N)!=8){x.msg="unknown compression method",e.mode=30;break}if(I-=4,t=8+(15&(N>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){x.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,x.adler=e.check=1,e.mode=512&N?10:12,I=N=0;break;case 2:for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(e.flags=N,(255&e.flags)!=8){x.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){x.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=N>>8&1),512&e.flags&&(C[0]=255&N,C[1]=N>>>8&255,e.check=r(e.check,C,2,0)),I=N=0,e.mode=3;case 3:for(;I<32;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.head&&(e.head.time=N),512&e.flags&&(C[0]=255&N,C[1]=N>>>8&255,C[2]=N>>>16&255,C[3]=N>>>24&255,e.check=r(e.check,C,4,0)),I=N=0,e.mode=4;case 4:for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.head&&(e.head.xflags=255&N,e.head.os=N>>8),512&e.flags&&(C[0]=255&N,C[1]=N>>>8&255,e.check=r(e.check,C,2,0)),I=N=0,e.mode=5;case 5:if(1024&e.flags){for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.length=N,e.head&&(e.head.extra_len=N),512&e.flags&&(C[0]=255&N,C[1]=N>>>8&255,e.check=r(e.check,C,2,0)),I=N=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(M<(V=e.length)&&(V=M),V&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),i.arraySet(e.head.extra,B,W,V,t)),512&e.flags&&(e.check=r(e.check,B,V,W)),M-=V,W+=V,e.length-=V),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(M===0)break t;for(V=0;t=B[W+V++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&V<M;);if(512&e.flags&&(e.check=r(e.check,B,V,W)),M-=V,W+=V,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(M===0)break t;for(V=0;t=B[W+V++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&V<M;);if(512&e.flags&&(e.check=r(e.check,B,V,W)),M-=V,W+=V,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;I<16;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(N!==(65535&e.check)){x.msg="header crc mismatch",e.mode=30;break}I=N=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),x.adler=e.check=0,e.mode=12;break;case 10:for(;I<32;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}x.adler=e.check=u(N),I=N=0,e.mode=11;case 11:if(e.havedict===0)return x.next_out=et,x.avail_out=Q,x.next_in=W,x.avail_in=M,e.hold=N,e.bits=I,2;x.adler=e.check=1,e.mode=12;case 12:if(R===5||R===6)break t;case 13:if(e.last){N>>>=7&I,I-=7&I,e.mode=27;break}for(;I<3;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}switch(e.last=1&N,I-=1,3&(N>>>=1)){case 0:e.mode=14;break;case 1:if(H(e),e.mode=20,R!==6)break;N>>>=2,I-=2;break t;case 2:e.mode=17;break;case 3:x.msg="invalid block type",e.mode=30}N>>>=2,I-=2;break;case 14:for(N>>>=7&I,I-=7&I;I<32;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if((65535&N)!=(N>>>16^65535)){x.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&N,I=N=0,e.mode=15,R===6)break t;case 15:e.mode=16;case 16:if(V=e.length){if(M<V&&(V=M),Q<V&&(V=Q),V===0)break t;i.arraySet(tt,B,W,V,et),M-=V,W+=V,Q-=V,et+=V,e.length-=V;break}e.mode=12;break;case 17:for(;I<14;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(e.nlen=257+(31&N),N>>>=5,I-=5,e.ndist=1+(31&N),N>>>=5,I-=5,e.ncode=4+(15&N),N>>>=4,I-=4,286<e.nlen||30<e.ndist){x.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(;I<3;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.lens[L[e.have++]]=7&N,N>>>=3,I-=3}for(;e.have<19;)e.lens[L[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,j={bits:e.lenbits},T=m(0,e.lens,0,19,e.lencode,0,e.work,j),e.lenbits=j.bits,T){x.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(;st=(f=e.lencode[N&(1<<e.lenbits)-1])>>>16&255,ct=65535&f,!((rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(ct<16)N>>>=rt,I-=rt,e.lens[e.have++]=ct;else{if(ct===16){for(g=rt+2;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(N>>>=rt,I-=rt,e.have===0){x.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],V=3+(3&N),N>>>=2,I-=2}else if(ct===17){for(g=rt+3;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}I-=rt,t=0,V=3+(7&(N>>>=rt)),N>>>=3,I-=3}else{for(g=rt+7;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}I-=rt,t=0,V=11+(127&(N>>>=rt)),N>>>=7,I-=7}if(e.have+V>e.nlen+e.ndist){x.msg="invalid bit length repeat",e.mode=30;break}for(;V--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){x.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,j={bits:e.lenbits},T=m(v,e.lens,0,e.nlen,e.lencode,0,e.work,j),e.lenbits=j.bits,T){x.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,j={bits:e.distbits},T=m(_,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,j),e.distbits=j.bits,T){x.msg="invalid distances set",e.mode=30;break}if(e.mode=20,R===6)break t;case 20:e.mode=21;case 21:if(6<=M&&258<=Q){x.next_out=et,x.avail_out=Q,x.next_in=W,x.avail_in=M,e.hold=N,e.bits=I,c(x,X),et=x.next_out,tt=x.output,Q=x.avail_out,W=x.next_in,B=x.input,M=x.avail_in,N=e.hold,I=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;st=(f=e.lencode[N&(1<<e.lenbits)-1])>>>16&255,ct=65535&f,!((rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(st&&(240&st)==0){for(ot=rt,ft=st,dt=ct;st=(f=e.lencode[dt+((N&(1<<ot+ft)-1)>>ot)])>>>16&255,ct=65535&f,!(ot+(rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}N>>>=ot,I-=ot,e.back+=ot}if(N>>>=rt,I-=rt,e.back+=rt,e.length=ct,st===0){e.mode=26;break}if(32&st){e.back=-1,e.mode=12;break}if(64&st){x.msg="invalid literal/length code",e.mode=30;break}e.extra=15&st,e.mode=22;case 22:if(e.extra){for(g=e.extra;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.length+=N&(1<<e.extra)-1,N>>>=e.extra,I-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;st=(f=e.distcode[N&(1<<e.distbits)-1])>>>16&255,ct=65535&f,!((rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if((240&st)==0){for(ot=rt,ft=st,dt=ct;st=(f=e.distcode[dt+((N&(1<<ot+ft)-1)>>ot)])>>>16&255,ct=65535&f,!(ot+(rt=f>>>24)<=I);){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}N>>>=ot,I-=ot,e.back+=ot}if(N>>>=rt,I-=rt,e.back+=rt,64&st){x.msg="invalid distance code",e.mode=30;break}e.offset=ct,e.extra=15&st,e.mode=24;case 24:if(e.extra){for(g=e.extra;I<g;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}e.offset+=N&(1<<e.extra)-1,N>>>=e.extra,I-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){x.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(Q===0)break t;if(V=X-Q,e.offset>V){if((V=e.offset-V)>e.whave&&e.sane){x.msg="invalid distance too far back",e.mode=30;break}at=V>e.wnext?(V-=e.wnext,e.wsize-V):e.wnext-V,V>e.length&&(V=e.length),ut=e.window}else ut=tt,at=et-e.offset,V=e.length;for(Q<V&&(V=Q),Q-=V,e.length-=V;tt[et++]=ut[at++],--V;);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(;I<32;){if(M===0)break t;M--,N|=B[W++]<<I,I+=8}if(X-=Q,x.total_out+=X,e.total+=X,X&&(x.adler=e.check=e.flags?r(e.check,tt,X,et-X):n(e.check,tt,X,et-X)),X=Q,(e.flags?N:u(N))!==e.check){x.msg="incorrect data check",e.mode=30;break}I=N=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;I<32;){if(M===0)break t;M--,N+=B[W++]<<I,I+=8}if(N!==(4294967295&e.total)){x.msg="incorrect length check",e.mode=30;break}I=N=0}e.mode=29;case 29:T=1;break t;case 30:T=-3;break t;case 31:return-4;case 32:default:return s}return x.next_out=et,x.avail_out=Q,x.next_in=W,x.avail_in=M,e.hold=N,e.bits=I,(e.wsize||X!==x.avail_out&&e.mode<30&&(e.mode<27||R!==4))&&J(x,x.output,x.next_out,X-x.avail_out)?(e.mode=31,-4):(q-=x.avail_in,X-=x.avail_out,x.total_in+=q,x.total_out+=X,e.total+=X,e.wrap&&X&&(x.adler=e.check=e.flags?r(e.check,tt,X,x.next_out-X):n(e.check,tt,X,x.next_out-X)),x.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(q==0&&X===0||R===4)&&T===w&&(T=-5),T)},h.inflateEnd=function(x){if(!x||!x.state)return s;var R=x.state;return R.window&&(R.window=null),x.state=null,w},h.inflateGetHeader=function(x,R){var e;return x&&x.state?(2&(e=x.state).wrap)==0?s:((e.head=R).done=!1,w):s},h.inflateSetDictionary=function(x,R){var e,B=R.length;return x&&x.state?(e=x.state).wrap!==0&&e.mode!==11?s:e.mode===11&&n(1,R,B,0)!==e.check?-3:J(x,R,B,B)?(e.mode=31,-4):(e.havedict=1,w):s},h.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(o,b,h){var i=o("../utils/common"),n=[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],r=[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],c=[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],m=[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];b.exports=function(v,_,w,s,d,a,l,u){var p,k,E,z,F,O,Z,P,H,J=u.bits,x=0,R=0,e=0,B=0,tt=0,W=0,et=0,M=0,Q=0,N=0,I=null,q=0,X=new i.Buf16(16),V=new i.Buf16(16),at=null,ut=0;for(x=0;x<=15;x++)X[x]=0;for(R=0;R<s;R++)X[_[w+R]]++;for(tt=J,B=15;1<=B&&X[B]===0;B--);if(B<tt&&(tt=B),B===0)return d[a++]=20971520,d[a++]=20971520,u.bits=1,0;for(e=1;e<B&&X[e]===0;e++);for(tt<e&&(tt=e),x=M=1;x<=15;x++)if(M<<=1,(M-=X[x])<0)return-1;if(0<M&&(v===0||B!==1))return-1;for(V[1]=0,x=1;x<15;x++)V[x+1]=V[x]+X[x];for(R=0;R<s;R++)_[w+R]!==0&&(l[V[_[w+R]]++]=R);if(O=v===0?(I=at=l,19):v===1?(I=n,q-=257,at=r,ut-=257,256):(I=c,at=m,-1),x=e,F=a,et=R=N=0,E=-1,z=(Q=1<<(W=tt))-1,v===1&&852<Q||v===2&&592<Q)return 1;for(;;){for(Z=x-et,H=l[R]<O?(P=0,l[R]):l[R]>O?(P=at[ut+l[R]],I[q+l[R]]):(P=96,0),p=1<<x-et,e=k=1<<W;d[F+(N>>et)+(k-=p)]=Z<<24|P<<16|H|0,k!==0;);for(p=1<<x-1;N&p;)p>>=1;if(p!==0?(N&=p-1,N+=p):N=0,R++,--X[x]==0){if(x===B)break;x=_[w+l[R]]}if(tt<x&&(N&z)!==E){for(et===0&&(et=tt),F+=e,M=1<<(W=x-et);W+et<B&&!((M-=X[W+et])<=0);)W++,M<<=1;if(Q+=1<<W,v===1&&852<Q||v===2&&592<Q)return 1;d[E=N&z]=tt<<24|W<<16|F-a|0}}return N!==0&&(d[F+N]=x-et<<24|64<<16|0),u.bits=tt,0}},{"../utils/common":41}],51:[function(o,b,h){b.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,b,h){var i=o("../utils/common"),n=0,r=1;function c(f){for(var C=f.length;0<=--C;)f[C]=0}var m=0,v=29,_=256,w=_+1+v,s=30,d=19,a=2*w+1,l=15,u=16,p=7,k=256,E=16,z=17,F=18,O=[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],Z=[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],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=new Array(2*(w+2));c(J);var x=new Array(2*s);c(x);var R=new Array(512);c(R);var e=new Array(256);c(e);var B=new Array(v);c(B);var tt,W,et,M=new Array(s);function Q(f,C,L,U,A){this.static_tree=f,this.extra_bits=C,this.extra_base=L,this.elems=U,this.max_length=A,this.has_stree=f&&f.length}function N(f,C){this.dyn_tree=f,this.max_code=0,this.stat_desc=C}function I(f){return f<256?R[f]:R[256+(f>>>7)]}function q(f,C){f.pending_buf[f.pending++]=255&C,f.pending_buf[f.pending++]=C>>>8&255}function X(f,C,L){f.bi_valid>u-L?(f.bi_buf|=C<<f.bi_valid&65535,q(f,f.bi_buf),f.bi_buf=C>>u-f.bi_valid,f.bi_valid+=L-u):(f.bi_buf|=C<<f.bi_valid&65535,f.bi_valid+=L)}function V(f,C,L){X(f,L[2*C],L[2*C+1])}function at(f,C){for(var L=0;L|=1&f,f>>>=1,L<<=1,0<--C;);return L>>>1}function ut(f,C,L){var U,A,$=new Array(l+1),K=0;for(U=1;U<=l;U++)$[U]=K=K+L[U-1]<<1;for(A=0;A<=C;A++){var G=f[2*A+1];G!==0&&(f[2*A]=at($[G]++,G))}}function rt(f){var C;for(C=0;C<w;C++)f.dyn_ltree[2*C]=0;for(C=0;C<s;C++)f.dyn_dtree[2*C]=0;for(C=0;C<d;C++)f.bl_tree[2*C]=0;f.dyn_ltree[2*k]=1,f.opt_len=f.static_len=0,f.last_lit=f.matches=0}function st(f){8<f.bi_valid?q(f,f.bi_buf):0<f.bi_valid&&(f.pending_buf[f.pending++]=f.bi_buf),f.bi_buf=0,f.bi_valid=0}function ct(f,C,L,U){var A=2*C,$=2*L;return f[A]<f[$]||f[A]===f[$]&&U[C]<=U[L]}function ot(f,C,L){for(var U=f.heap[L],A=L<<1;A<=f.heap_len&&(A<f.heap_len&&ct(C,f.heap[A+1],f.heap[A],f.depth)&&A++,!ct(C,U,f.heap[A],f.depth));)f.heap[L]=f.heap[A],L=A,A<<=1;f.heap[L]=U}function ft(f,C,L){var U,A,$,K,G=0;if(f.last_lit!==0)for(;U=f.pending_buf[f.d_buf+2*G]<<8|f.pending_buf[f.d_buf+2*G+1],A=f.pending_buf[f.l_buf+G],G++,U===0?V(f,A,C):(V(f,($=e[A])+_+1,C),(K=O[$])!==0&&X(f,A-=B[$],K),V(f,$=I(--U),L),(K=Z[$])!==0&&X(f,U-=M[$],K)),G<f.last_lit;);V(f,k,C)}function dt(f,C){var L,U,A,$=C.dyn_tree,K=C.stat_desc.static_tree,G=C.stat_desc.has_stree,Y=C.stat_desc.elems,it=-1;for(f.heap_len=0,f.heap_max=a,L=0;L<Y;L++)$[2*L]!==0?(f.heap[++f.heap_len]=it=L,f.depth[L]=0):$[2*L+1]=0;for(;f.heap_len<2;)$[2*(A=f.heap[++f.heap_len]=it<2?++it:0)]=1,f.depth[A]=0,f.opt_len--,G&&(f.static_len-=K[2*A+1]);for(C.max_code=it,L=f.heap_len>>1;1<=L;L--)ot(f,$,L);for(A=Y;L=f.heap[1],f.heap[1]=f.heap[f.heap_len--],ot(f,$,1),U=f.heap[1],f.heap[--f.heap_max]=L,f.heap[--f.heap_max]=U,$[2*A]=$[2*L]+$[2*U],f.depth[A]=(f.depth[L]>=f.depth[U]?f.depth[L]:f.depth[U])+1,$[2*L+1]=$[2*U+1]=A,f.heap[1]=A++,ot(f,$,1),2<=f.heap_len;);f.heap[--f.heap_max]=f.heap[1],(function(nt,ht){var _t,pt,bt,lt,vt,Et,mt=ht.dyn_tree,Ot=ht.max_code,qt=ht.stat_desc.static_tree,Jt=ht.stat_desc.has_stree,Qt=ht.stat_desc.extra_bits,Rt=ht.stat_desc.extra_base,yt=ht.stat_desc.max_length,wt=0;for(lt=0;lt<=l;lt++)nt.bl_count[lt]=0;for(mt[2*nt.heap[nt.heap_max]+1]=0,_t=nt.heap_max+1;_t<a;_t++)yt<(lt=mt[2*mt[2*(pt=nt.heap[_t])+1]+1]+1)&&(lt=yt,wt++),mt[2*pt+1]=lt,Ot<pt||(nt.bl_count[lt]++,vt=0,Rt<=pt&&(vt=Qt[pt-Rt]),Et=mt[2*pt],nt.opt_len+=Et*(lt+vt),Jt&&(nt.static_len+=Et*(qt[2*pt+1]+vt)));if(wt!==0){do{for(lt=yt-1;nt.bl_count[lt]===0;)lt--;nt.bl_count[lt]--,nt.bl_count[lt+1]+=2,nt.bl_count[yt]--,wt-=2}while(0<wt);for(lt=yt;lt!==0;lt--)for(pt=nt.bl_count[lt];pt!==0;)Ot<(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--)}})(f,C),ut($,it,f.bl_count)}function t(f,C,L){var U,A,$=-1,K=C[1],G=0,Y=7,it=4;for(K===0&&(Y=138,it=3),C[2*(L+1)+1]=65535,U=0;U<=L;U++)A=K,K=C[2*(U+1)+1],++G<Y&&A===K||(G<it?f.bl_tree[2*A]+=G:A!==0?(A!==$&&f.bl_tree[2*A]++,f.bl_tree[2*E]++):G<=10?f.bl_tree[2*z]++:f.bl_tree[2*F]++,$=A,it=(G=0)===K?(Y=138,3):A===K?(Y=6,3):(Y=7,4))}function T(f,C,L){var U,A,$=-1,K=C[1],G=0,Y=7,it=4;for(K===0&&(Y=138,it=3),U=0;U<=L;U++)if(A=K,K=C[2*(U+1)+1],!(++G<Y&&A===K)){if(G<it)for(;V(f,A,f.bl_tree),--G!=0;);else A!==0?(A!==$&&(V(f,A,f.bl_tree),G--),V(f,E,f.bl_tree),X(f,G-3,2)):G<=10?(V(f,z,f.bl_tree),X(f,G-3,3)):(V(f,F,f.bl_tree),X(f,G-11,7));$=A,it=(G=0)===K?(Y=138,3):A===K?(Y=6,3):(Y=7,4)}}c(M);var j=!1;function g(f,C,L,U){X(f,(m<<1)+(U?1:0),3),(function(A,$,K,G){st(A),q(A,K),q(A,~K),i.arraySet(A.pending_buf,A.window,$,K,A.pending),A.pending+=K})(f,C,L)}h._tr_init=function(f){j||((function(){var C,L,U,A,$,K=new Array(l+1);for(A=U=0;A<v-1;A++)for(B[A]=U,C=0;C<1<<O[A];C++)e[U++]=A;for(e[U-1]=A,A=$=0;A<16;A++)for(M[A]=$,C=0;C<1<<Z[A];C++)R[$++]=A;for($>>=7;A<s;A++)for(M[A]=$<<7,C=0;C<1<<Z[A]-7;C++)R[256+$++]=A;for(L=0;L<=l;L++)K[L]=0;for(C=0;C<=143;)J[2*C+1]=8,C++,K[8]++;for(;C<=255;)J[2*C+1]=9,C++,K[9]++;for(;C<=279;)J[2*C+1]=7,C++,K[7]++;for(;C<=287;)J[2*C+1]=8,C++,K[8]++;for(ut(J,w+1,K),C=0;C<s;C++)x[2*C+1]=5,x[2*C]=at(C,5);tt=new Q(J,O,_+1,w,l),W=new Q(x,Z,0,s,l),et=new Q(new Array(0),P,0,d,p)})(),j=!0),f.l_desc=new N(f.dyn_ltree,tt),f.d_desc=new N(f.dyn_dtree,W),f.bl_desc=new N(f.bl_tree,et),f.bi_buf=0,f.bi_valid=0,rt(f)},h._tr_stored_block=g,h._tr_flush_block=function(f,C,L,U){var A,$,K=0;0<f.level?(f.strm.data_type===2&&(f.strm.data_type=(function(G){var Y,it=4093624447;for(Y=0;Y<=31;Y++,it>>>=1)if(1&it&&G.dyn_ltree[2*Y]!==0)return n;if(G.dyn_ltree[18]!==0||G.dyn_ltree[20]!==0||G.dyn_ltree[26]!==0)return r;for(Y=32;Y<_;Y++)if(G.dyn_ltree[2*Y]!==0)return r;return n})(f)),dt(f,f.l_desc),dt(f,f.d_desc),K=(function(G){var Y;for(t(G,G.dyn_ltree,G.l_desc.max_code),t(G,G.dyn_dtree,G.d_desc.max_code),dt(G,G.bl_desc),Y=d-1;3<=Y&&G.bl_tree[2*H[Y]+1]===0;Y--);return G.opt_len+=3*(Y+1)+5+5+4,Y})(f),A=f.opt_len+3+7>>>3,($=f.static_len+3+7>>>3)<=A&&(A=$)):A=$=L+5,L+4<=A&&C!==-1?g(f,C,L,U):f.strategy===4||$===A?(X(f,2+(U?1:0),3),ft(f,J,x)):(X(f,4+(U?1:0),3),(function(G,Y,it,nt){var ht;for(X(G,Y-257,5),X(G,it-1,5),X(G,nt-4,4),ht=0;ht<nt;ht++)X(G,G.bl_tree[2*H[ht]+1],3);T(G,G.dyn_ltree,Y-1),T(G,G.dyn_dtree,it-1)})(f,f.l_desc.max_code+1,f.d_desc.max_code+1,K+1),ft(f,f.dyn_ltree,f.dyn_dtree)),rt(f),U&&st(f)},h._tr_tally=function(f,C,L){return f.pending_buf[f.d_buf+2*f.last_lit]=C>>>8&255,f.pending_buf[f.d_buf+2*f.last_lit+1]=255&C,f.pending_buf[f.l_buf+f.last_lit]=255&L,f.last_lit++,C===0?f.dyn_ltree[2*L]++:(f.matches++,C--,f.dyn_ltree[2*(e[L]+_+1)]++,f.dyn_dtree[2*I(C)]++),f.last_lit===f.lit_bufsize-1},h._tr_align=function(f){X(f,2,3),V(f,k,J),(function(C){C.bi_valid===16?(q(C,C.bi_buf),C.bi_buf=0,C.bi_valid=0):8<=C.bi_valid&&(C.pending_buf[C.pending++]=255&C.bi_buf,C.bi_buf>>=8,C.bi_valid-=8)})(f)}},{"../utils/common":41}],53:[function(o,b,h){b.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,b,h){(function(i){(function(n,r){if(!n.setImmediate){var c,m,v,_,w=1,s={},d=!1,a=n.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(n);l=l&&l.setTimeout?l:n,c={}.toString.call(n.process)==="[object process]"?function(E){process.nextTick(function(){p(E)})}:(function(){if(n.postMessage&&!n.importScripts){var E=!0,z=n.onmessage;return n.onmessage=function(){E=!1},n.postMessage("","*"),n.onmessage=z,E}})()?(_="setImmediate$"+Math.random()+"$",n.addEventListener?n.addEventListener("message",k,!1):n.attachEvent("onmessage",k),function(E){n.postMessage(_+E,"*")}):n.MessageChannel?((v=new MessageChannel).port1.onmessage=function(E){p(E.data)},function(E){v.port2.postMessage(E)}):a&&"onreadystatechange"in a.createElement("script")?(m=a.documentElement,function(E){var z=a.createElement("script");z.onreadystatechange=function(){p(E),z.onreadystatechange=null,m.removeChild(z),z=null},m.appendChild(z)}):function(E){setTimeout(p,0,E)},l.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var z=new Array(arguments.length-1),F=0;F<z.length;F++)z[F]=arguments[F+1];var O={callback:E,args:z};return s[w]=O,c(w),w++},l.clearImmediate=u}function u(E){delete s[E]}function p(E){if(d)setTimeout(p,0,E);else{var z=s[E];if(z){d=!0;try{(function(F){var O=F.callback,Z=F.args;switch(Z.length){case 0:O();break;case 1:O(Z[0]);break;case 2:O(Z[0],Z[1]);break;case 3:O(Z[0],Z[1],Z[2]);break;default:O.apply(r,Z)}})(z)}finally{u(E),d=!1}}}}function k(E){E.source===n&&typeof E.data=="string"&&E.data.indexOf(_)===0&&p(+E.data.slice(_.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof xt<"u"?xt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(At)),At.exports}var Ke=Xe();const Ye=ne(Ke);async function qe(y){let S;try{S=await Ye.loadAsync(y)}catch(r){return{format:"obsidian-zip",notes:[],errors:[{sourcePath:y.name,reason:`Could not read zip: ${r instanceof Error?r.message:String(r)}`}],tags:[],attachments:[]}}const o=[],b=[],h=[],i=[];S.forEach((r,c)=>{i.push({path:r,obj:c})}),i.sort((r,c)=>r.path.localeCompare(c.path));const n=er(i);for(const{path:r,obj:c}of i){if(c.dir||Kt(r))continue;const m=rr(r,n);if(Yt(r)){try{const v=await c.async("string"),_=Vt({sourcePath:m,raw:v});o.push(_)}catch(v){b.push({sourcePath:r,reason:v instanceof Error?v.message:String(v)})}continue}try{const v=await c.async("blob"),_=Je(m);h.push({sourcePath:m,filename:_,ext:Qe(_),kind:_e(_),blob:v})}catch(v){b.push({sourcePath:r,reason:v instanceof Error?v.message:String(v)})}}return{format:"obsidian-zip",notes:o,errors:b,tags:nr(o),attachments:h}}function Je(y){const S=y.lastIndexOf("/");return S>=0?y.slice(S+1):y}function Qe(y){const S=y.lastIndexOf(".");return S>=0?y.slice(S+1).toLowerCase():""}const tr=new Set([".obsidian",".trash",".git",".parachute","__MACOSX","node_modules"]);function Kt(y){return y.split("/").some(o=>tr.has(o)||o.startsWith("."))}function Yt(y){const S=y.toLowerCase();return S.endsWith(".md")||S.endsWith(".markdown")}function er(y){let S=null;for(const o of y){if(Kt(o.path)||!Yt(o.path))continue;const b=o.path.split("/")[0]??"";if(!o.path.includes("/"))return null;if(S===null)S=b;else if(b!==S)return null}return S}function rr(y,S){return S&&y.startsWith(`${S}/`)?y.slice(S.length+1):y}function nr(y){const S=new Set;for(const o of y)for(const b of o.tags)S.add(b);return[...S].sort()}function hr(){const y=se(s=>s.getActiveVault()),S=ie(),o=ae(),[b]=oe(),h=le(s=>s.push),[i,n]=gt.useState({kind:"pick"}),r=gt.useRef(null),c=gt.useRef(null);if(!y){const s=b.get("url");if(s){const d=`/add?url=${encodeURIComponent(s)}&redirect=${encodeURIComponent("/import")}`;return D.jsx(Tt,{to:d,replace:!0})}return D.jsx(Tt,{to:"/",replace:!0})}const m=gt.useCallback(async s=>{if(s.length===0)return;n({kind:"parsing"});const d=Be(s);try{let a;if(d==="obsidian-zip"){const l=s.find(Ht);if(!l){h("No zip file found in selection","error"),n({kind:"pick"});return}a=await qe(l)}else d==="loose-markdown"?a=await Ge(s.filter(jt)):a={format:d,notes:[],errors:s.map(l=>({sourcePath:l.name,reason:"Unrecognized format (expected .zip, .md, or .markdown)."})),tags:[],attachments:[]};n({kind:"review",parsed:a})}catch(a){h(a instanceof Error?a.message:"Parse failed","error"),n({kind:"pick"})}},[h]),v=gt.useCallback(async()=>{if(i.kind!=="review")return;if(!S){h("Vault session unavailable — reconnect first","error");return}const s=new AbortController;c.current=s,n({kind:"importing",parsed:i.parsed,progress:{done:0,total:i.parsed.notes.length}});const d=await Ie({client:S,parsed:i.parsed,signal:s.signal,onProgress:a=>{n(l=>l.kind==="importing"?{...l,progress:a}:l)}});c.current=null,n({kind:"done",report:d,parsed:i.parsed})},[i,S,h]),_=gt.useCallback(()=>{var s;(s=c.current)==null||s.abort()},[]),w=gt.useCallback(()=>{n({kind:"pick"}),r.current&&(r.current.value="")},[]);return D.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-7 md:px-6 md:py-10",children:[D.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:D.jsx(ce,{to:"/all",className:"hover:text-accent",children:"← All notes"})}),D.jsxs("header",{className:"mb-6",children:[D.jsxs("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:["Import notes into ",D.jsx("span",{className:"text-accent",children:y.name})]}),D.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."})]}),i.kind==="pick"||i.kind==="parsing"?D.jsx(sr,{parsing:i.kind==="parsing",onFiles:m,inputRef:r}):null,i.kind==="review"?D.jsx(ir,{parsed:i.parsed,onConfirm:v,onBack:w}):null,i.kind==="importing"?D.jsx(ar,{progress:i.progress,onCancel:_}):null,i.kind==="done"?D.jsx(or,{report:i.report,parsed:i.parsed,onAnother:w,onHome:()=>o("/")}):null]})}function sr({parsing:y,onFiles:S,inputRef:o}){const b=h=>{const i=Array.from(h.target.files??[]);i.length>0&&S(i)};return D.jsx("section",{children:D.jsx(he,{onDropFiles:S,className:"rounded-md border border-border bg-card",hint:"zip or markdown",children:D.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-4 p-8 text-center",children:[D.jsx("p",{className:"font-serif text-lg",children:y?"Reading files…":"Drop a file here"}),D.jsx("p",{className:"text-sm text-fg-dim",children:"Accepts an Obsidian vault `.zip`, or one or more `.md` / `.markdown` files."}),D.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[D.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-[--color-on-accent] hover:bg-accent-hover",children:[y?"Reading…":"Choose files",D.jsx("input",{ref:o,type:"file",className:"sr-only",accept:".zip,.md,.markdown",multiple:!0,disabled:y,onChange:b})]}),D.jsx("span",{className:"text-xs text-fg-dim",children:"— or drag and drop above"})]}),D.jsxs("details",{className:"mt-2 text-left text-xs text-fg-dim",children:[D.jsx("summary",{className:"cursor-pointer text-fg-muted hover:text-accent",children:"What about other tools?"}),D.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"," ",D.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 ir({parsed:y,onConfirm:S,onBack:o}){const{notes:b,errors:h,tags:i,attachments:n}=y,r=b.length,c=n.filter(d=>["image","pdf","audio","video"].includes(d.kind)).length,m=n.filter(d=>d.kind==="text").length,v=n.filter(d=>d.kind==="unsupported").length,_=r>0||c>0||m>0,w=gt.useMemo(()=>b.slice(0,8),[b]),s=gt.useMemo(()=>i.slice(0,12),[i]);return D.jsxs("section",{className:"space-y-6",children:[D.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[D.jsx("h2",{className:"font-serif text-lg",children:"Dry run"}),D.jsxs("p",{className:"mt-1 text-sm text-fg-muted",children:["Detected format: ",D.jsx(lr,{format:y.format}),"."," ",D.jsx("strong",{className:"text-fg",children:r})," ",r===1?"note":"notes"," will be created."," ",c>0?D.jsxs("span",{className:"text-fg-muted",children:[D.jsx("strong",{className:"text-fg",children:c})," attachment",c===1?"":"s"," (images / PDFs / audio) will come across."," "]}):null,m>0?D.jsxs("span",{className:"text-fg-muted",children:[m," data file",m===1?"":"s"," (json / csv / yaml / txt) will be saved as notes."," "]}):null,v>0?D.jsxs("span",{className:"text-fg-dim",children:[v," file",v===1?"":"s"," can't be imported (not a vault file type)."," "]}):null,h.length>0?D.jsxs("span",{className:"text-fg-dim",children:[h.length," file(s) couldn't be parsed."]}):null]}),i.length>0?D.jsxs("p",{className:"mt-2 text-sm text-fg-muted",children:[D.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Tags found"})," ",s.map(d=>D.jsxs("span",{className:"ml-1 inline-block rounded bg-bg/60 px-1.5 py-0.5 font-mono text-xs text-fg",children:["#",d]},d)),i.length>s.length?D.jsxs("span",{className:"ml-2 text-fg-dim",children:["+",i.length-s.length," more"]}):null]}):null]}),w.length>0?D.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[D.jsxs("h3",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:["Preview (",w.length," of ",r,")"]}),D.jsx("ul",{className:"space-y-1.5 font-mono text-xs",children:w.map(d=>D.jsxs("li",{className:"flex items-center justify-between gap-3",children:[D.jsx("span",{className:"truncate text-fg",children:d.path||d.sourcePath}),D.jsx("span",{className:"shrink-0 text-fg-dim",children:d.tags.length>0?`${d.tags.length} tag${d.tags.length===1?"":"s"}`:""})]},d.sourcePath))})]}):null,h.length>0?D.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[D.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[h.length," file(s) skipped during parse"]}),D.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:h.map(d=>D.jsxs("li",{className:"flex flex-col gap-0.5",children:[D.jsx("span",{className:"font-mono text-fg",children:d.sourcePath}),D.jsx("span",{className:"text-fg-dim",children:d.reason})]},d.sourcePath))})]}):null,D.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[D.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"}),D.jsxs("button",{type:"button",onClick:S,disabled:!_,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover disabled:opacity-40",children:["Run import (",r," ",r===1?"note":"notes",c>0?` + ${c} attachment${c===1?"":"s"}`:"",")"]})]})]})}function ar({progress:y,onCancel:S}){const o=y.total===0?0:Math.round(y.done/y.total*100);return D.jsxs("section",{className:"space-y-4 rounded-md border border-border bg-card p-6",children:[D.jsx("h2",{className:"font-serif text-lg",children:"Importing…"}),D.jsxs("p",{className:"text-sm text-fg-muted",children:[y.done," / ",y.total," notes processed."]}),D.jsx("div",{className:"h-2 w-full overflow-hidden rounded bg-bg/60",role:"progressbar",tabIndex:0,"aria-label":"Import progress","aria-valuenow":y.done,"aria-valuemin":0,"aria-valuemax":y.total,children:D.jsx("div",{className:"h-full bg-accent transition-all",style:{width:`${o}%`}})}),D.jsx("div",{className:"flex justify-end",children:D.jsx("button",{type:"button",onClick:S,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 or({report:y,parsed:S,onAnother:o,onHome:b}){const h=y.outcomes.filter(m=>m.status==="errored"),i=y.outcomes.filter(m=>m.status==="skipped"),n=y.attachmentOutcomes.filter(m=>m.status==="skipped"),r=y.attachmentOutcomes.filter(m=>m.status==="errored"),c=y.attachmentOutcomes.length>0;return D.jsxs("section",{className:"space-y-6",children:[D.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[D.jsx("h2",{className:"font-serif text-lg",children:"Import complete"}),D.jsxs("ul",{className:"mt-3 space-y-1 text-sm",children:[D.jsxs("li",{children:[D.jsx("span",{className:"text-accent",children:y.created})," notes created"]}),D.jsxs("li",{children:[D.jsx("span",{className:"text-fg-muted",children:y.skipped})," notes skipped (already in vault)"]}),D.jsxs("li",{children:[D.jsx("span",{className:y.errored>0?"text-red-400":"text-fg-muted",children:y.errored})," ","notes errored"]}),c?D.jsxs(D.Fragment,{children:[D.jsxs("li",{className:"pt-1",children:[D.jsx("span",{className:"text-accent",children:y.attachmentsUploaded})," attachments imported"]}),y.filesImportedAsNotes>0?D.jsxs("li",{children:[D.jsx("span",{className:"text-accent",children:y.filesImportedAsNotes})," data files imported as notes"]}):null,y.attachmentsSkipped>0?D.jsxs("li",{children:[D.jsx("span",{className:"text-fg-muted",children:y.attachmentsSkipped})," attachments skipped (not a vault file type)"]}):null,y.attachmentsErrored>0?D.jsxs("li",{children:[D.jsx("span",{className:"text-red-400",children:y.attachmentsErrored})," attachments errored"]}):null]}):null]}),S.errors.length>0?D.jsxs("p",{className:"mt-2 text-xs text-fg-dim",children:["(Plus ",S.errors.length," file(s) skipped at the parse stage — see above.)"]}):null]}),n.length>0||r.length>0?D.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[D.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[n.length+r.length," attachment(s) not imported as files — why"]}),D.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:[...r,...n].map(m=>D.jsxs("li",{className:"flex flex-col gap-0.5",children:[D.jsx("span",{className:"font-mono text-fg",children:m.sourcePath}),D.jsx("span",{className:"text-fg-dim",children:m.status==="skipped"||m.status==="errored"?m.reason:""})]},`a-${m.sourcePath}`))})]}):null,i.length>0?D.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[D.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[i.length," skipped — vault already had a matching note"]}),D.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:i.map(m=>D.jsxs("li",{className:"flex flex-col gap-0.5",children:[D.jsx("span",{className:"font-mono text-fg",children:m.sourcePath}),D.jsx("span",{className:"text-fg-dim",children:m.status==="skipped"?m.reason:""})]},`s-${m.sourcePath}`))})]}):null,h.length>0?D.jsxs("details",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4",open:!0,children:[D.jsxs("summary",{className:"cursor-pointer text-sm font-medium text-red-400",children:[h.length," errored"]}),D.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:h.map(m=>D.jsxs("li",{className:"flex flex-col gap-0.5",children:[D.jsx("span",{className:"font-mono text-fg",children:m.sourcePath}),D.jsx("span",{className:"text-fg-dim",children:m.status==="errored"?m.reason:""})]},`e-${m.sourcePath}`))})]}):null,D.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[D.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"}),D.jsx("button",{type:"button",onClick:b,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-[--color-on-accent] hover:bg-accent-hover",children:"Back to vault"})]})]})}function lr({format:y}){const S=y==="obsidian-zip"?"Obsidian vault (zip)":y==="loose-markdown"?"loose markdown":"unknown";return D.jsx("span",{className:"rounded bg-bg/60 px-1.5 py-0.5 font-mono text-xs text-fg",children:S})}export{hr as Import};