PageSourceSearch

https://azanaspa.com/static/js/async/2882.29376abc75.js

js azanaspa.com collected 2026-10-04 10:30:51 UTC 73,264 bytes, 7 lines download raw bytes

1"use strict";(self.rspackChunkvagaro_websitebuilder_consumer=self.rspackChunkvagaro_websitebuilder_consumer||[]).push([[2882],{59189(e,t,o){o.d(t,{A:()=>i});var a=o(74848),n=o(96540),l=o(40961),r=o(98232);let i=({children:e,wrapperElement:t="div",wrapperElementId:o="divId",inputRef:i,type:s,DropdownDirection:d="auto",wrapperName:c="",openInCenter:p=!1,glassDesign:u=!1})=>{let[h,T]=(0,n.useState)(null),[g,w]=(0,n.useState)(0),[m,S]=(0,n.useState)(0),y=(0,n.useRef)(null),[C,O]=(0,n.useState)({top:0,left:0}),f=r.Wp.CheckIsProApp(),[N,D]=(0,n.useState)(e?.props?.children?.length);return((0,n.useLayoutEffect)(()=>{if(!h||!h.firstElementChild)return;let e=h.firstElementChild,t=e?.getBoundingClientRect(),o=0,a=h.children;for(let e=0;e<a.length;e++)o+=a[e].scrollHeight;w(o),S(t?.width||700)},[h,o,e]),(0,n.useLayoutEffect)(()=>{O((()=>{let t,a,l;if(!i?.current)return{top:0,left:0};let h=i?.current?.getBoundingClientRect();if(!h||!h?.width&&!h.height)return{top:0,left:0};let T=85*!!u,w=window.innerHeight-h.bottom-(("threedotmenu"===o||"NestedDropdownPortal"===o)&&f?85:0)-T,S=h.top-T;if("ColorPicker"===o)t=420;else if("threedotmenu"===o||"threedotmenu"===c)t=36*(N||0)+10;else if("daterpicker"===o)t=340;else if("timepicker"===o||o.startsWith("timepicker-"))t=160;else if("dropdownmenu"===o)t=36*(e?.props?.children[0].length||0)+32;else if("NestedDropdownPortal"===o)t=38*(N||0)+8;else if("phonecountry"===o)t=257;else if("inputtogglemenu"===o){let o=e?.props?.children?.[1],a=(o?n.Children.toArray(o.props?.children).filter(Boolean):[]).length;t=a>0?41.8*a+53.6:179}else t="dotphrase-portal"===o?38*(N||0)+60:"gif-picker-portal"===o?370:"emoji-picker-portal"===o?369:p&&"daterangepicker"===o?490:258;let y=g||t,C=h.left,O=window.innerWidth-h.right,D=m||700,E=h.left+window.scrollX,I=!1;if(s===r.IU.addressSuggestions){let e=window.innerHeight,t=e/3,o=2*e/3,n=h.top<t,l=h.top>=t&&h.top<=o;a=h.top>o?h.top+window.scrollY-y:l||n||w>=y?h.bottom+window.scrollY:S>=y?h.top+window.scrollY-y:h.bottom+window.scrollY}else s===r.IU.timePickerRight?a=w<y&&S>=y?h.top+window.scrollY-y:h.bottom+window.scrollY:w>=y?a=h.bottom+window.scrollY:S>=y?a=h.top+window.scrollY-y:p&&("daterangepicker"===o||"daterpicker"===o)?(a=window.scrollY+Math.max(0,(window.innerHeight-y)/2),I=!0):a=h.bottom+window.scrollY;if("dotphrase-portal"===o){let e=g||38*(N||0)+20,t=m||320,o=window.innerWidth-h.left;h.right;let a=window.innerHeight-h.bottom;h.top;let n=a>=e?h.bottom+window.scrollY:h.top+window.scrollY-e-16,l=o>=t?h.left+window.scrollX:h.right+window.scrollX-t;return l=Math.max(window.scrollX+8,Math.min(l,window.scrollX+window.innerWidth-t-8)),{top:n=Math.max(window.scrollY+8,Math.min(n,window.scrollY+window.innerHeight-e-8)),left:l}}if(("daterangepicker"===o||"daterpicker"===o||"phonecountry"===o)&&s===r.IU.dateRangePickerAutoPosition)if(p&&I)E=window.scrollX+Math.max(0,(window.innerWidth-D)/2),l=void 0;else if(O+h?.width>=D)E=h.left+window.scrollX,l=void 0;else if(C+h?.width>=D)l=window.innerWidth-(h.right+window.scrollX),E=void 0;else{let e=window.innerWidth;h.left<e/2?(E=window.scrollX,l=void 0):"phonecountry"===o?l=void 0:(l=0,E=void 0)}else if("phonecountry"===o&&s===r.IU.phonecountry)O>=328?(E=h.left+window.scrollX,l=void 0):C>=328?(l=window.innerWidth-(h.right+window.scrollX),E=void 0):O>=C?(E=h.left+window.scrollX,l=void 0):(l=window.innerWidth-(h.right+window.scrollX),E=void 0);else switch(s){case r.IU.action:E=C<O?h.left+window.scrollX:window.innerWidth-O-(h?.width||328);break;case r.IU.timePickerRight:h?.width;let _=window.innerWidth,x=navigator.userAgent,v=/^((?!chrome|android).)*safari/i.test(x),R=navigator.platform.toUpperCase().indexOf("MAC")>=0;l=_-(h.right+window.scrollX+(v||R?0:10));break;case r.IU.threeDotmenu:a=w<y&&S>=y?h.top+window.scrollY-y:h.bottom+window.scrollY;let L=window.visualViewport?.width??document.documentElement.clientWidth??window.innerWidth,P=m||0,A=h.right>=P,b=L-h.left>=P;("left"===d?!P||b||!A:P&&!A&&b)?(E=h.left+window.scrollX,l=void 0):(l=Math.round(L-h.right),E=void 0);break;case r.IU.smileyPicker:E=h.right+window.scrollX-240;break;case r.IU.tableGrid:{let e=window.scrollX+8,t=window.scrollX+window.innerWidth-8,o=window.visualVie
1wport,n=o?window.innerHeight-o.height:0;a=null!=o&&n>80?h.top+window.scrollY-y:w>=y?h.bottom+window.scrollY:S>=y?h.top+window.scrollY-y:w>=S?h.bottom+window.scrollY:h.top+window.scrollY-y,E=O>=D?h.left+window.scrollX:C>=D?h.right+window.scrollX-D:Math.max(e,Math.min(h.left+window.scrollX,t-D));break}case r.IU.dateRangePickerRight:l=window.innerWidth-(h.right+window.scrollX);break;case r.IU.gifPicker:{let e=window.innerWidth-h.left,t=h.right;E=e>=343?h.left+window.scrollX:t>=343?h.right+window.scrollX-335:window.scrollX+Math.max(8,Math.min(h.left,window.innerWidth-335-8));break}case r.IU.emojiPicker:{let e=y||369;a=w>=e+4?h.bottom+window.scrollY+4:S>=e+4?h.top+window.scrollY-e-4:w>S?h.bottom+window.scrollY+4:h.top+window.scrollY-e-4;let t=h.left+window.scrollX;t+360>window.innerWidth+window.scrollX-8&&(t=window.innerWidth+window.scrollX-360-8),t<window.scrollX+8&&(t=window.scrollX+8),E=t;break}default:E=h.left+window.scrollX}if("dropdownmenu"===o&&d&&"auto"!==d){let e,t=window.innerHeight-h.bottom,o=h.top;return"right"===d?e=h.right+window.scrollX:"left"===d&&(e=h.left-h.width+window.scrollX),{top:t>=y?h.top+window.scrollY:o>=y?h.bottom+window.scrollY-y:h.top+window.scrollY,left:e}}return void 0!==l?{top:a,right:l}:{top:a,left:E}})())},[i,g,s,o,e]),(0,n.useEffect)(()=>{let e=y.current;if(!e||!e.firstElementChild)return;let t=()=>{let t=e.firstElementChild,o=t?.getBoundingClientRect(),a=0,n=e.children;for(let e=0;e<n.length;e++)a+=n[e].offsetHeight;w(a),S(o?.width||700)};t();let o=new ResizeObserver(t),a=new MutationObserver(t);return o.observe(e),a.observe(e,{childList:!0,subtree:!0}),()=>{o.disconnect(),a.disconnect()}},[e,o,s]),(0,n.useEffect)(()=>{let e,a=document.getElementById(o);a||((e=document.createElement(t)).setAttribute("id",o),""!==o&&("Popup-change-log-popup"===o&&e.setAttribute("data-identity","history"),"Popup-renter-popup"===o&&e.setAttribute("data-identity","sub-history")),document.body.appendChild(e),a=e),y.current=a,T(a);try{let e=i?.current??null,t=e?e.closest("[data-popup-id]"):null,o=t?.getAttribute("data-popup-id");o?a.setAttribute("data-parent-popup-id",o):a.removeAttribute("data-parent-popup-id")}catch{}return()=>{a&&document.body.contains(a)&&document.body.removeChild(a)}},[o,t]),null===h)?null:(0,l.createPortal)((0,a.jsx)("div",{style:{position:"absolute",...C,..."dropdownmenu"===o||"table-grid-portal"===o||"threedotmenu"===o||"threedotmenu"===c||"emoji-picker-portal"===o||"gif-picker-portal"===o?{zIndex:9999}:{}},children:e}),h)}},91405(e,t,o){o.r(t),o.d(t,{default:()=>_});var a=o(74848),n=o(96540),l=o(95851),r=o(87107),i=o(82973),s=o(2091),d=o(80401);let c=e=>{let{DropdownType:t,customerTab:o,handleTabOnChange:r,TotalRecord:c,options:p,selectedOption:u,LoadMorCutomer:h,IsLoading:T,LoadingMessage:g,InTodayTotalRecord:w,SaveForLaterTotalRecord:m,handleGroupCustomer:S,handleCreateNew:y,ShowCreateNew:C,ShowFooter:O,menuListRef:f}=e.selectProps,N=e=>{let{scrollTop:t,scrollHeight:o,clientHeight:a}=e.currentTarget;(t+a)/o*100>=90&&T&&(f.current&&f.current.scrollIntoView({block:"center"}),h())};return t===i.Nw.SingleDropdown?(0,a.jsxs)(n.Fragment,{children:[(0,a.jsxs)(l.c.MenuList,{...e,innerRef:f,innerProps:{...e.innerProps,onScroll:N},children:[e.children,!T&&(0,a.jsx)("div",{className:"vgCustomerSelect__menu-notice",children:g})]}),C&&(0,a.jsx)("div",{className:"vgCustomer-create",children:(0,a.jsxs)("button",{type:"button",onClick:y,children:[(0,a.jsx)("span",{children:(0,a.jsx)("svg",{viewBox:"0 0 14 13",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M13.0938 6.375C13.0938 6.90234 12.6543 7.3418 12.1562 7.3418H7.9375V11.5605C7.9375 12.0586 7.49805 12.4688 7 12.4688C6.47266 12.4688 6.0625 12.0586 6.0625 11.5605V7.3418H1.84375C1.31641 7.3418 0.90625 6.90234 0.90625 6.375C0.90625 5.87695 1.31641 5.4668 1.84375 5.4668H6.0625V1.24805C6.0625 0.720703 6.47266 0.28125 7 0.28125C7.49805 0.28125 7.9375 0.720703 7.9375 1.24805V5.4668H12.1562C12.6543 5.4375 13.0938 5.87695 13.0938 6.375Z"})})}),"Create New"]})}),O&&(0,a.jsx)(n.Fragment,{children:"0"===c.toString()?(0,a.jsx)("div",{className:"VgCustomerDDItmeCount",children:(0,a.jsx)("span",{children:"No Matches"})}):(0,a.jsx)("div",{className:"VgCustomerDDItmeCount",children:(0,a.jsxs)("span",{children:["Items ",(0,a.jsxs)("strong",{children:["1-",p.length]})," out of ",(0,a.jsx)("strong",{children:" "+c})]})})})]}):t===i.Nw.ThreeTabDropdown?(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)(s.default,{ActiveTab:o,BottomBorder:!0,Name:[{id:1,name:"In Today"},{id:2,name:"All Customers"},{id:3,name:"Save For Later"}],NoOfTab:"3",TabPosition:"left",TabSize:"medium",TabVariant:"horizontal",onClick:e=>{r(e)}}),(0,a.jsxs)(l.c.MenuList,{...e,innerRef:f,innerProps:{...e.innerProps,onScroll:N}
1,children:[e.children,!T&&o===i.Ku.AllCustomer&&(0,a.jsx)("div",{className:"vgCustomerSelect__menu-notice",children:g})]}),u.length>0&&o===i.Ku.InToday&&(0,a.jsx)("div",{className:"vgCustomerSelect-custgrp",children:(0,a.jsx)(d.default,{ButtonVariant:"primary",ButtononClick:()=>{S()},ButtononHover:()=>{},DropdownClick:()=>{},children:1===u.length?"Continue":"Group "+u.length+" Customers"})}),o===i.Ku.InToday&&0===w||o===i.Ku.SaveForLater&&0===m||o===i.Ku.AllCustomer&&0===c?(0,a.jsx)("div",{className:"VgCustomerDDItmeCount",children:(0,a.jsx)("span",{children:"No Matches"})},o):(0,a.jsx)("div",{className:"VgCustomerDDItmeCount",onClick:()=>h(),children:(0,a.jsxs)("span",{children:["Items ",(0,a.jsxs)("strong",{children:["1-",p.length]})," out of",(0,a.jsx)("strong",{children:" "+(o===i.Ku.InToday?w.toString():o===i.Ku.SaveForLater?m.toString():c.toString())})]})},o)]}):t===i.Nw.WithoutThreeTabDropdown?(0,a.jsxs)(n.Fragment,{children:[(0,a.jsxs)(l.c.MenuList,{...e,innerRef:f,innerProps:{...e.innerProps,onScroll:N},children:[e.children,!T&&(0,a.jsx)("div",{className:"vgCustomerSelect__menu-notice",children:g})]}),"0"===c.toString()?(0,a.jsx)("div",{className:"VgCustomerDDItmeCount",children:(0,a.jsx)("span",{children:"No Matches"})}):(0,a.jsx)("div",{className:"VgCustomerDDItmeCount",onClick:()=>h(),children:(0,a.jsxs)("span",{children:["Items ",(0,a.jsxs)("strong",{children:["1-",p.length]})," out of ",(0,a.jsx)("strong",{children:" "+c})]})})]}):void 0};var p=o(14977),u=o(33403),h=o(2390),T=o(6867);let g=({email:e,className:t})=>e?(0,a.jsx)("div",{className:`VgCustomerInfoEmail ${t||""}`,children:(0,a.jsx)("a",{onClick:e=>{e.stopPropagation()},href:`mailto:${e}`,title:e,children:e})}):null,w=e=>(0,a.jsx)(l.c.ClearIndicator,{...e,onTouchEnd:()=>e.selectProps.DropdownOpen(),onClick:()=>e.selectProps.DropdownOpen(),children:(0,a.jsx)("svg",{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:(0,a.jsx)("path",{d:"M352 160c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-160 160c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-9.2-9.2-11.9-22.9-6.9-34.9S19.1 160 32 160l320 0z"})})}),m=e=>(0,a.jsx)(l.c.ClearIndicator,{...e,children:(0,a.jsx)("svg",{className:"svgClearIndicator",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 640",fill:"currentColor",children:(0,a.jsx)("path",{d:"M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM231 231C240.4 221.6 255.6 221.6 264.9 231L319.9 286L374.9 231C384.3 221.6 399.5 221.6 408.8 231C418.1 240.4 418.2 255.6 408.8 264.9L353.8 319.9L408.8 374.9C418.2 384.3 418.2 399.5 408.8 408.8C399.4 418.1 384.2 418.2 374.9 408.8L319.9 353.8L264.9 408.8C255.5 418.2 240.3 418.2 231 408.8C221.7 399.4 221.6 384.2 231 374.9L286 319.9L231 264.9C221.6 255.5 221.6 240.3 231 231z"})})}),S=e=>{let{selectProps:{onInputChange:t,ResetInput:o,InputPlaceholder:r,handleInputOnChange:i}}=e;return(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)(l.c.Input,{...e,autoFocus:!0,placeholder:r,autoComplete:"new-password",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,name:"vg-customer-search-input"}),e.selectProps.inputValue&&(0,a.jsx)("span",{onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),t&&o()},className:"vgCustomerSelect__clearSearch",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 640",fill:"currentColor",children:(0,a.jsx)("path",{d:"M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM231 231C240.4 221.6 255.6 221.6 264.9 231L319.9 286L374.9 231C384.3 221.6 399.5 221.6 408.8 231C418.1 240.4 418.2 255.6 408.8 264.9L353.8 319.9L408.8 374.9C418.2 384.3 418.2 399.5 408.8 408.8C399.4 418.1 384.2 418.2 374.9 408.8L319.9 353.8L264.9 408.8C255.5 418.2 240.3 418.2 231 408.8C221.7 399.4 221.6 384.2 231 374.9L286 319.9L231 264.9C221.6 255.5 221.6 240.3 231 231z"})})})]})},y=e=>{let[t,o]=(0,n.useState)(-1),s=(0,n.useRef)(null),d=(0,n.useRef)([]),y=(e,t,o)=>{let{C:a,D:n,N:l,E:r,FN:s}=Array.isArray(e)?e[0]:e,d=(0,i.nr)(a)?(0,i.nr)(n)?(0,i.nr)(l)?"":l:n:a;return t?{Name:s+((0,i.nr)(d)?"":" - "+(0,i.Rf)(d,o))+((0,i.nr)(r)?"":" - "+r)}:{Name:s}},C=(0,n.useCallback)(e=>{let t,{children:o,selectProps:{DropdownType:n,value:r,PlaceholderData:s,PlaceholderName:d,NoImage:c,handleImageOnClick:w,handleDeleteImage:m,HasCu
1stomerRight:S,CountryId:C,ShowPoints:O}}=e;if(n===i.Nw.ThreeTabDropdown&&r&&(0,i.Gv)(s))if((0,i.cy)(r)&&r.length>0)return(0,a.jsx)(l.c.ValueContainer,{...e,children:(0,a.jsxs)("div",{className:"VgCustomerDDDetail",onTouchEnd:()=>e?.selectProps?.DropdownOpen(),onClick:()=>e?.selectProps?.DropdownOpen(),children:[(0,a.jsxs)("div",{className:`VgCustomerDDAvatar ${s?.IsVeraCustomer?"vg-veraiconwithAvatarborder":""}`,children:[(0,a.jsx)("div",{className:"VgCheckoutAvatar",style:{backgroundImage:`url(${s?.Avatar===""?c:s?.Avatar})`},onPointerDown:e=>{w(e)},onClick:e=>{s?.Avatar===""&&e.stopPropagation()},children:s?.Avatar!==""&&(0,a.jsxs)("ul",{children:[(0,a.jsx)("li",{onPointerDown:e=>w(e),onClick:e=>e.stopPropagation(),children:(0,a.jsx)("i",{className:"fa-regular fa-pencil"})}),(0,a.jsx)("li",{onPointerDown:e=>m(e),onClick:e=>e.stopPropagation(),children:(0,a.jsx)("i",{className:"fa-regular fa-trash-can"})})]})}),s?.IsVeraCustomer&&(0,a.jsx)("div",{className:"vg-veraiconwithborder",children:(0,a.jsx)(T.A,{name:"VeraIconWithBorder",width:18.5,height:18.5})})]}),(0,a.jsxs)("div",{className:"VgCustomerDDInfo",children:[(0,a.jsxs)("div",{className:"nameInvalidWrap",children:[(0,a.jsx)("div",{className:"VgCustomerInfoName",children:(0,a.jsx)("span",{className:"",children:s?.Name+" "+(""!==s.Number?" -  ":"")})}),s?.IsValidNumber===!1?(0,a.jsx)(h.default,{BeakPoint:"Down",BeakPosition:"Left",Children:(0,a.jsxs)("span",{className:"failedContact",children:[(0,a.jsx)("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),(0,a.jsx)("span",{className:"",children:s?.Number})]}),Duration:0,OnTooltipClose:()=>{},ScreenTitleForMobile:"",ShowHover:!0,TextAlign:"center",TooltipText:s.NumberTextMsg}):(0,a.jsxs)("span",{className:"VgCustNoPhone",children:[" ",s.Number]})]}),!1===s.IsValidEmail?(0,a.jsx)(h.default,{BeakPoint:"Down",BeakPosition:"Left",Children:(0,a.jsxs)("span",{className:"failedContact",children:[(0,a.jsx)("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),(0,a.jsx)("a",{href:"mailto:"+s?.Email,title:s?.Email,className:"",children:s?.Email})]}),Duration:0,OnTooltipClose:()=>{},ScreenTitleForMobile:"",ShowHover:!0,TextAlign:"center",TooltipText:s?.EmailTextMsg}):(0,a.jsx)(g,{email:s?.Email})]}),(0,a.jsx)("div",{className:"VgCustomerDDPts",children:O&&(0,a.jsx)(p.default,{BadgeSize:"large",BadgeText:s?.Points+(s?.Points==="0"?" pt":" pts"),BadgeVariation:"new"})})]})});else return(0,a.jsx)(l.c.ValueContainer,{...e,children:o});if(n===i.Nw.WithoutThreeTabDropdown&&r&&(0,i.Gv)(s))if((0,i.cy)(r)&&r.length>0)return(0,a.jsx)(l.c.ValueContainer,{...e,children:(0,a.jsxs)("div",{className:"VgCustomerDDDetail",onTouchEnd:()=>e?.selectProps?.DropdownOpen(),onClick:()=>e?.selectProps?.DropdownOpen(),children:[(0,a.jsxs)("div",{className:`VgCustomerDDAvatar ${s?.IsVeraCustomer?"vg-veraiconwithAvatarborder":""}`,children:[(0,a.jsx)(u.default,{AvatarSize:"Small",NoProfile:s?.Name,ProfileUrl:s?.Avatar}),s?.IsVeraCustomer&&(0,a.jsx)("div",{className:"vg-veraiconwithborder",children:(0,a.jsx)(T.A,{name:"VeraIconWithBorder",width:18.5,height:18.5})})]}),(0,a.jsxs)("div",{className:"VgCustomerDDInfo",children:[(0,a.jsxs)("div",{className:"nameInvalidWrap",children:[(0,a.jsx)("div",{className:"VgCustomerInfoName",children:(0,a.jsx)("span",{className:"",children:s?.Name+" "+(""!==s.Number?" -  ":"")})}),!1===s.IsValidNumber?(0,a.jsx)(h.default,{BeakPoint:"Down",BeakPosition:"Left",Children:(0,a.jsxs)("span",{className:"failedContact",children:[(0,a.jsx)("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),(0,a.jsx)("span",{className:"",children:s.Number})]}),Duration:0,OnTooltipClose:()=>{},ScreenTitleForMobile:"",ShowHover:!0,TextAlign:"center",TooltipText:s.NumberTextMsg}):(0,a.jsxs)("span",{className:"VgCustNoPhone",children:[" ",s.Number]})]}),s?.IsValidEmail===!1?(0,a.jsx)(h.default,{BeakPoint:"Down",BeakPosition:"Left",Children:(0,a.jsxs)("span",{className:"failedContact",children:[(0,a.jsx)("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),(0,a.jsx)("a",{href:"mailto:"+s?.Email,title:s?.Email,className:"",children:s?.Email})]}),Duration:0,OnTooltipClose:()=>{}
1,ScreenTitleForMobile:"",ShowHover:!0,TextAlign:"center",TooltipText:s?.EmailTextMsg}):(0,a.jsx)(g,{email:s?.Email})]}),(0,a.jsx)("div",{className:"VgCustomerDDPts",children:s?.IOU!=="0"&&(0,a.jsx)(p.default,{BadgeSize:"large",BadgeText:s?.IOU+" IOU",BadgeVariation:"new"})}),(0,a.jsx)("div",{className:"VgCustomerDDPts",children:s?.Points!=="0"&&(0,a.jsx)(p.default,{BadgeSize:"large",BadgeText:s?.Points+" pts",BadgeVariation:"new"})})]})});else return(0,a.jsx)(l.c.ValueContainer,{...e,children:o});return n===i.Nw.SingleDropdown&&r?(0,i.cy)(r)&&r.length>0?(t=y(r,S,C),(0,a.jsx)("div",{onTouchEnd:e=>e.stopPropagation(),onClick:()=>e.selectProps.DropdownOpen(),children:(0,a.jsx)(l.c.ValueContainer,{...e,children:t?.Name})})):(0,i.Gv)(r)&&void 0!==r.FN?(t=y(r,S,C),(0,a.jsx)("div",{className:"customerInputwithData",onTouchEnd:e=>e.stopPropagation(),onClick:()=>e.selectProps.DropdownOpen(),children:(0,a.jsx)(l.c.ValueContainer,{...e,children:t?.Name})})):e?.selectProps?.value.label?(0,a.jsx)("div",{onTouchEnd:e=>e.stopPropagation(),onClick:()=>e.selectProps.DropdownOpen(),children:(0,a.jsx)(l.c.ValueContainer,{...e,children:e?.selectProps?.value?.label})}):(0,a.jsx)("div",{onTouchEnd:e=>e.stopPropagation(),onClick:()=>e.selectProps.DropdownOpen(),children:(0,a.jsx)(l.c.ValueContainer,{...e,children:o})}):(0,a.jsx)(l.c.ValueContainer,{...e,children:(0,a.jsx)("div",{className:`defualtPlaceholder ${n===i.Nw.SingleDropdown?"vgSinglePlaceholder":""}`,onTouchEnd:e=>e.stopPropagation(),onClick:()=>e.selectProps.DropdownOpen(),children:d})})},[]),O=(0,n.useCallback)(e=>{let{selectProps:{DropdownType:t,PlaceholderData:o,NoImage:n,handleImageOnClick:r,handleDeleteImage:s,ShowPoints:d}}=e;return t===i.Nw.SingleDropdown?(0,a.jsx)(l.c.Placeholder,{...e,children:(0,a.jsx)("span",{children:e?.children})}):t===i.Nw.ThreeTabDropdown&&(0,i.Gv)(o)?(0,a.jsx)(l.c.ValueContainer,{...e,children:(0,a.jsxs)("div",{className:"VgCustomerDDDetail",onTouchEnd:()=>e?.selectProps?.DropdownOpen(),onClick:()=>e?.selectProps?.DropdownOpen(),children:[(0,a.jsxs)("div",{className:`VgCustomerDDAvatar ${o?.IsVeraCustomer?"vg-veraiconwithAvatarborder":""}`,children:[(0,a.jsx)("div",{className:"VgCheckoutAvatar",style:{backgroundImage:`url(${o?.Avatar===""?n:o?.Avatar})`},onPointerDown:e=>{r(e)},onClick:e=>{o?.Avatar===""&&e.stopPropagation()},children:o?.Avatar!==""&&(0,a.jsxs)("ul",{children:[(0,a.jsx)("li",{onPointerDown:e=>r(e),onClick:e=>e.stopPropagation(),children:(0,a.jsx)("i",{className:"fa-regular fa-pencil"})}),(0,a.jsx)("li",{onPointerDown:e=>s(e),onClick:e=>e.stopPropagation(),children:(0,a.jsx)("i",{className:"fa-regular fa-trash-can"})})]})}),o?.IsVeraCustomer&&(0,a.jsx)("div",{className:"vg-veraiconwithborder",children:(0,a.jsx)(T.A,{name:"VeraIconWithBorder",width:18.5,height:18.5})})]}),(0,a.jsxs)("div",{className:"VgCustomerDDInfo",children:[(0,a.jsxs)("div",{className:"nameInvalidWrap",children:[(0,a.jsx)("div",{className:"VgCustomerInfoName",children:(0,a.jsx)("span",{className:"",children:o?.Name+" "+(""!==o.Number?" -  ":"")})}),o?.IsValidNumber===!1?(0,a.jsx)(h.default,{BeakPoint:"Down",BeakPosition:"Left",Children:(0,a.jsxs)("span",{className:"failedContact",children:[(0,a.jsx)("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),(0,a.jsx)("span",{className:"",children:o?.Number})]}),Duration:0,OnTooltipClose:()=>{},ScreenTitleForMobile:"",ShowHover:!0,TextAlign:"center",TooltipText:o.NumberTextMsg}):(0,a.jsxs)("span",{className:"VgCustNoPhone",children:[" ",o.Number]})]}),!1===o.IsValidEmail?(0,a.jsx)(h.default,{BeakPoint:"Down",BeakPosition:"Left",Children:(0,a.jsxs)("span",{className:"failedContact",children:[(0,a.jsx)("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),(0,a.jsx)("a",{href:"mailto:"+o?.Email,title:o?.Email,className:"",children:o?.Email})]}),Duration:0,OnTooltipClose:()=>{},ScreenTitleForMobile:"",ShowHover:!0,TextAlign:"center",TooltipText:o?.EmailTextMsg}):(0,a.jsx)(g,{email:o?.Email})]}),(0,a.jsx)("div",{className:"VgCustomerDDPts",children:d&&(0,a.jsx)(p.default,{BadgeSize:"large",BadgeText:o?.Points+(o?.Points==="0"?" pt":" pts"),BadgeVariation:"new"})})]})}):t===i.Nw.WithoutThreeTabDropdown&&(0,i.Gv)(o)?(0,a.jsx)(l.c.ValueContainer,{...e,children:(0,a.jsxs)("div",{className:"VgCustomerDDDetail",onTouchEnd:()=>e?.selectProps?.DropdownOpen(),onClick:()=>e?.selectProps?.DropdownOpen(),children:[(0,a.jsxs)("div",{className:`VgCustomerDDAvatar ${o?.IsVeraCustomer?"vg-veraiconwithAvatarborder":""}`,children:[(0,a.jsx)(u.default,{AvatarSize:"Small",NoProfile:o?.Name,ProfileUrl:o?.Avatar}),o?.IsVeraCustomer&&(0,a.jsx)("div",{className:"vg-veraiconwithborder",children:(0,a.jsx)(T.A,{name:"VeraIconWithBorder",width:18.5,height:18.5})})]}),(0,a.jsxs)("div",{className:"VgCustomerDDInfo",children:[(0,a.jsxs)("div",{className:"nameInvalidWrap",children:[(0,a.jsx)("div",{className:"VgCustomerInfoName",children:(0,a.jsx)("span",{className:"",children:o?.Name+" "+(""!==o.Number?" -  ":"")})}),!1===o.IsValidNumber?(0,a.jsx)(h.default,{BeakPoint:"Down",BeakPosition:"Left",Children:(0,a.jsxs)("span",{className:"failedContact",children:[(0,a.jsx)("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),(0,a.jsx)("span",{className:"",children:o.Number})]}),Duration:0,OnTooltipClose:()=>{}
1,ScreenTitleForMobile:"",ShowHover:!0,TextAlign:"center",TooltipText:o.NumberTextMsg}):(0,a.jsxs)("span",{className:"VgCustNoPhone",children:[" ",o.Number]})]}),o?.IsValidEmail===!1?(0,a.jsx)(h.default,{BeakPoint:"Down",BeakPosition:"Left",Children:(0,a.jsxs)("span",{className:"failedContact",children:[(0,a.jsx)("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),(0,a.jsx)("a",{href:"mailto:"+o?.Email,title:o?.Email,className:"",children:o?.Email})]}),Duration:0,OnTooltipClose:()=>{},ScreenTitleForMobile:"",ShowHover:!0,TextAlign:"center",TooltipText:o?.EmailTextMsg}):(0,a.jsx)(g,{email:o?.Email})]}),(0,a.jsx)("div",{className:"VgCustomerDDPts",children:o?.IOU!=="0"&&(0,a.jsx)(p.default,{BadgeSize:"large",BadgeText:o?.IOU+" IOU",BadgeVariation:"new"})}),(0,a.jsx)("div",{className:"VgCustomerDDPts",children:o?.Points!=="0"&&(0,a.jsx)(p.default,{BadgeSize:"large",BadgeText:o?.Points+" pts",BadgeVariation:"new"})})]})}):(0,a.jsx)(l.c.Placeholder,{...e,children:o})},[]),f=(0,n.useCallback)(()=>e.customerTab===i.Ku.InToday&&e.DropdownType===i.Nw.ThreeTabDropdown?e.InTodayOptions:e.customerTab===i.Ku.SaveForLater&&e.DropdownType===i.Nw.ThreeTabDropdown?e.SaveForLaterOptions:e.options,[e.customerTab,e.DropdownType,e.InTodayOptions,e.SaveForLaterOptions,e.options]),N=(0,n.useCallback)(e=>{requestAnimationFrame(()=>{let t=d.current[e];if(t&&s.current){let e=s.current,o=t.getBoundingClientRect(),a=e.getBoundingClientRect();o.top<a.top?t.scrollIntoView({block:"start",behavior:"smooth"}):o.bottom>a.bottom&&t.scrollIntoView({block:"end",behavior:"smooth"})}})},[]),D=(0,n.useCallback)(e=>{let{children:t,innerRef:o,innerProps:n}=e;return(0,a.jsxs)("div",{ref:o,...n,className:`vgCustomerSelect__control ${e.selectProps.ShowSearchIcon?"search-input-prefix-space vg-icon-prefix-space":""} `,children:[e.selectProps.ShowSearchIcon&&(0,a.jsx)("span",{className:"vg-input-control-prefix vg-search-input-control",onClick:()=>e.selectProps.handleSeachOnClick(),children:(0,a.jsx)("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:"24",height:"24",children:(0,a.jsx)("path",{d:"M368 208A160 160 0 1 0 48 208a160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"})})}),t]})},[]),E=(0,n.useMemo)(()=>{let o=()=>(0,a.jsx)("div",{className:"vgCustomerSelect__menu-notice",children:e.CustomNoOptionsMessage}),n={...e.components,MenuList:c,Option:o=>(o=>{let{innerProps:n}=o,r=f().findIndex(e=>e.value===o.data.value),s=r===t;s&&(d.current[r]=null);let c=t=>{t?.stopPropagation?.(),n.onClick?.(t),e.handleOnSingleSelect?.(o.data)};if(e.DropdownType===i.Nw.ThreeTabDropdown){if(e.customerTab===i.Ku.InToday)return(0,a.jsx)(l.c.Option,{...o,innerProps:{...o.innerProps,ref:e=>{d.current[r]=e},className:s?"vgCustomerSelect-focused":""},children:(0,a.jsxs)("div",{className:"vgCustomerSelect-checkbox",children:[(0,a.jsxs)("div",{className:"vgCustomerSelect-check",onClick:()=>e.handleOnMultiSelectCheckbox(!o?.isSelected),children:[(0,a.jsx)("input",{type:"checkbox",value:o.data.value,checked:o?.isSelected,onChange:()=>{},onTouchEnd:()=>n.onClick?.(),onClick:e=>{e.stopPropagation(),n.onClick?.(e)}}),(0,a.jsx)("label",{})]}),(0,a.jsx)("label",{className:"vgCustomerSelect-ck-label",onTouchEnd:()=>c(),onClick:e.handleOnSingleSelect,children:(0,i.CN)(o.data.label)})]})});else if(e.customerTab===i.Ku.AllCustomer)return(0,a.jsx)(l.c.Option,{...o,innerProps:{...o.innerProps,ref:e=>{d.current[r]=e},className:s?"vgCustomerSelect-focused":""},children:(0,a.jsx)("label",{className:"vgCustomerSelect-label",onTouchEnd:()=>c(),onClick:e.handleOnSingleSelect,children:(0,i.CN)(o.data.label)})});else if(e.customerTab===i.Ku.SaveForLater)return(0,a.jsx)(l.c.Option,{...o,innerProps:{...o.innerProps,ref:e=>{d.current[r]=e},className:s?"vgCustomerSelect-focused":""},children:(0,a.jsx)("label",{className:"vgCustomerSelect-label",onTouchEnd:()=>c(),onClick:e.handleOnSingleSelect,children:(0,i.CN)(o.data.label)})})}else if(e.DropdownType===i.Nw.WithoutThreeTabDropdown)return(0,a.jsx)(l.c.Option,{...o,innerProps:{...o.innerProps,ref:e=>{d.current[r]=e},className:s?"vgCustomerSelect-focused":""},children:(0,a.jsx)("label",{className:"vgCustomerSelect-label",onTouchEnd:()=>c(),onClick:e.handleOnSingleSelect,children:(0,i.CN)(o.data.label)})});else if(e.DropdownType===i.Nw.SingleDropdown){let t=e.DisableOptions.includes(o.data.value);return(0,a.jsx)(l.c.Option,{...o,innerProps:{...o.innerProps,ref:e=>{d.current[r]=e},className:`${t?"vgCustomerSelect-Notallow":""} ${s?"vgCustomerSelect-focused":""}`,onClick:t?e=>e.preventDefault():n.onClick},isDisabled:t,children:(0,a.jsx)("label",{className:"vgCustomerSelect-label",onClick:e.handleOnSingleSelect,children:(0,i.CN)(o.data.label)})})}})(o)};return e.DropdownType===i.Nw.SingleDropdown&&e.ShowInputBox?{...n,ValueContainer:()=>null,Placeholder:()=>null,Input:()=>null,SingleValue:()=>null,IndicatorsContainer:()=>null,NoOptionsMessage:()=>0===f().length&&e.IsLoading?o():""}
1:{...n,ValueContainer:e.isShowSearchBox?l.c.ValueContainer:C,Placeholder:e.isShowSearchBox?l.c.Placeholder:O,Input:e.isShowSearchBox?S:e.DropdownType===i.Nw.SingleDropdown?l.c.Input:()=>null,DropdownIndicator:e.DropdownType===i.Nw.SingleDropdown?()=>null:w,IndicatorSeparator:()=>null,NoOptionsMessage:()=>e.DropdownType===i.Nw.ThreeTabDropdown&&e.customerTab===i.Ku.InToday&&e.ShowHideLoading?(0,a.jsx)("div",{className:"vgCustomerSelect__menu-notice",children:e.LoadingMessage}):e.DropdownType===i.Nw.ThreeTabDropdown&&e.customerTab===i.Ku.InToday&&e.ShowHideLoading&&0===e.InTodayOptions.length||0===f().length&&e.IsLoading?o():"",ClearIndicator:e.DropdownType===i.Nw.SingleDropdown&&e.ClearSearchIcon?m:()=>null,Control:e.DropdownType===i.Nw.SingleDropdown?D:l.c.Control}},[e,t,f,C,O,D]),I=(0,n.useCallback)(a=>{let n=a.target,l=f();if("ArrowDown"===a.key){if(a.preventDefault(),e.OpenAndClose&&l.length>0){if(-1===t)o(0),N(0);else if(t<l.length-1){let e=t+1;o(e),N(e)}}return}if("ArrowUp"===a.key){if(a.preventDefault(),e.OpenAndClose&&l.length>0){if(-1===t)o(l.length-1),N(l.length-1);else if(t>0){let e=t-1;o(e),N(e)}}return}if("Enter"===a.key){if(a.preventDefault(),e.OpenAndClose&&t>=0&&t<l.length){let a=l[t];e.DropdownType===i.Nw.ThreeTabDropdown||e.DropdownType===i.Nw.WithoutThreeTabDropdown?e.handleOnChange([a]):e.handleOnChange(a),o(-1),e.DropdownType===i.Nw.SingleDropdown&&e.ShowInputBox||e.DropdownClose()}return}if(("Backspace"===a.key||"Delete"===a.key)&&""===n.value){a.preventDefault(),a.stopPropagation(),s.current&&(s.current.scrollTop=0),o(-1),N(0);return}if("Home"===a.key){a.preventDefault(),requestAnimationFrame(()=>{n.setSelectionRange(0,0)});return}if("End"===a.key){a.preventDefault(),requestAnimationFrame(()=>{let e=n.value.length;n.setSelectionRange(e,e)});return}1===a.key.length&&(s.current&&(s.current.scrollTop=0),o(-1),N(0))},[t,e,N,f]);return(0,a.jsxs)(n.Fragment,{children:[e.DropdownType===i.Nw.SingleDropdown&&e.ShowInputBox&&(0,a.jsx)("div",{className:"vg-input-control-group",children:(0,a.jsxs)("div",{className:`vg-input-container ${e.ShowSearchIcon?"search-input-prefix-space vg-icon-prefix-space":""}`,children:[e.ShowSearchIcon&&(0,a.jsx)("span",{className:"vg-input-control-prefix vg-search-input-control",onClick:()=>e.handleSeachOnClick(),children:(0,a.jsx)("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:"24",height:"24",children:(0,a.jsx)("path",{d:"M368 208A160 160 0 1 0 48 208a160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"})})}),(0,a.jsx)("input",{ref:e.inputRef,type:"text",className:`vg-input-control ${e.ShowSearchIcon?"vg-input-control-prefix-left-padding":""}`,value:e.searchValue||"",placeholder:e?.PlaceholderName||"",onChange:t=>{e.handleInputOnChange(t.target.value)},onClick:()=>e.DropdownOpen(),autoFocus:e.InputAutoFocus,maxLength:e.MaxLength}),e.ClearSearchIcon&&""!==e.searchValue&&(0,a.jsx)("div",{className:"vg-search-clear-indicator",onClick:()=>{e.handleClearSelection()},children:(0,a.jsx)("svg",{className:"svgClearIndicator",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 640",fill:"currentColor",children:(0,a.jsx)("path",{d:"M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM231 231C240.4 221.6 255.6 221.6 264.9 231L319.9 286L374.9 231C384.3 221.6 399.5 221.6 408.8 231C418.1 240.4 418.2 255.6 408.8 264.9L353.8 319.9L408.8 374.9C418.2 384.3 418.2 399.5 408.8 408.8C399.4 418.1 384.2 418.2 374.9 408.8L319.9 353.8L264.9 408.8C255.5 418.2 240.3 418.2 231 408.8C221.7 399.4 221.6 384.2 231 374.9L286 319.9L231 264.9C221.6 255.5 221.6 240.3 231 231z"})})})]})}),(0,n.createElement)(r.Ay,{...e,id:e.id,key:e.key,className:`vgCustomerSelect ${e.DropdownType===i.Nw.SingleDropdown&&e.ShowInputBox?"vg-select-hide-control":""}`,classNamePrefix:"vgCustomerSelect",placeholder:!0===e.isShowSearchBox?"":e.PlaceholderName,options:f(),value:e.selectedOption,onChange:e.handleOnChange,inputValue:e.searchValue||"",onInputChange:e.handleInputOnChange,menuPlacement:e.MenuPlacement,isMulti:e.DropdownType!==i.Nw.SingleDropdown,closeMenuOnSelect:!1,menuPortalTarget:"u">typeof document?null!==e.divTarget?e.divTarget:e.menuPortalTarget||document.body:null,filterOption:()=>!0,components:E,unstyled:!0,onKeyDown:I,focusedIndex:t,menuListRef:s,classNames:{control:()=>"",group:()=>"",groupHeading:()=>"",menu:()=>"",menuList:()=>"",menuPortal:()=>""},styles:{control:e=>({}),dropdownIndicator:e=>({}),indicatorsContainer:e=>({}),valueContainer:e=>({}),menu:e=>({}),menuList:t=>
1({...t,maxHeight:e.Height,overflowY:"auto"}),menuPortal:t=>({...t,zIndex:e.ZIndex}),input:e=>({}),noOptionsMessage:e=>({})},hideSelectedOptions:!1,onMenuScrollToTop:!1,menuShouldScrollIntoView:!1,isSearchable:!0,menuIsOpen:e.OpenAndClose,onMenuOpen:()=>{e.DropdownType===i.Nw.SingleDropdown&&e.DropdownOpen(),o(0)},onMenuClose:()=>{o(-1),e.DropdownClose()},menuShouldCloseOnBlur:!0,blurInputOnSelect:e.DropdownType===i.Nw.SingleDropdown,isClearable:e.DropdownType===i.Nw.SingleDropdown,tabSelectsValue:!1,autoFocus:!1,scrollToFocusedOption:!1,controlShouldRenderValue:!1,onBlur:()=>e.handleCloseOutSide(),isDisabled:e.DisabledDropdown})]})};var C=o(68566),O=o(98232),f=o(58530),N=o(60067),D=o(47996);let E={customerTab:i.Ku.InToday,selectedOption:[],options:[],totalRecord:0,initialTotalRecord:0,isShowSearchBox:!1,pageIndex:1,isLoading:!0,customers:[],searchedText:"",selectAll:"",selectNone:"",inTodayOptions:[],saveForLaterOptions:[],inTodayTotalRecord:0,saveForLaterTotalRecord:0,openAndCloseDropdown:!1,reportApiLoading:!1};function I(e,t){switch(t.type){case i.X2.SET_CUSTOMER_TAB:return{...e,customerTab:t.payload};case i.X2.SET_SELECTED_OPTION:return{...e,selectedOption:t.payload};case i.X2.SET_OPTIONS:let o=[...e.options,...t.payload];return{...e,options:e.options.length>0?(0,i.ML)(o):t.payload};case i.X2.SET_EMPTY_OPTION:return{...e,options:t.payload};case i.X2.SET_TOTAL_RECORD:return{...e,totalRecord:t.payload};case i.X2.SET_INITIAL_TOTAL_RECORD:return{...e,initialTotalRecord:t.payload};case i.X2.SET_IS_SHOW_SEARCH_BOX:return{...e,isShowSearchBox:t.payload};case i.X2.SET_PAGE_INDEX:return{...e,pageIndex:t.payload};case i.X2.SET_IS_LOADING:return{...e,isLoading:t.payload};case i.X2.SET_STORE_CUSTOMER:return{...e,customers:t.payload};case i.X2.SET_SEARCHING_TEXT:return{...e,searchedText:t.payload};case i.X2.SET_IN_TODAY_OPTION:return{...e,inTodayOptions:t.payload};case i.X2.SET_SAVE_FOR_LATER_OPTION:return{...e,saveForLaterOptions:t.payload};case i.X2.SET_IN_TODAY_TOTAL_RECORD:return{...e,inTodayTotalRecord:t.payload};case i.X2.SET_SAVE_FOR_LATER_TOTAL_RECORD:return{...e,saveForLaterTotalRecord:t.payload};case i.X2.SET_OPEN_AND_CLOSE_DROPDOWN:return{...e,openAndCloseDropdown:t.payload};case i.X2.SET_ONLY_OPTIONS:return{...e,options:t.payload};case i.X2.SET_REPORT_API_LOADING:return{...e,reportApiLoading:t.payload};default:return e}}let _=({DropdownType:e,HasCustomerRight:t,MultiLocationBusinessIDs:o="",LoadingMessage:l="Loading..",UserType:r,ReactBusinessId:s,IsLoadCustFromDB:d=!1,InTodayList:c=[],SaveForLaterList:p=[],OnChange:u,PlaceholderData:h,key:T,APIURL:g,PlaceholderName:w,ShowCreateNew:m=!1,ClickOnCreateNew:S,ShowFooter:_=!1,CustomNoOptionsMessage:x="No Customer Found",MenuPlacement:v="auto",InputPlaceholder:R="",ImageUploadOnChange:L,ImageDeleteOnChange:P,CountryId:A=1,TabOnChange:b,defaultOptions:X,ShowInputBox:j=!1,InputAutoFocus:k=!0,ShowSearchIcon:M=!0,DisableOptions:V=[],DisabledDropdown:B=!1,Height:F=300,IndexDBEnable:W=!0,MaxLength:z=2e3,id:H="",divTarget:G=null,ZIndex:Y=999999,ClearSearchIcon:U=!0,ShowHideLoading:$=!0,ShowPoints:K=!0,SearchText:J,DefaultValue:Q=[],SetControlonRight:q=!1,SyncFromMultilocation:Z=!1,promotionId:ee="",InitialSelectedIds:et=[],InitialSelectAll:eo=!1,InitialUnselectedValues:ea=[],OpenFromBody:en=!1,BlurInputOnSelect:el=!1,Select2OpenCallback:er,DisableCaching:ei=!1,DropdownMenuPosition:es="",MultiReportDropdown:ed=!0,ReportDropdownTitle:ec="Customer:",SearchAutoFocus:ep=!0,AutoFocus:eu=!0,CloseCallback:eh=()=>{},OnDropdownOpen:eT=()=>{},OnClearClick:eg=()=>{},DonotOpenNativeCal:ew=!1})=>{let[em,eS]=(0,n.useReducer)(I,E),ey=(0,n.useRef)(!1),eC=(0,n.useRef)(!1),eO=(0,n.useRef)(!1);(0,n.useRef)(!1);let ef=(0,n.useRef)(null),eN=n.useRef(null),eD=(0,n.useRef)([]),eE=(0,n.useRef)(0),eI=(0,n.useRef)(null),e_=(0,n.useRef)(null),ex=(0,n.useRef)(""),ev=(0,n.useRef)(!1),eR=(0,n.useRef)(null),eL=`${O.C2}/Images/no-Image-150.png`,eP=O.Wp.CheckIsFromIpadAndroidTabWithoutParm(),eA="cusList",eb="cusSynInfo",eX=O.Wp.CheckIsFromProAppWithoutState()&&e===i.Nw.ReportDropdown?15:10,ej=!1,[ek,eM]=(0,n.useState)(et),eV=()=>W&&!1===eF()&&eB()===s&&!1==(r===i.zO.SuperAdmin),eB=()=>{let e=0,t=localStorage.getItem(eb);if(!(0,i.z)(t)&&!(0,i.nr)(t))try{let t=JSON.parse(localStorage.getItem(eb)||"null");e=!(0,i.z)(t)&&""!==t&&t?.busID?t.busID:0}catch{e=0}return 0==+e?s:e},eF=()=>{let e=!1;if(eC.current)e=eC.current;else if(!(0,i.z)(localStorage[eb])&&!(0,i.nr)(localStorage[eb])){let t=JSON.parse(localStorage.getItem(eb)||"null");if(null!=t){let o=new Date,a=new Date(t.maxDt);e=o.setHours(0,0,0,0)===a.setHours(0,0,0,0)?t.IsMaxQuataReached:e}}return e},eW=()=>!(0,i.z)(localStorage[eA])&&!(0,i.nr)(localStorage[eA])&&!1===eF()&&eB()===s,ez=()=>{let e=null;if(!(0,i.z)(localStorage[eb])&&!(0,i.nr)(localStorage[eb])){let t=JSON.parse(localStorage.getItem(eb)||"null");(0,i.z)(t)||""===t||(0,i.z)(t.synDt)||(0,i.nr)(t.synDt)||(e=t.synDt)}return e},eH=async()=>{"object"==typeof localStorage&&(W?(await (0,f.YQ)(),await (0,f.OH)()):localStorage.removeItem(eA),localStorage.removeItem(eb))},eG=async()=>{let e=!1===(null==ez()&&eF())||!1===eF(),t=null;if(e){let e;null!=(e=W?await (0,f.kH)():"object"==typeof localStorage&&void 0!==localStorage[eA]&&localStorage[eA].length>0?JSON.parse(localStorage[eA]||[]):[])&&e.length>0&&(t=ez())}let o={};return o.isForLocalStorage=e,o.lastSyncDate=t,o},eY=async(e,t,o)=>{let a=e,n={};n.busID=s,n.lstDt=new Date,n.maxDt=new Date,n.synDt=t;try{if(n.IsMaxQuataReached=!1,localStorage.removeItem(eb),localStorage.setItem(eb,JSON.stringify(n)),null===ez())null!==e?localStorage.setItem(eA,JSON.stringify(e)):localStorage[eA]=[];else{let t=[];if(void 0!==localStorage[eA]&&(t=JSON.parse(localStorage.getItem(eA)||"null")),null!==o&&""!==o&&o.length>0&&null!==t&&t.length>0){o=","+o+",";let e=[];for(let a=0;a<t.length;a++){let n=t[a];-1===o.indexOf(","+n.ID+",")&&e.push(n)}t=e}if(null!==t&&t.length>0&&null!==e&&e.length>0){let o=",";for(let a=0;a<e.length;a++){let n=e[a];t.map(e=>e.ID).indexOf(n.ID)>-1&&(o+=n.ID+",")}t=t.filter(e=>-1===o.indexOf(","+e.ID+",")),a=null!=t&&t.length>0?t.concat(e):e}else null!==e&&e.length>0?a=e:null!==t&&t.length>0&&(a=t);localStorage.removeItem(eA),null!=a?localStorage.setItem(eA,JSON.stringify(a)):localStorage[eA]=[],(0,i.jR)()||eP?eC.current=!0:ey.current=d}}catch(e){eC.current=!0,eH(),n.IsMaxQuataReached=!0,localStorage.setItem(eb,JSON.stringify(n))}return a},eU=async()=>{eS({type:i.X2.SET_IS_LOADING,payload:!1});let o=await (0,f.jN)("fetchingInProgress");if(!(ei&&e===i.Nw.ReportDropdown)&&(eW()||eV()&&"done"===o)){let e=[];
1if((e=W?await (0,f.kH)():"object"==typeof localStorage&&void 0!==localStorage[eA]&&localStorage[eA].length>0?JSON.parse(localStorage[eA]||[]):[]).length>0&&(e=await e.sort(eQ)),0===em.options.length||em.searchedText.length>0)if(em.searchedText.length>0){let o=em.searchedText;if(em.searchedText.includes(" - ")){let e=em.searchedText.split(" - ").map(e=>e.trim());if(e[0])o=e[0];else for(let t of e){if(/\d/.test(t)){o=t;break}t.includes("@")&&(o=t)}}let a=e2(e,o,1,eX),n=(0,i.sp)(a.results,A,t);eS({type:i.X2.SET_TOTAL_RECORD,payload:a.totalMatched}),eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:e.length}),eS({type:i.X2.SET_OPTIONS,payload:n})}else{let o=(0,i.sp)(e.slice(0,eX),A,t);eS({type:i.X2.SET_TOTAL_RECORD,payload:e.length}),eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:e.length}),eS({type:i.X2.SET_OPTIONS,payload:o})}else eS({type:i.X2.SET_EMPTY_OPTION,payload:[]}),eS({type:i.X2.SET_TOTAL_RECORD,payload:em.totalRecord}),eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:em.initialTotalRecord}),eS({type:i.X2.SET_OPTIONS,payload:em.options});eS({type:i.X2.SET_IS_LOADING,payload:!0})}else eS({type:i.X2.SET_PAGE_INDEX,payload:1}),e$(em.searchedText,1,eX,null,!1,!1,function(e,o){try{if(!(0,i.z)(e.data)&&!(0,i.z)(e.data.Data)){let o=e.data.Data;if(eS({type:i.X2.SET_TOTAL_RECORD,payload:o.TotalCount}),0===em.searchedText.length&&eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:o.TotalCount}),!(0,i.z)(o.CustomerList)&&o.CustomerList.length>0){eS({type:i.X2.SET_STORE_CUSTOMER,payload:o.CustomerList});let e=(0,i.sp)(o.CustomerList,A,t);eS({type:i.X2.SET_OPTIONS,payload:e})}else eS({type:i.X2.SET_OPTIONS,payload:[]});eS({type:i.X2.SET_IS_LOADING,payload:!0})}}catch(e){O.Wp.displayErrorMessage(O.By.Fail,"Something went wrong. Please try again.")}},e5)},e$=async(e="",t=1,a=eX,n=null,l=!1,r=!1,s,d)=>{let c=g+"?searchtext="+e+"&Page="+t+"&PageSize="+a+"&ForStorage="+l+"&LastSyncTime="+(null!==n?(0,i.C)(n):"")+"&multiLocationBusinessIDs="+o+"&promotionId="+ee;eS({type:i.X2.SET_REPORT_API_LOADING,payload:!0}),await (0,C.fE)(c,function(t){let o={};o.CustomerList=[],o.LastSyncTime=null,o.DeletedIDs="",o.TotalCount=0,o.SyncVersion=1,(0,i.z)(t.data)||(0,i.z)(t.data.data)||(!(0,i.z)(t.data.data.customers)&&t.data.data.customers.length>0&&(o.CustomerList=(0,i.Xw)(t.data.data.customers)),(0,i.z)(t.data.data.lastSyncedTime)||""===t.data.data.lastSyncedTime||(o.LastSyncTime=(0,i.Ey)(t.data.data.lastSyncedTime)),(0,i.z)(t.data.data.deletedIds)||""===t.data.data.deletedIds||(o.DeletedIDs=t.data.data.deletedIds),(0,i.z)(t.data.data.totalRecord)||""===t.data.data.totalRecord||(o.TotalCount=t.data.data.totalRecord),(0,i.z)(t.data.data.syncVersion)||""===t.data.data.syncVersion||(o.SyncVersion=t.data.data.syncVersion)),t.data.Data=o,eS({type:i.X2.SET_REPORT_API_LOADING,payload:!1}),s(t,e)},function(e){eS({type:i.X2.SET_REPORT_API_LOADING,payload:!1}),d(e)})},eK=async()=>{let e=eV(),t=(()=>{let e=!0;if(void 0!==localStorage[eb]){let t=JSON.parse(localStorage.getItem(eb)||"null");if(null!==t)if(t.IsMaxQuataReached)e=!0;else{let o=new Date(t.lstDt),a=new Date;a<o&&a.setDate(a.getDate()+1),e=Math.floor((a-o)/1e3/60)>2}}else e=!0;return e})();return eW()&&t||e&&t},eJ=async(e,o="")=>{em.customers.length>0&&em.customers.length===em.totalRecord?eS({type:i.X2.SET_IS_LOADING,payload:!0}):await e$(o,e,eX,null,!1,!1,function(a,n){try{if(!(0,i.z)(a.data)&&!(0,i.z)(a.data.Data)){let n=a.data.Data;if(eS({type:i.X2.SET_IS_LOADING,payload:!1}),eS({type:i.X2.SET_TOTAL_RECORD,payload:n.TotalCount}),0===o.length&&eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:n.TotalCount}),!(0,i.z)(n.CustomerList)&&n.CustomerList.length>0){if(1===e)eS({type:i.X2.SET_STORE_CUSTOMER,payload:n.CustomerList});else{let e=[...em.customers,...n.CustomerList];eS({type:i.X2.SET_STORE_CUSTOMER,payload:e})}let o=(0,i.sp)(n.CustomerList,A,t);1===e?eS({type:i.X2.SET_ONLY_OPTIONS,payload:o}):eS({type:i.X2.SET_OPTIONS,payload:o}),eS({type:i.X2.SET_IS_LOADING,payload:!0})}else eS({type:i.X2.SET_OPTIONS,payload:[]}),eS({type:i.X2.SET_IS_LOADING,payload:!1})}}catch(e){O.Wp.displayErrorMessage(O.By.Fail,"Something went wrong. Please try again.")}},e5)},eQ=(e,t)=>{try{var o=e.FN.toLowerCase(),a=t.FN.toLowerCase();if(o<a)return -1;if(o>a)return 1;return 0}catch(e){return 0}},eq=async()=>
1{if(r===i.zO.SuperAdmin)return void await eJ(1,em.searchedText);if(await eK()&&!(ei&&e===i.Nw.ReportDropdown)){if(eW()||eV()){let e=[];(e=W?await (0,f.kH)():"object"==typeof localStorage&&void 0!==localStorage[eA]&&localStorage[eA].length>0?JSON.parse(localStorage[eA]||[]):[]).length>0&&(e=await e.sort(eQ)),eS({type:i.X2.SET_IS_LOADING,payload:!0}),eS({type:i.X2.SET_TOTAL_RECORD,payload:e.length}),eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:e.length});let o=(0,i.sp)(e.slice(0,eX),A,t);eS({type:i.X2.SET_OPTIONS,payload:o})}else eS({type:i.X2.SET_OPTIONS,payload:[]}),eS({type:i.X2.SET_IS_LOADING,payload:!1});let e=await eG();e$("",1,eX,e.lastSyncDate,e.isForLocalStorage,!1,async function(e,t){try{if(!(0,i.z)(e.data)&&!(0,i.z)(e.data.Data)){let t=e.data.Data;0===em.searchedText.length&&eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:t.TotalCount}),eV()?await e7(t.CustomerList,t.LastSyncTime,t.DeletedIDs,1):await eY(t.CustomerList,t.LastSyncTime,t.DeletedIDs)}}catch(e){O.Wp.displayErrorMessage(O.By.Fail,"Something went wrong. Please try again.")}},e5)}else eU()},eZ=async(e="",t=1,a=eX,n=null,l=!1,r=!1,s,d,c=!0)=>{let p=g+"?searchtext="+e+"&Page="+t+"&PageSize="+a+"&ForStorage="+l+"&LastSyncTime="+(null!==n?(0,i.C)(n):"")+"&multiLocationBusinessIDs="+o+"&promotionId="+ee;ef.current&&(ef.current.cancel("Operation canceled due to new request."),c&&(eS({type:i.X2.SET_IS_LOADING,payload:!1}),eS({type:i.X2.SET_STORE_CUSTOMER,payload:[]}),eS({type:i.X2.SET_TOTAL_RECORD,payload:0}))),ef.current=N.A.CancelToken.source(),eS({type:i.X2.SET_REPORT_API_LOADING,payload:!0}),await (0,C.Ct)(p,function(e){if((0,i.z)(e.data)||(0,i.z)(e.data.data))eS({type:i.X2.SET_REPORT_API_LOADING,payload:!1}),s(e);else{let t={};t.CustomerList=[],t.LastSyncTime=null,t.DeletedIDs="",t.TotalCount=0,t.SyncVersion=1,!(0,i.z)(e.data.data.customers)&&e.data.data.customers.length>0&&(t.CustomerList=(0,i.Xw)(e.data.data.customers)),(0,i.z)(e.data.data.lastSyncedTime)||""===e.data.data.lastSyncedTime||(t.LastSyncTime=(0,i.Ey)(e.data.data.lastSyncedTime)),(0,i.z)(e.data.data.deletedIds)||""===e.data.data.deletedIds||(t.DeletedIDs=e.data.data.deletedIds),(0,i.z)(e.data.data.totalRecord)||""===e.data.data.totalRecord||(t.TotalCount=e.data.data.totalRecord),(0,i.z)(e.data.data.syncVersion)||""===e.data.data.syncVersion||(t.SyncVersion=e.data.data.syncVersion),e.data.Data=t,eS({type:i.X2.SET_REPORT_API_LOADING,payload:!1}),s(e)}},function(e){N.A.isCancel(e)||(eS({type:i.X2.SET_REPORT_API_LOADING,payload:!1}),d(e)),c&&(eS({type:i.X2.SET_IS_LOADING,payload:!1}),eS({type:i.X2.SET_STORE_CUSTOMER,payload:[]}),eS({type:i.X2.SET_TOTAL_RECORD,payload:0}))},ef.current?.token)},e0=(e,t)=>{let o=e=>e.toLowerCase().replace(/\s+/g," ").replace(/[^0-9a-zA-Z ]+/g,"").trim(),a=o(e).split(" "),n=o(t);return a.every(e=>0===n.indexOf(e)||-1!==n.indexOf(" "+e))},e2=(e,o,a=1,n=eX)=>{let l=o?.toLowerCase().trim();if(!l){let t=(a-1)*n;return{results:e.slice(t,t+n),totalMatched:e.length}}let r=[];for(let o of e){let e=1/0,a=!1,n=(o.FN||"").toLowerCase();if(e0(l,n)&&(a=!0,e=n.startsWith(l)?1:n.indexOf(l)>-1?2:3),!a&&t&&(o.E||"").replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,"").replace(/-/g,"").toLowerCase().indexOf(l.replace(/ /g,""))>-1&&(a=!0,e=Math.min(e,4)),!a&&t){let t=l.replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,"").replace(/-/g,"");if(t){let n=(0,i.Rf)(o.C,A).replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,"").replace(/-/g,""),l=(0,i.Rf)(o.D,A).replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,"").replace(/-/g,""),r=(0,i.Rf)(o.N,A).replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,"").replace(/-/g,"");(n.indexOf(t)>-1||l.indexOf(t)>-1||r.indexOf(t)>-1)&&(a=!0,e=Math.min(e,4))}}a&&r.push({record:o,priority:e})}r.sort((e,t)=>e.priority!==t.priority?e.priority-t.priority:e.record.FN.length!==t.record.FN.length?e.record.FN.length-t.record.FN.length:e.record.FN.localeCompare(t.record.FN));let s=r.length,d=(a-1)*n;return{results:r.slice(d,d+n).map(e=>e.record),totalMatched:s}},e1=async()=>{if(eS({type:i.X2.SET_SEARCHING_TEXT,payload:""}),eS({type:i.X2.SET_IS_LOADING,payload:!0}),eS({type:i.X2.SET_TOTAL_RECORD,payload:0}),eS({type:i.X2.SET_EMPTY_OPTION,payload:[]}),e===i.Nw.ReportDropdown&&eS({type:i.X2.SET_PAGE_INDEX,payload:1}),e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.AllCustomer||e===i.Nw.WithoutThreeTabDropdown||e===i.Nw.SingleDropdown||e===i.Nw.ReportDropdown)if(!(e
1i&&e===i.Nw.ReportDropdown)&&(eW()||eV())&&r!==i.zO.SuperAdmin){let e=[];(e=W?await (0,f.kH)():"object"==typeof localStorage&&void 0!==localStorage[eA]&&localStorage[eA].length>0?JSON.parse(localStorage[eA]||[]):[]).length>0&&(e=await e.sort(eQ));let o=(0,i.sp)(e.slice(0,eX),A,t);eS({type:i.X2.SET_TOTAL_RECORD,payload:e.length}),eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:e.length}),eS({type:i.X2.SET_OPTIONS,payload:o})}else eZ("",1,eX,null,!1,!1,function(e){try{if(!(0,i.z)(e.data)&&!(0,i.z)(e.data.Data)){let o=e.data.Data;if(eS({type:i.X2.SET_TOTAL_RECORD,payload:o.TotalCount}),eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:o.TotalCount}),!(0,i.z)(o.CustomerList)&&o.CustomerList.length>0){eS({type:i.X2.SET_STORE_CUSTOMER,payload:o.CustomerList});let e=(0,i.sp)(o.CustomerList,A,t);eS({type:i.X2.SET_OPTIONS,payload:e}),eS({type:i.X2.SET_IS_LOADING,payload:!0})}else eS({type:i.X2.SET_OPTIONS,payload:[]}),eS({type:i.X2.SET_IS_LOADING,payload:!1})}}catch(e){O.Wp.displayErrorMessage(O.By.Fail,"Something went wrong. Please try again.")}},e5);else if(e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.InToday){let e=e2(c,"",1,c.length),o=(0,i.sp)(e.results,A,t);eS({type:i.X2.SET_IN_TODAY_TOTAL_RECORD,payload:e.totalMatched}),eS({type:i.X2.SET_IN_TODAY_OPTION,payload:o})}else if(e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.SaveForLater){let e=e2(p,"",1,p.length),o=(0,i.sp)(e.results,A,t);eS({type:i.X2.SET_SAVE_FOR_LATER_TOTAL_RECORD,payload:e.totalMatched}),eS({type:i.X2.SET_SAVE_FOR_LATER_OPTION,payload:o})}},e4=async o=>{if(eS({type:i.X2.SET_SEARCHING_TEXT,payload:o}),ex.current=o,""!==o||""!==em.searchedText)if(o.length>0&&!em.openAndCloseDropdown&&e===i.Nw.SingleDropdown&&j&&eS({type:i.X2.SET_OPEN_AND_CLOSE_DROPDOWN,payload:!0}),eS({type:i.X2.SET_IS_LOADING,payload:!1}),e!==i.Nw.ReportDropdown&&(eS({type:i.X2.SET_TOTAL_RECORD,payload:0}),eS({type:i.X2.SET_EMPTY_OPTION,payload:[]}),eS({type:i.X2.SET_STORE_CUSTOMER,payload:[]})),eS({type:i.X2.SET_PAGE_INDEX,payload:1}),e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.AllCustomer||e===i.Nw.WithoutThreeTabDropdown||e===i.Nw.SingleDropdown||e===i.Nw.ReportDropdown){J&&J(o);let a=await (0,f.jN)("fetchingInProgress");if(!(ei&&e===i.Nw.ReportDropdown)&&(eW()||eV()&&"done"===a)&&r!==i.zO.SuperAdmin){let a=[],n=[];if(a=W?await (0,f.kH)():"object"==typeof localStorage&&void 0!==localStorage[eA]&&localStorage[eA].length>0?JSON.parse(localStorage[eA]||[]):[],""===o){a.length>0&&(a=await a.sort(eQ));let o=(0,i.sp)(a.slice(0,eX),A,t);eS({type:i.X2.SET_TOTAL_RECORD,payload:a.length}),eS({type:e===i.Nw.ReportDropdown?i.X2.SET_ONLY_OPTIONS:i.X2.SET_OPTIONS,payload:o}),eS({type:i.X2.SET_IS_LOADING,payload:!0});return}{let l=e2(a,o,1,eX),r=(0,i.sp)(l.results,A,t);n=r,eS({type:i.X2.SET_TOTAL_RECORD,payload:l.totalMatched}),eS({type:e===i.Nw.ReportDropdown?i.X2.SET_ONLY_OPTIONS:i.X2.SET_OPTIONS,payload:r})}eS({type:i.X2.SET_IS_LOADING,payload:!0}),r!==i.zO.SuperAdmin&&Z&&""!==o&&(0===n.length&&eS({type:i.X2.SET_IS_LOADING,payload:!1}),eZ(o,1,eX,null,!1,!1,async function(e){try{if(!(0,i.z)(e.data)&&!(0,i.z)(e.data.Data)){let a=e.data.Data;if(!(0,i.z)(a.CustomerList)&&a.CustomerList.length>0){let e=ex.current;if(e&&""!==e.trim()&&e===o){let e=(0,i.sp)(a.CustomerList,A,t),o=(0,i.ML)([...n,...e]);eS({type:i.X2.SET_TOTAL_RECORD,payload:o.length}),eS({type:i.X2.SET_OPTIONS,payload:o})}W?await (0,f.Sn)(a.CustomerList):(0,f.EV)(a.CustomerList)}}eS({type:i.X2.SET_IS_LOADING,payload:!0})}catch(e){O.Wp.displayErrorMessage(O.By.Fail,"Something went wrong. Please try again."),eS({type:i.X2.SET_IS_LOADING,payload:!0})}},e5,!1))}else eS({type:i.X2.SET_PAGE_INDEX,payload:1}),await eZ(o,1,eX,null,!1,!1,async function(o){try{if((0,i.z)(o.data)||(0,i.z)(o.data.Data))eS({type:i.X2.SET_IS_LOADING,payload:!1});else{let a=o.data.Data;if(eS({type:i.X2.SET_TOTAL_RECORD,payload:a.TotalCount}),!(0,i.z)(a.CustomerList)&&a.CustomerList.length>0){eS({type:i.X2.SET_STORE_CUSTOMER,payload:a.CustomerList});let e=(0,i.sp)(a.CustomerList,A,t);eS({type:i.X2.SET_ONLY_OPTIONS,payload:e})}else e===i.Nw.ReportDropdown?eS({type:i.X2.SET_ONLY_OPTIONS,payload:[]}):eS({type:i.X2.SET_OPTIONS,payload:[]});eS({type:i.X2.SET_IS_LOADING,payload:!0})}}catch(e){O.Wp.displayErrorMessage(O.By.Fail,"Something went wrong. Please try again.")}},e5)}else{if(e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.InToday){let e=e2(c,o,1,c.length),a=(0,i.sp)(e.results,A,t);eS({type:i.X2.SET_IN_TODAY_TOTAL_RECORD,payload:e.totalMatched}),eS({type:i.X2.SET_IN_TODAY_OPTION,payload:a})}else if(e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.SaveForLater){let e=e2(p,o,1,p.length),a=(0,i.sp)(e.results,A,t);eS({type:i.X2.SET_SAVE_FOR_LATER_TOTAL_RECORD,payload:e.totalMatched}),eS({type:i.X2.SET_SAVE_FOR_LATER_OPTION,payload:a})}eS({type:i.X2.SET_IS_LOADING,payload:!0})}},e3=async()=>
1{if(!em.isLoading)return;let o=em.pageIndex+1;eS({type:i.X2.SET_PAGE_INDEX,payload:o}),eS({type:i.X2.SET_IS_LOADING,payload:!1});let a=await (0,f.jN)("fetchingInProgress");if(!(ei&&e===i.Nw.ReportDropdown)&&(eW()||eV()&&"done"===a)&&r!==i.zO.SuperAdmin){let e=[];if((e=W?await (0,f.kH)():"object"==typeof localStorage&&void 0!==localStorage[eA]&&localStorage[eA].length>0?JSON.parse(localStorage[eA]||[]):[]).length>0&&(e=await e.sort(eQ)),eS({type:i.X2.SET_IS_LOADING,payload:!0}),""!==em.searchedText){let a=e2(e,em.searchedText,o,eX),n=(0,i.sp)(a.results,A,t),l=a.totalMatched>=em.totalRecord?a.totalMatched:em.totalRecord;eS({type:i.X2.SET_TOTAL_RECORD,payload:l}),eS({type:i.X2.SET_OPTIONS,payload:n})}else{let a=(o-1)*eX,n=(0,i.sp)(e.slice(a,a+eX),A,t);eS({type:i.X2.SET_TOTAL_RECORD,payload:e.length}),eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:e.length}),eS({type:i.X2.SET_OPTIONS,payload:n})}eS({type:i.X2.SET_IS_LOADING,payload:!0})}else await eJ(o,em.searchedText)},e8=async()=>{if(e===i.Nw.ReportDropdown&&void 0!==er&&er(),em.customerTab===i.Ku.InToday&&e===i.Nw.ThreeTabDropdown&&void 0!==b&&b(i.Ku.InToday),eS({type:i.X2.SET_STORE_CUSTOMER,payload:[]}),eS({type:i.X2.SET_PAGE_INDEX,payload:1}),eS({type:i.X2.SET_IS_LOADING,payload:!1}),eS({type:i.X2.SET_EMPTY_OPTION,payload:[]}),e!==i.Nw.SingleDropdown&&eS({type:i.X2.SET_SELECTED_OPTION,payload:[]}),eS({type:i.X2.SET_OPEN_AND_CLOSE_DROPDOWN,payload:!0}),eS({type:i.X2.SET_IS_SHOW_SEARCH_BOX,payload:!0}),eS({type:i.X2.SET_TOTAL_RECORD,payload:0}),e===i.Nw.ReportDropdown&&eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:0}),eE.current=0,eD.current=[],em.customerTab===i.Ku.AllCustomer&&e===i.Nw.ThreeTabDropdown||e===i.Nw.WithoutThreeTabDropdown||e===i.Nw.SingleDropdown||e===i.Nw.ReportDropdown){if(r===i.zO.SuperAdmin)eS({type:i.X2.SET_EMPTY_OPTION,payload:[]});else{let e=await (0,f.jN)("fetchingInProgress"),t=await (0,f.rH)();"done"!==e||t||ej||(ej=!0,await (0,f.Rk)("fetchingInProgress","inProgress"),await te(1))}eq()}e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.InToday&&(eS({type:i.X2.SET_IN_TODAY_TOTAL_RECORD,payload:c.length}),eS({type:i.X2.SET_IN_TODAY_OPTION,payload:(0,i.sp)(c,A,t)}),eS({type:i.X2.SET_IS_LOADING,payload:!0})),e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.SaveForLater&&(eS({type:i.X2.SET_SAVE_FOR_LATER_OPTION,payload:(0,i.sp)(p,A,t)}),eS({type:i.X2.SET_SAVE_FOR_LATER_TOTAL_RECORD,payload:p.length}))},e6=()=>{eS({type:i.X2.SET_IS_SHOW_SEARCH_BOX,payload:!1}),eS({type:i.X2.SET_OPEN_AND_CLOSE_DROPDOWN,payload:!1}),e!==i.Nw.SingleDropdown&&eS({type:i.X2.SET_EMPTY_OPTION,payload:[]}),eS({type:i.X2.SET_STORE_CUSTOMER,payload:[]}),eS({type:i.X2.SET_PAGE_INDEX,payload:1}),eS({type:i.X2.SET_SEARCHING_TEXT,payload:""}),e===i.Nw.ReportDropdown&&void 0!==er&&er()},e9=()=>{ev.current&&e===i.Nw.ReportDropdown?setTimeout(()=>e6(),350):e6()},e5=()=>{O.Wp.displayErrorMessage(O.By.Fail,"Something went wrong. Please try again.")},e7=async(e,t,o,a)=>{let n={};n.busID=s,n.lstDt=new Date,n.maxDt=new Date,n.synDt=t;try{if(n.IsMaxQuataReached=!1,1===a&&(localStorage.removeItem(eb),localStorage.setItem(eb,JSON.stringify(n))),null===ez())null!==e?W?(await (0,f.M9)(e),(0,f.tX)()&&(eC.current=!0)):localStorage.setItem(eA,JSON.stringify(e)):W?(0,f.M9)([]):localStorage[eA]=[];else{if(null!=o&&""!==o&&o.length>0){let e=o.split(",").filter(Boolean);await (0,f.LB)(e)}null!==e&&e.length>0&&(0,f.M9)(e)}if((0,i.jR)()||eP)eC.current=!0;else{let e=await (0,f.jN)("fetchingInProgress");"done"===e&&(eC.current=!1)}}catch(e){await (0,f.Rk)("fetchingInProgress","done"),eC.current=!0,await eH(),n.IsMaxQuataReached=!0,localStorage.setItem(eb,JSON.stringify(n))}return e},te=async e=>{let t=await (0,f.jN)("fetchingInProgress");eC.current=!0,"done"===t||eO.current||"done"!==t&&await e$("",e,5e3,null,!0,!0,async function(t,o){let a=t?.data?.Data?.CustomerList||[];0===em.searchedText.length&&eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:t?.data?.Data?.TotalCount}),t?.data?.Data?.TotalCount>=2e5||(a.length>0?(await e7(a,t.data.Data.LastSyncTime,t.data.Data.DeletedIDs,e),await (0,f.Rk)("pageIndex",e+1),e%eX==0&&await new Promise(e=>setTimeout(e,1e4)),(0,f.tX)()||await te(e+1)):(await (0,f.Rk)("fetchingInProgress","done"),(0,f.tX)()||(eC.current=!1)),"done"!==await (0,f.jN)("fetchingInProgress")||(0,f.tX)()||(eC.current=!1),ej=!1)},e5)},tt=async e=>{if(eS({type:i.X2.SET_IS_LOADING,payload:!1}),eS({type:i.X2.SET_CUSTOMER_TAB,payload:e}),eS({type:i.X2.SET_EMPTY_OPTION,payload:[]}),eS({type:i.X2.SET_TOTAL_RECORD,payload:0}),eS({type:i.X2.SET_INITIAL_TOTAL_RECORD,payload:0}),eS({type:i.X2.SET_SELECTED_OPTION,payload:[]}),void 0!==b&&b(e),e===i.Ku.AllCustomer){let e=await (0,f.jN)("fetchingInProgress");eW()||eV()&&"done"===e?eU():(eS({type:i.X2.SET_PAGE_INDEX,payload:1}),eJ(1,em.searchedText))}else if(e===i.Ku.InToday){if(""!==em.searchedText){let e=await e2(c,em.searchedText,1,c.length),o=(0,i.sp)(e.results,A,t);eS({type:i.X2.SET_IN_TODAY_TOTAL_RECORD,payload:e.totalMatched}),eS({type:i.X2.SET_IN_TODAY_OPTION,payload:o})}else{let e=(0,i.sp)(c,A,t);eS({type:i.X2.SET_IN_TODAY_OPTION,payload:e}),eS({type:i.X2.SET_IN_TODAY_TOTAL_RECORD,payload:c.length})}eS({type:i.X2.SET_IS_LOADING,payload:!0})}else if(e===i.Ku.SaveForLater){if(""!==em.searchedText){let e=await e2(p,em.searchedText,1,p.length),o=(0,i.sp)(e.results,A,t);eS({type:i.X2.SET_SAVE_FOR_LATER_TOTAL_RECORD,payload:e.totalMatched}),eS({type:i.X2.SET_SAVE_FOR_LATER_OPTION,payload:o})}else{let e=(0,i.sp)(p,A,t);eS({type:i.X2.SET_SAVE_FOR_LATER_OPTION,payload:e}),eS({type:i.X2.SET_SAVE_FOR_LATER_TOTAL_RECORD,payload:p.length})}eS({type:i.X2.SET_IS_LOADING,payload:!0})}},to=()=>{!0===em.openAndCloseDropdown?eI.current&&(eI.current.value="",eI.current?.focus()):(eS({type:i.X2.SET_SELECTED_OPTION,payload:[]}),eS({type:i.X2.SET_IS_SHOW_SEARCH_BOX,payload:!1})),eg(null),e1()};return(0,n.useEffect)(()=>{let t=t=>{eN.current&&!eN.current.contains(t.target)&&null!==em.selectedOption&&e===i.Nw.SingleDropdown&&j&&(eS({type:i.X2.SET_OPEN_AND_CLOSE_DROPDOWN,payload:!1}),eS({type:i.X2.SET_STORE_CUSTOMER,payload:[]}))};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[]),(0,n.useEffect)(()=>
1{if(e!==i.Nw.ReportDropdown)return;let t=e=>{ev.current=!0,null!==eR.current&&clearTimeout(eR.current),eR.current=setTimeout(()=>{ev.current=!1,eR.current=null},500)};return document.addEventListener("touchstart",t,{capture:!0,passive:!0}),()=>{document.removeEventListener("touchstart",t,{capture:!0}),null!==eR.current&&clearTimeout(eR.current)}},[]),(0,n.useEffect)(()=>{if("threeTab"===e||"withoutthreeTab"===e||!em.openAndCloseDropdown)return;if(!e_.current){let e=document.createElement("div");document.body.appendChild(e),e_.current=e}let t=e_.current;if(t)try{let e=eN.current,o=e?e.closest("[data-popup-id]"):null,a=o?.getAttribute("data-popup-id");a?t.setAttribute("data-parent-popup-id",a):t.removeAttribute("data-parent-popup-id")}catch{}return()=>{e_.current&&document.body.contains(e_.current)&&document.body.removeChild(e_.current),e_.current=null}},[em.openAndCloseDropdown]),(0,n.useEffect)(()=>{e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.InToday&&(eS({type:i.X2.SET_IS_LOADING,payload:!1}),eS({type:i.X2.SET_IN_TODAY_TOTAL_RECORD,payload:c.length}),eS({type:i.X2.SET_IN_TODAY_OPTION,payload:(0,i.sp)(c,A,t)}),eS({type:i.X2.SET_IS_LOADING,payload:!0}))},[c]),(0,n.useEffect)(()=>{e===i.Nw.SingleDropdown&&void 0!==X&&"object"==typeof X&&Object.values(X)?.length>0&&(j&&eS({type:i.X2.SET_SEARCHING_TEXT,payload:X?.label||""}),eS({type:i.X2.SET_SELECTED_OPTION,payload:X}))},[X]),(0,a.jsx)(n.Fragment,{children:e===i.Nw.ReportDropdown?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(D.default,{AutoFocus:eu,BeakPosition:"Left",CallBackTimeCount:0,ChildCheckbox:ed,ClassNamePrefix:"vg-select2-dropdown",CloseCallback:eh,CustomClassNamePrefix:"custom-class",CustomPlaceholderName:"Selected",DefaultValue:Q,DropdownClosed:()=>e9(),DropdownClosingName:"",DropdownData:em.options,DropdownGap:"8px 0px 8px 0px",DropdownId:"report-dropdown",DropdownName:"",DropdownPlaceholder:w,DropdownTitle:ec,DropdownWidth:"",MenuPlacement:"auto",Multi:ed,NativeActionValue:13,OnScrollPagination:e=>{e3()},DropdownDisabled:B,OpenFromBody:en,PrefixIconClick:()=>{},RecordsPerPage:10,RequiredMessage:"This field is required",RightSwipeEvent:!0,ScrollPagination:!0,SearchPlaceholder:"Search",Searchable:!0,SetBottomSheetDropdown:!1,ShowCheckBoxInGroup:!0,ShowCustomMessage:"No results found",ShowHideFooter:2,ShowSelectAllSelectNone:!0,TabIndex:0,VagaroToolkit:1,onChange:e=>{e.selectionState.selectAll?eM([-1]):eM([]),u(e),ed||e9()},SelectedIds:ek,IsSelect2OpenCallback:!0,Select2OpenCallback:e8,variant:"default",OnSearchChange:e=>{e4(e)},OnClearIconClick:()=>{to()},TotalRecord:em.initialTotalRecord||em.totalRecord,SearchAutoFocus:ep,SetControlonRight:q,InitialSelectAll:eo,InitialUnselectedValues:ea,CloseFromOutSide:!0,BlurInputOnSelect:el,ReportDropdown:!0,Loading:em.reportApiLoading,DropdownMenuPosition:es,ForceOnChangeFire:!ed,OnDropdownOpen:eT,DonotOpenNativeCal:ew})}):(0,a.jsx)("div",{ref:eN,className:`
2					VgCustomerDropdown
3					${e===i.Nw.SingleDropdown?"VgCustomerSingleSelect":""} 
4						${e===i.Nw.SingleDropdown&&!j?"VgSingleSelectPlaceHolder":""} 
5						${!M?"onPrefixIcon":""}
6						${B?"disabledCustomerDropdown":""}
7					`,children:(0,a.jsx)(y,{DropdownType:e,customerTab:em.customerTab,handleTabOnChange:tt,selectedOption:em.selectedOption,isShowSearchBox:em.isShowSearchBox,handleOnChange:t=>{if(e===i.Nw.SingleDropdown&&j&&t&&"object"==typeof t){let e=t.label||"";eS({type:i.X2.SET_SEARCHING_TEXT,payload:e}),eS({type:i.X2.SET_OPEN_AND_CLOSE_DROPDOWN,payload:!1})}null===t&&e===i.Nw.SingleDropdown?(eS({type:i.X2.SET_SELECTED_OPTION,payload:[]}),eS({type:i.X2.SET_EMPTY_OPTION,payload:[]}),eS({type:i.X2.SET_TOTAL_RECORD,payload:0})):eS({type:i.X2.SET_SELECTED_OPTION,payload:t}),e===i.Nw.ThreeTabDropdown&&em.customerTab===i.Ku.InToday&&eE.current>0?eD.current=t:u(t)},options:em.options,handleScroll:e3,TotalRecord:em.totalRecord,DropdownOpen:e8,DropdownClose:e9,LoadMorCutomer:()=>{e3()},IsLoading:em.isLoading,LoadingMessage:l,handleInputOnChange:e4,searchValue:em.searchedText,InTodayOptions:em.inTodayOptions,SaveForLaterOptions:em.saveForLaterOptions,InTodayTotalRecord:em.inTodayTotalRecord,SaveForLaterTotalRecord:em.saveForLaterTotalRecord,handleGroupCustomer:()=>{eS({type:i.X2.SET_IS_SHOW_SEARCH_BOX,payload:!1}),eS({type:i.X2.SET_OPEN_AND_CLOSE_DROPDOWN,payload:!1}),e!==i.Nw.SingleDropdown&&eS({type:i.X2.SET_EMPTY_OPTION,payload:[]}),eS({type:i.X2.SET_SEARCHING_TEXT,payload:""}),u(eD.current)},OpenAndClose:em.openAndCloseDropdown,handleOnSingleSelect:()=>{(e===i.Nw.ThreeTabDropdown||e===i.Nw.WithoutThreeTabDropdown||e===i.Nw.SingleDropdown)&&(eE.current=0,eD.current=[],eS({type:i.X2.SET_OPEN_AND_CLOSE_DROPDOWN,payload:!1}),eS({type:i.X2.SET_IS_SHOW_SEARCH_BOX,payload:!1}))},PlaceholderData:h,handleCloseOutSide:()=>{e!==i.Nw.SingleDropdown||j||eS({type:i.X2.SET_SEARCHING_TEXT,payload:""})},PlaceholderName:w,handleCreateNew:e=>{m&&void 0!==S&&(e9(),S(e))},ShowCreateNew:m,ShowFooter:_,CustomNoOptionsMessage:x,MenuPlacement:v,ResetInput:e1,InputPlaceholder:R,NoImage:eL,handleImageOnClick:e=>{e.stopPropagation(),e.preventDefault(),void 0!==L&&L(e)},handleDeleteImage:e=>{e.stopPropagation(),e.preventDefault(),void 0!==P&&P(e)},handleOnMultiSelectCheckbox:e=>{eE.current+=e?1:-1}
7,CountryId:A,HasCustomerRight:t,ShowInputBox:j,InputAutoFocus:k,ShowSearchIcon:M,DisableOptions:V,DisabledDropdown:B,handleClearSelection:to,inputRef:eI,Height:F,handleSeachOnClick:()=>{eI.current?.focus(),e8()},menuPortalTarget:e_.current,MaxLength:z,id:H,divTarget:G,ZIndex:Y,ClearSearchIcon:U,ShowHideLoading:$,ShowPoints:K},T)})})}},2091(e,t,o){o.r(t),o.d(t,{default:()=>r});var a=o(74848),n=o(96540),l=o(14977);let r=({onClick:e,OnDisabledTabClick:t,PreOnChange:o,Name:r=[],NoOfTab:i="",ActiveTab:s=0,TabVariant:d,TabPosition:c="center",TabSize:p="medium",BottomBorder:u=!1,FullWidth:h=!1,ShowSelectedBorder:T=!0,ShowSelectedBgColorTab:g=!1,HoverEffect:w=!0})=>{let[m,S]=(0,n.useState)(r[s]?.id),[y,C]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{let e=0===s?r[0]?.id:r.find(e=>e.id===s)?.id;S(e??null),null!=e&&C(t=>new Set(t).add(e))},[s,r]);let O=async(a,n,l,r)=>{if(r)return void t?.(a,n,l);if(m!==a){if("function"==typeof o&&!1===await Promise.resolve(o(a,n,!0,l)))return;S(a),C(e=>new Set(e).add(a)),e?.(a,n,l)}},f=Array.from({length:parseInt(i)},(e,t)=>r[t]||{id:t,name:`Tab ${t}`}),N=r.find(e=>e.id===m),D=N&&y.has(m);return(0,a.jsxs)("div",{className:"vg-tab",children:[(0,a.jsx)("ul",{className:`vg-nav-tabs ${g?"vg-nav-tabs-bg":""} ${"vertical"===d?"vertical":"horizontal"} ${c} ${p} ${u?" full-width-border":""} ${h?"vg-full-width-tab":""}`,children:f.map(({id:e,name:t,IconSVG:o,badgeCount:n,IconNode:r,IconNodeAlignment:i,disabled:s,title:d,textColor:c})=>{let p=m===e,u=i??"left";return(0,a.jsx)("li",{title:d,onClick:o=>O(e,t,o,s),className:`vg-list-item ${p&&T?"active":""} ${p&&g?"active-bg":""} ${s?"vg-tab-item-disabled":""} ${!w?"vg-no-hover":""}`,children:(0,a.jsxs)("a",{className:`vg-tab-link ${p?"vg-tab-link":"vg-tab-link w--current"}`,style:c?{color:c}:void 0,children:[o&&(0,a.jsx)("span",{className:"vg-tab-icon",children:o}),r&&"left"===u&&(0,a.jsx)("div",{className:"vg-icon-node vg-icon-node-left",children:r}),t,null!=n&&parseInt(n)>0?(0,a.jsx)("span",{className:"vg-badge-tabLink",children:(0,a.jsx)(l.default,{BadgeColorVariant:"leave",BadgeSize:"overlay",BadgeText:n,BadgeVariation:"none"})}):"",r&&"right"===u&&(0,a.jsx)("div",{className:"vg-icon-node vg-icon-node-right",children:r})]})},e)})}),D&&N.Children&&(0,a.jsx)("div",{className:"vg-tab-children",children:N.Children})]})}},2390(e,t,o){o.r(t),o.d(t,{default:()=>i});var a=o(74848),n=o(96540),l=o(40961),r=o(98232);let i=({TooltipText:e,Children:t,ScreenTitleForMobile:o,Html:i=!0,TextAlign:s="center",BeakPoint:d="Down",BeakPosition:c="Middle",Duration:p=2e3,ShowHover:u=!0,TriggerTooltip:h=!1,OnTooltipClose:T,FullWidth:g=!1,TooltipRender:w="inline",MaxWidth:m,FullHeight:S=!1,ForceWebRender:y=!1})=>{let[C,O]=(0,n.useState)("top-center"),[f,N]=(0,n.useState)(!1),D=(0,n.useRef)(null),E=(0,n.useRef)(null),I=(0,n.useRef)(null),_=(0,n.useRef)(null),x=(0,n.useRef)(!1),[v,R]=(0,n.useState)({top:0,left:0}),L=r.Wp.CheckIsFromProAppWithoutState()&&!y,P=r.Wp.CheckIsFromIpadAndroidTabWithoutParm(),A=u&&!P,b=(0,n.useRef)([]),X=e=>{let t=getComputedStyle(e),o=t.overflowY,a=t.overflowX;return/(auto|scroll|overlay)/.test(o)||/(auto|scroll|overlay)/.test(a)},j=(0,n.useCallback)(e=>{let t=[],o=e?.parentElement||null;for(;o;)X(o)&&t.push(o),o=o.parentElement;return t.push(document.scrollingElement||document.documentElement),t},[]);(0,n.useEffect)(()=>(I.current&&(clearTimeout(I.current),I.current=null),!u&&h?(N(!0),p>0&&(I.current=setTimeout(()=>{N(!1),T&&T()},p))):N(!1),()=>{I.current&&(clearTimeout(I.current),I.current=null)}),[h,p,T,u]),(0,n.useEffect)(()=>{if("portal"!==w&&f&&D.current&&E.current){let e=D.current.getBoundingClientRect(),t=E.current.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight,n=t.top>=e.height,l=a-t.bottom>=e.height,r=t.left>=e.width,i=o-t.right>=e.width;n?O("top-center"):l?O("bottom-center"):r?O("left"):i?O("right"):O("bottom-center")}},[f,w]),(0,n.useEffect)(()=>{if("inline"!==w&&f&&E.current){let e=E.current.getBoundingClientRect(),t=D.current?.getBoundingClientRect().width??200,o=D.current?.getBoundingClientRect().height??40,a=window.innerWidth,n=window.innerHeight,l=e.top>=o+8,r=n-e.bottom>=o+8,i=e.left>=t+8,s=a-e.right>=t+8;l?O("top-center"):r?O("bottom-center"):i?O("left"):s?O("right"):O("bottom-center")}},[f,w]);let k=()=>
7{if(!E.current||!D.current)return"Middle";let e=E.current.getBoundingClientRect(),t=D.current.getBoundingClientRect(),o=window.innerWidth,a=t.width||200,n=e.left+e.width/2,l=n-a/2,r=o-(n+a/2);return l>=20&&r>=20?"Middle":l<20?"Left":r<20?"Right":"Middle"};(0,n.useEffect)(()=>{let e=c;"Auto"===c&&(e=k()),"Down"===d&&"Middle"===e?O("bottom-center"):"Down"===d&&"Left"===e?O("bottom-left"):"Down"===d&&"Right"===e?O("bottom-right"):"Up"===d&&"Left"===e?O("top-left"):"Up"===d&&"Right"===e&&O("top-right")},[d,c,C,f]),(0,n.useEffect)(()=>{if("Auto"!==c)return;let e=()=>{if(f){let e=k();"Down"===d&&"Middle"===e?O("bottom-center"):"Down"===d&&"Left"===e?O("bottom-left"):"Down"===d&&"Right"===e?O("bottom-right"):"Up"===d&&"Left"===e?O("top-left"):"Up"===d&&"Right"===e&&O("top-right")}};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[c,d,f,window.innerWidth]);let M=(0,n.useCallback)(()=>{if("inline"===w||!f||"Auto"!==c||!D.current||!E.current)return;let e=D.current.getBoundingClientRect(),t=E.current.getBoundingClientRect(),o=window.innerWidth,a=t.left,n=o-t.right,l=e.width;return n<l&&n<a?`${a+30}px`:a<l&&a<n?`${n+30}px`:void 0},[w,f,c]),V=(0,n.useCallback)(()=>{if("inline"===w||!f||!D.current||!E.current)return;let e=D.current.getBoundingClientRect(),t=E.current.getBoundingClientRect(),o=0,a=0,n=t.left+t.width/2,l=t.top+t.height/2;switch(C){case"top-center":o=t.top-e.height-8,a=n-e.width/2;break;case"bottom-center":o=t.bottom+8,a=n-e.width/2;break;case"left":o=l-e.height/2,a=t.left-e.width-8;break;case"right":o=l-e.height/2,a=t.right+8;break;case"top-left":o=t.top-e.height-8,a=t.left-10;break;case"top-right":o=t.top-e.height-8,a=t.right-e.width+10;break;case"bottom-left":o=t.bottom+8,a=t.left-10;break;case"bottom-right":o=t.bottom+8,a=t.right-e.width+10}let r=window.innerWidth,i=window.innerHeight,s=Math.max(8,Math.min(a,r-e.width-8)),d=Math.max(8,Math.min(o,i-e.height-8)),c=`${n-s}px`;R({top:d,left:s,maxWidth:M(),beakLeft:c})},[w,f,C,M]);(0,n.useLayoutEffect)(()=>{"portal"===w&&V()},[f,C,c,w,V]),(0,n.useEffect)(()=>{if("inline"===w||!f)return;let e=j(E.current);b.current=e;let t=()=>V();return e.forEach(e=>e.addEventListener("scroll",t,{passive:!0})),window.addEventListener("resize",t),t(),()=>{e.forEach(e=>e.removeEventListener("scroll",t)),window.removeEventListener("resize",t)}},[f,C,c,w,V,j]),(0,n.useEffect)(()=>{if(!f)return;let e=j(E.current),t=()=>{x.current=!0,N(!1),T&&T()};return e.forEach(e=>e.addEventListener("scroll",t,{passive:!0})),window.addEventListener("scroll",t,{passive:!0}),()=>{e.forEach(e=>e.removeEventListener("scroll",t)),window.removeEventListener("scroll",t)}},[f,j,T]);let B=e=>new DOMParser().parseFromString(e,"text/html").body.textContent||"";(0,n.useEffect)(()=>{let e=e=>{P&&E.current&&!E.current.contains(e.target)&&N(!1)};if(P)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[P]),(0,n.useEffect)(()=>{if("portal"!==w&&!m&&f&&D.current&&E.current&&"Auto"===c){let e=D.current,t=e.getBoundingClientRect(),o=E.current.getBoundingClientRect(),a=window.innerWidth,n=o.left,l=a-o.right;e.style.maxWidth="none";let r=t.width;l<r&&l<n?e.style.maxWidth=`${n+30}px`:n<r&&n<l&&(e.style.maxWidth=`${l+30}px`)}},[f,C,w,m]);let F=()=>{_.current&&(window.clearTimeout(_.current),_.current=null)},W=()=>{A&&"inline"!==w&&(F(),N(!0))},z=()=>{A&&"inline"!==w&&(F(),_.current=window.setTimeout(()=>N(!1),10))};(0,n.useEffect)(()=>()=>F(),[]);let H=()=>{!P&&u&&(x.current=!1,N(!0))},G="portal"===w&&A?{onMouseEnter:W,onMouseLeave:z,onMouseMove:()=>{x.current&&W()}}:{onMouseEnter:H,onMouseLeave:()=>{!P&&u&&(x.current=!1,N(!1))},onMouseMove:()=>{x.current&&H()}};return(0,a.jsxs)("div",{className:`vg-group vg-tooltip-group ${S?"vg-tooltip-fullheight":""}`,children:[(0,a.jsxs)("div",{className:`vg-tooltip vg-tooltip-${C} ${g?"vg-tooltip-fullwidth":""} ${"portal"===w?"vg-tooltip-portal-trigger":""}`,ref:E,...G,onPointerUp:a=>{if(a.preventDefault(),a.stopPropagation(),u&&(P&&!L&&N(!0),L&&e)){var l={};l.message=e,l.messageType=0,l.screenTitle=n.isValidElement(t)?o||"Info":B(e),l.screenType=0,l.navType=51,l.action="",r.Wp.ToolkitSendCallbacktoMobile(5006,JSON.stringify(l))}},children:["inline"===w&&e&&f&&(0,a.jsx)("div",{className:`vg-tooltip-sms vg-text-${s}`,ref:D,style:m?{maxWidth:m}:void 0,children:i?(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:e||""}}):e&&B(e)}),t]}),"portal"===w&&e&&f&&(0,l.createPortal)((0,a.jsx)("div",{className:`vg-tooltip vg-tooltip-portal vg-tooltip-${C} ${g?"vg-tooltip-fullwidth":""}`,children:(0,a.jsx)("div",{className:`vg-tooltip-sms vg-text-${s}
7`,ref:D,style:{position:"fixed",top:v.top,left:v.left,maxWidth:m||v.maxWidth,zIndex:9999,visibility:0===v.left&&0===v.top?"hidden":"visible","--beak-left":v.beakLeft||"50%"},onMouseEnter:W,onMouseLeave:z,children:i?(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:e||""}}):e&&B(e)})}),document.body)]})}}}]);

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.