1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="aaa1afa0-eda8-7eea-3d2b-23aee2625383")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,618566,(e,t,r)=>{t.exports=e.r(976562)},534792,e=>{"use strict";var t=e.i(843476),r=e.i(152236);e.s(["Skeleton",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,r.cn)("animate-pulse rounded-md bg-primary/10",e),...a})}])},197424,e=>{"use strict";let t="stocksmart:chat-open";function r(e={}){window.dispatchEvent(new CustomEvent(t,{detail:e}))}e.s(["BULK_IMPORT_LEARN_MORE_CHAT_PROMPT",0,"How does bulk item import work in StockSmartâfrom uploading a spreadsheet through items appearing in Item Management?","STOCKSMART_CHAT_OPEN_EVENT",0,t,"STOCKSMART_CHAT_PREFILL_EVENT",0,"stocksmart:chat-prefill","openStockSmartAssistant",0,r,"openStockSmartChatWithQuestion",0,function(e,t={}){let a=e.trim();a&&r({...t,message:a,startNewChat:t.startNewChat??!0})}])},172038,583063,e=>{"use strict";var t=e.i(271645),r=e.i(266027),a=e.i(912598);function i(e){return{...e,restaurant_ids:Array.from(new Set(e.restaurant_ids.map(e=>e.trim()).filter(Boolean))).sort(),search:e.search.trim().slice(0,100),include_inactive:!!e.include_inactive,limit:Math.min(Math.max(e.limit??10,1),25)}}function s(e){let t=i(e);return["item-search",t.org_id,t.restaurant_ids,t.search.toLowerCase(),t.include_inactive,t.limit]}async function n(e,t){let r=i(e),a=new URLSearchParams({org_id:r.org_id,restaurant_ids:r.restaurant_ids.join(","),search:r.search,include_inactive:String(r.include_inactive),limit:String(r.limit)}
2),s=await fetch(`/api/items/search?${a.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:t}),n=await s.json();if(!s.ok||!n.success)throw Error(n.error||"Failed to search items");return n.data||[]}async function l(e,t){let r=new URLSearchParams({org_id:e.org_id,restaurant_id:e.restaurant_id,limit:String(Math.min(Math.max(e.limit??3,1),10))}),a=await fetch(`/api/items/recent?${r.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:t}),i=await a.json();if(!a.ok||!i.success)throw Error(i.error||"Failed to load recently counted items");return i.data||[]}function o(e,t=100){let r=e.getQueryCache().findAll({queryKey:["item-search"],type:"inactive"}).sort((e,t)=>e.state.dataUpdatedAt-t.state.dataUpdatedAt);for(let a of r.slice(0,Math.max(0,r.length-t)))e.removeQueries({queryKey:a.queryKey,exact:!0})}e.s(["fetchItemSearch",0,n,"fetchRecentCountItems",0,l,"itemSearchQueryKey",0,s,"normalizeItemSearchInput",0,i,"pruneItemSearchCache",0,o],583063),e.s(["useItemSearch",0,function({org_id:e,restaurant_ids:l,search:u,include_inactive:c=!1,limit:d=10,minLength:h=2,debounceMs:f=160,enabled:m=!0}){let g=(0,a.useQueryClient)(),p=u.trim(),{debouncedValue:y,flush:E}=function(e,r){let[a,i]=(0,t.useState)(e),s=(0,t.useRef)(e),n=(0,t.useRef)(null);return(0,t.useEffect)(()=>(s.current=e,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>i(e),r),()=>{n.current&&clearTimeout(n.current)}),[r,e]),{debouncedValue:a,flush:(0,t.useCallback)(e=>{n.current&&clearTimeout(n.current),i(void 0===e?s.current:e)},[])}}(p,f),C=l.join(","),R=i({org_id:e||"",restaurant_ids:(0,t.useMemo)(()=>Array.from(new Set(l.map(e=>e.trim()).filter(Boolean))).sort(),[C]),search:y,include_inactive:c,limit:d}),w=m&&!!R.org_id&&R.restaurant_ids.length>0&&p.length>=h&&R.search.length>=h,v=(0,r.useQuery)({queryKey:s(R),queryFn:({signal:e})=>n(R,e),enabled:w,staleTime:6e4,gcTime:3e5,retry:1,placeholderData:(e,t)=>{let r=t?.queryKey,a=s(R);return r?.[0]===a[0]&&r?.[1]===a[1]&&JSON.stringify(r?.[2])===JSON.stringify(a[2])&&r?.[4]===a[4]?e:void 0}});return(0,t.useEffect)(()=>{v.data&&o(g)},[v.data,g]),{...v,results:w&&v.data||[],searchedQuery:y,isDebouncing:p!==y,canSearch:w,searchNow:e=>E(e?.trim())}}],172038)},993483,e=>{"use strict";let t=(0,e.i(388369).default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);e.s(["Target",0,t],993483)},302918,e=>{"use strict";let t=(0,e.i(388369).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],302918)},318064,e=>{"use strict";var t=e.i(271645);let r={status:"idle",sessionId:null,deepLink:null,expiresAt:null,result:null,error:null};e.s(["useBridgeSession",0,function({intent:e,orgId:a,onResult:i,metadata:s,ttlSeconds:n}){let[l,o]=(0,t.useState)(r),u=(0,t.useRef)(null),c=(0,t.useRef)(null),d=(0,t.useRef)(i),h=(0,t.useRef)(!1);(0,t.useEffect)(()=>{d.current=i},[i]);let f=(0,t.useCallback)(()=>{null!==u.current&&(clearInterval(u.current),u.current=null)},[]),m=(0,t.useCallback)(async()=>{let e=c.current;
2if(f(),c.current=null,e)try{await fetch(`/api/desktop-bridge/sessions/${e}`,{method:"DELETE"})}catch{}},[f]),g=(0,t.useCallback)(()=>{f(),c.current=null,h.current=!1,o(r)},[f]),p=(0,t.useCallback)(async()=>{let e=c.current;if(e)try{let t=await fetch(`/api/desktop-bridge/sessions/${e}`),r=await t.json();if(!t.ok||!r?.success)throw Error(r?.error||"Failed to load session");let a=r.data;o(e=>({...e,status:a.status,result:a.result??null,expiresAt:a.expires_at})),"completed"===a.status?(f(),!h.current&&(h.current=!0,a.result&&d.current?.(a.result))):("expired"===a.status||"cancelled"===a.status||"failed"===a.status)&&f()}catch(e){o(t=>({...t,status:"error",error:e?.message||"Failed to poll bridge session"})),f()}},[f]),y=(0,t.useCallback)(async()=>{if(!a)return void o({...r,status:"error",error:"Missing organization context"});await m(),h.current=!1,o({...r,status:"creating"});try{let t=await fetch("/api/desktop-bridge/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org_id:a,intent:e,metadata:s,ttl_seconds:n})}),r=await t.json();if(!t.ok||!r?.success)throw Error(r?.error||"Failed to create bridge session");let i=r.data;c.current=i.id,o({status:"pending",sessionId:i.id,deepLink:i.deep_link??null,expiresAt:i.expires_at,result:null,error:null}),f(),u.current=setInterval(()=>{p()},2e3)}catch(e){o({...r,status:"error",error:e?.message||"Failed to create bridge session"})}},[a,e,s,n,m,p,f]);return(0,t.useEffect)(()=>()=>{f();let e=c.current;e&&fetch(`/api/desktop-bridge/sessions/${e}`,{method:"DELETE"})},[f]),{state:l,start:y,cancel:m,reset:g}}])},965973,e=>{"use strict";let t=(0,e.i(388369).default)("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]]);e.s(["Store",0,t],965973)},96222,e=>{"use strict";var t=e.i(271645),r=e.i(981140),a=e.i(30030),i=e.i(369340),s=e.i(934620),n=e.i(820783),l=e.i(248425),o=e.i(296626),u=e.i(610772),c=e.i(843476),d="Collapsible",[h,f]=(0,a.createContextScope)(d),[m,g]=h(d),p=t.forwardRef((e,r)=>{let{__scopeCollapsible:a,open:s,defaultOpen:n,disabled:o,onOpenChange:h,...f}=e,[g,p]=(0,i.useControllableState)({prop:s,defaultProp:n??!1,onChange:h,caller:d});return(0,c.jsx)(m,{scope:a,disabled:o,contentId:(0,u.useId)(),open:g,onOpenToggle:t.useCallback(()=>p(e=>!e),[p]),children:(0,c.jsx)(l.Primitive.div,{"data-state":v(g),"data-disabled":o?"":void 0,...f,ref:r})})});p.displayName=d;var y="CollapsibleTrigger",E=t.forwardRef((e,t)=>{let{__scopeCollapsible:a,...i}=e,s=g(y,a);return(0,c.jsx)(l.Primitive.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":v(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...i,ref:t,onClick:(0,r.composeEventHandlers)(e.onClick,s.onOpenToggle)})});E.displayName=y;var C="CollapsibleContent",R=t.forwardRef((e,t)=>{let{forceMount:r,...a}=e,i=g(C,e.__scopeCollapsible);return(0,c.jsx)(o.Presence,{present:r||i.open,children:({present:e})=>(0,c.jsx)(w,{...a,ref:t,present:e})})});R.displayName=C;var w=t.forwardRef((e,r)=>{let{__scopeCollapsible:a,present:i,children:o,...u}=e,d=g(C,a),[h,f]=t.useState(i),m=t.useRef(null),p=(0,n.useComposedRefs)(r,m),y=t.useRef(0),E=y.current,R=t.useRef(0),w=R.current,M=d.open||h,N=t.useRef(M),A=t.useRef(void 0);return t.useEffect(()=>{let e=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,s.useLayoutEffect)(()=>{let e=m.current;if(e){A.current=A.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();y.current=t.height,R.current=t.width,N.current||(e.style.transitionDuration=A.current.transitionDuration,e.style.animationName=A.current.animationName),f(i)}},[d.open,i]),(0,c.jsx)(l.Primitive.div,{"data-state":v(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!M,...u,ref:p,style:{"--radix-collapsible-content-height":E?`${E}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:M&&o})});function v(e){return e?"open":"closed"}e.s(["Collapsible",0,p,"CollapsibleContent",0,R,"CollapsibleTrigger",0,E],96222)},197873,e=>{"use strict";let t=(0,e.i(388369).default)("barcode",[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M8 5v14",key:"1ybrkv"}],["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"M17 5v14",key:"ycjyhj"}],["path",{d:"M21 5v14",key:"nzette"}]]);e.s(["Barcode",0,t],197873)},878835,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(30030),i=e.i(820783),s=e.i(326999),n=e.i(981140),l="AlertDialog",[o,u]=(0,a.createContextScope)(l,[s.createDialogScope]),c=(0,s.createDialogScope)(),d=e=>{let{__scopeAlertDialog:r,...a}=e,i=c(r);return(0,t.jsx)(s.Root,{...i,...a,modal:!0})};d.displayName=l;var h=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...i}=e,n=c(a);return(0,t.jsx)(s.Trigger,{...n,...i,ref:r})});h.displayName="AlertDialogTrigger";var f=e=>{let{__scopeAlertDialog:r,...a}=e,i=c(r);return(0,t.jsx)(s.Portal,{...i,...a}
2)};f.displayName="AlertDialogPortal";var m=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...i}=e,n=c(a);return(0,t.jsx)(s.Overlay,{...n,...i,ref:r})});m.displayName="AlertDialogOverlay";var g="AlertDialogContent",[p,y]=o(g),E=r.forwardRef((e,a)=>{let{__scopeAlertDialog:l,children:o,...u}=e,d=c(l),h=r.useRef(null),f=(0,i.useComposedRefs)(a,h),m=r.useRef(null);return(0,t.jsx)(p,{scope:l,cancelRef:m,children:(0,t.jsx)(s.Content,{role:"alertdialog",...d,...u,ref:f,onOpenAutoFocus:(0,n.composeEventHandlers)(u.onOpenAutoFocus,e=>{e.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:o})})});E.displayName=g;var C=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...i}=e,n=c(a);return(0,t.jsx)(s.Title,{...n,...i,ref:r})});C.displayName="AlertDialogTitle";var R=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...i}=e,n=c(a);return(0,t.jsx)(s.Description,{...n,...i,ref:r})});R.displayName="AlertDialogDescription";var w=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...i}=e,n=c(a);return(0,t.jsx)(s.Close,{...n,...i,ref:r})});w.displayName="AlertDialogAction";var v="AlertDialogCancel",M=r.forwardRef((e,r)=>{let{__scopeAlertDialog:a,...n}=e,{cancelRef:l}=y(v,a),o=c(a),u=(0,i.useComposedRefs)(r,l);return(0,t.jsx)(s.Close,{...o,...n,ref:u})});M.displayName=v;var N=e.i(152236),A=e.i(466691);let S=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(m,{className:(0,N.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:a}));S.displayName=m.displayName;let b=r.forwardRef(({className:e,overlayClassName:r,...a},i)=>(0,t.jsxs)(f,{children:[(0,t.jsx)(S,{className:r}),(0,t.jsx)(E,{ref:i,className:(0,N.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a})]}));b.displayName=E.displayName;let x=({className:e,...r})=>(0,t.jsx)("div",{className:(0,N.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...r});x.displayName="AlertDialogHeader";let _=({className:e,...r})=>(0,t.jsx)("div",{className:(0,N.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});_.displayName="AlertDialogFooter";let P=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(C,{ref:a,className:(0,N.cn)("text-lg font-semibold",e),...r}));P.displayName=C.displayName;let k=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(R,{ref:a,className:(0,N.cn)("text-sm text-muted-foreground",e),...r}));k.displayName=R.displayName;let I=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(w,{ref:a,className:(0,N.cn)((0,A.buttonVariants)(),e),...r}));I.displayName=w.displayName;let D=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)(M,{ref:a,className:(0,N.cn)((0,A.buttonVariants)({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));D.displayName=M.displayName,e.s(["AlertDialog",0,d,"AlertDialogAction",0,I,"AlertDialogCancel",0,D,"AlertDialogContent",0,b,"AlertDialogDescription",0,k,"AlertDialogFooter",0,_,"AlertDialogHeader",0,x,"AlertDialogTitle",0,P,"AlertDialogTrigger",0,h],878835)},928835,e=>{"use strict";let t,r;var a,i,s,n,l,o=e.i(271645),u=Object.defineProperty,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(e,t,r)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))d.call(t,r)&&f(e,r,t[r]);if(c)for(var r of c(t))h.call(t,r)&&f(e,r,t[r]);return e},g=(e,t)=>{var r={};for(var a in e)d.call(e,a)&&0>t.indexOf(a)&&(r[a]=e[a]);if(null!=e&&c)for(var a of c(e))0>t.indexOf(a)&&h.call(e,a)&&(r[a]=e[a]);return r};(e=>{let t=class t{constructor(e,r,a,s){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError("Version value out of range");if(s<-1||s>7)throw RangeError("Mask value out of range");this.size=4*e+17;let n=[];for(let e=0;e<this.size;e++)n.push(!1);for(let e=0;e<this.size;e++)this.modules.push(n.slice()),this.isFunction.push(n.slice());this.drawFunctionPatterns();const l=this.addEccAndInterleave(a);if(this.drawCodewords(l),-1==s){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const r=this.getPenaltyScore();r<e&&(s=t,e=r),this.applyMask(t)}}i(0<=s&&s<=7),this.mask=s,this.applyMask(s),this.drawFormatBits(s),this.isFunction=[]}static encodeText(r,a){let i=e.QrSegment.makeSegments(r);return t.encodeSegments(i,a)}static encodeBinary(r,a){let i=e.QrSegment.makeBytes(r);return t.encodeSegments([i],a)}static encodeSegments(e,a,s=1,l=40,o=-1,u=!0){let c,d;if(!(t.MIN_VERSION<=s&&s<=l&&l<=t.MAX_VERSION)||o<-1||o>7)throw RangeError("Invalid value");for(c=s;;c++){let r=8*t.getNumDataCodewords(c,a),i=n.getTotalBits(e,c);if(i<=r){d=i;break}if(c>=l)throw RangeError("Data too long")}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&d<=8*t.getNumDataCodewords(c,e)&&(a=e);let h=[];for(let t of e)for(let e of(r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(c),h),t.getData()))h.push(e);i(h.length==d);let f=8*t.getNumDataCodewords(c,a);i(h.length<=f),r(0,Math.min(4,f-h.length),h),r(0,(8-h.length%8)%8,h),i(h.length%8==0);for(let e=236;h.length<f;e^=253)r(e,8,h);let m=[];for(;8*m.length<h.length;)m.push(0);return h.forEach((e,t)=>m[t>>>3]|=e<<7-(7&t)),new t(c,a,m,o)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let r=0;r<t;r++)for(let a=0;a<t;a++)(0!=r||0!=a)&&(0!=r||a!=t-1)&&(r!=t-1||0!=a)&&this.drawAlignmentPattern(e[r],e[a]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,r=t;for(let e=0;e<10;e++)r=r<<1^(r>>>9)*1335;let s=(t<<10|r)^21522;i(s>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,a(s,e));this.setFunctionModule(8,7,a(s,6)),this.setFunctionModule(8,8,a(s,7)),this.setFunctionModule(7,8,a(s,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,a(s,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,a(s,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,a(s,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let r=a(t,e),i=this.size-11+e%3,s=Math.floor(e/3);this.setFunctionModule(i,s,r),this.setFunctionModule(s,i,r)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let a=-4;a<=4;a++){let i=Math.max(Math.abs(a),Math.abs(r)),s=e+a,n=t+r;0<=s&&s<this.size&&0<=n&&n<this.size&&this.setFunctionModule(s,n,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let r=-2;r<=2;r++)for(let a=-2;a<=2;a++)this.setFunctionModule(e+a,t+r,1!=Math.max(Math.abs(a),Math.abs(r)))}setFunctionModule(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0}addEccAndInterleave(e){let r=this.version,a=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(r,a))throw RangeError("Invalid argument");let s=t.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][r],n=t.ECC_CODEWORDS_PER_BLOCK[a.ordinal][r],l=Math.floor(t.getNumRawDataModules(r)/8),o=s-l%s,u=Math.floor(l/s),c=[],d=t.reedSolomonComputeDivisor(n);for(let r=0,a=0;r<s;r++){let i=e.slice(a,a+u-n+(r<o?0:1));a+=i.length;let s=t.reedSolomonComputeRemainder(i,d);r<o&&i.push(0),c.push(i.concat(s))}let h=[];for(let e=0;e<c[0].length;e++)c.forEach((t,r)=>{(e!=u-n||r>=o)&&h.push(t[e])});return i(h.length==l),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let i=0;i<this.size;i++)for(let s=0;s<2;s++){let n=t-s,l=(t+1&2)==0?this.size-1-i:i;!this.isFunction[l][n]&&r<8*e.length&&(this.modules[l][n]=a(e[r>>>3],7-(7&r)),r++)}}i(r==8*e.length)}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let a;switch(e){case 0:a=(r+t)%2==0;break;case 1:a=t%2==0;break;case 2:a=r%3==0;break;case 3:a=(r+t)%3==0;break;case 4:a=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:a=r*t%2+r*t%3==0;break;case 6:a=(r*t%2+r*t%3)%2==0;break;case 7:a=((r+t)%2+r*t%3)%2==0;break;default:throw Error("Unreachable")}!this.isFunction[t][r]&&a&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let e=0;for(let r=0;r<this.size;r++){let a=!1,i=0,s=[0,0,0,0,0,0,0];for(let n=0;n<this.size;
vendor: 7,094 bytes, line 2
2n++)this.modules[r][n]==a?5==++i?e+=t.PENALTY_N1:i>5&&e++:(this.finderPenaltyAddHistory(i,s),a||(e+=this.finderPenaltyCountPatterns(s)*t.PENALTY_N3),a=this.modules[r][n],i=1);e+=this.finderPenaltyTerminateAndCount(a,i,s)*t.PENALTY_N3}for(let r=0;r<this.size;r++){let a=!1,i=0,s=[0,0,0,0,0,0,0];for(let n=0;n<this.size;n++)this.modules[n][r]==a?5==++i?e+=t.PENALTY_N1:i>5&&e++:(this.finderPenaltyAddHistory(i,s),a||(e+=this.finderPenaltyCountPatterns(s)*t.PENALTY_N3),a=this.modules[n][r],i=1);e+=this.finderPenaltyTerminateAndCount(a,i,s)*t.PENALTY_N3}for(let r=0;r<this.size-1;r++)for(let a=0;a<this.size-1;a++){let i=this.modules[r][a];i==this.modules[r][a+1]&&i==this.modules[r+1][a]&&i==this.modules[r+1][a+1]&&(e+=t.PENALTY_N2)}let r=0;for(let e of this.modules)r=e.reduce((e,t)=>e+ +!!t,r);let a=this.size*this.size,s=Math.ceil(Math.abs(20*r-10*a)/a)-1;return i(0<=s&&s<=9),i(0<=(e+=s*t.PENALTY_N4)&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{let e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),r=[6];for(let a=this.size-7;r.length<e;a-=t)r.splice(1,0,a);return r}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return i(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError("Degree out of range");let r=[];for(let t=0;t<e-1;t++)r.push(0);r.push(1);let a=1;for(let i=0;i<e;i++){for(let e=0;e<r.length;e++)r[e]=t.reedSolomonMultiply(r[e],a),e+1<r.length&&(r[e]^=r[e+1]);a=t.reedSolomonMultiply(a,2)}return r}static reedSolomonComputeRemainder(e,r){let a=r.map(e=>0);for(let i of e){let e=i^a.shift();a.push(0),r.forEach((r,i)=>a[i]^=t.reedSolomonMultiply(r,e))}return a}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let r=0;for(let a=7;a>=0;a--)r=r<<1^(r>>>7)*285^(t>>>a&1)*e;return i(r>>>8==0),r}finderPenaltyCountPatterns(e){let t=e[1];i(t<=3*this.size);let r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function r(e,t,r){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let a=t-1;a>=0;a--)r.push(e>>>a&1)}function a(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;let s=class e{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let a=[];for(let e of t)r(e,8,a);return new e(e.Mode.BYTE,t.length,a)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError("String contains non-numeric characters");let a=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);r(parseInt(t.substring(e,e+i),10),3*i+1,a),e+=i}return new e(e.Mode.NUMERIC,t.length,a)}static makeAlphanumeric(t){let a;if(!e.isAlphanumeric(t))throw RangeError("String contains unencodable characters in alphanumeric mode");let i=[];for(a=0;a+2<=t.length;a+=2){let s=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a));r(s+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a+1)),11,i)}return a<t.length&&r(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a)),6,i),new e(e.Mode.ALPHANUMERIC,t.length,i)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let a=[];if(t<0)throw RangeError("ECI assignment value out of range");if(t<128)r(t,8,a);else if(t<16384)r(2,2,a),r(t,14,a);else if(t<1e6)r(6,3,a),r(t,21,a);else throw RangeError("ECI assignment value out of range");return new e(e.Mode.ECI,0,a)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let r=0;for(let a of e){let e=a.mode.numCharCountBits(t);if(a.numChars>=1<<e)return 1/0;r+=4+e+a.bitData.length}return r}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let r=0;r<e.length;r++)"%"!=e.charAt(r)?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t}};s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let n=s;e.QrSegment=s})(l||(l={})),i=(a=l||(l={})).QrCode||(a.QrCode={}),(t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}}).LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),i.Ecc=t,n=(s=l||(l={})).QrSegment||(s.QrSegment={}),(r=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}}).NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),n.Mode=r;var p=l,y={L:p.QrCode.Ecc.LOW,M:p.QrCode.Ecc.MEDIUM,Q:p.QrCode.Ecc.QUARTILE,H:p.QrCode.Ecc.HIGH},E="#FFFFFF",C="#000000";function R(e,t=0){let r=[];return e.forEach(function(e,a){let i=null;e.forEach(function(s,n){if(!s&&null!==i){r.push(`M${i+t} ${a+t}h${n-i}v1H${i+t}z`),i=null;return}if(n===e.length-1){if(!s)return;null===i?r.push(`M${n+t},${a+t} h1v1H${n+t}z`):r.push(`M${i+t},${a+t} h${n+1-i}v1H${i+t}z`);return}s&&null===i&&(i=n)})}),r.join("")}function w(e,t){return e.slice().map((e,r)=>r<t.y||r>=t.y+t.h?e:e.map((e,r)=>(r<t.x||r>=t.x+t.w)&&e))}function v({value:e,level:t,minVersion:r,includeMargin:a,marginSize:i,imageSettings:s,size:n,boostLevel:l}){let u=o.default.useMemo(()=>{let a=(Array.isArray(e)?e:[e]).reduce((e,t)=>
2(e.push(...p.QrSegment.makeSegments(t)),e),[]);return p.QrCode.encodeSegments(a,y[t],r,void 0,void 0,l)},[e,t,r,l]),{cells:c,margin:d,numCells:h,calculatedImageSettings:f}=o.default.useMemo(()=>{let e=u.getModules(),t=null!=i?Math.max(Math.floor(i),0):4*!!a,r=e.length+2*t,l=function(e,t,r,a){if(null==a)return null;let i=e.length+2*r,s=Math.floor(.1*t),n=i/t,l=(a.width||s)*n,o=(a.height||s)*n,u=null==a.x?e.length/2-l/2:a.x*n,c=null==a.y?e.length/2-o/2:a.y*n,d=null==a.opacity?1:a.opacity,h=null;if(a.excavate){let e=Math.floor(u),t=Math.floor(c),r=Math.ceil(l+u-e),a=Math.ceil(o+c-t);h={x:e,y:t,w:r,h:a}}return{x:u,y:c,h:o,w:l,excavation:h,opacity:d,crossOrigin:a.crossOrigin}}(e,n,t,s);return{cells:e,margin:t,numCells:r,calculatedImageSettings:l}},[u,n,s,a,i]);return{qrcode:u,margin:d,cells:c,numCells:h,calculatedImageSettings:f}}var M=function(){try{new Path2D().addPath(new Path2D)}catch(e){return!1}return!0}();o.default.forwardRef(function(e,t){let{value:r,size:a=128,level:i="L",bgColor:s=E,fgColor:n=C,includeMargin:l=!1,minVersion:u=1,boostLevel:c,marginSize:d,imageSettings:h}=e,f=g(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:p}=f,y=g(f,["style"]),N=null==h?void 0:h.src,A=o.default.useRef(null),S=o.default.useRef(null),b=o.default.useCallback(e=>{A.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]),[x,_]=o.default.useState(!1),{margin:P,cells:k,numCells:I,calculatedImageSettings:D}=v({value:r,level:i,minVersion:u,boostLevel:c,includeMargin:l,marginSize:d,imageSettings:h,size:a});o.default.useEffect(()=>{if(null!=A.current){let e=A.current,t=e.getContext("2d");if(!t)return;let r=k,i=S.current,l=null!=D&&null!==i&&i.complete&&0!==i.naturalHeight&&0!==i.naturalWidth;l&&null!=D.excavation&&(r=w(k,D.excavation));let o=window.devicePixelRatio||1;e.height=e.width=a*o;let u=a/I*o;t.scale(u,u),t.fillStyle=s,t.fillRect(0,0,I,I),t.fillStyle=n,M?t.fill(new Path2D(R(r,P))):k.forEach(function(e,r){e.forEach(function(e,a){e&&t.fillRect(a+P,r+P,1,1)})}),D&&(t.globalAlpha=D.opacity),l&&t.drawImage(i,D.x+P,D.y+P,D.w,D.h)}}),o.default.useEffect(()=>{_(!1)},[N]);let O=m({height:a,width:a},p),T=null;return null!=N&&(T=o.default.createElement("img",{src:N,key:N,style:{display:"none"},onLoad:()=>{_(!0)},ref:S,crossOrigin:null==D?void 0:D.crossOrigin})),o.default.createElement(o.default.Fragment,null,o.default.createElement("canvas",m({style:O,height:a,width:a,ref:b,role:"img"},y)),T)}).displayName="QRCodeCanvas";var N=o.default.forwardRef(function(e,t){let{value:r,size:a=128,level:i="L",bgColor:s=E,fgColor:n=C,includeMargin:l=!1,minVersion:u=1,boostLevel:c,title:d,marginSize:h,imageSettings:f}=e,p=g(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:y,cells:M,numCells:N,calculatedImageSettings:A}=v({value:r,level:i,minVersion:u,boostLevel:c,includeMargin:l,marginSize:h,imageSettings:f,size:a}),S=M,b=null;null!=f&&null!=A&&(null!=A.excavation&&(S=w(M,A.excavation)),b=o.default.createElement("image",{href:f.src,height:A.h,width:A.w,x:A.x+y,y:A.y+y,preserveAspectRatio:"none",opacity:A.opacity,crossOrigin:A.crossOrigin}));let x=R(S,y);return o.default.createElement("svg",m({height:a,width:a,viewBox:`0 0 ${N} ${N}`,ref:t,role:"img"},p),!!d&&o.default.createElement("title",null,d),o.default.createElement("path",{fill:s,d:`M0,0 h${N}v${N}H0z`,shapeRendering:"crispEdges"}),o.default.createElement("path",{fill:n,d:x,shapeRendering:"crispEdges"}),b)});N.displayName="QRCodeSVG",e.s(["QRCodeSVG",0,N])}]); 3 4//# debugId=aaa1afa0-eda8-7eea-3d2b-23aee2625383
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.