PageSourceSearch

https://www.handelskammer.dk/build/assets/globe-component-xy_M_g-J.js

js handelskammer.dk collected 2026-10-02 11:06:00 UTC 15,624 bytes, 1 lines download raw bytes

1import{d as Ce,m as Se,r as f,am as Ie,o as Oe,k as Y,n as se,w as Ae,b as ze,c as l,e as r,F as ae,y as ie,g as F,s as n,t as u,f as w,D as le,aa as re,h as j,i as q,x as Be,E as ce,v as Fe,U as Me}from"./app-BQ-43nIL.js";import{Q as ue}from"./browser-CFmrAm1B.js";import{g as Ge,a as $e,b as qe}from"./globeBackgroundImage-DwiFMXCX.js";import{_ as Re}from"./dihk-slider.scss_vue_type_style_index_0_src_true_lang-FmoKKIuU.js";import{_ as Ve}from"./teaser-tag.vue_vue_type_script_setup_true_lang-D4WytcJS.js";import{S as Ne}from"./swiper-vue-CN3QfT8j.js";import{_ as He}from"./dihk-button.vue_vue_type_script_setup_true_lang-CMVXMAoq.js";import"./_commonjsHelpers-CqkleIqs.js";import"./pagination-DPbamJQG.js";const de="171",R={PAN:1,DOLLY_ROTATE:3};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:de}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=de);const Pe={key:0,class:"globe-language-container"},We=["data-unit-test-id","onClick"],Ue={class:"globe-language-icon"},Qe=["xlink:href"],Ze={class:"globe-language-name"},Ye={class:"visually-hidden"},je={class:"position-relative d-flex"},Xe={key:0,class:"globe-pin-container"},Je={class:"globe-zoom-controls-container"},Ke=["title"],et={class:"visually-hidden"},tt=["title"],ot={class:"visually-hidden"},nt={key:1,class:"spinner-overlay"},st={key:2,class:"globe-overlay"},at={class:"globe-popup-wrapper u-scrollbar"},it=["title"],lt={class:"visually-hidden"},rt={class:"globe-popup-name"},ct={class:"globe-popup-contact-info"},ut={class:"globe-popup-contact-info-wrapper"},dt={class:"globe-popup-subtitle"},ft={class:"globe-popup-contact-info-text u-hyphens-auto is-address"},vt={key:0,class:"globe-popup-contact-info-text u-hyphens-auto"},pt={key:0},ht=["href","title"],gt={key:1,class:"globe-popup-contact-info-text is-email"},mt={key:0},bt=["href","title"],_t={class:"globe-popup-contact-info-text u-hyphens-auto"},wt={key:0},yt=["href","title"],kt={class:"visually-hidden"},Et={class:"globe-contact-flip-inner"},Dt={class:"globe-contact-flip-front"},Lt={class:"globe-contact-flip-text"},xt={class:"globe-contact-flip-back"},Tt={class:"globe-contact-flip-text"},Ct={key:1,class:"globe-contact-button"},St={class:"globe-popup-contact-info-text is-description"},It={key:2,class:"globe-popup-featured-content"},Ot={class:"globe-popup-featured-content-subtitle"},At={class:"globe-featured-item-img-wrapper"},zt={class:"image-wrapper"},Bt=["src"],Ft={key:1,class:"globe-featured-item-placeholder"},Mt={key:2,class:"qr-code-wrapper"},Gt=["src"],$t={class:"qr-code-label"},qt={class:"globe-featured-item-text-wrapper"},Rt={class:"globe-featured-item-title"},Vt={class:"globe-featured-item-description u-hyphens-auto"},Nt={class:"globe-finger-icon"},Ht=1080,Kt=Ce({__name:"globe-component",props:{translations:{},isDDS:{type:Boolean},isBlock:{type:Boolean},isIframe:{type:Boolean},languageCode:{}},setup(b){const p=f(null),T=f(null),V=f(null),C=f(!1),i=f(null);let S=f([]),y=null;const N=f(!1),H=f(!1),P=f("gb"),fe=f([{code:"gb",name:"English"},{code:"de",name:"German"}]),M=f(!1),A=f(!1),d=f("eng-GB"),{deactivate:ve}=Se(T),pe=async e=>{P.value=e,d.value=e==="de"?"ger-DE":"eng-GB",A.value=!0;try{S.value=await Y(`/api/pins/${d.value}`,{method:"GET"}),await ee()}catch(t){console.error(`Failed to FETCH DATA: ${t}`)}finally{A.value=!1}},he=()=>{M.value=!M.value};let c=null;const I=f(!1);let W=null;const s=b,O=f(!1),X=f(120),U=f(s.isDDS?500:300);function G(e){T.value&&!T.value.contains(e.target)&&$()}Ie(()=>{d.value=s.languageCode==="ger-DE"?"ger-DE":"eng-GB"}
1),Oe(()=>{be(),ke(),p.value.addEventListener("touchstart",G),p.value.addEventListener("mousedown",G)});const Q={mobile:16,tablet:48,desktop:48};function ge(){if(!p.value)return{width:0,height:0};const e=window.outerWidth,t=window.outerWidth<768?window.outerHeight/2:710;let o=0;return e<768?(o=Q.mobile,me(),c.controls().touches.ONE=null,c.controls().touches.TWO=R.PAN,c.controls().touches.TWO=R.DOLLY_ROTATE,U.value=350):e>=768&&e<992?o=Q.tablet:o=Q.desktop,{width:Math.min(e-2*o,Ht),height:t}}function J(e){const t=e.target;c.width(t.innerWidth),c.height(t.innerHeight)}function Z(){if(!c||!p.value)return;const{width:e,height:t}=ge();c.width(e).height(t)}function K(e){const t=p.value.querySelector("canvas");e.touches.length===1?t.style.touchAction="auto":(t.style.touchAction="none",c.controls().touches.TWO=R.PAN,c.controls().touches.TWO=R.DOLLY_ROTATE)}function me(){if(!p.value)return;const e=p.value.querySelector("canvas");e&&e.addEventListener("touchmove",K,{passive:!0})}async function be(){if(!p.value){console.error("Globe container is not found.");return}c=new Ge(p.value).globeImageUrl($e).backgroundImageUrl(qe).showAtmosphere(!0).atmosphereColor("#cce6ff").atmosphereAltitude(.25),(s.isDDS||s.isIframe)&&window.addEventListener("resize",J),s.isBlock&&(Z(),window.addEventListener("resize",Z));const e=c.camera();c.controls().addEventListener("change",()=>{const v=e.position.length();v<=X.value?(e.position.setLength(X.value),N.value=!0):v>=U.value?(e.position.setLength(U.value),H.value=!0):(N.value=!1,H.value=!1)});const t=10,o=s.isDDS?3.6:1.6;c.pointOfView({lat:1.6,lng:t,altitude:o},0);try{let v="eng-GB";s.isBlock?v=s.languageCode:s.isIframe&&(v="ger-DE"),S.value=await Y(`/api/pins/${v}`,{method:"GET"}),await ee()}catch(v){console.error(`Failed to FETCH DATA: ${v}`)}const a=40;let m=s.isDDS?3.6:1.6,h=t+360;_e(t,a,o,m,h)}function _e(e,t,o,a,m){const k=s.isDDS?1:.6,E=10;let D=null,x=null;const L=()=>{D&&clearInterval(D),x&&clearTimeout(x)},g=["mousedown","touchstart","wheel"],B=()=>{O.value=!0,L(),g.forEach(_=>p.value.removeEventListener(_,B))};g.forEach(_=>p.value.addEventListener(_,B)),D=setInterval(()=>{let _=!0;a>o&&(a=Math.max(a-.02,o),_=!1),m>e&&(m=Math.max(m-.2,e),_=!1),c?.pointOfView({lat:E,lng:m,altitude:a},0),_&&(L(),we(t,e,k,()=>{x=setTimeout(()=>{ye(t,e,k)},5e3)}))},20)}function we(e,t,o,a){let h=c?.pointOfView().lat,v=c?.pointOfView().lng,k=c?.pointOfView().altitude,E=null;const D=["mousedown","touchstart","wheel"],x=()=>{E&&clearInterval(E)},L=()=>{O.value=!0,x(),D.forEach(g=>window.removeEventListener(g,L))};D.forEach(g=>window.addEventListener(g,L)),E=setInterval(()=>{let g=!0;Math.abs(h-e)>.1&&(h+=(e-h)*.01,g=!1),Math.abs(v-t)>.1&&(v+=(t-v)*.01,g=!1),Math.abs(k-o)>.01&&(k+=(o-k)*.01,g=!1),c?.pointOfView({lat:h,lng:v,altitude:k},0),g&&(x(),a&&a())},20)}function ye(e,t,o){I.value=!0;const a=document.querySelector(".globe-finger-icon"),m=4e3,h=200,v=m/h,k=-20;let E=0;const D=t,x=t+k;let L=null;function g(){L&&clearInterval(L),I.value=!1,O.value=!0,B.forEach(_=>window.removeEventListener(_,g))}const B=["mousedown","touchstart","wheel"];B.forEach(_=>window.addEventListener(_,g)),a&&(a.style.animation=`finger-left-to-right-swipe ${m}ms ease-in-out forwards`),L=setInterval(()=>{E++;const _=E/h,Te=D+_*(x-D);c?.pointOfView({lat:e,lng:Te,altitude:o},0),E>=h&&g()},v)}async function ee(){if(!S.value||S.value.length===0){c?.htmlElementsData(S.value);return}c?.htmlElementsData(S.value).htmlElement(e=>{const t=document.createElement("div");t.classList.add("marker"),t.style.position="relative",t.style.pointerEvents="auto",t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="center";const o=document.createElement("div");o.classList.add("marker-wrapper"),o.style.width="20px",o.style.height="20px",o.style.cursor="pointer",o.setAttribute("tabindex","0"),o.setAttribute("aria-label",`Marker for ${e.name}`),o.setAttribute("data-unit-test-id",`globe-marker-${e.name}`),o.setAttribute("role","button");const a=document.createElement("div");return a.className="marker-label",a.innerText=e.name,a.setAttribute("tabindex","0"),a.setAttribute("role","button"),a.style.cursor="pointer",a.style.pointerEvents="auto",t.appendChild(o),t.appendChild(a),te(o,e,o),te(a,e,o),p.value?.appendChild(t),t})}function te(e,t,o){e.addEventListener("click",a=>{a.stopPropagation(),oe(a,t,o)}),e.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),oe(a,t,o))})}async function oe(e,t,o){A.value=!0;try{let a;if(s.isBlock?a=s.languageCode:s.isIframe?a="ger-DE":a=P.value==="de"?"ger-DE":"eng-GB",i.value=await Y(`/api/pins/${t.id}/${a}`,{method:"GET"}),C.value=!0,await se(()=>{i.value.form&&Ee(i.value.form)}),i.value.featured&&Array.isArray(i.value.featured))for(const m of i.value.featured)m.url&&ue.toDataURL(m.url,{scale:30,errorCorrectionLevel:"L",margin:0}).then(async h=>{m.qrCode=h,await se()}).catch(h=>{console.error("Failed to generate QR code:",h)})}catch(a){console.error(`Failed to FETCH DATA: ${a}`)}finally{A.value=!1}z(),y&&y!==o&&y.classList.remove("active-pin"),y=o,y.classList.add("active-pin")}function ke(){document.addEventListener("click",e=>{T.value&&!T.value.contains(e.target)&&!y?.contains(e.target)&&$()}),document.addEventListener("keydown",e=>{e.key==="Escape"&&$()})}function $(){C.value=!1,i.value=null,ve(),y&&(y.classList.remove("active-pin"),y=null),z(),M.value=!1}function Ee(e){V.value&&ue.toCanvas(V.value,e,{width:90,scale:10,errorCorrectionLevel:"L",margin:0},t=>{t&&console.error("QR Code generation failed:",t)})}function z(){I.value=!1,O.value=!0,W&&clearTimeout(W),W=setTimeout(()=>{C.value||(I.value=!0,O.value=!1)},3e5)}function De(){const e=c.camera(),t=e.position.length();e.position.setLength(t+10)}function Le(){const e=c.camera(),t=e.position.length();e.position.setLength(t-10)}const ne=["mousemove","click","keydown","wheel","touchstart","touchmove","touchend"];
1function xe(){ne.forEach(e=>window.addEventListener(e,z)),z()}return Ae(O,e=>{if(e){I.value=!0;const t=document.querySelector(".globe-finger-icon"),o=4e3;t&&(t.style.animation=`finger-left-to-right-swipe ${o}ms ease-in-out forwards`),xe()}}),ze(()=>{if(window.removeEventListener("resize",Z),window.removeEventListener("resize",J),ne.forEach(e=>window.removeEventListener(e,z)),document.removeEventListener("touchstart",G),document.removeEventListener("mousedown",G),p.value){const e=p.value.querySelector("canvas");e&&e.removeEventListener("touchmove",K)}}),(e,t)=>(l(),r("div",{class:F(["b-globe-component",{"is-dds":b.isDDS,"is-block":b.isBlock,"is-iframe":b.isBlock}])},[b.isDDS?(l(),r("div",Pe,[(l(!0),r(ae,null,ie(fe.value,o=>(l(),r("button",{key:o.code,class:F(["globe-language-cell u-reset-button u-focus-ring",{"is-selected":o.code===P.value}]),"data-unit-test-id":`globe-language-${o.code}`,onClick:a=>pe(o.code)},[(l(),r("svg",Ue,[n("use",{"xlink:href":`#flag-${o.code}`},null,8,Qe)])),n("span",Ze,u(o.name),1),n("span",Ye,u(o.name),1)],10,We))),128))])):w("",!0),n("div",je,[n("div",{ref_key:"globeContainer",ref:p,class:"globe-visualisation"},null,512),b.isDDS?(l(),r("div",Xe)):w("",!0),n("div",Je,[n("button",{type:"button",class:F(["zoom-controls u-reset-button u-focus-ring",{"is-disabled":N.value}]),"data-unit-test-id":"zoom-in",title:s.translations[d.value].zoomIn,onClick:Le},[n("span",et,u(s.translations[d.value].zoomIn),1),t[0]||(t[0]=n("svg",{class:"zoom-controls-icon"},[n("use",{"xlink:href":"#plus"})],-1))],10,Ke),t[2]||(t[2]=n("svg",{class:"zoom-controls-icon"},[n("use",{"xlink:href":"#line"})],-1)),n("button",{type:"button",class:F(["zoom-controls u-reset-button u-focus-ring",{"is-disabled":H.value}]),"data-unit-test-id":"zoom-out",title:s.translations[d.value].zoomOut,onClick:De},[n("span",ot,u(s.translations[d.value].zoomOut),1),t[1]||(t[1]=n("svg",{class:"zoom-controls-icon"},[n("use",{"xlink:href":"#minus"})],-1))],10,tt)]),A.value?(l(),r("div",nt,[...t[3]||(t[3]=[n("div",{class:"spinner"},null,-1)])])):w("",!0),b.isDDS?le((l(),r("div",st,null,512)),[[re,C.value]]):w("",!0),C.value?(l(),r("dialog",{key:3,ref_key:"popup",ref:T,class:"globe-popup",tabindex:"-1","data-unit-test-id":"globe-popup"},[n("div",at,[C.value?(l(),r("button",{key:0,type:"button",class:"globe-popup-close u-reset-button u-focus-ring","data-unit-test-id":"globe-popup-close-button",title:s.translations[d.value].closeModal,onClick:$},[n("span",lt,u(s.translations[d.value].closeModal),1),t[4]||(t[4]=n("svg",{class:"globe-popup-close-icon"},[n("use",{"xlink:href":"#cross"})],-1))],8,it)):w("",!0),n("h4",rt,u(i.value?.name),1),n("div",ct,[n("div",ut,[n("h5",dt,u(i.value?.contact_heading),1),n("address",ft,u(i.value?.address),1),i.value?.phone?(l(),r("p",vt,[b.isDDS?(l(),r("span",pt,u(i.value?.phone),1)):(l(),r("a",{key:1,href:"tel:"+i.value?.phone,class:"globe-popup-contact-link u-focus-ring",title:s.translations[d.value].telephoneLabel+" "+i.value?.name},u(i.value?.phone),9,ht))])):w("",!0),i.value?.email?(l(),r("p",gt,[b.isDDS?(l(),r("span",mt,u(i.value?.email),1)):(l(),r("a",{key:1,href:"mailto:"+i.value?.email,title:s.translations[d.value].emailLabel+" "+i.value?.name,class:"globe-popup-contact-link u-focus-ring"},u(i.value?.email),9,bt))])):w("",!0),n("p",_t,[b.isDDS?(l(),r("span",wt,u(i.value?.url?.link.split("/")[2]),1)):(l(),r("a",{key:1,href:i.value?.url?.link,target:"_blank",title:s.translations[d.value].urlLabel,class:"globe-popup-contact-link u-focus-ring"},u(i.value?.url?.text?i.value?.url?.text:i.value?.url?.link.split("/")[2]),9,yt))])]),i.value?.form&&b.isDDS?(l(),r("button",{key:0,class:F(["globe-contact-flip-card u-focus-ring",{flipped:M.value}]),onClick:he}
1,[n("span",kt,u(s.translations.contactInfoQrFrontLabel),1),n("div",Et,[n("div",Dt,[t[5]||(t[5]=n("div",{class:"globe-contact-flip-icon-wrapper"},[n("svg",{class:"globe-contact-flip-icon"},[n("use",{"xlink:href":"#scan-qr"})])],-1)),n("span",Lt,u(s.translations[d.value].contactInfoQrFrontLabel),1)]),n("div",xt,[n("canvas",{ref_key:"qrCanvas",ref:V,class:"globe-contact-qr-canvas"},null,512),n("span",Tt,u(s.translations[d.value].contactInfoQrBackLabel),1)])])],2)):w("",!0)]),(b.isBlock||s.isIframe)&&i.value?.form?(l(),r("div",Ct,[j(He,{element:"a",href:i.value?.form,text:s.translations[d.value].contactUs,title:s.translations[d.value].contactUs,target:"_blank",brand:"secondary",size:"md"},{default:q(()=>[Be(u(s.translations[d.value].contactUs),1)]),_:1},8,["href","text","title"])])):w("",!0),n("p",St,u(i.value?.description),1),i.value?.featured&&i.value.featured.length>0?(l(),r("div",It,[n("h5",Ot,u(s.translations[d.value].featuredContent),1),j(Re,{class:"globe-featured-content-slider","button-text-prev":s.translations[d.value].buttonTextPrev,"button-text-next":s.translations[d.value].buttonTextNext,"swiper-type":"globe"},{slides:q(()=>[(l(!0),r(ae,null,ie(i.value.featured,(o,a)=>(l(),ce(Fe(Ne),{key:a,tag:"li",class:"globe-featured-slider-item"},{default:q(()=>[(l(),ce(Me(s.isBlock||s.isIframe?"a":"article"),{href:s.isBlock||s.isIframe?o.url:null,target:s.isBlock||s.isIframe?"_blank":null,class:"globe-featured-content-item u-focus-ring"},{default:q(()=>[n("div",At,[n("div",zt,[j(Ve,{type:o.type,"custom-class":"globe-featured-item-type",text:s.translations[d.value].type[o.type.toString().toLowerCase()]},null,8,["type","text"]),o.image?(l(),r("img",{key:0,src:o.image,class:"globe-featured-item-image",alt:""},null,8,Bt)):(l(),r("div",Ft)),b.isDDS?(l(),r("div",Mt,[o?.qrCode?(l(),r("img",{key:0,src:o.qrCode,class:"globe-featured-item-qr-code","data-unit-test-id":"globe-featured-item-qr-code",alt:""},null,8,Gt)):w("",!0),n("span",$t,u(s.translations[d.value].qrCodeLabel),1)])):w("",!0)])]),n("div",qt,[n("h5",Rt,u(o.title),1),n("p",Vt,u(o.description.length>121?o.description.substring(0,121)+"...":o.description),1)])]),_:2},1032,["href","target"]))]),_:2},1024))),128))]),_:1},8,["button-text-prev","button-text-next"])])):w("",!0)])],512)):w("",!0),le(n("div",Nt,null,512),[[re,I.value]])])],2))}});export{Kt as default};

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.