PageSourceSearch

https://www.soas.ac.uk/themes/custom/numiko/dist/bundle-444-c30ec0f5163f4d384927.js

js soas.ac.uk collected 2026-10-01 08:44:09 UTC 16,923 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunknumiko_frontend_framework=self.webpackChunknumiko_frontend_framework||[]).push([[444],{5444:function(e,t,o){o.r(t);var n=o(8769),i=o(4599),a=o(8512);const r=document.querySelector("[data-off-canvas-main-canvas]"),s=document.querySelector("[data-js-page]"),l=document.querySelector("[data-js-experience-wrapper]"),c=document.querySelector("[data-js-globe-hero-wrapper]"),u=document.querySelector("[data-js-experience-loader]"),d=`/themes/custom/numiko/dist/img/raster/earth-map.${S("jpg")}`,p=`/themes/custom/numiko/dist/img/raster/earth-bump-map.${S("png")}`,m=document.querySelector("[data-js-canvas-placeholder]"),h=document.querySelector("body");function y(e,t){if(!e||!t)return;const o=e.getBoundingClientRect().top;return t.getBoundingClientRect().top-o}function w(e,t,o){const n=o||200,a=new i.Pa4(e.position.x-n/2,e.position.y-n/2,e.position.z),r=new i.Pa4(e.position.x-n/2,e.position.y+n/2,e.position.z),s=new i.Pa4(e.position.x+n/2,e.position.y+n/2,e.position.z);a.project(t),r.project(t),s.project(t);const l=(1+a.x)/2*c.offsetWidth,u=(1-a.y)/2*c.offsetHeight,d=(1+r.x)/2*c.offsetWidth,p=(1-r.y)/2*c.offsetHeight;return{bottomLeftX:l,bottomLeftY:u,topRightX:(1+s.x)/2*c.offsetWidth,topRightY:(1-s.y)/2*c.offsetHeight,topLeftX:d,topLeftY:p}}function f(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"globe-height-hero";const n=2*e.getGlobeRadius,{topLeftY:i}=w(e,t,n),a=c.offsetHeight-i;h.style.setProperty(`--${o}`,`${a}px`)}function g(){document.querySelectorAll("[data-js-question-line]").forEach(((e,t)=>{const{width:o,height:i}=e.getBoundingClientRect(),a=[...document.querySelectorAll("[data-js-marker]")];if(o>0&&i>0){let o=y(e,a[t]);o&&n.p8.to(e,{height:o+"px"})}}))}const v=new CustomEvent("numiko:update-globe-tween");function S(e){return(0,a.d)()?"webp":e}var b=o(3513),q=o(5448);var k=o(592),E=o(8960),j=o(6608),T=o(438),A=o(3852);function H(e,t,o,i,a){const c=[{minHeight:0,minWidth:0,y:-5,z:-400},{minWidth:375,minHeight:700,y:-5,z:-425},{minWidth:600,minHeight:700,y:-5,z:-400},{minWidth:1e3,minHeight:800,y:-5,z:-320}];let d=!1;let p,h,y=0,w=!1,f=window.innerWidth;const v=document.querySelector("[data-js-skip-link]"),S=(0,A.Ds)((function(){const e=k.i.isInViewport(l,.99);e&&!p.isEnabled?z(p):!e&&p.isEnabled&&P(p)}),500),b=n.p8.to(t.globe.position,{y:()=>q(c).y,z:()=>q(c).z,duration:1,onComplete(){window.numikoHomeState.globeCanRotate=!0,n.p8.to(t.globe.rotation,{z:0,x:0,y:0,duration:1})}});function q(e){const t=window.innerHeight,o=window.innerWidth;let n;for(let i of e)t>=i.minHeight&&o>=i.minWidth&&(n=i);return n||(n=e[e.length-1]),n}function j(e){e.target.closest("header")||(e.preventDefault(),e.stopImmediatePropagation())}function H(e){0!==E.Qj.isTouch&&"INPUT"===e.target.tagName&&!0!==d&&(window.numikoHomeState.canResize=!1,window.removeEventListener("resize",T.L),document.querySelector("meta[name=viewport]").setAttribute("content","height="+window.innerHeight+", width=device-width, initial-scale=1.0"),k.i.config({autoRefreshEvents:"visibilitychange,DOMContentLoaded,load"}),d=!0)}function L(e,t){r.scrollTop!==e.scrollTrigger.labelToScroll(t)&&(w=!0,n.p8.to(r,{scrollTo:e.scrollTrigger.labelToScroll(t),duration:1,ease:"linear",onComplete(){setTimeout((()=>{w=!1}),600)}}))}function C(e){const t=["#ccc"];for(const o of t)if(e.target.closest(o))return;const o=e.target,{top:i}=o.getBoundingClientRect();!1===k.i.isInViewport(o,.1)&&n.p8.to(r,{scrollTo:h.scrollTrigger.labelToScroll("end"),duration:0,onComplete(){n.p8.to(r,{scrollTo:r.scrollTop+i,duration:0})}})}function x(e){const t=e.key;"ArrowDown"===t&&r.scrollBy(0,20),"ArrowUp"===t&&r.scrollBy(0,-20)}function P(e){e.disable(),r.removeEventListener("touch",j),r.removeEventListener("touchmove",j)}function z(e){e.enable(),r.addEventListener("touch",j),r.addEventListener("touchmove",j)}function R(e,t){if(1===y){return void("wheel"!==t.event.type?n.p8.to(r,{scrollTo:l.nextElementSibling,onComplete(){P(t)}}):(r.scrollBy(0,1),P(t)))}r.scrollBy(0,.1);const o=e.nextLabel();L(e,o)}function M(e){const t=e.previousLabel();r.scrollBy(0,-.1),L(e,t)}function _(){L(h,"end")}function W(){b.invalidate()}function B(){0!==E.Qj.isTouch&&!0===d&&window.innerWidth!==f&&0!==E.Qj.isTouch&&!1!==d&&(window.numikoHomeState.canResize=!0,window.addEventListener("resize",T.L),d=!1,document.querySelector("meta[name=viewport]").setAttribute("content","width=device-width, initial-scale=1.0"),k.i.config({autoRefreshEvents:"visibilitychange,DOMContentLoaded,load,resize"}))}return{init:function(){return h=n.p8.timeline({scrollTrigger:{trigger:s,pin:!0,start:"top top",scrub:5,pinType:"fixed",scroller:r,anticipatePin:1,snap:{snapTo:"labels",duration:{min:.15,max:.35},delay:.25},onEnterBack(){p.isEnabled||z(p)}}}),p=E.Qj.create({target:l,type:"wheel,touch,scroll",preventDefault:!0,scrollSpeed:.1,wheelSpeed:.1,ignore:[document.querySelectorAll("header a","header ul","header nav div"),u,document.querySelectorAll("header [data-js-drilldown-submenu]")],onUp:e=>{if(n.p8.isTweening(r))return;"wheel"===e.event.type?M(h):R(h,e)},onDown:e=>{if(n.p8.isTweening(r)||!0===w)return;"wheel"===e.event.type?R(h,e):M(h)}}),v.addEventListener("click",_),document.addEventListener("keydown",x),document.addEventListener("focusin",C),document.addEventListener("numiko:update-globe-tween",W),r.addEventListener("scroll",S),window.addEventListener("resize",B),document.addEventListener("focusin",H),z(p),h.addLabel("start"),h.to(document.querySelector("[data-js-question-section-wrapper]"),{autoAlpha:0,yPercent:-20,duration:.15,display:"none",onStart(){!r.scrollTop>0||(o&&n.p8.to(o,{autoAlpha:0}),window.numikoHomeState.userHasScrolled=!0,window.numikoHomeState.scrollTimelineActive=!0,e&&e.pause())},onReverseComplete(){0===r.scrollTop&&!1!==window.numikoHomeState.scrollTimelineActive&&(o&&1!==e.progress()&&n.p8.to(o,{autoAlpha:1}),window.numikoHomeState.scrollTimelineActive=!1,e&&!1===window.numikoHomeState.userPausedIntro&&e.play(),z(p))}}),h.to(document.querySelectorAll("[data-js-question-line]"),{clipPath:"inset(0 0 100% 0)",duration:.4},"<"),h.add(b,"<"),h.fromTo("[data-js-course-finder]",{autoAlpha:0,yPercent:-10},{autoAlpha:1,yPercent:0,onStart(){y=1,n.p8.to(m,{opacity:.2,duration:1}),i&&n.p8.to(i,{autoAlpha:1,delay:.75,onComplete(){a.isActive()||a.play()}})},onReverseComplete(){if(y=0,z(p),i&&n.p8.to(i,{autoAlpha:0}),window.numikoHomeState.questionsStarted){window.numikoHomeState.globeCanRotate=!1;const e=window.numikoHomeState.lastKnownCoords;n.p8.to(t.globe.rotation,{x:e.x,y:e.y,duration:1.25,ease:"sine.out",onComplete(){g()}})}n.p8.to(m,{opacity:1,duration:1})}}),h.addLabel("end"),{scrollTimeline:h}},destroy:function(){r.scrollTop=0,h.scrollTrigger.kill(),h.kill(),h.getChildren().forEac
1h((e=>{e.targets().forEach((e=>{e instanceof HTMLElement!=!1&&n.p8.set(e,{clearProps:"all"})}))})),h=null,m.removeAttribute("style"),p&&p.kill(),v.removeEventListener("click",_),document.removeEventListener("keydown",x),document.removeEventListener("focusin",C),document.removeEventListener("numiko:update-globe-tween",W),r.removeEventListener("touch",j),r.removeEventListener("touchmove",j),r.removeEventListener("scroll",S),window.removeEventListener("resize",B),document.removeEventListener("focusin",H)}}}n.p8.registerPlugin(k.i),n.p8.registerPlugin(E.Qj),n.p8.registerPlugin(j.L);var L=o(699),C=o(3276),x=o(3199);let P,z,R,M,_,W,B,I=new i._12(200,200),$=new i.vBJ({transparent:!0,opacity:0,alphaTest:0,visible:!1,side:i.ehD});const D=new i.Kj0(I,$),N=new CustomEvent("numiko:globe-ready");let Q;function O(){window.numikoHomeState.canResize&&(z.forEach((e=>{e.setSize(c.offsetWidth,c.offsetHeight)})),_.aspect=c.offsetWidth/c.offsetHeight,_.updateProjectionMatrix(),requestAnimationFrame((()=>{f(D,_),f(D,_,"globe-height-hero-reduced"),g()})))}function U(e){if(!e)return;P=(new C.Z).globeImageUrl(d).bumpImageUrl(p).htmlElement((()=>{const e=document.createElement("div");return e.style.width="1px",e.style.height="1px",e.style.opacity="0",e.setAttribute("data-js-marker",""),e})),P.onGlobeReady((()=>{f(P,_),n.p8.set(D.position,{z:-75}),f(D,_,"globe-height-hero-reduced"),document.dispatchEvent(N)})),P.position.y=-120,P.position.z=-20,D.position.y=-120,D.position.z=-20;const t=P.globeMaterial();return t.bumpScale=10,(new i.dpR).load(d,(e=>{t.specularMap=e,t.specular=new i.Ilk("grey")})),R=new i.xsS,R.add(P),R.add(D),M=new i.Ox3(16777215,.6),M.position.set(1,1,1),z=[new i.CP7({alpha:!0}),new L.M],z.forEach(((t,o)=>{const n=window.devicePixelRatio?window.devicePixelRatio:1;t.setPixelRatio&&t.setPixelRatio(n),t.setSize(c.offsetWidth,c.offsetHeight),e.appendChild(t.domElement),o>0&&(t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none")})),B=c.offsetWidth/c.offsetHeight,_=new i.cPb(50,B,1,1e3),_.updateProjectionMatrix(),_.position.z=75,R.add(new i.Mig(12303291)),R.add(M),function e(){window.numikoHomeState.globeCanRotate&&P&&(P.rotation.y+=3e-4),z.forEach((e=>e.render(R,_))),W=requestAnimationFrame(e)}(),Q=new x.do(O),Q.observe(c),{globe:P,heroGlobePlaceholder:D,scene:R,camera:_}}const Y=document.querySelector("[data-js-intro-play-pause]");let G=!1;const K=document.body,F=document.getElementsByTagName("html")[0],X=["fixed","top-0","left-0","w-full","h-full","overflow-hidden"],J=document.querySelector("[data-js-scroll-prompt]"),V=document.querySelector("[data-js-scroll-icon]"),Z=n.p8.timeline({paused:!0,repeat:-1,repeatDelay:1});Z.to(V,{yPercent:105,duration:.3,ease:"power2.out"}),Z.set(V,{opacity:0}),Z.set(V,{yPercent:-105,opacity:1}),Z.to(V,{yPercent:0,duration:.3,ease:"power2.out"});const ee=document.querySelector("[data-js-fallback]"),te=window.matchMedia("(min-height: 568px)"),oe=window.drupalSettings.questions||[],ne=oe.length?oe[Math.floor(Math.random()*oe.length)]:null;let ie,ae=[];function re(e){return`\n    <div class="hidden z-10 relative" data-js-question-section="1" data-js-question-lat="${e.lat}" data-js-question-lon="${e.lon}">\n      <h2 class="c-homepage__secondary-question-preface">We ask...</h2>\n      <p class="c-homepage__secondary-question">${e.question}</p>\n      <div class="w-[5px] bg-color-teal absolute -bottom-[1.5rem] left-1/2 translate-y-full" data-js-question-line></div>\n    </div>`}function se(e){if(!e)return;const t=function(e){return`\n      <p class="c-homepage__question-preface" data-js-question-intro-wrapper>\n        <span data-js-question-intro-text>The world asks...</span><span data-js-cursor class="c-cursor">|</span>\n      </p>\n\n      <h2 class="c-homepage__question-placeholder" data-js-primary-question-placeholder>${e}</h2>\n\n      <h2 class="c-homepage__main-question" data-js-primary-question-wrapper>\n        <span data-js-primary-question-text>${e}</span><span data-js-cursor class="c-cursor">|</span>\n      </h2>\n    `}(e.question);document.querySelector("[data-js-question-main-wrapper]").innerHTML=t;const o=function(e){if(!e)return;let t="";for(const o of e)t+=re(o);return t}(e.soas_asks);return document.querySelector("[data-js-questions-secondary-placeholder]").innerHTML=o,{mainQuestionMarkup:t,secondaryQuestionsMarkup:o}}function le(e){window.numikoHomeState&&!1===window.numikoHomeState.canResize||(e.matches?(window.scrollBy(0,1),window.scrollBy(0,0),r.scrollTop=0,ue()):de())}function ce(){n.p8.to(u,{autoAlpha:0,duration:1,delay:1,overwrite:!0,onStart(){(0,A.jY)()},onComplete(){ie&&setTimeout((()=>{window.numikoHomeState.scrollTimelineActive||ie.play()}),500)}})}function ue(){if(u.removeAttribute("style"),ee.removeAttribute("style"),l.removeAttribute("style"),n.p8.killTweensOf([l,ee,u]),G)return void n.p8.to(u,{autoAlpha:0});window.numikoHomeState={questionsStarted:!1,questionsCompleted:!1,lastKnownCoords:null,globeCanRotate:!0,canResize:!0,userPausedIntro:!1,scrollTimelineActive:!1,userHasScrolled:!1},n.p8.set(l,{display:"flex"}),n.p8.set(ee,{display:"none"}),K.classList.add(...X),F.classList.add(...X),r.classList.add("overflow-auto","h-full"),se(ne);const{globe:e,scene:t,camera:o}=U(m),i=function(e,t,o){if(!e)return;const i=[...o.soas_asks.map((e=>({lat:e.lat,lng:e.lon})))],a=n.p8.timeline({delay:.3,onStart(){t.globe.htmlElementsData(i),window.numikoHomeState.questionsStarted=!0},onComplete(){window.numikoHomeState.questionsCompleted=!0}});return e.forEach(((o,i)=>{const r=Number(o.getAttribute("data-js-question-lat")),s=Number(o.getAttribute("data-js-question-lon")),l=o.querySelector("[data-js-question-line]");a.fromTo(o,{opacity:0,y:-50}
1,{opacity:1,y:0,duration:1,onStart(){if(o.classList.remove("hidden"),window.numikoHomeState.globeCanRotate=!1,r&&s&&!window.numikoHomeState.scrollTimelineActive){let e={x:(r-75)*(Math.PI/180),y:-s*(Math.PI/180)};n.p8.to(t.globe.rotation,{x:e.x,y:e.y,duration:1.25,ease:"sine.out"}),window.numikoHomeState.lastKnownCoords=e}},onComplete(){const e=document.querySelectorAll("[data-js-marker]")[i];n.p8.fromTo(l,{height:0},{delay:.5,height:()=>`${y(l,e)}px`})}}),i+1!==e.length&&(a.to(l,{opacity:0,height:0},"+=3"),a.to(o,{opacity:0,y:-50,duration:.5,onComplete(){o.classList.add("hidden")}}))})),a}(document.querySelectorAll("[data-js-question-section]"),{globe:e,scene:t,camera:o},ne),a=function(e,t,o,i,a){let r;const s=document.querySelector("[data-js-question-intro-wrapper]"),l=document.querySelector("[data-js-question-intro-text]"),c=document.querySelector("[data-js-primary-question-wrapper]"),u=document.querySelector("[data-js-primary-question-text]"),d=document.querySelector("[data-js-primary-question-placeholder]");function p(e){const t=o.querySelector("[data-js-button-label]"),n=o.querySelector("use");"paused"===e&&(window.numikoHomeState.userPausedIntro=!0,t.innerText="Play animation",n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#sprite-icon-play")),"playing"===e&&(window.numikoHomeState.userPausedIntro=!1,t.innerText="Pause animation",n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#sprite-icon-pause"))}function m(){r.paused()?(r.play(),p("playing")):(r.pause(),p("paused"))}return{init:function(){return new q.C(u,{type:"words,chars",wordsClass:"word",linesClass:"line",charsClass:"char"}),new q.C(l,{type:"words,chars",wordsClass:"word",linesClass:"line",charsClass:"char"}),r=n.p8.timeline({paused:!0,onStart(){n.p8.to(o,{opacity:1})},onComplete(){window.numikoHomeState.userHasScrolled||n.p8.fromTo(i,{opacity:0,y:20},{opacity:1,y:0,ease:b.eJ.easeOut.config(2.25),onComplete(){a.play()}}),n.p8.to(o,{autoAlpha:0})}}),n.p8.set([u.querySelectorAll(".word"),l.querySelectorAll(".word")],{display:"none"}),r.fromTo(s.querySelectorAll(".char"),{display:"none"},{display:"inline",stagger:{each:.1,onStart(){const e=this.targets()[0];n.p8.set(e.parentElement,{display:"inline-block"})}},ease:"SteppedEase.config(37)"}).to(s,{scale:.4,onStart(){const e=s.querySelector("[data-js-cursor]");n.p8.to(e,{autoAlpha:0,duration:0})}}).to(c,{height:()=>`${d.scrollHeight}px`,onStart(){n.p8.set(c,{overflow:"visible"})}},"<").fromTo(c.querySelectorAll(".char"),{display:"none"},{display:"inline",stagger:{each:.1,onStart(){const e=this.targets()[0];n.p8.set(e.parentElement,{display:"inline-block"})}},ease:"SteppedEase.config(37)"}).to(c.querySelectorAll(".char"),{display:"none",stagger:{each:-.03,onComplete(){const e=this.targets()[0];e.parentElement.firstElementChild===e&&n.p8.set(e.parentElement,{display:"none"})}},ease:"SteppedEase.config(37)",onStart(){n.p8.to(s,{opacity:0,duration:.6,delay:.2})},onComplete(){window.numikoHomeState.scrollTimelineActive||(n.p8.set(document.querySelector("[data-js-question-main-wrapper]"),{display:"none"}),n.p8.to(t.position,{z:-75,onStart(){window.numikoHomeState.scrollTimelineActive&&this.kill()},onUpdate(){document.dispatchEvent(v),window.numikoHomeState.scrollTimelineActive&&this.kill()},onComplete(){document.dispatchEvent(v)}}))}}),r.add(e),o.addEventListener("click",m),r},destroy:function(){r.kill(),r=null,e.kill(),e=null,o.removeEventListener("click",m),o.removeAttribute("style"),p("playing"),document.querySelector("[data-js-question-main-wrapper]").removeAttribute("style"),i.removeAttribute("style")}}}(i,e,Y,J,Z);ie=a.init(),ae.push(a);const s=H(ie,{globe:e,scene:t,camera:o},Y,J,Z);s.init(),ae.push(s),document.addEventListener("numiko:globe-ready",ce),G=!0}function de(){n.p8.killTweensOf([l,ee,u]),n.p8.set(l,{display:"none"}),n.p8.set(ee,{display:"block"}),n.p8.to(u,{autoAlpha:0,duration:1}),!1!==G&&(G=!1,ie=null,cancelAnimationFrame(W),Q&&(Q.unobserve(c),Q=null),z.forEach((e=>{e.domElement.remove(),e=null})),_=null,B=null,M=null,P.onGlobeReady((()=>!1)),P=null,R=null,document.removeEventListener("numiko:globe-ready",ce),ae.forEach((e=>{e.destroy()})),ae=[],document.querySelector("[data-js-question-main-wrapper]").innerHTML="",document.querySelector("[data-js-questions-secondary-placeholder]").innerHTML="")}te.matches?ue():de();try{te.addEventListener("change",le)}catch(e){try{te.addListener(le)}catch(e){console.error(e)}}}}]);

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.