1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5835],{5835:(e,t,n)=>{n.d(t,{IZ:()=>y,Ly:()=>T,M0:()=>g,Th:()=>v,Yg:()=>p,bF:()=>b,fp:()=>w,fq:()=>d,mX:()=>q,n:()=>I,o_:()=>m,rq:()=>f,vD:()=>h,wH:()=>_});var r=n(53455),a=n(99776),o=n(80549),i=n(12466),u=n(18019),l=n(28961),c=n(27048),s=n(84804);let d="mitte",m="leti",f=()=>{let{orgSlug:e}=(0,u.I)();return(0,r.I)({queryKey:["my-presence",e],queryFn:async()=>{let{data:t}=await i.Ay.get("/api/v1/org/".concat(e,"/me/presence"));return t.data},enabled:!!e,refetchInterval:3e4})},y=()=>{let{orgSlug:e}=(0,u.I)(),t=(0,a.jE)();return(0,o.n)({mutationFn:async t=>{let{data:n}=await i.Ay.post("/api/v1/org/".concat(e,"/me/access/open-turnstile"),t);return n.data},onSuccess:()=>{t.invalidateQueries({queryKey:["my-presence",e]}),t.invalidateQueries({queryKey:["my-check-ins"]}),t.invalidateQueries({queryKey:["entry-status",e]})}})},g=()=>{let{orgSlug:e}=(0,u.I)();return(0,r.I)({queryKey:["entry-status",e],queryFn:async()=>{let{data:t}=await i.Ay.get("/api/v1/org/".concat(e,"/me/access/entry-status"));return t.data},enabled:!!e,refetchInterval:6e4})},h=()=>{let{data:e}=g(),{data:t}=f();return function(e,t){return(null==e?void 0:e.allow)===!1&&(null==t?void 0:t.state)!=="in"}(e,t)},v=()=>{let{orgSlug:e}=(0,u.I)();return(0,r.I)({queryKey:["access-qr",e],queryFn:async()=>{let{data:t}=await i.Ay.get("/api/v1/org/".concat(e,"/me/access/qr"));return t.data},enabled:!!e,refetchInterval:e=>{var t;let n=null==(t=e.state.data)?void 0:t.expires_at;return n?Math.max(1e3,new Date(n).getTime()-Date.now()-3e3):1e4},refetchOnWindowFocus:!1})};function p(e){var t;return!!(null==e?void 0:e.used)&&(null==(t=e.presence)?void 0:t.state)!=="in"}let w=(e,t)=>(0,r.I)({queryKey:["guest-access-qr",e],queryFn:async()=>{let{data:t}=await i.Ay.post("/api/v1/voucher-redeem-guest",{code:e});return t.data},enabled:t&&!!e,refetchInterval:e=>{var t;if(p(e.state.data))return!1;let n=null==(t=e.state.data)?void 0:t.expires_at;return n?Math.max(1e3,new Date(n).getTime()-Date.now()-3e3):1e4},refetchOnWindowFocus:!1}),_=()=>{let e=(0,a.jE)();return(0,o.n)({mutationFn:async e=>{let{code:t,controller:n,direction:r}=e,{data:a}=await i.Ay.post("/api/v1/voucher-open-door",{code:t,controller:n,direction:r});return a.data},onSuccess:(t,n)=>{let{code:r}=n;e.invalidateQueries({queryKey:["guest-access-qr",r]})}})},I=()=>{let{orgSlug:e}=(0,u.I)();return(0,o.n)({mutationFn:async t=>{let{data:n}=await i.Ay.post("/api/v1/org/".concat(e,"/admin/doors/open"),t?{controller:t}:{});return n.data}})},D="after_hours_window_hint";function q(e,t,n){return t<=n?e>=t&&e<n:e>=t||e<n}function S(){try{var e,t,n;let r=localStorage.getItem(D);if(!r)return;let a=JSON.parse(r);if(!a.enabled||!a.opens_at||!a.closes_at)return;let o=null!=(e=a.active_from)?e:a.opens_at,i=null!=(t=a.active_to)?t:a.closes_at,u=(0,s.E5)().slice(11);return{enabled:!0,window_open:q(u,o,i),floors:null!=(n=a.floors)?n:[],opens_at:a.opens_at,closes_at:a.closes_at,active_from:a.active_from,active_to:a.active_to}}catch(e){return}}let T=()=>{var e,t;let{orgSlug:n}=(0,u.I)(),a=(0,l.ad)(),o=(0,r.I)({queryKey:["after-hours-status",n],queryFn:async()=>{let{data:e}=await i.Ay.get("/api/v1/org/".concat(n,"/me/access/after-hours"));return!function(e){try{let t={enabled:e.enabled,floors:e.floors,opens_at:e.opens_at,closes_at:e.closes_at,active_from:e.active_from,active_to:e.active_to};localStorage.setItem(D,JSON.stringify(t))}catch(e){}}(e.data),e.data},enabled:!!n,placeholderData:S,refetchInterval:6e4});if((0,c.nZ)(null==a||null==(e=a.user)?void 0:e.email)){let e=null!=(t=o.data)?t:{enabled:!0,window_open:!0,floors:[]},n={...e,enabled:!0,window_open:!0,floors:e.floors.length>0?e.floors:[{floor:1},{floor:3}]};return{...o,data:n}}return o},b=()=>{let{orgSlug:e}=(0,u.I)();return(0,o.n)({mutationFn:async t=>{let{data:n}=await i.Ay.post("/api/v1/org/".concat(e,"/me/access/open-relay"),t);return n.data}})}},84804:(e,t,n)=>{n.d(t,{E5:()=>u,ID:()=>c,NJ:()=>i,Vp:()=>I,Yq:()=>y,_5:()=>_,fU:()=>g,ft:()=>m,gl:()=>h,gn:()=>l,hY:()=>v,ig:()=>a,jl:()=>D,m3:()=>p,m7:()=>q,ne:()=>f,r6:()=>d,x1:()=>w});var r=n(94577);let a="Europe/Tallinn",o={timeZone:a};function i(){return new Intl.DateTimeFormat("sv-SE",{...o,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date)}function u(){return"".concat(i(),"T").concat(new Intl.DateTimeFormat("sv-SE",{...o,hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date))}function l(e,t){let[n,r,a]=e.split("-").map(Number);if(!n||!r||!a)return e;let o=new Date(Date.UTC(n,r-1,a,12,0,0));return o.setUTCDate(o.getUTCDate()+t),o.toISOString().slice(0,10)}function c(e,t){let[n,r,a]=e.split("-").map(Number);return n&&r&&a?new Date(Date.UTC(n,r-1+t,a,12,0,0)).toISOString().slice(0,10):e}function s(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function d(e){let t=s(e);
1return t?t.toLocaleString((0,r.J)(),o):e||"â"}function m(e){let t=s(e);if(!t)return e||"â";let n=new Intl.DateTimeFormat("en-GB",{...o,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),r=e=>{var t,r;return null!=(r=null==(t=n.find(t=>t.type===e))?void 0:t.value)?r:""},a="24"===r("hour")?"00":r("hour");return"".concat(r("day"),".").concat(r("month"),".").concat(r("year")," ").concat(a,":").concat(r("minute"))}function f(e){let t=Math.max(0,Math.floor(Math.abs(e)));return{days:Math.floor(t/1440),hours:Math.floor(t%1440/60),minutes:t%60}}function y(e){let t=s(e);return t?t.toLocaleDateString((0,r.J)(),o):e||"â"}function g(e){let t=s(e);return t?t.toLocaleTimeString((0,r.J)(),{...o,hour:"2-digit",minute:"2-digit",hour12:!1}):e||"â"}function h(e){let t=s(e);return t?t.toLocaleDateString((0,r.J)(),{...o,day:"numeric",month:"long",year:"numeric"}):e||"â"}function v(e){let t=s(e);return t?t.toLocaleString((0,r.J)(),{...o,day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):e||"â"}function p(e){let t=s(e);return t?w(t,new Date)?g(e):t.toLocaleString((0,r.J)(),{...o,day:"numeric",month:"long",hour:"2-digit",minute:"2-digit",hour12:!1}):e||"â"}function w(e,t){let n=e=>new Intl.DateTimeFormat("sv-SE",{...o,year:"numeric",month:"2-digit",day:"2-digit"}).format(e);return n(e)===n(t)}function _(e){let t=s(e);return t?new Intl.DateTimeFormat("sv-SE",{...o,year:"numeric",month:"2-digit",day:"2-digit"}).format(t):null}function I(e){let t=s(e);if(!t)return null;let n=_(e);if(!n)return null;let r=new Intl.DateTimeFormat("sv-SE",{...o,hour:"2-digit",minute:"2-digit",hour12:!1}).format(t);return"".concat(n,"T").concat(r)}function D(e){let t=I(e);return null!=t&&t.endsWith("T00:00")}function q(e){let t=_(e);if(!t)return null;let n=e=>{let[t,n,r]=e.split("-").map(Number);return Date.UTC(t,n-1,r,12,0,0)};return Math.round((n(t)-n(i()))/864e5)}},94577:(e,t,n)=>{n.d(t,{J:()=>i,Y:()=>o});var r=n(67556),a=n(75662);function o(){let{i18n:e}=(0,a.Bd)();return u(e.language)}function i(){return u(r.A.language)}function u(e){return"et"===e?"et-EE":"en-GB"}}}]);
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.