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