@arcgis/portal-components 5.2.0-next.110 → 5.2.0-next.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{AKOYP2S2.js → 2GBRZSEC.js} +1 -1
- package/dist/cdn/{QDT553FU.js → 2M7ICZ55.js} +2 -2
- package/dist/cdn/2PAD5NQT.js +66 -0
- package/dist/cdn/{26PMKN4T.js → 2QCYQYNA.js} +2 -2
- package/dist/cdn/2RPQKCIL.js +2 -0
- package/dist/cdn/{5KWLV7W7.js → 2RWCT4ED.js} +2 -2
- package/dist/cdn/{2GE7J7JB.js → 2Z5BVWD4.js} +2 -2
- package/dist/cdn/{V5QDJGF5.js → 3BCVFBV7.js} +2 -2
- package/dist/cdn/{3RKZZT32.js → 3JNQUJZL.js} +2 -2
- package/dist/cdn/{B43IHRNR.js → 3OBIA66A.js} +2 -2
- package/dist/cdn/3R4I7T7Y.js +2 -0
- package/dist/cdn/4N5OKWHT.js +2 -0
- package/dist/cdn/{XU6YAW25.js → 4PPXBKIJ.js} +1 -1
- package/dist/cdn/{DMMJSQBU.js → 4QA4AYHJ.js} +2 -2
- package/dist/cdn/{DVAHYUGM.js → 4RPNBHB5.js} +1 -1
- package/dist/cdn/{N754VOKR.js → 55FL7WQV.js} +2 -2
- package/dist/cdn/{LJ5JK3LJ.js → 5SRRBZNT.js} +2 -2
- package/dist/cdn/{KBZ5UAEH.js → 63THOLAY.js} +2 -2
- package/dist/cdn/{AO3MSYBG.js → 645GY5SX.js} +2 -2
- package/dist/cdn/6KVA4AKM.js +2 -0
- package/dist/cdn/6PRXL6A7.js +2 -0
- package/dist/cdn/{Z3UWZNMT.js → 6TO2BYXU.js} +1 -1
- package/dist/cdn/{DFDF7VMD.js → 6Z2AEG54.js} +2 -2
- package/dist/cdn/{Z5EGMQ5Z.js → 7T744GFJ.js} +2 -2
- package/dist/cdn/{QNZK3K3Z.js → 7Y2OBOEM.js} +2 -2
- package/dist/cdn/A6YWV3MB.js +2 -0
- package/dist/cdn/ACCEI7S4.js +2 -0
- package/dist/cdn/AEG3QAZ2.js +2 -0
- package/dist/cdn/{YBLTWPA6.js → AMBLICID.js} +2 -2
- package/dist/cdn/{5LWGILD4.js → AVHHDYZX.js} +2 -2
- package/dist/cdn/{SNE7CP22.js → AVNFYSR4.js} +2 -2
- package/dist/cdn/AVU5RFRK.js +2 -0
- package/dist/cdn/{7RZQCGMR.js → BADETB57.js} +1 -1
- package/dist/cdn/{OIC2QJ56.js → BCYZTGDC.js} +2 -2
- package/dist/cdn/BJA2P3AN.js +2 -0
- package/dist/cdn/{MFAURWL2.js → BKACWDST.js} +2 -2
- package/dist/cdn/{JSLBS5LJ.js → BLCWXWUR.js} +2 -2
- package/dist/cdn/BTGSJRJK.js +2 -0
- package/dist/cdn/{YMR465MB.js → BXDQIHOS.js} +2 -2
- package/dist/cdn/{UG672UNT.js → BY6ZY3C4.js} +2 -2
- package/dist/cdn/C7FIYNJZ.js +2 -0
- package/dist/cdn/{XP6IQNXR.js → C7ZFXRPS.js} +2 -2
- package/dist/cdn/{XSBYBPZD.js → CFBSBZSS.js} +1 -1
- package/dist/cdn/{B5LD2ENG.js → CFLKHGTI.js} +2 -2
- package/dist/cdn/{5X2LQR52.js → CGX6YKBP.js} +2 -2
- package/dist/cdn/CI7ELLP3.js +2 -0
- package/dist/cdn/{ORZLJRHF.js → CVOWIH4J.js} +2 -2
- package/dist/cdn/{PX77OS7W.js → DFTUMKSN.js} +1 -1
- package/dist/cdn/{4EC4CBVI.js → DG6DAKQ2.js} +5 -5
- package/dist/cdn/{PYWM5FEU.js → DKWAWI4G.js} +2 -2
- package/dist/cdn/{KTSWRHCV.js → DOLCL4IJ.js} +2 -2
- package/dist/cdn/{DWTR4VUK.js → DWHJ45FR.js} +2 -2
- package/dist/cdn/E3WSTTT5.js +2 -0
- package/dist/cdn/{D7FPM6PI.js → EHQVLI6M.js} +2 -2
- package/dist/cdn/ETDGPTQW.js +2 -0
- package/dist/cdn/{HWKLTJZ2.js → F3ODJVJC.js} +1 -1
- package/dist/cdn/{Q5E2DMYV.js → FJSGWELR.js} +2 -2
- package/dist/cdn/FWRSYP3I.js +2 -0
- package/dist/cdn/{KI7CEMT2.js → FXGAQXNR.js} +2 -2
- package/dist/cdn/{QSGSEQYF.js → G2CJ5PLI.js} +2 -2
- package/dist/cdn/{2ET5YZKX.js → GBYHBRUW.js} +2 -2
- package/dist/cdn/{LMAACAQ4.js → GC7KNL7Y.js} +58 -58
- package/dist/cdn/{J5CY2C46.js → GUTV5BR3.js} +2 -2
- package/dist/cdn/GXQMTKYF.js +2 -0
- package/dist/cdn/{QAR5RRQS.js → H6QY5OJL.js} +2 -2
- package/dist/cdn/{CWUG2C3Y.js → HLZECIZI.js} +2 -2
- package/dist/cdn/{2UTHLA57.js → HWPV6BAO.js} +2 -2
- package/dist/cdn/{URV44SV4.js → IGZ7A7S3.js} +2 -2
- package/dist/cdn/{6MGLQFUE.js → IJ3CLFAU.js} +2 -2
- package/dist/cdn/{SM6CKNC7.js → ILDTKRON.js} +1 -1
- package/dist/cdn/{WHMK5MXH.js → INPDIPW5.js} +2 -2
- package/dist/cdn/{PZXVOCAF.js → JADQNA27.js} +2 -2
- package/dist/cdn/{O7OKVMWB.js → KCJDG4OE.js} +2 -2
- package/dist/cdn/{AG5VHX6A.js → KL6LCRES.js} +2 -2
- package/dist/cdn/{D4C6O7OG.js → KNRJ3WXR.js} +2 -2
- package/dist/cdn/KXSBIXYI.js +2 -0
- package/dist/cdn/{N23TPKII.js → KYNL256E.js} +2 -2
- package/dist/cdn/{CW26LYUS.js → L6KBBJEC.js} +2 -2
- package/dist/cdn/LD2SO7MK.js +2 -0
- package/dist/cdn/{P3LTM2WD.js → LDTVM22U.js} +2 -2
- package/dist/cdn/{ISZOOEPD.js → LLRHHAXZ.js} +2 -2
- package/dist/cdn/{4VBT4LRL.js → M5GKRRB3.js} +2 -2
- package/dist/cdn/{7FECNH76.js → M6EVMQYT.js} +2 -2
- package/dist/cdn/MA5HWGFW.js +2 -0
- package/dist/cdn/ML2ETZQ5.js +2 -0
- package/dist/cdn/{DVHYYANM.js → MT4QAG2X.js} +2 -2
- package/dist/cdn/{5KUUEBNE.js → MTJN3KRM.js} +2 -2
- package/dist/cdn/{MLJBM2BZ.js → NDUVVGGB.js} +2 -2
- package/dist/cdn/NMMQRFHX.js +2 -0
- package/dist/cdn/{X6VOQTMG.js → NQQLTGIK.js} +2 -2
- package/dist/cdn/{TRKN5BVY.js → OAVKM5RX.js} +2 -2
- package/dist/cdn/{GK3M3FL5.js → OBBYT2AV.js} +2 -2
- package/dist/cdn/{NJMFVYYB.js → OEMNHYK6.js} +2 -2
- package/dist/cdn/{UDIW5U7E.js → OHYDYQVF.js} +2 -2
- package/dist/cdn/{N4EGGSII.js → OT4PZJNB.js} +2 -2
- package/dist/cdn/{EX72BIVK.js → OTLSI3AA.js} +2 -2
- package/dist/cdn/{ZD6RA6K2.js → OUFIJDIW.js} +2 -2
- package/dist/cdn/{3DNUVGE3.js → PAFEMDUL.js} +2 -2
- package/dist/cdn/PBWAZUZ4.js +2 -0
- package/dist/cdn/{5VBIARBL.js → PH4LUNY2.js} +2 -2
- package/dist/cdn/{QM4KEAMM.js → PLVQ3AZ4.js} +2 -2
- package/dist/cdn/{CNP5RND7.js → PQ75545K.js} +1 -1
- package/dist/cdn/{RTLQKGJF.js → Q75EBGI2.js} +1 -1
- package/dist/cdn/{ZK3PPCGU.js → QE4CNVDQ.js} +2 -2
- package/dist/cdn/{PTJJ6SQU.js → QKCV7CY2.js} +2 -2
- package/dist/cdn/{JFS5UBJT.js → QNFTJR2M.js} +2 -2
- package/dist/cdn/{P4E7SHXA.js → QS3GXAIH.js} +1 -1
- package/dist/cdn/{Z4FXF5FS.js → QUP4L3ZJ.js} +2 -2
- package/dist/cdn/{UTAEP4HN.js → R2D2KBV7.js} +2 -2
- package/dist/cdn/{RFGDI5TB.js → RBGARTND.js} +2 -2
- package/dist/cdn/{3MO6M3VO.js → RJR5FQIQ.js} +2 -2
- package/dist/cdn/RTWFHVRS.js +2 -0
- package/dist/cdn/{WOH3HMMR.js → RZV3CS2K.js} +1 -1
- package/dist/cdn/{GSM7PUVG.js → S2BGAMSA.js} +1 -1
- package/dist/cdn/{JUWVKK6D.js → S7IRYX4A.js} +2 -2
- package/dist/cdn/{D3YDSEJP.js → SHWP2FT2.js} +2 -2
- package/dist/cdn/{CBBMJRB2.js → SLTFLCVR.js} +2 -2
- package/dist/cdn/{6QQ5KDOW.js → SMGYUJIK.js} +2 -2
- package/dist/cdn/{MAMZSTEX.js → T3BCFS2M.js} +2 -2
- package/dist/cdn/{5LI7CT3K.js → T3LU5V74.js} +2 -2
- package/dist/cdn/{JCQ2GYVT.js → TFCRFHRE.js} +2 -2
- package/dist/cdn/{MQ66GXGD.js → TKCE4WYE.js} +2 -2
- package/dist/cdn/TZA2KIST.js +695 -0
- package/dist/cdn/U63EBRGM.js +2 -0
- package/dist/cdn/{G7LWAQ54.js → UIPDNLVK.js} +2 -2
- package/dist/cdn/UWYKXVBV.js +2 -0
- package/dist/cdn/{I6MWUNED.js → UZCHLKLO.js} +1 -1
- package/dist/cdn/{BVUCNXC5.js → UZLQALHY.js} +1 -1
- package/dist/cdn/{U5MRF5KB.js → V4EYW3O6.js} +2 -2
- package/dist/cdn/VENYHN3O.js +2 -0
- package/dist/cdn/{PLYL7A7J.js → VHNV45FQ.js} +2 -2
- package/dist/cdn/{43ILIBJ6.js → VJ4STLVD.js} +2 -2
- package/dist/cdn/VJON6KGX.js +2 -0
- package/dist/cdn/{4TZNEXFP.js → VKYMORWN.js} +2 -2
- package/dist/cdn/VLLPYVQB.js +2 -0
- package/dist/cdn/{QW5RUJ2Z.js → VMQIDO4Z.js} +2 -2
- package/dist/cdn/{YNJQQKQY.js → VQKLCN3V.js} +2 -2
- package/dist/cdn/{7AOZCH5A.js → VW7DSKPH.js} +2 -2
- package/dist/cdn/{VUV3KYCJ.js → W2SYL7IJ.js} +2 -2
- package/dist/cdn/W47ZH7KA.js +2 -0
- package/dist/cdn/{A6M3XZV5.js → W4FGRGLV.js} +2 -2
- package/dist/cdn/{R4FL6CWB.js → W4GBRVNN.js} +2 -2
- package/dist/cdn/{GCJWACTP.js → W4SAWMXS.js} +2 -2
- package/dist/cdn/W6HDPBAV.js +2 -0
- package/dist/cdn/{3J3VSEPH.js → WBZLQZYR.js} +2 -2
- package/dist/cdn/WFTFIAEX.js +2 -0
- package/dist/cdn/{4IN5LFTZ.js → WMV67HW3.js} +2 -2
- package/dist/cdn/{KFCWPHBZ.js → X3WXFI25.js} +2 -2
- package/dist/cdn/X4RLE42T.js +2 -0
- package/dist/cdn/{E4NVOXNZ.js → XEK22IDA.js} +1 -1
- package/dist/cdn/{KFWAYTFR.js → YA32NOJY.js} +2 -2
- package/dist/cdn/{KR6HK726.js → YFT47SCG.js} +2 -2
- package/dist/cdn/{3OHHN4IB.js → YQHVXBGD.js} +2 -2
- package/dist/cdn/{WIFEG6XT.js → YVKSTDL6.js} +1 -1
- package/dist/cdn/{HFIWGXUK.js → ZI3JA3SL.js} +2 -2
- package/dist/cdn/{HOTF45KM.js → ZJ7GT4N2.js} +2 -2
- package/dist/cdn/ZMWOCZ6I.js +2 -0
- package/dist/cdn/{YMZMBR6L.js → ZRPFJQP2.js} +2 -2
- package/dist/cdn/{F4RM3CSR.js → ZWDOT3HF.js} +2 -2
- package/dist/cdn/assets/portal-sublayer-type/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/common.js +1 -1
- package/dist/chunks/dom.js +1 -1
- package/dist/chunks/fieldAddDelete.js +1 -1
- package/dist/chunks/functionalities.js +1 -1
- package/dist/chunks/groups.js +1 -1
- package/dist/chunks/groups2.js +1 -1
- package/dist/chunks/icons.js +1 -1
- package/dist/chunks/info.js +1 -1
- package/dist/chunks/item.js +1 -1
- package/dist/chunks/item2.js +1 -1
- package/dist/chunks/items.js +1 -1
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/portal-account-switcher.js +1 -1
- package/dist/chunks/portal-browser-filter-date.js +1 -1
- package/dist/chunks/portal-browser.js +1 -1
- package/dist/chunks/portal-item-badge.js +1 -1
- package/dist/chunks/portal.js +1 -1
- package/dist/chunks/portal2.js +1 -1
- package/dist/chunks/query.js +1 -1
- package/dist/chunks/request.js +1 -1
- package/dist/chunks/requests.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/services.js +1 -1
- package/dist/chunks/store.js +1 -1
- package/dist/chunks/string.js +1 -1
- package/dist/chunks/thumbnail.js +1 -1
- package/dist/chunks/ui.js +1 -1
- package/dist/chunks/url.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/user.js +1 -1
- package/dist/chunks/user2.js +1 -1
- package/dist/chunks/users.js +1 -1
- package/dist/chunks/utils.js +1 -1
- package/dist/chunks/utils2.js +1 -1
- package/dist/chunks/verified.js +1 -1
- package/dist/components/arcgis-portal-account-switcher/customElement.js +1 -1
- package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +1 -1
- package/dist/components/arcgis-portal-account-switcher-list/customElement.js +1 -1
- package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +1 -1
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +1 -1
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser-actions/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser-filter-status/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser-pagination/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser-search/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser-sort/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser-top-bar/customElement.js +1 -1
- package/dist/components/arcgis-portal-browser-view/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
- package/dist/components/arcgis-portal-extent-picker/customElement.js +1 -1
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
- package/dist/components/arcgis-portal-field-delete/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-badges/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-browser/customElement.js +79 -65
- package/dist/components/arcgis-portal-group-browser-card/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-browser-preview/customElement.js +2 -2
- package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-card/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
- package/dist/components/arcgis-portal-info-banner/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-actions/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-badge/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-badges/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-card/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
- package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +1 -1
- package/dist/components/arcgis-portal-navigation/customElement.js +38 -29
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +1 -1
- package/dist/components/arcgis-portal-sublayer-type/customElement.d.ts +76 -0
- package/dist/components/arcgis-portal-sublayer-type/customElement.js +121 -0
- package/dist/components/arcgis-portal-sublayer-type/index.d.ts +1 -0
- package/dist/components/arcgis-portal-sublayer-type/index.js +2 -0
- package/dist/components/arcgis-portal-sublayer-type/utils.d.ts +30 -0
- package/dist/components/arcgis-portal-user-avatar/customElement.js +1 -1
- package/dist/components/arcgis-portal-user-popup/customElement.js +1 -1
- package/dist/components/arcgis-portal-voice-input/customElement.js +1 -1
- package/dist/components/portal-browser/components/portal-browser-filter/customElement.js +1 -1
- package/dist/components/portal-browser/components/portal-browser-filter-date/customElement.js +1 -1
- package/dist/components/portal-browser/components/portal-browser-filters/customElement.js +1 -1
- package/dist/components/portal-group-browser-filters/customElement.js +1 -1
- package/dist/components/portal-group-browser-pagination/customElement.js +1 -1
- package/dist/components/portal-group-browser-sort/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/loader.js +2 -1
- package/dist/types/geometry.d.ts +8 -0
- package/dist/types/item.d.ts +6 -6
- package/dist/types/lumina.d.ts +5 -0
- package/dist/types/preact.d.ts +6 -0
- package/dist/types/react.d.ts +7 -0
- package/dist/types/stencil.d.ts +5 -0
- package/package.json +9 -9
- package/dist/cdn/23NPOBZL.js +0 -2
- package/dist/cdn/5MB7TCAR.js +0 -2
- package/dist/cdn/6IFFQ6IX.js +0 -689
- package/dist/cdn/6J76KUV6.js +0 -2
- package/dist/cdn/7JQPAKEK.js +0 -2
- package/dist/cdn/A4R6JMAE.js +0 -2
- package/dist/cdn/A6JP4IPN.js +0 -2
- package/dist/cdn/AL7WAZ57.js +0 -2
- package/dist/cdn/BYIJRDXC.js +0 -2
- package/dist/cdn/CDSFZOTX.js +0 -2
- package/dist/cdn/D2AV54QA.js +0 -2
- package/dist/cdn/D5GNVZNC.js +0 -2
- package/dist/cdn/DFVEASA2.js +0 -2
- package/dist/cdn/FLV2GH2N.js +0 -2
- package/dist/cdn/FQAA4I36.js +0 -2
- package/dist/cdn/G25LKIUC.js +0 -2
- package/dist/cdn/GZH5ORHA.js +0 -2
- package/dist/cdn/HZICKYZU.js +0 -2
- package/dist/cdn/I3HL7N3J.js +0 -2
- package/dist/cdn/JJ2XKGTD.js +0 -2
- package/dist/cdn/JMRQWMUN.js +0 -2
- package/dist/cdn/JTG655DG.js +0 -2
- package/dist/cdn/KXFXARDF.js +0 -2
- package/dist/cdn/LK3LUAA7.js +0 -2
- package/dist/cdn/LO5EMUCP.js +0 -2
- package/dist/cdn/N4C6VG53.js +0 -2
- package/dist/cdn/N4IRX5VR.js +0 -2
- package/dist/cdn/PCSVOKQE.js +0 -2
- package/dist/cdn/QWMTQV3K.js +0 -2
- package/dist/cdn/TOJOSZ2F.js +0 -2
- package/dist/cdn/ULTLYUY2.js +0 -2
- package/dist/cdn/XLUBLY73.js +0 -2
- package/dist/cdn/Y5SIYNRO.js +0 -66
- package/dist/cdn/YMECQNUT.js +0 -2
- package/dist/cdn/YTWB6O3G.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as s}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as s}from"./VMQIDO4Z.js";export default $arcgis.t(([a])=>{async function c(t,o={}){return await t.queryGroups(o)}async function l(t,o){let e=o.title.trim();if(!e)return{error:{code:"unhandledError",message:"Group title is required."}};try{let{data:r}=await a(`${s(t)}community/createGroup`,{method:"post",responseType:"json",query:{f:"json",...o,title:e}});return!r.success||!r.group?.id?{error:{code:"unhandledError",message:"Unable to create a group with the provided title."}}:{result:{id:r.group.id,title:r.group.title||e}}}catch(r){return console.error("Error creating portal group:",r),{error:{code:"unhandledError",message:r.details.messages.join(",")}}}}async function p(t,o,e){if(!e.length)return{error:{code:"unhandledError",message:"At least one username is required."}};try{let{data:r}=await a(`${s(t)}community/groups/${o}/addUsers`,{method:"post",responseType:"json",query:{f:"json",users:e.join(",")}}),n=r.notAdded;return{result:{addedUsernames:n?.length?e.filter(d=>!n.includes(d)):e,notAddedUsers:r.notAddedDetails}}}catch(r){return console.error("Error adding users to portal group:",r),{error:{code:"unhandledError"}}}}return{a:c,b:l,c:p}},"request")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import b from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import b from"./RZV3CS2K.js";import{a as t}from"./BADETB57.js";import{a as l}from"./S2BGAMSA.js";import{a}from"./FWRSYP3I.js";import{Ic as d}from"./DG6DAKQ2.js";import"./UZLQALHY.js";export default $arcgis.t(([o])=>{var g=.7,b=10;async function S(i){let{query:e,layerIds:s,includeSummaryStatistics:r=!1,fieldSearch:c,layersAndFieldsRegistry:m,embeddingCache:y,mapView:u,minScore:f=g,topResults:h=b}=i,n=await c.searchFields({text:e,layerIds:s,minScore:f,topResults:h,embeddingCache:y}),p=await o(n,m,u,r);return{matches:n,...p}}var v=a.object({query:a.string().describe("A concise semantic description of the fields relevant to the user's task."),layerIds:a.array(a.string()).min(1).describe("Layer IDs returned by findRelevantLayers, restricted to layers relevant to the current task."),includeSummaryStatistics:a.boolean().optional().default(!1).describe("Set to true only when the task directly asks for numeric summaries such as average, minimum, maximum, total, variance, or range.")});async function w(i,e){let{mapView:s}=l(e,["mapView"]),r=await S({...i,fieldSearch:t(e,"fieldSearch"),layersAndFieldsRegistry:t(e,"layersAndFieldsRegistry"),embeddingCache:t(e,"embeddingCache"),mapView:s});return JSON.stringify(r,null,2)}var A=d(w,{name:"findRelevantFields",description:"Finds relevant fields within candidate layers. Returns ranked matches, field metadata, categorical values, and optional numeric summary statistics. Call findRelevantLayers first when layer IDs are not already known.",schema:v});return A},b)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import"./UZLQALHY.js";var e=`## Navigation Agent - Tool Intent Classifier
|
|
3
3
|
|
|
4
4
|
You are an assistant that classifies the assigned task intent for navigation agent.
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as r}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as r}from"./FWRSYP3I.js";export default $arcgis.t(([p,l])=>{var m=["feet","kilometers","meters","miles","nautical-miles","us-nautical-miles"],u=r.enum(m);var f=750;function y(e){return"point"in e&&e.point!==void 0}function h(e){return"layerId"in e&&e.layerId!==void 0}var $=async(e,a)=>{if(y(e)){let{point:t}=e;return{geometry:new p({x:t.x,y:t.y,spatialReference:t.spatialReference?{wkid:t.spatialReference.wkid}:a.spatialReference})}}if(h(e)){let t=a.map?.allLayers.find(o=>o.id===e.layerId);if(!t)return{error:`Could not find geometry layer with ID: ${e.layerId}`};let i=t.title??t.id,n=e.where?.trim()||"1=1";try{let o=await t.queryFeatures({where:n,returnGeometry:!0,outSpatialReference:a.spatialReference,num:f+1});if(!o.features.length)return{error:`No features found in geometry layer "${i}" with the specified where clause: ${n}`};if(o.features.length>f)return{error:`Geometry filter for layer "${i}" matched too many features (${o.features.length}+). Please narrow the geometry layer filter.`};let s=o.features.map(d=>d.geometry).filter(d=>!!d);if(!s.length)return{error:"No valid geometries found for the matched geometry layer features."};let c=s.length===1?s[0]:l.executeMany(s);return c?(c.spatialReference||(c.spatialReference=a.spatialReference),{geometry:c}):{error:"Failed to combine geometries from geometry layer."}}catch(o){return{error:`Failed to query geometry: ${String(o)}`}}}return{error:"Invalid geometry configuration provided"}},g=r.object({id:r.string()}),b=r.object({id:r.string(),kind:r.literal("point"),payload:r.object({x:r.number(),y:r.number(),spatialReference:r.object({wkid:r.number()}).optional()})}),x=r.object({sharedResourceId:r.string().describe("ID of a point returned by listSharedResources for a previously geocoded address or place."),distance:r.number().optional().describe("Optional buffer distance around the point."),units:u.optional().describe("The units for the distance buffer.")}),j=(e,a)=>{if(!e||!("sharedResourceId"in e))return e;if(!a)throw new Error("Shared resources are unavailable in the tool runtime state.");let t=a.find(n=>{let o=g.safeParse(n);return o.success&&o.data.id===e.sharedResourceId});if(!t)throw new Error(`Shared resource not found: ${e.sharedResourceId}`);let i=b.safeParse(t);if(!i.success)throw new Error(`Shared resource ${e.sharedResourceId} does not contain a valid point.`);return{point:i.data.payload,distance:e.distance,units:e.units}};return{a:u,b:y,c:h,d:$,e:x,f:j}},"geometry/Point","geometry/operators/unionOperator")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
var t=["360 VR Experience","Big Data Analytic","Dashboard","Data Pipeline","Deep Learning Studio Project","Discussion","Document Link","Excalibur Imagery Project","Feature Collection","Feature Service","Feed","Form","GeoBIM Application","GeoBIM Project","Hub Event","Hub Initiative","Hub Initiative Template","Hub Page","Hub Project","Image Service","Knowledge Graph","Knowledge Studio Project","Map Service","Map Showcase","Mission Report","Mission Template","Notebook","OGCFeatureServer","Ortho Mapping Project","Parquet Feature Layer","Real Time Analytic","Route Layer","Scene Service","Solution","StoryMap","StoryMap Theme","Tile Layer","Urban Model","Urban Project","Vector Tile Service","Video Service","Web Experience","Web Experience Template","Web Map","Web Mapping Application","Web Scene","WFS","Workflow"],n=["3DInsetMap","3DScene","3DViz","AttachmentViewer","CapacityAnalysis","Cascade","Compare","Compare/Configure","Compare/Multiviewer","Compare/Search","Compare/SideBySideViewer_Configure","Compare/storytelling_compare","Compare/storytelling_sidepanel","Compare/storytelling_tabbed","Compare3d","CompareAnalysis","CompareMaps","CrowdsourceManager","CrowdsourcePolling","CrowdsourceReporter","Directions","Edit","Editor","Elevations","ElevationsProfile","Embed","Filter","FilterGallery","GeoForm","GeoList","GeoTour","HeaderFooter","Identify","ImageInterpretation","ImageMask","ImageVisit","ImageryViewer","ImpactSummary","InformationLookup","InteractiveFilter","InteractiveLegend","LayerShowcase","Legend","LiveMaps","LocalPerspective","MapAndAppGallery","MapCarousel","MapJournal","MapSeries","Shortlist","MapTools","MapTour","Media","MinimalGallery","Minimalist","MobileViewer","Nearby","OnePane","Panels","PanelsLegend","Profile","PublicGallery","PublicInformation","ServiceLookup","SimpleMapViewer","SimpleViewer","SocialMedia","Solutions/s2.html?app=apps2/FindEditFilter","Solutions/s2.html?app=apps2/Finder","Solutions/s2.html","StoryMapBasic","StorytellingSwipe","StorytellingTextLegend","Styler","SummaryViewer","Time","TimeAware","TwoPane","View","Viewer","ZoneLookup"],s=e=>{if(!e)return!1;let r=n.some(o=>{let a=o.includes(".html"),i=`/apps/${o}${a?"":"/"}`;return decodeURIComponent(e.url)?.includes(i)});return e.type==="Web Mapping Application"&&!!e.url&&r};function c(e){let r=["Cascade","MapTour","MapJournal","MapSeries","Shortlist","StoryMapCrowdsource","SwipeSpyglass","Story Map"];return e.type==="Web Mapping Application"&&(l(r,e)||p(e))}function p(e){return["Cascade","MapTour","MapJournal","MapSeries","Shortlist","StoryMapCrowdsource","StorytellingSwipe"].some(r=>{let o=`/apps/${r}/index.html`;return decodeURIComponent(e.url)?.includes(o)})}function l(e,r){return e?.some(o=>r?.typeKeywords?.includes(o))}function u(e){return!!e&&t.some(r=>e.type===r)}export{s as a,c as b,u as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as n}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as n}from"./S2BGAMSA.js";import{a as i}from"./FWRSYP3I.js";import{Ic as o}from"./DG6DAKQ2.js";async function a(e){let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;if(t)await e.goTo(t);else throw new Error("Initial extent is undefined");return{text:"Successfully zoomed to home extent"}}async function m(e,t){let{mapView:r}=n(t,["mapView"]);return await a(r)}var s=i.object({}),f=o(m,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:s});export{f as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as r}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as r}from"./BADETB57.js";import{a as s}from"./FWRSYP3I.js";import{Ic as o}from"./DG6DAKQ2.js";import"./UZLQALHY.js";var m=.7;async function h(a){let{query:e,layerSearch:t,layersAndFieldsRegistry:c,embeddingCache:l,minScore:d=m}=a;return(await t.searchLayers({text:e,minScore:d,embeddingCache:l})).map(({id:i,score:y})=>{let n=c.get(i)?.layerItem;return{layerId:i,score:y,name:n?.name??void 0,title:n?.title,description:n?.description}})}var f=s.object({query:s.string().describe("A concise semantic description of the layers relevant to the user's task.")});async function u({query:a},e){let t=await h({query:a,layerSearch:r(e,"layerSearch"),layersAndFieldsRegistry:r(e,"layersAndFieldsRegistry"),embeddingCache:r(e,"embeddingCache")});return JSON.stringify({layers:t},null,2)}var S=o(u,{name:"findRelevantLayers",description:"Finds map layers relevant to a task and returns their layer IDs, similarity scores, names, titles, and descriptions. Call this before finding fields or querying data when layer IDs are not already known.",schema:f});export{S as findRelevantLayersTool};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import b from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import b from"./4RPNBHB5.js";import{a as x,b as O}from"./PQ75545K.js";import a from"./645GY5SX.js";import{a as L}from"./S2BGAMSA.js";import{a as e}from"./FWRSYP3I.js";import{Ic as T}from"./DG6DAKQ2.js";export default $arcgis.t(([{a:p,b:g,c:b,d:v,e:R,f:j},{c:N}])=>{var w=25,k=i=>i.flatMap(r=>r.split(",")).map(r=>r.trim()).map(r=>r.split(/\s+/u)[0]?.replace(/^"|"$/gu,"")).filter(r=>!!r),E=async(i,r,t,l)=>{let s=r.map?.allLayers.find(u=>u.id===i.layerId),d=await r.whenLayerView(s),f=s.title??i.layerId,h;if(t){let u=await v(t,r);if("error"in u){let o={error:u.error};if(b(t)){let c=r.map?.allLayers.find(m=>m.id===t.layerId);o.geometryLayerName=c?.title??c?.id,o.geometryLayerId=t.layerId,o.geometryWhere=t.where}else g(t)&&(o.point=t.point);return{tool:"queryFeatures",layerName:f,summary:"Geometry lookup failed",details:o}}if(!u.geometry){let o={};if(b(t)){let c=r.map?.allLayers.find(m=>m.id===t.layerId);o.error=`No features found matching: ${t.where}`,o.geometryLayerName=c?.title??c?.id,o.geometryLayerId=t.layerId,o.geometryWhere=t.where}else g(t)&&(o.error="Failed to create point geometry",o.point=t.point);return{tool:"queryFeatures",layerName:f,summary:"No features found for geometry filter",details:o}}h=u.geometry}else l&&(h=r.extent.clone());let C=[...new Set([...i.outFields,...k(i.orderByFields)])],F=x(d,C,l??!1),I=s.objectIdField,a=s.createQuery();a.where=O(s.definitionExpression,i.where||"1=1"),a.outFields=i.outFields.includes("*")?["*"]:[...new Set([...i.outFields,I])],a.orderByFields=i.orderByFields,h&&(a.geometry=h,a.spatialRelationship="intersects"),t?.distance&&(a.distance=t.distance),t?.units&&(a.units=t.units),a.outSpatialReference=r.spatialReference;let n,y;try{n=F?await d.queryFeatureCount(a):await s.queryFeatureCount(a),n>0&&n<=w&&(y=F?await d.queryFeatures(a):await s.queryFeatures(a))}catch(u){console.warn("Client-side query failed, falling back to server:",u),n=await s.queryFeatureCount(a),n>0&&n<=w&&(y=await s.queryFeatures(a))}let{objectIds:q,attributes:S}=y?N(s,y,r.timeZone):{objectIds:void 0,attributes:void 0};return{tool:"queryFeatures",layerName:f,summary:`${n} features found`,details:{totalCount:n,where:i.where,orderByFields:i.orderByFields,outFields:i.outFields,...q&&{objectIds:q,objectIdField:I},...S&&{attributes:S},...n>w&&{note:`${n} features found.`}}}};async function W({targetLayer:i,geometryFilter:r,useCurrentExtent:t},l){let{mapView:s}=L(l,["mapView"]),d=j(r,l.state?.agentExecutionContext?.sharedResources),f=await E(i,s,d,t);return JSON.stringify(f,null,2)}var B=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:p.optional().describe("The units for the distance buffer.")}),U=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:e.number().optional().describe("Optional buffer distance around the point."),units:p.optional().describe("The units for the distance buffer.")}),D=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer containing the field from which to get a value."),where:e.string().describe("SQL-92 where clause. IMPORTANT: When using geometryFilter.point or geometryFilter.sharedResourceId for point-in-polygon queries, set this to '1=1' to return all features that intersect the point. Only add attribute filters if the user specifically requests them in addition to the spatial query."),orderByFields:e.array(e.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:e.array(e.string().describe('The fields to include in the output that will be presented to the user. This should include identifying information about the resulting features, like a name or id, along with the values desired in the output. If unsure, choose all fields ("*").').default("*"))}),geometryFilter:e.union([B,U,R]).optional().describe("Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."),useCurrentExtent:e.boolean().optional().describe("Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at', OR when the user refers back to features previously identified using the current extent (e.g. 'these', 'those', 'them', 'the same ones'). Default is false (queries entire layer).")}),H=T(W,{name:"queryFeatures",description:`Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if \u226425 features match.
|
|
3
3
|
|
|
4
4
|
USE THIS TOOL FOR:
|
|
5
5
|
- "Show / display / list features where..." \u2014 finding and listing features
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import e from"./W4GBRVNN.js";import d from"./OEMNHYK6.js";import"./6TO2BYXU.js";import"./6KVA4AKM.js";import"./CFBSBZSS.js";import"./ILDTKRON.js";import"./OBBYT2AV.js";import"./DFTUMKSN.js";import c from"./RBGARTND.js";import b from"./F3ODJVJC.js";import a from"./OUFIJDIW.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import"./2GBRZSEC.js";import"./ACCEI7S4.js";import"./S7IRYX4A.js";import"./VJ4STLVD.js";import"./4PPXBKIJ.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,{b:r}])=>{return r},a,b,c,d,e)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as j}from"./6KVA4AKM.js";import{a as oe,b as xe}from"./4QA4AYHJ.js";import"./SMGYUJIK.js";import n from"./NDUVVGGB.js";import m from"./R2D2KBV7.js";import l from"./CVOWIH4J.js";import"./CFBSBZSS.js";import k from"./T3BCFS2M.js";import"./ILDTKRON.js";import"./LDTVM22U.js";import i from"./MT4QAG2X.js";import h from"./RJR5FQIQ.js";import g from"./HLZECIZI.js";import"./G2CJ5PLI.js";import f from"./OTLSI3AA.js";import{a as D}from"./FJSGWELR.js";import"./OBBYT2AV.js";import e from"./HWPV6BAO.js";import d from"./ZJ7GT4N2.js";import"./UZCHLKLO.js";import"./DFTUMKSN.js";import c from"./RBGARTND.js";import{a as Ge}from"./VQKLCN3V.js";import b from"./F3ODJVJC.js";import"./EHQVLI6M.js";import a from"./OUFIJDIW.js";import{a as Oe}from"./VMQIDO4Z.js";import"./QS3GXAIH.js";import{a as V,c as B}from"./2GBRZSEC.js";import{a as ae}from"./ACCEI7S4.js";import"./S7IRYX4A.js";import"./VJ4STLVD.js";import{M as $e,N as E,P as w,S as Fe,h as ye,j as p,w as S}from"./4PPXBKIJ.js";import"./UZLQALHY.js";export default $arcgis.t(([{substitute:L},ar,{substitute:sr},{watch:or},{substitute:M},{b:Se},,,,{c:Pe},,,,{a:Be,b:_e},,,{a:Ce,b:J,c:K,d:X,e:Y,f:Z}])=>{function _(t){let{action:e,active:r=!1,clearDisabled:s=!1,clearLabel:i="Clear",children:n,expanded:a=!1,heading:l,noPadding:c=!1,onRemove:g,primary:v=!1,setExpanded:f}=t;return v?p`<div class="filter--primary"><div class="filter__header filter__header--primary"><h3 class="filter__title">${l}</h3>${e}</div>${n}</div>`:p`<calcite-accordion-item class="filter__accordion-item" .heading=${l} .expanded=${a} @calciteAccordionItemExpand=${()=>{f?.(!0)}} @calciteAccordionItemCollapse=${()=>{f?.(!1)}}><div slot=actions-end class="filter__actions-slot arcgis-item-browser-filter__actions-slot">${e}${r&&!s&&p`<calcite-button class="clear-button" scale=s kind=neutral appearance=transparent @click=${()=>g?.()}>${i}</calcite-button>`||""}</div><div class=${E({filter__content:!0,"filter__content--padded":!c})}>${n}</div></calcite-accordion-item>`}var I=1440*60*1e3;function $(t){let e=typeof t=="string"?Number.parseInt(t,10):typeof t=="number"?t:(t??new Date).valueOf(),r=new Date(e);return r.setHours(0,0,0,0),r.valueOf()}function x(t){return $(t)+I-1}var le=7*I,Ue=["today","yesterday","last7","last30","never","custom"],tr=(t,e,r)=>{let s=$(),i=x();switch(t){case"yesterday":return[s-I,s-1];case"today":return[s,i];case"last7":return[s-le,i];case"last30":return[s-I*30,i];case"never":return[-1,-1];case"custom":return e&&r?[$(e),x(r)]:null;default:return null}};function Te(t){let{clearLabel:e,end:r,expanded:s,filterDateMessages:i,includeNever:n,onFilter:a,onRemove:l,property:c,range:g,serverProperty:v,setExpanded:f,start:y}=t,q=i.title[c],u=n?Ue:Ue.filter(m=>m!=="never"),C=new Date().toISOString().slice(0,10),b=!!(g&&(g!=="custom"||y&&r)),O=(m,P,F)=>{let U=v??(c==="modified"?"modified":"uploaded"),G=tr(m,P,F),A=m?i[m]:"";a?.({id:c,label:m?sr(i[c],{date:A}):"",value:G?`(${U}:[${G[0]} TO ${G[1]}])`:"",range:m,start:G?new Date(G[0]):void 0,end:G?new Date(G[1]):void 0})};return _({heading:q,expanded:s,setExpanded:f,active:b,clearLabel:e,onRemove:l,children:p`<div><calcite-tree selection-mode=children scale=m @calciteTreeSelect=${m=>{let P=m.target.selectedItems?.[0]?.dataset.range,F=g===P?null:P;if(!F){l?.();return}O(F,y,r)}}>${u.map(m=>p`<calcite-tree-item data-range=${m??w} .selected=${m===g}>${i[m]}</calcite-tree-item>`)}</calcite-tree>${g==="custom"&&p`<calcite-input-date-picker class="custom-date-picker" @calciteInputDatePickerChange=${m=>{let P=m.target.valueAsDate,[F,U]=Array.isArray(P)?P:[];F&&U&&O("custom",F,U)}} scale=s .max=${C} calendars=1 layout=vertical month-style=abbreviated proximity-selection-disabled range .valueAsDate=${y&&r?[new Date($(y)),new Date($(r))]:[]}></calcite-input-date-picker>`||""}</div>`})}var ir=["title","relevance","modified"];function Re(t){let{slot:e="sort",sort:r,formFactor:s,sortField:i,sortOrder:n,onSortFieldChange:a,onSortOrderChange:l}=t;return r.enabled?p`<arcgis-portal-browser-sort slot=${e??w} .options=${r.props?.options??ir} .field=${i} .order=${n} .appearance=${r.props?.appearance??"dropdown"} .showText=${r.props?.showText??s!=="small"} .useDeleted=${r.props?.useDeleted??!1} @arcgisBrowserSortFieldChange=${c=>{a(c.detail)}} @arcgisBrowserSortOrderChange=${c=>{l(c.detail)}}></arcgis-portal-browser-sort>`:p`<slot name=${e??w} slot=${e??w}></slot>`}function ke(t){let{slot:e="pagination",store:r,total:s,start:i,num:n,onPage:a}=t;return p`<slot name=${e??w} slot=${e??w}><arcgis-portal-browser-pagination .store=${r} .total=${s} .start=${i} .num=${n} @arcgisBrowserPage=${l=>{a(l.detail)}}></arcgis-portal-browser-pagination></slot>`}function Ie(t){let{bottom:e,children:r,primary:s,slot:i,store:n,title:a,top:l}=t,c=!!n?.panel||(n?.width??0)<D.sm;return p`<div slot=${i??w} class="filters-shell" .inert=${!!n?.preview}><div class=${E({"filters-shell__top":!0,"filters-shell__top--padded":c})}>${l}</div>${s}${a}<calcite-accordion appearance=transparent icon-type=chevron icon-position=start scale=m>${r}</calcite-accordion>${e}</div>`}function qe(t){let{browserMessages:e,slot:r,filters:s,hasIndoorsSpaces:i,isFilterActive:n,messages:a,portal:l,selectedAccess:c,selectedGroupsByUser:g,selectedMemberOrg:v,selectedMembership:f,selectedOwner:y,selectedSpecialGroup:q,specialGroupOptions:u,store:C,handleRemove:b,handleSelect:O,handleUpsert:m,handleUserFilterChange:P}=t,F=l.isPortal,U=l.user,G=j(U),A=U?.username??"",We=o=>o===A?M(a.groupsByUser.me,{username:o}):o,me=(o,d)=>o==="owner"?d:o==="outsideOrg"&&G?a.owner.someoneElse:o==="inOrg"?a.owner.inOrg:o==="outsideOrg"?a.owner.outsideOrg:d,Q=s.owner,ue=y??Q?.props?.owner??null,H=Q?.props?.username??A,ze=l.id??"",Qe=G?["owner","outsideOrg"]:["owner","inOrg","outsideOrg"],re=s.membership,ge=f??re?.props?.membership??null,He=["org","collaboration","anyOrg"],N=s.memberOrg,we=v??N?.props?.memberOrg??null,Ne=N?.props?.orgId??l.id??"",Ve=["myOrg","anotherOrg"],se=s.specialGroups,fe=q??se?.props?.specialGroup??null,te=s.access,be=c??te?.props?.access??null,je=["public","org","private"],W=s.groupsByUser,ve=W?.props?.usernames??[],Je=W?.props?.selectedUsername??g??ve[0]??A,T=e.filter.clear,R=(o,d)=>{let h=s[o];h&&(h.props={...h.props,expanded:d})},Ke=o=>{if(o.assignedElements({flatten:!0}).length>0){o.setAttribute("data-has-before-filters","true");return}o.removeAttribute("data-has-before-filters")};return Ie({slot:r,store:C,title:p`<div class="filters-title"><h2 class="filters-title__heading">${a.filters.title}</h2><slot name=before-filters @slotchange=${o=>Ke(o.currentTarget)}></slot></div>`,children:p`${!!W?.enabled&&_({heading:a.groupsByUser.title,expanded:!!W?.props?.expanded,setExpanded:o=>R("groupsByUser",o),clearLabel:T,onRemove:()=>{O({kind:"groupsByUser",value:W?.props?.selectedUsername??A})},children:p`<calcite-tree selection-mode=single scale=m @calciteTreeSelect=${o=>{let d=o.target.selectedItems?.[0]?.dataset.username??"";O({kind:"groupsByUser",value:d}),P(d)}}>${ve.map(o=>p`<calcite-tree-item data-username=${o??w} .selected=${o===Je}><a class="groups-by-user__label">${We(o)}</a></calcite-tree-item>`)}</calcite-tree>`})||""}${!!Q?.enabled&&_({heading:a.owner.title,expanded:!!Q?.props?.expanded,setExpanded:o=>R("owner",o),active:n("owner"),clearLabel:T,onRemove:()=>b("owner"),children:p`<calcite-tree selection-mode=single scale=m @calciteTreeSelect=${o=>{let d="owner",h=z(ue,o,d);if(!h){b(d);return}m({id:d,label:M(a.owner.label,{label:me(h,H)}),param:"q",value:J(h,H,{isPublicUser:G,orgId:ze}),owner:h,username:H}),O({kind:d,value:h})}}>${Qe.filter(o=>!(F||i)||o!=="outsideOrg").map(o=>p`<calcite-tree-item data-owner=${o??w} .selected=${ue===o}>${me(o,H)}</calcite-tree-item>`)}</calcite-tree>`})||""}${!!(N?.enabled&&!F)&&_({heading:a.memberOrg.title,expanded:!!N?.props?.expanded,setExpanded:o=>R("memberOrg",o),active:n("memberOrg"),clearLabel:T,onRemove:()=>b("memberOrg"),children:p`<calcite-tree selection-mode=single scale=m @calciteTreeSelect=${o=>{let d="memberOrg",h=z(we,o,d);if(!h){b(d);return}m({id:d,label:M(a.memberOrg.label,{label:a.memberOrg[h]}),param:"q",value:X(h,Ne),memberOrg:h}),O({kind:d,value:h})}}>${Ve.map(o=>p`<calcite-tree-item data-member-org=${o??w} .selected=${we===o}>${a.memberOrg[o]}</calcite-tree-item>`)}</calcite-tree>`})||""}${!!(re?.enabled&&!F&&!i)&&_({heading:a.membership.title,expanded:!!re?.props?.expanded,setExpanded:o=>R("membership",o),active:n("membership"),clearLabel:T,onRemove:()=>b("membership"),children:p`<calcite-tree selection-mode=single scale=m @calciteTreeSelect=${o=>{let d="membership",h=z(ge,o,d);if(!h){b(d);return}m({id:d,label:M(a.membership.label,{label:a.membership[h]}),param:"q",value:K(h,i),membership:h}),O({kind:d,value:h})}}>${He.map(o=>p`<calcite-tree-item data-membership=${o??w} .selected=${ge===o}>${a.membership[o]}</calcite-tree-item>`)}</calcite-tree>`})||""}${se?.enabled&&_({heading:a.specialGroups.title,expanded:!!se.props?.expanded,setExpanded:o=>R("specialGroups",o),active:n("specialGroups"),clearLabel:T,onRemove:()=>b("specialGroups"),children:p`<calcite-tree selection-mode=single scale=m @calciteTreeSelect=${async o=>{let d="specialGroups",h=z(fe,o,d);if(!h){b(d);return}let ie=await Y(h,l);m({id:"specialGroups",label:M(a.specialGroups.label,{label:a.specialGroups[h]}),param:"q",value:ie,specialGroup:h}),O({kind:"specialGroups",value:h})}}>${u.map(o=>p`<calcite-tree-item data-special-groups=${o??w} .selected=${fe===o}><span class="special-groups-settings-option">${a.specialGroups[o]}${o==="settings"&&p`<span class="special-groups-settings-icon"><calcite-icon id=portal-group-browser-special-groups-settings-info icon=information scale=s text-label=Information></calcite-icon><calcite-tooltip placement=bottom-end reference-element=portal-group-browser-special-groups-settings-info>Groups used in organization settings.</calcite-tooltip></span>`||""}</span></calcite-tree-item>`)}</calcite-tree>`})||""}${["modified","created"].filter(o=>s[o]?.enabled).map(o=>{let d=s[o]?.props,h=C.filters[o],ie=!!d?.includeNever,Xe=h?.range??d?.range??null,Ye=h?.start??d?.start,Ze=h?.end??d?.end,er=d?.serverProperty,rr=d?.expanded;return Te({property:o,filterDateMessages:e.filterDate,clearLabel:T,expanded:rr,setExpanded:k=>R(o,k),includeNever:ie,range:Xe,start:Ye,end:Ze,serverProperty:er,onRemove:()=>{m({id:o,label:"",param:"q",value:"",range:null,start:null,end:null})},onFilter:k=>{m({id:o,label:k.label,param:"q",value:k.value,range:k.range,start:k.start,end:k.end})}})})}${!!te?.enabled&&_({heading:a.access.title,expanded:!!te?.props?.expanded,setExpanded:o=>R("access",o),active:n("access"),clearLabel:T,onRemove:()=>b("access"),children:p`<calcite-tree selection-mode=single scale=m @calciteTreeSelect=${o=>{let d="access",h=z(be,o,d);if(!h){b(d);return}m({id:d,label:M(a.access.label,{label:a.access[h]}),param:"q",value:Z(h),access:h}),O({kind:d,value:h})}}>${je.map(o=>p`<calcite-tree-item data-access=${o??w} .selected=${be===o}>${a.access[o]}</calcite-tree-item>`)}</calcite-tree>`})||""}`})}var z=(t,e,r)=>{let s=e.target.selectedItems?.[0]?.dataset[r];return t===s?null:s??null};var Ae={select:"arcgisGroupCardSelect",preview:"arcgisGroupBrowserCardPreview"},lr=ye`:host{position:relative;background-color:var(--calcite-color-background);display:flex;flex-direction:column;height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;--portal-group-browser-max-width: var(--group-browser-max-width, 100%);--portal-group-browser-pane-width: 18.75rem;--portal-group-browser-pane-z-index: 11;container-type:inline-size;container-name:portal-group-browser}arcgis-portal-browser{--arcgis-browser-max-width: var(--portal-group-browser-max-width);--arcgis-browser-pane-width: var(--portal-group-browser-pane-width);--arcgis-browser-pane-z-index: var(--portal-group-browser-pane-z-index)}.filters-title__heading{color:var(--calcite-color-text-1);font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);line-height:1.2;margin:0;padding:1rem .5rem}.filters-title:has(>slot[name=before-filters][data-has-before-filters=true]) .filters-title__heading{border-bottom:1px solid var(--calcite-color-border-2)}.filters-shell{display:block}.filters-shell__top{padding:0}.filters-shell__top--padded{padding:0 1rem 1rem}.filter__accordion-item{--calcite-accordion-item-content-space: .75rem .25rem;--calcite-accordion-icon-margin: .5rem;border-top:1px solid var(--calcite-color-border-1)}.filter__actions-slot{display:flex;align-self:center;align-items:center;line-height:0}.filter__content{margin:0}.filter__content--padded{margin:-.75rem .5rem 0}.filter__content>calcite-tree>calcite-tree-item>a{padding-block:.25rem}.clear-button{line-height:1;margin-inline:.25rem}.custom-date-picker{margin-block:.5rem;margin-inline-start:1.75rem;width:12.75rem}.groups-by-user__label{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.special-groups-settings-option{display:inline-flex;align-items:center;gap:.25rem}.special-groups-settings-icon{display:inline-flex;align-items:center}.group-browser__results{display:grid;gap:.5rem}.group-browser__results--compact{gap:0}.group-browser__result-card{margin:0}@container portal-group-browser (max-width: 640px){arcgis-portal-browser{--portal-group-browser-pane-width: 100%}}.empty-text-slot{width:100%;height:100%;display:flex;justify-content:center}.empty-text-slot__default{@apply max-w-lg mx-auto px-6 pb-16;max-width:32rem;margin-inline:auto;padding-inline:1.5rem;padding-bottom:4rem;margin-top:min(8rem,30vh)}`;async function nr(t,e){let r=`${Oe(t)}community/groups`,s=dr(e),i=hr(e),n=!!e.searchUser?.trim();if(!s.trim()&&!n)return{nextStart:-1,num:0,q:s,queryParams:{...i,q:s},results:[],start:0,total:0};let a={...i,q:s},l=await Se({url:r,portal:t,params:a}),c=l.results.map(g=>{let v=ar.fromJSON(g);return v.portal=t,v});return{...l,q:s,queryParams:a,results:c}}var cr=["created","modified","owner","title"];function pr(t){return!!t&&cr.includes(t)}function dr(t){let e=[],r=t.baseQuery?.trim();r&&e.push(`(${r})`);let s=t.searchTerm?.trim();s&&e.push(`(${xe(s)})`);for(let i of Object.values(t.filters??{}))typeof i.value=="string"&&i.value.trim()&&e.push(`(${i.value.trim()})`),typeof i.additionalParams=="string"&&i.additionalParams.trim()&&e.push(`(${i.additionalParams.trim()})`);return e.join(" AND ")}function hr(t){return{num:t.num,start:t.start,...t.searchUser?{searchUserAccess:"groupMember",searchUserName:t.searchUser}:{},...t.sortField==="relevance"||!pr(t.sortField)?{}:{sortField:t.sortField,sortOrder:t.sortOrder}}}function mr(t,e,r){switch(t){case"yesterday":{let s=$();return[s-I,s-1]}case"today":return[$(),x()];case"last7":return[$()-le,x()];case"last30":return[$()-I*30,x()];case"never":return[-1,-1];case"custom":return e&&r?[$(e),x(r)]:null;default:return V(t)}}var ur=["created","modified","owner","relevance","title"],gr=["asc","desc"],wr=["custom","last7","last30","never","today","yesterday"],fr=["inOrg","outsideOrg","owner"],br=["anyOrg","collaboration","org"],vr=["anotherOrg","myOrg"],yr=["admin","distributed","openData","settings","sharedUpdate"],$r=["org","private","public"],Fr=["access","created","created_from","created_to","memberorgids","membershipaccess","modified","modified_from","modified_to","owner","q","searchTerm","sortField","sortOrder","specialGroups","start","num"];function ee(t){if(!t)return;let e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:void 0}function Ee(t,e){let r=t.get(e);if(!B(wr,r))return;if(r!=="custom")return{range:r};let s=ee(t.get(`${e}_from`)),i=ee(t.get(`${e}_to`));if(!(!s||!i))return{range:r,start:new Date(s),end:new Date(i)}}function De(t,e,r){r?.range&&(t.set(e,r.range),r.range==="custom"&&(r.start&&t.set(`${e}_from`,`${$(r.start)}`),r.end&&t.set(`${e}_to`,`${x(r.end)}`)))}function Le(t){let e=t.get("searchTerm")?.trim()||t.get("q")?.trim()||void 0,r=t.get("sortField"),s=t.get("sortOrder"),i=ee(t.get("start")),n=ee(t.get("num")),a=t.get("access"),l=t.get("memberorgids"),c=t.get("membershipaccess"),g=t.get("owner"),v=t.get("specialGroups"),f=Ee(t,"created"),y=Ee(t,"modified");return{...e?{searchTerm:e}:{},...B(ur,r)?{sortField:r}:{},...B(gr,s)?{sortOrder:s}:{},...i?{start:i}:{},...n?{num:n}:{},filters:{...B($r,a)?{access:a}:{},...f?{created:f}:{},...B(vr,l)?{memberOrg:l}:{},...B(br,c)?{membership:c}:{},...y?{modified:y}:{},...B(fr,g)?{owner:g}:{},...B(yr,v)?{specialGroups:v}:{}}}}function de(t){let e=Le(t),{filters:r,num:s,sortField:i,sortOrder:n,start:a}=e,{access:l,created:c,memberOrg:g,membership:v,modified:f,owner:y,specialGroups:q}=r,u={},C=t.get("searchTerm")?.trim()||void 0,b=t.get("q")?.trim()||void 0;return C&&(u.searchTerm=C),b&&(u.q=b),i&&(u.sortField=i),n&&(u.sortOrder=n),a&&(u.start=a),s&&(u.num=s),l&&(u.access=l),y&&(u.owner=y),v&&(u.membershipAccess=v),g&&(u.memberOrgIds=g),q&&(u.specialGroups=q),c?.range&&(u.created=c.range),c?.start&&(u.createdFrom=c.start.getTime()),c?.end&&(u.createdTo=c.end.getTime()),f?.range&&(u.modified=f.range),f?.start&&(u.modifiedFrom=f.start.getTime()),f?.end&&(u.modifiedTo=f.end.getTime()),u}function Gr(t){let e=new URLSearchParams(t.currentSearchParams);return Fr.forEach(r=>{e.delete(r)}),t.searchTerm?.trim()&&e.set("searchTerm",t.searchTerm.trim()),t.sortField&&e.set("sortField",t.sortField),t.sortOrder&&e.set("sortOrder",t.sortOrder),Object.values(t.filters??{}).forEach(r=>{if(r)switch(r.id){case"owner":r.owner&&e.set("owner",r.owner);break;case"access":r.access&&e.set("access",r.access);break;case"specialGroups":r.specialGroup&&e.set("specialGroups",r.specialGroup);break;case"memberOrg":r.memberOrg&&e.set("memberorgids",r.memberOrg);break;case"membership":r.membership&&e.set("membershipaccess",r.membership);break;case"created":De(e,"created",r);break;case"modified":De(e,"modified",r);break;default:V(r)}}),e}function ne(t,e="desc"){switch(t){case"owner":case"title":return"asc";case"created":case"modified":case"relevance":return"desc";default:return e}}function Or(t){return!t||!(t instanceof HTMLElement)?null:t}async function Sr(t){if(t){if(t.restoreFocus){await t.restoreFocus();return}if(t.setFocus){await t.setFocus();return}t.focus?.()}}function Pr(t){let e=null,r=async(s={})=>{t.onClose(),s.restoreFocus&&await Sr(e)};return{handlePreview:(s,i)=>{if(!s?.id){r();return}e=Or(i),t.onOpen({preview:s})},closePreview:r}}function Br(t){let e,r,s,i=()=>{e?.();let a=or(()=>t.getStore().width,()=>{n()});e=()=>{a.remove()}},n=()=>{let a=t.getStore(),l=a.width||t.getHostWidth()||t.getViewportWidth(),c=Math.min(l,t.getViewportWidth());a.width!==c&&(a.width=c);let g=c>D.md?"large":"small";t.getResponsiveFormFactor()==="large"&&g==="small"&&(a.panel=!1,a.filtersExpanded=!1),t.getResponsiveFormFactor()==="small"&&g==="large"&&(a.panel=!1,a.filtersExpanded=!0),t.setResponsiveFormFactor(g)};return{connect:()=>{typeof ResizeObserver<"u"&&(r=new ResizeObserver(a=>{let l=a[0]?.contentRect?.width??0;if(l>0){let c=Math.round(l);t.setHostWidth(c),t.getStore().width=c,n()}}),r.observe(t.el)),i(),n()},disconnect:()=>{s!==void 0&&(cancelAnimationFrame(s),s=void 0),e?.(),r?.disconnect(),r=void 0},refreshStoreWatcher:i,handleWindowResize:()=>{if(t.setViewportWidth(window.innerWidth),!r){if(s!==void 0)return;s=requestAnimationFrame(()=>{s=void 0;let a=Math.round(t.el.getBoundingClientRect().width||t.getHostWidth()||t.getViewportWidth()),l=Math.min(a,t.getViewportWidth()),c=t.getStore();c.width!==l&&(c.width=l),n()});return}n()},updateResponsiveLayout:n}}function _r(t){let e=!1,r=()=>!!t.getSearchParamInteraction()?.read,s=()=>!!t.getSearchParamInteraction()?.write;return{hydrateFromLocation:async()=>{if(!r()||typeof window>"u")return;let i=new URLSearchParams(window.location.search);await t.applySearchParams(i),t.onSearchParamsUpdate?.({phase:"hydrate",search:i.toString(),searchParams:i,searchParamMap:de(i)}),e=!0},writeToLocation:i=>{if(!s()||typeof window>"u")return;if(e){e=!1;return}let n=i.toString(),a=window.location.search.startsWith("?")?window.location.search.slice(1):window.location.search;if(n===a)return;let l=`${window.location.pathname}${n?`?${n}`:""}${window.location.hash}`;window.history.replaceState(window.history.state,"",l),t.onSearchParamsUpdate?.({phase:"write",search:n,searchParams:i,searchParamMap:de(i)})}}}var ce=["title","relevance","modified"],pe={queryParams:void 0,nextStart:-1,results:[],start:-1,num:0,total:0},Me=["openData","sharedUpdate","distributed","admin","settings"],he=class extends $e{constructor(){super(),this._messages=ae({name:"portal-group-browser",blocking:!0}),this._browserMessages=ae({name:"portal-browser",blocking:!0}),this.responsiveLayoutController=Br({el:this.el,getStore:()=>this.store,getViewportWidth:()=>this.viewportWidth,setViewportWidth:e=>{this.viewportWidth=e},getHostWidth:()=>this.hostWidth,setHostWidth:e=>{this.hostWidth=e},getResponsiveFormFactor:()=>this.responsiveFormFactor,setResponsiveFormFactor:e=>{this.responsiveFormFactor=e}}),this.previewSessionController=Pr({onOpen:({preview:e})=>{this.store.preview=e.id,this.arcgisGroupBrowserPreview.emit(e)},onClose:()=>{this.store.preview=null,this.arcgisGroupBrowserPreview.emit(null),this.arcgisGroupBrowserSublayerPreview.emit(null)}}),this.browserResponse=this.getBrowserResponseFromQueryResponse(pe),this.previewGroupsById=new Map,this.searchParamController=_r({applySearchParams:async e=>{await this.applySearchParams(e)},getSearchParamInteraction:()=>this.searchParamInteraction,onSearchParamsUpdate:e=>{this.arcgisGroupBrowserSearchParamsUpdate.emit(e)}}),this.handleBrowserFilterClear=()=>{this.clearFilters()},this.handleBrowserFilterRemove=e=>{let r=e.detail;r&&this.removeFilter(r)},this.onDelegatedGroupCardSelect=e=>{this.handleGroupCardSelect(e)},this.onDelegatedGroupCardPreview=e=>{this.handleGroupCardPreview(e)},this.selectedOwner=null,this.selectedMembership=null,this.selectedMemberOrg=null,this.selectedSpecialGroup=null,this.selectedAccess=null,this.selectedGroups=[],this.queryResponse=pe,this.specialGroupOptions=Me,this.responsiveFormFactor="large",this.viewportWidth=typeof window>"u"?D.lg:window.innerWidth,this.hostWidth=0,this.store=Pe({type:"group-browser",width:window?.innerWidth??D.lg,hiddenFilters:[],filtersEmpty:!1,topbarEmpty:!1,sortEmpty:!1,filtersExpanded:!1,panel:!1,filters:{}}),this.filters={},this.loading=!1,this.formFactor="large",this.height="full",this.searchTerm="",this.messageOverrides={},this.hideTopBar=!1,this.cards={},this.preview="top",this.q="",this.num=60,this.sort={enabled:!0,props:{options:ce}},this.searchParamInteraction={read:!1,write:!1},this.selection="none",this.alwaysShowSelection=!1,this.hidePreviewFooter=!1,this.hidePreviewBadges=!1,this.hasIndoorsSpaces=!1,this.arcgisGroupBrowserLoading=S(),this.arcgisGroupBrowserPreview=S(),this.arcgisGroupBrowserSelect=S(),this.arcgisGroupBrowserSublayerPreview=S(),this.arcgisGroupBrowserUpdate=S(),this.arcgisGroupBrowserInternalUIAction=S(),this.arcgisGroupBrowserUserFilterChange=S(),this.arcgisGroupBrowserSearchParamsUpdate=S(),this.arcgisAriaUpdate=S(),this.listen(Ae.select,this.onDelegatedGroupCardSelect),this.listen(Ae.preview,this.onDelegatedGroupCardPreview)}static{this.properties={selectedGroupsByUser:16,selectedOwner:16,selectedMembership:16,selectedMemberOrg:16,selectedSpecialGroup:16,selectedAccess:16,selectedGroups:16,queryResponse:16,specialGroupOptions:16,sortField:16,sortOrder:16,responsiveFormFactor:16,viewportWidth:16,hostWidth:16,store:0,filters:0,loading:5,formFactor:1,height:3,searchTerm:1,messageOverrides:0,hideTopBar:5,selected:0,view:1,cards:0,preview:1,q:1,portal:0,num:9,sort:0,fetch:0,preflight:0,searchUser:1,searchParamInteraction:0,selection:1,alwaysShowSelection:5,hidePreviewFooter:5,hidePreviewBadges:5,hasIndoorsSpaces:5}}static{this.styles=lr}get currentUsername(){return this.portal.user?.username??""}get selectedGroupsState(){return this.selectedGroups}get previewedGroupId(){return this.store.preview||void 0}async refresh(){await this.fetchGroups()}async clearFilters(){this.clearFiltersInternal(),await this.fetchGroups()}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.responsiveLayoutController.handleWindowResize),this.responsiveLayoutController.connect()}firstUpdated(){this.initializeBrowserState()}updated(e){e.has("view")&&(this.store.view=this.view),e.has("store")&&(this.view!==void 0&&(this.store.view=this.view),this.responsiveLayoutController.refreshStoreWatcher(),this.responsiveLayoutController.updateResponsiveLayout(),this.syncFiltersEmptyFromConfig()),e.has("filters")&&this.syncFiltersEmptyFromConfig(),e.has("selected")&&(this.selectedGroups=this.selected||[]);let r=e.get("num");r!==void 0&&r!==this.num&&this.fetchGroups(),(e.has("portal")||e.has("hasIndoorsSpaces"))&&this.updateSpecialGroupOptions(),e.has("sort")&&this.syncSortFromConfig()}disconnectedCallback(){this.responsiveLayoutController.disconnect(),window.removeEventListener("resize",this.responsiveLayoutController.handleWindowResize),super.disconnectedCallback()}syncSelectionsFromConfig(){this.selectedGroupsByUser=this.filters.groupsByUser?.props?.selectedUsername??this.currentUsername,this.selectedOwner=this.filters.owner?.props?.owner||null,this.selectedMembership=this.filters.membership?.props?.membership||null,this.selectedMemberOrg=this.filters.memberOrg?.props?.memberOrg||null,this.selectedSpecialGroup=this.filters.specialGroups?.props?.specialGroup||null,this.selectedAccess=this.filters.access?.props?.access||null}async initializeBrowserState(){this.syncSortFromConfig(),this.syncFiltersEmptyFromConfig(),this.selectedGroups=this.selected||[],this.syncSelectionsFromConfig(),await this.searchParamController.hydrateFromLocation(),await this.updateSpecialGroupOptions(!1),await this.fetchGroups()}resetSelectionByFilterId(e){switch(e){case"groupsByUser":this.selectedGroupsByUser=this.filters.groupsByUser?.props?.selectedUsername??this.currentUsername;break;case"owner":this.selectedOwner=null;break;case"membership":this.selectedMembership=null;break;case"memberOrg":this.selectedMemberOrg=null;break;case"specialGroups":this.selectedSpecialGroup=null;break;case"access":this.selectedAccess=null;break}}resetAllFilterSelections(){this.selectedGroupsByUser=this.filters.groupsByUser?.props?.selectedUsername??this.currentUsername,this.selectedOwner=null,this.selectedMembership=null,this.selectedMemberOrg=null,this.selectedSpecialGroup=null,this.selectedAccess=null}getSearchParamsSnapshot(e,r){return Gr({currentSearchParams:typeof window>"u"?void 0:new URLSearchParams(window.location.search),filters:this.store.filters,searchTerm:r,sortField:e.queryParams?.sortField,sortOrder:e.queryParams?.sortOrder})}publishFilterStateChange(){this.requestUpdate()}syncFiltersEmptyFromConfig(){let e=["created","modified","owner","membership","memberOrg","specialGroups","access","groupsByUser"].some(r=>!!this.filters[r]?.enabled);this.store.filtersEmpty=!e}syncSortFromConfig(){let e=this.sort,r=e.props?.options??ce;if(!e.enabled){this.sortField=void 0,this.sortOrder=void 0;return}if(!r.length){this.sortField=void 0,this.sortOrder=void 0;return}let s=e.props?.field,i=s&&r.includes(s)?s:r[0];this.sortField=i,this.sortOrder=e.props?.order??ne(i,this.sortOrder)}async updateSpecialGroupOptions(e=!0){if(!this.portal){this.specialGroupOptions=[];return}let r="";try{r=await Ce(this.portal)}catch{r=""}if(this.specialGroupOptions=Me.filter(s=>!(s==="openData"&&this.portal.isPortal||s==="distributed"&&this.hasIndoorsSpaces||s==="settings"&&!r)),this.selectedSpecialGroup&&!this.specialGroupOptions.includes(this.selectedSpecialGroup))if(e)this.removeFilter("specialGroups");else{let{specialGroups:s,...i}=this.store.filters;this.store.filters={...i},this.selectedSpecialGroup=null}}async applySearchParams(e){let r=Le(e);if(!this.searchTerm&&r.searchTerm&&(this.searchTerm=r.searchTerm),this.sort.enabled){let s=this.sort.props?.options??ce;r.sortField&&this.sort.props?.field===void 0&&s.includes(r.sortField)&&(this.sortField=r.sortField),r.sortOrder&&this.sort.props?.order===void 0?this.sortOrder=r.sortOrder:r.sortField&&this.sort.props?.order===void 0&&(this.sortOrder=ne(r.sortField,this.sortOrder))}await this.applyFilterSearchParams(r.filters)}async applyFilterSearchParams(e){let r={...this.store.filters},s=!1,i=j(this.portal.user);if(e.owner&&this.filters.owner?.enabled&&!this.filters.owner.props?.owner){let l=this.filters.owner.props?.username??this.currentUsername;r.owner={id:"owner",label:L(this._messages.owner.label,{label:this.getOwnerOptionLabel(e.owner,l,i)}),param:"q",value:J(e.owner,l,{isPublicUser:i,orgId:this.portal.id??""}),owner:e.owner,username:l},this.selectedOwner=e.owner,s=!0}e.membership&&this.filters.membership?.enabled&&!this.filters.membership.props?.membership&&(r.membership={id:"membership",label:L(this._messages.membership.label,{label:this._messages.membership[e.membership]}),param:"q",value:K(e.membership,this.hasIndoorsSpaces),membership:e.membership},this.selectedMembership=e.membership,s=!0),e.memberOrg&&this.filters.memberOrg?.enabled&&!this.filters.memberOrg.props?.memberOrg&&(r.memberOrg={id:"memberOrg",label:L(this._messages.memberOrg.label,{label:this._messages.memberOrg[e.memberOrg]}),param:"q",value:X(e.memberOrg,this.filters.memberOrg.props?.orgId??this.portal.id??""),memberOrg:e.memberOrg,orgId:this.filters.memberOrg.props?.orgId??this.portal.id??""},this.selectedMemberOrg=e.memberOrg,s=!0),e.specialGroups&&this.filters.specialGroups?.enabled&&!this.filters.specialGroups.props?.specialGroup&&(r.specialGroups={id:"specialGroups",label:L(this._messages.specialGroups.label,{label:this._messages.specialGroups[e.specialGroups]}),param:"q",value:await Y(e.specialGroups,this.portal),specialGroup:e.specialGroups},this.selectedSpecialGroup=e.specialGroups,s=!0),e.access&&this.filters.access?.enabled&&!this.filters.access.props?.access&&(r.access={id:"access",label:L(this._messages.access.label,{label:this._messages.access[e.access]}),param:"q",value:Z(e.access),access:e.access},this.selectedAccess=e.access,s=!0);let n=this.getDateFilterDetailFromSearchParams("created",e.created);n&&(r.created=n,s=!0);let a=this.getDateFilterDetailFromSearchParams("modified",e.modified);a&&(r.modified=a,s=!0),s&&(this.store.filters=r,this.publishFilterStateChange())}getDateFilterDetailFromSearchParams(e,r){let s=this.filters[e];if(!s?.enabled||s.props?.range||s.props?.start||s.props?.end||!r?.range)return;let i=mr(r.range,r.start,r.end);if(!i)return;let n=this._browserMessages.filterDate[r.range],[a,l]=i;return{id:e,label:L(this._browserMessages.filterDate[e],{date:n}),param:"q",value:`(${s.props?.serverProperty??(e==="modified"?"modified":"uploaded")}:[${a} TO ${l}])`,range:r.range,start:new Date(a),end:new Date(l)}}getOwnerOptionLabel(e,r,s){return e==="owner"?r:e==="outsideOrg"&&s?this._messages.owner.someoneElse:e==="inOrg"?this._messages.owner.inOrg:this._messages.owner.outsideOrg}writeSearchParams(e){this.searchParamController.writeToLocation(e)}async fetchGroups(){this.loading=!0,this.arcgisGroupBrowserLoading.emit();let e=this.createQuery();await this.fetchAndEmit(e,this.searchTerm)}removeFilter(e){let r=this.store.filters[e];r&&(this.store.filters={...this.store.filters,[e]:Be(r)},this.resetSelectionByFilterId(e),this.publishFilterStateChange(),this.fetchGroups())}clearFiltersInternal(){this.store.filters=_e(this.store.filters,{hiddenFilterIds:this.store.hiddenFilters}),this.resetAllFilterSelections(),this.publishFilterStateChange(),this.fetchGroups()}isFilterActive(e){let r=this.store.filters[e];return r?!!(r.value||"additionalParams"in r&&r.additionalParams):!1}setFilterSelection(e){switch(e.kind){case"owner":this.selectedOwner=e.value;break;case"membership":this.selectedMembership=e.value;break;case"memberOrg":this.selectedMemberOrg=e.value;break;case"access":this.selectedAccess=e.value;break;case"groupsByUser":this.selectedGroupsByUser=e.value;break;case"specialGroups":this.selectedSpecialGroup=e.value;break;default:V(e)}}selectGroup(e){this.isSelected(e)||(this.selectedGroups=[...this.selectedGroups,e])}deselectGroup(e){this.selectedGroups=this.selectedGroups.filter(({id:r})=>r!==e.id)}isSelected(e){return this.selectedGroups.some(({id:r})=>e.id===r)}handleGroupCardSelect(e){let{selected:r,group:s}=e.detail;switch(this.selection){case"single":this.selectedGroups=[s];break;case"multiple":r?this.selectGroup(s):this.deselectGroup(s);break;default:return}this.arcgisGroupBrowserSelect.emit(this.selectedGroups)}handleGroupCardPreview(e){this.store.filtersExpanded=!1,this.previewSessionController.handlePreview(e.detail,e.target)}closePreview(e={}){this.previewSessionController.closePreview(e)}async handleSortFieldChange(e){this.sortField=e,this.sortOrder=ne(e,this.sortOrder),this.loading=!0,this.arcgisGroupBrowserLoading.emit();let r=this.createQuery({start:1,total:0});await this.fetchAndEmit(r,this.searchTerm)}async handleSortOrderChange(e){this.sortOrder=e,this.loading=!0,this.arcgisGroupBrowserLoading.emit();let r=this.createQuery({start:1,total:0});await this.fetchAndEmit(r,this.searchTerm)}emitUpdate(e,r){let s=e.queryParams,i=this.getSearchParamsSnapshot(e,r),n=de(i);this.arcgisGroupBrowserUpdate.emit({queryResponse:e,sortField:s?.sortField,sortOrder:s?.sortOrder,selectedGroups:this.selectedGroups,filters:{...this.store.filters},searchTerm:r,searchParamMap:n}),this.writeSearchParams(i)}async queryGroups(e){return await(this.fetch?.(e)??nr(this.portal,e))}async fetchAndEmit(e,r){this.preflight&&(e=await this.preflight(e));let s=await this.queryGroups(e);this.store.preview&&!s.results.some(i=>i.id===this.store.preview)&&this.closePreview(),this.queryResponse=s,this.previewGroupsById=new Map(s.results.filter(i=>!!i.id).map(i=>[i.id,i])),this.browserResponse=this.getBrowserResponseFromQueryResponse(s),this.loading=!1,this.emitUpdate(s,r)}createQuery(e={}){return{filters:this.store.filters,searchUser:this.searchUser,searchTerm:e.searchTerm??this.searchTerm,baseQuery:this.q,sortField:this.sortField,sortOrder:this.sortOrder,start:e.start??1,num:e.num??this.num,total:e.total??this.queryResponse.total}}async handleSearch(e){this.searchTerm=e,this.loading=!0,this.arcgisGroupBrowserLoading.emit();let r=this.createQuery({searchTerm:e});await this.fetchAndEmit(r,e)}async handlePage({num:e,start:r,total:s}){this.loading=!0,this.arcgisGroupBrowserLoading.emit();let i=this.createQuery({start:r,num:e,total:s});await this.fetchAndEmit(i,this.searchTerm)}getBrowserResponseFromQueryResponse(e){let{nextStart:r,num:s,queryParams:i,results:n,start:a,total:l}=e??pe;return{nextStart:r??-1,num:s??i?.num??0,results:n,start:a??i?.start??1,total:l}}async formatRange({start:e,end:r,total:s}){if(this._messages._lang?.toLowerCase().startsWith("en"))return[`${e}-${r} of ${s}`,`${e}-${r} of ${s} group${s==="1"?"":"s"}`];let i=this._messages.browser,n={start:e,end:r,total:s},a=oe(i.pageRange,n),l=oe(i.pageRangeAria,n);return[a,l]}getPreviewFooterActionsEmpty(){return!this.el?.querySelector('[slot="preview-footer-action"]')}renderTopBar(){return p`<arcgis-portal-browser-top-bar slot=top-bar .store=${this.store}><slot name=top-bar-start slot=content-start></slot><arcgis-portal-browser-search slot=search .store=${this.store} .term=${this.searchTerm} .placeholder=${this.messageOverrides.searchPlaceholder} @arcgisBrowserSearch=${e=>{this.handleSearch(e.detail)}}></arcgis-portal-browser-search><slot name=top-bar-end slot=content-end></slot></arcgis-portal-browser-top-bar>`}renderEmptyTextSlot(e,r){return p`<div slot=${e??w} class="empty-text-slot"><slot name=${e??w}><p class="empty-text-slot__default">${r}</p></slot></div>`}renderDefaultContent(){let e=new Set(this.selectedGroups.map(a=>a.id)),r=!!this.el.querySelector('[slot="group-cards"]'),s=this.view??this.store.view??"list",i=this.queryResponse.results.map(a=>{let l=this.cards.group,c=typeof l=="function"?l(a):{};return{group:a,cardProps:c}}),n=i.length>0&&s==="compact";return p`<div slot=content class=${E({"group-browser__results":!0,"group-browser__results--compact":n})} .part=${"results"}>${r?p`<slot name=group-cards></slot>`:p`<slot name=group-cards>${i.map(({group:a,cardProps:l})=>{let c=a.id;return Ge(c,p`<arcgis-portal-group-card class="group-browser__result-card" .portal=${this.portal} .group=${a} .user=${l.user} .indeterminate=${l.indeterminate} .view=${s} .selection=${this.selection} .selected=${e.has(c)} .preview=${l.preview??this.preview} .previewed=${l.previewed??this.store.preview===c} .name=${l.name} .showSummary=${l.showSummary??!0} .hideBadges=${l.hideBadges??!1} .hideDateUpdated=${l.hideDateUpdated??!1} .showDateCreated=${l.showDateCreated??!1} .hideViewableBy=${l.hideViewableBy??!1} .hideOwner=${l.hideOwner??!1} .link=${l.link} .linkHandler=${l.linkHandler} .newTab=${l.newTab??!1} .disabled=${l.disabled??!1}></arcgis-portal-group-card>`)})}</slot>`}</div>`}render(){let e=this.responsiveFormFactor==="small"?"small":this.formFactor,r=this.previewGroupsById.get(this.store.preview??"");return p`<arcgis-portal-browser .store=${this.store} .response=${this.browserResponse} .loading=${this.loading} .formFactor=${e} .height=${this.height} .searchTerm=${this.searchTerm} .rangeFormatter=${this.formatRange} .selected=${this.selectedGroups} .alwaysShowSelection=${this.alwaysShowSelection} @arcgisBrowserFilterClear=${this.handleBrowserFilterClear} @arcgisBrowserFilterRemove=${this.handleBrowserFilterRemove} @arcgisAriaUpdate=${s=>{this.arcgisAriaUpdate.emit(s.detail)}}>${!this.hideTopBar&&p`<slot name=top-bar slot=top-bar>${this.renderTopBar()}</slot>`||""}<slot name=content-start slot=content-start></slot><slot name=selection slot=selection></slot><slot name=actions slot=actions></slot><slot name=view slot=view></slot>${Re({slot:"sort",sort:this.sort,formFactor:e,sortField:this.sortField,sortOrder:this.sortOrder,onSortFieldChange:s=>{this.handleSortFieldChange(s)},onSortOrderChange:s=>{this.handleSortOrderChange(s)}})}${this.renderDefaultContent()}${ke({slot:"pagination",store:this.store,total:this.queryResponse.total,start:this.queryResponse?.queryParams?.start??1,num:this.queryResponse?.queryParams?.num??this.num,onPage:s=>{this.handlePage(s)}})}<slot name=content-end slot=content-end></slot><slot name=preview slot=preview>${r&&p`<arcgis-portal-group-browser-preview .group=${r} .portal=${this.portal} .user=${this.portal.user??void 0} .hideBadges=${this.hidePreviewBadges} .hidePreviewFooter=${this.hidePreviewFooter} .currentResponse=${this.queryResponse} .previewFooterActionsSpaced=${!this.getPreviewFooterActionsEmpty()} @arcgisGroupBrowserInternalUIAction=${s=>{this.arcgisGroupBrowserInternalUIAction.emit(s.detail)}} @arcgisGroupBrowserPreviewClose=${()=>{this.closePreview({restoreFocus:!0})}}><slot name=preview-footer-action slot=footer-action></slot></arcgis-portal-group-browser-preview>`||""}</slot>${this.renderEmptyTextSlot("no-results",this._messages.content.noResults)}${this.renderEmptyTextSlot("no-content",this._messages.content.noContent)}<slot name=scroll-end slot=scroll-end></slot>${qe({slot:"filters",filters:this.filters,messages:this._messages,browserMessages:this._browserMessages,store:this.store,portal:this.portal,hasIndoorsSpaces:this.hasIndoorsSpaces,selectedGroupsByUser:this.selectedGroupsByUser,selectedOwner:this.selectedOwner,selectedMembership:this.selectedMembership,selectedMemberOrg:this.selectedMemberOrg,selectedSpecialGroup:this.selectedSpecialGroup,specialGroupOptions:this.specialGroupOptions,selectedAccess:this.selectedAccess,isFilterActive:s=>this.isFilterActive(s),handleSelect:s=>{this.setFilterSelection(s)},handleUserFilterChange:s=>{this.arcgisGroupBrowserUserFilterChange.emit(s)},handleRemove:s=>{this.removeFilter(s)},handleUpsert:s=>{this.store.filters={...this.store.filters,[s.id]:s},this.publishFilterStateChange(),this.fetchGroups()}})}</arcgis-portal-browser>`}};Fe("arcgis-portal-group-browser",he);return he},"intl","portal/PortalGroup","intl","core/reactiveUtils","intl",a,b,c,d,e,f,g,h,i,k,l,m,n)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import a from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./F3ODJVJC.js";export default $arcgis.t(([a,{e:o}])=>{var i=async(r,t,e)=>{try{return{result:await r.queryItems({...e,query:`title:${t}`})}}catch(n){return console.error(n),{error:{code:"unhandledError"}}}},l=async(r,t,e)=>{let n=`${t.restUrl}/content/users/${r.id}/items/${e}/generateContext`;try{return{result:(await a(n,{method:"post",responseType:"json",query:{f:"json"}})).data}}catch(s){return console.error("Error fetching item context:",s),{error:{code:"unhandledError"}}}};async function d(r,t){if(!r||!t)return{result:null};let e=`${r.restUrl}/content/items/${t}/data`;return await o(e)}return{a:i,b:l,c:d}},"request",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{b as $,c as y,d as x,e as v,f as z,g as O}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{b as $,c as y,d as x,e as v,f as z,g as O}from"./UZCHLKLO.js";import{c as f}from"./2GBRZSEC.js";import{a as w}from"./ACCEI7S4.js";import"./S7IRYX4A.js";import"./VJ4STLVD.js";import{M as g,N as m,P as u,S as b,h,j as n}from"./4PPXBKIJ.js";import"./UZLQALHY.js";var T=({appearance:a,badgeType:e,class:t,messages:r,scale:o,showTooltip:i,width:c})=>{let s=r[e]??{title:e,tooltip:""},P=C[e],l=c==="narrow",d=`portal-group-badge-${e}`;return n`<calcite-chip id=${d??u} class=${m({badge:!0,"badge--colored":f(["OpenData","Partnered"],e),narrow:l,[`narrow--${o}`]:l,[t]:!0})} .value=${e} tabindex=0 .scale=${o} .appearance=${a} .label=${s.title} .icon=${P}>${l?null:s.title}</calcite-chip>${i?n`<calcite-tooltip .referenceElement=${d} close-on-click placement=bottom-start offset-distance=6 offset-skidding=0>${l?n`<h3 class="tooltip-title">${s.title}</h3>`:null}<p class="tooltip-text">${s.tooltip}</p></calcite-tooltip>`:null}`},C={Collaboration:"collaboration",FeaturedContent:"home",Gallery:"images",OpenData:"open-data",SharedUpdate:"configure-editing",Partnered:"partnered-collaboration",AnyOrg:"zoom-to-object"},G=h`:host{display:flex;flex-wrap:wrap}.portal-group-badges__badge{margin-inline-end:.25rem}.badge{border:0}.badge--colored{--calcite-chip-icon-color: var(--calcite-color-brand)}.narrow{box-sizing:border-box;width:2rem;--calcite-chip-spacing-unit-l: 0}.image{border-radius:0;display:inline-flex;align-items:center;justify-content:center;margin-inline-end:.5rem}.narrow--s{width:1.5rem}.narrow--l{width:2.75rem}.tooltip-title{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1);margin:0 0 .25rem;padding:0}.tooltip-text{font-size:var(--calcite-font-size--2);color:var(--calcite-color-text-1);margin:0;padding:0}`;function U(a,e){let t=[],r=y(a),o=x(a),i=v(a);return e.id&&(r.includes("updateitemcontrol")&&t.push("SharedUpdate"),z(a)&&o===e.id&&t.push("OpenData"),e.featuredItemsGroupQuery===`id:${a.id}`&&t.push("Gallery")),($(a).collaborationInfo?.collaborationId||O(a))&&t.push("Collaboration"),!i&&!e.isPortal&&o!=="none"&&t.push("AnyOrg"),i==="collaboration"&&t.push("Partnered"),t.includes("SharedUpdate")&&!t.includes("Partnered")&&o!==e.id&&t.splice(t.indexOf("SharedUpdate"),1),t}var p=class extends g{constructor(){super(...arguments),this._messages=w({blocking:!0}),this.badges=[],this.width="full",this.scale="m",this.showTooltips=!1,this.empty=!1}static{this.properties={badges:16,group:0,portal:0,width:1,appearance:1,scale:1,showTooltips:5,empty:7}}static{this.styles=G}willUpdate(e){(e.has("group")||e.has("portal"))&&(this.badges=this.group&&this.portal?U(this.group,this.portal):[],this.empty=this.badges.length===0)}render(){let{appearance:e,badges:t,scale:r,showTooltips:o,width:i}=this;return t.map(c=>T({appearance:e,badgeType:c,class:"portal-group-badges__badge",messages:this._messages,scale:r,showTooltip:o,width:i}))}};b("arcgis-portal-group-badges",p);export{p as ArcgisPortalGroupBadges};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import a from"./5LI7CT3K.js";import{b as W}from"./J5CY2C46.js";import{a as T}from"./QW5RUJ2Z.js";import"./P4E7SHXA.js";import"./AKOYP2S2.js";import{a as q}from"./LO5EMUCP.js";import"./JUWVKK6D.js";import"./43ILIBJ6.js";import{K as C,L as P,M as J,Q as A,S as B,h as R,j as y,p as N,r as S,s as j,w as E}from"./XU6YAW25.js";import"./BVUCNXC5.js";export default $arcgis.t(([le,Ie,ve,Fe,x,de,I,pe,fe,k,Z,$,ee,{g:G,i:z,j:V,k:U,l:_,m:H,n:K,o:Q,p:X,q:Y}])=>{var L=(i=>(i.expression="expression/",i))(L||{});function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(L.expression)){let r=t.get(s);return r?.title?r.title:s}else return ee.supportsFieldConfiguration(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function se(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let r=e.get(i);s=r.type?r.type.toLowerCase():""}else if(t.has(i)){let r=t.get(i);s=r.returnType?r.returnType.toLowerCase():""}else s="number";return s}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function re(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${L.expression}${t.name}`;e.set(s,t)}),e}async function me(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,r=s?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=a.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(a=>{t(new Error(a))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function ae(i,e,t,s){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=s?.item??e.portalItem,o=e.sourceJSON;if(!r||!a||!a.portal.user||!U(a)||V(a)||_(a)||H(o)||a.portal.isPortal&&z(a)||["oid","global-id","geometry"].includes(t.type)||await ue(e,t.name,s))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,n=c?.shapeAreaFieldName;if(d(p,t.name)||d(n,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!s?.ignoreLayerRenderer&&e.featureReduction){let f=new Set;if(await I.collectFeatureReductionFields(f,e,e.featureReduction),Array.from(f).some(b=>d(b,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(f=>d(f,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let f=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(f&&((await I.getExpressionFields(e,f)).some(b=>d(b,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(f=>d(f,t.name))||await ge(e,t,s)||await ye(e,t))return!1;if(await be(e,t))return await Promise.resolve(!1);if(await we(e,t))return await Promise.resolve(!1);if(he(i,e,t)||e.relationships?.map(f=>f.keyField)?.some(f=>d(f,t.name)))return!1;let u=G(a,a.portal.user),v=s?.userItemInfo?.userGroups??await K(e)??[],g=s?.userItemInfo?.itemGroups??await Q(e)??[],w=Y(v,g);if(!u&&!w)return!1;let m=s?.userItemInfo?.relatedItems??await X(a.id,a.portal,{relationshipType:"Service2Service"});return!(m?.data?.relatedItems&&m.data.relatedItems.some(f=>["WMTS","Map Service","Vector Tile Service"].includes(f.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`;try{let r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await Z(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(o=>d(o,e))):!1}catch{return!1}}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let r=s.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,t.name)}}return!1}async function oe(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(o=>F(o.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(o=>F(o.where));if(!s?.length)return!1;let r=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],a=!1;for(let o=0;o<r.length;o++){let c=r[o].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let r=`${T(s.portal)}content/items/${s.id}/data`,a=(t?.userItemInfo?.itemData??await Z(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let o=a.layers.find(l=>l.id===i.layerId),c=o?.layerDefinition?.drawingInfo?.renderer,p=o?.layerDefinition?.featureReduction,n=o?.layerDefinition?.definitionExpression;if(!c&&!p&&!n)return!1;if(!t?.ignoreItemRenderer&&c){let l=k.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(u=>d(u,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await ne(i,e,p)||n&&(await $.parseWhereClause(n,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ye(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!s&&!r)return!1;if(s){let a=k.fromJSON(s);if((await I.getRendererFields(a,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(r&&await ne(i,e,r))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(r=>r.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await oe(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function we(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function ne(i,e,t){let s=t.type==="binning"?pe.fromJSON(t):fe.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,i,s),!!Array.from(r).some(a=>d(a,e.name))}var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Ne=({fieldType:i})=>y`<calcite-icon scale=s .icon=${h.get(i)}></calcite-icon>`,Ee=R`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,O=class extends J{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=q({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new W(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||N("error",this,S("layer")),F(t)||N("error",this,S("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=E(),this.arcgisClose=E(),this.arcgisBeforeDelete=E(),this.arcgisFieldsDeleted=E()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>s.includes(a.name));let r=s.some(a=>!e.fields.find(o=>o.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async o=>await ae(t,e,o,this.options)));if(this.fieldsAreDeletable=a.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=re(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Fe.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?te(t,r,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return de.supportsFieldConfiguration(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(o=>({name:o}))},a={deleteFromDefinition:JSON.stringify(r)};await x(s,{query:{...a,f:"json",async:!1},method:"post",responseType:"json"}).then(async o=>{if(o.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(n=>{e.type==="feature"&&e.floorInfo?.floorField===n&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let n=p.data;this.currentLayerInfo=p.data,n&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{n.templates?.length?n.templates.forEach(u=>delete u.prototype.attributes[l]):n.types?.forEach(u=>{u.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(n))}else this.handleError()}else this.handleError()},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,r=[];return(e??[]).forEach(a=>{let o=new Ie;o.description=a.description??"",o.name=a.name||s.newFeature,o.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let u=0;u<a.prototype.attributes.length;u++)if(a.prototype.attributes[u]===n.name){l=!0,c[n.name]=a.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,r.push(o)}),r}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(r)};await x(a,{query:{...o,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${T(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(n=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==n)),t.popupTemplate?.content?.forEach((l,u)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[u].fieldInfos=(t.popupTemplate?.content)[u].fieldInfos?.filter(v=>v.fieldName!==n))})}),t.attributeTableTemplate){let n=t.attributeTableTemplate.clone();n.elements=n.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),n.orderByFields=n.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=n}if(t.fieldConfigurations?.length){let n=le.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=n}await x(p,{query:{f:"json"},responseType:"json"}).then(async n=>{let l=n.data;if(l?.layers||l?.tables){let u=t.isTable,v=u?l.tables:l.layers,g=v?.find(w=>w.id===t.layerId);if(s.forEach(w=>{g?.attributeTableInfo?.attributeTableElements&&(g.attributeTableInfo.attributeTableElements=g.attributeTableInfo.attributeTableElements.map(m=>{if(m.type==="field")return m.fieldName===w?void 0:m;if(m.type==="group"&&Array.isArray(m.attributeTableElements)){let f=m.attributeTableElements.filter(b=>!(b.type==="field"&&b.fieldName===w));return f.length?{...m,attributeTableElements:f}:void 0}return m}).filter(Boolean),g.attributeTableInfo.orderByFields=g.attributeTableInfo.orderByFields.filter(m=>m.field!==w))}),g?.layerDefinition?.fieldConfigurations&&(g.layerDefinition.fieldConfigurations=g.layerDefinition.fieldConfigurations.filter(w=>!s.includes(w.name))),g?.popupInfo){s.forEach(b=>{g.popupInfo.fieldInfos=g.popupInfo.fieldInfos.filter(D=>D.fieldName!==b),g.popupInfo.popupElements?.forEach((D,M)=>{D.type==="fields"&&D.fieldInfos&&(g.popupInfo.popupElements[M].fieldInfos=g.popupInfo.popupElements[M].fieldInfos.filter(ce=>ce.fieldName!==b))})});let w=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,m={};u?(m.tables=v,l.layers&&(m.layers=l.layers)):(m.layers=v,l.tables&&(m.tables=l.tables));let f={f:"json",text:JSON.stringify(m)};await x(w,{query:{...f},method:"post",responseType:"json"}).then(b=>{b.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else n.httpStatus===200&&(!n.data||JSON.stringify(n.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=A(y`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&y`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:s,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,j("fieldNames"))),y`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${s?.length===1?e.deleteField:e.deleteFields} ${P(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return y`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return y`<calcite-list-item .label=${this.getFieldLabel(o)} .description=${`{${o}}`} .value=${o} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:se(o,s,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${P(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return y`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:r}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};B("arcgis-portal-field-delete",O);return O},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","applications/PortalApp/layerUtils","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql","applications/PortalApp/layerUtils",a)
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./T3LU5V74.js";import{b as W}from"./GUTV5BR3.js";import{a as T}from"./VMQIDO4Z.js";import"./QS3GXAIH.js";import"./2GBRZSEC.js";import{a as q}from"./ACCEI7S4.js";import"./S7IRYX4A.js";import"./VJ4STLVD.js";import{K as C,L as P,M as J,Q as A,S as B,h as R,j as y,p as N,r as S,s as j,w as E}from"./4PPXBKIJ.js";import"./UZLQALHY.js";export default $arcgis.t(([le,Ie,ve,Fe,x,de,I,pe,fe,k,Z,$,ee,{g:G,i:z,j:V,k:U,l:_,m:H,n:K,o:Q,p:X,q:Y}])=>{var L=(i=>(i.expression="expression/",i))(L||{});function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(L.expression)){let r=t.get(s);return r?.title?r.title:s}else return ee.supportsFieldConfiguration(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function se(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let r=e.get(i);s=r.type?r.type.toLowerCase():""}else if(t.has(i)){let r=t.get(i);s=r.returnType?r.returnType.toLowerCase():""}else s="number";return s}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function re(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${L.expression}${t.name}`;e.set(s,t)}),e}async function me(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,r=s?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=a.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(a=>{t(new Error(a))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function ae(i,e,t,s){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=s?.item??e.portalItem,o=e.sourceJSON;if(!r||!a||!a.portal.user||!U(a)||V(a)||_(a)||H(o)||a.portal.isPortal&&z(a)||["oid","global-id","geometry"].includes(t.type)||await ue(e,t.name,s))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,n=c?.shapeAreaFieldName;if(d(p,t.name)||d(n,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!s?.ignoreLayerRenderer&&e.featureReduction){let f=new Set;if(await I.collectFeatureReductionFields(f,e,e.featureReduction),Array.from(f).some(b=>d(b,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(f=>d(f,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let f=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(f&&((await I.getExpressionFields(e,f)).some(b=>d(b,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(f=>d(f,t.name))||await ge(e,t,s)||await ye(e,t))return!1;if(await be(e,t))return await Promise.resolve(!1);if(await we(e,t))return await Promise.resolve(!1);if(he(i,e,t)||e.relationships?.map(f=>f.keyField)?.some(f=>d(f,t.name)))return!1;let u=G(a,a.portal.user),v=s?.userItemInfo?.userGroups??await K(e)??[],g=s?.userItemInfo?.itemGroups??await Q(e)??[],w=Y(v,g);if(!u&&!w)return!1;let m=s?.userItemInfo?.relatedItems??await X(a.id,a.portal,{relationshipType:"Service2Service"});return!(m?.data?.relatedItems&&m.data.relatedItems.some(f=>["WMTS","Map Service","Vector Tile Service"].includes(f.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`;try{let r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await Z(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(o=>d(o,e))):!1}catch{return!1}}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let r=s.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,t.name)}}return!1}async function oe(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(o=>F(o.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(o=>F(o.where));if(!s?.length)return!1;let r=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],a=!1;for(let o=0;o<r.length;o++){let c=r[o].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let r=`${T(s.portal)}content/items/${s.id}/data`,a=(t?.userItemInfo?.itemData??await Z(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let o=a.layers.find(l=>l.id===i.layerId),c=o?.layerDefinition?.drawingInfo?.renderer,p=o?.layerDefinition?.featureReduction,n=o?.layerDefinition?.definitionExpression;if(!c&&!p&&!n)return!1;if(!t?.ignoreItemRenderer&&c){let l=k.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(u=>d(u,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await ne(i,e,p)||n&&(await $.parseWhereClause(n,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ye(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!s&&!r)return!1;if(s){let a=k.fromJSON(s);if((await I.getRendererFields(a,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(r&&await ne(i,e,r))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(r=>r.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await oe(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function we(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function ne(i,e,t){let s=t.type==="binning"?pe.fromJSON(t):fe.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,i,s),!!Array.from(r).some(a=>d(a,e.name))}var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Ne=({fieldType:i})=>y`<calcite-icon scale=s .icon=${h.get(i)}></calcite-icon>`,Ee=R`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,O=class extends J{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=q({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new W(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||N("error",this,S("layer")),F(t)||N("error",this,S("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=E(),this.arcgisClose=E(),this.arcgisBeforeDelete=E(),this.arcgisFieldsDeleted=E()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>s.includes(a.name));let r=s.some(a=>!e.fields.find(o=>o.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async o=>await ae(t,e,o,this.options)));if(this.fieldsAreDeletable=a.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=re(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Fe.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?te(t,r,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return de.supportsFieldConfiguration(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(o=>({name:o}))},a={deleteFromDefinition:JSON.stringify(r)};await x(s,{query:{...a,f:"json",async:!1},method:"post",responseType:"json"}).then(async o=>{if(o.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(n=>{e.type==="feature"&&e.floorInfo?.floorField===n&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let n=p.data;this.currentLayerInfo=p.data,n&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{n.templates?.length?n.templates.forEach(u=>delete u.prototype.attributes[l]):n.types?.forEach(u=>{u.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(n))}else this.handleError()}else this.handleError()},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,r=[];return(e??[]).forEach(a=>{let o=new Ie;o.description=a.description??"",o.name=a.name||s.newFeature,o.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let u=0;u<a.prototype.attributes.length;u++)if(a.prototype.attributes[u]===n.name){l=!0,c[n.name]=a.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,r.push(o)}),r}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(r)};await x(a,{query:{...o,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${T(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(n=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==n)),t.popupTemplate?.content?.forEach((l,u)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[u].fieldInfos=(t.popupTemplate?.content)[u].fieldInfos?.filter(v=>v.fieldName!==n))})}),t.attributeTableTemplate){let n=t.attributeTableTemplate.clone();n.elements=n.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),n.orderByFields=n.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=n}if(t.fieldConfigurations?.length){let n=le.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=n}await x(p,{query:{f:"json"},responseType:"json"}).then(async n=>{let l=n.data;if(l?.layers||l?.tables){let u=t.isTable,v=u?l.tables:l.layers,g=v?.find(w=>w.id===t.layerId);if(s.forEach(w=>{g?.attributeTableInfo?.attributeTableElements&&(g.attributeTableInfo.attributeTableElements=g.attributeTableInfo.attributeTableElements.map(m=>{if(m.type==="field")return m.fieldName===w?void 0:m;if(m.type==="group"&&Array.isArray(m.attributeTableElements)){let f=m.attributeTableElements.filter(b=>!(b.type==="field"&&b.fieldName===w));return f.length?{...m,attributeTableElements:f}:void 0}return m}).filter(Boolean),g.attributeTableInfo.orderByFields=g.attributeTableInfo.orderByFields.filter(m=>m.field!==w))}),g?.layerDefinition?.fieldConfigurations&&(g.layerDefinition.fieldConfigurations=g.layerDefinition.fieldConfigurations.filter(w=>!s.includes(w.name))),g?.popupInfo){s.forEach(b=>{g.popupInfo.fieldInfos=g.popupInfo.fieldInfos.filter(D=>D.fieldName!==b),g.popupInfo.popupElements?.forEach((D,M)=>{D.type==="fields"&&D.fieldInfos&&(g.popupInfo.popupElements[M].fieldInfos=g.popupInfo.popupElements[M].fieldInfos.filter(ce=>ce.fieldName!==b))})});let w=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,m={};u?(m.tables=v,l.layers&&(m.layers=l.layers)):(m.layers=v,l.tables&&(m.tables=l.tables));let f={f:"json",text:JSON.stringify(m)};await x(w,{query:{...f},method:"post",responseType:"json"}).then(b=>{b.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else n.httpStatus===200&&(!n.data||JSON.stringify(n.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=A(y`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&y`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:s,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,j("fieldNames"))),y`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${s?.length===1?e.deleteField:e.deleteFields} ${P(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return y`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return y`<calcite-list-item .label=${this.getFieldLabel(o)} .description=${`{${o}}`} .value=${o} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:se(o,s,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${P(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return y`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:r}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};B("arcgis-portal-field-delete",O);return O},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","applications/PortalApp/layerUtils","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql","applications/PortalApp/layerUtils",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import c from"./7Y2OBOEM.js";import b from"./4RPNBHB5.js";import"./PQ75545K.js";import a from"./645GY5SX.js";import"./S2BGAMSA.js";import"./FWRSYP3I.js";import"./DG6DAKQ2.js";import"./UZLQALHY.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
var s=(n,r)=>{let i=n?.configurable?.services?.[r];if(i==null)throw new Error(`${r} missing in config.configurable.services`);return i};export{s as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as k,b as D,c as _}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as k,b as D,c as _}from"./6TO2BYXU.js";import l from"./CVOWIH4J.js";import{a as A}from"./CFBSBZSS.js";import{a as C,b as U}from"./LDTVM22U.js";import j from"./T3LU5V74.js";import{a as w}from"./LLRHHAXZ.js";import i from"./RBGARTND.js";import e from"./F3ODJVJC.js";import a from"./OUFIJDIW.js";import{f as b}from"./VMQIDO4Z.js";import{b as f}from"./QS3GXAIH.js";import"./2GBRZSEC.js";import{a as v}from"./ACCEI7S4.js";import"./S7IRYX4A.js";import"./VJ4STLVD.js";import{K as d,L as I,M as u,P as R,S as g,h as p,j as c,w as h}from"./4PPXBKIJ.js";import"./UZLQALHY.js";export default $arcgis.t(([P,,,{a:$},{p:T},{f:y}])=>{var H=p`.thumbnail{object-fit:cover;max-height:8rem}.replacement-container{margin:.5rem}.replacement-message{margin-bottom:.5rem}.replacement-card__title{margin-bottom:.25rem}`,B=5e3,m=class extends u{constructor(){super(...arguments),this.replacementId=null,this.itemOwnerName="",this.replacementItemInRecycleBin=!1,this.hasInaccessibleReplacementItem=!1,this.replacementItemSupportsOpenActions=!1,this.thumbnailUrl=null,this.timer=void 0,this.messages=v({blocking:!0}),this.primaryActionRef=d(),this.getItemDetailsUrl=({portal:e,itemId:t,redirect:i})=>{let s=f({portal:e,usePortalHostname:!this.user});return s?`${`${s}/home`}/item.html?id=${t}${i?"&performRedirectAction=true":""}`:""},this.performRedirectAction=()=>{window.open(this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId,redirect:!0}),"_self")},this.viewItemDetailsPage=()=>{window.open(this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId??this.itemId}),this.supportsReplacement?"_self":"_blank")},this.canRedirect=!1,this.item=null,this.replacementItem=null,this.redirectAction=null,this.supportsReplacement=!1,this.redirectCancelled=!1,this.open=!1,this.redirectTimeRemaining=B/1e3,this.arcgisPortalReplacementItemFetch=h()}static{this.properties={item:16,replacementItem:16,redirectAction:16,supportsReplacement:16,redirectCancelled:16,open:16,redirectTimeRemaining:16,itemId:1,portal:0,user:0}}static{this.styles=H}async setFocus(){this.primaryActionRef.value?.setFocus()}willUpdate(e){(e.has("itemId")||e.has("portal")||e.has("user"))&&(this.user??=this.portal?.user??null,this.initItem())}setupTimer({onComplete:e}){typeof this.timer=="number"&&clearInterval(this.timer),this.redirectTimeRemaining=B/1e3,this.timer=setInterval(()=>{if(this.redirectTimeRemaining<=0){clearInterval(this.timer),this.timer=void 0,e();return}this.redirectTimeRemaining-=1},1e3)}cancelTimer({onCancel:e}={}){e?.(),clearInterval(this.timer)}handleClose(){this.cancelTimer(),this.itemId="",this.item=null,this.open=!1}cancelRedirect(){this.cancelTimer(),this.redirectCancelled=!0}isItemRetired(e){return k(e)||D(e)}async initItem(){if(!this.itemId)return;let{itemId:e,portal:t,performRedirectAction:i}=this,s=new P({id:e,portal:t});this.item=await s?.load();let n=await T(e,t,{relationshipType:"ReplacementItem2Item",direction:"reverse"},!0),r=n.data?.relatedItems?.[0];this.replacementItemInRecycleBin=r?.inRecycleBin;let l=r?.id,a=!this.replacementItemInRecycleBin&&l?new P({id:l,portal:t}):null;await a?.load(),this.replacementItem=a,this.hasInaccessibleReplacementItem=this.replacementItemInRecycleBin||!a&&n.data?.aggregations?.total?.count>0&&n.data?.relatedItems?.length===0,this.arcgisPortalReplacementItemFetch.emit({replacementItem:this.hasInaccessibleReplacementItem?{}:a||null}),this.replacementItem=a;let o=this.replacementItem?.owner??(s?.owner||null);this.itemOwnerName=o?A(await $(o,t),this.messages?._t9nLocale||"en"):"",this.replacementItemSupportsOpenActions=_(a),this.thumbnailUrl=U(t,a??this.item),this.supportsReplacement=!!a&&this.isItemRetired(s);let O=b(this.replacementItem,await y(this.portal),this.portal?.isPortal??!1);this.canRedirect=this.supportsReplacement&&this.replacementItemSupportsOpenActions&&!O,this.replacementId=a?.id||null,this.canRedirect&&this.setupTimer({onComplete:()=>i()}),this.open=!0}getReplacementHeading(){let{messages:e,hasInaccessibleReplacementItem:t,canRedirect:i}=this;return t?e.replacementUnavailable:i?e.redirectToReplacement:this.isItemRetired(this.item)&&!this.replacementItem?e.replacementUnavailable:e.replacementAvailable}getReplacementMessage(){let{messages:e,hasInaccessibleReplacementItem:t,supportsReplacement:i}=this;return t?e.retiredReplacementUnavailable:i?e.deprecatedHasReplacement:this.isItemRetired(this.item)&&!this.replacementItem?e.retired:e.deprecatedHasReplacement}getRedirectActionMessage(){let{messages:e,canRedirect:t,redirectTimeRemaining:i,redirectCancelled:s}=this;return s?e.redirectToReplacement:t?e.redirect.replace("${seconds}",`${i}`):e.moreDetails}renderCard(e){let{canRedirect:t,messages:i}=this;return c`<calcite-card thumbnail-position=inline-start><img slot=thumbnail class="thumbnail" src=${(this.thumbnailUrl||void 0)??R} @error=${async()=>this.thumbnailUrl=C(e)}><span slot=heading class="replacement-card__title">${e.title}</span><span slot=description>${i.ownedBy?.replace("${owner}",this.itemOwnerName)}</span>${t&&c`<calcite-link slot=footer-start icon-end=launch .href=${this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId})} target=_blank>${i.moreDetails}</calcite-link>`||""}</calcite-card>`}render(){let{open:e,messages:t,item:i,replacementItem:s,supportsReplacement:n,canRedirect:r,redirectCancelled:l}=this;if(!(!i||!this.isItemRetired(i)))return c`<calcite-dialog modal .open=${e} width=s kind=info outside-close-disabled escape-disabled close-disabled .heading=${this.getReplacementHeading()} @calciteDialogClose=${()=>this.handleClose()}><div class="replacement-container"><div class="replacement-message">${w(this.getReplacementMessage()?.replace("${itemTitle}",this.item?.title||""))}</div>${this.renderCard(n?s:i)}</div>${r&&!l&&c`<calcite-button slot=footer-end appearance=outline-fill kind=neutral @click=${()=>{this.cancelRedirect()}}>${t.cancelRedirection}</calcite-button>`||""}<calcite-button slot=footer-end @click=${()=>{this.cancelTimer(),r?this.performRedirectAction():this.viewItemDetailsPage()}} .iconEnd=${r?void 0:"launch"} ${I(this.primaryActionRef)}>${this.getRedirectActionMessage()}</calcite-button></calcite-dialog>`}};g("arcgis-portal-replacement-item-redirect",m);return m},"portal/PortalItem",a,e,i,j,l)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import f from"./R2D2KBV7.js";import e from"./CVOWIH4J.js";import"./CFBSBZSS.js";import d from"./T3BCFS2M.js";import"./ILDTKRON.js";import"./LDTVM22U.js";import"./OBBYT2AV.js";import"./UZCHLKLO.js";import"./DFTUMKSN.js";import c from"./RBGARTND.js";import"./VQKLCN3V.js";import b from"./F3ODJVJC.js";import"./EHQVLI6M.js";import a from"./OUFIJDIW.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import"./2GBRZSEC.js";import"./ACCEI7S4.js";import"./S7IRYX4A.js";import"./VJ4STLVD.js";import"./4PPXBKIJ.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,{g:a}])=>{return a},a,b,c,d,e,f)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{$ as J,$a as Ga,A as z,Aa as ia,B as A,Ba as ja,C as B,Ca as ka,D as C,E as D,Ea as la,F as E,Fa as ma,G as F,Ga as na,H as G,Ha as oa,I as H,Ia as pa,Ja as qa,Ka as ra,La as sa,Ma as ta,Na as ua,Oa as va,Pa as wa,Qa as xa,R as I,Ra as ya,Sa as za,Ta as Aa,Wa as Ba,Xa as Ca,Ya as Da,Za as Ea,_a as Fa,a,aa as K,ab as Ha,b,ba as L,bb as Ia,c,ca as M,cb as Ja,d,da as N,db as Ka,e,ea as O,eb as La,f,fa as P,ga as Q,h as g,ha as R,i as h,ia as S,j as i,ja as T,k as j,ka as U,l as k,la as V,m as l,ma as W,n as m,na as X,o as n,oa as Y,p as o,pa as Z,q as p,qa as _,r as q,ra as $,s as r,sa as aa,t as s,ta as ba,u as t,ua as ca,v as u,va as da,w as v,wa as ea,x as w,xa as fa,y as x,ya as ga,z as y,za as ha}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{$ as J,$a as Ga,A as z,Aa as ia,B as A,Ba as ja,C as B,Ca as ka,D as C,E as D,Ea as la,F as E,Fa as ma,G as F,Ga as na,H as G,Ha as oa,I as H,Ia as pa,Ja as qa,Ka as ra,La as sa,Ma as ta,Na as ua,Oa as va,Pa as wa,Qa as xa,R as I,Ra as ya,Sa as za,Ta as Aa,Wa as Ba,Xa as Ca,Ya as Da,Za as Ea,_a as Fa,a,aa as K,ab as Ha,b,ba as L,bb as Ia,c,ca as M,cb as Ja,d,da as N,db as Ka,e,ea as O,eb as La,f,fa as P,ga as Q,h as g,ha as R,i as h,ia as S,j as i,ja as T,k as j,ka as U,l as k,la as V,m as l,ma as W,n as m,na as X,o as n,oa as Y,p as o,pa as Z,q as p,qa as _,r as q,ra as $,s as r,sa as aa,t as s,ta as ba,u as t,ua as ca,v as u,va as da,w as v,wa as ea,x as w,xa as fa,y as x,ya as ga,z as y,za as ha}from"./GC7KNL7Y.js";import"./DG6DAKQ2.js";import"./UZLQALHY.js";export{S as Annotation,O as AsyncBatchedStore,Q as BaseChannel,L as BaseCheckpointSaver,k as BaseLangGraphError,N as BaseStore,R as BinaryOperatorAggregate,d as COMMAND_SYMBOL,I as ChatModelStreamImpl,i as Command,e as CommandInstance,Ca as CompiledStateGraph,qa as DeltaChannel,ua as DeltaValue,b as END,B as EmptyChannelError,A as EmptyInputError,$ as EventLog,la as Graph,l as GraphBubbleUp,o as GraphDrained,q as GraphInterrupt,m as GraphRecursionError,ha as GraphRunStream,n as GraphValueError,c as INTERRUPT,P as InMemoryStore,C as InvalidUpdateError,M as MemorySaver,Da as MessageGraph,Ia as MessagesAnnotation,Aa as MessagesDeltaValue,za as MessagesValue,Ja as MessagesZodMeta,Ka as MessagesZodState,D as MultipleSubgraphsError,s as NodeError,r as NodeInterrupt,y as NodeTimeoutError,g as Overwrite,u as ParentCommand,wa as REMOVE_ALL_MESSAGES,sa as ReducedValue,F as RemoteException,X as RunControl,a as START,Y as STREAM_EVENTS_V3_MODES,f as Send,Ba as StateGraph,G as StateGraphInputError,va as StateSchema,$ as StreamChannel,ia as SubgraphRunStream,E as UnreachableNodeError,ta as UntrackedValue,ra as UntrackedValueChannel,xa as addMessages,_ as convertToProtocolEvent,K as copyCheckpoint,ja as createGraphRunStream,ba as createLifecycleTransformer,ca as createMessagesTransformer,ea as createSubgraphDiscoveryTransformer,fa as createValuesTransformer,J as emptyCheckpoint,Ga as entrypoint,aa as filterLifecycleEntries,da as filterSubgraphHandles,V as getConfig,W as getCurrentTaskInput,oa as getJsonSchemaFromSchema,Ha as getPreviousState,pa as getSchemaDefaultGetter,T as getStore,H as getSubgraphsSeenSet,U as getWriter,ka as interrupt,Z as isCheckpointEnvelope,j as isCommand,w as isGraphBubbleUp,p as isGraphDrained,x as isGraphInterrupt,h as isInterrupted,ga as isNativeTransformer,t as isNodeError,z as isNodeTimeoutError,v as isParentCommand,na as isSerializableSchema,ma as isStandardSchema,ya as messagesDeltaReducer,xa as messagesStateReducer,Ea as pushMessage,Fa as task,La as writer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as f}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as f}from"./S2BGAMSA.js";import{a as l}from"./FWRSYP3I.js";import{Ic as o}from"./DG6DAKQ2.js";var i=a=>{let r=a.map?.allLayers.filter(t=>t.type==="feature"),e=0;return r?.forEach(t=>{let s=t;s.featureEffect&&(s.featureEffect=null,e++)}),e>0?`Cleared filters from ${e} layer(s). View unchanged.`:"No active filters to clear. View unchanged."},n=async(a,r)=>{let{mapView:e}=f(r,["mapView"]);return i(e)},h=o(n,{name:"clearFilters",description:"Clears all feature effects/filters from the map but does NOT change the current view. Use when user says 'clear filters', 'reset filters', 'remove filters', 'show all features', or wants to remove emphasis without navigating anywhere.",schema:l.object({})});export{h as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as R}from"./LO5EMUCP.js";import"./JUWVKK6D.js";import"./43ILIBJ6.js";import{K as c,L as d,M as S,N as F,O as V,S as M,h as C,j as l,w as y}from"./XU6YAW25.js";import"./BVUCNXC5.js";export default $arcgis.t(([T,I,b,x,P,g,h,N,m,u,w,v,D,O,G,z,j,k,W,B,J])=>{var U=C`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`,L=class{constructor(e){this.outerRing=[[180,-90],[-180,-90],[-180,90],[180,90],[180,-90]],this.map=e}init(){this.maskSymbol=new k({color:[0,0,0,.5],outline:{color:[128,128,128,.5],width:"0px"}}),this.maskLayer=new v({id:"maskLayer "}),this.overlapLayer=new v({id:"overlapLayer"}),this.map?.add(this.maskLayer),this.map?.add(this.overlapLayer)}hide(){this.maskLayer.visible=!1}show(){this.maskLayer.visible=!0}add(e,t){let i=this.buildGraphic(e,t);if(i)return i.graphic&&this.maskLayer?.add(i.graphic),i}update(e,t,i){i?this.remove(null,i):this.clear();let a=this.buildGraphic(e,t);if(a)return a.graphic&&this.maskLayer?.add(a.graphic),a}clear(){this.maskLayer?.removeAll()}remove(e,t){!e&&!t||(t&&!e&&(e=this.maskLayer?.graphics.getItemAt(t)),e&&this.maskLayer?.remove(e))}buildGraphic(e,t=this.maskSymbol){let i={};if(!e)return i;if(e.type==="extent"&&e.xmax===e.xmin){let o=new h({rings:[this.outerRing]});return i.graphic=new u({geometry:o,symbol:t}),i}e=this.toWGS84(e);let a,s;if(e.type==="extent"){let o=this.checkPolyOverlap(e);o?(a=o?.ring?.reverse(),s=o?.oring?.reverse()):a=[[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin],[e.xmin,e.ymax]]}let r=[];e.xmin===e.xmax?r=[this.outerRing]:r=[this.outerRing,a?.reverse()||[[]]];let n=new h({rings:r});return s&&(i.overlap=s),i.graphic=new u({geometry:n,symbol:t}),i}checkPolyOverlap(e){let t={};if(e.xmax<=e.xmin){let i=[[e.xmin,e.ymin],[180,e.ymin],[180,e.ymax],[e.xmin,e.ymax],[e.xmin,e.ymin]],a=[[-180,e.ymin],[e.xmax,e.ymin],[e.xmax,e.ymax],[-180,e.ymax],[-180,e.ymin]],s=180-Math.abs(e.xmax),r=180-Math.abs(e.xmin);return s>r?(t.ring=a,t.oring=i):(t.ring=i,t.oring=a),t}else return}toWGS84(e){let t=new N({wkid:4326});return m.canProject(e,t)?m.project(e,t):e}};function q(p){if(!p)return;let e=b.assetsPath;e.endsWith("/")||(e+="/"),p?.firstElementChild?.insertAdjacentHTML("beforebegin",`<link rel="stylesheet" href="${e}esri/themes/light/main.css" />`)}var $=class extends S{constructor(){super(...arguments),this.polygonSymbol=new k({style:"solid",color:new I([227,139,79,0]),outline:{color:new I([65,105,255]),width:0}}),this.dlOverlapSymbol=new k({style:"solid",color:[255,0,0,.5],outline:{color:[65,105,255],width:0}}),this.messages=R(),this.searchContainer=c(),this.mapContainer=c(),this.topCoordField=c(),this.bottomCoordField=c(),this.leftCoordField=c(),this.rightCoordField=c(),this.minLatLabel="",this.maxLatLabel="",this.minLngLabel="",this.maxLngLabel="",this.ymax="0",this.ymin="0",this.xmin="0",this.xmax="0",this.isDrawStart=!1,this.loading=!0,this.active=!1,this.contentOnly=!1,this.isArea=!1,this.arcgisExtentPickerChange=y(),this.arcgisExtentPickerClose=y(),this.arcgisExtentPickerSave=y()}static{this.properties={ymax:16,ymin:16,xmin:16,xmax:16,isDrawStart:16,loading:16,featureExtent:16,initialValue:16,active:5,extentValue:0,itemId:1,portal:0,extentService:1,contentOnly:5,isArea:5}}static{this.styles=U}getExtent(){return this.getExtentValue()}async load(){if(this.itemId){if(this.portal){let t=this.portal.url.replace("/sharing/rest/","");t!==b.portalUrl&&(b.portalUrl=t)}let e=new Intl.NumberFormat(w.getLocale(),{minimumFractionDigits:1,maximumFractionDigits:1});this.minLatLabel=e.format(-90),this.maxLatLabel=e.format(90),this.minLngLabel=e.format(-180),this.maxLngLabel=e.format(180),this.item=new z({id:this.itemId,portal:this.portal}),await this.item.load()}if(this.portal&&(this.orgExtent=this.portal.defaultExtent?.toJSON()),this.portal?.region){let e=this.portal.region,t=await j(`${this.portal.url.replace("/sharing/rest/","")}/sharing/rest/portals/self?region=${e}&default=true&f=pjson`,{responseType:"json"});this.orgRegionExtent=t.data.defaultExtent}}async loaded(){q(this.el.shadowRoot),await this.initMap()}convertToNumber(e){return this.parseNumber(e)}setFeatureExtent(e){let t;e.spatialReference.isGeographic?t=new x({xmax:e.xmax,xmin:e.xmin,ymax:e.ymax,ymin:e.ymin,spatialReference:{wkid:4326}}):t=this.toWGS84(e),this.featureExtent?(this.featureExtent.xmin=Math.min(t.xmin,this.featureExtent.xmin),this.featureExtent.ymin=Math.min(t.ymin,this.featureExtent.ymin),this.featureExtent.xmax=Math.max(t.xmax,this.featureExtent.xmax),this.featureExtent.ymax=Math.max(t.ymax,this.featureExtent.ymax)):this.featureExtent=t}async initMap(){let e=new G({basemap:"streets-vector"});if(this.extentService){let t=new O({url:this.extentService}),i=new T({baseLayers:[t],id:"org_basemap"});e.basemap=i}if(this.mask=new L(e),this.mask.init(),this.dateLineLayer=new v({id:"dateLineLayer"}),e.add(this.dateLineLayer),this.areasLayer=new v({id:"areaGraphics"}),e.add(this.areasLayer),this.item?.type==="Feature Service"||this.item?.type==="Map Service"){let t=await D.fromPortalItem({portalItem:this.item});t.visible=!1,e.add(t),t.when(i=>{if("layers"in i)for(let a=0;a<i.layers.length;a++)i.layers.getItemAt(a).queryExtent().then(s=>{s.extent&&this.setFeatureExtent(s.extent)});else i.queryExtent().then(a=>{a.extent&&this.setFeatureExtent(a.extent)})})}this.view=new W({map:e,popup:{dockEnabled:!0,dockOptions:{buttonEnabled:!1,breakpoint:!1,position:"bottom-center"}},zoom:2,center:[0,0],container:this.mapContainer.value}),this.view.when(async()=>{if(this.basemapExtent=this.getBasemapExtent(),this.itemExtent=this.item?.extent,this.extentValue?.xmax!==void 0&&this.extentValue?.xmin!==void 0&&this.extentValue?.ymax!==void 0&&this.extentValue?.ymin!==void 0)this.ymin=this.extentValue?.ymin||"0",this.ymax=this.extentValue?.ymax||"0",this.xmax=this.extentValue?.xmax||"0",this.xmin=this.extentValue?.xmin||"0",this.handleInputChange(),this.initialValue=this.currentExtent;else if(this.itemExtent)await this.drawExtent(this.itemExtent),this.initialValue=this.itemExtent;else if(this.featureExtent)await this.drawExtent(this.featureExtent),this.initialValue=this.featureExtent;else if(this.portal?.defaultExtent){let t=this.portal.defaultExtent.toJSON();await this.drawExtent(t),this.initialValue=t}this.initSearchWidget(),this.loading=!1})}getBasemapExtent(){try{let e,t,i,a;if(this.view?.map?.basemap?.hasOwnProperty("baseLayers")){let s=this.view.map.basemap.baseLayers;if(s.length>0){for(let r of s){let n=r.fullExtent||{xmin:0,ymin:0,xmax:0,ymax:0};e=e!==void 0&&e>n?.xmin?e:n.xmin,i=i!==void 0&&i>n?.ymin?i:n.ymin,t=t!==void 0&&t<n.xmax?t:n.xmax,a=a!==void 0&&a<n.ymax?a:n.ymax}return new x({xmin:e,xmax:t,ymin:i,ymax:a,spatialReference:this.view.spatialReference})}}return new x({ymin:-90,ymax:90,xmin:-180,xmax:180,spatialReference:{wkid:4326}})}catch{return new x({ymin:-90,ymax:90,xmin:-180,xmax:180,spatialReference:{wkid:4326}})}}async drawExtent(e){if(!e||!e.xmin&&e.xmin!==0||!e.xmax&&e.xmax!==0||!e.ymin&&e.ymin!==0||!e.ymax&&e.ymax!==0)return;let t=new h;t.spatialReference=e.spatialReference,t.addRing([new g({x:e.xmin,y:e.ymin}),new g({x:e.xmin,y:e.ymax}),new g({x:e.xmax,y:e.ymax}),new g({x:e.xmax,y:e.ymin}),new g({x:e.xmin,y:e.ymin})]),await this.addInitialExtentPicker({geometry:t})}toWGS84(e){let t=new N({wkid:4326});return m.canProject(e,t)?m.project(e,t):e}formatNum(e){return w.formatNumber(e,{minimumFractionDigits:6,maximumFractionDigits:6})}strippedInvalidChars(e){let t=Array.from({length:10},(i,a)=>a.toString()).join("");return Array.from(e).filter(i=>t.includes(i)||i==="."||i==="-").join("")}parseNumber(e){let t=e.replace(",",".");return t=this.strippedInvalidChars(t),parseFloat(t)}async startupSketching(e,t){if(e&&(e=this.toMap(e)),this.sketchViewModel=new J({updateOnGraphicClick:!1,layer:this.areasLayer,view:this.view,polygonSymbol:this.polygonSymbol}),this.clearAllGraphics(),!t)if(e){e.type==="extent"&&(e=h.fromExtent(e)),this.currentExtent=this.toWGS84(e?.extent?.toJSON()),this.ymax=this.formatNum(this.currentExtent.ymax),this.ymin=this.formatNum(this.currentExtent.ymin),this.xmin=this.formatNum(this.currentExtent.xmin),this.xmax=this.formatNum(this.currentExtent.xmax),this.arcgisExtentPickerChange.emit(this.getExtentValue()),e=P.intersect(e,this.basemapExtent);let i=new u({symbol:this.polygonSymbol,geometry:e});i.geometry&&(this.fallbackExtent=i.geometry.extent,this.areasLayer?.add(i),this.mask?.clear(),this.mask?.update(i.geometry.extent),await this.zoomTo(),setTimeout(async()=>{try{i.layer&&await this.sketchViewModel?.update([i],{tool:"transform",enableRotation:!1,toggleToolOnClick:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!1}})}catch{}},0))}else this.sketchViewModel.create("rectangle");this.addSketchListeners()}addSketchListeners(){this.sketchViewModel?.on("update",async e=>{if(!e.toolEventInfo)return;let t=e?.graphics?.[0]?.geometry?.extent,i=t&&this.mask?.update(t);if(e.toolEventInfo.type==="scale-stop"||e.toolEventInfo.type==="move-stop"){let a,s=parseFloat(`${t?.xmax??"0"}`).toFixed(6),r=parseFloat(`${t?.xmin??"0"}`).toFixed(6),n=parseFloat(`${t?.ymax??"0"}`).toFixed(6),o=parseFloat(`${t?.ymin??"0"}`).toFixed(6);if(s===r||n===o?(a=t,s===r&&(a.xmax+=1),n===o&&(a.ymax+=1)):a=e?.graphics?.[0]?.geometry?.extent,i?.overlap){let E=i.graphic?.geometry,A=new h({rings:[E?.rings[1]]});await this.addInitialExtentPicker({geometry:A.extent})}else await this.startupSketching(a);this.isDrawStart=!1}else if(this.dateLineLayer?.removeAll(),i?.overlap){let a=new u({geometry:new h({rings:[i.overlap]}),symbol:this.dlOverlapSymbol});this.dateLineLayer?.add(a)}}),this.sketchViewModel?.on("create",async e=>{if(this.dateLineLayer?.removeAll(),!e.graphic)return;this.mask?.clear();let t=e?.graphic?.geometry?.extent,i=this.mask?.add(t);if(i?.overlap?(this.remainderPoly=new u({geometry:new h({rings:[i.overlap]}),symbol:this.dlOverlapSymbol}),this.dateLineLayer?.add(this.remainderPoly)):this.remainderPoly=null,e.state==="complete"){let a,s=e.graphic?.geometry?.extent?.xmin||0,r=e.graphic?.geometry?.extent?.xmax||0,n=e.graphic?.geometry?.extent?.ymin||0,o=e.graphic?.geometry?.extent?.ymax||0;if(s===r||n===o)s===r&&(r=r+1),n===o&&(o=o+1),a=new x({xmin:s,xmax:r,ymin:n,ymax:o,spatialReference:e.graphic?.geometry?.extent?.spatialReference});else{let E=i?.graphic?.geometry;a=new h({rings:[E?.rings[1]]}).extent}this.remainderPoly?await this.addInitialExtentPicker({geometry:a}):await this.startupSketching(a),this.isDrawStart=!1,this.mapContainer.value.focus()}})}async addInitialExtentPicker(e){if(!e.geometry){await this.startupSketching(null,!0);return}let t=this.toMap(e.geometry);await this.startupSketching(t)}async zoomTo(){if(this.areasLayer?.graphics){let e;if(this.areasLayer.graphics.forEach(i=>{let a=i?.geometry?.extent;e=e?e.union(a):a}),!e)return;let t=this.toMap(x.fromJSON(e.toJSON()).expand(1.35));t&&await this.view?.goTo(t)}}clearAllGraphics(){this.sketchViewModel?.cancel(),this.view?.map?.layers?.forEach(e=>{e.type==="graphics"&&e.removeAll()})}toMap(e){return this.view&&m.canProject(e,this.view)?m.project(e,this.view.spatialReference):e}initSearchWidget(){let e=new B({view:this.view,popupEnabled:!1,resultGraphicEnabled:!1,container:this.searchContainer.value}),t=e.viewModel;e.viewModel.allSources.on("change",()=>{t.allSources.forEach(i=>{i.zoomScale=null})}),e.on("select-result",i=>{this.startupSketching(i.result.extent)})}getExtentValue(){return{extent:{ymin:this.normalizeDecimal(this.ymin),ymax:this.normalizeDecimal(this.ymax),xmin:this.normalizeDecimal(this.xmin),xmax:this.normalizeDecimal(this.xmax)}}}handleInputChange(){let e=this.parseNumber(this.ymin),t=this.parseNumber(this.ymax),i=this.parseNumber(this.xmin),a=this.parseNumber(this.xmax),s=new x({spatialReference:{wkid:4326},xmin:i,xmax:a,ymin:e,ymax:t});this.currentExtent=s,this.drawExtent(s)}handleSave(){if(!this.topCoordField.value.isValid()){this.topCoordField.value.setFocus();return}if(!this.bottomCoordField.value.isValid()){this.bottomCoordField.value.setFocus();return}if(!this.leftCoordField.value.isValid()){this.leftCoordField.value.setFocus();return}if(!this.rightCoordField.value.isValid()){this.rightCoordField.value.setFocus();return}this.arcgisExtentPickerSave.emit(this.getExtentValue())}normalizeDecimal(e){return e.replace(",",".")}formatLongitudeError(e){return e.replace("${minLng}",this.minLngLabel).replace("${maxLng}",this.maxLngLabel)}formatLatitudeError(e){return e.replace("${minLat}",this.minLatLabel).replace("${maxLat}",this.maxLatLabel)}async timeout(e){return await new Promise(t=>setTimeout(t,e))}renderModal(){return l`<calcite-dialog class="extent-picker-modal" role=dialog scale=l outside-close-disabled .open=${this.active} placement=cover @calciteDialogClose=${()=>{this.arcgisExtentPickerClose.emit()}} style=${V({"--calcite-dialog-content-space":"0"})} .heading=${this.isArea?this.messages.setArea:this.messages.setExtent} heading-level=3><div class="extent-picker-content">${this.renderContent()}</div>${this.initialValue&&l`<calcite-button appearance=outline slot=footer-start icon-start=reset @click=${async()=>{if(this.initialValue){let e=+this.ymin===f(this.initialValue.ymin)&&+this.ymax===f(this.initialValue.ymax);+this.xmin===f(this.initialValue.xmin)&&+this.xmax===f(this.initialValue.xmax)&&e&&(this.ymin="0",this.ymax="0",this.xmin="0",this.xmax="0",await this.timeout(100)),this.drawExtent(this.initialValue)}}}>${this.messages.revert}</calcite-button>`||""}<calcite-button appearance=outline slot=footer-end @click=${()=>this.arcgisExtentPickerClose.emit()}>${this.messages.cancel}</calcite-button><calcite-button slot=footer-end @click=${async()=>this.handleSave()}>${this.messages.save}</calcite-button></calcite-dialog>`}renderContent(){let e=!!(this.portal&&!this.portal.id),t=!!(this.orgExtent&&!e),i=!!(this.orgRegionExtent&&!e),a=!!this.featureExtent;return l`<div class="side-panel">${!(!t&&!i&&!a)&&l`<div>${this.isArea?this.messages.areaBasedOn:this.messages.extentBasedOn}</div>${t&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${()=>{this.drawExtent(this.orgExtent)}}>${this.messages.orgExtent}</calcite-button>`||""}${i&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${()=>{this.drawExtent(this.orgRegionExtent)}}>${this.messages.orgRegion}</calcite-button>`||""}${a&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=feature-layer @click=${()=>{this.drawExtent(this.featureExtent)}}>${this.messages.currentFeatures}</calcite-button>`||""}`||""}<div class="use-location-header">${this.messages.useLocation}</div><div class="search-container"><div ${d(this.searchContainer)}></div></div><div><div class="use-location-header">${this.isArea?this.messages.drawAreaTitle:this.messages.drawExtentTitle}</div><calcite-action .text=${(this.isArea?this.messages.drawArea:this.messages.drawExtent)||""} text-enabled icon=rectangle-plus .active=${this.isDrawStart} .indicator=${this.isDrawStart} @click=${async()=>{this.isDrawStart=!this.isDrawStart,this.isDrawStart?(this.sketchViewModel||await this.startupSketching(),this.clearAllGraphics(),this.sketchViewModel?.create("rectangle")):(this.sketchViewModel?.cancel(),this.startupSketching(this.fallbackExtent))}}></calcite-action></div><div class="coordinates-section"><calcite-accordion appearance=transparent icon-position=start scale=l><calcite-accordion-item .heading=${this.messages.coordinates}><p>${this.messages.coordinatesDescription}</p><arcgis-portal-extent-picker-coord-field input-id=top-coord .label=${this.messages.top} .value=${this.strippedInvalidChars(this.ymax)} .errorMessage=${this.formatLatitudeError(this.messages.invalidTop||"")} min=-90 max=90 @arcgisCoordChange=${s=>{this.ymax=s.detail;let r=this.bottomCoordField.value.checkRelatedField();r&&(this.ymin=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.topGreaterThanBottom} .validateRelated=${s=>s>this.convertToNumber(this.ymin)} ${d(this.topCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=bottom-coord .label=${this.messages.bottom} .value=${this.strippedInvalidChars(this.ymin)} .errorMessage=${this.formatLatitudeError(this.messages.invalidBottom||"")} min=-90 max=90 @arcgisCoordChange=${s=>{this.ymin=s.detail;let r=this.topCoordField.value.checkRelatedField();r&&(this.ymax=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.bottomLessThanTop} .validateRelated=${s=>s<this.convertToNumber(this.ymax)} ${d(this.bottomCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=left-coord .label=${this.messages.left} .value=${this.strippedInvalidChars(this.xmin)} .errorMessage=${this.formatLongitudeError(this.messages.invalidLeft||"")} min=-180 max=180 @arcgisCoordChange=${s=>{this.xmin=s.detail;let r=this.rightCoordField.value.checkRelatedField();r&&(this.xmax=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.leftLessThanRight} .validateRelated=${s=>s<this.convertToNumber(this.xmax)} ${d(this.leftCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=right-coord .label=${this.messages.right} .value=${this.strippedInvalidChars(this.xmax)} .errorMessage=${this.formatLongitudeError(this.messages.invalidRight||"")} min=-180 max=180 @arcgisCoordChange=${s=>{this.xmax=s.detail;let r=this.leftCoordField.value.checkRelatedField();r&&(this.xmin=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.rightGreaterThanLeft} .validateRelated=${s=>s>this.convertToNumber(this.xmin)} ${d(this.rightCoordField)}></arcgis-portal-extent-picker-coord-field></calcite-accordion-item></calcite-accordion></div></div><div class="map-panel">${this.loading&&l`<calcite-loader class="map-loader" label="Loading the application"></calcite-loader>`||""}<div class=${F({"map-container":!0,"map-container--loaded":!this.loading})} ${d(this.mapContainer)}></div></div>`}render(){return this.contentOnly?l`<div class="extent-picker-content">${this.renderContent()}</div>`:this.renderModal()}};function f(p){return Math.round(p*1e6)/1e6}M("arcgis-portal-extent-picker",$);return $},"Basemap","Color","config","geometry/Extent","geometry/geometryEngine","geometry/Point","geometry/Polygon","geometry/SpatialReference","geometry/support/webMercatorUtils","Graphic","intl","layers/GraphicsLayer","layers/Layer","layers/TileLayer","Map","portal/PortalItem","request","symbols/SimpleFillSymbol","views/MapView","widgets/Search","widgets/Sketch/SketchViewModel")
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as R}from"./ACCEI7S4.js";import"./S7IRYX4A.js";import"./VJ4STLVD.js";import{K as c,L as d,M as S,N as F,O as V,S as M,h as C,j as l,w as y}from"./4PPXBKIJ.js";import"./UZLQALHY.js";export default $arcgis.t(([T,I,b,x,P,g,h,N,m,u,w,v,D,O,G,z,j,k,W,B,J])=>{var U=C`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`,L=class{constructor(e){this.outerRing=[[180,-90],[-180,-90],[-180,90],[180,90],[180,-90]],this.map=e}init(){this.maskSymbol=new k({color:[0,0,0,.5],outline:{color:[128,128,128,.5],width:"0px"}}),this.maskLayer=new v({id:"maskLayer "}),this.overlapLayer=new v({id:"overlapLayer"}),this.map?.add(this.maskLayer),this.map?.add(this.overlapLayer)}hide(){this.maskLayer.visible=!1}show(){this.maskLayer.visible=!0}add(e,t){let i=this.buildGraphic(e,t);if(i)return i.graphic&&this.maskLayer?.add(i.graphic),i}update(e,t,i){i?this.remove(null,i):this.clear();let a=this.buildGraphic(e,t);if(a)return a.graphic&&this.maskLayer?.add(a.graphic),a}clear(){this.maskLayer?.removeAll()}remove(e,t){!e&&!t||(t&&!e&&(e=this.maskLayer?.graphics.getItemAt(t)),e&&this.maskLayer?.remove(e))}buildGraphic(e,t=this.maskSymbol){let i={};if(!e)return i;if(e.type==="extent"&&e.xmax===e.xmin){let o=new h({rings:[this.outerRing]});return i.graphic=new u({geometry:o,symbol:t}),i}e=this.toWGS84(e);let a,s;if(e.type==="extent"){let o=this.checkPolyOverlap(e);o?(a=o?.ring?.reverse(),s=o?.oring?.reverse()):a=[[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin],[e.xmin,e.ymax]]}let r=[];e.xmin===e.xmax?r=[this.outerRing]:r=[this.outerRing,a?.reverse()||[[]]];let n=new h({rings:r});return s&&(i.overlap=s),i.graphic=new u({geometry:n,symbol:t}),i}checkPolyOverlap(e){let t={};if(e.xmax<=e.xmin){let i=[[e.xmin,e.ymin],[180,e.ymin],[180,e.ymax],[e.xmin,e.ymax],[e.xmin,e.ymin]],a=[[-180,e.ymin],[e.xmax,e.ymin],[e.xmax,e.ymax],[-180,e.ymax],[-180,e.ymin]],s=180-Math.abs(e.xmax),r=180-Math.abs(e.xmin);return s>r?(t.ring=a,t.oring=i):(t.ring=i,t.oring=a),t}else return}toWGS84(e){let t=new N({wkid:4326});return m.canProject(e,t)?m.project(e,t):e}};function q(p){if(!p)return;let e=b.assetsPath;e.endsWith("/")||(e+="/"),p?.firstElementChild?.insertAdjacentHTML("beforebegin",`<link rel="stylesheet" href="${e}esri/themes/light/main.css" />`)}var $=class extends S{constructor(){super(...arguments),this.polygonSymbol=new k({style:"solid",color:new I([227,139,79,0]),outline:{color:new I([65,105,255]),width:0}}),this.dlOverlapSymbol=new k({style:"solid",color:[255,0,0,.5],outline:{color:[65,105,255],width:0}}),this.messages=R(),this.searchContainer=c(),this.mapContainer=c(),this.topCoordField=c(),this.bottomCoordField=c(),this.leftCoordField=c(),this.rightCoordField=c(),this.minLatLabel="",this.maxLatLabel="",this.minLngLabel="",this.maxLngLabel="",this.ymax="0",this.ymin="0",this.xmin="0",this.xmax="0",this.isDrawStart=!1,this.loading=!0,this.active=!1,this.contentOnly=!1,this.isArea=!1,this.arcgisExtentPickerChange=y(),this.arcgisExtentPickerClose=y(),this.arcgisExtentPickerSave=y()}static{this.properties={ymax:16,ymin:16,xmin:16,xmax:16,isDrawStart:16,loading:16,featureExtent:16,initialValue:16,active:5,extentValue:0,itemId:1,portal:0,extentService:1,contentOnly:5,isArea:5}}static{this.styles=U}getExtent(){return this.getExtentValue()}async load(){if(this.itemId){if(this.portal){let t=this.portal.url.replace("/sharing/rest/","");t!==b.portalUrl&&(b.portalUrl=t)}let e=new Intl.NumberFormat(w.getLocale(),{minimumFractionDigits:1,maximumFractionDigits:1});this.minLatLabel=e.format(-90),this.maxLatLabel=e.format(90),this.minLngLabel=e.format(-180),this.maxLngLabel=e.format(180),this.item=new z({id:this.itemId,portal:this.portal}),await this.item.load()}if(this.portal&&(this.orgExtent=this.portal.defaultExtent?.toJSON()),this.portal?.region){let e=this.portal.region,t=await j(`${this.portal.url.replace("/sharing/rest/","")}/sharing/rest/portals/self?region=${e}&default=true&f=pjson`,{responseType:"json"});this.orgRegionExtent=t.data.defaultExtent}}async loaded(){q(this.el.shadowRoot),await this.initMap()}convertToNumber(e){return this.parseNumber(e)}setFeatureExtent(e){let t;e.spatialReference.isGeographic?t=new x({xmax:e.xmax,xmin:e.xmin,ymax:e.ymax,ymin:e.ymin,spatialReference:{wkid:4326}}):t=this.toWGS84(e),this.featureExtent?(this.featureExtent.xmin=Math.min(t.xmin,this.featureExtent.xmin),this.featureExtent.ymin=Math.min(t.ymin,this.featureExtent.ymin),this.featureExtent.xmax=Math.max(t.xmax,this.featureExtent.xmax),this.featureExtent.ymax=Math.max(t.ymax,this.featureExtent.ymax)):this.featureExtent=t}async initMap(){let e=new G({basemap:"streets-vector"});if(this.extentService){let t=new O({url:this.extentService}),i=new T({baseLayers:[t],id:"org_basemap"});e.basemap=i}if(this.mask=new L(e),this.mask.init(),this.dateLineLayer=new v({id:"dateLineLayer"}),e.add(this.dateLineLayer),this.areasLayer=new v({id:"areaGraphics"}),e.add(this.areasLayer),this.item?.type==="Feature Service"||this.item?.type==="Map Service"){let t=await D.fromPortalItem({portalItem:this.item});t.visible=!1,e.add(t),t.when(i=>{if("layers"in i)for(let a=0;a<i.layers.length;a++)i.layers.getItemAt(a).queryExtent().then(s=>{s.extent&&this.setFeatureExtent(s.extent)});else i.queryExtent().then(a=>{a.extent&&this.setFeatureExtent(a.extent)})})}this.view=new W({map:e,popup:{dockEnabled:!0,dockOptions:{buttonEnabled:!1,breakpoint:!1,position:"bottom-center"}},zoom:2,center:[0,0],container:this.mapContainer.value}),this.view.when(async()=>{if(this.basemapExtent=this.getBasemapExtent(),this.itemExtent=this.item?.extent,this.extentValue?.xmax!==void 0&&this.extentValue?.xmin!==void 0&&this.extentValue?.ymax!==void 0&&this.extentValue?.ymin!==void 0)this.ymin=this.extentValue?.ymin||"0",this.ymax=this.extentValue?.ymax||"0",this.xmax=this.extentValue?.xmax||"0",this.xmin=this.extentValue?.xmin||"0",this.handleInputChange(),this.initialValue=this.currentExtent;else if(this.itemExtent)await this.drawExtent(this.itemExtent),this.initialValue=this.itemExtent;else if(this.featureExtent)await this.drawExtent(this.featureExtent),this.initialValue=this.featureExtent;else if(this.portal?.defaultExtent){let t=this.portal.defaultExtent.toJSON();await this.drawExtent(t),this.initialValue=t}this.initSearchWidget(),this.loading=!1})}getBasemapExtent(){try{let e,t,i,a;if(this.view?.map?.basemap?.hasOwnProperty("baseLayers")){let s=this.view.map.basemap.baseLayers;if(s.length>0){for(let r of s){let n=r.fullExtent||{xmin:0,ymin:0,xmax:0,ymax:0};e=e!==void 0&&e>n?.xmin?e:n.xmin,i=i!==void 0&&i>n?.ymin?i:n.ymin,t=t!==void 0&&t<n.xmax?t:n.xmax,a=a!==void 0&&a<n.ymax?a:n.ymax}return new x({xmin:e,xmax:t,ymin:i,ymax:a,spatialReference:this.view.spatialReference})}}return new x({ymin:-90,ymax:90,xmin:-180,xmax:180,spatialReference:{wkid:4326}})}catch{return new x({ymin:-90,ymax:90,xmin:-180,xmax:180,spatialReference:{wkid:4326}})}}async drawExtent(e){if(!e||!e.xmin&&e.xmin!==0||!e.xmax&&e.xmax!==0||!e.ymin&&e.ymin!==0||!e.ymax&&e.ymax!==0)return;let t=new h;t.spatialReference=e.spatialReference,t.addRing([new g({x:e.xmin,y:e.ymin}),new g({x:e.xmin,y:e.ymax}),new g({x:e.xmax,y:e.ymax}),new g({x:e.xmax,y:e.ymin}),new g({x:e.xmin,y:e.ymin})]),await this.addInitialExtentPicker({geometry:t})}toWGS84(e){let t=new N({wkid:4326});return m.canProject(e,t)?m.project(e,t):e}formatNum(e){return w.formatNumber(e,{minimumFractionDigits:6,maximumFractionDigits:6})}strippedInvalidChars(e){let t=Array.from({length:10},(i,a)=>a.toString()).join("");return Array.from(e).filter(i=>t.includes(i)||i==="."||i==="-").join("")}parseNumber(e){let t=e.replace(",",".");return t=this.strippedInvalidChars(t),parseFloat(t)}async startupSketching(e,t){if(e&&(e=this.toMap(e)),this.sketchViewModel=new J({updateOnGraphicClick:!1,layer:this.areasLayer,view:this.view,polygonSymbol:this.polygonSymbol}),this.clearAllGraphics(),!t)if(e){e.type==="extent"&&(e=h.fromExtent(e)),this.currentExtent=this.toWGS84(e?.extent?.toJSON()),this.ymax=this.formatNum(this.currentExtent.ymax),this.ymin=this.formatNum(this.currentExtent.ymin),this.xmin=this.formatNum(this.currentExtent.xmin),this.xmax=this.formatNum(this.currentExtent.xmax),this.arcgisExtentPickerChange.emit(this.getExtentValue()),e=P.intersect(e,this.basemapExtent);let i=new u({symbol:this.polygonSymbol,geometry:e});i.geometry&&(this.fallbackExtent=i.geometry.extent,this.areasLayer?.add(i),this.mask?.clear(),this.mask?.update(i.geometry.extent),await this.zoomTo(),setTimeout(async()=>{try{i.layer&&await this.sketchViewModel?.update([i],{tool:"transform",enableRotation:!1,toggleToolOnClick:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!1}})}catch{}},0))}else this.sketchViewModel.create("rectangle");this.addSketchListeners()}addSketchListeners(){this.sketchViewModel?.on("update",async e=>{if(!e.toolEventInfo)return;let t=e?.graphics?.[0]?.geometry?.extent,i=t&&this.mask?.update(t);if(e.toolEventInfo.type==="scale-stop"||e.toolEventInfo.type==="move-stop"){let a,s=parseFloat(`${t?.xmax??"0"}`).toFixed(6),r=parseFloat(`${t?.xmin??"0"}`).toFixed(6),n=parseFloat(`${t?.ymax??"0"}`).toFixed(6),o=parseFloat(`${t?.ymin??"0"}`).toFixed(6);if(s===r||n===o?(a=t,s===r&&(a.xmax+=1),n===o&&(a.ymax+=1)):a=e?.graphics?.[0]?.geometry?.extent,i?.overlap){let E=i.graphic?.geometry,A=new h({rings:[E?.rings[1]]});await this.addInitialExtentPicker({geometry:A.extent})}else await this.startupSketching(a);this.isDrawStart=!1}else if(this.dateLineLayer?.removeAll(),i?.overlap){let a=new u({geometry:new h({rings:[i.overlap]}),symbol:this.dlOverlapSymbol});this.dateLineLayer?.add(a)}}),this.sketchViewModel?.on("create",async e=>{if(this.dateLineLayer?.removeAll(),!e.graphic)return;this.mask?.clear();let t=e?.graphic?.geometry?.extent,i=this.mask?.add(t);if(i?.overlap?(this.remainderPoly=new u({geometry:new h({rings:[i.overlap]}),symbol:this.dlOverlapSymbol}),this.dateLineLayer?.add(this.remainderPoly)):this.remainderPoly=null,e.state==="complete"){let a,s=e.graphic?.geometry?.extent?.xmin||0,r=e.graphic?.geometry?.extent?.xmax||0,n=e.graphic?.geometry?.extent?.ymin||0,o=e.graphic?.geometry?.extent?.ymax||0;if(s===r||n===o)s===r&&(r=r+1),n===o&&(o=o+1),a=new x({xmin:s,xmax:r,ymin:n,ymax:o,spatialReference:e.graphic?.geometry?.extent?.spatialReference});else{let E=i?.graphic?.geometry;a=new h({rings:[E?.rings[1]]}).extent}this.remainderPoly?await this.addInitialExtentPicker({geometry:a}):await this.startupSketching(a),this.isDrawStart=!1,this.mapContainer.value.focus()}})}async addInitialExtentPicker(e){if(!e.geometry){await this.startupSketching(null,!0);return}let t=this.toMap(e.geometry);await this.startupSketching(t)}async zoomTo(){if(this.areasLayer?.graphics){let e;if(this.areasLayer.graphics.forEach(i=>{let a=i?.geometry?.extent;e=e?e.union(a):a}),!e)return;let t=this.toMap(x.fromJSON(e.toJSON()).expand(1.35));t&&await this.view?.goTo(t)}}clearAllGraphics(){this.sketchViewModel?.cancel(),this.view?.map?.layers?.forEach(e=>{e.type==="graphics"&&e.removeAll()})}toMap(e){return this.view&&m.canProject(e,this.view)?m.project(e,this.view.spatialReference):e}initSearchWidget(){let e=new B({view:this.view,popupEnabled:!1,resultGraphicEnabled:!1,container:this.searchContainer.value}),t=e.viewModel;e.viewModel.allSources.on("change",()=>{t.allSources.forEach(i=>{i.zoomScale=null})}),e.on("select-result",i=>{this.startupSketching(i.result.extent)})}getExtentValue(){return{extent:{ymin:this.normalizeDecimal(this.ymin),ymax:this.normalizeDecimal(this.ymax),xmin:this.normalizeDecimal(this.xmin),xmax:this.normalizeDecimal(this.xmax)}}}handleInputChange(){let e=this.parseNumber(this.ymin),t=this.parseNumber(this.ymax),i=this.parseNumber(this.xmin),a=this.parseNumber(this.xmax),s=new x({spatialReference:{wkid:4326},xmin:i,xmax:a,ymin:e,ymax:t});this.currentExtent=s,this.drawExtent(s)}handleSave(){if(!this.topCoordField.value.isValid()){this.topCoordField.value.setFocus();return}if(!this.bottomCoordField.value.isValid()){this.bottomCoordField.value.setFocus();return}if(!this.leftCoordField.value.isValid()){this.leftCoordField.value.setFocus();return}if(!this.rightCoordField.value.isValid()){this.rightCoordField.value.setFocus();return}this.arcgisExtentPickerSave.emit(this.getExtentValue())}normalizeDecimal(e){return e.replace(",",".")}formatLongitudeError(e){return e.replace("${minLng}",this.minLngLabel).replace("${maxLng}",this.maxLngLabel)}formatLatitudeError(e){return e.replace("${minLat}",this.minLatLabel).replace("${maxLat}",this.maxLatLabel)}async timeout(e){return await new Promise(t=>setTimeout(t,e))}renderModal(){return l`<calcite-dialog class="extent-picker-modal" role=dialog scale=l outside-close-disabled .open=${this.active} placement=cover @calciteDialogClose=${()=>{this.arcgisExtentPickerClose.emit()}} style=${V({"--calcite-dialog-content-space":"0"})} .heading=${this.isArea?this.messages.setArea:this.messages.setExtent} heading-level=3><div class="extent-picker-content">${this.renderContent()}</div>${this.initialValue&&l`<calcite-button appearance=outline slot=footer-start icon-start=reset @click=${async()=>{if(this.initialValue){let e=+this.ymin===f(this.initialValue.ymin)&&+this.ymax===f(this.initialValue.ymax);+this.xmin===f(this.initialValue.xmin)&&+this.xmax===f(this.initialValue.xmax)&&e&&(this.ymin="0",this.ymax="0",this.xmin="0",this.xmax="0",await this.timeout(100)),this.drawExtent(this.initialValue)}}}>${this.messages.revert}</calcite-button>`||""}<calcite-button appearance=outline slot=footer-end @click=${()=>this.arcgisExtentPickerClose.emit()}>${this.messages.cancel}</calcite-button><calcite-button slot=footer-end @click=${async()=>this.handleSave()}>${this.messages.save}</calcite-button></calcite-dialog>`}renderContent(){let e=!!(this.portal&&!this.portal.id),t=!!(this.orgExtent&&!e),i=!!(this.orgRegionExtent&&!e),a=!!this.featureExtent;return l`<div class="side-panel">${!(!t&&!i&&!a)&&l`<div>${this.isArea?this.messages.areaBasedOn:this.messages.extentBasedOn}</div>${t&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${()=>{this.drawExtent(this.orgExtent)}}>${this.messages.orgExtent}</calcite-button>`||""}${i&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${()=>{this.drawExtent(this.orgRegionExtent)}}>${this.messages.orgRegion}</calcite-button>`||""}${a&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=feature-layer @click=${()=>{this.drawExtent(this.featureExtent)}}>${this.messages.currentFeatures}</calcite-button>`||""}`||""}<div class="use-location-header">${this.messages.useLocation}</div><div class="search-container"><div ${d(this.searchContainer)}></div></div><div><div class="use-location-header">${this.isArea?this.messages.drawAreaTitle:this.messages.drawExtentTitle}</div><calcite-action .text=${(this.isArea?this.messages.drawArea:this.messages.drawExtent)||""} text-enabled icon=rectangle-plus .active=${this.isDrawStart} .indicator=${this.isDrawStart} @click=${async()=>{this.isDrawStart=!this.isDrawStart,this.isDrawStart?(this.sketchViewModel||await this.startupSketching(),this.clearAllGraphics(),this.sketchViewModel?.create("rectangle")):(this.sketchViewModel?.cancel(),this.startupSketching(this.fallbackExtent))}}></calcite-action></div><div class="coordinates-section"><calcite-accordion appearance=transparent icon-position=start scale=l><calcite-accordion-item .heading=${this.messages.coordinates}><p>${this.messages.coordinatesDescription}</p><arcgis-portal-extent-picker-coord-field input-id=top-coord .label=${this.messages.top} .value=${this.strippedInvalidChars(this.ymax)} .errorMessage=${this.formatLatitudeError(this.messages.invalidTop||"")} min=-90 max=90 @arcgisCoordChange=${s=>{this.ymax=s.detail;let r=this.bottomCoordField.value.checkRelatedField();r&&(this.ymin=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.topGreaterThanBottom} .validateRelated=${s=>s>this.convertToNumber(this.ymin)} ${d(this.topCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=bottom-coord .label=${this.messages.bottom} .value=${this.strippedInvalidChars(this.ymin)} .errorMessage=${this.formatLatitudeError(this.messages.invalidBottom||"")} min=-90 max=90 @arcgisCoordChange=${s=>{this.ymin=s.detail;let r=this.topCoordField.value.checkRelatedField();r&&(this.ymax=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.bottomLessThanTop} .validateRelated=${s=>s<this.convertToNumber(this.ymax)} ${d(this.bottomCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=left-coord .label=${this.messages.left} .value=${this.strippedInvalidChars(this.xmin)} .errorMessage=${this.formatLongitudeError(this.messages.invalidLeft||"")} min=-180 max=180 @arcgisCoordChange=${s=>{this.xmin=s.detail;let r=this.rightCoordField.value.checkRelatedField();r&&(this.xmax=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.leftLessThanRight} .validateRelated=${s=>s<this.convertToNumber(this.xmax)} ${d(this.leftCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=right-coord .label=${this.messages.right} .value=${this.strippedInvalidChars(this.xmax)} .errorMessage=${this.formatLongitudeError(this.messages.invalidRight||"")} min=-180 max=180 @arcgisCoordChange=${s=>{this.xmax=s.detail;let r=this.leftCoordField.value.checkRelatedField();r&&(this.xmin=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.rightGreaterThanLeft} .validateRelated=${s=>s>this.convertToNumber(this.xmin)} ${d(this.rightCoordField)}></arcgis-portal-extent-picker-coord-field></calcite-accordion-item></calcite-accordion></div></div><div class="map-panel">${this.loading&&l`<calcite-loader class="map-loader" label="Loading the application"></calcite-loader>`||""}<div class=${F({"map-container":!0,"map-container--loaded":!this.loading})} ${d(this.mapContainer)}></div></div>`}render(){return this.contentOnly?l`<div class="extent-picker-content">${this.renderContent()}</div>`:this.renderModal()}};function f(p){return Math.round(p*1e6)/1e6}M("arcgis-portal-extent-picker",$);return $},"Basemap","Color","config","geometry/Extent","geometry/geometryEngine","geometry/Point","geometry/Polygon","geometry/SpatialReference","geometry/support/webMercatorUtils","Graphic","intl","layers/GraphicsLayer","layers/Layer","layers/TileLayer","Map","portal/PortalItem","request","symbols/SimpleFillSymbol","views/MapView","widgets/Search","widgets/Sketch/SketchViewModel")
|