@vizzly/services 0.15.0-dev-509defaf8b80e792fe01ec64fbeadf5c6b393948 → 0.15.0-dev-7a0950140407e5d00da47b05fcfee58cb3dd2399
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -29,7 +29,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
29
29
|
`)===0?v0.substr(1,v0.length):v0}).forEach(function(v0){var E0=v0.split(":"),S0=E0.shift().trim();if(S0){var G0=E0.join(":").trim();Z.append(S0,G0)}}),Z}T.call(R.prototype);function G(V,Z){if(!(this instanceof G))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');Z||(Z={}),this.type="default",this.status=Z.status===void 0?200:Z.status,this.ok=this.status>=200&&this.status<300,this.statusText=Z.statusText===void 0?"":""+Z.statusText,this.headers=new z(Z.headers),this.url=Z.url||"",this._initBody(V)}T.call(G.prototype),G.prototype.clone=function(){return new G(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new z(this.headers),url:this.url})},G.error=function(){var V=new G(null,{status:0,statusText:""});return V.type="error",V};var s0=[301,302,303,307,308];G.redirect=function(V,Z){if(s0.indexOf(Z)===-1)throw new RangeError("Invalid status code");return new G(null,{status:Z,headers:{location:V}})},c.DOMException=l.DOMException;try{new c.DOMException}catch{c.DOMException=function(Z,d0){this.message=Z,this.name=d0;var v0=Error(Z);this.stack=v0.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function b0(V,Z){return new Promise(function(d0,v0){var E0=new R(V,Z);if(E0.signal&&E0.signal.aborted)return v0(new c.DOMException("Aborted","AbortError"));var S0=new XMLHttpRequest;function G0(){S0.abort()}S0.onload=function(){var h1={status:S0.status,statusText:S0.statusText,headers:E(S0.getAllResponseHeaders()||"")};h1.url="responseURL"in S0?S0.responseURL:h1.headers.get("X-Request-URL");var Y1="response"in S0?S0.response:S0.responseText;setTimeout(function(){d0(new G(Y1,h1))},0)},S0.onerror=function(){setTimeout(function(){v0(new TypeError("Network request failed"))},0)},S0.ontimeout=function(){setTimeout(function(){v0(new TypeError("Network request failed"))},0)},S0.onabort=function(){setTimeout(function(){v0(new c.DOMException("Aborted","AbortError"))},0)};function v1(h1){try{return h1===""&&l.location.href?l.location.href:h1}catch{return h1}}S0.open(E0.method,v1(E0.url),!0),E0.credentials==="include"?S0.withCredentials=!0:E0.credentials==="omit"&&(S0.withCredentials=!1),"responseType"in S0&&(M.blob?S0.responseType="blob":M.arrayBuffer&&E0.headers.get("Content-Type")&&E0.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(S0.responseType="arraybuffer")),Z&&typeof Z.headers=="object"&&!(Z.headers instanceof z)?Object.getOwnPropertyNames(Z.headers).forEach(function(h1){S0.setRequestHeader(h1,d(Z.headers[h1]))}):E0.headers.forEach(function(h1,Y1){S0.setRequestHeader(Y1,h1)}),E0.signal&&(E0.signal.addEventListener("abort",G0),S0.onreadystatechange=function(){S0.readyState===4&&E0.signal.removeEventListener("abort",G0)}),S0.send(typeof E0._bodyInit>"u"?null:E0._bodyInit)})}return b0.polyfill=!0,l.fetch||(l.fetch=b0,l.Headers=z,l.Request=R,l.Response=G),c.Headers=z,c.Request=R,c.Response=G,c.fetch=b0,c})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var a=o.fetch?o:n;e=a.fetch,e.default=a.fetch,e.fetch=a.fetch,e.Headers=a.Headers,e.Request=a.Request,e.Response=a.Response,t.exports=e})(zO,zO.exports);var $u=zO.exports;const b6=CM($u);var YM={},M6=z0&&z0.__awaiter||function(t,e,o,n){function a(p){return p instanceof o?p:new o(function(c){c(p)})}return new(o||(o=Promise))(function(p,c){function l(y){try{g(n.next(y))}catch(_){c(_)}}function M(y){try{g(n.throw(y))}catch(_){c(_)}}function g(y){y.done?p(y.value):a(y.value).then(l,M)}g((n=n.apply(t,e||[])).next())})};Object.defineProperty(YM,"__esModule",{value:!0});YM.Monitor=void 0;const s6=ki;class c6{static timeRequest(e,o,n){return function(...a){return M6(this,void 0,void 0,function*(){const p=performance.now(),c=yield n(...a),M=performance.now()-p;return s6.VizzlyApiClientLogger.debug(`[@vizzly/api-client timing] ${e.toUpperCase()} ${o} - ${M.toFixed(2)}ms`),c})}}}YM.Monitor=c6;var rr={};Object.defineProperty(rr,"__esModule",{value:!0});rr.Path=void 0;class xi{static removeAnyWrappingForwardSlash(e){return e.startsWith("/")?xi.removeAnyWrappingForwardSlash(e.slice(1)):e.endsWith("/")?xi.removeAnyWrappingForwardSlash(e.slice(0,-1)):e}static baseIsValid(e){return e.startsWith("https://")||e.startsWith("http://")||e.startsWith(".")}static buildPath(e,o){const n=xi.removeAnyWrappingForwardSlash(e),a=xi.removeAnyWrappingForwardSlash(o),p=xi.baseIsValid(e)?"":"/";return n==""&&a==""?"/":a==""?`${p}${n}`:n!=""&&a!=""?`${p}${n}/${a}`:`${p}${a}`}static addQueryParam(e,o,n){const[a,p]=e.split("#"),[c,l]=a.split("?");var M=new URLSearchParams(l);M.set(o,n);var g=c+"?"+M.toString()+(p?`#${p}`:"");return g}static hasHashtag(e){return e.includes("#")}static setVizzlyHashtagValue(e,o){return`${e}#vizzly_${o}`}static getVizzlyHashtagValue(e){return e.split("#vizzly_")[1]||null}}rr.Path=xi;const z6="@vizzly/api-client",O6="0.0.115",l6="NONE",u6="src/index.ts",A6="dist/index.js",d6="dist/index.d.ts",f6="commonjs",q6=["dist"],h6={"@types/jest":"^29.5.12","@types/lodash":"^4.17.0","@types/uuid":"^9.0.8","@vizzly/auth":"^0.2.16",jest:"^29.6.0",lodash:"^4.17.21",nock:"^13.5.4",prettier:"^3.2.5","ts-jest":"^29.1.1","ts-loader":"^9.5.1",typescript:"^5.3.2",uuid:"^9.0.1"},W6={test:". ./secrets.env && jest --runInBand","test:ci":"jest",build:"rm -rf ./dist && tsc",dev:"tsc -w",format:"prettier --write ./src/** ./__tests__/**",prepublish:"yarn build"},m6={"@vizzly/semantic-layer-public":">=0.0.244","@vizzly/sqlbuilder-public":">=0.1.80","cross-fetch":"^4.0.0"},g6={name:z6,version:O6,private:!1,license:l6,source:u6,main:A6,types:d6,type:f6,files:q6,devDependencies:h6,scripts:W6,dependencies:m6};var y6=z0&&z0.__awaiter||function(t,e,o,n){function a(p){return p instanceof o?p:new o(function(c){c(p)})}return new(o||(o=Promise))(function(p,c){function l(y){try{g(n.next(y))}catch(_){c(_)}}function M(y){try{g(n.throw(y))}catch(_){c(_)}}function g(y){y.done?p(y.value):a(y.value).then(l,M)}g((n=n.apply(t,e||[])).next())})},R6=z0&&z0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nr,"__esModule",{value:!0});nr.Api=void 0;const v6=R6($u),L6=YM,Gz=ki,_6=rr;class N6{constructor(e,o,n=()=>({})){this.host=o,this.extraHeaders=n,this.auth=e}execute(e){return y6(this,void 0,void 0,function*(){var o,n;const a=this.auth.buildAuthHeaders(e.acceptedAuthParams),p=Object.assign(Object.assign({},e.headers||{}),this.extraHeaders()||{}),c=_6.Path.buildPath(this.host,e.path),M=yield L6.Monitor.timeRequest(e.method,c,v6.default)(c,{method:e.method,headers:Object.assign(Object.assign({"Content-Type":"application/json",Accept:"application/json","Vizzly-User-Agent":`${Gz.VizzlyApiClientLogger.UserAgentProduct}${this.originApp()} (Using client ${(o=g6)===null||o===void 0?void 0:o.version})`},a),p),redirect:"follow",referrerPolicy:"no-referrer",body:e.body?JSON.stringify(e.body):null,signal:e.abortSignal});let g=!((n=M.headers.get("content-type"))===null||n===void 0)&&n.includes("json")?yield M.json():M.text();const y=M.headers.get("vizzly-query-engine-request-id")||"-",_=M.headers.get("x-request-id")||"-";return M.status===500&&Gz.VizzlyApiClientLogger.debug(`[TRACING] QE; ${y} - API; ${_}`),Gz.VizzlyApiClientLogger.debug(`[TRACING] QE; ${y} - API; ${_}`),{body:g,status:M.status,headers:M.headers}})}originApp(){if(!(typeof window<"u"&&window.document)){const o=process.env.NODE_ENV==="test"?"tests":"",n=process.env.VIZZLY_ORIGIN_APP||o||"";return n==""?"":` (${n})`}return""}getAuth(){return this.auth}}nr.Api=N6;var KM={};Object.defineProperty(KM,"__esModule",{value:!0});KM.FailedToUpdateQueryEngineUser=void 0;class T6 extends Error{constructor(e){super(e),this.name="FailedToUpdateQueryEngineUser"}}KM.FailedToUpdateQueryEngineUser=T6;var y1=z0&&z0.__awaiter||function(t,e,o,n){function a(p){return p instanceof o?p:new o(function(c){c(p)})}return new(o||(o=Promise))(function(p,c){function l(y){try{g(n.next(y))}catch(_){c(_)}}function M(y){try{g(n.throw(y))}catch(_){c(_)}}function g(y){y.done?p(y.value):a(y.value).then(l,M)}g((n=n.apply(t,e||[])).next())})};Object.defineProperty(HM,"__esModule",{value:!0});HM.VizzlyApi=void 0;const x6=nr,$n=Xa,S6=ka,B6=ja,w6=$a,I3=Ga,C6=KM,X6=Ha,E6=Va,P3=Pi;class D6 extends x6.Api{constructor(e,o="https://api.vizzly.co"){super(e,o)}buildUpdateGainTheoryDashboardRequest(e){return{path:"/api/v3/gaintheory/dashboard",method:"put",body:{dashboardSessionToken:e.dashboardPermission.token,definition:e.definition,meta:e.metadata||e.meta||{},deleted:e.deleted,name:e.name,usage_metadata:e.usage_metadata},abortSignal:e.abortSignal}}buildFetchGainTheoryDashboardsRequest(e){return{path:"/api/v3/gaintheory/load-dashboards",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken()},abortSignal:e?.abortSignal}}buildFetchDashboardAccessTokensRequest(e){return{path:"/api/v2/auth/dashboards/access",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),projectAdminOverrideToken:this.auth.getProjectAdminOverrideToken()},abortSignal:e?.abortSignal}}fetchGlobalLibraries(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildFetchGlobalLibrariesRequest(e))})}buildFetchGlobalLibrariesRequest(e){return{path:"/api/v2/multi-get-global-library",method:"post",body:{globalLibraryAccessTokens:e.globalLibraryAccessTokens},abortSignal:e.abortSignal}}duplicateTaggedLibraries(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildDuplicateTaggedLibrariesRequest(e))})}buildDuplicateTaggedLibrariesRequest(e){return{path:"/api/v3/gaintheory/duplicate-tagged-library",method:"post",body:{shared_library_tags_to_duplicate:e.sharedLibraryTagsToDuplicate},abortSignal:e.abortSignal}}fetchGlobalLibraryAccessTokens(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildFetchGlobalLibraryAccessTokensRequest(e))})}buildFetchGlobalLibraryAccessTokensRequest(e){return{path:"/api/v2/auth/global-library/access",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),projectAdminOverrideToken:this.auth.getProjectAdminOverrideToken()},abortSignal:e?.abortSignal}}buildCreateDashboardRequest(e){return{path:"/api/v2/dashboard",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),definition:e.definition||P3.DashboardRepository.EmptyDashboardDefinition(),meta:e.metadata||e.meta||{},parentDashboardId:e.parentDashboardId,permissions:e.permissions,usage_metadata:e.usage_metadata},abortSignal:e.abortSignal}}buildFetchDashboardsRequest(e){return{path:"/api/v2/multi-get-dashboard",method:"post",body:{dashboardAccessTokens:e.dashboardSessionAccessTokens},abortSignal:e.abortSignal}}createParentDashboard(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateParentDashboardRequest(e))})}buildCreateParentDashboardRequest(e){return{path:"/api/v2/parent-dashboard",method:"post",body:{projectId:e.projectId,definition:e.definition||P3.DashboardRepository.EmptyDashboardDefinition(),name:e.name},abortSignal:e.abortSignal}}createParentGlobalLibrary(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateParentGlobalLibraryRequest(e))})}buildCreateParentGlobalLibraryRequest(e){return{path:"/api/v2/parent-global-library",method:"post",body:{projectId:e.projectId,library:e.library},abortSignal:e.abortSignal}}createGlobalLibrary(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildCreateGlobalLibraryRequest(e));if(o.status===200)return o.body;throw o.status===403?new $n.PermissionDenied("Permission denied when creating a global library via the Vizzly API."):new $n.FailedToCreateGlobalLibrary(`Failed to create global library, got status ${o.status}`)})}buildCreateGlobalLibraryRequest(e){return{path:"/api/v2/global-library",method:"post",body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),parentGlobalLibraryId:e.parentGlobalLibraryId,library:e.library,permissions:e.permissions},abortSignal:e.abortSignal}}getProjects(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildGetProjectsRequest(e));if(o.status===200)return{projects:o.body.projects};throw new $n.FailedToFetchProjects(`Failed to fetch projects. Got status ${o.status}`)})}buildGetProjectsRequest(e){return{path:`/api/v2/projects${e?.withParentDashboards?"?with_parent_dashboards=true":""}`,method:"get",abortSignal:e?.abortSignal}}createProjectApiKey(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateProjectApiKeyRequest(e))})}buildCreateProjectApiKeyRequest(e){return{path:`/api/v3/project/${e.projectId}/api-key`,method:"post",body:{},abortSignal:e.abortSignal}}createQueryEngineUser(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildCreateQueryEngineUserRequest(e));if(o.status===200)return o.body.query_engine_user;throw new $n.FailedToCreateQueryEngineUser(`Failed to create query engine user. Got status ${o.status}`)})}buildCreateQueryEngineUserRequest(e){return{path:`/api/v3/project/${e.projectId}/query-engine-user`,method:"post",body:{email:e.email,password:e.password},abortSignal:e.abortSignal}}buildCreateSelfHostedDynamicQueryEngineProjectRequest(e){return{path:"/api/v2/project/self-hosted-dynamic-query-engine",method:"post",body:{},abortSignal:e?.abortSignal}}buildCreateSelfHostedInBrowserProjectRequest(e){return{path:"/api/v2/project/self-hosted-in-browser",method:"post",body:{},abortSignal:e?.abortSignal}}buildCreateSelfHostedProjectRequest(e){return{path:"/api/v2/project/self-hosted-query-engine",method:"post",body:{},abortSignal:e?.abortSignal}}createManagedQueryEngineProject(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateManagedQueryEngineProjectRequest(e))})}buildCreateManagedQueryEngineProjectRequest(e){return{path:"/api/v2/project/managed-query-engine",method:"post",body:{parent_dashboard_definition:{}},abortSignal:e?.abortSignal}}createVizzlyConfigVersion(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateVizzlyConfigVersionRequest(e))})}buildCreateVizzlyConfigVersionRequest(e){return{path:`/api/v3/project/${e.projectId}/config`,method:"post",body:{projectId:e.projectId,encryptedConfig:e.encryptedConfig},abortSignal:e.abortSignal}}duplicateDashboards(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildDuplicateDashboardsRequest(e))})}buildDuplicateDashboardsRequest(e){return{path:"/api/v2/duplicate-dashboards",method:"post",body:{dashboardIds:e.dashboardIds},abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey"]}}duplicateParentDashboard(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildDuplicateParentDashboardRequest(e))})}buildDuplicateParentDashboardRequest(e){return{path:"/api/v2/duplicate-parent-dashboard",method:"post",body:{dashboardId:e.dashboardId},abortSignal:e.abortSignal}}getConnection(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildGetConnectionRequest(e));if(o.status===200)return{encryptedCredentials:o.body.encrypted_credentials};throw o.status==404?new B6.ConnectionDoesNotExistOnProject("An active connection does not exist on the project"):new w6.FailedToFetchConnection(`Failed to fetch connection for the project. Got status ${o.status}`)})}buildGetConnectionRequest(e){return{path:`/api/v2/project/${e.projectId}/connection`,method:"get",abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}getManagedQueryEngineKeyPair(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetManagedQueryEngineKeyPairRequest(e))})}buildGetManagedQueryEngineKeyPairRequest(e){return{path:`/api/v2/project/managed-query-engine/${e.managedProjectId}/key-pairs/${e.keyPairId}`,method:"get",abortSignal:e.abortSignal}}getProject(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildGetProjectRequest(e));if(o.status===200)return o.body;throw new I3.FailedToFetchProject(`Failed to fetch project. Got status ${o.status}`)})}buildGetProjectRequest(e){const o=e.withParentDashboards?"?with_parent_dashboards=true":"";return{path:`/api/v3/project/${e.projectId}${o}`,method:"get",abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken","appSessionToken"]}}getProjectEnvelopeEncryptionSecret(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildGetProjectEnvelopeEncryptionSecretRequest(e));if(o.status===200)return o.body;throw new I3.FailedToFetchProject(`Failed to fetch project envelope encryption secret. Got status ${o.status}`)})}buildGetProjectEnvelopeEncryptionSecretRequest(e){return{path:`/api/v3/project/${e.projectId}/encrypted-encryption-secret`,method:"get",abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}getProjectAccessToken(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetProjectAccessTokenRequest(e))})}buildGetProjectAccessTokenRequest(e){let o="";return e.resourceFilters&&(o=`filter=${e.resourceFilters.join(",")}`),{path:`/api/v2/auth/project/${e.projectId}/access_token?${o}`,method:"get",abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","appSessionToken"]}}getQueryEngineUser(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildGetQueryEngineUserRequest(e));if(o.status===200)return o.body.query_engine_user;throw new $n.FailedToFetchQueryEngineUser(`Failed to fetch query engine user. Got status ${o.status}`)})}buildGetQueryEngineUserRequest(e){return{path:`/api/v3/project/${e.projectId}/query-engine-user?email=${encodeURIComponent(e.email)}`,method:"get",abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}getTeamMembers(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildGetTeamMembersRequest(e));if(o.status===200)return o.body;throw new $n.FailedToFetchTeamMembers(`Failed to fetch team members. Got status ${o.status}`)})}buildGetTeamMembersRequest(e){return{path:`/api/v3/project/${e.projectId}/organisation-team-members`,method:"get",abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}getVizzlyConfig(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildGetVizzlyConfigRequest(e));if(o.status===200)return{encryptedConfig:o.body.encrypted_config};throw new S6.FailedToFetchVizzlyConfig(`Failed to fetch the config containing data sets from the Vizzly API. Got status ${o.status}`)})}buildGetVizzlyConfigRequest(e){return{path:`/api/v3/project/${e.projectId}/config`,method:"get",abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}saveConnection(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildSaveConnectionRequest(e))})}buildSaveConnectionRequest(e){return{path:"/api/v3/project/connection",method:"post",body:{projectId:e.projectId,encryptedConfig:e.encryptedConfig,encryptedConnection:e.encryptedConnection},abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}saveEncryptedProjectEncryptionSecret(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildSaveEncryptedProjectEncryptionSecretRequest(e));if(o.status===200)return!0;throw o.status==400&&!e.allowRotation?new E6.ProjectEncryptedSecretAlreadySaved(e.projectId):new X6.FailedToSaveProjectEncryptedEncryptionSecret(e.projectId)})}buildSaveEncryptedProjectEncryptionSecretRequest(e){return{path:`/api/v3/project/${e.projectId}/encrypted-encryption-secret`,method:"post",body:{projectId:e.projectId,encryptedEncryptionSecret:e.encryptedProjectEncryptionSecret,allowRotation:e.allowRotation},abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}getScheduledReports(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetScheduledReports(e))})}buildGetScheduledReports(e){return{path:"/api/scheduled-report/collect",method:"post",body:{dashboardAccessToken:e.dashboardAccessToken},abortSignal:e.abortSignal}}saveScheduledReport(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildSaveScheduledReportRequest(e))})}buildSaveScheduledReportRequest(e){return{path:"/api/scheduled-report",method:"post",body:{cronSchedule:e.cronSchedule,dashboardAccessToken:e.dashboardAccessToken,scheduledReportId:e.scheduledReportId},abortSignal:e.abortSignal}}updateDashboard(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateDashboardRequest(e))})}buildUpdateDashboardRequest(e){return{path:"/api/v2/dashboard",method:"put",body:{dashboardSessionToken:e.dashboardPermission.token,definition:e.definition,meta:e.metadata||e.meta||{},deleted:e.deleted,name:e.name,usage_metadata:e.usage_metadata},abortSignal:e.abortSignal}}updateParentGlobalLibrary(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateParentGlobalLibraryRequest(e))})}buildUpdateParentGlobalLibraryRequest(e){return{path:"/api/v2/parent-global-library",method:"put",body:{globalLibraryId:e.globalLibraryId,deleted:e.deleted,name:e.name},abortSignal:e.abortSignal}}updateGlobalLibrary(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateGlobalLibraryRequest(e))})}buildUpdateGlobalLibraryRequest(e){return{path:"/api/v2/global-library",method:"put",body:{globalLibrarySessionToken:e.globalLibrarySessionToken,deleted:e.deleted,library:e.library,usage_metadata:e.usage_metadata},abortSignal:e.abortSignal}}updateProjectApiKey(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateProjectApiKeyRequest(e))})}buildUpdateProjectApiKeyRequest(e){return{path:`/api/v3/project/${e.projectId}/api-key/${e.projectApiKeyId}`,method:"put",body:{disabled:e.disabled},abortSignal:e.abortSignal}}updateQueryEngineUser(e){return y1(this,void 0,void 0,function*(){const o=yield this.execute(this.buildUpdateQueryEngineUserRequest(e));if(o.status===200)return!0;throw new C6.FailedToUpdateQueryEngineUser(`Failed to update query engine user. Got status ${o.status}`)})}buildUpdateQueryEngineUserRequest(e){return{path:`/api/v3/project/${e.projectId}/query-engine-user`,method:"put",body:{query_engine_user_id:e.queryEngineUserId,password:e.password},abortSignal:e.abortSignal,acceptedAuthParams:["projectApiKey","projectAccessToken"]}}getDashboardFieldUsageMetadata(e){return y1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetDashboardFieldUsageMetadata(e))})}buildGetDashboardFieldUsageMetadata(e){return{path:`/api/v2/field-usage/dashboard/${e.dashboardId}`,method:"get",abortSignal:e.abortSignal}}}HM.VizzlyApi=D6;var QM={},$1=z0&&z0.__awaiter||function(t,e,o,n){function a(p){return p instanceof o?p:new o(function(c){c(p)})}return new(o||(o=Promise))(function(p,c){function l(y){try{g(n.next(y))}catch(_){c(_)}}function M(y){try{g(n.throw(y))}catch(_){c(_)}}function g(y){y.done?p(y.value):a(y.value).then(l,M)}g((n=n.apply(t,e||[])).next())})};Object.defineProperty(QM,"__esModule",{value:!0});QM.VizzlyAppApi=void 0;const I6=nr;class P6 extends I6.Api{constructor(e,o="https://app.vizzly.co"){super(e,o)}createCliAuthToken(){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateCliAuthTokenRequest())})}buildCreateCliAuthTokenRequest(){return{path:"/api/create-cli-auth-token",method:"post",body:{}}}createInstantDashboard(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateInstantDashboardRequest(e))})}buildCreateInstantDashboardRequest(e){return{path:"/api/v2/instant-dashboard",method:"post",body:{parent_dashboard_definition:e.definition}}}createProjectAdminOverrideAccessToken(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateProjectAdminOverrideAccessTokenRequest(e))})}buildCreateProjectAdminOverrideAccessTokenRequest(e){return{path:`/api/v2/project/${e.projectId}/admin-override`,method:"post",body:{}}}startEmailChange(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildStartEmailChangeRequest(e))})}buildStartEmailChangeRequest(e){return{path:"/api/self/start-email-change",method:"post",body:{email:e.email}}}completeEmailChange(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildCompleteEmailChangeRequest(e))})}buildCompleteEmailChangeRequest(e){return{path:"/api/self/complete-email-change",method:"post",body:{token:e.token}}}getManagedQueryEngineAccessTokens(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetManagedQueryEngineAccessTokensRequest(e))})}buildGetManagedQueryEngineAccessTokensRequest(e){return{path:`/api/v2/managed-query-engine/${e.managedQueryEngineId}/identity`,method:"get"}}getParentDashboardMeta(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetParentDashboardMetaRequest(e))})}buildGetParentDashboardMetaRequest(e){return{path:`/api/v2/parent-dashboard/${e.dashboardId}/stats`,method:"get"}}updateParentDashboard(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateParentDashboardRequest(e))})}buildUpdateParentDashboardRequest(e){return{path:`/api/v2/parent-dashboard/${e.dashboardId}/stats`,method:"put",body:{name:e.name,definition:e.definition,meta:e.meta,deleted:e.deleted,webhookId:e.webhookId}}}getProjectMeta(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetProjectMetaRequest(e))})}buildGetProjectMetaRequest(e){return{path:`/api/v2/project/${e.projectId}/meta`,method:"get"}}getSelf(){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetSelfRequest())})}buildGetSelfRequest(){return{path:"/api/self",method:"get"}}getTeam(){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetTeamRequest())})}buildGetTeamRequest(){return{path:"/api/team",method:"get"}}getWebhooks(){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildGetWebhooksRequest())})}buildGetWebhooksRequest(){return{path:"/api/organisation/webhooks",method:"get"}}inviteTeamMember(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildInviteTeamMemberRequest(e))})}buildInviteTeamMemberRequest(e){return{path:"/api/invite",method:"post",body:{email:e.email,first_name:e.firstName,last_name:e.lastName,department:e.department}}}inAppAcceptTeamMemberInvite(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildInAppAcceptTeamMemberInviteRequest(e))})}buildInAppAcceptTeamMemberInviteRequest(e){return{path:"/api/invite/in-app-accept",method:"post",body:{team_member_id:e.teamMemberId}}}acceptTeamMemberInvite(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildAcceptTeamMemberInviteRequest(e))})}buildAcceptTeamMemberInviteRequest(e){return{path:"/api/invite/accept",method:"post",body:{token:e.inviteToken}}}resendTeamMemberInvite(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildResendTeamMemberInviteRequest(e))})}buildResendTeamMemberInviteRequest(e){return{path:"/api/invite/resend",method:"post",body:{team_member_id:e.teamMemberId}}}removeTeamMember(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildRemoveTeamMemberRequest(e))})}buildRemoveTeamMemberRequest(e){return{path:"/api/invite/remove",method:"post",body:{team_member_id:e.teamMemberId}}}startSignIn(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildStartSignInRequest(e))})}buildStartSignInRequest(e){return{path:"/api/start-sign-in",method:"post",body:{email:e.email}}}completeSignIn(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildCompleteSignInRequest(e))})}buildCompleteSignInRequest(e){return{path:"/api/complete-sign-in",method:"post",body:{token:e.token}}}searchUserDashboards(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildSearchUserDashboardsRequest(e))})}buildSearchUserDashboardsRequest(e){return{path:`/api/v2/project/${e.projectId}/search-user-dashboards?user_reference=${e.userReference}`,method:"get"}}signUp(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildSignUpRequest(e))})}buildSignUpRequest(e){return{path:"/api/complete-sign-in",method:"post",body:{email:e.email,organisation_title:e.organisationTitle,first_name:e.firstName,last_name:e.lastName,department:e.department}}}switchOrganisation(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildSwitchOrganisationRequest(e))})}buildSwitchOrganisationRequest(e){return{path:"/api/team/switch",method:"post",body:{organisation_id:e.organisationId}}}toggleKeyPairDisabled(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildToggleKeyPairDisabledRequest(e))})}buildToggleKeyPairDisabledRequest(e){return{path:"/api/organisation/key-pairs/toggle-disabled",method:"post",body:{key_pair_id:e.keyPairId,disabled:e.disabled}}}updateProject(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateProjectRequest(e))})}buildUpdateProjectRequest(e){return{path:"/api/v2/project",method:"put",body:{project_id:e.projectId,deleted:e.deleted,name:e.name}}}uploadPublicKey(e){return $1(this,void 0,void 0,function*(){return yield this.execute(this.buildUploadPublicKeyRequest(e))})}buildUploadPublicKeyRequest(e){return{path:"/api/v2/project/key-pair",method:"post",body:{public_key:e.publicKey,project_id:e.projectId}}}}QM.VizzlyAppApi=P6;var ZM={},j0=z0&&z0.__awaiter||function(t,e,o,n){function a(p){return p instanceof o?p:new o(function(c){c(p)})}return new(o||(o=Promise))(function(p,c){function l(y){try{g(n.next(y))}catch(_){c(_)}}function M(y){try{g(n.throw(y))}catch(_){c(_)}}function g(y){y.done?p(y.value):a(y.value).then(l,M)}g((n=n.apply(t,e||[])).next())})},F6=z0&&z0.__rest||function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(o[n[a]]=t[n[a]]);return o};Object.defineProperty(ZM,"__esModule",{value:!0});ZM.VizzlyQueryEngineApi=void 0;const F3=Xa,k6=Fa,j6=Pa,$6=Ua,G6=Ia,U6=nr,V6=Pi,Ke=rr;class H6 extends U6.Api{constructor(e,o,n){super(e,o,n)}buildCreateDashboardRequest(e){return{path:"/api/v1/dashboard",method:"post",abortSignal:e.abortSignal,body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),definition:e.definition||V6.DashboardRepository.EmptyDashboardDefinition(),meta:e.metadata||e.meta||{},parentDashboardId:e.parentDashboardId,permissions:e.permissions,usage_metadata:e.usage_metadata}}}buildFetchDashboardAccessTokensRequest(e){return{path:"/api/v1/dashboard/access",method:"post",abortSignal:e?.abortSignal,body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),projectAdminOverrideToken:this.auth.getProjectAdminOverrideToken()}}}fetchGlobalLibraryAccessTokens(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildFetchGlobalLibraryAccessTokensRequest(e))})}buildFetchGlobalLibraryAccessTokensRequest(e){return{path:"/api/v1/global-library/access",method:"post",abortSignal:e?.abortSignal,body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),projectAdminOverrideToken:this.auth.getProjectAdminOverrideToken()}}}buildFetchDashboardsRequest(e){return{path:"/api/v1/get-dashboards",method:"post",abortSignal:e.abortSignal,body:{dashboardAccessTokens:e.dashboardSessionAccessTokens}}}createConfigFromUpload(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateConfigFromUploadRequest(e))})}buildCreateConfigFromUploadRequest(e){return{path:"/api/v1/create-config-from-upload",method:"post",abortSignal:e.abortSignal,body:{queryEngineAccessToken:this.auth.getQueryEngineAccessToken(),table:e.table,fieldPublicNames:e.fieldPublicNames}}}createResults(e){return j0(this,arguments,void 0,function*(o,n="v2"){return yield this.execute(this.buildCreateResultsRequest(o,n))})}buildCreateResultsRequest(e,o){return{path:`/api/${o}/create-results`,method:"post",abortSignal:e.abortSignal,body:{queries:e.queries,dynamicConfig:e.dynamicConfig,identityConfigIntegritySignature:this.auth.hasDataAccessToken()?this.auth.getDataAccessToken():void 0,secureFilters:e.secureFilters,virtualFields:{}},acceptedAuthParams:["queryEngineApiKey","dashboardAccessToken"]}}collectTreePartInstructions(e){return j0(this,void 0,void 0,function*(){const o=yield this.execute(this.buildCollectTreePartInstructionsRequest(e));if(o.status===400&&"reason"in o.body&&typeof o.body.reason=="string"&&"details"in o.body&&typeof o.body.details=="string"&&"validationResults"in o.body&&typeof o.body.validationResults=="object"&&o.body.validationResults!==null)throw new $6.NullValidationError(o.body);return o})}buildCollectTreePartInstructionsRequest(e){return{path:"/api/v1/data-optimiser/tree-part-instructions",method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},fullTreeDataSourceId:e.fullTreeDataSourceId},acceptedAuthParams:["queryEngineApiKey"]}}collectTableSchema(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCollectTableSchemaRequest(e))})}buildCollectTableSchemaRequest(e){return{path:"/api/v1/schema/tables",method:"post",abortSignal:e.abortSignal,body:{allowedConfigOrigins:e.allowedConfigOrigins,dynamicConfig:e.dynamicConfig},acceptedAuthParams:["queryEngineApiKey"]}}collectSchema(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCollectSchemaRequest(e))})}buildCollectSchemaRequest(e){return{path:"/api/v1/schema",method:"post",abortSignal:e.abortSignal,body:{allowedConfigOrigins:e.allowedConfigOrigins,dynamicConfig:e.dynamicConfig,filterColumnsByTable:e.filterColumnsByTable},acceptedAuthParams:["queryEngineApiKey"]}}createSqlPreview(e){return j0(this,void 0,void 0,function*(){var o;const n=yield this.execute(this.buildCreateSqlPreviewRequest(e));if(n.status===200)return n;throw new G6.SQLPreviewError(((o=n?.body)===null||o===void 0?void 0:o.message)||"Unknown SQL error")})}buildCreateSqlPreviewRequest(e){return{path:"/api/v1/create-sql-preview",method:"post",abortSignal:e.abortSignal,body:{sql:e.sql,parameters:e.parameters,limit:e.limit}}}createQueryEngineUser(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateQueryEngineUserRequest(e))})}buildCreateQueryEngineUserRequest(e){return{path:"/api/v1/query-engine-user",method:"post",abortSignal:e.abortSignal,body:{email:e.email,password:e.password}}}fetchDataSets(e){return j0(this,void 0,void 0,function*(){const o=this.buildFetchDataSetsRequest(e),n=yield this.execute(o);if(n.status===200)return n;throw new k6.FailedToResolveDataSets(`Failed to resolve data sets from ${o.path}. Received status ${n.status}`)})}buildFetchDataSetsRequest(e){return{path:"/api/v1/resolve-data-sets",method:"post",abortSignal:e?.abortSignal,body:{integritySignature:this.auth.getDataAccessToken()}}}fetchSelfHostedQueryEngineConfig(e){return j0(this,void 0,void 0,function*(){return this.execute(this.buildFetchSelfHostedQueryEngineConfigRequest(e))})}buildFetchSelfHostedQueryEngineConfigRequest(e){return{path:"/api/v1/support",method:"post",abortSignal:e?.abortSignal,body:{}}}fetchProject(e){return j0(this,void 0,void 0,function*(){return this.execute(this.buildFetchProjectRequest(e))})}buildFetchProjectRequest(e){return{path:"/api/v1/project",method:"get",abortSignal:e?.abortSignal,body:{}}}getStarted(e){return j0(this,void 0,void 0,function*(){const o=yield this.execute(this.buildGetStartedRequest(e));if(o.status!=200)throw new j6.FailedToSetupProject(typeof o.body=="object"&&o.body.reason&&"reason"in o.body?o.body.reason:"Failed to create the first user.");return o})}buildGetStartedRequest(e){return{path:"/api/v2/get-started",method:"post",abortSignal:e.abortSignal,body:{email:e.email,password:e.password}}}getTeamMembers(e){return j0(this,void 0,void 0,function*(){return this.execute(this.buildGetTeamMembersRequest(e))})}buildGetTeamMembersRequest(e){return{path:"/api/v1/team-members",method:"get",abortSignal:e?.abortSignal}}isVizzly(e){return j0(this,void 0,void 0,function*(){return this.execute(this.buildIsVizzlyRequest(e))})}buildIsVizzlyRequest(e){return{path:"/api/is-vizzly",method:"get",abortSignal:e?.abortSignal}}saveConfig(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildSaveConfigRequest(e))})}buildSaveConfigRequest(e){return{path:"/api/v1/save-config",method:"post",abortSignal:e.abortSignal,body:{config:e.config}}}saveConnection(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildSaveConnectionRequest(e))})}buildSaveConnectionRequest(e){return{path:"/api/v1/save-connection",method:"post",abortSignal:e.abortSignal,body:{connection:e.connection,client:e.client}}}signInWithQueryEngineAccessToken(e){return j0(this,void 0,void 0,function*(){return this.execute(this.buildSignInWithQueryEngineAccessTokenRequest(e))})}buildSignInWithQueryEngineAccessTokenRequest(e){return{path:"/api/v1/sign-in",method:"post",abortSignal:e?.abortSignal,body:{}}}signInWithEmailAndPassword(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildSignInWithEmailAndPasswordRequest(e))})}buildSignInWithEmailAndPasswordRequest(e){return{path:"/api/v1/sign-in",method:"post",abortSignal:e.abortSignal,body:{email:e.email,password:e.password}}}status(e){return j0(this,void 0,void 0,function*(){return this.execute(this.buildStatusRequest(e))})}buildStatusRequest(e){return{path:"/api/status",method:"post",abortSignal:e?.abortSignal,body:{}}}createGlobalLibrary(e){return j0(this,void 0,void 0,function*(){const o=yield this.execute(this.buildCreateGlobalLibraryRequest(e));if(o.status===200)return o.body;throw o.status===403?new F3.PermissionDenied("Permission denied when creating a global library via the Vizzly Query Engine."):new F3.FailedToCreateGlobalLibrary(`Failed to create a global library. Got status ${o.status}`)})}buildCreateGlobalLibraryRequest(e){return{path:"/api/v1/global-library",method:"post",abortSignal:e.abortSignal,body:{dashboardAccessToken:this.auth.getDashboardAccessToken(),parentGlobalLibraryId:e.parentGlobalLibraryId,library:e.library,permissions:e.permissions}}}fetchGlobalLibraries(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildFetchGlobalLibrariesRequest(e))})}buildFetchGlobalLibrariesRequest(e){return{path:"/api/v1/get-global-libraries",method:"post",abortSignal:e.abortSignal,body:{globalLibraryAccessTokens:e.globalLibraryAccessTokens}}}updateGlobalLibrary(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateGlobalLibraryRequest(e))})}buildUpdateGlobalLibraryRequest(e){return{path:"/api/v1/global-library",method:"put",abortSignal:e.abortSignal,body:{globalLibrarySessionToken:e.globalLibrarySessionToken,deleted:e.deleted,library:e.library,usage_metadata:e.usage_metadata}}}updateDashboard(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateDashboardRequest(e))})}buildUpdateDashboardRequest(e){return{path:"/api/v1/dashboard",method:"put",abortSignal:e.abortSignal,body:{dashboardSessionToken:e.dashboardPermission.token,definition:e.definition,meta:e.metadata||e.meta||{},deleted:e.deleted,name:e.name,usage_metadata:e.usage_metadata}}}updateQueryEngineUser(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildUpdateQueryEngineUserRequest(e))})}buildUpdateQueryEngineUserRequest(e){return{path:"/api/v1/query-engine-user",method:"put",abortSignal:e.abortSignal,body:{queryEngineUserId:e.queryEngineUserId,password:e.password}}}uploadDataToVizzlyCloud(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildUploadDataToVizzlyCloudRequest(e))})}buildUploadDataToVizzlyCloudRequest(e){return{path:"/api/v1/ingest",method:"post",abortSignal:e.abortSignal,body:{queryEngineAccessToken:this.auth.getQueryEngineAccessToken(),ingest:e.ingest}}}createCompanyInfrastructure(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateCompanyInfrastructureRequest(e))})}getCreateCompanyInfrastructureStatus(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateCompanyInfrastructureRequest(e,{statusOnly:!0}))})}buildCreateCompanyInfrastructureRequest(e,o){var n,a,p;const c=o?.statusOnly?"/status":"";return{path:Ke.Path.buildPath("/api/v1/data-optimiser/company",c),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},databases:(n=e.externalConnection)===null||n===void 0?void 0:n.databases,clientName:(a=e.externalConnection)===null||a===void 0?void 0:a.clientName,account:(p=e.externalConnection)===null||p===void 0?void 0:p.account},acceptedAuthParams:["queryEngineApiKey"]}}ingestTreePartDatasource(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildIngestTreePartDatasourceRequest(e,{statusOnly:!1}))})}getIngestTreePartDatasourceStatus(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildIngestTreePartDatasourceRequest(e,{statusOnly:!0}))})}buildIngestTreePartDatasourceRequest(e,o){const n=o?.statusOnly?"/status":"";return{path:Ke.Path.buildPath("/api/v1/data-optimiser/ingest-tree-part",n),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},dataSourceId:e.dataSourceId,filter:e.filter,previousWorkflowResults:e.previousWorkflowResults,internalCompanyConnection:e.internalCompanyConnection,externalSnowflakeConnection:e.externalSnowflakeConnection,instructions:e.instructions,fullTreeFields:e.fullTreeFields,warehouseOverrideMapping:e.warehouseOverrideMapping||{}},acceptedAuthParams:["queryEngineApiKey"]}}ingestDatasource(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildIngestDatasourceRequest(e,{statusOnly:!1}))})}getIngestDatasourceStatus(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildIngestDatasourceRequest(e,{statusOnly:!0}))})}buildIngestDatasourceRequest(e,o){const n=o?.statusOnly?"/status":"";return{path:Ke.Path.buildPath("/api/v1/data-optimiser/ingest",n),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},dataSourceId:e.dataSourceId,ingestFields:e.ingestFields,internalCompanyConnection:e.internalCompanyConnection,externalSnowflakeConnection:e.externalSnowflakeConnection,transformations:e.transformations,previousWorkflowResults:e.previousWorkflowResults,warehouseOverrideMapping:e.warehouseOverrideMapping||{}},acceptedAuthParams:["queryEngineApiKey"]}}ingestInternalDataSource(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildInternalIngestDatasourceRequest(e,{statusOnly:!1}))})}getInternalIngestDatasourceStatus(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildInternalIngestDatasourceRequest(e,{statusOnly:!0}))})}buildInternalIngestDatasourceRequest(e,o){const n=o?.statusOnly?"/status":"";return{path:Ke.Path.buildPath("/api/v1/data-optimiser/internal-ingest",n),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},currentDataSourceId:e.currentDataSourceId,nextDataSourceId:e.nextDataSourceId,ingestFields:e.ingestFields,transformations:e.transformations,previousWorkflowResults:e.previousWorkflowResults,warehouseOverrideMapping:e.warehouseOverrideMapping||{}},acceptedAuthParams:["queryEngineApiKey"]}}getCreateSnapshotStatus(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateSnapshotRequest(e,{statusOnly:!0}))})}createSnapshot(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateSnapshotRequest(e,{statusOnly:!1}))})}buildCreateSnapshotRequest(e,o){const n=o?.statusOnly?"/status":"";return{path:Ke.Path.buildPath("/api/v1/data-optimiser/snapshot",n),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},ingestDataSourceId:e.ingestDataSourceId,snapshotDataSourceId:e.snapshotDataSourceId,ingestFields:e.ingestFields,cascadingInstructions:e.cascadingInstructions,primaryDateFieldId:e.primaryDateFieldId,internalCompanyConnection:e.internalCompanyConnection,previousWorkflowResults:e.previousWorkflowResults,warehouseOverrideMapping:e.warehouseOverrideMapping||{},optOutOfPreAggregation:e.optOutOfPreAggregation},acceptedAuthParams:["queryEngineApiKey"]}}createSubsnap(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateSubsnapRequest(e,{statusOnly:!1}))})}getCreateSubsnapStatus(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateSubsnapRequest(e,{statusOnly:!0}))})}buildCreateSubsnapRequest(e,o){const n=o?.statusOnly?"/status":"";return{path:Ke.Path.buildPath("/api/v1/data-optimiser/subsnap",n),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},dashboardId:e.dashboardId,snapshotDataSourceId:e.snapshotDataSourceId,subsnapDataSourceId:e.subsnapDataSourceId,snapshotFields:e.snapshotFields,internalCompanyConnection:e.internalCompanyConnection,previousWorkflowResults:e.previousWorkflowResults,warehouseOverrideMapping:e.warehouseOverrideMapping||{},requiredMinimumFields:e.requiredMinimumFields,cascadingInstructions:e.cascadingInstructions,primaryDateFieldId:e.primaryDateFieldId},acceptedAuthParams:["queryEngineApiKey"]}}ingestFromUpload(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildIngestFromUploadRequest(e,{statusOnly:!1}))})}getIngestFromUploadStatus(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildIngestFromUploadRequest(e,{statusOnly:!0}))})}buildIngestFromUploadRequest(e,o){const n=o?.statusOnly?"/status":"";return{path:Ke.Path.buildPath("/api/v1/data-optimiser/ingest-from-upload",n),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},dataSourceId:e.dataSourceId,ingestFields:e.ingestFields,transformations:e.transformations,previousWorkflowResults:e.previousWorkflowResults,warehouseOverrideMapping:e.warehouseOverrideMapping||{}},acceptedAuthParams:["queryEngineApiKey"]}}createUploadTable(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateUploadTableRequest(e,{statusOnly:!1}))})}getCreateUploadTableStatus(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateUploadTableRequest(e,{statusOnly:!0}))})}buildCreateUploadTableRequest(e,o){const n=o?.statusOnly?"/status":"";return{path:Ke.Path.buildPath("/api/v1/data-optimiser/upload",n),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},dataSourceId:e.dataSourceId,fileName:e.fileName,previousWorkflowResults:e.previousWorkflowResults},acceptedAuthParams:["queryEngineApiKey"]}}generateSignedUrl(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildGenerateSignedUrlRequest(e))})}buildGenerateSignedUrlRequest(e){return{path:Ke.Path.buildPath("/api/v1/data-optimiser/signed-url",""),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},dataSourceId:e.dataSourceId,fileName:e.fileName,purpose:e.purpose,contentType:e.contentType,dashboardViewId:e.dashboardViewId,reportPresentationId:e.reportPresentationId,presentationTemplateId:e.presentationTemplateId},acceptedAuthParams:["queryEngineApiKey"]}}generateBatchSignedUrl(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildGenerateBatchSignedUrl(e))})}buildGenerateBatchSignedUrl(e){return{path:Ke.Path.buildPath("/api/v1/data-optimiser/batch-signed-url",""),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},purpose:e.purpose,contentType:e.contentType,reportPresentationId:e.reportPresentationId,assets:e.assets},acceptedAuthParams:["queryEngineApiKey"]}}getTableAddresses(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildGetTableAddressesRequest(e))})}buildGetTableAddressesRequest(e){return{path:Ke.Path.buildPath("/api/v1/data-optimiser/address",""),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},dataSourceId:e.dataSourceId},acceptedAuthParams:["queryEngineApiKey"]}}enableMalwareScan(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildEnableMalwareScanRequest(e))})}buildEnableMalwareScanRequest(e){return{path:Ke.Path.buildPath("/api/v1/data-optimiser/malware-scan",""),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId}},acceptedAuthParams:["queryEngineApiKey"]}}enableDataTransferAcceleration(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildEnableDataTransferAccelerationRequest(e))})}buildEnableDataTransferAccelerationRequest(e){return{path:Ke.Path.buildPath("/api/v1/data-optimiser/accelerate-data-transfer",""),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId}},acceptedAuthParams:["queryEngineApiKey"]}}enableBucketCors(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildEnableBucketCorsRequest(e))})}buildEnableBucketCorsRequest(e){return{path:Ke.Path.buildPath("/api/v1/data-optimiser/bucket-cors",""),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId}},acceptedAuthParams:["queryEngineApiKey"]}}createWarehouse(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildCreateWarehouseRequest(e))})}buildCreateWarehouseRequest(e){return{path:Ke.Path.buildPath("/api/v1/data-optimiser/warehouse",""),method:"post",abortSignal:e.abortSignal,body:{company:{id:e.companyId},warehouseSize:e.warehouseSize},acceptedAuthParams:["queryEngineApiKey"]}}qaSetup(e){return j0(this,void 0,void 0,function*(){return yield this.execute(this.buildQASetupRequest(e))})}buildQASetupRequest(e){const{abortSignal:o}=e,n=F6(e,["abortSignal"]);return{path:Ke.Path.buildPath("/api/v1/data-optimiser/qa-setup",""),method:"post",abortSignal:o,body:n,acceptedAuthParams:["queryEngineApiKey"]}}}ZM.VizzlyQueryEngineApi=H6;var JM={};Object.defineProperty(JM,"__esModule",{value:!0});JM.Authentication=void 0;const Y6=_0,Gn=Ea;class K6{constructor(e){this.authParams=e}updateAuthParams(e){this.authParams=Object.assign(Object.assign({},this.authParams),e)}clearAuthParams(){this.authParams={}}getQueryEngineApiKey(){if(!this.authParams.queryEngineApiKey)throw new Gn.MissingAuthParameter("queryEngineApiKey");return this.authParams.queryEngineApiKey}getQueryEngineAccessToken(){if(!this.authParams.queryEngineAccessToken)throw new Gn.MissingAuthParameter("queryEngineAccessToken");return this.authParams.queryEngineAccessToken}getProjectAdminOverrideToken(){return this.authParams.projectAdminOverrideToken}getDashboardAccessToken(){if(!this.authParams.dashboardAccessToken)throw new Gn.MissingAuthParameter("dashboardAccessToken");return this.authParams.dashboardAccessToken}getAppSessionToken(){return this.authParams.appSessionToken}hasDataAccessToken(){return!!this.authParams.dataAccessToken}getDataAccessToken(){if(!this.hasDataAccessToken())throw new Gn.MissingAuthParameter("dataAccessToken");return this.authParams.dataAccessToken}getProjectApiKey(){if(!this.authParams.projectApiKey)throw new Gn.MissingAuthParameter("projectApiKey");return this.authParams.projectApiKey}getProjectAccessToken(){if(!this.authParams.projectAccessToken)throw new Gn.MissingAuthParameter("projectAccessToken");return this.authParams.projectAccessToken}buildAuthHeaders(e){let o=e?(0,Y6.pick)(this.authParams,e):this.authParams;return o.dashboardAccessToken?{auth:`Bearer ${o.dashboardAccessToken}`}:o.queryEngineApiKey?{"Config-Api-Key":o.queryEngineApiKey}:o.projectAccessToken?{auth:`Bearer ${o.projectAccessToken}`}:o.projectApiKey?{auth:`Api-Key ${o.projectApiKey}`}:o.appSessionToken?{auth:`Bearer ${o.appSessionToken}`}:{}}}JM.Authentication=K6;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.PersistDirectToVizzlyApi=ai.PersistViaQueryEngine=ai.ImplementationStrategy=void 0;class wO{}ai.ImplementationStrategy=wO;class Q6 extends wO{shouldPersistViaQueryEngine(){return!0}}ai.PersistViaQueryEngine=Q6;class Z6 extends wO{shouldPersistViaQueryEngine(){return!1}}ai.PersistDirectToVizzlyApi=Z6;var Gu={},Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});var Vu={};Object.defineProperty(Vu,"__esModule",{value:!0});var Hu={};Object.defineProperty(Hu,"__esModule",{value:!0});var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0});var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});(function(t){var e=z0&&z0.__createBinding||(Object.create?function(n,a,p,c){c===void 0&&(c=p);var l=Object.getOwnPropertyDescriptor(a,p);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[p]}}),Object.defineProperty(n,c,l)}:function(n,a,p,c){c===void 0&&(c=p),n[c]=a[p]}),o=z0&&z0.__exportStar||function(n,a){for(var p in n)p!=="default"&&!Object.prototype.hasOwnProperty.call(a,p)&&e(a,n,p)};Object.defineProperty(t,"__esModule",{value:!0}),o(Uu,t),o(Vu,t),o(Hu,t),o(Yu,t),o(Ku,t)})(Gu);(function(t){var e=z0&&z0.__createBinding||(Object.create?function(p,c,l,M){M===void 0&&(M=l);var g=Object.getOwnPropertyDescriptor(c,l);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(p,M,g)}:function(p,c,l,M){M===void 0&&(M=l),p[M]=c[l]}),o=z0&&z0.__setModuleDefault||(Object.create?function(p,c){Object.defineProperty(p,"default",{enumerable:!0,value:c})}:function(p,c){p.default=c}),n=z0&&z0.__exportStar||function(p,c){for(var l in p)l!=="default"&&!Object.prototype.hasOwnProperty.call(c,l)&&e(c,p,l)},a=z0&&z0.__importStar||function(p){if(p&&p.__esModule)return p;var c={};if(p!=null)for(var l in p)l!=="default"&&Object.prototype.hasOwnProperty.call(p,l)&&e(c,p,l);return o(c,p),c};Object.defineProperty(t,"__esModule",{value:!0}),t.Errors=void 0,n(XM,t),n(HM,t),n(QM,t),n(ZM,t),n(JM,t),n(ai,t),n(ki,t),n(rr,t),n(Gu,t),t.Errors=a(Xa)})(Fo);const J6=(t,e,o)=>{const n=new Fo.Authentication({dashboardAccessToken:t?.dashboardAccess.signature,dataAccessToken:t?.dataAccess?.signature,projectAdminOverrideToken:t?.dashboardAdminOverride?.signature,queryEngineAccessToken:t?.queryEngineAccessConfig?.signature});let a=()=>({});e.strategy==="queryEngine"&&typeof e.endpoint!="string"&&(a=e.endpoint.customHeaders||a);const p=e.strategy==="queryEngine"?new Fo.VizzlyQueryEngineApi(n,typeof e.endpoint=="string"?e.endpoint:e.endpoint.endpoint,a):void 0,c=new Fo.VizzlyApi(n,o.host),l=new Fo.VizzlyAppApi(n,"https://app.vizzly.co");return new Fo.Vizzly({vizzlyApi:c,vizzlyAppApi:l,vizzlyQueryEngineApi:p},e.strategy==="queryEngine"?new Fo.PersistViaQueryEngine:new Fo.PersistDirectToVizzlyApi)},Qu=(t,e)=>_0.mergeWith({},t,e,(o,n)=>_0.isArray(n)?n:_0.isObject(o)&&_0.isObject(n)?Qu(o,n):n),Zu=(t,e)=>Qu(e,t),E1=(t,e,o)=>{let n=Zu(e,t);n.updated_at=new Date().toISOString();const{value:a,error:p}=o.validate(n);if(p)throw p;return a};var Ju={exports:{}};(function(t,e){(function(o,n){t.exports=n()})(Ot,()=>(()=>{var o={514:(p,c,l)=>{const{clone:M}=l(8870),g=l(8160),y={annotations:Symbol("annotations")};c.error=function(_){if(!this._original||typeof this._original!="object")return this.details[0].message;const O=_?"":"\x1B[31m",d=_?"":"\x1B[41m",f=_?"":"\x1B[0m",z=M(this._original);for(let h=this.details.length-1;h>=0;--h){const A=h+1,q=this.details[h],v=q.path;let L=z;for(let T=0;;++T){const w=v[T];if(g.isSchema(L)&&(L=L.clone()),!(T+1<v.length&&typeof L[w]!="string")){const C=L[y.annotations]||{errors:{},missing:{}};L[y.annotations]=C;const R=w||q.context.key;L[w]!==void 0?(C.errors[R]=C.errors[R]||[],C.errors[R].push(A)):C.missing[R]=A;break}L=L[w]}}let s=y.safeStringify(z,2).replace(/_\$key\$_([, \d]+)_\$end\$_"/g,(h,A)=>`" ${O}[${A}]${f}`).replace(/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,(h,A,q)=>`${d}"${A}"${f}${O} [${q}]: -- missing --${f}`).replace(/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,(h,A,q)=>`
|
|
30
30
|
${q} ${O}[${A}]${f}`).replace(/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g,(h,A)=>A);s=`${s}
|
|
31
31
|
${O}`;for(let h=0;h<this.details.length;++h)s=`${s}
|
|
32
|
-
[${h+1}] ${this.details[h].message}`;return s+=f,s},y.safeStringify=function(_,O){return JSON.stringify(_,y.serializer(),O)},y.serializer=function(){const _=[],O=[],d=(f,z)=>O[0]===z?"[Circular ~]":"[Circular ~."+_.slice(0,O.indexOf(z)).join(".")+"]";return function(f,z){if(O.length>0){const s=O.indexOf(this);~s?(O.length=s+1,_.length=s+1,_[s]=f):(O.push(this),_.push(f)),~O.indexOf(z)&&(z=d.call(this,f,z))}else O.push(z);if(z){const s=z[y.annotations];if(s){if(Array.isArray(z)){const h=[];for(let A=0;A<z.length;++A)s.errors[A]&&h.push(`_$idx$_${s.errors[A].sort().join(", ")}_$end$_`),h.push(z[A]);z=h}else{for(const h in s.errors)z[`${h}_$key$_${s.errors[h].sort().join(", ")}_$end$_`]=z[h],z[h]=void 0;for(const h in s.missing)z[`_$miss$_${h}|${s.missing[h]}_$end$_`]="__missing__"}return z}}return z===1/0||z===-1/0||Number.isNaN(z)||typeof z=="function"||typeof z=="symbol"?"["+z.toString()+"]":z}}},7629:(p,c,l)=>{const{assert:M,clone:g,deepEqual:y,merge:_}=l(8870),O=l(8652),d=l(8160),f=l(3292),z=l(6354),s=l(8901),h=l(1123),A=l(6914),q=l(2294),v=l(6133),L=l(2305),T=l(8863),w=l(2036),C={Base:class{constructor(R){this.type=R,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new q.Ids,this._preferences=null,this._refs=new v.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return M(typeof h.describe=="function","Manifest functionality disabled"),h.describe(this)}allow(...R){return d.verifyFlat(R,"allow"),this._values(R,"_valids")}alter(R){M(R&&typeof R=="object"&&!Array.isArray(R),"Invalid targets argument"),M(!this._inRuleset(),"Cannot set alterations inside a ruleset");const S=this.clone();S.$_terms.alterations=S.$_terms.alterations||[];for(const E in R){const G=R[E];M(typeof G=="function","Alteration adjuster for",E,"must be a function"),S.$_terms.alterations.push({target:E,adjuster:G})}return S.$_temp.ruleset=!1,S}artifact(R){return M(R!==void 0,"Artifact cannot be undefined"),M(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",R)}cast(R){return M(R===!1||typeof R=="string","Invalid to value"),M(R===!1||this._definition.cast[R],"Type",this.type,"does not support casting to",R),this.$_setFlag("cast",R===!1?void 0:R)}default(R,S){return this._default("default",R,S)}description(R){return M(R&&typeof R=="string","Description must be a non-empty string"),this.$_setFlag("description",R)}empty(R){const S=this.clone();return R!==void 0&&(R=S.$_compile(R,{override:!1})),S.$_setFlag("empty",R,{clone:!1})}error(R){return M(R,"Missing error"),M(R instanceof Error||typeof R=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",R)}example(R,S={}){return M(R!==void 0,"Missing example"),d.assertOptions(S,["override"]),this._inner("examples",R,{single:!0,override:S.override})}external(R,S){return typeof R=="object"&&(M(!S,"Cannot combine options with description"),S=R.description,R=R.method),M(typeof R=="function","Method must be a function"),M(S===void 0||S&&typeof S=="string","Description must be a non-empty string"),this._inner("externals",{method:R,description:S},{single:!0})}failover(R,S){return this._default("failover",R,S)}forbidden(){return this.presence("forbidden")}id(R){return R?(M(typeof R=="string","id must be a non-empty string"),M(/^[^\.]+$/.test(R),"id cannot contain period character"),this.$_setFlag("id",R)):this.$_setFlag("id",void 0)}invalid(...R){return this._values(R,"_invalids")}label(R){return M(R&&typeof R=="string","Label name must be a non-empty string"),this.$_setFlag("label",R)}meta(R){return M(R!==void 0,"Meta cannot be undefined"),this._inner("metas",R,{single:!0})}note(...R){M(R.length,"Missing notes");for(const S of R)M(S&&typeof S=="string","Notes must be non-empty strings");return this._inner("notes",R)}only(R=!0){return M(typeof R=="boolean","Invalid mode:",R),this.$_setFlag("only",R)}optional(){return this.presence("optional")}prefs(R){M(R,"Missing preferences"),M(R.context===void 0,"Cannot override context"),M(R.externals===void 0,"Cannot override externals"),M(R.warnings===void 0,"Cannot override warnings"),M(R.debug===void 0,"Cannot override debug"),d.checkPreferences(R);const S=this.clone();return S._preferences=d.preferences(S._preferences,R),S}presence(R){return M(["optional","required","forbidden"].includes(R),"Unknown presence mode",R),this.$_setFlag("presence",R)}raw(R=!0){return this.$_setFlag("result",R?"raw":void 0)}result(R){return M(["raw","strip"].includes(R),"Unknown result mode",R),this.$_setFlag("result",R)}required(){return this.presence("required")}strict(R){const S=this.clone(),E=R!==void 0&&!R;return S._preferences=d.preferences(S._preferences,{convert:E}),S}strip(R=!0){return this.$_setFlag("result",R?"strip":void 0)}tag(...R){M(R.length,"Missing tags");for(const S of R)M(S&&typeof S=="string","Tags must be non-empty strings");return this._inner("tags",R)}unit(R){return M(R&&typeof R=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",R)}valid(...R){d.verifyFlat(R,"valid");const S=this.allow(...R);return S.$_setFlag("only",!!S._valids,{clone:!1}),S}when(R,S){const E=this.clone();E.$_terms.whens||(E.$_terms.whens=[]);const G=f.when(E,R,S);if(!["any","link"].includes(E.type)){const s0=G.is?[G]:G.switch;for(const b0 of s0)M(!b0.then||b0.then.type==="any"||b0.then.type===E.type,"Cannot combine",E.type,"with",b0.then&&b0.then.type),M(!b0.otherwise||b0.otherwise.type==="any"||b0.otherwise.type===E.type,"Cannot combine",E.type,"with",b0.otherwise&&b0.otherwise.type)}return E.$_terms.whens.push(G),E.$_mutateRebuild()}cache(R){M(!this._inRuleset(),"Cannot set caching inside a ruleset"),M(!this._cache,"Cannot override schema cache"),M(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const S=this.clone();return S._cache=R||O.provider.provision(),S.$_temp.ruleset=!1,S}clone(){const R=Object.create(Object.getPrototypeOf(this));return this._assign(R)}concat(R){M(d.isSchema(R),"Invalid schema object"),M(this.type==="any"||R.type==="any"||R.type===this.type,"Cannot merge type",this.type,"with another type:",R.type),M(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),M(!R._inRuleset(),"Cannot concatenate a schema with open ruleset");let S=this.clone();if(this.type==="any"&&R.type!=="any"){const E=R.clone();for(const G of Object.keys(S))G!=="type"&&(E[G]=S[G]);S=E}S._ids.concat(R._ids),S._refs.register(R,v.toSibling),S._preferences=S._preferences?d.preferences(S._preferences,R._preferences):R._preferences,S._valids=w.merge(S._valids,R._valids,R._invalids),S._invalids=w.merge(S._invalids,R._invalids,R._valids);for(const E of R._singleRules.keys())S._singleRules.has(E)&&(S._rules=S._rules.filter(G=>G.keep||G.name!==E),S._singleRules.delete(E));for(const E of R._rules)R._definition.rules[E.method].multi||S._singleRules.set(E.name,E),S._rules.push(E);if(S._flags.empty&&R._flags.empty){S._flags.empty=S._flags.empty.concat(R._flags.empty);const E=Object.assign({},R._flags);delete E.empty,_(S._flags,E)}else if(R._flags.empty){S._flags.empty=R._flags.empty;const E=Object.assign({},R._flags);delete E.empty,_(S._flags,E)}else _(S._flags,R._flags);for(const E in R.$_terms){const G=R.$_terms[E];G?S.$_terms[E]?S.$_terms[E]=S.$_terms[E].concat(G):S.$_terms[E]=G.slice():S.$_terms[E]||(S.$_terms[E]=G)}return this.$_root._tracer&&this.$_root._tracer._combine(S,[this,R]),S.$_mutateRebuild()}extend(R){return M(!R.base,"Cannot extend type with another base"),s.type(this,R)}extract(R){return R=Array.isArray(R)?R:R.split("."),this._ids.reach(R)}fork(R,S){M(!this._inRuleset(),"Cannot fork inside a ruleset");let E=this;for(let G of[].concat(R))G=Array.isArray(G)?G:G.split("."),E=E._ids.fork(G,S,E);return E.$_temp.ruleset=!1,E}rule(R){const S=this._definition;d.assertOptions(R,Object.keys(S.modifiers)),M(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const E=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;M(E>=0&&E<this._rules.length,"Cannot apply rules to empty ruleset");const G=this.clone();for(let s0=E;s0<G._rules.length;++s0){const b0=G._rules[s0],V=g(b0);for(const Z in R)S.modifiers[Z](V,R[Z]),M(V.name===b0.name,"Cannot change rule name");G._rules[s0]=V,G._singleRules.get(V.name)===b0&&G._singleRules.set(V.name,V)}return G.$_temp.ruleset=!1,G.$_mutateRebuild()}get ruleset(){M(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const R=this.clone();return R.$_temp.ruleset=R._rules.length,R}get $(){return this.ruleset}tailor(R){R=[].concat(R),M(!this._inRuleset(),"Cannot tailor inside a ruleset");let S=this;if(this.$_terms.alterations)for(const{target:E,adjuster:G}of this.$_terms.alterations)R.includes(E)&&(S=G(S),M(d.isSchema(S),"Alteration adjuster for",E,"failed to return a schema object"));return S=S.$_modify({each:E=>E.tailor(R),ref:!1}),S.$_temp.ruleset=!1,S.$_mutateRebuild()}tracer(){return L.location?L.location(this):this}validate(R,S){return T.entry(R,this,S)}validateAsync(R,S){return T.entryAsync(R,this,S)}$_addRule(R){typeof R=="string"&&(R={name:R}),M(R&&typeof R=="object","Invalid options"),M(R.name&&typeof R.name=="string","Invalid rule name");for(const b0 in R)M(b0[0]!=="_","Cannot set private rule properties");const S=Object.assign({},R);S._resolve=[],S.method=S.method||S.name;const E=this._definition.rules[S.method],G=S.args;M(E,"Unknown rule",S.method);const s0=this.clone();if(G){M(Object.keys(G).length===1||Object.keys(G).length===this._definition.rules[S.name].args.length,"Invalid rule definition for",this.type,S.name);for(const b0 in G){let V=G[b0];if(E.argsByName){const Z=E.argsByName.get(b0);if(Z.ref&&d.isResolvable(V))S._resolve.push(b0),s0.$_mutateRegister(V);else if(Z.normalize&&(V=Z.normalize(V),G[b0]=V),Z.assert){const d0=d.validateArg(V,b0,Z);M(!d0,d0,"or reference")}}V!==void 0?G[b0]=V:delete G[b0]}}return E.multi||(s0._ruleRemove(S.name,{clone:!1}),s0._singleRules.set(S.name,S)),s0.$_temp.ruleset===!1&&(s0.$_temp.ruleset=null),E.priority?s0._rules.unshift(S):s0._rules.push(S),s0}$_compile(R,S){return f.schema(this.$_root,R,S)}$_createError(R,S,E,G,s0,b0={}){const V=b0.flags!==!1?this._flags:{},Z=b0.messages?A.merge(this._definition.messages,b0.messages):this._definition.messages;return new z.Report(R,S,E,V,Z,G,s0)}$_getFlag(R){return this._flags[R]}$_getRule(R){return this._singleRules.get(R)}$_mapLabels(R){return R=Array.isArray(R)?R:R.split("."),this._ids.labels(R)}$_match(R,S,E,G){(E=Object.assign({},E)).abortEarly=!0,E._externals=!1,S.snapshot();const s0=!T.validate(R,this,S,E,G).errors;return S.restore(),s0}$_modify(R){return d.assertOptions(R,["each","once","ref","schema"]),q.schema(this,R)||this}$_mutateRebuild(){return M(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(R,{source:S,name:E,path:G,key:s0})=>{const b0=this._definition[S][E]&&this._definition[S][E].register;b0!==!1&&this.$_mutateRegister(R,{family:b0,key:s0})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(R,{family:S,key:E}={}){this._refs.register(R,S),this._ids.register(R,{key:E})}$_property(R){return this._definition.properties[R]}$_reach(R){return this._ids.reach(R)}$_rootReferences(){return this._refs.roots()}$_setFlag(R,S,E={}){M(R[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const G=this._definition.flags[R]||{};if(y(S,G.default)&&(S=void 0),y(S,this._flags[R]))return this;const s0=E.clone!==!1?this.clone():this;return S!==void 0?(s0._flags[R]=S,s0.$_mutateRegister(S)):delete s0._flags[R],R[0]!=="_"&&(s0.$_temp.ruleset=!1),s0}$_parent(R,...S){return this[R][d.symbols.parent].call(this,...S)}$_validate(R,S,E){return T.validate(R,this,S,E)}_assign(R){R.type=this.type,R.$_root=this.$_root,R.$_temp=Object.assign({},this.$_temp),R.$_temp.whens={},R._ids=this._ids.clone(),R._preferences=this._preferences,R._valids=this._valids&&this._valids.clone(),R._invalids=this._invalids&&this._invalids.clone(),R._rules=this._rules.slice(),R._singleRules=g(this._singleRules,{shallow:!0}),R._refs=this._refs.clone(),R._flags=Object.assign({},this._flags),R._cache=null,R.$_terms={};for(const S in this.$_terms)R.$_terms[S]=this.$_terms[S]?this.$_terms[S].slice():null;R.$_super={};for(const S in this.$_super)R.$_super[S]=this._super[S].bind(R);return R}_bare(){const R=this.clone();R._reset();const S=R._definition.terms;for(const E in S){const G=S[E];R.$_terms[E]=G.init}return R.$_mutateRebuild()}_default(R,S,E={}){return d.assertOptions(E,"literal"),M(S!==void 0,"Missing",R,"value"),M(typeof S=="function"||!E.literal,"Only function value supports literal option"),typeof S=="function"&&E.literal&&(S={[d.symbols.literal]:!0,literal:S}),this.$_setFlag(R,S)}_generate(R,S,E){if(!this.$_terms.whens)return{schema:this};const G=[],s0=[];for(let Z=0;Z<this.$_terms.whens.length;++Z){const d0=this.$_terms.whens[Z];if(d0.concat){G.push(d0.concat),s0.push(`${Z}.concat`);continue}const v0=d0.ref?d0.ref.resolve(R,S,E):R,E0=d0.is?[d0]:d0.switch,S0=s0.length;for(let G0=0;G0<E0.length;++G0){const{is:v1,then:h1,otherwise:Y1}=E0[G0],Oe=`${Z}${d0.switch?"."+G0:""}`;if(v1.$_match(v0,S.nest(v1,`${Oe}.is`),E)){if(h1){const le=S.localize([...S.path,`${Oe}.then`],S.ancestors,S.schemas),{schema:e1,id:B1}=h1._generate(R,le,E);G.push(e1),s0.push(`${Oe}.then${B1?`(${B1})`:""}`);break}}else if(Y1){const le=S.localize([...S.path,`${Oe}.otherwise`],S.ancestors,S.schemas),{schema:e1,id:B1}=Y1._generate(R,le,E);G.push(e1),s0.push(`${Oe}.otherwise${B1?`(${B1})`:""}`);break}}if(d0.break&&s0.length>S0)break}const b0=s0.join(", ");if(S.mainstay.tracer.debug(S,"rule","when",b0),!b0)return{schema:this};if(!S.mainstay.tracer.active&&this.$_temp.whens[b0])return{schema:this.$_temp.whens[b0],id:b0};let V=this;this._definition.generate&&(V=this._definition.generate(this,R,S,E));for(const Z of G)V=V.concat(Z);return this.$_root._tracer&&this.$_root._tracer._combine(V,[this,...G]),this.$_temp.whens[b0]=V,{schema:V,id:b0}}_inner(R,S,E={}){M(!this._inRuleset(),`Cannot set ${R} inside a ruleset`);const G=this.clone();return G.$_terms[R]&&!E.override||(G.$_terms[R]=[]),E.single?G.$_terms[R].push(S):G.$_terms[R].push(...S),G.$_temp.ruleset=!1,G}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(R,S={}){if(!this._singleRules.has(R))return this;const E=S.clone!==!1?this.clone():this;E._singleRules.delete(R);const G=[];for(let s0=0;s0<E._rules.length;++s0){const b0=E._rules[s0];b0.name!==R||b0.keep?G.push(b0):E._inRuleset()&&s0<E.$_temp.ruleset&&--E.$_temp.ruleset}return E._rules=G,E}_values(R,S){d.verifyFlat(R,S.slice(1,-1));const E=this.clone(),G=R[0]===d.symbols.override;if(G&&(R=R.slice(1)),!E[S]&&R.length?E[S]=new w:G&&(E[S]=R.length?new w:null,E.$_mutateRebuild()),!E[S])return E;G&&E[S].override();for(const s0 of R){M(s0!==void 0,"Cannot call allow/valid/invalid with undefined"),M(s0!==d.symbols.override,"Override must be the first value");const b0=S==="_invalids"?"_valids":"_invalids";E[b0]&&(E[b0].remove(s0),E[b0].length||(M(S==="_valids"||!E._flags.only,"Setting invalid value",s0,"leaves schema rejecting all values due to previous valid rule"),E[b0]=null)),E[S].add(s0,E._refs)}return E}}};C.Base.prototype[d.symbols.any]={version:d.version,compile:f.compile,root:"$_root"},C.Base.prototype.isImmutable=!0,C.Base.prototype.deny=C.Base.prototype.invalid,C.Base.prototype.disallow=C.Base.prototype.invalid,C.Base.prototype.equal=C.Base.prototype.valid,C.Base.prototype.exist=C.Base.prototype.required,C.Base.prototype.not=C.Base.prototype.invalid,C.Base.prototype.options=C.Base.prototype.prefs,C.Base.prototype.preferences=C.Base.prototype.prefs,p.exports=new C.Base},8652:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(8160),_={max:1e3,supported:new Set(["undefined","boolean","number","string"])};c.provider={provision:O=>new _.Cache(O)},_.Cache=class{constructor(O={}){y.assertOptions(O,["max"]),M(O.max===void 0||O.max&&O.max>0&&isFinite(O.max),"Invalid max cache size"),this._max=O.max||_.max,this._map=new Map,this._list=new _.List}get length(){return this._map.size}set(O,d){if(O!==null&&!_.supported.has(typeof O))return;let f=this._map.get(O);if(f)return f.value=d,void this._list.first(f);f=this._list.unshift({key:O,value:d}),this._map.set(O,f),this._compact()}get(O){const d=this._map.get(O);if(d)return this._list.first(d),g(d.value)}_compact(){if(this._map.size>this._max){const O=this._list.pop();this._map.delete(O.key)}}},_.List=class{constructor(){this.tail=null,this.head=null}unshift(O){return O.next=null,O.prev=this.head,this.head&&(this.head.next=O),this.head=O,this.tail||(this.tail=O),O}first(O){O!==this.head&&(this._remove(O),this.unshift(O))}pop(){return this._remove(this.tail)}_remove(O){const{next:d,prev:f}=O;return d.prev=f,f&&(f.next=d),O===this.tail&&(this.tail=d),O.prev=null,O.next=null,O}}},8160:(p,c,l)=>{const{assert:M,AssertError:g}=l(8870),y=l(5934);let _,O;const d={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};c.version=y.version,c.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},c.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},c.assertOptions=function(f,z,s="Options"){M(f&&typeof f=="object"&&!Array.isArray(f),"Options must be of type object");const h=Object.keys(f).filter(A=>!z.includes(A));M(h.length===0,`${s} contain unknown keys: ${h}`)},c.checkPreferences=function(f){O=O||l(3378);const z=O.preferences.validate(f);if(z.error)throw new g([z.error.details[0].message])},c.compare=function(f,z,s){switch(s){case"=":return f===z;case">":return f>z;case"<":return f<z;case">=":return f>=z;case"<=":return f<=z}},c.default=function(f,z){return f===void 0?z:f},c.isIsoDate=function(f){return d.isoDate.test(f)},c.isNumber=function(f){return typeof f=="number"&&!isNaN(f)},c.isResolvable=function(f){return!!f&&(f[c.symbols.ref]||f[c.symbols.template])},c.isSchema=function(f,z={}){const s=f&&f[c.symbols.any];return!!s&&(M(z.legacy||s.version===c.version,"Cannot mix different versions of joi schemas"),!0)},c.isValues=function(f){return f[c.symbols.values]},c.limit=function(f){return Number.isSafeInteger(f)&&f>=0},c.preferences=function(f,z){_=_||l(6914),f=f||{},z=z||{};const s=Object.assign({},f,z);return z.errors&&f.errors&&(s.errors=Object.assign({},f.errors,z.errors),s.errors.wrap=Object.assign({},f.errors.wrap,z.errors.wrap)),z.messages&&(s.messages=_.compile(z.messages,f.messages)),delete s[c.symbols.prefs],s},c.tryWithPath=function(f,z,s={}){try{return f()}catch(h){throw h.path!==void 0?h.path=z+"."+h.path:h.path=z,s.append&&(h.message=`${h.message} (${h.path})`),h}},c.validateArg=function(f,z,{assert:s,message:h}){if(c.isSchema(s)){const A=s.validate(f);return A.error?A.error.message:void 0}if(!s(f))return z?`${z} ${h}`:h},c.verifyFlat=function(f,z){for(const s of f)M(!Array.isArray(s),"Method no longer accepts array arguments:",z)}},3292:(p,c,l)=>{const{assert:M}=l(8870),g=l(8160),y=l(6133),_={};c.schema=function(O,d,f={}){g.assertOptions(f,["appendPath","override"]);try{return _.schema(O,d,f)}catch(z){throw f.appendPath&&z.path!==void 0&&(z.message=`${z.message} (${z.path})`),z}},_.schema=function(O,d,f){M(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(M(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const z=(s,...h)=>f.override!==!1?s.valid(O.override,...h):s.valid(...h);if(_.simple(d))return z(O,d);if(typeof d=="function")return O.custom(d);if(M(typeof d=="object","Invalid schema content:",typeof d),g.isResolvable(d))return z(O,d);if(g.isSchema(d))return d;if(Array.isArray(d)){for(const s of d)if(!_.simple(s))return O.alternatives().try(...d);return z(O,...d)}return d instanceof RegExp?O.string().regex(d):d instanceof Date?z(O.date(),d):(M(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),O.object().keys(d))},c.ref=function(O,d){return y.isRef(O)?O:y.create(O,d)},c.compile=function(O,d,f={}){g.assertOptions(f,["legacy"]);const z=d&&d[g.symbols.any];if(z)return M(f.legacy||z.version===g.version,"Cannot mix different versions of joi schemas:",z.version,g.version),d;if(typeof d!="object"||!f.legacy)return c.schema(O,d,{appendPath:!0});const s=_.walk(d);return s?s.compile(s.root,d):c.schema(O,d,{appendPath:!0})},_.walk=function(O){if(typeof O!="object")return null;if(Array.isArray(O)){for(const f of O){const z=_.walk(f);if(z)return z}return null}const d=O[g.symbols.any];if(d)return{root:O[d.root],compile:d.compile};M(Object.getPrototypeOf(O)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const f in O){const z=_.walk(O[f]);if(z)return z}return null},_.simple=function(O){return O===null||["boolean","string","number"].includes(typeof O)},c.when=function(O,d,f){if(f===void 0&&(M(d&&typeof d=="object","Missing options"),f=d,d=y.create(".")),Array.isArray(f)&&(f={switch:f}),g.assertOptions(f,["is","not","then","otherwise","switch","break"]),g.isSchema(d))return M(f.is===void 0,'"is" can not be used with a schema condition'),M(f.not===void 0,'"not" can not be used with a schema condition'),M(f.switch===void 0,'"switch" can not be used with a schema condition'),_.condition(O,{is:d,then:f.then,otherwise:f.otherwise,break:f.break});if(M(y.isRef(d)||typeof d=="string","Invalid condition:",d),M(f.not===void 0||f.is===void 0,'Cannot combine "is" with "not"'),f.switch===void 0){let s=f;f.not!==void 0&&(s={is:f.not,then:f.otherwise,otherwise:f.then,break:f.break});let h=s.is!==void 0?O.$_compile(s.is):O.$_root.invalid(null,!1,0,"").required();return M(s.then!==void 0||s.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),M(s.break===void 0||s.then===void 0||s.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),f.is===void 0||y.isRef(f.is)||g.isSchema(f.is)||(h=h.required()),_.condition(O,{ref:c.ref(d),is:h,then:s.then,otherwise:s.otherwise,break:s.break})}M(Array.isArray(f.switch),'"switch" must be an array'),M(f.is===void 0,'Cannot combine "switch" with "is"'),M(f.not===void 0,'Cannot combine "switch" with "not"'),M(f.then===void 0,'Cannot combine "switch" with "then"');const z={ref:c.ref(d),switch:[],break:f.break};for(let s=0;s<f.switch.length;++s){const h=f.switch[s],A=s===f.switch.length-1;g.assertOptions(h,A?["is","then","otherwise"]:["is","then"]),M(h.is!==void 0,'Switch statement missing "is"'),M(h.then!==void 0,'Switch statement missing "then"');const q={is:O.$_compile(h.is),then:O.$_compile(h.then)};if(y.isRef(h.is)||g.isSchema(h.is)||(q.is=q.is.required()),A){M(f.otherwise===void 0||h.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const v=f.otherwise!==void 0?f.otherwise:h.otherwise;v!==void 0&&(M(z.break===void 0,"Cannot specify both otherwise and break"),q.otherwise=O.$_compile(v))}z.switch.push(q)}return z},_.condition=function(O,d){for(const f of["then","otherwise"])d[f]===void 0?delete d[f]:d[f]=O.$_compile(d[f]);return d}},6354:(p,c,l)=>{const M=l(514),g=l(8160),y=l(3328);c.Report=class{constructor(_,O,d,f,z,s,h){if(this.code=_,this.flags=f,this.messages=z,this.path=s.path,this.prefs=h,this.state=s,this.value=O,this.message=null,this.template=null,this.local=d||{},this.local.label=c.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const A=this.path[this.path.length-1];typeof A!="object"&&(this.local.key=A)}}_setTemplate(_){if(this.template=_,!this.flags.label&&this.path.length===0){const O=this._template(this.template,"root");O&&(this.local.label=O)}}toString(){if(this.message)return this.message;const _=this.code;if(!this.prefs.errors.render)return this.code;const O=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return O===void 0?`Error code "${_}" is not defined, your custom type is missing the correct messages definition`:(this.message=O.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(_,O){return c.template(this.value,_,O||this.code,this.state,this.prefs)}},c.path=function(_){let O="";for(const d of _)typeof d!="object"&&(typeof d=="string"?(O&&(O+="."),O+=d):O+=`[${d}]`);return O},c.template=function(_,O,d,f,z){if(!O)return;if(y.isTemplate(O))return d!=="root"?O:null;let s=z.errors.language;if(g.isResolvable(s)&&(s=s.resolve(_,f,z)),s&&O[s]){if(O[s][d]!==void 0)return O[s][d];if(O[s]["*"]!==void 0)return O[s]["*"]}return O[d]?O[d]:O["*"]},c.label=function(_,O,d,f){if(_.label)return _.label;if(!d.errors.label)return"";let z=O.path;return d.errors.label==="key"&&O.path.length>1&&(z=O.path.slice(-1)),c.path(z)||c.template(null,d.messages,"root",O,d)||f&&c.template(null,f,"root",O,d)||"value"},c.process=function(_,O,d){if(!_)return null;const{override:f,message:z,details:s}=c.details(_);if(f)return f;if(d.errors.stack)return new c.ValidationError(z,s,O);const h=Error.stackTraceLimit;Error.stackTraceLimit=0;const A=new c.ValidationError(z,s,O);return Error.stackTraceLimit=h,A},c.details=function(_,O={}){let d=[];const f=[];for(const z of _){if(z instanceof Error){if(O.override!==!1)return{override:z};const h=z.toString();d.push(h),f.push({message:h,type:"override",context:{error:z}});continue}const s=z.toString();d.push(s),f.push({message:s,path:z.path.filter(h=>typeof h!="object"),type:z.code,context:z.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:f}},c.ValidationError=class extends Error{constructor(_,O,d){super(_),this._original=d,this.details=O}static isError(_){return _ instanceof c.ValidationError}},c.ValidationError.prototype.isJoi=!0,c.ValidationError.prototype.name="ValidationError",c.ValidationError.prototype.annotate=M.error},8901:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(8160),_=l(6914),O={};c.type=function(d,f){const z=Object.getPrototypeOf(d),s=g(z),h=d._assign(Object.create(s)),A=Object.assign({},f);delete A.base,s._definition=A;const q=z._definition||{};A.messages=_.merge(q.messages,A.messages),A.properties=Object.assign({},q.properties,A.properties),h.type=A.type,A.flags=Object.assign({},q.flags,A.flags);const v=Object.assign({},q.terms);if(A.terms)for(const C in A.terms){const R=A.terms[C];M(h.$_terms[C]===void 0,"Invalid term override for",A.type,C),h.$_terms[C]=R.init,v[C]=R}A.terms=v,A.args||(A.args=q.args),A.prepare=O.prepare(A.prepare,q.prepare),A.coerce&&(typeof A.coerce=="function"&&(A.coerce={method:A.coerce}),A.coerce.from&&!Array.isArray(A.coerce.from)&&(A.coerce={method:A.coerce.method,from:[].concat(A.coerce.from)})),A.coerce=O.coerce(A.coerce,q.coerce),A.validate=O.validate(A.validate,q.validate);const L=Object.assign({},q.rules);if(A.rules)for(const C in A.rules){const R=A.rules[C];M(typeof R=="object","Invalid rule definition for",A.type,C);let S=R.method;if(S===void 0&&(S=function(){return this.$_addRule(C)}),S&&(M(!s[C],"Rule conflict in",A.type,C),s[C]=S),M(!L[C],"Rule conflict in",A.type,C),L[C]=R,R.alias){const E=[].concat(R.alias);for(const G of E)s[G]=R.method}R.args&&(R.argsByName=new Map,R.args=R.args.map(E=>(typeof E=="string"&&(E={name:E}),M(!R.argsByName.has(E.name),"Duplicated argument name",E.name),y.isSchema(E.assert)&&(E.assert=E.assert.strict().label(E.name)),R.argsByName.set(E.name,E),E)))}A.rules=L;const T=Object.assign({},q.modifiers);if(A.modifiers)for(const C in A.modifiers){M(!s[C],"Rule conflict in",A.type,C);const R=A.modifiers[C];M(typeof R=="function","Invalid modifier definition for",A.type,C);const S=function(E){return this.rule({[C]:E})};s[C]=S,T[C]=R}if(A.modifiers=T,A.overrides){s._super=z,h.$_super={};for(const C in A.overrides)M(z[C],"Cannot override missing",C),A.overrides[C][y.symbols.parent]=z[C],h.$_super[C]=z[C].bind(h);Object.assign(s,A.overrides)}A.cast=Object.assign({},q.cast,A.cast);const w=Object.assign({},q.manifest,A.manifest);return w.build=O.build(A.manifest&&A.manifest.build,q.manifest&&q.manifest.build),A.manifest=w,A.rebuild=O.rebuild(A.rebuild,q.rebuild),h},O.build=function(d,f){return d&&f?function(z,s){return f(d(z,s),s)}:d||f},O.coerce=function(d,f){return d&&f?{from:d.from&&f.from?[...new Set([...d.from,...f.from])]:null,method(z,s){let h;if((!f.from||f.from.includes(typeof z))&&(h=f.method(z,s),h)){if(h.errors||h.value===void 0)return h;z=h.value}if(!d.from||d.from.includes(typeof z)){const A=d.method(z,s);if(A)return A}return h}}:d||f},O.prepare=function(d,f){return d&&f?function(z,s){const h=d(z,s);if(h){if(h.errors||h.value===void 0)return h;z=h.value}return f(z,s)||h}:d||f},O.rebuild=function(d,f){return d&&f?function(z){f(z),d(z)}:d||f},O.validate=function(d,f){return d&&f?function(z,s){const h=f(z,s);if(h){if(h.errors&&(!Array.isArray(h.errors)||h.errors.length))return h;z=h.value}return d(z,s)||h}:d||f}},5107:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(8652),_=l(8160),O=l(3292),d=l(6354),f=l(8901),z=l(1123),s=l(6133),h=l(3328),A=l(2305);let q;const v={types:{alternatives:l(4946),any:l(8068),array:l(546),boolean:l(4937),date:l(7500),function:l(390),link:l(8785),number:l(3832),object:l(8966),string:l(7417),symbol:l(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const L={_types:new Set(Object.keys(v.types))};for(const T of L._types)L[T]=function(...w){return M(!w.length||["alternatives","link","object"].includes(T),"The",T,"type does not allow arguments"),v.generate(this,v.types[T],w)};for(const T of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])L[T]=function(...w){return this.any()[T](...w)};Object.assign(L,v.methods);for(const T in v.aliases){const w=v.aliases[T];L[T]=L[w]}return L.x=L.expression,A.setup&&A.setup(L),L}};v.methods={ValidationError:d.ValidationError,version:_.version,cache:y.provider,assert(L,T,...w){v.assert(L,T,!0,w)},attempt:(L,T,...w)=>v.assert(L,T,!1,w),build(L){return M(typeof z.build=="function","Manifest functionality disabled"),z.build(this,L)},checkPreferences(L){_.checkPreferences(L)},compile(L,T){return O.compile(this,L,T)},defaults(L){M(typeof L=="function","modifier must be a function");const T=Object.assign({},this);for(const w of T._types){const C=L(T[w]());M(_.isSchema(C),"modifier must return a valid schema object"),T[w]=function(...R){return v.generate(this,C,R)}}return T},expression:(...L)=>new h(...L),extend(...L){_.verifyFlat(L,"extend"),q=q||l(3378),M(L.length,"You need to provide at least one extension"),this.assert(L,q.extensions);const T=Object.assign({},this);T._types=new Set(T._types);for(let w of L){typeof w=="function"&&(w=w(T)),this.assert(w,q.extension);const C=v.expandExtension(w,T);for(const R of C){M(T[R.type]===void 0||T._types.has(R.type),"Cannot override name",R.type);const S=R.base||this.any(),E=f.type(S,R);T._types.add(R.type),T[R.type]=function(...G){return v.generate(this,E,G)}}}return T},isError:d.ValidationError.isError,isExpression:h.isTemplate,isRef:s.isRef,isSchema:_.isSchema,in:(...L)=>s.in(...L),override:_.symbols.override,ref:(...L)=>s.create(...L),types(){const L={};for(const T of this._types)L[T]=this[T]();for(const T in v.aliases)L[T]=this[T]();return L}},v.assert=function(L,T,w,C){const R=C[0]instanceof Error||typeof C[0]=="string"?C[0]:null,S=R!==null?C[1]:C[0],E=T.validate(L,_.preferences({errors:{stack:!0}},S||{}));let G=E.error;if(!G)return E.value;if(R instanceof Error)throw R;const s0=w&&typeof G.annotate=="function"?G.annotate():G.message;throw G instanceof d.ValidationError==0&&(G=g(G)),G.message=R?`${R} ${s0}`:s0,G},v.generate=function(L,T,w){return M(L,"Must be invoked on a Joi instance."),T.$_root=L,T._definition.args&&w.length?T._definition.args(T,...w):T},v.expandExtension=function(L,T){if(typeof L.type=="string")return[L];const w=[];for(const C of T._types)if(L.type.test(C)){const R=Object.assign({},L);R.type=C,R.base=T[C](),w.push(R)}return w},p.exports=v.root()},1123:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(8160),_=l(6914),O=l(6133),d=l(3328);let f;const z={};c.describe=function(s){const h=s._definition,A={type:s.type,flags:{},rules:[]};for(const q in s._flags)q[0]!=="_"&&(A.flags[q]=z.describe(s._flags[q]));Object.keys(A.flags).length||delete A.flags,s._preferences&&(A.preferences=g(s._preferences,{shallow:["messages"]}),delete A.preferences[y.symbols.prefs],A.preferences.messages&&(A.preferences.messages=_.decompile(A.preferences.messages))),s._valids&&(A.allow=s._valids.describe()),s._invalids&&(A.invalid=s._invalids.describe());for(const q of s._rules){if(h.rules[q.name].manifest===!1)continue;const v={name:q.name};for(const L in h.modifiers)q[L]!==void 0&&(v[L]=z.describe(q[L]));if(q.args){v.args={};for(const L in q.args){const T=q.args[L];(L!=="options"||Object.keys(T).length)&&(v.args[L]=z.describe(T,{assign:L}))}Object.keys(v.args).length||delete v.args}A.rules.push(v)}A.rules.length||delete A.rules;for(const q in s.$_terms){if(q[0]==="_")continue;M(!A[q],"Cannot describe schema due to internal name conflict with",q);const v=s.$_terms[q];if(!v)continue;if(v instanceof Map){v.size&&(A[q]=[...v.entries()]);continue}if(y.isValues(v)){A[q]=v.describe();continue}M(h.terms[q],"Term",q,"missing configuration");const L=h.terms[q].manifest,T=typeof L=="object";if(!v.length&&!T)continue;const w=[];for(const C of v)w.push(z.describe(C));if(T){const{from:C,to:R}=L.mapped;A[q]={};for(const S of w)A[q][S[R]]=S[C]}else L!=="single"?A[q]=w:(M(w.length===1,"Term",q,"contains more than one item"),A[q]=w[0])}return z.validate(s.$_root,A),A},z.describe=function(s,h={}){if(Array.isArray(s))return s.map(z.describe);if(s===y.symbols.deepDefault)return{special:"deep"};if(typeof s!="object"||s===null)return s;if(h.assign==="options")return g(s);if(s instanceof Date)return s.toISOString();if(s instanceof Error)return s;if(s instanceof RegExp)return h.assign==="regex"?s.toString():{regex:s.toString()};if(s[y.symbols.literal])return{function:s.literal};if(typeof s.describe=="function")return h.assign==="ref"?s.describe().ref:s.describe();const A={};for(const q in s){const v=s[q];v!==void 0&&(A[q]=z.describe(v,{assign:q}))}return A},c.build=function(s,h){return new z.Builder(s).parse(h)},z.Builder=class{constructor(s){this.joi=s}parse(s){z.validate(this.joi,s);let h=this.joi[s.type]()._bare();const A=h._definition;if(s.flags)for(const v in s.flags){const L=A.flags[v]&&A.flags[v].setter||v;M(typeof h[L]=="function","Invalid flag",v,"for type",s.type),h=h[L](this.build(s.flags[v]))}if(s.preferences&&(h=h.preferences(this.build(s.preferences))),s.allow&&(h=h.allow(...this.build(s.allow))),s.invalid&&(h=h.invalid(...this.build(s.invalid))),s.rules)for(const v of s.rules){M(typeof h[v.name]=="function","Invalid rule",v.name,"for type",s.type);const L=[];if(v.args){const w={};for(const S in v.args)w[S]=this.build(v.args[S],{assign:S});const C=Object.keys(w),R=A.rules[v.name].args;if(R){M(C.length<=R.length,"Invalid number of arguments for",s.type,v.name,"(expected up to",R.length,", found",C.length,")");for(const{name:S}of R)L.push(w[S])}else M(C.length===1,"Invalid number of arguments for",s.type,v.name,"(expected up to 1, found",C.length,")"),L.push(w[C[0]])}h=h[v.name](...L);const T={};for(const w in A.modifiers)v[w]!==void 0&&(T[w]=this.build(v[w]));Object.keys(T).length&&(h=h.rule(T))}const q={};for(const v in s){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(v))continue;M(A.terms[v],"Term",v,"missing configuration");const L=A.terms[v].manifest;if(L!=="schema")if(L!=="values")if(L!=="single")if(typeof L!="object")q[v]=this.build(s[v]);else{q[v]={};for(const T in s[v]){const w=s[v][T];q[v][T]=this.parse(w)}}else q[v]=this.build(s[v]);else q[v]=s[v].map(T=>this.build(T));else q[v]=s[v].map(T=>this.parse(T))}return s.whens&&(q.whens=s.whens.map(v=>this.build(v))),h=A.manifest.build(h,q),h.$_temp.ruleset=!1,h}build(s,h={}){if(s===null)return null;if(Array.isArray(s))return s.map(q=>this.build(q));if(s instanceof Error)return s;if(h.assign==="options")return g(s);if(h.assign==="regex")return z.regex(s);if(h.assign==="ref")return O.build(s);if(typeof s!="object")return s;if(Object.keys(s).length===1){if(s.buffer)return M(!1,"Buffers are not supported"),!1;if(s.function)return{[y.symbols.literal]:!0,literal:s.function};if(s.override)return y.symbols.override;if(s.ref)return O.build(s.ref);if(s.regex)return z.regex(s.regex);if(s.special)return M(["deep"].includes(s.special),"Unknown special value",s.special),y.symbols.deepDefault;if(s.value)return g(s.value)}if(s.type)return this.parse(s);if(s.template)return d.build(s);const A={};for(const q in s)A[q]=this.build(s[q],{assign:q});return A}},z.regex=function(s){const h=s.lastIndexOf("/"),A=s.slice(1,h),q=s.slice(h+1);return new RegExp(A,q)},z.validate=function(s,h){f=f||l(3378),s.assert(h,f.description)}},6914:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(3328);c.compile=function(_,O){if(typeof _=="string")return M(!O,"Cannot set single message string"),new y(_);if(y.isTemplate(_))return M(!O,"Cannot set single message template"),_;M(typeof _=="object"&&!Array.isArray(_),"Invalid message options"),O=O?g(O):{};for(let d in _){const f=_[d];if(d==="root"||y.isTemplate(f)){O[d]=f;continue}if(typeof f=="string"){O[d]=new y(f);continue}M(typeof f=="object"&&!Array.isArray(f),"Invalid message for",d);const z=d;for(d in O[z]=O[z]||{},f){const s=f[d];d==="root"||y.isTemplate(s)?O[z][d]=s:(M(typeof s=="string","Invalid message for",d,"in",z),O[z][d]=new y(s))}}return O},c.decompile=function(_){const O={};for(let d in _){const f=_[d];if(d==="root"){O.root=f;continue}if(y.isTemplate(f)){O[d]=f.describe({compact:!0});continue}const z=d;for(d in O[z]={},f){const s=f[d];d!=="root"?O[z][d]=s.describe({compact:!0}):O[z].root=s}}return O},c.merge=function(_,O){if(!_)return c.compile(O);if(!O)return _;if(typeof O=="string")return new y(O);if(y.isTemplate(O))return O;const d=g(_);for(let f in O){const z=O[f];if(f==="root"||y.isTemplate(z)){d[f]=z;continue}if(typeof z=="string"){d[f]=new y(z);continue}M(typeof z=="object"&&!Array.isArray(z),"Invalid message for",f);const s=f;for(f in d[s]=d[s]||{},z){const h=z[f];f==="root"||y.isTemplate(h)?d[s][f]=h:(M(typeof h=="string","Invalid message for",f,"in",s),d[s][f]=new y(h))}}return d}},2294:(p,c,l)=>{const{assert:M}=l(8870),g=l(8160),y=l(6133),_={};c.Ids=_.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const O=new _.Ids;return O._byId=new Map(this._byId),O._byKey=new Map(this._byKey),O._schemaChain=this._schemaChain,O}concat(O){O._schemaChain&&(this._schemaChain=!0);for(const[d,f]of O._byId.entries())M(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,f);for(const[d,f]of O._byKey.entries())M(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,f)}fork(O,d,f){const z=this._collect(O);z.push({schema:f});const s=z.shift();let h={id:s.id,schema:d(s.schema)};M(g.isSchema(h.schema),"adjuster function failed to return a joi schema type");for(const A of z)h={id:A.id,schema:_.fork(A.schema,h.id,h.schema)};return h.schema}labels(O,d=[]){const f=O[0],z=this._get(f);if(!z)return[...d,...O].join(".");const s=O.slice(1);return d=[...d,z.schema._flags.label||f],s.length?z.schema._ids.labels(s,d):d.join(".")}reach(O,d=[]){const f=O[0],z=this._get(f);M(z,"Schema does not contain path",[...d,...O].join("."));const s=O.slice(1);return s.length?z.schema._ids.reach(s,[...d,f]):z.schema}register(O,{key:d}={}){if(!O||!g.isSchema(O))return;(O.$_property("schemaChain")||O._ids._schemaChain)&&(this._schemaChain=!0);const f=O._flags.id;if(f){const z=this._byId.get(f);M(!z||z.schema===O,"Cannot add different schemas with the same id:",f),M(!this._byKey.has(f),"Schema id conflicts with existing key:",f),this._byId.set(f,{schema:O,id:f})}d&&(M(!this._byKey.has(d),"Schema already contains key:",d),M(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:O,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(O,d=[],f=[]){const z=O[0],s=this._get(z);M(s,"Schema does not contain path",[...d,...O].join(".")),f=[s,...f];const h=O.slice(1);return h.length?s.schema._ids._collect(h,[...d,z],f):f}_get(O){return this._byId.get(O)||this._byKey.get(O)}},_.fork=function(O,d,f){const z=c.schema(O,{each:(s,{key:h})=>{if(d===(s._flags.id||h))return f},ref:!1});return z?z.$_mutateRebuild():O},c.schema=function(O,d){let f;for(const z in O._flags){if(z[0]==="_")continue;const s=_.scan(O._flags[z],{source:"flags",name:z},d);s!==void 0&&(f=f||O.clone(),f._flags[z]=s)}for(let z=0;z<O._rules.length;++z){const s=O._rules[z],h=_.scan(s.args,{source:"rules",name:s.name},d);if(h!==void 0){f=f||O.clone();const A=Object.assign({},s);A.args=h,f._rules[z]=A,f._singleRules.get(s.name)===s&&f._singleRules.set(s.name,A)}}for(const z in O.$_terms){if(z[0]==="_")continue;const s=_.scan(O.$_terms[z],{source:"terms",name:z},d);s!==void 0&&(f=f||O.clone(),f.$_terms[z]=s)}return f},_.scan=function(O,d,f,z,s){const h=z||[];if(O===null||typeof O!="object")return;let A;if(Array.isArray(O)){for(let q=0;q<O.length;++q){const v=d.source==="terms"&&d.name==="keys"&&O[q].key,L=_.scan(O[q],d,f,[q,...h],v);L!==void 0&&(A=A||O.slice(),A[q]=L)}return A}if(f.schema!==!1&&g.isSchema(O)||f.ref!==!1&&y.isRef(O)){const q=f.each(O,{...d,path:h,key:s});return q===O?void 0:q}for(const q in O){if(q[0]==="_")continue;const v=_.scan(O[q],d,f,[q,...h],s);v!==void 0&&(A=A||Object.assign({},O),A[q]=v)}return A}},6133:(p,c,l)=>{const{assert:M,clone:g,reach:y}=l(8870),_=l(8160);let O;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};c.create=function(f,z={}){M(typeof f=="string","Invalid reference key:",f),_.assertOptions(z,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),M(!z.prefix||typeof z.prefix=="object","options.prefix must be of type object");const s=Object.assign({},d.defaults,z);delete s.prefix;const h=s.separator,A=d.context(f,h,z.prefix);if(s.type=A.type,f=A.key,s.type==="value")if(A.root&&(M(!h||f[0]!==h,"Cannot specify relative path with root prefix"),s.ancestor="root",f||(f=null)),h&&h===f)f=null,s.ancestor=0;else if(s.ancestor!==void 0)M(!h||!f||f[0]!==h,"Cannot combine prefix with ancestor option");else{const[q,v]=d.ancestor(f,h);v&&(f=f.slice(v))===""&&(f=null),s.ancestor=q}return s.path=h?f===null?[]:f.split(h):[f],new d.Ref(s)},c.in=function(f,z={}){return c.create(f,{...z,in:!0})},c.isRef=function(f){return!!f&&!!f[_.symbols.ref]},d.Ref=class{constructor(f){M(typeof f=="object","Invalid reference construction"),_.assertOptions(f,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),M([!1,void 0].includes(f.separator)||typeof f.separator=="string"&&f.separator.length===1,"Invalid separator"),M(!f.adjust||typeof f.adjust=="function","options.adjust must be a function"),M(!f.map||Array.isArray(f.map),"options.map must be an array"),M(!f.map||!f.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,f),M(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(f,z,s,h,A={}){return M(!this.in||A.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(s.context,z,A):this.type==="local"?this._resolve(h,z,A):this.ancestor?this.ancestor==="root"?this._resolve(z.ancestors[z.ancestors.length-1],z,A):(M(this.ancestor<=z.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(z.ancestors[this.ancestor-1],z,A)):this._resolve(f,z,A)}_resolve(f,z,s){let h;if(this.type==="value"&&z.mainstay.shadow&&s.shadow!==!1&&(h=z.mainstay.shadow.get(this.absolute(z))),h===void 0&&(h=y(f,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(h=this.adjust(h)),this.map){const A=this.map.get(h);A!==void 0&&(h=A)}return z.mainstay&&z.mainstay.tracer.resolve(z,this,h),h}toString(){return this.display}absolute(f){return[...f.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const f={path:this.path};this.type!=="value"&&(f.type=this.type),this.separator!=="."&&(f.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(f.ancestor=this.ancestor),this.map&&(f.map=[...this.map]);for(const z of["adjust","iterables","render"])this[z]!==null&&this[z]!==void 0&&(f[z]=this[z]);return this.in!==!1&&(f.in=!0),{ref:f}}updateDisplay(){const f=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${f}`);if(!this.separator)return void(this.display=`ref:${f}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${f}`);if(this.ancestor==="root")return void(this.display=`ref:root:${f}`);if(this.ancestor===1)return void(this.display=`ref:${f||".."}`);const z=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${z}${f||""}`}},d.Ref.prototype[_.symbols.ref]=!0,c.build=function(f){return(f=Object.assign({},d.defaults,f)).type==="value"&&f.ancestor===void 0&&(f.ancestor=1),new d.Ref(f)},d.context=function(f,z,s={}){if(f=f.trim(),s){const h=s.global===void 0?"$":s.global;if(h!==z&&f.startsWith(h))return{key:f.slice(h.length),type:"global"};const A=s.local===void 0?"#":s.local;if(A!==z&&f.startsWith(A))return{key:f.slice(A.length),type:"local"};const q=s.root===void 0?"/":s.root;if(q!==z&&f.startsWith(q))return{key:f.slice(q.length),type:"value",root:!0}}return{key:f,type:"value"}},d.ancestor=function(f,z){if(!z)return[1,0];if(f[0]!==z)return[1,0];if(f[1]!==z)return[0,1];let s=2;for(;f[s]===z;)++s;return[s-1,s]},c.toSibling=0,c.toParent=1,c.Manager=class{constructor(){this.refs=[]}register(f,z){if(f)if(z=z===void 0?c.toParent:z,Array.isArray(f))for(const s of f)this.register(s,z);else if(_.isSchema(f))for(const s of f._refs.refs)s.ancestor-z>=0&&this.refs.push({ancestor:s.ancestor-z,root:s.root});else c.isRef(f)&&f.type==="value"&&f.ancestor-z>=0&&this.refs.push({ancestor:f.ancestor-z,root:f.root}),O=O||l(3328),O.isTemplate(f)&&this.register(f.refs(),z)}get length(){return this.refs.length}clone(){const f=new c.Manager;return f.refs=g(this.refs),f}reset(){this.refs=[]}roots(){return this.refs.filter(f=>!f.ancestor).map(f=>f.root)}}},3378:(p,c,l)=>{const M=l(5107),g={};g.wrap=M.string().min(1).max(2).allow(!1),c.preferences=M.object({allowUnknown:M.boolean(),abortEarly:M.boolean(),artifacts:M.boolean(),cache:M.boolean(),context:M.object(),convert:M.boolean(),dateFormat:M.valid("date","iso","string","time","utc"),debug:M.boolean(),errors:{escapeHtml:M.boolean(),label:M.valid("path","key",!1),language:[M.string(),M.object().ref()],render:M.boolean(),stack:M.boolean(),wrap:{label:g.wrap,array:g.wrap,string:g.wrap}},externals:M.boolean(),messages:M.object(),noDefaults:M.boolean(),nonEnumerables:M.boolean(),presence:M.valid("required","optional","forbidden"),skipFunctions:M.boolean(),stripUnknown:M.object({arrays:M.boolean(),objects:M.boolean()}).or("arrays","objects").allow(!0,!1),warnings:M.boolean()}).strict(),g.nameRx=/^[a-zA-Z0-9]\w*$/,g.rule=M.object({alias:M.array().items(M.string().pattern(g.nameRx)).single(),args:M.array().items(M.string(),M.object({name:M.string().pattern(g.nameRx).required(),ref:M.boolean(),assert:M.alternatives([M.function(),M.object().schema()]).conditional("ref",{is:!0,then:M.required()}),normalize:M.function(),message:M.string().when("assert",{is:M.function(),then:M.required()})})),convert:M.boolean(),manifest:M.boolean(),method:M.function().allow(!1),multi:M.boolean(),validate:M.function()}),c.extension=M.object({type:M.alternatives([M.string(),M.object().regex()]).required(),args:M.function(),cast:M.object().pattern(g.nameRx,M.object({from:M.function().maxArity(1).required(),to:M.function().minArity(1).maxArity(2).required()})),base:M.object().schema().when("type",{is:M.object().regex(),then:M.forbidden()}),coerce:[M.function().maxArity(3),M.object({method:M.function().maxArity(3).required(),from:M.array().items(M.string()).single()})],flags:M.object().pattern(g.nameRx,M.object({setter:M.string(),default:M.any()})),manifest:{build:M.function().arity(2)},messages:[M.object(),M.string()],modifiers:M.object().pattern(g.nameRx,M.function().minArity(1).maxArity(2)),overrides:M.object().pattern(g.nameRx,M.function()),prepare:M.function().maxArity(3),rebuild:M.function().arity(1),rules:M.object().pattern(g.nameRx,g.rule),terms:M.object().pattern(g.nameRx,M.object({init:M.array().allow(null).required(),manifest:M.object().pattern(/.+/,[M.valid("schema","single"),M.object({mapped:M.object({from:M.string().required(),to:M.string().required()}).required()})])})),validate:M.function().maxArity(3)}).strict(),c.extensions=M.array().items(M.object(),M.function().arity(1)).strict(),g.desc={buffer:M.object({buffer:M.string()}),func:M.object({function:M.function().required(),options:{literal:!0}}),override:M.object({override:!0}),ref:M.object({ref:M.object({type:M.valid("value","global","local"),path:M.array().required(),separator:M.string().length(1).allow(!1),ancestor:M.number().min(0).integer().allow("root"),map:M.array().items(M.array().length(2)).min(1),adjust:M.function(),iterables:M.boolean(),in:M.boolean(),render:M.boolean()}).required()}),regex:M.object({regex:M.string().min(3)}),special:M.object({special:M.valid("deep").required()}),template:M.object({template:M.string().required(),options:M.object()}),value:M.object({value:M.alternatives([M.object(),M.array()]).required()})},g.desc.entity=M.alternatives([M.array().items(M.link("...")),M.boolean(),M.function(),M.number(),M.string(),g.desc.buffer,g.desc.func,g.desc.ref,g.desc.regex,g.desc.special,g.desc.template,g.desc.value,M.link("/")]),g.desc.values=M.array().items(null,M.boolean(),M.function(),M.number().allow(1/0,-1/0),M.string().allow(""),M.symbol(),g.desc.buffer,g.desc.func,g.desc.override,g.desc.ref,g.desc.regex,g.desc.template,g.desc.value),g.desc.messages=M.object().pattern(/.+/,[M.string(),g.desc.template,M.object().pattern(/.+/,[M.string(),g.desc.template])]),c.description=M.object({type:M.string().required(),flags:M.object({cast:M.string(),default:M.any(),description:M.string(),empty:M.link("/"),failover:g.desc.entity,id:M.string(),label:M.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:M.boolean(),unit:M.string()}).unknown(),preferences:{allowUnknown:M.boolean(),abortEarly:M.boolean(),artifacts:M.boolean(),cache:M.boolean(),convert:M.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:M.boolean(),label:["path","key"],language:[M.string(),g.desc.ref],wrap:{label:g.wrap,array:g.wrap}},externals:M.boolean(),messages:g.desc.messages,noDefaults:M.boolean(),nonEnumerables:M.boolean(),presence:["required","optional","forbidden"],skipFunctions:M.boolean(),stripUnknown:M.object({arrays:M.boolean(),objects:M.boolean()}).or("arrays","objects").allow(!0,!1),warnings:M.boolean()},allow:g.desc.values,invalid:g.desc.values,rules:M.array().min(1).items({name:M.string().required(),args:M.object().min(1),keep:M.boolean(),message:[M.string(),g.desc.messages],warn:M.boolean()}),keys:M.object().pattern(/.*/,M.link("/")),link:g.desc.ref}).pattern(/^[a-z]\w*$/,M.any())},493:(p,c,l)=>{const{clone:M,reach:g}=l(8870),y=l(8160),_={value:Symbol("value")};p.exports=_.State=class{constructor(O,d,f){this.path=O,this.ancestors=d,this.mainstay=f.mainstay,this.schemas=f.schemas,this.debug=null}localize(O,d=null,f=null){const z=new _.State(O,d,this);return f&&z.schemas&&(z.schemas=[_.schemas(f),...z.schemas]),z}nest(O,d){const f=new _.State(this.path,this.ancestors,this);return f.schemas=f.schemas&&[_.schemas(O),...f.schemas],f.debug=d,f}shadow(O,d){this.mainstay.shadow=this.mainstay.shadow||new _.Shadow,this.mainstay.shadow.set(this.path,O,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=M(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},_.schemas=function(O){return y.isSchema(O)?{schema:O}:O},_.Shadow=class{constructor(){this._values=null}set(O,d,f){if(!O.length||f==="strip"&&typeof O[O.length-1]=="number")return;this._values=this._values||new Map;let z=this._values;for(let s=0;s<O.length;++s){const h=O[s];let A=z.get(h);A||(A=new Map,z.set(h,A)),z=A}z[_.value]=d}get(O){const d=this.node(O);if(d)return d[_.value]}node(O){if(this._values)return g(this._values,O,{iterables:!0})}override(O,d){if(!this._values)return;const f=O.slice(0,-1),z=O[O.length-1],s=g(this._values,f,{iterables:!0});d?s.set(z,d):s&&s.delete(z)}}},3328:(p,c,l)=>{const{assert:M,clone:g,escapeHtml:y}=l(8870),_=l(4964),O=l(8160),d=l(6354),f=l(6133),z={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};p.exports=z.Template=class{constructor(s,h){if(M(typeof s=="string","Template source must be a string"),M(!s.includes("\0")&&!s.includes(""),"Template source cannot contain reserved control characters"),this.source=s,this.rendered=s,this._template=null,h){const{functions:A,...q}=h;this._settings=Object.keys(q).length?g(q):void 0,this._functions=A,this._functions&&(M(Object.keys(this._functions).every(v=>typeof v=="string"),"Functions keys must be strings"),M(Object.values(this._functions).every(v=>typeof v=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const s=z.encode(this.source),h=z.split(s);let A=!1;const q=[],v=h.shift();v&&q.push(v);for(const L of h){const T=L[0]!=="{",w=T?"}":"}}",C=L.indexOf(w);if(C===-1||L[1]==="{"){q.push(`{${z.decode(L)}`);continue}let R=L.slice(T?0:1,C);const S=R[0]===":";S&&(R=R.slice(1));const E=this._ref(z.decode(R),{raw:T,wrapped:S});q.push(E),typeof E!="string"&&(A=!0);const G=L.slice(C+w.length);G&&q.push(z.decode(G))}A?this._template=q:this.rendered=q.join("")}static date(s,h){return z.dateFormat[h.dateFormat].call(s)}describe(s={}){if(!this._settings&&s.compact)return this.source;const h={template:this.source};return this._settings&&(h.options=this._settings),this._functions&&(h.functions=this._functions),h}static build(s){return new z.Template(s.template,s.options||s.functions?{...s.options,functions:s.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(s){return!!s&&!!s[O.symbols.template]}refs(){if(!this._template)return;const s=[];for(const h of this._template)typeof h!="string"&&s.push(...h.refs);return s}resolve(s,h,A,q){return this._template&&this._template.length===1?this._part(this._template[0],s,h,A,q,{}):this.render(s,h,A,q)}_part(s,...h){return s.ref?s.ref.resolve(...h):s.formula.evaluate(h)}render(s,h,A,q,v={}){if(!this.isDynamic())return this.rendered;const L=[];for(const T of this._template)if(typeof T=="string")L.push(T);else{const w=this._part(T,s,h,A,q,v),C=z.stringify(w,s,h,A,q,v);if(C!==void 0){const R=T.raw||(v.errors&&v.errors.escapeHtml)===!1?C:y(C);L.push(z.wrap(R,T.wrapped&&A.errors.wrap.label))}}return L.join("")}_ref(s,{raw:h,wrapped:A}){const q=[],v=T=>{const w=f.create(T,this._settings);return q.push(w),C=>{const R=w.resolve(...C);return R!==void 0?R:null}};try{const T=this._functions?{...z.functions,...this._functions}:z.functions;var L=new _.Parser(s,{reference:v,functions:T,constants:z.constants})}catch(T){throw T.message=`Invalid template variable "${s}" fails due to: ${T.message}`,T}if(L.single){if(L.single.type==="reference"){const T=q[0];return{ref:T,raw:h,refs:q,wrapped:A||T.type==="local"&&T.key==="label"}}return z.stringify(L.single.value)}return{formula:L,raw:h,refs:q}}toString(){return this.source}},z.Template.prototype[O.symbols.template]=!0,z.Template.prototype.isImmutable=!0,z.encode=function(s){return s.replace(/\\(\{+)/g,(h,A)=>z.opens.slice(0,A.length)).replace(/\\(\}+)/g,(h,A)=>z.closes.slice(0,A.length))},z.decode=function(s){return s.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},z.split=function(s){const h=[];let A="";for(let q=0;q<s.length;++q){const v=s[q];if(v==="{"){let L="";for(;q+1<s.length&&s[q+1]==="{";)L+="{",++q;h.push(A),A=L}else A+=v}return h.push(A),h},z.wrap=function(s,h){return h?h.length===1?`${h}${s}${h}`:`${h[0]}${s}${h[1]}`:s},z.stringify=function(s,h,A,q,v,L={}){const T=typeof s,w=q&&q.errors&&q.errors.wrap||{};let C=!1;if(f.isRef(s)&&s.render&&(C=s.in,s=s.resolve(h,A,q,v,{in:s.in,...L})),s===null)return"null";if(T==="string")return z.wrap(s,L.arrayItems&&w.string);if(T==="number"||T==="function"||T==="symbol")return s.toString();if(T!=="object")return JSON.stringify(s);if(s instanceof Date)return z.Template.date(s,q);if(s instanceof Map){const S=[];for(const[E,G]of s.entries())S.push(`${E.toString()} -> ${G.toString()}`);s=S}if(!Array.isArray(s))return s.toString();const R=[];for(const S of s)R.push(z.stringify(S,h,A,q,v,{arrayItems:!0,...L}));return z.wrap(R.join(", "),!C&&w.array)},z.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},z.functions={if:(s,h,A)=>s?h:A,length:s=>typeof s=="string"?s.length:s&&typeof s=="object"?Array.isArray(s)?s.length:Object.keys(s).length:null,msg(s){const[h,A,q,v,L]=this,T=L.messages;if(!T)return"";const w=d.template(h,T[0],s,A,q)||d.template(h,T[1],s,A,q);return w?w.render(h,A,q,v,L):""},number:s=>typeof s=="number"?s:typeof s=="string"?parseFloat(s):typeof s=="boolean"?s?1:0:s instanceof Date?s.getTime():null}},2305:(p,c,l)=>{const{deepEqual:M}=l(8870),g=l(7593),y=l(6354),_={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};c.setup=function(O){const d=function(){return O._tracer=O._tracer||new _.Tracer,O._tracer};O.trace=d,O[Symbol.for("@hapi/lab/coverage/initialize")]=d,O.untrace=()=>{O._tracer=null}},c.location=function(O){return O.$_setFlag("_tracerLocation",g.location(2))},_.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(O){const d=this._schemas.get(O);if(d)return d.store;const f=new _.Store(O),{filename:z,line:s}=O._flags._tracerLocation||g.location(5);return this._schemas.set(O,{filename:z,line:s,store:f}),f}_combine(O,d){for(const{store:f}of this._schemas.values())f._combine(O,d)}report(O){const d=[];for(const{filename:f,line:z,store:s}of this._schemas.values()){if(O&&O!==f)continue;const h=[],A=[];for(const[q,v]of s._sources.entries()){if(_.sub(v.paths,A))continue;if(!v.entry){h.push({status:"never reached",paths:[...v.paths]}),A.push(...v.paths);continue}for(const T of["valid","invalid"]){const w=q[`_${T}s`];if(!w)continue;const C=new Set(w._values),R=new Set(w._refs);for(const{value:S,ref:E}of v[T])C.delete(S),R.delete(E);(C.size||R.size)&&h.push({status:[...C,...[...R].map(S=>S.display)],rule:`${T}s`})}const L=q._rules.map(T=>T.name);for(const T of["default","failover"])q._flags[T]!==void 0&&L.push(T);for(const T of L){const w=_.labels[v.rule[T]||0];if(w){const C={rule:T,status:w};v.paths.size&&(C.paths=[...v.paths]),h.push(C)}}}h.length&&d.push({filename:f,line:z,missing:h,severity:"error",message:`Schema missing tests for ${h.map(_.message).join(", ")}`})}return d.length?d:null}},_.Store=class{constructor(O){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(O)}debug(O,d,f,z){O.mainstay.debug&&O.mainstay.debug.push({type:d,name:f,result:z,path:O.path})}entry(O,d){_.debug(d,{type:"entry"}),this._record(O,f=>{f.entry=!0})}filter(O,d,f,z){_.debug(d,{type:f,...z}),this._record(O,s=>{s[f].add(z)})}log(O,d,f,z,s){_.debug(d,{type:f,name:z,result:s==="full"?"pass":s}),this._record(O,h=>{h[f][z]=h[f][z]||0,h[f][z]|=_.codes[s]})}resolve(O,d,f){if(!O.mainstay.debug)return;const z={type:"resolve",ref:d.display,to:f,path:O.path};O.mainstay.debug.push(z)}value(O,d,f,z,s){if(!O.mainstay.debug||M(f,z))return;const h={type:"value",by:d,from:f,to:z,path:O.path};s&&(h.name=s),O.mainstay.debug.push(h)}_record(O,d){const f=this._sources.get(O);if(f)return void d(f);const z=this._combos.get(O);for(const s of z)this._record(s,d)}_scan(O,d){const f=d||[];let z=this._sources.get(O);z||(z={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(O,z)),f.length&&z.paths.add(f),O.$_modify({each:(s,h)=>{const A=_.id(s,h);this._scan(s,f.concat(A))},ref:!1})}_combine(O,d){this._combos.set(O,d)}},_.message=function(O){return`${O.paths?y.path(O.paths[0])+(O.rule?":":""):""}${O.rule||""} (${O.status})`},_.id=function(O,{source:d,name:f,path:z,key:s}){return O._flags.id?O._flags.id:s||(f=`@${f}`,d==="terms"?[f,z[Math.min(z.length-1,1)]]:f)},_.sub=function(O,d){for(const f of O)for(const z of d)if(M(f.slice(0,z.length),z))return!0;return!1},_.debug=function(O,d){O.mainstay.debug&&(d.path=O.debug?[...O.path,O.debug]:O.path,O.mainstay.debug.push(d))}},4946:(p,c,l)=>{const{assert:M,merge:g}=l(8870),y=l(8068),_=l(8160),O=l(3292),d=l(6354),f=l(6133),z={};p.exports=y.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:f.toSibling}},args:(s,...h)=>h.length===1&&Array.isArray(h[0])?s.try(...h[0]):s.try(...h),validate(s,h){const{schema:A,error:q,state:v,prefs:L}=h;if(A._flags.match){const w=[],C=[];for(let S=0;S<A.$_terms.matches.length;++S){const E=A.$_terms.matches[S],G=v.nest(E.schema,`match.${S}`);G.snapshot();const s0=E.schema.$_validate(s,G,L);s0.errors?(C.push(s0.errors),G.restore()):(w.push(s0.value),G.commit())}if(w.length===0)return{errors:q("alternatives.any",{details:C.map(S=>d.details(S,{override:!1}))})};if(A._flags.match==="one")return w.length===1?{value:w[0]}:{errors:q("alternatives.one")};if(w.length!==A.$_terms.matches.length)return{errors:q("alternatives.all",{details:C.map(S=>d.details(S,{override:!1}))})};const R=S=>S.$_terms.matches.some(E=>E.schema.type==="object"||E.schema.type==="alternatives"&&R(E.schema));return R(A)?{value:w.reduce((S,E)=>g(S,E,{mergeArrays:!1}))}:{value:w[w.length-1]}}const T=[];for(let w=0;w<A.$_terms.matches.length;++w){const C=A.$_terms.matches[w];if(C.schema){const E=v.nest(C.schema,`match.${w}`);E.snapshot();const G=C.schema.$_validate(s,E,L);if(!G.errors)return E.commit(),G;E.restore(),T.push({schema:C.schema,reports:G.errors});continue}const R=C.ref?C.ref.resolve(s,v,L):s,S=C.is?[C]:C.switch;for(let E=0;E<S.length;++E){const G=S[E],{is:s0,then:b0,otherwise:V}=G,Z=`match.${w}${C.switch?"."+E:""}`;if(s0.$_match(R,v.nest(s0,`${Z}.is`),L)){if(b0)return b0.$_validate(s,v.nest(b0,`${Z}.then`),L)}else if(V)return V.$_validate(s,v.nest(V,`${Z}.otherwise`),L)}}return z.errors(T,h)},rules:{conditional:{method(s,h){M(!this._flags._endedSwitch,"Unreachable condition"),M(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),M(h.break===void 0,"Cannot use break option with alternatives conditional");const A=this.clone(),q=O.when(A,s,h),v=q.is?[q]:q.switch;for(const L of v)if(L.then&&L.otherwise){A.$_setFlag("_endedSwitch",!0,{clone:!1});break}return A.$_terms.matches.push(q),A.$_mutateRebuild()}},match:{method(s){if(M(["any","one","all"].includes(s),"Invalid alternatives match mode",s),s!=="any")for(const h of this.$_terms.matches)M(h.schema,"Cannot combine match mode",s,"with conditional rules");return this.$_setFlag("match",s)}},try:{method(...s){M(s.length,"Missing alternative schemas"),_.verifyFlat(s,"try"),M(!this._flags._endedSwitch,"Unreachable condition");const h=this.clone();for(const A of s)h.$_terms.matches.push({schema:h.$_compile(A)});return h.$_mutateRebuild()}}},overrides:{label(s){return this.$_parent("label",s).$_modify({each:(h,A)=>A.path[0]!=="is"?h.label(s):void 0,ref:!1})}},rebuild(s){s.$_modify({each:h=>{_.isSchema(h)&&h.type==="array"&&s.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(s,h){if(h.matches)for(const A of h.matches){const{schema:q,ref:v,is:L,not:T,then:w,otherwise:C}=A;s=q?s.try(q):v?s.conditional(v,{is:L,then:w,not:T,otherwise:C,switch:A.switch}):s.conditional(L,{then:w,otherwise:C})}return s}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),z.errors=function(s,{error:h,state:A}){if(!s.length)return{errors:h("alternatives.any")};if(s.length===1)return{errors:s[0].reports};const q=new Set,v=[];for(const{reports:L,schema:T}of s){if(L.length>1)return z.unmatched(s,h);const w=L[0];if(w instanceof d.Report==0)return z.unmatched(s,h);if(w.state.path.length!==A.path.length){v.push({type:T.type,report:w});continue}if(w.code==="any.only"){for(const S of w.local.valids)q.add(S);continue}const[C,R]=w.code.split(".");R==="base"?q.add(C):v.push({type:T.type,report:w})}return v.length?v.length===1?{errors:v[0].report}:z.unmatched(s,h):{errors:h("alternatives.types",{types:[...q]})}},z.unmatched=function(s,h){const A=[];for(const q of s)A.push(...q.reports);return{errors:h("alternatives.match",d.details(A,{override:!1}))}}},8068:(p,c,l)=>{const{assert:M}=l(8870),g=l(7629),y=l(8160),_=l(6914);p.exports=g.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(O,d){return M(typeof O=="function","Method must be a function"),M(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:O,description:d}})},validate(O,d,{method:f}){try{return f(O,d)}catch(z){return d.error("any.custom",{error:z})}},args:["method","description"],multi:!0},messages:{method(O){return this.prefs({messages:O})}},shared:{method(O){M(y.isSchema(O)&&O._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(O),d.$_mutateRegister(O),d}},warning:{method(O,d){return M(O&&typeof O=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:O,local:d},warn:!0})},validate:(O,d,{code:f,local:z})=>d.error(f,z),args:["code","local"],multi:!0}},modifiers:{keep(O,d=!0){O.keep=d},message(O,d){O.message=_.compile(d)},warn(O,d=!0){O.warn=d}},manifest:{build(O,d){for(const f in d){const z=d[f];if(["examples","externals","metas","notes","tags"].includes(f))for(const s of z)O=O[f.slice(0,-1)](s);else if(f!=="alterations")if(f!=="whens"){if(f==="shared")for(const s of z)O=O.shared(s)}else for(const s of z){const{ref:h,is:A,not:q,then:v,otherwise:L,concat:T}=s;O=T?O.concat(T):h?O.when(h,{is:A,not:q,then:v,otherwise:L,switch:s.switch,break:s.break}):O.when(A,{then:v,otherwise:L,break:s.break})}else{const s={};for(const{target:h,adjuster:A}of z)s[h]=A;O=O.alter(s)}}return O}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(p,c,l)=>{const{assert:M,deepEqual:g,reach:y}=l(8870),_=l(8068),O=l(8160),d=l(3292),f={};p.exports=_.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(z,{schema:s,state:h,prefs:A}){if(!Array.isArray(z))return;const q=s.$_getRule("sort");return q?f.sort(s,z,q.args.options,h,A):void 0}},validate(z,{schema:s,error:h}){if(!Array.isArray(z)){if(s._flags.single){const A=[z];return A[O.symbols.arraySingle]=!0,{value:A}}return{errors:h("array.base")}}if(s.$_getRule("items")||s.$_terms.externals)return{value:z.slice()}},rules:{has:{method(z){z=this.$_compile(z,{appendPath:!0});const s=this.$_addRule({name:"has",args:{schema:z}});return s.$_mutateRegister(z),s},validate(z,{state:s,prefs:h,error:A},{schema:q}){const v=[z,...s.ancestors];for(let T=0;T<z.length;++T){const w=s.localize([...s.path,T],v,q);if(q.$_match(z[T],w,h))return z}const L=q._flags.label;return L?A("array.hasKnown",{patternLabel:L}):A("array.hasUnknown",null)},multi:!0},items:{method(...z){O.verifyFlat(z,"items");const s=this.$_addRule("items");for(let h=0;h<z.length;++h){const A=O.tryWithPath(()=>this.$_compile(z[h]),h,{append:!0});s.$_terms.items.push(A)}return s.$_mutateRebuild()},validate(z,{schema:s,error:h,state:A,prefs:q,errorsArray:v}){const L=s.$_terms._requireds.slice(),T=s.$_terms.ordered.slice(),w=[...s.$_terms._inclusions,...L],C=!z[O.symbols.arraySingle];delete z[O.symbols.arraySingle];const R=v();let S=z.length;for(let E=0;E<S;++E){const G=z[E];let s0=!1,b0=!1;const V=C?E:new Number(E),Z=[...A.path,V];if(!s._flags.sparse&&G===void 0){if(R.push(h("array.sparse",{key:V,path:Z,pos:E,value:void 0},A.localize(Z))),q.abortEarly)return R;T.shift();continue}const d0=[z,...A.ancestors];for(const G0 of s.$_terms._exclusions)if(G0.$_match(G,A.localize(Z,d0,G0),q,{presence:"ignore"})){if(R.push(h("array.excludes",{pos:E,value:G},A.localize(Z))),q.abortEarly)return R;s0=!0,T.shift();break}if(s0)continue;if(s.$_terms.ordered.length){if(T.length){const G0=T.shift(),v1=G0.$_validate(G,A.localize(Z,d0,G0),q);if(v1.errors){if(R.push(...v1.errors),q.abortEarly)return R}else if(G0._flags.result==="strip")f.fastSplice(z,E),--E,--S;else{if(!s._flags.sparse&&v1.value===void 0){if(R.push(h("array.sparse",{key:V,path:Z,pos:E,value:void 0},A.localize(Z))),q.abortEarly)return R;continue}z[E]=v1.value}continue}if(!s.$_terms.items.length){if(R.push(h("array.orderedLength",{pos:E,limit:s.$_terms.ordered.length})),q.abortEarly)return R;break}}const v0=[];let E0=L.length;for(let G0=0;G0<E0;++G0){const v1=A.localize(Z,d0,L[G0]);v1.snapshot();const h1=L[G0].$_validate(G,v1,q);if(v0[G0]=h1,!h1.errors){if(v1.commit(),z[E]=h1.value,b0=!0,f.fastSplice(L,G0),--G0,--E0,!s._flags.sparse&&h1.value===void 0&&(R.push(h("array.sparse",{key:V,path:Z,pos:E,value:void 0},A.localize(Z))),q.abortEarly))return R;break}v1.restore()}if(b0)continue;const S0=q.stripUnknown&&!!q.stripUnknown.arrays||!1;E0=w.length;for(const G0 of w){let v1;const h1=L.indexOf(G0);if(h1!==-1)v1=v0[h1];else{const Y1=A.localize(Z,d0,G0);if(Y1.snapshot(),v1=G0.$_validate(G,Y1,q),!v1.errors){Y1.commit(),G0._flags.result==="strip"?(f.fastSplice(z,E),--E,--S):s._flags.sparse||v1.value!==void 0?z[E]=v1.value:(R.push(h("array.sparse",{key:V,path:Z,pos:E,value:void 0},A.localize(Z))),s0=!0),b0=!0;break}Y1.restore()}if(E0===1){if(S0){f.fastSplice(z,E),--E,--S,b0=!0;break}if(R.push(...v1.errors),q.abortEarly)return R;s0=!0;break}}if(!s0&&(s.$_terms._inclusions.length||s.$_terms._requireds.length)&&!b0){if(S0){f.fastSplice(z,E),--E,--S;continue}if(R.push(h("array.includes",{pos:E,value:G},A.localize(Z))),q.abortEarly)return R}}return L.length&&f.fillMissedErrors(s,R,L,z,A,q),T.length&&(f.fillOrderedErrors(s,R,T,z,A,q),R.length||f.fillDefault(T,z,A,q)),R.length?R:z},priority:!0,manifest:!1},length:{method(z){return this.$_addRule({name:"length",args:{limit:z},operator:"="})},validate:(z,s,{limit:h},{name:A,operator:q,args:v})=>O.compare(z.length,h,q)?z:s.error("array."+A,{limit:v.limit,value:z}),args:[{name:"limit",ref:!0,assert:O.limit,message:"must be a positive integer"}]},max:{method(z){return this.$_addRule({name:"max",method:"length",args:{limit:z},operator:"<="})}},min:{method(z){return this.$_addRule({name:"min",method:"length",args:{limit:z},operator:">="})}},ordered:{method(...z){O.verifyFlat(z,"ordered");const s=this.$_addRule("items");for(let h=0;h<z.length;++h){const A=O.tryWithPath(()=>this.$_compile(z[h]),h,{append:!0});f.validateSingle(A,s),s.$_mutateRegister(A),s.$_terms.ordered.push(A)}return s.$_mutateRebuild()}},single:{method(z){const s=z===void 0||!!z;return M(!s||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",s)}},sort:{method(z={}){O.assertOptions(z,["by","order"]);const s={order:z.order||"ascending"};return z.by&&(s.by=d.ref(z.by,{ancestor:0}),M(!s.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:s}})},validate(z,{error:s,state:h,prefs:A,schema:q},{options:v}){const{value:L,errors:T}=f.sort(q,z,v,h,A);if(T)return T;for(let w=0;w<z.length;++w)if(z[w]!==L[w])return s("array.sort",{order:v.order,by:v.by?v.by.key:"value"});return z},convert:!0},sparse:{method(z){const s=z===void 0||!!z;return this._flags.sparse===s?this:(s?this.clone():this.$_addRule("items")).$_setFlag("sparse",s,{clone:!1})}},unique:{method(z,s={}){M(!z||typeof z=="function"||typeof z=="string","comparator must be a function or a string"),O.assertOptions(s,["ignoreUndefined","separator"]);const h={name:"unique",args:{options:s,comparator:z}};if(z)if(typeof z=="string"){const A=O.default(s.separator,".");h.path=A?z.split(A):[z]}else h.comparator=z;return this.$_addRule(h)},validate(z,{state:s,error:h,schema:A},{comparator:q,options:v},{comparator:L,path:T}){const w={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},C=L||g,R=v.ignoreUndefined;for(let S=0;S<z.length;++S){const E=T?y(z[S],T):z[S],G=L?w.custom:w[typeof E];if(M(G,"Failed to find unique map container for type",typeof E),G instanceof Map){const s0=G.entries();let b0;for(;!(b0=s0.next()).done;)if(C(b0.value[0],E)){const V=s.localize([...s.path,S],[z,...s.ancestors]),Z={pos:S,value:z[S],dupePos:b0.value[1],dupeValue:z[b0.value[1]]};return T&&(Z.path=q),h("array.unique",Z,V)}G.set(E,S)}else{if((!R||E!==void 0)&&G[E]!==void 0){const s0={pos:S,value:z[S],dupePos:G[E],dupeValue:z[G[E]]};return T&&(s0.path=q),h("array.unique",s0,s.localize([...s.path,S],[z,...s.ancestors]))}G[E]=S}}return z},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(z,s)=>new Set(z)}},rebuild(z){z.$_terms._inclusions=[],z.$_terms._exclusions=[],z.$_terms._requireds=[];for(const s of z.$_terms.items)f.validateSingle(s,z),s._flags.presence==="required"?z.$_terms._requireds.push(s):s._flags.presence==="forbidden"?z.$_terms._exclusions.push(s):z.$_terms._inclusions.push(s);for(const s of z.$_terms.ordered)f.validateSingle(s,z)},manifest:{build:(z,s)=>(s.items&&(z=z.items(...s.items)),s.ordered&&(z=z.ordered(...s.ordered)),z)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),f.fillMissedErrors=function(z,s,h,A,q,v){const L=[];let T=0;for(const w of h){const C=w._flags.label;C?L.push(C):++T}L.length?T?s.push(z.$_createError("array.includesRequiredBoth",A,{knownMisses:L,unknownMisses:T},q,v)):s.push(z.$_createError("array.includesRequiredKnowns",A,{knownMisses:L},q,v)):s.push(z.$_createError("array.includesRequiredUnknowns",A,{unknownMisses:T},q,v))},f.fillOrderedErrors=function(z,s,h,A,q,v){const L=[];for(const T of h)T._flags.presence==="required"&&L.push(T);L.length&&f.fillMissedErrors(z,s,L,A,q,v)},f.fillDefault=function(z,s,h,A){const q=[];let v=!0;for(let L=z.length-1;L>=0;--L){const T=z[L],w=[s,...h.ancestors],C=T.$_validate(void 0,h.localize(h.path,w,T),A).value;if(v){if(C===void 0)continue;v=!1}q.unshift(C)}q.length&&s.push(...q)},f.fastSplice=function(z,s){let h=s;for(;h<z.length;)z[h++]=z[h];--z.length},f.validateSingle=function(z,s){(z.type==="array"||z._flags._arrayItems)&&(M(!s._flags.single,"Cannot specify array item with single rule enabled"),s.$_setFlag("_arrayItems",!0,{clone:!1}))},f.sort=function(z,s,h,A,q){const v=h.order==="ascending"?1:-1,L=-1*v,T=v,w=(C,R)=>{let S=f.compare(C,R,L,T);if(S!==null||(h.by&&(C=h.by.resolve(C,A,q),R=h.by.resolve(R,A,q)),S=f.compare(C,R,L,T),S!==null))return S;const E=typeof C;if(E!==typeof R)throw z.$_createError("array.sort.mismatching",s,null,A,q);if(E!=="number"&&E!=="string")throw z.$_createError("array.sort.unsupported",s,{type:E},A,q);return E==="number"?(C-R)*v:C<R?L:T};try{return{value:s.slice().sort(w)}}catch(C){return{errors:C}}},f.compare=function(z,s,h,A){return z===s?0:z===void 0?1:s===void 0?-1:z===null?A:s===null?h:null}},4937:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y=l(8160),_=l(2036),O={isBool:function(d){return typeof d=="boolean"}};p.exports=g.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:f}){if(typeof d!="boolean"){if(typeof d=="string"){const z=f._flags.sensitive?d:d.toLowerCase();d=z==="true"||z!=="false"&&d}return typeof d!="boolean"&&(d=f.$_terms.truthy&&f.$_terms.truthy.has(d,null,null,!f._flags.sensitive)||(!f.$_terms.falsy||!f.$_terms.falsy.has(d,null,null,!f._flags.sensitive))&&d),{value:d}}},validate(d,{error:f}){if(typeof d!="boolean")return{value:d,errors:f("boolean.base")}},rules:{truthy:{method(...d){y.verifyFlat(d,"truthy");const f=this.clone();f.$_terms.truthy=f.$_terms.truthy||new _;for(let z=0;z<d.length;++z){const s=d[z];M(s!==void 0,"Cannot call truthy with undefined"),f.$_terms.truthy.add(s)}return f}},falsy:{method(...d){y.verifyFlat(d,"falsy");const f=this.clone();f.$_terms.falsy=f.$_terms.falsy||new _;for(let z=0;z<d.length;++z){const s=d[z];M(s!==void 0,"Cannot call falsy with undefined"),f.$_terms.falsy.add(s)}return f}},sensitive:{method(d=!0){return this.$_setFlag("sensitive",d)}}},cast:{number:{from:O.isBool,to:(d,f)=>d?1:0},string:{from:O.isBool,to:(d,f)=>d?"true":"false"}},manifest:{build:(d,f)=>(f.truthy&&(d=d.truthy(...f.truthy)),f.falsy&&(d=d.falsy(...f.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y=l(8160),_=l(3328),O={isDate:function(d){return d instanceof Date}};p.exports=g.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:f})=>({value:O.parse(d,f._flags.format)||d})},validate(d,{schema:f,error:z,prefs:s}){if(d instanceof Date&&!isNaN(d.getTime()))return;const h=f._flags.format;return s.convert&&h&&typeof d=="string"?{value:d,errors:z("date.format",{format:h})}:{value:d,errors:z("date.base")}},rules:{compare:{method:!1,validate(d,f,{date:z},{name:s,operator:h,args:A}){const q=z==="now"?Date.now():z.getTime();return y.compare(d.getTime(),q,h)?d:f.error("date."+s,{limit:A.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:O.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return M(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return M(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:O.isDate,to:(d,f)=>d.getTime()},string:{from:O.isDate,to:(d,{prefs:f})=>_.date(d,f)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),O.parse=function(d,f){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(f==="iso")return y.isIsoDate(d)?O.date(d.toString()):null;const z=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),f){if(f==="javascript")return O.date(1*d);if(f==="unix")return O.date(1e3*d);if(typeof z=="string")return null}return O.date(d)},O.date=function(d){const f=new Date(d);return isNaN(f.getTime())?null:f}},390:(p,c,l)=>{const{assert:M}=l(8870),g=l(7824);p.exports=g.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(y){return M(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:y}})},validate:(y,_,{n:O})=>y.length===O?y:_.error("function.arity",{n:O})},class:{method(){return this.$_addRule("class")},validate:(y,_)=>/^\s*class\s/.test(y.toString())?y:_.error("function.class",{value:y})},minArity:{method(y){return M(Number.isSafeInteger(y)&&y>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:y}})},validate:(y,_,{n:O})=>y.length>=O?y:_.error("function.minArity",{n:O})},maxArity:{method(y){return M(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:y}})},validate:(y,_,{n:O})=>y.length<=O?y:_.error("function.maxArity",{n:O})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(p,c,l)=>{const{applyToDefaults:M,assert:g,clone:y}=l(8870),_=l(3652),O=l(8068),d=l(8160),f=l(3292),z=l(6354),s=l(6133),h=l(3328),A={renameDefaults:{alias:!1,multiple:!1,override:!1}};p.exports=O.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(q,v)=>q.keys(v),validate(q,{schema:v,error:L,state:T,prefs:w}){if(!q||typeof q!==v.$_property("typeof")||Array.isArray(q))return{value:q,errors:L("object.base",{type:v.$_property("typeof")})};if(!(v.$_terms.renames||v.$_terms.dependencies||v.$_terms.keys||v.$_terms.patterns||v.$_terms.externals))return;q=A.clone(q,w);const C=[];if(v.$_terms.renames&&!A.rename(v,q,T,w,C))return{value:q,errors:C};if(!v.$_terms.keys&&!v.$_terms.patterns&&!v.$_terms.dependencies)return{value:q,errors:C};const R=new Set(Object.keys(q));if(v.$_terms.keys){const S=[q,...T.ancestors];for(const E of v.$_terms.keys){const G=E.key,s0=q[G];R.delete(G);const b0=T.localize([...T.path,G],S,E),V=E.schema.$_validate(s0,b0,w);if(V.errors){if(w.abortEarly)return{value:q,errors:V.errors};V.value!==void 0&&(q[G]=V.value),C.push(...V.errors)}else E.schema._flags.result==="strip"||V.value===void 0&&s0!==void 0?delete q[G]:V.value!==void 0&&(q[G]=V.value)}}if(R.size||v._flags._hasPatternMatch){const S=A.unknown(v,q,R,C,T,w);if(S)return S}if(v.$_terms.dependencies)for(const S of v.$_terms.dependencies){if(S.key!==null&&A.isPresent(S.options)(S.key.resolve(q,T,w,null,{shadow:!1}))===!1)continue;const E=A.dependencies[S.rel](v,S,q,T,w);if(E){const G=v.$_createError(E.code,q,E.context,T,w);if(w.abortEarly)return{value:q,errors:G};C.push(G)}}return{value:q,errors:C}},rules:{and:{method(...q){return d.verifyFlat(q,"and"),A.dependency(this,"and",null,q)}},append:{method(q){return q==null||Object.keys(q).length===0?this:this.keys(q)}},assert:{method(q,v,L){h.isTemplate(q)||(q=f.ref(q)),g(L===void 0||typeof L=="string","Message must be a string"),v=this.$_compile(v,{appendPath:!0});const T=this.$_addRule({name:"assert",args:{subject:q,schema:v,message:L}});return T.$_mutateRegister(q),T.$_mutateRegister(v),T},validate(q,{error:v,prefs:L,state:T},{subject:w,schema:C,message:R}){const S=w.resolve(q,T,L),E=s.isRef(w)?w.absolute(T):[];return C.$_match(S,T.localize(E,[q,...T.ancestors],C),L)?q:v("object.assert",{subject:w,message:R})},args:["subject","schema","message"],multi:!0},instance:{method(q,v){return g(typeof q=="function","constructor must be a function"),v=v||q.name,this.$_addRule({name:"instance",args:{constructor:q,name:v}})},validate:(q,v,{constructor:L,name:T})=>q instanceof L?q:v.error("object.instance",{type:T,value:q}),args:["constructor","name"]},keys:{method(q){g(q===void 0||typeof q=="object","Object schema must be a valid object"),g(!d.isSchema(q),"Object schema cannot be a joi schema");const v=this.clone();if(q)if(Object.keys(q).length){v.$_terms.keys=v.$_terms.keys?v.$_terms.keys.filter(L=>!q.hasOwnProperty(L.key)):new A.Keys;for(const L in q)d.tryWithPath(()=>v.$_terms.keys.push({key:L,schema:this.$_compile(q[L])}),L)}else v.$_terms.keys=new A.Keys;else v.$_terms.keys=null;return v.$_mutateRebuild()}},length:{method(q){return this.$_addRule({name:"length",args:{limit:q},operator:"="})},validate:(q,v,{limit:L},{name:T,operator:w,args:C})=>d.compare(Object.keys(q).length,L,w)?q:v.error("object."+T,{limit:C.limit,value:q}),args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"}]},max:{method(q){return this.$_addRule({name:"max",method:"length",args:{limit:q},operator:"<="})}},min:{method(q){return this.$_addRule({name:"min",method:"length",args:{limit:q},operator:">="})}},nand:{method(...q){return d.verifyFlat(q,"nand"),A.dependency(this,"nand",null,q)}},or:{method(...q){return d.verifyFlat(q,"or"),A.dependency(this,"or",null,q)}},oxor:{method(...q){return A.dependency(this,"oxor",null,q)}},pattern:{method(q,v,L={}){const T=q instanceof RegExp;T||(q=this.$_compile(q,{appendPath:!0})),g(v!==void 0,"Invalid rule"),d.assertOptions(L,["fallthrough","matches"]),T&&g(!q.flags.includes("g")&&!q.flags.includes("y"),"pattern should not use global or sticky mode"),v=this.$_compile(v,{appendPath:!0});const w=this.clone();w.$_terms.patterns=w.$_terms.patterns||[];const C={[T?"regex":"schema"]:q,rule:v};return L.matches&&(C.matches=this.$_compile(L.matches),C.matches.type!=="array"&&(C.matches=C.matches.$_root.array().items(C.matches)),w.$_mutateRegister(C.matches),w.$_setFlag("_hasPatternMatch",!0,{clone:!1})),L.fallthrough&&(C.fallthrough=!0),w.$_terms.patterns.push(C),w.$_mutateRegister(v),w}},ref:{method(){return this.$_addRule("ref")},validate:(q,v)=>s.isRef(q)?q:v.error("object.refType",{value:q})},regex:{method(){return this.$_addRule("regex")},validate:(q,v)=>q instanceof RegExp?q:v.error("object.regex",{value:q})},rename:{method(q,v,L={}){g(typeof q=="string"||q instanceof RegExp,"Rename missing the from argument"),g(typeof v=="string"||v instanceof h,"Invalid rename to argument"),g(v!==q,"Cannot rename key to same name:",q),d.assertOptions(L,["alias","ignoreUndefined","override","multiple"]);const T=this.clone();T.$_terms.renames=T.$_terms.renames||[];for(const w of T.$_terms.renames)g(w.from!==q,"Cannot rename the same key multiple times");return v instanceof h&&T.$_mutateRegister(v),T.$_terms.renames.push({from:q,to:v,options:M(A.renameDefaults,L)}),T}},schema:{method(q="any"){return this.$_addRule({name:"schema",args:{type:q}})},validate:(q,v,{type:L})=>!d.isSchema(q)||L!=="any"&&q.type!==L?v.error("object.schema",{type:L}):q},unknown:{method(q){return this.$_setFlag("unknown",q!==!1)}},with:{method(q,v,L={}){return A.dependency(this,"with",q,v,L)}},without:{method(q,v,L={}){return A.dependency(this,"without",q,v,L)}},xor:{method(...q){return d.verifyFlat(q,"xor"),A.dependency(this,"xor",null,q)}}},overrides:{default(q,v){return q===void 0&&(q=d.symbols.deepDefault),this.$_parent("default",q,v)}},rebuild(q){if(q.$_terms.keys){const v=new _.Sorter;for(const L of q.$_terms.keys)d.tryWithPath(()=>v.add(L,{after:L.schema.$_rootReferences(),group:L.key}),L.key);q.$_terms.keys=new A.Keys(...v.nodes)}},manifest:{build(q,v){if(v.keys&&(q=q.keys(v.keys)),v.dependencies)for(const{rel:L,key:T=null,peers:w,options:C}of v.dependencies)q=A.dependency(q,L,T,w,C);if(v.patterns)for(const{regex:L,schema:T,rule:w,fallthrough:C,matches:R}of v.patterns)q=q.pattern(L||T,w,{fallthrough:C,matches:R});if(v.renames)for(const{from:L,to:T,options:w}of v.renames)q=q.rename(L,T,w);return q}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),A.clone=function(q,v){if(typeof q=="object"){if(v.nonEnumerables)return y(q,{shallow:!0});const T=Object.create(Object.getPrototypeOf(q));return Object.assign(T,q),T}const L=function(...T){return q.apply(this,T)};return L.prototype=y(q.prototype),Object.defineProperty(L,"name",{value:q.name,writable:!1}),Object.defineProperty(L,"length",{value:q.length,writable:!1}),Object.assign(L,q),L},A.dependency=function(q,v,L,T,w){g(L===null||typeof L=="string",v,"key must be a strings"),w||(w=T.length>1&&typeof T[T.length-1]=="object"?T.pop():{}),d.assertOptions(w,["separator","isPresent"]),T=[].concat(T);const C=d.default(w.separator,"."),R=[];for(const E of T)g(typeof E=="string",v,"peers must be strings"),R.push(f.ref(E,{separator:C,ancestor:0,prefix:!1}));L!==null&&(L=f.ref(L,{separator:C,ancestor:0,prefix:!1}));const S=q.clone();return S.$_terms.dependencies=S.$_terms.dependencies||[],S.$_terms.dependencies.push(new A.Dependency(v,L,R,T,w)),S},A.dependencies={and(q,v,L,T,w){const C=[],R=[],S=v.peers.length,E=A.isPresent(v.options);for(const G of v.peers)E(G.resolve(L,T,w,null,{shadow:!1}))===!1?C.push(G.key):R.push(G.key);if(C.length!==S&&R.length!==S)return{code:"object.and",context:{present:R,presentWithLabels:A.keysToLabels(q,R),missing:C,missingWithLabels:A.keysToLabels(q,C)}}},nand(q,v,L,T,w){const C=[],R=A.isPresent(v.options);for(const G of v.peers)R(G.resolve(L,T,w,null,{shadow:!1}))&&C.push(G.key);if(C.length!==v.peers.length)return;const S=v.paths[0],E=v.paths.slice(1);return{code:"object.nand",context:{main:S,mainWithLabel:A.keysToLabels(q,S),peers:E,peersWithLabels:A.keysToLabels(q,E)}}},or(q,v,L,T,w){const C=A.isPresent(v.options);for(const R of v.peers)if(C(R.resolve(L,T,w,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:v.paths,peersWithLabels:A.keysToLabels(q,v.paths)}}},oxor(q,v,L,T,w){const C=[],R=A.isPresent(v.options);for(const E of v.peers)R(E.resolve(L,T,w,null,{shadow:!1}))&&C.push(E.key);if(!C.length||C.length===1)return;const S={peers:v.paths,peersWithLabels:A.keysToLabels(q,v.paths)};return S.present=C,S.presentWithLabels=A.keysToLabels(q,C),{code:"object.oxor",context:S}},with(q,v,L,T,w){const C=A.isPresent(v.options);for(const R of v.peers)if(C(R.resolve(L,T,w,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:v.key.key,mainWithLabel:A.keysToLabels(q,v.key.key),peer:R.key,peerWithLabel:A.keysToLabels(q,R.key)}}},without(q,v,L,T,w){const C=A.isPresent(v.options);for(const R of v.peers)if(C(R.resolve(L,T,w,null,{shadow:!1})))return{code:"object.without",context:{main:v.key.key,mainWithLabel:A.keysToLabels(q,v.key.key),peer:R.key,peerWithLabel:A.keysToLabels(q,R.key)}}},xor(q,v,L,T,w){const C=[],R=A.isPresent(v.options);for(const E of v.peers)R(E.resolve(L,T,w,null,{shadow:!1}))&&C.push(E.key);if(C.length===1)return;const S={peers:v.paths,peersWithLabels:A.keysToLabels(q,v.paths)};return C.length===0?{code:"object.missing",context:S}:(S.present=C,S.presentWithLabels=A.keysToLabels(q,C),{code:"object.xor",context:S})}},A.keysToLabels=function(q,v){return Array.isArray(v)?v.map(L=>q.$_mapLabels(L)):q.$_mapLabels(v)},A.isPresent=function(q){return typeof q.isPresent=="function"?q.isPresent:v=>v!==void 0},A.rename=function(q,v,L,T,w){const C={};for(const R of q.$_terms.renames){const S=[],E=typeof R.from!="string";if(E)for(const G in v){if(v[G]===void 0&&R.options.ignoreUndefined||G===R.to)continue;const s0=R.from.exec(G);s0&&S.push({from:G,to:R.to,match:s0})}else!Object.prototype.hasOwnProperty.call(v,R.from)||v[R.from]===void 0&&R.options.ignoreUndefined||S.push(R);for(const G of S){const s0=G.from;let b0=G.to;if(b0 instanceof h&&(b0=b0.render(v,L,T,G.match)),s0!==b0){if(!R.options.multiple&&C[b0]&&(w.push(q.$_createError("object.rename.multiple",v,{from:s0,to:b0,pattern:E},L,T)),T.abortEarly)||Object.prototype.hasOwnProperty.call(v,b0)&&!R.options.override&&!C[b0]&&(w.push(q.$_createError("object.rename.override",v,{from:s0,to:b0,pattern:E},L,T)),T.abortEarly))return!1;v[s0]===void 0?delete v[b0]:v[b0]=v[s0],C[b0]=!0,R.options.alias||delete v[s0]}}}return!0},A.unknown=function(q,v,L,T,w,C){if(q.$_terms.patterns){let R=!1;const S=q.$_terms.patterns.map(G=>{if(G.matches)return R=!0,[]}),E=[v,...w.ancestors];for(const G of L){const s0=v[G],b0=[...w.path,G];for(let V=0;V<q.$_terms.patterns.length;++V){const Z=q.$_terms.patterns[V];if(Z.regex){const E0=Z.regex.test(G);if(w.mainstay.tracer.debug(w,"rule",`pattern.${V}`,E0?"pass":"error"),!E0)continue}else if(!Z.schema.$_match(G,w.nest(Z.schema,`pattern.${V}`),C))continue;L.delete(G);const d0=w.localize(b0,E,{schema:Z.rule,key:G}),v0=Z.rule.$_validate(s0,d0,C);if(v0.errors){if(C.abortEarly)return{value:v,errors:v0.errors};T.push(...v0.errors)}if(Z.matches&&S[V].push(G),v[G]=v0.value,!Z.fallthrough)break}}if(R)for(let G=0;G<S.length;++G){const s0=S[G];if(!s0)continue;const b0=q.$_terms.patterns[G].matches,V=w.localize(w.path,E,b0),Z=b0.$_validate(s0,V,C);if(Z.errors){const d0=z.details(Z.errors,{override:!1});d0.matches=s0;const v0=q.$_createError("object.pattern.match",v,d0,w,C);if(C.abortEarly)return{value:v,errors:v0};T.push(v0)}}}if(L.size&&(q.$_terms.keys||q.$_terms.patterns)){if(C.stripUnknown&&!q._flags.unknown||C.skipFunctions){const R=!(!C.stripUnknown||C.stripUnknown!==!0&&!C.stripUnknown.objects);for(const S of L)R?(delete v[S],L.delete(S)):typeof v[S]=="function"&&L.delete(S)}if(!d.default(q._flags.unknown,C.allowUnknown))for(const R of L){const S=w.localize([...w.path,R],[]),E=q.$_createError("object.unknown",v[R],{child:R},S,C,{flags:!1});if(C.abortEarly)return{value:v,errors:E};T.push(E)}}},A.Dependency=class{constructor(q,v,L,T,w){this.rel=q,this.key=v,this.peers=L,this.paths=T,this.options=w}describe(){const q={rel:this.rel,peers:this.paths};return this.key!==null&&(q.key=this.key.key),this.peers[0].separator!=="."&&(q.options={...q.options,separator:this.peers[0].separator}),this.options.isPresent&&(q.options={...q.options,isPresent:this.options.isPresent}),q}},A.Keys=class extends Array{concat(q){const v=this.slice(),L=new Map;for(let T=0;T<v.length;++T)L.set(v[T].key,T);for(const T of q){const w=T.key,C=L.get(w);C!==void 0?v[C]={key:w,schema:v[C].schema.concat(T.schema)}:v.push(T)}return v}}},8785:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y=l(8160),_=l(3292),O=l(6354),d={};p.exports=g.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(f,z)=>f.ref(z),validate(f,{schema:z,state:s,prefs:h}){M(z.$_terms.link,"Uninitialized link schema");const A=d.generate(z,f,s,h),q=z.$_terms.link[0].ref;return A.$_validate(f,s.nest(A,`link:${q.display}:${A.type}`),h)},generate:(f,z,s,h)=>d.generate(f,z,s,h),rules:{ref:{method(f){M(!this.$_terms.link,"Cannot reinitialize schema"),f=_.ref(f),M(f.type==="value"||f.type==="local","Invalid reference type:",f.type),M(f.type==="local"||f.ancestor==="root"||f.ancestor>0,"Link cannot reference itself");const z=this.clone();return z.$_terms.link=[{ref:f}],z}},relative:{method(f=!0){return this.$_setFlag("relative",f)}}},overrides:{concat(f){M(this.$_terms.link,"Uninitialized link schema"),M(y.isSchema(f),"Invalid schema object"),M(f.type!=="link","Cannot merge type link with another link");const z=this.clone();return z.$_terms.whens||(z.$_terms.whens=[]),z.$_terms.whens.push({concat:f}),z.$_mutateRebuild()}},manifest:{build:(f,z)=>(M(z.link,"Invalid link description missing link"),f.ref(z.link))}}),d.generate=function(f,z,s,h){let A=s.mainstay.links.get(f);if(A)return A._generate(z,s,h).schema;const q=f.$_terms.link[0].ref,{perspective:v,path:L}=d.perspective(q,s);d.assert(v,"which is outside of schema boundaries",q,f,s,h);try{A=L.length?v.$_reach(L):v}catch{d.assert(!1,"to non-existing schema",q,f,s,h)}return d.assert(A.type!=="link","which is another link",q,f,s,h),f._flags.relative||s.mainstay.links.set(f,A),A._generate(z,s,h).schema},d.perspective=function(f,z){if(f.type==="local"){for(const{schema:s,key:h}of z.schemas){if((s._flags.id||h)===f.path[0])return{perspective:s,path:f.path.slice(1)};if(s.$_terms.shared){for(const A of s.$_terms.shared)if(A._flags.id===f.path[0])return{perspective:A,path:f.path.slice(1)}}}return{perspective:null,path:null}}return f.ancestor==="root"?{perspective:z.schemas[z.schemas.length-1].schema,path:f.path}:{perspective:z.schemas[f.ancestor]&&z.schemas[f.ancestor].schema,path:f.path}},d.assert=function(f,z,s,h,A,q){f||M(!1,`"${O.label(h._flags,A,q)}" contains link reference "${s.display}" ${z}`)}},3832:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y=l(8160),_={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/};p.exports=g.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(O,{schema:d,error:f}){if(!O.match(_.numberRx))return;O=O.trim();const z={value:parseFloat(O)};if(z.value===0&&(z.value=0),!d._flags.unsafe)if(O.match(/e/i)){if(_.extractSignificantDigits(O)!==_.extractSignificantDigits(String(z.value)))return z.errors=f("number.unsafe"),z}else{const s=z.value.toString();if(s.match(/e/i))return z;if(s!==_.normalizeDecimal(O))return z.errors=f("number.unsafe"),z}return z}},validate(O,{schema:d,error:f,prefs:z}){if(O===1/0||O===-1/0)return{value:O,errors:f("number.infinity")};if(!y.isNumber(O))return{value:O,errors:f("number.base")};const s={value:O};if(z.convert){const h=d.$_getRule("precision");if(h){const A=Math.pow(10,h.args.limit);s.value=Math.round(s.value*A)/A}}return s.value===0&&(s.value=0),!d._flags.unsafe&&(O>Number.MAX_SAFE_INTEGER||O<Number.MIN_SAFE_INTEGER)&&(s.errors=f("number.unsafe")),s},rules:{compare:{method:!1,validate:(O,d,{limit:f},{name:z,operator:s,args:h})=>y.compare(O,f,s)?O:d.error("number."+z,{limit:h.limit,value:O}),args:[{name:"limit",ref:!0,assert:y.isNumber,message:"must be a number"}]},greater:{method(O){return this.$_addRule({name:"greater",method:"compare",args:{limit:O},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(O,d)=>Math.trunc(O)-O==0?O:d.error("number.integer")},less:{method(O){return this.$_addRule({name:"less",method:"compare",args:{limit:O},operator:"<"})}},max:{method(O){return this.$_addRule({name:"max",method:"compare",args:{limit:O},operator:"<="})}},min:{method(O){return this.$_addRule({name:"min",method:"compare",args:{limit:O},operator:">="})}},multiple:{method(O){return this.$_addRule({name:"multiple",args:{base:O}})},validate:(O,d,{base:f},z)=>O*(1/f)%1==0?O:d.error("number.multiple",{multiple:z.args.base,value:O}),args:[{name:"base",ref:!0,assert:O=>typeof O=="number"&&isFinite(O)&&O>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(O,d)=>Number.isSafeInteger(O)&&O>=0&&O<=65535?O:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(O){return M(Number.isSafeInteger(O),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:O}})},validate(O,d,{limit:f}){const z=O.toString().match(_.precisionRx);return Math.max((z[1]?z[1].length:0)-(z[2]?parseInt(z[2],10):0),0)<=f?O:d.error("number.precision",{limit:f,value:O})},convert:!0},sign:{method(O){return M(["negative","positive"].includes(O),"Invalid sign",O),this.$_addRule({name:"sign",args:{sign:O}})},validate:(O,d,{sign:f})=>f==="negative"&&O<0||f==="positive"&&O>0?O:d.error(`number.${f}`)},unsafe:{method(O=!0){return M(typeof O=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",O)}}},cast:{string:{from:O=>typeof O=="number",to:(O,d)=>O.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),_.extractSignificantDigits=function(O){return O.replace(_.exponentialPartRegex,"").replace(_.dotRegex,"").replace(_.trailingZerosRegex,"").replace(_.leadingSignAndZerosRegex,"")},_.normalizeDecimal=function(O){return(O=O.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&O.endsWith("0")&&(O=O.replace(/0+$/,"")),O==="-0"?"0":O}},8966:(p,c,l)=>{const M=l(7824);p.exports=M.extend({type:"object",cast:{map:{from:g=>g&&typeof g=="object",to:(g,y)=>new Map(Object.entries(g))}}})},7417:(p,c,l)=>{const{assert:M,escapeRegex:g}=l(8870),{isDomainValid:y,isEmailValid:_,ipRegex:O,uriRegex:d}=l(4958),f=l(6264),z=l(8068),s=l(8160),h={tlds:f.tlds instanceof Set&&{tlds:{allow:f.tlds,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:/^[a-f0-9]+$/i,ipRegex:O({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};p.exports=z.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(A,{schema:q,state:v,prefs:L}){const T=q.$_getRule("normalize");T&&(A=A.normalize(T.args.form));const w=q.$_getRule("case");w&&(A=w.args.direction==="upper"?A.toLocaleUpperCase():A.toLocaleLowerCase());const C=q.$_getRule("trim");if(C&&C.args.enabled&&(A=A.trim()),q.$_terms.replacements)for(const S of q.$_terms.replacements)A=A.replace(S.pattern,S.replacement);const R=q.$_getRule("hex");if(R&&R.args.options.byteAligned&&A.length%2!=0&&(A=`0${A}`),q.$_getRule("isoDate")){const S=h.isoDate(A);S&&(A=S)}if(q._flags.truncate){const S=q.$_getRule("max");if(S){let E=S.args.limit;if(s.isResolvable(E)&&(E=E.resolve(A,v,L),!s.limit(E)))return{value:A,errors:q.$_createError("any.ref",E,{ref:S.args.limit,arg:"limit",reason:"must be a positive integer"},v,L)};A=A.slice(0,E)}}return{value:A}}},validate(A,{schema:q,error:v}){if(typeof A!="string")return{value:A,errors:v("string.base")};if(A===""){const L=q.$_getRule("min");return L&&L.args.limit===0?void 0:{value:A,errors:v("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(A,q)=>/^[a-zA-Z0-9]+$/.test(A)?A:q.error("string.alphanum")},base64:{method(A={}){return s.assertOptions(A,["paddingRequired","urlSafe"]),A={urlSafe:!1,paddingRequired:!0,...A},M(typeof A.paddingRequired=="boolean","paddingRequired must be boolean"),M(typeof A.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:A}})},validate:(A,q,{options:v})=>h.base64Regex[v.paddingRequired][v.urlSafe].test(A)?A:q.error("string.base64")},case:{method(A){return M(["lower","upper"].includes(A),"Invalid case:",A),this.$_addRule({name:"case",args:{direction:A}})},validate:(A,q,{direction:v})=>v==="lower"&&A===A.toLocaleLowerCase()||v==="upper"&&A===A.toLocaleUpperCase()?A:q.error(`string.${v}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(A,q){let v=A.length,L=0,T=1;for(;v--;){const w=A.charAt(v)*T;L+=w-9*(w>9),T^=3}return L>0&&L%10==0?A:q.error("string.creditCard")}},dataUri:{method(A={}){return s.assertOptions(A,["paddingRequired"]),A={paddingRequired:!0,...A},M(typeof A.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:A}})},validate(A,q,{options:v}){const L=A.match(h.dataUriRegex);return L&&(!L[2]||L[2]!=="base64"||h.base64Regex[v.paddingRequired].false.test(L[3]))?A:q.error("string.dataUri")}},domain:{method(A){A&&s.assertOptions(A,["allowFullyQualified","allowUnicode","allowUnderscore","maxDomainSegments","minDomainSegments","tlds"]);const q=h.addressOptions(A);return this.$_addRule({name:"domain",args:{options:A},address:q})},validate:(A,q,v,{address:L})=>y(A,L)?A:q.error("string.domain")},email:{method(A={}){s.assertOptions(A,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),M(A.multiple===void 0||typeof A.multiple=="boolean","multiple option must be an boolean");const q=h.addressOptions(A),v=new RegExp(`\\s*[${A.separator?g(A.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:A},regex:v,address:q})},validate(A,q,{options:v},{regex:L,address:T}){const w=v.multiple?A.split(L):[A],C=[];for(const R of w)_(R,T)||C.push(R);return C.length?q.error("string.email",{value:A,invalids:C}):A}},guid:{alias:"uuid",method(A={}){s.assertOptions(A,["version","separator"]);let q="";if(A.version){const T=[].concat(A.version);M(T.length>=1,"version must have at least 1 valid version specified");const w=new Set;for(let C=0;C<T.length;++C){const R=T[C];M(typeof R=="string","version at position "+C+" must be a string");const S=h.guidVersions[R.toLowerCase()];M(S,"version at position "+C+" must be one of "+Object.keys(h.guidVersions).join(", ")),M(!w.has(S),"version at position "+C+" must not be a duplicate"),q+=S,w.add(S)}}M(h.guidSeparators.has(A.separator),'separator must be one of true, false, "-", or ":"');const v=A.separator===void 0?"[:-]?":A.separator===!0?"[:-]":A.separator===!1?"[]?":`\\${A.separator}`,L=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${v})[0-9A-F]{4}\\2?[${q||"0-9A-F"}][0-9A-F]{3}\\2?[${q?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:A},regex:L})},validate(A,q,v,{regex:L}){const T=L.exec(A);return T?h.guidBrackets[T[1]]!==T[T.length-1]?q.error("string.guid"):A:q.error("string.guid")}},hex:{method(A={}){return s.assertOptions(A,["byteAligned"]),A={byteAligned:!1,...A},M(typeof A.byteAligned=="boolean","byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:A}})},validate:(A,q,{options:v})=>h.hexRegex.test(A)?v.byteAligned&&A.length%2!=0?q.error("string.hexAlign"):A:q.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(A,q)=>y(A,{minDomainSegments:1})||h.ipRegex.test(A)?A:q.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(A={}){s.assertOptions(A,["cidr","version"]);const{cidr:q,versions:v,regex:L}=O(A),T=A.version?v:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:q,version:T}},regex:L})},validate:(A,q,{options:v},{regex:L})=>L.test(A)?A:v.version?q.error("string.ipVersion",{value:A,cidr:v.cidr,version:v.version}):q.error("string.ip",{value:A,cidr:v.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(A,{error:q})=>h.isoDate(A)?A:q("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(A,q)=>h.isoDurationRegex.test(A)?A:q.error("string.isoDuration")},length:{method(A,q){return h.length(this,"length",A,"=",q)},validate(A,q,{limit:v,encoding:L},{name:T,operator:w,args:C}){const R=!L&&A.length;return s.compare(R,v,w)?A:q.error("string."+T,{limit:C.limit,value:A,encoding:L})},args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(A,q){return h.length(this,"max",A,"<=",q)},args:["limit","encoding"]},min:{method(A,q){return h.length(this,"min",A,">=",q)},args:["limit","encoding"]},normalize:{method(A="NFC"){return M(h.normalizationForms.includes(A),"normalization form must be one of "+h.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:A}})},validate:(A,{error:q},{form:v})=>A===A.normalize(v)?A:q("string.normalize",{value:A,form:v}),convert:!0},pattern:{alias:"regex",method(A,q={}){M(A instanceof RegExp,"regex must be a RegExp"),M(!A.flags.includes("g")&&!A.flags.includes("y"),"regex should not use global or sticky mode"),typeof q=="string"&&(q={name:q}),s.assertOptions(q,["invert","name"]);const v=["string.pattern",q.invert?".invert":"",q.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:A,options:q},errorCode:v})},validate:(A,q,{regex:v,options:L},{errorCode:T})=>v.test(A)^L.invert?A:q.error(T,{name:L.name,regex:v,value:A}),args:["regex","options"],multi:!0},replace:{method(A,q){typeof A=="string"&&(A=new RegExp(g(A),"g")),M(A instanceof RegExp,"pattern must be a RegExp"),M(typeof q=="string","replacement must be a String");const v=this.clone();return v.$_terms.replacements||(v.$_terms.replacements=[]),v.$_terms.replacements.push({pattern:A,replacement:q}),v}},token:{method(){return this.$_addRule("token")},validate:(A,q)=>/^\w+$/.test(A)?A:q.error("string.token")},trim:{method(A=!0){return M(typeof A=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:A}})},validate:(A,q,{enabled:v})=>v&&A!==A.trim()?q.error("string.trim"):A,convert:!0},truncate:{method(A=!0){return M(typeof A=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",A)}},uppercase:{method(){return this.case("upper")}},uri:{method(A={}){s.assertOptions(A,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),A.domain&&s.assertOptions(A.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:q,scheme:v}=d(A),L=A.domain?h.addressOptions(A.domain):null;return this.$_addRule({name:"uri",args:{options:A},regex:q,domain:L,scheme:v})},validate(A,q,{options:v},{regex:L,domain:T,scheme:w}){if(["http:/","https:/"].includes(A))return q.error("string.uri");const C=L.exec(A);if(C){const R=C[1]||C[2];return!T||v.allowRelative&&!R||y(R,T)?A:q.error("string.domain",{value:R})}return v.relativeOnly?q.error("string.uriRelativeOnly"):v.scheme?q.error("string.uriCustomScheme",{scheme:w,value:A}):q.error("string.uri")}}},manifest:{build(A,q){if(q.replacements)for(const{pattern:v,replacement:L}of q.replacements)A=A.replace(v,L);return A}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),h.addressOptions=function(A){if(!A||(M(A.minDomainSegments===void 0||Number.isSafeInteger(A.minDomainSegments)&&A.minDomainSegments>0,"minDomainSegments must be a positive integer"),M(A.maxDomainSegments===void 0||Number.isSafeInteger(A.maxDomainSegments)&&A.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),A.tlds===!1))return A;if(A.tlds===!0||A.tlds===void 0)return M(h.tlds,"Built-in TLD list disabled"),Object.assign({},A,h.tlds);M(typeof A.tlds=="object","tlds must be true, false, or an object");const q=A.tlds.deny;if(q)return Array.isArray(q)&&(A=Object.assign({},A,{tlds:{deny:new Set(q)}})),M(A.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),M(!A.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),h.validateTlds(A.tlds.deny,"tlds.deny"),A;const v=A.tlds.allow;return v?v===!0?(M(h.tlds,"Built-in TLD list disabled"),Object.assign({},A,h.tlds)):(Array.isArray(v)&&(A=Object.assign({},A,{tlds:{allow:new Set(v)}})),M(A.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),h.validateTlds(A.tlds.allow,"tlds.allow"),A):{...A,tlds:!1}},h.validateTlds=function(A,q){for(const v of A)M(y(v,{minDomainSegments:1,maxDomainSegments:1}),`${q} must contain valid top level domain names`)},h.isoDate=function(A){if(!s.isIsoDate(A))return null;/.*T.*[+-]\d\d$/.test(A)&&(A+="00");const q=new Date(A);return isNaN(q.getTime())?null:q.toISOString()},h.length=function(A,q,v,L,T){return M(!T||!1,"Invalid encoding:",T),A.$_addRule({name:q,method:"length",args:{limit:v,encoding:T},operator:L})}},8826:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y={};y.Map=class extends Map{slice(){return new y.Map(this)}},p.exports=g.extend({type:"symbol",terms:{map:{init:new y.Map}},coerce:{method(_,{schema:O,error:d}){const f=O.$_terms.map.get(_);return f&&(_=f),O._flags.only&&typeof _!="symbol"?{value:_,errors:d("symbol.map",{map:O.$_terms.map})}:{value:_}}},validate(_,{error:O}){if(typeof _!="symbol")return{value:_,errors:O("symbol.base")}},rules:{map:{method(_){_&&!_[Symbol.iterator]&&typeof _=="object"&&(_=Object.entries(_)),M(_&&_[Symbol.iterator],"Iterable must be an iterable or object");const O=this.clone(),d=[];for(const f of _){M(f&&f[Symbol.iterator],"Entry must be an iterable");const[z,s]=f;M(typeof z!="object"&&typeof z!="function"&&typeof z!="symbol","Key must not be of type object, function, or Symbol"),M(typeof s=="symbol","Value must be a Symbol"),O.$_terms.map.set(z,s),d.push(s)}return O.valid(...d)}}},manifest:{build:(_,O)=>(O.map&&(_=_.map(O.map)),_)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(p,c,l)=>{const{assert:M,clone:g,ignore:y,reach:_}=l(8870),O=l(8160),d=l(6354),f=l(493),z={result:Symbol("result")};c.entry=function(s,h,A){let q=O.defaults;A&&(M(A.warnings===void 0,"Cannot override warnings preference in synchronous validation"),M(A.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),q=O.preferences(O.defaults,A));const v=z.entry(s,h,q);M(!v.mainstay.externals.length,"Schema with external rules must use validateAsync()");const L={value:v.value};return v.error&&(L.error=v.error),v.mainstay.warnings.length&&(L.warning=d.details(v.mainstay.warnings)),v.mainstay.debug&&(L.debug=v.mainstay.debug),v.mainstay.artifacts&&(L.artifacts=v.mainstay.artifacts),L},c.entryAsync=async function(s,h,A){let q=O.defaults;A&&(q=O.preferences(O.defaults,A));const v=z.entry(s,h,q),L=v.mainstay;if(v.error)throw L.debug&&(v.error.debug=L.debug),v.error;if(L.externals.length){let w=v.value;const C=[];for(const R of L.externals){const S=R.state.path,E=R.schema.type==="link"?L.links.get(R.schema):null;let G,s0,b0=w;const V=S.length?[w]:[],Z=S.length?_(s,S):s;if(S.length){G=S[S.length-1];let d0=w;for(const v0 of S.slice(0,-1))d0=d0[v0],V.unshift(d0);s0=V[0],b0=s0[G]}try{const d0=(E0,S0)=>(E||R.schema).$_createError(E0,b0,S0,R.state,q),v0=await R.method(b0,{schema:R.schema,linked:E,state:R.state,prefs:A,original:Z,error:d0,errorsArray:z.errorsArray,warn:(E0,S0)=>L.warnings.push((E||R.schema).$_createError(E0,b0,S0,R.state,q)),message:(E0,S0)=>(E||R.schema).$_createError("external",b0,S0,R.state,q,{messages:E0})});if(v0===void 0||v0===b0)continue;if(v0 instanceof d.Report){if(L.tracer.log(R.schema,R.state,"rule","external","error"),C.push(v0),q.abortEarly)break;continue}if(Array.isArray(v0)&&v0[O.symbols.errors]){if(L.tracer.log(R.schema,R.state,"rule","external","error"),C.push(...v0),q.abortEarly)break;continue}s0?(L.tracer.value(R.state,"rule",b0,v0,"external"),s0[G]=v0):(L.tracer.value(R.state,"rule",w,v0,"external"),w=v0)}catch(d0){throw q.errors.label&&(d0.message+=` (${R.label})`),d0}}if(v.value=w,C.length)throw v.error=d.process(C,s,q),L.debug&&(v.error.debug=L.debug),v.error}if(!q.warnings&&!q.debug&&!q.artifacts)return v.value;const T={value:v.value};return L.warnings.length&&(T.warning=d.details(L.warnings)),L.debug&&(T.debug=L.debug),L.artifacts&&(T.artifacts=L.artifacts),T},z.Mainstay=class{constructor(s,h,A){this.externals=[],this.warnings=[],this.tracer=s,this.debug=h,this.links=A,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const s=this._snapshots.pop();this.externals=s.externals,this.warnings=s.warnings}commit(){this._snapshots.pop()}},z.entry=function(s,h,A){const{tracer:q,cleanup:v}=z.tracer(h,A),L=A.debug?[]:null,T=h._ids._schemaChain?new Map:null,w=new z.Mainstay(q,L,T),C=h._ids._schemaChain?[{schema:h}]:null,R=new f([],[],{mainstay:w,schemas:C}),S=c.validate(s,h,R,A);v&&h.$_root.untrace();const E=d.process(S.errors,s,A);return{value:S.value,error:E,mainstay:w}},z.tracer=function(s,h){return s.$_root._tracer?{tracer:s.$_root._tracer._register(s)}:h.debug?(M(s.$_root.trace,"Debug mode not supported"),{tracer:s.$_root.trace()._register(s),cleanup:!0}):{tracer:z.ignore}},c.validate=function(s,h,A,q,v={}){if(h.$_terms.whens&&(h=h._generate(s,A,q).schema),h._preferences&&(q=z.prefs(h,q)),h._cache&&q.cache){const E=h._cache.get(s);if(A.mainstay.tracer.debug(A,"validate","cached",!!E),E)return E}const L=(E,G,s0)=>h.$_createError(E,s,G,s0||A,q),T={original:s,prefs:q,schema:h,state:A,error:L,errorsArray:z.errorsArray,warn:(E,G,s0)=>A.mainstay.warnings.push(L(E,G,s0)),message:(E,G)=>h.$_createError("custom",s,G,A,q,{messages:E})};A.mainstay.tracer.entry(h,A);const w=h._definition;if(w.prepare&&s!==void 0&&q.convert){const E=w.prepare(s,T);if(E){if(A.mainstay.tracer.value(A,"prepare",s,E.value),E.errors)return z.finalize(E.value,[].concat(E.errors),T);s=E.value}}if(w.coerce&&s!==void 0&&q.convert&&(!w.coerce.from||w.coerce.from.includes(typeof s))){const E=w.coerce.method(s,T);if(E){if(A.mainstay.tracer.value(A,"coerced",s,E.value),E.errors)return z.finalize(E.value,[].concat(E.errors),T);s=E.value}}const C=h._flags.empty;C&&C.$_match(z.trim(s,h),A.nest(C),O.defaults)&&(A.mainstay.tracer.value(A,"empty",s,void 0),s=void 0);const R=v.presence||h._flags.presence||(h._flags._endedSwitch?null:q.presence);if(s===void 0){if(R==="forbidden")return z.finalize(s,null,T);if(R==="required")return z.finalize(s,[h.$_createError("any.required",s,null,A,q)],T);if(R==="optional"){if(h._flags.default!==O.symbols.deepDefault)return z.finalize(s,null,T);A.mainstay.tracer.value(A,"default",s,{}),s={}}}else if(R==="forbidden")return z.finalize(s,[h.$_createError("any.unknown",s,null,A,q)],T);const S=[];if(h._valids){const E=h._valids.get(s,A,q,h._flags.insensitive);if(E)return q.convert&&(A.mainstay.tracer.value(A,"valids",s,E.value),s=E.value),A.mainstay.tracer.filter(h,A,"valid",E),z.finalize(s,null,T);if(h._flags.only){const G=h.$_createError("any.only",s,{valids:h._valids.values({display:!0})},A,q);if(q.abortEarly)return z.finalize(s,[G],T);S.push(G)}}if(h._invalids){const E=h._invalids.get(s,A,q,h._flags.insensitive);if(E){A.mainstay.tracer.filter(h,A,"invalid",E);const G=h.$_createError("any.invalid",s,{invalids:h._invalids.values({display:!0})},A,q);if(q.abortEarly)return z.finalize(s,[G],T);S.push(G)}}if(w.validate){const E=w.validate(s,T);if(E&&(A.mainstay.tracer.value(A,"base",s,E.value),s=E.value,E.errors)){if(!Array.isArray(E.errors))return S.push(E.errors),z.finalize(s,S,T);if(E.errors.length)return S.push(...E.errors),z.finalize(s,S,T)}}return h._rules.length?z.rules(s,S,T):z.finalize(s,S,T)},z.rules=function(s,h,A){const{schema:q,state:v,prefs:L}=A;for(const T of q._rules){const w=q._definition.rules[T.method];if(w.convert&&L.convert){v.mainstay.tracer.log(q,v,"rule",T.name,"full");continue}let C,R=T.args;if(T._resolve.length){R=Object.assign({},R);for(const E of T._resolve){const G=w.argsByName.get(E),s0=R[E].resolve(s,v,L),b0=G.normalize?G.normalize(s0):s0,V=O.validateArg(b0,null,G);if(V){C=q.$_createError("any.ref",s0,{arg:E,ref:R[E],reason:V},v,L);break}R[E]=b0}}C=C||w.validate(s,A,R,T);const S=z.rule(C,T);if(S.errors){if(v.mainstay.tracer.log(q,v,"rule",T.name,"error"),T.warn){v.mainstay.warnings.push(...S.errors);continue}if(L.abortEarly)return z.finalize(s,S.errors,A);h.push(...S.errors)}else v.mainstay.tracer.log(q,v,"rule",T.name,"pass"),v.mainstay.tracer.value(v,"rule",s,S.value,T.name),s=S.value}return z.finalize(s,h,A)},z.rule=function(s,h){return s instanceof d.Report?(z.error(s,h),{errors:[s],value:null}):Array.isArray(s)&&s[O.symbols.errors]?(s.forEach(A=>z.error(A,h)),{errors:s,value:null}):{errors:null,value:s}},z.error=function(s,h){return h.message&&s._setTemplate(h.message),s},z.finalize=function(s,h,A){h=h||[];const{schema:q,state:v,prefs:L}=A;if(h.length){const w=z.default("failover",void 0,h,A);w!==void 0&&(v.mainstay.tracer.value(v,"failover",s,w),s=w,h=[])}if(h.length&&q._flags.error)if(typeof q._flags.error=="function"){h=q._flags.error(h),Array.isArray(h)||(h=[h]);for(const w of h)M(w instanceof Error||w instanceof d.Report,"error() must return an Error object")}else h=[q._flags.error];if(s===void 0){const w=z.default("default",s,h,A);v.mainstay.tracer.value(v,"default",s,w),s=w}if(q._flags.cast&&s!==void 0){const w=q._definition.cast[q._flags.cast];if(w.from(s)){const C=w.to(s,A);v.mainstay.tracer.value(v,"cast",s,C,q._flags.cast),s=C}}if(q.$_terms.externals&&L.externals&&L._externals!==!1)for(const{method:w}of q.$_terms.externals)v.mainstay.externals.push({method:w,schema:q,state:v,label:d.label(q._flags,v,L)});const T={value:s,errors:h.length?h:null};return q._flags.result&&(T.value=q._flags.result==="strip"?void 0:A.original,v.mainstay.tracer.value(v,q._flags.result,s,T.value),v.shadow(s,q._flags.result)),q._cache&&L.cache!==!1&&!q._refs.length&&q._cache.set(A.original,T),s===void 0||T.errors||q._flags.artifact===void 0||(v.mainstay.artifacts=v.mainstay.artifacts||new Map,v.mainstay.artifacts.has(q._flags.artifact)||v.mainstay.artifacts.set(q._flags.artifact,[]),v.mainstay.artifacts.get(q._flags.artifact).push(v.path)),T},z.prefs=function(s,h){const A=h===O.defaults;return A&&s._preferences[O.symbols.prefs]?s._preferences[O.symbols.prefs]:(h=O.preferences(h,s._preferences),A&&(s._preferences[O.symbols.prefs]=h),h)},z.default=function(s,h,A,q){const{schema:v,state:L,prefs:T}=q,w=v._flags[s];if(T.noDefaults||w===void 0)return h;if(L.mainstay.tracer.log(v,L,"rule",s,"full"),!w)return w;if(typeof w=="function"){const C=w.length?[g(L.ancestors[0]),q]:[];try{return w(...C)}catch(R){return void A.push(v.$_createError(`any.${s}`,null,{error:R},L,T))}}return typeof w!="object"?w:w[O.symbols.literal]?w.literal:O.isResolvable(w)?w.resolve(h,L,T):g(w)},z.trim=function(s,h){if(typeof s!="string")return s;const A=h.$_getRule("trim");return A&&A.args.enabled?s.trim():s},z.ignore={active:!1,debug:y,entry:y,filter:y,log:y,resolve:y,value:y},z.errorsArray=function(){const s=[];return s[O.symbols.errors]=!0,s}},2036:(p,c,l)=>{const{assert:M,deepEqual:g}=l(8870),y=l(8160),_={};p.exports=_.Values=class{constructor(O,d){this._values=new Set(O),this._refs=new Set(d),this._lowercase=_.lowercases(O),this._override=!1}get length(){return this._values.size+this._refs.size}add(O,d){y.isResolvable(O)?this._refs.has(O)||(this._refs.add(O),d&&d.register(O)):this.has(O,null,null,!1)||(this._values.add(O),typeof O=="string"&&this._lowercase.set(O.toLowerCase(),O))}static merge(O,d,f){if(O=O||new _.Values,d){if(d._override)return d.clone();for(const z of[...d._values,...d._refs])O.add(z)}if(f)for(const z of[...f._values,...f._refs])O.remove(z);return O.length?O:null}remove(O){y.isResolvable(O)?this._refs.delete(O):(this._values.delete(O),typeof O=="string"&&this._lowercase.delete(O.toLowerCase()))}has(O,d,f,z){return!!this.get(O,d,f,z)}get(O,d,f,z){if(!this.length)return!1;if(this._values.has(O))return{value:O};if(typeof O=="string"&&O&&z){const s=this._lowercase.get(O.toLowerCase());if(s)return{value:s}}if(!this._refs.size&&typeof O!="object")return!1;if(typeof O=="object"){for(const s of this._values)if(g(s,O))return{value:s}}if(d)for(const s of this._refs){const h=s.resolve(O,d,f,null,{in:!0});if(h===void 0)continue;const A=s.in&&typeof h=="object"?Array.isArray(h)?h:Object.keys(h):[h];for(const q of A)if(typeof q==typeof O){if(z&&O&&typeof O=="string"){if(q.toLowerCase()===O.toLowerCase())return{value:q,ref:s}}else if(g(q,O))return{value:q,ref:s}}}return!1}override(){this._override=!0}values(O){if(O&&O.display){const d=[];for(const f of[...this._values,...this._refs])f!==void 0&&d.push(f);return d}return Array.from([...this._values,...this._refs])}clone(){const O=new _.Values(this._values,this._refs);return O._override=this._override,O}concat(O){M(!O._override,"Cannot concat override set of values");const d=new _.Values([...this._values,...O._values],[...this._refs,...O._refs]);return d._override=this._override,d}describe(){const O=[];this._override&&O.push({override:!0});for(const d of this._values.values())O.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())O.push(d.describe());return O}},_.Values.prototype[y.symbols.values]=!0,_.Values.prototype.slice=_.Values.prototype.clone,_.lowercases=function(O){const d=new Map;if(O)for(const f of O)typeof f=="string"&&d.set(f.toLowerCase(),f);return d}},4958:(p,c,l)=>{l.r(c),l.d(c,{analyzeDomain:()=>q,analyzeEmail:()=>R,errorCodes:()=>g,ipRegex:()=>Oe,isDomainValid:()=>v,isEmailValid:()=>S,uriDecode:()=>B1,uriRegex:()=>Y1,validateDomainOptions:()=>L});var M=l(1275);const g={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"};function y(M0){return{code:M0,error:g[M0]}}const _=2,O=/[^\x00-\x7f]/,d=/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,f=/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,z=/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,s=/^[a-zA-Z0-9_](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,h=M.URL||URL;function A(M0){return!!M0.allow}function q(M0,N0={}){if(!M0)return y("DOMAIN_NON_EMPTY_STRING");if(typeof M0!="string")throw new Error("Invalid input: domain must be a string");if(M0.length>256)return y("DOMAIN_TOO_LONG");if(O.test(M0)){if(N0.allowUnicode===!1)return y("DOMAIN_INVALID_UNICODE_CHARS");M0=M0.normalize("NFC")}if(d.test(M0))return y("DOMAIN_INVALID_CHARS");M0=function(t0){t0.includes("%")&&(t0=t0.replace(/%/g,"%25"));try{return new h(`http://${t0}`).host}catch{return t0}}(M0),N0.allowFullyQualified&&M0[M0.length-1]==="."&&(M0=M0.slice(0,-1));const t1=N0.minDomainSegments||_,j=M0.split(".");if(j.length<t1)return y("DOMAIN_SEGMENTS_COUNT");if(N0.maxDomainSegments&&j.length>N0.maxDomainSegments)return y("DOMAIN_SEGMENTS_COUNT_MAX");const e0=N0.tlds;if(e0){const t0=j[j.length-1].toLowerCase();if(A(e0)){if(!e0.allow.has(t0))return y("DOMAIN_FORBIDDEN_TLDS")}else if(e0.deny.has(t0))return y("DOMAIN_FORBIDDEN_TLDS")}for(let t0=0;t0<j.length;++t0){const c0=j[t0];if(!c0.length)return y("DOMAIN_EMPTY_SEGMENT");if(c0.length>63)return y("DOMAIN_LONG_SEGMENT");if(t0<j.length-1){if(N0.allowUnderscore){if(!s.test(c0))return y("DOMAIN_INVALID_CHARS")}else if(!z.test(c0))return y("DOMAIN_INVALID_CHARS")}else if(!f.test(c0))return y("DOMAIN_INVALID_TLDS_CHARS")}return null}function v(M0,N0){return!q(M0,N0)}function L(M0){if(M0){if(typeof M0.tlds!="object")throw new Error("Invalid options: tlds must be a boolean or an object");if(A(M0.tlds)){if(M0.tlds.allow instanceof Set==0)throw new Error("Invalid options: tlds.allow must be a Set object or true");if(M0.tlds.deny)throw new Error("Invalid options: cannot specify both tlds.allow and tlds.deny lists")}else if(M0.tlds.deny instanceof Set==0)throw new Error("Invalid options: tlds.deny must be a Set object")}}var T=l(3975);const w=/[^\x00-\x7f]/,C=new(T.TextEncoder||TextEncoder);function R(M0,N0){return E(M0,N0)}function S(M0,N0){return!E(M0,N0)}function E(M0,N0={}){if(typeof M0!="string")throw new Error("Invalid input: email must be a string");if(!M0)return y("EMPTY_STRING");const t1=!w.test(M0);if(!t1){if(N0.allowUnicode===!1)return y("FORBIDDEN_UNICODE");M0=M0.normalize("NFC")}const j=M0.split("@");if(j.length!==2)return j.length>2?y("MULTIPLE_AT_CHAR"):y("MISSING_AT_CHAR");const[e0,t0]=j;if(!e0)return y("EMPTY_LOCAL");if(!N0.ignoreLength){if(M0.length>254)return y("ADDRESS_TOO_LONG");if(C.encode(e0).length>64)return y("LOCAL_TOO_LONG")}return function(c0,R0){const X0=c0.split(".");for(const x0 of X0){if(!x0.length)return y("EMPTY_LOCAL_SEGMENT");if(R0){if(!s0.test(x0))return y("INVALID_LOCAL_CHARS")}else for(const k0 of x0){if(s0.test(k0))continue;const Q0=G(k0);if(!b0.test(Q0))return y("INVALID_LOCAL_CHARS")}}return null}(e0,t1)||q(t0,N0)}function G(M0){return Array.from(C.encode(M0),N0=>String.fromCharCode(N0)).join("")}const s0=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,b0=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"));var V=l(375),Z=l.n(V),d0=l(6064),v0=l.n(d0);const E0=function(){const M0={},N0="\\dA-Fa-f",t1="["+N0+"]",j="\\w-\\.~",e0="!\\$&'\\(\\)\\*\\+,;=",t0="%"+N0,c0=j+t0+e0+":@",R0="["+c0+"]",X0="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";M0.ipv4address="(?:"+X0+"\\.){3}"+X0;const x0=t1+"{1,4}",k0="(?:"+x0+":"+x0+"|"+M0.ipv4address+")",Q0="(?:"+x0+":){6}"+k0,ao="::(?:"+x0+":){5}"+k0,Ko="(?:"+x0+")?::(?:"+x0+":){4}"+k0,Qi="(?:(?:"+x0+":){0,1}"+x0+")?::(?:"+x0+":){3}"+k0,Lo="(?:(?:"+x0+":){0,2}"+x0+")?::(?:"+x0+":){2}"+k0,Zi="(?:(?:"+x0+":){0,3}"+x0+")?::"+x0+":"+k0,_o="(?:(?:"+x0+":){0,4}"+x0+")?::"+k0,po="(?:(?:"+x0+":){0,5}"+x0+")?::"+x0,B2="(?:(?:"+x0+":){0,6}"+x0+")?::";M0.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",M0.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",M0.ipv6address="(?:"+Q0+"|"+ao+"|"+Ko+"|"+Qi+"|"+Lo+"|"+Zi+"|"+_o+"|"+po+"|"+B2+")",M0.ipvFuture="v"+t1+"+\\.["+j+e0+":]+",M0.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",M0.schemeRegex=new RegExp(M0.scheme);const Qo="["+j+t0+e0+":]*",ci="["+j+t0+e0+"]{1,255}",w2="(?:\\[(?:"+M0.ipv6address+"|"+M0.ipvFuture+")\\]|"+M0.ipv4address+"|"+ci+")",Zo="(?:"+Qo+"@)?"+w2+"(?::\\d*)?",Jo="(?:"+Qo+"@)?("+w2+")(?::\\d*)?",C2=R0+"*",X2=R0+"+",at="(?:\\/"+C2+")*",e2="\\/(?:"+X2+at+")?",Ji=X2+at,en="["+j+t0+e0+"@]+"+at,tn="(?:\\/\\/\\/"+C2+at+")";return M0.hierPart="(?:(?:\\/\\/"+Zo+at+")|"+e2+"|"+Ji+"|"+tn+")",M0.hierPartCapture="(?:(?:\\/\\/"+Jo+at+")|"+e2+"|"+Ji+")",M0.relativeRef="(?:(?:\\/\\/"+Zo+at+")|"+e2+"|"+en+"|)",M0.relativeRefCapture="(?:(?:\\/\\/"+Jo+at+")|"+e2+"|"+en+"|)",M0.query="["+c0+"\\/\\?]*(?=#|$)",M0.queryWithSquareBrackets="["+c0+"\\[\\]\\/\\?]*(?=#|$)",M0.fragment="["+c0+"\\/\\?]*",M0}(),S0={v4Cidr:E0.ipv4Cidr,v6Cidr:E0.ipv6Cidr,ipv4:E0.ipv4address,ipv6:E0.ipv6address,ipvfuture:E0.ipvFuture};function G0(M0){const N0=E0,t1="(?:\\?"+(M0.allowQuerySquareBrackets?N0.queryWithSquareBrackets:N0.query)+")?(?:#"+N0.fragment+")?",j=M0.domain?N0.relativeRefCapture:N0.relativeRef;if(M0.relativeOnly)return v1(j+t1);let e0="";if(M0.scheme){Z()(M0.scheme instanceof RegExp||typeof M0.scheme=="string"||Array.isArray(M0.scheme),"scheme must be a RegExp, String, or Array");const c0=[].concat(M0.scheme);Z()(c0.length>=1,"scheme must have at least 1 scheme specified");const R0=[];for(let X0=0;X0<c0.length;++X0){const x0=c0[X0];Z()(x0 instanceof RegExp||typeof x0=="string","scheme at position "+X0+" must be a RegExp or String"),x0 instanceof RegExp?R0.push(x0.source.toString()):(Z()(N0.schemeRegex.test(x0),"scheme at position "+X0+" must be a valid scheme"),R0.push(v0()(x0)))}e0=R0.join("|")}const t0="(?:"+(e0?"(?:"+e0+")":N0.scheme)+":"+(M0.domain?N0.hierPartCapture:N0.hierPart)+")";return v1((M0.allowRelative?"(?:"+t0+"|"+j+")":t0)+t1,e0)}function v1(M0,N0=null){return{raw:M0=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${M0}`,regex:new RegExp(`^${M0}$`),scheme:N0}}const h1=G0({});function Y1(M0={}){return M0.scheme||M0.allowRelative||M0.relativeOnly||M0.allowQuerySquareBrackets||M0.domain?G0(M0):h1}function Oe(M0={}){const N0=M0.cidr||"optional";Z()(["required","optional","forbidden"].includes(N0),"options.cidr must be one of required, optional, forbidden"),Z()(M0.version===void 0||typeof M0.version=="string"||Array.isArray(M0.version),"options.version must be a string or an array of string");let t1=M0.version||["ipv4","ipv6","ipvfuture"];Array.isArray(t1)||(t1=[t1]),Z()(t1.length>=1,"options.version must have at least 1 version specified");for(const t0 of t1)Z()(typeof t0=="string"&&t0===t0.toLowerCase(),"Invalid options.version value"),Z()(["ipv4","ipv6","ipvfuture"].includes(t0),"options.version contains unknown version "+t0+" - must be one of ipv4, ipv6, ipvfuture");t1=Array.from(new Set(t1));const j=`(?:${t1.map(t0=>{if(N0==="forbidden")return S0[t0];const c0=`\\/${t0==="ipv4"?S0.v4Cidr:S0.v6Cidr}`;return N0==="required"?`${S0[t0]}${c0}`:`${S0[t0]}(?:${c0})?`}).join("|")})`,e0=new RegExp(`^${j}$`);return{cidr:N0,versions:t1,regex:e0,raw:j}}const le={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15},e1={accept:12,reject:0,data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7]};function B1(M0){let N0=M0.indexOf("%");if(N0===-1)return M0;let t1="",j=0,e0=0,t0=N0,c0=e1.accept;for(;N0>-1&&N0<M0.length;){const R0=ft(M0[N0+1],4)|ft(M0[N0+2],0),X0=e1.data[R0];if(c0=e1.data[256+c0+X0],e0=e0<<6|R0&e1.data[364+X0],c0!==e1.accept){if(c0===e1.reject||(N0+=3,N0>=M0.length||M0[N0]!=="%"))return null}else t1+=M0.slice(j,t0),t1+=e0<=65535?String.fromCharCode(e0):String.fromCharCode(55232+(e0>>10),56320+(1023&e0)),e0=0,j=N0+3,N0=M0.indexOf("%",j),t0=N0}return t1+M0.slice(j)}function ft(M0,N0){const t1=le[M0];return t1===void 0?255:t1<<N0}},4964:(p,c)=>{const l={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};c.Parser=class{constructor(M,g={}){if(!g[l.settings]&&g.constants)for(const y in g.constants){const _=g.constants[y];if(_!==null&&!["boolean","number","string"].includes(typeof _))throw new Error(`Formula constant ${y} contains invalid ${typeof _} value type`)}this.settings=g[l.settings]?g:Object.assign({[l.settings]:!0,constants:{},functions:{}},g),this.single=null,this._parts=null,this._parse(M)}_parse(M){let g=[],y="",_=0,O=!1;const d=z=>{if(_)throw new Error("Formula missing closing parenthesis");const s=g.length?g[g.length-1]:null;if(O||y||z){if(s&&s.type==="reference"&&z===")")return s.type="function",s.value=this._subFormula(y,s.value),void(y="");if(z===")"){const h=new c.Parser(y,this.settings);g.push({type:"segment",value:h})}else if(O){if(O==="]")return g.push({type:"reference",value:y}),void(y="");g.push({type:"literal",value:y})}else if(l.operatorCharacters.includes(y))s&&s.type==="operator"&&l.operators.includes(s.value+y)?s.value+=y:g.push({type:"operator",value:y});else if(y.match(l.numberRx))g.push({type:"constant",value:parseFloat(y)});else if(this.settings.constants[y]!==void 0)g.push({type:"constant",value:this.settings.constants[y]});else{if(!y.match(l.tokenRx))throw new Error(`Formula contains invalid token: ${y}`);g.push({type:"reference",value:y})}y=""}};for(const z of M)O?z===O?(d(),O=!1):y+=z:_?z==="("?(y+=z,++_):z===")"?(--_,_?y+=z:d(z)):y+=z:z in l.literals?O=l.literals[z]:z==="("?(d(),++_):l.operatorCharacters.includes(z)?(d(),y=z,d()):z!==" "?y+=z:d();d(),g=g.map((z,s)=>z.type!=="operator"||z.value!=="-"||s&&g[s-1].type!=="operator"?z:{type:"operator",value:"n"});let f=!1;for(const z of g){if(z.type==="operator"){if(l.operatorsPrefix.includes(z.value))continue;if(!f)throw new Error("Formula contains an operator in invalid position");if(!l.operators.includes(z.value))throw new Error(`Formula contains an unknown operator ${z.value}`)}else if(f)throw new Error("Formula missing expected operator");f=!f}if(!f)throw new Error("Formula contains invalid trailing operator");g.length===1&&["reference","literal","constant"].includes(g[0].type)&&(this.single={type:g[0].type==="reference"?"reference":"value",value:g[0].value}),this._parts=g.map(z=>{if(z.type==="operator")return l.operatorsPrefix.includes(z.value)?z:z.value;if(z.type!=="reference")return z.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(z.value))throw new Error(`Formula contains invalid reference ${z.value}`);return this.settings.reference?this.settings.reference(z.value):l.reference(z.value)})}_subFormula(M,g){const y=this.settings.functions[g];if(typeof y!="function")throw new Error(`Formula contains unknown function ${g}`);let _=[];if(M){let O="",d=0,f=!1;const z=()=>{if(!O)throw new Error(`Formula contains function ${g} with invalid arguments ${M}`);_.push(O),O=""};for(let s=0;s<M.length;++s){const h=M[s];f?(O+=h,h===f&&(f=!1)):h in l.literals&&!d?(O+=h,f=l.literals[h]):h!==","||d?(O+=h,h==="("?++d:h===")"&&--d):z()}z()}return _=_.map(O=>new c.Parser(O,this.settings)),function(O){const d=[];for(const f of _)d.push(f.evaluate(O));return y.call(O,...d)}}evaluate(M){const g=this._parts.slice();for(let y=g.length-2;y>=0;--y){const _=g[y];if(_&&_.type==="operator"){const O=g[y+1];g.splice(y+1,1);const d=l.evaluate(O,M);g[y]=l.single(_.value,d)}}return l.operatorsOrder.forEach(y=>{for(let _=1;_<g.length-1;)if(y.includes(g[_])){const O=g[_],d=l.evaluate(g[_-1],M),f=l.evaluate(g[_+1],M);g.splice(_,2);const z=l.calculate(O,d,f);g[_-1]=z===0?0:z}else _+=2}),l.evaluate(g[0],M)}},c.Parser.prototype[l.symbol]=!0,l.reference=function(M){return function(g){return g&&g[M]!==void 0?g[M]:null}},l.evaluate=function(M,g){return M===null?null:typeof M=="function"?M(g):M[l.symbol]?M.evaluate(g):M},l.single=function(M,g){if(M==="!")return!g;const y=-g;return y===0?0:y},l.calculate=function(M,g,y){if(M==="??")return l.exists(g)?g:y;if(typeof g=="string"||typeof y=="string"){if(M==="+")return(g=l.exists(g)?g:"")+(l.exists(y)?y:"")}else switch(M){case"^":return Math.pow(g,y);case"*":return g*y;case"/":return g/y;case"%":return g%y;case"+":return g+y;case"-":return g-y}switch(M){case"<":return g<y;case"<=":return g<=y;case">":return g>y;case">=":return g>=y;case"==":return g===y;case"!=":return g!==y;case"&&":return g&&y;case"||":return g||y}return null},l.exists=function(M){return M!=null}},978:(p,c,l)=>{const M=l(375),g=l(8571),y=l(1687),_=l(9621),O={};p.exports=function(d,f,z={}){if(M(d&&typeof d=="object","Invalid defaults value: must be an object"),M(!f||f===!0||typeof f=="object","Invalid source value: must be true, falsy or an object"),M(typeof z=="object","Invalid options: must be an object"),!f)return null;if(z.shallow)return O.applyToDefaultsWithShallow(d,f,z);const s=g(d);if(f===!0)return s;const h=z.nullOverride!==void 0&&z.nullOverride;return y(s,f,{nullOverride:h,mergeArrays:!1})},O.applyToDefaultsWithShallow=function(d,f,z){const s=z.shallow;M(Array.isArray(s),"Invalid keys");const h=new Map,A=f===!0?null:new Set;for(let L of s){L=Array.isArray(L)?L:L.split(".");const T=_(d,L);T&&typeof T=="object"?h.set(T,A&&_(f,L)||T):A&&A.add(L)}const q=g(d,{},h);if(!A)return q;for(const L of A)O.reachCopy(q,f,L);const v=z.nullOverride!==void 0&&z.nullOverride;return y(q,f,{nullOverride:v,mergeArrays:!1})},O.reachCopy=function(d,f,z){for(const A of z){if(!(A in f))return;const q=f[A];if(typeof q!="object"||q===null)return;f=q}const s=f;let h=d;for(let A=0;A<z.length-1;++A){const q=z[A];typeof h[q]!="object"&&(h[q]={}),h=h[q]}h[z[z.length-1]]=s}},375:(p,c,l)=>{const M=l(4213),g=l(8761),y=p.exports=function(_,...O){if(_)return;if(O.length===1&&O[0]instanceof Error)throw O[0];const d=O.filter(f=>f!=="").map(f=>typeof f=="string"?f:f instanceof Error?f.message:g(f));throw new M(d.join(" "),y)}},4213:p=>{p.exports=class extends Error{constructor(c,l){var M,g,y,_;super(c||"Unknown error"),M=this,y="AssertError",(g=typeof(_=function(O,d){if(typeof O!="object"||!O)return O;var f=O[Symbol.toPrimitive];if(f!==void 0){var z=f.call(O,"string");if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)}(g="name"))=="symbol"?_:String(_))in M?Object.defineProperty(M,g,{value:y,enumerable:!0,configurable:!0,writable:!0}):M[g]=y,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,l)}}},9367:p=>{const c={};p.exports=c.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=c.Bench.now()}elapsed(){return c.Bench.now()-this.ts}static now(){const l=process.hrtime();return 1e3*l[0]+l[1]/1e6}}},8630:(p,c,l)=>{const M=l(738);p.exports=function(){return new Promise(M)}},8571:(p,c,l)=>{const M=l(9621),g=l(4277),y=l(7043),_={needsProtoHack:new Set([g.set,g.map,g.weakSet,g.weakMap])};p.exports=_.clone=function(O,d={},f=null){if(typeof O!="object"||O===null)return O;let z=_.clone,s=f;if(d.shallow){if(d.shallow!==!0)return _.cloneWithShallow(O,d);z=v=>v}else if(s){const v=s.get(O);if(v)return v}else s=new Map;const h=g.getInternalProto(O);switch(h){case g.buffer:return(!1).from(O);case g.date:return new Date(O.getTime());case g.regex:case g.url:return new h.constructor(O)}const A=_.base(O,h,d);if(A===O)return O;if(s&&s.set(O,A),h===g.set)for(const v of O)A.add(z(v,d,s));else if(h===g.map)for(const[v,L]of O)A.set(v,z(L,d,s));const q=y.keys(O,d);for(const v of q){if(v==="__proto__")continue;if(h===g.array&&v==="length"){A.length=O.length;continue}const L=Object.getOwnPropertyDescriptor(O,v);L?L.get||L.set?Object.defineProperty(A,v,L):L.enumerable?A[v]=z(O[v],d,s):Object.defineProperty(A,v,{enumerable:!1,writable:!0,configurable:!0,value:z(O[v],d,s)}):Object.defineProperty(A,v,{enumerable:!0,writable:!0,configurable:!0,value:z(O[v],d,s)})}return A},_.cloneWithShallow=function(O,d){const f=d.shallow;(d=Object.assign({},d)).shallow=!1;const z=new Map;for(const s of f){const h=M(O,s);typeof h!="object"&&typeof h!="function"||z.set(h,h)}return _.clone(O,d,z)},_.base=function(O,d,f){if(f.prototype===!1)return _.needsProtoHack.has(d)?new d.constructor:d===g.array?[]:{};const z=Object.getPrototypeOf(O);if(z&&z.isImmutable)return O;if(d===g.array){const s=[];return z!==d&&Object.setPrototypeOf(s,z),s}if(_.needsProtoHack.has(d)){const s=new z.constructor;return z!==d&&Object.setPrototypeOf(s,z),s}return Object.create(z)}},1467:(p,c,l)=>{const M=l(375),g=l(9474),y=l(6064),_=l(7043),O={};p.exports=function(d,f,z={}){return typeof f!="object"&&(f=[f]),M(!Array.isArray(f)||f.length,"Values array cannot be empty"),typeof d=="string"?O.string(d,f,z):Array.isArray(d)?O.array(d,f,z):(M(typeof d=="object","Reference must be string or an object"),O.object(d,f,z))},O.array=function(d,f,z){if(Array.isArray(f)||(f=[f]),!d.length||z.only&&z.once&&d.length!==f.length)return!1;let s;const h=new Map;for(const L of f)if(z.deep&&L&&typeof L=="object"){var A;s=(A=s)!==null&&A!==void 0?A:O.compare(z);let T=!1;for(const[w,C]of h.entries())if(s(w,L)){++C.allowed,T=!0;break}T||h.set(L,{allowed:1,hits:0})}else{const T=h.get(L);T?++T.allowed:h.set(L,{allowed:1,hits:0})}let q=0;for(const L of d){let T;if(z.deep&&L&&typeof L=="object"){var v;s=(v=s)!==null&&v!==void 0?v:O.compare(z);for(const[w,C]of h.entries())if(s(w,L)){T=C;break}}else T=h.get(L);if(T&&(++T.hits,++q,z.once&&T.hits>T.allowed))return!1}if(z.only&&q!==d.length)return!1;for(const L of h.values())if(L.hits!==L.allowed&&L.hits<L.allowed&&!z.part)return!1;return!!q},O.object=function(d,f,z){M(z.once===void 0,"Cannot use option once with object");const s=_.keys(d,z);if(!s.length)return!1;if(Array.isArray(f))return O.array(s,f,z);const h=Object.getOwnPropertySymbols(f).filter(L=>f.propertyIsEnumerable(L)),A=[...Object.keys(f),...h],q=O.compare(z),v=new Set(A);for(const L of s)if(v.has(L)){if(!q(f[L],d[L]))return!1;v.delete(L)}else if(z.only)return!1;return!v.size||!!z.part&&v.size<A.length},O.string=function(d,f,z){if(d==="")return f.length===1&&f[0]===""||!z.once&&!f.some(L=>L!=="");const s=new Map,h=[];for(const L of f)if(M(typeof L=="string","Cannot compare string reference to non-string value"),L){const T=s.get(L);T?++T.allowed:(s.set(L,{allowed:1,hits:0}),h.push(y(L)))}else if(z.once||z.only)return!1;if(!h.length)return!0;const A=new RegExp(`(${h.join("|")})`,"g"),q=d.replace(A,(L,T)=>(++s.get(T).hits,""));if(z.only&&q)return!1;let v=!1;for(const L of s.values())if(L.hits&&(v=!0),L.hits!==L.allowed&&(L.hits<L.allowed&&!z.part||z.once))return!1;return!!v},O.compare=function(d){if(!d.deep)return O.shallow;const f=d.only!==void 0,z=d.part!==void 0,s={prototype:f?d.only:!!z&&!d.part,part:f?!d.only:!!z&&d.part};return(h,A)=>g(h,A,s)},O.shallow=function(d,f){return d===f}},9474:(p,c,l)=>{const M=l(4277),g={mismatched:null};p.exports=function(y,_,O){return O=Object.assign({prototype:!0},O),!!g.isDeepEqual(y,_,O,[])},g.isDeepEqual=function(y,_,O,d){if(y===_)return y!==0||1/y==1/_;const f=typeof y;if(f!==typeof _||y===null||_===null)return!1;if(f==="function"){if(!O.deepFunction||y.toString()!==_.toString())return!1}else if(f!=="object")return y!=y&&_!=_;const z=g.getSharedType(y,_,!!O.prototype);switch(z){case M.buffer:return!1;case M.promise:return y===_;case M.regex:case M.url:return y.toString()===_.toString();case g.mismatched:return!1}for(let s=d.length-1;s>=0;--s)if(d[s].isSame(y,_))return!0;d.push(new g.SeenEntry(y,_));try{return!!g.isDeepEqualObj(z,y,_,O,d)}finally{d.pop()}},g.getSharedType=function(y,_,O){if(O)return Object.getPrototypeOf(y)!==Object.getPrototypeOf(_)?g.mismatched:M.getInternalProto(y);const d=M.getInternalProto(y);return d!==M.getInternalProto(_)?g.mismatched:d},g.valueOf=function(y){const _=y.valueOf;if(_===void 0)return y;try{return _.call(y)}catch(O){return O}},g.hasOwnEnumerableProperty=function(y,_){return Object.prototype.propertyIsEnumerable.call(y,_)},g.isSetSimpleEqual=function(y,_){for(const O of Set.prototype.values.call(y))if(!Set.prototype.has.call(_,O))return!1;return!0},g.isDeepEqualObj=function(y,_,O,d,f){const{isDeepEqual:z,valueOf:s,hasOwnEnumerableProperty:h}=g,{keys:A,getOwnPropertySymbols:q}=Object;if(y===M.array){if(!d.part){if(_.length!==O.length)return!1;for(let R=0;R<_.length;++R)if(!z(_[R],O[R],d,f))return!1;return!0}for(const R of _)for(const S of O)if(z(R,S,d,f))return!0}else if(y===M.set){if(_.size!==O.size)return!1;if(!g.isSetSimpleEqual(_,O)){const R=new Set(Set.prototype.values.call(O));for(const S of Set.prototype.values.call(_)){if(R.delete(S))continue;let E=!1;for(const G of R)if(z(S,G,d,f)){R.delete(G),E=!0;break}if(!E)return!1}}}else if(y===M.map){if(_.size!==O.size)return!1;for(const[R,S]of Map.prototype.entries.call(_))if(S===void 0&&!Map.prototype.has.call(O,R)||!z(S,Map.prototype.get.call(O,R),d,f))return!1}else if(y===M.error&&(_.name!==O.name||_.message!==O.message))return!1;const v=s(_),L=s(O);if((_!==v||O!==L)&&!z(v,L,d,f))return!1;const T=A(_);if(!d.part&&T.length!==A(O).length&&!d.skip)return!1;let w=0;for(const R of T)if(d.skip&&d.skip.includes(R))O[R]===void 0&&++w;else if(!h(O,R)||!z(_[R],O[R],d,f))return!1;if(!d.part&&T.length-w!==A(O).length)return!1;if(d.symbols!==!1){const R=q(_),S=new Set(q(O));for(const E of R){var C;if((C=d.skip)===null||C===void 0||!C.includes(E)){if(h(_,E)){if(!h(O,E)||!z(_[E],O[E],d,f))return!1}else if(h(O,E))return!1}S.delete(E)}for(const E of S)if(h(O,E))return!1}return!0},g.SeenEntry=class{constructor(y,_){this.obj=y,this.ref=_}isSame(y,_){return this.obj===y&&this.ref===_}}},4168:(p,c,l)=>{const M=l(375);p.exports=function(g){return M(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(g),"Bad attribute value ("+g+")"),g.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}},5277:p=>{const c={};p.exports=function(l){if(!l)return"";let M="";for(let g=0;g<l.length;++g){const y=l.charCodeAt(g);c.isSafe(y)?M+=l[g]:M+=c.escapeHtmlChar(y)}return M},c.escapeHtmlChar=function(l){return c.namedHtml.get(l)||(l>=256?"&#"+l+";":`&#x${l.toString(16).padStart(2,"0")};`)},c.isSafe=function(l){return c.safeCharCodes.has(l)},c.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),c.safeCharCodes=function(){const l=new Set;for(let M=32;M<123;++M)(M>=97||M>=65&&M<=90||M>=48&&M<=57||M===32||M===46||M===44||M===45||M===58||M===95)&&l.add(M);return l}()},7973:p=>{const c={};p.exports=function(l){return l?l.replace(/[<>&\u2028\u2029]/g,c.escape):""},c.escape=function(l){return c.replacements.get(l)},c.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])},6064:p=>{p.exports=function(c){return c.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},655:p=>{const c={};p.exports=c.flatten=function(l,M){const g=M||[];for(const y of l)Array.isArray(y)?c.flatten(y,g):g.push(y);return g}},738:p=>{p.exports=function(){}},8870:(p,c,l)=>{c.applyToDefaults=l(978),c.assert=l(375),c.AssertError=l(4213),c.Bench=l(9367),c.block=l(8630),c.clone=l(8571),c.contain=l(1467),c.deepEqual=l(9474),c.escapeHeaderAttribute=l(4168),c.escapeHtml=l(5277),c.escapeJson=l(7973),c.escapeRegex=l(6064),c.flatten=l(655),c.ignore=l(738),c.intersect=l(5088),c.isPromise=l(7259),c.merge=l(1687),c.once=l(5022),c.reach=l(9621),c.reachTemplate=l(4069),c.stringify=l(8761),c.wait=l(2620)},5088:p=>{const c={};p.exports=function(l,M,g={}){if(!l||!M)return g.first?null:[];const y=[],_=Array.isArray(l)?new Set(l):l,O=new Set;for(const d of M)if(c.has(_,d)&&!O.has(d)){if(g.first)return d;y.push(d),O.add(d)}return g.first?null:y},c.has=function(l,M){return typeof l.has=="function"?l.has(M):l[M]!==void 0}},7259:p=>{p.exports=function(c){return typeof c?.then=="function"}},1687:(p,c,l)=>{const M=l(375),g=l(8571),y=l(7043),_={};p.exports=_.merge=function(O,d,f){if(M(O&&typeof O=="object","Invalid target value: must be an object"),M(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return O;if(f=Object.assign({nullOverride:!0,mergeArrays:!0},f),Array.isArray(d)){M(Array.isArray(O),"Cannot merge array onto an object"),f.mergeArrays||(O.length=0);for(let s=0;s<d.length;++s)O.push(g(d[s],{symbols:f.symbols}));return O}const z=y.keys(d,f);for(let s=0;s<z.length;++s){const h=z[s];if(h==="__proto__"||!Object.prototype.propertyIsEnumerable.call(d,h))continue;const A=d[h];if(A&&typeof A=="object"){if(O[h]===A)continue;!O[h]||typeof O[h]!="object"||Array.isArray(O[h])!==Array.isArray(A)||A instanceof Date||A instanceof RegExp?O[h]=g(A,{symbols:f.symbols}):_.merge(O[h],A,f)}else(A!=null||f.nullOverride)&&(O[h]=A)}return O}},5022:p=>{const c=Symbol("wrapped");p.exports=function(l){if(l[c])return l;let M=!1;const g=function(...y){M||(M=!0,l(...y))};return g[c]=!0,g}},9621:(p,c,l)=>{const M=l(375),g={};p.exports=function(y,_,O){if(_===!1||_==null)return y;typeof(O=O||{})=="string"&&(O={separator:O});const d=Array.isArray(_);M(!d||!O.separator,"Separator option is not valid for array-based chain");const f=d?_:_.split(O.separator||".");let z=y;for(let s=0;s<f.length;++s){let h=f[s];const A=O.iterables&&g.iterables(z);if(Array.isArray(z)||A==="set"){const q=Number(h);Number.isInteger(q)&&(h=q<0?z.length+q:q)}if(!z||typeof z=="function"&&O.functions===!1||!A&&z[h]===void 0){M(!O.strict||s+1===f.length,"Missing segment",h,"in reach path ",_),M(typeof z=="object"||O.functions===!0||typeof z!="function","Invalid segment",h,"in reach path ",_),z=O.default;break}z=A?A==="set"?[...z][h]:z.get(h):z[h]}return z},g.iterables=function(y){return y instanceof Set?"set":y instanceof Map?"map":void 0}},4069:(p,c,l)=>{const M=l(9621);p.exports=function(g,y,_){return y.replace(/{([^{}]+)}/g,(O,d)=>{const f=M(g,d,_);return f??""})}},8761:p=>{p.exports=function(...c){try{return JSON.stringify(...c)}catch(l){return"[Cannot display object: "+l.message+"]"}}},4277:(p,c)=>{const l={};c=p.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,url:URL.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},l.typeMap=new Map([["[object Error]",c.error],["[object Map]",c.map],["[object Promise]",c.promise],["[object Set]",c.set],["[object URL]",c.url],["[object WeakMap]",c.weakMap],["[object WeakSet]",c.weakSet]]),c.getInternalProto=function(M){if(Array.isArray(M))return c.array;if(M instanceof Date)return c.date;if(M instanceof RegExp)return c.regex;if(M instanceof Error)return c.error;const g=Object.prototype.toString.call(M);return l.typeMap.get(g)||c.generic}},7043:(p,c)=>{c.keys=function(l,M={}){return M.symbols!==!1?Reflect.ownKeys(l):Object.getOwnPropertyNames(l)}},2620:p=>{p.exports=function(c,l,M){if(typeof c=="bigint"&&(c=Number(c)),c>=Number.MAX_SAFE_INTEGER&&(c=1/0),typeof c!="number"&&c!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(g=>{const y=M?M.setTimeout:setTimeout,_=()=>{const O=Math.min(c,2147483647);c-=O,y(()=>c>0?_():g(l),O)};c!==1/0&&_()})}},7593:(p,c)=>{c.location=function(l=0){const M=Error.prepareStackTrace;Error.prepareStackTrace=(_,O)=>O;const g={};Error.captureStackTrace(g,this);const y=g.stack[l+1];return Error.prepareStackTrace=M,{filename:y.getFileName(),line:y.getLineNumber()}}},6264:(p,c,l)=>{l.r(c),l.d(c,{tlds:()=>M});const M=new Set(["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].map(g=>g.toLowerCase()))},3652:(p,c,l)=>{const{assert:M}=l(8870),g={};c.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(y,_){var O,d,f,z,s;_=(O=_)!==null&&O!==void 0?O:{};const h=[].concat((d=_.before)!==null&&d!==void 0?d:[]),A=[].concat((f=_.after)!==null&&f!==void 0?f:[]),q=(z=_.group)!==null&&z!==void 0?z:"?",v=(s=_.sort)!==null&&s!==void 0?s:0;M(!h.includes(q),`Item cannot come before itself: ${q}`),M(!h.includes("?"),"Item cannot come before unassociated items"),M(!A.includes(q),`Item cannot come after itself: ${q}`),M(!A.includes("?"),"Item cannot come after unassociated items"),Array.isArray(y)||(y=[y]);for(const L of y){const T={seq:this._items.length,sort:v,before:h,after:A,group:q,node:L};this._items.push(T)}if(!_.manual){const L=this._sort();M(L,"item",q!=="?"?`added into group ${q}`:"","created a dependencies error")}return this.nodes}merge(y){Array.isArray(y)||(y=[y]);for(const O of y)if(O)for(const d of O._items)this._items.push(Object.assign({},d));this._items.sort(g.mergeSort);for(let O=0;O<this._items.length;++O)this._items[O].seq=O;const _=this._sort();return M(_,"merge created a dependencies error"),this.nodes}sort(){const y=this._sort();return M(y,"sort created a dependencies error"),this.nodes}_sort(){const y={},_=Object.create(null),O=Object.create(null);for(const L of this._items){var d;const T=L.seq,w=L.group;O[w]=(d=O[w])!==null&&d!==void 0?d:[],O[w].push(T),y[T]=L.before;for(const C of L.after){var f;_[C]=(f=_[C])!==null&&f!==void 0?f:[],_[C].push(T)}}for(const L in y){const T=[];for(const w in y[L]){var z;const C=y[L][w];O[C]=(z=O[C])!==null&&z!==void 0?z:[],T.push(...O[C])}y[L]=T}for(const L in _)if(O[L])for(const T of O[L])y[T].push(..._[L]);const s={};for(const L in y){const T=y[L];for(const w of T){var h;s[w]=(h=s[w])!==null&&h!==void 0?h:[],s[w].push(L)}}const A={},q=[];for(let L=0;L<this._items.length;++L){let T=L;if(s[L]){T=null;for(let w=0;w<this._items.length;++w){if(A[w]===!0)continue;s[w]||(s[w]=[]);const C=s[w].length;let R=0;for(let S=0;S<C;++S)A[s[w][S]]&&++R;if(R===C){T=w;break}}}T!==null&&(A[T]=!0,q.push(T))}if(q.length!==this._items.length)return!1;const v={};for(const L of this._items)v[L.seq]=L;this._items=[],this.nodes=[];for(const L of q){const T=v[L];this.nodes.push(T.node),this._items.push(T)}return!0}},g.mergeSort=(y,_)=>y.sort===_.sort?0:y.sort<_.sort?-1:1},1275:()=>{},3975:()=>{},5934:p=>{p.exports=JSON.parse('{"version":"17.11.0"}')}},n={};function a(p){var c=n[p];if(c!==void 0)return c.exports;var l=n[p]={exports:{}};return o[p](l,l.exports,a),l.exports}return a.n=p=>{var c=p&&p.__esModule?()=>p.default:()=>p;return a.d(c,{a:c}),c},a.d=(p,c)=>{for(var l in c)a.o(c,l)&&!a.o(p,l)&&Object.defineProperty(p,l,{enumerable:!0,get:c[l]})},a.o=(p,c)=>Object.prototype.hasOwnProperty.call(p,c),a.r=p=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})},a(5107)})())})(Ju);var eA=Ju.exports;const u=CM(eA);var oo={},tA={},Ya={},es={},R1={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ALL_FRONTEND_FEATURES=Jt.supportedAggregatesConstants=Jt.timeDimensionsConstants=Jt.supportedOperatorsConstants=void 0;Jt.supportedOperatorsConstants={">":{publicName:"Greater than",validDataTypes:["number","date_time"]},"<":{publicName:"Less than",validDataTypes:["number","date_time"]},"<=":{publicName:"Less than or equal to",validDataTypes:["number","date_time"]},">=":{publicName:"Greater than or equal to",validDataTypes:["number","date_time"]},"!=":{publicName:"Not equal to",validDataTypes:["number","date_time","boolean","string"]},is_one_of:{publicName:"Is one of",validDataTypes:["number","date_time","boolean","string"]},"=":{publicName:"Equal to",validDataTypes:["number","date_time","boolean","string"]},is_not_one_of:{publicName:"Is not one of",validDataTypes:["number","date_time","boolean","string"]},starts_with:{publicName:"Starts with",validDataTypes:["string"]},ends_with:{publicName:"Ends with",validDataTypes:["string"]},contains_substring:{publicName:"Contains text",validDataTypes:["string"]},does_not_contain_substring:{publicName:"Does not contain text",validDataTypes:["string"]},array_contains:{publicName:"Contains",validDataTypes:["string[]"]},array_does_not_contain:{publicName:"Does not contain",validDataTypes:["string[]"]},array_contains_any_of:{publicName:"Contains any of",validDataTypes:["string[]"]},array_contains_all_of:{publicName:"Contains all of",validDataTypes:["string[]"]}};Jt.timeDimensionsConstants={month:{publicName:"Monthly",dateFormat:"MMMM YYYY",dataTypeOutput:"date_time"},year:{publicName:"Yearly",dateFormat:"YYYY",dataTypeOutput:"date_time"},quarter:{publicName:"Per quarter",dateFormat:"quarter",dataTypeOutput:"date_time"},week:{publicName:"Weekly",dateFormat:"week",dataTypeOutput:"date_time"},day:{publicName:"Daily",dateFormat:"DD-MM-YYYY",dataTypeOutput:"date_time"},hourOfDayOnly:{publicName:"Hour of day",dateFormat:"hour_of_day",dataTypeOutput:"date_time"},weekOfYearOnly:{publicName:"Week of year",dateFormat:"week_of_year",dataTypeOutput:"number"},dayOfWeekOnly:{publicName:"Day of week",dateFormat:"day_of_week_iso",dataTypeOutput:"number"},monthOfYearOnly:{publicName:"Month of year",dateFormat:"month_of_year",dataTypeOutput:"number"},dayOfMonthOnly:{publicName:"Day of month",dateFormat:"day_of_month",dataTypeOutput:"number"},second:{publicName:"Per second",dateFormat:"hh:mm:ss",dataTypeOutput:"date_time"},hour:{publicName:"Hourly",dateFormat:"hh:mm",dataTypeOutput:"date_time"},minute:{publicName:"Per minute",dateFormat:"hh:mm",dataTypeOutput:"date_time"}};Jt.supportedAggregatesConstants={mean:{publicName:"Mean",validDataTypes:["number"]},sum:{publicName:"Sum",validDataTypes:["number"]},min:{publicName:"Min",validDataTypes:["number","date_time"]},max:{publicName:"Max",validDataTypes:["number","date_time"]},count:{publicName:"Count",validDataTypes:["string","number","boolean","date_time","string[]"]},countDistinct:{publicName:"Unique",validDataTypes:["string","number","boolean","date_time"]},median:{publicName:"Median",validDataTypes:["number"]},percentile25:{publicName:"25th percentile",validDataTypes:["number"]},percentile75:{publicName:"75th percentile",validDataTypes:["number"]},percentile90:{publicName:"90th percentile",validDataTypes:["number"]},percentile95:{publicName:"95th percentile",validDataTypes:["number"]},percentile99:{publicName:"99th percentile",validDataTypes:["number"]}};Jt.ALL_FRONTEND_FEATURES=["formatter:monthOfYearOnly"];Object.defineProperty(R1,"__esModule",{value:!0});R1.validOperatorsForField=R1.ALL_SUPPORTED_CONSTANTS=R1.isSupportedTimeTruncFunction=R1.isSupportedAggregate=R1.isSupportedAggregateFunction=R1.supportedAggregates=R1.supportedTimeTruncFunctions=R1.supportedOperators=R1.supportedAggregatesFunction=R1.supportedTransformationFunctions=void 0;const ts=_0,g2=Jt,eg={round_to_0_dp:{publicName:"Round to 0dp",validDataTypes:["number"]},round_to_2_dp:{publicName:"Round to 2dp",validDataTypes:["number"]}},tg=t=>{const e=(0,ts.cloneDeep)(eg);if(!t)return e;let o={};return t.forEach(n=>{if(!e[n])throw`Transformation function ${n} is not managed by Vizzly`;o[n]=e[n]}),o};R1.supportedTransformationFunctions=tg;const og=(t,e,o)=>{const n=t.supportedAggregates,a=Object.keys(n).filter(c=>n[c].validDataTypes.includes(e));let p=o&&o.length>0?o.filter(c=>a.includes(c)):a;return o&&o.length>0&&p.length===0&&(p=a),p};R1.supportedAggregatesFunction=og;const ig=t=>{const e=(0,ts.cloneDeep)(g2.supportedOperatorsConstants);if(!t)return e;let o={};return t.forEach(n=>{if(!g2.supportedOperatorsConstants[n])throw`Operator ${n} not managed by Vizzly`;o[n]=g2.supportedOperatorsConstants[n]}),o};R1.supportedOperators=ig;const ng=t=>{const e=(0,ts.cloneDeep)(g2.timeDimensionsConstants);if(!t)return e;let o={};return t.forEach(n=>{if(!e[n])throw`Time trunc function ${n} not managed by Vizzly`;o[n]=e[n]}),o};R1.supportedTimeTruncFunctions=ng;const rg=t=>{const e=(0,ts.cloneDeep)(g2.supportedAggregatesConstants);if(!t)return e;let o={};return t.forEach(n=>{if(!e[n])throw`Aggregate ${n} not managed by Vizzly`;o[n]=e[n]}),o};R1.supportedAggregates=rg;const ag=(t,e)=>[...Object.keys(t),"none"].includes(e);R1.isSupportedAggregateFunction=ag;const pg=(t,e)=>typeof t!="string"?!1:e.hasOwnProperty(t);R1.isSupportedAggregate=pg;const bg=(t,e)=>[...Object.keys(t),"none"].includes(e);R1.isSupportedTimeTruncFunction=bg;R1.ALL_SUPPORTED_CONSTANTS=[{namespace:"config.supported_operator",constants:g2.supportedOperatorsConstants},{namespace:"config.supported_aggregate",constants:g2.supportedAggregatesConstants},{namespace:"config.supported_time",constants:g2.timeDimensionsConstants}];const Mg=(t,e)=>{let o=[...Object.keys(e.supportedOperators)];return o=o.filter(n=>g2.supportedOperatorsConstants[n].validDataTypes.includes(t.dataType)),o};R1.validOperatorsForField=Mg;Object.defineProperty(es,"__esModule",{value:!0});es.queryEngineConfig=void 0;const Hb=R1,sg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Hb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second","dayOfMonthOnly","dayOfWeekOnly","weekOfYearOnly","monthOfYearOnly"]),supportedAggregates:(0,Hb.supportedAggregates)(["sum","mean","median","min","max","count","countDistinct","percentile25","percentile75","percentile90","percentile95","percentile99"]),supportedOperators:(0,Hb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,Hb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});es.queryEngineConfig=sg;var os={};Object.defineProperty(os,"__esModule",{value:!0});os.queryEngineConfig=void 0;const Yb=R1,cg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Yb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:(0,Yb.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,Yb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,Yb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});os.queryEngineConfig=cg;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.queryEngineConfig=void 0;const Kb=R1,zg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Kb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second","dayOfMonthOnly","weekOfYearOnly","monthOfYearOnly"]),supportedAggregates:(0,Kb.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,Kb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,Kb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});is.queryEngineConfig=zg;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.queryEngineConfig=void 0;const Qb=R1,Og=()=>{var t;return typeof process>"u"?!1:((t=process.env.VIZZLY_MICROSOFT_FLAVOR)===null||t===void 0?void 0:t.toUpperCase())==="KUSTO"},lg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Qb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute",...Og()?[]:["second"]]),supportedAggregates:(0,Qb.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,Qb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,Qb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});ns.queryEngineConfig=lg;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});rs.queryEngineConfig=void 0;const Zb=R1,ug=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","switchField","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Zb.supportedTimeTruncFunctions)(["month","year","day","hour","minute","second"]),supportedAggregates:(0,Zb.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,Zb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:(0,Zb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});rs.queryEngineConfig=ug;var as={};Object.defineProperty(as,"__esModule",{value:!0});as.queryEngineConfig=void 0;const Jb=R1,Ag=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Jb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second","dayOfMonthOnly","dayOfWeekOnly","weekOfYearOnly","hourOfDayOnly","monthOfYearOnly"]),supportedAggregates:(0,Jb.supportedAggregates)(["sum","mean","median","min","max","count","countDistinct","percentile25","percentile75","percentile90","percentile95","percentile99"]),supportedOperators:(0,Jb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain","array_contains_any_of","array_contains_all_of"]),supportedTransformationFunctions:(0,Jb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});as.queryEngineConfig=Ag;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.queryEngineConfig=void 0;const eM=R1,dg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,eM.supportedTimeTruncFunctions)(["month","year","day","hour","minute","second"]),supportedAggregates:(0,eM.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,eM.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:(0,eM.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});ps.queryEngineConfig=dg;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.localQueryEngineConfig=void 0;const tM=R1;bs.localQueryEngineConfig={origin:"in-browser",supportedFeatures:["simpleMaths","aggregateMaths","subquery","encryptedDashboards","switchField","roundedNumbers","encryptedDashboards","dateMaths"],supportedTimeTruncFunctions:(0,tM.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:(0,tM.supportedAggregates)(["sum","mean","min","max","count","countDistinct","median"]),supportedOperators:(0,tM.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,tM.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])};var fg=z0&&z0.__createBinding||(Object.create?function(t,e,o,n){n===void 0&&(n=o);var a=Object.getOwnPropertyDescriptor(e,o);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,a)}:function(t,e,o,n){n===void 0&&(n=o),t[n]=e[o]}),qg=z0&&z0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ji=z0&&z0.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(o){var n=[];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[n.length]=a);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var o={};if(e!=null)for(var n=t(e),a=0;a<n.length;a++)n[a]!=="default"&&fg(o,e,n[a]);return qg(o,e),o}}();Object.defineProperty(Ya,"__esModule",{value:!0});Ya.getQueryEngineConfig=void 0;const hg=ji(es),Wg=ji(os),mg=ji(is),gg=ji(ns),yg=ji(rs),Rg=ji(as),vg=ji(ps),Lg=bs,_g=t=>{switch(t){case"js":return Lg.localQueryEngineConfig;case"postgres":return hg.queryEngineConfig();case"redshift":return Wg.queryEngineConfig();case"bigquery":return mg.queryEngineConfig();case"mariadb":return yg.queryEngineConfig();case"snowflake":return Rg.queryEngineConfig();case"mysql":return vg.queryEngineConfig();case"microsoftSQLServer":return gg.queryEngineConfig();case"SQLite":throw"SQLite not support via the query engine"}};Ya.getQueryEngineConfig=_g;var Ms={};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.merge=void 0;const Uz=_0,Ng=(...t)=>t.reduce((e,o)=>{const n=a=>{let p=e[a],c=o[a];if(typeof p=="object"&&typeof c=="object"){const l=(0,Uz.intersection)(Object.keys(p),Object.keys(c));return(0,Uz.pick)(o[a],l)}throw"Cannot intersect non-object type in mapIntersection function."};return{origin:"query-engine",supportedAggregates:n("supportedAggregates"),supportedFeatures:(0,Uz.intersection)(e.supportedFeatures,o.supportedFeatures),supportedOperators:n("supportedOperators"),supportedTimeTruncFunctions:n("supportedTimeTruncFunctions"),supportedTransformationFunctions:n("supportedTransformationFunctions")}},t[0]);Ms.merge=Ng;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.removeUnsupportedFeatures=void 0;const Tg=_0,xg=(t,e)=>{const o=(0,Tg.cloneDeep)(t);return e.includes("formatter:monthOfYearOnly")||delete o.supportedTimeTruncFunctions.monthOfYearOnly,o};ss.removeUnsupportedFeatures=xg;(function(t){var e=z0&&z0.__createBinding||(Object.create?function(p,c,l,M){M===void 0&&(M=l);var g=Object.getOwnPropertyDescriptor(c,l);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(p,M,g)}:function(p,c,l,M){M===void 0&&(M=l),p[M]=c[l]}),o=z0&&z0.__setModuleDefault||(Object.create?function(p,c){Object.defineProperty(p,"default",{enumerable:!0,value:c})}:function(p,c){p.default=c}),n=z0&&z0.__exportStar||function(p,c){for(var l in p)l!=="default"&&!Object.prototype.hasOwnProperty.call(c,l)&&e(c,p,l)},a=z0&&z0.__importStar||function(){var p=function(c){return p=Object.getOwnPropertyNames||function(l){var M=[];for(var g in l)Object.prototype.hasOwnProperty.call(l,g)&&(M[M.length]=g);return M},p(c)};return function(c){if(c&&c.__esModule)return c;var l={};if(c!=null)for(var M=p(c),g=0;g<M.length;g++)M[g]!=="default"&&e(l,c,M[g]);return o(l,c),l}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Support=t.Constants=void 0,n(Ya,t),n(Ms,t),t.Constants=a(Jt),t.Support=a(R1),n(ss,t)})(tA);var oA={},iA={},$o={},nA={},ha={},CO={};Object.defineProperty(CO,"__esModule",{value:!0});CO.default={JSONB:{normalizedType:"string"},UUID:{normalizedType:"string"},DECIMAL:{normalizedType:"number"},NUMERIC:{normalizedType:"number"},INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},DOUBLEPRECISION:{normalizedType:"number",castAs:"DOUBLE PRECISION"},"DOUBLE PRECISION":{normalizedType:"number"},REAL:{normalizedType:"number"},FLOAT:{normalizedType:"number"},NUMBER:{normalizedType:"number"},BINARY:{normalizedType:"string"},VARBINARY:{normalizedType:"string"},CHAR:{normalizedType:"string"},CHARACTER:{normalizedType:"string"},"CHARACTER VARYING":{normalizedType:"string"},TEXT:{normalizedType:"string"},VARCHAR:{normalizedType:"string"},TIME:{normalizedType:"date_time"},DATE:{normalizedType:"date_time"},TIMESTAMP_LTZ:{normalizedType:"date_time"},TIMESTAMP_NTZ:{normalizedType:"date_time"},TIMESTAMP_TZ:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"},BOOLEAN:{normalizedType:"boolean"},"TIMESTAMP WITH TIME ZONE":{normalizedType:"date_time"},"TIMESTAMP WITHOUT TIME ZONE":{normalizedType:"date_time"},ARRAY:{normalizedType:"string[]"}};var Sg=z0&&z0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ha,"__esModule",{value:!0});ha.NATIVE_DATA_TYPES_DATABASE=void 0;const Bg=Sg(CO);ha.NATIVE_DATA_TYPES_DATABASE={microsoftSQLServer:{INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},NUMERIC:{normalizedType:"number"},BIT:{normalizedType:"number"},SMALLINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},DECIMAL:{normalizedType:"number"},SMALLMONEY:{normalizedType:"number"},TINYINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},MONEY:{normalizedType:"number"},FLOAT:{normalizedType:"number"},REAL:{normalizedType:"number"},DATE:{normalizedType:"date_time"},DATETIME2:{normalizedType:"date_time"},SMALLDATETIME:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIME:{normalizedType:"date_time"},UNIQUEIDENTIFIER:{normalizedType:"string"},CHAR:{normalizedType:"string"},VARCHAR:{normalizedType:"string"},TEXT:{normalizedType:"string",castAs:"VARCHAR(8000)"},NCHAR:{normalizedType:"string"},NVARCHAR:{normalizedType:"string"},NTEXT:{normalizedType:"string"},BINARY:{normalizedType:"string"},VARBINARY:{normalizedType:"string"}},bigquery:{INT64:{normalizedType:"number",numberCanOnlyBeInteger:!0},FLOAT64:{normalizedType:"number"},NUMERIC:{normalizedType:"number"},BIGNUMERIC:{normalizedType:"number"},STRING:{normalizedType:"string"},DATE:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"},BOOL:{normalizedType:"boolean"},"ARRAY<STRING>":{normalizedType:"string[]"}},elasticsearch:{date_time:{normalizedType:"date_time"},number:{normalizedType:"number"},string:{normalizedType:"string"},boolean:{normalizedType:"boolean"}},mariadb:{TINYINT:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},MEDIUMINT:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},DECIMAL:{normalizedType:"number"},FLOAT:{normalizedType:"number"},DOUBLE:{normalizedType:"number"},VARCHAR:{normalizedType:"string",castAs:"CHAR"},TEXT:{normalizedType:"string",castAs:"CHAR"},TINYTEXT:{normalizedType:"string",castAs:"CHAR"},CHAR:{normalizedType:"string"},MEDIUMTEXT:{normalizedType:"string",castAs:"CHAR"},LONGTEXT:{normalizedType:"string",castAs:"CHAR"},DATE:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time",castAs:"DATETIME"},BOOLEAN:{normalizedType:"boolean",castAs:null},BOOL:{normalizedType:"boolean",castAs:null}},postgres:Bg.default,SQLite:{BOOLEAN:{normalizedType:"boolean"},NULL:{normalizedType:"string"},INTEGER:{normalizedType:"number",numberCanOnlyBeInteger:!0},REAL:{normalizedType:"number"},DECIMAL:{normalizedType:"number"},CHAR:{normalizedType:"string"},TEXT:{normalizedType:"string"},DATE:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"}},snowflake:{FIXED:{normalizedType:"number"},DECIMAL:{normalizedType:"number"},NUMERIC:{normalizedType:"number"},INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},TINYINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},BYTEINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},FLOAT:{normalizedType:"number"},FLOAT4:{normalizedType:"number"},FLOAT8:{normalizedType:"number"},DOUBLE:{normalizedType:"number"},DOUBLEPRECISION:{normalizedType:"number",castAs:"DOUBLE PRECISION"},"DOUBLE PRECISION":{normalizedType:"number"},REAL:{normalizedType:"number"},NUMBER:{normalizedType:"number"},BINARY:{normalizedType:"string"},VARBINARY:{normalizedType:"string"},CHAR:{normalizedType:"string"},CHARACTER:{normalizedType:"string"},"CHARACTER VARYING":{normalizedType:"string"},TEXT:{normalizedType:"string"},VARCHAR:{normalizedType:"string"},STRING:{normalizedType:"string"},TIME:{normalizedType:"date_time"},DATE:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIMESTAMP_LTZ:{normalizedType:"date_time"},TIMESTAMP_NTZ:{normalizedType:"date_time"},TIMESTAMP_TZ:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"},BOOLEAN:{normalizedType:"boolean"},ARRAY:{normalizedType:"string[]"},VARIANT:{normalizedType:"string"}},mysql:{TINYINT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},MEDIUMINT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},INT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},DECIMAL:{normalizedType:"number",castAs:"DECIMAL(65, 10)"},FLOAT:{normalizedType:"number",castAs:"DECIMAL(65, 10)"},DOUBLE:{normalizedType:"number",castAs:"DECIMAL(65, 10)"},CHAR:{normalizedType:"string",castAs:"CHAR"},VARCHAR:{normalizedType:"string",castAs:"CHAR"},TEXT:{normalizedType:"string",castAs:"CHAR"},TINYTEXT:{normalizedType:"string",castAs:"CHAR"},MEDIUMTEXT:{normalizedType:"string",castAs:"CHAR"},LONGTEXT:{normalizedType:"string",castAs:"CHAR"},DATE:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time",castAs:"DATETIME"},BOOLEAN:{normalizedType:"boolean"},BOOL:{normalizedType:"boolean"}},redshift:{SUPER:{normalizedType:"string[]"},UUID:{normalizedType:"string"},DECIMAL:{normalizedType:"number"},NUMERIC:{normalizedType:"number"},INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},DOUBLEPRECISION:{normalizedType:"number",castAs:"DOUBLE PRECISION"},"DOUBLE PRECISION":{normalizedType:"number"},REAL:{normalizedType:"number"},FLOAT:{normalizedType:"number"},NUMBER:{normalizedType:"number"},BINARY:{normalizedType:"string"},VARBINARY:{normalizedType:"string"},CHAR:{normalizedType:"string"},CHARACTER:{normalizedType:"string"},"CHARACTER VARYING":{normalizedType:"string"},TEXT:{normalizedType:"string"},VARCHAR:{normalizedType:"string"},TIME:{normalizedType:"date_time"},DATE:{normalizedType:"date_time"},TIMESTAMP_LTZ:{normalizedType:"date_time"},TIMESTAMP_NTZ:{normalizedType:"date_time"},TIMESTAMP_TZ:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"},BOOLEAN:{normalizedType:"boolean"},"TIMESTAMP WITH TIME ZONE":{normalizedType:"date_time"},"TIMESTAMP WITHOUT TIME ZONE":{normalizedType:"date_time"},ARRAY:{normalizedType:"string[]"}}};var rA={},aA={};Object.defineProperty(aA,"__esModule",{value:!0});var pA={};Object.defineProperty(pA,"__esModule",{value:!0});var bA={};Object.defineProperty(bA,"__esModule",{value:!0});(function(t){var e=z0&&z0.__createBinding||(Object.create?function(n,a,p,c){c===void 0&&(c=p);var l=Object.getOwnPropertyDescriptor(a,p);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[p]}}),Object.defineProperty(n,c,l)}:function(n,a,p,c){c===void 0&&(c=p),n[c]=a[p]}),o=z0&&z0.__exportStar||function(n,a){for(var p in n)p!=="default"&&!Object.prototype.hasOwnProperty.call(a,p)&&e(a,n,p)};Object.defineProperty(t,"__esModule",{value:!0}),o(aA,t),o(pA,t),o(bA,t)})(rA);var ir={},cs={};Object.defineProperty(cs,"__esModule",{value:!0});class wg extends Error{constructor(e){super(`Field with ID ${e} does not exist in the data set.`),this.name="MissingField",this.fieldId=e}}cs.default=wg;var Cg=z0&&z0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ir,"__esModule",{value:!0});ir.findFieldById=ir.fromTable=void 0;const Xg=Cg(cs),Eg=_0,Dg=t=>{let e=(0,Eg.find)(t.fields||[],n=>"address"in n);return(t.joins||[]).length==0?e.address:t.joins[0].left};ir.fromTable=Dg;const Ig=(t,e)=>{const o=t.fields.find(n=>n.id==e);if(!o)throw new Xg.default(e);return o};ir.findFieldById=Ig;var MA={},zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.upCastQuery=void 0;const XO=_0,Wa=t=>(0,XO.isArray)(t)?{type:"orWhere",value:t.map(e=>({type:"andWhere",value:e.map(o=>(o.field.type==="subquery"&&(o.field.value.filter=Wa(o.field.value.filter)),{type:"where",value:o}))}))}:t,sM=t=>{if(t.type==="subquery"){const e=(0,XO.isArray)(t.value.filter)?Wa(t.value.filter):t.value.filter;return Object.assign(Object.assign({},t),{value:{measure:t.value.measure.map(sM),filter:e}})}else{if(t.type==="maths")return{left:sM(t.left),right:sM(t.right),op:t.op,type:t.type};if(!("type"in t))return{type:"field",value:t.field,function:t?.function||"none"}}return t},Pg=t=>Object.assign(Object.assign({},t),{measure:t.measure.map(e=>sM(e)),filter:(0,XO.isArray)(t.filter)?Wa(t.filter):t.filter,type:"query"}),Fg=t=>{if(t.preparedQueryType==="preAggregated"){const e={};return Object.keys(t.filter).forEach(o=>{e[o]=Wa(t.filter[o])}),Object.assign(Object.assign({},t),{filter:e})}return Object.assign(Object.assign({},t),{filter:Wa(t.filter)})},kg=t=>t.type==="preparedQuery"?Fg(t):Pg(t);zs.upCastQuery=kg;(function(t){var e=z0&&z0.__createBinding||(Object.create?function(n,a,p,c){c===void 0&&(c=p);var l=Object.getOwnPropertyDescriptor(a,p);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[p]}}),Object.defineProperty(n,c,l)}:function(n,a,p,c){c===void 0&&(c=p),n[c]=a[p]}),o=z0&&z0.__exportStar||function(n,a){for(var p in n)p!=="default"&&!Object.prototype.hasOwnProperty.call(a,p)&&e(a,n,p)};Object.defineProperty(t,"__esModule",{value:!0}),o(zs,t)})(MA);var sA={};(function(t){var e=z0&&z0.__createBinding||(Object.create?function(n,a,p,c){c===void 0&&(c=p);var l=Object.getOwnPropertyDescriptor(a,p);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[p]}}),Object.defineProperty(n,c,l)}:function(n,a,p,c){c===void 0&&(c=p),n[c]=a[p]}),o=z0&&z0.__exportStar||function(n,a){for(var p in n)p!=="default"&&!Object.prototype.hasOwnProperty.call(a,p)&&e(a,n,p)};Object.defineProperty(t,"__esModule",{value:!0}),o(cs,t)})(sA);var Os={};Object.defineProperty(Os,"__esModule",{value:!0});Os.lowestCommonGranularity=void 0;const Vz=[void 0,null,"none","truncSecond","second","truncMinute","minute","truncHour","hour","truncDay","day","truncWeek","week","truncMonth","month","truncQuarter","quarter","truncYear","year"],jg=(...t)=>t.includes(void 0)||t.includes(null)||t.some(e=>!Vz.includes(e))?"none":t.sort((e,o)=>{const n=Vz.indexOf(e),a=Vz.indexOf(o);return n===-1||a===-1?0:n-a})[0];Os.lowestCommonGranularity=jg;(function(t){var e=z0&&z0.__createBinding||(Object.create?function(l,M,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(M,g);(!_||("get"in _?!M.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return M[g]}}),Object.defineProperty(l,y,_)}:function(l,M,g,y){y===void 0&&(y=g),l[y]=M[g]}),o=z0&&z0.__setModuleDefault||(Object.create?function(l,M){Object.defineProperty(l,"default",{enumerable:!0,value:M})}:function(l,M){l.default=M}),n=z0&&z0.__exportStar||function(l,M){for(var g in l)g!=="default"&&!Object.prototype.hasOwnProperty.call(M,g)&&e(M,l,g)},a=z0&&z0.__importStar||function(){var l=function(M){return l=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},l(M)};return function(M){if(M&&M.__esModule)return M;var g={};if(M!=null)for(var y=l(M),_=0;_<y.length;_++)y[_]!=="default"&&e(g,M,y[_]);return o(g,M),g}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getNativeDataTypesOfNormalizedType=t.DATE_MATHS_OPERATORS=t.NORMALIZED_DATA_TYPES=t.DateFunctions=t.Errors=t.QueryLogic=t.DataSet=void 0;const p=ha;n(ha,t),n(rA,t),t.DataSet=a(ir),t.QueryLogic=a(MA),t.Errors=a(sA),t.DateFunctions=a(Os),t.NORMALIZED_DATA_TYPES=["number","boolean","string","date_time","string[]"],t.DATE_MATHS_OPERATORS=["seconds_between","minutes_between","hours_between","days_between"];const c=(l,M)=>Object.keys(p.NATIVE_DATA_TYPES_DATABASE[l]).filter(y=>p.NATIVE_DATA_TYPES_DATABASE[l][y].normalizedType===M);t.getNativeDataTypesOfNormalizedType=c})(nA);Object.defineProperty($o,"__esModule",{value:!0});$o.ENVIRONMENT_VARIABLES_TO_REQUIRED=$o.vizzlyToPossibleNativeDataTypes=$o.NATIVE_DATA_TYPES=$o.SUPPORTED_CLIENTS=void 0;const $g=_0,cA=nA;$o.SUPPORTED_CLIENTS=["bigquery","mariadb","postgres","snowflake","mysql","microsoftSQLServer","redshift"];const _i=t=>(0,$g.reduce)(Object.keys(cA.NATIVE_DATA_TYPES_DATABASE[t]),(e,o)=>Object.assign(Object.assign({},e),{[o]:o}),{});$o.NATIVE_DATA_TYPES={mysql:_i("mysql"),snowflake:_i("snowflake"),postgres:_i("postgres"),redshift:_i("redshift"),mariadb:_i("mariadb"),bigquery:_i("bigquery"),microsoftSQLServer:_i("microsoftSQLServer")};const Gg=(t,e)=>{let o=[];return Object.entries(cA.NATIVE_DATA_TYPES_DATABASE[t]).forEach(([n,{normalizedType:a}])=>{a==e&&(o=[...o,n])}),o};$o.vizzlyToPossibleNativeDataTypes=Gg;$o.ENVIRONMENT_VARIABLES_TO_REQUIRED={postgres:{VIZZLY_POSTGRES_PASSWORD:!0,VIZZLY_POSTGRES_DATABASE:!0,VIZZLY_POSTGRES_USER:!0,VIZZLY_POSTGRES_HOST:!0,VIZZLY_POSTGRES_PORT:!1},mariadb:{VIZZLY_MARIADB_PASSWORD:!0,VIZZLY_MARIADB_DATABASE:!0,VIZZLY_MARIADB_USER:!0,VIZZLY_MARIADB_HOST:!0,VIZZLY_MARIADB_PORT:!1},mysql:{VIZZLY_MYSQL_PASSWORD:!0,VIZZLY_MYSQL_DATABASE:!0,VIZZLY_MYSQL_USER:!0,VIZZLY_MYSQL_HOST:!0,VIZZLY_MYSQL_PORT:!1},elasticsearch:{VIZZLY_ELASTICSEARCH_CLOUD_ID:!0,VIZZLY_ELASTICSEARCH_API_KEY:!0,VIZZLY_ELASTICSEARCH_NODE:!0,VIZZLY_ELASTICSEARCH_USERNAME:!0,VIZZLY_ELASTICSEARCH_PASSWORD:!0,VIZZLY_ELASTICSEARCH_API_KEY_ID:!0},bigquery:{VIZZLY_BIGQUERY_PROJECT_ID:!0,VIZZLY_BIGQUERY_REGION:!0,VIZZLY_BIGQUERY_KEY_FILENAME:!1,VIZZLY_BIGQUERY_CREDENTIALS:!1},snowflake:{VIZZLY_SNOWFLAKE_PASSWORD:!0,VIZZLY_SNOWFLAKE_DATABASE:!1,VIZZLY_SNOWFLAKE_USERNAME:!0,VIZZLY_SNOWFLAKE_ACCOUNT:!0,VIZZLY_SNOWFLAKE_WAREHOUSE:!0,VIZZLY_SNOWFLAKE_ROLE:!0,VIZZLY_SNOWFLAKE_SCHEMA:!1,VIZZLY_SNOWFLAKE_SESSION_KEEP_ALIVE:!1},microsoftSQLServer:{VIZZLY_MICROSOFT_SQL_SERVER_PASSWORD:!0,VIZZLY_MICROSOFT_SQL_SERVER_DATABASE:!0,VIZZLY_MICROSOFT_SQL_SERVER_USER:!0,VIZZLY_MICROSOFT_SQL_SERVER_HOST:!0,VIZZLY_MICROSOFT_SQL_SERVER_PORT:!1}};var ls={};Object.defineProperty(ls,"__esModule",{value:!0});ls.DataSetNotLinkedToConnection=void 0;class Ug extends Error{constructor(e){super(`Data set ${e} must be linked to a connection by setting a 'connectionId' property that references a connection in the 'connections' section.`),this.name="DataSetNotLinkedToConnection"}}ls.DataSetNotLinkedToConnection=Ug;(function(t){var e=z0&&z0.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(t,"__esModule",{value:!0}),t.redshiftSchema=t.microsoftSQLServerSchema=t.snowflakeSchema=t.mySQLSchema=t.mariadbSchema=t.postgresSchema=t.bigQuerySchema=t._sqlDataSetSchema=t._fieldSchema=t.ID_REGEX_ERROR_MESSAGE=t.ALLOWED_ID_REGEX=void 0;const o=e(eA),n=Ya,a=$o,p=R1,c=Jt,l=ls,M=["unencryptedCredentials","encryptedCredentials"],g=Object.keys(c.supportedOperatorsConstants),y=["rightJoin","leftJoin","innerJoin","outerJoin","leftOuterJoin","rightOuterJoin"];t.ALLOWED_ID_REGEX=/^[a-zA-Z0-9_+:\/=\-\s]*$/,t.ID_REGEX_ERROR_MESSAGE="IDs must only use alpha numeric characters and _";const _={checkConnectionSpecificDataSets:!0},O={abortEarly:!1,allowUnknown:!0},d=L=>o.default.object({id:o.default.string().required().regex(t.ALLOWED_ID_REGEX,t.ID_REGEX_ERROR_MESSAGE).description("A unique identifier for this field. It should not change unless the meaning of the field, or the data type has changed."),publicName:o.default.string().optional().allow("").description("The name of this field that you want your users to see. This can be changed as much as you like without causing a breaking change."),address:o.default.array().items(o.default.string()).optional().description('The address of the column in your database. For example; ["database_name", "table_name", "column_name"] or for BigQuery; ["bigquery project id", "bigquery data set id", "table name", "column name"]'),description:o.default.string().allow("").optional().max(110).description("A description of what the purpose of this data set is"),sql:o.default.string().optional().description("Provide a SQL definition of the field, instead of a table & name combination."),dataType:o.default.valid(...Object.values(a.NATIVE_DATA_TYPES[L])).required(),canBeDimension:o.default.boolean().optional().description("Can this field be used in groupings?"),canBeMeasure:o.default.boolean().optional().description("Can this field be used in aggregations?"),canBeUsedInSort:o.default.boolean().optional().description("__vizzly_hide_from_docs"),allowedGranularities:o.default.array().items(o.default.string().valid(...Object.keys((0,n.getQueryEngineConfig)(L).supportedTimeTruncFunctions))).optional(),allowedOperators:o.default.alternatives().conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"string")),then:o.default.array().items(o.default.string().valid(...(0,p.validOperatorsForField)({dataType:"string"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a string data type.")}).conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"number")),then:o.default.array().items(o.default.string().valid(...(0,p.validOperatorsForField)({dataType:"number"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a number data type.")}).conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"date_time")),then:o.default.array().items(o.default.valid(...(0,p.validOperatorsForField)({dataType:"date_time"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a date time data type.")}).conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"boolean")),then:o.default.array().items(o.default.string().valid(...(0,p.validOperatorsForField)({dataType:"boolean"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a boolean data type.")}).conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"string[]")),then:o.default.array().items(o.default.string().valid(...(0,p.validOperatorsForField)({dataType:"string[]"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a string array data type.")}).optional()});t._fieldSchema=d;const f=o.default.object({type:o.default.string().valid(...y).required(),left:o.default.array().items(o.default.string()).required(),right:o.default.array().items(o.default.string()).required(),as:o.default.string().optional()}),z=o.default.object({fieldId:o.default.string().required(),op:o.default.string().valid(...g).required()}),s=L=>({id:o.default.string().required().regex(t.ALLOWED_ID_REGEX,t.ID_REGEX_ERROR_MESSAGE).description("A unique ID for the data set. This should not change unless the meaning of the data set represents changes."),connectionId:o.default.string().required().description("Reference the connection to use for this data set."),hide:o.default.boolean().optional().description("Hide the data set from the dashboard."),name:o.default.string().required().description("A public name for the data set. This can change as much as you like without causing a breaking change."),description:o.default.string().allow("").optional().max(110).description("A description of what this field represents"),sql:o.default.string().optional().description("Optionally define the data set using a SQL statement. If used, the `table` value for each field should equal `vizzly_data_set`."),testParameters:o.default.string().optional().description("Test parameters that are used when creating SQL backed data sets. This is a stringified JSON object."),preAggregated:o.default.alternatives(o.default.array().items(o.default.string()).description("Array of data set IDs relied on by the pre-aggregated data set"),o.default.boolean().allow(!1).description("Only `False` is a valid boolean option. For truthy values, provide an array of data set IDs")).optional().description("Optional - For pre-aggregated data sets or SQL views, provide a list of data sets that are relied upon."),fields:o.default.array().min(1).items(L).unique("id").message("Field IDs must be unique").required(),permanentFilters:o.default.object({type:o.default.valid("andWhere","orWhere","where"),value:o.default.array()}),secureFilterGuards:o.default.array().items(z).optional()}),h=L=>o.default.object(Object.assign(Object.assign({},s(L)),{joins:o.default.array().items(f).unique((T,w)=>{const C=JSON.stringify(T.right)===JSON.stringify(w.right);return!T.as&&!w.as&&C}).message("A table cannot be referenced in a right join multiple times.").optional()}));t._sqlDataSetSchema=h;const A=L=>{var T;if(((T=L.onlyClients)===null||T===void 0?void 0:T.length)===1)return(0,t._sqlDataSetSchema)((0,t._fieldSchema)(L.onlyClients[0]));const w=o.default.alternatives(...(L.onlyClients||a.SUPPORTED_CLIENTS).map(C=>(0,t._sqlDataSetSchema)((0,t._fieldSchema)(C))));if(L.dataSetIdToClientMapping){const C=Object.entries(L.dataSetIdToClientMapping).map(([R,S])=>({is:R,then:(0,t._sqlDataSetSchema)((0,t._fieldSchema)(S))}));return o.default.alternatives().conditional(".id",[...C,{is:!0,then:w}])}return w},q=(L,T)=>o.default.object({version:o.default.number(),connections:o.default.object().pattern(o.default.string(),o.default.object({client:o.default.string().allow(...a.SUPPORTED_CLIENTS).required(),name:o.default.string().optional().allow(""),encryptedCredentials:o.default.string().optional(),unencryptedCredentials:o.default.alternatives(o.default.string(),o.default.object()).optional()})),dataSets:o.default.array().items(T.checkConnectionSpecificDataSets?o.default.object().custom(w=>{var C,R;const S=w.connectionId||"___vizzly_default_conn",E=(R=(C=L?.connections)===null||C===void 0?void 0:C[S])===null||R===void 0?void 0:R.client;if(!E)throw new l.DataSetNotLinkedToConnection(w.id);const G=(0,t._sqlDataSetSchema)((0,t._fieldSchema)(E)).validate(w,O);if(G.error)throw G.error;return w},"Data sets linked to connections"):A(T)).unique("id").message("dataSet[x].id must be unique.").required(),executableDashboardConfigForPDF:o.default.string().allow(null).optional().description("JavaScript dashboard config for server-side generated PDFs"),publicKeys:o.default.array().items(o.default.string()).optional(),sqlViews:o.default.object().pattern(o.default.string(),o.default.object({name:o.default.string().required(),sql:o.default.string().allow("").required()})).optional(),runOptions:o.default.object().optional(),queryRoutingRules:o.default.array().items(o.default.object()).optional()});t.bigQuerySchema=q({},{onlyClients:["bigquery"]}),t.postgresSchema=q({},{onlyClients:["postgres"]}),t.mariadbSchema=q({},{onlyClients:["mariadb"]}),t.mySQLSchema=q({},{onlyClients:["mysql"]}),t.snowflakeSchema=q({},{onlyClients:["snowflake"]}),t.microsoftSQLServerSchema=q({},{onlyClients:["microsoftSQLServer"]}),t.redshiftSchema=q({},{onlyClients:["redshift"]}),t.default=(L,T={})=>{const w=q(L,Object.assign(Object.assign(Object.assign({},_),T),{dataSetIdToClientMapping:v(L)})).validate(L,O);return w.error&&w.error.details.map(C=>{var R,S;M.includes(((R=C.context)===null||R===void 0?void 0:R.key)||"")&&!((S=C.context)===null||S===void 0)&&S.value&&(C.context.value="-- VIZZLY REDACTED --")}),w};const v=L=>{let T={};return L&&typeof L?.dataSets=="object"&&typeof L?.connections=="object"&&L.dataSets.forEach(w=>{var C,R;if(T){const S=w.connectionId||"___vizzly_default_conn",E=(R=(C=L?.connections)===null||C===void 0?void 0:C[S])===null||R===void 0?void 0:R.client;E&&(T[w.id]=E)}}),T}})(iA);(function(t){var e=z0&&z0.__createBinding||(Object.create?function(c,l,M,g){g===void 0&&(g=M);var y=Object.getOwnPropertyDescriptor(l,M);(!y||("get"in y?!l.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return l[M]}}),Object.defineProperty(c,g,y)}:function(c,l,M,g){g===void 0&&(g=M),c[g]=l[M]}),o=z0&&z0.__setModuleDefault||(Object.create?function(c,l){Object.defineProperty(c,"default",{enumerable:!0,value:l})}:function(c,l){c.default=l}),n=z0&&z0.__importStar||function(){var c=function(l){return c=Object.getOwnPropertyNames||function(M){var g=[];for(var y in M)Object.prototype.hasOwnProperty.call(M,y)&&(g[g.length]=y);return g},c(l)};return function(l){if(l&&l.__esModule)return l;var M={};if(l!=null)for(var g=c(l),y=0;y<g.length;y++)g[y]!=="default"&&e(M,l,g[y]);return o(M,l),M}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Schemas=t.ID_REGEX_ERROR_MESSAGE=t.ALLOWED_ID_REGEX=t.validate=void 0;const a=n(iA);t.validate=a.default,Object.defineProperty(t,"ALLOWED_ID_REGEX",{enumerable:!0,get:function(){return a.ALLOWED_ID_REGEX}}),Object.defineProperty(t,"ID_REGEX_ERROR_MESSAGE",{enumerable:!0,get:function(){return a.ID_REGEX_ERROR_MESSAGE}});const p={bigQuery:a.bigQuerySchema,postgres:a.postgresSchema,mariadb:a.mariadbSchema,mySQL:a.mySQLSchema,snowflake:a.snowflakeSchema,microsoftSQLServer:a.microsoftSQLServerSchema,redshift:a.redshiftSchema};t.Schemas=p})(oA);var zA={};Object.defineProperty(zA,"__esModule",{value:!0});var OA={},us={};Object.defineProperty(us,"__esModule",{value:!0});us.ianaTimeZonesDb=void 0;us.ianaTimeZonesDb=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/La_Rioja","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Ciudad_Juarez","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New_York","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Katmandu","Asia/Khandyga","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis"];(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ianaTimeZones=t.ETC_UTC_TIME_ZONE=void 0,t.ETC_UTC_TIME_ZONE="Etc/UTC";const e=us,o=()=>[t.ETC_UTC_TIME_ZONE,...e.ianaTimeZonesDb];t.ianaTimeZones=o})(OA);(function(t){var e=z0&&z0.__createBinding||(Object.create?function(p,c,l,M){M===void 0&&(M=l);var g=Object.getOwnPropertyDescriptor(c,l);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(p,M,g)}:function(p,c,l,M){M===void 0&&(M=l),p[M]=c[l]}),o=z0&&z0.__setModuleDefault||(Object.create?function(p,c){Object.defineProperty(p,"default",{enumerable:!0,value:c})}:function(p,c){p.default=c}),n=z0&&z0.__importStar||function(){var p=function(c){return p=Object.getOwnPropertyNames||function(l){var M=[];for(var g in l)Object.prototype.hasOwnProperty.call(l,g)&&(M[M.length]=g);return M},p(c)};return function(c){if(c&&c.__esModule)return c;var l={};if(c!=null)for(var M=p(c),g=0;g<M.length;g++)M[g]!=="default"&&e(l,c,M[g]);return o(l,c),l}}(),a=z0&&z0.__exportStar||function(p,c){for(var l in p)l!=="default"&&!Object.prototype.hasOwnProperty.call(c,l)&&e(c,p,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.VizzlyConfig=t.QueryEngineConfig=void 0,t.QueryEngineConfig=n(tA),t.VizzlyConfig=n(oA),a(zA,t),a(OA,t)})(oo);const lA=oo.QueryEngineConfig.Constants.supportedOperatorsConstants,Vo=(t,e)=>{let o=[...Object.keys(e.supportedOperators)];return o=o.filter(n=>Qn[n].validDataTypes.includes(t.dataType)),o},Vg=(t,e)=>t=="countDistinct"?e("count_distinct","Count distinct"):_0.capitalize(t),Qn=lA,Hg=t=>{const e=_0.cloneDeep(Qn);if(!t)return e;let o={};return t.forEach(n=>{if(!Qn[n])throw`Operator ${n} not managed by Vizzly`;o[n]=Qn[n]}),o},Yg=t=>Qn[t].publicName,X1=t=>t.map(e=>e.map(o=>(o.op=="is_one_of"||o.op=="is_not_one_of")&&!_0.isArray(o.value)?{...o,value:[o.value]}:o)),te=(t,e)=>t.map(o=>{let n={...o,aggregate:void 0,function:o.function||o.aggregate};return delete n.aggregate,e&&n.field==e.field&&n.function=="none"&&(n.function=e.truncate),n}),c1=t=>t.map(e=>{let o={...e,aggregate:void 0,function:e.function||e.aggregate};return delete o.aggregate,o}),A1=t=>t==="auto"||t===0||t===2?t:"auto",Mi=t=>typeof t=="number"&&![0,2].includes(t)?"auto":t,Kg=t=>Qn[t].publicName,Re=t=>{if(!t)return{};let e={};return t.measure&&Object.entries(t.measure).forEach(([o,n])=>{e&&(e[o]=c1(n))}),{measure:_0.isEmpty(e)?void 0:e,group:t.group}},Qg=Object.freeze({__proto__:null,aggregateName:Vg,getOperatorPublicName:Kg,operatorToString:Yg,supportedOperators:Hg,upcastAxisLabel:A1,upcastAxisLabelWithAllOptions:Mi,upcastFilter:X1,upcastMeasure:c1,upcastOrder:te,upcastV1Parameters:Re,validOperatorsForField:Vo}),uA=oo.QueryEngineConfig.Constants.supportedAggregatesConstants,Zg=uA,Jg=t=>_0.cloneDeep(Zg),k3=(t,e)=>[...Object.keys(t),"none"].includes(e),ey=(t,e,o)=>{const n=t[e];return n?n.validDataTypes.includes(o):!1},ty=(t,e,o)=>{if(e===void 0)return t;if(_0.isFunction(e)){if(o?.filter)return e({value:t,filter:o.filter,dataSetId:o.dataSetId});if(o?.fieldId)return e({value:t,fieldId:o.fieldId,dataSetId:o.dataSetId})}if(e&&!_0.isFunction(e)&&t!==null&&e[t])return e[t]};function oy(t,e=!0,o){if(t.length==0)return"";if(t.length==1)return e?`'${t[0]}'`:`${t[0]}`;let n=[...t],a=n.pop();return`${n.map(p=>e?`'${p}'`:`${p}`).join(", ")} and ${e?`'${a}'`:`${a}`}`}const iy=t=>t.charAt(0).toUpperCase()+t.slice(1),AA=(t,e,o)=>{const n=_0.replace(t,e,o);return n.indexOf(e)>=0?AA(n,e,o):n},ny=t=>iy(AA(t,"_"," ")),j3=["debug","info","warning","error","properties"];let ry="error";const EO=t=>{const e=j3.findIndex(n=>ry==n),o=j3.findIndex(n=>t==n);return e<=o},DO=t=>t instanceof Error?t:_0.isObject(t)||_0.isArray(t)?JSON.stringify(t):t,ee=(...t)=>{EO("debug")&&console.info("[VIZZLY DEBUG]",...t.map(DO))},IO=(...t)=>{EO("warning")&&console.warn("[VIZZLY WARNING]",...t.map(DO))},eo=(...t)=>{EO("error")&&console.error("[VIZZLY ERROR]",...t.map(DO))},As="No value",ay=Object.keys(Jg()),dA=(t,e,o)=>{const n=o?.allowEmptyPublicName?"":qA(t.id);return{id:t.id,dataType:t.dataType,publicName:t.publicName||n,dashboardRequiredFilterGroups:t.dashboardRequiredFilterGroups||[],description:t.description||void 0,canBeDimension:t.canBeDimension===void 0?!0:t.canBeDimension,canBeMeasure:t.canBeMeasure===void 0?!0:t.canBeMeasure,allowedOperators:t.allowedOperators===void 0?Vo(t,e):t.allowedOperators,allowedGranularities:t.allowedGranularities===void 0?Object.keys(e.supportedTimeTruncFunctions):t.allowedGranularities,supportedAggregateOptions:gA(e,t.dataType,t.supportedAggregateOptions)}},py=(t,e)=>{if(t===null)return!0;switch(e){case"boolean":return _0.isBoolean(t);case"number":return _0.isNumber(t);case"string":return _0.isString(t);case"string[]":return Array.isArray(t);case"date_time":return _0.isDate(t)||_0.isString(t)}},by=(t,e)=>{if(t===null)return null;switch(e){case"boolean":return!!t;case"date_time":return new Date(t);case"number":return Number(t);case"string[]":return`${Array.isArray(t)?oy(t,!1):`${t}`}`;case"string":return`${t}`}},My=(t,e)=>e==="boolean"&&(t==="true"||t==="TRUE"||t==="True")?!0:e==="boolean"&&(t==="false"||t==="FALSE"||t==="False")?!1:t,fA=["date_time","boolean","number","string"],sy=t=>fA.includes(t),qA=t=>ny(t),cy=t=>t=="date_time"?"Date Time":t=="string"?"Text":t=="string[]"?"List of Text":t=="boolean"?"True or False":_0.upperFirst(t),zy=(t,e,o=As)=>t===null||t==="No value"||_0.isNumber(t)&&isNaN(t)?o:t instanceof Date&&e?e(t):t===!0?"True":t===!1?"False":_0.isNumber(t)&&t%1!==0?t.toFixed(2):Array.isArray(t)?t.join(", "):`${t}`,Oy=(t,e=As)=>t===null?e:t instanceof Date?t.toISOString():t,ly=(t,e)=>_0.remove([...t],o=>!e.includes(o.id)),uy=(t,e,o)=>{const n={};return[...t.allowedOperators].forEach(a=>{const p=e[a];p.validDataTypes.includes(t.dataType)&&(n[a]={...p,publicName:o?o(`config.supported_operator.${a}`,p.publicName):p.publicName})}),n},hA=(t,e)=>PO(t,e)[0],PO=(t,e)=>{let o=t.supportedAggregateOptions??[],n=o.filter(a=>Object.keys(e).includes(a)&&e[a].validDataTypes.includes(t.dataType));return n.length===0?n=Object.keys(e).filter(a=>e[a].validDataTypes.includes(t.dataType)):n.sort((a,p)=>{const c=o.indexOf(a),l=o.indexOf(p);return c-l}),n},Ay=(t,e)=>[...PO(t,e)].map(n=>({value:n,label:e[n].publicName})),dy=(t,e)=>[...Object.keys(e)].flatMap(n=>t.includes(n)?[{value:n,label:e[n].publicName}]:[]),fy=t=>t[0],WA=t=>!t?.function||t?.function=="none"?t?.field:`${t.field}_${t.function}`,Ka=(t,e)=>{const o=t.split("_"),n=o.pop();return[void 0,...Object.keys(e.supportedAggregates||{}),...Object.keys(e.supportedTimeTruncFunctions||{}),...Object.keys(e.supportedTransformationFunctions||{})].includes(n)?{field:o.join("_"),function:n??""}:{field:t,function:"none"}},qy=(t,e)=>{let{field:o,function:n}=Ka(t,e);return{fieldId:o,function:n}},mA=(t,e)=>Object.keys(e).filter(o=>e[o].validDataTypes.includes(t.dataType)),hy=(t,e)=>{const o=new Set(e.map(n=>n.field));return t.filter(n=>!o.has(n.id))},C1=t=>t.map(e=>typeof e=="string"?{field:e,function:"none"}:e),Wy=t=>t.dataType=="string[]",Hz={round_to_0_dp:{publicName:"Round to 0dp",validDataTypes:["number"]},round_to_2_dp:{publicName:"Round to 2dp",validDataTypes:["number"]}},my=t=>{const e=_0.cloneDeep(Hz);if(!t)return e;let o={};return t.forEach(n=>{if(!Hz[n])throw`Transformation function ${n} is not managed by Vizzly`;o[n]=Hz[n]}),o},gA=(t,e,o)=>{const n=t.supportedAggregates,a=Object.keys(n).filter(c=>n[c].validDataTypes.includes(e));o?.forEach(c=>{n.hasOwnProperty(c)||IO(`Unsupported aggregate option: ${c} on ${e}`)});let p=o&&o.length>0?o.filter(c=>a.includes(c)):a;return o&&o.length>0&&p.length===0&&(p=a),p},gy=(t,e,o,n,a,p)=>{if(a){let c;o?c=o.field:e&&e.length>0&&e[0].field&&(c=e[0].field);const l=ty(null,a,{fieldId:c,dataSetId:t});if(l)return String(l)}return n?n(p||"no_value",As):void 0},yy=Object.freeze({__proto__:null,ALL_AGGREGATES:ay,NULL_REPLACEMENT:As,VALID_DATA_TYPES:fA,checkForNullValue:gy,dataTypeToHumanReadable:cy,decodeId:Ka,getDefaultAggregateForField:hA,getQueryFieldIdFromResultFieldId:qy,id:WA,isArrayDataType:Wy,isValidDataType:sy,listValidFunctionsForDataType:mA,parseBooleanFromString:My,parseValue:by,removeField:hy,removeFields:ly,supportedAggregateOptions:Ay,supportedAggregatesForField:PO,supportedAggregatesFunction:gA,supportedOperators:uy,supportedTransformationFunctions:my,takeHighestGranularity:fy,timeDimensionTruncateToSelectOptions:dy,toHumanReadable:qA,toString:zy,toStringShort:Oy,upcastField:dA,upcastStringDimensionsToObject:C1,valueIsOrDataType:py}),yA=t=>({minutes:{description:"Minutes",formatter:(e,o)=>{e.setMinutes(e.getMinutes()+o)}},hours:{description:"Hours",formatter:(e,o)=>{e.setHours(e.getHours()+o)}},days:{description:"Days",formatter:(e,o)=>{e.setDate(e.getDate()+o)}},weeks:{description:"Weeks",formatter:(e,o)=>{e.setDate(e.getDate()+o*7)}},months:{description:"Months",formatter:(e,o)=>{e.setMonth(e.getMonth()+o)}},years:{description:"Years",formatter:(e,o)=>{e.setFullYear(e.getFullYear()+o)}}}),Ry=t=>({future:{description:"Future"},past:{description:"Past"}}),vy=()=>{const t=yA();return Object.keys(t)},Ly=()=>{const t=Ry();return Object.keys(t)},FO=u.object({unit:u.string().valid(...vy()).required(),value:u.number().integer().required(),timeFrame:u.string().valid(...Ly()).required()});function RA(t){const{error:e}=FO.validate(t);return!e}const kO=(t,e)=>{const o=e?new Date(e):new Date;if(!t.value||t.unit===null)throw new Error(`Unrecognized value: ${t.value}`);let n=t.timeFrame==="future"?t.value:-t.value;return yA()[t.unit].formatter(o,n),o},_y=(t,e,o)=>{if(!o)throw new Error("appliesToFields is required");return t.map(n=>{const a=n.map(c=>({op:c.op,value:{...c.value}})),p=[];return o.forEach(c=>{c.dataSetId==e.id&&a.forEach(l=>{p.push({...l,field:c.fieldId})})}),p})};var q2=(t=>(t.FIXED="fixed",t.AVERAGE="average",t.TRENDLINE="trendline",t))(q2||{});const Ny=()=>u.object({key:u.string().required()}),D1=()=>u.array().items(Ny()).min(0),ce=(t,e)=>{const o=(n,a)=>u.object({field:n.required(),function:a.required().description("Which if any, aggregate function should be applied to the field?")});return e?.restrictFields?u.alternatives(...e.restrictFields.filter(n=>n.canBeMeasure).map(n=>{const a=mA(n,t);return o(u.string().valid(n.id).description(`${n.publicName}, ${n.description||""}.`),u.string().valid(...a,"none"))})):o(u.string().description("The ID of the field from the data set to reference."),u.valid(...Object.keys(t),"none"))},_2=t=>u.object({field:u.string().required().description("The ID of the field from the data set to reference."),direction:u.string().valid("asc","desc").required().description("In which direction should the results be ordered?"),function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none").description("Which if any, function should be applied to the field?")}),ar=t=>u.object({field:u.string().required().description("The ID of the field from the data set to reference."),truncate:u.valid(...Object.keys(t),"none"),bucketFill:u.boolean()}),lt=(t,e)=>{const o=(n,a)=>u.object({field:n.required(),pivot:u.string().valid("x","y").optional(),function:a?u.valid(...Object.keys(t),"none").required():u.valid("none").required()});return e?.restrictFields?u.array().items(u.alternatives(...e.restrictFields.filter(n=>n.canBeDimension).map(n=>o(u.string().valid(n.id).description(`${n.publicName}, ${n.description||""}.`),n.dataType==="date_time")))).description("Fields to group the data by"):u.array().items(o(u.string().description("The ID of the field from the data set to reference."),!0)).description("Fields to group the data by")},Ty=(t,e=10)=>{const o=u.object({field:u.object({type:u.string().valid("field").required(),value:u.string().required().description("The ID of the field from the data set to reference."),function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none").description("Which function should be applied to the field?")}),op:u.string().valid(...Object.keys(t.supportedOperators)).required(),value:u.alternatives().try(LA,u.string().allow(null),u.number(),u.boolean(),u.array().items(u.string(),u.number(),u.allow(null)),FO).required()}),n=a=>a<=0?u.object({type:u.string().valid("where").required(),value:o.required()}):u.alternatives().try(u.object({type:u.string().valid("where").required(),value:o.required()}),u.object({type:u.string().valid("andWhere","orWhere").required(),value:u.array().items(n(a-1)).required().description("Array of nested filters")}));return n(e)},pr=t=>u.object({field:u.string().required().description("The ID of the field from the data set to reference."),op:u.string().valid(...Object.keys(t.supportedOperators)).required(),value:u.alternatives().try(LA,u.string().allow(null),u.number(),u.boolean(),u.array().items(u.string(),u.number(),u.allow(null)),FO).required(),function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none").description("Which function should be applied to the field?"),groupBy:u.string().optional().description("The dimension field to group the aggregate by for subquery filters.")}),yo=t=>u.array().items(u.array().items(pr(t))),io=()=>u.number().description("Limit the number of results returned after the query has been ran."),I1=t=>{const e=t?.restrictDataSetIds?u.string().valid(...t.restrictDataSetIds):u.string();return{viewId:u.string().allow("").optional().description("__vizzly_hide_from_docs"),displayTitle:u.string().allow("").description("A title that explains what is being displayed."),displaySubject:u.string().allow("").description("A chance to add a more detailed description of what is being shown."),dataSetId:e.description("The ID of the data set that is being used by the view."),protectedByOrganisation:u.boolean().optional().description("Has the view been created by your organisation, and therefore cannot be modified by your users?"),updated_at:u.string().optional().description("ISO timestamp of when the view attributes were last updated.")}},to=u.valid("auto",2,0).description("Determine how many axis labels should be shown on the axis"),jO=t=>{let e=["auto",2,0];return t&&(e=e.concat(t)),u.valid(...e).description("Determine how many axis labels should be shown on the axis")},xy=(t,e)=>({measure:u.array().items(ce(t.supportedAggregates,e)).required().description("A list of metrics that are to be shown. For example the `count` of a specific field in your data set."),dimension:lt(t.supportedTimeTruncFunctions,e).required(),order:u.array().items(_2(t)),limit:io(),offset:u.number().min(0).description("Paginate results by using this property with limit.")}),ut=(t,e,o)=>({...xy(t,e),filter:u.array().items(u.array().items(pr(t))),timeDimension:u.alternatives(ar(t.supportedTimeTruncFunctions),u.valid(null)).required(),drilldown:u.alternatives(lt(t.supportedTimeTruncFunctions,e).required(),u.string()),xAxisPostfix:u.string().allow("").description("Add a postfix to the X Axis"),xAxisPrefix:u.string().allow("").description("Add a prefix to the X Axis"),yAxisFormat:u.alternatives(u.string(),u.valid(null)).description("ID of the formatting function to apply to the Y Axis values"),yAxisPostfix:u.string().allow("").description("Add a postfix to the Y Axis"),yAxisPrefix:u.string().allow("").description("Add a prefix to the Y Axis"),yDualAxisFormat:u.alternatives(u.string(),u.valid(null)).description("ID of the formatting function to apply to the Dual Y Axis values").optional(),yDualAxisPostfix:u.string().allow("").description("Add a postfix to the Dual Y Axis").optional(),yDualAxisPrefix:u.string().allow("").description("Add a prefix to the Dual Y Axis").optional(),xAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),xAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),yAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),yAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),yDualAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),yDualAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),xAxisFormat:u.alternatives(u.string(),u.valid(null)).description("ID of the formatting function to apply to the X Axis values"),approxYAxisLabelCount:to,approxXAxisLabelCount:o?jO(o):to,approxDualYAxisLabelCount:to.optional()}),Qa=u.string().valid("natural","straight","step","stepBefore","stepAfter","dotted"),Sy=u.string().valid("natural","straight","step"),ds=t=>u.array().items(u.object({function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none"),field:u.string().required().description("The ID of the field from the data set to reference.")})),$O=t=>u.array().items(u.object({function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none"),truncate:u.string(),field:u.string().required().description("The ID of the field from the data set to reference."),bucketFill:u.boolean().optional(),pivot:u.string().valid("x","y").optional()})),By=(t,e)=>u.object().pattern(u.string(),u.alternatives().try(u.array().items(ar(t.supportedTimeTruncFunctions)).min(1),lt(t.supportedTimeTruncFunctions,e))).unknown(!0),wy=(t,e)=>u.object().pattern(u.string(),u.array().items(ce(t.supportedAggregates,e)).min(1)).unknown(!0),Ie=(t,e)=>u.object({measure:wy(t,e),group:By(t,e)}),At=u.object({fields:u.array().items(u.object({field:u.string()}))}),Cy=u.alternatives().try(u.number().required(),u.string().pattern(/^\{\{.*\}\}$/).required()),Xy=()=>u.object({color:u.string().required(),value:u.when("goalLineType",{is:u.valid(q2.AVERAGE,q2.TRENDLINE),then:u.any().optional(),otherwise:Cy}),strokeWidth:u.number().required(),strokeStyle:u.string().valid("dashed","solid").required(),label:u.boolean().optional(),goalLineType:u.string().valid(q2.FIXED,q2.AVERAGE,q2.TRENDLINE).optional().default(q2.FIXED),metricField:u.when("goalLineType",{is:u.valid(q2.AVERAGE,q2.TRENDLINE),then:u.string().required(),otherwise:u.string().optional()})}),Tt=()=>u.array().items(Xy()),GO=()=>u.object({enabled:u.boolean().required(),labels:u.object({quadrantOne:u.string().allow("").optional(),quadrantTwo:u.string().allow("").optional(),quadrantThree:u.string().allow("").optional(),quadrantFour:u.string().allow("").optional()}).required()}),jt=()=>u.object({func:u.string().valid("mean","sum","current").allow(null).optional()}),Pe=()=>u.object({x:u.string().allow(""),y:u.string().allow(""),yDual:u.string().allow("")}),vA=u.object().pattern(u.string(),u.object({width:u.number().min(0),height:u.number().min(0)})),LA=u.custom((t,e)=>Object.prototype.toString.call(t)==="[object Date]"?t:e.error("any.invalid"),"Date object validation"),ma=t=>u.object({filters:u.array().items(u.array().items(pr(t)).required().max(1)).required().max(1),ruleValue:u.string().allow("").required(),ruleValueEnd:u.string().allow(""),ruleType:u.valid("backgroundColor","fontColor","lineColor","areaColor").required()}).description("A rule used to conditionally format a view."),_A=u.object({field:u.string().required().description("ID of the field in the data set to add a prefix too."),prefix:u.string().required().description("The prefix to be applied.")}),nt=t=>u.array().items(ma(t)).description("Apply formatting based on a set of defined rules."),NA=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),type:u.valid("areaChart").required(),lineCurve:Qa,conditionalFormattingRules:nt(t.queryEngineConfig),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1()}),Ey=t=>(e,o)=>E1(e,o,NA(t)),Dy=oo.QueryEngineConfig.Constants.timeDimensionsConstants,Iy=t=>!t?.truncate||t?.truncate=="none"?t?.field:`${t.field}_${t.truncate}`,Py=(t,e)=>{const o=t.split("_"),n=o.pop();return n&&!OO(e,n)?null:{field:o.join("_"),truncate:n??""}},OO=(t,e)=>[...Object.keys(t),"none"].includes(e),Zn=WA,Fy=Ka,ky=(t,e,o)=>{if("measure"in t&&t.measure){const n=$y(t.measure,o);if(n?.function&&n.field===e){const a=Zn(n);delete t.measure[a]}t.measure=$3(t.measure,e)}if("group"in t&&t.group){const n=jy(t.group,o);if(n?.truncate&&n.field===e){const a=Iy(n);delete t.group[a]}else t.group.hasOwnProperty(e)&&delete t.group[e];t.group=$3(t.group,e)}return t};function jy(t,e){return Object.keys(t).map(o=>{const n=Py(o,e.supportedTimeTruncFunctions);return n?.truncate?n:null}).find(o=>o!==null)}function $y(t,e){return Object.keys(t).map(o=>{const n=Fy(o,e);return n?.function?n:null}).find(o=>o!==null)}function $3(t,e){const o={};for(const[n,a]of Object.entries(t))o[n]=a.filter(p=>p?.field!==e);return o}const Gy=(t,e)=>({fields:t.fields.filter(o=>o.field!=e)}),V1=(t,e,o)=>{let n={...t};if("measure"in n&&_0.remove(n.measure,a=>a.field==e),"barMeasure"in n&&_0.remove(n.barMeasure,a=>a.field==e),"lineMeasure"in n&&_0.remove(n.lineMeasure,a=>a.field==e),"xMeasure"in n&&Array.isArray(n.xMeasure)&&_0.remove(n.xMeasure,a=>a.field==e),"yMeasure"in n&&n.yMeasure?.field==e&&(n.yMeasure=null),"order"in n&&_0.remove(n.order,a=>a.field==e),"dimension"in n&&_0.remove(n.dimension,a=>a.field==e),"barDimension"in n&&_0.remove(n.barDimension,a=>a.field==e),"lineDimension"in n&&_0.remove(n.lineDimension,a=>a.field==e),"filter"in n&&n.filter.forEach(a=>{_0.remove(a,p=>p.field==e)}),"parameters"in n&&n.parameters&&o){const a=ky(n.parameters,e,o);n.parameters=a}if("parametersV2"in n&&n.parametersV2&&o){const a=Gy(n.parametersV2,e);n.parametersV2=a}return"timeDimension"in n&&n.timeDimension?.field==e&&(n.timeDimension=null),n},Uy={barChart:{displayName:"Column Charts"},lineChart:{displayName:"Line Charts"},lineChartV2:{displayName:"Line Charts"},areaChart:{displayName:"Area Charts"},horizontalBarChart:{displayName:"Horizontal Bar Charts"},scatterChart:{displayName:"Scatter Charts"},scatterChartV2:{displayName:"Scatter Charts"},pieChart:{displayName:"Pie Charts"},funnelChart:{displayName:"Funnel Charts"},sunburstChart:{displayName:"Sunburst Charts"},bubbleChart:{displayName:"Bubble Charts"},bubbleChartV2:{displayName:"Bubble Charts"},basicTable:{displayName:"Tables"},comboChart:{displayName:"Combo Charts",customMessage:"Combo Charts needs at least 1 grouping (Bar and Line), or, have time set to display correctly."},comboChartV2:{displayName:"Combo Charts",customMessage:"Combo Charts needs at least 1 grouping (Bar and Line), or, have time set to display correctly."}},Vy=t=>{const e=Uy[t.type];return e?.customMessage?e.customMessage:`${e?.displayName||"Charts"} need at least 1 grouping to display correctly.`},Hy=t=>t.type==="comboChart"?!!(t.timeDimension||t.barDimension.length>0&&t.lineDimension.length>0):t.type==="barChart"||t.type==="lineChart"||t.type==="areaChart"||t.type==="horizontalBarChart"||t.type==="scatterChart"||t.type==="pieChart"||t.type==="funnelChart"||t.type==="sunburstChart"?!!(t.timeDimension||!t?.dimension||t?.dimension?.length!==0):!0,ze=t=>Hy(t)?!0:Vy(t);var Yy=typeof z0=="object"&&z0&&z0.Object===Object&&z0,TA=Yy,Ky=TA,Qy=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,Zy=Ky||Qy||Function("return this")(),N2=Zy,Jy=N2,eR=Jy.Symbol,xA=eR,G3=xA,SA=Object.prototype,tR=SA.hasOwnProperty,oR=SA.toString,Ma=G3?G3.toStringTag:void 0;function iR(t){var e=tR.call(t,Ma),o=t[Ma];try{t[Ma]=void 0;var n=!0}catch{}var a=oR.call(t);return n&&(e?t[Ma]=o:delete t[Ma]),a}var nR=iR,rR=Object.prototype,aR=rR.toString;function pR(t){return aR.call(t)}var bR=pR,U3=xA,MR=nR,sR=bR,cR="[object Null]",zR="[object Undefined]",V3=U3?U3.toStringTag:void 0;function OR(t){return t==null?t===void 0?zR:cR:V3&&V3 in Object(t)?MR(t):sR(t)}var fs=OR;function lR(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Za=lR,uR=fs,AR=Za,dR="[object AsyncFunction]",fR="[object Function]",qR="[object GeneratorFunction]",hR="[object Proxy]";function WR(t){if(!AR(t))return!1;var e=uR(t);return e==fR||e==qR||e==dR||e==hR}var mR=WR,gR=N2,yR=gR["__core-js_shared__"],RR=yR,Yz=RR,H3=function(){var t=/[^.]+$/.exec(Yz&&Yz.keys&&Yz.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vR(t){return!!H3&&H3 in t}var LR=vR,_R=Function.prototype,NR=_R.toString;function TR(t){if(t!=null){try{return NR.call(t)}catch{}try{return t+""}catch{}}return""}var BA=TR,xR=mR,SR=LR,BR=Za,wR=BA,CR=/[\\^$.*+?()[\]{}|]/g,XR=/^\[object .+?Constructor\]$/,ER=Function.prototype,DR=Object.prototype,IR=ER.toString,PR=DR.hasOwnProperty,FR=RegExp("^"+IR.call(PR).replace(CR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kR(t){if(!BR(t)||SR(t))return!1;var e=xR(t)?FR:XR;return e.test(wR(t))}var jR=kR;function $R(t,e){return t?.[e]}var GR=$R,UR=jR,VR=GR;function HR(t,e){var o=VR(t,e);return UR(o)?o:void 0}var Ja=HR,YR=Ja,KR=N2,QR=YR(KR,"DataView"),ZR=QR,JR=Ja,ev=N2,tv=JR(ev,"Map"),ov=tv,iv=Ja,nv=N2,rv=iv(nv,"Promise"),av=rv,pv=Ja,bv=N2,Mv=pv(bv,"Set"),sv=Mv,cv=Ja,zv=N2,Ov=cv(zv,"WeakMap"),lv=Ov,lO=ZR,uO=ov,AO=av,dO=sv,fO=lv,wA=fs,br=BA,Y3="[object Map]",uv="[object Object]",K3="[object Promise]",Q3="[object Set]",Z3="[object WeakMap]",J3="[object DataView]",Av=br(lO),dv=br(uO),fv=br(AO),qv=br(dO),hv=br(fO),Un=wA;(lO&&Un(new lO(new ArrayBuffer(1)))!=J3||uO&&Un(new uO)!=Y3||AO&&Un(AO.resolve())!=K3||dO&&Un(new dO)!=Q3||fO&&Un(new fO)!=Z3)&&(Un=function(t){var e=wA(t),o=e==uv?t.constructor:void 0,n=o?br(o):"";if(n)switch(n){case Av:return J3;case dv:return Y3;case fv:return K3;case qv:return Q3;case hv:return Z3}return e});function Wv(t){return t!=null&&typeof t=="object"}var UO=Wv,mv=fs,gv=UO,yv="[object Arguments]";function Rv(t){return gv(t)&&mv(t)==yv}var vv=Rv,eu=vv,Lv=UO,CA=Object.prototype,_v=CA.hasOwnProperty,Nv=CA.propertyIsEnumerable;eu(function(){return arguments}());var WM={exports:{}};function Tv(){return!1}var xv=Tv;WM.exports;(function(t,e){var o=N2,n=xv,a=e&&!e.nodeType&&e,p=a&&!0&&t&&!t.nodeType&&t,c=p&&p.exports===a,l=c?o.Buffer:void 0,M=l?l.isBuffer:void 0,g=M||n;t.exports=g})(WM,WM.exports);WM.exports;var mM={exports:{}};mM.exports;(function(t,e){var o=TA,n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,p=a&&a.exports===n,c=p&&o.process,l=function(){try{var M=a&&a.require&&a.require("util").types;return M||c&&c.binding&&c.binding("util")}catch{}}();t.exports=l})(mM,mM.exports);var Sv=mM.exports,tu=Sv;tu&&tu.isTypedArray;class ep extends Error{constructor(e){super(e),this.name="ValidationError",IO(e)}}class ga extends ep{missingFieldId;constructor(e,o){super(`
|
|
32
|
+
[${h+1}] ${this.details[h].message}`;return s+=f,s},y.safeStringify=function(_,O){return JSON.stringify(_,y.serializer(),O)},y.serializer=function(){const _=[],O=[],d=(f,z)=>O[0]===z?"[Circular ~]":"[Circular ~."+_.slice(0,O.indexOf(z)).join(".")+"]";return function(f,z){if(O.length>0){const s=O.indexOf(this);~s?(O.length=s+1,_.length=s+1,_[s]=f):(O.push(this),_.push(f)),~O.indexOf(z)&&(z=d.call(this,f,z))}else O.push(z);if(z){const s=z[y.annotations];if(s){if(Array.isArray(z)){const h=[];for(let A=0;A<z.length;++A)s.errors[A]&&h.push(`_$idx$_${s.errors[A].sort().join(", ")}_$end$_`),h.push(z[A]);z=h}else{for(const h in s.errors)z[`${h}_$key$_${s.errors[h].sort().join(", ")}_$end$_`]=z[h],z[h]=void 0;for(const h in s.missing)z[`_$miss$_${h}|${s.missing[h]}_$end$_`]="__missing__"}return z}}return z===1/0||z===-1/0||Number.isNaN(z)||typeof z=="function"||typeof z=="symbol"?"["+z.toString()+"]":z}}},7629:(p,c,l)=>{const{assert:M,clone:g,deepEqual:y,merge:_}=l(8870),O=l(8652),d=l(8160),f=l(3292),z=l(6354),s=l(8901),h=l(1123),A=l(6914),q=l(2294),v=l(6133),L=l(2305),T=l(8863),w=l(2036),C={Base:class{constructor(R){this.type=R,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new q.Ids,this._preferences=null,this._refs=new v.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return M(typeof h.describe=="function","Manifest functionality disabled"),h.describe(this)}allow(...R){return d.verifyFlat(R,"allow"),this._values(R,"_valids")}alter(R){M(R&&typeof R=="object"&&!Array.isArray(R),"Invalid targets argument"),M(!this._inRuleset(),"Cannot set alterations inside a ruleset");const S=this.clone();S.$_terms.alterations=S.$_terms.alterations||[];for(const E in R){const G=R[E];M(typeof G=="function","Alteration adjuster for",E,"must be a function"),S.$_terms.alterations.push({target:E,adjuster:G})}return S.$_temp.ruleset=!1,S}artifact(R){return M(R!==void 0,"Artifact cannot be undefined"),M(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",R)}cast(R){return M(R===!1||typeof R=="string","Invalid to value"),M(R===!1||this._definition.cast[R],"Type",this.type,"does not support casting to",R),this.$_setFlag("cast",R===!1?void 0:R)}default(R,S){return this._default("default",R,S)}description(R){return M(R&&typeof R=="string","Description must be a non-empty string"),this.$_setFlag("description",R)}empty(R){const S=this.clone();return R!==void 0&&(R=S.$_compile(R,{override:!1})),S.$_setFlag("empty",R,{clone:!1})}error(R){return M(R,"Missing error"),M(R instanceof Error||typeof R=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",R)}example(R,S={}){return M(R!==void 0,"Missing example"),d.assertOptions(S,["override"]),this._inner("examples",R,{single:!0,override:S.override})}external(R,S){return typeof R=="object"&&(M(!S,"Cannot combine options with description"),S=R.description,R=R.method),M(typeof R=="function","Method must be a function"),M(S===void 0||S&&typeof S=="string","Description must be a non-empty string"),this._inner("externals",{method:R,description:S},{single:!0})}failover(R,S){return this._default("failover",R,S)}forbidden(){return this.presence("forbidden")}id(R){return R?(M(typeof R=="string","id must be a non-empty string"),M(/^[^\.]+$/.test(R),"id cannot contain period character"),this.$_setFlag("id",R)):this.$_setFlag("id",void 0)}invalid(...R){return this._values(R,"_invalids")}label(R){return M(R&&typeof R=="string","Label name must be a non-empty string"),this.$_setFlag("label",R)}meta(R){return M(R!==void 0,"Meta cannot be undefined"),this._inner("metas",R,{single:!0})}note(...R){M(R.length,"Missing notes");for(const S of R)M(S&&typeof S=="string","Notes must be non-empty strings");return this._inner("notes",R)}only(R=!0){return M(typeof R=="boolean","Invalid mode:",R),this.$_setFlag("only",R)}optional(){return this.presence("optional")}prefs(R){M(R,"Missing preferences"),M(R.context===void 0,"Cannot override context"),M(R.externals===void 0,"Cannot override externals"),M(R.warnings===void 0,"Cannot override warnings"),M(R.debug===void 0,"Cannot override debug"),d.checkPreferences(R);const S=this.clone();return S._preferences=d.preferences(S._preferences,R),S}presence(R){return M(["optional","required","forbidden"].includes(R),"Unknown presence mode",R),this.$_setFlag("presence",R)}raw(R=!0){return this.$_setFlag("result",R?"raw":void 0)}result(R){return M(["raw","strip"].includes(R),"Unknown result mode",R),this.$_setFlag("result",R)}required(){return this.presence("required")}strict(R){const S=this.clone(),E=R!==void 0&&!R;return S._preferences=d.preferences(S._preferences,{convert:E}),S}strip(R=!0){return this.$_setFlag("result",R?"strip":void 0)}tag(...R){M(R.length,"Missing tags");for(const S of R)M(S&&typeof S=="string","Tags must be non-empty strings");return this._inner("tags",R)}unit(R){return M(R&&typeof R=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",R)}valid(...R){d.verifyFlat(R,"valid");const S=this.allow(...R);return S.$_setFlag("only",!!S._valids,{clone:!1}),S}when(R,S){const E=this.clone();E.$_terms.whens||(E.$_terms.whens=[]);const G=f.when(E,R,S);if(!["any","link"].includes(E.type)){const s0=G.is?[G]:G.switch;for(const b0 of s0)M(!b0.then||b0.then.type==="any"||b0.then.type===E.type,"Cannot combine",E.type,"with",b0.then&&b0.then.type),M(!b0.otherwise||b0.otherwise.type==="any"||b0.otherwise.type===E.type,"Cannot combine",E.type,"with",b0.otherwise&&b0.otherwise.type)}return E.$_terms.whens.push(G),E.$_mutateRebuild()}cache(R){M(!this._inRuleset(),"Cannot set caching inside a ruleset"),M(!this._cache,"Cannot override schema cache"),M(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const S=this.clone();return S._cache=R||O.provider.provision(),S.$_temp.ruleset=!1,S}clone(){const R=Object.create(Object.getPrototypeOf(this));return this._assign(R)}concat(R){M(d.isSchema(R),"Invalid schema object"),M(this.type==="any"||R.type==="any"||R.type===this.type,"Cannot merge type",this.type,"with another type:",R.type),M(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),M(!R._inRuleset(),"Cannot concatenate a schema with open ruleset");let S=this.clone();if(this.type==="any"&&R.type!=="any"){const E=R.clone();for(const G of Object.keys(S))G!=="type"&&(E[G]=S[G]);S=E}S._ids.concat(R._ids),S._refs.register(R,v.toSibling),S._preferences=S._preferences?d.preferences(S._preferences,R._preferences):R._preferences,S._valids=w.merge(S._valids,R._valids,R._invalids),S._invalids=w.merge(S._invalids,R._invalids,R._valids);for(const E of R._singleRules.keys())S._singleRules.has(E)&&(S._rules=S._rules.filter(G=>G.keep||G.name!==E),S._singleRules.delete(E));for(const E of R._rules)R._definition.rules[E.method].multi||S._singleRules.set(E.name,E),S._rules.push(E);if(S._flags.empty&&R._flags.empty){S._flags.empty=S._flags.empty.concat(R._flags.empty);const E=Object.assign({},R._flags);delete E.empty,_(S._flags,E)}else if(R._flags.empty){S._flags.empty=R._flags.empty;const E=Object.assign({},R._flags);delete E.empty,_(S._flags,E)}else _(S._flags,R._flags);for(const E in R.$_terms){const G=R.$_terms[E];G?S.$_terms[E]?S.$_terms[E]=S.$_terms[E].concat(G):S.$_terms[E]=G.slice():S.$_terms[E]||(S.$_terms[E]=G)}return this.$_root._tracer&&this.$_root._tracer._combine(S,[this,R]),S.$_mutateRebuild()}extend(R){return M(!R.base,"Cannot extend type with another base"),s.type(this,R)}extract(R){return R=Array.isArray(R)?R:R.split("."),this._ids.reach(R)}fork(R,S){M(!this._inRuleset(),"Cannot fork inside a ruleset");let E=this;for(let G of[].concat(R))G=Array.isArray(G)?G:G.split("."),E=E._ids.fork(G,S,E);return E.$_temp.ruleset=!1,E}rule(R){const S=this._definition;d.assertOptions(R,Object.keys(S.modifiers)),M(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const E=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;M(E>=0&&E<this._rules.length,"Cannot apply rules to empty ruleset");const G=this.clone();for(let s0=E;s0<G._rules.length;++s0){const b0=G._rules[s0],V=g(b0);for(const Z in R)S.modifiers[Z](V,R[Z]),M(V.name===b0.name,"Cannot change rule name");G._rules[s0]=V,G._singleRules.get(V.name)===b0&&G._singleRules.set(V.name,V)}return G.$_temp.ruleset=!1,G.$_mutateRebuild()}get ruleset(){M(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const R=this.clone();return R.$_temp.ruleset=R._rules.length,R}get $(){return this.ruleset}tailor(R){R=[].concat(R),M(!this._inRuleset(),"Cannot tailor inside a ruleset");let S=this;if(this.$_terms.alterations)for(const{target:E,adjuster:G}of this.$_terms.alterations)R.includes(E)&&(S=G(S),M(d.isSchema(S),"Alteration adjuster for",E,"failed to return a schema object"));return S=S.$_modify({each:E=>E.tailor(R),ref:!1}),S.$_temp.ruleset=!1,S.$_mutateRebuild()}tracer(){return L.location?L.location(this):this}validate(R,S){return T.entry(R,this,S)}validateAsync(R,S){return T.entryAsync(R,this,S)}$_addRule(R){typeof R=="string"&&(R={name:R}),M(R&&typeof R=="object","Invalid options"),M(R.name&&typeof R.name=="string","Invalid rule name");for(const b0 in R)M(b0[0]!=="_","Cannot set private rule properties");const S=Object.assign({},R);S._resolve=[],S.method=S.method||S.name;const E=this._definition.rules[S.method],G=S.args;M(E,"Unknown rule",S.method);const s0=this.clone();if(G){M(Object.keys(G).length===1||Object.keys(G).length===this._definition.rules[S.name].args.length,"Invalid rule definition for",this.type,S.name);for(const b0 in G){let V=G[b0];if(E.argsByName){const Z=E.argsByName.get(b0);if(Z.ref&&d.isResolvable(V))S._resolve.push(b0),s0.$_mutateRegister(V);else if(Z.normalize&&(V=Z.normalize(V),G[b0]=V),Z.assert){const d0=d.validateArg(V,b0,Z);M(!d0,d0,"or reference")}}V!==void 0?G[b0]=V:delete G[b0]}}return E.multi||(s0._ruleRemove(S.name,{clone:!1}),s0._singleRules.set(S.name,S)),s0.$_temp.ruleset===!1&&(s0.$_temp.ruleset=null),E.priority?s0._rules.unshift(S):s0._rules.push(S),s0}$_compile(R,S){return f.schema(this.$_root,R,S)}$_createError(R,S,E,G,s0,b0={}){const V=b0.flags!==!1?this._flags:{},Z=b0.messages?A.merge(this._definition.messages,b0.messages):this._definition.messages;return new z.Report(R,S,E,V,Z,G,s0)}$_getFlag(R){return this._flags[R]}$_getRule(R){return this._singleRules.get(R)}$_mapLabels(R){return R=Array.isArray(R)?R:R.split("."),this._ids.labels(R)}$_match(R,S,E,G){(E=Object.assign({},E)).abortEarly=!0,E._externals=!1,S.snapshot();const s0=!T.validate(R,this,S,E,G).errors;return S.restore(),s0}$_modify(R){return d.assertOptions(R,["each","once","ref","schema"]),q.schema(this,R)||this}$_mutateRebuild(){return M(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(R,{source:S,name:E,path:G,key:s0})=>{const b0=this._definition[S][E]&&this._definition[S][E].register;b0!==!1&&this.$_mutateRegister(R,{family:b0,key:s0})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(R,{family:S,key:E}={}){this._refs.register(R,S),this._ids.register(R,{key:E})}$_property(R){return this._definition.properties[R]}$_reach(R){return this._ids.reach(R)}$_rootReferences(){return this._refs.roots()}$_setFlag(R,S,E={}){M(R[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const G=this._definition.flags[R]||{};if(y(S,G.default)&&(S=void 0),y(S,this._flags[R]))return this;const s0=E.clone!==!1?this.clone():this;return S!==void 0?(s0._flags[R]=S,s0.$_mutateRegister(S)):delete s0._flags[R],R[0]!=="_"&&(s0.$_temp.ruleset=!1),s0}$_parent(R,...S){return this[R][d.symbols.parent].call(this,...S)}$_validate(R,S,E){return T.validate(R,this,S,E)}_assign(R){R.type=this.type,R.$_root=this.$_root,R.$_temp=Object.assign({},this.$_temp),R.$_temp.whens={},R._ids=this._ids.clone(),R._preferences=this._preferences,R._valids=this._valids&&this._valids.clone(),R._invalids=this._invalids&&this._invalids.clone(),R._rules=this._rules.slice(),R._singleRules=g(this._singleRules,{shallow:!0}),R._refs=this._refs.clone(),R._flags=Object.assign({},this._flags),R._cache=null,R.$_terms={};for(const S in this.$_terms)R.$_terms[S]=this.$_terms[S]?this.$_terms[S].slice():null;R.$_super={};for(const S in this.$_super)R.$_super[S]=this._super[S].bind(R);return R}_bare(){const R=this.clone();R._reset();const S=R._definition.terms;for(const E in S){const G=S[E];R.$_terms[E]=G.init}return R.$_mutateRebuild()}_default(R,S,E={}){return d.assertOptions(E,"literal"),M(S!==void 0,"Missing",R,"value"),M(typeof S=="function"||!E.literal,"Only function value supports literal option"),typeof S=="function"&&E.literal&&(S={[d.symbols.literal]:!0,literal:S}),this.$_setFlag(R,S)}_generate(R,S,E){if(!this.$_terms.whens)return{schema:this};const G=[],s0=[];for(let Z=0;Z<this.$_terms.whens.length;++Z){const d0=this.$_terms.whens[Z];if(d0.concat){G.push(d0.concat),s0.push(`${Z}.concat`);continue}const v0=d0.ref?d0.ref.resolve(R,S,E):R,E0=d0.is?[d0]:d0.switch,S0=s0.length;for(let G0=0;G0<E0.length;++G0){const{is:v1,then:h1,otherwise:Y1}=E0[G0],Oe=`${Z}${d0.switch?"."+G0:""}`;if(v1.$_match(v0,S.nest(v1,`${Oe}.is`),E)){if(h1){const le=S.localize([...S.path,`${Oe}.then`],S.ancestors,S.schemas),{schema:e1,id:B1}=h1._generate(R,le,E);G.push(e1),s0.push(`${Oe}.then${B1?`(${B1})`:""}`);break}}else if(Y1){const le=S.localize([...S.path,`${Oe}.otherwise`],S.ancestors,S.schemas),{schema:e1,id:B1}=Y1._generate(R,le,E);G.push(e1),s0.push(`${Oe}.otherwise${B1?`(${B1})`:""}`);break}}if(d0.break&&s0.length>S0)break}const b0=s0.join(", ");if(S.mainstay.tracer.debug(S,"rule","when",b0),!b0)return{schema:this};if(!S.mainstay.tracer.active&&this.$_temp.whens[b0])return{schema:this.$_temp.whens[b0],id:b0};let V=this;this._definition.generate&&(V=this._definition.generate(this,R,S,E));for(const Z of G)V=V.concat(Z);return this.$_root._tracer&&this.$_root._tracer._combine(V,[this,...G]),this.$_temp.whens[b0]=V,{schema:V,id:b0}}_inner(R,S,E={}){M(!this._inRuleset(),`Cannot set ${R} inside a ruleset`);const G=this.clone();return G.$_terms[R]&&!E.override||(G.$_terms[R]=[]),E.single?G.$_terms[R].push(S):G.$_terms[R].push(...S),G.$_temp.ruleset=!1,G}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(R,S={}){if(!this._singleRules.has(R))return this;const E=S.clone!==!1?this.clone():this;E._singleRules.delete(R);const G=[];for(let s0=0;s0<E._rules.length;++s0){const b0=E._rules[s0];b0.name!==R||b0.keep?G.push(b0):E._inRuleset()&&s0<E.$_temp.ruleset&&--E.$_temp.ruleset}return E._rules=G,E}_values(R,S){d.verifyFlat(R,S.slice(1,-1));const E=this.clone(),G=R[0]===d.symbols.override;if(G&&(R=R.slice(1)),!E[S]&&R.length?E[S]=new w:G&&(E[S]=R.length?new w:null,E.$_mutateRebuild()),!E[S])return E;G&&E[S].override();for(const s0 of R){M(s0!==void 0,"Cannot call allow/valid/invalid with undefined"),M(s0!==d.symbols.override,"Override must be the first value");const b0=S==="_invalids"?"_valids":"_invalids";E[b0]&&(E[b0].remove(s0),E[b0].length||(M(S==="_valids"||!E._flags.only,"Setting invalid value",s0,"leaves schema rejecting all values due to previous valid rule"),E[b0]=null)),E[S].add(s0,E._refs)}return E}}};C.Base.prototype[d.symbols.any]={version:d.version,compile:f.compile,root:"$_root"},C.Base.prototype.isImmutable=!0,C.Base.prototype.deny=C.Base.prototype.invalid,C.Base.prototype.disallow=C.Base.prototype.invalid,C.Base.prototype.equal=C.Base.prototype.valid,C.Base.prototype.exist=C.Base.prototype.required,C.Base.prototype.not=C.Base.prototype.invalid,C.Base.prototype.options=C.Base.prototype.prefs,C.Base.prototype.preferences=C.Base.prototype.prefs,p.exports=new C.Base},8652:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(8160),_={max:1e3,supported:new Set(["undefined","boolean","number","string"])};c.provider={provision:O=>new _.Cache(O)},_.Cache=class{constructor(O={}){y.assertOptions(O,["max"]),M(O.max===void 0||O.max&&O.max>0&&isFinite(O.max),"Invalid max cache size"),this._max=O.max||_.max,this._map=new Map,this._list=new _.List}get length(){return this._map.size}set(O,d){if(O!==null&&!_.supported.has(typeof O))return;let f=this._map.get(O);if(f)return f.value=d,void this._list.first(f);f=this._list.unshift({key:O,value:d}),this._map.set(O,f),this._compact()}get(O){const d=this._map.get(O);if(d)return this._list.first(d),g(d.value)}_compact(){if(this._map.size>this._max){const O=this._list.pop();this._map.delete(O.key)}}},_.List=class{constructor(){this.tail=null,this.head=null}unshift(O){return O.next=null,O.prev=this.head,this.head&&(this.head.next=O),this.head=O,this.tail||(this.tail=O),O}first(O){O!==this.head&&(this._remove(O),this.unshift(O))}pop(){return this._remove(this.tail)}_remove(O){const{next:d,prev:f}=O;return d.prev=f,f&&(f.next=d),O===this.tail&&(this.tail=d),O.prev=null,O.next=null,O}}},8160:(p,c,l)=>{const{assert:M,AssertError:g}=l(8870),y=l(5934);let _,O;const d={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};c.version=y.version,c.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},c.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},c.assertOptions=function(f,z,s="Options"){M(f&&typeof f=="object"&&!Array.isArray(f),"Options must be of type object");const h=Object.keys(f).filter(A=>!z.includes(A));M(h.length===0,`${s} contain unknown keys: ${h}`)},c.checkPreferences=function(f){O=O||l(3378);const z=O.preferences.validate(f);if(z.error)throw new g([z.error.details[0].message])},c.compare=function(f,z,s){switch(s){case"=":return f===z;case">":return f>z;case"<":return f<z;case">=":return f>=z;case"<=":return f<=z}},c.default=function(f,z){return f===void 0?z:f},c.isIsoDate=function(f){return d.isoDate.test(f)},c.isNumber=function(f){return typeof f=="number"&&!isNaN(f)},c.isResolvable=function(f){return!!f&&(f[c.symbols.ref]||f[c.symbols.template])},c.isSchema=function(f,z={}){const s=f&&f[c.symbols.any];return!!s&&(M(z.legacy||s.version===c.version,"Cannot mix different versions of joi schemas"),!0)},c.isValues=function(f){return f[c.symbols.values]},c.limit=function(f){return Number.isSafeInteger(f)&&f>=0},c.preferences=function(f,z){_=_||l(6914),f=f||{},z=z||{};const s=Object.assign({},f,z);return z.errors&&f.errors&&(s.errors=Object.assign({},f.errors,z.errors),s.errors.wrap=Object.assign({},f.errors.wrap,z.errors.wrap)),z.messages&&(s.messages=_.compile(z.messages,f.messages)),delete s[c.symbols.prefs],s},c.tryWithPath=function(f,z,s={}){try{return f()}catch(h){throw h.path!==void 0?h.path=z+"."+h.path:h.path=z,s.append&&(h.message=`${h.message} (${h.path})`),h}},c.validateArg=function(f,z,{assert:s,message:h}){if(c.isSchema(s)){const A=s.validate(f);return A.error?A.error.message:void 0}if(!s(f))return z?`${z} ${h}`:h},c.verifyFlat=function(f,z){for(const s of f)M(!Array.isArray(s),"Method no longer accepts array arguments:",z)}},3292:(p,c,l)=>{const{assert:M}=l(8870),g=l(8160),y=l(6133),_={};c.schema=function(O,d,f={}){g.assertOptions(f,["appendPath","override"]);try{return _.schema(O,d,f)}catch(z){throw f.appendPath&&z.path!==void 0&&(z.message=`${z.message} (${z.path})`),z}},_.schema=function(O,d,f){M(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(M(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const z=(s,...h)=>f.override!==!1?s.valid(O.override,...h):s.valid(...h);if(_.simple(d))return z(O,d);if(typeof d=="function")return O.custom(d);if(M(typeof d=="object","Invalid schema content:",typeof d),g.isResolvable(d))return z(O,d);if(g.isSchema(d))return d;if(Array.isArray(d)){for(const s of d)if(!_.simple(s))return O.alternatives().try(...d);return z(O,...d)}return d instanceof RegExp?O.string().regex(d):d instanceof Date?z(O.date(),d):(M(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),O.object().keys(d))},c.ref=function(O,d){return y.isRef(O)?O:y.create(O,d)},c.compile=function(O,d,f={}){g.assertOptions(f,["legacy"]);const z=d&&d[g.symbols.any];if(z)return M(f.legacy||z.version===g.version,"Cannot mix different versions of joi schemas:",z.version,g.version),d;if(typeof d!="object"||!f.legacy)return c.schema(O,d,{appendPath:!0});const s=_.walk(d);return s?s.compile(s.root,d):c.schema(O,d,{appendPath:!0})},_.walk=function(O){if(typeof O!="object")return null;if(Array.isArray(O)){for(const f of O){const z=_.walk(f);if(z)return z}return null}const d=O[g.symbols.any];if(d)return{root:O[d.root],compile:d.compile};M(Object.getPrototypeOf(O)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const f in O){const z=_.walk(O[f]);if(z)return z}return null},_.simple=function(O){return O===null||["boolean","string","number"].includes(typeof O)},c.when=function(O,d,f){if(f===void 0&&(M(d&&typeof d=="object","Missing options"),f=d,d=y.create(".")),Array.isArray(f)&&(f={switch:f}),g.assertOptions(f,["is","not","then","otherwise","switch","break"]),g.isSchema(d))return M(f.is===void 0,'"is" can not be used with a schema condition'),M(f.not===void 0,'"not" can not be used with a schema condition'),M(f.switch===void 0,'"switch" can not be used with a schema condition'),_.condition(O,{is:d,then:f.then,otherwise:f.otherwise,break:f.break});if(M(y.isRef(d)||typeof d=="string","Invalid condition:",d),M(f.not===void 0||f.is===void 0,'Cannot combine "is" with "not"'),f.switch===void 0){let s=f;f.not!==void 0&&(s={is:f.not,then:f.otherwise,otherwise:f.then,break:f.break});let h=s.is!==void 0?O.$_compile(s.is):O.$_root.invalid(null,!1,0,"").required();return M(s.then!==void 0||s.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),M(s.break===void 0||s.then===void 0||s.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),f.is===void 0||y.isRef(f.is)||g.isSchema(f.is)||(h=h.required()),_.condition(O,{ref:c.ref(d),is:h,then:s.then,otherwise:s.otherwise,break:s.break})}M(Array.isArray(f.switch),'"switch" must be an array'),M(f.is===void 0,'Cannot combine "switch" with "is"'),M(f.not===void 0,'Cannot combine "switch" with "not"'),M(f.then===void 0,'Cannot combine "switch" with "then"');const z={ref:c.ref(d),switch:[],break:f.break};for(let s=0;s<f.switch.length;++s){const h=f.switch[s],A=s===f.switch.length-1;g.assertOptions(h,A?["is","then","otherwise"]:["is","then"]),M(h.is!==void 0,'Switch statement missing "is"'),M(h.then!==void 0,'Switch statement missing "then"');const q={is:O.$_compile(h.is),then:O.$_compile(h.then)};if(y.isRef(h.is)||g.isSchema(h.is)||(q.is=q.is.required()),A){M(f.otherwise===void 0||h.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const v=f.otherwise!==void 0?f.otherwise:h.otherwise;v!==void 0&&(M(z.break===void 0,"Cannot specify both otherwise and break"),q.otherwise=O.$_compile(v))}z.switch.push(q)}return z},_.condition=function(O,d){for(const f of["then","otherwise"])d[f]===void 0?delete d[f]:d[f]=O.$_compile(d[f]);return d}},6354:(p,c,l)=>{const M=l(514),g=l(8160),y=l(3328);c.Report=class{constructor(_,O,d,f,z,s,h){if(this.code=_,this.flags=f,this.messages=z,this.path=s.path,this.prefs=h,this.state=s,this.value=O,this.message=null,this.template=null,this.local=d||{},this.local.label=c.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const A=this.path[this.path.length-1];typeof A!="object"&&(this.local.key=A)}}_setTemplate(_){if(this.template=_,!this.flags.label&&this.path.length===0){const O=this._template(this.template,"root");O&&(this.local.label=O)}}toString(){if(this.message)return this.message;const _=this.code;if(!this.prefs.errors.render)return this.code;const O=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return O===void 0?`Error code "${_}" is not defined, your custom type is missing the correct messages definition`:(this.message=O.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(_,O){return c.template(this.value,_,O||this.code,this.state,this.prefs)}},c.path=function(_){let O="";for(const d of _)typeof d!="object"&&(typeof d=="string"?(O&&(O+="."),O+=d):O+=`[${d}]`);return O},c.template=function(_,O,d,f,z){if(!O)return;if(y.isTemplate(O))return d!=="root"?O:null;let s=z.errors.language;if(g.isResolvable(s)&&(s=s.resolve(_,f,z)),s&&O[s]){if(O[s][d]!==void 0)return O[s][d];if(O[s]["*"]!==void 0)return O[s]["*"]}return O[d]?O[d]:O["*"]},c.label=function(_,O,d,f){if(_.label)return _.label;if(!d.errors.label)return"";let z=O.path;return d.errors.label==="key"&&O.path.length>1&&(z=O.path.slice(-1)),c.path(z)||c.template(null,d.messages,"root",O,d)||f&&c.template(null,f,"root",O,d)||"value"},c.process=function(_,O,d){if(!_)return null;const{override:f,message:z,details:s}=c.details(_);if(f)return f;if(d.errors.stack)return new c.ValidationError(z,s,O);const h=Error.stackTraceLimit;Error.stackTraceLimit=0;const A=new c.ValidationError(z,s,O);return Error.stackTraceLimit=h,A},c.details=function(_,O={}){let d=[];const f=[];for(const z of _){if(z instanceof Error){if(O.override!==!1)return{override:z};const h=z.toString();d.push(h),f.push({message:h,type:"override",context:{error:z}});continue}const s=z.toString();d.push(s),f.push({message:s,path:z.path.filter(h=>typeof h!="object"),type:z.code,context:z.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:f}},c.ValidationError=class extends Error{constructor(_,O,d){super(_),this._original=d,this.details=O}static isError(_){return _ instanceof c.ValidationError}},c.ValidationError.prototype.isJoi=!0,c.ValidationError.prototype.name="ValidationError",c.ValidationError.prototype.annotate=M.error},8901:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(8160),_=l(6914),O={};c.type=function(d,f){const z=Object.getPrototypeOf(d),s=g(z),h=d._assign(Object.create(s)),A=Object.assign({},f);delete A.base,s._definition=A;const q=z._definition||{};A.messages=_.merge(q.messages,A.messages),A.properties=Object.assign({},q.properties,A.properties),h.type=A.type,A.flags=Object.assign({},q.flags,A.flags);const v=Object.assign({},q.terms);if(A.terms)for(const C in A.terms){const R=A.terms[C];M(h.$_terms[C]===void 0,"Invalid term override for",A.type,C),h.$_terms[C]=R.init,v[C]=R}A.terms=v,A.args||(A.args=q.args),A.prepare=O.prepare(A.prepare,q.prepare),A.coerce&&(typeof A.coerce=="function"&&(A.coerce={method:A.coerce}),A.coerce.from&&!Array.isArray(A.coerce.from)&&(A.coerce={method:A.coerce.method,from:[].concat(A.coerce.from)})),A.coerce=O.coerce(A.coerce,q.coerce),A.validate=O.validate(A.validate,q.validate);const L=Object.assign({},q.rules);if(A.rules)for(const C in A.rules){const R=A.rules[C];M(typeof R=="object","Invalid rule definition for",A.type,C);let S=R.method;if(S===void 0&&(S=function(){return this.$_addRule(C)}),S&&(M(!s[C],"Rule conflict in",A.type,C),s[C]=S),M(!L[C],"Rule conflict in",A.type,C),L[C]=R,R.alias){const E=[].concat(R.alias);for(const G of E)s[G]=R.method}R.args&&(R.argsByName=new Map,R.args=R.args.map(E=>(typeof E=="string"&&(E={name:E}),M(!R.argsByName.has(E.name),"Duplicated argument name",E.name),y.isSchema(E.assert)&&(E.assert=E.assert.strict().label(E.name)),R.argsByName.set(E.name,E),E)))}A.rules=L;const T=Object.assign({},q.modifiers);if(A.modifiers)for(const C in A.modifiers){M(!s[C],"Rule conflict in",A.type,C);const R=A.modifiers[C];M(typeof R=="function","Invalid modifier definition for",A.type,C);const S=function(E){return this.rule({[C]:E})};s[C]=S,T[C]=R}if(A.modifiers=T,A.overrides){s._super=z,h.$_super={};for(const C in A.overrides)M(z[C],"Cannot override missing",C),A.overrides[C][y.symbols.parent]=z[C],h.$_super[C]=z[C].bind(h);Object.assign(s,A.overrides)}A.cast=Object.assign({},q.cast,A.cast);const w=Object.assign({},q.manifest,A.manifest);return w.build=O.build(A.manifest&&A.manifest.build,q.manifest&&q.manifest.build),A.manifest=w,A.rebuild=O.rebuild(A.rebuild,q.rebuild),h},O.build=function(d,f){return d&&f?function(z,s){return f(d(z,s),s)}:d||f},O.coerce=function(d,f){return d&&f?{from:d.from&&f.from?[...new Set([...d.from,...f.from])]:null,method(z,s){let h;if((!f.from||f.from.includes(typeof z))&&(h=f.method(z,s),h)){if(h.errors||h.value===void 0)return h;z=h.value}if(!d.from||d.from.includes(typeof z)){const A=d.method(z,s);if(A)return A}return h}}:d||f},O.prepare=function(d,f){return d&&f?function(z,s){const h=d(z,s);if(h){if(h.errors||h.value===void 0)return h;z=h.value}return f(z,s)||h}:d||f},O.rebuild=function(d,f){return d&&f?function(z){f(z),d(z)}:d||f},O.validate=function(d,f){return d&&f?function(z,s){const h=f(z,s);if(h){if(h.errors&&(!Array.isArray(h.errors)||h.errors.length))return h;z=h.value}return d(z,s)||h}:d||f}},5107:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(8652),_=l(8160),O=l(3292),d=l(6354),f=l(8901),z=l(1123),s=l(6133),h=l(3328),A=l(2305);let q;const v={types:{alternatives:l(4946),any:l(8068),array:l(546),boolean:l(4937),date:l(7500),function:l(390),link:l(8785),number:l(3832),object:l(8966),string:l(7417),symbol:l(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const L={_types:new Set(Object.keys(v.types))};for(const T of L._types)L[T]=function(...w){return M(!w.length||["alternatives","link","object"].includes(T),"The",T,"type does not allow arguments"),v.generate(this,v.types[T],w)};for(const T of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])L[T]=function(...w){return this.any()[T](...w)};Object.assign(L,v.methods);for(const T in v.aliases){const w=v.aliases[T];L[T]=L[w]}return L.x=L.expression,A.setup&&A.setup(L),L}};v.methods={ValidationError:d.ValidationError,version:_.version,cache:y.provider,assert(L,T,...w){v.assert(L,T,!0,w)},attempt:(L,T,...w)=>v.assert(L,T,!1,w),build(L){return M(typeof z.build=="function","Manifest functionality disabled"),z.build(this,L)},checkPreferences(L){_.checkPreferences(L)},compile(L,T){return O.compile(this,L,T)},defaults(L){M(typeof L=="function","modifier must be a function");const T=Object.assign({},this);for(const w of T._types){const C=L(T[w]());M(_.isSchema(C),"modifier must return a valid schema object"),T[w]=function(...R){return v.generate(this,C,R)}}return T},expression:(...L)=>new h(...L),extend(...L){_.verifyFlat(L,"extend"),q=q||l(3378),M(L.length,"You need to provide at least one extension"),this.assert(L,q.extensions);const T=Object.assign({},this);T._types=new Set(T._types);for(let w of L){typeof w=="function"&&(w=w(T)),this.assert(w,q.extension);const C=v.expandExtension(w,T);for(const R of C){M(T[R.type]===void 0||T._types.has(R.type),"Cannot override name",R.type);const S=R.base||this.any(),E=f.type(S,R);T._types.add(R.type),T[R.type]=function(...G){return v.generate(this,E,G)}}}return T},isError:d.ValidationError.isError,isExpression:h.isTemplate,isRef:s.isRef,isSchema:_.isSchema,in:(...L)=>s.in(...L),override:_.symbols.override,ref:(...L)=>s.create(...L),types(){const L={};for(const T of this._types)L[T]=this[T]();for(const T in v.aliases)L[T]=this[T]();return L}},v.assert=function(L,T,w,C){const R=C[0]instanceof Error||typeof C[0]=="string"?C[0]:null,S=R!==null?C[1]:C[0],E=T.validate(L,_.preferences({errors:{stack:!0}},S||{}));let G=E.error;if(!G)return E.value;if(R instanceof Error)throw R;const s0=w&&typeof G.annotate=="function"?G.annotate():G.message;throw G instanceof d.ValidationError==0&&(G=g(G)),G.message=R?`${R} ${s0}`:s0,G},v.generate=function(L,T,w){return M(L,"Must be invoked on a Joi instance."),T.$_root=L,T._definition.args&&w.length?T._definition.args(T,...w):T},v.expandExtension=function(L,T){if(typeof L.type=="string")return[L];const w=[];for(const C of T._types)if(L.type.test(C)){const R=Object.assign({},L);R.type=C,R.base=T[C](),w.push(R)}return w},p.exports=v.root()},1123:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(8160),_=l(6914),O=l(6133),d=l(3328);let f;const z={};c.describe=function(s){const h=s._definition,A={type:s.type,flags:{},rules:[]};for(const q in s._flags)q[0]!=="_"&&(A.flags[q]=z.describe(s._flags[q]));Object.keys(A.flags).length||delete A.flags,s._preferences&&(A.preferences=g(s._preferences,{shallow:["messages"]}),delete A.preferences[y.symbols.prefs],A.preferences.messages&&(A.preferences.messages=_.decompile(A.preferences.messages))),s._valids&&(A.allow=s._valids.describe()),s._invalids&&(A.invalid=s._invalids.describe());for(const q of s._rules){if(h.rules[q.name].manifest===!1)continue;const v={name:q.name};for(const L in h.modifiers)q[L]!==void 0&&(v[L]=z.describe(q[L]));if(q.args){v.args={};for(const L in q.args){const T=q.args[L];(L!=="options"||Object.keys(T).length)&&(v.args[L]=z.describe(T,{assign:L}))}Object.keys(v.args).length||delete v.args}A.rules.push(v)}A.rules.length||delete A.rules;for(const q in s.$_terms){if(q[0]==="_")continue;M(!A[q],"Cannot describe schema due to internal name conflict with",q);const v=s.$_terms[q];if(!v)continue;if(v instanceof Map){v.size&&(A[q]=[...v.entries()]);continue}if(y.isValues(v)){A[q]=v.describe();continue}M(h.terms[q],"Term",q,"missing configuration");const L=h.terms[q].manifest,T=typeof L=="object";if(!v.length&&!T)continue;const w=[];for(const C of v)w.push(z.describe(C));if(T){const{from:C,to:R}=L.mapped;A[q]={};for(const S of w)A[q][S[R]]=S[C]}else L!=="single"?A[q]=w:(M(w.length===1,"Term",q,"contains more than one item"),A[q]=w[0])}return z.validate(s.$_root,A),A},z.describe=function(s,h={}){if(Array.isArray(s))return s.map(z.describe);if(s===y.symbols.deepDefault)return{special:"deep"};if(typeof s!="object"||s===null)return s;if(h.assign==="options")return g(s);if(s instanceof Date)return s.toISOString();if(s instanceof Error)return s;if(s instanceof RegExp)return h.assign==="regex"?s.toString():{regex:s.toString()};if(s[y.symbols.literal])return{function:s.literal};if(typeof s.describe=="function")return h.assign==="ref"?s.describe().ref:s.describe();const A={};for(const q in s){const v=s[q];v!==void 0&&(A[q]=z.describe(v,{assign:q}))}return A},c.build=function(s,h){return new z.Builder(s).parse(h)},z.Builder=class{constructor(s){this.joi=s}parse(s){z.validate(this.joi,s);let h=this.joi[s.type]()._bare();const A=h._definition;if(s.flags)for(const v in s.flags){const L=A.flags[v]&&A.flags[v].setter||v;M(typeof h[L]=="function","Invalid flag",v,"for type",s.type),h=h[L](this.build(s.flags[v]))}if(s.preferences&&(h=h.preferences(this.build(s.preferences))),s.allow&&(h=h.allow(...this.build(s.allow))),s.invalid&&(h=h.invalid(...this.build(s.invalid))),s.rules)for(const v of s.rules){M(typeof h[v.name]=="function","Invalid rule",v.name,"for type",s.type);const L=[];if(v.args){const w={};for(const S in v.args)w[S]=this.build(v.args[S],{assign:S});const C=Object.keys(w),R=A.rules[v.name].args;if(R){M(C.length<=R.length,"Invalid number of arguments for",s.type,v.name,"(expected up to",R.length,", found",C.length,")");for(const{name:S}of R)L.push(w[S])}else M(C.length===1,"Invalid number of arguments for",s.type,v.name,"(expected up to 1, found",C.length,")"),L.push(w[C[0]])}h=h[v.name](...L);const T={};for(const w in A.modifiers)v[w]!==void 0&&(T[w]=this.build(v[w]));Object.keys(T).length&&(h=h.rule(T))}const q={};for(const v in s){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(v))continue;M(A.terms[v],"Term",v,"missing configuration");const L=A.terms[v].manifest;if(L!=="schema")if(L!=="values")if(L!=="single")if(typeof L!="object")q[v]=this.build(s[v]);else{q[v]={};for(const T in s[v]){const w=s[v][T];q[v][T]=this.parse(w)}}else q[v]=this.build(s[v]);else q[v]=s[v].map(T=>this.build(T));else q[v]=s[v].map(T=>this.parse(T))}return s.whens&&(q.whens=s.whens.map(v=>this.build(v))),h=A.manifest.build(h,q),h.$_temp.ruleset=!1,h}build(s,h={}){if(s===null)return null;if(Array.isArray(s))return s.map(q=>this.build(q));if(s instanceof Error)return s;if(h.assign==="options")return g(s);if(h.assign==="regex")return z.regex(s);if(h.assign==="ref")return O.build(s);if(typeof s!="object")return s;if(Object.keys(s).length===1){if(s.buffer)return M(!1,"Buffers are not supported"),!1;if(s.function)return{[y.symbols.literal]:!0,literal:s.function};if(s.override)return y.symbols.override;if(s.ref)return O.build(s.ref);if(s.regex)return z.regex(s.regex);if(s.special)return M(["deep"].includes(s.special),"Unknown special value",s.special),y.symbols.deepDefault;if(s.value)return g(s.value)}if(s.type)return this.parse(s);if(s.template)return d.build(s);const A={};for(const q in s)A[q]=this.build(s[q],{assign:q});return A}},z.regex=function(s){const h=s.lastIndexOf("/"),A=s.slice(1,h),q=s.slice(h+1);return new RegExp(A,q)},z.validate=function(s,h){f=f||l(3378),s.assert(h,f.description)}},6914:(p,c,l)=>{const{assert:M,clone:g}=l(8870),y=l(3328);c.compile=function(_,O){if(typeof _=="string")return M(!O,"Cannot set single message string"),new y(_);if(y.isTemplate(_))return M(!O,"Cannot set single message template"),_;M(typeof _=="object"&&!Array.isArray(_),"Invalid message options"),O=O?g(O):{};for(let d in _){const f=_[d];if(d==="root"||y.isTemplate(f)){O[d]=f;continue}if(typeof f=="string"){O[d]=new y(f);continue}M(typeof f=="object"&&!Array.isArray(f),"Invalid message for",d);const z=d;for(d in O[z]=O[z]||{},f){const s=f[d];d==="root"||y.isTemplate(s)?O[z][d]=s:(M(typeof s=="string","Invalid message for",d,"in",z),O[z][d]=new y(s))}}return O},c.decompile=function(_){const O={};for(let d in _){const f=_[d];if(d==="root"){O.root=f;continue}if(y.isTemplate(f)){O[d]=f.describe({compact:!0});continue}const z=d;for(d in O[z]={},f){const s=f[d];d!=="root"?O[z][d]=s.describe({compact:!0}):O[z].root=s}}return O},c.merge=function(_,O){if(!_)return c.compile(O);if(!O)return _;if(typeof O=="string")return new y(O);if(y.isTemplate(O))return O;const d=g(_);for(let f in O){const z=O[f];if(f==="root"||y.isTemplate(z)){d[f]=z;continue}if(typeof z=="string"){d[f]=new y(z);continue}M(typeof z=="object"&&!Array.isArray(z),"Invalid message for",f);const s=f;for(f in d[s]=d[s]||{},z){const h=z[f];f==="root"||y.isTemplate(h)?d[s][f]=h:(M(typeof h=="string","Invalid message for",f,"in",s),d[s][f]=new y(h))}}return d}},2294:(p,c,l)=>{const{assert:M}=l(8870),g=l(8160),y=l(6133),_={};c.Ids=_.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const O=new _.Ids;return O._byId=new Map(this._byId),O._byKey=new Map(this._byKey),O._schemaChain=this._schemaChain,O}concat(O){O._schemaChain&&(this._schemaChain=!0);for(const[d,f]of O._byId.entries())M(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,f);for(const[d,f]of O._byKey.entries())M(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,f)}fork(O,d,f){const z=this._collect(O);z.push({schema:f});const s=z.shift();let h={id:s.id,schema:d(s.schema)};M(g.isSchema(h.schema),"adjuster function failed to return a joi schema type");for(const A of z)h={id:A.id,schema:_.fork(A.schema,h.id,h.schema)};return h.schema}labels(O,d=[]){const f=O[0],z=this._get(f);if(!z)return[...d,...O].join(".");const s=O.slice(1);return d=[...d,z.schema._flags.label||f],s.length?z.schema._ids.labels(s,d):d.join(".")}reach(O,d=[]){const f=O[0],z=this._get(f);M(z,"Schema does not contain path",[...d,...O].join("."));const s=O.slice(1);return s.length?z.schema._ids.reach(s,[...d,f]):z.schema}register(O,{key:d}={}){if(!O||!g.isSchema(O))return;(O.$_property("schemaChain")||O._ids._schemaChain)&&(this._schemaChain=!0);const f=O._flags.id;if(f){const z=this._byId.get(f);M(!z||z.schema===O,"Cannot add different schemas with the same id:",f),M(!this._byKey.has(f),"Schema id conflicts with existing key:",f),this._byId.set(f,{schema:O,id:f})}d&&(M(!this._byKey.has(d),"Schema already contains key:",d),M(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:O,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(O,d=[],f=[]){const z=O[0],s=this._get(z);M(s,"Schema does not contain path",[...d,...O].join(".")),f=[s,...f];const h=O.slice(1);return h.length?s.schema._ids._collect(h,[...d,z],f):f}_get(O){return this._byId.get(O)||this._byKey.get(O)}},_.fork=function(O,d,f){const z=c.schema(O,{each:(s,{key:h})=>{if(d===(s._flags.id||h))return f},ref:!1});return z?z.$_mutateRebuild():O},c.schema=function(O,d){let f;for(const z in O._flags){if(z[0]==="_")continue;const s=_.scan(O._flags[z],{source:"flags",name:z},d);s!==void 0&&(f=f||O.clone(),f._flags[z]=s)}for(let z=0;z<O._rules.length;++z){const s=O._rules[z],h=_.scan(s.args,{source:"rules",name:s.name},d);if(h!==void 0){f=f||O.clone();const A=Object.assign({},s);A.args=h,f._rules[z]=A,f._singleRules.get(s.name)===s&&f._singleRules.set(s.name,A)}}for(const z in O.$_terms){if(z[0]==="_")continue;const s=_.scan(O.$_terms[z],{source:"terms",name:z},d);s!==void 0&&(f=f||O.clone(),f.$_terms[z]=s)}return f},_.scan=function(O,d,f,z,s){const h=z||[];if(O===null||typeof O!="object")return;let A;if(Array.isArray(O)){for(let q=0;q<O.length;++q){const v=d.source==="terms"&&d.name==="keys"&&O[q].key,L=_.scan(O[q],d,f,[q,...h],v);L!==void 0&&(A=A||O.slice(),A[q]=L)}return A}if(f.schema!==!1&&g.isSchema(O)||f.ref!==!1&&y.isRef(O)){const q=f.each(O,{...d,path:h,key:s});return q===O?void 0:q}for(const q in O){if(q[0]==="_")continue;const v=_.scan(O[q],d,f,[q,...h],s);v!==void 0&&(A=A||Object.assign({},O),A[q]=v)}return A}},6133:(p,c,l)=>{const{assert:M,clone:g,reach:y}=l(8870),_=l(8160);let O;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};c.create=function(f,z={}){M(typeof f=="string","Invalid reference key:",f),_.assertOptions(z,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),M(!z.prefix||typeof z.prefix=="object","options.prefix must be of type object");const s=Object.assign({},d.defaults,z);delete s.prefix;const h=s.separator,A=d.context(f,h,z.prefix);if(s.type=A.type,f=A.key,s.type==="value")if(A.root&&(M(!h||f[0]!==h,"Cannot specify relative path with root prefix"),s.ancestor="root",f||(f=null)),h&&h===f)f=null,s.ancestor=0;else if(s.ancestor!==void 0)M(!h||!f||f[0]!==h,"Cannot combine prefix with ancestor option");else{const[q,v]=d.ancestor(f,h);v&&(f=f.slice(v))===""&&(f=null),s.ancestor=q}return s.path=h?f===null?[]:f.split(h):[f],new d.Ref(s)},c.in=function(f,z={}){return c.create(f,{...z,in:!0})},c.isRef=function(f){return!!f&&!!f[_.symbols.ref]},d.Ref=class{constructor(f){M(typeof f=="object","Invalid reference construction"),_.assertOptions(f,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),M([!1,void 0].includes(f.separator)||typeof f.separator=="string"&&f.separator.length===1,"Invalid separator"),M(!f.adjust||typeof f.adjust=="function","options.adjust must be a function"),M(!f.map||Array.isArray(f.map),"options.map must be an array"),M(!f.map||!f.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,f),M(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(f,z,s,h,A={}){return M(!this.in||A.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(s.context,z,A):this.type==="local"?this._resolve(h,z,A):this.ancestor?this.ancestor==="root"?this._resolve(z.ancestors[z.ancestors.length-1],z,A):(M(this.ancestor<=z.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(z.ancestors[this.ancestor-1],z,A)):this._resolve(f,z,A)}_resolve(f,z,s){let h;if(this.type==="value"&&z.mainstay.shadow&&s.shadow!==!1&&(h=z.mainstay.shadow.get(this.absolute(z))),h===void 0&&(h=y(f,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(h=this.adjust(h)),this.map){const A=this.map.get(h);A!==void 0&&(h=A)}return z.mainstay&&z.mainstay.tracer.resolve(z,this,h),h}toString(){return this.display}absolute(f){return[...f.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const f={path:this.path};this.type!=="value"&&(f.type=this.type),this.separator!=="."&&(f.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(f.ancestor=this.ancestor),this.map&&(f.map=[...this.map]);for(const z of["adjust","iterables","render"])this[z]!==null&&this[z]!==void 0&&(f[z]=this[z]);return this.in!==!1&&(f.in=!0),{ref:f}}updateDisplay(){const f=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${f}`);if(!this.separator)return void(this.display=`ref:${f}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${f}`);if(this.ancestor==="root")return void(this.display=`ref:root:${f}`);if(this.ancestor===1)return void(this.display=`ref:${f||".."}`);const z=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${z}${f||""}`}},d.Ref.prototype[_.symbols.ref]=!0,c.build=function(f){return(f=Object.assign({},d.defaults,f)).type==="value"&&f.ancestor===void 0&&(f.ancestor=1),new d.Ref(f)},d.context=function(f,z,s={}){if(f=f.trim(),s){const h=s.global===void 0?"$":s.global;if(h!==z&&f.startsWith(h))return{key:f.slice(h.length),type:"global"};const A=s.local===void 0?"#":s.local;if(A!==z&&f.startsWith(A))return{key:f.slice(A.length),type:"local"};const q=s.root===void 0?"/":s.root;if(q!==z&&f.startsWith(q))return{key:f.slice(q.length),type:"value",root:!0}}return{key:f,type:"value"}},d.ancestor=function(f,z){if(!z)return[1,0];if(f[0]!==z)return[1,0];if(f[1]!==z)return[0,1];let s=2;for(;f[s]===z;)++s;return[s-1,s]},c.toSibling=0,c.toParent=1,c.Manager=class{constructor(){this.refs=[]}register(f,z){if(f)if(z=z===void 0?c.toParent:z,Array.isArray(f))for(const s of f)this.register(s,z);else if(_.isSchema(f))for(const s of f._refs.refs)s.ancestor-z>=0&&this.refs.push({ancestor:s.ancestor-z,root:s.root});else c.isRef(f)&&f.type==="value"&&f.ancestor-z>=0&&this.refs.push({ancestor:f.ancestor-z,root:f.root}),O=O||l(3328),O.isTemplate(f)&&this.register(f.refs(),z)}get length(){return this.refs.length}clone(){const f=new c.Manager;return f.refs=g(this.refs),f}reset(){this.refs=[]}roots(){return this.refs.filter(f=>!f.ancestor).map(f=>f.root)}}},3378:(p,c,l)=>{const M=l(5107),g={};g.wrap=M.string().min(1).max(2).allow(!1),c.preferences=M.object({allowUnknown:M.boolean(),abortEarly:M.boolean(),artifacts:M.boolean(),cache:M.boolean(),context:M.object(),convert:M.boolean(),dateFormat:M.valid("date","iso","string","time","utc"),debug:M.boolean(),errors:{escapeHtml:M.boolean(),label:M.valid("path","key",!1),language:[M.string(),M.object().ref()],render:M.boolean(),stack:M.boolean(),wrap:{label:g.wrap,array:g.wrap,string:g.wrap}},externals:M.boolean(),messages:M.object(),noDefaults:M.boolean(),nonEnumerables:M.boolean(),presence:M.valid("required","optional","forbidden"),skipFunctions:M.boolean(),stripUnknown:M.object({arrays:M.boolean(),objects:M.boolean()}).or("arrays","objects").allow(!0,!1),warnings:M.boolean()}).strict(),g.nameRx=/^[a-zA-Z0-9]\w*$/,g.rule=M.object({alias:M.array().items(M.string().pattern(g.nameRx)).single(),args:M.array().items(M.string(),M.object({name:M.string().pattern(g.nameRx).required(),ref:M.boolean(),assert:M.alternatives([M.function(),M.object().schema()]).conditional("ref",{is:!0,then:M.required()}),normalize:M.function(),message:M.string().when("assert",{is:M.function(),then:M.required()})})),convert:M.boolean(),manifest:M.boolean(),method:M.function().allow(!1),multi:M.boolean(),validate:M.function()}),c.extension=M.object({type:M.alternatives([M.string(),M.object().regex()]).required(),args:M.function(),cast:M.object().pattern(g.nameRx,M.object({from:M.function().maxArity(1).required(),to:M.function().minArity(1).maxArity(2).required()})),base:M.object().schema().when("type",{is:M.object().regex(),then:M.forbidden()}),coerce:[M.function().maxArity(3),M.object({method:M.function().maxArity(3).required(),from:M.array().items(M.string()).single()})],flags:M.object().pattern(g.nameRx,M.object({setter:M.string(),default:M.any()})),manifest:{build:M.function().arity(2)},messages:[M.object(),M.string()],modifiers:M.object().pattern(g.nameRx,M.function().minArity(1).maxArity(2)),overrides:M.object().pattern(g.nameRx,M.function()),prepare:M.function().maxArity(3),rebuild:M.function().arity(1),rules:M.object().pattern(g.nameRx,g.rule),terms:M.object().pattern(g.nameRx,M.object({init:M.array().allow(null).required(),manifest:M.object().pattern(/.+/,[M.valid("schema","single"),M.object({mapped:M.object({from:M.string().required(),to:M.string().required()}).required()})])})),validate:M.function().maxArity(3)}).strict(),c.extensions=M.array().items(M.object(),M.function().arity(1)).strict(),g.desc={buffer:M.object({buffer:M.string()}),func:M.object({function:M.function().required(),options:{literal:!0}}),override:M.object({override:!0}),ref:M.object({ref:M.object({type:M.valid("value","global","local"),path:M.array().required(),separator:M.string().length(1).allow(!1),ancestor:M.number().min(0).integer().allow("root"),map:M.array().items(M.array().length(2)).min(1),adjust:M.function(),iterables:M.boolean(),in:M.boolean(),render:M.boolean()}).required()}),regex:M.object({regex:M.string().min(3)}),special:M.object({special:M.valid("deep").required()}),template:M.object({template:M.string().required(),options:M.object()}),value:M.object({value:M.alternatives([M.object(),M.array()]).required()})},g.desc.entity=M.alternatives([M.array().items(M.link("...")),M.boolean(),M.function(),M.number(),M.string(),g.desc.buffer,g.desc.func,g.desc.ref,g.desc.regex,g.desc.special,g.desc.template,g.desc.value,M.link("/")]),g.desc.values=M.array().items(null,M.boolean(),M.function(),M.number().allow(1/0,-1/0),M.string().allow(""),M.symbol(),g.desc.buffer,g.desc.func,g.desc.override,g.desc.ref,g.desc.regex,g.desc.template,g.desc.value),g.desc.messages=M.object().pattern(/.+/,[M.string(),g.desc.template,M.object().pattern(/.+/,[M.string(),g.desc.template])]),c.description=M.object({type:M.string().required(),flags:M.object({cast:M.string(),default:M.any(),description:M.string(),empty:M.link("/"),failover:g.desc.entity,id:M.string(),label:M.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:M.boolean(),unit:M.string()}).unknown(),preferences:{allowUnknown:M.boolean(),abortEarly:M.boolean(),artifacts:M.boolean(),cache:M.boolean(),convert:M.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:M.boolean(),label:["path","key"],language:[M.string(),g.desc.ref],wrap:{label:g.wrap,array:g.wrap}},externals:M.boolean(),messages:g.desc.messages,noDefaults:M.boolean(),nonEnumerables:M.boolean(),presence:["required","optional","forbidden"],skipFunctions:M.boolean(),stripUnknown:M.object({arrays:M.boolean(),objects:M.boolean()}).or("arrays","objects").allow(!0,!1),warnings:M.boolean()},allow:g.desc.values,invalid:g.desc.values,rules:M.array().min(1).items({name:M.string().required(),args:M.object().min(1),keep:M.boolean(),message:[M.string(),g.desc.messages],warn:M.boolean()}),keys:M.object().pattern(/.*/,M.link("/")),link:g.desc.ref}).pattern(/^[a-z]\w*$/,M.any())},493:(p,c,l)=>{const{clone:M,reach:g}=l(8870),y=l(8160),_={value:Symbol("value")};p.exports=_.State=class{constructor(O,d,f){this.path=O,this.ancestors=d,this.mainstay=f.mainstay,this.schemas=f.schemas,this.debug=null}localize(O,d=null,f=null){const z=new _.State(O,d,this);return f&&z.schemas&&(z.schemas=[_.schemas(f),...z.schemas]),z}nest(O,d){const f=new _.State(this.path,this.ancestors,this);return f.schemas=f.schemas&&[_.schemas(O),...f.schemas],f.debug=d,f}shadow(O,d){this.mainstay.shadow=this.mainstay.shadow||new _.Shadow,this.mainstay.shadow.set(this.path,O,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=M(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},_.schemas=function(O){return y.isSchema(O)?{schema:O}:O},_.Shadow=class{constructor(){this._values=null}set(O,d,f){if(!O.length||f==="strip"&&typeof O[O.length-1]=="number")return;this._values=this._values||new Map;let z=this._values;for(let s=0;s<O.length;++s){const h=O[s];let A=z.get(h);A||(A=new Map,z.set(h,A)),z=A}z[_.value]=d}get(O){const d=this.node(O);if(d)return d[_.value]}node(O){if(this._values)return g(this._values,O,{iterables:!0})}override(O,d){if(!this._values)return;const f=O.slice(0,-1),z=O[O.length-1],s=g(this._values,f,{iterables:!0});d?s.set(z,d):s&&s.delete(z)}}},3328:(p,c,l)=>{const{assert:M,clone:g,escapeHtml:y}=l(8870),_=l(4964),O=l(8160),d=l(6354),f=l(6133),z={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};p.exports=z.Template=class{constructor(s,h){if(M(typeof s=="string","Template source must be a string"),M(!s.includes("\0")&&!s.includes(""),"Template source cannot contain reserved control characters"),this.source=s,this.rendered=s,this._template=null,h){const{functions:A,...q}=h;this._settings=Object.keys(q).length?g(q):void 0,this._functions=A,this._functions&&(M(Object.keys(this._functions).every(v=>typeof v=="string"),"Functions keys must be strings"),M(Object.values(this._functions).every(v=>typeof v=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const s=z.encode(this.source),h=z.split(s);let A=!1;const q=[],v=h.shift();v&&q.push(v);for(const L of h){const T=L[0]!=="{",w=T?"}":"}}",C=L.indexOf(w);if(C===-1||L[1]==="{"){q.push(`{${z.decode(L)}`);continue}let R=L.slice(T?0:1,C);const S=R[0]===":";S&&(R=R.slice(1));const E=this._ref(z.decode(R),{raw:T,wrapped:S});q.push(E),typeof E!="string"&&(A=!0);const G=L.slice(C+w.length);G&&q.push(z.decode(G))}A?this._template=q:this.rendered=q.join("")}static date(s,h){return z.dateFormat[h.dateFormat].call(s)}describe(s={}){if(!this._settings&&s.compact)return this.source;const h={template:this.source};return this._settings&&(h.options=this._settings),this._functions&&(h.functions=this._functions),h}static build(s){return new z.Template(s.template,s.options||s.functions?{...s.options,functions:s.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(s){return!!s&&!!s[O.symbols.template]}refs(){if(!this._template)return;const s=[];for(const h of this._template)typeof h!="string"&&s.push(...h.refs);return s}resolve(s,h,A,q){return this._template&&this._template.length===1?this._part(this._template[0],s,h,A,q,{}):this.render(s,h,A,q)}_part(s,...h){return s.ref?s.ref.resolve(...h):s.formula.evaluate(h)}render(s,h,A,q,v={}){if(!this.isDynamic())return this.rendered;const L=[];for(const T of this._template)if(typeof T=="string")L.push(T);else{const w=this._part(T,s,h,A,q,v),C=z.stringify(w,s,h,A,q,v);if(C!==void 0){const R=T.raw||(v.errors&&v.errors.escapeHtml)===!1?C:y(C);L.push(z.wrap(R,T.wrapped&&A.errors.wrap.label))}}return L.join("")}_ref(s,{raw:h,wrapped:A}){const q=[],v=T=>{const w=f.create(T,this._settings);return q.push(w),C=>{const R=w.resolve(...C);return R!==void 0?R:null}};try{const T=this._functions?{...z.functions,...this._functions}:z.functions;var L=new _.Parser(s,{reference:v,functions:T,constants:z.constants})}catch(T){throw T.message=`Invalid template variable "${s}" fails due to: ${T.message}`,T}if(L.single){if(L.single.type==="reference"){const T=q[0];return{ref:T,raw:h,refs:q,wrapped:A||T.type==="local"&&T.key==="label"}}return z.stringify(L.single.value)}return{formula:L,raw:h,refs:q}}toString(){return this.source}},z.Template.prototype[O.symbols.template]=!0,z.Template.prototype.isImmutable=!0,z.encode=function(s){return s.replace(/\\(\{+)/g,(h,A)=>z.opens.slice(0,A.length)).replace(/\\(\}+)/g,(h,A)=>z.closes.slice(0,A.length))},z.decode=function(s){return s.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},z.split=function(s){const h=[];let A="";for(let q=0;q<s.length;++q){const v=s[q];if(v==="{"){let L="";for(;q+1<s.length&&s[q+1]==="{";)L+="{",++q;h.push(A),A=L}else A+=v}return h.push(A),h},z.wrap=function(s,h){return h?h.length===1?`${h}${s}${h}`:`${h[0]}${s}${h[1]}`:s},z.stringify=function(s,h,A,q,v,L={}){const T=typeof s,w=q&&q.errors&&q.errors.wrap||{};let C=!1;if(f.isRef(s)&&s.render&&(C=s.in,s=s.resolve(h,A,q,v,{in:s.in,...L})),s===null)return"null";if(T==="string")return z.wrap(s,L.arrayItems&&w.string);if(T==="number"||T==="function"||T==="symbol")return s.toString();if(T!=="object")return JSON.stringify(s);if(s instanceof Date)return z.Template.date(s,q);if(s instanceof Map){const S=[];for(const[E,G]of s.entries())S.push(`${E.toString()} -> ${G.toString()}`);s=S}if(!Array.isArray(s))return s.toString();const R=[];for(const S of s)R.push(z.stringify(S,h,A,q,v,{arrayItems:!0,...L}));return z.wrap(R.join(", "),!C&&w.array)},z.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},z.functions={if:(s,h,A)=>s?h:A,length:s=>typeof s=="string"?s.length:s&&typeof s=="object"?Array.isArray(s)?s.length:Object.keys(s).length:null,msg(s){const[h,A,q,v,L]=this,T=L.messages;if(!T)return"";const w=d.template(h,T[0],s,A,q)||d.template(h,T[1],s,A,q);return w?w.render(h,A,q,v,L):""},number:s=>typeof s=="number"?s:typeof s=="string"?parseFloat(s):typeof s=="boolean"?s?1:0:s instanceof Date?s.getTime():null}},2305:(p,c,l)=>{const{deepEqual:M}=l(8870),g=l(7593),y=l(6354),_={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};c.setup=function(O){const d=function(){return O._tracer=O._tracer||new _.Tracer,O._tracer};O.trace=d,O[Symbol.for("@hapi/lab/coverage/initialize")]=d,O.untrace=()=>{O._tracer=null}},c.location=function(O){return O.$_setFlag("_tracerLocation",g.location(2))},_.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(O){const d=this._schemas.get(O);if(d)return d.store;const f=new _.Store(O),{filename:z,line:s}=O._flags._tracerLocation||g.location(5);return this._schemas.set(O,{filename:z,line:s,store:f}),f}_combine(O,d){for(const{store:f}of this._schemas.values())f._combine(O,d)}report(O){const d=[];for(const{filename:f,line:z,store:s}of this._schemas.values()){if(O&&O!==f)continue;const h=[],A=[];for(const[q,v]of s._sources.entries()){if(_.sub(v.paths,A))continue;if(!v.entry){h.push({status:"never reached",paths:[...v.paths]}),A.push(...v.paths);continue}for(const T of["valid","invalid"]){const w=q[`_${T}s`];if(!w)continue;const C=new Set(w._values),R=new Set(w._refs);for(const{value:S,ref:E}of v[T])C.delete(S),R.delete(E);(C.size||R.size)&&h.push({status:[...C,...[...R].map(S=>S.display)],rule:`${T}s`})}const L=q._rules.map(T=>T.name);for(const T of["default","failover"])q._flags[T]!==void 0&&L.push(T);for(const T of L){const w=_.labels[v.rule[T]||0];if(w){const C={rule:T,status:w};v.paths.size&&(C.paths=[...v.paths]),h.push(C)}}}h.length&&d.push({filename:f,line:z,missing:h,severity:"error",message:`Schema missing tests for ${h.map(_.message).join(", ")}`})}return d.length?d:null}},_.Store=class{constructor(O){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(O)}debug(O,d,f,z){O.mainstay.debug&&O.mainstay.debug.push({type:d,name:f,result:z,path:O.path})}entry(O,d){_.debug(d,{type:"entry"}),this._record(O,f=>{f.entry=!0})}filter(O,d,f,z){_.debug(d,{type:f,...z}),this._record(O,s=>{s[f].add(z)})}log(O,d,f,z,s){_.debug(d,{type:f,name:z,result:s==="full"?"pass":s}),this._record(O,h=>{h[f][z]=h[f][z]||0,h[f][z]|=_.codes[s]})}resolve(O,d,f){if(!O.mainstay.debug)return;const z={type:"resolve",ref:d.display,to:f,path:O.path};O.mainstay.debug.push(z)}value(O,d,f,z,s){if(!O.mainstay.debug||M(f,z))return;const h={type:"value",by:d,from:f,to:z,path:O.path};s&&(h.name=s),O.mainstay.debug.push(h)}_record(O,d){const f=this._sources.get(O);if(f)return void d(f);const z=this._combos.get(O);for(const s of z)this._record(s,d)}_scan(O,d){const f=d||[];let z=this._sources.get(O);z||(z={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(O,z)),f.length&&z.paths.add(f),O.$_modify({each:(s,h)=>{const A=_.id(s,h);this._scan(s,f.concat(A))},ref:!1})}_combine(O,d){this._combos.set(O,d)}},_.message=function(O){return`${O.paths?y.path(O.paths[0])+(O.rule?":":""):""}${O.rule||""} (${O.status})`},_.id=function(O,{source:d,name:f,path:z,key:s}){return O._flags.id?O._flags.id:s||(f=`@${f}`,d==="terms"?[f,z[Math.min(z.length-1,1)]]:f)},_.sub=function(O,d){for(const f of O)for(const z of d)if(M(f.slice(0,z.length),z))return!0;return!1},_.debug=function(O,d){O.mainstay.debug&&(d.path=O.debug?[...O.path,O.debug]:O.path,O.mainstay.debug.push(d))}},4946:(p,c,l)=>{const{assert:M,merge:g}=l(8870),y=l(8068),_=l(8160),O=l(3292),d=l(6354),f=l(6133),z={};p.exports=y.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:f.toSibling}},args:(s,...h)=>h.length===1&&Array.isArray(h[0])?s.try(...h[0]):s.try(...h),validate(s,h){const{schema:A,error:q,state:v,prefs:L}=h;if(A._flags.match){const w=[],C=[];for(let S=0;S<A.$_terms.matches.length;++S){const E=A.$_terms.matches[S],G=v.nest(E.schema,`match.${S}`);G.snapshot();const s0=E.schema.$_validate(s,G,L);s0.errors?(C.push(s0.errors),G.restore()):(w.push(s0.value),G.commit())}if(w.length===0)return{errors:q("alternatives.any",{details:C.map(S=>d.details(S,{override:!1}))})};if(A._flags.match==="one")return w.length===1?{value:w[0]}:{errors:q("alternatives.one")};if(w.length!==A.$_terms.matches.length)return{errors:q("alternatives.all",{details:C.map(S=>d.details(S,{override:!1}))})};const R=S=>S.$_terms.matches.some(E=>E.schema.type==="object"||E.schema.type==="alternatives"&&R(E.schema));return R(A)?{value:w.reduce((S,E)=>g(S,E,{mergeArrays:!1}))}:{value:w[w.length-1]}}const T=[];for(let w=0;w<A.$_terms.matches.length;++w){const C=A.$_terms.matches[w];if(C.schema){const E=v.nest(C.schema,`match.${w}`);E.snapshot();const G=C.schema.$_validate(s,E,L);if(!G.errors)return E.commit(),G;E.restore(),T.push({schema:C.schema,reports:G.errors});continue}const R=C.ref?C.ref.resolve(s,v,L):s,S=C.is?[C]:C.switch;for(let E=0;E<S.length;++E){const G=S[E],{is:s0,then:b0,otherwise:V}=G,Z=`match.${w}${C.switch?"."+E:""}`;if(s0.$_match(R,v.nest(s0,`${Z}.is`),L)){if(b0)return b0.$_validate(s,v.nest(b0,`${Z}.then`),L)}else if(V)return V.$_validate(s,v.nest(V,`${Z}.otherwise`),L)}}return z.errors(T,h)},rules:{conditional:{method(s,h){M(!this._flags._endedSwitch,"Unreachable condition"),M(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),M(h.break===void 0,"Cannot use break option with alternatives conditional");const A=this.clone(),q=O.when(A,s,h),v=q.is?[q]:q.switch;for(const L of v)if(L.then&&L.otherwise){A.$_setFlag("_endedSwitch",!0,{clone:!1});break}return A.$_terms.matches.push(q),A.$_mutateRebuild()}},match:{method(s){if(M(["any","one","all"].includes(s),"Invalid alternatives match mode",s),s!=="any")for(const h of this.$_terms.matches)M(h.schema,"Cannot combine match mode",s,"with conditional rules");return this.$_setFlag("match",s)}},try:{method(...s){M(s.length,"Missing alternative schemas"),_.verifyFlat(s,"try"),M(!this._flags._endedSwitch,"Unreachable condition");const h=this.clone();for(const A of s)h.$_terms.matches.push({schema:h.$_compile(A)});return h.$_mutateRebuild()}}},overrides:{label(s){return this.$_parent("label",s).$_modify({each:(h,A)=>A.path[0]!=="is"?h.label(s):void 0,ref:!1})}},rebuild(s){s.$_modify({each:h=>{_.isSchema(h)&&h.type==="array"&&s.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(s,h){if(h.matches)for(const A of h.matches){const{schema:q,ref:v,is:L,not:T,then:w,otherwise:C}=A;s=q?s.try(q):v?s.conditional(v,{is:L,then:w,not:T,otherwise:C,switch:A.switch}):s.conditional(L,{then:w,otherwise:C})}return s}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),z.errors=function(s,{error:h,state:A}){if(!s.length)return{errors:h("alternatives.any")};if(s.length===1)return{errors:s[0].reports};const q=new Set,v=[];for(const{reports:L,schema:T}of s){if(L.length>1)return z.unmatched(s,h);const w=L[0];if(w instanceof d.Report==0)return z.unmatched(s,h);if(w.state.path.length!==A.path.length){v.push({type:T.type,report:w});continue}if(w.code==="any.only"){for(const S of w.local.valids)q.add(S);continue}const[C,R]=w.code.split(".");R==="base"?q.add(C):v.push({type:T.type,report:w})}return v.length?v.length===1?{errors:v[0].report}:z.unmatched(s,h):{errors:h("alternatives.types",{types:[...q]})}},z.unmatched=function(s,h){const A=[];for(const q of s)A.push(...q.reports);return{errors:h("alternatives.match",d.details(A,{override:!1}))}}},8068:(p,c,l)=>{const{assert:M}=l(8870),g=l(7629),y=l(8160),_=l(6914);p.exports=g.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(O,d){return M(typeof O=="function","Method must be a function"),M(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:O,description:d}})},validate(O,d,{method:f}){try{return f(O,d)}catch(z){return d.error("any.custom",{error:z})}},args:["method","description"],multi:!0},messages:{method(O){return this.prefs({messages:O})}},shared:{method(O){M(y.isSchema(O)&&O._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(O),d.$_mutateRegister(O),d}},warning:{method(O,d){return M(O&&typeof O=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:O,local:d},warn:!0})},validate:(O,d,{code:f,local:z})=>d.error(f,z),args:["code","local"],multi:!0}},modifiers:{keep(O,d=!0){O.keep=d},message(O,d){O.message=_.compile(d)},warn(O,d=!0){O.warn=d}},manifest:{build(O,d){for(const f in d){const z=d[f];if(["examples","externals","metas","notes","tags"].includes(f))for(const s of z)O=O[f.slice(0,-1)](s);else if(f!=="alterations")if(f!=="whens"){if(f==="shared")for(const s of z)O=O.shared(s)}else for(const s of z){const{ref:h,is:A,not:q,then:v,otherwise:L,concat:T}=s;O=T?O.concat(T):h?O.when(h,{is:A,not:q,then:v,otherwise:L,switch:s.switch,break:s.break}):O.when(A,{then:v,otherwise:L,break:s.break})}else{const s={};for(const{target:h,adjuster:A}of z)s[h]=A;O=O.alter(s)}}return O}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(p,c,l)=>{const{assert:M,deepEqual:g,reach:y}=l(8870),_=l(8068),O=l(8160),d=l(3292),f={};p.exports=_.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(z,{schema:s,state:h,prefs:A}){if(!Array.isArray(z))return;const q=s.$_getRule("sort");return q?f.sort(s,z,q.args.options,h,A):void 0}},validate(z,{schema:s,error:h}){if(!Array.isArray(z)){if(s._flags.single){const A=[z];return A[O.symbols.arraySingle]=!0,{value:A}}return{errors:h("array.base")}}if(s.$_getRule("items")||s.$_terms.externals)return{value:z.slice()}},rules:{has:{method(z){z=this.$_compile(z,{appendPath:!0});const s=this.$_addRule({name:"has",args:{schema:z}});return s.$_mutateRegister(z),s},validate(z,{state:s,prefs:h,error:A},{schema:q}){const v=[z,...s.ancestors];for(let T=0;T<z.length;++T){const w=s.localize([...s.path,T],v,q);if(q.$_match(z[T],w,h))return z}const L=q._flags.label;return L?A("array.hasKnown",{patternLabel:L}):A("array.hasUnknown",null)},multi:!0},items:{method(...z){O.verifyFlat(z,"items");const s=this.$_addRule("items");for(let h=0;h<z.length;++h){const A=O.tryWithPath(()=>this.$_compile(z[h]),h,{append:!0});s.$_terms.items.push(A)}return s.$_mutateRebuild()},validate(z,{schema:s,error:h,state:A,prefs:q,errorsArray:v}){const L=s.$_terms._requireds.slice(),T=s.$_terms.ordered.slice(),w=[...s.$_terms._inclusions,...L],C=!z[O.symbols.arraySingle];delete z[O.symbols.arraySingle];const R=v();let S=z.length;for(let E=0;E<S;++E){const G=z[E];let s0=!1,b0=!1;const V=C?E:new Number(E),Z=[...A.path,V];if(!s._flags.sparse&&G===void 0){if(R.push(h("array.sparse",{key:V,path:Z,pos:E,value:void 0},A.localize(Z))),q.abortEarly)return R;T.shift();continue}const d0=[z,...A.ancestors];for(const G0 of s.$_terms._exclusions)if(G0.$_match(G,A.localize(Z,d0,G0),q,{presence:"ignore"})){if(R.push(h("array.excludes",{pos:E,value:G},A.localize(Z))),q.abortEarly)return R;s0=!0,T.shift();break}if(s0)continue;if(s.$_terms.ordered.length){if(T.length){const G0=T.shift(),v1=G0.$_validate(G,A.localize(Z,d0,G0),q);if(v1.errors){if(R.push(...v1.errors),q.abortEarly)return R}else if(G0._flags.result==="strip")f.fastSplice(z,E),--E,--S;else{if(!s._flags.sparse&&v1.value===void 0){if(R.push(h("array.sparse",{key:V,path:Z,pos:E,value:void 0},A.localize(Z))),q.abortEarly)return R;continue}z[E]=v1.value}continue}if(!s.$_terms.items.length){if(R.push(h("array.orderedLength",{pos:E,limit:s.$_terms.ordered.length})),q.abortEarly)return R;break}}const v0=[];let E0=L.length;for(let G0=0;G0<E0;++G0){const v1=A.localize(Z,d0,L[G0]);v1.snapshot();const h1=L[G0].$_validate(G,v1,q);if(v0[G0]=h1,!h1.errors){if(v1.commit(),z[E]=h1.value,b0=!0,f.fastSplice(L,G0),--G0,--E0,!s._flags.sparse&&h1.value===void 0&&(R.push(h("array.sparse",{key:V,path:Z,pos:E,value:void 0},A.localize(Z))),q.abortEarly))return R;break}v1.restore()}if(b0)continue;const S0=q.stripUnknown&&!!q.stripUnknown.arrays||!1;E0=w.length;for(const G0 of w){let v1;const h1=L.indexOf(G0);if(h1!==-1)v1=v0[h1];else{const Y1=A.localize(Z,d0,G0);if(Y1.snapshot(),v1=G0.$_validate(G,Y1,q),!v1.errors){Y1.commit(),G0._flags.result==="strip"?(f.fastSplice(z,E),--E,--S):s._flags.sparse||v1.value!==void 0?z[E]=v1.value:(R.push(h("array.sparse",{key:V,path:Z,pos:E,value:void 0},A.localize(Z))),s0=!0),b0=!0;break}Y1.restore()}if(E0===1){if(S0){f.fastSplice(z,E),--E,--S,b0=!0;break}if(R.push(...v1.errors),q.abortEarly)return R;s0=!0;break}}if(!s0&&(s.$_terms._inclusions.length||s.$_terms._requireds.length)&&!b0){if(S0){f.fastSplice(z,E),--E,--S;continue}if(R.push(h("array.includes",{pos:E,value:G},A.localize(Z))),q.abortEarly)return R}}return L.length&&f.fillMissedErrors(s,R,L,z,A,q),T.length&&(f.fillOrderedErrors(s,R,T,z,A,q),R.length||f.fillDefault(T,z,A,q)),R.length?R:z},priority:!0,manifest:!1},length:{method(z){return this.$_addRule({name:"length",args:{limit:z},operator:"="})},validate:(z,s,{limit:h},{name:A,operator:q,args:v})=>O.compare(z.length,h,q)?z:s.error("array."+A,{limit:v.limit,value:z}),args:[{name:"limit",ref:!0,assert:O.limit,message:"must be a positive integer"}]},max:{method(z){return this.$_addRule({name:"max",method:"length",args:{limit:z},operator:"<="})}},min:{method(z){return this.$_addRule({name:"min",method:"length",args:{limit:z},operator:">="})}},ordered:{method(...z){O.verifyFlat(z,"ordered");const s=this.$_addRule("items");for(let h=0;h<z.length;++h){const A=O.tryWithPath(()=>this.$_compile(z[h]),h,{append:!0});f.validateSingle(A,s),s.$_mutateRegister(A),s.$_terms.ordered.push(A)}return s.$_mutateRebuild()}},single:{method(z){const s=z===void 0||!!z;return M(!s||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",s)}},sort:{method(z={}){O.assertOptions(z,["by","order"]);const s={order:z.order||"ascending"};return z.by&&(s.by=d.ref(z.by,{ancestor:0}),M(!s.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:s}})},validate(z,{error:s,state:h,prefs:A,schema:q},{options:v}){const{value:L,errors:T}=f.sort(q,z,v,h,A);if(T)return T;for(let w=0;w<z.length;++w)if(z[w]!==L[w])return s("array.sort",{order:v.order,by:v.by?v.by.key:"value"});return z},convert:!0},sparse:{method(z){const s=z===void 0||!!z;return this._flags.sparse===s?this:(s?this.clone():this.$_addRule("items")).$_setFlag("sparse",s,{clone:!1})}},unique:{method(z,s={}){M(!z||typeof z=="function"||typeof z=="string","comparator must be a function or a string"),O.assertOptions(s,["ignoreUndefined","separator"]);const h={name:"unique",args:{options:s,comparator:z}};if(z)if(typeof z=="string"){const A=O.default(s.separator,".");h.path=A?z.split(A):[z]}else h.comparator=z;return this.$_addRule(h)},validate(z,{state:s,error:h,schema:A},{comparator:q,options:v},{comparator:L,path:T}){const w={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},C=L||g,R=v.ignoreUndefined;for(let S=0;S<z.length;++S){const E=T?y(z[S],T):z[S],G=L?w.custom:w[typeof E];if(M(G,"Failed to find unique map container for type",typeof E),G instanceof Map){const s0=G.entries();let b0;for(;!(b0=s0.next()).done;)if(C(b0.value[0],E)){const V=s.localize([...s.path,S],[z,...s.ancestors]),Z={pos:S,value:z[S],dupePos:b0.value[1],dupeValue:z[b0.value[1]]};return T&&(Z.path=q),h("array.unique",Z,V)}G.set(E,S)}else{if((!R||E!==void 0)&&G[E]!==void 0){const s0={pos:S,value:z[S],dupePos:G[E],dupeValue:z[G[E]]};return T&&(s0.path=q),h("array.unique",s0,s.localize([...s.path,S],[z,...s.ancestors]))}G[E]=S}}return z},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(z,s)=>new Set(z)}},rebuild(z){z.$_terms._inclusions=[],z.$_terms._exclusions=[],z.$_terms._requireds=[];for(const s of z.$_terms.items)f.validateSingle(s,z),s._flags.presence==="required"?z.$_terms._requireds.push(s):s._flags.presence==="forbidden"?z.$_terms._exclusions.push(s):z.$_terms._inclusions.push(s);for(const s of z.$_terms.ordered)f.validateSingle(s,z)},manifest:{build:(z,s)=>(s.items&&(z=z.items(...s.items)),s.ordered&&(z=z.ordered(...s.ordered)),z)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),f.fillMissedErrors=function(z,s,h,A,q,v){const L=[];let T=0;for(const w of h){const C=w._flags.label;C?L.push(C):++T}L.length?T?s.push(z.$_createError("array.includesRequiredBoth",A,{knownMisses:L,unknownMisses:T},q,v)):s.push(z.$_createError("array.includesRequiredKnowns",A,{knownMisses:L},q,v)):s.push(z.$_createError("array.includesRequiredUnknowns",A,{unknownMisses:T},q,v))},f.fillOrderedErrors=function(z,s,h,A,q,v){const L=[];for(const T of h)T._flags.presence==="required"&&L.push(T);L.length&&f.fillMissedErrors(z,s,L,A,q,v)},f.fillDefault=function(z,s,h,A){const q=[];let v=!0;for(let L=z.length-1;L>=0;--L){const T=z[L],w=[s,...h.ancestors],C=T.$_validate(void 0,h.localize(h.path,w,T),A).value;if(v){if(C===void 0)continue;v=!1}q.unshift(C)}q.length&&s.push(...q)},f.fastSplice=function(z,s){let h=s;for(;h<z.length;)z[h++]=z[h];--z.length},f.validateSingle=function(z,s){(z.type==="array"||z._flags._arrayItems)&&(M(!s._flags.single,"Cannot specify array item with single rule enabled"),s.$_setFlag("_arrayItems",!0,{clone:!1}))},f.sort=function(z,s,h,A,q){const v=h.order==="ascending"?1:-1,L=-1*v,T=v,w=(C,R)=>{let S=f.compare(C,R,L,T);if(S!==null||(h.by&&(C=h.by.resolve(C,A,q),R=h.by.resolve(R,A,q)),S=f.compare(C,R,L,T),S!==null))return S;const E=typeof C;if(E!==typeof R)throw z.$_createError("array.sort.mismatching",s,null,A,q);if(E!=="number"&&E!=="string")throw z.$_createError("array.sort.unsupported",s,{type:E},A,q);return E==="number"?(C-R)*v:C<R?L:T};try{return{value:s.slice().sort(w)}}catch(C){return{errors:C}}},f.compare=function(z,s,h,A){return z===s?0:z===void 0?1:s===void 0?-1:z===null?A:s===null?h:null}},4937:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y=l(8160),_=l(2036),O={isBool:function(d){return typeof d=="boolean"}};p.exports=g.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:f}){if(typeof d!="boolean"){if(typeof d=="string"){const z=f._flags.sensitive?d:d.toLowerCase();d=z==="true"||z!=="false"&&d}return typeof d!="boolean"&&(d=f.$_terms.truthy&&f.$_terms.truthy.has(d,null,null,!f._flags.sensitive)||(!f.$_terms.falsy||!f.$_terms.falsy.has(d,null,null,!f._flags.sensitive))&&d),{value:d}}},validate(d,{error:f}){if(typeof d!="boolean")return{value:d,errors:f("boolean.base")}},rules:{truthy:{method(...d){y.verifyFlat(d,"truthy");const f=this.clone();f.$_terms.truthy=f.$_terms.truthy||new _;for(let z=0;z<d.length;++z){const s=d[z];M(s!==void 0,"Cannot call truthy with undefined"),f.$_terms.truthy.add(s)}return f}},falsy:{method(...d){y.verifyFlat(d,"falsy");const f=this.clone();f.$_terms.falsy=f.$_terms.falsy||new _;for(let z=0;z<d.length;++z){const s=d[z];M(s!==void 0,"Cannot call falsy with undefined"),f.$_terms.falsy.add(s)}return f}},sensitive:{method(d=!0){return this.$_setFlag("sensitive",d)}}},cast:{number:{from:O.isBool,to:(d,f)=>d?1:0},string:{from:O.isBool,to:(d,f)=>d?"true":"false"}},manifest:{build:(d,f)=>(f.truthy&&(d=d.truthy(...f.truthy)),f.falsy&&(d=d.falsy(...f.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y=l(8160),_=l(3328),O={isDate:function(d){return d instanceof Date}};p.exports=g.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:f})=>({value:O.parse(d,f._flags.format)||d})},validate(d,{schema:f,error:z,prefs:s}){if(d instanceof Date&&!isNaN(d.getTime()))return;const h=f._flags.format;return s.convert&&h&&typeof d=="string"?{value:d,errors:z("date.format",{format:h})}:{value:d,errors:z("date.base")}},rules:{compare:{method:!1,validate(d,f,{date:z},{name:s,operator:h,args:A}){const q=z==="now"?Date.now():z.getTime();return y.compare(d.getTime(),q,h)?d:f.error("date."+s,{limit:A.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:O.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return M(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return M(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:O.isDate,to:(d,f)=>d.getTime()},string:{from:O.isDate,to:(d,{prefs:f})=>_.date(d,f)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),O.parse=function(d,f){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(f==="iso")return y.isIsoDate(d)?O.date(d.toString()):null;const z=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),f){if(f==="javascript")return O.date(1*d);if(f==="unix")return O.date(1e3*d);if(typeof z=="string")return null}return O.date(d)},O.date=function(d){const f=new Date(d);return isNaN(f.getTime())?null:f}},390:(p,c,l)=>{const{assert:M}=l(8870),g=l(7824);p.exports=g.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(y){return M(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:y}})},validate:(y,_,{n:O})=>y.length===O?y:_.error("function.arity",{n:O})},class:{method(){return this.$_addRule("class")},validate:(y,_)=>/^\s*class\s/.test(y.toString())?y:_.error("function.class",{value:y})},minArity:{method(y){return M(Number.isSafeInteger(y)&&y>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:y}})},validate:(y,_,{n:O})=>y.length>=O?y:_.error("function.minArity",{n:O})},maxArity:{method(y){return M(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:y}})},validate:(y,_,{n:O})=>y.length<=O?y:_.error("function.maxArity",{n:O})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(p,c,l)=>{const{applyToDefaults:M,assert:g,clone:y}=l(8870),_=l(3652),O=l(8068),d=l(8160),f=l(3292),z=l(6354),s=l(6133),h=l(3328),A={renameDefaults:{alias:!1,multiple:!1,override:!1}};p.exports=O.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(q,v)=>q.keys(v),validate(q,{schema:v,error:L,state:T,prefs:w}){if(!q||typeof q!==v.$_property("typeof")||Array.isArray(q))return{value:q,errors:L("object.base",{type:v.$_property("typeof")})};if(!(v.$_terms.renames||v.$_terms.dependencies||v.$_terms.keys||v.$_terms.patterns||v.$_terms.externals))return;q=A.clone(q,w);const C=[];if(v.$_terms.renames&&!A.rename(v,q,T,w,C))return{value:q,errors:C};if(!v.$_terms.keys&&!v.$_terms.patterns&&!v.$_terms.dependencies)return{value:q,errors:C};const R=new Set(Object.keys(q));if(v.$_terms.keys){const S=[q,...T.ancestors];for(const E of v.$_terms.keys){const G=E.key,s0=q[G];R.delete(G);const b0=T.localize([...T.path,G],S,E),V=E.schema.$_validate(s0,b0,w);if(V.errors){if(w.abortEarly)return{value:q,errors:V.errors};V.value!==void 0&&(q[G]=V.value),C.push(...V.errors)}else E.schema._flags.result==="strip"||V.value===void 0&&s0!==void 0?delete q[G]:V.value!==void 0&&(q[G]=V.value)}}if(R.size||v._flags._hasPatternMatch){const S=A.unknown(v,q,R,C,T,w);if(S)return S}if(v.$_terms.dependencies)for(const S of v.$_terms.dependencies){if(S.key!==null&&A.isPresent(S.options)(S.key.resolve(q,T,w,null,{shadow:!1}))===!1)continue;const E=A.dependencies[S.rel](v,S,q,T,w);if(E){const G=v.$_createError(E.code,q,E.context,T,w);if(w.abortEarly)return{value:q,errors:G};C.push(G)}}return{value:q,errors:C}},rules:{and:{method(...q){return d.verifyFlat(q,"and"),A.dependency(this,"and",null,q)}},append:{method(q){return q==null||Object.keys(q).length===0?this:this.keys(q)}},assert:{method(q,v,L){h.isTemplate(q)||(q=f.ref(q)),g(L===void 0||typeof L=="string","Message must be a string"),v=this.$_compile(v,{appendPath:!0});const T=this.$_addRule({name:"assert",args:{subject:q,schema:v,message:L}});return T.$_mutateRegister(q),T.$_mutateRegister(v),T},validate(q,{error:v,prefs:L,state:T},{subject:w,schema:C,message:R}){const S=w.resolve(q,T,L),E=s.isRef(w)?w.absolute(T):[];return C.$_match(S,T.localize(E,[q,...T.ancestors],C),L)?q:v("object.assert",{subject:w,message:R})},args:["subject","schema","message"],multi:!0},instance:{method(q,v){return g(typeof q=="function","constructor must be a function"),v=v||q.name,this.$_addRule({name:"instance",args:{constructor:q,name:v}})},validate:(q,v,{constructor:L,name:T})=>q instanceof L?q:v.error("object.instance",{type:T,value:q}),args:["constructor","name"]},keys:{method(q){g(q===void 0||typeof q=="object","Object schema must be a valid object"),g(!d.isSchema(q),"Object schema cannot be a joi schema");const v=this.clone();if(q)if(Object.keys(q).length){v.$_terms.keys=v.$_terms.keys?v.$_terms.keys.filter(L=>!q.hasOwnProperty(L.key)):new A.Keys;for(const L in q)d.tryWithPath(()=>v.$_terms.keys.push({key:L,schema:this.$_compile(q[L])}),L)}else v.$_terms.keys=new A.Keys;else v.$_terms.keys=null;return v.$_mutateRebuild()}},length:{method(q){return this.$_addRule({name:"length",args:{limit:q},operator:"="})},validate:(q,v,{limit:L},{name:T,operator:w,args:C})=>d.compare(Object.keys(q).length,L,w)?q:v.error("object."+T,{limit:C.limit,value:q}),args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"}]},max:{method(q){return this.$_addRule({name:"max",method:"length",args:{limit:q},operator:"<="})}},min:{method(q){return this.$_addRule({name:"min",method:"length",args:{limit:q},operator:">="})}},nand:{method(...q){return d.verifyFlat(q,"nand"),A.dependency(this,"nand",null,q)}},or:{method(...q){return d.verifyFlat(q,"or"),A.dependency(this,"or",null,q)}},oxor:{method(...q){return A.dependency(this,"oxor",null,q)}},pattern:{method(q,v,L={}){const T=q instanceof RegExp;T||(q=this.$_compile(q,{appendPath:!0})),g(v!==void 0,"Invalid rule"),d.assertOptions(L,["fallthrough","matches"]),T&&g(!q.flags.includes("g")&&!q.flags.includes("y"),"pattern should not use global or sticky mode"),v=this.$_compile(v,{appendPath:!0});const w=this.clone();w.$_terms.patterns=w.$_terms.patterns||[];const C={[T?"regex":"schema"]:q,rule:v};return L.matches&&(C.matches=this.$_compile(L.matches),C.matches.type!=="array"&&(C.matches=C.matches.$_root.array().items(C.matches)),w.$_mutateRegister(C.matches),w.$_setFlag("_hasPatternMatch",!0,{clone:!1})),L.fallthrough&&(C.fallthrough=!0),w.$_terms.patterns.push(C),w.$_mutateRegister(v),w}},ref:{method(){return this.$_addRule("ref")},validate:(q,v)=>s.isRef(q)?q:v.error("object.refType",{value:q})},regex:{method(){return this.$_addRule("regex")},validate:(q,v)=>q instanceof RegExp?q:v.error("object.regex",{value:q})},rename:{method(q,v,L={}){g(typeof q=="string"||q instanceof RegExp,"Rename missing the from argument"),g(typeof v=="string"||v instanceof h,"Invalid rename to argument"),g(v!==q,"Cannot rename key to same name:",q),d.assertOptions(L,["alias","ignoreUndefined","override","multiple"]);const T=this.clone();T.$_terms.renames=T.$_terms.renames||[];for(const w of T.$_terms.renames)g(w.from!==q,"Cannot rename the same key multiple times");return v instanceof h&&T.$_mutateRegister(v),T.$_terms.renames.push({from:q,to:v,options:M(A.renameDefaults,L)}),T}},schema:{method(q="any"){return this.$_addRule({name:"schema",args:{type:q}})},validate:(q,v,{type:L})=>!d.isSchema(q)||L!=="any"&&q.type!==L?v.error("object.schema",{type:L}):q},unknown:{method(q){return this.$_setFlag("unknown",q!==!1)}},with:{method(q,v,L={}){return A.dependency(this,"with",q,v,L)}},without:{method(q,v,L={}){return A.dependency(this,"without",q,v,L)}},xor:{method(...q){return d.verifyFlat(q,"xor"),A.dependency(this,"xor",null,q)}}},overrides:{default(q,v){return q===void 0&&(q=d.symbols.deepDefault),this.$_parent("default",q,v)}},rebuild(q){if(q.$_terms.keys){const v=new _.Sorter;for(const L of q.$_terms.keys)d.tryWithPath(()=>v.add(L,{after:L.schema.$_rootReferences(),group:L.key}),L.key);q.$_terms.keys=new A.Keys(...v.nodes)}},manifest:{build(q,v){if(v.keys&&(q=q.keys(v.keys)),v.dependencies)for(const{rel:L,key:T=null,peers:w,options:C}of v.dependencies)q=A.dependency(q,L,T,w,C);if(v.patterns)for(const{regex:L,schema:T,rule:w,fallthrough:C,matches:R}of v.patterns)q=q.pattern(L||T,w,{fallthrough:C,matches:R});if(v.renames)for(const{from:L,to:T,options:w}of v.renames)q=q.rename(L,T,w);return q}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),A.clone=function(q,v){if(typeof q=="object"){if(v.nonEnumerables)return y(q,{shallow:!0});const T=Object.create(Object.getPrototypeOf(q));return Object.assign(T,q),T}const L=function(...T){return q.apply(this,T)};return L.prototype=y(q.prototype),Object.defineProperty(L,"name",{value:q.name,writable:!1}),Object.defineProperty(L,"length",{value:q.length,writable:!1}),Object.assign(L,q),L},A.dependency=function(q,v,L,T,w){g(L===null||typeof L=="string",v,"key must be a strings"),w||(w=T.length>1&&typeof T[T.length-1]=="object"?T.pop():{}),d.assertOptions(w,["separator","isPresent"]),T=[].concat(T);const C=d.default(w.separator,"."),R=[];for(const E of T)g(typeof E=="string",v,"peers must be strings"),R.push(f.ref(E,{separator:C,ancestor:0,prefix:!1}));L!==null&&(L=f.ref(L,{separator:C,ancestor:0,prefix:!1}));const S=q.clone();return S.$_terms.dependencies=S.$_terms.dependencies||[],S.$_terms.dependencies.push(new A.Dependency(v,L,R,T,w)),S},A.dependencies={and(q,v,L,T,w){const C=[],R=[],S=v.peers.length,E=A.isPresent(v.options);for(const G of v.peers)E(G.resolve(L,T,w,null,{shadow:!1}))===!1?C.push(G.key):R.push(G.key);if(C.length!==S&&R.length!==S)return{code:"object.and",context:{present:R,presentWithLabels:A.keysToLabels(q,R),missing:C,missingWithLabels:A.keysToLabels(q,C)}}},nand(q,v,L,T,w){const C=[],R=A.isPresent(v.options);for(const G of v.peers)R(G.resolve(L,T,w,null,{shadow:!1}))&&C.push(G.key);if(C.length!==v.peers.length)return;const S=v.paths[0],E=v.paths.slice(1);return{code:"object.nand",context:{main:S,mainWithLabel:A.keysToLabels(q,S),peers:E,peersWithLabels:A.keysToLabels(q,E)}}},or(q,v,L,T,w){const C=A.isPresent(v.options);for(const R of v.peers)if(C(R.resolve(L,T,w,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:v.paths,peersWithLabels:A.keysToLabels(q,v.paths)}}},oxor(q,v,L,T,w){const C=[],R=A.isPresent(v.options);for(const E of v.peers)R(E.resolve(L,T,w,null,{shadow:!1}))&&C.push(E.key);if(!C.length||C.length===1)return;const S={peers:v.paths,peersWithLabels:A.keysToLabels(q,v.paths)};return S.present=C,S.presentWithLabels=A.keysToLabels(q,C),{code:"object.oxor",context:S}},with(q,v,L,T,w){const C=A.isPresent(v.options);for(const R of v.peers)if(C(R.resolve(L,T,w,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:v.key.key,mainWithLabel:A.keysToLabels(q,v.key.key),peer:R.key,peerWithLabel:A.keysToLabels(q,R.key)}}},without(q,v,L,T,w){const C=A.isPresent(v.options);for(const R of v.peers)if(C(R.resolve(L,T,w,null,{shadow:!1})))return{code:"object.without",context:{main:v.key.key,mainWithLabel:A.keysToLabels(q,v.key.key),peer:R.key,peerWithLabel:A.keysToLabels(q,R.key)}}},xor(q,v,L,T,w){const C=[],R=A.isPresent(v.options);for(const E of v.peers)R(E.resolve(L,T,w,null,{shadow:!1}))&&C.push(E.key);if(C.length===1)return;const S={peers:v.paths,peersWithLabels:A.keysToLabels(q,v.paths)};return C.length===0?{code:"object.missing",context:S}:(S.present=C,S.presentWithLabels=A.keysToLabels(q,C),{code:"object.xor",context:S})}},A.keysToLabels=function(q,v){return Array.isArray(v)?v.map(L=>q.$_mapLabels(L)):q.$_mapLabels(v)},A.isPresent=function(q){return typeof q.isPresent=="function"?q.isPresent:v=>v!==void 0},A.rename=function(q,v,L,T,w){const C={};for(const R of q.$_terms.renames){const S=[],E=typeof R.from!="string";if(E)for(const G in v){if(v[G]===void 0&&R.options.ignoreUndefined||G===R.to)continue;const s0=R.from.exec(G);s0&&S.push({from:G,to:R.to,match:s0})}else!Object.prototype.hasOwnProperty.call(v,R.from)||v[R.from]===void 0&&R.options.ignoreUndefined||S.push(R);for(const G of S){const s0=G.from;let b0=G.to;if(b0 instanceof h&&(b0=b0.render(v,L,T,G.match)),s0!==b0){if(!R.options.multiple&&C[b0]&&(w.push(q.$_createError("object.rename.multiple",v,{from:s0,to:b0,pattern:E},L,T)),T.abortEarly)||Object.prototype.hasOwnProperty.call(v,b0)&&!R.options.override&&!C[b0]&&(w.push(q.$_createError("object.rename.override",v,{from:s0,to:b0,pattern:E},L,T)),T.abortEarly))return!1;v[s0]===void 0?delete v[b0]:v[b0]=v[s0],C[b0]=!0,R.options.alias||delete v[s0]}}}return!0},A.unknown=function(q,v,L,T,w,C){if(q.$_terms.patterns){let R=!1;const S=q.$_terms.patterns.map(G=>{if(G.matches)return R=!0,[]}),E=[v,...w.ancestors];for(const G of L){const s0=v[G],b0=[...w.path,G];for(let V=0;V<q.$_terms.patterns.length;++V){const Z=q.$_terms.patterns[V];if(Z.regex){const E0=Z.regex.test(G);if(w.mainstay.tracer.debug(w,"rule",`pattern.${V}`,E0?"pass":"error"),!E0)continue}else if(!Z.schema.$_match(G,w.nest(Z.schema,`pattern.${V}`),C))continue;L.delete(G);const d0=w.localize(b0,E,{schema:Z.rule,key:G}),v0=Z.rule.$_validate(s0,d0,C);if(v0.errors){if(C.abortEarly)return{value:v,errors:v0.errors};T.push(...v0.errors)}if(Z.matches&&S[V].push(G),v[G]=v0.value,!Z.fallthrough)break}}if(R)for(let G=0;G<S.length;++G){const s0=S[G];if(!s0)continue;const b0=q.$_terms.patterns[G].matches,V=w.localize(w.path,E,b0),Z=b0.$_validate(s0,V,C);if(Z.errors){const d0=z.details(Z.errors,{override:!1});d0.matches=s0;const v0=q.$_createError("object.pattern.match",v,d0,w,C);if(C.abortEarly)return{value:v,errors:v0};T.push(v0)}}}if(L.size&&(q.$_terms.keys||q.$_terms.patterns)){if(C.stripUnknown&&!q._flags.unknown||C.skipFunctions){const R=!(!C.stripUnknown||C.stripUnknown!==!0&&!C.stripUnknown.objects);for(const S of L)R?(delete v[S],L.delete(S)):typeof v[S]=="function"&&L.delete(S)}if(!d.default(q._flags.unknown,C.allowUnknown))for(const R of L){const S=w.localize([...w.path,R],[]),E=q.$_createError("object.unknown",v[R],{child:R},S,C,{flags:!1});if(C.abortEarly)return{value:v,errors:E};T.push(E)}}},A.Dependency=class{constructor(q,v,L,T,w){this.rel=q,this.key=v,this.peers=L,this.paths=T,this.options=w}describe(){const q={rel:this.rel,peers:this.paths};return this.key!==null&&(q.key=this.key.key),this.peers[0].separator!=="."&&(q.options={...q.options,separator:this.peers[0].separator}),this.options.isPresent&&(q.options={...q.options,isPresent:this.options.isPresent}),q}},A.Keys=class extends Array{concat(q){const v=this.slice(),L=new Map;for(let T=0;T<v.length;++T)L.set(v[T].key,T);for(const T of q){const w=T.key,C=L.get(w);C!==void 0?v[C]={key:w,schema:v[C].schema.concat(T.schema)}:v.push(T)}return v}}},8785:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y=l(8160),_=l(3292),O=l(6354),d={};p.exports=g.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(f,z)=>f.ref(z),validate(f,{schema:z,state:s,prefs:h}){M(z.$_terms.link,"Uninitialized link schema");const A=d.generate(z,f,s,h),q=z.$_terms.link[0].ref;return A.$_validate(f,s.nest(A,`link:${q.display}:${A.type}`),h)},generate:(f,z,s,h)=>d.generate(f,z,s,h),rules:{ref:{method(f){M(!this.$_terms.link,"Cannot reinitialize schema"),f=_.ref(f),M(f.type==="value"||f.type==="local","Invalid reference type:",f.type),M(f.type==="local"||f.ancestor==="root"||f.ancestor>0,"Link cannot reference itself");const z=this.clone();return z.$_terms.link=[{ref:f}],z}},relative:{method(f=!0){return this.$_setFlag("relative",f)}}},overrides:{concat(f){M(this.$_terms.link,"Uninitialized link schema"),M(y.isSchema(f),"Invalid schema object"),M(f.type!=="link","Cannot merge type link with another link");const z=this.clone();return z.$_terms.whens||(z.$_terms.whens=[]),z.$_terms.whens.push({concat:f}),z.$_mutateRebuild()}},manifest:{build:(f,z)=>(M(z.link,"Invalid link description missing link"),f.ref(z.link))}}),d.generate=function(f,z,s,h){let A=s.mainstay.links.get(f);if(A)return A._generate(z,s,h).schema;const q=f.$_terms.link[0].ref,{perspective:v,path:L}=d.perspective(q,s);d.assert(v,"which is outside of schema boundaries",q,f,s,h);try{A=L.length?v.$_reach(L):v}catch{d.assert(!1,"to non-existing schema",q,f,s,h)}return d.assert(A.type!=="link","which is another link",q,f,s,h),f._flags.relative||s.mainstay.links.set(f,A),A._generate(z,s,h).schema},d.perspective=function(f,z){if(f.type==="local"){for(const{schema:s,key:h}of z.schemas){if((s._flags.id||h)===f.path[0])return{perspective:s,path:f.path.slice(1)};if(s.$_terms.shared){for(const A of s.$_terms.shared)if(A._flags.id===f.path[0])return{perspective:A,path:f.path.slice(1)}}}return{perspective:null,path:null}}return f.ancestor==="root"?{perspective:z.schemas[z.schemas.length-1].schema,path:f.path}:{perspective:z.schemas[f.ancestor]&&z.schemas[f.ancestor].schema,path:f.path}},d.assert=function(f,z,s,h,A,q){f||M(!1,`"${O.label(h._flags,A,q)}" contains link reference "${s.display}" ${z}`)}},3832:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y=l(8160),_={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/};p.exports=g.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(O,{schema:d,error:f}){if(!O.match(_.numberRx))return;O=O.trim();const z={value:parseFloat(O)};if(z.value===0&&(z.value=0),!d._flags.unsafe)if(O.match(/e/i)){if(_.extractSignificantDigits(O)!==_.extractSignificantDigits(String(z.value)))return z.errors=f("number.unsafe"),z}else{const s=z.value.toString();if(s.match(/e/i))return z;if(s!==_.normalizeDecimal(O))return z.errors=f("number.unsafe"),z}return z}},validate(O,{schema:d,error:f,prefs:z}){if(O===1/0||O===-1/0)return{value:O,errors:f("number.infinity")};if(!y.isNumber(O))return{value:O,errors:f("number.base")};const s={value:O};if(z.convert){const h=d.$_getRule("precision");if(h){const A=Math.pow(10,h.args.limit);s.value=Math.round(s.value*A)/A}}return s.value===0&&(s.value=0),!d._flags.unsafe&&(O>Number.MAX_SAFE_INTEGER||O<Number.MIN_SAFE_INTEGER)&&(s.errors=f("number.unsafe")),s},rules:{compare:{method:!1,validate:(O,d,{limit:f},{name:z,operator:s,args:h})=>y.compare(O,f,s)?O:d.error("number."+z,{limit:h.limit,value:O}),args:[{name:"limit",ref:!0,assert:y.isNumber,message:"must be a number"}]},greater:{method(O){return this.$_addRule({name:"greater",method:"compare",args:{limit:O},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(O,d)=>Math.trunc(O)-O==0?O:d.error("number.integer")},less:{method(O){return this.$_addRule({name:"less",method:"compare",args:{limit:O},operator:"<"})}},max:{method(O){return this.$_addRule({name:"max",method:"compare",args:{limit:O},operator:"<="})}},min:{method(O){return this.$_addRule({name:"min",method:"compare",args:{limit:O},operator:">="})}},multiple:{method(O){return this.$_addRule({name:"multiple",args:{base:O}})},validate:(O,d,{base:f},z)=>O*(1/f)%1==0?O:d.error("number.multiple",{multiple:z.args.base,value:O}),args:[{name:"base",ref:!0,assert:O=>typeof O=="number"&&isFinite(O)&&O>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(O,d)=>Number.isSafeInteger(O)&&O>=0&&O<=65535?O:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(O){return M(Number.isSafeInteger(O),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:O}})},validate(O,d,{limit:f}){const z=O.toString().match(_.precisionRx);return Math.max((z[1]?z[1].length:0)-(z[2]?parseInt(z[2],10):0),0)<=f?O:d.error("number.precision",{limit:f,value:O})},convert:!0},sign:{method(O){return M(["negative","positive"].includes(O),"Invalid sign",O),this.$_addRule({name:"sign",args:{sign:O}})},validate:(O,d,{sign:f})=>f==="negative"&&O<0||f==="positive"&&O>0?O:d.error(`number.${f}`)},unsafe:{method(O=!0){return M(typeof O=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",O)}}},cast:{string:{from:O=>typeof O=="number",to:(O,d)=>O.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),_.extractSignificantDigits=function(O){return O.replace(_.exponentialPartRegex,"").replace(_.dotRegex,"").replace(_.trailingZerosRegex,"").replace(_.leadingSignAndZerosRegex,"")},_.normalizeDecimal=function(O){return(O=O.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&O.endsWith("0")&&(O=O.replace(/0+$/,"")),O==="-0"?"0":O}},8966:(p,c,l)=>{const M=l(7824);p.exports=M.extend({type:"object",cast:{map:{from:g=>g&&typeof g=="object",to:(g,y)=>new Map(Object.entries(g))}}})},7417:(p,c,l)=>{const{assert:M,escapeRegex:g}=l(8870),{isDomainValid:y,isEmailValid:_,ipRegex:O,uriRegex:d}=l(4958),f=l(6264),z=l(8068),s=l(8160),h={tlds:f.tlds instanceof Set&&{tlds:{allow:f.tlds,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:/^[a-f0-9]+$/i,ipRegex:O({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};p.exports=z.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(A,{schema:q,state:v,prefs:L}){const T=q.$_getRule("normalize");T&&(A=A.normalize(T.args.form));const w=q.$_getRule("case");w&&(A=w.args.direction==="upper"?A.toLocaleUpperCase():A.toLocaleLowerCase());const C=q.$_getRule("trim");if(C&&C.args.enabled&&(A=A.trim()),q.$_terms.replacements)for(const S of q.$_terms.replacements)A=A.replace(S.pattern,S.replacement);const R=q.$_getRule("hex");if(R&&R.args.options.byteAligned&&A.length%2!=0&&(A=`0${A}`),q.$_getRule("isoDate")){const S=h.isoDate(A);S&&(A=S)}if(q._flags.truncate){const S=q.$_getRule("max");if(S){let E=S.args.limit;if(s.isResolvable(E)&&(E=E.resolve(A,v,L),!s.limit(E)))return{value:A,errors:q.$_createError("any.ref",E,{ref:S.args.limit,arg:"limit",reason:"must be a positive integer"},v,L)};A=A.slice(0,E)}}return{value:A}}},validate(A,{schema:q,error:v}){if(typeof A!="string")return{value:A,errors:v("string.base")};if(A===""){const L=q.$_getRule("min");return L&&L.args.limit===0?void 0:{value:A,errors:v("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(A,q)=>/^[a-zA-Z0-9]+$/.test(A)?A:q.error("string.alphanum")},base64:{method(A={}){return s.assertOptions(A,["paddingRequired","urlSafe"]),A={urlSafe:!1,paddingRequired:!0,...A},M(typeof A.paddingRequired=="boolean","paddingRequired must be boolean"),M(typeof A.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:A}})},validate:(A,q,{options:v})=>h.base64Regex[v.paddingRequired][v.urlSafe].test(A)?A:q.error("string.base64")},case:{method(A){return M(["lower","upper"].includes(A),"Invalid case:",A),this.$_addRule({name:"case",args:{direction:A}})},validate:(A,q,{direction:v})=>v==="lower"&&A===A.toLocaleLowerCase()||v==="upper"&&A===A.toLocaleUpperCase()?A:q.error(`string.${v}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(A,q){let v=A.length,L=0,T=1;for(;v--;){const w=A.charAt(v)*T;L+=w-9*(w>9),T^=3}return L>0&&L%10==0?A:q.error("string.creditCard")}},dataUri:{method(A={}){return s.assertOptions(A,["paddingRequired"]),A={paddingRequired:!0,...A},M(typeof A.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:A}})},validate(A,q,{options:v}){const L=A.match(h.dataUriRegex);return L&&(!L[2]||L[2]!=="base64"||h.base64Regex[v.paddingRequired].false.test(L[3]))?A:q.error("string.dataUri")}},domain:{method(A){A&&s.assertOptions(A,["allowFullyQualified","allowUnicode","allowUnderscore","maxDomainSegments","minDomainSegments","tlds"]);const q=h.addressOptions(A);return this.$_addRule({name:"domain",args:{options:A},address:q})},validate:(A,q,v,{address:L})=>y(A,L)?A:q.error("string.domain")},email:{method(A={}){s.assertOptions(A,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),M(A.multiple===void 0||typeof A.multiple=="boolean","multiple option must be an boolean");const q=h.addressOptions(A),v=new RegExp(`\\s*[${A.separator?g(A.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:A},regex:v,address:q})},validate(A,q,{options:v},{regex:L,address:T}){const w=v.multiple?A.split(L):[A],C=[];for(const R of w)_(R,T)||C.push(R);return C.length?q.error("string.email",{value:A,invalids:C}):A}},guid:{alias:"uuid",method(A={}){s.assertOptions(A,["version","separator"]);let q="";if(A.version){const T=[].concat(A.version);M(T.length>=1,"version must have at least 1 valid version specified");const w=new Set;for(let C=0;C<T.length;++C){const R=T[C];M(typeof R=="string","version at position "+C+" must be a string");const S=h.guidVersions[R.toLowerCase()];M(S,"version at position "+C+" must be one of "+Object.keys(h.guidVersions).join(", ")),M(!w.has(S),"version at position "+C+" must not be a duplicate"),q+=S,w.add(S)}}M(h.guidSeparators.has(A.separator),'separator must be one of true, false, "-", or ":"');const v=A.separator===void 0?"[:-]?":A.separator===!0?"[:-]":A.separator===!1?"[]?":`\\${A.separator}`,L=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${v})[0-9A-F]{4}\\2?[${q||"0-9A-F"}][0-9A-F]{3}\\2?[${q?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:A},regex:L})},validate(A,q,v,{regex:L}){const T=L.exec(A);return T?h.guidBrackets[T[1]]!==T[T.length-1]?q.error("string.guid"):A:q.error("string.guid")}},hex:{method(A={}){return s.assertOptions(A,["byteAligned"]),A={byteAligned:!1,...A},M(typeof A.byteAligned=="boolean","byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:A}})},validate:(A,q,{options:v})=>h.hexRegex.test(A)?v.byteAligned&&A.length%2!=0?q.error("string.hexAlign"):A:q.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(A,q)=>y(A,{minDomainSegments:1})||h.ipRegex.test(A)?A:q.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(A={}){s.assertOptions(A,["cidr","version"]);const{cidr:q,versions:v,regex:L}=O(A),T=A.version?v:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:q,version:T}},regex:L})},validate:(A,q,{options:v},{regex:L})=>L.test(A)?A:v.version?q.error("string.ipVersion",{value:A,cidr:v.cidr,version:v.version}):q.error("string.ip",{value:A,cidr:v.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(A,{error:q})=>h.isoDate(A)?A:q("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(A,q)=>h.isoDurationRegex.test(A)?A:q.error("string.isoDuration")},length:{method(A,q){return h.length(this,"length",A,"=",q)},validate(A,q,{limit:v,encoding:L},{name:T,operator:w,args:C}){const R=!L&&A.length;return s.compare(R,v,w)?A:q.error("string."+T,{limit:C.limit,value:A,encoding:L})},args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(A,q){return h.length(this,"max",A,"<=",q)},args:["limit","encoding"]},min:{method(A,q){return h.length(this,"min",A,">=",q)},args:["limit","encoding"]},normalize:{method(A="NFC"){return M(h.normalizationForms.includes(A),"normalization form must be one of "+h.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:A}})},validate:(A,{error:q},{form:v})=>A===A.normalize(v)?A:q("string.normalize",{value:A,form:v}),convert:!0},pattern:{alias:"regex",method(A,q={}){M(A instanceof RegExp,"regex must be a RegExp"),M(!A.flags.includes("g")&&!A.flags.includes("y"),"regex should not use global or sticky mode"),typeof q=="string"&&(q={name:q}),s.assertOptions(q,["invert","name"]);const v=["string.pattern",q.invert?".invert":"",q.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:A,options:q},errorCode:v})},validate:(A,q,{regex:v,options:L},{errorCode:T})=>v.test(A)^L.invert?A:q.error(T,{name:L.name,regex:v,value:A}),args:["regex","options"],multi:!0},replace:{method(A,q){typeof A=="string"&&(A=new RegExp(g(A),"g")),M(A instanceof RegExp,"pattern must be a RegExp"),M(typeof q=="string","replacement must be a String");const v=this.clone();return v.$_terms.replacements||(v.$_terms.replacements=[]),v.$_terms.replacements.push({pattern:A,replacement:q}),v}},token:{method(){return this.$_addRule("token")},validate:(A,q)=>/^\w+$/.test(A)?A:q.error("string.token")},trim:{method(A=!0){return M(typeof A=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:A}})},validate:(A,q,{enabled:v})=>v&&A!==A.trim()?q.error("string.trim"):A,convert:!0},truncate:{method(A=!0){return M(typeof A=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",A)}},uppercase:{method(){return this.case("upper")}},uri:{method(A={}){s.assertOptions(A,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),A.domain&&s.assertOptions(A.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:q,scheme:v}=d(A),L=A.domain?h.addressOptions(A.domain):null;return this.$_addRule({name:"uri",args:{options:A},regex:q,domain:L,scheme:v})},validate(A,q,{options:v},{regex:L,domain:T,scheme:w}){if(["http:/","https:/"].includes(A))return q.error("string.uri");const C=L.exec(A);if(C){const R=C[1]||C[2];return!T||v.allowRelative&&!R||y(R,T)?A:q.error("string.domain",{value:R})}return v.relativeOnly?q.error("string.uriRelativeOnly"):v.scheme?q.error("string.uriCustomScheme",{scheme:w,value:A}):q.error("string.uri")}}},manifest:{build(A,q){if(q.replacements)for(const{pattern:v,replacement:L}of q.replacements)A=A.replace(v,L);return A}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),h.addressOptions=function(A){if(!A||(M(A.minDomainSegments===void 0||Number.isSafeInteger(A.minDomainSegments)&&A.minDomainSegments>0,"minDomainSegments must be a positive integer"),M(A.maxDomainSegments===void 0||Number.isSafeInteger(A.maxDomainSegments)&&A.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),A.tlds===!1))return A;if(A.tlds===!0||A.tlds===void 0)return M(h.tlds,"Built-in TLD list disabled"),Object.assign({},A,h.tlds);M(typeof A.tlds=="object","tlds must be true, false, or an object");const q=A.tlds.deny;if(q)return Array.isArray(q)&&(A=Object.assign({},A,{tlds:{deny:new Set(q)}})),M(A.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),M(!A.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),h.validateTlds(A.tlds.deny,"tlds.deny"),A;const v=A.tlds.allow;return v?v===!0?(M(h.tlds,"Built-in TLD list disabled"),Object.assign({},A,h.tlds)):(Array.isArray(v)&&(A=Object.assign({},A,{tlds:{allow:new Set(v)}})),M(A.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),h.validateTlds(A.tlds.allow,"tlds.allow"),A):{...A,tlds:!1}},h.validateTlds=function(A,q){for(const v of A)M(y(v,{minDomainSegments:1,maxDomainSegments:1}),`${q} must contain valid top level domain names`)},h.isoDate=function(A){if(!s.isIsoDate(A))return null;/.*T.*[+-]\d\d$/.test(A)&&(A+="00");const q=new Date(A);return isNaN(q.getTime())?null:q.toISOString()},h.length=function(A,q,v,L,T){return M(!T||!1,"Invalid encoding:",T),A.$_addRule({name:q,method:"length",args:{limit:v,encoding:T},operator:L})}},8826:(p,c,l)=>{const{assert:M}=l(8870),g=l(8068),y={};y.Map=class extends Map{slice(){return new y.Map(this)}},p.exports=g.extend({type:"symbol",terms:{map:{init:new y.Map}},coerce:{method(_,{schema:O,error:d}){const f=O.$_terms.map.get(_);return f&&(_=f),O._flags.only&&typeof _!="symbol"?{value:_,errors:d("symbol.map",{map:O.$_terms.map})}:{value:_}}},validate(_,{error:O}){if(typeof _!="symbol")return{value:_,errors:O("symbol.base")}},rules:{map:{method(_){_&&!_[Symbol.iterator]&&typeof _=="object"&&(_=Object.entries(_)),M(_&&_[Symbol.iterator],"Iterable must be an iterable or object");const O=this.clone(),d=[];for(const f of _){M(f&&f[Symbol.iterator],"Entry must be an iterable");const[z,s]=f;M(typeof z!="object"&&typeof z!="function"&&typeof z!="symbol","Key must not be of type object, function, or Symbol"),M(typeof s=="symbol","Value must be a Symbol"),O.$_terms.map.set(z,s),d.push(s)}return O.valid(...d)}}},manifest:{build:(_,O)=>(O.map&&(_=_.map(O.map)),_)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(p,c,l)=>{const{assert:M,clone:g,ignore:y,reach:_}=l(8870),O=l(8160),d=l(6354),f=l(493),z={result:Symbol("result")};c.entry=function(s,h,A){let q=O.defaults;A&&(M(A.warnings===void 0,"Cannot override warnings preference in synchronous validation"),M(A.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),q=O.preferences(O.defaults,A));const v=z.entry(s,h,q);M(!v.mainstay.externals.length,"Schema with external rules must use validateAsync()");const L={value:v.value};return v.error&&(L.error=v.error),v.mainstay.warnings.length&&(L.warning=d.details(v.mainstay.warnings)),v.mainstay.debug&&(L.debug=v.mainstay.debug),v.mainstay.artifacts&&(L.artifacts=v.mainstay.artifacts),L},c.entryAsync=async function(s,h,A){let q=O.defaults;A&&(q=O.preferences(O.defaults,A));const v=z.entry(s,h,q),L=v.mainstay;if(v.error)throw L.debug&&(v.error.debug=L.debug),v.error;if(L.externals.length){let w=v.value;const C=[];for(const R of L.externals){const S=R.state.path,E=R.schema.type==="link"?L.links.get(R.schema):null;let G,s0,b0=w;const V=S.length?[w]:[],Z=S.length?_(s,S):s;if(S.length){G=S[S.length-1];let d0=w;for(const v0 of S.slice(0,-1))d0=d0[v0],V.unshift(d0);s0=V[0],b0=s0[G]}try{const d0=(E0,S0)=>(E||R.schema).$_createError(E0,b0,S0,R.state,q),v0=await R.method(b0,{schema:R.schema,linked:E,state:R.state,prefs:A,original:Z,error:d0,errorsArray:z.errorsArray,warn:(E0,S0)=>L.warnings.push((E||R.schema).$_createError(E0,b0,S0,R.state,q)),message:(E0,S0)=>(E||R.schema).$_createError("external",b0,S0,R.state,q,{messages:E0})});if(v0===void 0||v0===b0)continue;if(v0 instanceof d.Report){if(L.tracer.log(R.schema,R.state,"rule","external","error"),C.push(v0),q.abortEarly)break;continue}if(Array.isArray(v0)&&v0[O.symbols.errors]){if(L.tracer.log(R.schema,R.state,"rule","external","error"),C.push(...v0),q.abortEarly)break;continue}s0?(L.tracer.value(R.state,"rule",b0,v0,"external"),s0[G]=v0):(L.tracer.value(R.state,"rule",w,v0,"external"),w=v0)}catch(d0){throw q.errors.label&&(d0.message+=` (${R.label})`),d0}}if(v.value=w,C.length)throw v.error=d.process(C,s,q),L.debug&&(v.error.debug=L.debug),v.error}if(!q.warnings&&!q.debug&&!q.artifacts)return v.value;const T={value:v.value};return L.warnings.length&&(T.warning=d.details(L.warnings)),L.debug&&(T.debug=L.debug),L.artifacts&&(T.artifacts=L.artifacts),T},z.Mainstay=class{constructor(s,h,A){this.externals=[],this.warnings=[],this.tracer=s,this.debug=h,this.links=A,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const s=this._snapshots.pop();this.externals=s.externals,this.warnings=s.warnings}commit(){this._snapshots.pop()}},z.entry=function(s,h,A){const{tracer:q,cleanup:v}=z.tracer(h,A),L=A.debug?[]:null,T=h._ids._schemaChain?new Map:null,w=new z.Mainstay(q,L,T),C=h._ids._schemaChain?[{schema:h}]:null,R=new f([],[],{mainstay:w,schemas:C}),S=c.validate(s,h,R,A);v&&h.$_root.untrace();const E=d.process(S.errors,s,A);return{value:S.value,error:E,mainstay:w}},z.tracer=function(s,h){return s.$_root._tracer?{tracer:s.$_root._tracer._register(s)}:h.debug?(M(s.$_root.trace,"Debug mode not supported"),{tracer:s.$_root.trace()._register(s),cleanup:!0}):{tracer:z.ignore}},c.validate=function(s,h,A,q,v={}){if(h.$_terms.whens&&(h=h._generate(s,A,q).schema),h._preferences&&(q=z.prefs(h,q)),h._cache&&q.cache){const E=h._cache.get(s);if(A.mainstay.tracer.debug(A,"validate","cached",!!E),E)return E}const L=(E,G,s0)=>h.$_createError(E,s,G,s0||A,q),T={original:s,prefs:q,schema:h,state:A,error:L,errorsArray:z.errorsArray,warn:(E,G,s0)=>A.mainstay.warnings.push(L(E,G,s0)),message:(E,G)=>h.$_createError("custom",s,G,A,q,{messages:E})};A.mainstay.tracer.entry(h,A);const w=h._definition;if(w.prepare&&s!==void 0&&q.convert){const E=w.prepare(s,T);if(E){if(A.mainstay.tracer.value(A,"prepare",s,E.value),E.errors)return z.finalize(E.value,[].concat(E.errors),T);s=E.value}}if(w.coerce&&s!==void 0&&q.convert&&(!w.coerce.from||w.coerce.from.includes(typeof s))){const E=w.coerce.method(s,T);if(E){if(A.mainstay.tracer.value(A,"coerced",s,E.value),E.errors)return z.finalize(E.value,[].concat(E.errors),T);s=E.value}}const C=h._flags.empty;C&&C.$_match(z.trim(s,h),A.nest(C),O.defaults)&&(A.mainstay.tracer.value(A,"empty",s,void 0),s=void 0);const R=v.presence||h._flags.presence||(h._flags._endedSwitch?null:q.presence);if(s===void 0){if(R==="forbidden")return z.finalize(s,null,T);if(R==="required")return z.finalize(s,[h.$_createError("any.required",s,null,A,q)],T);if(R==="optional"){if(h._flags.default!==O.symbols.deepDefault)return z.finalize(s,null,T);A.mainstay.tracer.value(A,"default",s,{}),s={}}}else if(R==="forbidden")return z.finalize(s,[h.$_createError("any.unknown",s,null,A,q)],T);const S=[];if(h._valids){const E=h._valids.get(s,A,q,h._flags.insensitive);if(E)return q.convert&&(A.mainstay.tracer.value(A,"valids",s,E.value),s=E.value),A.mainstay.tracer.filter(h,A,"valid",E),z.finalize(s,null,T);if(h._flags.only){const G=h.$_createError("any.only",s,{valids:h._valids.values({display:!0})},A,q);if(q.abortEarly)return z.finalize(s,[G],T);S.push(G)}}if(h._invalids){const E=h._invalids.get(s,A,q,h._flags.insensitive);if(E){A.mainstay.tracer.filter(h,A,"invalid",E);const G=h.$_createError("any.invalid",s,{invalids:h._invalids.values({display:!0})},A,q);if(q.abortEarly)return z.finalize(s,[G],T);S.push(G)}}if(w.validate){const E=w.validate(s,T);if(E&&(A.mainstay.tracer.value(A,"base",s,E.value),s=E.value,E.errors)){if(!Array.isArray(E.errors))return S.push(E.errors),z.finalize(s,S,T);if(E.errors.length)return S.push(...E.errors),z.finalize(s,S,T)}}return h._rules.length?z.rules(s,S,T):z.finalize(s,S,T)},z.rules=function(s,h,A){const{schema:q,state:v,prefs:L}=A;for(const T of q._rules){const w=q._definition.rules[T.method];if(w.convert&&L.convert){v.mainstay.tracer.log(q,v,"rule",T.name,"full");continue}let C,R=T.args;if(T._resolve.length){R=Object.assign({},R);for(const E of T._resolve){const G=w.argsByName.get(E),s0=R[E].resolve(s,v,L),b0=G.normalize?G.normalize(s0):s0,V=O.validateArg(b0,null,G);if(V){C=q.$_createError("any.ref",s0,{arg:E,ref:R[E],reason:V},v,L);break}R[E]=b0}}C=C||w.validate(s,A,R,T);const S=z.rule(C,T);if(S.errors){if(v.mainstay.tracer.log(q,v,"rule",T.name,"error"),T.warn){v.mainstay.warnings.push(...S.errors);continue}if(L.abortEarly)return z.finalize(s,S.errors,A);h.push(...S.errors)}else v.mainstay.tracer.log(q,v,"rule",T.name,"pass"),v.mainstay.tracer.value(v,"rule",s,S.value,T.name),s=S.value}return z.finalize(s,h,A)},z.rule=function(s,h){return s instanceof d.Report?(z.error(s,h),{errors:[s],value:null}):Array.isArray(s)&&s[O.symbols.errors]?(s.forEach(A=>z.error(A,h)),{errors:s,value:null}):{errors:null,value:s}},z.error=function(s,h){return h.message&&s._setTemplate(h.message),s},z.finalize=function(s,h,A){h=h||[];const{schema:q,state:v,prefs:L}=A;if(h.length){const w=z.default("failover",void 0,h,A);w!==void 0&&(v.mainstay.tracer.value(v,"failover",s,w),s=w,h=[])}if(h.length&&q._flags.error)if(typeof q._flags.error=="function"){h=q._flags.error(h),Array.isArray(h)||(h=[h]);for(const w of h)M(w instanceof Error||w instanceof d.Report,"error() must return an Error object")}else h=[q._flags.error];if(s===void 0){const w=z.default("default",s,h,A);v.mainstay.tracer.value(v,"default",s,w),s=w}if(q._flags.cast&&s!==void 0){const w=q._definition.cast[q._flags.cast];if(w.from(s)){const C=w.to(s,A);v.mainstay.tracer.value(v,"cast",s,C,q._flags.cast),s=C}}if(q.$_terms.externals&&L.externals&&L._externals!==!1)for(const{method:w}of q.$_terms.externals)v.mainstay.externals.push({method:w,schema:q,state:v,label:d.label(q._flags,v,L)});const T={value:s,errors:h.length?h:null};return q._flags.result&&(T.value=q._flags.result==="strip"?void 0:A.original,v.mainstay.tracer.value(v,q._flags.result,s,T.value),v.shadow(s,q._flags.result)),q._cache&&L.cache!==!1&&!q._refs.length&&q._cache.set(A.original,T),s===void 0||T.errors||q._flags.artifact===void 0||(v.mainstay.artifacts=v.mainstay.artifacts||new Map,v.mainstay.artifacts.has(q._flags.artifact)||v.mainstay.artifacts.set(q._flags.artifact,[]),v.mainstay.artifacts.get(q._flags.artifact).push(v.path)),T},z.prefs=function(s,h){const A=h===O.defaults;return A&&s._preferences[O.symbols.prefs]?s._preferences[O.symbols.prefs]:(h=O.preferences(h,s._preferences),A&&(s._preferences[O.symbols.prefs]=h),h)},z.default=function(s,h,A,q){const{schema:v,state:L,prefs:T}=q,w=v._flags[s];if(T.noDefaults||w===void 0)return h;if(L.mainstay.tracer.log(v,L,"rule",s,"full"),!w)return w;if(typeof w=="function"){const C=w.length?[g(L.ancestors[0]),q]:[];try{return w(...C)}catch(R){return void A.push(v.$_createError(`any.${s}`,null,{error:R},L,T))}}return typeof w!="object"?w:w[O.symbols.literal]?w.literal:O.isResolvable(w)?w.resolve(h,L,T):g(w)},z.trim=function(s,h){if(typeof s!="string")return s;const A=h.$_getRule("trim");return A&&A.args.enabled?s.trim():s},z.ignore={active:!1,debug:y,entry:y,filter:y,log:y,resolve:y,value:y},z.errorsArray=function(){const s=[];return s[O.symbols.errors]=!0,s}},2036:(p,c,l)=>{const{assert:M,deepEqual:g}=l(8870),y=l(8160),_={};p.exports=_.Values=class{constructor(O,d){this._values=new Set(O),this._refs=new Set(d),this._lowercase=_.lowercases(O),this._override=!1}get length(){return this._values.size+this._refs.size}add(O,d){y.isResolvable(O)?this._refs.has(O)||(this._refs.add(O),d&&d.register(O)):this.has(O,null,null,!1)||(this._values.add(O),typeof O=="string"&&this._lowercase.set(O.toLowerCase(),O))}static merge(O,d,f){if(O=O||new _.Values,d){if(d._override)return d.clone();for(const z of[...d._values,...d._refs])O.add(z)}if(f)for(const z of[...f._values,...f._refs])O.remove(z);return O.length?O:null}remove(O){y.isResolvable(O)?this._refs.delete(O):(this._values.delete(O),typeof O=="string"&&this._lowercase.delete(O.toLowerCase()))}has(O,d,f,z){return!!this.get(O,d,f,z)}get(O,d,f,z){if(!this.length)return!1;if(this._values.has(O))return{value:O};if(typeof O=="string"&&O&&z){const s=this._lowercase.get(O.toLowerCase());if(s)return{value:s}}if(!this._refs.size&&typeof O!="object")return!1;if(typeof O=="object"){for(const s of this._values)if(g(s,O))return{value:s}}if(d)for(const s of this._refs){const h=s.resolve(O,d,f,null,{in:!0});if(h===void 0)continue;const A=s.in&&typeof h=="object"?Array.isArray(h)?h:Object.keys(h):[h];for(const q of A)if(typeof q==typeof O){if(z&&O&&typeof O=="string"){if(q.toLowerCase()===O.toLowerCase())return{value:q,ref:s}}else if(g(q,O))return{value:q,ref:s}}}return!1}override(){this._override=!0}values(O){if(O&&O.display){const d=[];for(const f of[...this._values,...this._refs])f!==void 0&&d.push(f);return d}return Array.from([...this._values,...this._refs])}clone(){const O=new _.Values(this._values,this._refs);return O._override=this._override,O}concat(O){M(!O._override,"Cannot concat override set of values");const d=new _.Values([...this._values,...O._values],[...this._refs,...O._refs]);return d._override=this._override,d}describe(){const O=[];this._override&&O.push({override:!0});for(const d of this._values.values())O.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())O.push(d.describe());return O}},_.Values.prototype[y.symbols.values]=!0,_.Values.prototype.slice=_.Values.prototype.clone,_.lowercases=function(O){const d=new Map;if(O)for(const f of O)typeof f=="string"&&d.set(f.toLowerCase(),f);return d}},4958:(p,c,l)=>{l.r(c),l.d(c,{analyzeDomain:()=>q,analyzeEmail:()=>R,errorCodes:()=>g,ipRegex:()=>Oe,isDomainValid:()=>v,isEmailValid:()=>S,uriDecode:()=>B1,uriRegex:()=>Y1,validateDomainOptions:()=>L});var M=l(1275);const g={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"};function y(M0){return{code:M0,error:g[M0]}}const _=2,O=/[^\x00-\x7f]/,d=/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,f=/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,z=/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,s=/^[a-zA-Z0-9_](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,h=M.URL||URL;function A(M0){return!!M0.allow}function q(M0,N0={}){if(!M0)return y("DOMAIN_NON_EMPTY_STRING");if(typeof M0!="string")throw new Error("Invalid input: domain must be a string");if(M0.length>256)return y("DOMAIN_TOO_LONG");if(O.test(M0)){if(N0.allowUnicode===!1)return y("DOMAIN_INVALID_UNICODE_CHARS");M0=M0.normalize("NFC")}if(d.test(M0))return y("DOMAIN_INVALID_CHARS");M0=function(t0){t0.includes("%")&&(t0=t0.replace(/%/g,"%25"));try{return new h(`http://${t0}`).host}catch{return t0}}(M0),N0.allowFullyQualified&&M0[M0.length-1]==="."&&(M0=M0.slice(0,-1));const t1=N0.minDomainSegments||_,j=M0.split(".");if(j.length<t1)return y("DOMAIN_SEGMENTS_COUNT");if(N0.maxDomainSegments&&j.length>N0.maxDomainSegments)return y("DOMAIN_SEGMENTS_COUNT_MAX");const e0=N0.tlds;if(e0){const t0=j[j.length-1].toLowerCase();if(A(e0)){if(!e0.allow.has(t0))return y("DOMAIN_FORBIDDEN_TLDS")}else if(e0.deny.has(t0))return y("DOMAIN_FORBIDDEN_TLDS")}for(let t0=0;t0<j.length;++t0){const c0=j[t0];if(!c0.length)return y("DOMAIN_EMPTY_SEGMENT");if(c0.length>63)return y("DOMAIN_LONG_SEGMENT");if(t0<j.length-1){if(N0.allowUnderscore){if(!s.test(c0))return y("DOMAIN_INVALID_CHARS")}else if(!z.test(c0))return y("DOMAIN_INVALID_CHARS")}else if(!f.test(c0))return y("DOMAIN_INVALID_TLDS_CHARS")}return null}function v(M0,N0){return!q(M0,N0)}function L(M0){if(M0){if(typeof M0.tlds!="object")throw new Error("Invalid options: tlds must be a boolean or an object");if(A(M0.tlds)){if(M0.tlds.allow instanceof Set==0)throw new Error("Invalid options: tlds.allow must be a Set object or true");if(M0.tlds.deny)throw new Error("Invalid options: cannot specify both tlds.allow and tlds.deny lists")}else if(M0.tlds.deny instanceof Set==0)throw new Error("Invalid options: tlds.deny must be a Set object")}}var T=l(3975);const w=/[^\x00-\x7f]/,C=new(T.TextEncoder||TextEncoder);function R(M0,N0){return E(M0,N0)}function S(M0,N0){return!E(M0,N0)}function E(M0,N0={}){if(typeof M0!="string")throw new Error("Invalid input: email must be a string");if(!M0)return y("EMPTY_STRING");const t1=!w.test(M0);if(!t1){if(N0.allowUnicode===!1)return y("FORBIDDEN_UNICODE");M0=M0.normalize("NFC")}const j=M0.split("@");if(j.length!==2)return j.length>2?y("MULTIPLE_AT_CHAR"):y("MISSING_AT_CHAR");const[e0,t0]=j;if(!e0)return y("EMPTY_LOCAL");if(!N0.ignoreLength){if(M0.length>254)return y("ADDRESS_TOO_LONG");if(C.encode(e0).length>64)return y("LOCAL_TOO_LONG")}return function(c0,R0){const X0=c0.split(".");for(const x0 of X0){if(!x0.length)return y("EMPTY_LOCAL_SEGMENT");if(R0){if(!s0.test(x0))return y("INVALID_LOCAL_CHARS")}else for(const k0 of x0){if(s0.test(k0))continue;const Q0=G(k0);if(!b0.test(Q0))return y("INVALID_LOCAL_CHARS")}}return null}(e0,t1)||q(t0,N0)}function G(M0){return Array.from(C.encode(M0),N0=>String.fromCharCode(N0)).join("")}const s0=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,b0=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"));var V=l(375),Z=l.n(V),d0=l(6064),v0=l.n(d0);const E0=function(){const M0={},N0="\\dA-Fa-f",t1="["+N0+"]",j="\\w-\\.~",e0="!\\$&'\\(\\)\\*\\+,;=",t0="%"+N0,c0=j+t0+e0+":@",R0="["+c0+"]",X0="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";M0.ipv4address="(?:"+X0+"\\.){3}"+X0;const x0=t1+"{1,4}",k0="(?:"+x0+":"+x0+"|"+M0.ipv4address+")",Q0="(?:"+x0+":){6}"+k0,ao="::(?:"+x0+":){5}"+k0,Ko="(?:"+x0+")?::(?:"+x0+":){4}"+k0,Qi="(?:(?:"+x0+":){0,1}"+x0+")?::(?:"+x0+":){3}"+k0,Lo="(?:(?:"+x0+":){0,2}"+x0+")?::(?:"+x0+":){2}"+k0,Zi="(?:(?:"+x0+":){0,3}"+x0+")?::"+x0+":"+k0,_o="(?:(?:"+x0+":){0,4}"+x0+")?::"+k0,po="(?:(?:"+x0+":){0,5}"+x0+")?::"+x0,B2="(?:(?:"+x0+":){0,6}"+x0+")?::";M0.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",M0.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",M0.ipv6address="(?:"+Q0+"|"+ao+"|"+Ko+"|"+Qi+"|"+Lo+"|"+Zi+"|"+_o+"|"+po+"|"+B2+")",M0.ipvFuture="v"+t1+"+\\.["+j+e0+":]+",M0.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",M0.schemeRegex=new RegExp(M0.scheme);const Qo="["+j+t0+e0+":]*",ci="["+j+t0+e0+"]{1,255}",w2="(?:\\[(?:"+M0.ipv6address+"|"+M0.ipvFuture+")\\]|"+M0.ipv4address+"|"+ci+")",Zo="(?:"+Qo+"@)?"+w2+"(?::\\d*)?",Jo="(?:"+Qo+"@)?("+w2+")(?::\\d*)?",C2=R0+"*",X2=R0+"+",at="(?:\\/"+C2+")*",e2="\\/(?:"+X2+at+")?",Ji=X2+at,en="["+j+t0+e0+"@]+"+at,tn="(?:\\/\\/\\/"+C2+at+")";return M0.hierPart="(?:(?:\\/\\/"+Zo+at+")|"+e2+"|"+Ji+"|"+tn+")",M0.hierPartCapture="(?:(?:\\/\\/"+Jo+at+")|"+e2+"|"+Ji+")",M0.relativeRef="(?:(?:\\/\\/"+Zo+at+")|"+e2+"|"+en+"|)",M0.relativeRefCapture="(?:(?:\\/\\/"+Jo+at+")|"+e2+"|"+en+"|)",M0.query="["+c0+"\\/\\?]*(?=#|$)",M0.queryWithSquareBrackets="["+c0+"\\[\\]\\/\\?]*(?=#|$)",M0.fragment="["+c0+"\\/\\?]*",M0}(),S0={v4Cidr:E0.ipv4Cidr,v6Cidr:E0.ipv6Cidr,ipv4:E0.ipv4address,ipv6:E0.ipv6address,ipvfuture:E0.ipvFuture};function G0(M0){const N0=E0,t1="(?:\\?"+(M0.allowQuerySquareBrackets?N0.queryWithSquareBrackets:N0.query)+")?(?:#"+N0.fragment+")?",j=M0.domain?N0.relativeRefCapture:N0.relativeRef;if(M0.relativeOnly)return v1(j+t1);let e0="";if(M0.scheme){Z()(M0.scheme instanceof RegExp||typeof M0.scheme=="string"||Array.isArray(M0.scheme),"scheme must be a RegExp, String, or Array");const c0=[].concat(M0.scheme);Z()(c0.length>=1,"scheme must have at least 1 scheme specified");const R0=[];for(let X0=0;X0<c0.length;++X0){const x0=c0[X0];Z()(x0 instanceof RegExp||typeof x0=="string","scheme at position "+X0+" must be a RegExp or String"),x0 instanceof RegExp?R0.push(x0.source.toString()):(Z()(N0.schemeRegex.test(x0),"scheme at position "+X0+" must be a valid scheme"),R0.push(v0()(x0)))}e0=R0.join("|")}const t0="(?:"+(e0?"(?:"+e0+")":N0.scheme)+":"+(M0.domain?N0.hierPartCapture:N0.hierPart)+")";return v1((M0.allowRelative?"(?:"+t0+"|"+j+")":t0)+t1,e0)}function v1(M0,N0=null){return{raw:M0=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${M0}`,regex:new RegExp(`^${M0}$`),scheme:N0}}const h1=G0({});function Y1(M0={}){return M0.scheme||M0.allowRelative||M0.relativeOnly||M0.allowQuerySquareBrackets||M0.domain?G0(M0):h1}function Oe(M0={}){const N0=M0.cidr||"optional";Z()(["required","optional","forbidden"].includes(N0),"options.cidr must be one of required, optional, forbidden"),Z()(M0.version===void 0||typeof M0.version=="string"||Array.isArray(M0.version),"options.version must be a string or an array of string");let t1=M0.version||["ipv4","ipv6","ipvfuture"];Array.isArray(t1)||(t1=[t1]),Z()(t1.length>=1,"options.version must have at least 1 version specified");for(const t0 of t1)Z()(typeof t0=="string"&&t0===t0.toLowerCase(),"Invalid options.version value"),Z()(["ipv4","ipv6","ipvfuture"].includes(t0),"options.version contains unknown version "+t0+" - must be one of ipv4, ipv6, ipvfuture");t1=Array.from(new Set(t1));const j=`(?:${t1.map(t0=>{if(N0==="forbidden")return S0[t0];const c0=`\\/${t0==="ipv4"?S0.v4Cidr:S0.v6Cidr}`;return N0==="required"?`${S0[t0]}${c0}`:`${S0[t0]}(?:${c0})?`}).join("|")})`,e0=new RegExp(`^${j}$`);return{cidr:N0,versions:t1,regex:e0,raw:j}}const le={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15},e1={accept:12,reject:0,data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7]};function B1(M0){let N0=M0.indexOf("%");if(N0===-1)return M0;let t1="",j=0,e0=0,t0=N0,c0=e1.accept;for(;N0>-1&&N0<M0.length;){const R0=ft(M0[N0+1],4)|ft(M0[N0+2],0),X0=e1.data[R0];if(c0=e1.data[256+c0+X0],e0=e0<<6|R0&e1.data[364+X0],c0!==e1.accept){if(c0===e1.reject||(N0+=3,N0>=M0.length||M0[N0]!=="%"))return null}else t1+=M0.slice(j,t0),t1+=e0<=65535?String.fromCharCode(e0):String.fromCharCode(55232+(e0>>10),56320+(1023&e0)),e0=0,j=N0+3,N0=M0.indexOf("%",j),t0=N0}return t1+M0.slice(j)}function ft(M0,N0){const t1=le[M0];return t1===void 0?255:t1<<N0}},4964:(p,c)=>{const l={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};c.Parser=class{constructor(M,g={}){if(!g[l.settings]&&g.constants)for(const y in g.constants){const _=g.constants[y];if(_!==null&&!["boolean","number","string"].includes(typeof _))throw new Error(`Formula constant ${y} contains invalid ${typeof _} value type`)}this.settings=g[l.settings]?g:Object.assign({[l.settings]:!0,constants:{},functions:{}},g),this.single=null,this._parts=null,this._parse(M)}_parse(M){let g=[],y="",_=0,O=!1;const d=z=>{if(_)throw new Error("Formula missing closing parenthesis");const s=g.length?g[g.length-1]:null;if(O||y||z){if(s&&s.type==="reference"&&z===")")return s.type="function",s.value=this._subFormula(y,s.value),void(y="");if(z===")"){const h=new c.Parser(y,this.settings);g.push({type:"segment",value:h})}else if(O){if(O==="]")return g.push({type:"reference",value:y}),void(y="");g.push({type:"literal",value:y})}else if(l.operatorCharacters.includes(y))s&&s.type==="operator"&&l.operators.includes(s.value+y)?s.value+=y:g.push({type:"operator",value:y});else if(y.match(l.numberRx))g.push({type:"constant",value:parseFloat(y)});else if(this.settings.constants[y]!==void 0)g.push({type:"constant",value:this.settings.constants[y]});else{if(!y.match(l.tokenRx))throw new Error(`Formula contains invalid token: ${y}`);g.push({type:"reference",value:y})}y=""}};for(const z of M)O?z===O?(d(),O=!1):y+=z:_?z==="("?(y+=z,++_):z===")"?(--_,_?y+=z:d(z)):y+=z:z in l.literals?O=l.literals[z]:z==="("?(d(),++_):l.operatorCharacters.includes(z)?(d(),y=z,d()):z!==" "?y+=z:d();d(),g=g.map((z,s)=>z.type!=="operator"||z.value!=="-"||s&&g[s-1].type!=="operator"?z:{type:"operator",value:"n"});let f=!1;for(const z of g){if(z.type==="operator"){if(l.operatorsPrefix.includes(z.value))continue;if(!f)throw new Error("Formula contains an operator in invalid position");if(!l.operators.includes(z.value))throw new Error(`Formula contains an unknown operator ${z.value}`)}else if(f)throw new Error("Formula missing expected operator");f=!f}if(!f)throw new Error("Formula contains invalid trailing operator");g.length===1&&["reference","literal","constant"].includes(g[0].type)&&(this.single={type:g[0].type==="reference"?"reference":"value",value:g[0].value}),this._parts=g.map(z=>{if(z.type==="operator")return l.operatorsPrefix.includes(z.value)?z:z.value;if(z.type!=="reference")return z.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(z.value))throw new Error(`Formula contains invalid reference ${z.value}`);return this.settings.reference?this.settings.reference(z.value):l.reference(z.value)})}_subFormula(M,g){const y=this.settings.functions[g];if(typeof y!="function")throw new Error(`Formula contains unknown function ${g}`);let _=[];if(M){let O="",d=0,f=!1;const z=()=>{if(!O)throw new Error(`Formula contains function ${g} with invalid arguments ${M}`);_.push(O),O=""};for(let s=0;s<M.length;++s){const h=M[s];f?(O+=h,h===f&&(f=!1)):h in l.literals&&!d?(O+=h,f=l.literals[h]):h!==","||d?(O+=h,h==="("?++d:h===")"&&--d):z()}z()}return _=_.map(O=>new c.Parser(O,this.settings)),function(O){const d=[];for(const f of _)d.push(f.evaluate(O));return y.call(O,...d)}}evaluate(M){const g=this._parts.slice();for(let y=g.length-2;y>=0;--y){const _=g[y];if(_&&_.type==="operator"){const O=g[y+1];g.splice(y+1,1);const d=l.evaluate(O,M);g[y]=l.single(_.value,d)}}return l.operatorsOrder.forEach(y=>{for(let _=1;_<g.length-1;)if(y.includes(g[_])){const O=g[_],d=l.evaluate(g[_-1],M),f=l.evaluate(g[_+1],M);g.splice(_,2);const z=l.calculate(O,d,f);g[_-1]=z===0?0:z}else _+=2}),l.evaluate(g[0],M)}},c.Parser.prototype[l.symbol]=!0,l.reference=function(M){return function(g){return g&&g[M]!==void 0?g[M]:null}},l.evaluate=function(M,g){return M===null?null:typeof M=="function"?M(g):M[l.symbol]?M.evaluate(g):M},l.single=function(M,g){if(M==="!")return!g;const y=-g;return y===0?0:y},l.calculate=function(M,g,y){if(M==="??")return l.exists(g)?g:y;if(typeof g=="string"||typeof y=="string"){if(M==="+")return(g=l.exists(g)?g:"")+(l.exists(y)?y:"")}else switch(M){case"^":return Math.pow(g,y);case"*":return g*y;case"/":return g/y;case"%":return g%y;case"+":return g+y;case"-":return g-y}switch(M){case"<":return g<y;case"<=":return g<=y;case">":return g>y;case">=":return g>=y;case"==":return g===y;case"!=":return g!==y;case"&&":return g&&y;case"||":return g||y}return null},l.exists=function(M){return M!=null}},978:(p,c,l)=>{const M=l(375),g=l(8571),y=l(1687),_=l(9621),O={};p.exports=function(d,f,z={}){if(M(d&&typeof d=="object","Invalid defaults value: must be an object"),M(!f||f===!0||typeof f=="object","Invalid source value: must be true, falsy or an object"),M(typeof z=="object","Invalid options: must be an object"),!f)return null;if(z.shallow)return O.applyToDefaultsWithShallow(d,f,z);const s=g(d);if(f===!0)return s;const h=z.nullOverride!==void 0&&z.nullOverride;return y(s,f,{nullOverride:h,mergeArrays:!1})},O.applyToDefaultsWithShallow=function(d,f,z){const s=z.shallow;M(Array.isArray(s),"Invalid keys");const h=new Map,A=f===!0?null:new Set;for(let L of s){L=Array.isArray(L)?L:L.split(".");const T=_(d,L);T&&typeof T=="object"?h.set(T,A&&_(f,L)||T):A&&A.add(L)}const q=g(d,{},h);if(!A)return q;for(const L of A)O.reachCopy(q,f,L);const v=z.nullOverride!==void 0&&z.nullOverride;return y(q,f,{nullOverride:v,mergeArrays:!1})},O.reachCopy=function(d,f,z){for(const A of z){if(!(A in f))return;const q=f[A];if(typeof q!="object"||q===null)return;f=q}const s=f;let h=d;for(let A=0;A<z.length-1;++A){const q=z[A];typeof h[q]!="object"&&(h[q]={}),h=h[q]}h[z[z.length-1]]=s}},375:(p,c,l)=>{const M=l(4213),g=l(8761),y=p.exports=function(_,...O){if(_)return;if(O.length===1&&O[0]instanceof Error)throw O[0];const d=O.filter(f=>f!=="").map(f=>typeof f=="string"?f:f instanceof Error?f.message:g(f));throw new M(d.join(" "),y)}},4213:p=>{p.exports=class extends Error{constructor(c,l){var M,g,y,_;super(c||"Unknown error"),M=this,y="AssertError",(g=typeof(_=function(O,d){if(typeof O!="object"||!O)return O;var f=O[Symbol.toPrimitive];if(f!==void 0){var z=f.call(O,"string");if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)}(g="name"))=="symbol"?_:String(_))in M?Object.defineProperty(M,g,{value:y,enumerable:!0,configurable:!0,writable:!0}):M[g]=y,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,l)}}},9367:p=>{const c={};p.exports=c.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=c.Bench.now()}elapsed(){return c.Bench.now()-this.ts}static now(){const l=process.hrtime();return 1e3*l[0]+l[1]/1e6}}},8630:(p,c,l)=>{const M=l(738);p.exports=function(){return new Promise(M)}},8571:(p,c,l)=>{const M=l(9621),g=l(4277),y=l(7043),_={needsProtoHack:new Set([g.set,g.map,g.weakSet,g.weakMap])};p.exports=_.clone=function(O,d={},f=null){if(typeof O!="object"||O===null)return O;let z=_.clone,s=f;if(d.shallow){if(d.shallow!==!0)return _.cloneWithShallow(O,d);z=v=>v}else if(s){const v=s.get(O);if(v)return v}else s=new Map;const h=g.getInternalProto(O);switch(h){case g.buffer:return(!1).from(O);case g.date:return new Date(O.getTime());case g.regex:case g.url:return new h.constructor(O)}const A=_.base(O,h,d);if(A===O)return O;if(s&&s.set(O,A),h===g.set)for(const v of O)A.add(z(v,d,s));else if(h===g.map)for(const[v,L]of O)A.set(v,z(L,d,s));const q=y.keys(O,d);for(const v of q){if(v==="__proto__")continue;if(h===g.array&&v==="length"){A.length=O.length;continue}const L=Object.getOwnPropertyDescriptor(O,v);L?L.get||L.set?Object.defineProperty(A,v,L):L.enumerable?A[v]=z(O[v],d,s):Object.defineProperty(A,v,{enumerable:!1,writable:!0,configurable:!0,value:z(O[v],d,s)}):Object.defineProperty(A,v,{enumerable:!0,writable:!0,configurable:!0,value:z(O[v],d,s)})}return A},_.cloneWithShallow=function(O,d){const f=d.shallow;(d=Object.assign({},d)).shallow=!1;const z=new Map;for(const s of f){const h=M(O,s);typeof h!="object"&&typeof h!="function"||z.set(h,h)}return _.clone(O,d,z)},_.base=function(O,d,f){if(f.prototype===!1)return _.needsProtoHack.has(d)?new d.constructor:d===g.array?[]:{};const z=Object.getPrototypeOf(O);if(z&&z.isImmutable)return O;if(d===g.array){const s=[];return z!==d&&Object.setPrototypeOf(s,z),s}if(_.needsProtoHack.has(d)){const s=new z.constructor;return z!==d&&Object.setPrototypeOf(s,z),s}return Object.create(z)}},1467:(p,c,l)=>{const M=l(375),g=l(9474),y=l(6064),_=l(7043),O={};p.exports=function(d,f,z={}){return typeof f!="object"&&(f=[f]),M(!Array.isArray(f)||f.length,"Values array cannot be empty"),typeof d=="string"?O.string(d,f,z):Array.isArray(d)?O.array(d,f,z):(M(typeof d=="object","Reference must be string or an object"),O.object(d,f,z))},O.array=function(d,f,z){if(Array.isArray(f)||(f=[f]),!d.length||z.only&&z.once&&d.length!==f.length)return!1;let s;const h=new Map;for(const L of f)if(z.deep&&L&&typeof L=="object"){var A;s=(A=s)!==null&&A!==void 0?A:O.compare(z);let T=!1;for(const[w,C]of h.entries())if(s(w,L)){++C.allowed,T=!0;break}T||h.set(L,{allowed:1,hits:0})}else{const T=h.get(L);T?++T.allowed:h.set(L,{allowed:1,hits:0})}let q=0;for(const L of d){let T;if(z.deep&&L&&typeof L=="object"){var v;s=(v=s)!==null&&v!==void 0?v:O.compare(z);for(const[w,C]of h.entries())if(s(w,L)){T=C;break}}else T=h.get(L);if(T&&(++T.hits,++q,z.once&&T.hits>T.allowed))return!1}if(z.only&&q!==d.length)return!1;for(const L of h.values())if(L.hits!==L.allowed&&L.hits<L.allowed&&!z.part)return!1;return!!q},O.object=function(d,f,z){M(z.once===void 0,"Cannot use option once with object");const s=_.keys(d,z);if(!s.length)return!1;if(Array.isArray(f))return O.array(s,f,z);const h=Object.getOwnPropertySymbols(f).filter(L=>f.propertyIsEnumerable(L)),A=[...Object.keys(f),...h],q=O.compare(z),v=new Set(A);for(const L of s)if(v.has(L)){if(!q(f[L],d[L]))return!1;v.delete(L)}else if(z.only)return!1;return!v.size||!!z.part&&v.size<A.length},O.string=function(d,f,z){if(d==="")return f.length===1&&f[0]===""||!z.once&&!f.some(L=>L!=="");const s=new Map,h=[];for(const L of f)if(M(typeof L=="string","Cannot compare string reference to non-string value"),L){const T=s.get(L);T?++T.allowed:(s.set(L,{allowed:1,hits:0}),h.push(y(L)))}else if(z.once||z.only)return!1;if(!h.length)return!0;const A=new RegExp(`(${h.join("|")})`,"g"),q=d.replace(A,(L,T)=>(++s.get(T).hits,""));if(z.only&&q)return!1;let v=!1;for(const L of s.values())if(L.hits&&(v=!0),L.hits!==L.allowed&&(L.hits<L.allowed&&!z.part||z.once))return!1;return!!v},O.compare=function(d){if(!d.deep)return O.shallow;const f=d.only!==void 0,z=d.part!==void 0,s={prototype:f?d.only:!!z&&!d.part,part:f?!d.only:!!z&&d.part};return(h,A)=>g(h,A,s)},O.shallow=function(d,f){return d===f}},9474:(p,c,l)=>{const M=l(4277),g={mismatched:null};p.exports=function(y,_,O){return O=Object.assign({prototype:!0},O),!!g.isDeepEqual(y,_,O,[])},g.isDeepEqual=function(y,_,O,d){if(y===_)return y!==0||1/y==1/_;const f=typeof y;if(f!==typeof _||y===null||_===null)return!1;if(f==="function"){if(!O.deepFunction||y.toString()!==_.toString())return!1}else if(f!=="object")return y!=y&&_!=_;const z=g.getSharedType(y,_,!!O.prototype);switch(z){case M.buffer:return!1;case M.promise:return y===_;case M.regex:case M.url:return y.toString()===_.toString();case g.mismatched:return!1}for(let s=d.length-1;s>=0;--s)if(d[s].isSame(y,_))return!0;d.push(new g.SeenEntry(y,_));try{return!!g.isDeepEqualObj(z,y,_,O,d)}finally{d.pop()}},g.getSharedType=function(y,_,O){if(O)return Object.getPrototypeOf(y)!==Object.getPrototypeOf(_)?g.mismatched:M.getInternalProto(y);const d=M.getInternalProto(y);return d!==M.getInternalProto(_)?g.mismatched:d},g.valueOf=function(y){const _=y.valueOf;if(_===void 0)return y;try{return _.call(y)}catch(O){return O}},g.hasOwnEnumerableProperty=function(y,_){return Object.prototype.propertyIsEnumerable.call(y,_)},g.isSetSimpleEqual=function(y,_){for(const O of Set.prototype.values.call(y))if(!Set.prototype.has.call(_,O))return!1;return!0},g.isDeepEqualObj=function(y,_,O,d,f){const{isDeepEqual:z,valueOf:s,hasOwnEnumerableProperty:h}=g,{keys:A,getOwnPropertySymbols:q}=Object;if(y===M.array){if(!d.part){if(_.length!==O.length)return!1;for(let R=0;R<_.length;++R)if(!z(_[R],O[R],d,f))return!1;return!0}for(const R of _)for(const S of O)if(z(R,S,d,f))return!0}else if(y===M.set){if(_.size!==O.size)return!1;if(!g.isSetSimpleEqual(_,O)){const R=new Set(Set.prototype.values.call(O));for(const S of Set.prototype.values.call(_)){if(R.delete(S))continue;let E=!1;for(const G of R)if(z(S,G,d,f)){R.delete(G),E=!0;break}if(!E)return!1}}}else if(y===M.map){if(_.size!==O.size)return!1;for(const[R,S]of Map.prototype.entries.call(_))if(S===void 0&&!Map.prototype.has.call(O,R)||!z(S,Map.prototype.get.call(O,R),d,f))return!1}else if(y===M.error&&(_.name!==O.name||_.message!==O.message))return!1;const v=s(_),L=s(O);if((_!==v||O!==L)&&!z(v,L,d,f))return!1;const T=A(_);if(!d.part&&T.length!==A(O).length&&!d.skip)return!1;let w=0;for(const R of T)if(d.skip&&d.skip.includes(R))O[R]===void 0&&++w;else if(!h(O,R)||!z(_[R],O[R],d,f))return!1;if(!d.part&&T.length-w!==A(O).length)return!1;if(d.symbols!==!1){const R=q(_),S=new Set(q(O));for(const E of R){var C;if((C=d.skip)===null||C===void 0||!C.includes(E)){if(h(_,E)){if(!h(O,E)||!z(_[E],O[E],d,f))return!1}else if(h(O,E))return!1}S.delete(E)}for(const E of S)if(h(O,E))return!1}return!0},g.SeenEntry=class{constructor(y,_){this.obj=y,this.ref=_}isSame(y,_){return this.obj===y&&this.ref===_}}},4168:(p,c,l)=>{const M=l(375);p.exports=function(g){return M(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(g),"Bad attribute value ("+g+")"),g.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}},5277:p=>{const c={};p.exports=function(l){if(!l)return"";let M="";for(let g=0;g<l.length;++g){const y=l.charCodeAt(g);c.isSafe(y)?M+=l[g]:M+=c.escapeHtmlChar(y)}return M},c.escapeHtmlChar=function(l){return c.namedHtml.get(l)||(l>=256?"&#"+l+";":`&#x${l.toString(16).padStart(2,"0")};`)},c.isSafe=function(l){return c.safeCharCodes.has(l)},c.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),c.safeCharCodes=function(){const l=new Set;for(let M=32;M<123;++M)(M>=97||M>=65&&M<=90||M>=48&&M<=57||M===32||M===46||M===44||M===45||M===58||M===95)&&l.add(M);return l}()},7973:p=>{const c={};p.exports=function(l){return l?l.replace(/[<>&\u2028\u2029]/g,c.escape):""},c.escape=function(l){return c.replacements.get(l)},c.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])},6064:p=>{p.exports=function(c){return c.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},655:p=>{const c={};p.exports=c.flatten=function(l,M){const g=M||[];for(const y of l)Array.isArray(y)?c.flatten(y,g):g.push(y);return g}},738:p=>{p.exports=function(){}},8870:(p,c,l)=>{c.applyToDefaults=l(978),c.assert=l(375),c.AssertError=l(4213),c.Bench=l(9367),c.block=l(8630),c.clone=l(8571),c.contain=l(1467),c.deepEqual=l(9474),c.escapeHeaderAttribute=l(4168),c.escapeHtml=l(5277),c.escapeJson=l(7973),c.escapeRegex=l(6064),c.flatten=l(655),c.ignore=l(738),c.intersect=l(5088),c.isPromise=l(7259),c.merge=l(1687),c.once=l(5022),c.reach=l(9621),c.reachTemplate=l(4069),c.stringify=l(8761),c.wait=l(2620)},5088:p=>{const c={};p.exports=function(l,M,g={}){if(!l||!M)return g.first?null:[];const y=[],_=Array.isArray(l)?new Set(l):l,O=new Set;for(const d of M)if(c.has(_,d)&&!O.has(d)){if(g.first)return d;y.push(d),O.add(d)}return g.first?null:y},c.has=function(l,M){return typeof l.has=="function"?l.has(M):l[M]!==void 0}},7259:p=>{p.exports=function(c){return typeof c?.then=="function"}},1687:(p,c,l)=>{const M=l(375),g=l(8571),y=l(7043),_={};p.exports=_.merge=function(O,d,f){if(M(O&&typeof O=="object","Invalid target value: must be an object"),M(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return O;if(f=Object.assign({nullOverride:!0,mergeArrays:!0},f),Array.isArray(d)){M(Array.isArray(O),"Cannot merge array onto an object"),f.mergeArrays||(O.length=0);for(let s=0;s<d.length;++s)O.push(g(d[s],{symbols:f.symbols}));return O}const z=y.keys(d,f);for(let s=0;s<z.length;++s){const h=z[s];if(h==="__proto__"||!Object.prototype.propertyIsEnumerable.call(d,h))continue;const A=d[h];if(A&&typeof A=="object"){if(O[h]===A)continue;!O[h]||typeof O[h]!="object"||Array.isArray(O[h])!==Array.isArray(A)||A instanceof Date||A instanceof RegExp?O[h]=g(A,{symbols:f.symbols}):_.merge(O[h],A,f)}else(A!=null||f.nullOverride)&&(O[h]=A)}return O}},5022:p=>{const c=Symbol("wrapped");p.exports=function(l){if(l[c])return l;let M=!1;const g=function(...y){M||(M=!0,l(...y))};return g[c]=!0,g}},9621:(p,c,l)=>{const M=l(375),g={};p.exports=function(y,_,O){if(_===!1||_==null)return y;typeof(O=O||{})=="string"&&(O={separator:O});const d=Array.isArray(_);M(!d||!O.separator,"Separator option is not valid for array-based chain");const f=d?_:_.split(O.separator||".");let z=y;for(let s=0;s<f.length;++s){let h=f[s];const A=O.iterables&&g.iterables(z);if(Array.isArray(z)||A==="set"){const q=Number(h);Number.isInteger(q)&&(h=q<0?z.length+q:q)}if(!z||typeof z=="function"&&O.functions===!1||!A&&z[h]===void 0){M(!O.strict||s+1===f.length,"Missing segment",h,"in reach path ",_),M(typeof z=="object"||O.functions===!0||typeof z!="function","Invalid segment",h,"in reach path ",_),z=O.default;break}z=A?A==="set"?[...z][h]:z.get(h):z[h]}return z},g.iterables=function(y){return y instanceof Set?"set":y instanceof Map?"map":void 0}},4069:(p,c,l)=>{const M=l(9621);p.exports=function(g,y,_){return y.replace(/{([^{}]+)}/g,(O,d)=>{const f=M(g,d,_);return f??""})}},8761:p=>{p.exports=function(...c){try{return JSON.stringify(...c)}catch(l){return"[Cannot display object: "+l.message+"]"}}},4277:(p,c)=>{const l={};c=p.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,url:URL.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},l.typeMap=new Map([["[object Error]",c.error],["[object Map]",c.map],["[object Promise]",c.promise],["[object Set]",c.set],["[object URL]",c.url],["[object WeakMap]",c.weakMap],["[object WeakSet]",c.weakSet]]),c.getInternalProto=function(M){if(Array.isArray(M))return c.array;if(M instanceof Date)return c.date;if(M instanceof RegExp)return c.regex;if(M instanceof Error)return c.error;const g=Object.prototype.toString.call(M);return l.typeMap.get(g)||c.generic}},7043:(p,c)=>{c.keys=function(l,M={}){return M.symbols!==!1?Reflect.ownKeys(l):Object.getOwnPropertyNames(l)}},2620:p=>{p.exports=function(c,l,M){if(typeof c=="bigint"&&(c=Number(c)),c>=Number.MAX_SAFE_INTEGER&&(c=1/0),typeof c!="number"&&c!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(g=>{const y=M?M.setTimeout:setTimeout,_=()=>{const O=Math.min(c,2147483647);c-=O,y(()=>c>0?_():g(l),O)};c!==1/0&&_()})}},7593:(p,c)=>{c.location=function(l=0){const M=Error.prepareStackTrace;Error.prepareStackTrace=(_,O)=>O;const g={};Error.captureStackTrace(g,this);const y=g.stack[l+1];return Error.prepareStackTrace=M,{filename:y.getFileName(),line:y.getLineNumber()}}},6264:(p,c,l)=>{l.r(c),l.d(c,{tlds:()=>M});const M=new Set(["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].map(g=>g.toLowerCase()))},3652:(p,c,l)=>{const{assert:M}=l(8870),g={};c.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(y,_){var O,d,f,z,s;_=(O=_)!==null&&O!==void 0?O:{};const h=[].concat((d=_.before)!==null&&d!==void 0?d:[]),A=[].concat((f=_.after)!==null&&f!==void 0?f:[]),q=(z=_.group)!==null&&z!==void 0?z:"?",v=(s=_.sort)!==null&&s!==void 0?s:0;M(!h.includes(q),`Item cannot come before itself: ${q}`),M(!h.includes("?"),"Item cannot come before unassociated items"),M(!A.includes(q),`Item cannot come after itself: ${q}`),M(!A.includes("?"),"Item cannot come after unassociated items"),Array.isArray(y)||(y=[y]);for(const L of y){const T={seq:this._items.length,sort:v,before:h,after:A,group:q,node:L};this._items.push(T)}if(!_.manual){const L=this._sort();M(L,"item",q!=="?"?`added into group ${q}`:"","created a dependencies error")}return this.nodes}merge(y){Array.isArray(y)||(y=[y]);for(const O of y)if(O)for(const d of O._items)this._items.push(Object.assign({},d));this._items.sort(g.mergeSort);for(let O=0;O<this._items.length;++O)this._items[O].seq=O;const _=this._sort();return M(_,"merge created a dependencies error"),this.nodes}sort(){const y=this._sort();return M(y,"sort created a dependencies error"),this.nodes}_sort(){const y={},_=Object.create(null),O=Object.create(null);for(const L of this._items){var d;const T=L.seq,w=L.group;O[w]=(d=O[w])!==null&&d!==void 0?d:[],O[w].push(T),y[T]=L.before;for(const C of L.after){var f;_[C]=(f=_[C])!==null&&f!==void 0?f:[],_[C].push(T)}}for(const L in y){const T=[];for(const w in y[L]){var z;const C=y[L][w];O[C]=(z=O[C])!==null&&z!==void 0?z:[],T.push(...O[C])}y[L]=T}for(const L in _)if(O[L])for(const T of O[L])y[T].push(..._[L]);const s={};for(const L in y){const T=y[L];for(const w of T){var h;s[w]=(h=s[w])!==null&&h!==void 0?h:[],s[w].push(L)}}const A={},q=[];for(let L=0;L<this._items.length;++L){let T=L;if(s[L]){T=null;for(let w=0;w<this._items.length;++w){if(A[w]===!0)continue;s[w]||(s[w]=[]);const C=s[w].length;let R=0;for(let S=0;S<C;++S)A[s[w][S]]&&++R;if(R===C){T=w;break}}}T!==null&&(A[T]=!0,q.push(T))}if(q.length!==this._items.length)return!1;const v={};for(const L of this._items)v[L.seq]=L;this._items=[],this.nodes=[];for(const L of q){const T=v[L];this.nodes.push(T.node),this._items.push(T)}return!0}},g.mergeSort=(y,_)=>y.sort===_.sort?0:y.sort<_.sort?-1:1},1275:()=>{},3975:()=>{},5934:p=>{p.exports=JSON.parse('{"version":"17.11.0"}')}},n={};function a(p){var c=n[p];if(c!==void 0)return c.exports;var l=n[p]={exports:{}};return o[p](l,l.exports,a),l.exports}return a.n=p=>{var c=p&&p.__esModule?()=>p.default:()=>p;return a.d(c,{a:c}),c},a.d=(p,c)=>{for(var l in c)a.o(c,l)&&!a.o(p,l)&&Object.defineProperty(p,l,{enumerable:!0,get:c[l]})},a.o=(p,c)=>Object.prototype.hasOwnProperty.call(p,c),a.r=p=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})},a(5107)})())})(Ju);var eA=Ju.exports;const u=CM(eA);var oo={},tA={},Ya={},es={},R1={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ALL_FRONTEND_FEATURES=Jt.supportedAggregatesConstants=Jt.timeDimensionsConstants=Jt.supportedOperatorsConstants=void 0;Jt.supportedOperatorsConstants={">":{publicName:"Greater than",validDataTypes:["number","date_time"]},"<":{publicName:"Less than",validDataTypes:["number","date_time"]},"<=":{publicName:"Less than or equal to",validDataTypes:["number","date_time"]},">=":{publicName:"Greater than or equal to",validDataTypes:["number","date_time"]},"!=":{publicName:"Not equal to",validDataTypes:["number","date_time","boolean","string"]},is_one_of:{publicName:"Is one of",validDataTypes:["number","date_time","boolean","string"]},"=":{publicName:"Equal to",validDataTypes:["number","date_time","boolean","string"]},is_not_one_of:{publicName:"Is not one of",validDataTypes:["number","date_time","boolean","string"]},starts_with:{publicName:"Starts with",validDataTypes:["string"]},ends_with:{publicName:"Ends with",validDataTypes:["string"]},contains_substring:{publicName:"Contains text",validDataTypes:["string"]},does_not_contain_substring:{publicName:"Does not contain text",validDataTypes:["string"]},array_contains:{publicName:"Contains",validDataTypes:["string[]"]},array_does_not_contain:{publicName:"Does not contain",validDataTypes:["string[]"]},array_contains_any_of:{publicName:"Contains any of",validDataTypes:["string[]"]},array_contains_all_of:{publicName:"Contains all of",validDataTypes:["string[]"]}};Jt.timeDimensionsConstants={month:{publicName:"Monthly",dateFormat:"MMMM YYYY",dataTypeOutput:"date_time"},year:{publicName:"Yearly",dateFormat:"YYYY",dataTypeOutput:"date_time"},quarter:{publicName:"Per quarter",dateFormat:"quarter",dataTypeOutput:"date_time"},week:{publicName:"Weekly",dateFormat:"week",dataTypeOutput:"date_time"},day:{publicName:"Daily",dateFormat:"DD-MM-YYYY",dataTypeOutput:"date_time"},hourOfDayOnly:{publicName:"Hour of day",dateFormat:"hour_of_day",dataTypeOutput:"date_time"},weekOfYearOnly:{publicName:"Week of year",dateFormat:"week_of_year",dataTypeOutput:"number"},dayOfWeekOnly:{publicName:"Day of week",dateFormat:"day_of_week_iso",dataTypeOutput:"number"},monthOfYearOnly:{publicName:"Month of year",dateFormat:"month_of_year",dataTypeOutput:"number"},dayOfMonthOnly:{publicName:"Day of month",dateFormat:"day_of_month",dataTypeOutput:"number"},second:{publicName:"Per second",dateFormat:"hh:mm:ss",dataTypeOutput:"date_time"},hour:{publicName:"Hourly",dateFormat:"hh:mm",dataTypeOutput:"date_time"},minute:{publicName:"Per minute",dateFormat:"hh:mm",dataTypeOutput:"date_time"}};Jt.supportedAggregatesConstants={mean:{publicName:"Mean",validDataTypes:["number"]},sum:{publicName:"Sum",validDataTypes:["number"]},min:{publicName:"Min",validDataTypes:["number","date_time"]},max:{publicName:"Max",validDataTypes:["number","date_time"]},count:{publicName:"Count",validDataTypes:["string","number","boolean","date_time","string[]"]},countDistinct:{publicName:"Unique",validDataTypes:["string","number","boolean","date_time"]},median:{publicName:"Median",validDataTypes:["number"]},percentile25:{publicName:"25th percentile",validDataTypes:["number"]},percentile75:{publicName:"75th percentile",validDataTypes:["number"]},percentile90:{publicName:"90th percentile",validDataTypes:["number"]},percentile95:{publicName:"95th percentile",validDataTypes:["number"]},percentile99:{publicName:"99th percentile",validDataTypes:["number"]}};Jt.ALL_FRONTEND_FEATURES=["formatter:monthOfYearOnly"];Object.defineProperty(R1,"__esModule",{value:!0});R1.validOperatorsForField=R1.ALL_SUPPORTED_CONSTANTS=R1.isSupportedTimeTruncFunction=R1.isSupportedAggregate=R1.isSupportedAggregateFunction=R1.supportedAggregates=R1.supportedTimeTruncFunctions=R1.supportedOperators=R1.supportedAggregatesFunction=R1.supportedTransformationFunctions=void 0;const ts=_0,g2=Jt,eg={round_to_0_dp:{publicName:"Round to 0dp",validDataTypes:["number"]},round_to_2_dp:{publicName:"Round to 2dp",validDataTypes:["number"]}},tg=t=>{const e=(0,ts.cloneDeep)(eg);if(!t)return e;let o={};return t.forEach(n=>{if(!e[n])throw`Transformation function ${n} is not managed by Vizzly`;o[n]=e[n]}),o};R1.supportedTransformationFunctions=tg;const og=(t,e,o)=>{const n=t.supportedAggregates,a=Object.keys(n).filter(c=>n[c].validDataTypes.includes(e));let p=o&&o.length>0?o.filter(c=>a.includes(c)):a;return o&&o.length>0&&p.length===0&&(p=a),p};R1.supportedAggregatesFunction=og;const ig=t=>{const e=(0,ts.cloneDeep)(g2.supportedOperatorsConstants);if(!t)return e;let o={};return t.forEach(n=>{if(!g2.supportedOperatorsConstants[n])throw`Operator ${n} not managed by Vizzly`;o[n]=g2.supportedOperatorsConstants[n]}),o};R1.supportedOperators=ig;const ng=t=>{const e=(0,ts.cloneDeep)(g2.timeDimensionsConstants);if(!t)return e;let o={};return t.forEach(n=>{if(!e[n])throw`Time trunc function ${n} not managed by Vizzly`;o[n]=e[n]}),o};R1.supportedTimeTruncFunctions=ng;const rg=t=>{const e=(0,ts.cloneDeep)(g2.supportedAggregatesConstants);if(!t)return e;let o={};return t.forEach(n=>{if(!e[n])throw`Aggregate ${n} not managed by Vizzly`;o[n]=e[n]}),o};R1.supportedAggregates=rg;const ag=(t,e)=>[...Object.keys(t),"none"].includes(e);R1.isSupportedAggregateFunction=ag;const pg=(t,e)=>typeof t!="string"?!1:e.hasOwnProperty(t);R1.isSupportedAggregate=pg;const bg=(t,e)=>[...Object.keys(t),"none"].includes(e);R1.isSupportedTimeTruncFunction=bg;R1.ALL_SUPPORTED_CONSTANTS=[{namespace:"config.supported_operator",constants:g2.supportedOperatorsConstants},{namespace:"config.supported_aggregate",constants:g2.supportedAggregatesConstants},{namespace:"config.supported_time",constants:g2.timeDimensionsConstants}];const Mg=(t,e)=>{let o=[...Object.keys(e.supportedOperators)];return o=o.filter(n=>g2.supportedOperatorsConstants[n].validDataTypes.includes(t.dataType)),o};R1.validOperatorsForField=Mg;Object.defineProperty(es,"__esModule",{value:!0});es.queryEngineConfig=void 0;const Hb=R1,sg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Hb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second","dayOfMonthOnly","dayOfWeekOnly","weekOfYearOnly","monthOfYearOnly"]),supportedAggregates:(0,Hb.supportedAggregates)(["sum","mean","median","min","max","count","countDistinct","percentile25","percentile75","percentile90","percentile95","percentile99"]),supportedOperators:(0,Hb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,Hb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});es.queryEngineConfig=sg;var os={};Object.defineProperty(os,"__esModule",{value:!0});os.queryEngineConfig=void 0;const Yb=R1,cg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Yb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:(0,Yb.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,Yb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,Yb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});os.queryEngineConfig=cg;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.queryEngineConfig=void 0;const Kb=R1,zg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Kb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second","dayOfMonthOnly","weekOfYearOnly","monthOfYearOnly"]),supportedAggregates:(0,Kb.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,Kb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,Kb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});is.queryEngineConfig=zg;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.queryEngineConfig=void 0;const Qb=R1,Og=()=>{var t;return typeof process>"u"?!1:((t=process.env.VIZZLY_MICROSOFT_FLAVOR)===null||t===void 0?void 0:t.toUpperCase())==="KUSTO"},lg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Qb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute",...Og()?[]:["second"]]),supportedAggregates:(0,Qb.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,Qb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,Qb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});ns.queryEngineConfig=lg;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});rs.queryEngineConfig=void 0;const Zb=R1,ug=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","switchField","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Zb.supportedTimeTruncFunctions)(["month","year","day","hour","minute","second"]),supportedAggregates:(0,Zb.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,Zb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:(0,Zb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});rs.queryEngineConfig=ug;var as={};Object.defineProperty(as,"__esModule",{value:!0});as.queryEngineConfig=void 0;const Jb=R1,Ag=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,Jb.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second","dayOfMonthOnly","dayOfWeekOnly","weekOfYearOnly","hourOfDayOnly","monthOfYearOnly"]),supportedAggregates:(0,Jb.supportedAggregates)(["sum","mean","median","min","max","count","countDistinct","percentile25","percentile75","percentile90","percentile95","percentile99"]),supportedOperators:(0,Jb.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain","array_contains_any_of","array_contains_all_of"]),supportedTransformationFunctions:(0,Jb.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});as.queryEngineConfig=Ag;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.queryEngineConfig=void 0;const eM=R1,dg=()=>({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards","sqlViews","dateMaths"],supportedTimeTruncFunctions:(0,eM.supportedTimeTruncFunctions)(["month","year","day","hour","minute","second"]),supportedAggregates:(0,eM.supportedAggregates)(["sum","mean","min","max","count","countDistinct"]),supportedOperators:(0,eM.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:(0,eM.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])});ps.queryEngineConfig=dg;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.localQueryEngineConfig=void 0;const tM=R1;bs.localQueryEngineConfig={origin:"in-browser",supportedFeatures:["simpleMaths","aggregateMaths","subquery","encryptedDashboards","switchField","roundedNumbers","encryptedDashboards","dateMaths"],supportedTimeTruncFunctions:(0,tM.supportedTimeTruncFunctions)(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:(0,tM.supportedAggregates)(["sum","mean","min","max","count","countDistinct","median"]),supportedOperators:(0,tM.supportedOperators)([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains","array_does_not_contain"]),supportedTransformationFunctions:(0,tM.supportedTransformationFunctions)(["round_to_0_dp","round_to_2_dp"])};var fg=z0&&z0.__createBinding||(Object.create?function(t,e,o,n){n===void 0&&(n=o);var a=Object.getOwnPropertyDescriptor(e,o);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,a)}:function(t,e,o,n){n===void 0&&(n=o),t[n]=e[o]}),qg=z0&&z0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ji=z0&&z0.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(o){var n=[];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[n.length]=a);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var o={};if(e!=null)for(var n=t(e),a=0;a<n.length;a++)n[a]!=="default"&&fg(o,e,n[a]);return qg(o,e),o}}();Object.defineProperty(Ya,"__esModule",{value:!0});Ya.getQueryEngineConfig=void 0;const hg=ji(es),Wg=ji(os),mg=ji(is),gg=ji(ns),yg=ji(rs),Rg=ji(as),vg=ji(ps),Lg=bs,_g=t=>{switch(t){case"js":return Lg.localQueryEngineConfig;case"postgres":return hg.queryEngineConfig();case"redshift":return Wg.queryEngineConfig();case"bigquery":return mg.queryEngineConfig();case"mariadb":return yg.queryEngineConfig();case"snowflake":return Rg.queryEngineConfig();case"mysql":return vg.queryEngineConfig();case"microsoftSQLServer":return gg.queryEngineConfig();case"SQLite":throw"SQLite not support via the query engine"}};Ya.getQueryEngineConfig=_g;var Ms={};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.merge=void 0;const Uz=_0,Ng=(...t)=>t.reduce((e,o)=>{const n=a=>{let p=e[a],c=o[a];if(typeof p=="object"&&typeof c=="object"){const l=(0,Uz.intersection)(Object.keys(p),Object.keys(c));return(0,Uz.pick)(o[a],l)}throw"Cannot intersect non-object type in mapIntersection function."};return{origin:"query-engine",supportedAggregates:n("supportedAggregates"),supportedFeatures:(0,Uz.intersection)(e.supportedFeatures,o.supportedFeatures),supportedOperators:n("supportedOperators"),supportedTimeTruncFunctions:n("supportedTimeTruncFunctions"),supportedTransformationFunctions:n("supportedTransformationFunctions")}},t[0]);Ms.merge=Ng;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.removeUnsupportedFeatures=void 0;const Tg=_0,xg=(t,e)=>{const o=(0,Tg.cloneDeep)(t);return e.includes("formatter:monthOfYearOnly")||delete o.supportedTimeTruncFunctions.monthOfYearOnly,o};ss.removeUnsupportedFeatures=xg;(function(t){var e=z0&&z0.__createBinding||(Object.create?function(p,c,l,M){M===void 0&&(M=l);var g=Object.getOwnPropertyDescriptor(c,l);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(p,M,g)}:function(p,c,l,M){M===void 0&&(M=l),p[M]=c[l]}),o=z0&&z0.__setModuleDefault||(Object.create?function(p,c){Object.defineProperty(p,"default",{enumerable:!0,value:c})}:function(p,c){p.default=c}),n=z0&&z0.__exportStar||function(p,c){for(var l in p)l!=="default"&&!Object.prototype.hasOwnProperty.call(c,l)&&e(c,p,l)},a=z0&&z0.__importStar||function(){var p=function(c){return p=Object.getOwnPropertyNames||function(l){var M=[];for(var g in l)Object.prototype.hasOwnProperty.call(l,g)&&(M[M.length]=g);return M},p(c)};return function(c){if(c&&c.__esModule)return c;var l={};if(c!=null)for(var M=p(c),g=0;g<M.length;g++)M[g]!=="default"&&e(l,c,M[g]);return o(l,c),l}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Support=t.Constants=void 0,n(Ya,t),n(Ms,t),t.Constants=a(Jt),t.Support=a(R1),n(ss,t)})(tA);var oA={},iA={},$o={},nA={},ha={},CO={};Object.defineProperty(CO,"__esModule",{value:!0});CO.default={JSONB:{normalizedType:"string"},UUID:{normalizedType:"string"},DECIMAL:{normalizedType:"number"},NUMERIC:{normalizedType:"number"},INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},DOUBLEPRECISION:{normalizedType:"number",castAs:"DOUBLE PRECISION"},"DOUBLE PRECISION":{normalizedType:"number"},REAL:{normalizedType:"number"},FLOAT:{normalizedType:"number"},NUMBER:{normalizedType:"number"},BINARY:{normalizedType:"string"},VARBINARY:{normalizedType:"string"},CHAR:{normalizedType:"string"},CHARACTER:{normalizedType:"string"},"CHARACTER VARYING":{normalizedType:"string"},TEXT:{normalizedType:"string"},VARCHAR:{normalizedType:"string"},TIME:{normalizedType:"date_time"},DATE:{normalizedType:"date_time"},TIMESTAMP_LTZ:{normalizedType:"date_time"},TIMESTAMP_NTZ:{normalizedType:"date_time"},TIMESTAMP_TZ:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"},BOOLEAN:{normalizedType:"boolean"},"TIMESTAMP WITH TIME ZONE":{normalizedType:"date_time"},"TIMESTAMP WITHOUT TIME ZONE":{normalizedType:"date_time"},ARRAY:{normalizedType:"string[]"}};var Sg=z0&&z0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ha,"__esModule",{value:!0});ha.NATIVE_DATA_TYPES_DATABASE=void 0;const Bg=Sg(CO);ha.NATIVE_DATA_TYPES_DATABASE={microsoftSQLServer:{INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},NUMERIC:{normalizedType:"number"},BIT:{normalizedType:"number"},SMALLINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},DECIMAL:{normalizedType:"number"},SMALLMONEY:{normalizedType:"number"},TINYINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},MONEY:{normalizedType:"number"},FLOAT:{normalizedType:"number"},REAL:{normalizedType:"number"},DATE:{normalizedType:"date_time"},DATETIME2:{normalizedType:"date_time"},SMALLDATETIME:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIME:{normalizedType:"date_time"},UNIQUEIDENTIFIER:{normalizedType:"string"},CHAR:{normalizedType:"string"},VARCHAR:{normalizedType:"string"},TEXT:{normalizedType:"string",castAs:"VARCHAR(8000)"},NCHAR:{normalizedType:"string"},NVARCHAR:{normalizedType:"string"},NTEXT:{normalizedType:"string"},BINARY:{normalizedType:"string"},VARBINARY:{normalizedType:"string"}},bigquery:{INT64:{normalizedType:"number",numberCanOnlyBeInteger:!0},FLOAT64:{normalizedType:"number"},NUMERIC:{normalizedType:"number"},BIGNUMERIC:{normalizedType:"number"},STRING:{normalizedType:"string"},DATE:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"},BOOL:{normalizedType:"boolean"},"ARRAY<STRING>":{normalizedType:"string[]"}},elasticsearch:{date_time:{normalizedType:"date_time"},number:{normalizedType:"number"},string:{normalizedType:"string"},boolean:{normalizedType:"boolean"}},mariadb:{TINYINT:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},MEDIUMINT:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",castAs:"INT",numberCanOnlyBeInteger:!0},DECIMAL:{normalizedType:"number"},FLOAT:{normalizedType:"number"},DOUBLE:{normalizedType:"number"},VARCHAR:{normalizedType:"string",castAs:"CHAR"},TEXT:{normalizedType:"string",castAs:"CHAR"},TINYTEXT:{normalizedType:"string",castAs:"CHAR"},CHAR:{normalizedType:"string"},MEDIUMTEXT:{normalizedType:"string",castAs:"CHAR"},LONGTEXT:{normalizedType:"string",castAs:"CHAR"},DATE:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time",castAs:"DATETIME"},BOOLEAN:{normalizedType:"boolean",castAs:null},BOOL:{normalizedType:"boolean",castAs:null}},postgres:Bg.default,SQLite:{BOOLEAN:{normalizedType:"boolean"},NULL:{normalizedType:"string"},INTEGER:{normalizedType:"number",numberCanOnlyBeInteger:!0},REAL:{normalizedType:"number"},DECIMAL:{normalizedType:"number"},CHAR:{normalizedType:"string"},TEXT:{normalizedType:"string"},DATE:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"}},snowflake:{FIXED:{normalizedType:"number"},DECIMAL:{normalizedType:"number"},NUMERIC:{normalizedType:"number"},INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},TINYINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},BYTEINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},FLOAT:{normalizedType:"number"},FLOAT4:{normalizedType:"number"},FLOAT8:{normalizedType:"number"},DOUBLE:{normalizedType:"number"},DOUBLEPRECISION:{normalizedType:"number",castAs:"DOUBLE PRECISION"},"DOUBLE PRECISION":{normalizedType:"number"},REAL:{normalizedType:"number"},NUMBER:{normalizedType:"number"},BINARY:{normalizedType:"string"},VARBINARY:{normalizedType:"string"},CHAR:{normalizedType:"string"},CHARACTER:{normalizedType:"string"},"CHARACTER VARYING":{normalizedType:"string"},TEXT:{normalizedType:"string"},VARCHAR:{normalizedType:"string"},STRING:{normalizedType:"string"},TIME:{normalizedType:"date_time"},DATE:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIMESTAMP_LTZ:{normalizedType:"date_time"},TIMESTAMP_NTZ:{normalizedType:"date_time"},TIMESTAMP_TZ:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"},BOOLEAN:{normalizedType:"boolean"},ARRAY:{normalizedType:"string[]"},VARIANT:{normalizedType:"string"}},mysql:{TINYINT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},MEDIUMINT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},INT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",castAs:"SIGNED",numberCanOnlyBeInteger:!0},DECIMAL:{normalizedType:"number",castAs:"DECIMAL(65, 10)"},FLOAT:{normalizedType:"number",castAs:"DECIMAL(65, 10)"},DOUBLE:{normalizedType:"number",castAs:"DECIMAL(65, 10)"},CHAR:{normalizedType:"string",castAs:"CHAR"},VARCHAR:{normalizedType:"string",castAs:"CHAR"},TEXT:{normalizedType:"string",castAs:"CHAR"},TINYTEXT:{normalizedType:"string",castAs:"CHAR"},MEDIUMTEXT:{normalizedType:"string",castAs:"CHAR"},LONGTEXT:{normalizedType:"string",castAs:"CHAR"},DATE:{normalizedType:"date_time"},DATETIME:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time",castAs:"DATETIME"},BOOLEAN:{normalizedType:"boolean"},BOOL:{normalizedType:"boolean"}},redshift:{SUPER:{normalizedType:"string[]"},UUID:{normalizedType:"string"},DECIMAL:{normalizedType:"number"},NUMERIC:{normalizedType:"number"},INT:{normalizedType:"number",numberCanOnlyBeInteger:!0},INTEGER:{normalizedType:"number",numberCanOnlyBeInteger:!0},BIGINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},SMALLINT:{normalizedType:"number",numberCanOnlyBeInteger:!0},DOUBLEPRECISION:{normalizedType:"number",castAs:"DOUBLE PRECISION"},"DOUBLE PRECISION":{normalizedType:"number"},REAL:{normalizedType:"number"},FLOAT:{normalizedType:"number"},NUMBER:{normalizedType:"number"},BINARY:{normalizedType:"string"},VARBINARY:{normalizedType:"string"},CHAR:{normalizedType:"string"},CHARACTER:{normalizedType:"string"},"CHARACTER VARYING":{normalizedType:"string"},TEXT:{normalizedType:"string"},VARCHAR:{normalizedType:"string"},TIME:{normalizedType:"date_time"},DATE:{normalizedType:"date_time"},TIMESTAMP_LTZ:{normalizedType:"date_time"},TIMESTAMP_NTZ:{normalizedType:"date_time"},TIMESTAMP_TZ:{normalizedType:"date_time"},TIMESTAMP:{normalizedType:"date_time"},BOOLEAN:{normalizedType:"boolean"},"TIMESTAMP WITH TIME ZONE":{normalizedType:"date_time"},"TIMESTAMP WITHOUT TIME ZONE":{normalizedType:"date_time"},ARRAY:{normalizedType:"string[]"}}};var rA={},aA={};Object.defineProperty(aA,"__esModule",{value:!0});var pA={};Object.defineProperty(pA,"__esModule",{value:!0});var bA={};Object.defineProperty(bA,"__esModule",{value:!0});(function(t){var e=z0&&z0.__createBinding||(Object.create?function(n,a,p,c){c===void 0&&(c=p);var l=Object.getOwnPropertyDescriptor(a,p);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[p]}}),Object.defineProperty(n,c,l)}:function(n,a,p,c){c===void 0&&(c=p),n[c]=a[p]}),o=z0&&z0.__exportStar||function(n,a){for(var p in n)p!=="default"&&!Object.prototype.hasOwnProperty.call(a,p)&&e(a,n,p)};Object.defineProperty(t,"__esModule",{value:!0}),o(aA,t),o(pA,t),o(bA,t)})(rA);var ir={},cs={};Object.defineProperty(cs,"__esModule",{value:!0});class wg extends Error{constructor(e){super(`Field with ID ${e} does not exist in the data set.`),this.name="MissingField",this.fieldId=e}}cs.default=wg;var Cg=z0&&z0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ir,"__esModule",{value:!0});ir.findFieldById=ir.fromTable=void 0;const Xg=Cg(cs),Eg=_0,Dg=t=>{let e=(0,Eg.find)(t.fields||[],n=>"address"in n);return(t.joins||[]).length==0?e.address:t.joins[0].left};ir.fromTable=Dg;const Ig=(t,e)=>{const o=t.fields.find(n=>n.id==e);if(!o)throw new Xg.default(e);return o};ir.findFieldById=Ig;var MA={},zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.upCastQuery=void 0;const XO=_0,Wa=t=>(0,XO.isArray)(t)?{type:"orWhere",value:t.map(e=>({type:"andWhere",value:e.map(o=>(o.field.type==="subquery"&&(o.field.value.filter=Wa(o.field.value.filter)),{type:"where",value:o}))}))}:t,sM=t=>{if(t.type==="subquery"){const e=(0,XO.isArray)(t.value.filter)?Wa(t.value.filter):t.value.filter;return Object.assign(Object.assign({},t),{value:{measure:t.value.measure.map(sM),filter:e}})}else{if(t.type==="maths")return{left:sM(t.left),right:sM(t.right),op:t.op,type:t.type};if(!("type"in t))return{type:"field",value:t.field,function:t?.function||"none"}}return t},Pg=t=>Object.assign(Object.assign({},t),{measure:t.measure.map(e=>sM(e)),filter:(0,XO.isArray)(t.filter)?Wa(t.filter):t.filter,type:"query"}),Fg=t=>{if(t.preparedQueryType==="preAggregated"){const e={};return Object.keys(t.filter).forEach(o=>{e[o]=Wa(t.filter[o])}),Object.assign(Object.assign({},t),{filter:e})}return Object.assign(Object.assign({},t),{filter:Wa(t.filter)})},kg=t=>t.type==="preparedQuery"?Fg(t):Pg(t);zs.upCastQuery=kg;(function(t){var e=z0&&z0.__createBinding||(Object.create?function(n,a,p,c){c===void 0&&(c=p);var l=Object.getOwnPropertyDescriptor(a,p);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[p]}}),Object.defineProperty(n,c,l)}:function(n,a,p,c){c===void 0&&(c=p),n[c]=a[p]}),o=z0&&z0.__exportStar||function(n,a){for(var p in n)p!=="default"&&!Object.prototype.hasOwnProperty.call(a,p)&&e(a,n,p)};Object.defineProperty(t,"__esModule",{value:!0}),o(zs,t)})(MA);var sA={};(function(t){var e=z0&&z0.__createBinding||(Object.create?function(n,a,p,c){c===void 0&&(c=p);var l=Object.getOwnPropertyDescriptor(a,p);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[p]}}),Object.defineProperty(n,c,l)}:function(n,a,p,c){c===void 0&&(c=p),n[c]=a[p]}),o=z0&&z0.__exportStar||function(n,a){for(var p in n)p!=="default"&&!Object.prototype.hasOwnProperty.call(a,p)&&e(a,n,p)};Object.defineProperty(t,"__esModule",{value:!0}),o(cs,t)})(sA);var Os={};Object.defineProperty(Os,"__esModule",{value:!0});Os.lowestCommonGranularity=void 0;const Vz=[void 0,null,"none","truncSecond","second","truncMinute","minute","truncHour","hour","truncDay","day","truncWeek","week","truncMonth","month","truncQuarter","quarter","truncYear","year"],jg=(...t)=>t.includes(void 0)||t.includes(null)||t.some(e=>!Vz.includes(e))?"none":t.sort((e,o)=>{const n=Vz.indexOf(e),a=Vz.indexOf(o);return n===-1||a===-1?0:n-a})[0];Os.lowestCommonGranularity=jg;(function(t){var e=z0&&z0.__createBinding||(Object.create?function(l,M,g,y){y===void 0&&(y=g);var _=Object.getOwnPropertyDescriptor(M,g);(!_||("get"in _?!M.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return M[g]}}),Object.defineProperty(l,y,_)}:function(l,M,g,y){y===void 0&&(y=g),l[y]=M[g]}),o=z0&&z0.__setModuleDefault||(Object.create?function(l,M){Object.defineProperty(l,"default",{enumerable:!0,value:M})}:function(l,M){l.default=M}),n=z0&&z0.__exportStar||function(l,M){for(var g in l)g!=="default"&&!Object.prototype.hasOwnProperty.call(M,g)&&e(M,l,g)},a=z0&&z0.__importStar||function(){var l=function(M){return l=Object.getOwnPropertyNames||function(g){var y=[];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(y[y.length]=_);return y},l(M)};return function(M){if(M&&M.__esModule)return M;var g={};if(M!=null)for(var y=l(M),_=0;_<y.length;_++)y[_]!=="default"&&e(g,M,y[_]);return o(g,M),g}}();Object.defineProperty(t,"__esModule",{value:!0}),t.getNativeDataTypesOfNormalizedType=t.DATE_MATHS_OPERATORS=t.NORMALIZED_DATA_TYPES=t.DateFunctions=t.Errors=t.QueryLogic=t.DataSet=void 0;const p=ha;n(ha,t),n(rA,t),t.DataSet=a(ir),t.QueryLogic=a(MA),t.Errors=a(sA),t.DateFunctions=a(Os),t.NORMALIZED_DATA_TYPES=["number","boolean","string","date_time","string[]"],t.DATE_MATHS_OPERATORS=["seconds_between","minutes_between","hours_between","days_between"];const c=(l,M)=>Object.keys(p.NATIVE_DATA_TYPES_DATABASE[l]).filter(y=>p.NATIVE_DATA_TYPES_DATABASE[l][y].normalizedType===M);t.getNativeDataTypesOfNormalizedType=c})(nA);Object.defineProperty($o,"__esModule",{value:!0});$o.ENVIRONMENT_VARIABLES_TO_REQUIRED=$o.vizzlyToPossibleNativeDataTypes=$o.NATIVE_DATA_TYPES=$o.SUPPORTED_CLIENTS=void 0;const $g=_0,cA=nA;$o.SUPPORTED_CLIENTS=["bigquery","mariadb","postgres","snowflake","mysql","microsoftSQLServer","redshift"];const _i=t=>(0,$g.reduce)(Object.keys(cA.NATIVE_DATA_TYPES_DATABASE[t]),(e,o)=>Object.assign(Object.assign({},e),{[o]:o}),{});$o.NATIVE_DATA_TYPES={mysql:_i("mysql"),snowflake:_i("snowflake"),postgres:_i("postgres"),redshift:_i("redshift"),mariadb:_i("mariadb"),bigquery:_i("bigquery"),microsoftSQLServer:_i("microsoftSQLServer")};const Gg=(t,e)=>{let o=[];return Object.entries(cA.NATIVE_DATA_TYPES_DATABASE[t]).forEach(([n,{normalizedType:a}])=>{a==e&&(o=[...o,n])}),o};$o.vizzlyToPossibleNativeDataTypes=Gg;$o.ENVIRONMENT_VARIABLES_TO_REQUIRED={postgres:{VIZZLY_POSTGRES_PASSWORD:!0,VIZZLY_POSTGRES_DATABASE:!0,VIZZLY_POSTGRES_USER:!0,VIZZLY_POSTGRES_HOST:!0,VIZZLY_POSTGRES_PORT:!1},mariadb:{VIZZLY_MARIADB_PASSWORD:!0,VIZZLY_MARIADB_DATABASE:!0,VIZZLY_MARIADB_USER:!0,VIZZLY_MARIADB_HOST:!0,VIZZLY_MARIADB_PORT:!1},mysql:{VIZZLY_MYSQL_PASSWORD:!0,VIZZLY_MYSQL_DATABASE:!0,VIZZLY_MYSQL_USER:!0,VIZZLY_MYSQL_HOST:!0,VIZZLY_MYSQL_PORT:!1},elasticsearch:{VIZZLY_ELASTICSEARCH_CLOUD_ID:!0,VIZZLY_ELASTICSEARCH_API_KEY:!0,VIZZLY_ELASTICSEARCH_NODE:!0,VIZZLY_ELASTICSEARCH_USERNAME:!0,VIZZLY_ELASTICSEARCH_PASSWORD:!0,VIZZLY_ELASTICSEARCH_API_KEY_ID:!0},bigquery:{VIZZLY_BIGQUERY_PROJECT_ID:!0,VIZZLY_BIGQUERY_REGION:!0,VIZZLY_BIGQUERY_KEY_FILENAME:!1,VIZZLY_BIGQUERY_CREDENTIALS:!1},snowflake:{VIZZLY_SNOWFLAKE_PASSWORD:!0,VIZZLY_SNOWFLAKE_DATABASE:!1,VIZZLY_SNOWFLAKE_USERNAME:!0,VIZZLY_SNOWFLAKE_ACCOUNT:!0,VIZZLY_SNOWFLAKE_WAREHOUSE:!0,VIZZLY_SNOWFLAKE_ROLE:!0,VIZZLY_SNOWFLAKE_SCHEMA:!1,VIZZLY_SNOWFLAKE_SESSION_KEEP_ALIVE:!1},microsoftSQLServer:{VIZZLY_MICROSOFT_SQL_SERVER_PASSWORD:!0,VIZZLY_MICROSOFT_SQL_SERVER_DATABASE:!0,VIZZLY_MICROSOFT_SQL_SERVER_USER:!0,VIZZLY_MICROSOFT_SQL_SERVER_HOST:!0,VIZZLY_MICROSOFT_SQL_SERVER_PORT:!1}};var ls={};Object.defineProperty(ls,"__esModule",{value:!0});ls.DataSetNotLinkedToConnection=void 0;class Ug extends Error{constructor(e){super(`Data set ${e} must be linked to a connection by setting a 'connectionId' property that references a connection in the 'connections' section.`),this.name="DataSetNotLinkedToConnection"}}ls.DataSetNotLinkedToConnection=Ug;(function(t){var e=z0&&z0.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(t,"__esModule",{value:!0}),t.redshiftSchema=t.microsoftSQLServerSchema=t.snowflakeSchema=t.mySQLSchema=t.mariadbSchema=t.postgresSchema=t.bigQuerySchema=t._sqlDataSetSchema=t._fieldSchema=t.ID_REGEX_ERROR_MESSAGE=t.ALLOWED_ID_REGEX=void 0;const o=e(eA),n=Ya,a=$o,p=R1,c=Jt,l=ls,M=["unencryptedCredentials","encryptedCredentials"],g=Object.keys(c.supportedOperatorsConstants),y=["rightJoin","leftJoin","innerJoin","outerJoin","leftOuterJoin","rightOuterJoin"];t.ALLOWED_ID_REGEX=/^[a-zA-Z0-9_+:\/=\-\s]*$/,t.ID_REGEX_ERROR_MESSAGE="IDs must only use alpha numeric characters and _";const _={checkConnectionSpecificDataSets:!0},O={abortEarly:!1,allowUnknown:!0},d=L=>o.default.object({id:o.default.string().required().regex(t.ALLOWED_ID_REGEX,t.ID_REGEX_ERROR_MESSAGE).description("A unique identifier for this field. It should not change unless the meaning of the field, or the data type has changed."),publicName:o.default.string().optional().allow("").description("The name of this field that you want your users to see. This can be changed as much as you like without causing a breaking change."),address:o.default.array().items(o.default.string()).optional().description('The address of the column in your database. For example; ["database_name", "table_name", "column_name"] or for BigQuery; ["bigquery project id", "bigquery data set id", "table name", "column name"]'),description:o.default.string().allow("").optional().max(110).description("A description of what the purpose of this data set is"),sql:o.default.string().optional().description("Provide a SQL definition of the field, instead of a table & name combination."),dataType:o.default.valid(...Object.values(a.NATIVE_DATA_TYPES[L])).required(),canBeDimension:o.default.boolean().optional().description("Can this field be used in groupings?"),canBeMeasure:o.default.boolean().optional().description("Can this field be used in aggregations?"),canBeUsedInSort:o.default.boolean().optional().description("__vizzly_hide_from_docs"),allowedGranularities:o.default.array().items(o.default.string().valid(...Object.keys((0,n.getQueryEngineConfig)(L).supportedTimeTruncFunctions))).optional(),allowedOperators:o.default.alternatives().conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"string")),then:o.default.array().items(o.default.string().valid(...(0,p.validOperatorsForField)({dataType:"string"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a string data type.")}).conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"number")),then:o.default.array().items(o.default.string().valid(...(0,p.validOperatorsForField)({dataType:"number"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a number data type.")}).conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"date_time")),then:o.default.array().items(o.default.valid(...(0,p.validOperatorsForField)({dataType:"date_time"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a date time data type.")}).conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"boolean")),then:o.default.array().items(o.default.string().valid(...(0,p.validOperatorsForField)({dataType:"boolean"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a boolean data type.")}).conditional("..dataType",{is:o.default.string().valid(...(0,a.vizzlyToPossibleNativeDataTypes)(L,"string[]")),then:o.default.array().items(o.default.string().valid(...(0,p.validOperatorsForField)({dataType:"string[]"},(0,n.getQueryEngineConfig)(L)))).description("For fields that have a string array data type.")}).optional()});t._fieldSchema=d;const f=o.default.object({type:o.default.string().valid(...y).required(),left:o.default.array().items(o.default.string()).required(),right:o.default.array().items(o.default.string()).required(),as:o.default.string().optional()}),z=o.default.object({fieldId:o.default.string().required(),op:o.default.string().valid(...g).required()}),s=L=>({id:o.default.string().required().regex(t.ALLOWED_ID_REGEX,t.ID_REGEX_ERROR_MESSAGE).description("A unique ID for the data set. This should not change unless the meaning of the data set represents changes."),connectionId:o.default.string().required().description("Reference the connection to use for this data set."),hide:o.default.boolean().optional().description("Hide the data set from the dashboard."),name:o.default.string().required().description("A public name for the data set. This can change as much as you like without causing a breaking change."),description:o.default.string().allow("").optional().max(110).description("A description of what this field represents"),sql:o.default.string().optional().description("Optionally define the data set using a SQL statement. If used, the `table` value for each field should equal `vizzly_data_set`."),testParameters:o.default.string().optional().description("Test parameters that are used when creating SQL backed data sets. This is a stringified JSON object."),preAggregated:o.default.alternatives(o.default.array().items(o.default.string()).description("Array of data set IDs relied on by the pre-aggregated data set"),o.default.boolean().allow(!1).description("Only `False` is a valid boolean option. For truthy values, provide an array of data set IDs")).optional().description("Optional - For pre-aggregated data sets or SQL views, provide a list of data sets that are relied upon."),fields:o.default.array().min(1).items(L).unique("id").message("Field IDs must be unique").required(),permanentFilters:o.default.object({type:o.default.valid("andWhere","orWhere","where"),value:o.default.array()}),secureFilterGuards:o.default.array().items(z).optional()}),h=L=>o.default.object(Object.assign(Object.assign({},s(L)),{joins:o.default.array().items(f).unique((T,w)=>{const C=JSON.stringify(T.right)===JSON.stringify(w.right);return!T.as&&!w.as&&C}).message("A table cannot be referenced in a right join multiple times.").optional()}));t._sqlDataSetSchema=h;const A=L=>{var T;if(((T=L.onlyClients)===null||T===void 0?void 0:T.length)===1)return(0,t._sqlDataSetSchema)((0,t._fieldSchema)(L.onlyClients[0]));const w=o.default.alternatives(...(L.onlyClients||a.SUPPORTED_CLIENTS).map(C=>(0,t._sqlDataSetSchema)((0,t._fieldSchema)(C))));if(L.dataSetIdToClientMapping){const C=Object.entries(L.dataSetIdToClientMapping).map(([R,S])=>({is:R,then:(0,t._sqlDataSetSchema)((0,t._fieldSchema)(S))}));return o.default.alternatives().conditional(".id",[...C,{is:!0,then:w}])}return w},q=(L,T)=>o.default.object({version:o.default.number(),connections:o.default.object().pattern(o.default.string(),o.default.object({client:o.default.string().allow(...a.SUPPORTED_CLIENTS).required(),name:o.default.string().optional().allow(""),encryptedCredentials:o.default.string().optional(),unencryptedCredentials:o.default.alternatives(o.default.string(),o.default.object()).optional()})),dataSets:o.default.array().items(T.checkConnectionSpecificDataSets?o.default.object().custom(w=>{var C,R;const S=w.connectionId||"___vizzly_default_conn",E=(R=(C=L?.connections)===null||C===void 0?void 0:C[S])===null||R===void 0?void 0:R.client;if(!E)throw new l.DataSetNotLinkedToConnection(w.id);const G=(0,t._sqlDataSetSchema)((0,t._fieldSchema)(E)).validate(w,O);if(G.error)throw G.error;return w},"Data sets linked to connections"):A(T)).unique("id").message("dataSet[x].id must be unique.").required(),executableDashboardConfigForPDF:o.default.string().allow(null).optional().description("JavaScript dashboard config for server-side generated PDFs"),publicKeys:o.default.array().items(o.default.string()).optional(),sqlViews:o.default.object().pattern(o.default.string(),o.default.object({name:o.default.string().required(),sql:o.default.string().allow("").required()})).optional(),runOptions:o.default.object().optional(),queryRoutingRules:o.default.array().items(o.default.object()).optional()});t.bigQuerySchema=q({},{onlyClients:["bigquery"]}),t.postgresSchema=q({},{onlyClients:["postgres"]}),t.mariadbSchema=q({},{onlyClients:["mariadb"]}),t.mySQLSchema=q({},{onlyClients:["mysql"]}),t.snowflakeSchema=q({},{onlyClients:["snowflake"]}),t.microsoftSQLServerSchema=q({},{onlyClients:["microsoftSQLServer"]}),t.redshiftSchema=q({},{onlyClients:["redshift"]}),t.default=(L,T={})=>{const w=q(L,Object.assign(Object.assign(Object.assign({},_),T),{dataSetIdToClientMapping:v(L)})).validate(L,O);return w.error&&w.error.details.map(C=>{var R,S;M.includes(((R=C.context)===null||R===void 0?void 0:R.key)||"")&&!((S=C.context)===null||S===void 0)&&S.value&&(C.context.value="-- VIZZLY REDACTED --")}),w};const v=L=>{let T={};return L&&typeof L?.dataSets=="object"&&typeof L?.connections=="object"&&L.dataSets.forEach(w=>{var C,R;if(T){const S=w.connectionId||"___vizzly_default_conn",E=(R=(C=L?.connections)===null||C===void 0?void 0:C[S])===null||R===void 0?void 0:R.client;E&&(T[w.id]=E)}}),T}})(iA);(function(t){var e=z0&&z0.__createBinding||(Object.create?function(c,l,M,g){g===void 0&&(g=M);var y=Object.getOwnPropertyDescriptor(l,M);(!y||("get"in y?!l.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return l[M]}}),Object.defineProperty(c,g,y)}:function(c,l,M,g){g===void 0&&(g=M),c[g]=l[M]}),o=z0&&z0.__setModuleDefault||(Object.create?function(c,l){Object.defineProperty(c,"default",{enumerable:!0,value:l})}:function(c,l){c.default=l}),n=z0&&z0.__importStar||function(){var c=function(l){return c=Object.getOwnPropertyNames||function(M){var g=[];for(var y in M)Object.prototype.hasOwnProperty.call(M,y)&&(g[g.length]=y);return g},c(l)};return function(l){if(l&&l.__esModule)return l;var M={};if(l!=null)for(var g=c(l),y=0;y<g.length;y++)g[y]!=="default"&&e(M,l,g[y]);return o(M,l),M}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Schemas=t.ID_REGEX_ERROR_MESSAGE=t.ALLOWED_ID_REGEX=t.validate=void 0;const a=n(iA);t.validate=a.default,Object.defineProperty(t,"ALLOWED_ID_REGEX",{enumerable:!0,get:function(){return a.ALLOWED_ID_REGEX}}),Object.defineProperty(t,"ID_REGEX_ERROR_MESSAGE",{enumerable:!0,get:function(){return a.ID_REGEX_ERROR_MESSAGE}});const p={bigQuery:a.bigQuerySchema,postgres:a.postgresSchema,mariadb:a.mariadbSchema,mySQL:a.mySQLSchema,snowflake:a.snowflakeSchema,microsoftSQLServer:a.microsoftSQLServerSchema,redshift:a.redshiftSchema};t.Schemas=p})(oA);var zA={};Object.defineProperty(zA,"__esModule",{value:!0});var OA={},us={};Object.defineProperty(us,"__esModule",{value:!0});us.ianaTimeZonesDb=void 0;us.ianaTimeZonesDb=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/La_Rioja","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Ciudad_Juarez","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New_York","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Katmandu","Asia/Khandyga","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis"];(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ianaTimeZones=t.ETC_UTC_TIME_ZONE=void 0,t.ETC_UTC_TIME_ZONE="Etc/UTC";const e=us,o=()=>[t.ETC_UTC_TIME_ZONE,...e.ianaTimeZonesDb];t.ianaTimeZones=o})(OA);(function(t){var e=z0&&z0.__createBinding||(Object.create?function(p,c,l,M){M===void 0&&(M=l);var g=Object.getOwnPropertyDescriptor(c,l);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(p,M,g)}:function(p,c,l,M){M===void 0&&(M=l),p[M]=c[l]}),o=z0&&z0.__setModuleDefault||(Object.create?function(p,c){Object.defineProperty(p,"default",{enumerable:!0,value:c})}:function(p,c){p.default=c}),n=z0&&z0.__importStar||function(){var p=function(c){return p=Object.getOwnPropertyNames||function(l){var M=[];for(var g in l)Object.prototype.hasOwnProperty.call(l,g)&&(M[M.length]=g);return M},p(c)};return function(c){if(c&&c.__esModule)return c;var l={};if(c!=null)for(var M=p(c),g=0;g<M.length;g++)M[g]!=="default"&&e(l,c,M[g]);return o(l,c),l}}(),a=z0&&z0.__exportStar||function(p,c){for(var l in p)l!=="default"&&!Object.prototype.hasOwnProperty.call(c,l)&&e(c,p,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.VizzlyConfig=t.QueryEngineConfig=void 0,t.QueryEngineConfig=n(tA),t.VizzlyConfig=n(oA),a(zA,t),a(OA,t)})(oo);const lA=oo.QueryEngineConfig.Constants.supportedOperatorsConstants,Vo=(t,e)=>{let o=[...Object.keys(e.supportedOperators)];return o=o.filter(n=>Qn[n].validDataTypes.includes(t.dataType)),o},Vg=(t,e)=>t=="countDistinct"?e("count_distinct","Count distinct"):_0.capitalize(t),Qn=lA,Hg=t=>{const e=_0.cloneDeep(Qn);if(!t)return e;let o={};return t.forEach(n=>{if(!Qn[n])throw`Operator ${n} not managed by Vizzly`;o[n]=Qn[n]}),o},Yg=t=>Qn[t].publicName,X1=t=>t.map(e=>e.map(o=>(o.op=="is_one_of"||o.op=="is_not_one_of")&&!_0.isArray(o.value)?{...o,value:[o.value]}:o)),te=(t,e)=>t.map(o=>{let n={...o,aggregate:void 0,function:o.function||o.aggregate};return delete n.aggregate,e&&n.field==e.field&&n.function=="none"&&(n.function=e.truncate),n}),c1=t=>t.map(e=>{let o={...e,aggregate:void 0,function:e.function||e.aggregate};return delete o.aggregate,o}),A1=t=>t==="auto"||t===0||t===2?t:"auto",Mi=t=>typeof t=="number"&&![0,2].includes(t)?"auto":t,Kg=t=>Qn[t].publicName,Re=t=>{if(!t)return{};let e={};return t.measure&&Object.entries(t.measure).forEach(([o,n])=>{e&&(e[o]=c1(n))}),{measure:_0.isEmpty(e)?void 0:e,group:t.group}},Qg=Object.freeze({__proto__:null,aggregateName:Vg,getOperatorPublicName:Kg,operatorToString:Yg,supportedOperators:Hg,upcastAxisLabel:A1,upcastAxisLabelWithAllOptions:Mi,upcastFilter:X1,upcastMeasure:c1,upcastOrder:te,upcastV1Parameters:Re,validOperatorsForField:Vo}),uA=oo.QueryEngineConfig.Constants.supportedAggregatesConstants,Zg=uA,Jg=t=>_0.cloneDeep(Zg),k3=(t,e)=>[...Object.keys(t),"none"].includes(e),ey=(t,e,o)=>{const n=t[e];return n?n.validDataTypes.includes(o):!1},ty=(t,e,o)=>{if(e===void 0)return t;if(_0.isFunction(e)){if(o?.filter)return e({value:t,filter:o.filter,dataSetId:o.dataSetId});if(o?.fieldId)return e({value:t,fieldId:o.fieldId,dataSetId:o.dataSetId})}if(e&&!_0.isFunction(e)&&t!==null&&e[t])return e[t]};function oy(t,e=!0,o){if(t.length==0)return"";if(t.length==1)return e?`'${t[0]}'`:`${t[0]}`;let n=[...t],a=n.pop();return`${n.map(p=>e?`'${p}'`:`${p}`).join(", ")} and ${e?`'${a}'`:`${a}`}`}const iy=t=>t.charAt(0).toUpperCase()+t.slice(1),AA=(t,e,o)=>{const n=_0.replace(t,e,o);return n.indexOf(e)>=0?AA(n,e,o):n},ny=t=>iy(AA(t,"_"," ")),j3=["debug","info","warning","error","properties"];let ry="error";const EO=t=>{const e=j3.findIndex(n=>ry==n),o=j3.findIndex(n=>t==n);return e<=o},DO=t=>t instanceof Error?t:_0.isObject(t)||_0.isArray(t)?JSON.stringify(t):t,ee=(...t)=>{EO("debug")&&console.info("[VIZZLY DEBUG]",...t.map(DO))},IO=(...t)=>{EO("warning")&&console.warn("[VIZZLY WARNING]",...t.map(DO))},eo=(...t)=>{EO("error")&&console.error("[VIZZLY ERROR]",...t.map(DO))},As="No value",ay=Object.keys(Jg()),dA=(t,e,o)=>{const n=o?.allowEmptyPublicName?"":qA(t.id);return{id:t.id,dataType:t.dataType,publicName:t.publicName||n,dashboardRequiredFilterGroups:t.dashboardRequiredFilterGroups||[],description:t.description||void 0,canBeDimension:t.canBeDimension===void 0?!0:t.canBeDimension,canBeMeasure:t.canBeMeasure===void 0?!0:t.canBeMeasure,allowedOperators:t.allowedOperators===void 0?Vo(t,e):t.allowedOperators,allowedGranularities:t.allowedGranularities===void 0?Object.keys(e.supportedTimeTruncFunctions):t.allowedGranularities,supportedAggregateOptions:gA(e,t.dataType,t.supportedAggregateOptions)}},py=(t,e)=>{if(t===null)return!0;switch(e){case"boolean":return _0.isBoolean(t);case"number":return _0.isNumber(t);case"string":return _0.isString(t);case"string[]":return Array.isArray(t);case"date_time":return _0.isDate(t)||_0.isString(t)}},by=(t,e)=>{if(t===null)return null;switch(e){case"boolean":return!!t;case"date_time":return new Date(t);case"number":return Number(t);case"string[]":return`${Array.isArray(t)?oy(t,!1):`${t}`}`;case"string":return`${t}`}},My=(t,e)=>e==="boolean"&&(t==="true"||t==="TRUE"||t==="True")?!0:e==="boolean"&&(t==="false"||t==="FALSE"||t==="False")?!1:t,fA=["date_time","boolean","number","string"],sy=t=>fA.includes(t),qA=t=>ny(t),cy=t=>t=="date_time"?"Date Time":t=="string"?"Text":t=="string[]"?"List of Text":t=="boolean"?"True or False":_0.upperFirst(t),zy=(t,e,o=As)=>t===null||t==="No value"||_0.isNumber(t)&&isNaN(t)?o:t instanceof Date&&e?e(t):t===!0?"True":t===!1?"False":_0.isNumber(t)&&t%1!==0?t.toFixed(2):Array.isArray(t)?t.join(", "):`${t}`,Oy=(t,e=As)=>t===null?e:t instanceof Date?t.toISOString():t,ly=(t,e)=>_0.remove([...t],o=>!e.includes(o.id)),uy=(t,e,o)=>{const n={};return[...t.allowedOperators].forEach(a=>{const p=e[a];p.validDataTypes.includes(t.dataType)&&(n[a]={...p,publicName:o?o(`config.supported_operator.${a}`,p.publicName):p.publicName})}),n},hA=(t,e)=>PO(t,e)[0],PO=(t,e)=>{let o=t.supportedAggregateOptions??[],n=o.filter(a=>Object.keys(e).includes(a)&&e[a].validDataTypes.includes(t.dataType));return n.length===0?n=Object.keys(e).filter(a=>e[a].validDataTypes.includes(t.dataType)):n.sort((a,p)=>{const c=o.indexOf(a),l=o.indexOf(p);return c-l}),n},Ay=(t,e)=>[...PO(t,e)].map(n=>({value:n,label:e[n].publicName})),dy=(t,e)=>[...Object.keys(e)].flatMap(n=>t.includes(n)?[{value:n,label:e[n].publicName}]:[]),fy=t=>t[0],WA=t=>!t?.function||t?.function=="none"?t?.field:`${t.field}_${t.function}`,Ka=(t,e)=>{const o=t.split("_"),n=o.pop();return[void 0,...Object.keys(e.supportedAggregates||{}),...Object.keys(e.supportedTimeTruncFunctions||{}),...Object.keys(e.supportedTransformationFunctions||{})].includes(n)?{field:o.join("_"),function:n??""}:{field:t,function:"none"}},qy=(t,e)=>{let{field:o,function:n}=Ka(t,e);return{fieldId:o,function:n}},mA=(t,e)=>Object.keys(e).filter(o=>e[o].validDataTypes.includes(t.dataType)),hy=(t,e)=>{const o=new Set(e.map(n=>n.field));return t.filter(n=>!o.has(n.id))},C1=(t,e)=>{const o=t.map(n=>typeof n=="string"?{field:n,function:"none"}:n);return e?{dimension:o.some(p=>p.field===e.field&&p.function===e.truncate)?o:[{field:e.field,function:e.truncate},...o],timeDimension:null}:{dimension:o,timeDimension:null}},Wy=t=>t.dataType=="string[]",Hz={round_to_0_dp:{publicName:"Round to 0dp",validDataTypes:["number"]},round_to_2_dp:{publicName:"Round to 2dp",validDataTypes:["number"]}},my=t=>{const e=_0.cloneDeep(Hz);if(!t)return e;let o={};return t.forEach(n=>{if(!Hz[n])throw`Transformation function ${n} is not managed by Vizzly`;o[n]=Hz[n]}),o},gA=(t,e,o)=>{const n=t.supportedAggregates,a=Object.keys(n).filter(c=>n[c].validDataTypes.includes(e));o?.forEach(c=>{n.hasOwnProperty(c)||IO(`Unsupported aggregate option: ${c} on ${e}`)});let p=o&&o.length>0?o.filter(c=>a.includes(c)):a;return o&&o.length>0&&p.length===0&&(p=a),p},gy=(t,e,o,n,a,p)=>{if(a){let c;o?c=o.field:e&&e.length>0&&e[0].field&&(c=e[0].field);const l=ty(null,a,{fieldId:c,dataSetId:t});if(l)return String(l)}return n?n(p||"no_value",As):void 0},yy=Object.freeze({__proto__:null,ALL_AGGREGATES:ay,NULL_REPLACEMENT:As,VALID_DATA_TYPES:fA,checkForNullValue:gy,dataTypeToHumanReadable:cy,decodeId:Ka,getDefaultAggregateForField:hA,getQueryFieldIdFromResultFieldId:qy,id:WA,isArrayDataType:Wy,isValidDataType:sy,listValidFunctionsForDataType:mA,parseBooleanFromString:My,parseValue:by,removeField:hy,removeFields:ly,supportedAggregateOptions:Ay,supportedAggregatesForField:PO,supportedAggregatesFunction:gA,supportedOperators:uy,supportedTransformationFunctions:my,takeHighestGranularity:fy,timeDimensionTruncateToSelectOptions:dy,toHumanReadable:qA,toString:zy,toStringShort:Oy,upcastDimensions:C1,upcastField:dA,valueIsOrDataType:py}),yA=t=>({minutes:{description:"Minutes",formatter:(e,o)=>{e.setMinutes(e.getMinutes()+o)}},hours:{description:"Hours",formatter:(e,o)=>{e.setHours(e.getHours()+o)}},days:{description:"Days",formatter:(e,o)=>{e.setDate(e.getDate()+o)}},weeks:{description:"Weeks",formatter:(e,o)=>{e.setDate(e.getDate()+o*7)}},months:{description:"Months",formatter:(e,o)=>{e.setMonth(e.getMonth()+o)}},years:{description:"Years",formatter:(e,o)=>{e.setFullYear(e.getFullYear()+o)}}}),Ry=t=>({future:{description:"Future"},past:{description:"Past"}}),vy=()=>{const t=yA();return Object.keys(t)},Ly=()=>{const t=Ry();return Object.keys(t)},FO=u.object({unit:u.string().valid(...vy()).required(),value:u.number().integer().required(),timeFrame:u.string().valid(...Ly()).required()});function RA(t){const{error:e}=FO.validate(t);return!e}const kO=(t,e)=>{const o=e?new Date(e):new Date;if(!t.value||t.unit===null)throw new Error(`Unrecognized value: ${t.value}`);let n=t.timeFrame==="future"?t.value:-t.value;return yA()[t.unit].formatter(o,n),o},_y=(t,e,o)=>{if(!o)throw new Error("appliesToFields is required");return t.map(n=>{const a=n.map(c=>({op:c.op,value:{...c.value}})),p=[];return o.forEach(c=>{c.dataSetId==e.id&&a.forEach(l=>{p.push({...l,field:c.fieldId})})}),p})};var q2=(t=>(t.FIXED="fixed",t.AVERAGE="average",t.TRENDLINE="trendline",t))(q2||{});const Ny=()=>u.object({key:u.string().required()}),D1=()=>u.array().items(Ny()).min(0),ce=(t,e)=>{const o=(n,a)=>u.object({field:n.required(),function:a.required().description("Which if any, aggregate function should be applied to the field?")});return e?.restrictFields?u.alternatives(...e.restrictFields.filter(n=>n.canBeMeasure).map(n=>{const a=mA(n,t);return o(u.string().valid(n.id).description(`${n.publicName}, ${n.description||""}.`),u.string().valid(...a,"none"))})):o(u.string().description("The ID of the field from the data set to reference."),u.valid(...Object.keys(t),"none"))},_2=t=>u.object({field:u.string().required().description("The ID of the field from the data set to reference."),direction:u.string().valid("asc","desc").required().description("In which direction should the results be ordered?"),function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none").description("Which if any, function should be applied to the field?")}),ar=t=>u.object({field:u.string().required().description("The ID of the field from the data set to reference."),truncate:u.valid(...Object.keys(t),"none"),bucketFill:u.boolean()}),lt=(t,e)=>{const o=(n,a)=>u.object({field:n.required(),pivot:u.string().valid("x","y").optional(),function:a?u.valid(...Object.keys(t),"none").required():u.valid("none").required()});return e?.restrictFields?u.array().items(u.alternatives(...e.restrictFields.filter(n=>n.canBeDimension).map(n=>o(u.string().valid(n.id).description(`${n.publicName}, ${n.description||""}.`),n.dataType==="date_time")))).description("Fields to group the data by"):u.array().items(o(u.string().description("The ID of the field from the data set to reference."),!0)).description("Fields to group the data by")},Ty=(t,e=10)=>{const o=u.object({field:u.object({type:u.string().valid("field").required(),value:u.string().required().description("The ID of the field from the data set to reference."),function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none").description("Which function should be applied to the field?")}),op:u.string().valid(...Object.keys(t.supportedOperators)).required(),value:u.alternatives().try(LA,u.string().allow(null),u.number(),u.boolean(),u.array().items(u.string(),u.number(),u.allow(null)),FO).required()}),n=a=>a<=0?u.object({type:u.string().valid("where").required(),value:o.required()}):u.alternatives().try(u.object({type:u.string().valid("where").required(),value:o.required()}),u.object({type:u.string().valid("andWhere","orWhere").required(),value:u.array().items(n(a-1)).required().description("Array of nested filters")}));return n(e)},pr=t=>u.object({field:u.string().required().description("The ID of the field from the data set to reference."),op:u.string().valid(...Object.keys(t.supportedOperators)).required(),value:u.alternatives().try(LA,u.string().allow(null),u.number(),u.boolean(),u.array().items(u.string(),u.number(),u.allow(null)),FO).required(),function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none").description("Which function should be applied to the field?"),groupBy:u.string().optional().description("The dimension field to group the aggregate by for subquery filters.")}),yo=t=>u.array().items(u.array().items(pr(t))),io=()=>u.number().description("Limit the number of results returned after the query has been ran."),I1=t=>{const e=t?.restrictDataSetIds?u.string().valid(...t.restrictDataSetIds):u.string();return{viewId:u.string().allow("").optional().description("__vizzly_hide_from_docs"),displayTitle:u.string().allow("").description("A title that explains what is being displayed."),displaySubject:u.string().allow("").description("A chance to add a more detailed description of what is being shown."),dataSetId:e.description("The ID of the data set that is being used by the view."),protectedByOrganisation:u.boolean().optional().description("Has the view been created by your organisation, and therefore cannot be modified by your users?"),updated_at:u.string().optional().description("ISO timestamp of when the view attributes were last updated.")}},to=u.valid("auto",2,0).description("Determine how many axis labels should be shown on the axis"),jO=t=>{let e=["auto",2,0];return t&&(e=e.concat(t)),u.valid(...e).description("Determine how many axis labels should be shown on the axis")},xy=(t,e)=>({measure:u.array().items(ce(t.supportedAggregates,e)).required().description("A list of metrics that are to be shown. For example the `count` of a specific field in your data set."),dimension:lt(t.supportedTimeTruncFunctions,e).required(),order:u.array().items(_2(t)),limit:io(),offset:u.number().min(0).description("Paginate results by using this property with limit.")}),ut=(t,e,o)=>({...xy(t,e),filter:u.array().items(u.array().items(pr(t))),timeDimension:u.alternatives(ar(t.supportedTimeTruncFunctions),u.valid(null)).required(),drilldown:u.alternatives(lt(t.supportedTimeTruncFunctions,e).required(),u.string()),xAxisPostfix:u.string().allow("").description("Add a postfix to the X Axis"),xAxisPrefix:u.string().allow("").description("Add a prefix to the X Axis"),yAxisFormat:u.alternatives(u.string(),u.valid(null)).description("ID of the formatting function to apply to the Y Axis values"),yAxisPostfix:u.string().allow("").description("Add a postfix to the Y Axis"),yAxisPrefix:u.string().allow("").description("Add a prefix to the Y Axis"),yDualAxisFormat:u.alternatives(u.string(),u.valid(null)).description("ID of the formatting function to apply to the Dual Y Axis values").optional(),yDualAxisPostfix:u.string().allow("").description("Add a postfix to the Dual Y Axis").optional(),yDualAxisPrefix:u.string().allow("").description("Add a prefix to the Dual Y Axis").optional(),xAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),xAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),yAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),yAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),yDualAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),yDualAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),xAxisFormat:u.alternatives(u.string(),u.valid(null)).description("ID of the formatting function to apply to the X Axis values"),approxYAxisLabelCount:to,approxXAxisLabelCount:o?jO(o):to,approxDualYAxisLabelCount:to.optional()}),Qa=u.string().valid("natural","straight","step","stepBefore","stepAfter","dotted"),Sy=u.string().valid("natural","straight","step"),ds=t=>u.array().items(u.object({function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none"),field:u.string().required().description("The ID of the field from the data set to reference.")})),$O=t=>u.array().items(u.object({function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none"),truncate:u.string(),field:u.string().required().description("The ID of the field from the data set to reference."),bucketFill:u.boolean().optional(),pivot:u.string().valid("x","y").optional()})),By=(t,e)=>u.object().pattern(u.string(),u.alternatives().try(u.array().items(ar(t.supportedTimeTruncFunctions)).min(1),lt(t.supportedTimeTruncFunctions,e))).unknown(!0),wy=(t,e)=>u.object().pattern(u.string(),u.array().items(ce(t.supportedAggregates,e)).min(1)).unknown(!0),Ie=(t,e)=>u.object({measure:wy(t,e),group:By(t,e)}),At=u.object({fields:u.array().items(u.object({field:u.string()}))}),Cy=u.alternatives().try(u.number().required(),u.string().pattern(/^\{\{.*\}\}$/).required()),Xy=()=>u.object({color:u.string().required(),value:u.when("goalLineType",{is:u.valid(q2.AVERAGE,q2.TRENDLINE),then:u.any().optional(),otherwise:Cy}),strokeWidth:u.number().required(),strokeStyle:u.string().valid("dashed","solid").required(),label:u.boolean().optional(),goalLineType:u.string().valid(q2.FIXED,q2.AVERAGE,q2.TRENDLINE).optional().default(q2.FIXED),metricField:u.when("goalLineType",{is:u.valid(q2.AVERAGE,q2.TRENDLINE),then:u.string().required(),otherwise:u.string().optional()})}),Tt=()=>u.array().items(Xy()),GO=()=>u.object({enabled:u.boolean().required(),labels:u.object({quadrantOne:u.string().allow("").optional(),quadrantTwo:u.string().allow("").optional(),quadrantThree:u.string().allow("").optional(),quadrantFour:u.string().allow("").optional()}).required()}),jt=()=>u.object({func:u.string().valid("mean","sum","current").allow(null).optional()}),Pe=()=>u.object({x:u.string().allow(""),y:u.string().allow(""),yDual:u.string().allow("")}),vA=u.object().pattern(u.string(),u.object({width:u.number().min(0),height:u.number().min(0)})),LA=u.custom((t,e)=>Object.prototype.toString.call(t)==="[object Date]"?t:e.error("any.invalid"),"Date object validation"),ma=t=>u.object({filters:u.array().items(u.array().items(pr(t)).required().max(1)).required().max(1),ruleValue:u.string().allow("").required(),ruleValueEnd:u.string().allow(""),ruleType:u.valid("backgroundColor","fontColor","lineColor","areaColor").required()}).description("A rule used to conditionally format a view."),_A=u.object({field:u.string().required().description("ID of the field in the data set to add a prefix too."),prefix:u.string().required().description("The prefix to be applied.")}),nt=t=>u.array().items(ma(t)).description("Apply formatting based on a set of defined rules."),NA=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),type:u.valid("areaChart").required(),lineCurve:Qa,conditionalFormattingRules:nt(t.queryEngineConfig),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1()}),Ey=t=>(e,o)=>E1(e,o,NA(t)),Dy=oo.QueryEngineConfig.Constants.timeDimensionsConstants,Iy=t=>!t?.truncate||t?.truncate=="none"?t?.field:`${t.field}_${t.truncate}`,Py=(t,e)=>{const o=t.split("_"),n=o.pop();return n&&!OO(e,n)?null:{field:o.join("_"),truncate:n??""}},OO=(t,e)=>[...Object.keys(t),"none"].includes(e),Zn=WA,Fy=Ka,ky=(t,e,o)=>{if("measure"in t&&t.measure){const n=$y(t.measure,o);if(n?.function&&n.field===e){const a=Zn(n);delete t.measure[a]}t.measure=$3(t.measure,e)}if("group"in t&&t.group){const n=jy(t.group,o);if(n?.truncate&&n.field===e){const a=Iy(n);delete t.group[a]}else t.group.hasOwnProperty(e)&&delete t.group[e];t.group=$3(t.group,e)}return t};function jy(t,e){return Object.keys(t).map(o=>{const n=Py(o,e.supportedTimeTruncFunctions);return n?.truncate?n:null}).find(o=>o!==null)}function $y(t,e){return Object.keys(t).map(o=>{const n=Fy(o,e);return n?.function?n:null}).find(o=>o!==null)}function $3(t,e){const o={};for(const[n,a]of Object.entries(t))o[n]=a.filter(p=>p?.field!==e);return o}const Gy=(t,e)=>({fields:t.fields.filter(o=>o.field!=e)}),V1=(t,e,o)=>{let n={...t};if("measure"in n&&_0.remove(n.measure,a=>a.field==e),"barMeasure"in n&&_0.remove(n.barMeasure,a=>a.field==e),"lineMeasure"in n&&_0.remove(n.lineMeasure,a=>a.field==e),"xMeasure"in n&&Array.isArray(n.xMeasure)&&_0.remove(n.xMeasure,a=>a.field==e),"yMeasure"in n&&n.yMeasure?.field==e&&(n.yMeasure=null),"order"in n&&_0.remove(n.order,a=>a.field==e),"dimension"in n&&_0.remove(n.dimension,a=>a.field==e),"barDimension"in n&&_0.remove(n.barDimension,a=>a.field==e),"lineDimension"in n&&_0.remove(n.lineDimension,a=>a.field==e),"filter"in n&&n.filter.forEach(a=>{_0.remove(a,p=>p.field==e)}),"parameters"in n&&n.parameters&&o){const a=ky(n.parameters,e,o);n.parameters=a}if("parametersV2"in n&&n.parametersV2&&o){const a=Gy(n.parametersV2,e);n.parametersV2=a}return"timeDimension"in n&&n.timeDimension?.field==e&&(n.timeDimension=null),n},Uy={barChart:{displayName:"Column Charts"},lineChart:{displayName:"Line Charts"},lineChartV2:{displayName:"Line Charts"},areaChart:{displayName:"Area Charts"},horizontalBarChart:{displayName:"Horizontal Bar Charts"},scatterChart:{displayName:"Scatter Charts"},scatterChartV2:{displayName:"Scatter Charts"},pieChart:{displayName:"Pie Charts"},funnelChart:{displayName:"Funnel Charts"},sunburstChart:{displayName:"Sunburst Charts"},bubbleChart:{displayName:"Bubble Charts"},bubbleChartV2:{displayName:"Bubble Charts"},basicTable:{displayName:"Tables"},comboChart:{displayName:"Combo Charts",customMessage:"Combo Charts needs at least 1 grouping (Bar and Line), or, have time set to display correctly."},comboChartV2:{displayName:"Combo Charts",customMessage:"Combo Charts needs at least 1 grouping (Bar and Line), or, have time set to display correctly."}},Vy=t=>{const e=Uy[t.type];return e?.customMessage?e.customMessage:`${e?.displayName||"Charts"} need at least 1 grouping to display correctly.`},Hy=t=>t.type==="comboChart"?!!(t.timeDimension||t.barDimension.length>0&&t.lineDimension.length>0):t.type==="barChart"||t.type==="lineChart"||t.type==="areaChart"||t.type==="horizontalBarChart"||t.type==="scatterChart"||t.type==="pieChart"||t.type==="funnelChart"||t.type==="sunburstChart"?!!(t.timeDimension||!t?.dimension||t?.dimension?.length!==0):!0,ze=t=>Hy(t)?!0:Vy(t);var Yy=typeof z0=="object"&&z0&&z0.Object===Object&&z0,TA=Yy,Ky=TA,Qy=typeof Ot=="object"&&Ot&&Ot.Object===Object&&Ot,Zy=Ky||Qy||Function("return this")(),N2=Zy,Jy=N2,eR=Jy.Symbol,xA=eR,G3=xA,SA=Object.prototype,tR=SA.hasOwnProperty,oR=SA.toString,Ma=G3?G3.toStringTag:void 0;function iR(t){var e=tR.call(t,Ma),o=t[Ma];try{t[Ma]=void 0;var n=!0}catch{}var a=oR.call(t);return n&&(e?t[Ma]=o:delete t[Ma]),a}var nR=iR,rR=Object.prototype,aR=rR.toString;function pR(t){return aR.call(t)}var bR=pR,U3=xA,MR=nR,sR=bR,cR="[object Null]",zR="[object Undefined]",V3=U3?U3.toStringTag:void 0;function OR(t){return t==null?t===void 0?zR:cR:V3&&V3 in Object(t)?MR(t):sR(t)}var fs=OR;function lR(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Za=lR,uR=fs,AR=Za,dR="[object AsyncFunction]",fR="[object Function]",qR="[object GeneratorFunction]",hR="[object Proxy]";function WR(t){if(!AR(t))return!1;var e=uR(t);return e==fR||e==qR||e==dR||e==hR}var mR=WR,gR=N2,yR=gR["__core-js_shared__"],RR=yR,Yz=RR,H3=function(){var t=/[^.]+$/.exec(Yz&&Yz.keys&&Yz.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vR(t){return!!H3&&H3 in t}var LR=vR,_R=Function.prototype,NR=_R.toString;function TR(t){if(t!=null){try{return NR.call(t)}catch{}try{return t+""}catch{}}return""}var BA=TR,xR=mR,SR=LR,BR=Za,wR=BA,CR=/[\\^$.*+?()[\]{}|]/g,XR=/^\[object .+?Constructor\]$/,ER=Function.prototype,DR=Object.prototype,IR=ER.toString,PR=DR.hasOwnProperty,FR=RegExp("^"+IR.call(PR).replace(CR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kR(t){if(!BR(t)||SR(t))return!1;var e=xR(t)?FR:XR;return e.test(wR(t))}var jR=kR;function $R(t,e){return t?.[e]}var GR=$R,UR=jR,VR=GR;function HR(t,e){var o=VR(t,e);return UR(o)?o:void 0}var Ja=HR,YR=Ja,KR=N2,QR=YR(KR,"DataView"),ZR=QR,JR=Ja,ev=N2,tv=JR(ev,"Map"),ov=tv,iv=Ja,nv=N2,rv=iv(nv,"Promise"),av=rv,pv=Ja,bv=N2,Mv=pv(bv,"Set"),sv=Mv,cv=Ja,zv=N2,Ov=cv(zv,"WeakMap"),lv=Ov,lO=ZR,uO=ov,AO=av,dO=sv,fO=lv,wA=fs,br=BA,Y3="[object Map]",uv="[object Object]",K3="[object Promise]",Q3="[object Set]",Z3="[object WeakMap]",J3="[object DataView]",Av=br(lO),dv=br(uO),fv=br(AO),qv=br(dO),hv=br(fO),Un=wA;(lO&&Un(new lO(new ArrayBuffer(1)))!=J3||uO&&Un(new uO)!=Y3||AO&&Un(AO.resolve())!=K3||dO&&Un(new dO)!=Q3||fO&&Un(new fO)!=Z3)&&(Un=function(t){var e=wA(t),o=e==uv?t.constructor:void 0,n=o?br(o):"";if(n)switch(n){case Av:return J3;case dv:return Y3;case fv:return K3;case qv:return Q3;case hv:return Z3}return e});function Wv(t){return t!=null&&typeof t=="object"}var UO=Wv,mv=fs,gv=UO,yv="[object Arguments]";function Rv(t){return gv(t)&&mv(t)==yv}var vv=Rv,eu=vv,Lv=UO,CA=Object.prototype,_v=CA.hasOwnProperty,Nv=CA.propertyIsEnumerable;eu(function(){return arguments}());var WM={exports:{}};function Tv(){return!1}var xv=Tv;WM.exports;(function(t,e){var o=N2,n=xv,a=e&&!e.nodeType&&e,p=a&&!0&&t&&!t.nodeType&&t,c=p&&p.exports===a,l=c?o.Buffer:void 0,M=l?l.isBuffer:void 0,g=M||n;t.exports=g})(WM,WM.exports);WM.exports;var mM={exports:{}};mM.exports;(function(t,e){var o=TA,n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,p=a&&a.exports===n,c=p&&o.process,l=function(){try{var M=a&&a.require&&a.require("util").types;return M||c&&c.binding&&c.binding("util")}catch{}}();t.exports=l})(mM,mM.exports);var Sv=mM.exports,tu=Sv;tu&&tu.isTypedArray;class ep extends Error{constructor(e){super(e),this.name="ValidationError",IO(e)}}class ga extends ep{missingFieldId;constructor(e,o){super(`
|
|
33
33
|
An expected field is missing from a dataSet.
|
|
34
34
|
|
|
35
35
|
Missing '${o}'. Got;
|
|
@@ -59,9 +59,9 @@ W0.version="2.30.1";Dv(U1);W0.fn=A0;W0.min=v_;W0.max=L_;W0.now=__;W0.utc=Ho;W0.u
|
|
|
59
59
|
|
|
60
60
|
Missing '${o}'. Got;
|
|
61
61
|
${JSON.stringify([...e].map(n=>n.id))}
|
|
62
|
-
`),this.name="DataSetNotFound"}}const uf=t=>{let e=[];if("measure"in t&&t.measure&&(e=[...e,...t.measure]),"xMeasure"in t&&Array.isArray(t.xMeasure)&&(e=[...e,...t.xMeasure]),"yMeasure"in t&&t.yMeasure&&(e=[...e,t.yMeasure]),"zMeasure"in t&&t.zMeasure){let o=Array.isArray(t.zMeasure)?t.zMeasure:[t.zMeasure];e=[...e,...o]}return e},Af=t=>{let e=[];return"dimension"in t&&t.dimension&&(e=[...e,...t.dimension]),"lineDimension"in t&&t.lineDimension&&(e=[...e,...t.lineDimension]),"barDimension"in t&&t.barDimension&&(e=[...e,...t.barDimension]),e},ml=t=>{let e=[];return uf(t).forEach(o=>{e=[...e,{fieldId:o.field,function:o.function,dataSetId:t.dataSetId}]}),Af(t).forEach(o=>{e=[...e,{fieldId:o.field,function:o.function,dataSetId:t.dataSetId}]}),"order"in t&&t.order&&(e=[...e,...[...t.order].map(o=>({fieldId:o.field,function:o.function,dataSetId:t.dataSetId}))]),"timeDimension"in t&&t.timeDimension&&(e=[...e,{fieldId:t.timeDimension.field,function:t.timeDimension.truncate,dataSetId:t.dataSetId}]),"parametersV2"in t&&(e=[...e,...(t.parametersV2?.fields||[]).map(o=>({fieldId:o.field,function:"none",dataSetId:t.dataSetId}))]),e},cT={allowUnknown:!0,stripUnknown:!0},j1=(t,e,o)=>{const{error:n}=fo(t.type,{queryEngineConfig:o}).schema.validate(t,cT);if(n)return[new Of(n)];const a=jo(e,t.dataSetId);if(!a)return[new lf(e,t.dataSetId)];const p=ml(t).map(c=>c.fieldId);try{p.forEach(c=>{ot(a,c)})}catch(c){if(c instanceof ga)return[c];throw c}return[]},w0=t=>t||`view_${hl()}`,zT=t=>t&&t.length>0?t.map(OT):t||[];function OT(t){const{parentDimension:e,...o}=t;return o}const lr=(t,e)=>{let o=null,n=_0.cloneDeep(t);return n.forEach(a=>{const p=ot(e,a.field);p.dataType=="date_time"&&(o={field:p.id,truncate:a.function})}),n=n.filter(a=>ot(e,a.field).dataType!="date_time"),{timeDimension:o,dimension:n}},mo=t=>{let e=[...t.dimension];return"timeDimension"in t&&t.timeDimension&&(e=[{field:t.timeDimension.field,function:t.timeDimension.truncate},...e]),e},qe={title:"Area chart",description:"Displays data as areas on a chart, useful for showing trends over time.",namespace:"area_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this area chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each area to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each area to represent? An example might be an employee ID to represent each employee.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this area chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this area chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},rich_text:{type:"richText",title:"Text format"},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},curve:{type:"curve",title:"Line Curve",description:"",namespace:"curve"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}};function P(t,e){return(n=>n in t.format_panel)(e)?{...t.format_panel[e],namespace:e}:{...t.data_panel[e],namespace:e}}function G1(t,e){return t.format_panel.axis_labels?.subSectionDefinition[e]}function S1(t){return{...P(t,"heading"),subSection:[t.format_panel.heading.subSectionDefinition.title,t.format_panel.heading.subSectionDefinition.subject]}}function ve(t){return{...P(t,"axis_labels"),dualAxes:{...G1(t,"dual_axes")},y:{...G1(t,"y"),prefix:G1(t,"y.prefix"),postfix:G1(t,"y.postfix"),format:G1(t,"y.format"),min:G1(t,"y.min"),max:G1(t,"y.max"),count:G1(t,"y.count"),axisTitle:G1(t,"y.axis_title")},yDual:{...G1(t,"yDual"),prefix:G1(t,"yDual.prefix"),postfix:G1(t,"yDual.postfix"),format:G1(t,"yDual.format"),min:G1(t,"yDual.min"),max:G1(t,"yDual.max"),count:G1(t,"yDual.count"),axisTitle:G1(t,"yDual.axis_title")},x:{...G1(t,"x"),prefix:G1(t,"x.prefix"),postfix:G1(t,"x.postfix"),format:G1(t,"x.format"),min:G1(t,"x.min"),max:G1(t,"x.max"),count:G1(t,"x.count"),axisTitle:G1(t,"x.axis_title")}}}function Ki(t,e,o,n){const a=n?[t.format_panel.chart_styles?.subSectionDefinition.legendSingleRow]:[];return e?{...P(t,"chart_styles"),subSection:[t.format_panel.chart_styles?.subSectionDefinition.curve,t.format_panel.chart_styles?.subSectionDefinition.legend,...a]}:o?{...P(t,"chart_styles"),subSection:[t.format_panel.chart_styles?.subSectionDefinition.stacked,t.format_panel.chart_styles?.subSectionDefinition.legend,...a]}:{...P(t,"chart_styles"),subSection:[t.format_panel.chart_styles?.subSectionDefinition.legend,...a]}}function ri(t,e){return{...t.format_panel.stats_labels?.subSectionDefinition[e],namespace:e}}const vo=(t,e)=>{if(t?.func==="current"&&e)return t};var f0=(t=>(t.Maths="maths",t.IfStatement="ifStatement",t.Aggregates="aggregates",t))(f0||{});const lT=Object.freeze({__proto__:null,AcceptedTypes:f0}),df=t=>({title:qe.title,description:qe.description,servicesClass:"AreaChart",namespace:qe.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),displayTitle:e.displayTitle,dimension:C1(e.dimension),timeDimension:e.timeDimension,displaySubject:e.displaySubject,viewId:w0(e.viewId),filter:X1(e.filter),order:te(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,offset:e.offset,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,lineCurve:e.lineCurve,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),protectedByOrganisation:e.protectedByOrganisation,stacked:e.stacked,drilldown:e.drilldown,legend:e.legend,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,goalLines:e.goalLines,parameters:Re(e.parameters),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),headline:vo(e.headline,e.timeDimension),tags:e.tags??[]}),setAttributes:Ey(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"areaChart",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,offset:0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0,headline:void 0,tags:[],...o}),createFeedback:ze,schema:NA(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"areaChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(qe,"data_set"),P(qe,"views"),{...P(qe,"field_y_axis"),fieldFilterOptions:{forComponent:"areaChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(qe,"field_x_axis"),fieldFilterOptions:{forComponent:"areaChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P(qe,"sort"),P(qe,"filter"),P(qe,"custom_metrics"),P(qe,"limit")],formatPanelConfig:()=>[S1(qe),{...P(qe,"chart_styles"),subSection:[qe.format_panel.chart_styles?.subSectionDefinition.stacked,qe.format_panel.chart_styles?.subSectionDefinition.legend,qe.format_panel.chart_styles?.subSectionDefinition.curve]},ve(qe),{...P(qe,"conditional_formatting"),ruleType:"areaColor"},P(qe,"goal_line"),P(qe,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}});var ws=(t=>(t.Forecast="Forecast",t.MovingAverage="Moving Average",t.Trend="Trend",t))(ws||{});const uT=u.object({type:u.string().valid(ws.Forecast),value:u.number()}),AT=u.object({type:u.string().valid(ws.Trend),value:u.number()}),dT=u.object({value:u.number().required()}),fT=u.object({type:u.string().valid(ws.MovingAverage),averages:u.array().items(dT).required()}),pp=()=>u.array().items(u.alternatives(uT,AT,fT)),ff=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions,["all70","all90"]),stacked:u.valid(!0,!1),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),type:u.valid("areaChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,lineCurve:Sy,conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp()}),qT=t=>(e,o)=>E1(e,o,ff(t)),xt=(t,e,o)=>{let n=_0.cloneDeep(Xi(e.fields,{onlyFieldTypes:["boolean","string"]})),a=_0.cloneDeep(Xi(e.fields,{onlyFieldTypes:["date_time"]})),p=_0.cloneDeep(Xi(e.fields,{onlyFieldTypes:["number"]})),c=null;return a[0]&&(c={field:a[0].id,truncate:"none"}),o(t,{protectedByOrganisation:!0,dimension:n.map(M=>({field:M.id,function:"none"})),measure:[...p].map(M=>({function:"none",field:M.id})),order:[],timeDimension:c})},Qe={title:"Area chart",description:"Ideal for illustrating changes and trends over time with area graphs.",namespace:"area_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this area chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each area to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this area chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each area to represent? An example might be a `product category` field to represent each category as a area.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this area chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this area chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},curve:{type:"curve",title:"Area Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headarea",description:""},trends:{type:"trends",title:"Trend lines",description:"Specify a trend type for the area chart."},goal_line:{type:"goalLine",title:"Goal lines",description:""}}},dt=(t,e,o)=>{if(e&&"fields"in e)return e;if(t)return{fields:_0.uniqBy([...du(t.group,o),...du(t.measure,o)],n=>n.field)}},du=(t,e)=>{const o=Object.keys(t||{}).map(a=>Ka(a,e).field),n=Object.values(t||{}).flatMap(a=>a?a.flatMap(p=>p&&"field"in p?[p.field]:[]):[]);return[...o,...n].map(a=>({field:a}))},qf=t=>({title:"Area chart",description:"Ideal for illustrating changes and trends over time with area graphs.",servicesClass:"AreaChart",namespace:"area_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,lineCurve:e.lineCurve,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,legendSingleRow:e.legendSingleRow,labels:e.labels,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[],stacked:e.stacked}),setAttributes:qT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"areaChartV2",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,legendSingleRow:!1,labels:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},parametersV2:void 0,axisTitles:void 0,headline:void 0,tags:[],trends:[],stacked:!1,...o}),createFeedback:ze,schema:ff(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"lineChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Qe,"data_set"),P(Qe,"views"),{...P(Qe,"field_y_axis"),fieldFilterOptions:{forComponent:"lineChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(Qe,"field_x_axis"),fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:2,testId:"add-dimension"},P(Qe,"sort"),P(Qe,"filter"),P(Qe,"custom_metrics"),P(Qe,"limit")],formatPanelConfig:()=>[S1(Qe),{...P(Qe,"chart_styles"),subSection:[Qe.format_panel.chart_styles?.subSectionDefinition.legend,Qe.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,Qe.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Qe),{...P(Qe,"conditional_formatting"),ruleType:"lineColor"},P(Qe,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}});function Cs(t){return u.array().items(u.object({field:u.string().required(),function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none")}))}const Xs=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),type:u.valid("barChart","horizontalBarChart","funnelChart").required(),conditionalFormattingRules:nt(t.queryEngineConfig),protectedFields:u.object({dimension:$O(t.queryEngineConfig),measure:ds(t.queryEngineConfig)}).unknown(!0),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),drilldownOptions:Cs(t.queryEngineConfig)}),hT=t=>(e,o)=>E1(e,o,Xs(t)),xe={title:"Column chart",description:"Uses bars to compare different sets of data.",namespace:"bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},hf=t=>({title:xe.title,description:xe.description,servicesClass:"BarChart",namespace:xe.namespace,dump:e=>e,load:e=>({...e,measure:c1(e.measure),order:te(e.order,e.timeDimension),filter:X1(e.filter),viewId:w0(e.viewId),dimension:C1(e.dimension),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),parameters:Re(e.parameters),conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),headline:vo(e.headline,e.timeDimension),tags:e.tags??[],drilldownOptions:e.drilldownOptions}),setAttributes:hT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"barChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],stacked:void 0,dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0,headline:void 0,tags:[],drilldownOptions:void 0,...o}),createFeedback:ze,schema:Xs(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"barChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(xe,"data_set"),P(xe,"views"),{...P(xe,"field_y_axis"),fieldFilterOptions:{forComponent:"barChart",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(xe,"field_x_axis"),fieldFilterOptions:{forComponent:"barChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P(xe,"sort"),P(xe,"filter"),{...P(xe,"drilldown"),options:{property:"drilldownOptions"}},P(xe,"custom_metrics"),P(xe,"limit")],formatPanelConfig:()=>[S1(xe),Ki(xe,!1,!0),ve(xe),{...P(xe,"conditional_formatting"),ruleType:"backgroundColor"},P(xe,"goal_line"),P(xe,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),WT=["grouped","stacked","stacked100","consolidated"],mT=t=>t==="100%"?"stacked100":t===!0?"stacked":"grouped",qa=({layout:t,stacked:e})=>{switch(t??mT(e)){case"stacked":return{layout:"stacked",stacked:!0};case"stacked100":return{layout:"stacked100",stacked:"100%"};case"consolidated":return{layout:"consolidated",stacked:!1};case"grouped":default:return{layout:"grouped",stacked:!1}}},gT=()=>({prefix:"",postfix:"",format:null,labelCount:"auto",min:null,max:null}),yT=t=>({prefix:t.yAxisPrefix,postfix:t.yAxisPostfix,format:t.yAxisFormat,labelCount:t.approxYAxisLabelCount,min:t.yAxisMin,max:t.yAxisMax}),RT=(t,e)=>{const o=e.reduce((n,a)=>{const p=t?.[a];return p&&(n[a]=p),n},{});return Object.keys(o).length>0?o:void 0},lM=(t,e)=>{const o={...t,...qa(t)};o.layout==="consolidated"?(o.isDualAxisEnabled=!1,o.goalLines=void 0):(o.layout!=="grouped"||o.measure.length!==2)&&(o.isDualAxisEnabled=!1);const n=o.measure.map(l=>Zn(l)),a=RT(o.consolidatedYAxisPreferencesByMetric,n);if(o.layout!=="consolidated")return o.consolidatedYAxisPreferencesByMetric=a,o;const p=!a&&e?.layout!=="consolidated",c={...a||{}};return n.forEach(l=>{c[l]||(c[l]=p?{...yT(o)}:gT())}),o.consolidatedYAxisPreferencesByMetric=Object.keys(c).length>0?c:void 0,o},vT=u.object({title:u.string().allow("").optional(),prefix:u.string().allow("").required(),postfix:u.string().allow("").required(),format:u.alternatives(u.string(),u.valid(null)).required(),labelCount:to.required(),min:u.number().allow(null).optional(),max:u.number().allow(null).optional()}),Wf=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions,["all70","all90"]),layout:u.valid(...WT).optional(),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),type:u.valid("barChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),isDualAxisEnabled:u.valid(!0,!1).optional(),parametersV2:At,consolidatedYAxisPreferencesByMetric:u.object().pattern(u.string(),vT).optional()}).custom((e,o)=>e.layout!=="consolidated"?e:e.goalLines!==void 0||e.isDualAxisEnabled===!0||e.stacked!==void 0&&e.stacked!==!1?o.error("any.invalid"):e),ke={title:"Bar chart",description:"Ideal for illustrating changes and trends over time with bar graphs.",namespace:"bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"},yDual:{title:"Y Dual Axis",description:"",namespace:"yDual"},"yDual.prefix":{title:"Prefix",description:"",namespace:"yDual.prefix"},"yDual.postfix":{title:"Postfix",description:"",namespace:"yDual.postfix"},"yDual.format":{title:"Format",description:"",namespace:"yDual.format"},"yDual.min":{title:"Minimum",description:"",namespace:"yDual.min"},"yDual.max":{title:"Maximum",description:"",namespace:"yDual.max"},"yDual.count":{title:"Label count",description:"",namespace:"yDual.count"},"yDual.axis_title":{title:"Title",description:"",namespace:"yDual.axis_title"},dual_axes:{title:"Enable Dual Axes"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:"",supportsTrendLine:!0}}},LT=t=>(e,o)=>{const n=Zu(o,e),a=lM({...n,...qa({layout:o.layout??(o.stacked===void 0?e.layout:void 0),stacked:o.layout===void 0?o.stacked??e.stacked:void 0}),updated_at:new Date().toISOString()},e),{value:p,error:c}=Wf(t).validate(a);if(c)throw c;return p},mf=t=>({title:"Bar chart",description:"Ideal for illustrating changes and trends over time with bar graphs.",servicesClass:"BarChart",namespace:"bar_chart",dump:e=>{const o=lM({...e,...qa(e)});return{...o,consolidatedYAxisPreferencesByMetric:o.layout==="consolidated"?o.consolidatedYAxisPreferencesByMetric:void 0}},load:e=>lM({type:e.type,updated_at:e.updated_at,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,yDualAxisFormat:e.yDualAxisFormat,yDualAxisPostfix:e.yDualAxisPostfix,yDualAxisPrefix:e.yDualAxisPrefix,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,yDualAxisMin:e.yDualAxisMin??null,yDualAxisMax:e.yDualAxisMax??null,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),legend:e.legend,legendSingleRow:e.legendSingleRow,labels:e.labels,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),approxDualYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],isDualAxisEnabled:e.isDualAxisEnabled,consolidatedYAxisPreferencesByMetric:e.consolidatedYAxisPreferencesByMetric,...qa({layout:e.layout,stacked:e.stacked})}),setAttributes:LT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>lM({type:"barChartV2",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),parametersV2:void 0,filter:[],order:[],dataSetId:e,limit:5e3,xAxisFormat:null,xAxisPostfix:"",xAxisPrefix:"",yAxisFormat:null,yAxisPostfix:"",yAxisPrefix:"",yDualAxisFormat:null,yDualAxisPostfix:"",yDualAxisPrefix:"",xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,yDualAxisMin:null,yDualAxisMax:null,conditionalFormattingRules:[],legend:!0,legendSingleRow:!1,labels:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],isDualAxisEnabled:!1,...qa({layout:o?.layout,stacked:o?.stacked}),...o}),createFeedback:ze,schema:Wf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"barChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(ke,"data_set"),P(ke,"views"),{...P(ke,"field_y_axis"),fieldFilterOptions:{forComponent:"barChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(ke,"field_x_axis"),fieldFilterOptions:{forComponent:"barChart",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:2,testId:"add-dimension"},P(ke,"sort"),P(ke,"filter"),P(ke,"custom_metrics"),P(ke,"limit")],formatPanelConfig:()=>[S1(ke),{...P(ke,"chart_styles"),subSection:[ke.format_panel.chart_styles?.subSectionDefinition.stacked,ke.format_panel.chart_styles?.subSectionDefinition.legend,ke.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,ke.format_panel.chart_styles?.subSectionDefinition.labels]},ve(ke),{...P(ke,"conditional_formatting"),ruleType:"backgroundColor"},P(ke,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)},parametersV2Sections:["field_y_axis","field_x_axis"]}),_T=u.object({field:u.string().required(),function:u.valid("none").required()}),gf=t=>u.object({...I1(t.attributesSchemaOptions),type:u.valid("basicTable").required(),measure:u.array().items(_T).required(),dimension:u.array().max(0),order:u.array().items(_2(t.queryEngineConfig)),timeDimension:u.valid(null),limit:io().required(),offset:u.number().min(0),filter:yo(t.queryEngineConfig),prefixes:u.array().items(_A),exportNames:u.object(),numberFormat:u.object(),conditionalFormattingRules:nt(t.queryEngineConfig),dateTimeFormat:u.string(),protectedFields:u.object({measure:ds(t.queryEngineConfig)}).unknown(!0),sizing:vA,tags:D1(),hiddenFields:u.array().items(u.string()),freezeHeaders:u.boolean().default(!1).description("Enable/disable sticky column headers.")}),eO=t=>(e,o)=>E1(e,o,gf(t)),Ze={title:"Basic table",description:"Displays data in a simple, straightforward table format.",namespace:"basic_table",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this basic table?"},views:{type:"views",title:"View",description:""},fields:{type:"fields",title:"Columns",description:"Select which values you want to see in this table"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this basic table."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},pagination:{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{type:"subject",title:"Subject",description:"",namespace:"subject"}}},format:{type:"format",title:"Format",description:"",subSectionDefinition:{time:{type:"time",title:"Time",description:"",namespace:"time"}}},prefixes:{type:"prefixes",title:"Prefixes",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},visual_format:{type:"visualFormat",title:"Visual Format",description:"Configure how group columns are visually represented"},kpi_summarisation:{type:"kpiSummarisation",title:"",description:"Show aggregate statistics above column headers"},freeze_headers:{type:"freezeHeaders",title:"",description:"Keep table headers visible while scrolling."}}},yf=[3,5,10,20,50,100,200],Rf=t=>({title:Ze.title,description:Ze.description,servicesClass:"BasicTable",namespace:Ze.namespace,dump:e=>e,load:e=>({...e,measure:c1(e.measure),order:te(e.order,e.timeDimension),filter:X1(e.filter),dimension:C1(e.dimension),viewId:w0(e.viewId),conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),tags:e.tags??[],hiddenFields:e.hiddenFields??[],freezeHeaders:e.freezeHeaders??!1}),setAttributes:eO(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:function(e,o){const n={type:"basicTable",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",filter:[],order:[],tags:[],hiddenFields:[],dataSetId:e,viewId:w0(o?.viewId),protectedFields:void 0,limit:50,offset:0,conditionalFormattingRules:[],prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{}};return eO(t)(n,o||{})},schema:gf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),setFields:function(e,o){const n=[...o].map(a=>({field:a,function:"none"}));return eO(t)(e,{measure:n})},setDateTimeFormat:function(e,o){return this.setAttributes(e,{dateTimeFormat:o})},isRunnable:e=>e.measure.length>0,autoGenerate(e){const n=[...Xi(e.fields,{forComponent:"basicTable",onlyMeasures:!0,removeAggregateMaths:!0,removePercentage:!0})].map(a=>({field:a.id,function:"none"}));return this.init(e.id,{measure:n.slice(0,5)})},dataPanelConfig:()=>[P(Ze,"data_set"),P(Ze,"views"),P(Ze,"fields"),P(Ze,"sort"),{...P(Ze,"pagination"),options:yf},P(Ze,"filter"),P(Ze,"custom_metrics")],formatPanelConfig:()=>[S1(Ze),P(Ze,"freeze_headers"),{...P(Ze,"format"),subSection:[Ze.format_panel.format?.subSectionDefinition.time]},P(Ze,"prefixes"),{...P(Ze,"conditional_formatting"),ruleType:"backgroundColor"}],supportedCustomFields:{percentages:!1,simpleMaths:!0,rules:!0,aggregateMaths:!1,roundedNumbers:!0,dateCalculations:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement]},supportedFeatures:{parameters:!1,colorGradient:!0}}),vf=t=>u.object({...I1(t.attributesSchemaOptions),xMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),yMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),zMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),order:u.array().items(_2(t.queryEngineConfig)),limit:io(),legend:u.valid(!0,!1),offset:u.number().min(0),filter:yo(t.queryEngineConfig),type:u.valid("bubbleChart").required(),timeDimension:u.valid(null),xAxisPrefix:u.string().allow(""),yAxisPrefix:u.string().allow(""),xAxisPostfix:u.string().allow(""),yAxisPostfix:u.string().allow(""),yAxisFormat:u.alternatives(u.string(),u.valid(null)),xAxisFormat:u.alternatives(u.string(),u.valid(null)),approxYAxisLabelCount:to,approxXAxisLabelCount:to,goalLines:Tt(),axisTitles:Pe(),tags:D1()}),NT=t=>(e,o)=>E1(e,o,vf(t)),Se={title:"Bubble chart",description:"Displays data points on a Cartesian plane, with a third metric corresponding to bubble size.",namespace:"bubble_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bubble chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"",subSectionDefinition:{xAxis:{type:"metrics",title:"X axis",namespace:"metrics.xAxis"},yAxis:{type:"metrics",title:"Y axis",namespace:"metrics.yAxis"},zAxis:{type:"metrics",title:"Metric - Bubble Size",namespace:"metrics.zAxis"}}},field_grouping:{type:"fieldCollector",title:"Grouping",description:"What do you want each bubble to represent?",callToAction:"Add comparison"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this bubble chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of data points shown on this bubble chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"},z:{title:"Metric - Bubble Size",description:"",namespace:"z"},"z.prefix":{title:"Prefix",description:"",namespace:"z.prefix"},"z.postfix":{title:"Postfix",description:"",namespace:"z.postfix"},"z.format":{title:"Format",description:"",namespace:"z.format"},"z.count":{title:"Label count",description:"",namespace:"z.count"},"z.axis_title":{title:"Title",description:"",namespace:"z.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},Lf=t=>({title:Se.title,description:Se.description,servicesClass:"BubbleChart",namespace:Se.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,xMeasure:c1(e.xMeasure?[e.xMeasure]:[])[0]||null,yMeasure:c1(e.yMeasure?[e.yMeasure]:[])[0]||null,zMeasure:c1(e.zMeasure?[e.zMeasure]:[])[0]||null,dimension:C1(e.dimension),viewId:w0(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:X1(e.filter),order:te(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,legend:e.legend,xAxisFormat:e.xAxisFormat,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),goalLines:e.goalLines,axisTitles:e.axisTitles,tags:e.tags??[]}),setAttributes:NT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"bubbleChart",xMeasure:null,yMeasure:null,zMeasure:null,dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,legend:!0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,axisTitles:void 0,tags:[],...o}),createFeedback:ze,schema:vf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>!!e.xMeasure&&!!e.yMeasure&&!!e.zMeasure&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"bubbleChart");return this.init(e.id,{xMeasure:o[0],yMeasure:o[1],dimension:n})},dataPanelConfig:()=>[P(Se,"data_set"),P(Se,"views"),{...P(Se,"labelled_metrics"),subSection:[{...Se.data_panel.labelled_metrics?.subSectionDefinition.xAxis,propKey:"xMeasure",allowsMultiple:!1},{...Se.data_panel.labelled_metrics?.subSectionDefinition.yAxis,propKey:"yMeasure",allowsMultiple:!1},{...Se.data_panel.labelled_metrics?.subSectionDefinition.zAxis,propKey:"zMeasure",allowsMultiple:!1}]},{...P(Se,"field_grouping"),fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["boolean","number","string"],removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(Se,"filter"),P(Se,"custom_metrics"),P(Se,"limit")],formatPanelConfig:()=>[S1(Se),{...P(Se,"chart_styles"),subSection:[Se.format_panel.chart_styles?.subSectionDefinition.legend]},ve(Se),P(Se,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),_f=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),zMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).required().description("A list of metrics that are to be shown. For example the `count` of a specific field in your data set."),xMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).required().description("A list of metrics that are to be shown. For example the `count` of a specific field in your data set."),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),type:u.valid("bubbleChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,lineCurve:Qa,quadrants:GO(),conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp()}),TT=t=>(e,o)=>E1(e,o,_f(t)),je={title:"Bubble chart",description:"Displays data points on a Cartesian plane, with a third metric corresponding to bubble size.",namespace:"bubble_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bubble chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bubble to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this line chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add metric"},field_z_axis:{type:"fieldCollector",title:"Metric - Bubble Size",description:"What do you want each bubble to represent? An example might be a `product category` field to represent each category as a bubble.",callToAction:"Add metric"},field_grouping:{type:"fieldCollector",title:"Grouping - Bubble series",description:"How do you want to group each bubble?",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bubble chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bubble chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},quadrants:{type:"quadrants",title:"",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},trends:{type:"trends",title:"Trend lines",description:"Specify a trend type for the line chart."},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},Nf=t=>({title:"Bubble chart",description:je.description,servicesClass:"BubbleChartV2",namespace:"bubble_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),zMeasure:c1(e.zMeasure),xMeasure:c1(e.xMeasure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,lineCurve:e.lineCurve,quadrants:e.quadrants,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,legendSingleRow:e.legendSingleRow,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[]}),setAttributes:TT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"bubbleChartV2",measure:[],zMeasure:[],xMeasure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,lineCurve:"natural",quadrants:void 0,conditionalFormattingRules:[],drilldown:[],legend:!0,legendSingleRow:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},parametersV2:void 0,axisTitles:void 0,headline:void 0,tags:[],trends:[],...o}),createFeedback:ze,schema:_f(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0&&e.xMeasure.length>0&&e.zMeasure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"bubbleChartV2");return this.init(e.id,{measure:[o[0]],dimension:n,zMeasure:[o[0]],xMeasure:[o[0]]})},dataPanelConfig:()=>[P(je,"data_set"),P(je,"views"),{...P(je,"field_y_axis"),fieldFilterOptions:{forComponent:"bubbleChartV2"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,maxAllowed:1,testId:"metric-input",propKey:"yMeasure"},{...P(je,"field_x_axis"),fieldFilterOptions:{forComponent:"bubbleChartV2",onlyMeasures:!0,onlyDimensions:!1},preSetPartialAttributes:e=>({xMeasure:[...e]}),getValues:e=>[...e.xMeasure],maxAllowed:1,testId:"x-metric-axis"},{...P(je,"field_z_axis"),fieldFilterOptions:{forComponent:"bubbleChartV2"},preSetPartialAttributes:e=>({zMeasure:[...e]}),getValues:e=>e.zMeasure,testId:"metric-input-z",maxAllowed:1,propKey:"zMeasure"},{...P(je,"field_grouping"),fieldFilterOptions:{forComponent:"bubbleChartV2",onlyDimensions:!0},preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:1,testId:"bubble-dimension"},P(je,"sort"),P(je,"filter"),P(je,"custom_metrics"),P(je,"limit")],formatPanelConfig:()=>[S1(je),Ki(je,!0,!1,!0),ve(je),P(je,"quadrants"),{...P(je,"conditional_formatting"),ruleType:"backgroundColor"},P(je,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_z_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Tf=t=>u.object({...I1(t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),barMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),lineMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),barDimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),lineDimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),order:u.array().items(_2(t.queryEngineConfig)),timeDimension:u.alternatives(ar(t.queryEngineConfig.supportedTimeTruncFunctions),u.valid(null)),limit:io(),offset:u.number().min(0),filter:yo(t.queryEngineConfig),type:u.valid("comboChart").required(),xAxisPrefix:u.string().allow(""),yAxisPrefix:u.string().allow(""),xAxisPostfix:u.string().allow(""),yAxisPostfix:u.string().allow(""),yAxisFormat:u.alternatives(u.string(),u.valid(null)),xAxisFormat:u.alternatives(u.string(),u.valid(null)),approxYAxisLabelCount:to,approxXAxisLabelCount:to,goalLines:Tt(),conditionalFormattingRules:u.object({bar:u.array().items(ma(t.queryEngineConfig)),line:u.array().items(ma(t.queryEngineConfig))}),axisTitles:Pe(),tags:D1()}),xT=t=>(e,o)=>E1(e,o,Tf(t));function xf(t,e,o){return{...t,lineMeasure:c1(t.lineMeasure),barMeasure:c1(t.barMeasure),order:te(t.order,t.timeDimension||null),filter:X1(t.filter),lineDimension:C1(t.lineDimension||t.dimension||[]),barDimension:C1(t.barDimension||t.dimension||[]),viewId:w0(t.viewId),approxXAxisLabelCount:o?Mi(t.approxXAxisLabelCount):A1(t.approxXAxisLabelCount),approxYAxisLabelCount:A1(t.approxYAxisLabelCount),xAxisMin:t.xAxisMin??null,xAxisMax:t.xAxisMax??null,yAxisMin:t.yAxisMin??null,yAxisMax:t.yAxisMax??null,yDualAxisMin:t.yDualAxisMin??null,yDualAxisMax:t.yDualAxisMax??null,conditionalFormattingRules:{bar:Nt(e,t.conditionalFormattingRules?.bar),line:Nt(e,t.conditionalFormattingRules?.line)},tags:t.tags??[]}}const re={title:"Combo chart",description:"A versatile component that combines different chart types.",namespace:"combo_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this combo chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"What do you want each line and bar to measure?",subSectionDefinition:{line:{type:"metrics",title:"Line",namespace:"metrics.line"},bar:{type:"metrics",title:"Bar",namespace:"metrics.bar"}}},combo_chart_dimension:{type:"comboChartDimension",title:"Grouping - X Axis",description:""},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this combo chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:"",subSectionDefinition:{bar:{title:"Bar",namespace:"bar"},line:{title:"Line",namespace:"line"}}}}},Sf=t=>({title:re.title,description:re.description,servicesClass:"ComboChart",namespace:re.namespace,dump:e=>e,load:e=>xf(e,t.queryEngineConfig,!1),setAttributes:xT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"comboChart",barMeasure:[],lineMeasure:[],lineDimension:[],barDimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",protectedByOrganisation:void 0,xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,conditionalFormattingRules:void 0,axisTitles:void 0,tags:[],...o}),createFeedback:ze,schema:Tf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.lineMeasure.length>0||e.barMeasure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"comboChart");return this.init(e.id,{barMeasure:[o[0]],lineMeasure:[o[1]||o[0]],barDimension:n,lineDimension:n})},dataPanelConfig:()=>[P(re,"data_set"),P(re,"views"),{...P(re,"labelled_metrics"),subSection:[{...re.data_panel.labelled_metrics?.subSectionDefinition.line,propKey:"lineMeasure",allowsMultiple:!0},{...re.data_panel.labelled_metrics?.subSectionDefinition.bar,propKey:"barMeasure",allowsMultiple:!0}]},P(re,"combo_chart_dimension"),P(re,"sort"),P(re,"filter"),P(re,"custom_metrics"),P(re,"limit")],formatPanelConfig:()=>[S1(re),Ki(re,!1,!0),ve(re),{...P(re,"conditional_formatting"),ruleType:"backgroundColor",subSection:[{title:re.format_panel.conditional_formatting?.subSectionDefinition?.bar.title??"",namespace:re.format_panel.conditional_formatting?.subSectionDefinition?.bar.namespace,propKey:"bar"},{title:re.format_panel.conditional_formatting?.subSectionDefinition?.line.title??"",namespace:re.format_panel.conditional_formatting?.subSectionDefinition?.line.namespace,propKey:"line"}]},P(re,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),Bf=t=>u.object({...I1(t.attributesSchemaOptions),stacked:u.valid(!0,!1),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),barMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),lineMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),barDimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),lineDimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),order:u.array().items(_2(t.queryEngineConfig)),timeDimension:u.alternatives(ar(t.queryEngineConfig.supportedTimeTruncFunctions),u.valid(null)),limit:io(),offset:u.number().min(0),filter:yo(t.queryEngineConfig),type:u.valid("comboChartV2").required(),xAxisPrefix:u.string().allow(""),yAxisPrefix:u.string().allow(""),xAxisPostfix:u.string().allow(""),yAxisPostfix:u.string().allow(""),yAxisFormat:u.alternatives(u.string(),u.valid(null)),yDualAxisPrefix:u.string().allow("").optional(),yDualAxisPostfix:u.string().allow("").optional(),yDualAxisFormat:u.alternatives(u.string(),u.valid(null)).optional(),xAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),xAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),yAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),yAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),yDualAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),yDualAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),xAxisFormat:u.alternatives(u.string(),u.valid(null)),approxYAxisLabelCount:to,approxDualYAxisLabelCount:to.optional(),approxXAxisLabelCount:jO(["all70","all90"]),goalLines:Tt(),conditionalFormattingRules:u.object({bar:u.array().items(ma(t.queryEngineConfig)),line:u.array().items(ma(t.queryEngineConfig))}),axisTitles:Pe(),tags:D1(),isDualAxisEnabled:u.valid(!0,!1).optional()}),ST=t=>(e,o)=>{let n=E1(e,o,Bf(t));return(e.barMeasure?.length!=1||e.lineMeasure?.length!=1)&&(n.isDualAxisEnabled=!1),n},k1={title:"Combo chart",description:"A versatile component that combines different chart types.",namespace:"combo_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this combo chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"What do you want each line and bar to measure?",subSectionDefinition:{line:{type:"metrics",title:"Line",namespace:"metrics.line"},bar:{type:"metrics",title:"Bar",namespace:"metrics.bar"}}},combo_chart_dimension:{type:"comboChartDimension",title:"Grouping - X Axis",description:""},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this combo chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"},yDual:{title:"Y Dual Axis",description:"",namespace:"yDual"},"yDual.prefix":{title:"Prefix",description:"",namespace:"yDual.prefix"},"yDual.postfix":{title:"Postfix",description:"",namespace:"yDual.postfix"},"yDual.format":{title:"Format",description:"",namespace:"yDual.format"},"yDual.min":{title:"Minimum",description:"",namespace:"yDual.min"},"yDual.max":{title:"Maximum",description:"",namespace:"yDual.max"},"yDual.count":{title:"Label count",description:"",namespace:"yDual.count"},"yDual.axis_title":{title:"Title",description:"",namespace:"yDual.axis_title"},dual_axes:{title:"Enable Dual Axes"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:"",subSectionDefinition:{bar:{title:"Bar",namespace:"bar"},line:{title:"Line",namespace:"line"}}}}},wf=t=>({title:k1.title,description:k1.description,servicesClass:"ComboChartV2",namespace:k1.namespace,dump:e=>e,load:e=>xf(e,t.queryEngineConfig,!0),setAttributes:ST(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"comboChartV2",barMeasure:[],lineMeasure:[],lineDimension:[],barDimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",protectedByOrganisation:void 0,xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,yDualAxisPostfix:"",yDualAxisPrefix:"",yDualAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,yDualAxisMin:null,yDualAxisMax:null,xAxisFormat:null,legend:!0,legendSingleRow:!1,labels:!1,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",approxDualYAxisLabelCount:"auto",goalLines:void 0,conditionalFormattingRules:void 0,axisTitles:void 0,tags:[],isDualAxisEnabled:!1,...o}),createFeedback:ze,schema:Bf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.lineMeasure.length>0||e.barMeasure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"comboChart");return this.init(e.id,{barMeasure:[o[0]],lineMeasure:[o[1]||o[0]],barDimension:n,lineDimension:n})},dataPanelConfig:()=>[P(k1,"data_set"),P(k1,"views"),{...P(k1,"labelled_metrics"),subSection:[{...k1.data_panel.labelled_metrics?.subSectionDefinition.line,propKey:"lineMeasure",allowsMultiple:!0},{...k1.data_panel.labelled_metrics?.subSectionDefinition.bar,propKey:"barMeasure",allowsMultiple:!0}]},P(k1,"combo_chart_dimension"),P(k1,"sort"),P(k1,"filter"),P(k1,"custom_metrics"),P(k1,"limit")],formatPanelConfig:()=>[S1(k1),{...P(k1,"chart_styles"),subSection:[k1.format_panel.chart_styles?.subSectionDefinition.stacked,k1.format_panel.chart_styles?.subSectionDefinition.legend,k1.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,k1.format_panel.chart_styles?.subSectionDefinition.labels]},ve(k1),{...P(k1,"conditional_formatting"),ruleType:"backgroundColor",subSection:[{title:k1.format_panel.conditional_formatting?.subSectionDefinition?.bar.title??"",namespace:k1.format_panel.conditional_formatting?.subSectionDefinition?.bar.namespace,propKey:"bar"},{title:k1.format_panel.conditional_formatting?.subSectionDefinition?.line.title??"",namespace:k1.format_panel.conditional_formatting?.subSectionDefinition?.line.namespace,propKey:"line"}]},P(k1,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),fu=t=>u.object({...I1(t.attributesSchemaOptions),type:u.valid("custom").required(),customViewId:u.string().required(),tags:D1()}),Hn={title:"Progress",description:"Used to show progress towards goals, completion of tasks, or as indicators of performance metrics.",namespace:"progress",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this progress?"},views:{type:"views",title:"View",description:""}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}}}},Cf=t=>({title:Hn.title,description:Hn.description,namespace:Hn.namespace,servicesClass:"Custom",dump:e=>e,load:e=>({type:"custom",updated_at:e.updated_at,viewId:w0(e.viewId),customViewId:e.customViewId,displayTitle:e.displayTitle,displaySubject:e.displaySubject,dataSetId:e.dataSetId,tags:e.tags??[],protectedByOrganisation:e.protectedByOrganisation}),setAttributes:(e,o)=>E1(e,o,fu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"custom",viewId:w0(o?.viewId),customViewId:o?.customViewId||"",dataSetId:e,displaySubject:"",displayTitle:"",tags:[],protectedByOrganisation:void 0}),schema:fu(t),removeField(e,o){return e},isRunnable:()=>!0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[P(Hn,"data_set"),P(Hn,"views")],formatPanelConfig:()=>[S1(Hn)],supportedCustomFields:{percentages:!1,simpleMaths:!1,rules:!1,aggregateMaths:!1,roundedNumbers:!1,dateCalculations:!1,conditional:!1,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{colorGradient:!1,parameters:!1}}),Xf=t=>u.object({...I1(t.attributesSchemaOptions),type:u.valid("dataTable").required(),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).required(),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions).required(),order:u.array().items(_2(t.queryEngineConfig)),timeDimension:u.alternatives(ar(t.queryEngineConfig.supportedTimeTruncFunctions),u.valid(null)),limit:io().required(),offset:u.number().min(0),filter:yo(t.queryEngineConfig),prefixes:u.array().items(_A),exportNames:u.object(),numberFormat:u.object(),conditionalFormattingRules:nt(t.queryEngineConfig),dateTimeFormat:u.string(),protectedFields:u.object({dimension:$O(t.queryEngineConfig),measure:ds(t.queryEngineConfig)}).unknown(!0),sizing:vA,tags:D1(),hiddenFields:u.array().items(u.string()),tableDrilldown:u.array().items(u.object({subsetDimension:u.string().required().description("The ID of the field in the data set to drill down by.")})).description("Drilldown configuration for a pivot table."),summarizeKPIs:u.boolean().default(!1).description("Enable/disable KPI summarisation above column headers."),showGroupTotals:u.boolean().default(!1).description("Enable/disable inline group total rows in pivot tables."),showSubGroupTotals:u.boolean().default(!1).description("Enable/disable inline sub-group total rows in pivot tables."),changePercent:u.alternatives(u.object({targetFieldId:u.string().required(),targetFunction:u.string().required(),sortDirection:u.valid("asc","desc").default("asc")}),u.valid(null)).optional().description("Merge the last grouping rows and show the % change of the target metric."),kpiSplitByGroup:u.alternatives(u.object({targetFieldId:u.string().required(),targetFunction:u.string().required(),sortDirection:u.valid("asc","desc").default("asc")}),u.valid(null)).optional().description("Split the KPI Summary values by an existing grouping."),freezeHeaders:u.boolean().default(!1).description("Enable/disable sticky column headers."),freezeGroupedRows:u.boolean().default(!1).description("Enable/disable sticky grouped row columns in pivot tables."),visualFormatColumns:u.array().items(u.object({field:u.string(),function:u.string()})).default([]).description("Array of metrics to display as horizontal bars."),results:u.array().items(u.object({content:u.array().required(),fields:u.array().items(u.object({id:u.string().required(),publicName:u.string().required(),dataType:u.string().required(),hidden:u.boolean(),fieldId:u.string().required(),function:u.string().required(),outputDataType:u.string().required()}).unknown(!0)).required(),hasMoreResults:u.alternatives([u.boolean(),u.valid(null)])}).unknown(!0)).description("Query results data structure containing fields and content."),parametersV2:At}),BT=t=>(e,o)=>{let n=E1(e,o,Xf(t));const a=e.measure.length,p=o.measure?.length;if(p===void 0?!1:a>p){const y=e.measure.filter(_=>!o.measure?.some(O=>O.field===_.field&&O.function===_.function));n.visualFormatColumns=(e.visualFormatColumns||[]).filter(_=>!y.some(d=>{const f=_.field,z=_.function;return d.field===f&&d.function===z}))}const l=(n.dimension??[]).filter(y=>y.pivot!=="y").length,M=l>0,g=M&&n.showGroupTotals&&l>1;if(M?g||(n.showSubGroupTotals=!1):(n.showGroupTotals=!1,n.showSubGroupTotals=!1),n.kpiSplitByGroup){const y=n.kpiSplitByGroup.targetFieldId,_=n.kpiSplitByGroup.targetFunction;(n.dimension??[]).some(d=>d.field===y&&d.function===_)||(n.kpiSplitByGroup=null)}return n},J1={title:"Pivot table",description:"Transforms data into a table with dynamic rows and columns.",namespace:"pivot_table",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this data table?"},views:{type:"views",title:"View",description:""},field_columns:{type:"fieldCollector",title:"Group columns",callToAction:"Add group column",description:""},field_rows:{type:"fieldCollector",title:"Group rows",description:"Which field do you want to group each row by? An example might be an employee ID or geographical location",callToAction:"Add group row"},drilldown:{type:"drilldown",title:"Drilldown",description:"Drilldowns in a pivot table reveals underlying data contributing to summarized figures upon clicking."},field_metrics:{type:"fieldCollector",title:"Metrics",description:"Select the columns to show in the data table",callToAction:"Add metric"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this data table."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},pagination:{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},kpi_summarisation:{type:"kpiSummarisation",title:"",description:"Show aggregate statistics above each column."},show_group_totals:{type:"showGroupTotals",title:"",description:"Show a total row after each group of values."},change_percent:{type:"changePercent",title:"Grouping Change %",description:"Compare the two rows in the last grouping level and show the % change for the selected metric;"},visual_format:{type:"visualFormat",title:"Visual Format",description:"Configure how the group column is displayed visually."},format:{type:"format",title:"Format",description:"",subSectionDefinition:{time:{type:"time",title:"Time",description:"",namespace:"time"}}},prefixes:{type:"prefixes",title:"Prefixes",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},freeze_headers:{type:"freezeHeaders",title:"",description:"Keep table headers visible while scrolling."},freeze_grouped_rows:{type:"freezeGroupedRows",title:"",description:"Keep grouped row columns pinned while scrolling horizontally."}}};function wT(t){return t.filter(o=>typeof o!="string")}const aM=(t,e)=>t.filter(o=>o.pivot==e),CT=t=>t.map(e=>({...e,pivot:e.pivot?e.pivot:"x"})),Ef=t=>({title:J1.title,description:J1.description,servicesClass:"PivotTable",namespace:J1.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension||null),displayTitle:e.displayTitle,dimension:CT(mo({timeDimension:e.timeDimension,dimension:C1(e.dimension)})),displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,protectedFields:e.protectedFields,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,offset:e.offset,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),dateTimeFormat:e.dateTimeFormat,prefixes:e.prefixes,exportNames:e.exportNames,numberFormat:e.numberFormat,sizing:e.sizing,tableDrilldown:zT(e.tableDrilldown),tags:e.tags??[],hiddenFields:e.hiddenFields??[],summarizeKPIs:e.summarizeKPIs??!1,showGroupTotals:e.showGroupTotals??!1,showSubGroupTotals:e.showSubGroupTotals??!1,changePercent:e.changePercent,kpiSplitByGroup:e.kpiSplitByGroup??null,freezeHeaders:e.freezeHeaders??!1,freezeGroupedRows:e.freezeGroupedRows??!1,parametersV2:typeof e.parametersV2=="boolean"?{fields:[]}:e.parametersV2||{fields:[]},visualFormatColumns:wT(e.visualFormatColumns??[])}),setAttributes:BT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"dataTable",measure:[],displayTitle:"",dimension:[],protectedByOrganisation:void 0,displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:50,offset:0,conditionalFormattingRules:[],protectedFields:void 0,prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{},tableDrilldown:[],tags:[],hiddenFields:[],summarizeKPIs:!1,showGroupTotals:!1,showSubGroupTotals:!1,visualFormatColumns:[],parametersV2:void 0,...o}),schema:Xf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"dataTable");return this.init(e.id,{measure:o.slice(0,5),dimension:n})},dataPanelConfig:()=>[P(J1,"data_set"),P(J1,"views"),{...P(J1,"field_columns"),fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o,n)=>({dimension:[...e.map(a=>({...a,pivot:"y"})),...aM(n.dimension,"x")]}),getValues:e=>aM(e.dimension,"y"),testId:"add-pivot-dimension"},{...P(J1,"field_rows"),fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o,n)=>({dimension:[...e.map(a=>({...a,pivot:"x"})),...aM(n.dimension,"y")]}),getValues:e=>aM(e.dimension,"x"),testId:"add-dimension"},{...P(J1,"field_metrics"),fieldFilterOptions:{forComponent:"dataTable"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},P(J1,"sort"),{...P(J1,"pagination"),options:yf},P(J1,"filter"),P(J1,"custom_metrics")],formatPanelConfig:()=>[S1(J1),P(J1,"freeze_headers"),P(J1,"freeze_grouped_rows"),P(J1,"kpi_summarisation"),P(J1,"show_group_totals"),P(J1,"change_percent"),P(J1,"visual_format"),{...P(J1,"format"),subSection:[J1.format_panel.format?.subSectionDefinition.time]},P(J1,"prefixes"),{...P(J1,"conditional_formatting"),ruleType:"backgroundColor"}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!0},parametersV2Sections:["field_rows","field_metrics"]}),Df=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),type:u.valid("barChart","horizontalBarChart","funnelChart").required(),conditionalFormattingRules:nt(t.queryEngineConfig),protectedFields:u.object({dimension:$O(t.queryEngineConfig),measure:ds(t.queryEngineConfig)}).unknown(!0),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),drilldownOptions:Cs(t.queryEngineConfig)}),XT=t=>(e,o)=>E1(e,o,Df(t)),Be={title:"Funnel chart",description:"Track conversion between stages of a process.",namespace:"funnel_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},If=t=>({title:Be.title,description:Be.description,servicesClass:"FunnelChart",namespace:Be.namespace,dump:e=>e,load:e=>({...e,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),viewId:w0(e.viewId),filter:X1(e.filter),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,tags:e.tags??[],labels:e.labels??!1,parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig)}),setAttributes:XT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"funnelChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],parameters:{},order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,legend:!0,labels:!1,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",axisTitles:void 0,tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:Df(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"funnelChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Be,"data_set"),P(Be,"views"),{...P(Be,"field_y_axis"),fieldFilterOptions:{forComponent:"funnelChart"},preSetPartialAttributes:e=>({measure:e}),allowsMultiple:!1,maxAllowed:1,getValues:e=>e.measure,testId:"metric-input"},{...P(Be,"field_x_axis"),fieldFilterOptions:{forComponent:"funnelChart",onlyDimensions:!0},allowsMultiple:!1,preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:1,testId:"add-dimension"},P(Be,"sort"),P(Be,"filter"),P(Be,"custom_metrics"),P(Be,"limit")],formatPanelConfig:()=>[S1(Be),{...P(Be,"chart_styles"),subSection:[Be.format_panel.chart_styles?.subSectionDefinition.legend,Be.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Be),{...P(Be,"conditional_formatting"),ruleType:"backgroundColor"},P(Be,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),ET=t=>(e,o)=>E1(e,o,Xs(t)),$e={title:"Horizontal bar chart",description:"Similar to a BarChart but with horizontal bars.",namespace:"horizontal_bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Pf=t=>({title:$e.title,description:$e.description,servicesClass:"HorizontalBarChart",namespace:$e.namespace,dump:e=>e,load:e=>({...e,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),viewId:w0(e.viewId),filter:X1(e.filter),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),tags:e.tags??[],parameters:Re(e.parameters)}),setAttributes:ET(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"horizontalBarChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,parameters:{},drilldown:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",axisTitles:void 0,tags:[],drilldownOptions:void 0,...o}),createFeedback:ze,schema:Xs(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"horizontalBarChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P($e,"data_set"),P($e,"views"),{...P($e,"field_y_axis"),fieldFilterOptions:{forComponent:"horizontalBarChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P($e,"field_x_axis"),fieldFilterOptions:{forComponent:"horizontalBarChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P($e,"sort"),P($e,"filter"),{...P($e,"drilldown"),options:{property:"drilldownOptions"}},P($e,"custom_metrics"),P($e,"limit")],formatPanelConfig:()=>[S1($e),Ki($e,!1,!0),ve($e),{...P($e,"conditional_formatting"),ruleType:"backgroundColor"},P($e,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Ff=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),type:u.valid("horizontalBarChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1()}),he={title:"Horizontal bar chart",description:"Ideal for illustrating changes and trends over time with bar graphs.",namespace:"horizontal_bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_x_axis:{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_y_axis:{type:"fieldCollector",title:"Grouping - Y Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},DT=t=>(e,o)=>E1(e,o,Ff(t)),kf=t=>({title:he.title,description:he.description,servicesClass:"HorizontalBarChart",namespace:he.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),legend:e.legend,legendSingleRow:e.legendSingleRow,labels:e.labels,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],stacked:e.stacked,parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig)}),setAttributes:DT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"horizontalBarChartV2",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,conditionalFormattingRules:[],legend:!0,legendSingleRow:!1,labels:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:Ff(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"barChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(he,"data_set"),P(he,"views"),{...P(he,"field_x_axis"),fieldFilterOptions:{forComponent:"horizontalBarChartV2"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(he,"field_y_axis"),fieldFilterOptions:{forComponent:"horizontalBarChartV2",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:(e,o,n)=>e.length===3&&(n.stacked===!1||n.stacked===void 0)?{dimension:[...e],stacked:!0}:{dimension:[...e]},getValues:e=>[...e.dimension],maxAllowed:3,testId:"add-dimension"},P(he,"sort"),P(he,"filter"),P(he,"custom_metrics"),P(he,"limit")],formatPanelConfig:()=>[S1(he),{...P(he,"chart_styles"),subSection:[he.format_panel.chart_styles?.subSectionDefinition.stacked,he.format_panel.chart_styles?.subSectionDefinition.legend,he.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,he.format_panel.chart_styles?.subSectionDefinition.labels],labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}},ve(he),{...P(he,"conditional_formatting"),ruleType:"backgroundColor"},P(he,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_x_axis","field_y_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),jf=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),type:u.valid("lineChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),lineCurve:Qa,conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp()}),IT=t=>(e,o)=>E1(e,o,jf(t)),ct={title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",namespace:"line_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this line chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this line chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this line chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this line chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},trends:{type:"trends",title:"Trend lines",description:"Specify a trend type for the line chart."},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},$f=t=>({title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",servicesClass:"LineChart",namespace:"line_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,lineCurve:e.lineCurve,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[]}),setAttributes:IT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"lineChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],trends:[],...o}),createFeedback:ze,schema:jf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"lineChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(ct,"data_set"),P(ct,"views"),{...P(ct,"field_y_axis"),fieldFilterOptions:{forComponent:"lineChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(ct,"field_x_axis"),fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P(ct,"sort"),P(ct,"filter"),P(ct,"custom_metrics"),P(ct,"limit")],formatPanelConfig:()=>[S1(ct),Ki(ct,!0,!1),ve(ct),{...P(ct,"conditional_formatting"),ruleType:"lineColor"},P(ct,"goal_line"),P(ct,"trends"),P(ct,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Gf=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions,["all70","all90"]),aggregateMetricGroup:u.valid(!0,!1).optional(),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),type:u.valid("lineChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,lineCurve:Qa,conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp(),isDualAxisEnabled:u.valid(!0,!1).optional()}),PT=t=>(e,o)=>{let n=E1(e,o,Gf(t));return e.measure?.length!==2&&(n.isDualAxisEnabled=!1),n},Ge={title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",namespace:"line_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this line chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this line chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this line chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this line chart."},aggregate_metric_group:{type:"aggregateMetricGroup",title:"Aggregate metric group",description:"Check to plot raw data points for visualizing curves. By default, data is summarized for better performance."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"},yDual:{title:"Y Dual Axis",description:"",namespace:"yDual"},"yDual.prefix":{title:"Prefix",description:"",namespace:"yDual.prefix"},"yDual.postfix":{title:"Postfix",description:"",namespace:"yDual.postfix"},"yDual.format":{title:"Format",description:"",namespace:"yDual.format"},"yDual.min":{title:"Minimum",description:"",namespace:"yDual.min"},"yDual.max":{title:"Maximum",description:"",namespace:"yDual.max"},"yDual.count":{title:"Label count",description:"",namespace:"yDual.count"},"yDual.axis_title":{title:"Title",description:"",namespace:"yDual.axis_title"},dual_axes:{title:"Enable Dual Axes"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},trends:{type:"trends",title:"Trend lines",description:"Specify a trend type for the line chart."},goal_line:{type:"goalLine",title:"Goal Lines",description:"",supportsTrendLine:!0}}},Uf=t=>({title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",servicesClass:"LineChart",namespace:"line_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisFormat:e.xAxisFormat,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yDualAxisFormat:e.yDualAxisFormat,yDualAxisPostfix:e.yDualAxisPostfix,yDualAxisPrefix:e.yDualAxisPrefix,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,yDualAxisMin:e.yDualAxisMin??null,yDualAxisMax:e.yDualAxisMax??null,lineCurve:e.lineCurve,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,legendSingleRow:e.legendSingleRow,labels:e.labels,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),approxDualYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[],isDualAxisEnabled:e.isDualAxisEnabled??!1,aggregateMetricGroup:e.aggregateMetricGroup??!1}),setAttributes:PT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"lineChartV2",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisFormat:null,xAxisPostfix:"",xAxisPrefix:"",yAxisFormat:null,yAxisPostfix:"",yAxisPrefix:"",yDualAxisFormat:null,yDualAxisPostfix:"",yDualAxisPrefix:"",xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,yDualAxisMin:null,yDualAxisMax:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,legendSingleRow:!1,labels:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],trends:[],isDualAxisEnabled:!1,aggregateMetricGroup:!1,parametersV2:void 0,...o}),createFeedback:ze,schema:Gf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"lineChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Ge,"data_set"),P(Ge,"views"),{...P(Ge,"field_y_axis"),fieldFilterOptions:{forComponent:"lineChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(Ge,"field_x_axis"),fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:2,testId:"add-dimension"},P(Ge,"sort"),P(Ge,"filter"),P(Ge,"custom_metrics"),P(Ge,"limit"),P(Ge,"aggregate_metric_group")],formatPanelConfig:()=>[S1(Ge),{...P(Ge,"chart_styles"),subSection:[Ge.format_panel.chart_styles?.subSectionDefinition.legend,Ge.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,Ge.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Ge),{...P(Ge,"conditional_formatting"),ruleType:"lineColor"},P(Ge,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Vf=t=>u.object({...I1(t.attributesSchemaOptions),type:u.valid("mercatorMap").required(),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),filter:yo(t.queryEngineConfig),limit:io(),dimension:lt({},t.attributesSchemaOptions),labelFormat:u.alternatives(u.string(),u.valid(null)),noDataColor:u.string().required(),backgroundColor:u.string().required(),maxValueColor:u.string().required(),minValueColor:u.string().required(),position:u.object({scale:u.number(),centerX:u.number(),centerY:u.number()}),tags:D1()}),FT=t=>(e,o)=>E1(e,o,Vf(t)),vt={title:"Country map",description:"A map component based on the Mercator projection, suitable for geographical data visualization.",namespace:"mercator_map",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use for this map?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want to show?",callToAction:"Add metric"},field_country:{type:"fieldCollector",title:"Country",description:"Which field contains the country code required to group results on?",callToAction:"Set country"},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use on this map."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this map."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Map Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Value format",description:"",namespace:"number_format"}}},map_colors:{type:"mapColors",title:"Map colors",description:""}}},Hf=t=>({title:vt.title,description:vt.description,servicesClass:"MercatorMap",namespace:vt.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,dataSetId:e.dataSetId,displaySubject:e.displaySubject,displayTitle:e.displayTitle,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),type:"mercatorMap",dimension:e.dimension,limit:e.limit,measure:c1(e.measure),labelFormat:e.labelFormat,position:e.position,filter:X1(e.filter),noDataColor:e.noDataColor||"#ffffff",backgroundColor:e.backgroundColor||"#EFF5F6",maxValueColor:e.maxValueColor||"#000000",minValueColor:e.minValueColor||"#e0e0e0",tags:e.tags??[]}),setAttributes:FT(t),validate:()=>[],init:(e,o)=>({type:"mercatorMap",dataSetId:e,dimension:[],measure:[],displaySubject:"",displayTitle:"",limit:5e3,filter:[],viewId:w0(o?.viewId),labelFormat:null,noDataColor:"#ffffff",backgroundColor:"#EFF5F6",maxValueColor:"#000000",minValueColor:"#e0e0e0",tags:[],...o}),schema:Vf(t),removeField(e,o){return e},isRunnable:e=>!!(e.dimension&&e.dimension[0]&&e.measure&&e.measure[0]),autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[P(vt,"data_set"),P(vt,"views"),{...P(vt,"field_metrics"),type:"fieldCollector",fieldFilterOptions:{forComponent:"mercatorMap"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(vt,"field_country"),fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["string"],removeRuleGrouping:!1,removeSimpleMaths:!0,removePercentage:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(vt,"filter"),P(vt,"custom_metrics"),P(vt,"limit")],formatPanelConfig:()=>[S1(vt),{...P(vt,"chart_styles"),subSection:[vt.format_panel.chart_styles?.subSectionDefinition.number_format]},P(vt,"map_colors")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),qu=t=>u.object({...I1(t.attributesSchemaOptions),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),filter:yo(t.queryEngineConfig),timeDimension:u.valid(null),order:u.array().items(_2(t.queryEngineConfig)),type:u.valid("pieChart").required(),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),limit:io(),labelsAsPercentage:u.boolean(),conditionalFormattingRules:nt(t.queryEngineConfig),labelFormat:u.alternatives(u.string(),u.valid(null)),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,tags:D1(),drilldownOptions:Cs(t.queryEngineConfig)}),we={title:"Pie chart",description:"Represents data in a circular pie-like format, useful for showing proportions.",namespace:"pie_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this pie chart?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want each segment to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_grouping:{type:"fieldCollector",title:"Grouping",description:"How do you want to split each section of the pie chart?",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Choose the order of segments in the pie chart"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this pie chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of segments shown on this pie chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Format",description:"",namespace:"number_format"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Yf=t=>({title:we.title,description:we.description,servicesClass:"PieChart",namespace:we.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),viewId:w0(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),labelsAsPercentage:e.labelsAsPercentage,legend:e.legend,labels:e.labels,labelFormat:e.labelFormat,parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),tags:e.tags??[],drilldownOptions:e.drilldownOptions}),setAttributes:(e,o)=>E1(e,o,qu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"pieChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],labelsAsPercentage:!1,legend:!0,labels:!1,labelFormat:null,parameters:{},tags:[],drilldownOptions:void 0,parametersV2:void 0,...o}),createFeedback:ze,schema:qu(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"pieChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(we,"data_set"),P(we,"views"),{...P(we,"field_metrics"),fieldFilterOptions:{forComponent:"pieChart"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(we,"field_grouping"),fieldFilterOptions:{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(we,"sort"),P(we,"filter"),{...P(we,"drilldown"),options:{property:"drilldownOptions"}},P(we,"custom_metrics"),P(we,"limit")],formatPanelConfig:()=>[S1(we),{...P(we,"conditional_formatting"),ruleType:"backgroundColor"},{...P(we,"chart_styles"),subSection:[we.format_panel.chart_styles?.subSectionDefinition.legend,we.format_panel.chart_styles?.subSectionDefinition.labels,we.format_panel.chart_styles?.subSectionDefinition.number_format]}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},parametersV2Sections:["field_metrics","field_grouping"],supportedFeatures:{parameters:"v2",colorGradient:!1}});var hu;(t=>{(e=>{e.ASC="asc",e.DESC="desc"})(t.SortDirection||(t.SortDirection={}))})(hu||(hu={}));var _O=(t=>(t.Linear="linear",t.Circular="circular",t))(_O||{});const Wu=t=>u.object({...I1(t.attributesSchemaOptions),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),filter:yo(t.queryEngineConfig),type:u.valid("progress").required(),limit:io(),conditionalFormattingRules:nt(t.queryEngineConfig),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),goals:u.array().items(u.object({field:u.string().required().description("ID of the field in the data set to which the goal applies too"),value:u.number().required().description("Value of which the goal is set")})).description("Set the target value that progression is shown towards."),progressType:u.array().items(u.object({field:u.string().required().description("ID of the field to set the progress type of"),value:u.valid(_O.Linear,_O.Circular).required()})).description("Set the display type of the progress view"),formatter:u.object().pattern(u.string(),u.string()),prefixes:u.object().pattern(u.string(),u.string()),postfixes:u.object().pattern(u.string(),u.string()),tags:D1()}),Kf=(t,e)=>{if("singleMeasure"in t){let o={},n={},a=[],p={};return t.singleMeasure&&(a=[t.singleMeasure],o[Zn(t.singleMeasure)]=t.prefix,n[Zn(t.singleMeasure)]=t.postfix,p[Zn(t.singleMeasure)]=t.formatter),{type:"singleStat",prefixes:o,postfixes:n,measure:a,formatter:p,fontSize:t.fontSize,displayTitle:t.displayTitle,displaySubject:t.displaySubject,tags:t.tags,filter:X1(t.filter),dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:t.conditionalFormattingRules,deltaTimeDimension:t.deltaTimeDimension,parameters:Re(t.parameters),parametersV2:dt(t.parameters,t.parametersV2,e)}}else return{...t,filter:X1(t.filter)}},zt={title:"Progress",description:"Used to show progress towards goals, completion of tasks, or as indicators of performance metrics.",namespace:"progress",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this progress?"},views:{type:"views",title:"View",description:""},progress_goals:{type:"progressGoals",title:"Metric",description:"What do you want to show in each progress bar?"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this progress chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},stats_labels:{type:"statsLabels",title:"Labels",description:"",subSectionDefinition:{prefix:{title:"Prefix",description:"",namespace:"prefix"},postfix:{title:"Postfix",description:"",namespace:"postfix"},format:{title:"Format",description:"",namespace:"format"},count:{title:"Label count",description:"",namespace:"count"}}},progress_type:{type:"progressType",title:"Type",description:""}}},Qf=t=>({title:zt.title,description:zt.description,dump:e=>e,namespace:zt.namespace,servicesClass:"Progress",load:e=>{const o=Kf(e,t.queryEngineConfig);return{type:"progress",updated_at:o.updated_at,measure:c1(o.measure),displayTitle:o.displayTitle,displaySubject:o.displaySubject,protectedByOrganisation:o.protectedByOrganisation,viewId:w0(o.viewId),filter:o.filter,dataSetId:o.dataSetId,limit:o.limit,conditionalFormattingRules:o.conditionalFormattingRules,parameters:o.parameters,prefixes:o.prefixes,postfixes:o.postfixes,formatter:o.formatter,goals:o.goals,progressType:o.progressType,tags:o.tags??[]}},setAttributes:(e,o)=>E1(e,o,Wu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"progress",measure:[],displayTitle:"",protectedByOrganisation:void 0,displaySubject:"",viewId:w0(o?.viewId),filter:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],parameters:{},formatter:{},progressType:[],goals:[],postfixes:{},prefixes:{},tags:[],...o}),schema:Wu(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[P(zt,"data_set"),P(zt,"views"),P(zt,"progress_goals"),P(zt,"filter"),P(zt,"custom_metrics")],formatPanelConfig:()=>[S1(zt),P(zt,"progress_type"),{...P(zt,"stats_labels"),prefix:ri(zt,"prefix"),postfix:ri(zt,"postfix"),format:ri(zt,"format"),count:ri(zt,"count")}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),Zf=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),type:u.valid("radarChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,axisTitles:Pe(),headline:jt(),tags:D1()}),kT=t=>(e,o)=>E1(e,o,Zf(t)),Lt={title:"Radar chart",description:"Visualizes multiple variables as points on axes starting from the same center point, creating a spider web-like shape. Perfect for comparing strengths and weaknesses across multiple dimensions or showing performance metrics across different categories.",namespace:"radar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this radar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this radar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this radar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"Grouping - X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},y:{title:"Metric - Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"}}}}},Jf=t=>({title:Lt.title,description:Lt.description,servicesClass:"RadarChart",namespace:Lt.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),legend:e.legend,legendSingleRow:e.legendSingleRow,tags:e.tags??[],parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig)}),setAttributes:kT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"radarChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,legendSingleRow:!1,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:Zf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"radarChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Lt,"data_set"),P(Lt,"views"),{...P(Lt,"field_y_axis"),fieldFilterOptions:{forComponent:"radarChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(Lt,"field_x_axis"),fieldFilterOptions:{forComponent:"radarChart",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:1,testId:"add-dimension"},P(Lt,"sort"),P(Lt,"filter"),P(Lt,"custom_metrics"),P(Lt,"limit")],formatPanelConfig:()=>[S1(Lt),Ki(Lt,!1,!1,!0),ve(Lt)],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),eq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),type:u.valid("richText").required(),tags:D1(),content:u.any()}),jT=t=>(e,o)=>E1(e,o,eq(t)),Pt={title:"Rich text",description:"Add your data to a rich text component.",namespace:"rich_text",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this rich text view?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metrics",description:"What metrics do you need to collect?",callToAction:"Add metric"},field_grouping:{type:"fieldCollector",title:"Grouping",description:"How do you want to group your results?",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"How should the results be ordered?"},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this text view."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to use on this text view."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},rich_text:{type:"richText",title:"Text format",description:""}}},$T={type:"doc",content:[{type:"heading",attrs:{level:1},content:[{type:"text",text:"Rich text views"}]},{type:"paragraph",content:[{type:"text",text:"In this view, you can add any "},{type:"text",marks:[{type:"bold"}],text:"text based content"},{type:"text",text:" to your dashboard, and "},{type:"text",marks:[{type:"italic"}],text:"mix in your data with it!"}]},{type:"paragraph",content:[{type:"text",text:"Remember to use the "},{type:"text",marks:[{type:"bold"}],text:"format"},{type:"text",text:" "},{type:"text",marks:[{type:"bold"}],text:"tab"},{type:"text",text:" to "},{type:"text",marks:[{type:"underline"}],text:"style"},{type:"text",text:" your contents"}]},{type:"heading",attrs:{level:2},content:[{type:"text",text:"Adding data?"}]},{type:"paragraph",content:[{type:"text",text:"You can add data to your text content by using templating. For example, is how to take metrics "},{type:"text",marks:[{type:"code"}],text:'"Metric Name"'},{type:"text",text:" and "},{type:"text",marks:[{type:"code"}],text:'"A different metric name" '},{type:"text",text:"from the first row of the results, and show it on this view;"}]},{type:"codeBlock",attrs:{language:null},content:[{type:"text",text:`{{ data.first.metric_name }}
|
|
62
|
+
`),this.name="DataSetNotFound"}}const uf=t=>{let e=[];if("measure"in t&&t.measure&&(e=[...e,...t.measure]),"xMeasure"in t&&Array.isArray(t.xMeasure)&&(e=[...e,...t.xMeasure]),"yMeasure"in t&&t.yMeasure&&(e=[...e,t.yMeasure]),"zMeasure"in t&&t.zMeasure){let o=Array.isArray(t.zMeasure)?t.zMeasure:[t.zMeasure];e=[...e,...o]}return e},Af=t=>{let e=[];return"dimension"in t&&t.dimension&&(e=[...e,...t.dimension]),"lineDimension"in t&&t.lineDimension&&(e=[...e,...t.lineDimension]),"barDimension"in t&&t.barDimension&&(e=[...e,...t.barDimension]),e},ml=t=>{let e=[];return uf(t).forEach(o=>{e=[...e,{fieldId:o.field,function:o.function,dataSetId:t.dataSetId}]}),Af(t).forEach(o=>{e=[...e,{fieldId:o.field,function:o.function,dataSetId:t.dataSetId}]}),"order"in t&&t.order&&(e=[...e,...[...t.order].map(o=>({fieldId:o.field,function:o.function,dataSetId:t.dataSetId}))]),"timeDimension"in t&&t.timeDimension&&(e=[...e,{fieldId:t.timeDimension.field,function:t.timeDimension.truncate,dataSetId:t.dataSetId}]),"parametersV2"in t&&(e=[...e,...(t.parametersV2?.fields||[]).map(o=>({fieldId:o.field,function:"none",dataSetId:t.dataSetId}))]),e},cT={allowUnknown:!0,stripUnknown:!0},j1=(t,e,o)=>{const{error:n}=fo(t.type,{queryEngineConfig:o}).schema.validate(t,cT);if(n)return[new Of(n)];const a=jo(e,t.dataSetId);if(!a)return[new lf(e,t.dataSetId)];const p=ml(t).map(c=>c.fieldId);try{p.forEach(c=>{ot(a,c)})}catch(c){if(c instanceof ga)return[c];throw c}return[]},w0=t=>t||`view_${hl()}`,zT=t=>t&&t.length>0?t.map(OT):t||[];function OT(t){const{parentDimension:e,...o}=t;return o}const lr=(t,e)=>{let o=null,n=_0.cloneDeep(t);return n.forEach(a=>{const p=ot(e,a.field);p.dataType=="date_time"&&(o={field:p.id,truncate:a.function})}),n=n.filter(a=>ot(e,a.field).dataType!="date_time"),{timeDimension:o,dimension:n}},mo=t=>{let e=[...t.dimension];return"timeDimension"in t&&t.timeDimension&&(e=[{field:t.timeDimension.field,function:t.timeDimension.truncate},...e]),e},qe={title:"Area chart",description:"Displays data as areas on a chart, useful for showing trends over time.",namespace:"area_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this area chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each area to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each area to represent? An example might be an employee ID to represent each employee.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this area chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this area chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},rich_text:{type:"richText",title:"Text format"},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},curve:{type:"curve",title:"Line Curve",description:"",namespace:"curve"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}};function P(t,e){return(n=>n in t.format_panel)(e)?{...t.format_panel[e],namespace:e}:{...t.data_panel[e],namespace:e}}function G1(t,e){return t.format_panel.axis_labels?.subSectionDefinition[e]}function S1(t){return{...P(t,"heading"),subSection:[t.format_panel.heading.subSectionDefinition.title,t.format_panel.heading.subSectionDefinition.subject]}}function ve(t){return{...P(t,"axis_labels"),dualAxes:{...G1(t,"dual_axes")},y:{...G1(t,"y"),prefix:G1(t,"y.prefix"),postfix:G1(t,"y.postfix"),format:G1(t,"y.format"),min:G1(t,"y.min"),max:G1(t,"y.max"),count:G1(t,"y.count"),axisTitle:G1(t,"y.axis_title")},yDual:{...G1(t,"yDual"),prefix:G1(t,"yDual.prefix"),postfix:G1(t,"yDual.postfix"),format:G1(t,"yDual.format"),min:G1(t,"yDual.min"),max:G1(t,"yDual.max"),count:G1(t,"yDual.count"),axisTitle:G1(t,"yDual.axis_title")},x:{...G1(t,"x"),prefix:G1(t,"x.prefix"),postfix:G1(t,"x.postfix"),format:G1(t,"x.format"),min:G1(t,"x.min"),max:G1(t,"x.max"),count:G1(t,"x.count"),axisTitle:G1(t,"x.axis_title")}}}function Ki(t,e,o,n){const a=n?[t.format_panel.chart_styles?.subSectionDefinition.legendSingleRow]:[];return e?{...P(t,"chart_styles"),subSection:[t.format_panel.chart_styles?.subSectionDefinition.curve,t.format_panel.chart_styles?.subSectionDefinition.legend,...a]}:o?{...P(t,"chart_styles"),subSection:[t.format_panel.chart_styles?.subSectionDefinition.stacked,t.format_panel.chart_styles?.subSectionDefinition.legend,...a]}:{...P(t,"chart_styles"),subSection:[t.format_panel.chart_styles?.subSectionDefinition.legend,...a]}}function ri(t,e){return{...t.format_panel.stats_labels?.subSectionDefinition[e],namespace:e}}const vo=(t,e)=>{if(t?.func==="current"&&e)return t};var f0=(t=>(t.Maths="maths",t.IfStatement="ifStatement",t.Aggregates="aggregates",t))(f0||{});const lT=Object.freeze({__proto__:null,AcceptedTypes:f0}),df=t=>({title:qe.title,description:qe.description,servicesClass:"AreaChart",namespace:qe.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),displayTitle:e.displayTitle,dimension:C1(e.dimension).dimension,timeDimension:e.timeDimension,displaySubject:e.displaySubject,viewId:w0(e.viewId),filter:X1(e.filter),order:te(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,offset:e.offset,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,lineCurve:e.lineCurve,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),protectedByOrganisation:e.protectedByOrganisation,stacked:e.stacked,drilldown:e.drilldown,legend:e.legend,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,goalLines:e.goalLines,parameters:Re(e.parameters),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),headline:vo(e.headline,e.timeDimension),tags:e.tags??[]}),setAttributes:Ey(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"areaChart",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,offset:0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0,headline:void 0,tags:[],...o}),createFeedback:ze,schema:NA(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"areaChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(qe,"data_set"),P(qe,"views"),{...P(qe,"field_y_axis"),fieldFilterOptions:{forComponent:"areaChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(qe,"field_x_axis"),fieldFilterOptions:{forComponent:"areaChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P(qe,"sort"),P(qe,"filter"),P(qe,"custom_metrics"),P(qe,"limit")],formatPanelConfig:()=>[S1(qe),{...P(qe,"chart_styles"),subSection:[qe.format_panel.chart_styles?.subSectionDefinition.stacked,qe.format_panel.chart_styles?.subSectionDefinition.legend,qe.format_panel.chart_styles?.subSectionDefinition.curve]},ve(qe),{...P(qe,"conditional_formatting"),ruleType:"areaColor"},P(qe,"goal_line"),P(qe,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}});var ws=(t=>(t.Forecast="Forecast",t.MovingAverage="Moving Average",t.Trend="Trend",t))(ws||{});const uT=u.object({type:u.string().valid(ws.Forecast),value:u.number()}),AT=u.object({type:u.string().valid(ws.Trend),value:u.number()}),dT=u.object({value:u.number().required()}),fT=u.object({type:u.string().valid(ws.MovingAverage),averages:u.array().items(dT).required()}),pp=()=>u.array().items(u.alternatives(uT,AT,fT)),ff=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions,["all70","all90"]),stacked:u.valid(!0,!1),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),type:u.valid("areaChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,lineCurve:Sy,conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp()}),qT=t=>(e,o)=>E1(e,o,ff(t)),xt=(t,e,o)=>{let n=_0.cloneDeep(Xi(e.fields,{onlyFieldTypes:["boolean","string"]})),a=_0.cloneDeep(Xi(e.fields,{onlyFieldTypes:["date_time"]})),p=_0.cloneDeep(Xi(e.fields,{onlyFieldTypes:["number"]})),c=null;return a[0]&&(c={field:a[0].id,truncate:"none"}),o(t,{protectedByOrganisation:!0,dimension:n.map(M=>({field:M.id,function:"none"})),measure:[...p].map(M=>({function:"none",field:M.id})),order:[],timeDimension:c})},Qe={title:"Area chart",description:"Ideal for illustrating changes and trends over time with area graphs.",namespace:"area_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this area chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each area to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this area chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each area to represent? An example might be a `product category` field to represent each category as a area.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this area chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this area chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},curve:{type:"curve",title:"Area Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headarea",description:""},trends:{type:"trends",title:"Trend lines",description:"Specify a trend type for the area chart."},goal_line:{type:"goalLine",title:"Goal lines",description:""}}},dt=(t,e,o)=>{if(e&&"fields"in e)return e;if(t)return{fields:_0.uniqBy([...du(t.group,o),...du(t.measure,o)],n=>n.field)}},du=(t,e)=>{const o=Object.keys(t||{}).map(a=>Ka(a,e).field),n=Object.values(t||{}).flatMap(a=>a?a.flatMap(p=>p&&"field"in p?[p.field]:[]):[]);return[...o,...n].map(a=>({field:a}))},qf=t=>({title:"Area chart",description:"Ideal for illustrating changes and trends over time with area graphs.",servicesClass:"AreaChart",namespace:"area_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),...C1(e.dimension,e.timeDimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,lineCurve:e.lineCurve,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,legendSingleRow:e.legendSingleRow,labels:e.labels,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[],stacked:e.stacked}),setAttributes:qT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"areaChartV2",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,legendSingleRow:!1,labels:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},parametersV2:void 0,axisTitles:void 0,headline:void 0,tags:[],trends:[],stacked:!1,...o}),createFeedback:ze,schema:ff(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"lineChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Qe,"data_set"),P(Qe,"views"),{...P(Qe,"field_y_axis"),fieldFilterOptions:{forComponent:"lineChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(Qe,"field_x_axis"),fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:2,testId:"add-dimension"},P(Qe,"sort"),P(Qe,"filter"),P(Qe,"custom_metrics"),P(Qe,"limit")],formatPanelConfig:()=>[S1(Qe),{...P(Qe,"chart_styles"),subSection:[Qe.format_panel.chart_styles?.subSectionDefinition.legend,Qe.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,Qe.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Qe),{...P(Qe,"conditional_formatting"),ruleType:"lineColor"},P(Qe,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}});function Cs(t){return u.array().items(u.object({field:u.string().required(),function:u.string().valid(...Object.keys(t.supportedAggregates),...Object.keys(t.supportedTimeTruncFunctions),"none")}))}const Xs=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),type:u.valid("barChart","horizontalBarChart","funnelChart").required(),conditionalFormattingRules:nt(t.queryEngineConfig),protectedFields:u.object({dimension:$O(t.queryEngineConfig),measure:ds(t.queryEngineConfig)}).unknown(!0),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),drilldownOptions:Cs(t.queryEngineConfig)}),hT=t=>(e,o)=>E1(e,o,Xs(t)),xe={title:"Column chart",description:"Uses bars to compare different sets of data.",namespace:"bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},hf=t=>({title:xe.title,description:xe.description,servicesClass:"BarChart",namespace:xe.namespace,dump:e=>e,load:e=>({...e,measure:c1(e.measure),order:te(e.order,e.timeDimension),filter:X1(e.filter),viewId:w0(e.viewId),dimension:C1(e.dimension).dimension,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),parameters:Re(e.parameters),conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),headline:vo(e.headline,e.timeDimension),tags:e.tags??[],drilldownOptions:e.drilldownOptions}),setAttributes:hT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"barChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],stacked:void 0,dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0,headline:void 0,tags:[],drilldownOptions:void 0,...o}),createFeedback:ze,schema:Xs(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"barChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(xe,"data_set"),P(xe,"views"),{...P(xe,"field_y_axis"),fieldFilterOptions:{forComponent:"barChart",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(xe,"field_x_axis"),fieldFilterOptions:{forComponent:"barChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P(xe,"sort"),P(xe,"filter"),{...P(xe,"drilldown"),options:{property:"drilldownOptions"}},P(xe,"custom_metrics"),P(xe,"limit")],formatPanelConfig:()=>[S1(xe),Ki(xe,!1,!0),ve(xe),{...P(xe,"conditional_formatting"),ruleType:"backgroundColor"},P(xe,"goal_line"),P(xe,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),WT=["grouped","stacked","stacked100","consolidated"],mT=t=>t==="100%"?"stacked100":t===!0?"stacked":"grouped",qa=({layout:t,stacked:e})=>{switch(t??mT(e)){case"stacked":return{layout:"stacked",stacked:!0};case"stacked100":return{layout:"stacked100",stacked:"100%"};case"consolidated":return{layout:"consolidated",stacked:!1};case"grouped":default:return{layout:"grouped",stacked:!1}}},gT=()=>({prefix:"",postfix:"",format:null,labelCount:"auto",min:null,max:null}),yT=t=>({prefix:t.yAxisPrefix,postfix:t.yAxisPostfix,format:t.yAxisFormat,labelCount:t.approxYAxisLabelCount,min:t.yAxisMin,max:t.yAxisMax}),RT=(t,e)=>{const o=e.reduce((n,a)=>{const p=t?.[a];return p&&(n[a]=p),n},{});return Object.keys(o).length>0?o:void 0},lM=(t,e)=>{const o={...t,...qa(t)};o.layout==="consolidated"?(o.isDualAxisEnabled=!1,o.goalLines=void 0):(o.layout!=="grouped"||o.measure.length!==2)&&(o.isDualAxisEnabled=!1);const n=o.measure.map(l=>Zn(l)),a=RT(o.consolidatedYAxisPreferencesByMetric,n);if(o.layout!=="consolidated")return o.consolidatedYAxisPreferencesByMetric=a,o;const p=!a&&e?.layout!=="consolidated",c={...a||{}};return n.forEach(l=>{c[l]||(c[l]=p?{...yT(o)}:gT())}),o.consolidatedYAxisPreferencesByMetric=Object.keys(c).length>0?c:void 0,o},vT=u.object({title:u.string().allow("").optional(),prefix:u.string().allow("").required(),postfix:u.string().allow("").required(),format:u.alternatives(u.string(),u.valid(null)).required(),labelCount:to.required(),min:u.number().allow(null).optional(),max:u.number().allow(null).optional()}),Wf=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions,["all70","all90"]),layout:u.valid(...WT).optional(),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),type:u.valid("barChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),isDualAxisEnabled:u.valid(!0,!1).optional(),parametersV2:At,consolidatedYAxisPreferencesByMetric:u.object().pattern(u.string(),vT).optional()}).custom((e,o)=>e.layout!=="consolidated"?e:e.goalLines!==void 0||e.isDualAxisEnabled===!0||e.stacked!==void 0&&e.stacked!==!1?o.error("any.invalid"):e),ke={title:"Bar chart",description:"Ideal for illustrating changes and trends over time with bar graphs.",namespace:"bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"},yDual:{title:"Y Dual Axis",description:"",namespace:"yDual"},"yDual.prefix":{title:"Prefix",description:"",namespace:"yDual.prefix"},"yDual.postfix":{title:"Postfix",description:"",namespace:"yDual.postfix"},"yDual.format":{title:"Format",description:"",namespace:"yDual.format"},"yDual.min":{title:"Minimum",description:"",namespace:"yDual.min"},"yDual.max":{title:"Maximum",description:"",namespace:"yDual.max"},"yDual.count":{title:"Label count",description:"",namespace:"yDual.count"},"yDual.axis_title":{title:"Title",description:"",namespace:"yDual.axis_title"},dual_axes:{title:"Enable Dual Axes"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:"",supportsTrendLine:!0}}},LT=t=>(e,o)=>{const n=Zu(o,e),a=lM({...n,...qa({layout:o.layout??(o.stacked===void 0?e.layout:void 0),stacked:o.layout===void 0?o.stacked??e.stacked:void 0}),updated_at:new Date().toISOString()},e),{value:p,error:c}=Wf(t).validate(a);if(c)throw c;return p},mf=t=>({title:"Bar chart",description:"Ideal for illustrating changes and trends over time with bar graphs.",servicesClass:"BarChart",namespace:"bar_chart",dump:e=>{const o=lM({...e,...qa(e)});return{...o,consolidatedYAxisPreferencesByMetric:o.layout==="consolidated"?o.consolidatedYAxisPreferencesByMetric:void 0}},load:e=>lM({type:e.type,updated_at:e.updated_at,measure:c1(e.measure),order:te(e.order,e.timeDimension),...C1(e.dimension,e.timeDimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,yDualAxisFormat:e.yDualAxisFormat,yDualAxisPostfix:e.yDualAxisPostfix,yDualAxisPrefix:e.yDualAxisPrefix,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,yDualAxisMin:e.yDualAxisMin??null,yDualAxisMax:e.yDualAxisMax??null,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),legend:e.legend,legendSingleRow:e.legendSingleRow,labels:e.labels,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),approxDualYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],isDualAxisEnabled:e.isDualAxisEnabled,consolidatedYAxisPreferencesByMetric:e.consolidatedYAxisPreferencesByMetric,...qa({layout:e.layout,stacked:e.stacked})}),setAttributes:LT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>lM({type:"barChartV2",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),parametersV2:void 0,filter:[],order:[],dataSetId:e,limit:5e3,xAxisFormat:null,xAxisPostfix:"",xAxisPrefix:"",yAxisFormat:null,yAxisPostfix:"",yAxisPrefix:"",yDualAxisFormat:null,yDualAxisPostfix:"",yDualAxisPrefix:"",xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,yDualAxisMin:null,yDualAxisMax:null,conditionalFormattingRules:[],legend:!0,legendSingleRow:!1,labels:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],isDualAxisEnabled:!1,...qa({layout:o?.layout,stacked:o?.stacked}),...o}),createFeedback:ze,schema:Wf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"barChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(ke,"data_set"),P(ke,"views"),{...P(ke,"field_y_axis"),fieldFilterOptions:{forComponent:"barChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(ke,"field_x_axis"),fieldFilterOptions:{forComponent:"barChart",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:2,testId:"add-dimension"},P(ke,"sort"),P(ke,"filter"),P(ke,"custom_metrics"),P(ke,"limit")],formatPanelConfig:()=>[S1(ke),{...P(ke,"chart_styles"),subSection:[ke.format_panel.chart_styles?.subSectionDefinition.stacked,ke.format_panel.chart_styles?.subSectionDefinition.legend,ke.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,ke.format_panel.chart_styles?.subSectionDefinition.labels]},ve(ke),{...P(ke,"conditional_formatting"),ruleType:"backgroundColor"},P(ke,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)},parametersV2Sections:["field_y_axis","field_x_axis"]}),_T=u.object({field:u.string().required(),function:u.valid("none").required()}),gf=t=>u.object({...I1(t.attributesSchemaOptions),type:u.valid("basicTable").required(),measure:u.array().items(_T).required(),dimension:u.array().max(0),order:u.array().items(_2(t.queryEngineConfig)),timeDimension:u.valid(null),limit:io().required(),offset:u.number().min(0),filter:yo(t.queryEngineConfig),prefixes:u.array().items(_A),exportNames:u.object(),numberFormat:u.object(),conditionalFormattingRules:nt(t.queryEngineConfig),dateTimeFormat:u.string(),protectedFields:u.object({measure:ds(t.queryEngineConfig)}).unknown(!0),sizing:vA,tags:D1(),hiddenFields:u.array().items(u.string()),freezeHeaders:u.boolean().default(!1).description("Enable/disable sticky column headers.")}),eO=t=>(e,o)=>E1(e,o,gf(t)),Ze={title:"Basic table",description:"Displays data in a simple, straightforward table format.",namespace:"basic_table",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this basic table?"},views:{type:"views",title:"View",description:""},fields:{type:"fields",title:"Columns",description:"Select which values you want to see in this table"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this basic table."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},pagination:{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{type:"subject",title:"Subject",description:"",namespace:"subject"}}},format:{type:"format",title:"Format",description:"",subSectionDefinition:{time:{type:"time",title:"Time",description:"",namespace:"time"}}},prefixes:{type:"prefixes",title:"Prefixes",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},visual_format:{type:"visualFormat",title:"Visual Format",description:"Configure how group columns are visually represented"},kpi_summarisation:{type:"kpiSummarisation",title:"",description:"Show aggregate statistics above column headers"},freeze_headers:{type:"freezeHeaders",title:"",description:"Keep table headers visible while scrolling."}}},yf=[3,5,10,20,50,100,200],Rf=t=>({title:Ze.title,description:Ze.description,servicesClass:"BasicTable",namespace:Ze.namespace,dump:e=>e,load:e=>({...e,measure:c1(e.measure),order:te(e.order,e.timeDimension),filter:X1(e.filter),dimension:C1(e.dimension).dimension,viewId:w0(e.viewId),conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),tags:e.tags??[],hiddenFields:e.hiddenFields??[],freezeHeaders:e.freezeHeaders??!1}),setAttributes:eO(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:function(e,o){const n={type:"basicTable",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",filter:[],order:[],tags:[],hiddenFields:[],dataSetId:e,viewId:w0(o?.viewId),protectedFields:void 0,limit:50,offset:0,conditionalFormattingRules:[],prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{}};return eO(t)(n,o||{})},schema:gf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),setFields:function(e,o){const n=[...o].map(a=>({field:a,function:"none"}));return eO(t)(e,{measure:n})},setDateTimeFormat:function(e,o){return this.setAttributes(e,{dateTimeFormat:o})},isRunnable:e=>e.measure.length>0,autoGenerate(e){const n=[...Xi(e.fields,{forComponent:"basicTable",onlyMeasures:!0,removeAggregateMaths:!0,removePercentage:!0})].map(a=>({field:a.id,function:"none"}));return this.init(e.id,{measure:n.slice(0,5)})},dataPanelConfig:()=>[P(Ze,"data_set"),P(Ze,"views"),P(Ze,"fields"),P(Ze,"sort"),{...P(Ze,"pagination"),options:yf},P(Ze,"filter"),P(Ze,"custom_metrics")],formatPanelConfig:()=>[S1(Ze),P(Ze,"freeze_headers"),{...P(Ze,"format"),subSection:[Ze.format_panel.format?.subSectionDefinition.time]},P(Ze,"prefixes"),{...P(Ze,"conditional_formatting"),ruleType:"backgroundColor"}],supportedCustomFields:{percentages:!1,simpleMaths:!0,rules:!0,aggregateMaths:!1,roundedNumbers:!0,dateCalculations:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement]},supportedFeatures:{parameters:!1,colorGradient:!0}}),vf=t=>u.object({...I1(t.attributesSchemaOptions),xMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),yMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),zMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),order:u.array().items(_2(t.queryEngineConfig)),limit:io(),legend:u.valid(!0,!1),offset:u.number().min(0),filter:yo(t.queryEngineConfig),type:u.valid("bubbleChart").required(),timeDimension:u.valid(null),xAxisPrefix:u.string().allow(""),yAxisPrefix:u.string().allow(""),xAxisPostfix:u.string().allow(""),yAxisPostfix:u.string().allow(""),yAxisFormat:u.alternatives(u.string(),u.valid(null)),xAxisFormat:u.alternatives(u.string(),u.valid(null)),approxYAxisLabelCount:to,approxXAxisLabelCount:to,goalLines:Tt(),axisTitles:Pe(),tags:D1()}),NT=t=>(e,o)=>E1(e,o,vf(t)),Se={title:"Bubble chart",description:"Displays data points on a Cartesian plane, with a third metric corresponding to bubble size.",namespace:"bubble_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bubble chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"",subSectionDefinition:{xAxis:{type:"metrics",title:"X axis",namespace:"metrics.xAxis"},yAxis:{type:"metrics",title:"Y axis",namespace:"metrics.yAxis"},zAxis:{type:"metrics",title:"Metric - Bubble Size",namespace:"metrics.zAxis"}}},field_grouping:{type:"fieldCollector",title:"Grouping",description:"What do you want each bubble to represent?",callToAction:"Add comparison"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this bubble chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of data points shown on this bubble chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"},z:{title:"Metric - Bubble Size",description:"",namespace:"z"},"z.prefix":{title:"Prefix",description:"",namespace:"z.prefix"},"z.postfix":{title:"Postfix",description:"",namespace:"z.postfix"},"z.format":{title:"Format",description:"",namespace:"z.format"},"z.count":{title:"Label count",description:"",namespace:"z.count"},"z.axis_title":{title:"Title",description:"",namespace:"z.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},Lf=t=>({title:Se.title,description:Se.description,servicesClass:"BubbleChart",namespace:Se.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,xMeasure:c1(e.xMeasure?[e.xMeasure]:[])[0]||null,yMeasure:c1(e.yMeasure?[e.yMeasure]:[])[0]||null,zMeasure:c1(e.zMeasure?[e.zMeasure]:[])[0]||null,dimension:C1(e.dimension).dimension,viewId:w0(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:X1(e.filter),order:te(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,legend:e.legend,xAxisFormat:e.xAxisFormat,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),goalLines:e.goalLines,axisTitles:e.axisTitles,tags:e.tags??[]}),setAttributes:NT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"bubbleChart",xMeasure:null,yMeasure:null,zMeasure:null,dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,legend:!0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,axisTitles:void 0,tags:[],...o}),createFeedback:ze,schema:vf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>!!e.xMeasure&&!!e.yMeasure&&!!e.zMeasure&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"bubbleChart");return this.init(e.id,{xMeasure:o[0],yMeasure:o[1],dimension:n})},dataPanelConfig:()=>[P(Se,"data_set"),P(Se,"views"),{...P(Se,"labelled_metrics"),subSection:[{...Se.data_panel.labelled_metrics?.subSectionDefinition.xAxis,propKey:"xMeasure",allowsMultiple:!1},{...Se.data_panel.labelled_metrics?.subSectionDefinition.yAxis,propKey:"yMeasure",allowsMultiple:!1},{...Se.data_panel.labelled_metrics?.subSectionDefinition.zAxis,propKey:"zMeasure",allowsMultiple:!1}]},{...P(Se,"field_grouping"),fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["boolean","number","string"],removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(Se,"filter"),P(Se,"custom_metrics"),P(Se,"limit")],formatPanelConfig:()=>[S1(Se),{...P(Se,"chart_styles"),subSection:[Se.format_panel.chart_styles?.subSectionDefinition.legend]},ve(Se),P(Se,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),_f=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),zMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).required().description("A list of metrics that are to be shown. For example the `count` of a specific field in your data set."),xMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).required().description("A list of metrics that are to be shown. For example the `count` of a specific field in your data set."),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),type:u.valid("bubbleChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,lineCurve:Qa,quadrants:GO(),conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp()}),TT=t=>(e,o)=>E1(e,o,_f(t)),je={title:"Bubble chart",description:"Displays data points on a Cartesian plane, with a third metric corresponding to bubble size.",namespace:"bubble_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bubble chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bubble to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this line chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add metric"},field_z_axis:{type:"fieldCollector",title:"Metric - Bubble Size",description:"What do you want each bubble to represent? An example might be a `product category` field to represent each category as a bubble.",callToAction:"Add metric"},field_grouping:{type:"fieldCollector",title:"Grouping - Bubble series",description:"How do you want to group each bubble?",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bubble chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bubble chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},quadrants:{type:"quadrants",title:"",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},trends:{type:"trends",title:"Trend lines",description:"Specify a trend type for the line chart."},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},Nf=t=>({title:"Bubble chart",description:je.description,servicesClass:"BubbleChartV2",namespace:"bubble_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),zMeasure:c1(e.zMeasure),xMeasure:c1(e.xMeasure),order:te(e.order,e.timeDimension),...C1(e.dimension,e.timeDimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,lineCurve:e.lineCurve,quadrants:e.quadrants,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,legendSingleRow:e.legendSingleRow,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[]}),setAttributes:TT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"bubbleChartV2",measure:[],zMeasure:[],xMeasure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,lineCurve:"natural",quadrants:void 0,conditionalFormattingRules:[],drilldown:[],legend:!0,legendSingleRow:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},parametersV2:void 0,axisTitles:void 0,headline:void 0,tags:[],trends:[],...o}),createFeedback:ze,schema:_f(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0&&e.xMeasure.length>0&&e.zMeasure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"bubbleChartV2");return this.init(e.id,{measure:[o[0]],dimension:n,zMeasure:[o[0]],xMeasure:[o[0]]})},dataPanelConfig:()=>[P(je,"data_set"),P(je,"views"),{...P(je,"field_y_axis"),fieldFilterOptions:{forComponent:"bubbleChartV2"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,maxAllowed:1,testId:"metric-input",propKey:"yMeasure"},{...P(je,"field_x_axis"),fieldFilterOptions:{forComponent:"bubbleChartV2",onlyMeasures:!0,onlyDimensions:!1},preSetPartialAttributes:e=>({xMeasure:[...e]}),getValues:e=>[...e.xMeasure],maxAllowed:1,testId:"x-metric-axis"},{...P(je,"field_z_axis"),fieldFilterOptions:{forComponent:"bubbleChartV2"},preSetPartialAttributes:e=>({zMeasure:[...e]}),getValues:e=>e.zMeasure,testId:"metric-input-z",maxAllowed:1,propKey:"zMeasure"},{...P(je,"field_grouping"),fieldFilterOptions:{forComponent:"bubbleChartV2",onlyDimensions:!0},preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:1,testId:"bubble-dimension"},P(je,"sort"),P(je,"filter"),P(je,"custom_metrics"),P(je,"limit")],formatPanelConfig:()=>[S1(je),Ki(je,!0,!1,!0),ve(je),P(je,"quadrants"),{...P(je,"conditional_formatting"),ruleType:"backgroundColor"},P(je,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_z_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Tf=t=>u.object({...I1(t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),barMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),lineMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),barDimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),lineDimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),order:u.array().items(_2(t.queryEngineConfig)),timeDimension:u.alternatives(ar(t.queryEngineConfig.supportedTimeTruncFunctions),u.valid(null)),limit:io(),offset:u.number().min(0),filter:yo(t.queryEngineConfig),type:u.valid("comboChart").required(),xAxisPrefix:u.string().allow(""),yAxisPrefix:u.string().allow(""),xAxisPostfix:u.string().allow(""),yAxisPostfix:u.string().allow(""),yAxisFormat:u.alternatives(u.string(),u.valid(null)),xAxisFormat:u.alternatives(u.string(),u.valid(null)),approxYAxisLabelCount:to,approxXAxisLabelCount:to,goalLines:Tt(),conditionalFormattingRules:u.object({bar:u.array().items(ma(t.queryEngineConfig)),line:u.array().items(ma(t.queryEngineConfig))}),axisTitles:Pe(),tags:D1()}),xT=t=>(e,o)=>E1(e,o,Tf(t));function xf(t,e,o){return{...t,lineMeasure:c1(t.lineMeasure),barMeasure:c1(t.barMeasure),order:te(t.order,t.timeDimension||null),filter:X1(t.filter),lineDimension:C1(t.lineDimension||t.dimension||[]).dimension,barDimension:C1(t.barDimension||t.dimension||[]).dimension,viewId:w0(t.viewId),approxXAxisLabelCount:o?Mi(t.approxXAxisLabelCount):A1(t.approxXAxisLabelCount),approxYAxisLabelCount:A1(t.approxYAxisLabelCount),xAxisMin:t.xAxisMin??null,xAxisMax:t.xAxisMax??null,yAxisMin:t.yAxisMin??null,yAxisMax:t.yAxisMax??null,yDualAxisMin:t.yDualAxisMin??null,yDualAxisMax:t.yDualAxisMax??null,conditionalFormattingRules:{bar:Nt(e,t.conditionalFormattingRules?.bar),line:Nt(e,t.conditionalFormattingRules?.line)},tags:t.tags??[]}}const re={title:"Combo chart",description:"A versatile component that combines different chart types.",namespace:"combo_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this combo chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"What do you want each line and bar to measure?",subSectionDefinition:{line:{type:"metrics",title:"Line",namespace:"metrics.line"},bar:{type:"metrics",title:"Bar",namespace:"metrics.bar"}}},combo_chart_dimension:{type:"comboChartDimension",title:"Grouping - X Axis",description:""},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this combo chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:"",subSectionDefinition:{bar:{title:"Bar",namespace:"bar"},line:{title:"Line",namespace:"line"}}}}},Sf=t=>({title:re.title,description:re.description,servicesClass:"ComboChart",namespace:re.namespace,dump:e=>e,load:e=>xf(e,t.queryEngineConfig,!1),setAttributes:xT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"comboChart",barMeasure:[],lineMeasure:[],lineDimension:[],barDimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",protectedByOrganisation:void 0,xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,conditionalFormattingRules:void 0,axisTitles:void 0,tags:[],...o}),createFeedback:ze,schema:Tf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.lineMeasure.length>0||e.barMeasure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"comboChart");return this.init(e.id,{barMeasure:[o[0]],lineMeasure:[o[1]||o[0]],barDimension:n,lineDimension:n})},dataPanelConfig:()=>[P(re,"data_set"),P(re,"views"),{...P(re,"labelled_metrics"),subSection:[{...re.data_panel.labelled_metrics?.subSectionDefinition.line,propKey:"lineMeasure",allowsMultiple:!0},{...re.data_panel.labelled_metrics?.subSectionDefinition.bar,propKey:"barMeasure",allowsMultiple:!0}]},P(re,"combo_chart_dimension"),P(re,"sort"),P(re,"filter"),P(re,"custom_metrics"),P(re,"limit")],formatPanelConfig:()=>[S1(re),Ki(re,!1,!0),ve(re),{...P(re,"conditional_formatting"),ruleType:"backgroundColor",subSection:[{title:re.format_panel.conditional_formatting?.subSectionDefinition?.bar.title??"",namespace:re.format_panel.conditional_formatting?.subSectionDefinition?.bar.namespace,propKey:"bar"},{title:re.format_panel.conditional_formatting?.subSectionDefinition?.line.title??"",namespace:re.format_panel.conditional_formatting?.subSectionDefinition?.line.namespace,propKey:"line"}]},P(re,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),Bf=t=>u.object({...I1(t.attributesSchemaOptions),stacked:u.valid(!0,!1),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),barMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),lineMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),barDimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),lineDimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),order:u.array().items(_2(t.queryEngineConfig)),timeDimension:u.alternatives(ar(t.queryEngineConfig.supportedTimeTruncFunctions),u.valid(null)),limit:io(),offset:u.number().min(0),filter:yo(t.queryEngineConfig),type:u.valid("comboChartV2").required(),xAxisPrefix:u.string().allow(""),yAxisPrefix:u.string().allow(""),xAxisPostfix:u.string().allow(""),yAxisPostfix:u.string().allow(""),yAxisFormat:u.alternatives(u.string(),u.valid(null)),yDualAxisPrefix:u.string().allow("").optional(),yDualAxisPostfix:u.string().allow("").optional(),yDualAxisFormat:u.alternatives(u.string(),u.valid(null)).optional(),xAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),xAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),yAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),yAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),yDualAxisMin:u.alternatives(u.number(),u.valid(null)).optional(),yDualAxisMax:u.alternatives(u.number(),u.valid(null)).optional(),xAxisFormat:u.alternatives(u.string(),u.valid(null)),approxYAxisLabelCount:to,approxDualYAxisLabelCount:to.optional(),approxXAxisLabelCount:jO(["all70","all90"]),goalLines:Tt(),conditionalFormattingRules:u.object({bar:u.array().items(ma(t.queryEngineConfig)),line:u.array().items(ma(t.queryEngineConfig))}),axisTitles:Pe(),tags:D1(),isDualAxisEnabled:u.valid(!0,!1).optional()}),ST=t=>(e,o)=>{let n=E1(e,o,Bf(t));return(e.barMeasure?.length!=1||e.lineMeasure?.length!=1)&&(n.isDualAxisEnabled=!1),n},k1={title:"Combo chart",description:"A versatile component that combines different chart types.",namespace:"combo_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this combo chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"What do you want each line and bar to measure?",subSectionDefinition:{line:{type:"metrics",title:"Line",namespace:"metrics.line"},bar:{type:"metrics",title:"Bar",namespace:"metrics.bar"}}},combo_chart_dimension:{type:"comboChartDimension",title:"Grouping - X Axis",description:""},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this combo chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"},yDual:{title:"Y Dual Axis",description:"",namespace:"yDual"},"yDual.prefix":{title:"Prefix",description:"",namespace:"yDual.prefix"},"yDual.postfix":{title:"Postfix",description:"",namespace:"yDual.postfix"},"yDual.format":{title:"Format",description:"",namespace:"yDual.format"},"yDual.min":{title:"Minimum",description:"",namespace:"yDual.min"},"yDual.max":{title:"Maximum",description:"",namespace:"yDual.max"},"yDual.count":{title:"Label count",description:"",namespace:"yDual.count"},"yDual.axis_title":{title:"Title",description:"",namespace:"yDual.axis_title"},dual_axes:{title:"Enable Dual Axes"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:"",subSectionDefinition:{bar:{title:"Bar",namespace:"bar"},line:{title:"Line",namespace:"line"}}}}},wf=t=>({title:k1.title,description:k1.description,servicesClass:"ComboChartV2",namespace:k1.namespace,dump:e=>e,load:e=>xf(e,t.queryEngineConfig,!0),setAttributes:ST(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"comboChartV2",barMeasure:[],lineMeasure:[],lineDimension:[],barDimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",protectedByOrganisation:void 0,xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,yDualAxisPostfix:"",yDualAxisPrefix:"",yDualAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,yDualAxisMin:null,yDualAxisMax:null,xAxisFormat:null,legend:!0,legendSingleRow:!1,labels:!1,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",approxDualYAxisLabelCount:"auto",goalLines:void 0,conditionalFormattingRules:void 0,axisTitles:void 0,tags:[],isDualAxisEnabled:!1,...o}),createFeedback:ze,schema:Bf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.lineMeasure.length>0||e.barMeasure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"comboChart");return this.init(e.id,{barMeasure:[o[0]],lineMeasure:[o[1]||o[0]],barDimension:n,lineDimension:n})},dataPanelConfig:()=>[P(k1,"data_set"),P(k1,"views"),{...P(k1,"labelled_metrics"),subSection:[{...k1.data_panel.labelled_metrics?.subSectionDefinition.line,propKey:"lineMeasure",allowsMultiple:!0},{...k1.data_panel.labelled_metrics?.subSectionDefinition.bar,propKey:"barMeasure",allowsMultiple:!0}]},P(k1,"combo_chart_dimension"),P(k1,"sort"),P(k1,"filter"),P(k1,"custom_metrics"),P(k1,"limit")],formatPanelConfig:()=>[S1(k1),{...P(k1,"chart_styles"),subSection:[k1.format_panel.chart_styles?.subSectionDefinition.stacked,k1.format_panel.chart_styles?.subSectionDefinition.legend,k1.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,k1.format_panel.chart_styles?.subSectionDefinition.labels]},ve(k1),{...P(k1,"conditional_formatting"),ruleType:"backgroundColor",subSection:[{title:k1.format_panel.conditional_formatting?.subSectionDefinition?.bar.title??"",namespace:k1.format_panel.conditional_formatting?.subSectionDefinition?.bar.namespace,propKey:"bar"},{title:k1.format_panel.conditional_formatting?.subSectionDefinition?.line.title??"",namespace:k1.format_panel.conditional_formatting?.subSectionDefinition?.line.namespace,propKey:"line"}]},P(k1,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),fu=t=>u.object({...I1(t.attributesSchemaOptions),type:u.valid("custom").required(),customViewId:u.string().required(),tags:D1()}),Hn={title:"Progress",description:"Used to show progress towards goals, completion of tasks, or as indicators of performance metrics.",namespace:"progress",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this progress?"},views:{type:"views",title:"View",description:""}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}}}},Cf=t=>({title:Hn.title,description:Hn.description,namespace:Hn.namespace,servicesClass:"Custom",dump:e=>e,load:e=>({type:"custom",updated_at:e.updated_at,viewId:w0(e.viewId),customViewId:e.customViewId,displayTitle:e.displayTitle,displaySubject:e.displaySubject,dataSetId:e.dataSetId,tags:e.tags??[],protectedByOrganisation:e.protectedByOrganisation}),setAttributes:(e,o)=>E1(e,o,fu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"custom",viewId:w0(o?.viewId),customViewId:o?.customViewId||"",dataSetId:e,displaySubject:"",displayTitle:"",tags:[],protectedByOrganisation:void 0}),schema:fu(t),removeField(e,o){return e},isRunnable:()=>!0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[P(Hn,"data_set"),P(Hn,"views")],formatPanelConfig:()=>[S1(Hn)],supportedCustomFields:{percentages:!1,simpleMaths:!1,rules:!1,aggregateMaths:!1,roundedNumbers:!1,dateCalculations:!1,conditional:!1,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{colorGradient:!1,parameters:!1}}),Xf=t=>u.object({...I1(t.attributesSchemaOptions),type:u.valid("dataTable").required(),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).required(),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions).required(),order:u.array().items(_2(t.queryEngineConfig)),timeDimension:u.alternatives(ar(t.queryEngineConfig.supportedTimeTruncFunctions),u.valid(null)),limit:io().required(),offset:u.number().min(0),filter:yo(t.queryEngineConfig),prefixes:u.array().items(_A),exportNames:u.object(),numberFormat:u.object(),conditionalFormattingRules:nt(t.queryEngineConfig),dateTimeFormat:u.string(),protectedFields:u.object({dimension:$O(t.queryEngineConfig),measure:ds(t.queryEngineConfig)}).unknown(!0),sizing:vA,tags:D1(),hiddenFields:u.array().items(u.string()),tableDrilldown:u.array().items(u.object({subsetDimension:u.string().required().description("The ID of the field in the data set to drill down by.")})).description("Drilldown configuration for a pivot table."),summarizeKPIs:u.boolean().default(!1).description("Enable/disable KPI summarisation above column headers."),showGroupTotals:u.boolean().default(!1).description("Enable/disable inline group total rows in pivot tables."),showSubGroupTotals:u.boolean().default(!1).description("Enable/disable inline sub-group total rows in pivot tables."),changePercent:u.alternatives(u.object({targetFieldId:u.string().required(),targetFunction:u.string().required(),sortDirection:u.valid("asc","desc").default("asc")}),u.valid(null)).optional().description("Merge the last grouping rows and show the % change of the target metric."),kpiSplitByGroup:u.alternatives(u.object({targetFieldId:u.string().required(),targetFunction:u.string().required(),sortDirection:u.valid("asc","desc").default("asc")}),u.valid(null)).optional().description("Split the KPI Summary values by an existing grouping."),freezeHeaders:u.boolean().default(!1).description("Enable/disable sticky column headers."),freezeGroupedRows:u.boolean().default(!1).description("Enable/disable sticky grouped row columns in pivot tables."),visualFormatColumns:u.array().items(u.object({field:u.string(),function:u.string()})).default([]).description("Array of metrics to display as horizontal bars."),results:u.array().items(u.object({content:u.array().required(),fields:u.array().items(u.object({id:u.string().required(),publicName:u.string().required(),dataType:u.string().required(),hidden:u.boolean(),fieldId:u.string().required(),function:u.string().required(),outputDataType:u.string().required()}).unknown(!0)).required(),hasMoreResults:u.alternatives([u.boolean(),u.valid(null)])}).unknown(!0)).description("Query results data structure containing fields and content."),parametersV2:At}),BT=t=>(e,o)=>{let n=E1(e,o,Xf(t));const a=e.measure.length,p=o.measure?.length;if(p===void 0?!1:a>p){const y=e.measure.filter(_=>!o.measure?.some(O=>O.field===_.field&&O.function===_.function));n.visualFormatColumns=(e.visualFormatColumns||[]).filter(_=>!y.some(d=>{const f=_.field,z=_.function;return d.field===f&&d.function===z}))}const l=(n.dimension??[]).filter(y=>y.pivot!=="y").length,M=l>0,g=M&&n.showGroupTotals&&l>1;if(M?g||(n.showSubGroupTotals=!1):(n.showGroupTotals=!1,n.showSubGroupTotals=!1),n.kpiSplitByGroup){const y=n.kpiSplitByGroup.targetFieldId,_=n.kpiSplitByGroup.targetFunction;(n.dimension??[]).some(d=>d.field===y&&d.function===_)||(n.kpiSplitByGroup=null)}return n},J1={title:"Pivot table",description:"Transforms data into a table with dynamic rows and columns.",namespace:"pivot_table",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this data table?"},views:{type:"views",title:"View",description:""},field_columns:{type:"fieldCollector",title:"Group columns",callToAction:"Add group column",description:""},field_rows:{type:"fieldCollector",title:"Group rows",description:"Which field do you want to group each row by? An example might be an employee ID or geographical location",callToAction:"Add group row"},drilldown:{type:"drilldown",title:"Drilldown",description:"Drilldowns in a pivot table reveals underlying data contributing to summarized figures upon clicking."},field_metrics:{type:"fieldCollector",title:"Metrics",description:"Select the columns to show in the data table",callToAction:"Add metric"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this data table."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},pagination:{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},kpi_summarisation:{type:"kpiSummarisation",title:"",description:"Show aggregate statistics above each column."},show_group_totals:{type:"showGroupTotals",title:"",description:"Show a total row after each group of values."},change_percent:{type:"changePercent",title:"Grouping Change %",description:"Compare the two rows in the last grouping level and show the % change for the selected metric;"},visual_format:{type:"visualFormat",title:"Visual Format",description:"Configure how the group column is displayed visually."},format:{type:"format",title:"Format",description:"",subSectionDefinition:{time:{type:"time",title:"Time",description:"",namespace:"time"}}},prefixes:{type:"prefixes",title:"Prefixes",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},freeze_headers:{type:"freezeHeaders",title:"",description:"Keep table headers visible while scrolling."},freeze_grouped_rows:{type:"freezeGroupedRows",title:"",description:"Keep grouped row columns pinned while scrolling horizontally."}}};function wT(t){return t.filter(o=>typeof o!="string")}const aM=(t,e)=>t.filter(o=>o.pivot==e),CT=t=>t.map(e=>({...e,pivot:e.pivot?e.pivot:"x"})),Ef=t=>({title:J1.title,description:J1.description,servicesClass:"PivotTable",namespace:J1.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension||null),displayTitle:e.displayTitle,dimension:CT(mo({timeDimension:e.timeDimension,dimension:C1(e.dimension).dimension})),displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,protectedFields:e.protectedFields,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,offset:e.offset,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),dateTimeFormat:e.dateTimeFormat,prefixes:e.prefixes,exportNames:e.exportNames,numberFormat:e.numberFormat,sizing:e.sizing,tableDrilldown:zT(e.tableDrilldown),tags:e.tags??[],hiddenFields:e.hiddenFields??[],summarizeKPIs:e.summarizeKPIs??!1,showGroupTotals:e.showGroupTotals??!1,showSubGroupTotals:e.showSubGroupTotals??!1,changePercent:e.changePercent,kpiSplitByGroup:e.kpiSplitByGroup??null,freezeHeaders:e.freezeHeaders??!1,freezeGroupedRows:e.freezeGroupedRows??!1,parametersV2:typeof e.parametersV2=="boolean"?{fields:[]}:e.parametersV2||{fields:[]},visualFormatColumns:wT(e.visualFormatColumns??[])}),setAttributes:BT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"dataTable",measure:[],displayTitle:"",dimension:[],protectedByOrganisation:void 0,displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:50,offset:0,conditionalFormattingRules:[],protectedFields:void 0,prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{},tableDrilldown:[],tags:[],hiddenFields:[],summarizeKPIs:!1,showGroupTotals:!1,showSubGroupTotals:!1,visualFormatColumns:[],parametersV2:void 0,...o}),schema:Xf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"dataTable");return this.init(e.id,{measure:o.slice(0,5),dimension:n})},dataPanelConfig:()=>[P(J1,"data_set"),P(J1,"views"),{...P(J1,"field_columns"),fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o,n)=>({dimension:[...e.map(a=>({...a,pivot:"y"})),...aM(n.dimension,"x")]}),getValues:e=>aM(e.dimension,"y"),testId:"add-pivot-dimension"},{...P(J1,"field_rows"),fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o,n)=>({dimension:[...e.map(a=>({...a,pivot:"x"})),...aM(n.dimension,"y")]}),getValues:e=>aM(e.dimension,"x"),testId:"add-dimension"},{...P(J1,"field_metrics"),fieldFilterOptions:{forComponent:"dataTable"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},P(J1,"sort"),{...P(J1,"pagination"),options:yf},P(J1,"filter"),P(J1,"custom_metrics")],formatPanelConfig:()=>[S1(J1),P(J1,"freeze_headers"),P(J1,"freeze_grouped_rows"),P(J1,"kpi_summarisation"),P(J1,"show_group_totals"),P(J1,"change_percent"),P(J1,"visual_format"),{...P(J1,"format"),subSection:[J1.format_panel.format?.subSectionDefinition.time]},P(J1,"prefixes"),{...P(J1,"conditional_formatting"),ruleType:"backgroundColor"}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!0},parametersV2Sections:["field_rows","field_metrics"]}),Df=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),type:u.valid("barChart","horizontalBarChart","funnelChart").required(),conditionalFormattingRules:nt(t.queryEngineConfig),protectedFields:u.object({dimension:$O(t.queryEngineConfig),measure:ds(t.queryEngineConfig)}).unknown(!0),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),drilldownOptions:Cs(t.queryEngineConfig)}),XT=t=>(e,o)=>E1(e,o,Df(t)),Be={title:"Funnel chart",description:"Track conversion between stages of a process.",namespace:"funnel_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},If=t=>({title:Be.title,description:Be.description,servicesClass:"FunnelChart",namespace:Be.namespace,dump:e=>e,load:e=>({...e,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension).dimension,viewId:w0(e.viewId),filter:X1(e.filter),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,tags:e.tags??[],labels:e.labels??!1,parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig)}),setAttributes:XT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"funnelChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],parameters:{},order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,legend:!0,labels:!1,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",axisTitles:void 0,tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:Df(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"funnelChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Be,"data_set"),P(Be,"views"),{...P(Be,"field_y_axis"),fieldFilterOptions:{forComponent:"funnelChart"},preSetPartialAttributes:e=>({measure:e}),allowsMultiple:!1,maxAllowed:1,getValues:e=>e.measure,testId:"metric-input"},{...P(Be,"field_x_axis"),fieldFilterOptions:{forComponent:"funnelChart",onlyDimensions:!0},allowsMultiple:!1,preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:1,testId:"add-dimension"},P(Be,"sort"),P(Be,"filter"),P(Be,"custom_metrics"),P(Be,"limit")],formatPanelConfig:()=>[S1(Be),{...P(Be,"chart_styles"),subSection:[Be.format_panel.chart_styles?.subSectionDefinition.legend,Be.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Be),{...P(Be,"conditional_formatting"),ruleType:"backgroundColor"},P(Be,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),ET=t=>(e,o)=>E1(e,o,Xs(t)),$e={title:"Horizontal bar chart",description:"Similar to a BarChart but with horizontal bars.",namespace:"horizontal_bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Pf=t=>({title:$e.title,description:$e.description,servicesClass:"HorizontalBarChart",namespace:$e.namespace,dump:e=>e,load:e=>({...e,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension).dimension,viewId:w0(e.viewId),filter:X1(e.filter),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),tags:e.tags??[],parameters:Re(e.parameters)}),setAttributes:ET(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"horizontalBarChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,parameters:{},drilldown:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",axisTitles:void 0,tags:[],drilldownOptions:void 0,...o}),createFeedback:ze,schema:Xs(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"horizontalBarChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P($e,"data_set"),P($e,"views"),{...P($e,"field_y_axis"),fieldFilterOptions:{forComponent:"horizontalBarChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P($e,"field_x_axis"),fieldFilterOptions:{forComponent:"horizontalBarChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P($e,"sort"),P($e,"filter"),{...P($e,"drilldown"),options:{property:"drilldownOptions"}},P($e,"custom_metrics"),P($e,"limit")],formatPanelConfig:()=>[S1($e),Ki($e,!1,!0),ve($e),{...P($e,"conditional_formatting"),ruleType:"backgroundColor"},P($e,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Ff=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),type:u.valid("horizontalBarChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1()}),he={title:"Horizontal bar chart",description:"Ideal for illustrating changes and trends over time with bar graphs.",namespace:"horizontal_bar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},views:{type:"views",title:"View",description:""},field_x_axis:{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_y_axis:{type:"fieldCollector",title:"Grouping - Y Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{stacked:{type:"stacked",title:"Layout",description:"",namespace:"stacked"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},DT=t=>(e,o)=>E1(e,o,Ff(t)),kf=t=>({title:he.title,description:he.description,servicesClass:"HorizontalBarChart",namespace:he.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),...C1(e.dimension,e.timeDimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),legend:e.legend,legendSingleRow:e.legendSingleRow,labels:e.labels,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],stacked:e.stacked,parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig)}),setAttributes:DT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"horizontalBarChartV2",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,conditionalFormattingRules:[],legend:!0,legendSingleRow:!1,labels:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:Ff(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"barChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(he,"data_set"),P(he,"views"),{...P(he,"field_x_axis"),fieldFilterOptions:{forComponent:"horizontalBarChartV2"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(he,"field_y_axis"),fieldFilterOptions:{forComponent:"horizontalBarChartV2",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:(e,o,n)=>e.length===3&&(n.stacked===!1||n.stacked===void 0)?{dimension:[...e],stacked:!0}:{dimension:[...e]},getValues:e=>[...e.dimension],maxAllowed:3,testId:"add-dimension"},P(he,"sort"),P(he,"filter"),P(he,"custom_metrics"),P(he,"limit")],formatPanelConfig:()=>[S1(he),{...P(he,"chart_styles"),subSection:[he.format_panel.chart_styles?.subSectionDefinition.stacked,he.format_panel.chart_styles?.subSectionDefinition.legend,he.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,he.format_panel.chart_styles?.subSectionDefinition.labels],labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}},ve(he),{...P(he,"conditional_formatting"),ruleType:"backgroundColor"},P(he,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_x_axis","field_y_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),jf=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),type:u.valid("lineChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),lineCurve:Qa,conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp()}),IT=t=>(e,o)=>E1(e,o,jf(t)),ct={title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",namespace:"line_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this line chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this line chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this line chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this line chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},trends:{type:"trends",title:"Trend lines",description:"Specify a trend type for the line chart."},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},$f=t=>({title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",servicesClass:"LineChart",namespace:"line_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension).dimension,timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,lineCurve:e.lineCurve,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[]}),setAttributes:IT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"lineChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],trends:[],...o}),createFeedback:ze,schema:jf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"lineChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(ct,"data_set"),P(ct,"views"),{...P(ct,"field_y_axis"),fieldFilterOptions:{forComponent:"lineChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(ct,"field_x_axis"),fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P(ct,"sort"),P(ct,"filter"),P(ct,"custom_metrics"),P(ct,"limit")],formatPanelConfig:()=>[S1(ct),Ki(ct,!0,!1),ve(ct),{...P(ct,"conditional_formatting"),ruleType:"lineColor"},P(ct,"goal_line"),P(ct,"trends"),P(ct,"headline")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Gf=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions,["all70","all90"]),aggregateMetricGroup:u.valid(!0,!1).optional(),stacked:u.valid(!0,!1,"100%"),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),labels:u.valid(!0,!1).optional(),type:u.valid("lineChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,lineCurve:Qa,conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp(),isDualAxisEnabled:u.valid(!0,!1).optional()}),PT=t=>(e,o)=>{let n=E1(e,o,Gf(t));return e.measure?.length!==2&&(n.isDualAxisEnabled=!1),n},Ge={title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",namespace:"line_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this line chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this line chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this line chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this line chart."},aggregate_metric_group:{type:"aggregateMetricGroup",title:"Aggregate metric group",description:"Check to plot raw data points for visualizing curves. By default, data is summarized for better performance."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"},yDual:{title:"Y Dual Axis",description:"",namespace:"yDual"},"yDual.prefix":{title:"Prefix",description:"",namespace:"yDual.prefix"},"yDual.postfix":{title:"Postfix",description:"",namespace:"yDual.postfix"},"yDual.format":{title:"Format",description:"",namespace:"yDual.format"},"yDual.min":{title:"Minimum",description:"",namespace:"yDual.min"},"yDual.max":{title:"Maximum",description:"",namespace:"yDual.max"},"yDual.count":{title:"Label count",description:"",namespace:"yDual.count"},"yDual.axis_title":{title:"Title",description:"",namespace:"yDual.axis_title"},dual_axes:{title:"Enable Dual Axes"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},trends:{type:"trends",title:"Trend lines",description:"Specify a trend type for the line chart."},goal_line:{type:"goalLine",title:"Goal Lines",description:"",supportsTrendLine:!0}}},Uf=t=>({title:"Line chart",description:"Ideal for illustrating changes and trends over time with line graphs.",servicesClass:"LineChart",namespace:"line_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),...C1(e.dimension,e.timeDimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,xAxisFormat:e.xAxisFormat,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yDualAxisFormat:e.yDualAxisFormat,yDualAxisPostfix:e.yDualAxisPostfix,yDualAxisPrefix:e.yDualAxisPrefix,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,yDualAxisMin:e.yDualAxisMin??null,yDualAxisMax:e.yDualAxisMax??null,lineCurve:e.lineCurve,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,legendSingleRow:e.legendSingleRow,labels:e.labels,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),approxDualYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[],isDualAxisEnabled:e.isDualAxisEnabled??!1,aggregateMetricGroup:e.aggregateMetricGroup??!1}),setAttributes:PT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"lineChartV2",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisFormat:null,xAxisPostfix:"",xAxisPrefix:"",yAxisFormat:null,yAxisPostfix:"",yAxisPrefix:"",yDualAxisFormat:null,yDualAxisPostfix:"",yDualAxisPrefix:"",xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,yDualAxisMin:null,yDualAxisMax:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,legendSingleRow:!1,labels:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],trends:[],isDualAxisEnabled:!1,aggregateMetricGroup:!1,parametersV2:void 0,...o}),createFeedback:ze,schema:Gf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"lineChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Ge,"data_set"),P(Ge,"views"),{...P(Ge,"field_y_axis"),fieldFilterOptions:{forComponent:"lineChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(Ge,"field_x_axis"),fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:2,testId:"add-dimension"},P(Ge,"sort"),P(Ge,"filter"),P(Ge,"custom_metrics"),P(Ge,"limit"),P(Ge,"aggregate_metric_group")],formatPanelConfig:()=>[S1(Ge),{...P(Ge,"chart_styles"),subSection:[Ge.format_panel.chart_styles?.subSectionDefinition.legend,Ge.format_panel.chart_styles?.subSectionDefinition.legendSingleRow,Ge.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Ge),{...P(Ge,"conditional_formatting"),ruleType:"lineColor"},P(Ge,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Vf=t=>u.object({...I1(t.attributesSchemaOptions),type:u.valid("mercatorMap").required(),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),filter:yo(t.queryEngineConfig),limit:io(),dimension:lt({},t.attributesSchemaOptions),labelFormat:u.alternatives(u.string(),u.valid(null)),noDataColor:u.string().required(),backgroundColor:u.string().required(),maxValueColor:u.string().required(),minValueColor:u.string().required(),position:u.object({scale:u.number(),centerX:u.number(),centerY:u.number()}),tags:D1()}),FT=t=>(e,o)=>E1(e,o,Vf(t)),vt={title:"Country map",description:"A map component based on the Mercator projection, suitable for geographical data visualization.",namespace:"mercator_map",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use for this map?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want to show?",callToAction:"Add metric"},field_country:{type:"fieldCollector",title:"Country",description:"Which field contains the country code required to group results on?",callToAction:"Set country"},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use on this map."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this map."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Map Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Value format",description:"",namespace:"number_format"}}},map_colors:{type:"mapColors",title:"Map colors",description:""}}},Hf=t=>({title:vt.title,description:vt.description,servicesClass:"MercatorMap",namespace:vt.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,dataSetId:e.dataSetId,displaySubject:e.displaySubject,displayTitle:e.displayTitle,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),type:"mercatorMap",dimension:e.dimension,limit:e.limit,measure:c1(e.measure),labelFormat:e.labelFormat,position:e.position,filter:X1(e.filter),noDataColor:e.noDataColor||"#ffffff",backgroundColor:e.backgroundColor||"#EFF5F6",maxValueColor:e.maxValueColor||"#000000",minValueColor:e.minValueColor||"#e0e0e0",tags:e.tags??[]}),setAttributes:FT(t),validate:()=>[],init:(e,o)=>({type:"mercatorMap",dataSetId:e,dimension:[],measure:[],displaySubject:"",displayTitle:"",limit:5e3,filter:[],viewId:w0(o?.viewId),labelFormat:null,noDataColor:"#ffffff",backgroundColor:"#EFF5F6",maxValueColor:"#000000",minValueColor:"#e0e0e0",tags:[],...o}),schema:Vf(t),removeField(e,o){return e},isRunnable:e=>!!(e.dimension&&e.dimension[0]&&e.measure&&e.measure[0]),autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[P(vt,"data_set"),P(vt,"views"),{...P(vt,"field_metrics"),type:"fieldCollector",fieldFilterOptions:{forComponent:"mercatorMap"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(vt,"field_country"),fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["string"],removeRuleGrouping:!1,removeSimpleMaths:!0,removePercentage:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(vt,"filter"),P(vt,"custom_metrics"),P(vt,"limit")],formatPanelConfig:()=>[S1(vt),{...P(vt,"chart_styles"),subSection:[vt.format_panel.chart_styles?.subSectionDefinition.number_format]},P(vt,"map_colors")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),qu=t=>u.object({...I1(t.attributesSchemaOptions),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),filter:yo(t.queryEngineConfig),timeDimension:u.valid(null),order:u.array().items(_2(t.queryEngineConfig)),type:u.valid("pieChart").required(),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),limit:io(),labelsAsPercentage:u.boolean(),conditionalFormattingRules:nt(t.queryEngineConfig),labelFormat:u.alternatives(u.string(),u.valid(null)),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,tags:D1(),drilldownOptions:Cs(t.queryEngineConfig)}),we={title:"Pie chart",description:"Represents data in a circular pie-like format, useful for showing proportions.",namespace:"pie_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this pie chart?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want each segment to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},field_grouping:{type:"fieldCollector",title:"Grouping",description:"How do you want to split each section of the pie chart?",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Choose the order of segments in the pie chart"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this pie chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of segments shown on this pie chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Format",description:"",namespace:"number_format"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},Yf=t=>({title:we.title,description:we.description,servicesClass:"PieChart",namespace:we.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension).dimension,viewId:w0(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),labelsAsPercentage:e.labelsAsPercentage,legend:e.legend,labels:e.labels,labelFormat:e.labelFormat,parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),tags:e.tags??[],drilldownOptions:e.drilldownOptions}),setAttributes:(e,o)=>E1(e,o,qu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"pieChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],labelsAsPercentage:!1,legend:!0,labels:!1,labelFormat:null,parameters:{},tags:[],drilldownOptions:void 0,parametersV2:void 0,...o}),createFeedback:ze,schema:qu(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"pieChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(we,"data_set"),P(we,"views"),{...P(we,"field_metrics"),fieldFilterOptions:{forComponent:"pieChart"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(we,"field_grouping"),fieldFilterOptions:{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(we,"sort"),P(we,"filter"),{...P(we,"drilldown"),options:{property:"drilldownOptions"}},P(we,"custom_metrics"),P(we,"limit")],formatPanelConfig:()=>[S1(we),{...P(we,"conditional_formatting"),ruleType:"backgroundColor"},{...P(we,"chart_styles"),subSection:[we.format_panel.chart_styles?.subSectionDefinition.legend,we.format_panel.chart_styles?.subSectionDefinition.labels,we.format_panel.chart_styles?.subSectionDefinition.number_format]}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},parametersV2Sections:["field_metrics","field_grouping"],supportedFeatures:{parameters:"v2",colorGradient:!1}});var hu;(t=>{(e=>{e.ASC="asc",e.DESC="desc"})(t.SortDirection||(t.SortDirection={}))})(hu||(hu={}));var _O=(t=>(t.Linear="linear",t.Circular="circular",t))(_O||{});const Wu=t=>u.object({...I1(t.attributesSchemaOptions),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),filter:yo(t.queryEngineConfig),type:u.valid("progress").required(),limit:io(),conditionalFormattingRules:nt(t.queryEngineConfig),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),goals:u.array().items(u.object({field:u.string().required().description("ID of the field in the data set to which the goal applies too"),value:u.number().required().description("Value of which the goal is set")})).description("Set the target value that progression is shown towards."),progressType:u.array().items(u.object({field:u.string().required().description("ID of the field to set the progress type of"),value:u.valid(_O.Linear,_O.Circular).required()})).description("Set the display type of the progress view"),formatter:u.object().pattern(u.string(),u.string()),prefixes:u.object().pattern(u.string(),u.string()),postfixes:u.object().pattern(u.string(),u.string()),tags:D1()}),Kf=(t,e)=>{if("singleMeasure"in t){let o={},n={},a=[],p={};return t.singleMeasure&&(a=[t.singleMeasure],o[Zn(t.singleMeasure)]=t.prefix,n[Zn(t.singleMeasure)]=t.postfix,p[Zn(t.singleMeasure)]=t.formatter),{type:"singleStat",prefixes:o,postfixes:n,measure:a,formatter:p,fontSize:t.fontSize,displayTitle:t.displayTitle,displaySubject:t.displaySubject,tags:t.tags,filter:X1(t.filter),dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:t.conditionalFormattingRules,deltaTimeDimension:t.deltaTimeDimension,parameters:Re(t.parameters),parametersV2:dt(t.parameters,t.parametersV2,e)}}else return{...t,filter:X1(t.filter)}},zt={title:"Progress",description:"Used to show progress towards goals, completion of tasks, or as indicators of performance metrics.",namespace:"progress",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this progress?"},views:{type:"views",title:"View",description:""},progress_goals:{type:"progressGoals",title:"Metric",description:"What do you want to show in each progress bar?"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this progress chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},stats_labels:{type:"statsLabels",title:"Labels",description:"",subSectionDefinition:{prefix:{title:"Prefix",description:"",namespace:"prefix"},postfix:{title:"Postfix",description:"",namespace:"postfix"},format:{title:"Format",description:"",namespace:"format"},count:{title:"Label count",description:"",namespace:"count"}}},progress_type:{type:"progressType",title:"Type",description:""}}},Qf=t=>({title:zt.title,description:zt.description,dump:e=>e,namespace:zt.namespace,servicesClass:"Progress",load:e=>{const o=Kf(e,t.queryEngineConfig);return{type:"progress",updated_at:o.updated_at,measure:c1(o.measure),displayTitle:o.displayTitle,displaySubject:o.displaySubject,protectedByOrganisation:o.protectedByOrganisation,viewId:w0(o.viewId),filter:o.filter,dataSetId:o.dataSetId,limit:o.limit,conditionalFormattingRules:o.conditionalFormattingRules,parameters:o.parameters,prefixes:o.prefixes,postfixes:o.postfixes,formatter:o.formatter,goals:o.goals,progressType:o.progressType,tags:o.tags??[]}},setAttributes:(e,o)=>E1(e,o,Wu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"progress",measure:[],displayTitle:"",protectedByOrganisation:void 0,displaySubject:"",viewId:w0(o?.viewId),filter:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],parameters:{},formatter:{},progressType:[],goals:[],postfixes:{},prefixes:{},tags:[],...o}),schema:Wu(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[P(zt,"data_set"),P(zt,"views"),P(zt,"progress_goals"),P(zt,"filter"),P(zt,"custom_metrics")],formatPanelConfig:()=>[S1(zt),P(zt,"progress_type"),{...P(zt,"stats_labels"),prefix:ri(zt,"prefix"),postfix:ri(zt,"postfix"),format:ri(zt,"format"),count:ri(zt,"count")}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),Zf=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),type:u.valid("radarChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,axisTitles:Pe(),headline:jt(),tags:D1()}),kT=t=>(e,o)=>E1(e,o,Zf(t)),Lt={title:"Radar chart",description:"Visualizes multiple variables as points on axes starting from the same center point, creating a spider web-like shape. Perfect for comparing strengths and weaknesses across multiple dimensions or showing performance metrics across different categories.",namespace:"radar_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this radar chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this radar chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this radar chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"Grouping - X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},y:{title:"Metric - Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"}}}}},Jf=t=>({title:Lt.title,description:Lt.description,servicesClass:"RadarChart",namespace:Lt.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension).dimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),legend:e.legend,legendSingleRow:e.legendSingleRow,tags:e.tags??[],parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig)}),setAttributes:kT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"radarChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,legendSingleRow:!1,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:Zf(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"radarChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Lt,"data_set"),P(Lt,"views"),{...P(Lt,"field_y_axis"),fieldFilterOptions:{forComponent:"radarChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(Lt,"field_x_axis"),fieldFilterOptions:{forComponent:"radarChart",onlyDimensions:!0},preventDuplicates:!1,preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:1,testId:"add-dimension"},P(Lt,"sort"),P(Lt,"filter"),P(Lt,"custom_metrics"),P(Lt,"limit")],formatPanelConfig:()=>[S1(Lt),Ki(Lt,!1,!1,!0),ve(Lt)],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),eq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),type:u.valid("richText").required(),tags:D1(),content:u.any()}),jT=t=>(e,o)=>E1(e,o,eq(t)),Pt={title:"Rich text",description:"Add your data to a rich text component.",namespace:"rich_text",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this rich text view?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metrics",description:"What metrics do you need to collect?",callToAction:"Add metric"},field_grouping:{type:"fieldCollector",title:"Grouping",description:"How do you want to group your results?",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"How should the results be ordered?"},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this text view."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to use on this text view."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},rich_text:{type:"richText",title:"Text format",description:""}}},$T={type:"doc",content:[{type:"heading",attrs:{level:1},content:[{type:"text",text:"Rich text views"}]},{type:"paragraph",content:[{type:"text",text:"In this view, you can add any "},{type:"text",marks:[{type:"bold"}],text:"text based content"},{type:"text",text:" to your dashboard, and "},{type:"text",marks:[{type:"italic"}],text:"mix in your data with it!"}]},{type:"paragraph",content:[{type:"text",text:"Remember to use the "},{type:"text",marks:[{type:"bold"}],text:"format"},{type:"text",text:" "},{type:"text",marks:[{type:"bold"}],text:"tab"},{type:"text",text:" to "},{type:"text",marks:[{type:"underline"}],text:"style"},{type:"text",text:" your contents"}]},{type:"heading",attrs:{level:2},content:[{type:"text",text:"Adding data?"}]},{type:"paragraph",content:[{type:"text",text:"You can add data to your text content by using templating. For example, is how to take metrics "},{type:"text",marks:[{type:"code"}],text:'"Metric Name"'},{type:"text",text:" and "},{type:"text",marks:[{type:"code"}],text:'"A different metric name" '},{type:"text",text:"from the first row of the results, and show it on this view;"}]},{type:"codeBlock",attrs:{language:null},content:[{type:"text",text:`{{ data.first.metric_name }}
|
|
63
63
|
{{ data.first.a_different_metric_name }}
|
|
64
|
-
`}]}]},tq=t=>({title:Pt.title,description:Pt.description,servicesClass:"RichText",namespace:Pt.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,dataSetId:e.dataSetId,displaySubject:e.displaySubject,displayTitle:e.displayTitle,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),type:"richText",dimension:e.dimension,limit:e.limit,measure:c1(e.measure),filter:X1(e.filter),tags:e.tags??[],content:e.content||"",order:e.order||[],timeDimension:e.timeDimension||null}),setAttributes:jT(t),validate:()=>[],init:(e,o)=>({type:"richText",dataSetId:e,dimension:[],measure:[],displaySubject:"",displayTitle:"",limit:5e3,filter:[],viewId:w0(o?.viewId),tags:[],order:[],timeDimension:null,content:$T,...o}),schema:eq(t),removeField(e,o){return e},isRunnable:e=>!!(e.measure&&e.measure[0]),autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[P(Pt,"data_set"),P(Pt,"views"),{...P(Pt,"field_metrics"),fieldFilterOptions:{forComponent:"richText",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(Pt,"field_grouping"),fieldFilterOptions:{forComponent:"richText",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P(Pt,"sort"),P(Pt,"filter"),P(Pt,"custom_metrics"),P(Pt,"limit")],formatPanelConfig:()=>[S1(Pt),{...P(Pt,"rich_text")}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),oq=t=>u.object({...I1(t.attributesSchemaOptions),xMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),yMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),order:u.array().items(_2(t.queryEngineConfig)),limit:io(),legend:u.valid(!0,!1),offset:u.number().min(0),filter:yo(t.queryEngineConfig),type:u.valid("scatterChart").required(),timeDimension:u.valid(null),xAxisPrefix:u.string().allow(""),yAxisPrefix:u.string().allow(""),xAxisPostfix:u.string().allow(""),yAxisPostfix:u.string().allow(""),yAxisFormat:u.alternatives(u.string(),u.valid(null)),xAxisFormat:u.alternatives(u.string(),u.valid(null)),approxYAxisLabelCount:to,approxXAxisLabelCount:to,goalLines:Tt(),quadrants:GO(),axisTitles:Pe(),tags:D1()}),GT=t=>(e,o)=>E1(e,o,oq(t)),Ce={title:"Scatter chart",description:"Displays data points on a Cartesian plane, perfect for showing correlations.",namespace:"scatter_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this scatter chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"",subSectionDefinition:{xAxis:{type:"metrics",title:"X axis",namespace:"metrics.xAxis"},yAxis:{type:"metrics",title:"Y axis",namespace:"metrics.yAxis"}}},field_grouping:{type:"fieldCollector",title:"Grouping",description:"What do you want each dot to represent?",callToAction:"Add comparison"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of data points shown on this scatter chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""},quadrants:{type:"quadrants",title:"",description:""}}},iq=t=>({title:Ce.title,description:Ce.description,servicesClass:"ScatterChart",namespace:Ce.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,xMeasure:c1(e.xMeasure?[e.xMeasure]:[])[0]||null,yMeasure:c1(e.yMeasure?[e.yMeasure]:[])[0]||null,dimension:C1(e.dimension),viewId:w0(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:X1(e.filter),order:te(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,legend:e.legend,xAxisFormat:e.xAxisFormat,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),goalLines:e.goalLines,quadrants:e.quadrants,axisTitles:e.axisTitles,tags:e.tags??[]}),setAttributes:GT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"scatterChart",xMeasure:null,yMeasure:null,dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,legend:!0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,quadrants:void 0,axisTitles:void 0,tags:[],...o}),createFeedback:ze,schema:oq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>!!e.xMeasure&&!!e.yMeasure&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"scatterChart");return this.init(e.id,{xMeasure:o[0],yMeasure:o[1],dimension:n})},dataPanelConfig:()=>[P(Ce,"data_set"),P(Ce,"views"),{...P(Ce,"labelled_metrics"),subSection:[{...Ce.data_panel.labelled_metrics?.subSectionDefinition.xAxis,propKey:"xMeasure",allowsMultiple:!1},{...Ce.data_panel.labelled_metrics?.subSectionDefinition.yAxis,propKey:"yMeasure",allowsMultiple:!1}]},{...P(Ce,"field_grouping"),fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["boolean","number","string"],removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(Ce,"filter"),P(Ce,"custom_metrics"),P(Ce,"limit")],formatPanelConfig:()=>[S1(Ce),{...P(Ce,"chart_styles"),subSection:[Ce.format_panel.chart_styles?.subSectionDefinition.legend]},ve(Ce),P(Ce,"quadrants"),P(Ce,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),nq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),xMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).required().description("A list of metrics to be shown on the X axis. For example the `count` of a specific field in your data set."),stacked:u.valid(!0,!1,"100%"),lineCurve:Qa,legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),type:u.valid("scatterChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,quadrants:GO(),conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp()}),UT=t=>(e,o)=>E1(e,o,nq(t)),Je={title:"Scatter chart",description:"Displays data points on a Cartesian plane with X and Y coordinates.",namespace:"scatter_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this scatter chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each point to measure on the Y axis?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a point of this scatter chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each point to measure on the X axis?",callToAction:"Add metric"},field_grouping:{type:"fieldCollector",title:"Grouping - Point series",description:"How do you want to group each point?",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this scatter chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},quadrants:{type:"quadrants",title:"",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},rq=t=>({title:"Scatter chart",description:Je.description,servicesClass:"ScatterChartV2",namespace:"scatter_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),xMeasure:c1(e.xMeasure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,lineCurve:e.lineCurve,quadrants:e.quadrants,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,legendSingleRow:e.legendSingleRow,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[],parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig)}),setAttributes:UT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"scatterChartV2",measure:[],xMeasure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,lineCurve:"natural",quadrants:void 0,conditionalFormattingRules:[],drilldown:[],legend:!0,legendSingleRow:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],trends:[],parametersV2:void 0,...o}),createFeedback:ze,schema:nq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0&&e.xMeasure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"scatterChartV2");return this.init(e.id,{measure:[o[0]],dimension:n,xMeasure:[o[0]]})},dataPanelConfig:()=>[P(Je,"data_set"),P(Je,"views"),{...P(Je,"field_y_axis"),fieldFilterOptions:{forComponent:"scatterChartV2"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,maxAllowed:1,testId:"metric-input",propKey:"yMeasure"},{...P(Je,"field_x_axis"),fieldFilterOptions:{forComponent:"scatterChartV2",onlyMeasures:!0,onlyDimensions:!1},preSetPartialAttributes:e=>({xMeasure:[...e]}),getValues:e=>[...e.xMeasure],maxAllowed:1,testId:"x-metric-axis"},{...P(Je,"field_grouping"),fieldFilterOptions:{forComponent:"scatterChartV2",onlyDimensions:!0},preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:1,testId:"scatter-dimension"},P(Je,"sort"),P(Je,"filter"),P(Je,"custom_metrics"),P(Je,"limit")],formatPanelConfig:()=>[S1(Je),Ki(Je,!0,!1,!0),ve(Je),P(Je,"quadrants"),{...P(Je,"conditional_formatting"),ruleType:"lineColor"},P(Je,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),mu=t=>u.object({...I1(t.attributesSchemaOptions),fontSize:u.string().allow(""),formatter:u.object(),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),filter:yo(t.queryEngineConfig),prefixes:u.object(),postfixes:u.object(),type:u.valid("singleStat").required(),limit:io(),direction:u.string().valid("horizontal","vertical"),conditionalFormattingRules:nt(t.queryEngineConfig),deltaTimeDimension:u.alternatives(ar(t.queryEngineConfig.supportedTimeTruncFunctions),u.valid(null)),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,tags:D1()}),ge={title:"Single stat",description:"Shows a single statistical value, ideal for key data point representation.",namespace:"single_stat",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this single stat?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metrics",description:"What do you want to show?",callToAction:"Add metric"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},comparison:{type:"comparison",title:"Comparison",description:""}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},stats_labels:{type:"statsLabels",title:"Labels",description:"",subSectionDefinition:{prefix:{title:"Prefix",description:"",namespace:"prefix"},postfix:{title:"Postfix",description:"",namespace:"postfix"},format:{title:"Format",description:"",namespace:"format"},count:{title:"Label count",description:"",namespace:"count"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},format:{type:"format",title:"Format",description:"",subSectionDefinition:{font_size:{title:"Font Size",type:"fontSize",description:"",namespace:"font_size"},direction:{title:"Direction",type:"direction",description:"",namespace:"direction"}}}}},aq=t=>({title:ge.title,description:ge.description,servicesClass:"SingleStat",namespace:ge.namespace,dump:e=>e,load:e=>{const o=Kf(e,t.queryEngineConfig);return{type:"singleStat",updated_at:e.updated_at,prefixes:o.prefixes,postfixes:o.postfixes,formatter:o.formatter,fontSize:o.fontSize,measure:c1(o.measure),displayTitle:o.displayTitle,displaySubject:o.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:o.filter,dataSetId:o.dataSetId,limit:o.limit,direction:o.direction??"horizontal",conditionalFormattingRules:o.conditionalFormattingRules,deltaTimeDimension:o.deltaTimeDimension,parameters:Re(o.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),tags:o.tags??[]}},setAttributes:(e,o)=>E1(e,o,mu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"singleStat",measure:[],displayTitle:"",postfixes:{},prefixes:{},formatter:{},fontSize:"2rem",protectedByOrganisation:void 0,displaySubject:"",viewId:w0(o?.viewId),filter:[],dataSetId:e,limit:5e3,direction:"horizontal",conditionalFormattingRules:[],deltaTimeDimension:null,parameters:{},tags:[],parametersV2:void 0,...o}),schema:mu(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o}=ae(e,t.queryEngineConfig,"singleStat");return this.init(e.id,{measure:[o[0]]})},dataPanelConfig:()=>[P(ge,"data_set"),P(ge,"views"),{...P(ge,"field_metrics"),fieldFilterOptions:{forComponent:"singleStat"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},P(ge,"filter"),P(ge,"custom_metrics"),P(ge,"comparison")],formatPanelConfig:()=>[S1(ge),{...P(ge,"stats_labels"),prefix:ri(ge,"prefix"),postfix:ri(ge,"postfix"),format:ri(ge,"format"),count:ri(ge,"count")},{...P(ge,"format"),subSection:[ge.format_panel.format?.subSectionDefinition.font_size,ge.format_panel.format?.subSectionDefinition.direction]},{...P(ge,"conditional_formatting"),ruleType:"fontColor"}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_metrics"],setDataAttributesFromPreAggregatedDataSet(e,o){let n=_0.cloneDeep(Xi(o.fields,{onlyFieldTypes:["number"]}));return{...e,type:"singleStat",protectedByOrganisation:!0,measure:[...n].map(a=>({function:"none",field:a.id}))}}}),gu=t=>u.object({...I1(t.attributesSchemaOptions),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),filter:yo(t.queryEngineConfig),timeDimension:u.valid(null),order:u.array().items(_2(t.queryEngineConfig)),type:u.valid("sunburstChart").required(),legend:u.valid(!0,!1),labels:u.valid(!0,!1),limit:io(),labelsAsPercentage:u.boolean(),conditionalFormattingRules:nt(t.queryEngineConfig),labelFormat:u.alternatives(u.string(),u.valid(null)),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,tags:D1(),drilldownOptions:Cs(t.queryEngineConfig)}),et={title:"Sunburst chart",description:"Represents data in a sunburst format, useful for showing proportions.",namespace:"sunburst_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this sunburst chart?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want each segment to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this sunburst chart, what information do you want to see next?"},field_grouping:{type:"fieldCollector",title:"Grouping",description:"How do you want to split each section of the sunburst chart?",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Choose the order of segments in the sunburst chart"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this sunburst chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of segments shown on this sunburst chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Format",description:"",namespace:"number_format"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},pq=t=>({title:et.title,description:et.description,servicesClass:"SunburstChart",namespace:et.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),viewId:w0(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,conditionalFormattingRules:e.conditionalFormattingRules??[],labelsAsPercentage:e.labelsAsPercentage??!1,legend:e.legend??!0,labels:e.labels??!1,labelFormat:e.labelFormat??null,parameters:e.parameters??{},parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),tags:e.tags??[]}),setAttributes:(e,o)=>E1(e,o,gu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"sunburstChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],labelsAsPercentage:!1,legend:!0,labels:!1,labelFormat:null,parameters:{},tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:gu(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"sunburstChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(et,"data_set"),P(et,"views"),{...P(et,"field_metrics"),fieldFilterOptions:{forComponent:"sunburstChart"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(et,"field_grouping"),fieldFilterOptions:{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:5,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(et,"sort"),P(et,"filter"),P(et,"custom_metrics"),P(et,"limit")],formatPanelConfig:()=>[S1(et),{...P(et,"chart_styles"),subSection:[et.format_panel.chart_styles?.subSectionDefinition.legend,et.format_panel.chart_styles?.subSectionDefinition.labels,et.format_panel.chart_styles?.subSectionDefinition.number_format]}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_metrics","field_grouping"],supportedAggregations:["sum","count"]}),VT=["title","description","data_panel","format_panel"],HT=["title","description","callToAction"],YT="call_to_action",KT=u.alternatives().try(u.string(),u.object({sentence:u.string().custom((t,e)=>{const o=/\{\{(\w+)\}\}/g;let n;for(;(n=o.exec(t))!==null;){const a=n[1];if(!(e.state.ancestors[0][`${a}_singular`]&&e.state.ancestors[0][`${a}_plural`])){const p=`"textOverride": "${a}" found in sentence but corresponding "${a}_singular" and "${a}_plural" fields are missing`;return e.error("any.invalid",{message:p})}}return t})}).pattern(/.+_(singular|plural)$/,u.string())).messages({"any.custom":"{{#message}}"}),QT=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,ZT=/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,JT=/on[a-z]+\s*=\s*["'][^"']*["']/gi,ex=/javascript:[^\s"']+/gi,tx=/<(b|strong)>(?:(?!<\/(b|strong)>).)*<\/(b|strong)>/,ox=/<(i|em)>(?:(?!<\/(i|em)>).)*<\/(i|em)>/,ix=new RegExp(`^(?:${tx.source}|${ox.source}|[^*_<>])*$`,"m"),yu=t=>{if(QT.test(t)||ZT.test(t)||JT.test(t)||ex.test(t))throw new Error("Invalid content: potentially malicious elements detected.");return ix.test(t)};function nx(t,e){const o=t[e],n=KT.validate(o);return n.error&&n.error.details.forEach(p=>{eo(p.context?.message)}),(()=>{if(typeof o=="string")return yu(o);if(typeof o=="object")return yu(o.sentence);if(o===void 0)return!0;throw new Error("Invalid translation type")})()?o:void 0}const rx=(t,e,o,n)=>gl(t,e,o,void 0,n),gl=(t,e,o,n,a)=>{if(a)return`[key: ${t}]`;const p=n?nx(n,t):void 0;let c;return typeof p=="object"&&p!==null?c=p.sentence:typeof p=="string"?c=p:c=e,c=bx(c,o),o&&(c=ax(c,o,p)),px(c,o)};function ax(t,e,o){return Object.entries(e).forEach(([n,a])=>{if(a&&typeof a=="object"&&"count"in a){const p=a,c=p.count===1?o&&o[`${n}_singular`]||p.singular:o&&o[`${n}_plural`]||p.plural;t=t.replace(new RegExp(`{{${n}}}`,"g"),c)}}),t}function px(t,e){if(!e)return t;for(const[o,n]of Object.entries(e))if(typeof n=="string"||typeof n=="number"){const a=new RegExp(`\\[\\[${o}\\]\\]`,"g");t=t.replace(a,String(n))}return t}function bx(t,e){if(!e)return t;const o=/\[\[([^\]]+)\]\]/g;return t.replace(o,(n,a)=>{const p=a.split("|");for(const c of p){const l=e[c];if(typeof l=="string"&&l!=="")return l;if(typeof l=="number")return l.toString()}return""})}const N1=(t,e)=>{const o=e??gl;let n=t;const a=t.namespace;return VT.forEach(p=>{if(p==="title"||p==="description"){const c=o(`${a}.${p}`,t[p]);n={...n,[p]:c}}if(p==="data_panel"){const c=`${a}.${p}`,l=[];t.dataPanelConfig().forEach(M=>{M.subSection&&(M.subSection=Ru(M,o,c)),SM(M).forEach(g=>{const y=o(`${c}.${g.key}`,g.defaultValue);M[g.property]=y}),l.push(M)}),n={...n,dataPanelConfig:()=>l}}if(p==="format_panel"){const c=`${a}.${p}`,l=[];t.formatPanelConfig().forEach(M=>{M.subSection&&(M.subSection=Ru(M,o,c)),Mx(o,c,M),SM(M).forEach(g=>{const y=o(`${c}.${g.key}`,g.defaultValue);M[g.property]=y}),l.push(M)}),n={...n,formatPanelConfig:()=>l}}}),n},tO=["count","axisTitle","format","postfix","prefix"];function Mx(t,e,o){function n(p,c){p&&SM(p).forEach(l=>{const M=t(`${e}.${c}.${l.key}`,l.defaultValue);p[l.property]=M})}function a(p,c,l){c.forEach(M=>{const g=p[M];g&&n(g,l)})}o.x&&(a(o.x,tO,"axis_labels"),n(o.x,"axis_labels")),o.y&&(a(o.y,tO,"axis_labels"),n(o.y,"axis_labels")),sx(o)&&a(o,tO,"stats_labels")}function Ru(t,e,o){return t.subSection?.map(n=>(SM(n).forEach(a=>{const p=e(`${o}.${t.namespace}.${a.key}`,a.defaultValue);n[a.property]=p}),n))}function SM(t){const e=t.namespace||t.type;if(!e)return[];const o=[];return HT.forEach(n=>{if(t[n]){let a=n;n==="callToAction"&&(a=YT),o.push({key:`${e}.${a}`,defaultValue:t[n],property:n})}}),o}function sx(t){return"prefix"in t}const bq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions,["all70","all90"]),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),type:u.valid("waterfallChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,axisTitles:Pe(),headline:jt(),tags:D1(),increaseColor:u.string().required(),decreaseColor:u.string().required(),comparison:u.any()}),cx=t=>(e,o)=>E1(e,o,bq(t)),Xe={title:"Waterfall chart",description:"Shows a running total as values are added or subtracted. It's useful for understanding how an initial value is affected by a series of positive and negative values.",namespace:"waterfall_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this waterfall chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example would be a a date grouping to show each month as a bar",callToAction:"Add grouping"},dateComparison:{type:"dateComparison",title:"Comparison",description:"Compare the waterfall chart to a previous period.",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this waterfall chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this waterfall chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},waterfall_colors:{type:"waterfallColors",title:"Color selector",description:""}}},Mq=t=>({title:Xe.title,description:Xe.description,servicesClass:"WaterfallChart",namespace:Xe.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,measure:c1(e.measure),order:te(e.order,e.timeDimension),filter:X1(e.filter),dimension:mo({timeDimension:e.timeDimension??null,dimension:C1(e.dimension)}),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),headline:vo(e.headline,e.timeDimension),tags:e.tags??[],legend:e.legend,labels:e.labels,viewId:w0(e.viewId),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,displaySubject:e.displaySubject,displayTitle:e.displayTitle,increaseColor:e.increaseColor,decreaseColor:e.decreaseColor,protectedByOrganisation:e.protectedByOrganisation,type:e.type,offset:e.offset,comparison:e.comparison}),setAttributes:cx(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"waterfallChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,protectedByOrganisation:void 0,offset:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,legend:!0,labels:!1,parameters:{},axisTitles:void 0,headline:void 0,increaseColor:"#00FF00",decreaseColor:"#FF0000",tags:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",comparison:null,parametersV2:void 0,...o}),createFeedback:ze,schema:bq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&(e.dimension.length>0||e.timeDimension!==null),autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"waterfallChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Xe,"data_set"),P(Xe,"views"),{...P(Xe,"field_y_axis"),fieldFilterOptions:{forComponent:"waterfallChart",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input",maxAllowed:1},{...P(Xe,"field_x_axis"),fieldFilterOptions:{forComponent:"waterfallChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:e=>({dimension:[...e],timeDimension:null}),getValues:e=>mo(e),maxAllowed:1,testId:"add-dimension"},{...P(Xe,"dateComparison"),maxAllowed:1},P(Xe,"sort"),P(Xe,"filter"),P(Xe,"custom_metrics"),P(Xe,"limit")],formatPanelConfig:()=>[S1(Xe),P(Xe,"waterfall_colors"),{...P(Xe,"chart_styles"),subSection:[Xe.format_panel.chart_styles?.subSectionDefinition.legend,Xe.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Xe)],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),sq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),approxYAxisLabelCount:jO(["all70","all90"]),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),type:u.valid("horizontalWaterfallChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,axisTitles:Pe(),headline:jt(),tags:D1(),increaseColor:u.string().required(),decreaseColor:u.string().required(),comparison:u.any()}),zx=t=>(e,o)=>E1(e,o,sq(t)),Ee={title:"Horizontal Waterfall chart",description:"Shows a running total as values are added or subtracted, with categories on the Y axis and values on the X axis. It's useful for understanding how an initial value is affected by a series of positive and negative values.",namespace:"horizontal_waterfall_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this horizontal waterfall chart?"},views:{type:"views",title:"View",description:""},field_x_axis:{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_y_axis:{type:"fieldCollector",title:"Grouping - Y Axis",description:"What do you want each bar to represent? An example would be a a date grouping to show each month as a bar",callToAction:"Add grouping"},dateComparison:{type:"dateComparison",title:"Comparison",description:"Compare the waterfall chart to a previous period.",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this horizontal waterfall chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this horizontal waterfall chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},waterfall_colors:{type:"waterfallColors",title:"Color selector",description:""}}},cq=t=>({title:Ee.title,description:Ee.description,servicesClass:"HorizontalWaterfallChart",namespace:Ee.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,measure:c1(e.measure),order:te(e.order,e.timeDimension),filter:X1(e.filter),dimension:mo({timeDimension:e.timeDimension??null,dimension:C1(e.dimension)}),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),headline:vo(e.headline,e.timeDimension),tags:e.tags??[],legend:e.legend,labels:e.labels,viewId:w0(e.viewId),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:Mi(e.approxYAxisLabelCount),axisTitles:e.axisTitles,displaySubject:e.displaySubject,displayTitle:e.displayTitle,increaseColor:e.increaseColor,decreaseColor:e.decreaseColor,protectedByOrganisation:e.protectedByOrganisation,type:e.type,offset:e.offset,comparison:e.comparison}),setAttributes:zx(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"horizontalWaterfallChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,protectedByOrganisation:void 0,offset:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,legend:!0,labels:!1,parameters:{},axisTitles:void 0,headline:void 0,increaseColor:"#00FF00",decreaseColor:"#FF0000",tags:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",comparison:null,parametersV2:void 0,...o}),createFeedback:ze,schema:sq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&(e.dimension.length>0||e.timeDimension!==null),autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"horizontalWaterfallChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Ee,"data_set"),P(Ee,"views"),{...P(Ee,"field_x_axis"),fieldFilterOptions:{forComponent:"horizontalWaterfallChart",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input",maxAllowed:1},{...P(Ee,"field_y_axis"),fieldFilterOptions:{forComponent:"horizontalWaterfallChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:e=>({dimension:[...e],timeDimension:null}),getValues:e=>mo(e),maxAllowed:1,testId:"add-dimension"},{...P(Ee,"dateComparison"),maxAllowed:1},P(Ee,"sort"),P(Ee,"filter"),P(Ee,"custom_metrics"),P(Ee,"limit")],formatPanelConfig:()=>[S1(Ee),P(Ee,"waterfall_colors"),{...P(Ee,"chart_styles"),subSection:[Ee.format_panel.chart_styles?.subSectionDefinition.legend,Ee.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Ee)],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_x_axis","field_y_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Ox=t=>u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).max(1).required(),vu=t=>lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions).max(1).required(),Lu=t=>lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions).max(1).default([]),zq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),measure:Ox(t),dimension:vu(t),xDimension:vu(t),drilldown:u.forbidden(),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),showSpendMarkers:u.valid(!0,!1).default(!0),pointNameDimension:Lu(t),pointValueDimension:Lu(t),type:u.valid("curveViewerChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,axisTitles:Pe(),tags:D1()}),lx=t=>(e,o)=>E1(e,o,zq(t)),tt={title:"Curve Viewer",description:"Compare response curves across channels with one smooth line per channel. Map a metric on the Y axis, a numeric column on the X axis, and a grouping column to define each series.",namespace:"curve_viewer_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this curve viewer?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What metric do you want to plot on the Y axis?",callToAction:"Select a metric"},field_x_axis:{type:"fieldCollector",title:"X Axis",description:"What column do you want to plot on the X axis? An example might be a spend column.",callToAction:"Select a column"},field_grouping:{type:"fieldCollector",title:"Group by",description:"What column defines each curve? An example might be a channel field.",callToAction:"Select a column"},sort:{type:"sort",title:"Sort",description:"Select how the curve viewer results should be ordered."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this curve viewer."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this curve viewer."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},showSpendMarkers:{type:"legend",title:"Show Spend Markers",description:"",namespace:"showSpendMarkers"},pointValueDimension:{type:"fieldCollector",title:"Value column",description:"",namespace:"pointValueDimension",callToAction:"Select..."},pointNameDimension:{type:"fieldCollector",title:"Spend markers column",description:"",namespace:"pointNameDimension",callToAction:"Select..."}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},y:{title:"Metric - Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"}}}}},oO=tt.format_panel.chart_styles?.subSectionDefinition,Oq=t=>({title:tt.title,description:tt.description,servicesClass:"CurveViewerChart",namespace:tt.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),xDimension:C1(e.xDimension),order:te(e.order,e.timeDimension),dimension:C1(e.dimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),legend:e.legend,legendSingleRow:e.legendSingleRow,showSpendMarkers:e.showSpendMarkers??!0,pointNameDimension:C1(e.pointNameDimension??[]),pointValueDimension:C1(e.pointValueDimension??[]),tags:e.tags??[],parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),axisTitles:e.axisTitles}),setAttributes:lx(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"curveViewerChart",measure:[],xDimension:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,legendSingleRow:!1,showSpendMarkers:!0,pointNameDimension:[],pointValueDimension:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:zq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length===1&&e.xDimension.length===1&&e.dimension.length===1,autoGenerate(e){return this.init(e.id,{measure:[],xDimension:[],dimension:[]})},dataPanelConfig:()=>[P(tt,"data_set"),P(tt,"views"),{...P(tt,"field_y_axis"),fieldFilterOptions:{forComponent:"curveViewerChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,maxAllowed:1,testId:"metric-input"},{...P(tt,"field_x_axis"),fieldFilterOptions:{forComponent:"curveViewerChart",onlyMeasures:!0,onlyFieldTypes:["number"]},preSetPartialAttributes:e=>({xDimension:e.map(o=>({field:o.field,function:"none"}))}),getValues:e=>[...e.xDimension],maxAllowed:1,testId:"x-axis-dimension"},{...P(tt,"field_grouping"),fieldFilterOptions:{forComponent:"curveViewerChart",onlyDimensions:!0},preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:1,testId:"group-by-dimension"},P(tt,"sort"),P(tt,"filter"),P(tt,"custom_metrics"),P(tt,"limit")],formatPanelConfig:()=>[S1(tt),{...P(tt,"chart_styles"),subSection:[oO.legend,oO.legendSingleRow,oO.showSpendMarkers]},ve(tt)],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis","field_grouping"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),ux=()=>oo.QueryEngineConfig.getQueryEngineConfig("postgres"),Ax=()=>oo.QueryEngineConfig.getQueryEngineConfig("redshift"),dx=()=>oo.QueryEngineConfig.getQueryEngineConfig("bigquery"),fx=()=>oo.QueryEngineConfig.getQueryEngineConfig("microsoftSQLServer"),qx=()=>oo.QueryEngineConfig.getQueryEngineConfig("mariadb"),hx=()=>oo.QueryEngineConfig.getQueryEngineConfig("snowflake"),Wx=()=>oo.QueryEngineConfig.getQueryEngineConfig("mysql"),BM=oo.QueryEngineConfig.getQueryEngineConfig("js"),lq=t=>{switch(t){case"js":return BM;case"postgres":return ux();case"redshift":return Ax();case"bigquery":return dx();case"mariadb":return qx();case"snowflake":return hx();case"mysql":return Wx();case"microsoftSQLServer":return fx();case"SQLite":throw"SQLite not support via the query engine"}},T1={queryEngineConfig:lq("snowflake")};function fo(t,e){if(t=="areaChart")return N1(df(e||T1),e?.textOverride);if(t=="barChart")return N1(hf(e||T1),e?.textOverride);if(t=="basicTable")return N1(Rf(e||T1),e?.textOverride);if(t=="bubbleChart")return N1(Lf(e||T1),e?.textOverride);if(t=="bubbleChartV2")return N1(Nf(e||T1),e?.textOverride);if(t=="scatterChartV2")return N1(rq(e||T1),e?.textOverride);if(t=="comboChart")return N1(Sf(e||T1),e?.textOverride);if(t=="custom")return N1(Cf(e||T1),e?.textOverride);if(t=="dataTable")return N1(Ef(e||T1),e?.textOverride);if(t=="funnelChart")return N1(If(e||T1),e?.textOverride);if(t=="richText")return N1(tq(e||T1),e?.textOverride);if(t=="horizontalBarChart")return N1(Pf(e||T1),e?.textOverride);if(t=="horizontalBarChartV2")return N1(kf(e||T1),e?.textOverride);if(t=="lineChart")return N1($f(e||T1),e?.textOverride);if(t=="lineChartV2")return N1(Uf(e||T1),e?.textOverride);if(t=="barChartV2")return N1(mf(e||T1),e?.textOverride);if(t=="areaChartV2")return N1(qf(e||T1),e?.textOverride);if(t=="comboChartV2")return N1(wf(e||T1),e?.textOverride);if(t=="mercatorMap")return N1(Hf(e||T1),e?.textOverride);if(t=="pieChart")return N1(Yf(e||T1),e?.textOverride);if(t=="sunburstChart")return N1(pq(e||T1),e?.textOverride);if(t=="progress")return N1(Qf(e||T1),e?.textOverride);if(t=="scatterChart")return N1(iq(e||T1),e?.textOverride);if(t=="singleStat")return N1(aq(e||T1),e?.textOverride);if(t=="waterfallChart")return N1(Mq(e||T1),e?.textOverride);if(t=="horizontalWaterfallChart")return N1(cq(e||T1),e?.textOverride);if(t=="radarChart")return N1(Jf(e||T1),e?.textOverride);if(t=="curveViewerChart")return N1(Oq(e||T1),e?.textOverride);throw`Cannot get interface for ${t}. Please implement it.`}var mx={exports:{}};/**
|
|
64
|
+
`}]}]},tq=t=>({title:Pt.title,description:Pt.description,servicesClass:"RichText",namespace:Pt.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,dataSetId:e.dataSetId,displaySubject:e.displaySubject,displayTitle:e.displayTitle,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),type:"richText",dimension:e.dimension,limit:e.limit,measure:c1(e.measure),filter:X1(e.filter),tags:e.tags??[],content:e.content||"",order:e.order||[],timeDimension:e.timeDimension||null}),setAttributes:jT(t),validate:()=>[],init:(e,o)=>({type:"richText",dataSetId:e,dimension:[],measure:[],displaySubject:"",displayTitle:"",limit:5e3,filter:[],viewId:w0(o?.viewId),tags:[],order:[],timeDimension:null,content:$T,...o}),schema:eq(t),removeField(e,o){return e},isRunnable:e=>!!(e.measure&&e.measure[0]),autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[P(Pt,"data_set"),P(Pt,"views"),{...P(Pt,"field_metrics"),fieldFilterOptions:{forComponent:"richText",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(Pt,"field_grouping"),fieldFilterOptions:{forComponent:"richText",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:(e,o)=>lr(e,o),getValues:e=>mo(e),maxAllowed:2,testId:"add-dimension"},P(Pt,"sort"),P(Pt,"filter"),P(Pt,"custom_metrics"),P(Pt,"limit")],formatPanelConfig:()=>[S1(Pt),{...P(Pt,"rich_text")}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),oq=t=>u.object({...I1(t.attributesSchemaOptions),xMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),yMeasure:ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions).allow(null),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),order:u.array().items(_2(t.queryEngineConfig)),limit:io(),legend:u.valid(!0,!1),offset:u.number().min(0),filter:yo(t.queryEngineConfig),type:u.valid("scatterChart").required(),timeDimension:u.valid(null),xAxisPrefix:u.string().allow(""),yAxisPrefix:u.string().allow(""),xAxisPostfix:u.string().allow(""),yAxisPostfix:u.string().allow(""),yAxisFormat:u.alternatives(u.string(),u.valid(null)),xAxisFormat:u.alternatives(u.string(),u.valid(null)),approxYAxisLabelCount:to,approxXAxisLabelCount:to,goalLines:Tt(),quadrants:GO(),axisTitles:Pe(),tags:D1()}),GT=t=>(e,o)=>E1(e,o,oq(t)),Ce={title:"Scatter chart",description:"Displays data points on a Cartesian plane, perfect for showing correlations.",namespace:"scatter_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this scatter chart?"},views:{type:"views",title:"View",description:""},labelled_metrics:{type:"labelledMetrics",title:"Metric - Y Axis",description:"",subSectionDefinition:{xAxis:{type:"metrics",title:"X axis",namespace:"metrics.xAxis"},yAxis:{type:"metrics",title:"Y axis",namespace:"metrics.yAxis"}}},field_grouping:{type:"fieldCollector",title:"Grouping",description:"What do you want each dot to represent?",callToAction:"Add comparison"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of data points shown on this scatter chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},goal_line:{type:"goalLine",title:"Goal Lines",description:""},quadrants:{type:"quadrants",title:"",description:""}}},iq=t=>({title:Ce.title,description:Ce.description,servicesClass:"ScatterChart",namespace:Ce.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,xMeasure:c1(e.xMeasure?[e.xMeasure]:[])[0]||null,yMeasure:c1(e.yMeasure?[e.yMeasure]:[])[0]||null,dimension:C1(e.dimension).dimension,viewId:w0(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:X1(e.filter),order:te(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,legend:e.legend,xAxisFormat:e.xAxisFormat,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),goalLines:e.goalLines,quadrants:e.quadrants,axisTitles:e.axisTitles,tags:e.tags??[]}),setAttributes:GT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"scatterChart",xMeasure:null,yMeasure:null,dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,legend:!0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,quadrants:void 0,axisTitles:void 0,tags:[],...o}),createFeedback:ze,schema:oq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>!!e.xMeasure&&!!e.yMeasure&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"scatterChart");return this.init(e.id,{xMeasure:o[0],yMeasure:o[1],dimension:n})},dataPanelConfig:()=>[P(Ce,"data_set"),P(Ce,"views"),{...P(Ce,"labelled_metrics"),subSection:[{...Ce.data_panel.labelled_metrics?.subSectionDefinition.xAxis,propKey:"xMeasure",allowsMultiple:!1},{...Ce.data_panel.labelled_metrics?.subSectionDefinition.yAxis,propKey:"yMeasure",allowsMultiple:!1}]},{...P(Ce,"field_grouping"),fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["boolean","number","string"],removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(Ce,"filter"),P(Ce,"custom_metrics"),P(Ce,"limit")],formatPanelConfig:()=>[S1(Ce),{...P(Ce,"chart_styles"),subSection:[Ce.format_panel.chart_styles?.subSectionDefinition.legend]},ve(Ce),P(Ce,"quadrants"),P(Ce,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:!1,colorGradient:!1}}),nq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),xMeasure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).required().description("A list of metrics to be shown on the X axis. For example the `count` of a specific field in your data set."),stacked:u.valid(!0,!1,"100%"),lineCurve:Qa,legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),type:u.valid("scatterChartV2").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,quadrants:GO(),conditionalFormattingRules:nt(t.queryEngineConfig),goalLines:Tt(),axisTitles:Pe(),headline:jt(),tags:D1(),trends:pp()}),UT=t=>(e,o)=>E1(e,o,nq(t)),Je={title:"Scatter chart",description:"Displays data points on a Cartesian plane with X and Y coordinates.",namespace:"scatter_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this scatter chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each point to measure on the Y axis?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a point of this scatter chart, what information do you want to see next?"},field_x_axis:{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each point to measure on the X axis?",callToAction:"Add metric"},field_grouping:{type:"fieldCollector",title:"Grouping - Point series",description:"How do you want to group each point?",callToAction:"Add grouping"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this scatter chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{curve:{type:"curve",title:"Line Style",description:"",namespace:"curve"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},quadrants:{type:"quadrants",title:"",description:""},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},headline:{type:"headline",title:"Headline",description:""},goal_line:{type:"goalLine",title:"Goal Lines",description:""}}},rq=t=>({title:"Scatter chart",description:Je.description,servicesClass:"ScatterChartV2",namespace:"scatter_chart",dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),xMeasure:c1(e.xMeasure),order:te(e.order,e.timeDimension),...C1(e.dimension,e.timeDimension),displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,lineCurve:e.lineCurve,quadrants:e.quadrants,conditionalFormattingRules:Nt(t.queryEngineConfig,e.conditionalFormattingRules),drilldown:e.drilldown,legend:e.legend,legendSingleRow:e.legendSingleRow,goalLines:e.goalLines,headline:vo(e.headline,e.timeDimension),parameters:Re(e.parameters),approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,tags:e.tags??[],trends:e.trends??[],parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig)}),setAttributes:UT(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"scatterChartV2",measure:[],xMeasure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,lineCurve:"natural",quadrants:void 0,conditionalFormattingRules:[],drilldown:[],legend:!0,legendSingleRow:!1,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,headline:void 0,tags:[],trends:[],parametersV2:void 0,...o}),createFeedback:ze,schema:nq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0&&e.xMeasure.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"scatterChartV2");return this.init(e.id,{measure:[o[0]],dimension:n,xMeasure:[o[0]]})},dataPanelConfig:()=>[P(Je,"data_set"),P(Je,"views"),{...P(Je,"field_y_axis"),fieldFilterOptions:{forComponent:"scatterChartV2"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,maxAllowed:1,testId:"metric-input",propKey:"yMeasure"},{...P(Je,"field_x_axis"),fieldFilterOptions:{forComponent:"scatterChartV2",onlyMeasures:!0,onlyDimensions:!1},preSetPartialAttributes:e=>({xMeasure:[...e]}),getValues:e=>[...e.xMeasure],maxAllowed:1,testId:"x-metric-axis"},{...P(Je,"field_grouping"),fieldFilterOptions:{forComponent:"scatterChartV2",onlyDimensions:!0},preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:1,testId:"scatter-dimension"},P(Je,"sort"),P(Je,"filter"),P(Je,"custom_metrics"),P(Je,"limit")],formatPanelConfig:()=>[S1(Je),Ki(Je,!0,!1,!0),ve(Je),P(Je,"quadrants"),{...P(Je,"conditional_formatting"),ruleType:"lineColor"},P(Je,"goal_line")],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),mu=t=>u.object({...I1(t.attributesSchemaOptions),fontSize:u.string().allow(""),formatter:u.object(),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),filter:yo(t.queryEngineConfig),prefixes:u.object(),postfixes:u.object(),type:u.valid("singleStat").required(),limit:io(),direction:u.string().valid("horizontal","vertical"),conditionalFormattingRules:nt(t.queryEngineConfig),deltaTimeDimension:u.alternatives(ar(t.queryEngineConfig.supportedTimeTruncFunctions),u.valid(null)),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,tags:D1()}),ge={title:"Single stat",description:"Shows a single statistical value, ideal for key data point representation.",namespace:"single_stat",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this single stat?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metrics",description:"What do you want to show?",callToAction:"Add metric"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},comparison:{type:"comparison",title:"Comparison",description:""}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},stats_labels:{type:"statsLabels",title:"Labels",description:"",subSectionDefinition:{prefix:{title:"Prefix",description:"",namespace:"prefix"},postfix:{title:"Postfix",description:"",namespace:"postfix"},format:{title:"Format",description:"",namespace:"format"},count:{title:"Label count",description:"",namespace:"count"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""},format:{type:"format",title:"Format",description:"",subSectionDefinition:{font_size:{title:"Font Size",type:"fontSize",description:"",namespace:"font_size"},direction:{title:"Direction",type:"direction",description:"",namespace:"direction"}}}}},aq=t=>({title:ge.title,description:ge.description,servicesClass:"SingleStat",namespace:ge.namespace,dump:e=>e,load:e=>{const o=Kf(e,t.queryEngineConfig);return{type:"singleStat",updated_at:e.updated_at,prefixes:o.prefixes,postfixes:o.postfixes,formatter:o.formatter,fontSize:o.fontSize,measure:c1(o.measure),displayTitle:o.displayTitle,displaySubject:o.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:o.filter,dataSetId:o.dataSetId,limit:o.limit,direction:o.direction??"horizontal",conditionalFormattingRules:o.conditionalFormattingRules,deltaTimeDimension:o.deltaTimeDimension,parameters:Re(o.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),tags:o.tags??[]}},setAttributes:(e,o)=>E1(e,o,mu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"singleStat",measure:[],displayTitle:"",postfixes:{},prefixes:{},formatter:{},fontSize:"2rem",protectedByOrganisation:void 0,displaySubject:"",viewId:w0(o?.viewId),filter:[],dataSetId:e,limit:5e3,direction:"horizontal",conditionalFormattingRules:[],deltaTimeDimension:null,parameters:{},tags:[],parametersV2:void 0,...o}),schema:mu(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(e){const{measure:o}=ae(e,t.queryEngineConfig,"singleStat");return this.init(e.id,{measure:[o[0]]})},dataPanelConfig:()=>[P(ge,"data_set"),P(ge,"views"),{...P(ge,"field_metrics"),fieldFilterOptions:{forComponent:"singleStat"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},P(ge,"filter"),P(ge,"custom_metrics"),P(ge,"comparison")],formatPanelConfig:()=>[S1(ge),{...P(ge,"stats_labels"),prefix:ri(ge,"prefix"),postfix:ri(ge,"postfix"),format:ri(ge,"format"),count:ri(ge,"count")},{...P(ge,"format"),subSection:[ge.format_panel.format?.subSectionDefinition.font_size,ge.format_panel.format?.subSectionDefinition.direction]},{...P(ge,"conditional_formatting"),ruleType:"fontColor"}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_metrics"],setDataAttributesFromPreAggregatedDataSet(e,o){let n=_0.cloneDeep(Xi(o.fields,{onlyFieldTypes:["number"]}));return{...e,type:"singleStat",protectedByOrganisation:!0,measure:[...n].map(a=>({function:"none",field:a.id}))}}}),gu=t=>u.object({...I1(t.attributesSchemaOptions),measure:u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)),dimension:lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions),filter:yo(t.queryEngineConfig),timeDimension:u.valid(null),order:u.array().items(_2(t.queryEngineConfig)),type:u.valid("sunburstChart").required(),legend:u.valid(!0,!1),labels:u.valid(!0,!1),limit:io(),labelsAsPercentage:u.boolean(),conditionalFormattingRules:nt(t.queryEngineConfig),labelFormat:u.alternatives(u.string(),u.valid(null)),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,tags:D1(),drilldownOptions:Cs(t.queryEngineConfig)}),et={title:"Sunburst chart",description:"Represents data in a sunburst format, useful for showing proportions.",namespace:"sunburst_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this sunburst chart?"},views:{type:"views",title:"View",description:""},field_metrics:{type:"fieldCollector",title:"Metric",description:"What do you want each segment to measure?",callToAction:"Add metric"},drilldown:{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this sunburst chart, what information do you want to see next?"},field_grouping:{type:"fieldCollector",title:"Grouping",description:"How do you want to split each section of the sunburst chart?",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Choose the order of segments in the sunburst chart"},filter:{type:"filter",title:"Filters",description:"Only include the information you want in this sunburst chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Limit the number of segments shown on this sunburst chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{number_format:{type:"numberFormat",title:"Format",description:"",namespace:"number_format"},legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},conditional_formatting:{type:"conditionalFormatting",title:"Conditional Formatting",description:""}}},pq=t=>({title:et.title,description:et.description,servicesClass:"SunburstChart",namespace:et.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),order:te(e.order,e.timeDimension),dimension:C1(e.dimension).dimension,viewId:w0(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,conditionalFormattingRules:e.conditionalFormattingRules??[],labelsAsPercentage:e.labelsAsPercentage??!1,legend:e.legend??!0,labels:e.labels??!1,labelFormat:e.labelFormat??null,parameters:e.parameters??{},parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),tags:e.tags??[]}),setAttributes:(e,o)=>E1(e,o,gu(t)),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"sunburstChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],labelsAsPercentage:!1,legend:!0,labels:!1,labelFormat:null,parameters:{},tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:gu(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&e.dimension.length>0,autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"sunburstChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(et,"data_set"),P(et,"views"),{...P(et,"field_metrics"),fieldFilterOptions:{forComponent:"sunburstChart"},maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{...P(et,"field_grouping"),fieldFilterOptions:{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:5,preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},P(et,"sort"),P(et,"filter"),P(et,"custom_metrics"),P(et,"limit")],formatPanelConfig:()=>[S1(et),{...P(et,"chart_styles"),subSection:[et.format_panel.chart_styles?.subSectionDefinition.legend,et.format_panel.chart_styles?.subSectionDefinition.labels,et.format_panel.chart_styles?.subSectionDefinition.number_format]}],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_metrics","field_grouping"],supportedAggregations:["sum","count"]}),VT=["title","description","data_panel","format_panel"],HT=["title","description","callToAction"],YT="call_to_action",KT=u.alternatives().try(u.string(),u.object({sentence:u.string().custom((t,e)=>{const o=/\{\{(\w+)\}\}/g;let n;for(;(n=o.exec(t))!==null;){const a=n[1];if(!(e.state.ancestors[0][`${a}_singular`]&&e.state.ancestors[0][`${a}_plural`])){const p=`"textOverride": "${a}" found in sentence but corresponding "${a}_singular" and "${a}_plural" fields are missing`;return e.error("any.invalid",{message:p})}}return t})}).pattern(/.+_(singular|plural)$/,u.string())).messages({"any.custom":"{{#message}}"}),QT=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,ZT=/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,JT=/on[a-z]+\s*=\s*["'][^"']*["']/gi,ex=/javascript:[^\s"']+/gi,tx=/<(b|strong)>(?:(?!<\/(b|strong)>).)*<\/(b|strong)>/,ox=/<(i|em)>(?:(?!<\/(i|em)>).)*<\/(i|em)>/,ix=new RegExp(`^(?:${tx.source}|${ox.source}|[^*_<>])*$`,"m"),yu=t=>{if(QT.test(t)||ZT.test(t)||JT.test(t)||ex.test(t))throw new Error("Invalid content: potentially malicious elements detected.");return ix.test(t)};function nx(t,e){const o=t[e],n=KT.validate(o);return n.error&&n.error.details.forEach(p=>{eo(p.context?.message)}),(()=>{if(typeof o=="string")return yu(o);if(typeof o=="object")return yu(o.sentence);if(o===void 0)return!0;throw new Error("Invalid translation type")})()?o:void 0}const rx=(t,e,o,n)=>gl(t,e,o,void 0,n),gl=(t,e,o,n,a)=>{if(a)return`[key: ${t}]`;const p=n?nx(n,t):void 0;let c;return typeof p=="object"&&p!==null?c=p.sentence:typeof p=="string"?c=p:c=e,c=bx(c,o),o&&(c=ax(c,o,p)),px(c,o)};function ax(t,e,o){return Object.entries(e).forEach(([n,a])=>{if(a&&typeof a=="object"&&"count"in a){const p=a,c=p.count===1?o&&o[`${n}_singular`]||p.singular:o&&o[`${n}_plural`]||p.plural;t=t.replace(new RegExp(`{{${n}}}`,"g"),c)}}),t}function px(t,e){if(!e)return t;for(const[o,n]of Object.entries(e))if(typeof n=="string"||typeof n=="number"){const a=new RegExp(`\\[\\[${o}\\]\\]`,"g");t=t.replace(a,String(n))}return t}function bx(t,e){if(!e)return t;const o=/\[\[([^\]]+)\]\]/g;return t.replace(o,(n,a)=>{const p=a.split("|");for(const c of p){const l=e[c];if(typeof l=="string"&&l!=="")return l;if(typeof l=="number")return l.toString()}return""})}const N1=(t,e)=>{const o=e??gl;let n=t;const a=t.namespace;return VT.forEach(p=>{if(p==="title"||p==="description"){const c=o(`${a}.${p}`,t[p]);n={...n,[p]:c}}if(p==="data_panel"){const c=`${a}.${p}`,l=[];t.dataPanelConfig().forEach(M=>{M.subSection&&(M.subSection=Ru(M,o,c)),SM(M).forEach(g=>{const y=o(`${c}.${g.key}`,g.defaultValue);M[g.property]=y}),l.push(M)}),n={...n,dataPanelConfig:()=>l}}if(p==="format_panel"){const c=`${a}.${p}`,l=[];t.formatPanelConfig().forEach(M=>{M.subSection&&(M.subSection=Ru(M,o,c)),Mx(o,c,M),SM(M).forEach(g=>{const y=o(`${c}.${g.key}`,g.defaultValue);M[g.property]=y}),l.push(M)}),n={...n,formatPanelConfig:()=>l}}}),n},tO=["count","axisTitle","format","postfix","prefix"];function Mx(t,e,o){function n(p,c){p&&SM(p).forEach(l=>{const M=t(`${e}.${c}.${l.key}`,l.defaultValue);p[l.property]=M})}function a(p,c,l){c.forEach(M=>{const g=p[M];g&&n(g,l)})}o.x&&(a(o.x,tO,"axis_labels"),n(o.x,"axis_labels")),o.y&&(a(o.y,tO,"axis_labels"),n(o.y,"axis_labels")),sx(o)&&a(o,tO,"stats_labels")}function Ru(t,e,o){return t.subSection?.map(n=>(SM(n).forEach(a=>{const p=e(`${o}.${t.namespace}.${a.key}`,a.defaultValue);n[a.property]=p}),n))}function SM(t){const e=t.namespace||t.type;if(!e)return[];const o=[];return HT.forEach(n=>{if(t[n]){let a=n;n==="callToAction"&&(a=YT),o.push({key:`${e}.${a}`,defaultValue:t[n],property:n})}}),o}function sx(t){return"prefix"in t}const bq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions,["all70","all90"]),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),type:u.valid("waterfallChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,axisTitles:Pe(),headline:jt(),tags:D1(),increaseColor:u.string().required(),decreaseColor:u.string().required(),comparison:u.any()}),cx=t=>(e,o)=>E1(e,o,bq(t)),Xe={title:"Waterfall chart",description:"Shows a running total as values are added or subtracted. It's useful for understanding how an initial value is affected by a series of positive and negative values.",namespace:"waterfall_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this waterfall chart?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_x_axis:{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example would be a a date grouping to show each month as a bar",callToAction:"Add grouping"},dateComparison:{type:"dateComparison",title:"Comparison",description:"Compare the waterfall chart to a previous period.",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this waterfall chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this waterfall chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},waterfall_colors:{type:"waterfallColors",title:"Color selector",description:""}}},Mq=t=>({title:Xe.title,description:Xe.description,servicesClass:"WaterfallChart",namespace:Xe.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,measure:c1(e.measure),order:te(e.order,e.timeDimension),filter:X1(e.filter),dimension:mo({timeDimension:e.timeDimension??null,dimension:C1(e.dimension).dimension}),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),headline:vo(e.headline,e.timeDimension),tags:e.tags??[],legend:e.legend,labels:e.labels,viewId:w0(e.viewId),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),axisTitles:e.axisTitles,displaySubject:e.displaySubject,displayTitle:e.displayTitle,increaseColor:e.increaseColor,decreaseColor:e.decreaseColor,protectedByOrganisation:e.protectedByOrganisation,type:e.type,offset:e.offset,comparison:e.comparison}),setAttributes:cx(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"waterfallChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,protectedByOrganisation:void 0,offset:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,legend:!0,labels:!1,parameters:{},axisTitles:void 0,headline:void 0,increaseColor:"#00FF00",decreaseColor:"#FF0000",tags:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",comparison:null,parametersV2:void 0,...o}),createFeedback:ze,schema:bq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&(e.dimension.length>0||e.timeDimension!==null),autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"waterfallChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Xe,"data_set"),P(Xe,"views"),{...P(Xe,"field_y_axis"),fieldFilterOptions:{forComponent:"waterfallChart",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input",maxAllowed:1},{...P(Xe,"field_x_axis"),fieldFilterOptions:{forComponent:"waterfallChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:e=>({dimension:[...e],timeDimension:null}),getValues:e=>mo(e),maxAllowed:1,testId:"add-dimension"},{...P(Xe,"dateComparison"),maxAllowed:1},P(Xe,"sort"),P(Xe,"filter"),P(Xe,"custom_metrics"),P(Xe,"limit")],formatPanelConfig:()=>[S1(Xe),P(Xe,"waterfall_colors"),{...P(Xe,"chart_styles"),subSection:[Xe.format_panel.chart_styles?.subSectionDefinition.legend,Xe.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Xe)],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),sq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),approxYAxisLabelCount:jO(["all70","all90"]),legend:u.valid(!0,!1),labels:u.valid(!0,!1).optional(),type:u.valid("horizontalWaterfallChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,axisTitles:Pe(),headline:jt(),tags:D1(),increaseColor:u.string().required(),decreaseColor:u.string().required(),comparison:u.any()}),zx=t=>(e,o)=>E1(e,o,sq(t)),Ee={title:"Horizontal Waterfall chart",description:"Shows a running total as values are added or subtracted, with categories on the Y axis and values on the X axis. It's useful for understanding how an initial value is affected by a series of positive and negative values.",namespace:"horizontal_waterfall_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this horizontal waterfall chart?"},views:{type:"views",title:"View",description:""},field_x_axis:{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each bar to measure?",callToAction:"Add metric"},field_y_axis:{type:"fieldCollector",title:"Grouping - Y Axis",description:"What do you want each bar to represent? An example would be a a date grouping to show each month as a bar",callToAction:"Add grouping"},dateComparison:{type:"dateComparison",title:"Comparison",description:"Compare the waterfall chart to a previous period.",callToAction:"Add comparison"},sort:{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this horizontal waterfall chart."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this horizontal waterfall chart."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},labels:{type:"labels",title:"Show Labels",description:"",namespace:"labels"}}},axis_labels:{type:"axisLabels",title:"Axis Labels Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.min":{title:"Minimum",description:"",namespace:"x.min"},"x.max":{title:"Maximum",description:"",namespace:"x.max"},"x.count":{title:"Label count",description:"",namespace:"x.count"},"x.axis_title":{title:"Title",description:"",namespace:"x.axis_title"},y:{title:"Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.min":{title:"Minimum",description:"",namespace:"y.min"},"y.max":{title:"Maximum",description:"",namespace:"y.max"},"y.count":{title:"Label count",description:"",namespace:"y.count"},"y.axis_title":{title:"Title",description:"",namespace:"y.axis_title"}}},headline:{type:"headline",title:"Headline",description:""},waterfall_colors:{type:"waterfallColors",title:"Color selector",description:""}}},cq=t=>({title:Ee.title,description:Ee.description,servicesClass:"HorizontalWaterfallChart",namespace:Ee.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,measure:c1(e.measure),order:te(e.order,e.timeDimension),filter:X1(e.filter),dimension:mo({timeDimension:e.timeDimension??null,dimension:C1(e.dimension).dimension}),parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),headline:vo(e.headline,e.timeDimension),tags:e.tags??[],legend:e.legend,labels:e.labels,viewId:w0(e.viewId),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,xAxisMin:e.xAxisMin??null,xAxisMax:e.xAxisMax??null,yAxisMin:e.yAxisMin??null,yAxisMax:e.yAxisMax??null,approxXAxisLabelCount:Mi(e.approxXAxisLabelCount),approxYAxisLabelCount:Mi(e.approxYAxisLabelCount),axisTitles:e.axisTitles,displaySubject:e.displaySubject,displayTitle:e.displayTitle,increaseColor:e.increaseColor,decreaseColor:e.decreaseColor,protectedByOrganisation:e.protectedByOrganisation,type:e.type,offset:e.offset,comparison:e.comparison}),setAttributes:zx(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"horizontalWaterfallChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,protectedByOrganisation:void 0,offset:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,xAxisMin:null,xAxisMax:null,yAxisMin:null,yAxisMax:null,legend:!0,labels:!1,parameters:{},axisTitles:void 0,headline:void 0,increaseColor:"#00FF00",decreaseColor:"#FF0000",tags:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",comparison:null,parametersV2:void 0,...o}),createFeedback:ze,schema:sq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length>0&&(e.dimension.length>0||e.timeDimension!==null),autoGenerate(e){const{measure:o,dimension:n}=ae(e,t.queryEngineConfig,"horizontalWaterfallChart");return this.init(e.id,{measure:[o[0]],dimension:n})},dataPanelConfig:()=>[P(Ee,"data_set"),P(Ee,"views"),{...P(Ee,"field_x_axis"),fieldFilterOptions:{forComponent:"horizontalWaterfallChart",onlyMeasures:!0},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input",maxAllowed:1},{...P(Ee,"field_y_axis"),fieldFilterOptions:{forComponent:"horizontalWaterfallChart",onlyDimensions:!0},preventDuplicates:!0,preSetPartialAttributes:e=>({dimension:[...e],timeDimension:null}),getValues:e=>mo(e),maxAllowed:1,testId:"add-dimension"},{...P(Ee,"dateComparison"),maxAllowed:1},P(Ee,"sort"),P(Ee,"filter"),P(Ee,"custom_metrics"),P(Ee,"limit")],formatPanelConfig:()=>[S1(Ee),P(Ee,"waterfall_colors"),{...P(Ee,"chart_styles"),subSection:[Ee.format_panel.chart_styles?.subSectionDefinition.legend,Ee.format_panel.chart_styles?.subSectionDefinition.labels]},ve(Ee)],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_x_axis","field_y_axis"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),Ox=t=>u.array().items(ce(t.queryEngineConfig.supportedAggregates,t.attributesSchemaOptions)).max(1).required(),vu=t=>lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions).max(1).required(),Lu=t=>lt(t.queryEngineConfig.supportedTimeTruncFunctions,t.attributesSchemaOptions).max(1).default([]),zq=t=>u.object({...I1(t.attributesSchemaOptions),...ut(t.queryEngineConfig,t.attributesSchemaOptions),measure:Ox(t),dimension:vu(t),xDimension:vu(t),drilldown:u.forbidden(),legend:u.valid(!0,!1),legendSingleRow:u.valid(!0,!1).optional(),showSpendMarkers:u.valid(!0,!1).default(!0),pointNameDimension:Lu(t),pointValueDimension:Lu(t),type:u.valid("curveViewerChart").required(),parameters:Ie(t.queryEngineConfig,t.attributesSchemaOptions),parametersV2:At,axisTitles:Pe(),tags:D1()}),lx=t=>(e,o)=>E1(e,o,zq(t)),tt={title:"Curve Viewer",description:"Compare response curves across channels with one smooth line per channel. Map a metric on the Y axis, a numeric column on the X axis, and a grouping column to define each series.",namespace:"curve_viewer_chart",data_panel:{data_set:{type:"dataSet",title:"Data set",description:"What data do you want to use in this curve viewer?"},views:{type:"views",title:"View",description:""},field_y_axis:{type:"fieldCollector",title:"Metric - Y Axis",description:"What metric do you want to plot on the Y axis?",callToAction:"Select a metric"},field_x_axis:{type:"fieldCollector",title:"X Axis",description:"What column do you want to plot on the X axis? An example might be a spend column.",callToAction:"Select a column"},field_grouping:{type:"fieldCollector",title:"Group by",description:"What column defines each curve? An example might be a channel field.",callToAction:"Select a column"},sort:{type:"sort",title:"Sort",description:"Select how the curve viewer results should be ordered."},filter:{type:"filter",title:"Filters",description:"Only include the information you want to use in this curve viewer."},custom_metrics:{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},limit:{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this curve viewer."}},format_panel:{heading:{type:"heading",title:"Heading",description:"",subSectionDefinition:{title:{type:"title",title:"Title",description:"",namespace:"title"},subject:{title:"Subject",type:"subject",description:"",namespace:"subject"}}},chart_styles:{type:"chartStyles",title:"Chart Settings",description:"",subSectionDefinition:{legend:{type:"legend",title:"Show Legend",description:"",namespace:"legend"},legendSingleRow:{type:"legendSingleRow",title:"Show legend in a single row",description:"",namespace:"legendSingleRow"},showSpendMarkers:{type:"legend",title:"Show Spend Markers",description:"",namespace:"showSpendMarkers"},pointValueDimension:{type:"fieldCollector",title:"Value column",description:"",namespace:"pointValueDimension",callToAction:"Select..."},pointNameDimension:{type:"fieldCollector",title:"Spend markers column",description:"",namespace:"pointNameDimension",callToAction:"Select..."}}},axis_labels:{type:"axisLabels",title:"Axis Preferences",description:"",subSectionDefinition:{x:{title:"X Axis",description:"",namespace:"x"},"x.prefix":{title:"Prefix",description:"",namespace:"x.prefix"},"x.postfix":{title:"Postfix",description:"",namespace:"x.postfix"},"x.format":{title:"Format",description:"",namespace:"x.format"},"x.count":{title:"Label count",description:"",namespace:"x.count"},y:{title:"Metric - Y Axis",description:"",namespace:"y"},"y.prefix":{title:"Prefix",description:"",namespace:"y.prefix"},"y.postfix":{title:"Postfix",description:"",namespace:"y.postfix"},"y.format":{title:"Format",description:"",namespace:"y.format"},"y.count":{title:"Label count",description:"",namespace:"y.count"}}}}},oO=tt.format_panel.chart_styles?.subSectionDefinition,Oq=t=>({title:tt.title,description:tt.description,servicesClass:"CurveViewerChart",namespace:tt.namespace,dump:e=>e,load:e=>({updated_at:e.updated_at,type:e.type,measure:c1(e.measure),xDimension:C1(e.xDimension).dimension,order:te(e.order,e.timeDimension),dimension:C1(e.dimension).dimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:w0(e.viewId),filter:X1(e.filter),dataSetId:e.dataSetId,limit:e.limit,timeDimension:null,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,yAxisFormat:e.yAxisFormat,xAxisFormat:e.xAxisFormat,approxXAxisLabelCount:A1(e.approxXAxisLabelCount),approxYAxisLabelCount:A1(e.approxYAxisLabelCount),legend:e.legend,legendSingleRow:e.legendSingleRow,showSpendMarkers:e.showSpendMarkers??!0,pointNameDimension:C1(e.pointNameDimension??[]).dimension,pointValueDimension:C1(e.pointValueDimension??[]).dimension,tags:e.tags??[],parameters:Re(e.parameters),parametersV2:dt(e.parameters,e.parametersV2,t.queryEngineConfig),axisTitles:e.axisTitles}),setAttributes:lx(t),validate:(e,o)=>j1(e,o,t.queryEngineConfig),init:(e,o)=>({type:"curveViewerChart",measure:[],xDimension:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:w0(o?.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,legendSingleRow:!1,showSpendMarkers:!0,pointNameDimension:[],pointValueDimension:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0,tags:[],parametersV2:void 0,...o}),createFeedback:ze,schema:zq(t),removeField:(e,o)=>V1(e,o,t.queryEngineConfig),isRunnable:e=>e.measure.length===1&&e.xDimension.length===1&&e.dimension.length===1,autoGenerate(e){return this.init(e.id,{measure:[],xDimension:[],dimension:[]})},dataPanelConfig:()=>[P(tt,"data_set"),P(tt,"views"),{...P(tt,"field_y_axis"),fieldFilterOptions:{forComponent:"curveViewerChart"},preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,maxAllowed:1,testId:"metric-input"},{...P(tt,"field_x_axis"),fieldFilterOptions:{forComponent:"curveViewerChart",onlyMeasures:!0,onlyFieldTypes:["number"]},preSetPartialAttributes:e=>({xDimension:e.map(o=>({field:o.field,function:"none"}))}),getValues:e=>[...e.xDimension],maxAllowed:1,testId:"x-axis-dimension"},{...P(tt,"field_grouping"),fieldFilterOptions:{forComponent:"curveViewerChart",onlyDimensions:!0},preSetPartialAttributes:e=>({dimension:[...e]}),getValues:e=>[...e.dimension],maxAllowed:1,testId:"group-by-dimension"},P(tt,"sort"),P(tt,"filter"),P(tt,"custom_metrics"),P(tt,"limit")],formatPanelConfig:()=>[S1(tt),{...P(tt,"chart_styles"),subSection:[oO.legend,oO.legendSingleRow,oO.showSpendMarkers]},ve(tt)],supportedCustomFields:{percentages:!0,dateCalculations:!0,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0,conditional:!0,customBuild:[f0.Maths,f0.IfStatement,f0.Aggregates]},supportedFeatures:{parameters:"v2",colorGradient:!1},parametersV2Sections:["field_y_axis","field_x_axis","field_grouping"],setDataAttributesFromPreAggregatedDataSet(e,o){return xt(e,o,this.setAttributes)}}),ux=()=>oo.QueryEngineConfig.getQueryEngineConfig("postgres"),Ax=()=>oo.QueryEngineConfig.getQueryEngineConfig("redshift"),dx=()=>oo.QueryEngineConfig.getQueryEngineConfig("bigquery"),fx=()=>oo.QueryEngineConfig.getQueryEngineConfig("microsoftSQLServer"),qx=()=>oo.QueryEngineConfig.getQueryEngineConfig("mariadb"),hx=()=>oo.QueryEngineConfig.getQueryEngineConfig("snowflake"),Wx=()=>oo.QueryEngineConfig.getQueryEngineConfig("mysql"),BM=oo.QueryEngineConfig.getQueryEngineConfig("js"),lq=t=>{switch(t){case"js":return BM;case"postgres":return ux();case"redshift":return Ax();case"bigquery":return dx();case"mariadb":return qx();case"snowflake":return hx();case"mysql":return Wx();case"microsoftSQLServer":return fx();case"SQLite":throw"SQLite not support via the query engine"}},T1={queryEngineConfig:lq("snowflake")};function fo(t,e){if(t=="areaChart")return N1(df(e||T1),e?.textOverride);if(t=="barChart")return N1(hf(e||T1),e?.textOverride);if(t=="basicTable")return N1(Rf(e||T1),e?.textOverride);if(t=="bubbleChart")return N1(Lf(e||T1),e?.textOverride);if(t=="bubbleChartV2")return N1(Nf(e||T1),e?.textOverride);if(t=="scatterChartV2")return N1(rq(e||T1),e?.textOverride);if(t=="comboChart")return N1(Sf(e||T1),e?.textOverride);if(t=="custom")return N1(Cf(e||T1),e?.textOverride);if(t=="dataTable")return N1(Ef(e||T1),e?.textOverride);if(t=="funnelChart")return N1(If(e||T1),e?.textOverride);if(t=="richText")return N1(tq(e||T1),e?.textOverride);if(t=="horizontalBarChart")return N1(Pf(e||T1),e?.textOverride);if(t=="horizontalBarChartV2")return N1(kf(e||T1),e?.textOverride);if(t=="lineChart")return N1($f(e||T1),e?.textOverride);if(t=="lineChartV2")return N1(Uf(e||T1),e?.textOverride);if(t=="barChartV2")return N1(mf(e||T1),e?.textOverride);if(t=="areaChartV2")return N1(qf(e||T1),e?.textOverride);if(t=="comboChartV2")return N1(wf(e||T1),e?.textOverride);if(t=="mercatorMap")return N1(Hf(e||T1),e?.textOverride);if(t=="pieChart")return N1(Yf(e||T1),e?.textOverride);if(t=="sunburstChart")return N1(pq(e||T1),e?.textOverride);if(t=="progress")return N1(Qf(e||T1),e?.textOverride);if(t=="scatterChart")return N1(iq(e||T1),e?.textOverride);if(t=="singleStat")return N1(aq(e||T1),e?.textOverride);if(t=="waterfallChart")return N1(Mq(e||T1),e?.textOverride);if(t=="horizontalWaterfallChart")return N1(cq(e||T1),e?.textOverride);if(t=="radarChart")return N1(Jf(e||T1),e?.textOverride);if(t=="curveViewerChart")return N1(Oq(e||T1),e?.textOverride);throw`Cannot get interface for ${t}. Please implement it.`}var mx={exports:{}};/**
|
|
65
65
|
* chroma.js - JavaScript library for color conversions
|
|
66
66
|
*
|
|
67
67
|
* Copyright (c) 2011-2019, Gregor Aisch
|