@saasquatch/mint-components 1.6.14-5 → 1.6.14

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 (26) hide show
  1. package/dist/cjs/{ShadowViewAddon-b081d461.js → ShadowViewAddon-daece805.js} +51 -0
  2. package/dist/cjs/sqm-big-stat_39.cjs.entry.js +1 -1
  3. package/dist/cjs/sqm-stencilbook.cjs.entry.js +6 -2
  4. package/dist/collection/components/sqm-big-stat/UseBigStat.stories.js +2 -0
  5. package/dist/collection/components/sqm-big-stat/useBigStat.js +51 -0
  6. package/dist/esm/{ShadowViewAddon-a129a634.js → ShadowViewAddon-fdb8f6a9.js} +51 -0
  7. package/dist/esm/sqm-big-stat_39.entry.js +1 -1
  8. package/dist/esm/sqm-stencilbook.entry.js +6 -2
  9. package/dist/esm-es5/ShadowViewAddon-fdb8f6a9.js +1 -0
  10. package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
  11. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  12. package/dist/mint-components/mint-components.esm.js +1 -1
  13. package/dist/mint-components/{p-055add0d.system.entry.js → p-1f52e4ec.system.entry.js} +1 -1
  14. package/dist/mint-components/{p-6ce7b475.entry.js → p-36754aa0.entry.js} +1 -1
  15. package/dist/mint-components/p-3761c4e4.system.entry.js +1 -0
  16. package/dist/mint-components/{p-1a9be810.entry.js → p-39f29587.entry.js} +2 -2
  17. package/dist/mint-components/p-c3dd8944.system.js +1 -1
  18. package/dist/mint-components/p-cf9920b0.system.js +1 -0
  19. package/dist/mint-components/p-dd02e205.js +347 -0
  20. package/dist/types/components/sqm-big-stat/UseBigStat.stories.d.ts +12 -0
  21. package/docs/docs.docx +0 -0
  22. package/package.json +1 -1
  23. package/dist/esm-es5/ShadowViewAddon-a129a634.js +0 -1
  24. package/dist/mint-components/p-218403c4.system.entry.js +0 -1
  25. package/dist/mint-components/p-63fb4a0a.system.js +0 -1
  26. package/dist/mint-components/p-a8a2ec9d.js +0 -320
@@ -1111,6 +1111,49 @@ _, global = "") => {
1111
1111
  });
1112
1112
  });
1113
1113
  };
1114
+ const rewardsPendingQuery = (programId, locale, type, unit, global = "") => {
1115
+ return debugQuery(index_module.dist.gql `
1116
+ query (
1117
+ $programId: ID
1118
+ $type: RewardType
1119
+ $unit: String!
1120
+ $locale: RSLocale
1121
+ ) {
1122
+ fallback: formatRewardPrettyValue(
1123
+ value: 0
1124
+ unit: $unit
1125
+ locale: $locale
1126
+ formatType: UNIT_FORMATTED
1127
+ )
1128
+ viewer: viewer {
1129
+ ... on User {
1130
+ rewardBalanceDetails(
1131
+ programId: $programId
1132
+ filter: { type_eq: $type, unit_eq: $unit }
1133
+ locale: $locale
1134
+ ) {
1135
+ ... on CreditRewardBalance {
1136
+ prettyPendingCredit
1137
+ }
1138
+ }
1139
+ }
1140
+ }
1141
+ }
1142
+ `, {
1143
+ programId: !global && programId !== "classic" ? programId : null,
1144
+ type,
1145
+ unit,
1146
+ locale,
1147
+ }, (res) => {
1148
+ var _a, _b, _c, _d, _e;
1149
+ const arr = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.rewardBalanceDetails;
1150
+ const fallback = (_c = res.data) === null || _c === void 0 ? void 0 : _c.fallback;
1151
+ return {
1152
+ value: ((_d = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _d === void 0 ? void 0 : _d.prettyPendingCredit) || 0,
1153
+ statvalue: ((_e = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _e === void 0 ? void 0 : _e.prettyPendingCredit) || fallback,
1154
+ };
1155
+ });
1156
+ };
1114
1157
  const rewardsRedeemedQuery = (programId, locale, type, unit, global = "") => {
1115
1158
  return debugQuery(index_module.dist.gql `
1116
1159
  query (
@@ -1435,6 +1478,10 @@ const queries = {
1435
1478
  label: "Rewards Earned",
1436
1479
  query: rewardsAssignedQuery,
1437
1480
  },
1481
+ rewardsPending: {
1482
+ label: "Rewards Pending",
1483
+ query: rewardsPendingQuery,
1484
+ },
1438
1485
  rewardsRedeemed: {
1439
1486
  label: "Rewards Paid",
1440
1487
  query: rewardsRedeemedQuery,
@@ -1522,6 +1569,10 @@ const StatPaths = [
1522
1569
  name: "rewardsAssigned",
1523
1570
  route: "/(rewardsAssigned)/:statType/:unit/:global?",
1524
1571
  },
1572
+ {
1573
+ name: "rewardsPending",
1574
+ route: "/(rewardsPending)/:statType/:unit/:global?",
1575
+ },
1525
1576
  {
1526
1577
  name: "rewardsRedeemed",
1527
1578
  route: "/(rewardsRedeemed)/:statType/:unit/:global?",
@@ -17,7 +17,7 @@ const utils = require('./utils-6847bc06.js');
17
17
  require('./sqm-text-span-view-8a7b98d0.js');
18
18
  const useRegistrationFormState = require('./useRegistrationFormState-7e9641c4.js');
19
19
  const AsYouType = require('./AsYouType-6788393a.js');
20
- const ShadowViewAddon = require('./ShadowViewAddon-b081d461.js');
20
+ const ShadowViewAddon = require('./ShadowViewAddon-daece805.js');
21
21
  require('./sqm-portal-container-view-3ebf55a7.js');
22
22
 
23
23
  const BigStat = class {
@@ -26,7 +26,7 @@ const sqmPortalForgotPasswordView = require('./sqm-portal-forgot-password-view-9
26
26
  const sqmPortalProfileView = require('./sqm-portal-profile-view-28176f3e.js');
27
27
  const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-4a03d26a.js');
28
28
  const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-fb3bbf7b.js');
29
- const ShadowViewAddon = require('./ShadowViewAddon-b081d461.js');
29
+ const ShadowViewAddon = require('./ShadowViewAddon-daece805.js');
30
30
  const sqmPortalContainerView = require('./sqm-portal-container-view-3ebf55a7.js');
31
31
 
32
32
  /**
@@ -1706,7 +1706,7 @@ const ShareLink = /*#__PURE__*/Object.freeze({
1706
1706
  FullStack: FullStack
1707
1707
  });
1708
1708
 
1709
- const scenario$3 = "@author:sam\r\n@owner:sam\r\nFeature: Big Stat\r\n\r\n Big stat is a component for displaying a statistic as a large number with a label\r\n\r\n @minutia\r\n Scenario: Demo hook retrieves label using stat pattern\r\n Given isDemo() returns true\r\n And the component renders with props:\r\n | type |\r\n | /referralsCount |\r\n Then the label is: \"REFERRALS - COUNT\"\r\n And the value is: \"12345\"\r\n\r\n @minutia\r\n Scenario: Demo hook falls back to default label on invalid path\r\n Given isDemo() returns true\r\n And the component renders with props:\r\n | type |\r\n | a bad path |\r\n Then the label is: \"Demo Label\"\r\n And the value is: \"12345\"\r\n\r\n @motivating\r\n Scenario: Displays error on unrecognized path\r\n Given isDemo() returns false\r\n And the component renders with props:\r\n | type |\r\n | /(doesNotExistNopeNotHere) |\r\n Then the label is: \"BAD PROP TYPE\"\r\n And the value is: \"!!!\"\r\n\r\n @motivating\r\n Scenario Outline: Label displays correctly\r\n Given the type prop is set to <type>\r\n When the component renders\r\n Then the label is <label>\r\n Given isDemo() returns true\r\n When the component renders\r\n Then the label is <inferredLabel>\r\n Examples:\r\n | path | label | inferredLabel |\r\n | rewardsAssigned | Rewards Earned | Rewards Assigned |\r\n | rewardsRedeemed | Rewards Paid | Rewards Redeemed |\r\n | rewardsAvailable | Rewards Available | Rewards Available |\r\n | referralsCount | Referrals - Count | Referrals Count |\r\n | referralsMonth | Referrals - This Month | Referrals Month |\r\n | referralsWeek | Referrals - This Week | Referrals Week |\r\n | rewardsCount | Rewards - Count | Rewards Count |\r\n | rewardsMonth | Rewards - This Month | Rewards Month |\r\n | rewardsWeek | Rewards - This Week | Rewards Week |\r\n | rewardBalance | Balance - Credit Earned | Reward Balance |\r\n | customField | Custom Fields | Custom Fields |\r\n | programGoals | Program Goals | Program Goals |\r\n\r\n @motivating\r\n Scenario: Display user's credit\r\n Given isDemo() returns false\r\n And the user has earned 34 COFFEE from the program\r\n And the component renders with props:\r\n | type |\r\n | /rewardBalance/CREDIT/COFFEE/prettyValue |\r\n Then the label is: \"Balance - Credit Earned\"\r\n And the value is: \"34 COFFEE\"\r\n\r\n @minutia\r\n Scenario: Memoizes most recent query\r\n Given isDemo() returns false\r\n And the component's type prop is set to a variable named PATH\r\n And PATH is \"/referralsWeek\"\r\n Then the component shows a loading state before showing the result\r\n When the component reloads given some external reload\r\n Then the component doesn't show a loading state\r\n When PATH is set to \"/rewardsWeek\"\r\n Then the component shows a loading state before showing the result\r\n When PATH is set to \"/referralsWeek\"\r\n Then the component shows a loading state before showing the result\r\n\r\n @motivating\r\n Scenario: Stat has a loading state\r\n Given isDemo() returns false\r\n And the component's stat type prop is valid\r\n When the component renders\r\n Then The stat value displays \"...\"\r\n And when the stat query is completed\r\n And the stat value displays a value\r\n\r\n @motivating\r\n Scenario Outline: Program Goal stat requires metricType and goalId\r\n Given the statType prop is <statType>\r\n When the component renders\r\n Then the label is <label>\r\n And the stat value is <InvalidStatValue>\r\n Examples:\r\n | statType | label | InvalidStatValue |\r\n | /programGoals | BAD PROP TYPE | true |\r\n | /programGoals/count | BAD PROP TYPE | true |\r\n | /programGoals/conversionCount | BAD PROP TYPE | true |\r\n | /programGoals/My-Goal | BAD PROP TYPE | true |\r\n | /programGoals/count/My-Goal | Program Goals | false |\r\n | /programGoals/conversionCount/My-Goal | Program Goals | false |\r\n\r\n @motivating\r\n Scenario Outline: rewardCountFiltered supports many formats\r\n Given the statType begins with \"/rewardCountFiltered\"\r\n When the component renders with <statType>\r\n Then the stat <mayRender> a value\r\n Examples:\r\n | statType | mayRender |\r\n | /rewardsCountFiltered | renders |\r\n | /rewardsCountFiltered/COFFEE | doesn't render |\r\n | /rewardsCountFiltered/global | renders |\r\n | /rewardsCountFiltered/INTEGRATION | renders |\r\n | /rewardsCountFiltered/INTEGRATION/global | renders |\r\n | /rewardsCountFiltered/PCT_DISCOUNT | renders |\r\n | /rewardsCountFiltered/PCT_DISCOUNT/global | renders |\r\n | /rewardsCountFiltered/CREDIT | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE | renders |\r\n | /rewardsCountFiltered/CREDIT/global | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE/PENDING | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE/AVAILABLE | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/global | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/PENDING | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/PENDING/global | renders |\r\n\r\n @motivating\r\n Scenario Outline: Program Goals and Reward units with currencies must be encoded\r\n Given the statType is <statType>\r\n When the stat is queried\r\n Then the stat is filtered by <decodedFilter>\r\n And a value <mayBe> rendered\r\n Examples:\r\n | statType | decodedFilter | may |\r\n | /rewardBalance/CREDIT/COFFEE | COFFEE | is |\r\n | /rewardBalance/CREDIT/CENTS | CENTS | is |\r\n | /rewardBalance/CREDIT/COFFEE%2FUSD | COFFEE/USD | is |\r\n | /rewardBalance/CREDIT/COFFEE/USD | COFFEE | is |\r\n | /rewardBalance/CREDIT/CASH | CASH | is |\r\n | /rewardBalance/CREDIT/CASH/USD | CASH | is |\r\n | /rewardBalance/CREDIT/CASH%2FUSD | CASH/USD | is |\r\n | /programGoals/count/My-Goal | My-Goal | is |\r\n | /programGoals/count/My-Goal/referrals | | isn't |\r\n | /programGoals/count/My-Goal%2Freferrals | My-Goal/referrals | is |\r\n\r\n @motivating\r\n Scenario Outline: User custom fields can be queried\r\n Given the StatType is <statType>\r\n When the stat is queried\r\n Then the value matches that of the users <customField>\r\n Examples:\r\n | statType | customField |\r\n | /customFields/videosShared | videosShared |\r\n | /customFields/totalPurchaseCount | totalPurchaseCount |\r\n\r\n @motivating\r\n Scenario Outline: Some stats can use a global value instead of filtered by program\r\n Given the stat <statName>\r\n Then the global value <mayBe> available\r\n Examples:\r\n | statName | mayBe |\r\n | referralsCount | isn't |\r\n | referralsMonth | isn't |\r\n | referralsWeek | isn't |\r\n | rewardsCount | is |\r\n | rewardsCountFiltered | is |\r\n | integrationRewardsCountFiltered | is |\r\n | rewardsMonth | is |\r\n | rewardsWeek | is |\r\n | rewardsAssigned | is |\r\n | rewardsRedeemed | is |\r\n | rewardsAvailable | is |\r\n | rewardBalance | is |\r\n\r\n @motivating\r\n Scenario Outline: referralsCount stat can be filtered by Converted and Started\r\n Given statType prop is <statType>\r\n Then the stat returned has a <filter>\r\n Examples:\r\n | statType | filter |\r\n | /referralsCount | { programId_eq: programId } |\r\n | /referralsCount/converted | { programId_eq: programId, dateConverted_exists: true } |\r\n | /referralsCount/started | { programId_eq: programId, dateConverted_exists: false } |\r\n\r\n @motivating\r\n Scenario: Program context is used by default to source the programId used for queries\r\n Given a valid \"statType\"\r\n And its not a global stat\r\n And the stat is loaded in an environment for \"program-a\"\r\n And the \"program-id\" prop is not used\r\n When the stat is queried\r\n Then the query is filtered by \"{ programId_eq: 'program-a' }\"\r\n And only results from \"program-a\" are returned\r\n\r\n @motivating\r\n Scenario Outline: ProgramId can be specified to overwrite the program context default\r\n Given a valid \"statType\"\r\n And its not a global stat\r\n And the \"program-id\" prop has <value>\r\n When the stat is queried\r\n Then the query has a <filter>\r\n And only results from <value> are returned\r\n Examples:\r\n | value | filter |\r\n | program-b | { programId_eq: \"program-b\" } |\r\n | program-c | { programId_eq: \"program-c\" } |";
1709
+ const scenario$3 = "@author:sam\r\n@owner:sam\r\nFeature: Big Stat\r\n\r\n Big stat is a component for displaying a statistic as a large number with a label\r\n\r\n @minutia\r\n Scenario: Demo hook retrieves label using stat pattern\r\n Given isDemo() returns true\r\n And the component renders with props:\r\n | type |\r\n | /referralsCount |\r\n Then the label is: \"REFERRALS - COUNT\"\r\n And the value is: \"12345\"\r\n\r\n @minutia\r\n Scenario: Demo hook falls back to default label on invalid path\r\n Given isDemo() returns true\r\n And the component renders with props:\r\n | type |\r\n | a bad path |\r\n Then the label is: \"Demo Label\"\r\n And the value is: \"12345\"\r\n\r\n @motivating\r\n Scenario: Displays error on unrecognized path\r\n Given isDemo() returns false\r\n And the component renders with props:\r\n | type |\r\n | /(doesNotExistNopeNotHere) |\r\n Then the label is: \"BAD PROP TYPE\"\r\n And the value is: \"!!!\"\r\n\r\n @motivating\r\n Scenario Outline: Label displays correctly\r\n Given the type prop is set to <type>\r\n When the component renders\r\n Then the label is <label>\r\n Given isDemo() returns true\r\n When the component renders\r\n Then the label is <inferredLabel>\r\n Examples:\r\n | path | label | inferredLabel |\r\n | rewardsAssigned | Rewards Earned | Rewards Assigned |\r\n | rewardsRedeemed | Rewards Paid | Rewards Redeemed |\r\n | rewardsAvailable | Rewards Available | Rewards Available |\r\n | referralsCount | Referrals - Count | Referrals Count |\r\n | referralsMonth | Referrals - This Month | Referrals Month |\r\n | referralsWeek | Referrals - This Week | Referrals Week |\r\n | rewardsCount | Rewards - Count | Rewards Count |\r\n | rewardsMonth | Rewards - This Month | Rewards Month |\r\n | rewardsWeek | Rewards - This Week | Rewards Week |\r\n | rewardBalance | Balance - Credit Earned | Reward Balance |\r\n | customField | Custom Fields | Custom Fields |\r\n | programGoals | Program Goals | Program Goals |\r\n\r\n @motivating\r\n Scenario: Display user's credit\r\n Given isDemo() returns false\r\n And the user has earned 34 COFFEE from the program\r\n And the component renders with props:\r\n | type |\r\n | /rewardBalance/CREDIT/COFFEE/prettyValue |\r\n Then the label is: \"Balance - Credit Earned\"\r\n And the value is: \"34 COFFEE\"\r\n\r\n @minutia\r\n Scenario: Memoizes most recent query\r\n Given isDemo() returns false\r\n And the component's type prop is set to a variable named PATH\r\n And PATH is \"/referralsWeek\"\r\n Then the component shows a loading state before showing the result\r\n When the component reloads given some external reload\r\n Then the component doesn't show a loading state\r\n When PATH is set to \"/rewardsWeek\"\r\n Then the component shows a loading state before showing the result\r\n When PATH is set to \"/referralsWeek\"\r\n Then the component shows a loading state before showing the result\r\n\r\n @motivating\r\n Scenario: Stat has a loading state\r\n Given isDemo() returns false\r\n And the component's stat type prop is valid\r\n When the component renders\r\n Then The stat value displays \"...\"\r\n And when the stat query is completed\r\n And the stat value displays a value\r\n\r\n @motivating\r\n Scenario Outline: Program Goal stat requires metricType and goalId\r\n Given the statType prop is <statType>\r\n When the component renders\r\n Then the label is <label>\r\n And the stat value is <InvalidStatValue>\r\n Examples:\r\n | statType | label | InvalidStatValue |\r\n | /programGoals | BAD PROP TYPE | true |\r\n | /programGoals/count | BAD PROP TYPE | true |\r\n | /programGoals/conversionCount | BAD PROP TYPE | true |\r\n | /programGoals/My-Goal | BAD PROP TYPE | true |\r\n | /programGoals/count/My-Goal | Program Goals | false |\r\n | /programGoals/conversionCount/My-Goal | Program Goals | false |\r\n\r\n @motivating\r\n Scenario Outline: rewardCountFiltered supports many formats\r\n Given the statType begins with \"/rewardCountFiltered\"\r\n When the component renders with <statType>\r\n Then the stat <mayRender> a value\r\n Examples:\r\n | statType | mayRender |\r\n | /rewardsCountFiltered | renders |\r\n | /rewardsCountFiltered/COFFEE | doesn't render |\r\n | /rewardsCountFiltered/global | renders |\r\n | /rewardsCountFiltered/INTEGRATION | renders |\r\n | /rewardsCountFiltered/INTEGRATION/global | renders |\r\n | /rewardsCountFiltered/PCT_DISCOUNT | renders |\r\n | /rewardsCountFiltered/PCT_DISCOUNT/global | renders |\r\n | /rewardsCountFiltered/CREDIT | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE | renders |\r\n | /rewardsCountFiltered/CREDIT/global | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE/PENDING | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE/AVAILABLE | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/global | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/PENDING | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/PENDING/global | renders |\r\n\r\n @motivating\r\n Scenario Outline: Program Goals and Reward units with currencies must be encoded\r\n Given the statType is <statType>\r\n When the stat is queried\r\n Then the stat is filtered by <decodedFilter>\r\n And a value <mayBe> rendered\r\n Examples:\r\n | statType | decodedFilter | may |\r\n | /rewardBalance/CREDIT/COFFEE | COFFEE | is |\r\n | /rewardBalance/CREDIT/CENTS | CENTS | is |\r\n | /rewardBalance/CREDIT/COFFEE%2FUSD | COFFEE/USD | is |\r\n | /rewardBalance/CREDIT/COFFEE/USD | COFFEE | is |\r\n | /rewardBalance/CREDIT/CASH | CASH | is |\r\n | /rewardBalance/CREDIT/CASH/USD | CASH | is |\r\n | /rewardBalance/CREDIT/CASH%2FUSD | CASH/USD | is |\r\n | /programGoals/count/My-Goal | My-Goal | is |\r\n | /programGoals/count/My-Goal/referrals | | isn't |\r\n | /programGoals/count/My-Goal%2Freferrals | My-Goal/referrals | is |\r\n\r\n @motivating\r\n Scenario Outline: User custom fields can be queried\r\n Given the StatType is <statType>\r\n When the stat is queried\r\n Then the value matches that of the users <customField>\r\n Examples:\r\n | statType | customField |\r\n | /customFields/videosShared | videosShared |\r\n | /customFields/totalPurchaseCount | totalPurchaseCount |\r\n\r\n @motivating\r\n Scenario Outline: Some stats can use a global value instead of filtered by program\r\n Given the stat <statName>\r\n Then the global value <mayBe> available\r\n Examples:\r\n | statName | mayBe |\r\n | referralsCount | isn't |\r\n | referralsMonth | isn't |\r\n | referralsWeek | isn't |\r\n | rewardsCount | is |\r\n | rewardsCountFiltered | is |\r\n | integrationRewardsCountFiltered | is |\r\n | rewardsMonth | is |\r\n | rewardsWeek | is |\r\n | rewardsAssigned | is |\r\n | rewardsRedeemed | is |\r\n | rewardsRedeemedWeek | is |\r\n | rewardsRedeemedMonth | is |\r\n | rewardsPending | is |\r\n | rewardsAvailable | is |\r\n | rewardBalance | is |\r\n\r\n @motivating\r\n Scenario Outline: referralsCount stat can be filtered by Converted and Started\r\n Given statType prop is <statType>\r\n Then the stat returned has a <filter>\r\n Examples:\r\n | statType | filter |\r\n | /referralsCount | { programId_eq: programId } |\r\n | /referralsCount/converted | { programId_eq: programId, dateConverted_exists: true } |\r\n | /referralsCount/started | { programId_eq: programId, dateConverted_exists: false } |\r\n\r\n @motivating\r\n Scenario: Program context is used by default to source the programId used for queries\r\n Given a valid \"statType\"\r\n And its not a global stat\r\n And the stat is loaded in an environment for \"program-a\"\r\n And the \"program-id\" prop is not used\r\n When the stat is queried\r\n Then the query is filtered by \"{ programId_eq: 'program-a' }\"\r\n And only results from \"program-a\" are returned\r\n\r\n @motivating\r\n Scenario Outline: ProgramId can be specified to overwrite the program context default\r\n Given a valid \"statType\"\r\n And its not a global stat\r\n And the \"program-id\" prop has <value>\r\n When the stat is queried\r\n Then the query has a <filter>\r\n And only results from <value> are returned\r\n Examples:\r\n | value | filter |\r\n | program-b | { programId_eq: \"program-b\" } |\r\n | program-c | { programId_eq: \"program-c\" } |\r\n\r\n\r\n @motivating\r\n Scenario: \"/rewardsReedemedWeek\" stat shows rewards that have been redeemed this week\r\n Given a user reeemed the following rewards\r\n | reward | dateRedeemed | programId |\r\n | $1.00 USD | 2023-08-18 | A |\r\n | $1.00 CAD | 2023-08-18 | A |\r\n | $1.00 AUD | 2023-08-18 | A |\r\n | $1.00 USD | 2023-08-10 | A |\r\n | $20.00 USD | 2023-08-18 | B |\r\n | $20.00 CAD | 2023-08-18 | B |\r\n | $20.00 AUD | 2023-08-18 | B |\r\n | $20.00 USD | 2023-08-01 | B |\r\n | $20.00 GBP | 2023-08-01 | B |\r\n | $20.00 GBP | 2023-08-20 | |\r\n And the current date is \"2023-08-22\"\r\n And the program of the stat is <programId>\r\n And the statType is <statType>\r\n Then the stat displays <statValue>\r\n | programId | statType | statValue |\r\n | A | /rewardsReedemedWeek/CREDIT/USD | USD1.00 |\r\n | A | /rewardsReedemedWeek/CREDIT/CAD | CAD1.00 |\r\n | A | /rewardsReedemedWeek/CREDIT/AUD | AUD1.00 |\r\n | B | /rewardsReedemedWeek/CREDIT/USD | USD20.00 |\r\n | B | /rewardsReedemedWeek/CREDIT/CAD | CAD20.00 |\r\n | B | /rewardsReedemedWeek/CREDIT/AUD | AUD20.00 |\r\n | N/A | /rewardsReedemedWeek/CREDIT/USD/global | USD21.00 |\r\n | N/A | /rewardsReedemedWeek/CREDIT/CAD/global | CAD21.00 |\r\n | N/A | /rewardsReedemedWeek/CREDIT/GBP/global | GBP20.00 |\r\n\r\n @motivating\r\n Scenario: \"/rewardsReedemedMonth\" stat shows rewards that have been redeemed this month\r\n Given a user reeemed the following rewards\r\n | reward | dateRedeemed | programId |\r\n | $1.00 USD | 2023-08-18 | A |\r\n | $1.00 CAD | 2023-08-18 | A |\r\n | $1.00 AUD | 2023-08-18 | A |\r\n | $1.00 USD | 2023-07-31 | A |\r\n | $20.00 USD | 2023-08-18 | B |\r\n | $20.00 CAD | 2023-08-18 | B |\r\n | $20.00 AUD | 2023-08-18 | B |\r\n | $20.00 USD | 2023-08-01 | B |\r\n | $20.00 GBP | 2023-08-01 | B |\r\n | $20.00 GBP | 2023-08-20 | |\r\n | $20.00 GBP | 2023-07-31 | |\r\n And the current date is \"2023-08-22\"\r\n And the program of the stat is <programId>\r\n And the statType is <statType>\r\n Then the stat displays <statValue>\r\n | programId | statType | statValue |\r\n | A | /rewardsReedemedMonth/CREDIT/USD | USD1.00 |\r\n | A | /rewardsReedemedMonth/CREDIT/CAD | CAD1.00 |\r\n | A | /rewardsReedemedMonth/CREDIT/AUD | AUD1.00 |\r\n | B | /rewardsReedemedMonth/CREDIT/USD | USD20.00 |\r\n | B | /rewardsReedemedMonth/CREDIT/CAD | CAD20.00 |\r\n | B | /rewardsReedemedMonth/CREDIT/AUD | AUD20.00 |\r\n | N/A | /rewardsReedemedMonth/CREDIT/USD/global | USD41.00 |\r\n | N/A | /rewardsReedemedMonth/CREDIT/CAD/global | CAD21.00 |\r\n | N/A | /rewardsReedemedMonth/CREDIT/GBP/global | GBP40.00 |\r\n\r\n\r\n @landmine\r\n Scenario Outline: Rewards redeemed by week and month stats only include rewards that have been fully redeemed\r\n Given statType prop is <statType>\r\n And the user has fully redeemed a $50.00 USD reward\r\n And the user has redeemed <amountRedeemed> of a $50.00 USD reward\r\n Then the stat displays <statValue>\r\n Examples:\r\n | statType | amountRedeemed | statValue |\r\n | /rewardsRedeemed/CREDIT/USD/global | $0.00 | $50.00 |\r\n | /rewardsRedeemedWeek/CREDIT/USD/global | $0.00 | $50.00 |\r\n | /rewardsRedeemedMonth/CREDIT/USD/global | $0.00 | $50.00 |\r\n | /rewardsRedeemed/CREDIT/USD/global | $25.00 | $75.00 |\r\n | /rewardsRedeemedWeek/CREDIT/USD/global | $25.00 | $50.00 |\r\n | /rewardsRedeemedMonth/CREDIT/USD/global | $25.00 | $50.00 |\r\n | /rewardsRedeemed/CREDIT/USD/global | $50.00 | $100.00 |\r\n | /rewardsRedeemedWeek/CREDIT/USD/global | $50.00 | $100.00 |\r\n | /rewardsRedeemedMonth/CREDIT/USD/global | $50.00 | $100.00 |\r\n\r\n @landmine\r\n Scenario Outline: Rewards redeemed by week and month stats can only count up to 1000 redeemed rewards during the period\r\n Given statType prop is <statType>\r\n And the user has fully redeemed 1001 $1.00 USD rewards in the past <timeframe>\r\n Then the stat displays <statValue>\r\n Examples:\r\n | statType | timeframe | statValue |\r\n | /rewardsRedeemed/CREDIT/USD/global | N/A | $1001.00 |\r\n | /rewardsRedeemedWeek/CREDIT/USD/global | week | $1000.00 |\r\n | /rewardsRedeemedMonth/CREDIT/USD/global | month | $1000.00 |\r\n";
1710
1710
 
1711
1711
  const BigStat_stories = {
1712
1712
  title: "Components/Big Stat",
@@ -2909,6 +2909,8 @@ const RewardsMonth = createHookStory(() => View("/rewardsMonth", "/(rewardsMonth
2909
2909
  const RewardsWeek = createHookStory(() => View("/rewardsWeek", "/(rewardsWeek)/:global?"));
2910
2910
  const RewardsAssigned = createHookStory(() => View("/rewardsAssigned/CREDIT/COFFEE", "/(rewardsAssigned)/:statType/:unit/:global?"));
2911
2911
  const RewardsAssignedCashUSD = createHookStory(() => View("/rewardsAssigned/CREDIT/CASH%2FUSD", "/(rewardsAssigned)/:statType/:unit/:global?"));
2912
+ const RewardsPending = createHookStory(() => View("/rewardsPending/CREDIT/USD", "/(rewardsPending)/:statType/:unit/:global?"));
2913
+ const RewardsPendingGlobal = createHookStory(() => View("/rewardsPending/CREDIT/USD/global", "/(rewardsPending)/:statType/:unit/:global?"));
2912
2914
  const RewardsRedeemed = createHookStory(() => View("/rewardsRedeemed/CREDIT/USD", "/(rewardsRedeemed)/:statType/:unit/:global?"));
2913
2915
  const RewardsRedeemedWeek = createHookStory(() => View("/rewardsRedeemedWeek/CREDIT/USD", "/(rewardsRedeemedWeek)/:statType/:unit/:global?"));
2914
2916
  const RewardsRedeemedMonth = createHookStory(() => View("/rewardsRedeemedMonth/CREDIT/USD", "/(rewardsRedeemedMonth)/:statType/:unit/:global?"));
@@ -2967,6 +2969,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
2967
2969
  RewardsWeek: RewardsWeek,
2968
2970
  RewardsAssigned: RewardsAssigned,
2969
2971
  RewardsAssignedCashUSD: RewardsAssignedCashUSD,
2972
+ RewardsPending: RewardsPending,
2973
+ RewardsPendingGlobal: RewardsPendingGlobal,
2970
2974
  RewardsRedeemed: RewardsRedeemed,
2971
2975
  RewardsRedeemedWeek: RewardsRedeemedWeek,
2972
2976
  RewardsRedeemedMonth: RewardsRedeemedMonth,
@@ -84,6 +84,8 @@ export const RewardsMonth = createHookStory(() => View("/rewardsMonth", "/(rewar
84
84
  export const RewardsWeek = createHookStory(() => View("/rewardsWeek", "/(rewardsWeek)/:global?"));
85
85
  export const RewardsAssigned = createHookStory(() => View("/rewardsAssigned/CREDIT/COFFEE", "/(rewardsAssigned)/:statType/:unit/:global?"));
86
86
  export const RewardsAssignedCashUSD = createHookStory(() => View("/rewardsAssigned/CREDIT/CASH%2FUSD", "/(rewardsAssigned)/:statType/:unit/:global?"));
87
+ export const RewardsPending = createHookStory(() => View("/rewardsPending/CREDIT/USD", "/(rewardsPending)/:statType/:unit/:global?"));
88
+ export const RewardsPendingGlobal = createHookStory(() => View("/rewardsPending/CREDIT/USD/global", "/(rewardsPending)/:statType/:unit/:global?"));
87
89
  export const RewardsRedeemed = createHookStory(() => View("/rewardsRedeemed/CREDIT/USD", "/(rewardsRedeemed)/:statType/:unit/:global?"));
88
90
  export const RewardsRedeemedWeek = createHookStory(() => View("/rewardsRedeemedWeek/CREDIT/USD", "/(rewardsRedeemedWeek)/:statType/:unit/:global?"));
89
91
  export const RewardsRedeemedMonth = createHookStory(() => View("/rewardsRedeemedMonth/CREDIT/USD", "/(rewardsRedeemedMonth)/:statType/:unit/:global?"));
@@ -289,6 +289,49 @@ _, global = "") => {
289
289
  });
290
290
  });
291
291
  };
292
+ const rewardsPendingQuery = (programId, locale, type, unit, global = "") => {
293
+ return debugQuery(gql `
294
+ query (
295
+ $programId: ID
296
+ $type: RewardType
297
+ $unit: String!
298
+ $locale: RSLocale
299
+ ) {
300
+ fallback: formatRewardPrettyValue(
301
+ value: 0
302
+ unit: $unit
303
+ locale: $locale
304
+ formatType: UNIT_FORMATTED
305
+ )
306
+ viewer: viewer {
307
+ ... on User {
308
+ rewardBalanceDetails(
309
+ programId: $programId
310
+ filter: { type_eq: $type, unit_eq: $unit }
311
+ locale: $locale
312
+ ) {
313
+ ... on CreditRewardBalance {
314
+ prettyPendingCredit
315
+ }
316
+ }
317
+ }
318
+ }
319
+ }
320
+ `, {
321
+ programId: !global && programId !== "classic" ? programId : null,
322
+ type,
323
+ unit,
324
+ locale,
325
+ }, (res) => {
326
+ var _a, _b, _c, _d, _e;
327
+ const arr = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.rewardBalanceDetails;
328
+ const fallback = (_c = res.data) === null || _c === void 0 ? void 0 : _c.fallback;
329
+ return {
330
+ value: ((_d = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _d === void 0 ? void 0 : _d.prettyPendingCredit) || 0,
331
+ statvalue: ((_e = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _e === void 0 ? void 0 : _e.prettyPendingCredit) || fallback,
332
+ };
333
+ });
334
+ };
292
335
  const rewardsRedeemedQuery = (programId, locale, type, unit, global = "") => {
293
336
  return debugQuery(gql `
294
337
  query (
@@ -613,6 +656,10 @@ export const queries = {
613
656
  label: "Rewards Earned",
614
657
  query: rewardsAssignedQuery,
615
658
  },
659
+ rewardsPending: {
660
+ label: "Rewards Pending",
661
+ query: rewardsPendingQuery,
662
+ },
616
663
  rewardsRedeemed: {
617
664
  label: "Rewards Paid",
618
665
  query: rewardsRedeemedQuery,
@@ -700,6 +747,10 @@ export const StatPaths = [
700
747
  name: "rewardsAssigned",
701
748
  route: "/(rewardsAssigned)/:statType/:unit/:global?",
702
749
  },
750
+ {
751
+ name: "rewardsPending",
752
+ route: "/(rewardsPending)/:statType/:unit/:global?",
753
+ },
703
754
  {
704
755
  name: "rewardsRedeemed",
705
756
  route: "/(rewardsRedeemed)/:statType/:unit/:global?",
@@ -1109,6 +1109,49 @@ _, global = "") => {
1109
1109
  });
1110
1110
  });
1111
1111
  };
1112
+ const rewardsPendingQuery = (programId, locale, type, unit, global = "") => {
1113
+ return debugQuery(dist.gql `
1114
+ query (
1115
+ $programId: ID
1116
+ $type: RewardType
1117
+ $unit: String!
1118
+ $locale: RSLocale
1119
+ ) {
1120
+ fallback: formatRewardPrettyValue(
1121
+ value: 0
1122
+ unit: $unit
1123
+ locale: $locale
1124
+ formatType: UNIT_FORMATTED
1125
+ )
1126
+ viewer: viewer {
1127
+ ... on User {
1128
+ rewardBalanceDetails(
1129
+ programId: $programId
1130
+ filter: { type_eq: $type, unit_eq: $unit }
1131
+ locale: $locale
1132
+ ) {
1133
+ ... on CreditRewardBalance {
1134
+ prettyPendingCredit
1135
+ }
1136
+ }
1137
+ }
1138
+ }
1139
+ }
1140
+ `, {
1141
+ programId: !global && programId !== "classic" ? programId : null,
1142
+ type,
1143
+ unit,
1144
+ locale,
1145
+ }, (res) => {
1146
+ var _a, _b, _c, _d, _e;
1147
+ const arr = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.rewardBalanceDetails;
1148
+ const fallback = (_c = res.data) === null || _c === void 0 ? void 0 : _c.fallback;
1149
+ return {
1150
+ value: ((_d = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _d === void 0 ? void 0 : _d.prettyPendingCredit) || 0,
1151
+ statvalue: ((_e = arr === null || arr === void 0 ? void 0 : arr[0]) === null || _e === void 0 ? void 0 : _e.prettyPendingCredit) || fallback,
1152
+ };
1153
+ });
1154
+ };
1112
1155
  const rewardsRedeemedQuery = (programId, locale, type, unit, global = "") => {
1113
1156
  return debugQuery(dist.gql `
1114
1157
  query (
@@ -1433,6 +1476,10 @@ const queries = {
1433
1476
  label: "Rewards Earned",
1434
1477
  query: rewardsAssignedQuery,
1435
1478
  },
1479
+ rewardsPending: {
1480
+ label: "Rewards Pending",
1481
+ query: rewardsPendingQuery,
1482
+ },
1436
1483
  rewardsRedeemed: {
1437
1484
  label: "Rewards Paid",
1438
1485
  query: rewardsRedeemedQuery,
@@ -1520,6 +1567,10 @@ const StatPaths = [
1520
1567
  name: "rewardsAssigned",
1521
1568
  route: "/(rewardsAssigned)/:statType/:unit/:global?",
1522
1569
  },
1570
+ {
1571
+ name: "rewardsPending",
1572
+ route: "/(rewardsPending)/:statType/:unit/:global?",
1573
+ },
1523
1574
  {
1524
1575
  name: "rewardsRedeemed",
1525
1576
  route: "/(rewardsRedeemed)/:statType/:unit/:global?",
@@ -13,7 +13,7 @@ import { g as getProps, a as getMissingProps, s as sanitizeUrlPath } from './uti
13
13
  import './sqm-text-span-view-1eaedc4d.js';
14
14
  import { R as REGISTRATION_FORM_STATE_CONTEXT, u as useRegistrationFormState } from './useRegistrationFormState-b1f730bd.js';
15
15
  import { A as AsYouType } from './AsYouType-46f67d0d.js';
16
- import { b as useDemoBigStat, U as useBigStat, B as BigStatView, O as autoColorScaleCss, K as CardFeedView, j as CheckboxFieldView, M as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, V as withShadowView, L as LeaderboardView, N as NameFieldsView, d as PortalChangePasswordView, i as PortalFooterView, P as PortalFrameView, e as PortalLoginView, f as PortalRegisterView, R as ReferralIframeView, W as demoRewardExchange, k as RewardExchangeView, X as pathToRegexp, a as useShareButton, S as ShareButtonView, C as CopyTextView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-a129a634.js';
16
+ import { b as useDemoBigStat, U as useBigStat, B as BigStatView, O as autoColorScaleCss, K as CardFeedView, j as CheckboxFieldView, M as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, V as withShadowView, L as LeaderboardView, N as NameFieldsView, d as PortalChangePasswordView, i as PortalFooterView, P as PortalFrameView, e as PortalLoginView, f as PortalRegisterView, R as ReferralIframeView, W as demoRewardExchange, k as RewardExchangeView, X as pathToRegexp, a as useShareButton, S as ShareButtonView, C as CopyTextView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-fdb8f6a9.js';
17
17
  import './sqm-portal-container-view-b7b10841.js';
18
18
 
19
19
  const BigStat = class {
@@ -22,7 +22,7 @@ import { P as PortalForgotPasswordView } from './sqm-portal-forgot-password-view
22
22
  import { P as PortalProfileView } from './sqm-portal-profile-view-cc13ab93.js';
23
23
  import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-e4f288e8.js';
24
24
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-f0994025.js';
25
- import { S as ShareButtonView, L as LeaderboardView, C as CopyTextView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalLoginView, f as PortalRegisterView, T as TaskCardView, g as ProgressBarView, h as PoweredByImg$1, i as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, j as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, k as RewardExchangeView, r as rewardExchangeCustomErrorMsg, l as rewardExchangeLongText, m as rewardExchangeSelected, n as chooseAmountFixed, o as chooseAmountFixedNoDescription, p as chooseAmountVariable, q as chooseAmountVariableNoDescription, s as chooseAmountVariableDisabled, t as chooseAmountVariableUnavailable, v as confirmFixed, w as confirmVariable, x as redemptionError, y as queryError, z as success, A as successVariable, F as loading, G as empty$1, J as rewardExchange, K as CardFeedView, M as CouponCodeView, O as autoColorScaleCss, Q as ShadowViewAddon } from './ShadowViewAddon-a129a634.js';
25
+ import { S as ShareButtonView, L as LeaderboardView, C as CopyTextView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalLoginView, f as PortalRegisterView, T as TaskCardView, g as ProgressBarView, h as PoweredByImg$1, i as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, j as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, k as RewardExchangeView, r as rewardExchangeCustomErrorMsg, l as rewardExchangeLongText, m as rewardExchangeSelected, n as chooseAmountFixed, o as chooseAmountFixedNoDescription, p as chooseAmountVariable, q as chooseAmountVariableNoDescription, s as chooseAmountVariableDisabled, t as chooseAmountVariableUnavailable, v as confirmFixed, w as confirmVariable, x as redemptionError, y as queryError, z as success, A as successVariable, F as loading, G as empty$1, J as rewardExchange, K as CardFeedView, M as CouponCodeView, O as autoColorScaleCss, Q as ShadowViewAddon } from './ShadowViewAddon-fdb8f6a9.js';
26
26
  import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-b7b10841.js';
27
27
 
28
28
  /**
@@ -1702,7 +1702,7 @@ const ShareLink = /*#__PURE__*/Object.freeze({
1702
1702
  FullStack: FullStack
1703
1703
  });
1704
1704
 
1705
- const scenario$3 = "@author:sam\r\n@owner:sam\r\nFeature: Big Stat\r\n\r\n Big stat is a component for displaying a statistic as a large number with a label\r\n\r\n @minutia\r\n Scenario: Demo hook retrieves label using stat pattern\r\n Given isDemo() returns true\r\n And the component renders with props:\r\n | type |\r\n | /referralsCount |\r\n Then the label is: \"REFERRALS - COUNT\"\r\n And the value is: \"12345\"\r\n\r\n @minutia\r\n Scenario: Demo hook falls back to default label on invalid path\r\n Given isDemo() returns true\r\n And the component renders with props:\r\n | type |\r\n | a bad path |\r\n Then the label is: \"Demo Label\"\r\n And the value is: \"12345\"\r\n\r\n @motivating\r\n Scenario: Displays error on unrecognized path\r\n Given isDemo() returns false\r\n And the component renders with props:\r\n | type |\r\n | /(doesNotExistNopeNotHere) |\r\n Then the label is: \"BAD PROP TYPE\"\r\n And the value is: \"!!!\"\r\n\r\n @motivating\r\n Scenario Outline: Label displays correctly\r\n Given the type prop is set to <type>\r\n When the component renders\r\n Then the label is <label>\r\n Given isDemo() returns true\r\n When the component renders\r\n Then the label is <inferredLabel>\r\n Examples:\r\n | path | label | inferredLabel |\r\n | rewardsAssigned | Rewards Earned | Rewards Assigned |\r\n | rewardsRedeemed | Rewards Paid | Rewards Redeemed |\r\n | rewardsAvailable | Rewards Available | Rewards Available |\r\n | referralsCount | Referrals - Count | Referrals Count |\r\n | referralsMonth | Referrals - This Month | Referrals Month |\r\n | referralsWeek | Referrals - This Week | Referrals Week |\r\n | rewardsCount | Rewards - Count | Rewards Count |\r\n | rewardsMonth | Rewards - This Month | Rewards Month |\r\n | rewardsWeek | Rewards - This Week | Rewards Week |\r\n | rewardBalance | Balance - Credit Earned | Reward Balance |\r\n | customField | Custom Fields | Custom Fields |\r\n | programGoals | Program Goals | Program Goals |\r\n\r\n @motivating\r\n Scenario: Display user's credit\r\n Given isDemo() returns false\r\n And the user has earned 34 COFFEE from the program\r\n And the component renders with props:\r\n | type |\r\n | /rewardBalance/CREDIT/COFFEE/prettyValue |\r\n Then the label is: \"Balance - Credit Earned\"\r\n And the value is: \"34 COFFEE\"\r\n\r\n @minutia\r\n Scenario: Memoizes most recent query\r\n Given isDemo() returns false\r\n And the component's type prop is set to a variable named PATH\r\n And PATH is \"/referralsWeek\"\r\n Then the component shows a loading state before showing the result\r\n When the component reloads given some external reload\r\n Then the component doesn't show a loading state\r\n When PATH is set to \"/rewardsWeek\"\r\n Then the component shows a loading state before showing the result\r\n When PATH is set to \"/referralsWeek\"\r\n Then the component shows a loading state before showing the result\r\n\r\n @motivating\r\n Scenario: Stat has a loading state\r\n Given isDemo() returns false\r\n And the component's stat type prop is valid\r\n When the component renders\r\n Then The stat value displays \"...\"\r\n And when the stat query is completed\r\n And the stat value displays a value\r\n\r\n @motivating\r\n Scenario Outline: Program Goal stat requires metricType and goalId\r\n Given the statType prop is <statType>\r\n When the component renders\r\n Then the label is <label>\r\n And the stat value is <InvalidStatValue>\r\n Examples:\r\n | statType | label | InvalidStatValue |\r\n | /programGoals | BAD PROP TYPE | true |\r\n | /programGoals/count | BAD PROP TYPE | true |\r\n | /programGoals/conversionCount | BAD PROP TYPE | true |\r\n | /programGoals/My-Goal | BAD PROP TYPE | true |\r\n | /programGoals/count/My-Goal | Program Goals | false |\r\n | /programGoals/conversionCount/My-Goal | Program Goals | false |\r\n\r\n @motivating\r\n Scenario Outline: rewardCountFiltered supports many formats\r\n Given the statType begins with \"/rewardCountFiltered\"\r\n When the component renders with <statType>\r\n Then the stat <mayRender> a value\r\n Examples:\r\n | statType | mayRender |\r\n | /rewardsCountFiltered | renders |\r\n | /rewardsCountFiltered/COFFEE | doesn't render |\r\n | /rewardsCountFiltered/global | renders |\r\n | /rewardsCountFiltered/INTEGRATION | renders |\r\n | /rewardsCountFiltered/INTEGRATION/global | renders |\r\n | /rewardsCountFiltered/PCT_DISCOUNT | renders |\r\n | /rewardsCountFiltered/PCT_DISCOUNT/global | renders |\r\n | /rewardsCountFiltered/CREDIT | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE | renders |\r\n | /rewardsCountFiltered/CREDIT/global | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE/PENDING | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE/AVAILABLE | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/global | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/PENDING | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/PENDING/global | renders |\r\n\r\n @motivating\r\n Scenario Outline: Program Goals and Reward units with currencies must be encoded\r\n Given the statType is <statType>\r\n When the stat is queried\r\n Then the stat is filtered by <decodedFilter>\r\n And a value <mayBe> rendered\r\n Examples:\r\n | statType | decodedFilter | may |\r\n | /rewardBalance/CREDIT/COFFEE | COFFEE | is |\r\n | /rewardBalance/CREDIT/CENTS | CENTS | is |\r\n | /rewardBalance/CREDIT/COFFEE%2FUSD | COFFEE/USD | is |\r\n | /rewardBalance/CREDIT/COFFEE/USD | COFFEE | is |\r\n | /rewardBalance/CREDIT/CASH | CASH | is |\r\n | /rewardBalance/CREDIT/CASH/USD | CASH | is |\r\n | /rewardBalance/CREDIT/CASH%2FUSD | CASH/USD | is |\r\n | /programGoals/count/My-Goal | My-Goal | is |\r\n | /programGoals/count/My-Goal/referrals | | isn't |\r\n | /programGoals/count/My-Goal%2Freferrals | My-Goal/referrals | is |\r\n\r\n @motivating\r\n Scenario Outline: User custom fields can be queried\r\n Given the StatType is <statType>\r\n When the stat is queried\r\n Then the value matches that of the users <customField>\r\n Examples:\r\n | statType | customField |\r\n | /customFields/videosShared | videosShared |\r\n | /customFields/totalPurchaseCount | totalPurchaseCount |\r\n\r\n @motivating\r\n Scenario Outline: Some stats can use a global value instead of filtered by program\r\n Given the stat <statName>\r\n Then the global value <mayBe> available\r\n Examples:\r\n | statName | mayBe |\r\n | referralsCount | isn't |\r\n | referralsMonth | isn't |\r\n | referralsWeek | isn't |\r\n | rewardsCount | is |\r\n | rewardsCountFiltered | is |\r\n | integrationRewardsCountFiltered | is |\r\n | rewardsMonth | is |\r\n | rewardsWeek | is |\r\n | rewardsAssigned | is |\r\n | rewardsRedeemed | is |\r\n | rewardsAvailable | is |\r\n | rewardBalance | is |\r\n\r\n @motivating\r\n Scenario Outline: referralsCount stat can be filtered by Converted and Started\r\n Given statType prop is <statType>\r\n Then the stat returned has a <filter>\r\n Examples:\r\n | statType | filter |\r\n | /referralsCount | { programId_eq: programId } |\r\n | /referralsCount/converted | { programId_eq: programId, dateConverted_exists: true } |\r\n | /referralsCount/started | { programId_eq: programId, dateConverted_exists: false } |\r\n\r\n @motivating\r\n Scenario: Program context is used by default to source the programId used for queries\r\n Given a valid \"statType\"\r\n And its not a global stat\r\n And the stat is loaded in an environment for \"program-a\"\r\n And the \"program-id\" prop is not used\r\n When the stat is queried\r\n Then the query is filtered by \"{ programId_eq: 'program-a' }\"\r\n And only results from \"program-a\" are returned\r\n\r\n @motivating\r\n Scenario Outline: ProgramId can be specified to overwrite the program context default\r\n Given a valid \"statType\"\r\n And its not a global stat\r\n And the \"program-id\" prop has <value>\r\n When the stat is queried\r\n Then the query has a <filter>\r\n And only results from <value> are returned\r\n Examples:\r\n | value | filter |\r\n | program-b | { programId_eq: \"program-b\" } |\r\n | program-c | { programId_eq: \"program-c\" } |";
1705
+ const scenario$3 = "@author:sam\r\n@owner:sam\r\nFeature: Big Stat\r\n\r\n Big stat is a component for displaying a statistic as a large number with a label\r\n\r\n @minutia\r\n Scenario: Demo hook retrieves label using stat pattern\r\n Given isDemo() returns true\r\n And the component renders with props:\r\n | type |\r\n | /referralsCount |\r\n Then the label is: \"REFERRALS - COUNT\"\r\n And the value is: \"12345\"\r\n\r\n @minutia\r\n Scenario: Demo hook falls back to default label on invalid path\r\n Given isDemo() returns true\r\n And the component renders with props:\r\n | type |\r\n | a bad path |\r\n Then the label is: \"Demo Label\"\r\n And the value is: \"12345\"\r\n\r\n @motivating\r\n Scenario: Displays error on unrecognized path\r\n Given isDemo() returns false\r\n And the component renders with props:\r\n | type |\r\n | /(doesNotExistNopeNotHere) |\r\n Then the label is: \"BAD PROP TYPE\"\r\n And the value is: \"!!!\"\r\n\r\n @motivating\r\n Scenario Outline: Label displays correctly\r\n Given the type prop is set to <type>\r\n When the component renders\r\n Then the label is <label>\r\n Given isDemo() returns true\r\n When the component renders\r\n Then the label is <inferredLabel>\r\n Examples:\r\n | path | label | inferredLabel |\r\n | rewardsAssigned | Rewards Earned | Rewards Assigned |\r\n | rewardsRedeemed | Rewards Paid | Rewards Redeemed |\r\n | rewardsAvailable | Rewards Available | Rewards Available |\r\n | referralsCount | Referrals - Count | Referrals Count |\r\n | referralsMonth | Referrals - This Month | Referrals Month |\r\n | referralsWeek | Referrals - This Week | Referrals Week |\r\n | rewardsCount | Rewards - Count | Rewards Count |\r\n | rewardsMonth | Rewards - This Month | Rewards Month |\r\n | rewardsWeek | Rewards - This Week | Rewards Week |\r\n | rewardBalance | Balance - Credit Earned | Reward Balance |\r\n | customField | Custom Fields | Custom Fields |\r\n | programGoals | Program Goals | Program Goals |\r\n\r\n @motivating\r\n Scenario: Display user's credit\r\n Given isDemo() returns false\r\n And the user has earned 34 COFFEE from the program\r\n And the component renders with props:\r\n | type |\r\n | /rewardBalance/CREDIT/COFFEE/prettyValue |\r\n Then the label is: \"Balance - Credit Earned\"\r\n And the value is: \"34 COFFEE\"\r\n\r\n @minutia\r\n Scenario: Memoizes most recent query\r\n Given isDemo() returns false\r\n And the component's type prop is set to a variable named PATH\r\n And PATH is \"/referralsWeek\"\r\n Then the component shows a loading state before showing the result\r\n When the component reloads given some external reload\r\n Then the component doesn't show a loading state\r\n When PATH is set to \"/rewardsWeek\"\r\n Then the component shows a loading state before showing the result\r\n When PATH is set to \"/referralsWeek\"\r\n Then the component shows a loading state before showing the result\r\n\r\n @motivating\r\n Scenario: Stat has a loading state\r\n Given isDemo() returns false\r\n And the component's stat type prop is valid\r\n When the component renders\r\n Then The stat value displays \"...\"\r\n And when the stat query is completed\r\n And the stat value displays a value\r\n\r\n @motivating\r\n Scenario Outline: Program Goal stat requires metricType and goalId\r\n Given the statType prop is <statType>\r\n When the component renders\r\n Then the label is <label>\r\n And the stat value is <InvalidStatValue>\r\n Examples:\r\n | statType | label | InvalidStatValue |\r\n | /programGoals | BAD PROP TYPE | true |\r\n | /programGoals/count | BAD PROP TYPE | true |\r\n | /programGoals/conversionCount | BAD PROP TYPE | true |\r\n | /programGoals/My-Goal | BAD PROP TYPE | true |\r\n | /programGoals/count/My-Goal | Program Goals | false |\r\n | /programGoals/conversionCount/My-Goal | Program Goals | false |\r\n\r\n @motivating\r\n Scenario Outline: rewardCountFiltered supports many formats\r\n Given the statType begins with \"/rewardCountFiltered\"\r\n When the component renders with <statType>\r\n Then the stat <mayRender> a value\r\n Examples:\r\n | statType | mayRender |\r\n | /rewardsCountFiltered | renders |\r\n | /rewardsCountFiltered/COFFEE | doesn't render |\r\n | /rewardsCountFiltered/global | renders |\r\n | /rewardsCountFiltered/INTEGRATION | renders |\r\n | /rewardsCountFiltered/INTEGRATION/global | renders |\r\n | /rewardsCountFiltered/PCT_DISCOUNT | renders |\r\n | /rewardsCountFiltered/PCT_DISCOUNT/global | renders |\r\n | /rewardsCountFiltered/CREDIT | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE | renders |\r\n | /rewardsCountFiltered/CREDIT/global | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE/PENDING | renders |\r\n | /rewardsCountFiltered/CREDIT/COFFEE/AVAILABLE | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/global | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/PENDING | renders |\r\n | /rewardsCountFiltered/CREDIT/CASH%2FUSD/PENDING/global | renders |\r\n\r\n @motivating\r\n Scenario Outline: Program Goals and Reward units with currencies must be encoded\r\n Given the statType is <statType>\r\n When the stat is queried\r\n Then the stat is filtered by <decodedFilter>\r\n And a value <mayBe> rendered\r\n Examples:\r\n | statType | decodedFilter | may |\r\n | /rewardBalance/CREDIT/COFFEE | COFFEE | is |\r\n | /rewardBalance/CREDIT/CENTS | CENTS | is |\r\n | /rewardBalance/CREDIT/COFFEE%2FUSD | COFFEE/USD | is |\r\n | /rewardBalance/CREDIT/COFFEE/USD | COFFEE | is |\r\n | /rewardBalance/CREDIT/CASH | CASH | is |\r\n | /rewardBalance/CREDIT/CASH/USD | CASH | is |\r\n | /rewardBalance/CREDIT/CASH%2FUSD | CASH/USD | is |\r\n | /programGoals/count/My-Goal | My-Goal | is |\r\n | /programGoals/count/My-Goal/referrals | | isn't |\r\n | /programGoals/count/My-Goal%2Freferrals | My-Goal/referrals | is |\r\n\r\n @motivating\r\n Scenario Outline: User custom fields can be queried\r\n Given the StatType is <statType>\r\n When the stat is queried\r\n Then the value matches that of the users <customField>\r\n Examples:\r\n | statType | customField |\r\n | /customFields/videosShared | videosShared |\r\n | /customFields/totalPurchaseCount | totalPurchaseCount |\r\n\r\n @motivating\r\n Scenario Outline: Some stats can use a global value instead of filtered by program\r\n Given the stat <statName>\r\n Then the global value <mayBe> available\r\n Examples:\r\n | statName | mayBe |\r\n | referralsCount | isn't |\r\n | referralsMonth | isn't |\r\n | referralsWeek | isn't |\r\n | rewardsCount | is |\r\n | rewardsCountFiltered | is |\r\n | integrationRewardsCountFiltered | is |\r\n | rewardsMonth | is |\r\n | rewardsWeek | is |\r\n | rewardsAssigned | is |\r\n | rewardsRedeemed | is |\r\n | rewardsRedeemedWeek | is |\r\n | rewardsRedeemedMonth | is |\r\n | rewardsPending | is |\r\n | rewardsAvailable | is |\r\n | rewardBalance | is |\r\n\r\n @motivating\r\n Scenario Outline: referralsCount stat can be filtered by Converted and Started\r\n Given statType prop is <statType>\r\n Then the stat returned has a <filter>\r\n Examples:\r\n | statType | filter |\r\n | /referralsCount | { programId_eq: programId } |\r\n | /referralsCount/converted | { programId_eq: programId, dateConverted_exists: true } |\r\n | /referralsCount/started | { programId_eq: programId, dateConverted_exists: false } |\r\n\r\n @motivating\r\n Scenario: Program context is used by default to source the programId used for queries\r\n Given a valid \"statType\"\r\n And its not a global stat\r\n And the stat is loaded in an environment for \"program-a\"\r\n And the \"program-id\" prop is not used\r\n When the stat is queried\r\n Then the query is filtered by \"{ programId_eq: 'program-a' }\"\r\n And only results from \"program-a\" are returned\r\n\r\n @motivating\r\n Scenario Outline: ProgramId can be specified to overwrite the program context default\r\n Given a valid \"statType\"\r\n And its not a global stat\r\n And the \"program-id\" prop has <value>\r\n When the stat is queried\r\n Then the query has a <filter>\r\n And only results from <value> are returned\r\n Examples:\r\n | value | filter |\r\n | program-b | { programId_eq: \"program-b\" } |\r\n | program-c | { programId_eq: \"program-c\" } |\r\n\r\n\r\n @motivating\r\n Scenario: \"/rewardsReedemedWeek\" stat shows rewards that have been redeemed this week\r\n Given a user reeemed the following rewards\r\n | reward | dateRedeemed | programId |\r\n | $1.00 USD | 2023-08-18 | A |\r\n | $1.00 CAD | 2023-08-18 | A |\r\n | $1.00 AUD | 2023-08-18 | A |\r\n | $1.00 USD | 2023-08-10 | A |\r\n | $20.00 USD | 2023-08-18 | B |\r\n | $20.00 CAD | 2023-08-18 | B |\r\n | $20.00 AUD | 2023-08-18 | B |\r\n | $20.00 USD | 2023-08-01 | B |\r\n | $20.00 GBP | 2023-08-01 | B |\r\n | $20.00 GBP | 2023-08-20 | |\r\n And the current date is \"2023-08-22\"\r\n And the program of the stat is <programId>\r\n And the statType is <statType>\r\n Then the stat displays <statValue>\r\n | programId | statType | statValue |\r\n | A | /rewardsReedemedWeek/CREDIT/USD | USD1.00 |\r\n | A | /rewardsReedemedWeek/CREDIT/CAD | CAD1.00 |\r\n | A | /rewardsReedemedWeek/CREDIT/AUD | AUD1.00 |\r\n | B | /rewardsReedemedWeek/CREDIT/USD | USD20.00 |\r\n | B | /rewardsReedemedWeek/CREDIT/CAD | CAD20.00 |\r\n | B | /rewardsReedemedWeek/CREDIT/AUD | AUD20.00 |\r\n | N/A | /rewardsReedemedWeek/CREDIT/USD/global | USD21.00 |\r\n | N/A | /rewardsReedemedWeek/CREDIT/CAD/global | CAD21.00 |\r\n | N/A | /rewardsReedemedWeek/CREDIT/GBP/global | GBP20.00 |\r\n\r\n @motivating\r\n Scenario: \"/rewardsReedemedMonth\" stat shows rewards that have been redeemed this month\r\n Given a user reeemed the following rewards\r\n | reward | dateRedeemed | programId |\r\n | $1.00 USD | 2023-08-18 | A |\r\n | $1.00 CAD | 2023-08-18 | A |\r\n | $1.00 AUD | 2023-08-18 | A |\r\n | $1.00 USD | 2023-07-31 | A |\r\n | $20.00 USD | 2023-08-18 | B |\r\n | $20.00 CAD | 2023-08-18 | B |\r\n | $20.00 AUD | 2023-08-18 | B |\r\n | $20.00 USD | 2023-08-01 | B |\r\n | $20.00 GBP | 2023-08-01 | B |\r\n | $20.00 GBP | 2023-08-20 | |\r\n | $20.00 GBP | 2023-07-31 | |\r\n And the current date is \"2023-08-22\"\r\n And the program of the stat is <programId>\r\n And the statType is <statType>\r\n Then the stat displays <statValue>\r\n | programId | statType | statValue |\r\n | A | /rewardsReedemedMonth/CREDIT/USD | USD1.00 |\r\n | A | /rewardsReedemedMonth/CREDIT/CAD | CAD1.00 |\r\n | A | /rewardsReedemedMonth/CREDIT/AUD | AUD1.00 |\r\n | B | /rewardsReedemedMonth/CREDIT/USD | USD20.00 |\r\n | B | /rewardsReedemedMonth/CREDIT/CAD | CAD20.00 |\r\n | B | /rewardsReedemedMonth/CREDIT/AUD | AUD20.00 |\r\n | N/A | /rewardsReedemedMonth/CREDIT/USD/global | USD41.00 |\r\n | N/A | /rewardsReedemedMonth/CREDIT/CAD/global | CAD21.00 |\r\n | N/A | /rewardsReedemedMonth/CREDIT/GBP/global | GBP40.00 |\r\n\r\n\r\n @landmine\r\n Scenario Outline: Rewards redeemed by week and month stats only include rewards that have been fully redeemed\r\n Given statType prop is <statType>\r\n And the user has fully redeemed a $50.00 USD reward\r\n And the user has redeemed <amountRedeemed> of a $50.00 USD reward\r\n Then the stat displays <statValue>\r\n Examples:\r\n | statType | amountRedeemed | statValue |\r\n | /rewardsRedeemed/CREDIT/USD/global | $0.00 | $50.00 |\r\n | /rewardsRedeemedWeek/CREDIT/USD/global | $0.00 | $50.00 |\r\n | /rewardsRedeemedMonth/CREDIT/USD/global | $0.00 | $50.00 |\r\n | /rewardsRedeemed/CREDIT/USD/global | $25.00 | $75.00 |\r\n | /rewardsRedeemedWeek/CREDIT/USD/global | $25.00 | $50.00 |\r\n | /rewardsRedeemedMonth/CREDIT/USD/global | $25.00 | $50.00 |\r\n | /rewardsRedeemed/CREDIT/USD/global | $50.00 | $100.00 |\r\n | /rewardsRedeemedWeek/CREDIT/USD/global | $50.00 | $100.00 |\r\n | /rewardsRedeemedMonth/CREDIT/USD/global | $50.00 | $100.00 |\r\n\r\n @landmine\r\n Scenario Outline: Rewards redeemed by week and month stats can only count up to 1000 redeemed rewards during the period\r\n Given statType prop is <statType>\r\n And the user has fully redeemed 1001 $1.00 USD rewards in the past <timeframe>\r\n Then the stat displays <statValue>\r\n Examples:\r\n | statType | timeframe | statValue |\r\n | /rewardsRedeemed/CREDIT/USD/global | N/A | $1001.00 |\r\n | /rewardsRedeemedWeek/CREDIT/USD/global | week | $1000.00 |\r\n | /rewardsRedeemedMonth/CREDIT/USD/global | month | $1000.00 |\r\n";
1706
1706
 
1707
1707
  const BigStat_stories = {
1708
1708
  title: "Components/Big Stat",
@@ -2905,6 +2905,8 @@ const RewardsMonth = createHookStory(() => View("/rewardsMonth", "/(rewardsMonth
2905
2905
  const RewardsWeek = createHookStory(() => View("/rewardsWeek", "/(rewardsWeek)/:global?"));
2906
2906
  const RewardsAssigned = createHookStory(() => View("/rewardsAssigned/CREDIT/COFFEE", "/(rewardsAssigned)/:statType/:unit/:global?"));
2907
2907
  const RewardsAssignedCashUSD = createHookStory(() => View("/rewardsAssigned/CREDIT/CASH%2FUSD", "/(rewardsAssigned)/:statType/:unit/:global?"));
2908
+ const RewardsPending = createHookStory(() => View("/rewardsPending/CREDIT/USD", "/(rewardsPending)/:statType/:unit/:global?"));
2909
+ const RewardsPendingGlobal = createHookStory(() => View("/rewardsPending/CREDIT/USD/global", "/(rewardsPending)/:statType/:unit/:global?"));
2908
2910
  const RewardsRedeemed = createHookStory(() => View("/rewardsRedeemed/CREDIT/USD", "/(rewardsRedeemed)/:statType/:unit/:global?"));
2909
2911
  const RewardsRedeemedWeek = createHookStory(() => View("/rewardsRedeemedWeek/CREDIT/USD", "/(rewardsRedeemedWeek)/:statType/:unit/:global?"));
2910
2912
  const RewardsRedeemedMonth = createHookStory(() => View("/rewardsRedeemedMonth/CREDIT/USD", "/(rewardsRedeemedMonth)/:statType/:unit/:global?"));
@@ -2963,6 +2965,8 @@ const UseBigStat = /*#__PURE__*/Object.freeze({
2963
2965
  RewardsWeek: RewardsWeek,
2964
2966
  RewardsAssigned: RewardsAssigned,
2965
2967
  RewardsAssignedCashUSD: RewardsAssignedCashUSD,
2968
+ RewardsPending: RewardsPending,
2969
+ RewardsPendingGlobal: RewardsPendingGlobal,
2966
2970
  RewardsRedeemed: RewardsRedeemed,
2967
2971
  RewardsRedeemedWeek: RewardsRedeemedWeek,
2968
2972
  RewardsRedeemedMonth: RewardsRedeemedMonth,