@copio/sdk 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +204 -2
  2. package/css/container.css +177 -0
  3. package/css/cropper.css +306 -0
  4. package/css/main.css +139 -0
  5. package/css/reset.css +204 -0
  6. package/css/shoelace.css +485 -0
  7. package/css/utils.css +689 -0
  8. package/dist/adapters/image/canvas2d-adapter.js +2 -0
  9. package/dist/adapters/image/canvas2d-adapter.js.map +7 -0
  10. package/dist/adapters/image/index.js +2 -0
  11. package/dist/adapters/image/index.js.map +7 -0
  12. package/dist/adapters/image/null-image-processor-adapter.js +2 -0
  13. package/dist/adapters/image/null-image-processor-adapter.js.map +7 -0
  14. package/dist/adapters/index.js +2 -0
  15. package/dist/adapters/index.js.map +7 -0
  16. package/dist/adapters/indexeddb-adapter.js +2 -0
  17. package/dist/adapters/indexeddb-adapter.js.map +7 -0
  18. package/dist/adapters/memory-adapter.js +2 -0
  19. package/dist/adapters/memory-adapter.js.map +7 -0
  20. package/dist/adapters/ocr/index.js +2 -0
  21. package/dist/adapters/ocr/index.js.map +7 -0
  22. package/dist/adapters/ocr/null-ocr-adapter.js +2 -0
  23. package/dist/adapters/ocr/null-ocr-adapter.js.map +7 -0
  24. package/dist/adapters/ocr/tesseract-wasm-adapter.js +2 -0
  25. package/dist/adapters/ocr/tesseract-wasm-adapter.js.map +7 -0
  26. package/dist/adapters/pdf/index.js +2 -0
  27. package/dist/adapters/pdf/index.js.map +7 -0
  28. package/dist/adapters/pdf/null-pdf-adapter.js +2 -0
  29. package/dist/adapters/pdf/null-pdf-adapter.js.map +7 -0
  30. package/dist/adapters/pdf/pdfkit-adapter.js +2 -0
  31. package/dist/adapters/pdf/pdfkit-adapter.js.map +7 -0
  32. package/dist/adapters/storage/index.js +2 -0
  33. package/dist/adapters/storage/index.js.map +7 -0
  34. package/dist/adapters/storage/indexeddb-adapter.js +2 -0
  35. package/dist/adapters/storage/indexeddb-adapter.js.map +7 -0
  36. package/dist/adapters/storage/memory-adapter.js +2 -0
  37. package/dist/adapters/storage/memory-adapter.js.map +7 -0
  38. package/dist/adapters/sync/index.js +2 -0
  39. package/dist/adapters/sync/index.js.map +7 -0
  40. package/dist/adapters/sync/null-sync-adapter.js +2 -0
  41. package/dist/adapters/sync/null-sync-adapter.js.map +7 -0
  42. package/dist/adapters/sync/peerjs-adapter.js +2 -0
  43. package/dist/adapters/sync/peerjs-adapter.js.map +7 -0
  44. package/dist/canvas-FAXPLPXN.js +2 -0
  45. package/dist/cdn.js +2770 -0
  46. package/dist/chunk-36F637QU.js +2 -0
  47. package/dist/chunk-4C666HHU.js +2 -0
  48. package/dist/chunk-4GEMGDRU.js +1 -0
  49. package/dist/chunk-4JPEWIT4.js +2 -0
  50. package/dist/chunk-6IBEH4EW.js +2601 -0
  51. package/dist/chunk-A5G52Q2W.js +2 -0
  52. package/dist/chunk-AU7NM25J.js +2 -0
  53. package/dist/chunk-B2EK6INF.js +2 -0
  54. package/dist/chunk-B5BEYYR2.js +8 -0
  55. package/dist/chunk-B7HT2X67.js +2 -0
  56. package/dist/chunk-BKZEOOH4.js +2 -0
  57. package/dist/chunk-CWCS22CQ.js +1 -0
  58. package/dist/chunk-DGGK5KEX.js +2 -0
  59. package/dist/chunk-E7JYVRJA.js +2 -0
  60. package/dist/chunk-G65H4ZTJ.js +2 -0
  61. package/dist/chunk-HN3336JN.js +2 -0
  62. package/dist/chunk-IUBYFIV6.js +12 -0
  63. package/dist/chunk-K6YP7EET.js +8 -0
  64. package/dist/chunk-KIMVF5UG.js +2 -0
  65. package/dist/chunk-LI54F6PA.js +2 -0
  66. package/dist/chunk-N4R55VRR.js +2 -0
  67. package/dist/chunk-N7Q34F2P.js +4 -0
  68. package/dist/chunk-OI4WCW7E.js +2 -0
  69. package/dist/chunk-PUJYN435.js +1 -0
  70. package/dist/chunk-PVNRK4OH.js +2 -0
  71. package/dist/chunk-SH4P4XSZ.js +2 -0
  72. package/dist/chunk-UCV3MQ6I.js +33 -0
  73. package/dist/chunk-V2FP4EEH.js +2 -0
  74. package/dist/chunk-V6E2SSSW.js +1 -0
  75. package/dist/chunk-XEN5VKAV.js +19 -0
  76. package/dist/chunk-YHLOPPXM.js +2 -0
  77. package/dist/core.js +2 -0
  78. package/dist/custom-elements.json +4779 -0
  79. package/dist/export.js +2 -0
  80. package/dist/fs-HJ6WWW73.js +2 -0
  81. package/dist/http-FKJJMT2N.js +2 -0
  82. package/dist/https-MUBFLDZM.js +2 -0
  83. package/dist/index.js +99 -0
  84. package/dist/ocr.js +2 -0
  85. package/dist/path2d-QWN6DFCC.js +2 -0
  86. package/dist/scanner.js +2631 -0
  87. package/dist/sync.js +2 -0
  88. package/dist/types/js/adapters/image/canvas2d-adapter.d.ts +42 -0
  89. package/dist/types/js/adapters/image/image-processor-port.d.ts +41 -0
  90. package/dist/types/js/adapters/image/index.d.ts +3 -0
  91. package/dist/types/js/adapters/image/null-image-processor-adapter.d.ts +13 -0
  92. package/dist/types/js/adapters/ocr/index.d.ts +3 -0
  93. package/dist/types/js/adapters/ocr/null-ocr-adapter.d.ts +39 -0
  94. package/dist/types/js/adapters/ocr/ocr-port.d.ts +139 -0
  95. package/dist/types/js/adapters/ocr/tesseract-wasm-adapter.d.ts +40 -0
  96. package/dist/types/js/adapters/pdf/index.d.ts +3 -0
  97. package/dist/types/js/adapters/pdf/null-pdf-adapter.d.ts +23 -0
  98. package/dist/types/js/adapters/pdf/pdf-port.d.ts +21 -0
  99. package/dist/types/js/adapters/pdf/pdfkit-adapter.d.ts +16 -0
  100. package/dist/types/js/adapters/storage/index.d.ts +22 -0
  101. package/dist/types/js/adapters/storage/indexeddb-adapter.d.ts +109 -0
  102. package/dist/types/js/adapters/storage/memory-adapter.d.ts +101 -0
  103. package/dist/types/js/adapters/storage/storage-port.d.ts +113 -0
  104. package/dist/types/js/adapters/sync/index.d.ts +3 -0
  105. package/dist/types/js/adapters/sync/null-sync-adapter.d.ts +14 -0
  106. package/dist/types/js/adapters/sync/peerjs-adapter.d.ts +16 -0
  107. package/dist/types/js/adapters/sync/sync-port.d.ts +18 -0
  108. package/dist/types/js/components/copio-header.d.ts +19 -0
  109. package/dist/types/js/components/copio-loader.d.ts +6 -0
  110. package/dist/types/js/core/store.d.ts +2 -0
  111. package/dist/types/js/routes/add-edit/copio-add-edit-dialog.d.ts +9 -0
  112. package/dist/types/js/routes/doc/copio-carousel.d.ts +43 -0
  113. package/dist/types/js/routes/doc/copio-images.d.ts +37 -0
  114. package/dist/types/js/routes/home/copio-row.d.ts +49 -0
  115. package/dist/types/js/routes/ocr/copio-doc-ocr-dialog.d.ts +97 -0
  116. package/dist/types/js/routes/sync/copio-sync-dialog.d.ts +13 -0
  117. package/dist/types/js/services/doc-repository.d.ts +233 -0
  118. package/dist/types/js/services/export-utils.d.ts +42 -0
  119. package/dist/types/js/services/ice-servers.d.ts +1 -0
  120. package/dist/types/js/services/notify.d.ts +82 -0
  121. package/dist/types/js/services/ocr-service.d.ts +64 -0
  122. package/dist/types/js/services/sync-service.d.ts +11 -0
  123. package/dist/types/js/styles/cropper-styles.d.ts +5 -0
  124. package/dist/types/js/utils/module-loader.d.ts +76 -0
  125. package/dist/types/js/utils/pdf-utils.d.ts +7 -0
  126. package/dist/types/js/utils/utils.d.ts +54 -0
  127. package/dist/types/sdk/cdn.d.ts +7 -0
  128. package/dist/types/sdk/core.d.ts +310 -0
  129. package/dist/types/sdk/elements.d.ts +25 -0
  130. package/dist/types/sdk/events.d.ts +227 -0
  131. package/dist/types/sdk/index.d.ts +37 -0
  132. package/dist/types/sdk/license.d.ts +12 -0
  133. package/dist/types/sdk/models.d.ts +174 -0
  134. package/dist/types/sdk/scanner.d.ts +68 -0
  135. package/dist/types/sdk/styles.d.ts +21 -0
  136. package/dist/types/sdk/sync.d.ts +7 -0
  137. package/dist/types/sdk/version.d.ts +2 -0
  138. package/dist/url-ABJ6S2Y6.js +2 -0
  139. package/package.json +72 -3
  140. package/sdk/cdn.js +13 -0
  141. package/sdk/core.js +961 -0
  142. package/sdk/events.js +99 -0
  143. package/sdk/index.js +137 -0
  144. package/sdk/license.js +28 -0
  145. package/sdk/models.js +177 -0
  146. package/sdk/scanner.js +1597 -0
  147. package/sdk/styles.js +1236 -0
  148. package/sdk/sync.js +12 -0
  149. package/sdk/version.js +7 -0
@@ -0,0 +1,8 @@
1
+ import{a as S}from"./chunk-IUBYFIV6.js";import{d as g}from"./chunk-V2FP4EEH.js";import{f as U,g as A,h as C}from"./chunk-G65H4ZTJ.js";import{a as H}from"./chunk-4C666HHU.js";var I={};H(I,{exportDocumentAsImages:()=>O,exportDocumentAsMarkdown:()=>j,exportDocumentAsPdf:()=>M,renderMarkdownToPageDataUrls:()=>T,renderMarkdownToPdf:()=>R});function $(e){return e?e.replace(/✅/g,"Yes").replace(/❌/g,"No").replace(/[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/gu,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/`(.*?)`/g,"$1").trim():""}function R(e,c){if(!window.marked||!window.marked.lexer)return;let m=window.marked.lexer(c||"");function l(o=30){e.y+o>e.page.height-e.page.margins.bottom&&e.addPage({size:"A4",margin:40})}e.addPage({size:"A4",margin:40});for(let o of m)if(o.type==="heading"){l(40),e.moveDown(.3);let r=o.depth===1?20:o.depth===2?15:12;e.font("Helvetica-Bold").fontSize(r).fillColor("#0f172a").text($(o.text)),e.moveDown(.2)}else if(o.type==="paragraph"){let r=o.tokens&&o.tokens.find(t=>t.type==="image");if(r&&r.href&&r.href.startsWith("data:"))try{l(180),e.moveDown(.4),e.image(r.href,{fit:[515,300],align:"center"}),e.moveDown(.4)}catch(t){console.error("Error rendering embedded image to PDF:",t)}else l(20),e.font("Helvetica").fontSize(10.5).fillColor("#334155").text($(o.text),{lineGap:3}),e.moveDown(.4)}else if(o.type==="hr")l(15),e.moveDown(.2),e.strokeColor("#e2e8f0").lineWidth(1).moveTo(40,e.y).lineTo(555,e.y).stroke(),e.moveDown(.4);else if(o.type==="list"){for(let r=0;r<o.items.length;r++){let t=o.items[r];l(18);let n="\u2022 ";o.ordered?n=`${r+1}. `:t.task&&(n=t.checked?"[x] ":"[ ] "),e.font("Helvetica").fontSize(10.5).fillColor("#334155").text(n+$(t.text),{indent:10,lineGap:2})}e.moveDown(.4)}else if(o.type==="blockquote"){l(35);let r=e.y;e.font("Helvetica-Oblique").fontSize(10).fillColor("#475569").text($(o.text),50,r,{width:495});let t=e.y;e.strokeColor("#0284c7").lineWidth(3).moveTo(42,r).lineTo(42,t).stroke(),e.x=40,e.moveDown(.4)}else if(o.type==="code"){l(50);let r=o.text,t=e.y;e.font("Courier").fontSize(9).fillColor("#0f172a");let n=e.heightOfString(r,{width:495})+16;e.rect(40,t,515,n).fill("#f1f5f9"),e.fillColor("#0f172a").text(r,50,t+8,{width:495}),e.x=40,e.y=t+n+10}else if(o.type==="table"){l(50);let t=515/o.header.length,n=e.y;e.rect(40,n,515,22).fill("#f1f5f9"),e.font("Helvetica-Bold").fontSize(9.5).fillColor("#0f172a"),o.header.forEach((p,d)=>{e.text($(p.text),45+d*t,n+6,{width:t-10,align:"left"})}),e.y=n+22,e.font("Helvetica").fontSize(9).fillColor("#334155"),o.rows.forEach((p,d)=>{l(20);let h=e.y;d%2===1&&e.rect(40,h,515,20).fill("#f8fafc"),e.fillColor("#334155"),p.forEach((x,F)=>{e.text($(x.text),45+F*t,h+5,{width:t-10,align:"left"})}),e.y=h+20}),e.moveDown(.5)}}async function T(e){let[c]=await Promise.all([U(),C()]),m=new c({autoFirstPage:!1}),l=[];m.on("data",t=>l.push(t));let o=new Promise((t,n)=>{m.on("end",async()=>{try{let d=await new Blob(l,{type:"application/pdf"}).arrayBuffer();t(d)}catch(p){n(p)}}),m.on("error",n)});R(m,e.content||""),m.end();let r=await o;return S(r)}async function M(e,c,m={}){let{onProgress:l,showProgress:o=!0,download:r=!0}=m;if(!c||c.length===0){g.warning("No images to export");return}let t=null,n=c.length;try{o&&n>1&&(t=await g.progress({message:`Exporting "${e||"document"}.pdf"...`,total:n,done:0}));let p=null;if(typeof window<"u"&&!window.PDFDocument){typeof l=="function"&&l(0,n,"Downloading PDF engine...");try{p=await g.progress({message:"Downloading PDF engine...",total:100,done:0})}catch{}}let h=c.some(a=>a.type==="markdown"),x;try{let[a]=await Promise.all([U(),h?C():Promise.resolve()]);x=a}finally{p?.close()}let F=595.28,P=841.89,y=new x({autoFirstPage:!1}),v=[];y.on("data",a=>v.push(a));let i=new Promise((a,u)=>{y.on("end",()=>{try{let w=new Blob(v,{type:"application/pdf"});if(r!==!1){let s=URL.createObjectURL(w),f=document.createElement("a");f.href=s,f.download=`${e||"document"}.pdf`,f.click(),URL.revokeObjectURL(s),g.success(`Exported "${e||"document"}.pdf"`)}t?.close(),typeof window<"u"&&typeof window.dispatchEvent=="function"&&window.dispatchEvent(new CustomEvent("copio:export-complete",{bubbles:!0,composed:!0,detail:{type:"pdf",format:"pdf",blob:w,docName:e||"document"}})),a(w)}catch(w){u(w)}}),y.on("error",u)});for(let a=0;a<c.length;a++){let u=c[a],w=a+1;if(u.type==="markdown")R(y,u.content);else{let s=new Image;if(await new Promise(f=>{s.onload=f,s.onerror=b=>{console.warn("Page image failed to load for PDF:",b),f(void 0)},s.src=u.src}),s.width&&s.height){y.addPage({size:"A4"});let f=F/s.width,b=P/s.height,k=Math.min(f,b),E=s.width*k,z=s.height*k,L=(F-E)/2,D=(P-z)/2;y.image(u.src,L,D,{width:E,height:z})}}typeof l=="function"&&l(w,n),t&&t.update({done:w,total:n,message:`Exporting PDF: page ${w} of ${n}...`}),typeof window<"u"&&typeof window.dispatchEvent=="function"&&window.dispatchEvent(new CustomEvent("copio:export-progress",{detail:{type:"pdf",done:w,total:n,docName:e||"document"}})),await new Promise(s=>setTimeout(s,0))}return y.end(),await i}catch(p){t?.close(),console.error("Error generating PDF:",p),g.error("Failed to generate PDF")}}async function O(e,c,m={}){let{onProgress:l,showProgress:o=!0,download:r=!0}=m;if(!c||c.length===0){g.warning("No images to export");return}let t=null;try{let n=(e||"document").trim(),d=(i=>i.replace(/[/\\?%*:|"<>]/g,"_"))(n)||"document";if(c.length===1&&c[0].type!=="markdown"){let i=c[0],a="jpg";if(i.src.startsWith("data:")){let f=i.src.match(/^data:(image\/[a-zA-Z+]+);base64,/);f&&f[1].includes("png")&&(a="png")}let u=i.src,w=!1,s=null;if(!i.src.startsWith("data:")&&!i.src.startsWith("blob:"))s=await(await fetch(i.src)).blob(),u=URL.createObjectURL(s),w=!0;else if(i.src.startsWith("data:"))try{s=await(await fetch(i.src)).blob()}catch{s=new Blob([i.src],{type:`image/${a}`})}if(typeof l=="function"&&l(1,1),typeof window<"u"&&typeof window.dispatchEvent=="function"&&window.dispatchEvent(new CustomEvent("copio:export-progress",{detail:{type:"image",done:1,total:1,docName:d}})),r!==!1){let f=document.createElement("a");f.href=u,f.download=`${d}.${a}`,f.click(),g.success(`Exported "${d}.${a}"`)}return w&&URL.revokeObjectURL(u),typeof window<"u"&&typeof window.dispatchEvent=="function"&&window.dispatchEvent(new CustomEvent("copio:export-complete",{bubbles:!0,composed:!0,detail:{type:"image",format:a,blob:s,docName:d}})),s}let h=c.length;o&&h>1&&(t=await g.progress({message:`Exporting "${d}.zip"...`,total:h,done:0}));let x=c.some(i=>i.type==="markdown"),[F]=await Promise.all([A(),x?Promise.all([U(),C()]):Promise.resolve()]),P=new F,y=0;for(let i=0;i<c.length;i++){let a=c[i],u=[];a.type==="markdown"?u=await T(a):u=[a.src];let w=Math.max(2,String(c.length*u.length).length);for(let f=0;f<u.length;f++){let b=u[f],k="jpg",E="";if(b&&b.startsWith("data:")){let D=b.match(/^data:(image\/[a-zA-Z+]+);base64,(.*)$/);D?(D[1].includes("png")&&(k="png"),E=D[2]):E=b.replace(/^data:[^;]+;base64,/,"")}else{let B=await(await(await fetch(b)).blob()).arrayBuffer(),N=String(y+1).padStart(w,"0"),W=`${d}-${N}.${k}`;P.file(W,B),y++;continue}let z=String(y+1).padStart(w,"0"),L=`${d}-${z}.${k}`;P.file(L,E,{base64:!0}),y++}let s=i+1;typeof l=="function"&&l(s,h),t&&t.update({done:s,total:h,message:`Exporting ZIP: page ${s} of ${h}...`}),typeof window<"u"&&typeof window.dispatchEvent=="function"&&window.dispatchEvent(new CustomEvent("copio:export-progress",{detail:{type:"zip",done:s,total:h,docName:d}})),await new Promise(f=>setTimeout(f,0))}t&&t.update({message:"Compressing archive..."});let v=await P.generateAsync({type:"blob"},i=>{t&&i.percent&&t.update({value:Math.round(i.percent),message:`Compressing ZIP: ${Math.round(i.percent)}%...`})});if(r!==!1){let i=URL.createObjectURL(v),a=document.createElement("a");a.href=i,a.download=`${d}.zip`,a.click(),URL.revokeObjectURL(i),g.success(`Exported "${d}.zip"`)}return t?.close(),typeof window<"u"&&typeof window.dispatchEvent=="function"&&window.dispatchEvent(new CustomEvent("copio:export-complete",{bubbles:!0,composed:!0,detail:{type:"zip",format:"zip",blob:v,docName:d}})),v}catch(n){t?.close(),console.error("Error downloading images:",n),g.error("Failed to download images")}}function j(e,c){if(!c)return;let m=c.filter(p=>p.type==="markdown");if(m.length===0){g.warning("No markdown text in this document");return}let l=(e||"document").trim().replace(/[/\\?%*:|"<>]/g,"_"),o="";m.length===1?o=m[0].content||"":o=m.map((p,d)=>`# Page ${d+1}: ${p.name||""}
2
+
3
+ ${p.content||""}`).join(`
4
+
5
+ ---
6
+
7
+ `);let r=new Blob([o],{type:"text/markdown;charset=utf-8"}),t=URL.createObjectURL(r),n=document.createElement("a");n.href=t,n.download=`${l}.md`,n.click(),URL.revokeObjectURL(t),g.success(`Exported "${l}.md"`)}export{R as a,T as b,M as c,O as d,j as e,I as f};
8
+ //# sourceMappingURL=chunk-K6YP7EET.js.map
@@ -0,0 +1,2 @@
1
+ var e=class{async connect(t={}){throw new Error("SyncPort.connect() must be implemented by adapter")}async disconnect(){throw new Error("SyncPort.disconnect() must be implemented by adapter")}};export{e as a};
2
+ //# sourceMappingURL=chunk-KIMVF5UG.js.map
@@ -0,0 +1,2 @@
1
+ var r=class{async init(){throw new Error("StoragePort.init() must be implemented by adapter")}async listDocs(){throw new Error("StoragePort.listDocs() must be implemented by adapter")}async getDoc(e){throw new Error("StoragePort.getDoc() must be implemented by adapter")}async saveDoc(e,t){throw new Error("StoragePort.saveDoc() must be implemented by adapter")}async deleteDoc(e){throw new Error("StoragePort.deleteDoc() must be implemented by adapter")}async savePage(e,t,o){throw new Error("StoragePort.savePage() must be implemented by adapter")}async getPage(e,t){throw new Error("StoragePort.getPage() must be implemented by adapter")}async deletePage(e,t){throw new Error("StoragePort.deletePage() must be implemented by adapter")}subscribe(e){return()=>{}}};export{r as a};
2
+ //# sourceMappingURL=chunk-LI54F6PA.js.map
@@ -0,0 +1,2 @@
1
+ var t=class{async recognizeImageText(e,r={}){throw new Error("OcrPort.recognizeImageText() must be implemented by adapter")}async recognizeDocumentPages(e,r={}){throw new Error("OcrPort.recognizeDocumentPages() must be implemented by adapter")}async getOcrWorker(e="eng",r=null){throw new Error("OcrPort.getOcrWorker() must be implemented by adapter")}async terminateOcrWorker(){throw new Error("OcrPort.terminateOcrWorker() must be implemented by adapter")}};export{t as a};
2
+ //# sourceMappingURL=chunk-N4R55VRR.js.map
@@ -0,0 +1,4 @@
1
+ import{a as Et}from"./chunk-HN3336JN.js";function d(s,t,e){return t in s?Object.defineProperty(s,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):s[t]=e,s}var At=typeof self<"u"?self:global,q=typeof navigator<"u",me=q&&typeof HTMLImageElement>"u",zt=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),It=At.Buffer,tt=At.BigInt,Ut=!!It,et=s=>Yt(s)?void 0:s,ye=s=>s!==void 0;function Yt(s){return s===void 0||(s instanceof Map?s.size===0:Object.values(s).filter(ye).length===0)}function m(s){let t=new Error(s);throw delete t.stack,t}function qt(s){return(s=(function(t){for(;t.endsWith("\0");)t=t.slice(0,-1);return t})(s).trim())===""?void 0:s}function Vt(s){let t=(function(e){let i=0;return e.ifd0.enabled&&(i+=1024),e.exif.enabled&&(i+=2048),e.makerNote&&(i+=2048),e.userComment&&(i+=1024),e.gps.enabled&&(i+=512),e.interop.enabled&&(i+=100),e.ifd1.enabled&&(i+=1024),i+2048})(s);return s.jfif.enabled&&(t+=50),s.xmp.enabled&&(t+=2e4),s.iptc.enabled&&(t+=14e3),s.icc.enabled&&(t+=6e3),t}var yt=s=>String.fromCharCode.apply(null,s),Nt=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;function Zt(s){return Nt?Nt.decode(s):Ut?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(yt(s)))}var O=class s{static from(t,e){return t instanceof this&&t.le===e?t:new s(t,void 0,void 0,e)}constructor(t,e=0,i,n){if(typeof n=="boolean"&&(this.le=n),Array.isArray(t)&&(t=new Uint8Array(t)),t===0)this.byteOffset=0,this.byteLength=0;else if(t instanceof ArrayBuffer){i===void 0&&(i=t.byteLength-e);let r=new DataView(t,e,i);this._swapDataView(r)}else if(t instanceof Uint8Array||t instanceof DataView||t instanceof s){i===void 0&&(i=t.byteLength-e),(e+=t.byteOffset)+i>t.byteOffset+t.byteLength&&m("Creating view outside of available memory in ArrayBuffer");let r=new DataView(t.buffer,e,i);this._swapDataView(r)}else if(typeof t=="number"){let r=new DataView(new ArrayBuffer(t));this._swapDataView(r)}else m("Invalid input argument for BufferView: "+t)}_swapArrayBuffer(t){this._swapDataView(new DataView(t))}_swapBuffer(t){this._swapDataView(new DataView(t.buffer,t.byteOffset,t.byteLength))}_swapDataView(t){this.dataView=t,this.buffer=t.buffer,this.byteOffset=t.byteOffset,this.byteLength=t.byteLength}_lengthToEnd(t){return this.byteLength-t}set(t,e,i=s){return t instanceof DataView||t instanceof s?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array||m("BufferView.set(): Invalid data argument."),this.toUint8().set(t,e),new i(this,e,t.byteLength)}subarray(t,e){return e=e||this._lengthToEnd(t),new s(this,t,e)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(t,e){return new Uint8Array(this.buffer,this.byteOffset+t,e)}getString(t=0,e=this.byteLength){return Zt(this.getUint8Array(t,e))}getLatin1String(t=0,e=this.byteLength){let i=this.getUint8Array(t,e);return yt(i)}getUnicodeString(t=0,e=this.byteLength){let i=[];for(let n=0;n<e&&t+n<this.byteLength;n+=2)i.push(this.getUint16(t+n));return yt(i)}getInt8(t){return this.dataView.getInt8(t)}getUint8(t){return this.dataView.getUint8(t)}getInt16(t,e=this.le){return this.dataView.getInt16(t,e)}getInt32(t,e=this.le){return this.dataView.getInt32(t,e)}getUint16(t,e=this.le){return this.dataView.getUint16(t,e)}getUint32(t,e=this.le){return this.dataView.getUint32(t,e)}getFloat32(t,e=this.le){return this.dataView.getFloat32(t,e)}getFloat64(t,e=this.le){return this.dataView.getFloat64(t,e)}getFloat(t,e=this.le){return this.dataView.getFloat32(t,e)}getDouble(t,e=this.le){return this.dataView.getFloat64(t,e)}getUintBytes(t,e,i){switch(e){case 1:return this.getUint8(t,i);case 2:return this.getUint16(t,i);case 4:return this.getUint32(t,i);case 8:return this.getUint64&&this.getUint64(t,i)}}getUint(t,e,i){switch(e){case 8:return this.getUint8(t,i);case 16:return this.getUint16(t,i);case 32:return this.getUint32(t,i);case 64:return this.getUint64&&this.getUint64(t,i)}}toString(t){return this.dataView.toString(t,this.constructor.name)}ensureChunk(){}};function bt(s,t){m(`${s} '${t}' was not loaded, try using full build of exifr.`)}var Z=class extends Map{constructor(t){super(),this.kind=t}get(t,e){return this.has(t)||bt(this.kind,t),e&&(t in e||(function(i,n){m(`Unknown ${i} '${n}'.`)})(this.kind,t),e[t].enabled||bt(this.kind,t)),super.get(t)}keyList(){return Array.from(this.keys())}},V=new Z("file parser"),b=new Z("segment parser"),N=new Z("file reader"),Jt=At.fetch;function Rt(s,t){return(e=s).startsWith("data:")||e.length>1e4?St(s,t,"base64"):zt&&s.includes("://")?wt(s,t,"url",G):zt?St(s,t,"fs"):q?wt(s,t,"url",G):void m("Invalid input argument");var e}async function wt(s,t,e,i){return N.has(e)?St(s,t,e):i?(async function(n,r){let a=await r(n);return new O(a)})(s,i):void m(`Parser ${e} is not loaded`)}async function St(s,t,e){let i=new(N.get(e))(s,t);return await i.read(),i}var G=s=>Jt(s).then((t=>t.arrayBuffer())),H=s=>new Promise(((t,e)=>{let i=new FileReader;i.onloadend=()=>t(i.result||new ArrayBuffer),i.onerror=e,i.readAsArrayBuffer(s)})),kt=class extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}};function k(s,t,e){let i=new kt;for(let[n,r]of e)i.set(n,r);if(Array.isArray(t))for(let n of t)s.set(n,i);else s.set(t,i);return i}function Bt(s,t,e){let i,n=s.get(t);for(i of e)n.set(i[0],i[1])}var C=new Map,$=new Map,z=new Map,F=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],J=["jfif","xmp","icc","iptc","ihdr"],W=["tiff",...J],p=["ifd0","ifd1","exif","gps","interop"],M=[...W,...p],T=["makerNote","userComment"],Q=["translateKeys","translateValues","reviveValues","multiSegment"],E=[...Q,"sanitize","mergeOutput","silentErrors"],it=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},D=class extends it{get needed(){return this.enabled||this.deps.size>0}constructor(t,e,i,n){if(super(),d(this,"enabled",!1),d(this,"skip",new Set),d(this,"pick",new Set),d(this,"deps",new Set),d(this,"translateKeys",!1),d(this,"translateValues",!1),d(this,"reviveValues",!1),this.key=t,this.enabled=e,this.parse=this.enabled,this.applyInheritables(n),this.canBeFiltered=p.includes(t),this.canBeFiltered&&(this.dict=C.get(t)),i!==void 0)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if(typeof i=="object"){if(this.enabled=!0,this.parse=i.parse!==!1,this.canBeFiltered){let{pick:r,skip:a}=i;r&&r.length>0&&this.translateTagSet(r,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(i)}else i===!0||i===!1?this.parse=this.enabled=i:m(`Invalid options argument: ${i}`)}applyInheritables(t){let e,i;for(e of Q)i=t[e],i!==void 0&&(this[e]=i)}translateTagSet(t,e){if(this.dict){let i,n,{tagKeys:r,tagValues:a}=this.dict;for(i of t)typeof i=="string"?(n=a.indexOf(i),n===-1&&(n=r.indexOf(Number(i))),n!==-1&&e.add(Number(r[n]))):e.add(i)}else for(let i of t)e.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,st(this.pick,this.deps)):this.enabled&&this.pick.size>0&&st(this.pick,this.deps)}},y={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},jt=new Map,I=class extends it{static useCached(t){let e=jt.get(t);return e!==void 0||(e=new this(t),jt.set(t,e)),e}constructor(t){super(),t===!0?this.setupFromTrue():t===void 0?this.setupFromUndefined():Array.isArray(t)?this.setupFromArray(t):typeof t=="object"?this.setupFromObject(t):m(`Invalid options argument ${t}`),this.firstChunkSize===void 0&&(this.firstChunkSize=q?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let t;for(t of F)this[t]=y[t];for(t of E)this[t]=y[t];for(t of T)this[t]=y[t];for(t of M)this[t]=new D(t,y[t],void 0,this)}setupFromTrue(){let t;for(t of F)this[t]=y[t];for(t of E)this[t]=y[t];for(t of T)this[t]=!0;for(t of M)this[t]=new D(t,!0,void 0,this)}setupFromArray(t){let e;for(e of F)this[e]=y[e];for(e of E)this[e]=y[e];for(e of T)this[e]=y[e];for(e of M)this[e]=new D(e,!1,void 0,this);this.setupGlobalFilters(t,void 0,p)}setupFromObject(t){let e;for(e of(p.ifd0=p.ifd0||p.image,p.ifd1=p.ifd1||p.thumbnail,Object.assign(this,t),F))this[e]=gt(t[e],y[e]);for(e of E)this[e]=gt(t[e],y[e]);for(e of T)this[e]=gt(t[e],y[e]);for(e of W)this[e]=new D(e,y[e],t[e],this);for(e of p)this[e]=new D(e,y[e],t[e],this.tiff);this.setupGlobalFilters(t.pick,t.skip,p,M),t.tiff===!0?this.batchEnableWithBool(p,!0):t.tiff===!1?this.batchEnableWithUserValue(p,t):Array.isArray(t.tiff)?this.setupGlobalFilters(t.tiff,void 0,p):typeof t.tiff=="object"&&this.setupGlobalFilters(t.tiff.pick,t.tiff.skip,p)}batchEnableWithBool(t,e){for(let i of t)this[i].enabled=e}batchEnableWithUserValue(t,e){for(let i of t){let n=e[i];this[i].enabled=n!==!1&&n!==void 0}}setupGlobalFilters(t,e,i,n=i){if(t&&t.length){for(let a of n)this[a].enabled=!1;let r=Gt(t,i);for(let[a,o]of r)st(this[a].pick,o),this[a].enabled=!0}else if(e&&e.length){let r=Gt(e,i);for(let[a,o]of r)st(this[a].skip,o)}}filterNestedSegmentTags(){let{ifd0:t,exif:e,xmp:i,iptc:n,icc:r}=this;this.makerNote?e.deps.add(37500):e.skip.add(37500),this.userComment?e.deps.add(37510):e.skip.add(37510),i.enabled||t.skip.add(700),n.enabled||t.skip.add(33723),r.enabled||t.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:t,exif:e,gps:i,interop:n}=this;n.needed&&(e.deps.add(40965),t.deps.add(40965)),e.needed&&t.deps.add(34665),i.needed&&t.deps.add(34853),this.tiff.enabled=p.some((r=>this[r].enabled===!0))||this.makerNote||this.userComment;for(let r of p)this[r].finalizeFilters()}get onlyTiff(){return!J.map((t=>this[t].enabled)).some((t=>t===!0))&&this.tiff.enabled}checkLoadedPlugins(){for(let t of W)this[t].enabled&&!b.has(t)&&bt("segment parser",t)}};function Gt(s,t){let e,i,n,r,a=[];for(n of t){for(r of(e=C.get(n),i=[],e))(s.includes(r[0])||s.includes(r[1]))&&i.push(r[0]);i.length&&a.push([n,i])}return a}function gt(s,t){return s!==void 0?s:t!==void 0?t:void 0}function st(s,t){for(let e of t)s.add(e)}d(I,"default",y);var P=class{constructor(t){d(this,"parsers",{}),d(this,"output",{}),d(this,"errors",[]),d(this,"pushToErrors",(e=>this.errors.push(e))),this.options=I.useCached(t)}async read(t){this.file=await(function(e,i){return typeof e=="string"?Rt(e,i):q&&!me&&e instanceof HTMLImageElement?Rt(e.src,i):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new O(e):q&&e instanceof Blob?wt(e,i,"blob",H):void m("Invalid input argument")})(t,this.options)}setup(){if(this.fileParser)return;let{file:t}=this,e=t.getUint16(0);for(let[i,n]of V)if(n.canHandle(t,e))return this.fileParser=new n(this.options,this.file,this.parsers),t[i]=!0;this.file.close&&this.file.close(),m("Unknown file format")}async parse(){let{output:t,errors:e}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),e.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&e.length>0&&(t.errors=e),et(t)}async executeParsers(){let{output:t}=this;await this.fileParser.parse();let e=Object.values(this.parsers).map((async i=>{let n=await i.parse();i.assignToOutput(t,n)}));this.options.silentErrors&&(e=e.map((i=>i.catch(this.pushToErrors)))),await Promise.all(e)}async extractThumbnail(){this.setup();let{options:t,file:e}=this,i=b.get("tiff",t);var n;if(e.tiff?n={start:0,type:"tiff"}:e.jpeg&&(n=await this.fileParser.getOrFindSegment("tiff")),n===void 0)return;let r=await this.fileParser.ensureSegmentChunk(n),a=this.parsers.tiff=new i(r,t,e),o=await a.extractThumbnail();return e.close&&e.close(),o}};async function Lt(s,t){let e=new P(t);return await e.read(s),e.parse()}var be=Object.freeze({__proto__:null,parse:Lt,Exifr:P,fileParsers:V,segmentParsers:b,fileReaders:N,tagKeys:C,tagValues:$,tagRevivers:z,createDictionary:k,extendDictionary:Bt,fetchUrlAsArrayBuffer:G,readBlobAsArrayBuffer:H,chunkedProps:F,otherSegments:J,segments:W,tiffBlocks:p,segmentsAndBlocks:M,tiffExtractables:T,inheritables:Q,allFormatters:E,Options:I}),nt=class{constructor(t,e,i){d(this,"errors",[]),d(this,"ensureSegmentChunk",(async n=>{let r=n.start,a=n.size||65536;if(this.file.chunked)if(this.file.available(r,a))n.chunk=this.file.subarray(r,a);else try{n.chunk=await this.file.readChunk(r,a)}catch(o){m(`Couldn't read segment: ${JSON.stringify(n)}. ${o.message}`)}else this.file.byteLength>r+a?n.chunk=this.file.subarray(r,a):n.size===void 0?n.chunk=this.file.subarray(r):m("Segment unreachable: "+JSON.stringify(n));return n.chunk})),this.extendOptions&&this.extendOptions(t),this.options=t,this.file=e,this.parsers=i}injectSegment(t,e){this.options[t].enabled&&this.createParser(t,e)}createParser(t,e){let i=new(b.get(t))(e,this.options,this.file);return this.parsers[t]=i}createParsers(t){for(let e of t){let{type:i,chunk:n}=e,r=this.options[i];if(r&&r.enabled){let a=this.parsers[i];a&&a.append||a||this.createParser(i,n)}}}async readSegments(t){let e=t.map(this.ensureSegmentChunk);await Promise.all(e)}},v=class{static findPosition(t,e){let i=t.getUint16(e+2)+2,n=typeof this.headerLength=="function"?this.headerLength(t,e,i):this.headerLength,r=e+n,a=i-n;return{offset:e,length:i,headerLength:n,start:r,size:a,end:r+a}}static parse(t,e={}){return new this(t,new I({[this.type]:e}),t).parse()}normalizeInput(t){return t instanceof O?t:new O(t)}constructor(t,e={},i){d(this,"errors",[]),d(this,"raw",new Map),d(this,"handleError",(n=>{if(!this.options.silentErrors)throw n;this.errors.push(n.message)})),this.chunk=this.normalizeInput(t),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=e,this.localOptions=e[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(t,e){let i=z.get(e),n=$.get(e),r=C.get(e),a=this.options[e],o=a.reviveValues&&!!i,h=a.translateValues&&!!n,l=a.translateKeys&&!!r,f={};for(let[u,c]of t)o&&i.has(u)?c=i.get(u)(c):h&&n.has(u)&&(c=this.translateValue(c,n.get(u))),l&&r.has(u)&&(u=r.get(u)||u),f[u]=c;return f}translateValue(t,e){return e[t]||e.DEFAULT||t}assignToOutput(t,e){this.assignObjectToOutput(t,this.constructor.type,e)}assignObjectToOutput(t,e,i){if(this.globalOptions.mergeOutput)return Object.assign(t,i);t[e]?Object.assign(t[e],i):t[e]=i}};d(v,"headerLength",4),d(v,"type",void 0),d(v,"multiSegment",!1),d(v,"canHandle",(()=>!1));function we(s){return s===192||s===194||s===196||s===219||s===221||s===218||s===254}function Se(s){return s>=224&&s<=239}function ke(s,t,e){for(let[i,n]of b)if(n.canHandle(s,t,e))return i}var rt=class extends nt{constructor(...t){super(...t),d(this,"appSegments",[]),d(this,"jpegSegments",[]),d(this,"unknownSegments",[])}static canHandle(t,e){return e===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(t){t===!0?(this.findAll=!0,this.wanted=new Set(b.keyList())):(t=t===void 0?b.keyList().filter((e=>this.options[e].enabled)):t.filter((e=>this.options[e].enabled&&b.has(e))),this.findAll=!1,this.remaining=new Set(t),this.wanted=new Set(t)),this.unfinishedMultiSegment=!1}async findAppSegments(t=0,e){this.setupSegmentFinderArgs(e);let{file:i,findAll:n,wanted:r,remaining:a}=this;if(!n&&this.file.chunked&&(n=Array.from(r).some((o=>{let h=b.get(o),l=this.options[o];return h.multiSegment&&l.multiSegment})),n&&await this.file.readWhole()),t=this.findAppSegmentsInRange(t,i.byteLength),!this.options.onlyTiff&&i.chunked){let o=!1;for(;a.size>0&&!o&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:h}=i,l=this.appSegments.some((f=>!this.file.available(f.offset||f.start,f.length||f.size)));if(o=t>h&&!l?!await i.readNextChunk(t):!await i.readNextChunk(h),(t=this.findAppSegmentsInRange(t,i.byteLength))===void 0)return}}}findAppSegmentsInRange(t,e){e-=2;let i,n,r,a,o,h,{file:l,findAll:f,wanted:u,remaining:c,options:g}=this;for(;t<e;t++)if(l.getUint8(t)===255){if(i=l.getUint8(t+1),Se(i)){if(n=l.getUint16(t+2),r=ke(l,t,n),r&&u.has(r)&&(a=b.get(r),o=a.findPosition(l,t),h=g[r],o.type=r,this.appSegments.push(o),!f&&(a.multiSegment&&h.multiSegment?(this.unfinishedMultiSegment=o.chunkNumber<o.chunkCount,this.unfinishedMultiSegment||c.delete(r)):c.delete(r),c.size===0)))break;g.recordUnknownSegments&&(o=v.findPosition(l,t),o.marker=i,this.unknownSegments.push(o)),t+=n+1}else if(we(i)){if(n=l.getUint16(t+2),i===218&&g.stopAfterSos!==!1)return;g.recordJpegSegments&&this.jpegSegments.push({offset:t,length:n,marker:i}),t+=n+1}}return t}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let t=(function(e,i){let n,r,a,o=new Map;for(let h=0;h<e.length;h++)n=e[h],r=n[i],o.has(r)?a=o.get(r):o.set(r,a=[]),a.push(n);return Array.from(o)})(this.appSegments,"type");this.mergedAppSegments=t.map((([e,i])=>{let n=b.get(e,this.options);return n.handleMultiSegments?{type:e,chunk:n.handleMultiSegments(i)}:i[0]}))}getSegment(t){return this.appSegments.find((e=>e.type===t))}async getOrFindSegment(t){let e=this.getSegment(t);return e===void 0&&(await this.findAppSegments(0,[t]),e=this.getSegment(t)),e}};d(rt,"type","jpeg"),V.set("jpeg",rt);var xe=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],xt=class extends v{parseHeader(){var t=this.chunk.getUint16();t===18761?this.le=!0:t===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(t,e,i=new Map){let{pick:n,skip:r}=this.options[e];n=new Set(n);let a=n.size>0,o=r.size===0,h=this.chunk.getUint16(t);t+=2;for(let l=0;l<h;l++){let f=this.chunk.getUint16(t);if(a){if(n.has(f)&&(i.set(f,this.parseTag(t,f,e)),n.delete(f),n.size===0))break}else!o&&r.has(f)||i.set(f,this.parseTag(t,f,e));t+=12}return i}parseTag(t,e,i){let{chunk:n}=this,r=n.getUint16(t+2),a=n.getUint32(t+4),o=xe[r];if(o*a<=4?t+=8:t=n.getUint32(t+8),(r<1||r>13)&&m(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${e.toString(16)}, type: ${r}, offset ${t}`),t>n.byteLength&&m(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${e.toString(16)}, type: ${r}, offset ${t} is outside of chunk size ${n.byteLength}`),r===1)return n.getUint8Array(t,a);if(r===2)return qt(n.getString(t,a));if(r===7)return n.getUint8Array(t,a);if(a===1)return this.parseTagValue(r,t);{let h=new((function(f){switch(f){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}})(r))(a),l=o;for(let f=0;f<a;f++)h[f]=this.parseTagValue(r,t),t+=l;return h}}parseTagValue(t,e){let{chunk:i}=this;switch(t){case 1:return i.getUint8(e);case 3:return i.getUint16(e);case 4:return i.getUint32(e);case 5:return i.getUint32(e)/i.getUint32(e+4);case 6:return i.getInt8(e);case 8:return i.getInt16(e);case 9:return i.getInt32(e);case 10:return i.getInt32(e)/i.getInt32(e+4);case 11:return i.getFloat(e);case 12:return i.getDouble(e);case 13:return i.getUint32(e);default:m(`Invalid tiff type ${t}`)}}},X=class extends xt{static canHandle(t,e){return t.getUint8(e+1)===225&&t.getUint32(e+4)===1165519206&&t.getUint16(e+8)===0}async parse(){this.parseHeader();let{options:t}=this;return t.ifd0.enabled&&await this.parseIfd0Block(),t.exif.enabled&&await this.safeParse("parseExifBlock"),t.gps.enabled&&await this.safeParse("parseGpsBlock"),t.interop.enabled&&await this.safeParse("parseInteropBlock"),t.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(t){let e=this[t]();return e.catch!==void 0&&(e=e.catch(this.handleError)),e}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let t=this.chunk.getUint16(this.ifd0Offset),e=this.ifd0Offset+2+12*t;this.ifd1Offset=this.chunk.getUint32(e)}}parseBlock(t,e){let i=new Map;return this[e]=i,this.parseTags(t,e,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:t}=this;this.findIfd0Offset(),this.ifd0Offset<8&&m("Malformed EXIF data"),!t.chunked&&this.ifd0Offset>t.byteLength&&m(`IFD0 offset points to outside of file.
2
+ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${t.byteLength}`),t.tiff&&await t.ensureChunk(this.ifd0Offset,Vt(this.options));let e=this.parseBlock(this.ifd0Offset,"ifd0");return e.size!==0?(this.exifOffset=e.get(34665),this.interopOffset=e.get(40965),this.gpsOffset=e.get(34853),this.xmp=e.get(700),this.iptc=e.get(33723),this.icc=e.get(34675),this.options.sanitize&&(e.delete(34665),e.delete(40965),e.delete(34853),e.delete(700),e.delete(33723),e.delete(34675)),e):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Vt(this.options));let t=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=t.get(40965)),this.makerNote=t.get(37500),this.userComment=t.get(37510),this.options.sanitize&&(t.delete(40965),t.delete(37500),t.delete(37510)),this.unpack(t,41728),this.unpack(t,41729),t}unpack(t,e){let i=t.get(e);i&&i.length===1&&t.set(e,i[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let t=this.parseBlock(this.gpsOffset,"gps");return t&&t.has(2)&&t.has(4)&&(t.set("latitude",Ht(...t.get(2),t.get(1))),t.set("longitude",Ht(...t.get(4),t.get(3)))),t}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(t=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||t))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let t=this.ifd1.get(513),e=this.ifd1.get(514);return this.chunk.getUint8Array(t,e)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let t,e,i,n={};for(e of p)if(t=this[e],!Yt(t))if(i=this.canTranslate?this.translateBlock(t,e):Object.fromEntries(t),this.options.mergeOutput){if(e==="ifd1")continue;Object.assign(n,i)}else n[e]=i;return this.makerNote&&(n.makerNote=this.makerNote),this.userComment&&(n.userComment=this.userComment),n}assignToOutput(t,e){if(this.globalOptions.mergeOutput)Object.assign(t,e);else for(let[i,n]of Object.entries(e))this.assignObjectToOutput(t,i,n)}};function Ht(s,t,e,i){var n=s+t/60+e/3600;return i!=="S"&&i!=="W"||(n*=-1),n}d(X,"type","tiff"),d(X,"headerLength",10),b.set("tiff",X);var ve=Object.freeze({__proto__:null,default:be,Exifr:P,fileParsers:V,segmentParsers:b,fileReaders:N,tagKeys:C,tagValues:$,tagRevivers:z,createDictionary:k,extendDictionary:Bt,fetchUrlAsArrayBuffer:G,readBlobAsArrayBuffer:H,chunkedProps:F,otherSegments:J,segments:W,tiffBlocks:p,segmentsAndBlocks:M,tiffExtractables:T,inheritables:Q,allFormatters:E,Options:I,parse:Lt}),Dt={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},Qt=Object.assign({},Dt,{firstChunkSize:4e4,gps:[1,2,3,4]});async function Ce(s){let t=new P(Qt);await t.read(s);let e=await t.parse();if(e&&e.gps){let{latitude:i,longitude:n}=e.gps;return{latitude:i,longitude:n}}}var te=Object.assign({},Dt,{tiff:!1,ifd1:!0,mergeOutput:!1});async function Oe(s){let t=new P(te);await t.read(s);let e=await t.extractThumbnail();return e&&Ut?It.from(e):e}async function Pe(s){let t=await this.thumbnail(s);if(t!==void 0){let e=new Blob([t]);return URL.createObjectURL(e)}}var ee=Object.assign({},Dt,{firstChunkSize:4e4,ifd0:[274]});async function ie(s){let t=new P(ee);await t.read(s);let e=await t.parse();if(e&&e.ifd0)return e.ifd0[274]}var se=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}}),R=!0,j=!0;if(typeof navigator=="object"){let s=navigator.userAgent;if(s.includes("iPad")||s.includes("iPhone")){let t=s.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t;R=Number(e)+.1*Number(i)<13.4,j=!1}}else if(s.includes("OS X 10")){let[,t]=s.match(/OS X 10[_.](\d+)/);R=j=Number(t)<15}if(s.includes("Chrome/")){let[,t]=s.match(/Chrome\/(\d+)/);R=j=Number(t)<81}else if(s.includes("Firefox/")){let[,t]=s.match(/Firefox\/(\d+)/);R=j=Number(t)<77}}async function Ae(s){let t=await ie(s);return Object.assign({canvas:R,css:j},se[t])}var vt=class extends O{constructor(...t){super(...t),d(this,"ranges",new Ct),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(t,e,i){if(t===0&&this.byteLength===0&&i){let n=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(n)}else{let n=t+e;if(n>this.byteLength){let{dataView:r}=this._extend(n);this._swapDataView(r)}}}_extend(t){let e;e=Ut?It.allocUnsafe(t):new Uint8Array(t);let i=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:e,dataView:i}}subarray(t,e,i=!1){return e=e||this._lengthToEnd(t),i&&this._tryExtend(t,e),this.ranges.add(t,e),super.subarray(t,e)}set(t,e,i=!1){i&&this._tryExtend(e,t.byteLength,t);let n=super.set(t,e);return this.ranges.add(e,n.byteLength),n}async ensureChunk(t,e){this.chunked&&(this.ranges.available(t,e)||await this.readChunk(t,e))}available(t,e){return this.ranges.available(t,e)}},Ct=class{constructor(){d(this,"list",[])}get length(){return this.list.length}add(t,e,i=0){let n=t+e,r=this.list.filter((a=>Wt(t,a.offset,n)||Wt(t,a.end,n)));if(r.length>0){t=Math.min(t,...r.map((o=>o.offset))),n=Math.max(n,...r.map((o=>o.end))),e=n-t;let a=r.shift();a.offset=t,a.length=e,a.end=n,this.list=this.list.filter((o=>!r.includes(o)))}else this.list.push({offset:t,length:e,end:n})}available(t,e){let i=t+e;return this.list.some((n=>n.offset<=t&&i<=n.end))}};function Wt(s,t,e){return s<=t&&t<=e}var at=class extends vt{constructor(t,e){super(0),d(this,"chunksRead",0),this.input=t,this.options=e}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(t=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let e=this.options.chunkSize,i=await this.readChunk(t,e);return!!i&&i.byteLength===e}async readChunk(t,e){if(this.chunksRead++,(e=this.safeWrapAddress(t,e))!==0)return this._readChunk(t,e)}safeWrapAddress(t,e){return this.size!==void 0&&t+e>this.size?Math.max(0,this.size-t):e}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};N.set("blob",class extends at{async readWhole(){this.chunked=!1;let s=await H(this.input);this._swapArrayBuffer(s)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(s,t){let e=t?s+t:void 0,i=this.input.slice(s,e),n=await H(i);return this.set(n,s,!0)}});var Ie=Object.freeze({__proto__:null,default:ve,Exifr:P,fileParsers:V,segmentParsers:b,fileReaders:N,tagKeys:C,tagValues:$,tagRevivers:z,createDictionary:k,extendDictionary:Bt,fetchUrlAsArrayBuffer:G,readBlobAsArrayBuffer:H,chunkedProps:F,otherSegments:J,segments:W,tiffBlocks:p,segmentsAndBlocks:M,tiffExtractables:T,inheritables:Q,allFormatters:E,Options:I,parse:Lt,gpsOnlyOptions:Qt,gps:Ce,thumbnailOnlyOptions:te,thumbnail:Oe,thumbnailUrl:Pe,orientationOnlyOptions:ee,orientation:ie,rotations:se,get rotateCanvas(){return R},get rotateCss(){return j},rotation:Ae});N.set("url",class extends at{async readWhole(){this.chunked=!1;let s=await G(this.input);s instanceof ArrayBuffer?this._swapArrayBuffer(s):s instanceof Uint8Array&&this._swapBuffer(s)}async _readChunk(s,t){let e=t?s+t-1:void 0,i=this.options.httpHeaders||{};(s||e)&&(i.range=`bytes=${[s,e].join("-")}`);let n=await Jt(this.input,{headers:i}),r=await n.arrayBuffer(),a=r.byteLength;if(n.status!==416)return a!==t&&(this.size=s+a),this.set(r,s,!0)}});O.prototype.getUint64=function(s){let t=this.getUint32(s),e=this.getUint32(s+4);return t<1048575?t<<32|e:typeof tt!==void 0?(console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."),tt(t)<<tt(32)|tt(e)):void m("Trying to read 64b value but JS can only handle 53b numbers.")};var Ot=class extends nt{parseBoxes(t=0){let e=[];for(;t<this.file.byteLength-4;){let i=this.parseBoxHead(t);if(e.push(i),i.length===0)break;t+=i.length}return e}parseSubBoxes(t){t.boxes=this.parseBoxes(t.start)}findBox(t,e){return t.boxes===void 0&&this.parseSubBoxes(t),t.boxes.find((i=>i.kind===e))}parseBoxHead(t){let e=this.file.getUint32(t),i=this.file.getString(t+4,4),n=t+8;return e===1&&(e=this.file.getUint64(t+8),n+=8),{offset:t,length:e,kind:i,start:n}}parseBoxFullHead(t){if(t.version!==void 0)return;let e=this.file.getUint32(t.start);t.version=e>>24,t.start+=4}},ot=class extends Ot{static canHandle(t,e){if(e!==0)return!1;let i=t.getUint16(2);if(i>50)return!1;let n=16,r=[];for(;n<i;)r.push(t.getString(n,4)),n+=4;return r.includes(this.type)}async parse(){let t=this.file.getUint32(0),e=this.parseBoxHead(t);for(;e.kind!=="meta";)t+=e.length,await this.file.ensureChunk(t,16),e=this.parseBoxHead(t);await this.file.ensureChunk(e.offset,e.length),this.parseBoxFullHead(e),this.parseSubBoxes(e),this.options.icc.enabled&&await this.findIcc(e),this.options.tiff.enabled&&await this.findExif(e)}async registerSegment(t,e,i){await this.file.ensureChunk(e,i);let n=this.file.subarray(e,i);this.createParser(t,n)}async findIcc(t){let e=this.findBox(t,"iprp");if(e===void 0)return;let i=this.findBox(e,"ipco");if(i===void 0)return;let n=this.findBox(i,"colr");n!==void 0&&await this.registerSegment("icc",n.offset+12,n.length)}async findExif(t){let e=this.findBox(t,"iinf");if(e===void 0)return;let i=this.findBox(t,"iloc");if(i===void 0)return;let n=this.findExifLocIdInIinf(e),r=this.findExtentInIloc(i,n);if(r===void 0)return;let[a,o]=r;await this.file.ensureChunk(a,o);let h=4+this.file.getUint32(a);a+=h,o-=h,await this.registerSegment("tiff",a,o)}findExifLocIdInIinf(t){this.parseBoxFullHead(t);let e,i,n,r,a=t.start,o=this.file.getUint16(a);for(a+=2;o--;){if(e=this.parseBoxHead(a),this.parseBoxFullHead(e),i=e.start,e.version>=2&&(n=e.version===3?4:2,r=this.file.getString(i+n+2,4),r==="Exif"))return this.file.getUintBytes(i,n);a+=e.length}}get8bits(t){let e=this.file.getUint8(t);return[e>>4,15&e]}findExtentInIloc(t,e){this.parseBoxFullHead(t);let i=t.start,[n,r]=this.get8bits(i++),[a,o]=this.get8bits(i++),h=t.version===2?4:2,l=t.version===1||t.version===2?2:0,f=o+n+r,u=t.version===2?4:2,c=this.file.getUintBytes(i,u);for(i+=u;c--;){let g=this.file.getUintBytes(i,h);i+=h+l+2+a;let S=this.file.getUint16(i);if(i+=2,g===e)return S>1&&console.warn(`ILOC box has more than one extent but we're only processing one
3
+ Please create an issue at https://github.com/MikeKovarik/exifr with this file`),[this.file.getUintBytes(i+o,n),this.file.getUintBytes(i+o+n,r)];i+=S*f}}},ht=class extends ot{};d(ht,"type","heic");var lt=class extends ot{};d(lt,"type","avif"),V.set("heic",ht),V.set("avif",lt),k(C,["ifd0","ifd1"],[[256,"ImageWidth"],[257,"ImageHeight"],[258,"BitsPerSample"],[259,"Compression"],[262,"PhotometricInterpretation"],[270,"ImageDescription"],[271,"Make"],[272,"Model"],[273,"StripOffsets"],[274,"Orientation"],[277,"SamplesPerPixel"],[278,"RowsPerStrip"],[279,"StripByteCounts"],[282,"XResolution"],[283,"YResolution"],[284,"PlanarConfiguration"],[296,"ResolutionUnit"],[301,"TransferFunction"],[305,"Software"],[306,"ModifyDate"],[315,"Artist"],[316,"HostComputer"],[317,"Predictor"],[318,"WhitePoint"],[319,"PrimaryChromaticities"],[513,"ThumbnailOffset"],[514,"ThumbnailLength"],[529,"YCbCrCoefficients"],[530,"YCbCrSubSampling"],[531,"YCbCrPositioning"],[532,"ReferenceBlackWhite"],[700,"ApplicationNotes"],[33432,"Copyright"],[33723,"IPTC"],[34665,"ExifIFD"],[34675,"ICC"],[34853,"GpsIFD"],[330,"SubIFD"],[40965,"InteropIFD"],[40091,"XPTitle"],[40092,"XPComment"],[40093,"XPAuthor"],[40094,"XPKeywords"],[40095,"XPSubject"]]),k(C,"exif",[[33434,"ExposureTime"],[33437,"FNumber"],[34850,"ExposureProgram"],[34852,"SpectralSensitivity"],[34855,"ISO"],[34858,"TimeZoneOffset"],[34859,"SelfTimerMode"],[34864,"SensitivityType"],[34865,"StandardOutputSensitivity"],[34866,"RecommendedExposureIndex"],[34867,"ISOSpeed"],[34868,"ISOSpeedLatitudeyyy"],[34869,"ISOSpeedLatitudezzz"],[36864,"ExifVersion"],[36867,"DateTimeOriginal"],[36868,"CreateDate"],[36873,"GooglePlusUploadCode"],[36880,"OffsetTime"],[36881,"OffsetTimeOriginal"],[36882,"OffsetTimeDigitized"],[37121,"ComponentsConfiguration"],[37122,"CompressedBitsPerPixel"],[37377,"ShutterSpeedValue"],[37378,"ApertureValue"],[37379,"BrightnessValue"],[37380,"ExposureCompensation"],[37381,"MaxApertureValue"],[37382,"SubjectDistance"],[37383,"MeteringMode"],[37384,"LightSource"],[37385,"Flash"],[37386,"FocalLength"],[37393,"ImageNumber"],[37394,"SecurityClassification"],[37395,"ImageHistory"],[37396,"SubjectArea"],[37500,"MakerNote"],[37510,"UserComment"],[37520,"SubSecTime"],[37521,"SubSecTimeOriginal"],[37522,"SubSecTimeDigitized"],[37888,"AmbientTemperature"],[37889,"Humidity"],[37890,"Pressure"],[37891,"WaterDepth"],[37892,"Acceleration"],[37893,"CameraElevationAngle"],[40960,"FlashpixVersion"],[40961,"ColorSpace"],[40962,"ExifImageWidth"],[40963,"ExifImageHeight"],[40964,"RelatedSoundFile"],[41483,"FlashEnergy"],[41486,"FocalPlaneXResolution"],[41487,"FocalPlaneYResolution"],[41488,"FocalPlaneResolutionUnit"],[41492,"SubjectLocation"],[41493,"ExposureIndex"],[41495,"SensingMethod"],[41728,"FileSource"],[41729,"SceneType"],[41730,"CFAPattern"],[41985,"CustomRendered"],[41986,"ExposureMode"],[41987,"WhiteBalance"],[41988,"DigitalZoomRatio"],[41989,"FocalLengthIn35mmFormat"],[41990,"SceneCaptureType"],[41991,"GainControl"],[41992,"Contrast"],[41993,"Saturation"],[41994,"Sharpness"],[41996,"SubjectDistanceRange"],[42016,"ImageUniqueID"],[42032,"OwnerName"],[42033,"SerialNumber"],[42034,"LensInfo"],[42035,"LensMake"],[42036,"LensModel"],[42037,"LensSerialNumber"],[42080,"CompositeImage"],[42081,"CompositeImageCount"],[42082,"CompositeImageExposureTimes"],[42240,"Gamma"],[59932,"Padding"],[59933,"OffsetSchema"],[65e3,"OwnerName"],[65001,"SerialNumber"],[65002,"Lens"],[65100,"RawFile"],[65101,"Converter"],[65102,"WhiteBalance"],[65105,"Exposure"],[65106,"Shadows"],[65107,"Brightness"],[65108,"Contrast"],[65109,"Saturation"],[65110,"Sharpness"],[65111,"Smoothness"],[65112,"MoireFilter"],[40965,"InteropIFD"]]),k(C,"gps",[[0,"GPSVersionID"],[1,"GPSLatitudeRef"],[2,"GPSLatitude"],[3,"GPSLongitudeRef"],[4,"GPSLongitude"],[5,"GPSAltitudeRef"],[6,"GPSAltitude"],[7,"GPSTimeStamp"],[8,"GPSSatellites"],[9,"GPSStatus"],[10,"GPSMeasureMode"],[11,"GPSDOP"],[12,"GPSSpeedRef"],[13,"GPSSpeed"],[14,"GPSTrackRef"],[15,"GPSTrack"],[16,"GPSImgDirectionRef"],[17,"GPSImgDirection"],[18,"GPSMapDatum"],[19,"GPSDestLatitudeRef"],[20,"GPSDestLatitude"],[21,"GPSDestLongitudeRef"],[22,"GPSDestLongitude"],[23,"GPSDestBearingRef"],[24,"GPSDestBearing"],[25,"GPSDestDistanceRef"],[26,"GPSDestDistance"],[27,"GPSProcessingMethod"],[28,"GPSAreaInformation"],[29,"GPSDateStamp"],[30,"GPSDifferential"],[31,"GPSHPositioningError"]]),k($,["ifd0","ifd1"],[[274,{1:"Horizontal (normal)",2:"Mirror horizontal",3:"Rotate 180",4:"Mirror vertical",5:"Mirror horizontal and rotate 270 CW",6:"Rotate 90 CW",7:"Mirror horizontal and rotate 90 CW",8:"Rotate 270 CW"}],[296,{1:"None",2:"inches",3:"cm"}]]);var K=k($,"exif",[[34850,{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"}],[37121,{0:"-",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}],[37383,{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"}],[37384,{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"}],[37385,{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"}],[41495,{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"}],[41728,{1:"Film Scanner",2:"Reflection Print Scanner",3:"Digital Camera"}],[41729,{1:"Directly photographed"}],[41985,{0:"Normal",1:"Custom",2:"HDR (no original saved)",3:"HDR (original saved)",4:"Original (for HDR)",6:"Panorama",7:"Portrait HDR",8:"Portrait"}],[41986,{0:"Auto",1:"Manual",2:"Auto bracket"}],[41987,{0:"Auto",1:"Manual"}],[41990,{0:"Standard",1:"Landscape",2:"Portrait",3:"Night",4:"Other"}],[41991,{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"}],[41996,{0:"Unknown",1:"Macro",2:"Close",3:"Distant"}],[42080,{0:"Unknown",1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}]]),$t={1:"No absolute unit of measurement",2:"Inch",3:"Centimeter"};K.set(37392,$t),K.set(41488,$t);var pt={0:"Normal",1:"Low",2:"High"};function _t(s){return typeof s=="object"&&s.length!==void 0?s[0]:s}function Xt(s){let t=Array.from(s).slice(1);return t[1]>15&&(t=t.map((e=>String.fromCharCode(e)))),t[2]!=="0"&&t[2]!==0||t.pop(),t.join(".")}function mt(s){if(typeof s=="string"){var[t,e,i,n,r,a]=s.trim().split(/[-: ]/g).map(Number),o=new Date(t,e-1,i);return Number.isNaN(n)||Number.isNaN(r)||Number.isNaN(a)||(o.setHours(n),o.setMinutes(r),o.setSeconds(a)),Number.isNaN(+o)?s:o}}function _(s){if(typeof s=="string")return s;let t=[];if(s[1]===0&&s[s.length-1]===0)for(let e=0;e<s.length;e+=2)t.push(Kt(s[e+1],s[e]));else for(let e=0;e<s.length;e+=2)t.push(Kt(s[e],s[e+1]));return qt(String.fromCodePoint(...t))}function Kt(s,t){return s<<8|t}K.set(41992,pt),K.set(41993,pt),K.set(41994,pt),k(z,["ifd0","ifd1"],[[50827,function(s){return typeof s!="string"?Zt(s):s}],[306,mt],[40091,_],[40092,_],[40093,_],[40094,_],[40095,_]]),k(z,"exif",[[40960,Xt],[36864,Xt],[36867,mt],[36868,mt],[40962,_t],[40963,_t]]),k(z,"gps",[[0,s=>Array.from(s).join(".")],[7,s=>Array.from(s).join(":")]]);var Y=class extends v{static canHandle(t,e){return t.getUint8(e+1)===225&&t.getUint32(e+4)===1752462448&&t.getString(e+4,20)==="http://ns.adobe.com/"}static headerLength(t,e){return t.getString(e+4,34)==="http://ns.adobe.com/xmp/extension/"?79:33}static findPosition(t,e){let i=super.findPosition(t,e);return i.multiSegment=i.extended=i.headerLength===79,i.multiSegment?(i.chunkCount=t.getUint8(e+72),i.chunkNumber=t.getUint8(e+76),t.getUint8(e+77)!==0&&i.chunkNumber++):(i.chunkCount=1/0,i.chunkNumber=-1),i}static handleMultiSegments(t){return t.map((e=>e.chunk.getString())).join("")}normalizeInput(t){return typeof t=="string"?t:O.from(t).getString()}parse(t=this.chunk){if(!this.localOptions.parse)return t;t=(function(r){let a={},o={};for(let h of oe)a[h]=[],o[h]=0;return r.replace(De,((h,l,f)=>{if(l==="<"){let u=++o[f];return a[f].push(u),`${h}#${u}`}return`${h}#${a[f].pop()}`}))})(t);let e=ft.findAll(t,"rdf","Description");e.length===0&&e.push(new ft("rdf","Description",void 0,t));let i,n={};for(let r of e)for(let a of r.properties)i=Le(a.ns,n),ne(a,i);return(function(r){let a;for(let o in r)a=r[o]=et(r[o]),a===void 0&&delete r[o];return et(r)})(n)}assignToOutput(t,e){if(this.localOptions.parse)for(let[i,n]of Object.entries(e))switch(i){case"tiff":this.assignObjectToOutput(t,"ifd0",n);break;case"exif":this.assignObjectToOutput(t,"exif",n);break;case"xmlns":break;default:this.assignObjectToOutput(t,i,n)}else t.xmp=e}};d(Y,"type","xmp"),d(Y,"multiSegment",!0),b.set("xmp",Y);var Pt=class s{static findAll(t){return re(t,/([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(s.unpackMatch)}static unpackMatch(t){let e=t[1],i=t[2],n=t[3].slice(1,-1);return n=ae(n),new s(e,i,n)}constructor(t,e,i){this.ns=t,this.name=e,this.value=i}serialize(){return this.value}},ft=class s{static findAll(t,e,i){if(e!==void 0||i!==void 0){e=e||"[\\w\\d-]+",i=i||"[\\w\\d-]+";var n=new RegExp(`<(${e}):(${i})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`,"gm")}else n=/<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;return re(t,n).map(s.unpackMatch)}static unpackMatch(t){let e=t[1],i=t[2],n=t[4],r=t[8];return new s(e,i,n,r)}constructor(t,e,i,n){this.ns=t,this.name=e,this.attrString=i,this.innerXml=n,this.attrs=Pt.findAll(i),this.children=s.findAll(n),this.value=this.children.length===0?ae(n):void 0,this.properties=[...this.attrs,...this.children]}get isPrimitive(){return this.value!==void 0&&this.attrs.length===0&&this.children.length===0}get isListContainer(){return this.children.length===1&&this.children[0].isList}get isList(){let{ns:t,name:e}=this;return t==="rdf"&&(e==="Seq"||e==="Bag"||e==="Alt")}get isListItem(){return this.ns==="rdf"&&this.name==="li"}serialize(){if(this.properties.length===0&&this.value===void 0)return;if(this.isPrimitive)return this.value;if(this.isListContainer)return this.children[0].serialize();if(this.isList)return Be(this.children.map(Ue));if(this.isListItem&&this.children.length===1&&this.attrs.length===0)return this.children[0].serialize();let t={};for(let e of this.properties)ne(e,t);return this.value!==void 0&&(t.value=this.value),et(t)}};function ne(s,t){let e=s.serialize();e!==void 0&&(t[s.name]=e)}var Ue=s=>s.serialize(),Be=s=>s.length===1?s[0]:s,Le=(s,t)=>t[s]?t[s]:t[s]={};function re(s,t){let e,i=[];if(!s)return i;for(;(e=t.exec(s))!==null;)i.push(e);return i}function ae(s){if((function(i){return i==null||i==="null"||i==="undefined"||i===""||i.trim()===""})(s))return;let t=Number(s);if(!Number.isNaN(t))return t;let e=s.toLowerCase();return e==="true"||e!=="false"&&s.trim()}var oe=["rdf:li","rdf:Seq","rdf:Bag","rdf:Alt","rdf:Description"],De=new RegExp(`(<|\\/)(${oe.join("|")})`,"g"),he=Ie;async function Ne(s){try{return await he.parse(s)||null}catch{return null}}function Re(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),s=>s.toString(16).padStart(2,"0")).join("")}async function je(s){if(typeof createImageBitmap>"u"||typeof document>"u"){if(s&&typeof s.arrayBuffer=="function"){let o=await s.arrayBuffer(),h=globalThis.Buffer,l=typeof h<"u"?h.from(o).toString("base64"):btoa(String.fromCharCode(...new Uint8Array(o)));return`data:${s.type||"image/png"};base64,${l}`}if(typeof s=="string")return s}let t=await createImageBitmap(s),n=Math.min(1,1654/t.width,2339/t.height);if(n===1&&(s.type==="image/jpeg"||s.type==="image/jpg"||s.type==="image/png"||s.type==="image/webp"))return t.close(),new Promise((o,h)=>{let l=new FileReader;l.onload=()=>o(l.result),l.onerror=h,l.readAsDataURL(s)});let r=document.createElement("canvas");r.width=Math.round(t.width*n),r.height=Math.round(t.height*n),r.getContext("2d").drawImage(t,0,0,r.width,r.height),t.close();let a=s.type==="image/png"?"image/png":"image/jpeg";return r.toDataURL(a,a==="image/png"?void 0:.82)}function le(s,t=21,e=.2,i=128){let{data:n,width:r,height:a}=s,o=r+1,h=new Float64Array((r+1)*(a+1)),l=new Float64Array((r+1)*(a+1)),f=new Uint8Array(r*a);for(let c=0;c<a;c++){let g=0,S=0,U=c*r,B=(c+1)*o,A=c*o;for(let w=0;w<r;w++){let x=(U+w)*4,L=n[x]*77+n[x+1]*150+n[x+2]*29>>8;f[U+w]=L,g+=L,S+=L*L,h[B+w+1]=h[A+w+1]+g,l[B+w+1]=l[A+w+1]+S}}let u=Math.floor(t/2);for(let c=0;c<a;c++){let g=Math.max(0,c-u),S=Math.min(a-1,c+u),U=g*o,B=(S+1)*o;for(let A=0;A<r;A++){let w=Math.max(0,A-u),x=Math.min(r-1,A+u),L=(x-w+1)*(S-g+1),ue=h[B+x+1]-h[U+x+1]-h[B+w]+h[U+w],de=l[B+x+1]-l[U+x+1]-l[B+w]+l[U+w],ut=ue/L,ce=Math.max(0,de/L-ut*ut),ge=Math.sqrt(ce),pe=ut*(1+e*(ge/i-1)),Tt=c*r+A,dt=f[Tt]<pe?0:255,ct=Tt*4;n[ct]=dt,n[ct+1]=dt,n[ct+2]=dt}}return s}function Ge(s,t=21,e=.2,i=128){return new Promise(n=>{let r=new Image;r.onload=()=>{let a=document.createElement("canvas");a.width=r.width,a.height=r.height;let o=a.getContext("2d");o.drawImage(r,0,0);let h=o.getImageData(0,0,a.width,a.height);le(h,t,e,i),o.putImageData(h,0,0);let l=s.startsWith("data:image/png"),f=l?"image/png":"image/jpeg";n(a.toDataURL(f,l?void 0:.82))},r.src=s})}function He(s){return new Promise(t=>{let e=new Image;e.onload=()=>{let i=document.createElement("canvas");i.width=e.height,i.height=e.width;let n=i.getContext("2d");n.translate(i.width/2,i.height/2),n.rotate(Math.PI/2),n.drawImage(e,-e.width/2,-e.height/2);let r=s.startsWith("data:image/png"),a=r?"image/png":"image/jpeg";t(i.toDataURL(a,r?void 0:.82))},e.src=s})}function We(s,t=""){if(!s)return"";let e=s.getCroppedCanvas(),i=t.startsWith("data:image/png"),n=i?"image/png":"image/jpeg";return e.toDataURL(n,i?void 0:.82)}function Ft(s){if(!s||typeof s!="object")return{crop:null,rotation:0,filter:"none"};let t=s.crop&&typeof s.crop=="object"&&s.crop.width>0&&s.crop.height>0?{x:Math.round(s.crop.x||0),y:Math.round(s.crop.y||0),width:Math.round(s.crop.width),height:Math.round(s.crop.height)}:null,e=(Math.round(s.rotation||0)%360+360)%360,i=s.filter==="bw"?"bw":"none";return{crop:t,rotation:e,filter:i}}function Fe(s){if(!s)return!1;let t=Ft(s);return!!(t.crop||t.rotation!==0||t.filter!=="none")}function Mt(s,t){let e=Ft(t),i=s.naturalWidth||s.width||0,n=s.naturalHeight||s.height||0,r=document.createElement("canvas"),a=i,o=n,h=0,l=0;e.crop&&(h=Math.max(0,Math.min(e.crop.x,i)),l=Math.max(0,Math.min(e.crop.y,n)),a=Math.max(1,Math.min(e.crop.width,i-h)),o=Math.max(1,Math.min(e.crop.height,n-l))),r.width=a,r.height=o,r.getContext("2d").drawImage(s,h,l,a,o,0,0,a,o);let u=r;if(e.rotation!==0){let c=e.rotation,g=document.createElement("canvas");c===90||c===270?(g.width=u.height,g.height=u.width):(g.width=u.width,g.height=u.height);let S=g.getContext("2d");S.translate(g.width/2,g.height/2),S.rotate(c*Math.PI/180),S.drawImage(u,-u.width/2,-u.height/2),u=g}if(e.filter==="bw"){let c=u.getContext("2d"),g=c.getImageData(0,0,u.width,u.height);le(g),c.putImageData(g,0,0)}return u}function $e(s,t){if(!s)return Promise.resolve("");let e=Ft(t);return Fe(e)?new Promise((i,n)=>{let r=new Image;r.onload=()=>{try{let a=s.startsWith("data:image/png"),o=a?"image/png":"image/jpeg",h=Mt(r,e);i(h.toDataURL(o,a?void 0:.82))}catch(a){n(a)}},r.onerror=n,r.src=s}):Promise.resolve(s)}function Me(s){return new Promise((t,e)=>{let i=new Image;i.onload=()=>t(i),i.onerror=e,i.src=s})}var fe=class extends Et{async renderEdits(t,e={}){if(!t)return"";if(typeof document>"u")return t;try{let i=await Me(t),n={...e};return e?.crop&&"w"in e.crop&&(n.crop={x:Math.round((e.crop.x||0)*i.naturalWidth),y:Math.round((e.crop.y||0)*i.naturalHeight),width:Math.round((e.crop.w||1)*i.naturalWidth),height:Math.round((e.crop.h||1)*i.naturalHeight)}),e?.rotate!==void 0&&(n.rotation=e.rotate),Mt(i,n).toDataURL("image/jpeg",.92)}catch{return t}}async crop(t,e){return this.renderEdits(t,{crop:e})}async rotate(t,e){return this.renderEdits(t,{rotate:e})}async applyFilter(t,e){return this.renderEdits(t,{filter:e})}};export{Ne as a,Re as b,je as c,le as d,Ge as e,He as f,We as g,Ft as h,Fe as i,Mt as j,$e as k,fe as l};
4
+ //# sourceMappingURL=chunk-N7Q34F2P.js.map
@@ -0,0 +1,2 @@
1
+ import{a as c}from"./chunk-LI54F6PA.js";var a=class extends c{#e=new Map;#s=new Map;#i=new Set;constructor(){super()}async init(){return{kind:"memory",persistent:!1}}listDocsSync(){return Array.from(this.#e.values()).map(e=>({id:e.id,name:e.name,pages:Array.isArray(e.pages)?[...e.pages]:[]}))}async listDocs(){return this.listDocsSync()}getDocSync(e){let s=this.#e.get(e);return s?{id:s.id,name:s.name,pages:Array.isArray(s.pages)?[...s.pages]:[]}:null}async getDoc(e){return this.getDocSync(e)}async saveDoc(e,s){if(!e)throw new Error("Cannot save document without an ID");let t=[];if(Array.isArray(s.pages))t=[...s.pages];else if(typeof s.pages=="string")try{t=JSON.parse(s.pages)}catch{t=[]}this.#e.set(e,{id:e,name:s.name||"",pages:t}),this.#t()}async deleteDoc(e){this.#e.delete(e);let s=`${e}/`;for(let t of this.#s.keys())t.startsWith(s)&&this.#s.delete(t);this.#t()}async savePage(e,s,t){this.#s.set(`${e}/${s}`,t);let i=this.#e.get(e);if(i){let r=i.pages.findIndex(n=>n.id===s);if(r>=0)typeof t=="object"&&t!==null&&!(t instanceof Blob)?i.pages[r]={...i.pages[r],...t}:i.pages[r]={...i.pages[r],src:t};else{let n=typeof t=="object"&&t!==null&&!(t instanceof Blob)?{id:s,...t}:{id:s,src:t};i.pages.push(n)}}this.#t()}async getPage(e,s){if(this.#s.has(`${e}/${s}`))return this.#s.get(`${e}/${s}`);let t=this.#e.get(e);if(t){let i=t.pages.find(r=>r.id===s);if(i)return i.src??i}return null}async deletePage(e,s){this.#s.delete(`${e}/${s}`);let t=this.#e.get(e);t&&(t.pages=t.pages.filter(i=>i.id!==s)),this.#t()}subscribe(e){return this.#i.add(e),()=>{this.#i.delete(e)}}clear(){this.#e.clear(),this.#s.clear(),this.#t()}#t(){for(let e of this.#i)try{e()}catch(s){console.error("Error in MemoryStorageAdapter subscriber:",s)}}};export{a};
2
+ //# sourceMappingURL=chunk-OI4WCW7E.js.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-PUJYN435.js.map
@@ -0,0 +1,2 @@
1
+ import{a as s}from"./chunk-KIMVF5UG.js";import{b as o}from"./chunk-BKZEOOH4.js";var e=class extends s{#t=null;#n=null;#o=null;constructor(t=null,n=null){super(),this.#n=t,this.#o=n}async connect(t={}){let n=t.repo||this.#n,r=t.onStateChange||this.#o;return this.#t=new o(n,r),this.#t}async disconnect(){this.#t&&typeof this.#t.destroy=="function"&&(this.#t.destroy(),this.#t=null)}};export{e as a};
2
+ //# sourceMappingURL=chunk-PVNRK4OH.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-HN3336JN.js";var n=class extends t{async renderEdits(r,e){return r}async crop(r,e){return r}async rotate(r,e){return r}async applyFilter(r,e){return r}};export{n as a};
2
+ //# sourceMappingURL=chunk-SH4P4XSZ.js.map
@@ -0,0 +1,33 @@
1
+ import{b as s,c as o}from"./chunk-XEN5VKAV.js";var l=class extends o{static properties={syncState:{type:Object}};createRenderRoot(){return this}disconnectedCallback(){super.disconnectedCallback(),this.closeSyncDialog()}handleCloseClick=()=>{let e=this.querySelector("sl-dialog");e&&typeof e.hide=="function"?e.hide():this.closeSyncDialog()};closeSyncDialog=()=>{this.dispatchEvent(new CustomEvent("dialog:close",{bubbles:!0,composed:!1}))};render(){if(!this.syncState)return"";let{step:e,qrSvg:r,url:t,added:i,message:c}=this.syncState,n;return e==="init"?n=s`<sl-spinner></sl-spinner> Setting up…`:e==="waiting"?n=s`
2
+ <div .innerHTML=${r}></div>
3
+ ${t?s`
4
+ <div style="margin: 0.75rem 0; word-break: break-all;">
5
+ <a
6
+ class="sync-link"
7
+ href=${t}
8
+ target="_blank"
9
+ rel="noopener noreferrer"
10
+ style="color: var(--sl-color-primary-600, #0284c7); text-decoration: underline; font-size: 0.85rem;"
11
+ >
12
+ ${t}
13
+ </a>
14
+ </div>
15
+ `:""}
16
+ <p style="margin-top: 0.5rem; color: #6b7280; font-size: 0.9rem;">Waiting for other device…</p>
17
+ `:e==="connecting"?n=s`<sl-spinner></sl-spinner> Connecting…`:e==="syncing"?n=s`<sl-spinner></sl-spinner> Syncing…`:e==="done"?n=s`<p>
18
+ Sync complete — ${i} doc${i!==1?"s":""} added.
19
+ </p>`:e==="error"&&(n=s`<p style="color:var(--sl-color-danger-600)">
20
+ Error: ${c}
21
+ </p>`),s`
22
+ <sl-dialog
23
+ label="Link Device"
24
+ open
25
+ @sl-after-hide=${this.closeSyncDialog}
26
+ >
27
+ <div style="text-align:center;padding:1rem">${n}</div>
28
+ <sl-button slot="footer" class="sync-close-btn" @click=${this.handleCloseClick}
29
+ >Close</sl-button
30
+ >
31
+ </sl-dialog>
32
+ `}};customElements.define("copio-sync-dialog",l);export{l as a};
33
+ //# sourceMappingURL=chunk-UCV3MQ6I.js.map
@@ -0,0 +1,2 @@
1
+ var v=null,C={success:{slVariant:"success",defaultIcon:"check-circle",defaultDuration:3e3},error:{slVariant:"danger",defaultIcon:"exclamation-octagon",defaultDuration:5e3},danger:{slVariant:"danger",defaultIcon:"exclamation-octagon",defaultDuration:5e3},warning:{slVariant:"warning",defaultIcon:"exclamation-triangle",defaultDuration:4e3},info:{slVariant:"primary",defaultIcon:"info-circle",defaultDuration:4e3},primary:{slVariant:"primary",defaultIcon:"info-circle",defaultDuration:4e3},neutral:{slVariant:"neutral",defaultIcon:"info-circle",defaultDuration:4e3}};function I(n){v=n||null}function g(){return v||(typeof document<"u"?document.body:null)}function k(){let a=customElements.get("sl-alert")?.toastStack;a&&a.querySelectorAll("sl-alert").forEach(u=>{typeof u.hide=="function"&&u.hide()})}async function w(n,a={}){let e={};if(typeof n=="string"||n instanceof HTMLElement?e={message:n,...a}:n&&typeof n=="object"&&(e={...n,...a}),typeof customElements<"u"&&!customElements.get("sl-alert")&&await Promise.race([customElements.whenDefined("sl-alert"),new Promise(t=>setTimeout(t,200))]),typeof customElements>"u"||!customElements.get("sl-alert"))return null;let u=customElements.get("sl-alert"),s=e.variant||"info",f=C[s]||C.info,r=e.container||g();if(u?.toastStack&&r){let t=u.toastStack;t.parentElement!==r&&r.appendChild(t),r!==document.body?(t.style.position="absolute",t.style.width="auto",t.style.maxWidth="calc(100% - 24px)",t.style.left="12px",t.style.right="12px",t.style.insetInlineStart="12px",t.style.insetInlineEnd="12px",e.position==="top"?(t.style.top="12px",t.style.bottom="auto"):(t.style.top="auto",t.style.bottom="16px"),t.style.maxHeight="100%",t.style.overflow="auto"):(t.style.position="",t.style.width="",t.style.left="",t.style.right="",t.style.top="",t.style.bottom="",t.style.insetInlineStart="",t.style.insetInlineEnd="",t.style.maxHeight="",t.style.maxWidth="",t.style.overflow="")}let o=document.createElement("sl-alert");o.variant=f.slVariant,o.closable=e.closable!==!1,o.duration=e.duration!==void 0?e.duration:f.defaultDuration;let d=e.icon!==void 0?e.icon:f.defaultIcon;if(d){let t=document.createElement("sl-icon");t.slot="icon",t.name=d,o.appendChild(t)}let i=document.createElement("span");if(e.message instanceof HTMLElement?i.appendChild(e.message):e.html?i.innerHTML=e.message||"":i.textContent=e.message||"",e.action){let t=document.createElement("div");t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="space-between",t.style.gap="0.75rem",t.style.width="100%",i.style.flex="1",t.appendChild(i);let l=document.createElement("sl-button");l.size="small",l.variant=e.action.variant||"text",l.textContent=e.action.text||"Action",l.style.color="inherit",l.style.fontWeight="600",l.style.padding="0",l.addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),typeof e.action.onClick=="function"&&e.action.onClick(m,o),e.action.autoClose!==!1&&o.hide()}),t.appendChild(l),o.appendChild(t)}else o.appendChild(i);let y=o.toast();return o.toastPromise=y,o}function D(n,a={}){return p.show({message:n,variant:"success",...a})}function S(n,a={}){return p.show({message:n,variant:"error",...a})}function M(n,a={}){return p.show({message:n,variant:"warning",...a})}function N(n,a={}){return p.show({message:n,variant:"info",...a})}function V(n,a,e={}){return p.show({message:n,variant:e?.variant||"primary",icon:e?.icon!==void 0?e.icon:"arrow-counterclockwise",duration:e?.duration!==void 0?e.duration:5e3,closable:e?.closable!==!1,action:{text:e?.actionText||"Undo",onClick:(u,s)=>{typeof a=="function"&&a(u,s)},autoClose:!0},...e})}async function P(n,a={}){let e={};if(typeof n=="string"?e={message:n,...a}:n&&typeof n=="object"&&(e={...n,...a}),typeof customElements<"u"&&(!customElements.get("sl-alert")||!customElements.get("sl-progress-bar"))&&await Promise.race([Promise.all([customElements.whenDefined("sl-alert"),customElements.whenDefined("sl-progress-bar")]),new Promise(c=>setTimeout(c,200))]),typeof customElements>"u"||!customElements.get("sl-alert"))return{alert:null,progressBar:null,update(){},close(){}};let u=e.container||g(),s=document.createElement("sl-alert");s.variant=e.variant||"primary",s.closable=e.closable===!0,s.duration=1/0;let f=e.icon!==void 0?e.icon:"arrow-down-circle";if(f){let c=document.createElement("sl-icon");c.slot="icon",c.name=f,s.appendChild(c)}let r=document.createElement("div");r.className="notify-progress-wrapper",r.style.display="flex",r.style.flexDirection="column",r.style.gap="0.35rem",r.style.minWidth="220px";let o=document.createElement("div");o.style.display="flex",o.style.justifyContent="space-between",o.style.alignItems="center",o.style.gap="0.5rem";let d=document.createElement("span");d.className="notify-progress-message",d.style.fontWeight="500",d.style.fontSize="0.9rem",d.textContent=e.message||"Processing...",o.appendChild(d);let i=document.createElement("span");i.className="notify-progress-status",i.style.fontSize="0.78rem",i.style.color="#64748b",i.style.fontWeight="600";let y=e.done!==void 0?e.done:0,t=e.total!==void 0?e.total:0;t>0?i.textContent=`${y} / ${t}`:e.value!==void 0&&(i.textContent=`${e.value}%`),o.appendChild(i),r.appendChild(o);let l=document.createElement("sl-progress-bar");t>0?l.value=Math.round(y/t*100):e.value!==void 0?l.value=e.value:l.indeterminate=!0,r.appendChild(l),s.appendChild(r);let m=customElements.get("sl-alert");if(m?.toastStack&&u){let c=m.toastStack;c.parentElement!==u&&u.appendChild(c)}return s.toast(),{alert:s,progressBar:l,update({done:c,total:h,value:x,message:E}={}){if(E!==void 0&&(d.textContent=E),h!==void 0&&c!==void 0){l.indeterminate=!1;let b=Math.min(100,Math.max(0,Math.round(c/Math.max(h,1)*100)));l.value=b,i.textContent=`${c} / ${h}`}else x!==void 0&&(l.indeterminate=!1,l.value=Math.min(100,Math.max(0,x)),i.textContent=`${Math.round(l.value)}%`)},close(){typeof s.hide=="function"&&s.hide()}}}var p=Object.assign(function(n,a){return w(n,a)},{show:w,success:D,error:S,warning:M,info:N,undo:V,progress:P,clear:k,setContainer:I,getContainer:g});export{I as a,g as b,k as c,p as d};
2
+ //# sourceMappingURL=chunk-V2FP4EEH.js.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-V6E2SSSW.js.map
@@ -0,0 +1,19 @@
1
+ var N=globalThis,W=N.ShadowRoot&&(N.ShadyCSS===void 0||N.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),Z=new WeakMap,R=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.i,e=this.t;if(W&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.i=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},lt=n=>new R(typeof n=="string"?n:n+"",void 0,V),Pt=(n,...t)=>{let e=n.length===1?n[0]:t.reduce(((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[r+1]),n[0]);return new R(e,n,V)},ct=(n,t)=>{if(W)n.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),i=N.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},F=W?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return lt(e)})(n):n,{is:dt,defineProperty:pt,getOwnPropertyDescriptor:ut,getOwnPropertyNames:ft,getOwnPropertySymbols:At,getPrototypeOf:$t}=Object,T=globalThis,G=T.trustedTypes,mt=G?G.emptyScript:"",gt=T.reactiveElementPolyfillSupport,P=(n,t)=>n,L={toAttribute(n,t){switch(t){case Boolean:n=n?mt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},nt=(n,t)=>!dt(n,t),X={attribute:!0,type:String,converter:L,reflect:!1,useDefault:!1,hasChanged:nt};Symbol.metadata??=Symbol("metadata"),T.litPropertyMetadata??=new WeakMap;var A=class extends HTMLElement{static addInitializer(t){this.o(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this.u&&[...this.u.keys()]}static createProperty(t,e=X){if(e.state&&(e.attribute=!1),this.o(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&pt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=ut(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){let l=i?.call(this);r?.call(this,o),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??X}static o(){if(this.hasOwnProperty(P("elementProperties")))return;let t=$t(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this.o(),this.hasOwnProperty(P("properties"))){let e=this.properties,s=[...ft(e),...At(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this.u=new Map;for(let[e,s]of this.elementProperties){let i=this.p(e,s);i!==void 0&&this.u.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(F(i))}else t!==void 0&&e.push(F(t));return e}static p(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this.v=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.m=null,this._()}_(){this.S=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this.$(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this.P??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this.P?.delete(t)}$(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this.v=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ct(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.P?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this.P?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}C(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor.p(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:L).toAttribute(e,s.type);this.m=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this.m=null}}_$AK(t,e){let s=this.constructor,i=s.u.get(t);if(i!==void 0&&this.m!==i){let r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:L;this.m=i;let l=o.fromAttribute(e,r.type);this[i]=l??this.T?.get(i)??l,this.m=null}}requestUpdate(t,e,s){if(t!==void 0){let i=this.constructor,r=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??nt)(r,e)||s.useDefault&&s.reflect&&r===this.T?.get(t)&&!this.hasAttribute(i.p(t,s))))return;this.M(t,e,s)}this.isUpdatePending===!1&&(this.S=this.k())}M(t,e,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this.T??=new Map).has(t)&&(this.T.set(t,o??e??this[t]),r!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this.m!==t&&(this.A??=new Set).add(t))}async k(){this.isUpdatePending=!0;try{await this.S}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this.v){for(let[i,r]of this.v)this[i]=r;this.v=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s){let{wrapped:o}=r,l=this[i];o!==!0||this._$AL.has(i)||l===void 0||this.M(i,void 0,r,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this.P?.forEach((s=>s.hostUpdate?.())),this.update(e)):this.U()}catch(s){throw t=!1,this.U(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this.P?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}U(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.S}shouldUpdate(t){return!0}update(t){this.A&&=this.A.forEach((e=>this.C(e,this[e]))),this.U()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[P("elementProperties")]=new Map,A[P("finalized")]=new Map,gt?.({ReactiveElement:A}),(T.reactiveElementVersions??=[]).push("2.1.1");var j=globalThis,M=j.trustedTypes,Y=M?M.createPolicy("lit-html",{createHTML:n=>n}):void 0,rt="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,ot="?"+$,yt=`<${ot}>`,y=document,C=()=>y.createComment(""),U=n=>n===null||typeof n!="object"&&typeof n!="function",q=Array.isArray,_t=n=>q(n)||typeof n?.[Symbol.iterator]=="function",O=`[
2
+ \f\r]`,w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Q=/-->/g,tt=/>/g,m=RegExp(`>|${O}(?:([^\\s"'>=/]+)(${O}*=${O}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),et=/'/g,st=/"/g,ht=/^(?:script|style|textarea|title)$/i,K=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),Ct=K(1),Ut=K(2),xt=K(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),it=new WeakMap,g=y.createTreeWalker(y,129);function at(n,t){if(!q(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Y!==void 0?Y.createHTML(t):t}var vt=(n,t)=>{let e=n.length-1,s=[],i,r=t===2?"<svg>":t===3?"<math>":"",o=w;for(let l=0;l<e;l++){let h=n[l],c,p,a=-1,u=0;for(;u<h.length&&(o.lastIndex=u,p=o.exec(h),p!==null);)u=o.lastIndex,o===w?p[1]==="!--"?o=Q:p[1]!==void 0?o=tt:p[2]!==void 0?(ht.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=m):p[3]!==void 0&&(o=m):o===m?p[0]===">"?(o=i??w,a=-1):p[1]===void 0?a=-2:(a=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?m:p[3]==='"'?st:et):o===st||o===et?o=m:o===Q||o===tt?o=w:(o=m,i=void 0);let f=o===m&&n[l+1].startsWith("/>")?" ":"";r+=o===w?h+yt:a>=0?(s.push(c),h.slice(0,a)+rt+h.slice(a)+$+f):h+$+(a===-2?l:f)}return[at(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},x=class n{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0,l=t.length-1,h=this.parts,[c,p]=vt(t,e);if(this.el=n.createElement(c,s),g.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=g.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(let a of i.getAttributeNames())if(a.endsWith(rt)){let u=p[o++],f=i.getAttribute(a).split($),E=/([.?@])?(.*)/.exec(u);h.push({type:1,index:r,name:E[2],strings:f,ctor:E[1]==="."?B:E[1]==="?"?I:E[1]==="@"?D:b}),i.removeAttribute(a)}else a.startsWith($)&&(h.push({type:6,index:r}),i.removeAttribute(a));if(ht.test(i.tagName)){let a=i.textContent.split($),u=a.length-1;if(u>0){i.textContent=M?M.emptyScript:"";for(let f=0;f<u;f++)i.append(a[f],C()),g.nextNode(),h.push({type:2,index:++r});i.append(a[u],C())}}}else if(i.nodeType===8)if(i.data===ot)h.push({type:2,index:r});else{let a=-1;for(;(a=i.data.indexOf($,a+1))!==-1;)h.push({type:7,index:r}),a+=$.length-1}r++}}static createElement(t,e){let s=y.createElement("template");return s.innerHTML=t,s}};function S(n,t,e=n,s){if(t===v)return t;let i=s!==void 0?e.N?.[s]:e.O,r=U(t)?void 0:t._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,e,s)),s!==void 0?(e.N??=[])[s]=i:e.O=i),i!==void 0&&(t=S(n,i._$AS(n,t.values),i,s)),t}var k=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}R(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??y).importNode(e,!0);g.currentNode=i;let r=g.nextNode(),o=0,l=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new H(r,r.nextSibling,this,t):h.type===1?c=new h.ctor(r,h.name,h.strings,this,t):h.type===6&&(c=new z(r,this,t)),this._$AV.push(c),h=s[++l]}o!==h?.index&&(r=g.nextNode(),o++)}return g.currentNode=y,i}V(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},H=class n{get _$AU(){return this._$AM?._$AU??this.D}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this.D=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),U(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==v&&this.L(t):t._$litType$!==void 0?this.j(t):t.nodeType!==void 0?this.I(t):_t(t)?this.H(t):this.L(t)}B(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}I(t){this._$AH!==t&&(this._$AR(),this._$AH=this.B(t))}L(t){this._$AH!==d&&U(this._$AH)?this._$AA.nextSibling.data=t:this.I(y.createTextNode(t)),this._$AH=t}j(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=x.createElement(at(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.V(e);else{let r=new k(i,this),o=r.R(this.options);r.V(e),this.I(o),this._$AH=r}}_$AC(t){let e=it.get(t.strings);return e===void 0&&it.set(t.strings,e=new x(t)),e}H(t){q(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let r of t)i===e.length?e.push(s=new n(this.B(C()),this.B(C()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this.D=t,this._$AP?.(t))}},b=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let r=this.strings,o=!1;if(r===void 0)t=S(this,t,e,0),o=!U(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{let l=t,h,c;for(t=r[0],h=0;h<r.length-1;h++)c=S(this,l[s+h],e,h),c===v&&(c=this._$AH[h]),o||=!U(c)||c!==this._$AH[h],c===d?t=d:t!==d&&(t+=(c??"")+r[h+1]),this._$AH[h]=c}o&&!i&&this.W(t)}W(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},B=class extends b{constructor(){super(...arguments),this.type=3}W(t){this.element[this.name]=t===d?void 0:t}},I=class extends b{constructor(){super(...arguments),this.type=4}W(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},D=class extends b{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===v)return;let s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},z=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}};var St=j.litHtmlPolyfillSupport;St?.(x,H),(j.litHtmlVersions??=[]).push("3.3.1");var bt=(n,t,e)=>{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),r),r,void 0,e??{})}return i._$AI(n),i},J=globalThis;var _=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this.rt=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.rt=bt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.rt?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.rt?.setConnected(!1)}render(){return v}};_._$litElement$=!0,_.finalized=!0,J.litElementHydrateSupport?.({LitElement:_});var wt=J.litElementPolyfillSupport;wt?.({LitElement:_});(J.litElementVersions??=[]).push("4.2.1");export{Pt as a,Ct as b,_ as c};
4
+ /**
5
+ * @license
6
+ * Copyright 2019 Google LLC
7
+ * SPDX-License-Identifier: BSD-3-Clause
8
+ */
9
+ /**
10
+ * @license
11
+ * Copyright 2017 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */
14
+ /**
15
+ * @license
16
+ * Copyright 2022 Google LLC
17
+ * SPDX-License-Identifier: BSD-3-Clause
18
+ */
19
+ //# sourceMappingURL=chunk-XEN5VKAV.js.map
@@ -0,0 +1,2 @@
1
+ var e=class{async exportDocumentAsPdf(r,a,o={}){throw new Error("PdfPort.exportDocumentAsPdf() must be implemented by adapter")}async renderPdfPagesToDataUrls(r){throw new Error("PdfPort.renderPdfPagesToDataUrls() must be implemented by adapter")}};export{e as a};
2
+ //# sourceMappingURL=chunk-YHLOPPXM.js.map
package/dist/core.js ADDED
@@ -0,0 +1,2 @@
1
+ import{a as o,b as p,c as q,d as r,e as x,f as y,g as z,h as A,i as B,j as C,k as D,l as E,m as F,n as G,o as H,p as I,q as J}from"./chunk-AU7NM25J.js";import"./chunk-4GEMGDRU.js";import{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,j as m,k as n,l as v}from"./chunk-N7Q34F2P.js";import{a as w}from"./chunk-SH4P4XSZ.js";import{a as u}from"./chunk-HN3336JN.js";import{a as d}from"./chunk-36F637QU.js";import{a as c}from"./chunk-4JPEWIT4.js";import{a as s}from"./chunk-B7HT2X67.js";import"./chunk-N4R55VRR.js";import{a as t}from"./chunk-E7JYVRJA.js";import"./chunk-YHLOPPXM.js";import"./chunk-G65H4ZTJ.js";import{a as b}from"./chunk-OI4WCW7E.js";import{a}from"./chunk-LI54F6PA.js";import"./chunk-4C666HHU.js";export{q as BUILD_DATE,C as COPIO_EVENTS,v as Canvas2DAdapter,J as CopioEngine,F as DEFAULT_EXPORT_FORMATS,E as DEFAULT_FEATURES,G as DEFAULT_OCR_LANGUAGES,o as DocRepository,A as Document,u as ImageProcessorPort,c as IndexedDbStorageAdapter,b as MemoryStorageAdapter,w as NullImageProcessorAdapter,s as NullOcrAdapter,t as NullPdfAdapter,z as Page,B as ScanSession,a as StoragePort,r as VERSION,n as applyEdits,h as applySauvolaToImageData,d as createDefaultAdapter,D as dispatchCopioEvent,p as docRepository,e as extractExif,g as fileToBase64,k as getCroppedSrc,I as getRegisteredService,y as hasActiveEdits,x as normalizeEditStack,l as normalizeEdits,f as randomId,H as registerService,m as renderEditsToCanvas,j as rotateSrc,i as thresholdSrc};
2
+ //# sourceMappingURL=core.js.map