@arcgis/portal-components 5.2.0-next.138 → 5.2.0-next.139

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.
Files changed (247) hide show
  1. package/dist/cdn/{Z6R3C4AK.js → 23X56P4K.js} +2 -2
  2. package/dist/cdn/{VDXESPJK.js → 25XJ66JO.js} +2 -2
  3. package/dist/cdn/{EMJQI4MA.js → 2GBRZSEC.js} +1 -1
  4. package/dist/cdn/{LISDTBEX.js → 2I5SLQC5.js} +2 -2
  5. package/dist/cdn/{ZKZDKJ6D.js → 3R4PPD5N.js} +2 -2
  6. package/dist/cdn/3SO52LKS.js +2 -0
  7. package/dist/cdn/{SGDDFWCJ.js → 456JKNCU.js} +2 -2
  8. package/dist/cdn/{3CQKCUM5.js → 4SHXR62X.js} +2 -2
  9. package/dist/cdn/{ABORO35R.js → 4TQWZ2KF.js} +2 -2
  10. package/dist/cdn/{L64UURQB.js → 4ZTWQN6Q.js} +2 -2
  11. package/dist/cdn/{4TSXFX3M.js → 55FL7WQV.js} +2 -2
  12. package/dist/cdn/{ZDDN7UKS.js → 5EFYJYWM.js} +1 -1
  13. package/dist/cdn/{3EYB5GQX.js → 5FDUO7J4.js} +2 -2
  14. package/dist/cdn/{FIQZPIIK.js → 5FOWUL6I.js} +2 -2
  15. package/dist/cdn/{DAAON2UO.js → 5YDITHQA.js} +1 -1
  16. package/dist/cdn/{K2XSYDAP.js → 6BMWSGLA.js} +2 -2
  17. package/dist/cdn/{JIJO4CAS.js → 6EY5GHKE.js} +2 -2
  18. package/dist/cdn/6KVA4AKM.js +2 -0
  19. package/dist/cdn/6LST5YZY.js +2 -0
  20. package/dist/cdn/{JN23JH3T.js → 6MWSS5YF.js} +2 -2
  21. package/dist/cdn/{V6A6MKLU.js → 6TO2BYXU.js} +1 -1
  22. package/dist/cdn/{GSOBDGLK.js → 7NK6UF47.js} +2 -2
  23. package/dist/cdn/{I273CANO.js → 7NQY5QJK.js} +2 -2
  24. package/dist/cdn/7TGCBYRK.js +2 -0
  25. package/dist/cdn/{I6IRHXWR.js → ADZAKBOJ.js} +2 -2
  26. package/dist/cdn/{TLM457Z5.js → AE574B3G.js} +2 -2
  27. package/dist/cdn/AWCYG2JJ.js +2 -0
  28. package/dist/cdn/{OD5WXP7J.js → B3NVWHCS.js} +2 -2
  29. package/dist/cdn/BEAUY47J.js +2 -0
  30. package/dist/cdn/{PNIFJ5DQ.js → BIXJGL7B.js} +1 -1
  31. package/dist/cdn/{OXPXXIWL.js → BRJE3G3H.js} +2 -2
  32. package/dist/cdn/{A2SQ4EMZ.js → C5U7YKVI.js} +2 -2
  33. package/dist/cdn/C5VUNN4M.js +2 -0
  34. package/dist/cdn/{PKA745KL.js → CFBSBZSS.js} +1 -1
  35. package/dist/cdn/CJHR4UK5.js +2 -0
  36. package/dist/cdn/{7LMZHJZG.js → CVOWIH4J.js} +2 -2
  37. package/dist/cdn/{AICPYLWE.js → CWSEBETE.js} +3 -3
  38. package/dist/cdn/{DLI4XKJ3.js → D6QHNXEH.js} +2 -2
  39. package/dist/cdn/{YZTBAUIO.js → D7LRCAK4.js} +2 -2
  40. package/dist/cdn/DF5GVVDW.js +2 -0
  41. package/dist/cdn/{BKD7JSV2.js → DIKRXF22.js} +2 -2
  42. package/dist/cdn/{DDBXEXOV.js → DKIYHE4A.js} +2 -2
  43. package/dist/cdn/{GX7U3727.js → E3FQ4QWE.js} +2 -2
  44. package/dist/cdn/{ROX3GKKA.js → F3ODJVJC.js} +1 -1
  45. package/dist/cdn/{E3INH2O6.js → FEBUVUR5.js} +2 -2
  46. package/dist/cdn/{4QFTKB6T.js → FFLIAQOL.js} +2 -2
  47. package/dist/cdn/FQOOFBPI.js +2 -0
  48. package/dist/cdn/FQYC25GN.js +2 -0
  49. package/dist/cdn/{3LEQ37YT.js → FSACXOM3.js} +2 -2
  50. package/dist/cdn/{APSYZEPP.js → FTKD53UG.js} +2 -2
  51. package/dist/cdn/{TNUCSWBN.js → GEZH4D32.js} +2 -2
  52. package/dist/cdn/{5C5GHX4D.js → GTZ4LKEQ.js} +2 -2
  53. package/dist/cdn/{NRMQDCM3.js → GYA7R4F6.js} +2 -2
  54. package/dist/cdn/{4KTRAA2J.js → ILDTKRON.js} +1 -1
  55. package/dist/cdn/{YTODQCOG.js → J537SBGI.js} +2 -2
  56. package/dist/cdn/{3NSHGKZA.js → JUDF3TYJ.js} +2 -2
  57. package/dist/cdn/KC4FTTKP.js +2 -0
  58. package/dist/cdn/{OR6T5SB3.js → KIKEE2KY.js} +2 -2
  59. package/dist/cdn/{AXOBMX3S.js → KYNL256E.js} +2 -2
  60. package/dist/cdn/{32BWFMTC.js → LCO2BWDK.js} +2 -2
  61. package/dist/cdn/{5HZNBMW6.js → LNWWUPFK.js} +2 -2
  62. package/dist/cdn/{SVROAT3Z.js → LP4IB3PV.js} +2 -2
  63. package/dist/cdn/LRHPL6B5.js +2 -0
  64. package/dist/cdn/LYOR4B2O.js +2 -0
  65. package/dist/cdn/{LWFACY3F.js → MCX22B23.js} +2 -2
  66. package/dist/cdn/{GAF4YT5N.js → MQISQ7P3.js} +2 -2
  67. package/dist/cdn/MY7AYBBR.js +2 -0
  68. package/dist/cdn/{JPUUMGX5.js → NDRCB2K3.js} +2 -2
  69. package/dist/cdn/{NWVLGU2C.js → NICTB76A.js} +2 -2
  70. package/dist/cdn/{MKSFNVXL.js → NXFE6R2N.js} +2 -2
  71. package/dist/cdn/{CD5UWSCP.js → O5LFDRK2.js} +2 -2
  72. package/dist/cdn/{5PPZNVWG.js → ODH2VAWC.js} +2 -2
  73. package/dist/cdn/{TOICLGFK.js → OJNU7H3F.js} +2 -2
  74. package/dist/cdn/OKUI3HQ4.js +2 -0
  75. package/dist/cdn/{IN4JPZTY.js → OQGUCK3G.js} +2 -2
  76. package/dist/cdn/{PMRFXB4F.js → OUFIJDIW.js} +2 -2
  77. package/dist/cdn/{TWCJJCPC.js → OV5O7YP4.js} +2 -2
  78. package/dist/cdn/{TGCJUIEL.js → Q75EBGI2.js} +1 -1
  79. package/dist/cdn/QBV7VDQK.js +2 -0
  80. package/dist/cdn/QCOJMMT3.js +2 -0
  81. package/dist/cdn/{JOUR2FB2.js → QDWOQBO3.js} +2 -2
  82. package/dist/cdn/{4PRXQFCV.js → QKBGX2OY.js} +2 -2
  83. package/dist/cdn/{LYLQCBVX.js → QKK6N2AN.js} +2 -2
  84. package/dist/cdn/{N5QLV56W.js → QNCMFQSA.js} +2 -2
  85. package/dist/cdn/{KV4ZZSNW.js → QS3GXAIH.js} +1 -1
  86. package/dist/cdn/{JWBUJT43.js → QSAZVVVL.js} +2 -2
  87. package/dist/cdn/{DHMNNIXZ.js → QUOPWSRC.js} +2 -2
  88. package/dist/cdn/QYMSY57N.js +2 -0
  89. package/dist/cdn/{TXC7YBGL.js → R3QN5WF2.js} +2 -2
  90. package/dist/cdn/{OUMTV5H5.js → R74ZHFA6.js} +1 -1
  91. package/dist/cdn/{RQYNPDN3.js → RBGARTND.js} +2 -2
  92. package/dist/cdn/{TOTWYGB3.js → RUB2GDBE.js} +2 -2
  93. package/dist/cdn/{PZDI5ZDC.js → SG7Z5VLB.js} +2 -2
  94. package/dist/cdn/{TUUUK3VX.js → T2HQNZ36.js} +2 -2
  95. package/dist/cdn/{TBZXKKGP.js → T3RJKB2A.js} +2 -2
  96. package/dist/cdn/{XYMBRPC7.js → TJYPEMON.js} +2 -2
  97. package/dist/cdn/{2YZWRFCI.js → UGRFT75G.js} +2 -2
  98. package/dist/cdn/UKHCSMA4.js +2 -0
  99. package/dist/cdn/{74T6IXSN.js → UQKT5JQZ.js} +2 -2
  100. package/dist/cdn/{U3KMGSVH.js → USGROSML.js} +2 -2
  101. package/dist/cdn/{FRE56NBG.js → UTA2UBBS.js} +2 -2
  102. package/dist/cdn/{4MUB6TL6.js → UZCHLKLO.js} +1 -1
  103. package/dist/cdn/{5PV2GUZW.js → UZLQALHY.js} +1 -1
  104. package/dist/cdn/{M5PPX4ZX.js → V5YXPHYD.js} +2 -2
  105. package/dist/cdn/{K75JTQPW.js → VMQIDO4Z.js} +2 -2
  106. package/dist/cdn/{EQDYQOOT.js → WDMNL6PJ.js} +2 -2
  107. package/dist/cdn/X4G32AIG.js +2 -0
  108. package/dist/cdn/{GUL7EIJ4.js → XEK22IDA.js} +1 -1
  109. package/dist/cdn/{RHCRPJWS.js → XKC6SPS4.js} +2 -2
  110. package/dist/cdn/{MLYQGIJU.js → XOFCMJBQ.js} +2 -2
  111. package/dist/cdn/{CXXV6WJT.js → XROCYFKH.js} +2 -2
  112. package/dist/cdn/{BSTA5KI5.js → XU3QHJD7.js} +2 -2
  113. package/dist/cdn/XUPYBBRI.js +2 -0
  114. package/dist/cdn/{GUO7HKSP.js → Y3YIMI2Z.js} +4 -4
  115. package/dist/cdn/YG5VQATB.js +2 -0
  116. package/dist/cdn/{3UFTKKFG.js → YUQFNMEZ.js} +1 -1
  117. package/dist/cdn/{YG6ZGQ46.js → YVKSTDL6.js} +1 -1
  118. package/dist/cdn/ZAIRH5DL.js +2 -0
  119. package/dist/cdn/{24QSQLRY.js → ZSILF72K.js} +2 -2
  120. package/dist/cdn/index.js +2 -2
  121. package/dist/chunks/common.js +1 -1
  122. package/dist/chunks/dom.js +1 -1
  123. package/dist/chunks/fieldAddDelete.js +1 -1
  124. package/dist/chunks/functional.js +1 -1
  125. package/dist/chunks/functionalities.js +1 -1
  126. package/dist/chunks/groups.js +1 -1
  127. package/dist/chunks/groups2.js +1 -1
  128. package/dist/chunks/icons.js +1 -1
  129. package/dist/chunks/info.js +1 -1
  130. package/dist/chunks/item.js +1 -1
  131. package/dist/chunks/item2.js +1 -1
  132. package/dist/chunks/itemThumbnail.js +1 -1
  133. package/dist/chunks/items.js +1 -1
  134. package/dist/chunks/loadClassificationData.js +1 -1
  135. package/dist/chunks/portal-account-switcher.js +1 -1
  136. package/dist/chunks/portal-browser-filter-date.js +1 -1
  137. package/dist/chunks/portal-browser.js +1 -1
  138. package/dist/chunks/portal-delete-items-review.js +1 -1
  139. package/dist/chunks/portal-item-badge.js +1 -1
  140. package/dist/chunks/portal-related-items-list-item.js +1 -1
  141. package/dist/chunks/portal.js +1 -1
  142. package/dist/chunks/portal2.js +1 -1
  143. package/dist/chunks/query.js +1 -1
  144. package/dist/chunks/request.js +1 -1
  145. package/dist/chunks/requests.js +1 -1
  146. package/dist/chunks/runtime.js +2 -2
  147. package/dist/chunks/services.js +1 -1
  148. package/dist/chunks/store.js +1 -1
  149. package/dist/chunks/string.js +1 -1
  150. package/dist/chunks/ui.js +1 -1
  151. package/dist/chunks/url.js +1 -1
  152. package/dist/chunks/useT9n.js +1 -1
  153. package/dist/chunks/user.js +1 -1
  154. package/dist/chunks/user2.js +1 -1
  155. package/dist/chunks/users.js +1 -1
  156. package/dist/chunks/utils.js +1 -1
  157. package/dist/chunks/utils2.js +1 -1
  158. package/dist/chunks/utils3.js +1 -1
  159. package/dist/chunks/verified.js +1 -1
  160. package/dist/components/arcgis-portal-account-switcher/customElement.js +1 -1
  161. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +1 -1
  162. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +1 -1
  163. package/dist/components/arcgis-portal-account-switcher-signout/customElement.js +1 -1
  164. package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +1 -1
  165. package/dist/components/arcgis-portal-ai-assistant/customElement.js +1 -1
  166. package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +1 -1
  167. package/dist/components/arcgis-portal-browser/customElement.js +1 -1
  168. package/dist/components/arcgis-portal-browser-actions/customElement.js +1 -1
  169. package/dist/components/arcgis-portal-browser-filter-status/customElement.js +1 -1
  170. package/dist/components/arcgis-portal-browser-pagination/customElement.js +1 -1
  171. package/dist/components/arcgis-portal-browser-search/customElement.js +1 -1
  172. package/dist/components/arcgis-portal-browser-sort/customElement.js +1 -1
  173. package/dist/components/arcgis-portal-browser-top-bar/customElement.js +1 -1
  174. package/dist/components/arcgis-portal-browser-view/customElement.js +1 -1
  175. package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
  176. package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
  177. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  178. package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
  179. package/dist/components/arcgis-portal-delete-items/customElement.js +1 -1
  180. package/dist/components/arcgis-portal-delete-items-review/customElement.js +1 -1
  181. package/dist/components/arcgis-portal-entity-picker/customElement.js +1 -1
  182. package/dist/components/arcgis-portal-extent-picker/customElement.js +1 -1
  183. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
  184. package/dist/components/arcgis-portal-field-delete/customElement.js +1 -1
  185. package/dist/components/arcgis-portal-group-badges/customElement.js +1 -1
  186. package/dist/components/arcgis-portal-group-browser/customElement.js +1 -1
  187. package/dist/components/arcgis-portal-group-browser-card/customElement.js +1 -1
  188. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +1 -1
  189. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +1 -1
  190. package/dist/components/arcgis-portal-group-card/customElement.js +1 -1
  191. package/dist/components/arcgis-portal-group-picker/customElement.js +1 -1
  192. package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
  193. package/dist/components/arcgis-portal-info-banner/customElement.js +1 -1
  194. package/dist/components/arcgis-portal-item-actions/customElement.js +1 -1
  195. package/dist/components/arcgis-portal-item-badge/customElement.js +1 -1
  196. package/dist/components/arcgis-portal-item-badges/customElement.js +1 -1
  197. package/dist/components/arcgis-portal-item-card/customElement.js +1 -1
  198. package/dist/components/arcgis-portal-item-favorite/customElement.js +1 -1
  199. package/dist/components/arcgis-portal-item-picker/customElement.js +1 -1
  200. package/dist/components/arcgis-portal-item-thumbnail/customElement.js +1 -1
  201. package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
  202. package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +1 -1
  203. package/dist/components/arcgis-portal-navigation/customElement.js +1 -1
  204. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +1 -1
  205. package/dist/components/arcgis-portal-review-related-items/customElement.js +1 -1
  206. package/dist/components/arcgis-portal-sublayer-type/customElement.js +1 -1
  207. package/dist/components/arcgis-portal-user-avatar/customElement.js +1 -1
  208. package/dist/components/arcgis-portal-user-picker/customElement.js +1 -1
  209. package/dist/components/arcgis-portal-user-popup/customElement.js +1 -1
  210. package/dist/components/arcgis-portal-voice-input/customElement.js +1 -1
  211. package/dist/components/portal-browser/components/portal-browser-filter/customElement.js +1 -1
  212. package/dist/components/portal-browser/components/portal-browser-filter-date/customElement.js +1 -1
  213. package/dist/components/portal-browser/components/portal-browser-filters/customElement.js +1 -1
  214. package/dist/components/portal-group-browser-filters/customElement.js +1 -1
  215. package/dist/components/portal-group-browser-pagination/customElement.js +1 -1
  216. package/dist/components/portal-group-browser-sort/customElement.js +1 -1
  217. package/dist/components/portal-related-items-list-item/customElement.js +1 -1
  218. package/dist/docs/api.json +1 -1
  219. package/dist/docs/docs.json +1 -1
  220. package/dist/docs/web-types.json +1 -1
  221. package/dist/index.js +1 -1
  222. package/dist/loader.js +1 -1
  223. package/package.json +7 -7
  224. package/dist/cdn/23FS4XTG.js +0 -2
  225. package/dist/cdn/2MPQ5IWJ.js +0 -2
  226. package/dist/cdn/46BUEBWS.js +0 -2
  227. package/dist/cdn/4AI52H7C.js +0 -2
  228. package/dist/cdn/66XWNGQ2.js +0 -2
  229. package/dist/cdn/6F4SJDRR.js +0 -2
  230. package/dist/cdn/7ZWYUHGK.js +0 -2
  231. package/dist/cdn/AJQT7UXB.js +0 -2
  232. package/dist/cdn/AZOJHVAO.js +0 -2
  233. package/dist/cdn/DYO5P3F2.js +0 -2
  234. package/dist/cdn/E66BDC6N.js +0 -2
  235. package/dist/cdn/EEAVX4PP.js +0 -2
  236. package/dist/cdn/EITRZQSC.js +0 -2
  237. package/dist/cdn/FIBQAMJ3.js +0 -2
  238. package/dist/cdn/FNLBJ4ZQ.js +0 -2
  239. package/dist/cdn/GXM3XY3J.js +0 -2
  240. package/dist/cdn/I6NVKNZJ.js +0 -2
  241. package/dist/cdn/J5FKIZAM.js +0 -2
  242. package/dist/cdn/JL52W3Z4.js +0 -2
  243. package/dist/cdn/N4VOTJ25.js +0 -2
  244. package/dist/cdn/RVYSVTPQ.js +0 -2
  245. package/dist/cdn/SLQQ44IA.js +0 -2
  246. package/dist/cdn/WC3FPLYQ.js +0 -2
  247. package/dist/cdn/YYTEJVBL.js +0 -2
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import a from"./PMRFXB4F.js";import"./K75JTQPW.js";import"./KV4ZZSNW.js";import"./EMJQI4MA.js";import{a as q}from"./7ZWYUHGK.js";import"./A2SQ4EMZ.js";import"./K2XSYDAP.js";import{L as f,R as _,h as b,j as u,w as c}from"./AICPYLWE.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([D,S,g,{b:h}])=>{var I=b`:host{background-color:var(--calcite-color-foreground-1)}.scrim-container{position:relative}.base-fields-control{margin-inline-end:.75rem}.added{display:inline-flex;gap:.5rem;flex-shrink:0;white-space:nowrap}.added calcite-icon{color:var(--calcite-color-status-success)}`;async function v({item:t,layers:e}){let{url:a}=t,l=new Map;if(!a)return{result:l};try{let s=(await g(a,{query:{f:"json"},responseType:"json"})).data;if(s.fields){let n=e?.[0];return e?.length===1&&n?.layerId!=null&&l.set(n.layerId,s.fields),{result:l}}if(!s.layers?.length)return{result:l};let i=a.replace(/\/$/u,"");return await Promise.all(s.layers.map(async({id:n})=>{let d=(await g(`${i}/${n}`,{query:{f:"json"},responseType:"json"})).data;l.set(n,d.fields??[])})),{result:l}}catch(s){return console.error("Error getting layer fields:",s),{error:{code:"unhandledError"}}}}var P=t=>{let{url:e}=t;return e?e.replace("/rest/services","/rest/admin/services").replace(/\/$/u,""):null};async function C({fields:t,item:e,portal:a,layerId:l}){let s=P(e);if(!s)return{error:{code:"unhandledError",message:"A feature service URL is required."}};try{let i=await h({url:`${s}/${l!=null?`${l}/`:""}addToDefinition`,portal:a,method:"post",params:{addToDefinition:JSON.stringify({fields:t})}});return i.success===!1||i.error?{error:{code:"unhandledError",message:i.error?.message}}:{result:i}}catch(i){return console.error("Error adding fields to the feature service definition:",i),{error:{code:"unhandledError"}}}}async function L({fields:t,item:e,portal:a,layerId:l}){let s=P(e);if(!s)return{error:{code:"unhandledError",message:"A feature service URL is required."}};try{let i=await h({url:`${s}/${l!=null?`${l}/`:""}updateDefinition`,portal:a,method:"post",params:{updateDefinition:JSON.stringify({fields:t})}});return i.success===!1||i.error?{error:{code:"unhandledError",message:i.error?.message??"Failed to update the feature service definition."}}:{result:i}}catch(i){return console.error("Error updating the feature service definition:",i),{error:{code:"unhandledError"}}}}async function z(t){let{url:e}=t;if(!e)return{error:{code:"unhandledError"}};try{return{result:(await g(e,{query:{f:"json"}})).data}}catch(a){return console.error("Error getting service info:",a),{error:{code:"unhandledError"}}}}var A=(t,e)=>{let a=t.domain??null,l=e.domain??null;return a===null||l===null?a===l:a.type!==l.type?!1:a.type==="codedValue"&&l.type==="codedValue"?a.name===l.name&&a.codedValues.length===l.codedValues.length&&a.codedValues.every(({code:s,name:i},n)=>s===l.codedValues[n]?.code&&i===l.codedValues[n]?.name):a.type==="range"&&l.type==="range"?a.name===l.name&&a.range[0]===l.range[0]&&a.range[1]===l.range[1]:!0},w=(t,e)=>{let a=new Map(e.map(i=>[i.name,i])),l=[],s=[];for(let i of t){let n=a.get(i.name);n?A(i,n)||s.push({name:i.name,domain:i.domain}):l.push(i)}return{missingFields:l,modifiedFields:s}},F=t=>{switch(t){case"esriGeometryPolyline":case"esriGeometryPolygon":return[...E];case"esriGeometryPoint":return[...R];default:return[]}},x=t=>t==="esriGeometryPoint"?[...M]:[],G=t=>t==="esriGeometryPoint"?[...N]:[],E=[{name:"esrignss_avg_h_rms",type:"esriFieldTypeDouble",alias:"Average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_v_rms",type:"esriFieldTypeDouble",alias:"Average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_h_rms",type:"esriFieldTypeDouble",alias:"Worst horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_v_rms",type:"esriFieldTypeDouble",alias:"Worst vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_fixtype",type:"esriFieldTypeSmallInteger",alias:"Worst fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"NoFix",code:0},{name:"GPS",code:1},{name:"DifferentialGPS",code:2},{name:"PrecisePositioningService",code:3},{name:"RTKFixed",code:4},{name:"RTKFloat",code:5}]},defaultValue:null},{name:"esrignss_manual_locations",type:"esriFieldTypeInteger",alias:"Number of manual locations",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}],R=[{name:"esrignss_speed",type:"esriFieldTypeDouble",alias:"Speed (km/h)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_direction",type:"esriFieldTypeDouble",alias:"Direction of travel (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_azimuth",type:"esriFieldTypeDouble",alias:"Compass reading (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_positionsourcetype",type:"esriFieldTypeInteger",alias:"Position source type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_POSITIONSOURCETYPE_DOMAIN",codedValues:[{name:"Unknown",code:0},{name:"User defined",code:1},{name:"Integrated (System) Location Provider",code:2},{name:"External GNSS Receiver",code:3},{name:"Network Location Provider",code:4},{name:"Snapped",code:5}]},defaultValue:null},{name:"esrignss_receiver",type:"esriFieldTypeString",alias:"Receiver name",sqlType:"sqlTypeOther",length:50,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_rms",type:"esriFieldTypeDouble",alias:"Horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_v_rms",type:"esriFieldTypeDouble",alias:"Vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_latitude",type:"esriFieldTypeDouble",alias:"Latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_longitude",type:"esriFieldTypeDouble",alias:"Longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_altitude",type:"esriFieldTypeDouble",alias:"Ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_pdop",type:"esriFieldTypeDouble",alias:"PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_hdop",type:"esriFieldTypeDouble",alias:"HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_vdop",type:"esriFieldTypeDouble",alias:"VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_fixtype",type:"esriFieldTypeSmallInteger",alias:"Fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"NoFix",code:0},{name:"GPS",code:1},{name:"DifferentialGPS",code:2},{name:"PrecisePositioningService",code:3},{name:"RTKFixed",code:4},{name:"RTKFloat",code:5}]},defaultValue:null},{name:"esrignss_correctionage",type:"esriFieldTypeDouble",alias:"Correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_stationid",type:"esriFieldTypeSmallInteger",alias:"Station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_numsats",type:"esriFieldTypeSmallInteger",alias:"Number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"range",name:"ESRI_NUM_SATS_DOMAIN",range:[0,99]},defaultValue:null},{name:"esrignss_fixdatetime",type:"esriFieldTypeDate",alias:"Fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_h_rms",type:"esriFieldTypeDouble",alias:"Average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_v_rms",type:"esriFieldTypeDouble",alias:"Average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_positions",type:"esriFieldTypeInteger",alias:"Averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_stddev",type:"esriFieldTypeDouble",alias:"Standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_correction_source_name",type:"esriFieldTypeString",alias:"Correction source name",sqlType:"sqlTypeOther",length:100,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_correction_source_type",type:"esriFieldTypeString",alias:"Correction source type",sqlType:"sqlTypeOther",length:25,nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_correction_source_domain",codedValues:[{name:"Unknown",code:"Unknown"},{name:"Direct IP",code:"Direct IP"},{name:"NTRIP",code:"NTRIP"},{name:"PPP",code:"PPP"},{name:"Radio",code:"Radio"},{name:"SBAS",code:"SBAS"}]},defaultValue:null},{name:"esrignss_custom_attributes",type:"esriFieldTypeString",alias:"GNSS custom attributes",sqlType:"sqlTypeOther",length:2e3,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_95_status",type:"esriFieldTypeSmallInteger",alias:"95% accuracy applied",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null},{name:"esrignss_ntrip_mount_point",type:"esriFieldTypeString",alias:"NTRIP mount point",sqlType:"sqlTypeOther",length:100,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_antenna_height",type:"esriFieldTypeDouble",alias:"GNSS antenna height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_orthometric_height",type:"esriFieldTypeDouble",alias:"Orthometric height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_profile_has_hor_xform",type:"esriFieldTypeSmallInteger",alias:"Location profile horizontal datum transformation applied",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null},{name:"esrignss_profile_hor_xform",type:"esriFieldTypeString",alias:"Location profile horizontal datum transformation",sqlType:"sqlTypeOther",length:255,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_gcs",type:"esriFieldTypeString",alias:"Geographic coordinate system",sqlType:"sqlTypeOther",length:60,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_gcs_wkid",type:"esriFieldTypeInteger",alias:"Geographic coordinate system WKID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_geoid",type:"esriFieldTypeString",alias:"Receiver geoid model",sqlType:"sqlTypeOther",length:60,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_ref_epoch",type:"esriFieldTypeDouble",alias:"Reference epoch",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}],M=[{name:"esrisnsr_tilt_azimuth_accuracy",type:"esriFieldTypeDouble",alias:"Tilt azimuth accuracy (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_azimuth",type:"esriFieldTypeDouble",alias:"Tilt azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_angle_accuracy",type:"esriFieldTypeDouble",alias:"Tilt angle accuracy (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_angle",type:"esriFieldTypeDouble",alias:"Tilt angle (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_tilt_compensated",type:"esriFieldTypeSmallInteger",alias:"Tilt compensated",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null}],N=[{name:"esrignss_cp1_latitude",type:"esriFieldTypeDouble",alias:"CP1 latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_longitude",type:"esriFieldTypeDouble",alias:"CP1 longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_altitude",type:"esriFieldTypeDouble",alias:"CP1 ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_h_rms",type:"esriFieldTypeDouble",alias:"CP1 horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_v_rms",type:"esriFieldTypeDouble",alias:"CP1 vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_fixdatetime",type:"esriFieldTypeDate",alias:"CP1 fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_fixtype",type:"esriFieldTypeSmallInteger",alias:"CP1 fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"Fix not valid",code:0},{name:"GPS",code:1},{name:"Differential GPS",code:2},{name:"RTK Fixed",code:4},{name:"RTK Float",code:5}]},defaultValue:null},{name:"esrignss_cp1_corr_age",type:"esriFieldTypeDouble",alias:"CP1 correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_stationid",type:"esriFieldTypeSmallInteger",alias:"CP1 station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_numsats",type:"esriFieldTypeSmallInteger",alias:"CP1 number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_pdop",type:"esriFieldTypeDouble",alias:"CP1 PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_hdop",type:"esriFieldTypeDouble",alias:"CP1 HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_vdop",type:"esriFieldTypeDouble",alias:"CP1 VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_h_rms",type:"esriFieldTypeDouble",alias:"CP1 average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_v_rms",type:"esriFieldTypeDouble",alias:"CP1 average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_positions",type:"esriFieldTypeInteger",alias:"CP1 averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_h_stddev",type:"esriFieldTypeDouble",alias:"CP1 standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_slope_dist",type:"esriFieldTypeDouble",alias:"CP1 laser slope distance (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_inclination",type:"esriFieldTypeDouble",alias:"CP1 laser inclination (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_azimuth",type:"esriFieldTypeDouble",alias:"CP1 laser azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_latitude",type:"esriFieldTypeDouble",alias:"CP2 latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_longitude",type:"esriFieldTypeDouble",alias:"CP2 longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_altitude",type:"esriFieldTypeDouble",alias:"CP2 ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_h_rms",type:"esriFieldTypeDouble",alias:"CP2 horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_v_rms",type:"esriFieldTypeDouble",alias:"CP2 vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_fixdatetime",type:"esriFieldTypeDate",alias:"CP2 fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_fixtype",type:"esriFieldTypeSmallInteger",alias:"CP2 fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"Fix not valid",code:0},{name:"GPS",code:1},{name:"Differential GPS",code:2},{name:"RTK Fixed",code:4},{name:"RTK Float",code:5}]},defaultValue:null},{name:"esrignss_cp2_corr_age",type:"esriFieldTypeDouble",alias:"CP2 correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_stationid",type:"esriFieldTypeSmallInteger",alias:"CP2 station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_numsats",type:"esriFieldTypeSmallInteger",alias:"CP2 number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_pdop",type:"esriFieldTypeDouble",alias:"CP2 PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_hdop",type:"esriFieldTypeDouble",alias:"CP2 HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_vdop",type:"esriFieldTypeDouble",alias:"CP2 VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_h_rms",type:"esriFieldTypeDouble",alias:"CP2 average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_v_rms",type:"esriFieldTypeDouble",alias:"CP2 average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_positions",type:"esriFieldTypeInteger",alias:"CP2 averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_h_stddev",type:"esriFieldTypeDouble",alias:"CP2 standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_slope_dist",type:"esriFieldTypeDouble",alias:"CP2 laser slope distance (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_inclination",type:"esriFieldTypeDouble",alias:"CP2 laser inclination (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_azimuth",type:"esriFieldTypeDouble",alias:"CP2 laser azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_method",type:"esriFieldTypeString",alias:"Offset method",sqlType:"sqlTypeOther",length:5e3,nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_OFFSET_METHOD_DOMAIN",codedValues:[{name:"Azimuth-Azimuth",code:"azimuth-azimuth"},{name:"Distance-Angle",code:"distance-angle"},{name:"Distance-Azimuth",code:"distance-azimuth"},{name:"Distance-Distance",code:"distance-distance"},{name:"Azimuth-Azimuth-Backsight",code:"azimuth-azimuth-backsight"},{name:"Distance-Azimuth-Backsight",code:"distance-azimuth-backsight"},{name:"Distance-Distance-Backsight",code:"distance-distance-backsight"},{name:"User-defined",code:"user-defined"}]},defaultValue:null},{name:"esrisnsr_offset_device",type:"esriFieldTypeString",alias:"Rangefinder name",sqlType:"sqlTypeOther",length:5e3,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_laser_height",type:"esriFieldTypeDouble",alias:"Rangefinder height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_laser_target_ht",type:"esriFieldTypeDouble",alias:"Laser target height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_mag_var",type:"esriFieldTypeDouble",alias:"Rangefinder magnetic variation (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}];function $(t){let e=t.capabilities;return e?.data?.supportsAttachment&&e?.operations?.supportsQueryAttachments}function k(t){return t.every($)}var B=["point","polyline","polygon"],O=t=>t?.type==="Feature Service",T=class extends f{constructor(){super(...arguments),this.messages=q({blocking:!0}),this.initCount=0,this.supportsAttachments=!1,this.layersLoaded=!1,this.pointLayers=[],this.lineOrPolygonLayers=[],this.loadedItem=null,this.gpsFieldFixesBySet=null,this.addFieldsDisabled=!0,this.initializing=!0,this.hasLineOrPolygonLayer=!1,this.hasPointFeatureLayer=!1,this.addingGPSFieldMetadata=[],this.item=null,this.itemId=null,this.arcgisGPSMetadataFieldsAdded=c(),this.arcgisReadOnlyMode=c()}static{this.properties={loadedItem:16,gpsFieldFixesBySet:16,addFieldsDisabled:16,initializing:16,hasLineOrPolygonLayer:16,hasPointFeatureLayer:16,addingGPSFieldMetadata:16,item:0,itemId:1,portal:0}}static{this.styles=I}willUpdate(e){(e.has("item")||e.has("itemId"))&&this.initItem()}async initItem({showLoading:e=!0}={}){let a=++this.initCount;if(!this.item&&!this.itemId){this.resetItemState(),this.initializing=!1;return}e&&(this.resetItemState(),this.initializing=!0);let{item:l,itemId:s,portal:i}=this,n=l?await l.load():await new S({id:s,portal:i}).load();if(!this.isCurrentInitialization(a))return;if(!O(n)){this.resetItemState(),this.initializing=!1;return}this.loadedItem=n;let d=!e&&this.layersLoaded?[...this.pointLayers,...this.lineOrPolygonLayers]:await this.getFeatureLayers(n),{result:p}=await z(n);if(!this.isCurrentInitialization(a))return;this.layersLoaded=!0,this.pointLayers=d.filter(o=>o.geometryType==="point"),this.lineOrPolygonLayers=d.filter(o=>o.geometryType==="polyline"||o.geometryType==="polygon"),this.hasLineOrPolygonLayer=d.some(o=>o.geometryType==="polyline"||o.geometryType==="polygon"),this.hasPointFeatureLayer=d.some(o=>o.geometryType==="point");let{result:r,error:y}=d.length>0?await v({item:n,layers:d}):{};if(!this.isCurrentInitialization(a))return;if(y){this.resetItemState(),this.initializing=!1;return}let m=r??new Map;this.gpsFieldFixesBySet={base:this.analyzeFieldSet([...this.pointLayers,...this.lineOrPolygonLayers],m,"base"),gnss:this.analyzeFieldSet(this.pointLayers,m,"gnss"),rangefinder:this.analyzeFieldSet(this.pointLayers,m,"rangefinder")},this.supportsAttachments=k(d);let V=p?.sourceSchemaChangesAllowed!==!1;this.addFieldsDisabled=!this.supportsAttachments||!V,this.initializing=!1}isCurrentInitialization(e){return e===this.initCount}resetItemState(){this.loadedItem=null,this.layersLoaded=!1,this.pointLayers=[],this.lineOrPolygonLayers=[],this.gpsFieldFixesBySet=null,this.addFieldsDisabled=!0,this.hasLineOrPolygonLayer=!1,this.hasPointFeatureLayer=!1}async getFeatureLayers(e){let a=await D.fromPortalItem({portalItem:e});return await a.load(),"layers"in a?(await Promise.all(a.layers.map(async l=>(await l.load(),this.isSupportedFeatureLayer(l)?l:null)))).filter(l=>!!l):this.isSupportedFeatureLayer(a)?[a]:[]}isSupportedFeatureLayer(e){return e.type==="feature"&&B.some(a=>a===e.geometryType)}getCompatibleEsriGeometryType(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";default:return null}}analyzeFieldSet(e,a,l){let s=[];for(let i of e){if(i.layerId==null)continue;let n=a.get(i.layerId)??[],d=this.getCompatibleEsriGeometryType(i),p=d?l==="base"?F(d):l==="gnss"?x(d):G(d):[],r=w(p,n);(r.missingFields.length>0||r.modifiedFields.length>0)&&s.push({layerId:i.layerId,fieldsToAdd:r.missingFields,domainsToUpdate:r.modifiedFields})}return s}hasFieldChanges(e){return(this.gpsFieldFixesBySet?.[e].length??0)>0}isLoading(e){return this.addingGPSFieldMetadata.includes(e)}async addFields(e){let a=this.portal??this.loadedItem?.portal,l=this.loadedItem,s=this.gpsFieldFixesBySet;if(!(!a||!l||!s)){if(a.isReadOnly){this.arcgisReadOnlyMode.emit();return}this.addingGPSFieldMetadata=[...this.addingGPSFieldMetadata,e];try{let i=s[e],n=(await Promise.all(i.filter(({fieldsToAdd:r})=>r.length>0).map(async({fieldsToAdd:r,layerId:y})=>await C({fields:r,item:l,layerId:y,portal:a})))).every(({error:r})=>!r),d=n?await Promise.all(i.filter(({domainsToUpdate:r})=>r.length>0).map(async({domainsToUpdate:r,layerId:y})=>await L({fields:r,item:l,layerId:y,portal:a}))):[],p=n&&d.every(({error:r})=>!r);await this.initItem({showLoading:!1}),n&&p&&this.gpsFieldFixesBySet&&!this.hasFieldChanges(e)&&this.arcgisGPSMetadataFieldsAdded.emit(e)}finally{this.addingGPSFieldMetadata=this.addingGPSFieldMetadata.filter(i=>i!==e)}}}canShowAddGPSMetadata(){let e=this.loadedItem??this.item;return!!e&&O(e)}showAdvancedFields(){let e=this.gpsFieldFixesBySet;return!this.hasPointFeatureLayer||!e?!1:this.pointLayers.some(a=>{if(a.layerId==null)return!1;let l=this.getCompatibleEsriGeometryType(a),s=l?F(l):[];return(e.base.find(({layerId:i})=>i===a.layerId)?.fieldsToAdd??[]).length<s.length})}renderAddFieldsControl(e,a=!1){let l=this.gpsFieldFixesBySet;if(!a&&l&&!this.hasFieldChanges(e))return u`<span slot=actions-end class="added"><calcite-icon icon=check-circle scale=s aria-hidden></calcite-icon>${this.messages.added}</span>`;let s=this.isLoading(e);return u`<calcite-button slot=actions-end appearance=outline-fill .disabled=${a||!l||s||this.addFieldsDisabled} .loading=${s} @click=${async()=>await this.addFields(e)}>${s?this.messages.addingFields:this.messages.addFields}</calcite-button>`}render(){return this.canShowAddGPSMetadata()?u`<div class="scrim-container"><calcite-block scale=m expanded>${this.initializing&&u`<calcite-scrim loading></calcite-scrim>`||""}<calcite-list .label=${this.messages.gpsOptions} selection-mode=none><calcite-list-item .label=${this.messages.accordionHeading}>${this.renderAddFieldsControl("base")}</calcite-list-item>${this.showAdvancedFields()&&u`<calcite-list-item .label=${this.messages.gnssReceiverFields}>${this.renderAddFieldsControl("gnss")}</calcite-list-item><calcite-list-item .label=${this.messages.laserRangefinderFields}>${this.renderAddFieldsControl("rangefinder")}</calcite-list-item>`||""}</calcite-list></calcite-block></div>`:null}};_("arcgis-portal-add-gps-metadata",T);return T},"layers/Layer","portal/PortalItem","request",a)
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./OUFIJDIW.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import"./2GBRZSEC.js";import{a as q}from"./XUPYBBRI.js";import"./C5U7YKVI.js";import"./6BMWSGLA.js";import{L as f,R as _,h as b,j as u,w as c}from"./CWSEBETE.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([D,S,g,{b:h}])=>{var I=b`:host{background-color:var(--calcite-color-foreground-1)}.scrim-container{position:relative}.base-fields-control{margin-inline-end:.75rem}.added{display:inline-flex;gap:.5rem;flex-shrink:0;white-space:nowrap}.added calcite-icon{color:var(--calcite-color-status-success)}`;async function v({item:t,layers:e}){let{url:a}=t,l=new Map;if(!a)return{result:l};try{let s=(await g(a,{query:{f:"json"},responseType:"json"})).data;if(s.fields){let n=e?.[0];return e?.length===1&&n?.layerId!=null&&l.set(n.layerId,s.fields),{result:l}}if(!s.layers?.length)return{result:l};let i=a.replace(/\/$/u,"");return await Promise.all(s.layers.map(async({id:n})=>{let d=(await g(`${i}/${n}`,{query:{f:"json"},responseType:"json"})).data;l.set(n,d.fields??[])})),{result:l}}catch(s){return console.error("Error getting layer fields:",s),{error:{code:"unhandledError"}}}}var P=t=>{let{url:e}=t;return e?e.replace("/rest/services","/rest/admin/services").replace(/\/$/u,""):null};async function C({fields:t,item:e,portal:a,layerId:l}){let s=P(e);if(!s)return{error:{code:"unhandledError",message:"A feature service URL is required."}};try{let i=await h({url:`${s}/${l!=null?`${l}/`:""}addToDefinition`,portal:a,method:"post",params:{addToDefinition:JSON.stringify({fields:t})}});return i.success===!1||i.error?{error:{code:"unhandledError",message:i.error?.message}}:{result:i}}catch(i){return console.error("Error adding fields to the feature service definition:",i),{error:{code:"unhandledError"}}}}async function L({fields:t,item:e,portal:a,layerId:l}){let s=P(e);if(!s)return{error:{code:"unhandledError",message:"A feature service URL is required."}};try{let i=await h({url:`${s}/${l!=null?`${l}/`:""}updateDefinition`,portal:a,method:"post",params:{updateDefinition:JSON.stringify({fields:t})}});return i.success===!1||i.error?{error:{code:"unhandledError",message:i.error?.message??"Failed to update the feature service definition."}}:{result:i}}catch(i){return console.error("Error updating the feature service definition:",i),{error:{code:"unhandledError"}}}}async function z(t){let{url:e}=t;if(!e)return{error:{code:"unhandledError"}};try{return{result:(await g(e,{query:{f:"json"}})).data}}catch(a){return console.error("Error getting service info:",a),{error:{code:"unhandledError"}}}}var A=(t,e)=>{let a=t.domain??null,l=e.domain??null;return a===null||l===null?a===l:a.type!==l.type?!1:a.type==="codedValue"&&l.type==="codedValue"?a.name===l.name&&a.codedValues.length===l.codedValues.length&&a.codedValues.every(({code:s,name:i},n)=>s===l.codedValues[n]?.code&&i===l.codedValues[n]?.name):a.type==="range"&&l.type==="range"?a.name===l.name&&a.range[0]===l.range[0]&&a.range[1]===l.range[1]:!0},w=(t,e)=>{let a=new Map(e.map(i=>[i.name,i])),l=[],s=[];for(let i of t){let n=a.get(i.name);n?A(i,n)||s.push({name:i.name,domain:i.domain}):l.push(i)}return{missingFields:l,modifiedFields:s}},F=t=>{switch(t){case"esriGeometryPolyline":case"esriGeometryPolygon":return[...E];case"esriGeometryPoint":return[...R];default:return[]}},x=t=>t==="esriGeometryPoint"?[...M]:[],G=t=>t==="esriGeometryPoint"?[...N]:[],E=[{name:"esrignss_avg_h_rms",type:"esriFieldTypeDouble",alias:"Average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_v_rms",type:"esriFieldTypeDouble",alias:"Average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_h_rms",type:"esriFieldTypeDouble",alias:"Worst horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_v_rms",type:"esriFieldTypeDouble",alias:"Worst vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_fixtype",type:"esriFieldTypeSmallInteger",alias:"Worst fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"NoFix",code:0},{name:"GPS",code:1},{name:"DifferentialGPS",code:2},{name:"PrecisePositioningService",code:3},{name:"RTKFixed",code:4},{name:"RTKFloat",code:5}]},defaultValue:null},{name:"esrignss_manual_locations",type:"esriFieldTypeInteger",alias:"Number of manual locations",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}],R=[{name:"esrignss_speed",type:"esriFieldTypeDouble",alias:"Speed (km/h)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_direction",type:"esriFieldTypeDouble",alias:"Direction of travel (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_azimuth",type:"esriFieldTypeDouble",alias:"Compass reading (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_positionsourcetype",type:"esriFieldTypeInteger",alias:"Position source type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_POSITIONSOURCETYPE_DOMAIN",codedValues:[{name:"Unknown",code:0},{name:"User defined",code:1},{name:"Integrated (System) Location Provider",code:2},{name:"External GNSS Receiver",code:3},{name:"Network Location Provider",code:4},{name:"Snapped",code:5}]},defaultValue:null},{name:"esrignss_receiver",type:"esriFieldTypeString",alias:"Receiver name",sqlType:"sqlTypeOther",length:50,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_rms",type:"esriFieldTypeDouble",alias:"Horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_v_rms",type:"esriFieldTypeDouble",alias:"Vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_latitude",type:"esriFieldTypeDouble",alias:"Latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_longitude",type:"esriFieldTypeDouble",alias:"Longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_altitude",type:"esriFieldTypeDouble",alias:"Ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_pdop",type:"esriFieldTypeDouble",alias:"PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_hdop",type:"esriFieldTypeDouble",alias:"HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_vdop",type:"esriFieldTypeDouble",alias:"VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_fixtype",type:"esriFieldTypeSmallInteger",alias:"Fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"NoFix",code:0},{name:"GPS",code:1},{name:"DifferentialGPS",code:2},{name:"PrecisePositioningService",code:3},{name:"RTKFixed",code:4},{name:"RTKFloat",code:5}]},defaultValue:null},{name:"esrignss_correctionage",type:"esriFieldTypeDouble",alias:"Correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_stationid",type:"esriFieldTypeSmallInteger",alias:"Station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_numsats",type:"esriFieldTypeSmallInteger",alias:"Number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"range",name:"ESRI_NUM_SATS_DOMAIN",range:[0,99]},defaultValue:null},{name:"esrignss_fixdatetime",type:"esriFieldTypeDate",alias:"Fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_h_rms",type:"esriFieldTypeDouble",alias:"Average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_v_rms",type:"esriFieldTypeDouble",alias:"Average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_positions",type:"esriFieldTypeInteger",alias:"Averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_stddev",type:"esriFieldTypeDouble",alias:"Standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_correction_source_name",type:"esriFieldTypeString",alias:"Correction source name",sqlType:"sqlTypeOther",length:100,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_correction_source_type",type:"esriFieldTypeString",alias:"Correction source type",sqlType:"sqlTypeOther",length:25,nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_correction_source_domain",codedValues:[{name:"Unknown",code:"Unknown"},{name:"Direct IP",code:"Direct IP"},{name:"NTRIP",code:"NTRIP"},{name:"PPP",code:"PPP"},{name:"Radio",code:"Radio"},{name:"SBAS",code:"SBAS"}]},defaultValue:null},{name:"esrignss_custom_attributes",type:"esriFieldTypeString",alias:"GNSS custom attributes",sqlType:"sqlTypeOther",length:2e3,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_95_status",type:"esriFieldTypeSmallInteger",alias:"95% accuracy applied",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null},{name:"esrignss_ntrip_mount_point",type:"esriFieldTypeString",alias:"NTRIP mount point",sqlType:"sqlTypeOther",length:100,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_antenna_height",type:"esriFieldTypeDouble",alias:"GNSS antenna height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_orthometric_height",type:"esriFieldTypeDouble",alias:"Orthometric height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_profile_has_hor_xform",type:"esriFieldTypeSmallInteger",alias:"Location profile horizontal datum transformation applied",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null},{name:"esrignss_profile_hor_xform",type:"esriFieldTypeString",alias:"Location profile horizontal datum transformation",sqlType:"sqlTypeOther",length:255,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_gcs",type:"esriFieldTypeString",alias:"Geographic coordinate system",sqlType:"sqlTypeOther",length:60,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_gcs_wkid",type:"esriFieldTypeInteger",alias:"Geographic coordinate system WKID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_geoid",type:"esriFieldTypeString",alias:"Receiver geoid model",sqlType:"sqlTypeOther",length:60,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_ref_epoch",type:"esriFieldTypeDouble",alias:"Reference epoch",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}],M=[{name:"esrisnsr_tilt_azimuth_accuracy",type:"esriFieldTypeDouble",alias:"Tilt azimuth accuracy (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_azimuth",type:"esriFieldTypeDouble",alias:"Tilt azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_angle_accuracy",type:"esriFieldTypeDouble",alias:"Tilt angle accuracy (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_angle",type:"esriFieldTypeDouble",alias:"Tilt angle (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_tilt_compensated",type:"esriFieldTypeSmallInteger",alias:"Tilt compensated",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null}],N=[{name:"esrignss_cp1_latitude",type:"esriFieldTypeDouble",alias:"CP1 latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_longitude",type:"esriFieldTypeDouble",alias:"CP1 longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_altitude",type:"esriFieldTypeDouble",alias:"CP1 ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_h_rms",type:"esriFieldTypeDouble",alias:"CP1 horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_v_rms",type:"esriFieldTypeDouble",alias:"CP1 vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_fixdatetime",type:"esriFieldTypeDate",alias:"CP1 fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_fixtype",type:"esriFieldTypeSmallInteger",alias:"CP1 fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"Fix not valid",code:0},{name:"GPS",code:1},{name:"Differential GPS",code:2},{name:"RTK Fixed",code:4},{name:"RTK Float",code:5}]},defaultValue:null},{name:"esrignss_cp1_corr_age",type:"esriFieldTypeDouble",alias:"CP1 correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_stationid",type:"esriFieldTypeSmallInteger",alias:"CP1 station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_numsats",type:"esriFieldTypeSmallInteger",alias:"CP1 number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_pdop",type:"esriFieldTypeDouble",alias:"CP1 PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_hdop",type:"esriFieldTypeDouble",alias:"CP1 HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_vdop",type:"esriFieldTypeDouble",alias:"CP1 VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_h_rms",type:"esriFieldTypeDouble",alias:"CP1 average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_v_rms",type:"esriFieldTypeDouble",alias:"CP1 average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_positions",type:"esriFieldTypeInteger",alias:"CP1 averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_h_stddev",type:"esriFieldTypeDouble",alias:"CP1 standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_slope_dist",type:"esriFieldTypeDouble",alias:"CP1 laser slope distance (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_inclination",type:"esriFieldTypeDouble",alias:"CP1 laser inclination (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_azimuth",type:"esriFieldTypeDouble",alias:"CP1 laser azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_latitude",type:"esriFieldTypeDouble",alias:"CP2 latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_longitude",type:"esriFieldTypeDouble",alias:"CP2 longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_altitude",type:"esriFieldTypeDouble",alias:"CP2 ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_h_rms",type:"esriFieldTypeDouble",alias:"CP2 horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_v_rms",type:"esriFieldTypeDouble",alias:"CP2 vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_fixdatetime",type:"esriFieldTypeDate",alias:"CP2 fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_fixtype",type:"esriFieldTypeSmallInteger",alias:"CP2 fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"Fix not valid",code:0},{name:"GPS",code:1},{name:"Differential GPS",code:2},{name:"RTK Fixed",code:4},{name:"RTK Float",code:5}]},defaultValue:null},{name:"esrignss_cp2_corr_age",type:"esriFieldTypeDouble",alias:"CP2 correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_stationid",type:"esriFieldTypeSmallInteger",alias:"CP2 station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_numsats",type:"esriFieldTypeSmallInteger",alias:"CP2 number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_pdop",type:"esriFieldTypeDouble",alias:"CP2 PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_hdop",type:"esriFieldTypeDouble",alias:"CP2 HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_vdop",type:"esriFieldTypeDouble",alias:"CP2 VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_h_rms",type:"esriFieldTypeDouble",alias:"CP2 average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_v_rms",type:"esriFieldTypeDouble",alias:"CP2 average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_positions",type:"esriFieldTypeInteger",alias:"CP2 averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_h_stddev",type:"esriFieldTypeDouble",alias:"CP2 standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_slope_dist",type:"esriFieldTypeDouble",alias:"CP2 laser slope distance (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_inclination",type:"esriFieldTypeDouble",alias:"CP2 laser inclination (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_azimuth",type:"esriFieldTypeDouble",alias:"CP2 laser azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_method",type:"esriFieldTypeString",alias:"Offset method",sqlType:"sqlTypeOther",length:5e3,nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_OFFSET_METHOD_DOMAIN",codedValues:[{name:"Azimuth-Azimuth",code:"azimuth-azimuth"},{name:"Distance-Angle",code:"distance-angle"},{name:"Distance-Azimuth",code:"distance-azimuth"},{name:"Distance-Distance",code:"distance-distance"},{name:"Azimuth-Azimuth-Backsight",code:"azimuth-azimuth-backsight"},{name:"Distance-Azimuth-Backsight",code:"distance-azimuth-backsight"},{name:"Distance-Distance-Backsight",code:"distance-distance-backsight"},{name:"User-defined",code:"user-defined"}]},defaultValue:null},{name:"esrisnsr_offset_device",type:"esriFieldTypeString",alias:"Rangefinder name",sqlType:"sqlTypeOther",length:5e3,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_laser_height",type:"esriFieldTypeDouble",alias:"Rangefinder height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_laser_target_ht",type:"esriFieldTypeDouble",alias:"Laser target height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_mag_var",type:"esriFieldTypeDouble",alias:"Rangefinder magnetic variation (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}];function $(t){let e=t.capabilities;return e?.data?.supportsAttachment&&e?.operations?.supportsQueryAttachments}function k(t){return t.every($)}var B=["point","polyline","polygon"],O=t=>t?.type==="Feature Service",T=class extends f{constructor(){super(...arguments),this.messages=q({blocking:!0}),this.initCount=0,this.supportsAttachments=!1,this.layersLoaded=!1,this.pointLayers=[],this.lineOrPolygonLayers=[],this.loadedItem=null,this.gpsFieldFixesBySet=null,this.addFieldsDisabled=!0,this.initializing=!0,this.hasLineOrPolygonLayer=!1,this.hasPointFeatureLayer=!1,this.addingGPSFieldMetadata=[],this.item=null,this.itemId=null,this.arcgisGPSMetadataFieldsAdded=c(),this.arcgisReadOnlyMode=c()}static{this.properties={loadedItem:16,gpsFieldFixesBySet:16,addFieldsDisabled:16,initializing:16,hasLineOrPolygonLayer:16,hasPointFeatureLayer:16,addingGPSFieldMetadata:16,item:0,itemId:1,portal:0}}static{this.styles=I}willUpdate(e){(e.has("item")||e.has("itemId"))&&this.initItem()}async initItem({showLoading:e=!0}={}){let a=++this.initCount;if(!this.item&&!this.itemId){this.resetItemState(),this.initializing=!1;return}e&&(this.resetItemState(),this.initializing=!0);let{item:l,itemId:s,portal:i}=this,n=l?await l.load():await new S({id:s,portal:i}).load();if(!this.isCurrentInitialization(a))return;if(!O(n)){this.resetItemState(),this.initializing=!1;return}this.loadedItem=n;let d=!e&&this.layersLoaded?[...this.pointLayers,...this.lineOrPolygonLayers]:await this.getFeatureLayers(n),{result:p}=await z(n);if(!this.isCurrentInitialization(a))return;this.layersLoaded=!0,this.pointLayers=d.filter(o=>o.geometryType==="point"),this.lineOrPolygonLayers=d.filter(o=>o.geometryType==="polyline"||o.geometryType==="polygon"),this.hasLineOrPolygonLayer=d.some(o=>o.geometryType==="polyline"||o.geometryType==="polygon"),this.hasPointFeatureLayer=d.some(o=>o.geometryType==="point");let{result:r,error:y}=d.length>0?await v({item:n,layers:d}):{};if(!this.isCurrentInitialization(a))return;if(y){this.resetItemState(),this.initializing=!1;return}let m=r??new Map;this.gpsFieldFixesBySet={base:this.analyzeFieldSet([...this.pointLayers,...this.lineOrPolygonLayers],m,"base"),gnss:this.analyzeFieldSet(this.pointLayers,m,"gnss"),rangefinder:this.analyzeFieldSet(this.pointLayers,m,"rangefinder")},this.supportsAttachments=k(d);let V=p?.sourceSchemaChangesAllowed!==!1;this.addFieldsDisabled=!this.supportsAttachments||!V,this.initializing=!1}isCurrentInitialization(e){return e===this.initCount}resetItemState(){this.loadedItem=null,this.layersLoaded=!1,this.pointLayers=[],this.lineOrPolygonLayers=[],this.gpsFieldFixesBySet=null,this.addFieldsDisabled=!0,this.hasLineOrPolygonLayer=!1,this.hasPointFeatureLayer=!1}async getFeatureLayers(e){let a=await D.fromPortalItem({portalItem:e});return await a.load(),"layers"in a?(await Promise.all(a.layers.map(async l=>(await l.load(),this.isSupportedFeatureLayer(l)?l:null)))).filter(l=>!!l):this.isSupportedFeatureLayer(a)?[a]:[]}isSupportedFeatureLayer(e){return e.type==="feature"&&B.some(a=>a===e.geometryType)}getCompatibleEsriGeometryType(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";default:return null}}analyzeFieldSet(e,a,l){let s=[];for(let i of e){if(i.layerId==null)continue;let n=a.get(i.layerId)??[],d=this.getCompatibleEsriGeometryType(i),p=d?l==="base"?F(d):l==="gnss"?x(d):G(d):[],r=w(p,n);(r.missingFields.length>0||r.modifiedFields.length>0)&&s.push({layerId:i.layerId,fieldsToAdd:r.missingFields,domainsToUpdate:r.modifiedFields})}return s}hasFieldChanges(e){return(this.gpsFieldFixesBySet?.[e].length??0)>0}isLoading(e){return this.addingGPSFieldMetadata.includes(e)}async addFields(e){let a=this.portal??this.loadedItem?.portal,l=this.loadedItem,s=this.gpsFieldFixesBySet;if(!(!a||!l||!s)){if(a.isReadOnly){this.arcgisReadOnlyMode.emit();return}this.addingGPSFieldMetadata=[...this.addingGPSFieldMetadata,e];try{let i=s[e],n=(await Promise.all(i.filter(({fieldsToAdd:r})=>r.length>0).map(async({fieldsToAdd:r,layerId:y})=>await C({fields:r,item:l,layerId:y,portal:a})))).every(({error:r})=>!r),d=n?await Promise.all(i.filter(({domainsToUpdate:r})=>r.length>0).map(async({domainsToUpdate:r,layerId:y})=>await L({fields:r,item:l,layerId:y,portal:a}))):[],p=n&&d.every(({error:r})=>!r);await this.initItem({showLoading:!1}),n&&p&&this.gpsFieldFixesBySet&&!this.hasFieldChanges(e)&&this.arcgisGPSMetadataFieldsAdded.emit(e)}finally{this.addingGPSFieldMetadata=this.addingGPSFieldMetadata.filter(i=>i!==e)}}}canShowAddGPSMetadata(){let e=this.loadedItem??this.item;return!!e&&O(e)}showAdvancedFields(){let e=this.gpsFieldFixesBySet;return!this.hasPointFeatureLayer||!e?!1:this.pointLayers.some(a=>{if(a.layerId==null)return!1;let l=this.getCompatibleEsriGeometryType(a),s=l?F(l):[];return(e.base.find(({layerId:i})=>i===a.layerId)?.fieldsToAdd??[]).length<s.length})}renderAddFieldsControl(e,a=!1){let l=this.gpsFieldFixesBySet;if(!a&&l&&!this.hasFieldChanges(e))return u`<span slot=actions-end class="added"><calcite-icon icon=check-circle scale=s aria-hidden></calcite-icon>${this.messages.added}</span>`;let s=this.isLoading(e);return u`<calcite-button slot=actions-end appearance=outline-fill .disabled=${a||!l||s||this.addFieldsDisabled} .loading=${s} @click=${async()=>await this.addFields(e)}>${s?this.messages.addingFields:this.messages.addFields}</calcite-button>`}render(){return this.canShowAddGPSMetadata()?u`<div class="scrim-container"><calcite-block scale=m expanded>${this.initializing&&u`<calcite-scrim loading></calcite-scrim>`||""}<calcite-list .label=${this.messages.gpsOptions} selection-mode=none><calcite-list-item .label=${this.messages.accordionHeading}>${this.renderAddFieldsControl("base")}</calcite-list-item>${this.showAdvancedFields()&&u`<calcite-list-item .label=${this.messages.gnssReceiverFields}>${this.renderAddFieldsControl("gnss")}</calcite-list-item><calcite-list-item .label=${this.messages.laserRangefinderFields}>${this.renderAddFieldsControl("rangefinder")}</calcite-list-item>`||""}</calcite-list></calcite-block></div>`:null}};_("arcgis-portal-add-gps-metadata",T);return T},"layers/Layer","portal/PortalItem","request",a)
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{c as R}from"./JOUR2FB2.js";import{a as k}from"./VDXESPJK.js";import{a as c}from"./TWCJJCPC.js";import a from"./PMRFXB4F.js";import{a as $}from"./K75JTQPW.js";import{a as b}from"./7ZWYUHGK.js";import{J as p,K as u,L as v,N as f,R as g,h as m,j as n,w as y}from"./AICPYLWE.js";export default $arcgis.t(([{b:T}])=>{var I=["esri_livingatlas","esri_boundaries","esri_demographics","esri_nav","esri_webstyles"];function S(o){return k(o.trim()).replace(/[!*+\-&|()[\]{}^~?:"\\]/gu,"\\$&")}async function _({portal:o,searchTerm:e,num:t=100,query:s}){let i=S(e),l=`${$(o)}portals/self/users/search`,r=[i?`(${i})`:void 0,s?.trim()?`(${s.trim()})`:void 0];o.isPortal&&r.push(...I.map(h=>`-username:${h}`));let a=l.includes("www.arcgis.com")&&o.isPortal?{disableIdentityLookup:!0,addTokenManually:!1}:{};return await T({url:l,portal:o,params:{num:Math.min(Math.max(t,1),100),q:r.filter(Boolean).join(" AND "),sortField:"relevance"},options:a})}function A(...o){return o.map(e=>e?.trim()).filter(e=>!!e).map(e=>`(${e})`).join(" AND ")}async function O(o,e,t,s={}){let i=Math.min(Math.max(s.num??10,1),100);if(e==="user")try{return{result:{entityType:e,result:await _({portal:o,searchTerm:t,num:i,query:s.query})}}}catch(a){return console.error(a),{error:{code:"unhandledError"}}}let l=R(t);if(!l)return{};let r={num:i,query:A(l,s.query)};try{return e==="group"?{result:{entityType:e,result:await o.queryGroups(r)}}:{result:{entityType:e,result:await o.queryItems(r)}}}catch(a){return console.error(a),{error:{code:"unhandledError"}}}}var C=m`:host{display:block;inline-size:100%}.entity-picker{display:flex;flex-direction:column;gap:.5rem;min-inline-size:16rem}.entity-picker__results{max-block-size:22rem;overflow-y:auto}.entity-picker__cards{display:flex;flex-direction:column;gap:.5rem}.entity-picker__status{color:var(--calcite-color-text-3);font-size:.875rem;margin:0;padding:.75rem}.entity-picker__selection{align-items:center;display:flex;gap:.5rem}.entity-picker__selection-label{flex:1;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-picker__input{inline-size:100%}`,d=class extends v{constructor(){super(...arguments),this._messages=b({blocking:!0,name:"portal-entity-picker"}),this.inputRef=p(),this.inputContainerRef=p(),this.resizeObserver=null,this.searchId=0,this.searchTerm="",this.isSearching=!1,this.searchFailed=!1,this.popoverOpen=!1,this.popoverWidth=0,this.entityType="group",this.mode="inline",this.selected=null,this.num=10,this.arcgisSelectionChange=y()}static{this.properties={searchTerm:16,isSearching:16,searchFailed:16,searchResult:16,popoverOpen:16,popoverWidth:16,portal:0,entityType:1,mode:1,selected:0,query:1,num:9,icon:1,messageOverrides:0}}static{this.styles=C}get searchLabel(){let{entityType:e,_messages:t}=this;return e==="group"?t.searchGroups:e==="item"?t.searchItems:t.searchUsers}get selectedLabel(){let{entityType:e,selected:t}=this;if(t?.entityType===e)return t.entityType==="user"?t.entity.fullName||t.entity.username:t.entity.title||t.entity.id||void 0}async togglePicker(e){this.mode==="popover"&&(this.popoverOpen=e,await this.updateComplete,await this.setFocus())}async setFocus(){await this.inputRef.value?.setFocus()}firstUpdated(){this.updatePopoverWidth(),!(typeof ResizeObserver>"u"||!this.inputContainerRef.value)&&(this.resizeObserver=new ResizeObserver(()=>this.updatePopoverWidth()),this.resizeObserver.observe(this.inputContainerRef.value))}willUpdate(e){(e.has("portal")||e.has("entityType")||e.has("query")||e.has("num"))&&this.resetSearch(),e.has("mode")&&this.mode==="inline"&&(this.popoverOpen=!1)}disconnectedCallback(){this.cancelPendingSearch(),this.resizeObserver?.disconnect(),this.resizeObserver=null,super.disconnectedCallback()}updatePopoverWidth(){requestAnimationFrame(()=>{this.popoverWidth=this.inputContainerRef.value?.offsetWidth??0})}cancelPendingSearch(){return this.debounceId!==void 0&&(window.clearTimeout(this.debounceId),this.debounceId=void 0),this.searchId+=1,this.searchId}resetSearch(){this.cancelPendingSearch(),this.searchTerm="",this.isSearching=!1,this.searchFailed=!1,this.searchResult=void 0,this.popoverOpen=!1}scheduleSearch(e){let t=e.trim(),s=this.cancelPendingSearch();if(this.searchFailed=!1,this.searchResult=void 0,!t){this.isSearching=!1,this.popoverOpen=!1;return}this.isSearching=!0,this.mode==="popover"&&(this.popoverOpen=!0),this.debounceId=window.setTimeout(()=>{this.debounceId=void 0,this.search(t,s)},400)}async search(e,t){let{entityType:s,num:i,portal:l,query:r}=this;try{let{error:a,result:h}=await O(l,s,e,{num:i,query:r});if(t!==this.searchId)return;this.searchFailed=!!a,this.searchResult=h}catch{if(t!==this.searchId)return;this.searchFailed=!0,this.searchResult=void 0}finally{t===this.searchId&&(this.isSearching=!1)}}emitSelection(e){this.arcgisSelectionChange.emit(e),this.mode==="popover"&&this.togglePicker(!1)}getFocusableResults(){let e=Array.from(this.renderRoot.querySelector('slot[name="list-start"]')?.assignedElements({flatten:!0})??[]).filter(s=>s instanceof HTMLElement&&(s.tagName==="CALCITE-LIST-ITEM"||s.tabIndex>=0)),t=Array.from(this.renderRoot.querySelectorAll("calcite-list-item, arcgis-portal-group-card, arcgis-portal-item-card"));return[...e,...t]}async focusResult(e){if(e.tagName==="CALCITE-LIST-ITEM"){await e.setFocus();return}if(e.tagName==="ARCGIS-PORTAL-GROUP-CARD"){await e.restoreFocus();return}if(e.tagName==="ARCGIS-PORTAL-ITEM-CARD"){await e.restoreFocus();return}e.focus()}async focusResultAt(e){let t=this.getFocusableResults();if(!t.length)return;let s=(e+t.length)%t.length;await this.focusResult(t[s])}handleResultsKeyDown(e){let t=this.getFocusableResults(),s=e.composedPath(),i=t.findIndex(r=>s.includes(r));if(i===-1)return;if(this.mode==="inline"&&(e.key==="ArrowDown"||e.key==="ArrowUp")){e.preventDefault(),this.focusResultAt(i+(e.key==="ArrowDown"?1:-1));return}let l=t[i];if(l.tagName==="ARCGIS-PORTAL-GROUP-CARD"&&(e.key==="Enter"||e.key===" ")){e.preventDefault();let{group:r}=l;this.emitSelection({entityType:"group",entity:r});return}if(l.tagName==="ARCGIS-PORTAL-ITEM-CARD"&&(e.key==="Enter"||e.key===" ")){e.preventDefault();let{item:r}=l;this.emitSelection({entityType:"item",entity:r})}}renderGroup(e){return c(e.id,n`<calcite-list-item .label=${e.title||e.id||""} .description=${[e.owner,e.access].filter(Boolean).join(" \xB7 ")} .selected=${this.selected?.entityType==="group"&&this.selected.entity.id===e.id} @calciteListItemSelect=${()=>this.emitSelection({entityType:"group",entity:e})}><calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar></calcite-list-item>`)}renderInlineGroup(e){return c(e.id,n`<arcgis-portal-group-card .group=${e} .portal=${this.portal} .selected=${this.selected?.entityType==="group"&&this.selected.entity.id===e.id} selection=none show-summary .user=${this.portal.user??void 0} view=compact></arcgis-portal-group-card>`)}renderItem(e){return c(e.id,n`<calcite-list-item .label=${e.title||e.id||""} .description=${[e.type,e.owner].filter(Boolean).join(" \xB7 ")} .selected=${this.selected?.entityType==="item"&&this.selected.entity.id===e.id} @calciteListItemSelect=${()=>this.emitSelection({entityType:"item",entity:e})}><calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar></calcite-list-item>`)}renderInlineItem(e){return c(e.id,n`<arcgis-portal-item-card .item=${e} .portal=${this.portal} .selected=${this.selected?.entityType==="item"&&this.selected.entity.id===e.id} selection=none show-summary .user=${this.portal.user??void 0} view=list></arcgis-portal-item-card>`)}renderUser(e){return c(e.username,n`<calcite-list-item .label=${e.fullName||e.username} .description=${e.username} .selected=${this.selected?.entityType==="user"&&this.selected.entity.username===e.username} @calciteListItemSelect=${()=>this.emitSelection({entityType:"user",entity:e})}><arcgis-portal-user-avatar slot=content-start .portal=${this.portal} .user=${e} scale=m></arcgis-portal-user-avatar></calcite-list-item>`)}renderSearchResults(){let{entityType:e,isSearching:t,searchFailed:s,searchResult:i,searchTerm:l,_messages:r}=this;if(!l.trim())return null;if(t)return n`<div role=status><calcite-loader .label=${r.searching} scale=s></calcite-loader></div>`;if(s)return n`<p class="entity-picker__status" role=alert>${r.searchFailed}</p>`;if(!(i?.result.results??[]).length){let a=e==="group"?r.noGroupsFound:e==="item"?r.noItemsFound:r.noUsersFound;return n`<p class="entity-picker__status" role=status>${a}</p>`}return this.mode==="inline"&&i?.entityType==="group"?n`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map(a=>this.renderInlineGroup(a))}</div>`:this.mode==="inline"&&i?.entityType==="item"?n`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map(a=>this.renderInlineItem(a))}</div>`:n`<calcite-list interaction-mode=interactive .label=${this.searchLabel} selection-mode=none><slot name=list-start></slot>${i?.entityType==="group"?i.result.results.map(a=>this.renderGroup(a)):i?.entityType==="item"?i.result.results.map(a=>this.renderItem(a)):i?.result.results.map(a=>this.renderUser(a))}</calcite-list>`}renderPicker(e=!0){return n`<div class="entity-picker">${this.selectedLabel&&n`<div class="entity-picker__selection"><span class="entity-picker__selection-label">${this.selectedLabel}</span><calcite-button appearance=transparent icon-start=x kind=neutral .label=${this._messages.clearSelection} @click=${()=>this.arcgisSelectionChange.emit(null)} scale=s></calcite-button></div>`||""}<div class="entity-picker__input" ${u(this.inputContainerRef)}><calcite-input .icon=${this.icon} .label=${this.searchLabel} .placeholder=${this.searchLabel} .value=${this.searchTerm} @click=${()=>{this.mode==="popover"&&this.searchTerm.trim()&&(this.popoverOpen=!0)}} @keydown=${t=>{(t.key==="ArrowDown"||t.key==="ArrowUp")&&this.searchResult?.result.results.length&&(t.preventDefault(),this.focusResultAt(t.key==="ArrowDown"?0:-1))}} @focus=${()=>{this.mode==="popover"&&this.searchTerm.trim()&&(this.popoverOpen=!0)}} @calciteInputInput=${t=>{this.searchTerm=t.target.value,this.scheduleSearch(this.searchTerm)}} ${u(this.inputRef)}></calcite-input></div>${e&&n`<div class="entity-picker__results" @keydown=${this.handleResultsKeyDown}>${this.renderSearchResults()}</div>`||""}</div>`}render(){return this.mode==="inline"?this.renderPicker():n`${this.renderPicker(!1)}<calcite-popover .label=${this.searchLabel} .open=${this.popoverOpen} placement=bottom-start .referenceElement=${this.inputContainerRef.value} trigger-disabled @calcitePopoverClose=${e=>{!e.target.open&&this.popoverOpen&&(this.popoverOpen=!1,requestAnimationFrame(()=>{this.setFocus()}))}}><div class="entity-picker__results" style=${f({inlineSize:this.popoverWidth?`${this.popoverWidth}px`:void 0})}>${this.renderSearchResults()}</div></calcite-popover>`}};g("arcgis-portal-entity-picker",d);return d},a)
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{c as R}from"./QDWOQBO3.js";import{a as k}from"./25XJ66JO.js";import{a as c}from"./OV5O7YP4.js";import a from"./OUFIJDIW.js";import{a as $}from"./VMQIDO4Z.js";import{a as b}from"./XUPYBBRI.js";import{J as p,K as u,L as v,N as f,R as g,h as m,j as n,w as y}from"./CWSEBETE.js";export default $arcgis.t(([{b:T}])=>{var I=["esri_livingatlas","esri_boundaries","esri_demographics","esri_nav","esri_webstyles"];function S(o){return k(o.trim()).replace(/[!*+\-&|()[\]{}^~?:"\\]/gu,"\\$&")}async function _({portal:o,searchTerm:e,num:t=100,query:s}){let i=S(e),l=`${$(o)}portals/self/users/search`,r=[i?`(${i})`:void 0,s?.trim()?`(${s.trim()})`:void 0];o.isPortal&&r.push(...I.map(h=>`-username:${h}`));let a=l.includes("www.arcgis.com")&&o.isPortal?{disableIdentityLookup:!0,addTokenManually:!1}:{};return await T({url:l,portal:o,params:{num:Math.min(Math.max(t,1),100),q:r.filter(Boolean).join(" AND "),sortField:"relevance"},options:a})}function A(...o){return o.map(e=>e?.trim()).filter(e=>!!e).map(e=>`(${e})`).join(" AND ")}async function O(o,e,t,s={}){let i=Math.min(Math.max(s.num??10,1),100);if(e==="user")try{return{result:{entityType:e,result:await _({portal:o,searchTerm:t,num:i,query:s.query})}}}catch(a){return console.error(a),{error:{code:"unhandledError"}}}let l=R(t);if(!l)return{};let r={num:i,query:A(l,s.query)};try{return e==="group"?{result:{entityType:e,result:await o.queryGroups(r)}}:{result:{entityType:e,result:await o.queryItems(r)}}}catch(a){return console.error(a),{error:{code:"unhandledError"}}}}var C=m`:host{display:block;inline-size:100%}.entity-picker{display:flex;flex-direction:column;gap:.5rem;min-inline-size:16rem}.entity-picker__results{max-block-size:22rem;overflow-y:auto}.entity-picker__cards{display:flex;flex-direction:column;gap:.5rem}.entity-picker__status{color:var(--calcite-color-text-3);font-size:.875rem;margin:0;padding:.75rem}.entity-picker__selection{align-items:center;display:flex;gap:.5rem}.entity-picker__selection-label{flex:1;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-picker__input{inline-size:100%}`,d=class extends v{constructor(){super(...arguments),this._messages=b({blocking:!0,name:"portal-entity-picker"}),this.inputRef=p(),this.inputContainerRef=p(),this.resizeObserver=null,this.searchId=0,this.searchTerm="",this.isSearching=!1,this.searchFailed=!1,this.popoverOpen=!1,this.popoverWidth=0,this.entityType="group",this.mode="inline",this.selected=null,this.num=10,this.arcgisSelectionChange=y()}static{this.properties={searchTerm:16,isSearching:16,searchFailed:16,searchResult:16,popoverOpen:16,popoverWidth:16,portal:0,entityType:1,mode:1,selected:0,query:1,num:9,icon:1,messageOverrides:0}}static{this.styles=C}get searchLabel(){let{entityType:e,_messages:t}=this;return e==="group"?t.searchGroups:e==="item"?t.searchItems:t.searchUsers}get selectedLabel(){let{entityType:e,selected:t}=this;if(t?.entityType===e)return t.entityType==="user"?t.entity.fullName||t.entity.username:t.entity.title||t.entity.id||void 0}async togglePicker(e){this.mode==="popover"&&(this.popoverOpen=e,await this.updateComplete,await this.setFocus())}async setFocus(){await this.inputRef.value?.setFocus()}firstUpdated(){this.updatePopoverWidth(),!(typeof ResizeObserver>"u"||!this.inputContainerRef.value)&&(this.resizeObserver=new ResizeObserver(()=>this.updatePopoverWidth()),this.resizeObserver.observe(this.inputContainerRef.value))}willUpdate(e){(e.has("portal")||e.has("entityType")||e.has("query")||e.has("num"))&&this.resetSearch(),e.has("mode")&&this.mode==="inline"&&(this.popoverOpen=!1)}disconnectedCallback(){this.cancelPendingSearch(),this.resizeObserver?.disconnect(),this.resizeObserver=null,super.disconnectedCallback()}updatePopoverWidth(){requestAnimationFrame(()=>{this.popoverWidth=this.inputContainerRef.value?.offsetWidth??0})}cancelPendingSearch(){return this.debounceId!==void 0&&(window.clearTimeout(this.debounceId),this.debounceId=void 0),this.searchId+=1,this.searchId}resetSearch(){this.cancelPendingSearch(),this.searchTerm="",this.isSearching=!1,this.searchFailed=!1,this.searchResult=void 0,this.popoverOpen=!1}scheduleSearch(e){let t=e.trim(),s=this.cancelPendingSearch();if(this.searchFailed=!1,this.searchResult=void 0,!t){this.isSearching=!1,this.popoverOpen=!1;return}this.isSearching=!0,this.mode==="popover"&&(this.popoverOpen=!0),this.debounceId=window.setTimeout(()=>{this.debounceId=void 0,this.search(t,s)},400)}async search(e,t){let{entityType:s,num:i,portal:l,query:r}=this;try{let{error:a,result:h}=await O(l,s,e,{num:i,query:r});if(t!==this.searchId)return;this.searchFailed=!!a,this.searchResult=h}catch{if(t!==this.searchId)return;this.searchFailed=!0,this.searchResult=void 0}finally{t===this.searchId&&(this.isSearching=!1)}}emitSelection(e){this.arcgisSelectionChange.emit(e),this.mode==="popover"&&this.togglePicker(!1)}getFocusableResults(){let e=Array.from(this.renderRoot.querySelector('slot[name="list-start"]')?.assignedElements({flatten:!0})??[]).filter(s=>s instanceof HTMLElement&&(s.tagName==="CALCITE-LIST-ITEM"||s.tabIndex>=0)),t=Array.from(this.renderRoot.querySelectorAll("calcite-list-item, arcgis-portal-group-card, arcgis-portal-item-card"));return[...e,...t]}async focusResult(e){if(e.tagName==="CALCITE-LIST-ITEM"){await e.setFocus();return}if(e.tagName==="ARCGIS-PORTAL-GROUP-CARD"){await e.restoreFocus();return}if(e.tagName==="ARCGIS-PORTAL-ITEM-CARD"){await e.restoreFocus();return}e.focus()}async focusResultAt(e){let t=this.getFocusableResults();if(!t.length)return;let s=(e+t.length)%t.length;await this.focusResult(t[s])}handleResultsKeyDown(e){let t=this.getFocusableResults(),s=e.composedPath(),i=t.findIndex(r=>s.includes(r));if(i===-1)return;if(this.mode==="inline"&&(e.key==="ArrowDown"||e.key==="ArrowUp")){e.preventDefault(),this.focusResultAt(i+(e.key==="ArrowDown"?1:-1));return}let l=t[i];if(l.tagName==="ARCGIS-PORTAL-GROUP-CARD"&&(e.key==="Enter"||e.key===" ")){e.preventDefault();let{group:r}=l;this.emitSelection({entityType:"group",entity:r});return}if(l.tagName==="ARCGIS-PORTAL-ITEM-CARD"&&(e.key==="Enter"||e.key===" ")){e.preventDefault();let{item:r}=l;this.emitSelection({entityType:"item",entity:r})}}renderGroup(e){return c(e.id,n`<calcite-list-item .label=${e.title||e.id||""} .description=${[e.owner,e.access].filter(Boolean).join(" \xB7 ")} .selected=${this.selected?.entityType==="group"&&this.selected.entity.id===e.id} @calciteListItemSelect=${()=>this.emitSelection({entityType:"group",entity:e})}><calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar></calcite-list-item>`)}renderInlineGroup(e){return c(e.id,n`<arcgis-portal-group-card .group=${e} .portal=${this.portal} .selected=${this.selected?.entityType==="group"&&this.selected.entity.id===e.id} selection=none show-summary .user=${this.portal.user??void 0} view=compact></arcgis-portal-group-card>`)}renderItem(e){return c(e.id,n`<calcite-list-item .label=${e.title||e.id||""} .description=${[e.type,e.owner].filter(Boolean).join(" \xB7 ")} .selected=${this.selected?.entityType==="item"&&this.selected.entity.id===e.id} @calciteListItemSelect=${()=>this.emitSelection({entityType:"item",entity:e})}><calcite-avatar slot=content-start .fullName=${e.title??void 0} .thumbnail=${e.thumbnailUrl??void 0} scale=m></calcite-avatar></calcite-list-item>`)}renderInlineItem(e){return c(e.id,n`<arcgis-portal-item-card .item=${e} .portal=${this.portal} .selected=${this.selected?.entityType==="item"&&this.selected.entity.id===e.id} selection=none show-summary .user=${this.portal.user??void 0} view=list></arcgis-portal-item-card>`)}renderUser(e){return c(e.username,n`<calcite-list-item .label=${e.fullName||e.username} .description=${e.username} .selected=${this.selected?.entityType==="user"&&this.selected.entity.username===e.username} @calciteListItemSelect=${()=>this.emitSelection({entityType:"user",entity:e})}><arcgis-portal-user-avatar slot=content-start .portal=${this.portal} .user=${e} scale=m></arcgis-portal-user-avatar></calcite-list-item>`)}renderSearchResults(){let{entityType:e,isSearching:t,searchFailed:s,searchResult:i,searchTerm:l,_messages:r}=this;if(!l.trim())return null;if(t)return n`<div role=status><calcite-loader .label=${r.searching} scale=s></calcite-loader></div>`;if(s)return n`<p class="entity-picker__status" role=alert>${r.searchFailed}</p>`;if(!(i?.result.results??[]).length){let a=e==="group"?r.noGroupsFound:e==="item"?r.noItemsFound:r.noUsersFound;return n`<p class="entity-picker__status" role=status>${a}</p>`}return this.mode==="inline"&&i?.entityType==="group"?n`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map(a=>this.renderInlineGroup(a))}</div>`:this.mode==="inline"&&i?.entityType==="item"?n`<div class="entity-picker__cards"><slot name=list-start></slot>${i.result.results.map(a=>this.renderInlineItem(a))}</div>`:n`<calcite-list interaction-mode=interactive .label=${this.searchLabel} selection-mode=none><slot name=list-start></slot>${i?.entityType==="group"?i.result.results.map(a=>this.renderGroup(a)):i?.entityType==="item"?i.result.results.map(a=>this.renderItem(a)):i?.result.results.map(a=>this.renderUser(a))}</calcite-list>`}renderPicker(e=!0){return n`<div class="entity-picker">${this.selectedLabel&&n`<div class="entity-picker__selection"><span class="entity-picker__selection-label">${this.selectedLabel}</span><calcite-button appearance=transparent icon-start=x kind=neutral .label=${this._messages.clearSelection} @click=${()=>this.arcgisSelectionChange.emit(null)} scale=s></calcite-button></div>`||""}<div class="entity-picker__input" ${u(this.inputContainerRef)}><calcite-input .icon=${this.icon} .label=${this.searchLabel} .placeholder=${this.searchLabel} .value=${this.searchTerm} @click=${()=>{this.mode==="popover"&&this.searchTerm.trim()&&(this.popoverOpen=!0)}} @keydown=${t=>{(t.key==="ArrowDown"||t.key==="ArrowUp")&&this.searchResult?.result.results.length&&(t.preventDefault(),this.focusResultAt(t.key==="ArrowDown"?0:-1))}} @focus=${()=>{this.mode==="popover"&&this.searchTerm.trim()&&(this.popoverOpen=!0)}} @calciteInputInput=${t=>{this.searchTerm=t.target.value,this.scheduleSearch(this.searchTerm)}} ${u(this.inputRef)}></calcite-input></div>${e&&n`<div class="entity-picker__results" @keydown=${this.handleResultsKeyDown}>${this.renderSearchResults()}</div>`||""}</div>`}render(){return this.mode==="inline"?this.renderPicker():n`${this.renderPicker(!1)}<calcite-popover .label=${this.searchLabel} .open=${this.popoverOpen} placement=bottom-start .referenceElement=${this.inputContainerRef.value} trigger-disabled @calcitePopoverClose=${e=>{!e.target.open&&this.popoverOpen&&(this.popoverOpen=!1,requestAnimationFrame(()=>{this.setFocus()}))}}><div class="entity-picker__results" style=${f({inlineSize:this.popoverWidth?`${this.popoverWidth}px`:void 0})}>${this.renderSearchResults()}</div></calcite-popover>`}};g("arcgis-portal-entity-picker",d);return d},a)
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  export default $arcgis.t(([c,{once:m}])=>{async function j(a,r){let e=`${a}/portals/self/classification/classificationSchema`,n={};try{let t=(await c(e,{query:{f:"json"},signal:r})).data;if(typeof t=="object"&&t!==null&&"classificationSchema"in t)n.result=t.classificationSchema;else throw new Error("Invalid response format received from the classification schema endpoint")}catch(t){n.error=t}return n}async function S(a,r,e){let n=`${a}/portals/self/classification/validateClassification`,t={classificationValue:JSON.stringify(r),f:"json"},o={};try{let s=await c(n,{query:t,method:"post",signal:e.signal});o.result=s.data}catch(s){console.error(s),o.error=s}return o}async function g(a){if(!a)return;a.loaded||await a.load();let r=a.portal.user??await m(()=>a?.portal.user);if(!r)return;let e=`${a.portal.restUrl}/community/users/${r.username}/resources/classification_favorites`,n={};try{let t=await c(e,{query:{f:"json"}});n.result=t.data}catch(t){console.error(t),n.error=t}return n}async function $(a,r){if(!a)return;a.loaded||await a.load();let e=a.portal.user??await m(()=>a?.portal.user);if(!e)return;let n=`${a.portal.restUrl}/community/users/${e.username}/addResource`,t={},o={f:"json",key:"classification_favorites",text:JSON.stringify({favorites:r}),access:"UserPrivateAllApps"};try{let s=await c(n,{query:o,method:"post"});t.result=s.data.success}catch(s){console.error(s),t.error=s}return t}function q(a){return{error:{code:a||"unhandledError"}}}async function y(a,r){r=r||{},r.query=r.query||{},r.query instanceof URLSearchParams||(r.query={f:"json",...r.query||{}});try{return{result:(await c(a,r)).data}}catch{return q()}}async function U(a,r={}){r.query=r.query||{},r.query instanceof URLSearchParams||(r.query={f:"json",...r.query||{}});try{return{success:!0,...await c(a,r)}}catch(e){return{success:!1,error:e}}}async function x(a,r,e="results",n=!1){let t=[],o;r.start=1,r.num||(r.num=100);let{result:s}=await y(a,{query:r}),f=s?.[e];if(!f)return[];t=[...t,...f];let d=s.nextStart,h=s.total-t.length,p=Math.ceil(h/r.num),u=[];for(o=0;o<p;o++)r.start=d+o*r.num,u.push(y(a,{query:{...r}}));if(n){for(let l of u){let i=await l;i.result?.[e]&&(t=[...t,...i.result[e]])}return t}return(await Promise.all(u)).forEach(l=>{let i=l.result?.[e]||[];t=[...t,...i]}),t}return{a:j,b:S,c:g,d:$,e:y,f:U,g:x}},"request","core/reactiveUtils")
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{a as J}from"./YG6ZGQ46.js";import c from"./RQYNPDN3.js";import b from"./ROX3GKKA.js";import{a as T}from"./TWCJJCPC.js";import{a as P}from"./AXOBMX3S.js";import{a as K}from"./Z6R3C4AK.js";import a from"./PMRFXB4F.js";import"./K75JTQPW.js";import"./KV4ZZSNW.js";import{b as M}from"./EMJQI4MA.js";import{a as B}from"./7ZWYUHGK.js";import"./A2SQ4EMZ.js";import"./K2XSYDAP.js";import{L as O,M as _,O as L,R as x,j as d,k as I,w as A}from"./AICPYLWE.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([p,{substitute:w},,,{f:N,g:E,h:H,i:W}])=>{var b=1260*1e3,q=2500;function R(o,t="_blank",i=582,e=670){let s=window.screenLeft??0,n=window.screenTop??0,a=window.innerWidth||document.documentElement.clientWidth||window.screen.width,r=window.innerHeight||document.documentElement.clientHeight||window.screen.height,c=a/2-i/2+s,l=r/2-e/2+n,u=window.open(o,t,`scrollbars=no, width=${i}, height=${e}, top=${l}, left=${c}`);return u?.focus(),u}function z(o){let t=p.findOAuthInfo(o.url),{locale:i="en",expiration:e=b}=t??{},s=new URLSearchParams({locale:i,client_id:"arcgisonline",response_type:"token",expiration:`${e}`,linkUserRequest:"true",showSocialLogins:"true",hideEnterpriseLogins:"false",force_login:"true",parent:window.location.origin,redirect_uri:`https://${o.portalHostname}/home/link_account_callback.html`,state:JSON.stringify({useMessage:!0})}),n=`https://${o.portalHostname}/sharing/oauth2/authorize?${s.toString()}`;R(n)}function U(o){let{config:t,token:i,clientId:e="arcgisonline",redirectToClientUri:s=!1,displaySignoutComplete:n=!1,clientUri:a}=o,r=new URLSearchParams({display:"iframe",client_id:e,...i&&{token:i},parent:window.location.origin,redirect_uri:`${t.baseUrl}/home/check_sign_in_status.html`,state:JSON.stringify({signout:!0,origin:window.location.origin,accountOrigin:`${t.restBaseUrl}/`,redirectToClientUri:s,displaySignoutComplete:n,...a&&{redirectUri:a}})}),c=`${t.restBaseUrl}/oauth2/signout?${r.toString()}`,l=document.createElement("iframe");l.src=c,l.style.display="none",document.body.appendChild(l)}function F(o,t,i){let e=h(o.orgUrlKey,t),s=p.findOAuthInfo(e),{appId:n,locale:a="en",expiration:r=b}=s??{},c=C(o.provider),l=new URLSearchParams({locale:a,client_id:i??n??"arcgisonline",response_type:"token",expiration:`${r}`,parent:window.location.origin,...c==="social"&&{socialLoginProviderName:o.provider},...c==="default"&&{prepopulatedusername:o.username},force_login:"true",redirect_uri:`${e}/home/sign_in_callback.html`,state:JSON.stringify({user:o.username,server:e,portalUrl:e,origin:window.location.origin})}),u=`${v(o,t)}?${l.toString()}`;R(u)}function G({accounts:o,clientId:t="arcgisonline",usersToFilter:i=[],accountsToFilter:e=""}){let s={};return o.reduce((n,a)=>{let r={disabled:a.disabled??!1,allowed:a.clientAppAccessAllowed??!0};return n[a.username]=r,(i.includes(a.username)||i.includes(a.username.toLowerCase())||e==="org"&&a.orgUrlKey||t==="esriapps"&&a.userType!=="both")&&(r.allowed=!1),n},s),s}function Q({account:o,credential:t,clientId:i,portal:e,redirectUri:s}){let n=C(o.provider),a=v(o,e),r=s||D(o,e),c=new URLSearchParams({client_id:i,redirect_uri:r,parent:window.location.origin,response_type:"token",force_login:"false",...t.userId&&{prepopulatedusername:t.userId},...n==="social"&&{socialLoginProviderName:o.provider},expiration:`${(t?.expires??Date.now()+b)-Date.now()}`});return`${a}?${c.toString()}`}function C(o){return V(o)?"social":o==="enterprise"?"enterprise":o.includes("oidc")?"oidc":"default"}function V(o){return["apple","facebook","github","google"].includes(o)}function v(o,t){let i=h(o.orgUrlKey,t).toLowerCase(),e=C(o.provider),s="";switch(e){case"social":s="social/";break;case"enterprise":s="saml/";break;case"oidc":s=`oidc/${o.provider.split("_")[1]}/`;break}return`${i}/sharing/rest/oauth2/${s}authorize`}function h(o,t){return o?.startsWith("https://")?o:o&&t.customBaseUrl?`https://${o}.${t.customBaseUrl}`:`https://${t.portalHostname}`}function D(o,t){return`${h(o.orgUrlKey,t)}/home/accountswitcher-callback.html`}function X(o,t){return p.findCredential(h(o.orgUrlKey,t),o.username)}function Y(o,t){let i=X(o,t);if(i)return i;let e=h(o.orgUrlKey,t),s=`${e}/home/check_sign_in_status.html#state=${JSON.stringify({origin:window.location.origin,server:e,orgKey:e})}`;Z(s,`iframe__for-${e}`)}function Z(o,t){let i=document.createElement("iframe");i.src=o,i.id=t,i.style.display="none",document.body.appendChild(i)}var y=100,S=class extends O{constructor(){super(),this.messages=B({blocking:!0}),this.targetUser="",this.targetToken="",this.accountAccess={},this.remainingSignouts=0,this.signoutHandle=0,this.linkedAccounts=[],this.loading=!1,this.signedInStatus={},this.showAssociatedAccountsWarning=!1,this.signedInAccounts=[],this.clientId="arcgisonline",this.signout=!1,this.signoutOptions={redirectToClientUri:!1,displaySignoutComplete:!1},this.arcgisAccountSwitch=A(),this.arcgisClose=A(),this.arcgisSignoutComplete=A(),this.listenOn(window,"message",this.handleMessageEvent)}static{this.properties={linkedAccounts:16,userAccounts:16,user:16,credential:16,alertOptions:16,loading:16,signedInStatus:16,showAssociatedAccountsWarning:16,signedInAccounts:16,portal:0,clientId:1,redirectUri:1,signout:5,signoutOptions:0}}static{this.styles=K}willUpdate(t){if(t.has("portal")&&(this.user=this.portal?.user),(t.has("portal")||t.has("user"))&&this.portal&&this.user){this.findLinkedUsers();return}if(t.has("linkedAccounts")||t.has("signedInStatus")){if(this.signout){let{signedInStatus:i,linkedAccounts:e,portal:s,signoutOptions:n,clientId:a,user:r,redirectUri:c}=this,l=Object.keys(i).filter(k=>i[k]!==null).map(k=>e.find(j=>j.username===k));this.remainingSignouts=l.length+1;let u=h(s.urlKey??"",s),f=`${u}/sharing/rest`,{displaySignoutComplete:g=!0,redirectToClientUri:m=!0}=n;l.length>0&&(g=!1,m=!1),this.loading=!0;let $=p.findCredential(u,r?.id||r?.username);U({displaySignoutComplete:g,redirectToClientUri:m,clientId:a,config:{baseUrl:u,restBaseUrl:f},token:$?.token,clientUri:m?c:void 0}),this.signoutHandle=window.setTimeout(()=>{this.remainingSignouts-=1,this.finishSignout({accountOrigin:u,redirectToClientUri:m,displaySignoutComplete:g})},q)}return}}handleMessageEvent(t){if(new URL(t.origin).hostname!=="localhost"&&(t.origin.endsWith(".arcgis.com")||t.origin===window.location.origin)){if(typeof t.data=="string"){JSON.parse(t.data).type==="token_exchange"&&this.handleExchangeTokenMessage(t);return}if("type"in t.data)switch(t.data.type){case"signin":this.handleSigninMessage(t);return;case"signout":this.handleSignoutMessage(t);return;case"linkUser":this.handleLinkUserMessage(t);return;case"token_exchange":this.handleExchangeTokenMessage(t);return}if("credential"in t.data){this.handleSigninMessage(t);return}this.handleCheckSignInStatusMessage(t)}}handleSignoutMessage(t){let{error:i,signout:e,accountOrigin:s,redirectToClientUri:n,displaySignoutComplete:a}=t.data;if(this.remainingSignouts-=1,i&&i!=="unknown"){console.error(i),this.showAlert("danger",this.messages.errors.signout);return}e&&(this.user=void 0,this.credential=void 0,this.finishSignout({accountOrigin:s,redirectToClientUri:n,displaySignoutComplete:a}))}handleSigninMessage(t){let{messages:i,clientId:e}=this,{error:s,status:n,state:a,access_token:r,ssl:c}=t.data;if(s){console.error(s),this.showAlert("danger",i.errors.signin);return}if(n==="success"){let{portal:l,user:u,redirectUri:f}=this,g=this.linkedAccounts.find(k=>k.username===a.user);g?.orgUrlKey===this.portal.urlKey&&p.findCredential(`https://${l.portalHostname}`,u?.username)?.destroy();let m={server:a.portalUrl,userId:a.user,token:r,expires:Number(t.data.expires_in)+Date.now(),ssl:c===void 0||c!=="false"};p.registerToken(m);let $=Q({account:g,credential:m,clientId:e,portal:l,redirectUri:f});window.self!==window.top?window.top?.postMessage({type:"navigate",url:$}):window.location.href=$}}handleCheckSignInStatusMessage(t){let{success:i,orgKey:e,server:s,userId:n,token:a,expires:r,ssl:c}=t.data;e&&s&&i&&n&&a&&r&&c!==void 0&&(this.signedInStatus[n]={token:a,expires:r,ssl:c})}async handleLinkUserMessage(t){let{error:i,username:e,access_token:s}=t.data,{portal:n,user:a,linkedAccounts:r,messages:c}=this;if(i){if(i.toString().toLowerCase().includes("user denied your request"))return;this.showAlert("danger",c.errors.accessAccount);return}if(e===a?.username){this.showAlert("danger",c.errors.selfLink);return}if(r.find(u=>u.username===e)){this.showAlert("danger",w(c.errors.alreadyLinked,{username:e}));return}let l=await E(n,e,s);if(l?.length){this.userAccounts=l,this.targetUser=e??"",this.targetToken=s??"",this.showAssociatedAccountsWarning=!0;return}this.linkAccount(e,s)}handleExchangeTokenMessage(t){let i=typeof t.data=="string"?JSON.parse(t.data):t.data;if(!(i.type&&i.type!=="token_exchange")){if(i.error)console.error(i);else if(i.status==="success"&&this.targetUser){let{portal:e,linkedAccounts:s,targetUser:n,clientId:a}=this,r=s.find(g=>g.username===n);if(!r)return;let c=D(r,e),l=h(r.orgUrlKey,e),u=new URLSearchParams({response_type:"token",client_id:a,redirect_uri:c,state:JSON.stringify({user:r.username,portalUrl:l})}),f=`${v(r,e)}?${u.toString()}`;window.opener?(window.opener.location.href=f,window.close()):window.location.href=f}}}finishSignout({accountOrigin:t,redirectToClientUri:i,displaySignoutComplete:e}){this.signoutHandle&&window.clearTimeout(this.signoutHandle),t===window.location.origin&&p.destroyCredentials(),console.info("Signout complete",t,i,e),this.remainingSignouts<=0&&this.arcgisSignoutComplete.emit({accountOrigin:t,redirectToClientUri:i,displaySignoutComplete:e})}async findLinkedUsers(){if(this.loading=!0,!this.portal||!this.user){this.linkedAccounts=[],this.loading=!1;return}this.linkedAccounts=await N(this.portal,this.user),this.linkedAccounts.length&&(this.signedInStatus=this.linkedAccounts.filter(t=>t.orgUrlKey!==this.portal.urlKey).reduce((t,i)=>(t[i.username]=Y(i,this.portal)??null,t),{}),this.accountAccess=G({accounts:this.linkedAccounts,clientId:this.clientId})),this.loading=!1}async linkAccount(t,i){let{portal:e,user:s}=this;if(!e||!s)return;let n=await H({portal:e,user:s,targetUser:t,targetToken:i}),{messages:a}=this;if(n.error){this.showAlert("danger",w(a.errors.linkAccount,{username:t})),this.targetUser="",this.userAccounts=[];return}let r=this.userAccounts?.length?a.success.linkAccountMultiple:a.success.linkAccount;this.showAlert("success",w(r,{username:t})),this.targetUser="",this.userAccounts=[],await M(350),this.findLinkedUsers()}async unlinkAccount(t){if(!this.portal||!this.user)return;let{messages:i,portal:e,user:s}=this,{success:n}=await W({portal:e,user:s,linkedUsername:t.username});n?this.showAlert("success",w(i.success.unlinkAccount,{username:t.username})):this.showAlert("danger",w(i.errors.unlinkAccount,{username:t.username})),await this.findLinkedUsers()}startAccountLink(){z(this.portal)}switchAccount(t){let{portal:i,user:e,clientId:s}=this;if(!i||!e||!t)return;let n=h(e.sourceJSON.orgUrlKey??"",i),a=p.findCredential(n,e.id||e.username);a&&U({config:{baseUrl:n,restBaseUrl:`${n}/sharing/rest`},token:a?.token,clientId:s}),F(t,i,s)}signoutAll(t){let{portal:i,signedInStatus:e,clientId:s}=this;t.forEach(n=>{let a=h(n.orgUrlKey,i),r=`${a}/sharing/rest`,c=e[n.username];U({config:{baseUrl:a,restBaseUrl:r},token:c?.token,clientId:s})})}showAlert(t,i,e){this.alertOptions={kind:t,title:e,message:i}}showUnlinkConfirmation(t){let{messages:i}=this;this.alertOptions={kind:"danger",icon:"exclamation-mark-triangle-f",title:i.unlinkAccount,message:i.unlinkWarning,actions:[{text:i.unlink,kind:"danger",clickHandler:()=>{this.alertOptions=void 0,this.unlinkAccount(t)}}]}}render(){let{linkedAccounts:t,accountAccess:i,user:e,portal:s,messages:n,signout:a}=this;if(!s||!e)return null;if(a){let{signedInAccounts:r}=this;return r.length===0?d`<calcite-loader .label=${n.signingOut} .text=${n.signingOut}></calcite-loader>`:d`<arcgis-portal-account-switcher-signout .portal=${s} .signedInAccounts=${r} @arcgisSwitchAccount=${c=>{this.switchAccount(c.detail.account)}} @arcgisSignOutAll=${()=>{this.signoutAll(r)}}></arcgis-portal-account-switcher-signout>`}return d`<calcite-dialog .heading=${n.switchAccounts} heading-level=2 scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${()=>{this.arcgisClose.emit()}}><calcite-block .heading=${n.currentAccount} heading-level=3 .description=${n.signedInAs} expanded class="current-account-block" tabindex=-1>${T(e.id??e.username,d`<calcite-block class="current-account" .label=${s.urlKey?`${e.username}, ${s.name}`:e.username} heading-level=4 .heading=${e.username} .description=${s.urlKey?`${e.fullName??e.username}, ${s.name}`:e.fullName??e.username}><calcite-avatar slot=content-start inert .fullName=${e.fullName??void 0} .username=${e.username} .userId=${e.id} .thumbnail=${P(e,s)??void 0}></calcite-avatar></calcite-block>`)}</calcite-block>${t.length>0?d`<calcite-block .heading=${n.linkedAccounts} heading-level=3 .description=${n.linkedAccountActions} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${()=>this.startAccountLink()} .disabled=${t.length>=y}>${n.addAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${t} .accountAccess=${i} .signedInUsers=${Object.keys(this.signedInStatus).filter(r=>this.signedInStatus[r]!==null)} interactive @arcgisAccountSwitch=${r=>{this.switchAccount(r.detail.account)}} @arcgisAccountUnlink=${r=>{this.showUnlinkConfirmation(r.detail.account)}}></arcgis-portal-account-switcher-list></calcite-block>`:d`<calcite-block .heading=${n.linkedAccounts} heading-level=3 expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${I`<path d=${J.couple??L} fill=currentColor />`}</svg><h4>${n.emptyListTitle}</h4><p>${n.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${()=>this.startAccountLink()} .disabled=${t.length>=y}>${n.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${t.length>=y}><div slot=message>${n.maxAccounts}</div></calcite-notice><calcite-alert .label=${n.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind!=="danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${()=>{this.alertOptions=void 0}}>${this.alertOptions?.title&&d`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>`||""}${this.alertOptions?.message&&d`<p slot=message class=${_({"alert-message":!0,"short-message":!!this.alertOptions?.actions?.length})}>${this.alertOptions.message}</p>`||""}${this.alertOptions?.actions?.map(r=>d`<calcite-button slot=actions-end .kind=${r.kind} .appearance=${r.appearance} @click=${r.clickHandler}>${r.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning&&d`<arcgis-portal-account-switcher-accounts .portal=${s} .targetUser=${this.targetUser} .accounts=${this.userAccounts??[]} @arcgisLinkAll=${()=>{this.linkAccount(this.targetUser,this.targetToken)}} @arcgisCloseDialog=${()=>{this.showAssociatedAccountsWarning=!1}}></arcgis-portal-account-switcher-accounts>`||""}`}};x("arcgis-portal-account-switcher",S);return S},"identity/IdentityManager","intl",a,b,c)
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as J}from"./YVKSTDL6.js";import c from"./RBGARTND.js";import b from"./F3ODJVJC.js";import{a as T}from"./OV5O7YP4.js";import{a as P}from"./KYNL256E.js";import{a as K}from"./23X56P4K.js";import a from"./OUFIJDIW.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import{b as M}from"./2GBRZSEC.js";import{a as B}from"./XUPYBBRI.js";import"./C5U7YKVI.js";import"./6BMWSGLA.js";import{L as O,M as _,O as L,R as x,j as d,k as I,w as A}from"./CWSEBETE.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([p,{substitute:w},,,{f:N,g:E,h:H,i:W}])=>{var b=1260*1e3,q=2500;function R(o,t="_blank",i=582,e=670){let s=window.screenLeft??0,n=window.screenTop??0,a=window.innerWidth||document.documentElement.clientWidth||window.screen.width,r=window.innerHeight||document.documentElement.clientHeight||window.screen.height,c=a/2-i/2+s,l=r/2-e/2+n,u=window.open(o,t,`scrollbars=no, width=${i}, height=${e}, top=${l}, left=${c}`);return u?.focus(),u}function z(o){let t=p.findOAuthInfo(o.url),{locale:i="en",expiration:e=b}=t??{},s=new URLSearchParams({locale:i,client_id:"arcgisonline",response_type:"token",expiration:`${e}`,linkUserRequest:"true",showSocialLogins:"true",hideEnterpriseLogins:"false",force_login:"true",parent:window.location.origin,redirect_uri:`https://${o.portalHostname}/home/link_account_callback.html`,state:JSON.stringify({useMessage:!0})}),n=`https://${o.portalHostname}/sharing/oauth2/authorize?${s.toString()}`;R(n)}function U(o){let{config:t,token:i,clientId:e="arcgisonline",redirectToClientUri:s=!1,displaySignoutComplete:n=!1,clientUri:a}=o,r=new URLSearchParams({display:"iframe",client_id:e,...i&&{token:i},parent:window.location.origin,redirect_uri:`${t.baseUrl}/home/check_sign_in_status.html`,state:JSON.stringify({signout:!0,origin:window.location.origin,accountOrigin:`${t.restBaseUrl}/`,redirectToClientUri:s,displaySignoutComplete:n,...a&&{redirectUri:a}})}),c=`${t.restBaseUrl}/oauth2/signout?${r.toString()}`,l=document.createElement("iframe");l.src=c,l.style.display="none",document.body.appendChild(l)}function F(o,t,i){let e=h(o.orgUrlKey,t),s=p.findOAuthInfo(e),{appId:n,locale:a="en",expiration:r=b}=s??{},c=C(o.provider),l=new URLSearchParams({locale:a,client_id:i??n??"arcgisonline",response_type:"token",expiration:`${r}`,parent:window.location.origin,...c==="social"&&{socialLoginProviderName:o.provider},...c==="default"&&{prepopulatedusername:o.username},force_login:"true",redirect_uri:`${e}/home/sign_in_callback.html`,state:JSON.stringify({user:o.username,server:e,portalUrl:e,origin:window.location.origin})}),u=`${v(o,t)}?${l.toString()}`;R(u)}function G({accounts:o,clientId:t="arcgisonline",usersToFilter:i=[],accountsToFilter:e=""}){let s={};return o.reduce((n,a)=>{let r={disabled:a.disabled??!1,allowed:a.clientAppAccessAllowed??!0};return n[a.username]=r,(i.includes(a.username)||i.includes(a.username.toLowerCase())||e==="org"&&a.orgUrlKey||t==="esriapps"&&a.userType!=="both")&&(r.allowed=!1),n},s),s}function Q({account:o,credential:t,clientId:i,portal:e,redirectUri:s}){let n=C(o.provider),a=v(o,e),r=s||D(o,e),c=new URLSearchParams({client_id:i,redirect_uri:r,parent:window.location.origin,response_type:"token",force_login:"false",...t.userId&&{prepopulatedusername:t.userId},...n==="social"&&{socialLoginProviderName:o.provider},expiration:`${(t?.expires??Date.now()+b)-Date.now()}`});return`${a}?${c.toString()}`}function C(o){return V(o)?"social":o==="enterprise"?"enterprise":o.includes("oidc")?"oidc":"default"}function V(o){return["apple","facebook","github","google"].includes(o)}function v(o,t){let i=h(o.orgUrlKey,t).toLowerCase(),e=C(o.provider),s="";switch(e){case"social":s="social/";break;case"enterprise":s="saml/";break;case"oidc":s=`oidc/${o.provider.split("_")[1]}/`;break}return`${i}/sharing/rest/oauth2/${s}authorize`}function h(o,t){return o?.startsWith("https://")?o:o&&t.customBaseUrl?`https://${o}.${t.customBaseUrl}`:`https://${t.portalHostname}`}function D(o,t){return`${h(o.orgUrlKey,t)}/home/accountswitcher-callback.html`}function X(o,t){return p.findCredential(h(o.orgUrlKey,t),o.username)}function Y(o,t){let i=X(o,t);if(i)return i;let e=h(o.orgUrlKey,t),s=`${e}/home/check_sign_in_status.html#state=${JSON.stringify({origin:window.location.origin,server:e,orgKey:e})}`;Z(s,`iframe__for-${e}`)}function Z(o,t){let i=document.createElement("iframe");i.src=o,i.id=t,i.style.display="none",document.body.appendChild(i)}var y=100,S=class extends O{constructor(){super(),this.messages=B({blocking:!0}),this.targetUser="",this.targetToken="",this.accountAccess={},this.remainingSignouts=0,this.signoutHandle=0,this.linkedAccounts=[],this.loading=!1,this.signedInStatus={},this.showAssociatedAccountsWarning=!1,this.signedInAccounts=[],this.clientId="arcgisonline",this.signout=!1,this.signoutOptions={redirectToClientUri:!1,displaySignoutComplete:!1},this.arcgisAccountSwitch=A(),this.arcgisClose=A(),this.arcgisSignoutComplete=A(),this.listenOn(window,"message",this.handleMessageEvent)}static{this.properties={linkedAccounts:16,userAccounts:16,user:16,credential:16,alertOptions:16,loading:16,signedInStatus:16,showAssociatedAccountsWarning:16,signedInAccounts:16,portal:0,clientId:1,redirectUri:1,signout:5,signoutOptions:0}}static{this.styles=K}willUpdate(t){if(t.has("portal")&&(this.user=this.portal?.user),(t.has("portal")||t.has("user"))&&this.portal&&this.user){this.findLinkedUsers();return}if(t.has("linkedAccounts")||t.has("signedInStatus")){if(this.signout){let{signedInStatus:i,linkedAccounts:e,portal:s,signoutOptions:n,clientId:a,user:r,redirectUri:c}=this,l=Object.keys(i).filter(k=>i[k]!==null).map(k=>e.find(j=>j.username===k));this.remainingSignouts=l.length+1;let u=h(s.urlKey??"",s),f=`${u}/sharing/rest`,{displaySignoutComplete:g=!0,redirectToClientUri:m=!0}=n;l.length>0&&(g=!1,m=!1),this.loading=!0;let $=p.findCredential(u,r?.id||r?.username);U({displaySignoutComplete:g,redirectToClientUri:m,clientId:a,config:{baseUrl:u,restBaseUrl:f},token:$?.token,clientUri:m?c:void 0}),this.signoutHandle=window.setTimeout(()=>{this.remainingSignouts-=1,this.finishSignout({accountOrigin:u,redirectToClientUri:m,displaySignoutComplete:g})},q)}return}}handleMessageEvent(t){if(new URL(t.origin).hostname!=="localhost"&&(t.origin.endsWith(".arcgis.com")||t.origin===window.location.origin)){if(typeof t.data=="string"){JSON.parse(t.data).type==="token_exchange"&&this.handleExchangeTokenMessage(t);return}if("type"in t.data)switch(t.data.type){case"signin":this.handleSigninMessage(t);return;case"signout":this.handleSignoutMessage(t);return;case"linkUser":this.handleLinkUserMessage(t);return;case"token_exchange":this.handleExchangeTokenMessage(t);return}if("credential"in t.data){this.handleSigninMessage(t);return}this.handleCheckSignInStatusMessage(t)}}handleSignoutMessage(t){let{error:i,signout:e,accountOrigin:s,redirectToClientUri:n,displaySignoutComplete:a}=t.data;if(this.remainingSignouts-=1,i&&i!=="unknown"){console.error(i),this.showAlert("danger",this.messages.errors.signout);return}e&&(this.user=void 0,this.credential=void 0,this.finishSignout({accountOrigin:s,redirectToClientUri:n,displaySignoutComplete:a}))}handleSigninMessage(t){let{messages:i,clientId:e}=this,{error:s,status:n,state:a,access_token:r,ssl:c}=t.data;if(s){console.error(s),this.showAlert("danger",i.errors.signin);return}if(n==="success"){let{portal:l,user:u,redirectUri:f}=this,g=this.linkedAccounts.find(k=>k.username===a.user);g?.orgUrlKey===this.portal.urlKey&&p.findCredential(`https://${l.portalHostname}`,u?.username)?.destroy();let m={server:a.portalUrl,userId:a.user,token:r,expires:Number(t.data.expires_in)+Date.now(),ssl:c===void 0||c!=="false"};p.registerToken(m);let $=Q({account:g,credential:m,clientId:e,portal:l,redirectUri:f});window.self!==window.top?window.top?.postMessage({type:"navigate",url:$}):window.location.href=$}}handleCheckSignInStatusMessage(t){let{success:i,orgKey:e,server:s,userId:n,token:a,expires:r,ssl:c}=t.data;e&&s&&i&&n&&a&&r&&c!==void 0&&(this.signedInStatus[n]={token:a,expires:r,ssl:c})}async handleLinkUserMessage(t){let{error:i,username:e,access_token:s}=t.data,{portal:n,user:a,linkedAccounts:r,messages:c}=this;if(i){if(i.toString().toLowerCase().includes("user denied your request"))return;this.showAlert("danger",c.errors.accessAccount);return}if(e===a?.username){this.showAlert("danger",c.errors.selfLink);return}if(r.find(u=>u.username===e)){this.showAlert("danger",w(c.errors.alreadyLinked,{username:e}));return}let l=await E(n,e,s);if(l?.length){this.userAccounts=l,this.targetUser=e??"",this.targetToken=s??"",this.showAssociatedAccountsWarning=!0;return}this.linkAccount(e,s)}handleExchangeTokenMessage(t){let i=typeof t.data=="string"?JSON.parse(t.data):t.data;if(!(i.type&&i.type!=="token_exchange")){if(i.error)console.error(i);else if(i.status==="success"&&this.targetUser){let{portal:e,linkedAccounts:s,targetUser:n,clientId:a}=this,r=s.find(g=>g.username===n);if(!r)return;let c=D(r,e),l=h(r.orgUrlKey,e),u=new URLSearchParams({response_type:"token",client_id:a,redirect_uri:c,state:JSON.stringify({user:r.username,portalUrl:l})}),f=`${v(r,e)}?${u.toString()}`;window.opener?(window.opener.location.href=f,window.close()):window.location.href=f}}}finishSignout({accountOrigin:t,redirectToClientUri:i,displaySignoutComplete:e}){this.signoutHandle&&window.clearTimeout(this.signoutHandle),t===window.location.origin&&p.destroyCredentials(),console.info("Signout complete",t,i,e),this.remainingSignouts<=0&&this.arcgisSignoutComplete.emit({accountOrigin:t,redirectToClientUri:i,displaySignoutComplete:e})}async findLinkedUsers(){if(this.loading=!0,!this.portal||!this.user){this.linkedAccounts=[],this.loading=!1;return}this.linkedAccounts=await N(this.portal,this.user),this.linkedAccounts.length&&(this.signedInStatus=this.linkedAccounts.filter(t=>t.orgUrlKey!==this.portal.urlKey).reduce((t,i)=>(t[i.username]=Y(i,this.portal)??null,t),{}),this.accountAccess=G({accounts:this.linkedAccounts,clientId:this.clientId})),this.loading=!1}async linkAccount(t,i){let{portal:e,user:s}=this;if(!e||!s)return;let n=await H({portal:e,user:s,targetUser:t,targetToken:i}),{messages:a}=this;if(n.error){this.showAlert("danger",w(a.errors.linkAccount,{username:t})),this.targetUser="",this.userAccounts=[];return}let r=this.userAccounts?.length?a.success.linkAccountMultiple:a.success.linkAccount;this.showAlert("success",w(r,{username:t})),this.targetUser="",this.userAccounts=[],await M(350),this.findLinkedUsers()}async unlinkAccount(t){if(!this.portal||!this.user)return;let{messages:i,portal:e,user:s}=this,{success:n}=await W({portal:e,user:s,linkedUsername:t.username});n?this.showAlert("success",w(i.success.unlinkAccount,{username:t.username})):this.showAlert("danger",w(i.errors.unlinkAccount,{username:t.username})),await this.findLinkedUsers()}startAccountLink(){z(this.portal)}switchAccount(t){let{portal:i,user:e,clientId:s}=this;if(!i||!e||!t)return;let n=h(e.sourceJSON.orgUrlKey??"",i),a=p.findCredential(n,e.id||e.username);a&&U({config:{baseUrl:n,restBaseUrl:`${n}/sharing/rest`},token:a?.token,clientId:s}),F(t,i,s)}signoutAll(t){let{portal:i,signedInStatus:e,clientId:s}=this;t.forEach(n=>{let a=h(n.orgUrlKey,i),r=`${a}/sharing/rest`,c=e[n.username];U({config:{baseUrl:a,restBaseUrl:r},token:c?.token,clientId:s})})}showAlert(t,i,e){this.alertOptions={kind:t,title:e,message:i}}showUnlinkConfirmation(t){let{messages:i}=this;this.alertOptions={kind:"danger",icon:"exclamation-mark-triangle-f",title:i.unlinkAccount,message:i.unlinkWarning,actions:[{text:i.unlink,kind:"danger",clickHandler:()=>{this.alertOptions=void 0,this.unlinkAccount(t)}}]}}render(){let{linkedAccounts:t,accountAccess:i,user:e,portal:s,messages:n,signout:a}=this;if(!s||!e)return null;if(a){let{signedInAccounts:r}=this;return r.length===0?d`<calcite-loader .label=${n.signingOut} .text=${n.signingOut}></calcite-loader>`:d`<arcgis-portal-account-switcher-signout .portal=${s} .signedInAccounts=${r} @arcgisSwitchAccount=${c=>{this.switchAccount(c.detail.account)}} @arcgisSignOutAll=${()=>{this.signoutAll(r)}}></arcgis-portal-account-switcher-signout>`}return d`<calcite-dialog .heading=${n.switchAccounts} heading-level=2 scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${()=>{this.arcgisClose.emit()}}><calcite-block .heading=${n.currentAccount} heading-level=3 .description=${n.signedInAs} expanded class="current-account-block" tabindex=-1>${T(e.id??e.username,d`<calcite-block class="current-account" .label=${s.urlKey?`${e.username}, ${s.name}`:e.username} heading-level=4 .heading=${e.username} .description=${s.urlKey?`${e.fullName??e.username}, ${s.name}`:e.fullName??e.username}><calcite-avatar slot=content-start inert .fullName=${e.fullName??void 0} .username=${e.username} .userId=${e.id} .thumbnail=${P(e,s)??void 0}></calcite-avatar></calcite-block>`)}</calcite-block>${t.length>0?d`<calcite-block .heading=${n.linkedAccounts} heading-level=3 .description=${n.linkedAccountActions} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${()=>this.startAccountLink()} .disabled=${t.length>=y}>${n.addAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${t} .accountAccess=${i} .signedInUsers=${Object.keys(this.signedInStatus).filter(r=>this.signedInStatus[r]!==null)} interactive @arcgisAccountSwitch=${r=>{this.switchAccount(r.detail.account)}} @arcgisAccountUnlink=${r=>{this.showUnlinkConfirmation(r.detail.account)}}></arcgis-portal-account-switcher-list></calcite-block>`:d`<calcite-block .heading=${n.linkedAccounts} heading-level=3 expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${I`<path d=${J.couple??L} fill=currentColor />`}</svg><h4>${n.emptyListTitle}</h4><p>${n.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${()=>this.startAccountLink()} .disabled=${t.length>=y}>${n.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${t.length>=y}><div slot=message>${n.maxAccounts}</div></calcite-notice><calcite-alert .label=${n.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind!=="danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${()=>{this.alertOptions=void 0}}>${this.alertOptions?.title&&d`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>`||""}${this.alertOptions?.message&&d`<p slot=message class=${_({"alert-message":!0,"short-message":!!this.alertOptions?.actions?.length})}>${this.alertOptions.message}</p>`||""}${this.alertOptions?.actions?.map(r=>d`<calcite-button slot=actions-end .kind=${r.kind} .appearance=${r.appearance} @click=${r.clickHandler}>${r.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning&&d`<arcgis-portal-account-switcher-accounts .portal=${s} .targetUser=${this.targetUser} .accounts=${this.userAccounts??[]} @arcgisLinkAll=${()=>{this.linkAccount(this.targetUser,this.targetToken)}} @arcgisCloseDialog=${()=>{this.showAssociatedAccountsWarning=!1}}></arcgis-portal-account-switcher-accounts>`||""}`}};x("arcgis-portal-account-switcher",S);return S},"identity/IdentityManager","intl",a,b,c)
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{e as f}from"./VDXESPJK.js";import{a as m}from"./TWCJJCPC.js";import{a as b}from"./7ZWYUHGK.js";import{L as p,R as u,h,j as i,w as r}from"./AICPYLWE.js";var g={sm:640,md:768,lg:1024};var w=h`:host{display:flex;align-items:center}.status-list{display:flex;align-items:center;max-width:100%}.status-chip{max-width:100%;--calcite-color-foreground-2: var(--calcite-color-foreground-1)}.chip-group{max-width:100%;min-width:0}.status-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.popover-content{max-width:28rem;padding:.75rem}.clear-button{margin-inline-start:.25rem}`,o=class extends p{constructor(){super(...arguments),this._messages=b({name:"portal-browser",blocking:!0}),this.inBounds=[],this.outOfBounds=[],this.filters={},this.hiddenFilterIds=[],this.arcgisBrowserFilterClear=r(),this.arcgisBrowserFilterRemove=r()}static{this.properties={inBounds:16,outOfBounds:16,filters:0,hiddenFilterIds:0,componentWidth:9,browserWidth:9}}static{this.styles=w}connectedCallback(){super.connectedCallback(),this.processValidFilters()}willUpdate(t){(t.has("filters")||t.has("hiddenFilterIds")||t.has("componentWidth")||t.has("browserWidth"))&&this.processValidFilters()}isFilterValid(t){return this.hiddenFilterIds.includes(t.id)?!1:t.id==="collaborations"&&"additionalParams"in t?!!(t.additionalParams&&t.label):!!(t.value&&t.label)}processValidFilters(){let t=Object.values(this.filters).filter(this.isFilterValid.bind(this)),s=this.componentWidth??0;if((this.browserWidth??s??window.innerWidth)<g.sm){this.inBounds=t,this.outOfBounds=[];return}let a=Math.max(s-460,0),e=0,n=[],c=[];t.forEach(l=>{let d=f({text:l.label});!s||e+d<=a?(n.push(l),e+=d):c.push(l)}),this.inBounds=n,this.outOfBounds=c}renderChip(t){return m(t.id,i`<calcite-chip class="status-chip" scale=s .label=${t.label} .value=${t.id} closable appearance=outline @calciteChipClose=${()=>{this.arcgisBrowserFilterRemove.emit(t.id)}}><span class="status-chip__label">${t.label}</span></calcite-chip>`)}render(){let t=this._messages.filterStatus,s=this.outOfBounds.length>0,a=this.inBounds.length+this.outOfBounds.length;return a?i`<div class="status-list"><calcite-chip-group class="chip-group" .label=${t.filters} scale=s>${this.inBounds.map(e=>this.renderChip(e))}${s&&i`<calcite-button id=popover-button round kind=neutral appearance=outline scale=s>+ ${this.outOfBounds.length}</calcite-button>`||""}</calcite-chip-group>${s&&i`<calcite-popover .label=${t.additional} reference-element=popover-button placement=bottom-end><div class="popover-content"><calcite-chip-group .label=${t.additional} scale=s>${this.outOfBounds.map(e=>this.renderChip(e))}</calcite-chip-group></div></calcite-popover>`||""}${a>1&&i`<calcite-button class="clear-button" scale=s appearance=transparent kind=brand @click=${()=>this.arcgisBrowserFilterClear.emit(null)}>${t.clearAllFilters}</calcite-button>`||""}</div>`:null}};u("arcgis-portal-browser-filter-status",o);export{g as a,o as b};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{e as f}from"./25XJ66JO.js";import{a as m}from"./OV5O7YP4.js";import{a as b}from"./XUPYBBRI.js";import{L as p,R as u,h,j as i,w as r}from"./CWSEBETE.js";var g={sm:640,md:768,lg:1024};var w=h`:host{display:flex;align-items:center}.status-list{display:flex;align-items:center;max-width:100%}.status-chip{max-width:100%;--calcite-color-foreground-2: var(--calcite-color-foreground-1)}.chip-group{max-width:100%;min-width:0}.status-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.popover-content{max-width:28rem;padding:.75rem}.clear-button{margin-inline-start:.25rem}`,o=class extends p{constructor(){super(...arguments),this._messages=b({name:"portal-browser",blocking:!0}),this.inBounds=[],this.outOfBounds=[],this.filters={},this.hiddenFilterIds=[],this.arcgisBrowserFilterClear=r(),this.arcgisBrowserFilterRemove=r()}static{this.properties={inBounds:16,outOfBounds:16,filters:0,hiddenFilterIds:0,componentWidth:9,browserWidth:9}}static{this.styles=w}connectedCallback(){super.connectedCallback(),this.processValidFilters()}willUpdate(t){(t.has("filters")||t.has("hiddenFilterIds")||t.has("componentWidth")||t.has("browserWidth"))&&this.processValidFilters()}isFilterValid(t){return this.hiddenFilterIds.includes(t.id)?!1:t.id==="collaborations"&&"additionalParams"in t?!!(t.additionalParams&&t.label):!!(t.value&&t.label)}processValidFilters(){let t=Object.values(this.filters).filter(this.isFilterValid.bind(this)),s=this.componentWidth??0;if((this.browserWidth??s??window.innerWidth)<g.sm){this.inBounds=t,this.outOfBounds=[];return}let a=Math.max(s-460,0),e=0,n=[],c=[];t.forEach(l=>{let d=f({text:l.label});!s||e+d<=a?(n.push(l),e+=d):c.push(l)}),this.inBounds=n,this.outOfBounds=c}renderChip(t){return m(t.id,i`<calcite-chip class="status-chip" scale=s .label=${t.label} .value=${t.id} closable appearance=outline @calciteChipClose=${()=>{this.arcgisBrowserFilterRemove.emit(t.id)}}><span class="status-chip__label">${t.label}</span></calcite-chip>`)}render(){let t=this._messages.filterStatus,s=this.outOfBounds.length>0,a=this.inBounds.length+this.outOfBounds.length;return a?i`<div class="status-list"><calcite-chip-group class="chip-group" .label=${t.filters} scale=s>${this.inBounds.map(e=>this.renderChip(e))}${s&&i`<calcite-button id=popover-button round kind=neutral appearance=outline scale=s>+ ${this.outOfBounds.length}</calcite-button>`||""}</calcite-chip-group>${s&&i`<calcite-popover .label=${t.additional} reference-element=popover-button placement=bottom-end><div class="popover-content"><calcite-chip-group .label=${t.additional} scale=s>${this.outOfBounds.map(e=>this.renderChip(e))}</calcite-chip-group></div></calcite-popover>`||""}${a>1&&i`<calcite-button class="clear-button" scale=s appearance=transparent kind=brand @click=${()=>this.arcgisBrowserFilterClear.emit(null)}>${t.clearAllFilters}</calcite-button>`||""}</div>`:null}};u("arcgis-portal-browser-filter-status",o);export{g as a,o as b};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./SG7Z5VLB.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([a])=>{return a},a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{ka as t}from"./FTKD53UG.js";import"./XOFCMJBQ.js";import c from"./B3NVWHCS.js";import{b as a}from"./YUQFNMEZ.js";import b from"./SG7Z5VLB.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([r,{b:i}])=>{var p=async(o={})=>{let{tier:e="default",config:m}=o,n=a[e],c=await i(e);return new t({modelName:n,apiKey:"dummy-key",configuration:{baseURL:c,fetch:await r({config:m})},batchSize:2048,maxConcurrency:10})};return p},b,c)
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{a as ue}from"./IN4JPZTY.js";import{a as he}from"./DAAON2UO.js";import{a as ce}from"./EMJQI4MA.js";import{a as pe}from"./7ZWYUHGK.js";import"./A2SQ4EMZ.js";import"./K2XSYDAP.js";import{L as ae,R as oe,h as le,j as T,w as F}from"./AICPYLWE.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var z=J();function Re(n){z=n}var A={exec:()=>null};function I(n){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),r=e[s];return r||(r=n(s),e[s]=r),r}}function u(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(b.caret,"$1"),t=t.replace(r,a),s},getRegex:()=>new RegExp(t,e)};return s}var qe=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),b={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:I(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:I(n=>new RegExp(`^ {0,${n}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:I(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:I(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:I(n=>new RegExp(`^ {0,${n}}(?:</?(?:${D})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:I(n=>new RegExp(`^ {0,${n}}>`))},Ze=/^(?:[ \t]*(?:\n|$))+/,De=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Me=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Z=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,K=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Te=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ae=u(Te).replace(/bull/g,K).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Oe=u(Te).replace(/bull/g,K).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),V=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,je=/^[^\n]+/,Y=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,He=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Y).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ne=u(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,K).getRegex(),D="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ee=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ge=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ee).replace("tag",D).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e=n=>u(V).replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),Fe=_e(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Xe=_e(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ue=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xe).getRegex(),te={blockquote:Ue,code:De,def:He,fences:Me,heading:Qe,hr:Z,html:Ge,lheading:Ae,list:Ne,newline:Ze,paragraph:Fe,table:A,text:je},ge=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),We={...te,lheading:Oe,table:ge,paragraph:u(V).replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ge).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex()},Je={...te,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(V).replace("hr",Z).replace("heading",` *#{1,6} *[^
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as ue}from"./OQGUCK3G.js";import{a as he}from"./5YDITHQA.js";import{a as ce}from"./2GBRZSEC.js";import{a as pe}from"./XUPYBBRI.js";import"./C5U7YKVI.js";import"./6BMWSGLA.js";import{L as ae,R as oe,h as le,j as T,w as F}from"./CWSEBETE.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var z=J();function Re(n){z=n}var A={exec:()=>null};function I(n){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),r=e[s];return r||(r=n(s),e[s]=r),r}}function u(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(b.caret,"$1"),t=t.replace(r,a),s},getRegex:()=>new RegExp(t,e)};return s}var qe=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),b={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:I(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:I(n=>new RegExp(`^ {0,${n}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:I(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:I(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:I(n=>new RegExp(`^ {0,${n}}(?:</?(?:${D})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:I(n=>new RegExp(`^ {0,${n}}>`))},Ze=/^(?:[ \t]*(?:\n|$))+/,De=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Me=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Z=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,K=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Te=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ae=u(Te).replace(/bull/g,K).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Oe=u(Te).replace(/bull/g,K).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),V=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,je=/^[^\n]+/,Y=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,He=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Y).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ne=u(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,K).getRegex(),D="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ee=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ge=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ee).replace("tag",D).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e=n=>u(V).replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),Fe=_e(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Xe=_e(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ue=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xe).getRegex(),te={blockquote:Ue,code:De,def:He,fences:Me,heading:Qe,hr:Z,html:Ge,lheading:Ae,list:Ne,newline:Ze,paragraph:Fe,table:A,text:je},ge=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),We={...te,lheading:Oe,table:ge,paragraph:u(V).replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ge).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex()},Je={...te,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(V).replace("hr",Z).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("lheading",Ae).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ke=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ve=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ze=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Ye=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,y=/[\p{P}\p{S}]/u,L=/[\s\p{P}\p{S}]/u,M=/[^\s\p{P}\p{S}]/u,et=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,L).getRegex(),tt=/[\p{Pi}\p{Ps}"']/u,Pe=/(?!~)[\p{P}\p{S}]/u,rt=/(?!~)[\s\p{P}\p{S}]/u,nt=/(?:[^\s\p{P}\p{S}]|~)/u,st=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",qe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ie=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,it=u(Ie,"u").replace(/punct/g,y).getRegex(),lt=u(Ie,"u").replace(/punct/g,Pe).getRegex(),at=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,ot=u(at,"u").replace(/openQuote/g,tt).replace(/punct/g,y).getRegex(),Le="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ct=u(Le,"gu").replace(/notPunctSpace/g,M).replace(/punctSpace/g,L).replace(/punct/g,y).getRegex(),pt=u(Le,"gu").replace(/notPunctSpace/g,nt).replace(/punctSpace/g,rt).replace(/punct/g,Pe).getRegex(),ht="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",ut=u(ht,"gu").replace(/notPunctSpace/g,M).replace(/punctSpace/g,L).replace(/punct/g,y).getRegex(),gt=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,M).replace(/punctSpace/g,L).replace(/punct/g,y).getRegex(),kt="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",dt=u(kt,"gu").replace(/notPunctSpace/g,M).replace(/punctSpace/g,L).replace(/punct/g,y).getRegex(),ft=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,y).getRegex(),xt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",bt=u(xt,"gu").replace(/notPunctSpace/g,M).replace(/punctSpace/g,L).replace(/punct/g,y).getRegex(),mt=u(/\\(punct)/,"gu").replace(/punct/g,y).getRegex(),wt=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$t=u(ee).replace("(?:-->|$)","-->").getRegex(),St=u("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$t).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ve=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,O=u(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",ve).getRegex(),yt=u(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",O).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rt=u(/^!?\[(label)\]\[(ref)\]/).replace("label",O).replace("ref",Y).getRegex(),Tt=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",Y).getRegex(),ke=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,At=u(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",ve).getRegex(),_t=u("reflink|nolink(?!\\()","g").replace("reflink",u(/^!?\[(label)\]\[(ref)\]/).replace("label",At).replace("ref",ke).getRegex()).replace("nolink",u(/^!?\[(ref)\](?:\[\])?/).replace("ref",ke).getRegex()).getRegex(),de=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zt=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Pt=u(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,zt).getRegex(),re={_backpedal:A,anyPunctuation:mt,autolink:wt,blockSkip:st,br:ze,code:Ve,del:A,delLDelim:A,delRDelim:A,emStrongLDelim:it,emStrongRDelimAst:ct,emStrongRDelimUnd:gt,escape:Ke,link:yt,nolink:Tt,punctuation:et,reflink:Rt,reflinkSearch:_t,tag:St,text:Ye,url:A},It={...re,emStrongLDelim:ot,emStrongRDelimAst:ut,emStrongRDelimUnd:dt,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",O).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",O).getRegex()},X={...re,emStrongRDelimAst:pt,emStrongLDelim:lt,delLDelim:ft,delRDelim:bt,url:u(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Pt).replace("protocol",de).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:u(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",de).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Lt={...X,br:u(ze).replace("{2,}","*").getRegex(),text:u(X.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:te,gfm:We,pedantic:Je},B={normal:re,gfm:X,breaks:Lt,pedantic:It},vt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fe=n=>vt[n];function w(n,e){if(e){if(b.escapeTest.test(n))return n.replace(b.escapeReplace,fe)}else if(b.escapeTestNoEncode.test(n))return n.replace(b.escapeReplaceNoEncode,fe);return n}function Ct(n){return n.replace(b.numericCharacterReference,(e,t,s)=>{let r=t===void 0?Number.parseInt(s,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function xe(n){try{n=encodeURI(n).replace(b.percentDecode,"%")}catch{return null}return n}function be(n,e){let t=n.replace(b.findPipe,(i,a,l)=>{let c=!1,o=a;for(;--o>=0&&l[o]==="\\";)c=!c;return c?"|":" |"}),s=t.split(b.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(b.slashPipe,"|");return s}function R(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s;){let i=n.charAt(s-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return n.slice(0,s-r)}function me(n){let e=n.split(`
4
4
  `),t=e.length-1;for(;t>=0&&b.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(`
5
5
  `)}function j(n){return n.trim().toLowerCase().toUpperCase().toLowerCase()}function we(n,e){if(n.indexOf(e[0])===-1&&n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function $e(n,e=0){let t=e,s="";for(let r of n)if(r===" "){let i=4-t%4;s+=" ".repeat(i),t+=i}else s+=r,t++;return s}function Se(n,e,t,s,r){let i=e.href,a=e.title||null,l=n[1].replace(r.other.outputLinkReplace,"$1"),c=n[0].charAt(0)==="!";s.state.inLink=!0;let o=s.state.linkEmitted,p=s.state.inRawBlock;s.state.linkEmitted=!1;let h=s.inlineTokens(l),x=s.state.linkEmitted;if(s.state.linkEmitted=o,s.state.inLink=!1,!c){if(x){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:c?"image":"link",raw:t,href:i,title:a,text:l,tokens:h}}function Et(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`