/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as r}from"tslib";import t from"../core/Accessor.js";import i from"../core/Collection.js";import{addMaybe as e}from"../core/SetUtils.js";import{property as o,subclass as s}from"../core/accessorSupport/decorators.js";import{isCSVGraphicOrigin as n}from"../graphic/isCSVGraphicOrigin.js";import{isFeatureGraphicOrigin as p}from"../graphic/isFeatureGraphicOrigin.js";import{isGeoJSONGraphicOrigin as a}from"../graphic/isGeoJSONGraphicOrigin.js";import{isOGCFeatureGraphicOrigin as m}from"../graphic/isOGCFeatureGraphicOrigin.js";import{isSubtypeGroupGraphicOrigin as l}from"../graphic/isSubtypeGroupGraphicOrigin.js";import{isWFSGraphicOrigin as c}from"../graphic/isWFSGraphicOrigin.js";import{isSubtypeSublayer as h}from"../layers/support/layerUtils.js";import{isGraphic as g}from"../support/graphicInstanceUtils.js";class y{constructor(r,t,i){this.layer=r,this.graphic=t,this.type=i}}function u(r){return r&&(p(r.origin)||l(r.origin)||c(r.origin)||n(r.origin)||m(r.origin)||a(r.origin))?r.origin.layer:null}let f=class extends t{constructor(){super(...arguments),this.version=0,this.items=new i}setData(r){this.items.removeAll();for(const t of r)g(t)?this.items.push(new y(u(t),t.clone(),"feature")):this.items.push(new y(t.layer,t.graphic.clone(),t.type));this.version++}get hasItems(){return this.items.length>0}get hasDestinationRelationships(){const r=new Set(this.items.map(r=>h(r.layer)?r.layer.parent:r.layer).filter(r=>null!=r));for(const t of r){if((t.relationships??[]).some(r=>"destination"===r.role))return!0}return!1}get geometryTypes(){const r=new Set;for(const t of this.items)e(r,t.graphic.geometry?.type);return r}get singleGeometryType(){if(1===this.geometryTypes.size)return this.geometryTypes.values().next().value}};r([o()],f.prototype,"version",void 0),r([o()],f.prototype,"hasItems",null),r([o()],f.prototype,"items",void 0),r([o()],f.prototype,"hasDestinationRelationships",null),r([o()],f.prototype,"geometryTypes",null),r([o()],f.prototype,"singleGeometryType",null),f=r([s("esri.editing.Clipboard")],f);const j=new f;function G(){return j}export{G as getApplicationClipboard};
