exifreader 4.26.1 → 4.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -208,6 +208,47 @@ For the compressed tags to work, the environment needs to support the
208
208
  The reason for having an option to enable this is to not break backwards
209
209
  compatibility. This will probably be the default in the next major version.
210
210
 
211
+ #### Grouping
212
+
213
+ By default, Exif, IPTC and XMP tags are grouped together. This means that if
214
+ e.g. `Orientation` exists in both Exif and XMP, the first value (Exif) will be
215
+ overwritten by the second (XMP). If you need to separate between these values,
216
+ pass in an options object with the property `expanded` set to `true`:
217
+
218
+ ```javascript
219
+ const tags = ExifReader.load(fileBuffer, {expanded: true});
220
+ ```
221
+
222
+ #### Parsing XMP tags when not in a DOM environment
223
+
224
+ When using for example Node.js or a web worker, there is no native
225
+ [`DOMParser`](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser)
226
+ available for parsing the XML used in XMP. In this case – and if XMP support is
227
+ important to you – you can pass in a third-party parser to ExifReader. The
228
+ parser needs to have a `parseFromString` method with the same API as the
229
+ [`parseFromString` from the DOMParser Web
230
+ API](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString).
231
+
232
+ Two libraries have been tested,
233
+ [`xmldom`](https://www.npmjs.com/package/@xmldom/xmldom) and
234
+ [`linkedom`](https://www.npmjs.com/package/linkedom), but more might work if
235
+ they follow the spec.
236
+
237
+ Here is an example using `xmldom`:
238
+
239
+ ```javascript
240
+ import {DOMParser, onErrorStopParsing} from '@xmldom/xmldom';
241
+ // ...
242
+ const tags = ExifReader.load(fileBuffer, {domParser: new DOMParser({onError: onErrorStopParsing})});
243
+ ```
244
+
245
+ The `onError` option is needed to avoid a [seemingly infinite loop for some
246
+ XMLs](https://github.com/xmldom/xmldom/issues/501). Unfortunately `linkedom` has
247
+ the same problem but does not have this option and will therefore get stuck on
248
+ these XMLs. If this happens to you, switch to `xmldom` and pass in the `onError`
249
+ option. (NOTE: The native `DOMParser` that a web browser uses does not seem to
250
+ have this issue.)
251
+
211
252
  #### Using React Native
212
253
 
213
254
  Import ExifReader like this:
@@ -235,17 +276,6 @@ If you're having trouble getting the GPS location, see [this comment and
235
276
  thread](https://github.com/mattiasw/ExifReader/issues/177#issuecomment-1172228225)
236
277
  and the [GPS section below](#gps) for more details.
237
278
 
238
- #### Grouping
239
-
240
- By default, Exif, IPTC and XMP tags are grouped together. This means that if
241
- e.g. `Orientation` exists in both Exif and XMP, the first value (Exif) will be
242
- overwritten by the second (XMP). If you need to separate between these values,
243
- pass in an options object with the property `expanded` set to `true`:
244
-
245
- ```javascript
246
- const tags = ExifReader.load(fileBuffer, {expanded: true});
247
- ```
248
-
249
279
  #### Read only part of file
250
280
 
251
281
  If you only want to read part of the image file you can use the `length` option:
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ExifReader=t():e.ExifReader=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:1,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:1})}},t={};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return e+""}(e);return"symbol"==n(t)?t:t+""}e.r(t),e.d(t,{default:function(){return Ci},errors:function(){return Ui},load:function(){return Pi},loadView:function(){return Ei}});var i=function(){return e=function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e){return"object"!==n(e)||void 0===e.length||void 0===e.readUInt8||void 0===e.readUInt16LE||void 0===e.readUInt16BE||void 0===e.readUInt32LE||void 0===e.readUInt32BE||void 0===e.readInt32LE||void 0===e.readInt32BE}(t))throw Error("DataView: Passed buffer type is unsupported.");this.buffer=t,this.byteLength=this.buffer.length},(t=[{key:"getUint8",value:function(e){return this.buffer.readUInt8(e)}},{key:"getUint16",value:function(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}},{key:"getUint32",value:function(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}},{key:"getInt32",value:function(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||0,i.configurable=1,"value"in i&&(i.writable=1),Object.defineProperty(e,r(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:0}),e;var e,t}();function o(e,t,n){try{return new DataView(e,t,n)}catch(r){return new i(e,t,n)}}function a(e,t,n){for(var r=[],i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return s(r)}function u(e,t){for(var n=[],r=0;t+r<e.byteLength;){var i=e.getUint8(t+r);if(0===i)break;n.push(i),r++}return s(n)}function c(e,t,n){for(var r=[],i=0;i<n&&t+i<e.byteLength;i+=2)r.push(e.getUint16(t+i));return 0===r[r.length-1]&&r.pop(),s(r)}function f(e,t){var n=e.getUint8(t);return[n,a(e,t+1,n)]}function s(e){return e.map((function(e){return String.fromCharCode(e)})).join("")}function l(){for(var e=1;e<arguments.length;e++)for(var t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}function d(e,t,n){var r=0;Object.defineProperty(e,t,{get:function(){return r||(r=1,Object.defineProperty(e,t,{configurable:1,enumerable:1,value:n.apply(e),writable:1})),e[t]},configurable:1,enumerable:1})}function p(e){return"undefined"!=typeof btoa?"string"==typeof e?btoa(e):btoa(Array.prototype.reduce.call(new Uint8Array(e),(function(e,t){return e+String.fromCharCode(t)}),"")):"undefined"!=typeof Buffer?"undefined"!=typeof Buffer.from?Buffer.from(e).toString("base64"):new Buffer(e).toString("base64"):void 0}function m(e,t){return Array(t+1).join(e)}var g=void 0;function h(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"string";if(0===t&&"function"==typeof DecompressionStream){var i=new DecompressionStream("deflate"),o=new Blob([e]).stream().pipeThrough(i);return"dataview"===r?new Response(o).arrayBuffer().then((function(e){return new DataView(e)})):new Response(o).arrayBuffer().then((function(e){return new TextDecoder(n).decode(e)}))}return void 0!==t?Promise.reject("Unknown compression method ".concat(t,".")):e}var v={USE_FILE:1,USE_JFIF:1,USE_PNG_FILE:1,USE_EXIF:1,USE_IPTC:1,USE_XMP:1,USE_ICC:1,USE_MPF:1,USE_PHOTOSHOP:1,USE_THUMBNAIL:1,USE_TIFF:1,USE_JPEG:1,USE_PNG:1,USE_HEIC:1,USE_AVIF:1,USE_WEBP:1,USE_GIF:1,USE_MAKER_NOTES:1};function y(e){return e.map((function(e){return String.fromCharCode(e)})).join("")}function S(e){if(e.length>=8){var t=y(e.slice(0,8));if("ASCII\0\0\0"===t)return y(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t)return"[Undefined encoding]"}return"Undefined"}function b(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}var I=18761,C=I,U=function(e,t){if(e.getUint16(t)===I)return I;if(19789===e.getUint16(t))return 19789;throw Error("Illegal byte order value. Faulty image.")},P=2,A=65496,E=2,w=4,T=2,x=2,F=10,M=18,O=33,k=79,D=18,R=8,N="ICC_PROFILE\0",L=w+N.length,_=L+1,B="MPF\0",G=65472,j=65474,z=65476,V=65499,H=65501,W=65498,X=65504,J=65505,Y=65506,K=65517,q=65519,$=65534,Q=65535,Z="JFIF",ee="Exif",te="http://ns.adobe.com/xap/1.0/\0",ne="http://ns.adobe.com/xmp/extension/\0",re="Photoshop 3.0";function ie(e,t){return e.getUint16(t)===G}function oe(e,t){return e.getUint16(t)===j}function ae(e,t){var n=N.length;return e.getUint16(t)===Y&&a(e,t+w,n)===N}function ue(e,t){var n=B.length;return e.getUint16(t)===Y&&a(e,t+w,n)===B}function ce(e,t){var n=Z.length;return e.getUint16(t)===X&&a(e,t+w,n)===Z&&0===e.getUint8(t+w+n)}function fe(e,t){var n=ee.length;return e.getUint16(t)===J&&a(e,t+w,n)===ee&&0===e.getUint8(t+w+n)}function se(e,t){return e.getUint16(t)===J&&function(e,t){var n=te.length;return a(e,t+w,n)===te}(e,t)}function le(e,t){return e.getUint16(t)===J&&function(e,t){var n=ne.length;return a(e,t+w,n)===ne}(e,t)}function de(e,t){return{dataOffset:e+O,length:t-(O-T)}}function pe(e,t){return{dataOffset:e+k,length:t-(k-T)}}function me(e,t){var n=re.length;return e.getUint16(t)===K&&a(e,t+w,n)===re&&0===e.getUint8(t+w+n)}function ge(e,t){var n=e.getUint16(t);return n>=X&&n<=q||n===$||n===G||n===j||n===z||n===V||n===H||n===W}function he(e,t){return e.getUint16(t)===Q}var ve="‰PNG\r\n\n",ye=4,Se=4,be=0,Ie=ye,Ce=ye+Se,Ue="XML:com.adobe.xmp\0",Pe="tEXt",Ae="iTXt",Ee="zTXt",we="pHYs",Te="tIME",xe="eXIf",Fe="iCCP";function Me(e,t){return"IHDR"===a(e,t+Ie,Se)}function Oe(e,t){return a(e,t+Ie,Se)===Ae&&a(e,t+Ce,Ue.length)===Ue}function ke(e,t,n){var r=a(e,t+Ie,Se);return r===Pe||r===Ae||r===Ee&&n}function De(e,t){return a(e,t+Ie,Se)===xe}function Re(e,t){return a(e,t+Ie,Se)===Fe}function Ne(e,t){var n=[we,Te],r=a(e,t+Ie,Se);return n.includes(r)}function Le(e,t){t+=Ce+Ue.length+1+1;for(var n=0;n<2&&t<e.byteLength;)0===e.getUint8(t)&&n++,t++;if(!(n<2))return t}function _e(e,t){var n=u(e,t);return t+=n.length+1,{profileName:n,compressionMethod:e.getUint8(t),compressedProfileOffset:t+=1}}function Be(e,t,n,r,i,o,a,u){if(void 0===u)return[];for(var c=[],f=n.items,s=0;s<u;s++){var l={extents:[]};l.itemId=Ge(e,f,t),f+=r.item.itemId,l.constructionMethod=1===t||2===t?15&e.getUint16(f):void 0,f+=r.item.constructionMethod,l.dataReferenceIndex=e.getUint16(f),f+=r.item.dataReferenceIndex,l.baseOffset=ze(e,f,r.item.baseOffset),f+=r.item.baseOffset,l.extentCount=e.getUint16(f),f+=r.item.extentCount;for(var d=0;d<l.extentCount;d++){var p={};p.extentIndex=je(e,t,f,a),f+=r.item.extent.extentIndex,p.extentOffset=ze(e,f,i),f+=r.item.extent.extentOffset,p.extentLength=ze(e,f,o),f+=r.item.extent.extentLength,l.extents.push(p)}c.push(l)}return c}function Ge(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}function je(e,t,n,r){if((1===t||2===t)&&r>0)return ze(e,n,r)}function ze(e,t,n){return 4===n?e.getUint32(t):8===n?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),function(e,t){return e.getUint32(t+4)}(e,t)):0}var Ve=1165519206,He=1835625829;function We(e,t){var n=function(e,t){var n=e.getUint32(t);return function(e){return 0===e}(n)?{length:e.byteLength-t,contentOffset:t+4+4}:function(e){return 1===e}(n)&&function(e,t){return 0===e.getUint32(t+8)}(e,t)?{length:e.getUint32(t+12),contentOffset:t+4+4+8}:{length:n,contentOffset:t+4+4}}(e,t),r=n.length,i=n.contentOffset;if(!(r<8)){var o=e.getUint32(t+4);if(1718909296===o)return function(e,t,n){return{type:"ftyp",majorBrand:a(e,t,4),length:n}}(e,i,r);if(1768977008===o)return function(e,t,n,r){return{type:"iprp",subBoxes:Ke(e,n,r-(n-t)),length:r}}(e,t,i,r);if(1768973167===o)return function(e,t,n,r){return{type:"ipco",properties:Ke(e,n,r-(n-t)),length:r}}(e,t,i,r);if(1668246642===o)return function(e,t,n){return{type:"colr",icc:Ye(e,t),length:n}}(e,i,r);var c=e.getUint8(i);return 1835365473===o?function(e,t,n,r){return{type:"meta",subBoxes:Ke(e,n+3,r-(n+3-t)),length:r}}(e,t,i+1,r):1768714083===o?function(e,t,n,r){var i=function(e,t){var n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):2===e&&(n.itemCount=4,n.item.itemId=4),n.item.constructionMethod=1===e||2===e?2:0;var r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}(t,n+3),o=i.offsets,a=i.sizes,u=e.getUint8(o.offsetSize)>>4;a.item.extent.extentOffset=u;var c=15&e.getUint8(o.lengthSize);a.item.extent.extentLength=c;var f=e.getUint8(o.baseOffsetSize)>>4;a.item.baseOffset=f;var s=function(e,t,n){if(1===n||2===n)return 15&e.getUint8(t)}(e,o.indexSize,t);a.item.extent.extentIndex=void 0!==s?s:0;var l=function(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}(e,o.itemCount,t);return{type:"iloc",items:Be(e,t,o,a,u,c,s,l),length:r}}(e,c,i+1,r):1768517222===o?function(e,t,n,r,i){var o=function(e,t){var n={entryCount:t+3},r={};return r.entryCount=0===e?2:4,n.itemInfos=n.entryCount+r.entryCount,{offsets:n}}(n,r),a=o.offsets;return{type:"iinf",itemInfos:Ke(e,a.itemInfos,i-(a.itemInfos-t)),length:i}}(e,t,c,i+1,r):1768842853===o?function(e,t,n,r,i){r+=3;var o={type:"infe",length:i};return 0!==n&&1!==n||(o.itemId=e.getUint16(r),r+=2,o.itemProtectionIndex=e.getUint16(r),r+=2,o.itemName=u(e,r),r+=o.itemName.length+1),n>=2&&(2===n?(o.itemId=e.getUint16(r),r+=2):3===n&&(o.itemId=e.getUint32(r),r+=4),o.itemProtectionIndex=e.getUint16(r),r+=2,o.itemType=e.getUint32(r),r+=4,o.itemName=u(e,r),r+=o.itemName.length+1,o.itemType===He?(o.contentType=u(e,r),t+i>(r+=o.contentType.length+1)&&(o.contentEncoding=u(e,r),r+=o.contentEncoding.length+1)):1970432288===o.itemType&&(o.itemUri=u(e,r),r+=o.itemUri.length+1)),o}(e,t,c,i+1,r):{type:void 0,length:r}}}function Xe(e){if(v.USE_EXIF||v.USE_XMP||v.USE_ICC){var t={},n=function(e){for(var t=0;t+4+4<=e.byteLength;){var n=We(e,t);if(void 0===n)break;if("meta"===n.type)return n;t+=n.length}}(e);return n?(v.USE_EXIF&&(t.tiffHeaderOffset=function(e,t){try{var n=function(e){return e.subBoxes.find((function(e){return"iinf"===e.type})).itemInfos.find((function(e){return e.itemType===Ve}))}(t).itemId,r=Je(t,n);return function(e,t){return t+4+e.getUint32(t)}(e,r.baseOffset+r.extents[0].extentOffset)}catch(e){return}}(e,n)),v.USE_XMP&&(t.xmpChunks=function(e){try{var t=function(e){return e.subBoxes.find((function(e){return"iinf"===e.type})).itemInfos.find((function(e){return e.itemType===He&&"application/rdf+xml"===e.contentType}))}(e).itemId,n=Je(e,t),r=Je(e,t).extents[0];return[{dataOffset:n.baseOffset+r.extentOffset,length:r.extentLength}]}catch(e){return}}(n)),v.USE_ICC&&(t.iccChunks=function(e){try{var t=e.subBoxes.find((function(e){return"iprp"===e.type})).subBoxes.find((function(e){return"ipco"===e.type})).properties.find((function(e){return"colr"===e.type})).icc;if(t)return[t]}catch(e){}}(n)),t.hasAppMarkers=void 0!==t.tiffHeaderOffset||void 0!==t.xmpChunks||void 0!==t.iccChunks,t):{hasAppMarkers:0}}return{}}function Je(e,t){return e.subBoxes.find((function(e){return"iloc"===e.type})).items.find((function(e){return e.itemId===t}))}function Ye(e,t){var n=a(e,t,4);if("prof"===n||"rICC"===n)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function Ke(e,t,n){for(var r=[Ve,He],i=[],o=t;o<t+n;){var a=We(e,o);if(void 0===a)break;void 0===a.type||void 0!==a.itemType&&-1===r.indexOf(a.itemType)||i.push(a),o+=a.length}return i}var qe=6,$e=["GIF87a","GIF89a"],Qe=0,Ze="<?xpacket begin",et={parseAppMarkers:function(e,t){if(v.USE_TIFF&&function(e){return!!e&&e.byteLength>=4&&function(e){var t=e.getUint16(0)===C;return 42===e.getUint16(2,t)}(e)}(e))return tt(v.USE_EXIF?{hasAppMarkers:1,tiffHeaderOffset:0}:{},"tiff","TIFF");if(v.USE_JPEG&&function(e){return!!e&&e.byteLength>=P&&e.getUint16(0)===A}(e))return tt(function(e){for(var t,n,r,i,o,a,u,c,f,s=E;s+w+5<=e.byteLength;){if(v.USE_FILE&&ie(e,s))t=e.getUint16(s+T),n=s+T;else if(v.USE_FILE&&oe(e,s))t=e.getUint16(s+T),r=s+T;else if(v.USE_JFIF&&ce(e,s))t=e.getUint16(s+T),i=s+x;else if(v.USE_EXIF&&fe(e,s))t=e.getUint16(s+T),o=s+F;else if(v.USE_XMP&&se(e,s))u||(u=[]),t=e.getUint16(s+T),u.push(de(s,t));else if(v.USE_XMP&&le(e,s))u||(u=[]),t=e.getUint16(s+T),u.push(pe(s,t));else if(v.USE_IPTC&&me(e,s))t=e.getUint16(s+T),a=s+M;else if(v.USE_ICC&&ae(e,s)){t=e.getUint16(s+T);var l=s+D,d=t-(D-T),p=e.getUint8(s+L),m=e.getUint8(s+_);c||(c=[]),c.push({offset:l,length:d,chunkNumber:p,chunksTotal:m})}else if(v.USE_MPF&&ue(e,s))t=e.getUint16(s+T),f=s+R;else{if(!ge(e,s)){if(he(e,s)){s++;continue}break}t=e.getUint16(s+T)}s+=T+t}return{hasAppMarkers:s>E,fileDataOffset:n||r,jfifDataOffset:i,tiffHeaderOffset:o,iptcDataOffset:a,xmpChunks:u,iccChunks:c,mpfDataOffset:f}}(e),"jpeg","JPEG");if(v.USE_PNG&&function(e){return!!e&&a(e,0,ve.length)===ve}(e))return tt(function(e,t){for(var n={hasAppMarkers:0},r=ve.length;r+ye+Se<=e.byteLength;){if(v.USE_PNG_FILE&&Me(e,r))n.hasAppMarkers=1,n.pngHeaderOffset=r+Ce;else if(v.USE_XMP&&Oe(e,r)){var i=Le(e,r);void 0!==i&&(n.hasAppMarkers=1,n.xmpChunks=[{dataOffset:i,length:e.getUint32(r+be)-(i-(r+Ce))}])}else if(ke(e,r,t)){n.hasAppMarkers=1;var o=a(e,r+Ie,Se);n.pngTextChunks||(n.pngTextChunks=[]),n.pngTextChunks.push({length:e.getUint32(r+be),type:o,offset:r+Ce})}else if(De(e,r))n.hasAppMarkers=1,n.tiffHeaderOffset=r+Ce;else if(v.USE_ICC&&t&&Re(e,r)){n.hasAppMarkers=1;var u=e.getUint32(r+be),c=r+Ce,f=_e(e,c),s=f.profileName,l=f.compressionMethod,d=f.compressedProfileOffset;n.iccChunks||(n.iccChunks=[]),n.iccChunks.push({offset:d,length:u-(d-c),chunkNumber:1,chunksTotal:1,profileName:s,compressionMethod:l})}else Ne(e,r)&&(n.hasAppMarkers=1,n.pngChunkOffsets||(n.pngChunkOffsets=[]),n.pngChunkOffsets.push(r+be));r+=e.getUint32(r+be)+ye+Se+4}return n}(e,t),"png","PNG");if(v.USE_HEIC&&function(e){if(!e)return 0;try{var t=We(e,0);return t&&-1!==["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"].indexOf(t.majorBrand)}catch(e){return 0}}(e))return tt(function(e){return Xe(e)}(e),"heic","HEIC");if(v.USE_AVIF&&function(e){if(!e)return 0;try{var t=We(e,0);return t&&"avif"===t.majorBrand}catch(e){return 0}}(e))return tt(function(e){return Xe(e)}(e),"avif","AVIF");if(v.USE_WEBP&&function(e){return!!e&&"RIFF"===a(e,0,4)&&"WEBP"===a(e,8,4)}(e))return tt(function(e){for(var t,n,r,i,o=12,u=0;o+8<e.byteLength;){var c=a(e,o,4),f=e.getUint32(o+4,1);v.USE_EXIF&&"EXIF"===c?(u=1,t="Exif\0\0"===a(e,o+8,6)?o+8+6:o+8):v.USE_XMP&&"XMP "===c?(u=1,n=[{dataOffset:o+8,length:f}]):v.USE_ICC&&"ICCP"===c?(u=1,r=[{offset:o+8,length:f,chunkNumber:1,chunksTotal:1}]):"VP8X"===c&&(u=1,i=o+8),o+=8+(f%2==0?f:f+1)}return{hasAppMarkers:u,tiffHeaderOffset:t,xmpChunks:n,iccChunks:r,vp8xChunkOffset:i}}(e),"webp","WebP");if(v.USE_GIF&&function(e){return!!e&&$e.includes(a(e,0,qe))}(e))return tt({gifHeaderOffset:0},"gif","GIF");if(v.USE_XMP&&function(e){return!!e&&a(e,Qe,Ze.length)===Ze}(e))return tt(function(e){var t=[];return t.push({dataOffset:Qe,length:e.byteLength}),{xmpChunks:t}}(e),"xml","XML");throw Error("Invalid image format")}};function tt(e,t,n){return l({},e,{fileType:{value:t,description:n}})}var nt={ApertureValue:function(e){return Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},ColorSpace:function(e){return 1===e?"sRGB":65535===e?"Uncalibrated":"Unknown"},ComponentsConfiguration:function(e){return e.map((function(e){return 49===e?"Y":50===e?"Cb":51===e?"Cr":52===e?"R":53===e?"G":54===e?"B":void 0})).join("")},Contrast:function(e){return 0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown"},CustomRendered:function(e){return 0===e?"Normal process":1===e?"Custom process":"Unknown"},ExposureMode:function(e){return 0===e?"Auto exposure":1===e?"Manual exposure":2===e?"Auto bracket":"Unknown"},ExposureProgram:function(e){return 0===e?"Undefined":1===e?"Manual":2===e?"Normal program":3===e?"Aperture priority":4===e?"Shutter priority":5===e?"Creative program":6===e?"Action program":7===e?"Portrait mode":8===e?"Landscape mode":9===e?"Bulb":"Unknown"},ExposureTime:function(e){if(e[0]/e[1]>.25){var t=e[0]/e[1];return Number.isInteger(t)?""+t:t.toFixed(1)}return 0!==e[0]?"1/".concat(Math.round(e[1]/e[0])):"0/".concat(e[1])},FNumber:function(e){return"f/".concat(e[0]/e[1])},FocalLength:function(e){return e[0]/e[1]+" mm"},FocalPlaneResolutionUnit:function(e){return 2===e?"inches":3===e?"centimeters":"Unknown"},LightSource:function(e){return 1===e?"Daylight":2===e?"Fluorescent":3===e?"Tungsten (incandescent light)":4===e?"Flash":9===e?"Fine weather":10===e?"Cloudy weather":11===e?"Shade":12===e?"Daylight fluorescent (D 5700 – 7100K)":13===e?"Day white fluorescent (N 4600 – 5400K)":14===e?"Cool white fluorescent (W 3900 – 4500K)":15===e?"White fluorescent (WW 3200 – 3700K)":17===e?"Standard light A":18===e?"Standard light B":19===e?"Standard light C":20===e?"D55":21===e?"D65":22===e?"D75":23===e?"D50":24===e?"ISO studio tungsten":255===e?"Other light source":"Unknown"},MeteringMode:function(e){return 1===e?"Average":2===e?"CenterWeightedAverage":3===e?"Spot":4===e?"MultiSpot":5===e?"Pattern":6===e?"Partial":255===e?"Other":"Unknown"},ResolutionUnit:function(e){return 2===e?"inches":3===e?"centimeters":"Unknown"},Saturation:function(e){return 0===e?"Normal":1===e?"Low saturation":2===e?"High saturation":"Unknown"},SceneCaptureType:function(e){return 0===e?"Standard":1===e?"Landscape":2===e?"Portrait":3===e?"Night scene":"Unknown"},Sharpness:function(e){return 0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown"},ShutterSpeedValue:function(e){var t=Math.pow(2,e[0]/e[1]);return t<=1?"".concat(Math.round(1/t)):"1/".concat(Math.round(t))},WhiteBalance:function(e){return 0===e?"Auto white balance":1===e?"Manual white balance":"Unknown"},XResolution:function(e){return""+Math.round(e[0]/e[1])},YResolution:function(e){return""+Math.round(e[0]/e[1])}},rt={11:"ProcessingSoftware",254:{name:"SubfileType",description:function(e){return{0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image",3:"Single page of multi-page reduced-resolution image",4:"Transparency mask",5:"Transparency mask of reduced-resolution image",6:"Transparency mask of multi-page image",7:"Transparency mask of reduced-resolution multi-page image",65537:"Alternate reduced-resolution image",4294967295:"Invalid"}[e]||"Unknown"}},255:{name:"OldSubfileType",description:function(e){return{0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image"}[e]||"Unknown"}},256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:{name:"Thresholding",description:function(e){return{1:"No dithering or halftoning",2:"Ordered dither or halfton",3:"Randomized dither"}[e]||"Unknown"}},264:"CellWidth",265:"CellLength",266:{name:"FillOrder",description:function(e){return{1:"Normal",2:"Reversed"}[e]||"Unknown"}},269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:function(e){return 1===e?"top-left":2===e?"top-right":3===e?"bottom-right":4===e?"bottom-left":5===e?"left-top":6===e?"right-top":7===e?"right-bottom":8===e?"left-bottom":"Undefined"}},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:nt.XResolution},283:{name:"YResolution",description:nt.YResolution},284:"PlanarConfiguration",285:"PageName",286:{name:"XPosition",description:function(e){return""+Math.round(e[0]/e[1])}},287:{name:"YPosition",description:function(e){return""+Math.round(e[0]/e[1])}},290:{name:"GrayResponseUnit",description:function(e){return{1:"0.1",2:"0.001",3:"0.0001",4:"1e-05",5:"1e-06"}[e]||"Unknown"}},296:{name:"ResolutionUnit",description:nt.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:function(e){return e.map((function(e){return"".concat(e[0],"/").concat(e[1])})).join(", ")}},319:{name:"PrimaryChromaticities",description:function(e){return e.map((function(e){return"".concat(e[0],"/").concat(e[1])})).join(", ")}},321:"HalftoneHints",322:"TileWidth",323:"TileLength",330:"A100DataOffset",332:{name:"InkSet",description:function(e){return{1:"CMYK",2:"Not CMYK"}[e]||"Unknown"}},337:"TargetPrinter",338:{name:"ExtraSamples",description:function(e){return{0:"Unspecified",1:"Associated Alpha",2:"Unassociated Alpha"}[e]||"Unknown"}},339:{name:"SampleFormat",description:function(e){var t={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map((function(e){return t[e]||"Unknown"})).join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:function(e){return e.map((function(e){return""+e[0]/e[1]})).join("/")}},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:function(e){return 1===e?"centered":2===e?"co-sited":"undefined "+e}},532:{name:"ReferenceBlackWhite",description:function(e){return e.map((function(e){return""+e[0]/e[1]})).join(", ")}},700:"ApplicationNotes",18246:"Rating",18249:"RatingPercent",33432:{name:"Copyright",description:function(e){return e.join("; ")}},33550:"PixelScale",33723:"IPTC-NAA",33920:"IntergraphMatrix",33922:"ModelTiePoint",34118:"SEMInfo",34264:"ModelTransform",34377:"PhotoshopSettings",34665:"Exif IFD Pointer",34675:"ICC_Profile",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34853:"GPS Info IFD Pointer",40091:{name:"XPTitle",description:it},40092:{name:"XPComment",description:it},40093:{name:"XPAuthor",description:it},40094:{name:"XPKeywords",description:it},40095:{name:"XPSubject",description:it},42112:"GDALMetadata",42113:"GDALNoData",50341:"PrintIM",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",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",50736:"DNGLensInfo",50739:"ShadowScale",50741:{name:"MakerNoteSafety",description:function(e){return{0:"Unsafe",1:"Safe"}[e]||"Unknown"}},50778:{name:"CalibrationIlluminant1",description:nt.LightSource},50779:{name:"CalibrationIlluminant2",description:nt.LightSource},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:{name:"ProfileEmbedPolicy",description:function(e){return{0:"Allow Copying",1:"Embed if Used",2:"Never Embed",3:"No Restrictions"}[e]||"Unknown"}},50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:{name:"PreviewColorSpace",description:function(e){return{1:"Gray Gamma 2.2",2:"sRGB",3:"Adobe RGB",4:"ProPhoto RGB"}[e]||"Unknown"}},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:{name:"ProfileHueSatMapEncoding",description:function(e){return{0:"Linear",1:"sRGB"}[e]||"Unknown"}},51108:{name:"ProfileLookTableEncoding",description:function(e){return{0:"Linear",1:"sRGB"}[e]||"Unknown"}},51109:"BaselineExposureOffset",51110:{name:"DefaultBlackRender",description:function(e){return{0:"Auto",1:"None"}[e]||"Unknown"}},51111:"NewRawImageDigest",51112:"RawToPreviewGain"};function it(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}function ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function at(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ut={0:{name:"GPSVersionID",description:function(e){return 2===e[0]&&2===e[1]&&0===e[2]&&0===e[3]?"Version 2.2":"Unknown"}},1:{name:"GPSLatitudeRef",description:function(e){var t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:b},3:{name:"GPSLongitudeRef",description:function(e){var t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:b},5:{name:"GPSAltitudeRef",description:function(e){return 0===e?"Sea level":1===e?"Sea level reference (negative value)":"Unknown"}},6:{name:"GPSAltitude",description:function(e){return e[0]/e[1]+" m"}},7:{name:"GPSTimeStamp",description:function(e){return e.map((function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=e)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return at(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?at(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0]/n[1];return/^\d(\.|$)/.test("".concat(r))?"0".concat(r):r})).join(":")}},8:"GPSSatellites",9:{name:"GPSStatus",description:function(e){var t=e.join("");return"A"===t?"Measurement in progress":"V"===t?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:function(e){var t=e.join("");return"2"===t?"2-dimensional measurement":"3"===t?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:function(e){var t=e.join("");return"K"===t?"Kilometers per hour":"M"===t?"Miles per hour":"N"===t?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:function(e){var t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:function(e){var t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:function(e){var t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:function(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}},21:{name:"GPSDestLongitudeRef",description:function(e){var t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:function(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}},23:{name:"GPSDestBearingRef",description:function(e){var t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:function(e){var t=e.join("");return"K"===t?"Kilometers":"M"===t?"Miles":"N"===t?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:S},28:{name:"GPSAreaInformation",description:S},29:"GPSDateStamp",30:{name:"GPSDifferential",description:function(e){return 0===e?"Measurement without differential correction":1===e?"Differential correction applied":"Unknown"}},31:"GPSHPositioningError"},ct={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:function(e){return y(e)}},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},ft={45056:{name:"MPFVersion",description:function(e){return y(e)}},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"};function st(e){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},st(e)}function lt(e,t,n){return(t=function(e){var t=function(e){if("object"!=st(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return e+""}(e);return"symbol"==st(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:1,configurable:1,writable:1}):e[t]=n,e}var dt=l({},rt,{33434:{name:"ExposureTime",description:nt.ExposureTime},33437:{name:"FNumber",description:nt.FNumber},34850:{name:"ExposureProgram",description:nt.ExposureProgram},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:function(){return"[Raw OECF table data]"}},34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:{name:"SensitivityType",description:function(e){return{1:"Standard Output Sensitivity",2:"Recommended Exposure Index",3:"ISO Speed",4:"Standard Output Sensitivity and Recommended Exposure Index",5:"Standard Output Sensitivity and ISO Speed",6:"Recommended Exposure Index and ISO Speed",7:"Standard Output Sensitivity, Recommended Exposure Index and ISO Speed"}[e]||"Unknown"}},34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:{name:"ExifVersion",description:function(e){return y(e)}},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:nt.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:nt.ShutterSpeedValue},37378:{name:"ApertureValue",description:nt.ApertureValue},37379:"BrightnessValue",37380:"ExposureBiasValue",37381:{name:"MaxApertureValue",description:function(e){return Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)}},37382:{name:"SubjectDistance",description:function(e){return e[0]/e[1]+" m"}},37383:{name:"MeteringMode",description:nt.MeteringMode},37384:{name:"LightSource",description:nt.LightSource},37385:{name:"Flash",description:function(e){return 0===e?"Flash did not fire":1===e?"Flash fired":5===e?"Strobe return light not detected":7===e?"Strobe return light detected":9===e?"Flash fired, compulsory flash mode":13===e?"Flash fired, compulsory flash mode, return light not detected":15===e?"Flash fired, compulsory flash mode, return light detected":16===e?"Flash did not fire, compulsory flash mode":24===e?"Flash did not fire, auto mode":25===e?"Flash fired, auto mode":29===e?"Flash fired, auto mode, return light not detected":31===e?"Flash fired, auto mode, return light detected":32===e?"No flash function":65===e?"Flash fired, red-eye reduction mode":69===e?"Flash fired, red-eye reduction mode, return light not detected":71===e?"Flash fired, red-eye reduction mode, return light detected":73===e?"Flash fired, compulsory flash mode, red-eye reduction mode":77===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":79===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":89===e?"Flash fired, auto mode, red-eye reduction mode":93===e?"Flash fired, auto mode, return light not detected, red-eye reduction mode":95===e?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"}},37386:{name:"FocalLength",description:nt.FocalLength},37393:"ImageNumber",37394:{name:"SecurityClassification",description:function(e){return{C:"Confidential",R:"Restricted",S:"Secret",T:"Top Secret",U:"Unclassified"}[e]||"Unknown"}},37395:"ImageHistory",37396:{name:"SubjectArea",description:function(e){return 2===e.length?"Location; X: ".concat(e[0],", Y: ").concat(e[1]):3===e.length?"Circle; X: ".concat(e[0],", Y: ").concat(e[1],", diameter: ").concat(e[2]):4===e.length?"Rectangle; X: ".concat(e[0],", Y: ").concat(e[1],", width: ").concat(e[2],", height: ").concat(e[3]):"Unknown"}},37500:{name:"MakerNote",description:function(){return"[Raw maker note data]"}},37510:{name:"UserComment",description:S},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37724:"ImageSourceData",37888:{name:"AmbientTemperature",description:function(e){return e[0]/e[1]+" °C"}},37889:{name:"Humidity",description:function(e){return e[0]/e[1]+" %"}},37890:{name:"Pressure",description:function(e){return e[0]/e[1]+" hPa"}},37891:{name:"WaterDepth",description:function(e){return e[0]/e[1]+" m"}},37892:{name:"Acceleration",description:function(e){return e[0]/e[1]+" mGal"}},37893:{name:"CameraElevationAngle",description:function(e){return e[0]/e[1]+" °"}},40960:{name:"FlashpixVersion",description:function(e){return e.map((function(e){return String.fromCharCode(e)})).join("")}},40961:{name:"ColorSpace",description:nt.ColorSpace},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:function(){return"[Raw SFR table data]"}},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:nt.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=e)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return ot(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ot(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],i=n[1];return"X: ".concat(r,", Y: ").concat(i)}},41493:"ExposureIndex",41495:{name:"SensingMethod",description:function(e){return 1===e?"Undefined":2===e?"One-chip color area sensor":3===e?"Two-chip color area sensor":4===e?"Three-chip color area sensor":5===e?"Color sequential area sensor":7===e?"Trilinear sensor":8===e?"Color sequential linear sensor":"Unknown"}},41728:{name:"FileSource",description:function(e){return 3===e?"DSC":"Unknown"}},41729:{name:"SceneType",description:function(e){return 1===e?"A directly photographed image":"Unknown"}},41730:{name:"CFAPattern",description:function(){return"[Raw CFA pattern table data]"}},41985:{name:"CustomRendered",description:nt.CustomRendered},41986:{name:"ExposureMode",description:nt.ExposureMode},41987:{name:"WhiteBalance",description:nt.WhiteBalance},41988:{name:"DigitalZoomRatio",description:function(e){return 0===e[0]?"Digital zoom was not used":""+e[0]/e[1]}},41989:{name:"FocalLengthIn35mmFilm",description:function(e){return 0===e?"Unknown":e}},41990:{name:"SceneCaptureType",description:nt.SceneCaptureType},41991:{name:"GainControl",description:function(e){return 0===e?"None":1===e?"Low gain up":2===e?"High gain up":3===e?"Low gain down":4===e?"High gain down":"Unknown"}},41992:{name:"Contrast",description:nt.Contrast},41993:{name:"Saturation",description:nt.Saturation},41994:{name:"Sharpness",description:nt.Sharpness},41995:{name:"DeviceSettingDescription",description:function(){return"[Raw device settings table data]"}},41996:{name:"SubjectDistanceRange",description:function(e){return 1===e?"Macro":2===e?"Close view":3===e?"Distant view":"Unknown"}},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:function(e){var t=parseFloat((e[0][0]/e[0][1]).toFixed(5)),n=parseFloat((e[1][0]/e[1][1]).toFixed(5)),r="".concat(t,"-").concat(n," mm");if(0===e[3][1])return"".concat(r," f/?");var i=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return"".concat(r," f/").concat(parseFloat(i.toFixed(5)))}},42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42080:{name:"CompositeImage",description:function(e){return{1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}[e]||"Unknown"}},42081:"SourceImageNumberOfCompositeImage",42082:"SourceExposureTimesOfCompositeImage",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"}),pt="0th",mt="exif",gt="interoperability",ht="canon",vt=lt(lt(lt(lt(lt(lt(lt({},pt,dt),"1st",rt),mt,dt),"gps",ut),gt,ct),"mpf",v.USE_MPF?ft:{}),ht,v.USE_MAKER_NOTES?{4:{name:"ShotInfo",description:function(e){return e}}}:{}),yt={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},St={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13},bt={getAsciiValue:function(e){return e.map((function(e){return String.fromCharCode(e)}))},getByteAt:It,getAsciiAt:function(e,t){return e.getUint8(t)},getShortAt:function(e,t,n){return e.getUint16(t,n===C)},getLongAt:Ct,getRationalAt:function(e,t,n){return[Ct(e,t,n),Ct(e,t+4,n)]},getUndefinedAt:function(e,t){return It(e,t)},getSlongAt:Ut,getSrationalAt:function(e,t,n){return[Ut(e,t,n),Ut(e,t+4,n)]},getIfdPointerAt:function(e,t,n){return Ct(e,t,n)},typeSizes:yt,tagTypes:St,getTypeSize:function(e){if(void 0===St[e])throw Error("No such type found.");return yt[St[e]]}};function It(e,t){return e.getUint8(t)}function Ct(e,t,n){return e.getUint32(t,n===C)}function Ut(e,t,n){return e.getInt32(t,n===C)}var Pt={1:bt.getByteAt,2:bt.getAsciiAt,3:bt.getShortAt,4:bt.getLongAt,5:bt.getRationalAt,7:bt.getUndefinedAt,9:bt.getSlongAt,10:bt.getSrationalAt,13:bt.getIfdPointerAt};function At(e,t,n){return t+bt.getLongAt(e,t+4,n)}function Et(e,t,n,r,i,o){var a=bt.getTypeSize("SHORT"),u={},c=function(e,t,n){return t+bt.getTypeSize("SHORT")<=e.byteLength?bt.getShortAt(e,t,n):0}(e,r,i);r+=a;for(var f=0;f<c&&!(r+12>e.byteLength);f++){var s=wt(e,t,n,r,i,o);void 0!==s&&(u[s.name]={id:s.id,value:s.value,description:s.description},"MakerNote"===s.name&&(u[s.name].__offset=s.__offset)),r+=12}if(v.USE_THUMBNAIL&&r<e.byteLength-bt.getTypeSize("LONG")){var l=bt.getLongAt(e,r,i);0!==l&&t===pt&&(u.Thumbnail=Et(e,"1st",n,n+l,i,o))}return u}function wt(e,t,n,r,i,o){var a,u,c=bt.getTypeSize("SHORT"),f=c+bt.getTypeSize("SHORT"),s=f+bt.getTypeSize("LONG"),l=bt.getShortAt(e,r,i),d=bt.getShortAt(e,r+c,i),p=bt.getLongAt(e,r+f,i);if(void 0!==bt.typeSizes[d]&&(o||void 0!==vt[t][l])){a=function(e,t){return bt.typeSizes[e]*t<=bt.getTypeSize("LONG")}(d,p)?Tt(e,u=r+s,d,p,i):function(e,t,n,r,i){return t+n+bt.typeSizes[r]*i<=e.byteLength}(e,n,u=bt.getLongAt(e,r+s,i),d,p)?Tt(e,n+u,d,p,i,33723===l):"<faulty value>",d===bt.tagTypes.ASCII&&(a=function(e){try{return e.map((function(e){return decodeURIComponent(escape(e))}))}catch(t){return e}}(a=function(e){for(var t=[],n=0,r=0;r<e.length;r++)"\0"!==e[r]?(void 0===t[n]&&(t[n]=""),t[n]+=e[r]):n++;return t}(a)));var m="undefined-".concat(l),g=a;if(void 0!==vt[t][l])if(void 0!==vt[t][l].name&&void 0!==vt[t][l].description){m=vt[t][l].name;try{g=vt[t][l].description(a)}catch(e){g=xt(a)}}else d===bt.tagTypes.RATIONAL||d===bt.tagTypes.SRATIONAL?(m=vt[t][l],g=""+a[0]/a[1]):(m=vt[t][l],g=xt(a));return{id:l,name:m,value:a,description:g,__offset:u}}}function Tt(e,t,n,r,i){var o=[];arguments.length>5&&void 0!==arguments[5]&&arguments[5]&&(r*=bt.typeSizes[n],n=bt.tagTypes.BYTE);for(var a=0;a<r;a++)o.push(Pt[n](e,t,i)),t+=bt.typeSizes[n];return n===bt.tagTypes.ASCII?o=bt.getAsciiValue(o):1===o.length&&(o=o[0]),o}function xt(e){return e instanceof Array?e.join(", "):e}var Ft="Exif IFD Pointer",Mt="GPS Info IFD Pointer",Ot="Interoperability IFD Pointer",kt={read:function(e,t,n){var r=U(e,t),i=function(e,t,n,r){return Et(e,pt,t,At(e,t,n),n,r)}(e,t,r,n);return{tags:i=Nt(i=Rt(i=Dt(i,e,t,r,n),e,t,r,n),e,t,r,n),byteOrder:r}}};function Dt(e,t,n,r,i){return void 0!==e[Ft]?l(e,Et(t,mt,n,n+e[Ft].value,r,i)):e}function Rt(e,t,n,r,i){return void 0!==e[Mt]?l(e,Et(t,"gps",n,n+e[Mt].value,r,i)):e}function Nt(e,t,n,r,i){return void 0!==e[Ot]?l(e,Et(t,gt,n,n+e[Ot].value,r,i)):e}var Lt={read:function(e,t,n){var r=U(e,t);return function(e,t,n,r){if(!n.MPEntry)return n;for(var i=[],o=0;o<Math.ceil(n.MPEntry.value.length/_t);o++){i[o]={};var a=Bt(n.MPEntry.value,o*_t,bt.getTypeSize("LONG"),r);i[o].ImageFlags=Gt(a),i[o].ImageFormat=jt(a),i[o].ImageType=zt(a);var u=Bt(n.MPEntry.value,o*_t+4,bt.getTypeSize("LONG"),r);i[o].ImageSize={value:u,description:""+u};var c=Vt(o,n.MPEntry,r,t);i[o].ImageOffset={value:c,description:""+c};var f=Bt(n.MPEntry.value,o*_t+12,bt.getTypeSize("SHORT"),r);i[o].DependentImage1EntryNumber={value:f,description:""+f};var s=Bt(n.MPEntry.value,o*_t+14,bt.getTypeSize("SHORT"),r);i[o].DependentImage2EntryNumber={value:s,description:""+s},i[o].image=e.buffer.slice(c,c+u),d(i[o],"base64",(function(){return p(this.image)}))}return n.Images=i,n}(e,t,Et(e,"mpf",t,At(e,t,r),r,n),r)}},_t=16;function Bt(e,t,n,r){if(r===C){for(var i=0,o=0;o<n;o++)i+=e[t+o]<<8*o;return i}for(var a=0,u=0;u<n;u++)a+=e[t+u]<<8*(n-1-u);return a}function Gt(e){var t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function jt(e){var t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function zt(e){var t=16777215&e;return{value:t,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[t]||"Unknown"}}function Vt(e,t,n,r){return function(e){return 0===e}(e)?0:Bt(t.value,e*_t+8,bt.getTypeSize("LONG"),n)+r}var Ht={read:function(e,t){var n=function(e,t){return bt.getShortAt(e,t)}(e,t),r=function(e,t,n){if(!(8>n)){var r=bt.getByteAt(e,t+7);return{value:r,description:""+r}}}(e,t,n);return{"Bits Per Sample":Wt(e,t,n),"Image Height":Xt(e,t,n),"Image Width":Jt(e,t,n),"Color Components":r,Subsampling:r&&Yt(e,t,r.value,n)}}};function Wt(e,t,n){if(!(3>n)){var r=bt.getByteAt(e,t+2);return{value:r,description:""+r}}}function Xt(e,t,n){if(!(5>n)){var r=bt.getShortAt(e,t+3);return{value:r,description:"".concat(r,"px")}}}function Jt(e,t,n){if(!(7>n)){var r=bt.getShortAt(e,t+5);return{value:r,description:"".concat(r,"px")}}}function Yt(e,t,n,r){if(!(8+3*n>r)){for(var i=[],o=0;o<n;o++){var a=t+8+3*o;i.push([bt.getByteAt(e,a),bt.getByteAt(e,a+1),bt.getByteAt(e,a+2)])}return{value:i,description:i.length>1?Kt(i)+qt(i):""}}}function Kt(e){var t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((function(e){return t[e[0]]})).join("")}function qt(e){var t={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var $t={read:function(e,t){var n=function(e,t){return bt.getShortAt(e,t)}(e,t),r=function(e,t,n){if(!(15>n)){var r=bt.getByteAt(e,t+14);return{value:r,description:"".concat(r,"px")}}}(e,t,n),i=function(e,t,n){if(!(16>n)){var r=bt.getByteAt(e,t+15);return{value:r,description:"".concat(r,"px")}}}(e,t,n),o={"JFIF Version":Qt(e,t,n),"Resolution Unit":Zt(e,t,n),XResolution:tn(e,t,n),YResolution:nn(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(void 0!==r&&void 0!==i){var a=function(e,t,n,r){if(!(0===n||16+n>r))return{value:e.buffer.slice(t+16,t+16+n),description:"<24-bit RGB pixel data>"}}(e,t,3*r.value*i.value,n);a&&(o["JFIF Thumbnail"]=a)}for(var u in o)void 0===o[u]&&delete o[u];return o}};function Qt(e,t,n){if(!(9>n)){var r=bt.getByteAt(e,t+7),i=bt.getByteAt(e,t+7+1);return{value:256*r+i,description:r+"."+i}}}function Zt(e,t,n){if(!(10>n)){var r=bt.getByteAt(e,t+9);return{value:r,description:en(r)}}}function en(e){return 0===e?"None":1===e?"inches":2===e?"cm":"Unknown"}function tn(e,t,n){if(!(12>n)){var r=bt.getShortAt(e,t+10);return{value:r,description:""+r}}}function nn(e,t,n){if(!(14>n)){var r=bt.getShortAt(e,t+12);return{value:r,description:""+r}}}var rn={iptc:{256:{name:"Model Version",description:function(e){return""+((e[0]<<8)+e[1])}},261:{name:"Destination",repeatable:1},276:{name:"File Format",description:function(e){return""+((e[0]<<8)+e[1])}},278:{name:"File Format Version",description:function(e){return""+((e[0]<<8)+e[1])}},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:on},336:{name:"Time Sent",description:an},346:{name:"Coded Character Set",description:un,encoding_name:un},356:"UNO",376:{name:"ARM Identifier",description:function(e){return""+((e[0]<<8)+e[1])}},378:{name:"ARM Version",description:function(e){return""+((e[0]<<8)+e[1])}},512:{name:"Record Version",description:function(e){return""+((e[0]<<8)+e[1])}},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:function(e){return"01"===y(e)?"Additional Language":"Unknown"}},522:"Urgency",524:{name:"Subject Reference",repeatable:1,description:function(e){var t=y(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:1},534:"Fixture Identifier",537:{name:"Keywords",repeatable:1},538:{name:"Content Location Code",repeatable:1},539:{name:"Content Location Name",repeatable:1},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:function(e){var t=y(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:1},559:{name:"Reference Date",repeatable:1},562:{name:"Reference Number",repeatable:1},567:{name:"Date Created",description:on},572:{name:"Time Created",description:an},574:{name:"Digital Creation Date",description:on},575:{name:"Digital Creation Time",description:an},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:function(e){var t=y(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"both":"Unknown"}},592:{name:"By-line",repeatable:1},597:{name:"By-line Title",repeatable:1},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:1},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:1},637:{name:"Rasterized Caption",description:function(e){return e}},642:"Image Type",643:{name:"Image Orientation",description:function(e){var t=y(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:function(e){var t=y(e),n=t.charAt(0),r=t.charAt(1),i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:function(e){return parseInt(y(e),10)+" Hz"}},664:{name:"Audio Sampling Resolution",description:function(e){var t=parseInt(y(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:function(e){var t=y(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:function(e){return 2===e.length?"ObjectData Preview File Format":"Record 2 destination"},description:function(e){if(2===e.length){var t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":"Unknown format ".concat(t)}return y(e)}},713:{name:"ObjectData Preview File Format Version",description:function(e,t){var n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},r=y(e);if(t["ObjectData Preview File Format"]){var i=y(t["ObjectData Preview File Format"].value);if(n[i]&&n[i][r])return n[i][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:function(e){return e[0].toString()}},1812:{name:"Max Subfile Size",description:function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:"ObjectData Size Announced",description:function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:"Maximum ObjectData Size",description:function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function on(e){var t=y(e);return t.length>=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function an(e){var t=y(e),n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function un(e){var t=y(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var cn=function(e,t){var n=function(){if("undefined"!=typeof TextDecoder)return TextDecoder}();if("undefined"!=typeof n&&void 0!==e)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch(e){}return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t.map((function(e){return String.fromCharCode(e)})).join(""))},fn={read:function(e,t,n){try{if(Array.isArray(e))return pn(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n);var r=function(e,t){for(;t+12<=e.byteLength;){var n=sn(e,t);if(ln(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+dn(n)}throw Error("No IPTC NAA resource block.")}(e,t);return pn(e,r.naaBlock,r.dataOffset,n)}catch(e){return{}}}};function sn(e,t){if(943868237!==e.getUint32(t,0))throw Error("Not an IPTC resource block.");var n=e.getUint8(t+4+2),r=(n%2==0?n+1:n)+1;return{headerSize:6+r+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+r)}}function ln(e){return 1028===e.type}function dn(e){return e.size%2!=0?1:0}function pn(e,t,n,r){for(var i={},o=void 0,a=n+t.size;n<a&&n<e.byteLength;){var u=mn(e,n,i,o,r),c=u.tag,f=u.tagSize;if(null===c)break;c&&("encoding"in c&&(o=c.encoding),void 0===i[c.name]||void 0===c.repeatable?i[c.name]={id:c.id,value:c.value,description:c.description}:(i[c.name]instanceof Array||(i[c.name]=[{id:i[c.name].id,value:i[c.name].value,description:i[c.name].description}]),i[c.name].push({id:c.id,value:c.value,description:c.description}))),n+=5+f}return i}function mn(e,t,n,r,i){if(function(e,t){return 28!==e.getUint8(t)}(e,t))return{tag:null,tagSize:0};var o=e.getUint16(t+1),a=e.getUint16(t+3);if(!i&&!rn.iptc[o])return{tag:void 0,tagSize:a};var u=function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(e.getUint8(t+i));return r}(e,t+5,a),c={id:o,name:gn(rn.iptc[o],o,u),value:u,description:hn(rn.iptc[o],u,n,r)};return function(e){return rn.iptc[e]&&rn.iptc[e].repeatable}(o)&&(c.repeatable=1),function(e){return rn.iptc[e]&&void 0!==rn.iptc[e].encoding_name}(o)&&(c.encoding=rn.iptc[o].encoding_name(u)),{tag:c,tagSize:a}}function gn(e,t,n){return e?function(e){return"string"==typeof e}(e)?e:function(e){return"function"==typeof e.name}(e)?e.name(n):e.name:"undefined-".concat(t)}function hn(e,t,n,r){if(function(e){return e&&void 0!==e.description}(e))try{return e.description(t,n)}catch(e){}return function(e,t){return e&&t instanceof Array}(e,t)?cn(r,t):t}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var yn={"tiff:Orientation":function(e){return"1"===e?"Horizontal (normal)":"2"===e?"Mirror horizontal":"3"===e?"Rotate 180":"4"===e?"Mirror vertical":"5"===e?"Mirror horizontal and rotate 270 CW":"6"===e?"Rotate 90 CW":"7"===e?"Mirror horizontal and rotate 90 CW":"8"===e?"Rotate 270 CW":e},"tiff:ResolutionUnit":function(e){return nt.ResolutionUnit(parseInt(e,10))},"tiff:XResolution":function(e){return Sn(nt.XResolution,e)},"tiff:YResolution":function(e){return Sn(nt.YResolution,e)},"exif:ApertureValue":function(e){return Sn(nt.ApertureValue,e)},"exif:GPSLatitude":In,"exif:GPSLongitude":In,"exif:FNumber":function(e){return Sn(nt.FNumber,e)},"exif:FocalLength":function(e){return Sn(nt.FocalLength,e)},"exif:FocalPlaneResolutionUnit":function(e){return nt.FocalPlaneResolutionUnit(parseInt(e,10))},"exif:ColorSpace":function(e){return nt.ColorSpace(function(e){return"0x"===e.substring(0,2)?parseInt(e.substring(2),16):parseInt(e,10)}(e))},"exif:ComponentsConfiguration":function(e,t){if(/^\d, \d, \d, \d$/.test(t)){var n=t.split(", ").map((function(e){return e.charCodeAt(0)}));return nt.ComponentsConfiguration(n)}return t},"exif:Contrast":function(e){return nt.Contrast(parseInt(e,10))},"exif:CustomRendered":function(e){return nt.CustomRendered(parseInt(e,10))},"exif:ExposureMode":function(e){return nt.ExposureMode(parseInt(e,10))},"exif:ExposureProgram":function(e){return nt.ExposureProgram(parseInt(e,10))},"exif:ExposureTime":function(e){return bn(e)?nt.ExposureTime(e.split("/").map((function(e){return parseInt(e,10)}))):e},"exif:MeteringMode":function(e){return nt.MeteringMode(parseInt(e,10))},"exif:Saturation":function(e){return nt.Saturation(parseInt(e,10))},"exif:SceneCaptureType":function(e){return nt.SceneCaptureType(parseInt(e,10))},"exif:Sharpness":function(e){return nt.Sharpness(parseInt(e,10))},"exif:ShutterSpeedValue":function(e){return Sn(nt.ShutterSpeedValue,e)},"exif:WhiteBalance":function(e){return nt.WhiteBalance(parseInt(e,10))}};function Sn(e,t){return bn(t)?e(t.split("/")):t}function bn(e){return/^-?\d+\/-?\d+$/.test(e)}function In(e){var t,n=function(e){if(Array.isArray(e))return e}(t=e.split(","))||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return vn(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vn(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],i=n[1];if(void 0!==r&&void 0!==i){var o=parseFloat(r),a=parseFloat(i),u=i.charAt(i.length-1);if(!Number.isNaN(o)&&!Number.isNaN(a))return""+(o+a/60)+u}return e}function Cn(e){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cn(e)}function Un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Pn={read:function(e,t){var n={};if("string"==typeof e)return En(n,e),n;var r,i=(r=function(e,t){if(0===t.length)return[];var n=[An(e,t.slice(0,1))];return t.length>1&&n.push(An(e,t.slice(1))),n}(e,t),function(e){if(Array.isArray(e))return e}(r)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(r)||function(e){if(e){if("string"==typeof e)return Un(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Un(e,2):void 0}}(r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],a=i[1],u=En(n,o);if(a){var c=En(n,a);u||c||(delete n._raw,En(n,An(e,t)))}return n}};function An(e,t){for(var n=t.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),i=0,o=0;o<t.length;o++){var a=t[o],u=e.buffer.slice(a.dataOffset,a.dataOffset+a.length);r.set(new Uint8Array(u),i),i+=a.length}return new DataView(r.buffer)}function En(e,t){try{var n=function(e){var t=function(){if("undefined"!=typeof DOMParser)return new DOMParser;try{var e=require("@xmldom/xmldom");return new(0,e.DOMParser)({onError:e.onErrorStopParsing})}catch(e){return}}();if(!t)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),Error();var n="string"==typeof e?e:a(e,0,e.byteLength),r=t.parseFromString(n.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1"),"application/xml");if("parsererror"===r.documentElement.nodeName)throw Error(r.documentElement.textContent);return{doc:r,raw:n}}(t),r=n.doc,i=n.raw;return e._raw=(e._raw||"")+i,l(e,Fn(Tn(wn(r),1))),1}catch(e){return 0}}function wn(e){for(var t=0;t<e.childNodes.length;t++){if("x:xmpmeta"===e.childNodes[t].tagName)return wn(e.childNodes[t]);if("rdf:RDF"===e.childNodes[t].tagName)return e.childNodes[t]}throw Error()}function Tn(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=function(e){for(var t=[],n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}(e);return 1===(t=r).length&&"#text"===t[0].nodeName?n?{}:function(e){return e.nodeValue}(r[0]):function(e){var t={};return e.forEach((function(e){if(function(e){return e.nodeName&&"#text"!==e.nodeName}(e)){var n=function(e){return{attributes:xn(e),value:Tn(e)}}(e);void 0!==t[e.nodeName]?(Array.isArray(t[e.nodeName])||(t[e.nodeName]=[t[e.nodeName]]),t[e.nodeName].push(n)):t[e.nodeName]=n}})),t}(r)}function xn(e){for(var t={},n=0;n<e.attributes.length;n++)t[e.attributes[n].nodeName]=decodeURIComponent(escape(e.attributes[n].value));return t}function Fn(e){var t={};if("string"==typeof e)return e;for(var n in e){var r=e[n];Array.isArray(r)||(r=[r]),r.forEach((function(e){l(t,Mn(e.attributes)),"object"===Cn(e.value)&&l(t,Ln(e.value))}))}return t}function Mn(e){var t={};for(var n in e)try{On(n)&&(t[Dn(n)]={value:e[n],attributes:{},description:Rn(e[n],n)})}catch(e){}return t}function On(e){return"rdf:parseType"!==e&&!kn(e)}function kn(e){return"xmlns"===e.split(":")[0]}function Dn(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function Rn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Array.isArray(e)){var n=function(e){return e.map((function(e){return void 0!==e.value?Rn(e.value):Rn(e)})).join(", ")}(e);return t&&"function"==typeof yn[t]?yn[t](e,n):n}if("object"===Cn(e))return function(e){var t=[];for(var n in e)t.push("".concat(Nn(n),": ").concat(Rn(e[n].value)));return t.join("; ")}(e);try{return t&&"function"==typeof yn[t]?yn[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function Nn(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function Ln(e){var t={};for(var n in e)try{kn(n)||(t[Dn(n)]=_n(e[n],n))}catch(e){}return t}function _n(e,t){return function(e){return Array.isArray(e)}(e)?function(e,t){return Jn(e[e.length-1],t)}(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]&&"string"==typeof e.value&&""===e.value.trim()}(e)?{value:"",attributes:{},description:""}:Bn(e)?Gn(e,t):zn(e)?Vn(e,t):Hn(e)?Wn(e,t):function(e){return void 0!==Xn(e.value)}(e)?function(e,t){var n=Xn(e.value).value["rdf:li"],r=jn(e),i=[];return void 0===n?n=[]:Array.isArray(n)||(n=[n]),n.forEach((function(e){i.push(function(e){return Bn(e)?Gn(e):zn(e)?Vn(e).value:Hn(e)?Wn(e).value:Jn(e)}(e))})),{value:i,attributes:r,description:Rn(i,t)}}(e,t):Jn(e,t)}function Bn(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function Gn(e,t){var n=jn(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),l(n,jn(e),function(e){var t={};for(var n in e.value)"rdf:value"===n||kn(n)||(t[Dn(n)]=e.value[n].value);return t}(e));var r=function(e){return Yn(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:Rn(r,t)}}function jn(e){var t={};for(var n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||kn(n)||(t[Dn(n)]=e.attributes[n]);return t}function zn(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}function Vn(e,t){var n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(l(n.value,Mn(e.value["rdf:Description"].attributes)),l(n.attributes,jn(e)),e=e.value["rdf:Description"]),l(n.value,Ln(e.value)),n.description=Rn(n.value,t),n}function Hn(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["xml:lang"]&&void 0===e.attributes["rdf:resource"]}function Wn(e,t){var n=Mn(e.attributes);return{value:n,attributes:{},description:Rn(n,t)}}function Xn(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function Jn(e,t){var n=Yn(e)||Fn(e.value);return{value:n,attributes:jn(e),description:Rn(n,t)}}function Yn(e){return e.attributes&&e.attributes["rdf:resource"]}function Kn(e){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kn(e)}function qn(e,t,n){return(t=function(e){var t=function(e){if("object"!=Kn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return e+""}(e);return"symbol"==Kn(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:1,configurable:1,writable:1}):e[t]=n,e}function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Qn={2e3:{name:"PathInformation",description:function(e){for(var t={},n=[],r=0;r<e.byteLength;r+=26){var i=bt.getShortAt(e,r);Zn[i]&&(t[i]||(t[i]=Zn[i].description),n.push({type:i,path:Zn[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}},2999:{name:"ClippingPathName",description:function(e){return(t=f(e,0),function(e){if(Array.isArray(e))return e}(t)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return $n(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?$n(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];var t}}},Zn=qn(qn(qn(qn(qn(qn(qn(qn(qn({},0,{description:"Closed subpath length",path:function(e,t){return[bt.getShortAt(e,t)]}}),1,{description:"Closed subpath Bezier knot, linked",path:er}),2,{description:"Closed subpath Bezier knot, unlinked",path:er}),3,{description:"Open subpath length",path:function(e,t){return[bt.getShortAt(e,t)]}}),4,{description:"Open subpath Bezier knot, linked",path:er}),5,{description:"Open subpath Bezier knot, unlinked",path:er}),6,{description:"Path fill rule",path:function(){return[]}}),8,{description:"Initial fill rule",path:function(e,t){return[bt.getShortAt(e,t)]}}),7,{description:"Clipboard",path:function(e,t){return[[nr(e,t,8),nr(e,t+4,8),nr(e,t+8,8),nr(e,t+12,8)],nr(e,t+16,8)]}});function er(e,t){for(var n=[],r=0;r<24;r+=8)n.push(tr(e,t+r));return n}function tr(e,t){var n=nr(e,t,8);return[nr(e,t+4,8),n]}function nr(e,t,n){var r,i=bt.getLongAt(e,t),o=i>>>31==0?1:-1,a=(2130706432&i)>>>32-n,u=i&parseInt(m("1",32-n),2);return o*function(e){return parseInt(e.replace(".",""),2)/Math.pow(2,(e.split(".")[1]||"").length)}(a.toString(2)+"."+(m("0",32-n-(r=u.toString(2)).length)+r))}function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ir={read:function(e,t){for(var n=o(new Uint8Array(e).buffer),r={},i=0;i<e.length;){var u=a(n,i,cr);i+=cr;var c=bt.getShortAt(n,i),f=fr(n,i+=ar),s=f.tagName;i+=f.tagNameSize;var l=bt.getLongAt(n,i);if(i+=ur,u===or){var d=o(n.buffer,i,l),p={id:c,value:a(d,0,l)};if(Qn[c]){try{p.description=Qn[c].description(d)}catch(e){p.description="<no description formatter>"}r[s||Qn[c].name]=p}else t&&(r["undefined-".concat(c)]=p)}i+=l+l%2}return r}},or="8BIM",ar=2,ur=4,cr=or.length;function fr(e,t){var n,r=function(e){if(Array.isArray(e))return e}(n=f(e,t))||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(n)||function(e){if(e){if("string"==typeof e)return rr(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?rr(e,2):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=r[0];return{tagName:r[1],tagNameSize:1+i+(i%2==0?1:0)}}var sr={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},lr={4:{name:"Preferred CMM type",value:function(e,t){return a(e,t,4)},description:function(e){return null!==e?dr(e):""}},8:{name:"Profile Version",value:function(e,t){return e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)}},12:{name:"Profile/Device class",value:function(e,t){return a(e,t,4)},description:function(e){switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:function(e,t){return a(e,t,4)}},20:{name:"Connection Space",value:function(e,t){return a(e,t,4)}},24:{name:"ICC Profile Date",value:function(e,t){return function(e,t){var n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),o=e.getUint16(t+6),a=e.getUint16(t+8),u=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,o,a,u))}(e,t).toISOString()}},36:{name:"ICC Signature",value:function(e,t){return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:function(e,t){return a(e,t,4)},description:function(e){return dr(e)}},48:{name:"Device Manufacturer",value:function(e,t){return a(e,t,4)},description:function(e){return dr(e)}},52:{name:"Device Model Number",value:function(e,t){return a(e,t,4)}},64:{name:"Rendering Intent",value:function(e,t){return e.getUint32(t)},description:function(e){switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:function(e,t){return a(e,t,4)}}};function dr(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}var pr={read:function(e,t,n){return n&&t[0].compressionMethod!==g?function(e,t){return 0!==t[0].compressionMethod?{}:h(new DataView(e.buffer.slice(t[0].offset,t[0].offset+t[0].length)),t[0].compressionMethod,"utf-8","dataview").then(Ur).catch((function(){return{}}))}(e,t):function(e,t){try{for(var n=t.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),i=0,o=function(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}(e),a=function(e){var n=t.find((function(t){return t.chunkNumber===e}));if(!n)throw Error("ICC chunk ".concat(e," not found"));var a=o.slice(n.offset,n.offset+n.length),u=new Uint8Array(a);r.set(u,i),i+=u.length},u=1;u<=t.length;u++)a(u);return Ur(new DataView(r.buffer))}catch(e){return{}}}(e,t)}},mr=84,gr=128,hr="acsp",vr="desc",yr="mluc",Sr="text",br="sig ",Ir=12;function Cr(e,t){return e.length<t+Ir}function Ur(e){var t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw Error("ICC profile length not matching");if(e.length<mr)throw Error("ICC profile too short");for(var r={},i=Object.keys(lr),o=0;o<i.length;o++){var u=i[o],f=lr[u],s=f.value(e,parseInt(u,10)),l=s;f.description&&(l=f.description(s)),r[f.name]={value:s,description:l}}if(Pr(t.slice(36,40))!==hr)throw Error("ICC profile: missing signature");if(function(e){return e.length<gr+4}(t))return r;for(var d=e.getUint32(128),p=132,m=0;m<d;m++){if(Cr(t,p))return r;var g=a(e,p,4),h=e.getUint32(p+4),v=e.getUint32(p+8);if(h>t.length)return r;var y=a(e,h,4);if(y===vr){var S=e.getUint32(h+8);if(S>v)return r;Ar(r,g,Pr(t.slice(h+12,h+S+11)))}else if(y===yr){for(var b=e.getUint32(h+8),I=e.getUint32(h+12),C=h+16,U=[],P=0;P<b;P++){var A=a(e,C+0,2),E=a(e,C+2,2),w=e.getUint32(C+4),T=e.getUint32(C+8),x=c(e,h+T,w);U.push({languageCode:A,countryCode:E,text:x}),C+=I}if(1===b)Ar(r,g,U[0].text);else{for(var F={},M=0;M<U.length;M++)F["".concat(U[M].languageCode,"-").concat(U[M].countryCode)]=U[M].text;Ar(r,g,F)}}else y===Sr?Ar(r,g,Pr(t.slice(h+8,h+v-7))):y===br&&Ar(r,g,Pr(t.slice(h+8,h+12)));p+=12}return r}function Pr(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function Ar(e,t,n){sr[t]?e[sr[t].name]={value:n,description:n}:e[t]={value:n,description:n}}var Er={read:function(e,t,n,r,i){var o=Et(e,ht,t,t+n,r,i);return o.ShotInfo&&delete(o=l({},o,function(e){var t,n={};return void 0!==e[27]&&(n.AutoRotate={value:e[27],description:(t=e[27],0===t?"None":1===t?"Rotate 90 CW":2===t?"Rotate 180":3===t?"Rotate 270 CW":"Unknown")}),n}(o.ShotInfo.value))).ShotInfo,o},SHOT_INFO_AUTO_ROTATE:27},wr={read:function(e,t){return{"Image Width":Tr(e,t),"Image Height":xr(e,t),"Bit Depth":Fr(e,t),"Color Type":Mr(e,t),Compression:Or(e,t),Filter:kr(e,t),Interlace:Dr(e,t)}}};function Tr(e,t){if(!(t+0+4>e.byteLength)){var n=bt.getLongAt(e,t);return{value:n,description:"".concat(n,"px")}}}function xr(e,t){if(!(t+4+4>e.byteLength)){var n=bt.getLongAt(e,t+4);return{value:n,description:"".concat(n,"px")}}}function Fr(e,t){if(!(t+8+1>e.byteLength)){var n=bt.getByteAt(e,t+8);return{value:n,description:"".concat(n)}}}function Mr(e,t){if(!(t+9+1>e.byteLength)){var n=bt.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}}function Or(e,t){if(!(t+10+1>e.byteLength)){var n=bt.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}}function kr(e,t){if(!(t+11+1>e.byteLength)){var n=bt.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}}function Dr(e,t){if(!(t+12+1>e.byteLength)){var n=bt.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}}function Rr(e){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rr(e)}var Nr={read:function(e,t,n,r){for(var i={},o=[],a=0;a<t.length;a++){var u=t[a],c=Wr(e,u.offset,u.length,u.type,n);if(c instanceof Promise)o.push(c.then((function(e){var t,n,i,o=e.name,a=e.value,u=e.description;try{if(v.USE_EXIF&&$r(o,a))return{__exif:kt.read(Zr(a),Hr,r).tags};if(v.USE_IPTC&&Qr(o,a))return{__iptc:fn.read(Zr(a),0,r)};if(o&&!$r(o,a)&&!Qr(o,a))return t={},i={value:a,description:u},(n=function(e){var t=function(e){if("object"!=Rr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Rr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return e+""}(e);return"symbol"==Rr(t)?t:t+""}(n=o))in t?Object.defineProperty(t,n,{value:i,enumerable:1,configurable:1,writable:1}):t[n]=i,t}catch(e){}return{}})));else{var f=c.name,s=c.value,l=c.description;f&&(i[f]={value:s,description:l})}}return{readTags:i,readTagsPromise:o.length>0?Promise.all(o):void 0}}},Lr="STATE_KEYWORD",_r="STATE_COMPRESSION",Br="STATE_LANG",Gr="STATE_TRANSLATED_KEYWORD",jr="STATE_TEXT",zr=1,Vr=1,Hr=6;function Wr(e,t,n,r,i){for(var o,a=[],u=[],c=[],f=Lr,s=g,l=0;l<n&&t+l<e.byteLength;l++)if(f!==_r){if(f===jr){o=new DataView(e.buffer.slice(t+l,t+n));break}var d=e.getUint8(t+l);0===d?f=Jr(r,f):f===Lr?a.push(d):f===Br?u.push(d):f===Gr&&c.push(d)}else s=Xr({type:r,dataView:e,offset:t+l}),r===Ae&&(l+=zr),f=Jr(r,f);if(s!==g&&!i)return{};var p=h(o,s,function(e){return e===Pe||e===Ee?"latin1":"utf-8"}(r));return p instanceof Promise?p.then((function(e){return Yr(e,r,u,a)})).catch((function(){return Yr("<text using unknown compression>".split(""),r,u,a)})):Yr(p,r,u,a)}function Xr(e){var t=e.type,n=e.dataView,r=e.offset;if(t===Ae){if(n.getUint8(r)===Vr)return n.getUint8(r+1)}else if(t===Ee)return n.getUint8(r);return g}function Jr(e,t){return t===Lr&&[Ae,Ee].includes(e)?_r:t===_r?e===Ae?Br:jr:t===Br?Gr:jr}function Yr(e,t,n,r){var i=function(e){return e instanceof DataView?a(e,0,e.byteLength):e}(e);return{name:Kr(t,n,r),value:i,description:t===Ae?qr(e):i}}function Kr(e,t,n){var r=s(n);if(e===Pe||0===t.length)return r;var i=s(t);return"".concat(r," (").concat(i,")")}function qr(e){return cn("UTF-8",e)}function $r(e,t){return"raw profile type exif"===e.toLowerCase()&&"exif"===t.substring(1,5)}function Qr(e,t){return"raw profile type iptc"===e.toLowerCase()&&"iptc"===t.substring(1,5)}function Zr(e){return function(e){for(var t=new DataView(new ArrayBuffer(e.length/2)),n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,""))}var ei={read:function(e,t){for(var n={},r=0;r<t.length;r++){var i=bt.getLongAt(e,t[r]+be),o=a(e,t[r]+Ie,Se);o===we?(n["Pixels Per Unit X"]=ti(e,t[r],i),n["Pixels Per Unit Y"]=ni(e,t[r],i),n["Pixel Units"]=ri(e,t[r],i)):o===Te&&(n["Modify Date"]=ii(e,t[r],i))}return n}};function ti(e,t,n){if(oi(e,t,n,0,4)){var r=bt.getLongAt(e,t+Ce+0);return{value:r,description:""+r}}}function ni(e,t,n){if(oi(e,t,n,4,4)){var r=bt.getLongAt(e,t+Ce+4);return{value:r,description:""+r}}}function ri(e,t,n){if(oi(e,t,n,8,1)){var r=bt.getByteAt(e,t+Ce+8);return{value:r,description:1===r?"meters":"Unknown"}}}function ii(e,t,n){if(oi(e,t,n,0,7)){var r=bt.getShortAt(e,t+Ce),i=bt.getByteAt(e,t+Ce+2),o=bt.getByteAt(e,t+Ce+3),a=bt.getByteAt(e,t+Ce+4),u=bt.getByteAt(e,t+Ce+5),c=bt.getByteAt(e,t+Ce+6);return{value:[r,i,o,a,u,c],description:"".concat(ai(r,4),"-").concat(ai(i,2),"-").concat(ai(o,2)," ").concat(ai(a,2),":").concat(ai(u,2),":").concat(ai(c,2))}}}function oi(e,t,n,r,i){return r+i<=n&&t+Ce+r+i<=e.byteLength}function ai(e,t){return"".concat("0".repeat(t-(""+e).length)).concat(e)}var ui={read:function(e,t){var n={},r=bt.getByteAt(e,t);return n.Alpha=function(e){var t=16&e;return{value:t?1:0,description:t?"Yes":"No"}}(r),n.Animation=function(e){var t=2&e;return{value:t?1:0,description:t?"Yes":"No"}}(r),n.ImageWidth=si(e,t+ci),n.ImageHeight=si(e,t+fi),n}},ci=4,fi=7;function si(e,t){var n=bt.getByteAt(e,t)+256*bt.getByteAt(e,t+1)+65536*bt.getByteAt(e,t+2)+1;return{value:n,description:n+"px"}}var li={read:function(e){return{"GIF Version":di(e),"Image Width":pi(e),"Image Height":mi(e),"Global Color Map":gi(e),"Bits Per Pixel":vi(e),"Color Resolution Depth":hi(e)}}};function di(e){if(!(6>e.byteLength)){var t=a(e,3,3);return{value:t,description:t}}}function pi(e){if(!(8>e.byteLength)){var t=e.getUint16(6,1);return{value:t,description:"".concat(t,"px")}}}function mi(e){if(!(10>e.byteLength)){var t=e.getUint16(8,1);return{value:t,description:"".concat(t,"px")}}}function gi(e){if(!(11>e.byteLength)){var t=(128&e.getUint8(10))>>>7;return{value:t,description:1===t?"Yes":"No"}}}function hi(e){if(!(11>e.byteLength)){var t=1+((112&e.getUint8(10))>>>4);return{value:t,description:"".concat(t," ").concat(1===t?"bit":"bits")}}}function vi(e){if(!(11>e.byteLength)){var t=1+(7&e.getUint8(10));return{value:t,description:"".concat(t," ").concat(1===t?"bit":"bits")}}}var yi=[6,7,99],Si={get:function(e,t,n){if((i=t)&&(void 0===i.Compression||yi.includes(i.Compression.value))&&i.JPEGInterchangeFormat&&i.JPEGInterchangeFormat.value&&i.JPEGInterchangeFormatLength&&i.JPEGInterchangeFormatLength.value){t.type="image/jpeg";var r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),d(t,"base64",(function(){return p(this.image)}))}var i;return t}};function bi(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=Error().stack}bi.prototype=Error();var Ii={MetadataMissingError:bi},Ci={load:Pi,loadView:Ei,errors:Ii},Ui=Ii;function Pi(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e){return"string"==typeof e}(e)?(n.async=1,function(e,t){return/^\w+:\/\//.test(e)?"undefined"!=typeof fetch?function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).length,n={method:"GET"};return Number.isInteger(t)&&t>=0&&(n.headers={range:"bytes=0-".concat(t-1)}),fetch(e,n).then((function(e){return e.arrayBuffer()}))}(e,t):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).length;return new Promise((function(n,r){var i={};Number.isInteger(t)&&t>=0&&(i.headers={range:"bytes=0-".concat(t-1)});var o=function(e){return/^https:\/\//.test(e)?require("https").get:require("http").get}(e);o(e,i,(function(e){if(e.statusCode>=200&&e.statusCode<=299){var t=[];e.on("data",(function(e){return t.push(Buffer.from(e))})),e.on("error",(function(e){return r(e)})),e.on("end",(function(){return n(Buffer.concat(t))}))}else r("Could not fetch file: ".concat(e.statusCode," ").concat(e.statusMessage)),e.resume()})).on("error",(function(e){return r(e)}))}))}(e,t):function(e){return/^data:[^;,]*(;base64)?,/.test(e)}(e)?Promise.resolve(function(e){var t=e.substring(e.indexOf(",")+1);if(-1!==e.indexOf(";base64")){if("undefined"!=typeof atob)return Uint8Array.from(atob(t),(function(e){return e.charCodeAt(0)})).buffer;if("undefined"==typeof Buffer)return;return"undefined"!=typeof Buffer.from?Buffer.from(t,"base64"):new Buffer(t,"base64")}var n=decodeURIComponent(t);return"undefined"!=typeof Buffer?"undefined"!=typeof Buffer.from?Buffer.from(n):new Buffer(n):Uint8Array.from(n,(function(e){return e.charCodeAt(0)})).buffer}(e)):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).length;return new Promise((function(n,r){var i=function(){try{return require("fs")}catch(e){return}}();i.open(e,(function(o,a){o?r(o):i.stat(e,(function(o,u){if(o)r(o);else{var c=Math.min(u.size,void 0!==t?t:u.size),f=Buffer.alloc(c),s={buffer:f,length:c};i.read(a,s,(function(t){t?r(t):i.close(a,(function(t){t&&console.warn("Could not close file ".concat(e,":"),t),n(f)}))}))}}))}))}))}(e,t)}(e,n).then((function(e){return Ai(e,n)}))):function(e){return"undefined"!=typeof window&&"undefined"!=typeof File&&e instanceof File}(e)?(n.async=1,(t=e,new Promise((function(e,n){var r=new FileReader;r.onload=function(t){return e(t.target.result)},r.onerror=function(){return n(r.error)},r.readAsArrayBuffer(t)}))).then((function(e){return Ai(e,n)}))):Ai(e,n)}function Ai(e,t){return function(e){try{return Buffer.isBuffer(e)}catch(e){return 0}}(e)&&(e=new Uint8Array(e).buffer),Ei(function(e){try{return new DataView(e)}catch(t){return new i(e)}}(e),t)}function Ei(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{expanded:0,async:0,includeUnknown:0},n=t.expanded,r=void 0===n?0:n,i=t.async,o=void 0===i?0:i,a=t.includeUnknown,u=void 0===a?0:a,c=0,f={},d=[],p=et.parseAppMarkers(e,o),m=p.fileType,g=p.fileDataOffset,h=p.jfifDataOffset,y=p.tiffHeaderOffset,S=p.iptcDataOffset,I=p.xmpChunks,C=p.iccChunks,U=p.mpfDataOffset,P=p.pngHeaderOffset,A=p.pngTextChunks,E=p.pngChunkOffsets,w=p.vp8xChunkOffset,T=p.gifHeaderOffset;if(v.USE_JPEG&&v.USE_FILE&&function(e){return void 0!==e}(g)){c=1;var x=Ht.read(e,g);r?f.file=x:f=l({},f,x)}if(v.USE_JPEG&&v.USE_JFIF&&function(e){return void 0!==e}(h)){c=1;var F=$t.read(e,h);r?f.jfif=F:f=l({},f,F)}if(v.USE_EXIF&&function(e){return void 0!==e}(y)){c=1;var M=kt.read(e,y,u),O=M.tags,k=M.byteOrder;if(O.Thumbnail&&(f.Thumbnail=O.Thumbnail,delete O.Thumbnail),r?(f.exif=O,function(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=b(e.exif.GPSLatitude.value),"S"===e.exif.GPSLatitudeRef.value.join("")&&(e.gps.Latitude=-e.gps.Latitude)}catch(e){}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=b(e.exif.GPSLongitude.value),"W"===e.exif.GPSLongitudeRef.value.join("")&&(e.gps.Longitude=-e.gps.Longitude)}catch(e){}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],1===e.exif.GPSAltitudeRef.value&&(e.gps.Altitude=-e.gps.Altitude)}catch(e){}}}(f)):f=l({},f,O),v.USE_TIFF&&v.USE_IPTC&&O["IPTC-NAA"]&&!wi(S)){var D=fn.read(O["IPTC-NAA"].value,0,u);r?f.iptc=D:f=l({},f,D)}if(v.USE_TIFF&&v.USE_XMP&&O.ApplicationNotes&&!Ti(I)){var R=Pn.read(s(O.ApplicationNotes.value));r?f.xmp=R:(delete R._raw,f=l({},f,R))}if(v.USE_PHOTOSHOP&&O.ImageSourceData){var N=ir.read(O.PhotoshopSettings.value,u);r?f.photoshop=N:f=l({},f,N)}if(v.USE_TIFF&&v.USE_ICC&&O.ICC_Profile&&!xi(C)){var L=pr.read(O.ICC_Profile.value,[{offset:0,length:O.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);r?f.icc=L:f=l({},f,L)}if(v.USE_MAKER_NOTES&&function(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&"Canon"===e.Make.value[0]&&e.MakerNote&&e.MakerNote.__offset}(O)){var _=Er.read(e,y,O.MakerNote.__offset,k,u);r?f.makerNotes=_:f=l({},f,_)}O.MakerNote&&delete O.MakerNote.__offset}if(v.USE_JPEG&&v.USE_IPTC&&wi(S)){c=1;var B=fn.read(e,S,u);r?f.iptc=B:f=l({},f,B)}if(v.USE_XMP&&Ti(I)){c=1;var G=Pn.read(e,I);r?f.xmp=G:(delete G._raw,f=l({},f,G))}if((v.USE_JPEG||v.USE_WEBP)&&v.USE_ICC&&xi(C)){c=1;var j=pr.read(e,C,o);j instanceof Promise?d.push(j.then($)):$(j)}if(v.USE_MPF&&function(e){return void 0!==e}(U)){c=1;var z=Lt.read(e,U,u);r?f.mpf=z:f=l({},f,z)}if(v.USE_PNG&&v.USE_PNG_FILE&&void 0!==P){c=1;var V=wr.read(e,P);r?(f.png=f.png?l({},f.png,V):V,f.pngFile=V):f=l({},f,V)}if(v.USE_PNG&&function(e){return void 0!==e}(A)){c=1;var H=Nr.read(e,A,o,u),W=H.readTags,X=H.readTagsPromise;Q(W),X&&d.push(X.then((function(e){return e.forEach(Q)})))}if(v.USE_PNG&&function(e){return void 0!==e}(E)){c=1;var J=ei.read(e,E);r?f.png=f.png?l({},f.png,J):J:f=l({},f,J)}if(v.USE_WEBP&&function(e){return void 0!==e}(w)){c=1;var Y=ui.read(e,w);r?f.riff=f.riff?l({},f.riff,Y):Y:f=l({},f,Y)}if(v.USE_GIF&&function(e){return void 0!==e}(T)){c=1;var K=li.read(e,T);r?f.gif=f.gif?l({},f.gif,K):K:f=l({},f,K)}var q=(v.USE_JPEG||v.USE_WEBP)&&v.USE_EXIF&&v.USE_THUMBNAIL&&Si.get(e,f.Thumbnail,y);if(q?(c=1,f.Thumbnail=q):delete f.Thumbnail,m&&(r?(f.file||(f.file={}),f.file.FileType=m):f.FileType=m,c=1),!c)throw new Ii.MetadataMissingError;return o?Promise.all(d).then((function(){return f})):f;function $(e){r?f.icc=e:f=l({},f,e)}function Q(e){if(r){for(var t=0,n=["exif","iptc"];t<n.length;t++){var i=n[t],o="__".concat(i);e[o]&&(f[i]=f[i]?l({},f.exif,e[o]):e[o],delete e[o])}f.png=f.png?l({},f.png,e):e,f.pngText=f.pngText?l({},f.png,e):e}else delete(f=l({},f,e.__exif?e.__exif:{},e.__iptc?e.__iptc:{},e)).__exif,delete f.__iptc}}function wi(e){return void 0!==e}function Ti(e){return Array.isArray(e)&&e.length>0}function xi(e){return Array.isArray(e)&&e.length>0}return t}()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ExifReader=t():e.ExifReader=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:1,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:1})}},t={};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return e+""}(e);return"symbol"==n(t)?t:t+""}e.r(t),e.d(t,{default:function(){return Ti},errors:function(){return Oi},load:function(){return Mi},loadView:function(){return Ri}});var i=function(){return e=function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e){return"object"!==n(e)||void 0===e.length||void 0===e.readUInt8||void 0===e.readUInt16LE||void 0===e.readUInt16BE||void 0===e.readUInt32LE||void 0===e.readUInt32BE||void 0===e.readInt32LE||void 0===e.readInt32BE}(t))throw Error("DataView: Passed buffer type is unsupported.");this.buffer=t,this.byteLength=this.buffer.length},(t=[{key:"getUint8",value:function(e){return this.buffer.readUInt8(e)}},{key:"getUint16",value:function(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}},{key:"getUint32",value:function(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}},{key:"getInt32",value:function(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||0,i.configurable=1,"value"in i&&(i.writable=1),Object.defineProperty(e,r(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:0}),e;var e,t}();function o(e,t,n){try{return new DataView(e,t,n)}catch(r){return new i(e,t,n)}}function a(e,t,n){for(var r=[],i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return s(r)}function u(e,t){for(var n=[],r=0;t+r<e.byteLength;){var i=e.getUint8(t+r);if(0===i)break;n.push(i),r++}return s(n)}function c(e,t,n){for(var r=[],i=0;i<n&&t+i<e.byteLength;i+=2)r.push(e.getUint16(t+i));return 0===r[r.length-1]&&r.pop(),s(r)}function f(e,t){var n=e.getUint8(t);return[n,a(e,t+1,n)]}function s(e){return e.map((function(e){return String.fromCharCode(e)})).join("")}function l(){for(var e=1;e<arguments.length;e++)for(var t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}function d(e,t,n){var r=0;Object.defineProperty(e,t,{get:function(){return r||(r=1,Object.defineProperty(e,t,{configurable:1,enumerable:1,value:n.apply(e),writable:1})),e[t]},configurable:1,enumerable:1})}function p(e){return"undefined"!=typeof btoa?"string"==typeof e?btoa(e):btoa(Array.prototype.reduce.call(new Uint8Array(e),(function(e,t){return e+String.fromCharCode(t)}),"")):"undefined"!=typeof Buffer?"undefined"!=typeof Buffer.from?Buffer.from(e).toString("base64"):new Buffer(e).toString("base64"):void 0}function m(e,t){return Array(t+1).join(e)}var g=void 0;function h(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"string";if(0===t&&"function"==typeof DecompressionStream){var i=new DecompressionStream("deflate"),o=new Blob([e]).stream().pipeThrough(i);return"dataview"===r?new Response(o).arrayBuffer().then((function(e){return new DataView(e)})):new Response(o).arrayBuffer().then((function(e){return new TextDecoder(n).decode(e)}))}return void 0!==t?Promise.reject("Unknown compression method ".concat(t,".")):e}var v={USE_FILE:1,USE_JFIF:1,USE_PNG_FILE:1,USE_EXIF:1,USE_IPTC:1,USE_XMP:1,USE_ICC:1,USE_MPF:1,USE_PHOTOSHOP:1,USE_THUMBNAIL:1,USE_TIFF:1,USE_JPEG:1,USE_PNG:1,USE_HEIC:1,USE_AVIF:1,USE_WEBP:1,USE_GIF:1,USE_MAKER_NOTES:1};function y(e){return e.map((function(e){return String.fromCharCode(e)})).join("")}function S(e){if(e.length>=8){var t=y(e.slice(0,8));if("ASCII\0\0\0"===t)return y(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t)return"[Undefined encoding]"}return"Undefined"}function b(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}var I=18761,C=I,U=function(e,t){if(e.getUint16(t)===I)return I;if(19789===e.getUint16(t))return 19789;throw Error("Illegal byte order value. Faulty image.")},P=2,A=65496,w=2,E=4,x=2,T=2,O=10,M=18,F=33,R=79,k=18,D=8,N="ICC_PROFILE\0",L=E+N.length,_=L+1,B="MPF\0",G=65472,j=65474,z=65476,V=65499,H=65501,W=65498,X=65504,J=65505,Y=65506,K=65517,q=65519,$=65534,Z=65535,Q="JFIF",ee="Exif",te="http://ns.adobe.com/xap/1.0/\0",ne="http://ns.adobe.com/xmp/extension/\0",re="Photoshop 3.0";function ie(e,t){return e.getUint16(t)===G}function oe(e,t){return e.getUint16(t)===j}function ae(e,t){var n=N.length;return e.getUint16(t)===Y&&a(e,t+E,n)===N}function ue(e,t){var n=B.length;return e.getUint16(t)===Y&&a(e,t+E,n)===B}function ce(e,t){var n=Q.length;return e.getUint16(t)===X&&a(e,t+E,n)===Q&&0===e.getUint8(t+E+n)}function fe(e,t){var n=ee.length;return e.getUint16(t)===J&&a(e,t+E,n)===ee&&0===e.getUint8(t+E+n)}function se(e,t){return e.getUint16(t)===J&&function(e,t){var n=te.length;return a(e,t+E,n)===te}(e,t)}function le(e,t){return e.getUint16(t)===J&&function(e,t){var n=ne.length;return a(e,t+E,n)===ne}(e,t)}function de(e,t){return{dataOffset:e+F,length:t-(F-x)}}function pe(e,t){return{dataOffset:e+R,length:t-(R-x)}}function me(e,t){var n=re.length;return e.getUint16(t)===K&&a(e,t+E,n)===re&&0===e.getUint8(t+E+n)}function ge(e,t){var n=e.getUint16(t);return n>=X&&n<=q||n===$||n===G||n===j||n===z||n===V||n===H||n===W}function he(e,t){return e.getUint16(t)===Z}var ve="‰PNG\r\n\n",ye=4,Se=4,be=0,Ie=ye,Ce=ye+Se,Ue="XML:com.adobe.xmp\0",Pe="tEXt",Ae="iTXt",we="zTXt",Ee="pHYs",xe="tIME",Te="eXIf",Oe="iCCP";function Me(e,t){return"IHDR"===a(e,t+Ie,Se)}function Fe(e,t){return a(e,t+Ie,Se)===Ae&&a(e,t+Ce,Ue.length)===Ue}function Re(e,t,n){var r=a(e,t+Ie,Se);return r===Pe||r===Ae||r===we&&n}function ke(e,t){return a(e,t+Ie,Se)===Te}function De(e,t){return a(e,t+Ie,Se)===Oe}function Ne(e,t){var n=[Ee,xe],r=a(e,t+Ie,Se);return n.includes(r)}function Le(e,t){t+=Ce+Ue.length+1+1;for(var n=0;n<2&&t<e.byteLength;)0===e.getUint8(t)&&n++,t++;if(!(n<2))return t}function _e(e,t){var n=u(e,t);return t+=n.length+1,{profileName:n,compressionMethod:e.getUint8(t),compressedProfileOffset:t+=1}}function Be(e,t,n,r,i,o,a,u){if(void 0===u)return[];for(var c=[],f=n.items,s=0;s<u;s++){var l={extents:[]};l.itemId=Ge(e,f,t),f+=r.item.itemId,l.constructionMethod=1===t||2===t?15&e.getUint16(f):void 0,f+=r.item.constructionMethod,l.dataReferenceIndex=e.getUint16(f),f+=r.item.dataReferenceIndex,l.baseOffset=ze(e,f,r.item.baseOffset),f+=r.item.baseOffset,l.extentCount=e.getUint16(f),f+=r.item.extentCount;for(var d=0;d<l.extentCount;d++){var p={};p.extentIndex=je(e,t,f,a),f+=r.item.extent.extentIndex,p.extentOffset=ze(e,f,i),f+=r.item.extent.extentOffset,p.extentLength=ze(e,f,o),f+=r.item.extent.extentLength,l.extents.push(p)}c.push(l)}return c}function Ge(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}function je(e,t,n,r){if((1===t||2===t)&&r>0)return ze(e,n,r)}function ze(e,t,n){return 4===n?e.getUint32(t):8===n?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),function(e,t){return e.getUint32(t+4)}(e,t)):0}var Ve=1165519206,He=1835625829;function We(e,t){var n=function(e,t){var n=e.getUint32(t);return function(e){return 0===e}(n)?{length:e.byteLength-t,contentOffset:t+4+4}:function(e){return 1===e}(n)&&function(e,t){return 0===e.getUint32(t+8)}(e,t)?{length:e.getUint32(t+12),contentOffset:t+4+4+8}:{length:n,contentOffset:t+4+4}}(e,t),r=n.length,i=n.contentOffset;if(!(r<8)){var o=e.getUint32(t+4);if(1718909296===o)return function(e,t,n){return{type:"ftyp",majorBrand:a(e,t,4),length:n}}(e,i,r);if(1768977008===o)return function(e,t,n,r){return{type:"iprp",subBoxes:Ke(e,n,r-(n-t)),length:r}}(e,t,i,r);if(1768973167===o)return function(e,t,n,r){return{type:"ipco",properties:Ke(e,n,r-(n-t)),length:r}}(e,t,i,r);if(1668246642===o)return function(e,t,n){return{type:"colr",icc:Ye(e,t),length:n}}(e,i,r);var c=e.getUint8(i);return 1835365473===o?function(e,t,n,r){return{type:"meta",subBoxes:Ke(e,n+3,r-(n+3-t)),length:r}}(e,t,i+1,r):1768714083===o?function(e,t,n,r){var i=function(e,t){var n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):2===e&&(n.itemCount=4,n.item.itemId=4),n.item.constructionMethod=1===e||2===e?2:0;var r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}(t,n+3),o=i.offsets,a=i.sizes,u=e.getUint8(o.offsetSize)>>4;a.item.extent.extentOffset=u;var c=15&e.getUint8(o.lengthSize);a.item.extent.extentLength=c;var f=e.getUint8(o.baseOffsetSize)>>4;a.item.baseOffset=f;var s=function(e,t,n){if(1===n||2===n)return 15&e.getUint8(t)}(e,o.indexSize,t);a.item.extent.extentIndex=void 0!==s?s:0;var l=function(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}(e,o.itemCount,t);return{type:"iloc",items:Be(e,t,o,a,u,c,s,l),length:r}}(e,c,i+1,r):1768517222===o?function(e,t,n,r,i){var o=function(e,t){var n={entryCount:t+3},r={};return r.entryCount=0===e?2:4,n.itemInfos=n.entryCount+r.entryCount,{offsets:n}}(n,r),a=o.offsets;return{type:"iinf",itemInfos:Ke(e,a.itemInfos,i-(a.itemInfos-t)),length:i}}(e,t,c,i+1,r):1768842853===o?function(e,t,n,r,i){r+=3;var o={type:"infe",length:i};return 0!==n&&1!==n||(o.itemId=e.getUint16(r),r+=2,o.itemProtectionIndex=e.getUint16(r),r+=2,o.itemName=u(e,r),r+=o.itemName.length+1),n>=2&&(2===n?(o.itemId=e.getUint16(r),r+=2):3===n&&(o.itemId=e.getUint32(r),r+=4),o.itemProtectionIndex=e.getUint16(r),r+=2,o.itemType=e.getUint32(r),r+=4,o.itemName=u(e,r),r+=o.itemName.length+1,o.itemType===He?(o.contentType=u(e,r),t+i>(r+=o.contentType.length+1)&&(o.contentEncoding=u(e,r),r+=o.contentEncoding.length+1)):1970432288===o.itemType&&(o.itemUri=u(e,r),r+=o.itemUri.length+1)),o}(e,t,c,i+1,r):{type:void 0,length:r}}}function Xe(e){if(v.USE_EXIF||v.USE_XMP||v.USE_ICC){var t={},n=function(e){for(var t=0;t+4+4<=e.byteLength;){var n=We(e,t);if(void 0===n)break;if("meta"===n.type)return n;t+=n.length}}(e);return n?(v.USE_EXIF&&(t.tiffHeaderOffset=function(e,t){try{var n=function(e){return e.subBoxes.find((function(e){return"iinf"===e.type})).itemInfos.find((function(e){return e.itemType===Ve}))}(t).itemId,r=Je(t,n);return function(e,t){return t+4+e.getUint32(t)}(e,r.baseOffset+r.extents[0].extentOffset)}catch(e){return}}(e,n)),v.USE_XMP&&(t.xmpChunks=function(e){try{var t=function(e){return e.subBoxes.find((function(e){return"iinf"===e.type})).itemInfos.find((function(e){return e.itemType===He&&"application/rdf+xml"===e.contentType}))}(e).itemId,n=Je(e,t),r=Je(e,t).extents[0];return[{dataOffset:n.baseOffset+r.extentOffset,length:r.extentLength}]}catch(e){return}}(n)),v.USE_ICC&&(t.iccChunks=function(e){try{var t=e.subBoxes.find((function(e){return"iprp"===e.type})).subBoxes.find((function(e){return"ipco"===e.type})).properties.find((function(e){return"colr"===e.type})).icc;if(t)return[t]}catch(e){}}(n)),t.hasAppMarkers=void 0!==t.tiffHeaderOffset||void 0!==t.xmpChunks||void 0!==t.iccChunks,t):{hasAppMarkers:0}}return{}}function Je(e,t){return e.subBoxes.find((function(e){return"iloc"===e.type})).items.find((function(e){return e.itemId===t}))}function Ye(e,t){var n=a(e,t,4);if("prof"===n||"rICC"===n)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function Ke(e,t,n){for(var r=[Ve,He],i=[],o=t;o<t+n;){var a=We(e,o);if(void 0===a)break;void 0===a.type||void 0!==a.itemType&&-1===r.indexOf(a.itemType)||i.push(a),o+=a.length}return i}var qe=6,$e=["GIF87a","GIF89a"],Ze=0,Qe="<?xpacket begin",et={parseAppMarkers:function(e,t){if(v.USE_TIFF&&function(e){return!!e&&e.byteLength>=4&&function(e){var t=e.getUint16(0)===C;return 42===e.getUint16(2,t)}(e)}(e))return tt(v.USE_EXIF?{hasAppMarkers:1,tiffHeaderOffset:0}:{},"tiff","TIFF");if(v.USE_JPEG&&function(e){return!!e&&e.byteLength>=P&&e.getUint16(0)===A}(e))return tt(function(e){for(var t,n,r,i,o,a,u,c,f,s=w;s+E+5<=e.byteLength;){if(v.USE_FILE&&ie(e,s))t=e.getUint16(s+x),n=s+x;else if(v.USE_FILE&&oe(e,s))t=e.getUint16(s+x),r=s+x;else if(v.USE_JFIF&&ce(e,s))t=e.getUint16(s+x),i=s+T;else if(v.USE_EXIF&&fe(e,s))t=e.getUint16(s+x),o=s+O;else if(v.USE_XMP&&se(e,s))u||(u=[]),t=e.getUint16(s+x),u.push(de(s,t));else if(v.USE_XMP&&le(e,s))u||(u=[]),t=e.getUint16(s+x),u.push(pe(s,t));else if(v.USE_IPTC&&me(e,s))t=e.getUint16(s+x),a=s+M;else if(v.USE_ICC&&ae(e,s)){t=e.getUint16(s+x);var l=s+k,d=t-(k-x),p=e.getUint8(s+L),m=e.getUint8(s+_);c||(c=[]),c.push({offset:l,length:d,chunkNumber:p,chunksTotal:m})}else if(v.USE_MPF&&ue(e,s))t=e.getUint16(s+x),f=s+D;else{if(!ge(e,s)){if(he(e,s)){s++;continue}break}t=e.getUint16(s+x)}s+=x+t}return{hasAppMarkers:s>w,fileDataOffset:n||r,jfifDataOffset:i,tiffHeaderOffset:o,iptcDataOffset:a,xmpChunks:u,iccChunks:c,mpfDataOffset:f}}(e),"jpeg","JPEG");if(v.USE_PNG&&function(e){return!!e&&a(e,0,ve.length)===ve}(e))return tt(function(e,t){for(var n={hasAppMarkers:0},r=ve.length;r+ye+Se<=e.byteLength;){if(v.USE_PNG_FILE&&Me(e,r))n.hasAppMarkers=1,n.pngHeaderOffset=r+Ce;else if(v.USE_XMP&&Fe(e,r)){var i=Le(e,r);void 0!==i&&(n.hasAppMarkers=1,n.xmpChunks=[{dataOffset:i,length:e.getUint32(r+be)-(i-(r+Ce))}])}else if(Re(e,r,t)){n.hasAppMarkers=1;var o=a(e,r+Ie,Se);n.pngTextChunks||(n.pngTextChunks=[]),n.pngTextChunks.push({length:e.getUint32(r+be),type:o,offset:r+Ce})}else if(ke(e,r))n.hasAppMarkers=1,n.tiffHeaderOffset=r+Ce;else if(v.USE_ICC&&t&&De(e,r)){n.hasAppMarkers=1;var u=e.getUint32(r+be),c=r+Ce,f=_e(e,c),s=f.profileName,l=f.compressionMethod,d=f.compressedProfileOffset;n.iccChunks||(n.iccChunks=[]),n.iccChunks.push({offset:d,length:u-(d-c),chunkNumber:1,chunksTotal:1,profileName:s,compressionMethod:l})}else Ne(e,r)&&(n.hasAppMarkers=1,n.pngChunkOffsets||(n.pngChunkOffsets=[]),n.pngChunkOffsets.push(r+be));r+=e.getUint32(r+be)+ye+Se+4}return n}(e,t),"png","PNG");if(v.USE_HEIC&&function(e){if(!e)return 0;try{var t=We(e,0);return t&&-1!==["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"].indexOf(t.majorBrand)}catch(e){return 0}}(e))return tt(function(e){return Xe(e)}(e),"heic","HEIC");if(v.USE_AVIF&&function(e){if(!e)return 0;try{var t=We(e,0);return t&&"avif"===t.majorBrand}catch(e){return 0}}(e))return tt(function(e){return Xe(e)}(e),"avif","AVIF");if(v.USE_WEBP&&function(e){return!!e&&"RIFF"===a(e,0,4)&&"WEBP"===a(e,8,4)}(e))return tt(function(e){for(var t,n,r,i,o=12,u=0;o+8<e.byteLength;){var c=a(e,o,4),f=e.getUint32(o+4,1);v.USE_EXIF&&"EXIF"===c?(u=1,t="Exif\0\0"===a(e,o+8,6)?o+8+6:o+8):v.USE_XMP&&"XMP "===c?(u=1,n=[{dataOffset:o+8,length:f}]):v.USE_ICC&&"ICCP"===c?(u=1,r=[{offset:o+8,length:f,chunkNumber:1,chunksTotal:1}]):"VP8X"===c&&(u=1,i=o+8),o+=8+(f%2==0?f:f+1)}return{hasAppMarkers:u,tiffHeaderOffset:t,xmpChunks:n,iccChunks:r,vp8xChunkOffset:i}}(e),"webp","WebP");if(v.USE_GIF&&function(e){return!!e&&$e.includes(a(e,0,qe))}(e))return tt({gifHeaderOffset:0},"gif","GIF");if(v.USE_XMP&&function(e){return!!e&&a(e,Ze,Qe.length)===Qe}(e))return tt(function(e){var t=[];return t.push({dataOffset:Ze,length:e.byteLength}),{xmpChunks:t}}(e),"xml","XML");throw Error("Invalid image format")}};function tt(e,t,n){return l({},e,{fileType:{value:t,description:n}})}var nt={ApertureValue:function(e){return Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},ColorSpace:function(e){return 1===e?"sRGB":65535===e?"Uncalibrated":"Unknown"},ComponentsConfiguration:function(e){return e.map((function(e){return 49===e?"Y":50===e?"Cb":51===e?"Cr":52===e?"R":53===e?"G":54===e?"B":void 0})).join("")},Contrast:function(e){return 0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown"},CustomRendered:function(e){return 0===e?"Normal process":1===e?"Custom process":"Unknown"},ExposureMode:function(e){return 0===e?"Auto exposure":1===e?"Manual exposure":2===e?"Auto bracket":"Unknown"},ExposureProgram:function(e){return 0===e?"Undefined":1===e?"Manual":2===e?"Normal program":3===e?"Aperture priority":4===e?"Shutter priority":5===e?"Creative program":6===e?"Action program":7===e?"Portrait mode":8===e?"Landscape mode":9===e?"Bulb":"Unknown"},ExposureTime:function(e){if(e[0]/e[1]>.25){var t=e[0]/e[1];return Number.isInteger(t)?""+t:t.toFixed(1)}return 0!==e[0]?"1/".concat(Math.round(e[1]/e[0])):"0/".concat(e[1])},FNumber:function(e){return"f/".concat(e[0]/e[1])},FocalLength:function(e){return e[0]/e[1]+" mm"},FocalPlaneResolutionUnit:function(e){return 2===e?"inches":3===e?"centimeters":"Unknown"},LightSource:function(e){return 1===e?"Daylight":2===e?"Fluorescent":3===e?"Tungsten (incandescent light)":4===e?"Flash":9===e?"Fine weather":10===e?"Cloudy weather":11===e?"Shade":12===e?"Daylight fluorescent (D 5700 – 7100K)":13===e?"Day white fluorescent (N 4600 – 5400K)":14===e?"Cool white fluorescent (W 3900 – 4500K)":15===e?"White fluorescent (WW 3200 – 3700K)":17===e?"Standard light A":18===e?"Standard light B":19===e?"Standard light C":20===e?"D55":21===e?"D65":22===e?"D75":23===e?"D50":24===e?"ISO studio tungsten":255===e?"Other light source":"Unknown"},MeteringMode:function(e){return 1===e?"Average":2===e?"CenterWeightedAverage":3===e?"Spot":4===e?"MultiSpot":5===e?"Pattern":6===e?"Partial":255===e?"Other":"Unknown"},ResolutionUnit:function(e){return 2===e?"inches":3===e?"centimeters":"Unknown"},Saturation:function(e){return 0===e?"Normal":1===e?"Low saturation":2===e?"High saturation":"Unknown"},SceneCaptureType:function(e){return 0===e?"Standard":1===e?"Landscape":2===e?"Portrait":3===e?"Night scene":"Unknown"},Sharpness:function(e){return 0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown"},ShutterSpeedValue:function(e){var t=Math.pow(2,e[0]/e[1]);return t<=1?"".concat(Math.round(1/t)):"1/".concat(Math.round(t))},WhiteBalance:function(e){return 0===e?"Auto white balance":1===e?"Manual white balance":"Unknown"},XResolution:function(e){return""+Math.round(e[0]/e[1])},YResolution:function(e){return""+Math.round(e[0]/e[1])}},rt={11:"ProcessingSoftware",254:{name:"SubfileType",description:function(e){return{0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image",3:"Single page of multi-page reduced-resolution image",4:"Transparency mask",5:"Transparency mask of reduced-resolution image",6:"Transparency mask of multi-page image",7:"Transparency mask of reduced-resolution multi-page image",65537:"Alternate reduced-resolution image",4294967295:"Invalid"}[e]||"Unknown"}},255:{name:"OldSubfileType",description:function(e){return{0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image"}[e]||"Unknown"}},256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:{name:"Thresholding",description:function(e){return{1:"No dithering or halftoning",2:"Ordered dither or halfton",3:"Randomized dither"}[e]||"Unknown"}},264:"CellWidth",265:"CellLength",266:{name:"FillOrder",description:function(e){return{1:"Normal",2:"Reversed"}[e]||"Unknown"}},269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:function(e){return 1===e?"top-left":2===e?"top-right":3===e?"bottom-right":4===e?"bottom-left":5===e?"left-top":6===e?"right-top":7===e?"right-bottom":8===e?"left-bottom":"Undefined"}},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:nt.XResolution},283:{name:"YResolution",description:nt.YResolution},284:"PlanarConfiguration",285:"PageName",286:{name:"XPosition",description:function(e){return""+Math.round(e[0]/e[1])}},287:{name:"YPosition",description:function(e){return""+Math.round(e[0]/e[1])}},290:{name:"GrayResponseUnit",description:function(e){return{1:"0.1",2:"0.001",3:"0.0001",4:"1e-05",5:"1e-06"}[e]||"Unknown"}},296:{name:"ResolutionUnit",description:nt.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:function(e){return e.map((function(e){return"".concat(e[0],"/").concat(e[1])})).join(", ")}},319:{name:"PrimaryChromaticities",description:function(e){return e.map((function(e){return"".concat(e[0],"/").concat(e[1])})).join(", ")}},321:"HalftoneHints",322:"TileWidth",323:"TileLength",330:"A100DataOffset",332:{name:"InkSet",description:function(e){return{1:"CMYK",2:"Not CMYK"}[e]||"Unknown"}},337:"TargetPrinter",338:{name:"ExtraSamples",description:function(e){return{0:"Unspecified",1:"Associated Alpha",2:"Unassociated Alpha"}[e]||"Unknown"}},339:{name:"SampleFormat",description:function(e){var t={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map((function(e){return t[e]||"Unknown"})).join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:function(e){return e.map((function(e){return""+e[0]/e[1]})).join("/")}},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:function(e){return 1===e?"centered":2===e?"co-sited":"undefined "+e}},532:{name:"ReferenceBlackWhite",description:function(e){return e.map((function(e){return""+e[0]/e[1]})).join(", ")}},700:"ApplicationNotes",18246:"Rating",18249:"RatingPercent",33432:{name:"Copyright",description:function(e){return e.join("; ")}},33550:"PixelScale",33723:"IPTC-NAA",33920:"IntergraphMatrix",33922:"ModelTiePoint",34118:"SEMInfo",34264:"ModelTransform",34377:"PhotoshopSettings",34665:"Exif IFD Pointer",34675:"ICC_Profile",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34853:"GPS Info IFD Pointer",40091:{name:"XPTitle",description:it},40092:{name:"XPComment",description:it},40093:{name:"XPAuthor",description:it},40094:{name:"XPKeywords",description:it},40095:{name:"XPSubject",description:it},42112:"GDALMetadata",42113:"GDALNoData",50341:"PrintIM",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",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",50736:"DNGLensInfo",50739:"ShadowScale",50741:{name:"MakerNoteSafety",description:function(e){return{0:"Unsafe",1:"Safe"}[e]||"Unknown"}},50778:{name:"CalibrationIlluminant1",description:nt.LightSource},50779:{name:"CalibrationIlluminant2",description:nt.LightSource},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:{name:"ProfileEmbedPolicy",description:function(e){return{0:"Allow Copying",1:"Embed if Used",2:"Never Embed",3:"No Restrictions"}[e]||"Unknown"}},50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:{name:"PreviewColorSpace",description:function(e){return{1:"Gray Gamma 2.2",2:"sRGB",3:"Adobe RGB",4:"ProPhoto RGB"}[e]||"Unknown"}},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:{name:"ProfileHueSatMapEncoding",description:function(e){return{0:"Linear",1:"sRGB"}[e]||"Unknown"}},51108:{name:"ProfileLookTableEncoding",description:function(e){return{0:"Linear",1:"sRGB"}[e]||"Unknown"}},51109:"BaselineExposureOffset",51110:{name:"DefaultBlackRender",description:function(e){return{0:"Auto",1:"None"}[e]||"Unknown"}},51111:"NewRawImageDigest",51112:"RawToPreviewGain"};function it(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}function ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function at(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ut={0:{name:"GPSVersionID",description:function(e){return 2===e[0]&&2===e[1]&&0===e[2]&&0===e[3]?"Version 2.2":"Unknown"}},1:{name:"GPSLatitudeRef",description:function(e){var t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:b},3:{name:"GPSLongitudeRef",description:function(e){var t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:b},5:{name:"GPSAltitudeRef",description:function(e){return 0===e?"Sea level":1===e?"Sea level reference (negative value)":"Unknown"}},6:{name:"GPSAltitude",description:function(e){return e[0]/e[1]+" m"}},7:{name:"GPSTimeStamp",description:function(e){return e.map((function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=e)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return at(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?at(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0]/n[1];return/^\d(\.|$)/.test("".concat(r))?"0".concat(r):r})).join(":")}},8:"GPSSatellites",9:{name:"GPSStatus",description:function(e){var t=e.join("");return"A"===t?"Measurement in progress":"V"===t?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:function(e){var t=e.join("");return"2"===t?"2-dimensional measurement":"3"===t?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:function(e){var t=e.join("");return"K"===t?"Kilometers per hour":"M"===t?"Miles per hour":"N"===t?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:function(e){var t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:function(e){var t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:function(e){var t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:function(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}},21:{name:"GPSDestLongitudeRef",description:function(e){var t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:function(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}},23:{name:"GPSDestBearingRef",description:function(e){var t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:function(e){var t=e.join("");return"K"===t?"Kilometers":"M"===t?"Miles":"N"===t?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:S},28:{name:"GPSAreaInformation",description:S},29:"GPSDateStamp",30:{name:"GPSDifferential",description:function(e){return 0===e?"Measurement without differential correction":1===e?"Differential correction applied":"Unknown"}},31:"GPSHPositioningError"},ct={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:function(e){return y(e)}},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},ft={45056:{name:"MPFVersion",description:function(e){return y(e)}},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"};function st(e){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},st(e)}function lt(e,t,n){return(t=function(e){var t=function(e){if("object"!=st(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return e+""}(e);return"symbol"==st(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:1,configurable:1,writable:1}):e[t]=n,e}var dt=l({},rt,{33434:{name:"ExposureTime",description:nt.ExposureTime},33437:{name:"FNumber",description:nt.FNumber},34850:{name:"ExposureProgram",description:nt.ExposureProgram},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:function(){return"[Raw OECF table data]"}},34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:{name:"SensitivityType",description:function(e){return{1:"Standard Output Sensitivity",2:"Recommended Exposure Index",3:"ISO Speed",4:"Standard Output Sensitivity and Recommended Exposure Index",5:"Standard Output Sensitivity and ISO Speed",6:"Recommended Exposure Index and ISO Speed",7:"Standard Output Sensitivity, Recommended Exposure Index and ISO Speed"}[e]||"Unknown"}},34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:{name:"ExifVersion",description:function(e){return y(e)}},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:nt.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:nt.ShutterSpeedValue},37378:{name:"ApertureValue",description:nt.ApertureValue},37379:"BrightnessValue",37380:"ExposureBiasValue",37381:{name:"MaxApertureValue",description:function(e){return Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)}},37382:{name:"SubjectDistance",description:function(e){return e[0]/e[1]+" m"}},37383:{name:"MeteringMode",description:nt.MeteringMode},37384:{name:"LightSource",description:nt.LightSource},37385:{name:"Flash",description:function(e){return 0===e?"Flash did not fire":1===e?"Flash fired":5===e?"Strobe return light not detected":7===e?"Strobe return light detected":9===e?"Flash fired, compulsory flash mode":13===e?"Flash fired, compulsory flash mode, return light not detected":15===e?"Flash fired, compulsory flash mode, return light detected":16===e?"Flash did not fire, compulsory flash mode":24===e?"Flash did not fire, auto mode":25===e?"Flash fired, auto mode":29===e?"Flash fired, auto mode, return light not detected":31===e?"Flash fired, auto mode, return light detected":32===e?"No flash function":65===e?"Flash fired, red-eye reduction mode":69===e?"Flash fired, red-eye reduction mode, return light not detected":71===e?"Flash fired, red-eye reduction mode, return light detected":73===e?"Flash fired, compulsory flash mode, red-eye reduction mode":77===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":79===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":89===e?"Flash fired, auto mode, red-eye reduction mode":93===e?"Flash fired, auto mode, return light not detected, red-eye reduction mode":95===e?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"}},37386:{name:"FocalLength",description:nt.FocalLength},37393:"ImageNumber",37394:{name:"SecurityClassification",description:function(e){return{C:"Confidential",R:"Restricted",S:"Secret",T:"Top Secret",U:"Unclassified"}[e]||"Unknown"}},37395:"ImageHistory",37396:{name:"SubjectArea",description:function(e){return 2===e.length?"Location; X: ".concat(e[0],", Y: ").concat(e[1]):3===e.length?"Circle; X: ".concat(e[0],", Y: ").concat(e[1],", diameter: ").concat(e[2]):4===e.length?"Rectangle; X: ".concat(e[0],", Y: ").concat(e[1],", width: ").concat(e[2],", height: ").concat(e[3]):"Unknown"}},37500:{name:"MakerNote",description:function(){return"[Raw maker note data]"}},37510:{name:"UserComment",description:S},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37724:"ImageSourceData",37888:{name:"AmbientTemperature",description:function(e){return e[0]/e[1]+" °C"}},37889:{name:"Humidity",description:function(e){return e[0]/e[1]+" %"}},37890:{name:"Pressure",description:function(e){return e[0]/e[1]+" hPa"}},37891:{name:"WaterDepth",description:function(e){return e[0]/e[1]+" m"}},37892:{name:"Acceleration",description:function(e){return e[0]/e[1]+" mGal"}},37893:{name:"CameraElevationAngle",description:function(e){return e[0]/e[1]+" °"}},40960:{name:"FlashpixVersion",description:function(e){return e.map((function(e){return String.fromCharCode(e)})).join("")}},40961:{name:"ColorSpace",description:nt.ColorSpace},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:function(){return"[Raw SFR table data]"}},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:nt.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=e)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return ot(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ot(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],i=n[1];return"X: ".concat(r,", Y: ").concat(i)}},41493:"ExposureIndex",41495:{name:"SensingMethod",description:function(e){return 1===e?"Undefined":2===e?"One-chip color area sensor":3===e?"Two-chip color area sensor":4===e?"Three-chip color area sensor":5===e?"Color sequential area sensor":7===e?"Trilinear sensor":8===e?"Color sequential linear sensor":"Unknown"}},41728:{name:"FileSource",description:function(e){return 3===e?"DSC":"Unknown"}},41729:{name:"SceneType",description:function(e){return 1===e?"A directly photographed image":"Unknown"}},41730:{name:"CFAPattern",description:function(){return"[Raw CFA pattern table data]"}},41985:{name:"CustomRendered",description:nt.CustomRendered},41986:{name:"ExposureMode",description:nt.ExposureMode},41987:{name:"WhiteBalance",description:nt.WhiteBalance},41988:{name:"DigitalZoomRatio",description:function(e){return 0===e[0]?"Digital zoom was not used":""+e[0]/e[1]}},41989:{name:"FocalLengthIn35mmFilm",description:function(e){return 0===e?"Unknown":e}},41990:{name:"SceneCaptureType",description:nt.SceneCaptureType},41991:{name:"GainControl",description:function(e){return 0===e?"None":1===e?"Low gain up":2===e?"High gain up":3===e?"Low gain down":4===e?"High gain down":"Unknown"}},41992:{name:"Contrast",description:nt.Contrast},41993:{name:"Saturation",description:nt.Saturation},41994:{name:"Sharpness",description:nt.Sharpness},41995:{name:"DeviceSettingDescription",description:function(){return"[Raw device settings table data]"}},41996:{name:"SubjectDistanceRange",description:function(e){return 1===e?"Macro":2===e?"Close view":3===e?"Distant view":"Unknown"}},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:function(e){var t=parseFloat((e[0][0]/e[0][1]).toFixed(5)),n=parseFloat((e[1][0]/e[1][1]).toFixed(5)),r="".concat(t,"-").concat(n," mm");if(0===e[3][1])return"".concat(r," f/?");var i=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return"".concat(r," f/").concat(parseFloat(i.toFixed(5)))}},42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42080:{name:"CompositeImage",description:function(e){return{1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}[e]||"Unknown"}},42081:"SourceImageNumberOfCompositeImage",42082:"SourceExposureTimesOfCompositeImage",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"}),pt="0th",mt="exif",gt="interoperability",ht="canon",vt=lt(lt(lt(lt(lt(lt(lt({},pt,dt),"1st",rt),mt,dt),"gps",ut),gt,ct),"mpf",v.USE_MPF?ft:{}),ht,v.USE_MAKER_NOTES?{4:{name:"ShotInfo",description:function(e){return e}}}:{}),yt={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},St={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13},bt={getAsciiValue:function(e){return e.map((function(e){return String.fromCharCode(e)}))},getByteAt:It,getAsciiAt:function(e,t){return e.getUint8(t)},getShortAt:function(e,t,n){return e.getUint16(t,n===C)},getLongAt:Ct,getRationalAt:function(e,t,n){return[Ct(e,t,n),Ct(e,t+4,n)]},getUndefinedAt:function(e,t){return It(e,t)},getSlongAt:Ut,getSrationalAt:function(e,t,n){return[Ut(e,t,n),Ut(e,t+4,n)]},getIfdPointerAt:function(e,t,n){return Ct(e,t,n)},typeSizes:yt,tagTypes:St,getTypeSize:function(e){if(void 0===St[e])throw Error("No such type found.");return yt[St[e]]}};function It(e,t){return e.getUint8(t)}function Ct(e,t,n){return e.getUint32(t,n===C)}function Ut(e,t,n){return e.getInt32(t,n===C)}var Pt={1:bt.getByteAt,2:bt.getAsciiAt,3:bt.getShortAt,4:bt.getLongAt,5:bt.getRationalAt,7:bt.getUndefinedAt,9:bt.getSlongAt,10:bt.getSrationalAt,13:bt.getIfdPointerAt};function At(e,t,n){return t+bt.getLongAt(e,t+4,n)}function wt(e,t,n,r,i,o){var a=bt.getTypeSize("SHORT"),u={},c=function(e,t,n){return t+bt.getTypeSize("SHORT")<=e.byteLength?bt.getShortAt(e,t,n):0}(e,r,i);r+=a;for(var f=0;f<c&&!(r+12>e.byteLength);f++){var s=Et(e,t,n,r,i,o);void 0!==s&&(u[s.name]={id:s.id,value:s.value,description:s.description},"MakerNote"===s.name&&(u[s.name].__offset=s.__offset)),r+=12}if(v.USE_THUMBNAIL&&r<e.byteLength-bt.getTypeSize("LONG")){var l=bt.getLongAt(e,r,i);0!==l&&t===pt&&(u.Thumbnail=wt(e,"1st",n,n+l,i,o))}return u}function Et(e,t,n,r,i,o){var a,u,c=bt.getTypeSize("SHORT"),f=c+bt.getTypeSize("SHORT"),s=f+bt.getTypeSize("LONG"),l=bt.getShortAt(e,r,i),d=bt.getShortAt(e,r+c,i),p=bt.getLongAt(e,r+f,i);if(void 0!==bt.typeSizes[d]&&(o||void 0!==vt[t][l])){a=function(e,t){return bt.typeSizes[e]*t<=bt.getTypeSize("LONG")}(d,p)?xt(e,u=r+s,d,p,i):function(e,t,n,r,i){return t+n+bt.typeSizes[r]*i<=e.byteLength}(e,n,u=bt.getLongAt(e,r+s,i),d,p)?xt(e,n+u,d,p,i,33723===l):"<faulty value>",d===bt.tagTypes.ASCII&&(a=function(e){try{return e.map((function(e){return decodeURIComponent(escape(e))}))}catch(t){return e}}(a=function(e){for(var t=[],n=0,r=0;r<e.length;r++)"\0"!==e[r]?(void 0===t[n]&&(t[n]=""),t[n]+=e[r]):n++;return t}(a)));var m="undefined-".concat(l),g=a;if(void 0!==vt[t][l])if(void 0!==vt[t][l].name&&void 0!==vt[t][l].description){m=vt[t][l].name;try{g=vt[t][l].description(a)}catch(e){g=Tt(a)}}else d===bt.tagTypes.RATIONAL||d===bt.tagTypes.SRATIONAL?(m=vt[t][l],g=""+a[0]/a[1]):(m=vt[t][l],g=Tt(a));return{id:l,name:m,value:a,description:g,__offset:u}}}function xt(e,t,n,r,i){var o=[];arguments.length>5&&void 0!==arguments[5]&&arguments[5]&&(r*=bt.typeSizes[n],n=bt.tagTypes.BYTE);for(var a=0;a<r;a++)o.push(Pt[n](e,t,i)),t+=bt.typeSizes[n];return n===bt.tagTypes.ASCII?o=bt.getAsciiValue(o):1===o.length&&(o=o[0]),o}function Tt(e){return e instanceof Array?e.join(", "):e}var Ot="Exif IFD Pointer",Mt="GPS Info IFD Pointer",Ft="Interoperability IFD Pointer",Rt={read:function(e,t,n){var r=U(e,t),i=function(e,t,n,r){return wt(e,pt,t,At(e,t,n),n,r)}(e,t,r,n);return{tags:i=Nt(i=Dt(i=kt(i,e,t,r,n),e,t,r,n),e,t,r,n),byteOrder:r}}};function kt(e,t,n,r,i){return void 0!==e[Ot]?l(e,wt(t,mt,n,n+e[Ot].value,r,i)):e}function Dt(e,t,n,r,i){return void 0!==e[Mt]?l(e,wt(t,"gps",n,n+e[Mt].value,r,i)):e}function Nt(e,t,n,r,i){return void 0!==e[Ft]?l(e,wt(t,gt,n,n+e[Ft].value,r,i)):e}var Lt={read:function(e,t,n){var r=U(e,t);return function(e,t,n,r){if(!n.MPEntry)return n;for(var i=[],o=0;o<Math.ceil(n.MPEntry.value.length/_t);o++){i[o]={};var a=Bt(n.MPEntry.value,o*_t,bt.getTypeSize("LONG"),r);i[o].ImageFlags=Gt(a),i[o].ImageFormat=jt(a),i[o].ImageType=zt(a);var u=Bt(n.MPEntry.value,o*_t+4,bt.getTypeSize("LONG"),r);i[o].ImageSize={value:u,description:""+u};var c=Vt(o,n.MPEntry,r,t);i[o].ImageOffset={value:c,description:""+c};var f=Bt(n.MPEntry.value,o*_t+12,bt.getTypeSize("SHORT"),r);i[o].DependentImage1EntryNumber={value:f,description:""+f};var s=Bt(n.MPEntry.value,o*_t+14,bt.getTypeSize("SHORT"),r);i[o].DependentImage2EntryNumber={value:s,description:""+s},i[o].image=e.buffer.slice(c,c+u),d(i[o],"base64",(function(){return p(this.image)}))}return n.Images=i,n}(e,t,wt(e,"mpf",t,At(e,t,r),r,n),r)}},_t=16;function Bt(e,t,n,r){if(r===C){for(var i=0,o=0;o<n;o++)i+=e[t+o]<<8*o;return i}for(var a=0,u=0;u<n;u++)a+=e[t+u]<<8*(n-1-u);return a}function Gt(e){var t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function jt(e){var t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function zt(e){var t=16777215&e;return{value:t,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[t]||"Unknown"}}function Vt(e,t,n,r){return function(e){return 0===e}(e)?0:Bt(t.value,e*_t+8,bt.getTypeSize("LONG"),n)+r}var Ht={read:function(e,t){var n=function(e,t){return bt.getShortAt(e,t)}(e,t),r=function(e,t,n){if(!(8>n)){var r=bt.getByteAt(e,t+7);return{value:r,description:""+r}}}(e,t,n);return{"Bits Per Sample":Wt(e,t,n),"Image Height":Xt(e,t,n),"Image Width":Jt(e,t,n),"Color Components":r,Subsampling:r&&Yt(e,t,r.value,n)}}};function Wt(e,t,n){if(!(3>n)){var r=bt.getByteAt(e,t+2);return{value:r,description:""+r}}}function Xt(e,t,n){if(!(5>n)){var r=bt.getShortAt(e,t+3);return{value:r,description:"".concat(r,"px")}}}function Jt(e,t,n){if(!(7>n)){var r=bt.getShortAt(e,t+5);return{value:r,description:"".concat(r,"px")}}}function Yt(e,t,n,r){if(!(8+3*n>r)){for(var i=[],o=0;o<n;o++){var a=t+8+3*o;i.push([bt.getByteAt(e,a),bt.getByteAt(e,a+1),bt.getByteAt(e,a+2)])}return{value:i,description:i.length>1?Kt(i)+qt(i):""}}}function Kt(e){var t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((function(e){return t[e[0]]})).join("")}function qt(e){var t={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var $t={read:function(e,t){var n=function(e,t){return bt.getShortAt(e,t)}(e,t),r=function(e,t,n){if(!(15>n)){var r=bt.getByteAt(e,t+14);return{value:r,description:"".concat(r,"px")}}}(e,t,n),i=function(e,t,n){if(!(16>n)){var r=bt.getByteAt(e,t+15);return{value:r,description:"".concat(r,"px")}}}(e,t,n),o={"JFIF Version":Zt(e,t,n),"Resolution Unit":Qt(e,t,n),XResolution:tn(e,t,n),YResolution:nn(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(void 0!==r&&void 0!==i){var a=function(e,t,n,r){if(!(0===n||16+n>r))return{value:e.buffer.slice(t+16,t+16+n),description:"<24-bit RGB pixel data>"}}(e,t,3*r.value*i.value,n);a&&(o["JFIF Thumbnail"]=a)}for(var u in o)void 0===o[u]&&delete o[u];return o}};function Zt(e,t,n){if(!(9>n)){var r=bt.getByteAt(e,t+7),i=bt.getByteAt(e,t+7+1);return{value:256*r+i,description:r+"."+i}}}function Qt(e,t,n){if(!(10>n)){var r=bt.getByteAt(e,t+9);return{value:r,description:en(r)}}}function en(e){return 0===e?"None":1===e?"inches":2===e?"cm":"Unknown"}function tn(e,t,n){if(!(12>n)){var r=bt.getShortAt(e,t+10);return{value:r,description:""+r}}}function nn(e,t,n){if(!(14>n)){var r=bt.getShortAt(e,t+12);return{value:r,description:""+r}}}var rn={iptc:{256:{name:"Model Version",description:function(e){return""+((e[0]<<8)+e[1])}},261:{name:"Destination",repeatable:1},276:{name:"File Format",description:function(e){return""+((e[0]<<8)+e[1])}},278:{name:"File Format Version",description:function(e){return""+((e[0]<<8)+e[1])}},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:on},336:{name:"Time Sent",description:an},346:{name:"Coded Character Set",description:un,encoding_name:un},356:"UNO",376:{name:"ARM Identifier",description:function(e){return""+((e[0]<<8)+e[1])}},378:{name:"ARM Version",description:function(e){return""+((e[0]<<8)+e[1])}},512:{name:"Record Version",description:function(e){return""+((e[0]<<8)+e[1])}},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:function(e){return"01"===y(e)?"Additional Language":"Unknown"}},522:"Urgency",524:{name:"Subject Reference",repeatable:1,description:function(e){var t=y(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:1},534:"Fixture Identifier",537:{name:"Keywords",repeatable:1},538:{name:"Content Location Code",repeatable:1},539:{name:"Content Location Name",repeatable:1},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:function(e){var t=y(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:1},559:{name:"Reference Date",repeatable:1},562:{name:"Reference Number",repeatable:1},567:{name:"Date Created",description:on},572:{name:"Time Created",description:an},574:{name:"Digital Creation Date",description:on},575:{name:"Digital Creation Time",description:an},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:function(e){var t=y(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"both":"Unknown"}},592:{name:"By-line",repeatable:1},597:{name:"By-line Title",repeatable:1},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:1},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:1},637:{name:"Rasterized Caption",description:function(e){return e}},642:"Image Type",643:{name:"Image Orientation",description:function(e){var t=y(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:function(e){var t=y(e),n=t.charAt(0),r=t.charAt(1),i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:function(e){return parseInt(y(e),10)+" Hz"}},664:{name:"Audio Sampling Resolution",description:function(e){var t=parseInt(y(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:function(e){var t=y(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:function(e){return 2===e.length?"ObjectData Preview File Format":"Record 2 destination"},description:function(e){if(2===e.length){var t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":"Unknown format ".concat(t)}return y(e)}},713:{name:"ObjectData Preview File Format Version",description:function(e,t){var n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},r=y(e);if(t["ObjectData Preview File Format"]){var i=y(t["ObjectData Preview File Format"].value);if(n[i]&&n[i][r])return n[i][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:function(e){return e[0].toString()}},1812:{name:"Max Subfile Size",description:function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:"ObjectData Size Announced",description:function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:"Maximum ObjectData Size",description:function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function on(e){var t=y(e);return t.length>=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function an(e){var t=y(e),n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function un(e){var t=y(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var cn=function(e,t){var n=function(){if("undefined"!=typeof TextDecoder)return TextDecoder}();if("undefined"!=typeof n&&void 0!==e)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch(e){}return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t.map((function(e){return String.fromCharCode(e)})).join(""))},fn={read:function(e,t,n){try{if(Array.isArray(e))return pn(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n);var r=function(e,t){for(;t+12<=e.byteLength;){var n=sn(e,t);if(ln(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+dn(n)}throw Error("No IPTC NAA resource block.")}(e,t);return pn(e,r.naaBlock,r.dataOffset,n)}catch(e){return{}}}};function sn(e,t){if(943868237!==e.getUint32(t,0))throw Error("Not an IPTC resource block.");var n=e.getUint8(t+4+2),r=(n%2==0?n+1:n)+1;return{headerSize:6+r+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+r)}}function ln(e){return 1028===e.type}function dn(e){return e.size%2!=0?1:0}function pn(e,t,n,r){for(var i={},o=void 0,a=n+t.size;n<a&&n<e.byteLength;){var u=mn(e,n,i,o,r),c=u.tag,f=u.tagSize;if(null===c)break;c&&("encoding"in c&&(o=c.encoding),void 0===i[c.name]||void 0===c.repeatable?i[c.name]={id:c.id,value:c.value,description:c.description}:(i[c.name]instanceof Array||(i[c.name]=[{id:i[c.name].id,value:i[c.name].value,description:i[c.name].description}]),i[c.name].push({id:c.id,value:c.value,description:c.description}))),n+=5+f}return i}function mn(e,t,n,r,i){if(function(e,t){return 28!==e.getUint8(t)}(e,t))return{tag:null,tagSize:0};var o=e.getUint16(t+1),a=e.getUint16(t+3);if(!i&&!rn.iptc[o])return{tag:void 0,tagSize:a};var u=function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(e.getUint8(t+i));return r}(e,t+5,a),c={id:o,name:gn(rn.iptc[o],o,u),value:u,description:hn(rn.iptc[o],u,n,r)};return function(e){return rn.iptc[e]&&rn.iptc[e].repeatable}(o)&&(c.repeatable=1),function(e){return rn.iptc[e]&&void 0!==rn.iptc[e].encoding_name}(o)&&(c.encoding=rn.iptc[o].encoding_name(u)),{tag:c,tagSize:a}}function gn(e,t,n){return e?function(e){return"string"==typeof e}(e)?e:function(e){return"function"==typeof e.name}(e)?e.name(n):e.name:"undefined-".concat(t)}function hn(e,t,n,r){if(function(e){return e&&void 0!==e.description}(e))try{return e.description(t,n)}catch(e){}return function(e,t){return e&&t instanceof Array}(e,t)?cn(r,t):t}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var yn={"tiff:Orientation":function(e){return"1"===e?"Horizontal (normal)":"2"===e?"Mirror horizontal":"3"===e?"Rotate 180":"4"===e?"Mirror vertical":"5"===e?"Mirror horizontal and rotate 270 CW":"6"===e?"Rotate 90 CW":"7"===e?"Mirror horizontal and rotate 90 CW":"8"===e?"Rotate 270 CW":e},"tiff:ResolutionUnit":function(e){return nt.ResolutionUnit(parseInt(e,10))},"tiff:XResolution":function(e){return Sn(nt.XResolution,e)},"tiff:YResolution":function(e){return Sn(nt.YResolution,e)},"exif:ApertureValue":function(e){return Sn(nt.ApertureValue,e)},"exif:GPSLatitude":In,"exif:GPSLongitude":In,"exif:FNumber":function(e){return Sn(nt.FNumber,e)},"exif:FocalLength":function(e){return Sn(nt.FocalLength,e)},"exif:FocalPlaneResolutionUnit":function(e){return nt.FocalPlaneResolutionUnit(parseInt(e,10))},"exif:ColorSpace":function(e){return nt.ColorSpace(function(e){return"0x"===e.substring(0,2)?parseInt(e.substring(2),16):parseInt(e,10)}(e))},"exif:ComponentsConfiguration":function(e,t){if(/^\d, \d, \d, \d$/.test(t)){var n=t.split(", ").map((function(e){return e.charCodeAt(0)}));return nt.ComponentsConfiguration(n)}return t},"exif:Contrast":function(e){return nt.Contrast(parseInt(e,10))},"exif:CustomRendered":function(e){return nt.CustomRendered(parseInt(e,10))},"exif:ExposureMode":function(e){return nt.ExposureMode(parseInt(e,10))},"exif:ExposureProgram":function(e){return nt.ExposureProgram(parseInt(e,10))},"exif:ExposureTime":function(e){return bn(e)?nt.ExposureTime(e.split("/").map((function(e){return parseInt(e,10)}))):e},"exif:MeteringMode":function(e){return nt.MeteringMode(parseInt(e,10))},"exif:Saturation":function(e){return nt.Saturation(parseInt(e,10))},"exif:SceneCaptureType":function(e){return nt.SceneCaptureType(parseInt(e,10))},"exif:Sharpness":function(e){return nt.Sharpness(parseInt(e,10))},"exif:ShutterSpeedValue":function(e){return Sn(nt.ShutterSpeedValue,e)},"exif:WhiteBalance":function(e){return nt.WhiteBalance(parseInt(e,10))}};function Sn(e,t){return bn(t)?e(t.split("/")):t}function bn(e){return/^-?\d+\/-?\d+$/.test(e)}function In(e){var t,n=function(e){if(Array.isArray(e))return e}(t=e.split(","))||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return vn(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vn(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],i=n[1];if(void 0!==r&&void 0!==i){var o=parseFloat(r),a=parseFloat(i),u=i.charAt(i.length-1);if(!Number.isNaN(o)&&!Number.isNaN(a))return""+(o+a/60)+u}return e}var Cn={xmp:"http://ns.adobe.com/xap/1.0/",tiff:"http://ns.adobe.com/tiff/1.0/",exif:"http://ns.adobe.com/exif/1.0/",dc:"http://purl.org/dc/elements/1.1/",xmpMM:"http://ns.adobe.com/xap/1.0/mm/",stEvt:"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#",stRef:"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",photoshop:"http://ns.adobe.com/photoshop/1.0/"};function Un(e){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Un(e)}function Pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function An(e){var t="function"==typeof Map?new Map:void 0;return An=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(wn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&En(i,n.prototype),i}(e,arguments,xn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:0,writable:1,configurable:1}}),En(n,e)},An(e)}function wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wn=function(){return!!e})()}function En(e,t){return En=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},En(e,t)}function xn(e){return xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xn(e)}var Tn={read:function(e,t,n){var r={};if("string"==typeof e)return Fn(r,e,n),r;var i,o=(i=function(e,t){if(0===t.length)return[];var n=[Mn(e,t.slice(0,1))];return t.length>1&&n.push(Mn(e,t.slice(1))),n}(e,t),function(e){if(Array.isArray(e))return e}(i)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(i)||function(e){if(e){if("string"==typeof e)return Pn(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Pn(e,2):void 0}}(i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],u=o[1],c=Fn(r,a,n);if(u){var f=Fn(r,u,n);c||f||(delete r._raw,Fn(r,Mn(e,t),n))}return r}},On=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=xn(t),function(e,t){if(t&&("object"==Un(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wn()?Reflect.construct(t,n||[],xn(e).constructor):t.apply(e,n))}(this,t,[e])).name="ParseError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:1,configurable:1}}),Object.defineProperty(e,"prototype",{writable:0}),t&&En(e,t)}(t,e),Object.defineProperty(n=t,"prototype",{writable:0}),n;var n}(An(Error));function Mn(e,t){for(var n=t.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),i=0,o=0;o<t.length;o++){var a=t[o],u=e.buffer.slice(a.dataOffset,a.dataOffset+a.length);r.set(new Uint8Array(u),i),i+=a.length}return new DataView(r.buffer)}function Fn(e,t,n){try{var r=function(e,t){var n=function(e){if(e)return e;if("undefined"!=typeof DOMParser)return new DOMParser;try{var t=require("@xmldom/xmldom");return new(0,t.DOMParser)({onError:t.onErrorStopParsing})}catch(e){return}}(t);if(!n)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),Error();var r="string"==typeof e?e:a(e,0,e.byteLength);return{doc:Rn(n,r.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")),raw:r}}(t,n),i=r.doc,o=r.raw;return e._raw=(e._raw||"")+o,l(e,Ln(Dn(kn(i),1))),1}catch(e){return 0}}function Rn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;try{var r=e.parseFromString(t,"application/xml"),i=r.getElementsByTagName("parsererror");if(i.length>0)throw new On(i[0].textContent);return r}catch(r){if("ParseError"===r.name&&function(e){for(var t=["prefix is non-null and namespace is null","prefix not bound to a namespace","prefix inte bundet till en namnrymd",/Namespace prefix .+ is not defined/],n=0;n<t.length;n++)if(RegExp(t[n]).test(e.message))return 1;return 0}(r)&&!n)return Rn(e,function(e){var t=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!t)return e;var n=t[1],r=function(e){for(var t,n=[],r=/xmlns:([\w-]+)=["'][^"']+["']/g;null!==(t=r.exec(e));)-1===n.indexOf(t[1])&&n.push(t[1]);return n}(e),i=function(e){for(var t,n=[],r=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;null!==(t=r.exec(e));){var i=t[1];"xmlns"!==i&&"xml"!==i&&-1===n.indexOf(i)&&n.push(i)}return n}(e).filter((function(e){return-1===r.indexOf(e)}));return 0===i.length?e:function(e,t,n){var r=RegExp("<"+t+"([^>]*)>");return e.replace(r,"<"+t+"$1"+n+">")}(e,n,function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=Cn[r]||"http://fallback.namespace/"+r;t.push(" xmlns:"+r+'="'+i+'"')}return t.join("")}(i))}(t),1);throw r}}function kn(e){for(var t=0;t<e.childNodes.length;t++){if("x:xmpmeta"===e.childNodes[t].tagName)return kn(e.childNodes[t]);if("rdf:RDF"===e.childNodes[t].tagName)return e.childNodes[t]}throw Error()}function Dn(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=function(e){for(var t=[],n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}(e);return 1===(t=r).length&&"#text"===t[0].nodeName?n?{}:function(e){return e.nodeValue}(r[0]):function(e){var t={};return e.forEach((function(e){if(function(e){return e.nodeName&&"#text"!==e.nodeName}(e)){var n=function(e){return{attributes:Nn(e),value:Dn(e)}}(e);void 0!==t[e.nodeName]?(Array.isArray(t[e.nodeName])||(t[e.nodeName]=[t[e.nodeName]]),t[e.nodeName].push(n)):t[e.nodeName]=n}})),t}(r)}function Nn(e){for(var t={},n=0;n<e.attributes.length;n++)t[e.attributes[n].nodeName]=decodeURIComponent(escape(e.attributes[n].value));return t}function Ln(e){var t={};if("string"==typeof e)return e;for(var n in e){var r=e[n];Array.isArray(r)||(r=[r]),r.forEach((function(e){l(t,_n(e.attributes)),"object"===Un(e.value)&&l(t,Hn(e.value))}))}return t}function _n(e){var t={};for(var n in e)try{Bn(n)&&(t[jn(n)]={value:e[n],attributes:{},description:zn(e[n],n)})}catch(e){}return t}function Bn(e){return"rdf:parseType"!==e&&!Gn(e)}function Gn(e){return"xmlns"===e.split(":")[0]}function jn(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function zn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Array.isArray(e)){var n=function(e){return e.map((function(e){return void 0!==e.value?zn(e.value):zn(e)})).join(", ")}(e);return t&&"function"==typeof yn[t]?yn[t](e,n):n}if("object"===Un(e))return function(e){var t=[];for(var n in e)t.push("".concat(Vn(n),": ").concat(zn(e[n].value)));return t.join("; ")}(e);try{return t&&"function"==typeof yn[t]?yn[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function Vn(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function Hn(e){var t={};for(var n in e)try{Gn(n)||(t[jn(n)]=Wn(e[n],n))}catch(e){}return t}function Wn(e,t){return function(e){return Array.isArray(e)}(e)?function(e,t){return er(e[e.length-1],t)}(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]&&"string"==typeof e.value&&""===e.value.trim()}(e)?{value:"",attributes:{},description:""}:Xn(e)?Jn(e,t):Kn(e)?qn(e,t):$n(e)?Zn(e,t):function(e){return void 0!==Qn(e.value)}(e)?function(e,t){var n=Qn(e.value).value["rdf:li"],r=Yn(e),i=[];return void 0===n?n=[]:Array.isArray(n)||(n=[n]),n.forEach((function(e){i.push(function(e){return Xn(e)?Jn(e):Kn(e)?qn(e).value:$n(e)?Zn(e).value:er(e)}(e))})),{value:i,attributes:r,description:zn(i,t)}}(e,t):er(e,t)}function Xn(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function Jn(e,t){var n=Yn(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),l(n,Yn(e),function(e){var t={};for(var n in e.value)"rdf:value"===n||Gn(n)||(t[jn(n)]=e.value[n].value);return t}(e));var r=function(e){return tr(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:zn(r,t)}}function Yn(e){var t={};for(var n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||Gn(n)||(t[jn(n)]=e.attributes[n]);return t}function Kn(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}function qn(e,t){var n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(l(n.value,_n(e.value["rdf:Description"].attributes)),l(n.attributes,Yn(e)),e=e.value["rdf:Description"]),l(n.value,Hn(e.value)),n.description=zn(n.value,t),n}function $n(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["xml:lang"]&&void 0===e.attributes["rdf:resource"]}function Zn(e,t){var n=_n(e.attributes);return{value:n,attributes:{},description:zn(n,t)}}function Qn(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function er(e,t){var n=tr(e)||Ln(e.value);return{value:n,attributes:Yn(e),description:zn(n,t)}}function tr(e){return e.attributes&&e.attributes["rdf:resource"]}function nr(e){return nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nr(e)}function rr(e,t,n){return(t=function(e){var t=function(e){if("object"!=nr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=nr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return e+""}(e);return"symbol"==nr(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:1,configurable:1,writable:1}):e[t]=n,e}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var or={2e3:{name:"PathInformation",description:function(e){for(var t={},n=[],r=0;r<e.byteLength;r+=26){var i=bt.getShortAt(e,r);ar[i]&&(t[i]||(t[i]=ar[i].description),n.push({type:i,path:ar[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}},2999:{name:"ClippingPathName",description:function(e){return(t=f(e,0),function(e){if(Array.isArray(e))return e}(t)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(t)||function(e){if(e){if("string"==typeof e)return ir(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ir(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];var t}}},ar=rr(rr(rr(rr(rr(rr(rr(rr(rr({},0,{description:"Closed subpath length",path:function(e,t){return[bt.getShortAt(e,t)]}}),1,{description:"Closed subpath Bezier knot, linked",path:ur}),2,{description:"Closed subpath Bezier knot, unlinked",path:ur}),3,{description:"Open subpath length",path:function(e,t){return[bt.getShortAt(e,t)]}}),4,{description:"Open subpath Bezier knot, linked",path:ur}),5,{description:"Open subpath Bezier knot, unlinked",path:ur}),6,{description:"Path fill rule",path:function(){return[]}}),8,{description:"Initial fill rule",path:function(e,t){return[bt.getShortAt(e,t)]}}),7,{description:"Clipboard",path:function(e,t){return[[fr(e,t,8),fr(e,t+4,8),fr(e,t+8,8),fr(e,t+12,8)],fr(e,t+16,8)]}});function ur(e,t){for(var n=[],r=0;r<24;r+=8)n.push(cr(e,t+r));return n}function cr(e,t){var n=fr(e,t,8);return[fr(e,t+4,8),n]}function fr(e,t,n){var r,i=bt.getLongAt(e,t),o=i>>>31==0?1:-1,a=(2130706432&i)>>>32-n,u=i&parseInt(m("1",32-n),2);return o*function(e){return parseInt(e.replace(".",""),2)/Math.pow(2,(e.split(".")[1]||"").length)}(a.toString(2)+"."+(m("0",32-n-(r=u.toString(2)).length)+r))}function sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var lr={read:function(e,t){for(var n=o(new Uint8Array(e).buffer),r={},i=0;i<e.length;){var u=a(n,i,gr);i+=gr;var c=bt.getShortAt(n,i),f=hr(n,i+=pr),s=f.tagName;i+=f.tagNameSize;var l=bt.getLongAt(n,i);if(i+=mr,u===dr){var d=o(n.buffer,i,l),p={id:c,value:a(d,0,l)};if(or[c]){try{p.description=or[c].description(d)}catch(e){p.description="<no description formatter>"}r[s||or[c].name]=p}else t&&(r["undefined-".concat(c)]=p)}i+=l+l%2}return r}},dr="8BIM",pr=2,mr=4,gr=dr.length;function hr(e,t){var n,r=function(e){if(Array.isArray(e))return e}(n=f(e,t))||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,a=[],u=1,c=0;try{for(i=(t=t.call(e)).next,!2;!(u=(n=i.call(t)).done)&&(a.push(n.value),2!==a.length);u=1);}catch(e){c=1,r=e}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(n)||function(e){if(e){if("string"==typeof e)return sr(e,2);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?sr(e,2):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=r[0];return{tagName:r[1],tagNameSize:1+i+(i%2==0?1:0)}}var vr={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},yr={4:{name:"Preferred CMM type",value:function(e,t){return a(e,t,4)},description:function(e){return null!==e?Sr(e):""}},8:{name:"Profile Version",value:function(e,t){return e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)}},12:{name:"Profile/Device class",value:function(e,t){return a(e,t,4)},description:function(e){switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:function(e,t){return a(e,t,4)}},20:{name:"Connection Space",value:function(e,t){return a(e,t,4)}},24:{name:"ICC Profile Date",value:function(e,t){return function(e,t){var n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),o=e.getUint16(t+6),a=e.getUint16(t+8),u=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,o,a,u))}(e,t).toISOString()}},36:{name:"ICC Signature",value:function(e,t){return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:function(e,t){return a(e,t,4)},description:function(e){return Sr(e)}},48:{name:"Device Manufacturer",value:function(e,t){return a(e,t,4)},description:function(e){return Sr(e)}},52:{name:"Device Model Number",value:function(e,t){return a(e,t,4)}},64:{name:"Rendering Intent",value:function(e,t){return e.getUint32(t)},description:function(e){switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:function(e,t){return a(e,t,4)}}};function Sr(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}var br={read:function(e,t,n){return n&&t[0].compressionMethod!==g?function(e,t){return 0!==t[0].compressionMethod?{}:h(new DataView(e.buffer.slice(t[0].offset,t[0].offset+t[0].length)),t[0].compressionMethod,"utf-8","dataview").then(Or).catch((function(){return{}}))}(e,t):function(e,t){try{for(var n=t.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),i=0,o=function(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}(e),a=function(e){var n=t.find((function(t){return t.chunkNumber===e}));if(!n)throw Error("ICC chunk ".concat(e," not found"));var a=o.slice(n.offset,n.offset+n.length),u=new Uint8Array(a);r.set(u,i),i+=u.length},u=1;u<=t.length;u++)a(u);return Or(new DataView(r.buffer))}catch(e){return{}}}(e,t)}},Ir=84,Cr=128,Ur="acsp",Pr="desc",Ar="mluc",wr="text",Er="sig ",xr=12;function Tr(e,t){return e.length<t+xr}function Or(e){var t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw Error("ICC profile length not matching");if(e.length<Ir)throw Error("ICC profile too short");for(var r={},i=Object.keys(yr),o=0;o<i.length;o++){var u=i[o],f=yr[u],s=f.value(e,parseInt(u,10)),l=s;f.description&&(l=f.description(s)),r[f.name]={value:s,description:l}}if(Mr(t.slice(36,40))!==Ur)throw Error("ICC profile: missing signature");if(function(e){return e.length<Cr+4}(t))return r;for(var d=e.getUint32(128),p=132,m=0;m<d;m++){if(Tr(t,p))return r;var g=a(e,p,4),h=e.getUint32(p+4),v=e.getUint32(p+8);if(h>t.length)return r;var y=a(e,h,4);if(y===Pr){var S=e.getUint32(h+8);if(S>v)return r;Fr(r,g,Mr(t.slice(h+12,h+S+11)))}else if(y===Ar){for(var b=e.getUint32(h+8),I=e.getUint32(h+12),C=h+16,U=[],P=0;P<b;P++){var A=a(e,C+0,2),w=a(e,C+2,2),E=e.getUint32(C+4),x=e.getUint32(C+8),T=c(e,h+x,E);U.push({languageCode:A,countryCode:w,text:T}),C+=I}if(1===b)Fr(r,g,U[0].text);else{for(var O={},M=0;M<U.length;M++)O["".concat(U[M].languageCode,"-").concat(U[M].countryCode)]=U[M].text;Fr(r,g,O)}}else y===wr?Fr(r,g,Mr(t.slice(h+8,h+v-7))):y===Er&&Fr(r,g,Mr(t.slice(h+8,h+12)));p+=12}return r}function Mr(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function Fr(e,t,n){vr[t]?e[vr[t].name]={value:n,description:n}:e[t]={value:n,description:n}}var Rr={read:function(e,t,n,r,i){var o=wt(e,ht,t,t+n,r,i);return o.ShotInfo&&delete(o=l({},o,function(e){var t,n={};return void 0!==e[27]&&(n.AutoRotate={value:e[27],description:(t=e[27],0===t?"None":1===t?"Rotate 90 CW":2===t?"Rotate 180":3===t?"Rotate 270 CW":"Unknown")}),n}(o.ShotInfo.value))).ShotInfo,o},SHOT_INFO_AUTO_ROTATE:27},kr={read:function(e,t){return{"Image Width":Dr(e,t),"Image Height":Nr(e,t),"Bit Depth":Lr(e,t),"Color Type":_r(e,t),Compression:Br(e,t),Filter:Gr(e,t),Interlace:jr(e,t)}}};function Dr(e,t){if(!(t+0+4>e.byteLength)){var n=bt.getLongAt(e,t);return{value:n,description:"".concat(n,"px")}}}function Nr(e,t){if(!(t+4+4>e.byteLength)){var n=bt.getLongAt(e,t+4);return{value:n,description:"".concat(n,"px")}}}function Lr(e,t){if(!(t+8+1>e.byteLength)){var n=bt.getByteAt(e,t+8);return{value:n,description:"".concat(n)}}}function _r(e,t){if(!(t+9+1>e.byteLength)){var n=bt.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}}function Br(e,t){if(!(t+10+1>e.byteLength)){var n=bt.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}}function Gr(e,t){if(!(t+11+1>e.byteLength)){var n=bt.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}}function jr(e,t){if(!(t+12+1>e.byteLength)){var n=bt.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}}function zr(e){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zr(e)}var Vr={read:function(e,t,n,r){for(var i={},o=[],a=0;a<t.length;a++){var u=t[a],c=Zr(e,u.offset,u.length,u.type,n);if(c instanceof Promise)o.push(c.then((function(e){var t,n,i,o=e.name,a=e.value,u=e.description;try{if(v.USE_EXIF&&ii(o,a))return{__exif:Rt.read(ai(a),$r,r).tags};if(v.USE_IPTC&&oi(o,a))return{__iptc:fn.read(ai(a),0,r)};if(o&&!ii(o,a)&&!oi(o,a))return t={},i={value:a,description:u},(n=function(e){var t=function(e){if("object"!=zr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return e+""}(e);return"symbol"==zr(t)?t:t+""}(n=o))in t?Object.defineProperty(t,n,{value:i,enumerable:1,configurable:1,writable:1}):t[n]=i,t}catch(e){}return{}})));else{var f=c.name,s=c.value,l=c.description;f&&(i[f]={value:s,description:l})}}return{readTags:i,readTagsPromise:o.length>0?Promise.all(o):void 0}}},Hr="STATE_KEYWORD",Wr="STATE_COMPRESSION",Xr="STATE_LANG",Jr="STATE_TRANSLATED_KEYWORD",Yr="STATE_TEXT",Kr=1,qr=1,$r=6;function Zr(e,t,n,r,i){for(var o,a=[],u=[],c=[],f=Hr,s=g,l=0;l<n&&t+l<e.byteLength;l++)if(f!==Wr){if(f===Yr){o=new DataView(e.buffer.slice(t+l,t+n));break}var d=e.getUint8(t+l);0===d?f=ei(r,f):f===Hr?a.push(d):f===Xr?u.push(d):f===Jr&&c.push(d)}else s=Qr({type:r,dataView:e,offset:t+l}),r===Ae&&(l+=Kr),f=ei(r,f);if(s!==g&&!i)return{};var p=h(o,s,function(e){return e===Pe||e===we?"latin1":"utf-8"}(r));return p instanceof Promise?p.then((function(e){return ti(e,r,u,a)})).catch((function(){return ti("<text using unknown compression>".split(""),r,u,a)})):ti(p,r,u,a)}function Qr(e){var t=e.type,n=e.dataView,r=e.offset;if(t===Ae){if(n.getUint8(r)===qr)return n.getUint8(r+1)}else if(t===we)return n.getUint8(r);return g}function ei(e,t){return t===Hr&&[Ae,we].includes(e)?Wr:t===Wr?e===Ae?Xr:Yr:t===Xr?Jr:Yr}function ti(e,t,n,r){var i=function(e){return e instanceof DataView?a(e,0,e.byteLength):e}(e);return{name:ni(t,n,r),value:i,description:t===Ae?ri(e):i}}function ni(e,t,n){var r=s(n);if(e===Pe||0===t.length)return r;var i=s(t);return"".concat(r," (").concat(i,")")}function ri(e){return cn("UTF-8",e)}function ii(e,t){return"raw profile type exif"===e.toLowerCase()&&"exif"===t.substring(1,5)}function oi(e,t){return"raw profile type iptc"===e.toLowerCase()&&"iptc"===t.substring(1,5)}function ai(e){return function(e){for(var t=new DataView(new ArrayBuffer(e.length/2)),n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,""))}var ui={read:function(e,t){for(var n={},r=0;r<t.length;r++){var i=bt.getLongAt(e,t[r]+be),o=a(e,t[r]+Ie,Se);o===Ee?(n["Pixels Per Unit X"]=ci(e,t[r],i),n["Pixels Per Unit Y"]=fi(e,t[r],i),n["Pixel Units"]=si(e,t[r],i)):o===xe&&(n["Modify Date"]=li(e,t[r],i))}return n}};function ci(e,t,n){if(di(e,t,n,0,4)){var r=bt.getLongAt(e,t+Ce+0);return{value:r,description:""+r}}}function fi(e,t,n){if(di(e,t,n,4,4)){var r=bt.getLongAt(e,t+Ce+4);return{value:r,description:""+r}}}function si(e,t,n){if(di(e,t,n,8,1)){var r=bt.getByteAt(e,t+Ce+8);return{value:r,description:1===r?"meters":"Unknown"}}}function li(e,t,n){if(di(e,t,n,0,7)){var r=bt.getShortAt(e,t+Ce),i=bt.getByteAt(e,t+Ce+2),o=bt.getByteAt(e,t+Ce+3),a=bt.getByteAt(e,t+Ce+4),u=bt.getByteAt(e,t+Ce+5),c=bt.getByteAt(e,t+Ce+6);return{value:[r,i,o,a,u,c],description:"".concat(pi(r,4),"-").concat(pi(i,2),"-").concat(pi(o,2)," ").concat(pi(a,2),":").concat(pi(u,2),":").concat(pi(c,2))}}}function di(e,t,n,r,i){return r+i<=n&&t+Ce+r+i<=e.byteLength}function pi(e,t){return"".concat("0".repeat(t-(""+e).length)).concat(e)}var mi={read:function(e,t){var n={},r=bt.getByteAt(e,t);return n.Alpha=function(e){var t=16&e;return{value:t?1:0,description:t?"Yes":"No"}}(r),n.Animation=function(e){var t=2&e;return{value:t?1:0,description:t?"Yes":"No"}}(r),n.ImageWidth=vi(e,t+gi),n.ImageHeight=vi(e,t+hi),n}},gi=4,hi=7;function vi(e,t){var n=bt.getByteAt(e,t)+256*bt.getByteAt(e,t+1)+65536*bt.getByteAt(e,t+2)+1;return{value:n,description:n+"px"}}var yi={read:function(e){return{"GIF Version":Si(e),"Image Width":bi(e),"Image Height":Ii(e),"Global Color Map":Ci(e),"Bits Per Pixel":Pi(e),"Color Resolution Depth":Ui(e)}}};function Si(e){if(!(6>e.byteLength)){var t=a(e,3,3);return{value:t,description:t}}}function bi(e){if(!(8>e.byteLength)){var t=e.getUint16(6,1);return{value:t,description:"".concat(t,"px")}}}function Ii(e){if(!(10>e.byteLength)){var t=e.getUint16(8,1);return{value:t,description:"".concat(t,"px")}}}function Ci(e){if(!(11>e.byteLength)){var t=(128&e.getUint8(10))>>>7;return{value:t,description:1===t?"Yes":"No"}}}function Ui(e){if(!(11>e.byteLength)){var t=1+((112&e.getUint8(10))>>>4);return{value:t,description:"".concat(t," ").concat(1===t?"bit":"bits")}}}function Pi(e){if(!(11>e.byteLength)){var t=1+(7&e.getUint8(10));return{value:t,description:"".concat(t," ").concat(1===t?"bit":"bits")}}}var Ai=[6,7,99],wi={get:function(e,t,n){if((i=t)&&(void 0===i.Compression||Ai.includes(i.Compression.value))&&i.JPEGInterchangeFormat&&i.JPEGInterchangeFormat.value&&i.JPEGInterchangeFormatLength&&i.JPEGInterchangeFormatLength.value){t.type="image/jpeg";var r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),d(t,"base64",(function(){return p(this.image)}))}var i;return t}};function Ei(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=Error().stack}Ei.prototype=Error();var xi={MetadataMissingError:Ei},Ti={load:Mi,loadView:Ri,errors:xi},Oi=xi;function Mi(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e){return"string"==typeof e}(e)?(n.async=1,function(e,t){return/^\w+:\/\//.test(e)?"undefined"!=typeof fetch?function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).length,n={method:"GET"};return Number.isInteger(t)&&t>=0&&(n.headers={range:"bytes=0-".concat(t-1)}),fetch(e,n).then((function(e){return e.arrayBuffer()}))}(e,t):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).length;return new Promise((function(n,r){var i={};Number.isInteger(t)&&t>=0&&(i.headers={range:"bytes=0-".concat(t-1)});var o=function(e){return/^https:\/\//.test(e)?require("https").get:require("http").get}(e);o(e,i,(function(e){if(e.statusCode>=200&&e.statusCode<=299){var t=[];e.on("data",(function(e){return t.push(Buffer.from(e))})),e.on("error",(function(e){return r(e)})),e.on("end",(function(){return n(Buffer.concat(t))}))}else r("Could not fetch file: ".concat(e.statusCode," ").concat(e.statusMessage)),e.resume()})).on("error",(function(e){return r(e)}))}))}(e,t):function(e){return/^data:[^;,]*(;base64)?,/.test(e)}(e)?Promise.resolve(function(e){var t=e.substring(e.indexOf(",")+1);if(-1!==e.indexOf(";base64")){if("undefined"!=typeof atob)return Uint8Array.from(atob(t),(function(e){return e.charCodeAt(0)})).buffer;if("undefined"==typeof Buffer)return;return"undefined"!=typeof Buffer.from?Buffer.from(t,"base64"):new Buffer(t,"base64")}var n=decodeURIComponent(t);return"undefined"!=typeof Buffer?"undefined"!=typeof Buffer.from?Buffer.from(n):new Buffer(n):Uint8Array.from(n,(function(e){return e.charCodeAt(0)})).buffer}(e)):function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).length;return new Promise((function(n,r){var i=function(){try{return require("fs")}catch(e){return}}();i.open(e,(function(o,a){o?r(o):i.stat(e,(function(o,u){if(o)r(o);else{var c=Math.min(u.size,void 0!==t?t:u.size),f=Buffer.alloc(c),s={buffer:f,length:c};i.read(a,s,(function(t){t?r(t):i.close(a,(function(t){t&&console.warn("Could not close file ".concat(e,":"),t),n(f)}))}))}}))}))}))}(e,t)}(e,n).then((function(e){return Fi(e,n)}))):function(e){return"undefined"!=typeof File&&e instanceof File}(e)?(n.async=1,(t=e,new Promise((function(e,n){var r=new FileReader;r.onload=function(t){return e(t.target.result)},r.onerror=function(){return n(r.error)},r.readAsArrayBuffer(t)}))).then((function(e){return Fi(e,n)}))):Fi(e,n)}function Fi(e,t){return function(e){try{return Buffer.isBuffer(e)}catch(e){return 0}}(e)&&(e=new Uint8Array(e).buffer),Ri(function(e){try{return new DataView(e)}catch(t){return new i(e)}}(e),t)}function Ri(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{expanded:0,async:0,includeUnknown:0,domParser:void 0},n=t.expanded,r=void 0===n?0:n,i=t.async,o=void 0===i?0:i,a=t.includeUnknown,u=void 0===a?0:a,c=t.domParser,f=void 0===c?void 0:c,d=0,p={},m=[],g=et.parseAppMarkers(e,o),h=g.fileType,y=g.fileDataOffset,S=g.jfifDataOffset,I=g.tiffHeaderOffset,C=g.iptcDataOffset,U=g.xmpChunks,P=g.iccChunks,A=g.mpfDataOffset,w=g.pngHeaderOffset,E=g.pngTextChunks,x=g.pngChunkOffsets,T=g.vp8xChunkOffset,O=g.gifHeaderOffset;if(v.USE_JPEG&&v.USE_FILE&&function(e){return void 0!==e}(y)){d=1;var M=Ht.read(e,y);r?p.file=M:p=l({},p,M)}if(v.USE_JPEG&&v.USE_JFIF&&function(e){return void 0!==e}(S)){d=1;var F=$t.read(e,S);r?p.jfif=F:p=l({},p,F)}if(v.USE_EXIF&&function(e){return void 0!==e}(I)){d=1;var R=Rt.read(e,I,u),k=R.tags,D=R.byteOrder;if(k.Thumbnail&&(p.Thumbnail=k.Thumbnail,delete k.Thumbnail),r?(p.exif=k,function(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=b(e.exif.GPSLatitude.value),"S"===e.exif.GPSLatitudeRef.value.join("")&&(e.gps.Latitude=-e.gps.Latitude)}catch(e){}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=b(e.exif.GPSLongitude.value),"W"===e.exif.GPSLongitudeRef.value.join("")&&(e.gps.Longitude=-e.gps.Longitude)}catch(e){}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],1===e.exif.GPSAltitudeRef.value&&(e.gps.Altitude=-e.gps.Altitude)}catch(e){}}}(p)):p=l({},p,k),v.USE_TIFF&&v.USE_IPTC&&k["IPTC-NAA"]&&!ki(C)){var N=fn.read(k["IPTC-NAA"].value,0,u);r?p.iptc=N:p=l({},p,N)}if(v.USE_TIFF&&v.USE_XMP&&k.ApplicationNotes&&!Di(U)){var L=Tn.read(s(k.ApplicationNotes.value),void 0,f);r?p.xmp=L:(delete L._raw,p=l({},p,L))}if(v.USE_PHOTOSHOP&&k.ImageSourceData){var _=lr.read(k.PhotoshopSettings.value,u);r?p.photoshop=_:p=l({},p,_)}if(v.USE_TIFF&&v.USE_ICC&&k.ICC_Profile&&!Ni(P)){var B=br.read(k.ICC_Profile.value,[{offset:0,length:k.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);r?p.icc=B:p=l({},p,B)}if(v.USE_MAKER_NOTES&&function(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&"Canon"===e.Make.value[0]&&e.MakerNote&&e.MakerNote.__offset}(k)){var G=Rr.read(e,I,k.MakerNote.__offset,D,u);r?p.makerNotes=G:p=l({},p,G)}k.MakerNote&&delete k.MakerNote.__offset}if(v.USE_JPEG&&v.USE_IPTC&&ki(C)){d=1;var j=fn.read(e,C,u);r?p.iptc=j:p=l({},p,j)}if(v.USE_XMP&&Di(U)){d=1;var z=Tn.read(e,U,f);r?p.xmp=z:(delete z._raw,p=l({},p,z))}if((v.USE_JPEG||v.USE_WEBP)&&v.USE_ICC&&Ni(P)){d=1;var V=br.read(e,P,o);V instanceof Promise?m.push(V.then(Q)):Q(V)}if(v.USE_MPF&&function(e){return void 0!==e}(A)){d=1;var H=Lt.read(e,A,u);r?p.mpf=H:p=l({},p,H)}if(v.USE_PNG&&v.USE_PNG_FILE&&void 0!==w){d=1;var W=kr.read(e,w);r?(p.png=p.png?l({},p.png,W):W,p.pngFile=W):p=l({},p,W)}if(v.USE_PNG&&function(e){return void 0!==e}(E)){d=1;var X=Vr.read(e,E,o,u),J=X.readTags,Y=X.readTagsPromise;ee(J),Y&&m.push(Y.then((function(e){return e.forEach(ee)})))}if(v.USE_PNG&&function(e){return void 0!==e}(x)){d=1;var K=ui.read(e,x);r?p.png=p.png?l({},p.png,K):K:p=l({},p,K)}if(v.USE_WEBP&&function(e){return void 0!==e}(T)){d=1;var q=mi.read(e,T);r?p.riff=p.riff?l({},p.riff,q):q:p=l({},p,q)}if(v.USE_GIF&&function(e){return void 0!==e}(O)){d=1;var $=yi.read(e,O);r?p.gif=p.gif?l({},p.gif,$):$:p=l({},p,$)}var Z=(v.USE_JPEG||v.USE_WEBP)&&v.USE_EXIF&&v.USE_THUMBNAIL&&wi.get(e,p.Thumbnail,I);if(Z?(d=1,p.Thumbnail=Z):delete p.Thumbnail,h&&(r?(p.file||(p.file={}),p.file.FileType=h):p.FileType=h,d=1),!d)throw new xi.MetadataMissingError;return o?Promise.all(m).then((function(){return p})):p;function Q(e){r?p.icc=e:p=l({},p,e)}function ee(e){if(r){for(var t=0,n=["exif","iptc"];t<n.length;t++){var i=n[t],o="__".concat(i);e[o]&&(p[i]=p[i]?l({},p.exif,e[o]):e[o],delete e[o])}p.png=p.png?l({},p.png,e):e,p.pngText=p.pngText?l({},p.png,e):e}else delete(p=l({},p,e.__exif?e.__exif:{},e.__iptc?e.__iptc:{},e)).__exif,delete p.__iptc}}function ki(e){return void 0!==e}function Di(e){return Array.isArray(e)&&e.length>0}function Ni(e){return Array.isArray(e)&&e.length>0}return t}()}));
2
2
  //# sourceMappingURL=exif-reader.js.map