1import{_ as S,b as v}from"./cemetery-web-map-mobile-jsxFactory-Dxam0y7Y.js";import"./cemetery-web-map-mobile-config-0Ug7i2HA.js";import{f as D,d as E}from"./cemetery-web-map-mobile-dataUtils-CKrVkGIP.js";import{ee as z,hj as y,hk as $,hl as b}from"./cemetery-web-map-mobile-config-yR1nJH_4.js";import"./index-B09amMR7.js";import"./cemetery-web-map-mobile-style-map-DmVMYgmw.js";import"./cemetery-web-map-mobile-ReactiveMap-DjlPRfIJ.js";import"./cemetery-web-map-mobile-messageBundle-CHvNslEc.js";function j(e,r,t){const{extent:i,valid:u}=e,[n,o,a,s]=i;return!(t<o||t>s)&&(u!=null&&n>a?r>=a||r<=n:r>=n&&r<=a)}function k(e,r,t,i){const{extent:u,modelSize:n,valid:o}=e,[a,s,c]=u,f=T(a,c,o);let l=r/n[0]*f+a;return o!=null&&i&&(l=new z(o[0],o[1]).normalize(l)),[l,(n[1]-t)/n[1]*y(u)+s]}function T(e,r,t){if(t!=null&&e>r){const[i,u]=t;return u-e+(r-i)}return r-e}function A(e){return e?4:3}function F(e,r,t){const[i,u]=t.modelSize;let n=null;const o=new Map;r.forEach(s=>{o.set(s.lij,D(e,s))});const a=(s,c,f)=>b(s.extent,c,f);return(s,c)=>{const f=Math.round(s),l=Math.round(c);if(!e.wrapAround&&(f<0||f>=i||l<0||l>=u))return[0,0];const[d,m]=k(t,s,c,!0);if(!j(t,d,m))return[0,0];if(n==null||!a(n,d,m)){n=null;for(const[I,x]of r)if(a(x,d,m)){n=x;break}}if(n?.data==null)return[0,0];const g=o.get(n.lij);if(g==null)return[0,0];const{width:M,height:w,extent:p}=n;return g((d-p[0])/$(p)*M,w-(m-p[1])/y(p)*w)}}let h=class{constructor(){this._tileData=new Map}async generateStreamlines(e){const{flowData:r,flowExtentInfo:t,needsMagnitude:i,simulationSettings:u,startPositions:n}=e,o=_(D(u,r),u,t.modelSize,i,n);return{result:{streamlines:o},transferList:o?.map(a=>a.vertices.buffer)}}async generateTiledStreamlines(e){const{flowDataTiles:r,flowExtentInfo:t,needsMagnitude:i,reset:u,simulationSettings:n,startPositions:o}=e;this._updateTileData(r,u);const a=_(F(n,this._tileData,t),n,t.modelSize,i,o);return{result:{streamlines:a},transferList:a?.map(s=>s.vertices.buffer)??[]}}_updateTileData(e,r){r&&this._tileData.forEach((t,i)=>{e.get(i)==null&&this._tileData.delete(i)}),e.forEach((t,i)=>{t.type==="delete"?this._tileData.delete(i):t.type!=="on-worker"&&t.type!=="waiting"&&this._tileData.set(i,t.data)})}};h=S([v("esri.views.3d.support.flow.FlowWorker")],h);const J=h;function _(e,r,t,i,u){if(e==null)return;const n=E(r,e,t[0],t[1],{positions:u}),o=[],a=A(i);for(const{vertices:s,stage:c}of n){const f=new Float32Array(s.length*a);for(let l=0;l<s.length;l++)f[l*a]=s[l].x,f[l*a+1]=s[l].y,f[l*a+2]=s[l].t,i&&(f[l*a+3]=s[l].speed);o.push({vertices:f,stage:c,hasMagnitude:i})}return o}export{J as default};
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.