/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../../core/maybe","../../../../../layers/support/arcgisLayerUrl","./DrillDownFeatureSource","./GeoEventSource","./PagedFeatureSource","./SnapshotFeatureSource"],(function(e,t,r,n,o,a,s){"use strict";function u(e,t,r,u,i,p){const l=c(e,t,r,u,i,p);switch(l.type){case"feature":switch(l.origin){case"hosted":case"local":return new a.PagedFeatureSource(l);case"snapshot":return new s.SnapshotFeatureSource(l);case"unknown":return new n.DrillDownFeatureSource(l)}case"geoevent":return new o.GeoEventSource(l)}}function c(e,n,o,a,s,u){switch(e.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:t.unwrapOr(e.featureCount,0),serviceInfo:e,onMessage:a,outSR:n,tileInfoView:o,canAcceptRequest:s,store:u};case"stream":return{type:"geoevent",serviceInfo:e,onMessage:a,outSR:n,canAcceptRequest:s};case"memory":case"on-demand":return{type:"feature",serviceInfo:e,onMessage:a,outSR:n,origin:c(e.source),tileInfoView:o,canAcceptRequest:s}}function c(e){return Array.isArray(e)?"local":"path"in e&&r.isHostedAgolService(e.path)?"hosted":"unknown"}}e.createSource=u,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
