PageSourceSearch

https://bo3.gg/_nuxt/Cy5LMMtu.js

js bo3.gg collected 2026-10-02 04:35:49 UTC 30,008 bytes, 35 lines download raw bytes

1import{i as D}from"./crqBNO2U.js";import{F as C,H as O,I as y,Jt as I,Kt as P,N as U,pt as B,q as x,st as b}from"./DcGtCD8U.js";x(),P();var T=e=>{const t=new XMLHttpRequest;return t.open(e.method||"GET",e.url),t.responseType="json",e.headers&&Object.keys(e.headers).forEach(s=>{t.setRequestHeader(s,e.headers[s])}),t},N=(e,t)=>new Promise((s,i)=>{e.onload=()=>{if(e.status>=200&&e.status<300){let r;try{r=JSON.parse(e.response)}catch{r=e.response}s(r)}else i(e.response)},e.onerror=()=>i(e.response),e.onabort=()=>i(new Error("abort")),e.ontimeout=()=>i(new Error("timeout")),e.send(JSON.stringify(t))}),z=(e,t)=>new Promise((s,i)=>{const r=new FormData;for(const a in t){const o=t[a];o&&typeof o=="object"&&!(typeof Blob<"u"&&o instanceof Blob)?r.append(a,JSON.stringify(o)):o!=null&&r.append(a,o)}e.onload=()=>{if(e.status>=200&&e.status<300){let a;try{a=JSON.parse(e.response)}catch{a=e.response}s(a)}else i(e.response)},e.onerror=()=>i(e.response),e.onabort=()=>i(new Error("abort")),e.ontimeout=()=>i(new Error("timeout")),e.send(r)});function E(e){const t=T(e);return N(t,e.body)}var M=3e3;function v(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}var A=class{constructor(e=M){this.windowMs=e,this.totalBytes=0,this.samples=[],this.lastPublishedAt=null}start(e=v()){this.samples.length||(this.samples.push({time:e,bytes:this.totalBytes}),this.lastPublishedAt=e)}add(e,t=v()){return this.start(t),Number.isFinite(e)&&e>0&&(this.totalBytes+=e),this.measure(t)}tick(e=v()){return this.start(e),this.measure(e)}shouldPublish(e=1e3){if(!this.samples.length)return!1;const t=this.samples[this.samples.length-1].time;return t-this.lastPublishedAt<e?!1:(this.lastPublishedAt=t,!0)}measure(e){const t=this.samples[this.samples.length-1],s=Math.max(t.time,e);s===t.time?t.bytes=this.totalBytes:this.samples.push({time:s,bytes:this.totalBytes});const i=s-this.windowMs;for(;this.samples.length>2&&this.samples[1].time<=i;)this.samples.shift();const r=this.samples[0],a=this.samples[1];let o=r.time,n=r.bytes;if(r.time<i&&a){const u=a.time-r.time,d=u>0?(i-r.time)/u:1;o=i,n=r.bytes+(a.bytes-r.bytes)*d}const l=s-o;return l<=0?0:Math.max(0,Math.round((this.totalBytes-n)*1e3/l))}},j=class{constructor(e,t){this.file=e,this.options=t,this.chunks=[],this.sessionId=null,this.chunkSize=null,this.speedometer=null,this.lastTransferSpeed=0,this.finishing=!1,this.settled=!1,this.paused=!1,this.resuming=!1}get maxRetries(){const e=parseInt(this.options.maxRetries,10);return Number.isFinite(e)&&e>=0?e:0}get maxActiveChunks(){const e=parseInt(this.options.maxActive,10);return Number.isFinite(e)&&e>0?e:1}get fileType(){return this.file.type}get fileSize(){return this.file.size}get fileName(){return this.file.name}get action(){return this.options.action||null}get startBody(){return this.options.startBody||{}}get uploadBody(){return this.options.uploadBody||{}}get finishBody(){return this.options.finishBody||{}}get headers(){return this.options.headers||{}}get readyToUpload(){return this.chunks.length>0}get progress(){if(!this.chunks.length||!this.fileSize)return 0;const e=this.chunks.reduce((t,s)=>s.uploaded?t+s.blob.size:s.active?t+Math.min(s.loaded||0,s.blob.size):t,0);return Math.min(e/this.fileSize*100,100)}get chunksToUpload(){return this.chunks.filter(e=>!e.active&&!e.uploaded)}get hasChunksToUpload(){return this.chunksToUpload.length>0}get chunksUploading(){return this.chunks.filter(e=>!!e.xhr&&!!e.active)}get chunksUploaded(){return this.chunks.filter(e=>!!e.uploaded)}createChunks(){this.chunks=[];let e=0,t=this.chunkSize;for(;e<this.fileSize;)this.chunks.push({blob:this.file.file.slice(e,t),startOffset:e,active:!1,loaded:0,transferred:0,retries:this.maxRetries}),e=t,t=e+this.chunkSize}updateFileProgress(){this.file.progress=this.progress}pause(){this.paused=!0;const e=this.options.onPause?.(this.file);e?this.file=e:this.file.active=!1,this.stopChunks()}stopChunks(){this.chunksUploading.forEach(e=>{e.xhr.abort(),e.active=!1}),this.stopSpeedCalc()}resume(){if(this.settled)return;this.resuming=!0,this.paused=!1;const e=this.options.onResume?.(this.file);e?this.file=e:this.file.active=!0,this.resuming=!1,this.startChunking()}upload(){if(this.promise)return this.promise;this.promise=new Promise((e,t)=>
1{this.resolve=s=>{this.settled||(this.settled=!0,this.stopSpeedCalc(),e(s))},this.reject=s=>{this.settled||(this.settled=!0,this.stopChunks(),t(s))}});try{this.start()}catch(e){this.reject(e)}return this.promise}start(){if(!this.action)return this.reject("action");E({method:"POST",headers:{...this.headers,"Content-Type":"application/json"},url:this.action,body:{...this.startBody,phase:"start",mime_type:this.fileType,size:this.fileSize,name:this.fileName}}).then(e=>{if(this.settled)return;if(e.status!=="success")return this.file.response=e,this.reject("server");const t=Number(e.data?.end_offset),s=e.data?.session_id;if(!Number.isFinite(t)||t<=0||s===null||s===void 0||s==="")return this.file.response=e,this.reject("server");this.sessionId=s,this.chunkSize=t,this.createChunks(),this.file.active&&this.startChunking()}).catch(e=>{this.settled||(this.file.response=e,this.reject("server"))})}startChunking(){if(!(this.settled||!this.file.active||!this.readyToUpload)){this.startSpeedCalc();for(let e=0;e<this.maxActiveChunks;e++)this.uploadNextChunk()}}uploadNextChunk(){if(!this.settled&&!this.finishing&&this.file.active){if(this.hasChunksToUpload)return this.uploadChunk(this.chunksToUpload[0]);if(this.chunksUploading.length===0)return this.finish()}}uploadChunk(e){e.progress=0,e.loaded=0,e.transferred=0,e.active=!0,this.updateFileProgress();try{e.xhr=T({method:"POST",headers:this.headers,url:this.action})}catch(t){e.active=!1,this.reject(t);return}e.xhr.upload.addEventListener("progress",t=>{if(t.lengthComputable){const s=Math.max(0,t.loaded-e.transferred);e.transferred=t.loaded,e.loaded=t.total>0?Math.min(e.blob.size,t.loaded/t.total*e.blob.size):0,e.progress=t.total>0?t.loaded/t.total*100:0,this.updateSpeed(s),this.updateFileProgress()}},!1),e.xhr.upload.addEventListener("loadstart",()=>{this.speedometer?.start()},!1),z(e.xhr,{...this.uploadBody,phase:"upload",session_id:this.sessionId,start_offset:e.startOffset,chunk:e.blob}).then(t=>{if(e.active=!1,!this.settled){if(t.status==="success")e.uploaded=!0;else if(e.retries--<=0)return this.stopChunks(),this.reject("upload");this.uploadNextChunk()}}).catch(()=>{if(e.active=!1,!(this.settled||!this.file.active)){if(e.retries--<=0)return this.stopChunks(),this.reject("upload");this.uploadNextChunk()}})}finish(){if(this.settled||this.finishing||!this.file.active)return;this.finishing=!0,this.updateFileProgress(),this.stopSpeedCalc();let e;try{e=E({method:"POST",headers:{...this.headers,"Content-Type":"application/json"},url:this.action,body:{...this.finishBody,phase:"finish",session_id:this.sessionId}})}catch(t){this.finishing=!1,this.file.response=t,this.reject("server");return}e.then(t=>{if(this.finishing=!1,!(this.settled||!this.file.active)){if(this.file.response=t,t.status!=="success")return this.reject("server");this.resolve(t)}}).catch(t=>{this.finishing=!1,!(this.settled||!this.file.active)&&(this.file.response=t,this.reject("server"))})}startSpeedCalc(){this.speedometer||(this.file.speed=0,this.lastTransferSpeed=0,this.speedometer=new A)}updateSpeed(e){this.speedometer&&(this.lastTransferSpeed=this.speedometer.add(e),this.speedometer.shouldPublish()&&(this.file.speed=this.lastTransferSpeed))}stopSpeedCalc(){this.speedometer&&this.lastTransferSpeed&&(this.file.speed=this.lastTransferSpeed),this.speedometer=null}},k={headers:{},action:"",minSize:1048576,maxActive:3,maxRetries:5,handler:j},w=0,L=0;function m(){return Object.create(null)}var S=O({compatConfig:{MODE:3},props:{inputId:{type:String},name:{type:String,default:"file"},accept:{type:String},capture:{type:[Boolean,String]},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},maximum:{type:Number},addIndex:{type:[Boolean,Number]},directory:{type:Boolean},createDirectory:{type:Boolean,default:!1},postAction:{type:String},putAction:{type:String},customAction:{type:Function},headers:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})},timeout:{type:Number,default:0},drop:{type:[Boolean,String,Object],default:()=>!1},dropDirectory:{type:Boolean,default:!0},size:{type:Number,default:0},extensions:{type:[RegExp,String,Array],default:()=>[]},modelValue:{type:Array,default:()=>[]},thread:{type:Number,default:1},chunkEnabled:{type:Boolean,default:!1},chunk:{type:Object,default:()=>({...k,headers:{}})}},emits:["update:modelValue","input-filter","input-file"],data(){return{files:this.modelValue,features:{html5:!0,directory:!1,drop:!1},active:!1,dropActive:!1,dropElementActive:!1,uploading:0,activeUploadIds:new Set,activeUploadTokens:new Map,destroy:!1,maps:m(),dropElement:null,dropTimeout:null,reload:!1}},mounted(){const e=document.createElement("input");if(e.type="file",e.multiple=!0,window.FormData&&e.files?((typeof e.webkitdirectory=="boolean"||typeof e.directory=="boolean")&&(this.features.directory=!0),this.features.html5&&typeof e.ondrop<"u"&&this.isRelatedTargetSupported()&&(this.features.drop=!0)):this.features.html5=!1,this.maps=m(),this.files)for(let t=0;t<this.files.length;t++){const s=this.files[t];this.maps[s.id]=s}this.$nextTick(()=>{this.$parent?(this.$parent.$forceUpdate(),this.$parent.$nextTick(()=>{this.watchDrop(this.drop)})):this.watchDrop(this.drop)})},beforeUnmount(){this.destroy=!0,this.active=!1,this.watchDrop(!1),this.watchActive(!1)},computed:{uploaded(){let e;for(let t=0;t<this.files.length;t++)if(e=this.files[t],e.fileObject&&!e.error&&!e.success)return!1;return!0},chunkOptions(){return{...k,...this.chunk}},className(){return["file-uploads",this.features.html5?"file-uploads-html5":"file-uploads-html4",this.features.directory&&this.directory?"file-uploads-directory":void 0,this.features.drop&&this.drop?"file-uploads-drop":void 0,this.disabled?"file-uploads-disabled":void 0]},forId(){return this.inputId||this.name},iMaximum(){if(this.maximum===void 0)return this.multiple?0:1;const e=Math.floor(this.maximum);return Number.isFinite(e)&&e>0?e:0},iThread(){const e=Math.floor(this.thread);return Number.isFinite(e)&&e>0?e:1},iExtensions(){if(!this.extensions)return;if(this.extensions instanceof RegExp)return this.extensions;
1if(!this.extensions.length)return;let e=[];typeof this.extensions=="string"?e=this.extensions.split(","):e=this.extensions,e=e.filter(function(s){return typeof s=="string"}).map(function(s){return s.trim()}).filter(function(s){return s});const t=e.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");if(t)return new RegExp("\\.("+t+")$","i")},iDirectory(){if(this.directory&&this.features.directory)return!0}},watch:{active(e){this.watchActive(e)},dropActive(e){this.watchDropActive(e),this.$parent&&this.$parent.$forceUpdate()},drop(e){this.watchDrop(e)},disabled(e){e&&(this.dropActive=!1,this.dropElementActive=!1,this.watchDropActive(!1))},modelValue(e){if(this.files===e)return;this.files=e;const t=this.maps;this.maps=m();for(let s=0;s<this.files.length;s++){const i=this.files[s];this.maps[i.id]=i}for(const s in this.maps){const i=this.maps[s],r=t[s];i!==r&&this.emitFile(i,r)}for(const s in t)this.maps[s]||this.emitFile(void 0,t[s])}},methods:{newId(){return w++,Math.random().toString(36).slice(2)+Date.now().toString(36)+w.toString(36)},ensureUniqueId(e,t){if(!(e.id&&!this.maps[e.id]&&!t.some(s=>s.id===e.id)))do e.id=this.newId();while(this.maps[e.id]||t.some(s=>s.id===e.id))},clear(){if(this.files.length){const e=this.files;this.files=[],this.maps=m(),this.emitInput();for(let t=0;t<e.length;t++)this.emitFile(void 0,e[t])}return!0},get(e){return e?typeof e=="object"?this.maps[e.id||""]||!1:this.maps[e]||!1:!1},add(e,t){let s;e instanceof Array?s=e:s=[e],t===void 0&&(t=this.addIndex);let i=[];for(let o=0;o<s.length;o++){let n=s[o];if(!n||typeof n!="object")continue;this.features.html5&&typeof Blob<"u"&&n instanceof Blob&&(n={id:"",file:n,size:n.size,name:n.webkitRelativePath||n.relativePath||n.name||"unknown",type:n.type}),n=n;let l=!1;if(n.fileObject===!1||(n.fileObject||typeof HTMLInputElement<"u"&&n.el instanceof HTMLInputElement||typeof Blob<"u"&&n.file instanceof Blob)&&(l=!0),l&&(n={fileObject:!0,size:-1,name:"Filename",type:"",active:!1,error:"",success:!1,putAction:this.putAction,postAction:this.postAction,timeout:this.timeout,...n,response:{},progress:"0.00",speed:0},n.data={...this.data,...n.data?n.data:{}},n.headers={...this.headers,...n.headers?n.headers:{}}),this.ensureUniqueId(n,i),!this.emitFilter(n,void 0)&&(this.ensureUniqueId(n,i),this.iMaximum>1&&i.length+this.files.length>=this.iMaximum||(i.push(n),this.iMaximum===1)))break}if(!i.length)return;this.iMaximum===1&&this.clear();let r;t===!0||t===0?r=i.concat(this.files):t?(r=this.files.concat([]),r.splice(t,0,...i)):r=this.files.concat(i),this.files=r;let a=0;t===!0||t===0?a=0:t?t>=0?t+i.length>this.files.length?a=this.files.length-i.length:a=t:(a=this.files.length-i.length+t,a<0&&(a=0)):a=this.files.length-i.length,i=this.files.slice(a,a+i.length);for(let o=0;o<i.length;o++){const n=i[o];this.maps[n.id]=n}this.emitInput();for(let o=0;o<i.length;o++)this.emitFile(i[o],void 0);return e instanceof Array?i:i[0]},addInputFile(e){const t=[],s=e.webkitEntries||e.entries||void 0;if(s?.length)return this.getFileSystemEntry(s).then(i=>this.add(i)||[]);if(e.files)for(let i=0;i<e.files.length;i++){const r=e.files[i];t.push({id:"",size:r.size,name:r.webkitRelativePath||r.relativePath||r.name,type:r.type,file:r})}else{let i=e.value.replace(/\\/g,"/").split("/");(!i||!i.length)&&(i=[e.value]),delete e.__vuex__,t.push({id:"",name:i[i.length-1],el:e})}return Promise.resolve(this.add(t)||[])},addDataTransfer(e){if(e?.items?.length){const i=[];for(let r=0;r<e.items.length;r++){const a=e.items[r];let o;a.getAsEntry?o=a.getAsEntry()||a.getAsFile():a.webkitGetAsEntry?o=a.webkitGetAsEntry()||a.getAsFile():o=a.getAsFile(),o&&i.push(o)}if(i.length)return this.getFileSystemEntry(i).then(r=>this.add(r)||[])}const t=this.iMaximum,s=[];if(e.files.length){for(let i=0;i<e.files.length&&(s.push(e.files[i]),!(t>0&&s.length>=t));i++);return Promise.resolve(this.add(s)||[])}return Promise.resolve([])},getFileSystemEntry(e,t=""){return new Promise(s=>{const i=this.iMaximum;if(!e){s([]);return}if(e instanceof Array){const r=[],a=o=>{const n=e[o];if(!n||i>0&&r.length>=i)return s(r);this.getFileSystemEntry(n,t).then(function(l){const u=i>0?i-r.length:l.length;r.push(...l.slice(0,Math.max(u,0))),a(o+1)})};a(0);return}if(e instanceof Blob){s([{id:"",size:e.size,name:t+e.name,type:e.type,file:e}]);return}if(e.isFile){e.file(function(r){s([{id:"",size:r.size,name:t+r.name,type:r.type,file:r}])},function(){s([])});return}if(e.isDirectory&&this.dropDirectory){let r=e;const a=[];this.createDirectory&&a.push({id:"",name:t+r.name,size:0,type:"text/directory",file:new File([],t+r.name,{type:"text/directory"})});const o=r.createReader(),n=()=>{o.readEntries(l=>{const u=d=>{if(!l[d]&&d===0||i>0&&a.length>=i)return s(a);if(!l[d])return n();this.getFileSystemEntry(l[d],t+r.name+"/").then(function(p){const f=i>0?i-a.length:p.length;a.push(...p.slice(0,Math.max(f,0))),u(d+1)})};u(0)},function(){s(a)})};n();return}s([])})},replace(e,t){const s=this.get(e),i=this.get(t);if(!s||!i||s===i)return!1;
1const r=this.files.concat([]),a=r.indexOf(s),o=r.indexOf(i);return a===-1||o===-1?!1:(r[a]=i,r[o]=s,this.files=r,this.emitInput(),!0)},remove(e){const t=this.get(e);if(t){if(this.emitFilter(void 0,t))return!1;const s=this.files.concat([]),i=s.indexOf(t);if(i===-1)return console.error("remove",t),!1;s.splice(i,1),this.files=s,delete this.maps[t.id],this.emitInput(),this.emitFile(void 0,t)}return t},update(e,t){const s=this.get(e);if(s){let i={...s,...t};if(i.id!==s.id&&(s.active||this.activeUploadTokens.has(s.id)||this.maps[i.id]&&this.maps[i.id]!==s)||(s.fileObject&&s.active&&!i.active&&!i.error&&!i.success&&!i.chunk?.paused&&(i.error="abort"),this.emitFilter(i,s))||!i.id||i.id!==s.id&&(s.active||this.maps[i.id]))return!1;const r=this.files.concat([]),a=r.indexOf(s);return a===-1?(console.error("update",s),!1):(r.splice(a,1,i),this.files=r,i=this.files[a],delete this.maps[s.id],this.maps[i.id]=i,this.emitInput(),this.emitFile(i,s),i)}return!1},emitFilter(e,t){let s=!1;return this.$emit("input-filter",e,t,function(i=!0){return s=i,s}),s},resumeChunkUpload(e){return!this.activeUploadTokens.has(e.id)||!e.chunk?.resume||e.chunk.settled?!1:(this.activeUploadIds.has(e.id)||(this.activeUploadIds.add(e.id),this.uploading++),e.chunk.file=e,e.chunk.resuming||e.chunk.resume(),!0)},emitFile(e,t){if(this.$emit("input-file",e,t),!e&&t?this.activeUploadTokens.delete(t.id):e&&!e.active&&(e.error||e.success||!e.fileObject)&&this.activeUploadTokens.delete(e.id),e?.fileObject&&e.active&&(!t||!t.active)){if(!this.resumeChunkUpload(e))if(this.activeUploadIds.has(e.id))e.chunk?.resume&&(e.chunk.file=e,e.chunk.resume());else{const s=e.id,i=++L;this.activeUploadIds.add(e.id),this.activeUploadTokens.set(s,i),this.uploading++,this.$nextTick(()=>{setTimeout(()=>{Promise.resolve().then(()=>{if(this.activeUploadTokens.get(s)!==i)return;const r=this.get(s);if(!r||!r.active)throw new Error("abort");return e=r,this.upload(r)}).then(()=>{this.activeUploadTokens.get(s)===i&&(e=this.get(s)||void 0,e?.fileObject&&this.update(e,{active:!1,success:!e.error}))}).catch(r=>{if(this.activeUploadTokens.get(s)!==i)return;const a=this.get(s);a&&this.update(a,{active:!1,success:!1,error:r.code||r.error||r.message||r})})},Math.ceil(Math.random()*50+50))})}}else(!e||!e.fileObject||!e.active)&&t?.fileObject&&this.activeUploadIds.has(t.id)&&(this.activeUploadIds.delete(t.id),e&&!e.error&&!e.success&&e.chunk?.paused||this.activeUploadTokens.delete(t.id),!e?.success&&t.chunk?.pause&&!t.chunk.paused&&t.chunk.pause(),this.uploading=Math.max(0,this.uploading-1));this.active&&(!!e!=!!t||e.active!==t.active)&&this.watchActive(!0)},emitInput(){this.$emit("update:modelValue",this.files)},upload(e){const t=this.get(e);if(!t)return Promise.reject(new Error("not_exists"));if(!t.fileObject)return Promise.reject(new Error("file_object"));if(t.error)return t.error instanceof Error?Promise.reject(t.error):Promise.reject(new Error(t.error));if(t.success)return Promise.resolve(t);if(t.name&&this.iExtensions&&t.type!=="text/directory"&&t.name.search(this.iExtensions)===-1)return Promise.reject(new Error("extension"));if(this.size>0&&t.size!==void 0&&t.size>=0&&t.size>this.size&&t.type!=="text/directory")return Promise.reject(new Error("size"));try{if(this.customAction)return Promise.resolve(this.customAction(t,this));if(this.features.html5){if(this.shouldUseChunkUpload(t))return this.uploadChunk(t);if(t.putAction)return this.uploadPut(t);if(t.postAction)return this.uploadHtml5(t)}if(t.postAction)return this.uploadHtml4(t)}catch(s){return Promise.reject(s instanceof Error?s:new Error(String(s)))}return Promise.reject(new Error("No action configured"))},shouldUseChunkUpload(e){return!!(this.chunkEnabled&&this.chunkOptions.handler&&e.size&&e.size>this.chunkOptions.minSize)},uploadChunk(e){const t=this.chunkOptions.handler,s=e.id;return e.chunk=new t(e,{...this.chunkOptions,onPause:i=>{const r=this.get(s);return r&&r.active?this.update(r,{active:!1})||i:r||i},onResume:i=>{const r=this.get(s);return r&&!r.active&&!r.error&&!r.success?this.update(r,{active:!0})||i:r||i}}),e.chunk.upload().then(()=>e)},uploadPut(e){const t=[];let s;for(const o in e.data)s=e.data[o],s!=null&&(typeof s=="object"&&(s=JSON.stringify(s)),t.push(encodeURIComponent(o)+"="+encodeURIComponent(s)));const i=e.putAction||"",r=t.length?(i.indexOf("?")===-1?"?":"&")+t.join("&"):"",a=new XMLHttpRequest;return a.open("PUT",i+r),this.uploadXhr(a,e,e.file)},uploadHtml5(e){const t=new window.FormData;let s;for(const r in e.data)s=e.data[r],s&&typeof s=="object"?typeof File<"u"&&s instanceof File?t.append(r,s,s.name):typeof Blob<"u"&&s instanceof Blob?t.append(r,s):t.append(r,JSON.stringify(s)):s!=null&&t.append(r,s);t.append(this.name,e.file,e.name||e.file.name||e.file.filename);const i=new XMLHttpRequest;return i.open("POST",e.postAction||""),this.uploadXhr(i,e,t)}
1,uploadXhr(e,t,s){let i=t,r=0,a=0;const o=new A;e.upload.onloadstart=()=>{o.start()},e.upload.onprogress=l=>{if(!i||(i=this.get(i),!l.lengthComputable||!i||!i.fileObject||!i.active))return;const u=Math.max(0,l.loaded-r);r=l.loaded,a=o.add(u);const d={progress:(l.loaded/l.total*100).toFixed(2)};o.shouldPublish()&&(d.speed=a),i=this.update(i,d)};let n=window.setInterval(()=>{if(!(i&&(i=this.get(i))&&i?.fileObject&&!i.success&&!i.error&&i.active)){n&&(clearInterval(n),n=void 0);try{e.abort(),e.timeout=1}catch{}}},100);return new Promise((l,u)=>{const d=()=>{n&&(clearInterval(n),n=void 0)};if(!i){d(),u(new Error("not_exists"));return}let p;const f=h=>{if(p)return;if(p=!0,d(),!i)return u(new Error("not_exists"));if(i=this.get(i),!i)return u(new Error("not_exists"));if(!i.fileObject)return u(new Error("file_object"));if(i.error)return i.error instanceof Error?u(i.error):u(new Error(i.error));if(!i.active)return u(new Error("abort"));if(i.success)return l(i);const c={speed:a||i.speed||0};switch(h.type){case"timeout":case"abort":c.error=h.type;break;case"error":e.status?e.status>=500?c.error="server":e.status>=400?c.error="denied":c.error="server":c.error="network";break;default:e.status?e.status>=500?c.error="server":e.status>=400?c.error="denied":e.status<200||e.status>=300?c.error="server":c.progress="100.00":c.error="network"}if(e.responseText){const g=e.getResponseHeader("Content-Type");if(g&&/(?:\/|\+)json(?:;|$)/i.test(g))try{c.response=JSON.parse(e.responseText)}catch{c.response=e.responseText}else c.response=e.responseText}return i=this.update(i,c),i?i.error?i.error instanceof Error?u(i.error):u(new Error(i.error)):l(i):u(new Error("abort"))};e.onload=f,e.onerror=f,e.onabort=f,e.ontimeout=f,i.timeout&&(e.timeout=i.timeout);try{for(const h in i.headers)e.setRequestHeader(h,i.headers[h]);if(i=this.update(i,{xhr:e}),!i){d(),u(new Error("abort"));return}e.send(s)}catch(h){d(),u(h instanceof Error?h:new Error(String(h)))}})},uploadHtml4(e){let t=e;if(!t)return Promise.reject(new Error("not_exists"));const s=function(o){o.keyCode===27&&o.preventDefault()},i=document.createElement("iframe");i.id="upload-iframe-"+t.id,i.name="upload-iframe-"+t.id,i.src="about:blank",i.setAttribute("style","width:1px;height:1px;top:-999em;position:absolute; margin-top:-999em;");const r=document.createElement("form");r.setAttribute("action",t.postAction||""),r.name="upload-form-"+t.id,r.setAttribute("method","POST"),r.setAttribute("target","upload-iframe-"+t.id),r.setAttribute("enctype","multipart/form-data");for(const o in t.data){let n=t.data[o];if(n&&typeof n=="object"&&typeof n.toString!="function"&&(n=JSON.stringify(n)),n!=null){const l=document.createElement("input");l.type="hidden",l.name=o,l.value=n,r.appendChild(l)}}r.appendChild(t.el),document.body.appendChild(i).appendChild(r);const a=function(){let o;try{i.contentWindow&&(o=i.contentWindow.document)}catch{}if(!o)try{o=i.contentDocument?i.contentDocument:i.document}catch{o=i.document}return o?.body?o.body.innerHTML:null};return new Promise((o,n)=>{setTimeout(()=>{if(!t){n(new Error("not_exists"));return}if(t=this.update(t,{iframe:i}),!t)return n(new Error("not_exists"));let l=window.setInterval(()=>{t&&(t=this.get(t))&&t.fileObject&&!t.success&&!t.error&&t.active||(l&&(clearInterval(l),l=void 0),i.onabort({type:t?"abort":"not_exists"}))},100),u;const d=p=>{if(u)return;if(u=!0,l&&(clearInterval(l),l=void 0),document.body.removeEventListener("keydown",s),!t)return n(new Error("not_exists"));if(t=this.get(t),!t)return n(new Error("not_exists"));if(!t.fileObject)return n(new Error("file_object"));if(t.error)return t.error instanceof Error?n(t.error):n(new Error(t.error));if(!t.active)return n(new Error("abort"));if(t.success)return o(t);let f=a();const h={};if(typeof p=="string")return n(new Error(p));switch(p.type){case"abort":h.error="abort";break;case"error":t.error?h.error=t.error:f===null?h.error="network":h.error="denied";break;default:t.error?h.error=t.error:f===null?h.error="network":h.progress="100.00"}if(f!==null){if(f&&f.substr(0,1)==="{"&&f.substr(f.length-1,1)==="}")try{f=JSON.parse(f)}catch{}h.response=f}return t=this.update(t,h),t?t?.error?t.error instanceof Error?n(t.error):n(new Error(t.error)):o(t):n(new Error("not_exists"))};i.onload=d,i.onerror=d,i.onabort=d,document.body.addEventListener("keydown",s),r.submit()},50)}).then(function(o){return i?.parentNode?.removeChild(i),o}).catch(function(o){return i?.parentNode?.removeChild(i),o})},watchActive(e){let t,s=0;for(;t=this.files[s];)if(s++,t.fileObject)if(e&&!this.destroy){if(this.uploading>=this.iThread||this.uploading&&!this.features.html5)break;!t.active&&!t.error&&!t.success&&this.update(t,{active:!0})}else t.active&&this.update(t,{active:!1});this.uploading===0&&(this.active=!1)},watchDrop(e,t=void 0){if(!this.features.drop||e===t)return;if(this.dropElement)try{document.removeEventListener("dragenter",this.onDocumentDragenter,!1),document.removeEventListener("dragleave",this.onDocumentDragleave,!1),document.removeEventListener("dragover",this.onDocumentDragover,!1),document.removeEventListener("drop",this.onDocumentDrop,!1),this.dropElement.removeEventListener("dragenter",this.onDragenter,!1),this.dropElement.removeEventListener("dragleave",this.onDragleave,!1),this.dropElement.removeEventListener("dragover",this.onDragover,!1),this.dropElement.removeEventListener("drop",this.onDrop,!1)}catch{}let s=null;if(e)if(typeof e=="string")try{s=document.querySelector(e)||this.$root.$el?.querySelector(e)}catch{s=null}else e===!0?(s=this.$parent?.$el,(!s||s?.nodeType===8)&&(s=this.$root.$el,(!s||s?.nodeType===8)&&(s=document.body))):s=e;this.dropElement=s,this.dropElement||(this.dropActive=!1,this.dropElementActive=!1,this.watchDropActive(!1)),this.dropElement&&(document.addEventListener("dragenter",this.onDocumentDragenter,!1),document.addEventListener("dragleave",this.onDocumentDragleave,!1),document.addEventListener("dragover",this.onDocumentDragover,!1),document.addEventListener("drop",this.onDocumentDrop,!1),this.dropElement.addEventListener("dragenter",this.onDragenter,!1),this.dropElement.addEventListener("dragleave",this.onDragleave,!1),this.dropElement.addEventListener("dragover",this.onDragover,!1),this.dropElement.addEventListener("drop",this.onDrop,!1))},watchDropActive(e,t){e!==t&&(!e&&this.dropElementActive&&(this.dropElementActive=!1),this.dropTimeout&&(clearTimeout(this.dropTimeout),this.dropTimeout=null),e&&(this.dropTimeout=setTimeout(this.onDocumentDrop,1e3)))},onDocumentDragenter(e){if(this.disabled||this.dropActive||!e.dataTransfer)return;const t=e.dataTransfer;t?.files?.length?this.dropActive=!0:t.types?t.types.indexOf&&t.types.indexOf("Files")!==-1?this.dropActive=!0:t.types?.contains&&t.types.contains("Files")&&(this.dropActive=!0):this.dropActive=!0,this.dropActive&&this.watchDropActive(!0)},onDocumentDragleave(e){this.dropActive&&(e.target===e.explicitOriginalTarget||!e.fromElement&&(e.clientX<=0||e.clientY
1<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight))&&(this.dropActive=!1,this.watchDropActive(!1))},onDocumentDragover(){!this.disabled&&this.dropActive&&this.watchDropActive(!0)},onDocumentDrop(){this.dropActive=!1,this.watchDropActive(!1)},onDragenter(){this.disabled||!this.dropActive||this.dropElementActive||(this.dropElementActive=!0)},onDragleave(e){if(!this.dropElementActive)return;const t=e.relatedTarget;if(!t)this.dropElementActive=!1;else if(this.dropElement?.contains)this.dropElement.contains(t)||(this.dropElementActive=!1);else{let s=t;for(;s&&s!==this.dropElement;)s=s.parentNode;s!==this.dropElement&&(this.dropElementActive=!1)}},onDragover(e){this.disabled||e.preventDefault()},onDrop(e){e.preventDefault(),this.disabled||e.dataTransfer&&this.addDataTransfer(e.dataTransfer)},async inputOnChange(e){if(!(e.target instanceof HTMLInputElement))return Promise.reject(new Error("not HTMLInputElement"));const t=s=>(this.reload=!0,this.$nextTick(()=>{this.reload=!1}),s);return this.addInputFile(e.target).then(t).catch(t)},isRelatedTargetSupported(){try{return"relatedTarget"in new MouseEvent("mouseout",{relatedTarget:document.body})}catch{return!1}}}}),R=["for"],$=["name","id","accept","capture","disabled","webkitdirectory","allowdirs","directory","multiple"];function _(e,t,s,i,r,a){return b(),y("span",{class:I(e.className)},[B(e.$slots,"default"),U("label",{for:e.forId},null,8,R),e.reload?C("",!0):(b(),y("input",{key:0,ref:"input",type:"file",name:e.name,id:e.forId,accept:e.accept,capture:e.capture,disabled:e.disabled,webkitdirectory:e.iDirectory,allowdirs:e.iDirectory,directory:e.iDirectory,multiple:e.multiple&&e.features.html5,onChange:t[0]||(t[0]=(...o)=>e.inputOnChange&&e.inputOnChange(...o))},null,40,$))],2)}function H(e,t){t===void 0&&(t={});var s=t.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",s==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}H(`
2.file-uploads {
3  overflow: hidden;
4  position: relative;
5  text-align: center;
6  display: inline-block;
7}
8.file-uploads.file-uploads-html4 input,
9.file-uploads.file-uploads-html5 label {
10  /* background fix ie  click */
11  background: #fff;
12  opacity: 0;
13  font-size: 20em;
14  z-index: 1;
15  top: 0;
16  left: 0;
17  right: 0;
18  bottom: 0;
19  position: absolute;
20  width: 100%;
21  height: 100%;
22}
23.file-uploads.file-uploads-html5 input,
24.file-uploads.file-uploads-html4 label {
25  /* background fix ie  click */
26  position: absolute;
27  background: rgba(255, 255, 255, 0);
28  overflow: hidden;
29  position: fixed;
30  width: 1px;
31  height: 1px;
32  z-index: -1;
33  opacity: 0;
34}
35`);S.render=_;var J=D(e=>{e.vueApp.component("file-upload",S)});export{J as t};

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.