UNPKG

@revealbi/ui

Version:

253 lines (227 loc) 44.3 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=class te{static set serverUrl(e){this._serverUrl=e,$.ig.RevealSdkSettings.setBaseUrl(this._serverUrl)}static get serverUrl(){return this._serverUrl}};te._serverUrl="";let G=te;/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const T=globalThis,J=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Q=Symbol(),ie=new WeakMap;let pe=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Q)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(J&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=ie.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&ie.set(t,e))}return e}toString(){return this.cssText}};const be=i=>new pe(typeof i=="string"?i:i+"",void 0,Q),F=(i,...e)=>{const t=i.length===1?i[0]:e.reduce((r,s,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[o+1],i[0]);return new pe(t,i,Q)},Ve=(i,e)=>{if(J)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),s=T.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=t.cssText,i.appendChild(r)}},re=J?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return be(t)})(i):i;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const{is:Ae,defineProperty:Re,getOwnPropertyDescriptor:Oe,getOwnPropertyNames:xe,getOwnPropertySymbols:De,getPrototypeOf:Ee}=Object,m=globalThis,se=m.trustedTypes,Ce=se?se.emptyScript:"",N=m.reactiveElementPolyfillSupport,x=(i,e)=>i,M={toAttribute(i,e){switch(e){case Boolean:i=i?Ce:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},K=(i,e)=>!Ae(i,e),oe={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:K};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);class A extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=oe){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(e,r,t);s!==void 0&&Re(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:o}=Oe(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get(){return s==null?void 0:s.call(this)},set(a){const l=s==null?void 0:s.call(this);o.call(this,a),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??oe}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const e=Ee(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const t=this.properties,r=[...xe(t),...De(t)];for(const s of r)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,s]of t)this.elementProperties.set(r,s)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const s=this._$Eu(t,r);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const s of r)t.unshift(re(s))}else e!==void 0&&t.push(re(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ve(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){var o;const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(s!==void 0&&r.reflect===!0){const a=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:M).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(s):this.setAttribute(s,a),this._$Em=null}}_$AK(e,t){var o;const r=this.constructor,s=r._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=r.getPropertyOptions(s),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((o=a.converter)==null?void 0:o.fromAttribute)!==void 0?a.converter:M;this._$Em=s,this[s]=l.fromAttribute(t,a.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??K)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,a]of s)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],a)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(t)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[x("elementProperties")]=new Map,A[x("finalized")]=new Map,N==null||N({ReactiveElement:A}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const D=globalThis,U=D.trustedTypes,ae=U?U.createPolicy("lit-html",{createHTML:i=>i}):void 0,ge="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,ve="?"+f,Ie=`<${ve}>`,b=document,E=()=>b.createComment(""),C=i=>i===null||typeof i!="object"&&typeof i!="function",_e=Array.isArray,Pe=i=>_e(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",B=`[ \f\r]`,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ne=/-->/g,le=/>/g,w=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),he=/'/g,de=/"/g,fe=/^(?:script|style|textarea|title)$/i,ze=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Y=ze(1),V=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),ce=new WeakMap,S=b.createTreeWalker(b,129);function me(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ae!==void 0?ae.createHTML(e):e}const Te=(i,e)=>{const t=i.length-1,r=[];let s,o=e===2?"<svg>":"",a=O;for(let l=0;l<t;l++){const n=i[l];let c,g,h=-1,v=0;for(;v<n.length&&(a.lastIndex=v,g=a.exec(n),g!==null);)v=a.lastIndex,a===O?g[1]==="!--"?a=ne:g[1]!==void 0?a=le:g[2]!==void 0?(fe.test(g[2])&&(s=RegExp("</"+g[2],"g")),a=w):g[3]!==void 0&&(a=w):a===w?g[0]===">"?(a=s??O,h=-1):g[1]===void 0?h=-2:(h=a.lastIndex-g[2].length,c=g[1],a=g[3]===void 0?w:g[3]==='"'?de:he):a===de||a===he?a=w:a===ne||a===le?a=O:(a=w,s=void 0);const _=a===w&&i[l+1].startsWith("/>")?" ":"";o+=a===O?n+Ie:h>=0?(r.push(c),n.slice(0,h)+ge+n.slice(h)+f+_):n+f+(h===-2?l:_)}return[me(i,o+(i[t]||"<?>")+(e===2?"</svg>":"")),r]};class I{constructor({strings:e,_$litType$:t},r){let s;this.parts=[];let o=0,a=0;const l=e.length-1,n=this.parts,[c,g]=Te(e,t);if(this.el=I.createElement(c,r),S.currentNode=this.el.content,t===2){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=S.nextNode())!==null&&n.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(ge)){const v=g[a++],_=s.getAttribute(h).split(f),z=/([.?@])?(.*)/.exec(v);n.push({type:1,index:o,name:z[2],strings:_,ctor:z[1]==="."?Ue:z[1]==="?"?Fe:z[1]==="@"?He:H}),s.removeAttribute(h)}else h.startsWith(f)&&(n.push({type:6,index:o}),s.removeAttribute(h));if(fe.test(s.tagName)){const h=s.textContent.split(f),v=h.length-1;if(v>0){s.textContent=U?U.emptyScript:"";for(let _=0;_<v;_++)s.append(h[_],E()),S.nextNode(),n.push({type:2,index:++o});s.append(h[v],E())}}}else if(s.nodeType===8)if(s.data===ve)n.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(f,h+1))!==-1;)n.push({type:7,index:o}),h+=f.length-1}o++}}static createElement(e,t){const r=b.createElement("template");return r.innerHTML=e,r}}function R(i,e,t=i,r){var a,l;if(e===V)return e;let s=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl;const o=C(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((l=s==null?void 0:s._$AO)==null||l.call(s,!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=s:t._$Cl=s),s!==void 0&&(e=R(i,s._$AS(i,e.values),s,r)),e}class Me{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,s=((e==null?void 0:e.creationScope)??b).importNode(t,!0);S.currentNode=s;let o=S.nextNode(),a=0,l=0,n=r[0];for(;n!==void 0;){if(a===n.index){let c;n.type===2?c=new P(o,o.nextSibling,this,e):n.type===1?c=new n.ctor(o,n.name,n.strings,this,e):n.type===6&&(c=new ke(o,this,e)),this._$AV.push(c),n=r[++l]}a!==(n==null?void 0:n.index)&&(o=S.nextNode(),a++)}return S.currentNode=b,s}p(e){let t=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class P{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,s){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=R(this,e,t),C(e)?e===p||e==null||e===""?(this._$AH!==p&&this._$AR(),this._$AH=p):e!==this._$AH&&e!==V&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Pe(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==p&&C(this._$AH)?this._$AA.nextSibling.data=e:this.T(b.createTextNode(e)),this._$AH=e}$(e){var o;const{values:t,_$litType$:r}=e,s=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=I.createElement(me(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(t);else{const a=new Me(s,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=ce.get(e.strings);return t===void 0&&ce.set(e.strings,t=new I(e)),t}k(e){_e(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,s=0;for(const o of e)s===t.length?t.push(r=new P(this.S(E()),this.S(E()),this,this.options)):r=t[s],r._$AI(o),s++;s<t.length&&(this._$AR(r&&r._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e&&e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,s,o){this.type=1,this._$AH=p,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=p}_$AI(e,t=this,r,s){const o=this.strings;let a=!1;if(o===void 0)e=R(this,e,t,0),a=!C(e)||e!==this._$AH&&e!==V,a&&(this._$AH=e);else{const l=e;let n,c;for(e=o[0],n=0;n<o.length-1;n++)c=R(this,l[r+n],t,n),c===V&&(c=this._$AH[n]),a||(a=!C(c)||c!==this._$AH[n]),c===p?e=p:e!==p&&(e+=(c??"")+o[n+1]),this._$AH[n]=c}a&&!s&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Ue extends H{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}}class Fe extends H{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==p)}}class He extends H{constructor(e,t,r,s,o){super(e,t,r,s,o),this.type=5}_$AI(e,t=this){if((e=R(this,e,t,0)??p)===V)return;const r=this._$AH,s=e===p&&r!==p||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==p&&(r===p||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class ke{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){R(this,e)}}const j=D.litHtmlPolyfillSupport;j==null||j(I,P),(D.litHtmlVersions??(D.litHtmlVersions=[])).push("3.1.4");const Le=(i,e,t)=>{const r=(t==null?void 0:t.renderBefore)??e;let s=r._$litPart$;if(s===void 0){const o=(t==null?void 0:t.renderBefore)??null;r._$litPart$=s=new P(e.insertBefore(E(),o),o,void 0,t??{})}return s._$AI(i),s};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class y extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Le(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return V}}var ue;y._$litElement$=!0,y.finalized=!0,(ue=globalThis.litElementHydrateSupport)==null||ue.call(globalThis,{LitElement:y});const q=globalThis.litElementPolyfillSupport;q==null||q({LitElement:y});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.6");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Z=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Ne={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:K},Be=(i=Ne,e,t)=>{const{kind:r,metadata:s}=t;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(t.name,i),r==="accessor"){const{name:a}=t;return{set(l){const n=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,n,i)},init(l){return l!==void 0&&this.P(a,void 0,i),l}}}if(r==="setter"){const{name:a}=t;return function(l){const n=this[a];e.call(this,l),this.requestUpdate(a,n,i)}}throw Error("Unsupported decorator location: "+r)};function d(i){return(e,t)=>typeof t=="object"?Be(i,e,t):((r,s,o)=>{const a=s.hasOwnProperty(o);return s.constructor.createProperty(o,a?{...r,wrapped:!0}:r),a?Object.getOwnPropertyDescriptor(s,o):void 0})(i,e,t)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const je={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},qe=i=>(...e)=>({_$litDirective$:i,values:e});class Ge{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const We=qe(class extends Ge{constructor(i){var e;if(super(i),i.type!==je.ATTRIBUTE||i.name!=="class"||((e=i.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(e=>i[e]).join(" ")+" "}update(i,[e]){var r,s;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!((r=this.nt)!=null&&r.has(o))&&this.st.add(o);return this.render(e)}const t=i.element.classList;for(const o of this.st)o in e||(t.remove(o),this.st.delete(o));for(const o in e){const a=!!e[o];a===this.st.has(o)||(s=this.nt)!=null&&s.has(o)||(a?(t.add(o),this.st.add(o)):(t.remove(o),this.st.delete(o)))}return V}}),X=F` :host { box-sizing: border-box; font-family: var(--rv-font-family); } :host *, :host *::before, :host *::after { box-sizing: inherit; } [hidden] { display: none !important; } `,Je=F` ${X} :host { --dialog-width: 31rem; --header-spacing: var(--rv-spacing-large); --body-spacing: var(--rv-spacing-large); --footer-spacing: var(--rv-spacing-large); display: none; } :host([open]) { display: contents; } .dialog__overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: var(--rv-dialog-background-color-overlay); } .dialog { display: flex; align-items: center; justify-content: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; } .dialog--open .dialog__panel { display: flex; opacity: 1; } .dialog__panel { display: flex; flex-direction: column; z-index: 2; width: var(--dialog-width); max-width: calc(100% - var(--rv-spacing-2x-large)); max-height: calc(100% - var(--rv-spacing-2x-large)); background-color: var(--rv-dialog-background-color); border-radius: var(--rv-border-radius-large); box-shadow: var(--rv-shadow-x-large); } .dialog__panel:focus { outline: none; } .dialog__header { flex: 0 0 auto; display: flex; background-color: var(--rv-dialog-background-color-header); height: 44px; font-size: 1.125rem; /* 18px */ line-height: 1.4; border-radius: var(--rv-border-radius-large) var(--rv-border-radius-large) 0 0; } .dialog__header-actions { flex-shrink: 0; display: flex; flex-wrap: wrap; justify-content: end; gap: var(--rv-spacing-2x-small); } .dialog__title { flex: 1 1 auto; margin: 0; font-weight: 600; text-overflow: ellipsis; padding: 0.75rem; } .dialog__close { background-color: transparent; border: none; border-radius: var(--rv-border-radius-circle); width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.3s; margin: 0.25rem; } .dialog__close:hover { background-color: hsl(0 0% 80% / 50%); } .dialog__content { flex: 1 1 auto; display: block; min-height: 250px; padding: var(--body-spacing); overflow: auto; -webkit-overflow-scrolling: touch; } .dialog__footer { flex: 0 0 auto; height: 64px; text-align: right; background-color: var(--rv-dialog-background-color-footer); padding: var(--rv-spacing-small); border-radius: 0 0 var(--rv-border-radius-large) var(--rv-border-radius-large); box-shadow: 0 -4px 8px -1px rgba(0, 0, 0, 0.1); } .rv-button { background-color: var(--rv-button-background-color); border: none; color: white; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; /* Adjust font size as needed */ cursor: pointer; border-radius: 20px; transition: background-color 0.3s, box-shadow 0.3s; /* Smooth transition for hover effects */ } .rv-button:hover { background-color: var(--rv-button-background-color-hover); } `;var Qe=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,ee=(i,e,t,r)=>{for(var s=r>1?void 0:r?Ke(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(r?a(e,t,s):a(s))||s);return r&&s&&Qe(e,t,s),s};exports.RvDialog=class extends y{constructor(){super(...arguments),this.title="",this.open=!1}show(){return this.open=!0,new Promise(e=>{this._closeResolver=e})}close(e){this._closeResolver&&(this._closeResolver(e),this._closeResolver=void 0),this.open=!1}render(){return Y` <div id="dialog" class="${We({dialog:!0,"dialog--open":this.open})}"> <div part="overlay" class="dialog__overlay" @click="${()=>this.close("overlay")}" tabindex="-1"></div> <div part="panel" class="dialog__panel" role="dialog" aria-modal="true" aria-hidden=${this.open?"false":"true"} tabindex="-1"> <header part="header" class="dialog__header"> <div part="title" class="dialog__title"> ${this.title.length>0?this.title:"\uFEFF"} </div> <div part="header-actions" class="dialog__header-actions"> <slot name="header-actions"></slot> <div part="close-button" class="dialog__close" @click="${()=>this.close("close-button")}"> <svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 16 16" fill="currentColor" > <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/> </svg> </div> </div> </header> <slot part="content" class="dialog__content"></slot> <footer part="footer" class="dialog__footer"> <slot name="footer"> <button class="rv-button" @click="${()=>this.close("close-button")}">Ok</button> </slot> </footer> </div> </div> `}};exports.RvDialog.styles=Je;ee([d()],exports.RvDialog.prototype,"title",2);ee([d({type:Boolean,reflect:!0})],exports.RvDialog.prototype,"open",2);exports.RvDialog=ee([Z("rv-dialog")],exports.RvDialog);var k=(i=>(i.Pivot="Pivot",i.Grid="Grid",i.AreaChart="AreaChart",i.BarChart="BarChart",i.BubbleChart="BubbleChart",i.CandlestickChart="CandlestickChart",i.ColumnChart="ColumnChart",i.ComboChart="ComboChart",i.DoughnutChart="DoughnutChart",i.FunnelChart="FunnelChart",i.LineChart="LineChart",i.OHLC_Chart="OHLC_Chart",i.PieChart="PieChart",i.RadialLineChart="RadialLineChart",i.ScatterChart="ScatterChart",i.SplineChart="SplineChart",i.SplineAreaChart="SplineAreaChart",i.StackedAreaChart="StackedAreaChart",i.StackedBarChart="StackedBarChart",i.StackedColumnChart="StackedColumnChart",i.StepAreaChart="StepAreaChart",i.StepLineChart="StepLineChart",i.RadialGauge="RadialGauge",i.BulletGraph="BulletGraph",i.LinearGauge="LinearGauge",i.LabelGauge="LabelGauge",i.TreeMap="TreeMap",i.Image="Image",i.DIY="DIY",i.TextView="TextView",i.Indicator="Indicator",i.IndicatorTarget="IndicatorTarget",i.Sparkline="Sparkline",i.TextBox="TextBox",i.Choropleth="Choropleth",i.ScatterMap="ScatterMap",i.TimeSeriesChart="TimeSeriesChart",i))(k||{});function Ye(i){const e=i&&i.constructor;return!!(we(i)&&e&&e.name&&e.name!=="Object")}function Ze(i){const e=Object.prototype.toString.call(i);return e==="[object Array]"||e==="[object Array Iterator]"}function we(i,e){return!!i&&typeof i=="object"&&!Ze(i)}const Xe=["__proto__","constructor","prototype"];function $e(i,...e){const t=function(s,o){return typeof s!="object"&&(s={}),Object.entries(o).forEach(([a,l])=>{Xe.includes(a)||(we(l)&&!Ye(l)?s[a]=t(s[a]||{},l):s[a]=o[a])}),s},r=e.length;for(let s=0;s<r;s++)i=t(i,e[s]);return i}const et=F` ${X} :host { display: block; height: 100%; width: 100%; position: relative; > div { height: inherit; width: inherit; min-height: inherit; position: relative; } } `;class Se{static async load(e){if(!e)return null;if(typeof e=="string"||e instanceof Blob)return await this.loadRVDashboard(e);if(typeof e.toRVDashboard=="function")return await e.toRVDashboard();if(e.constructor.name==="RVDashboard")return e;throw new Error("Invalid Dashboard provided to DashboardLoader.load: "+e)}static async loadRVDashboard(e){return typeof e=="string"?await $.ig.RVDashboard.loadDashboard(e):$.ig.RVDashboard.loadDashboardFromContainer(e)}}const W={AmazonAthena:{dataSourceCreator:()=>new $.ig.RVAthenaDataSource,dataSourceItemCreator:i=>new $.ig.RVAthenaDataSourceItem(i)},AmazonS3:{dataSourceCreator:()=>new $.ig.RVS3DataSource},Excel:{dataSourceItemCreator:(i,e)=>{const t=new $.ig.RVLocalFileDataSourceItem;return t.uri=e.fileName?`local:/${e.fileName}`:void 0,new $.ig.RVExcelDataSourceItem(t)}},GoogleBigQuery:{dataSourceCreator:()=>new $.ig.RVBigQueryDataSource,dataSourceItemCreator:i=>new $.ig.RVBigQueryDataSourceItem(i)},GoogleDrive:{dataSourceCreator:()=>new $.ig.RVGoogleDriveDataSource},GoogleSheets:{dataSourceCreator:()=>new $.ig.RVGoogleDriveDataSourceItem,dataSourceItemCreator:i=>new $.ig.RVGoogleSheetDataSourceItem(i)},LocalFile:{dataSourceItemCreator:(i,e)=>{const t=new $.ig.RVLocalFileDataSourceItem;return t.uri=e.fileName?`local:/${e.fileName}`:void 0,e.format==="Excel"?new $.ig.RVExcelDataSourceItem(t):new $.ig.RVCsvDataSourceItem(t)}},MicrosoftAzureSqlServer:{dataSourceCreator:()=>new $.ig.RVAzureSqlDataSource,dataSourceItemCreator:i=>new $.ig.RVAzureSqlDataSourceItem(i)},MicrosoftSqlServer:{dataSourceCreator:()=>new $.ig.RVSqlServerDataSource,dataSourceItemCreator:i=>new $.ig.RVSqlServerDataSourceItem(i)},MongoDB:{dataSourceCreator:()=>new $.ig.RVMongoDBDataSource,dataSourceItemCreator:i=>new $.ig.RVMongoDBDataSourceItem(i)},MySql:{dataSourceCreator:()=>new $.ig.RVMySqlDataSource,dataSourceItemCreator:i=>new $.ig.RVMySqlDataSourceItem(i)},Oracle:{dataSourceCreator:i=>i.provider==="SID"?new $.ig.RVOracleSIDDataSource:new $.ig.RVOracleServiceDataSource,dataSourceItemCreator:i=>new $.ig.RVOracleDataSourceItem(i)},PostgreSQL:{dataSourceCreator:()=>new $.ig.RVPostgresDataSource,dataSourceItemCreator:i=>new $.ig.RVPostgresDataSourceItem(i)},RemoteFile:{dataSourceItemCreator:(i,e)=>{const t=new $.ig.RVWebResourceDataSource;t.url=e.url,t.useAnonymousAuthentication=e.useAnonymousAuthentication??!0;const r=new $.ig.RVWebResourceDataSourceItem(t);if(e.format==="JSON")return new $.ig.RVJsonDataSourceItem(r);if(e.format==="CSV")return new $.ig.RVCsvDataSourceItem(r);if(e.format==="Excel")return new $.ig.RVExcelDataSourceItem(r);throw new Error(`Unsupported RemoteFile: ${e.type}`)}},REST:{dataSourceCreator:i=>{const e=new $.ig.RVRESTDataSource;return e.useAnonymousAuthentication=i.useAnonymousAuthentication??!0,e}},Snowflake:{dataSourceCreator:()=>new $.ig.RVSnowflakeDataSource,dataSourceItemCreator:i=>new $.ig.RVSnowflakeDataSourceItem(i)}};function tt(i){const e=[];let t=[];return i&&i.forEach(r=>{var a;let s;const o=W[r.type].dataSourceCreator;o&&(s=o(r),st(r,s),e.push(s)),(a=W[r.type])!=null&&a.dataSourceItemCreator&&t.push(...rt(r,s))}),{dataSources:e,dataSourceItems:t}}function it(i){return"items"in i&&Array.isArray(i.items)}function rt(i,e){const t=[],r=W[i.type].dataSourceItemCreator;if(!r)throw new Error(`Unsupported dataSourceItemType: ${i.type}`);return(it(i)?i.items:[i]).forEach(o=>{const a=r(e,o);ot(o,a),t.push(a)}),t}function st(i,e){ye(i,e)}function ot(i,e){ye(i,e)}function ye(i,e){for(const t in i)i.hasOwnProperty(t)&&(e[t]=i[t])}const at=Object.freeze({canEdit:!0,canSave:!0,canSaveAs:!0,dataSources:[],saveOnServer:!0,startInEditMode:!1,startWithNewVisualization:!1,header:{showHeader:!0,canAddVisualization:!0,menu:{showMenu:!0,exportToExcel:!0,exportToImage:!0,exportToPdf:!0,exportToPowerPoint:!0,refresh:!0,items:[]}},filters:{addDashboardFiter:!0,addDateFilter:!0,interactiveFiltering:!0,showFilters:!0},dataSourceDialog:{showExistingDataSources:!1,showSearch:!1},visualizations:{canMaximize:!0,categoryGroupingSeparator:" - ",crosshairs:!1,hoverTooltips:!0,changeChartType:!0,statisticalFunctions:!0,menu:{copy:!0,duplicate:!0,items:[]}},editor:{defaultChartType:k.ColumnChart,addPostCalculatedFields:!0,addCalculatedFields:!0,dataBlending:!0,editDataSource:!1,machineLearning:!1}});var nt=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,u=(i,e,t,r)=>{for(var s=r>1?void 0:r?lt(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(r?a(e,t,s):a(s))||s);return r&&s&&nt(e,t,s),s};exports.RvRevealView=class extends y{constructor(){super(...arguments),this._revealView=null,this._mergedOptions={},this.dashboard="",this.options={}}get dateFilter(){var e,t;return(t=(e=this._revealView)==null?void 0:e.dashboard)==null?void 0:t.dateFilter}get filters(){var e,t;return(t=(e=this._revealView)==null?void 0:e.dashboard)==null?void 0:t.filters}firstUpdated(e){console.log("firstUpdated"),this.init(this.dashboard,this.options)}async init(e,t){const r=await this.loadRVDashboard(e),s=this.renderRoot.querySelector("#rv-viewer");this._revealView=new $.ig.RevealView(s),this._revealView.interactiveFilteringEnabled=!0,this.assignHandler(this.dataLoading,"onDataLoading",o=>o),e&&(this._revealView.dashboard=r),this.updateOptions(t),this.initializeEvents(),this.initialized&&this.initialized()}loadRVDashboard(e){return Se.load(e)}updateOptions(e){if(this._revealView){if(this._mergedOptions=$e({},at,e),this._revealView.canEdit=this._mergedOptions.canEdit,this._revealView.canSave=this._mergedOptions.canSave,this._revealView.canSaveAs=this._mergedOptions.canSaveAs,this._revealView.serverSideSave=this._mergedOptions.saveOnServer,this._revealView.startInEditMode=this._mergedOptions.startInEditMode,this._revealView.startWithNewVisualization=this._mergedOptions.startWithNewVisualization,this._revealView.showHeader=this._mergedOptions.header.showHeader,this._revealView.canAddVisualization=this._mergedOptions.header.canAddVisualization,this._revealView.showMenu=this._mergedOptions.header.menu.showMenu,this._revealView.showExportToExcel=this._mergedOptions.header.menu.exportToExcel,this._revealView.showExportImage=this._mergedOptions.header.menu.exportToImage,this._revealView.showExportToPDF=this._mergedOptions.header.menu.exportToPdf,this._revealView.showExportToPowerpoint=this._mergedOptions.header.menu.exportToPowerPoint,this._revealView.showRefresh=this._mergedOptions.header.menu.refresh,this._revealView.showFilters=this._mergedOptions.filters.showFilters,this._revealView.canAddDashboardFiter=this._mergedOptions.filters.addDashboardFiter,this._revealView.canAddDateFilter=this._mergedOptions.filters.addDateFilter,this._revealView.interactiveFilteringEnabled=this._mergedOptions.filters.interactiveFiltering,this._revealView.canMaximizeVisualization=this._mergedOptions.visualizations.canMaximize,this._revealView.categoryGroupingSeparator=this._mergedOptions.visualizations.categoryGroupingSeparator,this._revealView.crosshairsEnabled=this._mergedOptions.visualizations.crosshairs,this._revealView.hoverTooltipsEnabled=this._mergedOptions.visualizations.hoverTooltips,this._revealView.showChangeVisualization=this._mergedOptions.visualizations.changeChartType,this._revealView.showStatisticalFunctions=this._mergedOptions.visualizations.statisticalFunctions,this._revealView.canCopyVisualization=this._mergedOptions.visualizations.menu.copy,this._revealView.canDuplicateVisualization=this._mergedOptions.visualizations.menu.duplicate,this._revealView.showDataSourceSelectionDialogSearch=this._mergedOptions.dataSourceDialog.showSearch,this._mergedOptions.editor.chartTypes&&(this._revealView.chartTypes=this._mergedOptions.editor.chartTypes(this._revealView.chartTypes)),this._mergedOptions.editor.chartTypesToRemove&&(this._revealView.chartTypes=this._revealView.chartTypes.filter(t=>!this._mergedOptions.editor.chartTypesToRemove.includes(t.chartType))),this._mergedOptions.editor.chartTypesToAdd&&this._revealView.chartTypes.push(...this._mergedOptions.editor.chartTypesToAdd),typeof this._mergedOptions.editor.defaultChartType=="string"){const t=Object.values(k).includes(this._mergedOptions.editor.defaultChartType);this._revealView.defaultChartType=t?this._mergedOptions.editor.defaultChartType:void 0,this._revealView.defaultCustomChartType=t?void 0:this._mergedOptions.editor.defaultChartType}else this._revealView.defaultChartType=this._mergedOptions.editor.defaultChartType;this._revealView.canAddCalculatedFields=this._mergedOptions.editor.addCalculatedFields,this._revealView.canAddPostCalculatedFields=this._mergedOptions.editor.addPostCalculatedFields,this._revealView.showDataBlending=this._mergedOptions.editor.dataBlending,this._revealView.showEditDataSource=this._mergedOptions.editor.editDataSource,this._revealView.showMachineLearningModelsIntegration=this._mergedOptions.editor.machineLearning}}async updateDashboard(e){this._revealView&&(this._revealView.dashboard=await this.loadRVDashboard(e))}initializeEvents(){this.assignHandler(this.dataPointClicked,"onVisualizationDataPointClicked",(e,t,r)=>({visualization:e,cell:t,row:r})),this.assignHandler(this.dataSourceDialogOpening,"onDataSourceSelectionDialogShowing",e=>e),this.assignHandler(this.fieldsInitializing,"onFieldsInitializing",e=>e),this.assignHandler(this.tooltipShowing,"onTooltipShowing",e=>e),this.assignHandler(this.editorClosed,"onVisualizationEditorClosed",e=>e),this.assignHandler(this.editorClosing,"onVisualizationEditorClosing",e=>e),this.assignHandler(this.editorOpened,"onVisualizationEditorOpened",e=>e),this.assignHandler(this.editorOpening,"onVisualizationEditorOpening",e=>e),this.assignHandler(this.imageExported,"onImageExported",e=>({image:e})),this.assignHandler(this.linkSelectionDialogOpening,"onDashboardSelectorRequested",e=>e),this.assignHandler(this.saving,"onSave",(e,t)=>t),this.seriesColorRequested!==void 0&&(this._revealView.onVisualizationSeriesColorAssigning=(e,t,r,s)=>{var o;return(o=this.seriesColorRequested)==null?void 0:o.call(this,{visualization:e,defaultColor:t,fieldName:r,categoryName:s})}),this._revealView.onMenuOpening=(e,t)=>{const r=(s,o)=>{s.forEach(a=>{const l=a.icon?new $.ig.RVImage(a.icon):void 0;t.menuItems.push(new $.ig.RVMenuItem(a.title,l,()=>o(a)))})};if(e===null){const s=this._mergedOptions.header.menu.items;r(s,o=>o.click())}else{const s=this._mergedOptions.visualizations.menu.items;r(s,o=>o.click(e))}this.assignHandler(this.menuOpening,"onMenuOpening",s=>s)},this._revealView.onDataSourcesRequested=(e,t)=>{const{dataSources:r,dataSourceItems:s}=tt(this._mergedOptions.dataSources);if(this.dataSourcesRequested!==void 0){const o=this.dataSourcesRequested({trigger:t});r.push(...o.dataSources),s.push(...o.dataSourceItems)}e(new $.ig.RevealDataSources(r,s,this._mergedOptions.dataSourceDialog.showExistingDataSources))},this._revealView.onLinkedDashboardProviderAsync=(e,t)=>{let r=e;return this.dashboardLinkRequested!==void 0&&(r=this.dashboardLinkRequested({dashboardId:e,title:t})),$.ig.RVDashboard.loadDashboard(r)}}assignHandler(e,t,r){e!==void 0&&(this._revealView[t]=(...s)=>{e&&e(r(...s))})}getRVDashboard(){return this._revealView?this._revealView.dashboard:null}exportToExcel(){this._revealView._dashboardView.exportToExcel()}exportToImage(e=!0){if(e){this._revealView._dashboardView.exportImage();return}return this._revealView.toImage()}exportToPdf(){this._revealView._dashboardView.exportToFormat("pdf")}exportToPowerPoint(){this._revealView._dashboardView.exportToFormat("pptx")}refreshData(e){typeof e=="string"?this._revealView._dashboardView.refreshWidget(e):typeof e=="number"?this._revealView._dashboardView.refreshWidget(this._revealView.dashboard.visualizations[e].id):this._revealView.refreshDashboardData()}updated(e){const t=e.has("dashboard")&&this.dashboard!==void 0,r=e.has("options")&&this.options!==void 0;t&&this.updateDashboard(this.dashboard),r&&this.updateOptions(this.options)}render(){return Y` <div id="rv-viewer"></div> `}};exports.RvRevealView.styles=et;u([d({type:String})],exports.RvRevealView.prototype,"dashboard",2);u([d({type:Object,attribute:!1})],exports.RvRevealView.prototype,"options",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"dataLoading",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"dataPointClicked",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"dataSourceDialogOpening",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"dataSourcesRequested",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"dashboardLinkRequested",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"editorClosed",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"editorClosing",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"editorOpened",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"editorOpening",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"fieldsInitializing",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"imageExported",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"initialized",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"linkSelectionDialogOpening",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"menuOpening",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"saving",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"seriesColorRequested",2);u([d({type:Function,attribute:!1})],exports.RvRevealView.prototype,"tooltipShowing",2);exports.RvRevealView=u([Z("rv-reveal-view")],exports.RvRevealView);const ht=Object.freeze({categoryGroupingSeparator:" - ",crosshairs:!1,hoverTooltips:!0,showFilters:!1,changeChartType:!1,statisticalFunctions:!1,menu:{items:[],copy:!0,duplicate:!0,exportToExcel:!0,exportToImage:!0,showMenu:!1,refresh:!0}}),dt=F` ${X} :host { display: block; height: 100%; width: 100%; position: relative; > div { height: inherit; width: inherit; min-height: inherit; position: relative; } } `;var ct=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,L=(i,e,t,r)=>{for(var s=r>1?void 0:r?ut(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(r?a(e,t,s):a(s))||s);return r&&s&&ct(e,t,s),s};exports.RvVisualizationViewer=class extends y{constructor(){super(...arguments),this._revealView=null,this._mergedOptions={},this.dashboard="",this.options={},this.visualization=0}firstUpdated(e){this.init(this.dashboard,this.visualization,this.options)}async init(e,t,r){const s=await this.loadRVDashboard(e),o=this.renderRoot.querySelector("#rv-viewer");this._revealView=new $.ig.RevealView(o),this._revealView.singleVisualizationMode=!0,this.updateOptions(r),this._revealView.dashboard=s,this.setVisualization(s,t),this._revealView.onMenuOpening=(a,l)=>{a!==null&&this._mergedOptions.menu.items.forEach(c=>{l.menuItems.push(new $.ig.RVMenuItem(c.title,c.icon,()=>c.click(a)))})}}setVisualization(e,t){if(!e||!e.visualizations||e.visualizations.length===0){this._revealView.maximizedVisualization=null;return}t=t!==void 0?t:0;let r=null;typeof t=="string"?(r=e.visualizations.getByTitle(t),r===null&&(r=e.visualizations.getById(t)),r===null&&(r=e.visualizations[t])):typeof t=="number"&&(r=e.visualizations[t]),r||console.log(`Visualization ${typeof t=="string"?`with ID or title "${t}"`:`at index ${t}`} is not found. Loading the default vizualization.`),this._revealView.maximizedVisualization=r}async updateDashboard(e,t){this._revealView&&(this._revealView.dashboard=await this.loadRVDashboard(e),this.setVisualization(this._revealView.dashboard,t))}updateOptions(e){this._revealView&&(this._mergedOptions=$e({},ht,e),this._revealView.showExportToExcel=this._mergedOptions.menu.exportToExcel,this._revealView.showExportImage=this._mergedOptions.menu.exportToImage,this._revealView.showMenu=this._mergedOptions.menu.showMenu,this._revealView.showRefresh=this._mergedOptions.menu.refresh,this._revealView.showFilters=this._mergedOptions.showFilters,this._revealView.categoryGroupingSeparator=this._mergedOptions.categoryGroupingSeparator,this._revealView.crosshairsEnabled=this._mergedOptions.crosshairs,this._revealView.hoverTooltipsEnabled=this._mergedOptions.hoverTooltips,this._revealView.showChangeVisualization=this._mergedOptions.changeChartType,this._revealView.showStatisticalFunctions=this._mergedOptions.statisticalFunctions,this._revealView.canCopyVisualization=this._mergedOptions.menu.copy,this._revealView.canDuplicateVisualization=this._mergedOptions.menu.duplicate)}updateVisualization(e){this._revealView&&this.setVisualization(this._revealView.dashboard,e)}async loadRVDashboard(e){return Se.load(e)}updated(e){const t=e.has("dashboard")&&this.dashboard!==void 0,r=e.has("visualization")&&this.visualization!==void 0,s=e.has("options")&&this.options!==void 0;t?this.updateDashboard(this.dashboard,this.visualization):r&&this.updateVisualization(this.visualization),s&&this.updateOptions(this.options)}render(){return Y` <div id="rv-viewer"></div> `}};exports.RvVisualizationViewer.styles=dt;L([d({type:String})],exports.RvVisualizationViewer.prototype,"dashboard",2);L([d({type:Object,attribute:!1})],exports.RvVisualizationViewer.prototype,"options",2);L([d({type:String})],exports.RvVisualizationViewer.prototype,"visualization",2);exports.RvVisualizationViewer=L([Z("rv-visualization-viewer")],exports.RvVisualizationViewer);exports.ChartType=k;exports.RevealSdkSettings=G;