@eric-emg/symphiq-components 1.2.256 → 1.2.258

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.
@@ -15,6 +15,8 @@ import { FormsModule, FormBuilder, Validators, ReactiveFormsModule } from '@angu
15
15
  import { trigger, transition, style, animate } from '@angular/animations';
16
16
  import { toObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
17
17
  import { MarkdownComponent } from 'ngx-markdown';
18
+ import dayjs from 'dayjs';
19
+ import utc from 'dayjs/plugin/utc';
18
20
  import { Root, color, Tooltip, Bullet, Circle, Legend, percent, LinearGradient, p100, p50 } from '@amcharts/amcharts5';
19
21
  import { XYChart, CategoryAxis, AxisRendererX, ValueAxis, AxisRendererY, XYCursor, LineSeries, DateAxis, ColumnSeries } from '@amcharts/amcharts5/xy';
20
22
  import am5themes_Animated from '@amcharts/amcharts5/themes/Animated';
@@ -59484,6 +59486,13 @@ class InitialTargetSettingComponent {
59484
59486
  title: 'Current Pace Projection',
59485
59487
  markdown: 'This is your projected year-end revenue based on your current performance trends. It extrapolates your year-to-date results to estimate where you will finish the year if you maintain your current pace.'
59486
59488
  };
59489
+ effect(() => {
59490
+ const targets = this.targets();
59491
+ if (targets && targets.length > 0) {
59492
+ this.calculationState.set('results');
59493
+ this.detailsExpanded.set(false);
59494
+ }
59495
+ }, { allowSignalWrites: true });
59487
59496
  effect(() => {
59488
59497
  const response = this.reverseCalculationResponse();
59489
59498
  if (response) {
@@ -60522,40 +60531,15 @@ function SymphiqRevenueCalculatorDashboardComponent_Conditional_25_Template(rf,
60522
60531
  const _r2 = i0.ɵɵgetCurrentView();
60523
60532
  i0.ɵɵelement(0, "symphiq-revenue-calculator-welcome-banner", 14);
60524
60533
  i0.ɵɵelementStart(1, "div", 21)(2, "symphiq-initial-target-setting", 22);
60525
- i0.ɵɵlistener("targetsCreated", function SymphiqRevenueCalculatorDashboardComponent_Conditional_25_Template_symphiq_initial_target_setting_targetsCreated_2_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.targetsCreated.emit($event)); })("calculateRevenueRequest", function SymphiqRevenueCalculatorDashboardComponent_Conditional_25_Template_symphiq_initial_target_setting_calculateRevenueRequest_2_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.calculateRevenueRequest.emit($event)); });
60534
+ i0.ɵɵlistener("targetsCreated", function SymphiqRevenueCalculatorDashboardComponent_Conditional_25_Template_symphiq_initial_target_setting_targetsCreated_2_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onTargetsCreated($event)); })("calculateRevenueRequest", function SymphiqRevenueCalculatorDashboardComponent_Conditional_25_Template_symphiq_initial_target_setting_calculateRevenueRequest_2_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.calculateRevenueRequest.emit($event)); });
60526
60535
  i0.ɵɵelementEnd()();
60527
60536
  } if (rf & 2) {
60528
60537
  const ctx_r0 = i0.ɵɵnextContext();
60529
- i0.ɵɵproperty("viewMode", ctx_r0.viewMode())("dataLoadStatus", ctx_r0.dataLoadStatus() ?? ctx_r0.ShopDataLoadStatusEnum.NOT_LOADED)("hasTargets", false);
60538
+ i0.ɵɵproperty("viewMode", ctx_r0.viewMode())("dataLoadStatus", ctx_r0.dataLoadStatus() ?? ctx_r0.ShopDataLoadStatusEnum.NOT_LOADED)("hasTargets", ctx_r0.hasCurrentYearTargets());
60530
60539
  i0.ɵɵadvance(2);
60531
60540
  i0.ɵɵproperty("viewMode", ctx_r0.viewMode())("funnelMetrics", ctx_r0.funnelMetrics() ?? i0.ɵɵpureFunction0(12, _c0$p))("mainUiData", ctx_r0.mainUiData())("trendUiData", ctx_r0.trendUiData())("shopId", ctx_r0.shopId())("pacingMetrics", ctx_r0.pacingResponse())("dataResults", ctx_r0.dataResults())("reverseCalculationResponse", ctx_r0.reverseCalculationResponse())("targets", ctx_r0.targets());
60532
60541
  } }
60533
- function SymphiqRevenueCalculatorDashboardComponent_Conditional_26_Template(rf, ctx) { if (rf & 1) {
60534
- i0.ɵɵelement(0, "symphiq-revenue-calculator-welcome-banner", 14);
60535
- i0.ɵɵelementStart(1, "div", 23)(2, "div", 24)(3, "div", 25);
60536
- i0.ɵɵnamespaceSVG();
60537
- i0.ɵɵelementStart(4, "svg", 26);
60538
- i0.ɵɵelement(5, "path", 27);
60539
- i0.ɵɵelementEnd()();
60540
- i0.ɵɵnamespaceHTML();
60541
- i0.ɵɵelementStart(6, "h3", 28);
60542
- i0.ɵɵtext(7, " Revenue Calculator Dashboard ");
60543
- i0.ɵɵelementEnd();
60544
- i0.ɵɵelementStart(8, "p", 29);
60545
- i0.ɵɵtext(9, " Your targets are set! The full revenue calculator dashboard with pacing and insights will be displayed here. ");
60546
- i0.ɵɵelementEnd()()();
60547
- } if (rf & 2) {
60548
- const ctx_r0 = i0.ɵɵnextContext();
60549
- i0.ɵɵproperty("viewMode", ctx_r0.viewMode())("dataLoadStatus", ctx_r0.dataLoadStatus() ?? ctx_r0.ShopDataLoadStatusEnum.NOT_LOADED)("hasTargets", true);
60550
- i0.ɵɵadvance();
60551
- i0.ɵɵproperty("ngClass", ctx_r0.placeholderContainerClasses());
60552
- i0.ɵɵadvance(3);
60553
- i0.ɵɵproperty("ngClass", ctx_r0.placeholderIconClasses());
60554
- i0.ɵɵadvance(2);
60555
- i0.ɵɵproperty("ngClass", ctx_r0.placeholderTitleClasses());
60556
- i0.ɵɵadvance(2);
60557
- i0.ɵɵproperty("ngClass", ctx_r0.placeholderTextClasses());
60558
- } }
60542
+ dayjs.extend(utc);
60559
60543
  class SymphiqRevenueCalculatorDashboardComponent {
60560
60544
  constructor() {
60561
60545
  this.viewMode = input(ViewModeEnum.LIGHT, ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
@@ -60699,10 +60683,20 @@ class SymphiqRevenueCalculatorDashboardComponent {
60699
60683
  ? 'text-slate-600'
60700
60684
  : 'text-slate-400';
60701
60685
  }
60686
+ onTargetsCreated(targets) {
60687
+ const startDate = dayjs().utc().startOf('year').toDate();
60688
+ const endDate = dayjs().utc().endOf('year').toDate();
60689
+ const targetsWithDates = targets.map(target => ({
60690
+ ...target,
60691
+ startDate,
60692
+ endDate
60693
+ }));
60694
+ this.targetsCreated.emit(targetsWithDates);
60695
+ }
60702
60696
  static { this.ɵfac = function SymphiqRevenueCalculatorDashboardComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SymphiqRevenueCalculatorDashboardComponent)(); }; }
60703
60697
  static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SymphiqRevenueCalculatorDashboardComponent, selectors: [["symphiq-revenue-calculator-dashboard"]], hostBindings: function SymphiqRevenueCalculatorDashboardComponent_HostBindings(rf, ctx) { if (rf & 1) {
60704
60698
  i0.ɵɵlistener("scroll", function SymphiqRevenueCalculatorDashboardComponent_scroll_HostBindingHandler($event) { return ctx.onWindowScroll($event); }, i0.ɵɵresolveWindow);
60705
- } }, inputs: { viewMode: [1, "viewMode"], isLoading: [1, "isLoading"], dataLoadStatus: [1, "dataLoadStatus"], targets: [1, "targets"], funnelMetrics: [1, "funnelMetrics"], mainUiData: [1, "mainUiData"], ytdComparisonUiData: [1, "ytdComparisonUiData"], trendUiData: [1, "trendUiData"], pacingResponse: [1, "pacingResponse"], dataResults: [1, "dataResults"], shopId: [1, "shopId"], embedded: [1, "embedded"], scrollEvent: [1, "scrollEvent"], scrollElement: [1, "scrollElement"], forDemo: [1, "forDemo"], maxAccessibleStepId: [1, "maxAccessibleStepId"], reverseCalculationResponse: [1, "reverseCalculationResponse"] }, outputs: { stepClick: "stepClick", nextStepClick: "nextStepClick", targetsCreated: "targetsCreated", calculateRevenueRequest: "calculateRevenueRequest" }, decls: 27, vars: 42, consts: [[3, "ngClass"], [1, "h-full", "transition-all", "duration-200", "ease-out", 3, "ngClass"], [1, "animated-bubbles", 2, "position", "fixed", "top", "0", "left", "0", "right", "0", "bottom", "0", "width", "100vw", "height", "100vh", "z-index", "1", "pointer-events", "none"], [1, "relative", "z-[51]"], [1, "sticky", "top-0", "z-50", 3, "ngClass"], [1, "transition-all", "duration-300", "ease-in-out", "overflow-hidden"], [1, "max-w-7xl", "mx-auto", "px-4", "sm:px-6", "lg:px-8", "py-8"], [1, "flex", "items-center", "justify-between"], [1, "max-w-7xl", "mx-auto", "px-4", "sm:px-6", "lg:px-8", "py-3"], [1, "flex-1", "min-w-0", "mr-4"], [3, "stepClick", "nextStepClick", "viewMode", "currentStepId", "showNextStepAction", "forDemo", "maxAccessibleStepId"], [1, "relative"], [1, "flex", "items-center", "justify-center", "min-h-[400px]"], ["size", "large", 3, "viewMode"], [3, "viewMode", "dataLoadStatus", "hasTargets"], [1, "mt-8", "rounded-2xl", "border", "shadow-lg", "overflow-hidden", 3, "ngClass"], [1, "px-8", "py-12", 3, "ngClass"], [1, "flex", "flex-col", "items-center", "text-center", "space-y-6"], [1, "space-y-2"], [1, "text-xl", "font-bold", 3, "ngClass"], [1, "text-sm", "max-w-md", 3, "ngClass"], [1, "mt-8"], [3, "targetsCreated", "calculateRevenueRequest", "viewMode", "funnelMetrics", "mainUiData", "trendUiData", "shopId", "pacingMetrics", "dataResults", "reverseCalculationResponse", "targets"], [1, "mt-8", "rounded-2xl", "border-2", "border-dashed", "p-12", 3, "ngClass"], [1, "text-center", "space-y-4"], [1, "flex", "justify-center"], ["fill", "none", "stroke", "currentColor", "viewBox", "0 0 24 24", 1, "w-16", "h-16", 3, "ngClass"], ["stroke-linecap", "round", "stroke-linejoin", "round", "stroke-width", "2", "d", "M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"], [1, "text-2xl", "font-bold", 3, "ngClass"], [1, "text-base", "max-w-2xl", "mx-auto", 3, "ngClass"]], template: function SymphiqRevenueCalculatorDashboardComponent_Template(rf, ctx) { if (rf & 1) {
60699
+ } }, inputs: { viewMode: [1, "viewMode"], isLoading: [1, "isLoading"], dataLoadStatus: [1, "dataLoadStatus"], targets: [1, "targets"], funnelMetrics: [1, "funnelMetrics"], mainUiData: [1, "mainUiData"], ytdComparisonUiData: [1, "ytdComparisonUiData"], trendUiData: [1, "trendUiData"], pacingResponse: [1, "pacingResponse"], dataResults: [1, "dataResults"], shopId: [1, "shopId"], embedded: [1, "embedded"], scrollEvent: [1, "scrollEvent"], scrollElement: [1, "scrollElement"], forDemo: [1, "forDemo"], maxAccessibleStepId: [1, "maxAccessibleStepId"], reverseCalculationResponse: [1, "reverseCalculationResponse"] }, outputs: { stepClick: "stepClick", nextStepClick: "nextStepClick", targetsCreated: "targetsCreated", calculateRevenueRequest: "calculateRevenueRequest" }, decls: 26, vars: 42, consts: [[3, "ngClass"], [1, "h-full", "transition-all", "duration-200", "ease-out", 3, "ngClass"], [1, "animated-bubbles", 2, "position", "fixed", "top", "0", "left", "0", "right", "0", "bottom", "0", "width", "100vw", "height", "100vh", "z-index", "1", "pointer-events", "none"], [1, "relative", "z-[51]"], [1, "sticky", "top-0", "z-50", 3, "ngClass"], [1, "transition-all", "duration-300", "ease-in-out", "overflow-hidden"], [1, "max-w-7xl", "mx-auto", "px-4", "sm:px-6", "lg:px-8", "py-8"], [1, "flex", "items-center", "justify-between"], [1, "max-w-7xl", "mx-auto", "px-4", "sm:px-6", "lg:px-8", "py-3"], [1, "flex-1", "min-w-0", "mr-4"], [3, "stepClick", "nextStepClick", "viewMode", "currentStepId", "showNextStepAction", "forDemo", "maxAccessibleStepId"], [1, "relative"], [1, "flex", "items-center", "justify-center", "min-h-[400px]"], ["size", "large", 3, "viewMode"], [3, "viewMode", "dataLoadStatus", "hasTargets"], [1, "mt-8", "rounded-2xl", "border", "shadow-lg", "overflow-hidden", 3, "ngClass"], [1, "px-8", "py-12", 3, "ngClass"], [1, "flex", "flex-col", "items-center", "text-center", "space-y-6"], [1, "space-y-2"], [1, "text-xl", "font-bold", 3, "ngClass"], [1, "text-sm", "max-w-md", 3, "ngClass"], [1, "mt-8"], [3, "targetsCreated", "calculateRevenueRequest", "viewMode", "funnelMetrics", "mainUiData", "trendUiData", "shopId", "pacingMetrics", "dataResults", "reverseCalculationResponse", "targets"]], template: function SymphiqRevenueCalculatorDashboardComponent_Template(rf, ctx) { if (rf & 1) {
60706
60700
  i0.ɵɵelementStart(0, "div", 0)(1, "div");
60707
60701
  i0.ɵɵelement(2, "div", 1);
60708
60702
  i0.ɵɵelementEnd();
@@ -60720,7 +60714,7 @@ class SymphiqRevenueCalculatorDashboardComponent {
60720
60714
  i0.ɵɵlistener("stepClick", function SymphiqRevenueCalculatorDashboardComponent_Template_symphiq_journey_progress_indicator_stepClick_20_listener($event) { return ctx.stepClick.emit($event); })("nextStepClick", function SymphiqRevenueCalculatorDashboardComponent_Template_symphiq_journey_progress_indicator_nextStepClick_20_listener() { return ctx.nextStepClick.emit(); });
60721
60715
  i0.ɵɵelementEnd();
60722
60716
  i0.ɵɵelementStart(21, "main", 11)(22, "div", 6);
60723
- i0.ɵɵconditionalCreate(23, SymphiqRevenueCalculatorDashboardComponent_Conditional_23_Template, 2, 1, "div", 12)(24, SymphiqRevenueCalculatorDashboardComponent_Conditional_24_Template, 10, 8)(25, SymphiqRevenueCalculatorDashboardComponent_Conditional_25_Template, 3, 13)(26, SymphiqRevenueCalculatorDashboardComponent_Conditional_26_Template, 10, 7);
60717
+ i0.ɵɵconditionalCreate(23, SymphiqRevenueCalculatorDashboardComponent_Conditional_23_Template, 2, 1, "div", 12)(24, SymphiqRevenueCalculatorDashboardComponent_Conditional_24_Template, 10, 8)(25, SymphiqRevenueCalculatorDashboardComponent_Conditional_25_Template, 3, 13);
60724
60718
  i0.ɵɵelementEnd()()()();
60725
60719
  } if (rf & 2) {
60726
60720
  i0.ɵɵproperty("ngClass", ctx.getContainerClasses());
@@ -60750,7 +60744,7 @@ class SymphiqRevenueCalculatorDashboardComponent {
60750
60744
  i0.ɵɵadvance(2);
60751
60745
  i0.ɵɵproperty("viewMode", ctx.viewMode())("currentStepId", ctx.JourneyStepIdEnum.REVENUE_CALCULATOR)("showNextStepAction", ctx.hasCurrentYearTargets())("forDemo", ctx.forDemo())("maxAccessibleStepId", ctx.maxAccessibleStepId());
60752
60746
  i0.ɵɵadvance(3);
60753
- i0.ɵɵconditional(ctx.isLoading() ? 23 : ctx.dataLoadStatus() !== ctx.ShopDataLoadStatusEnum.FULLY_LOADED ? 24 : !ctx.hasCurrentYearTargets() ? 25 : 26);
60747
+ i0.ɵɵconditional(ctx.isLoading() ? 23 : ctx.dataLoadStatus() !== ctx.ShopDataLoadStatusEnum.FULLY_LOADED ? 24 : 25);
60754
60748
  } }, dependencies: [CommonModule, i1$1.NgClass, JourneyProgressIndicatorComponent,
60755
60749
  RevenueCalculatorWelcomeBannerComponent,
60756
60750
  InitialTargetSettingComponent,
@@ -60888,12 +60882,12 @@ class SymphiqRevenueCalculatorDashboardComponent {
60888
60882
  </div>
60889
60883
  }
60890
60884
 
60891
- <!-- State 3a: Initial Target Setting (isLoading = false && dataLoadStatus === FULLY_LOADED && !hasCurrentYearTargets) -->
60892
- @else if (!hasCurrentYearTargets()) {
60885
+ <!-- State 3: Target Setting / Results (isLoading = false && dataLoadStatus === FULLY_LOADED) -->
60886
+ @else {
60893
60887
  <symphiq-revenue-calculator-welcome-banner
60894
60888
  [viewMode]="viewMode()"
60895
60889
  [dataLoadStatus]="dataLoadStatus() ?? ShopDataLoadStatusEnum.NOT_LOADED"
60896
- [hasTargets]="false"
60890
+ [hasTargets]="hasCurrentYearTargets()"
60897
60891
  />
60898
60892
 
60899
60893
  <div class="mt-8">
@@ -60907,41 +60901,12 @@ class SymphiqRevenueCalculatorDashboardComponent {
60907
60901
  [dataResults]="dataResults()"
60908
60902
  [reverseCalculationResponse]="reverseCalculationResponse()"
60909
60903
  [targets]="targets()"
60910
- (targetsCreated)="targetsCreated.emit($event)"
60904
+ (targetsCreated)="onTargetsCreated($event)"
60911
60905
  (calculateRevenueRequest)="calculateRevenueRequest.emit($event)"
60912
60906
  />
60913
60907
  </div>
60914
60908
  }
60915
60909
 
60916
- <!-- State 3b: Final Dashboard (isLoading = false && dataLoadStatus === FULLY_LOADED && hasCurrentYearTargets) -->
60917
- @else {
60918
- <symphiq-revenue-calculator-welcome-banner
60919
- [viewMode]="viewMode()"
60920
- [dataLoadStatus]="dataLoadStatus() ?? ShopDataLoadStatusEnum.NOT_LOADED"
60921
- [hasTargets]="true"
60922
- />
60923
-
60924
- <!-- Placeholder for Revenue Calculator Content -->
60925
- <div [ngClass]="placeholderContainerClasses()" class="mt-8 rounded-2xl border-2 border-dashed p-12">
60926
- <div class="text-center space-y-4">
60927
- <div class="flex justify-center">
60928
- <svg [ngClass]="placeholderIconClasses()" class="w-16 h-16" fill="none" stroke="currentColor"
60929
- viewBox="0 0 24 24">
60930
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
60931
- d="M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
60932
- </svg>
60933
- </div>
60934
- <h3 [ngClass]="placeholderTitleClasses()" class="text-2xl font-bold">
60935
- Revenue Calculator Dashboard
60936
- </h3>
60937
- <p [ngClass]="placeholderTextClasses()" class="text-base max-w-2xl mx-auto">
60938
- Your targets are set! The full revenue calculator dashboard with pacing and insights will be
60939
- displayed here.
60940
- </p>
60941
- </div>
60942
- </div>
60943
- }
60944
-
60945
60910
  </div>
60946
60911
  </main>
60947
60912
  </div>
@@ -60952,7 +60917,7 @@ class SymphiqRevenueCalculatorDashboardComponent {
60952
60917
  type: HostListener,
60953
60918
  args: ['window:scroll', ['$event']]
60954
60919
  }] }); })();
60955
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SymphiqRevenueCalculatorDashboardComponent, { className: "SymphiqRevenueCalculatorDashboardComponent", filePath: "lib/components/revenue-calculator-dashboard/symphiq-revenue-calculator-dashboard.component.ts", lineNumber: 223 }); })();
60920
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SymphiqRevenueCalculatorDashboardComponent, { className: "SymphiqRevenueCalculatorDashboardComponent", filePath: "lib/components/revenue-calculator-dashboard/symphiq-revenue-calculator-dashboard.component.ts", lineNumber: 198 }); })();
60956
60921
 
60957
60922
  function HierarchyDisplayComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
60958
60923
  i0.ɵɵelementStart(0, "div", 1)(1, "div", 1);