PageSourceSearch

https://www.inven.co.kr/common/lib/js/release/blueImage.js

js inven.co.kr collected 2026-09-24 09:02:59 UTC 11,780 bytes, 1 lines download raw bytes

1!function(){"use strict";var t="undefined"!=typeof document?document.currentScript:null;const e="object"==typeof globalThis.WebAssembly&&null!==globalThis.WebAssembly&&"function"==typeof WebAssembly.Instance,a="function"==typeof globalThis.OffscreenCanvas,n=![e,a,"function"==typeof globalThis.ImageDecoder,"function"==typeof globalThis.VideoEncoder,"function"==typeof globalThis.VideoDecoder,"function"==typeof globalThis.VideoFrame].includes(!1);async function i(t,e){if(!e){let a="string"==typeof t?t.split("#")[0].split("?")[0].trim().toLowerCase():t.pathname.toLowerCase();if(a.endsWith(".js"))e="text/javascript";else{if(!a.endsWith(".wasm"))return"";e="application/wasm"}}return URL.createObjectURL(new Blob([await(await fetch(t)).arrayBuffer()],{type:e}))}async function s(t,e="image/png"){if("function"==typeof globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement){if(t.width>0&&t.height>0)return new Promise((a=>{t.toBlob((async t=>{a(t&&t.size>0?await t.arrayBuffer():null)}),e)}))}else if("function"==typeof globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas&&t.width>0&&t.height>0){let e=await t.convertToBlob({type:"image/png"});return e.size>0?await e.arrayBuffer():null}return null}async function o(t,e="image/png"){if((t instanceof ImageData||"function"==typeof globalThis.ImageBitmap&&t instanceof ImageBitmap)&&t.width>0&&t.height>0){let a;if("function"==typeof globalThis.OffscreenCanvas)a=new OffscreenCanvas(t.width,t.height).getContext("2d");else if("function"==typeof globalThis.HTMLCanvasElement&&document){const e=document.createElement("canvas");e.width=t.width,e.height=t.height,a=e.getContext("2d")}if(a)return t instanceof ImageData?a.putImageData(t,0,0):a.drawImage(t,0,0),await s(a.canvas,e)}return null}async function r(t){if(t.href&&["http","https"].includes(t.protocol)){let e=await async function(t){try{let e=await fetch(t);if(e?.ok)return e}catch(t){}try{let e=await fetch(t,{referrer:""});if(e?.ok)return e}catch(t){}return null}(t);return e?await(await e.blob()).arrayBuffer():null}return null}async function l(e){if(e=e.trim(),/^data:(?:image|video)\/[^;]+;base64,[0-9a-zA-Z\+\/]+$/.test(e))try{let t=await fetch(e);return t?await t.arrayBuffer():null}catch(t){}else if(!e.startsWith("data:"))try{return await r(new URL(e,t&&t.src||new URL("js/release/blueImage.js",document.baseURI).href))}catch(t){}return null}async function u(t){if(t instanceof ArrayBuffer)return t;if(t instanceof File)return await t.arrayBuffer();if(t instanceof Blob)return await t.arrayBuffer();if(t instanceof Uint8Array)return 0===(e=t).byteOffset?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("function"==typeof globalThis.HTMLImageElement&&t instanceof HTMLImageElement){if(!t.complete)try{await t.decode()}catch(t){return null}return t.naturalWidth>0?await l(t.src):null}return"function"==typeof globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas?await s(t):"function"==typeof globalThis.OffscreenCanvasRenderingContext2D&&t instanceof OffscreenCanvasRenderingContext2D?await s(t.canvas):"function"==typeof globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement?await s(t):"function"==typeof globalThis.CanvasRenderingContext2D&&t instanceof CanvasRenderingContext2D?await s(t.canvas):t instanceof ImageData||"function"==typeof globalThis.ImageBitmap&&t instanceof ImageBitmap?await o(t):"string"==typeof t?await l(t):t instanceof URL?await r(t):null;var e}const c=4;const f="undefined"!=typeof document&&document?.currentScript?.src?.trim()?new URL(document?.currentScript?.src?.trim()):null;async function h(e){if("undefined"!=typeof self&&globalThis===self&&"undefined"==typeof window){let t=new URL(e,self.location.href);if(t.search="","blob:"==self.location.protocol)try{return{url:t,blob:await i(t)}}catch(t){}return{url:t}}{const a="undefined"!=typeof document&&/^https?:\/\/(?:[^\.]+\.|)inven\.co\.kr$/.test(document.location.origin);let n=new URL(e,a?"https://www.inven.co.kr/common/lib/js/release/":t&&t.src||new URL("js/release/blueImage.js",document.baseURI).href);
1if("blob:"!=n.protocol){if(f)for(let[t,e]of f.searchParams.entries())n.searchParams.has(t)||n.searchParams.append(t,e);a&&n.searchParams.delete("origin");let t=function(t=c){if("number"==typeof t){if(!isNaN(t)&&Math.floor(t)>1)return Math.floor(t).toString()}else if("string"==typeof t&&!["","0","1"].includes(t.trim()))return t.trim();return""}();if(t&&n.searchParams.append("v",t),document.location.origin!=n.origin){a&&n.searchParams.append("origin",document.location.host);try{return{url:n,blob:await i(n)}}catch(t){}}}return{url:n}}}var g;!function(t){t[t.None=0]="None",t[t.Pending=1]="Pending",t[t.Error=2]="Error",t[t.Fulfill=3]="Fulfill"}(g||(g={}));class m{#t=[];#e=0;#a=!1;#n=null;constructor(t=!0){this.#a=t}get size(){return this.#t.length}get count(){return this.#e}has(t){return void 0!==this.#t[t]}push(t){return null!==this.#n&&(clearTimeout(this.#n),this.#n=null),this.#t.push(t),this.#e++,this.#t.length-1}pop(t){const e=this.#t[t];return void 0!==e?(this.#e=Math.max(this.#e-1,0),!this.#a||this.#e>0?this.#t[t]=void 0:(null!==this.#n&&clearTimeout(this.#n),this.#n=setTimeout(this.#i.bind(this),1e3)),e):null}destroy(){null!==this.#n&&(clearTimeout(this.#n),this.#n=null),this.#t.splice(0),this.#e=0}#i(){0===this.#e&&this.#t.splice(0),this.#n=null}}const p=Object.entries({jpg:/^\xff\xd8\xff[\xdb\xe0-\xef]/,png:"‰PNG\r\n�\n",gif:/^GIF8[79]a/,webp:/^RIFF[\x00-\xff]{4}WEBP/,avif:/^\x00\x00\x00[ \x1c]ftypavi[fs]/,bmp:"BM",mp4:/^\x00\x00[\x00-\xff]{2}ftyp/}),d=new Map(Object.entries({jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",apng:"image/png",gif:"image/gif",webp:"image/webp",avif:"image/avif",avifs:"image/avif",bmp:"image/bmp",mp4:"video/mp4"}));async function y(t,e=!1){const a=String.fromCharCode(...t instanceof ArrayBuffer?new Uint8Array(t,0,14):t.slice(t.byteOffset,t.byteOffset+14));for(let[t,n]of p)if(n instanceof RegExp&&n.test(a)||"string"==typeof n&&a.startsWith(n))return e?d.get(t)??null:t;return null}new Map(Object.entries({"image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/apng":"png","image/gif":"gif","image/webp":"webp","image/avif":"avif","image/bmp":"bmp","video/mp4":"mp4","image/mp4":"mp4"}));let w=null;const b=new class{#s=g.None;#o;#r;#l=[];#u;constructor(t,e){this.#o=t,this.#r=e}isLoaded(){return this.#s===g.Fulfill||this.#s===g.Error}isError(){return this.#s===g.Error}async load(...t){return this.#s===g.Fulfill||this.#s===g.Error?this.#u:this.#s===g.Pending?new Promise((t=>this.#l.push(t))):(this.#s=g.Pending,new Promise((async e=>{this.#l.push(e),this.#u=await(this.#o?.(...t)),this.#o=null,this.#s=!1!==this.#u&&null!==this.#u?g.Fulfill:g.Error,this.#s===g.Fulfill&&this.#r&&this.#r(this.#u);for(let t of this.#l.splice(0))t(this.#u)})))}}((e=>{if("string"==typeof e)try{e=new URL(e,t&&t.src||new URL("js/release/blueImage.js",document.baseURI).href)}catch(t){e=null}return new Promise((async t=>{let a;if(e instanceof URL)a=e;else{let t=await h("blueImage_worker.js");e=t.blob??t.url,a=t.url}try{w=new Worker(e),w?w.onmessage=e=>{"init"==e.data?.method&&(w.onmessage=null,w.postMessage({method:"location",location:a.href}),t(!!e.data.result))}:(w=null,t(!1))}catch(e){w=null,t(!1)}}))}));function v(t,e,a){const{instance:n,hash:i,size:s,width:o,height:r,originalFormat:l,format:u,type:c,isOpaque:f,frameCount:h,videoCodec:g}=t;if(o>0){const t={instance:n,hash:i,size:s,width:o,height:r,originalFormat:l,format:u,type:c,isOpaque:f,frameCount:h,videoCodec:g};return"string"==typeof a&&(a=a.trim().replace(/\.[^\.]*$/,"").replace(/[\.\s]+$/,"").trim())&&(t.name=a),t}return e.onmessage=null,e.close(),null}class C{static async init(t){return e&&!!await b.load(t)}static isLoaded(){return!!e&&b.isLoaded()}static isError(){return!e||b.isError()}static get isSupportMp4(){return n}static get isSupportWebCodesAPI(){return n}static get isSupportWasm(){return e}static async read(t,e){let a=await u(t);return a&&a.byteLength>0&&await this.init()?new Promise((n=>{const i=new MessageChannel;i.port1.onmessage=e=>{if("read"==e.data?.method){const a=v(e.data,i.port1,t instanceof File?t.name:null);n(a?new C(a,i.port1):null)}},w.postMessage({method:"read",mode:e,buffer:a},[i.port2])})):null}static async guessFormat(t){return(t instanceof File||t instanceof Blob)&&(t=await t.arrayBuffer()),await y(t)??""}static async guessType(t){return(t instanceof File||t instanceof Blob)&&(t=await t.arrayBuffer()),await y(t,!0)??""}static async fileHash(t){let e=await u(t);return e&&e.byteLength>0&&await this.init()?new Promise((t=>{const a=new MessageChannel;a.port1.onmessage=e=>{const n="hash"==e.data?.method&&"string"==typeof e.data.hash?e.data.hash.trim():"";a.port1.onmessage=null,a.port1.close(),t(n)},w.postMessage({method:"hash",buffer:e},[a.port2])})):""}#c;#f;#h;constructor(t,e){this.#c=t,this.#h=new m,this.#f=e,this.#f.onmessage=this.#g.bind(this)}close(){this.#c=null,this.#f&&(this.#m("close"),this.#f.close(),this.#f=null),this.#h?.destroy(),this.#h=null}async clone(){const t=this.instance>0?await this.#m("clone"):null;if("number"==typeof t)return new Promise((e=>{const a=new MessageChannel;a.port1.onmessage=t=>{if("clone"==t.data?.method){const n=v(t.data,a.port1,this.#c?.name);e(n?new C(n,a.port1):this)}},w.postMessage({method:"clone",clone:t},[a.port2])}));throw new Error("Instance already closed.")}get instance(){return this.#c?.instance??0}get name(){if(this.#c){let t=this.#c.name||"noname",e=this.format;return e?`${t}.${e}`:t}return""}get hash(){return this.#c?.hash??""}get originalFormat(){return this.#c?.originalFormat??""}get format(){return this.#c?.format??""}get type(){return this.#c?.type??""}get size(){return this.#c?.size??0}get width(){return this.#c?.width??0}get height(){return this.#c?.height??0}get frameCount(){return this.#c?.frameCount??0}get hasAnimation(){return this.frameCount>1}
1get isOpaque(){return this.#c?.isOpaque??!0}get videoCodec(){return this.#c?.videoCodec??""}async removeAnimation(){return!!await this.#m("removeAnimation")}async coalesce(){await this.#m("coalesce")}async resize(t,e){return!!await this.#m("resize",t,e)}async resizeMaxWidth(t){return!!await this.#m("resizeMaxWidth",t)}async resizeMaxHeight(t){return!!await this.#m("resizeMaxHeight",t)}async crop(t,e,a,n){return!!await this.#m("crop",t,e,a,n)}async thumbnail(t,e,a=!1,n="white"){return!!await this.#m("thumbnail",t,e,a,n)}async sticker(){return!!await this.#m("sticker")}async setBackgroundColor(t){return!!await this.#m("setBackgroundColor",t)}async getImageData(){return await this.#m("getImageData")}async save(t,e){const a=await this.#m("save",t,e);return a?new File([a],this.name,{type:this.type}):null}#m(t,...e){return new Promise((a=>{this.#f?this.#f.postMessage({id:this.#h.push(a),method:t,args:e}):a(null)}))}#g(t){this.#f&&("number"==typeof t.data?.id&&!isNaN(t.data.id)&&this.#h?.has(t.data.id)?this.#h.pop(t.data.id)(t.data.result):"update"==t.data?.method&&this.#c&&("number"==typeof t.data.instance&&(this.#c.instance=t.data.instance),"string"==typeof t.data.hash&&(this.#c.hash=t.data.hash),"number"==typeof t.data.size&&(this.#c.size=t.data.size),"number"==typeof t.data.width&&(this.#c.width=t.data.width),"number"==typeof t.data.height&&(this.#c.height=t.data.height),"number"==typeof t.data.originalFormat&&(this.#c.originalFormat=t.data.originalFormat),"string"==typeof t.data.format&&(this.#c.format=t.data.format),"string"==typeof t.data.type&&(this.#c.type=t.data.type),"boolean"==typeof t.data.isOpaque&&(this.#c.isOpaque=t.data.isOpaque),"number"==typeof t.data.frameCount&&(this.#c.frameCount=t.data.frameCount),"string"==typeof t.data.videoCodec&&(this.#c.videoCodec=t.data.videoCodec)))}}globalThis.BlueImage=C,document.dispatchEvent(new CustomEvent("BlueImageLoaded",{detail:{BlueImage:C}}))}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.