@soma-vertical-web/multi-lib 1.0.36 → 1.0.38
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/constants.d.ts +0 -14
- package/data/api/checkout/order-form/items/index.d.ts +2 -2
- package/data/api/checkout/order-form/items/update/index.d.ts +2 -2
- package/data/api/xml/index.d.ts +4 -2
- package/index-DbyPXL-x.mjs +2696 -0
- package/index-HEA7MkPc.js +4 -0
- package/index.js +18 -18
- package/index.mjs +2901 -2930
- package/index2.js +2 -2
- package/index2.mjs +273 -275
- package/layout/team-component/UserMenu/Composite/Menu.d.ts +1 -1
- package/layout/team-component/UserMenu/UserMenu.d.ts +1 -1
- package/package.json +1 -1
- package/types/constants.d.ts +12 -0
- package/types/layout/team-components/Filter/index.d.ts +0 -1
- package/types/layout/team-components/Header/index.d.ts +8 -1
- package/types/layout/team-components/UserMenu/index.d.ts +4 -5
package/index2.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),_=require("./index-DsX1pAV4.js"),z=require("@soma-vertical-web/core-components"),mt=require("yup"),gt=require("sanitize-html"),bt=require("jose"),wt=require("axios");function vt(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=vt(mt),yt=async({children:e,ClientCartProvider:t,...r})=>{const{data:n}=await _.fetchContentType("mini_cart",r);return S.jsx(t,{...n?Array.isArray(n)?{data:n[0]}:{data:n}:{},children:e})},_t=({slug:e,data:t,SectionZone:r,COMMON_PAGE_COLUMN_GAP:n,identifyWhoIsFirst:o})=>{const i=t==null?void 0:t.find(d=>{var w,v,y,P;return((v=(w=d.config)==null?void 0:w.responsive)==null?void 0:v.deviceType)==="desktop"&&((P=(y=d.config)==null?void 0:y.seo)==null?void 0:P.slug)===e}),c=i==null?void 0:i.config.responsive.gapCustom,a=i==null?void 0:i.config.responsive.gapSections,u=t==null?void 0:t.find(d=>{var w,v,y,P;return((v=(w=d.config)==null?void 0:w.responsive)==null?void 0:v.deviceType)==="mobile"&&((P=(y=d.config)==null?void 0:y.seo)==null?void 0:P.slug)===e}),g=u==null?void 0:u.config.responsive.gapCustom,s=u==null?void 0:u.config.responsive.gapSections;return S.jsxs(S.Fragment,{children:[S.jsx(z.Utils.Column,{gap:c&&a?a:n,className:z.helpers.classNameConcat(_.responsive["responsive-desktop-flex"],"utils-column-modifier"),children:S.jsx(r,{data:(i==null?void 0:i.sections)??[],identifyWhoIsFirst:o})}),S.jsx(z.Utils.Column,{gap:g&&s?s:n,className:z.helpers.classNameConcat(_.responsive["responsive-mobile-flex"],"utils-column-modifier"),children:S.jsx(r,{data:(u==null?void 0:u.sections)??[],identifyWhoIsFirst:o})})]})},xt=async({slug:e,SectionZone:t,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:n=!1,...o})=>{const{data:i}=await _.fetchContentType("common_page",o);return!i||!Array.isArray(i)||i.length===0?null:S.jsx(_t,{data:i,slug:e,SectionZone:t,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:n})},Pt=async({children:e,ClientFlagsAndTagsProvider:t,...r})=>{const{data:n}=await _.fetchContentType("flags_and_tags",r);return!n||!Array.isArray(n)?null:S.jsx(t,{data:n[0],children:e})},It=async({className:e,PAYMENT_FLAGS_DICTIONARY:t,PAYMENT_FLAGS:r,LEGAL_INFORMATION_TEXT:n,ICONS:o,SectionZone:i,Footer:c,FooterSupport:a,hasFooterStamps:u,...g})=>{var v,y,P,p,b,f,h,m,T,A,x;const{data:s}=await _.fetchContentType("footer",g),d=Array.isArray(s)&&((v=s[0])==null?void 0:v.type)==="footer"?s[0]:null,w={...(y=d==null?void 0:d.paymentInfo)==null?void 0:y.paymentInfo,acceptedFlags:Array.isArray((P=d==null?void 0:d.paymentInfo)==null?void 0:P.paymentInfo.acceptedFlags)?(p=d==null?void 0:d.paymentInfo)==null?void 0:p.paymentInfo.acceptedFlags.filter(I=>!!t[I]).map(I=>t[I]):[]};return d?S.jsx(c,{className:e,data:{...d},socialInfo:(b=d.socialMedia)==null?void 0:b.socialMedia,socialMedias:(h=(f=d.socialMedia)==null?void 0:f.socialMedia)==null?void 0:h.medias,payments:w,hasFooterStamps:u,adornment:{...(T=(m=d.supportInfo)==null?void 0:m.supportInfo)!=null&&T.content?{bottom:S.jsx(a,{content:(x=(A=d.supportInfo)==null?void 0:A.supportInfo)==null?void 0:x.content,CONSTANTS:{ICONS:o,PAYMENT_FLAGS:r,PAYMENT_FLAGS_DICTIONARY:t}})}:{},...d.sections.length?{top:S.jsx(i,{data:d.sections})}:{}},LEGAL_INFORMATION_TEXT:n,ICONS:o}):null},Rt=async({children:e,ClientHeaderProvider:t,...r})=>{var i,c,a,u,g,s;const{data:n}=await _.fetchContentType("header",r),o=Array.isArray(n)?n[0]:void 0;return S.jsx(t,{headerData:{...((i=o==null?void 0:o.layerConfig)==null?void 0:i.config)??{},subMenus:((c=o==null?void 0:o.sections)==null?void 0:c.map(d=>d.data))??[],categories:((u=(a=o==null?void 0:o.categories)==null?void 0:a.categories)==null?void 0:u.items)??[],navigationLinks:((s=(g=o==null?void 0:o.navigationLinks)==null?void 0:g.navigationLinks)==null?void 0:s.items)??[]},children:e})},Ct=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,o=t==null?void 0:t.helpButtonSize,i=t.items.map((u,g)=>({type:u.type,id:`${g.toString()}-${u.title.toLowerCase()}`,title:u.title,subtitle:u.subtitle,description:u.description,buttonLabel:u.buttonLabel,buttonHref:u.buttonHref,buttonMode:u.buttonMode,buttonSize:u.buttonSize,buttonIcon:u.buttonIcon}));return{iconLabel:r,label:n,helpButtonSize:o,content:i}},St=async({HelpButton:e,ICONS:t,className:r,...n})=>{const{data:o}=await _.fetchContentType("helpbutton",n);if(!o||!Array.isArray(o)||o.length===0)return null;const i=Ct(o);return S.jsx(e,{data:i,ICONS:t,className:r})},kt=async({SectionZone:e,LPCadastro:t,...r})=>{var u;const{data:n}=await _.fetchContentType("lp_cadastro",r);if(!n||!Array.isArray(n)||n.length===0)return null;const[o]=n,i=(o==null?void 0:o.sections)||[],c=((u=o==null?void 0:o.content)==null?void 0:u.conteúdo)||{},a=o==null?void 0:o.sections;return S.jsxs(S.Fragment,{children:[S.jsx(t,{sections:i,content:c}),S.jsx(e,{data:a})]})},Tt=async({LPLOJAS_TEMPLATE_RETURN_BUTTON:e,ICONS:t,entity:r,showVendor:n,LPStoresClientWrapper:o,...i})=>{var g;const{data:c}=await _.fetchContentType("lp_lojas",i),u=(g=(Array.isArray(c)?c:[])[0])==null?void 0:g.config.config;return S.jsx(o,{entity:r,content:u,data:c,showVendor:n,ICONS:t,LPLOJAS_TEMPLATE_RETURN_BUTTON:e})},Ot=async({ERROR_TEMPLATE_RETURN_BUTTON:e,ErrorTemplate:t,...r})=>{var i;const{data:n}=await _.fetchContentType("notfound_page",r),o=Array.isArray(n)?(i=n[0])==null?void 0:i.config.config:null;return n&&o?S.jsx(t,{data:o,ERROR_TEMPLATE_RETURN_BUTTON:e}):S.jsx(S.Fragment,{})},Et=async({children:e,productId:t,COMMON_PAGE_COLUMN_GAP:r,SectionZone:n,PDPContentProvider:o,...i})=>{const{data:c}=await _.fetchContentType("product_page",i);return!c||!Array.isArray(c)||c.length===0?null:S.jsx(o,{data:c[0],productId:t,COMMON_PAGE_COLUMN_GAP:r,SectionZone:n,children:e})},jt={"column-modifier":"_column-modifier_1tqap_1"},At=async({className:e,children:t,slug:r,SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:o,PLPContentProvider:i,...c})=>{const{data:a}=await _.fetchContentType("categories_page",c);if(!a||!Array.isArray(a))return null;const u=a.find(v=>{var y,P,p;return((y=v.config)==null?void 0:y.seo.slug)===r&&((p=(P=v.config)==null?void 0:P.responsive)==null?void 0:p.deviceType)==="desktop"}),g=a.find(v=>{var y,P,p;return((y=v.config)==null?void 0:y.seo.slug)===r&&((p=(P=v.config)==null?void 0:P.responsive)==null?void 0:p.deviceType)==="mobile"}),s=a.find(v=>{var y,P,p;return((y=v.config)==null?void 0:y.seo.slug)==="default"&&((p=(P=v.config)==null?void 0:P.responsive)==null?void 0:p.deviceType)==="desktop"}),d=a.find(v=>{var y,P,p;return((y=v.config)==null?void 0:y.seo.slug)==="default"&&((p=(P=v.config)==null?void 0:P.responsive)==null?void 0:p.deviceType)==="mobile"}),w=Array.isArray(e)?e:[e];return S.jsxs(S.Fragment,{children:[S.jsx(z.Utils.Column,{className:z.helpers.classNameConcat(_.responsive["responsive-desktop-flex"],[jt["column-modifier"],...w]),style:{minHeight:"100vh"},children:S.jsx(i,{data:u??s,device:"desktop",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:o,children:t})}),S.jsx(z.Utils.Column,{className:z.helpers.classNameConcat(_.responsive["responsive-mobile-flex"],e),children:S.jsx(i,{data:g??d,device:"mobile",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:o,children:t})})]})},qt=async({slug:e,...t})=>{var c,a,u;const{data:r}=await _.fetchContentType("redirect_to_search",t);if(!r||!Array.isArray(r))return{slug:e,query:null,redirect:!1};const n=((u=(a=(c=r[0])==null?void 0:c.redirectToSearch)==null?void 0:a.redirectToSearch)==null?void 0:u.paths)??[];if(!!!n.length)return{slug:e,query:null,redirect:!1};const i=n.find(g=>{var s,d;return((s=g.path)==null?void 0:s.replace(/\//g,"-").toLowerCase())===e.replace(/\//g,"-").toLowerCase()||((d=g.path)==null?void 0:d.replace(/\//g,"-").toLowerCase())===`/${e}`.replace(/\//g,"-").toLowerCase()});return i?{slug:e,query:i==null?void 0:i.searchQuery,redirect:!0,collectionId:i==null?void 0:i.collectionId,filters:i==null?void 0:i.filters,sort:i==null?void 0:i.sort}:{slug:e,query:null,redirect:!1,collectionId:null,filters:null,sort:null}},Nt=async({slug:e,...t})=>{var c,a,u;const{data:r}=await _.fetchContentType("redirect_to_search",t);if(!r||!Array.isArray(r))return null;const n=((u=(a=(c=r[0])==null?void 0:c.redirectToSearch)==null?void 0:a.redirectToSearch)==null?void 0:u.paths)??[];if(!!!n.length)return null;const i=n.find(g=>{var s,d;return((s=g.path)==null?void 0:s.replace(/\//g,"-").toLowerCase())===e.replace(/\//g,"-").toLowerCase()||((d=g.path)==null?void 0:d.replace(/\//g,"-").toLowerCase())===`/${e}`.replace(/\//g,"-").toLowerCase()});return i?{slug:e,title:i.pageTitle,description:i.pageDescription}:null},Ft=async({slug:e,Politicas:t,SectionZone:r,oneTrust:n,...o})=>{const{data:i}=await _.fetchContentType("policy_page",o),{data:c}=await _.fetchContentType("policy_tab",o),a=Array.isArray(i)?i:null,u=Array.isArray(c)?c:null,g=a?a[0].sections:null;return!a||!u?null:S.jsxs(S.Fragment,{children:[S.jsx(t,{slug:e,pageData:a[0],tabsData:u,oneTrust:n}),g&&S.jsx(r,{data:g})]})},$t=async({children:e,SectionZone:t,className:r,...n})=>{const{data:o}=await _.fetchContentType("search_page",n);return Array.isArray(o)&&o.length>0?S.jsx(_.SearchPageScreening,{data:o,SectionZone:t,className:r,children:e}):S.jsx(S.Fragment,{children:"children"})},Lt=async({ClientTipbarContent:e,...t})=>{const{data:r}=await _.fetchContentType("tipbar",t);return S.jsx(e,{data:r})},Dt=async({children:e,SectionZone:t,WishlistScreening:r,...n})=>{const{data:o}=await _.fetchContentType("wishlist_page",n);return S.jsx(r,{data:Array.isArray(o)?o:[],SectionZone:t,children:e})},Ut={CommonPageContent:xt,CartContent:yt,FlagsAndTagsContent:Pt,HeaderContent:Rt,TipbarContent:Lt,FooterContent:It,PLPContent:At,PDPContent:Et,getRedirectData:qt,getPLPSynteticMetaData:Nt,SearchPageContent:$t,HelpButtonContent:St,LPCadastroContent:kt,LPLojasContent:Tt,PolicyPageContent:Ft,NotFoundContent:Ot,WishlistContent:Dt},Mt={Components:Ut},Ht=l.object({country:l.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:l.string().nullable()});async function Bt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Ht.validate(t);const{country:n,postalCode:o}=t;return await _.fetchVtex(`${e}/api/checkout/pub/postal-code/${n}/${o}`,{method:"POST",body:t,...r})}const zt=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 zt.validate(t);const{orderFormId:n,sellerCode:o,sellerName:i}=t,c=o?`${o.trim()} - ${i}`:null;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/openTextField`,{method:"POST",body:{value:c},...r})}const Vt=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 Vt.validate(t);const{orderFormId:o,sellerCode:i,marketingData:c}=t,a=i?{utmCampaign:i?i.toUpperCase():"",utmiCampaign:i?`${r.VENDOR_CODE}`:"semcodigo"}:{};return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${o}/attachments/marketingData`,{method:"POST",body:{...c,...a},...n})}const Gt=l.object({orderFormId:l.string().nullable(),sellerCode:l.string().nullable(),sellerName:l.string().nullable()});async function Wt({apiUrl:e,body:t,fetchOptions:r,extraData:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Gt.validate(t);const o=await Le({apiUrl:e,body:t,fetchOptions:r});return De({apiUrl:e,body:{...t,marketingData:o==null?void 0:o.marketingData},extraData:n,fetchOptions:r})}const Qt=l.object({orderFormId:l.string().nullable(),coupon:l.string().nullable()});async function Xt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Qt.validate(t);const{coupon:n="",orderFormId:o}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${o}/coupons`,{method:"POST",body:{text:n},...r})}const Kt=l.object({appId:l.string().required("App ID is required"),orderFormId:l.string().nullable(),key:l.array().of(l.string())});async function Jt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Kt.validate(t);const{appId:n="faststore",orderFormId:o,key:i}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${o}/customData/${n}/${i}`,{method:"PUT",...r})}const Zt=l.object().shape({name:l.string().required("Attachment name is required"),content:l.object().nullable()});var Fe;const Yt=l.object().shape({attachments:(Fe=l.array().of(Zt))==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()}),er=l.object({orderFormId:l.string().required("OrderFormId is required"),orderItems:l.array().of(Yt)});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,orderItems:o}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items`,{method:"POST",body:{orderItems:o},...r})}const rr=l.object({orderFormId:l.string().nullable()});async function nr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await rr.validate(t);const{orderFormId:n}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items/removeAll`,{method:"POST",...r})}const or=l.object().shape({name:l.string().required("Attachment name is required"),content:l.object().nullable()});var $e;const ar=l.object().shape({attachments:($e=l.array().of(or))==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()}),ir=l.object({orderFormId:l.string().nullable(),orderItems:l.array().of(ar)});async function sr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await ir.validate(t);const{orderFormId:n,orderItems:o}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items/update`,{method:"POST",body:{orderItems:o},...r})}const cr=l.object({orderFormId:l.string().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{orderFormId:n}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/messages/clear`,{method:"POST",...r})}const ur=l.object({id:l.string().nullable(),itemIndex:l.number().nullable(),orderFormId:l.string().nullable(),remove:l.boolean().nullable()});async function dr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await ur.validate(t);const{itemIndex:n,orderFormId:o,id:i,remove:c}=t,a=c?`/${i}/remove`:"",u=`${e}/api/checkout/pub/orderForm/${o}/items/${n}/offerings${a}`;return _.fetchVtex(u,{method:"POST",body:{id:i},...r})}const pr=l.object({orderFormId:l.string().nullable()});async function fr({apiUrl:e,body:t,fetchOptions:r,extraData:n}){var c;if(!t){console.error("[ERROR FETCHING] Body is required");return}await pr.validate(t);const o=new URLSearchParams({refreshOutdatedData:"true"}),i=t.orderFormId&&((c=n.orderFormPurchaseId)==null?void 0:c.value)!==t.orderFormId?`${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(o)}`:`${e}/api/checkout/pub/orderForm`;return _.fetchVtex(i,{method:"GET",...r})}const hr=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 mr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await hr.validate(t);const{orderFormId:n,...o}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/clientProfileData`,{method:"POST",body:{...o},...r})}const gr=l.object({sellerCode:l.string().nullable()});async function br({apiUrl:e,body:t,extraData:r,fetchOptions:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await gr.validate(t);const{sellerCode:o=""}=t;return _.fetchVtex(`${e}/api/dataentities/${r.ENTITIES}/search?_fields=${r.FIELDS}&${r.FILTER}=${o}`,{method:"GET",headers:{Accept:"application/vnd.vtex.ds.v10+json"},...n})}const wr=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 vr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await wr.validate(t);const{country:n,orderFormId:o,postalCode:i}=t,c=i?{address:{addressType:"residential",postalCode:i,country:n}}:{logisticsInfo:[],clearAddressIfPostalCodeNotFound:!0};return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${o}/attachments/shippingData`,{method:"POST",body:c,...r})}const yr=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 _r({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await yr.validate(t);const{orderFormId:n,options:o,selectedAddresses:i}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/shippingData`,{method:"POST",body:{selectedAddresses:i,clearAddressIfPostalCodeNotFound:!1,logisticsInfo:o},...r})}const xr=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 Pr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await xr.validate(t);const{country:n="",geoCoordinates:o,postalCode:i=""}=t,c=new URLSearchParams({country:String(n)});return i?c.append("postalCode",i):c.append("geoCoordinates",`${o==null?void 0:o.longitude};${o==null?void 0:o.latitude}`),await _.fetchVtex(`${e}/api/checkout/pub/regions/?${c.toString()}`,{method:"GET",...r})}const Ir=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(Ir),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 Cr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}return await Rr.validate(t),_.fetchVtex(`${e}/api/checkout/pub/orderForms/simulation`,{method:"POST",body:t,...r})}const Sr=Object.freeze(Object.defineProperty({__proto__:null,getMasterDataSellerCode:br,getOrderForm:fr,postOrderFormAddCoupon:Xt,postOrderFormAttachClientProfileData:mr,postOrderFormAttachOrderFormData:Wt,postOrderFormAttachShippingData:vr,postOrderFormAttachmentsMarketingData:De,postOrderFormAttachmentsOpenTextField:Le,postOrderFormClearMessages:lr,postOrderFormFreightSimulation:Cr,postOrderFormItems:tr,postOrderFormRegion:Pr,postOrderFormRemoveAllItems:nr,postOrderFormUpdateItems:sr,postOrderFormUpdateShippingData:_r,postOrderformAddress:Bt,putOrderFormCustomData:Jt,updateOrderFormOffering:dr},Symbol.toStringTag,{value:"Module"})),kr=l.object({skuId:l.string()});async function Tr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await kr.validate(t);const{skuId:n}=t;return _.fetchVtex(`${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${n}`,{...r})}const Or=l.object({ids:l.array().of(l.string().required("ID are required")).required("IDs are required")});async function Er({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Or.validate(t);const{ids:n}=t;return _.fetchVtex(`${e}/api/catalog_system/pub/products/search?fq=${n.map(o=>`productId:${o}`).join("&fq=")}`,{...r})}const jr=l.object({productId:l.number().required("Product ID is required")});async function Ar({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await jr.validate(t);const{productId:n}=t;return _.fetchVtex(`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`,{...r})}async function qr({apiUrl:e,params:t,fetchOptions:r}){return t!=null&&t.slug?_.fetchVtex(`${e}/api/catalog_system/pub/portal/pagetype/${t.slug}`,{...r}):(console.error("[ERROR FETCHING] slug is required"),null)}const Nr=Object.freeze(Object.defineProperty({__proto__:null,getCatalogKitProducts:Tr,getCatalogPageInfo:qr,getCatalogProducts:Er,getCatalogSimilars:Ar},Symbol.toStringTag,{value:"Module"})),Fr=l.object({query:l.string()});async function $r({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Fr.validate(t);const{query:n=""}=t,o=new URLSearchParams({query:n});return _.fetchVtex(`${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${o.toString()}`,{...r})}const Lr=(e,t)=>gt(e,t),Dr=e=>({...e,description:e.description?Lr(e.description):e.description}),Ur=({offer:e,seller:t,product:r})=>({...e,product:r,seller:t}),Ue=(e,t)=>({...e,isVariantOf:Dr(t)}),Mr=e=>e?"https://schema.org/InStock":"https://schema.org/OutOfStock",oe=e=>e.AvailableQuantity>0,Ae=e=>e.spotPrice??0,Hr=e=>e.Price??0,Me=(e,t)=>oe(e)&&!oe(t)?-1:!oe(e)&&oe(t)?1:Ae(e)-Ae(t),Br=(e,t)=>{let r=0;for(let n=1;n<e.length;n++)t(e[r],e[n])>0&&(r=n);return e[r]},He=e=>{const t=e.flatMap(n=>n.sellers.map(o=>({offer:o.commertialOffer,sku:n}))),r=Br(t,({offer:n},{offer:o})=>Me(n,o));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"},zr=e=>({name:e.name,value:e.content,valueReference:ae.attachment}),Vr=e=>({propertyID:e.id,name:e.name,value:e.value,valueReference:{valueReference:ae.attribute,visible:e.visible}}),ie=(e,t,r)=>{const n=e.flatMap(({name:c,values:a})=>a?a.map(u=>({name:c,value:u,valueReference:ae.specification})):{name:c,value:"",valueReference:ae.specification}),o=Array.isArray(r)?r.map(zr):[],i=t?t.map(Vr):[];return[...n,...o,...i]},qe="ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",Gr="AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa",Wr=e=>{let t=e.slice(0);for(let r=0;r<qe.length;r++)t=t.replace(new RegExp(qe.charAt(r),"g"),Gr.charAt(r));return t},Qr=e=>e.replace(/[·/_,:]/,"-"),ze=e=>{const r=e.replace(/,/g,"").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g,"-");return Qr(Wr(r)).toLowerCase()},Ve=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},o=e.map(i=>Ur({offer:i.commertialOffer,seller:i,product:t})).sort(Me).map(i=>(i.seller.sellerId==="1"&&i.AvailableQuantity>0&&(r.price=i.Price,r.listPrice=i.ListPrice,r.sellerDefault=!0),{availability:i.AvailableQuantity>0,listPrice:i.ListPrice,price:Hr(i),priceValidUntil:i.PriceValidUntil,priceCurrency:"BRL",installments:i.Installments,lowPrice:i.spotPrice,quantity:i.AvailableQuantity,seller:{identifier:i.seller.sellerId}}));return{lowPrice:r.sellerDefault?r.price:o[0].price,highPrice:r.sellerDefault?r.listPrice:o[0].listPrice,offers:o}},Qe=e=>{const{attributes:t,itemId:r,name:n,sellers:o,variations:i}=e;return{additionalProperty:ie(i,t,[]),name:n,offers:{offers:o==null?void 0:o.map(({sellerId:c,commertialOffer:a})=>({availability:Mr(a.AvailableQuantity>0),listPrice:a.ListPrice,price:a.Price,quantity:a.AvailableQuantity,seller:{identifier:c}}))},sku:r}},Xr=e=>{var I;const{attributes:t,referenceId:r,isVariantOf:n,images:o,itemId:i,name:c,sellers:a,videos:u,variations:g}=e,{brand:s,categories:d,categoriesIds:w,description:v,linkText:y,productClusters:P,clusterHighlights:p,productName:b,properties:f,productId:h,productReference:m}=n,T=d.slice().reverse(),A=We(a,e.isVariantOf),x=Ge(A.offers[0].installments);return{sku:i,gtin:((I=r==null?void 0:r[0])==null?void 0:I.Value)??m??"",name:b??c,description:v,releaseDate:n.releaseDate??"",slug:y,video:u[0],categories:d,categoriesIds:w,id:h,brand:{name:s,brandName:s},seo:{description:v,title:b,canonical:Ve(y)},cluster:{generals:P,highlights:p},properties:f,availability:{status:A.offers[0].availability},breadcrumbList:{itemListElement:[...T.map((O,N)=>{const F=O.split("/"),L=F[F.length-2],D=F.map(ze).join("/");return{name:L,item:D,position:N+1}}),{name:n.productName,item:y,position:d.length+1}],numberOfItems:d.length},image:Be(o),offers:A,additionalProperty:ie(g,t,[]),isVariantOf:{productGroupID:n.productId,hasVariant:n.items.map(O=>Qe(O))},installments:x}},Kr=e=>{var x;const{attributes:t,referenceId:r,isVariantOf:n,images:o,itemId:i,name:c,sellers:a,Videos:u,variations:g}=e,{brand:s,categories:d,categoriesIds:w,description:v,linkText:y,productClusters:P,productName:p,Coleção:b,"ID Coleção":f,productId:h}=n,m=d.slice().reverse(),T=We(a,e.isVariantOf),A=Ge(T.offers[0].installments);return{sku:i,gtin:((x=r[0])==null?void 0:x.Value)??"",name:p??c,description:v,releaseDate:n.releaseDate??"",slug:y,video:u[0],categories:d,categoriesIds:w,collection:b,collectionId:f,id:h,brand:{name:s,brandName:s},seo:{description:v,title:p,canonical:Ve(y)},cluster:{generals:P,highlights:[]},availability:{status:T.offers[0].availability},breadcrumbList:{itemListElement:[...m.map((I,O)=>{const N=I.split("/"),F=N[N.length-2],L=N.map(ze).join("/");return{name:F,item:L,position:O+1}}),{name:n.productName,item:y,position:d.length+1}],numberOfItems:d.length},image:Be(o),offers:T,additionalProperty:ie(g,t,[]),isVariantOf:{productGroupID:n.productId,hasVariant:n.items.map(I=>{const{variations:O}=I,N=O.map(F=>({name:F,values:I[F]}));return{...Qe(I),additionalProperty:ie(N,t,[])}})},installments:A}},Jr=l.array().of(l.object({key:l.string().required(),value:l.string().required()})).required("Facets are required");async function Zr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Jr.validate(t);const n=new URLSearchParams({}),o=t.map(({key:c,value:a})=>`${c}/${a}`).join("/");_.addSearchParamsFacets(t,n);const i=`${e}/api/catalog_system/pub/products/crossselling/${o}`;return _.fetchVtex(i,{cache:"no-store",...r}).then(c=>c.map(u=>{const g=He(u.items);return g&&Ue(g,u)}).filter(u=>!!u).map(u=>({node:Kr(u)})))}const Xe=({apiUrl:e,body:t,fetchOptions:r,extraData:n})=>{if(!t){console.error("[ERROR FETCHING] Body is required");return}const{query:o="",page:i=1,count:c,sort:a="",facets:u=[],type:g,hideUnavailableItems:s=!0,locale:d=""}=t,w=new URLSearchParams({page:i.toString(),count:(c==null?void 0:c.toString())??(n==null?void 0:n.ITEMS_PER_PAGE)??24,query:o,sort:a,locale:d});s!==void 0&&w.append("hideUnavailableItems",s.toString());const v=u.map(y=>`${y.key}/${y.value}`).join("/")??"";return _.fetchVtexWithAbortController(`${e}/api/io/_v/api/intelligent-search/${g}/${v}?${w.toString()}`,{headers:{Accept:"application/json","content-type":"application/json"},...r})};async function Yr({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}),o=(n==null?void 0:n.products.map(a=>{const u=He(a.items);return u&&Ue(u,a)}).filter(a=>!!a))??[],{pagination:i,recordsFiltered:c}=n;return{data:{pagination:{nextPage:i.after.length>0,previousPage:i.before.length>0,startCursor:"0",endCursor:c.toString(),count:c,total:i.count},products:o.map((a,u)=>({node:Xr(a),cursor:u.toString()}))}}}async function en({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:_.formattedFacets(n,e==null?void 0:e.selectedFacets,(e==null?void 0:e.query)??"")}}}const tn=l.object({query:l.string().optional(),locale:l.string().optional()});async function rn({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await tn.validate(t);const{query:n="",locale:o="default_locale"}=t,i=new URLSearchParams({query:n,locale:o});return _.fetchVtex(`${e}/api/io/_v/api/intelligent-search/search_suggestions?${i.toString()}`,{...r})}async function nn({apiUrl:e}){return _.fetchVtex(`${e}/api/io/_v/api/intelligent-search/top_searches`)}const on=Object.freeze(Object.defineProperty({__proto__:null,getSearchAutoCompleteSuggestions:$r,getSearchCrossellingProducts:Zr,getSearchFacets:en,getSearchProducts:Yr,getSearchSuggestedTerms:rn,getSearchTopSearchs:nn},Symbol.toStringTag,{value:"Module"})),an=l.object({masterDataEntity:l.string().nonNullable(),payload:l.object().shape({}).nullable()});async function sn({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await an.validate(t);const{masterDataEntity:n,payload:o}=t,i=`${e}/api/dataentities/${n}/documents`;return _.fetchVtex(i,{method:"POST",body:{payload:o},...r})}const cn=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()}),ln=l.object({masterDataEntity:l.string().required(),searchFields:cn,headers:l.object().shape({"REST-Range":l.string().notRequired()})});async function Ke({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}const n=new URLSearchParams;await ln.validate(t);const{masterDataEntity:o,searchFields:i,headers:c}=t;i&&Object.entries(i).forEach(([g,s])=>{n.append(g,String(s))}),"_fields"in i||n==null||n.append("_fields","_all");let a=[],u=null;do{u&&n.set("_scroll",u);const g=await fetch(`${e}/api/dataentities/${o}/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),u=g.headers.get("x-vtex-md-scroll")}while(u);return a}const un=l.object({dataEntityName:l.string().required(),id:l.string().required(),fieldsToBeUpdated:l.object().shape({})});async function dn({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await un.validate(t);const{dataEntityName:n,id:o,fieldsToBeUpdated:i}=t,c=`${e}/api/dataentities/${n}/documents/${o}`;return _.fetchVtex(c,{body:{fieldsToBeUpdated:i},method:"PATCH",...r})}const pn=Object.freeze(Object.defineProperty({__proto__:null,getSearchMasterdata:Ke,patchUpdateMasterdata:dn,postMasterdata:sn},Symbol.toStringTag,{value:"Module"}));async function fn({body:e,apiUrl:t,extraData:r,fetchOptions:n}){const{productIds:o}=e;if(!o)return console.error("[ERROR FETCHING] productIds is required"),[];const{NAME_SPLIT_SYMBOL:i}=r;if(!i)return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"),[];const c=o.map(s=>typeof s=="string"||typeof s=="number"?`productId:${s}`:"").join("&fq="),a=await _.fetchVtex(`${t}/api/catalog_system/pub/products/search?fq=${c}`,{...n}),u=s=>Object.keys(s).map(d=>({id:d,name:s[d]}));return a.map((s,d)=>{var h;const{installments:w,price:v,listPrice:y,sizes:P,allSizesAvailable:p}=_.getSkuInfos({items:s.items,NAME_SPLIT_SYMBOL:i}),b=p?!0:P.some(m=>m.available),f=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:u(s.productClusters),highlights:u(s.clusterHighlights)},availability:{status:b},image:s.items[0].images.map(({imageLabel:m,imageUrl:T})=>({alternateName:m,url:T,keywords:m})),offers:{lowPrice:v,highPrice:y,offers:[{availability:b,listPrice:y,price:v,priceValidUntil:f.PriceValidUntil,priceCurrency:"BRL",installments:f.Installments,lowPrice:v,quantity:f.AvailableQuantity,seller:{identifier:s.items[0].sellers[0].sellerId}}]},additionalProperty:(h=s==null?void 0:s.skuSpecifications)==null?void 0:h.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 T;return{additionalProperty:m==null?void 0:m.variations.map(()=>{var A,x,I;return{name:(A=m==null?void 0:m.variations)==null?void 0:A[0],value:(I=m==null?void 0:m[(x=m==null?void 0:m.variations)==null?void 0:x[0]])==null?void 0:I[0],valueReference:"SPECIFICATION"}}),name:m.name,offers:{offers:(T=m.sellers)==null?void 0:T.map(({commertialOffer:A,sellerId:x})=>({availability:"https://schema.org/InStock",listPrice:A.ListPrice,price:A.Price,quantity:A.AvailableQuantity,seller:{identifier:x}}))},sku:m.itemId,slug:`-${m.itemId}`}})},installments:w},cursor:d.toString()}})}const hn=Object.freeze(Object.defineProperty({__proto__:null,getWishlistProducts:fn},Symbol.toStringTag,{value:"Module"}));var ge={exports:{}},Je={},we={},Ze={},Ye={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathSuffix",{enumerable:!0,get:function(){return r}});const t=_.parsePath;function r(n,o){if(!n.startsWith("/")||!o)return n;const{pathname:i,query:c,hash:a}=(0,t.parsePath)(n);return""+i+o+c+a}})(Ye);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"formatNextPathnameInfo",{enumerable:!0,get:function(){return i}});const t=_.removeTrailingSlash,r=_.addPathPrefix,n=Ye,o=_.addLocale;function i(c){let a=(0,o.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 et={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getHostname",{enumerable:!0,get:function(){return t}});function t(r,n){let o;if(n!=null&&n.host&&!Array.isArray(n.host))o=n.host.toString().split(":",1)[0];else if(r.hostname)o=r.hostname;else return;return o.toLowerCase()}})(et);var tt={},rt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removePathPrefix",{enumerable:!0,get:function(){return r}});const t=_.pathHasPrefix;function r(n,o){if(!(0,t.pathHasPrefix)(n,o))return n;const i=n.slice(o.length);return i.startsWith("/")?i:"/"+i}})(rt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getNextPathnameInfo",{enumerable:!0,get:function(){return o}});const t=_.normalizeLocalePath,r=rt,n=_.pathHasPrefix;function o(i,c){var a;const{basePath:u,i18n:g,trailingSlash:s}=(a=c.nextConfig)!=null?a:{},d={pathname:i,trailingSlash:i!=="/"?i.endsWith("/"):s};u&&(0,n.pathHasPrefix)(d.pathname,u)&&(d.pathname=(0,r.removePathPrefix)(d.pathname,u),d.basePath=u);let w=d.pathname;if(d.pathname.startsWith("/_next/data/")&&d.pathname.endsWith(".json")){const y=d.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),P=y[0];d.buildId=P,w=y[1]!=="index"?"/"+y.slice(1).join("/"):"/",c.parseData===!0&&(d.pathname=w)}if(g){let y=c.i18nProvider?c.i18nProvider.analyze(d.pathname):(0,t.normalizeLocalePath)(d.pathname,g.locales);d.locale=y.detectedLocale;var v;d.pathname=(v=y.pathname)!=null?v:d.pathname,!y.detectedLocale&&d.buildId&&(y=c.i18nProvider?c.i18nProvider.analyze(w):(0,t.normalizeLocalePath)(w,g.locales),y.detectedLocale&&(d.locale=y.detectedLocale))}return d}})(tt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextURL",{enumerable:!0,get:function(){return u}});const t=_.detectDomainLocale,r=Ze,n=et,o=tt,i=/(?!^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(i,"localhost"),s&&String(s).replace(i,"localhost"))}const a=Symbol("NextURLInternal");class u{constructor(s,d,w){let v,y;typeof d=="object"&&"pathname"in d||typeof d=="string"?(v=d,y=w||{}):y=w||d||{},this[a]={url:c(s,v??y.base),options:y,basePath:""},this.analyze()}analyze(){var s,d,w,v,y;const P=(0,o.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)((d=this[a].options.nextConfig)==null||(s=d.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=P.pathname,this[a].defaultLocale=b,this[a].basePath=P.basePath??"",this[a].buildId=P.buildId,this[a].locale=P.locale??b,this[a].trailingSlash=P.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 d,w;if(!this[a].locale||!(!((w=this[a].options.nextConfig)==null||(d=w.i18n)==null)&&d.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(),d=this.formatSearch();return`${this.protocol}//${this.host}${s}${d}${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 u(String(this),this[a].options)}}})(we);var ve={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,g){for(var s in g)Object.defineProperty(u,s,{enumerable:!0,get:g[s]})}t(e,{fromNodeOutgoingHttpHeaders:function(){return n},normalizeNextQueryParam:function(){return a},splitCookiesString:function(){return o},toNodeOutgoingHttpHeaders:function(){return i},validateURL:function(){return c}});const r=_.constants;function n(u){const g=new Headers;for(let[s,d]of Object.entries(u)){const w=Array.isArray(d)?d:[d];for(let v of w)typeof v>"u"||(typeof v=="number"&&(v=v.toString()),g.append(s,v))}return g}function o(u){var g=[],s=0,d,w,v,y,P;function p(){for(;s<u.length&&/\s/.test(u.charAt(s));)s+=1;return s<u.length}function b(){return w=u.charAt(s),w!=="="&&w!==";"&&w!==","}for(;s<u.length;){for(d=s,P=!1;p();)if(w=u.charAt(s),w===","){for(v=s,s+=1,p(),y=s;s<u.length&&b();)s+=1;s<u.length&&u.charAt(s)==="="?(P=!0,s=y,g.push(u.substring(d,v)),d=s):s=v+1}else s+=1;(!P||s>=u.length)&&g.push(u.substring(d,u.length))}return g}function i(u){const g={},s=[];if(u)for(const[d,w]of u.entries())d.toLowerCase()==="set-cookie"?(s.push(...o(w)),g[d]=s.length===1?s[0]:s):g[d]=w;return g}function c(u){try{return String(new URL(String(u)))}catch(g){throw new Error(`URL is malformed "${String(u)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:g})}}function a(u,g){const s=[r.NEXT_QUERY_PARAM_PREFIX,r.NEXT_INTERCEPTION_MARKER_PREFIX];for(const d of s)if(u!==d&&u.startsWith(d)){const w=u.substring(d.length);g(w)}}})(ve);var nt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(i,c){for(var a in c)Object.defineProperty(i,a,{enumerable:!0,get:c[a]})}t(e,{PageSignatureError:function(){return r},RemovedPageError:function(){return n},RemovedUAError:function(){return o}});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"),_=require("./index-HEA7MkPc.js"),z=require("@soma-vertical-web/core-components"),mt=require("yup"),gt=require("sanitize-html"),bt=require("jose");function wt(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=wt(mt),vt=async({children:e,ClientCartProvider:t,...r})=>{const{data:n}=await _.fetchContentType("mini_cart",r);return S.jsx(t,{...n?Array.isArray(n)?{data:n[0]}:{data:n}:{},children:e})},yt=({slug:e,data:t,SectionZone:r,COMMON_PAGE_COLUMN_GAP:n,identifyWhoIsFirst:o})=>{const a=t==null?void 0:t.find(d=>{var w,v,y,P;return((v=(w=d.config)==null?void 0:w.responsive)==null?void 0:v.deviceType)==="desktop"&&((P=(y=d.config)==null?void 0:y.seo)==null?void 0:P.slug)===e}),c=a==null?void 0:a.config.responsive.gapCustom,i=a==null?void 0:a.config.responsive.gapSections,u=t==null?void 0:t.find(d=>{var w,v,y,P;return((v=(w=d.config)==null?void 0:w.responsive)==null?void 0:v.deviceType)==="mobile"&&((P=(y=d.config)==null?void 0:y.seo)==null?void 0:P.slug)===e}),g=u==null?void 0:u.config.responsive.gapCustom,s=u==null?void 0:u.config.responsive.gapSections;return S.jsxs(S.Fragment,{children:[S.jsx(z.Utils.Column,{gap:c&&i?i:n,className:z.helpers.classNameConcat(_.responsive["responsive-desktop-flex"],"utils-column-modifier"),children:S.jsx(r,{data:(a==null?void 0:a.sections)??[],identifyWhoIsFirst:o})}),S.jsx(z.Utils.Column,{gap:g&&s?s:n,className:z.helpers.classNameConcat(_.responsive["responsive-mobile-flex"],"utils-column-modifier"),children:S.jsx(r,{data:(u==null?void 0:u.sections)??[],identifyWhoIsFirst:o})})]})},_t=async({slug:e,SectionZone:t,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:n=!1,...o})=>{const{data:a}=await _.fetchContentType("common_page",o);return!a||!Array.isArray(a)||a.length===0?null:S.jsx(yt,{data:a,slug:e,SectionZone:t,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:n})},xt=async({children:e,ClientFlagsAndTagsProvider:t,...r})=>{const{data:n}=await _.fetchContentType("flags_and_tags",r);return!n||!Array.isArray(n)?null:S.jsx(t,{data:n[0],children:e})},Pt=async({className:e,PAYMENT_FLAGS_DICTIONARY:t,PAYMENT_FLAGS:r,LEGAL_INFORMATION_TEXT:n,ICONS:o,SectionZone:a,Footer:c,FooterSupport:i,hasFooterStamps:u,...g})=>{var v,y,P,p,b,f,h,m,T,A,x;const{data:s}=await _.fetchContentType("footer",g),d=Array.isArray(s)&&((v=s[0])==null?void 0:v.type)==="footer"?s[0]:null,w={...(y=d==null?void 0:d.paymentInfo)==null?void 0:y.paymentInfo,acceptedFlags:Array.isArray((P=d==null?void 0:d.paymentInfo)==null?void 0:P.paymentInfo.acceptedFlags)?(p=d==null?void 0:d.paymentInfo)==null?void 0:p.paymentInfo.acceptedFlags.filter(R=>!!t[R]).map(R=>t[R]):[]};return d?S.jsx(c,{className:e,data:{...d},socialInfo:(b=d.socialMedia)==null?void 0:b.socialMedia,socialMedias:(h=(f=d.socialMedia)==null?void 0:f.socialMedia)==null?void 0:h.medias,payments:w,hasFooterStamps:u,adornment:{...(T=(m=d.supportInfo)==null?void 0:m.supportInfo)!=null&&T.content?{bottom:S.jsx(i,{content:(x=(A=d.supportInfo)==null?void 0:A.supportInfo)==null?void 0:x.content,CONSTANTS:{ICONS:o,PAYMENT_FLAGS:r,PAYMENT_FLAGS_DICTIONARY:t}})}:{},...d.sections.length?{top:S.jsx(a,{data:d.sections})}:{}},LEGAL_INFORMATION_TEXT:n,ICONS:o}):null},Rt=async({children:e,ClientHeaderProvider:t,...r})=>{var a,c,i,u,g,s;const{data:n}=await _.fetchContentType("header",r),o=Array.isArray(n)?n[0]:void 0;return S.jsx(t,{headerData:{...((a=o==null?void 0:o.layerConfig)==null?void 0:a.config)??{},subMenus:((c=o==null?void 0:o.sections)==null?void 0:c.map(d=>d.data))??[],categories:((u=(i=o==null?void 0:o.categories)==null?void 0:i.categories)==null?void 0:u.items)??[],navigationLinks:((s=(g=o==null?void 0:o.navigationLinks)==null?void 0:g.navigationLinks)==null?void 0:s.items)??[]},children:e})},It=e=>{var c,i;const t=(i=(c=e[0])==null?void 0:c.items)==null?void 0:i.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,o=t==null?void 0:t.helpButtonSize,a=t.items.map((u,g)=>({type:u.type,id:`${g.toString()}-${u.title.toLowerCase()}`,title:u.title,subtitle:u.subtitle,description:u.description,buttonLabel:u.buttonLabel,buttonHref:u.buttonHref,buttonMode:u.buttonMode,buttonSize:u.buttonSize,buttonIcon:u.buttonIcon}));return{iconLabel:r,label:n,helpButtonSize:o,content:a}},Ct=async({HelpButton:e,ICONS:t,className:r,...n})=>{const{data:o}=await _.fetchContentType("helpbutton",n);if(!o||!Array.isArray(o)||o.length===0)return null;const a=It(o);return S.jsx(e,{data:a,ICONS:t,className:r})},St=async({SectionZone:e,LPCadastro:t,...r})=>{var u;const{data:n}=await _.fetchContentType("lp_cadastro",r);if(!n||!Array.isArray(n)||n.length===0)return null;const[o]=n,a=(o==null?void 0:o.sections)||[],c=((u=o==null?void 0:o.content)==null?void 0:u.conteúdo)||{},i=o==null?void 0:o.sections;return S.jsxs(S.Fragment,{children:[S.jsx(t,{sections:a,content:c}),S.jsx(e,{data:i})]})},kt=async({LPLOJAS_TEMPLATE_RETURN_BUTTON:e,ICONS:t,entity:r,showVendor:n,LPStoresClientWrapper:o,...a})=>{var g;const{data:c}=await _.fetchContentType("lp_lojas",a),u=(g=(Array.isArray(c)?c:[])[0])==null?void 0:g.config.config;return S.jsx(o,{entity:r,content:u,data:c,showVendor:n,ICONS:t,LPLOJAS_TEMPLATE_RETURN_BUTTON:e})},Tt=async({ERROR_TEMPLATE_RETURN_BUTTON:e,ErrorTemplate:t,...r})=>{var a;const{data:n}=await _.fetchContentType("notfound_page",r),o=Array.isArray(n)?(a=n[0])==null?void 0:a.config.config:null;return n&&o?S.jsx(t,{data:o,ERROR_TEMPLATE_RETURN_BUTTON:e}):S.jsx(S.Fragment,{})},Ot=async({children:e,productId:t,COMMON_PAGE_COLUMN_GAP:r,SectionZone:n,PDPContentProvider:o,...a})=>{const{data:c}=await _.fetchContentType("product_page",a);return!c||!Array.isArray(c)||c.length===0?null:S.jsx(o,{data:c[0],productId:t,COMMON_PAGE_COLUMN_GAP:r,SectionZone:n,children:e})},Et={"column-modifier":"_column-modifier_1tqap_1"},jt=async({className:e,children:t,slug:r,SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:o,PLPContentProvider:a,...c})=>{const{data:i}=await _.fetchContentType("categories_page",c);if(!i||!Array.isArray(i))return null;const u=i.find(v=>{var y,P,p;return((y=v.config)==null?void 0:y.seo.slug)===r&&((p=(P=v.config)==null?void 0:P.responsive)==null?void 0:p.deviceType)==="desktop"}),g=i.find(v=>{var y,P,p;return((y=v.config)==null?void 0:y.seo.slug)===r&&((p=(P=v.config)==null?void 0:P.responsive)==null?void 0:p.deviceType)==="mobile"}),s=i.find(v=>{var y,P,p;return((y=v.config)==null?void 0:y.seo.slug)==="default"&&((p=(P=v.config)==null?void 0:P.responsive)==null?void 0:p.deviceType)==="desktop"}),d=i.find(v=>{var y,P,p;return((y=v.config)==null?void 0:y.seo.slug)==="default"&&((p=(P=v.config)==null?void 0:P.responsive)==null?void 0:p.deviceType)==="mobile"}),w=Array.isArray(e)?e:[e];return S.jsxs(S.Fragment,{children:[S.jsx(z.Utils.Column,{className:z.helpers.classNameConcat(_.responsive["responsive-desktop-flex"],[Et["column-modifier"],...w]),style:{minHeight:"100vh"},children:S.jsx(a,{data:u??s,device:"desktop",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:o,children:t})}),S.jsx(z.Utils.Column,{className:z.helpers.classNameConcat(_.responsive["responsive-mobile-flex"],e),children:S.jsx(a,{data:g??d,device:"mobile",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:o,children:t})})]})},At=async({slug:e,...t})=>{var c,i,u;const{data:r}=await _.fetchContentType("redirect_to_search",t);if(!r||!Array.isArray(r))return{slug:e,query:null,redirect:!1};const n=((u=(i=(c=r[0])==null?void 0:c.redirectToSearch)==null?void 0:i.redirectToSearch)==null?void 0:u.paths)??[];if(!!!n.length)return{slug:e,query:null,redirect:!1};const a=n.find(g=>{var s,d;return((s=g.path)==null?void 0:s.replace(/\//g,"-").toLowerCase())===e.replace(/\//g,"-").toLowerCase()||((d=g.path)==null?void 0:d.replace(/\//g,"-").toLowerCase())===`/${e}`.replace(/\//g,"-").toLowerCase()});return a?{slug:e,query:a==null?void 0:a.searchQuery,redirect:!0,collectionId:a==null?void 0:a.collectionId,filters:a==null?void 0:a.filters,sort:a==null?void 0:a.sort}:{slug:e,query:null,redirect:!1,collectionId:null,filters:null,sort:null}},qt=async({slug:e,...t})=>{var c,i,u;const{data:r}=await _.fetchContentType("redirect_to_search",t);if(!r||!Array.isArray(r))return null;const n=((u=(i=(c=r[0])==null?void 0:c.redirectToSearch)==null?void 0:i.redirectToSearch)==null?void 0:u.paths)??[];if(!!!n.length)return null;const a=n.find(g=>{var s,d;return((s=g.path)==null?void 0:s.replace(/\//g,"-").toLowerCase())===e.replace(/\//g,"-").toLowerCase()||((d=g.path)==null?void 0:d.replace(/\//g,"-").toLowerCase())===`/${e}`.replace(/\//g,"-").toLowerCase()});return a?{slug:e,title:a.pageTitle,description:a.pageDescription}:null},Nt=async({slug:e,Politicas:t,SectionZone:r,oneTrust:n,...o})=>{const{data:a}=await _.fetchContentType("policy_page",o),{data:c}=await _.fetchContentType("policy_tab",o),i=Array.isArray(a)?a:null,u=Array.isArray(c)?c:null,g=i?i[0].sections:null;return!i||!u?null:S.jsxs(S.Fragment,{children:[S.jsx(t,{slug:e,pageData:i[0],tabsData:u,oneTrust:n}),g&&S.jsx(r,{data:g})]})},Ft=async({children:e,SectionZone:t,className:r,...n})=>{const{data:o}=await _.fetchContentType("search_page",n);return Array.isArray(o)&&o.length>0?S.jsx(_.SearchPageScreening,{data:o,SectionZone:t,className:r,children:e}):S.jsx(S.Fragment,{children:"children"})},$t=async({ClientTipbarContent:e,...t})=>{const{data:r}=await _.fetchContentType("tipbar",t);return S.jsx(e,{data:r})},Lt=async({children:e,SectionZone:t,WishlistScreening:r,...n})=>{const{data:o}=await _.fetchContentType("wishlist_page",n);return S.jsx(r,{data:Array.isArray(o)?o:[],SectionZone:t,children:e})},Dt={CommonPageContent:_t,CartContent:vt,FlagsAndTagsContent:xt,HeaderContent:Rt,TipbarContent:$t,FooterContent:Pt,PLPContent:jt,PDPContent:Ot,getRedirectData:At,getPLPSynteticMetaData:qt,SearchPageContent:Ft,HelpButtonContent:Ct,LPCadastroContent:St,LPLojasContent:kt,PolicyPageContent:Nt,NotFoundContent:Tt,WishlistContent:Lt},Ut={Components:Dt},Mt=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 Mt.validate(t);const{country:n,postalCode:o}=t;return await _.fetchVtex(`${e}/api/checkout/pub/postal-code/${n}/${o}`,{method:"POST",body:t,...r})}const Bt=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 Bt.validate(t);const{orderFormId:n,sellerCode:o,sellerName:a}=t,c=o?`${o.trim()} - ${a}`:null;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/openTextField`,{method:"POST",body:{value:c},...r})}const zt=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 zt.validate(t);const{orderFormId:o,sellerCode:a,marketingData:c}=t,i=a?{utmCampaign:a?a.toUpperCase():"",utmiCampaign:a?`${r.VENDOR_CODE}`:"semcodigo"}:{};return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${o}/attachments/marketingData`,{method:"POST",body:{...c,...i},...n})}const Vt=l.object({orderFormId:l.string().nullable(),sellerCode:l.string().nullable(),sellerName:l.string().nullable()});async function Gt({apiUrl:e,body:t,fetchOptions:r,extraData:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Vt.validate(t);const o=await Le({apiUrl:e,body:t,fetchOptions:r});return De({apiUrl:e,body:{...t,marketingData:o==null?void 0:o.marketingData},extraData:n,fetchOptions:r})}const Wt=l.object({orderFormId:l.string().nullable(),coupon:l.string().nullable()});async function Qt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Wt.validate(t);const{coupon:n="",orderFormId:o}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${o}/coupons`,{method:"POST",body:{text:n},...r})}const Xt=l.object({appId:l.string().required("App ID is required"),orderFormId:l.string().nullable(),key:l.array().of(l.string())});async function Kt({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Xt.validate(t);const{appId:n="faststore",orderFormId:o,key:a}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${o}/customData/${n}/${a}`,{method:"PUT",...r})}const Jt=l.object().shape({name:l.string().required("Attachment name is required"),content:l.object().nullable()});var Fe;const Zt=l.object().shape({attachments:(Fe=l.array().of(Jt))==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()}),Yt=l.object({orderFormId:l.string().required("OrderFormId is required"),orderItems:l.array().of(Zt)});async function er({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Yt.validate(t);const{orderFormId:n,orderItems:o}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items`,{method:"POST",body:{orderItems:o},...r})}const tr=l.object({orderFormId:l.string().nullable()});async function rr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await tr.validate(t);const{orderFormId:n}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items/removeAll`,{method:"POST",...r})}const nr=l.object().shape({name:l.string().required("Attachment name is required"),content:l.object().nullable()});var $e;const or=l.object().shape({attachments:($e=l.array().of(nr))==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()}),ir=l.object({orderFormId:l.string().nullable(),orderItems:l.array().of(or)});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:o}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/items/update`,{method:"POST",body:{orderItems:o},...r})}const sr=l.object({orderFormId:l.string().nullable()});async function cr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await sr.validate(t);const{orderFormId:n}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/messages/clear`,{method:"POST",...r})}const lr=l.object({id:l.string().nullable(),itemIndex:l.number().nullable(),orderFormId:l.string().nullable(),remove:l.boolean().nullable()});async function ur({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await lr.validate(t);const{itemIndex:n,orderFormId:o,id:a,remove:c}=t,i=c?`/${a}/remove`:"",u=`${e}/api/checkout/pub/orderForm/${o}/items/${n}/offerings${i}`;return _.fetchVtex(u,{method:"POST",body:{id:a},...r})}const dr=l.object({orderFormId:l.string().nullable()});async function pr({apiUrl:e,body:t,fetchOptions:r,extraData:n}){var c;if(!t){console.error("[ERROR FETCHING] Body is required");return}await dr.validate(t);const o=new URLSearchParams({refreshOutdatedData:"true"}),a=t.orderFormId&&((c=n.orderFormPurchaseId)==null?void 0:c.value)!==t.orderFormId?`${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(o)}`:`${e}/api/checkout/pub/orderForm`;return _.fetchVtex(a,{method:"GET",...r})}const fr=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 fr.validate(t);const{orderFormId:n,...o}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/clientProfileData`,{method:"POST",body:{...o},...r})}const mr=l.object({sellerCode:l.string().nullable()});async function gr({apiUrl:e,body:t,extraData:r,fetchOptions:n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await mr.validate(t);const{sellerCode:o=""}=t;return _.fetchVtex(`${e}/api/dataentities/${r.ENTITIES}/search?_fields=${r.FIELDS}&${r.FILTER}=${o}`,{method:"GET",headers:{Accept:"application/vnd.vtex.ds.v10+json"},...n})}const br=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 wr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await br.validate(t);const{country:n,orderFormId:o,postalCode:a}=t,c=a?{address:{addressType:"residential",postalCode:a,country:n}}:{logisticsInfo:[],clearAddressIfPostalCodeNotFound:!0};return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${o}/attachments/shippingData`,{method:"POST",body:c,...r})}const vr=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 yr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await vr.validate(t);const{orderFormId:n,options:o,selectedAddresses:a}=t;return _.fetchVtex(`${e}/api/checkout/pub/orderForm/${n}/attachments/shippingData`,{method:"POST",body:{selectedAddresses:a,clearAddressIfPostalCodeNotFound:!1,logisticsInfo:o},...r})}const _r=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 _r.validate(t);const{country:n="",geoCoordinates:o,postalCode:a=""}=t,c=new URLSearchParams({country:String(n)});return a?c.append("postalCode",a):c.append("geoCoordinates",`${o==null?void 0:o.longitude};${o==null?void 0:o.latitude}`),await _.fetchVtex(`${e}/api/checkout/pub/regions/?${c.toString()}`,{method:"GET",...r})}const Pr=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(Pr),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 Ir({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}return await Rr.validate(t),_.fetchVtex(`${e}/api/checkout/pub/orderForms/simulation`,{method:"POST",body:t,...r})}const Cr=Object.freeze(Object.defineProperty({__proto__:null,getMasterDataSellerCode:gr,getOrderForm:pr,postOrderFormAddCoupon:Qt,postOrderFormAttachClientProfileData:hr,postOrderFormAttachOrderFormData:Gt,postOrderFormAttachShippingData:wr,postOrderFormAttachmentsMarketingData:De,postOrderFormAttachmentsOpenTextField:Le,postOrderFormClearMessages:cr,postOrderFormFreightSimulation:Ir,postOrderFormItems:er,postOrderFormRegion:xr,postOrderFormRemoveAllItems:rr,postOrderFormUpdateItems:ar,postOrderFormUpdateShippingData:yr,postOrderformAddress:Ht,putOrderFormCustomData:Kt,updateOrderFormOffering:ur},Symbol.toStringTag,{value:"Module"})),Sr=l.object({skuId:l.string()});async function kr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Sr.validate(t);const{skuId:n}=t;return _.fetchVtex(`${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${n}`,{...r})}const Tr=l.object({ids:l.array().of(l.string().required("ID are required")).required("IDs are required")});async function Or({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Tr.validate(t);const{ids:n}=t;return _.fetchVtex(`${e}/api/catalog_system/pub/products/search?fq=${n.map(o=>`productId:${o}`).join("&fq=")}`,{...r})}const Er=l.object({productId:l.number().required("Product ID is required")});async function jr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Er.validate(t);const{productId:n}=t;return _.fetchVtex(`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`,{...r})}async function Ar({apiUrl:e,params:t,fetchOptions:r}){return t!=null&&t.slug?_.fetchVtex(`${e}/api/catalog_system/pub/portal/pagetype/${t.slug}`,{...r}):(console.error("[ERROR FETCHING] slug is required"),null)}const qr=Object.freeze(Object.defineProperty({__proto__:null,getCatalogKitProducts:kr,getCatalogPageInfo:Ar,getCatalogProducts:Or,getCatalogSimilars:jr},Symbol.toStringTag,{value:"Module"})),Nr=l.object({query:l.string()});async function Fr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Nr.validate(t);const{query:n=""}=t,o=new URLSearchParams({query:n});return _.fetchVtex(`${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${o.toString()}`,{...r})}const $r=(e,t)=>gt(e,t),Lr=e=>({...e,description:e.description?$r(e.description):e.description}),Dr=({offer:e,seller:t,product:r})=>({...e,product:r,seller:t}),Ue=(e,t)=>({...e,isVariantOf:Lr(t)}),Ur=e=>e?"https://schema.org/InStock":"https://schema.org/OutOfStock",oe=e=>e.AvailableQuantity>0,Ae=e=>e.spotPrice??0,Mr=e=>e.Price??0,Me=(e,t)=>oe(e)&&!oe(t)?-1:!oe(e)&&oe(t)?1:Ae(e)-Ae(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]},He=e=>{const t=e.flatMap(n=>n.sellers.map(o=>({offer:o.commertialOffer,sku:n}))),r=Hr(t,({offer:n},{offer:o})=>Me(n,o));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})),ie={attachment:"ATTACHMENT",specification:"SPECIFICATION",attribute:"ATTRIBUTE"},Br=e=>({name:e.name,value:e.content,valueReference:ie.attachment}),zr=e=>({propertyID:e.id,name:e.name,value:e.value,valueReference:{valueReference:ie.attribute,visible:e.visible}}),ae=(e,t,r)=>{const n=e.flatMap(({name:c,values:i})=>i?i.map(u=>({name:c,value:u,valueReference:ie.specification})):{name:c,value:"",valueReference:ie.specification}),o=Array.isArray(r)?r.map(Br):[],a=t?t.map(zr):[];return[...n,...o,...a]},qe="ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",Vr="AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa",Gr=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},Wr=e=>e.replace(/[·/_,:]/,"-"),ze=e=>{const r=e.replace(/,/g,"").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g,"-");return Wr(Gr(r)).toLowerCase()},Ve=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},o=e.map(a=>Dr({offer:a.commertialOffer,seller:a,product:t})).sort(Me).map(a=>(a.seller.sellerId==="1"&&a.AvailableQuantity>0&&(r.price=a.Price,r.listPrice=a.ListPrice,r.sellerDefault=!0),{availability:a.AvailableQuantity>0,listPrice:a.ListPrice,price:Mr(a),priceValidUntil:a.PriceValidUntil,priceCurrency:"BRL",installments:a.Installments,lowPrice:a.spotPrice,quantity:a.AvailableQuantity,seller:{identifier:a.seller.sellerId}}));return{lowPrice:r.sellerDefault?r.price:o[0].price,highPrice:r.sellerDefault?r.listPrice:o[0].listPrice,offers:o}},Qe=e=>{const{attributes:t,itemId:r,name:n,sellers:o,variations:a}=e;return{additionalProperty:ae(a,t,[]),name:n,offers:{offers:o==null?void 0:o.map(({sellerId:c,commertialOffer:i})=>({availability:Ur(i.AvailableQuantity>0),listPrice:i.ListPrice,price:i.Price,quantity:i.AvailableQuantity,seller:{identifier:c}}))},sku:r}},Qr=e=>{var R;const{attributes:t,referenceId:r,isVariantOf:n,images:o,itemId:a,name:c,sellers:i,videos:u,variations:g}=e,{brand:s,categories:d,categoriesIds:w,description:v,linkText:y,productClusters:P,clusterHighlights:p,productName:b,properties:f,productId:h,productReference:m}=n,T=d.slice().reverse(),A=We(i,e.isVariantOf),x=Ge(A.offers[0].installments);return{sku:a,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:u[0],categories:d,categoriesIds:w,id:h,brand:{name:s,brandName:s},seo:{description:v,title:b,canonical:Ve(y)},cluster:{generals:P,highlights:p},properties:f,availability:{status:A.offers[0].availability},breadcrumbList:{itemListElement:[...T.map((O,N)=>{const F=O.split("/"),L=F[F.length-2],D=F.map(ze).join("/");return{name:L,item:D,position:N+1}}),{name:n.productName,item:y,position:d.length+1}],numberOfItems:d.length},image:Be(o),offers:A,additionalProperty:ae(g,t,[]),isVariantOf:{productGroupID:n.productId,hasVariant:n.items.map(O=>Qe(O))},installments:x}},Xr=e=>{var x;const{attributes:t,referenceId:r,isVariantOf:n,images:o,itemId:a,name:c,sellers:i,Videos:u,variations:g}=e,{brand:s,categories:d,categoriesIds:w,description:v,linkText:y,productClusters:P,productName:p,Coleção:b,"ID Coleção":f,productId:h}=n,m=d.slice().reverse(),T=We(i,e.isVariantOf),A=Ge(T.offers[0].installments);return{sku:a,gtin:((x=r[0])==null?void 0:x.Value)??"",name:p??c,description:v,releaseDate:n.releaseDate??"",slug:y,video:u[0],categories:d,categoriesIds:w,collection:b,collectionId:f,id:h,brand:{name:s,brandName:s},seo:{description:v,title:p,canonical:Ve(y)},cluster:{generals:P,highlights:[]},availability:{status:T.offers[0].availability},breadcrumbList:{itemListElement:[...m.map((R,O)=>{const N=R.split("/"),F=N[N.length-2],L=N.map(ze).join("/");return{name:F,item:L,position:O+1}}),{name:n.productName,item:y,position:d.length+1}],numberOfItems:d.length},image:Be(o),offers:T,additionalProperty:ae(g,t,[]),isVariantOf:{productGroupID:n.productId,hasVariant:n.items.map(R=>{const{variations:O}=R,N=O.map(F=>({name:F,values:R[F]}));return{...Qe(R),additionalProperty:ae(N,t,[])}})},installments:A}},Kr=l.array().of(l.object({key:l.string().required(),value:l.string().required()})).required("Facets are required");async function Jr({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Kr.validate(t);const n=new URLSearchParams({}),o=t.map(({key:c,value:i})=>`${c}/${i}`).join("/");_.addSearchParamsFacets(t,n);const a=`${e}/api/catalog_system/pub/products/crossselling/${o}`;return _.fetchVtex(a,{cache:"no-store",...r}).then(c=>c.map(u=>{const g=He(u.items);return g&&Ue(g,u)}).filter(u=>!!u).map(u=>({node:Xr(u)})))}const Xe=({apiUrl:e,body:t,fetchOptions:r,extraData:n})=>{if(!t){console.error("[ERROR FETCHING] Body is required");return}const{query:o="",page:a=1,count:c,sort:i="",facets:u=[],type:g,hideUnavailableItems:s=!0,locale:d=""}=t,w=new URLSearchParams({page:a.toString(),count:(c==null?void 0:c.toString())??(n==null?void 0:n.ITEMS_PER_PAGE)??24,query:o,sort:i,locale:d});s!==void 0&&w.append("hideUnavailableItems",s.toString());const v=u.map(y=>`${y.key}/${y.value}`).join("/")??"";return _.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}),o=(n==null?void 0:n.products.map(i=>{const u=He(i.items);return u&&Ue(u,i)}).filter(i=>!!i))??[],{pagination:a,recordsFiltered:c}=n;return{data:{pagination:{nextPage:a.after.length>0,previousPage:a.before.length>0,startCursor:"0",endCursor:c.toString(),count:c,total:a.count},products:o.map((i,u)=>({node:Qr(i),cursor:u.toString()}))}}}async function Yr({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:_.formattedFacets(n,e==null?void 0:e.selectedFacets,(e==null?void 0:e.query)??"")}}}const en=l.object({query:l.string().optional(),locale:l.string().optional()});async function tn({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await en.validate(t);const{query:n="",locale:o="default_locale"}=t,a=new URLSearchParams({query:n,locale:o});return _.fetchVtex(`${e}/api/io/_v/api/intelligent-search/search_suggestions?${a.toString()}`,{...r})}async function rn({apiUrl:e}){return _.fetchVtex(`${e}/api/io/_v/api/intelligent-search/top_searches`)}const nn=Object.freeze(Object.defineProperty({__proto__:null,getSearchAutoCompleteSuggestions:Fr,getSearchCrossellingProducts:Jr,getSearchFacets:Yr,getSearchProducts:Zr,getSearchSuggestedTerms:tn,getSearchTopSearchs:rn},Symbol.toStringTag,{value:"Module"})),on=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 on.validate(t);const{masterDataEntity:n,payload:o}=t,a=`${e}/api/dataentities/${n}/documents`;return _.fetchVtex(a,{method:"POST",body:{payload:o},...r})}const sn=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()}),cn=l.object({masterDataEntity:l.string().required(),searchFields:sn,headers:l.object().shape({"REST-Range":l.string().notRequired()})});async function Ke({apiUrl:e,body:t,fetchOptions:r}){if(!t){console.error("[ERROR FETCHING] Body is required");return}const n=new URLSearchParams;await cn.validate(t);const{masterDataEntity:o,searchFields:a,headers:c}=t;a&&Object.entries(a).forEach(([g,s])=>{n.append(g,String(s))}),"_fields"in a||n==null||n.append("_fields","_all");let i=[],u=null;do{u&&n.set("_scroll",u);const g=await fetch(`${e}/api/dataentities/${o}/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();i.push(...s),u=g.headers.get("x-vtex-md-scroll")}while(u);return i}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:o,fieldsToBeUpdated:a}=t,c=`${e}/api/dataentities/${n}/documents/${o}`;return _.fetchVtex(c,{body:{fieldsToBeUpdated:a},method:"PATCH",...r})}const dn=Object.freeze(Object.defineProperty({__proto__:null,getSearchMasterdata:Ke,patchUpdateMasterdata:un,postMasterdata:an},Symbol.toStringTag,{value:"Module"}));async function pn({body:e,apiUrl:t,extraData:r,fetchOptions:n}){const{productIds:o}=e;if(!o)return console.error("[ERROR FETCHING] productIds is required"),[];const{NAME_SPLIT_SYMBOL:a}=r;if(!a)return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"),[];const c=o.map(s=>typeof s=="string"||typeof s=="number"?`productId:${s}`:"").join("&fq="),i=await _.fetchVtex(`${t}/api/catalog_system/pub/products/search?fq=${c}`,{...n}),u=s=>Object.keys(s).map(d=>({id:d,name:s[d]}));return i.map((s,d)=>{var h;const{installments:w,price:v,listPrice:y,sizes:P,allSizesAvailable:p}=_.getSkuInfos({items:s.items,NAME_SPLIT_SYMBOL:a}),b=p?!0:P.some(m=>m.available),f=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:u(s.productClusters),highlights:u(s.clusterHighlights)},availability:{status:b},image:s.items[0].images.map(({imageLabel:m,imageUrl:T})=>({alternateName:m,url:T,keywords:m})),offers:{lowPrice:v,highPrice:y,offers:[{availability:b,listPrice:y,price:v,priceValidUntil:f.PriceValidUntil,priceCurrency:"BRL",installments:f.Installments,lowPrice:v,quantity:f.AvailableQuantity,seller:{identifier:s.items[0].sellers[0].sellerId}}]},additionalProperty:(h=s==null?void 0:s.skuSpecifications)==null?void 0:h.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 T;return{additionalProperty:m==null?void 0:m.variations.map(()=>{var A,x,R;return{name:(A=m==null?void 0:m.variations)==null?void 0:A[0],value:(R=m==null?void 0:m[(x=m==null?void 0:m.variations)==null?void 0:x[0]])==null?void 0:R[0],valueReference:"SPECIFICATION"}}),name:m.name,offers:{offers:(T=m.sellers)==null?void 0:T.map(({commertialOffer:A,sellerId:x})=>({availability:"https://schema.org/InStock",listPrice:A.ListPrice,price:A.Price,quantity:A.AvailableQuantity,seller:{identifier:x}}))},sku:m.itemId,slug:`-${m.itemId}`}})},installments:w},cursor:d.toString()}})}const fn=Object.freeze(Object.defineProperty({__proto__:null,getWishlistProducts:pn},Symbol.toStringTag,{value:"Module"}));var ge={exports:{}},Je={},we={},Ze={},Ye={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathSuffix",{enumerable:!0,get:function(){return r}});const t=_.parsePath;function r(n,o){if(!n.startsWith("/")||!o)return n;const{pathname:a,query:c,hash:i}=(0,t.parsePath)(n);return""+a+o+c+i}})(Ye);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"formatNextPathnameInfo",{enumerable:!0,get:function(){return a}});const t=_.removeTrailingSlash,r=_.addPathPrefix,n=Ye,o=_.addLocale;function a(c){let i=(0,o.addLocale)(c.pathname,c.locale,c.buildId?void 0:c.defaultLocale,c.ignorePrefix);return(c.buildId||!c.trailingSlash)&&(i=(0,t.removeTrailingSlash)(i)),c.buildId&&(i=(0,n.addPathSuffix)((0,r.addPathPrefix)(i,"/_next/data/"+c.buildId),c.pathname==="/"?"index.json":".json")),i=(0,r.addPathPrefix)(i,c.basePath),!c.buildId&&c.trailingSlash?i.endsWith("/")?i:(0,n.addPathSuffix)(i,"/"):(0,t.removeTrailingSlash)(i)}})(Ze);var et={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getHostname",{enumerable:!0,get:function(){return t}});function t(r,n){let o;if(n!=null&&n.host&&!Array.isArray(n.host))o=n.host.toString().split(":",1)[0];else if(r.hostname)o=r.hostname;else return;return o.toLowerCase()}})(et);var tt={},rt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removePathPrefix",{enumerable:!0,get:function(){return r}});const t=_.pathHasPrefix;function r(n,o){if(!(0,t.pathHasPrefix)(n,o))return n;const a=n.slice(o.length);return a.startsWith("/")?a:"/"+a}})(rt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getNextPathnameInfo",{enumerable:!0,get:function(){return o}});const t=_.normalizeLocalePath,r=rt,n=_.pathHasPrefix;function o(a,c){var i;const{basePath:u,i18n:g,trailingSlash:s}=(i=c.nextConfig)!=null?i:{},d={pathname:a,trailingSlash:a!=="/"?a.endsWith("/"):s};u&&(0,n.pathHasPrefix)(d.pathname,u)&&(d.pathname=(0,r.removePathPrefix)(d.pathname,u),d.basePath=u);let w=d.pathname;if(d.pathname.startsWith("/_next/data/")&&d.pathname.endsWith(".json")){const y=d.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),P=y[0];d.buildId=P,w=y[1]!=="index"?"/"+y.slice(1).join("/"):"/",c.parseData===!0&&(d.pathname=w)}if(g){let y=c.i18nProvider?c.i18nProvider.analyze(d.pathname):(0,t.normalizeLocalePath)(d.pathname,g.locales);d.locale=y.detectedLocale;var v;d.pathname=(v=y.pathname)!=null?v:d.pathname,!y.detectedLocale&&d.buildId&&(y=c.i18nProvider?c.i18nProvider.analyze(w):(0,t.normalizeLocalePath)(w,g.locales),y.detectedLocale&&(d.locale=y.detectedLocale))}return d}})(tt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextURL",{enumerable:!0,get:function(){return u}});const t=_.detectDomainLocale,r=Ze,n=et,o=tt,a=/(?!^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(a,"localhost"),s&&String(s).replace(a,"localhost"))}const i=Symbol("NextURLInternal");class u{constructor(s,d,w){let v,y;typeof d=="object"&&"pathname"in d||typeof d=="string"?(v=d,y=w||{}):y=w||d||{},this[i]={url:c(s,v??y.base),options:y,basePath:""},this.analyze()}analyze(){var s,d,w,v,y;const P=(0,o.getNextPathnameInfo)(this[i].url.pathname,{nextConfig:this[i].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[i].options.i18nProvider}),p=(0,n.getHostname)(this[i].url,this[i].options.headers);this[i].domainLocale=this[i].options.i18nProvider?this[i].options.i18nProvider.detectDomainLocale(p):(0,t.detectDomainLocale)((d=this[i].options.nextConfig)==null||(s=d.i18n)==null?void 0:s.domains,p);const b=((w=this[i].domainLocale)==null?void 0:w.defaultLocale)||((y=this[i].options.nextConfig)==null||(v=y.i18n)==null?void 0:v.defaultLocale);this[i].url.pathname=P.pathname,this[i].defaultLocale=b,this[i].basePath=P.basePath??"",this[i].buildId=P.buildId,this[i].locale=P.locale??b,this[i].trailingSlash=P.trailingSlash}formatPathname(){return(0,r.formatNextPathnameInfo)({basePath:this[i].basePath,buildId:this[i].buildId,defaultLocale:this[i].options.forceLocale?void 0:this[i].defaultLocale,locale:this[i].locale,pathname:this[i].url.pathname,trailingSlash:this[i].trailingSlash})}formatSearch(){return this[i].url.search}get buildId(){return this[i].buildId}set buildId(s){this[i].buildId=s}get locale(){return this[i].locale??""}set locale(s){var d,w;if(!this[i].locale||!(!((w=this[i].options.nextConfig)==null||(d=w.i18n)==null)&&d.locales.includes(s)))throw new TypeError(`The NextURL configuration includes no locale "${s}"`);this[i].locale=s}get defaultLocale(){return this[i].defaultLocale}get domainLocale(){return this[i].domainLocale}get searchParams(){return this[i].url.searchParams}get host(){return this[i].url.host}set host(s){this[i].url.host=s}get hostname(){return this[i].url.hostname}set hostname(s){this[i].url.hostname=s}get port(){return this[i].url.port}set port(s){this[i].url.port=s}get protocol(){return this[i].url.protocol}set protocol(s){this[i].url.protocol=s}get href(){const s=this.formatPathname(),d=this.formatSearch();return`${this.protocol}//${this.host}${s}${d}${this.hash}`}set href(s){this[i].url=c(s),this.analyze()}get origin(){return this[i].url.origin}get pathname(){return this[i].url.pathname}set pathname(s){this[i].url.pathname=s}get hash(){return this[i].url.hash}set hash(s){this[i].url.hash=s}get search(){return this[i].url.search}set search(s){this[i].url.search=s}get password(){return this[i].url.password}set password(s){this[i].url.password=s}get username(){return this[i].url.username}set username(s){this[i].url.username=s}get basePath(){return this[i].basePath}set basePath(s){this[i].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 u(String(this),this[i].options)}}})(we);var ve={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,g){for(var s in g)Object.defineProperty(u,s,{enumerable:!0,get:g[s]})}t(e,{fromNodeOutgoingHttpHeaders:function(){return n},normalizeNextQueryParam:function(){return i},splitCookiesString:function(){return o},toNodeOutgoingHttpHeaders:function(){return a},validateURL:function(){return c}});const r=_.constants;function n(u){const g=new Headers;for(let[s,d]of Object.entries(u)){const w=Array.isArray(d)?d:[d];for(let v of w)typeof v>"u"||(typeof v=="number"&&(v=v.toString()),g.append(s,v))}return g}function o(u){var g=[],s=0,d,w,v,y,P;function p(){for(;s<u.length&&/\s/.test(u.charAt(s));)s+=1;return s<u.length}function b(){return w=u.charAt(s),w!=="="&&w!==";"&&w!==","}for(;s<u.length;){for(d=s,P=!1;p();)if(w=u.charAt(s),w===","){for(v=s,s+=1,p(),y=s;s<u.length&&b();)s+=1;s<u.length&&u.charAt(s)==="="?(P=!0,s=y,g.push(u.substring(d,v)),d=s):s=v+1}else s+=1;(!P||s>=u.length)&&g.push(u.substring(d,u.length))}return g}function a(u){const g={},s=[];if(u)for(const[d,w]of u.entries())d.toLowerCase()==="set-cookie"?(s.push(...o(w)),g[d]=s.length===1?s[0]:s):g[d]=w;return g}function c(u){try{return String(new URL(String(u)))}catch(g){throw new Error(`URL is malformed "${String(u)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:g})}}function i(u,g){const s=[r.NEXT_QUERY_PARAM_PREFIX,r.NEXT_INTERCEPTION_MARKER_PREFIX];for(const d of s)if(u!==d&&u.startsWith(d)){const w=u.substring(d.length);g(w)}}})(ve);var nt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(a,c){for(var i in c)Object.defineProperty(a,i,{enumerable:!0,get:c[i]})}t(e,{PageSignatureError:function(){return r},RemovedPageError:function(){return n},RemovedUAError:function(){return o}});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')
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
8
|
-
`)}}class n extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class o extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}})(nt);var se={},ye=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyNames,bn=Object.prototype.hasOwnProperty,wn=(e,t)=>{for(var r in t)ye(e,r,{get:t[r],enumerable:!0})},vn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gn(t))!bn.call(e,o)&&o!==r&&ye(e,o,{get:()=>t[o],enumerable:!(n=mn(t,o))||n.enumerable});return e},yn=e=>vn(ye({},"__esModule",{value:!0}),e),ot={};wn(ot,{RequestCookies:()=>kn,ResponseCookies:()=>Tn,parseCookie:()=>_e,parseSetCookie:()=>at,stringifyCookie:()=>X});var _n=yn(ot);function X(e){var t;const r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||e.expires===0)&&`Expires=${(typeof e.expires=="number"?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&typeof e.maxAge=="number"&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent((t=e.value)!=null?t:"")}`;return r.length===0?n:`${n}; ${r.join("; ")}`}function _e(e){const t=new Map;for(const r of e.split(/; */)){if(!r)continue;const n=r.indexOf("=");if(n===-1){t.set(r,"true");continue}const[o,i]=[r.slice(0,n),r.slice(n+1)];try{t.set(o,decodeURIComponent(i??"true"))}catch{}}return t}function at(e){if(!e)return;const[[t,r],...n]=_e(e),{domain:o,expires:i,httponly:c,maxage:a,path:u,samesite:g,secure:s,partitioned:d,priority:w}=Object.fromEntries(n.map(([y,P])=>[y.toLowerCase(),P])),v={name:t,value:decodeURIComponent(r),domain:o,...i&&{expires:new Date(i)},...c&&{httpOnly:!0},...typeof a=="string"&&{maxAge:Number(a)},path:u,...g&&{sameSite:In(g)},...s&&{secure:!0},...w&&{priority:Cn(w)},...d&&{partitioned:!0}};return xn(v)}function xn(e){const t={};for(const r in e)e[r]&&(t[r]=e[r]);return t}var Pn=["strict","lax","none"];function In(e){return e=e.toLowerCase(),Pn.includes(e)?e:void 0}var Rn=["low","medium","high"];function Cn(e){return e=e.toLowerCase(),Rn.includes(e)?e:void 0}function Sn(e){if(!e)return[];var t=[],r=0,n,o,i,c,a;function u(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function g(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,a=!1;u();)if(o=e.charAt(r),o===","){for(i=r,r+=1,u(),c=r;r<e.length&&g();)r+=1;r<e.length&&e.charAt(r)==="="?(a=!0,r=c,t.push(e.substring(n,i)),n=r):r=i+1}else r+=1;(!a||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var kn=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t){const r=_e(t);for(const[n,o]of r)this._parsed.set(n,{name:n,value:o})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){const t=typeof e[0]=="string"?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;const r=Array.from(this._parsed);if(!e.length)return r.map(([o,i])=>i);const n=typeof e[0]=="string"?e[0]:(t=e[0])==null?void 0:t.name;return r.filter(([o])=>o===n).map(([o,i])=>i)}has(e){return this._parsed.has(e)}set(...e){const[t,r]=e.length===1?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([o,i])=>X(i)).join("; ")),this}delete(e){const t=this._parsed,r=Array.isArray(e)?e.map(n=>t.delete(n)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([n,o])=>X(o)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},Tn=class{constructor(e){this._parsed=new Map;var t,r,n;this._headers=e;const o=(n=(r=(t=e.getSetCookie)==null?void 0:t.call(e))!=null?r:e.get("set-cookie"))!=null?n:[],i=Array.isArray(o)?o:Sn(o);for(const c of i){const a=at(c);a&&this._parsed.set(a.name,a)}}get(...e){const t=typeof e[0]=="string"?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;const r=Array.from(this._parsed.values());if(!e.length)return r;const n=typeof e[0]=="string"?e[0]:(t=e[0])==null?void 0:t.name;return r.filter(o=>o.name===n)}has(e){return this._parsed.has(e)}set(...e){const[t,r,n]=e.length===1?[e[0].name,e[0].value,e[0]]:e,o=this._parsed;return o.set(t,En({name:t,value:r,...n})),On(o,this._headers),this}delete(...e){const[t,r,n]=typeof e[0]=="string"?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:r,domain:n,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(X).join("; ")}};function On(e,t){t.delete("set-cookie");for(const[,r]of e){const n=X(r);t.append("set-cookie",n)}}function En(e={name:"",value:""}){return typeof e.expires=="number"&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+e.maxAge*1e3)),(e.path===null||e.path===void 0)&&(e.path="/"),e}(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(n,o){for(var i in o)Object.defineProperty(n,i,{enumerable:!0,get:o[i]})}t(e,{RequestCookies:function(){return r.RequestCookies},ResponseCookies:function(){return r.ResponseCookies},stringifyCookie:function(){return r.stringifyCookie}});const r=_n})(se);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,g){for(var s in g)Object.defineProperty(u,s,{enumerable:!0,get:g[s]})}t(e,{INTERNALS:function(){return c},NextRequest:function(){return a}});const r=we,n=ve,o=nt,i=se,c=Symbol("internal request");class a extends Request{constructor(g,s={}){const d=typeof g!="string"&&"url"in g?g.url:String(g);(0,n.validateURL)(d),g instanceof Request?super(g,s):super(d,s);const w=new r.NextURL(d,{headers:(0,n.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:s.nextConfig});this[c]={cookies:new i.RequestCookies(this.headers),geo:s.geo||{},ip:s.ip,nextUrl:w,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?d:w.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[c].cookies}get geo(){return this[c].geo}get ip(){return this[c].ip}get nextUrl(){return this[c].nextUrl}get page(){throw new o.RemovedPageError}get ua(){throw new o.RemovedUAError}get url(){return this[c].url}}})(Je);var it={},st={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ReflectAdapter",{enumerable:!0,get:function(){return t}});class t{static get(n,o,i){const c=Reflect.get(n,o,i);return typeof c=="function"?c.bind(n):c}static set(n,o,i,c){return Reflect.set(n,o,i,c)}static has(n,o){return Reflect.has(n,o)}static deleteProperty(n,o){return Reflect.deleteProperty(n,o)}}})(st);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextResponse",{enumerable:!0,get:function(){return g}});const t=se,r=we,n=ve,o=st,i=se,c=Symbol("internal response"),a=new Set([301,302,303,307,308]);function u(s,d){var w;if(!(s==null||(w=s.request)==null)&&w.headers){if(!(s.request.headers instanceof Headers))throw new Error("request.headers must be an instance of Headers");const v=[];for(const[y,P]of s.request.headers)d.set("x-middleware-request-"+y,P),v.push(y);d.set("x-middleware-override-headers",v.join(","))}}class g extends Response{constructor(d,w={}){super(d,w);const v=this.headers,y=new i.ResponseCookies(v),P=new Proxy(y,{get(p,b,f){switch(b){case"delete":case"set":return(...h)=>{const m=Reflect.apply(p[b],p,h),T=new Headers(v);return m instanceof i.ResponseCookies&&v.set("x-middleware-set-cookie",m.getAll().map(A=>(0,t.stringifyCookie)(A)).join(",")),u(w,T),m};default:return o.ReflectAdapter.get(p,b,f)}}});this[c]={cookies:P,url:w.url?new r.NextURL(w.url,{headers:(0,n.toNodeOutgoingHttpHeaders)(v),nextConfig:w.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[c].cookies}static json(d,w){const v=Response.json(d,w);return new g(v.body,v)}static redirect(d,w){const v=typeof w=="number"?w:(w==null?void 0:w.status)??307;if(!a.has(v))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');const y=typeof w=="object"?w:{},P=new Headers(y==null?void 0:y.headers);return P.set("Location",(0,n.validateURL)(d)),new g(null,{...y,headers:P,status:v})}static rewrite(d,w){const v=new Headers(w==null?void 0:w.headers);return v.set("x-middleware-rewrite",(0,n.validateURL)(d)),u(w,v),new g(null,{...w,headers:v})}static next(d){const w=new Headers(d==null?void 0:d.headers);return w.set("x-middleware-next","1"),u(d,w),new g(null,{...d,headers:w})}}})(it);var ct={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ImageResponse",{enumerable:!0,get:function(){return t}});function t(){throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}})(ct);var be={},lt={exports:{}};(()=>{var e={226:function(o,i){(function(c,a){var u="1.0.35",g="",s="?",d="function",w="undefined",v="object",y="string",P="major",p="model",b="name",f="type",h="vendor",m="version",T="architecture",A="console",x="mobile",I="tablet",O="smarttv",N="wearable",F="embedded",L=350,D="Amazon",H="Apple",K="ASUS",xe="BlackBerry",V="Browser",J="Chrome",dt="Edge",Z="Firefox",Y="Google",Pe="Huawei",ce="LG",le="Microsoft",Ie="Motorola",ee="Opera",ue="Samsung",Re="Sharp",te="Sony",de="Xiaomi",pe="Zebra",Ce="Facebook",Se="Chromium OS",ke="Mac OS",pt=function(k,j){var C={};for(var q in k)j[q]&&j[q].length%2===0?C[q]=j[q].concat(k[q]):C[q]=k[q];return C},re=function(k){for(var j={},C=0;C<k.length;C++)j[k[C].toUpperCase()]=k[C];return j},Te=function(k,j){return typeof k===y?W(j).indexOf(W(k))!==-1:!1},W=function(k){return k.toLowerCase()},ft=function(k){return typeof k===y?k.replace(/[^\d\.]/g,g).split(".")[0]:a},fe=function(k,j){if(typeof k===y)return k=k.replace(/^\s\s*/,g),typeof j===w?k:k.substring(0,L)},Q=function(k,j){for(var C=0,q,B,U,E,R,M;C<j.length&&!R;){var me=j[C],je=j[C+1];for(q=B=0;q<me.length&&!R&&me[q];)if(R=me[q++].exec(k),R)for(U=0;U<je.length;U++)M=R[++B],E=je[U],typeof E===v&&E.length>0?E.length===2?typeof E[1]==d?this[E[0]]=E[1].call(this,M):this[E[0]]=E[1]:E.length===3?typeof E[1]===d&&!(E[1].exec&&E[1].test)?this[E[0]]=M?E[1].call(this,M,E[2]):a:this[E[0]]=M?M.replace(E[1],E[2]):a:E.length===4&&(this[E[0]]=M?E[3].call(this,M.replace(E[1],E[2])):a):this[E]=M||a;C+=2}},he=function(k,j){for(var C in j)if(typeof j[C]===v&&j[C].length>0){for(var q=0;q<j[C].length;q++)if(Te(j[C][q],k))return C===s?a:C}else if(Te(j[C],k))return C===s?a:C;return k},ht={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Oe={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ee={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[b,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[b,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[b,m],[/opios[\/ ]+([\w\.]+)/i],[m,[b,ee+" Mini"]],[/\bopr\/([\w\.]+)/i],[m,[b,ee]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[b,m],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[b,"UC"+V]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[m,[b,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[m,[b,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[b,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[b,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[b,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[b,/(.+)/,"$1 Secure "+V],m],[/\bfocus\/([\w\.]+)/i],[m,[b,Z+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[b,ee+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[b,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[b,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[b,ee+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[b,"MIUI "+V]],[/fxios\/([-\w\.]+)/i],[m,[b,Z]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+V]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+V],m],[/(comodo_dragon)\/([\w\.]+)/i],[[b,/_/g," "],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[b,m],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[b],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[b,Ce],m],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[b,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[b,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[b,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[b,J+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,J+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[b,"Android "+V]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[b,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[b,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,b],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[b,[m,he,ht]],[/(webkit|khtml)\/([\w\.]+)/i],[b,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[b,Z+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[b,m],[/(cobalt)\/([\w\.]+)/i],[b,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[T,"amd64"]],[/(ia32(?=;))/i],[[T,W]],[/((?:i[346]|x)86)[;\)]/i],[[T,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[T,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[T,"armhf"]],[/windows (ce|mobile); ppc;/i],[[T,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[T,/ower/,g,W]],[/(sun4\w)[;\)]/i],[[T,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[T,W]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[h,ue],[f,I]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[h,ue],[f,x]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[h,H],[f,x]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[h,H],[f,I]],[/(macintosh);/i],[p,[h,H]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[h,Re],[f,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[h,Pe],[f,I]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[h,Pe],[f,x]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[h,de],[f,x]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[h,de],[f,I]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[h,"OPPO"],[f,x]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[h,"Vivo"],[f,x]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[p,[h,"Realme"],[f,x]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[h,Ie],[f,x]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[h,Ie],[f,I]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[h,ce],[f,I]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[h,ce],[f,x]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[h,"Lenovo"],[f,I]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[h,"Nokia"],[f,x]],[/(pixel c)\b/i],[p,[h,Y],[f,I]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[h,Y],[f,x]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[h,te],[f,x]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[h,te],[f,I]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[h,"OnePlus"],[f,x]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[h,D],[f,I]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[h,D],[f,x]],[/(playbook);[-\w\),; ]+(rim)/i],[p,h,[f,I]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[h,xe],[f,x]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[h,K],[f,I]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[h,K],[f,x]],[/(nexus 9)/i],[p,[h,"HTC"],[f,I]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[p,/_/g," "],[f,x]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[h,"Acer"],[f,I]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[h,"Meizu"],[f,x]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,p,[f,x]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,p,[f,I]],[/(surface duo)/i],[p,[h,le],[f,I]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[h,"Fairphone"],[f,x]],[/(u304aa)/i],[p,[h,"AT&T"],[f,x]],[/\bsie-(\w*)/i],[p,[h,"Siemens"],[f,x]],[/\b(rct\w+) b/i],[p,[h,"RCA"],[f,I]],[/\b(venue[\d ]{2,7}) b/i],[p,[h,"Dell"],[f,I]],[/\b(q(?:mv|ta)\w+) b/i],[p,[h,"Verizon"],[f,I]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[h,"Barnes & Noble"],[f,I]],[/\b(tm\d{3}\w+) b/i],[p,[h,"NuVision"],[f,I]],[/\b(k88) b/i],[p,[h,"ZTE"],[f,I]],[/\b(nx\d{3}j) b/i],[p,[h,"ZTE"],[f,x]],[/\b(gen\d{3}) b.+49h/i],[p,[h,"Swiss"],[f,x]],[/\b(zur\d{3}) b/i],[p,[h,"Swiss"],[f,I]],[/\b((zeki)?tb.*\b) b/i],[p,[h,"Zeki"],[f,I]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],p,[f,I]],[/\b(ns-?\w{0,9}) b/i],[p,[h,"Insignia"],[f,I]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[h,"NextBook"],[f,I]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],p,[f,x]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],p,[f,x]],[/\b(ph-1) /i],[p,[h,"Essential"],[f,x]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[h,"Envizen"],[f,I]],[/\b(trio[-\w\. ]+) b/i],[p,[h,"MachSpeed"],[f,I]],[/\btu_(1491) b/i],[p,[h,"Rotor"],[f,I]],[/(shield[\w ]+) b/i],[p,[h,"Nvidia"],[f,I]],[/(sprint) (\w+)/i],[h,p,[f,x]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[h,le],[f,x]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[h,pe],[f,I]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[h,pe],[f,x]],[/smart-tv.+(samsung)/i],[h,[f,O]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[h,ue],[f,O]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,ce],[f,O]],[/(apple) ?tv/i],[h,[p,H+" TV"],[f,O]],[/crkey/i],[[p,J+"cast"],[h,Y],[f,O]],[/droid.+aft(\w)( bui|\))/i],[p,[h,D],[f,O]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[h,Re],[f,O]],[/(bravia[\w ]+)( bui|\))/i],[p,[h,te],[f,O]],[/(mitv-\w{5}) bui/i],[p,[h,de],[f,O]],[/Hbbtv.*(technisat) (.*);/i],[h,p,[f,O]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,fe],[p,fe],[f,O]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,O]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,p,[f,A]],[/droid.+; (shield) bui/i],[p,[h,"Nvidia"],[f,A]],[/(playstation [345portablevi]+)/i],[p,[h,te],[f,A]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[h,le],[f,A]],[/((pebble))app/i],[h,p,[f,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[h,H],[f,N]],[/droid.+; (glass) \d/i],[p,[h,Y],[f,N]],[/droid.+; (wt63?0{2,3})\)/i],[p,[h,pe],[f,N]],[/(quest( 2| pro)?)/i],[p,[h,Ce],[f,N]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[f,F]],[/(aeobc)\b/i],[p,[h,D],[f,F]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[p,[f,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[f,I]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,I]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,x]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[b,dt+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[b,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[b,m],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,b]],os:[[/microsoft (windows) (vista|xp)/i],[b,m],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[b,[m,he,Oe]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[m,he,Oe]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[b,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[b,ke],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,b],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[b,m],[/\(bb(10);/i],[m,[b,xe]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[m,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[b,Z+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[b,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[b,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[b,J+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[b,Se],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[b,m],[/(sunos) ?([\w\.\d]*)/i],[[b,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[b,m]]},$=function(k,j){if(typeof k===v&&(j=k,k=a),!(this instanceof $))return new $(k,j).getResult();var C=typeof c!==w&&c.navigator?c.navigator:a,q=k||(C&&C.userAgent?C.userAgent:g),B=C&&C.userAgentData?C.userAgentData:a,U=j?pt(Ee,j):Ee,E=C&&C.userAgent==q;return this.getBrowser=function(){var R={};return R[b]=a,R[m]=a,Q.call(R,q,U.browser),R[P]=ft(R[m]),E&&C&&C.brave&&typeof C.brave.isBrave==d&&(R[b]="Brave"),R},this.getCPU=function(){var R={};return R[T]=a,Q.call(R,q,U.cpu),R},this.getDevice=function(){var R={};return R[h]=a,R[p]=a,R[f]=a,Q.call(R,q,U.device),E&&!R[f]&&B&&B.mobile&&(R[f]=x),E&&R[p]=="Macintosh"&&C&&typeof C.standalone!==w&&C.maxTouchPoints&&C.maxTouchPoints>2&&(R[p]="iPad",R[f]=I),R},this.getEngine=function(){var R={};return R[b]=a,R[m]=a,Q.call(R,q,U.engine),R},this.getOS=function(){var R={};return R[b]=a,R[m]=a,Q.call(R,q,U.os),E&&!R[b]&&B&&B.platform!="Unknown"&&(R[b]=B.platform.replace(/chrome os/i,Se).replace(/macos/i,ke)),R},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return q},this.setUA=function(R){return q=typeof R===y&&R.length>L?fe(R,L):R,this},this.setUA(q),this};$.VERSION=u,$.BROWSER=re([b,m,P]),$.CPU=re([T]),$.DEVICE=re([p,h,f,A,x,O,I,N,F]),$.ENGINE=$.OS=re([b,m]),typeof i!==w?(o.exports&&(i=o.exports=$),i.UAParser=$):typeof c!==w&&(c.UAParser=$);var G=typeof c!==w&&(c.jQuery||c.Zepto);if(G&&!G.ua){var ne=new $;G.ua=ne.getResult(),G.ua.get=function(){return ne.getUA()},G.ua.set=function(k){ne.setUA(k);var j=ne.getResult();for(var C in j)G.ua[C]=j[C]}}})(typeof window=="object"?window:this)}},t={};function r(o){var i=t[o];if(i!==void 0)return i.exports;var c=t[o]={exports:{}},a=!0;try{e[o].call(c.exports,c,c.exports,r),a=!1}finally{a&&delete t[o]}return c.exports}typeof r<"u"&&(r.ab=__dirname+"/");var n=r(226);lt.exports=n})();var jn=lt.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(a,u){for(var g in u)Object.defineProperty(a,g,{enumerable:!0,get:u[g]})}t(e,{isBot:function(){return o},userAgent:function(){return c},userAgentFromString:function(){return i}});const r=n(jn);function n(a){return a&&a.__esModule?a:{default:a}}function o(a){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(a)}function i(a){return{...(0,r.default)(a),isBot:a===void 0?!1:o(a)}}function c({headers:a}){return i(a.get("user-agent")||void 0)}})(be);var ut={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"URLPattern",{enumerable:!0,get:function(){return t}});const t=typeof URLPattern>"u"?void 0:URLPattern})(ut);(function(e,t){const r={NextRequest:Je.NextRequest,NextResponse:it.NextResponse,ImageResponse:ct.ImageResponse,userAgentFromString:be.userAgentFromString,userAgent:be.userAgent,URLPattern:ut.URLPattern};e.exports=r,t.NextRequest=r.NextRequest,t.NextResponse=r.NextResponse,t.ImageResponse=r.ImageResponse,t.userAgentFromString=r.userAgentFromString,t.userAgent=r.userAgent,t.URLPattern=r.URLPattern})(ge,ge.exports);var Ne=ge.exports;async function An({apiUrl:e,extraData:t,fetchOptions:r}){var x,I;const n=`${e}/api/dataentities`,o=`${e}/api/io/v1/extrato/get-total`,{MASTER_DATA_ENTITY:i,MASTER_DATA_FIELDS:c,AUTH_TOKEN_COOKIE:a,requestHeaders:u,cookies:g}=t,{address:s,client:d}=i,{address:w,client:v}=c,y=((x=g==null?void 0:g.find(O=>(O==null?void 0:O.name)===a))==null?void 0:x.value)||"";if(!y)return Ne.NextResponse.json({error:"Token not found. Unauthorized"},{status:200});const{sub:P,userId:p}=bt.decodeJwt(y),b=Object.fromEntries(Object.entries(u).map(([O,N])=>[O,String(N||"")])),f=async(O,N,F=!1)=>{try{const D=await fetch(`${F?o:n}${O}`,{headers:{...N,...r==null?void 0:r.headers}}).then(K=>K.json()),H=Array.isArray(D)?D[0]:D;return Array.isArray(H)?H[0]:H}catch(L){return console.error(`Erro no fetch: ${O}`,L),null}},h=await f(`/${d}/search?email=${P}&_fields=${v.join(",")}`,b);if(!(h!=null&&h.id))return Ne.NextResponse.json({sub:P},{status:200});const m=(I=h.document)==null?void 0:I.replace(/\D/g,""),T=await f(`/${s}/search?userId=${h.id}&_fields=${w.join(",")}&_sort=lastInteractionIn DESC`,{...b,"REST-Range":"resources=0-1000"}),A=m?await f(`/${m}?user_code=${h.userId},${P}&per_page=1&page=1`,b,!0):null;return{...h,...T,userCredits:A,sub:P,userId:p}}const qn=Object.freeze(Object.defineProperty({__proto__:null,getUserData:An},Symbol.toStringTag,{value:"Module"})),Nn=l.object({userName:l.string().optional(),email:l.string().optional(),sku:l.string().optional()});async function Fn({apiUrl:e,body:t}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await Nn.validate(t);const r=`https://${e}.myvtex.com/no-cache/AviseMe.aspx`,n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:`notifymeClientName=${t==null?void 0:t.userName}¬ifymeClientEmail=${t==null?void 0:t.email}¬ifymeIdSku=${t==null?void 0:t.sku}`}),o=await n.text;return{ok:n.ok,status:n.status,text:o}}const $n=Object.freeze(Object.defineProperty({__proto__:null,aviseMe:Fn},Symbol.toStringTag,{value:"Module"}));function Ln({platformCMS:e,request:t}){const{searchParams:r}=new URL(t.url),n=r.get("url")??"/",o=e==="vtex"?"draft":r.get("status");return e!=="vtex"&&r.get("secret")!==process.env.PREVIEW_SECRET?{error:!0}:{url:n,isDraft:o!=="published",previewData:e==="vtex"?{versionId:r.get("versionId")??"",releaseId:r.get("releaseId")??"",documentId:r.get("documentId")??"",contentType:r.get("contentType")??""}:null}}const Dn=Object.freeze(Object.defineProperty({__proto__:null,getCMSPreviewData:Ln},Symbol.toStringTag,{value:"Module"}));function Un(e){return{redirectTo:e.nextUrl.searchParams.get("redirect")??"/",clearCookies:["cms_preview_data"],disableDraft:!0}}const Mn=Object.freeze(Object.defineProperty({__proto__:null,getCMSPreviewExitData:Un},Symbol.toStringTag,{value:"Module"}));async function Hn({pathname:e}){return(await wt.get(`https://mariafilo.vtexcommercestable.com.br${e}`,{headers:{"Content-Type":"application/xml"}})).data.replace(/mariafilo.vtexcommercestable/g,"www.multimarcassoma")}const Bn=Object.freeze(Object.defineProperty({__proto__:null,getVtexXmlProxyData:Hn},Symbol.toStringTag,{value:"Module"})),zn=async e=>await fetch(e,{method:"POST",cache:"force-cache",headers:{Authorization:`Bearer ${process.env.ditoUser}:${process.env.ditoPassword}`}}).then(r=>r.json());function Vn(e){return e.type==="TRACK"}function Gn(e){const t={};for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}function Wn(e){var a,u;const t=((a=e["sec-ch-ua-platform"])==null?void 0:a.toLowerCase())||"",r=e["sec-ch-ua-mobile"],n=((u=e["user-agent"])==null?void 0:u.toLowerCase())||"";let o=r==="?1"?"Mobile":"Desktop";r||(o=/Mobi|Android|iPhone|iPad|iPod/i.test(n)?"Mobile":"Desktop");const i=/iphone|ipad|ipod/.test(n)||t.includes("ios")?"iOS":/android/.test(n)||t.includes("android")?"Android":"Desktop",c=/chrome/.test(n)&&!/edg|opr/.test(n)?"Chrome":/safari/.test(n)&&!/chrome/.test(n)?"Safari":/firefox/.test(n)?"Firefox":/edg/.test(n)?"Edge":"Other";return{platform_name:o,os_name:i,browser_name:c}}async function Qn({body:e,userToken:t,headers:r,dito:n,apiUrl:o}){var d,w;const i=Gn(r),c=await zn(n.authUrl),{platform_name:a,os_name:u,browser_name:g}=Wn(i),s=e.findIndex(({type:v})=>v==="IDENTIFY");if(s>=0&&t){const v=_.getAuthenticatedUser(t),y=e[s],P=await Ke({apiUrl:o,body:{masterDataEntity:"CL",searchFields:{_where:`email=${v.email||((d=y==null?void 0:y.traits)==null?void 0:d.email)}`},headers:{}},fetchOptions:{headers:i}}),p=Array.isArray(P)?P[0]:null;if(p!=null&&p.userId){const{gender:b,homePhone:f,birthDate:h,userId:m}=p,T=await fetch(`${o}/api/profile-system/pvt/profiles/${m}/addresses`,{headers:i}).then(I=>I.json()),A=(w=Object.keys(T))==null?void 0:w[0],x=A?JSON.parse(T[A]):null;y.traits={...y.traits,birthday:h==null?void 0:h.split("T")[0],gender:b,phone:f,address:{city:x==null?void 0:x.city,country:x==null?void 0:x.country,postal_code:x==null?void 0:x.postalCode,state:x==null?void 0:x.state,street:x==null?void 0:x.street}}}}return e.forEach(v=>{Vn(v)&&(v.properties.custom_data={platform_name:a,os_name:u,browser_name:g,authenticated:!!t,...v.properties.custom_data})}),fetch(n.ingestUrl,{method:"POST",headers:{Authorization:`Bearer ${c.token}`,brand:n.brandName},body:JSON.stringify(e)})}const Xn=Object.freeze(Object.defineProperty({__proto__:null,ditoIngestService:Qn},Symbol.toStringTag,{value:"Module"})),Kn={checkout:Sr,catalog:Nr,cms:_.cms,search:on,masterdata:pn,marketingdata:_.marketingdata,user:qn,aviseme:$n,preview:Dn,exitpreview:Mn,vtexXmlProxy:Bn,wishlist:{...hn},ditoIngestService:Xn},Jn={catalog:_.catalogHelpers,search:_.searchHelpers,product:_.productHelpers,cms:{..._.cmsHelpers,..._.cmsUtils}},Zn={template:{pdp:{}}};exports.serverAPIs=Kn;exports.serverCMS=Mt;exports.serverComponents=Zn;exports.serverHelpers=Jn;
|
|
8
|
+
`)}}class n extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class o extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}})(nt);var se={},ye=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,mn=Object.getOwnPropertyNames,gn=Object.prototype.hasOwnProperty,bn=(e,t)=>{for(var r in t)ye(e,r,{get:t[r],enumerable:!0})},wn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of mn(t))!gn.call(e,o)&&o!==r&&ye(e,o,{get:()=>t[o],enumerable:!(n=hn(t,o))||n.enumerable});return e},vn=e=>wn(ye({},"__esModule",{value:!0}),e),ot={};bn(ot,{RequestCookies:()=>Sn,ResponseCookies:()=>kn,parseCookie:()=>_e,parseSetCookie:()=>it,stringifyCookie:()=>X});var yn=vn(ot);function X(e){var t;const r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||e.expires===0)&&`Expires=${(typeof e.expires=="number"?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&typeof e.maxAge=="number"&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent((t=e.value)!=null?t:"")}`;return r.length===0?n:`${n}; ${r.join("; ")}`}function _e(e){const t=new Map;for(const r of e.split(/; */)){if(!r)continue;const n=r.indexOf("=");if(n===-1){t.set(r,"true");continue}const[o,a]=[r.slice(0,n),r.slice(n+1)];try{t.set(o,decodeURIComponent(a??"true"))}catch{}}return t}function it(e){if(!e)return;const[[t,r],...n]=_e(e),{domain:o,expires:a,httponly:c,maxage:i,path:u,samesite:g,secure:s,partitioned:d,priority:w}=Object.fromEntries(n.map(([y,P])=>[y.toLowerCase(),P])),v={name:t,value:decodeURIComponent(r),domain:o,...a&&{expires:new Date(a)},...c&&{httpOnly:!0},...typeof i=="string"&&{maxAge:Number(i)},path:u,...g&&{sameSite:Pn(g)},...s&&{secure:!0},...w&&{priority:In(w)},...d&&{partitioned:!0}};return _n(v)}function _n(e){const t={};for(const r in e)e[r]&&(t[r]=e[r]);return t}var xn=["strict","lax","none"];function Pn(e){return e=e.toLowerCase(),xn.includes(e)?e:void 0}var Rn=["low","medium","high"];function In(e){return e=e.toLowerCase(),Rn.includes(e)?e:void 0}function Cn(e){if(!e)return[];var t=[],r=0,n,o,a,c,i;function u(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function g(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,i=!1;u();)if(o=e.charAt(r),o===","){for(a=r,r+=1,u(),c=r;r<e.length&&g();)r+=1;r<e.length&&e.charAt(r)==="="?(i=!0,r=c,t.push(e.substring(n,a)),n=r):r=a+1}else r+=1;(!i||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var Sn=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t){const r=_e(t);for(const[n,o]of r)this._parsed.set(n,{name:n,value:o})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){const t=typeof e[0]=="string"?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;const r=Array.from(this._parsed);if(!e.length)return r.map(([o,a])=>a);const n=typeof e[0]=="string"?e[0]:(t=e[0])==null?void 0:t.name;return r.filter(([o])=>o===n).map(([o,a])=>a)}has(e){return this._parsed.has(e)}set(...e){const[t,r]=e.length===1?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([o,a])=>X(a)).join("; ")),this}delete(e){const t=this._parsed,r=Array.isArray(e)?e.map(n=>t.delete(n)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([n,o])=>X(o)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},kn=class{constructor(e){this._parsed=new Map;var t,r,n;this._headers=e;const o=(n=(r=(t=e.getSetCookie)==null?void 0:t.call(e))!=null?r:e.get("set-cookie"))!=null?n:[],a=Array.isArray(o)?o:Cn(o);for(const c of a){const i=it(c);i&&this._parsed.set(i.name,i)}}get(...e){const t=typeof e[0]=="string"?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;const r=Array.from(this._parsed.values());if(!e.length)return r;const n=typeof e[0]=="string"?e[0]:(t=e[0])==null?void 0:t.name;return r.filter(o=>o.name===n)}has(e){return this._parsed.has(e)}set(...e){const[t,r,n]=e.length===1?[e[0].name,e[0].value,e[0]]:e,o=this._parsed;return o.set(t,On({name:t,value:r,...n})),Tn(o,this._headers),this}delete(...e){const[t,r,n]=typeof e[0]=="string"?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:r,domain:n,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(X).join("; ")}};function Tn(e,t){t.delete("set-cookie");for(const[,r]of e){const n=X(r);t.append("set-cookie",n)}}function On(e={name:"",value:""}){return typeof e.expires=="number"&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+e.maxAge*1e3)),(e.path===null||e.path===void 0)&&(e.path="/"),e}(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(n,o){for(var a in o)Object.defineProperty(n,a,{enumerable:!0,get:o[a]})}t(e,{RequestCookies:function(){return r.RequestCookies},ResponseCookies:function(){return r.ResponseCookies},stringifyCookie:function(){return r.stringifyCookie}});const r=yn})(se);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,g){for(var s in g)Object.defineProperty(u,s,{enumerable:!0,get:g[s]})}t(e,{INTERNALS:function(){return c},NextRequest:function(){return i}});const r=we,n=ve,o=nt,a=se,c=Symbol("internal request");class i extends Request{constructor(g,s={}){const d=typeof g!="string"&&"url"in g?g.url:String(g);(0,n.validateURL)(d),g instanceof Request?super(g,s):super(d,s);const w=new r.NextURL(d,{headers:(0,n.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:s.nextConfig});this[c]={cookies:new a.RequestCookies(this.headers),geo:s.geo||{},ip:s.ip,nextUrl:w,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?d:w.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[c].cookies}get geo(){return this[c].geo}get ip(){return this[c].ip}get nextUrl(){return this[c].nextUrl}get page(){throw new o.RemovedPageError}get ua(){throw new o.RemovedUAError}get url(){return this[c].url}}})(Je);var at={},st={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ReflectAdapter",{enumerable:!0,get:function(){return t}});class t{static get(n,o,a){const c=Reflect.get(n,o,a);return typeof c=="function"?c.bind(n):c}static set(n,o,a,c){return Reflect.set(n,o,a,c)}static has(n,o){return Reflect.has(n,o)}static deleteProperty(n,o){return Reflect.deleteProperty(n,o)}}})(st);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextResponse",{enumerable:!0,get:function(){return g}});const t=se,r=we,n=ve,o=st,a=se,c=Symbol("internal response"),i=new Set([301,302,303,307,308]);function u(s,d){var w;if(!(s==null||(w=s.request)==null)&&w.headers){if(!(s.request.headers instanceof Headers))throw new Error("request.headers must be an instance of Headers");const v=[];for(const[y,P]of s.request.headers)d.set("x-middleware-request-"+y,P),v.push(y);d.set("x-middleware-override-headers",v.join(","))}}class g extends Response{constructor(d,w={}){super(d,w);const v=this.headers,y=new a.ResponseCookies(v),P=new Proxy(y,{get(p,b,f){switch(b){case"delete":case"set":return(...h)=>{const m=Reflect.apply(p[b],p,h),T=new Headers(v);return m instanceof a.ResponseCookies&&v.set("x-middleware-set-cookie",m.getAll().map(A=>(0,t.stringifyCookie)(A)).join(",")),u(w,T),m};default:return o.ReflectAdapter.get(p,b,f)}}});this[c]={cookies:P,url:w.url?new r.NextURL(w.url,{headers:(0,n.toNodeOutgoingHttpHeaders)(v),nextConfig:w.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[c].cookies}static json(d,w){const v=Response.json(d,w);return new g(v.body,v)}static redirect(d,w){const v=typeof w=="number"?w:(w==null?void 0:w.status)??307;if(!i.has(v))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');const y=typeof w=="object"?w:{},P=new Headers(y==null?void 0:y.headers);return P.set("Location",(0,n.validateURL)(d)),new g(null,{...y,headers:P,status:v})}static rewrite(d,w){const v=new Headers(w==null?void 0:w.headers);return v.set("x-middleware-rewrite",(0,n.validateURL)(d)),u(w,v),new g(null,{...w,headers:v})}static next(d){const w=new Headers(d==null?void 0:d.headers);return w.set("x-middleware-next","1"),u(d,w),new g(null,{...d,headers:w})}}})(at);var ct={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ImageResponse",{enumerable:!0,get:function(){return t}});function t(){throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}})(ct);var be={},lt={exports:{}};(()=>{var e={226:function(o,a){(function(c,i){var u="1.0.35",g="",s="?",d="function",w="undefined",v="object",y="string",P="major",p="model",b="name",f="type",h="vendor",m="version",T="architecture",A="console",x="mobile",R="tablet",O="smarttv",N="wearable",F="embedded",L=350,D="Amazon",H="Apple",K="ASUS",xe="BlackBerry",V="Browser",J="Chrome",dt="Edge",Z="Firefox",Y="Google",Pe="Huawei",ce="LG",le="Microsoft",Re="Motorola",ee="Opera",ue="Samsung",Ie="Sharp",te="Sony",de="Xiaomi",pe="Zebra",Ce="Facebook",Se="Chromium OS",ke="Mac OS",pt=function(k,j){var C={};for(var q in k)j[q]&&j[q].length%2===0?C[q]=j[q].concat(k[q]):C[q]=k[q];return C},re=function(k){for(var j={},C=0;C<k.length;C++)j[k[C].toUpperCase()]=k[C];return j},Te=function(k,j){return typeof k===y?W(j).indexOf(W(k))!==-1:!1},W=function(k){return k.toLowerCase()},ft=function(k){return typeof k===y?k.replace(/[^\d\.]/g,g).split(".")[0]:i},fe=function(k,j){if(typeof k===y)return k=k.replace(/^\s\s*/,g),typeof j===w?k:k.substring(0,L)},Q=function(k,j){for(var C=0,q,B,U,E,I,M;C<j.length&&!I;){var me=j[C],je=j[C+1];for(q=B=0;q<me.length&&!I&&me[q];)if(I=me[q++].exec(k),I)for(U=0;U<je.length;U++)M=I[++B],E=je[U],typeof E===v&&E.length>0?E.length===2?typeof E[1]==d?this[E[0]]=E[1].call(this,M):this[E[0]]=E[1]:E.length===3?typeof E[1]===d&&!(E[1].exec&&E[1].test)?this[E[0]]=M?E[1].call(this,M,E[2]):i:this[E[0]]=M?M.replace(E[1],E[2]):i:E.length===4&&(this[E[0]]=M?E[3].call(this,M.replace(E[1],E[2])):i):this[E]=M||i;C+=2}},he=function(k,j){for(var C in j)if(typeof j[C]===v&&j[C].length>0){for(var q=0;q<j[C].length;q++)if(Te(j[C][q],k))return C===s?i:C}else if(Te(j[C],k))return C===s?i:C;return k},ht={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Oe={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ee={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[b,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[b,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[b,m],[/opios[\/ ]+([\w\.]+)/i],[m,[b,ee+" Mini"]],[/\bopr\/([\w\.]+)/i],[m,[b,ee]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[b,m],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[b,"UC"+V]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[m,[b,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[m,[b,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[b,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[b,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[b,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[b,/(.+)/,"$1 Secure "+V],m],[/\bfocus\/([\w\.]+)/i],[m,[b,Z+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[b,ee+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[b,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[b,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[b,ee+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[b,"MIUI "+V]],[/fxios\/([-\w\.]+)/i],[m,[b,Z]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+V]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+V],m],[/(comodo_dragon)\/([\w\.]+)/i],[[b,/_/g," "],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[b,m],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[b],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[b,Ce],m],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[b,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[b,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[b,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[b,J+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,J+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[b,"Android "+V]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[b,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[b,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,b],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[b,[m,he,ht]],[/(webkit|khtml)\/([\w\.]+)/i],[b,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[b,Z+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[b,m],[/(cobalt)\/([\w\.]+)/i],[b,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[T,"amd64"]],[/(ia32(?=;))/i],[[T,W]],[/((?:i[346]|x)86)[;\)]/i],[[T,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[T,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[T,"armhf"]],[/windows (ce|mobile); ppc;/i],[[T,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[T,/ower/,g,W]],[/(sun4\w)[;\)]/i],[[T,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[T,W]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[h,ue],[f,R]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[h,ue],[f,x]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[h,H],[f,x]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[h,H],[f,R]],[/(macintosh);/i],[p,[h,H]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[h,Ie],[f,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[h,Pe],[f,R]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[h,Pe],[f,x]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[h,de],[f,x]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[h,de],[f,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[h,"OPPO"],[f,x]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[h,"Vivo"],[f,x]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[p,[h,"Realme"],[f,x]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[h,Re],[f,x]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[h,Re],[f,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[h,ce],[f,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[h,ce],[f,x]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[h,"Lenovo"],[f,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[h,"Nokia"],[f,x]],[/(pixel c)\b/i],[p,[h,Y],[f,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[h,Y],[f,x]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[h,te],[f,x]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[h,te],[f,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[h,"OnePlus"],[f,x]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[h,D],[f,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[h,D],[f,x]],[/(playbook);[-\w\),; ]+(rim)/i],[p,h,[f,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[h,xe],[f,x]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[h,K],[f,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[h,K],[f,x]],[/(nexus 9)/i],[p,[h,"HTC"],[f,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[p,/_/g," "],[f,x]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[h,"Acer"],[f,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[h,"Meizu"],[f,x]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,p,[f,x]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,p,[f,R]],[/(surface duo)/i],[p,[h,le],[f,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[h,"Fairphone"],[f,x]],[/(u304aa)/i],[p,[h,"AT&T"],[f,x]],[/\bsie-(\w*)/i],[p,[h,"Siemens"],[f,x]],[/\b(rct\w+) b/i],[p,[h,"RCA"],[f,R]],[/\b(venue[\d ]{2,7}) b/i],[p,[h,"Dell"],[f,R]],[/\b(q(?:mv|ta)\w+) b/i],[p,[h,"Verizon"],[f,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[h,"Barnes & Noble"],[f,R]],[/\b(tm\d{3}\w+) b/i],[p,[h,"NuVision"],[f,R]],[/\b(k88) b/i],[p,[h,"ZTE"],[f,R]],[/\b(nx\d{3}j) b/i],[p,[h,"ZTE"],[f,x]],[/\b(gen\d{3}) b.+49h/i],[p,[h,"Swiss"],[f,x]],[/\b(zur\d{3}) b/i],[p,[h,"Swiss"],[f,R]],[/\b((zeki)?tb.*\b) b/i],[p,[h,"Zeki"],[f,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],p,[f,R]],[/\b(ns-?\w{0,9}) b/i],[p,[h,"Insignia"],[f,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[h,"NextBook"],[f,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],p,[f,x]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],p,[f,x]],[/\b(ph-1) /i],[p,[h,"Essential"],[f,x]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[h,"Envizen"],[f,R]],[/\b(trio[-\w\. ]+) b/i],[p,[h,"MachSpeed"],[f,R]],[/\btu_(1491) b/i],[p,[h,"Rotor"],[f,R]],[/(shield[\w ]+) b/i],[p,[h,"Nvidia"],[f,R]],[/(sprint) (\w+)/i],[h,p,[f,x]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[h,le],[f,x]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[h,pe],[f,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[h,pe],[f,x]],[/smart-tv.+(samsung)/i],[h,[f,O]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[h,ue],[f,O]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,ce],[f,O]],[/(apple) ?tv/i],[h,[p,H+" TV"],[f,O]],[/crkey/i],[[p,J+"cast"],[h,Y],[f,O]],[/droid.+aft(\w)( bui|\))/i],[p,[h,D],[f,O]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[h,Ie],[f,O]],[/(bravia[\w ]+)( bui|\))/i],[p,[h,te],[f,O]],[/(mitv-\w{5}) bui/i],[p,[h,de],[f,O]],[/Hbbtv.*(technisat) (.*);/i],[h,p,[f,O]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,fe],[p,fe],[f,O]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,O]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,p,[f,A]],[/droid.+; (shield) bui/i],[p,[h,"Nvidia"],[f,A]],[/(playstation [345portablevi]+)/i],[p,[h,te],[f,A]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[h,le],[f,A]],[/((pebble))app/i],[h,p,[f,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[h,H],[f,N]],[/droid.+; (glass) \d/i],[p,[h,Y],[f,N]],[/droid.+; (wt63?0{2,3})\)/i],[p,[h,pe],[f,N]],[/(quest( 2| pro)?)/i],[p,[h,Ce],[f,N]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[f,F]],[/(aeobc)\b/i],[p,[h,D],[f,F]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[p,[f,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[f,R]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,R]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,x]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[b,dt+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[b,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[b,m],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,b]],os:[[/microsoft (windows) (vista|xp)/i],[b,m],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[b,[m,he,Oe]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[m,he,Oe]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[b,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[b,ke],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,b],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[b,m],[/\(bb(10);/i],[m,[b,xe]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[m,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[b,Z+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[b,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[b,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[b,J+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[b,Se],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[b,m],[/(sunos) ?([\w\.\d]*)/i],[[b,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[b,m]]},$=function(k,j){if(typeof k===v&&(j=k,k=i),!(this instanceof $))return new $(k,j).getResult();var C=typeof c!==w&&c.navigator?c.navigator:i,q=k||(C&&C.userAgent?C.userAgent:g),B=C&&C.userAgentData?C.userAgentData:i,U=j?pt(Ee,j):Ee,E=C&&C.userAgent==q;return this.getBrowser=function(){var I={};return I[b]=i,I[m]=i,Q.call(I,q,U.browser),I[P]=ft(I[m]),E&&C&&C.brave&&typeof C.brave.isBrave==d&&(I[b]="Brave"),I},this.getCPU=function(){var I={};return I[T]=i,Q.call(I,q,U.cpu),I},this.getDevice=function(){var I={};return I[h]=i,I[p]=i,I[f]=i,Q.call(I,q,U.device),E&&!I[f]&&B&&B.mobile&&(I[f]=x),E&&I[p]=="Macintosh"&&C&&typeof C.standalone!==w&&C.maxTouchPoints&&C.maxTouchPoints>2&&(I[p]="iPad",I[f]=R),I},this.getEngine=function(){var I={};return I[b]=i,I[m]=i,Q.call(I,q,U.engine),I},this.getOS=function(){var I={};return I[b]=i,I[m]=i,Q.call(I,q,U.os),E&&!I[b]&&B&&B.platform!="Unknown"&&(I[b]=B.platform.replace(/chrome os/i,Se).replace(/macos/i,ke)),I},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return q},this.setUA=function(I){return q=typeof I===y&&I.length>L?fe(I,L):I,this},this.setUA(q),this};$.VERSION=u,$.BROWSER=re([b,m,P]),$.CPU=re([T]),$.DEVICE=re([p,h,f,A,x,O,R,N,F]),$.ENGINE=$.OS=re([b,m]),typeof a!==w?(o.exports&&(a=o.exports=$),a.UAParser=$):typeof c!==w&&(c.UAParser=$);var G=typeof c!==w&&(c.jQuery||c.Zepto);if(G&&!G.ua){var ne=new $;G.ua=ne.getResult(),G.ua.get=function(){return ne.getUA()},G.ua.set=function(k){ne.setUA(k);var j=ne.getResult();for(var C in j)G.ua[C]=j[C]}}})(typeof window=="object"?window:this)}},t={};function r(o){var a=t[o];if(a!==void 0)return a.exports;var c=t[o]={exports:{}},i=!0;try{e[o].call(c.exports,c,c.exports,r),i=!1}finally{i&&delete t[o]}return c.exports}typeof r<"u"&&(r.ab=__dirname+"/");var n=r(226);lt.exports=n})();var En=lt.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(i,u){for(var g in u)Object.defineProperty(i,g,{enumerable:!0,get:u[g]})}t(e,{isBot:function(){return o},userAgent:function(){return c},userAgentFromString:function(){return a}});const r=n(En);function n(i){return i&&i.__esModule?i:{default:i}}function o(i){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(i)}function a(i){return{...(0,r.default)(i),isBot:i===void 0?!1:o(i)}}function c({headers:i}){return a(i.get("user-agent")||void 0)}})(be);var ut={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"URLPattern",{enumerable:!0,get:function(){return t}});const t=typeof URLPattern>"u"?void 0:URLPattern})(ut);(function(e,t){const r={NextRequest:Je.NextRequest,NextResponse:at.NextResponse,ImageResponse:ct.ImageResponse,userAgentFromString:be.userAgentFromString,userAgent:be.userAgent,URLPattern:ut.URLPattern};e.exports=r,t.NextRequest=r.NextRequest,t.NextResponse=r.NextResponse,t.ImageResponse=r.ImageResponse,t.userAgentFromString=r.userAgentFromString,t.userAgent=r.userAgent,t.URLPattern=r.URLPattern})(ge,ge.exports);var Ne=ge.exports;async function jn({apiUrl:e,extraData:t,fetchOptions:r}){var x,R;const n=`${e}/api/dataentities`,o=`${e}/api/io/v1/extrato/get-total`,{MASTER_DATA_ENTITY:a,MASTER_DATA_FIELDS:c,AUTH_TOKEN_COOKIE:i,requestHeaders:u,cookies:g}=t,{address:s,client:d}=a,{address:w,client:v}=c,y=((x=g==null?void 0:g.find(O=>(O==null?void 0:O.name)===i))==null?void 0:x.value)||"";if(!y)return Ne.NextResponse.json({error:"Token not found. Unauthorized"},{status:200});const{sub:P,userId:p}=bt.decodeJwt(y),b=Object.fromEntries(Object.entries(u).map(([O,N])=>[O,String(N||"")])),f=async(O,N,F=!1)=>{try{const D=await fetch(`${F?o:n}${O}`,{headers:{...N,...r==null?void 0:r.headers}}).then(K=>K.json()),H=Array.isArray(D)?D[0]:D;return Array.isArray(H)?H[0]:H}catch(L){return console.error(`Erro no fetch: ${O}`,L),null}},h=await f(`/${d}/search?email=${P}&_fields=${v.join(",")}`,b);if(!(h!=null&&h.id))return Ne.NextResponse.json({sub:P},{status:200});const m=(R=h.document)==null?void 0:R.replace(/\D/g,""),T=await f(`/${s}/search?userId=${h.id}&_fields=${w.join(",")}&_sort=lastInteractionIn DESC`,{...b,"REST-Range":"resources=0-1000"}),A=m?await f(`/${m}?user_code=${h.userId},${P}&per_page=1&page=1`,b,!0):null;return{...h,...T,userCredits:A,sub:P,userId:p}}const An=Object.freeze(Object.defineProperty({__proto__:null,getUserData:jn},Symbol.toStringTag,{value:"Module"})),qn=l.object({userName:l.string().optional(),email:l.string().optional(),sku:l.string().optional()});async function Nn({apiUrl:e,body:t}){if(!t){console.error("[ERROR FETCHING] Body is required");return}await qn.validate(t);const r=`https://${e}.myvtex.com/no-cache/AviseMe.aspx`,n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:`notifymeClientName=${t==null?void 0:t.userName}¬ifymeClientEmail=${t==null?void 0:t.email}¬ifymeIdSku=${t==null?void 0:t.sku}`}),o=await n.text;return{ok:n.ok,status:n.status,text:o}}const Fn=Object.freeze(Object.defineProperty({__proto__:null,aviseMe:Nn},Symbol.toStringTag,{value:"Module"}));function $n({platformCMS:e,request:t}){const{searchParams:r}=new URL(t.url),n=r.get("url")??"/",o=e==="vtex"?"draft":r.get("status");return e!=="vtex"&&r.get("secret")!==process.env.PREVIEW_SECRET?{error:!0}:{url:n,isDraft:o!=="published",previewData:e==="vtex"?{versionId:r.get("versionId")??"",releaseId:r.get("releaseId")??"",documentId:r.get("documentId")??"",contentType:r.get("contentType")??""}:null}}const Ln=Object.freeze(Object.defineProperty({__proto__:null,getCMSPreviewData:$n},Symbol.toStringTag,{value:"Module"}));function Dn(e){return{redirectTo:e.nextUrl.searchParams.get("redirect")??"/",clearCookies:["cms_preview_data"],disableDraft:!0}}const Un=Object.freeze(Object.defineProperty({__proto__:null,getCMSPreviewExitData:Dn},Symbol.toStringTag,{value:"Module"}));async function Mn({pathname:e,apiUrl:t,siteHost:r}){const n=await fetch(`${t}${e}`,{headers:{"Content-Type":"application/xml"}}),o=new URL(t).hostname;return(await n.text()).replaceAll(o,r)}const Hn=Object.freeze(Object.defineProperty({__proto__:null,getVtexXmlProxyData:Mn},Symbol.toStringTag,{value:"Module"})),Bn=async e=>await fetch(e,{method:"POST",cache:"force-cache",headers:{Authorization:`Bearer ${process.env.ditoUser}:${process.env.ditoPassword}`}}).then(r=>r.json());function zn(e){return e.type==="TRACK"}function Vn(e){const t={};for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}function Gn(e){var i,u;const t=((i=e["sec-ch-ua-platform"])==null?void 0:i.toLowerCase())||"",r=e["sec-ch-ua-mobile"],n=((u=e["user-agent"])==null?void 0:u.toLowerCase())||"";let o=r==="?1"?"Mobile":"Desktop";r||(o=/Mobi|Android|iPhone|iPad|iPod/i.test(n)?"Mobile":"Desktop");const a=/iphone|ipad|ipod/.test(n)||t.includes("ios")?"iOS":/android/.test(n)||t.includes("android")?"Android":"Desktop",c=/chrome/.test(n)&&!/edg|opr/.test(n)?"Chrome":/safari/.test(n)&&!/chrome/.test(n)?"Safari":/firefox/.test(n)?"Firefox":/edg/.test(n)?"Edge":"Other";return{platform_name:o,os_name:a,browser_name:c}}async function Wn({body:e,userToken:t,headers:r,dito:n,apiUrl:o}){var d,w;const a=Vn(r),c=await Bn(n.authUrl),{platform_name:i,os_name:u,browser_name:g}=Gn(a),s=e.findIndex(({type:v})=>v==="IDENTIFY");if(s>=0&&t){const v=_.getAuthenticatedUser(t),y=e[s],P=await Ke({apiUrl:o,body:{masterDataEntity:"CL",searchFields:{_where:`email=${v.email||((d=y==null?void 0:y.traits)==null?void 0:d.email)}`},headers:{}},fetchOptions:{headers:a}}),p=Array.isArray(P)?P[0]:null;if(p!=null&&p.userId){const{gender:b,homePhone:f,birthDate:h,userId:m}=p,T=await fetch(`${o}/api/profile-system/pvt/profiles/${m}/addresses`,{headers:a}).then(R=>R.json()),A=(w=Object.keys(T))==null?void 0:w[0],x=A?JSON.parse(T[A]):null;y.traits={...y.traits,birthday:h==null?void 0:h.split("T")[0],gender:b,phone:f,address:{city:x==null?void 0:x.city,country:x==null?void 0:x.country,postal_code:x==null?void 0:x.postalCode,state:x==null?void 0:x.state,street:x==null?void 0:x.street}}}}return e.forEach(v=>{zn(v)&&(v.properties.custom_data={platform_name:i,os_name:u,browser_name:g,authenticated:!!t,...v.properties.custom_data})}),fetch(n.ingestUrl,{method:"POST",headers:{Authorization:`Bearer ${c.token}`,brand:n.brandName},body:JSON.stringify(e)})}const Qn=Object.freeze(Object.defineProperty({__proto__:null,ditoIngestService:Wn},Symbol.toStringTag,{value:"Module"})),Xn={checkout:Cr,catalog:qr,cms:_.cms,search:nn,masterdata:dn,marketingdata:_.marketingdata,user:An,aviseme:Fn,preview:Ln,exitpreview:Un,vtexXmlProxy:Hn,wishlist:{...fn},ditoIngestService:Qn},Kn={catalog:_.catalogHelpers,search:_.searchHelpers,product:_.productHelpers,cms:{..._.cmsHelpers,..._.cmsUtils}},Jn={template:{pdp:{}}};exports.serverAPIs=Xn;exports.serverCMS=Ut;exports.serverComponents=Jn;exports.serverHelpers=Kn;
|