/** * SmartEarth WebSDK - https://websdk.terra-it.cn * Version 5.3.1 */ import{a as Ft,b as Lt}from"./chunk-FNJ2A2P5.js";import{a as Pt}from"./chunk-6MN6BBPN.js";import{a as tt}from"./chunk-NJVIDNJ6.js";import"./chunk-EZRSLM27.js";import{a as Ht}from"./chunk-LSAUAD4X.js";import{a as rt}from"./chunk-563CJZT3.js";import"./chunk-ZPW6H6BB.js";import{b as $,g as Gt,i as St}from"./chunk-HMXXHGCW.js";import"./chunk-NFDMGE7Q.js";import{b as V,c as Et,d as Nt,e as kt}from"./chunk-VDZXURWO.js";import{a as x}from"./chunk-UEFEFMYS.js";import"./chunk-YGIPMXAD.js";import"./chunk-PZ34T7DL.js";import"./chunk-5HWP5DW7.js";import{a as T}from"./chunk-3K67FZLU.js";import{e as b}from"./chunk-55TU6MJR.js";function y(){T.throwInstantiationError()}Object.defineProperties(y.prototype,{errorEvent:{get:T.throwInstantiationError},credit:{get:T.throwInstantiationError},tilingScheme:{get:T.throwInstantiationError},hasWaterMask:{get:T.throwInstantiationError},hasVertexNormals:{get:T.throwInstantiationError},availability:{get:T.throwInstantiationError}});var _t=[];y.getRegularGridIndices=function(t,i){if(t*i>=x.FOUR_GIGABYTES)throw new T("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=_t[t];b(n)||(_t[t]=n=[]);let o=n[i];return b(o)||(t*i=x.FOUR_GIGABYTES)throw new T("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=Vt[t];b(n)||(Vt[t]=n=[]);let o=n[i];if(!b(o)){let a=y.getRegularGridIndices(t,i),r=Rt(t,i),e=r.westIndicesSouthToNorth,c=r.southIndicesEastToWest,d=r.eastIndicesNorthToSouth,I=r.northIndicesWestToEast;o=n[i]={indices:a,westIndicesSouthToNorth:e,southIndicesEastToWest:c,eastIndicesNorthToSouth:d,northIndicesWestToEast:I}}return o};var Bt=[];y.getRegularGridAndSkirtIndicesAndEdgeIndices=function(t,i){if(t*i>=x.FOUR_GIGABYTES)throw new T("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=Bt[t];b(n)||(Bt[t]=n=[]);let o=n[i];if(!b(o)){let a=t*i,r=(t-1)*(i-1)*6,e=t*2+i*2,c=Math.max(0,e-4)*6,d=a+e,I=r+c,g=Rt(t,i),H=g.westIndicesSouthToNorth,O=g.southIndicesEastToWest,p=g.eastIndicesNorthToSouth,h=g.northIndicesWestToEast,N=rt.createTypedArray(d,I);Yt(t,i,N,0),y.addSkirtIndices(H,O,p,h,a,N,r),o=n[i]={indices:N,westIndicesSouthToNorth:H,southIndicesEastToWest:O,eastIndicesNorthToSouth:p,northIndicesWestToEast:h,indexCountWithoutSkirts:r}}return o};y.addSkirtIndices=function(t,i,n,o,a,r,e){let c=a;e=st(t,c,r,e),c+=t.length,e=st(i,c,r,e),c+=i.length,e=st(n,c,r,e),c+=n.length,st(o,c,r,e)};function Rt(t,i){let n=new Array(i),o=new Array(t),a=new Array(i),r=new Array(t),e;for(e=0;eMath.min(r[0],e[0])&&t[0]<=Math.max(r[0],e[0])&&t[1]<=Math.max(r[1],e[1])&&r[0]!==e[0]&&(a=(t[0]-r[0])*(e[1]-r[1])/(e[0]-r[0])+r[1],(r[1]===e[1]||t[1]<=a)&&n++),r=e;return n%2!==0}function ue(t,i,n,o){let a=(t.x-n.x)*(i.y-n.y)-(t.y-n.y)*(i.x-n.x),r=(t.x-o.x)*(i.y-o.y)-(t.y-o.y)*(i.x-o.x);if(a*r>=0)return!1;let e=(n.x-t.x)*(o.y-t.y)-(n.y-t.y)*(o.x-t.x),c=e+a-r;if(e*c>=0)return!1;let d=e/(r-a),I=d*(i.x-t.x),g=d*(i.y-t.y);return{x:t.x+I,y:t.y+g}}function le(t,i){let n=t.flattenPolygonHeight||[1],o=t.flattenPolygon||[],a=-65565,r=t.quantizedVertices,e=r.length/3,c=t.octEncodedNormals,d=t.westIndices.length+t.eastIndices.length+t.southIndices.length+t.northIndices.length,I=t.includeWebMercatorT,g=t.exaggeration,H=t.exaggerationRelativeHeight,p=g!==1,h=St.clone(t.rectangle),N=h.west,k=h.south,G=h.east,M=h.north;q.length=0,et.length=0;let E=!1,w=[[N,k],[G,k],[G,M],[N,M]];for(let s=0;s