/*! For license information please see module.js.LICENSE.txt */ define(["@emotion/css","@grafana/data","@grafana/runtime","@grafana/ui","app/core/app_events","app/core/core","lodash","react"],((t,e,r,n,o,i,a,s)=>(()=>{var c=[t=>{"use strict";t.exports=s},t=>{"use strict";t.exports=n},,,,,,,,,t=>{"use strict";t.exports=e},t=>{t.exports="object"==typeof self?self.FormData:window.FormData},,t=>{"use strict";t.exports=a},t=>{"use strict";t.exports=r},t=>{"use strict";t.exports=o},,,,,,,,,,,,,t=>{"use strict";t.exports=i},e=>{"use strict";e.exports=t}],u={};function l(t){var e=u[t];if(void 0!==e)return e.exports;var r=u[t]={exports:{}};return c[t](r,r.exports,l),r.exports}l.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return l.d(e,{a:e}),e},l.d=(t,e)=>{for(var r in e)l.o(e,r)&&!l.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},l.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),l.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var f={};return(()=>{"use strict";var t,e,r;l.r(f),l.d(f,{plugin:()=>De}),function(t){t.INFLUXDB="influxdb",t.GRAPHITE="graphite",t.PROMETHEUS="prometheus",t.POSTGRES="postgres",t.ELASTICSEARCH="elasticsearch",t.MYSQL="mysql"}(t||(t={})),function(t){t.LOADING="Loading",t.DATASOURCE_ERROR="Datasource Error",t.PERMISSION_ERROR="Permission Error",t.OK="Ok"}(e||(e={})),function(t){t.EXPORTING="exporting",t.FINISHED="finished",t.ERROR="error"}(r||(r={}));var n=l(10);l(15);function o(t){var e=new URL(t).pathname.match(/\/d\/([^/]+)/);if(e)return e[1];throw new Error("Couldn't parse uid from ".concat(t))}var i="iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACJSURBVHgB7ZPRCcAgDESv0lWc0zhC53OIjmAVUpCSamL76YEoyfFIiAGWfldK6SwnKHyhep9xJ3iPcqgH5RyxV1VlBWYJypXVHMEiCaqBbRhAy3W3B76j954wq6ZSVZsOY+WXt6i9l2ymGTlUq0VpOcIqaQC96Zth01DN1zBBefVI4SNp9Za+6wLcH6DKFrfpxgAAAABJRU5ErkJggg==",a="iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADlSURBVHgB3ZPNDYJAEIVnN96lBA7A2RIsATuQiiwBSrAD7MAjCZBACXqFwPomMRtEwMVwgZeQhfn5mNnMEG1CaZoeiqKwTWJ3JkFCiEtVVU+8+r9iJRlKSrk3iqOFtWJglmXHf3yDwCRJbBxxnudh34cRYluMMbKGcgWNCIlnjEuIJ1JK2WzDWeKb7YHjONEsYBf6kTABY+mWuYX+3Xiex9UFU7D3FllfwLqueQvi/h8ZCtBprDLY703T6A0yWj2ArmSoxedQV4jSSz5xj4pmCi0/NKfrwNz5bdtaNENciOu6N1qNXhzZXHMb9Q+nAAAAAElFTkSuQmCC",s="PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIxNSIgaGVpZ2h0PSIxNSIgcng9IjEuNSIgZmlsbD0iIzExMTIxNiIgc3Ryb2tlPSIjMkQyRTM0Ii8+Cjwvc3ZnPgo=",c="PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiByeD0iMiIgZmlsbD0iIzRBNzFEMiIvPgo8cGF0aCBkPSJNNS45ODI2NCAxMi41MjE3QzUuNzczOTUgMTIuNTIxNyA1LjU4MjY0IDEyLjQ1MjIgNS40MjYxMiAxMi4yOTU2TDEuOTY1MjUgOC44MzQ3NkMxLjY1MjIxIDguNTIxNzIgMS42NTIyMSA4LjAzNDc2IDEuOTY1MjUgNy43MjE3MkMyLjI3ODI5IDcuNDA4NjcgMi43NjUyNSA3LjQwODY3IDMuMDc4MjkgNy43MjE3Mkw2LjAwMDAzIDEwLjYyNjFMMTIuOTM5MiAzLjcwNDMzQzEzLjI1MjIgMy4zOTEyOCAxMy43MzkyIDMuMzkxMjggMTQuMDUyMiAzLjcwNDMzQzE0LjM2NTMgNC4wMTczNyAxNC4zNjUzIDQuNTA0MzMgMTQuMDUyMiA0LjgxNzM3TDYuNTU2NTYgMTIuMjk1NkM2LjM4MjY0IDEyLjQ1MjIgNi4xOTEzNCAxMi41MjE3IDUuOTgyNjQgMTIuNTIxN1YxMi41MjE3WiIgZmlsbD0iI0ZFRkZGRiIvPgo8L3N2Zz4K";function u(t,e){return function(){return t.apply(e,arguments)}}const{toString:p}=Object.prototype,{getPrototypeOf:h}=Object,d=(y=Object.create(null),t=>{const e=p.call(t);return y[e]||(y[e]=e.slice(8,-1).toLowerCase())});var y;const m=t=>(t=t.toLowerCase(),e=>d(e)===t),v=t=>e=>typeof e===t,{isArray:g}=Array,w=v("undefined");const b=m("ArrayBuffer");const E=v("string"),O=v("function"),A=v("number"),x=t=>null!==t&&"object"==typeof t,S=t=>{if("object"!==d(t))return!1;const e=h(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},j=m("Date"),R=m("File"),L=m("Blob"),N=m("FileList"),T=m("URLSearchParams");function I(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),g(t))for(n=0,o=t.length;n0;)if(n=r[o],e===n.toLowerCase())return n;return null}const C="undefined"==typeof self?"undefined"==typeof global?void 0:global:self,D=t=>!w(t)&&t!==C;const M=(k="undefined"!=typeof Uint8Array&&h(Uint8Array),t=>k&&t instanceof k);var k;const _=m("HTMLFormElement"),F=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),B=m("RegExp"),U=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};I(r,((r,o)=>{!1!==e(r,o,t)&&(n[o]=r)})),Object.defineProperties(t,n)},z={isArray:g,isArrayBuffer:b,isBuffer:function(t){return null!==t&&!w(t)&&null!==t.constructor&&!w(t.constructor)&&O(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||p.call(t)===e||O(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&b(t.buffer),e},isString:E,isNumber:A,isBoolean:t=>!0===t||!1===t,isObject:x,isPlainObject:S,isUndefined:w,isDate:j,isFile:R,isBlob:L,isRegExp:B,isFunction:O,isStream:t=>x(t)&&O(t.pipe),isURLSearchParams:T,isTypedArray:M,isFileList:N,forEach:I,merge:function t(){const{caseless:e}=D(this)&&this||{},r={},n=(n,o)=>{const i=e&&P(r,o)||o;S(r[i])&&S(n)?r[i]=t(r[i],n):S(n)?r[i]=t({},n):g(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t(I(e,((e,n)=>{r&&O(e)?t[n]=u(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==r&&h(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:d,kindOfTest:m,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(g(t))return t;let e=t.length;if(!A(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:_,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:U,freezeMethods:t=>{U(t,((e,r)=>{if(O(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];O(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return g(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:P,global:C,isContextDefined:D,toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(x(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=g(t)?[]:{};return I(t,((t,e)=>{const i=r(t,n+1);!w(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)}};function G(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}z.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const H=G.prototype,Y={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{Y[t]={value:t}})),Object.defineProperties(G,Y),Object.defineProperty(H,"isAxiosError",{value:!0}),G.from=(t,e,r,n,o,i)=>{const a=Object.create(H);return z.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),G.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const J=G;const Z=l(11);function W(t){return z.isPlainObject(t)||z.isArray(t)}function Q(t){return z.endsWith(t,"[]")?t.slice(0,-2):t}function q(t,e,r){return t?t.concat(e).map((function(t,e){return t=Q(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const V=z.toFlatObject(z,{},null,(function(t){return/^is[A-Z]/.test(t)}));const K=function(t,e,r){if(!z.isObject(t))throw new TypeError("target must be an object");e=e||new(Z||FormData);const n=(r=z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!z.isUndefined(e[t])}))).metaTokens,o=r.visitor||l,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&((c=e)&&z.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!z.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(z.isDate(t))return t.toISOString();if(!s&&z.isBlob(t))throw new J("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(t)||z.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function l(t,r,o){let s=t;if(t&&!o&&"object"==typeof t)if(z.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(z.isArray(t)&&function(t){return z.isArray(t)&&!t.some(W)}(t)||z.isFileList(t)||z.endsWith(r,"[]")&&(s=z.toArray(t)))return r=Q(r),s.forEach((function(t,n){!z.isUndefined(t)&&null!==t&&e.append(!0===a?q([r],n,i):null===a?r:r+"[]",u(t))})),!1;return!!W(t)||(e.append(q(o,r,i),u(t)),!1)}const f=[],p=Object.assign(V,{defaultVisitor:l,convertValue:u,isVisitable:W});if(!z.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!z.isUndefined(r)){if(-1!==f.indexOf(r))throw Error("Circular reference detected in "+n.join("."));f.push(r),z.forEach(r,(function(r,i){!0===(!(z.isUndefined(r)||null===r)&&o.call(e,r,z.isString(i)?i.trim():i,n,p))&&t(r,n?n.concat(i):[i])})),f.pop()}}(t),e};function X(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function $(t,e){this._pairs=[],t&&K(t,this,e)}const tt=$.prototype;tt.append=function(t,e){this._pairs.push([t,e])},tt.toString=function(t){const e=t?function(e){return t.call(this,e,X)}:X;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const et=$;function rt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nt(t,e,r){if(!e)return t;const n=r&&r.encode||rt,o=r&&r.serialize;let i;if(i=o?o(e,r):z.isURLSearchParams(e)?e.toString():new et(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const ot=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){z.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},it={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},at="undefined"!=typeof URLSearchParams?URLSearchParams:et,st=FormData,ct=(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),ut="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,lt={isBrowser:!0,classes:{URLSearchParams:at,FormData:st,Blob},isStandardBrowserEnv:ct,isStandardBrowserWebWorkerEnv:ut,protocols:["http","https","file","blob","url","data"]};const ft=function(t){function e(t,r,n,o){let i=t[o++];const a=Number.isFinite(+i),s=o>=t.length;if(i=!i&&z.isArray(n)?n.length:i,s)return z.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&z.isObject(n[i])||(n[i]=[]);return e(t,r,n[i],o)&&z.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n{e(function(t){return z.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},pt={"Content-Type":void 0};const ht={transitional:it,adapter:["xhr","http"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=z.isObject(t);o&&z.isHTMLForm(t)&&(t=new FormData(t));if(z.isFormData(t))return n&&n?JSON.stringify(ft(t)):t;if(z.isArrayBuffer(t)||z.isBuffer(t)||z.isStream(t)||z.isFile(t)||z.isBlob(t))return t;if(z.isArrayBufferView(t))return t.buffer;if(z.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return K(t,new lt.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return lt.isNode&&z.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=z.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return K(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(z.isString(t))try{return(e||JSON.parse)(t),z.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||ht.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&z.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw J.from(t,J.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:lt.classes.FormData,Blob:lt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],(function(t){ht.headers[t]={}})),z.forEach(["post","put","patch"],(function(t){ht.headers[t]=z.merge(pt)}));const dt=ht,yt=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),mt=Symbol("internals");function vt(t){return t&&String(t).trim().toLowerCase()}function gt(t){return!1===t||null==t?t:z.isArray(t)?t.map(gt):String(t)}function wt(t,e,r,n){return z.isFunction(n)?n.call(this,e,r):z.isString(e)?z.isString(n)?-1!==e.indexOf(n):z.isRegExp(n)?n.test(e):void 0:void 0}class bt{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=vt(e);if(!o)throw new Error("header name must be a non-empty string");const i=z.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=gt(t))}const i=(t,e)=>z.forEach(t,((t,r)=>o(t,r,e)));return z.isPlainObject(t)||t instanceof this.constructor?i(t,e):z.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&yt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e):null!=t&&o(e,t,r),this}get(t,e){if(t=vt(t)){const r=z.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(z.isFunction(e))return e.call(this,t,r);if(z.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=vt(t)){const r=z.findKey(this,t);return!(!r||e&&!wt(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=vt(t)){const o=z.findKey(r,t);!o||e&&!wt(0,r[o],o,e)||(delete r[o],n=!0)}}return z.isArray(t)?t.forEach(o):o(t),n}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(t){const e=this,r={};return z.forEach(this,((n,o)=>{const i=z.findKey(r,o);if(i)return e[i]=gt(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=gt(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return z.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&z.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[mt]=this[mt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=vt(t);e[n]||(!function(t,e){const r=z.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return z.isArray(t)?t.forEach(n):n(t),this}}bt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),z.freezeMethods(bt.prototype),z.freezeMethods(bt);const Et=bt;function Ot(t,e){const r=this||dt,n=e||r,o=Et.from(n.headers);let i=n.data;return z.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function At(t){return!(!t||!t.__CANCEL__)}function xt(t,e,r){J.call(this,null==t?"canceled":t,J.ERR_CANCELED,e,r),this.name="CanceledError"}z.inherits(xt,J,{__CANCEL__:!0});const St=xt;const jt=lt.isStandardBrowserEnv?{write:function(t,e,r,n,o,i){const a=[];a.push(t+"="+encodeURIComponent(e)),z.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),z.isString(n)&&a.push("path="+n),z.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Rt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Lt=lt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=z.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0};const Nt=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o{const i=o.loaded,a=o.lengthComputable?o.total:void 0,s=i-r,c=n(s);r=i;const u={loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:o};u[e?"download":"upload"]=!0,t(u)}}const It={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){let n=t.data;const o=Et.from(t.headers).normalize(),i=t.responseType;let a;function s(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}z.isFormData(n)&&(lt.isStandardBrowserEnv||lt.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",r=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+r))}const u=Rt(t.baseURL,t.url);function l(){if(!c)return;const n=Et.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new J("Request failed with status code "+r.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}((function(t){e(t),s()}),(function(t){r(t),s()}),{data:i&&"text"!==i&&"json"!==i?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),nt(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(r(new J("Request aborted",J.ECONNABORTED,t,c)),c=null)},c.onerror=function(){r(new J("Network Error",J.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const n=t.transitional||it;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new J(e,n.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,t,c)),c=null},lt.isStandardBrowserEnv){const e=(t.withCredentials||Lt(u))&&t.xsrfCookieName&&jt.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===n&&o.setContentType(null),"setRequestHeader"in c&&z.forEach(o.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),z.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),i&&"json"!==i&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",Tt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Tt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{c&&(r(!e||e.type?new St(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const f=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(u);f&&-1===lt.protocols.indexOf(f)?r(new J("Unsupported protocol "+f+":",J.ERR_BAD_REQUEST,t)):c.send(n||null)}))}};z.forEach(It,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Pt=t=>{t=z.isArray(t)?t:[t];const{length:e}=t;let r,n;for(let o=0;ot instanceof Et?t.toJSON():t;function kt(t,e){e=e||{};const r={};function n(t,e,r){return z.isPlainObject(t)&&z.isPlainObject(e)?z.merge.call({caseless:r},t,e):z.isPlainObject(e)?z.merge({},e):z.isArray(e)?e.slice():e}function o(t,e,r){return z.isUndefined(e)?z.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!z.isUndefined(e))return n(void 0,e)}function a(t,e){return z.isUndefined(e)?z.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function s(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>o(Mt(t),Mt(e),!0)};return z.forEach(Object.keys(t).concat(Object.keys(e)),(function(n){const i=c[n]||o,a=i(t[n],e[n],n);z.isUndefined(a)&&i!==s||(r[n]=a)})),r}const _t="1.2.1",Ft={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ft[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Bt={};Ft.transitional=function(t,e,r){return(n,o,i)=>{if(!1===t)throw new J(function(t,e){return"[Axios v1.2.1] Transitional option '"+t+"'"+e+(r?". "+r:"")}(o," has been removed"+(e?" in "+e:"")),J.ERR_DEPRECATED);return e&&!Bt[o]&&(Bt[o]=!0),!t||t(n,o,i)}};const Ut={assertOptions:function(t,e,r){if("object"!=typeof t)throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new J("option "+i+" must be "+r,J.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new J("Unknown option "+i,J.ERR_BAD_OPTION)}},validators:Ft},zt=Ut.validators;class Gt{constructor(t){this.defaults=t,this.interceptors={request:new ot,response:new ot}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=kt(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;let i;void 0!==r&&Ut.assertOptions(r,{silentJSONParsing:zt.transitional(zt.boolean),forcedJSONParsing:zt.transitional(zt.boolean),clarifyTimeoutError:zt.transitional(zt.boolean)},!1),void 0!==n&&Ut.assertOptions(n,{encode:zt.function,serialize:zt.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),i=o&&z.merge(o.common,o[e.method]),i&&z.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Et.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,f=0;if(!s){const t=[Dt.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);f{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new St(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new Yt((function(e){t=e})),cancel:t}}}const Jt=Yt;const Zt=function t(e){const r=new Ht(e),n=u(Ht.prototype.request,r);return z.extend(n,Ht.prototype,r,{allOwnKeys:!0}),z.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(kt(e,r))},n}(dt);Zt.Axios=Ht,Zt.CanceledError=St,Zt.CancelToken=Jt,Zt.isCancel=At,Zt.VERSION=_t,Zt.toFormData=K,Zt.AxiosError=J,Zt.Cancel=Zt.CanceledError,Zt.all=function(t){return Promise.all(t)},Zt.spread=function(t){return function(e){return t.apply(null,e)}},Zt.isAxiosError=function(t){return z.isObject(t)&&!0===t.isAxiosError},Zt.mergeConfig=kt,Zt.AxiosHeaders=Et,Zt.formToJSON=t=>ft(z.isHTMLForm(t)?new FormData(t):t),Zt.default=Zt;const Wt=Zt;var Qt=l(13);function qt(t){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(t)}function Vt(){Vt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new S(o||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var y={};c(y,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(j([])));v&&v!==e&&r.call(v,i)&&(y=v);var g=d.prototype=p.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==qt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return R()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function j(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Kt(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Xt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Kt(i,n,o,a,s,"next",t)}function s(t){Kt(i,n,o,a,s,"throw",t)}a(void 0)}))}}function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;e=200&&t<300},$t({},t)}));var ee=function(){var t=Xt(Vt().mark((function t(e,r){var n,o,i,a,s,c,u;return Vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.method,o=void 0===n?"GET":n,i=r.params,a=r.data,s=r.validateStatus,c="".concat("api/plugin-proxy/corpglory-dataexporter-app").concat("/api").concat(e),t.next=4,te({method:o,url:c,params:i,data:a,validateStatus:s});case 4:return u=t.sent,t.abrupt("return",u.data);case 6:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}();function re(){return(re=Xt(Vt().mark((function t(){return Vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",ee("/task",{}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ne(t){return oe.apply(this,arguments)}function oe(){return(oe=Xt(Vt().mark((function t(e){return Vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Qt.isEmpty(e)){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,ee("/task",{method:"DELETE",data:{taskId:e}});case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ie(){return(ie=Xt(Vt().mark((function t(e){var r,n,o;return Vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Qt.isEmpty(e)){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,ee("/static/".concat(e,".csv"),{});case 5:r=t.sent,n=URL.createObjectURL(new Blob([r],{type:"text/csv"})),(o=document.createElement("a")).href=n,o.setAttribute("download","".concat(e,".csv")),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(n);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ae=l(14);function se(t){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(t)}function ce(){ce=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new S(o||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var y={};c(y,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(j([])));v&&v!==e&&r.call(v,i)&&(y=v);var g=d.prototype=p.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==se(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return R()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function j(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ue(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function le(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ue(i,n,o,a,s,"next",t)}function s(t){ue(i,n,o,a,s,"throw",t)}a(void 0)}))}}function fe(){return(fe=le(ce().mark((function t(){var e;return ce().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0,ae.getBackendSrv)(),t.abrupt("return",e.get("/api/datasources"));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function pe(t){return he.apply(this,arguments)}function he(){return(he=le(ce().mark((function t(e){var r;return ce().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,ae.getBackendSrv)(),t.abrupt("return",r.get("/api/dashboards/uid/".concat(e)));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var de,ye,me,ve,ge,we,be=l(28),Ee=l(29),Oe=l(1),Ae=l(0),xe=l.n(Ae);function Se(t){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(t)}function je(){return je=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Le(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Ne(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Le(i,n,o,a,s,"next",t)}function s(t){Le(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||Ie(t,e)||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 Ie(t,e){if(t){if("string"==typeof t)return Pe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pe(t,e):void 0}}function Pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(t);try{for(o.s();!(n=o.n()).done;){var i;if((null===(i=n.value.progress)||void 0===i?void 0:i.status)===r.EXPORTING)return void setTimeout(Y,1e3)}}catch(t){o.e(t)}finally{o.f()}})).catch((function(t){G(e.DATASOURCE_ERROR)}))}function J(){return J=Ne(Re().mark((function t(e){var r,n,o;return Re().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Qt.filter(j,(function(t){return t.selected})),n=[F.from.unix(),F.to.unix()],o={username:be.contextSrv.user.name,timeRange:{from:1e3*n[0],to:1e3*n[1]},queries:r},t.next=5,ee("/task",{method:"POST",data:{task:o,url:window.location.toString(),timeZoneName:e}});case 5:Y(),W(),Z();case 8:case"end":return t.stop()}}),t)}))),J.apply(this,arguments)}function Z(){null!==j&&R(j.map((function(t){return je({},t,{selected:!1})})))}function W(){k(!1),Z()}function Q(){return(Q=Ne(Re().mark((function t(e){var r,n,o;return Re().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.origin.rowIndex,n=Qt.find(A,(function(t,e){return e===r})),t.next=4,ne(null==n?void 0:n.id);case 4:o=Qt.filter(A,(function(t,e){return e!==r})),x(o);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function q(t){var e=t.origin.rowIndex,r=Qt.find(A,(function(t,r){return r===e}));!function(t){ie.apply(this,arguments)}(null==r?void 0:r.id)}function V(t){if(null!==j){var e=t.origin.rowIndex,r=Qt.clone(j);r[e].selected=!r[e].selected,R(r)}}be.contextSrv.user.orgRole!==n.OrgRole.Admin&&G(e.PERMISSION_ERROR),(0,Ae.useEffect)((function(){function t(){return(t=Ne(Re().mark((function t(){var e;return Re().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=o(window.location.toString()),t.abrupt("return",pe(e));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}(function(){return t.apply(this,arguments)})().then((function(t){return g(t.dashboard)})).catch((function(t){}))}),[]),(0,Ae.useEffect)((function(){(function(){return fe.apply(this,arguments)})().then((function(t){return E(t)})).catch((function(t){}))}),[]),(0,Ae.useEffect)((function(){v&&b&&v.panels.forEach((function(e){var r,n,o=[];"corpglory-dataexporter-panel"!==e.type&&Qt.includes(Qt.values(t),null===(r=e.datasource)||void 0===r?void 0:r.type)&&(null===(n=e.targets)||void 0===n||n.forEach((function(t){var r,n=function(t){if(Qt.isNil(t))return;if(null===b)return;var e=Qt.find(b,(function(e){return e.uid===t}));return e}(null===(r=t.datasource)||void 0===r?void 0:r.uid);n&&o.push({selected:!1,target:t,panel:e,datasource:n})})),R(o))}))}),[v,b]),(0,Ae.useEffect)((function(){if(null!==A){var t=function(t){var e=(0,n.toDataFrame)({name:"A",fields:[{name:"Time",type:n.FieldType.number,values:Qt.map(t,(function(t){var e,r;return(r=null===(e=t.progress)||void 0===e?void 0:e.time)?new Date(r).toLocaleString("en-GB",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}):"-"}))},{name:"User",type:n.FieldType.string,values:Qt.map(t,(function(t){return t.username}))},{name:"Datasource",type:n.FieldType.string,values:Qt.map(t,(function(t){return t.queries.map((function(t){var e;return null===(e=t.datasource)||void 0===e?void 0:e.name})).join(",")}))},{name:"Exported Rows",type:n.FieldType.number,values:Qt.map(t,(function(t){var e;return null===(e=t.progress)||void 0===e?void 0:e.exportedRowsCount}))},{name:"Progress",type:n.FieldType.string,values:Qt.map(t,(function(t){var e;return"".concat((100*((null===(e=t.progress)||void 0===e?void 0:e.progress)||0)).toFixed(0),"%")}))},{name:"Status",type:n.FieldType.string,values:Qt.map(t,(function(t){var e;return null===(e=t.progress)||void 0===e?void 0:e.status}))},{name:"Error",type:n.FieldType.string,values:Qt.map(t,(function(t){var e;return(null===(e=t.progress)||void 0===e?void 0:e.errorMessage)||"-"}))},{name:"Download CSV",type:n.FieldType.string,values:Qt.map(t,(function(){return"data:image/png;base64,".concat(a)})),config:{custom:{filterable:!1,displayMode:"image"},links:[{targetBlank:!1,title:"Download",url:"#",onClick:function(t){return q(t)}}]}},{name:"Delete task",type:n.FieldType.string,values:Qt.map(t,(function(){return"data:image/png;base64,".concat(i)})),config:{custom:{filterable:!1,displayMode:"image"},links:[{targetBlank:!1,title:"Delete",url:"#",onClick:function(t){return function(t){return Q.apply(this,arguments)}(t)}}]}}]});return(0,n.applyFieldOverrides)({data:[e],fieldConfig:{overrides:[],defaults:{}},theme:(0,n.createTheme)(),replaceVariables:function(t){return t}})[0]}(A);T(t)}}),[A]),(0,Ae.useEffect)(Y,[]),(0,Ae.useEffect)((function(){null!==j&&C(function(t){var e=(0,n.toDataFrame)({name:"A",fields:[{name:"Select",type:n.FieldType.string,values:Qt.map(t,(function(t){return"data:image/svg+xml;base64,".concat(t.selected?c:s)})),config:{custom:{filterable:!1,displayMode:"image"},links:[{targetBlank:!1,title:"Select",url:"#",onClick:function(t){return V(t)}}]}},{name:"Panel",type:n.FieldType.string,values:Qt.map(t,(function(t){return t.panel.title}))},{name:"RefId",type:n.FieldType.string,values:Qt.map(t,(function(t){return t.target.refId}))},{name:"Datasource",type:n.FieldType.string,values:Qt.map(t,(function(t){return t.datasource.name}))}]});return(0,n.applyFieldOverrides)({data:[e],fieldConfig:{overrides:[],defaults:{}},theme:(0,n.createTheme)(),replaceVariables:function(t){return t}})[0]}(j))}),[j]),d.subscribe(ae.RefreshEvent,Y);var K=(0,Oe.useStyles2)(Ce),X=de||(de=xe().createElement(Oe.LoadingPlaceholder,{text:"Loading..."})),$=xe().createElement("div",null,ye||(ye=xe().createElement("p",null,"Datasource is unavailable.")),me||(me=xe().createElement("div",null,"Click ",xe().createElement("a",{href:"/plugins/".concat("corpglory-dataexporter-app")},"here")," to configure DataExporter."))),tt=ve||(ve=xe().createElement("div",null,xe().createElement("p",null,"Permission Error."),xe().createElement("div",null," DataExporter panel availabel only for Admins "))),et=xe().createElement("div",null,xe().createElement(Oe.Table,{width:f,height:p-40,data:N}),xe().createElement(Oe.HorizontalGroup,{justify:"flex-end"},xe().createElement(Oe.Button,{variant:"primary","aria-label":"Rich history button",icon:"plus",style:{marginTop:"8px"},onClick:function(){B(h),k(!0)}},"Add Task"),xe().createElement(Oe.Modal,{title:"Select Queries",isOpen:M,onDismiss:W,className:K.calendarModal},null===P?ge||(ge=xe().createElement(Oe.LoadingPlaceholder,{text:"Loading..."})):xe().createElement("div",null,xe().createElement(Oe.VerticalGroup,{spacing:"xs"},xe().createElement(Oe.HorizontalGroup,{justify:"flex-start",spacing:"md"},xe().createElement(Oe.TimeRangeInput,{value:F,onChange:function(t){B(t)}})),xe().createElement(Oe.Table,{width:f/2-20,height:p-40,data:P}),xe().createElement(Oe.HorizontalGroup,{justify:"flex-end",spacing:"md"},xe().createElement(Oe.Button,{variant:"primary","aria-label":"Add task button",onClick:function(){return function(t){return J.apply(this,arguments)}(H)},disabled:!(null!=j&&null!==(l=j.filter((function(t){return t.selected})))&&void 0!==l&&l.length)},"Add Task")))))));return xe().createElement("div",null,function(t){switch(t){case e.LOADING:return X;case e.DATASOURCE_ERROR:return $;case e.PERMISSION_ERROR:return tt;case e.OK:return et;default:return $}}(z))}))})(),f})())); //# sourceMappingURL=module.js.map