1"use strict";(self.webpackChunkkicks=self.webpackChunkkicks||[]).push([[8495],{7976:(e,t,r)=>{r.r(t),r.d(t,{ajax:()=>d,default:()=>n});var i=r(9e3),s=r(8618),a=r(1485),o=r(1155);const n={mixins:[r(2616).Z],i18n:{invalidMime:"Invalid File Type: %s",invalidName:"Invalid File Name: %s",invalidSize:"Invalid File Size: %s Kilobytes Max"},props:{allow:String,clsDragover:String,concurrent:Number,maxSize:Number,method:String,mime:String,multiple:Boolean,name:String,params:Object,type:String,url:String},data:{allow:!1,clsDragover:"uk-dragover",concurrent:1,maxSize:0,method:"POST",mime:!1,multiple:!1,name:"files[]",params:{},type:"",url:"",abort:i.ZT,beforeAll:i.ZT,beforeSend:i.ZT,complete:i.ZT,completeAll:i.ZT,error:i.ZT,fail:i.ZT,load:i.ZT,loadEnd:i.ZT,loadStart:i.ZT,progress:i.ZT},events:{change(e){(0,s.wB)(e.target,'input[type="file"]')&&(e.preventDefault(),e.target.files&&this.upload(e.target.files),e.target.value="")},drop(e){h(e);const t=e.dataTransfer;t?.files&&((0,a.IV)(this.$el,this.clsDragover),this.upload(t.files))},dragenter(e){h(e)},dragover(e){h(e),(0,a.cn)(this.$el,this.clsDragover)},dragleave(e){h(e),(0,a.IV)(this.$el,this.clsDragover)}},methods:{async upload(e){if(!(e=(0,i.qo)(e)).length)return;(0,o.X$)(this.$el,"upload",[e]);for(const t of e){if(this.maxSize&&1e3*this.maxSize<t.size)return void this.fail(this.t("invalidSize",this.maxSize));if(this.allow&&!l(this.allow,t.name))return void this.fail(this.t("invalidName",this.allow));if(this.mime&&!l(this.mime,t.type))return void this.fail(this.t("invalidMime",this.mime))}this.multiple||(e=e.slice(0,1)),this.beforeAll(this,e);const t=function(e,t){const r=[];for(let i=0;i<e.length;i+=t)r.push(e.slice(i,i+t));return r}(e,this.concurrent),r=async e=>{const i=new FormData;e.forEach((e=>i.append(this.name,e)));for(const e in this.params)i.append(e,this.params[e]);try{const e=await d(this.url,{data:i,method:this.method,responseType:this.type,beforeSend:e=>{const{xhr:t}=e;(0,o.on)(t.upload,"progress",this.progress);for(const e of["loadStart","load","loadEnd","abort"])(0,o.on)(t,e.toLowerCase(),this[e]);return this.beforeSend(e)}});this.complete(e),t.length?await r(t.shift()):this.completeAll(e)}catch(e){this.error(e)}};await r(t.shift())}}};function l(e,t){return t.match(new RegExp(`^${e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")}$`,"i"))}function h(e){e.preventDefault(),e.stopPropagation()}function d(e,t){const r={data:null,method:"GET",headers:{},xhr:new XMLHttpRequest,beforeSend:i.ZT,responseType:"",...t};return Promise.resolve().then((()=>r.beforeSend(r))).then((()=>function(e,t){return new Promise(((r,s)=>{const{xhr:a}=t;for(const e in t)if(e in a)try{a[e]=t[e]}catch(e){}a.open(t.method.toUpperCase(),e);for(const e in t.headers)a.setRequestHeader(e,t.headers[e]);(0,o.on)(a,"load",(()=>{0===a.status||a.status>=200&&a.status<300||304===a.status?r(a):s((0,i.f0)(Error(a.statusText),{xhr:a,status:a.status}))})),(0,o.on)(a,"error",(()=>s((0,i.f0)(Error("Network Error"),{xhr:a})))),(0,o.on)(a,"timeout",(()=>s((0,i.f0)(Error("Network Timeout"),{xhr:a})))),a.send(t.data)}))}(e,r)))}}}]); 2//# sourceMappingURL=upload.b972f2081e7a9753feea.min.js.map
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.