/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.canvas_bundle_jsonpfunction=window.canvas_bundle_jsonpfunction||[]).push([[10],{133:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var s=r(n(240)),i=r(n(137)),a=n(254),o=n(258),l=r(n(259)),c=r(n(179)),u=r(n(178)),p=s.default.create;function h(){var e=p();return e.compile=function(t,n){return o.compile(t,n,e)},e.precompile=function(t,n){return o.precompile(t,n,e)},e.AST=i.default,e.Compiler=o.Compiler,e.JavaScriptCompiler=l.default,e.Parser=a.parser,e.parse=a.parse,e.parseWithoutProcessing=a.parseWithoutProcessing,e}var d=h();d.create=h,u.default(d),d.Visitor=c.default,d.default=d,t.default=d,e.exports=t.default},134:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=p;var s=n(72),i=r(n(82)),a=n(135),o=n(248),l=r(n(177)),c=n(136);t.VERSION="4.7.7",t.COMPILER_REVISION=8,t.LAST_COMPATIBLE_COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var u="[object Object]";function p(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},a.registerDefaultHelpers(this),o.registerDefaultDecorators(this)}p.prototype={constructor:p,logger:l.default,log:l.default.log,registerHelper:function(e,t){if(s.toString.call(e)===u){if(t)throw new i.default("Arg not supported with multiple helpers");s.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(s.toString.call(e)===u)s.extend(this.partials,e);else{if(void 0===t)throw new i.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(s.toString.call(e)===u){if(t)throw new i.default("Arg not supported with multiple decorators");s.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var h=l.default.log;t.log=h,t.createFrame=s.createFrame,t.logger=l.default},135:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){s.default(e),i.default(e),a.default(e),o.default(e),l.default(e),c.default(e),u.default(e)},t.moveHelperToHooks=function(e,t,n){e.helpers[t]&&(e.hooks[t]=e.helpers[t],n||delete e.helpers[t])};var s=r(n(241)),i=r(n(242)),a=r(n(243)),o=r(n(244)),l=r(n(245)),c=r(n(246)),u=r(n(247))},136:function(e,t,n){"use strict";t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:r.createNewLookupObject(n,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:r.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,n){return function(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==i[e]&&(i[e]=!0,s.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}("function"==typeof e?t.methods:t.properties,n)},t.resetLoggedProperties=function(){Object.keys(i).forEach((function(e){delete i[e]}))};var r=n(250),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(177)),i=Object.create(null)},137:function(e,t,n){"use strict";t.__esModule=!0;var r={helpers:{helperExpression:function(e){return"SubExpression"===e.type||("MustacheStatement"===e.type||"BlockStatement"===e.type)&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return 1===e.parts.length&&!r.helpers.scopedId(e)&&!e.depth}}};t.default=r,e.exports=t.default},177:function(e,t,n){"use strict";t.__esModule=!0;var r=n(72),s={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=r.indexOf(s.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=s.lookupLevel(e),"undefined"!=typeof console&&s.lookupLevel(s.level)<=e){var t=s.methodMap[e];console[t]||(t="log");for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i"function"==typeof e?e.call(t):e,data(e,t){for(;e&&t--;)e=e._parent;return e},hooks:{}};this.defaultHelperOptions={lookupProperty:i.lookupProperty}}render(e,t={}){this.contexts=[e],this.output=[],this.runtimeOptions={...t},this.container.helpers={...this.env.helpers,...t.helpers},this.container.partials={...this.env.partials,...t.partials},this.container.decorators={...this.env.decorators,...t.decorators},this.container.hooks={},this.processedRootDecorators=!1,this.processedDecoratorsForProgram.clear(),this.compileOptions.data&&(this.runtimeOptions.data=function(e,t){return t&&"root"in t||((t=t?Object(u.createFrame)(t):{}).root=e),t}(e,this.runtimeOptions.data)),Object(p.moveHelperToHooks)(this.container,"helperMissing",!1),Object(p.moveHelperToHooks)(this.container,"blockHelperMissing",!1),this.ast||(this.ast=s.a.parse(this.template));const n=e=>this.generateProgramFunction(this.ast)(e,this.runtimeOptions),r=this.processDecorators(this.ast,n);this.processedRootDecorators=!0;const i=r(this.context,t);return r===n?(this.output.push(i),this.output.join("")):i}Program(e){this.blockParamNames.unshift(e.blockParams),super.Program(e),this.blockParamNames.shift()}MustacheStatement(e){this.processStatementOrExpression(e)}BlockStatement(e){this.processStatementOrExpression(e)}PartialStatement(e){this.invokePartial(e)}PartialBlockStatement(e){this.invokePartial(e)}DecoratorBlock(e){}Decorator(e){}SubExpression(e){this.processStatementOrExpression(e)}PathExpression(e){const t=!e.depth&&!c.a.helpers.scopedId(e)&&this.blockParamIndex(e.parts[0]);let n;n=t?this.lookupBlockParam(t,e):e.data?this.lookupData(this.runtimeOptions.data,e):this.resolvePath(this.contexts[e.depth],e),this.output.push(n)}ContentStatement(e){this.output.push(e.value)}StringLiteral(e){this.output.push(e.value)}NumberLiteral(e){this.output.push(e.value)}BooleanLiteral(e){this.output.push(e.value)}UndefinedLiteral(){this.output.push(void 0)}NullLiteral(){this.output.push(null)}processDecorators(e,t){if(!this.processedDecoratorsForProgram.has(e)){this.processedDecoratorsForProgram.add(e);const n={};for(const r of e.body)g(r)&&(t=this.processDecorator(r,t,n))}return t}processDecorator(e,t,n){const r=this.setupDecoratorOptions(e),s=this.container.lookupProperty(this.container.decorators,r.name)(t,n,this.container,r);return Object.assign(s||t,n)}processStatementOrExpression(e){switch(function(e){if("parts"in e.path==0){const t=e.path,n=t.original;e.path={type:"PathExpression",data:!1,depth:0,parts:[n+""],original:n+"",loc:t.loc}}}(e),this.classifyNode(e)){case f:this.processSimpleNode(e);break;case h:this.processHelperNode(e);break;case d:this.processAmbiguousNode(e)}}classifyNode(e){const t=c.a.helpers.simpleId(e.path),n=t&&!!this.blockParamIndex(e.path.parts[0]);let r=!n&&c.a.helpers.helperExpression(e),s=!n&&(r||t);if(s&&!r){const t=e.path.parts[0],n=this.compileOptions;n.knownHelpers&&n.knownHelpers[t]?r=!0:n.knownHelpersOnly&&(s=!1)}return r?h:s?d:f}blockParamIndex(e){for(let t=0,n=this.blockParamNames.length;t=0)return[t,r]}}lookupBlockParam(e,t){const n=this.blockParamValues[e[0]][e[1]];return this.resolvePath(n,t,1)}lookupData(e,t){return t.depth&&(e=this.container.data(e,t.depth)),this.resolvePath(e,t)}processSimpleNode(e){const t=e.path;t.strict=!0;const n=this.resolveNodes(t)[0],r=this.container.lambda(n,this.context);m(e)?this.blockValue(e,r):this.output.push(r)}blockValue(e,t){const n=e.path.original,r=this.setupParams(e,n),s=this.container.hooks.blockHelperMissing.call(this.context,t,r);this.output.push(s)}processHelperNode(e){const t=e.path.parts[0];if(this.compileOptions.knownHelpers&&this.compileOptions.knownHelpers[t])this.invokeKnownHelper(e);else{if(this.compileOptions.knownHelpersOnly)throw new s.a.Exception("You specified knownHelpersOnly, but used the unknown helper "+t,e);this.invokeHelper(e)}}invokeKnownHelper(e){const t=e.path.parts[0],n=this.setupHelper(e,t),r=n.fn.call(n.context,...n.params,n.options);this.output.push(r)}invokeHelper(e){const t=e.path,n=t.original,r=c.a.helpers.simpleId(t),s=this.setupHelper(e,n),i=r&&s.fn?e.loc:t.loc;s.fn=r&&s.fn||this.resolveNodes(t)[0],s.fn||(this.compileOptions.strict?s.fn=this.container.strict(s.context,n,i):s.fn=this.container.hooks.helperMissing);const a=s.fn.call(s.context,...s.params,s.options);this.output.push(a)}invokePartial(e){var t,n;const{params:r}=e;if(r.length>1)throw new s.a.Exception(`Unsupported number of partial arguments: ${r.length}`,e);const i="SubExpression"===e.name.type?this.resolveNodes(e.name).join(""):e.name.original,a=this.setupParams(e,i);let o;if(a.helpers=this.container.helpers,a.partials=this.container.partials,a.decorators=this.container.decorators,"fn"in a&&a.fn!==y){var l;const{fn:e}=a,t=null===(l=a.data)||void 0===l?void 0:l["partial-block"];a.data=Object(u.createFrame)(a.data),o=a.data["partial-block"]=function(n,r={}){return r.data=Object(u.createFrame)(r.data),r.data["partial-block"]=t,e(n,r)},e.partials&&(a.partials={...a.partials,...e.partials})}let c={};0!==r.length||this.compileOptions.explicitPartialContext?1===r.length&&(c=this.resolveNodes(r[0])[0]):c=this.context,Object.keys(a.hash).length>0&&(c=Object.assign({},c,a.hash));const p=null!==(t=null!==(n=this.container.partials[i])&&void 0!==n?n:o)&&void 0!==t?t:s.a.VM.resolvePartial(void 0,void 0,a);if(void 0===p)throw new s.a.Exception(`The partial ${i} could not be found`);let h;"string"==typeof p?(h=this.env.compileAST(p,this.compileOptions),i in this.container.partials&&(this.container.partials[i]=h)):h=p;let d=h(c,a);"indent"in e&&(d=e.indent+(this.compileOptions.preventIndent?d:d.replace(/\n(?!$)/g,`\n${e.indent}`))),this.output.push(d)}processAmbiguousNode(e){var t;const n=e.path.parts[0],r=this.setupHelper(e,n);let{fn:i}=r;const a=i?e.loc:e.path.loc;i=null!==(t=i)&&void 0!==t?t:this.resolveNodes(e.path)[0],void 0===i&&(this.compileOptions.strict?i=this.container.strict(r.context,n,a):(i=null!=r.context?this.container.lookupProperty(r.context,n):r.context,null==i&&(i=this.container.hooks.helperMissing)));const o="function"==typeof i?i.call(r.context,...r.params,r.options):i;if(m(e)){const e=r.fn?o:this.container.hooks.blockHelperMissing.call(this.context,o,r.options);null!=e&&this.output.push(e)}else!1===e.escaped||!0===this.compileOptions.noEscape||"string"!=typeof o?this.output.push(o):this.output.push(s.a.escapeExpression(o))}setupHelper(e,t){return{fn:this.container.lookupProperty(this.container.helpers,t),context:this.context,params:this.resolveNodes(e.params),options:this.setupParams(e,t)}}setupDecoratorOptions(e){const t=e.path.original,n=function(e){return delete e.lookupProperty,e}(this.setupParams(e,t));if(e.params.length>0)if(this.processedRootDecorators)n.args=this.resolveNodes(e.params);else{const t=this.contexts.shift();n.args=this.resolveNodes(e.params),this.contexts.unshift(t)}else n.args=[];return n}setupParams(e,t){const n={name:t,hash:this.getHash(e),data:this.runtimeOptions.data,loc:{start:e.loc.start,end:e.loc.end},...this.defaultHelperOptions};return m(e)&&(n.fn=e.program?this.processDecorators(e.program,this.generateProgramFunction(e.program)):y,n.inverse=e.inverse?this.processDecorators(e.inverse,this.generateProgramFunction(e.inverse)):y),n}generateProgramFunction(e){var t,n;if(!e)return y;const r=(t,n={})=>{(n={...n}).data=n.data||this.runtimeOptions.data,n.blockParams&&(n.blockParams=n.blockParams.concat(this.runtimeOptions.blockParams)),n.partials=n.partials||this.runtimeOptions.partials;const r=this.runtimeOptions;this.runtimeOptions=n;const s=t!==this.context;s&&this.contexts.unshift(t),this.blockParamValues.unshift(n.blockParams||[]);const i=this.resolveNodes(e).join("");return this.blockParamValues.shift(),s&&this.contexts.shift(),this.runtimeOptions=r,i};return r.blockParams=null!==(t=null===(n=e.blockParams)||void 0===n?void 0:n.length)&&void 0!==t?t:0,r}getHash(e){const t={};if(!e.hash)return t;for(const{key:n,value:r}of e.hash.pairs)t[n]=this.resolveNodes(r)[0];return t}resolvePath(e,t,n=0){if(this.compileOptions.strict||this.compileOptions.assumeObjects)return this.strictLookup(e,t);for(;nn.render(e,t)},t.b=s.a;const v=function(){try{return new Function,!0}catch(e){return!1}}()?"compile":"compileAST"},239:function(e,t,n){var r,s; /* @license Papa Parse v5.2.0 https://github.com/mholt/PapaParse License: MIT */r=function e(){"use strict";var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,r=n&&/blob:/i.test((t.location||{}).protocol),s={},i=0,a={parse:function(n,r){var o=(r=r||{}).dynamicTyping||!1;if(k(o)&&(r.dynamicTypingFunction=o,o={}),r.dynamicTyping=o,r.transform=!!k(r.transform)&&r.transform,r.worker&&a.WORKERS_SUPPORTED){var l=function(){if(!a.WORKERS_SUPPORTED)return!1;var n,r,o=(n=t.URL||t.webkitURL||null,r=e.toString(),a.BLOB_URL||(a.BLOB_URL=n.createObjectURL(new Blob(["(",r,")();"],{type:"text/javascript"})))),l=new t.Worker(o);return l.onmessage=g,l.id=i++,s[l.id]=l}();return l.userStep=r.step,l.userChunk=r.chunk,l.userComplete=r.complete,l.userError=r.error,r.step=k(r.step),r.chunk=k(r.chunk),r.complete=k(r.complete),r.error=k(r.error),delete r.worker,void l.postMessage({input:n,config:r,workerId:l.id})}var d=null;return a.NODE_STREAM_INPUT,"string"==typeof n?d=r.download?new c(r):new p(r):!0===n.readable&&k(n.read)&&k(n.on)?d=new h(r):(t.File&&n instanceof File||n instanceof Object)&&(d=new u(r)),d.stream(n)},unparse:function(e,t){var n=!1,r=!0,s=",",i="\r\n",o='"',l=o+o,c=!1,u=null;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||a.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(s=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(i=t.newline),"string"==typeof t.quoteChar&&(o=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+o)}}();var p=new RegExp(f(o),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return d(null,e,c);if("object"==typeof e[0])return d(u||h(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:h(e.data[0])),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),d(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function h(e){if("object"!=typeof e)return[];var t=[];for(var n in e)t.push(n);return t}function d(e,t,n){var a="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var o=Array.isArray(e)&&0=this._config.preview;if(r)t.postMessage({results:o,workerId:a.WORKER_ID,finished:c});else if(k(this._config.chunk)&&!n){if(this._config.chunk(o,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);o=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(o.data),this._completeResults.errors=this._completeResults.errors.concat(o.errors),this._completeResults.meta=o.meta),this._completed||!c||!k(this._config.complete)||o&&o.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||o&&o.meta.paused||this._nextChunk(),o}this._halted=!0},this._sendError=function(e){k(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:a.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=a.RemoteChunkSize),l.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var s=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+s)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function u(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=a.LocalChunkSize),l.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function p(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function h(e){l.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=_((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=_((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=_((function(){this._streamCleanUp(),r=!0,this._streamData("")}),this),this._streamCleanUp=_((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function d(e){var t,n,r,s=Math.pow(2,53),i=-s,o=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)(e[-+]?\d+)?\s*$/,l=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,c=this,u=0,p=0,h=!1,d=!1,g=[],y={data:[],errors:[],meta:{}};if(k(e.step)){var b=e.step;e.step=function(t){if(y=t,w())S();else{if(S(),0===y.data.length)return;u+=t.data.length,e.preview&&u>e.preview?n.abort():(y.data=y.data[0],b(y,c))}}}function _(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function S(){if(y&&r&&(x("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines)for(var t=0;t=g.length?"__parsed_extra":g[r]),e.transform&&(a=e.transform(a,i)),a=O(i,a),"__parsed_extra"===i?(s[i]=s[i]||[],s[i].push(a)):s[i]=a}return e.header&&(r>g.length?x("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+r,p+n):r=r.length/2?"\r\n":"\r"}(s,l)),r=!1,e.delimiter)k(e.delimiter)&&(e.delimiter=e.delimiter(s),y.meta.delimiter=e.delimiter);else{var c=function(t,n,r,s,i){var o,l,c,u;i=i||[",","\t","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var p=0;p=o)return M(!0)}else for(C=u,u++;;){if(-1===(C=e.indexOf(t,C+1)))return h||_.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:v.length,index:u}),D();if(C===d-1)return D(e.substring(u,C).replace(E,t));if(t!==c||e[C+1]!==c){if(t===c||0===C||e[C-1]!==c){-1!==P&&P=o)return M(!0);break}_.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:v.length,index:u}),C++}}else C++}return D();function N(e){v.push(e),w=u}function T(t){var n=0;if(-1!==t){var r=e.substring(C+1,t);r&&""===r.trim()&&(n=r.length)}return n}function D(t){return h||(void 0===t&&(t=e.substring(u)),S.push(t),u=d,N(S),b&&F()),M()}function R(t){u=t,N(S),S=[],j=e.indexOf(r,u)}function M(e){return{data:v,errors:_,meta:{delimiter:n,linebreak:r,aborted:p,truncated:!!e,cursor:w+(a||0)}}}function F(){i(M()),v=[],_=[]}function B(r,s,i){var a={nextDelim:void 0,quoteSearch:void 0},o=e.indexOf(t,s+1);if(s0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):s(this);if(n.data&&n.ids){var a=r.createFrame(n.data);a.contextPath=r.appendContextPath(n.data.contextPath,n.name),n={data:a}}return i(t,n)}))},e.exports=t.default},242:function(e,t,n){"use strict";(function(r){t.__esModule=!0;var s,i=n(72),a=(s=n(82))&&s.__esModule?s:{default:s};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new a.default("Must pass iterator to #each");var n,s=t.fn,o=t.inverse,l=0,c="",u=void 0,p=void 0;function h(t,n,r){u&&(u.key=t,u.index=n,u.first=0===n,u.last=!!r,p&&(u.contextPath=p+t)),c+=s(e[t],{data:u,blockParams:i.blockParams([e[t],t],[p+t,null])})}if(t.data&&t.ids&&(p=i.appendContextPath(t.data.contextPath,t.ids[0])+"."),i.isFunction(e)&&(e=e.call(this)),t.data&&(u=i.createFrame(t.data)),e&&"object"==typeof e)if(i.isArray(e))for(var d=e.length;l=a.LAST_COMPATIBLE_COMPILER_REVISION&&t<=a.COMPILER_REVISION)){if(t2&&v.push("'"+this.terminals_[g]+"'");S=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[p]||p)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==p?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(S,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:c,expected:v})}}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+d+", token: "+p);switch(f[0]){case 1:t.push(p),n.push(this.lexer.yytext),r.push(this.lexer.yylloc),t.push(f[1]),p=null,h?(p=h,h=null):(o=this.lexer.yyleng,i=this.lexer.yytext,a=this.lexer.yylineno,c=this.lexer.yylloc,l>0&&l--);break;case 2:if(y=this.productions_[f[1]][1],k.$=n[n.length-y],k._$={first_line:r[r.length-(y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(y||1)].first_column,last_column:r[r.length-1].last_column},u&&(k._$.range=[r[r.length-(y||1)].range[0],r[r.length-1].range[1]]),void 0!==(m=this.performAction.call(k,i,o,a,this.yy,f[1],n,r)))return m;y&&(t=t.slice(0,-1*y*2),n=n.slice(0,-1*y),r=r.slice(0,-1*y)),t.push(this.productions_[f[1]][0]),n.push(k.$),r.push(k._$),b=s[t[t.length-2]][t[t.length-1]],t.push(b);break;case 3:return!0}}return!0}},t={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t,n,r,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)||(t=n,r=a,this.options.flex));a++);return t?((s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,n,r){function s(e,n){return t.yytext=t.yytext.substring(e,t.yyleng-n+e)}switch(n){case 0:if("\\\\"===t.yytext.slice(-2)?(s(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(s(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 15;break;case 1:case 5:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(s(5,9),"END_RAW_BLOCK");case 6:case 22:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:case 23:return 48;case 21:this.unput(t.yytext),this.popState(),this.begin("com");break;case 24:return 73;case 25:case 26:case 41:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return t.yytext=s(1,2).replace(/\\"/g,'"'),80;case 32:return t.yytext=s(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 42:return t.yytext=t.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};function n(){this.yy={}}return e.lexer=t,n.prototype=e,e.Parser=n,new n}();t.default=r,e.exports=t.default},256:function(e,t,n){"use strict";t.__esModule=!0;var r,s=(r=n(179))&&r.__esModule?r:{default:r};function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=e}function a(e,t,n){void 0===t&&(t=e.length);var r=e[t-1],s=e[t-2];return r?"ContentStatement"===r.type?(s||!n?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(r.original):void 0:n}function o(e,t,n){void 0===t&&(t=-1);var r=e[t+1],s=e[t+2];return r?"ContentStatement"===r.type?(s||!n?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(r.original):void 0:n}function l(e,t,n){var r=e[null==t?0:t+1];if(r&&"ContentStatement"===r.type&&(n||!r.rightStripped)){var s=r.value;r.value=r.value.replace(n?/^\s+/:/^[ \t]*\r?\n?/,""),r.rightStripped=r.value!==s}}function c(e,t,n){var r=e[null==t?e.length-1:t-1];if(r&&"ContentStatement"===r.type&&(n||!r.leftStripped)){var s=r.value;return r.value=r.value.replace(n?/\s+$/:/[ \t]+$/,""),r.leftStripped=r.value!==s,r.leftStripped}}i.prototype=new s.default,i.prototype.Program=function(e){var t=!this.options.ignoreStandalone,n=!this.isRootSeen;this.isRootSeen=!0;for(var r=e.body,s=0,i=r.length;s0)throw new s.default("Invalid path: "+r,{loc:n});".."===c&&a++}}return{type:"PathExpression",data:e,depth:a,parts:i,original:r,loc:n}},t.prepareMustache=function(e,t,n,r,s,i){var a=r.charAt(3)||r.charAt(2),o="{"!==a&&"&"!==a;return{type:/\*/.test(r)?"Decorator":"MustacheStatement",path:e,params:t,hash:n,escaped:o,strip:s,loc:this.locInfo(i)}},t.prepareRawBlock=function(e,t,n,r){i(e,n);var s={type:"Program",body:t,strip:{},loc:r=this.locInfo(r)};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:s,openStrip:{},inverseStrip:{},closeStrip:{},loc:r}},t.prepareBlock=function(e,t,n,r,a,o){r&&r.path&&i(e,r);var l=/\*/.test(e.open);t.blockParams=e.blockParams;var c=void 0,u=void 0;if(n){if(l)throw new s.default("Unexpected inverse block on decorator",n);n.chain&&(n.program.body[0].closeStrip=r.strip),u=n.strip,c=n.program}return a&&(a=c,c=t,t=a),{type:l?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:c,openStrip:e.strip,inverseStrip:u,closeStrip:r&&r.strip,loc:this.locInfo(o)}},t.prepareProgram=function(e,t){if(!t&&e.length){var n=e[0].loc,r=e[e.length-1].loc;n&&r&&(t={source:n.source,start:{line:n.start.line,column:n.start.column},end:{line:r.end.line,column:r.end.column}})}return{type:"Program",body:e,strip:{},loc:t}},t.preparePartialBlock=function(e,t,n,r){return i(e,n),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:n&&n.strip,loc:this.locInfo(r)}};var r,s=(r=n(82))&&r.__esModule?r:{default:r};function i(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var n={loc:e.path.loc};throw new s.default(e.path.original+" doesn't match "+t,n)}}},258:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.Compiler=l,t.precompile=function(e,t,n){if(null==e||"string"!=typeof e&&"Program"!==e.type)throw new s.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);"data"in(t=t||{})||(t.data=!0),t.compat&&(t.useDepths=!0);var r=n.parse(e,t),i=(new n.Compiler).compile(r,t);return(new n.JavaScriptCompiler).compile(i,t)},t.compile=function(e,t,n){if(void 0===t&&(t={}),null==e||"string"!=typeof e&&"Program"!==e.type)throw new s.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);"data"in(t=i.extend({},t))||(t.data=!0),t.compat&&(t.useDepths=!0);var r=void 0;function a(){var r=n.parse(e,t),s=(new n.Compiler).compile(r,t),i=(new n.JavaScriptCompiler).compile(s,t,void 0,!0);return n.template(i)}function o(e,t){return r||(r=a()),r.call(this,e,t)}return o._setup=function(e){return r||(r=a()),r._setup(e)},o._child=function(e,t,n,s){return r||(r=a()),r._child(e,t,n,s)},o};var s=r(n(82)),i=n(72),a=r(n(137)),o=[].slice;function l(){}function c(e,t){if(e===t)return!0;if(i.isArray(e)&&i.isArray(t)&&e.length===t.length){for(var n=0;n1)throw new s.default("Unsupported number of partial arguments: "+n.length,e);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var r=e.name.original,i="SubExpression"===e.name.type;i&&this.accept(e.name),this.setupFullMustacheParams(e,t,void 0,!0);var a=e.indent||"";this.options.preventIndent&&a&&(this.opcode("appendContent",a),a=""),this.opcode("invokePartial",i,r,a),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){u(e);var t=this.classifySexpr(e);"simple"===t?this.simpleSexpr(e):"helper"===t?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,t,n){var r=e.path,s=r.parts[0],i=null!=t||null!=n;this.opcode("getContext",r.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",n),r.strict=!0,this.accept(r),this.opcode("invokeAmbiguous",s,i)},simpleSexpr:function(e){var t=e.path;t.strict=!0,this.accept(t),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,t,n){var r=this.setupFullMustacheParams(e,t,n),i=e.path,o=i.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",r.length,o);else{if(this.options.knownHelpersOnly)throw new s.default("You specified knownHelpersOnly, but used the unknown helper "+o,e);i.strict=!0,i.falsy=!0,this.accept(i),this.opcode("invokeHelper",r.length,i.original,a.default.helpers.simpleId(i))}},PathExpression:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var t=e.parts[0],n=a.default.helpers.scopedId(e),r=!e.depth&&!n&&this.blockParamIndex(t);r?this.opcode("lookupBlockParam",r,e.parts):t?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,n):this.opcode("pushContext")},StringLiteral:function(e){this.opcode("pushString",e.value)},NumberLiteral:function(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var t=e.pairs,n=0,r=t.length;for(this.opcode("pushHash");n=0)return[t,s]}}}},259:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var s=n(134),i=r(n(82)),a=n(72),o=r(n(260));function l(e){this.value=e}function c(){}c.prototype={nameLookup:function(e,t){return this.internalNameLookup(e,t)},depthedLookup:function(e){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(e),")"]},compilerInfo:function(){var e=s.COMPILER_REVISION;return[e,s.REVISION_CHANGES[e]]},appendToBuffer:function(e,t,n){return a.isArray(e)||(e=[e]),e=this.source.wrap(e,t),this.environment.isSimple?["return ",e,";"]:n?["buffer += ",e,";"]:(e.appendToBuffer=!0,e)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(e,t){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",e,",",JSON.stringify(t),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(e,t,n,r){this.environment=e,this.options=t,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!r,this.name=this.environment.name,this.isChild=!!n,this.context=n||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(e,t),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var s=e.opcodes,a=void 0,o=void 0,l=void 0,c=void 0;for(l=0,c=s.length;l0&&(n+=", "+r.join(", "));var s=0;Object.keys(this.aliases).forEach((function(e){var r=t.aliases[e];r.children&&r.referenceCount>1&&(n+=", alias"+ ++s+"="+e,r.children[0]="alias"+s)})),this.lookupPropertyFunctionIsUsed&&(n+=", "+this.lookupPropertyFunctionVarDeclaration());var i=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&i.push("blockParams"),this.useDepths&&i.push("depths");var a=this.mergeSource(n);return e?(i.push(a),Function.apply(this,i)):this.source.wrap(["function(",i.join(","),") {\n ",a,"}"])},mergeSource:function(e){var t=this.environment.isSimple,n=!this.forceBuffer,r=void 0,s=void 0,i=void 0,a=void 0;return this.source.each((function(e){e.appendToBuffer?(i?e.prepend(" + "):i=e,a=e):(i&&(s?i.prepend("buffer += "):r=!0,a.add(";"),i=a=void 0),s=!0,t||(n=!1))})),n?i?(i.prepend("return "),a.add(";")):s||this.source.push('return "";'):(e+=", buffer = "+(r?"":this.initializeBuffer()),i?(i.prepend("return buffer + "),a.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(r?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(e){var t=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(e,0,n);var r=this.popStack();n.splice(1,0,r),this.push(this.source.functionCall(t,"call",n))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),t=[this.contextName(0)];this.setupHelperArgs("",0,t,!0),this.flushInline();var n=this.topStack();t.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(e,"call",t),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack((function(e){return[" != null ? ",e,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,t,n,r){var s=0;r||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(e[s++])),this.resolvePath("context",e,s,t,n)},lookupBlockParam:function(e,t){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",t,1)},lookupData:function(e,t,n){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",t,0,!0,n)},resolvePath:function(e,t,n,r,s){var i=this;if(this.options.strict||this.options.assumeObjects)this.push(function(e,t,n,r){var s=t.popStack(),i=0,a=n.length;for(e&&a--;ithis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var t=0,n=e.length;te.split(",").map((e=>e.trim())),p=e=>e.map((e=>{var t;return null!==(t=e.id)&&void 0!==t?t:e.name})),h=(e,t,n=!1)=>e.reduce(((e,r)=>t.includes(r.id)||t.includes(r.name)?{...e,matched:[...e.matched,r]}:n?{...e,other:[...e.other,r]}:e),{matched:[],other:[]});var d=n(239),f=n.n(d),m=n(2),g=n(29),y=n(47),b=n.n(y);var v=n(127);function _(e){return Object(r.uniqWith)(e.flat(),(({name:e},{name:t})=>e===t))}function k(e){const t=Object(s.t)().ply,[n]=e,i=n.rows.length;e.forEach((e=>{if(e.rows.length!==i)throw t.rowCountMismatch()}));const a=Object(r.map)(e,"rows"),o=[];for(let e=0;e(t.condition||[]).every(Boolean)}},function(){const{help:e,args:t}=Object(s.u)().alterColumn,n=Object(s.t)().alterColumn;return{name:"alterColumn",type:"datatable",inputTypes:["datatable"],help:e,args:{column:{aliases:["_"],types:["string"],required:!0,help:t.column},name:{types:["string"],help:t.name},type:{types:["string"],help:t.type,options:["null","boolean","number","string","date"]}},fn:(e,t)=>{if(!t.column||!t.type&&!t.name)return e;const s=e.columns.find((e=>e.name===t.column));if(!s)throw n.columnNotFound(t.column);const i=t.name||s.name,a=t.type||s.meta.type,o=e.columns.reduce(((e,n)=>(n.name!==t.name&&(n.name!==s.name?e.push(n):e.push({id:i,name:i,meta:{type:a}})),e)),[]);let l=e=>e;t.type&&(l=function(){switch(a){case"string":return"date"===s.meta.type?e=>new Date(e).toISOString():String;case"number":return Number;case"date":return e=>new Date(e).valueOf();case"boolean":return Boolean;case"null":return()=>null;default:throw n.cannotConvertType(a)}}());const c=e.rows.map((e=>({...Object(r.omit)(e,s.name),[i]:l(e[s.name])})));return{...e,columns:o,rows:c}}}},function(){const{help:e,args:t}=Object(s.u)().any;return{name:"any",type:"boolean",inputTypes:["null"],help:e,args:{condition:{aliases:["_"],types:["boolean"],required:!0,multi:!0,help:t.condition}},fn:(e,t)=>(t.condition||[]).some(Boolean)}},function(){const{help:e,args:t}=Object(s.u)().as;return{name:"as",type:"datatable",inputTypes:["string","boolean","number","null"],help:e,args:{name:{types:["string"],aliases:["_"],help:t.name,default:"value"}},fn:(e,t)=>({type:"datatable",columns:[{id:t.name,name:t.name,meta:{type:Object(i.getType)(e)}}],rows:[{[t.name]:e}]})}},function(){const{help:e,args:t}=Object(s.u)().axisConfig,n=Object(s.t)().axisConfig;return{name:"axisConfig",aliases:[],type:"axisConfig",inputTypes:["null"],help:e,args:{max:{types:["number","string","null"],help:t.max},min:{types:["number","string","null"],help:t.min},position:{types:["string"],help:t.position,options:Object.values(i.Position),default:"left"},show:{types:["boolean"],help:t.show,default:!0},tickSize:{types:["number","null"],help:t.tickSize}},fn:(e,t)=>{const{position:r,min:s,max:a,...l}=t;if(!Object.values(i.Position).includes(r))throw n.invalidPosition(r);const c="string"==typeof s?o.a.utc(s).valueOf():s,u="string"==typeof a?o.a.utc(a).valueOf():a;if(null!=c&&isNaN(c))throw n.invalidMinDateString(s);if(null!=u&&isNaN(u))throw n.invalidMaxDateString(a);return{max:u,min:c,type:"axisConfig",position:r,...l}}}},function(){const{help:e}=Object(s.u)().clear;return{name:"clear",type:"null",inputTypes:["null"],help:e,args:{},fn:()=>null}},function(){const{help:e,args:t}=Object(s.u)().columns;return{name:"columns",type:"datatable",inputTypes:["datatable"],help:e,args:{include:{aliases:["_"],types:["string"],help:t.include},exclude:{types:["string"],help:t.exclude}},fn:(e,t)=>{const{include:n,exclude:s}=t,{columns:i,rows:a,...o}=e;let l={...e};if(s){const e=u(s),{matched:t,other:n}=h(l.columns,e,!0),i=p(t),a=t.length?l.rows.map((e=>Object(r.omit)(e,i))):l.rows;l={rows:a,columns:n,...o}}if(n){const e=u(n),{matched:t}=h(l.columns,e),s=p(t),i=e.reduce(((e,n)=>{const s=Object(r.find)(t,(e=>e.id===n||e.name===n));return s?[...e,s]:e}),[]),a=i.length?l.rows.map((e=>Object(r.pick)(e,s))):[];l={rows:a,columns:i,...o}}return l}}},l.b,function(){const{help:e,args:t}=Object(s.u)().containerStyle,n=Object(s.t)().containerStyle;return{name:"containerStyle",aliases:[],type:"containerStyle",inputTypes:["null"],help:e,args:{backgroundColor:{types:["string"],help:t.backgroundColor},backgroundImage:{types:["string"],help:t.backgroundImage},backgroundRepeat:{types:["string"],help:t.backgroundRepeat,default:"no-repeat",options:Object.values(i.BackgroundRepeat)},backgroundSize:{types:["string"],help:t.backgroundSize,default:"contain",options:Object.values(i.BackgroundSize)},border:{types:["string"],help:t.border},borderRadius:{types:["string"],help:t.borderRadius},opacity:{types:["number"],help:t.opacity},overflow:{types:["string"],help:t.overflow,options:Object.values(i.Overflow),default:"hidden"},padding:{types:["string"],help:t.padding}},fn:(e,t)=>{const{backgroundImage:r,backgroundSize:s,backgroundRepeat:i,...a}=t,o={type:"containerStyle",...a};if(r){if(!Object(c.isValidUrl)(r))throw n.invalidBackgroundImage();o.backgroundImage=`url(${r})`,o.backgroundSize=s,o.backgroundRepeat=i}return JSON.parse(JSON.stringify(o))}}},function(){const{help:e}=Object(s.u)().context;return{name:"context",help:e,args:{},fn:e=>e}},function(){const{help:e,args:t}=Object(s.u)().csv,n=Object(s.t)().csv;return{name:"csv",type:"datatable",inputTypes:["null"],help:e,args:{data:{aliases:["_"],types:["string"],required:!0,help:t.data},delimiter:{types:["string"],help:t.delimiter},newline:{types:["string"],help:t.newline}},fn(e,t){const{data:r,delimiter:s,newline:i}=t,a={transform:e=>e.indexOf('"')>=0?e.trim().replace(/(^\"|\"$)/g,""):e};null!=s&&(a.delimiter=s),null!=i&&(a.newline=i);const o=f.a.parse(r,a),{data:l,errors:c}=o;if(c.length>0)throw n.invalidInputCSV();return l.reduce(((e,t,n)=>{if(0===n)t.forEach((t=>e.columns.push({id:t.trim(),name:t.trim(),meta:{type:"string"}})));else{const n=t.reduce(((t,n,r)=>(t[e.columns[r].name]=n,t)),{});e.rows.push(n)}return e}),{type:"datatable",columns:[],rows:[]})}}},function(){const{help:e,args:t}=Object(s.u)().date,n=Object(s.t)().date;return{name:"date",type:"number",help:e,inputTypes:["null"],args:{value:{aliases:["_"],types:["string"],help:t.value},format:{types:["string"],help:t.format}},fn:(e,t)=>{const{value:r,format:s}=t,i=r&&s?o.a.utc(r,s).toDate():r?new Date(r):new Date;if(isNaN(i.getTime()))throw n.invalidDateInput(r);return i.valueOf()}}},function(){const{help:e,args:t}=Object(s.u)().do;return{name:"do",help:e,args:{fn:{aliases:["_","exp","expression","function"],multi:!0,help:t.fn}},fn:e=>e}},function(){const{help:e,args:t}=Object(s.u)().dropdownControl;return{name:"dropdownControl",aliases:[],type:"render",inputTypes:["datatable"],help:e,args:{filterColumn:{types:["string"],required:!0,help:t.filterColumn},labelColumn:{types:["string"],required:!1,help:t.labelColumn},valueColumn:{types:["string"],required:!0,help:t.valueColumn},filterGroup:{types:["string"],help:t.filterGroup}},fn:(e,{valueColumn:t,filterColumn:n,filterGroup:s,labelColumn:i})=>{let a=[];const o=i||t,l=e.rows.filter((e=>null!==e[t]&&void 0!==e[t]));return l.length>0&&(a=l.map((e=>[e[t],e[o]])),a=Object(r.uniqBy)(a,(e=>e[0]))),{type:"render",as:"dropdown_filter",value:{column:n||t,choices:a,filterGroup:s}}}}},function(){const{help:e,args:t}=Object(s.u)().eq;return{name:"eq",type:"boolean",inputTypes:["boolean","number","string","null"],help:e,args:{value:{aliases:["_"],types:["boolean","number","string","null"],required:!0,help:t.value}},fn:(e,t)=>e===t.value}},function(){const{help:e,args:t}=Object(s.u)().exactly;return{name:"exactly",aliases:[],type:"filter",help:e,inputTypes:["filter"],args:{column:{types:["string"],aliases:["field","c"],required:!0,help:t.column},value:{types:["string"],aliases:["v","val"],required:!0,help:t.value},filterGroup:{types:["string"],help:t.filterGroup}},fn:(e,t)=>{const{value:n,column:r,filterGroup:s}=t,i={type:"filter",filterType:"exactly",value:n,column:r,filterGroup:s,and:[]};return{...e,and:[...e.and,i]}}}},function(){const{help:e,args:t}=Object(s.u)().filterrows;return{name:"filterrows",aliases:[],type:"datatable",inputTypes:["datatable"],help:e,args:{fn:{resolve:!1,aliases:["_","exp","expression","function"],types:["boolean"],required:!0,help:t.fn}},fn:(e,{fn:t})=>Object(m.defer)((()=>Object(m.combineLatest)(e.rows.map((n=>t({...e,rows:[n]})))))).pipe(Object(g.map)((t=>e.rows.filter(((e,n)=>t[n])))),Object(g.map)((t=>({...e,rows:t}))))}},function(){const{help:e,args:t}=Object(s.u)().formatdate;return{name:"formatdate",type:"string",inputTypes:["number","string"],help:e,args:{format:{aliases:["_"],types:["string"],required:!0,help:t.format}},fn:(e,t)=>t.format?o.a.utc(new Date(e)).format(t.format):o.a.utc(new Date(e)).toISOString()}},function(){const{help:e,args:t}=Object(s.u)().formatnumber;return{name:"formatnumber",type:"string",help:e,inputTypes:["number"],args:{format:{aliases:["_"],types:["string"],help:t.format,required:!0}},fn:(e,t)=>t.format?b()(e).format(t.format):String(e)}},function(){const{help:e,args:t}=Object(s.u)().getCell,n=Object(s.t)().getCell;return{name:"getCell",help:e,inputTypes:["datatable"],args:{column:{types:["string"],aliases:["_","c"],help:t.column},row:{types:["number"],aliases:["r"],help:t.row,default:0}},fn:(e,t)=>{const r=e.rows[t.row];if(!r)throw n.rowNotFound(t.row);const{column:s=e.columns[0].name}=t,i=r[s];if(void 0===i)throw n.columnNotFound(s);return i}}},function(){const{help:e,args:t}=Object(s.u)().gt;return{name:"gt",type:"boolean",inputTypes:["number","string"],help:e,args:{value:{aliases:["_"],types:["number","string"],required:!0,help:t.value}},fn:(e,t)=>{const{value:n}=t;return typeof e==typeof n&&e>n}}},function(){const{help:e,args:t}=Object(s.u)().gte;return{name:"gte",type:"boolean",inputTypes:["number","string"],help:e,args:{value:{aliases:["_"],types:["number","string"],required:!0,help:t.value}},fn:(e,t)=>{const{value:n}=t;return typeof e==typeof n&&e>=n}}},function(){const{help:e,args:t}=Object(s.u)().head;return{name:"head",aliases:[],type:"datatable",inputTypes:["datatable"],help:e,args:{count:{aliases:["_"],types:["number"],help:t.count,default:1}},fn:(e,t)=>({...e,rows:Object(r.take)(e.rows,t.count)})}},function(){const{help:e,args:t}=Object(s.u)().if;return{name:"if",help:e,args:{condition:{types:["boolean"],aliases:["_"],help:t.condition,required:!0},then:{resolve:!1,help:t.then},else:{resolve:!1,help:t.else}},fn:(e,t)=>Object(m.defer)((()=>{var n,r,s;return null!==(n=t.condition?null===(r=t.then)||void 0===r?void 0:r.call(t):null===(s=t.else)||void 0===s?void 0:s.call(t))&&void 0!==n?n:Object(m.of)(e)}))}},function(){const{help:e,args:t}=Object(s.u)().lt;return{name:"lt",type:"boolean",inputTypes:["number","string"],help:e,args:{value:{aliases:["_"],types:["number","string"],required:!0,help:t.value}},fn:(e,t)=>{const{value:n}=t;return typeof e==typeof n&&e{const{value:n}=t;return typeof e==typeof n&&e<=n}}},function(){const{help:e,args:t}=Object(s.u)().joinRows,n=Object(s.t)().joinRows;return{name:"joinRows",type:"string",help:e,inputTypes:["datatable"],args:{column:{aliases:["_"],types:["string"],required:!0,help:t.column},distinct:{types:["boolean"],help:t.distinct,default:!0},quote:{types:["string"],help:t.quote,default:'"\'"'},separator:{aliases:["sep","delimiter"],types:["string"],help:t.separator,default:","}},fn:(e,{column:t,separator:r,quote:s,distinct:i})=>{if(!e.columns.find((e=>e.name===t)))throw n.columnNotFound(t);return e.rows.reduce(((e,n)=>{const r=n[t];return i&&e.includes(r)?e:e.concat(r)}),[]).map((e=>`${s}${((e,t)=>{if(void 0===t||""===t)return e;{const n=new RegExp(t,"g");return e.replace(/\\/g,"\\\\").replace(n,`\\${t}`)}})(e,s)}${s}`)).join(r)}}},function(){const{help:e,args:t}=Object(v.b)().mapCenter;return{name:"mapCenter",help:e,type:"mapCenter",inputTypes:["null"],args:{lat:{types:["number"],required:!0,help:t.lat},lon:{types:["number"],required:!0,help:t.lon},zoom:{types:["number"],required:!0,help:t.zoom}},fn:(e,t)=>({type:"mapCenter",...t})}},function(){const{help:e,args:t}=Object(s.u)().neq;return{name:"neq",type:"boolean",help:e,context:{types:["boolean","number","string","null"]},args:{value:{aliases:["_"],types:["boolean","number","string","null"],required:!0,help:t.value}},fn:(e,t)=>e!==t.value}},function(){const{help:e,args:t}=Object(s.u)().ply,n=Object(s.t)().ply;return{name:"ply",type:"datatable",inputTypes:["datatable"],help:e,args:{by:{types:["string"],help:t.by,multi:!0},expression:{types:["datatable"],resolve:!1,multi:!0,aliases:["exp","fn","function"],help:t.expression}},fn(e,t){var s,i;if(!t)return e;const a=null!==(s=null===(i=t.by)||void 0===i?void 0:i.map((t=>{const r=e.columns.find((({name:e})=>e===t));if(!r)throw n.columnNotFound(t);return r})))&&void 0!==s?s:[],o=t.by?Object.values(Object(r.groupBy)(e.rows,(e=>JSON.stringify(Object(r.pick)(e,t.by))))).map((t=>({...e,rows:t}))):[e],l=o.map((e=>{var n,r;return Object(m.combineLatest)(null!==(n=null===(r=t.expression)||void 0===r?void 0:r.map((t=>Object(m.defer)((()=>t(e))))))&&void 0!==n?n:[Object(m.of)(e)]).pipe(Object(g.map)(k))}));return(l.length?Object(m.combineLatest)(l):Object(m.of)([])).pipe(Object(g.map)((n=>{const s=_([a].concat(Object(r.map)(n,"columns"))),i=Object(r.flatten)(n.map(((e,n)=>e.rows.map((e=>({...Object(r.pick)(o[n].rows[0],t.by),...e}))))));return{...e,rows:i,columns:s}})))}}},function(){const{help:e,args:t}=Object(s.u)().render;return{name:"render",aliases:[],type:"render",inputTypes:["render"],help:e,args:{as:{types:["string"],help:t.as,options:["advanced_filter","debug","dropdown_filter","error","image","markdown","metric","pie","plot","progress","repeatImage","shape","table","time_filter","text"]},css:{types:["string"],help:t.css,default:`"${S.p}"`},containerStyle:{types:["containerStyle"],help:t.containerStyle,default:"{containerStyle}"}},fn:(e,t)=>({...e,as:t.as||e.as,css:t.css||S.p,containerStyle:t.containerStyle})}},function(){const{help:e,args:t}=Object(s.u)().replace;return{name:"replace",type:"string",help:e,inputTypes:["string"],args:{pattern:{aliases:["_","regex"],types:["string"],help:t.pattern},flags:{aliases:["modifiers"],types:["string"],help:t.flags,default:"g"},replacement:{types:["string"],help:t.replacement,default:'""'}},fn:(e,t)=>e.replace(new RegExp(t.pattern,t.flags),t.replacement)}},function(){const{help:e,args:t}=Object(s.u)().rounddate;return{name:"rounddate",type:"number",help:e,inputTypes:["number"],args:{format:{aliases:["_"],types:["string"],help:t.format}},fn:(e,t)=>t.format?o.a.utc(o.a.utc(e).format(t.format),t.format).valueOf():e}},function(){const{help:e}=Object(s.u)().rowCount;return{name:"rowCount",aliases:[],type:"number",inputTypes:["datatable"],help:e,args:{},fn:e=>e.rows.length}},function(){const{help:e,args:t}=Object(s.u)().seriesStyle;return{name:w,help:e,type:"seriesStyle",inputTypes:["null"],args:{bars:{types:["number"],help:t.bars},color:{types:["string"],help:t.color},fill:{types:["number","boolean"],help:t.fill,default:!1,options:[!0,!1]},horizontalBars:{types:["boolean"],help:t.horizontalBars,options:[!0,!1]},label:{types:["string"],help:t.label},lines:{types:["number"],help:t.lines},points:{types:["number"],help:t.points},stack:{types:["number","null"],help:t.stack}},fn:(e,t)=>({type:w,...t})}},function(){const{help:e,args:t}=Object(s.u)().sort;return{name:"sort",type:"datatable",inputTypes:["datatable"],help:e,args:{by:{types:["string"],aliases:["_","column"],multi:!1,help:t.by},reverse:{types:["boolean"],help:t.reverse,options:[!0,!1],default:!1}},fn:(e,t)=>{const n=t.by||e.columns[0].name;return{...e,rows:t.reverse?Object(r.sortBy)(e.rows,n).reverse():Object(r.sortBy)(e.rows,n)}}}},function(){const{help:e,args:t}=Object(s.u)().staticColumn;return{name:"staticColumn",type:"datatable",inputTypes:["datatable"],help:e,args:{name:{types:["string"],aliases:["_","column"],help:t.name,required:!0},value:{types:["string","number","boolean","null"],help:t.value,default:null}},fn:(e,t)=>{const n=e.rows.map((e=>({...e,[t.name]:t.value}))),r=Object(O.e)(t.value),s=[...e.columns],i=s.findIndex((({name:e})=>e===t.name)),a={id:t.name,name:t.name,meta:{type:r}};return i>-1?s[i]=a:s.push(a),{...e,columns:s,rows:n}}}},function(){const{help:e,args:t}=Object(s.u)().string;return{name:"string",inputTypes:["null"],aliases:[],type:"string",help:e,args:{value:{aliases:["_"],types:["string","number","boolean"],multi:!0,help:t.value}},fn:(e,t)=>t.value.join("")}},function(){const{help:e,args:t}=Object(s.u)().table;return{name:"table",aliases:[],type:"render",inputTypes:["datatable"],help:e,args:{font:{types:["style"],default:"{font}",help:t.font},paginate:{types:["boolean"],default:!0,help:t.paginate,options:[!0,!1]},perPage:{types:["number"],default:10,help:t.perPage},showHeader:{types:["boolean"],default:!0,help:t.showHeader,options:[!0,!1]}},fn:(e,t)=>({type:"render",as:"table",value:{datatable:e,...t}})}},function(){const{help:e,args:t}=Object(s.u)().tail;return{name:"tail",aliases:[],type:"datatable",inputTypes:["datatable"],help:e,args:{count:{aliases:["_"],types:["number"],help:t.count,default:1}},fn:(e,t)=>({...e,rows:Object(r.takeRight)(e.rows,t.count)})}},function(){const{help:e,args:t}=Object(s.u)().timefilter,n=Object(s.t)().timefilter;return{name:"timefilter",aliases:[],type:"filter",inputTypes:["filter"],help:e,args:{column:{types:["string"],aliases:["field","c"],default:"@timestamp",help:t.column},from:{types:["string"],aliases:["f","start"],help:t.from},to:{types:["string"],aliases:["t","end"],help:t.to},filterGroup:{types:["string"],help:"The group name for the filter"}},fn:(e,t)=>{if(!t.from&&!t.to)return e;const{from:r,to:s,column:i,filterGroup:a}=t,o={type:"filter",filterType:"time",column:i,filterGroup:a,and:[]};function l(e,{roundUp:t}){const r=P.a.parse(e,{roundUp:t});if(!r||!r.isValid())throw n.invalidString(e);return r.toISOString()}return s&&(o.to=l(s,{roundUp:!0})),r&&(o.from=l(r,{roundUp:!1})),{...e,and:[...e.and,o]}}}},function(){const{help:e,args:t}=Object(s.u)().timefilterControl;return{name:"timefilterControl",aliases:[],type:"render",inputTypes:["null"],help:e,args:{column:{types:["string"],aliases:["field","c"],help:t.column,default:"@timestamp"},compact:{types:["boolean"],help:t.compact,default:!0,options:[!0,!1]},filterGroup:{types:["string"],help:t.filterGroup}},fn:(e,t)=>({type:"render",as:"time_filter",value:t})}},function(){const{help:e,args:t}=Object(v.b)().timerange;return{name:"timerange",help:e,type:"timerange",inputTypes:["null"],args:{from:{types:["string"],required:!0,help:t.from},to:{types:["string"],required:!0,help:t.to}},fn:(e,t)=>({type:"timerange",...t})}},function(){const{help:e,args:t}=Object(s.u)().switch;return{name:"switch",help:e,args:{case:{types:["case"],aliases:["_"],resolve:!1,multi:!0,required:!0,help:t.case},default:{aliases:["finally"],resolve:!1,help:t.default}},fn:function e(t,n){return Object(m.defer)((()=>{var r,s;if(!n.case.length)return null!==(r=null===(s=n.default)||void 0===s?void 0:s.call(n))&&void 0!==r?r:Object(m.of)(t);const[i,...a]=n.case;return i().pipe(Object(m.defaultIfEmpty)(void 0),Object(m.switchMap)((r=>null!=r&&r.matches?Object(m.of)(r.result):e(t,{...n,case:a}))))}))}}},function(){const{help:e,args:t}=Object(s.u)().case;return{name:"case",type:"case",help:e,args:{when:{aliases:["_"],resolve:!1,help:t.when},if:{types:["boolean"],help:t.if},then:{resolve:!1,required:!0,help:t.then}},fn:(e,{if:t,then:n,when:r})=>Object(m.defer)((()=>{var n;const s=null===(n=null!=t?t:null==r?void 0:r().pipe(Object(g.map)((t=>t===e))))||void 0===n||n;return Object(m.isObservable)(s)?s:Object(m.of)(s)})).pipe(Object(g.concatMap)((e=>(e?n():Object(m.of)(null)).pipe(Object(g.map)((t=>({matches:e,result:t,type:"case"})))))))}}],E=()=>{};var C=n(235);const I={exactly:function(e){if(e.filterType!==i.FilterType.exactly)throw new Error("Filter is not an exactly filter");return{term:{[e.column]:{value:e.value}}}},time:function(e){if(e.filterType!==i.FilterType.time||!e.column)throw new Error("column is required for Elasticsearch range filters");return{range:{[e.column]:{gte:e.from,lte:e.to}}}},luceneQueryString:function(e){if(e.filterType!==i.FilterType.luceneQueryString)throw new Error("Filter is not a lucene filter");return{query_string:{query:e.query||"*"}}}},L=e=>Array.isArray(e)?e.filter((e=>Boolean(e))):[];function A(e){return L(e.map((e=>{try{return function(e){if(!e.filterType||!I[e.filterType])throw new Error(`Unknown filter type: ${e.filterType}`);try{return I[e.filterType](e)}catch(t){throw new Error(`Could not create elasticsearch filter from ${e.filterType}`)}}(e)}catch(e){return}})))}var N=n(63),T=n(48);function D(e){const t={string:["string","text","keyword","_type","_id","_index","geo_point","ip"],number:["float","half_float","scaled_float","double","integer","long","short","byte","token_count","_version"],date:["date","datetime"],boolean:["boolean"],null:["null"]},n=Object.keys(t).find((n=>t[n].includes(e)));if(n)return n;throw new Error(`Canvas does not yet support type: ${e}`)}function R(e){return e.replace(/[\(\)]/g,"_")}const M=[function(){const{help:e}=Object(s.u)().location;return{name:"location",type:"datatable",inputTypes:["null"],args:{},help:e,fn:()=>new Promise((e=>navigator.geolocation.getCurrentPosition((function(t){const{latitude:n,longitude:r}=t.coords;return e({type:"datatable",columns:[{id:"latitude",name:"latitude",meta:{type:"number"}},{id:"longitude",name:"longitude",meta:{type:"number"}}],rows:[{latitude:n,longitude:r}]})}),E,{maximumAge:5e3})))}},function(){const{help:e,args:t}=Object(s.u)().markdown;return{name:"markdown",aliases:[],type:"render",help:e,inputTypes:["datatable","null"],args:{content:{aliases:["_","expression"],types:["string"],help:t.content,default:'""',multi:!0},font:{types:["style"],help:t.font,default:"{font}"},openLinksInNewTab:{types:["boolean"],help:t.openLinksInNewTab,default:!1}},fn:async(e,t)=>{const{Handlebars:r}=await Promise.all([n.e(0),n.e(16)]).then(n.bind(null,440)),s=t.content.map((e=>r[C.a](String(e),{knownHelpersOnly:!0}))),i={columns:[],rows:[],type:null,...e};return{type:"render",as:"markdown",value:{content:s.map((e=>e(i))).join(""),font:t.font,openLinksInNewTab:t.openLinksInNewTab}}}}},function(){const{help:e,args:t}=Object(s.u)().urlparam;return{name:"urlparam",aliases:[],type:"string",help:e,inputTypes:["null"],args:{param:{types:["string"],aliases:["_","var","variable"],help:t.param,multi:!1,required:!0},default:{types:["string"],default:'""',help:t.default}},fn:(e,t)=>new URL(window.location.href).searchParams.get(t.param)||t.default}},function(){const{help:e,args:t}=Object(s.u)().escount;return{name:"escount",type:"number",context:{types:["filter"]},help:e,args:{query:{types:["string"],aliases:["_","q"],help:t.query,default:'"-_index:.kibana"'},index:{types:["string"],aliases:["dataView"],default:"_all",help:t.index}},fn:(e,t,n)=>{e.and=e.and.concat([{type:"filter",filterType:"luceneQueryString",query:t.query,and:[]}]);const r=function(e,t){return t.size&&(e={...e,size:t.size}),t.and&&(e.body.query.bool.must=A(t.and)),e}({index:t.index,body:{track_total_hits:!0,size:0,query:{bool:{must:[{match_all:{}}]}}}},e),s=N.searchService.getService().search,i={params:{...r}};return Object(m.lastValueFrom)(s.search(i)).then((e=>e.rawResponse.hits.total))}}},function(){const{help:e,args:t}=Object(s.u)().esdocs;return{name:"esdocs",type:"datatable",context:{types:["filter"]},help:e,args:{query:{types:["string"],aliases:["_","q"],help:t.query,default:"-_index:.kibana"},count:{types:["number"],default:1e3,help:t.count},fields:{help:t.fields,types:["string"]},index:{types:["string"],aliases:["dataView"],default:"_all",help:t.index},metaFields:{help:t.metaFields,types:["string"]},sort:{types:["string"],help:t.sort}},fn:(e,t,{abortSignal:s})=>Object(m.from)(n.e(15).then(n.t.bind(null,441,7))).pipe(Object(m.switchMap)((n=>{const{count:r,index:i,fields:a,sort:o}=t;let l=n.select({autoQuoteTableNames:!0,autoQuoteFieldNames:!0,autoQuoteAliasNames:!0,nameQuoteCharacter:'"'});if(i&&l.from(i),a&&a.split(",").map((e=>e.trim())).forEach((e=>l=l.field(e))),o){const[e,t]=o.split(",").map((e=>e.trim()));e&&l.order(`"${e}"`,"asc"===t)}const c={query:l.toString(),fetch_size:r,field_multi_value_leniency:!0,filter:{bool:{must:[{match_all:{}},...A([...e.and,{type:"filter",filterType:"luceneQueryString",query:t.query,and:[]}])]}}};return N.searchService.getService().search.search({params:c},{abortSignal:s,strategy:T.SQL_SEARCH_STRATEGY})})),Object(m.catchError)((e=>{if(e.err){const{type:t,reason:n}=e.err.attributes;e.message="parsing_exception"===t?`Couldn't parse Elasticsearch SQL query. You may need to add double quotes to names containing special characters. Check your query and try again. Error: ${n}`:`Unexpected error from Elasticsearch: ${t} - ${n}`}else e.message=`Unexpected error from Elasticsearch: ${e.message}`;return Object(m.throwError)((()=>e))})),Object(m.map)((({rawResponse:e})=>{var t,n;const s=null!==(t=null===(n=e.columns)||void 0===n?void 0:n.map((({name:e,type:t})=>({id:R(e),name:R(e),meta:{type:D(t)}}))))&&void 0!==t?t:[],i=s.map((({name:e})=>e));return{type:"datatable",meta:{type:"essql"},columns:s,rows:e.rows.map((e=>Object(r.zipObject)(i,e)))}})))}},...j];var F=n(128);const B=[F.c];var H=n(91),$=n(104);const q={timeRange:{from:"now-15m",to:"now"},disableTriggers:!0,renderMode:"noInteractivity"};function V({embeddablePersistableStateService:e}){return function(){const{help:t,args:n}=Object(s.u)().embeddable,i=e=>t=>{const n=Object($.a)(t.arguments.config[0]),r=t.arguments.type[0];if(void 0===n.savedObjectId){const s=e({...n,type:r});t.arguments.config[0]=Object($.b)(s),t.arguments.type[0]=s.type}return t};return{name:"embeddable",help:t,args:{config:{aliases:["_"],types:["string"],required:!0,help:n.config},type:{types:["string"],required:!0,help:n.type}},context:{types:["filter"]},type:F.a,fn:(e,t)=>{const n=e?e.and:[],r=Object($.a)(t.config);return{type:F.a,input:{...q,...r,filters:Object(H.b)(n)},generatedAt:Date.now(),embeddableType:t.type}},extract(t){const n=Object($.a)(t.config[0]);if(n.savedObjectId)return{state:t,references:[{name:"embeddable.savedObjectId",type:t.type[0],id:n.savedObjectId}]};const{state:r,references:s}=e.extract({...n,type:t.type[0]}),{type:i,...a}=r;return{state:{...t,config:[Object($.b)(a)],type:[i]},references:s}},inject(t,n){const r=Object($.a)(t.config[0]),s=n.find((e=>"embeddable.savedObjectId"===e.name));if(s)r.savedObjectId=s.id,t.config[0]=Object($.b)(r),t.type[0]=s.type;else{const{type:s,...i}=e.inject({...r,type:t.type[0]},n);t.config[0]=Object($.b)(i),t.type[0]=s}return t},migrations:()=>Object(r.mapValues)(e.getAllMigrations(),i)}}}const U={from:"now-15m",to:"now"};function z(){const{help:e,args:t}=Object(s.u)().savedLens;return{name:"savedLens",help:e,args:{id:{types:["string"],required:!1,help:t.id},timerange:{types:["timerange"],help:t.timerange,required:!1},title:{types:["string"],help:t.title,required:!1},palette:{types:["palette"],help:t.palette,required:!1}},type:F.a,fn:(e,{id:t,timerange:n,title:r,palette:s})=>{const i=e?e.and:[];return{type:F.a,input:{id:t,savedObjectId:t,filters:Object(H.b)(i),timeRange:n||U,title:null===r?void 0:r,disableTriggers:!0,palette:s},embeddableType:F.b.lens,generatedAt:Date.now()}},extract(e){const t="savedLens.id",n=[{name:t,type:"lens",id:e.id[0]}];return{state:{...e,id:[t]},references:n}},inject(e,t){const n=t.find((e=>"savedLens.id"===e.name));return n&&(e.id[0]=n.id),e}}}const K={from:"now-15m",to:"now"};function G(){const{help:e,args:t}=Object(s.u)().savedMap;return{name:"savedMap",help:e,args:{id:{types:["string"],required:!1,help:t.id},center:{types:["mapCenter"],help:t.center,required:!1},hideLayer:{types:["string"],help:t.hideLayer,required:!1,multi:!0},timerange:{types:["timerange"],help:t.timerange,required:!1},title:{types:["string"],help:t.title,required:!1}},type:F.a,fn:(e,t)=>{const n=e?e.and:[],r=t.center?{lat:t.center.lat,lon:t.center.lon,zoom:t.center.zoom}:void 0;return{type:F.a,input:{id:t.id,attributes:{title:""},savedObjectId:t.id,filters:Object(H.b)(n),timeRange:t.timerange||K,refreshConfig:{pause:!1,value:0},mapCenter:r,hideFilterActions:!0,title:null===t.title?void 0:t.title,isLayerTOCOpen:!1,hiddenLayers:t.hideLayer||[]},embeddableType:F.b.map,generatedAt:Date.now()}},extract(e){const t="savedMap.id",n=[{name:t,type:"map",id:e.id[0]}];return{state:{...e,id:[t]},references:n}},inject(e,t){const n=t.find((e=>"savedMap.id"===e.name));return n&&(e.id[0]=n.id),e}}}function W(){const{help:e,args:t}=Object(s.u)().savedSearch;return{name:"savedSearch",help:e,args:{id:{types:["string"],required:!1,help:t.id}},type:F.a,fn:(e,{id:t})=>{const n=e?e.and:[];return{type:F.a,input:{id:t,...Object(H.a)(n)},embeddableType:F.b.search,generatedAt:Date.now()}},extract(e){const t="savedSearch.id",n=[{name:t,type:"search",id:e.id[0]}];return{state:{...e,id:[t]},references:n}},inject(e,t){const n=t.find((e=>"savedSearch.id"===e.name));return n&&(e.id[0]=n.id),e}}}const Q={from:"now-15m",to:"now"};function J(){const{help:e,args:t}=Object(s.u)().savedVisualization;return{name:"savedVisualization",help:e,args:{id:{types:["string"],required:!1,help:t.id},timerange:{types:["timerange"],help:t.timerange,required:!1},colors:{types:["seriesStyle"],help:t.colors,multi:!0,required:!1},hideLegend:{types:["boolean"],help:t.hideLegend,required:!1},title:{types:["string"],help:t.title,required:!1}},type:F.a,fn:(e,{id:t,timerange:n,colors:s,hideLegend:i,title:a})=>{const o=e?e.and:[],l={};return s&&(l.colors=s.reduce(((e,t)=>(t.label&&t.color&&(e[t.label]=t.color),e)),{})),!0===i&&(l.legendOpen=!1),{type:F.a,input:{id:t,savedObjectId:t,disableTriggers:!0,disabledActions:["ACTION_EDIT_IN_LENS"],timeRange:n?Object(r.omit)(n,"type"):Q,filters:Object(H.b)(o),vis:l,title:null===a?void 0:a},embeddableType:F.b.visualization,generatedAt:Date.now()}},extract(e){const t="savedVisualization.id",n=[{name:t,type:"visualization",id:e.id[0]}];return{state:{...e,id:[t]},references:n}},inject(e,t){const n=t.find((e=>"savedVisualization.id"===e.name));return n&&(e.id[0]=n.id),e}}}var Y=n(16),Z=n(105),X=n.n(Z),ee=n(21),te=n.n(ee),ne=n(90),re=n(52);const se={[F.b.map]:function(e){const t=[];if(t.push("savedMap"),t.push(`id="${e.savedObjectId}"`),void 0!==e.title&&t.push(`title="${e.title}"`),e.mapCenter&&t.push(`center={mapCenter lat=${e.mapCenter.lat} lon=${e.mapCenter.lon} zoom=${e.mapCenter.zoom}}`),e.timeRange&&t.push(`timerange={timerange from="${e.timeRange.from}" to="${e.timeRange.to}"}`),e.hiddenLayers&&e.hiddenLayers.length)for(const n of e.hiddenLayers)t.push(`hideLayer="${n}"`);return t.join(" ")},[F.b.visualization]:function(e){var t,n;const r=[];return r.push("savedVisualization"),r.push(`id="${e.savedObjectId}"`),void 0!==e.title&&r.push(`title="${e.title}"`),e.timeRange&&r.push(`timerange={timerange from="${e.timeRange.from}" to="${e.timeRange.to}"}`),null!==(t=e.vis)&&void 0!==t&&t.colors&&Object.entries(e.vis.colors).map((([e,t])=>`colors={seriesStyle label="${e}" color="${t}"}`)).reduce(((e,t)=>r.push(t)),0),void 0!==(null===(n=e.vis)||void 0===n?void 0:n.legendOpen)&&!1===e.vis.legendOpen&&r.push("hideLegend=true"),r.join(" ")},[F.b.lens]:function(e,t){const n=[];return n.push("savedLens"),n.push(`id="${e.savedObjectId}"`),void 0!==e.title&&n.push(`title="${e.title}"`),e.timeRange&&n.push(`timerange={timerange from="${e.timeRange.from}" to="${e.timeRange.to}"}`),e.palette&&n.push(`palette={${Object(O.h)(t.get(e.palette.name).toExpression(e.palette.params))}}`),n.join(" ")}};var ie=n(86),ae=n(17);const{embeddable:oe}=s.j,le={},ce=[(e,t)=>{const n=((e,t)=>{const n=e.i18n.Context,r=({embeddable:t})=>{const n=X()(e.application.currentAppId$,void 0);if(!n)return null;const r={getCurrentPath:()=>{const t=e.application.getUrlForApp(n);return window.location.pathname.replace(t,"")+window.location.search+window.location.hash}};return Object(ae.jsx)(re.EmbeddablePanel,{embeddable:t,containerContext:r})};return t=>Object(ae.jsx)("div",{className:ie.CANVAS_EMBEDDABLE_CLASSNAME,style:{width:"100%",height:"100%",cursor:"auto"}},Object(ae.jsx)(n,null,Object(ae.jsx)(ne.a,{theme:{theme$:e.theme.theme$}},Object(ae.jsx)(r,{embeddable:t}))))})(e);return()=>({name:"embeddable",displayName:oe.getDisplayName(),help:oe.getHelpDescription(),reuseDomNode:!0,render:async(e,{input:r,embeddableType:s},i)=>{const a=i.getElementId(),o=t.presentationUtil.labsService.isProjectEnabled("labs:canvas:byValueEmbeddable");if(le[a]){const e=le[a];"updateInput"in e&&(e.updateInput(r),e.reload())}else{const l=Array.from(t.embeddable.getEmbeddableFactories()).find((e=>e.type===s));if(!l)throw i.done(),new re.EmbeddableFactoryNotFoundError(s);const c={...r,id:a,executionContext:{type:"canvas"}},u=r.savedObjectId?l.createFromSavedObject(r.savedObjectId,c).then((e=>(le[a]=e,e))):l.create(c).then((e=>{if(e&&!Object(re.isErrorEmbeddable)(e))return le[a]=e,e}));le[a]=u;const p=await(async()=>u)(),h=await t.charts.palettes.getPalettes();le[a]=p,te.a.unmountComponentAtNode(e);const d=p.getInput$().subscribe((function(e){const t=function(e,t,n,r){return r?function(e,t){return`embeddable config="${Object($.b)(e)}" type="${t}"`}(e,t):se[t]?se[t](e,n):void 0}(e,s,h,o);t&&i.onEmbeddableInputChange(t)}));te.a.render(n(p),e,(()=>i.done())),i.onDestroy((()=>(d.unsubscribe(),i.onEmbeddableDestroyed(),delete le[a],te.a.unmountComponentAtNode(e))))}}})}];var ue=n(70),pe=n(18),he=n(3);const de=({value:e="",onChange:t,commit:n})=>Object(ae.jsx)("form",{onSubmit:t=>{t.preventDefault(),n(e)},className:"canvasAdvancedFilter"},Object(ae.jsx)(pe.EuiFlexGroup,{gutterSize:"xs"},Object(ae.jsx)(pe.EuiFlexItem,null,Object(ae.jsx)("input",{type:"text",className:"canvasAdvancedFilter__input",placeholder:he.i18n.translate("xpack.canvas.renderer.advancedFilter.inputPlaceholder",{defaultMessage:"Enter filter expression"}),value:e,onChange:e=>t(e.target.value)})),Object(ae.jsx)(pe.EuiFlexItem,{grow:!1},Object(ae.jsx)("button",{className:"canvasAdvancedFilter__button",type:"submit"},he.i18n.translate("xpack.canvas.renderer.advancedFilter.applyButtonLabel",{defaultMessage:"Apply",description:"This refers to applying the filter to the Canvas workpad"})))));de.defaultProps={value:""};const fe=Object(ue.compose)(Object(ue.withState)("value","onChange",(({value:e})=>e||"")))(de),{advancedFilter:me}=s.j;var ge=n(78),ye=n.n(ge);const{set:be,del:ve}=ye.a;function _e(e,t,n=[]){let s=!1;const i=Object(O.d)(t),a=n.reduce(((t,n)=>Object(r.get)(t,`chain[0].arguments.${n}[0]`)!==e[n]?(s=!0,e[n]?be(t,`chain.0.arguments.${n}.0`,e[n]):ve(t,`chain.0.arguments.${n}`)):t),i);return{changed:s,newAst:a}}const ke=({initialValue:e="",commit:t,choices:n=[]})=>{const[r,s]=Object(Y.useState)(e);Object(Y.useEffect)((()=>{s(e)}),[e]);let i=[{value:"%%CANVAS_MATCH_ALL%%",text:`-- ${he.i18n.translate("xpack.canvas.renderer.dropdownFilter.matchAllOptionLabel",{defaultMessage:"ANY",description:"The dropdown filter option to match any value in the field."})} --`}];i=i.concat(n.map((e=>({value:e[0],text:e[1]}))));const a=i.map((e=>{const{text:t}=e,n=e.value;return{text:t,selected:n===r,value:n}}));return Object(ae.jsx)("div",{className:"canvasDropdownFilter"},Object(ae.jsx)(pe.EuiSelect,{className:"canvasDropdownFilter__select",value:r,onChange:e=>{if(e&&e.target){const n=e.target;s(n.value),t(n.value)}},"data-test-subj":"canvasDropdownFilter__select",options:a,fullWidth:!0,compressed:!0}))},{dropdownFilter:Se}=s.j,we="%%CANVAS_MATCH_ALL%%",Oe=e=>{if(""===e)return we;const t=Object(O.d)(e);return Object(r.get)(t,"chain[0].arguments.value[0]",we)};var xe=n(53),Pe=n(132);const{quickRanges:je}=Pe.a,Ee=[{start:"now-1d/d",end:"now-1d/d",label:je.getYesterdayLabel()},{start:"now/d",end:"now",label:je.getTodayLabel()},{start:"now-24h",end:"now",label:je.getLast24HoursLabel()},{start:"now-7d",end:"now",label:je.getLast7DaysLabel()},{start:"now-14d",end:"now",label:je.getLast2WeeksLabel()},{start:"now-30d",end:"now",label:je.getLast30DaysLabel()},{start:"now-90d",end:"now",label:je.getLast90DaysLabel()},{start:"now-1y",end:"now",label:je.getLast1YearLabel()}],Ce=({filter:e,commit:t,dateFormat:n,commonlyUsedRanges:s=[]})=>{const{column:i,start:a,end:o}=function(e){const t=Object(O.d)(e);return{column:Object(r.get)(t,"chain[0].arguments.column[0]"),start:Object(r.get)(t,"chain[0].arguments.from[0]"),end:Object(r.get)(t,"chain[0].arguments.to[0]")}}(e);return Object(ae.jsx)("div",{className:"canvasTimeFilter"},Object(ae.jsx)(pe.EuiSuperDatePicker,{width:"full",start:a,end:o,isPaused:!1,onTimeChange:(e=>({start:n,end:r})=>{t(`timefilter from="${n}" to=${r} column=${e}`)})(i),showUpdateButton:!1,dateFormat:n,commonlyUsedRanges:s.length?s:Ee}))},{timeFilter:Ie}=s.j,Le=[(e,t)=>{const{uiSettings:n,theme:r}=e,s=(n.get(xe.UI_SETTINGS.TIMEPICKER_QUICK_RANGES)||[]).map((({from:e,to:t,display:n})=>({start:e,end:t,label:n}))),i=n.get("dateFormat");return()=>({name:"time_filter",displayName:Ie.getDisplayName(),help:Ie.getHelpDescription(),reuseDomNode:!0,render:async(e,t,n)=>{let a=n.getFilter();if(void 0===a||0!==a.indexOf("timefilter"))a="timefilter column=@timestamp from=now-24h to=now",n.event({name:"applyFilterAction",data:a});else if(""!==a){const{changed:e,newAst:r}=_e(t,a,["column","filterGroup"]);e&&n.event({name:"applyFilterAction",data:Object(O.h)(r)})}te.a.render(Object(ae.jsx)(ne.a,{theme:{theme$:r.theme$}},Object(ae.jsx)(Ce,{commit:e=>n.event({name:"applyFilterAction",data:e}),filter:a,commonlyUsedRanges:s,dateFormat:i})),e,(()=>n.done())),n.onDestroy((()=>{te.a.unmountComponentAtNode(e)}))}})},(e,t)=>()=>({name:"dropdown_filter",displayName:Se.getDisplayName(),help:Se.getHelpDescription(),reuseDomNode:!0,height:50,render(t,n,r){let s=r.getFilter();if(""===s||void 0!==s&&s.includes("exactly")){if(""!==s){const{changed:e,newAst:t}=_e(n,s,["filterGroup"]);e&&r.event({name:"applyFilterAction",data:Object(O.h)(t)})}}else s="",r.event({name:"applyFilterAction",data:s});const i=Object(ae.jsx)(ke,{commit:e=>{if("%%CANVAS_MATCH_ALL%%"===e)r.event({name:"applyFilterAction",data:""});else{const t={type:"expression",chain:[{type:"function",function:"exactly",arguments:{value:[e],column:[n.column],filterGroup:[n.filterGroup]}}]},s=Object(O.h)(t);r.event({name:"applyFilterAction",data:s})}},choices:n.choices||[],initialValue:Oe(s)});te.a.render(Object(ae.jsx)(ne.a,{theme:{theme$:e.theme.theme$}},i),t,(()=>r.done())),r.onDestroy((()=>{te.a.unmountComponentAtNode(t)}))}}),(e,t)=>()=>({name:"advanced_filter",displayName:me.getDisplayName(),help:me.getHelpDescription(),reuseDomNode:!0,height:50,render(t,n,r){te.a.render(Object(ae.jsx)(ne.a,{theme:{theme$:e.theme.theme$}},Object(ae.jsx)(fe,{commit:e=>r.event({name:"applyFilterAction",data:e}),value:r.getFilter()})),t,(()=>r.done())),r.onDestroy((()=>{te.a.unmountComponentAtNode(t)}))}})];var Ae=n(39),Ne=n(40),Te=n(33),De=n(41),Re=n(42),Me=n(34);const Fe=[Te.debugRendererFactory,Te.errorRendererFactory,Ae.imageRendererFactory,Me.shapeRendererFactory,Me.progressRendererFactory,De.revealImageRendererFactory,Re.repeatImageRendererFactory,Ne.metricRendererFactory];var Be=n(187),He=n(188),$e=n(189),qe=n(192),Ve=n(193);const Ue=[He.a,$e.a],ze=[Be.b,Ve.b,qe.b],Ke=[...Ue],Ge=[...ze,...ce,...Le,...Fe];class plugin_CanvasSrcPlugin{setup(e,t){t.canvas.addFunctions(M),t.canvas.addTypes(B),t.canvas.addRenderers(Ke),e.getStartServices().then((([e,n])=>{const r=[V({embeddablePersistableStateService:{extract:n.embeddable.extract,inject:n.embeddable.inject,getAllMigrations:n.embeddable.getAllMigrations}}),z,G,W,J];t.canvas.addFunctions(r),t.canvas.addRenderers(Ge.map((t=>t(e,n))))})),t.canvas.addDatasourceUIs((async()=>{const{datasourceSpecs:e}=await Promise.all([n.e(0),n.e(1)]).then(n.bind(null,443));return e})),t.canvas.addElements((async()=>{const{initializeElements:r}=await Promise.all([n.e(0),n.e(1)]).then(n.bind(null,443));return r(e,t)})),t.canvas.addModelUIs((async()=>{const{modelSpecs:e}=await Promise.all([n.e(0),n.e(1)]).then(n.bind(null,443));return e})),t.canvas.addViewUIs((async()=>{const{initializeViews:r}=await Promise.all([n.e(0),n.e(1)]).then(n.bind(null,443));return r(e,t)})),t.canvas.addArgumentUIs((async()=>{const{initializeArgs:r}=await Promise.all([n.e(0),n.e(1)]).then(n.bind(null,443));return r(e,t)})),t.canvas.addTagUIs((async()=>{const{tagSpecs:e}=await Promise.all([n.e(0),n.e(1)]).then(n.bind(null,443));return e})),t.canvas.addTransformUIs((async()=>{const{transformSpecs:e}=await Promise.all([n.e(0),n.e(1)]).then(n.bind(null,443));return e}))}start(e,t){}}},72:function(e,t,n){"use strict";t.__esModule=!0,t.extend=o,t.indexOf=function(e,t){for(var n=0,r=e.length;n":">",'"':""","'":"'","`":"`","=":"="},s=/[&<>"'`=]/g,i=/[&<>"'`=]/;function a(e){return r[e]}function o(e){for(var t=1;t{if(!e)return null;const n=i.a.parse(e,{roundUp:t});return n&&n.isValid()?n.valueOf():null};function u(e){const t=e.filter((e=>void 0!==e.filterType&&e.filterType===l&&void 0!==e.from&&void 0!==e.to)).filter((e=>null!==c(e.from)&&null!==c(e.to,!0))),n=Object(a.minBy)(t,(e=>c(e.from))),r=Object(a.maxBy)(t,(e=>c(e.to,!0)));return null!=n&&n.from&&null!=r&&r.to?{from:n.from,to:r.to}:void 0}function p(e){const t=e.map((e=>({...e,type:e.filterType})));return Object(o.a)(t).map(((e,t)=>{const{group:n,...s}=e;return Object(r.buildQueryFilter)(s,t.toString(),"",{group:n})}))}function h(e){return{timeRange:u(e),filters:p(e)}}}}]);