PageSourceSearch

https://vitanote.jp/_next/static/chunks/pages/items/search-1b595100eba24e58.js

js vitanote.jp collected 2026-09-24 12:21:30 UTC 9,050 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4987],{32305:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/items/search",function(){return l(10890)}])},10890:function(e,t,l){"use strict";l.r(t),l.d(t,{__N_SSP:function(){return z},default:function(){return B}});var r=l(85893),a=l(28262);let n=[{id:a.Axw.Supplement,label:"サプリメント"},{id:a.Axw.AnalyzeKit,label:"検査キット"},{id:a.Axw.Food,label:"フード"},{id:a.Axw.Personalized,label:"パーソナライズ"},{id:a.Axw.Snack,label:"スナック"},{id:a.Axw.Drink,label:"ドリンク"}],i=[{label:"パーソナライズサプリメント",keyword:"Supplement"},{label:"パーソナライズプロテイン",keyword:"プロテイン"},{label:"パーソナライズフード",categories:[a.Axw.Food]},{label:"検査キット",keyword:"検査キット"},{label:"ドリンク",categories:[a.Axw.Drink]}],o={categories:n};var s=l(9008),c=l.n(s),d=l(1563);let u={toCondition:e=>{let t={};return e.allergens&&(t.allergens=e.allergens.split(",").map(e=>a.tH4[e])),e.categories&&(t.categories=e.categories.split(",").map(e=>a.Axw[e])),e.keyword&&(t.keyword=e.keyword),t},toQuery:e=>{let t={};return e.allergens&&(t.allergens=Object.entries(a.tH4).filter(t=>{var l;let[,r]=t;return null===(l=e.allergens)||void 0===l?void 0:l.includes(r)}).map(e=>{let[t]=e;return t}).join(",")),e.categories&&(t.categories=Object.entries(a.Axw).filter(t=>{var l;let[,r]=t;return null===(l=e.categories)||void 0===l?void 0:l.includes(r)}).map(e=>{let[t]=e;return t}).join(",")),e.keyword&&(t.keyword=e.keyword),t}};var _=l(67294),p=l(11163),g=l(36886),h=l.n(g);let v=e=>
1u.toQuery({keyword:e.keyword,categories:e.categories}),m=e=>{let{onClose:t}=e,l=(0,p.useRouter)(),a=e=>{let r=l.query;l.push({pathname:"/items/search",query:{...r.allergens?{allergens:r.allergens}:{},...v(e)}}),t()};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:h().close_wrapper,children:[(0,r.jsx)("p",{className:h().title,children:"絞り込み"}),(0,r.jsx)("button",{type:"button",className:h().close_button,onClick:t,"aria-label":"閉じる",children:"\xd7"})]}),(0,r.jsx)("div",{className:h().body,children:(0,r.jsx)("ul",{className:h().category_list,children:i.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)("button",{type:"button",className:h().category_button,onClick:()=>a(e),children:e.label})},e.label))})})]})};var y=l(87663),x=l.n(y);let b=e=>{let{isOpen:t,onClose:l}=e;return t?(0,r.jsx)("div",{className:x().overlay,children:(0,r.jsx)("div",{className:x().content,children:(0,r.jsx)(m,{onClose:l})})}):null};var j=l(25675),f=l.n(j),C=l(43139),w=l(5069),k=l.n(w);let N=e=>{let{resultCount:t,onClickSearchCondition:l}=e;return(0,r.jsxs)("div",{className:k().wrapper,children:[void 0!==t&&(0,r.jsxs)("div",{className:k().result_count,children:["対象商品:",(0,r.jsx)("span",{className:k().result_number,children:t}),"件"]}),(0,r.jsxs)("button",{type:"button",onClick:l,className:k().filter,children:[(0,r.jsx)(f(),{src:C.N.iconsort,alt:"絞り込み",width:20,height:20}),"絞り込み"]})]})};var S=l(71916),T=l(94037),A=l(54357),q=l(30879),P=l(48934),R=l(74533),O=l.n(R);let E=e=>{let{section:t,items:l,addToCart:a,addToRecurringCart:n}=e;return(0,r.jsxs)("div",{className:O().section,children:[(0,r.jsx)("h2",{className:O().section_title,children:t.label}),(0,r.jsx)("div",{className:O().items_grid,children:l.map(e=>(0,r.jsx)("div",{className:O().item,children:(0,r.jsx)(P.q,{...e,addToCart:a,addToRecurringCart:n})},e.code))})]})},I=e=>{var t,l,a;let{section:n,allergens:i,useSearchQuery:o,addToCart:s,addToRecurringCart:c,onItemCount:d}=e,{data:u,loading:p,error:g}=o({keyword:n.keyword,categories:n.categories,allergens:i,paginate:{page:1,per:100}}),h=null!==(a=null==u?void 0:null===(l=u.searchItems)||void 0===l?void 0:null===(t=l.pagination)||void 0===t?void 0:t.totalCount)&&void 0!==a?a:0,v=(0,_.useRef)(d);if(v.current=d,(0,_.useEffect)(()=>{if(!p&&(null==u?void 0:u.searchItems)){var e;null===(e=v.current)||void 0===e||e.call(v,h)}},[p,h,null==u?void 0:u.searchItems,n.label]),g)return null;if(p||!(null==u?void 0:u.searchItems))return(0,r.jsx)(T.T,{});let{items:m}=u.searchItems;return 0===m.length?null:(0,r.jsx)(E,{section:n,items:m,addToCart:s,addToRecurringCart:c})},M=e=>{var t;let{allergens:l,onTotalCountChange:n}=e,o=(0,p.useRouter)(),{openAddToCartActionModal:s,openAddToRecurringActionModal:c,itemAddToCartOrRecurringActionModalElement:d}=(0,A.G)(),[u,g]=(0,a.Hl9)(),h=(0,_.useCallback)(async e=>{var t,l,r,a;let n=await u({variables:{input:{code:e,isAdd:!0,quantity:1}}});if(n.errors)return;s();let i=(null===(a=n.data)||void 0===a?void 0:null===(r=a.updateAdhocCartItem)||void 0===r?void 0:null===(l=r.adhocCart)||void 0===l?void 0:null===(t=l.items.find(t=>e===t.code))||void 0===t?void 0:t.price)||void 0;q.W.trackEvent({event:"click",label:"add_to_cart",item_id:e,price:i,quantity:1})},[u,s]),{isCustomer:v}=(0,S.Q)(),{data:m}=(0,a.GCL)({skip:!v}),y=(null==m?void 0:null===(t=m.recurringAccountDetail)||void 0===t?void 0:t.status)===a.lOy.Active,[x,b]=(0,a.HVg)(),j=(0,_.useCallback)(async e=>{if(!y){o.push("/recurring");return}(await x({variables:{input:{code:e,isAdd:!0,quantity:1}}})).errors||(c(),q.W.trackEvent({event:"click",label:"add_to_recurring_cart",item_id:e}))},[y,c,o,x]),f=(0,_.useCallback)(e=>(0,a.qcl)({variables:{input:e},fetchPolicy:"cache-first"}),[]),C=(0,_.useRef)({}),w=(0,_.useCallback)((e,t)=>{C.current[e]=t;let l=Object.values(C.current).reduce((e,t)=>e+t,0);null==n||n(l)},[n]);return(0,r.jsxs)("div",{children:[d,i.map(e=>(0,r.jsx)(I,{section:e,allergens:l,useSearchQuery:f,addToCart:g.loading?null:h,addToRecurringCart:b.loading?null:j,onItemCount:t=>w(e.label,t)},e.label))]})};var F=l(19268),L=l.n(F);let Q=e=>{var t;let l=[];
1if(e.keyword&&l.push("「".concat(e.keyword,"」")),(null==e?void 0:e.categories)&&(null==e?void 0:null===(t=e.categories)||void 0===t?void 0:t.length)>0){let t=o.categories.filter(t=>{var l;return null===(l=e.categories)||void 0===l?void 0:l.includes(t.id)}).map(e=>e.label);l.push(...t)}return l.length>0?l.join(", "):"全商品"},H=(e,t)=>(0,_.useEffect)(()=>{var l;if("/items/search"!==e.pathname||!(null==t?void 0:null===(l=t.data)||void 0===l?void 0:l.allergyFilter))return;let r=e.query,a=t.data.allergyFilter.allergens.filter(e=>e.isCaused).map(e=>{let{allergen:t}=e;return t.id}),n={...r,...u.toQuery({allergens:a.length>0?a:void 0})};JSON.stringify(n)!==JSON.stringify(r)&&e.push({pathname:"/items/search",query:n})},[e,t.data,e.query]),W=e=>!!(e.keyword||e.categories);var z=!0,B=()=>{let e=(0,p.useRouter)(),{isCustomer:t}=(0,S.Q)(),[l,n]=(0,_.useState)(!1),[i,o]=(0,_.useState)(void 0),s=(0,a.wPN)({fetchPolicy:"cache-first",skip:!t}),g=!W(e.query);H(e,s);let h=(0,_.useMemo)(()=>u.toCondition(e.query),[e.query]),v=Q(h),m=(0,_.useCallback)(e=>{let{data:t,loading:l}=(0,a.A3s)({variables:{input:{...h,paginate:{page:e,per:18}}},fetchPolicy:"cache-first"});return{itemsWithPagination:null==t?void 0:t.searchItems,loading:l}},[h]),{itemsListElement:y,totalCount:x}=(0,d.L)(m),j=()=>{n(!0)};return(0,r.jsxs)("main",{className:L().wrapper,children:[(0,r.jsxs)(c(),{children:[(0,r.jsx)("title",{children:"検索結果:".concat(v,"|VITANOTE(ビタノート)")}),(0,r.jsx)("meta",{name:"description",content:"".concat(v,"の商品一覧です。")}),(0,r.jsx)("meta",{property:"og:title",content:"検索結果:".concat(v,"|VITANOTE(ビタノート)")}),(0,r.jsx)("meta",{property:"og:description",content:"".concat(v,"の商品一覧です。")})]}),(0,r.jsx)(b,{onClose:()=>{n(!1)},isOpen:l}),g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{className:L().title,children:"全商品"}),(0,r.jsx)(N,{resultCount:i,onClickSearchCondition:j}),(0,r.jsx)(M,{allergens:h.allergens,onTotalCountChange:o})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{className:L().title,children:v}),(0,r.jsx)(N,{resultCount:x,onClickSearchCondition:j}),y]})]})}},87663:function(e){e.exports={overlay:"ItemSearchConditionModal_overlay__UnLa6",content:"ItemSearchConditionModal_content__1FaBp"}},36886:function(e){e.exports={close_wrapper:"TopModalPage_close_wrapper__A5oAa",title:"TopModalPage_title__PNLOz",close_button:"TopModalPage_close_button__f1MTZ",body:"TopModalPage_body__3dctB",category_list:"TopModalPage_category_list__4q5k1",category_button:"TopModalPage_category_button__jcsLH"}},5069:function(e){e.exports={wrapper:"ResultCountAndSearchCondition_wrapper___aTNZ",result_count:"ResultCountAndSearchCondition_result_count__TjQfe",result_number:"ResultCountAndSearchCondition_result_number__f7T3a",filter:"ResultCountAndSearchCondition_filter__qetNH"}},74533:function(e){e.exports={section:"StoreCategorySectionList_section__TETqd",section_title:"StoreCategorySectionList_section_title__nF8nj",items_grid:"StoreCategorySectionList_items_grid__ofBON",item:"StoreCategorySectionList_item__SR4b3"}},19268:function(e){e.exports={wrapper:"search_wrapper__j1nRx",title:"search_title__TgWwY"}}},function(e){e.O(0,[1563,2888,9774,179],function(){return e(e.s=32305)}),_N_E=e.O()}]);

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.