1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[54499,17299],{17299:function(e,t,n){n.r(t),n.d(t,{default:function(){return c}});var r=n(57437),i=n(2265),l=n(53581),o=n(93843),a=n(49897);function c(e){let{onDetected:t,onClose:c}=e,s=(0,i.useRef)(null),[d,u]=(0,i.useState)(null),[p,f]=(0,i.useState)(!0);return(0,i.useEffect)(()=>{let e=!1,r=null;return(async()=>{try{let{BrowserMultiFormatReader:i}=await Promise.all([n.e(71872),n.e(79398)]).then(n.bind(n,79398)),{DecodeHintType:l,BarcodeFormat:a}=await n.e(71872).then(n.bind(n,71872)),c=new Map;c.set(l.POSSIBLE_FORMATS,[a.UPC_A,a.UPC_E,a.EAN_13,a.EAN_8]);let d=new i(c);if(e||!s.current)return;r=await d.decodeFromConstraints({video:{facingMode:"environment"}},s.current,n=>{if(!n||e)return;let i=n.getText();null===(0,o.b8)(i)&&(e=!0,null==r||r.stop(),t(String(i).replace(/\D/g,"")))}),e&&r.stop(),f(!1)}catch(t){var i;let e=null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"";f(!1),u("NotAllowedError"===e?"Camera permission was blocked. Allow camera access, or type the barcode instead.":"NotFoundError"===e?"No camera found on this device â type the barcode instead.":"Couldnât start the camera. Type the barcode instead.")}})(),()=>{e=!0;try{null==r||r.stop()}catch(e){}}},[t]),(0,r.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:1e3,background:"#000",display:"flex",flexDirection:"column",fontFamily:"var(--d-font-body)"},role:"dialog","aria-label":"Scan a barcode",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",color:"#e8e8e5",background:"rgba(0,0,0,0.6)"},children:[(0,r.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:600},children:[(0,r.jsx)(l.Z,{size:16})," Scan barcode"]}
1),(0,r.jsx)(a.Z,{onClick:c,label:"Close scanner",size:"lg",style:{color:"#e8e8e5"}})]}),(0,r.jsxs)("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:[(0,r.jsx)("video",{ref:s,style:{width:"100%",height:"100%",objectFit:"cover"},muted:!0,playsInline:!0}),!d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{position:"absolute",width:"min(78vw, 340px)",height:150,border:"2px solid rgba(127,184,76,0.9)",borderRadius:12,boxShadow:"0 0 0 100vmax rgba(0,0,0,0.45)"}}),(0,r.jsx)("div",{style:{position:"absolute",bottom:40,color:"#e8e8e5",fontSize:13,textShadow:"0 1px 2px #000",textAlign:"center",padding:"0 24px"},children:p?"Starting cameraâ¦":"Point the rear camera at the bottleâs barcode"})]}),d&&(0,r.jsxs)("div",{style:{position:"absolute",color:"#F0A0A0",background:"rgba(0,0,0,0.7)",fontSize:14,lineHeight:1.5,padding:"16px 20px",borderRadius:10,maxWidth:320,textAlign:"center"},children:[d,(0,r.jsx)("div",{style:{marginTop:14},children:(0,r.jsx)("button",{onClick:c,style:{background:"rgba(127,184,76,0.16)",border:"1px solid rgba(127,184,76,0.5)",color:"#7FB84C",borderRadius:8,padding:"8px 16px",fontSize:13,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",cursor:"pointer"},children:"Type it instead"})})]})]})]})}},93843:function(e,t,n){function r(e){let t=0,n=0;for(let r=0;r<e.length;r++){let i=Number(e[r]);r%2==0?t+=i:n+=i}return String((10-(3*t+n)%10)%10)}function i(e){if(null==e)return null;let t=String(e).trim();if(!t||/e\+?\d+/i.test(t))return null;let n=t.replace(/\D/g,"");if(!n)return null;let i=11===n.length?function(e){let t="0".concat(e);return 12===t.length&&r(t.slice(0,11))===t[11]?t:"".concat(e).concat(r(e))}(n):n;return[8,12,13,14].includes(i.length)?i:null}function l(e){let t=String(null!=e?e:"").trim();if(!t)return null;let n=i(t);return n?!function(e){let t=i(e);if(!t)return!1;let n=t.split("").map(Number),r=n.pop(),l=0;for(let e=n.length-1,t=3;e>=0;e--,t=3===t?1:3)l+=n[e]*t;return(10-l%10)%10===r}(n)?"That barcodeâs check digit doesnât match â re-scan or re-check it.":null:"Enter a valid 8, 12, 13, or 14-digit barcode."}n.d(t,{b8:function(){return l}})},53581:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(68755).Z)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]])}}]);
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.