@arcgis/core 4.28.0-next.20230912 → 4.28.0-next.20230913
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.
- package/arcade/featureset/support/errorsupport.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{aa78ca83a4b582b6c2b6.js → 6d94b358e8d1cf79bba3.js} +1 -1
- package/assets/esri/core/workers/chunks/8aa7e994b74f66522c37.js +1 -0
- package/assets/esri/core/workers/chunks/a047fcf3c7307a69b63c.js +1 -0
- package/assets/esri/core/workers/chunks/c51233ad51823cb98c35.js +1 -0
- package/assets/esri/core/workers/chunks/dbf343d1fb746f99bb6e.js +1 -0
- package/assets/esri/core/workers/chunks/{271ec1d1666bf6dc3dda.js → dc74b4ec85e8e3de5b27.js} +1 -1
- package/assets/esri/themes/base/widgets/_Sketch.scss +0 -5
- package/assets/esri/themes/base/widgets/_SketchTooltipControls.scss +0 -5
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/sql/DateOnly.js +1 -1
- package/core/sql/TimeOnly.js +1 -1
- package/interfaces.d.ts +190 -144
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/DisplayId.js +1 -1
- package/views/2d/engine/webgl/Utils.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/settings.js +1 -1
- package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/animation/easing.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/support/SketchTooltipControls/SketchTooltipControlsViewModel.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/15056f91d87f11b00bcc.js +0 -1
- package/assets/esri/core/workers/chunks/877302d6e39a0d530aab.js +0 -1
- package/assets/esri/core/workers/chunks/aedb1f944b332b098933.js +0 -1
- package/assets/esri/core/workers/chunks/c8dd21a332559c99815c.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8968],{59987:(e,t,r)=>{r.d(t,{EN:()=>c,H9:()=>u,eS:()=>s,f:()=>n});var n,a,i=r(27535);(a=n||(n={})).InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="rimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters";const o={[n.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[n.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[n.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[n.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[n.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[n.UnsupportedOperator]:"Unsupported operator - {operator}",[n.UnsupportedSyntax]:"Unsupported syntax - {node}",[n.UnsupportedSqlFunction]:"Sql function not found = {function}",[n.InvalidDataType]:"Invalid sql data type",[n.InvalidDate]:"Invalid date encountered",[n.InvalidOperator]:"Invalid operator encountered",[n.InvalidTime]:"Invalid time encountered",[n.IllegalInterval]:"Illegal interval",[n.FunctionNotRecognized]:"Function not recognized",[n.InvalidTimeStamp]:"Invalid timestamp encountered",[n.InvalidParameterCount]:"Invalid parameter count for call to {name}",[n.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[n.YearMonthIntervals]:"Year-Month Intervals not supported",[n.CannotCastValue]:"Cannot cast value to the required data type"};class s extends Error{constructor(e,t){super((0,i.Hy)(o[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,s)}}var u;!function(e){e.NeverReach="NeverReach",e.NotImplemented="NotImplemented",e.Cancelled="Cancelled",e.InvalidStatResponse="InvalidStatResponse",e.InvalidRequest="InvalidRequest",e.RequestFailed="RequestFailed",e.MissingFeatures="MissingFeatures",e.AggregationFieldNotFound="AggregationFieldNotFound",e.DataElementsNotFound="DataElementsNotFound"}(u||(u={}));const l={[u.Cancelled]:"Cancelled",[u.InvalidStatResponse]:"Invalid statistics response from service",[u.InvalidRequest]:"Invalid request",[u.RequestFailed]:"Request failed - {reason}",[u.MissingFeatures]:"Missing features",[u.AggregationFieldNotFound]:"Aggregation field not found",[u.DataElementsNotFound]:"Data elements not found on service",[u.NeverReach]:"Encountered unreachable logic",[u.NotImplemented]:"Not implemented"};class c extends Error{constructor(e,t){super((0,i.Hy)(l[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,c)}}},41555:(e,t,r)=>{r.d(t,{H:()=>i});var n=r(17126);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}class i{constructor(e){this._timeStampOffset=e,this._date=null}toDateTime(){return this._date??=n.ou.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return a(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return a(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return i.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new i(n.ou.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new i(e.toISO({includeOffset:!0}))}static fromParts(e,t,r=0,n=0,a=0,o=0,s=0,u=!1,l=0,c=0){const f=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}`;let d="";o<10&&(d="0");let p=`${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+o.toString()}`;0!==s&&(p+="."+s.toString().padStart(3,"0"));const m=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new i(f+"T"+p+m)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const t=this.toDateTime().plus(e);return i.fromDateTime(t)}}},8968:(e,t,r)=>{r.r(t),r.d(t,{WhereClause:()=>ne,defaultAttributeAdapter:()=>me});var n=r(48853),a=r(59987),i=r(80442),o=r(22641),s=r(41555),u=r(53970),l=r(17126);function c(e,t){const r=f[e.toLowerCase()];return null!=r&&t>=r.minParams&&t<=r.maxParams}const f={min:{minParams:1,maxParams:1,evaluate:e=>m(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>m(e[0],"max")},avg:{minParams:1,maxParams:1,evaluate:e=>d(e[0])},sum:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;let t=0;for(let r=0;r<e.length;r++){const n=e[r];if(null!==n){if(!p(n))throw new a.eS(a.f.InvalidValueForAggregateFunction);t+=n}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=v(e);return null===t?null:Math.sqrt(t)}(e[0])},count:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].length},var:{minParams:1,maxParams:1,evaluate:e=>v(e[0])}};function d(e){if(null===e)return null;let t=0,r=0;for(let n=0;n<e.length;n++){const i=e[n];if(null!==i){if(!p(i))throw new a.eS(a.f.InvalidValueForAggregateFunction);r++,t+=i}}return 0===r?null:t/e.length}function p(e){return"number"==typeof e}function m(e,t){if(null===e)return null;let r=null,n=null;for(const a of e){let e=a;e=a instanceof o.u||a instanceof u.n?a.toNumber():a instanceof l.ou?a.toMillis():a instanceof s.H?a.toMilliseconds():a,(null===r||"max"===t&&null!==n&&null!==e&&n<=e||"min"===t&&null!==n&&null!==e&&n>=e)&&(r=a,n=e)}return r}function v(e){if(null===e)return null;if(0===(e=e.filter((e=>null!==e))).length)return null;const t=d(e);if(null===t)return null;let r=0;for(const n of e){if(!p(n))throw new a.eS(a.f.InvalidValueForAggregateFunction);r+=(t-n)**2}return r/(e.length-1)}class h{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(e){if(null!==e.precision||null!==e.secondary)throw new a.eS(a.f.PrimarySecondaryQualifiers)}static _parseSecondsComponent(e,t){if(t.includes(".")){const r=t.split(".");e.second=parseFloat(r[0]),e.millis=parseInt(r[1],10)}else e.second=parseFloat(t)}static createFromMilliseconds(e){const t=new h;return t.second=e/1e3,t}static createFromValueAndQualifer(e,t,r){let n=null;const i=new h;if(i.op="-"===r?"-":"+","interval-period"===t.type){h._fixDefaults(t);const r=new RegExp("^[0-9]{1,}$");if("year"===t.period||"month"===t.period)throw new a.eS(a.f.YearMonthIntervals);if("second"===t.period){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new a.eS(a.f.IllegalInterval);h._parseSecondsComponent(i,e)}else{if(!r.test(e))throw new a.eS(a.f.IllegalInterval);i[t.period]=parseFloat(e)}}else{if(h._fixDefaults(t.start),h._fixDefaults(t.end),"year"===t.start.period||"month"===t.start.period||"year"===t.end.period||"month"===t.end.period)throw new a.eS(a.f.YearMonthIntervals);switch(t.start.period){case"day":switch(t.end.period){case"hour":if(n=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);i[t.start.period]=parseFloat(e.split(" ")[0]),i[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(n=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);{i[t.start.period]=parseFloat(e.split(" ")[0]);const r=e.split(" ")[1].split(":");i.hour=parseFloat(r[0]),i.minute=parseFloat(r[1])}break;case"second":if(n=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);{i[t.start.period]=parseFloat(e.split(" ")[0]);const r=e.split(" ")[1].split(":");i.hour=parseFloat(r[0]),i.minute=parseFloat(r[1]),h._parseSecondsComponent(i,r[2])}break;default:throw new a.eS(a.f.IllegalInterval)}break;case"hour":switch(t.end.period){case"minute":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);i.hour=parseFloat(e.split(":")[0]),i.minute=parseFloat(e.split(":")[1]);break;case"second":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);{const t=e.split(":");i.hour=parseFloat(t[0]),i.minute=parseFloat(t[1]),h._parseSecondsComponent(i,t[2])}break;default:throw new a.eS(a.f.IllegalInterval)}break;case"minute":if("second"!==t.end.period)throw new a.eS(a.f.IllegalInterval);if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);{const t=e.split(":");i.minute=parseFloat(t[0]),h._parseSecondsComponent(i,t[1])}break;default:throw new a.eS(a.f.IllegalInterval)}}return i}valueInMilliseconds(){return("-"===this.op?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const w=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,S=/^(\d{1,2}):(\d{1,2})$/,I=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,N=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,O=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function C(e,t){switch(t){case"system":case"local":case null:return l.ou.fromJSDate(e);default:return l.ou.fromJSDate(e).setZone(t)}}function x(e){return"number"==typeof e}function b(e){return"string"==typeof e||e instanceof String}function A(e){return e instanceof h}function E(e){return e instanceof Date}function M(e){return e instanceof l.ou}function F(e){return e instanceof o.u}function R(e){return e instanceof u.n}function _(e){return e instanceof s.H}function D(e){let t=w.exec(e);if(null!==t){const[,e,r,n]=t,i=u.n.fromParts(parseInt(e,10),parseInt(r,10),parseInt(n,10),0);if(null!==i)return i;throw new a.eS(a.f.InvalidTime)}if(t=S.exec(e),null!==t){const[,e,r]=t,n=u.n.fromParts(parseInt(e,10),parseInt(r,10),0,0);if(null!==n)return n;throw new a.eS(a.f.InvalidTime)}if(t=I.exec(e),null!==t){const[,e,r,n,i]=t,o=u.n.fromParts(parseInt(e,10),parseInt(r,10),parseInt(n,10),parseInt(i,10));if(null!==o)return o;throw new a.eS(a.f.InvalidTime)}throw new a.eS(a.f.InvalidTime)}function P(e,t,r=!1){let n=y.exec(e);if(null!==n){const[,e,r,i,o,s,u,c]=n,f=l.ou.fromObject({year:parseInt(e,10),month:parseInt(r,10),day:parseInt(i,10),hour:parseInt(o,10),minute:parseInt(s,10),second:parseInt(u,10),millisecond:c?parseInt(c.replace(".",""),10):0},{zone:t});if(!1===f.isValid)throw new a.eS(a.f.InvalidTimeStamp);return f}if(n=T.exec(e),null!==n){const[,e,t,r,i,o,u,l,c,f,d]=n,p=s.H.fromParts(parseInt(e,10),parseInt(t,10),parseInt(r,10),parseInt(i,10),parseInt(o,10),parseInt(u,10),l?parseInt(l.replace(".",""),10):0,"-"===c,parseInt(f,10),parseInt(d,10));if(!1===p.isValid)throw new a.eS(a.f.InvalidTimeStamp);return p}if(n=N.exec(e),null!==n){const[,e,t,r,i,o,u,l,c]=n,f=s.H.fromParts(parseInt(e,10),parseInt(t,10),parseInt(r,10),parseInt(i,10),parseInt(o,10),0,0,"-"===u,parseInt(l,10),parseInt(c,10));if(!1===f.isValid)throw new a.eS(a.f.InvalidTimeStamp);return f}if(n=O.exec(e),null!==n){const[,e,r,i,o,s]=n,u=l.ou.fromObject({year:parseInt(e,10),month:parseInt(r,10),day:parseInt(i,10),hour:parseInt(o,10),minute:parseInt(s,10),second:0},{zone:t});if(!1===u.isValid)throw new a.eS(a.f.InvalidTimeStamp);return u}if(n=g.exec(e),null!==n){const[,e,r,i]=n,o=l.ou.fromObject({year:parseInt(e,10),month:parseInt(r,10),day:parseInt(i,10),hour:0,minute:0,second:0},{zone:t});if(!1===o.isValid)throw new a.eS(a.f.InvalidTimeStamp);return o}throw new a.eS(a.f.InvalidTimeStamp)}function L(e,t){const r=g.exec(e);if(null===r)try{return P(e,t)}catch{throw new a.eS(a.f.InvalidDate)}const[,n,i,s]=r,u=o.u.fromParts(parseInt(n,10),parseInt(i,10),parseInt(s,10));if(null===u)throw new a.eS(a.f.InvalidDate);return u}var U=r(19153);function J(e){return!!M(e)||!!_(e)}function Z(e){if(M(e))return e.toMillis();if(F(e))return e.toNumber();if(_(e))return e.toMilliseconds();throw new a.eS(a.f.InvalidDataType)}function V(e,t,r,n){if(null==e||null==t)return null;if(x(e)){if(x(t))return $(e,t,r);if(b(t))return function(e,t,r){const n=parseFloat(t);if(!isNaN(n))return $(e,n,r);const a=e.toString();switch(r){case"<>":return a!==t;case"=":return a===t;case">":return a>t;case"<":return a<t;case">=":return a>=t;case"<=":return a<=t}}(e,t,r);if(M(i=t)||F(i)||_(i)||R(i))throw new a.eS(a.f.InvalidOperator);if(F(t))throw new a.eS(a.f.InvalidOperator)}else if(b(e)){if(x(t))return function(e,t,r){const n=parseFloat(e);if(!isNaN(n))return $(n,t,r);const a=t.toString();switch(r){case"<>":return e!==a;case"=":return e===a;case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a}}(e,t,r);if(b(t))return function(e,t,r){switch(r){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}(e,t,r);if(M(t))throw new a.eS(a.f.InvalidOperator);if(F(t))throw new a.eS(a.f.InvalidOperator);if(R(t))throw new a.eS(a.f.InvalidOperator);if(_(t))throw new a.eS(a.f.InvalidOperator)}else if(M(e)){if(J(t))return $(Z(e),Z(t),r);if(b(t))throw new a.eS(a.f.InvalidOperator);if(F(t))return function(e,t,r){const n=t.toDateTimeLuxon(e.zone);return $((e=e.startOf("day")).toMillis(),n.toMillis(),r)}(e,t,r);if(R(t))throw new a.eS(a.f.InvalidOperator);if(x(t))throw new a.eS(a.f.InvalidOperator)}else if(F(e)){if(_(t))return function(e,t,r){const n=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),$(n.toMillis(),t.toMilliseconds(),r)}(e,t,r);if(M(t))return function(e,t,r){const n=e.toDateTimeLuxon(t.zone);return t=t.startOf("day"),$(n.toMillis(),t.toMillis(),r)}(e,t,r);if(b(t))throw new a.eS(a.f.InvalidOperator);if(F(t))return $(e.toNumber(),t.toNumber(),r);if(R(t))throw new a.eS(a.f.InvalidOperator);if(x(t))throw new a.eS(a.f.InvalidOperator)}else if(R(e)){if(R(t))return $(e.toNumber(),t.toNumber(),r);if(b(t))throw new a.eS(a.f.InvalidOperator);if(x(t))throw new a.eS(a.f.InvalidOperator);if(F(t))throw new a.eS(a.f.InvalidOperator);if(J(t))throw new a.eS(a.f.InvalidOperator)}else if(_(e)){if(J(t))return $(Z(e),Z(t),r);if(b(t))throw new a.eS(a.f.InvalidOperator);if(F(t))return function(e,t,r){const n=t.toDateTimeLuxon(e.toDateTime().zone);return $((e=e.startOfDay()).toMilliseconds(),n.toMillis(),r)}(e,t,r);if(R(t))throw new a.eS(a.f.InvalidOperator);if(x(t))throw new a.eS(a.f.InvalidOperator)}var i;switch(r){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function $(e,t,r){switch(r){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function H(e,t,r){const n=Y[e.toLowerCase()];if(null==n)throw new a.eS(a.f.FunctionNotRecognized);if(t.length<n.minParams||t.length>n.maxParams)throw new a.eS(a.f.InvalidParameterCount,{name:e.toUpperCase()});return n.evaluate(t,r)}function k(e){return"string"==typeof e||e instanceof String}function z(e){return!(E(e)||F(e)||M(e)||R(e)||_(e))}function q(e){return F(e)||R(e)?e.toString():_(e)?e.toSQLValue():M(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):E(e)?q(l.ou.fromJSDate(e)):e.toString()}const Y={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if(E(t))switch(e.toUpperCase()){case"SECOND":return t.getSeconds();case"MINUTE":return t.getMinutes();case"HOUR":return t.getHours();case"DAY":return t.getDate();case"MONTH":return t.getMonth()+1;case"YEAR":return t.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(M(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new a.eS(a.f.InvalidFunctionParameters,{function:"EXTRACT"})}else if(F(t))switch(e.toUpperCase()){case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new a.eS(a.f.InvalidFunctionParameters,{function:"EXTRACT"})}else if(R(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(_(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":return t.timezoneOffsetHour;case"TIMEZONE_MINUTE":return t.timezoneOffsetMinutes}throw new a.eS(a.f.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(2===e.length){const[t,r]=e;return null==t||null==r?null:t.toString().substring(r-1)}if(3===e.length){const[t,r,n]=e;return null==t||null==r||null==n?null:n<=0?"":t.toString().substring(r-1,r+n-1)}}},position:{minParams:2,maxParams:2,evaluate:([e,t])=>null==e||null==t?null:t.indexOf(e)+1},trim:{minParams:2,maxParams:3,evaluate:e=>{const t=3===e.length,r=t?e[1]:" ",n=t?e[2]:e[1];if(null==r||null==n)return null;const i=`(${(0,U.Qs)(r)})`;switch(e[0]){case"BOTH":return n.replaceAll(new RegExp(`^${i}*|${i}*$`,"g"),"");case"LEADING":return n.replaceAll(new RegExp(`^${i}*`,"g"),"");case"TRAILING":return n.replaceAll(new RegExp(`${i}*$`,"g"),"")}throw new a.eS(a.f.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.abs(e[0])},ceiling:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.ceil(e[0])},floor:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.floor(e[0])},log:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])},log10:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sin(e[0])},cos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cos(e[0])},tan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tan(e[0])},asin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.asin(e[0])},acos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.acos(e[0])},atan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.atan(e[0])},sign:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0]>0?1:e[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]**e[1]},mod:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]%e[1]},round:{minParams:1,maxParams:2,evaluate:e=>{const t=e[0],r=2===e.length?10**e[1]:1;return null==t?null:Math.round(t*r)/r}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length?parseInt(e[0].toFixed(0),10):parseFloat(e[0].toFixed(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>k(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let t="";for(let r=0;r<e.length;r++){if(null==e[r])return null;t+=e[r].toString()}return t}},lower:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:e=>{for(const t of e)if(null!==t)return t;return null}},cosh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cosh(e[0])},sinh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sinh(e[0])},tanh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tanh(e[0])},nullif:{minParams:2,maxParams:2,evaluate:(e,t)=>V(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,t)=>{const r=e[0],n=e[1];if(null===r)return null;switch(n.type){case"integer":{if(!z(r))throw new a.eS(a.f.CannotCastValue);const e=parseInt(r,10);if(isNaN(e))throw new a.eS(a.f.CannotCastValue);return e}case"smallint":{if(!z(r))throw new a.eS(a.f.CannotCastValue);const e=parseInt(r,10);if(isNaN(e))throw new a.eS(a.f.CannotCastValue);if(e>32767||e<-32767)throw new a.eS(a.f.CannotCastValue);return e}case"float":case"real":{if(!z(r))throw new a.eS(a.f.CannotCastValue);const e=parseFloat(r);if(isNaN(e))throw new a.eS(a.f.CannotCastValue);return e}case"time":return function(e){if(E(e))return u.n.fromDateJS(e);if(M(e))return u.n.fromDateTime(e);if(F(e))throw new a.eS(a.f.CannotCastValue);if(R(e))return e;if(_(e))return u.n.fromSqlTimeStampOffset(e);if(k(e))return D(e);throw new a.eS(a.f.CannotCastValue)}(r);case"date":return function(e){if(E(e))return o.u.fromDateJS(e);if(M(e))return o.u.fromParts(e.year,e.month,e.day);if(F(e))return e;if(R(e))throw new a.eS(a.f.CannotCastValue);if(_(e)&&null===o.u.fromParts(e.year,e.month,e.day))throw new a.eS(a.f.CannotCastValue);if(k(e)){const t=o.u.fromReader(e);if(null!==t&&t.isValid)return t}throw new a.eS(a.f.CannotCastValue)}(r);case"timestamp":return function(e,t,r){if(E(e))return C(e,t);if(M(e))return e.setZone(t);if(F(e))return e.toDateTimeLuxon(t);if(R(e))throw new a.eS(a.f.CannotCastValue);if(_(e))return e;if(k(e))return P(e,t,r);throw new a.eS(a.f.CannotCastValue)}(r,t,!0===n.withtimezone);case"varchar":{const e=q(r);if(e.length>n.size)throw new a.eS(a.f.CannotCastValue);return e}default:throw new a.eS(a.f.InvalidDataType)}}}};function B(e,t,r,n){if("||"===e)return H("concat",[t,r],n);if(null===t||null===r)return null;if(x(t)){if(x(r))return j(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return h.createFromMilliseconds(e+t.valueInMilliseconds());case"-":return h.createFromMilliseconds(e-t.valueInMilliseconds());case"*":return h.createFromMilliseconds(e*t.valueInMilliseconds());case"/":return h.createFromMilliseconds(e/t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(_(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(M(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(b(r))return function(e,t,r){const n=parseFloat(t);if(isNaN(n))throw new a.eS(a.f.InvalidOperator);return j(e,n,r)}(t,r,e);throw new a.eS(a.f.InvalidOperator)}if(F(t)){if(x(r))return function(e,t,r){const n=1e3*t*24*60*60;switch(r){case"+":return e.plus("milliseconds",n);case"-":return e.plus("milliseconds",-1*n)}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){if("-"===r)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(_(r))return function(e,t,r){if("-"===r)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(M(r))return function(e,t,r){if("-"===r)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(R(t)){if(x(r))return function(e,t,r){const n=1e3*t*24*60*60;switch(r){case"+":return e.plus("milliseconds",n);case"-":return e.plus("milliseconds",-1*n)}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(_(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(M(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(A(t)){if(x(r))return function(e,t,r){switch(r){case"+":return h.createFromMilliseconds(e.valueInMilliseconds()+t);case"-":return h.createFromMilliseconds(e.valueInMilliseconds()-t);case"*":return h.createFromMilliseconds(e.valueInMilliseconds()*t);case"/":return h.createFromMilliseconds(e.valueInMilliseconds()/t)}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return h.createFromMilliseconds(e.valueInMilliseconds()+t.valueInMilliseconds());case"-":return h.createFromMilliseconds(e.valueInMilliseconds()-t.valueInMilliseconds());case"*":return h.createFromMilliseconds(e.valueInMilliseconds()*t.valueInMilliseconds());case"/":return h.createFromMilliseconds(e.valueInMilliseconds()/t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){if("+"===r)return t.plus("milliseconds",e.valueInMilliseconds());throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(F(r))return function(e,t,r){if("+"===r)return t.plus("milliseconds",e.valueInMilliseconds());throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(_(r))return function(e,t,r){if("+"===r)return t.addMilliseconds(e.valueInMilliseconds());throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(M(r))return function(e,t,r){switch(r){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(M(t)){if(x(r))return function(e,t,r){const n=1e3*t*24*60*60;switch(r){case"+":return e.plus({milliseconds:n});case"-":return e.minus({milliseconds:n})}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){if("-"===r)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(_(r))return function(e,t,r){if("-"===r)return e.diff(t.toDateTime()).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(M(r))return function(e,t,r){if("-"===r)return e.diff(t).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(_(t)){if(x(r))return function(e,t,r){const n=1e3*t*24*60*60;switch(r){case"+":return e.addMilliseconds(n);case"-":return e.addMilliseconds(-1*n)}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){if("-"===r)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(_(r))return function(e,t,r){if("-"===r)return e.toDateTime().diff(t.toDateTime()).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(M(r))return function(e,t,r){if("-"===r)return e.toDateTime().diff(t).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(b(t)){if(x(r))return function(e,t,r){const n=parseFloat(e);if(isNaN(n))throw new a.eS(a.f.InvalidOperator);return j(n,t,r)}(t,r,e);if(A(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(_(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(M(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(b(r))return function(e,t,r){if("+"===r)return e+t;throw new a.eS(a.f.InvalidOperator)}(t,r,e);throw new a.eS(a.f.InvalidOperator)}throw new a.eS(a.f.InvalidOperator)}function j(e,t,r){switch(r){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t}throw new a.eS(a.f.InvalidOperator)}r(5732);var Q,G,W={exports:{}};G=function(){function e(t,r,n,a){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,e.prototype),i.expected=r,i.found=n,i.location=a,i.name="SyntaxError",i}function t(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.prototype.format=function(e){var r="Error: "+this.message;if(this.location){var n,a=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){a=e[n].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+o.line+":"+o.column;if(a){var u=this.location.end,l=t("",o.line.toString().length," "),c=a[i.line-1],f=(i.line===u.line?u.column:c.length+1)-i.column||1;r+="\n --\x3e "+s+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+t("",i.column-1," ")+t("",f,"^")}else r+="\n at "+s}return r},e.buildMessage=function(e,t){var r={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return r[e.type](e)}return"Expected "+function(e){var t,r,n=e.map(o);if(n.sort(),n.length>0){for(t=1,r=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){var n,a={},i=(r=void 0!==r?r:{}).grammarSource,o={start:$a},s=$a,u="!",l="=",c=">=",f=">",d="<=",p="<>",m="<",v="!=",h="+",w="-",S="||",I="*",g="/",y="@",T="'",N="N'",O="''",C=".",x="null",b="true",A="false",E="in",M="is",F="like",R="escape",_="not",D="and",P="or",L="between",U="from",J="for",Z="substring",V="extract",$="trim",H="position",k="timestamp",z="date",q="time",Y="leading",B="trailing",j="both",Q="cast",G="as",W="integer",K="smallint",X="float",ee="real",te="varchar",re="to",ne="interval",ae="year",ie="timezone_hour",oe="timezone_minute",se="month",ue="day",le="hour",ce="minute",fe="second",de="case",pe="end",me="when",ve="then",he="else",we=",",Se="(",Ie=")",ge="`",ye=/^[A-Za-z_\x80-\uFFFF]/,Te=/^[A-Za-z0-9_]/,Ne=/^[A-Za-z0-9_.\x80-\uFFFF]/,Oe=/^["]/,Ce=/^[^']/,xe=/^[0-9]/,be=/^[eE]/,Ae=/^[+\-]/,Ee=/^[ \t\n\r]/,Me=/^[^`]/,Fe=Pa("!",!1),Re=Pa("=",!1),_e=Pa(">=",!1),De=Pa(">",!1),Pe=Pa("<=",!1),Le=Pa("<>",!1),Ue=Pa("<",!1),Je=Pa("!=",!1),Ze=Pa("+",!1),Ve=Pa("-",!1),$e=Pa("||",!1),He=Pa("*",!1),ke=Pa("/",!1),ze=La([["A","Z"],["a","z"],"_",["",""]],!1,!1),qe=La([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Ye=La([["A","Z"],["a","z"],["0","9"],"_",".",["",""]],!1,!1),Be=La(['"'],!1,!1),je=Pa("@",!1),Qe=Pa("'",!1),Ge=Pa("N'",!1),We=Pa("''",!1),Ke=La(["'"],!0,!1),Xe=Pa(".",!1),et=La([["0","9"]],!1,!1),tt=La(["e","E"],!1,!1),rt=La(["+","-"],!1,!1),nt=Pa("NULL",!0),at=Pa("TRUE",!0),it=Pa("FALSE",!0),ot=Pa("IN",!0),st=Pa("IS",!0),ut=Pa("LIKE",!0),lt=Pa("ESCAPE",!0),ct=Pa("NOT",!0),ft=Pa("AND",!0),dt=Pa("OR",!0),pt=Pa("BETWEEN",!0),mt=Pa("FROM",!0),vt=Pa("FOR",!0),ht=Pa("SUBSTRING",!0),wt=Pa("EXTRACT",!0),St=Pa("TRIM",!0),It=Pa("POSITION",!0),gt=Pa("TIMESTAMP",!0),yt=Pa("DATE",!0),Tt=Pa("TIME",!0),Nt=Pa("LEADING",!0),Ot=Pa("TRAILING",!0),Ct=Pa("BOTH",!0),xt=Pa("CAST",!0),bt=Pa("AS",!0),At=Pa("INTEGER",!0),Et=Pa("SMALLINT",!0),Mt=Pa("FLOAT",!0),Ft=Pa("REAL",!0),Rt=Pa("VARCHAR",!0),_t=Pa("TO",!0),Dt=Pa("INTERVAL",!0),Pt=Pa("YEAR",!0),Lt=Pa("TIMEZONE_HOUR",!0),Ut=Pa("TIMEZONE_MINUTE",!0),Jt=Pa("MONTH",!0),Zt=Pa("DAY",!0),Vt=Pa("HOUR",!0),$t=Pa("MINUTE",!0),Ht=Pa("SECOND",!0),kt=Pa("CASE",!0),zt=Pa("END",!0),qt=Pa("WHEN",!0),Yt=Pa("THEN",!0),Bt=Pa("ELSE",!0),jt=Pa(",",!1),Qt=Pa("(",!1),Gt=Pa(")",!1),Wt=La([" ","\t","\n","\r"],!1,!1),Kt=Pa("`",!1),Xt=La(["`"],!0,!1),er=function(e){return e},tr=function(e,t){var r={type:"expression-list"},n=function(e,t,r){return function(e,t){for(var r=[e],n=0;n<t.length;n++)r.push(t[n][3]);return r}(e,t)}(e,t);return r.value=n,r},rr=function(e,t){return Oo(e,t)},nr=function(e,t){return Oo(e,t)},ar=function(e){return function(e,t){return{type:"unary-expression",operator:"NOT",expr:t}}(0,e)},ir=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?Oo(e,t.tail):No(t.op,e,t.right,t.escape)},or=function(e){return{type:"arithmetic",tail:e}},sr=function(e,t){return{op:e+"NOT",right:t}},ur=function(e,t){return{op:e,right:t}},lr=function(e,t,r){return{op:"NOT"+e,right:{type:"expression-list",value:[t,r]}}},cr=function(e,t,r){return{op:e,right:{type:"expression-list",value:[t,r]}}},fr=function(e){return e[0]+" "+e[2]},dr=function(e){return e[0]+" "+e[2]},pr=function(e,t,r){return{op:e,right:t,escape:r.value}},mr=function(e,t){return{op:e,right:t,escape:""}},vr=function(e,t){return{op:e,right:t}},hr=function(e){return{op:e,right:{type:"expression-list",value:[]}}},wr=function(e,t){return{op:e,right:t}},Sr=function(e,t){return Oo(e,t)},Ir=function(e,t){return Oo(e,t)},gr=function(e){return e.paren=!0,e},yr=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:e}},Tr=function(e){return{type:"column-reference",table:"",column:e,delimited:!0}},Nr=function(e){return e},Or=function(e,t){return e+t.join("")},Cr=function(e,t){return e+t.join("")},xr=function(e){return e},br=function(e){return e.join("")},Ar=function(){return'"'},Er=function(e){return{type:"parameter",value:e[1]}},Mr=function(e,t){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:e},t]}}},Fr=function(e,t,r){return{type:"function",name:"substring",args:{type:"expression-list",value:r?[e,t,r[2]]:[e,t]}}},Rr=function(e,t){return{type:"function",name:"cast",args:{type:"expression-list",value:[e,t]}}},_r=function(){return{type:"data-type",value:{type:"integer"}}},Dr=function(){return{type:"data-type",value:{type:"smallint"}}},Pr=function(){return{type:"data-type",value:{type:"float"}}},Lr=function(){return{type:"data-type",value:{type:"real"}}},Ur=function(){return{type:"data-type",value:{type:"date"}}},Jr=function(){return{type:"data-type",value:{type:"timestamp"}}},Zr=function(){return{type:"data-type",value:{type:"time"}}},Vr=function(e){return{type:"data-type",value:{type:"varchar",size:parseInt(e)}}},$r=function(e,t,r){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:e??"BOTH"},t,r]}}},Hr=function(e,t){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:e??"BOTH"},t]}}},kr=function(e,t){return{type:"function",name:"position",args:{type:"expression-list",value:[e,t]}}},zr=function(e,t){return{type:"function",name:e,args:t||{type:"expression-list",value:[]}}},qr=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&Da("Timestamp literal is invalid")}(e.value),{type:"timestamp",value:e.value}},Yr=function(e){return"string"===e.type&&function(e){!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)&&Da("Time literal is invalid")}(e.value),{type:"time",value:e.value}},Br=function(e,t,r){return{type:"interval",value:t,qualifier:r,op:e}},jr=function(e,t){return{type:"interval",value:e,qualifier:t,op:""}},Qr=function(e,t){return{type:"interval-qualifier",start:e,end:t}},Gr=function(e,t){return{type:"interval-period",period:e.value,precision:t,secondary:null}},Wr=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},Kr=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},Xr=function(e,t){return{type:"interval-period",period:"second",precision:e,secondary:t}},en=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null}},tn=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},rn=function(e,t){return{type:"interval-period",period:e.value,precision:t,secondary:null}},nn=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},an=function(e,t){return{type:"interval-period",period:"second",precision:e,secondary:t}},on=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null}},sn=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},un=function(){return{type:"string",value:"day"}},ln=function(){return{type:"string",value:"hour"}},cn=function(){return{type:"string",value:"minute"}},fn=function(){return{type:"string",value:"month"}},dn=function(){return{type:"string",value:"year"}},pn=function(e){return parseFloat(e)},mn=function(e){return parseFloat(e)},vn=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&Da("Date literal is invalid")}(e.value),{type:"date",value:e.value}},hn=function(){return{type:"null",value:null}},wn=function(){return{type:"boolean",value:!0}},Sn=function(){return{type:"boolean",value:!1}},In=function(){return"'"},gn=function(e){return{type:"string",value:e.join("")}},yn=function(e,t){return{type:"case-expression",format:"simple",operand:e,clauses:t,else:null}},Tn=function(e,t,r){return{type:"case-expression",format:"simple",operand:e,clauses:t,else:r.value}},Nn=function(e){return{type:"case-expression",format:"searched",clauses:e,else:null}},On=function(e,t){return{type:"case-expression",format:"searched",clauses:e,else:t.value}},Cn=function(e,t){return{type:"when-clause",operand:e,value:t}},xn=function(e,t){return{type:"when-clause",operand:e,value:t}},bn=function(e){return{type:"else-clause",value:e}},An=function(e){return{type:"number",value:e}},En=function(e,t,r){return parseFloat(e+t+r)},Mn=function(e,t){return parseFloat(e+t)},Fn=function(e,t){return parseFloat(e+t)},Rn=function(e){return parseFloat(e)},_n=function(e,t){return e[0]+t},Dn=function(e){return"."+(null!=e?e:"")},Pn=function(e,t){return e+t},Ln=function(e){return e.join("")},Un=function(e,t){return"e"+(null===t?"":t)},Jn=function(){return"IN"},Zn=function(){return"IS"},Vn=function(){return"LIKE"},$n=function(){return"ESCAPE"},Hn=function(){return"NOT"},kn=function(){return"AND"},zn=function(){return"OR"},qn=function(){return"BETWEEN"},Yn=function(){return"FROM"},Bn=function(){return"FOR"},jn=function(){return"SUBSTRING"},Qn=function(){return"EXTRACT"},Gn=function(){return"TRIM"},Wn=function(){return"POSITION"},Kn=function(){return"TIMESTAMP"},Xn=function(){return"DATE"},ea=function(){return"TIME"},ta=function(){return"LEADING"},ra=function(){return"TRAILING"},na=function(){return"BOTH"},aa=function(){return"CAST"},ia=function(){return"AS"},oa=function(){return"INTEGER"},sa=function(){return"SMALLINT"},ua=function(){return"FLOAT"},la=function(){return"REAL"},ca=function(){return"VARCHAR"},fa=function(){return"TO"},da=function(){return"INTERVAL"},pa=function(){return"YEAR"},ma=function(){return"TIMEZONE_HOUR"},va=function(){return"TIMEZONE_MINUTE"},ha=function(){return"MONTH"},wa=function(){return"DAY"},Sa=function(){return"HOUR"},Ia=function(){return"MINUTE"},ga=function(){return"SECOND"},ya=function(){return"CASE"},Ta=function(){return"END"},Na=function(){return"WHEN"},Oa=function(){return"THEN"},Ca=function(){return"ELSE"},xa=function(e){return e},ba=function(e){return e.join("")},Aa=0,Ea=0,Ma=[{line:1,column:1}],Fa=0,Ra=[],_a=0;if("startRule"in r){if(!(r.startRule in o))throw new Error("Can't start parsing from rule \""+r.startRule+'".');s=o[r.startRule]}function Da(e,t){throw Va(e,t=void 0!==t?t:Ja(Ea,Aa))}function Pa(e,t){return{type:"literal",text:e,ignoreCase:t}}function La(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ua(e){var r,n=Ma[e];if(n)return n;for(r=e-1;!Ma[r];)r--;for(n={line:(n=Ma[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Ma[e]=n,n}function Ja(e,t,r){var n=Ua(e),a=Ua(t),o={source:i,start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:a.line,column:a.column}};return r&&i&&"function"==typeof i.offset&&(o.start=i.offset(o.start),o.end=i.offset(o.end)),o}function Za(e){Aa<Fa||(Aa>Fa&&(Fa=Aa,Ra=[]),Ra.push(e))}function Va(t,r){return new e(t,null,null,r)}function $a(){var e,t;return e=Aa,go(),(t=ka())!==a?(go(),Ea=e,e=er(t)):(Aa=e,e=a),e}function Ha(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=ka())!==a){for(r=[],n=Aa,i=go(),(o=wo())!==a?(s=go(),(u=ka())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=wo())!==a?(s=go(),(u=ka())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=tr(t,r)}else Aa=e,e=a;return e}function ka(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=za())!==a){for(r=[],n=Aa,i=go(),(o=Di())!==a?(s=go(),(u=za())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=Di())!==a?(s=go(),(u=za())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=rr(t,r)}else Aa=e,e=a;return e}function za(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=qa())!==a){for(r=[],n=Aa,i=go(),(o=_i())!==a?(s=go(),(u=qa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=_i())!==a?(s=go(),(u=qa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=nr(t,r)}else Aa=e,e=a;return e}function qa(){var e,r,n,i,o;return e=Aa,(r=Ri())===a&&(r=Aa,33===t.charCodeAt(Aa)?(n=u,Aa++):(n=a,0===_a&&Za(Fe)),n!==a?(i=Aa,_a++,61===t.charCodeAt(Aa)?(o=l,Aa++):(o=a,0===_a&&Za(Re)),_a--,o===a?i=void 0:(Aa=i,i=a),i!==a?r=n=[n,i]:(Aa=r,r=a)):(Aa=r,r=a)),r!==a?(n=go(),(i=qa())!==a?(Ea=e,e=ar(i)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=function(){var e,t,r;return e=Aa,(t=Qa())!==a?(go(),(r=function(){var e;return(e=function(){var e,t,r,n,i,o,s;if(e=Aa,t=[],r=Aa,n=go(),(i=Ya())!==a?(o=go(),(s=Qa())!==a?r=n=[n,i,o,s]:(Aa=r,r=a)):(Aa=r,r=a),r!==a)for(;r!==a;)t.push(r),r=Aa,n=go(),(i=Ya())!==a?(o=go(),(s=Qa())!==a?r=n=[n,i,o,s]:(Aa=r,r=a)):(Aa=r,r=a);else t=a;return t!==a&&(Ea=e,t=or(t)),t}())===a&&(e=function(){var e,t,r,n;return e=Aa,(t=ja())!==a?(go(),(r=So())!==a?(go(),(n=Ha())!==a?(go(),Io()!==a?(Ea=e,e=vr(t,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=ja())!==a?(go(),(r=So())!==a?(go(),(n=Io())!==a?(Ea=e,e=hr(t)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=ja())!==a?(go(),(r=si())!==a?(Ea=e,e=wr(t,r)):(Aa=e,e=a)):(Aa=e,e=a))),e}())===a&&(e=function(){var e,t,r,n,i,o;return e=Aa,(t=Ri())!==a?(go(),(r=Pi())!==a?(go(),(n=Qa())!==a?(go(),(i=_i())!==a?(go(),(o=Qa())!==a?(Ea=e,e=lr(r,n,o)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=Pi())!==a?(go(),(r=Qa())!==a?(go(),(n=_i())!==a?(go(),(i=Qa())!==a?(Ea=e,e=cr(t,r,i)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)),e}())===a&&(e=function(){var e,t,r,n;return e=Aa,(t=Ei())!==a?(go(),(r=Ri())!==a?(go(),(n=Qa())!==a?(Ea=e,e=sr(t,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ei())!==a?(go(),(r=Qa())!==a?(Ea=e,e=ur(t,r)):(Aa=e,e=a)):(Aa=e,e=a)),e}())===a&&(e=function(){var e,t,r,n;return e=Aa,(t=Ba())!==a?(go(),(r=mi())!==a?(go(),Fi()!==a?(go(),(n=vi())!==a?(Ea=e,e=pr(t,r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ba())!==a?(go(),(r=mi())!==a?(Ea=e,e=mr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)),e}()),e}())===a&&(r=null),Ea=e,e=ir(t,r)):(Aa=e,e=a),e}()),e}function Ya(){var e;return t.substr(Aa,2)===c?(e=c,Aa+=2):(e=a,0===_a&&Za(_e)),e===a&&(62===t.charCodeAt(Aa)?(e=f,Aa++):(e=a,0===_a&&Za(De)),e===a&&(t.substr(Aa,2)===d?(e=d,Aa+=2):(e=a,0===_a&&Za(Pe)),e===a&&(t.substr(Aa,2)===p?(e=p,Aa+=2):(e=a,0===_a&&Za(Le)),e===a&&(60===t.charCodeAt(Aa)?(e=m,Aa++):(e=a,0===_a&&Za(Ue)),e===a&&(61===t.charCodeAt(Aa)?(e=l,Aa++):(e=a,0===_a&&Za(Re)),e===a&&(t.substr(Aa,2)===v?(e=v,Aa+=2):(e=a,0===_a&&Za(Je)))))))),e}function Ba(){var e,t,r,n,i;return e=Aa,t=Aa,(r=Ri())!==a?(n=go(),(i=Mi())!==a?t=r=[r,n,i]:(Aa=t,t=a)):(Aa=t,t=a),t!==a&&(Ea=e,t=fr(t)),(e=t)===a&&(e=Mi()),e}function ja(){var e,t,r,n,i;return e=Aa,t=Aa,(r=Ri())!==a?(n=go(),(i=Ai())!==a?t=r=[r,n,i]:(Aa=t,t=a)):(Aa=t,t=a),t!==a&&(Ea=e,t=dr(t)),(e=t)===a&&(e=Ai()),e}function Qa(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=Wa())!==a){for(r=[],n=Aa,i=go(),(o=Ga())!==a?(s=go(),(u=Wa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=Ga())!==a?(s=go(),(u=Wa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=Sr(t,r)}else Aa=e,e=a;return e}function Ga(){var e;return 43===t.charCodeAt(Aa)?(e=h,Aa++):(e=a,0===_a&&Za(Ze)),e===a&&(45===t.charCodeAt(Aa)?(e=w,Aa++):(e=a,0===_a&&Za(Ve)),e===a&&(t.substr(Aa,2)===S?(e=S,Aa+=2):(e=a,0===_a&&Za($e)))),e}function Wa(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=Xa())!==a){for(r=[],n=Aa,i=go(),(o=Ka())!==a?(s=go(),(u=Xa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=Ka())!==a?(s=go(),(u=Xa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=Ir(t,r)}else Aa=e,e=a;return e}function Ka(){var e;return 42===t.charCodeAt(Aa)?(e=I,Aa++):(e=a,0===_a&&Za(He)),e===a&&(47===t.charCodeAt(Aa)?(e=g,Aa++):(e=a,0===_a&&Za(ke))),e}function Xa(){var e,t;return(e=function(){var e;return(e=vi())===a&&(e=function(){var e,t,r,n;return e=Aa,(t=function(){var e,t,r,n;return e=Aa,(t=Ii())!==a&&(r=gi())!==a&&(n=yi())!==a?(Ea=e,e=En(t,r,n)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ii())!==a&&(r=gi())!==a?(Ea=e,e=Mn(t,r)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ii())!==a&&(r=yi())!==a?(Ea=e,e=Fn(t,r)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ii())!==a&&(Ea=e,t=Rn(t)),e=t))),e}())!==a?(r=Aa,_a++,n=ti(),_a--,n===a?r=void 0:(Aa=r,r=a),r!==a?(Ea=e,e=An(t)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t;return e=Aa,(t=xi())!==a&&(Ea=e,t=wn()),(e=t)===a&&(e=Aa,(t=bi())!==a&&(Ea=e,t=Sn()),e=t),e}())===a&&(e=function(){var e,t;return e=Aa,(t=Ci())!==a&&(Ea=e,t=hn()),t}())===a&&(e=function(){var e,t;return e=Aa,ki()!==a?(go(),(t=mi())!==a?(Ea=e,e=vn(t)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t;return e=Aa,Hi()!==a?(go(),(t=mi())!==a?(Ea=e,e=qr(t)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=li())===a&&(e=function(){var e,t;return e=Aa,zi()!==a?(go(),(t=mi())!==a?(Ea=e,e=Yr(t)):(Aa=e,e=a)):(Aa=e,e=a),e}()),e}())===a&&(e=function(){var e,t,r;return e=Aa,Zi()!==a?(go(),So()!==a?(go(),(t=function(){var e;return(e=no())===a&&(e=oo())===a&&(e=so())===a&&(e=uo())===a&&(e=lo())===a&&(e=co())===a&&(e=ao())===a&&(e=io()),e}())!==a?(go(),Li()!==a?(go(),(r=ka())!==a?(go(),Io()!==a?(Ea=e,e=Mr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t,r,n,i,o,s;return e=Aa,Ji()!==a?(go(),So()!==a?(go(),(t=ka())!==a?(go(),Li()!==a?(go(),(r=ka())!==a?(go(),n=Aa,(i=Ui())!==a?(o=go(),(s=ka())!==a?n=i=[i,o,s,go()]:(Aa=n,n=a)):(Aa=n,n=a),n===a&&(n=null),(i=Io())!==a?(Ea=e,e=Fr(t,r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t,r,n;return e=Aa,Vi()!==a?(go(),So()!==a?(go(),(t=ui())===a&&(t=null),go(),(r=ka())!==a?(go(),Li()!==a?(go(),(n=ka())!==a?(go(),Io()!==a?(Ea=e,e=$r(t,r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,Vi()!==a?(go(),So()!==a?(go(),(t=ui())===a&&(t=null),go(),(r=ka())!==a?(go(),Io()!==a?(Ea=e,e=Hr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)),e}())===a&&(e=function(){var e,t,r;return e=Aa,$i()!==a?(go(),So()!==a?(go(),(t=ka())!==a?(go(),Ai()!==a?(go(),(r=ka())!==a?(go(),Io()!==a?(Ea=e,e=kr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t,r;return e=Aa,ji()!==a?(go(),So()!==a?(go(),(t=ka())!==a?(go(),Qi()!==a?(go(),(r=function(){var e,t,r;return e=Aa,(t=Gi())!==a&&(Ea=e,t=_r()),(e=t)===a&&(e=Aa,(t=Wi())!==a&&(Ea=e,t=Dr()),(e=t)===a&&(e=Aa,(t=Ki())!==a&&(Ea=e,t=Pr()),(e=t)===a&&(e=Aa,(t=Xi())!==a&&(Ea=e,t=Lr()),(e=t)===a&&(e=Aa,(t=ki())!==a&&(Ea=e,t=Ur()),(e=t)===a&&(e=Aa,(t=Hi())!==a&&(Ea=e,t=Jr()),(e=t)===a&&(e=Aa,(t=zi())!==a&&(Ea=e,t=Zr()),(e=t)===a&&(e=Aa,(t=eo())!==a?(go(),So()!==a?(go(),(r=Ti())!==a?(go(),Io()!==a?(Ea=e,e=Vr(r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)))))))),e}())!==a?(go(),Io()!==a?(Ea=e,e=Rr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t,r;return e=Aa,(t=To())!==a?(go(),So()!==a?(go(),(r=Ha())===a&&(r=null),go(),Io()!==a?(Ea=e,e=zr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e;return(e=function(){var e,t,r,n,i;if(e=Aa,fo()!==a)if(go(),(t=ka())!==a){for(go(),r=[],n=wi();n!==a;)r.push(n),n=wi();n=go(),(i=po())!==a?(Ea=e,e=yn(t,r)):(Aa=e,e=a)}else Aa=e,e=a;else Aa=e,e=a;if(e===a)if(e=Aa,fo()!==a)if(go(),(t=ka())!==a){for(go(),r=[],n=wi();n!==a;)r.push(n),n=wi();n=go(),(i=Si())!==a?(go(),po()!==a?(Ea=e,e=Tn(t,r,i)):(Aa=e,e=a)):(Aa=e,e=a)}else Aa=e,e=a;else Aa=e,e=a;return e}())===a&&(e=function(){var e,t,r,n;if(e=Aa,fo()!==a){for(go(),t=[],r=hi();r!==a;)t.push(r),r=hi();r=go(),(n=po())!==a?(Ea=e,e=Nn(t)):(Aa=e,e=a)}else Aa=e,e=a;if(e===a)if(e=Aa,fo()!==a){for(go(),t=[],r=hi();r!==a;)t.push(r),r=hi();r=go(),(n=Si())!==a?(go(),po()!==a?(Ea=e,e=On(t,n)):(Aa=e,e=a)):(Aa=e,e=a)}else Aa=e,e=a;return e}()),e}())===a&&(e=function(){var e,t;return e=Aa,(t=function(){var e,t;return e=Aa,(t=function(){var e,t,r,n;if(e=Aa,(t=ti())!==a){for(r=[],n=ni();n!==a;)r.push(n),n=ni();Ea=e,e=Or(t,r)}else Aa=e,e=a;return e}())!==a&&(Ea=e,t=Nr(t)),t}())!==a&&(Ea=e,t=yr(t)),(e=t)===a&&(e=Aa,(t=function(){var e,t;return e=Aa,oi()!==a?(t=function(){var e,t,r;for(e=Aa,t=[],r=ai();r!==a;)t.push(r),r=ai();return Ea=e,br(t)}(),oi()!==a?(Ea=e,e=xr(t)):(Aa=e,e=a)):(Aa=e,e=a),e}())!==a&&(Ea=e,t=Tr(t)),e=t),e}())===a&&(e=si())===a&&(e=Aa,So()!==a?(go(),(t=ka())!==a?(go(),Io()!==a?(Ea=e,e=gr(t)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)),e}function ei(){var e,t,r,n;if(e=Aa,(t=ti())!==a){for(r=[],n=ri();n!==a;)r.push(n),n=ri();Ea=e,e=Cr(t,r)}else Aa=e,e=a;return e}function ti(){var e;return ye.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(ze)),e}function ri(){var e;return Te.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(qe)),e}function ni(){var e;return Ne.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(Ye)),e}function ai(){var e;return(e=ii())===a&&(e=function(){var e;return e=Aa,oi()!==a&&oi()!==a?(Ea=e,e=Ar()):(Aa=e,e=a),e}()),e}function ii(){var e;return Ne.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(Ye)),e}function oi(){var e;return Oe.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(Be)),e}function si(){var e,r,n,i;return e=Aa,r=Aa,64===t.charCodeAt(Aa)?(n=y,Aa++):(n=a,0===_a&&Za(je)),n!==a&&(i=ei())!==a?r=n=[n,i]:(Aa=r,r=a),r!==a&&(Ea=e,r=Er(r)),r}function ui(){var e;return(e=qi())===a&&(e=Yi())===a&&(e=Bi()),e}function li(){var e,r,n,i;return e=Aa,ro()!==a?(go(),45===t.charCodeAt(Aa)?(r=w,Aa++):(r=a,0===_a&&Za(Ve)),r===a&&(43===t.charCodeAt(Aa)?(r=h,Aa++):(r=a,0===_a&&Za(Ze))),r!==a?(go(),(n=mi())!==a?(go(),(i=ci())!==a?(Ea=e,e=Br(r,n,i)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,ro()!==a?(go(),(r=mi())!==a?(go(),(n=ci())!==a?(Ea=e,e=jr(r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)),e}function ci(){var e,t,r;return e=Aa,(t=function(){var e,t,r;return e=Aa,(t=fi())!==a?(go(),So()!==a?(go(),(r=pi())!==a?(go(),Io()!==a?(Ea=e,e=Gr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=fi())!==a&&(Ea=e,t=Wr(t)),e=t),e}())!==a?(go(),to()!==a?(go(),(r=function(){var e,t,r,n;return e=Aa,(t=fi())!==a&&(Ea=e,t=Kr(t)),(e=t)===a&&(e=Aa,(t=co())!==a?(go(),So()!==a?(go(),(r=pi())!==a?(go(),wo()!==a?(go(),(n=di())!==a?(go(),Io()!==a?(Ea=e,e=Xr(r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=co())!==a?(go(),So()!==a?(go(),(r=pi())!==a?(go(),Io()!==a?(Ea=e,e=en(r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=co())!==a&&(Ea=e,t=tn()),e=t))),e}())!==a?(Ea=e,e=Qr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=function(){var e,t,r,n;return e=Aa,(t=fi())!==a?(go(),So()!==a?(go(),(r=di())!==a?(go(),Io()!==a?(Ea=e,e=rn(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=fi())!==a&&(Ea=e,t=nn(t)),(e=t)===a&&(e=Aa,(t=co())!==a?(go(),So()!==a?(go(),(r=pi())!==a?(go(),wo()!==a?(go(),(n=di())!==a?(go(),Io()!==a?(Ea=e,e=an(r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=co())!==a?(go(),So()!==a?(go(),(r=di())!==a?(go(),Io()!==a?(Ea=e,e=on(r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=co())!==a&&(Ea=e,t=sn()),e=t)))),e}()),e}function fi(){var e,t;return e=Aa,(t=so())!==a&&(Ea=e,t=un()),(e=t)===a&&(e=Aa,(t=uo())!==a&&(Ea=e,t=ln()),(e=t)===a&&(e=Aa,(t=lo())!==a&&(Ea=e,t=cn()),(e=t)===a&&(e=Aa,(t=oo())!==a&&(Ea=e,t=fn()),(e=t)===a&&(e=Aa,(t=no())!==a&&(Ea=e,t=dn()),e=t)))),e}function di(){var e,t;return e=Aa,(t=Ti())!==a&&(Ea=e,t=pn(t)),t}function pi(){var e,t;return e=Aa,(t=Ti())!==a&&(Ea=e,t=mn(t)),t}function mi(){var e;return(e=vi())===a&&(e=si()),e}function vi(){var e,r,n,i,o;if(e=Aa,39===t.charCodeAt(Aa)?(r=T,Aa++):(r=a,0===_a&&Za(Qe)),r===a&&(t.substr(Aa,2)===N?(r=N,Aa+=2):(r=a,0===_a&&Za(Ge))),r!==a){for(n=[],i=Aa,t.substr(Aa,2)===O?(o=O,Aa+=2):(o=a,0===_a&&Za(We)),o!==a&&(Ea=i,o=In()),(i=o)===a&&(Ce.test(t.charAt(Aa))?(i=t.charAt(Aa),Aa++):(i=a,0===_a&&Za(Ke)));i!==a;)n.push(i),i=Aa,t.substr(Aa,2)===O?(o=O,Aa+=2):(o=a,0===_a&&Za(We)),o!==a&&(Ea=i,o=In()),(i=o)===a&&(Ce.test(t.charAt(Aa))?(i=t.charAt(Aa),Aa++):(i=a,0===_a&&Za(Ke)));39===t.charCodeAt(Aa)?(i=T,Aa++):(i=a,0===_a&&Za(Qe)),i!==a?(Ea=e,e=gn(n)):(Aa=e,e=a)}else Aa=e,e=a;return e}function hi(){var e,t,r;return e=Aa,mo()!==a?(go(),(t=ka())!==a?(go(),vo()!==a?(go(),(r=ka())!==a?(Ea=e,e=Cn(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}function wi(){var e,t,r;return e=Aa,mo()!==a?(go(),(t=ka())!==a?(go(),vo()!==a?(go(),(r=ka())!==a?(Ea=e,e=xn(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}function Si(){var e,t;return e=Aa,ho()!==a?(go(),(t=ka())!==a?(Ea=e,e=bn(t)):(Aa=e,e=a)):(Aa=e,e=a),e}function Ii(){var e,r,n;return(e=Ti())===a&&(e=Aa,45===t.charCodeAt(Aa)?(r=w,Aa++):(r=a,0===_a&&Za(Ve)),r===a&&(43===t.charCodeAt(Aa)?(r=h,Aa++):(r=a,0===_a&&Za(Ze))),r!==a&&(n=Ti())!==a?(Ea=e,e=_n(r,n)):(Aa=e,e=a)),e}function gi(){var e,r,n;return e=Aa,46===t.charCodeAt(Aa)?(r=C,Aa++):(r=a,0===_a&&Za(Xe)),r!==a?((n=Ti())===a&&(n=null),Ea=e,e=Dn(n)):(Aa=e,e=a),e}function yi(){var e,t,r;return e=Aa,(t=Oi())!==a&&(r=Ti())!==a?(Ea=e,e=Pn(t,r)):(Aa=e,e=a),e}function Ti(){var e,t,r;if(e=Aa,t=[],(r=Ni())!==a)for(;r!==a;)t.push(r),r=Ni();else t=a;return t!==a&&(Ea=e,t=Ln(t)),t}function Ni(){var e;return xe.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(et)),e}function Oi(){var e,r,n;return e=Aa,be.test(t.charAt(Aa))?(r=t.charAt(Aa),Aa++):(r=a,0===_a&&Za(tt)),r!==a?(Ae.test(t.charAt(Aa))?(n=t.charAt(Aa),Aa++):(n=a,0===_a&&Za(rt)),n===a&&(n=null),Ea=e,e=Un(r,n)):(Aa=e,e=a),e}function Ci(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===x?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(nt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?e=r=[r,n]:(Aa=e,e=a)):(Aa=e,e=a),e}function xi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===b?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(at)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?e=r=[r,n]:(Aa=e,e=a)):(Aa=e,e=a),e}function bi(){var e,r,n,i;return e=Aa,t.substr(Aa,5).toLowerCase()===A?(r=t.substr(Aa,5),Aa+=5):(r=a,0===_a&&Za(it)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?e=r=[r,n]:(Aa=e,e=a)):(Aa=e,e=a),e}function Ai(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===E?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(ot)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Jn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ei(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===M?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(st)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Zn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Mi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===F?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(ut)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Vn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Fi(){var e,r,n,i;return e=Aa,t.substr(Aa,6).toLowerCase()===R?(r=t.substr(Aa,6),Aa+=6):(r=a,0===_a&&Za(lt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=$n()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ri(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===_?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(ct)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Hn()):(Aa=e,e=a)):(Aa=e,e=a),e}function _i(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===D?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(ft)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=kn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Di(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===P?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(dt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=zn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Pi(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===L?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(pt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=qn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Li(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===U?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(mt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Yn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ui(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===J?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(vt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Bn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ji(){var e,r,n,i;return e=Aa,t.substr(Aa,9).toLowerCase()===Z?(r=t.substr(Aa,9),Aa+=9):(r=a,0===_a&&Za(ht)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=jn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Zi(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===V?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(wt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Qn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Vi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===$?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(St)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Gn()):(Aa=e,e=a)):(Aa=e,e=a),e}function $i(){var e,r,n,i;return e=Aa,t.substr(Aa,8).toLowerCase()===H?(r=t.substr(Aa,8),Aa+=8):(r=a,0===_a&&Za(It)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Wn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Hi(){var e,r,n,i;return e=Aa,t.substr(Aa,9).toLowerCase()===k?(r=t.substr(Aa,9),Aa+=9):(r=a,0===_a&&Za(gt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Kn()):(Aa=e,e=a)):(Aa=e,e=a),e}function ki(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===z?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(yt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Xn()):(Aa=e,e=a)):(Aa=e,e=a),e}function zi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===q?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Tt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ea()):(Aa=e,e=a)):(Aa=e,e=a),e}function qi(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===Y?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(Nt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ta()):(Aa=e,e=a)):(Aa=e,e=a),e}function Yi(){var e,r,n,i;return e=Aa,t.substr(Aa,8).toLowerCase()===B?(r=t.substr(Aa,8),Aa+=8):(r=a,0===_a&&Za(Ot)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ra()):(Aa=e,e=a)):(Aa=e,e=a),e}function Bi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===j?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Ct)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=na()):(Aa=e,e=a)):(Aa=e,e=a),e}function ji(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===Q?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(xt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=aa()):(Aa=e,e=a)):(Aa=e,e=a),e}function Qi(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===G?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(bt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ia()):(Aa=e,e=a)):(Aa=e,e=a),e}function Gi(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===W?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(At)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=oa()):(Aa=e,e=a)):(Aa=e,e=a),e}function Wi(){var e,r,n,i;return e=Aa,t.substr(Aa,8).toLowerCase()===K?(r=t.substr(Aa,8),Aa+=8):(r=a,0===_a&&Za(Et)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=sa()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ki(){var e,r,n,i;return e=Aa,t.substr(Aa,5).toLowerCase()===X?(r=t.substr(Aa,5),Aa+=5):(r=a,0===_a&&Za(Mt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ua()):(Aa=e,e=a)):(Aa=e,e=a),e}function Xi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===ee?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Ft)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=la()):(Aa=e,e=a)):(Aa=e,e=a),e}function eo(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===te?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(Rt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ca()):(Aa=e,e=a)):(Aa=e,e=a),e}function to(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===re?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(_t)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=fa()):(Aa=e,e=a)):(Aa=e,e=a),e}function ro(){var e,r,n,i;return e=Aa,t.substr(Aa,8).toLowerCase()===ne?(r=t.substr(Aa,8),Aa+=8):(r=a,0===_a&&Za(Dt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=da()):(Aa=e,e=a)):(Aa=e,e=a),e}function no(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===ae?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Pt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=pa()):(Aa=e,e=a)):(Aa=e,e=a),e}function ao(){var e,r,n,i;return e=Aa,t.substr(Aa,13).toLowerCase()===ie?(r=t.substr(Aa,13),Aa+=13):(r=a,0===_a&&Za(Lt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ma()):(Aa=e,e=a)):(Aa=e,e=a),e}function io(){var e,r,n,i;return e=Aa,t.substr(Aa,15).toLowerCase()===oe?(r=t.substr(Aa,15),Aa+=15):(r=a,0===_a&&Za(Ut)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=va()):(Aa=e,e=a)):(Aa=e,e=a),e}function oo(){var e,r,n,i;return e=Aa,t.substr(Aa,5).toLowerCase()===se?(r=t.substr(Aa,5),Aa+=5):(r=a,0===_a&&Za(Jt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ha()):(Aa=e,e=a)):(Aa=e,e=a),e}function so(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===ue?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(Zt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=wa()):(Aa=e,e=a)):(Aa=e,e=a),e}function uo(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===le?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Vt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Sa()):(Aa=e,e=a)):(Aa=e,e=a),e}function lo(){var e,r,n,i;return e=Aa,t.substr(Aa,6).toLowerCase()===ce?(r=t.substr(Aa,6),Aa+=6):(r=a,0===_a&&Za($t)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Ia()):(Aa=e,e=a)):(Aa=e,e=a),e}function co(){var e,r,n,i;return e=Aa,t.substr(Aa,6).toLowerCase()===fe?(r=t.substr(Aa,6),Aa+=6):(r=a,0===_a&&Za(Ht)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ga()):(Aa=e,e=a)):(Aa=e,e=a),e}function fo(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===de?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(kt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ya()):(Aa=e,e=a)):(Aa=e,e=a),e}function po(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===pe?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(zt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Ta()):(Aa=e,e=a)):(Aa=e,e=a),e}function mo(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===me?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(qt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Na()):(Aa=e,e=a)):(Aa=e,e=a),e}function vo(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===ve?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Yt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Oa()):(Aa=e,e=a)):(Aa=e,e=a),e}function ho(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===he?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Bt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Ca()):(Aa=e,e=a)):(Aa=e,e=a),e}function wo(){var e;return 44===t.charCodeAt(Aa)?(e=we,Aa++):(e=a,0===_a&&Za(jt)),e}function So(){var e;return 40===t.charCodeAt(Aa)?(e=Se,Aa++):(e=a,0===_a&&Za(Qt)),e}function Io(){var e;return 41===t.charCodeAt(Aa)?(e=Ie,Aa++):(e=a,0===_a&&Za(Gt)),e}function go(){var e,t;for(e=[],t=yo();t!==a;)e.push(t),t=yo();return e}function yo(){var e;return Ee.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(Wt)),e}function To(){var e,r,n,i;if(e=Aa,(r=ei())!==a&&(Ea=e,r=xa(r)),(e=r)===a)if(e=Aa,96===t.charCodeAt(Aa)?(r=ge,Aa++):(r=a,0===_a&&Za(Kt)),r!==a){if(n=[],Me.test(t.charAt(Aa))?(i=t.charAt(Aa),Aa++):(i=a,0===_a&&Za(Xt)),i!==a)for(;i!==a;)n.push(i),Me.test(t.charAt(Aa))?(i=t.charAt(Aa),Aa++):(i=a,0===_a&&Za(Xt));else n=a;n!==a?(96===t.charCodeAt(Aa)?(i=ge,Aa++):(i=a,0===_a&&Za(Kt)),i!==a?(Ea=e,e=ba(n)):(Aa=e,e=a)):(Aa=e,e=a)}else Aa=e,e=a;return e}function No(e,t,r,n){var a={type:"binary-expression",operator:e,left:t,right:r};return void 0!==n&&(a.escape=n),a}function Oo(e,t){for(var r=e,n=0;n<t.length;n++)r=No(t[n][1],r,t[n][3]);return r}if((n=s())!==a&&Aa===t.length)return n;throw n!==a&&Aa<t.length&&Za({type:"end"}),function(t,r,n){return new e(e.buildMessage(t,r),t,r,n)}(Ra,Fa<t.length?t.charAt(Fa):null,Fa<t.length?Ja(Fa,Fa+1):Ja(Fa,Fa))}}},(Q=W).exports&&(Q.exports=G());var K=W.exports;class X{static parse(e){return K.parse(e)}}const ee=new Set(["current_timestamp","current_date","current_time"]);var te;!function(e){e[e.Date=1]="Date",e[e.DateOnly=2]="DateOnly",e[e.TimeOnly=3]="TimeOnly",e[e.TimeStampOffset=4]="TimeStampOffset"}(te||(te={}));class re{static makeBool(e){return ae(e)}static featureValue(e,t,r,n,a){return pe(e,t,r,n,a)}static equalsNull(e){return null===e}static applyLike(e,t,r){return de(e,t,r)}static ensureArray(e){return ie(e)}static applyIn(e,t){return le(e,t)}static currentDate(e){return o.u.fromNow(e)}static makeSqlInterval(e,t,r){return h.createFromValueAndQualifer(e,t,r)}static convertInterval(e){return e instanceof h?e.valueInMilliseconds():e}static currentTimestamp(e){return C(new Date,e)}static compare(e,t,r,n){return V(t,r,e)}static calculate(e,t,r,n){return B(e,t,r,n)}static evaluateTime(e){return D(e)}static evaluateTimestamp(e,t,r){return P(e,t,r)}static evaluateDate(e,t){return L(e,t)}static evaluateFunction(e,t,r){return H(e,t,r)}static lookup(e,t){const r=t[e];return void 0===r?null:r}static between(e,t,r){return null==e||null==t[0]||null==t[1]?null:V(e,t[0],">=")&&V(e,t[1],"<=")}static notbetween(e,t,r){return null==e||null==t[0]||null==t[1]?null:V(e,t[0],"<")||V(e,t[1],">")}static ternaryNot(e){return oe(e)}static ternaryAnd(e,t){return se(e,t)}static ternaryOr(e,t){return ue(e,t)}}class ne{constructor(e,t,r={timeZone:"UTC"}){this.fieldsIndex=t,this._complextypefields={},this.parameters={},this.timeReferenceZone="UTC",this._hasDateFunctions=void 0,this.configureExpressionTimeZone(r),this.parseTree=X.parse(e);const{isStandardized:n,isAggregate:a,referencedFieldNames:i}=this._extractExpressionInfo(t);this._referencedFieldNames=i,this.isStandardized=n,this.isAggregate=a}configureExpressionTimeZone(e){this.timeReferenceZone=e.timeZone}static convertValueToStorageFormat(e,t=null){if(null===t)return E(e)?e.getTime():M(e)?e.toMillis():_(e)?e.toStorageFormat():R(e)?e.toStorageString():F(e)?e.toStorageFormat():e;switch(t){case"date":return E(e)?e.getTime():M(e)?e.toMillis():_(e)?e.toMilliseconds():F(e)?e.toNumber():e;case"date-only":return E(e)?o.u.fromDateJS(e).toString():_(e)?o.u.fromSqlTimeStampOffset(e).toString():M(e)?o.u.fromDateTime(e).toString():e;case"time-only":return E(e)?u.n.fromDateJS(e).toStorageString():M(e)?u.n.fromDateTime(e).toStorageString():_(e)?u.n.fromSqlTimeStampOffset(e).toStorageString():R(e)?e.toStorageString():e;case"timestamp-offset":if(E(e))return s.H.fromJSDate(e).toStorageFormat();if(M(e))return s.H.fromDateTime(e).toStorageFormat();if(_(e))return e.toStorageFormat()}return e}static create(e,t,r={timeZone:"UTC"}){return new ne(e,t,r)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=me){return!!this._evaluateNode(this.parseTree,null,t,e)}calculateValue(e,t=me){const r=this._evaluateNode(this.parseTree,e,t,null);return r instanceof h?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,t=me){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this._complextypefields,this.timeReferenceZone):(0,i.Z)("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this._complextypefields,this.timeReferenceZone))}testFeature(e,t=me){return!!this._evaluateNode(this.parseTree,e,t,null)}testFeatureCompiled(e,t=me){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this._complextypefields,this.timeReferenceZone):(0,i.Z)("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this._complextypefields,this.timeReferenceZone))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||ee.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,(t=>{if("function"===t.type){const r=t.name.toLowerCase(),n=t.args.value[0];if("column-reference"===n.type){const t=n.column,a=`${r}-${t}`;e.has(a)||e.set(a,{aggregateType:r,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","complextypefields","timeReferenceZone",e).bind(re)}_extractExpressionInfo(e){const t=[],r=new Set;let n=!0,a=!1;return this._visitAll(this.parseTree,(i=>{switch(i.type){case"column-reference":{const n=e?.get(i.column);let a,o;n?a=o=n.name??"":(o=i.column,a=o.toLowerCase()),n&&n.name&&("date"===n.type||"esriFieldTypeDate"===n.type)&&(this._complextypefields[n.name]=te.Date),!n?.name||"date-only"!==n.type&&"esriFieldTypeDateOnly"!==n.type||(this._complextypefields[n.name]=te.DateOnly),n&&n.name&&("time-only"===n.type||"esriFieldTypeTimeOnly"===n.type)&&(this._complextypefields[n.name]=te.TimeOnly),n&&n.name&&("timestamp-offset"===n.type||"esriFieldTypeTimestampOffset"===n.type)&&(this._complextypefields[n.name]=te.TimeStampOffset),r.has(a)||(r.add(a),t.push(o)),i.column=o;break}case"function":{const{name:e,args:t}=i,r=t.value.length;n&&(n=function(e,t){const r=Y[e.toLowerCase()];return null!=r&&t>=r.minParams&&t<=r.maxParams}(e,r)),!1===a&&(a=c(e,r));break}}})),{referencedFieldNames:Array.from(t),isStandardized:n,isAggregate:a}}_visitAll(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":this._visitAll(e.operand,t),this._visitAll(e.value,t);break;case"case-expression":for(const r of e.clauses)this._visitAll(r,t);"simple"===e.format&&this._visitAll(e.operand,t),null!==e.else&&this._visitAll(e.else,t);break;case"expression-list":for(const r of e.value)this._visitAll(r,t);break;case"unary-expression":this._visitAll(e.expr,t);break;case"binary-expression":this._visitAll(e.left,t),this._visitAll(e.right,t);break;case"function":this._visitAll(e.args,t)}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const r=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let n=0;n<e.clauses.length;n++)t+=" (this.compare('=',"+r+","+this.evaluateNodeToJavaScript(e.clauses[n].operand)+") ? ("+this.evaluateNodeToJavaScript(e.clauses[n].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let r=0;r<e.clauses.length;r++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[r].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const r of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(r);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")))";case"IN":return"this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"))";case"NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+")))";case"BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeReferenceZone)";case"NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeReferenceZone)";case"LIKE":return"this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+")";case"NOT LIKE":return"this.ternaryNot(this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+"))";case"<>":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeReferenceZone)";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeReferenceZone)"}throw new a.eS(a.f.UnsupportedOperator,{operator:e.operator});case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"time":return"this.evaluateTime(JSON.stringify(node.value))";case"date":return"this.evaluateDate(JSON.stringify(node.value), timeReferenceZone)";case"timestamp":return"this.evaluateTimestamp(JSON.stringify(node.value), timeReferenceZone)";case"current-time":return"date"===e.mode?"this.currentDate(timeReferenceZone)":"this.currentTimestamp(timeReferenceZone)";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",complextypefields,attributeAdapter, timeReferenceZone)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+", timeReferenceZone)"}throw new a.eS(a.f.UnsupportedSyntax,{node:e.type})}_evaluateNode(e,t,r,i){let s;switch(e.type){case"interval":{const n=this._evaluateNode(e.value,t,r,i);return h.createFromValueAndQualifer(n,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const n=this._evaluateNode(e.operand,t,r,i);for(let a=0;a<e.clauses.length;a++)if(V(n,this._evaluateNode(e.clauses[a].operand,t,r,i),"=",this.timeReferenceZone))return this._evaluateNode(e.clauses[a].value,t,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,r,i)}else{for(let n=0;n<e.clauses.length;n++)if(ae(this._evaluateNode(e.clauses[n].operand,t,r,i)))return this._evaluateNode(e.clauses[n].value,t,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,r,i)}return null;case"parameter":return s=this.parameters[e.value.toLowerCase()],E(s)?l.ou.fromJSDate(s):s instanceof n.iG?s.toDateTime():s;case"expression-list":{const n=[];for(const a of e.value)n.push(this._evaluateNode(a,t,r,i));return n}case"unary-expression":return oe(this._evaluateNode(e.expr,t,r,i));case"binary-expression":switch(e.operator){case"AND":return se(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i));case"OR":return ue(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i));case"IS":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return null===this._evaluateNode(e.left,t,r,i);case"ISNOT":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return null!==this._evaluateNode(e.left,t,r,i);case"IN":{const n=ie(this._evaluateNode(e.right,t,r,i));return le(this._evaluateNode(e.left,t,r,i),n)}case"NOT IN":{const n=ie(this._evaluateNode(e.right,t,r,i));return oe(le(this._evaluateNode(e.left,t,r,i),n))}case"BETWEEN":{const n=this._evaluateNode(e.left,t,r,i),a=this._evaluateNode(e.right,t,r,i);return null==n||null==a[0]||null==a[1]?null:V(n,a[0],">=",this.timeReferenceZone)&&V(n,a[1],"<=",this.timeReferenceZone)}case"NOTBETWEEN":{const n=this._evaluateNode(e.left,t,r,i),a=this._evaluateNode(e.right,t,r,i);return null==n||null==a[0]||null==a[1]?null:V(n,a[0],"<",this.timeReferenceZone)||V(n,a[1],">",this.timeReferenceZone)}case"LIKE":return de(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i),e.escape);case"NOT LIKE":return oe(de(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return V(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i),e.operator,this.timeReferenceZone);case"-":case"+":case"*":case"/":case"||":return B(e.operator,this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i),this.timeReferenceZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return L(e.value,this.timeReferenceZone);case"timestamp":return P(e.value,this.timeReferenceZone);case"time":return D(e.value);case"current-time":return"date"===e.mode?o.u.fromNow(this.timeReferenceZone):C(new Date,this.timeReferenceZone);case"column-reference":return pe(t,e.column,this._complextypefields,r,this.timeReferenceZone);case"data-type":return e.value;case"function":{if(this.isAggregate&&c(e.name,e.args.value.length)){const t=[];for(const n of e.args?.value||[]){const e=[];for(const t of i||[])e.push(this._evaluateNode(n,t,r,null));t.push(e)}return function(e,t){const r=f[e.toLowerCase()];if(null==r)throw new a.eS(a.f.FunctionNotRecognized);if(t.length<r.minParams||t.length>r.maxParams)throw new a.eS(a.f.InvalidParameterCount,{name:e.toUpperCase()});return r.evaluate(t)}(e.name,t)}const n=this._evaluateNode(e.args,t,r,i);return H(e.name,n,this.timeReferenceZone)}}throw new a.eS(a.f.UnsupportedSyntax,{node:e.type})}}function ae(e){return!0===e}function ie(e){return Array.isArray(e)?e:[e]}function oe(e){return null!==e?!0!==e:null}function se(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function ue(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function le(e,t){if(null==e)return null;let r=!1;for(const n of t)if(null==n)r=null;else if(e===n){r=!0;break}return r}const ce="-[]/{}()*+?.\\^$|";var fe;function de(e,t,r){return null==e?null:function(e,t){const r=t;let n="",a=fe.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case fe.Normal:i===r?a=fe.Escaped:ce.includes(i)?n+="\\"+i:n+="%"===i?".*":"_"===i?".":i;break;case fe.Escaped:ce.includes(i)?n+="\\"+i:n+=i,a=fe.Normal}}return new RegExp("^"+n+"$","m")}(t,r).test(e)}function pe(e,t,r,n,a){const i=n.getAttribute(e,t);return null!=i&&r[t]===te.Date?C(new Date(i),a):null!=i&&r[t]===te.DateOnly?o.u.fromReader(i):null!=i&&r[t]===te.TimeOnly?u.n.fromReader(i):null!=i&&r[t]===te.TimeStampOffset?new s.H(i):i}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(fe||(fe={}));const me={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9387],{83932:(e,t,r)=>{r.d(t,{B:()=>l});var o=r(22021),n=r(52138),s=r(65617);function i(e,t,r){const o=Math.sin(e),n=Math.cos(e),s=Math.sin(t),i=Math.cos(t),a=r;return a[0]=-o,a[4]=-s*n,a[8]=i*n,a[12]=0,a[1]=n,a[5]=-s*o,a[9]=i*o,a[13]=0,a[2]=0,a[6]=i,a[10]=s,a[14]=0,a[3]=0,a[7]=0,a[11]=0,a[15]=1,a}var a=r(29166),u=r(8744);function l(e,t,r,o){if(null==e||null==o)return!1;const s=(0,a.eT)(e,a.Jz),l=(0,a.eT)(o,a.sp);if(s===l&&!p(l)&&(s!==a.Ej.UNKNOWN||(0,u.fS)(e,o)))return(0,n.d)(r,t),!0;if(p(l)){const e=a.rf[s][a.Ej.LON_LAT],o=a.rf[a.Ej.LON_LAT][l];return null!=e&&null!=o&&(e(t,0,d,0),o(d,0,y,0),i(c*d[0],c*d[1],r),r[12]=y[0],r[13]=y[1],r[14]=y[2],!0)}if((l===a.Ej.WEB_MERCATOR||l===a.Ej.PLATE_CARREE)&&(s===a.Ej.WGS84||s===a.Ej.CGCS2000&&l===a.Ej.PLATE_CARREE||s===a.Ej.SPHERICAL_ECEF||s===a.Ej.WEB_MERCATOR)){const e=a.rf[s][a.Ej.LON_LAT],o=a.rf[a.Ej.LON_LAT][l];return null!=e&&null!=o&&(e(t,0,d,0),o(d,0,y,0),s===a.Ej.SPHERICAL_ECEF?function(e,t,r){i(e,t,r),(0,n.t)(r,r)}(c*d[0],c*d[1],r):(0,n.g)(r),r[12]=y[0],r[13]=y[1],r[14]=y[2],!0)}return!1}function p(e){return e===a.Ej.SPHERICAL_ECEF||e===a.Ej.SPHERICAL_MARS_PCPF||e===a.Ej.SPHERICAL_MOON_PCPF}const c=(0,o.Vl)(1),d=(0,s.c)(),y=(0,s.c)()},58995:(e,t,r)=>{r.d(t,{rS:()=>l});var o=r(2109),n=r(82971),s=r(8744);const i=new n.Z(o.kU),a=new n.Z(o.JL),u=new n.Z(o.mM);function l(e){return e&&((0,s.BZ)(e)||(0,s.fS)(e,a))?a:e&&((0,s.V2)(e)||(0,s.fS)(e,u))?u:i}new n.Z(o.pn)},17017:(e,t,r)=>{r.d(t,{N:()=>i});var o=r(43697),n=r(5600),s=(r(75215),r(67676),r(80442),r(52011));const i=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,o._)([(0,n.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,o._)([(0,s.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},70082:(e,t,r)=>{r.d(t,{Z:()=>c});var o=r(43697),n=r(2368),s=r(35454),i=r(96674),a=r(5600),u=(r(75215),r(67676),r(80442),r(52011));const l=new s.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends((0,n.J)(i.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,o._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"name",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"description",void 0),(0,o._)([(0,a.Cb)({json:{read:l.read,write:l.write}})],p.prototype,"drawingTool",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,o._)([(0,u.j)("esri.layers.support.FeatureTemplate")],p);const c=p},16451:(e,t,r)=>{r.d(t,{Z:()=>y});var o=r(43697),n=r(2368),s=r(96674),i=r(5600),a=(r(75215),r(67676),r(80442),r(71715)),u=r(52011),l=r(30556),p=r(72729),c=r(70082);let d=class extends((0,n.J)(s.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,o._)([(0,i.Cb)({json:{write:!0}})],d.prototype,"id",void 0),(0,o._)([(0,i.Cb)({json:{write:!0}})],d.prototype,"name",void 0),(0,o._)([(0,i.Cb)({json:{write:!0}})],d.prototype,"domains",void 0),(0,o._)([(0,a.r)("domains")],d.prototype,"readDomains",null),(0,o._)([(0,l.c)("domains")],d.prototype,"writeDomains",null),(0,o._)([(0,i.Cb)({type:[c.Z],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,o._)([(0,u.j)("esri.layers.support.FeatureType")],d);const y=d},14147:(e,t,r)=>{r.d(t,{W:()=>l});var o=r(40330),n=r(3172),s=r(95330),i=r(19238),a=r(48522),u=r(15235);class l{constructor(e,t,r,o){this._parsedUrl=e,this._portalItem=t,this._apiKey=r,this.signal=o,this._rootDocument=null;const n=this._parsedUrl?.path.match(/^(.*)\/SceneServer\/layers\/([\d]*)\/?$/i);n&&(this._urlParts={root:n[1],layerId:parseInt(n[2],10)})}async fetch(){if(!this._urlParts)return null;const e=this._portalItem??await this._portalItemFromServiceItemId();if(null==e)return this._loadFromUrl();const t=await this._findAndLoadRelatedPortalItem(e);return null==t?null:this._loadFeatureLayerFromPortalItem(t)}async fetchPortalItem(){if(!this._urlParts)return null;const e=this._portalItem??await this._portalItemFromServiceItemId();return null==e?null:this._findAndLoadRelatedPortalItem(e)}async _fetchRootDocument(){if(null!=this._rootDocument)return this._rootDocument;if(null==this._urlParts)return this._rootDocument={},{};const e={query:{f:"json",token:this._apiKey},responseType:"json",signal:this.signal},t=`${this._urlParts.root}/SceneServer`;try{const r=await(0,n.Z)(t,e);this._rootDocument=r.data}catch{this._rootDocument={}}return this._rootDocument}async _fetchServiceOwningPortalUrl(){const e=this._parsedUrl?.path,t=e?o.id?.findServerInfo(e):null;if(t?.owningSystemUrl)return t.owningSystemUrl;const r=e?e.replace(/(.*\/rest)\/.*/i,"$1")+"/info":null;try{const e=(await(0,n.Z)(r,{query:{f:"json"},responseType:"json",signal:this.signal})).data.owningSystemUrl;if(e)return e}catch(e){(0,s.r9)(e)}return null}async _findAndLoadRelatedPortalItem(e){try{return(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:this.signal})).find((e=>"Feature Service"===e.type))||null}catch(e){return(0,s.r9)(e),null}}async _loadFeatureLayerFromPortalItem(e){await e.load({signal:this.signal});const t=await this._findMatchingAssociatedSublayerUrl(e.url??"");return new i.default({url:t,portalItem:e}).load({signal:this.signal})}async _loadFromUrl(){const e=await this._findMatchingAssociatedSublayerUrl(`${this._urlParts?.root}/FeatureServer`);return new i.default({url:e}).load({signal:this.signal})}async _findMatchingAssociatedSublayerUrl(e){const t=e.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i,"$1"),r=this._urlParts?.layerId,o=this._fetchRootDocument(),s=e=>{const r={query:{f:"json"},responseType:"json",authMode:e,signal:this.signal};return(0,n.Z)(t,r)},i=s("anonymous").catch((()=>s("no-prompt"))),[a,u]=await Promise.all([i,o]),l=u&&u.layers,p=a.data&&a.data.layers;if(!Array.isArray(p))throw new Error("expected layers array");if(Array.isArray(l)){for(let e=0;e<Math.min(l.length,p.length);e++)if(l[e].id===r)return`${t}/${p[e].id}`}else if(null!=r&&r<p.length)return`${t}/${p[r].id}`;throw new Error("could not find matching associated sublayer")}async _portalItemFromServiceItemId(){const e=(await this._fetchRootDocument()).serviceItemId;if(!e)return null;const t=new u.default({id:e,apiKey:this._apiKey}),r=await this._fetchServiceOwningPortalUrl();null!=r&&(t.portal=new a.Z({url:r}));try{return t.load({signal:this.signal})}catch(e){return(0,s.r9)(e),null}}}},51161:(e,t,r)=>{r.d(t,{H3:()=>g,QI:()=>c,U4:()=>u,Yh:()=>y});var o=r(43697),n=r(96674),s=r(5600),i=(r(75215),r(67676),r(80442),r(36030)),a=r(52011);let u=class extends n.wq{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};(0,o._)([(0,s.Cb)({type:Number})],u.prototype,"nodesPerPage",void 0),(0,o._)([(0,s.Cb)({type:Number})],u.prototype,"rootIndex",void 0),(0,o._)([(0,s.Cb)({type:String})],u.prototype,"lodSelectionMetricType",void 0),u=(0,o._)([(0,a.j)("esri.layer.support.I3SNodePageDefinition")],u);let l=class extends n.wq{constructor(){super(...arguments),this.factor=1}};(0,o._)([(0,s.Cb)({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],l.prototype,"id",void 0),(0,o._)([(0,s.Cb)({type:Number})],l.prototype,"factor",void 0),l=(0,o._)([(0,a.j)("esri.layer.support.I3SMaterialTexture")],l);let p=class extends n.wq{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};(0,o._)([(0,s.Cb)({type:[Number]})],p.prototype,"baseColorFactor",void 0),(0,o._)([(0,s.Cb)({type:l})],p.prototype,"baseColorTexture",void 0),(0,o._)([(0,s.Cb)({type:l})],p.prototype,"metallicRoughnessTexture",void 0),(0,o._)([(0,s.Cb)({type:Number})],p.prototype,"metallicFactor",void 0),(0,o._)([(0,s.Cb)({type:Number})],p.prototype,"roughnessFactor",void 0),p=(0,o._)([(0,a.j)("esri.layer.support.I3SMaterialPBRMetallicRoughness")],p);let c=class extends n.wq{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};(0,o._)([(0,i.J)({opaque:"opaque",mask:"mask",blend:"blend"})],c.prototype,"alphaMode",void 0),(0,o._)([(0,s.Cb)({type:Number})],c.prototype,"alphaCutoff",void 0),(0,o._)([(0,s.Cb)({type:Boolean})],c.prototype,"doubleSided",void 0),(0,o._)([(0,i.J)({none:"none",back:"back",front:"front"})],c.prototype,"cullFace",void 0),(0,o._)([(0,s.Cb)({type:l})],c.prototype,"normalTexture",void 0),(0,o._)([(0,s.Cb)({type:l})],c.prototype,"occlusionTexture",void 0),(0,o._)([(0,s.Cb)({type:l})],c.prototype,"emissiveTexture",void 0),(0,o._)([(0,s.Cb)({type:[Number]})],c.prototype,"emissiveFactor",void 0),(0,o._)([(0,s.Cb)({type:p})],c.prototype,"pbrMetallicRoughness",void 0),c=(0,o._)([(0,a.j)("esri.layer.support.I3SMaterialDefinition")],c);let d=class extends n.wq{};(0,o._)([(0,s.Cb)({type:String,json:{read:{source:["name","index"],reader:(e,t)=>null!=e?e:`${t.index}`}}})],d.prototype,"name",void 0),(0,o._)([(0,i.J)({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],d.prototype,"format",void 0),d=(0,o._)([(0,a.j)("esri.layer.support.I3STextureFormat")],d);let y=class extends n.wq{constructor(){super(...arguments),this.atlas=!1}};(0,o._)([(0,s.Cb)({type:[d]})],y.prototype,"formats",void 0),(0,o._)([(0,s.Cb)({type:Boolean})],y.prototype,"atlas",void 0),y=(0,o._)([(0,a.j)("esri.layer.support.I3STextureSetDefinition")],y);let f=class extends n.wq{};(0,o._)([(0,i.J)({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],f.prototype,"type",void 0),(0,o._)([(0,s.Cb)({type:Number})],f.prototype,"component",void 0),f=(0,o._)([(0,a.j)("esri.layer.support.I3SGeometryAttribute")],f);let h=class extends n.wq{};(0,o._)([(0,i.J)({draco:"draco"})],h.prototype,"encoding",void 0),(0,o._)([(0,s.Cb)({type:[String]})],h.prototype,"attributes",void 0),h=(0,o._)([(0,a.j)("esri.layer.support.I3SGeometryCompressedAttributes")],h);let m=class extends n.wq{constructor(){super(...arguments),this.offset=0}};(0,o._)([(0,s.Cb)({type:Number})],m.prototype,"offset",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"position",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"normal",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"uv0",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"color",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"uvRegion",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"featureId",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"faceRange",void 0),(0,o._)([(0,s.Cb)({type:h})],m.prototype,"compressedAttributes",void 0),m=(0,o._)([(0,a.j)("esri.layer.support.I3SGeometryBuffer")],m);let g=class extends n.wq{};(0,o._)([(0,i.J)({triangle:"triangle"})],g.prototype,"topology",void 0),(0,o._)([(0,s.Cb)()],g.prototype,"geometryBuffers",void 0),g=(0,o._)([(0,a.j)("esri.layer.support.I3SGeometryDefinition")],g)},56765:(e,t,r)=>{r.d(t,{Z:()=>p});var o,n=r(43697),s=r(46791),i=r(96674),a=r(5600),u=(r(75215),r(67676),r(80442),r(52011));let l=o=class extends i.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new s.Z}clone(){return new o({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],l.prototype,"floorField",void 0),(0,n._)([(0,a.Cb)({json:{read:!1,write:!1}})],l.prototype,"viewAllMode",void 0),(0,n._)([(0,a.Cb)({json:{read:!1,write:!1}})],l.prototype,"viewAllLevelIds",void 0),l=o=(0,n._)([(0,u.j)("esri.layers.support.LayerFloorInfo")],l);const p=l},15506:(e,t,r)=>{r.d(t,{C:()=>o});const o={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}}},30707:(e,t,r)=>{r.d(t,{a:()=>c,r:()=>l});var o=r(20102),n=r(22974),s=r(92604),i=r(54306);const a=s.Z.getLogger("esri.layers.support.labelingInfo"),u=/\[([^\[\]]+)\]/gi;function l(e,t,r){return e?e.map((e=>{const o=new i.Z;if(o.read(e,r),o.labelExpression){const e=t.fields||t.layerDefinition&&t.layerDefinition.fields||this.fields;o.labelExpression=o.labelExpression.replaceAll(u,((t,r)=>`[${function(e,t){if(!t)return e;const r=e.toLowerCase();for(let e=0;e<t.length;e++){const o=t[e].name;if(o.toLowerCase()===r)return o}return e}(r,e)}]`))}return o})):null}const p={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function c(e,t){const r=(0,n.d9)(e);return r.some((e=>function(e,t){const r=e.labelPlacement,n=p[t];if(!e.symbol)return a.warn("No ILabelClass symbol specified."),!0;if(!n)return a.error(new o.Z("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!n.includes(r)){const o=n[0];r&&a.warn(`Found invalid label placement type ${r} for ${t}. Defaulting to ${o}`),e.labelPlacement=o}return!1}(e,t)))?[]:r}},54275:(e,t,r)=>{r.d(t,{h:()=>c});var o=r(80442),n=r(66677);function s(e,t,r){return!!a(e,t,r)}function i(e,t,r){return a(e,t,r)}function a(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}const u={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function l(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function p(e,t){const r=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!r?.includes(t.toLowerCase())}function c(e,t){return{analytics:d(e),attachment:y(e),data:f(e),metadata:h(e),operations:m(e.capabilities,e,t),query:g(e,t),queryRelated:w(e),queryTopFeatures:b(e),editing:C(e)}}function d(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryAnalytics")}}function y(e){const t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:p(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:s(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=u[e.name];t&&(r[t]=!!e.isEnabled)})),r}function f(e){return{isVersioned:s(e,"isDataVersioned",!1),supportsAttachment:s(e,"hasAttachments",!1),supportsM:s(e,"hasM",!1),supportsZ:s(e,"hasZ",!1)}}function h(e){return{supportsAdvancedFieldProperties:s(e,"supportsFieldDescriptionProperty",!1)}}function m(e,t,r){const o=e?e.toLowerCase().split(",").map((e=>e.trim())):[],i=r?(0,n.Qc)(r):null,a=o.includes(null!=i&&"MapServer"===i.serverType?"data":"query"),u=o.includes("editing")&&!t.datesInUnknownTimezone;let l=u&&o.includes("create"),p=u&&o.includes("delete"),c=u&&o.includes("update");const d=o.includes("changetracking"),y=t.advancedQueryCapabilities;return u&&!(l||p||c)&&(l=p=c=!0),{supportsCalculate:s(t,"supportsCalculate",!1),supportsTruncate:s(t,"supportsTruncate",!1),supportsValidateSql:s(t,"supportsValidateSql",!1),supportsAdd:l,supportsDelete:p,supportsEditing:u,supportsChangeTracking:d,supportsQuery:a,supportsQueryAnalytics:s(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:s(y,"supportsQueryAttachments",!1),supportsQueryTopFeatures:s(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:s(t,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:s(t,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:s(t,"supportsAsyncConvert3D",!1)}}function g(e,t){const r=e.advancedQueryCapabilities,a=e.ownershipBasedAccessControlForFeatures,u=e.archivingInfo,c=e.currentVersion,d=t?.includes("MapServer"),y=!d||c>=(0,o.Z)("mapserver-pbf-version-support"),f=(0,n.M8)(t),h=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:s(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:s(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:s(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:l(r),supportsCentroid:s(r,"supportsReturningGeometryCentroid",!1),supportsDistance:s(r,"supportsQueryWithDistance",!1),supportsDistinct:s(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:s(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:s(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:s(r,"supportsHavingClause",!1),supportsOrderBy:s(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:s(r,"supportsPagination",!1),supportsQuantization:s(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:s(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:s(e,"supportsReturningQueryGeometry",!1),supportsResultType:s(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:s(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:s(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:s(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:s(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:s(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:s(a,"allowOthersToQuery",!0),supportsHistoricMoment:s(u,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:y&&h.has("pbf"),supportsDisjointSpatialRelationship:s(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:s(r,"supportsQueryWithCacheHint",!1)||p(r,"query"),supportsDefaultSpatialReference:s(r,"supportsDefaultSR",!1),supportsCompactGeometry:f,supportsFullTextSearch:s(r,"supportsFullTextSearch",!1),maxRecordCountFactor:i(e,"maxRecordCountFactor",void 0),maxRecordCount:i(e,"maxRecordCount",void 0),standardMaxRecordCount:i(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:i(e,"tileMaxRecordCount",void 0)}}function w(e){const t=e.advancedQueryCapabilities,r=s(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:s(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:p(t,"queryRelated")}}function b(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryTopFilter")}}function C(e){const t=e.ownershipBasedAccessControlForFeatures,r=e?e.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:s(e,"allowGeometryUpdates",!0),supportsGlobalId:s(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:s(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:s(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:s(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:s(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:s(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:s(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:s(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:s(t,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:s(r,"supportsAsyncApplyEdits",!1)}}},28694:(e,t,r)=>{r.d(t,{p:()=>n});var o=r(69285);function n(e,t,r){if(!r||!r.features||!r.hasZ)return;const n=(0,o.k)(r.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of r.features)n(e.geometry)}},74889:(e,t,r)=>{r.d(t,{Z:()=>b});var o,n=r(43697),s=r(66577),i=r(38171),a=r(35454),u=r(96674),l=r(22974),p=r(5600),c=(r(75215),r(71715)),d=r(52011),y=r(30556),f=r(82971),h=r(33955),m=r(1231);const g=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=o=class extends u.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=f.Z.fromJSON(t.spatialReference),o=[];for(let t=0;t<e.length;t++){const n=e[t],s=i.Z.fromJSON(n),a=n.geometry&&n.geometry.spatialReference;null==s.geometry||a||(s.geometry.spatialReference=r);const u=n.aggregateGeometries,l=s.aggregateGeometries;if(u&&null!=l)for(const e in l){const t=l[e],o=u[e],n=o?.spatialReference;null==t||n||(t.spatialReference=r)}o.push(s)}return o}writeGeometryType(e,t,r,o){if(e)return void g.write(e,t,r,o);const{features:n}=this;if(n)for(const e of n)if(e&&null!=e.geometry)return void g.write(e.geometry.type,t,r,o)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,o=(0,h.im)(e);return o&&!r&&t.spatialReference&&(o.spatialReference=f.Z.fromJSON(t.spatialReference)),o}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new o(this.cloneProperties())}cloneProperties(){return(0,l.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const o=t.features[r];if(o.geometry){const t=e&&e[r];o.geometry=t&&t.toJSON()||o.geometry}}return t}quantize(e){const{scale:[t,r],translate:[o,n]}=e,s=this.features,i=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-o)/t)),(e=>Math.round((n-e)/r)));for(let e=0,t=s.length;e<t;e++)i?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[o,n],scale:[s,i]}=r;let a=null,u=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;u=r=>null==r?r:r*t+e}const l=this._getHydrationFunction(e,(e=>e*s+o),(e=>n-e*i),a,u);for(const{geometry:e}of t)null!=e&&l&&l(e);return this.transform=null,this}_quantizePoints(e,t,r){let o,n;const s=[];for(let i=0,a=e.length;i<a;i++){const a=e[i];if(i>0){const e=t(a[0]),i=r(a[1]);e===o&&i===n||(s.push([e-o,i-n]),o=e,n=i)}else o=t(a[0]),n=r(a[1]),s.push([o,n])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const o=(0,h.oU)(e)?e.rings:e.paths,n=[];for(let e=0,s=o.length;e<s;e++){const s=o[e],i=this._quantizePoints(s,t,r);i&&n.push(i)}return n.length>0?((0,h.oU)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const o=this._quantizePoints(e.points,t,r);return o&&o.length>0?(e.points=o,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,o,n){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),o&&(e.z=o(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,h.oU)(e)?e.rings:e.paths;let i,a;for(let e=0,o=s.length;e<o;e++){const o=s[e];for(let e=0,n=o.length;e<n;e++){const n=o[e];e>0?(i+=n[0],a+=n[1]):(i=n[0],a=n[1]),n[0]=t(i),n[1]=r(a)}}if(o&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2]),r[3]=n(r[3])}}else if(o)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2])}}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),o&&null!=e.zmax&&null!=e.zmin&&(e.zmax=o(e.zmax),e.zmin=o(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let i,a;for(let e=0,o=s.length;e<o;e++){const o=s[e];e>0?(i+=o[0],a+=o[1]):(i=o[0],a=o[1]),o[0]=t(i),o[1]=r(a)}if(o&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=o(t[2]),t[3]=n(t[3])}else if(o)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=o(t[2])}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2])}}:null}};(0,n._)([(0,p.Cb)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,n._)([(0,p.Cb)({type:[i.Z],json:{write:!0}})],w.prototype,"features",void 0),(0,n._)([(0,c.r)("features")],w.prototype,"readFeatures",null),(0,n._)([(0,p.Cb)({type:[m.Z],json:{write:!0}})],w.prototype,"fields",void 0),(0,n._)([(0,p.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],w.prototype,"geometryType",void 0),(0,n._)([(0,y.c)("geometryType")],w.prototype,"writeGeometryType",null),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,n._)([(0,p.Cb)({types:s.qM,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,n._)([(0,c.r)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,n._)([(0,p.Cb)({type:f.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,n._)([(0,y.c)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,n._)([(0,p.Cb)({json:{write:!0}})],w.prototype,"transform",void 0),w=o=(0,n._)([(0,d.j)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const b=w},36405:(e,t,r)=>{function o(e,t){return null!=t&&t.mode?t.mode:function(e){return e?l:p}(e).mode}function n(e,t){return o(null!=e&&e.hasZ,t)}function s(e,t,r){return r&&r.mode!==t?`${e} only support ${t} elevation mode`:null}function i(e,t,r){return r?.mode===t?`${e} do not support ${t} elevation mode`:null}function a(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function u(e,t){t&&e.warn(".elevationInfo=",t)}r.d(t,{LR:()=>u,Uy:()=>s,VW:()=>n,Wb:()=>i,kf:()=>a}),r(12541);const l={mode:"absolute-height",offset:0},p={mode:"on-the-ground",offset:null}},58333:(e,t,r)=>{r.d(t,{ET:()=>s,I4:()=>n,eG:()=>u,lF:()=>i,lj:()=>p,qP:()=>a,wW:()=>l});const o=[252,146,31,255],n={type:"esriSMS",style:"esriSMSCircle",size:6,color:o,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},s={type:"esriSLS",style:"esriSLSSolid",width:.75,color:o},i={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},u={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},l={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},p={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}},91891:(e,t,r)=>{r.d(t,{I_:()=>d,W7:()=>h,qM:()=>g});var o=r(20102),n=r(22974),s=r(92604),i=r(25683),a=r(35065);const u=s.Z.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function l(e,t,r){let n="",s=0;for(;s<r;){const i=e[t+s];if(i<128)n+=String.fromCharCode(i),s++;else if(i>=192&&i<224){if(s+1>=r)throw new o.Z("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const a=(31&i)<<6|63&e[t+s+1];n+=String.fromCharCode(a),s+=2}else if(i>=224&&i<240){if(s+2>=r)throw new o.Z("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(15&i)<<12|(63&e[t+s+1])<<6|63&e[t+s+2];n+=String.fromCharCode(a),s+=3}else{if(!(i>=240&&i<248))throw new o.Z("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(s+3>=r)throw new o.Z("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(7&i)<<18|(63&e[t+s+1])<<12|(63&e[t+s+2])<<6|63&e[t+s+3];if(a>=65536){const e=55296+(a-65536>>10),t=56320+(1023&a);n+=String.fromCharCode(e,t)}else n+=String.fromCharCode(a);s+=4}}}return n}function p(e,t){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let o=0;for(let n=0;n<t.length;n++){const s=t[n],i=s.valueType||s.type,a=b[i];r.fields[s.property]=a(e,o),o+=w[i].BYTES_PER_ELEMENT}return r.byteCount=o,r}function c(e,t,r){const n=[];let s,i,a=0;for(i=0;i<e;i+=1){if(s=t[i],s>0){if(n.push(l(r,a,s-1)),0!==r[a+s-1])throw new o.Z("string-array-error","Invalid string array: missing null termination.")}else n.push(null);a+=s}return n}function d(e,t){return new(0,w[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function y(e,t,r){const s=null!=t.header?p(e,t.header):{byteOffset:0,byteCount:0,fields:{count:r}},i={header:s,byteOffset:s.byteCount,byteCount:0,entries:Object.create(null)};let a=s.byteCount;for(let e=0;e<t.ordering.length;e++){const r=t.ordering[e],u=(0,n.d9)(t[r]);if(u.count=s.fields.count??0,"String"===u.valueType){if(u.byteOffset=a,u.byteCount=s.fields[r+"ByteCount"],"UTF-8"!==u.encoding)throw new o.Z("unsupported-encoding","Unsupported String encoding.",{encoding:u.encoding});if(u.timeEncoding&&"ECMA_ISO8601"!==u.timeEncoding)throw new o.Z("unsupported-time-encoding","Unsupported time encoding.",{timeEncoding:u.timeEncoding})}else{if(!C(u.valueType))throw new o.Z("unsupported-value-type","Unsupported binary valueType",{valueType:u.valueType});{const e=v(u.valueType);a+=a%e!=0?e-a%e:0,u.byteOffset=a,u.byteCount=e*u.valuesPerElement*u.count}}a+=u.byteCount??0,i.entries[r]=u}return i.byteCount=a-i.byteOffset,i}function f(e,t,r){if(t!==e&&u.error(`Invalid ${r} buffer size\n expected: ${e}, actual: ${t})`),t<e)throw new o.Z("buffer-too-small","Binary buffer is too small",{expectedSize:e,actualSize:t})}function h(e,t){const r=p(e,t&&t.header);let o=r.byteCount;const n={isDraco:!1,header:r,byteOffset:r.byteCount,byteCount:0,vertexAttributes:{}},s=r.fields,i=null!=s.vertexCount?s.vertexCount:s.count;for(const e of t.ordering){if(!t.vertexAttributes[e])continue;const r={...t.vertexAttributes[e],byteOffset:o,count:i},s=m[e]||"_"+e;n.vertexAttributes[s]=r,o+=v(r.valueType)*r.valuesPerElement*i}const a=s.faceCount;if(t.faces&&a){n.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const r={...t.faces[e],byteOffset:o,count:a};n.faces[e]=r,o+=v(r.valueType)*r.valuesPerElement*a}}const u=s.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&u){n.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const r={...t.featureAttributes[e],byteOffset:o,count:u};n.featureAttributes[e]=r,o+=("UInt64"===r.valueType?8:v(r.valueType))*r.valuesPerElement*u}}return f(o,e.byteLength,"geometry"),n.byteCount=o-n.byteOffset,n}const m={position:a.T.POSITION,normal:a.T.NORMAL,color:a.T.COLOR,uv0:a.T.UV0,region:a.T.UVREGION};function g(e,t,r){if("lepcc-rgb"===e.encoding)return(0,i.IT)(t);if("lepcc-intensity"===e.encoding)return(0,i.ti)(t);if(null!=e.encoding&&""!==e.encoding)throw new o.Z("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");e["attributeByteCounts "]&&!e.attributeByteCounts&&(u.warn("Warning: Trailing space in 'attributeByteCounts '."),e.attributeByteCounts=e["attributeByteCounts "]),"ObjectIds"===e.ordering[0]&&e.hasOwnProperty("objectIds")&&(u.warn("Warning: Case error in objectIds"),e.ordering[0]="objectIds");const n=y(t,e,r);f(n.byteOffset+n.byteCount,t.byteLength,"attribute");const s=n.entries.attributeValues||n.entries.objectIds;if(s){if("String"===s.valueType){const e=n.entries.attributeByteCounts,r=d(t,e),o=function(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}(t,s);return s.timeEncoding?function(e,t,r){return c(e,t,r).map((e=>{const t=e?Date.parse(e):null;return t&&!Number.isNaN(t)?t:null}))}(e.count,r,o):c(e.count,r,o)}return d(t,s)}throw new o.Z("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const w={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},b={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function C(e){return w.hasOwnProperty(e)}function v(e){return C(e)?w[e].BYTES_PER_ELEMENT:0}},2358:(e,t,r)=>{r.d(t,{xe:()=>w});var o=r(3172),n=(r(67676),r(20102),r(80442),r(1533)),s=(r(21787),r(46521)),i=(r(52138),r(13598)),a=(r(51305),r(94961)),u=(r(17896),r(65617));r(2109),r(73615),r(82971),r(58995),r(83932),r(87360),(0,u.c)();var l=r(24470),p=(r(8744),r(14165),r(91891));r(22303);var c,d,y=r(88669);(d=c||(c={}))[d.INVISIBLE=0]="INVISIBLE",d[d.TRANSPARENT=1]="TRANSPARENT",d[d.OPAQUE=2]="OPAQUE";(0,y.f)(0,0,0,.2),c.OPAQUE;(0,y.f)(0,0,0,.2),c.OPAQUE,r(6206);var f,h,m=r(87951),g=r(51417);async function w(e,t,r,n,s){const i=[];for(const o of t)if(o&&s.includes(o.name)){const t=`${e}/nodes/${r}/attributes/${o.key}/0`;i.push({url:t,storageInfo:o})}const a=await Promise.allSettled(i.map((e=>(0,o.Z)(e.url,{responseType:"array-buffer"}).then((t=>(0,p.qM)(e.storageInfo,t.data)))))),u=[];for(const e of n){const t={};for(let r=0;r<a.length;r++){const o=a[r];if("fulfilled"===o.status){const n=o.value;t[i[r].storageInfo.name]=v(n,e)}}u.push(t)}return u}(0,l.Ue)(),(h=f||(f={}))[h.OUTSIDE=0]="OUTSIDE",h[h.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",h[h.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",h[h.INSIDE=3]="INSIDE";const b=-32768,C=-(2**31);function v(e,t){if(!e)return null;const r=e[t];return(0,n.z3)(e)?r===b?null:r:(0,n.Hx)(e)?r===C?null:r:r!=r?null:r}const S=new Array(24);new g.a(S,3,!0),(0,u.c)(),(0,u.c)(),(0,s.a)(),(0,i.a)(),(0,a.a)(),(0,l.Ue)(),(0,l.Ue)(),(0,m.Ue)(),(0,u.c)(),new Array(72),(0,i.a)()},25683:(e,t,r)=>{r.d(t,{Gi:()=>l,IT:()=>f,ti:()=>g});var o=r(20102);const n=!0,s={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function i(e,t,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(e,r+s.identifierOffset,s.identifierLength)),version:t.getUint16(r+s.versionOffset,n),checksum:t.getUint32(r+s.checksumOffset,n)}}const a={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function u(e,t){return{sizeLo:e.getUint32(t+a.sizeLo,n),sizeHi:e.getUint32(t+a.sizeHi,n),minX:e.getFloat64(t+a.minX,n),minY:e.getFloat64(t+a.minY,n),minZ:e.getFloat64(t+a.minZ,n),maxX:e.getFloat64(t+a.maxX,n),maxY:e.getFloat64(t+a.maxY,n),maxZ:e.getFloat64(t+a.maxZ,n),errorX:e.getFloat64(t+a.errorX,n),errorY:e.getFloat64(t+a.errorY,n),errorZ:e.getFloat64(t+a.errorZ,n),count:e.getUint32(t+a.count,n),reserved:e.getUint32(t+a.reserved,n)}}function l(e){const t=new DataView(e,0);let r=0;const{identifier:n,version:l}=i(e,t,r);if(r+=s.byteCount,"LEPCC "!==n)throw new o.Z("lepcc-decode-error","Bad identifier");if(l>1)throw new o.Z("lepcc-decode-error","Unknown version");const c=u(t,r);if(r+=a.byteCount,c.sizeHi*2**32+c.sizeLo!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");const d=new Float64Array(3*c.count),y=[],f=[],h=[],m=[];if(r=p(e,r,y),r=p(e,r,f),r=p(e,r,h),r=p(e,r,m),r!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad length");let g=0,w=0;for(let e=0;e<y.length;e++){w+=y[e];let t=0;for(let r=0;r<f[e];r++){t+=h[g];const e=m[g];d[3*g]=Math.min(c.maxX,c.minX+2*c.errorX*t),d[3*g+1]=Math.min(c.maxY,c.minY+2*c.errorY*w),d[3*g+2]=Math.min(c.maxZ,c.minZ+2*c.errorZ*e),g++}}return{errorX:c.errorX,errorY:c.errorY,errorZ:c.errorZ,result:d}}function p(e,t,r){const o=[];t=c(e,t,o);const n=[];for(let s=0;s<o.length;s++){n.length=0,t=c(e,t,n);for(let e=0;e<n.length;e++)r.push(n[e]+o[s])}return t}function c(e,t,r){const s=new DataView(e,t),i=s.getUint8(0),a=31&i,u=!!(32&i),l=(192&i)>>6;let p=0;if(0===l)p=s.getUint32(1,n),t+=5;else if(1===l)p=s.getUint16(1,n),t+=3;else{if(2!==l)throw new o.Z("lepcc-decode-error","Bad count type");p=s.getUint8(1),t+=2}if(u)throw new o.Z("lepcc-decode-error","LUT not implemented");const c=Math.ceil(p*a/8),d=new Uint8Array(e,t,c);let y=0,f=0,h=0;const m=-1>>>32-a;for(let e=0;e<p;e++){for(;f<a;)y|=d[h]<<f,f+=8,h+=1;r[e]=y&m,y>>>=a,f-=a,f+a>32&&(y|=d[h-1]>>8-f)}return t+h}const d={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function y(e,t){return{sizeLo:e.getUint32(t+d.sizeLo,n),sizeHi:e.getUint32(t+d.sizeHi,n),count:e.getUint32(t+d.count,n),colorMapCount:e.getUint16(t+d.colorMapCount,n),lookupMethod:e.getUint8(t+d.lookupMethod),compressionMethod:e.getUint8(t+d.compressionMethod)}}function f(e){const t=new DataView(e,0);let r=0;const{identifier:n,version:a}=i(e,t,r);if(r+=s.byteCount,"ClusterRGB"!==n)throw new o.Z("lepcc-decode-error","Bad identifier");if(a>1)throw new o.Z("lepcc-decode-error","Unknown version");const u=y(t,r);if(r+=d.byteCount,u.sizeHi*2**32+u.sizeLo!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");if((2===u.lookupMethod||1===u.lookupMethod)&&0===u.compressionMethod){if(3*u.colorMapCount+u.count+r!==e.byteLength||u.colorMapCount>256)throw new o.Z("lepcc-decode-error","Bad count");const t=new Uint8Array(e,r,3*u.colorMapCount),n=new Uint8Array(e,r+3*u.colorMapCount,u.count),s=new Uint8Array(3*u.count);for(let e=0;e<u.count;e++){const r=n[e];s[3*e]=t[3*r],s[3*e+1]=t[3*r+1],s[3*e+2]=t[3*r+2]}return s}if(0===u.lookupMethod&&0===u.compressionMethod){if(3*u.count+r!==e.byteLength||0!==u.colorMapCount)throw new o.Z("lepcc-decode-error","Bad count");return new Uint8Array(e,r).slice()}if(u.lookupMethod<=2&&1===u.compressionMethod){if(r+3!==e.byteLength||1!==u.colorMapCount)throw new o.Z("lepcc-decode-error","Bad count");const n=t.getUint8(r),s=t.getUint8(r+1),i=t.getUint8(r+2),a=new Uint8Array(3*u.count);for(let e=0;e<u.count;e++)a[3*e]=n,a[3*e+1]=s,a[3*e+2]=i;return a}throw new o.Z("lepcc-decode-error","Bad method "+u.lookupMethod+","+u.compressionMethod)}const h={sizeLo:0,sizeHi:4,count:8,scaleFactor:12,bitsPerPoint:14,reserved:15,byteCount:16};function m(e,t){return{sizeLo:e.getUint32(t+h.sizeLo,n),sizeHi:e.getUint32(t+h.sizeHi,n),count:e.getUint32(t+h.count,n),scaleFactor:e.getUint16(t+h.scaleFactor,n),bitsPerPoint:e.getUint8(t+h.bitsPerPoint),reserved:e.getUint8(t+h.reserved)}}function g(e){const t=new DataView(e,0);let r=0;const{identifier:n,version:a}=i(e,t,r);if(r+=s.byteCount,"Intensity "!==n)throw new o.Z("lepcc-decode-error","Bad identifier");if(a>1)throw new o.Z("lepcc-decode-error","Unknown version");const u=m(t,r);if(r+=h.byteCount,u.sizeHi*2**32+u.sizeLo!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");const l=new Uint16Array(u.count);if(8===u.bitsPerPoint){if(u.count+r!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");const t=new Uint8Array(e,r,u.count);for(let e=0;e<u.count;e++)l[e]=t[e]*u.scaleFactor}else if(16===u.bitsPerPoint){if(2*u.count+r!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");const t=new Uint16Array(e,r,u.count);for(let e=0;e<u.count;e++)l[e]=t[e]*u.scaleFactor}else{const t=[];if(c(e,r,t)!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");for(let e=0;e<u.count;e++)l[e]=t[e]*u.scaleFactor}return l}},19833:(e,t,r)=>{r.d(t,{V5:()=>s,e7:()=>n});var o=r(35671);async function n(e,t=e.popupTemplate){if(null==t)return[];const r=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:n}=t,{objectIdField:s,typeIdField:i,globalIdField:a,relationships:u}=e;if(r.includes("*"))return["*"];const l=n?await(0,o.CH)(e):[],p=(0,o.Q0)(e.fieldsIndex,[...r,...l]);return i&&p.push(i),p&&s&&e.fieldsIndex?.has(s)&&!p.includes(s)&&p.push(s),p&&a&&e.fieldsIndex?.has(a)&&!p.includes(a)&&p.push(a),u&&u.forEach((t=>{const{keyField:r}=t;p&&r&&e.fieldsIndex?.has(r)&&!p.includes(r)&&p.push(r)})),p}function s(e,t){return e.popupTemplate?e.popupTemplate:null!=t&&t.defaultPopupTemplateEnabled&&null!=e.defaultPopupTemplate?e.defaultPopupTemplate:null}}}]);
|