(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[290],{7811:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"undefined"!=typeof window&&e in window}},9242:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=!!("undefined"!=typeof window&&window.document&&window.document.createElement);t.default=n},2704:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new Map;t.default=function(e){n.has(e)||(n.set(e,!0),console.warn(e))}},7527:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(7294),a=r(n(9242)),i=r(n(7811)),s=r(n(2704));t.default=function(e){if(!a.default||!(0,i.default)("matchMedia"))return(0,s.default)("matchMedia is not supported, this could happen both because window.matchMedia is not supported by your current browser or you're using the useMediaQuery hook whilst server side rendering."),!1;var t=(0,o.useState)(!!window.matchMedia(e).matches),n=t[0],r=t[1];return(0,o.useEffect)(function(){var t=window.matchMedia(e),n=function(){r(!!t.matches)};try{t.addEventListener("change",n)}catch(e){t.addListener(n)}return n(),function(){try{t.removeEventListener("change",n)}catch(e){t.removeListener(n)}}},[e]),n}},2569:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/program",function(){return n(2752)}])},2752:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return P},default:function(){return k}});var r=n(5893),o=n(7294);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var i=function(e){return o.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21.2 12.71"},e),o.createElement("path",{d:"m21838.501 1560.678 8.499-8.298 2.1 2.12-10.6 10.61zm-10.601-6.178 2.1-2.12 8.501 8.298v4.432z",style:{fill:"currentColor",fillRule:"evenodd"},transform:"translate(-21827.9 -1552.38)"}))},s=n(6538),l=n(2637),d=n(1537),u=n(8638),c=n(8292),p=n(6200),f=n(7116),h=n(2176),m=n(1380),v=n(6514),g=n(9008),w=n.n(g),_=n(1163),y=n(1686),b=n(5152);let x=n.n(b)()(()=>n.e(303).then(n.bind(n,303)).then(e=>e.default),{loadableGenerated:{webpack:()=>[303]},ssr:!1}),j=y.ZP.header.withConfig({componentId:"sc-c00b7600-0"})(["text-align:center;margin-top:32px;margin-bottom:32px;h1{font-size:",";text-transform:uppercase;}"],(0,v.Vj)(31)),M=y.ZP.span.withConfig({componentId:"sc-c00b7600-1"})(["position:relative;color:var(--color_dateselector_text,var(--color_ticketbutton_text,#fff));select{background-color:var(--color_dateselector_bg,var(--color_ticketbutton_bg,#000));color:var(--color_dateselector_text,var(--color_ticketbutton_text,#fff));font-size:",";@media screen and (min-width:641px){font-size:1rem;}padding:0.5em 2.5em 0.5em 0.5em;appearance:none;border:none;}svg{position:absolute;width:21px;height:13px;right:5px;top:50%;transform:translateY(-50%);pointer-events:none;}"],(0,v.Vj)(20)),E=(0,y.ZP)(c.ZP).withConfig({componentId:"sc-c00b7600-2"})(["text-align:left;margin:0 16px;"]),Z=(0,y.ZP)(l.Z).withConfig({componentId:"sc-c00b7600-3"})(["&[aria-busy='true']{min-height:90vh;}"]);var P=!0;function k(e){var t;let n,{daysWithShows:a,appData:l,infoText:c}=e,v=(0,o.useMemo)(()=>null==a?void 0:a.map(e=>{let t=(0,p.Z)(e,"yyyy-MM-dd'T'HH:mm:ss",new Date,{locale:h.Z}),n=(0,f.Z)(t,"EEEE dd. MMMM",{locale:h.Z});return{str:e,date:t,display:n.charAt(0).toUpperCase()+n.slice(1)}}),[a]),g=(0,_.useRouter)(),[y,b]=(0,o.useState)(()=>{var e,t,n;let r;return(g.query.dato&&(Array.isArray(g.query.dato)&&1===g.query.dato.length?r=g.query.dato[0]:Array.isArray(g.query.dato)||(r=g.query.dato)),r&&(/^\d{4}-\d{2}-\d{2}$/.test(r.trim())||l.settings.program_hasalldays&&"alle"===r.trim()))?r:l.settings.program_hasalldays?"alle":null!==(n=null==v?void 0:null===(t=v[0])||void 0===t?void 0:null===(e=t.str)||void 0===e?void 0:e.substring(0,10))&&void 0!==n?n:(0,f.Z)(new Date,"yyyy-MM-dd",{locale:h.Z})});switch((0,o.useEffect)(()=>{y&&y!==g.query.dato&&g.replace("/program?dato=".concat(y),void 0,{shallow:!0})},[y,g]),l.settings.program_view){case"posters":default:n=d.Z;break;case"wide":n=u.Z}let P=(0,m.h)(l.settings,"Kinoprogram");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{as:"section",children:[(0,r.jsxs)(w(),{children:[(0,r.jsx)("title",{children:P}),(0,r.jsx)("meta",{property:"og:title",content:P},"title")]}),(0,r.jsxs)(j,{children:[(0,r.jsx)("h1",{children:"Kinoprogrammet"}),c&&(0,r.jsx)(E,{value:c,disableCustomComponents:!0}),(null!==(t=null==v?void 0:v.length)&&void 0!==t?t:0)>0&&(0,r.jsxs)(M,{children:[(0,r.jsxs)("select",{value:y,onChange:e=>b(e.currentTarget.value),"aria-label":"Velg dato",children:[l.settings.program_hasalldays&&(0,r.jsx)("option",{value:"alle",children:"Alle dager"}),v.map(e=>(0,r.jsx)("option",{value:e.str.substring(0,10),children:e.display},e.str.substring(0,10)))]}),(0,r.jsx)(i,{})]})]}),(0,r.jsx)(Z,{date:y,loaderText:"Henter kinoprogrammet...",children:(0,r.jsx)(n,{allowTitleOverride:l.settings.canOverrideMovieTitles,appData:l})})]}),(0,r.jsx)(x,{appData:l,index:1,hideOnMobile:!1,hideOnDesktop:!0,debugLabel:"Program bottom"})]})}}},function(e){e.O(0,[423,283,273,888,774,179],function(){return e(e.s=2569)}),_N_E=e.O()}]);
//# sourceMappingURL=program-0efd08ed8abf3067.js.map