@genesislcap/design-system-configurator 13.7.0 → 13.8.0

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 (53) hide show
  1. package/dist/1.0.0.remoteEntry.js +1 -1
  2. package/dist/189.189.a9c8d30ece74b531825c.js +46 -0
  3. package/dist/189.5962ce1f44db4f8c4a459719f748276ad6786c6603fd8957c5646cf7f8295e77.js.map +1 -0
  4. package/dist/{415.415.479036c8c77772e8d4e9.js → 415.415.78a8bd8264823c40afb9.js} +2 -2
  5. package/dist/{914.914.3e5ebad50d02f5f7dccd.js → 623.623.e5cb705430337f4d7c18.js} +3 -3
  6. package/dist/{914.270c4937e40a679470a98cdf663208f7d854ed0eac3571188a682d583b03a705.js.map → 623.a705d0a55a2298ab6aef08a9ccf0317b955ddfef40104015c24149193ede963c.js.map} +1 -1
  7. package/dist/695.3fe5051e7afea06fe92113b21c5f673302d283c7446ab03fd35a3ab7c9b27dba.js.map +1 -0
  8. package/dist/{623.623.52e4002134bb21bb9319.js → 695.695.12d9b4ff31329ac430bf.js} +318 -273
  9. package/dist/755.755.5b2449ca5f385b7977ee.js +2 -0
  10. package/dist/{755.6e63a9bcaf60158ad78e00b5427da57b42b3b42656c361f4bb2d09304a95caac.js.map → 755.95370e73f97c50dfc77607496743c84b9714899e9698cc0f852a723fa87f4e2c.js.map} +1 -1
  11. package/dist/842.766f4641f73b351cef03c397b46d306db279e3f7a37db551da5a31cfef773934.js.map +1 -0
  12. package/dist/{842.842.39e0b0623807c8803766.js → 842.842.bd3221bd5ac1934a9e0d.js} +2 -2
  13. package/dist/88.291806167084e5537bc097f32a0ccf673314abfad80df71c48f88eaf3a040510.js.map +1 -0
  14. package/dist/{88.88.bee92aaa47eac4443964.js → 88.88.b860466a23070e24c8ca.js} +3 -3
  15. package/dist/905.905.60f90fac12b049034fe3.js +3 -0
  16. package/dist/{905.fc87bab08887b2994b23d5d3ef52325ec1224f43091d6895fc0d3303567020c5.js.map → 905.abe3f8f58593e33cfecc1ba9d091da35b0c44e059169b87ad147517f9aed6078.js.map} +1 -1
  17. package/dist/dashboard.json +1 -1
  18. package/dist/{designSystemConfigurator.6639c4954bca22a1c3d0058724b38ad2f4504d41c2abaa10491e6ce3bfe28ece.js.map → designSystemConfigurator.494e2cad3d462ff788ddd00a1ec6133e26c781f33f7833c9ef1f1cfbe3c00c77.js.map} +1 -1
  19. package/dist/dts/components/components.d.ts.map +1 -1
  20. package/dist/dts/components/design-system-preview-container/design-system-preview-container.d.ts +4 -0
  21. package/dist/dts/components/design-system-preview-container/design-system-preview-container.d.ts.map +1 -0
  22. package/dist/dts/components/design-system-preview-container/design-system-preview-container.styles.d.ts +2 -0
  23. package/dist/dts/components/design-system-preview-container/design-system-preview-container.styles.d.ts.map +1 -0
  24. package/dist/dts/components/design-system-preview-container/design-system-preview-container.template.d.ts +3 -0
  25. package/dist/dts/components/design-system-preview-container/design-system-preview-container.template.d.ts.map +1 -0
  26. package/dist/dts/components/design-system-preview-container/index.d.ts +2 -0
  27. package/dist/dts/components/design-system-preview-container/index.d.ts.map +1 -0
  28. package/dist/dts/main/main.styles.d.ts.map +1 -1
  29. package/dist/esm/components/components.js +4 -1
  30. package/dist/esm/components/design-system-preview-container/design-system-preview-container.js +14 -0
  31. package/dist/esm/components/design-system-preview-container/design-system-preview-container.styles.js +17 -0
  32. package/dist/esm/components/design-system-preview-container/design-system-preview-container.template.js +20 -0
  33. package/dist/esm/components/design-system-preview-container/index.js +1 -0
  34. package/dist/esm/main/main.styles.js +2 -0
  35. package/dist/esm/main/main.template.js +1 -1
  36. package/dist/index.html +1 -1
  37. package/dist/info.html +4 -4
  38. package/dist/{main.1bb6903dee693ff39d1b3910605cbdf8c9d520e6c56606ad8ea979dda87424ad.js.map → main.d6cdadbe27f0d69700af110687e4250b7ca640a2b5ecb3e121efa714a2ab7009.js.map} +1 -1
  39. package/dist/main.d80eb775dbc82ca73d2e.js +2 -0
  40. package/dist/remoteEntry.js +2 -2
  41. package/dist/tsconfig.build.tsbuildinfo +1 -1
  42. package/package.json +6 -6
  43. package/dist/623.033e45f0bd22dc2f1542776ae3fdc6cf0792b081a1907ffad0bdbfed99e14610.js.map +0 -1
  44. package/dist/755.755.41ad64d44195eb509895.js +0 -2
  45. package/dist/842.49fa7ef3df11fa5ab84653ca0458f8e054e4af6dd2b00bbcc666e5093b2b5645.js.map +0 -1
  46. package/dist/88.b5974dbad94772003ff7d61cb8a196d3b57e36912f44cf6bb59db146f53a4ace.js.map +0 -1
  47. package/dist/905.905.1e62c5880d223891122e.js +0 -3
  48. package/dist/93.9015bb82a6bbcfe139cc208006c342aaf344a85cdb543a02ea5e7f4fd6fff4eb.js.map +0 -1
  49. package/dist/93.93.dde75e9288bd35656d8f.js +0 -11
  50. package/dist/main.cf9df79cee29242ce20d.js +0 -2
  51. /package/dist/{415.415.479036c8c77772e8d4e9.js.LICENSE.txt → 415.415.78a8bd8264823c40afb9.js.LICENSE.txt} +0 -0
  52. /package/dist/{914.914.3e5ebad50d02f5f7dccd.js.LICENSE.txt → 623.623.e5cb705430337f4d7c18.js.LICENSE.txt} +0 -0
  53. /package/dist/{905.905.1e62c5880d223891122e.js.LICENSE.txt → 905.905.60f90fac12b049034fe3.js.LICENSE.txt} +0 -0
@@ -489,7 +489,7 @@
489
489
  `)}
490
490
  </div>
491
491
  </div>
492
- `,Ye=void 0,We={};class qe extends s.FoundationElement{formatChanged(e,t){t&&this.calendar&&(this.formatDate=Pe()(this.currentDate.Date).format(t))}valueChanged(e,t){t&&this.calendar&&(this.currentDate=new Ge(new Date(t)),this.calendar.goToDate(this.currentDate.monthNumber,this.currentDate.year),this.formatDate=Pe()(this.currentDate.Date).format(this.format),this.updateHeaderText(),this.monthList=this.getMonthDaysGrid())}constructor(){var e;super(),this.format="MM-DD-YYYY",this.visible=!1,this.position="bottom";const t="en-US",o=new Date(null!==(e=this.currentDate)&&void 0!==e?e:this.getAttribute("value")||Date.now());this.substringNumber=3,this.currentDate=new Ge(o,t),this.value=Pe()(this.currentDate.Date).format("MM-DD-YYYY"),this.calendar=new ze(this.currentDate.year,this.currentDate.monthNumber,t)}connectedCallback(){super.connectedCallback(),this.currentMonth=this.calendar.month.name,this.currentYear=this.calendar.year,this.formatDate=Pe()(this.currentDate.Date).format(this.format),this.toggleButton.addEventListener("click",(()=>this.toggleCalendar())),this.prevBtn.addEventListener("click",(()=>this.prevMonth())),this.nextBtn.addEventListener("click",(()=>this.nextMonth())),this.monthList=this.getMonthDaysGrid()}updateHeaderText(){this.currentMonth=this.calendar.month.name,this.currentYear=this.calendar.year}toggleCalendar(){this.visible=!this.visible,this.toggleVisibility(),this.isCurrentCalendarMonth()||(this.calendar.goToDate(this.currentDate.monthNumber,this.currentDate.year),this.updateHeaderText())}toggleVisibility(){this.calendarDropdownClasses=(0,l.A)(["visible",this.visible],this.position)}isSelectedDate(e){return Pe()(e.Date).isSame(this.currentDate.Date,"day")}isCurrentCalendarMonth(){return this.currentMonth===this.currentDate.monthNumber&&this.currentYear===this.currentDate.year}prevMonth(){this.calendar.goToPreviousMonth(),this.updateHeaderText(),this.monthList=this.getMonthDaysGrid()}nextMonth(){this.calendar.goToNextMonth(),this.updateHeaderText(),this.monthList=this.getMonthDaysGrid()}selectDay(e){Pe()(e.Date).isSame(this.currentDate.Date)||(this.currentDate=e,e.monthNumber!==this.calendar.month.number&&this.prevMonth(),this.formatDate=Pe()(this.currentDate.Date).format(this.format),this.value=Pe()(e.Date).format("MM-DD-YYYY"),this.toggleCalendar())}getMonthDaysGrid(){const e=this.calendar.month.getDay(1),t=this.calendar.getPreviousMonth(),o=e.dayNumber-1,a=this.calendar.month.numberOfDays+o,i=Array.from({length:a});for(let e=o;e<a;e+=1)i[e]=this.calendar.month.getDay(e+1-o);for(let e=0;e<o;e+=1){const a=o-(e+1);i[e]=t.getDay(t.numberOfDays-a)}return i}}(0,n.__decorate)([r.attr],qe.prototype,"format",void 0),(0,n.__decorate)([r.attr],qe.prototype,"visible",void 0),(0,n.__decorate)([r.attr],qe.prototype,"position",void 0),(0,n.__decorate)([r.attr],qe.prototype,"value",void 0),(0,n.__decorate)([r.observable],qe.prototype,"currentDate",void 0),(0,n.__decorate)([r.observable],qe.prototype,"currentMonth",void 0),(0,n.__decorate)([r.observable],qe.prototype,"currentYear",void 0),(0,n.__decorate)([r.observable],qe.prototype,"calendarDropdownClasses",void 0),(0,n.__decorate)([r.observable],qe.prototype,"formatDate",void 0),(0,n.__decorate)([r.observable],qe.prototype,"monthList",void 0);const Xe=qe.compose(Object.assign({baseName:"date-picker",styles:Ve,template:Ue,shadowOptions:Ye},We));var Ke=o(2694);const Ze=m.SwatchRGB.create(1,1,1),Je=m.SwatchRGB.create(0,0,0),Qe=(0,Ke.parseColorHexRGB)("#585858"),et=m.SwatchRGB.create(Qe.r,Qe.g,Qe.b),tt=(0,Ke.parseColorHexRGB)("#ffffff"),ot=m.SwatchRGB.create(tt.r,tt.g,tt.b),at=m.PaletteRGB.from(ot),it=(0,Ke.parseColorHexRGB)("#eeeeee"),nt=m.SwatchRGB.create(it.r,it.g,it.b),rt=m.PaletteRGB.from(nt),st=(0,Ke.parseColorHexRGB)("#08c3a5"),lt=m.SwatchRGB.create(st.r,st.g,st.b),dt=m.PaletteRGB.from(lt),{create:ct}=s.DesignToken,ut=ct("fui-fill-color").withDefault(et),pt=ct({name:"card-fill-color",cssCustomPropertyName:"fui-card-fill-color"}).withDefault(ot),ht=14;function mt(e,t){return e.colorContrast(t,ht)}const ft=ct({name:"card-foreground-color",cssCustomPropertyName:"fui-card-foreground-color"}).withDefault((e=>mt(ct("fui-card-palette").withDefault(at).getValueFor(e),pt.getValueFor(e)))),gt=(e,t,o)=>{const a=o?(e,t)=>e.setValueFor(o,t):(e,t)=>e.withDefault(t);Object.keys(e).forEach((o=>{const i=`${o}Value`;t[i]&&a(e[o],t[i])}))};function vt(e){return(t,o)=>{t[o+"Changed"]=function(t,o){null!=o?e.setValueFor(this,o):e.deleteValueFor(this)}}}const bt={toView:e=>null==e?null:null==e?void 0:e.toColorString(),fromView(e){if(null==e)return null;const t=(0,Ke.parseColorHexRGB)(e);return t?m.SwatchRGB.create(t.r,t.g,t.b):null}},yt=e=>m.PaletteRGB.from(m.SwatchRGB.from((0,Ke.parseColorHexRGB)(e))),wt=["baseClass","baseName","shadowOptions","styles","template"],xt=(e,t=wt)=>Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,o)=>(t[o]=e[o],t)),{}),Ft=e=>{const{definition:t}=e(),{shadowOptions:o,styles:a,template:i}=t;return{shadowOptions:o,styles:a,template:i,defaultConfig:xt(t)}},$t=(e,t)=>{const o=t.design_tokens;m.accentPalette.setValueFor(e,yt(o.color.accent.$value)),m.neutralPalette.setValueFor(e,yt(o.color.neutral.$value)),m.bodyFont.setValueFor(e,o.fontFamily.bodyFont.$value),m.baseLayerLuminance.setValueFor(e,o.mode.luminance.$value),m.density.setValueFor(e,o.style.density.$value),m.controlCornerRadius.setValueFor(e,o.style.borderRadius.$value),m.strokeWidth.setValueFor(e,o.style.strokeWidth.$value),m.designUnit.setValueFor(e,o.space.designUnit.$value)},St=yt("#08c3a5"),Dt=yt("#eeeeee"),Ct=m.StandardLuminance.DarkMode;const _t=o(3773).N.ltr,kt=4,Ot=4;var Lt=o(8775);const Tt=(e="normal",t="normal")=>`\n font-family: ${m.bodyFont};\n font-style: ${e};\n font-weight: ${t};\n`,Rt=r.css`
492
+ `,Ye=void 0,We={};class qe extends s.FoundationElement{formatChanged(e,t){t&&this.calendar&&(this.formatDate=Pe()(this.currentDate.Date).format(t))}valueChanged(e,t){t&&this.calendar&&(this.currentDate=new Ge(new Date(t)),this.calendar.goToDate(this.currentDate.monthNumber,this.currentDate.year),this.formatDate=Pe()(this.currentDate.Date).format(this.format),this.updateHeaderText(),this.monthList=this.getMonthDaysGrid())}constructor(){var e;super(),this.format="MM-DD-YYYY",this.visible=!1,this.position="bottom";const t="en-US",o=new Date(null!==(e=this.currentDate)&&void 0!==e?e:this.getAttribute("value")||Date.now());this.substringNumber=3,this.currentDate=new Ge(o,t),this.value=Pe()(this.currentDate.Date).format("MM-DD-YYYY"),this.calendar=new ze(this.currentDate.year,this.currentDate.monthNumber,t)}connectedCallback(){super.connectedCallback(),this.currentMonth=this.calendar.month.name,this.currentYear=this.calendar.year,this.formatDate=Pe()(this.currentDate.Date).format(this.format),this.toggleButton.addEventListener("click",(()=>this.toggleCalendar())),this.prevBtn.addEventListener("click",(()=>this.prevMonth())),this.nextBtn.addEventListener("click",(()=>this.nextMonth())),this.monthList=this.getMonthDaysGrid()}updateHeaderText(){this.currentMonth=this.calendar.month.name,this.currentYear=this.calendar.year}toggleCalendar(){this.visible=!this.visible,this.toggleVisibility(),this.isCurrentCalendarMonth()||(this.calendar.goToDate(this.currentDate.monthNumber,this.currentDate.year),this.updateHeaderText())}toggleVisibility(){this.calendarDropdownClasses=(0,l.A)(["visible",this.visible],this.position)}isSelectedDate(e){return Pe()(e.Date).isSame(this.currentDate.Date,"day")}isCurrentCalendarMonth(){return this.currentMonth===this.currentDate.monthNumber&&this.currentYear===this.currentDate.year}prevMonth(){this.calendar.goToPreviousMonth(),this.updateHeaderText(),this.monthList=this.getMonthDaysGrid()}nextMonth(){this.calendar.goToNextMonth(),this.updateHeaderText(),this.monthList=this.getMonthDaysGrid()}selectDay(e){Pe()(e.Date).isSame(this.currentDate.Date)||(this.currentDate=e,e.monthNumber!==this.calendar.month.number&&this.prevMonth(),this.formatDate=Pe()(this.currentDate.Date).format(this.format),this.value=Pe()(e.Date).format("MM-DD-YYYY"),this.toggleCalendar())}getMonthDaysGrid(){const e=this.calendar.month.getDay(1),t=this.calendar.getPreviousMonth(),o=e.dayNumber-1,a=this.calendar.month.numberOfDays+o,i=Array.from({length:a});for(let e=o;e<a;e+=1)i[e]=this.calendar.month.getDay(e+1-o);for(let e=0;e<o;e+=1){const a=o-(e+1);i[e]=t.getDay(t.numberOfDays-a)}return i}}(0,n.__decorate)([r.attr],qe.prototype,"format",void 0),(0,n.__decorate)([r.attr],qe.prototype,"visible",void 0),(0,n.__decorate)([r.attr],qe.prototype,"position",void 0),(0,n.__decorate)([r.attr],qe.prototype,"value",void 0),(0,n.__decorate)([r.observable],qe.prototype,"currentDate",void 0),(0,n.__decorate)([r.observable],qe.prototype,"currentMonth",void 0),(0,n.__decorate)([r.observable],qe.prototype,"currentYear",void 0),(0,n.__decorate)([r.observable],qe.prototype,"calendarDropdownClasses",void 0),(0,n.__decorate)([r.observable],qe.prototype,"formatDate",void 0),(0,n.__decorate)([r.observable],qe.prototype,"monthList",void 0);const Xe=qe.compose(Object.assign({baseName:"date-picker",styles:Ve,template:Ue,shadowOptions:Ye},We));var Ke=o(2694);const Ze=m.SwatchRGB.create(1,1,1),Je=m.SwatchRGB.create(0,0,0),Qe=(0,Ke.parseColorHexRGB)("#585858"),et=m.SwatchRGB.create(Qe.r,Qe.g,Qe.b),tt=(0,Ke.parseColorHexRGB)("#ffffff"),ot=m.SwatchRGB.create(tt.r,tt.g,tt.b),at=m.PaletteRGB.from(ot),it=(0,Ke.parseColorHexRGB)("#eeeeee"),nt=m.SwatchRGB.create(it.r,it.g,it.b),rt=m.PaletteRGB.from(nt),st=(0,Ke.parseColorHexRGB)("#08c3a5"),lt=m.SwatchRGB.create(st.r,st.g,st.b),dt=m.PaletteRGB.from(lt),{create:ct}=s.DesignToken,ut=ct("fui-fill-color").withDefault(et),pt=ct({name:"card-fill-color",cssCustomPropertyName:"fui-card-fill-color"}).withDefault(ot),ht=14;function mt(e,t){return e.colorContrast(t,ht)}const ft=ct({name:"card-foreground-color",cssCustomPropertyName:"fui-card-foreground-color"}).withDefault((e=>mt(ct("fui-card-palette").withDefault(at).getValueFor(e),pt.getValueFor(e)))),gt=(e,t,o)=>{const a=o?(e,t)=>e.setValueFor(o,t):(e,t)=>e.withDefault(t);Object.keys(e).forEach((o=>{const i=`${o}Value`;t[i]&&a(e[o],t[i])}))};function vt(e){return(t,o)=>{t[o+"Changed"]=function(t,o){null!=o?e.setValueFor(this,o):e.deleteValueFor(this)}}}const bt={toView:e=>null==e?null:null==e?void 0:e.toColorString(),fromView(e){if(null==e)return null;const t=(0,Ke.parseColorHexRGB)(e);return t?m.SwatchRGB.create(t.r,t.g,t.b):null}},yt=e=>m.PaletteRGB.from(m.SwatchRGB.from((0,Ke.parseColorHexRGB)(e))),wt=["baseClass","baseName","shadowOptions","styles","template"],xt=(e,t=wt)=>Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,o)=>(t[o]=e[o],t)),{}),Ft=e=>{const{definition:t}=e(),{shadowOptions:o,styles:a,template:i}=t;return{shadowOptions:o,styles:a,template:i,defaultConfig:xt(t)}},$t=(e,t)=>{const o=t.design_tokens;m.accentPalette.setValueFor(e,yt(o.color.accent.$value)),m.neutralPalette.setValueFor(e,yt(o.color.neutral.$value)),m.bodyFont.setValueFor(e,o.fontFamily.bodyFont.$value),m.baseLayerLuminance.setValueFor(e,o.mode.luminance.$value),m.density.setValueFor(e,o.style.density.$value),m.controlCornerRadius.setValueFor(e,o.style.borderRadius.$value),m.strokeWidth.setValueFor(e,o.style.strokeWidth.$value),m.designUnit.setValueFor(e,o.space.designUnit.$value),m.typeRampBaseFontSize.setValueFor(e,o.typography.baseFontSize.$value),m.typeRampBaseLineHeight.setValueFor(e,o.typography.baseLineHeight.$value)},St=yt("#08c3a5"),Dt=yt("#eeeeee"),Ct=m.StandardLuminance.DarkMode;const _t=o(3773).N.ltr,kt=4,Ot=4;var Lt=o(8775);const Tt=(e="normal",t="normal")=>`\n font-family: ${m.bodyFont};\n font-style: ${e};\n font-weight: ${t};\n`,Rt=r.css`
493
493
  ${(0,s.display)("flex")}
494
494
  :host {
495
495
  flex: 1;
@@ -694,7 +694,7 @@
694
694
  </div>
695
695
  `,co=r.html`
696
696
  ${e=>lo(e.tagName.toLowerCase().split("-")[0])}
697
- `;class uo extends s.FoundationElement{constructor(){super(...arguments),this.autoClose=!0,this.disabled=!1,this.name="Dropdown Menu",this.open=!1,this.clickOutside=e=>this.handleClickOutside(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("onMenuClick",this.onDropdownMenuItemClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this.clickOutside)}handleClickOutside(e){io(e,this)&&(this.open=!1)}openChanged(){this.classNames=(0,l.A)(["hidden",!this.open]),this.open?document.addEventListener("mousedown",this.clickOutside):document.removeEventListener("mousedown",this.clickOutside)}toggleDropdownMenuVisibility(){this.open=!this.open}onDropdownMenuItemClick(){this.autoClose&&(this.open=!1)}get allItems(){return this.items}}(0,n.__decorate)([r.observable],uo.prototype,"items",void 0),(0,n.__decorate)([(0,r.attr)({attribute:"auto-close",mode:"boolean"})],uo.prototype,"autoClose",void 0),(0,n.__decorate)([(0,r.attr)({attribute:"disable-button",mode:"boolean"})],uo.prototype,"disabled",void 0),(0,n.__decorate)([r.observable],uo.prototype,"classNames",void 0),(0,n.__decorate)([r.attr],uo.prototype,"name",void 0),(0,n.__decorate)([(0,r.attr)({attribute:"open",mode:"boolean"})],uo.prototype,"open",void 0),(0,n.__decorate)([r.attr],uo.prototype,"buttonAppearance",void 0);const po=uo.compose({baseName:"dropdown-menu",styles:ro,template:co});var ho=o(9802);const mo=(0,ho.createLogger)("foundation-ui"),fo=r.html`
697
+ `;class uo extends s.FoundationElement{constructor(){super(...arguments),this.autoClose=!0,this.disabled=!1,this.name="Dropdown Menu",this.open=!1,this.clickOutside=e=>this.handleClickOutside(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("onMenuClick",this.onDropdownMenuItemClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this.clickOutside)}handleClickOutside(e){io(e,this)&&(this.open=!1)}openChanged(){this.classNames=(0,l.A)(["hidden",!this.open]),this.open?document.addEventListener("mousedown",this.clickOutside):document.removeEventListener("mousedown",this.clickOutside)}toggleDropdownMenuVisibility(){this.open=!this.open}onDropdownMenuItemClick(){this.autoClose&&(this.open=!1)}get allItems(){return this.items}}(0,n.__decorate)([r.observable],uo.prototype,"items",void 0),(0,n.__decorate)([(0,r.attr)({attribute:"auto-close",mode:"boolean"})],uo.prototype,"autoClose",void 0),(0,n.__decorate)([(0,r.attr)({attribute:"disable-button",mode:"boolean"})],uo.prototype,"disabled",void 0),(0,n.__decorate)([r.observable],uo.prototype,"classNames",void 0),(0,n.__decorate)([r.attr],uo.prototype,"name",void 0),(0,n.__decorate)([(0,r.attr)({attribute:"open",mode:"boolean"})],uo.prototype,"open",void 0),(0,n.__decorate)([r.attr],uo.prototype,"buttonAppearance",void 0);const po=uo.compose({baseName:"dropdown-menu",styles:ro,template:co});var ho=o(342);const mo=(0,ho.createLogger)("foundation-ui"),fo=r.html`
698
698
  <foundation-banner ${(0,r.ref)("banner")}>
699
699
  <div slot="content">
700
700
  <div>${e=>{var t;return(null===(t=e.error)||void 0===t?void 0:t.errorDetails)||"Place holder for error message"}}</div>
@@ -2165,4 +2165,4 @@
2165
2165
  `)}
2166
2166
  </div>
2167
2167
  `,Ts=void 0,Rs={};class As extends m.TextField{constructor(){super(...arguments),this.value=""}saveUrl(e){this.value=e.startsWith("http")?e:"https://"+e,this.focused=!1}focus(){this.focused=!0}}(0,n.__decorate)([r.observable],As.prototype,"value",void 0),(0,n.__decorate)([r.observable],As.prototype,"focused",void 0);const Ns=As.compose(Object.assign({baseName:"url-input",template:Ls,styles:Os,shadowOptions:Ts},Rs)),Ms={foundationActionsMenu:h,foundationAnchor:w,foundationBadge:C,foundationBanner:T,foundationBreadcrumbItem:z,foundationBreadcrumb:I,foundationButton:X,foundationCard:te,foundationCheckbox:se,foundationCombobox:he,foundationConnectionIndicator:we,foundationDataGrid:Ce,foundationDataGridCell:Te,foundationDataGridRow:Ee,foundationDatePicker:Xe,foundationDesignSystemProvider:Et,foundationDialog:Ut,foundationDisclosure:Zt,foundationDivider:ao,foundationDropdownMenu:po,foundationErrorBoundary:ko,foundationErrorBanner:bo,foundationErrorDialog:No,foundationFileUpload:ta,foundationFilter:ma,foundationFilterBar:Sa,foundationFlexLayout:Ra,foundationFlipper:Pa,foundationFlyout:Ua,foundationGridLayout:ei,foundationGridLayoutItem:ni,foundationIcon:vi,foundationListboxOption:$i,foundationMenu:Oi,foundationMenuItem:Mi,foundationModal:Gi,foundationMultiselect:Ki,foundationNumberField:on,foundationProgress:fn,foundationPopper:dn,foundationProgressRing:xn,foundationRadio:_n,foundationRadioGroup:An,foundationSegmentedControl:Hn,foundationSegmentedItem:Un,foundationSelect:Zn,foundationSkeleton:ar,foundationSlider:ur,foundationSnackbar:gr,foundationSwitch:Fr,foundationTab:kr,foundationTabPanel:Nr,foundationTabs:Br,foundationTextArea:Yr,foundationTextField:Jr,foundationToast:is,foundationToolbar:cs,foundationTooltip:gs,foundationTreeItem:Fs,foundationTreeView:ks,foundationUrlInput:Ns,register(e,...t){if(e)for(const o in this)"register"!==o&&this[o]().register(e,...t)}};function Es(e){return new Proxy(e,{get:(e,t,...o)=>{if(["withPrefix","withShadowRootMode","withElementDisambiguation"].includes(t))throw new Error("Modification of the Design System is not allowed.");return Reflect.get(e,t,...o)}})}const Is=(e,t="foundation")=>{e&&gt(a,i,e);return Es(s.DesignSystem.getOrCreate(e).withPrefix(t))};class Ps extends r.CSSDirective{constructor(e){super(),this.tokenMap=e}createTokenPartial(e,t){return r.cssPartial`${e}: ${t}`}createTokensCSS(){const e=[];for(const[t,o]of Object.entries(this.tokenMap))e.push(this.createTokenPartial(t,o).createCSS());return e}createCSS(){return this.createTokensCSS().join(";")}}var Hs=o(2940),Bs=o(9162),Gs=o(5127),js=o(2449),zs=o(1871),Vs=o(6714);class Us extends s.FoundationElement{constructor(){super(...arguments),this.withGridInit=!0,this.isSnapshot=!1,this.maxRows=Hs.WJ.MAX_ROWS_250,this.maxView=Hs.WJ.MAX_VIEW_1000,this.reverse=!1,this.rowId="ROW_REF",this.withTimestampFormatting=!0,this.requiresFullDataRefresh=!0,this.rowsSyncedWithStream=new Map,this.dataSubWasLoggedOff=!1,this.criteriaFromFilters=new Map,this.update=new Vs.X(new Map)}disconnectedCallback(){super.disconnectedCallback(),this.clearData()}reset(){this.requiresFullDataRefresh=!0,this.fetchGenesisData()}fetchGenesisData(e=!0){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(this.data)return void this.syncComponentData(this.data);const t=e||!this.datasource.initialized;t||(this.connect.dataLogoff(this.sourceRef),this.clearData());if(yield this.datasource.init(this.datasourceOptions(),t))if(this.isSnapshot){const e=yield this.datasource.snapshotFiltered();this.syncComponentData(e)}else mo.debug(`requesting stream for ${this.resourceName}`),this.dataSub=this.datasource.stream.subscribe((e=>{this.sourceRef=e.SOURCE_REF;const t=e.MESSAGE_TYPE;if(t&&t===Bs.Cs.LOGOFF_ACK)this.dataSubWasLoggedOff=!0;else if(this.dataSubWasLoggedOff=!1,e.ROW){const t=(0,Gs.$)(e);this.handleStreamUpdate(t)}else this.handleStreamUpdate(e)}));else mo.debug(`Genesis Datasource init failed for ${this.resourceName}`)}))}initDatasource(){return(0,n.__awaiter)(this,void 0,void 0,(function*(){yield this.datasource.init(this.datasourceOptions(),!0)}))}datasourceOptions(){return{criteria:this.buildCriteria(),fields:this.fields,isSnapshot:this.isSnapshot,orderBy:this.orderBy,resourceName:this.resourceName,request:this.request,reverse:this.reverse,maxRows:this.maxRows,maxView:this.maxView}}handleStreamUpdate(e){if(!e)return;e.hasOwnProperty("REPLY")?this.applyRequestServerData(e):this.applyDataserverData(e)}applyRequestServerData(e){var t,o;if(!Array.isArray(e.REPLY)||!(null===(t=e.MESSAGE_TYPE)||void 0===t?void 0:t.startsWith("REP_")))return void mo.error("received invalid RequestServerResult",e);if(this.requiresFullDataRefresh){"ROW_REF"!==this.rowId&&(null===(o=e.REPLY)||void 0===o||o.forEach((e=>{this.rowsSyncedWithStream.set(e[this.rowId],e)})));const t=this.rowsSyncedWithStream.size>0?Array.from(this.rowsSyncedWithStream.values()):e.REPLY;return void this.syncComponentData(t)}this.handleStreamInserts(e.REPLY);const a=Array.from(this.rowsSyncedWithStream.values()).filter((t=>!e.REPLY.includes(t)));this.handleStreamDeletes(a)}applyDataserverData(e){var t,o,a,i;if(this.requiresFullDataRefresh){null===(t=e.inserts)||void 0===t||t.forEach((e=>{this.rowsSyncedWithStream.set(e[this.rowId],e)}));const o=Array.from(this.rowsSyncedWithStream.values());this.syncComponentData(o)}else(null===(o=e.inserts)||void 0===o?void 0:o.length)>0&&this.handleStreamInserts(e.inserts),(null===(a=e.deletes)||void 0===a?void 0:a.length)>0&&this.handleStreamDeletes(e.deletes),(null===(i=e.updates)||void 0===i?void 0:i.length)>0&&this.handleStreamUpdates(e.updates)}buildCriteria(){var e;const t=(null===(e=this.criteria)||void 0===e?void 0:e.split(";"))||[];return(0,js.p)(t.join(" && "),";")}criteriaChanged(e,t){const o=!e&&t,a=e!==(0,js.p)(t,";");(o||a)&&r.DOM.queueUpdate((()=>this.fetchGenesisData(null)))}setFilter(e,t){this.criteriaFromFilters.set(e,t),this.update.next(this.criteriaFromFilters)}removeFilter(e){this.criteriaFromFilters.delete(e),this.update.next(this.criteriaFromFilters)}}(0,n.__decorate)([me.lj],Us.prototype,"connect",void 0),(0,n.__decorate)([zs.Yh],Us.prototype,"datasource",void 0),(0,n.__decorate)([(0,r.attr)({mode:"boolean"})],Us.prototype,"withGridInit",void 0),(0,n.__decorate)([r.attr],Us.prototype,"criteria",void 0),(0,n.__decorate)([r.observable],Us.prototype,"data",void 0),(0,n.__decorate)([r.attr],Us.prototype,"fields",void 0),(0,n.__decorate)([(0,r.attr)({mode:"boolean"})],Us.prototype,"isSnapshot",void 0),(0,n.__decorate)([r.attr],Us.prototype,"maxRows",void 0),(0,n.__decorate)([r.attr],Us.prototype,"maxView",void 0),(0,n.__decorate)([r.attr],Us.prototype,"orderBy",void 0),(0,n.__decorate)([r.observable],Us.prototype,"request",void 0),(0,n.__decorate)([r.attr],Us.prototype,"resourceName",void 0),(0,n.__decorate)([(0,r.attr)({mode:"boolean"})],Us.prototype,"reverse",void 0),(0,n.__decorate)([r.attr],Us.prototype,"rowId",void 0),(0,n.__decorate)([(0,r.attr)({mode:"boolean",attribute:"with-timestamp-formatting"})],Us.prototype,"withTimestampFormatting",void 0);let Ys=class extends Us{constructor(){super(...arguments),this.isSnapshot=!0}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return(0,n.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.dataGrid=this.parentElement,this.dataGrid&&this.resourceName&&this.connect.isConnected&&this.fetchGenesisData()}))}getColumnDefs(e){return null==e?void 0:e.flatMap((e=>this.fields&&!this.fields.includes(e.name)?[]:{columnDataKey:e.name}))}clearData(){mo.debug("clearData - Method not implemented.")}syncComponentData(e){const t=null!=e?e:Array.from(this.rowsSyncedWithStream.values()),o=this.getColumnDefs(this.datasource.fieldMetadata);this.dataGrid.columnDefinitions=o,this.dataGrid.rowsData=t}handleStreamInserts(e){mo.debug("handleStreamInserts - Method not implemented.")}handleStreamDeletes(e){mo.debug("handleStreamDeletes - Method not implemented.")}handleStreamUpdates(e){mo.debug("handleStreamUpdates - Method not implemented.")}};var Ws;Ys=(0,n.__decorate)([(0,r.customElement)({name:"data-grid-datasource"})],Ys);let qs=Ws=class extends Us{constructor(){super(...arguments),this.optionElement="fast-option",this.isSnapshot=!0}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t;return(0,n.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.fields=this.labelField?null===(t=this.valueField)||void 0===t?void 0:t.concat(" ",this.labelField):this.valueField,this.select=this.parentElement,this.select.addEventListener("change",(e=>{const t=this.options.find((t=>t.label===e.target.value));this.select.$emit("value-change",t)})),this.select&&this.valueField&&(this.resourceName||this.data)&&this.connect.isConnected&&this.fetchGenesisData(),this.valueField||mo.warn('Specify field for values in options (e.g value-field="VALUE") and optionally field for label (e.g label-field="NAME")')}))}clearData(){Array.from(this.select.children).forEach((e=>{e instanceof Ws||this.select.removeChild(e)})),this.select.value="",this.select.initialValue=""}syncComponentData(e){var t;const o=null!=e?e:Array.from(this.rowsSyncedWithStream.values());this.options=o.map((e=>({value:e[this.valueField],label:e[this.labelField]})));this.options.map((({value:e,label:t})=>{const o=document.createElement(this.optionElement);return o.textContent=t||e,o.value=e,o})).forEach((e=>{this.select.appendChild(e)}));const a=null===(t=this.options.find((e=>e.value===this.initialSelectedValue)))||void 0===t?void 0:t.label;r.DOM.queueUpdate((()=>{this.select.value=a}))}handleStreamInserts(e){mo.debug("handleStreamInserts - Method not implemented.")}handleStreamDeletes(e){mo.debug("handleStreamDeletes - Method not implemented.")}handleStreamUpdates(e){mo.debug("handleStreamUpdates - Method not implemented.")}};(0,n.__decorate)([(0,r.attr)({attribute:"label-field"})],qs.prototype,"labelField",void 0),(0,n.__decorate)([(0,r.attr)({attribute:"value-field"})],qs.prototype,"valueField",void 0),(0,n.__decorate)([r.observable],qs.prototype,"initialSelectedValue",void 0),qs=Ws=(0,n.__decorate)([(0,r.customElement)({name:"options-datasource"})],qs);let Xs=class extends Us{constructor(){super(...arguments),this.isSnapshot=!0}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return(0,n.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.fields=this.valueField,this.select=this.parentElement,this.select&&this.valueField&&(this.resourceName||this.data)&&this.connect.isConnected&&this.fetchGenesisData(),this.valueField||mo.warn('Specify field for values in options (e.g value-field="VALUE") and optionally field for label which is supported only in select and combobox (e.g label-field="NAME")')}))}clearData(){this.select.options=[]}syncComponentData(e){const t=(null!=e?e:Array.from(this.rowsSyncedWithStream.values())).map((e=>({value:e[this.valueField]})));this.select.options=t.map((({value:e})=>e))}handleStreamInserts(e){mo.debug("handleStreamInserts - Method not implemented.")}handleStreamDeletes(e){mo.debug("handleStreamDeletes - Method not implemented.")}handleStreamUpdates(e){mo.debug("handleStreamUpdates - Method not implemented.")}};(0,n.__decorate)([(0,r.attr)({attribute:"value-field"})],Xs.prototype,"valueField",void 0),Xs=(0,n.__decorate)([(0,r.customElement)({name:"multiselect-datasource"})],Xs);const Ks=(e,t)=>o=>{const a="function"==typeof t?t:(i=t,e=>Object.assign(Object.assign({},i),e));var i;return r.FASTElement.define(class extends e{},a(o))};function Zs(e){if("string"==typeof e)return e;if("function"==typeof e&&!(e=r.FASTElementDefinition.forType(e)))throw new Error("Missing FASTElement definition.");return e.name}var Js=o(792);let Qs=class extends(Js.F0.from(r.FASTElement)){connectedCallback(){super.connectedCallback(),r.DOM.queueUpdate((()=>(0,n.__awaiter)(this,void 0,void 0,(function*(){this.$router.config=this.config}))))}};Qs=(0,n.__decorate)([(0,r.customElement)({name:"foundation-router"})],Qs);const el=()=>Is().register(Ms)}}]);
2168
- //# sourceMappingURL=88.b5974dbad94772003ff7d61cb8a196d3b57e36912f44cf6bb59db146f53a4ace.js.map
2168
+ //# sourceMappingURL=88.291806167084e5537bc097f32a0ccf673314abfad80df71c48f88eaf3a040510.js.map
@@ -0,0 +1,3 @@
1
+ /*! For license information please see 905.905.60f90fac12b049034fe3.js.LICENSE.txt */
2
+ (self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[905],{4077:(e,t,s)=>{"use strict";var r;s.d(t,{G:()=>r,l:()=>i}),function(e){e.BASIC="BASIC",e.SSO="SSO",e.JWT="JWT",e.REFRESH="REFRESH"}(r||(r={}));class i extends Error{constructor(e,t,s="Auth Failed \n"){super(s),this.sent=e,this.received=t,Object.setPrototypeOf(this,i.prototype)}isIgnorableError(){var e,t,s,r;return null===(r=null===(s=null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)||void 0===s?void 0:s.toLowerCase())||void 0===r?void 0:r.includes("request needs the user to be logged")}getMessageError(){var e,t;return Array.isArray(null===(e=this.received)||void 0===e?void 0:e.ERROR)?null===(t=this.received)||void 0===t?void 0:t.ERROR.map((e=>this.errorDetailFormatter(e))).join("\n"):""}getDetailsError(){var e,t,s,r;return Array.isArray(null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)?null===(r=null===(s=this.received)||void 0===s?void 0:s.DETAILS)||void 0===r?void 0:r.ERROR.map((e=>this.errorDetailFormatter(e))).join("\n"):""}hasPasswordExpiredError(){return this.hasErrorCode("PASSWORD_EXPIRED")}hasErrorCode(e){var t,s;return!!Array.isArray(null===(t=this.received)||void 0===t?void 0:t.ERROR)&&(null===(s=this.received)||void 0===s?void 0:s.ERROR.some((t=>t.CODE===e)))}errorDetailFormatter(e){return`\n ${e.CODE}: \n ${e.TEXT}`}}},1440:(e,t,s)=>{"use strict";s.d(t,{lj:()=>q});var r=s(186),i=s(342),n=s(3147),o=s(5951),a=s(6714);class c{constructor(){this.cachedMetadata=new Map,this.cachedJsonSchema=new Map}getMetadataFor(e){return this.cachedMetadata.get(e)}getJsonSchemaFor(e){return this.cachedJsonSchema.get(e)}hasMetadataFor(e){return this.cachedMetadata.has(e)}hasJsonSchemaFor(e){return this.cachedJsonSchema.has(e)}setMetadataFor(e,t){this.cachedMetadata.set(e,t)}setJsonSchemaFor(e,t){this.cachedJsonSchema.set(e,t)}}const h=o.DI.createInterface((e=>e.singleton(c))),d=new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i");var E=s(2296);const l=o.DI.createInterface(),u=o.DI.createInterface();var S=s(5373),g=s(1966),_=s(9866),T=s(804),R=s(7211),v=s(4866),p=s(5527);class m{serialize(e){return JSON.stringify(e)}deserialize(e){return e?"string"==typeof e?JSON.parse(e):e.data?JSON.parse(e.data):e.text().then((e=>JSON.parse(e))):Promise.resolve({})}}const O=o.DI.createInterface((e=>e.singleton(m)));let A=class{constructor(e){this.serializer=e}get(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const s=yield fetch(e,Object.assign(Object.assign({},t),{method:"GET"}));return(t.serializer||this.serializer).deserialize(s)}))}post(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const s=yield fetch(e,Object.assign(Object.assign({},t),{method:"POST"}));return(t.serializer||this.serializer).deserialize(s)}))}};A=(0,r.__decorate)([(0,r.__param)(0,O)],A);const I=o.DI.createInterface((e=>e.singleton(A)));var f=s(9162);const M={polling:Object.assign({POLLING_MAP:{EVENT_AMEND_USER:{TEMP_FREQUENCY:500,AMOUNT_OF_POLLS:5,QUERIES:["ALL_USERS"]}},POLLING_INTERVAL_MAP:{ALL_TRADES:5e3,ALL_USERS:5e3,ALL_PROCESSES_STATUS:1e4},POLLING_FREQUENCY:5e3},{})};let N=class e{get isConnected(){return"connected"===this._status.getValue()}get status(){return this._status.getValue()}set status(e){this._status.next(e)}constructor(e,t,s,r,i,n=M){this.http=e,this.messageBuilder=t,this.session=s,this.metaCache=r,this.serializer=i,this.config=n,this._status=new a.X("disconnected"),this._hostUrl=new a.X(void 0),this.ongoingTurbo={},this.streams=new Map}checkHost(){return(0,r.__awaiter)(this,void 0,void 0,(function*(){try{return this.getMessage({MESSAGE_TYPE:f.Cs.HEARTBEAT_PING,SOURCE_REF:"host check"}).then((e=>e.MESSAGE_TYPE===f.Cs.HEARTBEAT_PONG))}catch(e){return E.k.error(e),!1}}))}send(t,s){return this.http.post(e.getUrl(this.host,t),{body:e.getBody(t),headers:e.getHeaders(t)})}httpMode(){return!0}setValidSession(e){E.k.warn("setValidSession() called while in http polling mode.")}connect(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){return this.host=e,this.host.endsWith("/")||(this.host=this.host.concat("/")),this.checkHost().then((e=>(this.status=e?"connected":"disconnected",this.session.setSessionStorageItem("hostUrl",this.host),this._hostUrl.next(this.host),e)))}))}disconnect(){this.status="disconnected",this.streams.clear(),this.ongoingTurbo={},this.host=void 0}snapshot(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return E.k.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.send(s).then((e=>(this.dataLogoff(s.SOURCE_REF).catch((e=>E.k.error(e))),e)))}))}stream(e,t,s,r){const i=this.messageBuilder.createDataLogonMessage(e,r);E.k.debug(`HTTP MODE - ${i.MESSAGE_TYPE} (stream) message created -> `,i);const n=i.SOURCE_REF;this.streams.set(n,{SOURCE_REF:n,POLLING_FREQUENCY:new a.X(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(n).POLLING_FREQUENCY,c=(0,S.z)((0,g.D)(this.send(i)),o.pipe((0,_.w)((e=>(0,T.F)(e)))).pipe((0,_.w)((()=>(0,g.D)(this.getMessage(i)))))).pipe((0,R.o)((()=>this.streams.has(n))),(0,v.x)((()=>{E.k.debug(`Terminating stream for ${e} - ${n}`),this.dataLogoff(n)})));return this.streams.get(n).STREAM=c,c}getMessage(t){return(0,r.__awaiter)(this,void 0,void 0,(function*(){return this.http.get(e.getUrl(this.host,t),{headers:e.getHeaders(t)})}))}getMoreRows(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return E.k.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)}))}dataLogoff(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then((t=>(this.streams.has(e)&&(E.k.debug(`Removing stream ${e}`),this.streams.delete(e)),t)))}))}getMetadata(e,t=!0){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e);return E.k.debug(`HTTP MODE - ${t.MESSAGE_TYPE} (metadata) message created -> `,t),this.send(t).then((e=>e.DETAILS))}))}getJSONSchema(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMetaRequestMessage(e,f.N$.JSON_SCHEMA_REQUEST);return E.k.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (json schema) message created -> `,t),this.send(t)}))}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return E.k.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (request server) message created -> `,s),this.send(s)}commitEvent(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createCommitMessage(e,t);return E.k.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (commit) message created -> `,s),this.send(s).then((t=>(this.maybeTurbo(e,t),t)))}))}maybeTurbo(e,t){var s;if(!(null===(s=null==t?void 0:t.MESSAGE_TYPE)||void 0===s?void 0:s.endsWith("_ACK")))return;if(this.ongoingTurbo[e])return void E.k.debug(`${e} polling frequency is already accelerated.`);const r=this.config.polling.POLLING_MAP[e];if(!(null==r?void 0:r.TEMP_FREQUENCY)||!r.AMOUNT_OF_POLLS)return;const i=r.TEMP_FREQUENCY,n=i*r.AMOUNT_OF_POLLS,o=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP)),a=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP));for(const e of r.QUERIES)a[e]=i,o[e]||(o[e]=this.config.polling.POLLING_FREQUENCY);E.k.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${i}ms DURATION=${n}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout((()=>{E.k.debug(`RESTORED ORIGINAL POLLING INTERVALS FOR ${e}`),this.updateIntervals({polling:{POLLING_INTERVAL_MAP:o}}),this.ongoingTurbo[e]=!1}),n)}updateIntervals(e){const{POLLING_INTERVAL_MAP:t}=e.polling;t&&(this.config.polling.POLLING_INTERVAL_MAP=t,this.handlePollingIntervalMapUpdate(t))}handlePollingIntervalMapUpdate(e){if(e)for(const t in e){if(!e.hasOwnProperty(t))continue;const s=e[t];this.config.polling.POLLING_INTERVAL_MAP[t]=s,E.k.debug(`Setting polling frequency for ${t} = ${s}`),[...this.streams.values()].filter((e=>e.RESOURCE_NAME===t)).forEach((e=>{var t;return null===(t=null==e?void 0:e.POLLING_FREQUENCY)||void 0===t?void 0:t.next(s)}))}}static getHeaders(e){const t={"Content-type":"application/json; charset=UTF-8","source-ref":e.SOURCE_REF};return e.SESSION_AUTH_TOKEN&&(t["SESSION-AUTH-TOKEN"]=e.SESSION_AUTH_TOKEN),e.MESSAGE_TYPE===f.N$.EVENT_LOGOUT&&(t["SESSION-ID"]=e.SESSION_ID),t}static getBody(e){return JSON.stringify(e)}static getUrl(e,t){const s=t.MESSAGE_TYPE;let r=t.MESSAGE_TYPE.replace(/_/g,"-").toLowerCase();return s===f.N$.DATA_LOGON&&(r=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${r}`}};(0,r.__decorate)([n.observable],N.prototype,"host",void 0),(0,r.__decorate)([n.volatile],N.prototype,"isConnected",null),(0,r.__decorate)([n.volatile],N.prototype,"status",null),N=(0,r.__decorate)([(0,r.__param)(0,I),(0,r.__param)(1,f.sW),(0,r.__param)(2,p.z),(0,r.__param)(3,h),(0,r.__param)(4,i.JSONSerializer),(0,r.__param)(5,(0,o.optional)(u))],N);const b=o.DI.createInterface((e=>e.singleton(N)));var U=s(3344),C=s(1057),L=s(7674),k=s(94),w=s(526),P=s(5255),D=s(8370),y=s(1262),G=s(9262);const F=1e4,H=6e4;var V;!function(e){e.Linear="linear",e.Exponential="exponential"}(V||(V={}));const $=(e,t)=>{const{reconnectInterval:s=F}=e,r=s>H?H:s,i=Math.round(Math.log2(H/r));return r*Math.pow(2,t%i)},Y=e=>{const{reconnectInterval:t=F}=e;return t>H?H:t};class B extends U.x{constructor(){super()}}class K{constructor(e,t,s,r){this._message=e,this._onMessage=t,this._onError=s,this._isSubscription=r}get sentMessage(){return this._message}get onReceivedMessage(){return this._onMessage}get onReceivedError(){return this._onError}get isSubscription(){return this._isSubscription}}let x=class{constructor(e,t,s,r){this.messageBuilder=e,this.session=t,this.serializer=s,this.uuid=r,this.defaultInterval=1e4,this.secondsMultiplier=1e3,this.hasValidSession=!1,this.heartbeatIsEnabled=!0,this.heartbeatInterval=this.defaultInterval,this.isReconnecting=!1,this.socketMessages=()=>this.wsMessages}bind(e){this.connectService=e}get heartbeatLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeatLogging)&&void 0!==t&&t}get messageLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableMessageLogging)&&void 0!==t&&t}connect(e,t,s){return this.url=e,this.connectOptions=t,this.reconnectOptions=s,this.connectService.status="busy",new Promise((e=>{var t,s,i,n;E.k.info(`${this.isReconnecting?"Reconnecting":"Connecting"} to ${this.url}`);(!this.isReconnecting||!(null===(t=this.reconnectOptions)||void 0===t?void 0:t.reconnectStreams))&&this.cleanMessages(),null===(s=this.socketSubscription)||void 0===s||s.unsubscribe(),this.websocket=new y.p({url:this.url,openObserver:{next:()=>{this.connectService.status="connected",this.connectService._hostUrl.next(this.url),this.session.setSessionStorageItem("hostUrl",this.url),this.prepareHeartbeat(),E.k.info("WebSocket connection is now open"),e(this.connectService.isConnected)}},closeObserver:{next:t=>{this.disconnectedByServer=!t.wasClean,this.connectService.status="disconnected",this.disconnectedByServer&&E.k.info(`WebSocket connection was closed due an error - Code: ${t.code} ${t.reason?" | Reason: "+t.reason:""}`),e(!1)}},serializer:this.serializer.serialize,deserializer:this.serializer.deserialize});this.socketSubscription=this.websocket.subscribe(null!==(n=null===(i=this.connectOptions)||void 0===i?void 0:i.connectObserver)&&void 0!==n?n:{next:e=>(0,r.__awaiter)(this,void 0,void 0,(function*(){var t;const s=`Response Message received for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,E.k.info,s);const{SOURCE_REF:r,MESSAGE_TYPE:i}=e,n=this.getMessageHandler(r,i);if(!n)return;let o=!1;switch(e.MESSAGE_TYPE){case f.N$.EVENT_LOGIN_AUTH_ACK:{this.hasValidSession=!0;const s=e.DETAILS;s.HEARTBEAT_INTERVAL_SECS&&void 0===(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatInterval)&&(this.heartbeatInterval=s.HEARTBEAT_INTERVAL_SECS*this.secondsMultiplier,this.prepareHeartbeat());break}case f.Cs.LOGOUT_ACK:return this.hasValidSession=!1,n.onReceivedMessage.call(this,e),void this.cleanMessages();case f.Cs.LOGON_ACK:return;case f.Cs.LOGOFF_ACK:if(e.LOGGED_OUT&&this.hasValidSession){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);t?t.MESSAGE_TYPE===f.N$.EVENT_LOGIN_AUTH_ACK&&(this.session.setAuthResult(t),this.wsMessageHandlers.forEach((e=>{e.isSubscription&&(e.sentMessage.SESSION_AUTH_TOKEN=t.SESSION_AUTH_TOKEN,this.websocket.next(e.sentMessage))}))):this.hasValidSession=!1}break;case f.Cs.QUERY_UPDATE:if(!n.isSubscription){const e=this.messageBuilder.createDataLogoffMessage(r);this.send(e)}break;case f.Cs.MSG_NACK:o=!0}o?n.onReceivedError.call(this,{receivedMessage:e,sentMessage:n.sentMessage}):n.onReceivedMessage.call(this,e),this.wsMessages.next(e),n.isSubscription||this.removeMessageHandler(r)})),error:e=>{E.k.debug("Error found: ",e),this.reconnect()},complete:()=>{var e;this.disconnectedByServer&&(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)?this.reconnect():E.k.info("Connection is now closed")}})}))}prepareHeartbeat(){var e,t,s,i;this.heartbeatSubscription&&this.heartbeatSubscription.unsubscribe();const n=()=>(0,r.__awaiter)(this,void 0,void 0,(function*(){if(!this.connectService.isConnected)return;const e={MESSAGE_TYPE:f.Cs.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId()},t=yield this.send(e);this.heartbeatIsEnabled=t.MESSAGE_TYPE===f.Cs.HEARTBEAT_PONG&&t.SOURCE_REF===e.SOURCE_REF}));if(null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeat)&&void 0!==t?t:this.heartbeatIsEnabled){const e=null!==(i=null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatInterval)&&void 0!==i?i:this.heartbeatInterval;this.heartbeatSubscription=(0,C.H)(e,e).pipe((0,R.o)((()=>this.websocket&&this.connectService.isConnected)),(0,w.b)((()=>this.heartbeatLoggingIsEnabled&&E.k.debug(`Sending a heartbeat ping every ${e} ms`)))).subscribe((()=>n()))}}reconnect(){var e,t,s,r,i;const n=!(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)&&!1===(null===(t=this.connectOptions)||void 0===t?void 0:t.enableHeartbeat);if(this.isReconnecting||n)return;this.isReconnecting=!0;const o=(null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectStrategy)===V.Exponential?$:Y,a=this.connectService._status.asObservable().pipe((0,_.w)((e=>"connected"!==e?((e,t)=>new G.y((s=>{let r,i=0;return function n(){s.next(i),clearTimeout(r),r=setTimeout(n,t(e,i)),i+=1}(),()=>{clearTimeout(r)}})))(this.reconnectOptions,o).pipe((0,P.z)((e=>{var t,s,r;let i;return i=(null===(t=this.connectOptions)||void 0===t?void 0:t.alwaysOn)?e+1:null!==(r=null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectAttempts)&&void 0!==r?r:10,e<i?(0,L.of)(e):(0,k._)((()=>new Error(`Max reconnect attempts ${i} reached.`)))}))):(0,L.of)(-1))),(0,R.o)((()=>this.websocket&&!this.connectService.isConnected)));a.subscribe(null!==(i=null===(r=this.reconnectOptions)||void 0===r?void 0:r.reconnectObserver)&&void 0!==i?i:{next:e=>{E.k.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;E.k.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.isReconnecting=!1},complete:()=>{E.k.info(this.connectService.isConnected?"Reconnected":"Disconnected"),this.isReconnecting=!1,this.wsMessageHandlers.forEach((e=>{e.isSubscription&&this.websocket.next(e.sentMessage)}))}})}reset(){this.connectService.status="disconnected",this.websocket&&this.websocket.complete(),this.websocket=null,this.cleanMessages()}cleanMessages(){this.wsMessages&&this.wsMessages.complete(),this.wsMessages=new B,this.wsMessageHandlers=new Map}send(e,t=!0){if("disconnected"===this.connectService.status)return void Promise.reject(new Error("WebSocket connection is closed"));const s=`Sending Message for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,E.k.info,s),new Promise(((s,r)=>{const i=e=>{s(e)},n=e=>{r(e)};t&&this.setMessageHandler(e,i,n),this.websocket.next(e)}))}sendForStream(e,t,s){if(!this.connectService.isConnected)return(0,k._)((()=>new Error("WebSocket connection is closed")));if(!this.hasValidSession)return(0,k._)((()=>new Error("WebSocket connection is open but there is no valid/active session, please check your auth flow")));const r=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,E.k.info,r),this.setMessageHandler(e,t,s,!0),this.websocket.next(e),(0,g.D)(this.wsMessages.pipe((0,D.h)((t=>t.SOURCE_REF===e.SOURCE_REF))))}setMessageHandler(e,t,s,r=!1){const i=`Setting Message Handler for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,E.k.debug,i),this.wsMessageHandlers.set(e.SOURCE_REF,new K(e,t,s,r))}removeMessageHandler(e){this.wsMessageHandlers.delete(e)}getMessageHandler(e,t){const s=`Getting Message Handler for SourceRef: ${e} | MessageType: ${t}`;return this.logMessageTypeFlow(t,E.k.debug,s),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,s){switch(e){case f.Cs.HEARTBEAT_PING:case f.Cs.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(s);break;default:this.messageLoggingIsEnabled&&t(s)}}};(0,r.__decorate)([n.observable],x.prototype,"websocket",void 0),(0,r.__decorate)([n.observable],x.prototype,"wsMessages",void 0),(0,r.__decorate)([n.observable],x.prototype,"wsMessageHandlers",void 0),(0,r.__decorate)([n.observable],x.prototype,"disconnectedByServer",void 0),(0,r.__decorate)([n.observable],x.prototype,"hasValidSession",void 0),(0,r.__decorate)([n.observable],x.prototype,"heartbeatIsEnabled",void 0),(0,r.__decorate)([n.observable],x.prototype,"isReconnecting",void 0),x=(0,r.__decorate)([(0,r.__param)(0,f.sW),(0,r.__param)(1,p.z),(0,r.__param)(2,O),(0,r.__param)(3,i.UUID)],x);const W=o.DI.createInterface((e=>e.singleton(x))),Q={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0}};let J=class{constructor(e,t,s,r=Q){this.socket=e,this.messageBuilder=t,this.metaCache=s,this.config=r,this._status=new a.X("disconnected"),this._hostUrl=new a.X(void 0),this.socket.bind(this)}get isConnected(){return"connected"===this._status.getValue()}get status(){return this._status.getValue()}set status(e){this._status.next(e)}httpMode(){return!1}setValidSession(e){this.socket.hasValidSession=e}send(e,t){return this.socket.send(e,t)}connect(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){return this.socket.reset(),d.test(e)?this.socket.connect(e,this.config.connect,this.config.reconnect):(E.k.error(`Specified host (${e}) is not valid WebSocket url. Connection will not proceed.`),void E.k.warn("Make sure the host url starts with wss:// or ws://"))}))}disconnect(){this.socket.reset()}snapshot(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return E.k.debug(`${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.socket.send(s)}))}stream(e,t,s,r){const i=this.messageBuilder.createDataLogonMessage(e,r);return E.k.debug(`${i.MESSAGE_TYPE} (stream) message created -> `,i),this.socket.sendForStream(i,t,s)}getMoreRows(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return E.k.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t,!1)}))}dataLogoff(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return E.k.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)}))}getMetadata(e,t=!0){var s;return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(t&&this.metaCache.hasMetadataFor(e))return E.k.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const r=this.messageBuilder.createMetaRequestMessage(e);let i;try{const t=yield this.socket.send(r);i=null!==(s=null==t?void 0:t.DETAILS)&&void 0!==s?s:{},Object.keys(i).length&&this.metaCache.setMetadataFor(e,i)}catch(e){E.k.error(e)}return i}))}getJSONSchema(e,t=!0){var s;return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(t&&this.metaCache.hasMetadataFor(e))return E.k.debug(`Cached JsonSchema retrieved for ${e}`),this.metaCache.getJsonSchemaFor(e);const r=this.messageBuilder.createMetaRequestMessage(e,f.N$.JSON_SCHEMA_REQUEST);let i;E.k.debug(`${r.MESSAGE_TYPE} (json schema) message created -> `,r);try{i=null!==(s=yield this.socket.send(r))&&void 0!==s?s:{},Object.keys(i).length&&this.metaCache.setJsonSchemaFor(e,i)}catch(e){E.k.error(e)}return i}))}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return E.k.debug(`${s.MESSAGE_TYPE} (request server) message created -> `,s),this.socket.send(s)}commitEvent(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const s=this.messageBuilder.createCommitMessage(e,t);return E.k.debug(`${s.MESSAGE_TYPE} (commit) message created -> `,s),this.socket.send(s)}))}};(0,r.__decorate)([n.volatile],J.prototype,"isConnected",null),(0,r.__decorate)([n.volatile],J.prototype,"status",null),J=(0,r.__decorate)([(0,r.__param)(0,W),(0,r.__param)(1,f.sW),(0,r.__param)(2,h),(0,r.__param)(3,(0,o.optional)(l))],J);const z="true"===i.FORCE_HTTP||!1,j=o.DI.createInterface((e=>e.singleton(J))),q=o.DI.createInterface((e=>z?e.aliasTo(b):e.aliasTo(j)))},9162:(e,t,s)=>{"use strict";s.d(t,{Cs:()=>r,N$:()=>i,QT:()=>n,sW:()=>l});var r,i,n,o=s(186),a=s(342),c=s(5951),h=s(4077),d=s(5527);!function(e){e.LOGON_ACK="LOGON_ACK",e.LOGON_NACK="LOGON_NACK",e.LOGOFF_ACK="LOGOFF_ACK",e.LOGOFF_NACK="LOGOFF_NACK",e.HEARTBEAT_PING="HEARTBEAT_PING",e.HEARTBEAT_PONG="HEARTBEAT_PONG",e.MORE_ROWS="MORE_ROWS",e.MSG_ACK="MSG_ACK",e.MSG_NACK="MSG_NACK",e.LOGOUT_ACK="LOGOUT_ACK",e.LOGOUT_NACK="LOGOUT_NACK",e.QUERY_UPDATE="QUERY_UPDATE"}(r||(r={})),function(e){e.EVENT_LOGIN_AUTH="EVENT_LOGIN_AUTH",e.EVENT_LOGIN_AUTH_ACK="EVENT_LOGIN_AUTH_ACK",e.EVENT_LOGIN_AUTH_NACK="EVENT_LOGIN_AUTH_NACK",e.EVENT_LOGOUT="EVENT_LOGOUT",e.DATA_LOGON="DATA_LOGON",e.DATA_LOGOFF="DATA_LOGOFF",e.META_REQUEST="META_REQUEST",e.JSON_SCHEMA_REQUEST="JSON_SCHEMA_REQUEST",e.RESOURCES_REQUEST="RESOURCES_REQUEST",e.EVENT_CHANGE_USER_PASSWORD="EVENT_CHANGE_USER_PASSWORD",e.EVENT_SELF_SERVICE_PASSWORD_RESET="EVENT_SELF_SERVICE_PASSWORD_RESET",e.EVENT_PASSWORD_RESET_ACTION="EVENT_PASSWORD_RESET_ACTION"}(i||(i={})),function(e){e.SESSION_NOT_FOUND="SESSION_NOT_FOUND",e.UNKNOWN_MESSAGE_TYPE="UNKNOWN_MESSAGE_TYPE"}(n||(n={}));let E=class{constructor(e,t){this.session=e,this.uuid=t}createLoginMessage(e){let t;switch(e.type){case h.G.BASIC:t={USER_NAME:e.username,PASSWORD:e.password};break;case h.G.REFRESH:t={USER_NAME:e.username,REFRESH_AUTH_TOKEN:e.refreshToken};break;case h.G.SSO:t={SSO_TOKEN:e.ssoToken};break;case h.G.JWT:t={JWT:e.jwt,DOMAIN:e.domain}}return{DETAILS:t,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.EVENT_LOGIN_AUTH}}createLogoutMessage(e){var t,s;return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.EVENT_LOGOUT,SESSION_AUTH_TOKEN:null!==(t=e.authToken)&&void 0!==t?t:this.session.getSessionStorageItem("authToken"),SESSION_ID:null!==(s=e.sessionId)&&void 0!==s?s:this.session.getSessionStorageItem("sessionId")}}createDataLogonMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.DATA_LOGON,DETAILS:Object.assign({DATASOURCE_NAME:e},t),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createDataLogoffMessage(e){return{SOURCE_REF:e,MESSAGE_TYPE:i.DATA_LOGOFF,SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createRequestMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e.startsWith("REQ_")?e:`REQ_${e}`},t)}createMetaRequestMessage(e,t=i.META_REQUEST){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:t,DETAILS:{FEATURE:e},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createCommitMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e},t)}createRefreshTokenMessage(){return{SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:i.EVENT_LOGIN_AUTH,DETAILS:{REFRESH_AUTH_TOKEN:this.session.getSessionStorageItem("refreshToken")}}}createChangePasswordMessage(e,t,s){return{USER_NAME:e,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.EVENT_CHANGE_USER_PASSWORD,DETAILS:{OLD_PASSWORD:t,NEW_PASSWORD:s}}}createForgotPasswordMessage(e,t,s=e){return{USER_NAME:s,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.EVENT_SELF_SERVICE_PASSWORD_RESET,DETAILS:{USER_NAME:e,RETURN_URL:t}}}createForgotPasswordTokenMessage(e,t,s,r=e){return{USER_NAME:r,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.EVENT_PASSWORD_RESET_ACTION,DETAILS:{USER_NAME:e,RESET_TOKEN:t,NEW_PASSWORD:s}}}createMoreRowsMessage(e){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.MORE_ROWS,DETAILS:{SOURCE_REF:e},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}};E=(0,o.__decorate)([(0,o.__param)(0,d.z),(0,o.__param)(1,a.UUID)],E);const l=c.DI.createInterface((e=>e.singleton(E)))},5127:(e,t,s)=>{"use strict";s.d(t,{$:()=>i});var r=s(2296);function i(e,t="ROW_REF"){const s=e=>{const s=Object.assign(Object.assign({},e),{[t]:e.DETAILS[t]});return delete s.DETAILS,s},i=[],n=[],o=[];for(const t of e.ROW)if(t.DETAILS)switch(t.DETAILS.OPERATION){case"INSERT":i.push(s(t));break;case"MODIFY":o.push(s(t));break;case"DELETE":n.push(s(t));break;default:r.k.error(`Unsupported operation type: '${t.DETAILS.OPERATION}'`)}return{inserts:i,deletes:n,updates:o,SOURCE_REF:e.SOURCE_REF}}},1871:(e,t,s)=>{"use strict";s.d(t,{Yh:()=>H});var r=s(186),i=s(3147),n=s(5951),o=s(1057),a=s(1966),c=s(7211),h=s(9866),d=s(1440),E=s(9162);function l(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)e[r]=s[r]}return e}var u=function e(t,s){function r(e,r,i){if("undefined"!=typeof document){"number"==typeof(i=l({},s,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var n="";for(var o in i)i[o]&&(n+="; "+o,!0!==i[o]&&(n+="="+i[o].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+n}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var s=document.cookie?document.cookie.split("; "):[],r={},i=0;i<s.length;i++){var n=s[i].split("="),o=n.slice(1).join("=");try{var a=decodeURIComponent(n[0]);if(r[a]=t.read(o,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",l({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,l({},this.attributes,t))},withConverter:function(t){return e(l({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(s)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const S=u;var g=s(4077),_=s(5527),T=s(2296);const R=n.DI.createInterface();function v(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(T.k.warn("PasswordCredential not available in this browser."),!1):(T.k.warn("CredentialsContainer not available in this browser."),!1)}const p=":";function m(e="",t=p,s){return e.split(t,s).map((e=>e.trim())).filter((e=>""!==e))}function O(e,t=p){const s="string"==typeof e&&e.trim();return!!s&&s.includes(t)}function A(e,t=p){return"string"==typeof e&&e.trim()?(e.match(new RegExp(t,"g"))||[]).length:0}function I(e,t=p){for(const s of e)if(O(s,t))return s;return e.find((e=>"string"==typeof e&&!!e.trim()))}function f(e,t,s){const r="string"==typeof e&&e.trim();return!r||s&&!r.includes(s)||A(r)>1?s&&t&&s!==t?`${t}:${s}`:t||s:r}function M(e="credential"){T.k.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}const N={password:!0,mediation:"optional"},b={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let U=class{constructor(e,t=b){this.session=e,this.config=t}createBasicCredentials(e){return{type:g.G.BASIC,username:e.username,password:e.password}}createRefreshCredentials(e){var t,s;return{type:g.G.REFRESH,username:null!==(t=null==e?void 0:e.username)&&void 0!==t?t:this.getUsername(),refreshToken:null!==(s=null==e?void 0:e.refreshToken)&&void 0!==s?s:this.getRefreshToken()}}createSSOCredentials(e){var t;return{type:g.G.SSO,ssoToken:null!==(t=null==e?void 0:e.ssoToken)&&void 0!==t?t:this.getSSOToken()}}validateBasicCredentials(e){return e&&!!e.username&&!!e.password}validateRefreshCredentials(e){return e&&!!e.refreshToken&&!!e.username}validateSSOCredentials(e){return e&&!!e.ssoToken}validateUserCredentialData(e,t){const s=e&&!!e.id&&!!e.name&&!e.name.includes(p)&&A(e.id)<=1;return t?s&&!!e.password:s}normaliseLegacyCredentialData(e,t){if(this.validateUserCredentialData(e,!0))return[e,!0];if(this.validateUserCredentialData(t))return[t,!1];if(e)try{const t=e,[s]=m(t.name||t.id),[r,i]=m(I([t.id,t.name]));return[{id:f(t.id||t.name,s,i),name:s,password:t.password||""},!0]}catch(e){M("PasswordCredential")}if(t)try{const e=t,[s]=m(e.name||e.username||e.organisation),[r,i]=m(I([e.organisation||e.username||e.name]));return[{id:f(e.id||e.username||e.name,s,i),name:s,password:e.password||""},!1]}catch(e){M("cookie")}return[void 0,!1]}storeCredentialsInContainer(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(!v())return;const t=new PasswordCredential(e);return T.k.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)}))}getCredentialsFromContainer(e=N){return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(v())return T.k.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)}))}storeCredentialsInCookie(e){const{password:t}=e,s=(0,r.__rest)(e,["password"]),i=this.config.cookie.storePasswords?e:s;return T.k.debug("Storing credentials in cookie"),!!S.set(this.config.cookie.name,JSON.stringify(i),{expires:this.config.cookie.expires,domain:location.hostname,path:this.config.cookie.path,secure:!0})}getCredentialsFromCookie(){T.k.debug("Getting credentials from cookie");const e=S.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(v()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))}))}getCredentials(e){return(0,r.__awaiter)(this,void 0,void 0,(function*(){return v()?this.getCredentialsFromContainer(e):Promise.resolve(this.getCredentialsFromCookie())}))}getSSOToken(){return this.session.getSessionStorageItem("ssoToken")}getUsername(){return this.session.getSessionStorageItem("username")}getRefreshToken(){return this.session.getSessionStorageItem("refreshToken")}removeCookie(){S.remove(this.config.cookie.name,{domain:location.hostname,path:this.config.cookie.path})}removeSSOToken(){this.session.removeSessionStorageItem("ssoToken")}removeUsername(){this.session.removeSessionStorageItem("username")}removeRefreshToken(){this.session.removeSessionStorageItem("refreshToken")}removeAll(){this.removeCookie(),this.removeSSOToken(),this.removeUsername(),this.removeRefreshToken()}preventSilentAccess(){return v()&&navigator.credentials.preventSilentAccess()}};U=(0,r.__decorate)([(0,r.__param)(0,_.z),(0,r.__param)(1,(0,n.optional)(R))],U);const C=n.DI.createInterface((e=>e.singleton(U)));class L{constructor(e){Object.assign(this,e)}hasAdminProfile(){return this.hasProfile("ADMIN")}hasPermission(e){return this.hasKey(this.permissions,e)}hasProfile(e){return this.hasKey(this.profiles,e)}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some((t=>e.includes(t))))}}(0,r.__decorate)([i.observable],L.prototype,"permissions",void 0),(0,r.__decorate)([i.observable],L.prototype,"profiles",void 0),(0,r.__decorate)([i.observable],L.prototype,"username",void 0);let k=class{get isLoggedIn(){return!!this.loggedUserResult&&!(!this.loggedUserResult.authToken||!this.loggedUserResult.sessionId)}constructor(e,t,s,r){this.session=e,this.connect=t,this.messageBuilder=s,this.credentialManager=r,this.isWorking=!1,this.loggedUserResult=null,this.currentUser=null}login(e){var t;return(0,r.__awaiter)(this,void 0,void 0,(function*(){this.isWorking=!0;try{const s=this.messageBuilder.createLoginMessage(e),r=yield this.connect.send(s);if(!r||r.ERROR||(null===(t=r.DETAILS)||void 0===t?void 0:t.ERROR))throw new g.l(s,r);this.applyAuthResults({authToken:r.SESSION_AUTH_TOKEN,refreshToken:r.REFRESH_AUTH_TOKEN,profiles:r.PROFILE,username:r.USER_NAME,permissions:r.PERMISSION,sessionId:r.SESSION_ID}),this.session.setAuthResult(r),T.k.debug("Login Authentication Result:",r)}catch(e){if(T.k.error("Login Authentication Error:",e),!(e instanceof g.l&&e.isIgnorableError()))throw this.removeAuthResults(),e;T.k.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult}))}logout(){var e;return(0,r.__awaiter)(this,void 0,void 0,(function*(){this.isWorking=!0;let t={success:!1};try{const s=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage(),this.connect.setValidSession(!1);const{CODE:r,DETAILS:i,MESSAGE_TYPE:n,OIDC_LOGOUT_URL:o}=yield this.connect.send(s);t={success:n===E.Cs.LOGOUT_ACK||r===E.QT.SESSION_NOT_FOUND,error:null!==(e=null==i?void 0:i.ERROR)&&void 0!==e?e:void 0},o&&window.open(o,"_self")}catch(e){const s=new g.l(e.sentMessage,e.receivedMessage);if(T.k.error("Logout Authentication Error:",s),!s.isIgnorableError())throw e;T.k.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.isWorking=!1}return t}))}reAuthFromSession(){return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(yield this.ensureConnection()){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.connect.send(e);if((null==t?void 0:t.MESSAGE_TYPE)===E.N$.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.connect.setValidSession(!0),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.connect.setValidSession(!1),!1}))}ensureConnection(){return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(this.connect.isConnected)return!0;const e=this.session.getSessionStorageItem("hostUrl");return!!e&&this.connect.connect(e)}))}getLoggedUserFromMessage(e){const t=e.USER_NAME,s=e.SESSION_AUTH_TOKEN,r=e.REFRESH_AUTH_TOKEN;return t&&s&&r?{username:t,authToken:s,refreshToken:r,profiles:e.PROFILE,permissions:e.PERMISSION,sessionId:e.SESSION_ID}:null}applyAuthResults(e){e?(this.loggedUserResult={authToken:e.authToken,refreshToken:e.refreshToken,profiles:e.profiles,username:e.username,permissions:e.permissions,sessionId:e.sessionId},this.currentUser=new L({permissions:e.permissions,profiles:e.profiles,username:e.username})):this.removeAuthResults()}removeAuthResults(){this.loggedUserResult=null,this.currentUser=null}};(0,r.__decorate)([i.observable],k.prototype,"isWorking",void 0),(0,r.__decorate)([i.observable],k.prototype,"loggedUserResult",void 0),(0,r.__decorate)([i.observable],k.prototype,"currentUser",void 0),(0,r.__decorate)([i.volatile],k.prototype,"isLoggedIn",null),k=(0,r.__decorate)([(0,r.__param)(0,_.z),(0,r.__param)(1,d.lj),(0,r.__param)(2,E.sW),(0,r.__param)(3,C)],k);const w=n.DI.createInterface((e=>e.singleton(k)));var P=s(6306);var D=s(5127),y=s(2940);const G={options:{criteria:"",isSnapshot:!1,maxRows:y.WJ.MAX_ROWS_250,maxView:y.WJ.MAX_VIEW_1000,orderBy:"",resourceName:"",reverse:!1},criteriaToFields:function(e){const t=e.split("&&").map((e=>e.trim())),s={};return t.forEach((e=>{const t=e.substr(0,e.indexOf("=")).trim().replace(/["']/g,""),r=e.substr(e.lastIndexOf("=")+1,e.length).trim().replace(/["']/g,"");s[t]=r})),s},dataServerResultFilter:D.$};let F=class{constructor(e,t,s=G){this.connect=e,this.auth=t,this.config=s,this.initialized=!1,this.readOnly=!0,this.originalFieldDef=[],this.requestFields=[],this.fieldMetadata=[],this.availableIndexes=[]}init(e,t=!0){var s;return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(!this.validResourceName(null==e?void 0:e.resourceName))return!1;if(this.options=Object.assign(Object.assign({},this.config.options),e),t){T.k.debug(`Initializing ${this.options.resourceName} Datasource`);const t=yield this.connect.getMetadata(this.options.resourceName).catch((t=>T.k.error(`Metadata Fetch failed for ${e.resourceName}:`,t)));if(!t)return!1;this.resourceType=t.TYPE,this.availableIndexes=null!==(s=t.INDEXES)&&void 0!==s?s:[],this.originalFieldDef=(0,P.C)(t),this.fieldMetadata=(0,P.i)(this.originalFieldDef),this.requestFields=t.REQUEST_FIELD||[],T.k.debug(`Datasource for ${this.options.resourceName} is ready`)}return this.options.isSnapshot||(this._stream=yield this.createStream()),this.initialized=!0,this.initialized}))}get stream(){return this._stream}get params(){const e={CRITERIA_MATCH:this.options.criteria,FIELDS:this.options.fields,MAX_ROWS:this.options.maxRows,MAX_VIEW:this.options.maxView,REQUEST:this.options.request,REVERSE:this.options.reverse};if(this.options.orderBy)if(this.availableIndexes.findIndex((e=>e.NAME===this.options.orderBy))>-1)e.ORDER_BY=this.options.orderBy;else{const e=this.availableIndexes.map((e=>e.NAME));T.k.warn("Specified [orderBy] index is not valid and will not be used. See https://learn.genesis.global/docs/database/data-types/index-entities/ - Available indexes:",e)}return T.k.debug("Getting configured params:",e),e}snapshot(){var e;return(0,r.__awaiter)(this,void 0,void 0,(function*(){switch(T.k.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case y._g.DATASERVER:return this.connect.snapshot(this.options.resourceName,this.params);case y._g.REQUEST_SERVER:{const t={DETAILS:Object.assign({},this.params),REQUEST:null},s={};if(this.requestFields.forEach((e=>{s[e.NAME]="*"})),t.REQUEST=s,null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.criteria){const e=this.config.criteriaToFields(this.options.criteria);t.REQUEST=Object.assign(Object.assign({},t.REQUEST),e)}return this.connect.request(this.options.resourceName,t)}default:throw new Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}}))}snapshotFiltered(e="ROW_REF"){return(0,r.__awaiter)(this,void 0,void 0,(function*(){const t=yield this.snapshot();return Array.isArray(t)?t:t.REPLY?t.REPLY:t.ROW?this.config.dataServerResultFilter(t,e).inserts:void 0}))}createStream(){return(0,r.__awaiter)(this,void 0,void 0,(function*(){if(![y._g.DATASERVER,y._g.REQUEST_SERVER].includes(this.resourceType))throw new Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===y._g.DATASERVER?this.createDataserverStream():(T.k.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())}))}createDataserverStream(){return(0,r.__awaiter)(this,void 0,void 0,(function*(){return this.connect.stream(this.options.resourceName,(e=>{}),(e=>T.k.error(e)),this.params)}))}createReqRepStream(){return(0,o.H)(0,y.WJ.REQ_REP_POLLING_INTERVAL_MS).pipe((0,c.o)((()=>this.connect.isConnected&&this.auth.isLoggedIn)),(0,h.w)((()=>(0,a.D)(this.snapshot()))))}validResourceName(e){return!!e&&!!e.trim().length}};(0,r.__decorate)([i.observable],F.prototype,"initialized",void 0),(0,r.__decorate)([i.observable],F.prototype,"readOnly",void 0),(0,r.__decorate)([i.volatile],F.prototype,"stream",null),F=(0,r.__decorate)([(0,r.__param)(0,d.lj),(0,r.__param)(1,w),(0,r.__param)(2,(0,n.optional)(y.tt))],F);const H=n.DI.createInterface((e=>e.transient(F)))},2940:(e,t,s)=>{"use strict";s.d(t,{_g:()=>r,WJ:()=>n,tt:()=>o});var r,i=s(5951);!function(e){e.DATASERVER="DATASERVER",e.EVENT_HANDLER="EVENT_HANDLER",e.REQUEST_SERVER="REQUEST_SERVER"}(r||(r={}));class n{}n.MAX_ROWS_250=250,n.MAX_VIEW_1000=1e3,n.REQ_REP_POLLING_INTERVAL_MS=1e4;const o=i.DI.createInterface()},2449:(e,t,s)=>{"use strict";function r(e,t=";"){return e?e.split(t).map((e=>e.trim())).sort(((e,t)=>e.localeCompare(t))).join(t):e}s.d(t,{p:()=>r})},3123:(e,t,s)=>{"use strict";var r;s.d(t,{r:()=>r,E:()=>i}),function(e){e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.ENUM="ENUM",e.DATE="DATE",e.DATETIME="DATETIME",e.CUSTOM="CUSTOM"}(r||(r={}));const i={STRING:r.STRING,ENUM:r.ENUM,BOOLEAN:r.BOOLEAN,INT:r.NUMBER,DOUBLE:r.NUMBER,BIGDECIMAL:r.NUMBER,DATE:r.DATE,DATETIME:r.DATETIME}},6306:(e,t,s)=>{"use strict";s.d(t,{i:()=>o,C:()=>a});var r=s(2940),i=s(2296),n=s(3123);const o=e=>e?e.map((e=>{const t={name:e.NAME,type:n.E[e.TYPE]||n.r.STRING};if(e.TYPE===n.r.ENUM&&e.VALID_VALUES)try{t.enumOptions=Array.isArray(e.VALID_VALUES)?e.VALID_VALUES:e.VALID_VALUES.split("|")}catch(e){i.k.error(e),t.enumOptions=[]}return t})):null,a=e=>{const t=null==e?void 0:e.TYPE;if(t===r._g.DATASERVER)return e.FIELD||[];if(t===r._g.REQUEST_SERVER)return e.REPLY_FIELD||[];throw new Error(`Unsupported resource type: ${t}`)}},5527:(e,t,s)=>{"use strict";s.d(t,{z:()=>n});var r=s(5951);class i{constructor(){this.storageKeyPrefix="",this.returnUrl=this.getSessionStorageItem("returnUrl")||""}deleteUserFromSessionStorage(){["authToken","refreshToken","sessionId","ssoToken"].forEach((e=>this.removeSessionStorageItem(e)))}setStorageKeyPrefix(e){this.storageKeyPrefix=`${e.replace(/\s/g,"")}/`}setAuthResult(e){this.setSessionStorageItem("authToken",e.SESSION_AUTH_TOKEN),this.setSessionStorageItem("refreshToken",e.REFRESH_AUTH_TOKEN),this.setSessionStorageItem("username",e.USER_NAME),this.setSessionStorageItem("sessionId",e.SESSION_ID)}captureReturnUrl(){const{pathname:e,search:t,hash:s}=location;if("/login"===e)return;const r=`${"/"!==e?e:""}`;this.returnUrl=`${r}${t}${s}`,this.setSessionStorageItem("returnUrl",this.returnUrl)}setItem(e,t,s){"local"===s?localStorage.setItem(this.storageKeyPrefix+e,t):sessionStorage.setItem(this.storageKeyPrefix+e,t)}getItem(e,t){return"local"===t?localStorage.getItem(this.storageKeyPrefix+e):sessionStorage.getItem(this.storageKeyPrefix+e)}removeItem(e,t){"local"===t?localStorage.removeItem(this.storageKeyPrefix+e):sessionStorage.removeItem(this.storageKeyPrefix+e)}setLocalStorageItem(e,t){this.setItem(e,t,"local")}setSessionStorageItem(e,t){this.setItem(e,t,"session")}getLocalStorageItem(e){return this.getItem(e,"local")}getSessionStorageItem(e){return this.getItem(e,"session")}removeLocalStorageItem(e){this.removeItem(e,"local")}removeSessionStorageItem(e){this.removeItem(e,"session")}}const n=r.DI.createInterface((e=>e.singleton(i)))},2296:(e,t,s)=>{"use strict";s.d(t,{k:()=>i});var r=s(342);const i=(0,r.createLogger)("foundation-comms")}}]);
3
+ //# sourceMappingURL=905.abe3f8f58593e33cfecc1ba9d091da35b0c44e059169b87ad147517f9aed6078.js.map