@abtnode/blocklet-services 1.16.45-beta-20250702-091552-478bb5e9 → 1.16.46-beta-20250703-024219-4029ee97

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 (150) hide show
  1. package/api/routes/user-session.js +2 -1
  2. package/dist/assets/{AdapterDayjs-BRnJ9bMs.js → AdapterDayjs-BIQsjtiT.js} +1 -1
  3. package/dist/assets/{ArrowDropDown-DBJPIOl4.js → ArrowDropDown-C8mwBtnq.js} +1 -1
  4. package/dist/assets/{CheckCircle-DUJmWceY.js → CheckCircle-BMMes-V7.js} +1 -1
  5. package/dist/assets/{ChevronLeft-BBJJJhVi.js → ChevronLeft-B8rsCJhy.js} +1 -1
  6. package/dist/assets/{ChevronRight-BU9I7WD4.js → ChevronRight-CXhRlHKa.js} +1 -1
  7. package/dist/assets/{DeleteOutline-BKSMNwfT.js → DeleteOutline-DtbgduIM.js} +1 -1
  8. package/dist/assets/{Done-ASNftAOL.js → Done-CfxTFgBR.js} +1 -1
  9. package/dist/assets/{Download-D4X39_9V.js → Download-Cz4FAob1.js} +1 -1
  10. package/dist/assets/{Edit-CiTb-w5P.js → Edit-Dh2oBqBB.js} +1 -1
  11. package/dist/assets/{Error-BAEKW7-e.js → Error-BsnYcwiq.js} +1 -1
  12. package/dist/assets/{ExpandLess-CcLTbsdW.js → ExpandLess-B7eaaZaz.js} +1 -1
  13. package/dist/assets/{Google-C28yeMZW.js → Google-BAVYemz7.js} +1 -1
  14. package/dist/assets/{Home-Dujcj083.js → Home-SYcuMunC.js} +1 -1
  15. package/dist/assets/{InfoOutlined-BVWbftGI.js → InfoOutlined-GEKFkezP.js} +1 -1
  16. package/dist/assets/{Launch-DFS3fgjy.js → Launch-BB2NS6gw.js} +1 -1
  17. package/dist/assets/{LaunchOutlined-C1x4Og4u.js → LaunchOutlined-BEsYq9kI.js} +1 -1
  18. package/dist/assets/{MoreHoriz-ChJ3K52h.js → MoreHoriz-BDLlOCqj.js} +1 -1
  19. package/dist/assets/{PlayArrow-BqVYRyLK.js → PlayArrow-hnXK75qN.js} +1 -1
  20. package/dist/assets/{TuneOutlined-CKzi_VZZ.js → TuneOutlined-CjVMXY_7.js} +1 -1
  21. package/dist/assets/{ViewList-BOGcbymi.js → ViewList-CYMKafss.js} +1 -1
  22. package/dist/assets/{access-control-5WGT2JfR.js → access-control-C1HMwNqK.js} +1 -1
  23. package/dist/assets/{actions-DnTVXQ_Z.js → actions-D_aAU5uf.js} +1 -1
  24. package/dist/assets/{add-component-core-DehB4lvu.js → add-component-core-BEFFiTrn.js} +1 -1
  25. package/dist/assets/{add-resource-DfqBSLDk.js → add-resource-BwdFwCui.js} +1 -1
  26. package/dist/assets/{addon-DdjBFoHI.js → addon-CuKQNO-0.js} +1 -1
  27. package/dist/assets/advanced-BUnq5m4o.js +14 -0
  28. package/dist/assets/api-ZzsS0diA.js +1 -0
  29. package/dist/assets/{appearance-DsoglxbB.js → appearance-4MhpGgxL.js} +1 -1
  30. package/dist/assets/{audit-logs-DKiQkfse.js → audit-logs-Crahcw3z.js} +1 -1
  31. package/dist/assets/{authorize-IzqEi1HK.js → authorize-BdvY1Z98.js} +1 -1
  32. package/dist/assets/{base-chart-CoApVzod.js → base-chart-B81_ogPb.js} +1 -1
  33. package/dist/assets/{base32-DUSifB4M.js → base32-BTgHqgXA.js} +1 -1
  34. package/dist/assets/{branding-CwYIeBi1.js → branding-A9uxpYm2.js} +1 -1
  35. package/dist/assets/{branding-B1o_K1XB.js → branding-DPMhTm_T.js} +2 -2
  36. package/dist/assets/{bundle-avatar-UIbxwQif.js → bundle-avatar-DKZRbFJ2.js} +1 -1
  37. package/dist/assets/{button-D_ZVjN82.js → button-BxXFhZV_.js} +1 -1
  38. package/dist/assets/{click-to-copy-By4fgGR7.js → click-to-copy-nMjIOe47.js} +1 -1
  39. package/dist/assets/{cloneDeep-CDl5kZTY.js → cloneDeep-Cm_V5yFW.js} +1 -1
  40. package/dist/assets/{collapse-DAaiuAEY.js → collapse-2Uzc-qtU.js} +1 -1
  41. package/dist/assets/{complete-Bi_BaBBl.js → complete-C0GvGwhR.js} +1 -1
  42. package/dist/assets/{component-CiFJ1vhL.js → component-CI10LcFr.js} +3 -3
  43. package/dist/assets/{config-BZuiK8BP.js → config-COcQW2xB.js} +1 -1
  44. package/dist/assets/{config-JUGJKWP_.js → config-DwZ4p-2p.js} +1 -1
  45. package/dist/assets/{config-navigation-DZ54_nVv.js → config-navigation-OsN6Bi3R.js} +3 -3
  46. package/dist/assets/{config-space-D6ScnWdA.js → config-space-DD1BpqT2.js} +1 -1
  47. package/dist/assets/{confirm-RvA9mFot.js → confirm-DchYh746.js} +1 -1
  48. package/dist/assets/{connect-DGMfp8-Y.js → connect-BC_FEDb_.js} +1 -1
  49. package/dist/assets/{connect-DhuiCF4g.js → connect-DxHNQKee.js} +1 -1
  50. package/dist/assets/{connect-to-CxoBjkcK.js → connect-to-ZkYEK0m1.js} +1 -1
  51. package/dist/assets/{dashboard-t9EszOna.js → dashboard-BTYQTsrm.js} +3 -3
  52. package/dist/assets/{delete-confirm-wTMDQFnr.js → delete-confirm-bNsLJZC8.js} +1 -1
  53. package/dist/assets/{did-address-NnOD1W_A.js → did-address-BYc4cym-.js} +1 -1
  54. package/dist/assets/{domain-BaMcm6r6.js → domain-Clgo_OSc.js} +1 -1
  55. package/dist/assets/{domain-action-card-BlPWBOAu.js → domain-action-card-DLv7qvqf.js} +1 -1
  56. package/dist/assets/domains-DG0-1EGf.js +1 -0
  57. package/dist/assets/{dot-4jhL56kz.js → dot-BYJ1q_JZ.js} +1 -1
  58. package/dist/assets/{email-0b_MYxBQ.js → email-vrlxa6_L.js} +1 -1
  59. package/dist/assets/{exchange-passport-BnmyuwIs.js → exchange-passport-twE4l8Ym.js} +1 -1
  60. package/dist/assets/{fuel-DEqW116b.js → fuel-CRlIvND2.js} +1 -1
  61. package/dist/assets/{gen-access-key-CVpZSjIw.js → gen-access-key-7DQV-fiV.js} +1 -1
  62. package/dist/assets/{get-safe-url-B0-S5PGZ.js → get-safe-url-D3ggKpT1.js} +1 -1
  63. package/dist/assets/{get-safe-url-D5KSEAKZ.js → get-safe-url-DAFhlwkH.js} +1 -1
  64. package/dist/assets/{home-DfSu-4-a.js → home-A-VRaS1G.js} +1 -1
  65. package/dist/assets/{iframe-DFg8oeD0.js → iframe-GZPTHXNz.js} +1 -1
  66. package/dist/assets/{index-6I6juqjg.js → index-B9TY-Odb.js} +1 -1
  67. package/dist/assets/{index-aAlnaECr.js → index-B_LRxSf2.js} +1 -1
  68. package/dist/assets/{index-B4fH-l5R.js → index-Bm0yY2oo.js} +1 -1
  69. package/dist/assets/{index-B874LN5A.js → index-Bv2l4NRE.js} +1 -1
  70. package/dist/assets/{index-DrTNV3tX.js → index-C-YrYRw8.js} +1 -1
  71. package/dist/assets/{index-C0btiQfG.js → index-C4HCwPkf.js} +1 -1
  72. package/dist/assets/{index-ZcD1N43m.js → index-C4UNdprC.js} +1 -1
  73. package/dist/assets/{index-CkwXRCmN.js → index-C86CKPcd.js} +4 -4
  74. package/dist/assets/{index-I1i2Mc1k.js → index-CIPzQU7w.js} +1 -1
  75. package/dist/assets/{index-BxJZWVOT.js → index-CRPd6bu_.js} +1 -1
  76. package/dist/assets/{index-CD07vq9d.js → index-CneQHlZz.js} +1 -1
  77. package/dist/assets/{index-Dq1Rmjwf.js → index-CwogVjPF.js} +1 -1
  78. package/dist/assets/{index-BLfUtUpB.js → index-D1V1OV_1.js} +1 -1
  79. package/dist/assets/{index-DPIWnhb5.js → index-D3Qm_7QJ.js} +1 -1
  80. package/dist/assets/{index-CwUT0vPy.js → index-DBdN7QPA.js} +4 -4
  81. package/dist/assets/{index-IeoAQOW8.js → index-DJghIcZg.js} +1 -1
  82. package/dist/assets/{index-B70kYOfj.js → index-DYS82O-e.js} +1 -1
  83. package/dist/assets/{index-2mYUqHxe.js → index-DYlNzDk4.js} +3 -3
  84. package/dist/assets/{index-YaLWfp9D.js → index-JN3t0gnY.js} +1 -1
  85. package/dist/assets/{index-Cwq0Io0K.js → index-czMSCB_F.js} +1 -1
  86. package/dist/assets/{index-w4f-mlFt.js → index-opVatFs5.js} +1 -1
  87. package/dist/assets/{invitation-B3B-J4fG.js → invitation-DpzHBehx.js} +1 -1
  88. package/dist/assets/{invite-jaOwIvW9.js → invite-CLIKbeIQ.js} +1 -1
  89. package/dist/assets/{issue-passport-DpSBB2L8.js → issue-passport-8zXA1BKY.js} +1 -1
  90. package/dist/assets/{item-D-39k2FC.js → item-CDthQ-2V.js} +1 -1
  91. package/dist/assets/{layout-DEiEwPzB.js → layout-B9UmfNkJ.js} +1 -1
  92. package/dist/assets/{list-ZFC0mCy0.js → list-B1hvgiX4.js} +2 -2
  93. package/dist/assets/{list-DDNORnll.js → list-CeHTzwCI.js} +1 -1
  94. package/dist/assets/localization-BmadHeXm.js +1 -0
  95. package/dist/assets/{log-BBUgs8Rd.js → log-BwyobBHM.js} +1 -1
  96. package/dist/assets/{logger-Dqm1UQym.js → logger-9nL4ASn6.js} +1 -1
  97. package/dist/assets/{login-DbSs2lO2.js → login-Cgts-E2y.js} +1 -1
  98. package/dist/assets/{login-oauth-callback-Cpai1yC1.js → login-oauth-callback-D3WJu6Qx.js} +1 -1
  99. package/dist/assets/{logo-uploader-BPSmPaZd.js → logo-uploader-C2Aw-_0m.js} +3 -3
  100. package/dist/assets/{lost-passport-Ce_WXcnR.js → lost-passport-Jvpfzzix.js} +1 -1
  101. package/dist/assets/{omit-Cao4GLS7.js → omit-rJ-mc6U5.js} +1 -1
  102. package/dist/assets/{open-window-hpzKFxn5.js → open-window-CTBzFUUv.js} +1 -1
  103. package/dist/assets/{overview-C3aIT8Ro.js → overview-D2wj1UNY.js} +1 -1
  104. package/dist/assets/{page-header-DNvUdNpI.js → page-header-DqtuZOzT.js} +1 -1
  105. package/dist/assets/{passport-item-B3XIp0U4.js → passport-item-vgQO4aPM.js} +1 -1
  106. package/dist/assets/{permission-DQvXGutX.js → permission-BEqDHKfL.js} +1 -1
  107. package/dist/assets/{preferences-C3zaKjfI.js → preferences-D1eIimRF.js} +1 -1
  108. package/dist/assets/{profile-embed-BFjGm3Vt.js → profile-embed-DdACJ_zu.js} +1 -1
  109. package/dist/assets/publish-resource-BFNO0Bju.js +1 -0
  110. package/dist/assets/{react-beautiful-dnd.esm-02tdagHZ.js → react-beautiful-dnd.esm-CNuzAjru.js} +1 -1
  111. package/dist/assets/{runtime-Drmh1-cb.js → runtime-CJxB8Qqy.js} +1 -1
  112. package/dist/assets/{sanitize-e0A8A-yt.js → sanitize-BKnEhEg8.js} +1 -1
  113. package/dist/assets/sdk-Btq1iUPd.js +1 -0
  114. package/dist/assets/{security-BPd4v9z4.js → security-D5upbFtT.js} +1 -1
  115. package/dist/assets/{session-BGdAM8zS.js → session-kQ1tvY5U.js} +1 -1
  116. package/dist/assets/{setup-Bo10IVJ4.js → setup-DDRNZUzD.js} +3 -3
  117. package/dist/assets/{spaces-DUkzPTBd.js → spaces-BTlTdKAI.js} +1 -1
  118. package/dist/assets/{start-C9Hvgbcz.js → start-DcujueM1.js} +1 -1
  119. package/dist/assets/{starting-progress-CYgfPTsE.js → starting-progress-CAkASj-X.js} +1 -1
  120. package/dist/assets/{status-f3Y-NXRP.js → status-oJ1As_M0.js} +1 -1
  121. package/dist/assets/{step-actions-BNbc1l8F.js → step-actions-DrPbY3ZQ.js} +1 -1
  122. package/dist/assets/{studio-I9lo0Itp.js → studio-BWs_EnV3.js} +1 -1
  123. package/dist/assets/{switch-control-Brwb8ptk.js → switch-control-eCwDP-ME.js} +1 -1
  124. package/dist/assets/{table-tips-BzPqsKYQ.js → table-tips-CCj0tXz1.js} +1 -1
  125. package/dist/assets/{traffic-FNLLya21.js → traffic-BAsnAfLz.js} +1 -1
  126. package/dist/assets/{transfer-m6229uxg.js → transfer-C2qtHrKp.js} +1 -1
  127. package/dist/assets/{unsubscribe-BXKQU2c1.js → unsubscribe-B4aHISnG.js} +1 -1
  128. package/dist/assets/{use-blocklet-logo-4UB-MFD3.js → use-blocklet-logo-BWK1UHK5.js} +1 -1
  129. package/dist/assets/use-server-logo-UTr-CyJD.js +1 -1
  130. package/dist/assets/{useAsync-C62uE2pS.js → useAsync-BzjEtgtr.js} +1 -1
  131. package/dist/assets/{useLocalStorage-CaPDqrQ7.js → useLocalStorage-BoYGn-bQ.js} +1 -1
  132. package/dist/assets/{user-center-CNdVbQx6.js → user-center-BgJo4uqg.js} +3 -3
  133. package/dist/assets/{util-BRPRFc9p.js → util-KGB__QYA.js} +1 -1
  134. package/dist/assets/{util-BQAJqeb4.js → util-TW4lcckB.js} +1 -1
  135. package/dist/assets/{vendor-arcblock-CwufDgLV.js → vendor-arcblock-DzylOsX3.js} +3 -3
  136. package/dist/assets/{vendor-hooks-DqdmWCmo.js → vendor-hooks-B2N8eE_a.js} +1 -1
  137. package/dist/assets/vendor-utils-uPLZO5mM.js +208 -0
  138. package/dist/assets/vendor-ux-did-connect-CQtodyZB.js +2304 -0
  139. package/dist/assets/{wrap-locale-ClbCNOs0.js → wrap-locale-9hBUwROZ.js} +1 -1
  140. package/dist/index.html +5 -5
  141. package/dist/service-worker.js +1 -1
  142. package/package.json +23 -23
  143. package/dist/assets/advanced-CJz1c7Eh.js +0 -14
  144. package/dist/assets/api-C1S8LUld.js +0 -1
  145. package/dist/assets/domains-CxJF-JF_.js +0 -1
  146. package/dist/assets/localization-tyC-vHO5.js +0 -1
  147. package/dist/assets/publish-resource-CAZrBTdz.js +0 -1
  148. package/dist/assets/sdk-BmeKtHic.js +0 -1
  149. package/dist/assets/vendor-utils-BfZ4tlod.js +0 -208
  150. package/dist/assets/vendor-ux-did-connect-pzpsrvqx.js +0 -2304
@@ -1 +1 @@
1
- import{j as t,ah as r}from"./vendor-mui-core-Bq8gXTan.js";import{r as s}from"./vendor-react-DEoibe3W.js";import{bb as a}from"./vendor-ux-did-connect-pzpsrvqx.js";import{R as e}from"./vendor-arcblock-CwufDgLV.js";import"./vendor-utils-BfZ4tlod.js";import"./vendor-hooks-DqdmWCmo.js";import"./lottie-web-jYmAQWuC.js";function x(){const{t:o}=s.useContext(a);return t.jsx(n,{style:{paddingTop:"25vh"},children:t.jsx(e,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const n=r.main``;export{x as default};
1
+ import{j as t,ah as r}from"./vendor-mui-core-Bq8gXTan.js";import{r as s}from"./vendor-react-DEoibe3W.js";import{bb as a}from"./vendor-ux-did-connect-CQtodyZB.js";import{R as e}from"./vendor-arcblock-DzylOsX3.js";import"./vendor-utils-uPLZO5mM.js";import"./vendor-hooks-B2N8eE_a.js";import"./lottie-web-jYmAQWuC.js";function x(){const{t:o}=s.useContext(a);return t.jsx(n,{style:{paddingTop:"25vh"},children:t.jsx(e,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const n=r.main``;export{x as default};
@@ -1 +1 @@
1
- import{r as m}from"./vendor-react-DEoibe3W.js";import{a as w,k as C,a2 as T,ax as P,b$ as R}from"./vendor-ux-did-connect-pzpsrvqx.js";import{l as v}from"./vendor-hooks-DqdmWCmo.js";import{j as e,aa as s,ab as y,ak as j,al as L,bo as M,br as W,bn as B,q as _,ap as A,I as D,y as z,H as F}from"./vendor-mui-core-Bq8gXTan.js";import{d as q}from"./Launch-DFS3fgjy.js";import{a as K}from"./api-C1S8LUld.js";import{T as N}from"./table-tips-BzPqsKYQ.js";import{D as k}from"./index-CwUT0vPy.js";import{u as U}from"./dashboard-t9EszOna.js";import"./vendor-utils-BfZ4tlod.js";import"./lottie-web-jYmAQWuC.js";import"./InfoOutlined-BVWbftGI.js";import"./use-mobile-CtTQsfXN.js";import"./vendor-arcblock-CwufDgLV.js";import"./useLocalStorage-CaPDqrQ7.js";import"./index-8eXqqyHQ.js";import"./confirm-RvA9mFot.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-D5KSEAKZ.js";import"./session-BGdAM8zS.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./dot-4jhL56kz.js";import"./useAsync-C62uE2pS.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";function $({endpoint:n}){const[i,r]=m.useState("mcp-link"),h=k(),{api:g}=k(),{teamDid:p}=U(),{t:u,locale:d}=w(),{data:o,run:b,loading:x}=v(()=>g.createAccessKey({input:{teamDid:p,passport:C.SERVER_ROLES.ADMIN,authType:"simple",remark:"Generated by MCP Servers"}}),{manual:!0}),{imgPrefix:t}=h,a=m.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[t]),l=a.find(c=>c.value===i),f=m.useMemo(()=>{var c;return(c=o==null?void 0:o.data)==null?void 0:c.accessKeySecret},[o]),S=m.useMemo(()=>!f&&i!=="mcp-link",[f,i]),I=c=>{const E=`npx @blocklet/install-mcp@latest i ${n} --client ${c} --streamableHTTP --oauth2Bearer ${f}`;switch(c){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return E;case"mcp-link":default:return n}};return e.jsxs(s,{children:[e.jsx(P,{tabs:a,current:i,onChange:r,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(s,{component:"h2",children:i==="mcp-link"?l==null?void 0:l.label:`${l==null?void 0:l.label} ${u("installCommand")}`}),i!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${d}/mcp-${i}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(D,{size:"small",children:e.jsx(q,{})})})]}),e.jsxs(s,{position:"relative",sx:{"& .codeblock__inner":{overflow:"auto !important"}},children:[e.jsx(R,{code:I(i),language:"shell",style:{margin:0}}),S&&e.jsx(s,{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",sx:{bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:x?e.jsx(y,{}):e.jsx(z,{variant:"contained",color:"primary",onClick:b,size:"small",children:`${u("common.generate")} ${u("command")}`})})]})]})]})}$.propTypes={endpoint:F.string.isRequired};function ge(){var x;const[n,i]=m.useState(null),{t:r,locale:h}=w(),g=`${(x=window==null?void 0:window.blocklet)==null?void 0:x.appUrl}${C.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:p,loading:u,error:d}=v(()=>Promise.all([K.get(g)])),o=m.useMemo(()=>{var t,a;return((a=(t=p==null?void 0:p[0])==null?void 0:t.data)==null?void 0:a.servers)||[]},[p]);m.useEffect(()=>{o!=null&&o.length&&i(o.find(t=>{var a;return t.did===((a=window==null?void 0:window.blocklet)==null?void 0:a.did)})||o[0])},[o]);const b=t=>{const a=t.target.value;i(o.find(l=>l.did===a))};return u?e.jsx(s,{children:e.jsx(y,{})}):d?e.jsx(j,{color:"error",children:d==null?void 0:d.message}):o!=null&&o.length?e.jsxs(L,{gap:2,sx:{maxWidth:1200},children:[e.jsx(N,{title:r("mcp.listTitle"),tooltipTitle:r("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${h}/mcp-server`}),e.jsxs(M,{fullWidth:!0,children:[e.jsx(W,{id:"server-select-label",children:r("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:(n==null?void 0:n.did)||"",label:r("mcp.available"),onChange:b,children:o.map(t=>e.jsx(_,{value:t.did,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(T,{variant:"rounded",shape:"square",did:t.did,src:t.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:t.name})]})},t.did))})]}),n&&e.jsx($,{endpoint:n.endpoint})]}):e.jsx(j,{color:"warning",children:r("mcp.noServer")})}export{ge as default};
1
+ import{r as m}from"./vendor-react-DEoibe3W.js";import{a as w,k as C,a2 as T,ax as P,b$ as R}from"./vendor-ux-did-connect-CQtodyZB.js";import{l as v}from"./vendor-hooks-B2N8eE_a.js";import{j as e,aa as s,ab as y,ak as j,al as L,bo as M,br as W,bn as B,q as _,ap as A,I as D,y as z,H as F}from"./vendor-mui-core-Bq8gXTan.js";import{d as q}from"./Launch-BB2NS6gw.js";import{a as K}from"./api-ZzsS0diA.js";import{T as N}from"./table-tips-CCj0tXz1.js";import{D as k}from"./index-DBdN7QPA.js";import{u as U}from"./dashboard-BTYQTsrm.js";import"./vendor-utils-uPLZO5mM.js";import"./lottie-web-jYmAQWuC.js";import"./InfoOutlined-GEKFkezP.js";import"./use-mobile-DwzRjjku.js";import"./vendor-arcblock-DzylOsX3.js";import"./useLocalStorage-BoYGn-bQ.js";import"./index-8eXqqyHQ.js";import"./confirm-DchYh746.js";import"./PlayArrow-hnXK75qN.js";import"./get-safe-url-D3ggKpT1.js";import"./session-kQ1tvY5U.js";import"./use-blocklet-logo-BWK1UHK5.js";import"./dot-BYJ1q_JZ.js";import"./useAsync-BzjEtgtr.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-CtTQsfXN.js";function $({endpoint:n}){const[i,r]=m.useState("mcp-link"),h=k(),{api:g}=k(),{teamDid:p}=U(),{t:u,locale:d}=w(),{data:o,run:b,loading:x}=v(()=>g.createAccessKey({input:{teamDid:p,passport:C.SERVER_ROLES.ADMIN,authType:"simple",remark:"Generated by MCP Servers"}}),{manual:!0}),{imgPrefix:t}=h,a=m.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[t]),l=a.find(c=>c.value===i),f=m.useMemo(()=>{var c;return(c=o==null?void 0:o.data)==null?void 0:c.accessKeySecret},[o]),S=m.useMemo(()=>!f&&i!=="mcp-link",[f,i]),I=c=>{const E=`npx @blocklet/install-mcp@latest i ${n} --client ${c} --streamableHTTP --oauth2Bearer ${f}`;switch(c){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return E;case"mcp-link":default:return n}};return e.jsxs(s,{children:[e.jsx(P,{tabs:a,current:i,onChange:r,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(s,{component:"h2",children:i==="mcp-link"?l==null?void 0:l.label:`${l==null?void 0:l.label} ${u("installCommand")}`}),i!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${d}/mcp-${i}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(D,{size:"small",children:e.jsx(q,{})})})]}),e.jsxs(s,{position:"relative",sx:{"& .codeblock__inner":{overflow:"auto !important"}},children:[e.jsx(R,{code:I(i),language:"shell",style:{margin:0}}),S&&e.jsx(s,{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",sx:{bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:x?e.jsx(y,{}):e.jsx(z,{variant:"contained",color:"primary",onClick:b,size:"small",children:`${u("common.generate")} ${u("command")}`})})]})]})]})}$.propTypes={endpoint:F.string.isRequired};function ge(){var x;const[n,i]=m.useState(null),{t:r,locale:h}=w(),g=`${(x=window==null?void 0:window.blocklet)==null?void 0:x.appUrl}${C.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:p,loading:u,error:d}=v(()=>Promise.all([K.get(g)])),o=m.useMemo(()=>{var t,a;return((a=(t=p==null?void 0:p[0])==null?void 0:t.data)==null?void 0:a.servers)||[]},[p]);m.useEffect(()=>{o!=null&&o.length&&i(o.find(t=>{var a;return t.did===((a=window==null?void 0:window.blocklet)==null?void 0:a.did)})||o[0])},[o]);const b=t=>{const a=t.target.value;i(o.find(l=>l.did===a))};return u?e.jsx(s,{children:e.jsx(y,{})}):d?e.jsx(j,{color:"error",children:d==null?void 0:d.message}):o!=null&&o.length?e.jsxs(L,{gap:2,sx:{maxWidth:1200},children:[e.jsx(N,{title:r("mcp.listTitle"),tooltipTitle:r("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${h}/mcp-server`}),e.jsxs(M,{fullWidth:!0,children:[e.jsx(W,{id:"server-select-label",children:r("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:(n==null?void 0:n.did)||"",label:r("mcp.available"),onChange:b,children:o.map(t=>e.jsx(_,{value:t.did,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(T,{variant:"rounded",shape:"square",did:t.did,src:t.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:t.name})]})},t.did))})]}),n&&e.jsx($,{endpoint:n.endpoint})]}):e.jsx(j,{color:"warning",children:r("mcp.noServer")})}export{ge as default};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C0btiQfG.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-react-DEoibe3W.js","assets/vendor-hooks-DqdmWCmo.js","assets/vendor-utils-BfZ4tlod.js","assets/vendor-ux-did-connect-pzpsrvqx.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-CwufDgLV.js","assets/index-BxJZWVOT.js","assets/index-CwUT0vPy.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js"])))=>i.map(i=>d[i]);
2
- var $h=Object.defineProperty;var Hh=(i,e,t)=>e in i?$h(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Se=(i,e,t)=>Hh(i,typeof e!="symbol"?e+"":e,t);import{cm as qh,cn as Vh,co as Wh,cp as Gh,ao as ep,_ as Xh}from"./vendor-ux-did-connect-pzpsrvqx.js";import{m as ss,p as Rl,X as Kh,$ as Yh}from"./vendor-arcblock-CwufDgLV.js";import{g as $t,r as Z,e as Ul,d as Qh}from"./vendor-react-DEoibe3W.js";import{p as Jh}from"./index-BxJZWVOT.js";import{t as tp,g as Cs,v as Ai,B as Pt,d as os,a9 as Ml,a1 as ip,aO as Zh,aP as ap,P as Ms,aL as Ls,c as Ns,e as Bs}from"./vendor-utils-BfZ4tlod.js";import{H as O,e as ef,v as tf,j as Re,a3 as af,aa as No,I as nf,dw as sf,ab as of,T as rf,dx as lf}from"./vendor-mui-core-Bq8gXTan.js";import{a as cf,l as uf,G as pf}from"./vendor-hooks-DqdmWCmo.js";import{aR as df}from"./index-CwUT0vPy.js";import{c as Me}from"./index-DVQCgvFb.js";import"./lottie-web-jYmAQWuC.js";function yn(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var hf=0;function np(i){return"__private_"+hf+++"_"+i}function ff(i,e,t){const a=[];return i.forEach(n=>typeof n!="string"?a.push(n):e[Symbol.split](n).forEach((s,o,r)=>{s!==""&&a.push(s),o<r.length-1&&a.push(t)})),a}/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C4HCwPkf.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-react-DEoibe3W.js","assets/vendor-hooks-B2N8eE_a.js","assets/vendor-utils-uPLZO5mM.js","assets/vendor-ux-did-connect-CQtodyZB.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-DzylOsX3.js","assets/index-CRPd6bu_.js","assets/index-DBdN7QPA.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js"])))=>i.map(i=>d[i]);
2
+ var $h=Object.defineProperty;var Hh=(i,e,t)=>e in i?$h(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Se=(i,e,t)=>Hh(i,typeof e!="symbol"?e+"":e,t);import{cm as qh,cn as Vh,co as Wh,cp as Gh,ao as ep,_ as Xh}from"./vendor-ux-did-connect-CQtodyZB.js";import{m as ss,p as Rl,X as Kh,$ as Yh}from"./vendor-arcblock-DzylOsX3.js";import{g as $t,r as Z,e as Ul,d as Qh}from"./vendor-react-DEoibe3W.js";import{p as Jh}from"./index-CRPd6bu_.js";import{t as tp,g as Cs,w as Ai,B as Pt,d as os,a9 as Ml,a1 as ip,aO as Zh,aP as ap,P as Ms,aL as Ls,c as Ns,e as Bs}from"./vendor-utils-uPLZO5mM.js";import{H as O,e as ef,v as tf,j as Re,a3 as af,aa as No,I as nf,dw as sf,ab as of,T as rf,dx as lf}from"./vendor-mui-core-Bq8gXTan.js";import{a as cf,l as uf,G as pf}from"./vendor-hooks-B2N8eE_a.js";import{aR as df}from"./index-DBdN7QPA.js";import{c as Me}from"./index-DVQCgvFb.js";import"./lottie-web-jYmAQWuC.js";function yn(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var hf=0;function np(i){return"__private_"+hf+++"_"+i}function ff(i,e,t){const a=[];return i.forEach(n=>typeof n!="string"?a.push(n):e[Symbol.split](n).forEach((s,o,r)=>{s!==""&&a.push(s),o<r.length-1&&a.push(t)})),a}/**
3
3
  * Takes a string with placeholder variables like `%{smart_count} file selected`
4
4
  * and replaces it with values from options `{smart_count: 5}`
5
5
  *
@@ -73,5 +73,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
73
73
  </div>
74
74
  `,a.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(a,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));Se(this,"convertImgToObject",os(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(a=>{var l;if(!(a!=null&&a.src))return;const{src:n}=a,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(u=>u.previewUrl===n),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=Ex(s.originalname),[".mp4",".webm"].find(u=>{var p;return(p=a.src)==null?void 0:p.endsWith(u)})){const u=document.createElement("video");u.src=a.src,u.width=a.width,u.height=a.height,u.autoplay=!0,u.setAttribute("playsinline","playsinline"),u.muted=!0,u.loop=!0,u.style="pointer-events: none;",o.appendChild(u)}else if([".pdf"].find(u=>{var p;return(p=a.src)==null?void 0:p.endsWith(u)})){const u=document.createElement("div");u.className="pdf-icon",u.innerHTML=Ux,o.appendChild(u)}else{const u=document.createElement("object");u.data=n,u.type=s.mimetype||"image/png",u.alt=s.originalname,u.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",u.loading="lazy",o.appendChild(u)}o.appendChild(r),a.parentNode.replaceChild(o,a)}),this.canConvertImgToObject=!1)},{wait:200}));Se(this,"resetState",()=>{this.uploadedAPIData={...ku},this.uploaded.setPluginState({...Tu}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...ku},this.addUploadItemFlag=!0,this.icon=()=>le("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[le("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),le("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),le("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),le("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var a;return!this.uploadedAPIData.loading&&((a=this.uploadedAPIData.files)==null?void 0:a.length)===0&&this.queryUploadedFromMediaKit(),le("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new Qr(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...Tu}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===n._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==n._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,n]}))},this.view.donePicking=()=>{const{currentSelection:a}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",a),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=a=>{const{scrollHeight:n,scrollTop:s,offsetHeight:o}=a.target;n-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const Du={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,componentDid:"",components:[]},Eu={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},Lx={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"};class Nx extends ve{constructor(t,a){super(t,a);Se(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await dn.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=ip([...t.resources.map(a=>{let n="file";const{filename:s}=a,o=bs(s,0,0,jt);return n=bs(s,400,0,jt),{filename:s,_id:s,id:s,name:s,icon:n,previewUrl:n,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});Se(this,"resetState",()=>{this.apiData={...Du},this.resources.setPluginState({...Eu})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...Du},this.icon=()=>le("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[le("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),le("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),le("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),le("div",{id:"resources",className:"uploaded",children:[le("div",{style:{padding:this.apiData.components.length?"12px":"0",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(a=>le("button",{className:this.apiData.componentDid===a.did?"button-color-style button-color-style-active":"button-color-style",style:Lx,id:a.componentDid,onClick:()=>{this.apiData.componentDid!==a.did&&(this.apiData.componentDid=a.did,this.queryResources())},children:Zh(a.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new Qr(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...Eu}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===n.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==n.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,n]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:a}=this.resources.getPluginState();this.uppy.emit("resources:selected",a),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}var ze=Uint8Array,Ii=Uint16Array,Bx=Int32Array,Sh=new ze([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ph=new ze([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),zx=new ze([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ch=function(i,e){for(var t=new Ii(31),a=0;a<31;++a)t[a]=e+=1<<i[a-1];for(var n=new Bx(t[30]),a=1;a<30;++a)for(var s=t[a];s<t[a+1];++s)n[s]=s-t[a]<<5|a;return{b:t,r:n}},Fh=Ch(Sh,2),_h=Fh.b,jx=Fh.r;_h[28]=258,jx[258]=28;var $x=Ch(Ph,0),Hx=$x.b,Er=new Ii(32768);for(var ee=0;ee<32768;++ee){var Vt=(ee&43690)>>1|(ee&21845)<<1;Vt=(Vt&52428)>>2|(Vt&13107)<<2,Vt=(Vt&61680)>>4|(Vt&3855)<<4,Er[ee]=((Vt&65280)>>8|(Vt&255)<<8)>>1}var Ba=function(i,e,t){for(var a=i.length,n=0,s=new Ii(e);n<a;++n)i[n]&&++s[i[n]-1];var o=new Ii(e);for(n=1;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;var r;if(t){r=new Ii(1<<e);var l=15-e;for(n=0;n<a;++n)if(i[n])for(var u=n<<4|i[n],p=e-i[n],c=o[i[n]-1]++<<p,f=c|(1<<p)-1;c<=f;++c)r[Er[c]>>l]=u}else for(r=new Ii(a),n=0;n<a;++n)i[n]&&(r[n]=Er[o[i[n]-1]++]>>15-i[n]);return r},hn=new ze(288);for(var ee=0;ee<144;++ee)hn[ee]=8;for(var ee=144;ee<256;++ee)hn[ee]=9;for(var ee=256;ee<280;++ee)hn[ee]=7;for(var ee=280;ee<288;++ee)hn[ee]=8;var kh=new ze(32);for(var ee=0;ee<32;++ee)kh[ee]=5;var qx=Ba(hn,9,1),Vx=Ba(kh,5,1),ko=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},ot=function(i,e,t){var a=e/8|0;return(i[a]|i[a+1]<<8)>>(e&7)&t},To=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},Wx=function(i){return(i+7)/8|0},wl=function(i,e,t){return(e==null||e<0)&&(e=0),(t==null||t>i.length)&&(t=i.length),new ze(i.subarray(e,t))},Gx=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ke=function(i,e,t){var a=new Error(e||Gx[i]);if(a.code=i,Error.captureStackTrace&&Error.captureStackTrace(a,ke),!t)throw a;return a},Sl=function(i,e,t,a){var n=i.length,s=a?a.length:0;if(!n||e.f&&!e.l)return t||new ze(0);var o=!t,r=o||e.i!=2,l=e.i;o&&(t=new ze(n*3));var u=function(Wi){var Gi=t.length;if(Wi>Gi){var Xi=new ze(Math.max(Gi*2,Wi));Xi.set(t),t=Xi}},p=e.f||0,c=e.p||0,f=e.b||0,b=e.l,S=e.d,_=e.m,w=e.n,v=n*8;do{if(!b){p=ot(i,c,1);var x=ot(i,c+1,3);if(c+=3,x)if(x==1)b=qx,S=Vx,_=9,w=5;else if(x==2){var g=ot(i,c,31)+257,k=ot(i,c+10,15)+4,D=g+ot(i,c+5,31)+1;c+=14;for(var A=new ze(D),U=new ze(19),L=0;L<k;++L)U[zx[L]]=ot(i,c+L*3,7);c+=k*3;for(var X=ko(U),V=(1<<X)-1,$=Ba(U,X,1),L=0;L<D;){var B=$[ot(i,c,V)];c+=B&15;var h=B>>4;if(h<16)A[L++]=h;else{var F=0,P=0;for(h==16?(P=3+ot(i,c,3),c+=2,F=A[L-1]):h==17?(P=3+ot(i,c,7),c+=3):h==18&&(P=11+ot(i,c,127),c+=7);P--;)A[L++]=F}}var C=A.subarray(0,g),T=A.subarray(g);_=ko(C),w=ko(T),b=Ba(C,_,1),S=Ba(T,w,1)}else ke(1);else{var h=Wx(c)+4,m=i[h-4]|i[h-3]<<8,y=h+m;if(y>n){l&&ke(0);break}r&&u(f+m),t.set(i.subarray(h,y),f),e.b=f+=m,e.p=c=y*8,e.f=p;continue}if(c>v){l&&ke(0);break}}r&&u(f+131072);for(var I=(1<<_)-1,E=(1<<w)-1,z=c;;z=c){var F=b[To(i,c)&I],q=F>>4;if(c+=F&15,c>v){l&&ke(0);break}if(F||ke(2),q<256)t[f++]=q;else if(q==256){z=c,b=null;break}else{var W=q-254;if(q>264){var L=q-257,Y=Sh[L];W=ot(i,c,(1<<Y)-1)+_h[L],c+=Y}var J=S[To(i,c)&E],Q=J>>4;J||ke(3),c+=J&15;var T=Hx[Q];if(Q>3){var Y=Ph[Q];T+=To(i,c)&(1<<Y)-1,c+=Y}if(c>v){l&&ke(0);break}r&&u(f+131072);var qi=f+W;if(f<T){var Vi=s-T,fn=Math.min(T,qi);for(Vi+f<0&&ke(3);f<fn;++f)t[f]=a[Vi+f]}for(;f<qi;++f)t[f]=t[f-T]}}e.l=b,e.p=z,e.b=f,e.f=p,b&&(p=1,e.m=_,e.d=S,e.n=w)}while(!p);return f!=t.length&&o?wl(t,0,f):t.subarray(0,f)},Xx=new ze(0),vt=function(i,e){return i[e]|i[e+1]<<8},dt=function(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0},Do=function(i,e){return dt(i,e)+dt(i,e+4)*4294967296},Kx=function(i){(i[0]!=31||i[1]!=139||i[2]!=8)&&ke(6,"invalid gzip data");var e=i[3],t=10;e&4&&(t+=(i[10]|i[11]<<8)+2);for(var a=(e>>3&1)+(e>>4&1);a>0;a-=!i[t++]);return t+(e&2)},Yx=function(i){var e=i.length;return(i[e-4]|i[e-3]<<8|i[e-2]<<16|i[e-1]<<24)>>>0},Qx=function(i,e){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&ke(6,"invalid zlib data"),(i[1]>>5&1)==+!e&&ke(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function Th(i,e){return Sl(i,{i:2},e&&e.out,e&&e.dictionary)}function Jx(i,e){var t=Kx(i);return t+8>i.length&&ke(6,"invalid gzip data"),Sl(i.subarray(t,-8),{i:2},e&&e.out||new ze(Yx(i)),e&&e.dictionary)}function Zx(i,e){return Sl(i.subarray(Qx(i,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function Eo(i,e){return i[0]==31&&i[1]==139&&i[2]==8?Jx(i,e):(i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31?Th(i,e):Zx(i,e)}var Ir=typeof TextDecoder<"u"&&new TextDecoder,ew=0;try{Ir.decode(Xx,{stream:!0}),ew=1}catch{}var tw=function(i){for(var e="",t=0;;){var a=i[t++],n=(a>127)+(a>223)+(a>239);if(t+n>i.length)return{s:e,r:wl(i,t-1)};n?n==3?(a=((a&15)<<18|(i[t++]&63)<<12|(i[t++]&63)<<6|i[t++]&63)-65536,e+=String.fromCharCode(55296|a>>10,56320|a&1023)):n&1?e+=String.fromCharCode((a&31)<<6|i[t++]&63):e+=String.fromCharCode((a&15)<<12|(i[t++]&63)<<6|i[t++]&63):e+=String.fromCharCode(a)}};function iw(i,e){if(e){for(var t="",a=0;a<i.length;a+=16384)t+=String.fromCharCode.apply(null,i.subarray(a,a+16384));return t}else{if(Ir)return Ir.decode(i);var n=tw(i),s=n.s,t=n.r;return t.length&&ke(8),s}}var aw=function(i,e){return e+30+vt(i,e+26)+vt(i,e+28)},nw=function(i,e,t){var a=vt(i,e+28),n=iw(i.subarray(e+46,e+46+a),!(vt(i,e+8)&2048)),s=e+46+a,o=dt(i,e+20),r=t&&o==4294967295?sw(i,s):[o,dt(i,e+24),dt(i,e+42)],l=r[0],u=r[1],p=r[2];return[vt(i,e+10),l,u,n,s+vt(i,e+30)+vt(i,e+32),p]},sw=function(i,e){for(;vt(i,e)!=1;e+=4+vt(i,e+2));return[Do(i,e+12),Do(i,e+4),Do(i,e+20)]};function ow(i,e){for(var t={},a=i.length-22;dt(i,a)!=101010256;--a)(!a||i.length-a>65558)&&ke(13);var n=vt(i,a+8);if(!n)return{};var s=dt(i,a+16),o=s==4294967295||n==65535;if(o){var r=dt(i,a-12);o=dt(i,r)==101075792,o&&(n=dt(i,r+32),s=dt(i,r+48))}for(var l=e&&e.filter,u=0;u<n;++u){var p=nw(i,s,o),c=p[0],f=p[1],b=p[2],S=p[3],_=p[4],w=p[5],v=aw(i,w);s=_,(!l||l({name:S,size:f,originalSize:b,compression:c}))&&(c?c==8?t[S]=Th(i.subarray(v,v+f),{out:new ze(b)}):ke(14,"unknown compression type "+c):t[S]=wl(i,v,v+f))}return t}var Dh={exports:{}};(function(i,e){(function(t){i.exports=t()})(function(t){var a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(v,x){var h=v[0],m=v[1],y=v[2],g=v[3];h+=(m&y|~m&g)+x[0]-680876936|0,h=(h<<7|h>>>25)+m|0,g+=(h&m|~h&y)+x[1]-389564586|0,g=(g<<12|g>>>20)+h|0,y+=(g&h|~g&m)+x[2]+606105819|0,y=(y<<17|y>>>15)+g|0,m+=(y&g|~y&h)+x[3]-1044525330|0,m=(m<<22|m>>>10)+y|0,h+=(m&y|~m&g)+x[4]-176418897|0,h=(h<<7|h>>>25)+m|0,g+=(h&m|~h&y)+x[5]+1200080426|0,g=(g<<12|g>>>20)+h|0,y+=(g&h|~g&m)+x[6]-1473231341|0,y=(y<<17|y>>>15)+g|0,m+=(y&g|~y&h)+x[7]-45705983|0,m=(m<<22|m>>>10)+y|0,h+=(m&y|~m&g)+x[8]+1770035416|0,h=(h<<7|h>>>25)+m|0,g+=(h&m|~h&y)+x[9]-1958414417|0,g=(g<<12|g>>>20)+h|0,y+=(g&h|~g&m)+x[10]-42063|0,y=(y<<17|y>>>15)+g|0,m+=(y&g|~y&h)+x[11]-1990404162|0,m=(m<<22|m>>>10)+y|0,h+=(m&y|~m&g)+x[12]+1804603682|0,h=(h<<7|h>>>25)+m|0,g+=(h&m|~h&y)+x[13]-40341101|0,g=(g<<12|g>>>20)+h|0,y+=(g&h|~g&m)+x[14]-1502002290|0,y=(y<<17|y>>>15)+g|0,m+=(y&g|~y&h)+x[15]+1236535329|0,m=(m<<22|m>>>10)+y|0,h+=(m&g|y&~g)+x[1]-165796510|0,h=(h<<5|h>>>27)+m|0,g+=(h&y|m&~y)+x[6]-1069501632|0,g=(g<<9|g>>>23)+h|0,y+=(g&m|h&~m)+x[11]+643717713|0,y=(y<<14|y>>>18)+g|0,m+=(y&h|g&~h)+x[0]-373897302|0,m=(m<<20|m>>>12)+y|0,h+=(m&g|y&~g)+x[5]-701558691|0,h=(h<<5|h>>>27)+m|0,g+=(h&y|m&~y)+x[10]+38016083|0,g=(g<<9|g>>>23)+h|0,y+=(g&m|h&~m)+x[15]-660478335|0,y=(y<<14|y>>>18)+g|0,m+=(y&h|g&~h)+x[4]-405537848|0,m=(m<<20|m>>>12)+y|0,h+=(m&g|y&~g)+x[9]+568446438|0,h=(h<<5|h>>>27)+m|0,g+=(h&y|m&~y)+x[14]-1019803690|0,g=(g<<9|g>>>23)+h|0,y+=(g&m|h&~m)+x[3]-187363961|0,y=(y<<14|y>>>18)+g|0,m+=(y&h|g&~h)+x[8]+1163531501|0,m=(m<<20|m>>>12)+y|0,h+=(m&g|y&~g)+x[13]-1444681467|0,h=(h<<5|h>>>27)+m|0,g+=(h&y|m&~y)+x[2]-51403784|0,g=(g<<9|g>>>23)+h|0,y+=(g&m|h&~m)+x[7]+1735328473|0,y=(y<<14|y>>>18)+g|0,m+=(y&h|g&~h)+x[12]-1926607734|0,m=(m<<20|m>>>12)+y|0,h+=(m^y^g)+x[5]-378558|0,h=(h<<4|h>>>28)+m|0,g+=(h^m^y)+x[8]-2022574463|0,g=(g<<11|g>>>21)+h|0,y+=(g^h^m)+x[11]+1839030562|0,y=(y<<16|y>>>16)+g|0,m+=(y^g^h)+x[14]-35309556|0,m=(m<<23|m>>>9)+y|0,h+=(m^y^g)+x[1]-1530992060|0,h=(h<<4|h>>>28)+m|0,g+=(h^m^y)+x[4]+1272893353|0,g=(g<<11|g>>>21)+h|0,y+=(g^h^m)+x[7]-155497632|0,y=(y<<16|y>>>16)+g|0,m+=(y^g^h)+x[10]-1094730640|0,m=(m<<23|m>>>9)+y|0,h+=(m^y^g)+x[13]+681279174|0,h=(h<<4|h>>>28)+m|0,g+=(h^m^y)+x[0]-358537222|0,g=(g<<11|g>>>21)+h|0,y+=(g^h^m)+x[3]-722521979|0,y=(y<<16|y>>>16)+g|0,m+=(y^g^h)+x[6]+76029189|0,m=(m<<23|m>>>9)+y|0,h+=(m^y^g)+x[9]-640364487|0,h=(h<<4|h>>>28)+m|0,g+=(h^m^y)+x[12]-421815835|0,g=(g<<11|g>>>21)+h|0,y+=(g^h^m)+x[15]+530742520|0,y=(y<<16|y>>>16)+g|0,m+=(y^g^h)+x[2]-995338651|0,m=(m<<23|m>>>9)+y|0,h+=(y^(m|~g))+x[0]-198630844|0,h=(h<<6|h>>>26)+m|0,g+=(m^(h|~y))+x[7]+1126891415|0,g=(g<<10|g>>>22)+h|0,y+=(h^(g|~m))+x[14]-1416354905|0,y=(y<<15|y>>>17)+g|0,m+=(g^(y|~h))+x[5]-57434055|0,m=(m<<21|m>>>11)+y|0,h+=(y^(m|~g))+x[12]+1700485571|0,h=(h<<6|h>>>26)+m|0,g+=(m^(h|~y))+x[3]-1894986606|0,g=(g<<10|g>>>22)+h|0,y+=(h^(g|~m))+x[10]-1051523|0,y=(y<<15|y>>>17)+g|0,m+=(g^(y|~h))+x[1]-2054922799|0,m=(m<<21|m>>>11)+y|0,h+=(y^(m|~g))+x[8]+1873313359|0,h=(h<<6|h>>>26)+m|0,g+=(m^(h|~y))+x[15]-30611744|0,g=(g<<10|g>>>22)+h|0,y+=(h^(g|~m))+x[6]-1560198380|0,y=(y<<15|y>>>17)+g|0,m+=(g^(y|~h))+x[13]+1309151649|0,m=(m<<21|m>>>11)+y|0,h+=(y^(m|~g))+x[4]-145523070|0,h=(h<<6|h>>>26)+m|0,g+=(m^(h|~y))+x[11]-1120210379|0,g=(g<<10|g>>>22)+h|0,y+=(h^(g|~m))+x[2]+718787259|0,y=(y<<15|y>>>17)+g|0,m+=(g^(y|~h))+x[9]-343485551|0,m=(m<<21|m>>>11)+y|0,v[0]=h+v[0]|0,v[1]=m+v[1]|0,v[2]=y+v[2]|0,v[3]=g+v[3]|0}function s(v){var x=[],h;for(h=0;h<64;h+=4)x[h>>2]=v.charCodeAt(h)+(v.charCodeAt(h+1)<<8)+(v.charCodeAt(h+2)<<16)+(v.charCodeAt(h+3)<<24);return x}function o(v){var x=[],h;for(h=0;h<64;h+=4)x[h>>2]=v[h]+(v[h+1]<<8)+(v[h+2]<<16)+(v[h+3]<<24);return x}function r(v){var x=v.length,h=[1732584193,-271733879,-1732584194,271733878],m,y,g,k,D,A;for(m=64;m<=x;m+=64)n(h,s(v.substring(m-64,m)));for(v=v.substring(m-64),y=v.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0;m<y;m+=1)g[m>>2]|=v.charCodeAt(m)<<(m%4<<3);if(g[m>>2]|=128<<(m%4<<3),m>55)for(n(h,g),m=0;m<16;m+=1)g[m]=0;return k=x*8,k=k.toString(16).match(/(.*?)(.{0,8})$/),D=parseInt(k[2],16),A=parseInt(k[1],16)||0,g[14]=D,g[15]=A,n(h,g),h}function l(v){var x=v.length,h=[1732584193,-271733879,-1732584194,271733878],m,y,g,k,D,A;for(m=64;m<=x;m+=64)n(h,o(v.subarray(m-64,m)));for(v=m-64<x?v.subarray(m-64):new Uint8Array(0),y=v.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0;m<y;m+=1)g[m>>2]|=v[m]<<(m%4<<3);if(g[m>>2]|=128<<(m%4<<3),m>55)for(n(h,g),m=0;m<16;m+=1)g[m]=0;return k=x*8,k=k.toString(16).match(/(.*?)(.{0,8})$/),D=parseInt(k[2],16),A=parseInt(k[1],16)||0,g[14]=D,g[15]=A,n(h,g),h}function u(v){var x="",h;for(h=0;h<4;h+=1)x+=a[v>>h*8+4&15]+a[v>>h*8&15];return x}function p(v){var x;for(x=0;x<v.length;x+=1)v[x]=u(v[x]);return v.join("")}p(r("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function v(x,h){return x=x|0||0,x<0?Math.max(x+h,0):Math.min(x,h)}ArrayBuffer.prototype.slice=function(x,h){var m=this.byteLength,y=v(x,m),g=m,k,D,A,U;return h!==t&&(g=v(h,m)),y>g?new ArrayBuffer(0):(k=g-y,D=new ArrayBuffer(k),A=new Uint8Array(D),U=new Uint8Array(this,y,k),A.set(U),D)}}();function c(v){return/[\u0080-\uFFFF]/.test(v)&&(v=unescape(encodeURIComponent(v))),v}function f(v,x){var h=v.length,m=new ArrayBuffer(h),y=new Uint8Array(m),g;for(g=0;g<h;g+=1)y[g]=v.charCodeAt(g);return x?y:m}function b(v){return String.fromCharCode.apply(null,new Uint8Array(v))}function S(v,x,h){var m=new Uint8Array(v.byteLength+x.byteLength);return m.set(new Uint8Array(v)),m.set(new Uint8Array(x),v.byteLength),m}function _(v){var x=[],h=v.length,m;for(m=0;m<h-1;m+=2)x.push(parseInt(v.substr(m,2),16));return String.fromCharCode.apply(String,x)}function w(){this.reset()}return w.prototype.append=function(v){return this.appendBinary(c(v)),this},w.prototype.appendBinary=function(v){this._buff+=v,this._length+=v.length;var x=this._buff.length,h;for(h=64;h<=x;h+=64)n(this._hash,s(this._buff.substring(h-64,h)));return this._buff=this._buff.substring(h-64),this},w.prototype.end=function(v){var x=this._buff,h=x.length,m,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g;for(m=0;m<h;m+=1)y[m>>2]|=x.charCodeAt(m)<<(m%4<<3);return this._finish(y,h),g=p(this._hash),v&&(g=_(g)),this.reset(),g},w.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},w.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},w.prototype.setState=function(v){return this._buff=v.buff,this._length=v.length,this._hash=v.hash,this},w.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},w.prototype._finish=function(v,x){var h=x,m,y,g;if(v[h>>2]|=128<<(h%4<<3),h>55)for(n(this._hash,v),h=0;h<16;h+=1)v[h]=0;m=this._length*8,m=m.toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(m[2],16),g=parseInt(m[1],16)||0,v[14]=y,v[15]=g,n(this._hash,v)},w.hash=function(v,x){return w.hashBinary(c(v),x)},w.hashBinary=function(v,x){var h=r(v),m=p(h);return x?_(m):m},w.ArrayBuffer=function(){this.reset()},w.ArrayBuffer.prototype.append=function(v){var x=S(this._buff.buffer,v),h=x.length,m;for(this._length+=v.byteLength,m=64;m<=h;m+=64)n(this._hash,o(x.subarray(m-64,m)));return this._buff=m-64<h?new Uint8Array(x.buffer.slice(m-64)):new Uint8Array(0),this},w.ArrayBuffer.prototype.end=function(v){var x=this._buff,h=x.length,m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y,g;for(y=0;y<h;y+=1)m[y>>2]|=x[y]<<(y%4<<3);return this._finish(m,h),g=p(this._hash),v&&(g=_(g)),this.reset(),g},w.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},w.ArrayBuffer.prototype.getState=function(){var v=w.prototype.getState.call(this);return v.buff=b(v.buff),v},w.ArrayBuffer.prototype.setState=function(v){return v.buff=f(v.buff,!0),w.prototype.setState.call(this,v)},w.ArrayBuffer.prototype.destroy=w.prototype.destroy,w.ArrayBuffer.prototype._finish=w.prototype._finish,w.ArrayBuffer.hash=function(v,x){var h=l(new Uint8Array(v)),m=p(h);return x?_(m):m},w})})(Dh);var rw=Dh.exports;const lw=$t(rw);var As=typeof self<"u"?self:Cs;const nn=typeof navigator<"u",cw=nn&&typeof HTMLImageElement>"u",ys=!(typeof Cs>"u"||typeof Ai>"u"||!Ai.versions||!Ai.versions.node),Pl=As.Buffer,Mn=As.BigInt,Cl=!!Pl,uw=i=>i;function xs(i,e=uw){if(ys)try{return typeof require=="function"?Promise.resolve(e(require(i))):import(i).then(e)}catch{console.warn(`Couldn't load ${i}`)}}let Fl=As.fetch;const pw=i=>Fl=i;if(!As.fetch){const i=xs("http",a=>a),e=xs("https",a=>a),t=(a,{headers:n}={})=>new Promise(async(s,o)=>{let{port:r,hostname:l,pathname:u,protocol:p,search:c}=new URL(a);const f={method:"GET",hostname:l,path:encodeURI(u)+c,headers:n};r!==""&&(f.port=Number(r));const b=(p==="https:"?await e:await i).request(f,S=>{if(S.statusCode===301||S.statusCode===302){let _=new URL(S.headers.location,a).toString();return t(_,{headers:n}).then(s).catch(o)}s({status:S.statusCode,arrayBuffer:()=>new Promise(_=>{let w=[];S.on("data",v=>w.push(v)),S.on("end",()=>_(Pt.concat(w)))})})});b.on("error",o),b.end()});pw(t)}function H(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}const ws=i=>Eh(i)?void 0:i,dw=i=>i!==void 0;function Eh(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(dw).length===0)}function me(i){let e=new Error(i);throw delete e.stack,e}function mi(i){return(i=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(i).trim())===""?void 0:i}function Ar(i){let e=function(t){let a=0;return t.ifd0.enabled&&(a+=1024),t.exif.enabled&&(a+=2048),t.makerNote&&(a+=2048),t.userComment&&(a+=1024),t.gps.enabled&&(a+=512),t.interop.enabled&&(a+=100),t.ifd1.enabled&&(a+=1024),a+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}const Or=i=>String.fromCharCode.apply(null,i),Iu=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;function Ih(i){return Iu?Iu.decode(i):Cl?Pt.from(i).toString("utf8"):decodeURIComponent(escape(Or(i)))}class je{static from(e,t){return e instanceof this&&e.le===t?e:new je(e,void 0,void 0,t)}constructor(e,t=0,a,n){if(typeof n=="boolean"&&(this.le=n),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){a===void 0&&(a=e.byteLength-t);let s=new DataView(e,t,a);this._swapDataView(s)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof je){a===void 0&&(a=e.byteLength-t),(t+=e.byteOffset)+a>e.byteOffset+e.byteLength&&me("Creating view outside of available memory in ArrayBuffer");let s=new DataView(e.buffer,t,a);this._swapDataView(s)}else if(typeof e=="number"){let s=new DataView(new ArrayBuffer(e));this._swapDataView(s)}else me("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,a=je){return e instanceof DataView||e instanceof je?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||me("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new a(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new je(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return Ih(this.getUint8Array(e,t))}getLatin1String(e=0,t=this.byteLength){let a=this.getUint8Array(e,t);return Or(a)}getUnicodeString(e=0,t=this.byteLength){const a=[];for(let n=0;n<t&&e+n<this.byteLength;n+=2)a.push(this.getUint16(e+n));return Or(a)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,a){switch(t){case 1:return this.getUint8(e,a);case 2:return this.getUint16(e,a);case 4:return this.getUint32(e,a);case 8:return this.getUint64&&this.getUint64(e,a)}}getUint(e,t,a){switch(t){case 8:return this.getUint8(e,a);case 16:return this.getUint16(e,a);case 32:return this.getUint32(e,a);case 64:return this.getUint64&&this.getUint64(e,a)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function Rr(i,e){me(`${i} '${e}' was not loaded, try using full build of exifr.`)}class _l extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Rr(this.kind,e),t&&(e in t||function(a,n){me(`Unknown ${a} '${n}'.`)}(this.kind,e),t[e].enabled||Rr(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Bi=new _l("file parser"),Te=new _l("segment parser"),Hi=new _l("file reader");function hw(i,e){return typeof i=="string"?Au(i,e):nn&&!cw&&i instanceof HTMLImageElement?Au(i.src,e):i instanceof Uint8Array||i instanceof ArrayBuffer||i instanceof DataView?new je(i):nn&&i instanceof Blob?Ur(i,e,"blob",Nr):void me("Invalid input argument")}function Au(i,e){return(t=i).startsWith("data:")||t.length>1e4?Mr(i,e,"base64"):ys&&i.includes("://")?Ur(i,e,"url",Lr):ys?Mr(i,e,"fs"):nn?Ur(i,e,"url",Lr):void me("Invalid input argument");var t}async function Ur(i,e,t,a){return Hi.has(t)?Mr(i,e,t):a?async function(n,s){let o=await s(n);return new je(o)}(i,a):void me(`Parser ${t} is not loaded`)}async function Mr(i,e,t){let a=new(Hi.get(t))(i,e);return await a.read(),a}const Lr=i=>Fl(i).then(e=>e.arrayBuffer()),Nr=i=>new Promise((e,t)=>{let a=new FileReader;a.onloadend=()=>e(a.result||new ArrayBuffer),a.onerror=t,a.readAsArrayBuffer(i)});class fw 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 Fe(i,e,t){let a=new fw;for(let[n,s]of t)a.set(n,s);if(Array.isArray(e))for(let n of e)i.set(n,a);else i.set(e,a);return a}function Br(i,e,t){let a,n=i.get(e);for(a of t)n.set(a[0],a[1])}const $e=new Map,wi=new Map,as=new Map,Ln=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Ah=["jfif","xmp","icc","iptc","ihdr"],zr=["tiff",...Ah],ye=["ifd0","ifd1","exif","gps","interop"],Nn=[...zr,...ye],Bn=["makerNote","userComment"],Oh=["translateKeys","translateValues","reviveValues","multiSegment"],zn=[...Oh,"sanitize","mergeOutput","silentErrors"];class Rh{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class ya extends Rh{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,a,n){if(super(),H(this,"enabled",!1),H(this,"skip",new Set),H(this,"pick",new Set),H(this,"deps",new Set),H(this,"translateKeys",!1),H(this,"translateValues",!1),H(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(n),this.canBeFiltered=ye.includes(e),this.canBeFiltered&&(this.dict=$e.get(e)),a!==void 0)if(Array.isArray(a))this.parse=this.enabled=!0,this.canBeFiltered&&a.length>0&&this.translateTagSet(a,this.pick);else if(typeof a=="object"){if(this.enabled=!0,this.parse=a.parse!==!1,this.canBeFiltered){let{pick:s,skip:o}=a;s&&s.length>0&&this.translateTagSet(s,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(a)}else a===!0||a===!1?this.parse=this.enabled=a:me(`Invalid options argument: ${a}`)}applyInheritables(e){let t,a;for(t of Oh)a=e[t],a!==void 0&&(this[t]=a)}translateTagSet(e,t){if(this.dict){let a,n,{tagKeys:s,tagValues:o}=this.dict;for(a of e)typeof a=="string"?(n=o.indexOf(a),n===-1&&(n=s.indexOf(Number(a))),n!==-1&&t.add(Number(s[n]))):t.add(a)}else for(let a of e)t.add(a)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ss(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ss(this.pick,this.deps)}}var Oe={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},Ou=new Map;class kl extends Rh{static useCached(e){let t=Ou.get(e);return t!==void 0||(t=new this(e),Ou.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):me(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=nn?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Ln)this[e]=Oe[e];for(e of zn)this[e]=Oe[e];for(e of Bn)this[e]=Oe[e];for(e of Nn)this[e]=new ya(e,Oe[e],void 0,this)}setupFromTrue(){let e;for(e of Ln)this[e]=Oe[e];for(e of zn)this[e]=Oe[e];for(e of Bn)this[e]=!0;for(e of Nn)this[e]=new ya(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Ln)this[t]=Oe[t];for(t of zn)this[t]=Oe[t];for(t of Bn)this[t]=Oe[t];for(t of Nn)this[t]=new ya(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,ye)}setupFromObject(e){let t;for(t of(ye.ifd0=ye.ifd0||ye.image,ye.ifd1=ye.ifd1||ye.thumbnail,Object.assign(this,e),Ln))this[t]=Io(e[t],Oe[t]);for(t of zn)this[t]=Io(e[t],Oe[t]);for(t of Bn)this[t]=Io(e[t],Oe[t]);for(t of zr)this[t]=new ya(t,Oe[t],e[t],this);for(t of ye)this[t]=new ya(t,Oe[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,ye,Nn),e.tiff===!0?this.batchEnableWithBool(ye,!0):e.tiff===!1?this.batchEnableWithUserValue(ye,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,ye):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,ye)}batchEnableWithBool(e,t){for(let a of e)this[a].enabled=t}batchEnableWithUserValue(e,t){for(let a of e){let n=t[a];this[a].enabled=n!==!1&&n!==void 0}}setupGlobalFilters(e,t,a,n=a){if(e&&e.length){for(let o of n)this[o].enabled=!1;let s=Ru(e,a);for(let[o,r]of s)Ss(this[o].pick,r),this[o].enabled=!0}else if(t&&t.length){let s=Ru(t,a);for(let[o,r]of s)Ss(this[o].skip,r)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:a,iptc:n,icc:s}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),a.enabled||e.skip.add(700),n.enabled||e.skip.add(33723),s.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:a,interop:n}=this;n.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),a.needed&&e.deps.add(34853),this.tiff.enabled=ye.some(s=>this[s].enabled===!0)||this.makerNote||this.userComment;for(let s of ye)this[s].finalizeFilters()}get onlyTiff(){return!Ah.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of zr)this[e].enabled&&!Te.has(e)&&Rr("segment parser",e)}}function Ru(i,e){let t,a,n,s,o=[];for(n of e){for(s of(t=$e.get(n),a=[],t))(i.includes(s[0])||i.includes(s[1]))&&a.push(s[0]);a.length&&o.push([n,a])}return o}function Io(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Ss(i,e){for(let t of e)i.add(t)}H(kl,"default",Oe);class mw{constructor(e){H(this,"parsers",{}),H(this,"output",{}),H(this,"errors",[]),H(this,"pushToErrors",t=>this.errors.push(t)),this.options=kl.useCached(e)}async read(e){this.file=await hw(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[a,n]of Bi)if(n.canHandle(e,t))return this.fileParser=new n(this.options,this.file,this.parsers),e[a]=!0;this.file.close&&this.file.close(),me("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),ws(e)}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async a=>{let n=await a.parse();a.assignToOutput(e,n)});this.options.silentErrors&&(t=t.map(a=>a.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,a=Te.get("tiff",e);var n;if(t.tiff?n={start:0,type:"tiff"}:t.jpeg&&(n=await this.fileParser.getOrFindSegment("tiff")),n===void 0)return;let s=await this.fileParser.ensureSegmentChunk(n),o=this.parsers.tiff=new a(s,e,t),r=await o.extractThumbnail();return t.close&&t.close(),r}}class Os{constructor(e,t,a){H(this,"errors",[]),H(this,"ensureSegmentChunk",async n=>{let s=n.start,o=n.size||65536;if(this.file.chunked)if(this.file.available(s,o))n.chunk=this.file.subarray(s,o);else try{n.chunk=await this.file.readChunk(s,o)}catch(r){me(`Couldn't read segment: ${JSON.stringify(n)}. ${r.message}`)}else this.file.byteLength>s+o?n.chunk=this.file.subarray(s,o):n.size===void 0?n.chunk=this.file.subarray(s):me("Segment unreachable: "+JSON.stringify(n));return n.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=a}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let a=new(Te.get(e))(t,this.options,this.file);return this.parsers[e]=a}createParsers(e){for(let t of e){let{type:a,chunk:n}=t,s=this.options[a];if(s&&s.enabled){let o=this.parsers[a];o&&o.append||o||this.createParser(a,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}class ht{static findPosition(e,t){let a=e.getUint16(t+2)+2,n=typeof this.headerLength=="function"?this.headerLength(e,t,a):this.headerLength,s=t+n,o=a-n;return{offset:t,length:a,headerLength:n,start:s,size:o,end:s+o}}static parse(e,t={}){return new this(e,new kl({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof je?e:new je(e)}constructor(e,t={},a){H(this,"errors",[]),H(this,"raw",new Map),H(this,"handleError",n=>{if(!this.options.silentErrors)throw n;this.errors.push(n.message)}),this.chunk=this.normalizeInput(e),this.file=a,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[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(e,t){let a=as.get(t),n=wi.get(t),s=$e.get(t),o=this.options[t],r=o.reviveValues&&!!a,l=o.translateValues&&!!n,u=o.translateKeys&&!!s,p={};for(let[c,f]of e)r&&a.has(c)?f=a.get(c)(f):l&&n.has(c)&&(f=this.translateValue(f,n.get(c))),u&&s.has(c)&&(c=s.get(c)||c),p[c]=f;return p}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,a){if(this.globalOptions.mergeOutput)return Object.assign(e,a);e[t]?Object.assign(e[t],a):e[t]=a}}H(ht,"headerLength",4),H(ht,"type",void 0),H(ht,"multiSegment",!1),H(ht,"canHandle",()=>!1);function gw(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function vw(i){return i>=224&&i<=239}function bw(i,e,t){for(let[a,n]of Te)if(n.canHandle(i,e,t))return a}class Uu extends Os{constructor(...e){super(...e),H(this,"appSegments",[]),H(this,"jpegSegments",[]),H(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Te.keyList())):(e=e===void 0?Te.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Te.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:a,findAll:n,wanted:s,remaining:o}=this;if(!n&&this.file.chunked&&(n=Array.from(s).some(r=>{let l=Te.get(r),u=this.options[r];return l.multiSegment&&u.multiSegment}),n&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,a.byteLength),!this.options.onlyTiff&&a.chunked){let r=!1;for(;o.size>0&&!r&&(a.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=a,u=this.appSegments.some(p=>!this.file.available(p.offset||p.start,p.length||p.size));if(r=e>l&&!u?!await a.readNextChunk(e):!await a.readNextChunk(l),(e=this.findAppSegmentsInRange(e,a.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let a,n,s,o,r,l,{file:u,findAll:p,wanted:c,remaining:f,options:b}=this;for(;e<t;e++)if(u.getUint8(e)===255){if(a=u.getUint8(e+1),vw(a)){if(n=u.getUint16(e+2),s=bw(u,e,n),s&&c.has(s)&&(o=Te.get(s),r=o.findPosition(u,e),l=b[s],r.type=s,this.appSegments.push(r),!p&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=r.chunkNumber<r.chunkCount,this.unfinishedMultiSegment||f.delete(s)):f.delete(s),f.size===0)))break;b.recordUnknownSegments&&(r=ht.findPosition(u,e),r.marker=a,this.unknownSegments.push(r)),e+=n+1}else if(gw(a)){if(n=u.getUint16(e+2),a===218&&b.stopAfterSos!==!1)return;b.recordJpegSegments&&this.jpegSegments.push({offset:e,length:n,marker:a}),e+=n+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,a){let n,s,o,r=new Map;for(let l=0;l<t.length;l++)n=t[l],s=n[a],r.has(s)?o=r.get(s):r.set(s,o=[]),o.push(n);return Array.from(r)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,a])=>{let n=Te.get(t,this.options);return n.handleMultiSegments?{type:t,chunk:n.handleMultiSegments(a)}:a[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}H(Uu,"type","jpeg"),Bi.set("jpeg",Uu);const yw=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class xw extends ht{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,a=new Map){let{pick:n,skip:s}=this.options[t];n=new Set(n);let o=n.size>0,r=s.size===0,l=this.chunk.getUint16(e);e+=2;for(let u=0;u<l;u++){let p=this.chunk.getUint16(e);if(o){if(n.has(p)&&(a.set(p,this.parseTag(e,p,t)),n.delete(p),n.size===0))break}else!r&&s.has(p)||a.set(p,this.parseTag(e,p,t));e+=12}return a}parseTag(e,t,a){let{chunk:n}=this,s=n.getUint16(e+2),o=n.getUint32(e+4),r=yw[s];if(r*o<=4?e+=8:e=n.getUint32(e+8),(s<1||s>13)&&me(`Invalid TIFF value type. block: ${a.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e}`),e>n.byteLength&&me(`Invalid TIFF value offset. block: ${a.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e} is outside of chunk size ${n.byteLength}`),s===1)return n.getUint8Array(e,o);if(s===2)return mi(n.getString(e,o));if(s===7)return n.getUint8Array(e,o);if(o===1)return this.parseTagValue(s,e);{let l=new(function(p){switch(p){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}}(s))(o),u=r;for(let p=0;p<o;p++)l[p]=this.parseTagValue(s,e),e+=u;return l}}parseTagValue(e,t){let{chunk:a}=this;switch(e){case 1:return a.getUint8(t);case 3:return a.getUint16(t);case 4:return a.getUint32(t);case 5:return a.getUint32(t)/a.getUint32(t+4);case 6:return a.getInt8(t);case 8:return a.getInt16(t);case 9:return a.getInt32(t);case 10:return a.getInt32(t)/a.getInt32(t+4);case 11:return a.getFloat(t);case 12:return a.getDouble(t);case 13:return a.getUint32(t);default:me(`Invalid tiff type ${e}`)}}}class Ao extends xw{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let a=new Map;return this[t]=a,this.parseTags(e,t,a),a}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&me("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&me(`IFD0 offset points to outside of file.
75
75
  this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Ar(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):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,Ar(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let a=e.get(t);a&&a.length===1&&e.set(t,a[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Mu(...e.get(2),e.get(1))),e.set("longitude",Mu(...e.get(4),e.get(3)))),e}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(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))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 e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,a,n={};for(t of ye)if(e=this[t],!Eh(e))if(a=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(n,a)}else n[t]=a;return this.makerNote&&(n.makerNote=this.makerNote),this.userComment&&(n.userComment=this.userComment),n}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[a,n]of Object.entries(t))this.assignObjectToOutput(e,a,n)}}function Mu(i,e,t,a){var n=i+e/60+t/3600;return a!=="S"&&a!=="W"||(n*=-1),n}H(Ao,"type","tiff"),H(Ao,"headerLength",10),Te.set("tiff",Ao);const Tl={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},Tl,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},Tl,{tiff:!1,ifd1:!0,mergeOutput:!1});const ww=Object.assign({},Tl,{firstChunkSize:4e4,ifd0:[274]});async function Sw(i){let e=new mw(ww);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const Pw=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}});let Fa=!0,_a=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,a]=e;Fa=Number(t)+.1*Number(a)<13.4,_a=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Fa=_a=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Fa=_a=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Fa=_a=Number(e)<77}}async function Cw(i){let e=await Sw(i);return Object.assign({canvas:Fa,css:_a},Pw[e])}class Fw extends je{constructor(...e){super(...e),H(this,"ranges",new _w),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,a){if(e===0&&this.byteLength===0&&a){let n=new DataView(a.buffer||a,a.byteOffset,a.byteLength);this._swapDataView(n)}else{let n=e+t;if(n>this.byteLength){let{dataView:s}=this._extend(n);this._swapDataView(s)}}}_extend(e){let t;t=Cl?Pl.allocUnsafe(e):new Uint8Array(e);let a=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:a}}subarray(e,t,a=!1){return t=t||this._lengthToEnd(e),a&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,a=!1){a&&this._tryExtend(t,e.byteLength,e);let n=super.set(e,t);return this.ranges.add(t,n.byteLength),n}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class _w{constructor(){H(this,"list",[])}get length(){return this.list.length}add(e,t,a=0){let n=e+t,s=this.list.filter(o=>Lu(e,o.offset,n)||Lu(e,o.end,n));if(s.length>0){e=Math.min(e,...s.map(r=>r.offset)),n=Math.max(n,...s.map(r=>r.end)),t=n-e;let o=s.shift();o.offset=e,o.length=t,o.end=n,this.list=this.list.filter(r=>!s.includes(r))}else this.list.push({offset:e,length:t,end:n})}available(e,t){let a=e+t;return this.list.some(n=>n.offset<=e&&a<=n.end)}}function Lu(i,e,t){return i<=e&&e<=t}class Rs extends Fw{constructor(e,t){super(0),H(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,a=await this.readChunk(e,t);return!!a&&a.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}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(){}}Hi.set("blob",class extends Rs{async readWhole(){this.chunked=!1;let i=await Nr(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,a=this.input.slice(i,t),n=await Nr(a);return this.set(n,i,!0)}});Hi.set("url",class extends Rs{async readWhole(){this.chunked=!1;let i=await Lr(this.input);i instanceof ArrayBuffer?this._swapArrayBuffer(i):i instanceof Uint8Array&&this._swapBuffer(i)}async _readChunk(i,e){let t=e?i+e-1:void 0,a=this.options.httpHeaders||{};(i||t)&&(a.range=`bytes=${[i,t].join("-")}`);let n=await Fl(this.input,{headers:a}),s=await n.arrayBuffer(),o=s.byteLength;if(n.status!==416)return o!==e&&(this.size=i+o),this.set(s,i,!0)}});je.prototype.getUint64=function(i){let e=this.getUint32(i),t=this.getUint32(i+4);return e<1048575?e<<32|t:typeof Mn!==void 0?(console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."),Mn(e)<<Mn(32)|Mn(t)):void me("Trying to read 64b value but JS can only handle 53b numbers.")};class kw extends Os{parseBoxes(e=0){let t=[];for(;e<this.file.byteLength-4;){let a=this.parseBoxHead(e);if(t.push(a),a.length===0)break;e+=a.length}return t}parseSubBoxes(e){e.boxes=this.parseBoxes(e.start)}findBox(e,t){return e.boxes===void 0&&this.parseSubBoxes(e),e.boxes.find(a=>a.kind===t)}parseBoxHead(e){let t=this.file.getUint32(e),a=this.file.getString(e+4,4),n=e+8;return t===1&&(t=this.file.getUint64(e+8),n+=8),{offset:e,length:t,kind:a,start:n}}parseBoxFullHead(e){if(e.version!==void 0)return;let t=this.file.getUint32(e.start);e.version=t>>24,e.start+=4}}class Uh extends kw{static canHandle(e,t){if(t!==0)return!1;let a=e.getUint16(2);if(a>50)return!1;let n=16,s=[];for(;n<a;)s.push(e.getString(n,4)),n+=4;return s.includes(this.type)}async parse(){let e=this.file.getUint32(0),t=this.parseBoxHead(e);for(;t.kind!=="meta";)e+=t.length,await this.file.ensureChunk(e,16),t=this.parseBoxHead(e);await this.file.ensureChunk(t.offset,t.length),this.parseBoxFullHead(t),this.parseSubBoxes(t),this.options.icc.enabled&&await this.findIcc(t),this.options.tiff.enabled&&await this.findExif(t)}async registerSegment(e,t,a){await this.file.ensureChunk(t,a);let n=this.file.subarray(t,a);this.createParser(e,n)}async findIcc(e){let t=this.findBox(e,"iprp");if(t===void 0)return;let a=this.findBox(t,"ipco");if(a===void 0)return;let n=this.findBox(a,"colr");n!==void 0&&await this.registerSegment("icc",n.offset+12,n.length)}async findExif(e){let t=this.findBox(e,"iinf");if(t===void 0)return;let a=this.findBox(e,"iloc");if(a===void 0)return;let n=this.findExifLocIdInIinf(t),s=this.findExtentInIloc(a,n);if(s===void 0)return;let[o,r]=s;await this.file.ensureChunk(o,r);let l=4+this.file.getUint32(o);o+=l,r-=l,await this.registerSegment("tiff",o,r)}findExifLocIdInIinf(e){this.parseBoxFullHead(e);let t,a,n,s,o=e.start,r=this.file.getUint16(o);for(o+=2;r--;){if(t=this.parseBoxHead(o),this.parseBoxFullHead(t),a=t.start,t.version>=2&&(n=t.version===3?4:2,s=this.file.getString(a+n+2,4),s==="Exif"))return this.file.getUintBytes(a,n);o+=t.length}}get8bits(e){let t=this.file.getUint8(e);return[t>>4,15&t]}findExtentInIloc(e,t){this.parseBoxFullHead(e);let a=e.start,[n,s]=this.get8bits(a++),[o,r]=this.get8bits(a++),l=e.version===2?4:2,u=e.version===1||e.version===2?2:0,p=r+n+s,c=e.version===2?4:2,f=this.file.getUintBytes(a,c);for(a+=c;f--;){let b=this.file.getUintBytes(a,l);a+=l+u+2+o;let S=this.file.getUint16(a);if(a+=2,b===t)return S>1&&console.warn(`ILOC box has more than one extent but we're only processing one
76
- Please create an issue at https://github.com/MikeKovarik/exifr with this file`),[this.file.getUintBytes(a+r,n),this.file.getUintBytes(a+r+n,s)];a+=S*p}}}class Mh extends Uh{}H(Mh,"type","heic");class Nu extends Uh{}H(Nu,"type","avif"),Bi.set("heic",Mh),Bi.set("avif",Nu),Fe($e,["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"]]),Fe($e,"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"]]),Fe($e,"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"]]),Fe(wi,["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"}]]);let za=Fe(wi,"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"}]]);const Bu={1:"No absolute unit of measurement",2:"Inch",3:"Centimeter"};za.set(37392,Bu),za.set(41488,Bu);const Oo={0:"Normal",1:"Low",2:"High"};function zu(i){return typeof i=="object"&&i.length!==void 0?i[0]:i}function ju(i){let e=Array.from(i).slice(1);return e[1]>15&&(e=e.map(t=>String.fromCharCode(t))),e[2]!=="0"&&e[2]!==0||e.pop(),e.join(".")}function Ro(i){if(typeof i=="string"){var[e,t,a,n,s,o]=i.trim().split(/[-: ]/g).map(Number),r=new Date(e,t-1,a);return Number.isNaN(n)||Number.isNaN(s)||Number.isNaN(o)||(r.setHours(n),r.setMinutes(s),r.setSeconds(o)),Number.isNaN(+r)?i:r}}function xa(i){if(typeof i=="string")return i;let e=[];if(i[1]===0&&i[i.length-1]===0)for(let t=0;t<i.length;t+=2)e.push($u(i[t+1],i[t]));else for(let t=0;t<i.length;t+=2)e.push($u(i[t],i[t+1]));return mi(String.fromCodePoint(...e))}function $u(i,e){return i<<8|e}za.set(41992,Oo),za.set(41993,Oo),za.set(41994,Oo),Fe(as,["ifd0","ifd1"],[[50827,function(i){return typeof i!="string"?Ih(i):i}],[306,Ro],[40091,xa],[40092,xa],[40093,xa],[40094,xa],[40095,xa]]),Fe(as,"exif",[[40960,ju],[36864,ju],[36867,Ro],[36868,Ro],[40962,zu],[40963,zu]]),Fe(as,"gps",[[0,i=>Array.from(i).join(".")],[7,i=>Array.from(i).join(":")]]);class Uo extends ht{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1752462448&&e.getString(t+4,20)==="http://ns.adobe.com/"}static headerLength(e,t){return e.getString(t+4,34)==="http://ns.adobe.com/xmp/extension/"?79:33}static findPosition(e,t){let a=super.findPosition(e,t);return a.multiSegment=a.extended=a.headerLength===79,a.multiSegment?(a.chunkCount=e.getUint8(t+72),a.chunkNumber=e.getUint8(t+76),e.getUint8(t+77)!==0&&a.chunkNumber++):(a.chunkCount=1/0,a.chunkNumber=-1),a}static handleMultiSegments(e){return e.map(t=>t.chunk.getString()).join("")}normalizeInput(e){return typeof e=="string"?e:je.from(e).getString()}parse(e=this.chunk){if(!this.localOptions.parse)return e;e=function(s){let o={},r={};for(let l of zh)o[l]=[],r[l]=0;return s.replace(Iw,(l,u,p)=>{if(u==="<"){let c=++r[p];return o[p].push(c),`${l}#${c}`}return`${l}#${o[p].pop()}`})}(e);let t=Mi.findAll(e,"rdf","Description");t.length===0&&t.push(new Mi("rdf","Description",void 0,e));let a,n={};for(let s of t)for(let o of s.properties)a=Ew(o.ns,n),Lh(o,a);return function(s){let o;for(let r in s)o=s[r]=ws(s[r]),o===void 0&&delete s[r];return ws(s)}(n)}assignToOutput(e,t){if(this.localOptions.parse)for(let[a,n]of Object.entries(t))switch(a){case"tiff":this.assignObjectToOutput(e,"ifd0",n);break;case"exif":this.assignObjectToOutput(e,"exif",n);break;case"xmlns":break;default:this.assignObjectToOutput(e,a,n)}else e.xmp=t}}H(Uo,"type","xmp"),H(Uo,"multiSegment",!0),Te.set("xmp",Uo);class Ps{static findAll(e){return Nh(e,/([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(Ps.unpackMatch)}static unpackMatch(e){let t=e[1],a=e[2],n=e[3].slice(1,-1);return n=Bh(n),new Ps(t,a,n)}constructor(e,t,a){this.ns=e,this.name=t,this.value=a}serialize(){return this.value}}class Mi{static findAll(e,t,a){if(t!==void 0||a!==void 0){t=t||"[\\w\\d-]+",a=a||"[\\w\\d-]+";var n=new RegExp(`<(${t}):(${a})(#\\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 Nh(e,n).map(Mi.unpackMatch)}static unpackMatch(e){let t=e[1],a=e[2],n=e[4],s=e[8];return new Mi(t,a,n,s)}constructor(e,t,a,n){this.ns=e,this.name=t,this.attrString=a,this.innerXml=n,this.attrs=Ps.findAll(a),this.children=Mi.findAll(n),this.value=this.children.length===0?Bh(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:e,name:t}=this;return e==="rdf"&&(t==="Seq"||t==="Bag"||t==="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 Dw(this.children.map(Tw));if(this.isListItem&&this.children.length===1&&this.attrs.length===0)return this.children[0].serialize();let e={};for(let t of this.properties)Lh(t,e);return this.value!==void 0&&(e.value=this.value),ws(e)}}function Lh(i,e){let t=i.serialize();t!==void 0&&(e[i.name]=t)}var Tw=i=>i.serialize(),Dw=i=>i.length===1?i[0]:i,Ew=(i,e)=>e[i]?e[i]:e[i]={};function Nh(i,e){let t,a=[];if(!i)return a;for(;(t=e.exec(i))!==null;)a.push(t);return a}function Bh(i){if(function(a){return a==null||a==="null"||a==="undefined"||a===""||a.trim()===""}(i))return;let e=Number(i);if(!Number.isNaN(e))return e;let t=i.toLowerCase();return t==="true"||t!=="false"&&i.trim()}const zh=["rdf:li","rdf:Seq","rdf:Bag","rdf:Alt","rdf:Description"],Iw=new RegExp(`(<|\\/)(${zh.join("|")})`,"g");let Hu=xs("fs",i=>i.promises);Hi.set("fs",class extends Rs{async readWhole(){this.chunked=!1,this.fs=await Hu;let i=await this.fs.readFile(this.input);this._swapBuffer(i)}async readChunked(){this.chunked=!0,this.fs=await Hu,await this.open(),await this.readChunk(0,this.options.firstChunkSize)}async open(){this.fh===void 0&&(this.fh=await this.fs.open(this.input,"r"),this.size=(await this.fh.stat(this.input)).size)}async _readChunk(i,e){this.fh===void 0&&await this.open(),i+e>this.size&&(e=this.size-i);var t=this.subarray(i,e,!0);return await this.fh.read(t.dataView,0,e,i),t}async close(){if(this.fh){let i=this.fh;this.fh=void 0,await i.close()}}});Hi.set("base64",class extends Rs{constructor(...i){super(...i),this.input=this.input.replace(/^data:([^;]+);base64,/gim,""),this.size=this.input.length/4*3,this.input.endsWith("==")?this.size-=2:this.input.endsWith("=")&&(this.size-=1)}async _readChunk(i,e){let t,a,n=this.input;i===void 0?(i=0,t=0,a=0):(t=4*Math.floor(i/3),a=i-t/4*3),e===void 0&&(e=this.size);let s=i+e,o=t+4*Math.ceil(s/3);n=n.slice(t,o);let r=Math.min(e,this.size-i);if(Cl){let l=Pl.from(n,"base64").slice(a,a+r);return this.set(l,i,!0)}{let l=this.subarray(i,r,!0),u=atob(n),p=l.toUint8();for(let c=0;c<r;c++)p[c]=u.charCodeAt(a+c);return l}}});class qu extends Os{static canHandle(e,t){return t===18761||t===19789}extendOptions(e){let{ifd0:t,xmp:a,iptc:n,icc:s}=e;a.enabled&&t.deps.add(700),n.enabled&&t.deps.add(33723),s.enabled&&t.deps.add(34675),t.finalizeFilters()}async parse(){let{tiff:e,xmp:t,iptc:a,icc:n}=this.options;if(e.enabled||t.enabled||a.enabled||n.enabled){let s=Math.max(Ar(this.options),this.options.chunkSize);await this.file.ensureChunk(0,s),this.createParser("tiff",this.file),this.parsers.tiff.parseHeader(),await this.parsers.tiff.parseIfd0Block(),this.adaptTiffPropAsSegment("xmp"),this.adaptTiffPropAsSegment("iptc"),this.adaptTiffPropAsSegment("icc")}}adaptTiffPropAsSegment(e){if(this.parsers.tiff[e]){let t=this.parsers.tiff[e];this.injectSegment(e,t)}}}H(qu,"type","tiff"),Bi.set("tiff",qu);let Aw=xs("zlib");const Ow=["ihdr","iccp","text","itxt","exif"];class Vu extends Os{constructor(...e){super(...e),H(this,"catchError",t=>this.errors.push(t)),H(this,"metaChunks",[]),H(this,"unknownChunks",[])}static canHandle(e,t){return t===35152&&e.getUint32(0)===2303741511&&e.getUint32(4)===218765834}async parse(){let{file:e}=this;await this.findPngChunksInRange(8,e.byteLength),await this.readSegments(this.metaChunks),this.findIhdr(),this.parseTextChunks(),await this.findExif().catch(this.catchError),await this.findXmp().catch(this.catchError),await this.findIcc().catch(this.catchError)}async findPngChunksInRange(e,t){let{file:a}=this;for(;e<t;){let n=a.getUint32(e),s=a.getUint32(e+4),o=a.getString(e+4,4).toLowerCase(),r=n+4+4+4,l={type:o,offset:e,length:r,start:e+4+4,size:n,marker:s};Ow.includes(o)?this.metaChunks.push(l):this.unknownChunks.push(l),e+=r}}parseTextChunks(){let e=this.metaChunks.filter(t=>t.type==="text");for(let t of e){let[a,n]=this.file.getString(t.start,t.size).split("\0");this.injectKeyValToIhdr(a,n)}}injectKeyValToIhdr(e,t){let a=this.parsers.ihdr;a&&a.raw.set(e,t)}findIhdr(){let e=this.metaChunks.find(t=>t.type==="ihdr");e&&this.options.ihdr.enabled!==!1&&this.createParser("ihdr",e.chunk)}async findExif(){let e=this.metaChunks.find(t=>t.type==="exif");e&&this.injectSegment("tiff",e.chunk)}async findXmp(){let e=this.metaChunks.filter(t=>t.type==="itxt");for(let t of e)t.chunk.getString(0,17)==="XML:com.adobe.xmp"&&this.injectSegment("xmp",t.chunk)}async findIcc(){let e=this.metaChunks.find(r=>r.type==="iccp");if(!e)return;let{chunk:t}=e,a=t.getUint8Array(0,81),n=0;for(;n<80&&a[n]!==0;)n++;let s=n+2,o=t.getString(0,n);if(this.injectKeyValToIhdr("ProfileName",o),ys){let r=await Aw,l=t.getUint8Array(s);l=r.inflateSync(l),this.injectSegment("icc",l)}}}H(Vu,"type","png"),Bi.set("png",Vu),Fe($e,"interop",[[1,"InteropIndex"],[2,"InteropVersion"],[4096,"RelatedImageFileFormat"],[4097,"RelatedImageWidth"],[4098,"RelatedImageHeight"]]),Br($e,"ifd0",[[11,"ProcessingSoftware"],[254,"SubfileType"],[255,"OldSubfileType"],[263,"Thresholding"],[264,"CellWidth"],[265,"CellLength"],[266,"FillOrder"],[269,"DocumentName"],[280,"MinSampleValue"],[281,"MaxSampleValue"],[285,"PageName"],[286,"XPosition"],[287,"YPosition"],[290,"GrayResponseUnit"],[297,"PageNumber"],[321,"HalftoneHints"],[322,"TileWidth"],[323,"TileLength"],[332,"InkSet"],[337,"TargetPrinter"],[18246,"Rating"],[18249,"RatingPercent"],[33550,"PixelScale"],[34264,"ModelTransform"],[34377,"PhotoshopSettings"],[50706,"DNGVersion"],[50707,"DNGBackwardVersion"],[50708,"UniqueCameraModel"],[50709,"LocalizedCameraModel"],[50736,"DNGLensInfo"],[50739,"ShadowScale"],[50740,"DNGPrivateData"],[33920,"IntergraphMatrix"],[33922,"ModelTiePoint"],[34118,"SEMInfo"],[34735,"GeoTiffDirectory"],[34736,"GeoTiffDoubleParams"],[34737,"GeoTiffAsciiParams"],[50341,"PrintIM"],[50721,"ColorMatrix1"],[50722,"ColorMatrix2"],[50723,"CameraCalibration1"],[50724,"CameraCalibration2"],[50725,"ReductionMatrix1"],[50726,"ReductionMatrix2"],[50727,"AnalogBalance"],[50728,"AsShotNeutral"],[50729,"AsShotWhiteXY"],[50730,"BaselineExposure"],[50731,"BaselineNoise"],[50732,"BaselineSharpness"],[50734,"LinearResponseLimit"],[50735,"CameraSerialNumber"],[50741,"MakerNoteSafety"],[50778,"CalibrationIlluminant1"],[50779,"CalibrationIlluminant2"],[50781,"RawDataUniqueID"],[50827,"OriginalRawFileName"],[50828,"OriginalRawFileData"],[50831,"AsShotICCProfile"],[50832,"AsShotPreProfileMatrix"],[50833,"CurrentICCProfile"],[50834,"CurrentPreProfileMatrix"],[50879,"ColorimetricReference"],[50885,"SRawType"],[50898,"PanasonicTitle"],[50899,"PanasonicTitle2"],[50931,"CameraCalibrationSig"],[50932,"ProfileCalibrationSig"],[50933,"ProfileIFD"],[50934,"AsShotProfileName"],[50936,"ProfileName"],[50937,"ProfileHueSatMapDims"],[50938,"ProfileHueSatMapData1"],[50939,"ProfileHueSatMapData2"],[50940,"ProfileToneCurve"],[50941,"ProfileEmbedPolicy"],[50942,"ProfileCopyright"],[50964,"ForwardMatrix1"],[50965,"ForwardMatrix2"],[50966,"PreviewApplicationName"],[50967,"PreviewApplicationVersion"],[50968,"PreviewSettingsName"],[50969,"PreviewSettingsDigest"],[50970,"PreviewColorSpace"],[50971,"PreviewDateTime"],[50972,"RawImageDigest"],[50973,"OriginalRawFileDigest"],[50981,"ProfileLookTableDims"],[50982,"ProfileLookTableData"],[51043,"TimeCodes"],[51044,"FrameRate"],[51058,"TStop"],[51081,"ReelName"],[51089,"OriginalDefaultFinalSize"],[51090,"OriginalBestQualitySize"],[51091,"OriginalDefaultCropSize"],[51105,"CameraLabel"],[51107,"ProfileHueSatMapEncoding"],[51108,"ProfileLookTableEncoding"],[51109,"BaselineExposureOffset"],[51110,"DefaultBlackRender"],[51111,"NewRawImageDigest"],[51112,"RawToPreviewGain"]]);let Wu=[[273,"StripOffsets"],[279,"StripByteCounts"],[288,"FreeOffsets"],[289,"FreeByteCounts"],[291,"GrayResponseCurve"],[292,"T4Options"],[293,"T6Options"],[300,"ColorResponseUnit"],[320,"ColorMap"],[324,"TileOffsets"],[325,"TileByteCounts"],[326,"BadFaxLines"],[327,"CleanFaxData"],[328,"ConsecutiveBadFaxLines"],[330,"SubIFD"],[333,"InkNames"],[334,"NumberofInks"],[336,"DotRange"],[338,"ExtraSamples"],[339,"SampleFormat"],[340,"SMinSampleValue"],[341,"SMaxSampleValue"],[342,"TransferRange"],[343,"ClipPath"],[344,"XClipPathUnits"],[345,"YClipPathUnits"],[346,"Indexed"],[347,"JPEGTables"],[351,"OPIProxy"],[400,"GlobalParametersIFD"],[401,"ProfileType"],[402,"FaxProfile"],[403,"CodingMethods"],[404,"VersionYear"],[405,"ModeNumber"],[433,"Decode"],[434,"DefaultImageColor"],[435,"T82Options"],[437,"JPEGTables"],[512,"JPEGProc"],[515,"JPEGRestartInterval"],[517,"JPEGLosslessPredictors"],[518,"JPEGPointTransforms"],[519,"JPEGQTables"],[520,"JPEGDCTables"],[521,"JPEGACTables"],[559,"StripRowCounts"],[999,"USPTOMiscellaneous"],[18247,"XP_DIP_XML"],[18248,"StitchInfo"],[28672,"SonyRawFileType"],[28688,"SonyToneCurve"],[28721,"VignettingCorrection"],[28722,"VignettingCorrParams"],[28724,"ChromaticAberrationCorrection"],[28725,"ChromaticAberrationCorrParams"],[28726,"DistortionCorrection"],[28727,"DistortionCorrParams"],[29895,"SonyCropTopLeft"],[29896,"SonyCropSize"],[32781,"ImageID"],[32931,"WangTag1"],[32932,"WangAnnotation"],[32933,"WangTag3"],[32934,"WangTag4"],[32953,"ImageReferencePoints"],[32954,"RegionXformTackPoint"],[32955,"WarpQuadrilateral"],[32956,"AffineTransformMat"],[32995,"Matteing"],[32996,"DataType"],[32997,"ImageDepth"],[32998,"TileDepth"],[33300,"ImageFullWidth"],[33301,"ImageFullHeight"],[33302,"TextureFormat"],[33303,"WrapModes"],[33304,"FovCot"],[33305,"MatrixWorldToScreen"],[33306,"MatrixWorldToCamera"],[33405,"Model2"],[33421,"CFARepeatPatternDim"],[33422,"CFAPattern2"],[33423,"BatteryLevel"],[33424,"KodakIFD"],[33445,"MDFileTag"],[33446,"MDScalePixel"],[33447,"MDColorTable"],[33448,"MDLabName"],[33449,"MDSampleInfo"],[33450,"MDPrepDate"],[33451,"MDPrepTime"],[33452,"MDFileUnits"],[33589,"AdventScale"],[33590,"AdventRevision"],[33628,"UIC1Tag"],[33629,"UIC2Tag"],[33630,"UIC3Tag"],[33631,"UIC4Tag"],[33918,"IntergraphPacketData"],[33919,"IntergraphFlagRegisters"],[33921,"INGRReserved"],[34016,"Site"],[34017,"ColorSequence"],[34018,"IT8Header"],[34019,"RasterPadding"],[34020,"BitsPerRunLength"],[34021,"BitsPerExtendedRunLength"],[34022,"ColorTable"],[34023,"ImageColorIndicator"],[34024,"BackgroundColorIndicator"],[34025,"ImageColorValue"],[34026,"BackgroundColorValue"],[34027,"PixelIntensityRange"],[34028,"TransparencyIndicator"],[34029,"ColorCharacterization"],[34030,"HCUsage"],[34031,"TrapIndicator"],[34032,"CMYKEquivalent"],[34152,"AFCP_IPTC"],[34232,"PixelMagicJBIGOptions"],[34263,"JPLCartoIFD"],[34306,"WB_GRGBLevels"],[34310,"LeafData"],[34687,"TIFF_FXExtensions"],[34688,"MultiProfiles"],[34689,"SharedData"],[34690,"T88Options"],[34732,"ImageLayer"],[34750,"JBIGOptions"],[34856,"Opto-ElectricConvFactor"],[34857,"Interlace"],[34908,"FaxRecvParams"],[34909,"FaxSubAddress"],[34910,"FaxRecvTime"],[34929,"FedexEDR"],[34954,"LeafSubIFD"],[37387,"FlashEnergy"],[37388,"SpatialFrequencyResponse"],[37389,"Noise"],[37390,"FocalPlaneXResolution"],[37391,"FocalPlaneYResolution"],[37392,"FocalPlaneResolutionUnit"],[37397,"ExposureIndex"],[37398,"TIFF-EPStandardID"],[37399,"SensingMethod"],[37434,"CIP3DataFile"],[37435,"CIP3Sheet"],[37436,"CIP3Side"],[37439,"StoNits"],[37679,"MSDocumentText"],[37680,"MSPropertySetStorage"],[37681,"MSDocumentTextPosition"],[37724,"ImageSourceData"],[40965,"InteropIFD"],[40976,"SamsungRawPointersOffset"],[40977,"SamsungRawPointersLength"],[41217,"SamsungRawByteOrder"],[41218,"SamsungRawUnknown"],[41484,"SpatialFrequencyResponse"],[41485,"Noise"],[41489,"ImageNumber"],[41490,"SecurityClassification"],[41491,"ImageHistory"],[41494,"TIFF-EPStandardID"],[41995,"DeviceSettingDescription"],[42112,"GDALMetadata"],[42113,"GDALNoData"],[44992,"ExpandSoftware"],[44993,"ExpandLens"],[44994,"ExpandFilm"],[44995,"ExpandFilterLens"],[44996,"ExpandScanner"],[44997,"ExpandFlashLamp"],[46275,"HasselbladRawImage"],[48129,"PixelFormat"],[48130,"Transformation"],[48131,"Uncompressed"],[48132,"ImageType"],[48256,"ImageWidth"],[48257,"ImageHeight"],[48258,"WidthResolution"],[48259,"HeightResolution"],[48320,"ImageOffset"],[48321,"ImageByteCount"],[48322,"AlphaOffset"],[48323,"AlphaByteCount"],[48324,"ImageDataDiscard"],[48325,"AlphaDataDiscard"],[50215,"OceScanjobDesc"],[50216,"OceApplicationSelector"],[50217,"OceIDNumber"],[50218,"OceImageLogic"],[50255,"Annotations"],[50459,"HasselbladExif"],[50547,"OriginalFileName"],[50560,"USPTOOriginalContentType"],[50656,"CR2CFAPattern"],[50710,"CFAPlaneColor"],[50711,"CFALayout"],[50712,"LinearizationTable"],[50713,"BlackLevelRepeatDim"],[50714,"BlackLevel"],[50715,"BlackLevelDeltaH"],[50716,"BlackLevelDeltaV"],[50717,"WhiteLevel"],[50718,"DefaultScale"],[50719,"DefaultCropOrigin"],[50720,"DefaultCropSize"],[50733,"BayerGreenSplit"],[50737,"ChromaBlurRadius"],[50738,"AntiAliasStrength"],[50752,"RawImageSegmentation"],[50780,"BestQualityScale"],[50784,"AliasLayerMetadata"],[50829,"ActiveArea"],[50830,"MaskedAreas"],[50935,"NoiseReductionApplied"],[50974,"SubTileBlockSize"],[50975,"RowInterleaveFactor"],[51008,"OpcodeList1"],[51009,"OpcodeList2"],[51022,"OpcodeList3"],[51041,"NoiseProfile"],[51114,"CacheVersion"],[51125,"DefaultUserCrop"],[51157,"NikonNEFInfo"],[65024,"KdcIFD"]];Br($e,"ifd0",Wu),Br($e,"exif",Wu),Fe(wi,"gps",[[23,{M:"Magnetic North",T:"True North"}],[25,{K:"Kilometers",M:"Miles",N:"Nautical Miles"}]]);class Mo extends ht{static canHandle(e,t){return e.getUint8(t+1)===224&&e.getUint32(t+4)===1246120262&&e.getUint8(t+8)===0}parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint16(0)],[2,this.chunk.getUint8(2)],[3,this.chunk.getUint16(3)],[5,this.chunk.getUint16(5)],[7,this.chunk.getUint8(7)],[8,this.chunk.getUint8(8)]])}}H(Mo,"type","jfif"),H(Mo,"headerLength",9),Te.set("jfif",Mo),Fe($e,"jfif",[[0,"JFIFVersion"],[2,"ResolutionUnit"],[3,"XResolution"],[5,"YResolution"],[7,"ThumbnailWidth"],[8,"ThumbnailHeight"]]);class Gu extends ht{parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint32(0)],[4,this.chunk.getUint32(4)],[8,this.chunk.getUint8(8)],[9,this.chunk.getUint8(9)],[10,this.chunk.getUint8(10)],[11,this.chunk.getUint8(11)],[12,this.chunk.getUint8(12)],...Array.from(this.raw)])}}H(Gu,"type","ihdr"),Te.set("ihdr",Gu),Fe($e,"ihdr",[[0,"ImageWidth"],[4,"ImageHeight"],[8,"BitDepth"],[9,"ColorType"],[10,"Compression"],[11,"Filter"],[12,"Interlace"]]),Fe(wi,"ihdr",[[9,{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha",DEFAULT:"Unknown"}],[10,{0:"Deflate/Inflate",DEFAULT:"Unknown"}],[11,{0:"Adaptive",DEFAULT:"Unknown"}],[12,{0:"Noninterlaced",1:"Adam7 Interlace",DEFAULT:"Unknown"}]]);class ns extends ht{static canHandle(e,t){return e.getUint8(t+1)===226&&e.getUint32(t+4)===1229144927}static findPosition(e,t){let a=super.findPosition(e,t);return a.chunkNumber=e.getUint8(t+16),a.chunkCount=e.getUint8(t+17),a.multiSegment=a.chunkCount>1,a}static handleMultiSegments(e){return function(t){let a=function(n){let s=n[0].constructor,o=0;for(let u of n)o+=u.length;let r=new s(o),l=0;for(let u of n)r.set(u,l),l+=u.length;return r}(t.map(n=>n.chunk.toUint8()));return new je(a)}(e)}parse(){return this.raw=new Map,this.parseHeader(),this.parseTags(),this.translate(),this.output}parseHeader(){let{raw:e}=this;this.chunk.byteLength<84&&me("ICC header is too short");for(let[t,a]of Object.entries(Rw)){t=parseInt(t,10);let n=a(this.chunk,t);n!=="\0\0\0\0"&&e.set(t,n)}}parseTags(){let e,t,a,n,s,{raw:o}=this,r=this.chunk.getUint32(128),l=132,u=this.chunk.byteLength;for(;r--;){if(e=this.chunk.getString(l,4),t=this.chunk.getUint32(l+4),a=this.chunk.getUint32(l+8),n=this.chunk.getString(t,4),t+a>u)return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");s=this.parseTag(n,t,a),s!==void 0&&s!=="\0\0\0\0"&&o.set(e,s),l+=12}}parseTag(e,t,a){switch(e){case"desc":return this.parseDesc(t);case"mluc":return this.parseMluc(t);case"text":return this.parseText(t,a);case"sig ":return this.parseSig(t)}if(!(t+a>this.chunk.byteLength))return this.chunk.getUint8Array(t,a)}parseDesc(e){let t=this.chunk.getUint32(e+8)-1;return mi(this.chunk.getString(e+12,t))}parseText(e,t){return mi(this.chunk.getString(e+8,t-8))}parseSig(e){return mi(this.chunk.getString(e+8,4))}parseMluc(e){let{chunk:t}=this,a=t.getUint32(e+8),n=t.getUint32(e+12),s=e+16,o=[];for(let r=0;r<a;r++){let l=t.getString(s+0,2),u=t.getString(s+2,2),p=t.getUint32(s+4),c=t.getUint32(s+8)+e,f=mi(t.getUnicodeString(c,p));o.push({lang:l,country:u,text:f}),s+=n}return a===1?o[0].text:o}translateValue(e,t){return typeof e=="string"?t[e]||t[e.toLowerCase()]||e:t[e]||e}}H(ns,"type","icc"),H(ns,"multiSegment",!0),H(ns,"headerLength",18);const Rw={4:Rt,8:function(i,e){return[i.getUint8(e),i.getUint8(e+1)>>4,i.getUint8(e+1)%16].map(t=>t.toString(10)).join(".")},12:Rt,16:Rt,20:Rt,24:function(i,e){const t=i.getUint16(e),a=i.getUint16(e+2)-1,n=i.getUint16(e+4),s=i.getUint16(e+6),o=i.getUint16(e+8),r=i.getUint16(e+10);return new Date(Date.UTC(t,a,n,s,o,r))},36:Rt,40:Rt,48:Rt,52:Rt,64:(i,e)=>i.getUint32(e),80:Rt};function Rt(i,e){return mi(i.getString(e,4))}Te.set("icc",ns),Fe($e,"icc",[[4,"ProfileCMMType"],[8,"ProfileVersion"],[12,"ProfileClass"],[16,"ColorSpaceData"],[20,"ProfileConnectionSpace"],[24,"ProfileDateTime"],[36,"ProfileFileSignature"],[40,"PrimaryPlatform"],[44,"CMMFlags"],[48,"DeviceManufacturer"],[52,"DeviceModel"],[56,"DeviceAttributes"],[64,"RenderingIntent"],[68,"ConnectionSpaceIlluminant"],[80,"ProfileCreator"],[84,"ProfileID"],["Header","ProfileHeader"],["MS00","WCSProfiles"],["bTRC","BlueTRC"],["bXYZ","BlueMatrixColumn"],["bfd","UCRBG"],["bkpt","MediaBlackPoint"],["calt","CalibrationDateTime"],["chad","ChromaticAdaptation"],["chrm","Chromaticity"],["ciis","ColorimetricIntentImageState"],["clot","ColorantTableOut"],["clro","ColorantOrder"],["clrt","ColorantTable"],["cprt","ProfileCopyright"],["crdi","CRDInfo"],["desc","ProfileDescription"],["devs","DeviceSettings"],["dmdd","DeviceModelDesc"],["dmnd","DeviceMfgDesc"],["dscm","ProfileDescriptionML"],["fpce","FocalPlaneColorimetryEstimates"],["gTRC","GreenTRC"],["gXYZ","GreenMatrixColumn"],["gamt","Gamut"],["kTRC","GrayTRC"],["lumi","Luminance"],["meas","Measurement"],["meta","Metadata"],["mmod","MakeAndModel"],["ncl2","NamedColor2"],["ncol","NamedColor"],["ndin","NativeDisplayInfo"],["pre0","Preview0"],["pre1","Preview1"],["pre2","Preview2"],["ps2i","PS2RenderingIntent"],["ps2s","PostScript2CSA"],["psd0","PostScript2CRD0"],["psd1","PostScript2CRD1"],["psd2","PostScript2CRD2"],["psd3","PostScript2CRD3"],["pseq","ProfileSequenceDesc"],["psid","ProfileSequenceIdentifier"],["psvm","PS2CRDVMSize"],["rTRC","RedTRC"],["rXYZ","RedMatrixColumn"],["resp","OutputResponse"],["rhoc","ReflectionHardcopyOrigColorimetry"],["rig0","PerceptualRenderingIntentGamut"],["rig2","SaturationRenderingIntentGamut"],["rpoc","ReflectionPrintOutputColorimetry"],["sape","SceneAppearanceEstimates"],["scoe","SceneColorimetryEstimates"],["scrd","ScreeningDesc"],["scrn","Screening"],["targ","CharTarget"],["tech","Technology"],["vcgt","VideoCardGamma"],["view","ViewingConditions"],["vued","ViewingCondDesc"],["wtpt","MediaWhitePoint"]]);const jn={"4d2p":"Erdt Systems",AAMA:"Aamazing Technologies",ACER:"Acer",ACLT:"Acolyte Color Research",ACTI:"Actix Sytems",ADAR:"Adara Technology",ADBE:"Adobe",ADI:"ADI Systems",AGFA:"Agfa Graphics",ALMD:"Alps Electric",ALPS:"Alps Electric",ALWN:"Alwan Color Expertise",AMTI:"Amiable Technologies",AOC:"AOC International",APAG:"Apago",APPL:"Apple Computer",AST:"AST","AT&T":"AT&T",BAEL:"BARBIERI electronic",BRCO:"Barco NV",BRKP:"Breakpoint",BROT:"Brother",BULL:"Bull",BUS:"Bus Computer Systems","C-IT":"C-Itoh",CAMR:"Intel",CANO:"Canon",CARR:"Carroll Touch",CASI:"Casio",CBUS:"Colorbus PL",CEL:"Crossfield",CELx:"Crossfield",CGS:"CGS Publishing Technologies International",CHM:"Rochester Robotics",CIGL:"Colour Imaging Group, London",CITI:"Citizen",CL00:"Candela",CLIQ:"Color IQ",CMCO:"Chromaco",CMiX:"CHROMiX",COLO:"Colorgraphic Communications",COMP:"Compaq",COMp:"Compeq/Focus Technology",CONR:"Conrac Display Products",CORD:"Cordata Technologies",CPQ:"Compaq",CPRO:"ColorPro",CRN:"Cornerstone",CTX:"CTX International",CVIS:"ColorVision",CWC:"Fujitsu Laboratories",DARI:"Darius Technology",DATA:"Dataproducts",DCP:"Dry Creek Photo",DCRC:"Digital Contents Resource Center, Chung-Ang University",DELL:"Dell Computer",DIC:"Dainippon Ink and Chemicals",DICO:"Diconix",DIGI:"Digital","DL&C":"Digital Light & Color",DPLG:"Doppelganger",DS:"Dainippon Screen",DSOL:"DOOSOL",DUPN:"DuPont",EPSO:"Epson",ESKO:"Esko-Graphics",ETRI:"Electronics and Telecommunications Research Institute",EVER:"Everex Systems",EXAC:"ExactCODE",Eizo:"Eizo",FALC:"Falco Data Products",FF:"Fuji Photo Film",FFEI:"FujiFilm Electronic Imaging",FNRD:"Fnord Software",FORA:"Fora",FORE:"Forefront Technology",FP:"Fujitsu",FPA:"WayTech Development",FUJI:"Fujitsu",FX:"Fuji Xerox",GCC:"GCC Technologies",GGSL:"Global Graphics Software",GMB:"Gretagmacbeth",GMG:"GMG",GOLD:"GoldStar Technology",GOOG:"Google",GPRT:"Giantprint",GTMB:"Gretagmacbeth",GVC:"WayTech Development",GW2K:"Sony",HCI:"HCI",HDM:"Heidelberger Druckmaschinen",HERM:"Hermes",HITA:"Hitachi America",HP:"Hewlett-Packard",HTC:"Hitachi",HiTi:"HiTi Digital",IBM:"IBM",IDNT:"Scitex",IEC:"Hewlett-Packard",IIYA:"Iiyama North America",IKEG:"Ikegami Electronics",IMAG:"Image Systems",IMI:"Ingram Micro",INTC:"Intel",INTL:"N/A (INTL)",INTR:"Intra Electronics",IOCO:"Iocomm International Technology",IPS:"InfoPrint Solutions Company",IRIS:"Scitex",ISL:"Ichikawa Soft Laboratory",ITNL:"N/A (ITNL)",IVM:"IVM",IWAT:"Iwatsu Electric",Idnt:"Scitex",Inca:"Inca Digital Printers",Iris:"Scitex",JPEG:"Joint Photographic Experts Group",JSFT:"Jetsoft Development",JVC:"JVC Information Products",KART:"Scitex",KFC:"KFC Computek Components",KLH:"KLH Computers",KMHD:"Konica Minolta",KNCA:"Konica",KODA:"Kodak",KYOC:"Kyocera",Kart:"Scitex",LCAG:"Leica",LCCD:"Leeds Colour",LDAK:"Left Dakota",LEAD:"Leading Technology",LEXM:"Lexmark International",LINK:"Link Computer",LINO:"Linotronic",LITE:"Lite-On",Leaf:"Leaf",Lino:"Linotronic",MAGC:"Mag Computronic",MAGI:"MAG Innovision",MANN:"Mannesmann",MICN:"Micron Technology",MICR:"Microtek",MICV:"Microvitec",MINO:"Minolta",MITS:"Mitsubishi Electronics America",MITs:"Mitsuba",MNLT:"Minolta",MODG:"Modgraph",MONI:"Monitronix",MONS:"Monaco Systems",MORS:"Morse Technology",MOTI:"Motive Systems",MSFT:"Microsoft",MUTO:"MUTOH INDUSTRIES",Mits:"Mitsubishi Electric",NANA:"NANAO",NEC:"NEC",NEXP:"NexPress Solutions",NISS:"Nissei Sangyo America",NKON:"Nikon",NONE:"none",OCE:"Oce Technologies",OCEC:"OceColor",OKI:"Oki",OKID:"Okidata",OKIP:"Okidata",OLIV:"Olivetti",OLYM:"Olympus",ONYX:"Onyx Graphics",OPTI:"Optiquest",PACK:"Packard Bell",PANA:"Matsushita Electric Industrial",PANT:"Pantone",PBN:"Packard Bell",PFU:"PFU",PHIL:"Philips Consumer Electronics",PNTX:"HOYA",POne:"Phase One A/S",PREM:"Premier Computer Innovations",PRIN:"Princeton Graphic Systems",PRIP:"Princeton Publishing Labs",QLUX:"Hong Kong",QMS:"QMS",QPCD:"QPcard AB",QUAD:"QuadLaser",QUME:"Qume",RADI:"Radius",RDDx:"Integrated Color Solutions",RDG:"Roland DG",REDM:"REDMS Group",RELI:"Relisys",RGMS:"Rolf Gierling Multitools",RICO:"Ricoh",RNLD:"Edmund Ronald",ROYA:"Royal",RPC:"Ricoh Printing Systems",RTL:"Royal Information Electronics",SAMP:"Sampo",SAMS:"Samsung",SANT:"Jaime Santana Pomares",SCIT:"Scitex",SCRN:"Dainippon Screen",SDP:"Scitex",SEC:"Samsung",SEIK:"Seiko Instruments",SEIk:"Seikosha",SGUY:"ScanGuy.com",SHAR:"Sharp Laboratories",SICC:"International Color Consortium",SONY:"Sony",SPCL:"SpectraCal",STAR:"Star",STC:"Sampo Technology",Scit:"Scitex",Sdp:"Scitex",Sony:"Sony",TALO:"Talon Technology",TAND:"Tandy",TATU:"Tatung",TAXA:"TAXAN America",TDS:"Tokyo Denshi Sekei",TECO:"TECO Information Systems",TEGR:"Tegra",TEKT:"Tektronix",TI:"Texas Instruments",TMKR:"TypeMaker",TOSB:"Toshiba",TOSH:"Toshiba",TOTK:"TOTOKU ELECTRIC",TRIU:"Triumph",TSBT:"Toshiba",TTX:"TTX Computer Products",TVM:"TVM Professional Monitor",TW:"TW Casper",ULSX:"Ulead Systems",UNIS:"Unisys",UTZF:"Utz Fehlau & Sohn",VARI:"Varityper",VIEW:"Viewsonic",VISL:"Visual communication",VIVO:"Vivo Mobile Communication",WANG:"Wang",WLBR:"Wilbur Imaging",WTG2:"Ware To Go",WYSE:"WYSE Technology",XERX:"Xerox",XRIT:"X-Rite",ZRAN:"Zoran",Zebr:"Zebra Technologies",appl:"Apple Computer",bICC:"basICColor",berg:"bergdesign",ceyd:"Integrated Color Solutions",clsp:"MacDermid ColorSpan",ds:"Dainippon Screen",dupn:"DuPont",ffei:"FujiFilm Electronic Imaging",flux:"FluxData",iris:"Scitex",kart:"Scitex",lcms:"Little CMS",lino:"Linotronic",none:"none",ob4d:"Erdt Systems",obic:"Medigraph",quby:"Qubyx Sarl",scit:"Scitex",scrn:"Dainippon Screen",sdp:"Scitex",siwi:"SIWI GRAFIKA",yxym:"YxyMaster"},Xu={scnr:"Scanner",mntr:"Monitor",prtr:"Printer",link:"Device Link",abst:"Abstract",spac:"Color Space Conversion Profile",nmcl:"Named Color",cenc:"ColorEncodingSpace profile",mid:"MultiplexIdentification profile",mlnk:"MultiplexLink profile",mvis:"MultiplexVisualization profile",nkpf:"Nikon Input Device Profile (NON-STANDARD!)"};Fe(wi,"icc",[[4,jn],[12,Xu],[40,Object.assign({},jn,Xu)],[48,jn],[80,jn],[64,{0:"Perceptual",1:"Relative Colorimetric",2:"Saturation",3:"Absolute Colorimetric"}],["tech",{amd:"Active Matrix Display",crt:"Cathode Ray Tube Display",kpcd:"Photo CD",pmd:"Passive Matrix Display",dcam:"Digital Camera",dcpj:"Digital Cinema Projector",dmpc:"Digital Motion Picture Camera",dsub:"Dye Sublimation Printer",epho:"Electrophotographic Printer",esta:"Electrostatic Printer",flex:"Flexography",fprn:"Film Writer",fscn:"Film Scanner",grav:"Gravure",ijet:"Ink Jet Printer",imgs:"Photo Image Setter",mpfr:"Motion Picture Film Recorder",mpfs:"Motion Picture Film Scanner",offs:"Offset Lithography",pjtv:"Projection Television",rpho:"Photographic Paper Printer",rscn:"Reflective Scanner",silk:"Silkscreen",twax:"Thermal Wax Printer",vidc:"Video Camera",vidm:"Video Monitor"}]]);class $n extends ht{static canHandle(e,t,a){return e.getUint8(t+1)===237&&e.getString(t+4,9)==="Photoshop"&&this.containsIptc8bim(e,t,a)!==void 0}static headerLength(e,t,a){let n,s=this.containsIptc8bim(e,t,a);if(s!==void 0)return n=e.getUint8(t+s+7),n%2!=0&&(n+=1),n===0&&(n=4),s+8+n}static containsIptc8bim(e,t,a){for(let n=0;n<a;n++)if(this.isIptcSegmentHead(e,t+n))return n}static isIptcSegmentHead(e,t){return e.getUint8(t)===56&&e.getUint32(t)===943868237&&e.getUint16(t+4)===1028}parse(){let{raw:e}=this,t=this.chunk.byteLength-1,a=!1;for(let n=0;n<t;n++)if(this.chunk.getUint8(n)===28&&this.chunk.getUint8(n+1)===2){a=!0;let s=this.chunk.getUint16(n+3),o=this.chunk.getUint8(n+2),r=this.chunk.getLatin1String(n+5,s);e.set(o,this.pluralizeValue(e.get(o),r)),n+=4+s}else if(a)break;return this.translate(),this.output}pluralizeValue(e,t){return e!==void 0?e instanceof Array?(e.push(t),e):[e,t]:t}}H($n,"type","iptc"),H($n,"translateValues",!1),H($n,"reviveValues",!1),Te.set("iptc",$n),Fe($e,"iptc",[[0,"ApplicationRecordVersion"],[3,"ObjectTypeReference"],[4,"ObjectAttributeReference"],[5,"ObjectName"],[7,"EditStatus"],[8,"EditorialUpdate"],[10,"Urgency"],[12,"SubjectReference"],[15,"Category"],[20,"SupplementalCategories"],[22,"FixtureIdentifier"],[25,"Keywords"],[26,"ContentLocationCode"],[27,"ContentLocationName"],[30,"ReleaseDate"],[35,"ReleaseTime"],[37,"ExpirationDate"],[38,"ExpirationTime"],[40,"SpecialInstructions"],[42,"ActionAdvised"],[45,"ReferenceService"],[47,"ReferenceDate"],[50,"ReferenceNumber"],[55,"DateCreated"],[60,"TimeCreated"],[62,"DigitalCreationDate"],[63,"DigitalCreationTime"],[65,"OriginatingProgram"],[70,"ProgramVersion"],[75,"ObjectCycle"],[80,"Byline"],[85,"BylineTitle"],[90,"City"],[92,"Sublocation"],[95,"State"],[100,"CountryCode"],[101,"Country"],[103,"OriginalTransmissionReference"],[105,"Headline"],[110,"Credit"],[115,"Source"],[116,"CopyrightNotice"],[118,"Contact"],[120,"Caption"],[121,"LocalCaption"],[122,"Writer"],[125,"RasterizedCaption"],[130,"ImageType"],[131,"ImageOrientation"],[135,"LanguageIdentifier"],[150,"AudioType"],[151,"AudioSamplingRate"],[152,"AudioSamplingResolution"],[153,"AudioDuration"],[154,"AudioOutcue"],[184,"JobID"],[185,"MasterDocumentID"],[186,"ShortDocumentID"],[187,"UniqueDocumentID"],[188,"OwnerID"],[200,"ObjectPreviewFileFormat"],[201,"ObjectPreviewFileVersion"],[202,"ObjectPreviewData"],[221,"Prefs"],[225,"ClassifyState"],[228,"SimilarityIndex"],[230,"DocumentNotes"],[231,"DocumentHistory"],[232,"ExifCameraInfo"],[255,"CatalogSets"]]),Fe(wi,"iptc",[[10,{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"}],[75,{a:"Morning",b:"Both Morning and Evening",p:"Evening"}],[131,{L:"Landscape",P:"Portrait",S:"Square"}]]);const Hn={zip:ow,gz:Eo,tgz:Eo,deflate:Eo};class Uw extends ve{constructor(t,a){super(t,{...{},...a});Se(this,"setHashFileName",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s}=n,o=1024*1024*5,l=await s.slice(0,o).text(),u=new lw;u.append(l);const p=u.end(),c=La(n),f=`${p}${c?`.${c}`:""}`;this.uppy.setFileState(a,{hashFileName:f})}});Se(this,"setMetaData",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:{webkitRelativePath:s,relativePath:o,name:r},hashFileName:l,size:u}=n,p=o||s||r||l;this.uppy.setFileMeta(a,{relativePath:p,name:p})}});Se(this,"preventXssAttack",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{name:s,meta:o}=this.uppy.getFile(a),r=Rl.sanitize(s);if(s!==r){const u=La(n),p=r.endsWith(`.${u}`)?r:`${r}.${u}`;this.uppy.setFileState(a,{name:p,meta:{...o,name:p,filename:p}})}if(await Ix(n)){const{data:u,name:p,type:c}=this.uppy.getFile(a),f=await u.text(),b=Rl.sanitize(f,{USE_PROFILES:{svg:!0,svgFilters:!0},ALLOWED_TAGS:["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","use","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop"],ALLOWED_ATTR:["d","points","x","y","width","height","r","cx","cy","rx","ry","x1","y1","x2","y2","transform","fill","stroke","stroke-width","viewBox","xmlns","style","id","class","offset","stop-color","stop-opacity","clip-path","mask","fill-opacity","stroke-opacity"],FORBID_TAGS:["a","script","iframe","image","foreignObject"],FORBID_ATTR:["href","xlink:href","onclick","onload","onerror"]});if(f!==b){const S=new Blob([b],{type:c}),_=Co(S,p);this.uppy.setFileState(a,{...this.uppy.getFile(a),data:_}),console.info("clean svg file xss attack",{name:p,originalFile:n.data.text(),cleanFile:b})}}}});Se(this,"preventZipBombAttack",async t=>{const{id:a}=t,n=this.uppy.getFile(a);try{if(n&&Hn[n.extension]){const{data:s}=n,o=Hn[n.extension](new Uint8Array(await s.arrayBuffer())),r=(u,p,c=0)=>Object.entries(u instanceof Uint8Array?{[p||n.name]:u}:u).reduce((f,[b,S])=>{if(!S||S.byteLength===0)return console.warn("Invalid or empty item in unzipped content",{name:b,item:S}),f;const _=f+S.byteLength;if(c>=5||_>n.size*100)throw console.error("Zip bomb detected, please check your file",{depth:c,baseAcc:_,fileSize:n.size}),new Error("Zip bomb detected, please check your file");const w=tt.extension(tt.lookup(b));if(Hn[w]){const v=Hn[w](S);return _+r(v,b,c+1)}return _},0);if(r(o)>n.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}});Se(this,"validateImagesRespectCropperOptions",async()=>this.uppy.getFiles().reduce(async(t,a)=>{var _,w,v;await t;const{id:n}=a;let s=this.uppy.getFile(n);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(n)),!((_=this.opts.cropperOptions)!=null&&_.aspectRatio)||!((w=s==null?void 0:s.type)!=null&&w.includes("image"))||(v=s.type)!=null&&v.includes("image/svg"))return Promise.resolve();const{aspectRatio:o}=this.opts.cropperOptions,r=this.uppy.getPlugin("ImageEditor"),l=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+n).querySelector("img"),u=l==null?void 0:l.naturalWidth,p=l==null?void 0:l.naturalHeight,c=Number(u/p).toFixed(2),f=Number(o).toFixed(2);if(c===f)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),r.parent.openFileEditor(s);const S=this.i18n("aspectRatioMessage",{imageAspectRatio:c,aspectRatio:f});return this.uppy.info({message:S,details:S}),new Promise((x,h)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{x()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve()));Se(this,"checkImageOrientation",async t=>{var s;const{id:a}=t,n=this.uppy.getFile(a);if((s=n==null?void 0:n.type)!=null&&s.startsWith("image/"))try{if(!(await Cw(n.data).catch(()=>({deg:0}))).deg)return;const r=n.data.size*.98,l=await new Promise((v,x)=>{const h=new Image;let m=URL.createObjectURL(n.data);h.src=m,h.onload=()=>{URL.revokeObjectURL(m),m=null,v(h)},h.onerror=y=>{m&&(URL.revokeObjectURL(m),m=null),x(new Error(`Image load failed: ${y.message}`))}}),u=l.width/l.height;let p=Math.sqrt(r*u),c=p/u;const f=8096;if(p>f||c>f){const v=f/Math.max(p,c);p*=v,c*=v}const b=document.createElement("canvas");b.width=p,b.height=c;const S=b.getContext("2d",{willReadFrequently:!0,alpha:n.type==="image/png"});S.imageSmoothingEnabled=!0,S.imageSmoothingQuality="high",S.translate(b.width/2,b.height/2),S.drawImage(l,-p/2,-c/2,p,c);const _=1,w=await new Promise(v=>{b.toBlob(v,n.type,_)});this.uppy.setFileState(a,{data:w,size:w.size})}catch(o){console.error("Image rotation processing failed:",o);return}});Se(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.checkImageOrientation(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.preventXssAttack(t),await this.preventZipBombAttack(t),await this.setMetaData(t)});Se(this,"tryDownloadRemoteFile",async t=>{var m,y;const{type:a,name:n,preview:s,source:o,isRemote:r,isDownloading:l,id:u,isLoading:p,remote:c,meta:f,errorCount:b=0}=t,S=!p&&r,_=`uploader:${u}:downloaded`,w=La(t),v=(m=n==null?void 0:n.split("?"))==null?void 0:m[0],h=(()=>{const g=["jpg","jpeg"];return g.includes(w)&&g.some(k=>v==null?void 0:v.endsWith(k))?!0:v==null?void 0:v.endsWith(w)})()?v:`${v}${w?`.${w}`:""}`;if(S){const g=Cx(s||((y=c==null?void 0:c.body)==null?void 0:y.url));if(b>=3)throw this.uppy.setFileState(u,{error:this.i18n("downloadRemoteFileFailure"),meta:{...f,name:this.i18n("downloadRemoteFileFailure")}}),new Error("Download remote file failure");this.uppy.setFileState(u,{isLoading:!0,isDownloading:!0,size:null,meta:{...f,name:this.i18n("loading")}}),await fetch(g).then(async k=>await k.blob()).then(async k=>{const D=Co(k,h);this.uppy.setFileState(u,{name:h,extension:w,type:a,data:D,preview:s||Po(D),source:o,size:D.size,isDownloading:!1,isRemote:!1,meta:{...f,name:h,filename:h}}),this.uppy.getFile(u),this.uppy.emit(_,u)}).catch(async k=>{if(console.error("Axios download remote file error: ",k),a.startsWith("image/")){const D=a.includes("svg")?"image/png":a,A=h.endsWith(".svg")?h.replace(".svg",".png"):h;try{const U=await new Promise((V,$)=>{const B=new Image;B.crossOrigin="anonymous",B.onload=()=>{const F=document.createElement("canvas");F.width=B.width,F.height=B.height;const P=F.getContext("2d");P.translate(F.width/2,F.height/2),P.drawImage(B,-B.width/2,-B.height/2,B.width,B.height),F.toBlob(V,D)},B.onerror=$,B.src=g});let L=Co(U,A);this.uppy.setFileState(u,{name:A,extension:w,type:D,data:L,preview:s||Po(L),source:o,size:L.size,isDownloading:!1,isRemote:!1,meta:{...f,name:A,filename:A}});const X=this.uppy.getFile(u);this.uppy.emit(_,u);return}catch{}}this.uppy.setFileState(u,{isRemote:!0,isLoading:!1,errorCount:b+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(u))})}else l&&await(async()=>new Promise(k=>{this.uppy.once(_,async()=>{k()})}))()});Se(this,"getPreviewFromData",t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s,type:o,preview:r}=n;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(a,{preview:Po(s)})},o.indexOf("gif")>-1?1e3:0)}});Se(this,"prepareUpload",async t=>{await this.validateImagesRespectCropperOptions();const a=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),n=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(a).then(n)});this.id=this.opts.id||"PrepareUpload",this.type="progressindicator",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}render(){return le(Ox,{})}}class Mw extends ve{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>le("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:le("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[le("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),le("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return le("div",{id:"ai-image",className:"ai-image",children:le("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}class Lw extends ve{constructor(e,t){super(e,t),this.id=t.id,this.title=t.title,this.type="acquirer",this.uppy=e,this.i18nInit(),this.autoHide=t.autoHide??!0,typeof t.icon=="string"&&(this.icon=()=>le("div",{dangerouslySetInnerHTML:{__html:t.icon},style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}))}getDashboard(){var e;return(e=this.uppy.getPlugin(this.id))==null?void 0:e.parent}render(){var e;return this.autoHide&&((e=this.getDashboard())!=null&&e.hideAllPanels)&&this.getDashboard().hideAllPanels(),le("div",{id:this.id,className:"uppy-VirtualPlugin"})}update(){}onFirstRender(){}uninstall(){this.unmount()}}const Nw="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",Bw=Z.lazy(()=>Xh(()=>import("./index-C0btiQfG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),Ku="uploader-container",Lo="uploader-dashboard",zw='div[tabindex="-1"]',Yu=50,jw=10,jr=localStorage.getItem("uppy_debug"),$w=()=>Tr.get("x-csrf-token")?{"x-csrf-token":Tr.get("x-csrf-token")}:{},Hw=i=>{var f;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:a,resourcesProps:n,imageEditorProps:s={},theme:o,plugins:r}=i,{companionUrl:l}=wh(e),u=$w(),p=async b=>(await dn.post("/api/image/generations",b)).data,c={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:Wd,options:{quality:1,...s},alwayUse:!0},(jr||Na()&&t.Uploaded&&!Fu())&&{id:"Uploaded",plugin:Mx,options:{params:a==null?void 0:a.params}},(jr||Na()&&t.Resources&&!Fu())&&{id:"Resources",plugin:Nx,options:{params:n==null?void 0:n.params}},Na()&&Fx()&&t.AIImage&&{id:"AIImage",plugin:Mw,options:{companionUrl:l,companionHeaders:u},onShowPanel:b=>{function S(){setTimeout(()=>{var w,v;const _=document.getElementById("ai-image");_?df(_).render(Re.jsx(Bw,{theme:o,api:p,restrictions:c,i18n:(v=(w=b.current)==null?void 0:w.getUploader())==null?void 0:v.i18n,onSelect:x=>{const h=b.current.getUploader();h==null||h.emit("ai-image:selected",x),x.forEach(({src:m,alt:y},g)=>{const k=U=>(U==null?void 0:U.length)>16?`${U==null?void 0:U.slice(0,8)}...${U==null?void 0:U.slice(-4)}`:U,D=`${k(y)||k(m)}.png`,A={name:D,type:"image/png",data:Px(m,D),source:"AIImage",isRemote:!1};h==null||h.addFile(A)})}})):S()},100)}S()}},{id:"Url",plugin:rn,options:{companionUrl:l,companionHeaders:u}},{id:"Webcam",plugin:_p,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!((f=window==null?void 0:window.blocklet)!=null&&f.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:Wp,options:{companionUrl:l,companionHeaders:u,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:Uw,options:{companionUrl:l,companionHeaders:u,cropperOptions:(s==null?void 0:s.cropperOptions)||null},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:nl,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0},...(r||[]).filter(b=>b==null?void 0:b.id).map(b=>{const{id:S,options:_,onShowPanel:w}=b;return{id:S,plugin:Lw,options:_,onShowPanel:w}})].filter(Boolean)};function qw(i){const{id:e,plugins:t,locale:a="en",onAfterResponse:n,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:u,pluginList:p,restrictions:c,onChange:f,initialFiles:b}=i,S=ap(p,"id"),{uploaderUrl:_}=wh(r);let w=new Hr({id:e,meta:{uploaderId:e},debug:["true",!0].includes(jr||""),locale:is[a],onBeforeFileAdded:(h,m)=>{if(Object.hasOwn(m,h.id))return!1;const y=!!tt.extension(h.type),g=tt.lookup(h.name)||"";if(!y&&g&&g!==h.type){const k=La(h);k&&(h.extension=k),h.type=g}return h},...o,restrictions:c}).use(yh,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:_,async onBeforeRequest(h,m){var X,V;const{hashFileName:y,id:g,meta:k}=m,D=((X=w.getFile(g))==null?void 0:X.mockResponse)||null;h.getMethod()==="PATCH"&&D&&(h.send=()=>D);const A=La(m);h.setHeader("x-uploader-file-name",`${y}`),h.setHeader("x-uploader-file-id",`${g}`),h.setHeader("x-uploader-file-ext",`${A}`),h.setHeader("x-uploader-base-url",new URL(h.getURL()).pathname),h.setHeader("x-uploader-endpoint-url",_),h.setHeader("x-uploader-metadata",JSON.stringify(k,($,B)=>typeof B=="string"?encodeURIComponent(B):B));const U=Tr.get("x-csrf-token");U&&h.setHeader("x-csrf-token",U);const L=(window==null?void 0:window.uploaderComponentId)||((V=window==null?void 0:window.blocklet)==null?void 0:V.componentId);L&&h.setHeader("x-component-did",(L||"").split("/").pop())},onAfterResponse:async(h,m)=>{const y={},g=h.getUnderlyingObject();try{g.response&&(y.data=JSON.parse(g.response))}catch{y.data={}}y.method=h.getMethod().toUpperCase(),y.url=h.getURL(),y.status=g.status,y.headers={...h._headers};const k=g.getAllResponseHeaders();k&&k.split(`\r
76
+ Please create an issue at https://github.com/MikeKovarik/exifr with this file`),[this.file.getUintBytes(a+r,n),this.file.getUintBytes(a+r+n,s)];a+=S*p}}}class Mh extends Uh{}H(Mh,"type","heic");class Nu extends Uh{}H(Nu,"type","avif"),Bi.set("heic",Mh),Bi.set("avif",Nu),Fe($e,["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"]]),Fe($e,"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"]]),Fe($e,"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"]]),Fe(wi,["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"}]]);let za=Fe(wi,"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"}]]);const Bu={1:"No absolute unit of measurement",2:"Inch",3:"Centimeter"};za.set(37392,Bu),za.set(41488,Bu);const Oo={0:"Normal",1:"Low",2:"High"};function zu(i){return typeof i=="object"&&i.length!==void 0?i[0]:i}function ju(i){let e=Array.from(i).slice(1);return e[1]>15&&(e=e.map(t=>String.fromCharCode(t))),e[2]!=="0"&&e[2]!==0||e.pop(),e.join(".")}function Ro(i){if(typeof i=="string"){var[e,t,a,n,s,o]=i.trim().split(/[-: ]/g).map(Number),r=new Date(e,t-1,a);return Number.isNaN(n)||Number.isNaN(s)||Number.isNaN(o)||(r.setHours(n),r.setMinutes(s),r.setSeconds(o)),Number.isNaN(+r)?i:r}}function xa(i){if(typeof i=="string")return i;let e=[];if(i[1]===0&&i[i.length-1]===0)for(let t=0;t<i.length;t+=2)e.push($u(i[t+1],i[t]));else for(let t=0;t<i.length;t+=2)e.push($u(i[t],i[t+1]));return mi(String.fromCodePoint(...e))}function $u(i,e){return i<<8|e}za.set(41992,Oo),za.set(41993,Oo),za.set(41994,Oo),Fe(as,["ifd0","ifd1"],[[50827,function(i){return typeof i!="string"?Ih(i):i}],[306,Ro],[40091,xa],[40092,xa],[40093,xa],[40094,xa],[40095,xa]]),Fe(as,"exif",[[40960,ju],[36864,ju],[36867,Ro],[36868,Ro],[40962,zu],[40963,zu]]),Fe(as,"gps",[[0,i=>Array.from(i).join(".")],[7,i=>Array.from(i).join(":")]]);class Uo extends ht{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1752462448&&e.getString(t+4,20)==="http://ns.adobe.com/"}static headerLength(e,t){return e.getString(t+4,34)==="http://ns.adobe.com/xmp/extension/"?79:33}static findPosition(e,t){let a=super.findPosition(e,t);return a.multiSegment=a.extended=a.headerLength===79,a.multiSegment?(a.chunkCount=e.getUint8(t+72),a.chunkNumber=e.getUint8(t+76),e.getUint8(t+77)!==0&&a.chunkNumber++):(a.chunkCount=1/0,a.chunkNumber=-1),a}static handleMultiSegments(e){return e.map(t=>t.chunk.getString()).join("")}normalizeInput(e){return typeof e=="string"?e:je.from(e).getString()}parse(e=this.chunk){if(!this.localOptions.parse)return e;e=function(s){let o={},r={};for(let l of zh)o[l]=[],r[l]=0;return s.replace(Iw,(l,u,p)=>{if(u==="<"){let c=++r[p];return o[p].push(c),`${l}#${c}`}return`${l}#${o[p].pop()}`})}(e);let t=Mi.findAll(e,"rdf","Description");t.length===0&&t.push(new Mi("rdf","Description",void 0,e));let a,n={};for(let s of t)for(let o of s.properties)a=Ew(o.ns,n),Lh(o,a);return function(s){let o;for(let r in s)o=s[r]=ws(s[r]),o===void 0&&delete s[r];return ws(s)}(n)}assignToOutput(e,t){if(this.localOptions.parse)for(let[a,n]of Object.entries(t))switch(a){case"tiff":this.assignObjectToOutput(e,"ifd0",n);break;case"exif":this.assignObjectToOutput(e,"exif",n);break;case"xmlns":break;default:this.assignObjectToOutput(e,a,n)}else e.xmp=t}}H(Uo,"type","xmp"),H(Uo,"multiSegment",!0),Te.set("xmp",Uo);class Ps{static findAll(e){return Nh(e,/([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(Ps.unpackMatch)}static unpackMatch(e){let t=e[1],a=e[2],n=e[3].slice(1,-1);return n=Bh(n),new Ps(t,a,n)}constructor(e,t,a){this.ns=e,this.name=t,this.value=a}serialize(){return this.value}}class Mi{static findAll(e,t,a){if(t!==void 0||a!==void 0){t=t||"[\\w\\d-]+",a=a||"[\\w\\d-]+";var n=new RegExp(`<(${t}):(${a})(#\\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 Nh(e,n).map(Mi.unpackMatch)}static unpackMatch(e){let t=e[1],a=e[2],n=e[4],s=e[8];return new Mi(t,a,n,s)}constructor(e,t,a,n){this.ns=e,this.name=t,this.attrString=a,this.innerXml=n,this.attrs=Ps.findAll(a),this.children=Mi.findAll(n),this.value=this.children.length===0?Bh(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:e,name:t}=this;return e==="rdf"&&(t==="Seq"||t==="Bag"||t==="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 Dw(this.children.map(Tw));if(this.isListItem&&this.children.length===1&&this.attrs.length===0)return this.children[0].serialize();let e={};for(let t of this.properties)Lh(t,e);return this.value!==void 0&&(e.value=this.value),ws(e)}}function Lh(i,e){let t=i.serialize();t!==void 0&&(e[i.name]=t)}var Tw=i=>i.serialize(),Dw=i=>i.length===1?i[0]:i,Ew=(i,e)=>e[i]?e[i]:e[i]={};function Nh(i,e){let t,a=[];if(!i)return a;for(;(t=e.exec(i))!==null;)a.push(t);return a}function Bh(i){if(function(a){return a==null||a==="null"||a==="undefined"||a===""||a.trim()===""}(i))return;let e=Number(i);if(!Number.isNaN(e))return e;let t=i.toLowerCase();return t==="true"||t!=="false"&&i.trim()}const zh=["rdf:li","rdf:Seq","rdf:Bag","rdf:Alt","rdf:Description"],Iw=new RegExp(`(<|\\/)(${zh.join("|")})`,"g");let Hu=xs("fs",i=>i.promises);Hi.set("fs",class extends Rs{async readWhole(){this.chunked=!1,this.fs=await Hu;let i=await this.fs.readFile(this.input);this._swapBuffer(i)}async readChunked(){this.chunked=!0,this.fs=await Hu,await this.open(),await this.readChunk(0,this.options.firstChunkSize)}async open(){this.fh===void 0&&(this.fh=await this.fs.open(this.input,"r"),this.size=(await this.fh.stat(this.input)).size)}async _readChunk(i,e){this.fh===void 0&&await this.open(),i+e>this.size&&(e=this.size-i);var t=this.subarray(i,e,!0);return await this.fh.read(t.dataView,0,e,i),t}async close(){if(this.fh){let i=this.fh;this.fh=void 0,await i.close()}}});Hi.set("base64",class extends Rs{constructor(...i){super(...i),this.input=this.input.replace(/^data:([^;]+);base64,/gim,""),this.size=this.input.length/4*3,this.input.endsWith("==")?this.size-=2:this.input.endsWith("=")&&(this.size-=1)}async _readChunk(i,e){let t,a,n=this.input;i===void 0?(i=0,t=0,a=0):(t=4*Math.floor(i/3),a=i-t/4*3),e===void 0&&(e=this.size);let s=i+e,o=t+4*Math.ceil(s/3);n=n.slice(t,o);let r=Math.min(e,this.size-i);if(Cl){let l=Pl.from(n,"base64").slice(a,a+r);return this.set(l,i,!0)}{let l=this.subarray(i,r,!0),u=atob(n),p=l.toUint8();for(let c=0;c<r;c++)p[c]=u.charCodeAt(a+c);return l}}});class qu extends Os{static canHandle(e,t){return t===18761||t===19789}extendOptions(e){let{ifd0:t,xmp:a,iptc:n,icc:s}=e;a.enabled&&t.deps.add(700),n.enabled&&t.deps.add(33723),s.enabled&&t.deps.add(34675),t.finalizeFilters()}async parse(){let{tiff:e,xmp:t,iptc:a,icc:n}=this.options;if(e.enabled||t.enabled||a.enabled||n.enabled){let s=Math.max(Ar(this.options),this.options.chunkSize);await this.file.ensureChunk(0,s),this.createParser("tiff",this.file),this.parsers.tiff.parseHeader(),await this.parsers.tiff.parseIfd0Block(),this.adaptTiffPropAsSegment("xmp"),this.adaptTiffPropAsSegment("iptc"),this.adaptTiffPropAsSegment("icc")}}adaptTiffPropAsSegment(e){if(this.parsers.tiff[e]){let t=this.parsers.tiff[e];this.injectSegment(e,t)}}}H(qu,"type","tiff"),Bi.set("tiff",qu);let Aw=xs("zlib");const Ow=["ihdr","iccp","text","itxt","exif"];class Vu extends Os{constructor(...e){super(...e),H(this,"catchError",t=>this.errors.push(t)),H(this,"metaChunks",[]),H(this,"unknownChunks",[])}static canHandle(e,t){return t===35152&&e.getUint32(0)===2303741511&&e.getUint32(4)===218765834}async parse(){let{file:e}=this;await this.findPngChunksInRange(8,e.byteLength),await this.readSegments(this.metaChunks),this.findIhdr(),this.parseTextChunks(),await this.findExif().catch(this.catchError),await this.findXmp().catch(this.catchError),await this.findIcc().catch(this.catchError)}async findPngChunksInRange(e,t){let{file:a}=this;for(;e<t;){let n=a.getUint32(e),s=a.getUint32(e+4),o=a.getString(e+4,4).toLowerCase(),r=n+4+4+4,l={type:o,offset:e,length:r,start:e+4+4,size:n,marker:s};Ow.includes(o)?this.metaChunks.push(l):this.unknownChunks.push(l),e+=r}}parseTextChunks(){let e=this.metaChunks.filter(t=>t.type==="text");for(let t of e){let[a,n]=this.file.getString(t.start,t.size).split("\0");this.injectKeyValToIhdr(a,n)}}injectKeyValToIhdr(e,t){let a=this.parsers.ihdr;a&&a.raw.set(e,t)}findIhdr(){let e=this.metaChunks.find(t=>t.type==="ihdr");e&&this.options.ihdr.enabled!==!1&&this.createParser("ihdr",e.chunk)}async findExif(){let e=this.metaChunks.find(t=>t.type==="exif");e&&this.injectSegment("tiff",e.chunk)}async findXmp(){let e=this.metaChunks.filter(t=>t.type==="itxt");for(let t of e)t.chunk.getString(0,17)==="XML:com.adobe.xmp"&&this.injectSegment("xmp",t.chunk)}async findIcc(){let e=this.metaChunks.find(r=>r.type==="iccp");if(!e)return;let{chunk:t}=e,a=t.getUint8Array(0,81),n=0;for(;n<80&&a[n]!==0;)n++;let s=n+2,o=t.getString(0,n);if(this.injectKeyValToIhdr("ProfileName",o),ys){let r=await Aw,l=t.getUint8Array(s);l=r.inflateSync(l),this.injectSegment("icc",l)}}}H(Vu,"type","png"),Bi.set("png",Vu),Fe($e,"interop",[[1,"InteropIndex"],[2,"InteropVersion"],[4096,"RelatedImageFileFormat"],[4097,"RelatedImageWidth"],[4098,"RelatedImageHeight"]]),Br($e,"ifd0",[[11,"ProcessingSoftware"],[254,"SubfileType"],[255,"OldSubfileType"],[263,"Thresholding"],[264,"CellWidth"],[265,"CellLength"],[266,"FillOrder"],[269,"DocumentName"],[280,"MinSampleValue"],[281,"MaxSampleValue"],[285,"PageName"],[286,"XPosition"],[287,"YPosition"],[290,"GrayResponseUnit"],[297,"PageNumber"],[321,"HalftoneHints"],[322,"TileWidth"],[323,"TileLength"],[332,"InkSet"],[337,"TargetPrinter"],[18246,"Rating"],[18249,"RatingPercent"],[33550,"PixelScale"],[34264,"ModelTransform"],[34377,"PhotoshopSettings"],[50706,"DNGVersion"],[50707,"DNGBackwardVersion"],[50708,"UniqueCameraModel"],[50709,"LocalizedCameraModel"],[50736,"DNGLensInfo"],[50739,"ShadowScale"],[50740,"DNGPrivateData"],[33920,"IntergraphMatrix"],[33922,"ModelTiePoint"],[34118,"SEMInfo"],[34735,"GeoTiffDirectory"],[34736,"GeoTiffDoubleParams"],[34737,"GeoTiffAsciiParams"],[50341,"PrintIM"],[50721,"ColorMatrix1"],[50722,"ColorMatrix2"],[50723,"CameraCalibration1"],[50724,"CameraCalibration2"],[50725,"ReductionMatrix1"],[50726,"ReductionMatrix2"],[50727,"AnalogBalance"],[50728,"AsShotNeutral"],[50729,"AsShotWhiteXY"],[50730,"BaselineExposure"],[50731,"BaselineNoise"],[50732,"BaselineSharpness"],[50734,"LinearResponseLimit"],[50735,"CameraSerialNumber"],[50741,"MakerNoteSafety"],[50778,"CalibrationIlluminant1"],[50779,"CalibrationIlluminant2"],[50781,"RawDataUniqueID"],[50827,"OriginalRawFileName"],[50828,"OriginalRawFileData"],[50831,"AsShotICCProfile"],[50832,"AsShotPreProfileMatrix"],[50833,"CurrentICCProfile"],[50834,"CurrentPreProfileMatrix"],[50879,"ColorimetricReference"],[50885,"SRawType"],[50898,"PanasonicTitle"],[50899,"PanasonicTitle2"],[50931,"CameraCalibrationSig"],[50932,"ProfileCalibrationSig"],[50933,"ProfileIFD"],[50934,"AsShotProfileName"],[50936,"ProfileName"],[50937,"ProfileHueSatMapDims"],[50938,"ProfileHueSatMapData1"],[50939,"ProfileHueSatMapData2"],[50940,"ProfileToneCurve"],[50941,"ProfileEmbedPolicy"],[50942,"ProfileCopyright"],[50964,"ForwardMatrix1"],[50965,"ForwardMatrix2"],[50966,"PreviewApplicationName"],[50967,"PreviewApplicationVersion"],[50968,"PreviewSettingsName"],[50969,"PreviewSettingsDigest"],[50970,"PreviewColorSpace"],[50971,"PreviewDateTime"],[50972,"RawImageDigest"],[50973,"OriginalRawFileDigest"],[50981,"ProfileLookTableDims"],[50982,"ProfileLookTableData"],[51043,"TimeCodes"],[51044,"FrameRate"],[51058,"TStop"],[51081,"ReelName"],[51089,"OriginalDefaultFinalSize"],[51090,"OriginalBestQualitySize"],[51091,"OriginalDefaultCropSize"],[51105,"CameraLabel"],[51107,"ProfileHueSatMapEncoding"],[51108,"ProfileLookTableEncoding"],[51109,"BaselineExposureOffset"],[51110,"DefaultBlackRender"],[51111,"NewRawImageDigest"],[51112,"RawToPreviewGain"]]);let Wu=[[273,"StripOffsets"],[279,"StripByteCounts"],[288,"FreeOffsets"],[289,"FreeByteCounts"],[291,"GrayResponseCurve"],[292,"T4Options"],[293,"T6Options"],[300,"ColorResponseUnit"],[320,"ColorMap"],[324,"TileOffsets"],[325,"TileByteCounts"],[326,"BadFaxLines"],[327,"CleanFaxData"],[328,"ConsecutiveBadFaxLines"],[330,"SubIFD"],[333,"InkNames"],[334,"NumberofInks"],[336,"DotRange"],[338,"ExtraSamples"],[339,"SampleFormat"],[340,"SMinSampleValue"],[341,"SMaxSampleValue"],[342,"TransferRange"],[343,"ClipPath"],[344,"XClipPathUnits"],[345,"YClipPathUnits"],[346,"Indexed"],[347,"JPEGTables"],[351,"OPIProxy"],[400,"GlobalParametersIFD"],[401,"ProfileType"],[402,"FaxProfile"],[403,"CodingMethods"],[404,"VersionYear"],[405,"ModeNumber"],[433,"Decode"],[434,"DefaultImageColor"],[435,"T82Options"],[437,"JPEGTables"],[512,"JPEGProc"],[515,"JPEGRestartInterval"],[517,"JPEGLosslessPredictors"],[518,"JPEGPointTransforms"],[519,"JPEGQTables"],[520,"JPEGDCTables"],[521,"JPEGACTables"],[559,"StripRowCounts"],[999,"USPTOMiscellaneous"],[18247,"XP_DIP_XML"],[18248,"StitchInfo"],[28672,"SonyRawFileType"],[28688,"SonyToneCurve"],[28721,"VignettingCorrection"],[28722,"VignettingCorrParams"],[28724,"ChromaticAberrationCorrection"],[28725,"ChromaticAberrationCorrParams"],[28726,"DistortionCorrection"],[28727,"DistortionCorrParams"],[29895,"SonyCropTopLeft"],[29896,"SonyCropSize"],[32781,"ImageID"],[32931,"WangTag1"],[32932,"WangAnnotation"],[32933,"WangTag3"],[32934,"WangTag4"],[32953,"ImageReferencePoints"],[32954,"RegionXformTackPoint"],[32955,"WarpQuadrilateral"],[32956,"AffineTransformMat"],[32995,"Matteing"],[32996,"DataType"],[32997,"ImageDepth"],[32998,"TileDepth"],[33300,"ImageFullWidth"],[33301,"ImageFullHeight"],[33302,"TextureFormat"],[33303,"WrapModes"],[33304,"FovCot"],[33305,"MatrixWorldToScreen"],[33306,"MatrixWorldToCamera"],[33405,"Model2"],[33421,"CFARepeatPatternDim"],[33422,"CFAPattern2"],[33423,"BatteryLevel"],[33424,"KodakIFD"],[33445,"MDFileTag"],[33446,"MDScalePixel"],[33447,"MDColorTable"],[33448,"MDLabName"],[33449,"MDSampleInfo"],[33450,"MDPrepDate"],[33451,"MDPrepTime"],[33452,"MDFileUnits"],[33589,"AdventScale"],[33590,"AdventRevision"],[33628,"UIC1Tag"],[33629,"UIC2Tag"],[33630,"UIC3Tag"],[33631,"UIC4Tag"],[33918,"IntergraphPacketData"],[33919,"IntergraphFlagRegisters"],[33921,"INGRReserved"],[34016,"Site"],[34017,"ColorSequence"],[34018,"IT8Header"],[34019,"RasterPadding"],[34020,"BitsPerRunLength"],[34021,"BitsPerExtendedRunLength"],[34022,"ColorTable"],[34023,"ImageColorIndicator"],[34024,"BackgroundColorIndicator"],[34025,"ImageColorValue"],[34026,"BackgroundColorValue"],[34027,"PixelIntensityRange"],[34028,"TransparencyIndicator"],[34029,"ColorCharacterization"],[34030,"HCUsage"],[34031,"TrapIndicator"],[34032,"CMYKEquivalent"],[34152,"AFCP_IPTC"],[34232,"PixelMagicJBIGOptions"],[34263,"JPLCartoIFD"],[34306,"WB_GRGBLevels"],[34310,"LeafData"],[34687,"TIFF_FXExtensions"],[34688,"MultiProfiles"],[34689,"SharedData"],[34690,"T88Options"],[34732,"ImageLayer"],[34750,"JBIGOptions"],[34856,"Opto-ElectricConvFactor"],[34857,"Interlace"],[34908,"FaxRecvParams"],[34909,"FaxSubAddress"],[34910,"FaxRecvTime"],[34929,"FedexEDR"],[34954,"LeafSubIFD"],[37387,"FlashEnergy"],[37388,"SpatialFrequencyResponse"],[37389,"Noise"],[37390,"FocalPlaneXResolution"],[37391,"FocalPlaneYResolution"],[37392,"FocalPlaneResolutionUnit"],[37397,"ExposureIndex"],[37398,"TIFF-EPStandardID"],[37399,"SensingMethod"],[37434,"CIP3DataFile"],[37435,"CIP3Sheet"],[37436,"CIP3Side"],[37439,"StoNits"],[37679,"MSDocumentText"],[37680,"MSPropertySetStorage"],[37681,"MSDocumentTextPosition"],[37724,"ImageSourceData"],[40965,"InteropIFD"],[40976,"SamsungRawPointersOffset"],[40977,"SamsungRawPointersLength"],[41217,"SamsungRawByteOrder"],[41218,"SamsungRawUnknown"],[41484,"SpatialFrequencyResponse"],[41485,"Noise"],[41489,"ImageNumber"],[41490,"SecurityClassification"],[41491,"ImageHistory"],[41494,"TIFF-EPStandardID"],[41995,"DeviceSettingDescription"],[42112,"GDALMetadata"],[42113,"GDALNoData"],[44992,"ExpandSoftware"],[44993,"ExpandLens"],[44994,"ExpandFilm"],[44995,"ExpandFilterLens"],[44996,"ExpandScanner"],[44997,"ExpandFlashLamp"],[46275,"HasselbladRawImage"],[48129,"PixelFormat"],[48130,"Transformation"],[48131,"Uncompressed"],[48132,"ImageType"],[48256,"ImageWidth"],[48257,"ImageHeight"],[48258,"WidthResolution"],[48259,"HeightResolution"],[48320,"ImageOffset"],[48321,"ImageByteCount"],[48322,"AlphaOffset"],[48323,"AlphaByteCount"],[48324,"ImageDataDiscard"],[48325,"AlphaDataDiscard"],[50215,"OceScanjobDesc"],[50216,"OceApplicationSelector"],[50217,"OceIDNumber"],[50218,"OceImageLogic"],[50255,"Annotations"],[50459,"HasselbladExif"],[50547,"OriginalFileName"],[50560,"USPTOOriginalContentType"],[50656,"CR2CFAPattern"],[50710,"CFAPlaneColor"],[50711,"CFALayout"],[50712,"LinearizationTable"],[50713,"BlackLevelRepeatDim"],[50714,"BlackLevel"],[50715,"BlackLevelDeltaH"],[50716,"BlackLevelDeltaV"],[50717,"WhiteLevel"],[50718,"DefaultScale"],[50719,"DefaultCropOrigin"],[50720,"DefaultCropSize"],[50733,"BayerGreenSplit"],[50737,"ChromaBlurRadius"],[50738,"AntiAliasStrength"],[50752,"RawImageSegmentation"],[50780,"BestQualityScale"],[50784,"AliasLayerMetadata"],[50829,"ActiveArea"],[50830,"MaskedAreas"],[50935,"NoiseReductionApplied"],[50974,"SubTileBlockSize"],[50975,"RowInterleaveFactor"],[51008,"OpcodeList1"],[51009,"OpcodeList2"],[51022,"OpcodeList3"],[51041,"NoiseProfile"],[51114,"CacheVersion"],[51125,"DefaultUserCrop"],[51157,"NikonNEFInfo"],[65024,"KdcIFD"]];Br($e,"ifd0",Wu),Br($e,"exif",Wu),Fe(wi,"gps",[[23,{M:"Magnetic North",T:"True North"}],[25,{K:"Kilometers",M:"Miles",N:"Nautical Miles"}]]);class Mo extends ht{static canHandle(e,t){return e.getUint8(t+1)===224&&e.getUint32(t+4)===1246120262&&e.getUint8(t+8)===0}parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint16(0)],[2,this.chunk.getUint8(2)],[3,this.chunk.getUint16(3)],[5,this.chunk.getUint16(5)],[7,this.chunk.getUint8(7)],[8,this.chunk.getUint8(8)]])}}H(Mo,"type","jfif"),H(Mo,"headerLength",9),Te.set("jfif",Mo),Fe($e,"jfif",[[0,"JFIFVersion"],[2,"ResolutionUnit"],[3,"XResolution"],[5,"YResolution"],[7,"ThumbnailWidth"],[8,"ThumbnailHeight"]]);class Gu extends ht{parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint32(0)],[4,this.chunk.getUint32(4)],[8,this.chunk.getUint8(8)],[9,this.chunk.getUint8(9)],[10,this.chunk.getUint8(10)],[11,this.chunk.getUint8(11)],[12,this.chunk.getUint8(12)],...Array.from(this.raw)])}}H(Gu,"type","ihdr"),Te.set("ihdr",Gu),Fe($e,"ihdr",[[0,"ImageWidth"],[4,"ImageHeight"],[8,"BitDepth"],[9,"ColorType"],[10,"Compression"],[11,"Filter"],[12,"Interlace"]]),Fe(wi,"ihdr",[[9,{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha",DEFAULT:"Unknown"}],[10,{0:"Deflate/Inflate",DEFAULT:"Unknown"}],[11,{0:"Adaptive",DEFAULT:"Unknown"}],[12,{0:"Noninterlaced",1:"Adam7 Interlace",DEFAULT:"Unknown"}]]);class ns extends ht{static canHandle(e,t){return e.getUint8(t+1)===226&&e.getUint32(t+4)===1229144927}static findPosition(e,t){let a=super.findPosition(e,t);return a.chunkNumber=e.getUint8(t+16),a.chunkCount=e.getUint8(t+17),a.multiSegment=a.chunkCount>1,a}static handleMultiSegments(e){return function(t){let a=function(n){let s=n[0].constructor,o=0;for(let u of n)o+=u.length;let r=new s(o),l=0;for(let u of n)r.set(u,l),l+=u.length;return r}(t.map(n=>n.chunk.toUint8()));return new je(a)}(e)}parse(){return this.raw=new Map,this.parseHeader(),this.parseTags(),this.translate(),this.output}parseHeader(){let{raw:e}=this;this.chunk.byteLength<84&&me("ICC header is too short");for(let[t,a]of Object.entries(Rw)){t=parseInt(t,10);let n=a(this.chunk,t);n!=="\0\0\0\0"&&e.set(t,n)}}parseTags(){let e,t,a,n,s,{raw:o}=this,r=this.chunk.getUint32(128),l=132,u=this.chunk.byteLength;for(;r--;){if(e=this.chunk.getString(l,4),t=this.chunk.getUint32(l+4),a=this.chunk.getUint32(l+8),n=this.chunk.getString(t,4),t+a>u)return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");s=this.parseTag(n,t,a),s!==void 0&&s!=="\0\0\0\0"&&o.set(e,s),l+=12}}parseTag(e,t,a){switch(e){case"desc":return this.parseDesc(t);case"mluc":return this.parseMluc(t);case"text":return this.parseText(t,a);case"sig ":return this.parseSig(t)}if(!(t+a>this.chunk.byteLength))return this.chunk.getUint8Array(t,a)}parseDesc(e){let t=this.chunk.getUint32(e+8)-1;return mi(this.chunk.getString(e+12,t))}parseText(e,t){return mi(this.chunk.getString(e+8,t-8))}parseSig(e){return mi(this.chunk.getString(e+8,4))}parseMluc(e){let{chunk:t}=this,a=t.getUint32(e+8),n=t.getUint32(e+12),s=e+16,o=[];for(let r=0;r<a;r++){let l=t.getString(s+0,2),u=t.getString(s+2,2),p=t.getUint32(s+4),c=t.getUint32(s+8)+e,f=mi(t.getUnicodeString(c,p));o.push({lang:l,country:u,text:f}),s+=n}return a===1?o[0].text:o}translateValue(e,t){return typeof e=="string"?t[e]||t[e.toLowerCase()]||e:t[e]||e}}H(ns,"type","icc"),H(ns,"multiSegment",!0),H(ns,"headerLength",18);const Rw={4:Rt,8:function(i,e){return[i.getUint8(e),i.getUint8(e+1)>>4,i.getUint8(e+1)%16].map(t=>t.toString(10)).join(".")},12:Rt,16:Rt,20:Rt,24:function(i,e){const t=i.getUint16(e),a=i.getUint16(e+2)-1,n=i.getUint16(e+4),s=i.getUint16(e+6),o=i.getUint16(e+8),r=i.getUint16(e+10);return new Date(Date.UTC(t,a,n,s,o,r))},36:Rt,40:Rt,48:Rt,52:Rt,64:(i,e)=>i.getUint32(e),80:Rt};function Rt(i,e){return mi(i.getString(e,4))}Te.set("icc",ns),Fe($e,"icc",[[4,"ProfileCMMType"],[8,"ProfileVersion"],[12,"ProfileClass"],[16,"ColorSpaceData"],[20,"ProfileConnectionSpace"],[24,"ProfileDateTime"],[36,"ProfileFileSignature"],[40,"PrimaryPlatform"],[44,"CMMFlags"],[48,"DeviceManufacturer"],[52,"DeviceModel"],[56,"DeviceAttributes"],[64,"RenderingIntent"],[68,"ConnectionSpaceIlluminant"],[80,"ProfileCreator"],[84,"ProfileID"],["Header","ProfileHeader"],["MS00","WCSProfiles"],["bTRC","BlueTRC"],["bXYZ","BlueMatrixColumn"],["bfd","UCRBG"],["bkpt","MediaBlackPoint"],["calt","CalibrationDateTime"],["chad","ChromaticAdaptation"],["chrm","Chromaticity"],["ciis","ColorimetricIntentImageState"],["clot","ColorantTableOut"],["clro","ColorantOrder"],["clrt","ColorantTable"],["cprt","ProfileCopyright"],["crdi","CRDInfo"],["desc","ProfileDescription"],["devs","DeviceSettings"],["dmdd","DeviceModelDesc"],["dmnd","DeviceMfgDesc"],["dscm","ProfileDescriptionML"],["fpce","FocalPlaneColorimetryEstimates"],["gTRC","GreenTRC"],["gXYZ","GreenMatrixColumn"],["gamt","Gamut"],["kTRC","GrayTRC"],["lumi","Luminance"],["meas","Measurement"],["meta","Metadata"],["mmod","MakeAndModel"],["ncl2","NamedColor2"],["ncol","NamedColor"],["ndin","NativeDisplayInfo"],["pre0","Preview0"],["pre1","Preview1"],["pre2","Preview2"],["ps2i","PS2RenderingIntent"],["ps2s","PostScript2CSA"],["psd0","PostScript2CRD0"],["psd1","PostScript2CRD1"],["psd2","PostScript2CRD2"],["psd3","PostScript2CRD3"],["pseq","ProfileSequenceDesc"],["psid","ProfileSequenceIdentifier"],["psvm","PS2CRDVMSize"],["rTRC","RedTRC"],["rXYZ","RedMatrixColumn"],["resp","OutputResponse"],["rhoc","ReflectionHardcopyOrigColorimetry"],["rig0","PerceptualRenderingIntentGamut"],["rig2","SaturationRenderingIntentGamut"],["rpoc","ReflectionPrintOutputColorimetry"],["sape","SceneAppearanceEstimates"],["scoe","SceneColorimetryEstimates"],["scrd","ScreeningDesc"],["scrn","Screening"],["targ","CharTarget"],["tech","Technology"],["vcgt","VideoCardGamma"],["view","ViewingConditions"],["vued","ViewingCondDesc"],["wtpt","MediaWhitePoint"]]);const jn={"4d2p":"Erdt Systems",AAMA:"Aamazing Technologies",ACER:"Acer",ACLT:"Acolyte Color Research",ACTI:"Actix Sytems",ADAR:"Adara Technology",ADBE:"Adobe",ADI:"ADI Systems",AGFA:"Agfa Graphics",ALMD:"Alps Electric",ALPS:"Alps Electric",ALWN:"Alwan Color Expertise",AMTI:"Amiable Technologies",AOC:"AOC International",APAG:"Apago",APPL:"Apple Computer",AST:"AST","AT&T":"AT&T",BAEL:"BARBIERI electronic",BRCO:"Barco NV",BRKP:"Breakpoint",BROT:"Brother",BULL:"Bull",BUS:"Bus Computer Systems","C-IT":"C-Itoh",CAMR:"Intel",CANO:"Canon",CARR:"Carroll Touch",CASI:"Casio",CBUS:"Colorbus PL",CEL:"Crossfield",CELx:"Crossfield",CGS:"CGS Publishing Technologies International",CHM:"Rochester Robotics",CIGL:"Colour Imaging Group, London",CITI:"Citizen",CL00:"Candela",CLIQ:"Color IQ",CMCO:"Chromaco",CMiX:"CHROMiX",COLO:"Colorgraphic Communications",COMP:"Compaq",COMp:"Compeq/Focus Technology",CONR:"Conrac Display Products",CORD:"Cordata Technologies",CPQ:"Compaq",CPRO:"ColorPro",CRN:"Cornerstone",CTX:"CTX International",CVIS:"ColorVision",CWC:"Fujitsu Laboratories",DARI:"Darius Technology",DATA:"Dataproducts",DCP:"Dry Creek Photo",DCRC:"Digital Contents Resource Center, Chung-Ang University",DELL:"Dell Computer",DIC:"Dainippon Ink and Chemicals",DICO:"Diconix",DIGI:"Digital","DL&C":"Digital Light & Color",DPLG:"Doppelganger",DS:"Dainippon Screen",DSOL:"DOOSOL",DUPN:"DuPont",EPSO:"Epson",ESKO:"Esko-Graphics",ETRI:"Electronics and Telecommunications Research Institute",EVER:"Everex Systems",EXAC:"ExactCODE",Eizo:"Eizo",FALC:"Falco Data Products",FF:"Fuji Photo Film",FFEI:"FujiFilm Electronic Imaging",FNRD:"Fnord Software",FORA:"Fora",FORE:"Forefront Technology",FP:"Fujitsu",FPA:"WayTech Development",FUJI:"Fujitsu",FX:"Fuji Xerox",GCC:"GCC Technologies",GGSL:"Global Graphics Software",GMB:"Gretagmacbeth",GMG:"GMG",GOLD:"GoldStar Technology",GOOG:"Google",GPRT:"Giantprint",GTMB:"Gretagmacbeth",GVC:"WayTech Development",GW2K:"Sony",HCI:"HCI",HDM:"Heidelberger Druckmaschinen",HERM:"Hermes",HITA:"Hitachi America",HP:"Hewlett-Packard",HTC:"Hitachi",HiTi:"HiTi Digital",IBM:"IBM",IDNT:"Scitex",IEC:"Hewlett-Packard",IIYA:"Iiyama North America",IKEG:"Ikegami Electronics",IMAG:"Image Systems",IMI:"Ingram Micro",INTC:"Intel",INTL:"N/A (INTL)",INTR:"Intra Electronics",IOCO:"Iocomm International Technology",IPS:"InfoPrint Solutions Company",IRIS:"Scitex",ISL:"Ichikawa Soft Laboratory",ITNL:"N/A (ITNL)",IVM:"IVM",IWAT:"Iwatsu Electric",Idnt:"Scitex",Inca:"Inca Digital Printers",Iris:"Scitex",JPEG:"Joint Photographic Experts Group",JSFT:"Jetsoft Development",JVC:"JVC Information Products",KART:"Scitex",KFC:"KFC Computek Components",KLH:"KLH Computers",KMHD:"Konica Minolta",KNCA:"Konica",KODA:"Kodak",KYOC:"Kyocera",Kart:"Scitex",LCAG:"Leica",LCCD:"Leeds Colour",LDAK:"Left Dakota",LEAD:"Leading Technology",LEXM:"Lexmark International",LINK:"Link Computer",LINO:"Linotronic",LITE:"Lite-On",Leaf:"Leaf",Lino:"Linotronic",MAGC:"Mag Computronic",MAGI:"MAG Innovision",MANN:"Mannesmann",MICN:"Micron Technology",MICR:"Microtek",MICV:"Microvitec",MINO:"Minolta",MITS:"Mitsubishi Electronics America",MITs:"Mitsuba",MNLT:"Minolta",MODG:"Modgraph",MONI:"Monitronix",MONS:"Monaco Systems",MORS:"Morse Technology",MOTI:"Motive Systems",MSFT:"Microsoft",MUTO:"MUTOH INDUSTRIES",Mits:"Mitsubishi Electric",NANA:"NANAO",NEC:"NEC",NEXP:"NexPress Solutions",NISS:"Nissei Sangyo America",NKON:"Nikon",NONE:"none",OCE:"Oce Technologies",OCEC:"OceColor",OKI:"Oki",OKID:"Okidata",OKIP:"Okidata",OLIV:"Olivetti",OLYM:"Olympus",ONYX:"Onyx Graphics",OPTI:"Optiquest",PACK:"Packard Bell",PANA:"Matsushita Electric Industrial",PANT:"Pantone",PBN:"Packard Bell",PFU:"PFU",PHIL:"Philips Consumer Electronics",PNTX:"HOYA",POne:"Phase One A/S",PREM:"Premier Computer Innovations",PRIN:"Princeton Graphic Systems",PRIP:"Princeton Publishing Labs",QLUX:"Hong Kong",QMS:"QMS",QPCD:"QPcard AB",QUAD:"QuadLaser",QUME:"Qume",RADI:"Radius",RDDx:"Integrated Color Solutions",RDG:"Roland DG",REDM:"REDMS Group",RELI:"Relisys",RGMS:"Rolf Gierling Multitools",RICO:"Ricoh",RNLD:"Edmund Ronald",ROYA:"Royal",RPC:"Ricoh Printing Systems",RTL:"Royal Information Electronics",SAMP:"Sampo",SAMS:"Samsung",SANT:"Jaime Santana Pomares",SCIT:"Scitex",SCRN:"Dainippon Screen",SDP:"Scitex",SEC:"Samsung",SEIK:"Seiko Instruments",SEIk:"Seikosha",SGUY:"ScanGuy.com",SHAR:"Sharp Laboratories",SICC:"International Color Consortium",SONY:"Sony",SPCL:"SpectraCal",STAR:"Star",STC:"Sampo Technology",Scit:"Scitex",Sdp:"Scitex",Sony:"Sony",TALO:"Talon Technology",TAND:"Tandy",TATU:"Tatung",TAXA:"TAXAN America",TDS:"Tokyo Denshi Sekei",TECO:"TECO Information Systems",TEGR:"Tegra",TEKT:"Tektronix",TI:"Texas Instruments",TMKR:"TypeMaker",TOSB:"Toshiba",TOSH:"Toshiba",TOTK:"TOTOKU ELECTRIC",TRIU:"Triumph",TSBT:"Toshiba",TTX:"TTX Computer Products",TVM:"TVM Professional Monitor",TW:"TW Casper",ULSX:"Ulead Systems",UNIS:"Unisys",UTZF:"Utz Fehlau & Sohn",VARI:"Varityper",VIEW:"Viewsonic",VISL:"Visual communication",VIVO:"Vivo Mobile Communication",WANG:"Wang",WLBR:"Wilbur Imaging",WTG2:"Ware To Go",WYSE:"WYSE Technology",XERX:"Xerox",XRIT:"X-Rite",ZRAN:"Zoran",Zebr:"Zebra Technologies",appl:"Apple Computer",bICC:"basICColor",berg:"bergdesign",ceyd:"Integrated Color Solutions",clsp:"MacDermid ColorSpan",ds:"Dainippon Screen",dupn:"DuPont",ffei:"FujiFilm Electronic Imaging",flux:"FluxData",iris:"Scitex",kart:"Scitex",lcms:"Little CMS",lino:"Linotronic",none:"none",ob4d:"Erdt Systems",obic:"Medigraph",quby:"Qubyx Sarl",scit:"Scitex",scrn:"Dainippon Screen",sdp:"Scitex",siwi:"SIWI GRAFIKA",yxym:"YxyMaster"},Xu={scnr:"Scanner",mntr:"Monitor",prtr:"Printer",link:"Device Link",abst:"Abstract",spac:"Color Space Conversion Profile",nmcl:"Named Color",cenc:"ColorEncodingSpace profile",mid:"MultiplexIdentification profile",mlnk:"MultiplexLink profile",mvis:"MultiplexVisualization profile",nkpf:"Nikon Input Device Profile (NON-STANDARD!)"};Fe(wi,"icc",[[4,jn],[12,Xu],[40,Object.assign({},jn,Xu)],[48,jn],[80,jn],[64,{0:"Perceptual",1:"Relative Colorimetric",2:"Saturation",3:"Absolute Colorimetric"}],["tech",{amd:"Active Matrix Display",crt:"Cathode Ray Tube Display",kpcd:"Photo CD",pmd:"Passive Matrix Display",dcam:"Digital Camera",dcpj:"Digital Cinema Projector",dmpc:"Digital Motion Picture Camera",dsub:"Dye Sublimation Printer",epho:"Electrophotographic Printer",esta:"Electrostatic Printer",flex:"Flexography",fprn:"Film Writer",fscn:"Film Scanner",grav:"Gravure",ijet:"Ink Jet Printer",imgs:"Photo Image Setter",mpfr:"Motion Picture Film Recorder",mpfs:"Motion Picture Film Scanner",offs:"Offset Lithography",pjtv:"Projection Television",rpho:"Photographic Paper Printer",rscn:"Reflective Scanner",silk:"Silkscreen",twax:"Thermal Wax Printer",vidc:"Video Camera",vidm:"Video Monitor"}]]);class $n extends ht{static canHandle(e,t,a){return e.getUint8(t+1)===237&&e.getString(t+4,9)==="Photoshop"&&this.containsIptc8bim(e,t,a)!==void 0}static headerLength(e,t,a){let n,s=this.containsIptc8bim(e,t,a);if(s!==void 0)return n=e.getUint8(t+s+7),n%2!=0&&(n+=1),n===0&&(n=4),s+8+n}static containsIptc8bim(e,t,a){for(let n=0;n<a;n++)if(this.isIptcSegmentHead(e,t+n))return n}static isIptcSegmentHead(e,t){return e.getUint8(t)===56&&e.getUint32(t)===943868237&&e.getUint16(t+4)===1028}parse(){let{raw:e}=this,t=this.chunk.byteLength-1,a=!1;for(let n=0;n<t;n++)if(this.chunk.getUint8(n)===28&&this.chunk.getUint8(n+1)===2){a=!0;let s=this.chunk.getUint16(n+3),o=this.chunk.getUint8(n+2),r=this.chunk.getLatin1String(n+5,s);e.set(o,this.pluralizeValue(e.get(o),r)),n+=4+s}else if(a)break;return this.translate(),this.output}pluralizeValue(e,t){return e!==void 0?e instanceof Array?(e.push(t),e):[e,t]:t}}H($n,"type","iptc"),H($n,"translateValues",!1),H($n,"reviveValues",!1),Te.set("iptc",$n),Fe($e,"iptc",[[0,"ApplicationRecordVersion"],[3,"ObjectTypeReference"],[4,"ObjectAttributeReference"],[5,"ObjectName"],[7,"EditStatus"],[8,"EditorialUpdate"],[10,"Urgency"],[12,"SubjectReference"],[15,"Category"],[20,"SupplementalCategories"],[22,"FixtureIdentifier"],[25,"Keywords"],[26,"ContentLocationCode"],[27,"ContentLocationName"],[30,"ReleaseDate"],[35,"ReleaseTime"],[37,"ExpirationDate"],[38,"ExpirationTime"],[40,"SpecialInstructions"],[42,"ActionAdvised"],[45,"ReferenceService"],[47,"ReferenceDate"],[50,"ReferenceNumber"],[55,"DateCreated"],[60,"TimeCreated"],[62,"DigitalCreationDate"],[63,"DigitalCreationTime"],[65,"OriginatingProgram"],[70,"ProgramVersion"],[75,"ObjectCycle"],[80,"Byline"],[85,"BylineTitle"],[90,"City"],[92,"Sublocation"],[95,"State"],[100,"CountryCode"],[101,"Country"],[103,"OriginalTransmissionReference"],[105,"Headline"],[110,"Credit"],[115,"Source"],[116,"CopyrightNotice"],[118,"Contact"],[120,"Caption"],[121,"LocalCaption"],[122,"Writer"],[125,"RasterizedCaption"],[130,"ImageType"],[131,"ImageOrientation"],[135,"LanguageIdentifier"],[150,"AudioType"],[151,"AudioSamplingRate"],[152,"AudioSamplingResolution"],[153,"AudioDuration"],[154,"AudioOutcue"],[184,"JobID"],[185,"MasterDocumentID"],[186,"ShortDocumentID"],[187,"UniqueDocumentID"],[188,"OwnerID"],[200,"ObjectPreviewFileFormat"],[201,"ObjectPreviewFileVersion"],[202,"ObjectPreviewData"],[221,"Prefs"],[225,"ClassifyState"],[228,"SimilarityIndex"],[230,"DocumentNotes"],[231,"DocumentHistory"],[232,"ExifCameraInfo"],[255,"CatalogSets"]]),Fe(wi,"iptc",[[10,{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"}],[75,{a:"Morning",b:"Both Morning and Evening",p:"Evening"}],[131,{L:"Landscape",P:"Portrait",S:"Square"}]]);const Hn={zip:ow,gz:Eo,tgz:Eo,deflate:Eo};class Uw extends ve{constructor(t,a){super(t,{...{},...a});Se(this,"setHashFileName",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s}=n,o=1024*1024*5,l=await s.slice(0,o).text(),u=new lw;u.append(l);const p=u.end(),c=La(n),f=`${p}${c?`.${c}`:""}`;this.uppy.setFileState(a,{hashFileName:f})}});Se(this,"setMetaData",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:{webkitRelativePath:s,relativePath:o,name:r},hashFileName:l,size:u}=n,p=o||s||r||l;this.uppy.setFileMeta(a,{relativePath:p,name:p})}});Se(this,"preventXssAttack",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{name:s,meta:o}=this.uppy.getFile(a),r=Rl.sanitize(s);if(s!==r){const u=La(n),p=r.endsWith(`.${u}`)?r:`${r}.${u}`;this.uppy.setFileState(a,{name:p,meta:{...o,name:p,filename:p}})}if(await Ix(n)){const{data:u,name:p,type:c}=this.uppy.getFile(a),f=await u.text(),b=Rl.sanitize(f,{USE_PROFILES:{svg:!0,svgFilters:!0},ALLOWED_TAGS:["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","use","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop"],ALLOWED_ATTR:["d","points","x","y","width","height","r","cx","cy","rx","ry","x1","y1","x2","y2","transform","fill","stroke","stroke-width","viewBox","xmlns","style","id","class","offset","stop-color","stop-opacity","clip-path","mask","fill-opacity","stroke-opacity"],FORBID_TAGS:["a","script","iframe","image","foreignObject"],FORBID_ATTR:["href","xlink:href","onclick","onload","onerror"]});if(f!==b){const S=new Blob([b],{type:c}),_=Co(S,p);this.uppy.setFileState(a,{...this.uppy.getFile(a),data:_}),console.info("clean svg file xss attack",{name:p,originalFile:n.data.text(),cleanFile:b})}}}});Se(this,"preventZipBombAttack",async t=>{const{id:a}=t,n=this.uppy.getFile(a);try{if(n&&Hn[n.extension]){const{data:s}=n,o=Hn[n.extension](new Uint8Array(await s.arrayBuffer())),r=(u,p,c=0)=>Object.entries(u instanceof Uint8Array?{[p||n.name]:u}:u).reduce((f,[b,S])=>{if(!S||S.byteLength===0)return console.warn("Invalid or empty item in unzipped content",{name:b,item:S}),f;const _=f+S.byteLength;if(c>=5||_>n.size*100)throw console.error("Zip bomb detected, please check your file",{depth:c,baseAcc:_,fileSize:n.size}),new Error("Zip bomb detected, please check your file");const w=tt.extension(tt.lookup(b));if(Hn[w]){const v=Hn[w](S);return _+r(v,b,c+1)}return _},0);if(r(o)>n.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}});Se(this,"validateImagesRespectCropperOptions",async()=>this.uppy.getFiles().reduce(async(t,a)=>{var _,w,v;await t;const{id:n}=a;let s=this.uppy.getFile(n);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(n)),!((_=this.opts.cropperOptions)!=null&&_.aspectRatio)||!((w=s==null?void 0:s.type)!=null&&w.includes("image"))||(v=s.type)!=null&&v.includes("image/svg"))return Promise.resolve();const{aspectRatio:o}=this.opts.cropperOptions,r=this.uppy.getPlugin("ImageEditor"),l=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+n).querySelector("img"),u=l==null?void 0:l.naturalWidth,p=l==null?void 0:l.naturalHeight,c=Number(u/p).toFixed(2),f=Number(o).toFixed(2);if(c===f)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),r.parent.openFileEditor(s);const S=this.i18n("aspectRatioMessage",{imageAspectRatio:c,aspectRatio:f});return this.uppy.info({message:S,details:S}),new Promise((x,h)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{x()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve()));Se(this,"checkImageOrientation",async t=>{var s;const{id:a}=t,n=this.uppy.getFile(a);if((s=n==null?void 0:n.type)!=null&&s.startsWith("image/"))try{if(!(await Cw(n.data).catch(()=>({deg:0}))).deg)return;const r=n.data.size*.98,l=await new Promise((v,x)=>{const h=new Image;let m=URL.createObjectURL(n.data);h.src=m,h.onload=()=>{URL.revokeObjectURL(m),m=null,v(h)},h.onerror=y=>{m&&(URL.revokeObjectURL(m),m=null),x(new Error(`Image load failed: ${y.message}`))}}),u=l.width/l.height;let p=Math.sqrt(r*u),c=p/u;const f=8096;if(p>f||c>f){const v=f/Math.max(p,c);p*=v,c*=v}const b=document.createElement("canvas");b.width=p,b.height=c;const S=b.getContext("2d",{willReadFrequently:!0,alpha:n.type==="image/png"});S.imageSmoothingEnabled=!0,S.imageSmoothingQuality="high",S.translate(b.width/2,b.height/2),S.drawImage(l,-p/2,-c/2,p,c);const _=1,w=await new Promise(v=>{b.toBlob(v,n.type,_)});this.uppy.setFileState(a,{data:w,size:w.size})}catch(o){console.error("Image rotation processing failed:",o);return}});Se(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.checkImageOrientation(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.preventXssAttack(t),await this.preventZipBombAttack(t),await this.setMetaData(t)});Se(this,"tryDownloadRemoteFile",async t=>{var m,y;const{type:a,name:n,preview:s,source:o,isRemote:r,isDownloading:l,id:u,isLoading:p,remote:c,meta:f,errorCount:b=0}=t,S=!p&&r,_=`uploader:${u}:downloaded`,w=La(t),v=(m=n==null?void 0:n.split("?"))==null?void 0:m[0],h=(()=>{const g=["jpg","jpeg"];return g.includes(w)&&g.some(k=>v==null?void 0:v.endsWith(k))?!0:v==null?void 0:v.endsWith(w)})()?v:`${v}${w?`.${w}`:""}`;if(S){const g=Cx(s||((y=c==null?void 0:c.body)==null?void 0:y.url));if(b>=3)throw this.uppy.setFileState(u,{error:this.i18n("downloadRemoteFileFailure"),meta:{...f,name:this.i18n("downloadRemoteFileFailure")}}),new Error("Download remote file failure");this.uppy.setFileState(u,{isLoading:!0,isDownloading:!0,size:null,meta:{...f,name:this.i18n("loading")}}),await fetch(g).then(async k=>await k.blob()).then(async k=>{const D=Co(k,h);this.uppy.setFileState(u,{name:h,extension:w,type:a,data:D,preview:s||Po(D),source:o,size:D.size,isDownloading:!1,isRemote:!1,meta:{...f,name:h,filename:h}}),this.uppy.getFile(u),this.uppy.emit(_,u)}).catch(async k=>{if(console.error("Axios download remote file error: ",k),a.startsWith("image/")){const D=a.includes("svg")?"image/png":a,A=h.endsWith(".svg")?h.replace(".svg",".png"):h;try{const U=await new Promise((V,$)=>{const B=new Image;B.crossOrigin="anonymous",B.onload=()=>{const F=document.createElement("canvas");F.width=B.width,F.height=B.height;const P=F.getContext("2d");P.translate(F.width/2,F.height/2),P.drawImage(B,-B.width/2,-B.height/2,B.width,B.height),F.toBlob(V,D)},B.onerror=$,B.src=g});let L=Co(U,A);this.uppy.setFileState(u,{name:A,extension:w,type:D,data:L,preview:s||Po(L),source:o,size:L.size,isDownloading:!1,isRemote:!1,meta:{...f,name:A,filename:A}});const X=this.uppy.getFile(u);this.uppy.emit(_,u);return}catch{}}this.uppy.setFileState(u,{isRemote:!0,isLoading:!1,errorCount:b+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(u))})}else l&&await(async()=>new Promise(k=>{this.uppy.once(_,async()=>{k()})}))()});Se(this,"getPreviewFromData",t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s,type:o,preview:r}=n;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(a,{preview:Po(s)})},o.indexOf("gif")>-1?1e3:0)}});Se(this,"prepareUpload",async t=>{await this.validateImagesRespectCropperOptions();const a=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),n=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(a).then(n)});this.id=this.opts.id||"PrepareUpload",this.type="progressindicator",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}render(){return le(Ox,{})}}class Mw extends ve{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>le("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:le("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[le("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),le("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return le("div",{id:"ai-image",className:"ai-image",children:le("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}class Lw extends ve{constructor(e,t){super(e,t),this.id=t.id,this.title=t.title,this.type="acquirer",this.uppy=e,this.i18nInit(),this.autoHide=t.autoHide??!0,typeof t.icon=="string"&&(this.icon=()=>le("div",{dangerouslySetInnerHTML:{__html:t.icon},style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}))}getDashboard(){var e;return(e=this.uppy.getPlugin(this.id))==null?void 0:e.parent}render(){var e;return this.autoHide&&((e=this.getDashboard())!=null&&e.hideAllPanels)&&this.getDashboard().hideAllPanels(),le("div",{id:this.id,className:"uppy-VirtualPlugin"})}update(){}onFirstRender(){}uninstall(){this.unmount()}}const Nw="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",Bw=Z.lazy(()=>Xh(()=>import("./index-C4HCwPkf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),Ku="uploader-container",Lo="uploader-dashboard",zw='div[tabindex="-1"]',Yu=50,jw=10,jr=localStorage.getItem("uppy_debug"),$w=()=>Tr.get("x-csrf-token")?{"x-csrf-token":Tr.get("x-csrf-token")}:{},Hw=i=>{var f;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:a,resourcesProps:n,imageEditorProps:s={},theme:o,plugins:r}=i,{companionUrl:l}=wh(e),u=$w(),p=async b=>(await dn.post("/api/image/generations",b)).data,c={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:Wd,options:{quality:1,...s},alwayUse:!0},(jr||Na()&&t.Uploaded&&!Fu())&&{id:"Uploaded",plugin:Mx,options:{params:a==null?void 0:a.params}},(jr||Na()&&t.Resources&&!Fu())&&{id:"Resources",plugin:Nx,options:{params:n==null?void 0:n.params}},Na()&&Fx()&&t.AIImage&&{id:"AIImage",plugin:Mw,options:{companionUrl:l,companionHeaders:u},onShowPanel:b=>{function S(){setTimeout(()=>{var w,v;const _=document.getElementById("ai-image");_?df(_).render(Re.jsx(Bw,{theme:o,api:p,restrictions:c,i18n:(v=(w=b.current)==null?void 0:w.getUploader())==null?void 0:v.i18n,onSelect:x=>{const h=b.current.getUploader();h==null||h.emit("ai-image:selected",x),x.forEach(({src:m,alt:y},g)=>{const k=U=>(U==null?void 0:U.length)>16?`${U==null?void 0:U.slice(0,8)}...${U==null?void 0:U.slice(-4)}`:U,D=`${k(y)||k(m)}.png`,A={name:D,type:"image/png",data:Px(m,D),source:"AIImage",isRemote:!1};h==null||h.addFile(A)})}})):S()},100)}S()}},{id:"Url",plugin:rn,options:{companionUrl:l,companionHeaders:u}},{id:"Webcam",plugin:_p,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!((f=window==null?void 0:window.blocklet)!=null&&f.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:Wp,options:{companionUrl:l,companionHeaders:u,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:Uw,options:{companionUrl:l,companionHeaders:u,cropperOptions:(s==null?void 0:s.cropperOptions)||null},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:nl,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0},...(r||[]).filter(b=>b==null?void 0:b.id).map(b=>{const{id:S,options:_,onShowPanel:w}=b;return{id:S,plugin:Lw,options:_,onShowPanel:w}})].filter(Boolean)};function qw(i){const{id:e,plugins:t,locale:a="en",onAfterResponse:n,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:u,pluginList:p,restrictions:c,onChange:f,initialFiles:b}=i,S=ap(p,"id"),{uploaderUrl:_}=wh(r);let w=new Hr({id:e,meta:{uploaderId:e},debug:["true",!0].includes(jr||""),locale:is[a],onBeforeFileAdded:(h,m)=>{if(Object.hasOwn(m,h.id))return!1;const y=!!tt.extension(h.type),g=tt.lookup(h.name)||"";if(!y&&g&&g!==h.type){const k=La(h);k&&(h.extension=k),h.type=g}return h},...o,restrictions:c}).use(yh,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:_,async onBeforeRequest(h,m){var X,V;const{hashFileName:y,id:g,meta:k}=m,D=((X=w.getFile(g))==null?void 0:X.mockResponse)||null;h.getMethod()==="PATCH"&&D&&(h.send=()=>D);const A=La(m);h.setHeader("x-uploader-file-name",`${y}`),h.setHeader("x-uploader-file-id",`${g}`),h.setHeader("x-uploader-file-ext",`${A}`),h.setHeader("x-uploader-base-url",new URL(h.getURL()).pathname),h.setHeader("x-uploader-endpoint-url",_),h.setHeader("x-uploader-metadata",JSON.stringify(k,($,B)=>typeof B=="string"?encodeURIComponent(B):B));const U=Tr.get("x-csrf-token");U&&h.setHeader("x-csrf-token",U);const L=(window==null?void 0:window.uploaderComponentId)||((V=window==null?void 0:window.blocklet)==null?void 0:V.componentId);L&&h.setHeader("x-component-did",(L||"").split("/").pop())},onAfterResponse:async(h,m)=>{const y={},g=h.getUnderlyingObject();try{g.response&&(y.data=JSON.parse(g.response))}catch{y.data={}}y.method=h.getMethod().toUpperCase(),y.url=h.getURL(),y.status=g.status,y.headers={...h._headers};const k=g.getAllResponseHeaders();k&&k.split(`\r
77
77
  `).forEach(X=>{const[V,$]=X.split(": ");V&&$&&(y.headers[V]=$)});const D=w.getFile(y.headers["x-uploader-file-id"]);if(h.getMethod()==="PATCH"&&D.mockResponse)return;if(["PATCH","POST"].includes(y.method)&&[200,500].includes(y.status)){const L=[!0,"true"].includes(y.headers["x-uploader-file-exist"]),X=Tx(y.url,y.headers["x-uploader-file-name"]);y.file=D,y.uploadURL=X;const V={uploadURL:X,...y};w.setFileState(D.id,{responseResult:V}),L&&D&&(y.method==="POST"&&w.setFileState(D.id,{mockResponse:m}),w.emit("upload-success",w.getFile(D.id),{...V,body:y.data}),w.emit("postprocess-complete",w.getFile(D.id)),w.calculateTotalProgress()),y.status===200&&(await(s==null?void 0:s(y)),w.emitUploadSuccess(D,y))}n&&await(n==null?void 0:n(g));const A=w.getState().totalProgress===100,U=w.getFiles().every(L=>L.source==="DropTarget");A&&U&&w.close()},...l});const v=({fileIDs:h,id:m})=>{h.forEach(y=>{w.setFileState(y,{uploadID:m})})};w.off("upload",v),w.on("upload",v);const x=h=>{typeof f=="function"&&f(h,w.getFiles())};return w.off("file-added",x),w.on("file-added",x),w.off("file-removed-success",x),w.on("file-removed-success",x),u&&w.use(Ed,{target:document.body,onDrop:h=>{var m;(m=w==null?void 0:w.open)==null||m.call(w)},...u}),t==null||t.forEach(h=>{if(h!=null&&h.id||h){const{plugin:m,options:y}=S[(h==null?void 0:h.id)||h]||{};m&&w.use(m,y)}}),Dx(w),b&&(b==null?void 0:b.length)>0&&w.addFiles(b),w}const Qu=Z.forwardRef((i,e)=>{var B,F,P,C,T,I,E,z,q,W,Y,J,Q,qi,Vi,fn,Wi,Gi,Xi,Dl,El;const t={uploader:"/api/uploads",companion:"/api/companion",disableMediaKitPrefix:!1,disableMediaKitStatus:!1,...i==null?void 0:i.apiPathProps},a=Z.useRef(null),n=Z.useRef(null),s=Z.useRef(0),o=cf({open:!1,uppy:null,availablePluginMap:{},restrictions:Ms((B=i==null?void 0:i.coreProps)==null?void 0:B.restrictions)||{}}),r=ef(),l=(F=r==null?void 0:r.palette)==null?void 0:F.mode,u=Hw({...i,apiPathProps:t,availablePluginMap:o.availablePluginMap,restrictions:o.restrictions,theme:r}),{plugins:p=u.map(N=>N.id),id:c="Uploader",popup:f=!1,onUploadFinish:b,onOpen:S,onClose:_,locale:w="en",installerProps:v}=i,x=ap(u,"id"),h=tf(N=>{var ge;return(ge=N==null?void 0:N.breakpoints)==null?void 0:ge.down("md")}),m=Ls([...p,...u.filter(N=>N.alwayUse).map(N=>N.id)]),{loading:y}=uf(async()=>{var ge,Je,ce,re,_e;let N=Ns((ge=i==null?void 0:i.coreProps)==null?void 0:ge.restrictions)?{}:Ms((Je=i==null?void 0:i.coreProps)==null?void 0:Je.restrictions);if(!t.disableMediaKitStatus&&Na())try{await dn.get("/api/uploader/status").then(({data:De})=>{var mn;o.availablePluginMap=De.availablePluginMap,!t.disableMediaKitPrefix&&Ns((mn=i==null?void 0:i.coreProps)==null?void 0:mn.restrictions)&&(N=De.restrictions||{})})}catch{}!((ce=N==null?void 0:N.allowedFileTypes)!=null&&ce.length)&&(N!=null&&N.allowedFileExts)&&(N.allowedFileTypes=Ls((_e=(re=(typeof(N==null?void 0:N.allowedFileExts)=="string"?N==null?void 0:N.allowedFileExts.split(","):N==null?void 0:N.allowedFileExts)||[])==null?void 0:re.map(De=>tt.lookup((De==null?void 0:De.replaceAll(" ",""))||"")))==null?void 0:_e.filter(De=>De)),delete N.allowedFileExts),N.maxFileSize&&typeof N.maxFileSize=="string"&&(N.maxFileSize=Kh.parseSize(N.maxFileSize,{iec:!1})||void 0),o.restrictions=Ms(N)},{refreshDeps:[JSON.stringify({apiPathProps:t,restrictionsProps:(P=i==null?void 0:i.coreProps)==null?void 0:P.restrictions})]}),g=typeof((C=o.restrictions)==null?void 0:C.allowedFileTypes)=="object"&&((I=(T=o.restrictions)==null?void 0:T.allowedFileTypes)==null?void 0:I.length)===0,k=Z.useMemo(()=>{var N,ge,Je,ce;return((ce=(Je=Ls(((ge=(N=o.restrictions)==null?void 0:N.allowedFileTypes)==null?void 0:ge.flatMap(re=>{var _e;if(re.endsWith("/*")){const De=(_e=re.split("/"))==null?void 0:_e[0];switch(De){case"image":return["jpg","jpeg","png","gif","svg","webp","bmp","tiff","avif","heic","ico","apng"];case"video":return["mp4","webm","mov","avi","wmv","flv","mkv","mpg","mpeg","3gp","m4v","ts","m2ts"];case"audio":return["mp3","wav","ogg","aac","flac","m4a","wma","opus","mid","midi","amr"];case"text":return["txt","html","htm","css","csv","md","rtf","xml","json","js","ts","jsx","tsx"];case"application":return["pdf","doc","docx","xls","xlsx","ppt","pptx","zip","rar","7z","tar","gz","exe","msi","apk","dmg","iso"];case"font":return["ttf","otf","woff","woff2","eot"];case"chemical":return["mol","pdb","cml","xyz"];case"model":return["obj","stl","gltf","glb","fbx","3ds","dae"];case"message":return["eml","msg","vcf","ics"];default:return De}}return tt.extension(re)}))||[]))==null?void 0:Je.filter(Boolean))==null?void 0:ce.join(", "))||""},[(E=o.restrictions)==null?void 0:E.allowedFileTypes]);let D="";g?D=Bs(is,`${w}.strings.noAllowedFileTypes`,"No allowed file types"):(q=(z=o.restrictions)==null?void 0:z.allowedFileTypes)!=null&&q.length&&k&&(D=Bs(is,`${w}.strings.allowedFileTypes`,"Allowed file types: ")+k),(Ns(D)||["undefined","null",void 0,null].includes(D))&&(D=""),pf("esc",N=>{o.open&&(N.stopPropagation(),N.preventDefault(),L())},{useCapture:!0}),Z.useEffect(()=>{_x(t),o.uppy=qw({...i,id:c,plugins:m,apiPathProps:t,pluginList:u,restrictions:o.restrictions}),o.uppy.open=U,o.uppy.close=L,o.uppy.openPlugin=A;const N=ce=>{const{onShowPanel:re}=x[ce];re==null||re(e)};o.uppy.off("dashboard:show-panel",N),o.uppy.on("dashboard:show-panel",N);const ge=(ce,re,_e,De)=>{var Il;const mn=`${De.toLowerCase()}Props`,gn=(Il=_e[mn])==null?void 0:Il.onSelectedFiles;if(typeof gn=="function"){const vn=ce.map(Ht=>{var Ct,Al,Ol;const bn={name:Ht.id||((Ol=(Al=(Ct=Ht.fileUrl)==null?void 0:Ct.split("/"))==null?void 0:Al.slice(-1))==null?void 0:Ol[0]),type:Ht.mimetype||tt.lookup(Ht.fileUrl),data:"",preview:Ht.fileUrl,source:De,isRemote:!0},Us=re.uppy.addFile(bn);return{...Ht,uppyFile:re.uppy.getFile(Us)}});gn==null||gn(vn)}else{const vn=[],Ht=[],bn=`Mock-${Math.random().toString(36).substring(2,15)}`;Promise.all(ce.map(async Us=>{const Ct=Ax(Us);Ct&&(Ct.uploadID=bn,vn.push(Ct)),await(b==null?void 0:b(Ct)),re.uppy.emitUploadSuccess(Ct.file,Ct)})).then(()=>{re.uppy.close()}).finally(()=>{re.uppy.emit("complete",{failed:Ht,successful:vn,uploadID:bn})})}};[{name:"Uploaded",event:"uploaded:selected"},{name:"Resources",event:"resources:selected"}].forEach(({name:ce,event:re})=>{m.includes(ce)&&(o.uppy.off(re),o.uppy.on(re,_e=>ge(_e,o,i,ce)))})},[JSON.stringify({id:c,plugins:m,apiPathProps:t,locale:w,restrictions:o.restrictions,theme:r})]);function A(N){var Je,ce,re;if(N=N.replace(/\s/g,""),["MyDevice",...m.map(_e=>_e.id||_e)].map(_e=>_e.toLowerCase()).includes(N.toLowerCase())){let _e=`div[data-uppy-acquirer-id="${N}"] > button`;(re=(ce=(Je=document==null?void 0:document.getElementById(Lo))==null?void 0:Je.querySelector(_e))==null?void 0:ce.click)==null||re.call(ce)}}function U(N){o.open=!0,N&&setTimeout(()=>{A(N)},200),o.uppy.emitOpen(),S==null||S(),n.current&&(clearInterval(n.current),n.current=null),s.current=0,n.current=setInterval(()=>{var Je,ce;const ge=(Je=a.current)==null?void 0:Je.querySelector(zw);s.current+=1,(s.current>Yu||ge&&ge!==document.activeElement)&&(ge&&ge!==document.activeElement?((ce=ge.focus)==null||ce.call(ge),console.info("[Uploader] Trigger auto focus overlay success")):s.current>Yu&&console.info("[Uploader] Auto focus overlay failed after maximum attempts"),clearInterval(n.current),n.current=null)},jw)}function L(){var N;n.current&&(clearInterval(n.current),n.current=null),(N=o.uppy.getPlugin(Lo))==null||N.hideAllPanels(),o.open=!1,o.uppy.emitClose(),_==null||_(),setTimeout(()=>{o.uppy.getState().totalProgress===100&&(o.uppy.setState({files:{},currentUploads:{}}),o.uppy.calculateTotalProgress())},500)}Z.useImperativeHandle(e,()=>({getUploader:()=>o.uppy,open:U,close:L}));const X=f?lf:Z.Fragment,V=f?{sx:{zIndex:99999999999,"& > *":{display:o.open?"block":"none"},display:"flex",justifyContent:"center",alignItems:"center",...(W=i==null?void 0:i.wrapperProps)==null?void 0:W.sx},invisible:!0,open:o.open,onClick:N=>{document.activeElement===document.body&&(N.stopPropagation(),L())},...i.wrapperProps}:{...i.wrapperProps},$=h?"42px":"40px";return Re.jsx(X,{...V,children:Re.jsxs(Yh,{onClose:L,did:Nw,disabled:!o.open,...v,children:[Re.jsx(af,{styles:()=>({".uppy-is-drag-over":{"&::after":{transition:"all 0.3s ease-in-out",border:"2px dashed #bbb !important",borderRadius:4,background:"rgba(234, 234, 234, 0.5)"}}})}),Re.jsxs(No,{className:"uploader-container",ref:a,id:Ku,onClick:N=>N.stopPropagation(),sx:{position:"relative",width:h?"90vw":720,animation:o.open?"uppy-Dashboard-fadeIn 150ms ease-in-out":"none","@keyframes uppy-Dashboard-fadeIn":{from:{opacity:0},to:{opacity:1}},".uppy-Dashboard-inner":{borderColor:"divider"},".uppy-ProviderBrowserItem > *":{transition:"all 0.3s ease-in-out"},".uppy-ProviderBrowserItem-inner":{flex:1,color:"transparent","img, object":{objectFit:"contain !important"}},".uppy-ProviderBrowserItem-checkbox":{backgroundColor:`${(J=(Y=r==null?void 0:r.palette)==null?void 0:Y.primary)==null?void 0:J.main} !important`},".uppy-Dashboard-Item-previewInnerWrap, .uppy-ProviderBrowserItem-inner":{boxShadow:"none !important",background:"repeating-conic-gradient(#e0e0e0 0 25%,#fff 0 50%) 50%/18px 18px !important"},".uppy-ProviderBrowserItem--selected .uppy-ProviderBrowserItem-inner":{boxShadow:N=>`0 0 0 3px ${N.palette.primary.main} !important`},".uploaded-add-item":{background:r.palette.mode==="dark"?"rgba(255,255,255,0.1) !important":"rgba(0,0,0,0.1) !important",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out","&:hover":{background:r.palette.mode==="dark"?"rgba(255,255,255,0.13) !important":"rgba(0,0,0,0.13) !important"}},".uppy-StatusBar-actions, .uppy-ProviderBrowser-footer":{justifyContent:"flex-end"},".uppy-ProviderBrowser-footer":{button:{marginRight:"0 !important","&:last-child":{display:"none"}}},".uppy-Dashboard-AddFiles-title":{whiteSpace:"normal"},".uppy-ProviderBrowser-body":{height:"100%"},".uppy-ProviderBrowser-list":{height:"fit-content",maxHeight:"100%",bgcolor:"background.paper"},".uploaded, .ai-image":{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column","& > div":{width:"100%",bgcolor:"background.paper"},"& .uppy-ProviderBrowser-header":{display:"none"}},"& .uppy-Url":{width:"100% !important",display:"flex",justifyContent:"center","& input":{width:"70%"}},"& .uppy-Dashboard-browse, & .uppy-DashboardContent-addMore, & .uppy-DashboardContent-back, & .uppy-StatusBar-actionBtn--done, & .uppy-DashboardContent-save, & .uppy-StatusBar-actionBtn--upload":{color:`${(qi=(Q=r==null?void 0:r.palette)==null?void 0:Q.primary)==null?void 0:qi.main}`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{color:`${(fn=(Vi=r==null?void 0:r.palette)==null?void 0:Vi.primary)==null?void 0:fn.main}`,filter:"brightness(1.2)"}},"& .uppy-Dashboard-browse":{textDecoration:"underline !important"},"& .uppy-c-btn-primary":{backgroundColor:`${(Gi=(Wi=r==null?void 0:r.palette)==null?void 0:Wi.primary)==null?void 0:Gi.main} !important`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{backgroundColor:`${(Dl=(Xi=r==null?void 0:r.palette)==null?void 0:Xi.primary)==null?void 0:Dl.main} !important`,filter:"brightness(1.2)"}},"& .button-color-style":{border:"1px solid",borderColor:"primary.main",color:"primary.main",backgroundColor:"transparent",transition:"all 0.3s ease-in-out","&:hover":{filter:"brightness(1.2)"}},"& .button-color-style-active":{backgroundColor:"primary.main",color:"white"}},children:[f&&Re.jsx(nf,{"aria-label":"close",onClick:L,sx:{color:l==="dark"?"#ddd":"#fafafa",position:"absolute",...h?{bottom:`calc(0px - ${$} - 16px)`,left:`calc(50vw - ${$} - 8px)`}:{right:`calc(0px - ${$} - 16px)`,top:-12}},children:Re.jsx(sf,{sx:{fontSize:$}})}),y&&Re.jsxs(No,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",zIndex:99999999999,flexDirection:"column",background:"rgba(256, 256, 256, 0.2)",backdropFilter:"blur(4px)",borderRadius:1,pointerEvents:"none"},children:[Re.jsx(of,{size:32}),Re.jsx(rf,{variant:"body2",color:"primary",sx:{mt:1.5,fontWeight:"bold"},children:Bs(is,`${w}.strings.loadingStatus`,"Loading...")})]}),o.uppy&&Re.jsx(xd,{inline:!0,target:`#${Ku}`,id:Lo,disabled:g,uppy:o.uppy,plugins:m,fileManagerSelectionType:((El=o.restrictions)==null?void 0:El.maxNumberOfFiles)===1?"files":"both",proudlyDisplayPoweredByUppy:!1,showProgressDetails:!0,disableThumbnailGenerator:!0,theme:l==="dark"?"dark":"light",note:D,doneButtonHandler:L,...i.dashboardProps})]},"uploader-container")]})},"uploader-wrapper")}),jh=Z.createContext(null);function Vw(){const i=Z.useContext(jh);if(!i)throw new Error("useUploaderContext must be used within an UploaderProvider");return i}function b2({onChange:i,children:e,...t}){const a=Vw(),n=()=>{var o;const s=(o=a==null?void 0:a.current)==null?void 0:o.getUploader();s==null||s.open(),i&&s.onceUploadSuccess((...r)=>{i(...r)})};return Re.jsx(No,{onClick:n,...t,children:e})}function y2({children:i,popup:e,...t}){const a=Z.useRef(null),n=Z.useMemo(()=>e?Qh.createPortal(Re.jsx(Qu,{ref:a,popup:!0,...t},"uploader"),document.body):Re.jsx(Qu,{ref:a,popup:!1,...t},"uploader"),[a,e,t]);return Re.jsxs(jh.Provider,{value:a,children:[i,n]})}export{_o as CLOSE,Fo as OPEN,_u as UPLOADER_UPLOAD_SUCCESS,Qu as Uploader,jh as UploaderContext,y2 as UploaderProvider,b2 as UploaderTrigger,kx as api,Px as base64ToFile,Co as blobToFile,bs as createImageUrl,Fx as getAIKitComponent,Cx as getDownloadUrl,La as getExt,Na as getMediaKitComponent,Po as getObjectURL,wh as getUploaderEndpoint,Tx as getUrl,qw as initUploader,Dx as initUppy,Sx as isBlob,Fu as isMediaKit,Ix as isSvgFile,dn as mediaKitApi,jt as mediaKitMountPoint,Ax as mockUploaderFileResponse,Ex as parseStringToDot,xi as prefixPath,_x as setPrefixPath,Vw as useUploaderContext};