/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import{l as c}from"./ZX3UHK6P.js";import{a as o}from"./AJZDBHB6.js";import{a as n}from"./FKCIW6NV.js";function x(e){return f(e.type,e.typeKeywords)}function f(e,r=[]){return e==="Feature Service"&&r.includes("Hosted Service")}function u(e){let r=/(feature)server(\/|\/(\d+))?$/i;return!!e&&e.includes("arcgis.com")&&r.test(e)&&!m(e)}function m(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}var p;(function(e){e.EXTRACT="Extract",e.QUERY="Query"})(p||(p={}));function b(e,r){return(r.capabilities||"").split(",").includes(e)}function S(e,r){return b(e,r)?v(e,r):g(e,r)}function g(e,r){let t=(r.capabilities||"").split(",").filter(s=>!!s).concat(e).join(",");return Object.assign(Object.assign({},r),{capabilities:t})}function v(e,r){let t=r.capabilities.split(",").filter(s=>s!==e).join(",");return Object.assign(Object.assign({},r),{capabilities:t})}function l(e){return u(e.url)&&!!e.serverExtractCapability}function d(e){let r=c(e.url),t=e.access==="public",i=e.serverQueryCapability;return r&&t&&i}function a(e){let{type:r,typeKeywords:t=[]}=e;return r===n["Image Service"]&&!t.includes("Tiled Imagery")}function M(e,r){let t=null;return l(e)?t="createReplica":d(e)&&!r?t=!!o(e,"extendedProps.serverExtractCapability")?"fgdb":"paging":a(e)&&(t="exportImage"),t}function A(e){let r=["Feature Service","Map Service"].includes(e.type)&&/\/\d+$/.test(e.url),t=o(e,"extendedProps.server.layers.length")===1,i=a(e);return r||t||i}export{x as a,p as b,b as c,S as d,M as e,A as f};
