PageSourceSearch

https://zoomto.me/build/js/Base64FileViewer.cae9ff16.js

js zoomto.me collected 2026-10-09 01:04:56 UTC 3,471 bytes, 1 lines download raw bytes

1import{b as t}from"./base64Tools.5b8a160c.js";import{n as e}from"./vueComponentNormalizer.fc2fb13f.js";var s=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"b64-file"},[s("form",{on:{submit:function(e){return e.preventDefault(),t.processBase64(e)}}},[s("label",{staticClass:"form-label",attrs:{for:"input-b64"}},[t._v("Base64 (raw or data URL)")]),t._v(" "),s("textarea",{directives:[{name:"model",rawName:"v-model.trim",value:t.inputB64,expression:"inputB64",modifiers:{trim:!0}}],staticClass:"form-control",attrs:{id:"input-b64",rows:"6"},domProps:{value:t.inputB64},on:{input:function(e){e.target.composing||(t.inputB64=e.target.value.trim())},blur:function(e){return t.$forceUpdate()}}}),t._v(" "),t._m(0)]),t._v(" "),t.errorMessage?s("div",{staticClass:"card mt-3 border-danger"},[s("div",{staticClass:"card-body text-danger"},[s("i",{staticClass:"fa fa-exclamation-circle mr-2"}),t._v(t._s(t.errorMessage))])]):t._e(),t._v(" "),t.outputBlob?s("div",{staticClass:"mt-3"},[s("div",{staticClass:"d-flex justify-content-between align-items-center"},[s("div",[s("span",{staticClass:"meta-chip"},[t._v(t._s(t.mimeType))]),t._v(" "),s("span",{staticClass:"meta-chip"},[t._v(t._s(t.prettyBytes(t.rawSize)))])]),t._v(" "),s("div",{staticClass:"btn-group"},[s("button",{staticClass:"btn btn-secondary",on:{click:t.copyFile}},[s("i",{staticClass:"fa fa-copy"}),t._v(" Copy")]),t._v(" "),s("button",{staticClass:"btn btn-primary",on:{click:t.downloadFile}},[s("i",{staticClass:"fa fa-download"}),t._v(" Download")])])]),t._v(" "),t._m(1)]):t._e()])},i=[function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("button",{staticClass:"btn btn-primary mt-2"},[s("i",{staticClass:"fa fa-eye"}),t._v(" Inspect")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"card mt-2 p-3"},[s("p",{staticClass:"mb-0"},[t._v("Generic file ready. Use Download to save or Copy to put a file blob in your clipboard (supported browsers).")])])}];const a={name:"Base64FileViewer",data:()=>({inputB64:"",errorMessage:"",outputBlob:null,mimeType:"application/octet-stream",rawSize:0,objectUrl:""}),methods:{reset(){this.errorMessage="",this.outputBlob=null,this.mimeType="application/octet-stream",this.rawSize=0,this.objectUrl&&URL.revokeObjectURL(this.objectUrl),this.objectUrl=""},processBase64(){if(this.reset(),this.inputB64)try{const{mime:e,b64:s}=t.extractMimeAndData(this.inputB64),i=t.base64ToUint8Array(s),a=t.sniffMime(i);this.mimeType=t.mimeOrDefault(e||a),this.outputBlob=new Blob([i],{type:this.mimeType}),this.rawSize=i.length,this.objectUrl=URL.createObjectURL(this.outputBlob)}catch{this.errorMessage="Failed to decode Base64."}else this.errorMessage="Input cannot be empty."},async copyFile(){var t;if(this.outputBlob)try{await navigator.clipboard.write([new ClipboardItem({[this.mimeType]:this.outputBlob})]),null==(t=$.toast)||t.call($,{title:"Copied",message:"File blob copied!",style:"success"})}catch{this.errorMessage="Copy failed. Browser may not support file clipboard."}},downloadFile(){if(!this.outputBlob)return;const t=this.mimeType.split("/")[1]||"bin",e=document.createElement("a");e.href=this.objectUrl,e.download=`file.${t}`,e.click()},prettyBytes:t.prettyBytes},beforeDestroy(){this.objectUrl&&URL.revokeObjectURL(this.objectUrl)}},r={};var o=e(a,s,i,!1,l,"3572e8f6",null,null);function l(t){for(let e in r)this[e]=r[e]}const n=function(){return o.exports}();export{n as default};

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.