PageSourceSearch

https://www.autobla.se/_next/static/chunks/pages/%5B%5B...slug%5D%5D-e6498a0bb1010f3a.js

js autobla.se collected 2026-10-08 22:40:48 UTC 82,002 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[243],{1756:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>th});var i=s(7876),a=s(4232);s(4208);var r=s(582),n=s(7328),l=s.n(n),o=s(7480),c=s(6943),d=s(1105),h=s(2723),u=s.n(h),m=s(8230),p=s.n(m),x=s(3846),v=s(9081),g=s(4260),j=s(1679),f=s(6598),b=s(5401),y=s(5839),w=s(5801),_=s(2627),N=s(7818),S=s(5612),C=s(5240);let k=(e,t)=>{let s=0;if(t){let i=e.variants.findIndex(e=>e.sku===t.sku);s=i<0?0:Math.floor(i/10)}return s+1},E=e=>{let{active:t,variant:s,product:a,prices:r,storeConfig:n,attributesInTable:l,showQuantity:o}=e,c=(0,g.Fr)(),d=r[s.id],h=(0,g.TE)({type:"variant",data:s,product:a},c),u=(0,_.F)(),m=s.image||(null==a?void 0:a.image)||u;return(0,i.jsxs)("tr",{className:"variant ".concat(t?"active":""),children:[(0,i.jsx)("td",{className:"align-middle",children:(0,i.jsx)(p(),{href:h,children:(0,i.jsx)("img",{className:"variant-image",src:null==m?void 0:m.thumbnail,alt:""})})}),(0,i.jsx)("td",{className:"align-middle",children:(0,i.jsx)(p(),{href:h,children:(0,i.jsx)(y.A,{variant:s})})}),(0,i.jsx)("td",{className:"align-middle",children:(0,i.jsx)(p(),{href:h,children:s.name})}),l&&l.map((e,t)=>{var a;return(0,i.jsx)("td",{children:null==(a=s.attributes)?void 0:a[e.key]},t)}),o&&(0,i.jsx)("td",{children:a.quantity||"-"}),(0,i.jsxs)("td",{className:"align-middle",children:[d&&(0,i.jsxs)("div",{className:"product-price-container",children:[(0,C.rI)(d)&&(0,i.jsx)("div",{children:(0,i.jsxs)("span",{className:"price-regular",children:[(0,i.jsx)(b.A,{money:n.vat_mode?d.regular_price.total_gross:d.regular_price.total_net}),(0,i.jsx)(S.A,{})]})}),(0,i.jsx)("span",{className:"price",children:d.price&&(0,i.jsx)(b.A,{money:n.vat_mode?d.price.total_gross:d.price.total_net})})]}),!d&&(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"spinner-border"})})]}),(0,i.jsx)("td",{className:"align-middle",children:d&&d.stock&&(0,i.jsx)(j.A,{stockItem:d.stock})}),(0,i.jsx)("td",{className:"align-middle",children:d&&(0,i.jsx)(v.A,{variant:s,product:a,price:d,withStepper:!0,wrapperClass:"variant-add-to-cart",stepperClass:"sm"})})]})},A=e=>{let{product:t,prices:s,variant:r}=e,n=(0,d.wA)(),{t:l,i18n:o}=(0,N.B)();(0,g.Fr)();let[c,h]=a.useState(k(t,r)),u=(0,d.d4)(e=>e.storeConfig),[m,p]=a.useState(!0),x=(0,_.F)(),v=a.useMemo(()=>t.variants.slice((c-1)*10,10*c),[c,t]);a.useEffect(()=>{h(k(t,r))},[r,t]),a.useEffect(()=>{let e=[{variants:v}];r&&e.push({variants:[r]}),n((0,w.$W)(e,!0))},[v,r]);let j=a.useMemo(()=>{if(!t||!t.attribute_definitions)return[];let e=[];return Object.entries(t.attribute_definitions).map((t,s)=>{let[i,a]=t;"combination_unique"===a.constraint&&e.push({key:i,value:a})}),e},[t]);return m&&r?(0,i.jsxs)("div",{className:"mt-5",children:[(0,i.jsxs)("h4",{children:[o.t("Selected variant"),(0,i.jsx)("button",{className:"btn btn-outline-dark btn-sm ml-2",onClick:()=>{p(!1)},children:o.t("Select another ({{total}} variants)",{total:t.variants.length})})]}),(0,i.jsxs)("div",{className:"row rounded bg-light border d-flex align-items-center",children:[(0,i.jsx)("div",{className:"col-sm-1 variant-col",children:(0,i.jsx)("img",{className:"variant-image",src:r.image?r.image.thumbnail:x.thumbnail})}),(0,i.jsx)("div",{className:"col-sm-2 variant-col",children:(0,i.jsx)(y.A,{variant:r})}),(0,i.jsx)("div",{className:"col-sm-3 variant-col",children:r.name})]})]}):(0,i.jsxs)("div",{className:"mt-5",children:[(0,i.jsxs)("h4",{children:[o.t("Select variant"),r&&(0,i.jsx)("button",{className:"btn btn-outline-dark btn-sm ml-2",onClick:()=>{p(!0)},children:o.t("Hide variants")})]}),(0,i.jsx)("small",{children:o.t("Showing {{count}} of {{total}}",{count:v.length,total:t.variants.length})}),(0,i.jsx)("div",{className:"table-responsive",children:(0,i.jsxs)("table",{className:"variants table table-sm table-striped",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{}),(0,i.jsx)("th",{children:o.t("SKU")}),(0,i.jsx)("th",{children:o.t("Name")}),j&&j.map((e,t)=>(0,i.jsx)("th",{children:e.value.name},t)),(0,i.jsx)("th",{}),(0,i.jsx)("th",{}),(0,i.jsx)("th",{})]})}),(0,i.jsx)("tbody",{children:v.map((e,a)=>(0,i.jsx)(E,{active:r&&r.id===e.id,variant:e,product:t,prices:s,attributesInTable:j,storeConfig:u},a))})]})}),(0,i.jsx)(f.A,{total:t.variants.length,currentPage:c,perPage:10,setCurrentPage:h})]})},T=e=>{let{products:t}=e,{t:s,i18n:a}=(0,N.B)(),r=(0,d.d4)(e=>e.storeConfig),n=(0,d.d4)(e=>e.prices);return(0,i.jsx)("div",{className:"table-responsive",children:(0,i.jsxs)("table",{className:"variants table table-sm table-striped",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{}),(0,i.jsx)("th",{children:a.t("SKU")}),(0,i.jsx)("th",{children:a.t("Name")}
1),(0,i.jsx)("th",{children:a.t("Quantity")}),(0,i.jsx)("th",{}),(0,i.jsx)("th",{}),(0,i.jsx)("th",{})]})}),(0,i.jsx)("tbody",{children:t.map((e,t)=>(0,i.jsx)(E,{variant:e.variants[0],product:e,prices:n,storeConfig:r,showQuantity:!0},t))})]})})},M=e=>{let{product:t,compact:s}=e,{t:n,i18n:l}=(0,N.B)(),o=(0,d.wA)(),[c,h]=a.useState(!1),[u,m]=a.useState(null),p=(0,d.d4)(e=>e.storeConfig),v={cross_sell:l.t("Accessories"),up_sell:l.t("Alternatives"),bundle:l.t("Bundle")};return a.useEffect(()=>{let e=async()=>{let e=[];for(let s of t.relations)e.push(s.product_id);let s={ids:[...new Set(e)].join(","),page_size:100};h(!0);let i=await r.A.get("/api/v2/products/get_by_ids/",{params:s});h(!1);let a=i.data.results,n={};for(let e of a)n[e.id]=e;let l=[],c={};for(let e of t.relations){let t=n[e.product_id];if(t)if(c[e.relation_type]||(c[e.relation_type]=[]),e.variant_id){let s={...t},i=t.variants.find(t=>t.id===e.variant_id);if(!i)continue;s.variants=[i],s.quantity=e.quantity,c[e.relation_type].push(s),l.push(s)}else c[e.relation_type].push(t),l.push(t)}o((0,w.$W)(l)),m(c)};if(!t.relations||!t.relations.length)return void m();e(t.relations)},[t]),(0,i.jsxs)("div",{children:[c&&(0,i.jsx)("span",{className:"spinner spinner-border"}),u&&Object.keys(u).map((e,t)=>{var a;let r=u[e];return r&&r.length?(0,i.jsxs)("div",{className:"mt-5",children:[(0,i.jsx)("h4",{className:"text-center",children:l.t(v[e]||(null==(a=p.product_relation_types.find(t=>t.key===e))?void 0:a.name)||e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()))}),s?(0,i.jsx)(T,{products:r}):(0,i.jsx)(x.A,{preLoadedProducts:r})]},e):null})]},t.id)},I=e=>{let{color:t}=e;return(0,i.jsx)("div",{className:"attribute-color",style:{backgroundColor:t}})},P=e=>{let{value:t,valueEnum:s}=e;if(s){if(s.image)return(0,i.jsx)("img",{src:s.image,alt:t});if(s.color)return(0,i.jsxs)("div",{className:"d-flex align-items-center",children:[(0,i.jsx)(I,{color:s.color}),s.label]});if(s.label)return s.label}return Array.isArray(t)?(0,i.jsx)("ul",{className:"no-bullets",children:t.map((e,t)=>(0,i.jsx)("li",{className:"list-no-margin",children:e},t))}):t},L=e=>{let{product:t,variant:s,children:r,header:n}=e,l=s?s.attributes:null,o=t.attribute_definitions,c=a.useMemo(()=>{if(!o)return[];let e=Object.entries(o);return e.sort((e,t)=>e[1].sort<t[1].sort?-1:+(e[1].sort>t[1].sort)),e},[o]);return l||r?(0,i.jsxs)("div",{children:[n&&(0,i.jsx)("h5",{children:n}),(0,i.jsx)("table",{className:"attributes table table-sm table-responsive",children:(0,i.jsxs)("tbody",{children:[l&&o&&c.map((e,t)=>{let[s,a]=e,r=l[s];if(!r)return null;let n=a.values&&a.values[r];return(0,i.jsxs)("tr",{"data-attribute":s,children:[(0,i.jsx)("td",{className:"table-align-top",children:(0,i.jsx)("strong",{children:a.name})}),(0,i.jsxs)("td",{children:[(0,i.jsx)(P,{value:r,valueEnum:n})," ",a.unit]})]},t)}),r]})})]}):null};var D=s(5533),R=s(9533),O=s(9523),q=s(3079),B=s(3968),Y=s(553),X=s(5062),z=s.n(X),F=s(1116),Z=s.n(F);function W(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return"";let s=e;return t&&Object.keys(t).forEach(e=>{s=s.replace(e,t[e])}),s}function U(){return void 0!==s.g.window?s.g.window.innerWidth:0}let K={ESC:27,LEFT_ARROW:37,RIGHT_ARROW:39};class V extends a.Component{static isTargetMatchImage(e){return e&&/ril-image-current/.test(e.className)}static parseMouseEvent(e){return{id:"mouse",source:1,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}static parseTouchPointer(e){return{id:e.identifier,source:2,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}static parsePointerEvent(e){return{id:e.pointerId,source:3,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}static getTransform(e){let{x:t=0,y:s=0,zoom:i=1,width:a,targetWidth:r}=e,n=t,l=U();a>l&&(n+=(l-a)/2);let o=r/a*i;return{transform:"translate3d(".concat(n,"px,").concat(s,"px,0) scale3d(").concat(o,",").concat(o,",1)")}}componentDidMount(){this.props.animationDisabled||this.setState({isClosing:!1}),this.windowContext=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.g.window.self;return t===s.g.window.top||(()=>{try{return s.g.window.location.hostname!==s.g.window.parent.location.hostname}catch(e){return!0}})()?t:e(t.parent)}(),this.listeners={resize:this.handleWindowResize,mouseup:this.handleMouseUp,touchend:this.handleTouchEnd,touchcancel:this.handleTouchEnd,pointerdown:this.handlePointerEvent,pointermove:this.handlePointerEvent,pointerup:this.handlePointerEvent,pointercancel:this.handlePointerEvent}
1,Object.keys(this.listeners).forEach(e=>{this.windowContext.addEventListener(e,this.listeners[e])}),this.loadAllImages()}shouldComponentUpdate(e){return this.getSrcTypes().forEach(t=>{this.props[t.name]!==e[t.name]&&(this.moveRequested=!1)}),!this.moveRequested}componentDidUpdate(e){let t=!1,s={},i={};this.getSrcTypes().forEach(a=>{e[a.name]!==this.props[a.name]&&(t=!0,s[e[a.name]]=!0,i[this.props[a.name]]=!0)}),(t||this.moveRequested)&&(Object.keys(s).forEach(e=>{!(e in i)&&e in this.imageCache&&(this.imageCache[e].loaded=!1)}),this.moveRequested=!1,this.loadAllImages(this.props))}componentWillUnmount(){this.didUnmount=!0,Object.keys(this.listeners).forEach(e=>{this.windowContext.removeEventListener(e,this.listeners[e])}),this.timeouts.forEach(e=>clearTimeout(e))}setTimeout(e,t){let s=setTimeout(()=>{this.timeouts=this.timeouts.filter(e=>e!==s),e()},t);return this.timeouts.push(s),s}setPreventInnerClose(){this.preventInnerCloseTimeout&&this.clearTimeout(this.preventInnerCloseTimeout),this.preventInnerClose=!0,this.preventInnerCloseTimeout=this.setTimeout(()=>{this.preventInnerClose=!1,this.preventInnerCloseTimeout=null},100)}getBestImageForType(e){let t=this.props[e],s={};if(this.isImageLoaded(t))s=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height);else{if(!this.isImageLoaded(this.props["".concat(e,"Thumbnail")]))return null;t=this.props["".concat(e,"Thumbnail")],s=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height,!0)}return{src:t,height:this.imageCache[t].height,width:this.imageCache[t].width,targetHeight:s.height,targetWidth:s.width}}getFitSizes(e,t,s){let i=this.getLightboxRect(),a=i.height-2*this.props.imagePadding,r=i.width-2*this.props.imagePadding;return s||(a=Math.min(a,t),r=Math.min(r,e)),r/a>e/t?{width:e*a/t,height:a}:{width:r,height:t*r/e}}getMaxOffsets(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel,t=this.getBestImageForType("mainSrc");if(null===t)return{maxX:0,minX:0,maxY:0,minY:0};let s=this.getLightboxRect(),i=this.getZoomMultiplier(e),a=0;a=i*t.width-s.width<0?(s.width-i*t.width)/2:(i*t.width-s.width)/2;let r=0;return{maxX:a,maxY:r=i*t.height-s.height<0?(s.height-i*t.height)/2:(i*t.height-s.height)/2,minX:-1*a,minY:-1*r}}getSrcTypes(){return[{name:"mainSrc",keyEnding:"i".concat(this.keyCounter)},{name:"mainSrcThumbnail",keyEnding:"t".concat(this.keyCounter)},{name:"nextSrc",keyEnding:"i".concat(this.keyCounter+1)},{name:"nextSrcThumbnail",keyEnding:"t".concat(this.keyCounter+1)},{name:"prevSrc",keyEnding:"i".concat(this.keyCounter-1)},{name:"prevSrcThumbnail",keyEnding:"t".concat(this.keyCounter-1)}]}getZoomMultiplier(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel;return 1.007**e}getLightboxRect(){return this.outerEl.current?this.outerEl.current.getBoundingClientRect():{width:U(),height:void 0!==s.g.window?s.g.window.innerHeight:0,top:0,right:0,bottom:0,left:0}}clearTimeout(e){this.timeouts=this.timeouts.filter(t=>t!==e),clearTimeout(e)}changeZoom(e,t,s){if(!this.props.enableZoom)return;let i=Math.max(0,Math.min(300,e));if(i===this.state.zoomLevel)return;if(0===i)return void this.setState({zoomLevel:i,offsetX:0,offsetY:0});let a=this.getBestImageForType("mainSrc");if(null===a)return;let r=this.getZoomMultiplier(),n=this.getZoomMultiplier(i),l=this.getLightboxRect(),o=void 0!==t?t-l.left:l.width/2,c=void 0!==s?s-l.top:l.height/2,d=(l.width-a.width*r)/2,h=(l.height-a.height*r)/2,u=d-this.state.offsetX,m=h-this.state.offsetY,p=(l.width-a.width*n)/2,x=(l.height-a.height*n)/2,v=p-(o-(o-u)/r*n),g=x-(c-(c-m)/r*n);if(3!==this.currentAction){let e=this.getMaxOffsets();this.state.zoomLevel>i&&(v=Math.max(e.minX,Math.min(e.maxX,v)),g=Math.max(e.minY,Math.min(e.maxY,g)))}this.setState({zoomLevel:i,offsetX:v,offsetY:g})}closeIfClickInner(e){!this.preventInnerClose&&e.target.className.search(/\bril-inner\b/)>-1&&this.requestClose(e)}handleKeyInput(e){if(e.stopPropagation(),this.isAnimating())return;if("keyup"===e.type){this.lastKeyDownTime-=this.props.keyRepeatKeyupBonus;return}let t=e.which||e.keyCode,s=new Date;if(!(s.getTime()-this.lastKeyDownTime<this.props.keyRepeatLimit)||t===K.ESC)switch(this.lastKeyDownTime=s.getTime(),t){case K.ESC:e.preventDefault(),this.requestClose(e);break;case K.LEFT_ARROW:if(!this.props.prevSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMovePrev(e);break;case K.RIGHT_ARROW:if(!this.props.nextSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMoveNext(e)}}handleOuterMousewheel(e){e.stopPropagation();let t=0;if(this.clearTimeout(this.resetScrollTimeout),this.resetScrollTimeout=this.setTimeout(()=>{this.scrollX=0,this.scrollY=0},300),!(null!==this.wheelActionTimeout||this.isAnimating())){if(Math.abs(e.deltaY)<Math.abs(e.deltaX)){this.scrollY=0,this.scrollX+=e.deltaX;this.scrollX>=200||e.deltaX>=100?(this.requestMoveNext(e),t=500,this.scrollX=0):(this.scrollX<=-200||e.deltaX<=-100)&&(this.requestMovePrev(e),t=500,this.scrollX=0)}0!==t&&(this.wheelActionTimeout=this.setTimeout(()=>{this.wheelActionTimeout=null},t))}}handleImageMouseWheel(e){Math.abs(e.deltaY)>=Math.abs(e.deltaX)&&(e.stopPropagation(),1>Math.abs(e.deltaY)||(this.scrollX=0,this.scrollY+=e.deltaY,this.changeZoom(this.state.zoomLevel-e.deltaY,e.clientX,e.clientY)))}handleImageDoubleClick(e){this.state.zoomLevel>0?this.changeZoom(0,e.clientX,e.clientY):this.changeZoom(this.state.zoomLevel+100,e.clientX,e.clientY)}shouldHandleEvent(e){if(this.eventsSource===e)return!0;
1if(0===this.eventsSource)return this.eventsSource=e,!0;switch(e){case 1:default:return!1;case 2:return this.eventsSource=2,this.filterPointersBySource(),!0;case 3:if(1===this.eventsSource)return this.eventsSource=3,this.filterPointersBySource(),!0;return!1}}addPointer(e){this.pointerList.push(e)}removePointer(e){this.pointerList=this.pointerList.filter(t=>{let{id:s}=t;return s!==e.id})}filterPointersBySource(){this.pointerList=this.pointerList.filter(e=>{let{source:t}=e;return t===this.eventsSource})}handleMouseDown(e){this.shouldHandleEvent(1)&&V.isTargetMatchImage(e.target)&&(this.addPointer(V.parseMouseEvent(e)),this.multiPointerStart(e))}handleMouseMove(e){this.shouldHandleEvent(1)&&this.multiPointerMove(e,[V.parseMouseEvent(e)])}handleMouseUp(e){this.shouldHandleEvent(1)&&(this.removePointer(V.parseMouseEvent(e)),this.multiPointerEnd(e))}handlePointerEvent(e){if(this.shouldHandleEvent(3))switch(e.type){case"pointerdown":V.isTargetMatchImage(e.target)&&(this.addPointer(V.parsePointerEvent(e)),this.multiPointerStart(e));break;case"pointermove":this.multiPointerMove(e,[V.parsePointerEvent(e)]);break;case"pointerup":case"pointercancel":this.removePointer(V.parsePointerEvent(e)),this.multiPointerEnd(e)}}handleTouchStart(e){this.shouldHandleEvent(2)&&V.isTargetMatchImage(e.target)&&([].forEach.call(e.changedTouches,e=>this.addPointer(V.parseTouchPointer(e))),this.multiPointerStart(e))}handleTouchMove(e){this.shouldHandleEvent(2)&&this.multiPointerMove(e,[].map.call(e.changedTouches,e=>V.parseTouchPointer(e)))}handleTouchEnd(e){this.shouldHandleEvent(2)&&([].map.call(e.changedTouches,e=>this.removePointer(V.parseTouchPointer(e))),this.multiPointerEnd(e))}decideMoveOrSwipe(e){this.state.zoomLevel<=0?this.handleSwipeStart(e):this.handleMoveStart(e)}multiPointerStart(e){switch(this.handleEnd(null),this.pointerList.length){case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}multiPointerMove(e,t){switch(this.currentAction){case 1:e.preventDefault(),this.handleMove(t[0]);break;case 2:e.preventDefault(),this.handleSwipe(t[0]);break;case 3:e.preventDefault(),this.handlePinch(t)}}multiPointerEnd(e){switch(0!==this.currentAction&&(this.setPreventInnerClose(),this.handleEnd(e)),this.pointerList.length){case 0:this.eventsSource=0;break;case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}handleEnd(e){switch(this.currentAction){case 1:this.handleMoveEnd(e);break;case 2:this.handleSwipeEnd(e);break;case 3:this.handlePinchEnd(e)}}handleMoveStart(e){let{x:t,y:s}=e;this.props.enableZoom&&(this.currentAction=1,this.moveStartX=t,this.moveStartY=s,this.moveStartOffsetX=this.state.offsetX,this.moveStartOffsetY=this.state.offsetY)}handleMove(e){let{x:t,y:s}=e,i=this.moveStartX-t+this.moveStartOffsetX,a=this.moveStartY-s+this.moveStartOffsetY;(this.state.offsetX!==i||this.state.offsetY!==a)&&this.setState({offsetX:i,offsetY:a})}handleMoveEnd(){this.currentAction=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0;let e=this.getMaxOffsets(),t=Math.max(e.minX,Math.min(e.maxX,this.state.offsetX)),s=Math.max(e.minY,Math.min(e.maxY,this.state.offsetY));(t!==this.state.offsetX||s!==this.state.offsetY)&&(this.setState({offsetX:t,offsetY:s,shouldAnimate:!0}),this.setTimeout(()=>{this.setState({shouldAnimate:!1})},this.props.animationDuration))}handleSwipeStart(e){let{x:t,y:s}=e;this.currentAction=2,this.swipeStartX=t,this.swipeStartY=s,this.swipeEndX=t,this.swipeEndY=s}handleSwipe(e){let{x:t,y:s}=e;this.swipeEndX=t,this.swipeEndY=s}handleSwipeEnd(e){let t=this.swipeEndX-this.swipeStartX,s=Math.abs(t),i=Math.abs(this.swipeEndY-this.swipeStartY);if(this.currentAction=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,!(!e||this.isAnimating())&&!(s<1.5*i)){if(s<200&&s<this.getLightboxRect().width/4)return;t>0&&this.props.prevSrc?(e.preventDefault(),this.requestMovePrev()):t<0&&this.props.nextSrc&&(e.preventDefault(),this.requestMoveNext())}}calculatePinchDistance(){let[e,t]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList;return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}calculatePinchCenter(){let[e,t]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList;return{x:e.x-(e.x-t.x)/2,y:e.y-(e.y-t.y)/2}}handlePinchStart(e){this.props.enableZoom&&(this.currentAction=3,this.pinchTouchList=e.map(e=>{let{id:t,x:s,y:i}=e;return{id:t,x:s,y:i}}),this.pinchDistance=this.calculatePinchDistance())}handlePinch(e){this.pinchTouchList=this.pinchTouchList.map(t=>{for(let s=0;s<e.length;s+=1)if(e[s].id===t.id)return e[s];return t});let t=this.calculatePinchDistance(),s=this.state.zoomLevel+t-this.pinchDistance;this.pinchDistance=t;let{x:i,y:a}=this.calculatePinchCenter(this.pinchTouchList);this.changeZoom(s,i,a)}handlePinchEnd(){this.currentAction=0,this.pinchTouchList=null,this.pinchDistance=0}handleWindowResize(){this.clearTimeout(this.resizeTimeout),this.resizeTimeout=this.setTimeout(this.forceUpdate.bind(this),100)}handleZoomInButtonClick(){let e=this.state.zoomLevel+100;this.changeZoom(e),300===e&&this.zoomOutBtn.current.focus()}handleZoomOutButtonClick(){let e=this.state.zoomLevel-100;this.changeZoom(e),0===e&&this.zoomInBtn.current.focus()}handleCaptionMousewheel(e){if(e.stopPropagation(),!this.caption.current)return;let{height:t}=this.caption.current.getBoundingClientRect(),{scrollHeight:s,scrollTop:i}=this.caption.current;(e.deltaY>0&&t+i>=s||e.deltaY<0&&i<=0)&&e.preventDefault()}isAnimating(){return this.state.shouldAnimate||this.state.isClosing}isImageLoaded(e){return e&&e in this.imageCache&&this.imageCache[e].loaded}loadImage(e,t,i){if(this.isImageLoaded(t))return void this.setTimeout(()=>{i()},1);let a=new s.g.Image;this.props.imageCrossOrigin&&(a.crossOrigin=this.props.imageCrossOrigin),a.onerror=s=>{this.props.onImageLoadError(t,e,s),this.setState(t=>({loadErrorStatus:{...t.loadErrorStatus,[e]:!0}})),i(s)},a.onload=()=>{this.props.onImageLoad(t,e,a),this.imageCache[t]={loaded:!0,width:a.width,height:a.height},i()},a.src=t}loadAllImages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,t=(e,t)=>s=>{!s&&(this.props[e]!==t||this.didUnmount||this.forceUpdate())};
1this.getSrcTypes().forEach(s=>{let i=s.name;e[i]&&this.state.loadErrorStatus[i]&&this.setState(e=>({loadErrorStatus:{...e.loadErrorStatus,[i]:!1}})),e[i]&&!this.isImageLoaded(e[i])&&this.loadImage(i,e[i],t(i,e[i]))})}requestClose(e){let t=()=>this.props.onCloseRequest(e);if(this.props.animationDisabled||"keydown"===e.type&&!this.props.animationOnKeyInput)return void t();this.setState({isClosing:!0}),this.setTimeout(t,this.props.animationDuration)}requestMove(e,t){let s={zoomLevel:0,offsetX:0,offsetY:0};this.props.animationDisabled||this.keyPressed&&!this.props.animationOnKeyInput||(s.shouldAnimate=!0,this.setTimeout(()=>this.setState({shouldAnimate:!1}),this.props.animationDuration)),this.keyPressed=!1,this.moveRequested=!0,"prev"===e?(this.keyCounter-=1,this.setState(s),this.props.onMovePrevRequest(t)):(this.keyCounter+=1,this.setState(s),this.props.onMoveNextRequest(t))}requestMoveNext(e){this.requestMove("next",e)}requestMovePrev(e){this.requestMove("prev",e)}render(){let{animationDisabled:e,animationDuration:t,clickOutsideToClose:r,discourageDownloads:n,enableZoom:l,imageTitle:o,nextSrc:c,prevSrc:d,toolbarButtons:h,reactModalStyle:u,onAfterOpen:m,imageCrossOrigin:p,reactModalProps:x,loader:v}=this.props,{zoomLevel:g,offsetX:j,offsetY:f,isClosing:b,loadErrorStatus:y}=this.state,w=this.getLightboxRect(),_={};!e&&this.isAnimating()&&(_={..._,transition:"transform ".concat(t,"ms")});let N={};this.getSrcTypes().forEach(e=>{let{name:t,keyEnding:s}=e;N[t]=s});let S=[],C=(e,t,s)=>{if(!this.props[e])return;let r=this.getBestImageForType(e),l={..._,...V.getTransform({...s,...r})};if(g>0&&(l.cursor="move"),null===r&&Object.keys(y).some(e=>y[e]))return void S.push((0,i.jsx)("div",{className:"".concat(t," ril__image ril-errored"),style:l,children:(0,i.jsx)("div",{className:"ril__errorContainer",children:this.props.imageLoadErrorMessage})},this.props[e]+N[e]));if(null===r){let s=void 0!==v?v:(0,i.jsx)("div",{className:"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon",children:[...Array(12)].map((e,t)=>(0,i.jsx)("div",{className:"ril-loading-circle-point ril__loadingCirclePoint"},t))});S.push((0,i.jsx)("div",{className:"".concat(t," ril__image ril-not-loaded"),style:l,children:(0,i.jsx)("div",{className:"ril__loadingContainer",children:s})},this.props[e]+N[e]));return}let c=r.src;n?(l.backgroundImage="url('".concat(c,"')"),S.push((0,i.jsx)("div",{className:"".concat(t," ril__image ril__imageDiscourager"),onDoubleClick:this.handleImageDoubleClick,onWheel:this.handleImageMouseWheel,style:l,children:(0,i.jsx)("div",{className:"ril-download-blocker ril__downloadBlocker"})},c+N[e]))):S.push((0,a.createElement)("img",{...p?{crossOrigin:p}:{},className:"".concat(t," ril__image"),onDoubleClick:this.handleImageDoubleClick,onWheel:this.handleImageMouseWheel,onDragStart:e=>e.preventDefault(),style:l,src:c,key:c+N[e],alt:"string"==typeof o?o:W("Image"),draggable:!1}))},k=this.getZoomMultiplier();C("nextSrc","ril-image-next ril__imageNext",{x:w.width}),C("mainSrc","ril-image-current",{x:-1*j,y:-1*f,zoom:k}),C("prevSrc","ril-image-prev ril__imagePrev",{x:-1*w.width});let E={overlay:{zIndex:1e3,backgroundColor:"transparent",...u.overlay},content:{backgroundColor:"transparent",overflow:"hidden",border:"none",borderRadius:0,padding:0,top:0,left:0,right:0,bottom:0,...u.content}};return(0,i.jsx)(Z(),{ariaHideApp:!1,isOpen:!0,onRequestClose:r?this.requestClose:void 0,onAfterOpen:()=>{this.outerEl.current&&this.outerEl.current.focus(),m()},style:E,contentLabel:W("Lightbox"),appElement:void 0!==s.g.window?s.g.window.document.body:void 0,...x,children:(0,i.jsxs)("div",{className:"ril-outer ril__outer ril__outerAnimating ".concat(this.props.wrapperClassName," ").concat(b?"ril-closing ril__outerClosing":""),style:{transition:"opacity ".concat(t,"ms"),animationDuration:"".concat(t,"ms"),animationDirection:b?"normal":"reverse"},ref:this.outerEl,onWheel:this.handleOuterMousewheel,onMouseMove:this.handleMouseMove,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,tabIndex:"-1",onKeyDown:this.handleKeyInput,onKeyUp:this.handleKeyInput,children:[(0,i.jsx)("div",{className:"ril-inner ril__inner",onClick:r?this.closeIfClickInner:void 0,children:S}),d&&(0,i.jsx)("button",{type:"button",className:"ril-prev-button ril__navButtons ril__navButtonPrev","aria-label":this.props.prevLabel,title:this.props.prevLabel,onClick:this.isAnimating()?void 0:this.requestMovePrev}
1,"prev"),c&&(0,i.jsx)("button",{type:"button",className:"ril-next-button ril__navButtons ril__navButtonNext","aria-label":this.props.nextLabel,title:this.props.nextLabel,onClick:this.isAnimating()?void 0:this.requestMoveNext},"next"),(0,i.jsxs)("div",{className:"ril-toolbar ril__toolbar",children:[(0,i.jsx)("ul",{className:"ril-toolbar-left ril__toolbarSide ril__toolbarLeftSide",children:(0,i.jsx)("li",{className:"ril-toolbar__item ril__toolbarItem",children:(0,i.jsx)("span",{className:"ril-toolbar__item__child ril__toolbarItemChild",children:o})})}),(0,i.jsxs)("ul",{className:"ril-toolbar-right ril__toolbarSide ril__toolbarRightSide",children:[h&&h.map((e,t)=>(0,i.jsx)("li",{className:"ril-toolbar__item ril__toolbarItem",children:e},"button_".concat(t+1))),l&&(0,i.jsx)("li",{className:"ril-toolbar__item ril__toolbarItem",children:(0,i.jsx)("button",{type:"button","aria-label":this.props.zoomInLabel,title:this.props.zoomInLabel,className:["ril-zoom-in","ril__toolbarItemChild","ril__builtinButton","ril__zoomInButton",...300===g?["ril__builtinButtonDisabled"]:[]].join(" "),ref:this.zoomInBtn,disabled:this.isAnimating()||300===g,onClick:this.isAnimating()||300===g?void 0:this.handleZoomInButtonClick},"zoom-in")}),l&&(0,i.jsx)("li",{className:"ril-toolbar__item ril__toolbarItem",children:(0,i.jsx)("button",{type:"button","aria-label":this.props.zoomOutLabel,title:this.props.zoomOutLabel,className:["ril-zoom-out","ril__toolbarItemChild","ril__builtinButton","ril__zoomOutButton",...0===g?["ril__builtinButtonDisabled"]:[]].join(" "),ref:this.zoomOutBtn,disabled:this.isAnimating()||0===g,onClick:this.isAnimating()||0===g?void 0:this.handleZoomOutButtonClick},"zoom-out")}),(0,i.jsx)("li",{className:"ril-toolbar__item ril__toolbarItem",children:(0,i.jsx)("button",{type:"button","aria-label":this.props.closeLabel,title:this.props.closeLabel,className:"ril-close ril-toolbar__item__child ril__toolbarItemChild ril__builtinButton ril__closeButton",onClick:this.isAnimating()?void 0:this.requestClose},"close")})]})]}),this.props.imageCaption&&(0,i.jsx)("div",{onWheel:this.handleCaptionMousewheel,onMouseDown:e=>e.stopPropagation(),className:"ril-caption ril__caption",ref:this.caption,children:(0,i.jsx)("div",{className:"ril-caption-content ril__captionContent",children:this.props.imageCaption})})]})})}constructor(e){super(e),this.state={isClosing:!e.animationDisabled,shouldAnimate:!1,zoomLevel:0,offsetX:0,offsetY:0,loadErrorStatus:{}},this.outerEl=a.createRef(),this.zoomInBtn=a.createRef(),this.zoomOutBtn=a.createRef(),this.caption=a.createRef(),this.closeIfClickInner=this.closeIfClickInner.bind(this),this.handleImageDoubleClick=this.handleImageDoubleClick.bind(this),this.handleImageMouseWheel=this.handleImageMouseWheel.bind(this),this.handleKeyInput=this.handleKeyInput.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleOuterMousewheel=this.handleOuterMousewheel.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.handlePointerEvent=this.handlePointerEvent.bind(this),this.handleCaptionMousewheel=this.handleCaptionMousewheel.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleZoomInButtonClick=this.handleZoomInButtonClick.bind(this),this.handleZoomOutButtonClick=this.handleZoomOutButtonClick.bind(this),this.requestClose=this.requestClose.bind(this),this.requestMoveNext=this.requestMoveNext.bind(this),this.requestMovePrev=this.requestMovePrev.bind(this),this.timeouts=[],this.currentAction=0,this.eventsSource=0,this.pointerList=[],this.preventInnerClose=!1,this.preventInnerCloseTimeout=null,this.keyPressed=!1,this.imageCache={},this.lastKeyDownTime=0,this.resizeTimeout=null,this.wheelActionTimeout=null,this.resetScrollTimeout=null,this.scrollX=0,this.scrollY=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,this.pinchTouchList=null,this.pinchDistance=0,this.keyCounter=0,this.moveRequested=!1}}
1V.propTypes={mainSrc:z().string.isRequired,prevSrc:z().string,nextSrc:z().string,mainSrcThumbnail:z().string,prevSrcThumbnail:z().string,nextSrcThumbnail:z().string,onCloseRequest:z().func.isRequired,onMovePrevRequest:z().func,onMoveNextRequest:z().func,onImageLoadError:z().func,onImageLoad:z().func,onAfterOpen:z().func,discourageDownloads:z().bool,animationDisabled:z().bool,animationOnKeyInput:z().bool,animationDuration:z().number,keyRepeatLimit:z().number,keyRepeatKeyupBonus:z().number,imageTitle:z().node,imageCaption:z().node,imageCrossOrigin:z().string,reactModalStyle:z().shape({}),imagePadding:z().number,wrapperClassName:z().string,toolbarButtons:z().arrayOf(z().node),clickOutsideToClose:z().bool,enableZoom:z().bool,reactModalProps:z().shape({}),nextLabel:z().string,prevLabel:z().string,zoomInLabel:z().string,zoomOutLabel:z().string,closeLabel:z().string,imageLoadErrorMessage:z().node,loader:z().node},V.defaultProps={imageTitle:null,imageCaption:null,toolbarButtons:null,reactModalProps:{},animationDisabled:!1,animationDuration:300,animationOnKeyInput:!1,clickOutsideToClose:!0,closeLabel:"Close lightbox",discourageDownloads:!1,enableZoom:!0,imagePadding:10,imageCrossOrigin:null,keyRepeatKeyupBonus:40,keyRepeatLimit:180,mainSrcThumbnail:null,nextLabel:"Next image",nextSrc:null,nextSrcThumbnail:null,onAfterOpen:()=>{},onImageLoadError:()=>{},onImageLoad:()=>{},onMoveNextRequest:()=>{},onMovePrevRequest:()=>{},prevLabel:"Previous image",prevSrc:null,prevSrcThumbnail:null,reactModalStyle:{},wrapperClassName:"",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",imageLoadErrorMessage:"This image failed to load",loader:void 0};var H=s(9222);D.A.use([R.A,O.A,q.A]);let Q=e=>{let{product:t,variant:s}=e,r=(0,_.F)(),n=a.useMemo(()=>{let e=[];return s&&(s.image&&s.image.preview&&e.push(s.image),s.images&&(e=e.concat(s.images))),t.image&&e.push(t.image),t.images&&(e=e.concat(t.images)),e.length||e.push(r),e.filter((t,s)=>s===e.findIndex(e=>e.thumbnail===t.thumbnail))},[t,s]),[l,o]=a.useState(n),[c,d]=a.useState(!1),[h,u]=a.useState(0),[m,p]=a.useState(null),[x,v]=a.useState(null),g=(0,H.A)(t);return a.useEffect(()=>{o(n[0]),u(0),m&&m.slideTo(0),x&&x.slideTo(0)},[t,s]),(0,i.jsxs)("div",{className:"product-images mb-3",children:[(0,i.jsx)(B.R,{thumbs:{swiper:m},onSwiper:v,a11y:{notificationClass:"custom-swiper-notification"},navigation:!0,className:"mb-3",children:n.map((e,s)=>(0,i.jsx)(Y.q,{className:"d-flex justify-content-center",children:a=>{let{isActive:r,isNext:n,isPrev:l}=a;return(r||n||l)&&(0,i.jsxs)("div",{className:"swiper-grid",children:[g&&g.visible_in_storefront&&(0,i.jsx)("div",{className:"collection-badge",children:g.name}),(0,i.jsx)("img",{width:"240",height:"300",className:"product-image",alt:(null==t?void 0:t.name)?t.name+" - ".concat(s+1):"",src:e.preview,role:"button",tabIndex:0,onClick:()=>{e.image&&(d(!0),u(s))},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),d(!0),u(s))}})]})}},s))}),(0,i.jsx)(B.R,{slidesPerView:4,spaceBetween:10,onSwiper:p,watchSlidesVisibility:!0,watchSlidesProgress:!0,children:n.map((e,t)=>(0,i.jsx)(Y.q,{children:(0,i.jsx)("img",{className:"product-thumbnail",src:e.thumbnail,width:"80",height:"80"})},t))}),c&&(0,i.jsx)(V,{mainSrc:n[h].image,nextSrc:n[(h+1)%n.length].image,prevSrc:n[(h+n.length-1)%n.length].image,onCloseRequest:()=>d(!1),onMovePrevRequest:()=>u((h+n.length-1)%n.length),onMoveNextRequest:()=>u((h+1)%n.length)})]})},G=e=>{let{product:t,onlyVideo:s,header:a}=e;return t.documents&&t.documents.length?(0,i.jsxs)("div",{className:"mb-5",children:[a&&(0,i.jsx)("h5",{children:a}),(0,i.jsx)("div",{className:"product-documents",children:(0,i.jsx)("ul",{children:t.documents.map((e,t)=>{let a=(e=>{if(void 0!==(e=e.replace(/(>|<)/gi,"").split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/|shorts\/)/))[2])return e[2].split(/[^0-9a-z_\-]/i)[0]})(e.url),r=e.url.includes("shorts")?"shorts":"embed",n=(e=>{let t=e.match(/(?:https:\/\/vimeo)\.com.*(?:videos|video|channels|)\/([\d]+)/i);if(t)return t[1]})(e.url),l=a||n;return(0,i.jsxs)("li",{children:[a&&s&&(0,i.jsxs)("div",{className:"video-embed-container",children:["embed"===r&&(0,i.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/".concat(a),frameBorder:"0",allowFullScreen:!0}),"shorts"===r&&(0,i.jsx)("iframe",{width:"560",height:"820",src:"https://www.youtube.com/embed/".concat(a),frameBorder:"0",allowFullScreen:!0})]}),n&&s&&(0,i.jsx)("div",{className:"video-embed-container",children:(0,i.jsx)("iframe",{width:"560",height:"315",src:"https://player.vimeo.com/video/".concat(n),frameBorder:"0",allowFullScreen:!0})}),!l&&!s&&(0,i.jsxs)("a",{href:e.url,title:e.name,target:"blank",children:[(0,i.jsx)("i",{className:"fa fa-link mr-2"}),e.name||e.url]})]},t)})})})]}):null},$=e=>{let{product:t,variant:s,showSku:a}=e,r=(0,_.F)(),n=s.image||(null==t?void 0:t.image)||r;return(0,i.jsxs)("div",{className:"row align-items-center col d-flex",children:[(0,i.jsx)("div",{className:"col-2",children:(0,i.jsx)("img",{src:n.thumbnail,width:40})}),(0,i.jsxs)("div",{className:"col-9",children:[(0,i.jsx)("div",{style:{fontWeight:"bold",whiteSpace:"wrap"},children:s.name}),a&&(0,i.jsx)(y.A,{variant:s,dropdown:!0})]})]})},J=e=>{let{product:t,variant:s}
1=e,[r,n]=a.useState(!1),l=a.useRef(),{t:o,i18n:c}=(0,N.B)(),d=(0,g.Fr)(),h=e=>{!l.current.contains(e.target)&&s&&n(!1)};return a.useEffect(()=>(r?document.addEventListener("mousedown",h):document.removeEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}),[r]),(0,i.jsxs)("div",{className:"my-4",children:[(0,i.jsx)("h6",{children:s?c.t("Selected variant"):c.t("Select variant")}),(0,i.jsxs)("div",{className:"dropdown",ref:l,children:[(0,i.jsx)("button",{className:"btn btn-light btn-block border btn-lg text-left dropdown-toggle d-flex align-items-center ".concat(r?"show":""),type:"button",onClick:()=>{n(!r)},children:s?(0,i.jsx)($,{product:t,variant:s,showSku:!1}):(0,i.jsx)("div",{className:"col",children:c.t("Select variant")})}),(0,i.jsx)("div",{className:"dropdown-container dropdown-menu w-100 ".concat(r?"show":""),"aria-labelledby":"dropdownMenuButton",children:t.variants.map((e,a)=>(0,i.jsx)(p(),{scroll:!1,href:(0,g.TE)({type:"variant",data:e,product:t},d),children:(0,i.jsx)("span",{className:"dropdown-item ".concat(s&&e.id===s.id?"active":""),onClick:()=>{n(!1)},children:(0,i.jsx)($,{product:t,variant:e,showSku:!0})})},a))})]})]})},ee=e=>{let{primaryCategory:t,categories:s,product:r}=e,{t:n,i18n:l}=(0,N.B)(),o=(0,g.Fr)(),c=a.useMemo(()=>{if(t){let e=[t],i=t.parent;for(;i;){let t=s[i];if(!t){i=null;continue}e.unshift(t),i=t.parent}return e}return[]},[t]);return(0,i.jsxs)("nav",{"aria-label":"breadcrumb",children:[(0,i.jsx)("div",{className:"breadcrumb-compact d-block d-md-none my-3",children:t&&(0,i.jsxs)(p(),{href:(0,g.TE)({type:"category",data:t},o),children:[(0,i.jsx)("i",{className:"fa fa-arrow-left"})," ",t.name]})}),(0,i.jsxs)("ol",{className:"breadcrumb d-none d-md-flex",children:[(0,i.jsx)("li",{className:"breadcrumb-item","aria-current":"page",children:(0,i.jsx)("a",{href:"/",children:l.t("Home")})}),c&&c.map((e,t)=>(0,i.jsx)("li",{className:"breadcrumb-item","aria-current":"page",children:(0,i.jsx)(p(),{href:(0,g.TE)({type:"category",data:e},o),children:e.name})},t)),(0,i.jsx)("li",{className:"breadcrumb-item active","aria-current":"page",children:r.name})]})]})};var et=s(3628);let es=e=>{let{autoDetails:t,header:s}=e;return t&&t.links?(0,i.jsxs)("div",{children:[s&&(0,i.jsx)("h5",{children:s}),t.links.map((e,t)=>(0,i.jsxs)("div",{className:"mb-3 mt-3",children:[(0,i.jsx)("div",{className:"mb-2",children:(0,i.jsxs)("strong",{children:[(0,i.jsx)("a",{className:"fa fa-check-circle"})," ",e.generic]})}),e.attributes&&e.attributes.length>0&&(0,i.jsx)("table",{className:"table table-sm table-striped table-responsive",children:(0,i.jsx)("tbody",{children:(0,i.jsx)(et.A,{type:"table",attributes:e.attributes})})})]},t))]}):null},ei=e=>{let{currentVehicle:t,autoDetails:s,primaryCategory:a}=e,r=(0,d.wA)(),n=(0,g.Fr)();return s?t&&s.links?(0,i.jsxs)("div",{className:"alert alert-success p-2 my-2  text-center",children:[(0,i.jsx)("i",{className:"fa fa-car"})," This product matches ",t.manufacturer," ",t.full_name]}):t&&s.has_links&&!s.links?(0,i.jsxs)("div",{className:"alert alert-danger p-2 my-2  text-center",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("i",{className:"fa fa-car"})," Product doesn't match your vehicle!"]}),a&&(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:"Find other products that matches your vehicle in "}),(0,i.jsx)(p(),{href:(0,g.TE)({type:"category",data:a},n),children:a.name})]})]}):!t&&s.has_links?(0,i.jsxs)("div",{className:"alert alert-warning p-2 my-2 text-center",onClick:()=>r({type:"SET_DRAWER_CONTEXT",data:"vehicle"}),style:{cursor:"pointer"},children:[(0,i.jsx)("i",{className:"fa fa-car"})," Check if this product matches your vehicle!"]}):null:null},ea=e=>{let{name:t,numbers:s}=e,[r,n]=a.useState(!1);return(0,i.jsxs)("li",{className:"list-group-item",children:[(0,i.jsxs)("div",{className:"d-flex justify-content-between align-items-center",children:[(0,i.jsxs)("a",{href:"#",onClick:e=>{e.preventDefault(),n(!r)},children:[r?(0,i.jsx)("i",{className:"fa fa-minus"}):(0,i.jsx)("i",{className:"fa fa-plus"}),"\xa0",t]}),(0,i.jsx)("span",{className:"badge badge-primary badge-pill",children:s.length})]}),r&&(0,i.jsx)("ul",{className:"children",children:s.map((e,t)=>(0,i.jsx)("li",{children:(0,i.jsx)(p(),{href:{pathname:"/search",query:{q:e,mode:"number"}},children:e})},t))})]})},er=e=>{let{variant:t}=e,[s,n]=a.useState(null);return a.useEffect(()=>{let e=async()=>{n((await r.A.get("/api/v2/products/".concat(t.id,"/get_auto_numbers/"))).data)};t?e():n(null)},[t]),(0,i.jsxs)("div",{className:"product-numbers",children:[!s&&(0,i.jsx)("span",{className:"spinner-border"}),s&&(0,i.jsx)("ul",{className:"list-group",children:s.map((e,t)=>{let{name:s,numbers:a}=e;return(0,i.jsx)(ea,{name:s,numbers:a},t)})})]})},en=e=>{let{variant:t,name:s,id:n}
1=e,[l,o]=a.useState(!1),[c,d]=a.useState(null);return a.useEffect(()=>{let e=async()=>{d((await r.A.get("/api/v2/products/".concat(t.id,"/get_auto_vehicles/"),{params:{model_id:n}})).data)};l&&!c&&n&&e()},[n,l]),(0,i.jsxs)("li",{className:"py-1",children:[(0,i.jsx)("div",{children:(0,i.jsxs)("a",{href:"#",onClick:e=>{e.preventDefault(),o(!l)},children:[l?(0,i.jsx)("i",{className:"fa fa-minus"}):(0,i.jsx)("i",{className:"fa fa-plus"}),"\xa0",s]})}),l&&(c?(0,i.jsxs)("table",{className:"table table-sm ml-2 my-3 table-hover table-responsive",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"#"}),(0,i.jsx)("th",{children:"Vehicle"}),(0,i.jsx)("th",{children:"Year"}),(0,i.jsx)("th",{children:"Engine type"}),(0,i.jsx)("th",{children:"Engine hp"}),(0,i.jsx)("th",{children:"Engine kw"}),(0,i.jsx)("th",{children:"Product type"})]})}),(0,i.jsx)("tbody",{children:c.map((e,t)=>{let{vehicle:s,generic:a}=e;return(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:s.id}),(0,i.jsx)("td",{children:s.name}),(0,i.jsxs)("td",{children:[s.year_from," - ",s.year_to]}),(0,i.jsx)("td",{children:s.engine_type}),(0,i.jsx)("td",{children:s.engine_hp}),(0,i.jsx)("td",{children:s.engine_kw}),(0,i.jsx)("td",{children:a})]},t)})})]}):(0,i.jsx)("span",{className:"spinner-border"}))]})},el=e=>{let{variant:t,name:s,id:n}=e,[l,o]=a.useState(!1),[c,d]=a.useState(null);return a.useEffect(()=>{let e=async()=>{d((await r.A.get("/api/v2/products/".concat(t.id,"/get_auto_vehicles/"),{params:{manufacturer_id:n}})).data)};l&&!c&&n&&e()},[n,l]),(0,i.jsxs)("li",{className:"list-group-item",children:[(0,i.jsx)("div",{children:(0,i.jsxs)("a",{href:"#",onClick:e=>{e.preventDefault(),o(!l)},children:[l?(0,i.jsx)("i",{className:"fa fa-minus"}):(0,i.jsx)("i",{className:"fa fa-plus"}),"\xa0",s]})}),l&&(c?(0,i.jsx)("ul",{className:"children pl-3",children:c.map((e,s)=>(0,i.jsx)(en,{variant:t,name:e.name,id:e.id},s))}):(0,i.jsx)("span",{className:"spinner-border"}))]})},eo=e=>{let{variant:t}=e,[s,n]=a.useState(null);return a.useEffect(()=>{let e=async()=>{n((await r.A.get("/api/v2/products/".concat(t.id,"/get_auto_vehicles/"))).data)};t?e():n(null)},[t]),(0,i.jsxs)("div",{className:"product-vehicles",children:[!s&&(0,i.jsx)("span",{className:"spinner-border"}),s&&(0,i.jsx)("ul",{className:"list-group",children:s.map((e,s)=>{let{id:a,name:r}=e;return(0,i.jsx)(el,{variant:t,name:r,id:a},s)})})]})},ec=e=>{let{tabs:t,children:s,className:r}=e,[n,l]=a.useState(t[0].name);return(0,i.jsxs)("div",{className:r,children:[(0,i.jsx)("ul",{className:"nav nav-tabs nav-fill",children:t.map((e,t)=>{let{label:s,name:a}=e;return(0,i.jsx)("li",{className:"nav-item",children:(0,i.jsx)("a",{className:"nav-link ".concat(a===n?"active":""),onClick:e=>{e.preventDefault(),l(a)},href:"#",children:s})},a)})}),(0,i.jsx)("div",{children:s({activeTab:n})})]})};var ed=s(9038),eh=s(9099),eu=s(5072),em=s(6888);let ep=e=>{var t,s,a;let{price:r,variant:n,showQuantity:l}=e,o=null!=(s=null==r?void 0:r.stock)?s:null==n?void 0:n.stock,c=null==(t=null!=(a=null==n?void 0:n.extra_stocks)?a:null==r?void 0:r.extra_stocks)?void 0:t.slice().sort((e,t)=>(0===e.mode)-(0===t.mode)),d=(null==o?void 0:o.in_stock)?null==c?void 0:c.filter(e=>e.in_stock||3===e.mode):c;return(0,i.jsx)("div",{className:"extra-stocks-container",children:(null==d?void 0:d.length)>0&&(0,i.jsx)("div",{className:"extra-stocks-list",children:d.map((e,t)=>{let s=0===e.mode&&(0===t||0!==d[t-1].mode),a=e.status?e.name||e.key||"":e.label||e.name||e.key||"";return(0,i.jsxs)("div",{className:"extra-stocks-list-item",style:s?{paddingTop:25}:void 0,children:[a?"".concat(a,":"):""," ",(0,i.jsx)(j.A,{stockItem:e,showQuantity:l})]},t)})})})};var ex=s(4979);let ev=e=>(0,i.jsx)(ex.A,{widgetId:"lipscore-rating",...e}),eg=e=>(0,i.jsx)(ex.A,{widgetId:"lipscore-review-list",...e}),ej=e=>{let{tiers:t,quantity:s,vatMode:a}=e,{t:r}=(0,N.B)();if(!t||t.length<2)return null;let n=Number(s)||1,l=t.reduce((e,t,s)=>t.quantity<=n?s:e,0);return(0,i.jsxs)("div",{className:"price-tiers-wrapper",children:[(0,i.jsx)("div",{className:"price-tiers-title",children:r("
1Volume pricing")}),(0,i.jsxs)("table",{className:"price-tiers",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{className:"price-tiers-qty",children:r("Quantity")}),(0,i.jsx)("th",{className:"price-tiers-price",children:r("Price/unit")})]})}),(0,i.jsx)("tbody",{children:t.map((e,s)=>{let r=a?e.price.total_gross:e.price.total_net;return(0,i.jsxs)("tr",{className:"price-tier ".concat(s===l?"price-tier-active":""),children:[(0,i.jsx)("td",{className:"price-tiers-qty",children:((e,t)=>{if(!t)return"".concat(e.quantity,"+");let s=t.quantity-1;return s<=e.quantity?"".concat(e.quantity):"".concat(e.quantity,"–").concat(s)})(e,t[s+1])}),(0,i.jsx)("td",{className:"price-tiers-price",children:r&&(0,i.jsx)(b.A,{money:r})})]},e.quantity)})})]})]})},ef=e=>{let{options:t,value:s,onChange:a,isClearable:r,placeholder:n}=e;return(0,i.jsx)("div",{className:"button-select",children:t.map((e,t)=>(0,i.jsx)("button",{disabled:e.disabled,className:"m-1 btn btn-sm ".concat((null==s?void 0:s.value)===e.value?"btn-primary":"btn-outline-primary"),onClick:()=>{e.disabled||a(e)},style:e.disabled?{cursor:"not-allowed",opacity:"0.3"}:{},children:e.label},t))})},eb=(e,t)=>e.attributes&&e.attributes[t.slug]&&e.attributes[t.slug][0]||null,ey=function(e){var t,s,n;let{product:o,variant:h}=e,m=(0,d.d4)(e=>e.prices),p=(0,d.wA)(),{t:x,i18n:f}=(0,N.B)(),_=(0,d.d4)(e=>e.currentVehicle),k=(0,d.d4)(e=>e.storeConfig);(0,d.d4)(e=>e.layoutContent);let E=(0,d.d4)(e=>e.categories),[T,I]=a.useState(null),[P,D]=a.useState({}),[R,O]=a.useState([]),[q,B]=a.useState(1),Y=(0,eh.useRouter)(),X=(0,g.Fr)(),z=Y.query.category,F=o.variants&&o.variants.length>1,Z=F&&o.variants.length>10,W=h&&h.auto_types&&h.auto_types.length,U=h&&m[h.id],K=null!=(n=null==U?void 0:U.stock)?n:null==h?void 0:h.stock;a.useEffect(()=>{B(1)},[null==h?void 0:h.id]);let V=a.useMemo(()=>{if(!o||!o.attribute_definitions||!o.variants||o.variants.length<1)return;let e=[];
1if(Object.entries(o.attribute_definitions).map((t,s)=>{let[i,a]=t;"combination_unique"===a.constraint&&e.push({slug:i,info:a,values:[]})}),e.length){for(let t of e){for(let e of o.variants){let s=e.attributes&&e.attributes[t.slug]||[null];s&&!t.values.includes(s[0])&&t.values.push(s[0])}if(o.attribute_definitions&&o.attribute_definitions[t.slug]&&"K"==o.attribute_definitions[t.slug].attribute_type&&o.attribute_definitions[t.slug].values){let e=o.attribute_definitions[t.slug].values;t.values.sort((t,s)=>{var i,a;let r=null==(i=e[t])?void 0:i.sort,n=null==(a=e[s])?void 0:a.sort;return(r=void 0===r?9999:r)-(n=void 0===n?9999:n)})}t.options=t.values.map(e=>({value:e,label:e||"-"}))}return e}},[o]),H=a.useCallback((e,t)=>{let s=[];for(let t of o.variants){let i=!0,a=!1;for(let s of V){let r=e[s.slug];if(!r){a=!0;break}i=i&&r.value===eb(t,s)}if(a)break;i&&s.push(t)}1===s.length?((t?Y.replace:Y.push)((0,g.TE)({type:"variant",data:s[0],product:o},X)),O([])):s.length>1?O(s):h&&(Y.push((0,g.TE)({type:"product",data:o},X)),O([]))},[o,h]),ea=a.useCallback((e,t)=>{let s={...P,[e]:t};D(s),H(s)},[P]);a.useEffect(()=>{if(!V||!V.length)return;let e={};if(h)for(let t of V){let s=h.attributes&&h.attributes[t.slug]&&h.attributes[t.slug][0]||null,i=t.options.find(e=>e.value===s);e[t.slug]=i}else{let t=!1,s=0;for(let i of V){if(t)if(1===i.options.length);else if("size"===i.slug)s=Math.floor(i.options.length/2);else break;else t=!0;e[i.slug]=i.options[s]}H(e,!0)}D(e)},[h,V]),a.useMemo(()=>{if(!V||!V.length)return;let e=[...o.variants];for(let t of V){let s=P[t.slug];s&&(e=e.filter(e=>s.value===eb(e,t)))}for(let t of V){let s=[];if(!P[t.slug])for(let i of t.options)e.find(e=>i.value===eb(e,t))||s.push(i.value);for(let e of t.options)e.disabled=s.includes(e.value)}},[V,P]);let en=a.useMemo(()=>{if(o.categories){let t;if(z){try{for(let s of o.categories){let i=s.id;for(;i;){var e;if(i.toString()===z){t=s;break}i=null==(e=E[i])?void 0:e.parent}}}catch(e){}if(t)return E[t.id]}for(let e of o.categories){let s=!0,i=e.id;for(;i;){let e=E[i];if(!e){i=null,s=!1;break}i=e.parent}if(s){t=e;break}}if(t)return E[t.id]}},[o]);a.useEffect(()=>{I(null);let e=async()=>{let e={};_&&(e.vehicle_id=(0,ed.G)(_)),I((await r.A.get("/api/v2/products/".concat(h.id,"/get_auto_details/"),{params:e})).data)};W&&e()},[h,_]),a.useEffect(()=>{Z||p((0,w.$W)([o],!0))},[o]);let el=a.useMemo(()=>{var e,t,s,i;if(!h||!U||!U.price)return null;let a=U.price.total_gross;return{"@context":"http://www.schema.org","@type":"product",brand:o.brand?o.brand.name:void 0,name:o.name,image:null!=(i=null!=(s=null==(e=h.image)?void 0:e.image)?s:null==(t=o.image)?void 0:t.image)?i:null,sku:h.sku,description:o.description,offers:{"@type":"Offer",price:a.centAmount/10**a.fractionDigits,priceCurrency:a.currencyCode,availability:(null==K?void 0:K.in_stock)?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}},[o,h,U]);a.useEffect(()=>{if(!h||!U||!U.price)return;let e={event:"product",product_ids:h.sku,page_type:"product",total_value:(0,em.QL)(U.price.total_gross),ecommerce:{currencyCode:U.price.total_gross.currencyCode,detail:{products:[(0,em.Ug)({product:o,variant:h,price:U})]}}};u().dataLayer({dataLayer:e})},[o,h,U]);let ex=o.meta_title?o.meta_title:o.name,ey=a.useMemo(()=>{if(o.meta_description)return o.meta_description;if(o.description){let e=o.description.replace(/(<([^>]+)>)/ig,"");return e.length>160?e.substring(0,157)+"...":e}return null},[o]);return(0,i.jsxs)("div",{className:"container product-details my-2",children:[(0,i.jsxs)(l(),{children:[(0,i.jsx)("title",{children:ex}),(0,i.jsx)("meta",{property:"og:title",content:ex}),ey&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("meta",{name:"description",content:ey}),(0,i.jsx)("meta",{property:"og:description",content:ey})]}),el&&(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(el).replace(/</g,"\\u003c").replace(/>/g,"\\u003e")}})]}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)(ee,{primaryCategory:en,categories:E,product:o,variant:h})})}),(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("div",{className:"col-12 col-sm-4",children:(0,i.jsx)(Q,{product:o,variant:h})}),(0,i.jsxs)("div",{className:"col-12 col-sm-8",children:[(0,i.jsx)("h1",{className:"product-name",children:(0,i.jsx)(eu.A,{product:o,variant:h})}),(0,i.jsx)(ev,{product:o,price:null==U||null==(t=U.price)?void 0:t.total_gross}),o.brand&&(0,i.jsx)("h3",{children:o.brand.name}),o.short_description&&(0,i.jsx)("p",{className:"shortDesc",children:o.short_description}),(0,i.jsxs)("div",{children:[V&&(0,i.jsx)("div",{className:"my-5 variant-attribute-options",children:V.map((e,t)=>(0,i.jsxs)("div",{className:"my-3 option",children:[(0,i.jsx)("h6",{children:e.info.name}),(0,i.jsx)(ef,{options:e.options,value:P[e.slug]||null,onChange:t=>{ea(e.slug,t)},isClearable:!0,placeholder:f.t("Select...")})]},t))}),!V&&F&&!Z&&(0,i.jsx)(J,{product:o,variant:h}),F&&V&&R.length>1&&(0,i.jsx)(J,{product:{...o,variants:R},variant:h}),!V&&h&&F&&Z&&(0,i.jsxs)("div",{className:"my-4",children:[(0,i.jsx)("h6",{children:f.t("Selected variant")}),(0,i.jsx)("div",{className:"rounded bg-light",children:(0,i.jsx)($,{product:o,variant:h,showSku:!0})})]}),h&&(0,i.jsxs)("div",{children:[f.t("SKU")," ",(0,i.jsx)(y.A,{variant:h})]}),T&&(0,i.jsx)(ei,{autoDetails:T,primaryCategory:en,currentVehicle:_}),(0,i.jsxs)("div",{className:"product-price-container my-4",children:[U&&(0,i.jsxs)("div",{children:[(0,C.rI)(U)&&(0,i.jsx)("div",{children:(0,i.jsxs)("span",{className:"price-regular",children:[(0,i.jsx)(b.A,{money:k.vat_mode?U.regular_price.total_gross:U.regular_price.total_net}),(0,i.jsx)(S.A,{})]})}),(0,i.jsx)("span",{className:"price ".concat((0,C.rI)(U)?"price-discounted":""),children:U.price&&(0,i.jsx)(b.A,{money:k.vat_mode?U.price.total_gross:U.price.total_net})}),U.unit&&(0,i.jsxs)("small",{children:[" / ",U.unit.name]}),U.price&&(0,i.jsx)("div",{className:"vat-text",children:k.vat_mode?f.t("VAT incl."):f.t("VAT excl.")}),(0,i.jsx)(ej,{tiers:U.price_tiers,quantity:q,vatMode:k.vat_mode}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"stock-item",children:K&&(0,i.jsxs)(i.Fragment,{children:[(K.location_label||K.label&&!K.status)&&(0,i.jsxs)("div",{className:"stock-web-stock-title",children:[K.location_label||K.label,":"]}
1),(0,i.jsx)(j.A,{stockItem:K})]})}),(0,i.jsx)(ep,{price:U,variant:h,showQuantity:"no"})]})]}),h&&!U&&(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"spinner-border"})}),U&&!(null==K?void 0:K.disabled)&&(0,i.jsx)(v.A,{product:o,price:U,variant:h,withStepper:!0,quantity:q,onQuantityChange:B,wrapperClass:"add-to-cart-primary",children:f.t("Add to cart")})]})]}),(0,i.jsx)(c.E,{name:"product-details-main"})]})]}),Z&&(0,i.jsx)(A,{product:o,prices:m,variant:h}),(0,i.jsx)("hr",{}),W?(0,i.jsxs)("div",{className:"row py-5",children:[(0,i.jsx)("div",{className:"col-12 col-md-8",children:(0,i.jsx)(ec,{tabs:[{label:f.t("Specification"),name:"specification"},{label:f.t("OEM"),name:"oem"},{label:f.t("Matching vehicles"),name:"vehicles"}],className:"product-tabs",children:e=>{let{activeTab:t}=e;return"specification"===t?(0,i.jsxs)(i.Fragment,{children:[T&&(0,i.jsx)("div",{className:"mb-3",children:(0,i.jsx)(es,{header:f.t("Specification for your vehicle"),autoDetails:T})}),(0,i.jsx)(L,{product:o,variant:h,header:f.t("Technical specification"),children:T&&T.attributes&&(0,i.jsx)(et.A,{attributes:T.attributes,type:"table"})}),(0,i.jsx)(G,{product:o,header:f.t("Documents")}),o.description&&(0,i.jsx)("div",{className:"mb-3",children:(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:o.description}})}),(0,i.jsx)(G,{product:o,onlyVideo:!0})]}):"oem"===t?(0,i.jsx)(er,{variant:h}):"vehicles"===t?(0,i.jsx)(eo,{variant:h}):null}})}),(0,i.jsx)("div",{className:"col-12 col-md-4",children:(0,i.jsx)(c.E,{name:"product-details-side"})})]}):(0,i.jsxs)("div",{className:"row py-5",children:[(0,i.jsxs)("div",{className:"col-12 col-md-6",children:[o.description&&(0,i.jsxs)("div",{className:"mb-5",children:[(0,i.jsx)("h5",{children:f.t("Description")}),(0,i.jsx)("div",{className:"description",dangerouslySetInnerHTML:{__html:o.description}})]}),(0,i.jsx)(G,{product:o,onlyVideo:!0})]}),(0,i.jsxs)("div",{className:"col-12 col-md-6",children:[(0,i.jsx)(G,{product:o,header:f.t("Documents")}),(0,i.jsx)(L,{product:o,variant:h,header:f.t("Specification")}),(0,i.jsx)(c.E,{name:"product-details-side"})]})]}),(0,i.jsx)(M,{product:o}),h&&(0,i.jsx)(M,{product:h,compact:!0}),(0,i.jsx)(c.E,{name:"product-details-below",context:{product:o}}),(0,i.jsx)(eg,{product:o,price:null==U||null==(s=U.price)?void 0:s.total_gross})]})};var ew=s(9656),e_=s(8080);let eN=()=>{let{t:e,i18n:t}=(0,N.B)(),s=(0,g.Fr)();return(0,i.jsxs)("div",{className:"container py-5",children:[(0,i.jsx)("h1",{children:e("Cart")}),(0,i.jsx)(e_.A,{editable:!0}),(0,i.jsx)("div",{className:"row d-flex mt-5",children:(0,i.jsx)(p(),{href:(0,g.TE)({type:"storefront",path:"checkout"},s),children:(0,i.jsx)("span",{className:"btn btn-success btn-lg ml-auto",children:e("To checkout")})})})]})};var eS=s(8176),eC=s(2316),ek=s(2038),eE=s(8993),eA=s(5003),eT=s(7311),eM=s(8679);let eI=e=>{var t,s,n;let{}=e,l=(0,d.d4)(e=>e.storeConfig),{checkoutData:o,isEditing:c,updateShippingMethod:h,multiplePaymentMethods:u}=a.useContext(eM.A),[m,p]=a.useState();a.useEffect(()=>{let e=o.cart;e&&e.items&&e.items.length&&r.A.post("/api/v2/checkout/mycart/check_inventory/",void 0,{withCredentials:!0}).then(e=>{e.data.items?p(e.data.items):p(null)}).catch(e=>{p(null)}).finally(()=>{})},[o.cart]);let x=a.useMemo(()=>m&&m.filter(e=>!e.allow_backorder).length>0,[m]),v=(null==(t=l.checkout_customer_types)?void 0:t.length)>1,g=(null==(s=o.shipping_methods)?void 0:s.length)>0,j=null==(n=o.shipping_methods)?void 0:n.find(e=>e.is_selected);return(0,i.jsxs)("div",{children:[(0,i.jsx)(ek.A,{inventoryItems:m}),v&&(0,i.jsx)(eT.A,{}),g&&(0,i.jsx)(eE.A,{}),(!g||j)&&!x&&(0,i.jsx)(eA.A,{})]})},eP="/api/v2/checkout/mycart/",eL=e=>
1{let[t,s]=a.useState(null),[n,l]=a.useState(null),[o,h]=a.useState(!1),[m,p]=a.useState(),[x,v]=a.useState(null),[g,j]=a.useState(!1),[f,b]=a.useState(0),y=(0,d.d4)(e=>e.country),w=a.useMemo(()=>({country:y}),[y]),_=(0,eh.useRouter)();(0,d.wA)();let{t:S,i18n:C}=(0,N.B)();a.useEffect(()=>{k()},[]);let k=async()=>{v(!0);try{let e=await r.A.get(eP,{params:w,withCredentials:!0});s(e.data),await E()}catch(e){e.response&&404===e.response.status&&s({cart:{items:[]}})}v(!1)},E=async()=>{l(null),l((await r.A.post("".concat(eP,"get_payment_data/"),{},{params:w,withCredentials:!0})).data)},A=async e=>{v(!0),s((await r.A.post("".concat(eP,"update_customer_type/"),{customer_type:e},{params:w,withCredentials:!0})).data),await E(),v(!1),p()},T=async e=>{v(!0),s((await r.A.post("".concat(eP,"update_shipping_method/"),{shipping_method_key:e.key},{params:w,withCredentials:!0})).data),await E(),v(!1),p()},M=async e=>{v(!0);try{let t=await r.A.post("".concat(eP,"update_discount_codes/"),{discount_code:e},{withCredentials:!0});s(t.data),await E(),v(!1),p()}catch(e){throw v(!1),e}},I=async()=>{v(!0);try{let e=await r.A.delete("".concat(eP,"update_discount_codes/"),{withCredentials:!0});s(e.data),await E(),v(!1),p()}catch(e){throw v(!1),e}},P=async(e,t)=>{v(!0);try{let i=await r.A.post("".concat(eP,"switch_").concat(e,"/"),t,{params:w,withCredentials:!0});s(i.data),await E(),v(!1),p()}catch(e){if(v(!1),e.response&&400===e.response.status)return e.response.data;return{non_field_errors:e.message}}},L=async(e,t)=>{v(!0);try{let t=await r.A.post("".concat(eP,"update_form/"),e,{params:w,withCredentials:!0});s(t.data),await E(),p(),v(!1),j(!1),b(f+1)}catch(e){if(v(!1),e.response&&400===e.response.status)return e.response.data;return{[eC.Ym]:e.message}}},D=async()=>{if(!o)return void p("You must accept terms");v(!0),p();try{let e=await r.A.post("".concat(eP,"purchase/"),null,{params:w,withCredentials:!0});v(!1),"confirmation"===e.data.action&&_.push({pathname:"confirmation",query:{order_id:e.data.order_id}})}catch(e){v(!1),e.response&&400===e.response.status?p(e.response.data.detail):p(e.message)}};a.useEffect(()=>{if(!t||!t.cart||!t.cart.total)return;let e={event:"checkout",product_ids:t.cart.items.map(e=>{var t;return(null==(t=e.variant)?void 0:t.sku)||e.product_code}),page_type:"cart",total_value:(0,em.QL)(t.cart.total.total_gross),ecommerce:{currencyCode:t.cart.total.total_gross.currencyCode,checkout:{actionField:{step:2},products:t.cart.items.map((e,t)=>(0,em.kV)({item:e}))}}};u().dataLayer({dataLayer:e})},[t]);let R=t&&t.payment_methods&&t.payment_methods.find(e=>e.is_selected),O=t&&t.payment_methods&&t.payment_methods.length>1,q=t&&!t.cart.items.length,B=R&&"checkout"===R.mode;return(0,i.jsx)(eM.A.Provider,{value:{currentPaymentMethod:R,multiplePaymentMethods:O,missingCart:q,modeIsCheckout:B,checkoutData:t,paymentData:n,updateForm:L,switchAddress:P,updateCustomerType:A,updateShippingMethod:T,addDiscountCode:M,removeDiscountCode:I,loadCheckout:k,onPurchase:D,updateFormCounter:f,isEditing:g,setIsEditing:j,acceptTerms:o,setAcceptTerms:h,error:m,setError:p},children:(0,i.jsxs)("div",{className:"checkout",children:[x&&(0,i.jsx)("div",{className:"loading-container",children:(0,i.jsx)("span",{className:"spinner spinner-border"})}),(0,i.jsxs)("div",{className:"container",children:[t&&q&&(0,i.jsx)("div",{className:"section",children:(0,i.jsx)("h3",{children:C.t("Your'e cart is empty!")})}),t&&!q&&(0,i.jsx)(c.E,{name:"checkout",fallback:()=>(0,i.jsx)(eI,{})})]})]})})};var eD=s(3210);let eR=e=>{let{}=e,t=(0,eh.useRouter)(),[s,n]=a.useState(!0),[l,c]=a.useState(),[h,m]=a.useState(),{t:p,i18n:x}=(0,N.B)(),v=(0,d.d4)(e=>e.layoutContent),{order_id:g}=t.query,j=(0,d.wA)();return a.useEffect(()=>{j({type:"SET_CART_COUNT",data:0})},[]),a.useEffect(()=>{let e=async e=>{n(!0);try{let t=await r.A.get("/api/v2/checkout/".concat(e,"/confirm/"),{withCredentials:!0});c(t.data.order),m(t.data.payment_data)}catch(e){c(null)}n(!1)};g?e(g):n(!1)},[g]),a.useEffect(()=>{if(!l)return;let e={event:"purchase",product_ids:l.items.map(e=>{var t;return(null==(t=e.variant)?void 0:t.sku)||e.product_code}),page_type:"purchase",total_value:(0,em.QL)(l.total.total_gross),ecommerce:{currencyCode:l.total.total_gross.currencyCode,purchase:{actionField:{id:l.number,revenue:(0,em.IN)(l.total.total_gross),tax:(0,em.IN)(l.total.total_tax),shipping:(0,em.IN)(l.shipping_price.total_gross)},products:l.items.map((e,t)=>(0,em.kV)({item:e}))}}};u().dataLayer({dataLayer:e})},[l]),(0,i.jsx)("div",{className:"confirmation",children:s?(0,i.jsx)("div",{className:"loading-container",children:(0,i.jsx)("span",{className:"spinner-border"})}):(0,i.jsx)("div",{className:"container my-5",children:(0,i.jsx)("div",{className:"row justify-content-center",children:(0,i.jsx)("div",{className:"col-md-6 col-12",children:l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"text-center mb-2",children:v.data.checkout_confirmation_success?(0,i.jsx)(o.A,{data:v.data.checkout_confirmation_success}):(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{children:x.t.confirmationTitle}),(0,i.jsx)("p",{children:x.t.confirmationContent})]})}),(0,i.jsxs)("div",{className:"py-3 border-top",children:[(0,i.jsxs)("div",{className:"mb-2",children:[(0,i.jsxs)("strong",{children:[x.t("Order number"),":"]})," ",l.number]}),h&&(0,i.jsx)(eD.d,{service:h.service,paymentData:h})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{children:x.t.confirmationErrorTitle}),(0,i.jsx)("p",{children:x.t.confirmationErrorContent})]})})})})})};var eO=s(6337),eq=s(6197);let eB=e=>{let{header:t}=e,{t:s,i18n:n}=(0,N.B)();(0,d.wA)();
1let[l,o]=a.useState(null),c=async(e,t)=>{o(null);try{let s=await r.A.post("".concat("/api/auth/v2","/password-change/"),e,{withCredentials:!0});o(s.data.detail),setTimeout(t.reset)}catch(e){if(!e.response||400!==e.response.status)return{[eC.Ym]:e.message};{let t=e.response.data;return t.non_field_errors&&(t[eC.Ym]=t.non_field_errors),t}}};return(0,i.jsx)(eS.lV,{onSubmit:c,children:e=>{let{handleSubmit:s,submitting:a,submitError:r}=e;return(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{children:t||n.t("Change password")}),r&&(0,i.jsx)("div",{className:"alert alert-danger",children:r}),l&&(0,i.jsx)("div",{className:"alert alert-success",children:l}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)(eq.A,{name:"new_password1",label:n.t("New password"),type:"password"})})}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)(eq.A,{name:"new_password2",label:n.t("Confirm password"),type:"password"})})}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12 my-2",children:(0,i.jsxs)("button",{onClick:s,className:"btn btn-success",type:"submit",disabled:a,children:[a&&(0,i.jsx)("span",{className:"spinner-border spinner-border-sm mr-1"}),n.t("Change password")]})})})]})}})},eY=e=>{let{header:t}=e,{t:s,i18n:n}=(0,N.B)();(0,d.wA)();let[l,o]=a.useState(null),c=async(e,t)=>{o(null);try{let t=await r.A.post("".concat("/api/auth/v2","/password-reset-email/"),e,{withCredentials:!0});o(t.data.detail)}catch(e){if(!e.response||400!==e.response.status)return{[eC.Ym]:e.message};{let t=e.response.data;return t.non_field_errors&&(t[eC.Ym]=t.non_field_errors),t}}};return(0,i.jsx)(eS.lV,{onSubmit:c,children:e=>{let{handleSubmit:s,submitting:a,submitError:r}=e;return(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{children:t||n.t("Reset password")}),r&&(0,i.jsx)("div",{className:"alert alert-danger",children:r}),l&&(0,i.jsx)("div",{className:"alert alert-success",children:l}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)(eq.A,{name:"email",label:n.t("Email"),type:"text"})})}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12 my-2",children:(0,i.jsxs)("button",{onClick:s,className:"btn btn-primary",type:"submit",disabled:a,children:[a&&(0,i.jsx)("span",{className:"spinner-border spinner-border-sm mr-1"}),n.t("Reset password")]})})})]})}})},eX=e=>{let{header:t}=e,{t:s,i18n:n}=(0,N.B)();(0,d.wA)();let[l,o]=a.useState(null),c=async(e,t)=>{o(null);try{let t=await r.A.post("".concat("/api/auth/v2","/activate-account/"),e,{withCredentials:!0});o(t.data.detail)}catch(e){if(!e.response||400!==e.response.status)return{[eC.Ym]:e.message};{let t=e.response.data;return t.non_field_errors&&(t[eC.Ym]=t.non_field_errors),t}}};return(0,i.jsx)(eS.lV,{onSubmit:c,children:e=>{let{handleSubmit:s,submitting:a,submitError:r}=e;return(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{children:t||n.t("Activate account")}),r&&(0,i.jsx)("div",{className:"alert alert-danger",children:r}),l&&(0,i.jsx)("div",{className:"alert alert-success",children:l}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)(eq.A,{name:"username",label:n.t("Username"),type:"text"})})}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)(eq.A,{name:"email",label:n.t("Email"),type:"text"})})}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12 my-2",children:(0,i.jsxs)("button",{onClick:s,className:"btn btn-primary",type:"submit",disabled:a,children:[a&&(0,i.jsx)("span",{className:"spinner-border spinner-border-sm mr-1"}),n.t("Activate account")]})})})]})}})},ez=e=>{let{header:t,extraSlugs:s}=e,{t:n,i18n:l}=(0,N.B)();(0,d.wA)();let[o,c]=a.useState(null),[h,u]=a.useState(null),m=(0,eh.useRouter)(),p=(0,g.Fr)();a.useEffect(()=>{2!==s.length?u(!0):u(!1)},[s]);let x=l.t("The password reset link was invalid, possibly because it has already been used.  Please request a new password reset."),v=async(e,t)=>{c(null);try{let i={...e,uid:s[0],token:s[1]},a=await r.A.post("".concat("/api/auth/v2","/password-reset-confirm/"),i,{withCredentials:!0});c(a.data.detail),setTimeout(t.reset),setTimeout(()=>{m.push({pathname:(0,g.TE)({type:"storefront",path:"customer/login"},p)})},2e3)}catch(e){if(!e.response||400!==e.response.status)return{[eC.Ym]:e.message};{let t=e.response.data;return t.non_field_errors?t[eC.Ym]=t.non_field_errors:(t.token||t.uid)&&(t[eC.Ym]=x),t}}};return h?(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{children:l.t("Password reset unsuccessful")}),(0,i.jsx)("p",{className:"text-danger",children:x})]}):!1!==h?null:(0,i.jsx)(eS.lV,{onSubmit:v,children:e=>{let{handleSubmit:s,submitting:a,submitError:r}=e;return(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{children:t||l.t("New password")}),(0,i.jsx)("p",{children:l.t("Please enter your new password twice so we can verify you typed it in correctly.")}),r&&(0,i.jsx)("div",{className:"alert alert-danger",children:r}),o&&(0,i.jsx)("div",{className:"alert alert-success",children:o}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)(eq.A,{name:"new_password1",label:l.t("New password"),type:"password"})})}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)(eq.A,{name:"new_password2",label:l.t("Confirm password"),type:"password"})})}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12 my-2",children:(0,i.jsxs)("button",{onClick:s,className:"btn btn-primary",type:"submit",disabled:a,children:[a&&(0,i.jsx)("span",{className:"spinner-border spinner-border-sm mr-1"}),l.t("Reset password")]})})})]})}})},eF=e=>{let{initialValues:t,onSubmit:s,readOnly:a}=e,{t:r,i18n:n}=(0,N.B)();return(0,i.jsx)(eS.lV,{onSubmit:s,initialValues:t,children:e=>{let{handleSubmit:s}=e;return(0,i.jsx)("form",{onSubmit:s,children:(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("div",{className:"col-6",children:(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{children:n.t("Email")}),(0,i.jsx)("div",{className:"text-muted",children:t.email})]})}),(0,i.jsx)("div",{className:"col-6",children:(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{children:n.t("Number")}),(0,i.jsx)("div",{className:"text-muted",children:t.number})]})})]}),(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("div",{className:"col-6",children:(0,i.jsx)(eq.A,{name:"first_name",label:n.t("First name")}
1)}),(0,i.jsx)("div",{className:"col-6",children:(0,i.jsx)(eq.A,{name:"last_name",label:n.t("Last name")})})]}),(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-12 d-flex mt-5",children:(0,i.jsx)("div",{className:"ml-auto",children:(0,i.jsx)("button",{className:"btn btn-success ml-2",children:n.t("Save")})})})})]})})}})},eZ=e=>{let{customer:t,header:s,loading:n,updateloading:l}=e,{t:o,i18n:c}=(0,N.B)(),[d,h]=a.useState();a.useEffect(()=>{(async()=>{l(!0),h((await r.A.get("/api/v2/customers/".concat(t.id,"/"),{withCredentials:!0})).data),l(!1)})()},[t]);let u=async(e,s)=>{try{l(!0);let s=await r.A.put("/api/v2/customers/".concat(t.id,"/"),e,{withCredentials:!0});h(s.data),l(!1)}catch(e){if(l(!1),400===e.response.status)return e.response.data}};return!n&&d?(0,i.jsx)("div",{children:(0,i.jsx)(eF,{initialValues:d,onSubmit:u})}):(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"spinner-border"})})};var eW=s(4380);let eU=e=>{let{customer:t,header:s}=e,[r,n]=a.useState(!0),{t:l,i18n:o}=(0,N.B)();return t?(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{children:s||o.t("My Details")}),(0,i.jsx)(eZ,{customer:t,loading:r,updateloading:e=>{n(e)}}),(0,i.jsx)(eW.Ay,{customer:t,loading:r})]}):(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"spinner-border"})})};var eK=s(2052),eV=s(4759),eH=s(608);let eQ=e=>{let{date:t}=e;return t?(0,i.jsx)("span",{children:(0,eK.A)((0,eV.A)(t),"Pp",{locale:eH.A})}):null},eG=e=>{let{orderId:t}=e,[s,n]=a.useState(!0),[l,o]=a.useState(),{t:c,i18n:h}=(0,N.B)();a.useEffect(()=>{(async()=>{n(!0),o((await r.A.get("/api/v2/orders/".concat(encodeURIComponent(t),"/"),{withCredentials:!0})).data),n(!1)})()},[t]);let[u,m]=(()=>{let[e,t]=a.useState(!1),s=(0,d.wA)();return[async e=>{t(!0);for(let t of e){if(!t.variant)continue;let e={quantity:t.quantity,product_variant_id:t.variant.id};try{await r.A.post("/api/v2/cart/",e,{withCredentials:!0})}catch(e){console.log(e)}}t(!1),s({type:"SET_DRAWER_CONTEXT",data:"cart"})},e]})();return l?(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"d-flex",children:[(0,i.jsxs)("h2",{children:["Order #",l.number]}),(0,i.jsxs)("button",{className:"ml-auto btn btn-outline-primary",disabled:m,onClick:()=>{u(l.items)},children:[m?(0,i.jsx)("span",{className:"spinner-border"}):(0,i.jsx)("i",{className:"fa fa-shopping-cart"})," ",h.t("Add items to cart")]})]}),(0,i.jsx)("h4",{children:(0,i.jsx)(eQ,{date:l.order_date})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("strong",{children:"Status:"})," ",l.status]}),(0,i.jsxs)("div",{className:"row my-5",children:[(0,i.jsxs)("div",{className:"col-md-6 col-12",children:[(0,i.jsx)("h6",{children:h.t("Billing address")}),l.billing_address&&(0,i.jsx)(eW.oS,{address:l.billing_address})]}),(0,i.jsxs)("div",{className:"col-md-6 col-12",children:[(0,i.jsx)("h6",{children:h.t("Shipping address")}),l.shipping_address&&(0,i.jsx)(eW.oS,{address:l.shipping_address})]})]}),(0,i.jsx)(e_.A,{cartProp:l,editable:!1})]}):(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"spinner-border"})})},e$=e=>{let{customer:t,header:s,extraSlugs:n}=e,[l,o]=a.useState(!0),{t:d,i18n:h}=(0,N.B)(),u=(0,g.Fr)(),[m,x]=a.useState([]);a.useEffect(()=>{(async()=>{o(!0),x((await r.A.get("/api/v2/orders/",{withCredentials:!0})).data.results),o(!1)})()},[t]);let v=n&&n[0];return v?(0,i.jsx)(eG,{orderId:v}):l?(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"spinner-border"})}):(0,i.jsxs)("div",{children:[(0,i.jsx)(c.E,{name:"customer-orders-header",fallback:()=>(0,i.jsx)("h3",{children:s||h.t("Orders")})}),m.length>0?(0,i.jsxs)("table",{className:"table table-responsive-md table-striped",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:h.t("Order number")}),(0,i.jsx)("th",{children:h.t("Status")}),(0,i.jsx)("th",{children:h.t("Order date")}),(0,i.jsx)("th",{children:h.t("Total")})]})}),(0,i.jsx)("tbody",{children:m.map((e,t)=>(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)(p(),{href:(0,g.TE)({type:"storefront",path:"customer/orders/".concat(encodeURIComponent(e.id))},u),children:e.number})}),(0,i.jsx)("td",{children:e.state||e.status}),(0,i.jsx)("td",{children:(0,i.jsx)(eQ,{date:e.order_date})}),(0,i.jsx)("td",{children:(0,i.jsx)(b.A,{money:e.total.total_gross})})]},t))})]}):(0,i.jsx)("span",{className:"text-muted",children:h.t("No orders")})]})};var eJ=s(8229);s(7326);let e0=e=>{let{name:t,label:s,initialValue:a,options:r}=e;return(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{children:s}),r.map((e,s)=>{let r="input-".concat(t,"-").concat(s);return(0,i.jsx)(eS.D0,{name:t,type:"radio",initialValue:a,value:e.value,children:t=>
1{let{input:s,meta:a}=t;return(0,i.jsxs)("div",{className:"form-check my-2",children:[(0,i.jsx)("input",{type:"radio",className:"form-check-input",id:r,...s}),(0,i.jsx)("label",{className:"form-check-label",htmlFor:r,children:e.label})]})}},s)})]})},e1=e=>{let{when:t,is:s,children:a}=e;return(0,i.jsx)(eS.D0,{name:t,subscription:{value:!0},children:e=>{let{input:{value:t}}=e;return t===s?a:null}})},e2=e=>{let{onSubmit:t,readOnly:s,setRecaptchaResponse:a}=e,{t:r,i18n:n}=(0,N.B)(),l=(0,d.d4)(e=>e.layoutContent),o=(0,g.Fr)();return(0,i.jsx)(eS.lV,{onSubmit:t,children:e=>{let{handleSubmit:t,submitError:s,submitting:r}=e;return(0,i.jsx)("form",{onSubmit:t,children:(0,i.jsxs)("div",{children:[s&&(0,i.jsx)("div",{className:"alert alert-danger",children:s}),(0,i.jsx)("div",{className:"row mb-3",children:(0,i.jsx)("div",{className:"col-md-6",children:(0,i.jsx)(e0,{name:"customer_type",label:"Jag handlar som",initialValue:"private",options:[{label:"Privatkund",value:"private"},{label:"F\xf6retagskund",value:"company"}]})})}),(0,i.jsx)("div",{className:"row mb-3",children:(0,i.jsx)("div",{className:"col-md-6",children:(0,i.jsx)(eq.A,{name:"email",label:n.t("Email")})})}),(0,i.jsxs)("div",{className:"row mb-3",children:[(0,i.jsx)("div",{className:"col-md-6",children:(0,i.jsx)(eq.A,{name:"first_name",label:n.t("First name")})}),(0,i.jsx)("div",{className:"col-md-6",children:(0,i.jsx)(eq.A,{name:"last_name",label:n.t("Last name")}
1)})]}),(0,i.jsx)(e1,{when:"customer_type",is:"company",children:(0,i.jsxs)("div",{className:"row mb-3",children:[(0,i.jsx)("div",{className:"col-md-6",children:(0,i.jsx)(eq.A,{name:"company_name",label:"F\xf6retagsnamn"})}),(0,i.jsx)("div",{className:"col-md-6",children:(0,i.jsx)(eq.A,{name:"organization_number",label:"Organisationsnummer"})})]})}),(0,i.jsx)("div",{className:"row mb-3",children:(0,i.jsx)("div",{className:"col-md-6",children:(0,i.jsx)(eq.A,{name:"phone",label:n.t("Phone")})})}),(0,i.jsxs)("div",{className:"row mb-3",children:[(0,i.jsxs)("div",{className:"col-md-6",children:[(0,i.jsx)(eq.A,{name:"password1",label:n.t("New password"),type:"password"}),(0,i.jsxs)("small",{className:"form-text text-muted",children:["Ditt l\xf6senord kan inte vara ett allm\xe4nt anv\xe4nt l\xf6senord.",(0,i.jsx)("br",{}),"Ditt l\xf6senord m\xe5ste inneh\xe5lla minst 10 tecken.",(0,i.jsx)("br",{}),"Ditt l\xf6senord kan inte bara vara numeriskt."]})]}),(0,i.jsx)("div",{className:"col-md-6",children:(0,i.jsx)(eq.A,{name:"password2",label:n.t("Confirm password"),type:"password"})})]}),(0,i.jsxs)("div",{className:"row mt-5",children:[s&&(0,i.jsx)("div",{className:"col-12",children:(0,i.jsx)("div",{className:"alert alert-danger",children:s})}),(0,i.jsx)("div",{className:"col-12 col-md-4",children:(0,i.jsx)(eJ.A,{sitekey:"6LcSFZ0UAAAAAM4oogS-m0IGPC-QgCWU_9g_QK23",onChange:a})}),(0,i.jsxs)("div",{className:"col-12 col-md-8",children:[l.data.page_privacy&&(0,i.jsx)(p(),{href:(0,g.TE)(l.data.page_privacy,o),children:"Hantering av personuppgifter"}),(0,i.jsx)("div",{className:"mt-1",children:(0,i.jsxs)("button",{className:"btn btn-primary btn-lg",disabled:r,type:"submit",children:[r&&(0,i.jsx)("span",{className:"spinner-border spinner-border-sm mr-1"}),"Registrera"]})})]})]})]})})}})},e3=e=>{let{header:t}=e,[s,n]=a.useState(null),[l,o]=a.useState(),{t:c,i18n:d}=(0,N.B)();(0,eh.useRouter)();let h=(0,g.Fr)(),u=async(e,t)=>{if(!l)return{[eC.Ym]:"ReCAPTCHA not valid"};n(null);try{e.recaptcha=l,await r.A.post("/api/v2/customers/",e,{withCredentials:!0}),n("Success"),setTimeout(t.reset),setTimeout(()=>{window.location.href=(0,g.TE)({type:"storefront",path:"customer"},h)},2e3)}catch(e){if(!e.response||400!==e.response.status)return{[eC.Ym]:e.message};{let t=e.response.data;return t.non_field_errors?t[eC.Ym]=t.non_field_errors:t.recaptcha&&(t[eC.Ym]="Recaptcha: ".concat(t.recaptcha)),t}}};return(0,i.jsxs)("div",{className:"col-12",children:[(0,i.jsx)("h3",{children:t||d.t("Register account")}),s?(0,i.jsx)("div",{className:"alert alert-success",children:s}):(0,i.jsx)(e2,{onSubmit:u,setRecaptchaResponse:o})]})},e4="customer",e5="details",e6="orders",e9="password-change",e8="login",e7="register",te="password-reset",tt="password-reset-confirm",ts="activate-account",ti=[e5,e6,e9],ta=[e8,e7,te,tt,ts],tr=e=>{let{name:t,label:s,page:a}=e,r=(0,g.Fr)(),n="".concat(e4,"/").concat(t);return(0,i.jsx)(p(),{href:(0,g.TE)({type:"storefront",path:n},r),children:(0,i.jsx)("span",{className:"nav-link ".concat(t===a?"active":""),children:s})})},tn=()=>{let e=(0,d.wA)(),{t,i18n:s}=(0,N.B)();return(0,i.jsx)("button",{className:"btn btn-outline-primary mt-1",onClick:async()=>{try{await r.A.post("".concat("/api/auth/v2","/logout/"),null,{withCredentials:!0}),e({type:"SET_CURRENT_CUSTOMER",data:null})}catch(e){console.log(e)}},children:s.t("Log out")})},tl=e=>{let{slug:t,extraSlugs:s,...r}=e,[n,l]=a.useState(),o=(0,eh.useRouter)(),c=(0,d.d4)(e=>e.currentCustomer);(0,d.wA)();let{t:h,i18n:m}=(0,N.B)(),p=(0,g.Fr)();return a.useEffect(()=>{c?ti.includes(t)?l(t):o.replace((0,g.TE)({type:"storefront",path:"".concat(e4,"/").concat(e5)},p)):ta.includes(t)?l(t):o.replace((0,g.TE)({type:"storefront",path:"".concat(e4,"/").concat(e8)},p))},[t,c]),a.useEffect(()=>{u().dataLayer({dataLayer:{event:"page",page_type:"other"}})},[]),(0,i.jsxs)("div",{className:"container",children:[c&&(0,i.jsxs)("div",{className:"row my-5",children:[(0,i.jsx)("div",{className:"col-12 col-md-4",children:(0,i.jsxs)("div",{className:"nav flex-column nav-pills mb-3",children:[(0,i.jsx)(tr,{page:n,name:e5,label:m.t("My Details")}),(0,i.jsx)(tr,{page:n,name:e6,label:m.t("My orders")}),(0,i.jsx)(tr,{page:n,name:e9,label:m.t("Change password")}),(0,i.jsx)(tn,{})]})}),(0,i.jsxs)("div",{className:"col-12 col-md-8",children:[n===e5&&(0,i.jsx)(eU,{customer:c}),n===e6&&(0,i.jsx)(e$,{customer:c,extraSlugs:s}),n===e9&&(0,i.jsx)(eB,{})]})]}),!c&&(0,i.jsxs)("div",{className:"row my-5",children:[(0,i.jsxs)("div",{className:"col-md-6 offset-md-3 col-12 ",children:[n===e8&&(0,i.jsx)(eO.A,{}),n===te&&(0,i.jsx)(eY,{}),n===ts&&(0,i.jsx)(eX,{}),n===tt&&(0,i.jsx)(ez,{extraSlugs:s})]}),n===e7&&(0,i.jsx)(e3,{})]})]})};s(5635),s(4441),s(5753);let to=e=>{let{isError:t}=e;return a.useEffect(()=>{setTimeout(()=>{nonexistingfunction2()},1e3)},[]),t&&nonexistingfunction(),(0,i.jsx)("div",{className:"container my-5",children:(0,i.jsx)("div",{className:"row",children:(0,i.jsxs)("div",{className:"col-md-6 offset-md-3",children:[(0,i.jsx)(p(),{href:"/testpageerror",children:"Show error"}),(0,i.jsx)("button",{onClick:e=>{nonexistingfunction3()},children:"TEST"})]})})})};var tc=s(8949);function td(e){let{pageType:t,...s}=e,r=(0,d.wA)();if(a.useEffect(()=>{r({type:"LOAD_CURRENT_VEHICLE"})},[]),"content"===t);else if("category"===t)return(0,i.jsx)(ew.A,{...s});else if("search"===t)return(0,i.jsx)(ew.A,{...s});else if("product"===t)return(0,i.jsx)(ey,{...s});else if("cart"===t)return(0,i.jsx)(eN,{...s});else if("checkout"===t)return(0,i.jsx)(eL,{...s});else if("confirmation"===t)return(0,i.jsx)(eR,{...s});else if("customer"===t)return(0,i.jsx)(tl,{...s});else if("testpage"===t)return(0,i.jsx)(to,{...s});else if("testpageerror"===t)return(0,i.jsx)(to,{...s,isError:!0});else if("placeholder"===t)return(0,i.jsx)("div",{});return(0,i.jsx)(tc.default,{})}td.getInitialProps=async e=>{let{slug:t}=e.query,s=!1;t&&t[0]===e.storePathPrefix&&(s=!0,t.shift());let i={};
1if(t&&e.regionPathPrefix&&((t=t.slice(1)).length||(t=void 0)),!s)return e.res&&(e.res.statusCode=404),{pageType:"notFound"};if(t&&"search"===t[0])return{pageType:"search",primaryFilter:{search:e.query.q,mode:e.query.mode},...i};if(t&&"checkout"===t[0])return{pageType:"checkout",...i};if(t&&"varukorg"===t[0])return{pageType:"cart",...i};if(t&&"partstream"===t[0]||t&&"sprangskisser"===t[0])return{pageType:"placeholder",...i};if(t&&"confirmation"===t[0])return{pageType:"confirmation",...i};if(t&&"customer"===t[0])return{pageType:"customer",slug:t[1],extraSlugs:t.slice(2),...i};try{let s;if(t){let i=t.join("/");s=Object.values(e.categories).find(e=>e.slug===i)}else s=e.categories["-1"];if(s){var a;let e;{let t=(0,w.Mb)();await t.dispatch((0,w.Xs)(s)),e=t.getState().categoryDetails}let t=null==(a=e[s.id])?void 0:a.poster;return{pageType:"category",currentCategory:s,categoryDetails:e,noPadding:t,...i}}}catch(e){console.error(e)}if(t&&"products"===t[0])try{let s,a,n;return(s=(await r.A.get("/api/v2/products/get_from_slug/",{params:{slug:t[1],language:e.language}})).data).variants&&1===s.variants.length?n=s.variants[0].id:t[2]&&(n=parseInt(t[2],10)),n&&(a=s.variants.find(e=>e.id===n)),{product:s,variant:a,pageType:"product",...i}}catch(e){console.error('Failed to load product "'.concat(t[1],'", rendering 404:'),e.message||e)}return e.res&&(e.res.statusCode=404),{pageType:"notFound"}};let th=td},3002:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[[...slug]]",function(){return s(1756)}])},8949:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var i=s(7876),a=s(1105),r=s(7480);function n(){let e=(0,a.d4)(e=>e.layoutContent);return(0,i.jsx)("div",{className:"container my-5 text-center",children:e.data.status_404?(0,i.jsx)(r.A,{data:e.data.status_404}):(0,i.jsx)("h1",{children:"404 - Page Not Found"})})}}},e=>{e.O(0,[950,636,593,792],()=>e(e.s=3002)),_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.