enqueueScripts([function(){ (window.webpackJsonpvtex_order_manager_0_12_0=window.webpackJsonpvtex_order_manager_0_12_0||[]).push([["OrderForm"],[function(e,r){e.exports=React},,function(e,r,t){"use strict";var u;t.r(r),t.d(r,"QueueStatus",(function(){return u})),t.d(r,"TASK_CANCELLED_CODE",(function(){return n})),t.d(r,"UNSYNC_ORDER_FORM_VALUE",(function(){return o})),t.d(r,"DEFAULT_ORDER_FORM",(function(){return a})),function(e){e.PENDING="Pending",e.FULFILLED="Fulfilled"}(u||(u={}));var n="TASK_CANCELLED",o=-1,a={id:"default-order-form",items:[],value:o,totalizers:[],marketingData:{},canEditData:!1,loggedIn:!1,paymentData:{isValid:!1,installmentOptions:[],paymentSystems:[],payments:[],availableAccounts:[]},messages:{couponMessages:[],generalMessages:[]},shipping:{isValid:!1,deliveryOptions:[],pickupOptions:[]}};r.default={QueueStatus:u,TASK_CANCELLED_CODE:n}},,function(e,r,t){"use strict";t.r(r);var u=t(1);t.d(r,"OrderQueueProvider",(function(){return u.b})),t.d(r,"useOrderQueue",(function(){return u.e})),t.d(r,"useQueueStatus",(function(){return u.f}));var n=t(2);t.d(r,"QueueStatus",(function(){return n.QueueStatus})),r.default={OrderQueueProvider:u.b,useOrderQueue:u.e,useQueueStatus:u.f,QueueStatus:n.QueueStatus}},,,function(e,r){e.exports=ReactApollo},,function(e,r){e.exports=__RENDER_8_COMPONENTS__["vtex.checkout-resources@0.x/QueryOrderForm"]},function(e,r){e.exports=__RENDER_8_COMPONENTS__["vtex.checkout-resources@0.x/MutationClearOrderFormMessages"]},function(e,r){e.exports=__RENDER_8_RUNTIME__},function(e,r){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ToastContext"]},function(e,r){e.exports=__RENDER_8_COMPONENTS__["vtex.checkout-splunk@0.x/useSplunk"]},,function(e,r,t){"use strict";t.r(r),function(e){var r=t(3);t.p=Object(r.getPublicPath)("vtex.order-manager@0.12.0");var u=Object(r.register)((function(){return t(16)}),e,"vtex.order-manager@0.12.0","vtex.order-manager@0.x","OrderForm");u.renderHotReload,u.setupHMR}.call(this,t(5)(e))},function(e,r,t){"use strict";t.r(r),t.d(r,"OrderFormProvider",(function(){return b}));var u=t(6),n=t.n(u),o=t(8),a=t(14),s=t(0),c=t(7),i=t(9),d=t.n(i),f=t(10),l=t.n(f),O=t(11),_=t(12),p=t.n(_),v=t(1);t.d(r,"useOrderForm",(function(){return v.d}));var m=t(13),E=t.n(m),g=t(4);var b=Object(v.c)({defaultOrderForm:v.a,useGetOrderForm:function(e){var r=e.setOrderForm,t=Object(O.useRuntime)(),u=t.page,n=t.query,o=u.includes("checkout"),a=Object(s.useRef)({refreshOutdatedData:o,orderFormId:null==n?void 0:n.orderFormId}),i=Object(c.useQuery)(d.a,{ssr:!1,fetchPolicy:"no-cache",variables:a.current}),f=i.data,l=i.loading,_=i.error,p=i.refetch,v=Object(g.useOrderQueue)().enqueue,m=Object(g.useQueueStatus)();return Object(s.useEffect)((function(){o&&v((function(){return p({refreshOutdatedData:!0}).then((function(e){return e.data.orderForm}))})).then((function(e){m.current===g.QueueStatus.FULFILLED&&r(e)}))}),[v,p,o,r,m]),Object(s.useMemo)((function(){return{data:f,loading:l,error:_}}),[f,l,_])},useClearOrderFormMessages:function(){var e=Object(c.useMutation)(l.a),r=Object(a.a)(e,1)[0];return Object(s.useCallback)(function(){var e=Object(o.a)(n.a.mark((function e(t){var u,o;return n.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r({variables:t});case 2:return u=e.sent,o=u.data,e.abrupt("return",{data:null==o?void 0:o.clearOrderFormMessages});case 5:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[r])},useToast:function(){return Object(s.useContext)(p.a)},useLogger:function(){var e=E()().logSplunk;return{log:Object(s.useCallback)((function(r){var t=r.type,u=r.level,n=r.event,o=r.workflowType,a=r.workflowInstance;e({type:t,level:u,event:n,workflowType:o,workflowInstance:a})}),[e])}}}).OrderFormProvider;r.default={OrderFormProvider:b,useOrderForm:v.d}},function(e,r){e.exports=regeneratorRuntime}],[[15,"common",0]]]); },function(){ (window.webpackJsonpvtex_order_manager_0_12_0=window.webpackJsonpvtex_order_manager_0_12_0||[]).push([["OrderQueue"],{0:function(e,t){e.exports=React},2:function(e,t,u){"use strict";var r;u.r(t),u.d(t,"QueueStatus",(function(){return r})),u.d(t,"TASK_CANCELLED_CODE",(function(){return n})),u.d(t,"UNSYNC_ORDER_FORM_VALUE",(function(){return a})),u.d(t,"DEFAULT_ORDER_FORM",(function(){return s})),function(e){e.PENDING="Pending",e.FULFILLED="Fulfilled"}(r||(r={}));var n="TASK_CANCELLED",a=-1,s={id:"default-order-form",items:[],value:a,totalizers:[],marketingData:{},canEditData:!1,loggedIn:!1,paymentData:{isValid:!1,installmentOptions:[],paymentSystems:[],payments:[],availableAccounts:[]},messages:{couponMessages:[],generalMessages:[]},shipping:{isValid:!1,deliveryOptions:[],pickupOptions:[]}};t.default={QueueStatus:r,TASK_CANCELLED_CODE:n}},21:function(e,t,u){"use strict";u.r(t),function(e){var t=u(3);u.p=Object(t.getPublicPath)("vtex.order-manager@0.12.0");var r=Object(t.register)((function(){return u(4)}),e,"vtex.order-manager@0.12.0","vtex.order-manager@0.x","OrderQueue");r.renderHotReload,r.setupHMR}.call(this,u(5)(e))},4:function(e,t,u){"use strict";u.r(t);var r=u(1);u.d(t,"OrderQueueProvider",(function(){return r.b})),u.d(t,"useOrderQueue",(function(){return r.e})),u.d(t,"useQueueStatus",(function(){return r.f}));var n=u(2);u.d(t,"QueueStatus",(function(){return n.QueueStatus})),t.default={OrderQueueProvider:r.b,useOrderQueue:r.e,useQueueStatus:r.f,QueueStatus:n.QueueStatus}}},[[21,"common",0]]]); },function(){ !function(e){function n(n){for(var r,c,u=n[0],a=n[1],l=n[2],w=0,f=[];w0}));return Boolean(t)},hasMoreSellersThan:function(e){var n=e.values,t=e.args,r=n.sellers,l=null==r?void 0:r.filter((function(e){return e.commertialOffer.AvailableQuantity>0}));return(null==l?void 0:l.length)>(null==t?void 0:t.quantity)},hasBestPrice:function(e){var n,t,r,l=e.values,i=e.args,u=(null!==(t=null===(n=l.sellers)||void 0===n?void 0:n.find((function(e){return e.sellerDefault})))&&void 0!==t?t:l.sellers[0]).commertialOffer;return u.ListPrice!==u.Price===(null===(r=null==i?void 0:i.value)||void 0===r||r)},sellerId:function(e){var n=e.values,t=e.args,r=n.sellers,l=null==r?void 0:r.filter((function(e){return e.commertialOffer.AvailableQuantity>0}));return null==l?void 0:l.some((function(e){var n;return null===(n=null==t?void 0:t.ids)||void 0===n?void 0:n.includes(e.sellerId)}))}},d=function(e){var n,t=e.Else,i=e.Then,d=e.matchType,c=e.conditions,s=e.children,v=null!==(n=u()())&&void 0!==n?n:{},f=v.product,g=v.selectedItem,p=v.skuSelector,m=(p=void 0===p?{}:p).areAllVariationsSelected,y=void 0!==m&&m,I=null!=f?f:{},h=I.productId,S=I.categoryId,_=I.brandId,b=I.productClusters,T=I.categoryTree,P=I.properties,x=null!=g?g:{},E=x.itemId,A=x.sellers,O=Object(r.useMemo)((function(){return{productId:h,categoryId:S,brandId:_,productClusters:b,categoryTree:T,selectedItemId:E,specificationProperties:P,areAllVariationsSelected:y,sellers:A}}),[_,S,T,b,h,E,P,y,A]);return null==O.selectedItemId||null==O.productId?null:l.a.createElement(o.default,{Else:t,Then:i,matchType:d,conditions:c,values:O,handlers:a},s)};d.schema={title:"admin/editor.condition-layout.wrapper.product"},n.default=d}],[[12,"common"]]]); },function(){ !function(t){function e(e){for(var r,u,a=e[0],c=e[1],l=e[2],s=0,d=[];st.length)&&(e=t.length);for(var n=0,r=new Array(e);n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"Profile")},,,,function(e,i,n){e.exports={iconSize:"vtex-wish-list-1-x-iconSize",fill:"vtex-wish-list-1-x-fill",outline:"vtex-wish-list-1-x-outline",clearLink:"vtex-wish-list-1-x-clearLink"}},,,,,,,,function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/ProductContext"]},function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ToastContext"]},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CheckItem"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"productId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sku"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"checkList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"productId"},value:{kind:"Variable",name:{kind:"Name",value:"productId"}}},{kind:"Argument",name:{kind:"Name",value:"sku"},value:{kind:"Variable",name:{kind:"Name",value:"sku"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"b83f1b8b01e40466f97a33cbb1c32b980a4c715f4e567fb79efe5c3d2ed34baf",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"inList"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"listNames"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"listIds"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:344}};n.loc.source={body:'query CheckItem($shopperId: String!, $productId: String!, $sku: String) @context(sender: "vtex.wish-list@1.18.2") {\n checkList(shopperId: $shopperId, productId: $productId, sku: $sku) @runtimeMeta(hash: "b83f1b8b01e40466f97a33cbb1c32b980a4c715f4e567fb79efe5c3d2ed34baf") {\n inList\n listNames\n listIds\n message\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"CheckItem")},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddToList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"listItem"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ListItemInputType"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"996e55ed3e6fe9d4195c58f9491c5687226a5094396638fa88944a113ebc67ed",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addToList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"listItem"},value:{kind:"Variable",name:{kind:"Name",value:"listItem"}}},{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[]}]}}],loc:{start:0,end:289}};n.loc.source={body:'mutation AddToList($listItem: ListItemInputType!, $shopperId: String!, $name: String!) @context(sender: "vtex.wish-list@1.18.2") @runtimeMeta(hash: "996e55ed3e6fe9d4195c58f9491c5687226a5094396638fa88944a113ebc67ed") {\n addToList(listItem: $listItem, shopperId: $shopperId, name: $name)\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"AddToList")},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RemoveFromList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"9aed358e26ce21ab217ccc495a954aca608506e22f2d2d06af6051874cda8f6e",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"removeFromList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[]}]}}],loc:{start:0,end:265}};n.loc.source={body:'mutation RemoveFromList($shopperId: String!, $id: ID!, $name: String) @context(sender: "vtex.wish-list@1.18.2") @runtimeMeta(hash: "9aed358e26ce21ab217ccc495a954aca608506e22f2d2d06af6051874cda8f6e") {\n removeFromList(id: $id, shopperId: $shopperId, name: $name)\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"RemoveFromList")},,,,,,,,,,,,,,,,,,function(e,i,n){"use strict";n.r(i),function(e){var i=n(2);n.p=Object(i.getPublicPath)("vtex.wish-list@1.18.2");var t=Object(i.register)((function(){return n(48)}),e,"vtex.wish-list@1.18.2","vtex.wish-list@1.x","AddProductBtn");t.renderHotReload,t.setupHMR}.call(this,n(6)(e))},function(e,i,n){"use strict";n.r(i);var t,a,d,o,s=n(1),r=n(0),l=n.n(r),u=n(3),c=n(4),m=n(24),v=n.n(m),f=n(25),k=n.n(f),p=n(26),h=n.n(p),g=n(5),b=n(8),N=n.n(b),S=n(9),I=n.n(S),w=n(10),_=n(11),y=n(27),x=n.n(y),E=n(28),O=n.n(E),D=n(12),L=n.n(D),T=n(29),V=n.n(T),A=n(16),P=n.n(A),R=Object(_.a)((function(){return sessionStorage})),j=["wishlistIconContainer","wishlistIcon"],F=null!==(t=JSON.parse(String(R.getItem("wishlist_isAuthenticated"))))&&void 0!==t&&t,C=null!==(a=R.getItem("wishlist_shopperId"))&&void 0!==a?a:null,M=null!==(d=R.getItem("wishlist_addAfterLogin"))&&void 0!==d?d:null,$=null!==(o=JSON.parse(R.getItem("wishlist_wishlisted")))&&void 0!==o?o:[],q={},W="Wishlist",z=Object(c.defineMessages)({addButton:{id:"store/wishlist.addButton"},seeLists:{id:"store/wishlist-see-lists"},productAddedToList:{id:"store/wishlist-product-added-to-list"},addProductFail:{id:"store/wishlist-add-product-fail"},listNameDefault:{id:"store/wishlist-default-list-name"},login:{id:"store/wishlist-login"},notLogged:{id:"store/wishlist-not-logged"}}),J=function(e,i){void 0===$.find((function(n){return n.productId&&n.sku&&n.productId===e&&n.sku===i}))&&$.push({productId:e,sku:i}),Q($)},Q=function(e){return R.setItem("wishlist_wishlisted",JSON.stringify(e)),e};i.default=function(e){var i,n,t,a,d,o,m,f,p,b,S,_,y,E,D,T,A,B,G,U=e.toastURL,H=void 0===U?"/account/#wishlist":U,K=Object(c.useIntl)(),X=Object(r.useState)({isLoading:!0,isWishlistPage:null}),Y=Object(s.a)(X,2),Z=Y[0],ee=Y[1],ie=Object(u.useMutation)(V.a,{onCompleted:function(){var e=String(ke.productId).split("-"),i=Object(s.a)(e,1)[0];q[i]&&(q[i]={isWishlisted:!1,wishListId:"",sku:""}),$=$.filter((function(e){return e.productId!==i&&e.sku!==Ee})),Q($),ee(Object.assign(Object.assign({},Z),{isWishlistPage:!1}))}}),ne=Object(s.a)(ie,2),te=ne[0],ae=ne[1].loading,de=Object(g.useRuntime)(),oe=de.navigate,se=de.history,re=de.route,le=de.account,ue=I()().push,ce=N()(j),me=Object(r.useContext)(h.a).showToast,ve=Object(r.useContext)(v.a),fe=ve.selectedItem,ke=ve.product,pe=(D=Object(r.useState)(),T=Object(s.a)(D,2),A=T[0],B=T[1],G=Object(w.a)(),Object(r.useEffect)((function(){G&&G.then((function(e){var i=e.response;B(i)}))}),[G]),A),he=Object(u.useLazyQuery)(x.a),ge=Object(s.a)(he,2),be=ge[0],Ne=ge[1],Se=Ne.data,Ie=Ne.loading,we=Ne.called,_e=Object(u.useQuery)(L.a,{ssr:!1}).data,ye=String(null==ke?void 0:ke.productId).split("-"),xe=Object(s.a)(ye,1)[0],Ee=null===(i=null==ke?void 0:ke.sku)||void 0===i?void 0:i.itemId;$=null!==(n=JSON.parse(R.getItem("wishlist_wishlisted")))&&void 0!==n?n:[];var Oe=function(e,i){var n;"notLogged"===e&&(n={label:K.formatMessage(z.login),onClick:function(){var e,i;return oe({page:"store.login",query:"returnUrl=".concat(encodeURIComponent(String(null===(e=null==se?void 0:se.location)||void 0===e?void 0:e.pathname)+String(null===(i=null==se?void 0:se.location)||void 0===i?void 0:i.search)))})}}),"productAddedToList"===e&&(n={label:K.formatMessage(z.seeLists),onClick:function(){return oe({to:i,fetchPage:!0})}}),me({message:K.formatMessage(z[e]),action:n})},De=Object(u.useMutation)(O.a,{onCompleted:function(e){q[xe]={wishListId:e.addToList,isWishlisted:!0,sku:Ee},J(xe,Ee),Oe("productAddedToList",H)}}),Le=Object(s.a)(De,2),Te=Le[0],Ve=Le[1],Ae=Ve.loading;Ve.error&&Oe("addProductFail",H),pe&&(F="true"===(null===(d=null===(a=null===(t=null==pe?void 0:pe.namespaces)||void 0===t?void 0:t.profile)||void 0===a?void 0:a.isAuthenticated)||void 0===d?void 0:d.value),C=(null===(o=null==_e?void 0:_e.profile)||void 0===o?void 0:o.pii)?null!==(y=null===(_=null===(S=null===(b=null==pe?void 0:pe.namespaces)||void 0===b?void 0:b.profile)||void 0===S?void 0:S.id)||void 0===_?void 0:_.value)&&void 0!==y?y:null:null===(p=null===(f=null===(m=null==pe?void 0:pe.namespaces)||void 0===m?void 0:m.profile)||void 0===f?void 0:f.email)||void 0===p?void 0:p.value,R.setItem("wishlist_isAuthenticated",JSON.stringify(F)),R.setItem("wishlist_shopperId",String(C)),F||C||R.getItem("wishlist_wishlisted")&&R.removeItem("wishlist_wishlisted"));var Pe=Z.isWishlistPage;if(!ke)return null;null===Pe&&(null==ke?void 0:ke.wishlistPage)&&ee(Object.assign(Object.assign({},Z),{isWishlistPage:!0}));F&&ke&&!we&&C&&(F&&M&&M===xe?(Te({variables:{listItem:{productId:xe,title:ke.productName,sku:fe.itemId},shopperId:C,name:W}}),M=null,R.removeItem("wishlist_addAfterLogin")):be({variables:{shopperId:String(C),productId:xe,sku:Ee}}));var Re,je,Fe,Ce=function(){var e,i,n;return"false"!==(null===(n=null===(i=null===(e=null==pe?void 0:pe.namespaces)||void 0===e?void 0:e.profile)||void 0===i?void 0:i.isAuthenticated)||void 0===n?void 0:n.value)&&void 0!==$.find((function(e){return e.productId===xe}))};if((null===(E=null==Se?void 0:Se.checkList)||void 0===E?void 0:E.inList)&&(!q[xe]||null===q[xe].wishListId)){var Me=(Re=W,je=Se.checkList,Fe=je.listNames.findIndex((function(e){return Re===e})),je.listIds[Fe]);q[xe]={isWishlisted:Se.checkList.inList,wishListId:Me,sku:Ee},Se.checkList.inList&&void 0===$.find((function(e){return e.productId===xe&&e.sku===Ee}))&&xe&&Ee&&J(xe,Ee)}return(null==Se?void 0:Se.checkList)&&!0!==Se.checkList.inList&&void 0===q[xe]&&void 0!==$.find((function(e){return e.productId===xe&&e.sku===Ee}))&&($=$.filter((function(e){return e.productId!==xe&&e.sku!==Ee})),Q($),ee(Object.assign(Object.assign({},Z),{isWishlistPage:!1}))),l.a.createElement(g.NoSSR,null,l.a.createElement("div",{className:ce.wishlistIconContainer},l.a.createElement(k.a,{variation:"tertiary",onClick:function(e){var i;if(e.preventDefault(),e.stopPropagation(),F){var n={list:null===(i=null==re?void 0:re.canonicalPath)||void 0===i?void 0:i.replace("/",""),items:{product:ke,selectedItem:fe,account:le}};Ce()&&C?(te({variables:{id:q[xe].wishListId,shopperId:C,name:W}}),n.event="removeToWishlist"):(Te({variables:{listItem:{productId:xe,title:ke.productName,sku:fe.itemId},shopperId:C,name:W}}),n.event="addToWishlist"),ue(n)}else R.setItem("wishlist_addAfterLogin",String(xe)),Oe("notLogged",H)},isLoading:Ie||Ae||ae},l.a.createElement("span",{className:"".concat(ce.wishlistIcon," ").concat(Ce()?P.a.fill:P.a.outline," ").concat(P.a.iconSize)}))))}}],[[47,"common"]]]); },function(){ !function(e){function t(t){for(var n,u,a=t[0],c=t[1],l=t[2],f=0,s=[];fe.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r>8&255]>10&&(i[r]=n),n},function(t,r,e){return e?t(r,e):new n(r,null)},function(t,r,e){var i;if(r<4352||4371<=r&&r<44032||55204=55296&&t<=56319},n.isLowSurrogate=function(t){return t>=56320&&t<=57343},n.prototype.prepFeature=function(){this.feature||(this.feature=n.fromCharCode(this.codepoint,!0).feature)},n.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var t=this.codepoint-65536;return String.fromCharCode(Math.floor(t/1024)+55296,t%1024+56320)},n.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},n.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},n.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},n.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},n.prototype.getComposite=function(t){if(this.prepFeature(),!this.feature[2])return null;var r=this.feature[2][t.codepoint];return r?n.fromCharCode(r):null};var f=function(t){this.str=t,this.cursor=0};f.prototype.next=function(){if(this.str&&this.cursor0;--e){if(this.resBuf[e-1].getCanonicalClass()<=t)break}this.resBuf.splice(e,0,r)}while(0!==t);return this.resBuf.shift()};var c=function(t){this.it=t,this.procBuf=[],this.resBuf=[],this.lastClass=null};c.prototype.next=function(){for(;0===this.resBuf.length;){var t=this.it.next();if(!t){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=t.getCanonicalClass(),this.procBuf.push(t);else{var r=this.procBuf[0].getComposite(t),e=t.getCanonicalClass();r&&(this.lastClasst.length)&&(e=t.length);for(var n=0,r=new Array(e);n");return e},c=function(e){var t=e.value,n=e.children;return o.a.createElement(a.Provider,{value:t},n)};t.default={DrawerContextProvider:c,useDrawer:i}},,function(e,t){e.exports=ReactDOM},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/applyModifiers"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconClose"]},function(e,t,n){"use strict";n.r(t);var r=n(7),o=n.n(r),a=n(4);t.default=function(e){var t,n=e.children,r=null===(t=null===window||void 0===window?void 0:window.document)||void 0===t?void 0:t.body,i=Object(a.useSSR)();return!r||i?null:o.a.createPortal(n,r)}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(2),i=n.n(a),c=n(8),s=n.n(c),l=["overlay"],u=function(e,t){var n=e.visible,r=e.onClick,a=e.zIndex,c=void 0===a?999:a,u=i()(l),d=n?"false":"true";return o.a.createElement("div",{ref:t,"aria-hidden":d,role:"presentation",onClick:r,style:{opacity:n?.5:0,pointerEvents:n?"auto":"none",zIndex:c},className:"".concat(s()(u.overlay,n?"visible":"")," bg-base--inverted z-999 fixed top-0 bottom-0 left-0 right-0")})};t.default=o.a.forwardRef(u)},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(2),i=n.n(a),c=n(9),s=n.n(c),l=n(5),u=["closeIconButton"];t.default=function(e){var t=e.size,n=void 0===t?30:t,r=e.type,a=void 0===r?"line":r,c=e.text,d=Object(l.useDrawer)().close,f=i()(u);return o.a.createElement("button",{className:"".concat(f.closeIconButton," pa4 pointer bg-transparent transparent bn pointer"),onClick:d},null!=c?c:o.a.createElement(s.a,{size:n,type:a}))}},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/usePixelEventCallback"]},,,,function(e,t){e.exports=ReactIntl},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconMenu"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.responsive-values@0.x/useResponsiveValue"]},,,,,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(1);n.p=Object(t.getPublicPath)("vtex.store-drawer@0.18.1");var r=Object(t.register)((function(){return n(36)}),e,"vtex.store-drawer@0.18.1","vtex.store-drawer@0.x","Drawer");r.renderHotReload,r.setupHMR}.call(this,n(6)(e))},,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(15),o=n(16),a=n(3),i=n(0),c=n.n(i),s=n(17),l=n(18),u=n.n(l),d=n(2),f=n.n(d),v=n(4),p=n(13),b=n.n(p),m=n(19),x=n.n(m),O=n(10),w=n(11),_=function(){var e=Object(i.useState)(!1),t=Object(a.a)(e,2),n=t[0],r=t[1],o=Object(i.useRef)("");return Object(i.useEffect)((function(){return n&&(o.current=document.body.style.overflow),document.body.style.overflow=n?"hidden":o.current,function(){n&&(document.body.style.overflow=o.current)}}),[n]),r},E=n(12),h=n(5);function g(e){return"tagName"in e}function N(e,t){if(!e||!g(e))return!1;if("A"===String(e.tagName).toUpperCase())return!0;var n=e.parentNode;return!(!n||!g(n)||"BODY"===n.tagName.toUpperCase()||t&&n===t)&&N(n,t)}var C=c.a.lazy((function(){return n.e(0).then(n.bind(null,35))})),j={isOpen:!1,hasBeenOpened:!1};function R(e,t){switch(t.type){case"open":return Object.assign(Object.assign({},e),{isOpen:!0,hasBeenOpened:!0});case"close":return Object.assign(Object.assign({},e),{isOpen:!1});default:return e}}var y=["openIconContainer","drawer","opened","closed","moving","drawerContent","childrenContainer","closeIconContainer"];function D(e){var t,n,s,l,d,p,m=e.width,g=e.header,D=e.children,I=e.customIcon,M=e.isFullWidth,P=e.maxWidth,S=void 0===P?450:P,k=e.slideDirection,z=void 0===k?"horizontal":k,B=e.backdropMode,T=void 0===B?"visible":B,W=e.renderingStrategy,U=void 0===W?"lazy":W,F=e.customPixelEventId,H=e.customPixelEventName,J=e.onVisibilityChanged,V=e.zIndex,A=void 0===V?999:V,L=f()(y),Y=x()(T),q=Boolean(Object(v.useChildBlock)({id:"drawer-trigger"})),G=Boolean(Object(v.useChildBlock)({id:"drawer-header"})),K=(t=Object(i.useReducer)(R,j),n=Object(a.a)(t,2),s=n[0],l=n[1],d=_(),p=function(e){l({type:e?"open":"close"}),d(e)},{state:s,openMenu:function(){return p(!0)},closeMenu:function(){return p(!1)}}),Q=K.state,X=K.openMenu,Z=K.closeMenu,$=Q.isOpen,ee=Q.hasBeenOpened,te=Object(i.useState)("eager"===U),ne=Object(a.a)(te,2),re=ne[0],oe=ne[1],ae=Object(i.useState)(!1),ie=Object(a.a)(ae,2),ce=ie[0],se=ie[1];b()({eventId:F,handler:X,eventName:"openDrawer"}),b()({eventId:F,handler:X,eventName:H}),Object(i.useEffect)((function(){void 0!==J&&J($)}),[J,$]);var le="horizontal"===z||"leftToRight"===z?"left":"right",ue="left"===le?"onSwipeLeft":"onSwipeRight",de=Object(i.useMemo)((function(){return{isOpen:$,open:X,close:Z}}),[$,X,Z]),fe="visible"===Y&&$;return Object(i.useEffect)((function(){($||ee||"eager"===U)&&oe(!0)}),[ee,U,oe,$]),c.a.createElement(h.DrawerContextProvider,{value:de},c.a.createElement("div",{onClick:X,role:"presentation","aria-hidden":$?"false":"true",className:"pa4 pointer ".concat(L.openIconContainer)},q?c.a.createElement(v.ExtensionPoint,{id:"drawer-trigger"}):null!=I?I:c.a.createElement(u.a,{size:20})),c.a.createElement(O.default,null,c.a.createElement(w.default,{visible:fe,onClick:Z,zIndex:A}),c.a.createElement(i.Suspense,{fallback:c.a.createElement(c.a.Fragment,null)},c.a.createElement(C,Object(r.a)({},Object(o.a)({},ue,Z),{enabled:$,position:$?"center":le,allowOutsideDrag:!0,onUpdateOffset:function(e){se(!("0%"===e||"-100%"===e))},className:"".concat(L.drawer," ").concat($?L.opened:L.closed," ").concat(ce?L.moving:""," ").concat("right"===le?"right-0":"left-0"," fixed top-0 bottom-0 bg-base z-999 flex flex-column"),style:{width:null!=m?m:M?"100%":"85%",maxWidth:S,minWidth:280,pointerEvents:$?"auto":"none",zIndex:A}}),c.a.createElement("div",{className:"".concat(L.drawerContent," overflow-y-auto"),style:{WebkitOverflowScrolling:"touch"}},G?c.a.createElement(v.ExtensionPoint,{id:"drawer-header"}):null!=g?g:c.a.createElement("div",{className:"flex ".concat(L.closeIconContainer)},c.a.createElement(E.default,null)),c.a.createElement("div",{className:"".concat(L.childrenContainer," flex flex-grow-1"),onClick:function(e){N(e.target,e.currentTarget)&&Z()}},re?D:c.a.createElement(c.a.Fragment,null)))))))}var I=Object(s.defineMessages)({title:{id:"admin/editor.drawer.title"}});D.schema={title:I.title.id};t.default=D}],[[25,"common"]]]); },function(){ !function(t){function e(e){for(var n,a,u=e[0],c=e[1],l=e[2],s=0,d=[];st.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0?r=o[i=d]:0!==n?(i=0,r=0):e&&(r=o[i=d]),l&&l({type:"SLIDE",payload:{currentSlide:i,transform:r}}),s({type:"SLIDE",payload:{transform:r,currentSlide:i}})}}},j=function(e){var t=Object(r.useState)(!1),n=Object(g.a)(t,2),i=n[0],a=n[1],o=Object(S.useSliderGroupState)(),s=Object(S.useSliderGroupDispatch)();return Object(r.useEffect)((function(){var t=function(){null==s||s({type:"HOVER",payload:{isHovering:!0}}),a(!0)},n=function(){null==s||s({type:"HOVER",payload:{isHovering:!1}}),a(!1)};return(null==e?void 0:e.current)&&(e.current.addEventListener("mouseenter",t),e.current.addEventListener("mouseleave",n)),function(){var i=e.current;i&&(i.removeEventListener("mouseenter",t),i.removeEventListener("mouseleave",n))}}),[e,s]),(null==o?void 0:o.isHovering)?{isHovering:!0}:{isHovering:i}},T=n(14),_=n.n(T)()(X),I=_.CssHandlesProvider,M=_.useContextCssHandles,N=function(e,t){return t%e==0?"firstVisible":(t+1)%e==0?"lastVisible":""},x=function(e){return a.a.Children.toArray(a.a.Children.map(e,(function(e){return"string"==typeof e||"number"==typeof e?e:Object(r.cloneElement)(e,Object.assign(Object.assign({},e.props),{__isDuplicated:!0}))})))},C=function(e){var t=e.infinite,n=e.usePagination,s=e.centerMode,l=e.centerModeSlidesGap,d=e.totalItems,c=e.children,u=P(),f=u.slideWidth,v=u.slidesPerPage,p=u.currentSlide,m=u.isOnTouchMove,g=u.useSlidingTransitionEffect,y=u.slideTransition,h=y.speed,b=y.timing,O=y.delay,w=u.transformMap,j=u.transform,T=E(),_=Object(o.useIntl)(),I=Object(S.useSliderGroupDispatch)(),C=M(),D=C.handles,R=C.withModifiers,A=function(e){var t=e.currentSlide,n=e.slidesPerPage,i=e.totalItems,a=e.centerMode,o=Object(r.useRef)(new Set);Object(r.useEffect)((function(){for(var e=0;e=n&&t=n&&t+1=n&&t-1=r)}({index:e,currentSlide:t,slidesToShow:n,totalItems:i,centerMode:a})};return{shouldRenderItem:function(e){return o.current.has(e)||s(e)},isItemVisible:s}}({currentSlide:p,slidesPerPage:v,totalItems:d,centerMode:s}),L=A.shouldRenderItem,k=A.isItemVisible,H=t&&c?x(c).slice(0,v):[],U=(t&&c?x(c).slice(c.length-v):[]).concat(null!=c?c:[],H),G=v<=d?"".concat(100*U.length/v,"%"):"100%";return a.a.createElement("div",{"data-testid":"slider-track",className:"".concat(D.sliderTrack," flex ").concat("disabled"!==s?"":"justify-around"," relative pa0 ma0"),style:{transition:m||!g?void 0:"transform ".concat(h,"ms ").concat(b," ").concat(O,"ms"),transform:"translate3d(".concat(m?j:w[p],"%, 0, 0)"),width:G},onTransitionEnd:function(){T({type:"DISABLE_TRANSITION"}),p>=d&&(T({type:"ADJUST_CURRENT_SLIDE",payload:{currentSlide:0,transform:w[0]}}),null==I||I({type:"SLIDE",payload:{currentSlide:0,transform:w[0]}})),p<0&&(T({type:"ADJUST_CURRENT_SLIDE",payload:{currentSlide:p+d,transform:w[p+d]}}),null==I||I({type:"SLIDE",payload:{currentSlide:p+d,transform:w[p+d]}}))},"aria-atomic":"false","aria-live":"polite"},U.map((function(e,r){var o=r-(t?v:0),c={width:"".concat(f,"%"),marginLeft:"disabled"===s||l?void 0:"".concat(f/(8*v),"%"),marginRight:"disabled"===s||l?void 0:"".concat(f/(8*v),"%"),paddingLeft:"disabled"!==s&&l?l/2:void 0,paddingRight:"disabled"!==s&&l?l/2:void 0};return a.a.createElement("div",Object(i.a)({key:o},function(e){var t=e.visible,n=e.index,i=e.totalItems,r=e.intl;return n<0||n>=i?{"aria-hidden":!t,role:"none presentation"}:{"aria-hidden":!t,role:"group","aria-roledescription":"slide","aria-label":"".concat(r.formatMessage({id:"store/slider-layout.sliderTrack.aria-label"},{slide:n+1,total:i}))}}({visible:k(o),index:o,totalItems:d,intl:_}),{className:"".concat(R("slide",[N(v,o),k(o)?"visible":"hidden"])," flex relative"),"data-index":o>=0&&o0?u(i):c(i)};return a.a.createElement("div",{className:"".concat(p.paginationDotsContainer," flex absolute justify-center pa0 ma0 bottom-0 left-0 right-0"),role:"group","aria-label":"Slider pagination dots"},S.map((function(e){var n=e===H(g,s,o);return a.a.createElement("div",{className:"".concat(m("paginationDot",n?"isActive":"")," ").concat(n?"bg-emphasis":"bg-muted-3"," grow dib br-100 pa2 mr2 ml2 bw0 pointer outline-0"),style:{height:"".concat(.625,"rem"),width:"".concat(.625,"rem")},key:e,tabIndex:n?0:-1,onKeyDown:function(t){return y(t,e)},onClick:function(t){return y(t,e)},role:"button","aria-controls":t,"aria-label":"Dot ".concat(e+1," of ").concat(S.length),"data-testid":"paginationDot"})})))},G=Object(r.memo)(U),W=["sliderLayoutContainer","sliderTrackContainer"].concat(Object(v.a)(["sliderTrack","slide","slideChildrenContainer"]),Object(v.a)(["sliderLeftArrow","sliderRightArrow","sliderArrows"]),Object(v.a)(["paginationDotsContainer","paginationDot"])),z=function(e){var t=e.children,n=e.totalItems,i=e.infinite,o=void 0!==i&&i,s=e.showNavigationArrows,l=e.showPaginationDots,d=e.usePagination,c=void 0===d||d,u=e.arrowSize,f=e.fullWidth,v=e.itemsPerPage,p=e.centerMode,S=e.centerModeSlidesGap,y=M().handles,h=m()().isMobile,b=P(),O=b.label,T=void 0===O?"slider":O,_=b.slidesPerPage,I=Object(r.useRef)(null),N=function(e){var t=e.infinite,n=e.centerMode,i=E(),a=P().transform,o=w(t),s=o.goForward,l=o.goBack,d=Object(r.useState)({touchStartX:0,touchInitialTransform:a}),c=Object(g.a)(d,2),u=c[0],f=c[1];return{onTouchEnd:function(e){var t=e.changedTouches[0].clientX-u.touchStartX;Math.abs(t)>75?(t>0&&l(),t<0&&s()):i({type:"TOUCH",payload:{transform:u.touchInitialTransform,isOnTouchMove:!1}}),f({touchStartX:0,touchInitialTransform:a}),i({type:"TOUCH",payload:{isOnTouchMove:!1}})},onTouchStart:function(e){var t=e.touches[0].clientX;f({touchStartX:t,touchInitialTransform:a})},onTouchMove:function(e){var t=e.touches[0].clientX-u.touchStartX,r=u.touchInitialTransform+t/(25*("disabled"!==n?2:1));i({type:"TOUCH",payload:{transform:r,isOnTouchMove:!0}})}}}({infinite:o,centerMode:p}),x=N.onTouchEnd,D=N.onTouchStart,R=N.onTouchMove;!function(e,t){var n=P().autoplay,i=j(t).isHovering,a=(null==n?void 0:n.stopOnHover)&&i,o=w(e).goForward;Object(r.useEffect)((function(){if(n){var e=setTimeout((function(){o()}),n.timeout);return a&&clearTimeout(e),function(){return clearTimeout(e)}}}),[o,a,n])}(o,I),function(e,t){var n=P(),i=n.navigationStep,a=n.isPageNavigationStep,o=n.totalItems,s=E();Object(r.useEffect)((function(){var n=o<=t?o:t,r=a?n:i,l=function(e){s({type:"ADJUST_ON_RESIZE",payload:{shouldCorrectItemPosition:e,slidesPerPage:n,navigationStep:r}})},d=function(t){l(!t||e)};return l(!1),window.addEventListener("resize",d),function(){return window.removeEventListener("resize",d)}}),[e,s,o,t,a,i])}(o,v);var A=_>=n,L="".concat(T.toLowerCase().trim().replace(/ /g,"-"),"-items-").concat(Math.random().toString(36).substring(2,9)),H=Boolean(("always"===s||"mobileOnly"===s&&h||"desktopOnly"===s&&!h)&&!A),U=Boolean(("always"===l||"mobileOnly"===l&&h||"desktopOnly"===l&&!h)&&!A);return a.a.createElement("section",{onTouchStart:function(e){return c&&!A?D(e):null},onTouchEnd:function(e){return c&&!A?x(e):null},onTouchMove:function(e){return c&&!A?R(e):null},"aria-label":T,id:L,style:{WebkitOverflowScrolling:c?void 0:"touch",paddingLeft:f?void 0:2*u,paddingRight:f?void 0:2*u,touchAction:"pan-y"},className:"w-100 flex items-center relative ".concat(y.sliderLayoutContainer)},a.a.createElement("div",{className:"w-100 ".concat(y.sliderTrackContainer," ").concat(c?"overflow-hidden":"overflow-x-scroll"),ref:I},a.a.createElement(C,{centerMode:p,centerModeSlidesGap:S,infinite:o,totalItems:n,usePagination:c},t)),H&&c&&a.a.createElement(r.Fragment,null,a.a.createElement(k,{totalItems:n,orientation:"left",controls:L,infinite:o,arrowSize:u}),a.a.createElement(k,{totalItems:n,orientation:"right",controls:L,infinite:o,arrowSize:u})),U&&c&&a.a.createElement(G,{totalItems:n,controls:L,infinite:o}))},F=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);rt.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:{},r=n.onSuccess,a=void 0===r?d:r,s=n.onFailure,p=void 0===s?d:s,v=n.onFinish,x=void 0===v?d:v,f=n.getAutoRunArgs,g=void 0===f?function(){return null}:f,m=Object(i.useState)(null),b=Object(o.a)(m,2),w=b[0],h=b[1],O=Object(i.useState)(null),C=Object(o.a)(O,2),y=C[0],P=C[1],E=Object(i.useMemo)(g,[]),I=Object(i.useState)(!!E),j=Object(o.a)(I,2),A=j[0],S=j[1],k=Object(i.useCallback)(t,e),L=Object(i.useCallback)(function(){var t=Object(u.a)(c.a.mark((function t(){var e,n=arguments;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return P(null),S(!0),t.prev=2,t.next=5,k.apply(void 0,n);case 5:return e=t.sent,h(e),P(null),a(e),t.abrupt("return",e);case 12:return t.prev=12,t.t0=t.catch(2),P(t.t0),h(null),p(t.t0),t.abrupt("return",t.t0);case 18:return t.prev=18,S(!1),x(),t.finish(18);case 22:case"end":return t.stop()}}),t,null,[[2,12,18,22]])})));return function(){return t.apply(this,arguments)}}(),[k,p,x,a]);return Object(i.useEffect)((function(){E&&L.apply(void 0,Object(l.a)(E))}),[E,L]),[L,{value:w,error:y,loading:A}]},v=n(13),x=Object(i.createContext)(null),f=function(){var t=Object(i.useContext)(x);if(!t)throw new Error('"useProfile" must be inside a Provider');return t.profile},g=function(t){var e,n,l=t.children,s=t.useLoadingState,c=Object(i.useContext)(x),u=p((function(){return Object(a.a)()}),[],{getAutoRunArgs:function(){return c?null:[]}}),d=Object(o.a)(u,2)[1],f=d.value,g=d.loading,m=null!==(e=null==c?void 0:c.profile)&&void 0!==e?e:f,b=null!==(n=null==c?void 0:c.loading)&&void 0!==n?n:g;return s&&b?r.a.createElement("div",{"data-testid":"loading-session"},r.a.createElement(v.a,null)):r.a.createElement(x.Provider,{value:{profile:m,loading:b}},l)}},20:function(t,e,n){"use strict";n.r(e),n.d(e,"LoginSchema",(function(){return o}));var o={type:"object",properties:{optionsTitle:{title:"admin/editor.login.optionsTitle",type:"string",widget:{"ui:widget":"textarea"}},emailAndPasswordTitle:{title:"admin/editor.login.emailAndPasswordTitle",type:"string",widget:{"ui:widget":"textarea"}},accessCodeTitle:{title:"admin/editor.login.accessCodeTitle",type:"string",widget:{"ui:widget":"textarea"}},emailPlaceholder:{title:"admin/editor.login.emailPlaceholder",type:"string"},passwordPlaceholder:{title:"admin/editor.login.passwordPlaceholder",type:"string"},showPasswordVerificationIntoTooltip:{title:"admin/editor.login.showPasswordVerificationIntoTooltip.title",type:"boolean",isLayout:!0},accessCodePlaceholder:{title:"admin/editor.login.accessCodePlaceholder",type:"string"},showIconProfile:{title:"admin/editor.login.showIconProfile",type:"boolean"},iconLabel:{title:"admin/editor.login.iconLabel",type:"string"},providerPasswordButtonLabel:{title:"admin/editor.login.providerPasswordButtonLabel",type:"string"},hasIdentifierExtension:{title:"admin/editor.login.hasIdentifierExtension",type:"boolean"},termsAndConditions:{title:"admin/editor.login.termsAndConditions",type:"string",widget:{"ui:widget":"textarea"}}},dependencies:{hasIdentifierExtension:{oneOf:[{properties:{hasIdentifierExtension:{enum:[!0]},identifierPlaceholder:{title:"admin/editor.login.identifierPlaceholder",type:"string"},invalidIdentifierError:{title:"admin/editor.login.invalidIdentifierError",type:"string"}}}]}}}},3:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(t,e){return e.formatMessage({id:"".concat(t)})}},38:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o=n(21),i=n(69),r=n.n(i),a=function(t){var e=Object(o.compose)(o.fromPairs,Object(o.map)(Object(o.split)("=")),Object(o.split)("&"),o.tail)(t),n=e.accountAuthCookieName,i=e.accountAuthCookieValue;if(n&&i){r.a.set(n,i,{expires:1,path:"/",secure:!0});var a=t.substring(0,t.indexOf("?"));window.history.replaceState({},document.title,a),window.location.assign(window.location.origin)}}},41:function(t,e,n){"use strict";var o=n(11),i=n.n(o),r=n(17),a=function(t){var e=(null!=t?t:{}).namespaces,n=(null!=e?e:{}).profile;if(!n)return null;var o=n.email,i=(o=void 0===o?{value:null}:o).value,r=n.firstName,a=(r=void 0===r?{value:null}:r).value,l=n.isAuthenticated,s="true"===(l=void 0===l?{value:"false"}:l).value;return s&&!i?null:{email:i,firstName:a,isAuthenticated:s}},l=function(){var t=Object(r.a)(i.a.mark((function t(){var e,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o=void 0,(null===(o=null===window||void 0===window?void 0:window.__RENDER_8_SESSION__)||void 0===o?void 0:o.sessionPromise)?window.__RENDER_8_SESSION__.sessionPromise:Promise.resolve(null);case 2:return e=t.sent,n=(null!=e?e:{}).response,t.abrupt("return",a(n));case 5:case"end":return t.stop()}var o}),t)})));return function(){return t.apply(this,arguments)}}();e.a=l},5:function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return a})),n.d(e,"e",(function(){return l})),n.d(e,"f",(function(){return c}));var o="user-identifier",i="vtex.login@2.66.0",r={POPOVER:"popover",LINK:"link"},a={RIGHT:"Right",LEFT:"Left"},l=function(){var t;return(null===(t=null===window||void 0===window?void 0:window.__RUNTIME__)||void 0===t?void 0:t.rootPath)||""},s=["fastshopbrqa1","fastshopbrqa2","fastshopbr","rubimstore"],c=function(t){return s.includes(t)}},69:function(t,e,n){!function(e){if("function"==typeof define&&define.amd&&(define(e),!0),t.exports=e(),!!0){var n=window.Cookies,o=window.Cookies=e();o.noConflict=function(){return window.Cookies=n,o}}}((function(){function t(){for(var t=0,e={};t=0||e.indexOf("Firefox")>=0}()&&window.location?i.a.createElement(a.Suspense,{fallback:null},i.a.createElement(R.a,{skip:!0,scope:"STORE",parentAppId:l.c},i.a.createElement(S,Object(b.a)({},e,{page:t})))):null},I=function(){window&&(window.localStorage&&localStorage.setItem("gsi_auto","false"),y()&&window.google.accounts.id.disableAutoSelect())},k=n(4),M=n(26),B=n.n(M),A=n(3),D=function(){var e,t=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.search;return t&&URLSearchParams?new URLSearchParams(t).get("__bindingAddress"):null},U=n(12),z=n.n(U),G=n(71),F=n.n(G),H=function(e){var t=e.iconSize,n=e.labelClasses,o=e.classes;return Boolean(Object(w.useChildBlock)({id:"icon-profile"}))?i.a.createElement("div",{className:z()(n,o)},i.a.createElement(w.ExtensionPoint,{id:"icon-profile",size:t})):i.a.createElement("div",{className:z()(n,o)},i.a.createElement(F.a,{size:t}))},K=function(e){var t,n,o=e.iconSize,a=e.iconLabel,r=e.hideIconLabel,c=e.labelClasses,l=e.loginButtonAsLink,s=e.onProfileIconClick,u=e.sessionProfile,d=e.showIconProfile,p=Object(k.useIntl)(),m=Object(w.useRuntime)(),v=m.history,g=m.navigate,f=null!=u?u:{},E=f.isAuthenticated,b=f.firstName,_=f.email,h=null===(t=null==v?void 0:v.location)||void 0===t?void 0:t.pathname,x=null===(n=null==v?void 0:v.location)||void 0===n?void 0:n.search,N="flex items-center ".concat(r?"nr4":""),R=a||Object(A.a)("store/login.signIn",p),C=r?i.a.createElement(i.a.Fragment,null):E?i.a.createElement("span",{className:"".concat(O.a.profile," truncate t-action--small order-1 pl4 ").concat(c," dn db-l")},Object(A.a)("store/login.hello",p)," ",null!=b?b:_):i.a.createElement("span",{className:"".concat(O.a.label," t-action--small pl4 ").concat(c," dn db-l")},R);if(l){var T=E?"store.account":"store.login";return i.a.createElement("div",{className:O.a.buttonLink},i.a.createElement(B.a,{variation:"tertiary",icon:d&&i.a.createElement(H,{iconSize:o,labelClasses:c,classes:N}),iconPosition:d?"left":"right",onClick:function(){if(window&&URLSearchParams){var e=!E&&encodeURIComponent("".concat(h).concat(x)),t=D();return g({page:T,query:new URLSearchParams(Object.assign(Object.assign({},e&&{returnUrl:e}),t&&{bindingAddress:t})).toString()})}}},C))}return i.a.createElement(B.a,{variation:"tertiary",icon:d&&i.a.createElement(H,{iconSize:o,labelClasses:c,classes:N}),iconPosition:d?"left":"right",onClick:s},i.a.createElement("div",{className:"flex pv2 items-center"},C))},V=n(72),W=n.n(V),J=n(13),q=function(e){var t=e.children,n=e.mirrorTooltipToRight;return i.a.createElement("div",{className:"".concat(O.a.box," z-max absolute"),style:n?{left:50}:{right:-50}},i.a.createElement("div",{className:"".concat(O.a.arrowUp," absolute top-0 ").concat(n?"left-0 ml3":"right-0 mr3"," shadow-3 bg-base rotate-45 h2 w2")}),i.a.createElement("div",{className:"".concat(O.a.contentContainer," shadow-3 mt3")},t))},X=n(39),Q=n(40),Y=n(27),Z=n(42),$=n(43),ee=n(28);function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=Object(ee.a)(e);if(t){var a=Object(ee.a)(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return Object($.a)(this,n)}}var ne={BLOCK:"block",FLEX:"flex",INLINE:"inline",INLINE_BLOCK:"inline-block",CONTENTS:"contents"},oe={disabled:!1,useCapture:!0,display:ne.BLOCK},ae=function(e){Object(Z.a)(n,e);var t=te(n);function n(){var e;Object(X.a)(this,n);for(var o=arguments.length,a=new Array(o),i=0;i0}),[t]),c=Object(a.useMemo)((function(){return(null!=t?t:[]).map((function(e){return e.cssClass})).filter((function(e){return e}))}),[t]),s=ue()(c),u=le()({onSuccess:Object(a.useCallback)((function(){var e;return null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.reload()}),[]),parentAppId:l.c,scope:"STORE"}),d=Object(o.a)(u,2),p=d[0],m=d[1].loading;return i.a.createElement("div",{className:"".concat(O.a.content," ").concat(O.a.content,"--accountOptions flex relative bg-base justify-around overflow-visible pa4 center items-baseline-ns items-baseline")},i.a.createElement("div",{className:"".concat(O.a.contentForm," dn ph4 ").concat(O.a.contentFormVisible," db")},i.a.createElement("div",null,i.a.createElement("div",{className:"".concat(O.a.accountOptions," items-center w-100")},i.a.createElement("div",{className:"mv4 min-h-2 b--muted-4"},r?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"".concat(O.a.accountOptionsSectionTitle," t-small b mb3")},Object(A.a)("store/login.myAccount",n)),null==t?void 0:t.map((function(e,t){var n=e.label,o=e.path,a=e.cssClass,r=new URL(o||"/",window.location.href);return i.a.createElement(w.Link,{className:"".concat(s[a]||""," db no-underline t-small c-muted-1 hover-c-action-primary pv3"),key:t,to:"".concat(r.pathname).concat(r.search).concat(r.hash)},n)}))):i.a.createElement(w.Link,{page:"store.account"},i.a.createElement("button",{className:"".concat(O.a.button," bw1 ba ttu br2 t-action--small v-mid relative pv3 ph5 t-heading-5 bg-base b--transparent c-action-primary hover-c-action-primary pointer")},i.a.createElement("span",{className:"t-action--small"},Object(A.a)("store/login.myAccount",n))))),i.a.createElement("hr",{className:"mv2 o-30"}),i.a.createElement("div",{className:"mv4 min-h-2 b--muted-4"},r?i.a.createElement(me,{className:O.a.logoutButton,onClick:function(){I(),p()},loading:m},Object(A.a)("store/login.logoutLabel",n)):i.a.createElement(re.a,{variation:"tertiary",size:"small",onClick:function(){I(),p()},isLoading:m},i.a.createElement("span",{className:"t-action--small"},Object(A.a)("store/login.logoutLabel",n))))))))},ge=i.a.lazy((function(){return Promise.all([n.e(0),n.e(2)]).then(n.bind(null,68))})),fe=function(e){var t=e.isBoxOpen,n=e.onOutSideBoxClick,o=d(),r=o.mirrorTooltipToRight,c=o.accountOptionLinks,l=Object(m.b)(),s=Object(v.b)(),u=(null!=s?s:{}).isAuthenticated;return t?i.a.createElement(W.a,null,i.a.createElement(ae,{onOutsideClick:n},i.a.createElement(q,{mirrorTooltipToRight:r},i.a.createElement(a.Suspense,{fallback:i.a.createElement(J.a,null)},u?i.a.createElement(ve,{optionLinks:c}):i.a.createElement(ge,Object(b.a)({},l,{isInitialScreenOptionOnly:!0,isHeaderLogin:!0})))))):i.a.createElement(i.a.Fragment,null)},Oe=function(){var e=d(),t=e.hideIconLabel,n=e.iconLabel,r=e.iconSize,c=e.showIconProfile,s=e.hasGoogleOneTap,u=e.googleOneTapAlignment,p=e.googleOneTapMarginTop,m=e.accountOptionsButtonBehavior,g=e.labelClasses,f=e.logInButtonBehavior,b=Object(a.useState)(!1),_=Object(o.a)(b,2),h=_[0],x=_[1],w=Object(a.useState)(!1),N=Object(o.a)(w,2),R=N[0],C=N[1],T=Object(v.b)(),P=Object(a.useCallback)((function(){window.innerWidth<640?C(!0):C(!1)}),[]);Object(a.useEffect)((function(){return window.addEventListener("resize",P),P(),function(){window.removeEventListener("resize",P)}}),[P]),Object(a.useEffect)((function(){window.location.href.indexOf("accountAuthCookieName")>0&&Object(E.a)(window.location.href)}),[]);var L=Object(a.useCallback)((function(){return x((function(e){return!e}))}),[]),y=Object(a.useCallback)((function(){return x(!1)}),[]),S=l.a.LINK,I=(null!=T?T:{}).isAuthenticated,k=R||(I?m===S:f===S);return i.a.createElement("div",{className:"".concat(O.a.container," flex items-center fr")},i.a.createElement("div",{className:"relative"},i.a.createElement(K,{onProfileIconClick:L,sessionProfile:T,hideIconLabel:t,iconLabel:n,iconSize:r,labelClasses:g,loginButtonAsLink:k,showIconProfile:c}),s&&i.a.createElement(j,{alignment:u,marginTop:p,shouldOpen:!I}),i.a.createElement(fe,{isBoxOpen:h,onOutSideBoxClick:y})))},Ee=function(e){var t=e.accountOptionsButtonBehavior,n=e.googleOneTapAlignment,o=e.googleOneTapMarginTop,a=e.hasGoogleOneTap,r=e.hideIconLabel,l=e.iconLabel,s=e.iconSize,u=e.labelClasses,d=e.logInButtonBehavior,g=e.mirrorTooltipToRight,f=e.showIconProfile,O=e.defaultOption,E=e.accessCodePlaceholder,b=e.accessCodeTitle,_=e.disabledEmailInputs,h=e.accountOptionLinks,x=e.emailAndPasswordTitle,w=e.emailPlaceholder,N=e.identifierPlaceholder,R=e.invalidIdentifierError,C=e.isInitialScreenOptionOnly,T=e.optionsTitle,P=e.passwordPlaceholder,L=e.providerPasswordButtonLabel,y=e.showPasswordVerificationIntoTooltip,S=e.termsAndConditions,j=e.blockOAuthAutoRedirect;return i.a.createElement(c.a,null,i.a.createElement(v.a,null,i.a.createElement(p,{value:{accountOptionsButtonBehavior:t,googleOneTapAlignment:n,googleOneTapMarginTop:o,hasGoogleOneTap:a,hideIconLabel:r,iconLabel:l,iconSize:s,labelClasses:u,logInButtonBehavior:d,mirrorTooltipToRight:g,showIconProfile:f,accountOptionLinks:h}},i.a.createElement(m.a,{value:{defaultOption:O,accessCodePlaceholder:E,accessCodeTitle:b,disabledEmailInputs:_,emailAndPasswordTitle:x,emailPlaceholder:w,identifierPlaceholder:N,invalidIdentifierError:R,isInitialScreenOptionOnly:C,optionsTitle:T,passwordPlaceholder:P,providerPasswordButtonLabel:L,showPasswordVerificationIntoTooltip:y,termsAndConditions:S,blockOAuthAutoRedirect:j}},i.a.createElement(Oe,null)))))};Ee.getSchema=function(){return Object.assign(Object.assign({title:"admin/editor.login.title"},g.LoginSchema),{properties:Object.assign(Object.assign({},g.LoginSchema.properties),{mirrorTooltipToRight:{title:"admin/editor.login.mirrorTooltipToRightTitle",type:"boolean",default:!1},logInButtonBehavior:{title:"admin/editor.login.logInButtonBehavior",type:"string",enum:[l.a.POPOVER,l.a.LINK],default:l.a.POPOVER},accountOptionsButtonBehavior:{title:"admin/editor.login.accountOptionsButtonBehavior",type:"string",enum:[l.a.POPOVER,l.a.LINK],default:l.a.POPOVER},accountOptionLinks:{title:"admin/editor.login.accountOptionLinks",type:"array",items:{type:"object",properties:{label:{title:"admin/editor.login.accountOptionLabelTitle",type:"string"},path:{title:"admin/editor.login.accountOptionPathTitle",type:"string"},cssClass:{title:"admin/editor.login.accountOptionCssClassTitle",type:"string"}}}},hasGoogleOneTap:{title:"admin/editor.login.googleOneTap.title",type:"boolean"},hideIconLabel:{title:"admin/editor.login.hideIconLabel",type:"boolean",default:!1}}),dependencies:Object.assign(Object.assign({},g.LoginSchema.dependencies),{hasGoogleOneTap:{oneOf:[{properties:{hasGoogleOneTap:{enum:[!0]},googleOneTapAlignment:{title:"admin/editor.login.googleOneTap.alignment",type:"string",enum:[l.b.RIGHT,l.b.LEFT],default:l.b.RIGHT},googleOneTapMarginTop:{title:"admin/editor.login.googleOneTap.marginTop",type:"string",default:"3rem"}}}]}})})},Ee.uiSchema={"ui:order":["*","hasIdentifierExtension","identifierPlaceholder","invalidIdentifierError","accountOptionLinks","hasGoogleOneTap","googleOneTapAlignment","googleOneTapMarginTop"]};var be=Ee},19:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/validations"]},21:function(e,t){e.exports=R},22:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Spinner"]},25:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/AuthStateLazy"]},26:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ButtonWithIcon"]},29:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/RecaptchaProvider"]},30:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useRedirectAfterLogin"]},31:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useSendAccessCode"]},32:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/AuthServiceLazy"]},4:function(e,t){e.exports=ReactIntl},49:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useGetPhoneNumberByEmail"]},50:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconArrowBack"]},51:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useLogInWithAccessKey"]},52:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useSetPassword"]},53:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconEyeSight"]},54:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useLogInWithPassword"]},55:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/RadioGroup"]},56:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useSendAccessKey"]},57:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/getAbsReturnUrl"]},58:function(e,t){e.exports=regeneratorRuntime},6:function(e,t){e.exports=__RENDER_8_RUNTIME__},67:function(e,t){e.exports=PropTypes},70:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useStartLoginAttempt"]},71:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconProfile"]},72:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-portal@0.x/Overlay"]},73:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-vtexid@4.x/useLogOut"]},74:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},77:function(e,t,n){"use strict";n.r(t),function(e){var t=n(15);n.p=Object(t.getPublicPath)("vtex.login@2.66.0");var o=Object(t.register)((function(){return n(163)}),e,"vtex.login@2.66.0","vtex.login@2.x","Login");o.renderHotReload,o.setupHMR}.call(this,n(34)(e))},8:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]}},[[77,"common",1]]]); }], document.currentScript.dataset.index)