@etu-wiki/sharp-iiif-shims 0.1.13 → 0.1.16
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/dist/index.mjs +1 -1
- package/package.json +4 -5
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import R from"sharp";var p="[1-9][0-9]*",V="[0-9]*",C="(?=.*[1-9])\\d+(\\.\\d+)?",N="\\d+(\\.\\d+)?",X={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",tif:"image/tiff",tiff:"image/tiff",gif:"image/gif",jp2:"image/jp2",pdf:"application/pdf"},A={version:["1.0","1.1","2.0","2.1","3.0"],level:["0","1","2"],region:["full","square",`${V},${V},${p},${p}`,`pct:${N},${N},${C},${C}`],rotation:`!?${N}`,quality:["color","gray","bitonal","default","native","grey"],format:["jpg","png","webp","tif","gif","jp2","pdf"],size:["^full$",`^${p},$`,`^,${p}$`,`^pct:${C}$`,`^${p},${p}$`,`^!${p},${p}$`,"^max$","^\\^max$",`^\\^${p},$`,`^\\^,${p}$`,`^\\^pct:${C}$`,`^\\^${p},${p}$`,`^\\^!${p},${p}$`]},j=/^pct:([\d,]+)/,tt=class{constructor(r,e,t,o,i,s){this.level=r,this.maxArea=e,this.maxWidth=t,this.maxHeight=o,this.tileWidth=i,this.tileHeight=s,this.validate("level",r)}validate(r,e){let t=A[r];if(t instanceof Array&&(t=t.join("|")),!new RegExp("^("+t+")$").test(e))throw Error(`invalid IIIF url ${r}: ${e}`);return!0}normalizeRegionParams(r,e){if(this.validate("region",r),r==="full")return null;if(r==="square")return this._regionSquare(e);if(j.test(r))return this._regionPct(r.match(j)[1],e);{let t=r.split(",").map(o=>Number(o));return this._regionXYWH(t,e)}}_regionSquare(r){let e,t,o=r.width,i=r.height;if(o!==i){let s=Math.min(o,i),n=Math.abs(Math.floor((o-i)/2));return o>i?(e=n,t=0):(e=0,t=n),this._regionXYWH([e,t,s,s],r)}return null}_regionPct(r,e){let t=r.split(",").map((o,i)=>{let s=Number(o)/100;return i===0||i===2?Math.ceil(e.width*s):i===1||i===3?Math.ceil(e.height*s):null});return this._regionXYWH(t,e)}_regionXYWH(r,e){let t=e.width,o=e.height,[i,s,n,a]=r;if(i+n>t&&(n=t-i),s+a>o&&(a=o-s),n<=0)throw Error(`invalid IIIF width ${n}`);if(a<=0)throw Error(`invalid IIIF height ${a}`);return{x:i,y:s,w:n,h:a}}normalizeSizeParams(r,e){let t=r,o=e.width,i=e.height;if(!e||!o&&!i)throw Error(`invalid region dimensions: ${JSON.stringify(e,null,2)}`);this.validate("size",t);let s=!1;t.charAt(0)==="^"&&(s=!0,t=t.substring(1));let n=null;if(t==="full"||(t==="max"?n=this._sizeMaxScale(e):j.test(t)?n=this._sizePctScale(t.match(j)[1]):t.charAt(0)==="!"&&(t=t.substring(1),n=this._sizeBangScale(t,s,e)),n===1))return null;if(n){let a=Math.ceil(o*n),l=Math.ceil(i*n);return this._sizeWH(`${a},${l}`,s,e)}else return this._sizeWH(t,s,e)}_sizeBangScale(r,e,t){let o=t.width,i=t.height,[s,n]=r.split(",").map(l=>l===""?null:Number(l)),a=Math.min(s/o,n/i);if(s>o&&n>i&&!e)throw Error("should not upscale without ^");return a}_sizeMaxScale(r){let e=r.width,t=r.height,o=1;return this.maxArea&&this.maxArea<e*t&&(o=Math.sqrt(this.maxArea/(e*t))),this.maxWidth&&this.maxWidth<e&&(o=Math.min(o,this.maxWidth/e)),this.maxHeight&&this.maxHeight<t&&(o=Math.min(o,this.maxHeight/t)),o}_sizePctScale(r){return Number(r)/100}_sizeWH(r,e,t){let o=t.width,i=t.height,[s,n]=r.split(",").map(a=>a===""?null:Number(a));if(s?n||(n=Math.ceil(i*s/o),n=n===0?1:n):(s=Math.ceil(o*n/i),s=s===0?1:s),(s>o||n>i)&&!e)throw Error("should not upscale without ^");return{width:s,height:n}}normalizeRotationParams(r){this.validate("rotation",r);let e=!1;if(r==="0")return null;r[0]==="!"&&(e=!0);let t=Number(r.replace(/^!/,""));return{isMirror:e,degree:t}}normalizeQualityParams(r){return this.validate("quality",r),r==="native"||r==="default"?null:r}normalizeFormatParams(r,e){this.validate("format",r);let t=X[r],o=X[e];return t===o?null:r}getContentType(r){return X[r]}generateImageInfoTemp(r,e,t){this.validate("version",t);let o={},i={};return o.info=i,t==="1.0"?(i.identifier=r,i.width=e.width,i.height=e.height,i.scale_factors=this.factors(e),i.tile_width=this.tileWidth,i.tile_height=this.tileHeight,i.formats=A.format,i.qualities=A.quality,i.profile=this.uriPattern("compliance",t),o.contentType="application/json",o.body=JSON.stringify(i)):(t==="1.1"?(i["@context"]=this.uriPattern("context",t),i["@id"]=r,i.width=e.width,i.height=e.height,i.scale_factors=this.factors(e),i.tile_width=this.tileWidth,i.tile_height=this.tileHeight,i.formats=A.format,i.qualities=A.quality,i.profile=this.uriPattern("compliance",t)):t==="2.0"||t==="2.1"?(i["@context"]=this.uriPattern("context",t),i["@id"]=r,i.protocol="http://iiif.io/api/image",i.width=e.width,i.height=e.height,this.level==="0"?i.sizes=this.sizes(e):i.tiles=[{scaleFactors:this.factors(e),width:this.tileWidth,height:this.tileHeight}],i.profile=[this.uriPattern("compliance",t)]):t==="3.0"&&(i["@context"]=[this.uriPattern("context",t)],i.id=r,i.type="ImageService3",i.protocol="http://iiif.io/api/image",i.width=e.width,i.height=e.height,this.level==="0"?i.sizes=this.sizes(e):i.tiles=[{scaleFactors:this.factors(e),width:this.tileWidth,height:this.tileHeight}],i.profile=this.uriPattern("compliance",t)),o.contentType="application/ld+json"),o}factors(r){let e=1,t=[];for(;this.tileWidth*e<=r.width||this.tileHeight*e<=r.height;)t.push(e),e*=2;return t.length===0&&t.push(1),t}uriPattern(r,e){let t="",o="";return e==="1.0"?t=`http://library.stanford.edu/iiif/image-api/compliance.html#level${this.level}`:e==="1.1"?(t=`http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level${this.level}`,o="http://library.stanford.edu/iiif/image-api/1.1/context.json"):e==="2.0"||e==="2.1"?(t=`http://iiif.io/api/image/2/level${this.level}.json`,o="http://iiif.io/api/image/2/context.json"):e==="3.0"&&(t=`level${this.level}`,o="http://iiif.io/api/image/3/context.json"),r==="compliance"?t:r==="context"?o:""}sizes(r){return[{width:r.width,height:r.height}]}};import{addDecoder as nt,BaseDecoder as at,fromCustomClient as et,fromUrl as lt,BaseClient as it,BaseResponse as ot}from"geotiff";var ht=1e8,ct=1e4,gt=1e4,ut=512,ft=512,pt={2:["baseUriRedirect","canonicalLinkHeader","cors","jsonldMediaType","mirroring","profileLinkHeader","regionByPct","regionByPx","rotationArbitrary","rotationBy90s","sizeAboveFull","sizeByWhListed","sizeByForcedWh","sizeByH","sizeByPct","sizeByW","sizeByWh"],2.1:["baseUriRedirect","canonicalLinkHeader","cors","jsonldMediaType","mirroring","profileLinkHeader","regionByPct","regionByPx","regionSquare","rotationArbitrary","rotationBy90s","sizeAboveFull","sizeByConfinedWh","sizeByDistortedWh","sizeByH","sizeByPct","sizeByW","sizeByWh","sizeByWhListed","sizeByForcedWh"],3:["baseUriRedirect","canonicalLinkHeader","cors","jsonldMediaType","mirroring","profileLinkHeader","regionByPct","regionByPx","regionSquare","rotationArbitrary","rotationBy90s","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh","sizeUpscaling"]},G=class extends at{async decode(e,t){let o=Array.isArray(e.BitsPerSample)?e.BitsPerSample.length:e.SamplesPerPixel||4,i=R(t,{sequentialRead:!0}),n=(await i.metadata()).channels||4;o===4&&n<4&&i.ensureAlpha?i=i.ensureAlpha():o===3&&n>3&&i.removeAlpha&&(i=i.removeAlpha());let{data:a,info:l}=await i.raw().toBuffer({resolveWithObject:!0});if(l.channels!==o){let m=l.width*l.height,z=Buffer.alloc(m*o),g=a;for(let h=0;h<m;h+=1){let f=h*l.channels,d=h*o;for(let c=0;c<o;c+=1)c<l.channels?z[d+c]=g[f+c]:z[d+c]=c===3?255:0}return z.buffer.slice(z.byteOffset,z.byteOffset+z.byteLength)}return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}};nt(50001,()=>Promise.resolve(G));var U=class extends ot{constructor(e){super(),this.result=e}get ok(){return this.result.res.status>=200&&this.result.res.status<300}get status(){return this.result.res.status}getHeader(e){return this.result.res.headers[e.toLowerCase()]}getData(){return Buffer.isBuffer(this.result.content)?this.result.content.buffer.slice(this.result.content.byteOffset,this.result.content.byteOffset+this.result.content.byteLength):this.result.content}},Y=class extends it{constructor(e,t){super(e),this.objectKey=e,this.ossClient=t}async request({headers:e={}}={}){let t=await this.ossClient.get(this.objectKey,{headers:e,timeout:3e4});return new U(t)}};async function mt(r,e){let t=new Y(r,e);return et(t)}var O=new Map,Q=class extends ot{constructor(e,t){super(),this.response=e,this.arrayBuffer=t}get ok(){return this.response.ok}get status(){return this.response.status}getHeader(e){return this.response.headers.get(e)||""}getData(){return this.arrayBuffer}},J=class extends it{constructor(e,t){super(e),this.ipfsUrl=e,this.verifiedFetch=t}extractCID(e){let t=e.match(/(?:ipfs:\/\/|\/ipfs\/)([a-zA-Z0-9]+)/);return t?t[1]:null}async request({headers:e={}}={}){console.log(e);let t=6e4,o=new AbortController,i=setTimeout(()=>{console.log("[IPFSClient] Request timeout, aborting..."),o.abort()},t);try{let s={headers:e,signal:o.signal,session:!1},n=await this.verifiedFetch(this.ipfsUrl,s);if(!n.ok)throw new Error(`Failed to fetch from IPFS: ${n.status} ${n.statusText}`);let a=await n.arrayBuffer();return clearTimeout(i),new Q(n,a)}catch(s){throw clearTimeout(i),console.error("[IPFSClient] Error during request:",s),s instanceof Error&&(console.error("[IPFSClient] Error name:",s.name),console.error("[IPFSClient] Error message:",s.message),console.error("[IPFSClient] Error stack:",s.stack)),s&&typeof s=="object"&&"errors"in s&&console.error("[IPFSClient] AggregateError details:",s.errors),s}}};async function dt(r,e){let t=O.get(r);if(t)return t instanceof Promise?(console.log(`[fromIPFS] Waiting for in-flight GeoTIFF creation for ${r}`),await t):(console.log(`[fromIPFS] Using cached GeoTIFF client for ${r}`),t);console.log(`[fromIPFS] Creating new GeoTIFF client for ${r}`);let o=(async()=>{let i=new J(r,e),s=await et(i);return O.set(r,s),s})();O.set(r,o);try{return await o}catch(i){throw O.delete(r),i}}var K=class extends tt{constructor(e,t=ht,o=ct,i=gt,s=ut,n=ft){super(e,t,o,i,s,n)}regionImpl(e,t){e&&(t=t.extract({left:e.x,top:e.y,width:e.w,height:e.h}))}sizeImpl(e,t){e&&(t=t.resize({...e,fit:"fill"}))}rotationImpl(e,t){e&&(e.isMirror&&(t=t.flop()),t=t.rotate(e.degree))}qualityFormatImpl(e,t,o,i,s){e&&(e==="color"?o=o.toColorspace("srgb"):e==="gray"||e==="grey"?o=o.grayscale():e==="bitonal"&&(o=o.threshold())),t&&(o=o.toFormat(t)),i==="png"&&(s.paletteBitDepth===1||s.space==="b-w")&&(o=o.toColorspace("b-w").png({colors:2}))}async generateImageTile(e,t,o){let i=e.split("/"),s=i.pop(),n=s.split(".")[0],a=s.split(".")[1],l=i.pop(),m=i.pop(),z=i.pop(),g=i.pop(),h={width:t.width,height:t.height},f=super.normalizeRegionParams(z,h),d=super.normalizeSizeParams(m,{width:f?f.w:h.width,height:f?f.h:h.height}),{x:c,y:x,w:v,h:$}=f??{x:0,y:0,w:h.width,h:h.height},{width:B,height:H}=d;console.log(`Attempting to fetch from URL: ${o}`);let I;if(typeof o=="string")console.log("Using standard HTTP fetch"),I=await lt(o);else if(typeof g=="string"&&g.startsWith("bafy")){console.log("Detected CID id, using fromIPFS");let S=`ipfs://${g}`;I=await dt(S,o)}else I=await mt(g,o);let u=await I.getImage(0);console.log(`Source dimensions: ${u.getWidth()} x ${u.getHeight()}`),console.log(`Extracting region: x=${c}, y=${x}, w=${v}, h=${$}`),console.log(`Output size: ${B} x ${H}`);let w=await I.getImageCount();console.log(`Total images (including overviews): ${w}`);let q=u.getSamplesPerPixel(),b;q>=3?(b=[0,1,2],q>=4&&b.push(3)):b=[0],console.log("Using automatic overview selection based on resolution...");let E=Math.max(v/B,$/H),F=u,W=1;for(let S=0;S<w;S++){let _=await I.getImage(S),D=u.getWidth()/_.getWidth();D<=E&&D>W&&(W=D,F=_)}console.log(`Selected overview with scale: ${W.toFixed(2)}x`),console.log(`Overview dimensions: ${F.getWidth()} x ${F.getHeight()}`);let M=[Math.floor(c/W),Math.floor(x/W),Math.floor((c+v)/W),Math.floor((x+$)/W)],y;try{y=await F.readRasters({window:M,width:B,height:H,samples:b,interleave:!0,resampleMethod:"bilinear"})}catch(S){console.log(`Failed to read from overview, falling back to main image: ${S}`);let _=[c,x,c+v,x+$];y=await u.readRasters({window:_,width:B,height:H,samples:b,interleave:!0,resampleMethod:"bilinear"})}let P=b.length,L=Buffer.from(y.buffer,y.byteOffset,y.byteLength),T=R(L,{raw:{width:B,height:H,channels:P}}),rt=super.normalizeRotationParams(l);this.rotationImpl(rt,T);let st=super.normalizeQualityParams(n),Z=super.normalizeFormatParams(a,t.format);this.qualityFormatImpl(st,Z,T,a,t);let k={};return k.body=T,k.contentType=super.getContentType(Z),k}iiifTransform(e,t){let o=t.isHDImage?R({limitInputPixels:!1,sequentialRead:!0}):R(),i=e.split("/"),s=i.pop(),n=s.split(".")[0],a=s.split(".")[1],l=i.pop(),m=i.pop(),z=i.pop(),g=!1,h=o,f={width:t.width,height:t.height};t&&t.orientation&&(g=!0,h=h.rotate(),t.orientation>=5&&(f={width:t.height,height:t.width}));let d=super.normalizeRegionParams(z,f);this.regionImpl(d,h);let c=super.normalizeSizeParams(m,{width:d?d.w:f.width,height:d?d.h:f.height});this.sizeImpl(c,h);let x=super.normalizeRotationParams(l);this.rotationImpl(x,h);let v=super.normalizeQualityParams(n),$=super.normalizeFormatParams(a,t.format);return this.qualityFormatImpl(v,$,h,a,t),d||c||x||v||$||g?h:(console.log("skip iiif transform"),null)}async generateIiifImage(e,t,o){let i=e.split("/"),s=i.pop(),n=s.split(".")[0],a=s.split(".")[1],l=i.pop(),m=i.pop(),z=i.pop(),g=super.normalizeRegionParams(z,o),h=super.normalizeSizeParams(m,{width:g?g.w:o.width,height:g?g.h:o.height}),f=super.normalizeRotationParams(l),d=super.normalizeQualityParams(n),c=super.normalizeFormatParams(a,o.format),{x,y:v,w:$,h:B}=g||{x:0,y:0,w:o.width,h:o.height},{width:H,height:I}=h||{width:o.width,height:o.height},u=0,w;if(o.pages&&o.pages>1){let b=H/$,E=I/B,F=Math.max(b,E);if(F>=.95)console.log("Pyramid optimization: using full resolution page (scale \u2248 1.0)"),u=0;else{u=o.pages-1;let M=Math.pow(2,o.pages-1),y=o.width/M,P=o.height/M;for(;u>0;){let L=$*(y/o.width),T=B*(P/o.height);if(L>=H*1.1&&T>=I*1.1)break;u--,y*=2,P*=2}console.log(`Pyramid optimization: selected page ${u}/${o.pages-1} (scale: ${F.toFixed(2)}x, target: ${H}x${I})`)}let W=o.isHDImage?{limitInputPixels:!1,page:u,sequentialRead:!0,failOn:"none"}:{page:u,sequentialRead:!0,failOn:"none"};if(w=R(t,W),g&&u>0){let M=await w.metadata(),y=M.width/o.width,P={x:Math.floor(x*y),y:Math.floor(v*y),w:Math.floor($*y),h:Math.floor(B*y)};P.w=Math.min(P.w,M.width-P.x),P.h=Math.min(P.h,M.height-P.y),this.regionImpl(P,w)}else this.regionImpl(g,w)}else{let b=o.isHDImage?{limitInputPixels:!1,sequentialRead:!0,failOn:"none"}:{sequentialRead:!0,failOn:"none"};w=R(t,b),this.regionImpl(g,w)}this.sizeImpl(h,w),this.rotationImpl(f,w),this.qualityFormatImpl(d,c,w,a,o);let q={};return q.body=w,q.contentType=super.getContentType(c),q}generateImageInfo(e,t,o="",i){let s=this.level,n={width:t.width,height:t.height};t&&t.orientation&&t.orientation>=5&&(console.log(t.orientation),n={width:t.height,height:t.width});let a=super.generateImageInfoTemp(e,n,i),l=a.info;if((i==="2.0"||i==="2.1")&&(l.profile=[super.uriPattern("compliance",i)],s==="2")){let m={};m.formats=["jpg","png","webp","jp2","pdf","tif"],m.qualities=["color","gray","bitonal","default","native","grey"],m.supports=pt[Number(i)],l.profile.push(m)}return i==="3.0"&&o&&(l.extraFormats=[o],l.preferredFormats=[o]),o&&(l.formats=[o]),a}};export{K as default};
|
|
1
|
+
const a0_0x5f4036=a0_0x3274;(function(_0x56c713,_0xb9becc){const _0x4177c2=a0_0x3274,_0x19dcb7=_0x56c713();while(!![]){try{const _0x2a5542=-parseInt(_0x4177c2(0x23e))/0x1+-parseInt(_0x4177c2(0x1d5))/0x2*(parseInt(_0x4177c2(0x170))/0x3)+parseInt(_0x4177c2(0x18a))/0x4*(parseInt(_0x4177c2(0x11c))/0x5)+parseInt(_0x4177c2(0x195))/0x6+-parseInt(_0x4177c2(0x179))/0x7*(parseInt(_0x4177c2(0x142))/0x8)+-parseInt(_0x4177c2(0x1e8))/0x9*(-parseInt(_0x4177c2(0x1f3))/0xa)+parseInt(_0x4177c2(0x118))/0xb;if(_0x2a5542===_0xb9becc)break;else _0x19dcb7['push'](_0x19dcb7['shift']());}catch(_0x1a2399){_0x19dcb7['push'](_0x19dcb7['shift']());}}}(a0_0x35bb,0x743e4));import a0_0x4e4605 from'sharp';import a0_0x40b134 from'@etu-wiki/iiif-image-shims';function a0_0x3274(_0x41f43b,_0x12acd4){const _0x35bbaf=a0_0x35bb();return a0_0x3274=function(_0x327469,_0x17e0c9){_0x327469=_0x327469-0x101;let _0x475cd0=_0x35bbaf[_0x327469];return _0x475cd0;},a0_0x3274(_0x41f43b,_0x12acd4);}import{addDecoder,BaseDecoder,fromCustomClient,fromUrl,BaseClient,BaseResponse}from'geotiff';const MAX_AREA=0x5f5e100,MAX_WIDTH=0x2710,MAX_HEIGHT=0x2710,SUPPORTS={0x2:[a0_0x5f4036(0x20c),a0_0x5f4036(0x130),a0_0x5f4036(0x1f2),a0_0x5f4036(0x122),a0_0x5f4036(0x1fe),a0_0x5f4036(0x1c9),a0_0x5f4036(0x12e),a0_0x5f4036(0x16a),'rotationArbitrary',a0_0x5f4036(0x12f),a0_0x5f4036(0x114),a0_0x5f4036(0x200),a0_0x5f4036(0x137),a0_0x5f4036(0x20f),a0_0x5f4036(0x1bb),a0_0x5f4036(0x112),a0_0x5f4036(0x101)],2.1:[a0_0x5f4036(0x20c),'canonicalLinkHeader',a0_0x5f4036(0x1f2),a0_0x5f4036(0x122),a0_0x5f4036(0x1fe),a0_0x5f4036(0x1c9),a0_0x5f4036(0x12e),a0_0x5f4036(0x16a),a0_0x5f4036(0x1d3),a0_0x5f4036(0x213),a0_0x5f4036(0x12f),a0_0x5f4036(0x114),a0_0x5f4036(0x1ed),'sizeByDistortedWh',a0_0x5f4036(0x20f),a0_0x5f4036(0x1bb),'sizeByW',a0_0x5f4036(0x101),a0_0x5f4036(0x200),a0_0x5f4036(0x137)],0x3:['baseUriRedirect','canonicalLinkHeader','cors','jsonldMediaType',a0_0x5f4036(0x1fe),a0_0x5f4036(0x1c9),a0_0x5f4036(0x12e),a0_0x5f4036(0x16a),a0_0x5f4036(0x1d3),a0_0x5f4036(0x213),a0_0x5f4036(0x12f),a0_0x5f4036(0x1ed),'sizeByH',a0_0x5f4036(0x1bb),a0_0x5f4036(0x112),a0_0x5f4036(0x101),a0_0x5f4036(0x1d4)]};class SharpWebImageDecoder extends BaseDecoder{async[a0_0x5f4036(0x10d)](_0x522e95,_0x34d980){const _0x2ea2be=a0_0x5f4036,_0x2ed795={'xEVBi':function(_0xd7a15a,_0x152835){return _0xd7a15a===_0x152835;},'tOZbv':function(_0x6abcc5,_0x198f35){return _0x6abcc5>_0x198f35;},'AiBBZ':function(_0x36c136,_0x542d54){return _0x36c136!==_0x542d54;},'qrUQm':_0x2ea2be(0x1cb),'xMEmG':_0x2ea2be(0x23a),'ZWxya':function(_0x582f32,_0x2b23cf){return _0x582f32*_0x2b23cf;},'sVCiS':function(_0x482937,_0x42caa0){return _0x482937*_0x42caa0;},'jjiLX':function(_0x553584,_0x1eff37){return _0x553584<_0x1eff37;},'sTfLH':function(_0x42533e,_0x447365){return _0x42533e!==_0x447365;},'MljNB':'TKdJy','QOjJq':function(_0x29217d,_0x41ca49){return _0x29217d+_0x41ca49;},'rpRIp':function(_0x43db36,_0x156c19){return _0x43db36+_0x156c19;},'ivbkH':_0x2ea2be(0x15c),'OEBno':_0x2ea2be(0x1b0),'mUwTg':function(_0x584ad9,_0x468e01){return _0x584ad9===_0x468e01;},'Znrnt':function(_0x511c9b,_0xdc4f11){return _0x511c9b+_0xdc4f11;}},_0x3697be=Array[_0x2ea2be(0x1b9)](_0x522e95[_0x2ea2be(0x1e7)])?_0x522e95[_0x2ea2be(0x1e7)][_0x2ea2be(0x196)]:_0x522e95[_0x2ea2be(0x1c0)]||0x4;let _0x1efa84=a0_0x4e4605(_0x34d980,{'sequentialRead':!![]});const _0x3223da=await _0x1efa84[_0x2ea2be(0x1da)](),_0x1ec061=_0x3223da['channels']||0x4;if(_0x2ed795[_0x2ea2be(0x209)](_0x3697be,0x4)&&_0x1ec061<0x4&&_0x1efa84[_0x2ea2be(0x219)])_0x1efa84=_0x1efa84[_0x2ea2be(0x219)]();else _0x3697be===0x3&&_0x2ed795['tOZbv'](_0x1ec061,0x3)&&_0x1efa84[_0x2ea2be(0x15e)]&&(_0x2ed795[_0x2ea2be(0x1ee)](_0x2ed795['qrUQm'],_0x2ed795['xMEmG'])?_0x1efa84=_0x1efa84[_0x2ea2be(0x15e)]():_0x401861=_0x3599cb['extract']({'left':_0x5a2655['x'],'top':_0x3d299c['y'],'width':_0x4875af['w'],'height':_0x1bcbd7['h']}));const {data:_0x19417c,info:_0x434def}=await _0x1efa84[_0x2ea2be(0x158)]()[_0x2ea2be(0x218)]({'resolveWithObject':!![]});if(_0x2ed795[_0x2ea2be(0x1ee)](_0x434def[_0x2ea2be(0x164)],_0x3697be)){const _0x34b7a6=_0x434def[_0x2ea2be(0x12b)]*_0x434def[_0x2ea2be(0x23c)],_0x3659b0=Buffer['alloc'](_0x2ed795[_0x2ea2be(0x194)](_0x34b7a6,_0x3697be)),_0x14cd78=_0x19417c;for(let _0x3d21df=0x0;_0x3d21df<_0x34b7a6;_0x3d21df+=0x1){const _0x448de2=_0x2ed795[_0x2ea2be(0x194)](_0x3d21df,_0x434def[_0x2ea2be(0x164)]),_0x41130e=_0x2ed795[_0x2ea2be(0x1a2)](_0x3d21df,_0x3697be);for(let _0x2e5714=0x0;_0x2ed795[_0x2ea2be(0x216)](_0x2e5714,_0x3697be);_0x2e5714+=0x1){if(_0x2ed795[_0x2ea2be(0x173)](_0x2ed795[_0x2ea2be(0x20d)],_0x2ed795[_0x2ea2be(0x20d)]))return this[_0x2ea2be(0x127)][_0x2ea2be(0x123)][_0x2ea2be(0x234)];else _0x2ed795[_0x2ea2be(0x216)](_0x2e5714,_0x434def[_0x2ea2be(0x164)])?_0x3659b0[_0x2ed795['QOjJq'](_0x41130e,_0x2e5714)]=_0x14cd78[_0x2ed795['rpRIp'](_0x448de2,_0x2e5714)]:_0x2ed795['ivbkH']===_0x2ed795[_0x2ea2be(0x188)]?_0x4c45bf=_0x32bb5c[_0x2ea2be(0x13b)]():_0x3659b0[_0x2ed795['rpRIp'](_0x41130e,_0x2e5714)]=_0x2ed795[_0x2ea2be(0x19b)](_0x2e5714,0x3)?0xff:0x0;}}return _0x3659b0[_0x2ea2be(0x1a5)][_0x2ea2be(0x15a)](_0x3659b0[_0x2ea2be(0x1b6)],_0x3659b0['byteOffset']+_0x3659b0[_0x2ea2be(0x1ce)]);}return _0x19417c[_0x2ea2be(0x1a5)][_0x2ea2be(0x15a)](_0x19417c['byteOffset'],_0x2ed795[_0x2ea2be(0x1c7)](_0x19417c[_0x2ea2be(0x1b6)],_0x19417c[_0x2ea2be(0x1ce)]));}}addDecoder(0xc351,()=>Promise['resolve'](SharpWebImageDecoder));class OSSResponse extends BaseResponse{constructor(_0x17c878){const _0x423ad6=a0_0x5f4036;super(),this[_0x423ad6(0x127)]=_0x17c878;}get['ok'](){const _0x354a85=a0_0x5f4036,_0x1c18a4={'GkipZ':function(_0x378df7,_0x85e288){return _0x378df7>=_0x85e288;},'dwxxU':function(_0x1bd5ff,_0x3e54cc){return _0x1bd5ff<_0x3e54cc;}};return _0x1c18a4[_0x354a85(0x131)](this[_0x354a85(0x127)][_0x354a85(0x123)]['status'],0xc8)&&_0x1c18a4[_0x354a85(0x191)](this[_0x354a85(0x127)][_0x354a85(0x123)][_0x354a85(0x234)],0x12c);}get[a0_0x5f4036(0x234)](){const _0x243f6c=a0_0x5f4036;return this['result'][_0x243f6c(0x123)][_0x243f6c(0x234)];}[a0_0x5f4036(0x133)](_0xbaa71d){const _0x2876fe=a0_0x5f4036;return this['result'][_0x2876fe(0x123)][_0x2876fe(0x19e)][_0xbaa71d[_0x2876fe(0x17c)]()];}['getData'](){const _0x3a47c0=a0_0x5f4036,_0x43a1e5={'tDzPm':function(_0x43ed3f,_0x392873){return _0x43ed3f!==_0x392873;},'UBtDC':_0x3a47c0(0x1c1),'sbLuh':function(_0x213a30,_0x34a064){return _0x213a30+_0x34a064;}};if(Buffer['isBuffer'](this[_0x3a47c0(0x127)]['content'])){if(_0x43a1e5[_0x3a47c0(0x12a)](_0x3a47c0(0x1c1),_0x43a1e5['UBtDC']))_0xc82fe0=_0x424c12[_0x3a47c0(0x223)]('b-w')[_0x3a47c0(0x1d0)]({'colors':0x2});else return this[_0x3a47c0(0x127)]['content'][_0x3a47c0(0x1a5)]['slice'](this['result'][_0x3a47c0(0x1ab)][_0x3a47c0(0x1b6)],_0x43a1e5[_0x3a47c0(0x17d)](this['result']['content'][_0x3a47c0(0x1b6)],this[_0x3a47c0(0x127)][_0x3a47c0(0x1ab)]['byteLength']));}return this['result'][_0x3a47c0(0x1ab)];}}class OSSClient extends BaseClient{constructor(_0x5b2fa5,_0x3548b7){const _0x276ee2=a0_0x5f4036;super(_0x5b2fa5),this[_0x276ee2(0x222)]=_0x5b2fa5,this[_0x276ee2(0x150)]=_0x3548b7;}async[a0_0x5f4036(0x1ae)]({headers:headers={}}={}){const _0x2ba126=a0_0x5f4036,_0x50fad7=await this['ossClient'][_0x2ba126(0x13a)](this['objectKey'],{'headers':headers,'timeout':0x7530});return new OSSResponse(_0x50fad7);}}async function fromOSS(_0x1ae075,_0x226f1d){const _0x309ab8=a0_0x5f4036,_0x2882a7={'QuSiZ':function(_0x25e430,_0x27d304){return _0x25e430(_0x27d304);}},_0x6feed1=new OSSClient(_0x1ae075,_0x226f1d);return _0x2882a7[_0x309ab8(0x225)](fromCustomClient,_0x6feed1);}const geotiffCache=new Map();class IPFSResponse extends BaseResponse{constructor(_0x31b51c,_0x16dbe){const _0x2de4c7=a0_0x5f4036;super(),this[_0x2de4c7(0x1f6)]=_0x31b51c,this[_0x2de4c7(0x167)]=_0x16dbe;}get['ok'](){return this['response']['ok'];}get[a0_0x5f4036(0x234)](){return this['response']['status'];}[a0_0x5f4036(0x133)](_0x413244){const _0x386ff1=a0_0x5f4036;return this[_0x386ff1(0x1f6)][_0x386ff1(0x19e)][_0x386ff1(0x13a)](_0x413244)||'';}[a0_0x5f4036(0x171)](){const _0x123f11=a0_0x5f4036;return this[_0x123f11(0x167)];}}function a0_0x35bb(){const _0x43c717=['mUqzk','XWWDq','zCUSo','EUrvr','hNXPR','height','startsWith','741201uEviZN','statusText','bkORf','sizeByWh','gray','XiUen','jGtIx','YVBFn','bilinear','isMirror','SrLHT','is_hd','TJXHk','contentType','VlosN','decode','Source\x20dimensions:\x20','push','hXKeB','[IPFSClient]\x20AggregateError\x20details:','sizeByW','PFfBm','sizeAboveFull','laoLi','BTtAb','[IPFSClient]\x20Request\x20timeout,\x20aborting...','1572417wlDiiW','name','toFormat','set','4415sBxCHi','generateTileLocal','grayscale','cAFWu','odqfo','qifKi','jsonldMediaType','res','kulIh','none','Detected\x20CID\x20id,\x20using\x20fromIPFS','result','HIfnK','OydNh','tDzPm','width','rotationImpl','BNyUx','regionByPct','rotationBy90s','canonicalLinkHeader','GkipZ','split','getHeader','Total\x20images\x20(including\x20overviews):\x20','format','ayjXU','sizeByForcedWh','Attempting\x20to\x20fetch\x20from\x20URL:\x20','log','get','flop','HetJL','uriPattern','iUiMb','Failed\x20to\x20fetch\x20from\x20IPFS:\x20','QIiUj','oluSv','568tPSTig','eSeLF','pdf','qWUZZ','stack','regionImpl','theLi','min','qkSlZ','QfBzV','YYuBS','DIHcr','errors','Rynqd','ossClient','toFixed','cAfWS','fill','Kyqtl','BcrEF','jp2','getImage','raw','xrQpy','slice','UvrrY','RpBYU','snApL','removeAlpha','Using\x20standard\x20HTTP\x20fetch','mhVjA','normalizeRegionParams','jpg','rotate','channels','BrnBa','extractCID','arrayBuffer','SBlYH','pFXqc','regionByPx','vvKkn','ugPbi','CzEAy','bitonal','LSryK','3357KZtThT','getData','formats','sTfLH','udnVV','pages','webp','normalizeQualityParams','Glcis','48699oJTFQU','lrWTT','[IPFSClient]\x20Error\x20message:','toLowerCase','sbLuh','ipfsUrl','nLMfo','floor','[IPFSClient]\x20Error\x20name:','b-w','preferredFormats','WpevA',',\x20w=','dlPvu','GzXBN','OEBno','x,\x20target:\x20','2140cdQPXZ','getWidth','verifiedFetch','Lryxi','Overview\x20dimensions:\x20','pMKZC','bwsKk','dwxxU','hYIxC','normalizeRotationParams','ZWxya','2470890tHgrHA','length','getSamplesPerPixel','uivgu','supports','normalizeSizeParams','mUwTg','DkTMF','extract','headers','limitInputPixels','vfyjt','NWvJh','sVCiS','PcDBV','rpgqG','buffer','from','2.1','EXTsQ','hpZlm','gMYSa','content','generateTileRemote','HIbZS','request','generateTilePipeline','pAZkN','nOSgT','PWRjr','VnrEm','qualityFormatImpl','lrRFl','byteOffset','cHyTR','bMjCA','isArray','ipUqi','sizeByPct','MvjyG','pow','string','ANdRy','SamplesPerPixel','JXQdz','message','nXdso','match','pop','skip\x20iiif\x20transform','Znrnt','getHeight','profileLinkHeader','ahZir','XAuOQ','xrnyU','MWHes','byteLength','qYovL','png','nqSra','generateImageInfo','regionSquare','sizeUpscaling','364qgbekz','sizeImpl','gPqie','FHhnu','2.0','metadata','ipfs://','paletteBitDepth','error','jBvDm','object','extraFormats','native','wkyzr','Selected\x20overview\x20with\x20scale:\x20','info','profile','Fdhmv','BitsPerSample','28233AgIGmi','body','sKUzH','rNRfA','KQWxA','sizeByConfinedWh','AiBBZ','Pyramid\x20optimization:\x20selected\x20page\x20','\x20(scale:\x20','tif','cors','2830MbivEt','degree','grey','response','SoRnK','color','hnMKn','[IPFSClient]\x20Error\x20stack:','NKyAu','VJYlw','fugVA','mirroring','getContentType','sizeByWhListed','TIefN','readRasters','aodzJ','bafy','\x20x\x20','LGcYC','QeqWQ','normalizeFormatParams','xEVBi','BIlxo','qVgOf','baseUriRedirect','MljNB','ZbTib','sizeByH','Failed\x20to\x20read\x20from\x20overview,\x20falling\x20back\x20to\x20main\x20image:\x20','kCLdD','FoPhi','rotationArbitrary','uxAPG','WZXxg','jjiLX','qualities','toBuffer','ensureAlpha','BvOCb',',\x20h=','abort','JCcpv','Using\x20automatic\x20overview\x20selection\x20based\x20on\x20resolution...','cBVNl','aMEJD','resize','objectKey','toColorspace',',\x20y=','QuSiZ','max','csomh','ezelV','[IPFSClient]\x20Error\x20during\x20request:','getImageCount','kMqUc','Output\x20size:\x20','ZODSd','orientation','QDOaI','lOcEs','[fromIPFS]\x20Creating\x20new\x20GeoTIFF\x20client\x20for\x20','VKZCr','yiRJQ','status','TddaU','wUSgv'];a0_0x35bb=function(){return _0x43c717;};return a0_0x35bb();}class IPFSClient extends BaseClient{constructor(_0x551078,_0x4999ef){const _0x1da44f=a0_0x5f4036;super(_0x551078),this['ipfsUrl']=_0x551078,this[_0x1da44f(0x18c)]=_0x4999ef;}[a0_0x5f4036(0x166)](_0x26d248){const _0x329a23=a0_0x5f4036,_0x4a7642=_0x26d248[_0x329a23(0x1c4)](/(?:ipfs:\/\/|\/ipfs\/)([a-zA-Z0-9]+)/);return _0x4a7642?_0x4a7642[0x1]:null;}async[a0_0x5f4036(0x1ae)]({headers:headers={}}={}){const _0x1c4c49=a0_0x5f4036,_0x5da7c8={'qVgOf':function(_0x3c8cf2,_0x12cac8){return _0x3c8cf2+_0x12cac8;},'Kyqtl':function(_0x5cbff3,_0x556a6f){return _0x5cbff3+_0x556a6f;},'PcDBV':function(_0xdb3dad,_0x311a76){return _0xdb3dad===_0x311a76;},'HfEAV':function(_0x39d661,_0x5bdcc8){return _0x39d661>=_0x5bdcc8;},'Rynqd':function(_0x494446,_0xdd558,_0x2c8420){return _0x494446(_0xdd558,_0x2c8420);},'bkTRk':function(_0x185909,_0x5aaa1f){return _0x185909===_0x5aaa1f;},'oluSv':_0x1c4c49(0x10c),'BrnBa':'SBggq','cAfWS':function(_0x4ab16a,_0xa5a9a7){return _0x4ab16a(_0xa5a9a7);},'wUSgv':_0x1c4c49(0x184),'WuXrJ':'[IPFSClient]\x20Error\x20during\x20request:','bkORf':function(_0x1bcbe8,_0xc1ef8){return _0x1bcbe8 instanceof _0xc1ef8;},'Lryxi':_0x1c4c49(0x181),'HetJL':_0x1c4c49(0x17b),'ScPsF':'[IPFSClient]\x20Error\x20stack:','Zxvht':_0x1c4c49(0x1df),'bMjCA':function(_0x33e05c,_0x91f004){return _0x33e05c in _0x91f004;},'theLi':_0x1c4c49(0x14e),'NMLVa':_0x1c4c49(0x111)};console[_0x1c4c49(0x139)](headers);const _0x1f3472=0xea60,_0x2f23d1=new AbortController(),_0x5d1efc=_0x5da7c8[_0x1c4c49(0x14f)](setTimeout,()=>{const _0x3af55a=_0x1c4c49;console[_0x3af55a(0x139)](_0x3af55a(0x117)),_0x2f23d1[_0x3af55a(0x21c)]();},_0x1f3472);try{if(_0x5da7c8['bkTRk'](_0x5da7c8[_0x1c4c49(0x141)],_0x5da7c8[_0x1c4c49(0x141)])){const _0x24ffba={'headers':headers,'signal':_0x2f23d1['signal'],'session':![]},_0x3bde78=await this[_0x1c4c49(0x18c)](this[_0x1c4c49(0x17e)],_0x24ffba);if(!_0x3bde78['ok']){if(_0x5da7c8[_0x1c4c49(0x165)]===_0x5da7c8[_0x1c4c49(0x165)])throw new Error(_0x1c4c49(0x13f)+_0x3bde78['status']+'\x20'+_0x3bde78[_0x1c4c49(0x23f)]);else _0x4b533f<_0x3cec48[_0x1c4c49(0x164)]?_0x2901a1[_0x5da7c8[_0x1c4c49(0x20b)](_0x4344d8,_0x4052b2)]=_0xb9c267[_0x543570+_0x5a64e0]:_0x4bc5c6[_0x5da7c8[_0x1c4c49(0x154)](_0x5e3879,_0x2ce546)]=_0x5da7c8[_0x1c4c49(0x1a3)](_0x19faf1,0x3)?0xff:0x0;}const _0x14686a=await _0x3bde78[_0x1c4c49(0x167)]();return _0x5da7c8[_0x1c4c49(0x152)](clearTimeout,_0x5d1efc),new IPFSResponse(_0x3bde78,_0x14686a);}else _0x4710bf[_0x1c4c49(0x107)]&&(_0x16abe7=_0x2fc071[_0x1c4c49(0x13b)]()),_0x64195d=_0x328ef1[_0x1c4c49(0x163)](_0x2cab78[_0x1c4c49(0x1f4)]);}catch(_0xf8fca){if(_0x1c4c49(0x1b3)===_0x5da7c8[_0x1c4c49(0x236)])_0x5da7c8['HfEAV'](_0xa7cb0e[_0x1c4c49(0x22e)],0x5)&&(_0x4b5966[_0x1c4c49(0x139)](_0x242a62[_0x1c4c49(0x22e)]),_0x2faa0f={'width':_0x3b6c7a[_0x1c4c49(0x23c)],'height':_0x3d3738['width']});else{_0x5da7c8['cAfWS'](clearTimeout,_0x5d1efc),console[_0x1c4c49(0x1dd)](_0x5da7c8['WuXrJ'],_0xf8fca);_0x5da7c8[_0x1c4c49(0x240)](_0xf8fca,Error)&&(console[_0x1c4c49(0x1dd)](_0x5da7c8[_0x1c4c49(0x18d)],_0xf8fca[_0x1c4c49(0x119)]),console[_0x1c4c49(0x1dd)](_0x5da7c8[_0x1c4c49(0x13c)],_0xf8fca[_0x1c4c49(0x1c2)]),console[_0x1c4c49(0x1dd)](_0x5da7c8['ScPsF'],_0xf8fca[_0x1c4c49(0x146)]));_0xf8fca&&typeof _0xf8fca===_0x5da7c8['Zxvht']&&_0x5da7c8[_0x1c4c49(0x1b8)](_0x5da7c8[_0x1c4c49(0x148)],_0xf8fca)&&console[_0x1c4c49(0x1dd)](_0x5da7c8['NMLVa'],_0xf8fca[_0x1c4c49(0x14e)]);throw _0xf8fca;}}}}async function fromIPFS(_0xc5bf74,_0x25dd2c){const _0x27818e=a0_0x5f4036,_0x3d8f32={'nXdso':function(_0x46ceb3,_0x4c1d55){return _0x46ceb3!==_0x4c1d55;},'nLMfo':_0x27818e(0x215),'SBlYH':function(_0x3a5087,_0x34f7b5){return _0x3a5087(_0x34f7b5);},'jBvDm':function(_0x32c9c4,_0x426b3c){return _0x32c9c4>=_0x426b3c;},'qifKi':function(_0x516bb0,_0x5c6cec){return _0x516bb0 instanceof _0x5c6cec;},'FoPhi':'RptMy'},_0x3fe804=geotiffCache[_0x27818e(0x13a)](_0xc5bf74);if(_0x3fe804){if(_0x3d8f32[_0x27818e(0x121)](_0x3fe804,Promise))return console[_0x27818e(0x139)]('[fromIPFS]\x20Waiting\x20for\x20in-flight\x20GeoTIFF\x20creation\x20for\x20'+_0xc5bf74),await _0x3fe804;return console[_0x27818e(0x139)]('[fromIPFS]\x20Using\x20cached\x20GeoTIFF\x20client\x20for\x20'+_0xc5bf74),_0x3fe804;}console[_0x27818e(0x139)](_0x27818e(0x231)+_0xc5bf74);const _0x5a61e1=((async()=>{const _0x507355=_0x27818e;if(_0x3d8f32[_0x507355(0x1c3)](_0x3d8f32[_0x507355(0x17f)],_0x507355(0x1cc))){const _0x536249=new IPFSClient(_0xc5bf74,_0x25dd2c),_0x4acd3f=await _0x3d8f32[_0x507355(0x168)](fromCustomClient,_0x536249);return geotiffCache[_0x507355(0x11b)](_0xc5bf74,_0x4acd3f),_0x4acd3f;}else _0x23c1ad=_0x20062a,_0x3d8305=_0x2abf68;})());geotiffCache[_0x27818e(0x11b)](_0xc5bf74,_0x5a61e1);try{if(_0x27818e(0x136)!==_0x3d8f32[_0x27818e(0x212)])return await _0x5a61e1;else _0xada409=!![],_0x59cc1a=_0x3595d7['rotate'](),_0x3d8f32[_0x27818e(0x1de)](_0x8ee711[_0x27818e(0x22e)],0x5)&&(_0x5c5078={'width':_0x1380b6['height'],'height':_0x1c9726['width']});}catch(_0x2ce800){geotiffCache['delete'](_0xc5bf74);throw _0x2ce800;}}export default class SharpIiifImageShims extends a0_0x40b134{constructor(_0x19d341=MAX_AREA,_0x4f2cea=MAX_WIDTH,_0x3976ea=MAX_HEIGHT){super(_0x19d341,_0x4f2cea,_0x3976ea);}[a0_0x5f4036(0x147)](_0x281aac,_0x3f7c07){const _0x27ef78=a0_0x5f4036;_0x281aac&&(_0x3f7c07=_0x3f7c07[_0x27ef78(0x19d)]({'left':_0x281aac['x'],'top':_0x281aac['y'],'width':_0x281aac['w'],'height':_0x281aac['h']}));}['sizeImpl'](_0x1d7c77,_0x28bd84){const _0x41626a=a0_0x5f4036,_0x57db5f={'JCcpv':_0x41626a(0x153)};_0x1d7c77&&(_0x28bd84=_0x28bd84['resize']({..._0x1d7c77,'fit':_0x57db5f[_0x41626a(0x21d)]}));}[a0_0x5f4036(0x12c)](_0x2401ad,_0x4e63aa){const _0x5becec=a0_0x5f4036;_0x2401ad&&(_0x2401ad['isMirror']&&(_0x4e63aa=_0x4e63aa['flop']()),_0x4e63aa=_0x4e63aa[_0x5becec(0x163)](_0x2401ad['degree']));}['qualityFormatImpl'](_0x5b8e39,_0x1baecb,_0x4aa875,_0x1580d6,_0xdb4c57){const _0x65b276=a0_0x5f4036,_0x343dfe={'aodzJ':function(_0x170e14,_0x5100ff){return _0x170e14===_0x5100ff;},'uxAPG':_0x65b276(0x201),'gMYSa':'nuKcU','JQiLU':function(_0x50d231,_0x1c13a3){return _0x50d231===_0x1c13a3;},'BcrEF':'grey','kCLdD':function(_0xdb543a,_0x42e276){return _0xdb543a===_0x42e276;},'VlTYK':_0x65b276(0x16e),'lrRFl':function(_0x90fe62,_0x16024c){return _0x90fe62===_0x16024c;},'QIiUj':function(_0xa71ed7,_0x3770d5){return _0xa71ed7===_0x3770d5;},'snApL':_0x65b276(0x182)};if(_0x5b8e39){if(_0x343dfe[_0x65b276(0x203)](_0x5b8e39,_0x65b276(0x1f8))){if(_0x343dfe[_0x65b276(0x214)]!==_0x343dfe[_0x65b276(0x1aa)])_0x4aa875=_0x4aa875['toColorspace']('srgb');else{const _0x12e509=_0x294e89[_0x65b276(0x1c4)](/(?:ipfs:\/\/|\/ipfs\/)([a-zA-Z0-9]+)/);return _0x12e509?_0x12e509[0x1]:null;}}else{if(_0x5b8e39===_0x65b276(0x102)||_0x343dfe['JQiLU'](_0x5b8e39,_0x343dfe[_0x65b276(0x155)]))_0x4aa875=_0x4aa875[_0x65b276(0x11e)]();else _0x343dfe['kCLdD'](_0x5b8e39,_0x343dfe['VlTYK'])&&(_0x4aa875=_0x4aa875['threshold']());}}_0x1baecb&&(_0x4aa875=_0x4aa875[_0x65b276(0x11a)](_0x1baecb)),_0x343dfe[_0x65b276(0x211)](_0x1580d6,_0x65b276(0x1d0))&&(_0x343dfe[_0x65b276(0x1b5)](_0xdb4c57[_0x65b276(0x1dc)],0x1)||_0x343dfe[_0x65b276(0x140)](_0xdb4c57['space'],_0x343dfe['snApL']))&&(_0x4aa875=_0x4aa875['toColorspace'](_0x343dfe[_0x65b276(0x15d)])['png']({'colors':0x2}));}async[a0_0x5f4036(0x1ac)](_0x1be9a0,_0x26694a,_0x4cbeeb){const _0x4c848e=a0_0x5f4036,_0x27a452={'eSeLF':_0x4c848e(0x153),'nqSra':function(_0x465d50,_0x3ed75e){return _0x465d50+_0x3ed75e;},'VKZCr':function(_0x254331,_0x48fb91){return _0x254331*_0x48fb91;},'Fdhmv':function(_0x57740d,_0x2dc916){return _0x57740d<_0x2dc916;},'ahZir':function(_0x5dcf3e,_0x35567f){return _0x5dcf3e+_0x35567f;},'mUqzk':function(_0x1931fd,_0x4cf919){return _0x1931fd===_0x4cf919;},'LGcYC':function(_0x442ff4,_0x3c69d3){return _0x442ff4===_0x3c69d3;},'iUiMb':_0x4c848e(0x1be),'dlPvu':_0x4c848e(0x15f),'iJnpe':function(_0x51b1fc,_0xe2d63a){return _0x51b1fc(_0xe2d63a);},'NWvJh':function(_0xaff736,_0x1a2efb,_0xe32718){return _0xaff736(_0x1a2efb,_0xe32718);},'SoRnK':function(_0x1cd4d0,_0x231db8){return _0x1cd4d0>=_0x231db8;},'zXiRJ':function(_0x2e9f64,_0x273525){return _0x2e9f64!==_0x273525;},'XWWDq':'KQWxA','cBVNl':function(_0xcf4ec1,_0x3a96b6){return _0xcf4ec1!==_0x3a96b6;},'zCUSo':_0x4c848e(0x14b),'hpZlm':function(_0x42797e,_0x284d2c){return _0x42797e/_0x284d2c;},'cHyTR':function(_0x5b8f3e,_0x1c8309){return _0x5b8f3e/_0x1c8309;},'aMEJD':function(_0xb69773,_0xff074c){return _0xb69773<=_0xff074c;},'jGtIx':function(_0x412bc2,_0x46b175){return _0x412bc2>_0x46b175;},'TJXHk':function(_0xbc697f,_0x4bfb0e){return _0xbc697f/_0x4bfb0e;},'XiUen':function(_0x109754,_0x9cbbac){return _0x109754+_0x9cbbac;},'gGYCR':_0x4c848e(0x106),'qkSlZ':_0x4c848e(0x1e2),'pFXqc':'QYovg','hZNLv':function(_0x52e1cd,_0x5a3f41){return _0x52e1cd+_0x5a3f41;},'lOcEs':_0x4c848e(0x125),'lrWTT':function(_0x3b683b,_0x4bcbe5){return _0x3b683b>_0x4bcbe5;},'uivgu':function(_0x23e0f2,_0x456be4){return _0x23e0f2>_0x456be4;},'Glcis':function(_0x2ed78f,_0x41c027,_0x35a06a){return _0x2ed78f(_0x41c027,_0x35a06a);}},_0x512fad=_0x1be9a0['split']('/'),_0x31c662=_0x512fad[_0x4c848e(0x1c5)](),_0x505cca=_0x31c662[_0x4c848e(0x132)]('.')[0x0],_0x39ffbe=_0x31c662[_0x4c848e(0x132)]('.')[0x1],_0x5b6031=_0x512fad[_0x4c848e(0x1c5)](),_0x4de020=_0x512fad[_0x4c848e(0x1c5)](),_0x1dac51=_0x512fad['pop'](),_0x2637ea=_0x512fad[_0x4c848e(0x1c5)]();let _0x5698bd={'width':_0x26694a[_0x4c848e(0x12b)],'height':_0x26694a[_0x4c848e(0x23c)]};const _0x590e54=super[_0x4c848e(0x161)](_0x1dac51,_0x5698bd),_0x502238=super['normalizeSizeParams'](_0x4de020,{'width':_0x590e54?_0x590e54['w']:_0x5698bd[_0x4c848e(0x12b)],'height':_0x590e54?_0x590e54['h']:_0x5698bd[_0x4c848e(0x23c)]}),{x:_0x62a21d,y:_0x36aa0a,w:_0x248656,h:_0x176009}=_0x590e54??{'x':0x0,'y':0x0,'w':_0x5698bd[_0x4c848e(0x12b)],'h':_0x5698bd[_0x4c848e(0x23c)]},{width:_0xcc5348,height:_0x177003}=_0x502238;console[_0x4c848e(0x139)](_0x4c848e(0x138)+_0x4cbeeb);let _0x24e0a1;if(_0x27a452[_0x4c848e(0x206)](typeof _0x4cbeeb,_0x27a452[_0x4c848e(0x13e)]))console['log'](_0x27a452[_0x4c848e(0x186)]),_0x24e0a1=await _0x27a452['iJnpe'](fromUrl,_0x4cbeeb);else{if(typeof _0x2637ea===_0x27a452[_0x4c848e(0x13e)]&&_0x2637ea[_0x4c848e(0x23d)](_0x4c848e(0x204))){console['log'](_0x4c848e(0x126));const _0x1d6193=_0x4c848e(0x1db)+_0x2637ea;_0x24e0a1=await _0x27a452[_0x4c848e(0x1a1)](fromIPFS,_0x1d6193,_0x4cbeeb);}else _0x24e0a1=await _0x27a452[_0x4c848e(0x1a1)](fromOSS,_0x2637ea,_0x4cbeeb);}const _0x303bc3=await _0x24e0a1[_0x4c848e(0x157)](0x0);console[_0x4c848e(0x139)](_0x4c848e(0x10e)+_0x303bc3['getWidth']()+_0x4c848e(0x205)+_0x303bc3[_0x4c848e(0x1c8)]()),console['log']('Extracting\x20region:\x20x='+_0x62a21d+_0x4c848e(0x224)+_0x36aa0a+_0x4c848e(0x185)+_0x248656+_0x4c848e(0x21b)+_0x176009),console[_0x4c848e(0x139)](_0x4c848e(0x22c)+_0xcc5348+'\x20x\x20'+_0x177003);const _0xa35c70=await _0x24e0a1[_0x4c848e(0x22a)]();console[_0x4c848e(0x139)](_0x4c848e(0x134)+_0xa35c70);const _0x396ff6=_0x303bc3[_0x4c848e(0x197)]();let _0x1718a8;_0x27a452[_0x4c848e(0x1f7)](_0x396ff6,0x3)?_0x27a452['zXiRJ'](_0x4c848e(0x1ec),_0x27a452[_0x4c848e(0x238)])?_0x583b5f=_0x44e34d[_0x4c848e(0x221)]({..._0x44e16d,'fit':_0x27a452[_0x4c848e(0x143)]}):(_0x1718a8=[0x0,0x1,0x2],_0x396ff6>=0x4&&_0x1718a8['push'](0x3)):_0x27a452[_0x4c848e(0x21f)](_0x27a452[_0x4c848e(0x239)],_0x27a452[_0x4c848e(0x239)])?(_0x54a799[_0x4c848e(0x139)](_0x37cb26['orientation']),_0x2f6d7b={'width':_0x46bca7[_0x4c848e(0x23c)],'height':_0x3b1afc[_0x4c848e(0x12b)]}):_0x1718a8=[0x0];console[_0x4c848e(0x139)](_0x4c848e(0x21e));const _0x6d5c3f=Math[_0x4c848e(0x226)](_0x27a452[_0x4c848e(0x1a9)](_0x248656,_0xcc5348),_0x27a452[_0x4c848e(0x1b7)](_0x176009,_0x177003));let _0x35598d=_0x303bc3,_0x1c8746=0x1;for(let _0x53d33e=0x0;_0x27a452[_0x4c848e(0x1e6)](_0x53d33e,_0xa35c70);_0x53d33e++){const _0x3a851a=await _0x24e0a1[_0x4c848e(0x157)](_0x53d33e),_0x211fe=_0x27a452['cHyTR'](_0x303bc3[_0x4c848e(0x18b)](),_0x3a851a[_0x4c848e(0x18b)]());_0x27a452[_0x4c848e(0x220)](_0x211fe,_0x6d5c3f)&&_0x27a452[_0x4c848e(0x104)](_0x211fe,_0x1c8746)&&(_0x1c8746=_0x211fe,_0x35598d=_0x3a851a);}console[_0x4c848e(0x139)](_0x4c848e(0x1e3)+_0x1c8746[_0x4c848e(0x151)](0x2)+'x'),console[_0x4c848e(0x139)](_0x4c848e(0x18e)+_0x35598d[_0x4c848e(0x18b)]()+_0x4c848e(0x205)+_0x35598d[_0x4c848e(0x1c8)]());const _0x353abd=[Math[_0x4c848e(0x180)](_0x62a21d/_0x1c8746),Math['floor'](_0x27a452[_0x4c848e(0x10a)](_0x36aa0a,_0x1c8746)),Math['floor'](_0x27a452['XiUen'](_0x62a21d,_0x248656)/_0x1c8746),Math['floor'](_0x27a452[_0x4c848e(0x103)](_0x36aa0a,_0x176009)/_0x1c8746)];let _0x138978;try{'BFFyT'===_0x4c848e(0x1cd)?_0x680565[_0x27a452[_0x4c848e(0x1d1)](_0x377895,_0x2280f6)]=_0x281819[_0x27a452[_0x4c848e(0x1d1)](_0x361928,_0x534349)]:_0x138978=await _0x35598d['readRasters']({'window':_0x353abd,'width':_0xcc5348,'height':_0x177003,'samples':_0x1718a8,'interleave':!![],'resampleMethod':_0x27a452['gGYCR']});}catch(_0x411505){if(_0x27a452['mUqzk'](_0x27a452[_0x4c848e(0x14a)],_0x27a452[_0x4c848e(0x169)])){const _0x39c0bb=_0x27a452[_0x4c848e(0x232)](_0x4fd64a,_0x3fd716[_0x4c848e(0x164)]),_0x29d8a3=_0x27a452[_0x4c848e(0x232)](_0x176e9c,_0x8668c7);for(let _0xa8423=0x0;_0x27a452['Fdhmv'](_0xa8423,_0x255df7);_0xa8423+=0x1){_0xa8423<_0x32f1b8['channels']?_0x246df2[_0x29d8a3+_0xa8423]=_0x59245d[_0x27a452[_0x4c848e(0x1ca)](_0x39c0bb,_0xa8423)]:_0x1a7306[_0x27a452[_0x4c848e(0x1ca)](_0x29d8a3,_0xa8423)]=_0x27a452[_0x4c848e(0x237)](_0xa8423,0x3)?0xff:0x0;}}else{console['log'](_0x4c848e(0x210)+_0x411505);const _0xbfb916=[_0x62a21d,_0x36aa0a,_0x27a452['hZNLv'](_0x62a21d,_0x248656),_0x27a452[_0x4c848e(0x1ca)](_0x36aa0a,_0x176009)];_0x138978=await _0x303bc3[_0x4c848e(0x202)]({'window':_0xbfb916,'width':_0xcc5348,'height':_0x177003,'samples':_0x1718a8,'interleave':!![],'resampleMethod':_0x27a452['gGYCR']});}}const _0x14d579=_0x1718a8[_0x4c848e(0x196)],_0x100f40=Buffer[_0x4c848e(0x1a6)](_0x138978['buffer'],_0x138978[_0x4c848e(0x1b6)],_0x138978[_0x4c848e(0x1ce)]),_0x43a913={'page':selectedPage,'sequentialRead':!![],'failOn':_0x27a452[_0x4c848e(0x230)],'raw':{'width':_0xcc5348,'height':_0x177003,'channels':_0x14d579}};(_0x27a452[_0x4c848e(0x17a)](_0xcc5348,0x1388)||_0x27a452[_0x4c848e(0x198)](_0x177003,0x1388))&&(_0x43a913[_0x4c848e(0x19f)]=![]);let _0xf8a997=_0x27a452[_0x4c848e(0x178)](a0_0x4e4605,_0x100f40,_0x43a913);const _0x40d191=super['normalizeRotationParams'](_0x5b6031);this[_0x4c848e(0x12c)](_0x40d191,_0xf8a997);const _0x5e6595=super[_0x4c848e(0x177)](_0x505cca),_0x588cb6=super[_0x4c848e(0x208)](_0x39ffbe,_0x26694a[_0x4c848e(0x135)]);this[_0x4c848e(0x1b4)](_0x5e6595,_0x588cb6,_0xf8a997,_0x39ffbe,_0x26694a);const _0x23b8bd={};return _0x23b8bd['body']=_0xf8a997,_0x23b8bd['contentType']=super[_0x4c848e(0x1ff)](_0x588cb6),_0x23b8bd;}async[a0_0x5f4036(0x11d)](_0x2007bf,_0x2e0c54,_0x4c31f1){const _0x5c828d=a0_0x5f4036,_0x12b36d={'FTloR':function(_0x3e1575,_0x4c8a57){return _0x3e1575||_0x4c8a57;},'ugPbi':function(_0x4321cf,_0x406c99){return _0x4321cf>_0x406c99;},'BNyUx':function(_0x50ad1d,_0x22486a){return _0x50ad1d>=_0x22486a;},'kMqUc':'Pyramid\x20optimization:\x20using\x20full\x20resolution\x20page\x20(scale\x20≈\x201.0)','MMQuP':_0x5c828d(0x124),'ipUqi':_0x5c828d(0x16d),'DIHcr':function(_0x337917,_0x383746){return _0x337917-_0x383746;},'qYovL':function(_0x46eaa3,_0x39f246){return _0x46eaa3-_0x39f246;},'QeqWQ':function(_0x592ea0,_0x4ab9e9){return _0x592ea0/_0x4ab9e9;},'ezelV':function(_0x39f9ee,_0x39de5f){return _0x39f9ee/_0x39de5f;},'JzWFg':function(_0x446fbb,_0x38a89a){return _0x446fbb>_0x38a89a;},'BIlxo':function(_0x32d0a9,_0x1a56a7){return _0x32d0a9!==_0x1a56a7;},'PFfBm':_0x5c828d(0x21a),'gPqie':function(_0x54f680,_0x5b3ba6){return _0x54f680*_0x5b3ba6;},'hnMKn':function(_0x2bb279,_0x4a24b4){return _0x2bb279*_0x4a24b4;},'SrLHT':function(_0x31102e,_0x85d8f5){return _0x31102e>=_0x85d8f5;},'ANdRy':function(_0x24c486,_0x5374e6){return _0x24c486*_0x5374e6;},'qWUZZ':_0x5c828d(0x125),'vvKkn':function(_0x4c2aa6,_0x8bab71){return _0x4c2aa6===_0x8bab71;},'YYuBS':_0x5c828d(0x1fb),'mhVjA':'RgNRQ','GbmAu':function(_0x54318a,_0x2273cb){return _0x54318a/_0x2273cb;},'EXTsQ':function(_0x4b0bee,_0x3d4a90){return _0x4b0bee*_0x3d4a90;},'ZbTib':function(_0x3e8241,_0x578c23){return _0x3e8241*_0x578c23;},'pMKZC':function(_0x17bb26,_0x1ff721){return _0x17bb26-_0x1ff721;},'pVoNP':'IxSWs','BTtAb':function(_0x5242f4,_0x10e519,_0x210c18){return _0x5242f4(_0x10e519,_0x210c18);}},_0x105579=_0x2007bf[_0x5c828d(0x132)]('/'),_0x4be557=_0x105579[_0x5c828d(0x1c5)](),_0x3e393e=_0x4be557[_0x5c828d(0x132)]('.')[0x0],_0x3501fd=_0x4be557[_0x5c828d(0x132)]('.')[0x1],_0x25ccfc=_0x105579['pop'](),_0x26385e=_0x105579[_0x5c828d(0x1c5)](),_0x339db7=_0x105579[_0x5c828d(0x1c5)](),_0x2795d6=super['normalizeRegionParams'](_0x339db7,_0x2e0c54),_0x9e7723=super[_0x5c828d(0x19a)](_0x26385e,{'width':_0x2795d6?_0x2795d6['w']:_0x2e0c54[_0x5c828d(0x12b)],'height':_0x2795d6?_0x2795d6['h']:_0x2e0c54['height']}),_0x17b7a2=super[_0x5c828d(0x193)](_0x25ccfc),_0x596140=super[_0x5c828d(0x177)](_0x3e393e),_0x59184a=super['normalizeFormatParams'](_0x3501fd,_0x2e0c54['format']),{x:_0x41e5c7,y:_0x101a23,w:_0x5b5e4c,h:_0x38eb35}=_0x2795d6||{'x':0x0,'y':0x0,'w':_0x2e0c54[_0x5c828d(0x12b)],'h':_0x2e0c54[_0x5c828d(0x23c)]},{width:_0x4f6d90,height:_0x370429}=_0x12b36d['FTloR'](_0x9e7723,{'width':_0x2e0c54['width'],'height':_0x2e0c54[_0x5c828d(0x23c)]});let _0x4b2950=0x0,_0x251929;if(_0x2e0c54[_0x5c828d(0x175)]&&_0x12b36d[_0x5c828d(0x16c)](_0x2e0c54[_0x5c828d(0x175)],0x1)){const _0x3037ef=_0x4f6d90/_0x5b5e4c,_0x34cfeb=_0x370429/_0x38eb35,_0x2513e8=Math[_0x5c828d(0x226)](_0x3037ef,_0x34cfeb);if(_0x12b36d[_0x5c828d(0x12d)](_0x2513e8,0.95))console[_0x5c828d(0x139)](_0x12b36d[_0x5c828d(0x22b)]),_0x4b2950=0x0;else{if(_0x12b36d['MMQuP']!==_0x12b36d[_0x5c828d(0x1ba)]){_0x4b2950=_0x12b36d[_0x5c828d(0x14d)](_0x2e0c54['pages'],0x1);const _0xeeb1de=Math[_0x5c828d(0x1bd)](0x2,_0x12b36d[_0x5c828d(0x1cf)](_0x2e0c54[_0x5c828d(0x175)],0x1));let _0x4e78c6=_0x12b36d[_0x5c828d(0x207)](_0x2e0c54[_0x5c828d(0x12b)],_0xeeb1de),_0x26a605=_0x12b36d[_0x5c828d(0x228)](_0x2e0c54[_0x5c828d(0x23c)],_0xeeb1de);while(_0x12b36d['JzWFg'](_0x4b2950,0x0)){if(_0x12b36d[_0x5c828d(0x20a)](_0x12b36d[_0x5c828d(0x113)],_0x12b36d['PFfBm']))return this[_0x5c828d(0x167)];else{const _0x12e506=_0x12b36d['gPqie'](_0x5b5e4c,_0x12b36d[_0x5c828d(0x228)](_0x4e78c6,_0x2e0c54[_0x5c828d(0x12b)])),_0x3f7cd6=_0x12b36d['gPqie'](_0x38eb35,_0x26a605/_0x2e0c54['height']);if(_0x12e506>=_0x12b36d[_0x5c828d(0x1f9)](_0x4f6d90,1.1)&&_0x12b36d[_0x5c828d(0x108)](_0x3f7cd6,_0x12b36d[_0x5c828d(0x1bf)](_0x370429,1.1)))break;_0x4b2950--,_0x4e78c6*=0x2,_0x26a605*=0x2;}}console[_0x5c828d(0x139)](_0x5c828d(0x1ef)+_0x4b2950+'/'+(_0x2e0c54[_0x5c828d(0x175)]-0x1)+_0x5c828d(0x1f0)+_0x2513e8[_0x5c828d(0x151)](0x2)+_0x5c828d(0x189)+_0x4f6d90+'x'+_0x370429+')');}else _0x507928[_0x5c828d(0x10f)](0x3);}const _0x3d30ed=_0x2e0c54[_0x5c828d(0x109)]?{'limitInputPixels':![],'page':_0x4b2950,'sequentialRead':!![],'failOn':_0x5c828d(0x125)}:{'page':_0x4b2950,'sequentialRead':!![],'failOn':_0x12b36d[_0x5c828d(0x145)]};_0x251929=a0_0x4e4605(_0x4c31f1,_0x3d30ed);if(_0x2795d6&&_0x12b36d[_0x5c828d(0x16c)](_0x4b2950,0x0)){if(_0x12b36d[_0x5c828d(0x16b)](_0x12b36d[_0x5c828d(0x14c)],_0x12b36d[_0x5c828d(0x160)]))_0x2dcdef=[0x0,0x1,0x2],_0x3b68c8>=0x4&&_0x52699f[_0x5c828d(0x10f)](0x3);else{const _0x823113=await _0x251929['metadata'](),_0x1350f7=_0x12b36d['GbmAu'](_0x823113[_0x5c828d(0x12b)],_0x2e0c54[_0x5c828d(0x12b)]),_0x3ea3af={'x':Math[_0x5c828d(0x180)](_0x12b36d[_0x5c828d(0x1d7)](_0x41e5c7,_0x1350f7)),'y':Math[_0x5c828d(0x180)](_0x101a23*_0x1350f7),'w':Math['floor'](_0x12b36d[_0x5c828d(0x1a8)](_0x5b5e4c,_0x1350f7)),'h':Math[_0x5c828d(0x180)](_0x12b36d[_0x5c828d(0x20e)](_0x38eb35,_0x1350f7))};_0x3ea3af['w']=Math[_0x5c828d(0x149)](_0x3ea3af['w'],_0x12b36d[_0x5c828d(0x14d)](_0x823113[_0x5c828d(0x12b)],_0x3ea3af['x'])),_0x3ea3af['h']=Math['min'](_0x3ea3af['h'],_0x12b36d[_0x5c828d(0x18f)](_0x823113['height'],_0x3ea3af['y'])),this[_0x5c828d(0x147)](_0x3ea3af,_0x251929);}}else this[_0x5c828d(0x147)](_0x2795d6,_0x251929);}else{if('IRfgi'!==_0x12b36d['pVoNP']){const _0x4cfa56=_0x2e0c54[_0x5c828d(0x109)]?{'limitInputPixels':![],'sequentialRead':!![],'failOn':_0x12b36d['qWUZZ']}:{'sequentialRead':!![],'failOn':_0x12b36d[_0x5c828d(0x145)]};_0x251929=_0x12b36d[_0x5c828d(0x116)](a0_0x4e4605,_0x4c31f1,_0x4cfa56),this[_0x5c828d(0x147)](_0x2795d6,_0x251929);}else throw new _0x3dad32(_0x5c828d(0x13f)+_0x394e66[_0x5c828d(0x234)]+'\x20'+_0x24207e['statusText']);}this[_0x5c828d(0x1d6)](_0x9e7723,_0x251929),this[_0x5c828d(0x12c)](_0x17b7a2,_0x251929),this['qualityFormatImpl'](_0x596140,_0x59184a,_0x251929,_0x3501fd,_0x2e0c54);const _0x54aa0e={};return _0x54aa0e[_0x5c828d(0x1e9)]=_0x251929,_0x54aa0e[_0x5c828d(0x10b)]=super['getContentType'](_0x59184a),_0x54aa0e;}[a0_0x5f4036(0x1d2)](_0x29e853,_0x5af81c,_0x4132ff='',_0x5d0723,_0x2f4efc='2',_0x297b0=0x200,_0x1dbae1=0x200){const _0x19f071=a0_0x5f4036,_0x4b38de={'UvrrY':function(_0x255626,_0x10792d){return _0x255626>=_0x10792d;},'FHhnu':function(_0x280558,_0x491e65){return _0x280558===_0x491e65;},'yiRJQ':_0x19f071(0x1d9),'cAFWu':_0x19f071(0x1a7),'nOSgT':'ZODSd','HIfnK':'compliance','odqfo':function(_0x49dbd5,_0x592b39){return _0x49dbd5===_0x592b39;},'udnVV':'MZeNW','GzXBN':_0x19f071(0x105),'laoLi':_0x19f071(0x162),'OydNh':'png','bwsKk':_0x19f071(0x156),'hYIxC':_0x19f071(0x144),'rpgqG':_0x19f071(0x1f1),'csomh':_0x19f071(0x217),'yyYvw':_0x19f071(0x16e),'Ziotk':'default','iTmWA':_0x19f071(0x1e1),'PWRjr':_0x19f071(0x1f5),'MvjyG':_0x19f071(0x199),'LSryK':function(_0x56eee6,_0x3a69c5){return _0x56eee6(_0x3a69c5);},'XNZRu':'3.0'};let _0x5382f9={'width':_0x5af81c['width'],'height':_0x5af81c['height']};_0x5af81c&&_0x5af81c[_0x19f071(0x22e)]&&(_0x4b38de[_0x19f071(0x15b)](_0x5af81c['orientation'],0x5)&&(console[_0x19f071(0x139)](_0x5af81c[_0x19f071(0x22e)]),_0x5382f9={'width':_0x5af81c[_0x19f071(0x23c)],'height':_0x5af81c['width']}));const _0x3cead9=super['generateImageInfoTemp'](_0x29e853,_0x5382f9,_0x5d0723,_0x2f4efc,_0x297b0,_0x1dbae1),_0x241953=_0x3cead9[_0x19f071(0x1e4)];if(_0x4b38de[_0x19f071(0x1d8)](_0x5d0723,_0x4b38de[_0x19f071(0x233)])||_0x4b38de[_0x19f071(0x1d8)](_0x5d0723,_0x4b38de[_0x19f071(0x11f)])){if(_0x4b38de[_0x19f071(0x1b1)]!==_0x19f071(0x22d))_0x3a9ec1=_0x277aa5['ensureAlpha']();else{_0x241953[_0x19f071(0x1e5)]=[super[_0x19f071(0x13d)](_0x4b38de[_0x19f071(0x128)],_0x5d0723,_0x2f4efc)];if(_0x4b38de['FHhnu'](_0x2f4efc,'2')){if(_0x4b38de[_0x19f071(0x120)](_0x4b38de[_0x19f071(0x174)],_0x4b38de[_0x19f071(0x187)])){const _0x503d43=new _0x5175cc(_0x20e12e,_0x57f93a);return _0x20d0cf(_0x503d43);}else{const _0x3da0c1={};_0x3da0c1[_0x19f071(0x172)]=[_0x4b38de[_0x19f071(0x115)],_0x4b38de[_0x19f071(0x129)],_0x19f071(0x176),_0x4b38de[_0x19f071(0x190)],_0x4b38de[_0x19f071(0x192)],_0x4b38de[_0x19f071(0x1a4)]],_0x3da0c1[_0x4b38de[_0x19f071(0x227)]]=[_0x19f071(0x1f8),_0x19f071(0x102),_0x4b38de['yyYvw'],_0x4b38de['Ziotk'],_0x4b38de['iTmWA'],_0x4b38de[_0x19f071(0x1b2)]],_0x3da0c1[_0x4b38de[_0x19f071(0x1bc)]]=SUPPORTS[_0x4b38de[_0x19f071(0x16f)](Number,_0x5d0723)],_0x241953['profile']['push'](_0x3da0c1);}}}}return _0x4b38de[_0x19f071(0x1d8)](_0x5d0723,_0x4b38de['XNZRu'])&&(_0x4132ff&&(_0x241953[_0x19f071(0x1e0)]=[_0x4132ff],_0x241953[_0x19f071(0x183)]=[_0x4132ff])),_0x4132ff&&(_0x241953[_0x19f071(0x172)]=[_0x4132ff]),_0x3cead9;}[a0_0x5f4036(0x1af)](_0x438f38,_0x13163a){const _0x2d12fc=a0_0x5f4036,_0x15633d={'rNRfA':function(_0x2e845f,_0x13afa5){return _0x2e845f(_0x13afa5);},'DkTMF':function(_0x76e07,_0xcd07e5){return _0x76e07 instanceof _0xcd07e5;},'slkvS':_0x2d12fc(0x181),'VJYlw':_0x2d12fc(0x17b),'HIbZS':function(_0x2e996,_0x2161fd){return _0x2e996===_0x2161fd;},'QDOaI':function(_0x188b5a,_0xb8ad7c){return _0x188b5a in _0xb8ad7c;},'fugVA':'errors','xrQpy':'[IPFSClient]\x20AggregateError\x20details:','sKUzH':function(_0x5cb06b,_0x1844e5){return _0x5cb06b(_0x1844e5);},'TddaU':function(_0x84e7f4,_0x408b1f){return _0x84e7f4>=_0x408b1f;},'hNXPR':function(_0x453de2,_0x2e4ef4){return _0x453de2||_0x2e4ef4;},'hXKeB':_0x2d12fc(0x1a0),'Wfjvz':_0x2d12fc(0x1c6)},_0x5f4a8d=_0x13163a[_0x2d12fc(0x109)]?_0x15633d[_0x2d12fc(0x1ea)](a0_0x4e4605,{'limitInputPixels':![],'sequentialRead':!![]}):a0_0x4e4605({'sequentialRead':!![]}),_0x211b79=_0x438f38[_0x2d12fc(0x132)]('/'),_0x4f0877=_0x211b79['pop'](),_0x19116e=_0x4f0877[_0x2d12fc(0x132)]('.')[0x0],_0x4e32b7=_0x4f0877[_0x2d12fc(0x132)]('.')[0x1],_0x14eda8=_0x211b79['pop'](),_0x1b7a8c=_0x211b79[_0x2d12fc(0x1c5)](),_0x332ee6=_0x211b79[_0x2d12fc(0x1c5)]();let _0x264818=![],_0x3fd4fd=_0x5f4a8d,_0x48aa3a={'width':_0x13163a[_0x2d12fc(0x12b)],'height':_0x13163a[_0x2d12fc(0x23c)]};_0x13163a&&_0x13163a['orientation']&&(_0x264818=!![],_0x3fd4fd=_0x3fd4fd[_0x2d12fc(0x163)](),_0x15633d[_0x2d12fc(0x235)](_0x13163a[_0x2d12fc(0x22e)],0x5)&&(_0x48aa3a={'width':_0x13163a[_0x2d12fc(0x23c)],'height':_0x13163a[_0x2d12fc(0x12b)]}));const _0x17c376=super['normalizeRegionParams'](_0x332ee6,_0x48aa3a);this[_0x2d12fc(0x147)](_0x17c376,_0x3fd4fd);const _0x1bd921=super['normalizeSizeParams'](_0x1b7a8c,{'width':_0x17c376?_0x17c376['w']:_0x48aa3a[_0x2d12fc(0x12b)],'height':_0x17c376?_0x17c376['h']:_0x48aa3a[_0x2d12fc(0x23c)]});this[_0x2d12fc(0x1d6)](_0x1bd921,_0x3fd4fd);const _0x417ce5=super[_0x2d12fc(0x193)](_0x14eda8);this[_0x2d12fc(0x12c)](_0x417ce5,_0x3fd4fd);const _0x2b5286=super[_0x2d12fc(0x177)](_0x19116e),_0x1ee0ee=super[_0x2d12fc(0x208)](_0x4e32b7,_0x13163a[_0x2d12fc(0x135)]);this[_0x2d12fc(0x1b4)](_0x2b5286,_0x1ee0ee,_0x3fd4fd,_0x4e32b7,_0x13163a);if(_0x15633d[_0x2d12fc(0x23b)](_0x17c376,_0x1bd921)||_0x417ce5||_0x2b5286||_0x1ee0ee||_0x264818)return _0x3fd4fd;else{if(_0x2d12fc(0x1a0)===_0x15633d[_0x2d12fc(0x110)])return console[_0x2d12fc(0x139)](_0x15633d['Wfjvz']),null;else{_0x15633d[_0x2d12fc(0x1eb)](_0x4db820,_0x5b4071),_0x2e8c97['error'](_0x2d12fc(0x229),_0xca8627);_0x15633d[_0x2d12fc(0x19c)](_0x580eb0,_0x5a9d44)&&(_0x382a4d[_0x2d12fc(0x1dd)](_0x15633d['slkvS'],_0x5a8076['name']),_0x59b6db[_0x2d12fc(0x1dd)](_0x15633d[_0x2d12fc(0x1fc)],_0x2bcf08[_0x2d12fc(0x1c2)]),_0xc93432[_0x2d12fc(0x1dd)](_0x2d12fc(0x1fa),_0x2fa04c[_0x2d12fc(0x146)]));_0x415125&&_0x15633d[_0x2d12fc(0x1ad)](typeof _0x56cec7,_0x2d12fc(0x1df))&&_0x15633d[_0x2d12fc(0x22f)](_0x15633d[_0x2d12fc(0x1fd)],_0x4dd5a0)&&_0x33ef3e[_0x2d12fc(0x1dd)](_0x15633d[_0x2d12fc(0x159)],_0xebe466[_0x2d12fc(0x14e)]);throw _0x18aeca;}}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etu-wiki/sharp-iiif-shims",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
|
|
15
|
-
"build": "
|
|
16
|
-
"build:common": "npx esbuild ./src/index.mjs --outdir=dist --bundle --platform=node --minify --external:sharp --external:geotiff --external:@helia/verified-fetch --format=esm --out-extension:.js=.mjs",
|
|
15
|
+
"build": "mkdir -p dist && cp ./src/index.mjs dist/index.temp.js && npx javascript-obfuscator dist/index.temp.js --output dist/index.obfuscated.js --compact true --control-flow-flattening true --dead-code-injection true --string-array true --string-array-rotate true --string-array-shuffle true --string-array-threshold 0.75 && mv dist/index.obfuscated.js dist/index.mjs && rm dist/index.temp.js",
|
|
17
16
|
"prepublishOnly": "npm run build"
|
|
18
17
|
},
|
|
19
18
|
"keywords": [
|
|
@@ -23,14 +22,14 @@
|
|
|
23
22
|
"author": "Joe Song",
|
|
24
23
|
"license": "ISC",
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"
|
|
25
|
+
"javascript-obfuscator": "^4.1.1",
|
|
27
26
|
"jest": "^29.5.0"
|
|
28
27
|
},
|
|
29
28
|
"files": [
|
|
30
29
|
"dist"
|
|
31
30
|
],
|
|
32
31
|
"dependencies": {
|
|
33
|
-
"@etu-wiki/iiif-image-shims": "^0.0.
|
|
32
|
+
"@etu-wiki/iiif-image-shims": "^0.0.31",
|
|
34
33
|
"geotiff": "^2.1.3"
|
|
35
34
|
},
|
|
36
35
|
"peerDependencies": {
|