101 lines
38 KiB
JavaScript
101 lines
38 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41626,e=>{"use strict";let t;var r,n,i,s,o,a,l,c,u,d,p,f,m,h,g,v,y,x,w,b,_,j,M,S,R,k=e.i(43476),N=e.i(71645),V=e.i(75056),A=e.i(25234),P=e.i(43257),C=e.i(8560),T=e.i(28600);function I(e,t,r){t.traverse(t=>{t.material&&(e.properties.remove(t.material),null==t.material.dispose||t.material.dispose())}),e.info.programs.length=0,e.compile(t,r)}function F({focus:e=0,samples:t=10,size:r=25}){let n=(0,T.useThree)(e=>e.gl),i=(0,T.useThree)(e=>e.scene),s=(0,T.useThree)(e=>e.camera);return N.useEffect(()=>{let o=C.ShaderChunk.shadowmap_pars_fragment;return C.ShaderChunk.shadowmap_pars_fragment=C.ShaderChunk.shadowmap_pars_fragment.replace("#ifdef USE_SHADOWMAP","#ifdef USE_SHADOWMAP\n"+(({focus:e=0,size:t=25,samples:r=10}={})=>`
|
|
#define PENUMBRA_FILTER_SIZE float(${t})
|
|
#define RGB_NOISE_FUNCTION(uv) (randRGB(uv))
|
|
vec3 randRGB(vec2 uv) {
|
|
return vec3(
|
|
fract(sin(dot(uv, vec2(12.75613, 38.12123))) * 13234.76575),
|
|
fract(sin(dot(uv, vec2(19.45531, 58.46547))) * 43678.23431),
|
|
fract(sin(dot(uv, vec2(23.67817, 78.23121))) * 93567.23423)
|
|
);
|
|
}
|
|
|
|
vec3 lowPassRandRGB(vec2 uv) {
|
|
// 3x3 convolution (average)
|
|
// can be implemented as separable with an extra buffer for a total of 6 samples instead of 9
|
|
vec3 result = vec3(0);
|
|
result += RGB_NOISE_FUNCTION(uv + vec2(-1.0, -1.0));
|
|
result += RGB_NOISE_FUNCTION(uv + vec2(-1.0, 0.0));
|
|
result += RGB_NOISE_FUNCTION(uv + vec2(-1.0, +1.0));
|
|
result += RGB_NOISE_FUNCTION(uv + vec2( 0.0, -1.0));
|
|
result += RGB_NOISE_FUNCTION(uv + vec2( 0.0, 0.0));
|
|
result += RGB_NOISE_FUNCTION(uv + vec2( 0.0, +1.0));
|
|
result += RGB_NOISE_FUNCTION(uv + vec2(+1.0, -1.0));
|
|
result += RGB_NOISE_FUNCTION(uv + vec2(+1.0, 0.0));
|
|
result += RGB_NOISE_FUNCTION(uv + vec2(+1.0, +1.0));
|
|
result *= 0.111111111; // 1.0 / 9.0
|
|
return result;
|
|
}
|
|
vec3 highPassRandRGB(vec2 uv) {
|
|
// by subtracting the low-pass signal from the original signal, we're being left with the high-pass signal
|
|
// hp(x) = x - lp(x)
|
|
return RGB_NOISE_FUNCTION(uv) - lowPassRandRGB(uv) + 0.5;
|
|
}
|
|
|
|
|
|
vec2 vogelDiskSample(int sampleIndex, int sampleCount, float angle) {
|
|
const float goldenAngle = 2.399963f; // radians
|
|
float r = sqrt(float(sampleIndex) + 0.5f) / sqrt(float(sampleCount));
|
|
float theta = float(sampleIndex) * goldenAngle + angle;
|
|
float sine = sin(theta);
|
|
float cosine = cos(theta);
|
|
return vec2(cosine, sine) * r;
|
|
}
|
|
float penumbraSize( const in float zReceiver, const in float zBlocker ) { // Parallel plane estimation
|
|
return (zReceiver - zBlocker) / zBlocker;
|
|
}
|
|
float findBlocker(sampler2D shadowMap, vec2 uv, float compare, float angle) {
|
|
float texelSize = 1.0 / float(textureSize(shadowMap, 0).x);
|
|
float blockerDepthSum = float(${e});
|
|
float blockers = 0.0;
|
|
|
|
int j = 0;
|
|
vec2 offset = vec2(0.);
|
|
float depth = 0.;
|
|
|
|
#pragma unroll_loop_start
|
|
for(int i = 0; i < ${r}; i ++) {
|
|
offset = (vogelDiskSample(j, ${r}, angle) * texelSize) * 2.0 * PENUMBRA_FILTER_SIZE;
|
|
depth = unpackRGBAToDepth( texture2D( shadowMap, uv + offset));
|
|
if (depth < compare) {
|
|
blockerDepthSum += depth;
|
|
blockers++;
|
|
}
|
|
j++;
|
|
}
|
|
#pragma unroll_loop_end
|
|
|
|
if (blockers > 0.0) {
|
|
return blockerDepthSum / blockers;
|
|
}
|
|
return -1.0;
|
|
}
|
|
|
|
|
|
float vogelFilter(sampler2D shadowMap, vec2 uv, float zReceiver, float filterRadius, float angle) {
|
|
float texelSize = 1.0 / float(textureSize(shadowMap, 0).x);
|
|
float shadow = 0.0f;
|
|
int j = 0;
|
|
vec2 vogelSample = vec2(0.0);
|
|
vec2 offset = vec2(0.0);
|
|
#pragma unroll_loop_start
|
|
for (int i = 0; i < ${r}; i++) {
|
|
vogelSample = vogelDiskSample(j, ${r}, angle) * texelSize;
|
|
offset = vogelSample * (1.0 + filterRadius * float(${t}));
|
|
shadow += step( zReceiver, unpackRGBAToDepth( texture2D( shadowMap, uv + offset ) ) );
|
|
j++;
|
|
}
|
|
#pragma unroll_loop_end
|
|
return shadow * 1.0 / ${r}.0;
|
|
}
|
|
|
|
float PCSS (sampler2D shadowMap, vec4 coords) {
|
|
vec2 uv = coords.xy;
|
|
float zReceiver = coords.z; // Assumed to be eye-space z in this code
|
|
float angle = highPassRandRGB(gl_FragCoord.xy).r * PI2;
|
|
float avgBlockerDepth = findBlocker(shadowMap, uv, zReceiver, angle);
|
|
if (avgBlockerDepth == -1.0) {
|
|
return 1.0;
|
|
}
|
|
float penumbraRatio = penumbraSize(zReceiver, avgBlockerDepth);
|
|
return vogelFilter(shadowMap, uv, zReceiver, 1.25 * penumbraRatio, angle);
|
|
}`)({size:r,samples:t,focus:e})).replace("#if defined( SHADOWMAP_TYPE_PCF )","\nreturn PCSS(shadowMap, shadowCoord);\n#if defined( SHADOWMAP_TYPE_PCF )"),I(n,i,s),()=>{C.ShaderChunk.shadowmap_pars_fragment=o,I(n,i,s)}},[e,r,t]),null}var E=e.i(90072);e.i(47167);var z=e.i(78140);let O="/models/3d_scene_final.glb",B="/draco/",L=[/WheelStock_FR_RB1c_Tire_1k_0$/i,/WheelStock_FR_RB1c_Tire_1k_0\.001$/i,/WheelStock_RL_RB1c_Tire/i,/WheelStock_RR_RB1c_Tire/i],D=/^LCT300007/i,W=/road|floor|slab|driveway|apron|grass|ground|pad|curb/i,G=/asphalt|concrete|lane|apron|curb|pavement|tarmac|grass/i,q=/tree|foliage|atlas|bush|hedge|shrub/i,U=/tree|leaf|leaves|bark|foliage|shrub|grass/i,$=/carton|cube|crate|package_box|barrel|pallet|bench/i,H=/cardboard|pallet/i,Z=/street_light|streetlight|lamp/i,Q=/street_light/i,Y=/atlas|background_tree/i,K=/background_tree_atlas/i;function J({truckRef:e,wheelRefs:t,tier:r="desktop",...n}){let{scene:i}=(0,z.useGLTF)(O,B);return(0,N.useLayoutEffect)(()=>{let n=[null,null,null,null],s=null;if(i.traverse(e=>{if(!e.isMesh)return;let t=e.name||"";/WheelStock_(FR|RL|RR)_RB1c_Tire/i.test(t)&&(s=e,L.forEach((r,i)=>{!n[i]&&r.test(t)&&(n[i]=e)}))}),n.forEach((e,r)=>{let n=e?.parent?.parent??null;n&&t?.[r]&&(t[r].current=n)}),e){let t=s;for(;t&&t.parent&&t.parent!==i;)t=t.parent;e.current=t??null}i.traverse(e=>{if(!e.isMesh)return;let t=e.name||"",n=(Array.isArray(e.material)?e.material[0]?.name:e.material?.name)||"",i=D.test(t),s=W.test(t)||G.test(n);e.castShadow=i,e.receiveShadow=i||s,i&&(e.frustumCulled=!1);let o=!1;"mobile"===r?o=q.test(t)||U.test(n)||$.test(t)||H.test(n)||Z.test(t)||Q.test(n):"tablet"===r&&(o=Y.test(t)||K.test(n)),e.visible=!o})},[i,e,t,r]),(0,k.jsx)("primitive",{object:i,...n,dispose:null})}z.useGLTF.preload(O,B);var X=e.i(8155);let ee=e=>{let t=(0,X.createStore)(e),r=e=>(function(e,t=e=>e){let r=N.default.useSyncExternalStore(e.subscribe,N.default.useCallback(()=>t(e.getState()),[e,t]),N.default.useCallback(()=>t(e.getInitialState()),[e,t]));return N.default.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},et=(t=e=>({scrollProgress:0,activeSection:0,truckProgress:0,cameraTarget:[19.727,4.397,-31.08],lenis:null,setScrollProgress:t=>e({scrollProgress:t}),setActiveSection:t=>e({activeSection:t}),setTruckProgress:t=>e({truckProgress:t}),setCameraTarget:t=>e({cameraTarget:t}),setLenis:t=>e({lenis:t})}))?ee(t):ee,er=[new E.Vector3(15.5,.45,-26.5),new E.Vector3(13.399,.324,-24.742),new E.Vector3(11.211,.178,-22.973),new E.Vector3(8.823,.111,-20.949),new E.Vector3(6.447,.059,-19.06),new E.Vector3(3.786,.072,-17.002),new E.Vector3(.732,.124,-14.955),new E.Vector3(-2.156,.124,-12.903),new E.Vector3(-4.417,.124,-10.929),new E.Vector3(-5.896,.124,-8.052),new E.Vector3(-5.985,.124,-5.497),new E.Vector3(-4.362,.124,-3.25),new E.Vector3(-1.448,.124,-1.234),new E.Vector3(2.539,.124,.986),new E.Vector3(6.686,.124,3.379),new E.Vector3(8.213,.124,6.14),new E.Vector3(7.976,.124,9.176),new E.Vector3(6.424,.124,12.428),new E.Vector3(3.883,.124,15.769),new E.Vector3(1.241,.124,19.056)],en=new E.CatmullRomCurve3(er);function ei(e){return e<.14?0:e<.38?.5*(e-.14)/.24:e<.5?.5:e<.76?.5+.5*(e-.5)/.26:1}let es={firstMileWhole:{position:new E.Vector3(38,15,-10),target:new E.Vector3(24.377,4,-39.303)},firstMileFront:{position:new E.Vector3(7,3,-19),target:new E.Vector3(15.5,1.5,-26.5)},midMile:{position:new E.Vector3(-7,7.5,8),target:new E.Vector3(-19.146,2.5,-9)},lastMileClose:{position:new E.Vector3(-3.5,4,15),target:new E.Vector3(8,2,20)},lastMileZoomedOut:{position:new E.Vector3(-10.4,5.2,12),target:new E.Vector3(8,2,20)},analytics:{position:new E.Vector3(-13.5,5,31),target:new E.Vector3(-7.7,3.5,25.4)}},eo=new E.Vector3,ea=new E.Vector3,el=new E.Vector3(0,1,0),ec=new E.Vector3,eu=new E.Vector3,ed=new E.Vector3,ep=e=>e*e*(3-2*e);function ef(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function em(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eh(e,t){if(e){if("string"==typeof e)return em(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return em(e,t)}}function eg(e){return function(e){if(Array.isArray(e))return em(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||eh(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}new E.Vector2,new E.Vector2;function ev(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var ey=function e(t,r,n){var i=this;ev(this,e),ef(this,"dot2",function(e,t){return i.x*e+i.y*t}),ef(this,"dot3",function(e,t,r){return i.x*e+i.y*t+i.z*r}),this.x=t,this.y=r,this.z=n},ex=[new ey(1,1,0),new ey(-1,1,0),new ey(1,-1,0),new ey(-1,-1,0),new ey(1,0,1),new ey(-1,0,1),new ey(1,0,-1),new ey(-1,0,-1),new ey(0,1,1),new ey(0,-1,1),new ey(0,1,-1),new ey(0,-1,-1)],ew=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],eb=Array(512),e_=Array(512),ej=0;(ej=Math.floor(ej))<256&&(ej|=ej<<8);for(var eM,eS=0;eS<256;eS++)eM=1&eS?ew[eS]^255&ej:ew[eS]^ej>>8&255,eb[eS]=eb[eS+256]=eM,e_[eS]=e_[eS+256]=ex[eM%12];function eR(e){var t=function(e){if("number"==typeof e)e=Math.abs(e);else if("string"==typeof e){var t=e;e=0;for(var r=0;r<t.length;r++)e=(e+(r+1)*(t.charCodeAt(r)%96))%0x7fffffff}return 0===e&&(e=311),e}(e);return function(){var e=48271*t%0x7fffffff;return t=e,e/0x7fffffff}}new function e(t){var r=this;ev(this,e),ef(this,"seed",0),ef(this,"init",function(e){r.seed=e,r.value=eR(e)}),ef(this,"value",eR(this.seed)),this.init(t)}(Math.random());var ek=function(e){return 1/(1+e+.48*e*e+.235*e*e*e)};function eN(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.25,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.01,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:ek,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:.001,l="velocity_"+t;if(void 0===e.__damp&&(e.__damp={}),void 0===e.__damp[l]&&(e.__damp[l]=0),Math.abs(e[t]-r)<=a)return e[t]=r,!1;var c=2/(n=Math.max(1e-4,n)),u=o(c*i),d=e[t]-r,p=r,f=s*n;d=Math.min(Math.max(d,-f),f),r=e[t]-d;var m=(e.__damp[l]+c*d)*i;e.__damp[l]=(e.__damp[l]-c*m)*u;var h=r+(d+m)*u;return p-e[t]>0==h>p&&(h=p,e.__damp[l]=(h-p)/i),e[t]=h,!0}var eV=new E.Vector3,eA=new E.Quaternion,eP=new E.Quaternion,eC=new E.Matrix4,eT=new E.Vector3;function eI(e,t,r,n,i,s,o,a){var l,c,u,d;return eN(e,t,e[t]+(u=(l=r-e[t])-Math.floor(l/(c=2*Math.PI))*c,(d=Math.max(0,Math.min(c,u)))>Math.PI&&(d-=2*Math.PI),d),n,i,s,o,a)}var eF=new E.Vector2,eE=new E.Vector3;function ez(e,t,r,n,a,l,c){return"number"==typeof t?eE.setScalar(t):Array.isArray(t)?eE.set(t[0],t[1],t[2]):eE.copy(t),i=eN(e,"x",eE.x,r,n,a,l,c),s=eN(e,"y",eE.y,r,n,a,l,c),o=eN(e,"z",eE.z,r,n,a,l,c),i||s||o}var eO=new E.Vector4,eB=new E.Euler,eL=new E.Color,eD=new E.Quaternion,eW=new E.Vector4,eG=new E.Vector4,eq=new E.Vector4;function eU(e,t,r,n,i,s,o){Array.isArray(t)?eD.set(t[0],t[1],t[2],t[3]):eD.copy(t);var a=e.dot(eD)>0?1:-1;return eD.x*=a,eD.y*=a,eD.z*=a,eD.w*=a,v=eN(e,"x",eD.x,r,n,i,s,o),y=eN(e,"y",eD.y,r,n,i,s,o),x=eN(e,"z",eD.z,r,n,i,s,o),w=eN(e,"w",eD.w,r,n,i,s,o),eW.set(e.x,e.y,e.z,e.w).normalize(),eG.set(e.__damp.velocity_x,e.__damp.velocity_y,e.__damp.velocity_z,e.__damp.velocity_w),eq.copy(eW).multiplyScalar(eG.dot(eW)/eW.dot(eW)),e.__damp.velocity_x-=eq.x,e.__damp.velocity_y-=eq.y,e.__damp.velocity_z-=eq.z,e.__damp.velocity_w-=eq.w,e.set(eW.x,eW.y,eW.z,eW.w),v||y||x||w}var e$=new E.Spherical,eH=new E.Matrix4,eZ=new E.Vector3,eQ=new E.Quaternion,eY=new E.Vector3,eK=Object.freeze({__proto__:null,rsqw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.01,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/(2*Math.PI);return r/Math.atan(1/t)*Math.atan(Math.sin(2*Math.PI*e*n)/t)},exp:ek,linear:function(e){return e},sine:{in:function(e){return 1-Math.cos(e*Math.PI/2)},out:function(e){return Math.sin(e*Math.PI/2)},inOut:function(e){return-(Math.cos(Math.PI*e)-1)/2}},cubic:{in:function(e){return e*e*e},out:function(e){return 1-Math.pow(1-e,3)},inOut:function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}},quint:{in:function(e){return e*e*e*e*e},out:function(e){return 1-Math.pow(1-e,5)},inOut:function(e){return e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2}},circ:{in:function(e){return 1-Math.sqrt(1-Math.pow(e,2))},out:function(e){return Math.sqrt(1-Math.pow(e-1,2))},inOut:function(e){return e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2}},quart:{in:function(e){return e*e*e*e},out:function(e){return 1- --e*e*e*e},inOut:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e}},expo:{in:function(e){return 0===e?0:Math.pow(2,10*e-10)},out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},inOut:function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2}},damp:eN,dampLookAt:function(e,t,r,n,i,s,o){"number"==typeof t?eV.setScalar(t):Array.isArray(t)?eV.set(t[0],t[1],t[2]):eV.copy(t);var a=e.parent;(e.updateWorldMatrix(!0,!1),eT.setFromMatrixPosition(e.matrixWorld),e&&e.isCamera||e&&e.isLight)?eC.lookAt(eT,eV,e.up):eC.lookAt(eV,eT,e.up),eU(e.quaternion,eP.setFromRotationMatrix(eC),r,n,i,s,o),a&&(eC.extractRotation(a.matrixWorld),eA.setFromRotationMatrix(eC),eU(e.quaternion,eP.copy(e.quaternion).premultiply(eA.invert()),r,n,i,s,o))},dampAngle:eI,damp2:function(e,t,i,s,o,a,l){return"number"==typeof t?eF.setScalar(t):Array.isArray(t)?eF.set(t[0],t[1]):eF.copy(t),r=eN(e,"x",eF.x,i,s,o,a,l),n=eN(e,"y",eF.y,i,s,o,a,l),r||n},damp3:ez,damp4:function(e,t,r,n,i,s,o){return"number"==typeof t?eO.setScalar(t):Array.isArray(t)?eO.set(t[0],t[1],t[2],t[3]):eO.copy(t),a=eN(e,"x",eO.x,r,n,i,s,o),l=eN(e,"y",eO.y,r,n,i,s,o),c=eN(e,"z",eO.z,r,n,i,s,o),u=eN(e,"w",eO.w,r,n,i,s,o),a||l||c||u},dampE:function(e,t,r,n,i,s,o){return Array.isArray(t)?eB.set(t[0],t[1],t[2],t[3]):eB.copy(t),d=eI(e,"x",eB.x,r,n,i,s,o),p=eI(e,"y",eB.y,r,n,i,s,o),f=eI(e,"z",eB.z,r,n,i,s,o),d||p||f},dampC:function(e,t,r,n,i,s,o){return t instanceof E.Color?eL.copy(t):Array.isArray(t)?eL.setRGB(t[0],t[1],t[2]):eL.set(t),m=eN(e,"r",eL.r,r,n,i,s,o),h=eN(e,"g",eL.g,r,n,i,s,o),g=eN(e,"b",eL.b,r,n,i,s,o),m||h||g},dampQ:eU,dampS:function(e,t,r,n,i,s,o){return Array.isArray(t)?e$.set(t[0],t[1],t[2]):e$.copy(t),b=eN(e,"radius",e$.radius,r,n,i,s,o),_=eI(e,"phi",e$.phi,r,n,i,s,o),j=eI(e,"theta",e$.theta,r,n,i,s,o),b||_||j},dampM:function(e,t,r,n,i,s,o){return void 0===e.__damp&&(e.__damp={position:new E.Vector3,rotation:new E.Quaternion,scale:new E.Vector3},e.decompose(e.__damp.position,e.__damp.rotation,e.__damp.scale)),Array.isArray(t)?eH.set.apply(eH,eg(t)):eH.copy(t),eH.decompose(eZ,eQ,eY),M=ez(e.__damp.position,eZ,r,n,i,s,o),S=eU(e.__damp.rotation,eQ,r,n,i,s,o),R=ez(e.__damp.scale,eY,r,n,i,s,o),e.compose(e.__damp.position,e.__damp.rotation,e.__damp.scale),M||S||R}});function eJ(){let e=(0,N.useRef)(new E.Vector3(19.7,4.4,-31.08)),t=(0,N.useRef)(new E.Vector3).current,r=(0,N.useRef)(new E.Vector3).current;return(0,A.useFrame)((n,i)=>{let{camera:s}=n;!function(e,t,r){let n=ei(e);if(en.getPoint(n,eo),en.getTangent(n,ea).normalize(),ec.crossVectors(ea,el).normalize(),eu.copy(eo).addScaledVector(ea,7.2).addScaledVector(el,3.2).addScaledVector(ec,-3),ed.copy(eo).addScaledVector(ea,7.2).addScaledVector(el,3.2).addScaledVector(ec,3),e<.04)t.copy(es.firstMileWhole.position),r.copy(es.firstMileWhole.target);else if(e<.14){let n=ep((e-.04)/.1);t.lerpVectors(es.firstMileWhole.position,es.firstMileFront.position,n),r.lerpVectors(es.firstMileWhole.target,es.firstMileFront.target,n)}else if(e<.18){let n=ep((e-.14)/.04);t.lerpVectors(es.firstMileFront.position,eu,n),r.lerpVectors(es.firstMileFront.target,eo,n)}else if(e<.34)t.copy(eu),r.copy(eo);else if(e<.38){let n=ep((e-.34)/.04);t.lerpVectors(eu,es.midMile.position,n),r.lerpVectors(eo,es.midMile.target,n)}else if(e<.5)t.copy(es.midMile.position),r.copy(es.midMile.target);else if(e<.54){let n=ep((e-.5)/.04);t.lerpVectors(es.midMile.position,ed,n),r.lerpVectors(es.midMile.target,eo,n)}else if(e<.72)t.copy(ed),r.copy(eo);else if(e<.76){let n=ep((e-.72)/.04);t.lerpVectors(ed,es.lastMileClose.position,n),r.lerpVectors(eo,es.lastMileClose.target,n)}else if(e<.92)if(e<.8)t.copy(es.lastMileClose.position),r.copy(es.lastMileClose.target);else if(e<.84){let n=ep((e-.8)/.04);t.lerpVectors(es.lastMileClose.position,es.lastMileZoomedOut.position,n),r.lerpVectors(es.lastMileClose.target,es.lastMileZoomedOut.target,n)}else t.copy(es.lastMileZoomedOut.position),r.copy(es.lastMileZoomedOut.target);else if(e<.96){let n=ep((e-.92)/.04);t.lerpVectors(es.lastMileZoomedOut.position,es.analytics.position,n),r.lerpVectors(es.lastMileZoomedOut.target,es.analytics.target,n)}else t.copy(es.analytics.position),r.copy(es.analytics.target)}(et.getState().scrollProgress,t,r);let o=Number.isFinite(i)&&i>0?Math.min(i,.1):1/60;eK.damp3(s.position,t,.35,o),eK.damp3(e.current,r,.25,o),Number.isFinite(s.position.x)||s.position.copy(t),Number.isFinite(e.current.x)||e.current.copy(r),s.lookAt(e.current);let a=n.size.width/n.size.height,l=a<1?Math.min(75,45/Math.sqrt(a)):45;s.fov!==l&&(s.fov=l,s.updateProjectionMatrix())}),null}function eX({truckRef:e,wheelRefs:t}){let r=(0,N.useRef)(!1),n=(0,N.useRef)(0),i=(0,N.useRef)(0),s=(0,N.useRef)(!1),o=(0,N.useRef)(0),a=(0,N.useRef)(0),l=(0,N.useRef)(0);return(0,A.useFrame)((c,u)=>{var d;let p;if(!e.current)return;let f=Number.isFinite(u)&&u>0?Math.min(u,.1):1/60,m=et.getState().scrollProgress,h=ei(m),g=m-i.current;g<-1e-4?s.current=!0:g>1e-4&&(s.current=!1),i.current=m;let v=e.current.children[0];if(v&&e.current.children.length>1&&([...e.current.children].slice(1).forEach(e=>{v.attach(e)}),v.rotation.set(0,-Math.PI/2,0),e.current.traverse(e=>{e.isMesh&&(e.frustumCulled=!1,e.castShadow=!0,e.receiveShadow=!0)})),!r.current){let t;n.current=h,n.current_velocity=0,l.current=h,i.current=m,s.current=!1,o.current=0,o.current_velocity=0;let a=en.getPoint(n.current);if(n.current>=.99){let e=en.getTangent(1),r=en.getPoint(1);t=new E.Vector3().copy(r).addScaledVector(e,1)}else{let e=Math.min(n.current+.01,1);t=en.getPoint(e)}e.current.position.copy(a),e.current.position.distanceToSquared(t)>1e-4&&e.current.lookAt(t),r.current=!0}eK.damp(n,"current",h,.3,f),!Number.isFinite(n.current)&&(n.current=h,n.__damp&&(n.__damp={})),n.current=E.MathUtils.clamp(n.current,0,1);let y=en.getPoint(n.current);if(n.current>=.99){let e=en.getTangent(1),t=en.getPoint(1);p=new E.Vector3().copy(t).addScaledVector(e,1)}else{let e=Math.min(n.current+.01,1);p=en.getPoint(e)}e.current.position.copy(y),e.current.position.distanceToSquared(p)>1e-4&&e.current.lookAt(p);let x=0;n.current>.05&&n.current<.95&&s.current&&(x=Math.PI),eK.damp(o,"current",x,.2,f),!Number.isFinite(o.current)&&(o.current=x,o.current_velocity=0,o.__damp&&(o.__damp={})),e.current.rotateY(o.current);let w=Math.abs(n.current-l.current);l.current=n.current,n.current>.001&&n.current<.999&&(a.current+=250*w),d=a.current,t&&0!==t.length&&t.forEach((e,t)=>{e.current&&(e.current.rotation.y=d*(t%2==0?1:-1))}),e.current.children&&e.current.children[0]&&(e.current.children[0].position.y=.003*Math.sin(45*c.clock.getElapsedTime()))}),null}let e0=[{pos:[0,4.2,-4.56],target:[0,0,-4.56]},{pos:[9.113,4.2,.944],target:[9.113,0,.944]},{pos:[-10.158,4.2,-9.874],target:[-10.158,0,-9.874]},{pos:[3.513,4.2,9.195],target:[3.513,0,9.195]},{pos:[3.96,4.2,-21.17],target:[3.96,0,-21.17]},{pos:[12.25,4.2,-16.7],target:[12.25,0,-16.7]},{pos:[3.052,4.2,-12.335],target:[3.052,0,-12.335]},{pos:[-2.03,4.2,-16.89],target:[-2.03,0,-16.89]},{pos:[-27.151,3.98,-9],target:[-27.151,0,-9]}],e1=new E.Color("#333333"),e2=new E.Color("#ffdf6d"),e3=new E.Color("#000000"),e5=new E.Color("#ffdf6d");function e4({pos:e,targetPos:t}){let r=(0,N.useRef)(),n=(0,N.useRef)(),i=(0,N.useRef)();return(0,N.useEffect)(()=>{r.current&&n.current&&(r.current.target=n.current,r.current.target.updateMatrixWorld())},[]),(0,A.useFrame)(()=>{r.current&&(r.current.intensity=0),i.current&&(i.current.material.color.lerpColors(e1,e2,0),i.current.material.emissive.lerpColors(e3,e5,0))}),(0,k.jsxs)("group",{children:[(0,k.jsx)("spotLight",{ref:r,position:e,intensity:0,distance:12,angle:Math.PI/4.5,penumbra:.6,decay:1.2,color:"#ffdf6d",castShadow:!1}),(0,k.jsxs)("mesh",{ref:i,position:e,children:[(0,k.jsx)("sphereGeometry",{args:[.16,16,16]}),(0,k.jsx)("meshStandardMaterial",{color:"#333333",emissive:"#000000",emissiveIntensity:3.5,roughness:.1})]}),(0,k.jsx)("object3D",{ref:n,position:t})]})}let e9=N.default.memo(function(){return(0,k.jsx)("group",{children:e0.map((e,t)=>(0,k.jsx)(e4,{pos:e.pos,targetPos:e.target},t))})}),e6=new E.Color("#f5f5f7"),e7=new E.Color,e8=new E.Vector3,te={desktop:{shadows:!0,softShadows:!0,environment:!0,streetLights:!0,dpr:[1,1.5],antialias:!0,shadowMap:2048},tablet:{shadows:!0,softShadows:!1,environment:!0,streetLights:!1,dpr:[1,1.5],antialias:!1,shadowMap:1024},mobile:{shadows:!1,softShadows:!1,environment:!1,streetLights:!1,dpr:[1,1],antialias:!1,shadowMap:512}},tt=N.default.memo(function({truckRef:e,shadows:t,shadowMap:r}){let n=(0,N.useRef)(),i=(0,N.useRef)();return(0,N.useEffect)(()=>{n.current&&i.current&&(n.current.target=i.current)},[]),(0,A.useFrame)(t=>{n.current&&i.current&&e.current&&(e.current.getWorldPosition(e8),i.current.position.copy(e8),i.current.updateMatrixWorld(),n.current.position.set(e8.x+10,e8.y+20,e8.z+10)),t.scene&&(t.scene.background=e7.copy(e6),t.scene.environmentIntensity=1)}),(0,k.jsxs)("group",{children:[(0,k.jsx)("ambientLight",{intensity:.45}),(0,k.jsx)("directionalLight",{ref:n,castShadow:t,position:[10,20,10],intensity:1.5,"shadow-mapSize-width":r,"shadow-mapSize-height":r,"shadow-camera-far":100,"shadow-camera-left":-35,"shadow-camera-right":35,"shadow-camera-top":35,"shadow-camera-bottom":-35,"shadow-bias":-1e-4}),(0,k.jsx)("object3D",{ref:i})]})});function tr({onReady:e}){return(0,N.useEffect)(()=>{let t=0,r=0;return t=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>e?.())}),()=>{cancelAnimationFrame(t),cancelAnimationFrame(r)}},[e]),null}let tn=N.default.memo(function({dashboardRefs:e,wheelRefs:t,truckRef:r,tier:n="desktop",onReady:i}){let s=te[n]??te.desktop;return(0,k.jsx)("div",{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0},children:(0,k.jsxs)(V.Canvas,{shadows:s.shadows,dpr:s.dpr,camera:{position:[32,12,-18],fov:45},gl:{antialias:s.antialias,powerPreference:"high-performance"},children:[(0,k.jsx)("color",{attach:"background",args:["#f5f5f7"]}),s.softShadows&&(0,k.jsx)(F,{size:10,samples:12,focus:1}),(0,k.jsx)(tt,{truckRef:r,shadows:s.shadows,shadowMap:s.shadowMap}),s.streetLights&&(0,k.jsx)(e9,{}),s.environment?(0,k.jsx)(N.Suspense,{fallback:null,children:(0,k.jsx)(P.Environment,{preset:"city"})}):(0,k.jsx)("hemisphereLight",{args:["#ffffff","#9aa0a6",.9]}),(0,k.jsxs)(N.Suspense,{fallback:null,children:[(0,k.jsx)(J,{dashboardRefs:e,truckRef:r,wheelRefs:t,tier:n}),(0,k.jsx)(tr,{onReady:i})]}),(0,k.jsx)(eX,{truckRef:r,wheelRefs:t}),(0,k.jsx)(eJ,{})]})})});var ti=e.i(89970),ts=e.i(83495);let to=(e,t,r)=>Math.min(Math.max(e,t),r),ta=e=>{if("u"<typeof document)return 0;let t=document.getElementById("scroll-trigger-trigger");if(!t)return 0;let r=t.getBoundingClientRect().top+window.scrollY,n=t.offsetHeight-window.innerHeight;return r+to(e,0,1)*n},tl=(e,t)=>{e?e.scrollTo(t,{duration:1.5}):window.scrollTo({top:t,behavior:"smooth"})};ti.default.registerPlugin(ts.ScrollTrigger);let tc={desktop:600,tablet:550,mobile:500};function tu({dashboardRefs:e,onPinState:t,tier:r="desktop",ready:n=!1}){let i=et(e=>e.setScrollProgress),s=et(e=>e.setActiveSection),o=(0,N.useRef)(null),a=(0,N.useRef)(0),l=(0,N.useRef)("before"),c=(0,N.useRef)(null);return(0,N.useEffect)(()=>{let r=o.current;if(!r)return;let n=r=>{i(r);let n=r<=2e-4?"before":r>=.9998?"after":"pinned";n!==l.current&&(l.current=n,t?.(n));let o=0;if(r>=.92?o=3:r>=.5?o=2:r>=.12&&(o=1),o!==a.current&&(a.current=o,s(o)),e){var c,u,d;c=e.bars||[],u=e.pieQuarters||[],d=r>=.92?(r-.92)/.08:0,c.forEach((e,t)=>{if(e.current){let r=to((d-.08*t)/.5,0,1);e.current.scale.y=r}}),u.forEach((e,t)=>{e.current&&(e.current.rotation.y=-.709+d*Math.PI*2*(2+.5*t))})}},u=ts.ScrollTrigger.create({trigger:r,start:"top top",end:"bottom bottom",scrub:2.5,invalidateOnRefresh:!0,onUpdate:e=>n(e.progress),onRefresh:e=>n(e.progress)});c.current=u;let d=requestAnimationFrame(()=>ts.ScrollTrigger.refresh()),p=0,f=new ResizeObserver(()=>{cancelAnimationFrame(p),p=requestAnimationFrame(()=>ts.ScrollTrigger.refresh())});f.observe(document.documentElement);let m=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{m||ts.ScrollTrigger.refresh()}),()=>{cancelAnimationFrame(d),cancelAnimationFrame(p),f.disconnect(),m=!0,u.kill(),c.current=null}},[i,s,e,t]),(0,N.useEffect)(()=>{n&&ts.ScrollTrigger.refresh()},[n]),(0,k.jsx)("div",{ref:o,id:"scroll-trigger-trigger",style:{position:"relative",width:"100%",height:`${tc[r]??600}vh`,pointerEvents:"none",zIndex:0}})}function td(){let e=et(e=>e.activeSection),t=et(e=>e.lenis);return(0,k.jsx)("div",{className:"side-navigation",id:"main-navbar",children:[{label:"First Mile",index:0},{label:"Mid Mile",index:1},{label:"Last Mile",index:2},{label:"Analytics",index:3}].map(r=>(0,k.jsxs)("button",{onClick:()=>{tl(t,ta([0,.38,.76,.92][r.index]))},className:`side-nav-item ${e===r.index?"active":""}`,children:[(0,k.jsx)("span",{className:"side-nav-label",children:r.label}),(0,k.jsx)("span",{className:"side-nav-dot"})]},r.index))})}let tp=[{id:"first-mile",title:"First Mile Warehouse",subtitle:"Consolidation & Prep",description:"Incoming shipments are securely loaded, checked, and queued for transfer in our high-capacity fulfillment centers.",progressStart:0,progressEnd:.25},{id:"mid-mile",title:"Mid Mile Hub",subtitle:"Sorting & Direct Dispatch",description:"Consolidated goods travel between primary distribution nodes. Heavy logistics lanes sorting thousands of parcels per hour.",progressStart:.25,progressEnd:.5},{id:"last-mile",title:"Last Mile Delivery",subtitle:"Doorstep Courier Services",description:"Local courier fleets take over for the final leg — MileTruth™ AI sequences the fastest doorstep routes and keeps every package tracked through to a confirmed delivery.",progressStart:.5,progressEnd:.75},{id:"analytics",title:"Fulfillment Analytics",subtitle:"Real-Time Operational Insights",description:"A fully centralized dashboard monitoring transit times, fleet coordinates, carbon footprint, and delivery success rates.",progressStart:.75,progressEnd:1}];function tf({children:e,active:t,id:r,className:n=""}){let i=(0,N.useRef)(null);return(0,N.useEffect)(()=>{let e=i.current;if(!e)return;let n=e.querySelectorAll(".section-badge, .section-title, .section-subtitle, .section-description, .section-metrics, .section-supporting, .section-close-btn"),s="promise-section"===r;t?(ti.default.killTweensOf([e,n]),ti.default.to(e,{xPercent:s?-50:0,yPercent:s?-50:0,y:0,scale:1,opacity:1,duration:.85,ease:"power4.out"}),ti.default.fromTo(n,{y:15,opacity:0},{y:0,opacity:1,duration:.6,stagger:.08,ease:"power3.out",delay:.1})):(ti.default.killTweensOf([e,n]),ti.default.to(e,{xPercent:s?-50:0,yPercent:s?-50:0,y:s?18:20,scale:.96,opacity:0,duration:.5,ease:"power3.inOut"}),ti.default.to(n,{y:10,opacity:0,duration:.35,ease:"power2.in"}))},[t,r]),(0,k.jsx)("div",{ref:i,id:r,className:`section-panel ${t?"active":""} ${n}`,style:{opacity:0,transform:"promise-section"===r?"translate(-50%, -50%) translateY(18px) scale(0.96)":"translateY(20px) scale(0.96)"},children:e})}function tm({active:e}){let t=tp[0];return(0,k.jsxs)(tf,{active:e,id:"first-mile-section",children:[(0,k.jsx)("div",{className:"section-badge",children:"Stage 01"}),(0,k.jsx)("h2",{className:"section-title",children:t.title}),(0,k.jsx)("h3",{className:"section-subtitle",children:t.subtitle}),(0,k.jsx)("p",{className:"section-description",children:t.description}),(0,k.jsxs)("div",{className:"section-metrics",children:[(0,k.jsxs)("div",{className:"metric-item",children:[(0,k.jsx)("span",{className:"metric-value",children:"14,250"}),(0,k.jsx)("span",{className:"metric-label",children:"Parcels Processed"})]}),(0,k.jsxs)("div",{className:"metric-item",children:[(0,k.jsx)("span",{className:"metric-value",children:"99.98%"}),(0,k.jsx)("span",{className:"metric-label",children:"Sorting Accuracy"})]})]})]})}function th({active:e}){let t=tp[1],r=et(e=>e.lenis);return(0,k.jsxs)(tf,{active:e,id:"mid-mile-section",children:[(0,k.jsx)("div",{className:"section-badge",children:"Stage 02"}),(0,k.jsx)("h2",{className:"section-title",children:t.title}),(0,k.jsx)("h3",{className:"section-subtitle",children:t.subtitle}),(0,k.jsx)("p",{className:"section-description",children:t.description}),(0,k.jsxs)("div",{className:"section-metrics mm-info-strip",children:[(0,k.jsxs)("div",{className:"mm-info-row",children:[(0,k.jsx)("span",{className:"mm-info-icon","aria-hidden":"true",children:(0,k.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,k.jsx)("rect",{x:"1",y:"3",width:"15",height:"13"}),(0,k.jsx)("polygon",{points:"16 8 20 8 23 11 23 16 16 16 16 8"}),(0,k.jsx)("circle",{cx:"5.5",cy:"18.5",r:"2.5"}),(0,k.jsx)("circle",{cx:"18.5",cy:"18.5",r:"2.5"})]})}),(0,k.jsxs)("div",{className:"mm-info-content",children:[(0,k.jsx)("h4",{className:"mm-info-title",children:"Vehicles In Transit"}),(0,k.jsx)("p",{className:"mm-info-text",children:"A live view of active vehicles moving shipments between regional distribution hubs."})]})]}),(0,k.jsxs)("div",{className:"mm-info-row",children:[(0,k.jsx)("span",{className:"mm-info-icon","aria-hidden":"true",children:(0,k.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,k.jsx)("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.21"}),(0,k.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),(0,k.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),(0,k.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]})}),(0,k.jsxs)("div",{className:"mm-info-content",children:[(0,k.jsx)("h4",{className:"mm-info-title",children:"Packages In Transit"}),(0,k.jsx)("p",{className:"mm-info-text",children:"Real-time visibility into parcels currently moving through the mid-mile network."})]})]})]}),(0,k.jsxs)("button",{className:"section-close-btn",onClick:()=>{tl(r,ta(.575))},children:["Continue Journey",(0,k.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:"6px"},children:[(0,k.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,k.jsx)("polyline",{points:"12 5 19 12 12 19"})]})]})]})}function tg({active:e}){let t=tp[2],r=et(e=>e.lenis);return(0,k.jsxs)(tf,{active:e,id:"last-mile-section",children:[(0,k.jsx)("div",{className:"section-badge",children:"Stage 03"}),(0,k.jsx)("h2",{className:"section-title",children:t.title}),(0,k.jsx)("h3",{className:"section-subtitle",children:t.subtitle}),(0,k.jsx)("p",{className:"section-description",children:t.description}),(0,k.jsxs)("div",{className:"section-metrics",children:[(0,k.jsxs)("div",{className:"metric-item",children:[(0,k.jsx)("span",{className:"metric-value",children:"99.4%"}),(0,k.jsx)("span",{className:"metric-label",children:"On-Time Delivery"})]}),(0,k.jsxs)("div",{className:"metric-item",children:[(0,k.jsx)("span",{className:"metric-value",children:"12.5 min"}),(0,k.jsx)("span",{className:"metric-label",children:"Avg. Doorstep Time"})]})]}),(0,k.jsxs)("div",{className:"section-supporting",children:[(0,k.jsx)("span",{className:"supporting-dot"}),(0,k.jsxs)("div",{className:"supporting-text",children:[(0,k.jsx)("span",{className:"supporting-value",children:"Real-Time visibility"}),(0,k.jsx)("span",{className:"supporting-label",children:"Live GPS · Active now"})]})]}),(0,k.jsxs)("button",{className:"section-close-btn",onClick:()=>{tl(r,ta(.92))},children:["View Analytics",(0,k.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:"6px"},children:[(0,k.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,k.jsx)("polyline",{points:"12 5 19 12 12 19"})]})]})]})}function tv({active:e}){return(0,k.jsxs)(tf,{active:e,id:"promise-section",children:[(0,k.jsx)("div",{className:"section-badge",children:"The Doormile Promise"}),(0,k.jsxs)("h2",{className:"section-title promise-title",children:["One Connected System.",(0,k.jsx)("br",{}),"One Promise Kept."]}),(0,k.jsx)("span",{className:"promise-divider","aria-hidden":!0}),(0,k.jsx)("p",{className:"section-description promise-desc",children:"Stop managing three separate logistics services. Doormile unifies first, mid and last mile into a single intelligent delivery system powered by MileTruth™ AI."})]})}var ty=e.i(92599);function tx(){let e=et(e=>e.scrollProgress<.14),t=et(e=>e.scrollProgress>=.38&&e.scrollProgress<.5),r=et(e=>e.scrollProgress>=.78&&e.scrollProgress<.875),n=et(e=>e.scrollProgress>=.9);return(0,k.jsxs)("div",{className:"sections-overlay-container",children:[(0,k.jsx)(tm,{active:e}),(0,k.jsx)(th,{active:t}),(0,k.jsx)(tg,{active:r}),(0,k.jsx)(tv,{active:n})]})}function tw({hidden:e}){return(0,k.jsxs)("div",{className:"dm-hiw-3d-loader","aria-hidden":e,style:{position:"absolute",inset:0,zIndex:50,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"18px",background:"linear-gradient(180deg, #f5f5f7 0%, #e9edf2 100%)",opacity:+!e,pointerEvents:e?"none":"auto",transition:"opacity 0.6s ease"},children:[(0,k.jsx)("span",{style:{width:30,height:30,borderRadius:"50%",border:"3px solid rgba(192,18,39,0.18)",borderTopColor:"#c01227",animation:"dm-hiw-spin 0.8s linear infinite"}}),(0,k.jsx)("span",{style:{fontWeight:600,letterSpacing:"0.01em",color:"#1f1f1f",fontSize:"0.95rem"},children:"Loading Doormile Experience…"}),(0,k.jsx)("style",{children:"@keyframes dm-hiw-spin{to{transform:rotate(360deg)}}"})]})}function tb(){return(0,k.jsxs)("section",{className:"dm-hiw-3d-fallback",style:{position:"relative",minHeight:"70vh",display:"flex",alignItems:"flex-end",background:"linear-gradient(180deg, #eef1f5 0%, #dfe5ec 55%, #cfd7e0 100%)",overflow:"hidden"},children:[(0,k.jsx)("img",{src:"/images/hiw-3d-fallback.jpg",alt:"Doormile delivery journey — first mile to last mile",loading:"lazy",decoding:"async",onError:e=>{e.currentTarget.style.display="none"},style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}),(0,k.jsx)("div",{style:{position:"relative",padding:"2rem clamp(1rem, 5vw, 4rem)",maxWidth:720},children:(0,k.jsx)("p",{style:{fontWeight:700,fontSize:"clamp(1.25rem, 3vw, 2rem)",lineHeight:1.2,margin:0},children:"From first mile to last mile, every delivery tracked."})})]})}ti.default.registerPlugin(ts.ScrollTrigger),e.s(["default",0,function(){let e=et(e=>e.setLenis),t=function(){let[e,t]=(0,N.useState)(null);return(0,N.useEffect)(()=>{let e,r,n,i,s,o,a;t((r=window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=window.matchMedia("(pointer: coarse)").matches||navigator.maxTouchPoints>0,i=window.innerWidth,s="number"==typeof navigator.deviceMemory?navigator.deviceMemory:8,o=navigator.hardwareConcurrency||8,a=function(){if("u"<typeof document)return!0;try{let e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch{return!1}}(),e=!n&&i>=1024?"desktop":i>=768&&i<=1366?"tablet":n&&i<768||i<768?"mobile":"tablet",(s<=2||o<=2)&&"mobile"!==e&&(e="mobile"),{tier:e,isTouch:n,reducedMotion:r,fallback:r||!a||s<=1,lowMemory:s<=4}))},[]),e}(),r=(0,N.useRef)(null),n=(0,N.useRef)(null),[i,s]=(0,N.useState)("before"),[o,a]=(0,N.useState)(!1),[l,c]=(0,N.useState)(!1),u=(0,N.useCallback)(()=>c(!0),[]),d=t?.tier??"desktop",p=t?.fallback??!1,f=t?.isTouch??!1,m=null!=t&&!p;(0,N.useEffect)(()=>{if(!m)return;let e=r.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(a(!0),t.disconnect())},{rootMargin:"200% 0px"});return t.observe(e),()=>t.disconnect()},[m]),(0,N.useEffect)(()=>{let t;if(!m||f)return;let r=new ty.default({duration:1.2,lerp:.08,syncTouch:!1});e(r),r.on("scroll",ts.ScrollTrigger.update);let n=e=>{r.raf(e),t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),ts.ScrollTrigger.refresh(),()=>{cancelAnimationFrame(t),r.destroy(),e(null)}},[m,f,e]),(0,N.useEffect)(()=>{if(!o)return;let e=n.current;if(!e)return;let t=null,r=r=>{let n=r>=.92;n!==t&&(t=n,e.style.opacity=n?"0.85":"1")};return r(et.getState().scrollProgress),et.subscribe(e=>r(e.scrollProgress))},[o]);let h=(0,N.useRef)(null),g=N.default.useMemo(()=>[{current:null},{current:null},{current:null},{current:null}],[]),v=N.default.useMemo(()=>({bars:[],floorBars:[],pieQuarters:[]}),[]);return null==t?(0,k.jsx)("div",{ref:r,className:"dm-hiw-3d",style:{minHeight:"100vh"},"aria-hidden":!0}):p?(0,k.jsx)(tb,{}):(0,k.jsxs)("div",{ref:r,className:`dm-hiw-3d is-${i}`,children:[(0,k.jsxs)("div",{className:"dm-hiw-3d-stage",children:[(0,k.jsx)("div",{ref:n,className:"canvas-wrapper",style:{transition:"opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1)"},children:o&&(0,k.jsx)(tn,{truckRef:h,wheelRefs:g,dashboardRefs:v,tier:d,onReady:u})}),o&&(0,k.jsx)(tw,{hidden:l}),(0,k.jsx)(td,{}),(0,k.jsx)(tx,{})]}),(0,k.jsx)(tu,{dashboardRefs:v,onPinState:s,tier:d,ready:l})]})}],41626)},88493,e=>{e.n(e.i(41626))}]); |