@esri/solutions-components 0.10.42 → 0.10.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. package/dist/cjs/calcite-action-pad_2.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-block_5.cjs.entry.js +25 -26
  3. package/dist/cjs/card-manager_3.cjs.entry.js +32 -4
  4. package/dist/cjs/{constants-51cf394f.js → constants-bed33322.js} +3 -11
  5. package/dist/cjs/crowdsource-reporter.cjs.entry.js +112 -49
  6. package/dist/cjs/{helpers-afcac967.js → helpers-0493759d.js} +1 -1
  7. package/dist/cjs/instant-apps-app-guide.cjs.entry.js +2 -2
  8. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +3 -3
  9. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +1 -1
  10. package/dist/cjs/instant-apps-create.cjs.entry.js +2 -2
  11. package/dist/cjs/instant-apps-export-views.cjs.entry.js +2 -2
  12. package/dist/cjs/instant-apps-export.cjs.entry.js +2 -2
  13. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +2 -2
  14. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +2 -2
  15. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +2 -2
  16. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +21 -7
  17. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +3 -3
  18. package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +2 -2
  19. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +7 -7
  20. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +6 -6
  21. package/dist/cjs/instant-apps-measurement.cjs.entry.js +2 -2
  22. package/dist/cjs/instant-apps-popover.cjs.entry.js +2 -2
  23. package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +2 -2
  24. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +2 -2
  25. package/dist/cjs/instant-apps-splash.cjs.entry.js +6 -5
  26. package/dist/cjs/instant-apps-time-filter.cjs.entry.js +2 -2
  27. package/dist/cjs/{loadModules-8567855e.js → loadModules-df8b13ca.js} +1 -1
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/cjs/{locale-4a18a858.js → locale-4b820602.js} +1 -1
  30. package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
  31. package/dist/cjs/solutions-components.cjs.js +1 -1
  32. package/dist/cjs/{utils-fa7ad44b.js → utils-3f10ea6b.js} +2 -2
  33. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +112 -49
  34. package/dist/collection/components/layer-table/layer-table.js +32 -4
  35. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +2 -2
  36. package/dist/components/crowdsource-reporter.js +112 -49
  37. package/dist/components/instant-apps-filter-list2.js +25 -26
  38. package/dist/components/instant-apps-interactive-legend-relationship2.js +19 -5
  39. package/dist/components/instant-apps-language-switcher.js +3 -3
  40. package/dist/components/instant-apps-language-translator2.js +4 -12
  41. package/dist/components/instant-apps-splash.js +4 -3
  42. package/dist/components/layer-table2.js +32 -4
  43. package/dist/components/loadModules2.js +1 -1
  44. package/dist/components/solution-spatial-ref2.js +2 -2
  45. package/dist/components/utils4.js +1 -1
  46. package/dist/esm/calcite-action-pad_2.entry.js +1 -1
  47. package/dist/esm/calcite-block_5.entry.js +25 -26
  48. package/dist/esm/card-manager_3.entry.js +32 -4
  49. package/dist/esm/{constants-886c7c2c.js → constants-637a40f5.js} +3 -11
  50. package/dist/esm/crowdsource-reporter.entry.js +112 -49
  51. package/dist/esm/{helpers-91087955.js → helpers-91ca0f44.js} +1 -1
  52. package/dist/esm/instant-apps-app-guide.entry.js +2 -2
  53. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +3 -3
  54. package/dist/esm/instant-apps-control-panel.entry.js +1 -1
  55. package/dist/esm/instant-apps-create.entry.js +2 -2
  56. package/dist/esm/instant-apps-export-views.entry.js +2 -2
  57. package/dist/esm/instant-apps-export.entry.js +2 -2
  58. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +2 -2
  59. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +2 -2
  60. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +2 -2
  61. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +21 -7
  62. package/dist/esm/instant-apps-interactive-legend.entry.js +3 -3
  63. package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +2 -2
  64. package/dist/esm/instant-apps-language-switcher.entry.js +7 -7
  65. package/dist/esm/instant-apps-language-translator.entry.js +6 -6
  66. package/dist/esm/instant-apps-measurement.entry.js +2 -2
  67. package/dist/esm/instant-apps-popover.entry.js +2 -2
  68. package/dist/esm/instant-apps-scoreboard.entry.js +2 -2
  69. package/dist/esm/instant-apps-sign-in.entry.js +2 -2
  70. package/dist/esm/instant-apps-splash.entry.js +6 -5
  71. package/dist/esm/instant-apps-time-filter.entry.js +2 -2
  72. package/dist/esm/{loadModules-03ba7abe.js → loadModules-d5a25252.js} +1 -1
  73. package/dist/esm/loader.js +1 -1
  74. package/dist/esm/{locale-ce177eb8.js → locale-77038bee.js} +1 -1
  75. package/dist/esm/solution-contents_3.entry.js +1 -1
  76. package/dist/esm/solutions-components.js +1 -1
  77. package/dist/esm/{utils-3fc29543.js → utils-0a78d3c9.js} +2 -2
  78. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-splash/instant-apps-splash.css +7 -0
  79. package/dist/solutions-components/{p-b739f26d.entry.js → p-053effee.entry.js} +1 -1
  80. package/dist/solutions-components/{p-af573e0d.js → p-09543b4e.js} +1 -1
  81. package/dist/solutions-components/p-1b1ff60a.entry.js +6 -0
  82. package/dist/solutions-components/{p-e4107150.entry.js → p-2291bf3f.entry.js} +1 -1
  83. package/dist/solutions-components/p-2cf41651.entry.js +6 -0
  84. package/dist/solutions-components/{p-fe3aea1a.entry.js → p-351c7cbf.entry.js} +1 -1
  85. package/dist/solutions-components/{p-90fc786f.entry.js → p-3d999f0f.entry.js} +1 -1
  86. package/dist/solutions-components/p-3fe6c230.entry.js +6 -0
  87. package/dist/solutions-components/p-4695cfab.js +6 -0
  88. package/dist/solutions-components/{p-43699470.entry.js → p-499489c5.entry.js} +1 -1
  89. package/dist/solutions-components/{p-5ff711ee.js → p-5104cc98.js} +1 -1
  90. package/dist/solutions-components/p-5e694bcc.entry.js +29 -0
  91. package/dist/solutions-components/{p-cbb86cf2.entry.js → p-6a3f2249.entry.js} +1 -1
  92. package/dist/solutions-components/{p-a7f56b28.entry.js → p-6e5ea1cb.entry.js} +1 -1
  93. package/dist/solutions-components/{p-9c170b30.entry.js → p-76a1236d.entry.js} +1 -1
  94. package/dist/solutions-components/{p-1e14b3d0.entry.js → p-78b6d3fe.entry.js} +1 -1
  95. package/dist/solutions-components/{p-c48be45f.entry.js → p-8a1a0f9b.entry.js} +1 -1
  96. package/dist/solutions-components/{p-5cbf3eed.entry.js → p-8d4a4498.entry.js} +1 -1
  97. package/dist/solutions-components/{p-4a02fd45.entry.js → p-9d9e0e74.entry.js} +1 -1
  98. package/dist/solutions-components/{p-50fb7f47.js → p-b49e1a78.js} +1 -1
  99. package/dist/solutions-components/{p-c551ffc5.entry.js → p-c399f2b8.entry.js} +1 -1
  100. package/dist/solutions-components/p-cb27611e.entry.js +6 -0
  101. package/dist/solutions-components/{p-4cd4cb85.js → p-d001e961.js} +1 -1
  102. package/dist/solutions-components/{p-523dcf4b.entry.js → p-d37a68f7.entry.js} +1 -1
  103. package/dist/solutions-components/{p-a2cf9fdc.entry.js → p-db7d5db8.entry.js} +1 -1
  104. package/dist/solutions-components/{p-6438d1ea.entry.js → p-e29e57db.entry.js} +1 -1
  105. package/dist/solutions-components/{p-a5b751e2.entry.js → p-e625aa69.entry.js} +1 -1
  106. package/dist/solutions-components/{p-2542d5c9.entry.js → p-e9fcc194.entry.js} +1 -1
  107. package/dist/solutions-components/p-f0509d41.entry.js +6 -0
  108. package/dist/solutions-components/{p-374ddead.entry.js → p-f4880179.entry.js} +1 -1
  109. package/dist/solutions-components/solutions-components.esm.js +1 -1
  110. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +43 -17
  111. package/dist/types/components/layer-table/layer-table.d.ts +4 -0
  112. package/package.json +7 -7
  113. package/dist/solutions-components/p-3fc18283.entry.js +0 -6
  114. package/dist/solutions-components/p-442dd59c.entry.js +0 -6
  115. package/dist/solutions-components/p-5585dcd3.entry.js +0 -6
  116. package/dist/solutions-components/p-953afbb3.entry.js +0 -29
  117. package/dist/solutions-components/p-a1d8aed8.entry.js +0 -6
  118. package/dist/solutions-components/p-ceb1030b.js +0 -6
  119. package/dist/solutions-components/p-f728af86.entry.js +0 -6
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as n,h as i,H as s,g as e}from"./p-4e6eb06e.js";import{l as o}from"./p-4cd4cb85.js";import{g as r}from"./p-5ff711ee.js";import{g as a}from"./p-a9a72626.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const p=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function c(t){const n=[];for(let i=0,s=t.length;i<s;i++)n.push(t[i]);return n}function l(t,n){const i=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(n);return i?parseFloat(i.replace("px","")):0}function h(t,n={}){return{width:n.width||function(t){const n=l(t,"border-left-width"),i=l(t,"border-right-width");return t.clientWidth+n+i}(t),height:n.height||function(t){const n=l(t,"border-top-width"),i=l(t,"border-bottom-width");return t.clientHeight+n+i}(t)}}const d=16384;function u(t){return new Promise(((n,i)=>{const s=new Image;s.decode=()=>n(s),s.onload=()=>n(s),s.onerror=i,s.crossOrigin="anonymous",s.decoding="async",s.src=t}))}const f=(t,n)=>{if(t instanceof n)return!0;const i=Object.getPrototypeOf(t);return null!==i&&(i.constructor.name===n.name||f(i,n))};function g(t,n,i){const s=window.getComputedStyle(t,i),e=s.getPropertyValue("content");if(""===e||"none"===e)return;const o=p();try{n.className=`${n.className} ${o}`}catch(t){return}const r=document.createElement("style");r.appendChild(function(t,n,i){const s=`.${t}:${n}`,e=i.cssText?function(t){const n=t.getPropertyValue("content");return`${t.cssText} content: '${n.replace(/'|"/g,"")}';`}(i):function(t){return c(t).map((n=>`${n}: ${t.getPropertyValue(n)}${t.getPropertyPriority(n)?" !important":""};`)).join(" ")}(i);return document.createTextNode(`${s}{${e}}`)}(o,i,s)),n.appendChild(r)}const v="application/font-woff",x="image/jpeg",m={woff:v,woff2:v,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:x,jpeg:x,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function _(t){const n=function(t){const n=/\.([^./]*?)$/g.exec(t);return n?n[1]:""}(t).toLowerCase();return m[n]||""}function b(t){return-1!==t.search(/^(data:)/)}function w(t,n){return`data:${n};base64,${t}`}async function y(t,n,i){const s=await fetch(t,n);if(404===s.status)throw new Error(`Resource "${s.url}" not found`);const e=await s.blob();return new Promise(((t,n)=>{const o=new FileReader;o.onerror=n,o.onloadend=()=>{try{t(i({res:s,result:o.result}))}catch(t){n(t)}},o.readAsDataURL(e)}))}const k={};async function P(t,n,i){const s=function(t,n,i){let s=t.replace(/\?.*/,"");return i&&(s=t),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),n?`[${n}]${s}`:s}(t,n,i.includeQueryParams);if(null!=k[s])return k[s];let e;i.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());try{const s=await y(t,i.fetchRequestInit,(({res:t,result:i})=>(n||(n=t.headers.get("Content-Type")||""),function(t){return t.split(/,/)[1]}(i))));e=w(s,n)}catch(n){e=i.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;n&&(s="string"==typeof n?n:n.message),s&&console.warn(s)}return k[s]=e,e}const $=t=>null!=t.tagName&&"SLOT"===t.tagName.toUpperCase();async function S(t,n,i){return i||!n.filter||n.filter(t)?Promise.resolve(t).then((t=>async function(t,n){return f(t,HTMLCanvasElement)?async function(t){const n=t.toDataURL();return"data:,"===n?t.cloneNode(!1):u(n)}(t):f(t,HTMLVideoElement)?async function(t,n){if(t.currentSrc){const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t.clientWidth,n.height=t.clientHeight,null==i||i.drawImage(t,0,0,n.width,n.height),u(n.toDataURL())}const i=t.poster,s=_(i);return u(await P(i,s,n))}(t,n):f(t,HTMLIFrameElement)?async function(t){var n;try{if(null===(n=null==t?void 0:t.contentDocument)||void 0===n?void 0:n.body)return await S(t.contentDocument.body,{},!0)}catch(t){}return t.cloneNode(!1)}(t):t.cloneNode(!1)}(t,n))).then((i=>async function(t,n,i){var s,e;let o=[];return o=$(t)&&t.assignedNodes?c(t.assignedNodes()):f(t,HTMLIFrameElement)&&(null===(s=t.contentDocument)||void 0===s?void 0:s.body)?c(t.contentDocument.body.childNodes):c((null!==(e=t.shadowRoot)&&void 0!==e?e:t).childNodes),0===o.length||f(t,HTMLVideoElement)||await o.reduce(((t,s)=>t.then((()=>S(s,i))).then((t=>{t&&n.appendChild(t)}))),Promise.resolve()),n}(t,i,n))).then((n=>function(t,n){return f(n,Element)&&(function(t,n){const i=n.style;if(!i)return;const s=window.getComputedStyle(t);s.cssText?(i.cssText=s.cssText,i.transformOrigin=s.transformOrigin):c(s).forEach((e=>{let o=s.getPropertyValue(e);if("font-size"===e&&o.endsWith("px")){const t=Math.floor(parseFloat(o.substring(0,o.length-2)))-.1;o=`${t}px`}f(t,HTMLIFrameElement)&&"display"===e&&"inline"===o&&(o="block"),"d"===e&&n.getAttribute("d")&&(o=`path(${n.getAttribute("d")})`),i.setProperty(e,o,s.getPropertyPriority(e))}))}(t,n),function(t,n){g(t,n,":before"),g(t,n,":after")}(t,n),function(t,n){f(t,HTMLTextAreaElement)&&(n.innerHTML=t.value),f(t,HTMLInputElement)&&n.setAttribute("value",t.value)}(t,n),function(t,n){if(f(t,HTMLSelectElement)){const i=Array.from(n.children).find((n=>t.value===n.getAttribute("value")));i&&i.setAttribute("selected","")}}(t,n)),n}(t,n))).then((t=>async function(t,n){const i=t.querySelectorAll?t.querySelectorAll("use"):[];if(0===i.length)return t;const s={};for(let e=0;e<i.length;e++){const o=i[e].getAttribute("xlink:href");if(o){const i=t.querySelector(o),e=document.querySelector(o);i||!e||s[o]||(s[o]=await S(e,n,!0))}}const e=Object.values(s);if(e.length){const n="http://www.w3.org/1999/xhtml",i=document.createElementNS(n,"svg");i.setAttribute("xmlns",n),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const s=document.createElementNS(n,"defs");i.appendChild(s);for(let t=0;t<e.length;t++)s.appendChild(e[t]);t.appendChild(i)}return t}(t,n))):null}const C=/url\((['"]?)([^'"]+?)\1\)/g,E=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,F=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function M(t){return-1!==t.search(C)}async function j(t,n,i){if(!M(t))return t;const s=function(t,{preferredFontFormat:n}){return n?t.replace(F,(t=>{for(;;){const[i,,s]=E.exec(t)||[];if(!s)return"";if(s===n)return`src: ${i};`}})):t}(t,i),e=function(t){const n=[];return t.replace(C,((t,i,s)=>(n.push(s),t))),n.filter((t=>!b(t)))}(s);return e.reduce(((t,s)=>t.then((t=>async function(t,n,i,s,e){try{const o=i?function(t,n){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const i=document.implementation.createHTMLDocument(),s=i.createElement("base"),e=i.createElement("a");return i.head.appendChild(s),i.body.appendChild(e),n&&(s.href=n),e.href=t,e.href}(n,i):n,r=_(n);let a;return a=e?w(await e(o),r):await P(o,r,s),t.replace(function(t){const n=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${n})(['"]?\\))`,"g")}(n),`$1${a}$3`)}catch(t){}return t}(t,s,n,i)))),Promise.resolve(s))}async function L(t,n,i){var s;const e=null===(s=n.style)||void 0===s?void 0:s.getPropertyValue(t);if(e){const s=await j(e,null,i);return n.style.setProperty(t,s,n.style.getPropertyPriority(t)),!0}return!1}async function T(t,n){f(t,Element)&&(await async function(t,n){await L("background",t,n)||await L("background-image",t,n),await L("mask",t,n)||await L("mask-image",t,n)}(t,n),await async function(t,n){const i=f(t,HTMLImageElement);if((!i||b(t.src))&&(!f(t,SVGImageElement)||b(t.href.baseVal)))return;const s=i?t.src:t.href.baseVal,e=await P(s,_(s),n);await new Promise(((n,s)=>{t.onload=n,t.onerror=s;const o=t;o.decode&&(o.decode=n),"lazy"===o.loading&&(o.loading="eager"),i?(t.srcset="",t.src=e):t.href.baseVal=e}))}(t,n),await async function(t,n){const i=c(t.childNodes).map((t=>T(t,n)));await Promise.all(i).then((()=>t))}(t,n))}const D={};async function I(t){let n=D[t];if(null!=n)return n;const i=await fetch(t);return n={url:t,cssText:await i.text()},D[t]=n,n}async function O(t,n){let i=t.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,e=(i.match(/url\([^)]+\)/g)||[]).map((async e=>{let o=e.replace(s,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),y(o,n.fetchRequestInit,(({result:t})=>(i=i.replace(e,`url(${t})`),[e,t])))}));return Promise.all(e).then((()=>i))}function z(t){if(null==t)return[];const n=[];let i=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const t=s.exec(i);if(null===t)break;n.push(t[0])}i=i.replace(s,"");const e=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=e.exec(i);if(null===t){if(t=o.exec(i),null===t)break;e.lastIndex=o.lastIndex}else o.lastIndex=e.lastIndex;n.push(t[0])}return n}async function R(t,n){const i=null!=n.fontEmbedCSS?n.fontEmbedCSS:n.skipFonts?null:await async function(t,n){const i=await async function(t,n){if(null==t.ownerDocument)throw new Error("Provided element is not within a Document");const i=c(t.ownerDocument.styleSheets),s=await async function(t,n){const i=[],s=[];return t.forEach((i=>{if("cssRules"in i)try{c(i.cssRules||[]).forEach(((t,e)=>{if(t.type===CSSRule.IMPORT_RULE){let o=e+1;const r=I(t.href).then((t=>O(t,n))).then((t=>z(t).forEach((t=>{try{i.insertRule(t,t.startsWith("@import")?o+=1:i.cssRules.length)}catch(n){console.error("Error inserting rule from remote css",{rule:t,error:n})}})))).catch((t=>{console.error("Error loading remote css",t.toString())}));s.push(r)}}))}catch(e){const o=t.find((t=>null==t.href))||document.styleSheets[0];null!=i.href&&s.push(I(i.href).then((t=>O(t,n))).then((t=>z(t).forEach((t=>{o.insertRule(t,i.cssRules.length)})))).catch((t=>{console.error("Error loading remote stylesheet",t)}))),console.error("Error inlining remote css file",e)}})),Promise.all(s).then((()=>(t.forEach((t=>{if("cssRules"in t)try{c(t.cssRules||[]).forEach((t=>{i.push(t)}))}catch(n){console.error(`Error while reading CSS rules from ${t.href}`,n)}})),i)))}(i,n);return function(t){return t.filter((t=>t.type===CSSRule.FONT_FACE_RULE)).filter((t=>M(t.style.getPropertyValue("src"))))}(s)}(t,n);return(await Promise.all(i.map((t=>j(t.cssText,t.parentStyleSheet?t.parentStyleSheet.href:null,n))))).join("\n")}(t,n);if(i){const n=document.createElement("style"),s=document.createTextNode(i);n.appendChild(s),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function H(t,n={}){const{width:i,height:s}=h(t,n),e=await S(t,n,!0);return await R(e,n),await T(e,n),function(t,n){const{style:i}=t;n.backgroundColor&&(i.backgroundColor=n.backgroundColor),n.width&&(i.width=`${n.width}px`),n.height&&(i.height=`${n.height}px`);const s=n.style;null!=s&&Object.keys(s).forEach((t=>{i[t]=s[t]}))}(e,n),await async function(t,n,i){const s="http://www.w3.org/2000/svg",e=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return e.setAttribute("width",`${n}`),e.setAttribute("height",`${i}`),e.setAttribute("viewBox",`0 0 ${n} ${i}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),e.appendChild(o),o.appendChild(t),async function(t){return Promise.resolve().then((()=>(new XMLSerializer).serializeToString(t))).then(encodeURIComponent).then((t=>`data:image/svg+xml;charset=utf-8,${t}`))}(e)}(e,i,s)}async function V(t,n={}){const{width:i,height:s}=h(t,n),e=await H(t,n),o=await u(e),r=document.createElement("canvas"),a=r.getContext("2d"),p=n.pixelRatio||function(){let t,n;try{n=process}catch(t){}const i=n&&n.env?n.env.devicePixelRatio:null;return i&&(t=parseInt(i,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}(),c=n.canvasWidth||i,l=n.canvasHeight||s;return r.width=c*p,r.height=l*p,n.skipAutoScale||function(t){(t.width>d||t.height>d)&&(t.width>d&&t.height>d?t.width>t.height?(t.height*=d/t.width,t.width=d):(t.width*=d/t.height,t.height=d):t.width>d?(t.height*=d/t.width,t.width=d):(t.width*=d/t.height,t.height=d))}(r),r.style.width=`${c}`,r.style.height=`${l}`,n.backgroundColor&&(a.fillStyle=n.backgroundColor,a.fillRect(0,0,r.width,r.height)),a.drawImage(o,0,0,r.width,r.height),r}const G="instant-apps-export calcite-mode-light",U="instant-apps-export-print instant-apps-export-print__pdf",W="instant-apps-export-print instant-apps-export-print__img",A="instant-apps-export-print__img--extra-content",B="instant-apps-export-print__content-container",N="instant-apps-export-print__extra-container",J="instant-apps-export-print__legend-container",q="instant-apps-export-print__compass-container",X="instant-apps-export-print__scale-bar-container",K="instant-apps-export-print__popup-container",Q="instant-apps-export-print__popup-content",Y="instant-apps-export-print__popup-title",Z="instant-apps-export-print__view",tt="instant-apps-export-print__view-container",nt="instant-apps-export-print__view-wrapper",it="instant-app-export-drag",st=class{constructor(i){t(this,i),this.exportOutputUpdated=n(this,"exportOutputUpdated",7),this.fileTypes=["PDF","JPG","PNG"],this.output=void 0,this.beforeExport=()=>Promise.resolve(),this.popoverIcon="export",this.extraContent=void 0,this.extraContentLabel=void 0,this.headerTitle="",this.logoImage="",this.includeExtraContent=!0,this.showExtraContentInImg=!1,this.includeLegend=!0,this.includeMap=!0,this.includePopup=!1,this.includeFileFormat=!0,this.mode="popover",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.scale="m",this.showHeaderTitle=!0,this.showIncludeLegend=!0,this.showIncludeMap=!1,this.showIncludePopup=!0,this.showScaleBar=!1,this.view=void 0,this.maskBackground="rgba(255, 51, 0, 0.1)",this.maskBorder="2px dashed rgb(255, 51, 0)",this.baseClass=G,this.exportIsLoading=void 0,this.messages=void 0,this.selectedFileType="PDF"}watchIncludeMap(t){t&&this.updateLegend()}watchView(){this.handleIncludePopup()}async componentWillLoad(){this.baseClass="dark"===a(this.el)?"instant-apps-export calcite-mode-dark":G,r(this),await this.initializeModules()}componentDidLoad(){this.printContainerEl.prepend(this.printEl),this.handleIncludePopup()}async initializeModules(){const[t,n]=await o(["esri/core/Handles","esri/core/reactiveUtils"]);return this.handles=new t,this.reactiveUtils=n,Promise.resolve()}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel(),n=this.renderCompass();return i(s,{key:"9811c244faf2c794db3edaad498a9a902cb3faad"},i("div",{key:"cb880c04d46ec06a9588cedc0bd90ab62d25c0ac",class:this.baseClass,onMouseEnter:this.handleWidgetCreation.bind(this),onFocusin:this.handleWidgetCreation.bind(this)},t,i("div",{key:"fc7ccd1eeb4b6a82bd9804d1aa73c4f242085a56",class:"instant-apps-export__visually-hidden"},n)))}renderPopover(){var t,n,s;const e=this.renderPanel();return[i("calcite-popover",{referenceElement:"export-popover-btn",label:null===(t=this.messages)||void 0===t?void 0:t.exportPopover,overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t},e),i("calcite-action",{id:"export-popover-btn",alignment:"center",icon:this.popoverIcon,scale:this.scale,title:null===(n=this.messages)||void 0===n?void 0:n.exportBtn,text:null===(s=this.messages)||void 0===s?void 0:s.exportBtn})]}renderPanel(){var t,n,s;const e=this.showHeaderTitle?this.renderTitle():null,o=null!=this.extraContent?this.renderSwitch("includeExtraContent",this.extraContentLabel,"PDF"!==this.selectedFileType&&!this.showExtraContentInImg):null,r=this.showIncludeMap?this.renderSwitch("includeMap",void 0,"PDF"!==this.selectedFileType):null,a=this.includeMap?this.renderMapOptions():null,p=this.includeFileFormat?this.renderSelectFileType():null,c="PDF"===this.selectedFileType?this.renderPrint():this.renderImg();return i("div",{class:"inline"===this.mode?"instant-apps-export__inline-container":"instant-apps-export__popover-container"},e,o,r,a,p,this.includeMap?i("calcite-button",{appearance:"transparent",width:"full",onClick:this.setMapAreaOnClick.bind(this,!0),disabled:this.exportIsLoading},null===(t=this.messages)||void 0===t?void 0:t.setMapArea):null,i("calcite-button",{width:"full",onClick:this.exportOnClick.bind(this),disabled:this.exportIsLoading},"PDF"===this.selectedFileType?null===(n=this.messages)||void 0===n?void 0:n.export:null===(s=this.messages)||void 0===s?void 0:s.preview),c)}renderTitle(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.title,i("calcite-input",{value:this.headerTitle,onCalciteInputInput:this.updateHeaderTitle.bind(this)}))}renderSwitch(t,n,s){var e;const o=null!=n?n:null===(e=this.messages)||void 0===e?void 0:e[t];return i("calcite-label",{layout:"inline-space-between"},o,i("calcite-switch",{checked:this[t],value:t,onCalciteSwitchChange:this.optionOnChange.bind(this),disabled:s}))}renderSelectFileType(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.fileType,i("calcite-select",{onCalciteSelectChange:this.handleSelectFileType.bind(this)},this.fileTypes.map((t=>i("calcite-option",{value:t,selected:t===this.selectedFileType},t)))))}renderMapOptions(){const t=this.showIncludeLegend?this.renderSwitch("includeLegend"):null,n=this.showIncludePopup?this.renderSwitch("includePopup"):null;return i("div",null,t,n)}renderPrint(){const t=this.includeMap?this.renderPrintMap():null,n=this.renderExtraContent(),s=this.includeMap&&this.showIncludeLegend?this.renderLegend():null,e=this.includeMap&&this.showIncludePopup?this.renderPopup():null;return i("div",{ref:t=>this.printContainerEl=t},i("div",{class:U,ref:t=>this.printEl=t},t,s,i("div",{class:B},e,n)))}renderPrintMap(){return i("div",{class:tt,ref:t=>this.viewContainerEl=t},i("div",{class:nt,ref:t=>this.viewWrapperEl=t},this.headerTitle?i("instant-apps-header",{logoImage:this.logoImage,logoScale:"s",titleText:this.headerTitle,backgroundColor:"#fff",textColor:"#323232"}):null,i("img",{class:Z,ref:t=>this.viewEl=t}),i("div",{class:X,ref:t=>this.scaleBarContainerEl=t})))}renderLegend(){return i("div",{class:J,ref:t=>this.legendContainerEl=t})}renderCompass(){return i("div",{class:q,ref:t=>this.compassContainerEl=t})}renderPopup(){return i("div",{class:K,ref:t=>this.popupContainerEl=t},i("div",{ref:t=>this.popupTitleEl=t,class:Y}),i("div",{ref:t=>this.popupContentEl=t,class:Q}))}renderExtraContent(){return i("div",{class:N,id:"export-content",ref:t=>this.extraContainerEl=t})}renderImg(){const t=this.includeMap?this.renderPrintMap():null,n=this.includeMap&&this.showIncludeLegend?this.renderLegend():null;let s;return this.includeMap&&this.showIncludePopup?s=this.renderPopup():this.showExtraContentInImg&&null!=this.extraContent&&this.includeExtraContent&&(s=this.renderExtraContent()),i("div",{ref:t=>this.printContainerEl=t},i("div",{class:W,ref:t=>this.printEl=t},t,n,s))}optionOnChange(t){const{checked:n,value:i}=t.target;this[i]=n,this.updateExportOutput()}updateHeaderTitle(t){this.headerTitle=t.target.value,this.updateExportOutput()}async exportOnClick(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}async exportPreviewOnClick(){"PDF"===this.selectedFileType?await this.exportPDF():this.exportImg()}async exportPDF(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}exportImg(){var t;if(this.resetPopupVisibility(),null==this.dataUrl)return;const n=document.createElement("a");n.id="download-link",n.href=this.dataUrl,n.download=null!==(t=this.headerTitle)&&void 0!==t?t:document.title,n.click(),this.dataUrl=null,this.exportIsLoading=!1,this.removeScreenshotElements(),this.resetPrintContent()}async handleViewExportOnClick(){null!=this.view?(this.addPrintStyling(),document.body.prepend(this.printEl),this.handleExtraContent(),this.includeMap?(this.updateScaleBar(),this.viewScreenshot(),this.handleImgLoaded()):this.handleImgLoaded()):null!=this.popoverEl&&(this.popoverEl.open=!1)}addPrintStyling(){null==this.printStyleEl&&(this.printStyleEl=document.createElement("style"),this.printStyleEl.innerHTML='\n @media print {\n @page {\n size: Portrait;\n margin: .25in;\n }\n\n html, body {\n padding: 0;\n margin: 0;\n height: 100%;\n width: 100%;\n }\n\n body > *:not(.instant-apps-export-print) { display: none; }\n }\n\n * {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n }\n\n\n .instant-apps-export-print {\n position: absolute;\n z-index: -999;\n color: #323232 !important;\n --esri-calcite-mode-name: "light";\n }\n\n .instant-apps-export-print__pdf {\n height: 100%;\n width: 100%;\n display: grid;\n gap: 24px;\n grid-auto-flow: row;\n }\n\n .instant-apps-export-print__img {\n display: grid;\n width: auto;\n }\n\n .instant-apps-export-print__img--extra-content {\n grid-template-columns: 2fr minmax(0, 325px);\n }\n\n .instant-apps-export-print, .instant-apps-export-print * {\n box-sizing: border-box;\n }\n\n .instant-apps-export-print__view-section {\n height: 100%;\n }\n\n .instant-apps-export-print__view-container {\n height: 100%;\n width: 100%;\n display: flex;\n justify-content: center;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__view-container {\n grid-row: 1;\n grid-column: 1;\n }\n\n .instant-apps-export-print__view-wrapper {\n height: fit-content;\n width: fit-content;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .instant-apps-export-print__pdf .instant-apps-export-print__view-wrapper {\n border: 2pt solid #323232;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__view-wrapper {\n border: 1pt solid #323232;\n }\n\n .instant-apps-export-print__view {\n object-fit: contain;\n }\n\n .instant-apps-export-print__extra-container {\n grid-row: 1 / span 2;\n grid-column: 2;\n }\n \n .instant-apps-export-print__extra-container .esri-feature.esri-widget .esri-widget__heading.esri-feature__title {\n display: block;\n }\n\n .instant-apps-export-print__popup-container {\n height: min-content;\n max-width: 325px;\n display: none;\n color: #323232;\n background: #fff;\n break-inside: avoid;\n }\n\n .instant-apps-export-print__pdf .instant-apps-export-print__popup-container {\n border: 1pt solid #323232;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__popup-container {\n grid-row: 1 / span 2;\n grid-column: 2;\n }\n\n .instant-apps-export-print__popup-title {\n border-bottom: 1pt solid #323232;\n }\n\n .instant-apps-export-print__popup-content {\n background: #fff;\n padding-top: 8pt;\n }\n\n .instant-apps-export-print__popup-content .esri-feature-media__chart {\n background: #fff;\n }\n\n .instant-apps-export-print__legend-container {\n height: min-content;\n background: #fff;\n overflow: unset;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__legend-container {\n margin: 14px;\n grid-row: 2;\n grid-column: 1;\n }\n\n .esri-legend--card, .esri-legend--card__service-content {\n flex-flow: row wrap;\n }\n\n .instant-apps-export-print .esri-widget > *:not(.esri-scale-bar.esri-widget > *) {\n background: #fff;\n color: #323232;\n }\n\n .instant-apps-export-print__popup-content *, .instant-apps-export-print__img .esri-feature.esri-widget * {\n color: #323232;\n }\n\n .instant-apps-export-print .esri-widget__heading {\n margin: 4pt 7pt;\n padding: 0;\n color: #323232;\n }\n\n .instant-apps-export-print .esri-legend__ramp-label:before {\n border-color: rgba(0,0,0,0) rgba(50,50,50,.8) rgba(0,0,0,0) rgba(0,0,0,0);\n }\n\n .instant-apps-export-print .esri-legend--card__section {\n padding: 4pt 0 4pt;\n min-width: unset;\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__section:first-child {\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service {\n border: none;\n flex: 0 1 auto;\n break-inside: avoid;\n }\n\n .instant-apps-export-print .esri-legend--card {\n border: none;\n gap: 6pt 12pt;\n }\n\n .instant-apps-export-print .esri-legend--card:not(:first-child),\n .instant-apps-export-print .esri-compass.esri-widget:not(:first-child) {\n display: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-container {\n height: unset;\n padding: 0;\n border-bottom: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-text {\n padding-bottom: 4px;\n }\n\n .instant-apps-export-print__compass-container {\n position: absolute;\n top: 65px;\n left: 15px;\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n --calcite-ui-icon-color: #000;\n border-radius: 50%;\n height: fit-content;\n }\n\n .instant-apps-export-print__compass-container .esri-compass {\n background: #fff;\n }\n\n .instant-apps-export-print__compass-container .esri-compass__icon.esri-icon-compass {\n color: #000;\n }\n\n .instant-apps-export-print__compass-container.esri-compass.esri-widget--button {\n background: #fff;\n }\n\n .instant-apps-export-print__scale-bar-container {\n width: 100%;\n position: absolute;\n bottom: 15px;\n margin: 0 15px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {\n color: #323232;\n font-size: 10px;\n padding: 0 4px;\n }\n \n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label {\n height: 10px;\n padding: 0 2px;\n line-height: 11px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__bar-container:nth-child(1n+3) {\n display: none;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__bar-container.esri-scale-bar__bar-container--line {\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line {\n background-color: rgba(255, 255, 255, 0.66);\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top {\n width: var(--instant-apps-scale-bar-top) !important;\n border-bottom: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom {\n width: var(--instant-apps-scale-bar-bottom) !important;\n border-top: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label-container--line {\n position: unset;\n margin: 0 2px;\n background-color: rgba(255, 255, 255, 0.66);\n height: 10px;\n display: flex;\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:after,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:after {\n background-color: #323232;\n border-right: 2px solid #323232;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__item-navigation {\n display: none;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__chart.esri-feature-media__chart--rendered * {\n width: 100%!important;\n }\n\n .instant-apps-export-print__popup-content .esri-popup__content {\n margin: 0;\n }\n\n .instant-apps-export-print__content-container {\n display: flex;\n gap: 24px;\n break-inside: avoid;\n break-before: auto;\n }',document.body.prepend(this.printStyleEl))}handleImgLoaded(){this.exportIsLoading=!0,setTimeout((()=>{"PDF"===this.selectedFileType&&(this.exportIsLoading=!1),this.setupViewPrintElements()}),1500)}handleExtraContent(){const t=this.printEl.querySelector("#export-content");if(null!=t){t.innerHTML="";const n=null!=this.extraContent&&this.includeExtraContent;this.printEl.classList.toggle(A,"PDF"!==this.selectedFileType&&this.showExtraContentInImg&&n),n?(t.style.display="block",t.append(this.extraContent.cloneNode(!0))):t.style.display="none"}else this.showExtraContentInImg&&"PDF"!==this.selectedFileType&&!this.includeExtraContent&&this.printEl.classList.toggle(A,!1)}resetPrintContent(){var t,n,i;if(null!=this.view){this.screenshot=null,null===(t=this.printContainerEl)||void 0===t||t.prepend(this.printEl),null===(n=this.printStyleEl)||void 0===n||n.remove(),null===(i=this.tmpPopupTitleEl)||void 0===i||i.remove(),this.printStyleEl=void 0;const s=this.printEl.querySelector("#export-content");s&&(s.innerHTML="")}}async updatePopupToPrint(){var t,n;if(null==this.view||null==this.popupContainerEl)return;this.popupContainerEl.style.display=this.includePopup&&this.view.popup.visible?"block":"none",this.checkPopupOpen();const i=this.includePopup&&(this.view.popup.visible||this.popupHiddenByMapArea)&&null!=this.view.popup.selectedFeature;if(this.printEl.classList.toggle(A,"PDF"!==this.selectedFileType&&i),i){const i=document.createElement(`h${null!==(t=this.view.popup.headingLevel)&&void 0!==t?t:2}`);i.innerHTML=null!==(n=this.view.popup.title)&&void 0!==n?n:"",i.className="esri-widget__heading esri-popup__header-title",null==this.popupTitleEl?(this.tmpPopupTitleEl=document.createElement("div"),this.tmpPopupTitleEl.prepend(i),this.tmpPopupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupContainerEl.prepend(this.tmpPopupTitleEl)):(this.popupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupTitleEl.innerHTML="",this.popupTitleEl.prepend(i))}}updateExportOutput(){this.output={},this.showHeaderTitle&&(this.output.headerTitle=this.headerTitle),this.showIncludeLegend&&(this.output.includeLegend=this.includeLegend),this.showIncludeMap&&(this.output.includeMap=this.includeMap),this.showIncludePopup&&(this.output.includePopup=this.includePopup),this.exportOutputUpdated.emit()}setupViewPrintElements(){if(null!=this.view)if(this.handleLegendSetup(),"PDF"===this.selectedFileType){const t=document.title;this.showHeaderTitle&&this.headerTitle&&(document.title=this.headerTitle),window.print(),document.title=t,setTimeout((()=>{this.resetPrintContent()}),1e3)}else this.convertToImage()}convertToImage(){const t={backgroundColor:"#FFF",skipFonts:!0};"JPG"===this.selectedFileType?async function(t,n={}){return(await V(t,n)).toDataURL("image/jpeg",n.quality||1)}(this.printEl,t).then(this.handleGetImage.bind(this)):async function(t,n={}){return(await V(t,n)).toDataURL()}(this.printEl,t).then(this.handleGetImage.bind(this))}handleGetImage(t){var n;this.resetPrintContent(),this.dataUrl=t,this.setMapAreaOnClick(!1),this.showPreview(t),null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null)}handleLegendSetup(){var t;if(this.showIncludeLegend&&null!=this.view&&this.includeMap&&null!=this.legendContainerEl){const n=null!=this.legend&&(null===(t=this.legend.activeLayerInfos)||void 0===t?void 0:t.length)>0;this.legendContainerEl.style.display=this.includeLegend&&n?"block":"none"}}handleWidgetCreation(){this.includeMap&&(this.handleLegendCreation(),this.handleCompassCreation(),this.updatePopupToPrint())}handleIncludePopup(){var t,n;if(this.showIncludePopup){const i="includePopup";null===(t=this.handles)||void 0===t||t.remove(i),null===(n=this.reactiveUtils)||void 0===n||n.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready})).then((()=>{var t;null===(t=this.handles)||void 0===t||t.add(this.reactiveUtils.watch((()=>{var t,n;return null===(n=null===(t=this.view)||void 0===t?void 0:t.popup)||void 0===n?void 0:n.visible}),(t=>{this.settingMapArea||(this.includePopup=t)})),i)}))}}handleLegendCreation(){var t,n,i,s,e;if(null!=this.view&&this.showIncludeLegend&&null!=this.legendContainerEl){const o=this.view.map,r=null===(n=null===(t=this.legend)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;null!=(null===(i=null==o?void 0:o.portalItem)||void 0===i?void 0:i.id)&&(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)===(null===(e=null==r?void 0:r.portalItem)||void 0===e?void 0:e.id)||this.updateLegend()}}updateLegend(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{if(null!=this.legend&&(this.legend.destroy(),this.legend=null),null!=this.legendContainerEl){this.legendContainerEl.innerHTML="";const n=document.createElement("div");this.legendContainerEl.append(n);const[i]=await o(["esri/widgets/Legend"]);this.legend=new i({container:n,view:t,respectLayerDefinitionExpression:!0,style:{type:"card",layout:"side-by-side"}})}}))}handleCompassCreation(){var t,n,i,s;if(null!=this.view&&null!=this.compassContainerEl){const e=this.view.map,o=null===(n=null===(t=this.compass)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null===(i=null==e?void 0:e.portalItem)||void 0===i?void 0:i.id)===(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)||this.updateCompass()}}updateCompass(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.compass)||void 0===n||n.destroy(),this.compass=null;const i=document.createElement("div");this.compassContainerEl.append(i);const[s]=await o(["esri/widgets/Compass"]);this.compass=new s({container:i,view:t})}))}updateScaleBar(){if(this.scaleBarContainerEl&&null!=this.view&&(this.scaleBarContainerEl.innerHTML="",this.showScaleBar)){const t=this.view.ui.getComponents(),n=null==t?void 0:t.find((({container:t})=>{var n;return null===(n=null==t?void 0:t.className)||void 0===n?void 0:n.includes("esri-scale-bar")}));null!=(null==n?void 0:n.container)&&"string"!=typeof n.container&&this.scaleBarContainerEl.append(n.container.cloneNode(!0))}}async viewScreenshot(){var t;if(null!=this.view&&this.includeMap&&(null==this.screenshot&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3),this.screenshot=await this.view.takeScreenshot({width:2*this.view.width,height:2*this.view.height})),this.handleScaleBarSize(),null!=this.viewEl&&null!=this.viewWrapperEl)){const{height:t,width:n}=this.screenshot.data;t>n?this.setMaxRowHeightOnViewContainer():this.setMaxWidthOnViewContainer(),this.viewEl.src=this.screenshot.dataUrl}}setMaxRowHeightOnViewContainer(){"PDF"===this.selectedFileType&&(this.printEl.style.gridTemplateRows="minmax(auto, 70%)"),this.viewEl.style.height="100%",this.viewEl.style.width="",this.viewWrapperEl.style.height="100%",this.viewWrapperEl.style.width="fit-content"}setMaxWidthOnViewContainer(){this.printEl.style.gridTemplateRows="",this.viewEl.style.width="100%",this.viewEl.style.height="",this.viewWrapperEl.style.height="fit-content",this.viewWrapperEl.style.width="100%"}checkPopupOpen(){if(null!=this.view){const t=this.view.popup.container,n=null==t?void 0:t.querySelector(".esri-popup .esri-feature__main-container");if(null!=n){const t=n.querySelectorAll("canvas");this.popupContentEl.innerHTML="",this.popupContentEl.append(n.cloneNode(!0));const i=this.popupContentEl.querySelectorAll("canvas");t.forEach(((t,n)=>{var s;const e=t.toDataURL(),o=document.createElement("img");o.src=e;const r=t.getAttribute("style");r&&o.setAttribute("style",r);const a=i[n];null!=a&&(a.replaceWith(o),document.querySelector("link[href*='esri/themes/dark/main.css']")&&null!=(null===(s=o.parentElement)||void 0===s?void 0:s.parentElement)&&(o.parentElement.style.background="#242424",o.parentElement.parentElement.style.background="#242424"))}))}}}createScreenshot(){var t,n,i;if(null!=this.view){this.screenshotPreview=document.createElement("div"),this.screenshotPreview.className="screenshot-preview hide",this.screenshotImgContainer=document.createElement("div"),this.screenshotImgContainer.className="screenshot-img-container",this.screenshotImg=document.createElement("img");const s=document.createElement("div"),e=document.createElement("calcite-button"),o=document.createElement("calcite-button");e.innerHTML="PDF"===this.selectedFileType?null===(t=this.messages)||void 0===t?void 0:t.export:null===(n=this.messages)||void 0===n?void 0:n.downloadImage,o.innerHTML=null===(i=this.messages)||void 0===i?void 0:i.returnToMap,o.appearance="outline-fill",e.onclick=this.exportPreviewOnClick.bind(this),o.onclick=this.screenshotReturn.bind(this),s.append(o,e),this.screenshotImgContainer.append(this.screenshotImg,s),this.screenshotPreview.append(this.screenshotImgContainer),this.view.container.append(this.screenshotPreview)}}createMaskDiv(){null!=this.view&&(this.maskDivEl=document.createElement("div"),this.maskDivEl.id="screenshot-mask",this.maskDivEl.className="hide screenshot-cursor",this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-background",this.maskBackground),this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-border",this.maskBorder),this.screenshotStyle=document.createElement("style"),this.screenshotStyle.innerHTML="\n.screenshot-preview.hide, .hide {\n display: none;\n}\n\n.screenshot-cursor {\n cursor: crosshair;\n}\n\n.relative {\n position: relative;\n}\n\n#screenshot-mask {\n position: absolute;\n background: var(--instant-apps-screenshot-mask-background);\n border: var(--instant-apps-screenshot-mask-border);\n}\n\n.screenshot-preview {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n text-align: center;\n background-color: rgba(0, 0, 0, 0.75);\n}\n\n.screenshot-preview * {\n box-sizing: border-box;\n}\n\n.screenshot-img-container img {\n max-height: 75%;\n max-width: 75%;\n object-fit: contain;\n box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.5);\n margin-bottom: 0.5em;\n}\n\n.screenshot-img-container {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n margin-bottom: 8px;\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n}\n\n.screenshot-img-container calcite-button {\n margin: 5px;\n}",this.view.container.append(this.screenshotStyle),this.view.container.append(this.maskDivEl))}screenshotReturn(){this.removeScreenshotElements(),this.exportIsLoading=!1,this.screenshot=null,this.resetPopupVisibility()}setMapAreaOnClick(t){null!=this.view&&(this.settingMapArea=!0,t&&this.view.popup.visible&&(this.popupHiddenByMapArea=!0,this.view.popup.container.style.display="none"),this.exportIsLoading=!0,this.createMaskDiv(),this.createScreenshot(),this.view.container.classList.add("screenshot-cursor","relative"),this.view.addHandles(this.view.on("drag",(async t=>{null!=this.view&&(t.stopPropagation(),"end"!==t.action?this.updateMaskSize(t):this.maskScreenshot())})),it))}updateMaskSize(t){if(null!=this.view){const n=this.clamp(Math.min(t.origin.x,t.x),0,this.view.width),i=this.clamp(Math.max(t.origin.x,t.x),0,this.view.width),s=this.clamp(Math.min(t.origin.y,t.y),0,this.view.height),e=this.clamp(Math.max(t.origin.y,t.y),0,this.view.height);this.area={x:n,y:s,width:i-n,height:e-s},this.setMaskPosition(this.area)}}maskScreenshot(){var t;if(null!=this.view&&null!=this.area){this.view.removeHandles(it);const n=this.area.height,i=this.area.width;this.showScaleBar&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3&&.75*this.view.width<i)),this.view.takeScreenshot({area:this.area,width:2*i,height:2*n,format:"jpg"}).then((t=>{var n;this.screenshot=t,null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null),"PDF"===this.selectedFileType?(this.showPreview(null==t?void 0:t.dataUrl),this.resetPopupVisibility()):(null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1))}))}}setMaskPosition(t){null!=t?(this.maskDivEl.classList.remove("hide"),this.maskDivEl.style.left=`${t.x}px`,this.maskDivEl.style.top=`${t.y}px`,this.maskDivEl.style.width=`${t.width}px`,this.maskDivEl.style.height=`${t.height}px`):this.maskDivEl.remove()}clamp(t,n,i){return t<n?n:t>i?i:t}showPreview(t){t&&(this.screenshotPreview.classList.remove("hide"),null!=this.screenshotImg&&(this.screenshotImg.src=t))}handleScaleBarSize(){var t;if(this.showScaleBar&&"2d"===(null===(t=this.view)||void 0===t?void 0:t.type)&&null!=this.scaleBarContainerEl){const t=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--top"),n=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--bottom");this.setScalebarWidth(t,"top"),this.setScalebarWidth(n,"bottom")}}setScalebarWidth(t,n){var i;if(null!=t&&null!=this.screenshot){const s=this.screenshot.data.width/2,e=Number(t.style.width.replace("px",""));null===(i=this.scaleBarContainerEl)||void 0===i||i.style.setProperty(`--instant-apps-scale-bar-${n}`,e/s*100+"%")}}removeScreenshotElements(){var t,n,i;null===(t=this.view)||void 0===t||t.removeHandles(it),null===(n=this.screenshotPreview)||void 0===n||n.remove(),null===(i=this.screenshotStyle)||void 0===i||i.remove()}resetPopupVisibility(){this.view&&this.settingMapArea&&this.popupHiddenByMapArea&&(this.view.popup.container.style.display=""),this.settingMapArea=!1,this.popupHiddenByMapArea=!1}handleSelectFileType(t){this.selectedFileType=t.target.value,"PDF"===this.selectedFileType?(this.includeMap=this.pdfIncludeMap,this.showExtraContentInImg||(this.includeExtraContent=this.pdfIncludeExtraContent)):(this.pdfIncludeMap=this.includeMap,this.includeMap=!0,this.showExtraContentInImg||(this.pdfIncludeExtraContent=this.includeExtraContent,this.includeMap=!0,this.includeExtraContent=!1))}get el(){return e(this)}static get watchers(){return{includeMap:["watchIncludeMap"],view:["watchView"]}}};st.style=":host{display:block;--instant-apps-export-action-background:var(--calcite-color-foreground-1);--instant-apps-export-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-export-action-background-press:var(--calcite-color-foreground-3);--instant-apps-export-action-height:100%;--instant-apps-export-action-width:fit-content;--instant-apps-export-action-icon-color:var(--calcite-color-text-3);--instant-apps-export-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-export-background:var(--calcite-color-foreground-1);--instant-apps-export-text-color:var(--calcite-color-text-1);--instant-apps-export-popover-width:250px}.instant-apps-export{height:100%}.instant-apps-export *{box-sizing:border-box}.instant-apps-export__popover-container,.instant-apps-export__inline-container{padding:12px;background:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export__popover-container{width:var(--instant-apps-export-popover-width)}.instant-apps-export calcite-action{height:var(--instant-apps-export-action-height);width:var(--instant-apps-export-action-width);--calcite-color-foreground-1:var(--instant-apps-export-action-background);--calcite-color-foreground-2:var(--instant-apps-export-action-background-hover);--calcite-color-foreground-3:var(--instant-apps-export-action-background-press);--calcite-color-text-3:var(--instant-apps-export-action-icon-color);--calcite-color-text-1:var(--instant-apps-export-action-icon-hover-color)}.instant-apps-export .instant-apps-export-print{display:none}.instant-apps-export .instant-apps-export-print_img{display:flex;flex-flow:row wrap}.instant-apps-export__visually-hidden{position:absolute;top:0;z-index:-1;visibility:hidden}.instant-apps-export calcite-input{--calcite-color-foreground-1:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export calcite-popover{--calcite-color-foreground-1:var(--instant-apps-export-background)}.instant-apps-export calcite-switch{--calcite-color-foreground-1:#fff;--calcite-color-foreground-2:#f3f3f3}.instant-apps-export calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-export .calcite-mode-dark calcite-switch{--calcite-color-foreground-1:#2b2b2b;--calcite-color-foreground-2:#202020}.instant-apps-export__compass-container.esri-widget{background:#fff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.instant-apps-export__compass-container.esri-widget .esri-compass__icon.esri-icon-compass{color:#6e6e6e}.hide{display:none}.screenshotCursor{cursor:crosshair}";export{st as instant_apps_export}
6
+ import{r as t,c as n,h as i,H as s,g as e}from"./p-4e6eb06e.js";import{l as o}from"./p-d001e961.js";import{g as r}from"./p-5104cc98.js";import{g as a}from"./p-a9a72626.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const p=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function c(t){const n=[];for(let i=0,s=t.length;i<s;i++)n.push(t[i]);return n}function l(t,n){const i=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(n);return i?parseFloat(i.replace("px","")):0}function h(t,n={}){return{width:n.width||function(t){const n=l(t,"border-left-width"),i=l(t,"border-right-width");return t.clientWidth+n+i}(t),height:n.height||function(t){const n=l(t,"border-top-width"),i=l(t,"border-bottom-width");return t.clientHeight+n+i}(t)}}const d=16384;function u(t){return new Promise(((n,i)=>{const s=new Image;s.decode=()=>n(s),s.onload=()=>n(s),s.onerror=i,s.crossOrigin="anonymous",s.decoding="async",s.src=t}))}const f=(t,n)=>{if(t instanceof n)return!0;const i=Object.getPrototypeOf(t);return null!==i&&(i.constructor.name===n.name||f(i,n))};function g(t,n,i){const s=window.getComputedStyle(t,i),e=s.getPropertyValue("content");if(""===e||"none"===e)return;const o=p();try{n.className=`${n.className} ${o}`}catch(t){return}const r=document.createElement("style");r.appendChild(function(t,n,i){const s=`.${t}:${n}`,e=i.cssText?function(t){const n=t.getPropertyValue("content");return`${t.cssText} content: '${n.replace(/'|"/g,"")}';`}(i):function(t){return c(t).map((n=>`${n}: ${t.getPropertyValue(n)}${t.getPropertyPriority(n)?" !important":""};`)).join(" ")}(i);return document.createTextNode(`${s}{${e}}`)}(o,i,s)),n.appendChild(r)}const v="application/font-woff",x="image/jpeg",m={woff:v,woff2:v,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:x,jpeg:x,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function _(t){const n=function(t){const n=/\.([^./]*?)$/g.exec(t);return n?n[1]:""}(t).toLowerCase();return m[n]||""}function b(t){return-1!==t.search(/^(data:)/)}function w(t,n){return`data:${n};base64,${t}`}async function y(t,n,i){const s=await fetch(t,n);if(404===s.status)throw new Error(`Resource "${s.url}" not found`);const e=await s.blob();return new Promise(((t,n)=>{const o=new FileReader;o.onerror=n,o.onloadend=()=>{try{t(i({res:s,result:o.result}))}catch(t){n(t)}},o.readAsDataURL(e)}))}const k={};async function P(t,n,i){const s=function(t,n,i){let s=t.replace(/\?.*/,"");return i&&(s=t),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),n?`[${n}]${s}`:s}(t,n,i.includeQueryParams);if(null!=k[s])return k[s];let e;i.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());try{const s=await y(t,i.fetchRequestInit,(({res:t,result:i})=>(n||(n=t.headers.get("Content-Type")||""),function(t){return t.split(/,/)[1]}(i))));e=w(s,n)}catch(n){e=i.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;n&&(s="string"==typeof n?n:n.message),s&&console.warn(s)}return k[s]=e,e}const $=t=>null!=t.tagName&&"SLOT"===t.tagName.toUpperCase();async function S(t,n,i){return i||!n.filter||n.filter(t)?Promise.resolve(t).then((t=>async function(t,n){return f(t,HTMLCanvasElement)?async function(t){const n=t.toDataURL();return"data:,"===n?t.cloneNode(!1):u(n)}(t):f(t,HTMLVideoElement)?async function(t,n){if(t.currentSrc){const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t.clientWidth,n.height=t.clientHeight,null==i||i.drawImage(t,0,0,n.width,n.height),u(n.toDataURL())}const i=t.poster,s=_(i);return u(await P(i,s,n))}(t,n):f(t,HTMLIFrameElement)?async function(t){var n;try{if(null===(n=null==t?void 0:t.contentDocument)||void 0===n?void 0:n.body)return await S(t.contentDocument.body,{},!0)}catch(t){}return t.cloneNode(!1)}(t):t.cloneNode(!1)}(t,n))).then((i=>async function(t,n,i){var s,e;let o=[];return o=$(t)&&t.assignedNodes?c(t.assignedNodes()):f(t,HTMLIFrameElement)&&(null===(s=t.contentDocument)||void 0===s?void 0:s.body)?c(t.contentDocument.body.childNodes):c((null!==(e=t.shadowRoot)&&void 0!==e?e:t).childNodes),0===o.length||f(t,HTMLVideoElement)||await o.reduce(((t,s)=>t.then((()=>S(s,i))).then((t=>{t&&n.appendChild(t)}))),Promise.resolve()),n}(t,i,n))).then((n=>function(t,n){return f(n,Element)&&(function(t,n){const i=n.style;if(!i)return;const s=window.getComputedStyle(t);s.cssText?(i.cssText=s.cssText,i.transformOrigin=s.transformOrigin):c(s).forEach((e=>{let o=s.getPropertyValue(e);if("font-size"===e&&o.endsWith("px")){const t=Math.floor(parseFloat(o.substring(0,o.length-2)))-.1;o=`${t}px`}f(t,HTMLIFrameElement)&&"display"===e&&"inline"===o&&(o="block"),"d"===e&&n.getAttribute("d")&&(o=`path(${n.getAttribute("d")})`),i.setProperty(e,o,s.getPropertyPriority(e))}))}(t,n),function(t,n){g(t,n,":before"),g(t,n,":after")}(t,n),function(t,n){f(t,HTMLTextAreaElement)&&(n.innerHTML=t.value),f(t,HTMLInputElement)&&n.setAttribute("value",t.value)}(t,n),function(t,n){if(f(t,HTMLSelectElement)){const i=Array.from(n.children).find((n=>t.value===n.getAttribute("value")));i&&i.setAttribute("selected","")}}(t,n)),n}(t,n))).then((t=>async function(t,n){const i=t.querySelectorAll?t.querySelectorAll("use"):[];if(0===i.length)return t;const s={};for(let e=0;e<i.length;e++){const o=i[e].getAttribute("xlink:href");if(o){const i=t.querySelector(o),e=document.querySelector(o);i||!e||s[o]||(s[o]=await S(e,n,!0))}}const e=Object.values(s);if(e.length){const n="http://www.w3.org/1999/xhtml",i=document.createElementNS(n,"svg");i.setAttribute("xmlns",n),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const s=document.createElementNS(n,"defs");i.appendChild(s);for(let t=0;t<e.length;t++)s.appendChild(e[t]);t.appendChild(i)}return t}(t,n))):null}const C=/url\((['"]?)([^'"]+?)\1\)/g,E=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,F=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function M(t){return-1!==t.search(C)}async function j(t,n,i){if(!M(t))return t;const s=function(t,{preferredFontFormat:n}){return n?t.replace(F,(t=>{for(;;){const[i,,s]=E.exec(t)||[];if(!s)return"";if(s===n)return`src: ${i};`}})):t}(t,i),e=function(t){const n=[];return t.replace(C,((t,i,s)=>(n.push(s),t))),n.filter((t=>!b(t)))}(s);return e.reduce(((t,s)=>t.then((t=>async function(t,n,i,s,e){try{const o=i?function(t,n){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const i=document.implementation.createHTMLDocument(),s=i.createElement("base"),e=i.createElement("a");return i.head.appendChild(s),i.body.appendChild(e),n&&(s.href=n),e.href=t,e.href}(n,i):n,r=_(n);let a;return a=e?w(await e(o),r):await P(o,r,s),t.replace(function(t){const n=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${n})(['"]?\\))`,"g")}(n),`$1${a}$3`)}catch(t){}return t}(t,s,n,i)))),Promise.resolve(s))}async function L(t,n,i){var s;const e=null===(s=n.style)||void 0===s?void 0:s.getPropertyValue(t);if(e){const s=await j(e,null,i);return n.style.setProperty(t,s,n.style.getPropertyPriority(t)),!0}return!1}async function T(t,n){f(t,Element)&&(await async function(t,n){await L("background",t,n)||await L("background-image",t,n),await L("mask",t,n)||await L("mask-image",t,n)}(t,n),await async function(t,n){const i=f(t,HTMLImageElement);if((!i||b(t.src))&&(!f(t,SVGImageElement)||b(t.href.baseVal)))return;const s=i?t.src:t.href.baseVal,e=await P(s,_(s),n);await new Promise(((n,s)=>{t.onload=n,t.onerror=s;const o=t;o.decode&&(o.decode=n),"lazy"===o.loading&&(o.loading="eager"),i?(t.srcset="",t.src=e):t.href.baseVal=e}))}(t,n),await async function(t,n){const i=c(t.childNodes).map((t=>T(t,n)));await Promise.all(i).then((()=>t))}(t,n))}const D={};async function I(t){let n=D[t];if(null!=n)return n;const i=await fetch(t);return n={url:t,cssText:await i.text()},D[t]=n,n}async function O(t,n){let i=t.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,e=(i.match(/url\([^)]+\)/g)||[]).map((async e=>{let o=e.replace(s,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),y(o,n.fetchRequestInit,(({result:t})=>(i=i.replace(e,`url(${t})`),[e,t])))}));return Promise.all(e).then((()=>i))}function z(t){if(null==t)return[];const n=[];let i=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const t=s.exec(i);if(null===t)break;n.push(t[0])}i=i.replace(s,"");const e=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=e.exec(i);if(null===t){if(t=o.exec(i),null===t)break;e.lastIndex=o.lastIndex}else o.lastIndex=e.lastIndex;n.push(t[0])}return n}async function R(t,n){const i=null!=n.fontEmbedCSS?n.fontEmbedCSS:n.skipFonts?null:await async function(t,n){const i=await async function(t,n){if(null==t.ownerDocument)throw new Error("Provided element is not within a Document");const i=c(t.ownerDocument.styleSheets),s=await async function(t,n){const i=[],s=[];return t.forEach((i=>{if("cssRules"in i)try{c(i.cssRules||[]).forEach(((t,e)=>{if(t.type===CSSRule.IMPORT_RULE){let o=e+1;const r=I(t.href).then((t=>O(t,n))).then((t=>z(t).forEach((t=>{try{i.insertRule(t,t.startsWith("@import")?o+=1:i.cssRules.length)}catch(n){console.error("Error inserting rule from remote css",{rule:t,error:n})}})))).catch((t=>{console.error("Error loading remote css",t.toString())}));s.push(r)}}))}catch(e){const o=t.find((t=>null==t.href))||document.styleSheets[0];null!=i.href&&s.push(I(i.href).then((t=>O(t,n))).then((t=>z(t).forEach((t=>{o.insertRule(t,i.cssRules.length)})))).catch((t=>{console.error("Error loading remote stylesheet",t)}))),console.error("Error inlining remote css file",e)}})),Promise.all(s).then((()=>(t.forEach((t=>{if("cssRules"in t)try{c(t.cssRules||[]).forEach((t=>{i.push(t)}))}catch(n){console.error(`Error while reading CSS rules from ${t.href}`,n)}})),i)))}(i,n);return function(t){return t.filter((t=>t.type===CSSRule.FONT_FACE_RULE)).filter((t=>M(t.style.getPropertyValue("src"))))}(s)}(t,n);return(await Promise.all(i.map((t=>j(t.cssText,t.parentStyleSheet?t.parentStyleSheet.href:null,n))))).join("\n")}(t,n);if(i){const n=document.createElement("style"),s=document.createTextNode(i);n.appendChild(s),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function H(t,n={}){const{width:i,height:s}=h(t,n),e=await S(t,n,!0);return await R(e,n),await T(e,n),function(t,n){const{style:i}=t;n.backgroundColor&&(i.backgroundColor=n.backgroundColor),n.width&&(i.width=`${n.width}px`),n.height&&(i.height=`${n.height}px`);const s=n.style;null!=s&&Object.keys(s).forEach((t=>{i[t]=s[t]}))}(e,n),await async function(t,n,i){const s="http://www.w3.org/2000/svg",e=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return e.setAttribute("width",`${n}`),e.setAttribute("height",`${i}`),e.setAttribute("viewBox",`0 0 ${n} ${i}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),e.appendChild(o),o.appendChild(t),async function(t){return Promise.resolve().then((()=>(new XMLSerializer).serializeToString(t))).then(encodeURIComponent).then((t=>`data:image/svg+xml;charset=utf-8,${t}`))}(e)}(e,i,s)}async function V(t,n={}){const{width:i,height:s}=h(t,n),e=await H(t,n),o=await u(e),r=document.createElement("canvas"),a=r.getContext("2d"),p=n.pixelRatio||function(){let t,n;try{n=process}catch(t){}const i=n&&n.env?n.env.devicePixelRatio:null;return i&&(t=parseInt(i,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}(),c=n.canvasWidth||i,l=n.canvasHeight||s;return r.width=c*p,r.height=l*p,n.skipAutoScale||function(t){(t.width>d||t.height>d)&&(t.width>d&&t.height>d?t.width>t.height?(t.height*=d/t.width,t.width=d):(t.width*=d/t.height,t.height=d):t.width>d?(t.height*=d/t.width,t.width=d):(t.width*=d/t.height,t.height=d))}(r),r.style.width=`${c}`,r.style.height=`${l}`,n.backgroundColor&&(a.fillStyle=n.backgroundColor,a.fillRect(0,0,r.width,r.height)),a.drawImage(o,0,0,r.width,r.height),r}const G="instant-apps-export calcite-mode-light",U="instant-apps-export-print instant-apps-export-print__pdf",W="instant-apps-export-print instant-apps-export-print__img",A="instant-apps-export-print__img--extra-content",B="instant-apps-export-print__content-container",N="instant-apps-export-print__extra-container",J="instant-apps-export-print__legend-container",q="instant-apps-export-print__compass-container",X="instant-apps-export-print__scale-bar-container",K="instant-apps-export-print__popup-container",Q="instant-apps-export-print__popup-content",Y="instant-apps-export-print__popup-title",Z="instant-apps-export-print__view",tt="instant-apps-export-print__view-container",nt="instant-apps-export-print__view-wrapper",it="instant-app-export-drag",st=class{constructor(i){t(this,i),this.exportOutputUpdated=n(this,"exportOutputUpdated",7),this.fileTypes=["PDF","JPG","PNG"],this.output=void 0,this.beforeExport=()=>Promise.resolve(),this.popoverIcon="export",this.extraContent=void 0,this.extraContentLabel=void 0,this.headerTitle="",this.logoImage="",this.includeExtraContent=!0,this.showExtraContentInImg=!1,this.includeLegend=!0,this.includeMap=!0,this.includePopup=!1,this.includeFileFormat=!0,this.mode="popover",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.scale="m",this.showHeaderTitle=!0,this.showIncludeLegend=!0,this.showIncludeMap=!1,this.showIncludePopup=!0,this.showScaleBar=!1,this.view=void 0,this.maskBackground="rgba(255, 51, 0, 0.1)",this.maskBorder="2px dashed rgb(255, 51, 0)",this.baseClass=G,this.exportIsLoading=void 0,this.messages=void 0,this.selectedFileType="PDF"}watchIncludeMap(t){t&&this.updateLegend()}watchView(){this.handleIncludePopup()}async componentWillLoad(){this.baseClass="dark"===a(this.el)?"instant-apps-export calcite-mode-dark":G,r(this),await this.initializeModules()}componentDidLoad(){this.printContainerEl.prepend(this.printEl),this.handleIncludePopup()}async initializeModules(){const[t,n]=await o(["esri/core/Handles","esri/core/reactiveUtils"]);return this.handles=new t,this.reactiveUtils=n,Promise.resolve()}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel(),n=this.renderCompass();return i(s,{key:"9811c244faf2c794db3edaad498a9a902cb3faad"},i("div",{key:"cb880c04d46ec06a9588cedc0bd90ab62d25c0ac",class:this.baseClass,onMouseEnter:this.handleWidgetCreation.bind(this),onFocusin:this.handleWidgetCreation.bind(this)},t,i("div",{key:"fc7ccd1eeb4b6a82bd9804d1aa73c4f242085a56",class:"instant-apps-export__visually-hidden"},n)))}renderPopover(){var t,n,s;const e=this.renderPanel();return[i("calcite-popover",{referenceElement:"export-popover-btn",label:null===(t=this.messages)||void 0===t?void 0:t.exportPopover,overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t},e),i("calcite-action",{id:"export-popover-btn",alignment:"center",icon:this.popoverIcon,scale:this.scale,title:null===(n=this.messages)||void 0===n?void 0:n.exportBtn,text:null===(s=this.messages)||void 0===s?void 0:s.exportBtn})]}renderPanel(){var t,n,s;const e=this.showHeaderTitle?this.renderTitle():null,o=null!=this.extraContent?this.renderSwitch("includeExtraContent",this.extraContentLabel,"PDF"!==this.selectedFileType&&!this.showExtraContentInImg):null,r=this.showIncludeMap?this.renderSwitch("includeMap",void 0,"PDF"!==this.selectedFileType):null,a=this.includeMap?this.renderMapOptions():null,p=this.includeFileFormat?this.renderSelectFileType():null,c="PDF"===this.selectedFileType?this.renderPrint():this.renderImg();return i("div",{class:"inline"===this.mode?"instant-apps-export__inline-container":"instant-apps-export__popover-container"},e,o,r,a,p,this.includeMap?i("calcite-button",{appearance:"transparent",width:"full",onClick:this.setMapAreaOnClick.bind(this,!0),disabled:this.exportIsLoading},null===(t=this.messages)||void 0===t?void 0:t.setMapArea):null,i("calcite-button",{width:"full",onClick:this.exportOnClick.bind(this),disabled:this.exportIsLoading},"PDF"===this.selectedFileType?null===(n=this.messages)||void 0===n?void 0:n.export:null===(s=this.messages)||void 0===s?void 0:s.preview),c)}renderTitle(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.title,i("calcite-input",{value:this.headerTitle,onCalciteInputInput:this.updateHeaderTitle.bind(this)}))}renderSwitch(t,n,s){var e;const o=null!=n?n:null===(e=this.messages)||void 0===e?void 0:e[t];return i("calcite-label",{layout:"inline-space-between"},o,i("calcite-switch",{checked:this[t],value:t,onCalciteSwitchChange:this.optionOnChange.bind(this),disabled:s}))}renderSelectFileType(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.fileType,i("calcite-select",{onCalciteSelectChange:this.handleSelectFileType.bind(this)},this.fileTypes.map((t=>i("calcite-option",{value:t,selected:t===this.selectedFileType},t)))))}renderMapOptions(){const t=this.showIncludeLegend?this.renderSwitch("includeLegend"):null,n=this.showIncludePopup?this.renderSwitch("includePopup"):null;return i("div",null,t,n)}renderPrint(){const t=this.includeMap?this.renderPrintMap():null,n=this.renderExtraContent(),s=this.includeMap&&this.showIncludeLegend?this.renderLegend():null,e=this.includeMap&&this.showIncludePopup?this.renderPopup():null;return i("div",{ref:t=>this.printContainerEl=t},i("div",{class:U,ref:t=>this.printEl=t},t,s,i("div",{class:B},e,n)))}renderPrintMap(){return i("div",{class:tt,ref:t=>this.viewContainerEl=t},i("div",{class:nt,ref:t=>this.viewWrapperEl=t},this.headerTitle?i("instant-apps-header",{logoImage:this.logoImage,logoScale:"s",titleText:this.headerTitle,backgroundColor:"#fff",textColor:"#323232"}):null,i("img",{class:Z,ref:t=>this.viewEl=t}),i("div",{class:X,ref:t=>this.scaleBarContainerEl=t})))}renderLegend(){return i("div",{class:J,ref:t=>this.legendContainerEl=t})}renderCompass(){return i("div",{class:q,ref:t=>this.compassContainerEl=t})}renderPopup(){return i("div",{class:K,ref:t=>this.popupContainerEl=t},i("div",{ref:t=>this.popupTitleEl=t,class:Y}),i("div",{ref:t=>this.popupContentEl=t,class:Q}))}renderExtraContent(){return i("div",{class:N,id:"export-content",ref:t=>this.extraContainerEl=t})}renderImg(){const t=this.includeMap?this.renderPrintMap():null,n=this.includeMap&&this.showIncludeLegend?this.renderLegend():null;let s;return this.includeMap&&this.showIncludePopup?s=this.renderPopup():this.showExtraContentInImg&&null!=this.extraContent&&this.includeExtraContent&&(s=this.renderExtraContent()),i("div",{ref:t=>this.printContainerEl=t},i("div",{class:W,ref:t=>this.printEl=t},t,n,s))}optionOnChange(t){const{checked:n,value:i}=t.target;this[i]=n,this.updateExportOutput()}updateHeaderTitle(t){this.headerTitle=t.target.value,this.updateExportOutput()}async exportOnClick(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}async exportPreviewOnClick(){"PDF"===this.selectedFileType?await this.exportPDF():this.exportImg()}async exportPDF(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}exportImg(){var t;if(this.resetPopupVisibility(),null==this.dataUrl)return;const n=document.createElement("a");n.id="download-link",n.href=this.dataUrl,n.download=null!==(t=this.headerTitle)&&void 0!==t?t:document.title,n.click(),this.dataUrl=null,this.exportIsLoading=!1,this.removeScreenshotElements(),this.resetPrintContent()}async handleViewExportOnClick(){null!=this.view?(this.addPrintStyling(),document.body.prepend(this.printEl),this.handleExtraContent(),this.includeMap?(this.updateScaleBar(),this.viewScreenshot(),this.handleImgLoaded()):this.handleImgLoaded()):null!=this.popoverEl&&(this.popoverEl.open=!1)}addPrintStyling(){null==this.printStyleEl&&(this.printStyleEl=document.createElement("style"),this.printStyleEl.innerHTML='\n @media print {\n @page {\n size: Portrait;\n margin: .25in;\n }\n\n html, body {\n padding: 0;\n margin: 0;\n height: 100%;\n width: 100%;\n }\n\n body > *:not(.instant-apps-export-print) { display: none; }\n }\n\n * {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n }\n\n\n .instant-apps-export-print {\n position: absolute;\n z-index: -999;\n color: #323232 !important;\n --esri-calcite-mode-name: "light";\n }\n\n .instant-apps-export-print__pdf {\n height: 100%;\n width: 100%;\n display: grid;\n gap: 24px;\n grid-auto-flow: row;\n }\n\n .instant-apps-export-print__img {\n display: grid;\n width: auto;\n }\n\n .instant-apps-export-print__img--extra-content {\n grid-template-columns: 2fr minmax(0, 325px);\n }\n\n .instant-apps-export-print, .instant-apps-export-print * {\n box-sizing: border-box;\n }\n\n .instant-apps-export-print__view-section {\n height: 100%;\n }\n\n .instant-apps-export-print__view-container {\n height: 100%;\n width: 100%;\n display: flex;\n justify-content: center;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__view-container {\n grid-row: 1;\n grid-column: 1;\n }\n\n .instant-apps-export-print__view-wrapper {\n height: fit-content;\n width: fit-content;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .instant-apps-export-print__pdf .instant-apps-export-print__view-wrapper {\n border: 2pt solid #323232;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__view-wrapper {\n border: 1pt solid #323232;\n }\n\n .instant-apps-export-print__view {\n object-fit: contain;\n }\n\n .instant-apps-export-print__extra-container {\n grid-row: 1 / span 2;\n grid-column: 2;\n }\n \n .instant-apps-export-print__extra-container .esri-feature.esri-widget .esri-widget__heading.esri-feature__title {\n display: block;\n }\n\n .instant-apps-export-print__popup-container {\n height: min-content;\n max-width: 325px;\n display: none;\n color: #323232;\n background: #fff;\n break-inside: avoid;\n }\n\n .instant-apps-export-print__pdf .instant-apps-export-print__popup-container {\n border: 1pt solid #323232;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__popup-container {\n grid-row: 1 / span 2;\n grid-column: 2;\n }\n\n .instant-apps-export-print__popup-title {\n border-bottom: 1pt solid #323232;\n }\n\n .instant-apps-export-print__popup-content {\n background: #fff;\n padding-top: 8pt;\n }\n\n .instant-apps-export-print__popup-content .esri-feature-media__chart {\n background: #fff;\n }\n\n .instant-apps-export-print__legend-container {\n height: min-content;\n background: #fff;\n overflow: unset;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__legend-container {\n margin: 14px;\n grid-row: 2;\n grid-column: 1;\n }\n\n .esri-legend--card, .esri-legend--card__service-content {\n flex-flow: row wrap;\n }\n\n .instant-apps-export-print .esri-widget > *:not(.esri-scale-bar.esri-widget > *) {\n background: #fff;\n color: #323232;\n }\n\n .instant-apps-export-print__popup-content *, .instant-apps-export-print__img .esri-feature.esri-widget * {\n color: #323232;\n }\n\n .instant-apps-export-print .esri-widget__heading {\n margin: 4pt 7pt;\n padding: 0;\n color: #323232;\n }\n\n .instant-apps-export-print .esri-legend__ramp-label:before {\n border-color: rgba(0,0,0,0) rgba(50,50,50,.8) rgba(0,0,0,0) rgba(0,0,0,0);\n }\n\n .instant-apps-export-print .esri-legend--card__section {\n padding: 4pt 0 4pt;\n min-width: unset;\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__section:first-child {\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service {\n border: none;\n flex: 0 1 auto;\n break-inside: avoid;\n }\n\n .instant-apps-export-print .esri-legend--card {\n border: none;\n gap: 6pt 12pt;\n }\n\n .instant-apps-export-print .esri-legend--card:not(:first-child),\n .instant-apps-export-print .esri-compass.esri-widget:not(:first-child) {\n display: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-container {\n height: unset;\n padding: 0;\n border-bottom: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-text {\n padding-bottom: 4px;\n }\n\n .instant-apps-export-print__compass-container {\n position: absolute;\n top: 65px;\n left: 15px;\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n --calcite-ui-icon-color: #000;\n border-radius: 50%;\n height: fit-content;\n }\n\n .instant-apps-export-print__compass-container .esri-compass {\n background: #fff;\n }\n\n .instant-apps-export-print__compass-container .esri-compass__icon.esri-icon-compass {\n color: #000;\n }\n\n .instant-apps-export-print__compass-container.esri-compass.esri-widget--button {\n background: #fff;\n }\n\n .instant-apps-export-print__scale-bar-container {\n width: 100%;\n position: absolute;\n bottom: 15px;\n margin: 0 15px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {\n color: #323232;\n font-size: 10px;\n padding: 0 4px;\n }\n \n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label {\n height: 10px;\n padding: 0 2px;\n line-height: 11px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__bar-container:nth-child(1n+3) {\n display: none;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__bar-container.esri-scale-bar__bar-container--line {\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line {\n background-color: rgba(255, 255, 255, 0.66);\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top {\n width: var(--instant-apps-scale-bar-top) !important;\n border-bottom: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom {\n width: var(--instant-apps-scale-bar-bottom) !important;\n border-top: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label-container--line {\n position: unset;\n margin: 0 2px;\n background-color: rgba(255, 255, 255, 0.66);\n height: 10px;\n display: flex;\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:after,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:after {\n background-color: #323232;\n border-right: 2px solid #323232;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__item-navigation {\n display: none;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__chart.esri-feature-media__chart--rendered * {\n width: 100%!important;\n }\n\n .instant-apps-export-print__popup-content .esri-popup__content {\n margin: 0;\n }\n\n .instant-apps-export-print__content-container {\n display: flex;\n gap: 24px;\n break-inside: avoid;\n break-before: auto;\n }',document.body.prepend(this.printStyleEl))}handleImgLoaded(){this.exportIsLoading=!0,setTimeout((()=>{"PDF"===this.selectedFileType&&(this.exportIsLoading=!1),this.setupViewPrintElements()}),1500)}handleExtraContent(){const t=this.printEl.querySelector("#export-content");if(null!=t){t.innerHTML="";const n=null!=this.extraContent&&this.includeExtraContent;this.printEl.classList.toggle(A,"PDF"!==this.selectedFileType&&this.showExtraContentInImg&&n),n?(t.style.display="block",t.append(this.extraContent.cloneNode(!0))):t.style.display="none"}else this.showExtraContentInImg&&"PDF"!==this.selectedFileType&&!this.includeExtraContent&&this.printEl.classList.toggle(A,!1)}resetPrintContent(){var t,n,i;if(null!=this.view){this.screenshot=null,null===(t=this.printContainerEl)||void 0===t||t.prepend(this.printEl),null===(n=this.printStyleEl)||void 0===n||n.remove(),null===(i=this.tmpPopupTitleEl)||void 0===i||i.remove(),this.printStyleEl=void 0;const s=this.printEl.querySelector("#export-content");s&&(s.innerHTML="")}}async updatePopupToPrint(){var t,n;if(null==this.view||null==this.popupContainerEl)return;this.popupContainerEl.style.display=this.includePopup&&this.view.popup.visible?"block":"none",this.checkPopupOpen();const i=this.includePopup&&(this.view.popup.visible||this.popupHiddenByMapArea)&&null!=this.view.popup.selectedFeature;if(this.printEl.classList.toggle(A,"PDF"!==this.selectedFileType&&i),i){const i=document.createElement(`h${null!==(t=this.view.popup.headingLevel)&&void 0!==t?t:2}`);i.innerHTML=null!==(n=this.view.popup.title)&&void 0!==n?n:"",i.className="esri-widget__heading esri-popup__header-title",null==this.popupTitleEl?(this.tmpPopupTitleEl=document.createElement("div"),this.tmpPopupTitleEl.prepend(i),this.tmpPopupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupContainerEl.prepend(this.tmpPopupTitleEl)):(this.popupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupTitleEl.innerHTML="",this.popupTitleEl.prepend(i))}}updateExportOutput(){this.output={},this.showHeaderTitle&&(this.output.headerTitle=this.headerTitle),this.showIncludeLegend&&(this.output.includeLegend=this.includeLegend),this.showIncludeMap&&(this.output.includeMap=this.includeMap),this.showIncludePopup&&(this.output.includePopup=this.includePopup),this.exportOutputUpdated.emit()}setupViewPrintElements(){if(null!=this.view)if(this.handleLegendSetup(),"PDF"===this.selectedFileType){const t=document.title;this.showHeaderTitle&&this.headerTitle&&(document.title=this.headerTitle),window.print(),document.title=t,setTimeout((()=>{this.resetPrintContent()}),1e3)}else this.convertToImage()}convertToImage(){const t={backgroundColor:"#FFF",skipFonts:!0};"JPG"===this.selectedFileType?async function(t,n={}){return(await V(t,n)).toDataURL("image/jpeg",n.quality||1)}(this.printEl,t).then(this.handleGetImage.bind(this)):async function(t,n={}){return(await V(t,n)).toDataURL()}(this.printEl,t).then(this.handleGetImage.bind(this))}handleGetImage(t){var n;this.resetPrintContent(),this.dataUrl=t,this.setMapAreaOnClick(!1),this.showPreview(t),null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null)}handleLegendSetup(){var t;if(this.showIncludeLegend&&null!=this.view&&this.includeMap&&null!=this.legendContainerEl){const n=null!=this.legend&&(null===(t=this.legend.activeLayerInfos)||void 0===t?void 0:t.length)>0;this.legendContainerEl.style.display=this.includeLegend&&n?"block":"none"}}handleWidgetCreation(){this.includeMap&&(this.handleLegendCreation(),this.handleCompassCreation(),this.updatePopupToPrint())}handleIncludePopup(){var t,n;if(this.showIncludePopup){const i="includePopup";null===(t=this.handles)||void 0===t||t.remove(i),null===(n=this.reactiveUtils)||void 0===n||n.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready})).then((()=>{var t;null===(t=this.handles)||void 0===t||t.add(this.reactiveUtils.watch((()=>{var t,n;return null===(n=null===(t=this.view)||void 0===t?void 0:t.popup)||void 0===n?void 0:n.visible}),(t=>{this.settingMapArea||(this.includePopup=t)})),i)}))}}handleLegendCreation(){var t,n,i,s,e;if(null!=this.view&&this.showIncludeLegend&&null!=this.legendContainerEl){const o=this.view.map,r=null===(n=null===(t=this.legend)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;null!=(null===(i=null==o?void 0:o.portalItem)||void 0===i?void 0:i.id)&&(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)===(null===(e=null==r?void 0:r.portalItem)||void 0===e?void 0:e.id)||this.updateLegend()}}updateLegend(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{if(null!=this.legend&&(this.legend.destroy(),this.legend=null),null!=this.legendContainerEl){this.legendContainerEl.innerHTML="";const n=document.createElement("div");this.legendContainerEl.append(n);const[i]=await o(["esri/widgets/Legend"]);this.legend=new i({container:n,view:t,respectLayerDefinitionExpression:!0,style:{type:"card",layout:"side-by-side"}})}}))}handleCompassCreation(){var t,n,i,s;if(null!=this.view&&null!=this.compassContainerEl){const e=this.view.map,o=null===(n=null===(t=this.compass)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null===(i=null==e?void 0:e.portalItem)||void 0===i?void 0:i.id)===(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)||this.updateCompass()}}updateCompass(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.compass)||void 0===n||n.destroy(),this.compass=null;const i=document.createElement("div");this.compassContainerEl.append(i);const[s]=await o(["esri/widgets/Compass"]);this.compass=new s({container:i,view:t})}))}updateScaleBar(){if(this.scaleBarContainerEl&&null!=this.view&&(this.scaleBarContainerEl.innerHTML="",this.showScaleBar)){const t=this.view.ui.getComponents(),n=null==t?void 0:t.find((({container:t})=>{var n;return null===(n=null==t?void 0:t.className)||void 0===n?void 0:n.includes("esri-scale-bar")}));null!=(null==n?void 0:n.container)&&"string"!=typeof n.container&&this.scaleBarContainerEl.append(n.container.cloneNode(!0))}}async viewScreenshot(){var t;if(null!=this.view&&this.includeMap&&(null==this.screenshot&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3),this.screenshot=await this.view.takeScreenshot({width:2*this.view.width,height:2*this.view.height})),this.handleScaleBarSize(),null!=this.viewEl&&null!=this.viewWrapperEl)){const{height:t,width:n}=this.screenshot.data;t>n?this.setMaxRowHeightOnViewContainer():this.setMaxWidthOnViewContainer(),this.viewEl.src=this.screenshot.dataUrl}}setMaxRowHeightOnViewContainer(){"PDF"===this.selectedFileType&&(this.printEl.style.gridTemplateRows="minmax(auto, 70%)"),this.viewEl.style.height="100%",this.viewEl.style.width="",this.viewWrapperEl.style.height="100%",this.viewWrapperEl.style.width="fit-content"}setMaxWidthOnViewContainer(){this.printEl.style.gridTemplateRows="",this.viewEl.style.width="100%",this.viewEl.style.height="",this.viewWrapperEl.style.height="fit-content",this.viewWrapperEl.style.width="100%"}checkPopupOpen(){if(null!=this.view){const t=this.view.popup.container,n=null==t?void 0:t.querySelector(".esri-popup .esri-feature__main-container");if(null!=n){const t=n.querySelectorAll("canvas");this.popupContentEl.innerHTML="",this.popupContentEl.append(n.cloneNode(!0));const i=this.popupContentEl.querySelectorAll("canvas");t.forEach(((t,n)=>{var s;const e=t.toDataURL(),o=document.createElement("img");o.src=e;const r=t.getAttribute("style");r&&o.setAttribute("style",r);const a=i[n];null!=a&&(a.replaceWith(o),document.querySelector("link[href*='esri/themes/dark/main.css']")&&null!=(null===(s=o.parentElement)||void 0===s?void 0:s.parentElement)&&(o.parentElement.style.background="#242424",o.parentElement.parentElement.style.background="#242424"))}))}}}createScreenshot(){var t,n,i;if(null!=this.view){this.screenshotPreview=document.createElement("div"),this.screenshotPreview.className="screenshot-preview hide",this.screenshotImgContainer=document.createElement("div"),this.screenshotImgContainer.className="screenshot-img-container",this.screenshotImg=document.createElement("img");const s=document.createElement("div"),e=document.createElement("calcite-button"),o=document.createElement("calcite-button");e.innerHTML="PDF"===this.selectedFileType?null===(t=this.messages)||void 0===t?void 0:t.export:null===(n=this.messages)||void 0===n?void 0:n.downloadImage,o.innerHTML=null===(i=this.messages)||void 0===i?void 0:i.returnToMap,o.appearance="outline-fill",e.onclick=this.exportPreviewOnClick.bind(this),o.onclick=this.screenshotReturn.bind(this),s.append(o,e),this.screenshotImgContainer.append(this.screenshotImg,s),this.screenshotPreview.append(this.screenshotImgContainer),this.view.container.append(this.screenshotPreview)}}createMaskDiv(){null!=this.view&&(this.maskDivEl=document.createElement("div"),this.maskDivEl.id="screenshot-mask",this.maskDivEl.className="hide screenshot-cursor",this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-background",this.maskBackground),this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-border",this.maskBorder),this.screenshotStyle=document.createElement("style"),this.screenshotStyle.innerHTML="\n.screenshot-preview.hide, .hide {\n display: none;\n}\n\n.screenshot-cursor {\n cursor: crosshair;\n}\n\n.relative {\n position: relative;\n}\n\n#screenshot-mask {\n position: absolute;\n background: var(--instant-apps-screenshot-mask-background);\n border: var(--instant-apps-screenshot-mask-border);\n}\n\n.screenshot-preview {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n text-align: center;\n background-color: rgba(0, 0, 0, 0.75);\n}\n\n.screenshot-preview * {\n box-sizing: border-box;\n}\n\n.screenshot-img-container img {\n max-height: 75%;\n max-width: 75%;\n object-fit: contain;\n box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.5);\n margin-bottom: 0.5em;\n}\n\n.screenshot-img-container {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n margin-bottom: 8px;\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n}\n\n.screenshot-img-container calcite-button {\n margin: 5px;\n}",this.view.container.append(this.screenshotStyle),this.view.container.append(this.maskDivEl))}screenshotReturn(){this.removeScreenshotElements(),this.exportIsLoading=!1,this.screenshot=null,this.resetPopupVisibility()}setMapAreaOnClick(t){null!=this.view&&(this.settingMapArea=!0,t&&this.view.popup.visible&&(this.popupHiddenByMapArea=!0,this.view.popup.container.style.display="none"),this.exportIsLoading=!0,this.createMaskDiv(),this.createScreenshot(),this.view.container.classList.add("screenshot-cursor","relative"),this.view.addHandles(this.view.on("drag",(async t=>{null!=this.view&&(t.stopPropagation(),"end"!==t.action?this.updateMaskSize(t):this.maskScreenshot())})),it))}updateMaskSize(t){if(null!=this.view){const n=this.clamp(Math.min(t.origin.x,t.x),0,this.view.width),i=this.clamp(Math.max(t.origin.x,t.x),0,this.view.width),s=this.clamp(Math.min(t.origin.y,t.y),0,this.view.height),e=this.clamp(Math.max(t.origin.y,t.y),0,this.view.height);this.area={x:n,y:s,width:i-n,height:e-s},this.setMaskPosition(this.area)}}maskScreenshot(){var t;if(null!=this.view&&null!=this.area){this.view.removeHandles(it);const n=this.area.height,i=this.area.width;this.showScaleBar&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3&&.75*this.view.width<i)),this.view.takeScreenshot({area:this.area,width:2*i,height:2*n,format:"jpg"}).then((t=>{var n;this.screenshot=t,null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null),"PDF"===this.selectedFileType?(this.showPreview(null==t?void 0:t.dataUrl),this.resetPopupVisibility()):(null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1))}))}}setMaskPosition(t){null!=t?(this.maskDivEl.classList.remove("hide"),this.maskDivEl.style.left=`${t.x}px`,this.maskDivEl.style.top=`${t.y}px`,this.maskDivEl.style.width=`${t.width}px`,this.maskDivEl.style.height=`${t.height}px`):this.maskDivEl.remove()}clamp(t,n,i){return t<n?n:t>i?i:t}showPreview(t){t&&(this.screenshotPreview.classList.remove("hide"),null!=this.screenshotImg&&(this.screenshotImg.src=t))}handleScaleBarSize(){var t;if(this.showScaleBar&&"2d"===(null===(t=this.view)||void 0===t?void 0:t.type)&&null!=this.scaleBarContainerEl){const t=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--top"),n=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--bottom");this.setScalebarWidth(t,"top"),this.setScalebarWidth(n,"bottom")}}setScalebarWidth(t,n){var i;if(null!=t&&null!=this.screenshot){const s=this.screenshot.data.width/2,e=Number(t.style.width.replace("px",""));null===(i=this.scaleBarContainerEl)||void 0===i||i.style.setProperty(`--instant-apps-scale-bar-${n}`,e/s*100+"%")}}removeScreenshotElements(){var t,n,i;null===(t=this.view)||void 0===t||t.removeHandles(it),null===(n=this.screenshotPreview)||void 0===n||n.remove(),null===(i=this.screenshotStyle)||void 0===i||i.remove()}resetPopupVisibility(){this.view&&this.settingMapArea&&this.popupHiddenByMapArea&&(this.view.popup.container.style.display=""),this.settingMapArea=!1,this.popupHiddenByMapArea=!1}handleSelectFileType(t){this.selectedFileType=t.target.value,"PDF"===this.selectedFileType?(this.includeMap=this.pdfIncludeMap,this.showExtraContentInImg||(this.includeExtraContent=this.pdfIncludeExtraContent)):(this.pdfIncludeMap=this.includeMap,this.includeMap=!0,this.showExtraContentInImg||(this.pdfIncludeExtraContent=this.includeExtraContent,this.includeMap=!0,this.includeExtraContent=!1))}get el(){return e(this)}static get watchers(){return{includeMap:["watchIncludeMap"],view:["watchView"]}}};st.style=":host{display:block;--instant-apps-export-action-background:var(--calcite-color-foreground-1);--instant-apps-export-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-export-action-background-press:var(--calcite-color-foreground-3);--instant-apps-export-action-height:100%;--instant-apps-export-action-width:fit-content;--instant-apps-export-action-icon-color:var(--calcite-color-text-3);--instant-apps-export-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-export-background:var(--calcite-color-foreground-1);--instant-apps-export-text-color:var(--calcite-color-text-1);--instant-apps-export-popover-width:250px}.instant-apps-export{height:100%}.instant-apps-export *{box-sizing:border-box}.instant-apps-export__popover-container,.instant-apps-export__inline-container{padding:12px;background:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export__popover-container{width:var(--instant-apps-export-popover-width)}.instant-apps-export calcite-action{height:var(--instant-apps-export-action-height);width:var(--instant-apps-export-action-width);--calcite-color-foreground-1:var(--instant-apps-export-action-background);--calcite-color-foreground-2:var(--instant-apps-export-action-background-hover);--calcite-color-foreground-3:var(--instant-apps-export-action-background-press);--calcite-color-text-3:var(--instant-apps-export-action-icon-color);--calcite-color-text-1:var(--instant-apps-export-action-icon-hover-color)}.instant-apps-export .instant-apps-export-print{display:none}.instant-apps-export .instant-apps-export-print_img{display:flex;flex-flow:row wrap}.instant-apps-export__visually-hidden{position:absolute;top:0;z-index:-1;visibility:hidden}.instant-apps-export calcite-input{--calcite-color-foreground-1:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export calcite-popover{--calcite-color-foreground-1:var(--instant-apps-export-background)}.instant-apps-export calcite-switch{--calcite-color-foreground-1:#fff;--calcite-color-foreground-2:#f3f3f3}.instant-apps-export calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-export .calcite-mode-dark calcite-switch{--calcite-color-foreground-1:#2b2b2b;--calcite-color-foreground-2:#202020}.instant-apps-export__compass-container.esri-widget{background:#fff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.instant-apps-export__compass-container.esri-widget .esri-compass__icon.esri-icon-compass{color:#6e6e6e}.hide{display:none}.screenshotCursor{cursor:crosshair}";export{st as instant_apps_export}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as e,c as n,h as t,g as i}from"./p-4e6eb06e.js";import{v as a,g as s}from"./p-af573e0d.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dc9d4be3.js";const p=class{constructor(t){e(this,t),this.groupLayerCaptionElementExpandUpdatedEvent=n(this,"groupLayerCaptionElementExpandUpdated",7),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}render(){var e,n,i,p;const l=a(this.activeLayerInfo),{expanded:c}=this,d=c?null===(e=this.messages)||void 0===e?void 0:e.collapse:null===(n=this.messages)||void 0===n?void 0:n.expand,r=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return t("header",{key:"f7fc15a482577d3dc46bf2c75a7e3349d7565654",class:`instant-apps-interactive-legend__header ${s(this.el)}`,style:{borderLeft:"1px solid var(--calcite-color-border-3)"}},t("span",{key:"e8652d3efbba23460e516c7a482b9c58711bfd6e"},t("span",{key:"0b3aa10dd2da8634101fca455b5a611f6d3e4436",class:"instant-apps-interactive-legend__header-action-container"},t("calcite-action",{key:"3f311642dd154822d105fa5ecd21bd5cfe7dcf0c",onClick:this.toggleExpanded(),icon:c?"chevron-down":"chevron-up",appearance:"transparent",text:d,label:d,scale:"s"}),t("h3",{key:"0d7eb0a5958b4f661772f59faf287836818aaeeb",class:`esri-widget__heading esri-legend__service-label${r}`,title:null===(i=this.activeLayerInfo)||void 0===i?void 0:i.title},null===(p=this.activeLayerInfo)||void 0===p?void 0:p.title)),this.featureCount&&l?t("instant-apps-interactive-legend-count",{activeLayerInfo:this.activeLayerInfo,"show-total":!0,messages:this.messages,legendvm:this.legendvm}):null))}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.groupLayerCaptionElementExpandUpdatedEvent.emit(this.expanded)}}get el(){return i(this)}};p.style=".sc-instant-apps-interactive-legend-group-legend-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption{overflow:hidden;margin:0;overflow-x:hidden;display:inline-block;font-size:var(--instant-apps-interactive-legend-heading-font-size);font-weight:var(--instant-apps-interactive-legend-heading-font-weight)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption header.sc-instant-apps-interactive-legend-group-legend-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption{display:flex;text-align:left;padding:var(--instant-apps-interactive-legend-ui-padding);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption h3.sc-instant-apps-interactive-legend-group-legend-element-caption{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal;color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption .instant-apps-interactive-legend__heading-text--group-item.sc-instant-apps-interactive-legend-group-legend-element-caption{-webkit-line-clamp:2;line-clamp:2}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption span.sc-instant-apps-interactive-legend-group-legend-element-caption{width:100%;font-size:var(--instant-apps-interactive-legend-total-feature-count-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption .instant-apps-interactive-legend__header-action-container.sc-instant-apps-interactive-legend-group-legend-element-caption{display:flex;align-items:center}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption header.sc-instant-apps-interactive-legend-group-legend-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget--panel.sc-instant-apps-interactive-legend-group-legend-element-caption{margin:0}.calcite-mode-dark.sc-instant-apps-interactive-legend-group-legend-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-group-legend-element-caption{background-color:#242424;color:var(--calcite-color-text-1)}.calcite-mode-light.sc-instant-apps-interactive-legend-group-legend-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-group-legend-element-caption{background-color:#ffffff;color:var(--calcite-color-text-1)}";export{p as instant_apps_interactive_legend_group_legend_element_caption}
6
+ import{r as e,c as n,h as t,g as i}from"./p-4e6eb06e.js";import{v as a,g as s}from"./p-09543b4e.js";import"./p-d001e961.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dc9d4be3.js";const p=class{constructor(t){e(this,t),this.groupLayerCaptionElementExpandUpdatedEvent=n(this,"groupLayerCaptionElementExpandUpdated",7),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}render(){var e,n,i,p;const l=a(this.activeLayerInfo),{expanded:c}=this,d=c?null===(e=this.messages)||void 0===e?void 0:e.collapse:null===(n=this.messages)||void 0===n?void 0:n.expand,r=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return t("header",{key:"f7fc15a482577d3dc46bf2c75a7e3349d7565654",class:`instant-apps-interactive-legend__header ${s(this.el)}`,style:{borderLeft:"1px solid var(--calcite-color-border-3)"}},t("span",{key:"e8652d3efbba23460e516c7a482b9c58711bfd6e"},t("span",{key:"0b3aa10dd2da8634101fca455b5a611f6d3e4436",class:"instant-apps-interactive-legend__header-action-container"},t("calcite-action",{key:"3f311642dd154822d105fa5ecd21bd5cfe7dcf0c",onClick:this.toggleExpanded(),icon:c?"chevron-down":"chevron-up",appearance:"transparent",text:d,label:d,scale:"s"}),t("h3",{key:"0d7eb0a5958b4f661772f59faf287836818aaeeb",class:`esri-widget__heading esri-legend__service-label${r}`,title:null===(i=this.activeLayerInfo)||void 0===i?void 0:i.title},null===(p=this.activeLayerInfo)||void 0===p?void 0:p.title)),this.featureCount&&l?t("instant-apps-interactive-legend-count",{activeLayerInfo:this.activeLayerInfo,"show-total":!0,messages:this.messages,legendvm:this.legendvm}):null))}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.groupLayerCaptionElementExpandUpdatedEvent.emit(this.expanded)}}get el(){return i(this)}};p.style=".sc-instant-apps-interactive-legend-group-legend-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption{overflow:hidden;margin:0;overflow-x:hidden;display:inline-block;font-size:var(--instant-apps-interactive-legend-heading-font-size);font-weight:var(--instant-apps-interactive-legend-heading-font-weight)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption header.sc-instant-apps-interactive-legend-group-legend-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption{display:flex;text-align:left;padding:var(--instant-apps-interactive-legend-ui-padding);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption h3.sc-instant-apps-interactive-legend-group-legend-element-caption{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal;color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption .instant-apps-interactive-legend__heading-text--group-item.sc-instant-apps-interactive-legend-group-legend-element-caption{-webkit-line-clamp:2;line-clamp:2}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption span.sc-instant-apps-interactive-legend-group-legend-element-caption{width:100%;font-size:var(--instant-apps-interactive-legend-total-feature-count-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption .instant-apps-interactive-legend__header-action-container.sc-instant-apps-interactive-legend-group-legend-element-caption{display:flex;align-items:center}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption header.sc-instant-apps-interactive-legend-group-legend-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget--panel.sc-instant-apps-interactive-legend-group-legend-element-caption{margin:0}.calcite-mode-dark.sc-instant-apps-interactive-legend-group-legend-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-group-legend-element-caption{background-color:#242424;color:var(--calcite-color-text-1)}.calcite-mode-light.sc-instant-apps-interactive-legend-group-legend-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-group-legend-element-caption{background-color:#ffffff;color:var(--calcite-color-text-1)}";export{p as instant_apps_interactive_legend_group_legend_element_caption}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as o,h as e,H as i,g as a}from"./p-4e6eb06e.js";import{g as l}from"./p-5ff711ee.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const s=class{constructor(e){t(this,e),this.measureActive=o(this,"measureActive",7),this.messages=void 0,this.view=void 0,this.areaUnit=void 0,this.linearUnit=void 0,this.coordinateFormat=void 0,this.activeToolType=void 0,this.closable=!1}async componentWillLoad(){l(this)}componentDidLoad(){}render(){var t;return e(i,{key:"843dd716e3f9b125044afd9a2919a60b937ae8b0"},e("calcite-panel",{key:"45dd9e43decdcdc0526139938751d727bd73b3e0",heading:null===(t=null==this?void 0:this.messages)||void 0===t?void 0:t.label,closable:this.closable},e("div",{key:"953365a04fd1f977b08d4b9309fdb52d44363b67",slot:"content-top"},this.renderActionPad()),e("div",{key:"57ce5b75a8aff0d796073bbf2a2f36ea71f65b3c"},this.renderMeasureToolPanel())))}renderMeasureToolPanel(){const{view:t,coordinateFormat:o,areaUnit:i,linearUnit:a,activeToolType:l}=this;return e("calcite-panel",{class:"instant-apps-measurement__content"},e("instant-apps-measurement-tool",{ref:t=>{this.measureTool=t},view:t,measureConfiguration:{coordinateFormat:o,areaUnit:i,linearUnit:a,activeToolType:l}}))}renderActionPad(){const{messages:t,activeToolType:o}=this;return e("calcite-action-pad",{"expand-disabled":!0,layout:"horizontal",position:"end"},e("calcite-action",{class:"distance"===o?"active-tool":"",text:null==t?void 0:t.line,icon:"measure",scale:"m","data-value":"distance",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.line)),e("calcite-action",{class:"area"===o?"active-tool":"",text:null==t?void 0:t.area,scale:"m",icon:"measure-area","data-value":"area",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.area)),e("calcite-action",{class:"point"===o?"active-tool":"",text:null==t?void 0:t.point,scale:"m",icon:"pin-plus","data-value":"point",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.point)),e("calcite-action",{text:null==t?void 0:t.clear,scale:"m",icon:"trash","data-value":"clear",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.clear)))}_handleToolClick(t){var o,e,i,a;if(!(null==this?void 0:this.measureTool))return;const l=null===(o=null==t?void 0:t.target)||void 0===o?void 0:o.dataset.value;this.measureTool.activeTool=l;const s=document.getElementsByClassName("active-tool");for(let t=0;t<(null==s?void 0:s.length);t++)null===(i=null===(e=s[t])||void 0===e?void 0:e.classList)||void 0===i||i.remove("active-tool");null===(a=null==t?void 0:t.target)||void 0===a||a.classList.add("active-tool"),this.measureActive.emit(void 0!==l&&"clear"!==l)}get el(){return a(this)}};s.style=".sc-instant-apps-measurement-h .sc-instant-apps-measurement.sc-instant-apps-measurement{background:var(--calcite-color-foreground-1)}.sc-instant-apps-measurement-h .active-tool.sc-instant-apps-measurement{--calcite-color-foreground-1:#c7eaff}";export{s as instant_apps_measurement}
6
+ import{r as t,c as o,h as i,H as e,g as a}from"./p-4e6eb06e.js";import{g as l}from"./p-5104cc98.js";import"./p-d001e961.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const s=class{constructor(i){t(this,i),this.measureActive=o(this,"measureActive",7),this.messages=void 0,this.view=void 0,this.areaUnit=void 0,this.linearUnit=void 0,this.coordinateFormat=void 0,this.activeToolType=void 0,this.closable=!1}async componentWillLoad(){l(this)}componentDidLoad(){}render(){var t;return i(e,{key:"843dd716e3f9b125044afd9a2919a60b937ae8b0"},i("calcite-panel",{key:"45dd9e43decdcdc0526139938751d727bd73b3e0",heading:null===(t=null==this?void 0:this.messages)||void 0===t?void 0:t.label,closable:this.closable},i("div",{key:"953365a04fd1f977b08d4b9309fdb52d44363b67",slot:"content-top"},this.renderActionPad()),i("div",{key:"57ce5b75a8aff0d796073bbf2a2f36ea71f65b3c"},this.renderMeasureToolPanel())))}renderMeasureToolPanel(){const{view:t,coordinateFormat:o,areaUnit:e,linearUnit:a,activeToolType:l}=this;return i("calcite-panel",{class:"instant-apps-measurement__content"},i("instant-apps-measurement-tool",{ref:t=>{this.measureTool=t},view:t,measureConfiguration:{coordinateFormat:o,areaUnit:e,linearUnit:a,activeToolType:l}}))}renderActionPad(){const{messages:t,activeToolType:o}=this;return i("calcite-action-pad",{"expand-disabled":!0,layout:"horizontal",position:"end"},i("calcite-action",{class:"distance"===o?"active-tool":"",text:null==t?void 0:t.line,icon:"measure",scale:"m","data-value":"distance",onClick:this._handleToolClick.bind(this)},i("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.line)),i("calcite-action",{class:"area"===o?"active-tool":"",text:null==t?void 0:t.area,scale:"m",icon:"measure-area","data-value":"area",onClick:this._handleToolClick.bind(this)},i("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.area)),i("calcite-action",{class:"point"===o?"active-tool":"",text:null==t?void 0:t.point,scale:"m",icon:"pin-plus","data-value":"point",onClick:this._handleToolClick.bind(this)},i("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.point)),i("calcite-action",{text:null==t?void 0:t.clear,scale:"m",icon:"trash","data-value":"clear",onClick:this._handleToolClick.bind(this)},i("calcite-tooltip",{"close-on-click":!0,placement:"top",slot:"tooltip"},null==t?void 0:t.clear)))}_handleToolClick(t){var o,i,e,a;if(!(null==this?void 0:this.measureTool))return;const l=null===(o=null==t?void 0:t.target)||void 0===o?void 0:o.dataset.value;this.measureTool.activeTool=l;const s=document.getElementsByClassName("active-tool");for(let t=0;t<(null==s?void 0:s.length);t++)null===(e=null===(i=s[t])||void 0===i?void 0:i.classList)||void 0===e||e.remove("active-tool");null===(a=null==t?void 0:t.target)||void 0===a||a.classList.add("active-tool"),this.measureActive.emit(void 0!==l&&"clear"!==l)}get el(){return a(this)}};s.style=".sc-instant-apps-measurement-h .sc-instant-apps-measurement.sc-instant-apps-measurement{background:var(--calcite-color-foreground-1)}.sc-instant-apps-measurement-h .active-tool.sc-instant-apps-measurement{--calcite-color-foreground-1:#c7eaff}";export{s as instant_apps_measurement}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as e,h as i,H as s,g as o}from"./p-4e6eb06e.js";import{c as a,d as n}from"./p-5e25a0b8.js";import{e as r}from"./p-621ad249.js";import{s as c,a as d,c as l}from"./p-ad9d1221.js";import{c as h,d as p}from"./p-895e7b9c.js";import{u,c as m,d as b,s as v}from"./p-efaa77a0.js";import{t as f,E as g}from"./p-347f341e.js";import{c as x}from"./p-ff336351.js";import{l as y}from"./p-4cd4cb85.js";import"./p-7d542581.js";import"./p-91371f97.js";import"./p-4f82eb55.js";import"./p-233f219c.js";import"./p-54e5a55d.js";import"./p-3cfc1e2e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";
6
+ import{r as t,c as e,h as i,H as s,g as o}from"./p-4e6eb06e.js";import{c as a,d as n}from"./p-5e25a0b8.js";import{e as r}from"./p-621ad249.js";import{s as c,a as d,c as l}from"./p-ad9d1221.js";import{c as h,d as p}from"./p-895e7b9c.js";import{u,c as m,d as b,s as v}from"./p-efaa77a0.js";import{t as f,E as g}from"./p-347f341e.js";import{c as x}from"./p-ff336351.js";import{l as y}from"./p-d001e961.js";import"./p-7d542581.js";import"./p-91371f97.js";import"./p-4f82eb55.js";import"./p-233f219c.js";import"./p-54e5a55d.js";import"./p-3cfc1e2e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as e,c as t,g as i,h as a,H as s}from"./p-4e6eb06e.js";import{s as c}from"./p-c350eacb.js";import{g as l}from"./p-f4aadb3b.js";import{n}from"./p-5e71e72a.js";import{C as r,g as o}from"./p-80cb7c73.js";import"./p-dc9d4be3.js";import"./p-d0d020a5.js";import"./p-d4056c1c.js";import"./p-7530a02f.js";import"./p-9bb44f57.js";import"./p-0a24ad5f.js";const h=class{constructor(i){e(this,i),this.solutionItemSelected=t(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}get el(){return i(this)}valueWatchHandler(e,t){e&&e!==t&&Array.isArray(e)&&e.length>0&&this._treeItemSelected(e[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return a(s,{key:"98ca82042eb168779c0c373c9bf5136ae620ff70"},a("calcite-tree",{key:"c1c634c98e1a69c88c118a8f61036e04ea1b6b42"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(e){return e.map((e=>{const t=this.selectedItemId&&this.selectedItemId===e.id;return e.dependencies&&e.dependencies.length>0?a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title),a("calcite-tree",{slot:"children"},this.renderHierarchy(e.dependencies))):a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title))}))}solutionItemSelected;_treeItemSelected(e,t){const i=t?.target?.closest("calcite-tree-item");i&&(i.expanded=!i?.expanded),this.selectedItemId=e,this.solutionItemSelected.emit(e)}static get assetsDirs(){return["item-type-icons"]}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};h.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const d=class{constructor(t){e(this,t),this.authentication=void 0,this.itemId="",this.locale=void 0,this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}get el(){return i(this)}itemIdWatchHandler(){const e=c.getItemInfo(this.itemId);this.itemType=e.type}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}render(){return a(s,{key:"3fe864ad8d8bcf7bc276feafc60ce7e9fd7e803b"},a("div",{key:"90f327cc0736d8c9c13bf8b65d69e3835b4dae7b",class:"configuration-container"},a("div",{key:"10536f9927ba2b5745f1b5ae3b154a3aac902d47",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.groupDetailsTab),a("calcite-tab-title",null,this._translations.sharingTab)),a("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"share-tab"},a("solution-item-sharing",{"group-id":this.itemId,locale:this.locale})))}_showItemTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.itemDetailsTab),a("calcite-tab-title",null,this._translations.dataTab),a("calcite-tab-title",null,this._translations.propertiesTab),a("calcite-tab-title",null,this._translations.resourcesTab)),a("calcite-tab",{class:"config-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"data-tab"},a("solution-template-data",{instanceid:"data","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"props-tab"},a("solution-template-data",{instanceid:"properties","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"resources-tab"},a("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId,locale:this.locale})))}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};d.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const b="3857",f=class{constructor(i){e(this,i),this.featureServiceSpatialReferenceChange=t(this,"featureServiceSpatialReferenceChange",7),this.enableDefaultSpatialReferenceChange=t(this,"enableDefaultSpatialReferenceChange",7),this.enabledSpatialReferenceChange=t(this,"enabledSpatialReferenceChange",7),this.enabled=!1,this.enableDefault=!1,this.featureServices=[],this.locale=void 0,this._translations=void 0}get el(){return i(this)}enabledChanged(){this._handleSpatialRefParamChange()}enableDefaultChanged(){this._handleDefaultSpatialRefParamChange()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentWillLoad(){return this._updateUIFromStore(),this._getTranslations()}render(){return this._updateUIFromStore(),a(s,{key:"c4d6b7debb3852da999002bd1d9394ba4a4f2da8"},a("label",{key:"e16a28157db4c3aece6a00460816c3394f1f9198",class:"switch-label"},a("calcite-switch",{key:"48d3b1c12aa93c50ccf424ccaf0a810855227b8d",checked:this.enabled,class:"spatial-ref-switch",onCalciteSwitchChange:e=>this.enabled=e.target.checked,scale:"m"}),this._translations.enableSpatialReference),a("br",{key:"0e7eb35accdccef9f17e0a24b17180d25c4f054a"}),a("div",{key:"257e130fdda5e42a8c40662f21c3d315f91562c7",class:"spatial-ref-component",id:"spatialRefDefn"},this._renderFeatureServicesList(this.featureServices)),a("label",{key:"d7581971bb310c6c4b0fb1015db59a359da54b90",class:"switch-label spatial-ref-component"},a("calcite-switch",{key:"3045b179955101fc5baff8ca09cb10d0077e35ca",checked:this.enableDefault,class:"spatial-ref-switch",disabled:!this.enabled,onCalciteSwitchChange:e=>this.enableDefault=e.target.checked,scale:"m"}),this._translations.enableDefaultSpatialReference))}featureServiceSpatialReferenceChange;enableDefaultSpatialReferenceChange;enabledSpatialReferenceChange;solutionStoreHasChanges(){this.featureServices=c.getStoreInfo("featureServices")}async _testAccess(e,t,i,a){switch(e){case"_parameterizeWkid":return Promise.resolve(this._parameterizeWkid(t));case"_unparameterizeWkid":return Promise.resolve(this._unparameterizeWkid(t))}return Promise.resolve(null)}_clearFeatureServiceDefaults(e){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((e=>e.checked=!1)),e.forEach((e=>this._updateEnabledServices({detail:{switched:!1}},e)))}_handleDefaultSpatialRefParamChange(){this._updateStore(),this.enableDefaultSpatialReferenceChange.emit({defaultWkid:this.enableDefault?b:""})}_handleSpatialRefParamChange(){this.enabled||(this.enableDefault=!1,this._clearFeatureServiceDefaults(this.featureServices)),this._updateStore(),this.enabledSpatialReferenceChange.emit({enabled:this.enabled})}_parameterizeWkid(e){return e?e.toString().startsWith(r)?e:`${r}${e}${o}`:e}_renderFeatureServicesList(e){const t=c.getStoreInfo("spatialReferenceInfo"),i=e.filter((e=>Object.keys(t.services).some((t=>t===e.id))));return i.length>0?a("div",null,a("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),a("ul",{class:"spatial-ref-services-list"},i.map((e=>a("li",{class:"spatial-ref-services-list-item"},a("label",{class:"switch-label"},a("calcite-switch",{checked:t.services[e.id],class:"spatial-ref-item-switch",disabled:!this.enabled,onCalciteSwitchChange:t=>this._updateEnabledServices(t,e),scale:"m"}),e.name)))))):null}_updateEnabledServices(e,t){const i=c.getStoreInfo("spatialReferenceInfo");i.services[t.id]=void 0!==e.detail?.switched?e.detail.switched:void 0===e.target?.checked||e.target.checked,c.setStoreInfo("spatialReferenceInfo",i),this._updateStore(),this.featureServiceSpatialReferenceChange.emit(t)}_unparameterizeWkid(e){return e&&e.toString().startsWith(r)?e.substring(r.length,e.length-o.length):e}_updateFeatureServices(e){e.enabled||Object.keys(e.services).forEach((t=>{e.services[t]=!1})),this.featureServices.forEach((t=>{t.enabled=e.services[t.id],t.wkid=t.enabled?this._parameterizeWkid(t.wkid):this._unparameterizeWkid(t.wkid)})),c.setStoreInfo("featureServices",this.featureServices)}_updateStore(){const e=c.getStoreInfo("spatialReferenceInfo");e.enabled=this.enabled,this.enabled&&this.enableDefault?e.default=b:e.hasOwnProperty("default")&&delete e.default,c.setStoreInfo("spatialReferenceInfo",e),this._updateFeatureServices(e)}_updateUIFromStore(){const e=c.getStoreInfo("spatialReferenceInfo");this.enabled=e.enabled,this.enableDefault=!!e.default,this.featureServices=c.getStoreInfo("featureServices")}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{enabled:["enabledChanged"],enableDefault:["enableDefaultChanged"],locale:["localeWatchHandler"]}}};f.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{font-size:0.875rem;line-height:1.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:2em}.spatial-ref-services-list-item{margin-top:0.25rem}";export{h as solution_contents,d as solution_item,f as solution_spatial_ref}
6
+ import{r as e,c as t,g as i,h as a,H as s}from"./p-4e6eb06e.js";import{s as c}from"./p-c350eacb.js";import{g as l}from"./p-f4aadb3b.js";import{n}from"./p-5e71e72a.js";import{C as r,g as o}from"./p-80cb7c73.js";import"./p-dc9d4be3.js";import"./p-d0d020a5.js";import"./p-d4056c1c.js";import"./p-7530a02f.js";import"./p-9bb44f57.js";import"./p-0a24ad5f.js";const h=class{constructor(i){e(this,i),this.solutionItemSelected=t(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}get el(){return i(this)}valueWatchHandler(e,t){e&&e!==t&&Array.isArray(e)&&e.length>0&&this._treeItemSelected(e[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return a(s,{key:"98ca82042eb168779c0c373c9bf5136ae620ff70"},a("calcite-tree",{key:"c1c634c98e1a69c88c118a8f61036e04ea1b6b42"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(e){return e.map((e=>{const t=this.selectedItemId&&this.selectedItemId===e.id;return e.dependencies&&e.dependencies.length>0?a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title),a("calcite-tree",{slot:"children"},this.renderHierarchy(e.dependencies))):a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title))}))}solutionItemSelected;_treeItemSelected(e,t){const i=t?.target?.closest("calcite-tree-item");i&&(i.expanded=!i?.expanded),this.selectedItemId=e,this.solutionItemSelected.emit(e)}static get assetsDirs(){return["item-type-icons"]}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};h.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const d=class{constructor(t){e(this,t),this.authentication=void 0,this.itemId="",this.locale=void 0,this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}get el(){return i(this)}itemIdWatchHandler(){const e=c.getItemInfo(this.itemId);this.itemType=e.type}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}render(){return a(s,{key:"3fe864ad8d8bcf7bc276feafc60ce7e9fd7e803b"},a("div",{key:"90f327cc0736d8c9c13bf8b65d69e3835b4dae7b",class:"configuration-container"},a("div",{key:"10536f9927ba2b5745f1b5ae3b154a3aac902d47",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.groupDetailsTab),a("calcite-tab-title",null,this._translations.sharingTab)),a("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"share-tab"},a("solution-item-sharing",{"group-id":this.itemId,locale:this.locale})))}_showItemTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.itemDetailsTab),a("calcite-tab-title",null,this._translations.dataTab),a("calcite-tab-title",null,this._translations.propertiesTab),a("calcite-tab-title",null,this._translations.resourcesTab)),a("calcite-tab",{class:"config-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"data-tab"},a("solution-template-data",{instanceid:"data","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"props-tab"},a("solution-template-data",{instanceid:"properties","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"resources-tab"},a("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId,locale:this.locale})))}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};d.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const f="3857",b=class{constructor(i){e(this,i),this.featureServiceSpatialReferenceChange=t(this,"featureServiceSpatialReferenceChange",7),this.enableDefaultSpatialReferenceChange=t(this,"enableDefaultSpatialReferenceChange",7),this.enabledSpatialReferenceChange=t(this,"enabledSpatialReferenceChange",7),this.enabled=!1,this.enableDefault=!1,this.featureServices=[],this.locale=void 0,this._translations=void 0}get el(){return i(this)}enabledChanged(){this._handleSpatialRefParamChange()}enableDefaultChanged(){this._handleDefaultSpatialRefParamChange()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentWillLoad(){return this._updateUIFromStore(),this._getTranslations()}render(){return this._updateUIFromStore(),a(s,{key:"b8775ad1a6a18c0b32d020c02d6f9fe13f5d578a"},a("label",{key:"d10fa03d4d127579eed4fec2c6c907dc46166bdf",class:"switch-label"},a("calcite-switch",{key:"ce47d98234008f377d674851ce77c68ebaa4fd71",checked:this.enabled,class:"spatial-ref-switch",onCalciteSwitchChange:e=>this.enabled=e.target.checked,scale:"m"}),this._translations.enableSpatialReference),a("br",{key:"54dc5ccf3fec55650f62d8dbeb09071c8e88805c"}),a("div",{key:"03257e474d254e4d5a0dd10ac7ab6e8b88f85d54",class:"spatial-ref-component",id:"spatialRefDefn"},this._renderFeatureServicesList(this.featureServices)),a("label",{key:"fac415766affa3b1620ce6a5c3d5ef900b25944f",class:"switch-label spatial-ref-component"},a("calcite-switch",{key:"611b69b0895267702a69a70436033274d3d28892",checked:this.enableDefault,class:"spatial-ref-switch",disabled:!this.enabled,onCalciteSwitchChange:e=>this.enableDefault=e.target.checked,scale:"m"}),this._translations.enableDefaultSpatialReference))}featureServiceSpatialReferenceChange;enableDefaultSpatialReferenceChange;enabledSpatialReferenceChange;solutionStoreHasChanges(){this.featureServices=c.getStoreInfo("featureServices")}async _testAccess(e,t,i,a){switch(e){case"_parameterizeWkid":return Promise.resolve(this._parameterizeWkid(t));case"_unparameterizeWkid":return Promise.resolve(this._unparameterizeWkid(t))}return Promise.resolve(null)}_clearFeatureServiceDefaults(e){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((e=>e.checked=!1)),e.forEach((e=>this._updateEnabledServices({detail:{switched:!1}},e)))}_handleDefaultSpatialRefParamChange(){this._updateStore(),this.enableDefaultSpatialReferenceChange.emit({defaultWkid:this.enableDefault?f:""})}_handleSpatialRefParamChange(){this.enabled||(this.enableDefault=!1,this._clearFeatureServiceDefaults(this.featureServices)),this._updateStore(),this.enabledSpatialReferenceChange.emit({enabled:this.enabled})}_parameterizeWkid(e){return e?e.toString().startsWith(r)?e:`${r}${e}${o}`:e}_renderFeatureServicesList(e){const t=c.getStoreInfo("spatialReferenceInfo"),i=e.filter((e=>Object.keys(t.services).some((t=>t===e.id))));return i.length>0?a("div",null,a("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),a("ul",{class:"spatial-ref-services-list"},i.map((e=>a("li",{class:"spatial-ref-services-list-item"},a("label",{class:"switch-label"},a("calcite-switch",{checked:t.services[e.id],class:"spatial-ref-item-switch",disabled:!this.enabled,onCalciteSwitchChange:t=>this._updateEnabledServices(t,e),scale:"m"}),e.name)))))):null}_updateEnabledServices(e,t){const i=c.getStoreInfo("spatialReferenceInfo");i.services[t.id]=void 0!==e.detail?.switched?e.detail.switched:void 0===e.target?.checked||e.target.checked,c.setStoreInfo("spatialReferenceInfo",i),this._updateStore(),this.featureServiceSpatialReferenceChange.emit(t)}_unparameterizeWkid(e){return e&&e.toString().startsWith(r)?e.substring(r.length,e.length-o.length):e}_updateFeatureServices(e){e.enabled||Object.keys(e.services).forEach((t=>{e.services[t]=!1})),this.featureServices.forEach((t=>{t.enabled=e.services[t.id],t.wkid=t.enabled?this._parameterizeWkid(t.wkid):this._unparameterizeWkid(t.wkid)})),c.setStoreInfo("featureServices",this.featureServices)}_updateStore(){const e=c.getStoreInfo("spatialReferenceInfo");e.enabled=this.enabled,this.enabled&&this.enableDefault?e.default=f:e.hasOwnProperty("default")&&delete e.default,c.setStoreInfo("spatialReferenceInfo",e),this._updateFeatureServices(e)}_updateUIFromStore(){const e=c.getStoreInfo("spatialReferenceInfo");this.enabled=e.enabled,this.enableDefault=!!e.default,this.featureServices=c.getStoreInfo("featureServices")}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{enabled:["enabledChanged"],enableDefault:["enableDefaultChanged"],locale:["localeWatchHandler"]}}};b.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{font-size:0.875rem;line-height:1.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:2em}.spatial-ref-services-list-item{margin-top:0.25rem}";export{h as solution_contents,d as solution_item,b as solution_spatial_ref}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,h as a,H as e,g as i}from"./p-4e6eb06e.js";import{g as n}from"./p-5ff711ee.js";import{l as r}from"./p-4cd4cb85.js";import{g as s}from"./p-a9a72626.js";import"./p-ac122d9e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const o={"instant-apps":{path:"M11.206 4.805v-1.38a2.231 2.231 0 0 1 2.23-2.231h13.168a2.231 2.231 0 0 1 2.231 2.23v11.15a2.231 2.231 0 0 1-2.23 2.231h-1.398V5.555a.75.75 0 0 0-.75-.75zM30.94 27.204l-5.447-4.41a.211.211 0 0 0-.344.164v2.225H8.197a1.344 1.344 0 0 1-1.344-1.344V11.665a.75.75 0 0 1 .75-.75h9.872a.75.75 0 0 1 .75.75l-.003 7.534a2.422 2.422 0 0 1-.798 1.796l-.945.855h4.3a1.075 1.075 0 0 0 1.074-1.075v-10.54a2.231 2.231 0 0 0-2.23-2.23H5.354a2.148 2.148 0 0 0-2.13 2.23v16.507a2.231 2.231 0 0 0 2.23 2.231l19.695-.003v2.725a.211.211 0 0 0 .344.164l5.447-4.41a.158.158 0 0 0 0-.245z",fill:"#83a238"},"map-viewer":{path:"M21.647 13.706A1.647 1.647 0 1 1 20 15.353a1.647 1.647 0 0 1 1.647-1.647zM19 19.083A1.917 1.917 0 1 1 17.082 21 1.917 1.917 0 0 1 19 19.082zm7.684 3.393a2.433 2.433 0 0 1-.64 1.776l-.01.012c-1.045 1.134-3.215 1.8-5.738 1.8-3.815 0-5.054-1.485-8.586-1.828a6.765 6.765 0 0 1 .566-4.07c.98-1.674 2.445-1.568 3.41-2.724.967-1.157.033-3.384 1.397-4.748 1.539-1.538 3.44-.12 4.57-2.542.877-1.884 1.84-2.98 3.68-3.35a.39.39 0 0 1 .047.07c.132.695 1.097 11.68 1.304 15.604zM6.208 8.864A3.054 3.054 0 0 1 8.115 6.17s2.425-.88 3.09-1.029a2.637 2.637 0 0 1 .314-.01 4.967 4.967 0 0 1 1.157.157l.404.095a7.26 7.26 0 0 0-.238 3.294c.188 1.354.657 2.399-.066 4.361-1.003 2.721-2.901 2.585-3.857 4.562-1.285 2.657.21 6.226-2.182 6.835l.004.002.003.003c-.801.114-1.363.22-1.663.272zm21.549-5.09a.055.055 0 0 0-.022-.037.058.058 0 0 0-.037-.01l-7.37 1.025-8.771-2.742a.227.227 0 0 0-.162.01L3.594 5.566a.054.054 0 0 0-.032.045L1.58 29a41.592 41.592 0 0 1 9.115-1.285c2.765.094 6.646 2.287 10.29 2.177 3.51-.108 8.582-2.382 9.564-2.836a.054.054 0 0 0 .03-.056z",fill:"#3DB8FF"},"story-maps":{path:"M25.5 0C23.015 0 21 .953 21 3.433v8.517a1.467 1.467 0 0 0 .43 1.038l3.837 3.827a.33.33 0 0 0 .466 0l3.836-3.827A1.467 1.467 0 0 0 30 11.95V3.433C30 .953 27.985 0 25.5 0zm0 8.1a2.6 2.6 0 1 1 2.6-2.599A2.599 2.599 0 0 1 25.5 8.1zm-7.856.453c.294-.153.312-.457.312-.788v-2.31a.104.104 0 0 0-.129-.1 6.128 6.128 0 0 0-2.248 1.19.14.14 0 0 1-.167.008c-3.437-2.283-8.543-1.52-12.131-.988-.432.064-1.762.34-2.164.424A.146.146 0 0 0 1 6.133V26.69a.147.147 0 0 0 .05.11.134.134 0 0 0 .116.035A36.394 36.394 0 0 1 9.5 25.781c3.283.054 4.403.96 4.967 1.513l.915.897a.164.164 0 0 0 .23 0l.916-.897a5.98 5.98 0 0 1 3.972-1.47 25.341 25.341 0 0 1 5.715.516c.718.109 1.46.22 2.186.312l1.251.16a.308.308 0 0 0 .348-.305v-7.375a.161.161 0 0 0-.303-.077l-.107.2a7.218 7.218 0 0 1-6.902 3.766 10.455 10.455 0 0 0-5.688.796V9.454a.89.89 0 0 1 .332-.693 2.058 2.058 0 0 1 .312-.208zM14 23.817c-3.071-1.38-5.998-.808-9.447-.293l-.253.036a.263.263 0 0 1-.3-.259V8.525a.098.098 0 0 1 .084-.097l.804-.115c2.518-.372 6.303-1.048 8.708.515a.89.89 0 0 1 .404.746z",fill:"#4fbaa9"},dashboards:{path:"M25.819 28H23.18a.181.181 0 0 1-.181-.181V13.18a.181.181 0 0 1 .181-.181h2.638a.181.181 0 0 1 .181.181V27.82a.181.181 0 0 1-.181.181zM21 27.816v-9.631a.184.184 0 0 0-.184-.185h-2.631a.184.184 0 0 0-.185.184v9.631a.184.184 0 0 0 .184.185h2.631a.184.184 0 0 0 .185-.184zm9.82.184a.18.18 0 0 0 .18-.18v-7.64a.18.18 0 0 0-.18-.18h-2.64a.18.18 0 0 0-.18.18v7.64a.18.18 0 0 0 .18.18zM7 9.267v10.475c.706.033 3.538-1.718 4.274-4.7.679-2.751 3.485-2.864 4.443-2.94 1.766-.14 3.588-.607 4.566-2.798A.216.216 0 0 0 20.085 9H7.267A.267.267 0 0 0 7 9.267zm18.997-1.053A4.411 4.411 0 0 0 21.63 4H2.684A.684.684 0 0 0 2 4.684V21.81A3.19 3.19 0 0 0 5.19 25h9.565a.245.245 0 0 0 .245-.245v-2.362a.393.393 0 0 0-.393-.393H6.38A1.385 1.385 0 0 1 5 20.619V7.349A.348.348 0 0 1 5.348 7h16.324A1.346 1.346 0 0 1 23 8.363v1.28a.357.357 0 0 0 .357.357h2.599a.046.046 0 0 0 .046-.046z",fill:"#ee9e01"},"experience-builder":{path:"M30.85 12.82l-2.85 5v7.44A1.78 1.78 0 0 1 26.22 27H25V7.75a.76.76 0 0 0-.75-.75H12V1.31a.28.28 0 0 1 .42-.25L17.51 4h8.71A1.78 1.78 0 0 1 28 5.78v4.42l2.54 1.47a.83.83 0 0 1 .31 1.15zM12 18h8v-6h-8zm7.62 5H7.75a.76.76 0 0 1-.75-.75V4H5.78A1.78 1.78 0 0 0 4 5.78V13l-2.89 5a.85.85 0 0 0 .31 1.15L4 20.59v4.61A1.78 1.78 0 0 0 5.78 27h8.62l5.18 3a.28.28 0 0 0 .42-.24v-6.39a.38.38 0 0 0-.38-.37z",fill:"#09b8ca"},geoBIM:{path:"M17.802 21.398l6.2 2.557-5.14 2.133a.772.772 0 0 1-1.06-.717zM9.311 7.868a.604.604 0 0 1-.003-1.122L16 4.169l8.12 3.148-8.119 3.184zm-3.5 1.541l8.387 3.413v12.554a.772.772 0 0 1-1.06.717l-6.297-2.736a1.639 1.639 0 0 1-1.03-1.521zM3.844 6.03a1.316 1.316 0 0 0-.827 1.22v17.395a1.316 1.316 0 0 0 .827 1.221L16 30.888l12.983-5.317v-2.423l-7.156-3.023 7.156-2.963v-1.95l-5.101-2.2-3.867 1.516L24 16.123l-6.199 2.505v-5.711l.073-.122 11.108-4.487v-1.95l-12.47-5.047a1.384 1.384 0 0 0-1.027 0z",fill:"#11ad1d"},notebooks:{path:"M2.941 25A.906.906 0 0 1 2 24.135v-.271A.906.906 0 0 1 2.941 23h3.118a.906.906 0 0 1 .941.864v.271a.906.906 0 0 1-.941.865zm3.118-8A.906.906 0 0 0 7 16.135v-.271A.906.906 0 0 0 6.059 15H2.941a.906.906 0 0 0-.941.864v.271a.906.906 0 0 0 .941.865zm0-8A.906.906 0 0 0 7 8.135v-.271A.906.906 0 0 0 6.059 7H2.941A.906.906 0 0 0 2 7.864v.271A.906.906 0 0 0 2.941 9zm9.44 16h-3.726a.773.773 0 0 1-.773-.774V6.171A.172.172 0 0 1 11.172 6H15.5a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5H5.342A1.345 1.345 0 0 0 4 4.343V5h2.059A2.904 2.904 0 0 1 9 7.858v.277A2.907 2.907 0 0 1 6.059 11H4v2h2.059A2.907 2.907 0 0 1 9 15.864v.271A2.907 2.907 0 0 1 6.059 19H4v2h2.059A2.907 2.907 0 0 1 9 23.864v.271A2.907 2.907 0 0 1 6.059 27H4v1.405a.595.595 0 0 0 .595.595H15.5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zM20 3.5v2a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 .5.5v18a.5.5 0 0 1-.5.5h-4a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-25a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.499.5z",fill:"#6e6e6e"},sites:{path:"M2.656 29A.656.656 0 0 1 2 28.344V6.185A3.189 3.189 0 0 1 5.185 3H29.72a.281.281 0 0 1 .281.281v22.53A3.194 3.194 0 0 1 26.81 29zm2.838-3h21.211a.295.295 0 0 0 .296-.295V13.494a.493.493 0 0 0-.493-.494H5v12.506a.494.494 0 0 0 .494.494zM23 9.91a.09.09 0 0 0 .09.09h3.82a.09.09 0 0 0 .09-.09V6.026A.026.026 0 0 0 26.974 6h-3.948a.026.026 0 0 0-.026.026zM6.633 6A1.597 1.597 0 0 0 5 7.595V10h14.523A.477.477 0 0 0 20 9.523V6.477A.477.477 0 0 0 19.523 6zM16 22v-5h7v5zm-7-2v-3h3v3z",fill:"#7842ed"},webAppBuilder:{path:"M15.044 19.974a.188.188 0 0 1-.192-.001l-3.762-2.35a.188.188 0 0 1-.09-.16v-4.098a.188.188 0 0 1 .096-.163l3.761-2.178a.188.188 0 0 1 .182-.001l3.863 2.179a.188.188 0 0 1 .098.165v4.095a.187.187 0 0 1-.092.161zm15.13-1.04a.052.052 0 0 0 .099.022 8.048 8.048 0 0 0 .67-3.147 7.155 7.155 0 0 0-3.507-6.213L17.59 3.768a4.054 4.054 0 0 0-1.968-.627 3.95 3.95 0 0 0-1.894.485c-.607.334-1.132.67-1.278.754a2.951 2.951 0 0 0-1.39 2.506v1.078a.2.2 0 0 0 .307.167l1.365-.87a4.988 4.988 0 0 1 2.319-.792 4.62 4.62 0 0 1 2.219.792s8.442 5.017 9.392 5.576a7.045 7.045 0 0 1 3.513 6.084zM9.546 23.55l.947-.547a.2.2 0 0 0 0-.345l-1.369-.79a4.326 4.326 0 0 1-2.13-3.842V7.286a7.16 7.16 0 0 1 3.63-6.083l.081-.05a.025.025 0 0 0-.012-.045l-.25-.005a8.333 8.333 0 0 0-3.887.994A7.102 7.102 0 0 0 3.069 8.31v10.786a3.96 3.96 0 0 0 1.89 3.362c.894.545 1.605.974 1.81 1.092a2.787 2.787 0 0 0 2.777 0zm4.383 6.37l9.997-5.773a3.959 3.959 0 0 0 1.967-3.32c.021-.929.034-1.604.034-1.806a2.786 2.786 0 0 0-1.39-2.406l-1.123-.57a.2.2 0 0 0-.289.177v1.604a4.45 4.45 0 0 1-2.218 3.842l-3.708 2.14a3.366 3.366 0 0 1-.256.135L11.6 27.128a6.427 6.427 0 0 1-3.343.938 7.137 7.137 0 0 1-3.513-1.038c-.09-.052-.38-.226-.797-.479a.094.094 0 0 0-.134.12 7.182 7.182 0 0 0 2.942 3.25 7.241 7.241 0 0 0 3.587 1.028 7.243 7.243 0 0 0 3.587-1.028z",fill:"#09b8ca"},urban:{path:"M32 14l-4 .003a1 1 0 0 0-1 1V21a1 1 0 0 1-1 1h-2V5.451l-7.598-3.335A1 1 0 0 0 15 3.03V25a1 1 0 0 1-1 1h-2V11.24h-.02L7.5 9l-4.48 2.24H3V20H0v4h5a1 1 0 0 0 1-1V12.717L7.5 12l1.5.717V28a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V6.094l3 1.317V24a2 2 0 0 0 2 2h5.02A1.977 1.977 0 0 0 30 24.024V17h2z",fill:"#3DB8FF"}},c=new Map;function l(t){return c[t]||""}Object.keys(o).forEach((t=>{c[t]=`<svg viewBox="0 0 32 32" width="32" height="32" fill="${o[t].fill}"><path d="${o[t].path}"/></svg>`}));const p="instant-apps-create calcite-mode-light",h=class{constructor(a){t(this,a),this.popoverIcon="grid",this.mode="inline",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.showHeader=!0,this.content=void 0,this.options=["instant-apps","map-viewer","story-maps","experience-builder","dashboards"],this.portal=void 0,this.baseClass=p,this.messages={},this.CreateOptionsLookup=void 0}contentChanged(){Object.keys(this.CreateOptionsLookup).forEach((t=>{this.CreateOptionsLookup[t].href=this.hrefLookup(t)}))}componentWillLoad(){return this.baseClass="dark"===s(this.el)?"instant-apps-create calcite-mode-dark":p,this.initializeModules(),n(this).then((()=>{this.initializePredefinedOptions()}))}disconnectedCallback(){var t,a;null===(t=this.handles)||void 0===t||t.removeAll(),null===(a=this.handles)||void 0===a||a.destroy(),this.handles=null}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel();return a(e,{key:"ee6a5076dce36a238288216de4cbd77d16347c15"},a("div",{key:"c22b60a05f5d0b430c76ab8edcf52577f1eecfaa",class:this.baseClass},t))}async initializeModules(){const[t]=await r(["esri/core/Handles"]);return this.handles=new t,Promise.resolve()}initializePredefinedOptions(){const{instantApps:t,instantAppsDesc:a,mapViewer:e,mapViewerDesc:i,arcgisStoryMaps:n,storyMapsDesc:r,experienceBuilder:s,experienceBuilderDesc:o,dashboards:c,dashboardsDesc:p}=this.messages;this.CreateOptionsLookup={"instant-apps":{title:t,subtitle:a,img:l("instant-apps"),href:this.hrefLookup("instant-apps")},"map-viewer":{title:e,subtitle:i,img:l("map-viewer"),href:this.hrefLookup("map-viewer")},"story-maps":{title:n,subtitle:r,img:l("story-maps"),href:this.hrefLookup("story-maps")},"experience-builder":{title:s,subtitle:o,img:l("experience-builder"),href:this.hrefLookup("experience-builder")},dashboards:{title:c,subtitle:p,img:l("dashboards"),href:this.hrefLookup("dashboards")}}}hrefLookup(t){var a,e;const i=this.getBaseUrl(this.portal),n=this._getEnvironment(i),r=this.contentHref();switch(t){case"instant-apps":return`${i}/apps/instantgallery/index.html?${r}`;case"dashboards":return`${i}/apps/dashboards/new#id=${null===(e=null===(a=this.content)||void 0===a?void 0:a.portalItem)||void 0===e?void 0:e.id}`;case"map-viewer":return`${i}/apps/mapviewer/index.html?${r}`;case"story-maps":return`https://storymaps${"prod"===n?"":n}.arcgis.com/stories/new?${r}`;case"experience-builder":return`https://experience${"prod"===n?"":n}.arcgis.com/builder/page/template/?${r}`}return""}contentHref(){var t,a,e,i,n;return"Web Map"===(null===(a=null===(t=null==this?void 0:this.content)||void 0===t?void 0:t.portalItem)||void 0===a?void 0:a.type)?`webmap=${this.content.portalItem.id}`:"Web Scene"===(null===(i=null===(e=null==this?void 0:this.content)||void 0===e?void 0:e.portalItem)||void 0===i?void 0:i.type)?`webscene=${this.content.portalItem.id}`:"function"==typeof(null===(n=null==this?void 0:this.content)||void 0===n?void 0:n.fetchMembers)?`group=${this.content.id}`:""}getBaseUrl(t){if(!t)return"";const{customBaseUrl:a,portalHostname:e,urlKey:i}=t,{protocol:n}=location;return`${n}//${i?`${i}.${a}`:e}`}_getEnvironment(t){var a;let e=null;try{e=null===(a=new URL(t))||void 0===a?void 0:a.hostname}catch(t){}return null==e||-1===e.indexOf("arcgis.com")?"dev":(-1!==e.indexOf("devext")?"dev":-1!==e.indexOf("qaext")&&"qa")||"prod"}renderPopover(){var t,e;const i=this.renderPanel();return[a("calcite-popover",{referenceElement:"create-popover-btn",overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t,label:"Create panel"},i),a("calcite-action",{id:"create-popover-btn",alignment:"center",icon:this.popoverIcon,title:null===(t=this.messages)||void 0===t?void 0:t.create,text:null===(e=this.messages)||void 0===e?void 0:e.create})]}renderPanel(){const t=this.showHeader?this.renderHeader():null,e=this.renderOptions();return a("div",{class:"inline"===this.mode?"instant-apps-create__inline-container":"instant-apps-create__popover-container"},t,e)}renderHeader(){const{create:t,createSubheading:e}=this.messages;return a("div",{class:"instant-apps-create__header"},a("h3",null,t),a("p",null,e))}renderOptions(){return a("nav",null,this.options.map((t=>this.renderOption(t))))}renderOption(t){var e;"string"==typeof t&&(t=null===(e=null==this?void 0:this.CreateOptionsLookup)||void 0===e?void 0:e[t]);const{title:i,subtitle:n,img:r,href:s}=t||{};return a("a",{class:"instant-apps-create__option",href:s,target:"_blank"},a("span",{class:"instant-apps-create__option-icon",innerHTML:r}),a("span",{class:"instant-apps-create__option-text"},a("span",{class:"instant-apps-create__option-text-wrapper"},a("h3",{class:"instant-apps-create__option-title"},i),a("calcite-icon",{scale:"s",icon:"launch"})),a("p",{class:"instant-apps-create__option-subtitle"},n)))}get el(){return i(this)}static get watchers(){return{content:["contentChanged"]}}};h.style=":host{display:block;--instant-apps-create-action-background:var(--calcite-color-foreground-1);--instant-apps-create-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-create-action-background-press:var(--calcite-color-foreground-3);--instant-apps-create-action-height:100%;--instant-apps-create-action-width:fit-content;--instant-apps-create-action-icon-color:var(--calcite-color-text-3);--instant-apps-create-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-create-background:var(--calcite-color-foreground-1);--instant-apps-create-text-color:var(--calcite-color-text-1);--instant-apps-create-popover-width:450px}.instant-apps-create{height:100%}.instant-apps-create *{box-sizing:border-box}.instant-apps-create__popover-container,.instant-apps-create__inline-container{padding:1rem 1.5rem;background:var(--instant-apps-create-background);--calcite-color-text-1:var(--instant-apps-create-text-color)}.instant-apps-create__popover-container{width:var(--instant-apps-create-popover-width)}.instant-apps-create calcite-popover{--calcite-color-foreground-1:var(--instant-apps-create-background)}.instant-apps-create calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-create__header h3{margin:0;font-weight:var(--calcite-font-weight-medium)}.instant-apps-create__header p{margin:0;padding:0 0 0.5rem 0;font-weight:var(--calcite-font-weight-normal)}.instant-apps-create__options{display:flex;justify-content:space-between;align-items:center;flex-direction:column}.instant-apps-create__option{display:flex;color:inherit;text-decoration:inherit;height:-moz-fit-content;height:fit-content;margin-bottom:0.5rem;cursor:pointer;--calcite-color-text-link:var(--calcite-color-text-1);align-items:stretch;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow);outline-offset:0;outline-color:transparent;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}.instant-apps-create__option:first-of-type{margin-top:0.5rem}.instant-apps-create__option:last-of-type{margin-bottom:0}.instant-apps-create__option:hover{outline:1px solid var(--calcite-color-border-1);outline-offset:2px}.instant-apps-create__option-icon{display:flex;background:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);font-size:1.25rem;background-color:var(--calcite-color-background);justify-content:center;align-items:center;flex:1 1 auto;max-width:5rem;min-width:5rem;height:auto}.instant-apps-create__option-icon svg{display:block;overflow-clip-margin:content-box;overflow:hidden}.instant-apps-create__option-text{min-height:2rem;font-size:0.75rem;color:var(--calcite-color-text-2);padding:0.75rem 0 0 0.75rem}.instant-apps-create__option-text-wrapper{display:flex;align-items:center}.instant-apps-create__option-text h3{margin:0;font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.instant-apps-create__option-text calcite-icon{margin-left:0.25rem;color:rgb(126, 126, 126);--tw-translate-x:0px;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;transition-delay:0s}a:hover .instant-apps-create__option-text calcite-icon{opacity:1;--tw-translate-x:0.5rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.instant-apps-create__option-text p{margin:0;font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3);line-height:1.35;min-height:3rem}";export{h as instant_apps_create}
6
+ import{r as t,h as a,H as e,g as i}from"./p-4e6eb06e.js";import{g as n}from"./p-5104cc98.js";import{l as r}from"./p-d001e961.js";import{g as s}from"./p-a9a72626.js";import"./p-ac122d9e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const o={"instant-apps":{path:"M11.206 4.805v-1.38a2.231 2.231 0 0 1 2.23-2.231h13.168a2.231 2.231 0 0 1 2.231 2.23v11.15a2.231 2.231 0 0 1-2.23 2.231h-1.398V5.555a.75.75 0 0 0-.75-.75zM30.94 27.204l-5.447-4.41a.211.211 0 0 0-.344.164v2.225H8.197a1.344 1.344 0 0 1-1.344-1.344V11.665a.75.75 0 0 1 .75-.75h9.872a.75.75 0 0 1 .75.75l-.003 7.534a2.422 2.422 0 0 1-.798 1.796l-.945.855h4.3a1.075 1.075 0 0 0 1.074-1.075v-10.54a2.231 2.231 0 0 0-2.23-2.23H5.354a2.148 2.148 0 0 0-2.13 2.23v16.507a2.231 2.231 0 0 0 2.23 2.231l19.695-.003v2.725a.211.211 0 0 0 .344.164l5.447-4.41a.158.158 0 0 0 0-.245z",fill:"#83a238"},"map-viewer":{path:"M21.647 13.706A1.647 1.647 0 1 1 20 15.353a1.647 1.647 0 0 1 1.647-1.647zM19 19.083A1.917 1.917 0 1 1 17.082 21 1.917 1.917 0 0 1 19 19.082zm7.684 3.393a2.433 2.433 0 0 1-.64 1.776l-.01.012c-1.045 1.134-3.215 1.8-5.738 1.8-3.815 0-5.054-1.485-8.586-1.828a6.765 6.765 0 0 1 .566-4.07c.98-1.674 2.445-1.568 3.41-2.724.967-1.157.033-3.384 1.397-4.748 1.539-1.538 3.44-.12 4.57-2.542.877-1.884 1.84-2.98 3.68-3.35a.39.39 0 0 1 .047.07c.132.695 1.097 11.68 1.304 15.604zM6.208 8.864A3.054 3.054 0 0 1 8.115 6.17s2.425-.88 3.09-1.029a2.637 2.637 0 0 1 .314-.01 4.967 4.967 0 0 1 1.157.157l.404.095a7.26 7.26 0 0 0-.238 3.294c.188 1.354.657 2.399-.066 4.361-1.003 2.721-2.901 2.585-3.857 4.562-1.285 2.657.21 6.226-2.182 6.835l.004.002.003.003c-.801.114-1.363.22-1.663.272zm21.549-5.09a.055.055 0 0 0-.022-.037.058.058 0 0 0-.037-.01l-7.37 1.025-8.771-2.742a.227.227 0 0 0-.162.01L3.594 5.566a.054.054 0 0 0-.032.045L1.58 29a41.592 41.592 0 0 1 9.115-1.285c2.765.094 6.646 2.287 10.29 2.177 3.51-.108 8.582-2.382 9.564-2.836a.054.054 0 0 0 .03-.056z",fill:"#3DB8FF"},"story-maps":{path:"M25.5 0C23.015 0 21 .953 21 3.433v8.517a1.467 1.467 0 0 0 .43 1.038l3.837 3.827a.33.33 0 0 0 .466 0l3.836-3.827A1.467 1.467 0 0 0 30 11.95V3.433C30 .953 27.985 0 25.5 0zm0 8.1a2.6 2.6 0 1 1 2.6-2.599A2.599 2.599 0 0 1 25.5 8.1zm-7.856.453c.294-.153.312-.457.312-.788v-2.31a.104.104 0 0 0-.129-.1 6.128 6.128 0 0 0-2.248 1.19.14.14 0 0 1-.167.008c-3.437-2.283-8.543-1.52-12.131-.988-.432.064-1.762.34-2.164.424A.146.146 0 0 0 1 6.133V26.69a.147.147 0 0 0 .05.11.134.134 0 0 0 .116.035A36.394 36.394 0 0 1 9.5 25.781c3.283.054 4.403.96 4.967 1.513l.915.897a.164.164 0 0 0 .23 0l.916-.897a5.98 5.98 0 0 1 3.972-1.47 25.341 25.341 0 0 1 5.715.516c.718.109 1.46.22 2.186.312l1.251.16a.308.308 0 0 0 .348-.305v-7.375a.161.161 0 0 0-.303-.077l-.107.2a7.218 7.218 0 0 1-6.902 3.766 10.455 10.455 0 0 0-5.688.796V9.454a.89.89 0 0 1 .332-.693 2.058 2.058 0 0 1 .312-.208zM14 23.817c-3.071-1.38-5.998-.808-9.447-.293l-.253.036a.263.263 0 0 1-.3-.259V8.525a.098.098 0 0 1 .084-.097l.804-.115c2.518-.372 6.303-1.048 8.708.515a.89.89 0 0 1 .404.746z",fill:"#4fbaa9"},dashboards:{path:"M25.819 28H23.18a.181.181 0 0 1-.181-.181V13.18a.181.181 0 0 1 .181-.181h2.638a.181.181 0 0 1 .181.181V27.82a.181.181 0 0 1-.181.181zM21 27.816v-9.631a.184.184 0 0 0-.184-.185h-2.631a.184.184 0 0 0-.185.184v9.631a.184.184 0 0 0 .184.185h2.631a.184.184 0 0 0 .185-.184zm9.82.184a.18.18 0 0 0 .18-.18v-7.64a.18.18 0 0 0-.18-.18h-2.64a.18.18 0 0 0-.18.18v7.64a.18.18 0 0 0 .18.18zM7 9.267v10.475c.706.033 3.538-1.718 4.274-4.7.679-2.751 3.485-2.864 4.443-2.94 1.766-.14 3.588-.607 4.566-2.798A.216.216 0 0 0 20.085 9H7.267A.267.267 0 0 0 7 9.267zm18.997-1.053A4.411 4.411 0 0 0 21.63 4H2.684A.684.684 0 0 0 2 4.684V21.81A3.19 3.19 0 0 0 5.19 25h9.565a.245.245 0 0 0 .245-.245v-2.362a.393.393 0 0 0-.393-.393H6.38A1.385 1.385 0 0 1 5 20.619V7.349A.348.348 0 0 1 5.348 7h16.324A1.346 1.346 0 0 1 23 8.363v1.28a.357.357 0 0 0 .357.357h2.599a.046.046 0 0 0 .046-.046z",fill:"#ee9e01"},"experience-builder":{path:"M30.85 12.82l-2.85 5v7.44A1.78 1.78 0 0 1 26.22 27H25V7.75a.76.76 0 0 0-.75-.75H12V1.31a.28.28 0 0 1 .42-.25L17.51 4h8.71A1.78 1.78 0 0 1 28 5.78v4.42l2.54 1.47a.83.83 0 0 1 .31 1.15zM12 18h8v-6h-8zm7.62 5H7.75a.76.76 0 0 1-.75-.75V4H5.78A1.78 1.78 0 0 0 4 5.78V13l-2.89 5a.85.85 0 0 0 .31 1.15L4 20.59v4.61A1.78 1.78 0 0 0 5.78 27h8.62l5.18 3a.28.28 0 0 0 .42-.24v-6.39a.38.38 0 0 0-.38-.37z",fill:"#09b8ca"},geoBIM:{path:"M17.802 21.398l6.2 2.557-5.14 2.133a.772.772 0 0 1-1.06-.717zM9.311 7.868a.604.604 0 0 1-.003-1.122L16 4.169l8.12 3.148-8.119 3.184zm-3.5 1.541l8.387 3.413v12.554a.772.772 0 0 1-1.06.717l-6.297-2.736a1.639 1.639 0 0 1-1.03-1.521zM3.844 6.03a1.316 1.316 0 0 0-.827 1.22v17.395a1.316 1.316 0 0 0 .827 1.221L16 30.888l12.983-5.317v-2.423l-7.156-3.023 7.156-2.963v-1.95l-5.101-2.2-3.867 1.516L24 16.123l-6.199 2.505v-5.711l.073-.122 11.108-4.487v-1.95l-12.47-5.047a1.384 1.384 0 0 0-1.027 0z",fill:"#11ad1d"},notebooks:{path:"M2.941 25A.906.906 0 0 1 2 24.135v-.271A.906.906 0 0 1 2.941 23h3.118a.906.906 0 0 1 .941.864v.271a.906.906 0 0 1-.941.865zm3.118-8A.906.906 0 0 0 7 16.135v-.271A.906.906 0 0 0 6.059 15H2.941a.906.906 0 0 0-.941.864v.271a.906.906 0 0 0 .941.865zm0-8A.906.906 0 0 0 7 8.135v-.271A.906.906 0 0 0 6.059 7H2.941A.906.906 0 0 0 2 7.864v.271A.906.906 0 0 0 2.941 9zm9.44 16h-3.726a.773.773 0 0 1-.773-.774V6.171A.172.172 0 0 1 11.172 6H15.5a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5H5.342A1.345 1.345 0 0 0 4 4.343V5h2.059A2.904 2.904 0 0 1 9 7.858v.277A2.907 2.907 0 0 1 6.059 11H4v2h2.059A2.907 2.907 0 0 1 9 15.864v.271A2.907 2.907 0 0 1 6.059 19H4v2h2.059A2.907 2.907 0 0 1 9 23.864v.271A2.907 2.907 0 0 1 6.059 27H4v1.405a.595.595 0 0 0 .595.595H15.5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zM20 3.5v2a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 .5.5v18a.5.5 0 0 1-.5.5h-4a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-25a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.499.5z",fill:"#6e6e6e"},sites:{path:"M2.656 29A.656.656 0 0 1 2 28.344V6.185A3.189 3.189 0 0 1 5.185 3H29.72a.281.281 0 0 1 .281.281v22.53A3.194 3.194 0 0 1 26.81 29zm2.838-3h21.211a.295.295 0 0 0 .296-.295V13.494a.493.493 0 0 0-.493-.494H5v12.506a.494.494 0 0 0 .494.494zM23 9.91a.09.09 0 0 0 .09.09h3.82a.09.09 0 0 0 .09-.09V6.026A.026.026 0 0 0 26.974 6h-3.948a.026.026 0 0 0-.026.026zM6.633 6A1.597 1.597 0 0 0 5 7.595V10h14.523A.477.477 0 0 0 20 9.523V6.477A.477.477 0 0 0 19.523 6zM16 22v-5h7v5zm-7-2v-3h3v3z",fill:"#7842ed"},webAppBuilder:{path:"M15.044 19.974a.188.188 0 0 1-.192-.001l-3.762-2.35a.188.188 0 0 1-.09-.16v-4.098a.188.188 0 0 1 .096-.163l3.761-2.178a.188.188 0 0 1 .182-.001l3.863 2.179a.188.188 0 0 1 .098.165v4.095a.187.187 0 0 1-.092.161zm15.13-1.04a.052.052 0 0 0 .099.022 8.048 8.048 0 0 0 .67-3.147 7.155 7.155 0 0 0-3.507-6.213L17.59 3.768a4.054 4.054 0 0 0-1.968-.627 3.95 3.95 0 0 0-1.894.485c-.607.334-1.132.67-1.278.754a2.951 2.951 0 0 0-1.39 2.506v1.078a.2.2 0 0 0 .307.167l1.365-.87a4.988 4.988 0 0 1 2.319-.792 4.62 4.62 0 0 1 2.219.792s8.442 5.017 9.392 5.576a7.045 7.045 0 0 1 3.513 6.084zM9.546 23.55l.947-.547a.2.2 0 0 0 0-.345l-1.369-.79a4.326 4.326 0 0 1-2.13-3.842V7.286a7.16 7.16 0 0 1 3.63-6.083l.081-.05a.025.025 0 0 0-.012-.045l-.25-.005a8.333 8.333 0 0 0-3.887.994A7.102 7.102 0 0 0 3.069 8.31v10.786a3.96 3.96 0 0 0 1.89 3.362c.894.545 1.605.974 1.81 1.092a2.787 2.787 0 0 0 2.777 0zm4.383 6.37l9.997-5.773a3.959 3.959 0 0 0 1.967-3.32c.021-.929.034-1.604.034-1.806a2.786 2.786 0 0 0-1.39-2.406l-1.123-.57a.2.2 0 0 0-.289.177v1.604a4.45 4.45 0 0 1-2.218 3.842l-3.708 2.14a3.366 3.366 0 0 1-.256.135L11.6 27.128a6.427 6.427 0 0 1-3.343.938 7.137 7.137 0 0 1-3.513-1.038c-.09-.052-.38-.226-.797-.479a.094.094 0 0 0-.134.12 7.182 7.182 0 0 0 2.942 3.25 7.241 7.241 0 0 0 3.587 1.028 7.243 7.243 0 0 0 3.587-1.028z",fill:"#09b8ca"},urban:{path:"M32 14l-4 .003a1 1 0 0 0-1 1V21a1 1 0 0 1-1 1h-2V5.451l-7.598-3.335A1 1 0 0 0 15 3.03V25a1 1 0 0 1-1 1h-2V11.24h-.02L7.5 9l-4.48 2.24H3V20H0v4h5a1 1 0 0 0 1-1V12.717L7.5 12l1.5.717V28a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V6.094l3 1.317V24a2 2 0 0 0 2 2h5.02A1.977 1.977 0 0 0 30 24.024V17h2z",fill:"#3DB8FF"}},c=new Map;function l(t){return c[t]||""}Object.keys(o).forEach((t=>{c[t]=`<svg viewBox="0 0 32 32" width="32" height="32" fill="${o[t].fill}"><path d="${o[t].path}"/></svg>`}));const p="instant-apps-create calcite-mode-light",h=class{constructor(a){t(this,a),this.popoverIcon="grid",this.mode="inline",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.showHeader=!0,this.content=void 0,this.options=["instant-apps","map-viewer","story-maps","experience-builder","dashboards"],this.portal=void 0,this.baseClass=p,this.messages={},this.CreateOptionsLookup=void 0}contentChanged(){Object.keys(this.CreateOptionsLookup).forEach((t=>{this.CreateOptionsLookup[t].href=this.hrefLookup(t)}))}componentWillLoad(){return this.baseClass="dark"===s(this.el)?"instant-apps-create calcite-mode-dark":p,this.initializeModules(),n(this).then((()=>{this.initializePredefinedOptions()}))}disconnectedCallback(){var t,a;null===(t=this.handles)||void 0===t||t.removeAll(),null===(a=this.handles)||void 0===a||a.destroy(),this.handles=null}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel();return a(e,{key:"ee6a5076dce36a238288216de4cbd77d16347c15"},a("div",{key:"c22b60a05f5d0b430c76ab8edcf52577f1eecfaa",class:this.baseClass},t))}async initializeModules(){const[t]=await r(["esri/core/Handles"]);return this.handles=new t,Promise.resolve()}initializePredefinedOptions(){const{instantApps:t,instantAppsDesc:a,mapViewer:e,mapViewerDesc:i,arcgisStoryMaps:n,storyMapsDesc:r,experienceBuilder:s,experienceBuilderDesc:o,dashboards:c,dashboardsDesc:p}=this.messages;this.CreateOptionsLookup={"instant-apps":{title:t,subtitle:a,img:l("instant-apps"),href:this.hrefLookup("instant-apps")},"map-viewer":{title:e,subtitle:i,img:l("map-viewer"),href:this.hrefLookup("map-viewer")},"story-maps":{title:n,subtitle:r,img:l("story-maps"),href:this.hrefLookup("story-maps")},"experience-builder":{title:s,subtitle:o,img:l("experience-builder"),href:this.hrefLookup("experience-builder")},dashboards:{title:c,subtitle:p,img:l("dashboards"),href:this.hrefLookup("dashboards")}}}hrefLookup(t){var a,e;const i=this.getBaseUrl(this.portal),n=this._getEnvironment(i),r=this.contentHref();switch(t){case"instant-apps":return`${i}/apps/instantgallery/index.html?${r}`;case"dashboards":return`${i}/apps/dashboards/new#id=${null===(e=null===(a=this.content)||void 0===a?void 0:a.portalItem)||void 0===e?void 0:e.id}`;case"map-viewer":return`${i}/apps/mapviewer/index.html?${r}`;case"story-maps":return`https://storymaps${"prod"===n?"":n}.arcgis.com/stories/new?${r}`;case"experience-builder":return`https://experience${"prod"===n?"":n}.arcgis.com/builder/page/template/?${r}`}return""}contentHref(){var t,a,e,i,n;return"Web Map"===(null===(a=null===(t=null==this?void 0:this.content)||void 0===t?void 0:t.portalItem)||void 0===a?void 0:a.type)?`webmap=${this.content.portalItem.id}`:"Web Scene"===(null===(i=null===(e=null==this?void 0:this.content)||void 0===e?void 0:e.portalItem)||void 0===i?void 0:i.type)?`webscene=${this.content.portalItem.id}`:"function"==typeof(null===(n=null==this?void 0:this.content)||void 0===n?void 0:n.fetchMembers)?`group=${this.content.id}`:""}getBaseUrl(t){if(!t)return"";const{customBaseUrl:a,portalHostname:e,urlKey:i}=t,{protocol:n}=location;return`${n}//${i?`${i}.${a}`:e}`}_getEnvironment(t){var a;let e=null;try{e=null===(a=new URL(t))||void 0===a?void 0:a.hostname}catch(t){}return null==e||-1===e.indexOf("arcgis.com")?"dev":(-1!==e.indexOf("devext")?"dev":-1!==e.indexOf("qaext")&&"qa")||"prod"}renderPopover(){var t,e;const i=this.renderPanel();return[a("calcite-popover",{referenceElement:"create-popover-btn",overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t,label:"Create panel"},i),a("calcite-action",{id:"create-popover-btn",alignment:"center",icon:this.popoverIcon,title:null===(t=this.messages)||void 0===t?void 0:t.create,text:null===(e=this.messages)||void 0===e?void 0:e.create})]}renderPanel(){const t=this.showHeader?this.renderHeader():null,e=this.renderOptions();return a("div",{class:"inline"===this.mode?"instant-apps-create__inline-container":"instant-apps-create__popover-container"},t,e)}renderHeader(){const{create:t,createSubheading:e}=this.messages;return a("div",{class:"instant-apps-create__header"},a("h3",null,t),a("p",null,e))}renderOptions(){return a("nav",null,this.options.map((t=>this.renderOption(t))))}renderOption(t){var e;"string"==typeof t&&(t=null===(e=null==this?void 0:this.CreateOptionsLookup)||void 0===e?void 0:e[t]);const{title:i,subtitle:n,img:r,href:s}=t||{};return a("a",{class:"instant-apps-create__option",href:s,target:"_blank"},a("span",{class:"instant-apps-create__option-icon",innerHTML:r}),a("span",{class:"instant-apps-create__option-text"},a("span",{class:"instant-apps-create__option-text-wrapper"},a("h3",{class:"instant-apps-create__option-title"},i),a("calcite-icon",{scale:"s",icon:"launch"})),a("p",{class:"instant-apps-create__option-subtitle"},n)))}get el(){return i(this)}static get watchers(){return{content:["contentChanged"]}}};h.style=":host{display:block;--instant-apps-create-action-background:var(--calcite-color-foreground-1);--instant-apps-create-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-create-action-background-press:var(--calcite-color-foreground-3);--instant-apps-create-action-height:100%;--instant-apps-create-action-width:fit-content;--instant-apps-create-action-icon-color:var(--calcite-color-text-3);--instant-apps-create-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-create-background:var(--calcite-color-foreground-1);--instant-apps-create-text-color:var(--calcite-color-text-1);--instant-apps-create-popover-width:450px}.instant-apps-create{height:100%}.instant-apps-create *{box-sizing:border-box}.instant-apps-create__popover-container,.instant-apps-create__inline-container{padding:1rem 1.5rem;background:var(--instant-apps-create-background);--calcite-color-text-1:var(--instant-apps-create-text-color)}.instant-apps-create__popover-container{width:var(--instant-apps-create-popover-width)}.instant-apps-create calcite-popover{--calcite-color-foreground-1:var(--instant-apps-create-background)}.instant-apps-create calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-create__header h3{margin:0;font-weight:var(--calcite-font-weight-medium)}.instant-apps-create__header p{margin:0;padding:0 0 0.5rem 0;font-weight:var(--calcite-font-weight-normal)}.instant-apps-create__options{display:flex;justify-content:space-between;align-items:center;flex-direction:column}.instant-apps-create__option{display:flex;color:inherit;text-decoration:inherit;height:-moz-fit-content;height:fit-content;margin-bottom:0.5rem;cursor:pointer;--calcite-color-text-link:var(--calcite-color-text-1);align-items:stretch;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow);outline-offset:0;outline-color:transparent;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}.instant-apps-create__option:first-of-type{margin-top:0.5rem}.instant-apps-create__option:last-of-type{margin-bottom:0}.instant-apps-create__option:hover{outline:1px solid var(--calcite-color-border-1);outline-offset:2px}.instant-apps-create__option-icon{display:flex;background:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);font-size:1.25rem;background-color:var(--calcite-color-background);justify-content:center;align-items:center;flex:1 1 auto;max-width:5rem;min-width:5rem;height:auto}.instant-apps-create__option-icon svg{display:block;overflow-clip-margin:content-box;overflow:hidden}.instant-apps-create__option-text{min-height:2rem;font-size:0.75rem;color:var(--calcite-color-text-2);padding:0.75rem 0 0 0.75rem}.instant-apps-create__option-text-wrapper{display:flex;align-items:center}.instant-apps-create__option-text h3{margin:0;font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.instant-apps-create__option-text calcite-icon{margin-left:0.25rem;color:rgb(126, 126, 126);--tw-translate-x:0px;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;transition-delay:0s}a:hover .instant-apps-create__option-text calcite-icon{opacity:1;--tw-translate-x:0.5rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.instant-apps-create__option-text p{margin:0;font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3);line-height:1.35;min-height:3rem}";export{h as instant_apps_create}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{b as n}from"./p-5ff711ee.js";import{c as t}from"./p-dc9d4be3.js";var e,l,a,o;!function(n){n.User="user",n.Translation="translation"}(e||(e={})),function(n){n.String="string",n.TextEditor="textEditor"}(l||(l={})),function(n){n.ExpandCollapse="list-merge",n.SettingIndicator="list-button",n.Popover="information",n.Expanded="chevron-down",n.Collapsed="chevron-right",n.Copy="copy-to-clipboard",n.Breadcrumb="chevron-right",n.DefaultIcon="language",n.Title="title",n.Subtitle="subheading",n.Text="text",n.Description="description",n.Button="button",n.String="string"}(a||(a={})),function(n){n.Light="calcite-mode-light",n.Dark="calcite-mode-dark"}(o||(o={}));const u=t({uiData:null,currentLanguage:null,lastSave:null,saving:!1,currentLocaleSettingItem:null,portalItemResource:null,portalItemResourceT9n:null}),i=u.state,c=u;function s(n,t){var e;if(!n)return;const l=c.get("uiData"),a=new Map;a.set("locales",t),a.set("translatedLanguageLabels",Object.assign({},n.translatedLanguageLabels)),n.content.forEach((n=>{var t,e;const{type:o,label:u,value:i,uiLocation:c}=n,s=null==l?void 0:l.get(n.id);a.set(n.id,{userLocaleData:{type:null!=o?o:null,label:null!=u?u:null,value:null!=i?i:null},expanded:!0,selected:null!==(t=null==s?void 0:s.selected)&&void 0!==t&&t,uiLocation:c,tip:null!==(e=null==n?void 0:n.tip)&&void 0!==e?e:null})}));const o=n.content.map((n=>n.id)),u=o.every((n=>!a.get(n).selected)),i=a.get(o[0]);if(u&&i){const n=null==l?void 0:l.get(o[0]);i.selected=null===(e=null==n?void 0:n.selected)||void 0===e||e}return a}async function r(t){return(await n(t))[0]}function d(){var n;const t=[];return null===(n=i.uiData)||void 0===n||n.forEach(((n,e)=>{"locales"!==e&&"translatedLanguageLabels"!==e&&t.push(e)})),t}function v(n,t){const e=c.get("portalItemResourceT9n");let l;return(null==e?void 0:e[n])||(e[n]={}),l=Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},e[n]),t)}),l}function p(n){var t;return null!==(t=null==n?void 0:n.map((n=>n.locale)))&&void 0!==t?t:[]}function f(){return document.body.classList.contains(o.Dark)}function g(){const n=document.createElement("style");n.innerHTML="\n .instant-apps-language-translator-item__nested-input .ck.ck-reset.ck-editor.ck-rounded-corners {\n margin-left: 30px !important;\n }\n",document.head.appendChild(n)}async function b(n){const t=await n.fetch(),e=Date.now();c.set("lastSave",e);const l=JSON.stringify(Object.assign(Object.assign({},t),{lastSave:e})),a=new Blob([l],{type:"application/json"});n.update(a)}export{a as E,s as a,p as b,d as c,l as d,f as e,o as f,r as g,e as h,g as i,v as j,i as l,c as s,b as u}
6
+ import{b as n}from"./p-5104cc98.js";import{c as t}from"./p-dc9d4be3.js";var e,l,a,o;!function(n){n.User="user",n.Translation="translation"}(e||(e={})),function(n){n.String="string",n.TextEditor="textEditor"}(l||(l={})),function(n){n.ExpandCollapse="list-merge",n.SettingIndicator="list-button",n.Popover="information",n.Expanded="chevron-down",n.Collapsed="chevron-right",n.Copy="copy-to-clipboard",n.Breadcrumb="chevron-right",n.DefaultIcon="language",n.Title="title",n.Subtitle="subheading",n.Text="text",n.Description="description",n.Button="button",n.String="string"}(a||(a={})),function(n){n.Light="calcite-mode-light",n.Dark="calcite-mode-dark"}(o||(o={}));const u=t({uiData:null,currentLanguage:null,lastSave:null,saving:!1,currentLocaleSettingItem:null,portalItemResource:null,portalItemResourceT9n:null}),c=u.state,i=u;function r(n,t){var e;if(!n)return;const l=i.get("uiData"),a=new Map;a.set("locales",t),a.set("translatedLanguageLabels",Object.assign({},n.translatedLanguageLabels)),n.content.forEach((n=>{var t,e;const{type:o,label:u,value:c,uiLocation:i}=n,r=null==l?void 0:l.get(n.id);a.set(n.id,{userLocaleData:{type:null!=o?o:null,label:null!=u?u:null,value:null!=c?c:null},expanded:!0,selected:null!==(t=null==r?void 0:r.selected)&&void 0!==t&&t,uiLocation:i,tip:null!==(e=null==n?void 0:n.tip)&&void 0!==e?e:null})}));const o=n.content.map((n=>n.id)),u=o.every((n=>!a.get(n).selected)),c=a.get(o[0]);if(u&&c){const n=null==l?void 0:l.get(o[0]);c.selected=null===(e=null==n?void 0:n.selected)||void 0===e||e}return a}async function s(t){return(await n(t))[0]}function d(){var n;const t=[];return null===(n=c.uiData)||void 0===n||n.forEach(((n,e)=>{"locales"!==e&&"translatedLanguageLabels"!==e&&t.push(e)})),t}function v(n,t){const e=i.get("portalItemResourceT9n");let l;return(null==e?void 0:e[n])||(e[n]={}),l=Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},e[n]),t)}),l}function p(n){var t;return null!==(t=null==n?void 0:n.map((n=>n.locale)))&&void 0!==t?t:[]}function g(){return document.body.classList.contains(o.Dark)}function b(){const n=document.createElement("style");n.innerHTML="\n .instant-apps-language-translator-item__nested-input .ck.ck-reset.ck-editor.ck-rounded-corners {\n margin-left: 30px !important;\n }\n",document.head.appendChild(n)}async function f(n){const t=i.get("portalItemResourceT9n"),e=Date.now();i.set("lastSave",e);const l=JSON.stringify(Object.assign(Object.assign({},t),{lastSave:e})),a=new Blob([l],{type:"application/json"});n.update(a)}export{a as E,r as a,p as b,d as c,l as d,g as e,o as f,s as g,e as h,b as i,v as j,c as l,i as s,f as u}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as a,h as n,H as s,g as e,F as i}from"./p-4e6eb06e.js";import{d as r,e as o,f as l,s as c,h as p,E as u,l as g,j as d,c as h}from"./p-50fb7f47.js";import"./p-5ff711ee.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";import"./p-dc9d4be3.js";const m="instant-apps-components__ckeditor-wrapper",v=class{constructor(n){t(this,n),this.isFocused=a(this,"isFocused",7),this.dataChanged=a(this,"dataChanged",7),this.value=void 0,this.editorInstance=void 0,this.config=void 0}updateValue(){this.value&&this.editorInstance.setData(this.value)}async componentDidLoad(){this.init()}componentDidUpdate(){this.editorInstance.setData(this.value)}render(){return n(s,{key:"26f62d5413e21916b77253476cf48f69682861d5"},n("div",{key:"45a9d7b859a21e49c81afdaa3bdd5074f1428cd5"}))}init(){this.applyStyles(),this.initEditor()}applyStyles(){if(document.getElementById(m))return;const t=document.createElement("style");t.id=m,t.innerHTML="\n .ck.ck-reset.ck-editor.ck-rounded-corners {\n margin-top: 10px !important;\n margin-left: 55px !important;\n }\n .ck-editor__editable {\n height: 70px !important;\n font-size: 0.875rem !important;\n line-height: \t1.375 !important;\n color: var(--calcite-color-text-1) !important;\n }\n\n .ck.ck-editor__editable_inline>:first-child,\n .ck.ck-editor__editable_inline>:last-child {\n --ck-spacing-large: 0.5rem !important;\n }\n\n .ck.ck-balloon-panel.ck-powered-by-balloon {\n --ck-z-modal: 700;\n z-index: 700;\n }\n\n .calcite-mode-dark .ck-editor__editable {\n color: var(--calcite-color-text-inverse) !important;\n }\n",document.head.prepend(t)}async initEditor(){const t=await this.createEditor();t&&(this.editorInstance=t,(this.value||""===this.value)&&t.setData(this.value),t.editing.view.document.on("change:isFocused",this.getEditorFocusedCallback(t)))}async createEditor(){try{let t;return t=this.config?await ClassicEditor.create(this.el,this.config):await ClassicEditor.create(this.el),this.editorInstance=t,Promise.resolve(t)}catch(t){return console.error(t),Promise.reject(null)}}getEditorFocusedCallback(t){return(a,n,s)=>{if(s)this.isFocused.emit();else{const a=t.getData();this.value!==a&&(this.value=a,this.dataChanged.emit(a))}}}get el(){return e(this)}static get watchers(){return{value:["updateValue"]}}};v.style=":host{display:block}";const _="instant-apps-language-translator-item",f={section:`${_}__section`,selected:`${_}__section--selected`,collapsed:`${_}__section--collapsed`,topRow:`${_}__top-row`,labelContainer:`${_}__label-container`,label:`${_}__label`,uiLocationPopoverContent:`${_}__ui-location-popover-content`,uiLocationItems:`${_}__ui-location-items`,uiLocationItem:`${_}__ui-location-item`,infoIcon:`${_}__info-icon`,infoButton:`${_}__info-button`,tip:`${_}__tip`,nestedInput:`${_}__nested-input`},b=class{constructor(n){t(this,n),this.translatorItemDataUpdated=a(this,"translatorItemDataUpdated",7),this.userInputs={},this.translatedInputs={},this.fieldName=void 0,this.translatedLanguageLabels=void 0,this.setting=void 0,this.userLocaleInputOnChangeCallback=void 0,this.translatedLocaleInputOnChangeCallback=void 0}get isTextEditor(){return this.setting.type===r.TextEditor}get calciteMode(){return o()?l.Dark:l.Light}get hasNestedContent(){var t;return!!(null===(t=this.setting)||void 0===t?void 0:t.content)}get tipID(){return`${this.fieldName}goTo`}componentDidLoad(){this.isTextEditor&&c.onChange("uiData",(()=>this.handleEditorCollapse()))}render(){var t;return"content"in this.setting&&(null===(t=this.setting.content)||void 0===t?void 0:t.every((t=>{var a;return 0===(null===(a=null==t?void 0:t.content)||void 0===a?void 0:a.length)})))?n(i,null):n(s,{class:this.calciteMode},this.renderBase(),this.renderPopover())}renderBase(){return n("div",{class:_},this.renderUserLocaleSection(),this.renderTranslatedLanguageSection())}renderPopover(){const t=this.getTip();return n("calcite-popover",{referenceElement:this.tipID,label:"","auto-close":"true",placement:"trailing",closable:!0},n("span",{class:f.uiLocationPopoverContent},n("span",{class:f.uiLocationItems},this.getUILocation()),t?n("span",{class:f.tip},t):null))}renderUserLocaleSection(){const t=this.getUIDataItem(),a=null==t?void 0:t.userLocaleData,s=null==a?void 0:a.value,e=this.setting.id;return n("div",{class:`${f.section}${(null==t?void 0:t.selected)?` ${f.selected}`:""}`},this.renderItemHeader(p.User,null==a?void 0:a.label,e),this.handleInputRender(p.User,s,e))}renderTranslatedLanguageSection(){var t,a;const s=this.getUIDataItem(),e=this.setting.id,i=c.get("currentLanguage"),r=c.get("portalItemResourceT9n"),o=null===(t=this.translatedLanguageLabels)||void 0===t?void 0:t[this.fieldName],l=null===(a=null==r?void 0:r[i])||void 0===a?void 0:a[e];return n("div",{class:`${f.section}${(null==s?void 0:s.selected)?` ${f.selected}`:""}`},this.renderItemHeader(p.Translation,o,e),this.handleInputRender(p.Translation,l,e))}handleInputRender(t,a,n){const s=this.getUIDataItem();return(null==s?void 0:s.expanded)?this.hasNestedContent?this.renderNestedInputs(t):this.renderInput(t,a,n):null}renderNestedInputs(t,a){const n=null!=a?a:this.setting,{content:s}=n;return null==s?void 0:s.map((a=>a.hasOwnProperty("content")?this.renderNestedInputs(t,a):this.renderNestedInput(t,a)))}renderNestedInput(t,a){var s;const e=c.get("currentLanguage"),i=c.get("portalItemResourceT9n"),r=null==a?void 0:a.id,o=null==i?void 0:i[e],l=null==o?void 0:o[r],{label:u,value:g,id:d}=a,h=t===p.Translation?null===(s=this.translatedLanguageLabels)||void 0===s?void 0:s[d]:u,m=t===p.User?g:l;return n("div",{class:f.nestedInput},this.renderItemHeader(t,h,r,a),this.renderInput(t,m,r,a))}renderItemHeader(t,a,s,e){const i=!this.hasNestedContent||!!e;return n("div",{class:f.topRow},this.renderItemHeaderLabel(t,a,e),i?this.renderCopyButton(t,s):null)}renderItemHeaderLabel(t,a,s){const e=t===p.User&&!s;return n("div",{class:f.labelContainer},s?null:this.renderExpandCollapseButton(),n("calcite-icon",{icon:this.getIcon(s),scale:"s"}),n("span",{class:f.label},a),e?this.renderInfoButton():null)}renderExpandCollapseButton(){const t=this.getUIDataItem(),a=(null==t?void 0:t.expanded)?u.Expanded:u.Collapsed;return n("calcite-action",{onClick:this.handleExpand.bind(this,t),icon:a,scale:"s",appearance:"transparent",text:""})}renderInfoButton(){return n("button",{id:this.tipID,class:f.infoButton},n("calcite-icon",{class:f.infoIcon,icon:u.Popover,scale:"s"}))}renderCopyButton(t,a){return n("calcite-action",{class:this.calciteMode,onClick:this.copySelection.bind(this,t,a),slot:"action",icon:u.Copy,appearance:"transparent",text:""})}renderInput(t,a,n,s){const e=null!=s?s:this.setting;return"string"===e.type||"textarea"===e.type?t===p.User?this.renderUserLocaleInput(a,n):this.renderTranslatedLanguageInput(a,n):this.renderTextEditor(a,t,n)}renderUserLocaleInput(t,a){return n("calcite-input",{ref:t=>this.userInputs[a]=t,key:a,id:a,class:l.Light,"data-field-name":this.fieldName,value:t,onFocus:this.handleSelection,onCalciteInputChange:this.handleUserInputChange.bind(this)})}renderTranslatedLanguageInput(t,a){return n("calcite-input",{ref:t=>this.translatedInputs[a]=t,key:a,id:a,class:l.Light,"data-field-name":this.fieldName,value:t,onFocus:this.handleSelection,onCalciteInputChange:this.handleTranslatedInputChange.bind(this)})}renderTextEditor(t,a,s){return n("instant-apps-ckeditor-wrapper",{id:s,ref:this.setEditor.bind(this,a),onDataChanged:this.handleTextEditorDataChange.bind(this,a),onIsFocused:this.handleSelection,value:null!=t?t:"","data-field-name":this.fieldName,config:{toolbar:[]}})}getUIDataItem(){if(g.uiData)return g.uiData.get(this.fieldName)}updateT9nStore(t,a){const n=c.get("currentLanguage"),s=d(n,{[t]:a});c.set("portalItemResourceT9n",s)}handleExpand(){const t=this.getUIDataItem();t.expanded=!t.expanded;const a=new Map(g.uiData);a.set(this.fieldName,t),c.set("uiData",a)}handleEditorCollapse(){var t,a;const n=c.get("uiData"),s=null==n?void 0:n.get(this.fieldName);if(!(null==s?void 0:s.expanded)&&(null===(t=this.userEditorWrapper)||void 0===t?void 0:t.editorInstance)&&(null===(a=this.translatedEditorWrapper)||void 0===a?void 0:a.editorInstance)){const{userEditorWrapper:t,translatedEditorWrapper:a}=this,n=t.editorInstance.getData();t.value=n;const s=a.editorInstance.getData();a.value=s,t.editorInstance.destroy(),a.editorInstance.destroy()}}handleSelection(t){const a=new Map(g.uiData),n=h();n.forEach((t=>{(null==a?void 0:a.get(t)).selected=!1})),n.forEach((n=>{const s=null==t?void 0:t.target;n===(null==s?void 0:s.getAttribute("data-field-name"))&&((null==a?void 0:a.get(n)).selected=!0)})),c.set("uiData",a)}getUILocation(){const t=this.getUIDataItem(),{uiLocation:a,userLocaleData:s}=t,{section:e,subsection:i}=a,r=[e.label,i.label,s.label].filter((t=>!!t));return r.map(((t,a)=>n("span",{class:f.uiLocationItem},n("span",null,t),a!==r.length-1?n("calcite-icon",{icon:"chevron-right",scale:"s"}):null)))}getTip(){const t=this.getUIDataItem(),{tip:a}=t;return a}copySelection(t,a){this.setting.type===r.TextEditor?this.copyTextEditorContent(t):this.copyCalciteInputContent(a,t)}copyTextEditorContent(t){var a,n;const s=t===p.User?null===(a=this.userEditorWrapper)||void 0===a?void 0:a.editorInstance:null===(n=this.translatedEditorWrapper)||void 0===n?void 0:n.editorInstance;setTimeout((()=>{this.selectContent(s),setTimeout((()=>this.selectContent(s)),50)}),50),this.copyContent(s)}selectContent(t){t.editing.view.focus();const{model:a}=t,n=a.createRangeIn(a.document.getRoot());a.change((t=>t.setSelection(n)))}copyContent(t){const a=t.getData(),n=document.createElement("div");n.contentEditable="true",n.innerHTML=a,document.body.appendChild(n);const s=document.createRange();s.selectNodeContents(n);const e=window.getSelection();null==e||e.removeAllRanges(),null==e||e.addRange(s),document.execCommand("copy"),document.body.removeChild(n)}copyCalciteInputContent(t,a){const n=a===p.User?this.userInputs[t]:this.translatedInputs[t];n&&(n.selectText(),navigator.clipboard.writeText(n.value))}setEditor(t,a){t===p.User?this.userEditorWrapper=a:this.translatedEditorWrapper=a}async handleUserInputChange(t){c.set("saving",!0);try{const a=t.target,n=a.id,s=a.value;this.getUIDataItem().userLocaleData.value=s,await this.userLocaleInputOnChangeCallback(n,s),c.set("saving",!1)}catch(t){c.set("saving",!1)}}async handleUserTextEditorChange(t){c.set("saving",!0);try{const a=t.detail,n=t.target.id;this.getUIDataItem().userLocaleData.value=a,await this.userLocaleInputOnChangeCallback(n,a),c.set("saving",!1)}catch(t){c.set("saving",!1)}}async handleTranslatedInputChange(t){c.set("saving",!0);try{const a=t.composedPath()[0],n=a.id;this.updateT9nStore(n,a.value);const{locale:s,resource:e}=this.getTranslatedLocaleCallbackData(),i=t.target.value;await this.translatedLocaleInputOnChangeCallback(n,i,s,e),setTimeout((()=>c.set("saving",!1)),1500),this.translatorItemDataUpdated.emit()}catch(t){console.error("Error writing to portal item resource: ",t),c.set("saving",!1)}}async handleTranslatedTextEditorChange(t){c.set("saving",!0);try{const a=t.target.id;this.updateT9nStore(a,t.detail);const{locale:n,resource:s}=this.getTranslatedLocaleCallbackData(),e=t.detail;await this.translatedLocaleInputOnChangeCallback(a,e,n,s),setTimeout((()=>c.set("saving",!1)),1500),this.translatorItemDataUpdated.emit()}catch(t){console.error("Error writing to portal item resource: ",t),c.set("saving",!1)}}handleTextEditorDataChange(t,a){t===p.User?this.handleUserTextEditorChange(a):this.handleTranslatedTextEditorChange(a)}getTranslatedLocaleCallbackData(){return{locale:c.get("currentLanguage"),resource:c.get("portalItemResource")}}getIcon(t){switch((null!=t?t:this.setting).stringType){case"title":return u.Title;case"subtitle":return u.Subtitle;case"text":return u.Text;case"button":return u.Button;case"string":return u.String;default:return u.SettingIndicator}}};b.style=".sc-instant-apps-language-translator-item-h{display:block}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item.sc-instant-apps-language-translator-item{display:flex}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item{padding:10px;border-bottom:1px solid var(--calcite-color-border-1);background-color:var(--calcite-color-foreground-2);width:49%}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__top-row.sc-instant-apps-language-translator-item{display:flex;align-items:center;justify-content:space-between}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__label-container.sc-instant-apps-language-translator-item{display:flex;align-items:center}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__label.sc-instant-apps-language-translator-item{display:inline-block;margin-left:10px;font-size:14px;font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item calcite-input.sc-instant-apps-language-translator-item{margin-top:10px;margin-left:55px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--last-item.sc-instant-apps-language-translator-item{border-bottom:none}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item{background-color:#f1faff}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item:first-child{margin-right:1%}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-popover-content.sc-instant-apps-language-translator-item{display:inline-block;padding:10px;max-width:400px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-items.sc-instant-apps-language-translator-item{display:flex}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-item.sc-instant-apps-language-translator-item{display:flex;align-items:center;font-weight:var(--calcite-font-weight-medium);font-size:14px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__tip.sc-instant-apps-language-translator-item{display:inline-block;font-size:14px;line-height:22px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__info-icon.sc-instant-apps-language-translator-item{color:var(--calcite-color-brand)}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__info-button.sc-instant-apps-language-translator-item{border:0;background-color:transparent;cursor:pointer}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__nested-input.sc-instant-apps-language-translator-item{margin-left:60px;margin-top:8px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__nested-input.sc-instant-apps-language-translator-item calcite-input.sc-instant-apps-language-translator-item{margin-left:30px}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item{background-color:#f1faff;background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item calcite-action.sc-instant-apps-language-translator-item{--calcite-ui-icon-color:var(--calcite-color-text-inverse)}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item calcite-icon.sc-instant-apps-language-translator-item{color:var(--calcite-color-text-inverse)}.instant-apps-language-translator--last-item.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item{border-bottom:none}";const x="instant-apps-language-translator-search",k={base:x,input:`${x}__input`,suggestionList:`${x}__suggestion-list`,suggestionListItem:`${x}__suggestion-list-item`},y=class{constructor(n){t(this,n),this.suggestionSelected=a(this,"suggestionSelected",7),this.t9nPlaceholder=void 0,this.results=[]}render(){return n(s,{key:"80febf289e2bbfcf09636c84b5a5a83e80f377c0"},this.renderSearchInput(),this.renderSuggestions())}renderSearchInput(){return n("calcite-input",{ref:t=>this.searchInput=t,class:k.input,onCalciteInputInput:this.handleSearch.bind(this),type:"search",placeholder:this.t9nPlaceholder,icon:"search"})}renderSuggestions(){return this.results.length>0?this.renderSuggestionList():null}renderSuggestionList(){return n("ul",{class:k.suggestionList},this.results.map((t=>this.renderSuggestionListItem(t))))}renderSuggestionListItem(t){return n("li",{onClick:this.selectSuggestion.bind(this),class:k.suggestionListItem,"data-field-name":t.fieldName},t.userLocaleData.label)}handleSearch(t){var a,n;const s=null===(n=null===(a=t.target.value)||void 0===a?void 0:a.toLowerCase())||void 0===n?void 0:n.trim(),e=c.get("uiData"),i=h(),r=c.get("portalItemResourceT9n"),o=c.get("currentLanguage"),l=r[o],p=this.getSettingDataItems(i).filter(this.matchedResultsCallback(e,l,s,o));this.results=[...p.map((t=>Object.assign({fieldName:t},e.get(t))))]}matchedResultsCallback(t,a,n,s){return e=>{var i;const r=t.get(e),{label:o}=r.userLocaleData,{value:l}=r.userLocaleData,c=t.get("translatedLanguageLabels"),p=null===(i=null==c?void 0:c[s])||void 0===i?void 0:i[e],u=null==a?void 0:a[e],g=this.testUserInput(o,n),d=this.testUserInput(l,n),h=this.testUserInput(p,n),m=this.testUserInput(u,n);return g||d||h||m}}getSettingDataItems(t){return t.filter((t=>"locales"!==t&&"translatedLanguageLabels"!==t))}testUserInput(t,a){var n;return!!(null==t?void 0:t.trim())&&!!(null==a?void 0:a.trim())&&-1!==(null===(n=null==t?void 0:t.toLowerCase())||void 0===n?void 0:n.search(a))}selectSuggestion(t){const a=t.target.getAttribute("data-field-name");this.suggestionSelected.emit(a),this.resetSearchInput()}resetSearchInput(){this.searchInput.value="",this.results=[]}};y.style=".sc-instant-apps-language-translator-search-h{display:block;position:relative}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__input.sc-instant-apps-language-translator-search{width:235.5px}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list.sc-instant-apps-language-translator-search{position:absolute;margin:0;padding:0;width:100%;max-height:30vh;overflow:auto;border-left:none;background-color:var(--calcite-color-foreground-1);border:1px solid #c0c0c0;z-index:702}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search:first-child{border:none}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search{margin-top:0;padding:0.8em 1em;border-top:solid 1px rgba(110, 110, 110, 0.3);display:flex;flex-direction:column;cursor:pointer;word-break:break-word}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search:hover{background-color:var(--calcite-color-foreground-2)}";export{v as instant_apps_ckeditor_wrapper,b as instant_apps_language_translator_item,y as instant_apps_language_translator_search}
6
+ import{r as t,c as a,h as n,H as s,g as e,F as i}from"./p-4e6eb06e.js";import{d as r,e as o,f as l,s as c,h as p,E as u,l as g,j as d,c as h}from"./p-b49e1a78.js";import"./p-5104cc98.js";import"./p-d001e961.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";import"./p-dc9d4be3.js";const m="instant-apps-components__ckeditor-wrapper",v=class{constructor(n){t(this,n),this.isFocused=a(this,"isFocused",7),this.dataChanged=a(this,"dataChanged",7),this.value=void 0,this.editorInstance=void 0,this.config=void 0}updateValue(){this.value&&this.editorInstance.setData(this.value)}async componentDidLoad(){this.init()}componentDidUpdate(){this.editorInstance.setData(this.value)}render(){return n(s,{key:"26f62d5413e21916b77253476cf48f69682861d5"},n("div",{key:"45a9d7b859a21e49c81afdaa3bdd5074f1428cd5"}))}init(){this.applyStyles(),this.initEditor()}applyStyles(){if(document.getElementById(m))return;const t=document.createElement("style");t.id=m,t.innerHTML="\n .ck.ck-reset.ck-editor.ck-rounded-corners {\n margin-top: 10px !important;\n margin-left: 55px !important;\n }\n .ck-editor__editable {\n height: 70px !important;\n font-size: 0.875rem !important;\n line-height: \t1.375 !important;\n color: var(--calcite-color-text-1) !important;\n }\n\n .ck.ck-editor__editable_inline>:first-child,\n .ck.ck-editor__editable_inline>:last-child {\n --ck-spacing-large: 0.5rem !important;\n }\n\n .ck.ck-balloon-panel.ck-powered-by-balloon {\n --ck-z-modal: 700;\n z-index: 700;\n }\n\n .calcite-mode-dark .ck-editor__editable {\n color: var(--calcite-color-text-inverse) !important;\n }\n",document.head.prepend(t)}async initEditor(){const t=await this.createEditor();t&&(this.editorInstance=t,(this.value||""===this.value)&&t.setData(this.value),t.editing.view.document.on("change:isFocused",this.getEditorFocusedCallback(t)))}async createEditor(){try{let t;return t=this.config?await ClassicEditor.create(this.el,this.config):await ClassicEditor.create(this.el),this.editorInstance=t,Promise.resolve(t)}catch(t){return console.error(t),Promise.reject(null)}}getEditorFocusedCallback(t){return(a,n,s)=>{if(s)this.isFocused.emit();else{const a=t.getData();this.value!==a&&(this.value=a,this.dataChanged.emit(a))}}}get el(){return e(this)}static get watchers(){return{value:["updateValue"]}}};v.style=":host{display:block}";const _="instant-apps-language-translator-item",f={section:`${_}__section`,selected:`${_}__section--selected`,collapsed:`${_}__section--collapsed`,topRow:`${_}__top-row`,labelContainer:`${_}__label-container`,label:`${_}__label`,uiLocationPopoverContent:`${_}__ui-location-popover-content`,uiLocationItems:`${_}__ui-location-items`,uiLocationItem:`${_}__ui-location-item`,infoIcon:`${_}__info-icon`,infoButton:`${_}__info-button`,tip:`${_}__tip`,nestedInput:`${_}__nested-input`},b=class{constructor(n){t(this,n),this.translatorItemDataUpdated=a(this,"translatorItemDataUpdated",7),this.userInputs={},this.translatedInputs={},this.fieldName=void 0,this.translatedLanguageLabels=void 0,this.setting=void 0,this.userLocaleInputOnChangeCallback=void 0,this.translatedLocaleInputOnChangeCallback=void 0}get isTextEditor(){return this.setting.type===r.TextEditor}get calciteMode(){return o()?l.Dark:l.Light}get hasNestedContent(){var t;return!!(null===(t=this.setting)||void 0===t?void 0:t.content)}get tipID(){return`${this.fieldName}goTo`}componentDidLoad(){this.isTextEditor&&c.onChange("uiData",(()=>this.handleEditorCollapse()))}render(){var t;return"content"in this.setting&&(null===(t=this.setting.content)||void 0===t?void 0:t.every((t=>{var a;return 0===(null===(a=null==t?void 0:t.content)||void 0===a?void 0:a.length)})))?n(i,null):n(s,{class:this.calciteMode},this.renderBase(),this.renderPopover())}renderBase(){return n("div",{class:_},this.renderUserLocaleSection(),this.renderTranslatedLanguageSection())}renderPopover(){const t=this.getTip();return n("calcite-popover",{referenceElement:this.tipID,label:"","auto-close":"true",placement:"trailing",closable:!0},n("span",{class:f.uiLocationPopoverContent},n("span",{class:f.uiLocationItems},this.getUILocation()),t?n("span",{class:f.tip},t):null))}renderUserLocaleSection(){const t=this.getUIDataItem(),a=null==t?void 0:t.userLocaleData,s=null==a?void 0:a.value,e=this.setting.id;return n("div",{class:`${f.section}${(null==t?void 0:t.selected)?` ${f.selected}`:""}`},this.renderItemHeader(p.User,null==a?void 0:a.label,e),this.handleInputRender(p.User,s,e))}renderTranslatedLanguageSection(){var t,a;const s=this.getUIDataItem(),e=this.setting.id,i=c.get("currentLanguage"),r=c.get("portalItemResourceT9n"),o=null===(t=this.translatedLanguageLabels)||void 0===t?void 0:t[this.fieldName],l=null===(a=null==r?void 0:r[i])||void 0===a?void 0:a[e];return n("div",{class:`${f.section}${(null==s?void 0:s.selected)?` ${f.selected}`:""}`},this.renderItemHeader(p.Translation,o,e),this.handleInputRender(p.Translation,l,e))}handleInputRender(t,a,n){const s=this.getUIDataItem();return(null==s?void 0:s.expanded)?this.hasNestedContent?this.renderNestedInputs(t):this.renderInput(t,a,n):null}renderNestedInputs(t,a){const n=null!=a?a:this.setting,{content:s}=n;return null==s?void 0:s.map((a=>a.hasOwnProperty("content")?this.renderNestedInputs(t,a):this.renderNestedInput(t,a)))}renderNestedInput(t,a){var s;const e=c.get("currentLanguage"),i=c.get("portalItemResourceT9n"),r=null==a?void 0:a.id,o=null==i?void 0:i[e],l=null==o?void 0:o[r],{label:u,value:g,id:d}=a,h=t===p.Translation?null===(s=this.translatedLanguageLabels)||void 0===s?void 0:s[d]:u,m=t===p.User?g:l;return n("div",{class:f.nestedInput},this.renderItemHeader(t,h,r,a),this.renderInput(t,m,r,a))}renderItemHeader(t,a,s,e){const i=!this.hasNestedContent||!!e;return n("div",{class:f.topRow},this.renderItemHeaderLabel(t,a,e),i?this.renderCopyButton(t,s):null)}renderItemHeaderLabel(t,a,s){const e=t===p.User&&!s;return n("div",{class:f.labelContainer},s?null:this.renderExpandCollapseButton(),n("calcite-icon",{icon:this.getIcon(s),scale:"s"}),n("span",{class:f.label},a),e?this.renderInfoButton():null)}renderExpandCollapseButton(){const t=this.getUIDataItem(),a=(null==t?void 0:t.expanded)?u.Expanded:u.Collapsed;return n("calcite-action",{onClick:this.handleExpand.bind(this,t),icon:a,scale:"s",appearance:"transparent",text:""})}renderInfoButton(){return n("button",{id:this.tipID,class:f.infoButton},n("calcite-icon",{class:f.infoIcon,icon:u.Popover,scale:"s"}))}renderCopyButton(t,a){return n("calcite-action",{class:this.calciteMode,onClick:this.copySelection.bind(this,t,a),slot:"action",icon:u.Copy,appearance:"transparent",text:""})}renderInput(t,a,n,s){const e=null!=s?s:this.setting;return"string"===e.type||"textarea"===e.type?t===p.User?this.renderUserLocaleInput(a,n):this.renderTranslatedLanguageInput(a,n):this.renderTextEditor(a,t,n)}renderUserLocaleInput(t,a){return n("calcite-input",{ref:t=>this.userInputs[a]=t,key:a,id:a,class:l.Light,"data-field-name":this.fieldName,value:t,onFocus:this.handleSelection,onCalciteInputChange:this.handleUserInputChange.bind(this)})}renderTranslatedLanguageInput(t,a){return n("calcite-input",{ref:t=>this.translatedInputs[a]=t,key:a,id:a,class:l.Light,"data-field-name":this.fieldName,value:t,onFocus:this.handleSelection,onCalciteInputChange:this.handleTranslatedInputChange.bind(this)})}renderTextEditor(t,a,s){return n("instant-apps-ckeditor-wrapper",{id:s,ref:this.setEditor.bind(this,a),onDataChanged:this.handleTextEditorDataChange.bind(this,a),onIsFocused:this.handleSelection,value:null!=t?t:"","data-field-name":this.fieldName,config:{toolbar:[]}})}getUIDataItem(){if(g.uiData)return g.uiData.get(this.fieldName)}updateT9nStore(t,a){const n=c.get("currentLanguage"),s=d(n,{[t]:a});c.set("portalItemResourceT9n",s)}handleExpand(){const t=this.getUIDataItem();t.expanded=!t.expanded;const a=new Map(g.uiData);a.set(this.fieldName,t),c.set("uiData",a)}handleEditorCollapse(){var t,a;const n=c.get("uiData"),s=null==n?void 0:n.get(this.fieldName);if(!(null==s?void 0:s.expanded)&&(null===(t=this.userEditorWrapper)||void 0===t?void 0:t.editorInstance)&&(null===(a=this.translatedEditorWrapper)||void 0===a?void 0:a.editorInstance)){const{userEditorWrapper:t,translatedEditorWrapper:a}=this,n=t.editorInstance.getData();t.value=n;const s=a.editorInstance.getData();a.value=s,t.editorInstance.destroy(),a.editorInstance.destroy()}}handleSelection(t){const a=new Map(g.uiData),n=h();n.forEach((t=>{(null==a?void 0:a.get(t)).selected=!1})),n.forEach((n=>{const s=null==t?void 0:t.target;n===(null==s?void 0:s.getAttribute("data-field-name"))&&((null==a?void 0:a.get(n)).selected=!0)})),c.set("uiData",a)}getUILocation(){const t=this.getUIDataItem(),{uiLocation:a,userLocaleData:s}=t,{section:e,subsection:i}=a,r=[e.label,i.label,s.label].filter((t=>!!t));return r.map(((t,a)=>n("span",{class:f.uiLocationItem},n("span",null,t),a!==r.length-1?n("calcite-icon",{icon:"chevron-right",scale:"s"}):null)))}getTip(){const t=this.getUIDataItem(),{tip:a}=t;return a}copySelection(t,a){this.setting.type===r.TextEditor?this.copyTextEditorContent(t):this.copyCalciteInputContent(a,t)}copyTextEditorContent(t){var a,n;const s=t===p.User?null===(a=this.userEditorWrapper)||void 0===a?void 0:a.editorInstance:null===(n=this.translatedEditorWrapper)||void 0===n?void 0:n.editorInstance;setTimeout((()=>{this.selectContent(s),setTimeout((()=>this.selectContent(s)),50)}),50),this.copyContent(s)}selectContent(t){t.editing.view.focus();const{model:a}=t,n=a.createRangeIn(a.document.getRoot());a.change((t=>t.setSelection(n)))}copyContent(t){const a=t.getData(),n=document.createElement("div");n.contentEditable="true",n.innerHTML=a,document.body.appendChild(n);const s=document.createRange();s.selectNodeContents(n);const e=window.getSelection();null==e||e.removeAllRanges(),null==e||e.addRange(s),document.execCommand("copy"),document.body.removeChild(n)}copyCalciteInputContent(t,a){const n=a===p.User?this.userInputs[t]:this.translatedInputs[t];n&&(n.selectText(),navigator.clipboard.writeText(n.value))}setEditor(t,a){t===p.User?this.userEditorWrapper=a:this.translatedEditorWrapper=a}async handleUserInputChange(t){c.set("saving",!0);try{const a=t.target,n=a.id,s=a.value;this.getUIDataItem().userLocaleData.value=s,await this.userLocaleInputOnChangeCallback(n,s),c.set("saving",!1)}catch(t){c.set("saving",!1)}}async handleUserTextEditorChange(t){c.set("saving",!0);try{const a=t.detail,n=t.target.id;this.getUIDataItem().userLocaleData.value=a,await this.userLocaleInputOnChangeCallback(n,a),c.set("saving",!1)}catch(t){c.set("saving",!1)}}async handleTranslatedInputChange(t){c.set("saving",!0);try{const a=t.composedPath()[0],n=a.id;this.updateT9nStore(n,a.value);const{locale:s,resource:e}=this.getTranslatedLocaleCallbackData(),i=t.target.value;await this.translatedLocaleInputOnChangeCallback(n,i,s,e),setTimeout((()=>c.set("saving",!1)),1500),this.translatorItemDataUpdated.emit()}catch(t){console.error("Error writing to portal item resource: ",t),c.set("saving",!1)}}async handleTranslatedTextEditorChange(t){c.set("saving",!0);try{const a=t.target.id;this.updateT9nStore(a,t.detail);const{locale:n,resource:s}=this.getTranslatedLocaleCallbackData(),e=t.detail;await this.translatedLocaleInputOnChangeCallback(a,e,n,s),setTimeout((()=>c.set("saving",!1)),1500),this.translatorItemDataUpdated.emit()}catch(t){console.error("Error writing to portal item resource: ",t),c.set("saving",!1)}}handleTextEditorDataChange(t,a){t===p.User?this.handleUserTextEditorChange(a):this.handleTranslatedTextEditorChange(a)}getTranslatedLocaleCallbackData(){return{locale:c.get("currentLanguage"),resource:c.get("portalItemResource")}}getIcon(t){switch((null!=t?t:this.setting).stringType){case"title":return u.Title;case"subtitle":return u.Subtitle;case"text":return u.Text;case"button":return u.Button;case"string":return u.String;default:return u.SettingIndicator}}};b.style=".sc-instant-apps-language-translator-item-h{display:block}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item.sc-instant-apps-language-translator-item{display:flex}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item{padding:10px;border-bottom:1px solid var(--calcite-color-border-1);background-color:var(--calcite-color-foreground-2);width:49%}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__top-row.sc-instant-apps-language-translator-item{display:flex;align-items:center;justify-content:space-between}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__label-container.sc-instant-apps-language-translator-item{display:flex;align-items:center}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item .instant-apps-language-translator-item__label.sc-instant-apps-language-translator-item{display:inline-block;margin-left:10px;font-size:14px;font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item calcite-input.sc-instant-apps-language-translator-item{margin-top:10px;margin-left:55px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--last-item.sc-instant-apps-language-translator-item{border-bottom:none}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item{background-color:#f1faff}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item:first-child{margin-right:1%}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-popover-content.sc-instant-apps-language-translator-item{display:inline-block;padding:10px;max-width:400px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-items.sc-instant-apps-language-translator-item{display:flex}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__ui-location-item.sc-instant-apps-language-translator-item{display:flex;align-items:center;font-weight:var(--calcite-font-weight-medium);font-size:14px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__tip.sc-instant-apps-language-translator-item{display:inline-block;font-size:14px;line-height:22px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__info-icon.sc-instant-apps-language-translator-item{color:var(--calcite-color-brand)}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__info-button.sc-instant-apps-language-translator-item{border:0;background-color:transparent;cursor:pointer}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__nested-input.sc-instant-apps-language-translator-item{margin-left:60px;margin-top:8px}.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__nested-input.sc-instant-apps-language-translator-item calcite-input.sc-instant-apps-language-translator-item{margin-left:30px}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item{background-color:#f1faff;background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item calcite-action.sc-instant-apps-language-translator-item{--calcite-ui-icon-color:var(--calcite-color-text-inverse)}.calcite-mode-dark.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section--selected.sc-instant-apps-language-translator-item calcite-icon.sc-instant-apps-language-translator-item{color:var(--calcite-color-text-inverse)}.instant-apps-language-translator--last-item.sc-instant-apps-language-translator-item-h .instant-apps-language-translator-item__section.sc-instant-apps-language-translator-item{border-bottom:none}";const x="instant-apps-language-translator-search",k={base:x,input:`${x}__input`,suggestionList:`${x}__suggestion-list`,suggestionListItem:`${x}__suggestion-list-item`},y=class{constructor(n){t(this,n),this.suggestionSelected=a(this,"suggestionSelected",7),this.t9nPlaceholder=void 0,this.results=[]}render(){return n(s,{key:"80febf289e2bbfcf09636c84b5a5a83e80f377c0"},this.renderSearchInput(),this.renderSuggestions())}renderSearchInput(){return n("calcite-input",{ref:t=>this.searchInput=t,class:k.input,onCalciteInputInput:this.handleSearch.bind(this),type:"search",placeholder:this.t9nPlaceholder,icon:"search"})}renderSuggestions(){return this.results.length>0?this.renderSuggestionList():null}renderSuggestionList(){return n("ul",{class:k.suggestionList},this.results.map((t=>this.renderSuggestionListItem(t))))}renderSuggestionListItem(t){return n("li",{onClick:this.selectSuggestion.bind(this),class:k.suggestionListItem,"data-field-name":t.fieldName},t.userLocaleData.label)}handleSearch(t){var a,n;const s=null===(n=null===(a=t.target.value)||void 0===a?void 0:a.toLowerCase())||void 0===n?void 0:n.trim(),e=c.get("uiData"),i=h(),r=c.get("portalItemResourceT9n"),o=c.get("currentLanguage"),l=r[o],p=this.getSettingDataItems(i).filter(this.matchedResultsCallback(e,l,s,o));this.results=[...p.map((t=>Object.assign({fieldName:t},e.get(t))))]}matchedResultsCallback(t,a,n,s){return e=>{var i;const r=t.get(e),{label:o}=r.userLocaleData,{value:l}=r.userLocaleData,c=t.get("translatedLanguageLabels"),p=null===(i=null==c?void 0:c[s])||void 0===i?void 0:i[e],u=null==a?void 0:a[e],g=this.testUserInput(o,n),d=this.testUserInput(l,n),h=this.testUserInput(p,n),m=this.testUserInput(u,n);return g||d||h||m}}getSettingDataItems(t){return t.filter((t=>"locales"!==t&&"translatedLanguageLabels"!==t))}testUserInput(t,a){var n;return!!(null==t?void 0:t.trim())&&!!(null==a?void 0:a.trim())&&-1!==(null===(n=null==t?void 0:t.toLowerCase())||void 0===n?void 0:n.search(a))}selectSuggestion(t){const a=t.target.getAttribute("data-field-name");this.suggestionSelected.emit(a),this.resetSearchInput()}resetSearchInput(){this.searchInput.value="",this.results=[]}};y.style=".sc-instant-apps-language-translator-search-h{display:block;position:relative}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__input.sc-instant-apps-language-translator-search{width:235.5px}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list.sc-instant-apps-language-translator-search{position:absolute;margin:0;padding:0;width:100%;max-height:30vh;overflow:auto;border-left:none;background-color:var(--calcite-color-foreground-1);border:1px solid #c0c0c0;z-index:702}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search:first-child{border:none}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search{margin-top:0;padding:0.8em 1em;border-top:solid 1px rgba(110, 110, 110, 0.3);display:flex;flex-direction:column;cursor:pointer;word-break:break-word}.sc-instant-apps-language-translator-search-h .instant-apps-language-translator-search__suggestion-list-item.sc-instant-apps-language-translator-search:hover{background-color:var(--calcite-color-foreground-2)}";export{v as instant_apps_ckeditor_wrapper,b as instant_apps_language_translator_item,y as instant_apps_language_translator_search}