1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4523],{34523:(e,t,a)=>{a.d(t,{Lo:()=>h,XZ:()=>d,p0:()=>s,vA:()=>u});let l=null;async function n(){return l||(l=await Promise.all([a.e(3690),a.e(272),a.e(3660),a.e(5056),a.e(7087),a.e(6251),a.e(2674),a.e(7164),a.e(3209)]).then(a.bind(a,92779))),l}let r=null,i=[],o=null;async function c(){if(!r||!(i.length>0))return o||(o=(async()=>{try{let e=await n();await e.ready(),r=await e.loadGraphModel("/models/dakanji_tfjs/model.json");let t=await fetch("/models/labels.txt");i=[...await t.text()];try{let t=e.zeros([1,64,64,1]),a=r.execute(t,"Identity:0");await a.data(),t.dispose(),a.dispose()}catch(e){}}catch(e){throw console.error("[kanjiRecognizer] ëª¨ë¸ ë¡ë ì¤í¨:",e),o=null,e}})())}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;try{await c();let a=await n();if(!r)return[];let l=function(e){let t=e.getContext("2d");if(!t)return e;let{width:a,height:l}=e,n=t.getImageData(0,0,a,l).data,r=a,i=l,o=0,c=0,u=!1;for(let e=0;e<l;e++)for(let t=0;t<a;t++){let l=(e*a+t)*4;(n[l]<250||n[l+1]<250||n[l+2]<250)&&(r=Math.min(r,t),i=Math.min(i,e),o=Math.max(o,t),c=Math.max(c,e),u=!0)}if(!u)return e;let s=.2*Math.max(o-r,c-i);r=Math.max(0,r-s),i=Math.max(0,i-s);let d=(o=Math.min(a,o+s))-r,h=Math.max(d,(c=Math.min(l,c+s))-i),f=(r+o)/2-h/2,m=(i+c)/2-h/2,w=document.createElement("canvas");w.width=224,w.height=224;let p=w.getContext("2d");return p.fillStyle="white",p.fillRect(0,0,224,224),p.drawImage(e,f,m,h,h,0,0,224,224),w}(e),o=[],u=a.browser.fromPixels(l,1);o.push(u);let s=a.sub(255,u);o.push(s);let d=s.toFloat();o.push(d);let h=d.expandDims(0);o.push(h);let f=r.execute(h,"Identity:0");o.push(f);let m=await f.data();return o.forEach(e=>e.dispose()),Array.from(m).map((e,t)=>({prob:e,idx:t})).sort((e,t)=>t.prob-e.prob).slice(0,t).map(e=>e.idx).map(e=>i[e]||"")}catch(e){return console.error("[kanjiRecognizer] ì¸ì ì¤í¨:",e),[]}}function s(){if(d()||o)return()=>{};let e=navigator.connection;if((null==e?void 0:e.saveData)||(null==e?void 0:e.effectiveType)&&["slow-2g","2g","3g"].includes(e.effectiveType))return()=>{};let t=window,a=!1,l=()=>{a||h()};if(t.requestIdleCallback){let e=t.requestIdleCallback(l,{timeout:1200});return()=>{var l;a=!0,null==(l=t.cancelIdleCallback)||l.call(t,e)}}let n=window.setTimeout(l,600);return()=>{a=!0,window.clearTimeout(n)}}function d(){return!!r&&i.length>0}async function h(){try{await c()}catch(e){console.error("[kanjiRecognizer] ì¬ì ë¡ë ì¤í¨:",e)}}}}]);
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.