@soma-vertical-web/multi-lib 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cms/Sections/ProductCarousel/request.d.ts +4 -0
- package/contexts/contexts/search/Facets.d.ts +1 -1
- package/contexts/contexts/search/Products.d.ts +1 -1
- package/contexts/contexts/search/TopSearches.d.ts +2 -3
- package/contexts/index.d.ts +2 -2
- package/data/api/checkout/order-form/items/index.d.ts +1 -1
- package/data/api/checkout/order-form/items/update/index.d.ts +1 -1
- package/data/api/search/crosseling/index.d.ts +1 -1
- package/data/helpers/plp/index.d.ts +2 -1
- package/data/helpers/search/product/index.d.ts +1 -1
- package/index-By2TIGCS.js +4 -0
- package/{index-BM8vTUKg.mjs → index-CrmS0qoM.mjs} +750 -732
- package/index.js +16 -16
- package/index.mjs +4177 -4162
- package/index2.js +1 -1
- package/index2.mjs +12 -6
- package/layout/index.d.ts +2 -2
- package/layout/team-component/AddToCart/AddToCart.d.ts +1 -1
- package/layout/team-component/AddToCart/Composite/Card/Card.d.ts +1 -1
- package/layout/team-component/AddToCart/Composite/Card/Content.d.ts +1 -1
- package/layout/team-component/AddToCart/Composite/Card/StyleSize.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/Card.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/Composite/Sku.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/Composite/Style.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/index.d.ts +2 -2
- package/layout/template/MiniCart/Composite/Modal/Body/Body.d.ts +1 -1
- package/layout/template/MiniCart/index.d.ts +2 -2
- package/package.json +1 -1
- package/types/contexts/contexts/plp.d.ts +3 -3
- package/types/contexts/contexts/search.d.ts +8 -2
- package/types/contexts/hooks/index.d.ts +3 -3
- package/types/data/api/cms/index.d.ts +3 -1
- package/types/layout/team-components/AddToCart/index.d.ts +5 -1
- package/types/layout/templates/MiniCart/index.d.ts +2 -0
- package/types/layout/templates/SearchModal/index.d.ts +2 -1
- package/index-CZjoMPpQ.js +0 -4
package/index2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),x=require("./index-CZjoMPpQ.js"),V=require("@soma-vertical-web/core-components"),ft=require("yup"),mt=require("sanitize-html"),gt=require("jose");function bt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const l=bt(ft),wt=async({children:e,ClientCartProvider:t,...r})=>{const{data:n}=await x.fetchContentType("mini_cart",r);return S.jsx(t,{...n?Array.isArray(n)?{data:n[0]}:{data:n}:{},children:e})},vt=({slug:e,data:t,SectionZone:r,COMMON_PAGE_COLUMN_GAP:n,identifyWhoIsFirst:i})=>{const o=t==null?void 0:t.find(u=>{var w,v,y,_;return((v=(w=u.config)==null?void 0:w.responsive)==null?void 0:v.deviceType)==="desktop"&&((_=(y=u.config)==null?void 0:y.seo)==null?void 0:_.slug)===e}),c=o==null?void 0:o.config.responsive.gapCustom,a=o==null?void 0:o.config.responsive.gapSections,d=t==null?void 0:t.find(u=>{var w,v,y,_;return((v=(w=u.config)==null?void 0:w.responsive)==null?void 0:v.deviceType)==="mobile"&&((_=(y=u.config)==null?void 0:y.seo)==null?void 0:_.slug)===e}),g=d==null?void 0:d.config.responsive.gapCustom,s=d==null?void 0:d.config.responsive.gapSections;return S.jsxs(S.Fragment,{children:[S.jsx(V.Utils.Column,{gap:c&&a?a:n,className:V.helpers.classNameConcat(x.responsive["responsive-desktop-flex"],"utils-column-modifier"),children:S.jsx(r,{data:(o==null?void 0:o.sections)??[],identifyWhoIsFirst:i})}),S.jsx(V.Utils.Column,{gap:g&&s?s:n,className:V.helpers.classNameConcat(x.responsive["responsive-mobile-flex"],"utils-column-modifier"),children:S.jsx(r,{data:(d==null?void 0:d.sections)??[],identifyWhoIsFirst:i})})]})},yt=async({slug:e,SectionZone:t,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:n=!1,...i})=>{const{data:o}=await x.fetchContentType("common_page",i);return!o||!Array.isArray(o)||o.length===0?null:S.jsx(vt,{data:o,slug:e,SectionZone:t,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:n})},xt=async({children:e,ClientFlagsAndTagsProvider:t,...r})=>{const{data:n}=await x.fetchContentType("flags_and_tags",r);return!n||!Array.isArray(n)?null:S.jsx(t,{data:n[0],children:e})},_t=async({className:e,PAYMENT_FLAGS_DICTIONARY:t,PAYMENT_FLAGS:r,LEGAL_INFORMATION_TEXT:n,ICONS:i,SectionZone:o,Footer:c,FooterSupport:a,hasFooterStamps:d,...g})=>{var v,y,_,p,b,h,f,m,E,q,P;const{data:s}=await x.fetchContentType("footer",g),u=Array.isArray(s)&&((v=s[0])==null?void 0:v.type)==="footer"?s[0]:null,w={...(y=u==null?void 0:u.paymentInfo)==null?void 0:y.paymentInfo,acceptedFlags:Array.isArray((_=u==null?void 0:u.paymentInfo)==null?void 0:_.paymentInfo.acceptedFlags)?(p=u==null?void 0:u.paymentInfo)==null?void 0:p.paymentInfo.acceptedFlags.filter(R=>!!t[R]).map(R=>t[R]):[]};return u?S.jsx(c,{className:e,data:{...u},socialInfo:(b=u.socialMedia)==null?void 0:b.socialMedia,socialMedias:(f=(h=u.socialMedia)==null?void 0:h.socialMedia)==null?void 0:f.medias,payments:w,hasFooterStamps:d,adornment:{...(E=(m=u.supportInfo)==null?void 0:m.supportInfo)!=null&&E.content?{bottom:S.jsx(a,{content:(P=(q=u.supportInfo)==null?void 0:q.supportInfo)==null?void 0:P.content,CONSTANTS:{ICONS:i,PAYMENT_FLAGS:r,PAYMENT_FLAGS_DICTIONARY:t}})}:{},...u.sections.length?{top:S.jsx(o,{data:u.sections})}:{}},LEGAL_INFORMATION_TEXT:n,ICONS:i}):null},Rt=async({children:e,ClientHeaderProvider:t,...r})=>{var o,c,a,d,g,s;const{data:n}=await x.fetchContentType("header",r),i=Array.isArray(n)?n[0]:void 0;return S.jsx(t,{headerData:{...((o=i==null?void 0:i.layerConfig)==null?void 0:o.config)??{},subMenus:((c=i==null?void 0:i.sections)==null?void 0:c.map(u=>u.data))??[],categories:((d=(a=i==null?void 0:i.categories)==null?void 0:a.categories)==null?void 0:d.items)??[],navigationLinks:((s=(g=i==null?void 0:i.navigationLinks)==null?void 0:g.navigationLinks)==null?void 0:s.items)??[]},children:e})},Pt=e=>{var c,a;const t=(a=(c=e[0])==null?void 0:c.items)==null?void 0:a.items;if((t==null?void 0:t.items.length)===0||e.length===0)return{iconLabel:"",label:"",content:[]};const r=t==null?void 0:t.iconLabel,n=t==null?void 0:t.label,i=t==null?void 0:t.helpButtonSize,o=t.items.map((d,g)=>({type:d.type,id:`${g.toString()}-${d.title.toLowerCase()}`,title:d.title,subtitle:d.subtitle,description:d.description,buttonLabel:d.buttonLabel,buttonHref:d.buttonHref,buttonMode:d.buttonMode,buttonSize:d.buttonSize,buttonIcon:d.buttonIcon}));return{iconLabel:r,label:n,helpButtonSize:i,content:o}},It=async({HelpButton:e,ICONS:t,className:r,...n})=>{const{data:i}=await x.fetchContentType("helpbutton",n);if(!i||!Array.isArray(i)||i.length===0)return null;const o=Pt(i);return S.jsx(e,{data:o,ICONS:t,className:r})},Ct=async({SectionZone:e,LPCadastro:t,...r})=>{var d;const{data:n}=await x.fetchContentType("lp_cadastro",r);if(!n||!Array.isArray(n)||n.length===0)return null;const[i]=n,o=(i==null?void 0:i.sections)||[],c=((d=i==null?void 0:i.content)==null?void 0:d.conteúdo)||{},a=i==null?void 0:i.sections;return S.jsxs(S.Fragment,{children:[S.jsx(t,{sections:o,content:c}),S.jsx(e,{data:a})]})},St=async({LPLOJAS_TEMPLATE_RETURN_BUTTON:e,ICONS:t,entity:r,showVendor:n,LPStoresClientWrapper:i,...o})=>{var g;const{data:c}=await x.fetchContentType("lp_lojas",o),d=(g=(Array.isArray(c)?c:[])[0])==null?void 0:g.config.config;return S.jsx(i,{entity:r,content:d,data:c,showVendor:n,ICONS:t,LPLOJAS_TEMPLATE_RETURN_BUTTON:e})},kt=async({ERROR_TEMPLATE_RETURN_BUTTON:e,ErrorTemplate:t,...r})=>{var o;const{data:n}=await x.fetchContentType("notfound_page",r),i=Array.isArray(n)?(o=n[0])==null?void 0:o.config.config:null;return n&&i?S.jsx(t,{data:i,ERROR_TEMPLATE_RETURN_BUTTON:e}):S.jsx(S.Fragment,{})},Tt=async({children:e,productId:t,COMMON_PAGE_COLUMN_GAP:r,SectionZone:n,PDPContentProvider:i,...o})=>{const{data:c}=await x.fetchContentType("product_page",o);return!c||!Array.isArray(c)||c.length===0?null:S.jsx(i,{data:c[0],productId:t,COMMON_PAGE_COLUMN_GAP:r,SectionZone:n,children:e})},At={"column-modifier":"_column-modifier_1tqap_1"},Et=async({className:e,children:t,slug:r,SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:i,PLPContentProvider:o,...c})=>{const{data:a}=await x.fetchContentType("categories_page",c);if(!a||!Array.isArray(a))return null;const d=a.find(v=>{var y,_,p;return((y=v.config)==null?void 0:y.seo.slug)===r&&((p=(_=v.config)==null?void 0:_.responsive)==null?void 0:p.deviceType)==="desktop"}),g=a.find(v=>{var y,_,p;return((y=v.config)==null?void 0:y.seo.slug)===r&&((p=(_=v.config)==null?void 0:_.responsive)==null?void 0:p.deviceType)==="mobile"}),s=a.find(v=>{var y,_,p;return((y=v.config)==null?void 0:y.seo.slug)==="default"&&((p=(_=v.config)==null?void 0:_.responsive)==null?void 0:p.deviceType)==="desktop"}),u=a.find(v=>{var y,_,p;return((y=v.config)==null?void 0:y.seo.slug)==="default"&&((p=(_=v.config)==null?void 0:_.responsive)==null?void 0:p.deviceType)==="mobile"}),w=Array.isArray(e)?e:[e];return S.jsxs(S.Fragment,{children:[S.jsx(V.Utils.Column,{className:V.helpers.classNameConcat(x.responsive["responsive-desktop-flex"],[At["column-modifier"],...w]),style:{minHeight:"100vh"},children:S.jsx(o,{data:d??s,device:"desktop",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:i,children:t})}),S.jsx(V.Utils.Column,{className:V.helpers.classNameConcat(x.responsive["responsive-mobile-flex"],e),children:S.jsx(o,{data:g??u,device:"mobile",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:i,children:t})})]})},Ot=async({slug:e,...t})=>{var c,a,d;const{data:r}=await x.fetchContentType("redirect_to_search",t);if(!r||!Array.isArray(r))return{slug:e,query:null,redirect:!1};const n=((d=(a=(c=r[0])==null?void 0:c.redirectToSearch)==null?void 0:a.redirectToSearch)==null?void 0:d.paths)??[];if(!!!n.length)return{slug:e,query:null,redirect:!1};const o=n.find(g=>{var s,u;return((s=g.path)==null?void 0:s.replace(/\//g,"-").toLowerCase())===e.replace(/\//g,"-").toLowerCase()||((u=g.path)==null?void 0:u.replace(/\//g,"-").toLowerCase())===`/${e}`.replace(/\//g,"-").toLowerCase()});return o?{slug:e,query:o==null?void 0:o.searchQuery,redirect:!0,collectionId:o==null?void 0:o.collectionId,filters:o==null?void 0:o.filters,sort:o==null?void 0:o.sort}:{slug:e,query:null,redirect:!1,collectionId:null,filters:null,sort:null}},jt=async({slug:e,...t})=>{var c,a,d;const{data:r}=await x.fetchContentType("redirect_to_search",t);if(!r||!Array.isArray(r))return null;const n=((d=(a=(c=r[0])==null?void 0:c.redirectToSearch)==null?void 0:a.redirectToSearch)==null?void 0:d.paths)??[];if(!!!n.length)return null;const o=n.find(g=>{var s,u;return((s=g.path)==null?void 0:s.replace(/\//g,"-").toLowerCase())===e.replace(/\//g,"-").toLowerCase()||((u=g.path)==null?void 0:u.replace(/\//g,"-").toLowerCase())===`/${e}`.replace(/\//g,"-").toLowerCase()});return o?{slug:e,title:o.pageTitle,description:o.pageDescription}:null},qt=async({slug:e,Politicas:t,SectionZone:r,oneTrust:n,...i})=>{const{data:o}=await x.fetchContentType("policy_page",i),{data:c}=await x.fetchContentType("policy_tab",i),a=Array.isArray(o)?o:null,d=Array.isArray(c)?c:null,g=a?a[0].sections:null;return!a||!d?null:S.jsxs(S.Fragment,{children:[S.jsx(t,{slug:e,pageData:a[0],tabsData:d,oneTrust:n}),g&&S.jsx(r,{data:g})]})},Nt=async({children:e,SectionZone:t,className:r,...n})=>{const{data:i}=await x.fetchContentType("search_page",n);return Array.isArray(i)&&i.length>0?S.jsx(x.SearchPageScreening,{data:i,SectionZone:t,className:r,children:e}):S.jsx(S.Fragment,{children:"children"})},$t=async({ClientTipbarContent:e,...t})=>{const{data:r}=await x.fetchContentType("tipbar",t);return S.jsx(e,{data:r})},Ft=async({children:e,SectionZone:t,WishlistScreening:r,...n})=>{const{data:i}=await x.fetchContentType("wishlist_page",n);return S.jsx(r,{data:Array.isArray(i)?i:[],SectionZone:t,children:e})},Lt={CommonPageContent:yt,CartContent:wt,FlagsAndTagsContent:xt,HeaderContent:Rt,TipbarContent:$t,FooterContent:_t,PLPContent:Et,PDPContent:Tt,getRedirectData:Ot,getPLPSynteticMetaData:jt,SearchPageContent:Nt,HelpButtonContent:It,LPCadastroContent:Ct,LPLojasContent:St,PolicyPageContent:qt,NotFoundContent:kt,WishlistContent:Ft},Dt={Components:Lt},Ut=l.object({country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:l.string().nullable()});async function Ht({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Ut.validate(t);const{country:n,postalCode:i}=t;return await x.fetchVtex(`${e}/api/checkout/pub/postal-code/${n}/${i}`,{method:"POST",body:t,...r})}const Mt=l.object({orderFormId:l.string().nullable(),sellerCode:l.string().nullable(),sellerName:l.string().nullable()});async function Le({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Mt.validate(t);const{orderFormId:n,sellerCode:i,sellerName:o}=t,c=i?`${i.trim()} - ${o}`:null;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/openTextField`,{method:"POST",body:{value:c},...r})}const Bt=l.object({orderFormId:l.string().nullable(),sellerCode:l.string().nullable(),marketingData:l.object()});async function De({apiUrl:e,body:t,extraData:r={},fetchOptions:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Bt.validate(t);const{orderFormId:i,sellerCode:o,marketingData:c}=t,a=o?{utmCampaign:o?o.toUpperCase():"",utmiCampaign:o?`${r.VENDOR_CODE}`:"semcodigo"}:{};return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${i}/attachments/marketingData`,{method:"POST",body:{...c,...a},...n})}const Vt=l.object({orderFormId:l.string().nullable(),sellerCode:l.string().nullable(),sellerName:l.string().nullable()});async function zt({apiUrl:e,body:t,fetchOptions:r,extraData:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Vt.validate(t);const i=await Le({apiUrl:e,body:t,fetchOptions:r});return De({apiUrl:e,body:{...t,marketingData:i==null?void 0:i.marketingData},extraData:n,fetchOptions:r})}const Gt=l.object({orderFormId:l.string().nullable(),coupon:l.string().nullable()});async function Wt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Gt.validate(t);const{coupon:n="",orderFormId:i}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${i}/coupons`,{method:"POST",body:{text:n},...r})}const Qt=l.object({appId:l.string().required("App ID is required"),orderFormId:l.string().nullable(),key:l.array().of(l.string())});async function Xt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Qt.validate(t);const{appId:n="faststore",orderFormId:i,key:o}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${i}/customData/${n}/${o}`,{method:"PUT",...r})}const Kt=l.object().shape({name:l.string().required("Attachment name is required"),content:l.object().nullable()});var $e;const Zt=l.object().shape({attachments:($e=l.array().of(Kt))==null?void 0:$e.nullable(),id:l.string().required("ID of SKU is required"),index:l.number().integer().nullable(),quantity:l.number().integer().nullable(),seller:l.string().required("Seller is required"),price:l.number().integer()}),Jt=l.object({orderFormId:l.string().required("OrderFormId is required"),orderItems:l.array().of(Zt)});async function Yt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Jt.validate(t);const{orderFormId:n,orderItems:i}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items`,{method:"POST",body:{orderItems:i},...r})}const er=l.object({orderFormId:l.string().nullable()});async function tr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await er.validate(t);const{orderFormId:n}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items/removeAll`,{method:"POST",...r})}const rr=l.object().shape({name:l.string().required("Attachment name is required"),content:l.object().nullable()});var Fe;const nr=l.object().shape({attachments:(Fe=l.array().of(rr))==null?void 0:Fe.nullable(),id:l.string().required("ID of SKU is required"),index:l.number().integer().nullable(),quantity:l.number().integer().nullable(),seller:l.string().required("Seller is required"),price:l.number().integer()}),ir=l.object({orderFormId:l.string().nullable(),orderItems:l.array().of(nr)});async function ar({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await ir.validate(t);const{orderFormId:n,orderItems:i}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items/update`,{method:"POST",body:{orderItems:i},...r})}const or=l.object({orderFormId:l.string().nullable()});async function sr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await or.validate(t);const{orderFormId:n}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/messages/clear`,{method:"POST",...r})}const cr=l.object({id:l.string().nullable(),itemIndex:l.number().nullable(),orderFormId:l.string().nullable(),remove:l.boolean().nullable()});async function lr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await cr.validate(t);const{itemIndex:n,orderFormId:i,id:o,remove:c}=t,a=c?`/${o}/remove`:"",d=`${e}/api/checkout/pub/orderForm/${i}/items/${n}/offerings${a}`;return x.fetchVtex(d,{method:"POST",body:{id:o},...r})}const ur=l.object({orderFormId:l.string().nullable()});async function dr({apiUrl:e,body:t,fetchOptions:r,extraData:n}){var c;if(!t){console.error("[ERROR FETCHING] Body is required");return}await ur.validate(t);const i=new URLSearchParams({refreshOutdatedData:"true"}),o=t.orderFormId&&((c=n.orderFormPurchaseId)==null?void 0:c.value)!==t.orderFormId?`${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(i)}`:`${e}/api/checkout/pub/orderForm`;return x.fetchVtex(o,{method:"GET",...r})}const pr=l.object({orderFormId:l.string().nullable(),email:l.string().email().required(),firstName:l.string().required(),lastName:l.string().required(),documentType:l.string().required(),document:l.string().required(),phone:l.string().matches(/^\+\d{1,3}\d{10,11}$/)});async function hr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await pr.validate(t);const{orderFormId:n,...i}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/clientProfileData`,{method:"POST",body:{...i},...r})}const fr=l.object({sellerCode:l.string().nullable()});async function mr({apiUrl:e,body:t,extraData:r,fetchOptions:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await fr.validate(t);const{sellerCode:i=""}=t;return x.fetchVtex(`${e}/api/dataentities/${r.ENTITIES}/search?_fields=${r.FIELDS}&${r.FILTER}=${i}`,{method:"GET",headers:{Accept:"application/vnd.vtex.ds.v10+json"},...n})}const gr=l.object().shape({country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),orderFormId:l.string().nullable(),postalCode:l.string().nullable()});async function br({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await gr.validate(t);const{country:n,orderFormId:i,postalCode:o}=t,c=o?{address:{addressType:"residential",postalCode:o,country:n}}:{logisticsInfo:[],clearAddressIfPostalCodeNotFound:!0};return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${i}/attachments/shippingData`,{method:"POST",body:c,...r})}const wr=l.object().shape({orderFormId:l.string().nullable(),options:l.array().of(l.object().shape({itemIndex:l.number(),selectedDeliveryChannel:l.string(),selectedSla:l.string()})),selectedAddresses:l.array().of(l.object().shape({addressId:l.string().required(),addressType:l.string().required(),city:l.string().nullable(),complement:l.string().nullable(),country:l.string().required().length(3),geoCoordinates:l.array().of(l.number()).required().min(0),isDisposable:l.boolean().required(),neighborhood:l.string().nullable(),number:l.string().nullable(),postalCode:l.string().required(),receiverName:l.string().nullable(),reference:l.string().nullable(),state:l.string().nullable(),street:l.string().nullable()}))});async function vr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await wr.validate(t);const{orderFormId:n,options:i,selectedAddresses:o}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/shippingData`,{method:"POST",body:{selectedAddresses:o,clearAddressIfPostalCodeNotFound:!1,logisticsInfo:i},...r})}const yr=l.object({country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:l.string().nullable(),geoCoordinates:l.object().shape({longitude:l.number().required(),latitude:l.number().required()})});async function xr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await yr.validate(t);const{country:n="",geoCoordinates:i,postalCode:o=""}=t,c=new URLSearchParams({country:String(n)});return o?c.append("postalCode",o):c.append("geoCoordinates",`${i==null?void 0:i.longitude};${i==null?void 0:i.latitude}`),await x.fetchVtex(`${e}/api/checkout/pub/regions/?${c.toString()}`,{method:"GET",...r})}const _r=l.object({id:l.string().required("ID of SKU is required"),quantity:l.number().integer().required("Quantity of item is required"),seller:l.string()}),Rr=l.object({items:l.array().of(_r),country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:l.string().nullable(),geoCoordinates:l.array().nullable().of(l.number()).length(2)});async function Pr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}return await Rr.validate(t),x.fetchVtex(`${e}/api/checkout/pub/orderForms/simulation`,{method:"POST",body:t,...r})}const Ir=Object.freeze(Object.defineProperty({__proto__:null,getMasterDataSellerCode:mr,getOrderForm:dr,postOrderFormAddCoupon:Wt,postOrderFormAttachClientProfileData:hr,postOrderFormAttachOrderFormData:zt,postOrderFormAttachShippingData:br,postOrderFormAttachmentsMarketingData:De,postOrderFormAttachmentsOpenTextField:Le,postOrderFormClearMessages:sr,postOrderFormFreightSimulation:Pr,postOrderFormItems:Yt,postOrderFormRegion:xr,postOrderFormRemoveAllItems:tr,postOrderFormUpdateItems:ar,postOrderFormUpdateShippingData:vr,postOrderformAddress:Ht,putOrderFormCustomData:Xt,updateOrderFormOffering:lr},Symbol.toStringTag,{value:"Module"})),Cr=l.object({skuId:l.string()});async function Sr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Cr.validate(t);const{skuId:n}=t;return x.fetchVtex(`${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${n}`,{...r})}const kr=l.object({ids:l.array().of(l.string().required("ID are required")).required("IDs are required")});async function Tr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await kr.validate(t);const{ids:n}=t;return x.fetchVtex(`${e}/api/catalog_system/pub/products/search?fq=${n.map(i=>`productId:${i}`).join("&fq=")}`,{...r})}const Ar=l.object({productId:l.number().required("Product ID is required")});async function Er({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Ar.validate(t);const{productId:n}=t;return x.fetchVtex(`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`,{...r})}async function Or({apiUrl:e,params:t,fetchOptions:r}){return t!=null&&t.slug?x.fetchVtex(`${e}/api/catalog_system/pub/portal/pagetype/${t.slug}`,{...r}):(console.error("[ERROR FETCHING] slug is required"),null)}const jr=Object.freeze(Object.defineProperty({__proto__:null,getCatalogKitProducts:Sr,getCatalogPageInfo:Or,getCatalogProducts:Tr,getCatalogSimilars:Er},Symbol.toStringTag,{value:"Module"})),qr=l.object({query:l.string()});async function Nr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await qr.validate(t);const{query:n=""}=t,i=new URLSearchParams({query:n});return x.fetchVtex(`${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${i.toString()}`,{...r})}const $r=(e,t)=>mt(e,t),Fr=e=>({...e,description:e.description?$r(e.description):e.description}),Lr=({offer:e,seller:t,product:r})=>({...e,product:r,seller:t}),Ue=(e,t)=>({...e,isVariantOf:Fr(t)}),Dr=e=>e?"https://schema.org/InStock":"https://schema.org/OutOfStock",ie=e=>e.AvailableQuantity>0,je=e=>e.spotPrice??0,Ur=e=>e.Price??0,He=(e,t)=>ie(e)&&!ie(t)?-1:!ie(e)&&ie(t)?1:je(e)-je(t),Hr=(e,t)=>{let r=0;for(let n=1;n<e.length;n++)t(e[r],e[n])>0&&(r=n);return e[r]},Me=e=>{const t=e.flatMap(n=>n.sellers.map(i=>({offer:i.commertialOffer,sku:n}))),r=Hr(t,({offer:n},{offer:i})=>He(n,i));return r?r.sku:e[0]},Be=e=>e.map(({imageUrl:t,imageText:r,imageLabel:n})=>({alternateName:r??"",url:t.replace("vteximg.com.br","vtexassets.com"),keywords:n})),ae={attachment:"ATTACHMENT",specification:"SPECIFICATION",attribute:"ATTRIBUTE"},Mr=e=>({name:e.name,value:e.content,valueReference:ae.attachment}),Br=e=>({propertyID:e.id,name:e.name,value:e.value,valueReference:{valueReference:ae.attribute,visible:e.visible}}),oe=(e,t,r)=>{const n=e.flatMap(({name:c,values:a})=>a?a.map(d=>({name:c,value:d,valueReference:ae.specification})):{name:c,value:"",valueReference:ae.specification}),i=Array.isArray(r)?r.map(Mr):[],o=t?t.map(Br):[];return[...n,...i,...o]},qe="ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",Vr="AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa",zr=e=>{let t=e.slice(0);for(let r=0;r<qe.length;r++)t=t.replace(new RegExp(qe.charAt(r),"g"),Vr.charAt(r));return t},Gr=e=>e.replace(/[·/_,:]/,"-"),Ve=e=>{const r=e.replace(/,/g,"").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g,"-");return Gr(zr(r)).toLowerCase()},ze=e=>`/${e}/p`,Ge=e=>{const t=Math.max(...e.map(n=>n.NumberOfInstallments)),r=e.find(n=>n.NumberOfInstallments===t);return{count:(r==null?void 0:r.NumberOfInstallments)??0,value:(r==null?void 0:r.Value)??0}},We=(e,t)=>{const r={price:0,listPrice:0,sellerDefault:!1},i=e.map(o=>Lr({offer:o.commertialOffer,seller:o,product:t})).sort(He).map(o=>(o.seller.sellerId==="1"&&o.AvailableQuantity>0&&(r.price=o.Price,r.listPrice=o.ListPrice,r.sellerDefault=!0),{availability:o.AvailableQuantity>0,listPrice:o.ListPrice,price:Ur(o),priceValidUntil:o.PriceValidUntil,priceCurrency:"BRL",installments:o.Installments,lowPrice:o.spotPrice,quantity:o.AvailableQuantity,seller:{identifier:o.seller.sellerId}}));return{lowPrice:r.sellerDefault?r.price:i[0].price,highPrice:r.sellerDefault?r.listPrice:i[0].listPrice,offers:i}},Qe=e=>{const{attributes:t,itemId:r,name:n,sellers:i,variations:o}=e;return{additionalProperty:oe(o,t,[]),name:n,offers:{offers:i==null?void 0:i.map(({sellerId:c,commertialOffer:a})=>({availability:Dr(a.AvailableQuantity>0),listPrice:a.ListPrice,price:a.Price,quantity:a.AvailableQuantity,seller:{identifier:c}}))},sku:r}},Wr=e=>{var R;const{attributes:t,referenceId:r,isVariantOf:n,images:i,itemId:o,name:c,sellers:a,videos:d,variations:g}=e,{brand:s,categories:u,categoriesIds:w,description:v,linkText:y,productClusters:_,clusterHighlights:p,productName:b,properties:h,productId:f,productReference:m}=n,E=u.slice().reverse(),q=We(a,e.isVariantOf),P=Ge(q.offers[0].installments);return{sku:o,gtin:((R=r==null?void 0:r[0])==null?void 0:R.Value)??m??"",name:b??c,description:v,releaseDate:n.releaseDate??"",slug:y,video:d[0],categories:u,categoriesIds:w,id:f,brand:{name:s,brandName:s},seo:{description:v,title:b,canonical:ze(y)},cluster:{generals:_,highlights:p},properties:h,availability:{status:q.offers[0].availability},breadcrumbList:{itemListElement:[...E.map((T,N)=>{const $=T.split("/"),L=$[$.length-2],D=$.map(Ve).join("/");return{name:L,item:D,position:N+1}}),{name:n.productName,item:y,position:u.length+1}],numberOfItems:u.length},image:Be(i),offers:q,additionalProperty:oe(g,t,[]),isVariantOf:{productGroupID:n.productId,hasVariant:n.items.map(T=>Qe(T))},installments:P}},Qr=e=>{var P;const{attributes:t,referenceId:r,isVariantOf:n,images:i,itemId:o,name:c,sellers:a,Videos:d,variations:g}=e,{brand:s,categories:u,categoriesIds:w,description:v,linkText:y,productClusters:_,productName:p,Coleção:b,"ID Coleção":h,productId:f}=n,m=u.slice().reverse(),E=We(a,e.isVariantOf),q=Ge(E.offers[0].installments);return{sku:o,gtin:((P=r[0])==null?void 0:P.Value)??"",name:p??c,description:v,releaseDate:n.releaseDate??"",slug:y,video:d[0],categories:u,categoriesIds:w,collection:b,collectionId:h,id:f,brand:{name:s,brandName:s},seo:{description:v,title:p,canonical:ze(y)},cluster:{generals:_,highlights:[]},availability:{status:E.offers[0].availability},breadcrumbList:{itemListElement:[...m.map((R,T)=>{const N=R.split("/"),$=N[N.length-2],L=N.map(Ve).join("/");return{name:$,item:L,position:T+1}}),{name:n.productName,item:y,position:u.length+1}],numberOfItems:u.length},image:Be(i),offers:E,additionalProperty:oe(g,t,[]),isVariantOf:{productGroupID:n.productId,hasVariant:n.items.map(R=>{const{variations:T}=R,N=T.map($=>({name:$,values:R[$]}));return{...Qe(R),additionalProperty:oe(N,t,[])}})},installments:q}},Xr=l.array().of(l.object({key:l.string().required(),value:l.string().required()})).required("Facets are required");async function Kr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Xr.validate(t);const n=new URLSearchParams({}),i=t.map(({key:c,value:a})=>`${c}/${a}`).join("/");x.addSearchParamsFacets(t,n);const o=`${e}/api/catalog_system/pub/products/crossselling/${i}`;return x.fetchVtex(o,{cache:"no-store",...r}).then(c=>c.map(d=>{const g=Me(d.items);return g&&Ue(g,d)}).filter(d=>!!d).map(d=>({node:Qr(d)})))}const Xe=({apiUrl:e,body:t,fetchOptions:r,extraData:n})=>{if(!t){console.error("[ERROR FETCHING] Body is required");return}const{query:i="",page:o=1,count:c,sort:a="",facets:d=[],type:g,hideUnavailableItems:s=!0,locale:u=""}=t,w=new URLSearchParams({page:o.toString(),count:(c==null?void 0:c.toString())??(n==null?void 0:n.ITEMS_PER_PAGE)??24,query:i,sort:a,locale:u});s!==void 0&&w.append("hideUnavailableItems",s.toString());const v=d.map(y=>`${y.key}/${y.value}`).join("/")??"";return x.fetchVtexWithAbortController(`${e}/api/io/_v/api/intelligent-search/${g}/${v}?${w.toString()}`,{headers:{Accept:"application/json","content-type":"application/json"},...r})};async function Zr({body:e,extraData:t,...r}){if(!e){console.error("[ERROR FETCHING] Body is required");return}const n=await Xe({body:{...e,type:"product_search"},extraData:t,...r}),i=(n==null?void 0:n.products.map(a=>{const d=Me(a.items);return d&&Ue(d,a)}).filter(a=>!!a))??[],{pagination:o,recordsFiltered:c}=n;return{data:{pagination:{nextPage:o.after.length>0,previousPage:o.before.length>0,startCursor:"0",endCursor:c.toString(),count:c,total:o.count},products:i.map((a,d)=>({node:Wr(a),cursor:d.toString()}))}}}async function Jr({body:e,extraData:t,...r}){if(!e){console.error("[ERROR FETCHING] Body is required");return}const n=await Xe({body:{...e,type:"facets"},extraData:t,...r});return!n||!n.facets?(console.error("[ERROR FETCHING] No facets found"),{data:{facets:[]}}):{data:{...n,facets:x.formattedFacets(n,e==null?void 0:e.selectedFacets,(e==null?void 0:e.query)??"")}}}const Yr=l.object({query:l.string().optional(),locale:l.string().optional()});async function en({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Yr.validate(t);const{query:n="",locale:i="default_locale"}=t,o=new URLSearchParams({query:n,locale:i});return x.fetchVtex(`${e}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,{...r})}async function tn({apiUrl:e}){return x.fetchVtex(`${e}/api/io/_v/api/intelligent-search/top_searches`)}const rn=Object.freeze(Object.defineProperty({__proto__:null,getSearchAutoCompleteSuggestions:Nr,getSearchCrossellingProducts:Kr,getSearchFacets:Jr,getSearchProducts:Zr,getSearchSuggestedTerms:en,getSearchTopSearchs:tn},Symbol.toStringTag,{value:"Module"})),nn=l.object({masterDataEntity:l.string().nonNullable(),payload:l.object().shape({}).nullable()});async function an({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await nn.validate(t);const{masterDataEntity:n,payload:i}=t,o=`${e}/api/dataentities/${n}/documents`;return x.fetchVtex(o,{method:"POST",body:{payload:i},...r})}const on=l.object().shape({_where:l.string().optional(),_fields:l.string().optional(),_sort:l.string().optional(),_from:l.number().integer().min(0).optional(),_to:l.number().integer().min(0).optional(),_keyword:l.string().optional()}),sn=l.object({masterDataEntity:l.string().required(),searchFields:on,headers:l.object().shape({"REST-Range":l.string().notRequired()})});async function cn({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}const n=new URLSearchParams;await sn.validate(t);const{masterDataEntity:i,searchFields:o,headers:c}=t;o&&Object.entries(o).forEach(([g,s])=>{n.append(g,String(s))}),"_fields"in o||n==null||n.append("_fields","_all");let a=[],d=null;do{d&&n.set("_scroll",d);const g=await fetch(`${e}/api/dataentities/${i}/search?${n.toString()}`,{method:"GET",headers:{"REST-Range":(c==null?void 0:c["REST-Range"])??"resources=0-100",...r==null?void 0:r.headers},cache:"no-store"});if(!g.ok)throw new Error(`[MasterData] ${g.status} - ${g.statusText}`);const s=await g.json();a.push(...s),d=g.headers.get("x-vtex-md-scroll")}while(d);return a}const ln=l.object({dataEntityName:l.string().required(),id:l.string().required(),fieldsToBeUpdated:l.object().shape({})});async function un({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await ln.validate(t);const{dataEntityName:n,id:i,fieldsToBeUpdated:o}=t,c=`${e}/api/dataentities/${n}/documents/${i}`;return x.fetchVtex(c,{body:{fieldsToBeUpdated:o},method:"PATCH",...r})}const dn=Object.freeze(Object.defineProperty({__proto__:null,getSearchMasterdata:cn,patchUpdateMasterdata:un,postMasterdata:an},Symbol.toStringTag,{value:"Module"}));async function pn({body:e,apiUrl:t,extraData:r,fetchOptions:n}){const{productIds:i}=e;if(!i)return console.error("[ERROR FETCHING] productIds is required"),[];const{NAME_SPLIT_SYMBOL:o}=r;if(!o)return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"),[];const c=i.map(s=>typeof s=="string"||typeof s=="number"?`productId:${s}`:"").join("&fq="),a=await x.fetchVtex(`${t}/api/catalog_system/pub/products/search?fq=${c}`,{...n}),d=s=>Object.keys(s).map(u=>({id:u,name:s[u]}));return a.map((s,u)=>{var f;const{installments:w,price:v,listPrice:y,sizes:_,allSizesAvailable:p}=x.getSkuInfos({items:s.items,NAME_SPLIT_SYMBOL:o}),b=p?!0:_.some(m=>m.available),h=s.items[0].sellers[0].commertialOffer;return{node:{sku:s.items[0].itemId,gtin:s.productReference,name:s.productName,description:s.description,releaseDate:s.releaseDate,slug:s.linkText,categories:s.categories,categoriesIds:s.categoriesIds,id:s.items[0].itemId,brand:{name:s.brand,brandName:s.brand},seo:{description:s.description,title:s.productName,canonical:`/${s.linkText}/p`},cluster:{generals:d(s.productClusters),highlights:d(s.clusterHighlights)},availability:{status:b},image:s.items[0].images.map(({imageLabel:m,imageUrl:E})=>({alternateName:m,url:E,keywords:m})),offers:{lowPrice:v,highPrice:y,offers:[{availability:b,listPrice:y,price:v,priceValidUntil:h.PriceValidUntil,priceCurrency:"BRL",installments:h.Installments,lowPrice:v,quantity:h.AvailableQuantity,seller:{identifier:s.items[0].sellers[0].sellerId}}]},additionalProperty:(f=s==null?void 0:s.skuSpecifications)==null?void 0:f.map(m=>({name:s==null?void 0:s.skuSpecifications[0].field.name,value:m,valueReference:"SPECIFICATION"})),isVariantOf:{productGroupID:s.productId,hasVariant:s.items.map(m=>{var E;return{additionalProperty:m==null?void 0:m.variations.map(()=>{var q,P,R;return{name:(q=m==null?void 0:m.variations)==null?void 0:q[0],value:(R=m==null?void 0:m[(P=m==null?void 0:m.variations)==null?void 0:P[0]])==null?void 0:R[0],valueReference:"SPECIFICATION"}}),name:m.name,offers:{offers:(E=m.sellers)==null?void 0:E.map(({commertialOffer:q,sellerId:P})=>({availability:"https://schema.org/InStock",listPrice:q.ListPrice,price:q.Price,quantity:q.AvailableQuantity,seller:{identifier:P}}))},sku:m.itemId,slug:`-${m.itemId}`}})},installments:w},cursor:u.toString()}})}const hn=Object.freeze(Object.defineProperty({__proto__:null,getWishlistProducts:pn},Symbol.toStringTag,{value:"Module"}));var ge={exports:{}},Ke={},we={},Ze={},Je={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathSuffix",{enumerable:!0,get:function(){return r}});const t=x.parsePath;function r(n,i){if(!n.startsWith("/")||!i)return n;const{pathname:o,query:c,hash:a}=(0,t.parsePath)(n);return""+o+i+c+a}})(Je);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"formatNextPathnameInfo",{enumerable:!0,get:function(){return o}});const t=x.removeTrailingSlash,r=x.addPathPrefix,n=Je,i=x.addLocale;function o(c){let a=(0,i.addLocale)(c.pathname,c.locale,c.buildId?void 0:c.defaultLocale,c.ignorePrefix);return(c.buildId||!c.trailingSlash)&&(a=(0,t.removeTrailingSlash)(a)),c.buildId&&(a=(0,n.addPathSuffix)((0,r.addPathPrefix)(a,"/_next/data/"+c.buildId),c.pathname==="/"?"index.json":".json")),a=(0,r.addPathPrefix)(a,c.basePath),!c.buildId&&c.trailingSlash?a.endsWith("/")?a:(0,n.addPathSuffix)(a,"/"):(0,t.removeTrailingSlash)(a)}})(Ze);var Ye={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getHostname",{enumerable:!0,get:function(){return t}});function t(r,n){let i;if(n!=null&&n.host&&!Array.isArray(n.host))i=n.host.toString().split(":",1)[0];else if(r.hostname)i=r.hostname;else return;return i.toLowerCase()}})(Ye);var et={},tt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removePathPrefix",{enumerable:!0,get:function(){return r}});const t=x.pathHasPrefix;function r(n,i){if(!(0,t.pathHasPrefix)(n,i))return n;const o=n.slice(i.length);return o.startsWith("/")?o:"/"+o}})(tt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getNextPathnameInfo",{enumerable:!0,get:function(){return i}});const t=x.normalizeLocalePath,r=tt,n=x.pathHasPrefix;function i(o,c){var a;const{basePath:d,i18n:g,trailingSlash:s}=(a=c.nextConfig)!=null?a:{},u={pathname:o,trailingSlash:o!=="/"?o.endsWith("/"):s};d&&(0,n.pathHasPrefix)(u.pathname,d)&&(u.pathname=(0,r.removePathPrefix)(u.pathname,d),u.basePath=d);let w=u.pathname;if(u.pathname.startsWith("/_next/data/")&&u.pathname.endsWith(".json")){const y=u.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),_=y[0];u.buildId=_,w=y[1]!=="index"?"/"+y.slice(1).join("/"):"/",c.parseData===!0&&(u.pathname=w)}if(g){let y=c.i18nProvider?c.i18nProvider.analyze(u.pathname):(0,t.normalizeLocalePath)(u.pathname,g.locales);u.locale=y.detectedLocale;var v;u.pathname=(v=y.pathname)!=null?v:u.pathname,!y.detectedLocale&&u.buildId&&(y=c.i18nProvider?c.i18nProvider.analyze(w):(0,t.normalizeLocalePath)(w,g.locales),y.detectedLocale&&(u.locale=y.detectedLocale))}return u}})(et);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextURL",{enumerable:!0,get:function(){return d}});const t=x.detectDomainLocale,r=Ze,n=Ye,i=et,o=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function c(g,s){return new URL(String(g).replace(o,"localhost"),s&&String(s).replace(o,"localhost"))}const a=Symbol("NextURLInternal");class d{constructor(s,u,w){let v,y;typeof u=="object"&&"pathname"in u||typeof u=="string"?(v=u,y=w||{}):y=w||u||{},this[a]={url:c(s,v??y.base),options:y,basePath:""},this.analyze()}analyze(){var s,u,w,v,y;const _=(0,i.getNextPathnameInfo)(this[a].url.pathname,{nextConfig:this[a].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[a].options.i18nProvider}),p=(0,n.getHostname)(this[a].url,this[a].options.headers);this[a].domainLocale=this[a].options.i18nProvider?this[a].options.i18nProvider.detectDomainLocale(p):(0,t.detectDomainLocale)((u=this[a].options.nextConfig)==null||(s=u.i18n)==null?void 0:s.domains,p);const b=((w=this[a].domainLocale)==null?void 0:w.defaultLocale)||((y=this[a].options.nextConfig)==null||(v=y.i18n)==null?void 0:v.defaultLocale);this[a].url.pathname=_.pathname,this[a].defaultLocale=b,this[a].basePath=_.basePath??"",this[a].buildId=_.buildId,this[a].locale=_.locale??b,this[a].trailingSlash=_.trailingSlash}formatPathname(){return(0,r.formatNextPathnameInfo)({basePath:this[a].basePath,buildId:this[a].buildId,defaultLocale:this[a].options.forceLocale?void 0:this[a].defaultLocale,locale:this[a].locale,pathname:this[a].url.pathname,trailingSlash:this[a].trailingSlash})}formatSearch(){return this[a].url.search}get buildId(){return this[a].buildId}set buildId(s){this[a].buildId=s}get locale(){return this[a].locale??""}set locale(s){var u,w;if(!this[a].locale||!(!((w=this[a].options.nextConfig)==null||(u=w.i18n)==null)&&u.locales.includes(s)))throw new TypeError(`The NextURL configuration includes no locale "${s}"`);this[a].locale=s}get defaultLocale(){return this[a].defaultLocale}get domainLocale(){return this[a].domainLocale}get searchParams(){return this[a].url.searchParams}get host(){return this[a].url.host}set host(s){this[a].url.host=s}get hostname(){return this[a].url.hostname}set hostname(s){this[a].url.hostname=s}get port(){return this[a].url.port}set port(s){this[a].url.port=s}get protocol(){return this[a].url.protocol}set protocol(s){this[a].url.protocol=s}get href(){const s=this.formatPathname(),u=this.formatSearch();return`${this.protocol}//${this.host}${s}${u}${this.hash}`}set href(s){this[a].url=c(s),this.analyze()}get origin(){return this[a].url.origin}get pathname(){return this[a].url.pathname}set pathname(s){this[a].url.pathname=s}get hash(){return this[a].url.hash}set hash(s){this[a].url.hash=s}get search(){return this[a].url.search}set search(s){this[a].url.search=s}get password(){return this[a].url.password}set password(s){this[a].url.password=s}get username(){return this[a].url.username}set username(s){this[a].url.username=s}get basePath(){return this[a].basePath}set basePath(s){this[a].basePath=s.startsWith("/")?s:`/${s}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new d(String(this),this[a].options)}}})(we);var ve={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,g){for(var s in g)Object.defineProperty(d,s,{enumerable:!0,get:g[s]})}t(e,{fromNodeOutgoingHttpHeaders:function(){return n},normalizeNextQueryParam:function(){return a},splitCookiesString:function(){return i},toNodeOutgoingHttpHeaders:function(){return o},validateURL:function(){return c}});const r=x.constants;function n(d){const g=new Headers;for(let[s,u]of Object.entries(d)){const w=Array.isArray(u)?u:[u];for(let v of w)typeof v>"u"||(typeof v=="number"&&(v=v.toString()),g.append(s,v))}return g}function i(d){var g=[],s=0,u,w,v,y,_;function p(){for(;s<d.length&&/\s/.test(d.charAt(s));)s+=1;return s<d.length}function b(){return w=d.charAt(s),w!=="="&&w!==";"&&w!==","}for(;s<d.length;){for(u=s,_=!1;p();)if(w=d.charAt(s),w===","){for(v=s,s+=1,p(),y=s;s<d.length&&b();)s+=1;s<d.length&&d.charAt(s)==="="?(_=!0,s=y,g.push(d.substring(u,v)),u=s):s=v+1}else s+=1;(!_||s>=d.length)&&g.push(d.substring(u,d.length))}return g}function o(d){const g={},s=[];if(d)for(const[u,w]of d.entries())u.toLowerCase()==="set-cookie"?(s.push(...i(w)),g[u]=s.length===1?s[0]:s):g[u]=w;return g}function c(d){try{return String(new URL(String(d)))}catch(g){throw new Error(`URL is malformed "${String(d)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:g})}}function a(d,g){const s=[r.NEXT_QUERY_PARAM_PREFIX,r.NEXT_INTERCEPTION_MARKER_PREFIX];for(const u of s)if(d!==u&&d.startsWith(u)){const w=d.substring(u.length);g(w)}}})(ve);var rt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(o,c){for(var a in c)Object.defineProperty(o,a,{enumerable:!0,get:c[a]})}t(e,{PageSignatureError:function(){return r},RemovedPageError:function(){return n},RemovedUAError:function(){return i}});class r extends Error{constructor({page:c}){super(`The middleware "${c}" accepts an async API directly with the form:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),x=require("./index-By2TIGCS.js"),V=require("@soma-vertical-web/core-components"),ft=require("yup"),mt=require("sanitize-html"),gt=require("jose");function bt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const l=bt(ft),wt=async({children:e,ClientCartProvider:t,...r})=>{const{data:n}=await x.fetchContentType("mini_cart",r);return S.jsx(t,{...n?Array.isArray(n)?{data:n[0]}:{data:n}:{},children:e})},vt=({slug:e,data:t,SectionZone:r,COMMON_PAGE_COLUMN_GAP:n,identifyWhoIsFirst:i})=>{const o=t==null?void 0:t.find(u=>{var w,v,y,_;return((v=(w=u.config)==null?void 0:w.responsive)==null?void 0:v.deviceType)==="desktop"&&((_=(y=u.config)==null?void 0:y.seo)==null?void 0:_.slug)===e}),c=o==null?void 0:o.config.responsive.gapCustom,a=o==null?void 0:o.config.responsive.gapSections,d=t==null?void 0:t.find(u=>{var w,v,y,_;return((v=(w=u.config)==null?void 0:w.responsive)==null?void 0:v.deviceType)==="mobile"&&((_=(y=u.config)==null?void 0:y.seo)==null?void 0:_.slug)===e}),g=d==null?void 0:d.config.responsive.gapCustom,s=d==null?void 0:d.config.responsive.gapSections;return S.jsxs(S.Fragment,{children:[S.jsx(V.Utils.Column,{gap:c&&a?a:n,className:V.helpers.classNameConcat(x.responsive["responsive-desktop-flex"],"utils-column-modifier"),children:S.jsx(r,{data:(o==null?void 0:o.sections)??[],identifyWhoIsFirst:i})}),S.jsx(V.Utils.Column,{gap:g&&s?s:n,className:V.helpers.classNameConcat(x.responsive["responsive-mobile-flex"],"utils-column-modifier"),children:S.jsx(r,{data:(d==null?void 0:d.sections)??[],identifyWhoIsFirst:i})})]})},yt=async({slug:e,SectionZone:t,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:n=!1,...i})=>{const{data:o}=await x.fetchContentType("common_page",i);return!o||!Array.isArray(o)||o.length===0?null:S.jsx(vt,{data:o,slug:e,SectionZone:t,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:n})},xt=async({children:e,ClientFlagsAndTagsProvider:t,...r})=>{const{data:n}=await x.fetchContentType("flags_and_tags",r);return!n||!Array.isArray(n)?null:S.jsx(t,{data:n[0],children:e})},_t=async({className:e,PAYMENT_FLAGS_DICTIONARY:t,PAYMENT_FLAGS:r,LEGAL_INFORMATION_TEXT:n,ICONS:i,SectionZone:o,Footer:c,FooterSupport:a,hasFooterStamps:d,...g})=>{var v,y,_,p,b,h,f,m,E,q,P;const{data:s}=await x.fetchContentType("footer",g),u=Array.isArray(s)&&((v=s[0])==null?void 0:v.type)==="footer"?s[0]:null,w={...(y=u==null?void 0:u.paymentInfo)==null?void 0:y.paymentInfo,acceptedFlags:Array.isArray((_=u==null?void 0:u.paymentInfo)==null?void 0:_.paymentInfo.acceptedFlags)?(p=u==null?void 0:u.paymentInfo)==null?void 0:p.paymentInfo.acceptedFlags.filter(R=>!!t[R]).map(R=>t[R]):[]};return u?S.jsx(c,{className:e,data:{...u},socialInfo:(b=u.socialMedia)==null?void 0:b.socialMedia,socialMedias:(f=(h=u.socialMedia)==null?void 0:h.socialMedia)==null?void 0:f.medias,payments:w,hasFooterStamps:d,adornment:{...(E=(m=u.supportInfo)==null?void 0:m.supportInfo)!=null&&E.content?{bottom:S.jsx(a,{content:(P=(q=u.supportInfo)==null?void 0:q.supportInfo)==null?void 0:P.content,CONSTANTS:{ICONS:i,PAYMENT_FLAGS:r,PAYMENT_FLAGS_DICTIONARY:t}})}:{},...u.sections.length?{top:S.jsx(o,{data:u.sections})}:{}},LEGAL_INFORMATION_TEXT:n,ICONS:i}):null},Rt=async({children:e,ClientHeaderProvider:t,...r})=>{var o,c,a,d,g,s;const{data:n}=await x.fetchContentType("header",r),i=Array.isArray(n)?n[0]:void 0;return S.jsx(t,{headerData:{...((o=i==null?void 0:i.layerConfig)==null?void 0:o.config)??{},subMenus:((c=i==null?void 0:i.sections)==null?void 0:c.map(u=>u.data))??[],categories:((d=(a=i==null?void 0:i.categories)==null?void 0:a.categories)==null?void 0:d.items)??[],navigationLinks:((s=(g=i==null?void 0:i.navigationLinks)==null?void 0:g.navigationLinks)==null?void 0:s.items)??[]},children:e})},Pt=e=>{var c,a;const t=(a=(c=e[0])==null?void 0:c.items)==null?void 0:a.items;if((t==null?void 0:t.items.length)===0||e.length===0)return{iconLabel:"",label:"",content:[]};const r=t==null?void 0:t.iconLabel,n=t==null?void 0:t.label,i=t==null?void 0:t.helpButtonSize,o=t.items.map((d,g)=>({type:d.type,id:`${g.toString()}-${d.title.toLowerCase()}`,title:d.title,subtitle:d.subtitle,description:d.description,buttonLabel:d.buttonLabel,buttonHref:d.buttonHref,buttonMode:d.buttonMode,buttonSize:d.buttonSize,buttonIcon:d.buttonIcon}));return{iconLabel:r,label:n,helpButtonSize:i,content:o}},It=async({HelpButton:e,ICONS:t,className:r,...n})=>{const{data:i}=await x.fetchContentType("helpbutton",n);if(!i||!Array.isArray(i)||i.length===0)return null;const o=Pt(i);return S.jsx(e,{data:o,ICONS:t,className:r})},Ct=async({SectionZone:e,LPCadastro:t,...r})=>{var d;const{data:n}=await x.fetchContentType("lp_cadastro",r);if(!n||!Array.isArray(n)||n.length===0)return null;const[i]=n,o=(i==null?void 0:i.sections)||[],c=((d=i==null?void 0:i.content)==null?void 0:d.conteúdo)||{},a=i==null?void 0:i.sections;return S.jsxs(S.Fragment,{children:[S.jsx(t,{sections:o,content:c}),S.jsx(e,{data:a})]})},St=async({LPLOJAS_TEMPLATE_RETURN_BUTTON:e,ICONS:t,entity:r,showVendor:n,LPStoresClientWrapper:i,...o})=>{var g;const{data:c}=await x.fetchContentType("lp_lojas",o),d=(g=(Array.isArray(c)?c:[])[0])==null?void 0:g.config.config;return S.jsx(i,{entity:r,content:d,data:c,showVendor:n,ICONS:t,LPLOJAS_TEMPLATE_RETURN_BUTTON:e})},kt=async({ERROR_TEMPLATE_RETURN_BUTTON:e,ErrorTemplate:t,...r})=>{var o;const{data:n}=await x.fetchContentType("notfound_page",r),i=Array.isArray(n)?(o=n[0])==null?void 0:o.config.config:null;return n&&i?S.jsx(t,{data:i,ERROR_TEMPLATE_RETURN_BUTTON:e}):S.jsx(S.Fragment,{})},Tt=async({children:e,productId:t,COMMON_PAGE_COLUMN_GAP:r,SectionZone:n,PDPContentProvider:i,...o})=>{const{data:c}=await x.fetchContentType("product_page",o);return!c||!Array.isArray(c)||c.length===0?null:S.jsx(i,{data:c[0],productId:t,COMMON_PAGE_COLUMN_GAP:r,SectionZone:n,children:e})},At={"column-modifier":"_column-modifier_1tqap_1"},Et=async({className:e,children:t,slug:r,SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:i,PLPContentProvider:o,...c})=>{const{data:a}=await x.fetchContentType("categories_page",c);if(!a||!Array.isArray(a))return null;const d=a.find(v=>{var y,_,p;return((y=v.config)==null?void 0:y.seo.slug)===r&&((p=(_=v.config)==null?void 0:_.responsive)==null?void 0:p.deviceType)==="desktop"}),g=a.find(v=>{var y,_,p;return((y=v.config)==null?void 0:y.seo.slug)===r&&((p=(_=v.config)==null?void 0:_.responsive)==null?void 0:p.deviceType)==="mobile"}),s=a.find(v=>{var y,_,p;return((y=v.config)==null?void 0:y.seo.slug)==="default"&&((p=(_=v.config)==null?void 0:_.responsive)==null?void 0:p.deviceType)==="desktop"}),u=a.find(v=>{var y,_,p;return((y=v.config)==null?void 0:y.seo.slug)==="default"&&((p=(_=v.config)==null?void 0:_.responsive)==null?void 0:p.deviceType)==="mobile"}),w=Array.isArray(e)?e:[e];return S.jsxs(S.Fragment,{children:[S.jsx(V.Utils.Column,{className:V.helpers.classNameConcat(x.responsive["responsive-desktop-flex"],[At["column-modifier"],...w]),style:{minHeight:"100vh"},children:S.jsx(o,{data:d??s,device:"desktop",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:i,children:t})}),S.jsx(V.Utils.Column,{className:V.helpers.classNameConcat(x.responsive["responsive-mobile-flex"],e),children:S.jsx(o,{data:g??u,device:"mobile",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:i,children:t})})]})},Ot=async({slug:e,...t})=>{var c,a,d;const{data:r}=await x.fetchContentType("redirect_to_search",t);if(!r||!Array.isArray(r))return{slug:e,query:null,redirect:!1};const n=((d=(a=(c=r[0])==null?void 0:c.redirectToSearch)==null?void 0:a.redirectToSearch)==null?void 0:d.paths)??[];if(!!!n.length)return{slug:e,query:null,redirect:!1};const o=n.find(g=>{var s,u;return((s=g.path)==null?void 0:s.replace(/\//g,"-").toLowerCase())===e.replace(/\//g,"-").toLowerCase()||((u=g.path)==null?void 0:u.replace(/\//g,"-").toLowerCase())===`/${e}`.replace(/\//g,"-").toLowerCase()});return o?{slug:e,query:o==null?void 0:o.searchQuery,redirect:!0,collectionId:o==null?void 0:o.collectionId,filters:o==null?void 0:o.filters,sort:o==null?void 0:o.sort}:{slug:e,query:null,redirect:!1,collectionId:null,filters:null,sort:null}},jt=async({slug:e,...t})=>{var c,a,d;const{data:r}=await x.fetchContentType("redirect_to_search",t);if(!r||!Array.isArray(r))return null;const n=((d=(a=(c=r[0])==null?void 0:c.redirectToSearch)==null?void 0:a.redirectToSearch)==null?void 0:d.paths)??[];if(!!!n.length)return null;const o=n.find(g=>{var s,u;return((s=g.path)==null?void 0:s.replace(/\//g,"-").toLowerCase())===e.replace(/\//g,"-").toLowerCase()||((u=g.path)==null?void 0:u.replace(/\//g,"-").toLowerCase())===`/${e}`.replace(/\//g,"-").toLowerCase()});return o?{slug:e,title:o.pageTitle,description:o.pageDescription}:null},qt=async({slug:e,Politicas:t,SectionZone:r,oneTrust:n,...i})=>{const{data:o}=await x.fetchContentType("policy_page",i),{data:c}=await x.fetchContentType("policy_tab",i),a=Array.isArray(o)?o:null,d=Array.isArray(c)?c:null,g=a?a[0].sections:null;return!a||!d?null:S.jsxs(S.Fragment,{children:[S.jsx(t,{slug:e,pageData:a[0],tabsData:d,oneTrust:n}),g&&S.jsx(r,{data:g})]})},Nt=async({children:e,SectionZone:t,className:r,...n})=>{const{data:i}=await x.fetchContentType("search_page",n);return Array.isArray(i)&&i.length>0?S.jsx(x.SearchPageScreening,{data:i,SectionZone:t,className:r,children:e}):S.jsx(S.Fragment,{children:"children"})},$t=async({ClientTipbarContent:e,...t})=>{const{data:r}=await x.fetchContentType("tipbar",t);return S.jsx(e,{data:r})},Ft=async({children:e,SectionZone:t,WishlistScreening:r,...n})=>{const{data:i}=await x.fetchContentType("wishlist_page",n);return S.jsx(r,{data:Array.isArray(i)?i:[],SectionZone:t,children:e})},Lt={CommonPageContent:yt,CartContent:wt,FlagsAndTagsContent:xt,HeaderContent:Rt,TipbarContent:$t,FooterContent:_t,PLPContent:Et,PDPContent:Tt,getRedirectData:Ot,getPLPSynteticMetaData:jt,SearchPageContent:Nt,HelpButtonContent:It,LPCadastroContent:Ct,LPLojasContent:St,PolicyPageContent:qt,NotFoundContent:kt,WishlistContent:Ft},Dt={Components:Lt},Ut=l.object({country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:l.string().nullable()});async function Ht({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Ut.validate(t);const{country:n,postalCode:i}=t;return await x.fetchVtex(`${e}/api/checkout/pub/postal-code/${n}/${i}`,{method:"POST",body:t,...r})}const Mt=l.object({orderFormId:l.string().nullable(),sellerCode:l.string().nullable(),sellerName:l.string().nullable()});async function Le({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Mt.validate(t);const{orderFormId:n,sellerCode:i,sellerName:o}=t,c=i?`${i.trim()} - ${o}`:null;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/openTextField`,{method:"POST",body:{value:c},...r})}const Bt=l.object({orderFormId:l.string().nullable(),sellerCode:l.string().nullable(),marketingData:l.object()});async function De({apiUrl:e,body:t,extraData:r={},fetchOptions:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Bt.validate(t);const{orderFormId:i,sellerCode:o,marketingData:c}=t,a=o?{utmCampaign:o?o.toUpperCase():"",utmiCampaign:o?`${r.VENDOR_CODE}`:"semcodigo"}:{};return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${i}/attachments/marketingData`,{method:"POST",body:{...c,...a},...n})}const Vt=l.object({orderFormId:l.string().nullable(),sellerCode:l.string().nullable(),sellerName:l.string().nullable()});async function zt({apiUrl:e,body:t,fetchOptions:r,extraData:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Vt.validate(t);const i=await Le({apiUrl:e,body:t,fetchOptions:r});return De({apiUrl:e,body:{...t,marketingData:i==null?void 0:i.marketingData},extraData:n,fetchOptions:r})}const Gt=l.object({orderFormId:l.string().nullable(),coupon:l.string().nullable()});async function Wt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Gt.validate(t);const{coupon:n="",orderFormId:i}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${i}/coupons`,{method:"POST",body:{text:n},...r})}const Qt=l.object({appId:l.string().required("App ID is required"),orderFormId:l.string().nullable(),key:l.array().of(l.string())});async function Xt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Qt.validate(t);const{appId:n="faststore",orderFormId:i,key:o}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${i}/customData/${n}/${o}`,{method:"PUT",...r})}const Kt=l.object().shape({name:l.string().required("Attachment name is required"),content:l.object().nullable()});var $e;const Zt=l.object().shape({attachments:($e=l.array().of(Kt))==null?void 0:$e.nullable(),id:l.string().required("ID of SKU is required"),index:l.number().integer().nullable(),quantity:l.number().integer().nullable(),seller:l.string().required("Seller is required"),price:l.number().integer()}),Jt=l.object({orderFormId:l.string().required("OrderFormId is required"),orderItems:l.array().of(Zt)});async function Yt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Jt.validate(t);const{orderFormId:n,orderItems:i}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items`,{method:"POST",body:{orderItems:i},...r})}const er=l.object({orderFormId:l.string().nullable()});async function tr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await er.validate(t);const{orderFormId:n}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items/removeAll`,{method:"POST",...r})}const rr=l.object().shape({name:l.string().required("Attachment name is required"),content:l.object().nullable()});var Fe;const nr=l.object().shape({attachments:(Fe=l.array().of(rr))==null?void 0:Fe.nullable(),id:l.string().required("ID of SKU is required"),index:l.number().integer().nullable(),quantity:l.number().integer().nullable(),seller:l.string().required("Seller is required"),price:l.number().integer()}),ir=l.object({orderFormId:l.string().nullable(),orderItems:l.array().of(nr)});async function ar({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await ir.validate(t);const{orderFormId:n,orderItems:i}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items/update`,{method:"POST",body:{orderItems:i},...r})}const or=l.object({orderFormId:l.string().nullable()});async function sr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await or.validate(t);const{orderFormId:n}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/messages/clear`,{method:"POST",...r})}const cr=l.object({id:l.string().nullable(),itemIndex:l.number().nullable(),orderFormId:l.string().nullable(),remove:l.boolean().nullable()});async function lr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await cr.validate(t);const{itemIndex:n,orderFormId:i,id:o,remove:c}=t,a=c?`/${o}/remove`:"",d=`${e}/api/checkout/pub/orderForm/${i}/items/${n}/offerings${a}`;return x.fetchVtex(d,{method:"POST",body:{id:o},...r})}const ur=l.object({orderFormId:l.string().nullable()});async function dr({apiUrl:e,body:t,fetchOptions:r,extraData:n}){var c;if(!t){console.error("[ERROR FETCHING] Body is required");return}await ur.validate(t);const i=new URLSearchParams({refreshOutdatedData:"true"}),o=t.orderFormId&&((c=n.orderFormPurchaseId)==null?void 0:c.value)!==t.orderFormId?`${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(i)}`:`${e}/api/checkout/pub/orderForm`;return x.fetchVtex(o,{method:"GET",...r})}const pr=l.object({orderFormId:l.string().nullable(),email:l.string().email().required(),firstName:l.string().required(),lastName:l.string().required(),documentType:l.string().required(),document:l.string().required(),phone:l.string().matches(/^\+\d{1,3}\d{10,11}$/)});async function hr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await pr.validate(t);const{orderFormId:n,...i}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/clientProfileData`,{method:"POST",body:{...i},...r})}const fr=l.object({sellerCode:l.string().nullable()});async function mr({apiUrl:e,body:t,extraData:r,fetchOptions:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await fr.validate(t);const{sellerCode:i=""}=t;return x.fetchVtex(`${e}/api/dataentities/${r.ENTITIES}/search?_fields=${r.FIELDS}&${r.FILTER}=${i}`,{method:"GET",headers:{Accept:"application/vnd.vtex.ds.v10+json"},...n})}const gr=l.object().shape({country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),orderFormId:l.string().nullable(),postalCode:l.string().nullable()});async function br({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await gr.validate(t);const{country:n,orderFormId:i,postalCode:o}=t,c=o?{address:{addressType:"residential",postalCode:o,country:n}}:{logisticsInfo:[],clearAddressIfPostalCodeNotFound:!0};return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${i}/attachments/shippingData`,{method:"POST",body:c,...r})}const wr=l.object().shape({orderFormId:l.string().nullable(),options:l.array().of(l.object().shape({itemIndex:l.number(),selectedDeliveryChannel:l.string(),selectedSla:l.string()})),selectedAddresses:l.array().of(l.object().shape({addressId:l.string().required(),addressType:l.string().required(),city:l.string().nullable(),complement:l.string().nullable(),country:l.string().required().length(3),geoCoordinates:l.array().of(l.number()).required().min(0),isDisposable:l.boolean().required(),neighborhood:l.string().nullable(),number:l.string().nullable(),postalCode:l.string().required(),receiverName:l.string().nullable(),reference:l.string().nullable(),state:l.string().nullable(),street:l.string().nullable()}))});async function vr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await wr.validate(t);const{orderFormId:n,options:i,selectedAddresses:o}=t;return x.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/shippingData`,{method:"POST",body:{selectedAddresses:o,clearAddressIfPostalCodeNotFound:!1,logisticsInfo:i},...r})}const yr=l.object({country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:l.string().nullable(),geoCoordinates:l.object().shape({longitude:l.number().required(),latitude:l.number().required()})});async function xr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await yr.validate(t);const{country:n="",geoCoordinates:i,postalCode:o=""}=t,c=new URLSearchParams({country:String(n)});return o?c.append("postalCode",o):c.append("geoCoordinates",`${i==null?void 0:i.longitude};${i==null?void 0:i.latitude}`),await x.fetchVtex(`${e}/api/checkout/pub/regions/?${c.toString()}`,{method:"GET",...r})}const _r=l.object({id:l.string().required("ID of SKU is required"),quantity:l.number().integer().required("Quantity of item is required"),seller:l.string()}),Rr=l.object({items:l.array().of(_r),country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:l.string().nullable(),geoCoordinates:l.array().nullable().of(l.number()).length(2)});async function Pr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}return await Rr.validate(t),x.fetchVtex(`${e}/api/checkout/pub/orderForms/simulation`,{method:"POST",body:t,...r})}const Ir=Object.freeze(Object.defineProperty({__proto__:null,getMasterDataSellerCode:mr,getOrderForm:dr,postOrderFormAddCoupon:Wt,postOrderFormAttachClientProfileData:hr,postOrderFormAttachOrderFormData:zt,postOrderFormAttachShippingData:br,postOrderFormAttachmentsMarketingData:De,postOrderFormAttachmentsOpenTextField:Le,postOrderFormClearMessages:sr,postOrderFormFreightSimulation:Pr,postOrderFormItems:Yt,postOrderFormRegion:xr,postOrderFormRemoveAllItems:tr,postOrderFormUpdateItems:ar,postOrderFormUpdateShippingData:vr,postOrderformAddress:Ht,putOrderFormCustomData:Xt,updateOrderFormOffering:lr},Symbol.toStringTag,{value:"Module"})),Cr=l.object({skuId:l.string()});async function Sr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Cr.validate(t);const{skuId:n}=t;return x.fetchVtex(`${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${n}`,{...r})}const kr=l.object({ids:l.array().of(l.string().required("ID are required")).required("IDs are required")});async function Tr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await kr.validate(t);const{ids:n}=t;return x.fetchVtex(`${e}/api/catalog_system/pub/products/search?fq=${n.map(i=>`productId:${i}`).join("&fq=")}`,{...r})}const Ar=l.object({productId:l.number().required("Product ID is required")});async function Er({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Ar.validate(t);const{productId:n}=t;return x.fetchVtex(`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`,{...r})}async function Or({apiUrl:e,params:t,fetchOptions:r}){return t!=null&&t.slug?x.fetchVtex(`${e}/api/catalog_system/pub/portal/pagetype/${t.slug}`,{...r}):(console.error("[ERROR FETCHING] slug is required"),null)}const jr=Object.freeze(Object.defineProperty({__proto__:null,getCatalogKitProducts:Sr,getCatalogPageInfo:Or,getCatalogProducts:Tr,getCatalogSimilars:Er},Symbol.toStringTag,{value:"Module"})),qr=l.object({query:l.string()});async function Nr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await qr.validate(t);const{query:n=""}=t,i=new URLSearchParams({query:n});return x.fetchVtex(`${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${i.toString()}`,{...r})}const $r=(e,t)=>mt(e,t),Fr=e=>({...e,description:e.description?$r(e.description):e.description}),Lr=({offer:e,seller:t,product:r})=>({...e,product:r,seller:t}),Ue=(e,t)=>({...e,isVariantOf:Fr(t)}),Dr=e=>e?"https://schema.org/InStock":"https://schema.org/OutOfStock",ie=e=>e.AvailableQuantity>0,je=e=>e.spotPrice??0,Ur=e=>e.Price??0,He=(e,t)=>ie(e)&&!ie(t)?-1:!ie(e)&&ie(t)?1:je(e)-je(t),Hr=(e,t)=>{let r=0;for(let n=1;n<e.length;n++)t(e[r],e[n])>0&&(r=n);return e[r]},Me=e=>{const t=e.flatMap(n=>n.sellers.map(i=>({offer:i.commertialOffer,sku:n}))),r=Hr(t,({offer:n},{offer:i})=>He(n,i));return r?r.sku:e[0]},Be=e=>e.map(({imageUrl:t,imageText:r,imageLabel:n})=>({alternateName:r??"",url:t.replace("vteximg.com.br","vtexassets.com"),keywords:n})),ae={attachment:"ATTACHMENT",specification:"SPECIFICATION",attribute:"ATTRIBUTE"},Mr=e=>({name:e.name,value:e.content,valueReference:ae.attachment}),Br=e=>({propertyID:e.id,name:e.name,value:e.value,valueReference:{valueReference:ae.attribute,visible:e.visible}}),oe=(e,t,r)=>{const n=e.flatMap(({name:c,values:a})=>a?a.map(d=>({name:c,value:d,valueReference:ae.specification})):{name:c,value:"",valueReference:ae.specification}),i=Array.isArray(r)?r.map(Mr):[],o=t?t.map(Br):[];return[...n,...i,...o]},qe="ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",Vr="AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa",zr=e=>{let t=e.slice(0);for(let r=0;r<qe.length;r++)t=t.replace(new RegExp(qe.charAt(r),"g"),Vr.charAt(r));return t},Gr=e=>e.replace(/[·/_,:]/,"-"),Ve=e=>{const r=e.replace(/,/g,"").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g,"-");return Gr(zr(r)).toLowerCase()},ze=e=>`/${e}/p`,Ge=e=>{const t=Math.max(...e.map(n=>n.NumberOfInstallments)),r=e.find(n=>n.NumberOfInstallments===t);return{count:(r==null?void 0:r.NumberOfInstallments)??0,value:(r==null?void 0:r.Value)??0}},We=(e,t)=>{const r={price:0,listPrice:0,sellerDefault:!1},i=e.map(o=>Lr({offer:o.commertialOffer,seller:o,product:t})).sort(He).map(o=>(o.seller.sellerId==="1"&&o.AvailableQuantity>0&&(r.price=o.Price,r.listPrice=o.ListPrice,r.sellerDefault=!0),{availability:o.AvailableQuantity>0,listPrice:o.ListPrice,price:Ur(o),priceValidUntil:o.PriceValidUntil,priceCurrency:"BRL",installments:o.Installments,lowPrice:o.spotPrice,quantity:o.AvailableQuantity,seller:{identifier:o.seller.sellerId}}));return{lowPrice:r.sellerDefault?r.price:i[0].price,highPrice:r.sellerDefault?r.listPrice:i[0].listPrice,offers:i}},Qe=e=>{const{attributes:t,itemId:r,name:n,sellers:i,variations:o}=e;return{additionalProperty:oe(o,t,[]),name:n,offers:{offers:i==null?void 0:i.map(({sellerId:c,commertialOffer:a})=>({availability:Dr(a.AvailableQuantity>0),listPrice:a.ListPrice,price:a.Price,quantity:a.AvailableQuantity,seller:{identifier:c}}))},sku:r}},Wr=e=>{var R;const{attributes:t,referenceId:r,isVariantOf:n,images:i,itemId:o,name:c,sellers:a,videos:d,variations:g}=e,{brand:s,categories:u,categoriesIds:w,description:v,linkText:y,productClusters:_,clusterHighlights:p,productName:b,properties:h,productId:f,productReference:m}=n,E=u.slice().reverse(),q=We(a,e.isVariantOf),P=Ge(q.offers[0].installments);return{sku:o,gtin:((R=r==null?void 0:r[0])==null?void 0:R.Value)??m??"",name:b??c,description:v,releaseDate:n.releaseDate??"",slug:y,video:d[0],categories:u,categoriesIds:w,id:f,brand:{name:s,brandName:s},seo:{description:v,title:b,canonical:ze(y)},cluster:{generals:_,highlights:p},properties:h,availability:{status:q.offers[0].availability},breadcrumbList:{itemListElement:[...E.map((T,N)=>{const $=T.split("/"),L=$[$.length-2],D=$.map(Ve).join("/");return{name:L,item:D,position:N+1}}),{name:n.productName,item:y,position:u.length+1}],numberOfItems:u.length},image:Be(i),offers:q,additionalProperty:oe(g,t,[]),isVariantOf:{productGroupID:n.productId,hasVariant:n.items.map(T=>Qe(T))},installments:P}},Qr=e=>{var P;const{attributes:t,referenceId:r,isVariantOf:n,images:i,itemId:o,name:c,sellers:a,Videos:d,variations:g}=e,{brand:s,categories:u,categoriesIds:w,description:v,linkText:y,productClusters:_,productName:p,Coleção:b,"ID Coleção":h,productId:f}=n,m=u.slice().reverse(),E=We(a,e.isVariantOf),q=Ge(E.offers[0].installments);return{sku:o,gtin:((P=r[0])==null?void 0:P.Value)??"",name:p??c,description:v,releaseDate:n.releaseDate??"",slug:y,video:d[0],categories:u,categoriesIds:w,collection:b,collectionId:h,id:f,brand:{name:s,brandName:s},seo:{description:v,title:p,canonical:ze(y)},cluster:{generals:_,highlights:[]},availability:{status:E.offers[0].availability},breadcrumbList:{itemListElement:[...m.map((R,T)=>{const N=R.split("/"),$=N[N.length-2],L=N.map(Ve).join("/");return{name:$,item:L,position:T+1}}),{name:n.productName,item:y,position:u.length+1}],numberOfItems:u.length},image:Be(i),offers:E,additionalProperty:oe(g,t,[]),isVariantOf:{productGroupID:n.productId,hasVariant:n.items.map(R=>{const{variations:T}=R,N=T.map($=>({name:$,values:R[$]}));return{...Qe(R),additionalProperty:oe(N,t,[])}})},installments:q}},Xr=l.array().of(l.object({key:l.string().required(),value:l.string().required()})).required("Facets are required");async function Kr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Xr.validate(t);const n=new URLSearchParams({}),i=t.map(({key:c,value:a})=>`${c}/${a}`).join("/");x.addSearchParamsFacets(t,n);const o=`${e}/api/catalog_system/pub/products/crossselling/${i}`;return x.fetchVtex(o,{cache:"no-store",...r}).then(c=>c.map(d=>{const g=Me(d.items);return g&&Ue(g,d)}).filter(d=>!!d).map(d=>({node:Qr(d)})))}const Xe=({apiUrl:e,body:t,fetchOptions:r,extraData:n})=>{if(!t){console.error("[ERROR FETCHING] Body is required");return}const{query:i="",page:o=1,count:c,sort:a="",facets:d=[],type:g,hideUnavailableItems:s=!0,locale:u=""}=t,w=new URLSearchParams({page:o.toString(),count:(c==null?void 0:c.toString())??(n==null?void 0:n.ITEMS_PER_PAGE)??24,query:i,sort:a,locale:u});s!==void 0&&w.append("hideUnavailableItems",s.toString());const v=d.map(y=>`${y.key}/${y.value}`).join("/")??"";return x.fetchVtexWithAbortController(`${e}/api/io/_v/api/intelligent-search/${g}/${v}?${w.toString()}`,{headers:{Accept:"application/json","content-type":"application/json"},...r})};async function Zr({body:e,extraData:t,...r}){if(!e){console.error("[ERROR FETCHING] Body is required");return}const n=await Xe({body:{...e,type:"product_search"},extraData:t,...r}),i=(n==null?void 0:n.products.map(a=>{const d=Me(a.items);return d&&Ue(d,a)}).filter(a=>!!a))??[],{pagination:o,recordsFiltered:c}=n;return{data:{pagination:{nextPage:o.after.length>0,previousPage:o.before.length>0,startCursor:"0",endCursor:c.toString(),count:c,total:o.count},products:i.map((a,d)=>({node:Wr(a),cursor:d.toString()}))}}}async function Jr({body:e,extraData:t,...r}){if(!e){console.error("[ERROR FETCHING] Body is required");return}const n=await Xe({body:{...e,type:"facets"},extraData:t,...r});return!n||!n.facets?(console.error("[ERROR FETCHING] No facets found"),{data:{facets:[]}}):{data:{...n,facets:x.formattedFacets(n,e==null?void 0:e.selectedFacets,(e==null?void 0:e.query)??"")}}}const Yr=l.object({query:l.string().optional(),locale:l.string().optional()});async function en({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Yr.validate(t);const{query:n="",locale:i="default_locale"}=t,o=new URLSearchParams({query:n,locale:i});return x.fetchVtex(`${e}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,{...r})}async function tn({apiUrl:e}){return x.fetchVtex(`${e}/api/io/_v/api/intelligent-search/top_searches`)}const rn=Object.freeze(Object.defineProperty({__proto__:null,getSearchAutoCompleteSuggestions:Nr,getSearchCrossellingProducts:Kr,getSearchFacets:Jr,getSearchProducts:Zr,getSearchSuggestedTerms:en,getSearchTopSearchs:tn},Symbol.toStringTag,{value:"Module"})),nn=l.object({masterDataEntity:l.string().nonNullable(),payload:l.object().shape({}).nullable()});async function an({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await nn.validate(t);const{masterDataEntity:n,payload:i}=t,o=`${e}/api/dataentities/${n}/documents`;return x.fetchVtex(o,{method:"POST",body:{payload:i},...r})}const on=l.object().shape({_where:l.string().optional(),_fields:l.string().optional(),_sort:l.string().optional(),_from:l.number().integer().min(0).optional(),_to:l.number().integer().min(0).optional(),_keyword:l.string().optional()}),sn=l.object({masterDataEntity:l.string().required(),searchFields:on,headers:l.object().shape({"REST-Range":l.string().notRequired()})});async function cn({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}const n=new URLSearchParams;await sn.validate(t);const{masterDataEntity:i,searchFields:o,headers:c}=t;o&&Object.entries(o).forEach(([g,s])=>{n.append(g,String(s))}),"_fields"in o||n==null||n.append("_fields","_all");let a=[],d=null;do{d&&n.set("_scroll",d);const g=await fetch(`${e}/api/dataentities/${i}/search?${n.toString()}`,{method:"GET",headers:{"REST-Range":(c==null?void 0:c["REST-Range"])??"resources=0-100",...r==null?void 0:r.headers},cache:"no-store"});if(!g.ok)throw new Error(`[MasterData] ${g.status} - ${g.statusText}`);const s=await g.json();a.push(...s),d=g.headers.get("x-vtex-md-scroll")}while(d);return a}const ln=l.object({dataEntityName:l.string().required(),id:l.string().required(),fieldsToBeUpdated:l.object().shape({})});async function un({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await ln.validate(t);const{dataEntityName:n,id:i,fieldsToBeUpdated:o}=t,c=`${e}/api/dataentities/${n}/documents/${i}`;return x.fetchVtex(c,{body:{fieldsToBeUpdated:o},method:"PATCH",...r})}const dn=Object.freeze(Object.defineProperty({__proto__:null,getSearchMasterdata:cn,patchUpdateMasterdata:un,postMasterdata:an},Symbol.toStringTag,{value:"Module"}));async function pn({body:e,apiUrl:t,extraData:r,fetchOptions:n}){const{productIds:i}=e;if(!i)return console.error("[ERROR FETCHING] productIds is required"),[];const{NAME_SPLIT_SYMBOL:o}=r;if(!o)return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"),[];const c=i.map(s=>typeof s=="string"||typeof s=="number"?`productId:${s}`:"").join("&fq="),a=await x.fetchVtex(`${t}/api/catalog_system/pub/products/search?fq=${c}`,{...n}),d=s=>Object.keys(s).map(u=>({id:u,name:s[u]}));return a.map((s,u)=>{var f;const{installments:w,price:v,listPrice:y,sizes:_,allSizesAvailable:p}=x.getSkuInfos({items:s.items,NAME_SPLIT_SYMBOL:o}),b=p?!0:_.some(m=>m.available),h=s.items[0].sellers[0].commertialOffer;return{node:{sku:s.items[0].itemId,gtin:s.productReference,name:s.productName,description:s.description,releaseDate:s.releaseDate,slug:s.linkText,categories:s.categories,categoriesIds:s.categoriesIds,id:s.items[0].itemId,brand:{name:s.brand,brandName:s.brand},seo:{description:s.description,title:s.productName,canonical:`/${s.linkText}/p`},cluster:{generals:d(s.productClusters),highlights:d(s.clusterHighlights)},availability:{status:b},image:s.items[0].images.map(({imageLabel:m,imageUrl:E})=>({alternateName:m,url:E,keywords:m})),offers:{lowPrice:v,highPrice:y,offers:[{availability:b,listPrice:y,price:v,priceValidUntil:h.PriceValidUntil,priceCurrency:"BRL",installments:h.Installments,lowPrice:v,quantity:h.AvailableQuantity,seller:{identifier:s.items[0].sellers[0].sellerId}}]},additionalProperty:(f=s==null?void 0:s.skuSpecifications)==null?void 0:f.map(m=>({name:s==null?void 0:s.skuSpecifications[0].field.name,value:m,valueReference:"SPECIFICATION"})),isVariantOf:{productGroupID:s.productId,hasVariant:s.items.map(m=>{var E;return{additionalProperty:m==null?void 0:m.variations.map(()=>{var q,P,R;return{name:(q=m==null?void 0:m.variations)==null?void 0:q[0],value:(R=m==null?void 0:m[(P=m==null?void 0:m.variations)==null?void 0:P[0]])==null?void 0:R[0],valueReference:"SPECIFICATION"}}),name:m.name,offers:{offers:(E=m.sellers)==null?void 0:E.map(({commertialOffer:q,sellerId:P})=>({availability:"https://schema.org/InStock",listPrice:q.ListPrice,price:q.Price,quantity:q.AvailableQuantity,seller:{identifier:P}}))},sku:m.itemId,slug:`-${m.itemId}`}})},installments:w},cursor:u.toString()}})}const hn=Object.freeze(Object.defineProperty({__proto__:null,getWishlistProducts:pn},Symbol.toStringTag,{value:"Module"}));var ge={exports:{}},Ke={},we={},Ze={},Je={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathSuffix",{enumerable:!0,get:function(){return r}});const t=x.parsePath;function r(n,i){if(!n.startsWith("/")||!i)return n;const{pathname:o,query:c,hash:a}=(0,t.parsePath)(n);return""+o+i+c+a}})(Je);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"formatNextPathnameInfo",{enumerable:!0,get:function(){return o}});const t=x.removeTrailingSlash,r=x.addPathPrefix,n=Je,i=x.addLocale;function o(c){let a=(0,i.addLocale)(c.pathname,c.locale,c.buildId?void 0:c.defaultLocale,c.ignorePrefix);return(c.buildId||!c.trailingSlash)&&(a=(0,t.removeTrailingSlash)(a)),c.buildId&&(a=(0,n.addPathSuffix)((0,r.addPathPrefix)(a,"/_next/data/"+c.buildId),c.pathname==="/"?"index.json":".json")),a=(0,r.addPathPrefix)(a,c.basePath),!c.buildId&&c.trailingSlash?a.endsWith("/")?a:(0,n.addPathSuffix)(a,"/"):(0,t.removeTrailingSlash)(a)}})(Ze);var Ye={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getHostname",{enumerable:!0,get:function(){return t}});function t(r,n){let i;if(n!=null&&n.host&&!Array.isArray(n.host))i=n.host.toString().split(":",1)[0];else if(r.hostname)i=r.hostname;else return;return i.toLowerCase()}})(Ye);var et={},tt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removePathPrefix",{enumerable:!0,get:function(){return r}});const t=x.pathHasPrefix;function r(n,i){if(!(0,t.pathHasPrefix)(n,i))return n;const o=n.slice(i.length);return o.startsWith("/")?o:"/"+o}})(tt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getNextPathnameInfo",{enumerable:!0,get:function(){return i}});const t=x.normalizeLocalePath,r=tt,n=x.pathHasPrefix;function i(o,c){var a;const{basePath:d,i18n:g,trailingSlash:s}=(a=c.nextConfig)!=null?a:{},u={pathname:o,trailingSlash:o!=="/"?o.endsWith("/"):s};d&&(0,n.pathHasPrefix)(u.pathname,d)&&(u.pathname=(0,r.removePathPrefix)(u.pathname,d),u.basePath=d);let w=u.pathname;if(u.pathname.startsWith("/_next/data/")&&u.pathname.endsWith(".json")){const y=u.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),_=y[0];u.buildId=_,w=y[1]!=="index"?"/"+y.slice(1).join("/"):"/",c.parseData===!0&&(u.pathname=w)}if(g){let y=c.i18nProvider?c.i18nProvider.analyze(u.pathname):(0,t.normalizeLocalePath)(u.pathname,g.locales);u.locale=y.detectedLocale;var v;u.pathname=(v=y.pathname)!=null?v:u.pathname,!y.detectedLocale&&u.buildId&&(y=c.i18nProvider?c.i18nProvider.analyze(w):(0,t.normalizeLocalePath)(w,g.locales),y.detectedLocale&&(u.locale=y.detectedLocale))}return u}})(et);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextURL",{enumerable:!0,get:function(){return d}});const t=x.detectDomainLocale,r=Ze,n=Ye,i=et,o=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function c(g,s){return new URL(String(g).replace(o,"localhost"),s&&String(s).replace(o,"localhost"))}const a=Symbol("NextURLInternal");class d{constructor(s,u,w){let v,y;typeof u=="object"&&"pathname"in u||typeof u=="string"?(v=u,y=w||{}):y=w||u||{},this[a]={url:c(s,v??y.base),options:y,basePath:""},this.analyze()}analyze(){var s,u,w,v,y;const _=(0,i.getNextPathnameInfo)(this[a].url.pathname,{nextConfig:this[a].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[a].options.i18nProvider}),p=(0,n.getHostname)(this[a].url,this[a].options.headers);this[a].domainLocale=this[a].options.i18nProvider?this[a].options.i18nProvider.detectDomainLocale(p):(0,t.detectDomainLocale)((u=this[a].options.nextConfig)==null||(s=u.i18n)==null?void 0:s.domains,p);const b=((w=this[a].domainLocale)==null?void 0:w.defaultLocale)||((y=this[a].options.nextConfig)==null||(v=y.i18n)==null?void 0:v.defaultLocale);this[a].url.pathname=_.pathname,this[a].defaultLocale=b,this[a].basePath=_.basePath??"",this[a].buildId=_.buildId,this[a].locale=_.locale??b,this[a].trailingSlash=_.trailingSlash}formatPathname(){return(0,r.formatNextPathnameInfo)({basePath:this[a].basePath,buildId:this[a].buildId,defaultLocale:this[a].options.forceLocale?void 0:this[a].defaultLocale,locale:this[a].locale,pathname:this[a].url.pathname,trailingSlash:this[a].trailingSlash})}formatSearch(){return this[a].url.search}get buildId(){return this[a].buildId}set buildId(s){this[a].buildId=s}get locale(){return this[a].locale??""}set locale(s){var u,w;if(!this[a].locale||!(!((w=this[a].options.nextConfig)==null||(u=w.i18n)==null)&&u.locales.includes(s)))throw new TypeError(`The NextURL configuration includes no locale "${s}"`);this[a].locale=s}get defaultLocale(){return this[a].defaultLocale}get domainLocale(){return this[a].domainLocale}get searchParams(){return this[a].url.searchParams}get host(){return this[a].url.host}set host(s){this[a].url.host=s}get hostname(){return this[a].url.hostname}set hostname(s){this[a].url.hostname=s}get port(){return this[a].url.port}set port(s){this[a].url.port=s}get protocol(){return this[a].url.protocol}set protocol(s){this[a].url.protocol=s}get href(){const s=this.formatPathname(),u=this.formatSearch();return`${this.protocol}//${this.host}${s}${u}${this.hash}`}set href(s){this[a].url=c(s),this.analyze()}get origin(){return this[a].url.origin}get pathname(){return this[a].url.pathname}set pathname(s){this[a].url.pathname=s}get hash(){return this[a].url.hash}set hash(s){this[a].url.hash=s}get search(){return this[a].url.search}set search(s){this[a].url.search=s}get password(){return this[a].url.password}set password(s){this[a].url.password=s}get username(){return this[a].url.username}set username(s){this[a].url.username=s}get basePath(){return this[a].basePath}set basePath(s){this[a].basePath=s.startsWith("/")?s:`/${s}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new d(String(this),this[a].options)}}})(we);var ve={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,g){for(var s in g)Object.defineProperty(d,s,{enumerable:!0,get:g[s]})}t(e,{fromNodeOutgoingHttpHeaders:function(){return n},normalizeNextQueryParam:function(){return a},splitCookiesString:function(){return i},toNodeOutgoingHttpHeaders:function(){return o},validateURL:function(){return c}});const r=x.constants;function n(d){const g=new Headers;for(let[s,u]of Object.entries(d)){const w=Array.isArray(u)?u:[u];for(let v of w)typeof v>"u"||(typeof v=="number"&&(v=v.toString()),g.append(s,v))}return g}function i(d){var g=[],s=0,u,w,v,y,_;function p(){for(;s<d.length&&/\s/.test(d.charAt(s));)s+=1;return s<d.length}function b(){return w=d.charAt(s),w!=="="&&w!==";"&&w!==","}for(;s<d.length;){for(u=s,_=!1;p();)if(w=d.charAt(s),w===","){for(v=s,s+=1,p(),y=s;s<d.length&&b();)s+=1;s<d.length&&d.charAt(s)==="="?(_=!0,s=y,g.push(d.substring(u,v)),u=s):s=v+1}else s+=1;(!_||s>=d.length)&&g.push(d.substring(u,d.length))}return g}function o(d){const g={},s=[];if(d)for(const[u,w]of d.entries())u.toLowerCase()==="set-cookie"?(s.push(...i(w)),g[u]=s.length===1?s[0]:s):g[u]=w;return g}function c(d){try{return String(new URL(String(d)))}catch(g){throw new Error(`URL is malformed "${String(d)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:g})}}function a(d,g){const s=[r.NEXT_QUERY_PARAM_PREFIX,r.NEXT_INTERCEPTION_MARKER_PREFIX];for(const u of s)if(d!==u&&d.startsWith(u)){const w=d.substring(u.length);g(w)}}})(ve);var rt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(o,c){for(var a in c)Object.defineProperty(o,a,{enumerable:!0,get:c[a]})}t(e,{PageSignatureError:function(){return r},RemovedPageError:function(){return n},RemovedUAError:function(){return i}});class r extends Error{constructor({page:c}){super(`The middleware "${c}" accepts an async API directly with the form:
|
|
2
2
|
|
|
3
3
|
export function middleware(request, event) {
|
|
4
4
|
return NextResponse.redirect('/new-location')
|
package/index2.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as O, jsxs as pe, Fragment as W } from "react/jsx-runtime";
|
|
2
|
-
import { G as $, z as oe, S as yt, H as T, I as _t, J as Rt, K as It, a as Pt, j as xt, m as St, r as Ct, q as kt, k as Be, n as At, o as Et, l as Ot, D as Tt, C as qt, L as Nt, p as jt, M as $t, N as Ft, O as Lt, P as Dt, e as Ut, Q as Ht } from "./index-
|
|
2
|
+
import { G as $, z as oe, S as yt, H as T, I as _t, J as Rt, K as It, a as Pt, j as xt, m as St, r as Ct, q as kt, k as Be, n as At, o as Et, l as Ot, D as Tt, C as qt, L as Nt, p as jt, M as $t, N as Ft, O as Lt, P as Dt, e as Ut, Q as Ht } from "./index-CrmS0qoM.mjs";
|
|
3
3
|
import { Utils as se, helpers as le } from "@soma-vertical-web/core-components";
|
|
4
4
|
import * as c from "yup";
|
|
5
5
|
import Mt from "sanitize-html";
|
|
@@ -1412,11 +1412,17 @@ const ln = (e, t) => Mt(e, t), cn = (e) => ({
|
|
|
1412
1412
|
},
|
|
1413
1413
|
installments: N
|
|
1414
1414
|
};
|
|
1415
|
-
}, _n = c.array().of(
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1415
|
+
}, _n = c.array().of(
|
|
1416
|
+
c.object({
|
|
1417
|
+
key: c.string().required(),
|
|
1418
|
+
value: c.string().required()
|
|
1419
|
+
})
|
|
1420
|
+
).required("Facets are required");
|
|
1421
|
+
async function Rn({
|
|
1422
|
+
apiUrl: e,
|
|
1423
|
+
body: t,
|
|
1424
|
+
fetchOptions: r
|
|
1425
|
+
}) {
|
|
1420
1426
|
if (!t) {
|
|
1421
1427
|
console.error("[ERROR FETCHING] Body is required");
|
|
1422
1428
|
return;
|
package/layout/index.d.ts
CHANGED
|
@@ -218,11 +218,11 @@ export declare const layout: {
|
|
|
218
218
|
template: {
|
|
219
219
|
minicart: {
|
|
220
220
|
Body: {
|
|
221
|
-
({ children, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, PLP_NOT_RESULT, TEXTURE_IMAGE, TIPBAR_CONFIGS, TOGGLE_STYLE_MODIFIER }: import('../types/layout/templates/MiniCart').ModalBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
221
|
+
({ children, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, PLP_NOT_RESULT, TEXTURE_IMAGE, TIPBAR_CONFIGS, TOGGLE_STYLE_MODIFIER, storeId }: import('../types/layout/templates/MiniCart').ModalBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
222
222
|
displayName: string;
|
|
223
223
|
};
|
|
224
224
|
Card: {
|
|
225
|
-
({ available, index, product, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, }: import('../types/layout/templates/MiniCart').CardProps): import("react/jsx-runtime").JSX.Element;
|
|
225
|
+
({ available, index, product, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, storeId, }: import('../types/layout/templates/MiniCart').CardProps): import("react/jsx-runtime").JSX.Element;
|
|
226
226
|
displayName: string;
|
|
227
227
|
};
|
|
228
228
|
Cashback: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const AddToCart: {
|
|
2
2
|
Card: {
|
|
3
|
-
({ className, item, texture, thumbnail, ...props }: import('../../../types/layout/team-components/AddToCart').CardProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ className, item, texture, thumbnail, storeId, ...props }: import('../../../types/layout/team-components/AddToCart').CardProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
Content: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CardProps } from '../../../../../types/layout/team-components/AddToCart';
|
|
2
2
|
|
|
3
3
|
declare const Card: {
|
|
4
|
-
({ className, item, texture, thumbnail, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ className, item, texture, thumbnail, storeId, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Card;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CardContentProps } from '../../../../../types/layout/team-components/AddToCart';
|
|
2
2
|
|
|
3
3
|
declare const Content: {
|
|
4
|
-
({ className, item, texture, ...props }: CardContentProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ className, item, texture, storeId, ...props }: CardContentProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Content;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StyleSizeProps } from '../../../../../types/layout/team-components/AddToCart';
|
|
2
2
|
|
|
3
3
|
declare const StyleSize: {
|
|
4
|
-
({ className, productGroupID, size, texture, ...props }: StyleSizeProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ className, productGroupID, size, texture, storeId, ...props }: StyleSizeProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default StyleSize;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CardProps } from '../../../../../types/layout/templates/MiniCart/index';
|
|
2
2
|
|
|
3
3
|
declare const Card: {
|
|
4
|
-
({ available, index, product, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ available, index, product, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, storeId, }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Card;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SkuCardProps } from '../../../../../../types/layout/templates/MiniCart';
|
|
2
2
|
|
|
3
3
|
declare const Sku: {
|
|
4
|
-
({ product, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, }: SkuCardProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ product, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, storeId, }: SkuCardProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Sku;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StyleCardProps } from '../../../../../../types/layout/templates/MiniCart';
|
|
2
2
|
|
|
3
3
|
declare const Style: {
|
|
4
|
-
({ product, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, }: StyleCardProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ product, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, storeId, }: StyleCardProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Style;
|
|
@@ -30,7 +30,7 @@ declare const Card: {
|
|
|
30
30
|
displayName: string;
|
|
31
31
|
};
|
|
32
32
|
Sku: {
|
|
33
|
-
({ product, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, }: import('../../../../../types/layout/templates/MiniCart').SkuCardProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
({ product, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, storeId, }: import('../../../../../types/layout/templates/MiniCart').SkuCardProps): import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
displayName: string;
|
|
35
35
|
};
|
|
36
36
|
Stepper: {
|
|
@@ -38,7 +38,7 @@ declare const Card: {
|
|
|
38
38
|
displayName: string;
|
|
39
39
|
};
|
|
40
40
|
Style: {
|
|
41
|
-
({ product, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, }: import('../../../../../types/layout/templates/MiniCart').StyleCardProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
({ product, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, storeId, }: import('../../../../../types/layout/templates/MiniCart').StyleCardProps): import("react/jsx-runtime").JSX.Element;
|
|
42
42
|
displayName: string;
|
|
43
43
|
};
|
|
44
44
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModalBodyProps } from '../../../../../../types/layout/templates/MiniCart';
|
|
2
2
|
|
|
3
3
|
declare const Body: {
|
|
4
|
-
({ children, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, PLP_NOT_RESULT, TEXTURE_IMAGE, TIPBAR_CONFIGS, TOGGLE_STYLE_MODIFIER }: ModalBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ children, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, PLP_NOT_RESULT, TEXTURE_IMAGE, TIPBAR_CONFIGS, TOGGLE_STYLE_MODIFIER, storeId }: ModalBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Body;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare const MiniCart: {
|
|
2
2
|
Body: {
|
|
3
|
-
({ children, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, PLP_NOT_RESULT, TEXTURE_IMAGE, TIPBAR_CONFIGS, TOGGLE_STYLE_MODIFIER }: import('../../../types/layout/templates/MiniCart').ModalBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ children, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, PLP_NOT_RESULT, TEXTURE_IMAGE, TIPBAR_CONFIGS, TOGGLE_STYLE_MODIFIER, storeId }: import('../../../types/layout/templates/MiniCart').ModalBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
Card: {
|
|
7
|
-
({ available, index, product, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, }: import('../../../types/layout/templates/MiniCart').CardProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
({ available, index, product, ICONS, MINICART_CONFIG, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER, storeId, }: import('../../../types/layout/templates/MiniCart').CardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
displayName: string;
|
|
9
9
|
};
|
|
10
10
|
Cashback: {
|
package/package.json
CHANGED
|
@@ -28,14 +28,14 @@ export type PositionsGrid = {
|
|
|
28
28
|
};
|
|
29
29
|
export type DataLayerEvent = (data: ProductSearchResultPage) => void;
|
|
30
30
|
export interface PageState {
|
|
31
|
-
addPage: (state: State, positions: PositionsGrid, callback?: DataLayerEvent, itemsPerPage?: number) => void;
|
|
31
|
+
addPage: (state: State, positions: PositionsGrid, callback?: DataLayerEvent, itemsPerPage?: number, storeId?: StoreConfigType['api']['storeId']) => void;
|
|
32
32
|
banners: number[];
|
|
33
|
-
createPages: (state: State, positions: PositionsGrid, callback?: DataLayerEvent, itemsPerPage?: number) => void;
|
|
33
|
+
createPages: (state: State, positions: PositionsGrid, callback?: DataLayerEvent, itemsPerPage?: number, storeId?: StoreConfigType['api']['storeId']) => void;
|
|
34
34
|
load: boolean;
|
|
35
35
|
pages: Page[];
|
|
36
36
|
products: number[];
|
|
37
37
|
total: number;
|
|
38
|
-
updateProducts: (state: State, callback?: DataLayerEvent) => void;
|
|
38
|
+
updateProducts: (state: State, callback?: DataLayerEvent, storeId?: StoreConfigType['api']['storeId']) => void;
|
|
39
39
|
}
|
|
40
40
|
export interface PLPInfiniteContextProps extends PropsWithChildren<Omit<PageState, 'init'>> {
|
|
41
41
|
addNewPage(page: Page): void;
|
|
@@ -2,7 +2,7 @@ import { Dispatch, PropsWithChildren, SetStateAction } from 'react';
|
|
|
2
2
|
import { ProductSearchResultPage } from '../../data/api/search/product';
|
|
3
3
|
import { State, Suggestion } from '../../data/api/search';
|
|
4
4
|
import { Facet, SelectedFacet } from '../../data/api/search/facets';
|
|
5
|
-
import { ITEMS_DEFAULT_SORTType, ITEMS_PER_PAGEType, ITEMS_PER_SECTIONType, PLP_FILTERS_SORT_OPTIONtype, SEARCH_PAGE_ITEM_THRESHOLDType, SEARCH_RESULTType, VARIANT_PAGINATIONType } from '../../constants';
|
|
5
|
+
import { ITEMS_DEFAULT_SORTType, ITEMS_PER_PAGEType, ITEMS_PER_SECTIONType, PLP_FILTERS_SORT_OPTIONtype, SEARCH_PAGE_ITEM_THRESHOLDType, SEARCH_RESULTType, StoreConfigType, VARIANT_PAGINATIONType } from '../../constants';
|
|
6
6
|
import { BreadCrumbItemLinkProps } from '../../layout/team-components/PLPNavigation';
|
|
7
7
|
import { ProductsProps } from '../../layout/templates/PLP';
|
|
8
8
|
|
|
@@ -17,8 +17,9 @@ export interface FacetsContextProps {
|
|
|
17
17
|
}
|
|
18
18
|
export interface FacetsProviderProps extends PropsWithChildren {
|
|
19
19
|
forceUpdate?: boolean;
|
|
20
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
20
21
|
}
|
|
21
|
-
export interface FacetsProviderContentProps extends Omit<FacetsProviderProps, 'forceUpdate'> {
|
|
22
|
+
export interface FacetsProviderContentProps extends Omit<FacetsProviderProps, 'forceUpdate' | 'storeId'> {
|
|
22
23
|
selectedFacets: SelectedFacet[];
|
|
23
24
|
}
|
|
24
25
|
export interface ProductsContextProps extends ProductSearchResultPage {
|
|
@@ -32,10 +33,12 @@ export interface SuggestedTermsContextProps {
|
|
|
32
33
|
}
|
|
33
34
|
export interface SuggestedTermsProviderProps extends PropsWithChildren {
|
|
34
35
|
term?: string;
|
|
36
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
35
37
|
}
|
|
36
38
|
export interface ProductsProviderProps extends PropsWithChildren {
|
|
37
39
|
query?: string;
|
|
38
40
|
forceUpdate?: boolean;
|
|
41
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
39
42
|
}
|
|
40
43
|
export interface SearchContextProps extends Pick<SearchProviderProps, 'sort' | 'searchParams'> {
|
|
41
44
|
count: number;
|
|
@@ -59,6 +62,9 @@ export interface TopSearchesContextProps {
|
|
|
59
62
|
isLoading: boolean;
|
|
60
63
|
error: string | null;
|
|
61
64
|
}
|
|
65
|
+
export interface TopSearchesProviderProps extends PropsWithChildren {
|
|
66
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
67
|
+
}
|
|
62
68
|
export type DataParams = FacetsContextProps | ProductSearchResultPage | SuggestedTermsContextProps;
|
|
63
69
|
export interface RootContextProps {
|
|
64
70
|
data: DataParams | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PLP_GRID_SCROLL_BACKType } from '../../constants';
|
|
1
|
+
import { PLP_GRID_SCROLL_BACKType, StoreConfigType } from '../../constants';
|
|
2
2
|
import { Page } from '../contexts/plp';
|
|
3
3
|
|
|
4
4
|
export interface UseBackPDCProps {
|
|
@@ -21,11 +21,11 @@ export type SimilarItem = any;
|
|
|
21
21
|
export type SimilarCallback = (data: SimilarItem[]) => void;
|
|
22
22
|
export type SimilarsOptions = {
|
|
23
23
|
filterTexture?: string[];
|
|
24
|
-
storeId:
|
|
24
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
25
25
|
};
|
|
26
26
|
export type PendingRequest = {
|
|
27
27
|
productId: string;
|
|
28
28
|
callbacks: SimilarCallback[];
|
|
29
29
|
filterTexture?: string[];
|
|
30
|
-
storeId:
|
|
30
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
31
31
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { StoreConfigType } from '../../../constants';
|
|
2
|
+
|
|
1
3
|
export interface ReplaceTargetForPreviewProps extends GetContentTypeProps {
|
|
2
4
|
documents: Array<any>;
|
|
3
5
|
}
|
|
@@ -6,7 +8,7 @@ export interface GetContentTypeProps {
|
|
|
6
8
|
previewId?: string;
|
|
7
9
|
previewMode?: boolean;
|
|
8
10
|
CMS_PROJECT_NAME: string;
|
|
9
|
-
storeId:
|
|
11
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
10
12
|
}
|
|
11
13
|
export interface GetContentTypeParams extends Omit<GetContentTypeProps, 'contentType' | 'CMS_PROJECT_NAME'> {
|
|
12
14
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ADD_TO_CARTType, TEXTURE_IMAGEType, TOGGLE_STYLE_MODIFIERType, Z_INDEX_WARType, NAME_SPLIT_SYMBOLType, OBJECT_FITS_DEFAULTType } from '../../../constants';
|
|
1
|
+
import { ADD_TO_CARTType, TEXTURE_IMAGEType, TOGGLE_STYLE_MODIFIERType, Z_INDEX_WARType, NAME_SPLIT_SYMBOLType, OBJECT_FITS_DEFAULTType, StoreConfigType } from '../../../constants';
|
|
2
2
|
import { CartItemStore } from '../../../contexts/store/cart';
|
|
3
3
|
import { Dispatch, HTMLAttributes, MutableRefObject, ReactNode, SetStateAction, VideoHTMLAttributes } from 'react';
|
|
4
4
|
|
|
@@ -15,6 +15,7 @@ type CONSTANTS_TYPE = {
|
|
|
15
15
|
TEXTURE_IMAGE: TEXTURE_IMAGEType;
|
|
16
16
|
TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
|
|
17
17
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
18
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
18
19
|
};
|
|
19
20
|
export interface RootProps extends HTMLAttributes<HTMLDivElement> {
|
|
20
21
|
component?: ReactNode;
|
|
@@ -46,6 +47,7 @@ export interface AddToCartProps {
|
|
|
46
47
|
export interface CardContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
47
48
|
item: CartItem;
|
|
48
49
|
texture?: string;
|
|
50
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
49
51
|
}
|
|
50
52
|
export interface NameProps extends HTMLAttributes<HTMLDivElement> {
|
|
51
53
|
brand?: string;
|
|
@@ -62,11 +64,13 @@ export interface StyleSizeProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
62
64
|
productGroupID: string;
|
|
63
65
|
size?: string | null;
|
|
64
66
|
texture?: string;
|
|
67
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
65
68
|
}
|
|
66
69
|
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
67
70
|
item: CartItem;
|
|
68
71
|
thumbnail?: boolean;
|
|
69
72
|
texture?: string;
|
|
73
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
70
74
|
}
|
|
71
75
|
export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
72
76
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
@@ -111,6 +111,7 @@ export type StyleCardProps = {
|
|
|
111
111
|
product: CartItemStore;
|
|
112
112
|
TEXTURE_IMAGE: TEXTURE_IMAGEType;
|
|
113
113
|
TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
|
|
114
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
114
115
|
};
|
|
115
116
|
export interface SkuCardProps extends StyleCardProps {
|
|
116
117
|
NAME_SPLIT_SYMBOL: NAME_SPLIT_SYMBOLType;
|
|
@@ -168,6 +169,7 @@ export interface ModalBodyProps extends PropsWithChildren {
|
|
|
168
169
|
TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
|
|
169
170
|
TIPBAR_CONFIGS: TIPBAR_CONFIGSType;
|
|
170
171
|
PLP_NOT_RESULT: PLP_NOT_RESULTType;
|
|
172
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
171
173
|
}
|
|
172
174
|
export type ModalHeaderProps = {
|
|
173
175
|
ICONS: ICONSType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, Dispatch, PropsWithChildren, SetStateAction } from 'react';
|
|
2
|
-
import { ICONSType, ITEMS_DEFAULT_SORTType, ITEMS_PER_PAGEType, SEARCH_MODALType } from '../../../../types/constants';
|
|
2
|
+
import { ICONSType, ITEMS_DEFAULT_SORTType, ITEMS_PER_PAGEType, SEARCH_MODALType, StoreConfigType } from '../../../../types/constants';
|
|
3
3
|
import { SearchContentProps } from '../../../cms/ContentTypes/Search';
|
|
4
4
|
|
|
5
5
|
export interface SearchModalProps extends PropsWithChildren, Pick<SearchContentProps, 'SectionZone'> {
|
|
@@ -10,6 +10,7 @@ export interface SearchModalProps extends PropsWithChildren, Pick<SearchContentP
|
|
|
10
10
|
ICONS: ICONSType;
|
|
11
11
|
ITEMS_PER_PAGE: ITEMS_PER_PAGEType;
|
|
12
12
|
ITEMS_DEFAULT_SORT: ITEMS_DEFAULT_SORTType;
|
|
13
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
13
14
|
};
|
|
14
15
|
className?: string;
|
|
15
16
|
}
|