t.bottom)return;if(!e.deltaY)return;const n=1===e.deltaMode?16:2===e.deltaMode?s.clientHeight:1;e.preventDefault(),s.scrollTop+=e.deltaY*n},{passive:!1}),requestAnimationFrame(()=>{s.scrollTop=M(),E(0,!1)}),a(i,()=>i.classList.add("in"),.25)}(),function(){const s=String(o().teamTitle||"Us.").replace(/\.$/,"");e("#teamTitle").innerHTML=t(s)+'.';const n=o().teamColors||{},i=e("#teamSec").style;i.setProperty("--tm-body",n.body||"#fff"),i.setProperty("--tm-name",n.name||"var(--champagne)"),i.setProperty("--tm-role",n.role||"var(--gold)");const r=e("#teamRow"),l=e("#teamBio"),c=e("#teamDots"),d=e("#teamSec");r.innerHTML="",c.innerHTML="";let u=-1,p=null,h=!1,m=!1,f=null,v=null;function g(e){[...r.children].forEach((t,s)=>{t.classList.toggle("lit",s===e),t.classList.toggle("dim",e>=0&&s!==e)}),[...c.children].forEach((t,s)=>t.classList.toggle("on",s===e))}function y(e){const s=o().team[e];if(!s)return;const n=("“"+s.quote+"”").split(" ").map((e,s)=>''+t(e)+"").join(" ");l.innerHTML=''+n+'
'+t(String(s.name).replace(/\./g,""))+'. — '+t(s.role)+"
"}function L(e){u=e,g(e),y(e),l.offsetWidth,l.classList.add("show")}function w(e){clearTimeout(p),clearTimeout(v),g(e);const t=[...l.querySelectorAll(".bio-quote span")];if(t.length&&l.classList.contains("show")){t.forEach((e,s)=>{e.style.transitionDelay=.0125*(t.length-1-s)+"s",e.style.transitionDuration=".22s",e.style.transitionTimingFunction="cubic-bezier(.33,0,.2,1)"}),l.classList.remove("show");const s=12.5*(t.length-1)+220+200;v=setTimeout(()=>{L(e),b(e)},s)}else L(e),b(e)}function b(e){clearTimeout(p),m||(p=setTimeout(()=>w((e+1)%o().team.length),1e4))}(o().team||[]).forEach((e,s)=>{const n=document.createElement("div");n.className="team-card",n.style.transitionDelay=.15*s+"s",a(n,()=>setTimeout(()=>n.style.transitionDelay="",900)),n.innerHTML=''+t(String(e.name).replace(/\./g,""))+'.
'+t(e.role)+'
“'+t(e.quote)+'”
— '+t(e.role)+"
";const o=()=>{clearTimeout(f),m=!0,clearTimeout(p),s!==u?w(s):(clearTimeout(v),g(s),l.classList.contains("show")||(y(s),l.offsetWidth,l.classList.add("show")))};n.addEventListener("mouseenter",o),n.addEventListener("click",o),n.addEventListener("mouseleave",()=>{n.classList.remove("still"),clearTimeout(n._still),clearTimeout(f),f=setTimeout(()=>{m=!1,b(u)},1e3)}),n.addEventListener("pointermove",()=>{n.classList.remove("still"),clearTimeout(n._still),n._still=setTimeout(()=>n.classList.add("still"),2e3)}),r.appendChild(n);const i=document.createElement("button");i.className="carousel-dot sm",i.addEventListener("click",()=>{clearTimeout(f),m=!1,s!==u?w(s):b(s)}),c.appendChild(i)});const M=()=>{const e=l.offsetWidth;if(!e)return;const s=document.createElement("div");s.className="team-bio show",s.style.cssText="position:absolute;visibility:hidden;pointer-events:none;left:-9999px;width:"+e+"px;min-height:0;",d.appendChild(s);let n=0;(o().team||[]).forEach(e=>{s.innerHTML='“'+t(e.quote)+'”
'+t(e.name)+" — "+t(e.role)+"
",n=Math.max(n,s.offsetHeight)}),s.remove(),l.style.minHeight=n+"px"};requestAnimationFrame(M);let E=null;addEventListener("resize",()=>{clearTimeout(E),E=setTimeout(M,150)}),a(d,()=>{d.classList.add("in"),h||(h=!0,w(0))},.3),new IntersectionObserver(e=>{e[0].isIntersecting?h&&u>=0&&(clearTimeout(p),p=setTimeout(()=>w((u+1)%o().team.length),1e4)):clearTimeout(p)},{threshold:.05}).observe(d)}(),A(),H(),function(){const s=o().creed,n=e("#creedSec");if(s&&s.body&&s.body.length){if(n.style.display="",e("#creedBody").innerHTML=s.body.map(e=>""+t(e)+"
").join(""),a(e("#creedHead"),()=>e("#creedHead").classList.add("in"),.6),document.querySelectorAll("#creedBody p").forEach((e,t)=>a(e,()=>setTimeout(()=>e.classList.add("in"),90*t),.3)),matchMedia("(pointer: coarse)").matches){let t=null;e("#creedHead").addEventListener("touchstart",()=>{n.classList.remove("press"),n.offsetWidth,n.classList.add("press"),clearTimeout(t),t=setTimeout(()=>n.classList.remove("press"),2300)},{passive:!0})}}else n.style.display="none"}(),function(){const s=o().begin||{},n=o().footer||{},i=s.email||n.email||"paul@manicsky.com",r=n.phone||"(480) 201-9085",l=e=>String(e).split(/(?=[@ ])/).map(e=>""+t(e)+"").join("");e("#brMail").innerHTML=l(i),e("#brPhone").innerHTML=l(r);const c=(t,s)=>{const n=e(t),a=e(s),o=[...a.querySelectorAll("span")];let i=!1;const r=()=>{o.forEach((e,t)=>e.style.transitionDelay=.05*t+"s"),a.classList.add("on")},l=()=>{o.forEach((e,t)=>e.style.transitionDelay=.05*(o.length-1-t)+"s"),a.classList.remove("on")};return n.addEventListener("mouseenter",()=>{i||r()}),n.addEventListener("mouseleave",()=>{i||l()}),n.addEventListener("click",()=>{n._press?n._press():(i=!i,i?r():l()),n.classList.remove("pop"),n.offsetWidth,n.classList.add("pop")}),{show:()=>{i=!0,r()},hide:()=>{i=!1,l()}}},d=c("#bwMail","#brMail"),u=c("#bwPhone","#brPhone");let p=!1;e("#beginBtn").onclick=()=>{p=!p,p?(d.show(),u.show()):(d.hide(),u.hide())},["mouseenter","focus","click"].forEach(t=>e("#beginBtn").addEventListener(t,()=>e("#beginWays").classList.add("in"))),matchMedia("(pointer: coarse)").matches&&(a(e("#beginSec"),()=>e("#beginWays").classList.add("in"),.05),d.show(),u.show(),e("#bwMail")._press=()=>{R(i),D("email copied.","mailto:"+i,"open mail")},e("#bwPhone")._press=()=>{R(r),D("number copied.","tel:"+r.replace(/[^+0-9]/g,""),"call")})}(),function(){const t=e("#rail");t.innerHTML="";const s=[];let n=-1;function a(e){s.forEach(([,t],s)=>t.classList.toggle("on",s===e))}function o(){if(n>=0)return void a(n);const e=scrollY+innerHeight/2;let t=0,o=1e9;s.forEach(([s],n)=>{if(!s)return;const a=s.getBoundingClientRect(),i=a.top+scrollY+a.height/2,r=Math.abs(i-e);r=document.body.scrollHeight-4&&(t=s.length-1),a(t)}[[null,"home"],["#journeySec","process"],["#teamSec","us"],["#groupHost","portfolio"],["#gallerySec","stills"],["#creedSec","creed"],["#beginSec","begin"]].forEach(([o,i])=>{const r=o?e(o):null;if(o&&!r)return;const l=document.createElement("button");l.type="button",l.innerHTML=''+i+".";const c=s.length,d=e=>{e.preventDefault(),n=c,a(c);let t=0;r&&(t=r.getBoundingClientRect().top+scrollY-Math.round(innerHeight/8),t=Math.max(0,Math.min(t,document.body.scrollHeight-innerHeight))),"begin"===i&&(t=document.body.scrollHeight),N(t)};l.addEventListener("pointerdown",d),l.addEventListener("click",d),t.appendChild(l),s.push([r,l])}),["wheel","touchstart","keydown"].forEach(e=>addEventListener(e,e=>{(!e||"ArrowUp"!==e.key&&"ArrowDown"!==e.key)&&n>=0&&(n=-1,o())},{passive:!0}));const i=e(".frame");let r=null;const l=s=>{if(s&&(t.style.transition="opacity 0.5s cubic-bezier(0.33, 0, 0.2, 1)",clearTimeout(r),r=setTimeout(()=>{t.style.transition="none"},560)),e("#pipBack").classList.contains("open")||e("#csBack").classList.contains("open"))return t.style.opacity="0",void(t.style.pointerEvents="none");const n=document.querySelector("#groupHost.perfopen .stage.open");if(n){const e=n.getBoundingClientRect();if(e.bottom>.25*innerHeight&&e.top<.75*innerHeight)return t.style.opacity="0",void(t.style.pointerEvents="none")}let a=1;if(i){const e=innerHeight/2-(t.offsetHeight||156)/2-8-i.getBoundingClientRect().bottom;a=Math.max(0,Math.min(1,e/150))}a=Math.min(a,Math.max(0,Math.min(1,(scrollY-24)/150))),t.style.opacity=a.toFixed(3),t.style.pointerEvents=a>.05?"auto":"none"};addEventListener("keydown",t=>{if("ArrowUp"!==t.key&&"ArrowDown"!==t.key)return;if(t.repeat)return;if(e("#pipBack").classList.contains("open")||e("#csBack").classList.contains("open")||document.querySelector("#groupHost.perfopen"))return;const n=s.findIndex(([,e])=>e.classList.contains("on"));if(n<0)return;t.preventDefault();const a=Math.max(0,Math.min(s.length-1,n+("ArrowDown"===t.key?1:-1)));a!==n&&s[a][1].dispatchEvent(new Event("pointerdown"))}),addEventListener("scroll",()=>l(!1),{passive:!0}),addEventListener("resize",()=>l(!1)),window.MSRAIL=()=>l(!0),l(!1),addEventListener("scroll",o,{passive:!0}),o()}()},heroGo:E}}();