/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
export default $arcgis.t(([f,y])=>{function v(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass.startsWith("esri.layers.")&&i(t)&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function c(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&(t.declaredClass==="esri.Map"||t.declaredClass==="esri.WebMap"||t.declaredClass==="esri.WebScene")}function h(t){return!!t&&typeof t=="object"&&"loadAll"in t&&typeof t.loadAll=="function"}function p(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function s(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function i(t){return!!t&&typeof t=="object"&&"fields"in t&&Array.isArray(t.fields)}function o(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function d(t){return o(t)&&/\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url??"")}function u(t){return o(t)||i(t)||s(t)}function D(t){return u(t)&&"type"in t&&t.type==="voxel"}function F(t){return u(t)&&"type"in t&&(t.type==="imagery"||t.type==="imagery-tile")}function w(t){return o(t)||i(t)||s(t)}function q(t){return p(t)||c(t)||d(t)}function S(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.Subtype"}function x(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.CodedValueDomain"}function W(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.InheritedDomain"}function L(t){return!!t&&typeof t=="object"&&"id"in t&&typeof t.id=="string"&&"definitions"in t&&typeof t.definitions=="object"&&!Array.isArray(t.definitions)}function M(t){return!!t&&typeof t=="object"&&"title"in t&&typeof t.title=="string"}function G(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function b(t){return!!t&&typeof t=="object"&&"layerId"in t&&typeof t.layerId=="number"}function U(t){return!!t&&typeof t=="object"&&"typeIdField"in t&&"types"in t}function k(t){return!!t&&typeof t=="object"&&"getFieldDomain"in t&&typeof t.getFieldDomain=="function"}function j(t){return!!t&&typeof t=="object"&&"subtypeField"in t}function z(t){return j(t)&&"subtypes"in t}function B(t){return!!t&&typeof t=="object"&&"portalItem"in t}function E(t){return b(t)&&"relationships"in t&&"url"in t&&Array.isArray(t.relationships)&&typeof t.url=="string"}function g(t){return!!t&&typeof t=="object"&&"isTable"in t&&typeof t.isTable=="boolean"}function m(t){if(t&&typeof t=="object"){if(g(t))return t.isTable||"type"in t&&t.type==="table";if("geometryType"in t)return t.geometryType===""||t.geometryType==="esriGeometryNull"||t.geometryType===null}return!1}function H(t){return!m(t)}function C(t){return!!t&&typeof t=="object"&&"load"in t&&typeof t.load=="function"}function N(t){return!!t&&typeof t=="object"&&"type"in t&&t.type==="voxel"}function O(t){return!!t&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&["imagery","imagery-tile"].includes(t.type)}function V(t){return!!t&&typeof t=="object"&&"id"in t&&typeof t.id=="string"&&"serviceUrl"in t&&typeof t.serviceUrl=="string"&&"portal"in t&&!!t.portal&&typeof t.portal=="object"&&"url"in t.portal&&typeof t.portal.url=="string"}function $(t){return!!t&&"intlStrings"in t&&"policy"in t}function J(t){return t?.type==="featureSet"}function K(t){return t?.type==="dataCatalogDatastore"}function I(t){return!!t&&"datasetInfo"in t}function P(t){return!!t&&t.type!=="dataCatalogDatastore"&&!I(t)}async function Q(t){if(!t)return null;let r;return i(t)?r=t:r=new f(t),C(r)&&await r.load(),r}async function R(t){t+="/layers";let r=await y(t,{responseType:"json",query:{f:"json"}}),n=t.endsWith("MapServer/layers")?"data":"query",e=a(r.data?.layers,n),l=a(r.data?.tables,n);return{layers:e,tables:l}}function a(t,r){return t?t.filter(n=>{switch(n.type){case"Feature Layer":case"Oriented Imagery Layer":case"Catalog Layer":case"Table":return(n.capabilities?n.capabilities.toLowerCase().split(",").map(e=>e.trim()):[]).includes(r);default:return!1}}):[]}return{a:v,b:c,c:h,d:p,e:o,f:u,g:D,h:F,i:w,j:q,k:S,l:x,m:W,n:L,o:M,p:G,q:b,r:U,s:k,t:j,u:z,v:B,w:E,x:g,y:H,z:N,A:O,B:V,C:$,D:J,E:K,F:I,G:P,H:Q,I:R}},"layers/FeatureLayer","request")