import{executeQuery as r,executeCount as e}from"../../support/_graphicsQuery.js";import{isRouteLayer as t}from"../../utilities/_layers.js";import{_toRouteLayerGraphic as o}from"../support/_routeLayerUtils.js";import{QueryProviderBase as s}from"./QueryProviderBase.js";export class RouteLayerQueryProvider extends s{isSupported(r){const{layer:e}=r;return t(e)&&r.capabilities.supportsQuery}_query(e,t,o){return r(t,e,this._getAllGraphics(e),o)}_count(r,t,o){return e(t,r,this._getAllGraphics(r),o)}_getAllGraphics(r){const e=[...r.layer.stops?.toArray()??[],...r.layer.directionPoints?.toArray()??[],...r.layer.directionLines?.toArray()??[],...r.layer.pointBarriers?.toArray()??[],...r.layer.polylineBarriers?.toArray()??[],...r.layer.polygonBarriers?.toArray()??[]].map(o);return r.layer.routeInfo&&e.unshift(o(r.layer.routeInfo)),e}}