1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9796],{19796:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>y});var a=t(37876),i=t(14232),n=t(71431),s=t(96851),r=t(17484);let o=e=>{let{title:l,description:t,initialSearchTerm:n=null,onSearchTermSubmit:o}=e,c=(0,s.c)(),[d,u]=i.useState(!1),[f,v]=i.useState(n),h=i.useRef(null);return i.useEffect(()=>{n&&(u(!0),v(n),o(n))},[n,o]),(0,a.jsxs)(a.Fragment,{children:[l?(0,a.jsx)("h3",{className:"c-office-overview__search-title mb-0",children:l}):null,t?(0,a.jsx)("p",{className:"c-office-overview__search-description",children:t}):null,(0,a.jsx)(r.A,{onSubmit:e=>(e=>{var l,t;e.preventDefault();let a=null!=(t=null==(l=h.current)?void 0:l.value)?t:"";u(!0),v(a),o(a)})(e),children:(0,a.jsxs)("div",{className:"c-office-overview__search-input-wrapper",children:[(0,a.jsx)(r.A.Control,{type:"autocomplete",placeholder:n||c("officesearch_enteralocation"),className:"c-office-overview__search-input ".concat(""===f&&d?"error":""),ref:h}),(0,a.jsx)("button",{className:"btn btn--blue c-office-overview__search-submit",type:"submit",children:c.raw("officeoverview_search")})]})})]})};var c=function(e){return e.INITIAL_STATE="initial_state",e.USE_MY_LOCATION="use-my-location",e.SHOW_ALL="show-all",e.SEARCH_TERM="search-term",e}({});let d=e=>{let{title:l,description:t,onStateChange:n,onOfficeSearchTermSubmit:r}=e,c=(0,s.c)(),[d,u]=i.useState("");return i.useEffect(()=>{let e=new URLSearchParams(window.location.search).get("searchTerm");e&&u(e),n("initial_state")},[n]),(0,a.jsxs)("div",{className:"c-office-overview__search",children:[(0,a.jsx)(o,{title:l,description:t,initialSearchTerm:d,onSearchTermSubmit:e=>{r(e),n("search-term")}}),(0,a.jsxs)("div",{className:"c-office-overview__search-btn-wrapper d-flex justify-content-between mt-2",children:[(0,a.jsx)("button",{type:"button",className:"c-office-overview__search-use-my-location",onClick:e=>{e.preventDefault(),u(""),n("use-my-location"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"office_search",searchTerm:"location-based"})},children:c.raw("officeoverview_usemylocation")}),(0,a.jsx)("button",{type:"button",className:"c-office-overview__search-show-all-results",onClick:e=>{e.preventDefault(),u(""),n("show-all"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"office_search",searchTerm:"show-all"})},children:c.raw("officeoverview_showall")})]})]})};var u=t(97719),f=t(60929),v=t(50172),h=t(50281),m=t(32033),p=t(89099);let _=e=>{var l;let{offices:t,maxNbrOfOfficesPerPage:n,noResultText:r="",currentPage:o,setCurrentPage:c,initialPage:d}=e,_=(0,s.c)(),g=(0,p.useRouter)(),w=(null==t?void 0:t.length)===0&&!!r,b=(null==t?void 0:t.length)>n,x=(0,i.useCallback)(()=>b?null==t?void 0:t.slice((o-1)*n,o*n):t,[o,n,t,b]),j=(0,i.useCallback)(()=>{var e;return null==(e=x())?void 0:e.map(e=>{var l,t,i,n,s,r,o;let c=null==e||null==(l=e.relationships)?void 0:l.field_office_type,d=(null==c||null==(i=c.data)||null==(t=i.attributes)?void 0:t.name)==="Large companies"?_("officeoverview_categorylabelget"):_("officeoverview_categorylabelsme");return(0,a.jsx)(f.A,{lg:6,className:"c-office-overview__office-wrapper",children:(0,a.jsx)(v.A,{link:e.attributes.path,children:(0,a.jsxs)("div",{className:"c-office-overview__office",children:[(0,a.jsxs)("div",{className:"d-flex flex-row justify-content-between align-items-center",children:[(0,a.jsx)("h5",{className:"mb-1 mt-0",children:e.attributes.title}),(null==c||null==(s=c.data)||null==(n=s.attributes)?void 0:n.name)?(0,a.jsx)("span",{className:"c-office-overview__office-type c-office-overview__office-type-".concat((null==c||null==(o=c.data)||null==(r=o.attributes)?void 0:r.name)==="Large companies"?"GET":"SME"),children:d}):null]}),(0,a.jsx)("hr",{}),(0,a.jsxs)("div",{className:"c-office-overview__office-address",children:[(0,a.jsx)("span",{className:"c-office-overview__office-address-icon"}),e.attributes.field_address.address_line1," ",e.attributes.field_address.address_line2," -"," ",e.attributes.field_address.postal_code," ",e.attributes.field_address.locality]})]})})},e.id)})},[x,_]);return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(u.A,{children:[w?(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:r}}
1):null,(null==(l=x())?void 0:l.length)>0?j():null,b?(0,a.jsx)(f.A,{lg:12,children:(0,a.jsx)(h.A,{nbrOfItems:t.length,nbrOfItemsPerPage:n,onPageChange:e=>{c(e);let l=(0,m.bP)(null==g?void 0:g.asPath).split("/");l.length>0&&(Number.isInteger(parseInt(l[l.length-1]))||l.push("".concat(m.zi)),l[l.length-1]=String(e)),1===e&&l.pop();let t=l.join("/");null==g||g.push({pathname:t},void 0)},initialPage:d})}):null]})})},g=e=>e*Math.PI/180,w=(e,l,t,a)=>{let i=g(e),n=g(t),s=g(l),r=(g(a)-s)*Math.cos((i+n)/2),o=n-i;return 6371*Math.sqrt(r*r+o*o)};function b(e){let{offices:l}=e,t=(0,s.c)();return(0,a.jsxs)("h4",{className:"c-office-overview__offices-title",children:[null==l?void 0:l.length," ",t.raw("ouroffices_offices")]})}function x(e){let{id:l,value:t,changeHandler:i,isDefaultChecked:n}=e;return(0,a.jsxs)("div",{className:"d-flex flex-row justify-content-center align-items-baseline",children:[(0,a.jsx)("input",{type:"radio",name:"category_filter",id:l,value:l,onChange:i,className:"c-office-overview__filter-radio-input",defaultChecked:n}),(0,a.jsx)("label",{htmlFor:l,className:"mb-0 c-office-overview__filter-radio-label",children:t})]})}function j(e){let{setCategoryFilter:l}=e,t=(0,s.c)(),n=(0,i.useCallback)(e=>(l(e.target.value),e.target.value),[l]);return(0,a.jsxs)("div",{className:"d-flex flex-column justify-content-center align-items-center c-office-overview__filter",children:[(0,a.jsxs)("p",{className:"c-office-overview__filter-title",children:[" ",t.raw("officeoverview_categoryfiltertitle")]}),(0,a.jsxs)("div",{className:"d-flex flex-row flex-wrap justify-content-center align-items-center c-office-overview__filter-radio",children:[(0,a.jsx)(x,{id:"all",value:t.raw("officeoverview_categorylabelall"),changeHandler:n,isDefaultChecked:!0}),(0,a.jsx)(x,{id:"Large companies",value:t.raw("officeoverview_categorylabelget"),changeHandler:n}),(0,a.jsx)(x,{id:"Small and medium companies",value:t.raw("officeoverview_categorylabelsme"),changeHandler:n})]})]})}let y=e=>{var l;let{page:t,offices:s=[],pageNumber:r}=e,[o,u]=(0,i.useState)(!1),[f,v]=(0,i.useState)(""),[h,m]=(0,i.useState)(c.INITIAL_STATE),[p,g]=(0,i.useState)(null!=r?r:1),[x,y]=(0,i.useState)(8),[N,C]=(0,i.useState)([]),[k,L]=(0,i.useState)(),[S,A]=(0,i.useState)(null),[T,I]=(0,i.useState)("all"),E=(0,i.useRef)(null),P=(0,i.useCallback)(e=>{var l,t,a,i,n,s,r,o;return(null==e||null==(i=e.relationships)||null==(a=i.field_office_type)||null==(t=a.data)||null==(l=t.attributes)?void 0:l.name)===T?e:(!!(null==e||null==(o=e.relationships)||null==(r=o.field_office_type)||null==(s=r.data)||null==(n=s.attributes)?void 0:n.name)||"all"===T)&&("all"===T||void 0)},[T]),R=(0,i.useCallback)(()=>s.filter(e=>!!e.attributes.status),[s]),O=(0,i.useCallback)(()=>{var e;return null==(e=R())?void 0:e.filter(P)},[R,P]),M=(0,i.useCallback)(()=>{var e;return null==(e=O())?void 0:e.sort((e,l)=>(null==k?void 0:k.latitude)&&(null==k?void 0:k.longitude)?w(k.latitude,k.longitude,e.attributes.field_latitude,e.attributes.field_longitude)-w(k.latitude,k.longitude,l.attributes.field_latitude,l.attributes.field_longitude):l.attributes.title.localeCompare(e.attributes.title))},[null==k?void 0:k.latitude,null==k?void 0:k.longitude,O]),D=(0,i.useCallback)((e,l,t)=>{let a=((e,l,t,a)=>null==e?void 0:e.sort((e,l)=>w(t,a,e.attributes.field_latitude,e.attributes.field_longitude)-w(t,a,l.attributes.field_latitude,l.attributes.field_longitude)).slice(0,l))(R(),e,l,t);if(a&&a.length>0){var i;let e=new google.maps.LatLngBounds;null==a||a.forEach(l=>{e.extend(new google.maps.LatLng(l.attributes.field_latitude+.01,l.attributes.field_longitude+.01)),e.extend(new google.maps.LatLng(l.attributes.field_latitude-.01,l.attributes.field_longitude-.01))}),null==(i=E.current)||i.fitBounds(e)}},[R]),F=(0,i.useCallback)(()=>{C(M().map(e=>{var l,t;let a={title:e.attributes.title,addressLine1:e.attributes.field_address.address_line1,addressLine2:e.attributes.field_address.address_line2,postalCode:e.attributes.field_address.postal_code,locality:e.attributes.field_address.locality,link:e.attributes.path,status:"",officeType:null==(t=e.relationships.field_office_type.data)||null==(l=t.attributes)?void 0:l.name};return{key:e.id,icon:"/icons/pin.svg",selectedIcon:"/icons/pin-selected.svg",clickable:!0,info:a,position:{lat:e.attributes.field_latitude,lng:e.attributes.field_longitude},onClick:()=>A(e)}}))},[M]),H=e=>{v(e),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"office_search",searchTerm:e})},B=(0,i.useCallback)(e=>{var l;let t=new google.maps.LatLngBounds;
1null==(l=R())||l.forEach(e=>{t.extend(new google.maps.LatLng(e.attributes.field_latitude,e.attributes.field_longitude))}),E.current=e,u(!0),e.fitBounds(t)},[R]);(0,i.useEffect)(()=>{if(o){var e;D(h===c.INITIAL_STATE||h===c.SHOW_ALL?null==(e=R())?void 0:e.length:6,null==k?void 0:k.latitude,null==k?void 0:k.longitude)}},[null==k?void 0:k.latitude,null==k?void 0:k.longitude,R,o,h,D]),(0,i.useEffect)(()=>{F()},[S,s,F]),(0,i.useEffect)(()=>{switch(h){case c.INITIAL_STATE:case c.SHOW_ALL:y(8);return;case c.USE_MY_LOCATION:y(6),navigator.geolocation.getCurrentPosition(e=>{let{coords:{latitude:l,longitude:t}}=e;L({latitude:l,longitude:t}),D(6,l,t)},e=>console.log("err :>> ",e));return;case c.SEARCH_TERM:y(6);return}},[h,D]),(0,i.useEffect)(()=>{f&&o&&new google.maps.Geocoder().geocode({address:f,componentRestrictions:{country:"BE"}},(e,l)=>{if(l===google.maps.GeocoderStatus.OK){var t,a,i,n;let l=null==e||null==(a=e[0].geometry)||null==(t=a.location)?void 0:t.lat(),s=null==e||null==(n=e[0].geometry)||null==(i=n.location)?void 0:i.lng();L({latitude:l,longitude:s}),D(6,l,s)}})},[f,o,D]);let G=(0,i.useCallback)(e=>{g(1),I(e)},[]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"c-office-overview__hero-section section-padding-inline d-flex flex-column flex-xxl-row align-items-xxl-center",children:[(0,a.jsx)("div",{className:"d-none d-xxl-block c-office-overview__searchbar-wrapper",children:(0,a.jsx)(d,{title:t.attributes.field_cta_title,description:t.attributes.field_cta_description,onOfficeSearchTermSubmit:H,onStateChange:m})}),(0,a.jsx)(n.A,{mapContainerClassName:"c-office-page__hero-map w-100",onLoad:B,markers:N}),(0,a.jsx)("div",{className:"d-xxl-none",children:(0,a.jsx)(d,{title:t.attributes.field_cta_title,description:t.attributes.field_cta_description,onOfficeSearchTermSubmit:H,onStateChange:m})})]}),(0,a.jsxs)("section",{className:"section-padding-inline",children:[(0,a.jsx)(b,{offices:M()}),(0,a.jsx)(j,{setCategoryFilter:G}),(0,a.jsx)(_,{offices:M(),maxNbrOfOfficesPerPage:x,noResultText:null==(l=t.attributes.field_no_results)?void 0:l.processed,currentPage:p,setCurrentPage:g,initialPage:r})]})]})}},39925:(e,l,t)=>{"use strict";t.d(l,{A:()=>_});var a=t(15039),i=t.n(a),n=t(14232),s=t(44935),r=t(92749),o=t(37876);let c=n.forwardRef((e,l)=>{let{active:t=!1,disabled:a=!1,className:n,style:s,activeLabel:c="(current)",children:d,linkStyle:u,linkClassName:f,as:v=r.A,...h}=e,m=t||a?"span":v;return(0,o.jsx)("li",{ref:l,style:s,className:i()(n,"page-item",{active:t,disabled:a}),children:(0,o.jsxs)(m,{className:i()("page-link",f),style:u,...h,children:[d,t&&c&&(0,o.jsx)("span",{className:"visually-hidden",children:c})]})})});function d(e,l){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,a=n.forwardRef((e,a)=>{let{children:i,...n}=e;return(0,o.jsxs)(c,{...n,ref:a,children:[(0,o.jsx)("span",{"aria-hidden":"true",children:i||l}),(0,o.jsx)("span",{className:"visually-hidden",children:t})]})});return a.displayName=e,a}c.displayName="PageItem";let u=d("First","\xab"),f=d("Prev","â¹","Previous"),v=d("Ellipsis","â¦","More"),h=d("Next","âº"),m=d("Last","\xbb"),p=n.forwardRef((e,l)=>{let{bsPrefix:t,className:a,size:n,...r}=e,c=(0,s.oU)(t,"pagination");return(0,o.jsx)("ul",{ref:l,...r,className:i()(a,c,n&&"".concat(c,"-").concat(n))})});p.displayName="Pagination";let _=Object.assign(p,{First:u,Prev:f,Ellipsis:v,Item:c,Next:h,Last:m})},50281:(e,l,t)=>{"use strict";t.d(l,{A:()=>u});var a=t(37876),i=t(14232),n=t(39925),s=t(16347),r=t(96851),o=t(89099),c=t(10314),d=t(32033);let u=e=>{let{onPageChange:l,initialPage:t,activePageIndex:u,...f}=e,v=(0,o.useRouter)(),h=(0,r.c)(),m=(0,s.A)("(min-width:1200px)"),p=f.nbrOfPages,_=f.nbrOfItems,g=f.nbrOfItemsPerPage,w=(0,d.bP)(null==v?void 0:v.asPath),[b,x]=(0,i.useState)(t||1),j=(0,i.useCallback)(()=>null!=p?p:Math.ceil(_?_/(g||1):0),[g,_,p]),y=(0,i.useCallback)((e,t)=>{x(e),null==l||l(e,t)},[l]);u!==b&&u&&y(u,!!u);let N=(0,i.useCallback)(e=>{e.preventDefault(),1!==b&&y(b-1)},[b,y]),C=(0,i.useCallback)(e=>{e.preventDefault(),y(+e.target.innerText)},[y]),k=(0,i.useCallback)(e=>{e.preventDefault(),b!==j()&&y(b+1)},[b,j,y]),L=(0,i.useCallback)(()=>{let e,l=[],t=2*!!m,i=b-t,s=b+t,r=i>2,o=s<j()-1;for(r&&l.push((0,a.jsx)(n.A.Ellipsis,{disabled:!0},"ellipsis-before")),e=i;e<=s;e++)e>1&&e<j()&&l.push((0,a.jsx)(n.A.Item,{className:"".concat(b===e?"active":""),onClick:C,href:"".concat("https://www.sdworx.ie","/").concat(v.locale).concat((0,c.R)(w,e)),children:e},"page-".concat(e)));return o&&l.push((0,a.jsx)(n.A.Ellipsis,{disabled:!0},"ellipsis-after")),l},[b,m,j,C,w,v.locale]),S=(0,i.useCallback)(()=>{let e=()=>(0,a.jsx)(n.A.Item,{className:"".concat(1===b?"active":""),onClick:C,href:"".concat("https://www.sdworx.ie","/").concat(v.locale).concat((0,c.R)(w,1)),children:1},"page-first");return 1>=j()?e():(0,a.jsxs)(a.Fragment,{children:[e(),L(),(0,a.jsx)(n.A.Item,{className:"".concat(b===j()?"active":""),onClick:C,href:"".concat("https://www.sdworx.ie","/").concat(v.locale).concat((0,c.R)(w,j())),children:j()},"page-last")]})},[b,j,C,L,w,v.locale]);return(0,a.jsx)("div",{className:"d-flex justify-content-center w-100",children:(0,a.jsxs)(n.A,{className:"align-items-center c-pagination",children:[(0,a.jsx)(n.A.Prev,{title:"Prev",className:"d-inline-flex flex-row align-items-center c-pagination-prev",disabled:1===b,onClick:N,href:1===b?void 0:"".concat("https://www.sdworx.ie","/").concat(v.locale).concat((0,c.R)(w,b-1)),children:m?h("pagination_prev"):null}),S(),(0,a.jsx)(n.A.Next,{title:"Next",className:"d-inline-flex flex-row align-items-center c-pagination-next",disabled:b===j(),onClick:k,href:b===j()?void 0:"".concat("https://www.sdworx.ie","/").concat(v.locale).concat((0,c.R)(w,b+1)),children:m?h("pagination_next"):null})]})})}},71431:(e,l,t)=>{"use strict";t.d(l,{A:()=>d});var a=t(37876),i=t(14232),n=t(62945),s=t(96851),r=t(50172),o=t(16347);let c=["places"],d=function(e){var l,t,d,u,f;let{id:v,libraries:h=c,zoom:m=7,markers:p=[],..._}=e,g=(0,s.c)(),{isLoaded:w}=(0,n.KD)({id:null!=v?v:"google-map-script",googleMapsApiKey:"AIzaSyDDfAJICF-fYD522TnC-GAj0VS5u_SAo4o",mapIds:["97da5afd217996d"],libraries:h}),[b,x]=(0,i.useState)(null),j=(0,o.A)("(min-width: 1200px)"),y=(0,i.useMemo)(()=>{var e,l,t,a;return[[null==b||null==(e=b.info)?void 0:e.addressLine1,null==b||null==(l=b.info)?void 0:l.addressLine2].filter(
1Boolean).join(" "),[null==b||null==(t=b.info)?void 0:t.postalCode,null==b||null==(a=b.info)?void 0:a.locality].filter(Boolean).join(" ")].filter(Boolean).join(" - ")},[null==b||null==(l=b.info)?void 0:l.addressLine1,null==b||null==(t=b.info)?void 0:t.addressLine2,null==b||null==(d=b.info)?void 0:d.locality,null==b||null==(u=b.info)?void 0:u.postalCode]),N=(0,i.useCallback)(()=>b&&x(null),[b]),C=(0,i.useCallback)(e=>{var l;N(),null==_||null==(l=_.onClick)||l.call(_,e)},[N,_]),k=(0,i.useCallback)(()=>p.map(e=>{let l=e.key===(null==b?void 0:b.key)&&e.selectedIcon?e.selectedIcon:e.icon;return(0,i.createElement)(n.pH,{...e,key:e.key,onClick:l=>{var t;e.clickable&&(x(e),null==e||null==(t=e.onClick)||t.call(e,l))},icon:l})}),[p,null==b?void 0:b.key]),L=(null==b||null==(f=b.info)?void 0:f.officeType)==="Large companies"?g("officeoverview_categorylabelget"):g("officeoverview_categorylabelsme"),S=(0,i.useCallback)(()=>{var e,l,t,i,n,s;return b?(0,a.jsxs)("div",{className:"c-map-selected-info",children:[(0,a.jsxs)("div",{className:"d-flex flex-row justify-content-between align-items-center position-relative mb-3",children:[(null==b||null==(e=b.info)?void 0:e.officeType)!==void 0?(0,a.jsx)("span",{className:"c-office-overview__office-type c-office-overview__office-type-".concat((null==b||null==(l=b.info)?void 0:l.officeType)==="Large companies"?"GET":"SME"),children:(null==b||null==(t=b.info)?void 0:t.officeType)!==void 0?L:null}):null,(0,a.jsx)("button",{className:"c-map-selected-info__close","aria-label":"Close info window",type:"button",onClick:N})]}),(0,a.jsx)("h6",{className:"mt-0",children:null==b||null==(i=b.info)?void 0:i.title}),(0,a.jsx)("p",{className:"c-map-selected-info__address",children:y}),(0,a.jsx)("p",{className:"c-map-selected-info__openinghours",children:null==b||null==(n=b.info)?void 0:n.status}),(0,a.jsx)(r.A,{link:null==b||null==(s=b.info)?void 0:s.link,extraClass:"btn btn--white",children:g.raw("map_moreinfo")})]}):null},[N,y,L,b,g]);return w?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.u6,{..._,zoom:m,onClick:C,mapId:"97da5afd217996d",children:[k(),j?S():null]}),j?null:S()]}):null}},89099:(e,l,t)=>{e.exports=t(16296)}}]);
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.