"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[7674],{77406:(t,o,e)=>{var r=e(25108),u=e(9705),n=e(41070),p=e(88147),s=e(63922),i=e(10611),h=e(84102),f=e(27418),a=e(31540);function l(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var c=l(u),g=l(n),b=l(p),m=l(s),d=l(f);function y(t,o){if(o=o||{},!h.isObject(o))throw new Error("options is invalid");var e=o.zProperty||"elevation",r=o.flip,u=o.flags;i.collectionOf(t,"Point","input must contain Points");for(var n=k(t,r),p=[],s=0;s<n.length;s++){for(var f=n[s],a=[],l=0;l<f.length;l++){var c=f[l];c.properties[e]?a.push(c.properties[e]):a.push(0),!0===u&&(c.properties.matrixPosition=[s,l])}p.push(a)}return p}function k(t,o){var e={};a.featureEach(t,(function(t){var o=i.getCoords(t)[1];e[o]||(e[o]=[]),e[o].push(t)}));var r=Object.keys(e).map((function(t){var o=e[t],r=o.sort((function(t,o){return i.getCoords(t)[0]-i.getCoords(o)[0]}));return r})),u=r.sort((function(t,e){return o?i.getCoords(t[0])[1]-i.getCoords(e[0])[1]:i.getCoords(e[0])[1]-i.getCoords(t[0])[1]}));return u} /*! * @license GNU Affero General Public License. * Copyright (c) 2015, 2015 Ronny Lorenz <ronny@tbi.univie.ac.at> * v. 1.2.0 * https://github.com/RaumZeit/MarchingSquares.js * * MarchingSquaresJS is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MarchingSquaresJS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * As additional permission under GNU Affero General Public License version 3 * section 7, third-party projects (personal or commercial) may distribute, * include, or link against UNMODIFIED VERSIONS of MarchingSquaresJS without the * requirement that said third-party project for that reason alone becomes * subject to any requirement of the GNU Affero General Public License version 3. * Any modifications to MarchingSquaresJS, however, must be shared with the public * and made available. * * In summary this: * - allows you to use MarchingSquaresJS at no cost * - allows you to use MarchingSquaresJS for both personal and commercial purposes * - allows you to distribute UNMODIFIED VERSIONS of MarchingSquaresJS under any * license as long as this license notice is included * - enables you to keep the source code of your program that uses MarchingSquaresJS * undisclosed * - forces you to share any modifications you have made to MarchingSquaresJS, * e.g. bug-fixes * * You should have received a copy of the GNU Affero General Public License * along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>. */var v={successCallback:null,verbose:!1,polygons:!1},x={};function w(t,o,e,u){u=u||{};for(var n=Object.keys(v),p=0;p<n.length;p++){var s=n[p],i=u[s];i="undefined"!==typeof i&&null!==i?i:v[s],x[s]=i}x.verbose&&r.log("MarchingSquaresJS-isoBands: computing isobands for ["+o+":"+(o+e)+"]");var h,f=Vt(t,o,e);return x.polygons?(x.verbose&&r.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),h=to(f)):(x.verbose&&r.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),h=Wt(f)),"function"===typeof x.successCallback&&x.successCallback(h),h}var S=64,E=16,q=4,C=1,M=[],B=[],J=[],j=[],P=[],O=[],N=[],A=[],_=[],z=[],R=[],I=[],D=[],F=[],G=[],H=[],K=[],L=[],Q=[],T=[],U=[],V=[],W=[],X=[];N[85]=z[85]=-1,A[85]=R[85]=0,_[85]=I[85]=1,Q[85]=V[85]=1,T[85]=W[85]=0,U[85]=X[85]=1,M[85]=j[85]=0,B[85]=P[85]=-1,J[85]=G[85]=0,H[85]=D[85]=0,K[85]=F[85]=1,O[85]=L[85]=1,V[1]=V[169]=0,W[1]=W[169]=-1,X[1]=X[169]=0,D[1]=D[169]=-1,F[1]=F[169]=0,G[1]=G[169]=0,z[4]=z[166]=0,R[4]=R[166]=-1,I[4]=I[166]=1,H[4]=H[166]=1,K[4]=K[166]=0,L[4]=L[166]=0,N[16]=N[154]=0,A[16]=A[154]=1,_[16]=_[154]=1,j[16]=j[154]=1,P[16]=P[154]=0,O[16]=O[154]=1,Q[64]=Q[106]=0,T[64]=T[106]=1,U[64]=U[106]=0,M[64]=M[106]=-1,B[64]=B[106]=0,J[64]=J[106]=1,Q[2]=Q[168]=0,T[2]=T[168]=-1,U[2]=U[168]=1,V[2]=V[168]=0,W[2]=W[168]=-1,X[2]=X[168]=0,D[2]=D[168]=-1,F[2]=F[168]=0,G[2]=G[168]=0,H[2]=H[168]=-1,K[2]=K[168]=0,L[2]=L[168]=1,N[8]=N[162]=0,A[8]=A[162]=-1,_[8]=_[162]=0,z[8]=z[162]=0,R[8]=R[162]=-1,I[8]=I[162]=1,D[8]=D[162]=1,F[8]=F[162]=0,G[8]=G[162]=1,H[8]=H[162]=1,K[8]=K[162]=0,L[8]=L[162]=0,N[32]=N[138]=0,A[32]=A[138]=1,_[32]=_[138]=1,z[32]=z[138]=0,R[32]=R[138]=1,I[32]=I[138]=0,M[32]=M[138]=1,B[32]=B[138]=0,J[32]=J[138]=0,j[32]=j[138]=1,P[32]=P[138]=0,O[32]=O[138]=1,V[128]=V[42]=0,W[128]=W[42]=1,X[128]=X[42]=1,Q[128]=Q[42]=0,T[128]=T[42]=1,U[128]=U[42]=0,M[128]=M[42]=-1,B[128]=B[42]=0,J[128]=J[42]=1,j[128]=j[42]=-1,P[128]=P[42]=0,O[128]=O[42]=0,z[5]=z[165]=-1,R[5]=R[165]=0,I[5]=I[165]=0,V[5]=V[165]=1,W[5]=W[165]=0,X[5]=X[165]=0,H[20]=H[150]=0,K[20]=K[150]=1,L[20]=L[150]=1,j[20]=j[150]=0,P[20]=P[150]=-1,O[20]=O[150]=1,N[80]=N[90]=-1,A[80]=A[90]=0,_[80]=_[90]=1,Q[80]=Q[90]=1,T[80]=T[90]=0,U[80]=U[90]=1,D[65]=D[105]=0,F[65]=F[105]=1,G[65]=G[105]=0,M[65]=M[105]=0,B[65]=B[105]=-1,J[65]=J[105]=0,N[160]=N[10]=-1,A[160]=A[10]=0,_[160]=_[10]=1,z[160]=z[10]=-1,R[160]=R[10]=0,I[160]=I[10]=0,V[160]=V[10]=1,W[160]=W[10]=0,X[160]=X[10]=0,Q[160]=Q[10]=1,T[160]=T[10]=0,U[160]=U[10]=1,H[130]=H[40]=0,K[130]=K[40]=1,L[130]=L[40]=1,D[130]=D[40]=0,F[130]=F[40]=1,G[130]=G[40]=0,M[130]=M[40]=0,B[130]=B[40]=-1,J[130]=J[40]=0,j[130]=j[40]=0,P[130]=P[40]=-1,O[130]=O[40]=1,z[37]=z[133]=0,R[37]=R[133]=1,I[37]=I[133]=1,V[37]=V[133]=0,W[37]=W[133]=1,X[37]=X[133]=0,M[37]=M[133]=-1,B[37]=B[133]=0,J[37]=J[133]=0,j[37]=j[133]=1,P[37]=P[133]=0,O[37]=O[133]=0,H[148]=H[22]=-1,K[148]=K[22]=0,L[148]=L[22]=0,V[148]=V[22]=0,W[148]=W[22]=-1,X[148]=X[22]=1,Q[148]=Q[22]=0,T[148]=T[22]=1,U[148]=U[22]=1,j[148]=j[22]=-1,P[148]=P[22]=0,O[148]=O[22]=1,N[82]=N[88]=0,A[82]=A[88]=-1,_[82]=_[88]=1,H[82]=H[88]=1,K[82]=K[88]=0,L[82]=L[88]=1,D[82]=D[88]=-1,F[82]=F[88]=0,G[82]=G[88]=1,Q[82]=Q[88]=0,T[82]=T[88]=-1,U[82]=U[88]=0,N[73]=N[97]=0,A[73]=A[97]=1,_[73]=_[97]=0,z[73]=z[97]=0,R[73]=R[97]=-1,I[73]=I[97]=0,D[73]=D[97]=1,F[73]=F[97]=0,G[73]=G[97]=0,M[73]=M[97]=1,B[73]=B[97]=0,J[73]=J[97]=1,N[145]=N[25]=0,A[145]=A[25]=-1,_[145]=_[25]=0,D[145]=D[25]=1,F[145]=F[25]=0,G[145]=G[25]=1,V[145]=V[25]=0,W[145]=W[25]=1,X[145]=X[25]=1,j[145]=j[25]=-1,P[145]=P[25]=0,O[145]=O[25]=0,z[70]=z[100]=0,R[70]=R[100]=1,I[70]=I[100]=0,H[70]=H[100]=-1,K[70]=K[100]=0,L[70]=L[100]=1,Q[70]=Q[100]=0,T[70]=T[100]=-1,U[70]=U[100]=1,M[70]=M[100]=1,B[70]=B[100]=0,J[70]=J[100]=0,z[101]=z[69]=0,R[101]=R[69]=1,I[101]=I[69]=0,M[101]=M[69]=1,B[101]=B[69]=0,J[101]=J[69]=0,V[149]=V[21]=0,W[149]=W[21]=1,X[149]=X[21]=1,j[149]=j[21]=-1,P[149]=P[21]=0,O[149]=O[21]=0,H[86]=H[84]=-1,K[86]=K[84]=0,L[86]=L[84]=1,Q[86]=Q[84]=0,T[86]=T[84]=-1,U[86]=U[84]=1,N[89]=N[81]=0,A[89]=A[81]=-1,_[89]=_[81]=0,D[89]=D[81]=1,F[89]=F[81]=0,G[89]=G[81]=1,N[96]=N[74]=0,A[96]=A[74]=1,_[96]=_[74]=0,z[96]=z[74]=-1,R[96]=R[74]=0,I[96]=I[74]=1,Q[96]=Q[74]=1,T[96]=T[74]=0,U[96]=U[74]=0,M[96]=M[74]=1,B[96]=B[74]=0,J[96]=J[74]=1,N[24]=N[146]=0,A[24]=A[146]=-1,_[24]=_[146]=1,H[24]=H[146]=1,K[24]=K[146]=0,L[24]=L[146]=1,D[24]=D[146]=0,F[24]=F[146]=1,G[24]=G[146]=1,j[24]=j[146]=0,P[24]=P[146]=-1,O[24]=O[146]=0,z[6]=z[164]=-1,R[6]=R[164]=0,I[6]=I[164]=1,H[6]=H[164]=-1,K[6]=K[164]=0,L[6]=L[164]=0,V[6]=V[164]=0,W[6]=W[164]=-1,X[6]=X[164]=1,Q[6]=Q[164]=1,T[6]=T[164]=0,U[6]=U[164]=0,D[129]=D[41]=0,F[129]=F[41]=1,G[129]=G[41]=1,V[129]=V[41]=0,W[129]=W[41]=1,X[129]=X[41]=0,M[129]=M[41]=-1,B[129]=B[41]=0,J[129]=J[41]=0,j[129]=j[41]=0,P[129]=P[41]=-1,O[129]=O[41]=0,H[66]=H[104]=0,K[66]=K[104]=1,L[66]=L[104]=0,D[66]=D[104]=-1,F[66]=F[104]=0,G[66]=G[104]=1,Q[66]=Q[104]=0,T[66]=T[104]=-1,U[66]=U[104]=0,M[66]=M[104]=0,B[66]=B[104]=-1,J[66]=J[104]=1,N[144]=N[26]=-1,A[144]=A[26]=0,_[144]=_[26]=0,V[144]=V[26]=1,W[144]=W[26]=0,X[144]=X[26]=1,Q[144]=Q[26]=0,T[144]=T[26]=1,U[144]=U[26]=1,j[144]=j[26]=-1,P[144]=P[26]=0,O[144]=O[26]=1,z[36]=z[134]=0,R[36]=R[134]=1,I[36]=I[134]=1,H[36]=H[134]=0,K[36]=K[134]=1,L[36]=L[134]=0,M[36]=M[134]=0,B[36]=B[134]=-1,J[36]=J[134]=1,j[36]=j[134]=1,P[36]=P[134]=0,O[36]=O[134]=0,N[9]=N[161]=-1,A[9]=A[161]=0,_[9]=_[161]=0,z[9]=z[161]=0,R[9]=R[161]=-1,I[9]=I[161]=0,D[9]=D[161]=1,F[9]=F[161]=0,G[9]=G[161]=0,V[9]=V[161]=1,W[9]=W[161]=0,X[9]=X[161]=1,N[136]=0,A[136]=1,_[136]=1,z[136]=0,R[136]=1,I[136]=0,H[136]=-1,K[136]=0,L[136]=1,D[136]=-1,F[136]=0,G[136]=0,V[136]=0,W[136]=-1,X[136]=0,Q[136]=0,T[136]=-1,U[136]=1,M[136]=1,B[136]=0,J[136]=0,j[136]=1,P[136]=0,O[136]=1,N[34]=0,A[34]=-1,_[34]=0,z[34]=0,R[34]=-1,I[34]=1,H[34]=1,K[34]=0,L[34]=0,D[34]=1,F[34]=0,G[34]=1,V[34]=0,W[34]=1,X[34]=1,Q[34]=0,T[34]=1,U[34]=0,M[34]=-1,B[34]=0,J[34]=1,j[34]=-1,P[34]=0,O[34]=0,N[35]=0,A[35]=1,_[35]=1,z[35]=0,R[35]=-1,I[35]=1,H[35]=1,K[35]=0,L[35]=0,D[35]=-1,F[35]=0,G[35]=0,V[35]=0,W[35]=-1,X[35]=0,Q[35]=0,T[35]=1,U[35]=0,M[35]=-1,B[35]=0,J[35]=1,j[35]=1,P[35]=0,O[35]=1,N[153]=0,A[153]=1,_[153]=1,D[153]=-1,F[153]=0,G[153]=0,V[153]=0,W[153]=-1,X[153]=0,j[153]=1,P[153]=0,O[153]=1,z[102]=0,R[102]=-1,I[102]=1,H[102]=1,K[102]=0,L[102]=0,Q[102]=0,T[102]=1,U[102]=0,M[102]=-1,B[102]=0,J[102]=1,N[155]=0,A[155]=-1,_[155]=0,D[155]=1,F[155]=0,G[155]=1,V[155]=0,W[155]=1,X[155]=1,j[155]=-1,P[155]=0,O[155]=0,z[103]=0,R[103]=1,I[103]=0,H[103]=-1,K[103]=0,L[103]=1,Q[103]=0,T[103]=-1,U[103]=1,M[103]=1,B[103]=0,J[103]=0,N[152]=0,A[152]=1,_[152]=1,H[152]=-1,K[152]=0,L[152]=1,D[152]=-1,F[152]=0,G[152]=0,V[152]=0,W[152]=-1,X[152]=0,Q[152]=0,T[152]=-1,U[152]=1,j[152]=1,P[152]=0,O[152]=1,N[156]=0,A[156]=-1,_[156]=1,H[156]=1,K[156]=0,L[156]=1,D[156]=-1,F[156]=0,G[156]=0,V[156]=0,W[156]=-1,X[156]=0,Q[156]=0,T[156]=1,U[156]=1,j[156]=-1,P[156]=0,O[156]=1,N[137]=0,A[137]=1,_[137]=1,z[137]=0,R[137]=1,I[137]=0,D[137]=-1,F[137]=0,G[137]=0,V[137]=0,W[137]=-1,X[137]=0,M[137]=1,B[137]=0,J[137]=0,j[137]=1,P[137]=0,O[137]=1,N[139]=0,A[139]=1,_[139]=1,z[139]=0,R[139]=-1,I[139]=0,D[139]=1,F[139]=0,G[139]=0,V[139]=0,W[139]=1,X[139]=0,M[139]=-1,B[139]=0,J[139]=0,j[139]=1,P[139]=0,O[139]=1,N[98]=0,A[98]=-1,_[98]=0,z[98]=0,R[98]=-1,I[98]=1,H[98]=1,K[98]=0,L[98]=0,D[98]=1,F[98]=0,G[98]=1,Q[98]=0,T[98]=1,U[98]=0,M[98]=-1,B[98]=0,J[98]=1,N[99]=0,A[99]=1,_[99]=0,z[99]=0,R[99]=-1,I[99]=1,H[99]=1,K[99]=0,L[99]=0,D[99]=-1,F[99]=0,G[99]=1,Q[99]=0,T[99]=-1,U[99]=0,M[99]=1,B[99]=0,J[99]=1,z[38]=0,R[38]=-1,I[38]=1,H[38]=1,K[38]=0,L[38]=0,V[38]=0,W[38]=1,X[38]=1,Q[38]=0,T[38]=1,U[38]=0,M[38]=-1,B[38]=0,J[38]=1,j[38]=-1,P[38]=0,O[38]=0,z[39]=0,R[39]=1,I[39]=1,H[39]=-1,K[39]=0,L[39]=0,V[39]=0,W[39]=-1,X[39]=1,Q[39]=0,T[39]=1,U[39]=0,M[39]=-1,B[39]=0,J[39]=1,j[39]=1,P[39]=0,O[39]=0;var Y=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Z=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},$=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},tt=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},ot=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},et=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},rt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},ut=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},nt=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},pt=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},st=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},it=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},ht=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},ft=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},at=function(){return[[0,0],[0,1],[1,1],[1,0]]},lt=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},ct=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},gt=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},bt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},mt=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},dt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},yt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},kt=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},vt=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},xt=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},wt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},St=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Et=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},qt=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Ct=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},Mt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Bt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Jt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},jt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Pt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Ot=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Nt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},At=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},_t=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},zt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Rt=[],It=[],Dt=[],Ft=[],Gt=[],Ht=[],Kt=[],Lt=[];Ft[1]=Gt[1]=18,Ft[169]=Gt[169]=18,Dt[4]=It[4]=12,Dt[166]=It[166]=12,Rt[16]=Lt[16]=4,Rt[154]=Lt[154]=4,Ht[64]=Kt[64]=22,Ht[106]=Kt[106]=22,Dt[2]=Ht[2]=17,Ft[2]=Gt[2]=18,Dt[168]=Ht[168]=17,Ft[168]=Gt[168]=18,Rt[8]=Ft[8]=9,It[8]=Dt[8]=12,Rt[162]=Ft[162]=9,It[162]=Dt[162]=12,Rt[32]=Lt[32]=4,It[32]=Kt[32]=1,Rt[138]=Lt[138]=4,It[138]=Kt[138]=1,Gt[128]=Lt[128]=21,Ht[128]=Kt[128]=22,Gt[42]=Lt[42]=21,Ht[42]=Kt[42]=22,It[5]=Gt[5]=14,It[165]=Gt[165]=14,Dt[20]=Lt[20]=6,Dt[150]=Lt[150]=6,Rt[80]=Ht[80]=11,Rt[90]=Ht[90]=11,Ft[65]=Kt[65]=3,Ft[105]=Kt[105]=3,Rt[160]=Ht[160]=11,It[160]=Gt[160]=14,Rt[10]=Ht[10]=11,It[10]=Gt[10]=14,Dt[130]=Lt[130]=6,Ft[130]=Kt[130]=3,Dt[40]=Lt[40]=6,Ft[40]=Kt[40]=3,It[101]=Kt[101]=1,It[69]=Kt[69]=1,Gt[149]=Lt[149]=21,Gt[21]=Lt[21]=21,Dt[86]=Ht[86]=17,Dt[84]=Ht[84]=17,Rt[89]=Ft[89]=9,Rt[81]=Ft[81]=9,Rt[96]=Kt[96]=0,It[96]=Ht[96]=15,Rt[74]=Kt[74]=0,It[74]=Ht[74]=15,Rt[24]=Dt[24]=8,Ft[24]=Lt[24]=7,Rt[146]=Dt[146]=8,Ft[146]=Lt[146]=7,It[6]=Ht[6]=15,Dt[6]=Gt[6]=16,It[164]=Ht[164]=15,Dt[164]=Gt[164]=16,Ft[129]=Lt[129]=7,Gt[129]=Kt[129]=20,Ft[41]=Lt[41]=7,Gt[41]=Kt[41]=20,Dt[66]=Kt[66]=2,Ft[66]=Ht[66]=19,Dt[104]=Kt[104]=2,Ft[104]=Ht[104]=19,Rt[144]=Gt[144]=10,Ht[144]=Lt[144]=23,Rt[26]=Gt[26]=10,Ht[26]=Lt[26]=23,It[36]=Lt[36]=5,Dt[36]=Kt[36]=2,It[134]=Lt[134]=5,Dt[134]=Kt[134]=2,Rt[9]=Gt[9]=10,It[9]=Ft[9]=13,Rt[161]=Gt[161]=10,It[161]=Ft[161]=13,It[37]=Lt[37]=5,Gt[37]=Kt[37]=20,It[133]=Lt[133]=5,Gt[133]=Kt[133]=20,Dt[148]=Gt[148]=16,Ht[148]=Lt[148]=23,Dt[22]=Gt[22]=16,Ht[22]=Lt[22]=23,Rt[82]=Dt[82]=8,Ft[82]=Ht[82]=19,Rt[88]=Dt[88]=8,Ft[88]=Ht[88]=19,Rt[73]=Kt[73]=0,It[73]=Ft[73]=13,Rt[97]=Kt[97]=0,It[97]=Ft[97]=13,Rt[145]=Ft[145]=9,Gt[145]=Lt[145]=21,Rt[25]=Ft[25]=9,Gt[25]=Lt[25]=21,It[70]=Kt[70]=1,Dt[70]=Ht[70]=17,It[100]=Kt[100]=1,Dt[100]=Ht[100]=17,Rt[34]=Ft[34]=9,It[34]=Dt[34]=12,Gt[34]=Lt[34]=21,Ht[34]=Kt[34]=22,Rt[136]=Lt[136]=4,It[136]=Kt[136]=1,Dt[136]=Ht[136]=17,Ft[136]=Gt[136]=18,Rt[35]=Lt[35]=4,It[35]=Dt[35]=12,Ft[35]=Gt[35]=18,Ht[35]=Kt[35]=22,Rt[153]=Lt[153]=4,Ft[153]=Gt[153]=18,It[102]=Dt[102]=12,Ht[102]=Kt[102]=22,Rt[155]=Ft[155]=9,Gt[155]=Lt[155]=23,It[103]=Kt[103]=1,Dt[103]=Ht[103]=17,Rt[152]=Lt[152]=4,Dt[152]=Ht[152]=17,Ft[152]=Gt[152]=18,Rt[156]=Dt[156]=8,Ft[156]=Gt[156]=18,Ht[156]=Lt[156]=23,Rt[137]=Lt[137]=4,It[137]=Kt[137]=1,Ft[137]=Gt[137]=18,Rt[139]=Lt[139]=4,It[139]=Ft[139]=13,Gt[139]=Kt[139]=20,Rt[98]=Ft[98]=9,It[98]=Dt[98]=12,Ht[98]=Kt[98]=22,Rt[99]=Kt[99]=0,It[99]=Dt[99]=12,Ft[99]=Ht[99]=19,It[38]=Dt[38]=12,Gt[38]=Lt[38]=21,Ht[38]=Kt[38]=22,It[39]=Lt[39]=5,Dt[39]=Gt[39]=16,Ht[39]=Kt[39]=22;var Qt=[];function Tt(t,o,e){return(t-o)/(e-o)}function Ut(t){return t.constructor.toString().indexOf("Array")>-1}function Vt(t,o,e){for(var u=t.length-1,n=t[0].length-1,p={rows:u,cols:n,cells:[]},s=o+Math.abs(e),i=0;i<u;++i){p.cells[i]=[];for(var h=0;h<n;++h){var f=0,a=t[i+1][h],l=t[i+1][h+1],c=t[i][h+1],g=t[i][h];if(!(isNaN(a)||isNaN(l)||isNaN(c)||isNaN(g))){f|=a<o?0:a>s?128:64,f|=l<o?0:l>s?32:16,f|=c<o?0:c>s?8:4,f|=g<o?0:g>s?2:1;var b=+f,m=0;if(17===f||18===f||33===f||34===f||38===f||68===f||72===f||98===f||102===f||132===f||136===f||137===f||152===f||153===f){var d=(a+l+c+g)/4;m=d>s?2:d<o?0:1,34===f?1===m?f=35:0===m&&(f=136):136===f?1===m?(f=35,m=4):0===m&&(f=34):17===f?1===m?(f=155,m=4):0===m&&(f=153):68===f?1===m?(f=103,m=4):0===m&&(f=102):153===f?1===m&&(f=155):102===f?1===m&&(f=103):152===f?m<2&&(f=156,m=1):137===f?m<2&&(f=139,m=1):98===f?m<2&&(f=99,m=1):38===f?m<2&&(f=39,m=1):18===f?m>0?(f=156,m=4):f=152:33===f?m>0?(f=139,m=4):f=137:72===f?m>0?(f=99,m=4):f=98:132===f&&(m>0?(f=39,m=4):f=38)}if(0!=f&&170!=f){var y,k,v,x,w,S,E,q;y=k=v=x=w=S=E=q=.5;var C=[];1===f?(v=1-Tt(o,c,g),q=1-Tt(o,a,g),C.push(Ft[f])):169===f?(v=Tt(s,g,c),q=Tt(s,g,a),C.push(Ft[f])):4===f?(S=1-Tt(o,l,c),x=Tt(o,g,c),C.push(It[f])):166===f?(S=Tt(s,c,l),x=1-Tt(s,c,g),C.push(It[f])):16===f?(w=Tt(o,c,l),k=Tt(o,a,l),C.push(Rt[f])):154===f?(w=1-Tt(s,l,c),k=1-Tt(s,l,a),C.push(Rt[f])):64===f?(E=Tt(o,g,a),y=1-Tt(o,l,a),C.push(Ht[f])):106===f?(E=1-Tt(s,a,g),y=Tt(s,a,l),C.push(Ht[f])):168===f?(x=Tt(s,g,c),v=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),C.push(Dt[f]),C.push(Ft[f])):2===f?(x=1-Tt(o,c,g),v=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),C.push(Dt[f]),C.push(Ft[f])):162===f?(w=Tt(s,c,l),S=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),C.push(Dt[f]),C.push(Ft[f])):8===f?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),C.push(Rt[f]),C.push(It[f])):138===f?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),y=1-Tt(s,l,a),k=1-Tt(o,l,a),C.push(Rt[f]),C.push(It[f])):32===f?(w=Tt(s,c,l),S=Tt(o,c,l),y=Tt(o,a,l),k=Tt(s,a,l),C.push(Rt[f]),C.push(It[f])):42===f?(q=1-Tt(s,a,g),E=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l),C.push(Gt[f]),C.push(Ht[f])):128===f&&(q=Tt(o,g,a),E=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a),C.push(Gt[f]),C.push(Ht[f])),5===f?(S=1-Tt(o,l,c),q=1-Tt(o,a,g),C.push(It[f])):165===f?(S=Tt(s,c,l),q=Tt(s,g,a),C.push(It[f])):20===f?(x=Tt(o,g,c),k=Tt(o,a,l),C.push(Dt[f])):150===f?(x=1-Tt(s,c,g),k=1-Tt(s,l,a),C.push(Dt[f])):80===f?(w=Tt(o,c,l),E=Tt(o,g,a),C.push(Rt[f])):90===f?(w=1-Tt(s,l,c),E=1-Tt(s,a,g),C.push(Rt[f])):65===f?(v=1-Tt(o,c,g),y=1-Tt(o,l,a),C.push(Ft[f])):105===f?(v=Tt(s,g,c),y=Tt(s,a,l),C.push(Ft[f])):160===f?(w=Tt(s,c,l),S=Tt(o,c,l),q=Tt(o,g,a),E=Tt(s,g,a),C.push(Rt[f]),C.push(It[f])):10===f?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),q=1-Tt(s,a,g),E=1-Tt(o,a,g),C.push(Rt[f]),C.push(It[f])):130===f?(x=1-Tt(o,c,g),v=1-Tt(s,c,g),y=1-Tt(s,l,a),k=1-Tt(o,l,a),C.push(Dt[f]),C.push(Ft[f])):40===f?(x=Tt(s,g,c),v=Tt(o,g,c),y=Tt(o,a,l),k=Tt(s,a,l),C.push(Dt[f]),C.push(Ft[f])):101===f?(S=Tt(s,c,l),y=Tt(s,a,l),C.push(It[f])):69===f?(S=1-Tt(o,l,c),y=1-Tt(o,l,a),C.push(It[f])):149===f?(q=Tt(s,g,a),k=1-Tt(s,l,a),C.push(Gt[f])):21===f?(q=1-Tt(o,a,g),k=Tt(o,a,l),C.push(Gt[f])):86===f?(x=1-Tt(s,c,g),E=1-Tt(s,a,g),C.push(Dt[f])):84===f?(x=Tt(o,g,c),E=Tt(o,g,a),C.push(Dt[f])):89===f?(w=1-Tt(s,l,c),v=Tt(s,g,c),C.push(Ft[f])):81===f?(w=Tt(o,c,l),v=1-Tt(o,c,g),C.push(Ft[f])):96===f?(w=Tt(s,c,l),S=Tt(o,c,l),E=Tt(o,g,a),y=Tt(s,a,l),C.push(Rt[f]),C.push(It[f])):74===f?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),E=1-Tt(s,a,g),y=1-Tt(o,l,a),C.push(Rt[f]),C.push(It[f])):24===f?(w=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),k=Tt(o,a,l),C.push(Rt[f]),C.push(Ft[f])):146===f?(w=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),k=1-Tt(s,l,a),C.push(Rt[f]),C.push(Ft[f])):6===f?(S=1-Tt(o,l,c),x=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),C.push(It[f]),C.push(Dt[f])):164===f?(S=Tt(s,c,l),x=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),C.push(It[f]),C.push(Dt[f])):129===f?(v=1-Tt(o,c,g),q=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a),C.push(Ft[f]),C.push(Gt[f])):41===f?(v=Tt(s,g,c),q=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l),C.push(Ft[f]),C.push(Gt[f])):66===f?(x=1-Tt(o,c,g),v=1-Tt(s,c,g),E=1-Tt(s,a,g),y=1-Tt(o,l,a),C.push(Dt[f]),C.push(Ft[f])):104===f?(x=Tt(s,g,c),v=Tt(o,g,c),E=Tt(o,g,a),y=Tt(s,a,l),C.push(Ft[f]),C.push(Kt[f])):144===f?(w=Tt(o,c,l),q=Tt(o,g,a),E=Tt(s,g,a),k=1-Tt(s,l,a),C.push(Rt[f]),C.push(Ht[f])):26===f?(w=1-Tt(s,l,c),q=1-Tt(s,a,g),E=1-Tt(o,a,g),k=Tt(o,a,l),C.push(Rt[f]),C.push(Ht[f])):36===f?(S=Tt(s,c,l),x=Tt(o,g,c),y=Tt(o,a,l),k=Tt(s,a,l),C.push(It[f]),C.push(Dt[f])):134===f?(S=1-Tt(o,l,c),x=1-Tt(s,c,g),y=1-Tt(s,l,a),k=1-Tt(o,l,a),C.push(It[f]),C.push(Dt[f])):9===f?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),v=Tt(s,g,c),q=1-Tt(o,a,g),C.push(Rt[f]),C.push(It[f])):161===f?(w=Tt(s,c,l),S=Tt(o,c,l),v=1-Tt(o,c,g),q=Tt(s,g,a),C.push(Rt[f]),C.push(It[f])):37===f?(S=Tt(s,c,l),q=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l),C.push(It[f]),C.push(Gt[f])):133===f?(S=1-Tt(o,l,c),q=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a),C.push(It[f]),C.push(Gt[f])):148===f?(x=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),k=1-Tt(s,l,a),C.push(Dt[f]),C.push(Ht[f])):22===f?(x=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),k=Tt(o,a,l),C.push(Dt[f]),C.push(Ht[f])):82===f?(w=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),E=1-Tt(s,a,g),C.push(Rt[f]),C.push(Ft[f])):88===f?(w=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),E=Tt(o,g,a),C.push(Rt[f]),C.push(Ft[f])):73===f?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),v=Tt(s,g,c),y=1-Tt(o,l,a),C.push(Rt[f]),C.push(It[f])):97===f?(w=Tt(s,c,l),S=Tt(o,c,l),v=1-Tt(o,c,g),y=Tt(s,a,l),C.push(Rt[f]),C.push(It[f])):145===f?(w=Tt(o,c,l),v=1-Tt(o,c,g),q=Tt(s,g,a),k=1-Tt(s,l,a),C.push(Rt[f]),C.push(Gt[f])):25===f?(w=1-Tt(s,l,c),v=Tt(s,g,c),q=1-Tt(o,a,g),k=Tt(o,a,l),C.push(Rt[f]),C.push(Gt[f])):70===f?(S=1-Tt(o,l,c),x=1-Tt(s,c,g),E=1-Tt(s,a,g),y=1-Tt(o,l,a),C.push(It[f]),C.push(Dt[f])):100===f?(S=Tt(s,c,l),x=Tt(o,g,c),E=Tt(o,g,a),y=Tt(s,a,l),C.push(It[f]),C.push(Dt[f])):34===f?(0===m?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a)):(w=Tt(s,c,l),S=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l)),C.push(Rt[f]),C.push(It[f]),C.push(Gt[f]),C.push(Ht[f])):35===f?(4===m?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a)):(w=Tt(s,c,l),S=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l)),C.push(Rt[f]),C.push(It[f]),C.push(Ft[f]),C.push(Ht[f])):136===f?(0===m?(w=Tt(s,c,l),S=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l)):(w=1-Tt(o,l,c),S=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a)),C.push(Rt[f]),C.push(It[f]),C.push(Gt[f]),C.push(Ht[f])):153===f?(0===m?(w=Tt(o,c,l),v=1-Tt(o,c,g),q=1-Tt(o,a,g),k=Tt(o,a,l)):(w=1-Tt(s,l,c),v=Tt(s,g,c),q=Tt(s,g,a),k=1-Tt(s,l,a)),C.push(Rt[f]),C.push(Ft[f])):102===f?(0===m?(S=1-Tt(o,l,c),x=Tt(o,g,c),E=Tt(o,g,a),y=1-Tt(o,l,a)):(S=Tt(s,c,l),x=1-Tt(s,c,g),E=1-Tt(s,a,g),y=Tt(s,a,l)),C.push(It[f]),C.push(Ht[f])):155===f?(4===m?(w=Tt(o,c,l),v=1-Tt(o,c,g),q=1-Tt(o,a,g),k=Tt(o,a,l)):(w=1-Tt(s,l,c),v=Tt(s,g,c),q=Tt(s,g,a),k=1-Tt(s,l,a)),C.push(Rt[f]),C.push(Gt[f])):103===f?(4===m?(S=1-Tt(o,l,c),x=Tt(o,g,c),E=Tt(o,g,a),y=1-Tt(o,l,a)):(S=Tt(s,c,l),x=1-Tt(s,c,g),E=1-Tt(s,a,g),y=Tt(s,a,l)),C.push(It[f]),C.push(Dt[f])):152===f?(0===m?(w=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),k=Tt(o,a,l)):(w=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),k=1-Tt(s,l,a)),C.push(Rt[f]),C.push(Dt[f]),C.push(Ft[f])):156===f?(4===m?(w=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),k=Tt(o,a,l)):(w=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),k=1-Tt(s,l,a)),C.push(Rt[f]),C.push(Ft[f]),C.push(Ht[f])):137===f?(0===m?(w=Tt(s,c,l),S=Tt(o,c,l),v=1-Tt(o,c,g),q=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l)):(w=1-Tt(o,l,c),S=1-Tt(s,l,c),v=Tt(s,g,c),q=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a)),C.push(Rt[f]),C.push(It[f]),C.push(Ft[f])):139===f?(4===m?(w=Tt(s,c,l),S=Tt(o,c,l),v=1-Tt(o,c,g),q=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l)):(w=1-Tt(o,l,c),S=1-Tt(s,l,c),v=Tt(s,g,c),q=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a)),C.push(Rt[f]),C.push(It[f]),C.push(Gt[f])):98===f?(0===m?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),E=Tt(o,g,a),y=1-Tt(o,l,a)):(w=Tt(s,c,l),S=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),E=1-Tt(s,a,g),y=Tt(s,a,l)),C.push(Rt[f]),C.push(It[f]),C.push(Ht[f])):99===f?(4===m?(w=1-Tt(o,l,c),S=1-Tt(s,l,c),x=Tt(s,g,c),v=Tt(o,g,c),E=Tt(o,g,a),y=1-Tt(o,l,a)):(w=Tt(s,c,l),S=Tt(o,c,l),x=1-Tt(o,c,g),v=1-Tt(s,c,g),E=1-Tt(s,a,g),y=Tt(s,a,l)),C.push(Rt[f]),C.push(It[f]),C.push(Ft[f])):38===f?(0===m?(S=1-Tt(o,l,c),x=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a)):(S=Tt(s,c,l),x=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l)),C.push(It[f]),C.push(Gt[f]),C.push(Ht[f])):39===f?(4===m?(S=1-Tt(o,l,c),x=Tt(o,g,c),q=Tt(o,g,a),E=Tt(s,g,a),y=1-Tt(s,l,a),k=1-Tt(o,l,a)):(S=Tt(s,c,l),x=1-Tt(s,c,g),q=1-Tt(s,a,g),E=1-Tt(o,a,g),y=Tt(o,a,l),k=Tt(s,a,l)),C.push(It[f]),C.push(Dt[f]),C.push(Ht[f])):85===f&&(w=1,S=0,x=1,v=0,q=0,E=1,y=0,k=1),(y<0||y>1||k<0||k>1||w<0||w>1||x<0||x>1||q<0||q>1||E<0||E>1)&&r.log("MarchingSquaresJS-isoBands: "+f+" "+b+" "+a+","+l+","+c+","+g+" "+m+" "+y+" "+k+" "+w+" "+S+" "+x+" "+v+" "+q+" "+E),p.cells[i][h]={cval:f,cval_real:b,flipped:m,topleft:y,topright:k,righttop:w,rightbottom:S,bottomright:x,bottomleft:v,leftbottom:q,lefttop:E,edges:C}}}}}return p}function Wt(t){for(var o=[],e=t.rows,r=t.cols,u=[],n=0;n<e;n++)for(var p=0;p<r;p++)if("undefined"!==typeof t.cells[n][p]&&t.cells[n][p].edges.length>0){var s=t.cells[n][p],i=Zt(s),h=null,f=p,a=n;null!==i&&u.push([i.p[0]+f,i.p[1]+a]);do{if(h=$t(t.cells[a][f],i.x,i.y,i.o),null===h)break;if(u.push([h.p[0]+f,h.p[1]+a]),f+=h.x,a+=h.y,i=h,a<0||a>=e||f<0||f>=r||"undefined"===typeof t.cells[a][f]){f-=h.x,a-=h.y;var l=Xt(t,f,a,h.x,h.y,h.o);if(null===l)break;l.path.forEach((function(t){u.push(t)})),f=l.i,a=l.j,i=l}}while("undefined"!==typeof t.cells[a][f]&&t.cells[a][f].edges.length>0);o.push(u),u=[],t.cells[n][p].edges.length>0&&p--}return o}function Xt(t,o,e,u,n,p){var s=t.cells[e][o],i=s.cval_real,h=o+u,f=e+n,a=[],l=!1;while(!l){if("undefined"===typeof t.cells[f]||"undefined"===typeof t.cells[f][h])if(f-=n,h-=u,s=t.cells[f][h],i=s.cval_real,-1===n)if(0===p)if(i&C)a.push([h,f]),u=-1,n=0,p=0;else{if(!(i&q)){a.push([h+s.bottomright,f]),u=0,n=1,p=1,l=!0;break}a.push([h+1,f]),u=1,n=0,p=0}else{if(!(i&C)){if(i&q){a.push([h+s.bottomright,f]),u=0,n=1,p=1,l=!0;break}a.push([h+s.bottomleft,f]),u=0,n=1,p=0,l=!0;break}a.push([h,f]),u=-1,n=0,p=0}else if(1===n)if(0===p){if(!(i&E)){if(i&S){a.push([h+s.topleft,f+1]),u=0,n=-1,p=0,l=!0;break}a.push([h+s.topright,f+1]),u=0,n=-1,p=1,l=!0;break}a.push([h+1,f+1]),u=1,n=0,p=1}else a.push([h+1,f+1]),u=1,n=0,p=1;else if(-1===u)if(0===p){if(!(i&S)){if(i&C){a.push([h,f+s.leftbottom]),u=1,n=0,p=0,l=!0;break}a.push([h,f+s.lefttop]),u=1,n=0,p=1,l=!0;break}a.push([h,f+1]),u=0,n=1,p=0}else{if(!(i&S)){r.log("MarchingSquaresJS-isoBands: wtf");break}a.push([h,f+1]),u=0,n=1,p=0}else{if(1!==u){r.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===p){if(!(i&q)){a.push([h+1,f+s.rightbottom]),u=-1,n=0,p=0,l=!0;break}a.push([h+1,f]),u=0,n=-1,p=1}else{if(!(i&q)){if(i&E){a.push([h+1,f+s.righttop]),u=-1,n=0,p=1;break}a.push([h+1,f+s.rightbottom]),u=-1,n=0,p=0,l=!0;break}a.push([h+1,f]),u=0,n=-1,p=1}}else if(s=t.cells[f][h],i=s.cval_real,-1===u)if(0===p)if("undefined"!==typeof t.cells[f-1]&&"undefined"!==typeof t.cells[f-1][h])u=0,n=-1,p=1;else{if(!(i&C)){a.push([h+s.bottomright,f]),u=0,n=1,p=1,l=!0;break}a.push([h,f])}else{if(!(i&S)){r.log("MarchingSquaresJS-isoBands: found entry from top at "+h+","+f);break}r.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===u){if(0===p){r.log("MarchingSquaresJS-isoBands: wtf");break}if("undefined"!==typeof t.cells[f+1]&&"undefined"!==typeof t.cells[f+1][h])u=0,n=1,p=0;else{if(!(i&E)){a.push([h+s.topleft,f+1]),u=0,n=-1,p=0,l=!0;break}a.push([h+1,f+1]),u=1,n=0,p=1}}else if(-1===n){if(1!==p){r.log("MarchingSquaresJS-isoBands: wtf");break}if("undefined"!==typeof t.cells[f][h+1])u=1,n=0,p=1;else{if(!(i&q)){a.push([h+1,f+s.righttop]),u=-1,n=0,p=1,l=!0;break}a.push([h+1,f]),u=0,n=-1,p=1}}else{if(1!==n){r.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==p){r.log("MarchingSquaresJS-isoBands: wtf");break}if("undefined"!==typeof t.cells[f][h-1])u=-1,n=0,p=0;else{if(!(i&S)){a.push([h,f+s.leftbottom]),u=1,n=0,p=0,l=!0;break}a.push([h,f+1]),u=0,n=1,p=0}}if(h+=u,f+=n,h===o&&f===e)break}return{path:a,i:h,j:f,x:u,y:n,o:p}}function Yt(t,o){delete t.edges[o];for(var e=o+1;e<t.edges.length;e++)t.edges[e-1]=t.edges[e];t.edges.pop()}function Zt(t){if(t.edges.length>0){var o=t.edges[t.edges.length-1],e=t.cval_real;switch(o){case 0:return e&E?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return e&q?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return e&q?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return e&C?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return e&E?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return e&q?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return e&q?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return e&C?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return e&q?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return e&C?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return e&C?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return e&S?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return e&q?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return e&C?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return e&C?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return e&S?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return e&q?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return e&S?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return e&C?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return e&S?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return e&S?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return e&E?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return e&S?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return e&E?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:r.log("MarchingSquaresJS-isoBands: edge index out of range!"),r.log(t);break}}return null}function $t(t,o,e,u){var n,p,s,i,h,f=t.cval;switch(o){case-1:switch(u){case 0:n=It[f],s=z[f],i=R[f],h=I[f];break;default:n=Rt[f],s=N[f],i=A[f],h=_[f];break}break;case 1:switch(u){case 0:n=Gt[f],s=V[f],i=W[f],h=X[f];break;default:n=Ht[f],s=Q[f],i=T[f],h=U[f];break}break;default:switch(e){case-1:switch(u){case 0:n=Kt[f],s=M[f],i=B[f],h=J[f];break;default:n=Lt[f],s=j[f],i=P[f],h=O[f];break}break;case 1:switch(u){case 0:n=Ft[f],s=D[f],i=F[f],h=G[f];break;default:n=Dt[f],s=H[f],i=K[f],h=L[f];break}break}break}if(p=t.edges.indexOf(n),"undefined"===typeof t.edges[p])return null;switch(Yt(t,p),f=t.cval_real,n){case 0:f&E?(o=t.topleft,e=1):(o=1,e=t.righttop);break;case 1:f&q?(o=1,e=t.rightbottom):(o=t.topleft,e=1);break;case 2:f&q?(o=t.topleft,e=1):(o=t.bottomright,e=0);break;case 3:f&C?(o=t.bottomleft,e=0):(o=t.topleft,e=1);break;case 4:f&E?(o=t.topright,e=1):(o=1,e=t.righttop);break;case 5:f&q?(o=1,e=t.rightbottom):(o=t.topright,e=1);break;case 6:f&q?(o=t.topright,e=1):(o=t.bottomright,e=0);break;case 7:f&C?(o=t.bottomleft,e=0):(o=t.topright,e=1);break;case 8:f&q?(o=1,e=t.righttop):(o=t.bottomright,e=0);break;case 9:f&C?(o=t.bottomleft,e=0):(o=1,e=t.righttop);break;case 10:f&C?(o=1,e=t.righttop):(o=0,e=t.leftbottom);break;case 11:f&S?(o=0,e=t.lefttop):(o=1,e=t.righttop);break;case 12:f&q?(o=1,e=t.rightbottom):(o=t.bottomright,e=0);break;case 13:f&C?(o=t.bottomleft,e=0):(o=1,e=t.rightbottom);break;case 14:f&C?(o=1,e=t.rightbottom):(o=0,e=t.leftbottom);break;case 15:f&S?(o=0,e=t.lefttop):(o=1,e=t.rightbottom);break;case 16:f&q?(o=0,e=t.leftbottom):(o=t.bottomright,e=0);break;case 17:f&S?(o=0,e=t.lefttop):(o=t.bottomright,e=0);break;case 18:f&C?(o=t.bottomleft,e=0):(o=0,e=t.leftbottom);break;case 19:f&S?(o=0,e=t.lefttop):(o=t.bottomleft,e=0);break;case 20:f&S?(o=0,e=t.leftbottom):(o=t.topleft,e=1);break;case 21:f&E?(o=t.topright,e=1):(o=0,e=t.leftbottom);break;case 22:f&S?(o=0,e=t.lefttop):(o=t.topleft,e=1);break;case 23:f&E?(o=t.topright,e=1):(o=0,e=t.lefttop);break;default:return r.log("MarchingSquaresJS-isoBands: edge index out of range!"),r.log(t),null}return"undefined"!==typeof o&&"undefined"!==typeof e&&"undefined"!==typeof s&&"undefined"!==typeof i&&"undefined"!==typeof h||(r.log("MarchingSquaresJS-isoBands: undefined value!"),r.log(t),r.log(o+" "+e+" "+s+" "+i+" "+h)),{p:[o,e],x:s,y:i,o:h}}function to(t){var o=[],e=0;return t.cells.forEach((function(t,u){t.forEach((function(t,n){if("undefined"!==typeof t){var p=Qt[t.cval](t);"object"===typeof p&&Ut(p)?"object"===typeof p[0]&&Ut(p[0])?"object"===typeof p[0][0]&&Ut(p[0][0])?p.forEach((function(t){t.forEach((function(t){t[0]+=n,t[1]+=u})),o[e++]=t})):(p.forEach((function(t){t[0]+=n,t[1]+=u})),o[e++]=p):r.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):r.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),o}function oo(t,o,e){if(e=e||{},!h.isObject(e))throw new Error("options is invalid");var r=e.zProperty||"elevation",u=e.commonProperties||{},n=e.breaksProperties||[];if(i.collectionOf(t,"Point","Input must contain Points"),!o)throw new Error("breaks is required");if(!Array.isArray(o))throw new Error("breaks is not an Array");if(!h.isObject(u))throw new Error("commonProperties is not an Object");if(!Array.isArray(n))throw new Error("breaksProperties is not an Array");var p=y(t,{zProperty:r,flip:!0}),s=eo(p,o,r);s=ro(s,p,t);var f=s.map((function(t,o){if(n[o]&&!h.isObject(n[o]))throw new Error("Each mappedProperty is required to be an Object");var e=d["default"]({},u,n[o]);e[r]=t[r];var p=h.multiPolygon(t.groupedRings,e);return p}));return h.featureCollection(f)}function eo(t,o,e){for(var r=[],u=1;u<o.length;u++){var n=+o[u-1],p=+o[u],s=w(t,n,p-n),i=uo(s),h=no(i),f={};f["groupedRings"]=h,f[e]=n+"-"+p,r.push(f)}return r}function ro(t,o,e){var r=c["default"](e),u=r[2]-r[0],n=r[3]-r[1],p=r[0],s=r[1],i=o[0].length-1,h=o.length-1,f=u/i,a=n/h,l=function(t){t[0]=t[0]*f+p,t[1]=t[1]*a+s};return t.forEach((function(t){t.groupedRings.forEach((function(t){t.forEach((function(t){t.forEach(l)}))}))})),t}function uo(t){var o=[],e=[];t.forEach((function(t){var r=g["default"](h.polygon([t]));e.push(r),o.push({ring:t,area:r})})),e.sort((function(t,o){return o-t}));var r=[];return e.forEach((function(t){for(var e=0;e<o.length;e++)if(o[e].area===t){r.push(o[e].ring),o.splice(e,1);break}})),r}function no(t){var o=t.map((function(t){return{lrCoordinates:t,grouped:!1}})),e=[];while(!so(o))for(var r=0;r<o.length;r++)if(!o[r].grouped){var u=[];u.push(o[r].lrCoordinates),o[r].grouped=!0;for(var n=h.polygon([o[r].lrCoordinates]),p=r+1;p<o.length;p++)if(!o[p].grouped){var s=h.polygon([o[p].lrCoordinates]);po(s,n)&&(u.push(o[p].lrCoordinates),o[p].grouped=!0)}e.push(u)}return e}function po(t,o){for(var e=m["default"](t),r=0;r<e.features.length;r++)if(!b["default"](e.features[r],o))return!1;return!0}function so(t){for(var o=0;o<t.length;o++)if(!1===t[o].grouped)return!1;return!0}Qt[1]=Qt[169]=Y,Qt[4]=Qt[166]=Z,Qt[16]=Qt[154]=$,Qt[64]=Qt[106]=tt,Qt[168]=Qt[2]=ot,Qt[162]=Qt[8]=et,Qt[138]=Qt[32]=rt,Qt[42]=Qt[128]=ut,Qt[5]=Qt[165]=nt,Qt[20]=Qt[150]=pt,Qt[80]=Qt[90]=st,Qt[65]=Qt[105]=it,Qt[160]=Qt[10]=ht,Qt[130]=Qt[40]=ft,Qt[85]=at,Qt[101]=Qt[69]=lt,Qt[149]=Qt[21]=ct,Qt[86]=Qt[84]=gt,Qt[89]=Qt[81]=bt,Qt[96]=Qt[74]=mt,Qt[24]=Qt[146]=dt,Qt[6]=Qt[164]=yt,Qt[129]=Qt[41]=kt,Qt[66]=Qt[104]=vt,Qt[144]=Qt[26]=xt,Qt[36]=Qt[134]=wt,Qt[9]=Qt[161]=St,Qt[37]=Qt[133]=Et,Qt[148]=Qt[22]=qt,Qt[82]=Qt[88]=Ct,Qt[73]=Qt[97]=Mt,Qt[145]=Qt[25]=Bt,Qt[70]=Qt[100]=Jt,Qt[34]=function(t){return[ut(t),et(t)]},Qt[35]=jt,Qt[136]=function(t){return[rt(t),ot(t)]},Qt[153]=function(t){return[$(t),Y(t)]},Qt[102]=function(t){return[Z(t),tt(t)]},Qt[155]=Pt,Qt[103]=Ot,Qt[152]=function(t){return[$(t),ot(t)]},Qt[156]=Nt,Qt[137]=function(t){return[rt(t),Y(t)]},Qt[139]=At,Qt[98]=function(t){return[et(t),tt(t)]},Qt[99]=_t,Qt[38]=function(t){return[Z(t),ut(t)]},Qt[39]=zt,t.exports=oo,t.exports["default"]=oo}}]);