1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="01d10a1c-f638-4a33-96dd-ac392ac7e4c4",e._sentryDebugIdIdentifier="sentry-dbid-01d10a1c-f638-4a33-96dd-ac392ac7e4c4")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6112],{27646:()=>{},30039:(e,t,a)=>{"use strict";a.d(t,{$:()=>u,E:()=>h});var i=a(95155),n=a(12115),s=a(99776),r=a(22454),l=a(5),o=a(75063),c=a(40893);let d=(0,n.createContext)(void 0);function u(e){var t;let{children:a}=e,[u,h]=(0,n.useState)(null),p=(0,s.jE)(),{data:m=[],isLoading:f}=(0,r.I)({queryKey:["provinces"],queryFn:l.wR,staleTime:18e5,gcTime:(0,o.W)(36e5)}),{data:g=[],isLoading:x}=(0,c.Z)(null!=(t=null==u?void 0:u.id)?t:null),y=(0,n.useCallback)(e=>{h(e)},[]),v=(0,n.useCallback)(async e=>{await p.prefetchQuery({queryKey:["cities",e],queryFn:()=>(0,l.i6)(e),staleTime:18e5})},[p]),b=(0,n.useCallback)(e=>p.getQueryData(["cities",e])||[],[p]),w=(0,n.useMemo)(()=>({provinces:m,cities:g,selectedProvince:u,isLoadingProvinces:f,isLoadingCities:x,selectProvince:y,prefetchCities:v,getCitiesForProvince:b}),[m,g,u,f,x,y,v,b]);return(0,i.jsx)(d.Provider,{value:w,children:a})}function h(){let e=(0,n.useContext)(d);if(void 0===e)throw Error("useProvinceCityContext must be used within a ProvinceCityProvider");return e}},40893:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var i=a(22454),n=a(5),s=a(75063);let r=e=>(0,i.I)({queryKey:["cities",e],queryFn:()=>(0,n.i6)(e),enabled:null!==e,staleTime:18e5,gcTime:(0,s.W)(36e5)})},41472:(e,t,a)=>{"use strict";a.d(t,{default:()=>d});var i=a(95155),n=a(52619),s=a.n(n),r=a(19152),l=a(20063),o=a(62673),c=a(83636);let d=e=>{let{href:t,children:a,className:n,target:d,rel:u,title:h,"aria-label":p,showLoading:m=!0,...f}=e,g=(0,o.i)(t),x=(0,l.usePathname)(),y=x===t||x.slice(0,-1)===t,v="_blank"===d||"_top"===d||"_parent"===d,b=m&&!g&&!v,{startNavigating:w}=(0,r.y)();return g?(0,i.jsx)("a",{href:t,className:n,target:d||"_blank",rel:u||"noopener noreferrer",title:h,"aria-label":p,...f,children:a}):(0,i.jsx)(s(),{href:t,className:n,target:d,title:h,"aria-label":p,...f,onClick:e=>{b&&!y&&w(),f.onClick&&f.onClick(e)},prefetch:"true"===(0,c.p)("PREFETCH_LINKS"),children:a})}},53237:(e,t,a)=>{Promise.resolve().then(a.bind(a,56179))}
1,55644:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var i=a(95155),n=a(36591);function s(e){let{mobileHeight:t,desktopHeight:a,className:s=""}=e,r=(0,n.Iu)()?t:a;if(!r)return null;let l=r.startsWith("h-"),o=l?{}:{height:r},c=l?r:"";return(0,i.jsx)("div",{className:"".concat(c," ").concat(s).trim(),style:o})}},56179:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>q});var i=a(95155),n=a(36591),s=a(41472),r=a(78934),l=a(2821),o=a(60668);function c(){let e=(0,n.Iu)(),{isScrolled:t}=(0,o.g)();return e?(0,i.jsx)("header",{className:(0,l.A)("shadow-sm left-0 right-0 z-50 bg-white transition-all duration-300 p-4 fixed top-[0px]",t?"shadow-[0px_2px_4px_0px_rgba(0,0,0,0.08)]":""),children:(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)(s.default,{href:"/",className:"w-[120px] h-6",children:(0,i.jsx)(r.A,{src:"/assets/images/automoby-text-logo.png",alt:"AUTOMOBY",width:120,height:24,className:"w-full h-full object-contain"})})})}):null}var d=a(12115),u=a(20063),h=a(60846),p=a(61234),m=a(71094),f=a(26889),g=a(14763),x=a(6674),y=a(89867),v=a(22454),b=a(24965),w=a(3540),j=a(42579),k=a(59067),C=a(88644),_=a(95011),N=a(22356),I=a(34949),E=a(36091);function P(e){let{items:t,isCreatingOrder:a,isCartPriceLoading:s,isPaymentPage:r,isParcelsPage:l,isDisabled:o,selectedGateway:c,finalTotal:d,cartItemsAndInstallationTotalPrice:h,onContinueClick:p}=e,m=(0,u.usePathname)(),f=(0,E.N)(m);console.log("s: ",f);let g=JSON.stringify(null==t?void 0:t.flatMap(e=>Array.from({length:e.quantity},()=>({item_id:String(e.configId),price:String(e.price)}))));return(0,i.jsxs)("div",{className:"px-[16px] py-[12px] flex gap-[16px] items-center justify-between",children:[(0,i.jsx)(n.$n,{variant:"primary",size:"lg",className:"w-[150px]",onClick:p,disabled:o,"data-track":(0,E.J)(f),"data-prop-currency":"IRR","data-prop-gateway-name":c,"data-prop-items":g,"data-prop-checkout_step":f,children:a||s?"در ØØ§Ù بارگذارÛ...":r?"پرداخت":"اداÙ
Ù Ø®Ø±ÛØ¯"}),(0,i.jsxs)("div",{className:"flex flex-col justify-between items-center",children:[(0,i.jsx)(n.o5,{variant:"body-xs-medium",children:"Ù
Ø¨ÙØº ÙØ§Ø¨Ù پرداخت"}),(0,i.jsx)(n.o5,{variant:"body-m-bold",color:"neutral-darker",children:(0,I.DS)(l||r?d:h)})]})]})}function S(){var e,t;let a=(0,n.Iu)(),s=(0,u.useRouter)(),r=(0,u.usePathname)(),{cartTotalPrice:l,cart:o}=(0,h._)(),{selectedAddress:c,selectedGateway:I,parcelsData:E,setSelectedAddress:S,discount:T,shippingDiscountPercent:O,selectedShippingIndices:D}=(0,p.m)(),{isAuthenticated:q,isInitialized:A}=(0,g.J)(),[W,R]=(0,d.useState)(!1),{isWarningOpen:L,handleWarningConfirm:F,checkBeforePayment:K}=(0,b.l)(),{data:M}=(0,f.t)(),$=(0,x.Wn)(null==o?void 0:o.items),B=(0,x.OC)((null==o?void 0:o.items)||[]),{data:z}=(0,v.I)({queryKey:["tireDolatiEligibility",B],queryFn:()=>(0,y.x)(B),enabled:$&&!!q&&!!A}),G="/checkout/payment/"===r,H="/checkout/parcels/"===r,{finalTotal:J,installationTotalPrice:Q,discountedS
1hippingCost:V,cartDiscountAmount:Z,gatewayFeeAmount:U}=(0,m.k)({parcelsData:E||void 0,appliedDiscount:T,shippingDiscountPercent:O,selectedGateway:I,availableGateways:M,selectedShippingIndices:D}),{handleContinueClick:Y,isCreatingOrder:X,isCartPriceLoading:ee,isIncompatibleGatewayModalOpen:et,closeIncompatibleGatewayModal:ea}=(0,w.s)({skipNavigation:!0,isPaymentStep:G,discountedShippingCost:V,cartDiscountAmount:Z,gatewayFeeAmount:U,finalTotal:J,setIsNationalCodeModalOpen:R,checkBeforePayment:K});if(!a||(null==o?void 0:o.items.length)===0&&(null!=(t=null==o||null==(e=o.installationBookings)?void 0:e.length)?t:0)===0)return null;let ei=async e=>{try{c&&S({...c,nationalCode:e}),R(!1),s.push("/checkout/parcels")}catch(e){console.error("Error updating national code:",e)}},en=(0,j.R)(o),es=q&&!(null==z?void 0:z.success)&&$||X||ee||"/checkout/payment/"===r&&!I||"/checkout/payment/"===r&&!en&&(!E||0===E.length)||"/checkout/address/"===r&&!c||H&&!(0,k.$)(E,D);return(0,i.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-50 bg-white shadow-[0px_-2px_8px_0px_rgba(0,0,0,0.1)]",children:[(0,i.jsx)(P,{items:null==o?void 0:o.items,isCreatingOrder:X,isCartPriceLoading:ee,isPaymentPage:G,isParcelsPage:H,isDisabled:es,selectedGateway:I,finalTotal:J,cartItemsAndInstallationTotalPrice:l+Q,onContinueClick:Y}),(0,i.jsx)(C.A,{isNationalCodeModalOpen:W,onCloseNationalCodeModal:()=>R(!1),onNationalCodeSubmit:ei,isVpnWarningOpen:L,onVpnWarningConfirm:F}),(0,i.jsx)(_.f,{isOpen:et,onClose:ea}),(0,i.jsx)(N._,{})]})}var T=a(50772),O=a(30039);a(27646);var D=a(55644);function q(e){let{children:t}=e;return(0,i.jsx)(T.s,{children:(0,i.jsx)(O.$,{children:(0,i.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,i.jsx)(c,{}),(0,i.jsx)(D.A,{mobileHeight:"h-[60px]"}),t,(0,i.jsx)(S,{}),(0,i.jsx)(D.A,{mobileHeight:"h-[90px]"})]})})})}},59067:(e,t,a)=>{"use strict";function i(e,t){return!!(null==e?void 0:e.length)&&e.every(e=>void 0!==t[e.row])}a.d(t,{$:()=>i})},60668:(e,t,a)=>{"use strict";a.d(t,{g:()=>n});var i=a(12115);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{hideBottomSectionOnScroll:t=!1}=e,[a,n]=(0,i.useState)(!1),[s,r]=(0,i.useState)(0),[l,o]=(0,i.useState)(!0),[c,d]=(0,i.useState)(0),[u,h]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=document.getElementById("top-banner");if(e){let{height:t}=e.getBoundingClientRect();d(t)}let a=()=>{let{scrollY:e}=window;h(e>=c),n(e>=c),t&&e>=c?e>s&&e>c+100?o(!1):o(!0):t&&o(!0),r(e)};return window.addEventListener("scroll",a,{passive:!0}),()=>window.removeEventListener("scroll",a)},[s,c,t]),{isScrolled:a,showBottomSection:l,topBannerHeight:c,isFixed:u}}},62673:(e,t,a)=>{"use strict";a.d(t,{i:()=>i});let i=e=>e.startsWith("http")||e.startsWith("//")},89867:(e,t,a)=>{"use strict";a.d(t,{x:()=>n});var i=a(96444);let n=async e=>await (0,i.GO)("/cart/check-goverment-tire?number=".concat(e),{method:"GET"})}},e=>{e.O(0,[3601,6591,5239,4161,2454,7435,4624,2544,7731,6444,6233,7668,4763,846,3907,8441,3333,7358],()=>e(e.s=53237)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.