1import{r as a,j as e}from"./react-vendor-DgF5BvPh.js";import{aJ as I,x as l,a1 as k}from"./index-DQrNnQ_p.js";import{C as G}from"./circle-help-eEpw_UoZ.js";import{I as S}from"./info-C4264qVI.js";import{C}from"./calculator-BNJ6KNQm.js";import{A as H}from"./arrow-down-CN8kgbJ0.js";import"./ui-vendor-DLQD4Y5c.js";import"./router-CYXz2GUs.js";const d=({children:r,className:c=""})=>e.jsx("div",{className:`bg-muted/60 border border-border rounded-lg p-4 text-sm text-foreground ${c}`,children:r}),n=()=>e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(H,{className:"h-5 w-5 text-accent"})}),i=[100,1e3,1e4,1e5];function L(r){const c=Math.ceil(r*1.1);for(const o of i)if(o>=c)return o;return i[i.length-1]}function M(){const[r,c]=a.useState("32"),[o,f]=a.useState("10"),[m,N]=a.useState("10"),[u,v]=a.useState("10");a.useEffect(()=>{document.title="How many barcodes do I need? | GS1 New Zealand"},[]);const t=a.useMemo(()=>{const s=parseInt(r)||0,h=parseInt(o)||1,b=parseInt(m)||0,g=parseInt(u)||1,p=s*h,j=b*g,x=p+j,w=x>0?L(x):null;return{cp:s,cv:h,fp:b,fv:g,currentGtins:p,futureGtins:j,totalGtins:x,block:w}},[r,o,m,u]),y=t.cp>0;return e.jsxs(e.Fragment,{children:[e.jsx(I,{title:"How many barcodes do I need?",description:"Use the GS1 New Zealand decision tool to work out how many barcode numbers (GTINs) your business needs.",pageStatus:"internal"}),e.jsx("main",{className:"min-h-screen bg-background py-8 px-4",children:e.jsxs("div",{className:"max-w-4xl mx-auto bg-card border border-border rounded-lg shadow-sm p-6 md:p-8",children:[e.jsx("header",{className:"mb-6",children:e.jsx("h1",{className:"text-xl md:text-2xl font-bold text-foreground",children:"How many barcode numbers (GTINs) does your business need?"})}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"font-semibold text-foreground mb-4 flex items-center gap-2",children:[e.jsx(G,{className:"h-4 w-4 text-accent"}),"Questions to ask"]}),e.jsxs("div",{className:"space-y-0",children:[e.jsx(d,{children:"How many numbers do I need?"}),e.jsx(n,{}),e.jsx(d,{children:"How many products do I currently have (including variations in packaging size, flavour, style, colours etc)?"}),e.jsx(n,{}),e.jsx(d,{children:"How many new products may I introduce in the future?"}),e.jsx(n,{}),e.jsx(d,{children:"Which number range is going to suit my current and future needs best?"}),e.jsx(n,{}),e.jsx("div",{className:"flex gap-2",children:i.map(s=>e.jsx("div",{className:`flex-1 rounded-lg py-2 text-center text-sm font-semibold transition-colors ${t.block===s?"bg-accent text-white border-2 border-accent":"bg-accent/10 border border-accent/30 text-accent"}`,children:s.toLocaleString()},s))}),e.jsx("div",{className:"pt-4"}),e.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-lg p-3 flex items-start gap-2.5",children:[e.jsx(S,{className:"h-4 w-4 text-primary flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-semibold text-foreground",children:"Remember:"})," If you run out of numbers you will need to purchase another block â so it's worth planning ahead."]})]})]})]}),e.jsxs("div",{children:[e.jsxs("h2",{className:"font-semibold text-foreground mb-4 flex items-center gap-2",children:[e.jsx(C,{className:"h-4 w-4 text-accent"}),"Work it out"]}),e.jsxs("div",{className:"space-y-0",children:[e.jsx(d,{className:"bg-accent/5 border-accent/20",children:"How many numbers do I need?"}),e.jsx(n,{}),e.jsxs("div",{className:"bg-accent/5 border border-accent/20 rounded-lg p-4 text-sm space-y-3",children:[e.jsx("p",{className:"text-foreground font-medium",children:"My current products"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Products"}),e.jsx(l,{type:"number",min:"0",placeholder:"e.g. 32",value:r,onChange:s=>c(s.target.value),className:"h-9 text-sm"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Avg. variants each"}),e.jsx(l,{type:"number",min:"1",placeholder:"e.g. 10",value:o,onChange:s=>
1f(s.target.value),className:"h-9 text-sm"})]})]}),t.currentGtins>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["= ",e.jsxs("strong",{className:"text-foreground",children:[t.currentGtins.toLocaleString()," GTINs"]})," needed now"]})]}),e.jsx(n,{}),e.jsxs("div",{className:"bg-accent/5 border border-accent/20 rounded-lg p-4 text-sm space-y-3",children:[e.jsx("p",{className:"text-foreground font-medium",children:"New products I plan to add (next 5 yrs)"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Future products"}),e.jsx(l,{type:"number",min:"0",placeholder:"e.g. 10",value:m,onChange:s=>N(s.target.value),className:"h-9 text-sm"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Avg. variants each"}),e.jsx(l,{type:"number",min:"1",placeholder:"e.g. 10",value:u,onChange:s=>v(s.target.value),className:"h-9 text-sm"})]})]}),t.futureGtins>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["= ",e.jsxs("strong",{className:"text-foreground",children:[t.futureGtins.toLocaleString()," GTINs"]})," planned"]})]}),e.jsx(n,{}),y&&t.block?e.jsxs("div",{className:"bg-accent/10 border-2 border-accent/40 rounded-lg p-4 text-sm flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 h-5 w-5 rounded border-2 border-accent bg-accent flex items-center justify-center flex-shrink-0",children:e.jsx(k,{className:"h-3.5 w-3.5 text-white"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-semibold text-foreground",children:[t.block.toLocaleString()," GTIN block recommended"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:t.totalGtins>1e5?`You need ${t.totalGtins.toLocaleString()} GTINs â let's start with a 100,000 block and add more later.`:`You need ${t.totalGtins.toLocaleString()} GTINs â a ${t.block.toLocaleString()} block gives you room to grow.`})]})]}):e.jsx("div",{className:"bg-muted/40 border border-dashed border-border rounded-lg p-4 text-sm text-center text-muted-foreground",children:"Enter your product numbers above to see a recommendation"})]})]})]})]})})]})}export{M 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.