{"version":3,"sources":["node_modules/@arcgis/core/portal/support/portalItemUtils.js"],"sourcesContent":["/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.31/esri/copyright.txt for details.\n*/\nimport { initializeProjection as e, project as t } from \"../../geometry/projection.js\";\nimport r from \"../../geometry/SpatialReference.js\";\nimport { webMercatorToGeographic as n } from \"../../geometry/support/webMercatorUtils.js\";\nasync function o(o) {\n const i = o.spatialReference;\n if (i.isWGS84) return o.clone();\n if (i.isWebMercator) return n(o);\n const s = r.WGS84;\n return await e(i, s), t(o, s);\n}\nfunction i(e, t) {\n if (!s(e, t)) {\n const r = e.typeKeywords;\n r ? r.push(t) : e.typeKeywords = [t];\n }\n}\nfunction s(e, t) {\n return !!e.typeKeywords?.includes(t);\n}\nfunction c(e) {\n return s(e, f.HOSTED_SERVICE);\n}\nfunction a(e, t) {\n const r = e.typeKeywords;\n if (r) {\n const e = r.indexOf(t);\n e > -1 && r.splice(e, 1);\n }\n}\nfunction u(e, t, r) {\n r ? i(e, t) : a(e, t);\n}\nasync function l(e) {\n const t = e.clone().normalize();\n let r;\n if (t.length > 1) for (const n of t) r ? n.width > r.width && (r = n) : r = n;else r = t[0];\n return o(r);\n}\nconst f = {\n DEVELOPER_BASEMAP: \"DeveloperBasemap\",\n JSAPI: \"ArcGIS API for JavaScript\",\n METADATA: \"Metadata\",\n MULTI_LAYER: \"Multilayer\",\n SINGLE_LAYER: \"Singlelayer\",\n TABLE: \"Table\",\n HOSTED_SERVICE: \"Hosted Service\",\n LOCAL_SCENE: \"ViewingMode-Local\",\n TILED_IMAGERY: \"Tiled Imagery\",\n GROUP_LAYER_MAP: \"Map\",\n ORIENTED_IMAGERY_LAYER: \"OrientedImageryLayer\"\n};\nfunction E(e) {\n const {\n portal: t,\n isOrgItem: r,\n itemControl: n\n } = e,\n o = t.user?.privileges;\n let i = !o || o.includes(\"features:user:edit\"),\n s = !!r && !!o?.includes(\"features:user:fullEdit\");\n const c = \"update\" === n || \"admin\" === n;\n return c ? s = i = !0 : s && (i = !0), {\n features: {\n edit: i,\n fullEdit: s\n },\n content: {\n updateItem: c\n }\n };\n}\nexport { i as addTypeKeyword, E as getUserPrivileges, l as getWGS84ExtentForItem, s as hasTypeKeyword, c as isHostedLayer, a as removeTypeKeyword, u as toggleTypeKeyword, f as typeKeyword };"],"mappings":"uKAOA,SAAeA,EAAEA,EAAG,QAAAC,EAAA,sBAClB,IAAMC,EAAIF,EAAE,iBACZ,GAAIE,EAAE,QAAS,OAAOF,EAAE,MAAM,EAC9B,GAAIE,EAAE,cAAe,OAAOC,EAAEH,CAAC,EAC/B,IAAMI,EAAIC,EAAE,MACZ,OAAO,MAAMC,EAAEJ,EAAGE,CAAC,EAAGG,EAAEP,EAAGI,CAAC,CAC9B,GACA,SAASF,EAAE,EAAG,EAAG,CACf,GAAI,CAACE,EAAE,EAAG,CAAC,EAAG,CACZ,IAAM,EAAI,EAAE,aACZ,EAAI,EAAE,KAAK,CAAC,EAAI,EAAE,aAAe,CAAC,CAAC,CACrC,CACF,CACA,SAASA,EAAE,EAAG,EAAG,CACf,MAAO,CAAC,CAAC,EAAE,cAAc,SAAS,CAAC,CACrC,CACA,SAASI,EAAE,EAAG,CACZ,OAAOJ,EAAE,EAAGK,EAAE,cAAc,CAC9B,CACA,SAASC,EAAE,EAAG,EAAG,CACf,IAAM,EAAI,EAAE,aACZ,GAAI,EAAG,CACL,IAAMC,EAAI,EAAE,QAAQ,CAAC,EACrBA,EAAI,IAAM,EAAE,OAAOA,EAAG,CAAC,CACzB,CACF,CACA,SAASC,EAAE,EAAG,EAAG,EAAG,CAClB,EAAIV,EAAE,EAAG,CAAC,EAAIQ,EAAE,EAAG,CAAC,CACtB,CACA,SAAeG,EAAE,EAAG,QAAAZ,EAAA,sBAClB,IAAM,EAAI,EAAE,MAAM,EAAE,UAAU,EAC1B,EACJ,GAAI,EAAE,OAAS,EAAG,QAAWa,KAAK,EAAG,EAAIA,EAAE,MAAQ,EAAE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