"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2136],{32136:function(t,e,n){n.r(e),n.d(e,{DispatchAndDateCountDownWidgetRenderer:function(){return q}});var o,i,r,d,l,u,a,s,c,g,v,h=n(95235),p=n(8529),w=n(2784),m=n(11006),f=n(7328),C=n(48840),b=n(60299),x=n(87330),D=n(81292),j=m.zo.a(o||(o=(0,f.Z)(["\n text-decoration: ",";\n display: flex;\n flex-direction: column;\n text-align: center;\n padding-bottom: ",";\n background: ",";\n"])),function(t){return t.textDecoration},(0,C.W0)(4),function(t){var e,n,o;return null!==(e=null!==(n=t.backgroundColour)&&void 0!==n?n:null===(o=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===o?void 0:o.background)&&void 0!==e?e:"inherit"}),y=m.zo.div(i||(i=(0,f.Z)(["\n display: flex;\n flex-direction: column;\n gap: ",";\n padding: "," "," 0 ",";\n ",";\n"])),(0,C.W0)(1),(0,C.W0)(4),(0,C.W0)(4),(0,C.W0)(4),function(t){var e,n;return(0,b.e)({bottom:null!==(e=null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n||null===(n=n.margin)||void 0===n?void 0:n.bottom)&&void 0!==e?e:3})}),W=m.zo.span(r||(r=(0,f.Z)(["\n ",";\n color: ",";\n"])),(0,x.xv)("large1","alternate"),function(t){var e,n;return null!==(e=t.titleColour)&&void 0!==e?e:null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n?void 0:n.color}),O=m.zo.span(d||(d=(0,f.Z)(["\n ",";\n\n ",";\n"])),function(t){var e,n;return(0,x.xv)((null===(e=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===e||null===(e=e.title)||void 0===e||null===(e=e.font)||void 0===e?void 0:e.entry)||"small",(null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n||null===(n=n.title)||void 0===n||null===(n=n.font)||void 0===n?void 0:n.style)||"default")},function(t){var e,n;return"color: ".concat(null!==(e=t.subtitleColour)&&void 0!==e?e:null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n?void 0:n.color)}),A=m.zo.div(l||(l=(0,f.Z)(["\n width: 100%;\n display: flex;\n justify-content: center;\n\n ",";\n\n padding: ",";\n\n "," {\n padding: ",";\n }\n"])),function(t){var e,n;return(null===(e=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===e||null===(e=e.containerStyle)||void 0===e?void 0:e.containerGap)&&"gap: ".concat((0,C.W0)(null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n||null===(n=n.containerStyle)||void 0===n?void 0:n.containerGap))},function(t){var e,n;return"".concat((0,C.W0)((null===(e=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===e||null===(e=e.containerStyle)||void 0===e?void 0:e.padding.top)||1.25)," ").concat((0,C.W0)((null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n||null===(n=n.containerStyle)||void 0===n?void 0:n.padding.bottom)||0))},function(t){return(0,D.mq)(t.theme.breakpointUtils.map,"md")},function(t){var e,n,o;return"".concat((0,C.W0)((null===(e=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===e||null===(e=e.containerStyle)||void 0===e?void 0:e.responsivePadding.top)||0)," ").concat((0,C.W0)((null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n||null===(n=n.containerStyle)||void 0===n?void 0:n.responsivePadding.left)||0)," ").concat((0,C.W0)((null===(o=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===o||null===(o=o.containerStyle)||void 0===o?void 0:o.responsivePadding.bottom)||0))}),k=m.zo.div(u||(u=(0,f.Z)(["\n ",";\n color: ",";\n padding-top: ",";\n"])),(0,x.xv)("bodyText","alternate"),function(t){var e,n;return t.separatorColour?t.separatorColour:null!==(e=null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n?void 0:n.colorSeparator)&&void 0!==e?e:t.theme.colors.palette.greys.white},function(t){var e,n;return null!==(e=null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n||null===(n=n.paddingSeparator)||void 0===n?void 0:n.top)&&void 0!==e?e:0}),S=m.zo.div(a||(a=(0,f.Z)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n ",";\n"])),function(t){var e;return(null===(e=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===e?void 0:e.timerSpanStyle)&&"width: 94px"}),P=m.zo.span(s||(s=(0,f.Z)(["\n ",";\n\n color: ",";\n\n ","\n"])),(0,x.xv)("medium1","alternate"),function(t){var e,n,o;return null!==(e=null!==(n=t.digitsColour)&&void 0!==n?n:null===(o=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===o?void 0:o.color)&&void 0!==e?e:t.theme.colors.palette.greys.white},function(t){var e;return null!==(e=t.theme.widget.dispatchAndDateCountdownWidget)&&void 0!==e&&e.timerSpanStyle?(0,m.iv)(c||(c=(0,f.Z)(["\n width: 100%;\n display: flex;\n justify-content: center;\n gap: 6px;\n\n > span {\n height: 100%;\n border: ",";\n border-radius: ",";\n padding: "," ",";\n }\n padding-bottom: ",";\n "])),function(t){var e,n,o;return"".concat(null===(e=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===e||null===(e=e.border)||void 0===e?void 0:e.width," ").concat(null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n||null===(n=n.border)||void 0===n?void 0:n.style," ").concat(null===(o=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===o||null===(o=o.border)||void 0===o?void 0:o.color)},function(t){var e;return null===(e=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===e||null===(e=e.borderRadius)||void 0===e?void 0:e.radius},(0,C.W0)(1.25),(0,C.W0)(1.5),(0,C.W0)(1)):(0,m.iv)(g||(g=(0,f.Z)(["\n > span:first-of-type {\n ",";\n color: ",";\n }\n "])),(0,x.xv)("medium1","alternate"),function(t){var e,n;return null!==(e=null===(n=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===n?void 0:n.color)&&void 0!==e?e:t.theme.colors.palette.greys.white})}),T=m.zo.span(v||(v=(0,f.Z)(["\n ",";\n\n color: ",";\n text-transform: ",";\n"])),(0,x.xv)("xsmall","default"),function(t){var e,n,o;return null!==(e=null!==(n=t.digitsColour)&&void 0!==n?n:null===(o=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===o?void 0:o.colorText)&&void 0!==e?e:t.theme.colors.palette.greys.white},function(t){var e;return null===(e=t.theme.widget.dispatchAndDateCountdownWidget)||void 0===e?void 0:e.textTransform}),Z=n(52322);function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function z(t){for(var e=1;e0?U(_(t)):U("00")},I=function(t){if(t<=0)return{weeks:U("00"),remainingDays:U("00"),hours:U("00"),minutes:U("00"),seconds:U("00"),hasEnded:!0};var e=Math.floor(t/6048e5),n=Math.floor(t%6048e5/864e5),o=Math.floor(t%864e5/36e5),i=Math.floor(t%36e5/6e4),r=Math.floor(t%6e4/1e3),d=e>0||n>0,l=d||o>0,u=l||i>0,a=u||r>0;return{weeks:e>0||d?U(_(e)):U("00"),remainingDays:G(n,d),hours:G(o,l),minutes:G(i,u),seconds:G(r,a),hasEnded:!1}},R=function(t){var e=new Date(t).getTime(),n=w.useState(e-new Date().getTime()),o=(0,p.Z)(n,2),i=o[0],r=o[1];return w.useEffect(function(){var t=setInterval(function(){var t=e-new Date().getTime();t>=0?r(t):r(0)},1e3);return function(){return clearInterval(t)}},[e]),I(i)},q=function(t){var e,n=(0,m.Fg)(),o=R(Number(new Date(t.targetDate))),i=o.weeks,r=o.remainingDays,d=o.hours,l=o.minutes,u=o.seconds,a=o.hasEnded,s="true"===t.removeOnEnd&&a,c=N(N({},t),{},{weeks:i,remainingDays:r,hours:d,minutes:l,seconds:u,textDecoration:null===(e=n.widget.dispatchAndDateCountdownWidget)||void 0===e?void 0:e.textDecoration,displayWeekTimer:n.widget.dispatchAndDateCountdownWidget.displayWeekTime,titleColour:t.titleColour,subtitleColour:t.subtitleColour,digitsColour:t.digitsColour,separatorColour:t.separatorColour,backgroundColour:t.backgroundColour});return(0,Z.jsx)(w.Fragment,{children:!s&&(0,Z.jsx)(F,N({},c))})}}}]); //# sourceMappingURL=2136.ce49bdfe69bc5eb2.js.map