1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="27959755-fc6d-4b14-8ed1-955e090af6f8",e._sentryDebugIdIdentifier="sentry-dbid-27959755-fc6d-4b14-8ed1-955e090af6f8")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4364],{11746:(e,t,a)=>{a.d(t,{$:()=>u});var n=a(11362),s=a(40170),r=a(17194),i=a(7620),l=a(18208),o=a(52245),d=a(46721),c=(0,a(71620).v)(e=>({itemField:"",setItemField:t=>e({itemField:t}),businessField:"",setBusinessField:t=>e({businessField:t}),defaultBusinessField:"",setDefaultBusinessField:t=>e({defaultBusinessField:t})})),m=()=>({value:c(e=>e.itemField),set:c(e=>e.setItemField)}),u=e=>{var{enabled:t=!0,businessId:a,showOwnItems:c=!0}=e,{value:u,set:h}=m(),f=(0,o.nY)(),[g,y]=(0,i.useState)("ja"===f?"ja":"en"),[v,p]=(0,i.useState)(!c),[b,w]=(0,i.useState)([]),j=(0,d.d7)({value:u,delay:500}),k=l.F.useUtils();(0,i.useEffect)(()=>{t||setTimeout(()=>{h(""),w([])},300)},[t,h]);var N=(0,i.useMemo)(()=>j.trimEnd(),[j]),{data:I,isLoading:F,isLoadingError:C}=l.F.item.search.useQuery({businessId:a,query:N,locale:g,showOwnItems:c},{enabled:t&&(!!N||c),refetchOnWindowFocus:!1});(0,i.useEffect)(()=>{if(!t||!j&&!c)return void w([]);F||void 0!==I&&w(I.map(e=>(0,r._)((0,s._)({},e),{imgUrl:x(e.imgUrl)})))},[t,F,I,j,c]),(0,i.useEffect)(()=>{u&&p(!1)},[u]),(0,i.useEffect)(()=>{p(e=>!t||!F||e)},[F,t]);var E=(0,i.useCallback)((0,n._)(function*(){yield k.item.search.invalidate({businessId:a,query:j.trimEnd()})}),[k,a,j]);return{itemMasterList:(0,i.useMemo)(()=>{var e=b.filter(e=>!(e.name.indexOf("Amazon")>-1&&(e.name.indexOf("ã«ã¹ã¿ãã¼ã¬ãã¥ã¼")>-1||e.name.indexOf("Review")>-1)||e.storeUrl.indexOf("/s?k=")>-1)&&(!!e.name||!!e.storeUrl||!!e.imgUrl)),t=new Set;e=e.filter(e=>""===e.storeUrl||!t.has(e.storeUrl)&&(t.add(e.storeUrl),!0));var a=new Set;return e.filter(e=>""===e.name||!a.has(e.name)&&(a.add(e.name),!0))},[b]),isLoaded:v,isLoading:F,isLoadingError:C,query:u,setQuery:h,invalidate:E,locale:g,setLocale:y}},x=e=>{if(e.startsWith("https://m.media-amazon.com")){var t=e.split(/[?#]/)[0];if(!t)return e;var a=t.match(/\/images\/I\/(.*?)(?:\.|_)/);if(a&&a[1]){var n=t.match(/\.([^/.]+)$/),s=n?n[1]:"";return"https://m.media-amazon.com/images/I/".concat(a[1],".").concat(s)}}return e}},14845:(e,t,a)=>{a.d(t,{n:()=>I,L:()=>F});var n=a(54568),s=a(7620),r=a(52239),i=a(18254),l=a(81325),o=a(93953),d=a(46721),c=a(52245),m=a(40170),u=a(17194),x=a(22708),h=a(41231),f=a(28302),g=a(65051),y=a(64043),v=a(48902),p=a(71979),b=e=>{var{mode:t="default",itemMasterList:a,activeOptionId:i,setActiveOptionId:b,selectToCreate:w}=e,j=(0,s.useRef)(!1),{isSm:k}=(0,p.d)("sm"),N=(0,c.ii)("Items");(0,s.useEffect)(()=>{var e=()=>{j.current&&(j.current=!1)},t=()=>{j.current||(j.current=!0)};return document.addEventListener("keydown",e),document.addEventListener("mousemove",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousemove",t)}},[]);var F=(0,d.d7)({value:i,delay:300}),C=(0,s.useMemo)(()=>a.find(e=>e.id===F),[a,F]);return(0,n.jsxs)(r.Kc,{as:"div",static:!0,hold:!0,className:(0,l.cn)("flex divide-x divide-gray-100 dark:divide-gray-800","onboarding"===t&&"my-2"),"data-sentry-element":"Options","data-sentry-component":"ComboboxOptions","data-sentry-source-file":"comboBoxOptions.tsx",children:[(0,n.jsx)("div",{id:I,className:(0,l.cn)("hidden-scrollbar xs:px-6 -mx-2 mt-2 max-h-96 min-w-0 flex-auto scroll-py-4 overflow-y-auto overflow-x-hidden py-4","text-sm text-gray-700 dark:text-gray-200","onboarding"!==t&&"sm:h-128"),children:a.map(e=>{var a;return(0,n.jsxs)(r.jO,{as:"div",id:"item-master-id-".concat(e.id),value:e,onClick:()=>w(e),className:(0,l.cn)("flex cursor-pointer select-none items-center rounded-md p-2","onboarding"!==t&&e.id===i&&"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-gray-100"),onMouseEnter:()=>{j.current&&b(e.id)},children:[e.imgUrl?(0,n.jsx)(g.Image,{src:e.imgUrl,width:"onboarding"===t?64:40,height:"onboarding"===t?64:40,alt:"",className:(0,l.cn)("aspect-square flex-none bg-white shadow-md","onboarding"===t?"h-16 w-16 rounded-sm object-cover":"h-10 w-10 rounded-full object-cover"),unoptimized:e.id.startsWith(h.lx)}):(0,n.jsx)(y.Cv,{itemMaster:(0,u._)((0,m._)({},e),{hostFaviconPair:null!=(a=e.hostFaviconPair)?a:null}),size:"onboarding"===t?"lg":"md",className:"onboarding"===t?"max-h-16 max-w-16 p-4":""}),(0,n.jsx)("span",{className:(0,l.cn)("ml-3 flex-auto","onboarding"===t?"line-clamp-2":"truncate font-medium"),children:e.name})]},e.id)})}),"onboarding"!==t&&k?(0,n.jsx)("div",{className:"hidden-scrollbar h-128 flex w-1/2 flex-none flex-col divide-y divide-gray-100 overflow-y-auto dark:divide-gray-800",children:!!C&&(0,n.jsxs)("div",{className:"flex h-full flex-auto flex-col justify-between p-8",children:[(0,n.jsxs)("div",{className:"flex-none",children:[(0,n.jsx)("div",{className:"mx-auto flex w-4/5 items-center justify-center rounded-md bg-white py-8",children:C.imgUrl?(0,n.jsx)(g.Image,{src:C.imgUrl,alt:"",width:288,height:288,className:"mx-auto aspect-square h-52 object-contain",unoptimized:C.id.startsWith(h.lx)}):(0,n.jsx)(x.A,{className:"my-10 h-32 w-32 shrink-0 text-black"})}),(0,n.jsx)("h2",{className:"mt-4 line-clamp-3 font-semibold text-gray-900 dark:text-gray-200",children:C.name}),!!C.storeUrl&&(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(v.Y,{url:C.storeUrl,onClick:()=>{window.open(C.storeUrl,"_blank")}})})]}),(0,n.jsx)(f.Button,{id:o.v0,label:N("default"===t?C.id.startsWith(h.lx)?"confirm":"preview":"attach"),onClick:()=>w(C),size:"full",type:"primary"})]})}):(0,n.jsx)(f.Button,{style:{display:"none"},id:o.v0,label:"",onClick:()=>{C&&w(C)}})]})},w=a(49381),j=a(81940),k=e=>{var{text:t,setText:a,setQuery:s,onKeyDownInput:r,composition:i,setComposition:d,mode:m,isLoading:u=!1}=e,x=(0,c.ii)("Items"),{isXs:h}=(0,p.d)("xs");return(0,n.jsxs)("div",{className:"relative","data-sentry-component":"InputField","data-sentry-source-file":"inputField.tsx",children:[u?(0,n.jsx)(j.Loading,{size:"xs",className:"absolute left-3 top-2 lg:top-3"}):(0,n.jsx)(w.A,{className:"pointer-events-none absolute left-4 top-2.5 h-5 w-5 shrink-0 text-gray-400 md:top-3.5","aria-hidden":"true"}),(0,n.jsx)("input",{type:"text",id:o.rW,autoComplete:"off",className:(0,l.cn)("h-10 w-full rounded-full pl-11 pr-11 ring md:h-12","bg-gray-50 text-gray-900 placeholder:text-gray-400 hover:ring-gray-200 focus:ring-gray-200","dark:bg-gray-900 dark:text-gray-100 dark:placeholder-gray-400 dark:ring-gray-800 dark:hover:ring-gray-700 dark:focus:ring-gray-700"),placeholder:"".concat(x("onboarding"!==m&&h?"searchPlaceholder":"searchPlaceholderShort")," â"),value:t,onChange:e=>{a(e.target.value),i||s(e.target.value)},onMouseDown:e=>{e.preventDefault()},onKeyDown:r,onClick:e=>
1{e.preventDefault(),e.target.focus()},onBlur:e=>e.preventDefault(),onCompositionStart:()=>d(!0),onCompositionEnd:()=>{d(!1),s(t)}})]})},N=e=>{var{query:t,createItemWithBlankState:a,mode:s}=e,r=(0,c.ii)("Items");return"onboarding"!==s||t?(0,n.jsxs)("div",{className:(0,l.cn)("sm:max-h-128 flex flex-col justify-center px-6 py-6 text-center text-sm sm:px-14","onboarding"===s?"":"sm:h-128"),"data-sentry-component":"NotFound","data-sentry-source-file":"notFoundForm.tsx",children:[(0,n.jsxs)("div",{className:"mt-4 text-center text-lg font-semibold text-gray-900 dark:text-white",children:[(0,n.jsx)(w.A,{className:"mx-auto h-12 w-12 shrink-0 text-gray-400","aria-hidden":"true","data-sentry-element":"MagnifyingGlassIcon","data-sentry-source-file":"notFoundForm.tsx"}),(0,n.jsx)("div",{className:"mt-4",children:r("notFound.title")})]}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-gray-500 dark:text-gray-300",children:r("notFound.tryAgainOrCreate")}),(0,n.jsx)("p",{className:"mt-2 whitespace-pre-wrap",children:(0,n.jsx)("span",{className:"text-lg font-semibold text-gray-600 dark:text-white",children:'"'.concat(t,'"')})}),(0,n.jsx)(f.Button,{id:"create-item-from-not-found",title:r("createFromScratch"),label:r("createFromScratch"),onClick:()=>a(),labelIcon:void 0,size:"full",className:"mx-auto my-6",type:"primary"})]})]}):null},I="Item-scroll-area",F=e=>{var{mode:t="default",businessId:a,slug:m,selectToCreate:u,createItemWithBlankState:x,itemMasterList:h,query:f,setQuery:g,isLoaded:y,isLoadingError:v,setOpen:p,locale:w,setLocale:j}=e,[F,U]=(0,s.useState)(null),[L,B]=(0,s.useState)(f),[D,S]=(0,s.useState)(!1),_=(0,c.ii)("Common"),M=(0,s.useCallback)(e=>{if(0!==h.length&&F){var t=h.findIndex(e=>e.id===F),a=h[t+e];void 0!==a&&U(a.id)}},[F,h]),z=(0,s.useCallback)(e=>{if("Escape"===e.key)e.preventDefault(),p(!1);else if("Enter"===e.key){if(D){e.preventDefault(),e.stopPropagation();return}if("onboarding"===t)return;var a=document.getElementById(o.v0);a&&(a.click(),e.currentTarget.blur())}},[t,p,D]);(0,s.useEffect)(()=>{v&&i.Ay.error(_("messages.failedToLoad"))},[v,_]),(0,s.useEffect)(()=>{if("onboarding"!==t){var e;null==(e=document.getElementById(o.rW))||e.focus()}},[t]),(0,s.useEffect)(()=>{B(f)},[f]),(0,s.useEffect)(()=>{void 0!==h[0]&&U(h[0].id)},[h]);var A=(0,s.useCallback)(e=>{F&&("ArrowDown"===e.key?(e.preventDefault(),M(1)):"ArrowUp"===e.key&&(e.preventDefault(),M(-1)))},[F,M]);(0,s.useEffect)(()=>{if(F){var e=document.getElementById("item-master-id-".concat(F)),t=document.getElementById(I);if(e&&t){var a=t.getBoundingClientRect(),n=e.getBoundingClientRect();return n.top<a.top?t.scrollBy(0,-e.clientHeight):n.bottom>a.bottom&&t.scrollBy(0,e.clientHeight),document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}}}},[A,F,M]),(0,s.useEffect)(()=>()=>{document.removeEventListener("keydown",A)},[A]);var O=(0,d.d7)({value:h,delay:300}),T=(0,d.d7)({value:h,delay:2e3}),W=(0,d.d7)({value:y,delay:300}),P=(0,d.d7)({value:f,delay:300});return(0,n.jsx)(r.G3,{"data-sentry-element":"Combobox","data-sentry-component":"ItemSearchView","data-sentry-source-file":"index.tsx",children:(0,n.jsxs)("div",{className:(0,l.cn)("flex flex-col justify-between","onboarding"===t?"":"min-h-80 sm:min-h-0"),children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:(0,l.cn)("relative","onboarding"===t?"":"ml-4 mr-10 sm:mr-12"),children:(0,n.jsx)(k,{text:L,setText:B,setQuery:g,onKeyDownInput:z,composition:D,setComposition:S,mode:t,isLoading:""!==L&&!y,"data-sentry-element":"InputField","data-sentry-source-file":"index.tsx"})}),O.length>0?(0,n.jsx)("div",{className:"motion-safe:animate-fade-in transition-opacity duration-1000 motion-safe:opacity-0",children:(0,n.jsx)(b,{mode:t,itemMasterList:O,activeOptionId:F,selectToCreate:u,setActiveOptionId:U})}):""===P&&W?"onboarding"===t?null:(0,n.jsx)(E,{}):""!==f&&""!==P&&y&&W&&0===h.length&&0===T.length?(0,n.jsx)(N,{query:P,createItemWithBlankState:x,mode:t}):(0,n.jsx)("div",{className:"sm:h-128"})]}),(0,n.jsx)(C,{locale:w,setLocale:j,"data-sentry-element":"StoreLocationChange","data-sentry-source-file":"index.tsx"})]})})},C=e=>{var{locale:t,setLocale:a}=e,r=(0,c.nY)(),i=(0,c.ii)("Items.location"),o=(0,s.useMemo)(()=>[{locale:"en",country:"us"},{locale:"ja",country:"jp"}].sort(e=>e.locale===r?-1:1),[r]);return(0,n.jsx)("div",{className:"flex justify-end pt-4 sm:pt-0","data-sentry-component":"StoreLocationChange","data-sentry-source-file":"index.tsx",children:(0,n.jsxs)("div",{className:"flex space-x-2 rounded-full px-4 py-2 text-sm",children:[(0,n.jsx)("span",{children:i("change")}),(0,n.jsx)("div",{className:"flex space-x-1",children:o.map((e,r)=>(0,n.jsxs)(s.Fragment,{children:[0!==r&&(0,n.jsx)("div",{children:"ï½"}),(0,n.jsx)("div",{onClick:()=>a(e.locale),className:(0,l.cn)(t===e.locale?"pointer-events-none font-semibold":"cursor-pointer text-blue-500 underline hover:text-blue-700 dark:hover:text-blue-400"),children:i("country.".concat(e.country))})]},e.locale))})]})})},E=()=>{var e=(0,c.ii)("Items.searchIntro");return(0,n.jsx)("div",{className:"sm:h-128 flex items-center justify-center py-8 sm:py-0","data-sentry-component":"Introduction","data-sentry-source-file":"index.tsx",children:(0,n.jsx)("div",{className:"w-full max-w-2xl space-y-4 rounded-lg text-center sm:p-12",children:(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-7 text-gray-600 dark:text-gray-400",children:e("description")})})})}}
1,48902:(e,t,a)=>{a.d(t,{Y:()=>r});var n=a(54568),s=a(81325),r=e=>{var{url:t,onClick:a,className:r}=e;return(0,n.jsx)("div",{title:t,onClick:a,className:(0,s.cn)("mt-1 line-clamp-1 w-fit max-w-full text-xs text-gray-600 dark:text-gray-300",r),"data-sentry-component":"TextLink","data-sentry-source-file":"textLink.tsx",children:new URL(t).hostname})}},64043:(e,t,a)=>{a.d(t,{$H:()=>u,Cv:()=>h,Vz:()=>f});var n=a(54568),s=a(7620),r=a(22708),i=a(97065),l=a(81325),o=a(65051),d=a(30830),c={sm:8,md:10},m="p-1.5 w-".concat(16," h-").concat(16," xs:w-20 xs:h-20 sm:w-16 sm:h-16 xs:p-2 md:h-16 md:w-16 lg:h-20 lg:w-20 md:p-4"),u=e=>!!x(e)||!!e.storeUrl,x=e=>{if("MAP"===e.itemType||e.storeUrl){var t;return e.thumbnailUrl||(null==(t=e.hostFaviconPair)?void 0:t.faviconUrl)}return e.imgUrl},h=e=>{var{itemMaster:t,size:a,className:r,mobilePreview:i=!1}=e,l=(0,s.useMemo)(()=>x(t),[t]);return(0,n.jsx)(f,{thumbnailUrl:l,useLinkIconAsFallback:!!t.storeUrl,size:a,className:r,mobilePreview:i,"data-sentry-element":"Thumbnail","data-sentry-component":"ItemThumbnail","data-sentry-source-file":"thumbnail.tsx"})},f=e=>{var{thumbnailUrl:t,useLinkIconAsFallback:a,size:o,className:u,mobilePreview:x=!1}=e,h=(0,s.useMemo)(()=>!!t&&t.endsWith(".svg"),[t]),f="lg"===o?16:10;return(0,n.jsx)(n.Fragment,{children:t?h?(0,n.jsx)(i.k,{src:"".concat(d.C,"/").concat(t),className:(0,l.cn)("overflow-hidden rounded-md bg-white fill-gray-700 dark:fill-white","[&>div>svg.injected-svg]:aspect-square","sm"===o&&"h-".concat(c.sm," w-").concat(c.sm," p-0.5"),"md"===o&&"h-".concat(c.md," w-").concat(c.md," p-0.5"),"lg"===o&&m,x&&"w-".concat(f," h-").concat(f),u)}):(0,n.jsx)(g,{imgUrl:t,size:o,className:(0,l.cn)("aspect-square p-0.5",x&&"w-".concat(f," h-").concat(f),u),alt:""}):a?(0,n.jsx)(r.A,{className:(0,l.cn)("flex-none shrink-0 rounded-md border bg-white text-gray-900","sm"===o&&"h-".concat(c.sm," w-").concat(c.sm," p-0.5"),"md"===o&&"h-".concat(c.md," w-").concat(c.md," p-0.5"),"lg"===o&&m,x&&"w-".concat(f," h-").concat(f),u)}):null})},g=e=>{var{imgUrl:t,size:a,className:s,alt:r}=e;return(0,n.jsx)(o.Image,{alt:r,src:t,width:"lg"===a?64:"md"===a?40:32,height:"lg"===a?64:"md"===a?40:32,className:(0,l.cn)("rounded-md bg-white object-cover","h-".concat(10," w-").concat(10," p-0.5"),"lg"===a&&m,s),fit:"cover","data-sentry-element":"Image","data-sentry-component":"ImageThumbnail","data-sentry-source-file":"thumbnail.tsx"})}}}]);
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.