@platforma-sdk/model 1.38.0 → 1.39.6

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.
Files changed (39) hide show
  1. package/dist/bconfig/index.d.ts +2 -3
  2. package/dist/bconfig/index.d.ts.map +1 -1
  3. package/dist/bconfig/normalization.d.ts +1 -7
  4. package/dist/bconfig/normalization.d.ts.map +1 -1
  5. package/dist/bconfig/types.d.ts +0 -4
  6. package/dist/bconfig/types.d.ts.map +1 -1
  7. package/dist/bconfig/{utils.d.ts → util.d.ts} +1 -1
  8. package/dist/bconfig/util.d.ts.map +1 -0
  9. package/dist/bconfig/v3.d.ts +3 -32
  10. package/dist/bconfig/v3.d.ts.map +1 -1
  11. package/dist/builder.d.ts +3 -1
  12. package/dist/builder.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +607 -597
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/pframe.d.ts.map +1 -1
  18. package/dist/render/api.d.ts +4 -2
  19. package/dist/render/api.d.ts.map +1 -1
  20. package/dist/render/internal.d.ts +4 -3
  21. package/dist/render/internal.d.ts.map +1 -1
  22. package/dist/render/util/pframe_upgraders.d.ts +3 -0
  23. package/dist/render/util/pframe_upgraders.d.ts.map +1 -0
  24. package/dist/version.d.ts +1 -1
  25. package/package.json +5 -5
  26. package/src/bconfig/index.ts +2 -3
  27. package/src/bconfig/normalization.ts +2 -105
  28. package/src/bconfig/types.ts +0 -5
  29. package/src/bconfig/v3.ts +3 -41
  30. package/src/builder.ts +21 -2
  31. package/src/pframe.ts +7 -0
  32. package/src/render/api.ts +36 -8
  33. package/src/render/internal.ts +15 -3
  34. package/src/render/util/pframe_upgraders.ts +54 -0
  35. package/dist/bconfig/container.d.ts +0 -46
  36. package/dist/bconfig/container.d.ts.map +0 -1
  37. package/dist/bconfig/utils.d.ts.map +0 -1
  38. package/src/bconfig/container.ts +0 -58
  39. /package/src/bconfig/{utils.ts → util.ts} +0 -0
@@ -1,7 +1,6 @@
1
- export * from './container';
2
1
  export * from './lambdas';
3
2
  export * from './normalization';
4
- export * from './types';
5
- export * from './utils';
3
+ export * from './util';
6
4
  export * from './v3';
5
+ export * from './types';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bconfig/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bconfig/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
@@ -1,13 +1,7 @@
1
- import { BlockConfigContainer } from './container';
1
+ import { BlockConfigContainer } from '@milaboratories/pl-model-common';
2
2
  import { TypedConfigOrConfigLambda, TypedConfigOrString } from './types';
3
3
  import { BlockConfig } from './v3';
4
4
  export declare function downgradeCfgOrLambda(data: TypedConfigOrConfigLambda): TypedConfigOrString;
5
5
  export declare function downgradeCfgOrLambda(data: TypedConfigOrConfigLambda | undefined): TypedConfigOrString | undefined;
6
- /**
7
- * Takes universal config, and converts it into latest config structure.
8
- *
9
- * **Important**: This operation is not meant to be executed recusively.
10
- * In no circumstance result of this function should be persisted!
11
- * */
12
6
  export declare function extractConfig(cfg: BlockConfigContainer): BlockConfig;
13
7
  //# sourceMappingURL=normalization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../../src/bconfig/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,yBAAyB,GAAG,mBAAmB,CAAC;AAC3F,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,yBAAyB,GAAG,SAAS,GAC1C,mBAAmB,GAAG,SAAS,CAAC;AAqBnC;;;;;KAKK;AACL,wBAAgB,aAAa,CAAC,GAAG,EAAE,oBAAoB,GAAG,WAAW,CAuFpE"}
1
+ {"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../../src/bconfig/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,KAAK,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,yBAAyB,GAAG,mBAAmB,CAAC;AAC3F,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,yBAAyB,GAAG,SAAS,GAC1C,mBAAmB,GAAG,SAAS,CAAC;AASnC,wBAAgB,aAAa,CAAC,GAAG,EAAE,oBAAoB,GAAG,WAAW,CAEpE"}
@@ -1,9 +1,5 @@
1
1
  import { TypedConfig } from '../config';
2
2
  import { ConfigRenderLambda } from './lambdas';
3
- export type Code = {
4
- type: 'plain';
5
- content: string;
6
- };
7
3
  export declare function isConfigLambda(cfgOrFh: TypedConfigOrConfigLambda): cfgOrFh is ConfigRenderLambda;
8
4
  export type TypedConfigOrConfigLambda = TypedConfig | ConfigRenderLambda;
9
5
  /** @deprecated */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bconfig/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,yBAAyB,GACjC,OAAO,IAAI,kBAAkB,CAE/B;AAED,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,kBAAkB,CAAC;AAEzE,kBAAkB;AAClB,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bconfig/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,yBAAyB,GACjC,OAAO,IAAI,kBAAkB,CAE/B;AAED,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,kBAAkB,CAAC;AAEzE,kBAAkB;AAClB,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,MAAM,CAAC"}
@@ -4,4 +4,4 @@ export type DeriveHref<S> = S extends readonly BlockSection[] ? OnlyString<Extra
4
4
  type: 'link';
5
5
  }>['href']> : never;
6
6
  export {};
7
- //# sourceMappingURL=utils.d.ts.map
7
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/bconfig/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,CAAC,GAAG,EAAE,CAAC;AAG/C,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,YAAY,EAAE,GACzD,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GACxD,KAAK,CAAC"}
@@ -1,35 +1,6 @@
1
- import { BlockRenderingMode } from '@milaboratories/pl-model-common';
2
- import { Code, TypedConfigOrConfigLambda } from './types';
1
+ import { BlockConfigV3Generic } from '@milaboratories/pl-model-common';
2
+ import { TypedConfigOrConfigLambda } from './types';
3
3
  import { ConfigRenderLambda } from './lambdas';
4
- export type BlockConfigV3<Args = unknown, UiState = unknown, Outputs extends Record<string, TypedConfigOrConfigLambda> = Record<string, TypedConfigOrConfigLambda>> = {
5
- /** SDK version used by the block */
6
- readonly sdkVersion: string;
7
- /** Main rendering mode for the block */
8
- readonly renderingMode: BlockRenderingMode;
9
- /** Initial value for the args when block is added to the project */
10
- readonly initialArgs: Args;
11
- /** Initial value for the args when block is added to the project */
12
- readonly initialUiState: UiState;
13
- /**
14
- * Config to determine whether the block can be executed with current
15
- * arguments.
16
- *
17
- * Optional to support earlier SDK version configs.
18
- * */
19
- readonly inputsValid: TypedConfigOrConfigLambda;
20
- /** Configuration to derive list of section for the left overview panel */
21
- readonly sections: TypedConfigOrConfigLambda;
22
- /** Lambda to derive block title */
23
- readonly title?: ConfigRenderLambda;
24
- /**
25
- * Lambda returning list of upstream blocks this block enriches with its exports,
26
- * influences dependency graph construction
27
- * */
28
- readonly enrichmentTargets?: ConfigRenderLambda;
29
- /** Configuration for the output cells */
30
- readonly outputs: Outputs;
31
- /** Config code bundle */
32
- readonly code?: Code;
33
- };
4
+ export type BlockConfigV3<Args = unknown, UiState = unknown, Outputs extends Record<string, TypedConfigOrConfigLambda> = Record<string, TypedConfigOrConfigLambda>> = BlockConfigV3Generic<Args, UiState, TypedConfigOrConfigLambda, ConfigRenderLambda, Outputs>;
34
5
  export type BlockConfig = BlockConfigV3;
35
6
  //# sourceMappingURL=v3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"v3.d.ts","sourceRoot":"","sources":["../../src/bconfig/v3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,MAAM,aAAa,CACvB,IAAI,GAAG,OAAO,EACd,OAAO,GAAG,OAAO,EACjB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAAG,MAAM,CAChE,MAAM,EACN,yBAAyB,CAC1B,IACC;IACF,oCAAoC;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAE3C,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC;IAE3B,oEAAoE;IACpE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IAEjC;;;;;SAKK;IACL,QAAQ,CAAC,WAAW,EAAE,yBAAyB,CAAC;IAEhD,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;IAE7C,mCAAmC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAEpC;;;SAGK;IACL,QAAQ,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;IAEhD,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC"}
1
+ {"version":3,"file":"v3.d.ts","sourceRoot":"","sources":["../../src/bconfig/v3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,MAAM,aAAa,CACvB,IAAI,GAAG,OAAO,EACd,OAAO,GAAG,OAAO,EACjB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAAG,MAAM,CAChE,MAAM,EACN,yBAAyB,CAC1B,IACC,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEhG,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC"}
package/dist/builder.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BlockRenderingMode, BlockSection, ValueOrErrors, PlRef } from '@milaboratories/pl-model-common';
1
+ import { BlockRenderingMode, BlockSection, ValueOrErrors, PlRef, BlockCodeKnownFeatureFlags } from '@milaboratories/pl-model-common';
2
2
  import { Checked, ConfigResult, TypedConfig } from './config';
3
3
  import { Platforma } from './platforma';
4
4
  import { InferRenderFunctionReturn, RenderFunction } from './render';
@@ -20,7 +20,9 @@ export declare class BlockModel<Args, OutputsCfg extends Record<string, TypedCon
20
20
  private readonly _sections;
21
21
  private readonly _title;
22
22
  private readonly _enrichmentTargets;
23
+ private readonly _featureFlags;
23
24
  private constructor();
25
+ static readonly INITIAL_BLOCK_FEATURE_FLAGS: BlockCodeKnownFeatureFlags;
24
26
  /** Initiates configuration builder */
25
27
  static create(renderingMode: BlockRenderingMode): BlockModel<NoOb, {}, NoOb>;
26
28
  /** Initiates configuration builder */
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EA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AAC;IAc/F;;;OAGG;IACI,QAAQ,CACb,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK,EAAE,GAC9B,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC;IAe9C;;gEAE4D;IACrD,IAAI,IAAI,SAAS,CACtB,IAAI,EACJ,uBAAuB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAClD,OAAO,EACP,IAAI,CACL;CAkCF;AAED,MAAM,MAAM,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,OAAO,SAAS,WAAW,GAC7E,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,GACtC,OAAO,SAAS,kBAAkB,GAChC,2BAA2B,CAAC,OAAO,CAAC,GACpC,KAAK,CAAC;AAEZ,KAAK,uBAAuB,CAC1B,IAAI,EACJ,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,EAC5D,OAAO,IACL;KACD,GAAG,IAAI,MAAM,UAAU,GAAG,aAAa,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;CAC1F,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var lt=Object.defineProperty;var ut=(t,e,n)=>e in t?lt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var F=(t,e,n)=>ut(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@milaboratories/pl-model-common"),xe=require("canonicalize"),$=require("zod"),Ae=require("@milaboratories/pl-error-like");class Ie extends Error{constructor(e,n){super(`${e.length}${n?"+":""} errors, first error: `+e[0].message),this.errors=e,this.moreErrors=n}}function Te(t){if(!t.ok)throw new Ie(t.errors,t.moreErrors);return t.value}function ct(t){return new Proxy(t,{get(e,n){return Te(e[n])}})}function x(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null?Y(t):t}function W(t){return{type:"GetFromCtx",variable:t}}function dt(t){return{type:"Isolate",cfg:t}}const pt=W("$args"),ft=W("$it"),ht=W("$prod"),gt=W("$staging"),mt=W("$ui");function Y(t){return{type:"Immediate",value:t}}function ye(t){const e={};for(const[n,r]of Object.entries(t))e[n]=x(r);return{type:"MakeObject",template:e}}function yt(...t){const e=[];for(const n of t)e.push(x(n));return{type:"MakeArray",template:e}}function Q(t,e){return{type:"GetJsonField",source:x(t),field:x(e)}}function bt(t,e,n="$it"){return{type:"MapRecordValues",source:t,mapping:e,itVar:n}}function vt(t,e,n="$it"){return{type:"MapArrayValues",source:t,mapping:e,itVar:n}}function At(t){return{type:"Flatten",source:t}}function Pt(t){return{type:"IsEmpty",arg:t}}function Ct(t){return{type:"Not",operand:t}}function St(t,e){return{type:"And",operand1:t,operand2:e}}function wt(t,e){return{type:"Or",operand1:t,operand2:e}}function xt(t,e){return{type:"GetResourceField",source:x(t),field:x(e)}}function It(){return function(t){return{type:"GetResourceValueAsJson",source:x(t)}}}function Tt(t,e,n="$it"){return{type:"MapResourceFields",source:t,mapping:e,itVar:n}}function _t(t,e){return{type:"GetBlobContent",range:e,source:x(t)}}function Lt(t,e){return{type:"GetBlobContentAsString",range:e,source:x(t)}}function Et(){return function(t,e){return{type:"GetBlobContentAsJson",range:e,source:x(t)}}}function Ot(t){return{type:"GetDownloadedBlobContent",source:x(t)}}function Rt(t){return{type:"GetOnDemandBlobContent",source:x(t)}}function Dt(t,e){return{type:"ExtractArchiveAndGetURL",format:e,source:x(t)}}function Ft(t){return{type:"GetImportProgress",source:x(t)}}function kt(t,e){return{type:"GetLastLogs",source:x(t),lines:e}}function Nt(t,e){return{type:"GetProgressLog",source:x(t),patternToSearch:e}}function Vt(t,e){return{type:"GetProgressLogWithInfo",source:x(t),patternToSearch:e}}function jt(t){return{type:"GetLogHandle",source:x(t)}}function Jt(){return typeof globalThis.getPlatforma<"u"||typeof globalThis.platforma<"u"}function _e(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}function Kt(){if(typeof globalThis.cfgRenderCtx<"u")return globalThis.cfgRenderCtx}function A(){if(typeof globalThis.cfgRenderCtx<"u")return globalThis.cfgRenderCtx;throw new Error("Not in config rendering context")}function H(t,e){const n=Kt();if(n===void 0)return!1;if(t in n.callbackRegistry)throw new Error(`Callback with key ${t} already registered.`);return n.callbackRegistry[t]=e,!0}const de=new Map;function Mt(t,e){t in A().callbackRegistry||(A().callbackRegistry[t]=n=>{for(const r of de.get(t))r(n)},de.set(t,[])),de.get(t).push(e)}class L{constructor(e,n=r=>r){F(this,"isResolved",!1);F(this,"resolvedValue");this.handle=e,this.postProcess=n,Mt(e,r=>{this.resolvedValue=n(r),this.isResolved=!0})}map(e){return new L(this.handle,n=>e(this.postProcess(n)))}mapDefined(e){return new L(this.handle,n=>{const r=this.postProcess(n);return r?e(r):void 0})}toJSON(){return this.isResolved?this.resolvedValue:{__awaited_futures__:[this.handle]}}}function ae(t,e){return t===void 0?void 0:e(t)}class R{constructor(e,n){this.handle=e,this.resolvePath=n}resolve(...e){const n=e.map(r=>({assertFieldType:"Input",...typeof r=="string"?{field:r}:r}));return this.resolveWithCommon({},...n)}resolveOutput(...e){const n=e.map(r=>({assertFieldType:"Output",...typeof r=="string"?{field:r}:r}));return this.resolveWithCommon({},...n)}resolveInput(...e){const n=e.map(r=>({assertFieldType:"Input",...typeof r=="string"?{field:r}:r}));return this.resolveWithCommon({},...n)}resolveAny(...e){return this.resolveWithCommon({},...e)}resolveWithCommon(e,...n){const r=[...this.resolvePath,...n.map(i=>typeof i=="string"?i:i.field)];return ae(A().resolveWithCommon(this.handle,e,...n),i=>new R(i,r))}get resourceType(){return A().getResourceType(this.handle)}getInputsLocked(){return A().getInputsLocked(this.handle)}getOutputsLocked(){return A().getOutputsLocked(this.handle)}getIsReadyOrError(){return A().getIsReadyOrError(this.handle)}getIsFinal(){return A().getIsFinal(this.handle)}getError(){const e=[...this.resolvePath,"error"];return ae(A().getError(this.handle),n=>new R(n,e))}listInputFields(){return A().listInputFields(this.handle)}listOutputFields(){return A().listOutputFields(this.handle)}listDynamicFields(){return A().listDynamicFields(this.handle)}getKeyValueBase64(e){return A().getKeyValueBase64(this.handle,e)}getKeyValueAsString(e){return A().getKeyValueAsString(this.handle,e)}getKeyValueAsJson(e){const n=this.getKeyValueAsString(e);if(n==null)throw new Error("Resource has no content.");return JSON.parse(n)}getDataBase64(){return A().getDataBase64(this.handle)}getDataAsString(){return A().getDataAsString(this.handle)}getDataAsJson(){const e=this.getDataAsString();if(e==null)throw new Error("Resource has no content.");return JSON.parse(e)}getPColumns(e=!1,n=""){const r=this.parsePObjectCollection(e,n);return r===void 0?void 0:Object.entries(r).map(([,s])=>{if(!u.isPColumn(s))throw new Error(`not a PColumn (kind = ${s.spec.kind})`);return s})}parsePObjectCollection(e=!1,n=""){const r=A().parsePObjectCollection(this.handle,e,n,...this.resolvePath);if(r===void 0)return;const i={};for(const[s,o]of Object.entries(r)){const a=[...this.resolvePath,s];i[s]=u.mapPObjectData(o,l=>new R(l,a))}return i}getFileContentAsBase64(e){return new L(A().getBlobContentAsBase64(this.handle,e))}getFileContentAsString(e){return new L(A().getBlobContentAsString(this.handle,e))}getFileContentAsJson(e){return new L(A().getBlobContentAsString(this.handle,e)).mapDefined(n=>JSON.parse(n))}getBlobContentAsBase64(){return this.getFileContentAsBase64()}getBlobContentAsString(){return this.getFileContentAsString()}getFileHandle(){return new L(A().getDownloadedBlobContentHandle(this.handle))}getDownloadedBlobHandle(){return this.getFileHandle()}getRemoteFileHandle(){return new L(A().getOnDemandBlobContentHandle(this.handle))}getOnDemandBlobHandle(){return this.getRemoteFileHandle()}extractArchiveAndGetURL(e){return new L(A().extractArchiveAndGetURL(this.handle,e))}getImportProgress(){return new L(A().getImportProgress(this.handle))}getLastLogs(e){return new L(A().getLastLogs(this.handle,e))}getProgressLog(e){return new L(A().getProgressLog(this.handle,e))}getProgressLogWithInfo(e){return new L(A().getProgressLogWithInfo(this.handle,e))}getLogHandle(){return new L(A().getLogHandle(this.handle))}allFieldsResolved(e="Input"){switch(e){case"Input":return this.getInputsLocked()&&this.listInputFields().every(n=>this.resolve({field:n,assertFieldType:"Input"})!==void 0);case"Output":return this.getOutputsLocked()&&this.listOutputFields().every(n=>this.resolve({field:n,assertFieldType:"Output"})!==void 0)}}mapFields(e,n){const{fieldType:r,requireLocked:i,skipUnresolved:s}={fieldType:"Input",requireLocked:!0,skipUnresolved:!1,...n},o=e;if(i&&(r==="Input"&&!this.getInputsLocked()||r==="Output"&&!this.getOutputsLocked()))return;let l=(r==="Input"?this.listInputFields():r==="Output"?this.listOutputFields():this.listDynamicFields()).map(c=>[c,this.resolve({field:c,assertFieldType:r})]);return s&&(l=l.filter(c=>c[1]!==void 0)),l.map(([c,p])=>o(c,p))}}const Le="staging",Ee="main",$t={explicitColumnsSupport:!0,inlineColumnsSupport:!0,activeArgs:!0,pTablePartitionFiltersSupport:!0};function Oe(t){return typeof t=="object"&&t!==null&&"__awaited_futures__"in t}function fe(t,e,n){if(e.has(n))return;if(e.add(n),typeof n==="object")if(Oe(n))n.__awaited_futures__.forEach(i=>t.add(i));else if(Array.isArray(n))for(const i of n)fe(t,e,i);else for(const[,i]of Object.entries(n))i!==n&&fe(t,e,i)}function Ut(t){const e=new Set;return fe(e,new Set,t),e}const Bt=Object.freeze(Object.defineProperty({__proto__:null,GlobalCfgRenderCtxFeatureFlags:$t,MainAccessorName:Ee,StagingAccessorName:Le,getAllFutureAwaits:Ut,isFutureAwait:Oe},Symbol.toStringTag,{value:"Module"})),Re="pl7.app/label",De="pl7.app/trace",Fe=$.z.object({type:$.z.string(),importance:$.z.number().optional(),id:$.z.string().optional(),label:$.z.string()}),ke=$.z.array(Fe),Wt=.001,zt="__LABEL__",Pe="__LABEL__@1";function be(t,e,n={}){const r=new Map,i=n.forceTraceElements!==void 0&&n.forceTraceElements.length>0?new Set(n.forceTraceElements):void 0,s=new Map,o=t.map(f=>{var d,y;const v=e(f);let h,b,P;"spec"in v&&typeof v.spec=="object"?(h=v.spec,b=v.prefixTrace,P=v.suffixTrace):h=v;const D=(d=h.annotations)==null?void 0:d[Re],I=(y=h.annotations)==null?void 0:y[De],S=(I?ke.safeParse(JSON.parse(I)).data:void 0)??[],w=[...b??[],...S,...P??[]];if(D!==void 0){const _={label:D,type:zt,importance:-2};n.addLabelAsSuffix?w.push(_):w.splice(0,0,_)}const C=[],T=new Map;for(let _=w.length-1;_>=0;--_){const{type:z}=w[_],N=w[_].importance??0,J=(T.get(z)??0)+1;T.set(z,J);const k=`${z}@${J}`;s.set(k,(s.get(k)??0)+1),r.set(k,Math.max(r.get(k)??Number.NEGATIVE_INFINITY,N-(w.length-_)*Wt)),C.push({...w[_],fullType:k,occurrenceIndex:J})}return C.reverse(),{value:f,spec:h,label:D,fullTrace:C}}),a=[],l=[],c=[...r];c.sort(([,f],[,v])=>v-f);for(const[f]of c)f.endsWith("@1")||s.get(f)===t.length?a.push(f):l.push(f);const p=(f,v=!1)=>{const h=[];for(let b=0;b<o.length;b++){const P=o[b],D=P.fullTrace.filter(w=>f.has(w.fullType)||i&&i.has(w.type));if(D.length===0)if(v)h.push({label:"Unlabeled",value:P.value});else return;const I=D.map(w=>w.label),S=n.separator??" / ";h.push({label:I.join(S),value:P.value})}return h};if(a.length===0){if(l.length!==0)throw new Error("Non-empty secondary types list while main types list is empty.");return p(new Set(Pe),!0)}let g=0,m=-1;for(;g<a.length;){const f=new Set;n.includeNativeLabel&&f.add(Pe);for(let h=0;h<g;++h)f.add(a[h]);m>=0&&f.add(a[m]);const v=p(f);if(v!==void 0&&new Set(v.map(h=>h.label)).size===t.length)return v;m++,m>=a.length&&(g++,m=g)}return p(new Set([...a,...l]),!0)}const re="PColumnData/",Z=re+"ResourceMap",ee=re+"Partitioned/ResourceMap",U=re+"JsonPartitioned",j=re+"BinaryPartitioned",Ne=re+"Partitioned/",te=Ne+"JsonPartitioned",B=Ne+"BinaryPartitioned";function Ve(t,e,n,r=[],i){if(t===void 0)return!1;switch(t.resourceType.name){case Z:{let s=t.getInputsLocked();for(const o of t.listInputFields()){const a=t.resolve({field:o,assertFieldType:"Input"}),l=[...r,...JSON.parse(o)],c=a===void 0?void 0:e(a);c===void 0&&(s=!1),(c!==void 0||i)&&n.push({key:l,value:c})}return s}case ee:{let s=t.getInputsLocked();for(const o of t.listInputFields()){const a=t.resolve({field:o,assertFieldType:"Input"});if(a===void 0)s=!1;else{const l=[...r,...JSON.parse(o)],c=Ve(a,e,n,l,i);s=s&&c}}return s}default:throw new Error(`Unknown resource type: ${t.resourceType.name}`)}}function Gt(t,e,n=!1){const r=[];return{isComplete:Ve(t,e,r,[],n),data:r}}const he=t=>{if(t.endsWith(".index"))return{baseKey:t.substring(0,t.length-6),type:"index"};if(t.endsWith(".values"))return{baseKey:t.substring(0,t.length-7),type:"values"};throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`)};function je(t){if(!t)return;const e=t.resourceType.name,n=t.getDataAsJson(),r=[];let i=0;switch(e){case Z:i=n.keyLength;break;case ee:i=n.partitionKeyLength+n.keyLength;break;case U:case j:i=n.partitionKeyLength;break;case B:case te:i=n.superPartitionKeyLength+n.partitionKeyLength;break}switch(e){case Z:case U:case j:for(let s of t.listInputFields()){e===j&&(s=he(s).baseKey);const o=[...JSON.parse(s)];r.push(o)}break;case ee:case B:case te:for(const s of t.listInputFields()){const o=[...JSON.parse(s)],a=t.resolve({field:s,assertFieldType:"Input"});if(a!==void 0)for(let l of a.listInputFields()){e===B&&(l=he(l).baseKey);const c=[...o,...JSON.parse(l)];r.push(c)}}break}return{data:r,keyLength:i}}function Ht(t){if(t.type!=="JsonPartitioned"&&t.type!=="BinaryPartitioned")throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);const{parts:e,partitionKeyLength:n}=t,r=[];for(let i=0;i<n;++i)r.push(new Set);for(const i of e){const s=i.key;if(s.length!==n)throw new Error(`Key length (${s.length}) does not match partition length (${n}) for key: ${JSON.stringify(s)}`);for(let o=0;o<n;++o)r[o].add(s[o])}return r.map(i=>Array.from(i.values()))}function Je(t){if(t===void 0)return;if(u.isDataInfoEntries(t))return Ht(t);const e=je(t);if(!e)return;const{data:n,keyLength:r}=e,i=[];for(let s=0;s<r;++s)i.push(new Set);for(const s of n){if(s.length!==r)throw new Error("key length does not match partition length");for(let o=0;o<r;++o)i[o].add(s[o])}return i.map(s=>Array.from(s.values()))}function le(t,e=[]){if(t===void 0||!t.getIsReadyOrError())return;const n=t.resourceType.name,r=t.getDataAsJson();if(e.length>0&&(n===te||n===B))throw new Error(`Unexpected nested super-partitioned resource: ${n}`);switch(n){case Z:case ee:throw new Error(`Only data columns are supported, got: ${n}`);case U:{if(typeof(r==null?void 0:r.partitionKeyLength)!="number")throw new Error(`Missing partitionKeyLength in metadata for ${n}`);const i=[];for(const s of t.listInputFields()){const o=t.resolve({field:s,assertFieldType:"Input"});if(o===void 0)return;const a=[...e,...JSON.parse(s)];i.push({key:a,value:o})}return{type:"JsonPartitioned",partitionKeyLength:r.partitionKeyLength,parts:i}}case j:{if(typeof(r==null?void 0:r.partitionKeyLength)!="number")throw new Error(`Missing partitionKeyLength in metadata for ${n}`);const i=[],s=new Map;for(const o of t.listInputFields()){const a=he(o),l=t.resolve({field:o,assertFieldType:"Input"});if(l===void 0)return;let c=s.get(a.baseKey);c||(c={},s.set(a.baseKey,c)),a.type==="index"?c.index=l:c.values=l}for(const[o,a]of s.entries()){if(!a.index||!a.values)return;const l=[...e,...JSON.parse(o)];i.push({key:l,value:{index:a.index,values:a.values}})}return{type:"BinaryPartitioned",partitionKeyLength:r.partitionKeyLength,parts:i}}case te:{if(typeof(r==null?void 0:r.superPartitionKeyLength)!="number"||typeof(r==null?void 0:r.partitionKeyLength)!="number")throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);const i=r.superPartitionKeyLength+r.partitionKeyLength,s=[];for(const o of t.listInputFields()){const a=t.resolve({field:o,assertFieldType:"Input"});if(a===void 0)return;if(a.resourceType.name!==U)throw new Error(`Expected ${U} inside ${n}, but got ${a.resourceType.name}`);const l=le(a,JSON.parse(o));if(l===void 0)return;if(l.type!=="JsonPartitioned")throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);s.push(...l.parts)}return{type:"JsonPartitioned",partitionKeyLength:i,parts:s}}case B:{if(typeof(r==null?void 0:r.superPartitionKeyLength)!="number"||typeof(r==null?void 0:r.partitionKeyLength)!="number")throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);const i=r.superPartitionKeyLength+r.partitionKeyLength,s=[];for(const o of t.listInputFields()){const a=t.resolve({field:o,assertFieldType:"Input"});if(a===void 0)return;if(a.resourceType.name!==j)throw new Error(`Expected ${j} inside ${n}, but got ${a.resourceType.name}`);const l=le(a,JSON.parse(o));if(l===void 0)return;if(l.type!=="BinaryPartitioned")throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);s.push(...l.parts)}return{type:"BinaryPartitioned",partitionKeyLength:i,parts:s}}default:throw new Error(`Unknown resource type: ${n}`)}}function Ke(t){if(t!==void 0){if(u.isDataInfoEntries(t))return t;if(u.isDataInfo(t))return u.dataInfoToEntries(t);if(t instanceof R)return le(t);throw new Error(`Unexpected input type: ${typeof t}`)}}function Me(t,e){const n=[...e].sort((s,o)=>o[0]-s[0]);if(t.type==="JsonPartitioned"||t.type==="BinaryPartitioned"){const{partitionKeyLength:s}=t;for(const[o]of e)if(o>=s)throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${s}`)}else if(t.type==="Json"){const{keyLength:s}=t;for(const[o]of e)if(o>=s)throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${s}`)}const r=s=>{for(const[o,a]of n)if(s[o]!==a)return!1;return!0},i=s=>{const o=[...s];for(const[a]of n)o.splice(a,1);return o};switch(t.type){case"Json":{const s=t.data.filter(o=>r(o.key)).map(o=>({key:i(o.key),value:o.value}));return{type:"Json",keyLength:t.keyLength-e.length,data:s}}case"JsonPartitioned":{const s=t.parts.filter(o=>r(o.key)).map(o=>({key:i(o.key),value:o.value}));return{type:"JsonPartitioned",partitionKeyLength:t.partitionKeyLength-e.length,parts:s}}case"BinaryPartitioned":{const s=t.parts.filter(o=>r(o.key)).map(o=>({key:i(o.key),value:o.value}));return{type:"BinaryPartitioned",partitionKeyLength:t.partitionKeyLength-e.length,parts:s}}}}function qt(t){if(!Array.isArray(t))return!1;if(t.length===0)return!0;const e=t[0];return typeof e=="object"&&e!==null&&"key"in e&&"val"in e}class Yt{constructor(e){this.columns=e}selectColumns(e){const n=typeof e=="function"?e:u.selectorsToPredicate(e);return this.columns.filter(r=>n(r.spec))}}function Xt(t){if(t)return t.map(e=>({type:`split:${u.canonicalizeAxisId(e.axisId)}`,label:e.label,importance:1e6}))}function Qt(t){if(t)return t.map(e=>[e.axisIdx,e.value])}function Zt(t,e){if(!e||e.length===0)return t;const n=[...e].sort((r,i)=>r[0]-i[0]);return xe({id:t,axisFilters:n})}function Ce(t){if(!t||typeof t!="object")return!1;const e=t,n=e.domain&&typeof e.domain=="object"&&Object.values(e.domain).some(i=>typeof i=="object"&&i!==null&&"anchor"in i),r=e.axes&&Array.isArray(e.axes)&&e.axes.some(i=>typeof i=="object"&&i!==null&&"anchor"in i);return!!e.domainAnchor||n||r}function en(t){if(typeof t!="object"||!("axes"in t)||t.axes===void 0)return[];const e=t.axes.map((n,r)=>typeof n=="object"&&"split"in n&&n.split===!0?r:-1).filter(n=>n!==-1);if(e.length>0&&t.partialAxesMatch!==void 0)throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");return e.sort((n,r)=>n-r),e}class ne{constructor(){F(this,"defaultProviderStore",[]);F(this,"providers",[new Yt(this.defaultProviderStore)]);F(this,"axisLabelProviders",[])}addColumnProvider(e){return this.providers.push(e),this}addAxisLabelProvider(e){return this.axisLabelProviders.push(e),this}addColumns(e){return this.defaultProviderStore.push(...e),this}addColumn(e){return this.defaultProviderStore.push(e),this}findLabels(e){for(const n of this.axisLabelProviders){const r=n.findLabels(e);if(r)return r}}getUniversalEntries(e,n){const{anchorCtx:r,labelOps:i,dontWaitAllData:s=!1,overrideLabelAnnotation:o=!1,exclude:a}=n??{},l={...o&&(i==null?void 0:i.includeNativeLabel)!==!1?{includeNativeLabel:!0}:{},...i??{}};let c=()=>!1;if(a){const h=(Array.isArray(a)?a:[a]).map(b=>{if(Ce(b)){if(!r)throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");return u.selectorsToPredicate(u.resolveAnchors(r.anchors,b,n))}else return u.selectorsToPredicate(b)});c=b=>h.some(P=>P(b))}const p=typeof e=="function"?[e]:Array.isArray(e)?e:[e],g=[],m=new Set;for(const h of p){const b=Ce(h);let P;if(b){if(!r)throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");P=u.resolveAnchors(r.anchors,h,n)}else P=h;const D=new Set,I=[];for(const C of this.providers){const T=C.selectColumns(P);for(const d of T){if(c(d.spec))continue;if(D.has(d.id))throw new Error(`Duplicate column id ${d.id} in provider ${C.constructor.name}`);const y=u.deriveNativeId(d.spec);m.has(y)||(D.add(d.id),m.add(y),I.push(d))}}if(I.length===0)continue;const S=en(h),w=S.length>0;for(const C of I){if(!u.isPColumnSpec(C.spec))continue;const T=C.spec;if(w){if(qt(C.data))throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${C.id}`);const d=Ke(C.data);if(!d){if(s)continue;return}if(!u.isPartitionedDataInfoEntries(d))throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${d.type} for column ${C.id}`);const y=Je(d),_=S[S.length-1];if(_>=d.partitionKeyLength)throw new Error(`Not enough partition keys (${d.partitionKeyLength}) for requested split axes (max index ${_}) in column ${T.name}`);const z=S.map(E=>this.findLabels(u.getAxisId(T.axesSpec[E]))),N=[],J=(E,G)=>{if(G>=S.length){if(N.push([...E]),N.length>1e4)throw new Error("Too many key combinations, aborting.");return}const V=S[G];if(V>=y.length)throw new Error(`Axis index ${V} out of bounds for unique keys array (length ${y.length}) during split key generation for column ${C.id}`);const K=y[V];if(!K||K.length===0){N.length=0;return}for(const ie of K)E.push(ie),J(E,G+1),E.pop()};if(J([],0),N.length===0)continue;const k=[...T.axesSpec],it=S.map(E=>E);for(let E=S.length-1;E>=0;E--)k.splice(S[E],1);const st={...T,axesSpec:k};for(const E of N){const G=E.map((V,K)=>{const ie=it[K],ot=u.getAxisId(T.axesSpec[ie]),ce=z[K],at=(ce==null?void 0:ce[V])??String(V);return{axisIdx:ie,axisId:ot,value:V,label:at}});g.push({type:"split",originalColumn:C,spec:T,adjustedSpec:st,dataEntries:d,axisFilters:G})}}else g.push({type:"direct",originalColumn:C,spec:T,adjustedSpec:T})}}if(g.length===0)return[];const f=be(g,h=>({spec:h.spec,suffixTrace:h.type==="split"?Xt(h.axisFilters):void 0}),l),v=[];for(const{value:h,label:b}of f){const{originalColumn:P,spec:D}=h,I=h.type==="split"?h.axisFilters:void 0,S=Qt(I);let w;r?w=r.deriveS(D,S):w=Zt(P.id,S);let C={...h.adjustedSpec};o&&(C={...C,annotations:{...C.annotations??{},"pl7.app/label":b}}),v.push({id:w,spec:C,data:()=>h.type==="split"?u.entriesToDataInfo(Me(h.dataEntries,S)):h.originalColumn.data,label:b})}return v}getColumns(e,n){const r=this.getUniversalEntries(e,{overrideLabelAnnotation:!0,...n??{}});if(!r)return;const i=[];for(const s of r){const o=s.data();if(!o){if(n!=null&&n.dontWaitAllData)continue;return}i.push({id:s.id,spec:s.spec,data:o})}return i}}function pe(t,e){if(t===void 0)return e===void 0;if(e===void 0)return!0;for(const n in e)if(t[n]!==e[n])return!1;return!0}function Se(t){return u.mapPObjectData(t,e=>e instanceof R?e.handle:u.isDataInfo(e)?u.mapDataInfo(e,n=>n.handle):e)}class $e{constructor(){F(this,"ctx",A())}calculateOptions(e){return this.ctx.calculateOptions(e)}getOptions(e,n){const r=typeof e=="function"?e:u.selectorsToPredicate(e),i=this.getSpecs().entries.filter(a=>r(a.obj));let s={},o=!1;return typeof n<"u"&&(typeof n=="function"?s=n:typeof n=="object"&&("includeNativeLabel"in n||"separator"in n||"addLabelAsSuffix"in n?s=n:(n=n,s=n.label??{},o=n.refsWithEnrichments??!1))),typeof s=="object"?be(i,a=>a.obj,s??{}).map(({value:{ref:a},label:l})=>({ref:u.withEnrichments(a,o),label:l})):i.map(({ref:a,obj:l})=>({ref:u.withEnrichments(a,o),label:s(l,a)}))}resolveAnchorCtx(e){if(e instanceof u.AnchoredIdDeriver)return e;const n={};for(const[r,i]of Object.entries(e))if(u.isPlRef(i)){const s=this.getPColumnSpecByRef(i);if(!s)return;n[r]=s}else n[r]=i;return new u.AnchoredIdDeriver(n)}getAnchoredPColumns(e,n,r){const i=this.resolveAnchorCtx(e);if(i)return new ne().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n,{...r,anchorCtx:i})}getCanonicalOptions(e,n,r){const i=this.resolveAnchorCtx(e);if(!i)return;const s=new ne().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n,{...r,anchorCtx:i});if(s)return s.map(o=>({value:o.id,label:o.label}))}getDataFromResultPool(){return this.getData()}getData(){const e=this.ctx.getDataFromResultPool();return{isComplete:e.isComplete,entries:e.entries.map(n=>({ref:n.ref,obj:{...n.obj,data:new R(n.obj.data,[n.ref.blockId,n.ref.name])}}))}}getDataWithErrorsFromResultPool(){return this.getDataWithErrors()}getDataWithErrors(){const e=this.ctx.getDataWithErrorsFromResultPool();return{isComplete:e.isComplete,entries:e.entries.map(n=>({ref:n.ref,obj:{...n.obj,data:u.mapValueInVOE(n.obj.data,r=>new R(r,[n.ref.blockId,n.ref.name]))}}))}}getSpecsFromResultPool(){return this.getSpecs()}getSpecs(){return this.ctx.getSpecsFromResultPool()}getDataByRef(e){var r;if(typeof this.ctx.getDataFromResultPoolByRef>"u")return(r=this.getData().entries.find(i=>i.ref.blockId===e.blockId&&i.ref.name===e.name))==null?void 0:r.obj;const n=this.ctx.getDataFromResultPoolByRef(e.blockId,e.name);if(n)return u.mapPObjectData(n,i=>new R(i,[e.blockId,e.name]))}getPColumnByRef(e){const n=this.getDataByRef(e);if(n)return u.ensurePColumn(n)}getPColumnSpecByRef(e){const n=this.getSpecByRef(e);if(n){if(!u.isPColumnSpec(n))throw new Error(`not a PColumn spec (kind = ${n.kind})`);return n}}getSpecByRef(e){return this.ctx.getSpecFromResultPoolByRef(e.blockId,e.name)}findDataWithCompatibleSpec(e){const n=[];e:for(const r of this.getData().entries){if(!u.isPColumnSpec(r.obj.spec))continue;const i=r.obj.spec;if(e.name===i.name&&e.valueType===i.valueType&&e.axesSpec.length===i.axesSpec.length&&pe(e.domain,i.domain)){for(let s=0;s<e.axesSpec.length;++s){const o=e.axesSpec[s],a=i.axesSpec[s];if(o.name!==a.name||o.type!==a.type||!pe(o.domain,a.domain))continue e}n.push(r.obj)}}return n}findLabels(e){const n=this.getData();for(const r of n.entries){if(!u.isPColumn(r.obj))continue;const i=r.obj.spec;if(i.name==="pl7.app/label"&&i.axesSpec.length===1&&i.axesSpec[0].name===e.name&&i.axesSpec[0].type===e.type&&pe(e.domain,i.axesSpec[0].domain)){if(r.obj.data.resourceType.name!=="PColumnData/Json")throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);return Object.fromEntries(Object.entries(r.obj.data.getDataAsJson().data).map(o=>[JSON.parse(o[0])[0],o[1]]))}}}selectColumns(e){const n=typeof e=="function"?e:u.selectorsToPredicate(e);return this.getSpecs().entries.filter(({obj:i})=>u.isPColumnSpec(i)?n(i):!1).map(({ref:i,obj:s})=>{const o=s;let a=null;const l=this;return{id:xe(i),spec:o,get data(){var c;return a!==null||(a=(c=l.getPColumnByRef(i))==null?void 0:c.data),a}}})}findLabelsForColumnAxis(e,n){var s;const r=this.findLabels(e.axesSpec[n]);if(!r)return;const i=(s=e.annotations)==null?void 0:s["pl7.app/axisKeys/"+n];if(i!==void 0){const o=JSON.parse(i);return Object.fromEntries(o.map(a=>[a,r[a]??"Unlabelled"]))}else return r}}class q{constructor(){F(this,"ctx");F(this,"args");F(this,"uiState");F(this,"_activeArgsCache");F(this,"resultPool",new $e);this.ctx=A(),this.args=JSON.parse(this.ctx.args),this.uiState=this.ctx.uiState!==void 0?JSON.parse(this.ctx.uiState):{}}get activeArgs(){return this._activeArgsCache===void 0&&(this._activeArgsCache={v:this.ctx.activeArgs?JSON.parse(this.ctx.activeArgs):void 0}),this._activeArgsCache.v}getNamedAccessor(e){return ae(this.ctx.getAccessorHandleByName(e),n=>new R(n,[e]))}get prerun(){return this.getNamedAccessor(Le)}get outputs(){return this.getNamedAccessor(Ee)}findLabels(e){return this.resultPool.findLabels(e)}verifyInlineAndExplicitColumnsSupport(e){var i;const n=e.some(s=>!(s.data instanceof R)||u.isDataInfo(s.data)),r=((i=this.ctx.featureFlags)==null?void 0:i.inlineColumnsSupport)===!0;if(n&&!r)throw Error("Inline or explicit columns not supported")}patchPTableDef(e){var n;return(n=this.ctx.featureFlags)!=null&&n.pTablePartitionFiltersSupport?e:{...e,partitionFilters:[],filters:[...e.partitionFilters,...e.filters]}}createPFrame(e){return this.verifyInlineAndExplicitColumnsSupport(e),this.ctx.createPFrame(e.map(n=>Se(n)))}createPTable(e){let n;return"columns"in e?n=this.patchPTableDef({src:{type:"full",entries:e.columns.map(r=>({type:"column",column:r}))},partitionFilters:e.filters??[],filters:[],sorting:e.sorting??[]}):n=this.patchPTableDef(e),this.verifyInlineAndExplicitColumnsSupport(u.extractAllColumns(n.src)),this.ctx.createPTable(u.mapPTableDef(n,r=>Se(r)))}getBlockLabel(e){return this.ctx.getBlockLabel(e)}getCurrentUnstableMarker(){return this.ctx.getCurrentUnstableMarker()}logInfo(e){this.ctx.logInfo(e)}logWarn(e){this.ctx.logWarn(e)}logError(e){this.ctx.logError(e)}}const X="1.38.0";function Ue(t){return t.__renderLambda===!0}function se(t){if(t!==void 0)return Ue(t)?t.handle:t}function M(t){if(t!==void 0)return typeof t=="string"?{__renderLambda:!0,handle:t,retentive:!1}:t}function tn(t){if(t.v3!==void 0){const{initialArgs:e,initialUiState:n,inputsValid:r,outputs:i,renderingMode:s,sdkVersion:o,sections:a,title:l,enrichmentTargets:c}=t.v3,{code:p}=t;return{initialArgs:e,initialUiState:n,inputsValid:r,outputs:i,renderingMode:s,sdkVersion:o,sections:a,title:l,code:p,enrichmentTargets:c}}else if(t.inputsValid!==void 0){const{sdkVersion:e,renderingMode:n,outputs:r,inputsValid:i,sections:s,initialArgs:o,code:a}=t,l=Object.keys(t);if(e===void 0||n===void 0||r===void 0||i===void 0||s===void 0||o===void 0)throw new Error(`Malformed config v2. SDK version ${e}; Fields = ${l.join(", ")}`);return{sdkVersion:e,renderingMode:n,initialArgs:o,outputs:Object.fromEntries(Object.entries(r).map(([c,p])=>[c,M(p)])),inputsValid:M(i),sections:M(s),initialUiState:void 0,code:a}}else if(t.renderingMode!==void 0){const{sdkVersion:e,canRun:n,renderingMode:r,outputs:i,sections:s,initialArgs:o,code:a}=t,l=Object.keys(t);if(r===void 0||i===void 0||n===void 0||s===void 0||o===void 0)throw new Error(`Malformed config v1. SDK version ${e}; Fields = ${l.join(", ")}`);return{sdkVersion:e??"unknown",renderingMode:r,initialArgs:o,outputs:Object.fromEntries(Object.entries(i).map(([c,p])=>[c,M(p)])),inputsValid:M(n),sections:M(s),initialUiState:void 0,code:a}}else{const{sdkVersion:e}=t,n=Object.keys(t);throw new Error(`Config format not supported: SDK = ${e}; Fields = ${n.join(", ")}`)}}class O{constructor(e,n,r,i,s,o,a,l){this._renderingMode=e,this._initialArgs=n,this._initialUiState=r,this._outputs=i,this._inputsValid=s,this._sections=o,this._title=a,this._enrichmentTargets=l}static create(e="Heavy"){return new O(e,void 0,{},{},Y(!0),Y([]),void 0,void 0)}output(e,n,r={}){if(typeof n=="function"){const i=`output#${e}`;return H(i,()=>n(new q)),new O(this._renderingMode,this._initialArgs,this._initialUiState,{...this._outputs,[e]:{__renderLambda:!0,handle:i,...r}},this._inputsValid,this._sections,this._title,this._enrichmentTargets)}else return new O(this._renderingMode,this._initialArgs,this._initialUiState,{...this._outputs,[e]:n},this._inputsValid,this._sections,this._title,this._enrichmentTargets)}retentiveOutput(e,n){return this.output(e,n,{retentive:!0})}argsValid(e){return typeof e=="function"?(H("inputsValid",()=>e(new q)),new O(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,{__renderLambda:!0,handle:"inputsValid"},this._sections,this._title,this._enrichmentTargets)):new O(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,e,this._sections,this._title,this._enrichmentTargets)}sections(e){return Array.isArray(e)?this.sections(Y(e)):typeof e=="function"?(H("sections",()=>e(new q)),new O(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,{__renderLambda:!0,handle:"sections"},this._title,this._enrichmentTargets)):new O(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,e,this._title,this._enrichmentTargets)}title(e){return H("title",()=>e(new q)),new O(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,this._sections,{__renderLambda:!0,handle:"title"},this._enrichmentTargets)}initialArgs(e){return new O(this._renderingMode,e,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}withArgs(e){return new O(this._renderingMode,e,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}withUiState(e){return new O(this._renderingMode,this._initialArgs,e,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}enriches(e){return H("enrichmentTargets",e),new O(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,{__renderLambda:!0,handle:"enrichmentTargets"})}done(){if(this._initialArgs===void 0)throw new Error("Initial arguments not set.");const e={v3:{sdkVersion:X,renderingMode:this._renderingMode,initialArgs:this._initialArgs,initialUiState:this._initialUiState,inputsValid:this._inputsValid,sections:this._sections,title:this._title,outputs:this._outputs,enrichmentTargets:this._enrichmentTargets},sdkVersion:X,renderingMode:this._renderingMode,initialArgs:this._initialArgs,inputsValid:se(this._inputsValid),sections:se(this._sections),outputs:Object.fromEntries(Object.entries(this._outputs).map(([n,r])=>[n,se(r)]))};return Jt()?_e({sdkVersion:X}):{config:e}}}function ve(){return{sourceId:null,hiddenColIds:null,partitionFilters:[],filters:[],sorting:[]}}function Be(){return{version:3,stateCache:[],pTableParams:ve()}}function We(t){return"version"in t?(t.version===2&&(t={version:3,stateCache:t.stateCache.map(e=>({...e,filtersState:[]})),pTableParams:ve()}),t):Be()}function ue(t){return t.axesSpec.length===1&&t.name==="pl7.app/label"}function ze(t){return new ne().addAxisLabelProvider(t).addColumnProvider(t).getColumns({name:"pl7.app/label",axes:[{}]},{dontWaitAllData:!0})}function ge(t,e){const n=[],r=[];for(const a of t)ue(a.spec)?n.push(a):r.push(a);const i=[];for(const a of r)for(const l of a.spec.axesSpec){const c=u.getAxisId(l);i.some(p=>u.matchAxisId(p,c))||i.push(c)}for(const a of n){const l=u.getAxisId(a.spec.axesSpec[0]),c=i.findIndex(p=>u.matchAxisId(p,l));c!==-1&&i.splice(c,1)}const s=(a,l)=>{let c=a.toString();if(l)for(const p in l)c+=p,c+=l[p];return c},o=[];for(const a of e){const l=a.spec.axesSpec[0],c=u.getAxisId(l),p=i.findIndex(g=>u.matchAxisId(g,c));if(p!==-1){const g=i[p],m=Object.keys(g.domain??{}).length,f=Object.keys(l.domain??{}).length;m>f?o.push({id:s(a.id,g.domain),spec:{...a.spec,axesSpec:[{...g,annotations:l.annotations}]},data:a.data}):o.push(a),i.splice(p,1)}}return o}function Ge(t){const e=i=>Array.isArray(i),n=i=>i instanceof R,r=i=>typeof i=="object"&&"type"in i;return t.map(i=>i.data).every(i=>{if(e(i))return!0;if(n(i))return i.getIsReadyOrError();if(r(i))switch(i.type){case"Json":return!0;case"JsonPartitioned":return Object.values(i.parts).every(o=>o.getIsReadyOrError());case"BinaryPartitioned":return Object.values(i.parts).every(o=>o.index.getIsReadyOrError()&&o.values.getIsReadyOrError())}else throw Error(`unsupported column data type: ${i}`)})}function we(t){let e=t.columns;const n=[];if(t.coreColumnPredicate){e=[];for(const r of t.columns)t.coreColumnPredicate(r.spec)?e.push(r):n.push(r)}return n.push(...t.labelColumns),{src:{type:"outer",primary:{type:t.coreJoinType,entries:e.map(r=>({type:"column",column:r}))},secondary:n.map(r=>({type:"column",column:r}))},partitionFilters:t.partitionFilters,filters:t.filters,sorting:t.sorting}}function He(t){var e;return((e=t.annotations)==null?void 0:e["pl7.app/table/visibility"])==="hidden"}function qe(t){var e;return((e=t.annotations)==null?void 0:e["pl7.app/table/visibility"])==="optional"}function oe(t,e){return[...new Map(t.map(n=>[e(n),n])).values()]}function nn(t,e,n,r){if(e.length===0)return;const i=e.filter(d=>!He(d.spec)),s=We(n),o=ze(t.resultPool);if(!o)return;const a=ge(i.map(u.getColumnIdAndSpec),o),l=[...i,...a],p=[...oe([...l.flatMap(d=>d.spec.axesSpec.map(y=>u.getAxisId(y)))],d=>u.canonicalizeJson(d)).map(d=>({type:"axis",id:d})),...l.map(d=>({type:"column",id:d.id}))],g=new Set(p.map(d=>u.canonicalizeJson(d))),m=d=>g.has(u.canonicalizeJson(d)),f=(r==null?void 0:r.coreJoinType)??"full",v=s.pTableParams.partitionFilters.filter(d=>{const y=m(d.column);return y||t.logWarn(`Partition filter ${JSON.stringify(d)} does not match provided columns, skipping`),y}),h=oe([...(r==null?void 0:r.filters)??[],...s.pTableParams.filters],d=>u.canonicalizeJson(d.column)).filter(d=>{const y=m(d.column);return y||t.logWarn(`Filter ${JSON.stringify(d)} does not match provided columns, skipping`),y}),b=oe([...(r==null?void 0:r.sorting)??[],...s.pTableParams.sorting],d=>u.canonicalizeJson(d.column)).filter(d=>{const y=m(d.column);return y||t.logWarn(`Sorting ${JSON.stringify(d)} does not match provided columns, skipping`),y}),P=we({columns:i,labelColumns:a,coreJoinType:f,partitionFilters:v,filters:h,sorting:b,coreColumnPredicate:r==null?void 0:r.coreColumnPredicate}),D=t.createPTable(P),I=new Set((()=>{if(f==="inner")return[];const d=s.pTableParams.hiddenColIds;return d||i.filter(y=>qe(y.spec)).map(y=>y.id)})());i.filter(d=>{var y;return((y=d.spec.annotations)==null?void 0:y["pl7.app/isLinkerColumn"])==="true"}).forEach(d=>I.delete(d.id)),r!=null&&r.coreColumnPredicate&&i.flatMap(y=>{var _;return(_=r==null?void 0:r.coreColumnPredicate)!=null&&_.call(r,y.spec)?[y.id]:[]}).forEach(y=>I.delete(y)),[...v.map(d=>d.column),...h.map(d=>d.column),...b.map(d=>d.column)].filter(d=>d.type==="column").forEach(d=>I.delete(d.id));const S=i.filter(d=>!I.has(d.id)),w=ge(S.map(u.getColumnIdAndSpec),o);if(!Ge([...S,...w]))return;const C=we({columns:S,labelColumns:w,coreJoinType:f,partitionFilters:v,filters:h,sorting:b,coreColumnPredicate:r==null?void 0:r.coreColumnPredicate}),T=t.createPTable(C);return{sourceId:s.pTableParams.sourceId,fullTableHandle:D,visibleTableHandle:T}}function rn(t,e,n){const r=t.resultPool.findLabels(e);return{axis:e,options:n.map(i=>({value:i,label:(r==null?void 0:r[i])??i.toString()})),defaultValue:n[0]}}const sn=(t,e)=>{let n=t.toString();return e==null||e.forEach(r=>{if(r)for(const[i,s]of Object.entries(r))n+=i,n+=s}),n};function on(t){if(!t.length)return[];let e=[[]];return t.forEach(n=>{const r=[];n.forEach(i=>{r.push(...e.map(s=>[...s,i]))}),e=r}),e}function Ye(t){var e;return t.axesSpec.length===2&&((e=t.annotations)==null?void 0:e[Qe])==="true"}const Xe="pl7.app/graph/isVirtual",me="pl7.app/label",Qe="pl7.app/isLinkerColumn";function Ze(t){var n,r;const e=new Map;for(const{spec:i}of t){const s=i.axesSpec.map(u.getAxisId).map(u.canonicalizeJson);s.forEach(o=>{e.has(o)||e.set(o,new Set)});for(let o=0;o<s.length-1;o++)for(let a=o+1;a<s.length;a++){const l=s[o],c=s[a];(n=e.get(l))==null||n.add(c),(r=e.get(c))==null||r.add(l)}}return e}function et(t,e){const n=Ze(t),r=[...n.keys()].map(u.parseJson),i=[];for(const l of e.values()){const c=r.find(p=>u.matchAxisId(l,p));c&&i.push(u.canonicalizeJson(c))}const s=new Set(i),o=new Map;let a=[...i];for(;a.length;){const l=[];for(const c of a)for(const p of n.get(c)??[])s.has(p)||(l.push(p),s.add(p),o.set(p,u.parseJson(p)));a=l}return o}function tt(t,e){const n=[];return e.forEach(r=>{n.push(...an(t,r))}),n}function an(t,e){const n=e.spec.axesSpec.map(u.getAxisId);if(n.every(c=>t.has(u.canonicalizeJson(c))))return[e];const r=n.map(c=>{const p=[];for(const[g,m]of t)u.matchAxisId(m,c)&&!u.matchAxisId(c,m)&&p.push(m);return p}),i=on(r),s=new Set,o=new Set,a=i.map(c=>{const p=new Set;return c.map((g,m)=>{const f=e.spec.axesSpec[m].domain,v=g.domain;return Object.entries(v??{}).forEach(([h,b])=>{if((f==null?void 0:f[h])===void 0){const P=JSON.stringify([h,b]);p.add(P),s.add(P)}}),{...g,annotations:e.spec.axesSpec[m].annotations}}),p});[...s].forEach(c=>{a.some(p=>!p.has(c))&&o.add(c)});const l=i.map((c,p)=>{var h;const g=sn(e.id,c.map(b=>b.domain)),m=((h=e.spec.annotations)==null?void 0:h[me])??"",f=[...a[p]].filter(b=>o.has(b)).sort().map(b=>{var P;return(P=JSON.parse(b))==null?void 0:P[1]}).join(" / "),v={...e.spec.annotations,[Xe]:"true"};return(m||f)&&(v[me]=m&&f?m+" / "+f:m+f),{id:g,spec:{...e.spec,axesSpec:c.map((b,P)=>({...b,annotations:e.spec.axesSpec[P].annotations})),annotations:v},data:e.data}});return[e,...l]}function ln(t,e){if(!e)return;const n=new ne;n.addColumnProvider(t.resultPool),n.addColumns(e);const r=new Map,i=new Map;for(const g of e)for(const m of g.spec.axesSpec){const f=u.getAxisId(m);r.set(u.canonicalizeJson(f),f),i.set(u.canonicalizeJson(f),f)}const s=n.getColumns(g=>Ye(g))??[],o=et(s,r);for(const g of o)r.set(...g),i.set(...g);const a=(n.getColumns(g=>g.axesSpec.some(m=>{const f=u.getAxisId(m);for(const v of r.values())if(u.matchAxisId(v,f))return!0;return!1}),{dontWaitAllData:!0,overrideLabelAnnotation:!1})??[]).filter(g=>!ue(g.spec));for(const g of a)for(const m of g.spec.axesSpec){const f=u.getAxisId(m);i.set(u.canonicalizeJson(f),f)}const l=(n.getColumns(g=>g.axesSpec.some(m=>{const f=u.getAxisId(m);for(const v of i.values())if(u.matchAxisId(v,f))return!0;return!1}),{dontWaitAllData:!0,overrideLabelAnnotation:!1})??[]).filter(g=>ue(g.spec)),c=[...a,...l],p=tt(r,c);if(!p.some(g=>g.data instanceof R&&!g.data.getIsReadyOrError()))return t.createPFrame(p)}function un({selection:t,columnId:e=u.uniquePlId(),label:n="Selection marker",domain:r}){if(!(t!=null&&t.axesSpec.length))return;const i=t.selectedKeys.filter(s=>s.every(o=>!u.isPTableAbsent(o))).map(s=>({key:s,val:1}));if(i.length)return{id:e,spec:{kind:"PColumn",valueType:"Int",name:"pl7.app/table/row-selection",axesSpec:t.axesSpec,...r&&Object.keys(r).length&&{domain:r},annotations:{"pl7.app/label":n,"pl7.app/discreteValues":"[1]"}},data:i}}function cn(t){return t===u.PTableNA?(console.error("Axis value can never be N/A"),""):t}class dn{constructor(e){this.handle=e}async findColumns(e){return await platforma.pFrameDriver.findColumns(this.handle,e)}async getColumnSpec(e){return await platforma.pFrameDriver.getColumnSpec(this.handle,e)}async listColumns(){return await platforma.pFrameDriver.listColumns(this.handle)}async calculateTableData(e,n){return await platforma.pFrameDriver.calculateTableData(this.handle,e,n)}async getUniqueValues(e){return await platforma.pFrameDriver.getUniqueValues(this.handle,e)}}function nt(t){return ye({__isRef:!0,blockId:Q(t,"blockId"),name:Q(t,"name")})}function pn(t){return ye({ref:nt(Q(t,"ref")),label:Q(t,"label")})}const fn={sdkVersion:X};function rt(){return _e({sdkVersion:X})}function hn(t){try{return rt()}catch{return t}}function gn(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}exports.Args=pt;exports.BlockModel=O;exports.CurrentSdkInfo=fn;exports.FutureRef=L;exports.IS_VIRTUAL_COLUMN=Xe;exports.It=ft;exports.JsRenderInternal=Bt;exports.LABEL_ANNOTATION=me;exports.LINKER_COLUMN_ANNOTATION=Qe;exports.MainOutputs=ht;exports.OutputError=Ie;exports.PAnnotationLabel=Re;exports.PAnnotationTrace=De;exports.PColumnCollection=ne;exports.PFrameImpl=dn;exports.RT_BINARY_PARTITIONED=j;exports.RT_BINARY_SUPER_PARTITIONED=B;exports.RT_JSON_PARTITIONED=U;exports.RT_JSON_SUPER_PARTITIONED=te;exports.RT_RESOURCE_MAP=Z;exports.RT_RESOURCE_MAP_PARTITIONED=ee;exports.RenderCtx=q;exports.ResultPool=$e;exports.StagingOutputs=gt;exports.Trace=ke;exports.TraceEntry=Fe;exports.TreeNodeAccessor=R;exports.UiState=mt;exports.allColumnsComputed=Ge;exports.and=St;exports.convertOrParsePColumnData=Ke;exports.createPFrameForGraphs=ln;exports.createPlDataTableSheet=rn;exports.createPlDataTableStateV2=Be;exports.createPlDataTableV2=nn;exports.createRowSelectionColumn=un;exports.deriveLabels=be;exports.downgradeCfgOrLambda=se;exports.enrichCompatible=tt;exports.extractArchiveAndGetURL=Dt;exports.extractConfig=tn;exports.filterDataInfoEntries=Me;exports.flatten=At;exports.fromPlOption=pn;exports.fromPlRef=nt;exports.getAllLabelColumns=ze;exports.getAvailableWithLinkersAxes=et;exports.getBlobContent=_t;exports.getBlobContentAsJson=Et;exports.getBlobContentAsString=Lt;exports.getDownloadedBlobContent=Ot;exports.getEnvironmentValue=gn;exports.getFromCfg=W;exports.getImmediate=Y;exports.getImportProgress=Ft;exports.getJsonField=Q;exports.getLastLogs=kt;exports.getLinkerColumnsMap=Ze;exports.getLogHandle=jt;exports.getMatchingLabelColumns=ge;exports.getOnDemandBlobContent=Rt;exports.getPartitionKeysList=je;exports.getPlatformaOrDefault=hn;exports.getProgressLog=Nt;exports.getProgressLogWithInfo=Vt;exports.getRawPlatformaInstance=rt;exports.getResourceField=xt;exports.getResourceValueAsJson=It;exports.getUniquePartitionKeys=Je;exports.ifDef=ae;exports.isColumnHidden=He;exports.isColumnOptional=qe;exports.isConfigLambda=Ue;exports.isEmpty=Pt;exports.isLabelColumn=ue;exports.isLinkerColumn=Ye;exports.isolate=dt;exports.makeArray=yt;exports.makeDefaultPTableParams=ve;exports.makeObject=ye;exports.mapArrayValues=vt;exports.mapPTableValueToAxisKey=cn;exports.mapRecordValues=bt;exports.mapResourceFields=Tt;exports.not=Ct;exports.or=wt;exports.parsePColumnData=le;exports.parseResourceMap=Gt;exports.readOutput=Te;exports.uniqueBy=oe;exports.upgradePlDataTableStateV2=We;exports.wrapOutputs=ct;Object.keys(u).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>u[t]})});Object.keys(Ae).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ae[t]})});
1
+ "use strict";var ut=Object.defineProperty;var ct=(t,e,n)=>e in t?ut(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var D=(t,e,n)=>ct(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@milaboratories/pl-model-common"),we=require("canonicalize"),M=require("zod"),Ce=require("@milaboratories/pl-error-like");class _e extends Error{constructor(e,n){super(`${e.length}${n?"+":""} errors, first error: `+e[0].message),this.errors=e,this.moreErrors=n}}function Te(t){if(!t.ok)throw new _e(t.errors,t.moreErrors);return t.value}function dt(t){return new Proxy(t,{get(e,n){return Te(e[n])}})}function x(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null?q(t):t}function U(t){return{type:"GetFromCtx",variable:t}}function pt(t){return{type:"Isolate",cfg:t}}const ft=U("$args"),ht=U("$it"),gt=U("$prod"),mt=U("$staging"),yt=U("$ui");function q(t){return{type:"Immediate",value:t}}function be(t){const e={};for(const[n,r]of Object.entries(t))e[n]=x(r);return{type:"MakeObject",template:e}}function bt(...t){const e=[];for(const n of t)e.push(x(n));return{type:"MakeArray",template:e}}function X(t,e){return{type:"GetJsonField",source:x(t),field:x(e)}}function vt(t,e,n="$it"){return{type:"MapRecordValues",source:t,mapping:e,itVar:n}}function At(t,e,n="$it"){return{type:"MapArrayValues",source:t,mapping:e,itVar:n}}function Ct(t){return{type:"Flatten",source:t}}function Pt(t){return{type:"IsEmpty",arg:t}}function St(t){return{type:"Not",operand:t}}function It(t,e){return{type:"And",operand1:t,operand2:e}}function xt(t,e){return{type:"Or",operand1:t,operand2:e}}function wt(t,e){return{type:"GetResourceField",source:x(t),field:x(e)}}function _t(){return function(t){return{type:"GetResourceValueAsJson",source:x(t)}}}function Tt(t,e,n="$it"){return{type:"MapResourceFields",source:t,mapping:e,itVar:n}}function Lt(t,e){return{type:"GetBlobContent",range:e,source:x(t)}}function Et(t,e){return{type:"GetBlobContentAsString",range:e,source:x(t)}}function Ft(){return function(t,e){return{type:"GetBlobContentAsJson",range:e,source:x(t)}}}function Ot(t){return{type:"GetDownloadedBlobContent",source:x(t)}}function Rt(t){return{type:"GetOnDemandBlobContent",source:x(t)}}function Dt(t,e){return{type:"ExtractArchiveAndGetURL",format:e,source:x(t)}}function kt(t){return{type:"GetImportProgress",source:x(t)}}function Nt(t,e){return{type:"GetLastLogs",source:x(t),lines:e}}function Jt(t,e){return{type:"GetProgressLog",source:x(t),patternToSearch:e}}function Kt(t,e){return{type:"GetProgressLogWithInfo",source:x(t),patternToSearch:e}}function Vt(t){return{type:"GetLogHandle",source:x(t)}}function jt(){return typeof globalThis.getPlatforma<"u"||typeof globalThis.platforma<"u"}function Le(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}function Mt(){if(typeof globalThis.cfgRenderCtx<"u")return globalThis.cfgRenderCtx}function A(){if(typeof globalThis.cfgRenderCtx<"u")return globalThis.cfgRenderCtx;throw new Error("Not in config rendering context")}function G(t,e){const n=Mt();if(n===void 0)return!1;if(t in n.callbackRegistry)throw new Error(`Callback with key ${t} already registered.`);return n.callbackRegistry[t]=e,!0}const ce=new Map;function Bt(t,e){t in A().callbackRegistry||(A().callbackRegistry[t]=n=>{for(const r of ce.get(t))r(n)},ce.set(t,[])),ce.get(t).push(e)}class E{constructor(e,n=r=>r){D(this,"isResolved",!1);D(this,"resolvedValue");this.handle=e,this.postProcess=n,Bt(e,r=>{this.resolvedValue=n(r),this.isResolved=!0})}map(e){return new E(this.handle,n=>e(this.postProcess(n)))}mapDefined(e){return new E(this.handle,n=>{const r=this.postProcess(n);return r?e(r):void 0})}toJSON(){return this.isResolved?this.resolvedValue:{__awaited_futures__:[this.handle]}}}function oe(t,e){return t===void 0?void 0:e(t)}class O{constructor(e,n){this.handle=e,this.resolvePath=n}resolve(...e){const n=e.map(r=>({assertFieldType:"Input",...typeof r=="string"?{field:r}:r}));return this.resolveWithCommon({},...n)}resolveOutput(...e){const n=e.map(r=>({assertFieldType:"Output",...typeof r=="string"?{field:r}:r}));return this.resolveWithCommon({},...n)}resolveInput(...e){const n=e.map(r=>({assertFieldType:"Input",...typeof r=="string"?{field:r}:r}));return this.resolveWithCommon({},...n)}resolveAny(...e){return this.resolveWithCommon({},...e)}resolveWithCommon(e,...n){const r=[...this.resolvePath,...n.map(i=>typeof i=="string"?i:i.field)];return oe(A().resolveWithCommon(this.handle,e,...n),i=>new O(i,r))}get resourceType(){return A().getResourceType(this.handle)}getInputsLocked(){return A().getInputsLocked(this.handle)}getOutputsLocked(){return A().getOutputsLocked(this.handle)}getIsReadyOrError(){return A().getIsReadyOrError(this.handle)}getIsFinal(){return A().getIsFinal(this.handle)}getError(){const e=[...this.resolvePath,"error"];return oe(A().getError(this.handle),n=>new O(n,e))}listInputFields(){return A().listInputFields(this.handle)}listOutputFields(){return A().listOutputFields(this.handle)}listDynamicFields(){return A().listDynamicFields(this.handle)}getKeyValueBase64(e){return A().getKeyValueBase64(this.handle,e)}getKeyValueAsString(e){return A().getKeyValueAsString(this.handle,e)}getKeyValueAsJson(e){const n=this.getKeyValueAsString(e);if(n==null)throw new Error("Resource has no content.");return JSON.parse(n)}getDataBase64(){return A().getDataBase64(this.handle)}getDataAsString(){return A().getDataAsString(this.handle)}getDataAsJson(){const e=this.getDataAsString();if(e==null)throw new Error("Resource has no content.");return JSON.parse(e)}getPColumns(e=!1,n=""){const r=this.parsePObjectCollection(e,n);return r===void 0?void 0:Object.entries(r).map(([,s])=>{if(!l.isPColumn(s))throw new Error(`not a PColumn (kind = ${s.spec.kind})`);return s})}parsePObjectCollection(e=!1,n=""){const r=A().parsePObjectCollection(this.handle,e,n,...this.resolvePath);if(r===void 0)return;const i={};for(const[s,o]of Object.entries(r)){const a=[...this.resolvePath,s];i[s]=l.mapPObjectData(o,u=>new O(u,a))}return i}getFileContentAsBase64(e){return new E(A().getBlobContentAsBase64(this.handle,e))}getFileContentAsString(e){return new E(A().getBlobContentAsString(this.handle,e))}getFileContentAsJson(e){return new E(A().getBlobContentAsString(this.handle,e)).mapDefined(n=>JSON.parse(n))}getBlobContentAsBase64(){return this.getFileContentAsBase64()}getBlobContentAsString(){return this.getFileContentAsString()}getFileHandle(){return new E(A().getDownloadedBlobContentHandle(this.handle))}getDownloadedBlobHandle(){return this.getFileHandle()}getRemoteFileHandle(){return new E(A().getOnDemandBlobContentHandle(this.handle))}getOnDemandBlobHandle(){return this.getRemoteFileHandle()}extractArchiveAndGetURL(e){return new E(A().extractArchiveAndGetURL(this.handle,e))}getImportProgress(){return new E(A().getImportProgress(this.handle))}getLastLogs(e){return new E(A().getLastLogs(this.handle,e))}getProgressLog(e){return new E(A().getProgressLog(this.handle,e))}getProgressLogWithInfo(e){return new E(A().getProgressLogWithInfo(this.handle,e))}getLogHandle(){return new E(A().getLogHandle(this.handle))}allFieldsResolved(e="Input"){switch(e){case"Input":return this.getInputsLocked()&&this.listInputFields().every(n=>this.resolve({field:n,assertFieldType:"Input"})!==void 0);case"Output":return this.getOutputsLocked()&&this.listOutputFields().every(n=>this.resolve({field:n,assertFieldType:"Output"})!==void 0)}}mapFields(e,n){const{fieldType:r,requireLocked:i,skipUnresolved:s}={fieldType:"Input",requireLocked:!0,skipUnresolved:!1,...n},o=e;if(i&&(r==="Input"&&!this.getInputsLocked()||r==="Output"&&!this.getOutputsLocked()))return;let u=(r==="Input"?this.listInputFields():r==="Output"?this.listOutputFields():this.listDynamicFields()).map(c=>[c,this.resolve({field:c,assertFieldType:r})]);return s&&(u=u.filter(c=>c[1]!==void 0)),u.map(([c,g])=>o(c,g))}}const Ee="staging",Fe="main",$t={explicitColumnsSupport:!0,inlineColumnsSupport:!0,activeArgs:!0,pTablePartitionFiltersSupport:!0,pFrameInSetFilterSupport:!0};function Oe(t){return typeof t=="object"&&t!==null&&"__awaited_futures__"in t}function pe(t,e,n){if(e.has(n))return;if(e.add(n),typeof n==="object")if(Oe(n))n.__awaited_futures__.forEach(i=>t.add(i));else if(Array.isArray(n))for(const i of n)pe(t,e,i);else for(const[,i]of Object.entries(n))i!==n&&pe(t,e,i)}function Ut(t){const e=new Set;return pe(e,new Set,t),e}const Wt=Object.freeze(Object.defineProperty({__proto__:null,GlobalCfgRenderCtxFeatureFlags:$t,MainAccessorName:Fe,StagingAccessorName:Ee,getAllFutureAwaits:Ut,isFutureAwait:Oe},Symbol.toStringTag,{value:"Module"})),Re="pl7.app/label",De="pl7.app/trace",ke=M.z.object({type:M.z.string(),importance:M.z.number().optional(),id:M.z.string().optional(),label:M.z.string()}),Ne=M.z.array(ke),zt=.001,Gt="__LABEL__",Pe="__LABEL__@1";function ve(t,e,n={}){const r=new Map,i=n.forceTraceElements!==void 0&&n.forceTraceElements.length>0?new Set(n.forceTraceElements):void 0,s=new Map,o=t.map(p=>{var d,y;const v=e(p);let f,b,C;"spec"in v&&typeof v.spec=="object"?(f=v.spec,b=v.prefixTrace,C=v.suffixTrace):f=v;const R=(d=f.annotations)==null?void 0:d[Re],_=(y=f.annotations)==null?void 0:y[De],S=(_?Ne.safeParse(JSON.parse(_)).data:void 0)??[],I=[...b??[],...S,...C??[]];if(R!==void 0){const L={label:R,type:Gt,importance:-2};n.addLabelAsSuffix?I.push(L):I.splice(0,0,L)}const P=[],T=new Map;for(let L=I.length-1;L>=0;--L){const{type:W}=I[L],N=I[L].importance??0,V=(T.get(W)??0)+1;T.set(W,V);const k=`${W}@${V}`;s.set(k,(s.get(k)??0)+1),r.set(k,Math.max(r.get(k)??Number.NEGATIVE_INFINITY,N-(I.length-L)*zt)),P.push({...I[L],fullType:k,occurrenceIndex:V})}return P.reverse(),{value:p,spec:f,label:R,fullTrace:P}}),a=[],u=[],c=[...r];c.sort(([,p],[,v])=>v-p);for(const[p]of c)p.endsWith("@1")||s.get(p)===t.length?a.push(p):u.push(p);const g=(p,v=!1)=>{const f=[];for(let b=0;b<o.length;b++){const C=o[b],R=C.fullTrace.filter(I=>p.has(I.fullType)||i&&i.has(I.type));if(R.length===0)if(v)f.push({label:"Unlabeled",value:C.value});else return;const _=R.map(I=>I.label),S=n.separator??" / ";f.push({label:_.join(S),value:C.value})}return f};if(a.length===0){if(u.length!==0)throw new Error("Non-empty secondary types list while main types list is empty.");return g(new Set(Pe),!0)}let h=0,m=-1;for(;h<a.length;){const p=new Set;n.includeNativeLabel&&p.add(Pe);for(let f=0;f<h;++f)p.add(a[f]);m>=0&&p.add(a[m]);const v=g(p);if(v!==void 0&&new Set(v.map(f=>f.label)).size===t.length)return v;m++,m>=a.length&&(h++,m=h)}return g(new Set([...a,...u]),!0)}const ne="PColumnData/",Q=ne+"ResourceMap",Z=ne+"Partitioned/ResourceMap",B=ne+"JsonPartitioned",K=ne+"BinaryPartitioned",Je=ne+"Partitioned/",ee=Je+"JsonPartitioned",$=Je+"BinaryPartitioned";function Ke(t,e,n,r=[],i){if(t===void 0)return!1;switch(t.resourceType.name){case Q:{let s=t.getInputsLocked();for(const o of t.listInputFields()){const a=t.resolve({field:o,assertFieldType:"Input"}),u=[...r,...JSON.parse(o)],c=a===void 0?void 0:e(a);c===void 0&&(s=!1),(c!==void 0||i)&&n.push({key:u,value:c})}return s}case Z:{let s=t.getInputsLocked();for(const o of t.listInputFields()){const a=t.resolve({field:o,assertFieldType:"Input"});if(a===void 0)s=!1;else{const u=[...r,...JSON.parse(o)],c=Ke(a,e,n,u,i);s=s&&c}}return s}default:throw new Error(`Unknown resource type: ${t.resourceType.name}`)}}function Ht(t,e,n=!1){const r=[];return{isComplete:Ke(t,e,r,[],n),data:r}}const fe=t=>{if(t.endsWith(".index"))return{baseKey:t.substring(0,t.length-6),type:"index"};if(t.endsWith(".values"))return{baseKey:t.substring(0,t.length-7),type:"values"};throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`)};function Ve(t){if(!t)return;const e=t.resourceType.name,n=t.getDataAsJson(),r=[];let i=0;switch(e){case Q:i=n.keyLength;break;case Z:i=n.partitionKeyLength+n.keyLength;break;case B:case K:i=n.partitionKeyLength;break;case $:case ee:i=n.superPartitionKeyLength+n.partitionKeyLength;break}switch(e){case Q:case B:case K:for(let s of t.listInputFields()){e===K&&(s=fe(s).baseKey);const o=[...JSON.parse(s)];r.push(o)}break;case Z:case $:case ee:for(const s of t.listInputFields()){const o=[...JSON.parse(s)],a=t.resolve({field:s,assertFieldType:"Input"});if(a!==void 0)for(let u of a.listInputFields()){e===$&&(u=fe(u).baseKey);const c=[...o,...JSON.parse(u)];r.push(c)}}break}return{data:r,keyLength:i}}function qt(t){if(t.type!=="JsonPartitioned"&&t.type!=="BinaryPartitioned")throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);const{parts:e,partitionKeyLength:n}=t,r=[];for(let i=0;i<n;++i)r.push(new Set);for(const i of e){const s=i.key;if(s.length!==n)throw new Error(`Key length (${s.length}) does not match partition length (${n}) for key: ${JSON.stringify(s)}`);for(let o=0;o<n;++o)r[o].add(s[o])}return r.map(i=>Array.from(i.values()))}function je(t){if(t===void 0)return;if(l.isDataInfoEntries(t))return qt(t);const e=Ve(t);if(!e)return;const{data:n,keyLength:r}=e,i=[];for(let s=0;s<r;++s)i.push(new Set);for(const s of n){if(s.length!==r)throw new Error("key length does not match partition length");for(let o=0;o<r;++o)i[o].add(s[o])}return i.map(s=>Array.from(s.values()))}function ae(t,e=[]){if(t===void 0||!t.getIsReadyOrError())return;const n=t.resourceType.name,r=t.getDataAsJson();if(e.length>0&&(n===ee||n===$))throw new Error(`Unexpected nested super-partitioned resource: ${n}`);switch(n){case Q:case Z:throw new Error(`Only data columns are supported, got: ${n}`);case B:{if(typeof(r==null?void 0:r.partitionKeyLength)!="number")throw new Error(`Missing partitionKeyLength in metadata for ${n}`);const i=[];for(const s of t.listInputFields()){const o=t.resolve({field:s,assertFieldType:"Input"});if(o===void 0)return;const a=[...e,...JSON.parse(s)];i.push({key:a,value:o})}return{type:"JsonPartitioned",partitionKeyLength:r.partitionKeyLength,parts:i}}case K:{if(typeof(r==null?void 0:r.partitionKeyLength)!="number")throw new Error(`Missing partitionKeyLength in metadata for ${n}`);const i=[],s=new Map;for(const o of t.listInputFields()){const a=fe(o),u=t.resolve({field:o,assertFieldType:"Input"});if(u===void 0)return;let c=s.get(a.baseKey);c||(c={},s.set(a.baseKey,c)),a.type==="index"?c.index=u:c.values=u}for(const[o,a]of s.entries()){if(!a.index||!a.values)return;const u=[...e,...JSON.parse(o)];i.push({key:u,value:{index:a.index,values:a.values}})}return{type:"BinaryPartitioned",partitionKeyLength:r.partitionKeyLength,parts:i}}case ee:{if(typeof(r==null?void 0:r.superPartitionKeyLength)!="number"||typeof(r==null?void 0:r.partitionKeyLength)!="number")throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);const i=r.superPartitionKeyLength+r.partitionKeyLength,s=[];for(const o of t.listInputFields()){const a=t.resolve({field:o,assertFieldType:"Input"});if(a===void 0)return;if(a.resourceType.name!==B)throw new Error(`Expected ${B} inside ${n}, but got ${a.resourceType.name}`);const u=ae(a,JSON.parse(o));if(u===void 0)return;if(u.type!=="JsonPartitioned")throw new Error(`Unexpected inner result type for ${n}: ${u.type}`);s.push(...u.parts)}return{type:"JsonPartitioned",partitionKeyLength:i,parts:s}}case $:{if(typeof(r==null?void 0:r.superPartitionKeyLength)!="number"||typeof(r==null?void 0:r.partitionKeyLength)!="number")throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);const i=r.superPartitionKeyLength+r.partitionKeyLength,s=[];for(const o of t.listInputFields()){const a=t.resolve({field:o,assertFieldType:"Input"});if(a===void 0)return;if(a.resourceType.name!==K)throw new Error(`Expected ${K} inside ${n}, but got ${a.resourceType.name}`);const u=ae(a,JSON.parse(o));if(u===void 0)return;if(u.type!=="BinaryPartitioned")throw new Error(`Unexpected inner result type for ${n}: ${u.type}`);s.push(...u.parts)}return{type:"BinaryPartitioned",partitionKeyLength:i,parts:s}}default:throw new Error(`Unknown resource type: ${n}`)}}function Me(t){if(t!==void 0){if(l.isDataInfoEntries(t))return t;if(l.isDataInfo(t))return l.dataInfoToEntries(t);if(t instanceof O)return ae(t);throw new Error(`Unexpected input type: ${typeof t}`)}}function Be(t,e){const n=[...e].sort((s,o)=>o[0]-s[0]);if(t.type==="JsonPartitioned"||t.type==="BinaryPartitioned"){const{partitionKeyLength:s}=t;for(const[o]of e)if(o>=s)throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${s}`)}else if(t.type==="Json"){const{keyLength:s}=t;for(const[o]of e)if(o>=s)throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${s}`)}const r=s=>{for(const[o,a]of n)if(s[o]!==a)return!1;return!0},i=s=>{const o=[...s];for(const[a]of n)o.splice(a,1);return o};switch(t.type){case"Json":{const s=t.data.filter(o=>r(o.key)).map(o=>({key:i(o.key),value:o.value}));return{type:"Json",keyLength:t.keyLength-e.length,data:s}}case"JsonPartitioned":{const s=t.parts.filter(o=>r(o.key)).map(o=>({key:i(o.key),value:o.value}));return{type:"JsonPartitioned",partitionKeyLength:t.partitionKeyLength-e.length,parts:s}}case"BinaryPartitioned":{const s=t.parts.filter(o=>r(o.key)).map(o=>({key:i(o.key),value:o.value}));return{type:"BinaryPartitioned",partitionKeyLength:t.partitionKeyLength-e.length,parts:s}}}}function Yt(t){if(!Array.isArray(t))return!1;if(t.length===0)return!0;const e=t[0];return typeof e=="object"&&e!==null&&"key"in e&&"val"in e}class Xt{constructor(e){this.columns=e}selectColumns(e){const n=typeof e=="function"?e:l.selectorsToPredicate(e);return this.columns.filter(r=>n(r.spec))}}function Qt(t){if(t)return t.map(e=>({type:`split:${l.canonicalizeAxisId(e.axisId)}`,label:e.label,importance:1e6}))}function Zt(t){if(t)return t.map(e=>[e.axisIdx,e.value])}function en(t,e){if(!e||e.length===0)return t;const n=[...e].sort((r,i)=>r[0]-i[0]);return we({id:t,axisFilters:n})}function Se(t){if(!t||typeof t!="object")return!1;const e=t,n=e.domain&&typeof e.domain=="object"&&Object.values(e.domain).some(i=>typeof i=="object"&&i!==null&&"anchor"in i),r=e.axes&&Array.isArray(e.axes)&&e.axes.some(i=>typeof i=="object"&&i!==null&&"anchor"in i);return!!e.domainAnchor||n||r}function tn(t){if(typeof t!="object"||!("axes"in t)||t.axes===void 0)return[];const e=t.axes.map((n,r)=>typeof n=="object"&&"split"in n&&n.split===!0?r:-1).filter(n=>n!==-1);if(e.length>0&&t.partialAxesMatch!==void 0)throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");return e.sort((n,r)=>n-r),e}class te{constructor(){D(this,"defaultProviderStore",[]);D(this,"providers",[new Xt(this.defaultProviderStore)]);D(this,"axisLabelProviders",[])}addColumnProvider(e){return this.providers.push(e),this}addAxisLabelProvider(e){return this.axisLabelProviders.push(e),this}addColumns(e){return this.defaultProviderStore.push(...e),this}addColumn(e){return this.defaultProviderStore.push(e),this}findLabels(e){for(const n of this.axisLabelProviders){const r=n.findLabels(e);if(r)return r}}getUniversalEntries(e,n){const{anchorCtx:r,labelOps:i,dontWaitAllData:s=!1,overrideLabelAnnotation:o=!1,exclude:a}=n??{},u={...o&&(i==null?void 0:i.includeNativeLabel)!==!1?{includeNativeLabel:!0}:{},...i??{}};let c=()=>!1;if(a){const f=(Array.isArray(a)?a:[a]).map(b=>{if(Se(b)){if(!r)throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");return l.selectorsToPredicate(l.resolveAnchors(r.anchors,b,n))}else return l.selectorsToPredicate(b)});c=b=>f.some(C=>C(b))}const g=typeof e=="function"?[e]:Array.isArray(e)?e:[e],h=[],m=new Set;for(const f of g){const b=Se(f);let C;if(b){if(!r)throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");C=l.resolveAnchors(r.anchors,f,n)}else C=f;const R=new Set,_=[];for(const P of this.providers){const T=P.selectColumns(C);for(const d of T){if(c(d.spec))continue;if(R.has(d.id))throw new Error(`Duplicate column id ${d.id} in provider ${P.constructor.name}`);const y=l.deriveNativeId(d.spec);m.has(y)||(R.add(d.id),m.add(y),_.push(d))}}if(_.length===0)continue;const S=tn(f),I=S.length>0;for(const P of _){if(!l.isPColumnSpec(P.spec))continue;const T=P.spec;if(I){if(Yt(P.data))throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${P.id}`);const d=Me(P.data);if(!d){if(s)continue;return}if(!l.isPartitionedDataInfoEntries(d))throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${d.type} for column ${P.id}`);const y=je(d),L=S[S.length-1];if(L>=d.partitionKeyLength)throw new Error(`Not enough partition keys (${d.partitionKeyLength}) for requested split axes (max index ${L}) in column ${T.name}`);const W=S.map(F=>this.findLabels(l.getAxisId(T.axesSpec[F]))),N=[],V=(F,z)=>{if(z>=S.length){if(N.push([...F]),N.length>1e4)throw new Error("Too many key combinations, aborting.");return}const J=S[z];if(J>=y.length)throw new Error(`Axis index ${J} out of bounds for unique keys array (length ${y.length}) during split key generation for column ${P.id}`);const j=y[J];if(!j||j.length===0){N.length=0;return}for(const re of j)F.push(re),V(F,z+1),F.pop()};if(V([],0),N.length===0)continue;const k=[...T.axesSpec],st=S.map(F=>F);for(let F=S.length-1;F>=0;F--)k.splice(S[F],1);const ot={...T,axesSpec:k};for(const F of N){const z=F.map((J,j)=>{const re=st[j],at=l.getAxisId(T.axesSpec[re]),ue=W[j],lt=(ue==null?void 0:ue[J])??String(J);return{axisIdx:re,axisId:at,value:J,label:lt}});h.push({type:"split",originalColumn:P,spec:T,adjustedSpec:ot,dataEntries:d,axisFilters:z})}}else h.push({type:"direct",originalColumn:P,spec:T,adjustedSpec:T})}}if(h.length===0)return[];const p=ve(h,f=>({spec:f.spec,suffixTrace:f.type==="split"?Qt(f.axisFilters):void 0}),u),v=[];for(const{value:f,label:b}of p){const{originalColumn:C,spec:R}=f,_=f.type==="split"?f.axisFilters:void 0,S=Zt(_);let I;r?I=r.deriveS(R,S):I=en(C.id,S);let P={...f.adjustedSpec};o&&(P={...P,annotations:{...P.annotations??{},"pl7.app/label":b}}),v.push({id:I,spec:P,data:()=>f.type==="split"?l.entriesToDataInfo(Be(f.dataEntries,S)):f.originalColumn.data,label:b})}return v}getColumns(e,n){const r=this.getUniversalEntries(e,{overrideLabelAnnotation:!0,...n??{}});if(!r)return;const i=[];for(const s of r){const o=s.data();if(!o){if(n!=null&&n.dontWaitAllData)continue;return}i.push({id:s.id,spec:s.spec,data:o})}return i}}function he(t){const e=i=>i.operator!=="InSet"?i:{operator:"Or",operands:i.references.map(s=>({operator:"Equal",reference:s}))},n=(i,s)=>{switch(i.operator){case"And":return{...i,operands:i.operands.map(a=>n(a,s))};case"Or":return{...i,operands:i.operands.map(a=>n(a,s))};case"Not":return{...i,operand:n(i.operand,s)};default:return s(i)}},r=(i,s)=>({...i,predicate:n(i.predicate,s)});return t.map(i=>r(i,e))}function de(t,e){if(t===void 0)return e===void 0;if(e===void 0)return!0;for(const n in e)if(t[n]!==e[n])return!1;return!0}function Ie(t){return l.mapPObjectData(t,e=>e instanceof O?e.handle:l.isDataInfo(e)?l.mapDataInfo(e,n=>n.handle):e)}class $e{constructor(){D(this,"ctx",A())}calculateOptions(e){return this.ctx.calculateOptions(e)}getOptions(e,n){const r=typeof e=="function"?e:l.selectorsToPredicate(e),i=this.getSpecs().entries.filter(a=>r(a.obj));let s={},o=!1;return typeof n<"u"&&(typeof n=="function"?s=n:typeof n=="object"&&("includeNativeLabel"in n||"separator"in n||"addLabelAsSuffix"in n?s=n:(n=n,s=n.label??{},o=n.refsWithEnrichments??!1))),typeof s=="object"?ve(i,a=>a.obj,s??{}).map(({value:{ref:a},label:u})=>({ref:l.withEnrichments(a,o),label:u})):i.map(({ref:a,obj:u})=>({ref:l.withEnrichments(a,o),label:s(u,a)}))}resolveAnchorCtx(e){if(e instanceof l.AnchoredIdDeriver)return e;const n={};for(const[r,i]of Object.entries(e))if(l.isPlRef(i)){const s=this.getPColumnSpecByRef(i);if(!s)return;n[r]=s}else n[r]=i;return new l.AnchoredIdDeriver(n)}getAnchoredPColumns(e,n,r){const i=this.resolveAnchorCtx(e);if(i)return new te().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n,{...r,anchorCtx:i})}getCanonicalOptions(e,n,r){const i=this.resolveAnchorCtx(e);if(!i)return;const s=new te().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n,{...r,anchorCtx:i});if(s)return s.map(o=>({value:o.id,label:o.label}))}getDataFromResultPool(){return this.getData()}getData(){const e=this.ctx.getDataFromResultPool();return{isComplete:e.isComplete,entries:e.entries.map(n=>({ref:n.ref,obj:{...n.obj,data:new O(n.obj.data,[n.ref.blockId,n.ref.name])}}))}}getDataWithErrorsFromResultPool(){return this.getDataWithErrors()}getDataWithErrors(){const e=this.ctx.getDataWithErrorsFromResultPool();return{isComplete:e.isComplete,entries:e.entries.map(n=>({ref:n.ref,obj:{...n.obj,data:l.mapValueInVOE(n.obj.data,r=>new O(r,[n.ref.blockId,n.ref.name]))}}))}}getSpecsFromResultPool(){return this.getSpecs()}getSpecs(){return this.ctx.getSpecsFromResultPool()}getDataByRef(e){var r;if(typeof this.ctx.getDataFromResultPoolByRef>"u")return(r=this.getData().entries.find(i=>i.ref.blockId===e.blockId&&i.ref.name===e.name))==null?void 0:r.obj;const n=this.ctx.getDataFromResultPoolByRef(e.blockId,e.name);if(n)return l.mapPObjectData(n,i=>new O(i,[e.blockId,e.name]))}getPColumnByRef(e){const n=this.getDataByRef(e);if(n)return l.ensurePColumn(n)}getPColumnSpecByRef(e){const n=this.getSpecByRef(e);if(n){if(!l.isPColumnSpec(n))throw new Error(`not a PColumn spec (kind = ${n.kind})`);return n}}getSpecByRef(e){return this.ctx.getSpecFromResultPoolByRef(e.blockId,e.name)}findDataWithCompatibleSpec(e){const n=[];e:for(const r of this.getData().entries){if(!l.isPColumnSpec(r.obj.spec))continue;const i=r.obj.spec;if(e.name===i.name&&e.valueType===i.valueType&&e.axesSpec.length===i.axesSpec.length&&de(e.domain,i.domain)){for(let s=0;s<e.axesSpec.length;++s){const o=e.axesSpec[s],a=i.axesSpec[s];if(o.name!==a.name||o.type!==a.type||!de(o.domain,a.domain))continue e}n.push(r.obj)}}return n}findLabels(e){const n=this.getData();for(const r of n.entries){if(!l.isPColumn(r.obj))continue;const i=r.obj.spec;if(i.name==="pl7.app/label"&&i.axesSpec.length===1&&i.axesSpec[0].name===e.name&&i.axesSpec[0].type===e.type&&de(e.domain,i.axesSpec[0].domain)){if(r.obj.data.resourceType.name!=="PColumnData/Json")throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);return Object.fromEntries(Object.entries(r.obj.data.getDataAsJson().data).map(o=>[JSON.parse(o[0])[0],o[1]]))}}}selectColumns(e){const n=typeof e=="function"?e:l.selectorsToPredicate(e);return this.getSpecs().entries.filter(({obj:i})=>l.isPColumnSpec(i)?n(i):!1).map(({ref:i,obj:s})=>{const o=s;let a=null;const u=this;return{id:we(i),spec:o,get data(){var c;return a!==null||(a=(c=u.getPColumnByRef(i))==null?void 0:c.data),a}}})}findLabelsForColumnAxis(e,n){var s;const r=this.findLabels(e.axesSpec[n]);if(!r)return;const i=(s=e.annotations)==null?void 0:s["pl7.app/axisKeys/"+n];if(i!==void 0){const o=JSON.parse(i);return Object.fromEntries(o.map(a=>[a,r[a]??"Unlabelled"]))}else return r}}class H{constructor(){D(this,"ctx");D(this,"_argsCache");D(this,"_uiStateCache");D(this,"_activeArgsCache");D(this,"resultPool",new $e);this.ctx=A()}get args(){if(this._argsCache===void 0){const e=this.ctx.args,n=typeof e=="function"?e():e;this._argsCache={v:JSON.parse(n)}}return this._argsCache.v}get uiState(){if(this._uiStateCache===void 0){const e=this.ctx.uiState,n=typeof e=="function"?e():e;this._uiStateCache={v:n?JSON.parse(n):{}}}return this._uiStateCache.v}get activeArgs(){if(this._activeArgsCache===void 0){const e=this.ctx.activeArgs,n=typeof e=="function"?e():e;this._activeArgsCache={v:n?JSON.parse(n):void 0}}return this._activeArgsCache.v}getNamedAccessor(e){return oe(this.ctx.getAccessorHandleByName(e),n=>new O(n,[e]))}get prerun(){return this.getNamedAccessor(Ee)}get outputs(){return this.getNamedAccessor(Fe)}findLabels(e){return this.resultPool.findLabels(e)}verifyInlineAndExplicitColumnsSupport(e){var i;const n=e.some(s=>!(s.data instanceof O)||l.isDataInfo(s.data)),r=((i=this.ctx.featureFlags)==null?void 0:i.inlineColumnsSupport)===!0;if(n&&!r)throw Error("Inline or explicit columns not supported")}patchPTableDef(e){var n,r;return(n=this.ctx.featureFlags)!=null&&n.pTablePartitionFiltersSupport||(e={...e,partitionFilters:[],filters:[...e.partitionFilters,...e.filters]}),(r=this.ctx.featureFlags)!=null&&r.pFrameInSetFilterSupport||(e={...e,partitionFilters:he(e.partitionFilters),filters:he(e.filters)}),e}createPFrame(e){return this.verifyInlineAndExplicitColumnsSupport(e),this.ctx.createPFrame(e.map(n=>Ie(n)))}createPTable(e){let n;return"columns"in e?n=this.patchPTableDef({src:{type:"full",entries:e.columns.map(r=>({type:"column",column:r}))},partitionFilters:e.filters??[],filters:[],sorting:e.sorting??[]}):n=this.patchPTableDef(e),this.verifyInlineAndExplicitColumnsSupport(l.extractAllColumns(n.src)),this.ctx.createPTable(l.mapPTableDef(n,r=>Ie(r)))}getBlockLabel(e){return this.ctx.getBlockLabel(e)}getCurrentUnstableMarker(){return this.ctx.getCurrentUnstableMarker()}logInfo(e){this.ctx.logInfo(e)}logWarn(e){this.ctx.logWarn(e)}logError(e){this.ctx.logError(e)}}const Y="1.39.6";function Ue(t){return t.__renderLambda===!0}function ie(t){if(t!==void 0)return Ue(t)?t.handle:t}function nn(t){return l.extractConfigGeneric(t)}const w=class w{constructor(e,n,r,i,s,o,a,u,c){this._renderingMode=e,this._initialArgs=n,this._initialUiState=r,this._outputs=i,this._inputsValid=s,this._sections=o,this._title=a,this._enrichmentTargets=u,this._featureFlags=c}static create(e="Heavy"){return new w(e,void 0,{},{},q(!0),q([]),void 0,void 0,{...w.INITIAL_BLOCK_FEATURE_FLAGS})}output(e,n,r={}){if(typeof n=="function"){const i=`output#${e}`;return G(i,()=>n(new H)),new w(this._renderingMode,this._initialArgs,this._initialUiState,{...this._outputs,[e]:{__renderLambda:!0,handle:i,...r}},this._inputsValid,this._sections,this._title,this._enrichmentTargets,this._featureFlags)}else return new w(this._renderingMode,this._initialArgs,this._initialUiState,{...this._outputs,[e]:n},this._inputsValid,this._sections,this._title,this._enrichmentTargets,this._featureFlags)}retentiveOutput(e,n){return this.output(e,n,{retentive:!0})}argsValid(e){return typeof e=="function"?(G("inputsValid",()=>e(new H)),new w(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,{__renderLambda:!0,handle:"inputsValid"},this._sections,this._title,this._enrichmentTargets,this._featureFlags)):new w(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,e,this._sections,this._title,this._enrichmentTargets,this._featureFlags)}sections(e){return Array.isArray(e)?this.sections(q(e)):typeof e=="function"?(G("sections",()=>e(new H)),new w(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,{__renderLambda:!0,handle:"sections"},this._title,this._enrichmentTargets,this._featureFlags)):new w(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,e,this._title,this._enrichmentTargets,this._featureFlags)}title(e){return G("title",()=>e(new H)),new w(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,this._sections,{__renderLambda:!0,handle:"title"},this._enrichmentTargets,this._featureFlags)}initialArgs(e){return new w(this._renderingMode,e,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets,this._featureFlags)}withArgs(e){return new w(this._renderingMode,e,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets,this._featureFlags)}withUiState(e){return new w(this._renderingMode,this._initialArgs,e,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets,this._featureFlags)}enriches(e){return G("enrichmentTargets",e),new w(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,{__renderLambda:!0,handle:"enrichmentTargets"},this._featureFlags)}done(){if(this._initialArgs===void 0)throw new Error("Initial arguments not set.");const e={v3:{sdkVersion:Y,renderingMode:this._renderingMode,initialArgs:this._initialArgs,initialUiState:this._initialUiState,inputsValid:this._inputsValid,sections:this._sections,title:this._title,outputs:this._outputs,enrichmentTargets:this._enrichmentTargets,featureFlags:this._featureFlags},sdkVersion:Y,renderingMode:this._renderingMode,initialArgs:this._initialArgs,inputsValid:ie(this._inputsValid),sections:ie(this._sections),outputs:Object.fromEntries(Object.entries(this._outputs).map(([n,r])=>[n,ie(r)]))};return jt()?Le({sdkVersion:Y}):{config:e}}};D(w,"INITIAL_BLOCK_FEATURE_FLAGS",{supportsLazyState:!0,requiresUIAPIVersion:1,requiresModelAPIVersion:1});let ge=w;function Ae(){return{sourceId:null,hiddenColIds:null,partitionFilters:[],filters:[],sorting:[]}}function We(){return{version:3,stateCache:[],pTableParams:Ae()}}function ze(t){return"version"in t?(t.version===2&&(t={version:3,stateCache:t.stateCache.map(e=>({...e,filtersState:[]})),pTableParams:Ae()}),t):We()}function le(t){return t.axesSpec.length===1&&t.name==="pl7.app/label"}function Ge(t){return new te().addAxisLabelProvider(t).addColumnProvider(t).getColumns({name:"pl7.app/label",axes:[{}]},{dontWaitAllData:!0})}function me(t,e){const n=[],r=[];for(const a of t)le(a.spec)?n.push(a):r.push(a);const i=[];for(const a of r)for(const u of a.spec.axesSpec){const c=l.getAxisId(u);i.some(g=>l.matchAxisId(g,c))||i.push(c)}for(const a of n){const u=l.getAxisId(a.spec.axesSpec[0]),c=i.findIndex(g=>l.matchAxisId(g,u));c!==-1&&i.splice(c,1)}const s=(a,u)=>{let c=a.toString();if(u)for(const g in u)c+=g,c+=u[g];return c},o=[];for(const a of e){const u=a.spec.axesSpec[0],c=l.getAxisId(u),g=i.findIndex(h=>l.matchAxisId(h,c));if(g!==-1){const h=i[g],m=Object.keys(h.domain??{}).length,p=Object.keys(u.domain??{}).length;m>p?o.push({id:s(a.id,h.domain),spec:{...a.spec,axesSpec:[{...h,annotations:u.annotations}]},data:a.data}):o.push(a),i.splice(g,1)}}return o}function He(t){const e=i=>Array.isArray(i),n=i=>i instanceof O,r=i=>typeof i=="object"&&"type"in i;return t.map(i=>i.data).every(i=>{if(e(i))return!0;if(n(i))return i.getIsReadyOrError();if(r(i))switch(i.type){case"Json":return!0;case"JsonPartitioned":return Object.values(i.parts).every(o=>o.getIsReadyOrError());case"BinaryPartitioned":return Object.values(i.parts).every(o=>o.index.getIsReadyOrError()&&o.values.getIsReadyOrError())}else throw Error(`unsupported column data type: ${i}`)})}function xe(t){let e=t.columns;const n=[];if(t.coreColumnPredicate){e=[];for(const r of t.columns)t.coreColumnPredicate(r.spec)?e.push(r):n.push(r)}return n.push(...t.labelColumns),{src:{type:"outer",primary:{type:t.coreJoinType,entries:e.map(r=>({type:"column",column:r}))},secondary:n.map(r=>({type:"column",column:r}))},partitionFilters:t.partitionFilters,filters:t.filters,sorting:t.sorting}}function qe(t){var e;return((e=t.annotations)==null?void 0:e["pl7.app/table/visibility"])==="hidden"}function Ye(t){var e;return((e=t.annotations)==null?void 0:e["pl7.app/table/visibility"])==="optional"}function se(t,e){return[...new Map(t.map(n=>[e(n),n])).values()]}function rn(t,e,n,r){if(e.length===0)return;const i=e.filter(d=>!qe(d.spec)),s=ze(n),o=Ge(t.resultPool);if(!o)return;const a=me(i.map(l.getColumnIdAndSpec),o),u=[...i,...a],g=[...se([...u.flatMap(d=>d.spec.axesSpec.map(y=>l.getAxisId(y)))],d=>l.canonicalizeJson(d)).map(d=>({type:"axis",id:d})),...u.map(d=>({type:"column",id:d.id}))],h=new Set(g.map(d=>l.canonicalizeJson(d))),m=d=>h.has(l.canonicalizeJson(d)),p=(r==null?void 0:r.coreJoinType)??"full",v=s.pTableParams.partitionFilters.filter(d=>{const y=m(d.column);return y||t.logWarn(`Partition filter ${JSON.stringify(d)} does not match provided columns, skipping`),y}),f=se([...(r==null?void 0:r.filters)??[],...s.pTableParams.filters],d=>l.canonicalizeJson(d.column)).filter(d=>{const y=m(d.column);return y||t.logWarn(`Filter ${JSON.stringify(d)} does not match provided columns, skipping`),y}),b=se([...(r==null?void 0:r.sorting)??[],...s.pTableParams.sorting],d=>l.canonicalizeJson(d.column)).filter(d=>{const y=m(d.column);return y||t.logWarn(`Sorting ${JSON.stringify(d)} does not match provided columns, skipping`),y}),C=xe({columns:i,labelColumns:a,coreJoinType:p,partitionFilters:v,filters:f,sorting:b,coreColumnPredicate:r==null?void 0:r.coreColumnPredicate}),R=t.createPTable(C),_=new Set((()=>{if(p==="inner")return[];const d=s.pTableParams.hiddenColIds;return d||i.filter(y=>Ye(y.spec)).map(y=>y.id)})());i.filter(d=>{var y;return((y=d.spec.annotations)==null?void 0:y["pl7.app/isLinkerColumn"])==="true"}).forEach(d=>_.delete(d.id)),r!=null&&r.coreColumnPredicate&&i.flatMap(y=>{var L;return(L=r==null?void 0:r.coreColumnPredicate)!=null&&L.call(r,y.spec)?[y.id]:[]}).forEach(y=>_.delete(y)),[...v.map(d=>d.column),...f.map(d=>d.column),...b.map(d=>d.column)].filter(d=>d.type==="column").forEach(d=>_.delete(d.id));const S=i.filter(d=>!_.has(d.id)),I=me(S.map(l.getColumnIdAndSpec),o);if(!He([...S,...I]))return;const P=xe({columns:S,labelColumns:I,coreJoinType:p,partitionFilters:v,filters:f,sorting:b,coreColumnPredicate:r==null?void 0:r.coreColumnPredicate}),T=t.createPTable(P);return{sourceId:s.pTableParams.sourceId,fullTableHandle:R,visibleTableHandle:T}}function sn(t,e,n){const r=t.resultPool.findLabels(e);return{axis:e,options:n.map(i=>({value:i,label:(r==null?void 0:r[i])??i.toString()})),defaultValue:n[0]}}const on=(t,e)=>{let n=t.toString();return e==null||e.forEach(r=>{if(r)for(const[i,s]of Object.entries(r))n+=i,n+=s}),n};function an(t){if(!t.length)return[];let e=[[]];return t.forEach(n=>{const r=[];n.forEach(i=>{r.push(...e.map(s=>[...s,i]))}),e=r}),e}function Xe(t){var e;return t.axesSpec.length===2&&((e=t.annotations)==null?void 0:e[Ze])==="true"}const Qe="pl7.app/graph/isVirtual",ye="pl7.app/label",Ze="pl7.app/isLinkerColumn";function et(t){var n,r;const e=new Map;for(const{spec:i}of t){const s=i.axesSpec.map(l.getAxisId).map(l.canonicalizeJson);s.forEach(o=>{e.has(o)||e.set(o,new Set)});for(let o=0;o<s.length-1;o++)for(let a=o+1;a<s.length;a++){const u=s[o],c=s[a];(n=e.get(u))==null||n.add(c),(r=e.get(c))==null||r.add(u)}}return e}function tt(t,e){const n=et(t),r=[...n.keys()].map(l.parseJson),i=[];for(const u of e.values()){const c=r.find(g=>l.matchAxisId(u,g));c&&i.push(l.canonicalizeJson(c))}const s=new Set(i),o=new Map;let a=[...i];for(;a.length;){const u=[];for(const c of a)for(const g of n.get(c)??[])s.has(g)||(u.push(g),s.add(g),o.set(g,l.parseJson(g)));a=u}return o}function nt(t,e){const n=[];return e.forEach(r=>{n.push(...ln(t,r))}),n}function ln(t,e){const n=e.spec.axesSpec.map(l.getAxisId);if(n.every(c=>t.has(l.canonicalizeJson(c))))return[e];const r=n.map(c=>{const g=[];for(const[h,m]of t)l.matchAxisId(m,c)&&!l.matchAxisId(c,m)&&g.push(m);return g}),i=an(r),s=new Set,o=new Set,a=i.map(c=>{const g=new Set;return c.map((h,m)=>{const p=e.spec.axesSpec[m].domain,v=h.domain;return Object.entries(v??{}).forEach(([f,b])=>{if((p==null?void 0:p[f])===void 0){const C=JSON.stringify([f,b]);g.add(C),s.add(C)}}),{...h,annotations:e.spec.axesSpec[m].annotations}}),g});[...s].forEach(c=>{a.some(g=>!g.has(c))&&o.add(c)});const u=i.map((c,g)=>{var f;const h=on(e.id,c.map(b=>b.domain)),m=((f=e.spec.annotations)==null?void 0:f[ye])??"",p=[...a[g]].filter(b=>o.has(b)).sort().map(b=>{var C;return(C=JSON.parse(b))==null?void 0:C[1]}).join(" / "),v={...e.spec.annotations,[Qe]:"true"};return(m||p)&&(v[ye]=m&&p?m+" / "+p:m+p),{id:h,spec:{...e.spec,axesSpec:c.map((b,C)=>({...b,annotations:e.spec.axesSpec[C].annotations})),annotations:v},data:e.data}});return[e,...u]}function un(t,e){if(!e)return;const n=new te;n.addColumnProvider(t.resultPool),n.addColumns(e);const r=new Map,i=new Map;for(const h of e)for(const m of h.spec.axesSpec){const p=l.getAxisId(m);r.set(l.canonicalizeJson(p),p),i.set(l.canonicalizeJson(p),p)}const s=n.getColumns(h=>Xe(h))??[],o=tt(s,r);for(const h of o)r.set(...h),i.set(...h);const a=(n.getColumns(h=>h.axesSpec.some(m=>{const p=l.getAxisId(m);for(const v of r.values())if(l.matchAxisId(v,p))return!0;return!1}),{dontWaitAllData:!0,overrideLabelAnnotation:!1})??[]).filter(h=>!le(h.spec));for(const h of a)for(const m of h.spec.axesSpec){const p=l.getAxisId(m);i.set(l.canonicalizeJson(p),p)}const u=(n.getColumns(h=>h.axesSpec.some(m=>{const p=l.getAxisId(m);for(const v of i.values())if(l.matchAxisId(v,p))return!0;return!1}),{dontWaitAllData:!0,overrideLabelAnnotation:!1})??[]).filter(h=>le(h.spec)),c=[...a,...u],g=nt(r,c);if(!g.some(h=>h.data instanceof O&&!h.data.getIsReadyOrError()))return t.createPFrame(g)}function cn({selection:t,columnId:e=l.uniquePlId(),label:n="Selection marker",domain:r}){if(!(t!=null&&t.axesSpec.length))return;const i=t.selectedKeys.filter(s=>s.every(o=>!l.isPTableAbsent(o))).map(s=>({key:s,val:1}));if(i.length)return{id:e,spec:{kind:"PColumn",valueType:"Int",name:"pl7.app/table/row-selection",axesSpec:t.axesSpec,...r&&Object.keys(r).length&&{domain:r},annotations:{"pl7.app/label":n,"pl7.app/discreteValues":"[1]"}},data:i}}function dn(t){return t===l.PTableNA?(console.error("Axis value can never be N/A"),""):t}class pn{constructor(e){this.handle=e}async findColumns(e){return await platforma.pFrameDriver.findColumns(this.handle,e)}async getColumnSpec(e){return await platforma.pFrameDriver.getColumnSpec(this.handle,e)}async listColumns(){return await platforma.pFrameDriver.listColumns(this.handle)}async calculateTableData(e,n){var r;return(r=cfgRenderCtx.featureFlags)!=null&&r.pFrameInSetFilterSupport||(e={...e,filters:he(e.filters)}),await platforma.pFrameDriver.calculateTableData(this.handle,e,n)}async getUniqueValues(e){return await platforma.pFrameDriver.getUniqueValues(this.handle,e)}}function rt(t){return be({__isRef:!0,blockId:X(t,"blockId"),name:X(t,"name")})}function fn(t){return be({ref:rt(X(t,"ref")),label:X(t,"label")})}const hn={sdkVersion:Y};function it(){return Le({sdkVersion:Y})}function gn(t){try{return it()}catch{return t}}function mn(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}exports.Args=ft;exports.BlockModel=ge;exports.CurrentSdkInfo=hn;exports.FutureRef=E;exports.IS_VIRTUAL_COLUMN=Qe;exports.It=ht;exports.JsRenderInternal=Wt;exports.LABEL_ANNOTATION=ye;exports.LINKER_COLUMN_ANNOTATION=Ze;exports.MainOutputs=gt;exports.OutputError=_e;exports.PAnnotationLabel=Re;exports.PAnnotationTrace=De;exports.PColumnCollection=te;exports.PFrameImpl=pn;exports.RT_BINARY_PARTITIONED=K;exports.RT_BINARY_SUPER_PARTITIONED=$;exports.RT_JSON_PARTITIONED=B;exports.RT_JSON_SUPER_PARTITIONED=ee;exports.RT_RESOURCE_MAP=Q;exports.RT_RESOURCE_MAP_PARTITIONED=Z;exports.RenderCtx=H;exports.ResultPool=$e;exports.StagingOutputs=mt;exports.Trace=Ne;exports.TraceEntry=ke;exports.TreeNodeAccessor=O;exports.UiState=yt;exports.allColumnsComputed=He;exports.and=It;exports.convertOrParsePColumnData=Me;exports.createPFrameForGraphs=un;exports.createPlDataTableSheet=sn;exports.createPlDataTableStateV2=We;exports.createPlDataTableV2=rn;exports.createRowSelectionColumn=cn;exports.deriveLabels=ve;exports.downgradeCfgOrLambda=ie;exports.enrichCompatible=nt;exports.extractArchiveAndGetURL=Dt;exports.extractConfig=nn;exports.filterDataInfoEntries=Be;exports.flatten=Ct;exports.fromPlOption=fn;exports.fromPlRef=rt;exports.getAllLabelColumns=Ge;exports.getAvailableWithLinkersAxes=tt;exports.getBlobContent=Lt;exports.getBlobContentAsJson=Ft;exports.getBlobContentAsString=Et;exports.getDownloadedBlobContent=Ot;exports.getEnvironmentValue=mn;exports.getFromCfg=U;exports.getImmediate=q;exports.getImportProgress=kt;exports.getJsonField=X;exports.getLastLogs=Nt;exports.getLinkerColumnsMap=et;exports.getLogHandle=Vt;exports.getMatchingLabelColumns=me;exports.getOnDemandBlobContent=Rt;exports.getPartitionKeysList=Ve;exports.getPlatformaOrDefault=gn;exports.getProgressLog=Jt;exports.getProgressLogWithInfo=Kt;exports.getRawPlatformaInstance=it;exports.getResourceField=wt;exports.getResourceValueAsJson=_t;exports.getUniquePartitionKeys=je;exports.ifDef=oe;exports.isColumnHidden=qe;exports.isColumnOptional=Ye;exports.isConfigLambda=Ue;exports.isEmpty=Pt;exports.isLabelColumn=le;exports.isLinkerColumn=Xe;exports.isolate=pt;exports.makeArray=bt;exports.makeDefaultPTableParams=Ae;exports.makeObject=be;exports.mapArrayValues=At;exports.mapPTableValueToAxisKey=dn;exports.mapRecordValues=vt;exports.mapResourceFields=Tt;exports.not=St;exports.or=xt;exports.parsePColumnData=ae;exports.parseResourceMap=Ht;exports.readOutput=Te;exports.uniqueBy=se;exports.upgradePlDataTableStateV2=ze;exports.wrapOutputs=dt;Object.keys(l).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>l[t]})});Object.keys(Ce).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ce[t]})});
2
2
  //# sourceMappingURL=index.js.map