PageSourceSearch

https://hacktronics.co.in/assets/gst-BDZV6gwC.js

js hacktronics.co.in collected 2026-10-08 10:55:37 UTC 1,257 bytes, 1 lines download raw bytes

1var e=e=>Math.round((e+2**-52)*100)/100;function t(e){let t=Number(e.gst_rate);return Number.isFinite(t)&&t>=0?t:18}function n(t,n={}){let r=Math.max(0,n.shipping??0),i=Math.max(0,n.discount??0),a=e(t.reduce((e,t)=>e+t.amount,0)),o=new Map,s=(e,t,n)=>{let r=o.get(e)??{taxable:0,tax:0};r.taxable+=t,r.tax+=n,o.set(e,r)},c=0;for(let e of t){let t=a>0?i*(e.amount/a):0,n=Math.max(0,e.amount-t),r=n*e.rate/100;c+=r,s(e.rate,n,r)}if(r>0){let e=r*18/100;c+=e,s(18,r,e)}c=e(c);let l=e(Math.max(0,a-i)+r),u=e(Math.max(0,a-i)+r+c),d=[...o.entries()].map(([t,n])=>({rate:t,taxable:e(n.taxable),tax:e(n.tax)})).sort((e,t)=>e.rate-t.rate);return{subtotal:a,discount:i,shipping:r,taxable:l,tax:c,total:u,byRate:d}}function r(t,n){let r=Math.max(0,n.shipping??0),i=Math.max(0,n.discount??0),a=e(Math.max(0,n.taxTotal)),o=e(t.reduce((e,t)=>e+t.amount,0)),s=new Map;for(let e of t){let t=o>0?i*(e.amount/o):0,n=Math.max(0,e.amount-t),r=s.get(e.rate)??{taxable:0,tax:0};r.taxable+=n,r.tax+=n*e.rate/100,s.set(e.rate,r)}let c=[...s.entries()].map(([t,n])=>({rate:t,taxable:e(n.taxable),tax:e(n.tax)})).sort((e,t)=>e.rate-t.rate),l=e(a-e(c.reduce((e,t)=>e+t.tax,0)));return(r>0||Math.abs(l)>.005)&&c.push({rate:18,taxable:e(r),tax:l,isShipping:!0}),c}export{t as n,r,n 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.