PageSourceSearch

https://www.styly.io/_next/static/chunks/8470.7b2d8808576f6a4e.js

js styly.io collected 2026-10-05 08:54:04 UTC 36,350 bytes, 36 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8470],{30258:(e,t,r)=>{r.d(t,{Hl:()=>c});var n=r(40264),a=r(12115),i=r(87548);function o(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let s=["x","y","top","bottom","left","right","width","height"];var l=r(54735),d=r(95155);function u({ref:e,children:t,fallback:r,resize:l,style:u,gl:c,events:f=n.f,eventSource:h,eventPrefix:p,shadows:g,linear:m,flat:v,legacy:y,orthographic:w,frameloop:b,dpr:_,performance:x,raycaster:M,camera:E,scene:C,onPointerMissed:T,onCreated:k,...R}){a.useMemo(()=>(0,n.e)(i),[]);let F=(0,n.u)(),[I,S]=function({debounce:e,scroll:t,polyfill:r,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var i,l,d;let u=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!u)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[c,f]=(0,a.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),h=(0,a.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:c,orientationHandler:null}),p=e?"number"==typeof e?e:e.scroll:null,g=e?"number"==typeof e?e:e.resize:null,m=(0,a.useRef)(!1);(0,a.useEffect)(()=>(m.current=!0,()=>void(m.current=!1)));let[v,y,w]=(0,a.useMemo)(()=>{let e=()=>{let e,t;if(!h.current.element)return;let{left:r,top:a,width:i,height:o,bottom:l,right:d,x:u,y:c}=h.current.element.getBoundingClientRect(),p={left:r,top:a,width:i,height:o,bottom:l,right:d,x:u,y:c};h.current.element instanceof HTMLElement&&n&&(p.height=h.current.element.offsetHeight,p.width=h.current.element.offsetWidth),Object.freeze(p),m.current&&(e=h.current.lastBounds,t=p,!s.every(r=>e[r]===t[r]))&&f(h.current.lastBounds=p)};return[e,g?o(e,g):e,p?o(e,p):e]},[f,n,p,g]);function b(){h.current.scrollContainers&&(h.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",w,!0)),h.current.scrollContainers=null),h.current.resizeObserver&&(h.current.resizeObserver.disconnect(),h.current.resizeObserver=null),h.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",h.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",h.current.orientationHandler))}function _(){h.current.element&&(h.current.resizeObserver=new u(w),h.current.resizeObserver.observe(h.current.element),t&&h.current.scrollContainers&&h.current.scrollContainers.forEach(e=>e.addEventListener("scroll",w,{capture:!0,passive:!0})),h.current.orientationHandler=()=>{w()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",h.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",h.current.orientationHandler))}return i=w,l=!!t,(0,a.useEffect)(()=>{if(l)return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)},[i,l]),d=y,(0,a.useEffect)(()=>(window.addEventListener("resize",d),()=>void window.removeEventListener("resize",d)),[d]),(0,a.useEffect)(()=>{b(),_()},[t,w,y]),(0,a.useEffect)(()=>b,[]),[e=>{e&&e!==h.current.element&&(b(),h.current.element=e,h.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:a,overflowY:i}=window.getComputedStyle(t);return[n,a,i].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),_())},c,v]}({scroll:!0,debounce:{scroll:50,resize:0},...l}),A=a.useRef(null),O=a.useRef(null);a.useImperativeHandle(e,()=>A.current);let P=(0,n.a)(T),[U,L]=a.useState(!1),[D,H]=a.useState(!1);if(U)throw U;if(D)throw D;let B=a.useRef(null);(0,n.b)(()=>{let e=A.current;S.width>0&&S.height>0&&e&&(B.current||(B.current=(0,n.c)(e)),async function(){await B.current.configure({gl:c,scene:C,events:f,shadows:g,linear:m,flat:v,legacy:y,orthographic:w,frameloop:b,dpr:_,performance:x,raycaster:M,camera:E,size:S,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(h?(0,n.i)(h)?h.current:h:O.current),p&&e.setEvents({compute:(e,t)=>
1{let r=e[p+"X"],n=e[p+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==k||k(e)}}),B.current.render((0,d.jsx)(F,{children:(0,d.jsx)(n.E,{set:H,children:(0,d.jsx)(a.Suspense,{fallback:(0,d.jsx)(n.B,{set:L}),children:null!=t?t:null})})}))}())}),a.useEffect(()=>{let e=A.current;if(e)return()=>(0,n.d)(e)},[]);let j=h?"none":"auto";return(0,d.jsx)("div",{ref:O,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:j,...u},...R,children:(0,d.jsx)("div",{ref:I,style:{width:"100%",height:"100%"},children:(0,d.jsx)("canvas",{ref:A,style:{display:"block"},children:r})})})}function c(e){return(0,d.jsx)(l.Af,{children:(0,d.jsx)(u,{...e})})}r(84943)},47198:(e,t,r)=>{let n;r.d(t,{OH:()=>q});var a=r(88945),i=r(12115),o=r(40264),s=r(85339),l=r(87548),d=r(31235),u=r(43818),c=r(99191);let f=(e,t,r)=>{let n;switch(e){case s.OUM:n=new Uint8ClampedArray(t*r*4);break;case s.ix0:n=new Uint16Array(t*r*4);break;case s.bkx:n=new Uint32Array(t*r*4);break;case s.tJf:n=new Int8Array(t*r*4);break;case s.fBL:n=new Int16Array(t*r*4);break;case s.Yuy:n=new Int32Array(t*r*4);break;case s.RQf:n=new Float32Array(t*r*4);break;default:throw Error("Unsupported data type")}return n};class h{_renderer;_rendererIsDisposable=!1;_material;_scene;_camera;_quad;_renderTarget;_width;_height;_type;_colorSpace;_supportsReadPixels=!0;constructor(e){this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace
1=e.colorSpace;let t={format:s.GWd,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:e.renderTargetOptions?.anisotropy!==void 0?e.renderTargetOptions?.anisotropy:1,generateMipmaps:e.renderTargetOptions?.generateMipmaps!==void 0&&e.renderTargetOptions?.generateMipmaps,magFilter:e.renderTargetOptions?.magFilter!==void 0?e.renderTargetOptions?.magFilter:s.k6q,minFilter:e.renderTargetOptions?.minFilter!==void 0?e.renderTargetOptions?.minFilter:s.k6q,samples:e.renderTargetOptions?.samples!==void 0?e.renderTargetOptions?.samples:void 0,wrapS:e.renderTargetOptions?.wrapS!==void 0?e.renderTargetOptions?.wrapS:s.ghU,wrapT:e.renderTargetOptions?.wrapT!==void 0?e.renderTargetOptions?.wrapT:s.ghU};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=h.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new s.Z58,this._camera=new s.qUd,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!((e,t,r,a)=>{if(void 0!==n)return n;let i=new s.nWS(1,1,a);t.setRenderTarget(i);let o=new s.eaF(new s.bdM,new s.V9B({color:0xffffff}));t.render(o,r),t.setRenderTarget(null);let l=f(e,i.width,i.height);return t.readRenderTargetPixels(i,0,0,i.width,i.height,l),i.dispose(),o.geometry.dispose(),o.material.dispose(),n=0!==l[0]})(this._type,this._renderer,this._camera,t)){let e;this._type===s.ix0&&(e=this._renderer.extensions.has("EXT_color_buffer_float")?s.RQf:void 0),void 0!==e?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${s.RQf}`),this._type=e):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new s.eaF(new s.bdM,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new s.nWS(this.width,this.height,t),this._renderTarget.texture.mapping=e.renderTargetOptions?.mapping!==void 0?e.renderTargetOptions?.mapping:s.UTZ}static instantiateRenderer(){let e=new l.WebGLRenderer;return e.setSize(128,128),e}render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)};toArray(){if(!this._supportsReadPixels)throw Error("Can't read pixels in this browser");let e=f(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){let t=new s.GYF(this.toArray(),this.width,this.height,s.GWd,this._type,e?.mapping||s.UTZ,e?.wrapS||s.ghU,e?.wrapT||s.ghU,e?.magFilter||s.k6q,e?.minFilter||s.k6q,e?.anisotropy||1,s.Zr2);return t.generateMipmaps=e?.generateMipmaps!==void 0&&e?.generateMipmaps,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof s.BKk&&Object.values(this.material.uniforms).forEach(e=>{e.value instanceof s.gPd&&e.value.dispose()}),Object.values(this.material).forEach(e=>{e instanceof s.gPd&&e.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}
1class p extends Error{}class g extends Error{}let m=(e,t,r)=>{let n=RegExp(`${t}="([^"]*)"`,"i").exec(e);if(n)return n[1];let a=RegExp(`<${t}[^>]*>([\\s\\S]*?)</${t}>`,"i").exec(e);if(a){let e=a[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return e&&3===e.length?e.map(e=>e.replace(/<\/?rdf:li>/g,"")):a[1].trim()}if(void 0!==r)return r;throw Error(`Can't find ${t} in gainmap metadata`)};class v{options;constructor(e){this.options={debug:!!e&&void 0!==e.debug&&e.debug,extractFII:!e||void 0===e.extractFII||e.extractFII,extractNonFII:!e||void 0===e.extractNonFII||e.extractNonFII}}extract(e){return new Promise((t,r)=>{let n,a=this.options.debug,i=new DataView(e.buffer);if(65496!==i.getUint16(0))return void r(Error("Not a valid jpeg"));let o=i.byteLength,s=2,l=0;for(;s<o;){if(++l>250)return void r(Error(`Found no marker after ${l} loops 😵`));if(255!==i.getUint8(s))return void r(Error(`Not a valid marker at offset 0x${s.toString(16)}, found: 0x${i.getUint8(s).toString(16)}`));if(n=i.getUint8(s+1),a&&console.log(`Marker: ${n.toString(16)}`),226===n){a&&console.log("Found APP2 marker (0xffe2)");let e=s+4;if(0x4d504600===i.getUint32(e)){let n,a=e+4;if(18761===i.getUint16(a))n=!1;else{if(19789!==i.getUint16(a))return void r(Error("No valid endianness marker found in TIFF header"));n=!0}if(42!==i.getUint16(a+2,!n))return void r(Error("Not valid TIFF data! (no 0x002A marker)"));let o=i.getUint32(a+4,!n);if(o<8)return void r(Error("Not valid TIFF data! (First offset less than 8)"));let s=a+o,l=i.getUint16(s,!n),d=s+2,u=0;for(let e=d;e<d+12*l;e+=12)45057===i.getUint16(e,!n)&&(u=i.getUint32(e+8,!n));let c=s+2+12*l+4,f=[];for(let e=c;e<c+16*u;e+=16){let t={MPType:i.getUint32(e,!n),size:i.getUint32(e+4,!n),dataOffset:i.getUint32(e+8,!n),dependantImages:i.getUint32(e+12,!n),start:-1,end:-1,isFII:!1};t.dataOffset?(t.start=a+t.dataOffset,t.isFII=!1):(t.start=0,t.isFII=!0),t.end=t.start+t.size,f.push(t)}if(this.options.extractNonFII&&f.length){let e=new Blob([i]),r=[];for(let t of f){if(t.isFII&&!this.options.extractFII)continue;let n=e.slice(t.start,t.end+1,"image/jpeg");r.push(n)}t(r)}}}s+=2+i.getUint16(s+2)}})}}let y=async e=>{let t=(e=>{let t,r=(t="undefined"!=typeof TextDecoder?new TextDecoder().decode(e):e.toString()).indexOf("<x:xmpmeta");for(;-1!==r;){let e=t.indexOf("x:xmpmeta>",r),n=t.slice(r,e+10);try{let e=m(n,"hdrgm:GainMapMin","0"),t=m(n,"hdrgm:GainMapMax"),r=m(n,"hdrgm:Gamma","1"),a=m(n,"hdrgm:OffsetSDR","0.015625"),i=m(n,"hdrgm:OffsetHDR","0.015625"),o=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(n),s=o?o[1]:"0",l=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(n);if(!l)throw Error("Incomplete gainmap metadata");let d=l[1];return{gainMapMin:Array.isArray(e)?e.map(e=>parseFloat(e)):[parseFloat(e),parseFloat(e),parseFloat(e)],gainMapMax:Array.isArray(t)?t.map(e=>parseFloat(e)):[parseFloat(t),parseFloat(t),parseFloat(t)],gamma:Array.isArray(r)?r.map(e=>parseFloat(e)):[parseFloat(r),parseFloat(r),parseFloat(r)],offsetSdr:Array.isArray(a)?a.map(e=>parseFloat(e)):[parseFloat(a),parseFloat(a),parseFloat(a)],offsetHdr:Array.isArray(i)?i.map(e=>parseFloat(e)):[parseFloat(i),parseFloat(i),parseFloat(i)],hdrCapacityMin:parseFloat(s),hdrCapacityMax:parseFloat(d)}}catch(e){}r=t.indexOf("<x:xmpmeta",e)}})(e);if(!t)throw new g("Gain map XMP metadata not found");let r=new v({extractFII:!0,extractNonFII:!0}),n=await r.extract(e);if(2!==n.length)throw new p("Gain map recovery image not found");return{sdr:new Uint8Array(await n[0].arrayBuffer()),gainMap:new Uint8Array(await n[1].arrayBuffer()),metadata:t}},w=e=>new Promise((t,r)=>{let n=document.createElement("img");n.onload=()=>{t(n)},n.onerror=e=>{r(e)},n.src=URL.createObjectURL(e)});class b extends s.aHM{_renderer;_renderTargetOptions;_internalLoadingManager;_config;constructor(e,t){super(t),this._config=e,e.renderer&&(this._renderer=e.renderer),this._internalLoadingManager=new s.KPJ}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loa
1der will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");let e=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new s.gPd,sdr:new s.gPd});return this._config.createQuadRenderer({width:16,height:16,type:s.ix0,colorSpace:s.Zr2,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(e,t,r){let n,a,i=t?new Blob([t],{type:"image/jpeg"}):void 0,o=new Blob([e],{type:"image/jpeg"}),s=!1;if("undefined"==typeof createImageBitmap){let e=await Promise.all([i?w(i):Promise.resolve(void 0),w(o)]);a=e[0],n=e[1],s="flipY"===r}else{let e=await Promise.all([i?createImageBitmap(i,{imageOrientation:r||"flipY"}):Promise.resolve(void 0),createImageBitmap(o,{imageOrientation:r||"flipY"})]);a=e[0],n=e[1]}return{sdrImage:n,gainMapImage:a,needsFlip:s}}createTextures(e,t,r){let n=new s.gPd(t||new ImageData(2,2),s.UTZ,s.ghU,s.ghU,s.k6q,s.NZq,s.GWd,s.OUM,1,s.Zr2);n.flipY=r,n.needsUpdate=!0;let a=new s.gPd(e,s.UTZ,s.ghU,s.ghU,s.k6q,s.NZq,s.GWd,s.OUM,1,s.er$);return a.flipY=r,a.needsUpdate=!0,{gainMap:n,sdr:a}}updateQuadRenderer(e,t,r,n,a){e.width=t.width,e.height=t.height,e.material.gainMap=r,e.material.sdr=n,e.material.gainMapMin=a.gainMapMin,e.material.gainMapMax=a.gainMapMax,e.material.offsetHdr=a.offsetHdr,e.material.offsetSdr=a.offsetSdr,e.material.gamma=a.gamma,e.material.hdrCapacityMin=a.hdrCapacityMin,e.material.hdrCapacityMax=a.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,a.hdrCapacityMax),e.material.needsUpdate=!0}}let _=`
2varying vec2 vUv;
3
4void main() {
5  vUv = uv;
6  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
7}
8`,x=`
9// min half float value
10#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 )
11// max half float value
12#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 )
13
14uniform sampler2D sdr;
15uniform sampler2D gainMap;
16uniform vec3 gamma;
17uniform vec3 offsetHdr;
18uniform vec3 offsetSdr;
19uniform vec3 gainMapMin;
20uniform vec3 gainMapMax;
21uniform float weightFactor;
22
23varying vec2 vUv;
24
25void main() {
26  vec3 rgb = texture2D( sdr, vUv ).rgb;
27  vec3 recovery = texture2D( gainMap, vUv ).rgb;
28  vec3 logRecovery = pow( recovery, gamma );
29  vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery;
30  vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr;
31  vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
32  gl_FragColor = vec4( clampedHdrColor , 1.0 );
33}
34`;class M extends s.BKk{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:r,gainMapMin:n,gainMapMax:a,maxDisplayBoost:i,hdrCapacityMin:o,hdrCapacityMax:l,sdr:d,gainMap:u}){super({name:"GainMapDecoderMaterial",vertexShader:_,fragmentShader:x,uniforms:{sdr:{value:d},gainMap:{value:u},gamma:{value:new s.Pq0(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new s.Pq0().fromArray(t)},offsetSdr:{value:new s.Pq0().fromArray(r)},gainMapMin:{value:new s.Pq0().fromArray(n)},gainMapMax:{value:new s.Pq0().fromArray(a)},weightFactor:{value:(Math.log2(i)-o)/(l-o)}},blending:s.XIg,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=i,this._hdrCapacityMin=o,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){let e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){let t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){let e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}!l.WebGLRenderer;class E extends b{constructor(e,t){super({renderer:e,createMaterial:e=>new M(e),createQuadRenderer:e=>new h(e)},t)}async render(e,t,r,n){let{sdrImage:a,gainMapImage:i,needsFlip:o}=await this.processImages(r,n,"flipY"),{gainMap:s,sdr:l}=this.createTextures(a,i,o);this.updateQuadRenderer(e,a,s,l,t),e.render()}}
34class C extends E{load([e,t,r],n,a,i){let o,l,d,u=this.prepareQuadRenderer(),c=async()=>{if(o&&l&&d){try{await this.render(u,d,o,l)}catch(n){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(r),"function"==typeof i&&i(n),u.disposeOnDemandRenderer();return}"function"==typeof n&&n(u),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(r),u.disposeOnDemandRenderer()}},f=!0,h=0,p=0,g=!0,m=0,v=0,y=!0,w=0,b=0,_=()=>{"function"==typeof a&&a(new ProgressEvent("progress",{lengthComputable:f&&g&&y,loaded:p+v+b,total:h+m+w}))};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(r);let x=new s.Y9S(this._internalLoadingManager);x.setResponseType("arraybuffer"),x.setRequestHeader(this.requestHeader),x.setPath(this.path),x.setWithCredentials(this.withCredentials),x.load(e,async e=>{if("string"==typeof e)throw Error("Invalid sdr buffer");o=e,await c()},e=>{f=e.lengthComputable,p=e.loaded,h=e.total,_()},t=>{this.manager.itemError(e),"function"==typeof i&&i(t)});let M=new s.Y9S(this._internalLoadingManager);M.setResponseType("arraybuffer"),M.setRequestHeader(this.requestHeader),M.setPath(this.path),M.setWithCredentials(this.withCredentials),M.load(t,async e=>{if("string"==typeof e)throw Error("Invalid gainmap buffer");l=e,await c()},e=>{g=e.lengthComputable,v=e.loaded,m=e.total,_()},e=>{this.manager.itemError(t),"function"==typeof i&&i(e)});let E=new s.Y9S(this._internalLoadingManager);return E.setRequestHeader(this.requestHeader),E.setPath(this.path),E.setWithCredentials(this.withCredentials),E.load(r,async e=>{if("string"!=typeof e)throw Error("Invalid metadata string");d=JSON.parse(e),await c()},e=>{y=e.lengthComputable,b=e.loaded,w=e.total,_()},e=>{this.manager.itemError(r),"function"==typeof i&&i(e)}),u}}class T extends E{load(e,t,r,n){let a=this.prepareQuadRenderer(),i=new s.Y9S(this._internalLoadingManager);return i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setPath(this.path),i.setWithCredentials(this.withCredentials),this.manager.itemStart(e),i.load(e,async r=>{let i,o,s;if("string"==typeof r)throw Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");let l=new Uint8Array(r);try{let e=await y(l);i=e.sdr,o=e.gainMap,s=e.metadata}catch(t){if(t instanceof g||t instanceof p)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),s={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},i=l;else throw t}try{await this.render(a,s,i.buffer,o?.buffer)}catch(t){this.manager.itemError(e),"function"==typeof n&&n(t),a.disposeOnDemandRenderer();return}"function"==typeof t&&t(a),this.manager.itemEnd(e),a.disposeOnDemandRenderer()},r,t=>{this.manager.itemError(e),"function"==typeof n&&n(t)}),a}}let k={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},R="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",F=e=>Array.isArray(e),I=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function S({files:e=I,path:t="",preset:r,colorSpace:n,extensions:a}={}){r&&(P(r),e=k[r],t=R);let l=F(e),{extension:d,isCubemap:u}=U(e),c=L(d);if(!c)throw Error("useEnvironment: Unrecognized file extension: "+e);let f=(0,o.C)(e=>e.gl);(0,i.useLayoutEffect)(()=>{("webp"===d||"jpg"===d||"jpeg"===d)&&f.domElement.addEventListener("webglcontextlost",function(){o.G.clear(c,l?[e]:e)},{once:!0})},[e,f.domElement]);let h=(0,o.G)(c,l?[e]:e,e=>{("webp"===d||"jpg"===d||"jpeg"===d)&&e.setRenderer(f),null==e.setPath||e.setPath(t),a&&a(e)}),p=l?h[0]:h;if("jpg"===d||"jpeg"===d||"webp"===d){var g;p=null==(g=p.renderTarget)?void 0:g.texture}return p.mapping=u?s.hy7:s.wfO,p.colorSpace=null!=n?n:u?"srgb":"srgb-linear",p}let A={files:I,path:"",preset:void 0,extensions:void 0};S.preload=e=>{let t={...A,...e},{files:r,path:n=""}=t,{preset:a,extensions:i}=t;a&&(P(a),r=k[a],n=R);let{extension:s}=U(r);if("webp"===s||"jpg"===s||"jpeg"===s)throw Error("useEnvironment: Preloading gainmaps is not supported");let l=L(s);if(!l)throw Error("useEnvironment: Unrecognized file extension: "+r);o.G.preload(l,F(r)?[r]:r,e=>{null==e.setPath||e.setPath(n),i&&i(e)})};let O={files:I,preset:void 0};function P(e){if(!(e in k))throw Error("Preset must be one of: "+Object.keys(k).join(", "))}function U(e){var t;let r=F(e)&&6===e.length,n=F(e)&&3===e.length&&e.some(e=>e.endsWith("json")),a=F(e)?e[0]:e;return{extension:r?"cube":n?"webp":a.startsWith("data:application/exr")?"exr":a.startsWith("data:application/hdr")?"hdr":a.startsWith("data:image/jpeg")?"jpg":null==(t=a.split(".").pop())||null==(t=t.split("?"))||null==(t=t.shift())?void 0:t.toLowerCase(),isCubemap:r,isGainmap:n}}function L(e){return"cube"===e?s.ScU:"hdr"===e?u.Y:"exr"===e?c.H:"jpg"===e||"jpeg"===e?T:"webp"===e?C:null}function D(e,t,r,n,a={}){var i,s,l,d;let u,c;a={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...a};let f=(c=u=t||r).current&&c.current.isScene?u.current:u,h=f.background,p=f.environment,g={backgroundBlurriness:f.backgroundBlurriness,backgroundIntensity:f.backgroundIntensity,backgroundRotation:null!=(i=null==(s=f.backgroundRotation)||null==s.clone?void 0:s.clone())?i:[0,0,0],environmentIntensity:f.environmentIntensity,environmentRotation:null!=(l=null==(d=f.environmentRotation)||null==d.clone?void 0:d.clone())?l:[0,0,0]};return"only"!==e&&(f.environment=n),e&&(f.background=n),(0,o.s)(f,a),()=>{"only"!==e&&(f.environment=p),e&&(f.background=h),(0,o.s)(f,g)}}function H({scene:e,background:t=!1,map:r,...n}){let a=(0,o.C)(e=>e.scene);return i.useLayoutEffect(()=>{if(r)return D(t,e,a,r,n)}),null}function B({background:e=!1,scene:t,blur:r,backgroundBlurriness:n,backgroundIntensity:a,backgroundRotation:s,environmentIntensity:l,environmentRotation:d,...u}){let c=S(u),f=(0,o.C)(e=>e.scene);return i.useLayoutEffect(()=>D(e,t,f,c,{backgroundBlurriness:null!=r?r:n,backgroundIntensity:a,backgroundRotation:s,environmentIntensity:l,environmentRotation:d})),i.useEffect(()=>()=>{c.dispose()},[c]),null}function j({children:e,near:t=.1,far:r=1e3,resolution:n=256,frames:a=1,map:d,background:u=!1,blur:c,backgroundBlurriness:f,backgroundIntensity:h,backgroundRotation:p,environmentIntensity:g,environmentRotation:m,scene:v,files:y,path:w,preset
34:b,extensions:_}){let x=(0,o.C)(e=>e.gl),M=(0,o.C)(e=>e.scene),E=i.useRef(null),[C]=i.useState(()=>new s.Z58),T=i.useMemo(()=>{let e=new l.WebGLCubeRenderTarget(n);return e.texture.type=s.ix0,e},[n]);i.useEffect(()=>()=>{T.dispose()},[T]),i.useLayoutEffect(()=>{if(1===a){let e=x.autoClear;x.autoClear=!0,E.current.update(x,C),x.autoClear=e}return D(u,v,M,T.texture,{backgroundBlurriness:null!=c?c:f,backgroundIntensity:h,backgroundRotation:p,environmentIntensity:g,environmentRotation:m})},[e,C,T.texture,v,M,u,a,x]);let k=1;return(0,o.D)(()=>{if(a===1/0||k<a){let e=x.autoClear;x.autoClear=!0,E.current.update(x,C),x.autoClear=e,k++}}),i.createElement(i.Fragment,null,(0,o.o)(i.createElement(i.Fragment,null,e,i.createElement("cubeCamera",{ref:E,args:[t,r,T]}),y||b?i.createElement(B,{background:!0,files:y,preset:b,path:w,extensions:_}):d?i.createElement(H,{background:!0,map:d,extensions:_}):null),C))}function z(e){var t,r,n,s;let l=S(e),u=e.map||l;i.useMemo(()=>(0,o.e)({GroundProjectedEnvImpl:d.L}),[]),i.useEffect(()=>()=>{l.dispose()},[l]);let c=i.useMemo(()=>[u],[u]),f=null==(t=e.ground)?void 0:t.height,h=null==(r=e.ground)?void 0:r.radius,p=null!=(n=null==(s=e.ground)?void 0:s.scale)?n:1e3;return i.createElement(i.Fragment,null,i.createElement(H,(0,a.A)({},e,{map:u})),i.createElement("groundProjectedEnvImpl",{args:c,scale:p,height:f,radius:h}))}function q(e){return e.ground?i.createElement(z,e):e.map?i.createElement(H,e):e.children?i.createElement(j,e):i.createElement(B,e)}S.clear=e=>{let t={...O,...e},{files:r}=t,{preset:n}=t;n&&(P(n),r=k[n]);let{extension:a}=U(r),i=L(a);if(!i)throw Error("useEnvironment: Unrecognized file extension: "+r);o.G.clear(i,F(r)?[r]:r)}},54735:(e,t,r)=>{r.d(t,{Af:()=>s,Nz:()=>a,u5:()=>l,y3:()=>c});var n=r(12115);function a(e,t,r){if(!e)return;if(!0===r(e))return e;let n=t?e.return:e.child;for(;n;){let e=a(n,t,r);if(e)return e;n=t?null:n.sibling}}function i(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}(()=>{var e,t;return"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||(null==(t=window.navigator)?void 0:t.product)==="ReactNative")})()?n.useLayoutEffect:n.useEffect;let o=i(n.createContext(null));class s extends n.Component{render(){return n.createElement(o.Provider,{value:this._reactInternals},this.props.children)}}function l(){let e=n.useContext(o);if(null===e)throw Error("its-fine: useFiber must be called within a <FiberProvider />!");let t=n.useId();return n.useMemo(()=>{for(let r of[e,null==e?void 0:e.alternate]){if(!r)continue;let e=a(r,!1,e=>{let r=e.memoizedState;for(;r;){if(r.memoizedState===t)return!0;r=r.next}});if(e)return e}},[e,t])}let d=Symbol.for("react.context"),u=e=>null!==e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===d;function c(){let e=function(){let e=l(),[t]=n.useState(()=>new Map);t.clear();let r=e;for(;r;){let e=r.type;u(e)&&e!==o&&!t.has(e)&&t.set(e,n.use(i(e))),r=r.return}return t}();return n.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>a=>n.createElement(t,null,n.createElement(r.Provider,{...a,value:e.get(r)})),e=>n.createElement(s,{...e})),[e])}},57361:(e,t,r)=>{r.d(t,{_:()=>d});var n=r(88945),a=r(12115),i=r(85339),o=r(40264),s=r(35841),l=r(34623);let d=a.forwardRef(({scale:e=10,frames:t=1/0,opacity:r=1,width:d=1,height:u=1,blur:c=1,near:f=0,far:h=10,resolution:p=512,smooth:g=!0,color:m="#000000",depthWrite:v=!1,renderOrder:y,...w},b)=>{let _,x,M=a.useRef(null),E=(0,o.C)(e=>e.scene),C=(0,o.C)(e=>e.gl),T=a.useRef(null);d*=Array.isArray(e)?e[0]:e||1,u*=Array.isArray(e)?e[1]:e||1;let[k,R,F,I,S,A,O]=a.useMemo(()=>{let e=new i.nWS(p,p),t=new i.nWS(p,p);t.texture.generateMipmaps=e.texture.generateMipmaps=!1;let r=new i.bdM(d,u).rotateX(Math.PI/2),n=new i.eaF(r),a=new i.CSG;a.depthTest=a.depthWrite=!1,a.onBeforeCompile=e=>{e.uniforms={...e.uniforms,ucolor:{value:new i.Q1f(m)}},e.fragmentShader=e.fragmentShader.replace("void main() {",`uniform vec3 ucolor;
35           void main() {
36          `),e.fragmentShader=e.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );")};let o=new i.BKk(s.F),c=new i.BKk(l.r);return c.depthTest=o.depthTest=!1,[e,r,a,n,o,c,t]},[p,d,u,e,m]),P=e=>{I.visible=!0,I.material=S,S.uniforms.tDiffuse.value=k.texture,S.uniforms.h.value=e/256,C.setRenderTarget(O),C.render(I,T.current),I.material=A,A.uniforms.tDiffuse.value=O.texture,A.uniforms.v.value=e/256,C.setRenderTarget(k),C.render(I,T.current),I.visible=!1},U=0;return(0,o.D)(()=>{T.current&&(t===1/0||U<t)&&(U++,_=E.background,x=E.overrideMaterial,M.current.visible=!1,E.background=null,E.overrideMaterial=F,C.setRenderTarget(k),C.render(E,T.current),P(c),g&&P(.4*c),C.setRenderTarget(null),M.current.visible=!0,E.overrideMaterial=x,E.background=_)}),a.useImperativeHandle(b,()=>M.current,[]),a.createElement("group",(0,n.A)({"rotation-x":Math.PI/2},w,{ref:M}),a.createElement("mesh",{renderOrder:y,geometry:R,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},a.createElement("meshBasicMaterial",{transparent:!0,map:k.texture,opacity:r,depthWrite:v})),a.createElement("orthographicCamera",{ref:T,args:[-d/2,d/2,u/2,-u/2,f,h]}))})},71345:(e,t,r)=>{r.d(t,{p:()=>u}),r(12115);var n=r(493),a=r(80805),i=r(25018),o=r(40264);
36let s=null,l="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function d(e=!0,t=!0,r){return i=>{r&&r(i),e&&(s||(s=new n.Z),s.setDecoderPath("string"==typeof e?e:l),i.setDRACOLoader(s)),t&&i.setMeshoptDecoder("function"==typeof a.f?(0,a.f)():a.f)}}let u=(e,t,r,n)=>(0,o.G)(i.B,e,d(t,r,n));u.preload=(e,t,r,n)=>o.G.preload(i.B,e,d(t,r,n)),u.clear=e=>o.G.clear(i.B,e),u.setDecoderPath=e=>{l=e}},71374:(e,t,r)=>{r.d(t,{M:()=>c});var n=r(12115),a=r(85339),i=r(40264),o=r(23689),s=r(57088);let l=((e,t)=>"undefined"!=typeof window&&"function"==typeof(null==(e=window.document)?void 0:e.createElement)&&"string"==typeof(null==(t=window.navigator)?void 0:t.userAgent))(),d=null;async function u(...e){null!=d||(d=await Promise.resolve().then(r.bind(r,57088)));let t=d.default;return t.isSupported()?new t(...e):null}function c(e,{unsuspend:t="loadedmetadata",start:r=!0,hls:d={},crossOrigin:h="anonymous",muted:p=!0,loop:g=!0,playsInline:m=!0,onVideoFrame:v,...y}={}){let w=(0,i.C)(e=>e.gl),b=(0,n.useRef)(null),_=(0,o.DY)(()=>new Promise(async r=>{let n,i;"string"==typeof e?n=e:i=e;let o=Object.assign(document.createElement("video"),{src:n,srcObject:i,crossOrigin:h,loop:g,muted:p,playsInline:m,...y});if(n&&l&&n.endsWith(".m3u8")){let e=b.current=await u(d);e&&(e.on(s.Events.MEDIA_ATTACHED,()=>void e.loadSource(n)),e.attachMedia(o))}let c=new a.Nv2(o);
36c.colorSpace=w.outputColorSpace,o.addEventListener(t,()=>r(c))}),[e]);return f(_.source.data,v),(0,n.useEffect)(()=>(r&&_.image.play(),()=>{b.current&&(b.current.destroy(),b.current=null)}),[_,r]),_}let f=(e,t)=>{(0,n.useEffect)(()=>{let r;if(!t||!e.requestVideoFrameCallback)return;let n=(...a)=>{t(...a),r=e.requestVideoFrameCallback(n)};return e.requestVideoFrameCallback(n),()=>e.cancelVideoFrameCallback(r)},[e,t])}},84004:(e,t)=>{function r(e,t){var r=e.length;for(e.push(t);0<r;){var n=r-1>>>1,a=e[n];if(0<i(a,t))e[n]=t,e[r]=a,r=n;else break}}function n(e){return 0===e.length?null:e[0]}function a(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;for(var n=0,a=e.length,o=a>>>1;n<o;){var s=2*(n+1)-1,l=e[s],d=s+1,u=e[d];if(0>i(l,r))d<a&&0>i(u,l)?(e[n]=u,e[d]=r,n=d):(e[n]=l,e[s]=r,n=s);else if(d<a&&0>i(u,r))e[n]=u,e[d]=r,n=d;else break}}return t}function i(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,d=l.now();t.unstable_now=function(){return l.now()-d}}var u=[],c=[],f=1,h=null,p=3,g=!1,m=!1,v=!1,y=!1,w="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,_="undefined"!=typeof setImmediate?setImmediate:null;function x(e){for(var t=n(c);null!==t;){if(null===t.callback)a(c);else if(t.startTime<=e)a(c),t.sortIndex=t.expirationTime,r(u,t);else break;t=n(c)}}function M(e){if(v=!1,x(e),!m)if(null!==n(u))m=!0,E||(E=!0,o());else{var t=n(c);null!==t&&A(M,t.startTime-e)}}var E=!1,C=-1,T=5,k=-1;function R(){return!!y||!(t.unstable_now()-k<T)}function F(){if(y=!1,E){var e=t.unstable_now();k=e;var r=!0;try{e:{m=!1,v&&(v=!1,b(C),C=-1),g=!0;var i=p;try{t:{for(x(e),h=n(u);null!==h&&!(h.expirationTime>e&&R());){var s=h.callback;if("function"==typeof s){h.callback=null,p=h.priorityLevel;var l=s(h.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof l){h.callback=l,x(e),r=!0;break t}h===n(u)&&a(u),x(e)}else a(u);h=n(u)}if(null!==h)r=!0;else{var d=n(c);null!==d&&A(M,d.startTime-e),r=!1}}break e}finally{h=null,p=i,g=!1}}}finally{r?o():E=!1}}}if("function"==typeof _)o=function(){_(F)};else if("undefined"!=typeof MessageChannel){var I=new MessageChannel,S=I.port2;I.port1.onmessage=F,o=function(){S.postMessage(null)}}else o=function(){w(F,0)};function A(e,r){C=w(function(){e(t.unstable_now())},r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var r=p;p=t;try{return e()}finally{p=r}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=p;p=e;try{return t()}finally{p=r}},t.unstable_scheduleCallback=function(e,a,i){var s=t.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?s+i:s,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=0x3fffffff;break;case 4:l=1e4;break;default:l=5e3}return l=i+l,e={id:f++,callback:a,priorityLevel:e,startTime:i,expirationTime:l,sortIndex:-1},i>s?(e.sortIndex=i,r(c,e),null===n(u)&&e===n(c)&&(v?(b(C),C=-1):v=!0,A(M,i-s))):(e.sortIndex=l,r(u,e),m||g||(m=!0,E||(E=!0,o()))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=p;return function(){var r=p;p=t;try{return e.apply(this,arguments)}finally{p=r}}}},84943:(e,t,r)=>{e.exports=r(84004)},88945:(e,t,r)=>{r.d(t,{A:()=>n});function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}
36).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}}}]);

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.