1import{i as P}from"./Dj0nR8io.js";import{a as F,p as D,s as T,i as k,e as C,f as $,c as R}from"./BYSH8RlV.js";import{a as H,l as M}from"./CSlSn3wR.js";import{n as A}from"./CnW4SyHR.js";function I(s=".solution-view"){if(!F())return null;const i=document.querySelector(`${s} .cursor`),e=document.querySelectorAll(`${s} .view_hover`);if(!i||!e.length)return null;const o=i.getAttribute("data-speed"),w=o===null?.9:Number(o)/10,c={x:window.innerWidth/2,y:window.innerHeight/2},n={...c};let t=0;i.style.transform=`translate3d(${c.x}px, ${c.y}px, 0) translate(-50%, -50%)`;const r=a=>{n.x=a.clientX,n.y=a.clientY},d=()=>i.classList.add("on"),f=()=>i.classList.remove("on"),l=()=>{const a=window.gsap?1-Math.pow(w,window.gsap.ticker.deltaRatio()):.18;c.x+=(n.x-c.x)*a,c.y+=(n.y-c.y)*a,i.style.transform=`translate3d(${c.x}px, ${c.y}px, 0) translate(-50%, -50%)`,t=requestAnimationFrame(l)};return document.body.addEventListener("mousemove",r),e.forEach(a=>{a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f)}),t=requestAnimationFrame(l),()=>{document.body.removeEventListener("mousemove",r),e.forEach(a=>{a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f)}),cancelAnimationFrame(t),i.classList.remove("on")}}function X(s,i,e=50){return new Promise(o=>{const w=c=>{const n=s?.querySelector(i);if(n||c<=0){o(n);return}window.requestAnimationFrame(()=>w(c-1))};w(e)})}async function B(s,i,e){const o=await X(s,i);if(!o)return;o.querySelectorAll("[data-intro-reveal-clone]").forEach(n=>n.remove());const w=o.getBoundingClientRect();if(D()||!("IntersectionObserver"in window)||w.top<window.innerHeight&&w.bottom>0){o.classList.add("on");return}const c=new IntersectionObserver(n=>{n.some(t=>t.isIntersecting)&&(o.classList.add("on"),c.disconnect())},{rootMargin:"0px 0px -10% 0px",threshold:.05});c.observe(o),e.push(()=>c.disconnect())}function O(){const s=document.querySelector(".solution-view .section6"),i=s?.querySelector(".fix .content .r .y"),e=s?Array.from(s.querySelectorAll(".fix .content .r .item")).filter(m=>m.textContent?.trim()):[];if(!s||!i||!e.length)return null;const o=e.length,w=500;let c=document.documentElement.clientHeight,n=c+w*o,t=s.getBoundingClientRect().top+(window.scrollY||0);const r=()=>{const m=parseInt(window.getComputedStyle(e[0]).marginBottom,10)||0,p=[0];let h=0;for(let g=0;g<e.length-1;g+=1)h+=e[g].clientHeight+m,p.push(h);return p};let d=r();const f=()=>{c=document.documentElement.clientHeight,n=c+w*o,s.style.height=`${n+500}px`,t=s.getBoundingClientRect().top+(window.scrollY||0),d=r()},l=m=>{e.forEach((p,h)=>{p.classList.toggle("is-active",h===m)})},a=m=>{const p=t+n-c;if(m>=t&&m<=p){const h=Math.max(0,Math.min(o-1,Math.round((m-t)/(n/o)))),g=d[h]||0;l(h),window.gsap?window.gsap.to(i,{y:-g,duration:.5}):i.style.transform=`translate3d(0, ${-g}px, 0)`;return}if(m>p){l(o-1);const h=d[o-1]||0;window.gsap?window.gsap.to(i,{y:-h,duration:.5}):i.style.transform=`translate3d(0, ${-h}px, 0)`;return}l(-1)},u=m=>{const p=m?.actualScroll??m?.scroll??window.scrollY??0;a(p)};return f(),window.lenis?.on&&window.lenis.on("scroll",u),window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",f),window.addEventListener("resize",u),u(),()=>{window.lenis?.off&&window.lenis.off("scroll",u),window.removeEventListener("scroll",u),window.removeEventListener("resize",f),window.removeEventListener("resize",u),s.style.height="",window.gsap?window.gsap.set(i,{clearProps:"transform"}):i.style.transform=""}}function z(s,i,e={}){const o=s.querySelector(".section3"),w=o?.querySelector(".fix .content .r .y"),c=o?.querySelector(".fix .content .l .by"),n=o?Array.from(o.querySelectorAll(".fix .content .r .item")):[];if(!o||!w||!n.length||window.innerWidth<=768)return;const t=e.distance??200,r=e.extraHeight??120;let d=window.innerHeight,f=0,l=0,a=0;const u=()=>{if(n.length<=1)return 0;const E=parseFloat(window.getComputedStyle(n[0]).marginBottom)||0;let v=0;for(let S=0;S<n.length-1;S+=1)v+=n[S].clientHeight+E;return v},m=()=>{d=window.innerHeight;const E=u(),v=t*Math.max(0,n.length-1),S=Math.max(E,v);f=d+S,o.style.height=`${f+r}px`;const L=window.getComputedStyle(n[0]);l=parseFloat(L.marginBottom||"0")+n[0].clientHeight},p=()=>{const E=o.offsetTop,v=f-d,S=E+v,L=window.scrollY||document.documentElement.scrollTop||0;if(L>=E&&L<=S){const q=L-E,x=n.length>1?Math.min(n.length-1,Math.round(q/v*(n.length-1))):0,b=Math.min(x,n.length-1)*l;window.gsap?window.gsap.to(w,{y:-b,duration:.5}):w.style.transform=`translate3d(0, ${-b}px, 0)`,e.toggleBy&&c?.classList.toggle("on",x===1)}},h=()=>{window.cancelAnimationFrame(a),a=window.requestAnimationFrame(p)},g=()=>{m(),h()};m(),p(),window.addEventListener("scroll",h,{passive:!0}),window.addEventListener("resize",g),i.push(()=>{window.cancelAnimationFrame(a),window.removeEventListener("scroll",h),window.removeEventListener("resize",g),o.style.height="",w.style.transform="",c?.classList.remove("on")})}async function W(s){await A(),await new Promise(e=>window.requestAnimationFrame(e)),await new Promise(e=>window.requestAnimationFrame(e)),window.location.hash&&document.querySelector(window.location.hash)||(window.scrollTo({top:0,left:0,behavior:"instant"}),document.documentElement.scrollTop=0,document.body.scrollTop=0),window.dispatchEvent(new Event("scroll")),$()&&window.ScrollTrigger?.refresh?.(),C(s),window.dispatchEvent(new Event("resize"))}function V(){const s=document.querySelectorAll(".solution-view .section5 .content .list"),i=[];
1return s.forEach(e=>{const o=()=>{const w=e.querySelector(".p2");w&&(window.jQuery?window.jQuery(w).stop().slideDown():w.style.display="block")};e.addEventListener("click",o),i.push(()=>e.removeEventListener("click",o))}),i.length?()=>i.forEach(e=>e()):null}function Y(s,i){const e=s.querySelector(".platform-cards-viewport"),o=s.querySelector(".platform-cards-track"),w=o?.querySelector(".platform-cards-inner");if(!e||!o||!w||!w.children.length)return;o.querySelectorAll(".platform-cards-inner-clone").forEach(y=>{y.remove()});const c=w.cloneNode(!0);c.classList.add("platform-cards-inner-clone"),o.appendChild(c);let n=0,t=0,r=!1,d=0,f=0,l=0,a=0;const u=()=>o.scrollWidth/2||0,m=()=>{o.style.transform=`translate3d(${n}px, 0, 0)`},p=()=>{if(l=l||u(),!!l){for(;n>0;)n-=l;for(;n<-l;)n+=l}},h=()=>{r||(l=l||u(),n-=.4,p(),m()),t=window.requestAnimationFrame(h)},g=y=>{r=!0,d=y,f=n},E=y=>{r&&(l=l||u(),n=f+y-d,p(),m())},v=()=>{r&&(r=!1,l=u(),p(),m())},S=y=>{y.button===0&&g(y.clientX)},L=y=>E(y.clientX),q=y=>g(y.touches[0].clientX),x=y=>E(y.touches[0].clientX),b=()=>{l=u(),p(),m()};e.addEventListener("mousedown",S),e.addEventListener("mousemove",L),e.addEventListener("mouseup",v),e.addEventListener("mouseleave",v),e.addEventListener("touchstart",q,{passive:!0}),e.addEventListener("touchmove",x,{passive:!0}),e.addEventListener("touchend",v),e.addEventListener("touchcancel",v),window.addEventListener("resize",b),l=u(),t=window.requestAnimationFrame(h),i.push(()=>{window.cancelAnimationFrame(t),window.clearTimeout(a),e.removeEventListener("mousedown",S),e.removeEventListener("mousemove",L),e.removeEventListener("mouseup",v),e.removeEventListener("mouseleave",v),e.removeEventListener("touchstart",q),e.removeEventListener("touchmove",x),e.removeEventListener("touchend",v),e.removeEventListener("touchcancel",v),window.removeEventListener("resize",b)})}function Q(){let s=null,i=null,e=null;function o(t=""){t!=="solution"&&t!=="solution2"&&t!=="solution3"&&R(),t!=="solution"&&s&&(s(),s=null),t!=="solution2"&&i&&(i(),i=null),t!=="solution3"&&e&&(e(),e=null)}function w(){A(()=>{T(async()=>{await Promise.all([H().catch(()=>null),M().catch(()=>null)]),s&&(s(),s=null),document.body.childNodes.forEach(u=>{u.nodeType===Node.TEXT_NODE&&u.textContent?.trim()==="-->"&&(u.textContent="")});const t=document.querySelector(".solution-view");if(!t)return;await W(t);const r=[];await B(t,".section1 .bottom",r);const d=await k(t);d&&r.push(d);const f=P(".solution-view .section2 .figure [data-to], .solution-view .section3 .figure [data-to], .solution-view .common_case [data-to]",{resetOnLeave:!1});f&&r.push(f);const l=V();l&&r.push(l);const a=O();if(a&&r.push(a),F()){const u=I();u&&r.push(u)}s=()=>r.forEach(u=>u()),window.Swiper&&document.querySelector(".solution-view .caseSwiper")&&new window.Swiper(".solution-view .caseSwiper",{speed:1e3,slidesPerView:1,spaceBetween:20,pagination:{el:".solution-view .swiper-pagination",clickable:!0,type:"progressbar"},breakpoints:{768:{slidesPerView:3,spaceBetween:20}}}),await W(t)})})}function c(){A(()=>{T(async()=>{await Promise.all([H().catch(()=>null)]),i&&(i(),i=null);const t=document.querySelector(".solution2-view");if(!t)return;const r=[];await B(t,".section1 .bottom",r);const d=await k(t);d&&r.push(d),Y(t,r),z(t,r,{distance:200,extraHeight:120}),i=()=>r.forEach(f=>f())})})}function n(){A(()=>{T(async()=>{await Promise.all([H().catch(()=>null),M().catch(()=>null)]),e&&(e(),e=null);const t=document.querySelector(".solution3-view");if(!t)return;const r=(a,u=80)=>new Promise(m=>{const p=h=>{const g=t.querySelector(a);if(g||h<=0){m(g);return}window.requestAnimationFrame(()=>p(h-1))};p(u)});await r(".section1 .bottom"),await r(".section3 .fix");const d=[];await B(t,".section1 .bottom",d);const f=await k(t);if(f&&d.push(f),C(t),z(t,d,{distance:200,extraHeight:120,toggleBy:!0}),$()?(window.ScrollTrigger?.refresh?.(),window.setTimeout(()=>{C(t),window.ScrollTrigger?.refresh?.()},200)):window.setTimeout(()=>C(t),200),F()){const a=I(".solution3-view");a&&d.push(a)}const l=P(".solution3-view .common_case [data-to]");l&&d.push(l),window.Swiper&&t.querySelector(".brand-s .swiper1")&&new window.Swiper(".solution3-view .brand-s .swiper1",{speed:1e3,slidesPerView:1,loop:!1,spaceBetween:"2%",breakpoints:{320:{spaceBetween:20},768:{slidesPerView:4}},pagination:{el:".solution3-view .brand-s .swiper-pagination",clickable:!0,type:"progressbar"}}),window.Swiper&&t.querySelector(".caseSwiper")&&new window.Swiper(".solution3-view .caseSwiper",{speed:1e3,slidesPerView:1,spaceBetween:20,pagination:{el:".solution3-view .common_case .swiper-pagination",clickable:!0,type:"progressbar"},breakpoints:{768:{slidesPerView:3,spaceBetween:20}}}),e=()=>
1d.forEach(a=>a())})})}return{cleanupSolutionEffects:o,initSolutionEffects:w,initSolution2Effects:c,initSolution3Effects:n}}export{Q as useSolutionEffects};
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.