PageSourceSearch

https://onoxa.com/assets/labelTemplateDownload-Smjgukmn.js

js onoxa.com collected 2026-10-05 03:47:35 UTC 1,534 bytes, 1 lines download raw bytes

1const l="/functions/getLabelTemplate",u="ONOXA-Label-Templates.pdf";function p(a){const o=a.headers.get("content-disposition")||"",t=/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i.exec(o);return t?decodeURIComponent(t[1]):u}async function m({productId:a}={}){const o=a?`${l}?product_id=${encodeURIComponent(a)}`:l;let t;try{t=await fetch(o,{headers:{Accept:"application/pdf"}})}catch{return{ok:!1,error:"Network error — please check your connection and try again."}}if(!t.ok){let s="The label template could not be downloaded. Please try again.";try{const c=await t.json();c!=null&&c.error&&(s=c.error)}catch{}return{ok:!1,error:s}}const r=await t.blob(),e=p(t),i=URL.createObjectURL(r),n=document.createElement("a");return n.href=i,n.download=e,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),6e4),{ok:!0,filename:e}}async function d(a){const o={available:!1,hasProductPages:!1,productPages:0,guidelinePages:0,totalPages:null,version:null};try{const t=a?`?meta=1&product_id=${encodeURIComponent(a)}`:"?meta=1",r=await fetch(`${l}${t}`,{headers:{Accept:"application/json"}});if(!r.ok)return o;const e=await r.json();return{available:!!(e!=null&&e.available),hasProductPages:Number(e==null?void 0:e.product_pages)>0,productPages:Number(e==null?void 0:e.product_pages)||0,guidelinePages:Number(e==null?void 0:e.guideline_pages)||0,totalPages:(e==null?void 0:e.total_pages)??null,version:(e==null?void 0:e.version)??null}}catch{return o}}export{m as downloadLabelTemplate,d as fetchLabelTemplateInfo};

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.