UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) • 24.5 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as t}from"tslib";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderConditionNode as r,ShaderPropertyAccessNode as i,ShaderFunctionNode as c,ShaderBlockNode as u,ShaderPropertyAccess2DNode as s,ShaderScopeNode as o}from"./ShaderGraphNode.js";var h,l,a,f,p,d,y,w,m,v,b,g,x,I;function E(t){switch(t.type){case"uint":return C;case"uvec2":return X;case"uvec3":return Y;case"uvec4":return _;default:throw new Error("Found unexpected type")}}function $(t){switch(t.type){case"float":return G;case"vec2":return H;case"vec3":return A;case"vec4":return V;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"int":return C;case"ivec2":return X;case"ivec3":return Y;case"ivec4":return _;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"float":return W;case"vec2":return Z;case"vec3":return tt;case"vec4":return et;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"bool":case"float":case"int":case"uint":return J;case"bvec2":case"vec2":case"ivec2":case"uvec2":return K;case"bvec3":case"vec3":case"ivec3":case"uvec3":return L;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Q;default:throw new Error("Unable to handle type")}}function D(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return J;case"float":case"vec2":case"vec3":case"vec4":return C;case"int":case"ivec2":case"ivec3":case"ivec4":return W;case"uint":case"uvec2":case"uvec3":case"uvec4":return G;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*F(t.elementType)}}function k(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map(t=>ct[t]);throw new Error("Unable to find type family")}function M(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>M(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=k(t.type);return dt(t,n,e[n.length-1])}}})}function S(t){return new Proxy(t,{construct:(t,e,n)=>M(new t(...e))})}function R(t){return new Proxy(t,{get(e,n){if(n in e)return e[n];if("string"==typeof n){const e=parseInt(n,10);if(!isNaN(e))return dt(t,`[${e}]`,t.elementType.constructor)}}})}function j(t){return new Proxy(t,{construct:(t,e,n)=>R(new t(...e))})}class P extends Error{}let B=class extends e{static{h=this}static{this.type="array"}constructor(t,e){super(),this.elementType=t,this.size=e,this.children=[],this.type="array"}clone(){const t=new h(this.elementType,this.size);return super.cloneInto(t),t}get(t,e){const n=new W(t),r=null!=e?new W(e):null;if(null!=r){return yt(this,n,r,D(this.elementType.constructor))}return dt(this,n,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return Et(this,t,e,n)}glslFindIndex(t,e,n){return $t(this,t,e,n)}static ofType(t,e){const n={construct:(n,r)=>new h(new t,e)};return new Proxy(h,n)}};B=h=t([j],B);class q extends e{static{this.type="array-2d"}constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.children=[],this.type="array-2d"}clone(){const t=new q(this.elementType,this.xSize,this.ySize,this.isRowMajor);return super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new W(t);return dt(this,new W(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new W(t),r=new W(e);return dt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(B,{construct:(i,c)=>new q(new t,e,n,r)})}}class U extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}static{this.type="sampler2D"}clone(){const t=new U;return t.children=this.children.map(n),super.cloneInto(t),t}}class C extends e{static{this.type="float"}constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new C(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}}let X=class extends e{static{l=this}static{this.type="vec2"}constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new l(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};X=l=t([S],X);let Y=class extends e{static{a=this}static{this.type="vec3"}constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter(t=>null!=t)}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){throw new P}clone(){const t=new a(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};Y=a=t([S],Y);let _=class extends e{static{f=this}static{this.type="vec4"}constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){return dt(this,"[3]",C)}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};_=f=t([S],_);let G=class extends e{static{p=this}static{this.type="uint"}constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new p(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Dt(this,O(t,p))}add(t){return kt(this,O(t,p))}subtract(t){return Mt(this,O(t,p))}divide(t){return Ft(this,O(t,p))}};G=p=t([S],G);let H=class extends e{static{d=this}static{this.type="uvec2"}constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new d(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,G):t)}divide(t){return Ft(this,"number"==typeof t?O(t,G):t)}add(t){return kt(this,"number"==typeof t?O(t,G):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,G):t)}};H=d=t([S],H);let A=class extends e{static{y=this}static{this.type="uvec3"}constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new y(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",G)}get 1(){return dt(this,"[1]",G)}get 2(){return dt(this,"[2]",G)}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,G):t)}divide(t){return Ft(this,"number"==typeof t?O(t,G):t)}add(t){return kt(this,"number"==typeof t?O(t,G):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,G):t)}};A=y=t([S],A);let V=class extends e{static{w=this}static{this.type="uvec4"}constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",G)}get 1(){return dt(this,"[1]",G)}get 2(){return dt(this,"[2]",G)}get 3(){return dt(this,"[3]",G)}multiply(t){return Dt(this,"number"==typeof t?O(t,G):t)}divide(t){return Ft(this,"number"==typeof t?O(t,G):t)}add(t){return kt(this,"number"==typeof t?O(t,G):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,G):t)}};V=w=t([S],V);class J extends e{static{this.type="bool"}constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Lt(this,t)}or(t){return At(this,t)}xor(t){return Jt(this,t)}clone(){const t=new J(n(this.children[0]));return super.cloneInto(t),t}}let K=class extends e{static{m=this}static{this.type="bvec2"}constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new m(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};K=m=t([S],K);let L=class extends e{static{v=this}static{this.type="bvec3"}constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function O(t,e){if("number"==typeof t){return new e(t)}return t}L=v=t([S],L);let Q=class extends e{static{b=this}static{this.type="bvec4"}constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Q=b=t([S],Q);class W extends e{static{this.type="int"}constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Dt(this,O(t,W))}add(t){return kt(this,O(t,W))}subtract(t){return Mt(this,O(t,W))}divide(t){return Ft(this,O(t,W))}clone(){const t=new W(n(this.children[0]));return super.cloneInto(t),t}}let Z=class extends e{static{g=this}static{this.type="ivec2"}constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new g(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,W):t)}divide(t){return Ft(this,"number"==typeof t?O(t,W):t)}add(t){return kt(this,"number"==typeof t?O(t,W):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,W):t)}};Z=g=t([S],Z);let tt=class extends e{static{x=this}static{this.type="ivec3"}constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new x(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,W):t)}divide(t){return Ft(this,"number"==typeof t?O(t,W):t)}add(t){return kt(this,"number"==typeof t?O(t,W):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,W):t)}};tt=x=t([S],tt);let et=class extends e{static{I=this}static{this.type="ivec4"}constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){return dt(this,"[3]",W)}multiply(t){return Dt(this,"number"==typeof t?O(t,W):t)}divide(t){return Ft(this,"number"==typeof t?O(t,W):t)}add(t){return kt(this,"number"==typeof t?O(t,W):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,W):t)}};et=I=t([S],et);class nt extends e{static{this.type="mat2"}constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new nt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return yt(this,new W(t),new W(e),C)}multiply(t){return Dt(this,t)}}class rt extends e{static{this.type="mat3"}static identity(){return new rt(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=un(t),n=oe(t);return new rt(n,e,0,gt(e),n,0,0,0,1)}constructor(t,e,n,r,i,c,u,s,o){super(),this.type="mat3",this.children=[t,e,n,r,i,c,u,s,o]}add(t){return kt(this,t)}multiply(t){return Dt(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new rt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}class it extends e{static{this.type="mat4"}static identity(){return new it(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,i,c,u,s,o,h,l,a,f,p,d,y){super(),this.type="mat4",this.children=[t,e,n,r,i,c,u,s,o,h,l,a,f,p,d,y]}static fromColumns(t,e,n,r){return new it(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return Dt(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new it(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}const ct={float:C,vec2:X,vec3:Y,vec4:_,int:W,ivec2:Z,ivec3:tt,ivec4:et,uint:G,uvec2:H,uvec3:A,uvec4:V,bool:J,bvec2:K,bvec3:L,bvec4:Q},ut=(...t)=>new W(...t),st=(...t)=>new C(...t),ot=(...t)=>new X(...t),ht=(...t)=>new Y(...t),lt=(...t)=>new _(...t),at=(...t)=>new nt(...t),ft=(...t)=>new rt(...t),pt=(...t)=>new it(...t);function dt(t,e,n){const r=new n(new i(e,t,n));return r.isImplicit=!0,r}function yt(t,e,n,r){const i=new r(new s(e,n,t,r));return i.isImplicit=!0,i}function wt(t,e,n,r=null){if(r){const i=new r,u=new r(new c(t,[e,n],!0,!1,i));return u.isImplicit=!0,u}if("float"===e.type||"int"===e.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const i=new e.constructor(new c(t,[e,n],!0,!1,e.constructor));return i.isImplicit=!0,i}function mt(t,e,n=e.constructor){const r=new n(new c(t,[e],!1,!1,n));return r.isImplicit=!0,r}function vt(t,e,n,r=e.constructor){const i=new r(new c(t,[e,n],!1,!1,r));return i.isImplicit=!0,i}function bt(t,e,n,r,i=e.constructor){const u=new i(new c(t,[e,n,r],!1,!1,i));return u.isImplicit=!0,u}function gt(t){return Dt(t,st(-1))}function xt(t,e,n,r){return new e(new u(t,e,n,r))}function It(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new o(n).setDebugName(e));return r.isImplicit=!0,r}function Et(t,e,n=0,r=t.size){const i=new W(n).setMutable().setDebugName("FindIndexIterator"),c=e(t.get(i)).setDebugName("FindIndexPredicate"),u=xt({iter:i},W,c,({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`).setDebugName("FindIndexBlock");return u}function $t(t,e,n=0,r=t.size){const i=xt({array:t},W,null,({out:t,array:i})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:i,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`).setDebugName("GlslFindIndexBlock");return i}function zt(t,e,n){const i="function"==typeof e?e():e,c="function"==typeof n?n():n,u=new i.constructor(new r(t,i,c));return u.isImplicit=!0,u}function Tt(...t){const e=t.map(([t,e])=>"function"==typeof e?[t,e()]:[t,e]),n=e[0][1].constructor,r=e.findIndex(t=>!0===t[0]);if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const i=e.slice(0,r),c=e[r][1],u=new n(i.reduceRight((t,e)=>zt(e[0],e[1],t),c));return u.isImplicit=!0,u}function Nt(t,e){const n=new e.constructor(new r(t,e,null));return n.isImplicit=!0,n}function Dt(t,e){return wt("*",t,e)}function Ft(t,e){return wt("/",t,e)}function kt(t,e){return wt("+",t,e)}function Mt(t,e){return wt("-",t,e)}function St(t,e){return wt("%",t,e)}function Rt(t,e){return wt("<<",t,e)}function jt(t,e){return wt(">>",t,e)}function Pt(t,e){return wt("&",t,e)}function Bt(t,e){return wt("|",t,e)}function qt(t,e){return wt("^",t,e)}function Ut(t){return mt("~",t)}function Ct(t,e){return wt("==",t,e,J)}function Xt(t,e){return wt("!=",t,e,J)}function Yt(t,e){return wt("<",t,e,J)}function _t(t,e){return wt("<=",t,e,J)}function Gt(t,e){return wt(">",t,e,J)}function Ht(t,e){return wt(">=",t,e,J)}function At(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Vt(t,e),t[0])}function Vt(t,e){return wt("||",t,e,J)}function Jt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Kt(t,e),t[0])}function Kt(t,e){return wt("^^",t,e,J)}function Lt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Ot(t,e),t[0])}function Ot(t,e){return wt("&&",t,e,J)}function Qt(t){return mt("abs",t)}function Wt(t){return mt("acos",t)}function Zt(t){return mt("acosh",t)}function te(t){return mt("all",t,J)}function ee(t){return mt("any",t,J)}function ne(t){return mt("asin",t)}function re(t){return mt("asinh",t)}function ie(t,e){return null==e?mt("atan",t):vt("atan",t,e,t.constructor)}function ce(t){return mt("atanh",t)}function ue(t){return mt("ceil",t)}function se(t,e,n){return bt("clamp",t,e,n,t.constructor)}function oe(t){return mt("cos",t)}function he(t){return mt("cosh",t)}function le(t,e){return vt("cross",t,e,t.constructor)}function ae(t){return mt("dFdX",t)}function fe(t){return mt("dFdY",t)}function pe(t){return mt("degrees",t)}function de(t){return mt("determinant",t,C)}function ye(t,e){return vt("distance",t,e,C)}function we(t,e){return vt("dot",t,e,C)}function me(t,e){return vt("equal",t,e,N(t))}function ve(t,e){return vt("greaterThan",t,e,N(t))}function be(t,e){return vt("greaterThanEqual",t,e,N(t))}function ge(t){return mt("exp",t)}function xe(t){return mt("exp2",t)}function Ie(t,e,n){return bt("faceforward",t,e,n)}function Ee(t){return mt("floatBitsToInt",t,T(t))}function $e(t){return mt("floatBitsToUint",t,$(t))}function ze(t){return mt("floor",t)}function Te(t){return mt("fract",t)}function Ne(t){return mt("fwidth",t)}function De(t){return mt("intBitsToFloat",t,z(t))}function Fe(t){return mt("uintBitsToFloat",t,E(t))}function ke(t){return mt("inverse",t,C)}function Me(t){return mt("inversesqrt",t)}function Se(t){return mt("isinf",t,N(t))}function Re(t){return mt("isnan",t,N(t))}function je(t){return mt("length",t,C)}function Pe(t,e){return vt("lessThan",t,e,N(t))}function Be(t,e){return vt("lessThanEqual",t,e,N(t))}function qe(t){return mt("log",t)}function Ue(t){return mt("log2",t)}function Ce(t,e){return vt("matrixCompMult",t,e)}function Xe(t,e){return vt("max",t,e)}function Ye(t,e){return vt("min",t,e)}function _e(t,e,n){return bt("mix",t,e,n)}function Ge(t,e){return vt("mod",t,e)}function He(t,e){throw new Error("modf not implemented")}function Ae(t){return mt("normalize",t)}function Ve(t){return"bool"===t.type?mt("!",t):mt("not",t)}function Je(t,e){return vt("notEqual",t,e,N(t))}function Ke(t,e){throw new Error("Impl type?")}function Le(t){return mt("packHalf2x16",t,G)}function Oe(t){return mt("packUnorm2x16",t,G)}function Qe(t){return mt("packSnorm2x16",t,G)}function We(t,e){return vt("pow",t,e)}function Ze(t){return mt("radians",t)}function tn(t,e){return vt("reflect",t,e)}function en(t,e,n){return bt("refract",t,e,n)}function nn(t){return mt("round",t)}function rn(t){return mt("roundEven",t)}function cn(t){return mt("sign",t)}function un(t){return mt("sin",t)}function sn(t){return mt("sinh",t)}function on(t,e,n){return bt("smoothstep",t,e,n)}function hn(t){return mt("sqrt",t)}function ln(t,e){return vt("step",t,e,e.constructor)}function an(t){return mt("tan",t)}function fn(t){return mt("tanh",t)}function pn(t,e,n){return bt("texelFetch",t,e,n,_)}function dn(t,e,n,r){throw new Error("Impl type")}function yn(t,e,n){throw new Error("Impl type")}function wn(t,e){return vt("texture",t,e,_)}function mn(t,e,n,r){throw new Error("Impl type")}function vn(t,e,n,r,i){throw new Error("Impl type")}function bn(t,e,n){throw new Error("Impl type")}function gn(t,e,n,r){throw new Error("Impl type")}function xn(t,e,n,r){throw new Error("Impl type")}function In(t,e,n){throw new Error("Impl type")}function En(t,e,n,r){throw new Error("Impl type")}function $n(t,e,n,r,i){throw new Error("Impl type")}function zn(t,e,n){throw new Error("Impl type")}function Tn(t,e,n,r){throw new Error("Impl type")}function Nn(t,e,n,r){throw new Error("Impl type")}function Dn(t,e){throw new Error("Impl type")}function Fn(t){return mt("transpose",t)}function kn(t){return mt("trunc",t)}function Mn(t){return mt("unpackHalf2x16",t,X)}function Sn(t){return mt("unpackUnorm2x16",t,X)}function Rn(t){return mt("unpackSnorm2x16",t,X)}function jn(t,e){const n=We(new C(2),new C(e));return[new _(Ge(t.x,n),ze(t.x.divide(n)),Ge(t.y,n),ze(t.y.divide(n))),new _(Ge(t.z,n),ze(t.z.divide(n)),Ge(t.w,n),ze(t.w.divide(n)))]}function Pn(t,e){const{initialValue:n,xRange:r,yRange:i,callback:c}=e,[u,s]=r,[o,h]=i,l=new W(0).setMutable().setDebugName("iterX"),a=new W(0).setMutable().setDebugName("iterY"),f=n.setMutable().setDebugName("accumulator"),p=c(f,t.get(l,a),l,a).setDebugName("callback"),d=xt({iterX:l,iterY:a,accumulator:f},n.constructor,p,({out:t,iterX:e,iterY:n,accumulator:r,subgraph:i})=>`\nfor (${n} = ${o}; ${n} < ${h}; ${n}++) {\n for (${e} = ${u}; ${e} < ${s}; ${e}++) {\n\n ${i.body}\n\n ${r} = ${i.varName};\n }\n}\n${t} = ${r};\n`).setDebugName("reduce2DBody");return d}export{K as BVec2,L as BVec3,Q as BVec4,J as Bool,B as FixedArray,q as FixedArray2D,C as Float,Z as IVec2,tt as IVec3,et as IVec4,W as Int,nt as Mat2,rt as Mat3,it as Mat4,U as Sampler2D,G as UInt,H as UVec2,A as UVec3,V as UVec4,X as Vec2,Y as Vec3,_ as Vec4,Vt as _or,Kt as _xor,Qt as abs,Wt as acos,Zt as acosh,kt as add,te as all,Lt as and,ee as any,ne as asin,re as asinh,ie as atan,ce as atanh,Pt as bitAnd,Ut as bitNot,Bt as bitOr,jt as bitRShift,Rt as bitShift,qt as bitXor,xt as block,ue as ceil,se as clamp,Tt as cond,oe as cos,he as cosh,le as cross,ae as dFdx,fe as dFdy,dt as definePropertyAccess,yt as definePropertyAccess2D,pe as degrees,de as determinant,ye as distance,Ft as divide,we as dot,Ct as equal,me as equalComponent,ge as exp,xe as exp2,Ie as faceforward,Et as findIndex,st as float,Ee as floatBitsToInt,$e as floatBitsToUint,ze as floor,Te as fract,Ne as fwidth,F as getTypeElementLengthForType,$t as glslFindIndex,Gt as greaterThan,ve as greaterThanComponent,Ht as greaterThanEqual,be as greaterThanEqualComponent,zt as ifElse,ut as int,De as intBitsToFloat,St as intMod,ke as inverse,Me as inversesqrt,Se as isinf,Re as isnan,je as length,Yt as lessThan,Pe as lessThanComponent,_t as lessThanEqual,Be as lessThanEqualComponent,qe as log,Ue as log2,at as mat2,ft as mat3,pt as mat4,Ce as matrixCompMult,Xe as max,Ye as min,_e as mix,Ge as mod,He as modf,Dt as multiply,It as namedScope,gt as negate,Ae as normalize,Ve as not,Xt as notEqual,Je as notEqualComponent,At as or,Ke as outerProduct,Le as packHalf2x16,Qe as packSnorm2x16,Oe as packUnorm2x16,We as pow,Ze as radians,Pn as reduce2D,tn as reflect,en as refract,nn as round,rn as roundEven,cn as sign,un as sin,sn as sinh,on as smoothstep,hn as sqrt,ln as step,Mt as subtract,an as tan,fn as tanh,pn as texelFetch,dn as texelFetchOffset,yn as texture,wn as texture2D,mn as textureGrad,vn as textureGradOffset,bn as textureLod,gn as textureLodOffset,xn as textureOffset,In as textureProj,En as textureProjGrad,$n as textureProjGradOffset,zn as textureProjLod,Tn as textureProjLodOffset,Nn as textureProjOffset,Dn as textureSize,T as transformFloatToInt,$ as transformFloatToUInt,z as transformIntToFloat,N as transformTypeToBooleanType,E as transformUIntToFloat,Fn as transpose,kn as trunc,Fe as uintBitsToFloat,Mn as unpackHalf2x16,Rn as unpackSnorm2x16,Sn as unpackUnorm2x16,jn as unpackVec4,ot as vec2,ht as vec3,lt as vec4,Nt as when,Jt as xor};