!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).predicates={})}(this,(function(t){"use strict";const n=11102230246251565e-32,e=134217729,o=(3+8*n)*n;function r(t,n,e,o,r){let f,s,u,i,a=n[0],c=o[0],l=0,b=0;c>a==c>-a?(f=a,a=n[++l]):(f=c,c=o[++b]);let h=0;if(la==c>-a?(s=a+f,u=f-(s-a),a=n[++l]):(s=c+f,u=f-(s-c),c=o[++b]),f=s,0!==u&&(r[h++]=u);la==c>-a?(s=f+a,i=s-f,u=f-(s-i)+(a-i),a=n[++l]):(s=f+c,i=s-f,u=f-(s-i)+(c-i),c=o[++b]),f=s,0!==u&&(r[h++]=u);for(;lnt||-_>nt?_:function(t,n,s,T,q,C,D,E,G,H,I,J,K){let L,N,O,P,Q,R,S,U,V,W,X,Y,Z,$,_,tt,nt,et,ot,rt,ft,st,ut,it;const at=t-H,ct=T-H,lt=D-H,bt=n-I,ht=q-I,dt=E-I,Mt=s-J,pt=C-J,yt=G-J;rt=ct*dt,Y=e*ct,Z=Y-(Y-ct),$=ct-Z,Y=e*dt,_=Y-(Y-dt),tt=dt-_,ft=$*tt-(rt-Z*_-$*_-Z*tt),st=lt*ht,Y=e*lt,Z=Y-(Y-lt),$=lt-Z,Y=e*ht,_=Y-(Y-ht),tt=ht-_,ut=$*tt-(st-Z*_-$*_-Z*tt),nt=ft-ut,X=ft-nt,a[0]=ft-(nt+X)+(X-ut),et=rt+nt,X=et-rt,ot=rt-(et-X)+(nt-X),nt=ot-st,X=ot-nt,a[1]=ot-(nt+X)+(X-st),it=et+nt,X=it-et,a[2]=et-(it-X)+(nt-X),a[3]=it,rt=lt*bt,Y=e*lt,Z=Y-(Y-lt),$=lt-Z,Y=e*bt,_=Y-(Y-bt),tt=bt-_,ft=$*tt-(rt-Z*_-$*_-Z*tt),st=at*dt,Y=e*at,Z=Y-(Y-at),$=at-Z,Y=e*dt,_=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t>=gt)return xt;const mt=z(N,Q,ct,ht,lt,dt,b,h),Tt=z(O,R,lt,dt,at,bt,d,M),jt=z(P,S,at,bt,ct,ht,p,y),wt=r(Tt,d,jt,y,x);L=v(L,f(wt,x,Mt,A),A);const At=r(jt,p,mt,h,g);L=v(L,f(At,g,pt,A),A);const Ft=r(mt,b,Tt,M,m);return L=v(L,f(Ft,m,yt,A),A),0!==U&&(L=v(L,f(4,a,U,F),F),L=v(L,f(wt,x,U,A),A)),0!==V&&(L=v(L,f(4,c,V,F),F),L=v(L,f(At,g,V,A),A)),0!==W&&(L=v(L,f(4,l,W,F),F),L=v(L,f(Ft,m,W,A),A)),0!==N&&(0!==R&&(L=B(L,N,R,yt,W)),0!==S&&(L=B(L,-N,S,pt,V))),0!==O&&(0!==S&&(L=B(L,O,S,Mt,U)),0!==Q&&(L=B(L,-O,Q,yt,W))),0!==P&&(0!==Q&&(L=B(L,P,Q,pt,V)),0!==R&&(L=B(L,-P,R,Mt,U))),k[L-1]}(t,n,s,T,q,C,D,E,G,H,I,J,tt)},t.orient3dfast=function(t,n,e,o,r,f,s,u,i,a,c,l){const b=n-c,h=r-c,d=u-c,M=e-l,p=f-l,y=i-l;return(t-a)*(h*y-p*d)+(o-a)*(d*M-y*b)+(s-a)*(b*p-M*h)}}));