@datadog/ui-apps-sdk
Advanced tools
Comparing version 0.10.2 to 0.10.3
@@ -17,2 +17,3 @@ export declare enum Host { | ||
DASHBOARD_TIMEFRAME_CHANGE = "dashboard_timeframe_change", | ||
DASHBOARD_CURSOR_CHANGE = "dashboard_cursor_change", | ||
DASHBOARD_TEMPLATE_VAR_CHANGE = "dashboard_template_var_change", | ||
@@ -40,8 +41,9 @@ DASHBOARD_CUSTOM_WIDGET_OPTIONS_CHANGE = "dashboard_custom_widget_options_change", | ||
CLOSE_SIDE_PANEL = "close_side_panel", | ||
SET_SECRET = "set_secret", | ||
STORE_SECRET = "store_secret", | ||
REMOVE_SECRET = "remove_secret", | ||
GET_ALL_SECRETS = "get_all_secrets", | ||
LOAD_ALL_SECRETS = "load_all_secrets", | ||
REMOVE_ALL_SECRETS = "remove_all_secrets", | ||
LOAD_SECRET = "load_secret", | ||
GET_SECRET = "get_secret", | ||
DECRYPT_SECRET = "decrypt_secret" | ||
SET_SECRET = "set_secret" | ||
} | ||
@@ -48,0 +50,0 @@ export declare const enabledEvents: Set<UiAppEventType>; |
@@ -10,2 +10,3 @@ import type { ChildClient } from '@datadog/framepost'; | ||
[UiAppEventType.DASHBOARD_TIMEFRAME_CHANGE]: Timeframe; | ||
[UiAppEventType.DASHBOARD_CURSOR_CHANGE]: number | null; | ||
[UiAppEventType.DASHBOARD_TEMPLATE_VAR_CHANGE]: TemplateVariableValue[]; | ||
@@ -12,0 +13,0 @@ [UiAppEventType.DASHBOARD_CUSTOM_WIDGET_OPTIONS_CHANGE]: { |
@@ -9,14 +9,15 @@ import type { ChildClient } from '@datadog/framepost'; | ||
private registerRequestHandlers; | ||
private handleSetSecretRequest; | ||
private handleGetSecretRequest; | ||
private handleGetAllSecretsRequest; | ||
private handleStoreSecretRequest; | ||
private handleLoadSecretRequest; | ||
private handleLoadAllSecretsRequest; | ||
private handleRemoveSecretRequest; | ||
private handleRemoveAllSecretsRequest; | ||
get(key: string): Promise<any>; | ||
set(key: string, data: string): Promise<any>; | ||
} | ||
export interface SetSecretRequest { | ||
export interface StoreSecretRequest { | ||
key: string; | ||
secret: string; | ||
} | ||
export interface GetAllSecretsRequest { | ||
export interface LoadAllSecretsRequest { | ||
prefix: string; | ||
@@ -27,3 +28,3 @@ } | ||
} | ||
export interface GetSecretRequest { | ||
export interface LoadSecretRequest { | ||
key: string; | ||
@@ -30,0 +31,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DD_SDK=t():e.DD_SDK=t()}(self,(function(){return e={145:function(e){self,e.exports=function(){"use strict";var e={573:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ChildClient=void 0;var o=n(601),s=n(473),a=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.context=t.context||null,n.initListener=n.initListener.bind(n),window.addEventListener("message",n.initListener),n.profile&&n.onRequest(o.REQUEST_KEY_GET_PROFILE,(function(){return n.profiler.getEvents()})),n.setInitTimer(),n}return i(t,e),t.prototype.getLogger=function(){return s.getLogger("child-client",this.debug)},t.prototype.onChannelInit=function(e){window.removeEventListener("message",this.initListener),this.messagePort=e.ports[0];var t=this.getInitMessage(this.context);this.messagePort.postMessage(t),this.profiler.logEvent(o.ProfileEventType.POST_MESSAGE,t)},t.prototype.destroy=function(){this.messagePort&&this.messagePort.close(),this.initTimer&&clearTimeout(this.initTimer),window.removeEventListener("message",this.initListener)},t}(n(416).SharedClient);t.ChildClient=a},601:function(e,t){var n,r,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.REQUEST_KEY_GET_PROFILE=t.REQUEST_TIMEOUT=t.SerializationType=t.TransactionDirection=t.ProfileEventType=t.MessageAPIVersion=t.MessageType=void 0,(o=t.MessageType||(t.MessageType={})).CHANNEL_INIT="channel_init",o.EVENT="event",o.REQUEST="request",o.RESPONSE="response",o.ERROR_RESPONSE="error_response",(t.MessageAPIVersion||(t.MessageAPIVersion={})).v1="framepost/v1",(i=t.ProfileEventType||(t.ProfileEventType={})).POST_MESSAGE="post_message",i.RECEIVE_MESSAGE="receive_message",(r=t.TransactionDirection||(t.TransactionDirection={})).UP="up",r.DOWN="down",(n=t.SerializationType||(t.SerializationType={})).NONE="none",n.ERROR="error",t.REQUEST_TIMEOUT=2e4,t.REQUEST_KEY_GET_PROFILE="framepost_get_profile"},758:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.RequestTimeoutError=t.HandshakeTimeoutError=void 0;var i=function(e){function t(){var t=e.call(this,"Handshake timed out")||this;return t.name="HandshakeTimeoutError",t}return r(t,e),t}(Error);t.HandshakeTimeoutError=i;var o=function(e){function t(){var t=e.call(this,"Request timed out")||this;return t.name="RequestTimeoutError",t}return r(t,e),t}(Error);t.RequestTimeoutError=o},607:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ParentClient=t.ChildClient=void 0;var o=n(573);Object.defineProperty(t,"ChildClient",{enumerable:!0,get:function(){return o.ChildClient}});var s=n(166);Object.defineProperty(t,"ParentClient",{enumerable:!0,get:function(){return s.ParentClient}}),i(n(699),t),i(n(758),t)},473:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLogger=void 0,t.getLogger=function(e,t){return t?{log:function(t){return console.log(e+": "+t)},error:function(t){return console.error(e+": "+t)}}:{log:function(){},error:function(){}}}},166:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ParentClient=void 0;var a=n(601),u=n(473),c=n(416),l=n(593),p=function(e){function t(t){return void 0===t&&(t={}),e.call(this,t)||this}return i(t,e),t.prototype.requestChannel=function(e,t){if(this.url=new URL(e.src),e.contentWindow){var n=new MessageChannel;this.messagePort=n.port1;var r=this.getInitMessage(t);this.messagePort.onmessage=this.initListener.bind(this),this.setInitTimer(),e.contentWindow.postMessage(r,this.url.origin,[n.port2]),this.profiler.logEvent(a.ProfileEventType.POST_MESSAGE,r)}},t.prototype.getMessageProfile=function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.request(a.REQUEST_KEY_GET_PROFILE)];case 1:return e=n.sent(),t=this.profiler.getEvents(),[2,l.profileMessages(t,e)]}}))}))},t.prototype.onChannelInit=function(){},t.prototype.getLogger=function(){return u.getLogger("parent-client",this.debug)},t.prototype.destroy=function(){this.messagePort&&this.messagePort.close(),this.initTimer&&clearTimeout(this.initTimer)},t}(c.SharedClient);t.ParentClient=p},819:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getProfiler=void 0,t.getProfiler=function(e){var t=[];return{logEvent:function(n,r){e&&t.push({type:n,message:r,date:new Date})},getEvents:function(){return t}}}},416:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SharedClient=void 0;var o=n(601),s=n(758),a=n(819),u=n(593),c=function(){function e(e){var t=this,n=void 0===e?{}:e,r=n.debug,i=void 0!==r&&r,s=n.profile,c=void 0!==s&&s,l=n.requestTimeout,p=void 0===l?o.REQUEST_TIMEOUT:l;this.debug=i,this.profile=c,this.requestTimeout=p,this.channel=u.defer(),this.eventSubscriptions={},this.responseSubscriptions={},this.requestSubscriptions={},this.logger=this.getLogger(),this.profiler=a.getProfiler(c),this.channel.promise.then((function(){t.logger.log("Secure parent <-> child channel established")})).catch((function(e){t.logger.log(e)}))}return e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.postMessage(o.MessageType.EVENT,e,t)]}))}))},e.prototype.on=function(e,t){var n=this;this.eventSubscriptions[e]||(this.eventSubscriptions[e]={});var r=u.randomInsecureId(8);return this.eventSubscriptions[e][r]=t,this.logger.log('Registered handler for event "'+e+'"'),function(){n.eventSubscriptions[e]=u.omit(n.eventSubscriptions[e],r),n.logger.log("Unsubscribed handler for event "+e)}},e.prototype.request=function(e,t){return r(this,void 0,void 0,(function(){var n,r,a=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.postMessage(o.MessageType.REQUEST,e,t)];case 1:return n=i.sent(),r=function(){a.responseSubscriptions=u.omit(a.responseSubscriptions,n.id)},[2,new Promise((function(e,t){var i;a.responseSubscriptions[n.id]=function(n,s){clearTimeout(i),r(),s.type===o.MessageType.ERROR_RESPONSE?t(n):e(n)},i=setTimeout((function(){r(),t(new s.RequestTimeoutError)}),a.requestTimeout)}))]}}))}))},e.prototype.onRequest=function(e,t){var n=this;return this.requestSubscriptions[e]=function(s,a){return r(n,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t(s,a)];case 1:return n=i.sent(),this.postMessage(o.MessageType.RESPONSE,e,n,a.id),[3,3];case 2:return r=i.sent(),this.postMessage(o.MessageType.ERROR_RESPONSE,e,r,a.id),[3,3];case 3:return[2]}}))}))},function(){n.requestSubscriptions=u.omit(n.requestSubscriptions,e)}},e.prototype.getContext=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.channel.promise];case 1:return[2,e.sent().context]}}))}))},e.prototype.messageListener=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.channel.promise];case 1:case 2:return r.sent(),[3,3];case 3:if(t=this.isValidMessage(e),n=u.deserialize(e.data),t){switch(n.type){case o.MessageType.EVENT:this.handleEvent(n);break;case o.MessageType.REQUEST:this.handleRequest(n);break;case o.MessageType.ERROR_RESPONSE:case o.MessageType.RESPONSE:this.handleResponse(n)}this.profiler.logEvent(o.ProfileEventType.RECEIVE_MESSAGE,n)}else this.logger.error("Invalid message format. Skipping.");return[2]}}))}))},e.prototype.handleEvent=function(e){var t=this.eventSubscriptions[e.key];t&&Object.values(t).forEach((function(t){return t(e.data,e)}))},e.prototype.handleRequest=function(e){var t=this.requestSubscriptions[e.key];t&&(t(e.data,e),this.logger.log("Handled request type "+e.key))},e.prototype.handleResponse=function(e){var t=e.requestId,n=t&&this.responseSubscriptions[t];n&&n(e.data,e)},e.prototype.postMessage=function(e,t,n,s){return r(this,void 0,void 0,(function(){var r,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.channel.promise];case 1:return r=i.sent().port,a=u.serialize({type:e,apiVersion:o.MessageAPIVersion.v1,key:t,data:n,id:u.randomInsecureId(),requestId:s}),r.postMessage(a),this.profiler.logEvent(o.ProfileEventType.POST_MESSAGE,a),[2,a]}}))}))},e.prototype.setInitTimer=function(){var e=this;this.initTimer=setTimeout((function(){e.channel.reject(new s.HandshakeTimeoutError),e.destroy()}),this.requestTimeout)},e.prototype.initListener=function(e){this.isInitMessage(e)?(this.profiler.logEvent(o.ProfileEventType.RECEIVE_MESSAGE,e.data),this.initTimer&&clearTimeout(this.initTimer),this.onChannelInit(e),this.messagePort&&(this.messagePort.onmessage=this.messageListener.bind(this)),this.resolveChannel(e)):this.logger.error("Invalid message format. Skipping.")},e.prototype.isValidMessage=function(e){var t=e.data;return t.type&&t.id&&t.apiVersion===o.MessageAPIVersion.v1},e.prototype.isInitMessage=function(e){return this.isValidMessage(e)&&e.data.type===o.MessageType.CHANNEL_INIT},e.prototype.resolveChannel=function(e){if(this.messagePort){var t={port:this.messagePort,origin:e.origin,context:e.data.data};this.channel.resolve(t)}},e.prototype.getInitMessage=function(e){return u.serialize({type:o.MessageType.CHANNEL_INIT,apiVersion:o.MessageAPIVersion.v1,key:"",data:e,id:u.randomInsecureId()})},e}();t.SharedClient=c},699:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},593:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.deserialize=t.serialize=t.profileMessages=t.omit=t.randomInsecureId=t.defer=void 0;var s=n(601);t.defer=function(){var e=function(){},t=function(){},n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}},t.randomInsecureId=function(e){return void 0===e&&(e=16),o(Array(e)).map((function(){return(~~(36*Math.random())).toString(36)})).join("")},t.omit=function(e,t){var n=e,r=t;return n[r],i(n,["symbol"==typeof r?r:r+""])},t.profileMessages=function(e,t){var n,r,i=e.concat(t).filter((function(e){return e.type===s.ProfileEventType.RECEIVE_MESSAGE})),o=(n=function(e){return e.message.id},r={},i.forEach((function(e){r[n(e)]=e})),r),a=[],u=function(e){var t=e.date,n=e.message,r={id:n.id,direction:s.TransactionDirection.DOWN,postTime:t,message:n},i=o[n.id];return i&&(r.receiveTime=i.date,r.duration=(i.date.getTime()-t.getTime())/1e3),r};return e.filter((function(e){return e.type===s.ProfileEventType.POST_MESSAGE})).forEach((function(e){var t=u(e);a.push(t)})),t.filter((function(e){return e.type===s.ProfileEventType.POST_MESSAGE})).forEach((function(e){var t=u(e);t.direction=s.TransactionDirection.UP,a.push(t)})),a.filter((function(e){return e.message.key!==s.REQUEST_KEY_GET_PROFILE})).sort((function(e,t){return e.postTime.getTime()-t.postTime.getTime()}))};var a=function(e){var t=e.name,n=e.message,r=e.stack,i=new Error(n);return i.name=t,i.stack=r,i};t.serialize=function(e){var t,n=e.data,i=s.SerializationType.NONE;return n instanceof Error&&(i=s.SerializationType.ERROR,n={message:(t=n).message,name:t.name,stack:t.stack}),r(r({},e),{serialization:i,data:n})},t.deserialize=function(e){return e.serialization===s.SerializationType.ERROR?r(r({},e),{data:a(e.data)}):e}}},t={};return function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(607)}()},724:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDAPIClient=void 0;var o=n(601),s=n(152),a=function(){function e(e,t,n){this.debug=e,this.logger=t,this.framePostClient=n,this.v1=new s.DDAPIV1Client(this)}return e.prototype.request=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.framePostClient.request(o.UiAppRequestType.API_REQUEST,e)]}))}))},e.prototype.get=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.request({method:o.IFrameApiRequestMethod.GET,resource:e,options:t,body:null})]}))}))},e.prototype.post=function(e,t,n){return void 0===n&&(n={}),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.request({method:o.IFrameApiRequestMethod.POST,resource:e,options:n,body:t})]}))}))},e.prototype.put=function(e,t,n){return void 0===n&&(n={}),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.request({method:o.IFrameApiRequestMethod.PUT,resource:e,options:n,body:t})]}))}))},e.prototype.patch=function(e,t,n){return void 0===n&&(n={}),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.request({method:o.IFrameApiRequestMethod.PATCH,resource:e,options:n,body:t})]}))}))},e.prototype.delete=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.request({method:o.IFrameApiRequestMethod.DELETE,resource:e,options:t,body:null})]}))}))},e}();t.DDAPIClient=a},152:function(e,t,n){"use strict";t.__esModule=!0,t.DDAPIV1Client=void 0;var r=n(445);t.DDAPIV1Client=function(e){this.metrics=new r.DDMetricsAPIClient(e)}},445:function(e,t){"use strict";t.__esModule=!0,t.DDMetricsAPIClient=void 0;var n=function(){function e(e){this.apiClient=e}return e.prototype.getMetadata=function(e){return this.apiClient.get("/api/v1/metrics/"+e)},e.prototype.listActiveMetrics=function(e){return this.apiClient.get("/api/v1/metrics",{params:e})},e.prototype.search=function(e){return this.apiClient.get("/api/v1/search",{params:e})},e.prototype.query=function(e){return this.apiClient.get("/api/v1/query",{params:e})},e}();t.DDMetricsAPIClient=n},883:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDClient=void 0;var o=n(145),s=n(724),a=n(601),u=n(114),c=n(391),l=n(955),p=n(979),f=n(964),h=n(645),d={host:a.Host.STAGE,debug:!1},y=function(){function e(e){void 0===e&&(e={}),this.host=e.host||d.host,this.debug=e.debug||d.debug,this.framePostClient=new o.ChildClient({debug:this.debug,profile:this.debug,context:{sdkVersion:"0.10.2"}}),this.logger=h.getLogger(e),this.api=new s.DDAPIClient(this.debug,this.logger,this.framePostClient),this.events=new u.DDEventsClient(this.debug,this.logger,this.framePostClient),this.location=new c.DDLocationClient(this.debug,this.logger,this.framePostClient),this.modal=new l.DDModalClient(this.debug,this.logger,this.framePostClient),this.sidePanel=new f.DDSidePanelClient(this.debug,this.logger,this.framePostClient),this.secrets=new p.DDSecretsClient(this.debug,this.logger,this.framePostClient)}return e.prototype.getContext=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.framePostClient.getContext()]}))}))},e}();t.DDClient=y},432:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDFeatureClient=void 0;var o=n(974),s=function(){function e(e,t,n,r){this.debug=e,this.logger=t,this.framePostClient=n,this.featureType=r}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.framePostClient.getContext()];case 1:return e=t.sent().app.features,[2,o.isFeatureEnabled(this.featureType,e)]}}))}))},e.prototype.validateFeatureIsEnabled=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.isEnabled()];case 1:if(!e.sent())throw new Error('Please enable the "'+this.featureType+'" feature to access this functionality.');return[2]}}))}))},e}();t.DDFeatureClient=s},601:function(e,t){"use strict";var n,r,i,o,s,a,u;t.__esModule=!0,t.ModalActionLevel=t.ModalSize=t.enabledEvents=t.UiAppRequestType=t.IFrameApiRequestMethod=t.UiAppEventType=t.UiAppFeatureType=t.Host=void 0,(u=t.Host||(t.Host={})).PROD="https://app.datadoghq.com/",u.STAGE="https://dd.datad0g.com/",(a=t.UiAppFeatureType||(t.UiAppFeatureType={})).DASHBOARD_COG_MENU="dashboard_cog_menu",a.DASHBOARD_CONTEXT_MENU="dashboard_context_menu",a.DASHBOARD_CUSTOM_WIDGET="dashboard_custom_widget",a.MODALS="modals",a.SIDE_PANELS="side_panels",function(e){e.CUSTOM_EVENT="custom_event",e.DASHBOARD_COG_MENU_CLICK="dashboard_cog_menu_click",e.DASHBOARD_CONTEXT_MENU_CLICK="dashboard_context_menu_click",e.DASHBOARD_TIMEFRAME_CHANGE="dashboard_timeframe_change",e.DASHBOARD_TEMPLATE_VAR_CHANGE="dashboard_template_var_change",e.DASHBOARD_CUSTOM_WIDGET_OPTIONS_CHANGE="dashboard_custom_widget_options_change",e.MODAL_CLOSE="modal_close",e.MODAL_ACTION="modal_action",e.MODAL_CANCEL="modal_cancel",e.SIDE_PANEL_CLOSE="side_panel_close"}(n=t.UiAppEventType||(t.UiAppEventType={})),(s=t.IFrameApiRequestMethod||(t.IFrameApiRequestMethod={})).GET="GET",s.POST="POST",s.PUT="PUT",s.PATCH="PATCH",s.DELETE="DELETE",(o=t.UiAppRequestType||(t.UiAppRequestType={})).API_REQUEST="api_request",o.EVENT_BROADCAST="event_broadcast",o.NAVIGATE_TOP="navigate_top",o.OPEN_MODAL="open_modal",o.CLOSE_MODAL="close_modal",o.OPEN_SIDE_PANEL="open_side_panel",o.CLOSE_SIDE_PANEL="close_side_panel",o.SET_SECRET="set_secret",o.REMOVE_SECRET="remove_secret",o.GET_ALL_SECRETS="get_all_secrets",o.REMOVE_ALL_SECRETS="remove_all_secrets",o.GET_SECRET="get_secret",o.DECRYPT_SECRET="decrypt_secret",t.enabledEvents=new Set([n.CUSTOM_EVENT]),(i=t.ModalSize||(t.ModalSize={})).SMALL="sm",i.MEDIUM="md",i.LARGE="lg",(r=t.ModalActionLevel||(t.ModalActionLevel={})).PRIMARY="primary",r.SUCCESS="success",r.WARNING="warning",r.DANGER="danger"},114:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDEventsClient=void 0;var o=n(601),s=n(974),a=function(){function e(e,t,n){this.debug=e,this.logger=t,this.framePostClient=n}return e.prototype.on=function(e,t){var n=this,r=this.framePostClient.on(e,t);return this.framePostClient.getContext().then((function(t){s.isEventEnabled(e,t.app.features)||(r(),n.logger.error("Your app does not have the required features enabled to respond to events of type "+e+"."))})).catch((function(){})),r},e.prototype.onCustom=function(e,t){return this.on(o.UiAppEventType.CUSTOM_EVENT,(function(n){n.eventType===e&&t(n.data)}))},e.prototype.broadcast=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.framePostClient.request(o.UiAppRequestType.EVENT_BROADCAST,{eventType:e,data:t})]}))}))},e}();t.DDEventsClient=a},309:function(e,t,n){"use strict";t.__esModule=!0,t.dashboardCogMenu=void 0;var r=n(601);t.dashboardCogMenu={type:r.UiAppFeatureType.DASHBOARD_COG_MENU,events:[r.UiAppEventType.DASHBOARD_COG_MENU_CLICK]}},622:function(e,t,n){"use strict";t.__esModule=!0,t.dashboardContextMenu=void 0;var r=n(601);t.dashboardContextMenu={type:r.UiAppFeatureType.DASHBOARD_CONTEXT_MENU,events:[r.UiAppEventType.DASHBOARD_CONTEXT_MENU_CLICK]}},828:function(e,t,n){"use strict";t.__esModule=!0,t.dashboardCustomWidget=void 0;var r=n(601);t.dashboardCustomWidget={type:r.UiAppFeatureType.DASHBOARD_CUSTOM_WIDGET,events:[r.UiAppEventType.DASHBOARD_CUSTOM_WIDGET_OPTIONS_CHANGE,r.UiAppEventType.DASHBOARD_TEMPLATE_VAR_CHANGE,r.UiAppEventType.DASHBOARD_TIMEFRAME_CHANGE]}},582:function(e,t,n){"use strict";t.__esModule=!0,t.features=void 0;var r=n(309),i=n(622),o=n(828),s=n(938),a=n(713);t.features=[r.dashboardCogMenu,i.dashboardContextMenu,o.dashboardCustomWidget,s.modals,a.sidePanels]},938:function(e,t,n){"use strict";t.__esModule=!0,t.modals=void 0;var r=n(601);t.modals={type:r.UiAppFeatureType.MODALS,events:[r.UiAppEventType.MODAL_CLOSE,r.UiAppEventType.MODAL_CANCEL,r.UiAppEventType.MODAL_ACTION]}},713:function(e,t,n){"use strict";t.__esModule=!0,t.sidePanels=void 0;var r=n(601);t.sidePanels={type:r.UiAppFeatureType.SIDE_PANELS,events:[r.UiAppEventType.SIDE_PANEL_CLOSE]}},607:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};t.__esModule=!0,t.DDClient=t.init=void 0;var o,s=n(883);t.DDClient=s.DDClient,t.init=function(e,t){return o||(o=new s.DDClient(e)),t&&o.getContext().then(t),o},i(n(699),t),i(n(601),t)},391:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDLocationClient=void 0;var o=n(601),s=function(){function e(e,t,n){this.debug=e,this.logger=t,this.framePostClient=n}return e.prototype.goTo=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.framePostClient.request(o.UiAppRequestType.NAVIGATE_TOP,{url:e})]}))}))},e}();t.DDLocationClient=s},955:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDModalClient=void 0;var a=n(432),u=n(601),c=n(974),l=function(e){function t(t,n,r){return e.call(this,t,n,r,u.UiAppFeatureType.MODALS)||this}return i(t,e),t.prototype.open=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.validateFeatureIsEnabled()];case 1:return t.sent(),c.validateKey(e)?[2,this.framePostClient.request(u.UiAppRequestType.OPEN_MODAL,e)]:[2]}}))}))},t.prototype.close=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.validateFeatureIsEnabled()];case 1:return t.sent(),[2,this.framePostClient.request(u.UiAppRequestType.CLOSE_MODAL,e)]}}))}))},t}(a.DDFeatureClient);t.DDModalClient=l},979:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};t.__esModule=!0,t.DDSecretsClient=void 0;var s=n(601),a=function(){return o(Array(window.localStorage.length)).map((function(e,t){return window.localStorage.key(t)}))},u=function(){function e(e,t,n){this.debug=e,this.logger=t,this.framePostClient=n,this.registerRequestHandlers()}return e.prototype.registerRequestHandlers=function(){this.framePostClient.onRequest(s.UiAppRequestType.SET_SECRET,this.handleSetSecretRequest.bind(this)),this.framePostClient.onRequest(s.UiAppRequestType.GET_SECRET,this.handleGetSecretRequest.bind(this)),this.framePostClient.onRequest(s.UiAppRequestType.GET_ALL_SECRETS,this.handleGetAllSecretsRequest.bind(this)),this.framePostClient.onRequest(s.UiAppRequestType.REMOVE_ALL_SECRETS,this.handleRemoveAllSecretsRequest.bind(this)),this.framePostClient.onRequest(s.UiAppRequestType.REMOVE_SECRET,this.handleRemoveSecretRequest.bind(this))},e.prototype.handleSetSecretRequest=function(e){var t=e.key,n=e.secret;try{return window.localStorage.setItem(t,n),!0}catch(e){return!1}},e.prototype.handleGetSecretRequest=function(e){var t=e.key;try{return window.localStorage.getItem(t)}catch(e){return!1}},e.prototype.handleGetAllSecretsRequest=function(e){var t=e.prefix;try{return a().filter((function(e){return e&&e.startsWith(t)})).reduce((function(e,t){return e[t]=window.localStorage.getItem(t),e}),{})}catch(e){return!1}},e.prototype.handleRemoveSecretRequest=function(e){var t=e.key;try{return window.localStorage.removeItem(t),!0}catch(e){return!1}},e.prototype.handleRemoveAllSecretsRequest=function(e){var t=e.prefix;try{return a().filter((function(e){return e&&e.startsWith(t)})).forEach((function(e){return e&&window.localStorage.removeItem(e)})),!0}catch(e){return!1}},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.framePostClient.request(s.UiAppRequestType.DECRYPT_SECRET,e)]}))}))},e}();t.DDSecretsClient=u},964:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDSidePanelClient=void 0;var a=n(432),u=n(601),c=n(974),l=function(e){function t(t,n,r){return e.call(this,t,n,r,u.UiAppFeatureType.SIDE_PANELS)||this}return i(t,e),t.prototype.open=function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.validateFeatureIsEnabled()];case 1:return n.sent(),c.validateKey(e)?[2,this.framePostClient.request(u.UiAppRequestType.OPEN_SIDE_PANEL,{definitionOrKey:e,args:t})]:[2]}}))}))},t.prototype.close=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.validateFeatureIsEnabled()];case 1:return t.sent(),[2,this.framePostClient.request(u.UiAppRequestType.CLOSE_SIDE_PANEL,e)]}}))}))},t}(a.DDFeatureClient);t.DDSidePanelClient=l},699:function(e,t){"use strict";t.__esModule=!0},645:function(e,t){"use strict";t.__esModule=!0,t.getLogger=void 0,t.getLogger=function(e){return e.debug?{log:function(e){return console.log("dd-apps: "+e)},error:function(e){return console.error("dd-apps: "+e)}}:{log:function(){},error:function(){}}}},974:function(e,t,n){"use strict";t.__esModule=!0,t.validateKey=t.isEventEnabled=t.getFeatureTypesByEvent=t.isFeatureEnabled=void 0;var r,i,o,s=n(601),a=n(582);t.isFeatureEnabled=function(e,t){return t.includes(e)},t.getFeatureTypesByEvent=(r=function(){var e=new Map;return a.features.forEach((function(t){t.events.forEach((function(n){e.has(n)||e.set(n,new Set),e.get(n).add(t.type)}))})),e},o=!1,function(){return o||(i=r(),o=!0),i}),t.isEventEnabled=function(e,n){if(s.enabledEvents.has(e))return!0;var r=t.getFeatureTypesByEvent().get(e);return!!r&&n.some((function(e){return r.has(e)}))},t.validateKey=function(e){if("string"==typeof e)return e.length>0;if(!e.key)throw new Error('Definition missing required field ".key"');return!0}}},t={},function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(607);var e,t})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DD_SDK=t():e.DD_SDK=t()}(self,(function(){return e={145:function(e){self,e.exports=function(){"use strict";var e={573:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ChildClient=void 0;var o=n(601),s=n(473),a=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.context=t.context||null,n.initListener=n.initListener.bind(n),window.addEventListener("message",n.initListener),n.profile&&n.onRequest(o.REQUEST_KEY_GET_PROFILE,(function(){return n.profiler.getEvents()})),n.setInitTimer(),n}return i(t,e),t.prototype.getLogger=function(){return s.getLogger("child-client",this.debug)},t.prototype.onChannelInit=function(e){window.removeEventListener("message",this.initListener),this.messagePort=e.ports[0];var t=this.getInitMessage(this.context);this.messagePort.postMessage(t),this.profiler.logEvent(o.ProfileEventType.POST_MESSAGE,t)},t.prototype.destroy=function(){this.messagePort&&this.messagePort.close(),this.initTimer&&clearTimeout(this.initTimer),window.removeEventListener("message",this.initListener)},t}(n(416).SharedClient);t.ChildClient=a},601:function(e,t){var n,r,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.REQUEST_KEY_GET_PROFILE=t.REQUEST_TIMEOUT=t.SerializationType=t.TransactionDirection=t.ProfileEventType=t.MessageAPIVersion=t.MessageType=void 0,(o=t.MessageType||(t.MessageType={})).CHANNEL_INIT="channel_init",o.EVENT="event",o.REQUEST="request",o.RESPONSE="response",o.ERROR_RESPONSE="error_response",(t.MessageAPIVersion||(t.MessageAPIVersion={})).v1="framepost/v1",(i=t.ProfileEventType||(t.ProfileEventType={})).POST_MESSAGE="post_message",i.RECEIVE_MESSAGE="receive_message",(r=t.TransactionDirection||(t.TransactionDirection={})).UP="up",r.DOWN="down",(n=t.SerializationType||(t.SerializationType={})).NONE="none",n.ERROR="error",t.REQUEST_TIMEOUT=2e4,t.REQUEST_KEY_GET_PROFILE="framepost_get_profile"},758:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.RequestTimeoutError=t.HandshakeTimeoutError=void 0;var i=function(e){function t(){var t=e.call(this,"Handshake timed out")||this;return t.name="HandshakeTimeoutError",t}return r(t,e),t}(Error);t.HandshakeTimeoutError=i;var o=function(e){function t(){var t=e.call(this,"Request timed out")||this;return t.name="RequestTimeoutError",t}return r(t,e),t}(Error);t.RequestTimeoutError=o},607:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ParentClient=t.ChildClient=void 0;var o=n(573);Object.defineProperty(t,"ChildClient",{enumerable:!0,get:function(){return o.ChildClient}});var s=n(166);Object.defineProperty(t,"ParentClient",{enumerable:!0,get:function(){return s.ParentClient}}),i(n(699),t),i(n(758),t)},473:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLogger=void 0,t.getLogger=function(e,t){return t?{log:function(t){return console.log(e+": "+t)},error:function(t){return console.error(e+": "+t)}}:{log:function(){},error:function(){}}}},166:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ParentClient=void 0;var a=n(601),u=n(473),c=n(416),l=n(593),p=function(e){function t(t){return void 0===t&&(t={}),e.call(this,t)||this}return i(t,e),t.prototype.requestChannel=function(e,t){if(this.url=new URL(e.src),e.contentWindow){var n=new MessageChannel;this.messagePort=n.port1;var r=this.getInitMessage(t);this.messagePort.onmessage=this.initListener.bind(this),this.setInitTimer(),e.contentWindow.postMessage(r,this.url.origin,[n.port2]),this.profiler.logEvent(a.ProfileEventType.POST_MESSAGE,r)}},t.prototype.getMessageProfile=function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(n){switch(n.label){case 0:return[4,this.request(a.REQUEST_KEY_GET_PROFILE)];case 1:return e=n.sent(),t=this.profiler.getEvents(),[2,l.profileMessages(t,e)]}}))}))},t.prototype.onChannelInit=function(){},t.prototype.getLogger=function(){return u.getLogger("parent-client",this.debug)},t.prototype.destroy=function(){this.messagePort&&this.messagePort.close(),this.initTimer&&clearTimeout(this.initTimer)},t}(c.SharedClient);t.ParentClient=p},819:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getProfiler=void 0,t.getProfiler=function(e){var t=[];return{logEvent:function(n,r){e&&t.push({type:n,message:r,date:new Date})},getEvents:function(){return t}}}},416:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SharedClient=void 0;var o=n(601),s=n(758),a=n(819),u=n(593),c=function(){function e(e){var t=this,n=void 0===e?{}:e,r=n.debug,i=void 0!==r&&r,s=n.profile,c=void 0!==s&&s,l=n.requestTimeout,p=void 0===l?o.REQUEST_TIMEOUT:l;this.debug=i,this.profile=c,this.requestTimeout=p,this.channel=u.defer(),this.eventSubscriptions={},this.responseSubscriptions={},this.requestSubscriptions={},this.logger=this.getLogger(),this.profiler=a.getProfiler(c),this.channel.promise.then((function(){t.logger.log("Secure parent <-> child channel established")})).catch((function(e){t.logger.log(e)}))}return e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.postMessage(o.MessageType.EVENT,e,t)]}))}))},e.prototype.on=function(e,t){var n=this;this.eventSubscriptions[e]||(this.eventSubscriptions[e]={});var r=u.randomInsecureId(8);return this.eventSubscriptions[e][r]=t,this.logger.log('Registered handler for event "'+e+'"'),function(){n.eventSubscriptions[e]=u.omit(n.eventSubscriptions[e],r),n.logger.log("Unsubscribed handler for event "+e)}},e.prototype.request=function(e,t){return r(this,void 0,void 0,(function(){var n,r,a=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.postMessage(o.MessageType.REQUEST,e,t)];case 1:return n=i.sent(),r=function(){a.responseSubscriptions=u.omit(a.responseSubscriptions,n.id)},[2,new Promise((function(e,t){var i;a.responseSubscriptions[n.id]=function(n,s){clearTimeout(i),r(),s.type===o.MessageType.ERROR_RESPONSE?t(n):e(n)},i=setTimeout((function(){r(),t(new s.RequestTimeoutError)}),a.requestTimeout)}))]}}))}))},e.prototype.onRequest=function(e,t){var n=this;return this.requestSubscriptions[e]=function(s,a){return r(n,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t(s,a)];case 1:return n=i.sent(),this.postMessage(o.MessageType.RESPONSE,e,n,a.id),[3,3];case 2:return r=i.sent(),this.postMessage(o.MessageType.ERROR_RESPONSE,e,r,a.id),[3,3];case 3:return[2]}}))}))},function(){n.requestSubscriptions=u.omit(n.requestSubscriptions,e)}},e.prototype.getContext=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.channel.promise];case 1:return[2,e.sent().context]}}))}))},e.prototype.messageListener=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.channel.promise];case 1:case 2:return r.sent(),[3,3];case 3:if(t=this.isValidMessage(e),n=u.deserialize(e.data),t){switch(n.type){case o.MessageType.EVENT:this.handleEvent(n);break;case o.MessageType.REQUEST:this.handleRequest(n);break;case o.MessageType.ERROR_RESPONSE:case o.MessageType.RESPONSE:this.handleResponse(n)}this.profiler.logEvent(o.ProfileEventType.RECEIVE_MESSAGE,n)}else this.logger.error("Invalid message format. Skipping.");return[2]}}))}))},e.prototype.handleEvent=function(e){var t=this.eventSubscriptions[e.key];t&&Object.values(t).forEach((function(t){return t(e.data,e)}))},e.prototype.handleRequest=function(e){var t=this.requestSubscriptions[e.key];t&&(t(e.data,e),this.logger.log("Handled request type "+e.key))},e.prototype.handleResponse=function(e){var t=e.requestId,n=t&&this.responseSubscriptions[t];n&&n(e.data,e)},e.prototype.postMessage=function(e,t,n,s){return r(this,void 0,void 0,(function(){var r,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.channel.promise];case 1:return r=i.sent().port,a=u.serialize({type:e,apiVersion:o.MessageAPIVersion.v1,key:t,data:n,id:u.randomInsecureId(),requestId:s}),r.postMessage(a),this.profiler.logEvent(o.ProfileEventType.POST_MESSAGE,a),[2,a]}}))}))},e.prototype.setInitTimer=function(){var e=this;this.initTimer=setTimeout((function(){e.channel.reject(new s.HandshakeTimeoutError),e.destroy()}),this.requestTimeout)},e.prototype.initListener=function(e){this.isInitMessage(e)?(this.profiler.logEvent(o.ProfileEventType.RECEIVE_MESSAGE,e.data),this.initTimer&&clearTimeout(this.initTimer),this.onChannelInit(e),this.messagePort&&(this.messagePort.onmessage=this.messageListener.bind(this)),this.resolveChannel(e)):this.logger.error("Invalid message format. Skipping.")},e.prototype.isValidMessage=function(e){var t=e.data;return t.type&&t.id&&t.apiVersion===o.MessageAPIVersion.v1},e.prototype.isInitMessage=function(e){return this.isValidMessage(e)&&e.data.type===o.MessageType.CHANNEL_INIT},e.prototype.resolveChannel=function(e){if(this.messagePort){var t={port:this.messagePort,origin:e.origin,context:e.data.data};this.channel.resolve(t)}},e.prototype.getInitMessage=function(e){return u.serialize({type:o.MessageType.CHANNEL_INIT,apiVersion:o.MessageAPIVersion.v1,key:"",data:e,id:u.randomInsecureId()})},e}();t.SharedClient=c},699:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},593:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.deserialize=t.serialize=t.profileMessages=t.omit=t.randomInsecureId=t.defer=void 0;var s=n(601);t.defer=function(){var e=function(){},t=function(){},n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}},t.randomInsecureId=function(e){return void 0===e&&(e=16),o(Array(e)).map((function(){return(~~(36*Math.random())).toString(36)})).join("")},t.omit=function(e,t){var n=e,r=t;return n[r],i(n,["symbol"==typeof r?r:r+""])},t.profileMessages=function(e,t){var n,r,i=e.concat(t).filter((function(e){return e.type===s.ProfileEventType.RECEIVE_MESSAGE})),o=(n=function(e){return e.message.id},r={},i.forEach((function(e){r[n(e)]=e})),r),a=[],u=function(e){var t=e.date,n=e.message,r={id:n.id,direction:s.TransactionDirection.DOWN,postTime:t,message:n},i=o[n.id];return i&&(r.receiveTime=i.date,r.duration=(i.date.getTime()-t.getTime())/1e3),r};return e.filter((function(e){return e.type===s.ProfileEventType.POST_MESSAGE})).forEach((function(e){var t=u(e);a.push(t)})),t.filter((function(e){return e.type===s.ProfileEventType.POST_MESSAGE})).forEach((function(e){var t=u(e);t.direction=s.TransactionDirection.UP,a.push(t)})),a.filter((function(e){return e.message.key!==s.REQUEST_KEY_GET_PROFILE})).sort((function(e,t){return e.postTime.getTime()-t.postTime.getTime()}))};var a=function(e){var t=e.name,n=e.message,r=e.stack,i=new Error(n);return i.name=t,i.stack=r,i};t.serialize=function(e){var t,n=e.data,i=s.SerializationType.NONE;return n instanceof Error&&(i=s.SerializationType.ERROR,n={message:(t=n).message,name:t.name,stack:t.stack}),r(r({},e),{serialization:i,data:n})},t.deserialize=function(e){return e.serialization===s.SerializationType.ERROR?r(r({},e),{data:a(e.data)}):e}}},t={};return function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(607)}()},724:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDAPIClient=void 0;var o=n(601),s=n(152),a=function(){function e(e,t,n){this.debug=e,this.logger=t,this.framePostClient=n,this.v1=new s.DDAPIV1Client(this)}return e.prototype.request=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.framePostClient.request(o.UiAppRequestType.API_REQUEST,e)]}))}))},e.prototype.get=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.request({method:o.IFrameApiRequestMethod.GET,resource:e,options:t,body:null})]}))}))},e.prototype.post=function(e,t,n){return void 0===n&&(n={}),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.request({method:o.IFrameApiRequestMethod.POST,resource:e,options:n,body:t})]}))}))},e.prototype.put=function(e,t,n){return void 0===n&&(n={}),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.request({method:o.IFrameApiRequestMethod.PUT,resource:e,options:n,body:t})]}))}))},e.prototype.patch=function(e,t,n){return void 0===n&&(n={}),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.request({method:o.IFrameApiRequestMethod.PATCH,resource:e,options:n,body:t})]}))}))},e.prototype.delete=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.request({method:o.IFrameApiRequestMethod.DELETE,resource:e,options:t,body:null})]}))}))},e}();t.DDAPIClient=a},152:function(e,t,n){"use strict";t.__esModule=!0,t.DDAPIV1Client=void 0;var r=n(445);t.DDAPIV1Client=function(e){this.metrics=new r.DDMetricsAPIClient(e)}},445:function(e,t){"use strict";t.__esModule=!0,t.DDMetricsAPIClient=void 0;var n=function(){function e(e){this.apiClient=e}return e.prototype.getMetadata=function(e){return this.apiClient.get("/api/v1/metrics/"+e)},e.prototype.listActiveMetrics=function(e){return this.apiClient.get("/api/v1/metrics",{params:e})},e.prototype.search=function(e){return this.apiClient.get("/api/v1/search",{params:e})},e.prototype.query=function(e){return this.apiClient.get("/api/v1/query",{params:e})},e}();t.DDMetricsAPIClient=n},883:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDClient=void 0;var o=n(145),s=n(724),a=n(601),u=n(114),c=n(391),l=n(955),p=n(979),f=n(964),h=n(645),d={host:a.Host.STAGE,debug:!1},y=function(){function e(e){void 0===e&&(e={}),this.host=e.host||d.host,this.debug=e.debug||d.debug,this.framePostClient=new o.ChildClient({debug:this.debug,profile:this.debug,context:{sdkVersion:"0.10.3"}}),this.logger=h.getLogger(e),this.api=new s.DDAPIClient(this.debug,this.logger,this.framePostClient),this.events=new u.DDEventsClient(this.debug,this.logger,this.framePostClient),this.location=new c.DDLocationClient(this.debug,this.logger,this.framePostClient),this.modal=new l.DDModalClient(this.debug,this.logger,this.framePostClient),this.sidePanel=new f.DDSidePanelClient(this.debug,this.logger,this.framePostClient),this.secrets=new p.DDSecretsClient(this.debug,this.logger,this.framePostClient)}return e.prototype.getContext=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.framePostClient.getContext()]}))}))},e}();t.DDClient=y},432:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDFeatureClient=void 0;var o=n(974),s=function(){function e(e,t,n,r){this.debug=e,this.logger=t,this.framePostClient=n,this.featureType=r}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.framePostClient.getContext()];case 1:return e=t.sent().app.features,[2,o.isFeatureEnabled(this.featureType,e)]}}))}))},e.prototype.validateFeatureIsEnabled=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.isEnabled()];case 1:if(!e.sent())throw new Error('Please enable the "'+this.featureType+'" feature to access this functionality.');return[2]}}))}))},e}();t.DDFeatureClient=s},601:function(e,t){"use strict";var n,r,i,o,s,a,u;t.__esModule=!0,t.ModalActionLevel=t.ModalSize=t.enabledEvents=t.UiAppRequestType=t.IFrameApiRequestMethod=t.UiAppEventType=t.UiAppFeatureType=t.Host=void 0,(u=t.Host||(t.Host={})).PROD="https://app.datadoghq.com/",u.STAGE="https://dd.datad0g.com/",(a=t.UiAppFeatureType||(t.UiAppFeatureType={})).DASHBOARD_COG_MENU="dashboard_cog_menu",a.DASHBOARD_CONTEXT_MENU="dashboard_context_menu",a.DASHBOARD_CUSTOM_WIDGET="dashboard_custom_widget",a.MODALS="modals",a.SIDE_PANELS="side_panels",function(e){e.CUSTOM_EVENT="custom_event",e.DASHBOARD_COG_MENU_CLICK="dashboard_cog_menu_click",e.DASHBOARD_CONTEXT_MENU_CLICK="dashboard_context_menu_click",e.DASHBOARD_TIMEFRAME_CHANGE="dashboard_timeframe_change",e.DASHBOARD_CURSOR_CHANGE="dashboard_cursor_change",e.DASHBOARD_TEMPLATE_VAR_CHANGE="dashboard_template_var_change",e.DASHBOARD_CUSTOM_WIDGET_OPTIONS_CHANGE="dashboard_custom_widget_options_change",e.MODAL_CLOSE="modal_close",e.MODAL_ACTION="modal_action",e.MODAL_CANCEL="modal_cancel",e.SIDE_PANEL_CLOSE="side_panel_close"}(n=t.UiAppEventType||(t.UiAppEventType={})),(s=t.IFrameApiRequestMethod||(t.IFrameApiRequestMethod={})).GET="GET",s.POST="POST",s.PUT="PUT",s.PATCH="PATCH",s.DELETE="DELETE",(o=t.UiAppRequestType||(t.UiAppRequestType={})).API_REQUEST="api_request",o.EVENT_BROADCAST="event_broadcast",o.NAVIGATE_TOP="navigate_top",o.OPEN_MODAL="open_modal",o.CLOSE_MODAL="close_modal",o.OPEN_SIDE_PANEL="open_side_panel",o.CLOSE_SIDE_PANEL="close_side_panel",o.STORE_SECRET="store_secret",o.REMOVE_SECRET="remove_secret",o.LOAD_ALL_SECRETS="load_all_secrets",o.REMOVE_ALL_SECRETS="remove_all_secrets",o.LOAD_SECRET="load_secret",o.GET_SECRET="get_secret",o.SET_SECRET="set_secret",t.enabledEvents=new Set([n.CUSTOM_EVENT]),(i=t.ModalSize||(t.ModalSize={})).SMALL="sm",i.MEDIUM="md",i.LARGE="lg",(r=t.ModalActionLevel||(t.ModalActionLevel={})).PRIMARY="primary",r.SUCCESS="success",r.WARNING="warning",r.DANGER="danger"},114:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDEventsClient=void 0;var o=n(601),s=n(974),a=function(){function e(e,t,n){this.debug=e,this.logger=t,this.framePostClient=n}return e.prototype.on=function(e,t){var n=this,r=this.framePostClient.on(e,t);return this.framePostClient.getContext().then((function(t){s.isEventEnabled(e,t.app.features)||(r(),n.logger.error("Your app does not have the required features enabled to respond to events of type "+e+"."))})).catch((function(){})),r},e.prototype.onCustom=function(e,t){return this.on(o.UiAppEventType.CUSTOM_EVENT,(function(n){n.eventType===e&&t(n.data)}))},e.prototype.broadcast=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.framePostClient.request(o.UiAppRequestType.EVENT_BROADCAST,{eventType:e,data:t})]}))}))},e}();t.DDEventsClient=a},309:function(e,t,n){"use strict";t.__esModule=!0,t.dashboardCogMenu=void 0;var r=n(601);t.dashboardCogMenu={type:r.UiAppFeatureType.DASHBOARD_COG_MENU,events:[r.UiAppEventType.DASHBOARD_COG_MENU_CLICK]}},622:function(e,t,n){"use strict";t.__esModule=!0,t.dashboardContextMenu=void 0;var r=n(601);t.dashboardContextMenu={type:r.UiAppFeatureType.DASHBOARD_CONTEXT_MENU,events:[r.UiAppEventType.DASHBOARD_CONTEXT_MENU_CLICK]}},828:function(e,t,n){"use strict";t.__esModule=!0,t.dashboardCustomWidget=void 0;var r=n(601);t.dashboardCustomWidget={type:r.UiAppFeatureType.DASHBOARD_CUSTOM_WIDGET,events:[r.UiAppEventType.DASHBOARD_CUSTOM_WIDGET_OPTIONS_CHANGE,r.UiAppEventType.DASHBOARD_TEMPLATE_VAR_CHANGE,r.UiAppEventType.DASHBOARD_TIMEFRAME_CHANGE,r.UiAppEventType.DASHBOARD_CURSOR_CHANGE]}},582:function(e,t,n){"use strict";t.__esModule=!0,t.features=void 0;var r=n(309),i=n(622),o=n(828),s=n(938),a=n(713);t.features=[r.dashboardCogMenu,i.dashboardContextMenu,o.dashboardCustomWidget,s.modals,a.sidePanels]},938:function(e,t,n){"use strict";t.__esModule=!0,t.modals=void 0;var r=n(601);t.modals={type:r.UiAppFeatureType.MODALS,events:[r.UiAppEventType.MODAL_CLOSE,r.UiAppEventType.MODAL_CANCEL,r.UiAppEventType.MODAL_ACTION]}},713:function(e,t,n){"use strict";t.__esModule=!0,t.sidePanels=void 0;var r=n(601);t.sidePanels={type:r.UiAppFeatureType.SIDE_PANELS,events:[r.UiAppEventType.SIDE_PANEL_CLOSE]}},607:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};t.__esModule=!0,t.DDClient=t.init=void 0;var o,s=n(883);t.DDClient=s.DDClient,t.init=function(e,t){return o||(o=new s.DDClient(e)),t&&o.getContext().then(t),o},i(n(699),t),i(n(601),t)},391:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDLocationClient=void 0;var o=n(601),s=function(){function e(e,t,n){this.debug=e,this.logger=t,this.framePostClient=n}return e.prototype.goTo=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.framePostClient.request(o.UiAppRequestType.NAVIGATE_TOP,{url:e})]}))}))},e}();t.DDLocationClient=s},955:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDModalClient=void 0;var a=n(432),u=n(601),c=n(974),l=function(e){function t(t,n,r){return e.call(this,t,n,r,u.UiAppFeatureType.MODALS)||this}return i(t,e),t.prototype.open=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.validateFeatureIsEnabled()];case 1:return t.sent(),c.validateKey(e)?[2,this.framePostClient.request(u.UiAppRequestType.OPEN_MODAL,e)]:[2]}}))}))},t.prototype.close=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.validateFeatureIsEnabled()];case 1:return t.sent(),[2,this.framePostClient.request(u.UiAppRequestType.CLOSE_MODAL,e)]}}))}))},t}(a.DDFeatureClient);t.DDModalClient=l},979:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};t.__esModule=!0,t.DDSecretsClient=void 0;var s=n(601),a=function(){return o(Array(window.localStorage.length)).map((function(e,t){return window.localStorage.key(t)}))},u=function(){function e(e,t,n){this.debug=e,this.logger=t,this.framePostClient=n,this.registerRequestHandlers()}return e.prototype.registerRequestHandlers=function(){this.framePostClient.onRequest(s.UiAppRequestType.STORE_SECRET,this.handleStoreSecretRequest.bind(this)),this.framePostClient.onRequest(s.UiAppRequestType.LOAD_SECRET,this.handleLoadSecretRequest.bind(this)),this.framePostClient.onRequest(s.UiAppRequestType.LOAD_ALL_SECRETS,this.handleLoadAllSecretsRequest.bind(this)),this.framePostClient.onRequest(s.UiAppRequestType.REMOVE_ALL_SECRETS,this.handleRemoveAllSecretsRequest.bind(this)),this.framePostClient.onRequest(s.UiAppRequestType.REMOVE_SECRET,this.handleRemoveSecretRequest.bind(this))},e.prototype.handleStoreSecretRequest=function(e){var t=e.key,n=e.secret;try{return window.localStorage.setItem(t,n),!0}catch(e){return!1}},e.prototype.handleLoadSecretRequest=function(e){var t=e.key;try{return window.localStorage.getItem(t)}catch(e){return!1}},e.prototype.handleLoadAllSecretsRequest=function(e){var t=e.prefix;try{return a().filter((function(e){return e&&e.startsWith(t)})).reduce((function(e,t){return e[t]=window.localStorage.getItem(t),e}),{})}catch(e){return!1}},e.prototype.handleRemoveSecretRequest=function(e){var t=e.key;try{return window.localStorage.removeItem(t),!0}catch(e){return!1}},e.prototype.handleRemoveAllSecretsRequest=function(e){var t=e.prefix;try{return a().filter((function(e){return e&&e.startsWith(t)})).forEach((function(e){return e&&window.localStorage.removeItem(e)})),!0}catch(e){return!1}},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.framePostClient.request(s.UiAppRequestType.GET_SECRET,e)]}))}))},e.prototype.set=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.framePostClient.request(s.UiAppRequestType.SET_SECRET,{key:e,data:t})]}))}))},e}();t.DDSecretsClient=u},964:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.DDSidePanelClient=void 0;var a=n(432),u=n(601),c=n(974),l=function(e){function t(t,n,r){return e.call(this,t,n,r,u.UiAppFeatureType.SIDE_PANELS)||this}return i(t,e),t.prototype.open=function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this.validateFeatureIsEnabled()];case 1:return n.sent(),c.validateKey(e)?[2,this.framePostClient.request(u.UiAppRequestType.OPEN_SIDE_PANEL,{definitionOrKey:e,args:t})]:[2]}}))}))},t.prototype.close=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.validateFeatureIsEnabled()];case 1:return t.sent(),[2,this.framePostClient.request(u.UiAppRequestType.CLOSE_SIDE_PANEL,e)]}}))}))},t}(a.DDFeatureClient);t.DDSidePanelClient=l},699:function(e,t){"use strict";t.__esModule=!0},645:function(e,t){"use strict";t.__esModule=!0,t.getLogger=void 0,t.getLogger=function(e){return e.debug?{log:function(e){return console.log("dd-apps: "+e)},error:function(e){return console.error("dd-apps: "+e)}}:{log:function(){},error:function(){}}}},974:function(e,t,n){"use strict";t.__esModule=!0,t.validateKey=t.isEventEnabled=t.getFeatureTypesByEvent=t.isFeatureEnabled=void 0;var r,i,o,s=n(601),a=n(582);t.isFeatureEnabled=function(e,t){return t.includes(e)},t.getFeatureTypesByEvent=(r=function(){var e=new Map;return a.features.forEach((function(t){t.events.forEach((function(n){e.has(n)||e.set(n,new Set),e.get(n).add(t.type)}))})),e},o=!1,function(){return o||(i=r(),o=!0),i}),t.isEventEnabled=function(e,n){if(s.enabledEvents.has(e))return!0;var r=t.getFeatureTypesByEvent().get(e);return!!r&&n.some((function(e){return r.has(e)}))},t.validateKey=function(e){if("string"==typeof e)return e.length>0;if(!e.key)throw new Error('Definition missing required field ".key"');return!0}}},t={},function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(607);var e,t})); | ||
//# sourceMappingURL=ui-apps-sdk.min.js.map |
{ | ||
"name": "@datadog/ui-apps-sdk", | ||
"version": "0.10.2", | ||
"version": "0.10.3", | ||
"description": "Datadog UI Apps - Official JavaScript SDK ", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/DataDog/ui_apps_sdk", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
151950
628