polymatica-widget-component-legacy 2.1.29 → 2.1.30

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.
@@ -103,14 +103,30 @@ export class PolymaticaWidgetLegacy extends HTMLElement {
103
103
  };
104
104
  blocks.push(sortBlock);
105
105
  }
106
+ function columnsStructure() {
107
+ let columnsStructure;
108
+ if (optionFilter && optionFilter[2] === null) {
109
+ columnsStructure = {
110
+ column_id: dataset.columns.find((column) => column.path === optionFilter[0])?.id || 0,
111
+ };
112
+ }
113
+ else if (optionFilter) {
114
+ optionFilter.map((column) => {
115
+ columnsStructure = {
116
+ column_id: column.column_id,
117
+ action: column.action,
118
+ value: column.value,
119
+ };
120
+ });
121
+ }
122
+ return columnsStructure;
123
+ }
106
124
  if (optionFilter) {
107
125
  const filterBlock = {
108
126
  key: blockFilterKey,
109
127
  block_type: ConfigDataBlockType_Server.Filter,
110
128
  function: null,
111
- columns: optionFilter.map(({ column_id, action, value }) => {
112
- return { column_id, action, value };
113
- }),
129
+ columns: [columnsStructure()],
114
130
  };
115
131
  blocks.push(filterBlock);
116
132
  }
@@ -1 +1 @@
1
- {"version":3,"file":"polymatica-widget-component-legacy.js","sourceRoot":"","sources":["../../src/polymatica-widget-component-legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AASlC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACH,iBAAiB,EACjB,eAAe,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAiB,MAAM,2BAA2B,CAAC;AACxE,OAAO,EACH,0BAA0B,EAE1B,cAAc,EACd,YAAY,GACf,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAIH,gBAAgB,GACnB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,6CAA6C,CAAC;AAGpE,OAAO,EAAE,GAAG,EAA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YACX,SAAS,CAAC,IAAI,CAAoB,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAEhE,IAAI,KAAK,CAAC,MAAM;YACZ,SAAS,CAAC,IAAI,CAAmB,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAE/D,IAAI,KAAK,CAAC,eAAe;YACrB,SAAS,CAAC,IAAI,CAAe,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;KACnE;AACL,CAAC"}
1
+ {"version":3,"file":"polymatica-widget-component-legacy.js","sourceRoot":"","sources":["../../src/polymatica-widget-component-legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AASlC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACH,iBAAiB,EACjB,eAAe,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAiB,MAAM,2BAA2B,CAAC;AACxE,OAAO,EACH,0BAA0B,EAE1B,cAAc,EACd,YAAY,GACf,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAIH,gBAAgB,GACnB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,6CAA6C,CAAC;AAGpE,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAW9C,MAAM,GAAG,GAAG,IAAI,OAAO,EAAmC,CAAC;AAO3D,SAAS,CAAC,gBAAgB,GAAG,GAAG,CAAC;AAEjC,MAAM,OAAO,sBACT,SAAQ,WAAW;IAGnB,IAAI,SAAS,CAAC,KAAsB;QAChC,QAAQ,KAAK,EAAE;YACX,KAAK,eAAe,CAAC,KAAK;gBACtB,MAAM,CAAC,IAAI,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,CAAC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AE,SAAS,EAAE,GAAG,OAAO,CAAC;QAE9B,IAAI,KAAK,CAAC,KAAK;YACX,SAAS,CAAC,IAAI,CAAoB,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAEhE,IAAI,KAAK,CAAC,MAAM;YACZ,SAAS,CAAC,IAAI,CAAmB,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAE/D,IAAI,KAAK,CAAC,eAAe;YACrB,SAAS,CAAC,IAAI,CAAe,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;KACnE;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polymatica-widget-component-legacy",
3
- "version": "2.1.29",
3
+ "version": "2.1.30",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "main": "./polymatica-widget-component-legacy.js",
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PolymaticaWidgetComponentLegacy=t():e.PolymaticaWidgetComponentLegacy=t()}(self,(()=>(()=>{var e={10:e=>{function t(e){return!e}e.exports=Object.defineProperties(t,{default:{value:t},not:{value:t},__esModule:{value:!0}})},771:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.encodeDrilldownData=t.decodeDrilldownData=t.blockColorizeKey=t.blockSortKey=t.blockFilterKey=t.configDataBlock_Server=t.ConfigDataBlockType_Server=void 0,(n=t.ConfigDataBlockType_Server||(t.ConfigDataBlockType_Server={})).Column="column",n.Filter="filter",n.Sort="sort",n.Colorizer="colorizer",n.Drilldown="drilldown",t.configDataBlock_Server="8316067a-d04b-4b21-bd4d-35529846617b",t.blockFilterKey="34642664-dbd1-4e35-b0ea-2eaabe796b48",t.blockSortKey="2c849ed6-6105-4aa2-a961-9f95135dfe3b",t.blockColorizeKey="badd51f7-82ce-45b2-a67e-37d52df88c5c",t.decodeDrilldownData=function(e,t){const n=[o(e.length),e];return t.forEach((e=>n.push(o(e.length),e))),n.join("");function o(e){if(e>255)throw new RangeError;return e>15?`0x${e.toString(16)}`:`0x0${e.toString(16)}`}},t.encodeDrilldownData=function(e){const t=[];!function n(o=0){const a=o+4,r=a+parseInt(e.slice(o,a));t.push(e.slice(a,r)),r<e.length&&n(r)}();const[n,...o]=t;return{source:n,additionalFilterSources:o}}},949:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DatasetColumnType_Server=t.ColumnFieldType_Server=void 0;var o,a=n(52);Object.defineProperty(t,"ColumnFieldType_Server",{enumerable:!0,get:function(){return a.ColumnType}}),(o=t.DatasetColumnType_Server||(t.DatasetColumnType_Server={})).Dimension="dimension",o.Fact="fact",o.Any="any"},992:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createColorizeColors=t.colorizeClassName=t.provideCssVariables=t.themeProjectKeys=t.themeKeys=void 0;const o=n(10);t.themeKeys=["background","backgroundBright","backgroundTint","text","textTint"],t.themeProjectKeys=["colors"];const a=document.querySelector("head"),r=document.querySelector("body"),i={};let s="",c="";function l(e,t){return`plmt-colorize-${e}-${t}`}t.provideCssVariables=function({theme:e,themeKey:n,themeProjectKey:a}){const r=`plmt-theme-${m(n)}`;if((0,o.not)(r in i)){const n=[];Object.entries(e).forEach((([e,o])=>{if(t.themeKeys.includes(e)){const t=m(e);Array.isArray(o)?o.forEach(((e,o)=>n.push({name:`--${t}-${o}`,value:e}))):n.push({name:`--${t}`,value:o})}})),p(r,[{className:r,cssProperties:n}])}s=f(s,r);const d=`plmt-project-${a}`;if((0,o.not)(d in i)&&p(d,[{className:d,cssProperties:e.colors.map(((e,t)=>({name:`--plmt-color-${t}`,value:e})))}]),c=f(c,d),(0,o.not)("colorize"in i)){const t=[];e.colorize.forEach(((e,n)=>{e.forEach(((e,o)=>t.push({className:l(n,o),cssProperties:[{name:"background-color",value:e}]})))})),p("colorize",t)}},t.colorizeClassName=l;const d=[...Array(10)].map(((e,t)=>t));t.createColorizeColors=function(e){return e.map((e=>{const[t,n,o]=function(e){const[,t,n,o]=e.match(u)||e.match(h)||[,"0","0","0"];return[parseInt(t,16),parseInt(n,16),parseInt(o,16)]}(e);return d.map((e=>`rgba(${t},${n},${o},${++e>9?"1":`0.${e}`})`))}))};const u=/([0-9abcdef]{2})([0-9abcdef]{2})([0-9abcdef]{2})/i,h=/([0-9abcdef])([0-9abcdef])([0-9abcdef])/i;function p(e,t){const n=document.createElement("style");i[e]=n;const o=[];t.forEach((({className:e,cssProperties:t})=>{o.push(".",e,"{\n"),t.forEach((({name:e,value:t})=>o.push(" ",e,": ",t,";\n"))),o.push("}\n")})),n.innerHTML=o.join(""),a.append(n)}function f(e,t){return e&&r.classList.remove(e),r.classList.add(t),t}function m(e){const t=Array(e.length);for(let n=0,o=e.length;n<o;n++){const o=e.charAt(n),a=o.toLowerCase();t[n]=o===a?o:"-"+a}return t.join("")}},40:(e,t)=>{"use strict";var n;function o(e,t){switch(e){case n.Input:case n.Radio:case n.Select:case n.ColorPicker:case n.TextArea:return t?String(t):"";case n.Checkbox:return Boolean(t);default:return""}}Object.defineProperty(t,"__esModule",{value:!0}),t.valueConversion=t.viewSettingsExtract=t.viewSettingsItemValue=t.ViewSettingsItemType=void 0,function(e){e.Input="text",e.Checkbox="checkbox",e.Radio="radio",e.Select="select",e.ColorPicker="color-picker",e.Title="title",e.TextArea="textArea"}(n=t.ViewSettingsItemType||(t.ViewSettingsItemType={})),t.viewSettingsItemValue="418d9556-a046-4623-be0b-4f4f69ccb783",t.viewSettingsExtract=function(e){return e.map((e=>e[t.viewSettingsItemValue])).map((e=>{return{type:e.type,key:e.key,label:e.label,placeholder:e.placeholder,defaultValue:o(e.type,e.defaultValue),options:e.options||[],span:(t=e.span,(t|=0)>24?24:t<0?0:t)};var t}))},t.valueConversion=o},35:(e,t)=>{"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.Input=void 0,(o=t.Input||(t.Input={})).Change="ptnl.input.change",o.ChangeLang="ptnl.input.changeLang",o.ChangeTheme="ptnl.input.changeTheme",o.ChangeOtherFilters="ptnl.input.ChangeOtherFilters",o.ChangeWidgetRenderEnv="ptnl.input.changeWidgetRenderEnv",(n=t.Output||(t.Output={})).Init="ptnl.output.init",n.Ready="ptnl.output.ready",n.SetFilter="ptnl.output.setFilter",n.RemoveFilterAt="ptnl.output.RemoveFilterAt",n.SetSort="ptnl.output.setSort",n.RemoveSortAt="ptnl.output.RemoveSortAt",n.Interact="ptnl.output.interact"},476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.provideDataTo=void 0;const o=n(771),a=n(382),r={setFilter(){},removeFilterAt(){},setSort(){},removeSortAt(){},interact(){}};function i(e,t){const n=t===a.widgetDefaultKey?e.dataSettings:e.dataSettings?.hasOwnProperty(t)?e.dataSettings[t]:e.dataSettings;return n?{events:n.events}:{events:{}}}t.provideDataTo=function(e,{dataOptionsMap:t,viewOptions:n},s=r){const c={},l={},d=window.parent.format?.[e.uid]||{};e.viewSettings={},Object.values(t).forEach((({data_option:t,rows:n,total:r})=>{c[t.key]=n;const u=t.dataset.columns_id.map((e=>({type:e.base_type,id:e.id,path:e.path,format:d[e.path]||(e=>e),name:e.name}))),h={},p=[],f=[],m=[];t.blocks.forEach((t=>{if(t.block_type!==o.ConfigDataBlockType_Server.Drilldown)switch(t.key){case o.blockFilterKey:t.columns.forEach((({column_id:e,action:t,value:n})=>{const o=u.find((({id:t})=>e===t));p.push({column:o,method:t,value:n})}));break;case o.blockSortKey:t.columns.forEach((({column_id:e,value:t})=>{const n=u.find((({id:t})=>e===t));f.push({column:n,direction:t})}));break;case o.blockColorizeKey:t.columns.forEach((({value:t})=>{const n=t,o=u.find((({id:e})=>n.columnId===e));m.push((0,a.createColorizeItem)(e,o,n))}));break;default:h[t.key]=t.columns.map((({column_id:e})=>u.find((t=>t.id===e))))}}));const g={columns:u,columnsByBlock:h,filters:p,sort:f,colorize:m,total:r,limit:t.limit_rows,offset:t.offset,...{...s,interact:s.interact.bind(t)},...i(e,t.key)};l[t.key]=g})),a.widgetDefaultKey in l?Object.assign(e,{data:c[a.widgetDefaultKey],dataSettings:l[a.widgetDefaultKey]}):Object.assign(e,{data:c,dataSettings:l}),e.viewSettings={},n.forEach((({key:t,value:n})=>e.viewSettings[t]=n))}},382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dispatchChangeOtherFilters=t.createColorizeItem=t.widgetDefaultKey=void 0;const o=n(52);function a(e){return e||"transparent"}t.widgetDefaultKey="ffed0a4d-4a9d-417f-b502-eb50142c6956",t.createColorizeItem=function(e,t,n){const o=+n.max||0,r=+n.min||0,i=+n.threshold||0,s=n.colorAbove,c=n.colorBelow,l=o-i,d=i-r;return{column:t,getColor(t){if((t=+t||0)>o||t<r)return a();if(t>=i){const n=e.theme.colorize[s]||[];return a(t===o?n[n.length-1]:n[Math.floor((t-i)/l*n.length)])}{const n=e.theme.colorize[c]||[];return a(t===r?n[n.length-1]:n[Math.floor((i-t)/d*n.length)])}}}},t.dispatchChangeOtherFilters=function(e,t){t.forEach((({column_id:t,value:n})=>{const a=function(e,t){if(Array.isArray(e.data))return e.dataSettings;for(let n of Object.values(e.dataSettings))if(n.columns.find((({id:e})=>e===t)))return n;return null}(e,t);if(a&&"function"==typeof a.events.onOtherFilterChange){const e=a.columns.find((({id:e})=>e===t));e&&a.events.onOtherFilterChange({column:e,method:o.FilterMethod.InList,value:n})}}))}},439:(e,t,n)=>{"use strict";t.wD=t.y8=t.JG=void 0;n(52),n(771),n(949),n(40);var o,a;(a=t.JG||(t.JG={})).Table="table",a.PivotTable="pivot",a.Aggregate="aggregate",(o=t.y8||(t.y8={})).Group="group",o.Sum="sum",o.Average="avg",o.Min="min",o.Max="max",o.First="first",o.Last="last",function(e){e.AxisX="sys:axis-x",e.AxisY="sys:axis-y",e.Value="sys:value-column"}(t.wD||(t.wD={}));Symbol()},52:(e,t)=>{"use strict";var n,o,a,r;Object.defineProperty(t,"__esModule",{value:!0}),t.Target=t.SortDirection=t.FilterMethod=t.ColumnType=void 0,(r=t.ColumnType||(t.ColumnType={})).String="string",r.Number="number",r.Boolean="boolean",r.Date="date",r.Array="array",r.Object="object",(a=t.FilterMethod||(t.FilterMethod={})).Equal="equally",a.NotEqual="not_equal",a.GreaterThen="gt",a.LessThen="lt",a.GreaterThenOrEqual="gte",a.LessThenOrEqual="lte",a.Period="period",a.DateList="date_list",a.InList="in_list",a.NotInList="nin_list",a.StartsOnIndex="starts_on_i",a.StartsOn="starts_on",a.EndsOnIndex="ends_on_i",a.EndsOn="ends_on",a.ContainsIndex="contains_i",a.Contains="contains",a.NotContainIndex="not_contain_i",a.NotContain="not_contain",(o=t.SortDirection||(t.SortDirection={})).Asc="ASC",o.Desc="DESC",(n=t.Target||(t.Target={})).Self="self",n.Other="other",n.All="all"},724:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Declare=void 0;const o=n(10),a=n(52),r=n(35),i=n(476),s=n(992),c=n(382);function l(e,t){window.addEventListener("message",(({data:n})=>{n.type===e&&t(n.payload)}))}function d(e,t,n){const o={type:t,token:e,payload:n};window.parent.postMessage(o,"*")}function u(e){const t=e+"=",n=window.location.search.split(/[?&]/).find((e=>e.startsWith(t)));return n?n.slice(t.length):""}t.Declare=function(e){return(0,o.not)(e)&&(e={provideCssVariables:!1}),t=>{const n=new t,h=u("token"),p=u("uid");p&&(n.uid=p),Object.assign(n,{viewSettings:{},ready(){d(h,r.Output.Ready)}});const f={setFilter(e,t,n=a.Target.Self){(e={...e}).column={...e.column},delete e.column.format,d(h,r.Output.SetFilter,{filter:e,target:n,rowIndex:t})},removeFilterAt(e){d(h,r.Output.RemoveFilterAt,{index:e})},setSort(e,t=a.Target.Self){e&&((e={...e}).column={...e.column},delete e.column.format),d(h,r.Output.SetSort,{sort:e,target:t})},removeSortAt(e){d(h,r.Output.RemoveSortAt,{index:e})},interact(e){d(h,r.Output.Interact,{dataOptionId:this.id,dataIndex:e})}};let m=!1;return l(r.Input.Change,(e=>{(0,i.provideDataTo)(n,e,f),(0,o.not)(m)&&(m=!0,"function"==typeof n.onInit&&n.onInit()),"function"==typeof n.onChange&&n.onChange()})),l(r.Input.ChangeLang,(e=>{n.lang=e,n.onLangChange&&m&&n.onLangChange()})),l(r.Input.ChangeTheme,(t=>{n.theme=t.theme,e.provideCssVariables&&(0,s.provideCssVariables)(t),n.onThemeChange&&m&&n.onThemeChange()})),l(r.Input.ChangeOtherFilters,(e=>(0,c.dispatchChangeOtherFilters)(n,e))),l(r.Input.ChangeWidgetRenderEnv,(e=>{n.renderEnv=e})),d(h,r.Output.Init),t}}},127:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,a)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(724),t),a(n(529),t)},529:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetRenderEnv=t.Widget=void 0,t.Widget=class{constructor(){this.renderEnv=n.Default}ready(){}onInit(){}onThemeChange(){}onLangChange(){}},function(e){e.Default="default",e.Print="print"}(n=t.WidgetRenderEnv||(t.WidgetRenderEnv={}))},279:e=>{var t;self,t=()=>(()=>{var e={10:e=>{function t(e){return!e}e.exports=Object.defineProperties(t,{default:{value:t},not:{value:t},__esModule:{value:!0}})},107:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.JsxElementType=void 0,(n=t.JsxElementType||(t.JsxElementType={})).Component="component",n.Primitive="primitive"},517:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listeners=t.elementBindings=void 0,t.elementBindings="⇠ element bindings",t.listeners="⇠ listeners"},292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,a)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(671),t)},671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;const o=n(10),a=n(107),r=n(517);var i;function s(e,t){switch(e.type){case a.JsxElementType.Component:return c(e,t);case a.JsxElementType.Primitive:return e.value}}function c(e,t){const{tagName:n}=e;if((0,o.not)(n))return d(e.children,t);switch(n){case"link":if(t.target!==i.Head)return"";l(e.attributes,"href",t.baseUrl);case"script":if(t.target!==i.Head)return"";l(e.attributes,"src",t.baseUrl)}const a=(r=e.attributes,Object.entries(r).map((([e,t])=>"data"===e?function(e){return Object.entries(e).map((([e,t])=>`data-${e}="${t}"`)).join(" ")}(t):("style"===e&&t instanceof Object&&(t=function(e){const t=Object.entries(e).map((([e,t])=>`${function(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}(e)}: ${t};`));return t.join("")}(t)),`${e}="${t}"`))).join(""));var r;return"input"===n?`<${n} ${a} />`:`<${n} ${a}>${d(e.children,t)}</${n}>`}function l(e,t,n){if(!(0,o.not)(t in e))try{const o=new URL(e[t],n);e[t]=o.toString()}catch(n){delete e[t]}}function d(e,t){return e.map((e=>{switch(e.type){case a.JsxElementType.Component:return c(e,t);case a.JsxElementType.Primitive:return e.value}})).join("")}t.Renderer=class{#e;#t;#n;constructor(e,t,n){e.innerHTML='<div style="display: contents;"></div>',this.#e=e.querySelector("div"),this.#t=t,this.#n=n,this.#o(t)}renderHead(e){const t=s(e,{target:i.Head,baseUrl:this.#n});this.#e.insertAdjacentHTML("beforebegin",t)}render(e){this.#e.innerHTML=s(e,{target:i.Body,baseUrl:this.#n}),this.#a()}#o(e){const t=e.constructor?.[r.listeners];if(Array.isArray(t)){const n=this.#e;t.forEach((({eventName:t,selector:a,callbackName:r})=>{const i=e[r];"function"==typeof i&&n.addEventListener(t,(t=>{if((0,o.not)(a)&&i.call(e,t),(0,o.not)(t.target))return;let r=t.target;for(;r&&r!==n;){if(r instanceof HTMLElement&&r.matches(a)){i.call(e,r,t);break}if(!r.parentElement)break;r=r.parentElement}}))}))}}#a(){const e=this.#t,t=e.constructor?.[r.elementBindings];if(Array.isArray(t)){const n=this.#e;t.forEach((({propertyName:t,selector:o,multi:a})=>{e[t]=a?n.querySelectorAll(o):n.querySelector(o)||void 0}))}}},function(e){e[e.Head=0]="Head",e[e.Body=1]="Body"}(i||(i={}))}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";var e;function t(e){for(const t of e){const e=t.target,{attributeName:n}=t;switch(n){case"render-env":e.renderEnv=a(e,"render-env");break;case"widget-base-path":e.widgetBasePath=a(e,"widget-base-path");break;case"locale":e.locale=a(e,"locale")}}}function a(e,t){return e.getAttribute(t)||""}n.r(o),n.d(o,{EventType:()=>e,PolymaticaWidget:()=>b}),function(e){e.Ready="plmt-ready",e.Interact="plmt-interact",e.Effect="plmt-effect"}(e||(e={}));class r{constructor(e){this.component=e}dispatch(e,t){const n=new CustomEvent(e,{detail:t,bubbles:!0});this.component.dispatchEvent(n)}}var i=n(10),s=n(292);class c{constructor(){this.cache=Object.create(null)}load(e,t){const n=`${e}/assets/i18n/${t}.json`;return this.cache[n]?Promise.resolve(this.cache[n]):fetch(n).then((e=>e.json())).then((e=>(this.cache[n]=e,e)))}}class l{constructor(e){this.events=e,this.datasetsByRef=Object.create(null)}apply(e,t){var n;t.dataset?e.dataset=this.createWidgetDataset(t.dataset,{key:"default",index:0}):d(t)?e.datasets=t.datasets.map(((e,t)=>this.createWidgetDataset(e,{key:"default",index:t}))):(n=t).datasets&&(0,i.not)(d(n))&&(e.datasets={},Object.entries(t.datasets).forEach((([t,n])=>{const o=Array.isArray(n)?n.map(((e,n)=>this.createWidgetDataset(e,{key:t,index:n}))):this.createWidgetDataset(n,{key:t,index:0});e.datasets[t]=o}))),t.options&&(e.options=t.options)}getDatasetByRef({key:e,index:t}){return this.datasetsByRef[e]?.[t]}reset(){this.datasetsByRef=Object.create(null)}createWidgetDataset(e,t){const{events:n}=this,{name:o,rows:a}=e,r={},s=e.columns.map((e=>{const o=e.id,a={...u(e,"id"),interact(e){n.onInteract({datasetRef:t,columnId:o,rowIndex:e})}};return r[o]=a,a})),c={};Object.entries(e.columnsByBlock).forEach((([e,t])=>{c[e]=[],t.forEach((t=>{const n=r[t];n&&c[e].push(n)}))}));const l={name:o,columns:s,columnsByBlock:c,rows:a,heatmap:{},events:{onHighlight(){}}};{const{datasetsByRef:e}=this,{key:n,index:o}=t;(0,i.not)(e[n])&&(e[n]=[]),e[n][o]=l}return l}}function d(e){return Array.isArray(e.datasets)}function u(e,t){const n={};return Object.entries(e).forEach((([e,o])=>{e!==t&&(n[e]=o)})),n}var h=function(e,t,n,o){var a,r=arguments.length,i=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i};class p{set renderEnv(e){}set theme(e){this.instance.theme=e,this.instance.onThemeChange()}set locale(e){this.loadTranslations(e)}set state(e){this.clearState(),this.stateManager.apply(this.instance,e),this.instance.onChange()}constructor(e,t){this.shadowRoot=e,this.events=t,this.context={translations:{loading:!1,first:!0}},this.stateManager=new l({onInteract:this.events.onInteract}),this.asyncCallbackMap={state:!1,theme:!1},this.translationsLoader=new c}provideWidgetEntity(e,t){this.context.entity=e,this.context.widgetBasePath=t,this.instantiate()}highlight(e,t){this.stateManager.getDatasetByRef(e)?.events.onHighlight(t)}async instantiate(){const{entity:e,renderEnv:t,theme:n,locale:o,state:a,widgetBasePath:r}=this.context;if((0,i.not)(e))return;if((0,i.not)(t))return;if((0,i.not)(n))return;if((0,i.not)(o))return;const c=new e.Widget;this.disposePrevious(),this.instance=c,c.renderEnv=t,c.theme=n,c.ready=()=>{this.events.onReady()};const l=new s.Renderer(this.shadowRoot,c,r),d=c.renderHead();d&&l.renderHead(d);const u=c.render;c.render=()=>{const e=u.call(c);return l.render(e),e},c.init(),e.config.useTranslations&&this.loadTranslations(o),a&&(this.state=a)}async loadTranslations(e){const{widgetBasePath:t}=this.context;if((0,i.not)(t))return;const{instance:n}=this;this.context.translations.loading=!0;const o=await this.translationsLoader.load(t,e);this.context.locale===e&&this.instance===n&&(this.instance&&(this.instance.translate=(e,t)=>{const n=o[e];return"string"!=typeof n?"":(0,i.not)(t)?n:n.replace(/\{\{(.+?)\}\}/g,((e,n)=>0===t[n]?"0":t[n]||""))}),this.context.translations.loading=!1,(0,i.not)(this.context.translations.first)&&this.instance?.onLangChange(),this.context.translations.first=!1,this.runAsyncCallback())}runAsyncCallback(){if((0,i.not)(this.instance))return;const{state:e,theme:t}=this.asyncCallbackMap;this.clearAsyncCallbackMap(),t&&this.context.theme&&(this.theme=this.context.theme),e&&this.context.state&&(this.state=this.context.state)}disposePrevious(){this.instance&&this.delete("render"),this.context.entity=void 0,this.context.state=void 0,this.context.translations={loading:!1,first:!0},this.clearAsyncCallbackMap()}delete(e){delete this.instance[e]}clearState(){const e=this.instance;delete e.dataset,delete e.datasets,delete e.options}clearAsyncCallbackMap(){this.asyncCallbackMap.state=!1,this.asyncCallbackMap.theme=!1}}function f(){return(e,t)=>{const{set:n}=Object.getOwnPropertyDescriptor(e,t),o=t;return{set(e){if(this.context[o]=e,this.context.translations.loading)switch(o){case"state":return void(this.asyncCallbackMap.state=!0);case"theme":return void(this.asyncCallbackMap.theme=!0)}(0,i.not)(this.instance)?this.instantiate():n.call(this,e)}}}}h([f()],p.prototype,"renderEnv",null),h([f()],p.prototype,"theme",null),h([f()],p.prototype,"locale",null),h([f()],p.prototype,"state",null);var m,g,y,v=function(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)};class b extends HTMLElement{set renderEnv(e){v(this,y,"f").renderEnv=e}set widgetBasePath(e){}set locale(e){v(this,y,"f").locale=e}constructor(){super(),m.set(this,this.attachShadow({mode:"open"})),g.set(this,new r(this)),y.set(this,new p(v(this,m,"f"),{onReady:()=>{v(this,g,"f").dispatch(e.Ready,null)},onInteract:t=>{v(this,g,"f").dispatch(e.Interact,t)}})),new MutationObserver(t).observe(this,{attributes:!0})}provide(e,t){(e||t)&&(v(this,y,"f").state={...e,options:t})}provideTheme(e){v(this,y,"f").theme=e}highlight(e,t){v(this,y,"f").highlight(e,t)}}m=new WeakMap,g=new WeakMap,y=new WeakMap,customElements.define("polymatica-widget",b)})(),o})(),e.exports=t()}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{PolymaticaWidgetLegacy:()=>f});var e=n(10),t=n(127),a=n(439),r=n(52),i=n(771),s=n(382),c=n(35);function l(e){for(const t of e){const e=t.target;switch(t.attributeName){case"render-env":e.renderEnv=e.getAttribute("render-env");break;case"widget-base-path":e.widgetBasePath=e.getAttribute("widget-base-path");break;case"locale":e.locale=e.getAttribute("locale")}}}var d=n(279);const u=(e,t,n)=>{const o=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(o)};class h{get context(){return h.widgetContextMap.get(this.widget)}constructor(e){this.widget=e,this.token=this.createToken(),this.isReady=!1,window.addEventListener("message",(({data:e})=>{e.token===this.token&&this.process(e)}))}send(e,t){this.context.iframe.contentWindow?.postMessage({type:e,payload:t},"*")}process(e){switch(e.type){case c.Output.Init:{if(this.isReady)break;this.isReady=!0;const{context:e}=this;this.send(c.Input.ChangeWidgetRenderEnv,e.widgetRenderEnv||t.WidgetRenderEnv.Default),this.send(c.Input.ChangeTheme,e.theme),this.send(c.Input.ChangeLang,e.locale),this.send(c.Input.Change,e.widgetRepresent);break}case c.Output.Ready:u(this.widget,d.EventType.Ready,{});break;case c.Output.SetFilter:{const{filter:t,target:n,rowIndex:o}=e.payload;if(n===r.Target.Other){this.context.otherFilterColumnId=t.column.id;const e={datasetRef:{key:"default",index:0},columnId:t.column.id,rowIndex:o};u(this.widget,d.EventType.Interact,e)}break}case c.Output.Interact:u(this.widget,d.EventType.Effect,e.payload)}}createToken(){return Math.random().toString(16).slice(2)}}const p=new WeakMap;h.widgetContextMap=p;class f extends HTMLElement{set renderEnv(e){e===t.WidgetRenderEnv.Print&&g(this,{widgetRenderEnv:e})}set widgetBasePath(e){g(this,{widgetBasePath:e})}set locale(e){g(this,{locale:e})}set uid(e){this._uid=e}get uid(){return this._uid}constructor(){super();const e=this.attachShadow({mode:"open"}),t=document.createElement("iframe"),n=document.createElement("style");n.textContent="\n:host {\n display: block;\n}\n\niframe {\n border: none;\n width: 100%;\n height: 100%;\n}\n",e.append(n);const o={iframe:t,inited:!1,shadowRoot:e,connector:new h(this),otherFilterColumnId:0};p.set(this,o),function(e){new MutationObserver(l).observe(e,{attributes:!0})}(this)}initFormatterToWindow(e,t){const n=window.format||{};n[t]=n[t]||{},e.columns.forEach((e=>{n[t][e.path]=e.format})),window.format=n}setDataConfig(e){g(this,{dataConfig:e})}provide(e,t){if(!e)return;let n=!1,o={};"dataset"in e&&(o.default=[e.dataset]),"datasets"in e&&Array.isArray(e.datasets)&&(o.default=e.datasets,n=!0),"datasets"in e&&!Array.isArray(e.datasets)&&(Object.entries(e.datasets).forEach((([e,t])=>{o[e]=Array.isArray(t)?t:[t]})),n=!0);const r={};Object.entries(o).forEach((([e,o])=>{o.forEach(((o,c)=>{this.uid&&this.initFormatterToWindow(o,this.uid);const l=t.sort[c],d=t.filters[c],u=Object.entries(o.columnsByBlock).map((([e,t])=>({key:e,block_type:i.ConfigDataBlockType_Server.Column,function:a.y8.Group,columns:t.map((e=>({column_id:e})))})));if(l?.length){const e={key:i.blockSortKey,block_type:i.ConfigDataBlockType_Server.Sort,function:null,columns:l.map((({column_id:e,direction:t})=>({column_id:e,value:t})))};u.push(e)}if(d){const e={key:i.blockFilterKey,block_type:i.ConfigDataBlockType_Server.Filter,function:null,columns:d.map((({column_id:e,action:t,value:n})=>({column_id:e,action:t,value:n})))};u.push(e)}const h=o.columns.map((e=>({id:e.id,name:e.name,path:e.path,base_type:e.type}))),p=n?`${e}--${c}`:s.widgetDefaultKey;r[p]={data_option:{key:p,id:0,dataset:{id:0,name:"",columns_id:h},method:a.JG.Aggregate,limit_rows:-1,offset:0,blocks:u},rows:o.rows,total:o.rows.length}}))})),g(this,{uid:this.uid,widgetRepresent:{dataOptionsMap:r,viewOptions:Object.entries(t||{}).map((([e,t])=>({key:e,value:t})))}})}provideTheme(e){g(this,{theme:{theme:{background:"rgb(241, 241, 242)",backgroundBright:"rgb(32, 33, 39)",backgroundTint:["rgb(230, 230, 234)","rgb(208, 208, 213)","rgb(163, 163, 172)","rgb(118, 118, 133)","rgb(64, 64, 83)","rgb(32, 33, 39)"],text:"rgb(0, 175, 215)",textTint:["#0d131e","#111827","#1f2937","#374151","#4b5563"],colors:e.seriesColorsPalette,colorize:e.heatmap??[],captionColor:e.captions?.color,captionFontFamily:e.captions?.fontFamily,captionFontSize:e.captions?.fontSize,mainElementsColor:e.elements?.mainElementsColor,extraElementsColor:e.elements?.extraElementsColor},themeKey:"polymatica",themeProjectKey:"polymatica"}})}highlight(e,t){const{connector:n,otherFilterColumnId:o,widgetRepresent:a}=m(this),i=[],l=a?.dataOptionsMap[s.widgetDefaultKey];if(l){const e=l.data_option.dataset.columns_id.find((({id:e})=>e===o));e&&t.forEach((t=>{t in l.rows&&i.push(l.rows[t][e.path])}))}n.send(c.Input.ChangeOtherFilters,[{column_id:o,value:i,action:r.FilterMethod.InList}])}setInteractColumnId(e){m(this).otherFilterColumnId=e}}function m(e){return p.get(e)}function g(t,n){const o=m(t);Object.assign(o,n);const{iframe:a,inited:r,widgetRepresent:i,locale:s,theme:l,widgetBasePath:d}=o;if(!((0,e.not)(i)||(0,e.not)(s)||(0,e.not)(l)||(0,e.not)(d)))if((0,e.not)(r)){o.inited=!0;let t=d;(0,e.not)(t.endsWith("/"))&&(t+="/"),t+=`index.html?token=${o.connector.token}`,o.uid&&(t+=`&uid=${o.uid}`),a.src=t,o.shadowRoot.append(a)}else{const{connector:e}=o;n.theme&&e.send(c.Input.ChangeTheme,l),n.locale&&e.send(c.Input.ChangeLang,s),n.widgetRepresent&&e.send(c.Input.Change,i)}}customElements.define("polymatica-widget-legacy",f)})(),o})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PolymaticaWidgetComponentLegacy=t():e.PolymaticaWidgetComponentLegacy=t()}(self,(()=>(()=>{var e={10:e=>{function t(e){return!e}e.exports=Object.defineProperties(t,{default:{value:t},not:{value:t},__esModule:{value:!0}})},771:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.encodeDrilldownData=t.decodeDrilldownData=t.blockColorizeKey=t.blockSortKey=t.blockFilterKey=t.configDataBlock_Server=t.ConfigDataBlockType_Server=void 0,(n=t.ConfigDataBlockType_Server||(t.ConfigDataBlockType_Server={})).Column="column",n.Filter="filter",n.Sort="sort",n.Colorizer="colorizer",n.Drilldown="drilldown",t.configDataBlock_Server="8316067a-d04b-4b21-bd4d-35529846617b",t.blockFilterKey="34642664-dbd1-4e35-b0ea-2eaabe796b48",t.blockSortKey="2c849ed6-6105-4aa2-a961-9f95135dfe3b",t.blockColorizeKey="badd51f7-82ce-45b2-a67e-37d52df88c5c",t.decodeDrilldownData=function(e,t){const n=[o(e.length),e];return t.forEach((e=>n.push(o(e.length),e))),n.join("");function o(e){if(e>255)throw new RangeError;return e>15?`0x${e.toString(16)}`:`0x0${e.toString(16)}`}},t.encodeDrilldownData=function(e){const t=[];!function n(o=0){const a=o+4,r=a+parseInt(e.slice(o,a));t.push(e.slice(a,r)),r<e.length&&n(r)}();const[n,...o]=t;return{source:n,additionalFilterSources:o}}},949:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DatasetColumnType_Server=t.ColumnFieldType_Server=void 0;var o,a=n(52);Object.defineProperty(t,"ColumnFieldType_Server",{enumerable:!0,get:function(){return a.ColumnType}}),(o=t.DatasetColumnType_Server||(t.DatasetColumnType_Server={})).Dimension="dimension",o.Fact="fact",o.Any="any"},992:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createColorizeColors=t.colorizeClassName=t.provideCssVariables=t.themeProjectKeys=t.themeKeys=void 0;const o=n(10);t.themeKeys=["background","backgroundBright","backgroundTint","text","textTint"],t.themeProjectKeys=["colors"];const a=document.querySelector("head"),r=document.querySelector("body"),i={};let s="",c="";function l(e,t){return`plmt-colorize-${e}-${t}`}t.provideCssVariables=function({theme:e,themeKey:n,themeProjectKey:a}){const r=`plmt-theme-${m(n)}`;if((0,o.not)(r in i)){const n=[];Object.entries(e).forEach((([e,o])=>{if(t.themeKeys.includes(e)){const t=m(e);Array.isArray(o)?o.forEach(((e,o)=>n.push({name:`--${t}-${o}`,value:e}))):n.push({name:`--${t}`,value:o})}})),p(r,[{className:r,cssProperties:n}])}s=f(s,r);const d=`plmt-project-${a}`;if((0,o.not)(d in i)&&p(d,[{className:d,cssProperties:e.colors.map(((e,t)=>({name:`--plmt-color-${t}`,value:e})))}]),c=f(c,d),(0,o.not)("colorize"in i)){const t=[];e.colorize.forEach(((e,n)=>{e.forEach(((e,o)=>t.push({className:l(n,o),cssProperties:[{name:"background-color",value:e}]})))})),p("colorize",t)}},t.colorizeClassName=l;const d=[...Array(10)].map(((e,t)=>t));t.createColorizeColors=function(e){return e.map((e=>{const[t,n,o]=function(e){const[,t,n,o]=e.match(u)||e.match(h)||[,"0","0","0"];return[parseInt(t,16),parseInt(n,16),parseInt(o,16)]}(e);return d.map((e=>`rgba(${t},${n},${o},${++e>9?"1":`0.${e}`})`))}))};const u=/([0-9abcdef]{2})([0-9abcdef]{2})([0-9abcdef]{2})/i,h=/([0-9abcdef])([0-9abcdef])([0-9abcdef])/i;function p(e,t){const n=document.createElement("style");i[e]=n;const o=[];t.forEach((({className:e,cssProperties:t})=>{o.push(".",e,"{\n"),t.forEach((({name:e,value:t})=>o.push(" ",e,": ",t,";\n"))),o.push("}\n")})),n.innerHTML=o.join(""),a.append(n)}function f(e,t){return e&&r.classList.remove(e),r.classList.add(t),t}function m(e){const t=Array(e.length);for(let n=0,o=e.length;n<o;n++){const o=e.charAt(n),a=o.toLowerCase();t[n]=o===a?o:"-"+a}return t.join("")}},40:(e,t)=>{"use strict";var n;function o(e,t){switch(e){case n.Input:case n.Radio:case n.Select:case n.ColorPicker:case n.TextArea:return t?String(t):"";case n.Checkbox:return Boolean(t);default:return""}}Object.defineProperty(t,"__esModule",{value:!0}),t.valueConversion=t.viewSettingsExtract=t.viewSettingsItemValue=t.ViewSettingsItemType=void 0,function(e){e.Input="text",e.Checkbox="checkbox",e.Radio="radio",e.Select="select",e.ColorPicker="color-picker",e.Title="title",e.TextArea="textArea"}(n=t.ViewSettingsItemType||(t.ViewSettingsItemType={})),t.viewSettingsItemValue="418d9556-a046-4623-be0b-4f4f69ccb783",t.viewSettingsExtract=function(e){return e.map((e=>e[t.viewSettingsItemValue])).map((e=>{return{type:e.type,key:e.key,label:e.label,placeholder:e.placeholder,defaultValue:o(e.type,e.defaultValue),options:e.options||[],span:(t=e.span,(t|=0)>24?24:t<0?0:t)};var t}))},t.valueConversion=o},35:(e,t)=>{"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.Input=void 0,(o=t.Input||(t.Input={})).Change="ptnl.input.change",o.ChangeLang="ptnl.input.changeLang",o.ChangeTheme="ptnl.input.changeTheme",o.ChangeOtherFilters="ptnl.input.ChangeOtherFilters",o.ChangeWidgetRenderEnv="ptnl.input.changeWidgetRenderEnv",(n=t.Output||(t.Output={})).Init="ptnl.output.init",n.Ready="ptnl.output.ready",n.SetFilter="ptnl.output.setFilter",n.RemoveFilterAt="ptnl.output.RemoveFilterAt",n.SetSort="ptnl.output.setSort",n.RemoveSortAt="ptnl.output.RemoveSortAt",n.Interact="ptnl.output.interact"},476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.provideDataTo=void 0;const o=n(771),a=n(382),r={setFilter(){},removeFilterAt(){},setSort(){},removeSortAt(){},interact(){}};function i(e,t){const n=t===a.widgetDefaultKey?e.dataSettings:e.dataSettings?.hasOwnProperty(t)?e.dataSettings[t]:e.dataSettings;return n?{events:n.events}:{events:{}}}t.provideDataTo=function(e,{dataOptionsMap:t,viewOptions:n},s=r){const c={},l={},d=window.parent.format?.[e.uid]||{};e.viewSettings={},Object.values(t).forEach((({data_option:t,rows:n,total:r})=>{c[t.key]=n;const u=t.dataset.columns_id.map((e=>({type:e.base_type,id:e.id,path:e.path,format:d[e.path]||(e=>e),name:e.name}))),h={},p=[],f=[],m=[];t.blocks.forEach((t=>{if(t.block_type!==o.ConfigDataBlockType_Server.Drilldown)switch(t.key){case o.blockFilterKey:t.columns.forEach((({column_id:e,action:t,value:n})=>{const o=u.find((({id:t})=>e===t));p.push({column:o,method:t,value:n})}));break;case o.blockSortKey:t.columns.forEach((({column_id:e,value:t})=>{const n=u.find((({id:t})=>e===t));f.push({column:n,direction:t})}));break;case o.blockColorizeKey:t.columns.forEach((({value:t})=>{const n=t,o=u.find((({id:e})=>n.columnId===e));m.push((0,a.createColorizeItem)(e,o,n))}));break;default:h[t.key]=t.columns.map((({column_id:e})=>u.find((t=>t.id===e))))}}));const g={columns:u,columnsByBlock:h,filters:p,sort:f,colorize:m,total:r,limit:t.limit_rows,offset:t.offset,...{...s,interact:s.interact.bind(t)},...i(e,t.key)};l[t.key]=g})),a.widgetDefaultKey in l?Object.assign(e,{data:c[a.widgetDefaultKey],dataSettings:l[a.widgetDefaultKey]}):Object.assign(e,{data:c,dataSettings:l}),e.viewSettings={},n.forEach((({key:t,value:n})=>e.viewSettings[t]=n))}},382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dispatchChangeOtherFilters=t.createColorizeItem=t.widgetDefaultKey=void 0;const o=n(52);function a(e){return e||"transparent"}t.widgetDefaultKey="ffed0a4d-4a9d-417f-b502-eb50142c6956",t.createColorizeItem=function(e,t,n){const o=+n.max||0,r=+n.min||0,i=+n.threshold||0,s=n.colorAbove,c=n.colorBelow,l=o-i,d=i-r;return{column:t,getColor(t){if((t=+t||0)>o||t<r)return a();if(t>=i){const n=e.theme.colorize[s]||[];return a(t===o?n[n.length-1]:n[Math.floor((t-i)/l*n.length)])}{const n=e.theme.colorize[c]||[];return a(t===r?n[n.length-1]:n[Math.floor((i-t)/d*n.length)])}}}},t.dispatchChangeOtherFilters=function(e,t){t.forEach((({column_id:t,value:n})=>{const a=function(e,t){if(Array.isArray(e.data))return e.dataSettings;for(let n of Object.values(e.dataSettings))if(n.columns.find((({id:e})=>e===t)))return n;return null}(e,t);if(a&&"function"==typeof a.events.onOtherFilterChange){const e=a.columns.find((({id:e})=>e===t));e&&a.events.onOtherFilterChange({column:e,method:o.FilterMethod.InList,value:n})}}))}},439:(e,t,n)=>{"use strict";t.wD=t.y8=t.JG=void 0;n(52),n(771),n(949),n(40);var o,a;(a=t.JG||(t.JG={})).Table="table",a.PivotTable="pivot",a.Aggregate="aggregate",(o=t.y8||(t.y8={})).Group="group",o.Sum="sum",o.Average="avg",o.Min="min",o.Max="max",o.First="first",o.Last="last",function(e){e.AxisX="sys:axis-x",e.AxisY="sys:axis-y",e.Value="sys:value-column"}(t.wD||(t.wD={}));Symbol()},52:(e,t)=>{"use strict";var n,o,a,r;Object.defineProperty(t,"__esModule",{value:!0}),t.Target=t.SortDirection=t.FilterMethod=t.ColumnType=void 0,(r=t.ColumnType||(t.ColumnType={})).String="string",r.Number="number",r.Boolean="boolean",r.Date="date",r.Array="array",r.Object="object",(a=t.FilterMethod||(t.FilterMethod={})).Equal="equally",a.NotEqual="not_equal",a.GreaterThen="gt",a.LessThen="lt",a.GreaterThenOrEqual="gte",a.LessThenOrEqual="lte",a.Period="period",a.DateList="date_list",a.InList="in_list",a.NotInList="nin_list",a.StartsOnIndex="starts_on_i",a.StartsOn="starts_on",a.EndsOnIndex="ends_on_i",a.EndsOn="ends_on",a.ContainsIndex="contains_i",a.Contains="contains",a.NotContainIndex="not_contain_i",a.NotContain="not_contain",(o=t.SortDirection||(t.SortDirection={})).Asc="ASC",o.Desc="DESC",(n=t.Target||(t.Target={})).Self="self",n.Other="other",n.All="all"},724:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Declare=void 0;const o=n(10),a=n(52),r=n(35),i=n(476),s=n(992),c=n(382);function l(e,t){window.addEventListener("message",(({data:n})=>{n.type===e&&t(n.payload)}))}function d(e,t,n){const o={type:t,token:e,payload:n};window.parent.postMessage(o,"*")}function u(e){const t=e+"=",n=window.location.search.split(/[?&]/).find((e=>e.startsWith(t)));return n?n.slice(t.length):""}t.Declare=function(e){return(0,o.not)(e)&&(e={provideCssVariables:!1}),t=>{const n=new t,h=u("token"),p=u("uid");p&&(n.uid=p),Object.assign(n,{viewSettings:{},ready(){d(h,r.Output.Ready)}});const f={setFilter(e,t,n=a.Target.Self){(e={...e}).column={...e.column},delete e.column.format,d(h,r.Output.SetFilter,{filter:e,target:n,rowIndex:t})},removeFilterAt(e){d(h,r.Output.RemoveFilterAt,{index:e})},setSort(e,t=a.Target.Self){e&&((e={...e}).column={...e.column},delete e.column.format),d(h,r.Output.SetSort,{sort:e,target:t})},removeSortAt(e){d(h,r.Output.RemoveSortAt,{index:e})},interact(e){d(h,r.Output.Interact,{dataOptionId:this.id,dataIndex:e})}};let m=!1;return l(r.Input.Change,(e=>{(0,i.provideDataTo)(n,e,f),(0,o.not)(m)&&(m=!0,"function"==typeof n.onInit&&n.onInit()),"function"==typeof n.onChange&&n.onChange()})),l(r.Input.ChangeLang,(e=>{n.lang=e,n.onLangChange&&m&&n.onLangChange()})),l(r.Input.ChangeTheme,(t=>{n.theme=t.theme,e.provideCssVariables&&(0,s.provideCssVariables)(t),n.onThemeChange&&m&&n.onThemeChange()})),l(r.Input.ChangeOtherFilters,(e=>(0,c.dispatchChangeOtherFilters)(n,e))),l(r.Input.ChangeWidgetRenderEnv,(e=>{n.renderEnv=e})),d(h,r.Output.Init),t}}},127:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,a)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(724),t),a(n(529),t)},529:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetRenderEnv=t.Widget=void 0,t.Widget=class{constructor(){this.renderEnv=n.Default}ready(){}onInit(){}onThemeChange(){}onLangChange(){}},function(e){e.Default="default",e.Print="print"}(n=t.WidgetRenderEnv||(t.WidgetRenderEnv={}))},279:e=>{var t;self,t=()=>(()=>{var e={10:e=>{function t(e){return!e}e.exports=Object.defineProperties(t,{default:{value:t},not:{value:t},__esModule:{value:!0}})},107:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.JsxElementType=void 0,(n=t.JsxElementType||(t.JsxElementType={})).Component="component",n.Primitive="primitive"},517:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listeners=t.elementBindings=void 0,t.elementBindings="⇠ element bindings",t.listeners="⇠ listeners"},292:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,a)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(671),t)},671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;const o=n(10),a=n(107),r=n(517);var i;function s(e,t){switch(e.type){case a.JsxElementType.Component:return c(e,t);case a.JsxElementType.Primitive:return e.value}}function c(e,t){const{tagName:n}=e;if((0,o.not)(n))return d(e.children,t);switch(n){case"link":if(t.target!==i.Head)return"";l(e.attributes,"href",t.baseUrl);case"script":if(t.target!==i.Head)return"";l(e.attributes,"src",t.baseUrl)}const a=(r=e.attributes,Object.entries(r).map((([e,t])=>"data"===e?function(e){return Object.entries(e).map((([e,t])=>`data-${e}="${t}"`)).join(" ")}(t):("style"===e&&t instanceof Object&&(t=function(e){const t=Object.entries(e).map((([e,t])=>`${function(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}(e)}: ${t};`));return t.join("")}(t)),`${e}="${t}"`))).join(""));var r;return"input"===n?`<${n} ${a} />`:`<${n} ${a}>${d(e.children,t)}</${n}>`}function l(e,t,n){if(!(0,o.not)(t in e))try{const o=new URL(e[t],n);e[t]=o.toString()}catch(n){delete e[t]}}function d(e,t){return e.map((e=>{switch(e.type){case a.JsxElementType.Component:return c(e,t);case a.JsxElementType.Primitive:return e.value}})).join("")}t.Renderer=class{#e;#t;#n;constructor(e,t,n){e.innerHTML='<div style="display: contents;"></div>',this.#e=e.querySelector("div"),this.#t=t,this.#n=n,this.#o(t)}renderHead(e){const t=s(e,{target:i.Head,baseUrl:this.#n});this.#e.insertAdjacentHTML("beforebegin",t)}render(e){this.#e.innerHTML=s(e,{target:i.Body,baseUrl:this.#n}),this.#a()}#o(e){const t=e.constructor?.[r.listeners];if(Array.isArray(t)){const n=this.#e;t.forEach((({eventName:t,selector:a,callbackName:r})=>{const i=e[r];"function"==typeof i&&n.addEventListener(t,(t=>{if((0,o.not)(a)&&i.call(e,t),(0,o.not)(t.target))return;let r=t.target;for(;r&&r!==n;){if(r instanceof HTMLElement&&r.matches(a)){i.call(e,r,t);break}if(!r.parentElement)break;r=r.parentElement}}))}))}}#a(){const e=this.#t,t=e.constructor?.[r.elementBindings];if(Array.isArray(t)){const n=this.#e;t.forEach((({propertyName:t,selector:o,multi:a})=>{e[t]=a?n.querySelectorAll(o):n.querySelector(o)||void 0}))}}},function(e){e[e.Head=0]="Head",e[e.Body=1]="Body"}(i||(i={}))}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";var e;function t(e){for(const t of e){const e=t.target,{attributeName:n}=t;switch(n){case"render-env":e.renderEnv=a(e,"render-env");break;case"widget-base-path":e.widgetBasePath=a(e,"widget-base-path");break;case"locale":e.locale=a(e,"locale")}}}function a(e,t){return e.getAttribute(t)||""}n.r(o),n.d(o,{EventType:()=>e,PolymaticaWidget:()=>b}),function(e){e.Ready="plmt-ready",e.Interact="plmt-interact",e.Effect="plmt-effect"}(e||(e={}));class r{constructor(e){this.component=e}dispatch(e,t){const n=new CustomEvent(e,{detail:t,bubbles:!0});this.component.dispatchEvent(n)}}var i=n(10),s=n(292);class c{constructor(){this.cache=Object.create(null)}load(e,t){const n=`${e}/assets/i18n/${t}.json`;return this.cache[n]?Promise.resolve(this.cache[n]):fetch(n).then((e=>e.json())).then((e=>(this.cache[n]=e,e)))}}class l{constructor(e){this.events=e,this.datasetsByRef=Object.create(null)}apply(e,t){var n;t.dataset?e.dataset=this.createWidgetDataset(t.dataset,{key:"default",index:0}):d(t)?e.datasets=t.datasets.map(((e,t)=>this.createWidgetDataset(e,{key:"default",index:t}))):(n=t).datasets&&(0,i.not)(d(n))&&(e.datasets={},Object.entries(t.datasets).forEach((([t,n])=>{const o=Array.isArray(n)?n.map(((e,n)=>this.createWidgetDataset(e,{key:t,index:n}))):this.createWidgetDataset(n,{key:t,index:0});e.datasets[t]=o}))),t.options&&(e.options=t.options)}getDatasetByRef({key:e,index:t}){return this.datasetsByRef[e]?.[t]}reset(){this.datasetsByRef=Object.create(null)}createWidgetDataset(e,t){const{events:n}=this,{name:o,rows:a}=e,r={},s=e.columns.map((e=>{const o=e.id,a={...u(e,"id"),interact(e){n.onInteract({datasetRef:t,columnId:o,rowIndex:e})}};return r[o]=a,a})),c={};Object.entries(e.columnsByBlock).forEach((([e,t])=>{c[e]=[],t.forEach((t=>{const n=r[t];n&&c[e].push(n)}))}));const l={name:o,columns:s,columnsByBlock:c,rows:a,heatmap:{},events:{onHighlight(){}}};{const{datasetsByRef:e}=this,{key:n,index:o}=t;(0,i.not)(e[n])&&(e[n]=[]),e[n][o]=l}return l}}function d(e){return Array.isArray(e.datasets)}function u(e,t){const n={};return Object.entries(e).forEach((([e,o])=>{e!==t&&(n[e]=o)})),n}var h=function(e,t,n,o){var a,r=arguments.length,i=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i};class p{set renderEnv(e){}set theme(e){this.instance.theme=e,this.instance.onThemeChange()}set locale(e){this.loadTranslations(e)}set state(e){this.clearState(),this.stateManager.apply(this.instance,e),this.instance.onChange()}constructor(e,t){this.shadowRoot=e,this.events=t,this.context={translations:{loading:!1,first:!0}},this.stateManager=new l({onInteract:this.events.onInteract}),this.asyncCallbackMap={state:!1,theme:!1},this.translationsLoader=new c}provideWidgetEntity(e,t){this.context.entity=e,this.context.widgetBasePath=t,this.instantiate()}highlight(e,t){this.stateManager.getDatasetByRef(e)?.events.onHighlight(t)}async instantiate(){const{entity:e,renderEnv:t,theme:n,locale:o,state:a,widgetBasePath:r}=this.context;if((0,i.not)(e))return;if((0,i.not)(t))return;if((0,i.not)(n))return;if((0,i.not)(o))return;const c=new e.Widget;this.disposePrevious(),this.instance=c,c.renderEnv=t,c.theme=n,c.ready=()=>{this.events.onReady()};const l=new s.Renderer(this.shadowRoot,c,r),d=c.renderHead();d&&l.renderHead(d);const u=c.render;c.render=()=>{const e=u.call(c);return l.render(e),e},c.init(),e.config.useTranslations&&this.loadTranslations(o),a&&(this.state=a)}async loadTranslations(e){const{widgetBasePath:t}=this.context;if((0,i.not)(t))return;const{instance:n}=this;this.context.translations.loading=!0;const o=await this.translationsLoader.load(t,e);this.context.locale===e&&this.instance===n&&(this.instance&&(this.instance.translate=(e,t)=>{const n=o[e];return"string"!=typeof n?"":(0,i.not)(t)?n:n.replace(/\{\{(.+?)\}\}/g,((e,n)=>0===t[n]?"0":t[n]||""))}),this.context.translations.loading=!1,(0,i.not)(this.context.translations.first)&&this.instance?.onLangChange(),this.context.translations.first=!1,this.runAsyncCallback())}runAsyncCallback(){if((0,i.not)(this.instance))return;const{state:e,theme:t}=this.asyncCallbackMap;this.clearAsyncCallbackMap(),t&&this.context.theme&&(this.theme=this.context.theme),e&&this.context.state&&(this.state=this.context.state)}disposePrevious(){this.instance&&this.delete("render"),this.context.entity=void 0,this.context.state=void 0,this.context.translations={loading:!1,first:!0},this.clearAsyncCallbackMap()}delete(e){delete this.instance[e]}clearState(){const e=this.instance;delete e.dataset,delete e.datasets,delete e.options}clearAsyncCallbackMap(){this.asyncCallbackMap.state=!1,this.asyncCallbackMap.theme=!1}}function f(){return(e,t)=>{const{set:n}=Object.getOwnPropertyDescriptor(e,t),o=t;return{set(e){if(this.context[o]=e,this.context.translations.loading)switch(o){case"state":return void(this.asyncCallbackMap.state=!0);case"theme":return void(this.asyncCallbackMap.theme=!0)}(0,i.not)(this.instance)?this.instantiate():n.call(this,e)}}}}h([f()],p.prototype,"renderEnv",null),h([f()],p.prototype,"theme",null),h([f()],p.prototype,"locale",null),h([f()],p.prototype,"state",null);var m,g,y,v=function(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)};class b extends HTMLElement{set renderEnv(e){v(this,y,"f").renderEnv=e}set widgetBasePath(e){}set locale(e){v(this,y,"f").locale=e}constructor(){super(),m.set(this,this.attachShadow({mode:"open"})),g.set(this,new r(this)),y.set(this,new p(v(this,m,"f"),{onReady:()=>{v(this,g,"f").dispatch(e.Ready,null)},onInteract:t=>{v(this,g,"f").dispatch(e.Interact,t)}})),new MutationObserver(t).observe(this,{attributes:!0})}provide(e,t){(e||t)&&(v(this,y,"f").state={...e,options:t})}provideTheme(e){v(this,y,"f").theme=e}highlight(e,t){v(this,y,"f").highlight(e,t)}}m=new WeakMap,g=new WeakMap,y=new WeakMap,customElements.define("polymatica-widget",b)})(),o})(),e.exports=t()}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{PolymaticaWidgetLegacy:()=>f});var e=n(10),t=n(127),a=n(439),r=n(52),i=n(771),s=n(382),c=n(35);function l(e){for(const t of e){const e=t.target;switch(t.attributeName){case"render-env":e.renderEnv=e.getAttribute("render-env");break;case"widget-base-path":e.widgetBasePath=e.getAttribute("widget-base-path");break;case"locale":e.locale=e.getAttribute("locale")}}}var d=n(279);const u=(e,t,n)=>{const o=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(o)};class h{get context(){return h.widgetContextMap.get(this.widget)}constructor(e){this.widget=e,this.token=this.createToken(),this.isReady=!1,window.addEventListener("message",(({data:e})=>{e.token===this.token&&this.process(e)}))}send(e,t){this.context.iframe.contentWindow?.postMessage({type:e,payload:t},"*")}process(e){switch(e.type){case c.Output.Init:{if(this.isReady)break;this.isReady=!0;const{context:e}=this;this.send(c.Input.ChangeWidgetRenderEnv,e.widgetRenderEnv||t.WidgetRenderEnv.Default),this.send(c.Input.ChangeTheme,e.theme),this.send(c.Input.ChangeLang,e.locale),this.send(c.Input.Change,e.widgetRepresent);break}case c.Output.Ready:u(this.widget,d.EventType.Ready,{});break;case c.Output.SetFilter:{const{filter:t,target:n,rowIndex:o}=e.payload;if(n===r.Target.Other){this.context.otherFilterColumnId=t.column.id;const e={datasetRef:{key:"default",index:0},columnId:t.column.id,rowIndex:o};u(this.widget,d.EventType.Interact,e)}break}case c.Output.Interact:u(this.widget,d.EventType.Effect,e.payload)}}createToken(){return Math.random().toString(16).slice(2)}}const p=new WeakMap;h.widgetContextMap=p;class f extends HTMLElement{set renderEnv(e){e===t.WidgetRenderEnv.Print&&g(this,{widgetRenderEnv:e})}set widgetBasePath(e){g(this,{widgetBasePath:e})}set locale(e){g(this,{locale:e})}set uid(e){this._uid=e}get uid(){return this._uid}constructor(){super();const e=this.attachShadow({mode:"open"}),t=document.createElement("iframe"),n=document.createElement("style");n.textContent="\n:host {\n display: block;\n}\n\niframe {\n border: none;\n width: 100%;\n height: 100%;\n}\n",e.append(n);const o={iframe:t,inited:!1,shadowRoot:e,connector:new h(this),otherFilterColumnId:0};p.set(this,o),function(e){new MutationObserver(l).observe(e,{attributes:!0})}(this)}initFormatterToWindow(e,t){const n=window.format||{};n[t]=n[t]||{},e.columns.forEach((e=>{n[t][e.path]=e.format})),window.format=n}setDataConfig(e){g(this,{dataConfig:e})}provide(e,t){if(!e)return;let n=!1,o={};"dataset"in e&&(o.default=[e.dataset]),"datasets"in e&&Array.isArray(e.datasets)&&(o.default=e.datasets,n=!0),"datasets"in e&&!Array.isArray(e.datasets)&&(Object.entries(e.datasets).forEach((([e,t])=>{o[e]=Array.isArray(t)?t:[t]})),n=!0);const r={};Object.entries(o).forEach((([e,o])=>{o.forEach(((o,c)=>{this.uid&&this.initFormatterToWindow(o,this.uid);const l=t.sort[c],d=t.filters[c],u=Object.entries(o.columnsByBlock).map((([e,t])=>({key:e,block_type:i.ConfigDataBlockType_Server.Column,function:a.y8.Group,columns:t.map((e=>({column_id:e})))})));if(l?.length){const e={key:i.blockSortKey,block_type:i.ConfigDataBlockType_Server.Sort,function:null,columns:l.map((({column_id:e,direction:t})=>({column_id:e,value:t})))};u.push(e)}if(d){const e={key:i.blockFilterKey,block_type:i.ConfigDataBlockType_Server.Filter,function:null,columns:[function(){let e;return d&&null===d[2]?e={column_id:o.columns.find((e=>e.path===d[0]))?.id||0}:d&&d.map((t=>{e={column_id:t.column_id,action:t.action,value:t.value}})),e}()]};u.push(e)}const h=o.columns.map((e=>({id:e.id,name:e.name,path:e.path,base_type:e.type}))),p=n?`${e}--${c}`:s.widgetDefaultKey;r[p]={data_option:{key:p,id:0,dataset:{id:0,name:"",columns_id:h},method:a.JG.Aggregate,limit_rows:-1,offset:0,blocks:u},rows:o.rows,total:o.rows.length}}))})),g(this,{uid:this.uid,widgetRepresent:{dataOptionsMap:r,viewOptions:Object.entries(t||{}).map((([e,t])=>({key:e,value:t})))}})}provideTheme(e){g(this,{theme:{theme:{background:"rgb(241, 241, 242)",backgroundBright:"rgb(32, 33, 39)",backgroundTint:["rgb(230, 230, 234)","rgb(208, 208, 213)","rgb(163, 163, 172)","rgb(118, 118, 133)","rgb(64, 64, 83)","rgb(32, 33, 39)"],text:"rgb(0, 175, 215)",textTint:["#0d131e","#111827","#1f2937","#374151","#4b5563"],colors:e.seriesColorsPalette,colorize:e.heatmap??[],captionColor:e.captions?.color,captionFontFamily:e.captions?.fontFamily,captionFontSize:e.captions?.fontSize,mainElementsColor:e.elements?.mainElementsColor,extraElementsColor:e.elements?.extraElementsColor},themeKey:"polymatica",themeProjectKey:"polymatica"}})}highlight(e,t){const{connector:n,otherFilterColumnId:o,widgetRepresent:a}=m(this),i=[],l=a?.dataOptionsMap[s.widgetDefaultKey];if(l){const e=l.data_option.dataset.columns_id.find((({id:e})=>e===o));e&&t.forEach((t=>{t in l.rows&&i.push(l.rows[t][e.path])}))}n.send(c.Input.ChangeOtherFilters,[{column_id:o,value:i,action:r.FilterMethod.InList}])}setInteractColumnId(e){m(this).otherFilterColumnId=e}}function m(e){return p.get(e)}function g(t,n){const o=m(t);Object.assign(o,n);const{iframe:a,inited:r,widgetRepresent:i,locale:s,theme:l,widgetBasePath:d}=o;if(!((0,e.not)(i)||(0,e.not)(s)||(0,e.not)(l)||(0,e.not)(d)))if((0,e.not)(r)){o.inited=!0;let t=d;(0,e.not)(t.endsWith("/"))&&(t+="/"),t+=`index.html?token=${o.connector.token}`,o.uid&&(t+=`&uid=${o.uid}`),a.src=t,o.shadowRoot.append(a)}else{const{connector:e}=o;n.theme&&e.send(c.Input.ChangeTheme,l),n.locale&&e.send(c.Input.ChangeLang,s),n.widgetRepresent&&e.send(c.Input.Change,i)}}customElements.define("polymatica-widget-legacy",f)})(),o})()));