amazon-quicksight-embedding-sdk
Version:
JS SDK for embedding Amazon QuickSight
9 lines • 69.4 kB
JavaScript
/*!
* amazon-quicksight-embedding-sdk v2.10.0
* git@github.com:awslabs/amazon-quicksight-embedding-sdk.git
* https://github.com/awslabs/amazon-quicksight-embedding-sdk
*
* Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).QuickSightEmbedding={})}(this,(function(e){"use strict";function n(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function r(e,n,r,t,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?n(c):Promise.resolve(c).then(t,i)}function t(e){return function(){var n=this,t=arguments;return new Promise((function(i,o){var a=e.apply(n,t);function s(e){r(a,i,o,s,c,"next",e)}function c(e){r(a,i,o,s,c,"throw",e)}s(void 0)}))}}function i(e,n,r){return n=c(n),function(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(n,r||[],c(e).constructor):n.apply(e,r))}function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function a(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,n,r){return(n=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,n);if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&E(e,n)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function p(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function f(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){s(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function h(e,n){if(null==e)return{};var r,t,i=function(e,n){if(null==e)return{};var r={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==n.indexOf(t))continue;r[t]=e[t]}return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(t=0;t<o.length;t++)r=o[t],-1===n.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function d(){d=function(){return n};var e,n={},r=Object.prototype,t=r.hasOwnProperty,i=Object.defineProperty||function(e,n,r){e[n]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,n,r){return Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{u({},"")}catch(e){u=function(e,n,r){return e[n]=r}}function l(e,n,r,t){var o=n&&n.prototype instanceof _?n:_,a=Object.create(o.prototype),s=new C(t||[]);return i(a,"_invoke",{value:R(e,r,s)}),a}function p(e,n,r){try{return{type:"normal",arg:e.call(n,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=l;var f="suspendedStart",h="suspendedYield",E="executing",m="completed",v={};function _(){}function w(){}function O(){}var g={};u(g,a,(function(){return this}));var I=Object.getPrototypeOf,A=I&&I(I(L([])));A&&A!==r&&t.call(A,a)&&(g=A);var T=O.prototype=_.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(n){u(e,n,(function(e){return this._invoke(n,e)}))}))}function x(e,n){function r(i,o,a,s){var c=p(e[i],e,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&t.call(l,"__await")?n.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):n.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(e,t){function i(){return new n((function(n,i){r(e,t,n,i)}))}return o=o?o.then(i,i):i()}})}function R(n,r,t){var i=f;return function(o,a){if(i===E)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:e,done:!0}}for(t.method=o,t.arg=a;;){var s=t.delegate;if(s){var c=y(s,t);if(c){if(c===v)continue;return c}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(i===f)throw i=m,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);i=E;var u=p(n,r,t);if("normal"===u.type){if(i=t.done?m:h,u.arg===v)continue;return{value:u.arg,done:t.done}}"throw"===u.type&&(i=m,t.method="throw",t.arg=u.arg)}}}function y(n,r){var t=r.method,i=n.iterator[t];if(i===e)return r.delegate=null,"throw"===t&&n.iterator.return&&(r.method="return",r.arg=e,y(n,r),"throw"===r.method)||"return"!==t&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+t+"' method")),v;var o=p(i,n.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[n.resultName]=a.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function N(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function b(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function L(n){if(n||""===n){var r=n[a];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,o=function r(){for(;++i<n.length;)if(t.call(n,i))return r.value=n[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(typeof n+" is not iterable")}return w.prototype=O,i(T,"constructor",{value:O,configurable:!0}),i(O,"constructor",{value:w,configurable:!0}),w.displayName=u(O,c,"GeneratorFunction"),n.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===w||"GeneratorFunction"===(n.displayName||n.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,u(e,c,"GeneratorFunction")),e.prototype=Object.create(T),e},n.awrap=function(e){return{__await:e}},S(x.prototype),u(x.prototype,s,(function(){return this})),n.AsyncIterator=x,n.async=function(e,r,t,i,o){void 0===o&&(o=Promise);var a=new x(l(e,r,t,i),o);return n.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(T),u(T,c,"Generator"),u(T,a,(function(){return this})),u(T,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var n=Object(e),r=[];for(var t in n)r.push(t);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},n.values=L,C.prototype={constructor:C,reset:function(n){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(b),!n)for(var r in this)"t"===r.charAt(0)&&t.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function i(t,i){return s.type="throw",s.arg=n,r.next=t,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=t.call(a,"catchLoc"),u=t.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&t.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=n,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),v},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),b(r),v}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var t=r.completion;if("throw"===t.type){var i=t.arg;b(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(n,r,t){return this.delegate={iterator:L(n),resultName:r,nextLoc:t},"next"===this.method&&(this.arg=e),v}},n}function E(e,n){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},E(e,n)}function m(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var t,i,o,a,s=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===n);else for(;!(c=(t=o.call(r)).done)&&(s.push(t.value),s.length!==n);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,r)||function(e,r){if(e){if("string"==typeof e)return n(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}var _={CALLBACK_OPERATION_INVOKED:"CALLBACK_OPERATION_INVOKED",CONTENT_LOADED:"CONTENT_LOADED",EXPERIENCE_INITIALIZED:"EXPERIENCE_INITIALIZED",ERROR_OCCURRED:"ERROR_OCCURRED",SIZE_CHANGED:"SIZE_CHANGED",PARAMETERS_CHANGED:"PARAMETERS_CHANGED",SELECTED_SHEET_CHANGED:"SELECTED_SHEET_CHANGED",MODAL_OPENED:"MODAL_OPENED",Q_SEARCH_CLOSED:"Q_SEARCH_CLOSED",Q_SEARCH_OPENED:"Q_SEARCH_OPENED",Q_SEARCH_FOCUSED:"Q_SEARCH_FOCUSED",Q_SEARCH_SIZE_CHANGED:"Q_SEARCH_SIZE_CHANGED",Q_SEARCH_ENTERED_FULLSCREEN:"Q_SEARCH_ENTERED_FULLSCREEN",Q_SEARCH_EXITED_FULLSCREEN:"Q_SEARCH_EXITED_FULLSCREEN",Q_PANEL_ENTERED_FULLSCREEN:"Q_PANEL_ENTERED_FULLSCREEN",Q_PANEL_EXITED_FULLSCREEN:"Q_PANEL_EXITED_FULLSCREEN",PAGE_NAVIGATION:"PAGE_NAVIGATION"},w={FRAME_STARTED:"FRAME_STARTED",FRAME_MOUNTED:"FRAME_MOUNTED",FRAME_LOADED:"FRAME_LOADED",FRAME_REMOVED:"FRAME_REMOVED"},O={FRAME_NOT_CREATED:"FRAME_NOT_CREATED",NO_BODY:"NO_BODY",NO_CONTAINER:"NO_CONTAINER",INVALID_CONTAINER:"INVALID_CONTAINER",NO_URL:"NO_URL",INVALID_URL:"INVALID_URL",NO_FRAME_OPTIONS:"NO_FRAME_OPTIONS",INVALID_FRAME_OPTIONS:"INVALID_FRAME_OPTIONS"},g={UNRECOGNIZED_CONTENT_OPTIONS:"UNRECOGNIZED_CONTENT_OPTIONS",UNRECOGNIZED_FRAME_OPTIONS:"UNRECOGNIZED_FRAME_OPTIONS",UNRECOGNIZED_EVENT_TARGET:"UNRECOGNIZED_EVENT_TARGET"},I={SET_PARAMETERS:"SET_PARAMETERS",SET_SELECTED_SHEET_ID:"SET_SELECTED_SHEET_ID",SET_Q_SEARCH_QUESTION:"SET_Q_SEARCH_QUESTION",SET_VISUAL_ACTIONS:"SET_VISUAL_ACTIONS",SET_THEME:"SET_THEME",ADD_FILTER_GROUPS:"ADD_FILTER_GROUPS",UPDATE_FILTER_GROUPS:"UPDATE_FILTER_GROUPS",REMOVE_FILTER_GROUPS:"REMOVE_FILTER_GROUPS",ADD_VISUAL_ACTIONS:"ADD_VISUAL_ACTIONS",REMOVE_VISUAL_ACTIONS:"REMOVE_VISUAL_ACTIONS",SET_THEME_OVERRIDE:"SET_THEME_OVERRIDE",PRELOAD_THEMES:"PRELOAD_THEMES",CREATE_SHARED_VIEW:"CREATE_SHARED_VIEW"},A={GET_PARAMETERS:"GET_PARAMETERS",GET_SHEETS:"GET_SHEETS",GET_SHEET_VISUALS:"GET_SHEET_VISUALS",GET_VISUAL_ACTIONS:"GET_VISUAL_ACTIONS",GET_SELECTED_SHEET_ID:"GET_SELECTED_SHEET_ID",GET_FILTER_GROUPS_FOR_SHEET:"GET_FILTER_GROUPS_FOR_SHEET",GET_FILTER_GROUPS_FOR_VISUAL:"GET_FILTER_GROUPS_FOR_VISUAL"},T={ACKNOWLEDGE:"ACKNOWLEDGE",INITIATE_PRINT:"INITIATE_PRINT",NAVIGATE_TO_DASHBOARD:"NAVIGATE_TO_DASHBOARD",CLOSE_Q_SEARCH:"CLOSE_Q_SEARCH",UNDO:"UNDO",REDO:"REDO",RESET:"RESET",TOGGLE_EXECUTIVE_SUMMARY_PANE:"TOGGLE_EXECUTIVE_SUMMARY_PANE",OPEN_BUILD_VISUAL_PANE:"OPEN_BUILD_VISUAL_PANE",OPEN_DATA_QNA_PANE:"OPEN_DATA_QNA_PANE",TOGGLE_BOOKMARKS_PANE:"TOGGLE_BOOKMARKS_PANE",TOGGLE_THRESHOLD_ALERTS_PANE:"TOGGLE_THRESHOLD_ALERTS_PANE",TOGGLE_SCHEDULING_PANE:"TOGGLE_SCHEDULING_PANE",TOGGLE_RECENT_SNAPSHOTS_PANE:"TOGGLE_RECENT_SNAPSHOTS_PANE"},S=Object.freeze({__proto__:null,ErrorChangeEventName:O,GetterMessageEventName:A,InfoChangeEventName:w,InfoMessageEventName:_,InvokerMessageEventName:T,SetterMessageEventName:I,WarnChangeEventName:g}),x=f(f(f({},w),O),g),R=f(f(f(f({},_),I),A),T),y={ERROR:"ERROR",INFO:"INFO",WARN:"WARN"},N=Object.freeze({__proto__:null,ChangeEventLevel:y,ChangeEventName:x,MessageEventName:R}),b=Object.freeze({__proto__:null}),C=Object.freeze({__proto__:null}),L=Object.freeze({__proto__:null}),P=Object.freeze({__proto__:null}),D={CONSOLE:"CONSOLE",CONTEXT:"CONTEXT",CONTROL:"CONTROL",VISUAL:"VISUAL",DASHBOARD:"DASHBOARD",QSEARCH:"QSEARCH",GENERATIVEQNA:"QSEARCH"},U=Object.freeze({__proto__:null,ExperienceType:D}),F=Object.freeze({__proto__:null}),M={NULL:null,OTHER_BUCKET:null},G={INTEGER:null,STRING:null,DECIMAL:null,DATETIME:null},k=Object.freeze({__proto__:null,CALCULATED_METRIC_COLUMN_TYPE:G,SPECIAL_DATAPOINT_VALUE_TYPES:M}),V=Object.freeze({__proto__:null}),H=Object.freeze({__proto__:null}),j=Object.freeze({__proto__:null}),Q={FULL:"FULL",SEARCH_BAR:"SEARCH_BAR"},B=Object.freeze({__proto__:null,GenerativeQnAPanelType:Q}),q=Object.freeze({__proto__:null}),z=a((function e(n,r,t){o(this,e),this.eventName=n,this.message=r,this.data=t})),X=function(e){function n(e,r,t,a){var s;return o(this,n),(s=i(this,n,[e,t,a])).eventLevel=r,s}return u(n,e),a(n)}(z),W=function(e){function n(e,r,t){var a;return o(this,n),(a=i(this,n,[e,r,t])).eventName=e,a}return u(n,e),a(n)}(z),Z=function(e){function n(e,r,t,a){var s;return o(this,n),(s=i(this,n,[e,t,a])).eventTarget=r,s}return u(n,e),a(n)}(W),Y=function(e){function n(e,r,t,a,s,c,u){var l;return o(this,n),(l=i(this,n,[e,r,c,u])).timestamp=a,l.version=s,l.eventId=t,l}return u(n,e),a(n)}(Z),K=a((function e(){o(this,e)})),$=a((function e(){o(this,e),s(this,"success",!0)})),J=a((function e(n){o(this,e),s(this,"success",!1),this.errorCode=n.errorCode,this.error=n.error,this.message=n.message})),ee=a((function e(n){o(this,e),s(this,"success",!0),this.message=n}));let ne;const re=new Uint8Array(16);function te(){if(!ne&&(ne="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ne))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(re)}const ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));var oe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ae(e,n,r){if(oe.randomUUID&&!e)return oe.randomUUID();const t=(e=e||{}).random||(e.rng||te)();return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(e,n=0){return ie[e[n+0]]+ie[e[n+1]]+ie[e[n+2]]+ie[e[n+3]]+"-"+ie[e[n+4]]+ie[e[n+5]]+"-"+ie[e[n+6]]+ie[e[n+7]]+"-"+ie[e[n+8]]+ie[e[n+9]]+"-"+ie[e[n+10]]+ie[e[n+11]]+ie[e[n+12]]+ie[e[n+13]]+ie[e[n+14]]+ie[e[n+15]]}(t)}var se=a((function e(n,r,i,a){var c=this;o(this,e),s(this,"send",function(){var e=t(d().mark((function e(n){var r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c.experienceFrame&&c.internalExperience){e.next=2;break}throw new Error("Experience has not been initialized");case 2:return r=new Z(n.eventName,c.internalExperience,n.message,n.data),e.abrupt("return",c.experienceFrame.send(r));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(this,"addEventListener",(function(e,n){return c.experienceFrame.addInternalEventListener(e,n)})),s(this,"setLogProvider",(function(e){return c.logger=e,c})),s(this,"getInternalExperienceInfo",(function(n){var r,t,i=-1;do{i++,r=f(f({},n),{},{contextId:c.controlOptions.contextId,discriminator:i}),t=e.getExperienceIdentifier(r)}while(c.experienceIdentifiers.has(t));return c.experienceIdentifiers.add(t),{experienceIdentifier:t,internalExperience:r}})),s(this,"transformContentOptions",(function(e,n){return c.warnUnrecognizedContentOptions(Object.keys(n)),e})),s(this,"warnUnrecognizedContentOptions",(function(e){var n,r,t;e.length>0&&(null===(n=(r=c.frameOptions).onChange)||void 0===n||n.call(r,new X(x.UNRECOGNIZED_CONTENT_OPTIONS,y.WARN,"Experience content options contain unrecognized properties",{unrecognizedContentOptions:e}),{frame:null}),null===(t=c.logger)||void 0===t||t.warn("Experience content options contain unrecognized properties"))})),s(this,"validateFrameOptions",(function(){if(!c.frameOptions.url){var e,n,r="Url is required for the experience";throw null===(e=(n=c.frameOptions).onChange)||void 0===e||e.call(n,new X(x.NO_URL,y.ERROR,r),{frame:null}),new Error(r)}})),this.frameOptions=n,this.contentOptions=r,this.controlOptions=i,this.experienceIdentifiers=a,this.validateFrameOptions()}));s(se,"getExperienceIdentifier",(function(e){if(e.experienceType===D.DASHBOARD)return[e.contextId,e.experienceType,e.dashboardId,e.discriminator].filter(Boolean).join("-");if(e.experienceType===D.VISUAL)return[e.contextId,e.experienceType,e.dashboardId,e.sheetId,e.visualId,e.discriminator].filter(Boolean).join("-");if([D.CONSOLE,D.CONTROL,D.CONTEXT,D.QSEARCH,D.GENERATIVEQNA].includes(e.experienceType))return[e.contextId,e.experienceType,e.discriminator].filter(Boolean).join("-");throw new Error("Invalid experience unable to build experience identifier")}));const ce=2147483647,ue={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},le=Math.floor,pe=String.fromCharCode;function fe(e){throw new RangeError(ue[e])}const he=function(e,n){return e+22+75*(e<26)-((0!=n)<<5)},de=function(e,n,r){let t=0;for(e=r?le(e/700):e>>1,e+=le(e/n);e>455;t+=36)e=le(e/35);return le(t+36*e/(e+38))},Ee=function(e){const n=[];e=function(e){const n=[];let r=0;const t=e.length;for(;r<t;){const i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<t){const t=e.charCodeAt(r++);56320==(64512&t)?n.push(((1023&i)<<10)+(1023&t)+65536):(n.push(i),r--)}else n.push(i)}return n}(e);const r=e.length;let t=128,i=0,o=72;for(const r of e)r<128&&n.push(pe(r));const a=n.length;let s=a;for(a&&n.push("-");s<r;){let r=ce;for(const n of e)n>=t&&n<r&&(r=n);const c=s+1;r-t>le((ce-i)/c)&&fe("overflow"),i+=(r-t)*c,t=r;for(const r of e)if(r<t&&++i>ce&&fe("overflow"),r===t){let e=i;for(let r=36;;r+=36){const t=r<=o?1:r>=o+26?26:r-o;if(e<t)break;const i=e-t,a=36-t;n.push(pe(he(t+i%a,0))),e=le(i/a)}n.push(pe(he(e,0))),o=de(i,c,s===a),i=0,++s}++i,++t}return n.join("")};var me=a((function e(n){var r=this;o(this,e),s(this,"classNames",[e.IFRAME_CLASS_NAME]),s(this,"getIframe",(function(){return r.iframe})),s(this,"createIframePlaceholder",(function(n){if(r.iframePlaceholder=document.createElement("div"),r.iframePlaceholder.id="".concat(r.iframeName,"-placeholder"),r.iframePlaceholder.style.width=r.width,r.iframePlaceholder.style.backgroundColor="rgba(0,0,0,.01)",r.iframePlaceholder.style.display="flex",r.iframePlaceholder.style.justifyContent="center",r.iframePlaceholder.style.alignItems="center",r.iframePlaceholder.className="".concat(e.IFRAME_CLASS_NAME,"-placeholder"),r.height.endsWith("px")&&(r.iframePlaceholder.style.height=r.height),n&&"boolean"!=typeof n)r.iframePlaceholder.appendChild(n);else{var t=r.createLoaderSVG();r.iframePlaceholder.appendChild(t)}r.container.appendChild(r.iframePlaceholder)})),s(this,"createIframe",(function(){var e=document.createElement("iframe");return e.className=r.classNames.join(" ").trim(),e.id=r.iframeName,e.name=r.iframeName,e.width=r.width,e.height=r.height,r.loading&&(e.loading=r.loading),e.style.border="0px",e.style.padding="0px",r.iframePlaceholder&&(e.style.opacity="0",e.style.position="absolute"),"0px"===r.width&&"0px"===r.height&&(e.style.position="absolute"),r.container.appendChild(e),r.payload?r.postRequest=r.createPostRequest({src:r.src,target:e.name,container:r.container,payload:r.payload}):e.src=r.src,e})),s(this,"onLoadLocal",(function(e){var n,t;r.iframePlaceholder&&(r.iframePlaceholder.remove(),r.iframe.style.position="",r.iframe.style.opacity="1",r.iframe.style.transition="opacity .5s ease-in-out"),null===(n=r.onLoad)||void 0===n||n.call(r,e),null===(t=r.postRequest)||void 0===t||t.remove()})),s(this,"createPostRequest",(function(e){var n=e.src,r=e.container,t=e.target,i=e.payload;if(!n)throw new Error("No source has been provided.");var o=document.createElement("form");return o.style.visibility="hidden",o.method="POST",o.action=n,o.target=t,o.name="".concat(t,"-form"),Object.keys(i).forEach((function(e){var n=document.createElement("input");n.type="hidden",n.name=e,n.value=i[e],o.appendChild(n)})),r.appendChild(o),null==o||o.submit(),{remove:function(){o.remove()}}})),s(this,"createSvgElement",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(n).forEach((function(e){var n=m(e,2),r=n[0],t=n[1];return i.setAttribute(r,t)})),Object.entries(r).forEach((function(e){var n=m(e,2),r=n[0],t=n[1];return i.style.setProperty(r,t)})),t.forEach((function(e){return i.appendChild(e)})),i})),s(this,"createLoaderSVG",(function(){var e=[1,2,3].map((function(e){var n=r.createSvgElement("animate",{attributeName:"opacity",dur:"1s",values:"0;1;0",repeatCount:"indefinite",begin:"".concat(e/10)});return r.createSvgElement("circle",{fill:"#ccc",stroke:"none",cx:"".concat(20*e-14),cy:"50",r:"6"},void 0,[n])}));return r.createSvgElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0"},{width:"100px",height:"100px"},e)}));var t=n.id,i=n.src,a=n.width,c=void 0===a?"100%":a,u=n.height,l=void 0===u?"100%":u,p=n.container,f=n.onLoad,h=n.loading,d=n.withIframePlaceholder,E=n.payload,v=n.className;this.width=c,this.height=l,this.onLoad=f,this.iframeName=t,this.loading=h,v&&this.classNames.push(v),this.container=p,this.payload=E,this.src=i,d&&this.createIframePlaceholder(d),this.iframe=this.createIframe(),this.iframe.addEventListener("load",this.onLoadLocal)}));s(me,"IFRAME_CLASS_NAME","quicksight-embedding-iframe");var ve="2.10.0",_e=a((function e(n,r,i,a,c,u,l){var p=this;o(this,e),s(this,"MESSAGE_RESPONSE_TIMEOUT",5e3),s(this,"iframe",null),s(this,"send",function(){var e=t(d().mark((function e(n){var r,t,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p.controlOptions.sendToControlFrame){e.next=2;break}return e.abrupt("return",p.controlOptions.sendToControlFrame(n));case 2:if(p.iframe){e.next=4;break}throw new Error("Cannot send ".concat(n.eventName,": No experience frame found"));case 4:if(t=ae(),i=new Y(n.eventName,n.eventTarget,t,Date.now(),ve,n.message,n.data),null===(r=p.iframe)||void 0===r||null===(r=r.contentWindow)||void 0===r||r.postMessage(i,p.url),n.eventName!==R.ACKNOWLEDGE){e.next=9;break}return e.abrupt("return",Promise.resolve(new $));case 9:return e.abrupt("return",new Promise((function(e,r){var i=function(n){var r,o,a=n.data;(null==a?void 0:a.eventId)===t&&(window.removeEventListener("message",i),!0===(null===(r=a.message)||void 0===r?void 0:r.success)?e(new $):!1===(null===(o=a.message)||void 0===o?void 0:o.success)?e(new J(a.message)):e(new ee(a.message)))};window.addEventListener("message",i),setTimeout((function(){window.removeEventListener("message",i),r("".concat(n.eventName," timed out"))}),p.MESSAGE_RESPONSE_TIMEOUT)})));case 10:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(this,"buildParameterString",(function(e){return e&&"object"===v(e)?Object.entries(e).map((function(e){var n=m(e,2),r=n[0],t=n[1],i=Array.isArray(t)?t:[t],o=encodeURIComponent(r);return i.map(encodeURIComponent).map((function(e){return"p.".concat(o,"=").concat(e)})).join("&")})).join("&"):""})),s(this,"buildQueryString",(function(e){var n=Object.entries(e).reduce((function(e,n){var r=m(n,2),t=r[0],i=r[1];return null!=i?f(f({},e),{},s({},t,"".concat(i))):e}),{punyCodeEmbedOrigin:Ee("".concat(window.location.origin,"/")),sdkVersion:ve});return new URLSearchParams(n).toString()})),s(this,"createExperienceIframe",(function(){p.onChange(new X(x.FRAME_STARTED,y.INFO,"Creating the frame",{experience:p.internalExperience}));try{p.setTimeoutInstance(),p.iframe=new me({id:p.experienceId,src:p.url,width:p.frameOptions.width,height:p.frameOptions.height,container:p.container,onLoad:p.onLoadHandler,withIframePlaceholder:p.frameOptions.withIframePlaceholder,className:p.frameOptions.className}).getIframe()}catch(e){throw p.onChange(new X(x.FRAME_NOT_CREATED,y.ERROR,"Failed to create the frame",{experience:p.internalExperience})),e}p.onChange(new X(x.FRAME_MOUNTED,y.INFO,"The frame mounted",{experience:p.internalExperience,frame:p.iframe}))})),s(this,"addInternalEventListener",(function(e,n){var r=function(r,t){r.eventName===e&&n(r,t)};return p.controlOptions.eventManager.addEventListener(p.experienceId,r,!0),{remove:function(){return p.controlOptions.eventManager.removeEventListener(p.experienceId,r)}}})),s(this,"validateBaseUrl",(function(e){if(!e)throw p.onChange(new X(x.NO_URL,y.ERROR,"Url is required for the experience",{experience:p.internalExperience})),new Error("Url is required for the experience");return e})),s(this,"setTimeoutInstance",(function(){p.timeoutInstance=setTimeout((function(){throw p.onChange(new X(x.FRAME_NOT_CREATED,y.ERROR,"Creating the frame timed out",{experience:p.internalExperience})),new Error("Creating the frame timed out")}),p.controlOptions.timeout)})),s(this,"onLoadHandler",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:p.timeoutInstance&&clearTimeout(p.timeoutInstance),p.onChange(new X(x.FRAME_LOADED,y.INFO,"The experience iframe loaded",{experience:p.internalExperience}));case 2:case"end":return e.stop()}}),e)})))),s(this,"getContainer",(function(e){if(!e){var n="Container is required for the experience";throw p.onChange(new X(x.NO_CONTAINER,y.ERROR,n,{experience:p.internalExperience})),new Error(n)}var r=null;if("string"==typeof e)try{r=document.querySelector(e)}catch(e){throw e instanceof Error&&p.onChange(new X(x.INVALID_CONTAINER,y.ERROR,e.message,{experience:p.internalExperience})),e}else"object"===v(e)&&e.nodeName&&(r=e);if(!r){var t="Invalid container '".concat(e,"' for the experience");throw p.onChange(new X(x.INVALID_CONTAINER,y.ERROR,t,{experience:p.internalExperience})),new Error(t)}return r})),s(this,"decorateOnChange",(function(e){return function(n){if(e){var r={frame:p.iframe};e(n,r)}}})),s(this,"decorateOnMessage",(function(e,n){return function(r){n&&p.iframe&&n(r,{frame:p.iframe}),e&&e(r,{frame:p.iframe})}})),s(this,"initializeMutationObserver",(function(){var e=new MutationObserver((function(n){n.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===p.iframe||e===p.container}))}))&&(p.controlOptions.eventManager.cleanUpCallbacksForExperience(p.experienceId),e.disconnect(),p.iframe=null,p.onChange(new X(x.FRAME_REMOVED,y.INFO,"Frame removed from the DOM",{experience:p.internalExperience})))}));e.observe(document.body,{childList:!0,subtree:!0})})),this.frameOptions=n,this.contentOptions=i,this.onChange=this.decorateOnChange(n.onChange),this.onMessage=this.decorateOnMessage(i.onMessage,l),this.container=this.getContainer(n.container),this.internalExperience=c,this.controlOptions=r,this.transformedContentOptions=a,this.experienceId=u,this.url=this.validateBaseUrl(n.url),this.controlOptions.eventManager.addEventListener(this.experienceId,this.onMessage,!0),this.initializeMutationObserver()})),we=["parameters"],Oe=function(e){function n(e,r,t,a,c,u,l){var p;return o(this,n),s(p=i(this,n,[e,r,t,a,c,u,l]),"buildExperienceUrl",(function(e){var n=p.transformedContentOptions,r=n.parameters,t=h(n,we),i=p.internalExperience,o=i.contextId,a=i.discriminator;return[e,[p.buildQueryString(f(f({},t),{},{contextId:o,discriminator:a})),p.buildParameterString(r)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(n,e),a(n)}(_e),ge=["fitToIframeWidth","locale","parameters","themeOptions","onMessage"],Ie=function(e){function n(e,r,a,c){var u;o(this,n),s(u=i(this,n,[e,r,a,c]),"setParameters",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_PARAMETERS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"reset",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.RESET)));case 1:case"end":return e.stop()}}),e)})))),s(u,"addFilterGroups",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.ADD_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"updateFilterGroups",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.UPDATE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"removeFilterGroups",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.REMOVE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"getFilterGroups",t(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_FILTER_GROUPS_FOR_VISUAL));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),s(u,"getActions",t(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_VISUAL_ACTIONS));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the actions");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),s(u,"addActions",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.ADD_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"setActions",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"removeActions",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.REMOVE_VISUAL_ACTIONS,{Actions:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"setTheme",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_THEME,{ThemeArn:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"setThemeOverride",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_THEME_OVERRIDE,{ThemeOverride:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"setPreloadThemes",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.PRELOAD_THEMES,{PreloadThemes:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"extractExperienceFromUrl",(function(e){var n,r,t=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)\/sheets\/([\w-]+)\/visuals\/([\w-]+)(\?|$)/i.exec(e)||[];if(t.length<5)throw null===(n=(r=u.frameOptions).onChange)||void 0===n||n.call(r,new X(x.INVALID_URL,y.ERROR,"Invalid visual experience url",{url:e}),{frame:u.experienceFrame.iframe}),new Error("Invalid visual experience URL");return{experienceType:D.VISUAL,dashboardId:t[1],sheetId:t[2],visualId:t[3]}})),s(u,"interceptMessage",(function(e,n){var r,t,i,o,a;"SIZE_CHANGED"===e.eventName&&u.frameOptions.resizeHeightOnSizeChangedEvent&&(null==n||null===(i=n.frame)||void 0===i||null===(o=i.setAttribute)||void 0===o||o.call(i,"height","".concat(null===(a=e.message)||void 0===a?void 0:a.height,"px")));"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(r=u.contentOptions)&&void 0!==r&&null!==(r=r.themeOptions)&&void 0!==r&&r.themeOverride&&u.setThemeOverride(u.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(t=u.contentOptions)&&void 0!==t&&null!==(t=t.themeOptions)&&void 0!==t&&t.preloadThemes&&u.setPreloadThemes(u.contentOptions.themeOptions.preloadThemes)})),s(u,"transformVisualContentOptions",(function(e){var n=e.fitToIframeWidth,r=e.locale,t=e.parameters,i=e.themeOptions;e.onMessage;var o=h(e,ge),a=u.transformContentOptions({fitToIframeWidth:null==n||n,locale:r},o);return Array.isArray(t)&&(a.parameters=t.reduce((function(e,n){return f(f({},e),{},s({},n.Name,n.Values))}),{})),null!=i&&i.themeArn&&(a.themeArn=i.themeArn),a})),u.experience=u.extractExperienceFromUrl(e.url);var l=u.getInternalExperienceInfo(u.experience),p=l.experienceIdentifier,E=l.internalExperience;return u.internalExperience=E,u.experienceId=p,u.experienceFrame=new Oe(e,a,r,u.transformVisualContentOptions(r),E,p,u.interceptMessage),u}return u(n,e),a(n)}(se),Ae=function(e){function n(e,r,t,a,c,u,l){var p;return o(this,n),s(p=i(this,n,[e,r,t,a,c,u,l]),"buildExperienceUrl",(function(e){var n=p.internalExperience,r=n.contextId,t=n.discriminator;return[e,p.buildQueryString(f(f({},p.transformedContentOptions),{},{contextId:r,discriminator:t}))].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(n,e),a(n)}(_e),Te=["locale","toolbarOptions","onMessage"],Se=function(e){function n(e,r,a,c){var u;o(this,n),s(u=i(this,n,[e,r,a,c]),"createSharedView",t(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("DASHBOARD"===u.currentPage||"DASHBOARD_SHEET"===u.currentPage||"DASHBOARD_VIEW"===u.currentPage){e.next=2;break}throw new Error("Cannot call createSharedView from this page");case 2:return e.next=4,u.send(new W(R.CREATE_SHARED_VIEW));case 4:if(null!=(n=e.sent)&&n.message){e.next=7;break}throw new Error("Failed to create shared view");case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e)})))),s(u,"toggleExecutiveSummaryPane",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("DASHBOARD"===u.currentPage){e.next=2;break}throw new Error("Cannot call toggleExecutiveSummaryPane from this page");case 2:return e.abrupt("return",u.send(new W(R.TOGGLE_EXECUTIVE_SUMMARY_PANE)));case 3:case"end":return e.stop()}}),e)})))),s(u,"openDataQnAPane",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.OPEN_DATA_QNA_PANE)));case 1:case"end":return e.stop()}}),e)})))),s(u,"openBuildVisualPane",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.OPEN_BUILD_VISUAL_PANE)));case 1:case"end":return e.stop()}}),e)})))),s(u,"interceptMessage",(function(e,n){var r;e.eventName===R.PAGE_NAVIGATION&&(u.currentPage=null==e||null===(r=e.message)||void 0===r?void 0:r.pageType)})),s(u,"extractExperienceFromUrl",(function(e){var n,r;if((/^https:\/\/[^/]+\/embedding\/[^/]+\/(start(\/(favorites|dashboards|analyses))?|dashboards\/[\w-]+(\/views\/[\w-]+)?|analyses\/[\w-]+)(\?|$)/i.exec(e)||[]).length<5)throw null===(n=(r=u.frameOptions).onChange)||void 0===n||n.call(r,new X(x.INVALID_URL,y.ERROR,"Invalid console experience url",{url:e}),{frame:u.experienceFrame.iframe}),new Error("Invalid console experience URL");return{experienceType:D.CONSOLE}})),s(u,"transformConsoleContentOptions",(function(e){var n=e.locale,r=e.toolbarOptions;e.onMessage;var t=h(e,Te),i=u.transformContentOptions({locale:n},t);return!0===(null==r?void 0:r.executiveSummary)&&(i.showExecutiveSummaryIcon=!0),!0===(null==r?void 0:r.dataQnA)&&(i.showDataQnAIcon=!0),!0===(null==r?void 0:r.buildVisual)&&(i.showBuildVisualIcon=!0),i})),u.experience=u.extractExperienceFromUrl(e.url);var l=u.getInternalExperienceInfo(u.experience),p=l.experienceIdentifier,f=l.internalExperience;u.internalExperience=f,u.experienceId=p,r.locale,r.onMessage;var E=u.transformConsoleContentOptions(r);return u.experienceFrame=new Ae(e,a,r,E,f,p,u.interceptMessage),u.currentPage="START",u}return u(n,e),a(n)}(se),xe=["parameters"],Re=function(e){function n(e,r,t,a,c,u,l){var p;return o(this,n),s(p=i(this,n,[e,r,t,a,c,u,l]),"buildExperienceUrl",(function(e){var n=p.transformedContentOptions,r=n.parameters,t=h(n,xe),i=p.internalExperience,o=i.contextId,a=i.discriminator,s=p.contentOptions.viewId;if(s){var c=new URL(e);c.pathname=c.pathname.concat("/views/"+s),e=c.href}return[e,[p.buildQueryString(f(f({},t),{},{contextId:o,discriminator:a})),p.buildParameterString(r)].join("#")].join(e.includes("?")?"&":"?")})),p.url=p.buildExperienceUrl(e.url),p.createExperienceIframe(),p}return u(n,e),a(n)}(_e),ye=["parameters","locale","attributionOptions","sheetOptions","toolbarOptions","themeOptions","onMessage"],Ne=function(e){function n(e,r,a,c){var u;o(this,n),s(u=i(this,n,[e,r,a,c]),"initiatePrint",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.INITIATE_PRINT)));case 1:case"end":return e.stop()}}),e)})))),s(u,"undo",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.UNDO)));case 1:case"end":return e.stop()}}),e)})))),s(u,"redo",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.REDO)));case 1:case"end":return e.stop()}}),e)})))),s(u,"toggleExecutiveSummaryPane",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.TOGGLE_EXECUTIVE_SUMMARY_PANE)));case 1:case"end":return e.stop()}}),e)})))),s(u,"toggleBookmarksPane",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.TOGGLE_BOOKMARKS_PANE)));case 1:case"end":return e.stop()}}),e)})))),s(u,"toggleThresholdAlertsPane",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.TOGGLE_THRESHOLD_ALERTS_PANE)));case 1:case"end":return e.stop()}}),e)})))),s(u,"toggleSchedulingPane",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.TOGGLE_SCHEDULING_PANE)));case 1:case"end":return e.stop()}}),e)})))),s(u,"toggleRecentSnapshotsPane",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.TOGGLE_RECENT_SNAPSHOTS_PANE)));case 1:case"end":return e.stop()}}),e)})))),s(u,"getParameters",t(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_PARAMETERS));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the parameters");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),s(u,"getSheets",t(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_SHEETS));case 2:if(n=e.sent,Array.isArray(null==n?void 0:n.message)){e.next=5;break}throw new Error("Failed to retrieve the sheets");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),s(u,"addFilterGroups",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.ADD_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"updateFilterGroups",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.UPDATE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"removeFilterGroups",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.REMOVE_FILTER_GROUPS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"getFilterGroupsForSheet",function(){var e=t(d().mark((function e(n){var r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_FILTER_GROUPS_FOR_SHEET,{SheetId:n}));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the sheet");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"getFilterGroupsForVisual",function(){var e=t(d().mark((function e(n,r){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_FILTER_GROUPS_FOR_VISUAL,{SheetId:n,VisualId:r}));case 2:if(t=e.sent,Array.isArray(null==t?void 0:t.message)){e.next=5;break}throw new Error("Failed to retrieve filter groups for the visual");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})));return function(n,r){return e.apply(this,arguments)}}()),s(u,"getVisualActions",function(){var e=t(d().mark((function e(n,r){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_VISUAL_ACTIONS,{SheetId:n,VisualId:r}));case 2:if(t=e.sent,Array.isArray(null==t?void 0:t.message)){e.next=5;break}throw new Error("Failed to retrieve the visual actions");case 5:return e.abrupt("return",t.message);case 6:case"end":return e.stop()}}),e)})));return function(n,r){return e.apply(this,arguments)}}()),s(u,"addVisualActions",function(){var e=t(d().mark((function e(n,r,t){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.ADD_VISUAL_ACTIONS,{SheetId:n,VisualId:r,Actions:t})));case 1:case"end":return e.stop()}}),e)})));return function(n,r,t){return e.apply(this,arguments)}}()),s(u,"setVisualActions",function(){var e=t(d().mark((function e(n,r,t){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_VISUAL_ACTIONS,{SheetId:n,VisualId:r,Actions:t})));case 1:case"end":return e.stop()}}),e)})));return function(n,r,t){return e.apply(this,arguments)}}()),s(u,"getSelectedSheetId",t(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_SELECTED_SHEET_ID));case 2:if(null!=(n=e.sent)&&n.message){e.next=5;break}throw new Error("Failed to retrieve the selected sheet id");case 5:return e.abrupt("return",n.message);case 6:case"end":return e.stop()}}),e)})))),s(u,"setSelectedSheetId",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_SELECTED_SHEET_ID,{SheetId:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"setTheme",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_THEME,{ThemeArn:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"navigateToDashboard",function(){var e=t(d().mark((function e(n,r){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.NAVIGATE_TO_DASHBOARD,{DashboardId:n,Parameters:null==r?void 0:r.parameters})));case 1:case"end":return e.stop()}}),e)})));return function(n,r){return e.apply(this,arguments)}}()),s(u,"removeVisualActions",function(){var e=t(d().mark((function e(n,r,t){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.REMOVE_VISUAL_ACTIONS,{SheetId:n,VisualId:r,Actions:t})));case 1:case"end":return e.stop()}}),e)})));return function(n,r,t){return e.apply(this,arguments)}}()),s(u,"getSheetVisuals",function(){var e=t(d().mark((function e(n){var r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.GET_SHEET_VISUALS,{SheetId:n}));case 2:if(r=e.sent,Array.isArray(null==r?void 0:r.message)){e.next=5;break}throw new Error("Failed to retrieve the sheet visuals");case 5:return e.abrupt("return",r.message);case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"setParameters",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_PARAMETERS,n)));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"reset",t(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.RESET)));case 1:case"end":return e.stop()}}),e)})))),s(u,"setThemeOverride",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.SET_THEME_OVERRIDE,{ThemeOverride:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"setPreloadThemes",function(){var e=t(d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.send(new W(R.PRELOAD_THEMES,{PreloadThemes:n})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),s(u,"createSharedView",t(d().mark((function e(){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.send(new W(R.CREATE_SHARED_VIEW));case 2:if(null!=(n=e.sent)&&n.message){e.next=5;break}throw new Error("Failed to create shared view");case 5:return e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))),s(u,"extractExperienceFromUrl",(function(e){var n,r,t=/^https:\/\/[^/]+\/embed\/[^/]+\/dashboards\/([\w-]+)(\?|$)/i.exec(e)||[];if(t.length<3)throw null===(n=(r=u.frameOptions).onChange)||void 0===n||n.call(r,new X(x.INVALID_URL,y.ERROR,"Invalid dashboard experience url",{url:e}),{frame:null}),new Error("Invalid dashboard experience URL");return{experienceType:D.DASHBOARD,dashboardId:t[1]}})),s(u,"interceptMessage",(function(e,n){var r,t,i,o,a;"SIZE_CHANGED"===e.eventName&&u.frameOptions.resizeHeightOnSizeChangedEvent&&(null==n||null===(i=n.frame)||void 0===i||null===(o=i.setAttribute)||void 0===o||o.call(i,"height","".concat(null==e||null===(a=e.message)||void 0===a?void 0:a.height,"px")));"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(r=u.contentOptions)&&void 0!==r&&null!==(r=r.themeOptions)&&void 0!==r&&r.themeOverride&&u.setThemeOverride(u.contentOptions.themeOptions.themeOverride),"EXPERIENCE_INITIALIZED"===e.eventName&&null!==(t=u.contentOptions)&&void 0!==t&&null!==(t=t.themeOptions)&&void 0!==t&&t.preloadThemes&&u.setPreloadThemes(u.contentOptions.themeOptions.preloadTh