2 lines
27 KiB
JavaScript
2 lines
27 KiB
JavaScript
var ae=Object.prototype.hasOwnProperty;var j=Object.getOwnPropertySymbols,re=Object.prototype.propertyIsEnumerable;var g=Object.assign;var V=(a,c)=>{var e={};for(var t in a)ae.call(a,t)&&c.indexOf(t)<0&&(e[t]=a[t]);if(a!=null&&j)for(var t of j(a))c.indexOf(t)<0&&re.call(a,t)&&(e[t]=a[t]);return e};var S=(a,c,e)=>new Promise((t,i)=>{var r=p=>{try{o(e.next(p))}catch(x){i(x)}},s=p=>{try{o(e.throw(p))}catch(x){i(x)}},o=p=>p.done?t(p.value):Promise.resolve(p.value).then(r,s);o((e=e.apply(a,c)).next())});(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[97696],{43347:function(a,c,e){"use strict";e.d(c,{Z:function(){return x}});var t=e(28991),i=e(67294),r={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"},s=r,o=e(27029),p=function(b,w){return i.createElement(o.Z,(0,t.Z)((0,t.Z)({},b),{},{ref:w,icon:s}))};p.displayName="InboxOutlined";var x=i.forwardRef(p)},86027:function(a,c,e){var t,i;(function(r,s){t=s,i=typeof t=="function"?t.call(c,e,c,a):t,i!==void 0&&(a.exports=i)})("fix-webm-duration",function(){var r={172351395:{name:"EBML",type:"Container"},646:{name:"EBMLVersion",type:"Uint"},759:{name:"EBMLReadVersion",type:"Uint"},754:{name:"EBMLMaxIDLength",type:"Uint"},755:{name:"EBMLMaxSizeLength",type:"Uint"},642:{name:"DocType",type:"String"},647:{name:"DocTypeVersion",type:"Uint"},645:{name:"DocTypeReadVersion",type:"Uint"},108:{name:"Void",type:"Binary"},63:{name:"CRC-32",type:"Binary"},190023271:{name:"SignatureSlot",type:"Container"},16010:{name:"SignatureAlgo",type:"Uint"},16026:{name:"SignatureHash",type:"Uint"},16037:{name:"SignaturePublicKey",type:"Binary"},16053:{name:"Signature",type:"Binary"},15963:{name:"SignatureElements",type:"Container"},15995:{name:"SignatureElementList",type:"Container"},9522:{name:"SignedElement",type:"Binary"},139690087:{name:"Segment",type:"Container"},21863284:{name:"SeekHead",type:"Container"},3515:{name:"Seek",type:"Container"},5035:{name:"SeekID",type:"Binary"},5036:{name:"SeekPosition",type:"Uint"},88713574:{name:"Info",type:"Container"},13220:{name:"SegmentUID",type:"Binary"},13188:{name:"SegmentFilename",type:"String"},1882403:{name:"PrevUID",type:"Binary"},1868715:{name:"PrevFilename",type:"String"},2013475:{name:"NextUID",type:"Binary"},1999803:{name:"NextFilename",type:"String"},1092:{name:"SegmentFamily",type:"Binary"},10532:{name:"ChapterTranslate",type:"Container"},10748:{name:"ChapterTranslateEditionUID",type:"Uint"},10687:{name:"ChapterTranslateCodec",type:"Uint"},10661:{name:"ChapterTranslateID",type:"Binary"},710577:{name:"TimecodeScale",type:"Uint"},1161:{name:"Duration",type:"Float"},1121:{name:"DateUTC",type:"Date"},15273:{name:"Title",type:"String"},3456:{name:"MuxingApp",type:"String"},5953:{name:"WritingApp",type:"String"},103:{name:"Timecode",type:"Uint"},6228:{name:"SilentTracks",type:"Container"},6359:{name:"SilentTrackNumber",type:"Uint"},39:{name:"Position",type:"Uint"},43:{name:"PrevSize",type:"Uint"},35:{name:"SimpleBlock",type:"Binary"},32:{name:"BlockGroup",type:"Container"},33:{name:"Block",type:"Binary"},34:{name:"BlockVirtual",type:"Binary"},13729:{name:"BlockAdditions",type:"Container"},38:{name:"BlockMore",type:"Container"},110:{name:"BlockAddID",type:"Uint"},37:{name:"BlockAdditional",type:"Binary"},27:{name:"BlockDuration",type:"Uint"},122:{name:"ReferencePriority",type:"Uint"},123:{name:"ReferenceBlock",type:"Int"},125:{name:"ReferenceVirtual",type:"Int"},36:{name:"CodecState",type:"Binary"},13730:{name:"DiscardPadding",type:"Int"},14:{name:"Slices",type:"Container"},104:{name:"TimeSlice",type:"Container"},76:{name:"LaceNumber",type:"Uint"},77:{name:"FrameNumber",type:"Uint"},75:{name:"BlockAdditionID",type:"Uint"},78:{name:"Delay",type:"Uint"},79:{name:"SliceDuration",type:"Uint"},72:{name:"ReferenceFrame",type:"Container"},73:{name:"ReferenceOffset",type:"Uint"},74:{name:"ReferenceTimeCode",type:"Uint"},47:{name:"EncryptedBlock",type:"Binary"},106212971:{name:"Tracks",type:"Container"},46:{name:"TrackEntry",type:"Container"},87:{name:"TrackNumber",type:"Uint"},13253:{name:"TrackUID",type:"Uint"},3:{name:"TrackType",type:"Uint"},57:{name:"FlagEnabled",type:"Uint"},8:{name:"FlagDefault",type:"Uint"},5546:{name:"FlagForced",type:"Uint"},28:{name:"FlagLacing",type:"Uint"},11751:{name:"MinCache",type:"Uint"},11768:{name:"MaxCache",type:"Uint"},254851:{name:"DefaultDuration",type:"Uint"},216698:{name:"DefaultDecodedFieldDuration",type:"Uint"},209231:{name:"TrackTimecodeScale",type:"Float"},4991:{name:"TrackOffset",type:"Int"},5614:{name:"MaxBlockAdditionID",type:"Uint"},4974:{name:"Name",type:"String"},177564:{name:"Language",type:"String"},6:{name:"CodecID",type:"String"},9122:{name:"CodecPrivate",type:"Binary"},362120:{name:"CodecName",type:"String"},13382:{name:"AttachmentLink",type:"Uint"},1742487:{name:"CodecSettings",type:"String"},1785920:{name:"CodecInfoURL",type:"String"},438848:{name:"CodecDownloadURL",type:"String"},42:{name:"CodecDecodeAll",type:"Uint"},12203:{name:"TrackOverlay",type:"Uint"},5802:{name:"CodecDelay",type:"Uint"},5819:{name:"SeekPreRoll",type:"Uint"},9764:{name:"TrackTranslate",type:"Container"},9980:{name:"TrackTranslateEditionUID",type:"Uint"},9919:{name:"TrackTranslateCodec",type:"Uint"},9893:{name:"TrackTranslateTrackID",type:"Binary"},96:{name:"Video",type:"Container"},26:{name:"FlagInterlaced",type:"Uint"},5048:{name:"StereoMode",type:"Uint"},5056:{name:"AlphaMode",type:"Uint"},5049:{name:"OldStereoMode",type:"Uint"},48:{name:"PixelWidth",type:"Uint"},58:{name:"PixelHeight",type:"Uint"},5290:{name:"PixelCropBottom",type:"Uint"},5307:{name:"PixelCropTop",type:"Uint"},5324:{name:"PixelCropLeft",type:"Uint"},5341:{name:"PixelCropRight",type:"Uint"},5296:{name:"DisplayWidth",type:"Uint"},5306:{name:"DisplayHeight",type:"Uint"},5298:{name:"DisplayUnit",type:"Uint"},5299:{name:"AspectRatioType",type:"Uint"},963876:{name:"ColourSpace",type:"Binary"},1029411:{name:"GammaValue",type:"Float"},230371:{name:"FrameRate",type:"Float"},97:{name:"Audio",type:"Container"},53:{name:"SamplingFrequency",type:"Float"},14517:{name:"OutputSamplingFrequency",type:"Float"},31:{name:"Channels",type:"Uint"},15739:{name:"ChannelPositions",type:"Binary"},8804:{name:"BitDepth",type:"Uint"},98:{name:"TrackOperation",type:"Container"},99:{name:"TrackCombinePlanes",type:"Container"},100:{name:"TrackPlane",type:"Container"},101:{name:"TrackPlaneUID",type:"Uint"},102:{name:"TrackPlaneType",type:"Uint"},105:{name:"TrackJoinBlocks",type:"Container"},109:{name:"TrackJoinUID",type:"Uint"},64:{name:"TrickTrackUID",type:"Uint"},65:{name:"TrickTrackSegmentUID",type:"Binary"},70:{name:"TrickTrackFlag",type:"Uint"},71:{name:"TrickMasterTrackUID",type:"Uint"},68:{name:"TrickMasterTrackSegmentUID",type:"Binary"},11648:{name:"ContentEncodings",type:"Container"},8768:{name:"ContentEncoding",type:"Container"},4145:{name:"ContentEncodingOrder",type:"Uint"},4146:{name:"ContentEncodingScope",type:"Uint"},4147:{name:"ContentEncodingType",type:"Uint"},4148:{name:"ContentCompression",type:"Container"},596:{name:"ContentCompAlgo",type:"Uint"},597:{name:"ContentCompSettings",type:"Binary"},4149:{name:"ContentEncryption",type:"Container"},2017:{name:"ContentEncAlgo",type:"Uint"},2018:{name:"ContentEncKeyID",type:"Binary"},2019:{name:"ContentSignature",type:"Binary"},2020:{name:"ContentSigKeyID",type:"Binary"},2021:{name:"ContentSigAlgo",type:"Uint"},2022:{name:"ContentSigHashAlgo",type:"Uint"},206814059:{name:"Cues",type:"Container"},59:{name:"CuePoint",type:"Container"},51:{name:"CueTime",type:"Uint"},55:{name:"CueTrackPositions",type:"Container"},119:{name:"CueTrack",type:"Uint"},113:{name:"CueClusterPosition",type:"Uint"},112:{name:"CueRelativePosition",type:"Uint"},50:{name:"CueDuration",type:"Uint"},4984:{name:"CueBlockNumber",type:"Uint"},106:{name:"CueCodecState",type:"Uint"},91:{name:"CueReference",type:"Container"},22:{name:"CueRefTime",type:"Uint"},23:{name:"CueRefCluster",type:"Uint"},4959:{name:"CueRefNumber",type:"Uint"},107:{name:"CueRefCodecState",type:"Uint"},155296873:{name:"Attachments",type:"Container"},8615:{name:"AttachedFile",type:"Container"},1662:{name:"FileDescription",type:"String"},1646:{name:"FileName",type:"String"},1632:{name:"FileMimeType",type:"String"},1628:{name:"FileData",type:"Binary"},1710:{name:"FileUID",type:"Uint"},1653:{name:"FileReferral",type:"Binary"},1633:{name:"FileUsedStartTime",type:"Uint"},1634:{name:"FileUsedEndTime",type:"Uint"},4433776:{name:"Chapters",type:"Container"},1465:{name:"EditionEntry",type:"Container"},1468:{name:"EditionUID",type:"Uint"},1469:{name:"EditionFlagHidden",type:"Uint"},1499:{name:"EditionFlagDefault",type:"Uint"},1501:{name:"EditionFlagOrdered",type:"Uint"},54:{name:"ChapterAtom",type:"Container"},13252:{name:"ChapterUID",type:"Uint"},5716:{name:"ChapterStringUID",type:"String"},17:{name:"ChapterTimeStart",type:"Uint"},18:{name:"ChapterTimeEnd",type:"Uint"},24:{name:"ChapterFlagHidden",type:"Uint"},1432:{name:"ChapterFlagEnabled",type:"Uint"},11879:{name:"ChapterSegmentUID",type:"Binary"},11964:{name:"ChapterSegmentEditionUID",type:"Uint"},9155:{name:"ChapterPhysicalEquiv",type:"Uint"},15:{name:"ChapterTrack",type:"Container"},9:{name:"ChapterTrackNumber",type:"Uint"},0:{name:"ChapterDisplay",type:"Container"},5:{name:"ChapString",type:"String"},892:{name:"ChapLanguage",type:"String"},894:{name:"ChapCountry",type:"String"},10564:{name:"ChapProcess",type:"Container"},10581:{name:"ChapProcessCodecID",type:"Uint"},1293:{name:"ChapProcessPrivate",type:"Binary"},10513:{name:"ChapProcessCommand",type:"Container"},10530:{name:"ChapProcessTime",type:"Uint"},10547:{name:"ChapProcessData",type:"Binary"},39109479:{name:"Tags",type:"Container"},13171:{name:"Tag",type:"Container"},9152:{name:"Targets",type:"Container"},10442:{name:"TargetTypeValue",type:"Uint"},9162:{name:"TargetType",type:"String"},9157:{name:"TagTrackUID",type:"Uint"},9161:{name:"TagEditionUID",type:"Uint"},9156:{name:"TagChapterUID",type:"Uint"},9158:{name:"TagAttachmentUID",type:"Uint"},10184:{name:"SimpleTag",type:"Container"},1443:{name:"TagName",type:"String"},1146:{name:"TagLanguage",type:"String"},1156:{name:"TagDefault",type:"Uint"},1159:{name:"TagString",type:"String"},1157:{name:"TagBinary",type:"Binary"}};function s(n,l){n.prototype=Object.create(l.prototype),n.prototype.constructor=n}function o(n,l){this.name=n||"Unknown",this.type=l||"Unknown"}o.prototype.updateBySource=function(){},o.prototype.setSource=function(n){this.source=n,this.updateBySource()},o.prototype.updateByData=function(){},o.prototype.setData=function(n){this.data=n,this.updateByData()};function p(n,l){o.call(this,n,l||"Uint")}s(p,o);function x(n){return n.length%2==1?"0"+n:n}p.prototype.updateBySource=function(){this.data="";for(var n=0;n<this.source.length;n++){var l=this.source[n].toString(16);this.data+=x(l)}},p.prototype.updateByData=function(){var n=this.data.length/2;this.source=new Uint8Array(n);for(var l=0;l<n;l++){var y=this.data.substr(l*2,2);this.source[l]=parseInt(y,16)}},p.prototype.getValue=function(){return parseInt(this.data,16)},p.prototype.setValue=function(n){this.setData(x(n.toString(16)))};function h(n,l){o.call(this,n,l||"Float")}s(h,o),h.prototype.getFloatArrayType=function(){return this.source&&this.source.length===4?Float32Array:Float64Array},h.prototype.updateBySource=function(){var n=this.source.reverse(),l=this.getFloatArrayType(),y=new l(n.buffer);this.data=y[0]},h.prototype.updateByData=function(){var n=this.getFloatArrayType(),l=new n([this.data]),y=new Uint8Array(l.buffer);this.source=y.reverse()},h.prototype.getValue=function(){return this.data},h.prototype.setValue=function(n){this.setData(n)};function b(n,l){o.call(this,n,l||"Container")}s(b,o),b.prototype.readByte=function(){return this.source[this.offset++]},b.prototype.readUint=function(){for(var n=this.readByte(),l=8-n.toString(2).length,y=n-(1<<7-l),U=0;U<l;U++)y*=256,y+=this.readByte();return y},b.prototype.updateBySource=function(){for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=y){var n=this.readUint(),l=this.readUint(),y=Math.min(this.offset+l,this.source.length),U=this.source.slice(this.offset,y),m=r[n]||{name:"Unknown",type:"Unknown"},f=o;switch(m.type){case"Container":f=b;break;case"Uint":f=p;break;case"Float":f=h;break}var C=new f(m.name,m.type);C.setSource(U),this.data.push({id:n,idHex:n.toString(16),data:C})}},b.prototype.writeUint=function(n,l){for(var y=1,U=128;n>=U&&y<8;y++,U*=128);if(!l)for(var m=U+n,f=y-1;f>=0;f--){var C=m%256;this.source[this.offset+f]=C,m=(m-C)/256}this.offset+=y},b.prototype.writeSections=function(n){this.offset=0;for(var l=0;l<this.data.length;l++){var y=this.data[l],U=y.data.source,m=U.length;this.writeUint(y.id,n),this.writeUint(m,n),n||this.source.set(U,this.offset),this.offset+=m}return this.offset},b.prototype.updateByData=function(){var n=this.writeSections("draft");this.source=new Uint8Array(n),this.writeSections()},b.prototype.getSectionById=function(n){for(var l=0;l<this.data.length;l++){var y=this.data[l];if(y.id===n)return y.data}return null};function w(n){b.call(this,"File","File"),this.setSource(n)}s(w,b),w.prototype.fixDuration=function(n,l){var y=l&&l.logger;y===void 0?y=function(B){console.log(B)}:y||(y=function(){});var U=this.getSectionById(139690087);if(!U)return y("[fix-webm-duration] Segment section is missing"),!1;var m=U.getSectionById(88713574);if(!m)return y("[fix-webm-duration] Info section is missing"),!1;var f=m.getSectionById(710577);if(!f)return y("[fix-webm-duration] TimecodeScale section is missing"),!1;var C=m.getSectionById(1161);if(C)if(C.getValue()<=0)y("[fix-webm-duration] Duration section is present, but the value is empty"),C.setValue(n);else return y("[fix-webm-duration] Duration section is present"),!1;else y("[fix-webm-duration] Duration section is missing"),C=new h("Duration","Float"),C.setValue(n),m.data.push({id:1161,data:C});return f.setValue(1e6),m.updateByData(),U.updateByData(),this.updateByData(),!0},w.prototype.toBlob=function(n){return new Blob([this.source.buffer],{type:n||"video/webm"})};function k(n,l,y,U){if(typeof y=="object"&&(U=y,y=void 0),!y)return new Promise(function(f){k(n,l,f,U)});try{var m=new FileReader;m.onloadend=function(){try{var f=new w(new Uint8Array(m.result));f.fixDuration(l,U)&&(n=f.toBlob(n.type))}catch(C){}y(n)},m.readAsArrayBuffer(n)}catch(f){y(n)}}return k.default=k,k})},59134:function(a,c,e){var t=e(34155);function i(){return typeof window!="undefined"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof t!="undefined"&&typeof t.versions=="object"&&!!t.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0}a.exports=i},22413:function(a){"use strict";a.exports=JSON.parse('{"name":"tesseract.js","version":"4.1.1","description":"Pure Javascript Multilingual OCR","main":"src/index.js","types":"src/index.d.ts","unpkg":"dist/tesseract.min.js","jsdelivr":"dist/tesseract.min.js","scripts":{"start":"node scripts/server.js","build":"rimraf dist && webpack --config scripts/webpack.config.prod.js && rollup -c scripts/rollup.esm.mjs","profile:tesseract":"webpack-bundle-analyzer dist/tesseract-stats.json","profile:worker":"webpack-bundle-analyzer dist/worker-stats.json","prepublishOnly":"npm run build","wait":"rimraf dist && wait-on http://localhost:3000/dist/tesseract.dev.js","test":"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:* test:node:all","test:node":"nyc mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser-tpl":"mocha-headless-chrome -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:detect":"npm run test:browser-tpl -- -f ./tests/detect.test.html","test:browser:recognize":"npm run test:browser-tpl -- -f ./tests/recognize.test.html","test:browser:scheduler":"npm run test:browser-tpl -- -f ./tests/scheduler.test.html","test:browser:FS":"npm run test:browser-tpl -- -f ./tests/FS.test.html","lint":"eslint src","lint:fix":"eslint --fix src","postinstall":"opencollective-postinstall || true"},"browser":{"./src/worker/node/index.js":"./src/worker/browser/index.js"},"author":"","contributors":["jeromewu"],"license":"Apache-2.0","devDependencies":{"@babel/core":"^7.21.4","@babel/eslint-parser":"^7.21.3","@babel/preset-env":"^7.21.4","@rollup/plugin-commonjs":"^24.1.0","acorn":"^8.8.2","babel-loader":"^9.1.2","buffer":"^6.0.3","cors":"^2.8.5","eslint":"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.27.5","expect.js":"^0.3.1","express":"^4.18.2","mocha":"^10.2.0","mocha-headless-chrome":"^4.0.0","npm-run-all":"^4.1.5","nyc":"^15.1.0","rimraf":"^5.0.0","rollup":"^3.20.7","wait-on":"^7.0.1","webpack":"^5.79.0","webpack-bundle-analyzer":"^4.8.0","webpack-cli":"^5.0.1","webpack-dev-middleware":"^6.0.2","rollup-plugin-sourcemaps":"^0.6.3"},"dependencies":{"bmp-js":"^0.1.0","idb-keyval":"^6.2.0","is-electron":"^2.2.2","is-url":"^1.2.4","node-fetch":"^2.6.9","opencollective-postinstall":"^2.0.3","regenerator-runtime":"^0.13.3","tesseract.js-core":"^4.0.4","wasm-feature-detect":"^1.2.11","zlibjs":"^0.3.1"},"overrides":{"@rollup/pluginutils":"^5.0.2"},"repository":{"type":"git","url":"https://github.com/naptha/tesseract.js.git"},"bugs":{"url":"https://github.com/naptha/tesseract.js/issues"},"homepage":"https://github.com/naptha/tesseract.js","collective":{"type":"opencollective","url":"https://opencollective.com/tesseractjs"}}')},70181:function(a,c,e){const t=e(51158),i=(s,o,p)=>S(this,null,function*(){const x=yield t(p);return yield x.loadLanguage(o),yield x.initialize(o),x.recognize(s).finally(()=>S(this,null,function*(){yield x.terminate()}))}),r=(s,o)=>S(this,null,function*(){const p=yield t(o);return yield p.loadLanguage("osd"),yield p.initialize("osd"),p.detect(s).finally(()=>S(this,null,function*(){yield p.terminate()}))});a.exports={recognize:i,detect:r}},6308:function(a){a.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}},87895:function(a){a.exports={OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12",RAW_LINE:"13"}},79154:function(a,c,e){const t=e(6308);a.exports={defaultOEM:t.DEFAULT}},8720:function(a){a.exports={langPath:"https://tessdata.projectnaptha.com/4.0.0",workerBlobURL:!0,logger:()=>{}}},79520:function(a){a.exports={AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"}},94314:function(a,c,e){const t=e(55504);let i=0;a.exports=({id:r,action:s,payload:o={}})=>{let p=r;return typeof p=="undefined"&&(p=t("Job",i),i+=1),{id:p,action:s,payload:o}}},77877:function(a,c,e){const t=e(94314),{log:i}=e(63486),r=e(55504);let s=0;a.exports=()=>{const o=r("Scheduler",s),p={},x={};let h=[];s+=1;const b=()=>h.length,w=()=>Object.keys(p).length,k=()=>{if(h.length!==0){const m=Object.keys(p);for(let f=0;f<m.length;f+=1)if(typeof x[m[f]]=="undefined"){h[0](p[m[f]]);break}}},n=(m,f)=>new Promise((C,B)=>{const I=t({action:m,payload:f});h.push(R=>S(this,null,function*(){h.shift(),x[R.id]=I;try{C(yield R[m].apply(this,[...f,I.id]))}catch(F){B(F)}finally{delete x[R.id],k()}})),i(`[${o}]: Add ${I.id} to JobQueue`),i(`[${o}]: JobQueue length=${h.length}`),k()});return{addWorker:m=>(p[m.id]=m,i(`[${o}]: Add ${m.id}`),i(`[${o}]: Number of workers=${w()}`),k(),m.id),addJob:(m,...f)=>S(this,null,function*(){if(w()===0)throw Error(`[${o}]: You need to have at least one worker before adding jobs`);return n(m,f)}),terminate:()=>S(this,null,function*(){Object.keys(p).forEach(m=>S(this,null,function*(){yield p[m].terminate()})),h=[]}),getQueueLen:b,getNumWorkers:w}}},51158:function(a,c,e){const t=e(51937),i=e(93634),r=e(94314),{log:s}=e(63486),o=e(55504),{defaultOEM:p}=e(79154),{defaultOptions:x,spawnWorker:h,terminateWorker:b,onMessage:w,loadImage:k,send:n}=e(27534);let l=0;a.exports=(...U)=>S(this,[...U],function*(y={}){const m=o("Worker",l),M=t(g(g({},x),y)),{logger:f,errorHandler:C}=M,B=V(M,["logger","errorHandler"]),I={},R={};let F,O;const W=new Promise((d,u)=>{O=d,F=u}),z=d=>{F(d.message)};let A=h(B);A.onerror=z,l+=1;const P=(d,u)=>{I[d]=u},N=(d,u)=>{R[d]=u},D=({id:d,action:u,payload:T})=>new Promise((v,E)=>{s(`[${m}]: Start ${d}, action=${u}`),P(u,v),N(u,E),n(A,{workerId:m,jobId:d,action:u,payload:T})}),H=()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),K=d=>D(r({id:d,action:"load",payload:{options:B}})),$=(d,u,T)=>D(r({id:T,action:"FS",payload:{method:"writeFile",args:[d,u]}})),G=(d,u)=>D(r({id:u,action:"FS",payload:{method:"readFile",args:[d,{encoding:"utf8"}]}})),J=(d,u)=>D(r({id:u,action:"FS",payload:{method:"unlink",args:[d]}})),Y=(d,u,T)=>D(r({id:T,action:"FS",payload:{method:d,args:u}})),Z=(d="eng",u)=>D(r({id:u,action:"loadLanguage",payload:{langs:d,options:B}})),Q=(d="eng",u=p,T,v)=>D(r({id:v,action:"initialize",payload:{langs:d,oem:u,config:T}})),X=(d={},u)=>D(r({id:u,action:"setParameters",payload:{params:d}})),_=(E,...L)=>S(this,[E,...L],function*(d,u={},T={blocks:!0,text:!0,hocr:!0,tsv:!0},v){return D(r({id:v,action:"recognize",payload:{image:yield k(d),options:u,output:T}}))}),q=(d="Tesseract OCR Result",u=!1,T)=>(console.log("`getPDF` function is depreciated. `recognize` option `savePDF` should be used instead."),D(r({id:T,action:"getPDF",payload:{title:d,textonly:u}}))),ee=(d,u)=>S(this,null,function*(){return D(r({id:u,action:"detect",payload:{image:yield k(d)}}))}),te=()=>S(this,null,function*(){return A!==null&&(b(A),A=null),Promise.resolve()});w(A,({workerId:d,jobId:u,status:T,action:v,data:E})=>{if(T==="resolve"){s(`[${d}]: Complete ${u}`);let L=E;v==="recognize"?L=i(E):v==="getPDF"&&(L=Array.from(g(g({},E),{length:Object.keys(E).length}))),I[v]({jobId:u,data:L})}else if(T==="reject")if(R[v](E),v==="load"&&F(E),C)C(E);else throw Error(E);else T==="progress"&&f(g(g({},E),{userJobId:u}))});const ne={id:m,worker:A,setResolve:P,setReject:N,load:H,writeText:$,readText:G,removeFile:J,FS:Y,loadLanguage:Z,initialize:Q,setParameters:X,recognize:_,getPDF:q,detect:ee,terminate:te};return K().then(()=>O(ne)).catch(()=>{}),W})},7320:function(a,c,e){e(17445);const t=e(77877),i=e(51158),r=e(70181),s=e(79520),o=e(6308),p=e(87895),{setLogging:x}=e(63486);a.exports=g({languages:s,OEM:o,PSM:p,createScheduler:t,createWorker:i,setLogging:x},r)},93634:function(a){a.exports=c=>{const e=[],t=[],i=[],r=[],s=[];return c.blocks&&c.blocks.forEach(o=>{o.paragraphs.forEach(p=>{p.lines.forEach(x=>{x.words.forEach(h=>{h.symbols.forEach(b=>{s.push(g(g({},b),{page:c,block:o,paragraph:p,line:x,word:h}))}),r.push(g(g({},h),{page:c,block:o,paragraph:p,line:x}))}),i.push(g(g({},x),{page:c,block:o,paragraph:p}))}),t.push(g(g({},p),{page:c,block:o}))}),e.push(g(g({},o),{page:c}))}),g(g({},c),{blocks:e,paragraphs:t,lines:i,words:r,symbols:s})}},56376:function(a,c,e){var t=e(34155);const i=e(59134);a.exports=r=>{const s={};return typeof WorkerGlobalScope!="undefined"?s.type="webworker":i()?s.type="electron":typeof window=="object"?s.type="browser":typeof t=="object"&&(s.type="node"),typeof r=="undefined"?s:s[r]}},55504:function(a){a.exports=(c,e)=>`${c}-${e}-${Math.random().toString(16).slice(3,8)}`},63486:function(a,c){let e=!1;c.logging=e,c.setLogging=t=>{e=t},c.log=(...t)=>e?console.log.apply(this,t):null},51937:function(a,c,e){const i=e(56376)("type")==="browser"?r=>new URL(r,window.location.href).href:r=>r;a.exports=r=>{const s=g({},r);return["corePath","workerPath","langPath"].forEach(o=>{r[o]&&(s[o]=i(s[o]))}),s}},84040:function(a,c,e){var t=e(34155);const i=o=>new URL(o,window.location.href).href,{version:r}=e(22413),s=e(8720);a.exports=g(g({},s),{workerPath:typeof t!="undefined"&&{NODE_ENV:"production",SOCKET_SERVER:"http://127.0.0.1:8000"}.TESS_ENV==="development"?i(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`):`https://cdn.jsdelivr.net/npm/tesseract.js@v${r}/dist/worker.min.js`,corePath:null})},27534:function(a,c,e){const t=e(84040),i=e(91005),r=e(60025),s=e(9804),o=e(57247),p=e(41196);a.exports={defaultOptions:t,spawnWorker:i,terminateWorker:r,onMessage:s,send:o,loadImage:p}},41196:function(a){const c=t=>new Promise((i,r)=>{const s=new FileReader;s.onload=()=>{i(s.result)},s.onerror=({target:{error:{code:o}}})=>{r(Error(`File could not be read! Code=${o}`))},s.readAsArrayBuffer(t)}),e=t=>S(this,null,function*(){let i=t;if(typeof t=="undefined")return"undefined";if(typeof t=="string")/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(t)?i=atob(t.split(",")[1]).split("").map(r=>r.charCodeAt(0)):i=yield(yield fetch(t)).arrayBuffer();else if(typeof HTMLElement!="undefined"&&t instanceof HTMLElement)t.tagName==="IMG"&&(i=yield e(t.src)),t.tagName==="VIDEO"&&(i=yield e(t.poster)),t.tagName==="CANVAS"&&(yield new Promise(r=>{t.toBlob(s=>S(this,null,function*(){i=yield c(s),r()}))}));else if(typeof OffscreenCanvas!="undefined"&&t instanceof OffscreenCanvas){const r=yield t.convertToBlob();i=yield c(r)}else(t instanceof File||t instanceof Blob)&&(i=yield c(t));return new Uint8Array(i)});a.exports=e},9804:function(a){a.exports=(c,e)=>{c.onmessage=({data:t})=>{e(t)}}},57247:function(a){a.exports=(c,e)=>S(this,null,function*(){c.postMessage(e)})},91005:function(a){a.exports=({workerPath:c,workerBlobURL:e})=>{let t;if(Blob&&URL&&e){const i=new Blob([`importScripts("${c}");`],{type:"application/javascript"});t=new Worker(URL.createObjectURL(i))}else t=new Worker(c);return t}},60025:function(a){a.exports=c=>{c.terminate()}}}]);
|