@arcgis/core 5.2.0-next.152 → 5.2.0-next.154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/arcade/containerUtils.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  3. package/arcade/functions/feature.js +1 -1
  4. package/arcade/functions/featuresetstring.js +1 -1
  5. package/arcade/functions/geomasync.js +1 -1
  6. package/arcade/functions/portal.js +1 -1
  7. package/arcade/functions/string.js +1 -1
  8. package/arcgisGlobal.d.ts +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/05b34302da58e8244da3.js +1 -0
  11. package/assets/esri/core/workers/chunks/47e250d471d0e55fa6be.js +1 -0
  12. package/assets/esri/core/workers/chunks/{a07cb6a2f5b66d4e9f15.js → 53e2f2b922116a45fe8f.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{dc486a3595b6d57018bb.js → 5bfea0c55aca826de536.js} +1 -1
  14. package/assets/esri/core/workers/chunks/67ebc5a3d46b254b725c.js +1 -0
  15. package/assets/esri/core/workers/chunks/{6e62581d933e7298d1f6.js → 6f4e6022a52de0c54aab.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{8c4e0a7384e40979cb42.js → 7e0cf70c0eb5a2ddfcec.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{3cc43ae56779a9f97f77.js → 917f53833b853898facc.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{9232f57623e1fa3ccabc.js → be5f92e98d09d6e6e38e.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{a7f3576208f295b670d6.js → c19cd5a03b6d480fe53b.js} +1 -1
  20. package/assets/esri/core/workers/chunks/d33360c4f85203edafff.js +1 -0
  21. package/assets/esri/core/workers/chunks/{dca35dbe427605ef6fcc.js → e01aeac34474540f61ee.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{b19b6102ed2d6f67b43b.js → e15ba90af0faf873b42d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/eb815148ae65388dd733.js +1 -0
  24. package/assets/esri/core/workers/chunks/ee6679ef9efa1504e7eb.js +1 -0
  25. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  26. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  27. package/chunks/lyr3DMain.js +1 -1
  28. package/chunks/lyr3DWorker.js +2 -2
  29. package/chunks/portal.js +1 -1
  30. package/config.js +1 -1
  31. package/form/elements/inputs/DynamicChoiceInput.d.ts +4 -2
  32. package/geometry/support/meshUtils.d.ts +5 -6
  33. package/interfaces.d.ts +1 -1
  34. package/kernel.js +1 -1
  35. package/layers/FeatureLayer.d.ts +2 -2
  36. package/layers/GeospatialPDFLayer.d.ts +154 -4
  37. package/layers/Layer.d.ts +2 -0
  38. package/layers/SketchLayer.d.ts +4 -2
  39. package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
  40. package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
  41. package/layers/geospatialPDF/projectionToWKTUtils.js +2 -2
  42. package/layers/support/LabelClass.d.ts +3 -2
  43. package/layers/support/PortalItemData.d.ts +31 -8
  44. package/layers/support/{TimeSeriesCalculation.d.ts → TimeSeriesCalculationMethod.d.ts} +6 -6
  45. package/layers/support/{TimeSeriesCalculation.js → TimeSeriesCalculationMethod.js} +1 -1
  46. package/layers/support/TimeSeriesInfo.d.ts +5 -5
  47. package/layers/support/TimeSeriesInfo.js +1 -1
  48. package/layers/support/timeSeriesUtils.d.ts +6 -2
  49. package/layers/support/timeSeriesUtils.js +1 -1
  50. package/layers/support/types.d.ts +4 -1
  51. package/package.json +2 -2
  52. package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
  53. package/smartMapping/statistics/support/timeSeriesUtils.js +1 -1
  54. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  55. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
  56. package/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl.js +2 -2
  57. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  58. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  59. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  60. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  61. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  62. package/views/draw/plugins/MultipointPlugin.js +1 -1
  63. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  64. package/assets/esri/core/workers/chunks/21f45a47708e6e43147f.js +0 -1
  65. package/assets/esri/core/workers/chunks/2ecfaa715863216f0faf.js +0 -1
  66. package/assets/esri/core/workers/chunks/3e8eb158320f0e4ce1b6.js +0 -1
  67. package/assets/esri/core/workers/chunks/7320a4913b6cad7cc5d7.js +0 -1
  68. package/assets/esri/core/workers/chunks/9e142551163acf752618.js +0 -1
  69. package/assets/esri/core/workers/chunks/f095cf98940e3f95d51e.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2343],{2343(e,r,t){async function n(e={}){var r,t=e,n=!!globalThis.window,o=!!globalThis.WorkerGlobalScope;globalThis.process?.versions?.node&&globalThis.process;var a,i,s="./this.program",l="";if(n||o){try{l=new URL(".","").href}catch{}o&&(i=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),a=async e=>{var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw Error(r.status+" : "+r.url)}}var u,d=console.log.bind(console),c=console.error.bind(console),f=!1;class h{}class m extends h{}var p,v,w,g=!1;function y(){var e=Ye.buffer;D=new Int8Array(e),b=new Int16Array(e),t.HEAPU8=R=new Uint8Array(e),t.HEAPU16=P=new Uint16Array(e),F=new Int32Array(e),t.HEAPU32=C=new Uint32Array(e),t.HEAPF32=A=new Float32Array(e),t.HEAPF64=S=new Float64Array(e),T=new BigInt64Array(e),x=new BigUint64Array(e)}function E(e){t.onAbort?.(e),c(e=`Aborted(${e})`),f=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw v?.(r),r}async function k(e,r,t){if(!e)try{var n=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(e){c(`wasm streaming compile failed: ${e}`),c("falling back to ArrayBuffer instantiation")}return async function(e,r){try{var t=await async function(e){if(!u)try{var r=await a(e);return new Uint8Array(r)}catch{}return function(e){if(e==w&&u)return new Uint8Array(u);if(i)return i(e);throw"both async and sync fetching of the wasm failed"}(e)}(e);return await WebAssembly.instantiate(t,r)}catch(e){c(`failed to asynchronously prepare wasm: ${e}`),E(e)}}(r,t)}class _{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var b,F,T,D,A,S,P,C,x,R,M=e=>{for(;e.length>0;)e.shift()(t)},N=[],z=e=>N.push(e),B=[],$=e=>B.push(e),I=!0,W=e=>Ge(e),j=()=>Ke();class O{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){C[this.ptr+4>>2]=e}get_type(){return C[this.ptr+4>>2]}set_destructor(e){C[this.ptr+8>>2]=e}get_destructor(){return C[this.ptr+8>>2]}set_caught(e){e=+!!e,D[this.ptr+12]=e}get_caught(){return 0!=D[this.ptr+12]}set_rethrown(e){e=+!!e,D[this.ptr+13]=e}get_rethrown(){return 0!=D[this.ptr+13]}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){C[this.ptr+16>>2]=e}get_adjusted_ptr(){return C[this.ptr+16>>2]}}var U=()=>{var e=F[me.varargs>>2];return me.varargs+=4,e},L=U,H={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=H.isAbs(e),t="/"===e.slice(-1);return!(e=H.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=H.splitPath(e),t=r[0],n=r[1];return t||n?(n&&=n.slice(0,-1),t+n):"."},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>H.normalize(e.join("/")),join2:(e,r)=>H.normalize(e+"/"+r)},V=e=>(V=e=>(crypto.getRandomValues(e),0))(e),q={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:fe.cwd();if("string"!=typeof o)throw TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=H.isAbs(o)}return r=H.normalizeArray(r.split("/").filter(e=>!!e),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=q.resolve(e).slice(1),r=q.resolve(r).slice(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},X=globalThis.TextDecoder&&new TextDecoder,G=(e,r,t,n)=>{var o=r+t;if(n)return o;for(;e[r]&&!(r>=o);)++r;return r},K=(e,r=0,t,n)=>{var o=G(e,r,t,n);if(o-r>16&&e.buffer&&X)return X.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var l=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&e[r++])<65536)a+=String.fromCharCode(i);else{var u=i-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},Y=[],J=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Q=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.codePointAt(i);if(s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s,i++}}return r[t]=0,t-o},Z=(e,r,t)=>{var n=J(e)+1,o=Array(n);return o.length=Q(e,o,0,o.length),o},ee={ttys:[],init(){},shutdown(){},register(e,r){ee.ttys[e]={input:[],output:[],ops:r},fe.registerDevice(e,ee.stream_ops)},stream_ops:{open(e){var r=ee.ttys[e.node.rdev];if(!r)throw new fe.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new fe.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch{throw new fe.ErrnoError(29)}if(void 0===s&&0===a)throw new fe.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new fe.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch{throw new fe.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!Y.length){var e=null;if(globalThis.window?.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n"),!e)return null;Y=Z(e)}return Y.shift()})(),put_char(e,r){null===r||10===r?(d(K(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(d(K(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(c(K(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(c(K(e.output)),e.output=[])}}},re=e=>{E()},te={ops_table:null,mount:e=>te.createNode(null,"/",16895,0),createNode(e,r,t,n){if(fe.isBlkdev(t)||fe.isFIFO(t))throw new fe.ErrnoError(63);te.ops_table||={dir:{node:{getattr:te.node_ops.getattr,setattr:te.node_ops.setattr,lookup:te.node_ops.lookup,mknod:te.node_ops.mknod,rename:te.node_ops.rename,unlink:te.node_ops.unlink,rmdir:te.node_ops.rmdir,readdir:te.node_ops.readdir,symlink:te.node_ops.symlink},stream:{llseek:te.stream_ops.llseek}},file:{node:{getattr:te.node_ops.getattr,setattr:te.node_ops.setattr},stream:{llseek:te.stream_ops.llseek,read:te.stream_ops.read,write:te.stream_ops.write,mmap:te.stream_ops.mmap,msync:te.stream_ops.msync}},link:{node:{getattr:te.node_ops.getattr,setattr:te.node_ops.setattr,readlink:te.node_ops.readlink},stream:{}},chrdev:{node:{getattr:te.node_ops.getattr,setattr:te.node_ops.setattr},stream:fe.chrdev_stream_ops}};var o=fe.createNode(e,r,t,n);return fe.isDir(o.mode)?(o.node_ops=te.ops_table.dir.node,o.stream_ops=te.ops_table.dir.stream,o.contents={}):fe.isFile(o.mode)?(o.node_ops=te.ops_table.file.node,o.stream_ops=te.ops_table.file.stream,o.usedBytes=0,o.contents=te.emptyFileContents??=new Uint8Array):fe.isLink(o.mode)?(o.node_ops=te.ops_table.link.node,o.stream_ops=te.ops_table.link.stream):fe.isChrdev(o.mode)&&(o.node_ops=te.ops_table.chrdev.node,o.stream_ops=te.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),e&&(e.contents[r]=o,e.atime=e.mtime=e.ctime=o.atime),o},getFileDataAsTypedArray:e=>e.contents.subarray(0,e.usedBytes),expandFileStorage(e,r){var t=e.contents.length;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),t&&(r=Math.max(r,256));var n=te.getFileDataAsTypedArray(e);e.contents=new Uint8Array(r),e.contents.set(n)}},resizeFileStorage(e,r){if(e.usedBytes!=r){var t=e.contents;e.contents=new Uint8Array(r),e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=fe.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,r.size=fe.isDir(e.mode)?4096:fe.isFile(e.mode)?e.usedBytes:fe.isLink(e.mode)?e.link.length:0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(let t of["mode","atime","mtime","ctime"])null!=r[t]&&(e[t]=r[t]);void 0!==r.size&&te.resizeFileStorage(e,r.size)},lookup(e,r){throw te.doesNotExistError||(te.doesNotExistError=new fe.ErrnoError(44),te.doesNotExistError.stack="<generic error, no stack>"),te.doesNotExistError},mknod:(e,r,t,n)=>te.createNode(e,r,t,n),rename(e,r,t){var n;try{n=fe.lookupNode(r,t)}catch{}if(n){if(fe.isDir(e.mode))for(var o in n.contents)throw new fe.ErrnoError(55);fe.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){for(var t in fe.lookupNode(e,r).contents)throw new fe.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.contents)],symlink(e,r,t){var n=te.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!fe.isLink(e.mode))throw new fe.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);return r.set(a.subarray(o,o+i),t),i},write(e,r,t,n,o,a){if(r.buffer===D.buffer&&(a=!1),!n)return 0;var i=e.node;return i.mtime=i.ctime=Date.now(),a?(i.contents=r.subarray(t,t+n),i.usedBytes=n):0===i.usedBytes&&0===o?(i.contents=r.slice(t,t+n),i.usedBytes=n):(te.expandFileStorage(i,o+n),i.contents.set(r.subarray(t,t+n),o),i.usedBytes=Math.max(i.usedBytes,o+n)),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&fe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new fe.ErrnoError(28);return n},mmap(e,r,t,n,o){if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||s.buffer!==D.buffer){if(i=!0,!(a=re()))throw new fe.ErrnoError(48);s&&((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),D.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(te.stream_ops.write(e,r,0,n,t,!1),0)}},ne=e=>("string"==typeof e&&(e=Z(e)),e.subarray||(e=new Uint8Array(e)),e),oe=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ae=(...e)=>fe.createDataFile(...e),ie=0,se=null,le=e=>{if(ie--,t.monitorRunDependencies?.(ie),0==ie&&se){var r=se;se=null,r()}},ue=e=>{ie++,t.monitorRunDependencies?.(ie)},de=[],ce=async(e,r,t,n,o,i,s,l)=>{var u=r?q.resolve(H.join2(e,r)):e;ue();try{var d=t;"string"==typeof t&&(d=await(async e=>{var r=await a(e);return new Uint8Array(r)})(t)),d=await(async(e,r)=>{for(var t of(typeof Browser<"u"&&Browser.init(),de))if(t.canHandle(r))return t.handle(e,r);return e})(d,u),l?.(),i||ae(e,r,d,n,o,s)}finally{le()}},fe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,ErrnoError:class{name="ErrnoError";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||=this,this.parent=e,this.mount=e.mount,this.id=fe.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return fe.isDir(this.mode)}get isDevice(){return fe.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new fe.ErrnoError(44);r.follow_mount??=!0,H.isAbs(e)||(e=fe.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter(e=>!!e),o=fe.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&r.parent)break;if("."!==n[i]){if(".."===n[i]){if(a=H.dirname(a),fe.isRoot(o)){e=a+"/"+n.slice(i+1).join("/"),t--;continue e}o=o.parent;continue}a=H.join2(a,n[i]);try{o=fe.lookupNode(o,n[i])}catch(e){if(44===e?.errno&&s&&r.noent_okay)return{path:a};throw e}if(fe.isMountpoint(o)&&(!s||r.follow_mount)&&(o=o.mounted.root),fe.isLink(o.mode)&&(!s||r.follow)){if(!o.node_ops.readlink)throw new fe.ErrnoError(52);var l=o.node_ops.readlink(o);H.isAbs(l)||(l=H.dirname(a)+"/"+l),e=l+"/"+n.slice(i+1).join("/");continue e}}}return{path:a,node:o}}throw new fe.ErrnoError(32)},getPath(e){for(var r;;){if(fe.isRoot(e)){var t=e.mount.mountpoint;return r?"/"===t[t.length-1]?t+r:`${t}/${r}`:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%fe.nameTable.length},hashAddNode(e){var r=fe.hashName(e.parent.id,e.name);e.name_next=fe.nameTable[r],fe.nameTable[r]=e},hashRemoveNode(e){var r=fe.hashName(e.parent.id,e.name);if(fe.nameTable[r]===e)fe.nameTable[r]=e.name_next;else for(var t=fe.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=fe.mayLookup(e);if(t)throw new fe.ErrnoError(t);for(var n=fe.hashName(e.id,r),o=fe.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return fe.lookup(e,r)},createNode(e,r,t,n){var o=new fe.FSNode(e,r,t,n);return fe.hashAddNode(o),o},destroyNode(e){fe.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>fe.ignorePermissions?0:r.includes("r")&&!(292&e.mode)||r.includes("w")&&!(146&e.mode)||r.includes("x")&&!(73&e.mode)?2:0,mayLookup:e=>fe.isDir(e.mode)?fe.nodePermissions(e,"x")||(e.node_ops.lookup?0:2):54,mayCreate(e,r){if(!fe.isDir(e.mode))return 54;try{return fe.lookupNode(e,r),20}catch{}return fe.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=fe.lookupNode(e,r)}catch(e){return e.errno}var o=fe.nodePermissions(e,"wx");if(o)return o;if(t){if(!fe.isDir(n.mode))return 54;if(fe.isRoot(n)||fe.getPath(n)===fe.cwd())return 10}else if(fe.isDir(n.mode))return 31;return 0},mayOpen(e,r){if(!e)return 44;if(fe.isLink(e.mode))return 32;var t=fe.flagsToPermissionString(r);return fe.isDir(e.mode)&&("r"!==t||576&r)?31:fe.nodePermissions(e,t)},checkOpExists(e,r){if(!e)throw new fe.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=fe.MAX_OPEN_FDS;e++)if(!fe.streams[e])return e;throw new fe.ErrnoError(33)},getStreamChecked(e){var r=fe.getStream(e);if(!r)throw new fe.ErrnoError(8);return r},getStream:e=>fe.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new fe.FSStream,e),-1==r&&(r=fe.nextfd()),e.fd=r,fe.streams[r]=e,e),closeStream(e){fe.streams[e]=null},dupStream(e,r=-1){var t=fe.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,o=n?e:r;n??=r.node_ops.setattr,fe.checkOpExists(n,63);try{n(o,t)}catch(e){throw e instanceof RangeError?new fe.ErrnoError(22):e}},chrdev_stream_ops:{open(e){e.stream_ops=fe.getDevice(e.node.rdev).stream_ops,e.stream_ops.open?.(e)},llseek(){throw new fe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){fe.devices[e]={stream_ops:r}},getDevice:e=>fe.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),fe.syncFSRequests++,fe.syncFSRequests>1&&c(`warning: ${fe.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=fe.getMounts(fe.root.mount),n=0;function o(e){return fe.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}for(var i of t)i.type.syncfs?i.type.syncfs(i,e,a):a(null)},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&fe.root)throw new fe.ErrnoError(10);if(!o&&!a){var i=fe.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,fe.isMountpoint(n))throw new fe.ErrnoError(10);if(!fe.isDir(n.mode))throw new fe.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?fe.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=fe.lookupPath(e,{follow_mount:!1});if(!fe.isMountpoint(r.node))throw new fe.ErrnoError(28);var t=r.node,n=t.mounted,o=fe.getMounts(n);for(var[a,i]of Object.entries(fe.nameTable))for(;i;){var s=i.name_next;o.includes(i.mount)&&fe.destroyNode(i),i=s}t.mounted=null;var l=t.mount.mounts.indexOf(n);t.mount.mounts.splice(l,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=fe.lookupPath(e,{parent:!0}).node,o=H.basename(e);if(!o)throw new fe.ErrnoError(28);if("."===o||".."===o)throw new fe.ErrnoError(20);var a=fe.mayCreate(n,o);if(a)throw new fe.ErrnoError(a);if(!n.node_ops.mknod)throw new fe.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},statfs:e=>fe.statfsNode(fe.lookupPath(e,{follow:!0}).node),statfsStream:e=>fe.statfsNode(e.node),statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:fe.nextInode,ffree:fe.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create:(e,r=438)=>(r&=4095,r|=32768,fe.mknod(e,r,0)),mkdir:(e,r=511)=>(r&=1023,r|=16384,fe.mknod(e,r,0)),mkdirTree(e,r){var t=e.split("/"),n="";for(var o of t)if(o){(n||H.isAbs(e))&&(n+="/"),n+=o;try{fe.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,fe.mknod(e,r,t)),symlink(e,r){if(!q.resolve(e))throw new fe.ErrnoError(44);var t=fe.lookupPath(r,{parent:!0}).node;if(!t)throw new fe.ErrnoError(44);var n=H.basename(r),o=fe.mayCreate(t,n);if(o)throw new fe.ErrnoError(o);if(!t.node_ops.symlink)throw new fe.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n=H.dirname(e),o=H.dirname(r),a=H.basename(e),i=H.basename(r),s=fe.lookupPath(e,{parent:!0}),l=s.node;if(t=(s=fe.lookupPath(r,{parent:!0})).node,!l||!t)throw new fe.ErrnoError(44);if(l.mount!==t.mount)throw new fe.ErrnoError(75);var u,d=fe.lookupNode(l,a),c=q.relative(e,o);if("."!==c.charAt(0))throw new fe.ErrnoError(28);if("."!==(c=q.relative(r,n)).charAt(0))throw new fe.ErrnoError(55);try{u=fe.lookupNode(t,i)}catch{}if(d!==u){var f=fe.isDir(d.mode),h=fe.mayDelete(l,a,f);if(h||(h=u?fe.mayDelete(t,i,f):fe.mayCreate(t,i)))throw new fe.ErrnoError(h);if(!l.node_ops.rename)throw new fe.ErrnoError(63);if(fe.isMountpoint(d)||u&&fe.isMountpoint(u))throw new fe.ErrnoError(10);if(t!==l&&(h=fe.nodePermissions(l,"w")))throw new fe.ErrnoError(h);fe.hashRemoveNode(d);try{l.node_ops.rename(d,t,i),d.parent=t}catch(e){throw e}finally{fe.hashAddNode(d)}}},rmdir(e){var r=fe.lookupPath(e,{parent:!0}).node,t=H.basename(e),n=fe.lookupNode(r,t),o=fe.mayDelete(r,t,!0);if(o)throw new fe.ErrnoError(o);if(!r.node_ops.rmdir)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);r.node_ops.rmdir(r,t),fe.destroyNode(n)},readdir(e){var r=fe.lookupPath(e,{follow:!0}).node;return fe.checkOpExists(r.node_ops.readdir,54)(r)},unlink(e){var r=fe.lookupPath(e,{parent:!0}).node;if(!r)throw new fe.ErrnoError(44);var t=H.basename(e),n=fe.lookupNode(r,t),o=fe.mayDelete(r,t,!1);if(o)throw new fe.ErrnoError(o);if(!r.node_ops.unlink)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);r.node_ops.unlink(r,t),fe.destroyNode(n)},readlink(e){var r=fe.lookupPath(e).node;if(!r)throw new fe.ErrnoError(44);if(!r.node_ops.readlink)throw new fe.ErrnoError(28);return r.node_ops.readlink(r)},stat(e,r){var t=fe.lookupPath(e,{follow:!r}).node;return fe.checkOpExists(t.node_ops.getattr,63)(t)},fstat(e){var r=fe.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,o=n?r:t;return n??=t.node_ops.getattr,fe.checkOpExists(n,63),n(o)},lstat:e=>fe.stat(e,!0),doChmod(e,r,t,n){fe.doSetAttr(e,r,{mode:4095&t|-4096&r.mode,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n="string"==typeof e?fe.lookupPath(e,{follow:!t}).node:e;fe.doChmod(null,n,r,t)},lchmod(e,r){fe.chmod(e,r,!0)},fchmod(e,r){var t=fe.getStreamChecked(e);fe.doChmod(t,t.node,r,!1)},doChown(e,r,t){fe.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var o="string"==typeof e?fe.lookupPath(e,{follow:!n}).node:e;fe.doChown(null,o,n)},lchown(e,r,t){fe.chown(e,r,t,!0)},fchown(e,r,t){var n=fe.getStreamChecked(e);fe.doChown(n,n.node,!1)},doTruncate(e,r,t){if(fe.isDir(r.mode))throw new fe.ErrnoError(31);if(!fe.isFile(r.mode))throw new fe.ErrnoError(28);var n=fe.nodePermissions(r,"w");if(n)throw new fe.ErrnoError(n);fe.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new fe.ErrnoError(28);var t="string"==typeof e?fe.lookupPath(e,{follow:!0}).node:e;fe.doTruncate(null,t,r)},ftruncate(e,r){var t=fe.getStreamChecked(e);if(r<0||!(2097155&t.flags))throw new fe.ErrnoError(28);fe.doTruncate(t,t.node,r)},utime(e,r,t){var n=fe.lookupPath(e,{follow:!0}).node;fe.checkOpExists(n.node_ops.setattr,63)(n,{atime:r,mtime:t})},open(e,r,t=438){if(""===e)throw new fe.ErrnoError(44);var n,o;if(r=(e=>{if("string"!=typeof e)return e;var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw Error(`Unknown file open mode: ${e}`);return r})(r),t=64&r?4095&t|32768:0,"object"==typeof e)n=e;else{o=e.endsWith("/");var a=fe.lookupPath(e,{follow:!(131072&r),noent_okay:!0});n=a.node,e=a.path}var i=!1;if(64&r)if(n){if(128&r)throw new fe.ErrnoError(20)}else{if(o)throw new fe.ErrnoError(31);n=fe.mknod(e,511|t,0),i=!0}if(!n)throw new fe.ErrnoError(44);if(fe.isChrdev(n.mode)&&(r&=-513),65536&r&&!fe.isDir(n.mode))throw new fe.ErrnoError(54);if(!i){var s=fe.mayOpen(n,r);if(s)throw new fe.ErrnoError(s)}512&r&&!i&&fe.truncate(n,0),r&=-131713;var l=fe.createStream({node:n,path:fe.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),i&&fe.chmod(n,511&t),l},close(e){if(fe.isClosed(e))throw new fe.ErrnoError(8);e.getdents&&=null;try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{fe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(fe.isClosed(e))throw new fe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new fe.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new fe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new fe.ErrnoError(28);if(fe.isClosed(e)||1==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.read)throw new fe.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new fe.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new fe.ErrnoError(28);if(fe.isClosed(e)||!(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.write)throw new fe.ErrnoError(28);e.seekable&&1024&e.flags&&fe.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new fe.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags)||1==(2097155&e.flags))throw new fe.ErrnoError(2);if(!e.stream_ops.mmap)throw new fe.ErrnoError(43);if(!r)throw new fe.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new fe.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){r.flags=r.flags??0,r.encoding=r.encoding??"binary","utf8"!==r.encoding&&"binary"!==r.encoding&&E(`Invalid encoding type "${r.encoding}"`);var t=fe.open(e,r.flags),n=fe.stat(e).size,o=new Uint8Array(n);return fe.read(t,o,0,n,0),"utf8"===r.encoding&&(o=K(o)),fe.close(t),o},writeFile(e,r,t={}){t.flags=t.flags??577;var n=fe.open(e,t.flags,t.mode);r=ne(r),fe.write(n,r,0,r.byteLength,void 0,t.canOwn),fe.close(n)},cwd:()=>fe.currentPath,chdir(e){var r=fe.lookupPath(e,{follow:!0});if(null===r.node)throw new fe.ErrnoError(44);if(!fe.isDir(r.node.mode))throw new fe.ErrnoError(54);var t=fe.nodePermissions(r.node,"x");if(t)throw new fe.ErrnoError(t);fe.currentPath=r.path},createDefaultDirectories(){fe.mkdir("/tmp"),fe.mkdir("/home"),fe.mkdir("/home/web_user")},createDefaultDevices(){fe.mkdir("/dev"),fe.registerDevice(fe.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n,llseek:()=>0}),fe.mkdev("/dev/null",fe.makedev(1,3)),ee.register(fe.makedev(5,0),ee.default_tty_ops),ee.register(fe.makedev(6,0),ee.default_tty1_ops),fe.mkdev("/dev/tty",fe.makedev(5,0)),fe.mkdev("/dev/tty1",fe.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(V(e),r=e.byteLength),e[--r]);fe.createDevice("/dev","random",t),fe.createDevice("/dev","urandom",t),fe.mkdir("/dev/shm"),fe.mkdir("/dev/shm/tmp")},createSpecialDirectories(){fe.mkdir("/proc");var e=fe.mkdir("/proc/self");fe.mkdir("/proc/self/fd"),fe.mount({mount(){var r=fe.createNode(e,"fd",16895,73);return r.stream_ops={llseek:te.stream_ops.llseek},r.node_ops={lookup(e,r){var t=+r,n=fe.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(fe.streams.entries()).filter(([e,r])=>r).map(([e,r])=>e.toString())},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?fe.createDevice("/dev","stdin",e):fe.symlink("/dev/tty","/dev/stdin"),r?fe.createDevice("/dev","stdout",null,r):fe.symlink("/dev/tty","/dev/stdout"),t?fe.createDevice("/dev","stderr",null,t):fe.symlink("/dev/tty1","/dev/stderr"),fe.open("/dev/stdin",0),fe.open("/dev/stdout",1),fe.open("/dev/stderr",1)},staticInit(){fe.nameTable=Array(4096),fe.mount(te,{},"/"),fe.createDefaultDirectories(),fe.createDefaultDevices(),fe.createSpecialDirectories(),fe.filesystems={MEMFS:te}},init(e,r,n){fe.initialized=!0,e??=t.stdin,r??=t.stdout,n??=t.stderr,fe.createStandardStreams(e,r,n)},quit(){for(var e of(fe.initialized=!1,fe.streams))e&&fe.close(e)},findObject(e,r){var t=fe.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=fe.lookupPath(e,{follow:!r})).path}catch{}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=fe.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=H.basename(e),n=fe.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:fe.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=H.join2(e,a);try{fe.mkdir(i)}catch(e){if(20!=e.errno)throw e}e=i}}return i},createFile(e,r,t,n,o){var a=H.join2("string"==typeof e?e:fe.getPath(e),r),i=oe(n,o);return fe.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:fe.getPath(e),i=r?H.join2(e,r):e);var s=oe(n,o),l=fe.create(i,s);if(t){t=ne(t),fe.chmod(l,146|s);var u=fe.open(l,577);fe.write(u,t,0,t.length,0,a),fe.close(u),fe.chmod(l,s)}},createDevice(e,r,t,n){var o=H.join2("string"==typeof e?e:fe.getPath(e),r),a=oe(!!t,!!n);fe.createDevice.major??=64;var i=fe.makedev(fe.createDevice.major++,0);return fe.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch{throw new fe.ErrnoError(29)}if(void 0===l&&0===i)throw new fe.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.atime=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch{throw new fe.ErrnoError(29)}return o&&(e.node.mtime=e.node.ctime=Date.now()),i}}),fe.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(globalThis.XMLHttpRequest)E("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{e.contents=i(e.url)}catch{throw new fe.ErrnoError(29)}},createLazyFile(e,r,t,n,a){class i{lengthKnown=!1;chunks=[];get(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;e.open("HEAD",t,!1),e.send(null),e.status>=200&&e.status<300||304===e.status||E("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=(e,r)=>{e>r&&E(`invalid range (${e}, ${r}) or no bytes requested!`),r>n-1&&E(`only ${n} bytes available! programmer error!`);var o=new XMLHttpRequest;return o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),o.status>=200&&o.status<300||304===o.status||E("Couldn't load "+t+". Status: "+o.status),void 0===o.response?Z(o.responseText??""):new Uint8Array(o.response||[])},l=this;l.setDataGetter(e=>{var r=e*i,t=(e+1)*i-1;return t=Math.min(t,n-1),void 0===l.chunks[e]&&(l.chunks[e]=s(r,t)),void 0===l.chunks[e]&&E("doXHR failed!"),l.chunks[e]}),(a||!n)&&(i=n=1,n=this.getter(0).length,i=n,d("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(globalThis.XMLHttpRequest){o||E("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var s={isDevice:!1,contents:new i}}else s={isDevice:!1,url:t};var l=fe.createFile(e,r,s,n,a);s.contents?l.contents=s.contents:s.url&&(l.contents=null,l.url=s.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={};for(let[e,r]of Object.entries(l.stream_ops))u[e]=(...e)=>(fe.forceLoadFile(l),r(...e));function c(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return u.read=(e,r,t,n,o)=>(fe.forceLoadFile(l),c(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{fe.forceLoadFile(l);var a=re();if(!a)throw new fe.ErrnoError(48);return c(e,D,a,r,t),{ptr:a,allocated:!0}},l.stream_ops=u,l}},he=(e,r,t)=>e?K(R,e,r,t):"",me={currentUmask:18,calculateAt(e,r,t){if(H.isAbs(r))return r;var n=-100===e?fe.cwd():me.getStreamFromFD(e).path;if(0==r.length){if(!t)throw new fe.ErrnoError(44);return n}return n+"/"+r},writeStat(e,r){C[e>>2]=r.dev,C[e+4>>2]=r.mode,C[e+8>>2]=r.nlink,C[e+12>>2]=r.uid,C[e+16>>2]=r.gid,C[e+20>>2]=r.rdev,T[e+24>>3]=BigInt(r.size),F[e+32>>2]=4096,F[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),o=r.ctime.getTime();return T[e+40>>3]=BigInt(Math.floor(t/1e3)),C[e+48>>2]=t%1e3*1e3*1e3,T[e+56>>3]=BigInt(Math.floor(n/1e3)),C[e+64>>2]=n%1e3*1e3*1e3,T[e+72>>3]=BigInt(Math.floor(o/1e3)),C[e+80>>2]=o%1e3*1e3*1e3,T[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){C[e+4>>2]=r.bsize,C[e+60>>2]=r.bsize,T[e+8>>3]=BigInt(r.blocks),T[e+16>>3]=BigInt(r.bfree),T[e+24>>3]=BigInt(r.bavail),T[e+32>>3]=BigInt(r.files),T[e+40>>3]=BigInt(r.ffree),C[e+48>>2]=r.fsid,C[e+64>>2]=r.flags,C[e+56>>2]=r.namelen},doMsync(e,r,t,n,o){if(!fe.isFile(r.node.mode))throw new fe.ErrnoError(43);if(2&n)return 0;var a=R.slice(e,e+t);fe.msync(r,a,o,t,n)},getStreamFromFD:e=>fe.getStreamChecked(e),varargs:void 0,getStr:e=>he(e)},pe={},ve=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function we(e){return this.fromWireType(C[e>>2])}var ge={},ye={},Ee={},ke=class extends Error{constructor(e){super(e),this.name="InternalError"}},_e=e=>{throw new ke(e)},be=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&_e("Mismatched type converter count");for(var o=0;o<e.length;++o)Ae(e[o],n[o])}e.forEach(e=>Ee[e]=r);var o=Array(r.length),a=[],i=0;for(let[e,t]of r.entries())ye.hasOwnProperty(t)?o[e]=ye[t]:(a.push(t),ge.hasOwnProperty(t)||(ge[t]=[]),ge[t].push(()=>{o[e]=ye[t],++i===a.length&&n(o)}));0===a.length&&n(o)},Fe=e=>{for(var r="";;){var t=R[e++];if(!t)return r;r+=String.fromCharCode(t)}},Te=class extends Error{constructor(e){super(e),this.name="BindingError"}},De=e=>{throw new Te(e)};function Ae(e,r,t={}){return function(e,r,t={}){var n=r.name;if(e||De(`type "${n}" must have a positive integer typeid pointer`),ye.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;De(`Cannot register type '${n}' twice`)}if(ye[e]=r,delete Ee[e],ge.hasOwnProperty(e)){var o=ge[e];delete ge[e],o.forEach(e=>e())}}(e,r,t)}var Se=(e,r,t)=>{switch(r){case 1:return t?e=>D[e]:e=>R[e];case 2:return t?e=>b[e>>1]:e=>P[e>>1];case 4:return t?e=>F[e>>2]:e=>C[e>>2];case 8:return t?e=>T[e>>3]:e=>x[e>>3];default:throw TypeError(`invalid integer width (${r}): ${e}`)}},Pe=[],Ce=[0,1,,1,null,1,!0,1,!1,1],xe=e=>{e>9&&0===--Ce[e+1]&&(Ce[e],Ce[e]=void 0,Pe.push(e))},Re={toValue:e=>(e||De(`Cannot use deleted val. handle = ${e}`),Ce[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=Pe.pop()||Ce.length;return Ce[r]=e,Ce[r+1]=1,r}}}},Me={name:"emscripten::val",fromWireType:e=>{var r=Re.toValue(e);return xe(e),r},toWireType:(e,r)=>Re.toHandle(r),readValueFromPointer:we,destructorFunction:null},Ne=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(A[e>>2])};case 8:return function(e){return this.fromWireType(S[e>>3])};default:throw TypeError(`invalid float width (${r}): ${e}`)}},ze=(e,r)=>Object.defineProperty(r,"name",{value:e}),Be=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||De(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},$e=(e,r,n)=>{t.hasOwnProperty(e)?((void 0===n||void 0!==t[e].overloadTable&&void 0!==t[e].overloadTable[n])&&De(`Cannot register public name '${e}' twice`),Be(t,e,e),t[e].overloadTable.hasOwnProperty(n)&&De(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),t[e].overloadTable[n]=r):(t[e]=r,t[e].argCount=n)},Ie=(e,r,n)=>{t.hasOwnProperty(e)||_e("Replacing nonexistent public symbol"),void 0!==t[e].overloadTable&&void 0!==n?t[e].overloadTable[n]=r:(t[e]=r,t[e].argCount=n)},We=[],je=e=>{var r=We[e];return r||(We[e]=r=Je.get(e)),r},Oe=(e,r,t=!1)=>{e=Fe(e);var n=je(r);return"function"!=typeof n&&De(`unknown function pointer with signature ${e}: ${r}`),n};class Ue extends Error{}var Le,He,Ve,qe,Xe,Ge,Ke,Ye,Je,Qe=e=>{var r=He(e),t=Fe(r);return qe(r),t},Ze=(e,r,t)=>Q(e,R,r,t),er=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,rr=(e,r,t)=>{var n=e>>1,o=G(P,n,r/2,t);if(o-n>16&&er)return er.decode(P.subarray(n,o));for(var a="",i=n;i<o;++i){var s=P[i];a+=String.fromCharCode(s)}return a},tr=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);b[r>>1]=i,r+=2}return b[r>>1]=0,r-n},nr=e=>2*e.length,or=(e,r,t)=>{for(var n="",o=e>>2,a=0;!(a>=r/4);a++){var i=C[o+a];if(!i&&!t)break;n+=String.fromCodePoint(i)}return n},ar=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.codePointAt(a);if(i>65535&&a++,F[r>>2]=i,(r+=4)+4>o)break}return F[r>>2]=0,r-n},ir=e=>{for(var r=0,t=0;t<e.length;++t)e.codePointAt(t)>65535&&t++,r+=4;return r},sr=[],lr=(e,r)=>{var t=ye[e];return void 0===t&&De(`${r} has unknown type ${Qe(e)}`),t},ur={},dr=e=>{var r=ur[e];return void 0===r?Fe(e):r},cr=(e,r)=>Math.ceil(e/r)*r,fr=e=>{var r=(e-Ye.buffer.byteLength+65535)/65536|0;try{return Ye.grow(r),y(),1}catch{}},hr={},mr=()=>{if(!mr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:s};for(var r in hr)void 0===hr[r]?delete e[r]:e[r]=hr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);mr.strings=t}return mr.strings},pr=[],vr=(e,r)=>{Je.set(e,r),We[e]=Je.get(e)},wr=e=>{let r=e.length;return[r%128|128,r>>7,...e]},gr={i:127,p:127,j:126,f:125,d:124,e:111},yr=e=>wr(Array.from(e,e=>gr[e]));if(fe.createPreloadedFile=(e,r,t,n,o,a,i,s,l,u)=>{ce(e,r,t,n,o,s,l,u).then(a).catch(i)},fe.preloadFile=ce,fe.staticInit(),t.noExitRuntime&&(I=t.noExitRuntime),t.preloadPlugins&&(de=t.preloadPlugins),t.print&&(d=t.print),t.printErr&&(c=t.printErr),t.wasmBinary&&(u=t.wasmBinary),t.arguments&&t.arguments,t.thisProgram&&(s=t.thisProgram),t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()();t.addRunDependency=ue,t.removeRunDependency=le,t.addFunction=(e,r)=>{var t=(e=>(Le||(Le=new WeakMap,((e,r)=>{if(Le)for(var t=0;t<0+r;t++){var n=je(t);n&&Le.set(n,t)}})(0,Je.length)),Le.get(e)||0))(e);if(t)return t;var n=pr.length?pr.pop():Je.grow(1);try{vr(n,e)}catch(t){if(!(t instanceof TypeError))throw t;vr(n,((e,r)=>{var t=Uint8Array.of(0,97,115,109,1,0,0,0,1,...wr([1,96,...yr(r.slice(1)),...yr("v"===r[0]?"":r[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),n=new WebAssembly.Module(t);return new WebAssembly.Instance(n,{e:{f:e}}).exports.f})(e,r))}return Le.set(e,n),n},t.UTF8ToString=he,t.FS_preloadFile=ce,t.FS_unlink=(...e)=>fe.unlink(...e),t.FS_createPath=(...e)=>fe.createPath(...e),t.FS_createDevice=(...e)=>fe.createDevice(...e),t.FS_createDataFile=ae,t.FS_createLazyFile=(...e)=>fe.createLazyFile(...e),t.Emval=Re;var Er={n:(e,r,t)=>{new O(e).init(r,t),E()},x:function(e,r,t){me.varargs=t;try{var n=me.getStreamFromFD(e);switch(r){case 0:if((o=U())<0)return-28;for(;fe.streams[o];)o++;return fe.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=U(),a=289792;return n.flags=n.flags&~a|o&a,0;case 12:return o=L(),b[o+0>>1]=2,0}return-28}catch(e){if(void 0===fe||"ErrnoError"!==e.name)throw e;return-e.errno}},M:function(e,r,t){me.varargs=t;try{var n=me.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=L();F[a>>2]=o.c_iflag||0,F[a+4>>2]=o.c_oflag||0,F[a+8>>2]=o.c_cflag||0,F[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)D[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=L();var s=F[a>>2],l=F[a+4>>2],u=F[a+8>>2],d=F[a+12>>2],c=[];for(i=0;i<32;i++)c.push(D[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:l,c_cflag:u,c_lflag:d,c_cc:c})}return 0;case 21519:return n.tty?(a=L(),F[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21537:case 21531:return a=L(),fe.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=L(),b[a>>1]=f[0],b[a+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===fe||"ErrnoError"!==e.name)throw e;return-e.errno}},N:function(e,r,t,n){me.varargs=n;try{r=me.getStr(r),r=me.calculateAt(e,r);var o=n?U():0;return 64&t&&(o&=~me.currentUmask),fe.open(r,t,o).fd}catch(e){if(void 0===fe||"ErrnoError"!==e.name)throw e;return-e.errno}},O:()=>E(""),A:e=>{var r=pe[e];delete pe[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map(e=>e.getterReturnType).concat(o.map(e=>e.setterArgumentType));be([e],a,e=>{var a={};for(var[i,s]of o.entries()){let r=e[i],t=s.getter,n=s.getterContext,l=e[i+o.length],u=s.setter,d=s.setterContext;a[s.fieldName]={read:e=>r.fromWireType(t(n,e)),write:(e,r)=>{var t=[];u(d,e,l.toWireType(t,r)),ve(t)},optional:r.optional}}return[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r)&&!a[o].optional)throw TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},readValueFromPointer:we,destructorFunction:n}]})},z:(e,r,t,n,o)=>{r=Fe(r);let a=0n===n,i=e=>e;if(a){let e=8*t;i=r=>BigInt.asUintN(e,r),o=i(o)}Ae(e,{name:r,fromWireType:i,toWireType:(e,r)=>("number"==typeof r&&(r=BigInt(r)),r),readValueFromPointer:Se(r,t,!a),destructorFunction:null})},T:(e,r,t,n)=>{Ae(e,{name:r=Fe(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},readValueFromPointer:function(e){return this.fromWireType(R[e])},destructorFunction:null})},R:e=>Ae(e,Me),y:(e,r,t)=>{Ae(e,{name:r=Fe(r),fromWireType:e=>e,toWireType:(e,r)=>r,readValueFromPointer:Ne(r,t),destructorFunction:null})},o:(e,r,t,n,o,a,i,s)=>{var l=((e,r)=>{for(var t=[],n=0;n<e;n++)t.push(C[r+4*n>>2]);return t})(r,t);e=(e=>{let r=(e=e.trim()).indexOf("(");return-1===r?e:e.slice(0,r)})(e=Fe(e)),o=Oe(n,o,i),$e(e,function(){((e,r)=>{var t=[],n={};throw r.forEach(function e(r){if(!n[r]&&!ye[r]){if(Ee[r])return void Ee[r].forEach(e);t.push(r),n[r]=!0}}),new Ue(`${e}: `+t.map(Qe).join([", "]))})(`Cannot call ${e} due to unbound types`,l)},r-1),be([],l,t=>{var n=[t[0],null].concat(t.slice(1));return Ie(e,function(e,r,t,n,o){var a=r.length;a<2&&De("argTypes array size mismatch! Must at least get return value and 'this' types!"),r[1];var i=function(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}(r),s=!r[0].isVoid,l=a-2,u=Array(l),d=[],c=[];return ze(e,function(...e){c.length=0,d.length=1,d[0]=o;for(var t=0;t<l;++t)u[t]=r[t+2].toWireType(c,e[t]),d.push(u[t]);return function(e){if(i)ve(c);else for(var t=2;t<r.length;t++){var n=1===t?void 0:u[t-2];null!==r[t].destructorFunction&&r[t].destructorFunction(n)}if(s)return r[0].fromWireType(e)}(n(...d))})}(e,n,0,o,a),r-1),[]})},d:(e,r,t,n,o)=>{r=Fe(r);let a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i,o=a(o)}Ae(e,{name:r,fromWireType:a,toWireType:(e,r)=>r,readValueFromPointer:Se(r,t,0!==n),destructorFunction:null})},b:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][r];function o(e){var r=C[e>>2],t=C[e+4>>2];return new n(D.buffer,t,r)}Ae(e,{name:t=Fe(t),fromWireType:o,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},S:(e,r)=>{Ae(e,{name:r=Fe(r),fromWireType(e){var r=C[e>>2],t=he(e+4,r,!0);return qe(e),t},toWireType(e,r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));var t,n="string"==typeof r;n||ArrayBuffer.isView(r)&&1==r.BYTES_PER_ELEMENT||De("Cannot pass non-string to std::string"),t=n?J(r):r.length;var o=Ve(4+t+1),a=o+4;return C[o>>2]=t,n?Ze(r,a,t+1):R.set(r,a),null!==e&&e.push(qe,o),o},readValueFromPointer:we,destructorFunction(e){qe(e)}})},t:(e,r,t)=>{var n,o,a;t=Fe(t),2===r?(n=rr,o=tr,a=nr):(n=or,o=ar,a=ir),Ae(e,{name:t,fromWireType:e=>{var t=C[e>>2],o=n(e+4,t*r,!0);return qe(e),o},toWireType:(e,n)=>{"string"!=typeof n&&De(`Cannot pass non-string to C++ string type ${t}`);var i=a(n),s=Ve(4+i+r);return C[s>>2]=i/r,o(n,s+4,i+r),null!==e&&e.push(qe,s),s},readValueFromPointer:we,destructorFunction(e){qe(e)}})},B:(e,r,t,n,o,a)=>{pe[e]={name:Fe(r),rawConstructor:Oe(t,n),rawDestructor:Oe(o,a),fields:[]}},c:(e,r,t,n,o,a,i,s,l,u)=>{pe[e].fields.push({fieldName:Fe(r),getterReturnType:t,getter:Oe(n,o),getterContext:a,setterArgumentType:i,setter:Oe(s,l),setterContext:u})},U:(e,r)=>{Ae(e,{isVoid:!0,name:r=Fe(r),fromWireType:()=>{},toWireType:(e,r)=>{}})},Q:e=>{do{var r=C[e>>2],t=C[(e+=4)>>2],n=C[(e+=4)>>2];e+=4;var o=he(r);fe.createPath("/",H.dirname(o)),fe.createDataFile(o,null,D.subarray(n,n+t),!0,!0,!0)}while(C[e>>2])},F:()=>{throw new m},W:(e,r)=>{e=Re.toValue(e),r=Re.toValue(r),e.set(r)},k:(e,r,t)=>{var[n,...o]=((e,r)=>{for(var t=Array(e),n=0;n<e;++n)t[n]=lr(C[r+4*n>>2],`parameter ${n}`);return t})(e,r),a=n.toWireType.bind(n),i=o.map(e=>e.readValueFromPointer.bind(e));e--;var s=Array(e);return(e=>{var r=sr.length;return sr.push(e),r})(ze(`methodCaller<(${o.map(e=>e.name)}) => ${n.name}>`,(r,n,o,l)=>{for(var u=0,d=0;d<e;++d)s[d]=i[d](l+u),u+=8;var c;switch(t){case 0:c=Re.toValue(r).apply(null,s);break;case 2:c=Reflect.construct(Re.toValue(r),s);break;case 3:c=s[0];break;case 1:c=Re.toValue(r)[dr(n)](...s)}return((e,r,t)=>{var n=[],o=e(n,t);return n.length&&(C[r>>2]=Re.toHandle(n)),o})(a,o,c)}))},a:xe,X:e=>e?(e=dr(e),Re.toHandle(globalThis[e])):Re.toHandle(globalThis),p:(e,r)=>(e=Re.toValue(e),r=Re.toValue(r),Re.toHandle(e[r])),j:e=>{e>9&&(Ce[e+1]+=1)},i:(e,r,t,n,o)=>sr[e](r,t,n,o),C:()=>Re.toHandle([]),m:e=>Re.toHandle(dr(e)),h:e=>{ve(Re.toValue(e)),xe(e)},V:(e,r,t)=>{e=Re.toValue(e),r=Re.toValue(r),t=Re.toValue(t),e[r]=t},H:(e,r,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),u=Math.max(s,l);C[e>>2]=60*u,F[r>>2]=Number(s!=l);var d=e=>{var r=e>=0?"-":"+",t=Math.abs(e);return`UTC${r}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=d(s),f=d(l);l<s?(Ze(c,t,17),Ze(f,n,17)):(Ze(c,n,17),Ze(f,t,17))},G:e=>{var r=R.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);if(o=Math.min(o,e+100663296),fr(Math.min(t,cr(Math.max(e,o),65536))))return!0}return!1},J:(e,r)=>{var t=0,n=0;for(var o of mr()){var a=r+t;C[e+n>>2]=a,t+=Ze(o,a,1/0)+1,n+=4}return 0},K:(e,r)=>{var t=mr();C[e>>2]=t.length;var n=0;for(var o of t)n+=J(o)+1;return C[r>>2]=n,0},P:(e,r)=>{(e=>{I||(t.onExit?.(e),f=!0),((e,r)=>{throw r})(0,new _(e))})(e)},v:function(e){try{var r=me.getStreamFromFD(e);return fe.close(r),0}catch(e){if(void 0===fe||"ErrnoError"!==e.name)throw e;return e.errno}},L:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=C[r>>2],i=C[r+4>>2];r+=8;var s=fe.read(e,D,a,i,void 0);if(s<0)return-1;if(n+=s,s<i)break}return n})(me.getStreamFromFD(e),r,t);return C[n>>2]=o,0}catch(e){if(void 0===fe||"ErrnoError"!==e.name)throw e;return e.errno}},I:function(e,r,t,n){r=(e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e))(r);try{if(isNaN(r))return 22;var o=me.getStreamFromFD(e);return fe.llseek(o,r,t),T[n>>3]=BigInt(o.position),o.getdents&&0===r&&0===t&&(o.getdents=null),0}catch(e){if(void 0===fe||"ErrnoError"!==e.name)throw e;return e.errno}},w:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=C[r>>2],i=C[r+4>>2];r+=8;var s=fe.write(e,D,a,i,void 0);if(s<0)return-1;if(n+=s,s<i)break}return n})(me.getStreamFromFD(e),r,t);return C[n>>2]=o,0}catch(e){if(void 0===fe||"ErrnoError"!==e.name)throw e;return e.errno}},q:function(e,r){var t=j();try{return je(e)(r)}catch(e){if(W(t),!(e instanceof h))throw e;Xe(1,0)}},l:function(e,r,t){var n=j();try{return je(e)(r,t)}catch(e){if(W(n),!(e instanceof h))throw e;Xe(1,0)}},r:function(e,r,t,n){var o=j();try{return je(e)(r,t,n)}catch(e){if(W(o),!(e instanceof h))throw e;Xe(1,0)}},u:function(e,r,t,n,o){var a=j();try{return je(e)(r,t,n,o)}catch(e){if(W(a),!(e instanceof h))throw e;Xe(1,0)}},E:function(e,r,t,n,o,a,i,s,l,u){var d=j();try{return je(e)(r,t,n,o,a,i,s,l,u)}catch(e){if(W(d),!(e instanceof h))throw e;Xe(1,0)}},s:function(e){var r=j();try{je(e)()}catch(e){if(W(r),!(e instanceof h))throw e;Xe(1,0)}},g:function(e,r){var t=j();try{je(e)(r)}catch(e){if(W(t),!(e instanceof h))throw e;Xe(1,0)}},D:function(e,r,t,n){var o=j();try{je(e)(r,t,n)}catch(e){if(W(o),!(e instanceof h))throw e;Xe(1,0)}},e:function(e,r,t){var n=j();try{je(e)(r,t)}catch(e){if(W(n),!(e instanceof h))throw e;Xe(1,0)}},f:function(e,r,t,n){var o=j();try{je(e)(r,t,n)}catch(e){if(W(o),!(e instanceof h))throw e;Xe(1,0)}}},kr=await async function(){function e(e,r){return function(e){He=e._,Ve=t._malloc=e.aa,qe=t._free=e.ba,Xe=e.ca,Ge=e.da,Ke=e.ea,Ye=e.Y,Je=e.$}(kr=e.exports),y(),kr}var r={a:Er};return t.instantiateWasm?new Promise((n,o)=>{t.instantiateWasm(r,(r,t)=>{n(e(r))})}):(w??=t.locateFile?function(e){return t.locateFile?t.locateFile(e,l):l+e}("lyr3DWorker.wasm"):new URL("lyr3DWorker.wasm","").href,function(r){return e(r.instance)}(await k(u,w,r)))}();return function e(){function r(){t.calledRun=!0,!f&&(g=!0,!t.noFSInit&&!fe.initialized&&fe.init(),kr.Z(),fe.ignorePermissions=!1,p?.(t),t.onRuntimeInitialized?.(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)z(t.postRun.shift());M(N)}())}ie>0?se=e:(function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)$(t.preRun.shift());M(B)}(),ie>0?se=e:t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),r()},1)):r())}(),r=g?t:new Promise((e,r)=>{p=e,v=r}),r}t.d(r,{default:()=>n})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6052],{96052(r,e,t){async function n(r={}){var e,t,n=r,a="./this.program",o="";try{o=new URL(".","").href}catch{}t=async r=>{var e=await fetch(r,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw Error(e.status+" : "+e.url)};var i,u,s,l,f=console.log.bind(console),c=console.error.bind(console),p=!1,h=!1;function v(){var r=pr.buffer;T=new Int8Array(r),m=new Int16Array(r),n.HEAPU8=P=new Uint8Array(r),n.HEAPU16=C=new Uint16Array(r),y=new Int32Array(r),n.HEAPU32=W=new Uint32Array(r),n.HEAPF32=b=new Float32Array(r),n.HEAPF64=A=new Float64Array(r),w=new BigInt64Array(r),F=new BigUint64Array(r)}function d(r){n.onAbort?.(r),c(r=`Aborted(${r})`),p=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw s?.(e),e}async function g(r,e,n){if(!r)try{var a=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(a,n)}catch(r){c(`wasm streaming compile failed: ${r}`),c("falling back to ArrayBuffer instantiation")}return async function(r,e){try{var n=await async function(r){if(!i)try{var e=await t(r);return new Uint8Array(e)}catch{}return function(r){if(r==l&&i)return new Uint8Array(i);throw"both async and sync fetching of the wasm failed"}(r)}(r);return await WebAssembly.instantiate(n,e)}catch(r){c(`failed to asynchronously prepare wasm: ${r}`),d(r)}}(e,n)}var m,y,w,T,b,A,C,W,F,P,E=r=>{for(;r.length>0;)r.shift()(n)},$=[],R=r=>$.push(r),x=[],V=r=>x.push(r);class _{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){W[this.ptr+4>>2]=r}get_type(){return W[this.ptr+4>>2]}set_destructor(r){W[this.ptr+8>>2]=r}get_destructor(){return W[this.ptr+8>>2]}set_caught(r){r=+!!r,T[this.ptr+12]=r}get_caught(){return 0!=T[this.ptr+12]}set_rethrown(r){r=+!!r,T[this.ptr+13]=r}get_rethrown(){return 0!=T[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){W[this.ptr+16>>2]=r}get_adjusted_ptr(){return W[this.ptr+16>>2]}}var I={},U=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function S(r){return this.fromWireType(W[r>>2])}var k={},H={},M={},D=class extends Error{constructor(r){super(r),this.name="InternalError"}},B=r=>{throw new D(r)},O=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&B("Mismatched type converter count");for(var a=0;a<r.length;++a)G(r[a],n[a])}r.forEach(r=>M[r]=e);var a=Array(e.length),o=[],i=0;for(let[r,t]of e.entries())H.hasOwnProperty(t)?a[r]=H[t]:(o.push(t),k.hasOwnProperty(t)||(k[t]=[]),k[t].push(()=>{a[r]=H[t],++i===o.length&&n(a)}));0===o.length&&n(a)},N={},j=r=>{for(var e="";;){var t=P[r++];if(!t)return e;e+=String.fromCharCode(t)}},L=class extends Error{constructor(r){super(r),this.name="BindingError"}},z=r=>{throw new L(r)};function G(r,e,t={}){return function(r,e,t={}){var n=e.name;if(r||z(`type "${n}" must have a positive integer typeid pointer`),H.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;z(`Cannot register type '${n}' twice`)}if(H[r]=e,delete M[r],k.hasOwnProperty(r)){var a=k[r];delete k[r],a.forEach(r=>r())}}(r,e,t)}var Y=(r,e,t)=>{switch(e){case 1:return t?r=>T[r]:r=>P[r];case 2:return t?r=>m[r>>1]:r=>C[r>>1];case 4:return t?r=>y[r>>2]:r=>W[r>>2];case 8:return t?r=>w[r>>3]:r=>F[r>>3];default:throw TypeError(`invalid integer width (${e}): ${r}`)}},q=[],J=[0,1,,1,null,1,!0,1,!1,1],K=r=>{r>9&&0===--J[r+1]&&(J[r],J[r]=void 0,q.push(r))},Q={toValue:r=>(r||z(`Cannot use deleted val. handle = ${r}`),J[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let e=q.pop()||J.length;return J[e]=r,J[e+1]=1,e}}}},X={name:"emscripten::val",fromWireType:r=>{var e=Q.toValue(r);return K(r),e},toWireType:(r,e)=>Q.toHandle(e),readValueFromPointer:S,destructorFunction:null},Z=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(b[r>>2])};case 8:return function(r){return this.fromWireType(A[r>>3])};default:throw TypeError(`invalid float width (${e}): ${r}`)}},rr=(r,e)=>Object.defineProperty(e,"name",{value:r}),er=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||z(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},tr=(r,e,t)=>{n.hasOwnProperty(r)?((void 0===t||void 0!==n[r].overloadTable&&void 0!==n[r].overloadTable[t])&&z(`Cannot register public name '${r}' twice`),er(n,r,r),n[r].overloadTable.hasOwnProperty(t)&&z(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),n[r].overloadTable[t]=e):(n[r]=e,n[r].argCount=t)},nr=(r,e,t)=>{n.hasOwnProperty(r)||B("Replacing nonexistent public symbol"),void 0!==n[r].overloadTable&&void 0!==t?n[r].overloadTable[t]=e:(n[r]=e,n[r].argCount=t)},ar=[],or=r=>{var e=ar[r];return e||(ar[r]=e=hr.get(r)),e},ir=(r,e,t=!1)=>{r=j(r);var n=or(e);return"function"!=typeof n&&z(`unknown function pointer with signature ${r}: ${e}`),n};class ur extends Error{}var sr,lr,fr,cr,pr,hr,vr=r=>{var e=lr(r),t=j(e);return cr(e),t},dr=(r,e,t)=>((r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,o=t+n-1,i=0;i<r.length;++i){var u=r.codePointAt(i);if(u<=127){if(t>=o)break;e[t++]=u}else if(u<=2047){if(t+1>=o)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=o)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=o)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u,i++}}return e[t]=0,t-a})(r,P,e,t),gr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},mr=globalThis.TextDecoder&&new TextDecoder,yr=(r,e,t,n)=>{var a=e+t;if(n)return a;for(;r[e]&&!(e>=a);)++e;return e},wr=(r,e=0,t,n)=>{var a=yr(r,e,t,n);if(a-e>16&&r.buffer&&mr)return mr.decode(r.subarray(e,a));for(var o="";e<a;){var i=r[e++];if(128&i){var u=63&r[e++];if(192!=(224&i)){var s=63&r[e++];if((i=224==(240&i)?(15&i)<<12|u<<6|s:(7&i)<<18|u<<12|s<<6|63&r[e++])<65536)o+=String.fromCharCode(i);else{var l=i-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&i)<<6|u)}else o+=String.fromCharCode(i)}return o},Tr=(r,e,t)=>r?wr(P,r,e,t):"",br=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Ar=(r,e,t)=>{var n=r>>1,a=yr(C,n,e/2,t);if(a-n>16&&br)return br.decode(C.subarray(n,a));for(var o="",i=n;i<a;++i){var u=C[i];o+=String.fromCharCode(u)}return o},Cr=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,a=(t-=2)<2*r.length?t/2:r.length,o=0;o<a;++o){var i=r.charCodeAt(o);m[e>>1]=i,e+=2}return m[e>>1]=0,e-n},Wr=r=>2*r.length,Fr=(r,e,t)=>{for(var n="",a=r>>2,o=0;!(o>=e/4);o++){var i=W[a+o];if(!i&&!t)break;n+=String.fromCodePoint(i)}return n},Pr=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,a=n+t-4,o=0;o<r.length;++o){var i=r.codePointAt(o);if(i>65535&&o++,y[e>>2]=i,(e+=4)+4>a)break}return y[e>>2]=0,e-n},Er=r=>{for(var e=0,t=0;t<r.length;++t)r.codePointAt(t)>65535&&t++,e+=4;return e},$r=[],Rr=(r,e)=>{var t=H[r];return void 0===t&&z(`${e} has unknown type ${vr(r)}`),t},xr={},Vr=r=>{var e=xr[r];return void 0===e?j(r):e},_r=(r,e)=>Math.ceil(r/e)*e,Ir=r=>{var e=(r-pr.buffer.byteLength+65535)/65536|0;try{return pr.grow(e),v(),1}catch{}},Ur={},Sr=()=>{if(!Sr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:a};for(var e in Ur)void 0===Ur[e]?delete r[e]:r[e]=Ur[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);Sr.strings=t}return Sr.strings},kr=[null,[],[]],Hr=(r,e)=>{var t=kr[r];0===e||10===e?((1===r?f:c)(wr(t)),t.length=0):t.push(e)},Mr=[],Dr=(r,e)=>{hr.set(r,e),ar[r]=hr.get(r)},Br=r=>{let e=r.length;return[e%128|128,e>>7,...r]},Or={i:127,p:127,j:126,f:125,d:124,e:111},Nr=r=>Br(Array.from(r,r=>Or[r]));if(n.noExitRuntime&&n.noExitRuntime,n.print&&(f=n.print),n.printErr&&(c=n.printErr),n.wasmBinary&&(i=n.wasmBinary),n.arguments&&n.arguments,n.thisProgram&&(a=n.thisProgram),n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.shift()();n.addFunction=(r,e)=>{var t=(r=>(sr||(sr=new WeakMap,((r,e)=>{if(sr)for(var t=0;t<0+e;t++){var n=or(t);n&&sr.set(n,t)}})(0,hr.length)),sr.get(r)||0))(r);if(t)return t;var n=Mr.length?Mr.pop():hr.grow(1);try{Dr(n,r)}catch(t){if(!(t instanceof TypeError))throw t;Dr(n,((r,e)=>{var t=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Br([1,96,...Nr(e.slice(1)),...Nr("v"===e[0]?"":e[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),n=new WebAssembly.Module(t);return new WebAssembly.Instance(n,{e:{f:r}}).exports.f})(r,e))}return sr.set(r,n),n},n.UTF8ToString=Tr,n.Emval=Q;var jr={h:(r,e,t)=>{new _(r).init(e,t),d()},E:()=>d(""),r:r=>{var e=I[r];delete I[r];var t=e.elements,n=t.length,a=t.map(r=>r.getterReturnType).concat(t.map(r=>r.setterArgumentType)),o=e.rawConstructor,i=e.rawDestructor;O([r],a,r=>{for(let[e,a]of t.entries()){let t=r[e],o=a.getter,i=a.getterContext,u=r[e+n],s=a.setter,l=a.setterContext;a.read=r=>t.fromWireType(o(i,r)),a.write=(r,e)=>{var t=[];s(l,r,u.toWireType(t,e)),U(t)}}return[{name:e.name,fromWireType:r=>{for(var e=Array(n),a=0;a<n;++a)e[a]=t[a].read(r);return i(r),e},toWireType:(r,a)=>{if(n!==a.length)throw TypeError(`Incorrect number of tuple elements for ${e.name}: expected=${n}, actual=${a.length}`);for(var u=o(),s=0;s<n;++s)t[s].write(u,a[s]);return null!==r&&r.push(i,u),u},readValueFromPointer:S,destructorFunction:i}]})},u:r=>{var e=N[r];delete N[r];var t=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(r=>r.getterReturnType).concat(a.map(r=>r.setterArgumentType));O([r],o,r=>{var o={};for(var[i,u]of a.entries()){let e=r[i],t=u.getter,n=u.getterContext,s=r[i+a.length],l=u.setter,f=u.setterContext;o[u.fieldName]={read:r=>e.fromWireType(t(n,r)),write:(r,e)=>{var t=[];l(f,r,s.toWireType(t,e)),U(t)},optional:e.optional}}return[{name:e.name,fromWireType:r=>{var e={};for(var t in o)e[t]=o[t].read(r);return n(r),e},toWireType:(r,e)=>{for(var a in o)if(!(a in e)&&!o[a].optional)throw TypeError(`Missing field: "${a}"`);var i=t();for(a in o)o[a].write(i,e[a]);return null!==r&&r.push(n,i),i},readValueFromPointer:S,destructorFunction:n}]})},y:(r,e,t,n,a)=>{e=j(e);let o=0n===n,i=r=>r;if(o){let r=8*t;i=e=>BigInt.asUintN(r,e),a=i(a)}G(r,{name:e,fromWireType:i,toWireType:(r,e)=>("number"==typeof e&&(e=BigInt(e)),e),readValueFromPointer:Y(e,t,!o),destructorFunction:null})},J:(r,e,t,n)=>{G(r,{name:e=j(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},readValueFromPointer:function(r){return this.fromWireType(P[r])},destructorFunction:null})},H:r=>G(r,X),x:(r,e,t)=>{G(r,{name:e=j(e),fromWireType:r=>r,toWireType:(r,e)=>e,readValueFromPointer:Z(e,t),destructorFunction:null})},g:(r,e,t,n,a,o,i,u)=>{var s=((r,e)=>{for(var t=[],n=0;n<r;n++)t.push(W[e+4*n>>2]);return t})(e,t);r=(r=>{let e=(r=r.trim()).indexOf("(");return-1===e?r:r.slice(0,e)})(r=j(r)),a=ir(n,a,i),tr(r,function(){((r,e)=>{var t=[],n={};throw e.forEach(function r(e){if(!n[e]&&!H[e]){if(M[e])return void M[e].forEach(r);t.push(e),n[e]=!0}}),new ur(`${r}: `+t.map(vr).join([", "]))})(`Cannot call ${r} due to unbound types`,s)},e-1),O([],s,t=>{var n=[t[0],null].concat(t.slice(1));return nr(r,function(r,e,t,n,a){var o=e.length;o<2&&z("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var i=function(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}(e),u=!e[0].isVoid,s=o-2,l=Array(s),f=[],c=[];return rr(r,function(...r){c.length=0,f.length=1,f[0]=a;for(var t=0;t<s;++t)l[t]=e[t+2].toWireType(c,r[t]),f.push(l[t]);return function(r){if(i)U(c);else for(var t=2;t<e.length;t++){var n=1===t?void 0:l[t-2];null!==e[t].destructorFunction&&e[t].destructorFunction(n)}if(u)return e[0].fromWireType(r)}(n(...f))})}(r,n,0,a,o),e-1),[]})},o:(r,e,t,n,a)=>{e=j(e);let o=r=>r;if(0===n){var i=32-8*t;o=r=>r<<i>>>i,a=o(a)}G(r,{name:e,fromWireType:o,toWireType:(r,e)=>e,readValueFromPointer:Y(e,t,0!==n),destructorFunction:null})},j:(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];function a(r){var e=W[r>>2],t=W[r+4>>2];return new n(T.buffer,t,e)}G(r,{name:t=j(t),fromWireType:a,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},I:(r,e)=>{G(r,{name:e=j(e),fromWireType(r){var e=W[r>>2],t=Tr(r+4,e,!0);return cr(r),t},toWireType(r,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,n="string"==typeof e;n||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT||z("Cannot pass non-string to std::string"),t=n?gr(e):e.length;var a=fr(4+t+1),o=a+4;return W[a>>2]=t,n?dr(e,o,t+1):P.set(e,o),null!==r&&r.push(cr,a),a},readValueFromPointer:S,destructorFunction(r){cr(r)}})},t:(r,e,t)=>{var n,a,o;t=j(t),2===e?(n=Ar,a=Cr,o=Wr):(n=Fr,a=Pr,o=Er),G(r,{name:t,fromWireType:r=>{var t=W[r>>2],a=n(r+4,t*e,!0);return cr(r),a},toWireType:(r,n)=>{"string"!=typeof n&&z(`Cannot pass non-string to C++ string type ${t}`);var i=o(n),u=fr(4+i+e);return W[u>>2]=i/e,a(n,u+4,i+e),null!==r&&r.push(cr,u),u},readValueFromPointer:S,destructorFunction(r){cr(r)}})},s:(r,e,t,n,a,o)=>{I[r]={name:j(e),rawConstructor:ir(t,n),rawDestructor:ir(a,o),elements:[]}},m:(r,e,t,n,a,o,i,u,s)=>{I[r].elements.push({getterReturnType:e,getter:ir(t,n),getterContext:a,setterArgumentType:o,setter:ir(i,u),setterContext:s})},v:(r,e,t,n,a,o)=>{N[r]={name:j(e),rawConstructor:ir(t,n),rawDestructor:ir(a,o),fields:[]}},k:(r,e,t,n,a,o,i,u,s,l)=>{N[r].fields.push({fieldName:j(e),getterReturnType:t,getter:ir(n,a),getterContext:o,setterArgumentType:i,setter:ir(u,s),setterContext:l})},K:(r,e)=>{G(r,{isVoid:!0,name:e=j(e),fromWireType:()=>{},toWireType:(r,e)=>{}})},d:(r,e,t)=>{var[n,...a]=((r,e)=>{for(var t=Array(r),n=0;n<r;++n)t[n]=Rr(W[e+4*n>>2],`parameter ${n}`);return t})(r,e),o=n.toWireType.bind(n),i=a.map(r=>r.readValueFromPointer.bind(r));r--;var u=Array(r);return(r=>{var e=$r.length;return $r.push(r),e})(rr(`methodCaller<(${a.map(r=>r.name)}) => ${n.name}>`,(e,n,a,s)=>{for(var l=0,f=0;f<r;++f)u[f]=i[f](s+l),l+=8;var c;switch(t){case 0:c=Q.toValue(e).apply(null,u);break;case 2:c=Reflect.construct(Q.toValue(e),u);break;case 3:c=u[0];break;case 1:c=Q.toValue(e)[Vr(n)](...u)}return((r,e,t)=>{var n=[],a=r(n,t);return n.length&&(W[e>>2]=Q.toHandle(n)),a})(o,a,c)}))},a:K,n:r=>r?(r=Vr(r),Q.toHandle(globalThis[r])):Q.toHandle(globalThis),q:r=>(r=Vr(r),Q.toHandle(n[r])),p:(r,e)=>(r=Q.toValue(r),e=Q.toValue(e),Q.toHandle(r[e])),l:r=>{r>9&&(J[r+1]+=1)},f:(r,e,t,n,a)=>$r[r](e,t,n,a),G:()=>Q.toHandle([]),F:r=>{r=Q.toValue(r);for(var e=Array(r.length),t=0;t<r.length;t++)e[t]=r[t];return Q.toHandle(e)},b:r=>Q.toHandle(Vr(r)),i:()=>Q.toHandle({}),e:r=>{U(Q.toValue(r)),K(r)},c:(r,e,t)=>{r=Q.toValue(r),e=Q.toValue(e),t=Q.toValue(t),r[e]=t},z:(r,e,t,n)=>{var a=(new Date).getFullYear(),o=new Date(a,0,1),i=new Date(a,6,1),u=o.getTimezoneOffset(),s=i.getTimezoneOffset(),l=Math.max(u,s);W[r>>2]=60*l,y[e>>2]=Number(u!=s);var f=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=f(u),p=f(s);s<u?(dr(c,t,17),dr(p,n,17)):(dr(c,n,17),dr(p,t,17))},C:function(r,e,t){if(!(r=>r>=0&&r<=3)(r))return 28;var n=0===r?Date.now():performance.now(),a=Math.round(1e3*n*1e3);return w[t>>3]=BigInt(a),0},D:r=>{var e=P.length,t=2147483648;if((r>>>=0)>t)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);if(a=Math.min(a,r+100663296),Ir(Math.min(t,_r(Math.max(r,a),65536))))return!0}return!1},A:(r,e)=>{var t=0,n=0;for(var a of Sr()){var o=e+t;W[r+n>>2]=o,t+=dr(a,o,1/0)+1,n+=4}return 0},B:(r,e)=>{var t=Sr();W[r>>2]=t.length;var n=0;for(var a of t)n+=gr(a)+1;return W[e>>2]=n,0},w:(r,e,t,n)=>{for(var a=0,o=0;o<t;o++){var i=W[e>>2],u=W[e+4>>2];e+=8;for(var s=0;s<u;s++)Hr(r,P[i+s]);a+=u}return W[n>>2]=a,0}},Lr=await async function(){function r(r,e){return function(r){lr=r.N,fr=n._malloc=r.P,cr=n._free=r.Q,pr=r.L,hr=r.O}(Lr=r.exports),v(),Lr}var e={a:jr};return n.instantiateWasm?new Promise((t,a)=>{n.instantiateWasm(e,(e,n)=>{t(r(e))})}):(l??=n.locateFile?function(r){return n.locateFile?n.locateFile(r,o):o+r}("lyr3DMain.wasm"):new URL("lyr3DMain.wasm","").href,function(e){return r(e.instance)}(await g(i,l,e)))}();return function(){function r(){n.calledRun=!0,!p&&(h=!0,Lr.M(),u?.(n),n.onRuntimeInitialized?.(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)R(n.postRun.shift());E($)}())}!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)V(n.preRun.shift());E(x)}(),n.setStatus?(n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),r()},1)):r()}(),e=h?n:new Promise((r,e)=>{u=r,s=e}),e}t.d(e,{default:()=>n})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5952],{52106(e,t,r){r.d(t,{A:()=>x});var i,s,l=r(32198),n=r(37838),a=r(69540),o=r(51447),u=r(25482),p=r(53966),d=r(36708),g=r(24326),h=r(91429),c=r(12195),f=r(65864),y=r(50498),m=r(55156),v=r(60950),b=r(54339),I=r(94128),_=r(33910);const w=Symbol("meshGeometryHandles");function M(e){if(null==e)return null;let t={};for(let r in e){let i=e[r];i&&(t[r]=i.toJSON())}return 0===Object.keys(t).length?null:t}let x=class extends((0,a.OU)(u.o)){static{i=I.Z}static{s=this}constructor(e){super(e),this[i]=!0,this.distance=null,this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this.statisticsAggregatedIds=void 0,this._version=0,Object.defineProperty(this,"uid",{value:(0,g.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,o.eF)(p.A.getLogger(this),"Graphic",{version:"4.30"})}set aggregateGeometries(e){let t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){let t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){let t=this._get("geometry");t!==e&&(this._set("geometry",e),this._watchMeshGeometryChanges(),this._notifyLayer("geometry",t,e))}set popupTemplate(e){let t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){let t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){let t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new s({aggregateGeometries:this.aggregateGeometries,statisticsAggregatedIds:this.statisticsAggregatedIds,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;let t=(0,v.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;let r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(let t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){let r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){let e=(0,m.I)(this.origin);if(e)return(0,b.r)(this,e);let t=this.sourceLayer??this.layer;return t?(0,b.r)(this,t):null}getGlobalId(){let e=(0,m.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);let t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){let e={aggregateGeometries:M(this.aggregateGeometries),geometry:this.geometry?.toJSON()??null,symbol:this.symbol?.toJSON()??null,attributes:(0,c.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null};return this.statisticsAggregatedIds?.length&&(e.aggregateIds=[...this.statisticsAggregatedIds]),null!=this.distance&&(e.distance=this.distance),e}notifyMeshTransformChanged(e={}){let{geometry:t}=this;if("mesh"===t?.type){let r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,i){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;let s={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(s.action=i),"attributes"===e&&(s.attributeName=i),this.layer.graphicChanged(s)}_watchMeshGeometryChanges(){this.removeHandles(w);let e=this.geometry;"mesh"===e?.type&&this.addHandles([(0,d.z7)(()=>e.vertexSpace.origin?{localMatrix:e.transform?.localMatrix,origin:e.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{(this._lastMeshTransform.localMatrix!==e||this._lastMeshTransform.origin!==t)&&(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,d.z7)(()=>({vertexAttributes:e.vertexAttributes}),()=>{e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",e,e)},{equals:(e,t)=>e===t,sync:!0})],w)}};(0,l.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;let t={};for(let r in e){let i=(0,f.rS)(e[r]);i&&(t[r]=i)}return 0===Object.keys(t).length?null:t}}})],x.prototype,"aggregateGeometries",null),(0,l.Cg)([(0,h.MZ)({value:null})],x.prototype,"attributes",null),(0,l.Cg)([(0,h.MZ)({value:null,types:y.yR,json:{read:f.rS}})],x.prototype,"geometry",null),(0,l.Cg)([(0,h.MZ)()],x.prototype,"distance",void 0),(0,l.Cg)([(0,h.MZ)({type:Boolean})],x.prototype,"isAggregate",void 0),(0,l.Cg)([(0,h.MZ)({clonable:!1})],x.prototype,"layer",void 0),(0,l.Cg)([(0,h.MZ)({clonable:"reference"})],x.prototype,"origin",void 0),(0,l.Cg)([(0,h.MZ)({type:n.A,value:null})],x.prototype,"popupTemplate",null),(0,l.Cg)([(0,h.MZ)({clonable:"reference"})],x.prototype,"sourceLayer",void 0),(0,l.Cg)([(0,h.MZ)({json:{name:"aggregateIds",read:e=>e?.map(e=>Array.isArray(e)?JSON.stringify(e):e)}})],x.prototype,"statisticsAggregatedIds",void 0),(0,l.Cg)([(0,h.MZ)({value:null,types:_.Es})],x.prototype,"symbol",null),(0,l.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],x.prototype,"_version",void 0),(0,l.Cg)([(0,h.MZ)({type:Boolean,value:!0})],x.prototype,"visible",null),x=s=(0,l.Cg)([(0,h.$K)("esri.Graphic")],x)},19334(e,t,r){r.d(t,{e:()=>n});var i=r(54639),s=r(14112);class l{constructor(e){this._geometry=e}toJsonGeometry(){return this._geometry.toJSON()}toAccessorGeometry(e){return this._geometry}toGxGeometry(e){return e.fromAccessorGeometry(this._geometry)}}function n(e){if(null==e)return null;switch(e.type){case"point":if((0,s.e6)(e))return null;break;case"polygon":if((0,s.Wq)(e))return null;break;case"polyline":if((0,s.IY)(e))return null;break;case"multipoint":if((0,s.DG)(e))return null;break;case"extent":if((0,s.As)(e))return null;break;default:return null}let t=i.R.of(e.type,e.spatialReference,e.hasZ,e.hasM,new l(e));return t.asAccessorGeometry(),t}},36983(e,t,r){r.d(t,{R:()=>u,p:()=>p});var i=r(54639),s=r(14112),l=r(16930),n=r(60408),a=r(65864);class o{constructor(e){this._geometry=e}toJsonGeometry(){return this._geometry}toAccessorGeometry(e){let t=(0,a.rS)(this._geometry);return t.spatialReference=e,t}toGxGeometry(e){return e.fromJsonGeometry(this._geometry)}}function u(e,t){if("object"!=typeof e||!e)return null;let r=t;if("spatialReference"in e&&(e.spatialReference instanceof l.A?r=e.spatialReference:"object"==typeof e.spatialReference&&null!=e.spatialReference&&(r=new l.A,r.read(e.spatialReference))),null==r)throw Error("Spatial reference required");return(0,n.fT)(e)?p("point",e,r):(0,n.Rg)(e)?p("polyline",e,r):(0,n.Bi)(e)?p("polygon",e,r):(0,n.U9)(e)?p("multipoint",e,r):(0,n.ZC)(e)?p("extent",e,r):null}function p(e,t,r){if(null==t)return null;let l=!1,n=!1;switch(e){case"point":if((0,s.e6)(t))return null;l=void 0!==t.z,n=void 0!==t.m;break;case"polygon":if((0,s.Wq)(t))return null;l=!0===t.hasZ,n=!0===t.hasM;break;case"polyline":if((0,s.IY)(t))return null;l=!0===t.hasZ,n=!0===t.hasM;break;case"multipoint":if((0,s.DG)(t))return null;l=!0===t.hasZ,n=!0===t.hasM;break;case"extent":if((0,s.As)(t))return null;l=null!=t.zmin&&null!=t.zmax,n=null!=t.mmin&&null!=t.mmax;break;default:throw Error("Unsupported geometry type: "+t.type)}return i.R.of(e,r,l,n,new o(t))}},14112(e,t,r){function i(e){return"NaN"===e.x||null===e.x||isNaN(e.x)}function s(e){if(0===(e.curveRings??e.rings).length)return!0;for(let t of e.curveRings??e.rings)if(t.length>0)return!1;return!0}function l(e){if(0===(e.curvePaths??e.paths).length)return!0;for(let t of e.curvePaths??e.paths)if(t.length>0)return!1;return!0}function n(e){return 0===e.points.length}function a(e){return"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)}r.d(t,{As:()=>a,DG:()=>n,IY:()=>l,Wq:()=>s,e6:()=>i})},13069(e,t,r){r.d(t,{AG:()=>a,lk:()=>s,vD:()=>n,yS:()=>l});const i="randomUUID"in crypto;function s(){if(i)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;let t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function l(){return`{${s().toUpperCase()}}`}function n(){return`{${s()}}`}function a(e){let t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},83027(e,t,r){const i=r(29953).ho;r.d(t,["h",0,i])},55156(e,t,r){r.d(t,{I:()=>s});const i=Symbol("idFieldsProviderSymbol");function s(e){return(t=e)&&i in t?e[i]:void 0;var t}r.d(t,["e",0,i])},54339(e,t,r){function i(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{let r=[];for(let i of t.fieldNames)r.push(e.attributes[i]??null);return JSON.stringify(r)}}}function s(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];let r=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(r)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}r.d(t,{W:()=>i,r:()=>s})},69208(e,t,r){var i=r(32198),s=r(91429);r.d(t,["d",0,e=>{let t=e,r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,s.$K)("esri.layers.mixins.CustomParametersMixin")],r),r}])},10497(e,t,r){r.d(t,{z:()=>c});var i=r(32198),s=r(91429),l=r(89317),n=r(69540),a=r(25482);let o=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.name=null,this.type=null,this.title=null}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],o.prototype,"name",void 0),(0,i.Cg)([(0,s.MZ)({type:["change-from-average","change-from-first","change-from-previous","percent-change-from-average","percent-change-from-first","percent-change-from-previous"],json:{write:{isRequired:!0}}})],o.prototype,"type",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],o.prototype,"title",void 0),o=(0,i.Cg)([(0,s.$K)("esri.layers.support.TimeSeriesCalculation")],o);const u=o;let p=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.fieldName=null,this.timeValue=null}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"fieldName",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"timeValue",void 0),p=(0,i.Cg)([(0,s.$K)("esri.layers.support.TimeSeriesFieldTimeMapping")],p);const d=p;var g=r(79677);let h=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.name=null,this.fieldTimeMappings=null,this.timeExtent=null,this.timeInterval=null,this.timeIntervalUnits=null,this.timeValueUnits=null,this.title=null,this.calculationMethods=null,this.type="time-series-fields"}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],h.prototype,"name",void 0),(0,i.Cg)([(0,s.MZ)({type:[d],json:{write:{isRequired:!0}}})],h.prototype,"fieldTimeMappings",void 0),(0,i.Cg)([(0,s.MZ)({type:g.A,json:{write:!0}})],h.prototype,"timeExtent",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,json:{write:{isRequired:!0}}})],h.prototype,"timeInterval",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],h.prototype,"timeIntervalUnits",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],h.prototype,"timeValueUnits",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],h.prototype,"title",void 0),(0,i.Cg)([(0,s.MZ)({type:[u],json:{write:!0}})],h.prototype,"calculationMethods",void 0),(0,i.Cg)([(0,s.MZ)({type:String,readOnly:!0,json:{write:{isRequired:!0}}})],h.prototype,"type",void 0),h=(0,i.Cg)([(0,s.$K)("esri.layers.support.TimeSeriesInfo")],h);const c=e=>{let t=e,r=class extends t{constructor(){super(...arguments),this.dataSeriesInfos=null}};return(0,i.Cg)([(0,s.MZ)({type:[h],json:{read:{source:["layerDefinition.dataSeriesInfos","dataSeriesInfos"],reader:(e,t,r)=>(t?.layerDefinition?.dataSeriesInfos??t.dataSeriesInfos)?.filter(e=>"time-series-fields"===e.type).map(e=>h.fromJSON(e,r))},write:{target:"layerDefinition.dataSeriesInfos",enabled:!0,allowNull:!0,layerContainerTypes:l.K},origins:{"web-scene":{write:!1,read:!1}}}})],r.prototype,"dataSeriesInfos",void 0),r=(0,i.Cg)([(0,s.$K)("esri.layers.mixins.DataSeriesLayer")],r),r}},8303(e,t,r){var i=r(32198),s=r(92602),l=r(70333),n=r(56507),a=r(60999),o=r(49186),u=r(36563),p=r(53966),d=r(97768),g=r(17676),h=r(84952),c=r(91429),f=r(77548),y=r(20655),m=r(80812),v=r(41318),b=r(10407),I=r(26121),_=r(36005),w=r(43937);const M={credential:null,user:null};r.d(t,["A",0,e=>{let t=e,x=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){super.destroy(),this.portalItem=(0,d.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new m.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{let{load:i}=await r.e(1204).then(()=>r(41204));return(0,g.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,g.zf)(e)||p.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async reloadFromPortal(e,t){if(!this.loaded||!this.portalItem?.id)return!1;let i=t?.signal?null:new AbortController;try{let{reload:s}=await r.e(1204).then(()=>r(41204));return i&&this.addHandles((0,u.rE)(i),"reloadFromPortal"),await s({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t?.signal?t:{signal:i.signal})}catch(e){throw(0,g.zf)(e)||p.A.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{i&&this.removeHandles("reloadFromPortal")}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,g.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{let{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,g.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);let i,s,n=!l.id?.findCredential(this.url),a=e===r.id;if(a&&r.portal.user)return this._getUserPrivileges(r,n);if(a)i=r.portal.url;else try{i=await(0,f.wI)(this.url,t)}catch(e){(0,g.QP)(e)}if(!i||!(0,h.b8)(i,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{let e=null==t?null:t.signal;s=await(l.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,g.QP)(e)}if(!s)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(a?await r.reload():(r=new m.default({id:e,portal:{url:i}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,n)}catch(e){(0,g.QP)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}_getUserPrivileges(e,t){let r=(0,b.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,g.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){let t=this.url?l.id?.findCredential(this.url):null;if(!t)return!0;let r=M.credential===t?M.user:await this._fetchEditingUser(e);return M.credential=t,M.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){let t=this.portalItem?.portal?.user;if(t)return t;let r=l.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;let i=`${r.owningSystemUrl}/sharing/rest`,s=y.A.getDefault();if(s&&s.loaded&&(0,h.S8)(s.restUrl)===(0,h.S8)(i))return s.user;let o=`${i}/community/self`,u=null==e?null:e.signal,p=await(0,a.Ke)((0,n.A)(o,{authMode:"no-prompt",query:{f:"json"},signal:u}));return p.ok?v.A.fromJSON(p.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){return(0,I.wN)(this.portalItem,t)?(t?.messages?.push(new o.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,c.MZ)({type:m.default})],x.prototype,"portalItem",null),(0,i.Cg)([(0,_.w)("web-document","portalItem",["itemId"])],x.prototype,"readPortalItem",null),(0,i.Cg)([(0,w.K)("web-document","portalItem",{itemId:{type:String}})],x.prototype,"writePortalItem",null),(0,i.Cg)([(0,c.MZ)({clonable:!1})],x.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],x.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],x.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],x.prototype,"userHasUpdateItemPrivileges",void 0),x=(0,i.Cg)([(0,c.$K)("esri.layers.mixins.PortalLayer")],x),x}])},17036(e,t,r){r.d(t,{p:()=>o});var i=r(44208),s=r(53966),l=r(20437),n=r(95466),a=r(30524);function o(){return{fields:{type:[l.A],value:null,set:function(e){if(e&&(0,i.A)("big-integer-warning-enabled")){let t=e.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(t.length){let e=t.map(e=>`'${e.name}'`).join(", ");s.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${2**53-1} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return n.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){let e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(let t of e)this.fieldsIndex?.has(t)||s.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e});return(0,a.DB)(this.fieldsIndex,e)}}}}},32730(e,t,r){r.d(t,{BI:()=>d,D3:()=>u,XJ:()=>p,lc:()=>o,mX:()=>h,rU:()=>g,tH:()=>v,zA:()=>I});var i=r(799);const s=RegExp("__begin__","ig"),l=RegExp("__end__","ig"),n=RegExp("^__begin__","i"),a=RegExp("__end__$","i");function o(e){return e.replaceAll(RegExp("\\[","g"),"{").replaceAll(RegExp("\\]","g"),"}")}function u(e){return e.replaceAll(RegExp("\\{","g"),"[").replaceAll(RegExp("\\}","g"),"]")}function p(e){let t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=o(e.labelExpression),t.type="conventional"),t}function d(e){let t=p(e);if(!t)return null;switch(t.type){case"conventional":return h(t.expression);case"arcade":return t.expression}return null}function g(e){let t=p(e);if(!t)return null;switch(t.type){case"conventional":return function(e){return(e?.match(c))?.[1].trim()||null}(t.expression);case"arcade":return v(t.expression)}return null}function h(e){let t;return e?(t=(0,i.HC)(e,e=>'__begin__$feature["'+e+'"]__end__'),t=n.test(t)?t.replace(n,""):'"'+t,t=a.test(t)?t.replace(a,""):t+'"',t=t.replaceAll(s,'" + ').replaceAll(l,' + "')):t='""',t}const c=/^\s*\{([^}]+)\}\s*$/i,f=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,y=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,m=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function v(e){if(!e)return null;let t=f.exec(e)||y.exec(e);return t?t[1]||t[3]:(t=m.exec(e),t?t[2]:null)}const b=Symbol("LabelClassInstance");function I(e){return"object"==typeof e&&!!e&&b in e}r.d(t,["vK",0,b])},26121(e,t,r){r.d(t,{I6:()=>p,ci:()=>u,dL:()=>o,wN:()=>d});var i=r(49186),s=r(84952),l=r(77548),n=r(20655),a=r(59923);async function o(e){let t=[];for(let r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){let e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function u(e,t,r){let s=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new i.A(e,t,r));if(e.blockedRelativeUrls&&(s=s.concat(e.blockedRelativeUrls.map(e=>(0,a.GL)("url",`Relative url '${e}' is not supported`)))),r){let{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:i}=r;e&&(s=s.filter(({name:e})=>!(a.MG.has(e)||t.includes(e)))),i&&(s=s.filter(e=>"web-document-write:property-required"!==e.name))}if(s.length>0)throw new i.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}function p(e){return(0,l.qd)(e).some(e=>!!e.charts?.length)}function d(e,t){let r=t?.portal,i=e?.id&&(e.portal||n.A.getDefault());return!!r&&!!i&&!(0,s.ut)(i.restUrl,r.restUrl)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3390],{3390(n,e,t){t.r(e),t.d(e,{registerFunctions:()=>u});var a=t(67862),r=t(85935),i=t(78878),o=t(54218);function u(n){"async"===n.mode&&(n.functions.domain=function(e,t){return n.standardFunctionAsync(e,t,async(n,e,o)=>{if((0,i.E)(o,2,3,t),(0,i.h)(o[0])){let n=(0,i.W)(o[0],(0,i.w)(o[1]),void 0===o[2]?void 0:o[2]);return(0,a.OT)(n)}if((0,i.k)(o[0])){await o[0]._ensureLoaded();let n=(0,i.a6)((0,i.w)(o[1]),o[0],null,void 0===o[2]?void 0:o[2],!1);return(0,a.OT)(n)}throw new r.D$("InvalidParameter",t)})},n.functions.subtypes=function(e,t){return n.standardFunctionAsync(e,t,async(n,e,o)=>{if((0,i.E)(o,1,1,t),(0,i.h)(o[0]))return(0,a.Tg)((0,i._)(o[0]));if((0,i.k)(o[0]))return await o[0]._ensureLoaded(),(0,a.Tg)(o[0].subtypeMetadata());throw new r.D$("InvalidParameter",t)})},n.functions.domainname=function(e,t){return n.standardFunctionAsync(e,t,async(n,e,a)=>{if((0,i.E)(a,2,4,t),(0,i.h)(a[0]))return(0,i.Y)(a[0],(0,i.w)(a[1]),a[2],void 0===a[3]?void 0:a[3]);if((0,i.k)(a[0])){await a[0]._ensureLoaded();let n=(0,i.a6)((0,i.w)(a[1]),a[0],null,void 0===a[3]?void 0:a[3],!0);return(0,i.a7)(n,a[2])}throw new r.D$("InvalidParameter",t)})},n.signatures.push({name:"domainname",min:2,max:4}),n.functions.domaincode=function(e,t){return n.standardFunctionAsync(e,t,async(n,e,a)=>{if((0,i.E)(a,2,4,t),(0,i.h)(a[0]))return(0,i.X)(a[0],(0,i.w)(a[1]),a[2],void 0===a[3]?void 0:a[3]);if((0,i.k)(a[0])){await a[0]._ensureLoaded();let n=(0,i.a6)((0,i.w)(a[1]),a[0],null,void 0===a[3]?void 0:a[3],!0);return(0,i.a8)(n,a[2])}throw new r.D$("InvalidParameter",t)})},n.signatures.push({name:"domaincode",min:2,max:4}),n.functions.text=function(e,t){return n.standardFunctionAsync(e,t,async(n,e,a)=>{if((0,i.E)(a,1,2,t),(0,i.k)(a[0])){let e=(0,i.N)(a[1],"");if(!(0,o.Kg)(e))throw new r.D$("InvalidParameter",t);if(""===e)return a[0].castToText();if("schema"===e.toLowerCase())return a[0].convertToText("schema",n.abortSignal);if("featureset"===e.toLowerCase())return a[0].convertToText("featureset",n.abortSignal);throw new r.D$("InvalidParameter",t)}return(0,i.t)(a[0],a[1])})},n.functions.gdbversion=function(e,t){return n.standardFunctionAsync(e,t,async(n,e,a)=>{if((0,i.E)(a,1,1,t),(0,i.h)(a[0]))return a[0].gdbVersion();if((0,i.k)(a[0]))return(await a[0].load()).gdbVersion;throw new r.D$("InvalidParameter",t)})},n.functions.schema=function(e,t){return n.standardFunctionAsync(e,t,async(n,e,o)=>{if((0,i.E)(o,1,1,t),(0,i.k)(o[0]))return await o[0].load(),(0,a.Tg)(o[0].schema());if((0,i.h)(o[0]))return(0,a.Tg)((0,i.Z)(o[0]));throw new r.D$("InvalidParameter",t)})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1560,9304],{96685(e,t,r){r.r(t),r.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>B,constructFeatureSet:()=>P,constructFeatureSetFromPortalItem:()=>z,constructFeatureSetFromRelationship:()=>G,constructFeatureSetFromUrl:()=>E,convertToFeatureSet:()=>$,createFeatureSetCollectionFromMap:()=>V,createFeatureSetCollectionFromService:()=>K,initialiseMetaDataCache:()=>Z});var a=r(56507);class i{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection"}castToText(e=!1){return"object, FeatureSetCollection"}}var l=r(78878),s=r(35704),n=r(70333),u=r(48938),o=r(61454),d=r(67862),y=r(87449),c=r(11221),h=r(33325),p=r(80609),f=r(50145),m=r(4576),_=r(80200),g=r(39516),w=r(89696),F=r(18589),b=r(17126),S=r(54546),I=r(97552),v=r(7562);function T(e,t){e.clause??=function(e){if(0===e.length)throw new y.dr("NeverReach");let t=[];for(let r=0;r<e.length;r++){let a=e[r],i=[`"${a.name.replaceAll('"','""')}" ${a.asc?">":"<"} @last_${r}`];for(let t=0;t<r;t++){let r=e[t];i.push(`"${r.name.replaceAll('"','""')}" = @last_${t}`)}t.push(i.join(" AND "))}let r=t.join(" OR ");return w.A.create(r)}(e.keyFields);for(let r=0;r<e.keyFields.length;r++){let a=e.keyFields[r].name;e.clause.parameters[`last_${r}`]=t.attributes[a]}}class C extends c.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this._requestStandardised=!1,this._useDefinitionExpression=!0,this._recentlyUsedQueries=null,this._featureSetQueryInterceptor=null,this._featureSetInfo=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry),e.lrucache&&(this._recentlyUsedQueries=e.lrucache),e.interceptor&&(this._featureSetQueryInterceptor=e.interceptor)}_maxQueryRate(){return 1e3}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){let t=this.urlQueryPath+","+(0,h.JB)(e.toJSON());return(0,_.d)(t,_.T.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{let e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}if(this._layer.source&&this._layer.source.sourceJSON){let e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}this.objectIdField=this._layer.objectIdField;for(let e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}async _runDatabaseProbe(e){await this._ensureLoaded();let t=new I.A;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}async _queryAll(){return(await this.query({abortSignal:u._})).features}async query(e){return await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter?c.An:this._canUsePagination()?this._queryUsingPaging(e):this._queryUsingIdSetTraversal(e)}async _queryUsingPaging(e){let t=this._layer.capabilities.query,r=!0,a=null,i=!1;null!=e.orderBy&&(t.supportsOrderBy?(a=e.orderBy.toOrderByFields(),i=!0):r=!1);let l=await this.databaseType(),s=null==e.where?null==e.spatialFilter?"1=1":"":(0,p.YY)(e.where,l),n=!0!==this._removeGeometry,u=this._overrideFields??this._fieldsIncludingObjectId(["*"]),o=u.includes("*")?this._layer.fields.length:u.length,d=(this.isTable()||!n?t.standardMaxRecordCountNoGeometry:void 0)??t.standardMaxRecordCount??t.maxRecordCount??this._maxQueryRate(),y=Math.max(Math.ceil(d*(o<=50?1:o<=100?.5:o<=200?.25:.125)),t.maxRecordCount??this._maxQueryRate()),h=this._maxQueryRate(),f=this._layer.capabilities?.query.maxRecordCount;null!=f&&f<h&&(h=f);let m=this._createQuery();if(m.where=(0,g.mA)(m.where,s),null!=e.spatialFilter){let t=(0,c.rj)(e.spatialFilter.relation);m.spatialRelationship=t.spatialRelationship,m.relationParameter=t.relationParameter,m.geometry=e.spatialFilter.geometry}return m.orderByFields=a,m.outFields=u,m.returnGeometry=n,m.outSpatialReference=this.spatialReference,m.resultType="standard",{ordered:i,filterApplied:!0,spatialFilterApplied:!0,features:this._queryPaginated(m,y,h,r?e.limit:null,e.abortSignal)}}async*_queryPaginated(e,t,r,a,i){e.start=0;let l,s=a??1/0;do{(0,y.dZ)(i),e.num=Math.max(r,Math.min(s,t)),l=await this.executeQuery(e,"execute"),e.start+=e.num,s-=l.features.length,yield*(0,m.Ho)(l.features,this._maxQueryRate())}while(s>0&&!0===l.exceededTransferLimit)}async _queryUsingIdSetTraversal(e){let t=!0,r=null,a=!1;null!=e.orderBy&&(this._layer.capabilities?.query?.supportsOrderBy?(r=e.orderBy.toOrderByFields(),a=!0):t=!1);let i=await this.databaseType(),l=null==e.where?null==e.spatialFilter?"1=1":"":(0,p.YY)(e.where,i),s=this._createQuery();if(s.where=(0,g.mA)(s.where,l),null!=e.spatialFilter){let t=(0,c.rj)(e.spatialFilter.relation);s.spatialRelationship=t.spatialRelationship,s.relationParameter=t.relationParameter,s.geometry=e.spatialFilter.geometry}s.orderByFields=r,s.outSpatialReference=this.spatialReference,s.num=t?e.limit:null;let n=await this.executeQuery(s,"executeForIds");if((0,y.dZ)(e.abortSignal),null==n||n.length<=0)return c.An;let u=this._maxQueryRate(),o=this._layer.capabilities?.query.maxRecordCount;null!=o&&o<u&&(u=o);let d=this._createQuery();return s.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),s.returnGeometry=!0!==this._removeGeometry,s.outSpatialReference=this.spatialReference,{ordered:a,filterApplied:!0,spatialFilterApplied:!0,features:this._traverseIdSet(d,n,u,e.abortSignal)}}async*_traverseIdSet(e,t,r,a){for(let i=0;i<t.length;i+=r)e.objectIds=t.slice(i,i+r),(0,y.dZ)(a),yield(await this.executeQuery(e,"execute")).features}async queryStat(e){await this._ensureLoaded();let t=this._layer.capabilities?.query,r=!!t?.supportsSqlExpression,a=!!t?.supportsStatistics,i=!!t?.supportsDistinct,l=(0,f.Dp)(e.stat);if("count"===l)return i?this._queryCount(e):{calculated:!1};let s=e.field;if(null==s)return{calculated:!1};if(!1===a||!1===(0,p.DA)(s)&&!1===r||!1===s.isStandardized)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,s,e.limit??1e3,e.abortSignal);if("distinct"===l)return!1===i?null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(l,s,e.limit??1e3,e.abortSignal):{calculated:!1};let n=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};let u=this._createQuery();if(u.where=(0,g.mA)(u.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,p.YY)(e.where,n)),null!=e.spatialFilter){let t=(0,c.rj)(e.spatialFilter.relation);u.spatialRelationship=t.spatialRelationship,u.relationParameter=t.relationParameter,u.geometry=e.spatialFilter.geometry}let o=new v.A;o.statisticType=l,o.onStatisticField=(0,p.YY)(s,n),o.outStatisticFieldName="ARCADE_STAT_RESULT",u.returnGeometry=!1;let d="ARCADE_STAT_RESULT";u.outStatistics=[o];let h=await this.executeQuery(u,"execute");if(!h.hasOwnProperty("features")||0===h.features.length)throw new y.dr("InvalidStatResponse");let m=!1,_=h.fields??[];for(let e of _)if("ARCADE_STAT_RESULT"===e.name.toUpperCase()){d=e.name,"esriFieldTypeDate"===e.type&&(m=!0);break}let w=h.features[0].attributes[d];return{calculated:!0,result:m&&null!=w?new Date(w):w}}async _queryCount(e){let t=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};let r=this._createQuery();if(r.where=(0,g.mA)(r.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,p.YY)(e.where,t)),null!=e.spatialFilter){let t=(0,c.rj)(e.spatialFilter.relation);r.spatialRelationship=t.spatialRelationship,r.relationParameter=t.relationParameter,r.geometry=e.spatialFilter.geometry}return r.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(r,"executeForCount")}}async canQueryAggregate(e){await this._ensureLoaded();let t=!1,r=this._layer.capabilities?.query,a=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(t=!0),t)for(let r of e.statistics)(!1===r.workingexpr?.isStandardized||!1===(0,p.DA)(r.workingexpr)&&!1===a)&&(t=!1);return t}async queryAggregate(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return c.An;let t=await this.databaseType(),r=e.groupBy,a=e.orderBy,i=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){let e=this.getFieldsIndex();i={keyFields:r.map((t,r)=>({name:e.normalizeFieldName(t)??t,asc:null==a||1===a._directions[r]}))}}let l=null,s=!1;null!=a&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==i||(0,m.MJ)(r,0,r.length,a._fields,0,Math.min(a._fields.length,r.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(l=a.toOrderByFields(),s=!0),l??=r.slice();let n=e.statistics.map(e=>new v.A({onStatisticField:null===e.workingexpr?"":(0,p.YY)(e.workingexpr,t),outStatisticFieldName:e.field,statisticType:e.toStatisticsName()})),u=this._maxQueryRate(),o=this._layer.capabilities?.query.maxRecordCount;null!=o&&o<u&&(u=o);let d=null==e.where?null==e.spatialFilter?"1=1":"":(0,p.YY)(e.where,t),y=this._createQuery();if(y.where=(0,g.mA)(y.where,d),null!=e.spatialFilter){let t=(0,c.rj)(e.spatialFilter.relation);y.spatialRelationship=t.spatialRelationship,y.relationParameter=t.relationParameter,y.geometry=e.spatialFilter.geometry}return y.orderByFields=l,y.outFields=["*"],y.outStatistics=n,y.groupByFieldsForStatistics=r,y.returnGeometry=!1,null==i?{filterApplied:!0,spatialFilterApplied:!0,ordered:s,features:this._queryPaginated(y,u,u,null,e.abortSignal)}:{filterApplied:!0,spatialFilterApplied:!0,ordered:s,features:this._queryKeysetPaginated(y,i,e.abortSignal)}}async*_queryKeysetPaginated(e,t,r){let a=e.where;for(;;){if(null!=t.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new y.dr("NotImplemented");e.where=(0,g.mA)(a,(0,p.YY)(t.clause,await this.databaseType()))}let i=await this.executeQuery(e,"execute");if((0,y.dZ)(r),!i.hasOwnProperty("features"))throw new y.dr("InvalidStatResponse");if(yield i.features,0===i.features.length||!0!==i.exceededTransferLimit)break;T(t,i.features.at(-1))}}_createQuery(){let e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){let r="execute"===t?async e=>{let t=await this._layer.source.queryFeaturesJSON(e);return(0,c.Rn)(t.features,t.spatialReference??this.spatialReference.toJSON()),t}:"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer),a=null;if(this._recentlyUsedQueries){let t=this.convertQueryToLruCacheKey(e);a=this._recentlyUsedQueries.getFromCache(t),null===a&&(a=r(e),this._recentlyUsedQueries.addToCache(t,a),a=a.catch(e=>{throw this._recentlyUsedQueries?.removeFromCache(t),e}))}return this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===a&&(a=r(e)),a}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];let t=e.slice();if(t.includes("*"))return t;let r=!1;for(let e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}static create(e,t,r,a,i){let l=new F.default({url:e,outFields:null===t?["*"]:t});return new C({layer:l,spatialReference:r,lrucache:a,interceptor:i})}relationshipMetadata(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,h.Qi)(this._layer.parsedUrl.path)}async queryAttachments(e,t,r,a,i){let l=this._layer;if(!function(e){let t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}(l))return[];let s=new S.A({objectIds:[e],returnMetadata:i});(t&&t>0||r&&r>0)&&(s.size=[t&&t>0?t:0,r&&r>0?r:t+1]),a&&a.length>0&&(s.attachmentTypes=a),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:l,query:s,method:"attachments"});let n=await l.queryAttachments(s);return n?.[e]?n[e].map(t=>{let r=`${this._layer.parsedUrl.path}/${e}/attachments/${t.id}`,a=null;return i&&t.exifInfo&&(a=(0,d.Tg)(t.exifInfo)),new o.A(t.id,t.name,t.contentType,t.size,r,a,t.keywords??null)}):[]}async queryRelatedFeatures(e){let t=(0,b.dw)(e);t.f="json",this._requestStandardised&&(t.sqlFormat="standard"),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});let r=await(0,a.A)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(r.data){let e={},t=r.data;if(t?.relatedRecordGroups){let r=t.spatialReference,a=!0===t.exceededTransferLimit;for(let i of t.relatedRecordGroups)(0,c.Rn)(i.relatedRecords,r),e[i.objectId]={features:i.relatedRecords,exceededTransferLimit:a}}return e}throw new y.dr("InvalidRequest")}async getFeatureByObjectId(e,t){let r=this._createQuery();r.outFields=t,r.returnGeometry=!1,r.outSpatialReference=this.spatialReference,r.where=(0,g.mA)(r.where,this.objectIdField+"="+e.toString()),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:r,method:"execute"});let a=await this._layer.source.queryFeaturesJSON(r);return 1===a.features.length?((0,c.Rn)(a.features,a.spatialReference??this.spatialReference.toJSON()),a.features[0]):null}async getIdentityUser(){await this.load();let e=n.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();let e=n.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl??"";let t=this._layer.url,r=t.toLowerCase().indexOf("/rest/services");if(t=r>-1?t.slice(0,r):t,t){t+="/rest/info";try{let e=await(0,a.A)(t,{query:{f:"json"}}),r="";return e.data?.owningSystemUrl&&(r=e.data.owningSystemUrl),r}catch{return""}}return""}getDataSourceFeatureSet(){let e=new C({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this._recentlyUsedQueries??void 0,interceptor:this._featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this._featureSetInfo)return this._featureSetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null,r=this._layer.parsedUrl?.path??null;if(r){let i=await(0,a.A)(r,{responseType:"json",query:{f:"json"}});e=i?.data?.name??null,t=i?.data?.serviceItemId??null}let i=this._layer.title&&null!==(this._layer.parent??null);return this._featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===t?null:t,serviceLayerUrl:""===r?null:r,webMapLayerId:i?this._layer.id??null:null,webMapLayerTitle:i?this._layer.title??null:null,className:null,objectClassId:null},this._featureSetInfo}}var A=r(30235);const R=new FinalizationRegistry(e=>{e.abort()});class L extends c.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerParquet",this._outFields=null,this._returnGeometry=!0,this._ignoreDefinitionExpression=!1,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),null!=e.outFields&&(this._outFields=e.outFields),null!=e.includeGeometry&&(this._returnGeometry=e.includeGeometry)}_maxQueryRate(){return 1e3}async loadImpl(){return this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,this.objectIdField=this._layer.objectIdField,null!==this._outFields)if(1===this._outFields.length&&"*"===this._outFields[0])this._outFields=null;else{let e=new Set(this._outFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._outFields=this.fields.map(({name:e})=>e)}this._databaseType=0}getDataSourceFeatureSet(){let e=new L({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._outFields??void 0,includeGeometry:this._returnGeometry});return e._ignoreDefinitionExpression=!0,e}_createQuery(){let e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this._ignoreDefinitionExpression&&(e.where=null),e}isTable(){return this._layer.isTable}async _queryAll(){return(await this.query({abortSignal:u._})).features}async query(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return c.An;let t={type:"arcade",returnGeometry:this._returnGeometry,returnZ:this.hasZ,returnM:this.hasM,outSpatialReference:(this.spatialReference??this._layer.spatialReference).toJSON(),outFields:Array.from(new Set(this._outFields??this._layer.fields.map(e=>e.name))),where:(0,g.mA)(this._ignoreDefinitionExpression?null:this._layer.definitionExpression,e.where?(0,p.YY)(e.where,0):null),extent:null};if(null!=e.spatialFilter)switch(e.spatialFilter.relation){case"esriSpatialRelIntersects":case"esriSpatialRelContains":case"esriSpatialRelOverlaps":case"esriSpatialRelWithin":case"esriSpatialRelTouches":case"esriSpatialRelCrosses":{let r=e.spatialFilter.geometry.extent;null!=r&&(t.extent=r.toJSON());break}}return{filterApplied:!0,spatialFilterApplied:!1,ordered:!1,features:await this._queryParquetStream(t,e.abortSignal)}}async _queryParquetStream(e,t){let r=new AbortController,a=await this._layer.source._queryStream(e,{signal:r.signal}),i=this._iterateParquetStream(a,r,t);return R.register(i,r,r),i}async*_iterateParquetStream(e,t,r){try{for(;;){let a=await this._layer.source._getStreamNextFeatures(e,{signal:t.signal});if(r.aborted&&(t.abort(),(0,y.dZ)(r)),null==a)break;(0,c.Rn)(a.features,a.spatialReference??this.spatialReference.toJSON()),yield a.features}}finally{R.unregister(t)}}async isEmpty(){return this._totalCount>=0?0===this._totalCount:(this._totalCount=await this._layer.queryFeatureCount(this._createQuery()),this._totalCount<=0)}async queryStat(e){await this._ensureLoaded();let t=(0,f.Dp)(e.stat);if("count"===t)return this._queryCount(e);let r=e.field;if(null==r)throw new y.dr("NeverReach");if(!0!==this._layer.capabilities?.query.supportsStatistics)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,r,e.limit??1e3,e.abortSignal);if("distinct"===t)return{calculated:!1};if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};let a=this._createQuery();if(a.returnGeometry=!1,a.where=(0,g.mA)(a.where,e.where?(0,p.YY)(e.where,0):null),null!=e.spatialFilter){let t=(0,c.rj)(e.spatialFilter.relation);a.spatialRelationship=t.spatialRelationship,a.relationParameter=t.relationParameter,a.geometry=e.spatialFilter.geometry}let i=new v.A;i.statisticType=t,i.onStatisticField=(0,p.YY)(r,0);let l="ARCADE_STAT_RESULT";i.outStatisticFieldName=l,a.outStatistics=[i];let s=await this._layer.source.queryFeaturesJSON(a);if(s.features.length<=0)throw new y.dr("InvalidStatResponse");let n=s.features[0].attributes[l];return{calculated:!0,result:"esriFieldTypeDate"===s.fields?.find(e=>e.name===l)?.type&&null!=n?new Date(n):n}}async _queryCount(e){if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};let t=this._createQuery();if(t.where=(0,g.mA)(t.where,e.where?(0,p.YY)(e.where,0):null),null!=e.spatialFilter){let r=(0,c.rj)(e.spatialFilter.relation);t.spatialRelationship=r.spatialRelationship,t.relationParameter=r.relationParameter,t.geometry=e.spatialFilter.geometry}return t.returnGeometry=!1,{calculated:!0,result:await this._layer.queryFeatureCount(t)}}async canQueryAggregate(e){return await this._ensureLoaded(),!0===this._layer.capabilities?.query?.supportsStatistics&&null==e.spatialFilter}async queryAggregate(e){await this._ensureLoaded();let t=this._createQuery();return t.where=(0,g.mA)(t.where,e.where?(0,p.YY)(e.where,0):null),t.orderByFields=e.orderBy?.toOrderByFields(),t.outFields=["*"],t.outStatistics=e.statistics.map(e=>new v.A({onStatisticField:null===e.workingexpr?"":(0,p.YY)(e.workingexpr,0),outStatisticFieldName:e.field,statisticType:e.toStatisticsName()})),t.groupByFieldsForStatistics=e.groupBy,t.returnGeometry=!1,{filterApplied:!0,spatialFilterApplied:!0,ordered:null!=e.orderBy,features:async function*(){let r=await this._layer.source.queryFeaturesJSON(t);(0,y.dZ)(e.abortSignal);for(let e of(0,m.Ho)(r.features,this._maxQueryRate()))(0,c.Rn)(e,r.spatialReference??this.spatialReference.toJSON()),yield e}.apply(this)}}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}async queryAttachments(){return[]}serviceUrl(){return""}relationshipMetadata(){return[]}get gdbVersion(){return""}getFeatureByObjectId(){throw new y.dr("NeverReach")}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone}get datesInUnknownTimezone(){return!1}get editFieldsInfo(){return null}get timeInfo(){return null}async getFeatureSetInfo(){let e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}var M=r(26591);class q extends c.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._removeGeometry=!1,this._overrideFields=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),this._findObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return 1e3}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{let e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}let e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return this._databaseType=await this._relatedLayer.databaseType(),this._databaseType}isTable(){return this._relatedLayer.isTable()}async _queryAll(){return(await this.query({abortSignal:u._})).features}async query(e){if(await this._ensureLoaded(),await this.databaseType(),this.isTable()&&null!=e.spatialFilter)return c.An;let t=this._layer.nativeCapabilities();if(!1===t.canQueryRelated)return c.An;if(t.capabilities?.queryRelated.supportsPagination)return this._queryUsingPaging(t.source,e);let r=null,a=!1;null!=e.orderBy&&t.capabilities?.queryRelated.supportsOrderBy&&(r=e.orderBy.toOrderByFields(),a=!0);let i=new M.default;return i.objectIds=[this._findObjectId],i.outFields=null===this._overrideFields?this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]):this._overrideFields,i.relationshipId=this.relationship.id,i.where="1=1",i.returnGeometry=!0!==this._removeGeometry,i.outSpatialReference=this.spatialReference,i.orderByFields=r,{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:a,features:async function*(){let r=await t.source.queryRelatedFeatures(i);(0,y.dZ)(e.abortSignal),yield r[this._findObjectId]?r[this._findObjectId].features:[]}.apply(this)}}async _queryUsingPaging(e,t){let r=null==t.where&&null==t.spatialFilter,a=null,i=!1,l=this._layer.nativeCapabilities();null!=t.orderBy&&(l.capabilities?.queryRelated.supportsOrderBy?(a=t.orderBy.toOrderByFields(),i=!0):r=!1),await this.databaseType();let s=this._maxQueryRate(),n=l.capabilities?.query.maxRecordCount;null!=n&&n<s&&(s=n);let u=new M.default;return u.relationshipId=this.relationship.id,u.objectIds=[this._findObjectId],u.outFields=null===this._overrideFields?this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]):this._overrideFields,u.where="1=1",u.orderByFields=a,u.returnGeometry=!0!==this._removeGeometry,u.outSpatialReference=this.spatialReference,{filterApplied:null==t.where,spatialFilterApplied:null==t.spatialFilter,ordered:i,features:this._queryPaginated(e,u,s,r?t.limit:null,t.abortSignal)}}async*_queryPaginated(e,t,r,a,i){let l;t.num=null==a?r:Math.min(a,r),t.start=0;do{(0,y.dZ)(i),l=(await e.queryRelatedFeatures(t))[this._findObjectId]??{exceededTransferLimit:!1,features:[]},yield l.features,t.start+=l.features.length,t.num=null==a?r:Math.min(a-t.start,r)}while(!0===l.exceededTransferLimit)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new y.dr("NeverReach")}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];let t=e.slice();if(t.includes("*"))return t;let r=!1;for(let e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}get gdbVersion(){return this._relatedLayer.gdbVersion}relationshipMetadata(){return this._relatedLayer.relationshipMetadata()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,r,a,i){return this._relatedLayer.queryAttachments(e,t,r,a,i)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer.editFieldsInfo??null}get timeInfo(){return this._relatedLayer.timeInfo??null}getFeatureSetInfo(){return this._relatedLayer.getFeatureSetInfo()}}var O=r(23732),k=r(92474),j=r(4146),D=r(99680),N=r(15584),x=r(80812);function Z(){null===O.A.applicationCache&&(O.A.applicationCache=new O.A)}async function U(e,t,r){if(O.A.applicationCache){let r=O.A.applicationCache.getLayerInfo(e);if(r){let a=await r;return new F.default({url:e,outFields:t,sourceJSON:a})}let a=new F.default({url:e,outFields:t}),i=(async()=>(await a.load(),a.sourceJSON))();if(O.A.applicationCache){O.A.applicationCache.setLayerInfo(e,i);try{return await i,a}catch(t){throw O.A.applicationCache.clearLayerInfo(e),t}}return await i,a}if(null!=r){let a=r.getCachedLayerMetadata(e);if(a){let r=await a;return new F.default({url:e,outFields:t,sourceJSON:r})}let i=new F.default({url:e,outFields:t}),l=(async()=>(await i.load(),i.sourceJSON))();r.setCachedLayerMetadata(e,l);try{return await l,i}catch(t){throw r.removeCachedLayerMetadata(e,l),t}}return new F.default({url:e,outFields:t})}async function E(e,t,r,a,i,l=null){return P(await U(e,["*"],i),t,r,a,i,l)}function P(e,t=null,r=null,a=!0,i=null,l=null){switch(e.type){case"catalog-footprint":return P(e.parent,t,r,a,i,l);case"subtype-sublayer":{let n=P(e.parent,t,r,a,i,l);return new s.A({parentfeatureset:n,whereclause:w.A.create(e.parent.subtypeField+"="+e.subtypeCode.toString(),{fieldsIndex:e.parent.fieldsIndex,timeZone:n.dateFieldsTimeZoneDefaultUTC})})}case"csv":case"geojson":case"knowledge-graph-sublayer":case"wfs":return new A.A({layer:e,spatialReference:t,outFields:r,includeGeometry:a,lrucache:i,interceptor:l});case"parquet":return new L({layer:e,spatialReference:t,outFields:r,includeGeometry:a});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{let s={layer:e,spatialReference:t,outFields:r,includeGeometry:a,lrucache:i,interceptor:l};return!e.url&&e.source?new A.A(s):new C(s)}default:throw Error(`Unsupported layer type: ${e.type}`)}}async function Q(e,t){if(null!==O.A.applicationCache){let t=O.A.applicationCache.getLayerInfo(e);if(null!==t)return t}if(null!=t){let r=t.getCachedServiceMetadata(e);if(null!=r)return r}let r=(async()=>{let t=await(0,a.A)(e,{responseType:"json",query:{f:"json"},authMode:"no-prompt"});if(t.data){let e=t.data;return e.layers||=[],e.tables||=[],e}return{layers:[],tables:[]}})();if(null!==O.A.applicationCache){O.A.applicationCache.setLayerInfo(e,r);try{return await r}catch(t){throw O.A.applicationCache.clearLayerInfo(e),t}}if(null!=t){t.setCachedServiceMetadata(e,r);try{return await r}catch(a){throw t.removeCachedServiceMetadata(e,r),a}}return r}async function B(e,t,r){let i={metadata:null,networkId:-1,unVersion:3,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map,queryelem:null,layerNameLkp:{},lkp:null},l=await Q(e,null);if(i.metadata=l,void 0!==l.controllerDatasetLayers?.utilityNetworkLayerId&&null!==l.controllerDatasetLayers.utilityNetworkLayerId){if(l.layers)for(let e of l.layers)i.layerNameLkp[e.id]=e.name;if(l.tables)for(let e of l.tables)i.layerNameLkp[e.id]=e.name;let n=l.controllerDatasetLayers.utilityNetworkLayerId;i.networkId=n;let u=await async function(e,t){let r="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==O.A.applicationCache){let e=O.A.applicationCache.getLayerInfo(r);if(null!==e)return e}let i=(async()=>{let r=await(0,a.A)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(r.data){let e=r.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new y.dr("DataElementsNotFound")})();if(null!==O.A.applicationCache){O.A.applicationCache.setLayerInfo(r,i);try{return await i}catch(e){throw O.A.applicationCache.clearLayerInfo(r),e}}return i}(e,n);if(u){i.queryelem=u,i.queryelem?.dataElement&&void 0!==i.queryelem.dataElement.schemaGeneration&&(i.unVersion=i.queryelem.dataElement.schemaGeneration),i.lkp={},i.queryelem.dataElement.domainNetworks||(i.queryelem.dataElement.domainNetworks=[]);for(let e of i.queryelem.dataElement.domainNetworks){for(let t of e.edgeSources??[]){let e={layerId:t.layerId,sourceId:t.sourceId,className:i.layerNameLkp[t.layerId]??null};i.layerIdLookup.set(e.layerId,e),i.sourceIdLookup.set(e.sourceId,e),e.className&&(i.lkp[e.className]=e)}for(let t of e.junctionSources??[]){let e={layerId:t.layerId,sourceId:t.sourceId,className:i.layerNameLkp[t.layerId]??null};i.layerIdLookup.set(e.layerId,e),i.sourceIdLookup.set(e.sourceId,e),e.className&&(i.lkp[e.className]=e)}}if(i.queryelem.dataElement.terminalConfigurations)for(let e of i.queryelem.dataElement.terminalConfigurations)for(let t of e.terminals)i.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});let l=await async function(e){if(null!==O.A.applicationCache){let t=O.A.applicationCache.getLayerInfo(e);if(null!==t)return t}let t=(async()=>{let t=await(0,a.A)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==O.A.applicationCache){O.A.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw O.A.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+n);if(void 0!==l.systemLayers?.associationsTableId&&null!==l.systemLayers.associationsTableId){let a=null;if(r&&i.unVersion<8){let r=[];i.unVersion>=4&&(r.push("STATUS"),r.push("PERCENTALONG")),a=await E(e+"/"+l.systemLayers.associationsTableId,t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...r],!1,null,null),await a.load(),i.unVersion>=4&&(a=new s.A({parentfeatureset:a,whereclause:w.A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:a.getFieldsIndex(),timeZone:a.dateFieldsTimeZoneDefaultUTC})}),await a.load())}return{lkp:i.lkp,associations:a,unVersion:i.unVersion,terminals:i.terminals,layerIdLookup:i.layerIdLookup,sourceIdLookup:i.sourceIdLookup}}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}async function G(e,t,r,a=null,i=null,l=!0,s=null,n=null){let u=e.serviceUrl();if(!u)return null;u=u.endsWith("/")?u+t.relatedTableId.toString():u+"/"+t.relatedTableId.toString();let o=await E(u,a,i,l,s,n);return new q({layer:e,relatedLayer:o,relationship:t,objectId:r,spatialReference:a,outFields:i,includeGeometry:l,lrucache:s,interceptor:n})}class J extends i{constructor(e,t=null,r=null,a=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=a,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,r=null){let a=P(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:a,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),a}async listAll(){(0,k.Zm)(this._map)&&!this._map.loaded&&await this._map.load();let e=this._map.allLayers.toArray().filter(e=>(0,h.eB)(e)).map(e=>({id:e.id,name:e.title})),t=this._map.allTables.toArray().filter(e=>(0,h.eB)(e)).map(e=>({id:e.id,name:e.title}));return e.concat(t)}async featureSetByName(e,t=!0,r=null){if((0,k.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();let a=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){let i=this._instantLayers[r];if(i.opitem.title===e&&i.includeGeometry===t&&i.outFields===a)return this._instantLayers[r].featureset}let i=this._map.allLayers.find(t=>(0,h.eB)(t)&&t.title===e);if(null!=i)return this._makeAndAddFeatureSet(i,t,r);if(this._map.allTables){let a=this._map.allTables.find(t=>(0,h.eB)(t)&&t.title===e);if(null!=a)return this._makeAndAddFeatureSet(a,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){if((0,k.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();let a=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){let i=this._instantLayers[r];if(i.opitem.id===e&&i.includeGeometry===t&&i.outFields===a)return this._instantLayers[r].featureset}let i=this._map.allLayers.find(t=>(0,h.eB)(t)&&t.id===e);if(i)return this._makeAndAddFeatureSet(i,t,r);if(this._map.allTables){let a=this._map.allTables.find(t=>(0,h.eB)(t)&&t.id===e);if(null!=a)return this._makeAndAddFeatureSet(a,t,r)}return null}}class Y extends i{constructor(e,t=null,r=null,a=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=a,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,r=null){let a=P(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache);return this._instantLayers.push({featureset:a,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),a}async _loadMetaData(){let e=await Q(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new Y(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async listAll(){let e=await this._loadMetaData();return e.layers.concat(e.tables)}async featureSetByName(e,t=!0,r=null){null===r&&(r=["*"]),r=(r=r.slice()).sort();let a=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){let i=this._instantLayers[r];if(i.opitem.title===e&&i.includeGeometry===t&&i.outFields===a)return this._instantLayers[r].featureset}let i=await this._loadMetaData(),l=null;for(let t of i.layers??[])t.name===e&&(l=t);if(!l)for(let t of i.tables??[])t.name===e&&(l=t);if(l){let e=await U(this._url+"/"+l.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){null===r&&(r=["*"]),r=(r=r.slice()).sort();let a=JSON.stringify(r);e=null==e?"":e.toString();for(let r=0;r<this._instantLayers.length;r++){let i=this._instantLayers[r];if(i.opitem.id===e&&i.includeGeometry===t&&i.outFields===a)return this._instantLayers[r].featureset}let i=await this._loadMetaData(),l=null;for(let t of i.layers??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(l=t);if(!l)for(let t of i.tables??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(l=t);if(l){let e=await U(this._url+"/"+l.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}}function V(e,t,r=null,a=null){return new J(e,t,r,a)}function K(e,t,r=null,a=null){return new Y(e,t,r,a)}function $(e,t,r,a,i){if(null===e)return null;if((0,l.k)(e)){switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}if(e instanceof j.A&&(0,h.eB)(e)){switch(t){case"datasource":return P(e,i,"outFields"in e?e.outFields:null,!0,r,a).getDataSourceFeatureSet();case"parent":case"root":return P(e,i,"outFields"in e?e.outFields:null,!0,r,a)}return null}if((0,l.a4)(e)){switch(t){case"datasource":return P(e.parent,i,e.parent.outFields,!0,r,a).getDataSourceFeatureSet();case"parent":case"root":return P(e,i,e.parent.outFields,!0,r,a)}return null}return null}async function z(e,t,r,a,i,l,s,n=null){if(O.A.applicationCache){let u=O.A.applicationCache.getLayerInfo(e+":"+l.url);if(u)return H(await u,t,r,a,i,s,n)}if(null!=s){let u=s.getCachedPortalItem(l.url,e);if(null!=u)return await H(await u,t,r,a,i,s,n)}let u=new x.default({id:e,portal:l}).load();O.A.applicationCache?O.A.applicationCache.setLayerInfo(e+":"+l.url,u):s?.setCachedPortalItem(l.url,e,u);try{return await H(await u,t,r,a,i,s,n)}catch(t){throw O.A.applicationCache&&O.A.applicationCache.clearLayerInfo(e+":"+l.url),s?.removeCachedPortalItem(l.url,e,u),t}}const W=new Set(["Apache Parquet","Parquet layer","Parquet Layer","Parquet feature layer","Parquet Feature Layer"]);async function H(e,t,r,a,i,l,s){let n;if("Feature Service"===e.type||"Map Service"===e.type)n=await U((0,h.Qi)(e.url??"")+"/"+t,["*"],l);else{if(t)throw Error(`layerId=${t} provided for ${e.type} item`);if(null!=l){let t=l.getCachedPortalItemLayer(e.portal.url,e.id);if(null!=t)n=await t;else{let t=W.has(e.type)?Promise.resolve(new D.default({data:new N.A({portalItem:e})})):j.A.fromPortalItem(e);l.setCachedPortalItemLayer(e.portal.url,e.id,t);try{n=await t}catch(r){throw l.removeCachedPortalItemLayer(e.portal.url,e.id,t),r}}}else n=W.has(e.type)?new D.default({data:new N.A({portalItem:e})}):await j.A.fromPortalItem(e)}return P(n,r,a,i,l,s)}},35704(e,t,r){r.d(t,{A:()=>u});var a=r(48938),i=r(87449),l=r(11221),s=(r(33325),r(80609)),n=r(89696);class u extends l.t1{constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof n.A?(this._whereClause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereClause=null)}_initialiseFeatureSet(){this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes}async _queryAll(){return(await this.query({abortSignal:a._})).features}async query(e){let t=e.where,r=!0;null===this._whereClauseFunction?null==t?t=this._whereClause:null!==this._whereClause&&(t=(0,s.kg)(this._whereClause,t)):r=!1,await this._ensureLoaded();let a=await this._parent.query({...e,where:t,limit:r?e.limit:null});return(0,i.dZ)(e.abortSignal),a.filterApplied&&null==this._whereClauseFunction?a:{...a,features:this._applyFilter(a.features,e.abortSignal)}}async*_applyFilter(e,t){for await(let r of e)if((0,i.dZ)(t),null!=this._whereClause){let e=r.filter(e=>this._whereClause.testFeature(e));e.length>0&&(yield e)}else if(null!=this._whereClauseFunction){let e=[];for(let t of r)await this._whereClauseFunction(t)&&e.push(t);e.length>0&&(yield e)}else yield r}async queryStat(e){if(null!==this._whereClauseFunction)return null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??1e3,e.abortSignal):{calculated:!1};let t=this._whereClause;null!=e.where&&null!==this._whereClause&&(t=(0,s.kg)(this._whereClause,e.where));let r=await this._parent.queryStat({...e,where:t});return r.calculated?r:null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??1e3,e.abortSignal):{calculated:!1}}async canQueryAggregate(e){if(null!==this._whereClauseFunction)return!1;let t=e.where;return null==t?t=this._whereClause:null!==this._whereClause&&(t=(0,s.kg)(this._whereClause,t)),this._parent.canQueryAggregate({...e,where:t})}async queryAggregate(e){let t=e.where;return null==t?t=this._whereClause:null!==this._whereClause&&(t=(0,s.kg)(this._whereClause,t)),this._parent.queryAggregate({...e,where:t})}getFieldsIndex(){return this._parent.getFieldsIndex()}}},30235(e,t,r){r.d(t,{A:()=>h});var a=r(48938),i=r(87449),l=r(11221),s=(r(33325),r(80609)),n=r(4576),u=r(39516),o=r(91075),d=r(18589),y=r(33143),c=r(20437);class h extends l.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return 1e3}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{let e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||this._layer.objectIdField===r||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}this.objectIdField=this._layer.objectIdField;for(let e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=0,this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}async _queryAll(){return(await this.query({abortSignal:a._})).features}_queryLayerFeaturesJSON(e){return"queryFeaturesJSON"in this._layer?this._layer.queryFeaturesJSON(e):this._layer.source.queryFeaturesJSON(e)}async query(e){await this._ensureLoaded();let t=null,r=!1;if(null!=e.orderBy&&(t=e.orderBy.toOrderByFields(),r=!0),this.isTable()&&null!=e.spatialFilter)return l.An;let a=this._createQuery();return a.where=(0,u.mA)(a.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,s.YY)(e.where,0)),null!=e.spatialFilter&&(a.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),a.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),a.geometry=e.spatialFilter.geometry),a.outSpatialReference=this.spatialReference,a.orderByFields=t,a.num=e.limit,{filterApplied:!0,spatialFilterApplied:!0,ordered:r,features:async function*(){let t=await this._queryLayerFeaturesJSON(a);(0,i.dZ)(e.abortSignal);for(let e of(0,n.Ho)(t.features,this._maxQueryRate()))(0,l.Rn)(e,t.spatialReference??this.spatialReference.toJSON()),yield e}.apply(this)}}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new i.dr("NeverReach")}_createQuery(){let e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,e.outFields=this._overrideFields??["*"],e.returnGeometry=!this._removeGeometry,e}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}relationshipMetadata(){return[]}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let r=e.layerDefinition.objectIdField,a=e.layerDefinition.typeIdField??"",i=[];if(e.layerDefinition.types)for(let t of e.layerDefinition.types)i.push(y.A.fromJSON(t));let l=e.layerDefinition.geometryType;void 0===l&&(l=e.featureSet.geometryType||"");let s=e.featureSet.features;if(!r){let t=!1;for(let a of e.layerDefinition.fields)if("oid"===a.type||"esriFieldTypeOID"===a.type){r=a.name,t=!0;break}if(!1===t){let t="FID",a=!0,i=0;for(;a;){let r=!0;for(let a of e.layerDefinition.fields)if(a.name===t){r=!1;break}!0===r?a=!1:(i++,t="FID"+i.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});let l=[];for(let r=0;r<s.length;r++)l.push({geometry:e.featureSet.features[r].geometry,attributes:{...e.featureSet.features[r].attributes,[t]:r}});s=l,r=t}}let n=[];for(let t of e.layerDefinition.fields)t instanceof c.A?n.push(t):n.push(c.A.fromJSON(t));let u=l;switch(u||="",u){case"esriGeometryPoint":u="point";break;case"esriGeometryPolyline":u="polyline";break;case"esriGeometryPolygon":u="polygon";break;case"esriGeometryEnvelope":u="extent";break;case"esriGeometryMultipoint":u="multipoint";break;case"":case"esriGeometryNull":u="esriGeometryNull"}if("esriGeometryNull"!==u){let e=t.toJSON();for(let t of s)t.geometry&&!(t.geometry instanceof o.A)&&(t.geometry.type=u,void 0===t.geometry.spatialReference&&(t.geometry.spatialReference=e))}else for(let e of s)e.geometry&&=null;let p={outFields:["*"],source:s,fields:n,hasZ:!0===e.layerDefinition.hasZ||!0===e.featureSet.hasZ,hasM:!0===e.layerDefinition.hasM||!0===e.featureSet.hasM,types:i,typeIdField:a,objectIdField:r,spatialReference:t},f="esriGeometryNull"===u||null===u;f||(p.geometryType=u);let m=new d.default(p);return e.layerDefinition.subtypeField&&e.layerDefinition.subtypes&&m.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new h({layer:m,spatialReference:t,isTable:f})}async queryAttachments(){return[]}async getFeatureByObjectId(e){let t=this._createQuery();t.where=this.objectIdField+"="+e.toString();let r=await this._queryLayerFeaturesJSON(t);return 1===r.features.length?((0,l.Rn)(r.features,r.spatialReference??this.spatialReference.toJSON()),r.features[0]):null}serviceUrl(){return""}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return"preferredTimeZone"in this._layer?this._layer.preferredTimeZone:null}get dateFieldsTimeZone(){return"dateFieldsTimeZone"in this._layer?this._layer.dateFieldsTimeZone:null}get datesInUnknownTimezone(){return"datesInUnknownTimezone"in this._layer&&this._layer.datesInUnknownTimezone}get editFieldsInfo(){return"editFieldsInfo"in this._layer?this._layer.editFieldsInfo:null}get timeInfo(){return"timeInfo"in this._layer?this._layer.timeInfo:null}async getFeatureSetInfo(){let e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}},88930(e,t,r){r.d(t,{S1:()=>n,VW:()=>u,lL:()=>o,rb:()=>d,t:()=>y});var a=r(97770),i=(r(98623),r(34747));const l=/^(?<hh>([01][0-9])|(2[0-3])):(?<mm>[0-5][0-9])(:(?<ss>[0-5][0-9]))?(\.(?<ms>\d+))?$/,s={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8,unknown:NaN};function n(e,t,r,l="system"){if("unknown"===r)return e;let s=new i.oh((0,a.wj)(l)),n=i.c9.fromJSDate(e,{zone:s}),u="decades"===r||"centuries"===r?"year":function(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}(r);return"decades"===r&&(t*=10),"centuries"===r&&(t*=100),n.plus({[u]:t}).toJSDate()}function u(e,t,r="milliseconds"){let a=e.getTime(),i=y(t,r,"milliseconds");return new Date(a+i)}function o(e,t,r="system"){let{unit:l}=t,s=Math.max(1,Math.trunc(t.value)),n=new i.oh((0,a.wj)(r)),u=i.c9.fromJSDate(e,{zone:n}),o=e=>e-e%s;switch(l){case"milliseconds":return u.startOf("second").plus({millisecond:o(u.millisecond)}).toJSDate();case"seconds":return u.startOf("minute").plus({second:o(u.second)}).toJSDate();case"minutes":return u.startOf("hour").plus({minute:o(u.minute)}).toJSDate();case"hours":return u.startOf("day").plus({hour:o(u.hour)}).toJSDate();case"days":return u.startOf("month").plus({day:o(u.day-1)}).toJSDate();case"weeks":{let e=u.startOf("year").startOf("week"),t=Math.floor(u.diff(e,"weeks").weeks);return e.plus({week:o(t)}).toJSDate()}case"months":return u.startOf("year").plus({month:o(u.month-1)}).toJSDate();case"years":case"decades":case"centuries":{let e=u.startOf("year"),t=("decades"===l?10:"centuries"===l?100:1)*s,r=e.year-e.year%t;return e.set({year:r}).toJSDate()}case"unknown":return e}}function d(e){let t=l.exec(e);if(!t)return null;let{hh:r,mm:a,ss:i,ms:n}=t.groups;return Number(r)*s.hours+Number(a)*s.minutes+Number(i||0)*s.seconds+Number(n||0)}function y(e,t,r){return 0===e?0:e*s[t]/s[r]}},4146(e,t,r){r.d(t,{A:()=>g});var a=r(32198),i=r(56507),l=r(49186),s=r(65529),n=r(4902),u=r(92474),o=r(53966),d=r(17676),y=r(84952),c=r(91429),h=r(5443),p=r(16930),f=r(92602),m=r(79677);let _=0,g=class extends((0,s.Zt)((0,n.s)(u.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new h.A(-180,-90,180,90,p.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+_++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=p.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){let t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(()=>r(27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){let t="portalItem"in e?e:{portalItem:e},{fromItem:a}=await Promise.all([r.e(9917),r.e(812),r.e(5613)]).then(()=>r(45613));try{return await a(t)}catch(e){let r=t?.portalItem,a=r?.id||"unset",i=r?.portal?.url||f.A.portalUrl;throw o.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+a+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,d.zf)(e)||o.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){let{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){let{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,y.An)(this.url)}createLayerView(e,t){return Promise.reject(new l.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){let e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new l.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,a.Cg)([(0,c.MZ)({type:String})],g.prototype,"attributionDataUrl",void 0),(0,a.Cg)([(0,c.MZ)({readOnly:!0})],g.prototype,"effectiveVisible",null),(0,a.Cg)([(0,c.MZ)({type:h.A})],g.prototype,"fullExtent",void 0),(0,a.Cg)([(0,c.MZ)({readOnly:!0})],g.prototype,"hasAttributionData",null),(0,a.Cg)([(0,c.MZ)({type:String,clonable:!1})],g.prototype,"id",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0})],g.prototype,"legendEnabled",void 0),(0,a.Cg)([(0,c.MZ)({type:["show","hide","hide-children"]})],g.prototype,"listMode",void 0),(0,a.Cg)([(0,c.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],g.prototype,"opacity",void 0),(0,a.Cg)([(0,c.MZ)({clonable:!1})],g.prototype,"parent",void 0),(0,a.Cg)([(0,c.MZ)({readOnly:!0})],g.prototype,"parsedUrl",null),(0,a.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],g.prototype,"persistenceEnabled",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean})],g.prototype,"popupEnabled",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean})],g.prototype,"attributionVisible",void 0),(0,a.Cg)([(0,c.MZ)({type:p.A})],g.prototype,"spatialReference",void 0),(0,a.Cg)([(0,c.MZ)({type:String})],g.prototype,"title",void 0),(0,a.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],g.prototype,"type",void 0),(0,a.Cg)([(0,c.MZ)()],g.prototype,"url",void 0),(0,a.Cg)([(0,c.MZ)({type:m.A})],g.prototype,"visibilityTimeExtent",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0})],g.prototype,"visible",void 0),g=(0,a.Cg)([(0,c.$K)("esri.layers.Layer")],g)},52136(e,t,r){var a=r(32198),i=r(91429);r.d(t,["p",0,e=>{let t=e,r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null==e?(this._clearOverride("apiKey"),this.clear("apiKey","user")):this._override("apiKey",e)}};return(0,a.Cg)([(0,i.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,a.Cg)([(0,i.$K)("esri.layers.mixins.APIKeyMixin")],r),r}])},28032(e,t,r){r.d(t,{A:()=>u});var a=r(32198),i=r(69540),l=r(25482),s=r(91429),n=r(56400);let u=class extends((0,i.OU)(l.o)){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};(0,a.Cg)([(0,s.MZ)()],u.prototype,"creatorField",void 0),(0,a.Cg)([(0,s.MZ)()],u.prototype,"creationDateField",void 0),(0,a.Cg)([(0,s.MZ)()],u.prototype,"editorField",void 0),(0,a.Cg)([(0,s.MZ)()],u.prototype,"editDateField",void 0),(0,a.Cg)([(0,s.MZ)()],u.prototype,"realm",void 0),(0,a.Cg)([(0,s.MZ)((0,n.P6)("dateFieldsTimeReference",!0))],u.prototype,"timeZone",void 0),u=(0,a.Cg)([(0,s.$K)("esri.layers.support.EditFieldsInfo")],u)},33143(e,t,r){r.d(t,{A:()=>y});var a=r(32198),i=r(69540),l=r(25482),s=r(91429),n=r(8631),u=r(29005),o=r(36005),d=r(43937);let y=class extends((0,i.OU)(l.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){let t={};for(let r of Object.keys(e))t[r]=(0,n.r)(e[r]);return t}writeDomains(e,t){let r={};for(let t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],y.prototype,"id",void 0),(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],y.prototype,"name",void 0),(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],y.prototype,"domains",void 0),(0,a.Cg)([(0,o.w)("domains")],y.prototype,"readDomains",null),(0,a.Cg)([(0,d.K)("domains")],y.prototype,"writeDomains",null),(0,a.Cg)([(0,s.MZ)({type:[u.A],json:{write:!0}})],y.prototype,"templates",void 0),y=(0,a.Cg)([(0,s.$K)("esri.layers.support.FeatureType")],y)},37352(e,t,r){r.d(t,{A:()=>u});var a,i=r(32198),l=r(7762),s=r(25482),n=r(91429);let u=a=class extends s.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new l.A}clone(){return new a({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,i.Cg)([(0,n.MZ)({type:String,json:{write:{isRequired:!0}}})],u.prototype,"floorField",void 0),(0,i.Cg)([(0,n.MZ)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,i.Cg)([(0,n.MZ)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=a=(0,i.Cg)([(0,n.$K)("esri.layers.support.LayerFloorInfo")],u)},45067(e,t,r){r.d(t,{A:()=>d});var a=r(32198),i=r(69540),l=r(66552),s=r(25482),n=r(91429);const u=new l.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),o=new l.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let d=class extends((0,i.OU)(s.o)){constructor(e){super(e),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,a.Cg)([(0,n.MZ)({json:{read:u.read,write:u.write}})],d.prototype,"cardinality",void 0),(0,a.Cg)([(0,n.MZ)({json:{name:"catalogID"}})],d.prototype,"catalogId",void 0),(0,a.Cg)([(0,n.MZ)({json:{read:!0,write:!0}})],d.prototype,"composite",void 0),(0,a.Cg)([(0,n.MZ)({json:{read:!0,write:!0}})],d.prototype,"id",void 0),(0,a.Cg)([(0,n.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyField",void 0),(0,a.Cg)([(0,n.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyFieldInRelationshipTable",void 0),(0,a.Cg)([(0,n.MZ)({json:{read:!0,write:!0}})],d.prototype,"name",void 0),(0,a.Cg)([(0,n.MZ)({json:{read:!0,write:!0}})],d.prototype,"relatedTableId",void 0),(0,a.Cg)([(0,n.MZ)({json:{read:!0,write:!0}})],d.prototype,"relationshipTableId",void 0),(0,a.Cg)([(0,n.MZ)({json:{read:o.read,write:o.write}})],d.prototype,"role",void 0),d=(0,a.Cg)([(0,n.$K)("esri.layers.support.Relationship")],d)},41560(e,t,r){r.d(t,{Ch:()=>s,mW:()=>l});var a=r(34727),i=r(39516);function l(e,t){return{...t,filterMode:e.mode}}function s(e,t,r){let l=function(e){if("manual"===o(e))return null;let t=[-1/0,1/0];for(let{minScale:r,maxScale:a}of e.filters)t[0]=Math.max(t[0],d(r)),t[1]=Math.min(t[1],y(a));return t}(e);if(l&&((0,a.gg)(t,l[0])||(0,a.ZH)(r,l[1])))return"";let s=Array.from(n(e,t,r)),u=function(e,t,r){if(0===e.length)return!0;let i=d(e.at(0)?.minScale),l=y(e.at(-1)?.maxScale);if((0,a.ZH)(i,t)||(0,a.gg)(l,r))return!0;for(let t=0;t<e.length-1;t++){let r=e[t],i=e[t+1];if((0,a.ZH)(d(i.minScale),y(r.maxScale)))return!0}return!1}(s,t,r)?"1=1":s.map(e=>e.where||"1=1").reduce((e,t)=>(0,i.IW)(e,t),"");return u&&"1=1"!==u?u:""}function*n(e,t,r){if("manual"===o(e)){let t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(let a of e.filters)u(a.minScale,a.maxScale,t,r)&&(yield a)}}function u(e,t,r,i){return e=d(e),r=d(r),t=y(t),!(!(0,a.Sp)(r,e)&&(i??r)>e||(0,a.Hx)(t,r)||void 0!==i&&(0,a.Sp)(i,e))}function o(e){return"mode"in e?e.mode:e.filterMode}function d(e){return e||1/0}function y(e){return e||0}},77548(e,t,r){r.d(t,{Gh:()=>q,tk:()=>C,BR:()=>T,p2:()=>I,qd:()=>A,wI:()=>v,G$:()=>L,$x:()=>R,Ov:()=>w,cM:()=>c,UC:()=>h,Qz:()=>p,OP:()=>M,TU:()=>g,F2:()=>f,XX:()=>_,Qi:()=>F,jy:()=>b});var a=r(70333),i=r(56507),l=r(7762),s=(r(84952),r(36563)),n=r(36708),u=r(4146);const o=new WeakMap;function d(e){return!e.destroyed&&(o.has(e)||e.addHandles([(0,n.wB)(()=>{let{parent:t}=e;return!!(t&&t instanceof u.A)&&("catalog-dynamic-group"===t.type||d(t))},t=>o.set(e,t),n.pc),(0,s.hA)(()=>o.delete(e))]),o.get(e))}function y(e,t){return"object"==typeof e&&!!e&&"type"in e&&e.type===t}function c(e){return y(e,"knowledge-graph")&&"layers"in e}function h(e){return y(e,"knowledge-graph-sublayer")}function p(e){return y(e,"link-chart")&&"layers"in e}function f(e){return y(e,"subtype-group")&&"sublayers"in e}function m(e){let t=e.parent;return function(e){return"group"===e?.type}(t)&&t.tables.includes(e)}r(16215);const _={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function g(e){let t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function w(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function F(e){return"object"==typeof e&&!!e&&"featureReduction"in e}function b(e){return function(e){return y(e,"catalog-footprint")}(e)||function(e){return y(e,"feature")}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)||function(e){return y(e,"oriented-imagery")}(e)||function(e){return"subtype-sublayer"===e?.type}(e)}function S(e){let t=e?.type;return"binning"===t||"cluster"===t}function I(e,t){if(!b(e))return;let r=t?.graphic,a="featureReduction"in e?e.featureReduction:null;if(r){if(r.isAggregate){let e=r.origin;return e&&"featureReductionProvider"in e&&a?S(a)?a:null:void 0}return e}return t?.checkFeatureReduction&&a?S(a)?a:null:e}async function v(e,t){let r=a.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;let l=e.toLowerCase().indexOf("/rest/services");if(-1===l)return null;let s=`${e.slice(0,l)}/rest/info`,n=null==t?null:t.signal,{data:u}=await(0,i.A)(s,{query:{f:"json"},responseType:"json",signal:n});return u?.owningSystemUrl||null}function T(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"annotation-feature":case"catalog":case"catalog-footprint":case"csv":case"dimension-feature":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"parquet":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function C(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function A(e){let t=new l.A;for(let r of e.allLayers.concat(e.allTables))d(r)||m(r)||"annotation-feature"===r.type||"dimension-feature"===r.type||("charts"in r&&t.push(r),"subtype-group"===r.type&&t.push(...r.sublayers));return t}function R(e,t){return null}function L(e){return null}function M(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function q(e,t){if(!t||!M(e))return;let r=(e.url,null);r&&(e.url=r)}},73133(e,t,r){const a=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"});r.d(t,["j",0,a])},10536(e,t,r){function a(e){let t={};for(let r in e){if("declaredClass"===r)continue;let i=e[r];if(null!=i&&"function"!=typeof i)if(Array.isArray(i)){t[r]=[];for(let e=0;e<i.length;e++)t[r][e]=a(i[e])}else"object"==typeof i?i.toJSON&&(t[r]=JSON.stringify(i)):t[r]=i}return t}r.d(t,{z:()=>a})},17126(e,t,r){r.d(t,{dw:()=>s,qD:()=>n,qW:()=>u});var a=r(56507),i=r(21325),l=r(10536);function s(e,t){let r=e.toJSON();return r.objectIds&&=r.objectIds.join(","),r.orderByFields&&=r.orderByFields.join(","),r.outFields&&!t?.returnCountOnly?r.outFields=r.outFields.includes("*")?"*":r.outFields.join(","):delete r.outFields,r.outSR&&=(0,i.YX)(r.outSR),r.dynamicDataSource&&(r.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r}async function n(e,t,r){let a=await o(e,t,r),i=a.data,l=i.geometryType,s=i.spatialReference,n={};for(let e of i.relatedRecordGroups){let t={fields:void 0,geometryType:l,spatialReference:s,hasZ:!!i.hasZ,hasM:!!i.hasM,features:e.relatedRecords};if(null!=e.objectId)n[e.objectId]=t;else for(let r of Object.keys(e))"relatedRecords"!==r&&(n[e[r]]=t)}return{...a,data:n}}async function u(e,t,r){let a=await o(e,t,r,{returnCountOnly:!0}),i=a.data,l={};for(let e of i.relatedRecordGroups)null!=e.objectId&&(l[e.objectId]=e.count);return{...a,data:l}}async function o(e,t,r={},i){let n=(0,l.z)({...e.query,f:"json",...i,...s(t,i)});return(0,a.A)(e.path+"/queryRelatedRecords",{...r,query:{...r.query,...n}})}},16215(e,t,r){r.d(t,{S:()=>i});const a=Symbol("BasemapInstance");function i(e){return"object"==typeof e&&!!e&&a in e}r.d(t,["Y",0,a])},79677(e,t,r){r.d(t,{A:()=>y});var a,i=r(32198),l=r(25482),s=r(88930),n=r(91429),u=(r(98623),r(10184)),o=r(36005),d=r(43937);let y=class extends l.o{static{a=this}static get allTime(){return c}static get empty(){return h}static fromArray(e){return new a({start:null==e[0]?e[0]:new Date(e[0]),end:null==e[1]?e[1]:new Date(e[1])})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null==t.end?null:new Date(t.end)}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(a.allTime)}get isEmpty(){return this.equals(a.empty)}readStart(e,t){return null==t.start?null:new Date(t.start)}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new a({end:this.end,start:this.start})}equals(e){if(!e)return!1;let t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,a=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===a&&r===i}expandTo(e,t="system"){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let r=this.start;r&&=(0,s.lL)(r,new u.A({value:1,unit:e}),t);let i=this.end;if(i){let r=(0,s.lL)(i,new u.A({value:1,unit:e}),t);i=i.getTime()===r.getTime()?r:(0,s.S1)(r,1,e,t)}return new a({start:r,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return a.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();let t,r,i=this.start?.getTime()??-1/0,l=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;return s>=i&&s<=l?t=s:i>=s&&i<=n&&(t=i),l>=s&&l<=n?r=l:n>=i&&n<=l&&(r=n),null==t||null==r||isNaN(t)||isNaN(r)?a.empty:new a({start:t===-1/0?null:new Date(t),end:r===1/0?null:new Date(r)})}offset(e,t,r="system"){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();let i=new a,{start:l,end:n}=this;return null!=l&&(i.start=(0,s.S1)(l,e,t,r)),null!=n&&(i.end=(0,s.S1)(n,e,t,r)),i}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return c.clone();let t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new a({start:t,end:r})}};(0,i.Cg)([(0,n.MZ)({type:Date,json:{write:{allowNull:!0}}})],y.prototype,"end",void 0),(0,i.Cg)([(0,o.w)("end")],y.prototype,"readEnd",null),(0,i.Cg)([(0,d.K)("end")],y.prototype,"writeEnd",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0,json:{read:!1}})],y.prototype,"isAllTime",null),(0,i.Cg)([(0,n.MZ)({readOnly:!0,json:{read:!1}})],y.prototype,"isEmpty",null),(0,i.Cg)([(0,n.MZ)({type:Date,json:{write:{allowNull:!0}}})],y.prototype,"start",void 0),(0,i.Cg)([(0,o.w)("start")],y.prototype,"readStart",null),(0,i.Cg)([(0,d.K)("start")],y.prototype,"writeStart",null),y=a=(0,i.Cg)([(0,n.$K)("esri.time.TimeExtent")],y);const c=new y,h=new y({start:void 0,end:void 0})},10184(e,t,r){r.d(t,{A:()=>d});var a=r(32198),i=r(69540),l=r(25482),s=r(88930),n=r(91429),u=r(73133),o=r(93223);let d=class extends((0,i.OU)(l.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,s.t)(this.value,this.unit,"milliseconds")}};(0,a.Cg)([(0,o.e)(u.j,{nonNullable:!0})],d.prototype,"unit",void 0),(0,a.Cg)([(0,n.MZ)({type:Number,json:{write:!0},nonNullable:!0})],d.prototype,"value",void 0),d=(0,a.Cg)([(0,n.$K)("esri.time.TimeInterval")],d)}}]);