@meetelise/chat 1.29.0 → 1.30.1

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 (228) hide show
  1. package/dist/src/MyPubnub.d.ts +116 -0
  2. package/dist/src/WebComponent/FeeCalculator/components/addon-item/addon-item-styles.d.ts +2 -0
  3. package/dist/src/WebComponent/FeeCalculator/components/addon-item/addon-item.d.ts +22 -0
  4. package/dist/src/WebComponent/FeeCalculator/components/addon-item/index.d.ts +1 -0
  5. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +2 -0
  6. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +34 -0
  7. package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +2 -0
  8. package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +21 -0
  9. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +2 -0
  10. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +13 -0
  11. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +2 -0
  12. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +33 -0
  13. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +2 -0
  14. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +18 -0
  15. package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +5 -0
  16. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +2 -0
  17. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +13 -0
  18. package/dist/src/WebComponent/FeeCalculator/constants.d.ts +2 -0
  19. package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +1 -0
  20. package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +59 -0
  21. package/dist/src/WebComponent/FeeCalculator/index.d.ts +2 -0
  22. package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +80 -0
  23. package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +23 -0
  24. package/dist/src/WebComponent/LeadSourceClient.d.ts +46 -0
  25. package/dist/src/WebComponent/OfficeHours.d.ts +21 -0
  26. package/dist/src/WebComponent/Scheduler/date-picker.d.ts +28 -0
  27. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +14 -0
  28. package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +100 -0
  29. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +13 -0
  30. package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +1 -0
  31. package/dist/src/WebComponent/actions/InputStyles.d.ts +1 -0
  32. package/dist/src/WebComponent/actions/action-confirm-button.d.ts +13 -0
  33. package/dist/src/WebComponent/actions/call-us-window.d.ts +37 -0
  34. package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +8 -0
  35. package/dist/src/WebComponent/actions/details-window.d.ts +14 -0
  36. package/dist/src/WebComponent/actions/email-us-window.d.ts +46 -0
  37. package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +17 -0
  38. package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +8 -0
  39. package/dist/src/WebComponent/chat-additional-actions.d.ts +28 -0
  40. package/dist/src/WebComponent/health-chat.d.ts +47 -0
  41. package/dist/src/WebComponent/healthchat-styles.d.ts +1 -0
  42. package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +2 -0
  43. package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +2 -0
  44. package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +2 -0
  45. package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +2 -0
  46. package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +2 -0
  47. package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +2 -0
  48. package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +2 -0
  49. package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +3 -0
  50. package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +2 -0
  51. package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +2 -0
  52. package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +2 -0
  53. package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +3 -0
  54. package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +2 -0
  55. package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +2 -0
  56. package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +2 -0
  57. package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +2 -0
  58. package/dist/src/WebComponent/index.d.ts +2 -0
  59. package/dist/src/WebComponent/launcher/Launcher.d.ts +98 -0
  60. package/dist/src/WebComponent/launcher/launcherStyles.d.ts +1 -0
  61. package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +27 -0
  62. package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +1 -0
  63. package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +1 -0
  64. package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +1 -0
  65. package/dist/src/WebComponent/leasing-chat-styles.d.ts +1 -0
  66. package/dist/src/WebComponent/me-chat.d.ts +91 -0
  67. package/dist/src/WebComponent/me-select.d.ts +24 -0
  68. package/dist/src/WebComponent/mega-loader.d.ts +7 -0
  69. package/dist/src/WebComponent/mini-loader.d.ts +5 -0
  70. package/dist/src/WebComponent/pubnub-chat-styles.d.ts +1 -0
  71. package/dist/src/WebComponent/pubnub-chat.d.ts +49 -0
  72. package/dist/src/WebComponent/pubnub-media.d.ts +14 -0
  73. package/dist/src/WebComponent/pubnub-message-styles.d.ts +1 -0
  74. package/dist/src/WebComponent/pubnub-message.d.ts +39 -0
  75. package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +1 -0
  76. package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +12 -0
  77. package/dist/src/WebComponent/utilities-chat.d.ts +47 -0
  78. package/dist/src/WebComponent/utilities-styles.d.ts +1 -0
  79. package/dist/src/WebComponent/utils.d.ts +31 -0
  80. package/dist/src/analytics.d.ts +64 -0
  81. package/dist/src/disclaimers.d.ts +8 -0
  82. package/dist/src/fetchBuildingABTestType.d.ts +8 -0
  83. package/dist/src/fetchBuildingInfo.d.ts +57 -0
  84. package/dist/src/fetchBuildingWebchatView.d.ts +123 -0
  85. package/dist/src/fetchFeatureFlag.d.ts +14 -0
  86. package/dist/src/fetchLeadSources.d.ts +4 -0
  87. package/dist/src/fetchPhoneNumberFromSource.d.ts +6 -0
  88. package/dist/src/getAvailabilities.d.ts +45 -0
  89. package/dist/src/getBuildingPhoneNumber.d.ts +1 -0
  90. package/dist/src/getShouldAllowScheduling.d.ts +1 -0
  91. package/dist/src/getShouldShowWebchat.d.ts +3 -0
  92. package/dist/src/getTimezoneString.d.ts +1 -0
  93. package/dist/src/globals.d.ts +1 -0
  94. package/dist/src/gtm.d.ts +6 -0
  95. package/dist/src/handleChatId.d.ts +11 -0
  96. package/dist/src/insertDNIIntoWebsite.d.ts +5 -0
  97. package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +4 -0
  98. package/dist/src/main/MEChat.d.ts +74 -0
  99. package/dist/src/main/utils.d.ts +2 -0
  100. package/dist/src/postLeadSources.d.ts +3 -0
  101. package/dist/src/rentgrata.d.ts +4 -0
  102. package/dist/src/replaceSelectButtonsWithNewLink.d.ts +5 -0
  103. package/dist/src/services/fees/calculateQuote.d.ts +52 -0
  104. package/dist/src/services/fees/fetchBuildingFees.d.ts +24 -0
  105. package/dist/src/services/fees/fetchBuildingFloorplans.d.ts +21 -0
  106. package/dist/src/services/fees/utils.d.ts +1 -0
  107. package/dist/src/svgIcons.d.ts +5 -0
  108. package/dist/src/themes.d.ts +5 -0
  109. package/dist/src/types/rest-sdk.types.d.ts +11 -0
  110. package/dist/src/types/webchat-no-show-reason.d.ts +1 -0
  111. package/dist/src/utils.d.ts +13 -0
  112. package/package.json +1 -1
  113. package/public/dist/index.js +384 -179
  114. package/src/MyPubnub.ts +792 -0
  115. package/src/WebComponent/FeeCalculator/components/addon-item/addon-item-styles.ts +79 -0
  116. package/src/WebComponent/FeeCalculator/components/addon-item/addon-item.ts +121 -0
  117. package/src/WebComponent/FeeCalculator/components/addon-item/index.ts +1 -0
  118. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +127 -0
  119. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +191 -0
  120. package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +65 -0
  121. package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +91 -0
  122. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +44 -0
  123. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +38 -0
  124. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +144 -0
  125. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +241 -0
  126. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +74 -0
  127. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +72 -0
  128. package/src/WebComponent/FeeCalculator/components/index.ts +5 -0
  129. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +39 -0
  130. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +39 -0
  131. package/src/WebComponent/FeeCalculator/constants.ts +3 -0
  132. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +334 -0
  133. package/src/WebComponent/FeeCalculator/fee-calculator.ts +369 -0
  134. package/src/WebComponent/FeeCalculator/index.ts +4 -0
  135. package/src/WebComponent/FeeCalculator/model/building-fee.ts +120 -0
  136. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -0
  137. package/src/WebComponent/LeadSourceClient.ts +332 -0
  138. package/src/WebComponent/MEChat.css +5 -0
  139. package/src/WebComponent/OfficeHours.ts +73 -0
  140. package/src/WebComponent/Scheduler/date-picker.ts +405 -0
  141. package/src/WebComponent/Scheduler/time-picker.ts +190 -0
  142. package/src/WebComponent/Scheduler/tour-scheduler.ts +1373 -0
  143. package/src/WebComponent/Scheduler/tour-type-option.ts +112 -0
  144. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
  145. package/src/WebComponent/actions/InputStyles.ts +57 -0
  146. package/src/WebComponent/actions/action-confirm-button.ts +125 -0
  147. package/src/WebComponent/actions/call-us-window.ts +445 -0
  148. package/src/WebComponent/actions/collapse-expand-button.ts +65 -0
  149. package/src/WebComponent/actions/details-window.ts +150 -0
  150. package/src/WebComponent/actions/email-us-window.ts +555 -0
  151. package/src/WebComponent/actions/formatPhoneNumber.ts +72 -0
  152. package/src/WebComponent/actions/minimize-expand-button.ts +93 -0
  153. package/src/WebComponent/chat-additional-actions.ts +135 -0
  154. package/src/WebComponent/health-chat.ts +270 -0
  155. package/src/WebComponent/healthchat-styles.ts +119 -0
  156. package/src/WebComponent/icons/ApplyOutlineIcon.ts +22 -0
  157. package/src/WebComponent/icons/BookTourOutlineIcon.ts +13 -0
  158. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +22 -0
  159. package/src/WebComponent/icons/ChatOutlineIcon.ts +10 -0
  160. package/src/WebComponent/icons/ChevronLeftIcon.ts +7 -0
  161. package/src/WebComponent/icons/ChevronRightIcon.ts +7 -0
  162. package/src/WebComponent/icons/ContactResidentIcon.ts +9 -0
  163. package/src/WebComponent/icons/DollarOutlineIcon.ts +18 -0
  164. package/src/WebComponent/icons/EmailOutlineIcon.ts +7 -0
  165. package/src/WebComponent/icons/HeyThereEmojiIcon.ts +12 -0
  166. package/src/WebComponent/icons/PhoneOutlineIcon.ts +7 -0
  167. package/src/WebComponent/icons/SendMessageIcon.ts +17 -0
  168. package/src/WebComponent/icons/TourSelfGuidedIcon.ts +17 -0
  169. package/src/WebComponent/icons/TourVirtuallyIcon.ts +17 -0
  170. package/src/WebComponent/icons/TourWithAgentIcon.ts +17 -0
  171. package/src/WebComponent/icons/XOutlineIcon.ts +8 -0
  172. package/src/WebComponent/index.ts +2 -0
  173. package/src/WebComponent/launcher/Launcher.ts +1282 -0
  174. package/src/WebComponent/launcher/launcherStyles.ts +500 -0
  175. package/src/WebComponent/launcher/mobile-launcher.ts +162 -0
  176. package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
  177. package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
  178. package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
  179. package/src/WebComponent/leasing-chat-styles.ts +114 -0
  180. package/src/WebComponent/me-chat.ts +1262 -0
  181. package/src/WebComponent/me-select.ts +322 -0
  182. package/src/WebComponent/mega-loader.ts +36 -0
  183. package/src/WebComponent/mini-loader.ts +28 -0
  184. package/src/WebComponent/pubnub-chat-styles.ts +204 -0
  185. package/src/WebComponent/pubnub-chat.ts +928 -0
  186. package/src/WebComponent/pubnub-media.ts +208 -0
  187. package/src/WebComponent/pubnub-message-styles.ts +54 -0
  188. package/src/WebComponent/pubnub-message.ts +431 -0
  189. package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +34 -0
  190. package/src/WebComponent/simple-launcher/simple-launcher.ts +100 -0
  191. package/src/WebComponent/utilities-chat.ts +270 -0
  192. package/src/WebComponent/utilities-styles.ts +110 -0
  193. package/src/WebComponent/utils.ts +82 -0
  194. package/src/analytics.ts +217 -0
  195. package/src/assetUrls.ts +6 -0
  196. package/src/disclaimers.ts +58 -0
  197. package/src/fetchBuildingABTestType.ts +21 -0
  198. package/src/fetchBuildingInfo.ts +87 -0
  199. package/src/fetchBuildingWebchatView.ts +156 -0
  200. package/src/fetchFeatureFlag.ts +250 -0
  201. package/src/fetchLeadSources.ts +98 -0
  202. package/src/fetchPhoneNumberFromSource.ts +31 -0
  203. package/src/fetchWebchatPreferences.ts +54 -0
  204. package/src/getAvailabilities.ts +179 -0
  205. package/src/getBuildingPhoneNumber.ts +26 -0
  206. package/src/getShouldAllowScheduling.ts +16 -0
  207. package/src/getShouldShowWebchat.ts +114 -0
  208. package/src/getTimezoneString.ts +39 -0
  209. package/src/globals.ts +1 -0
  210. package/src/gtm.ts +17 -0
  211. package/src/handleChatId.ts +101 -0
  212. package/src/insertDNIIntoWebsite.ts +146 -0
  213. package/src/insertLeadSourceIntoSchedulerLinks.ts +71 -0
  214. package/src/main/MEChat.test.ts +110 -0
  215. package/src/main/MEChat.ts +404 -0
  216. package/src/main/utils.ts +70 -0
  217. package/src/postLeadSources.ts +44 -0
  218. package/src/rentgrata.ts +74 -0
  219. package/src/replaceSelectButtonsWithNewLink.ts +69 -0
  220. package/src/services/fees/calculateQuote.ts +135 -0
  221. package/src/services/fees/fetchBuildingFees.ts +63 -0
  222. package/src/services/fees/fetchBuildingFloorplans.ts +74 -0
  223. package/src/services/fees/utils.ts +4 -0
  224. package/src/svgIcons.ts +14 -0
  225. package/src/themes.ts +65 -0
  226. package/src/types/rest-sdk.types.ts +13 -0
  227. package/src/types/webchat-no-show-reason.ts +6 -0
  228. package/src/utils.ts +121 -0
@@ -0,0 +1,79 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ :host {
5
+ display: block;
6
+ }
7
+
8
+ .addon-container {
9
+ border: 1px solid #e5e7eb;
10
+ border-radius: 0.375rem;
11
+ display: flex;
12
+ padding: 0.5rem;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ }
16
+
17
+ .addon-left {
18
+ display: flex;
19
+ flex: 1;
20
+ }
21
+
22
+ .addon-info {
23
+ margin-left: 0.75rem;
24
+ }
25
+
26
+ .addon-title {
27
+ font-size: 0.875rem;
28
+ font-weight: 500;
29
+ color: #374151;
30
+ }
31
+
32
+ .addon-right {
33
+ display: flex;
34
+ justify-content: flex-end;
35
+ }
36
+
37
+ .operator-sign {
38
+ display: inline-block;
39
+ line-height: 1;
40
+ position: relative;
41
+ transform: translateY(2px);
42
+ width: 1rem;
43
+ text-align: center;
44
+ }
45
+
46
+ .quantity-control {
47
+ display: flex;
48
+ align-items: center;
49
+ border: 1px solid #dee2e6;
50
+ border-radius: 0.2;
51
+ }
52
+
53
+ .quantity-button {
54
+ font-size: 1.2rem;
55
+ padding: 0.5rem;
56
+ background: none;
57
+ border: none;
58
+ color: #347ff7;
59
+ cursor: pointer;
60
+ }
61
+
62
+ .quantity-button:hover {
63
+ background-color: #f3f4f6;
64
+ }
65
+
66
+ .quantity-button:disabled {
67
+ opacity: 0.5;
68
+ cursor: not-allowed;
69
+ }
70
+
71
+ .quantity-value {
72
+ padding: 0.25rem;
73
+ font-size: 0.875rem;
74
+ }
75
+
76
+ .total-cost {
77
+ display: none;
78
+ }
79
+ `;
@@ -0,0 +1,121 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property, state } from "lit/decorators.js";
3
+ import { BuildingFee } from "../../model/building-fee";
4
+ import { formatCurrency } from "../../../../utils";
5
+
6
+ import addonItemStyles from "./addon-item-styles";
7
+ import { DesiredAddon } from "../../../../services/fees/calculateQuote";
8
+
9
+ @customElement("add-on-item")
10
+ export class AddonItem extends LitElement {
11
+ static styles = addonItemStyles;
12
+
13
+ @property({ type: Object })
14
+ feeItem: BuildingFee | null = null;
15
+
16
+ @property()
17
+ onQuantityChange: ((addon: DesiredAddon) => void) | null = null;
18
+
19
+ @state()
20
+ private isChecked = false;
21
+
22
+ @state()
23
+ private quantity = 0;
24
+
25
+ get totalCost(): string {
26
+ const amt = this.feeItem?.blueprint.transactionAmount ?? 0;
27
+ const cost = amt * this.quantity;
28
+ return formatCurrency(cost);
29
+ }
30
+
31
+ get atMaxUnits(): boolean {
32
+ const maxUnits =
33
+ this.feeItem?.blueprint.addOnInfo?.maxUnitsCharged ?? Infinity;
34
+ return this.quantity >= maxUnits;
35
+ }
36
+
37
+ get atMinUnits(): boolean {
38
+ const minUnits = this.feeItem?.blueprint.addOnInfo?.minUnitsCharged ?? 0;
39
+ return this.quantity <= minUnits;
40
+ }
41
+
42
+ private handleCheckboxClick(): void {
43
+ if (!this.isChecked) {
44
+ this.isChecked = true;
45
+ this.quantity = 1;
46
+ return;
47
+ }
48
+ this.isChecked = false;
49
+ this.quantity = 0;
50
+ }
51
+
52
+ private handleIncrement(): void {
53
+ if (this.atMaxUnits) return;
54
+ this.isChecked = true;
55
+ this.quantity += 1;
56
+ this.onQuantityChange?.({
57
+ id: this.feeItem?.id ?? 0,
58
+ quantity: this.quantity,
59
+ type: this.feeItem?.blueprint.addOnInfo?.addOnType ?? "",
60
+ });
61
+ }
62
+
63
+ private handleDecrement(): void {
64
+ if (this.atMinUnits) return;
65
+ this.quantity = Math.max(0, this.quantity - 1);
66
+ this.isChecked = this.quantity > 0;
67
+ this.onQuantityChange?.({
68
+ id: this.feeItem?.id ?? 0,
69
+ quantity: this.quantity,
70
+ type: this.feeItem?.blueprint.addOnInfo?.addOnType ?? "",
71
+ });
72
+ }
73
+
74
+ render(): TemplateResult {
75
+ if (!this.feeItem || !this.feeItem.blueprint.addOnInfo) return html``;
76
+
77
+ return html`
78
+ <div>
79
+ <div class="addon-container">
80
+ <div class="addon-left">
81
+ <input
82
+ type="checkbox"
83
+ ?checked=${this.isChecked}
84
+ @click=${this.handleCheckboxClick}
85
+ />
86
+ <div class="addon-info">
87
+ <p class="addon-title">${this.feeItem.displayName("Add-On")}</p>
88
+ </div>
89
+ </div>
90
+
91
+ <div class="addon-right">
92
+ <div class="quantity-control">
93
+ <button
94
+ class="quantity-button"
95
+ @click=${this.handleDecrement}
96
+ ?disabled=${this.quantity <= 0}
97
+ aria-label="Decrease quantity"
98
+ >
99
+ <span class="operator-sign">&minus;</span>
100
+ </button>
101
+ <span class="quantity-value">${this.quantity}</span>
102
+ <button
103
+ class="quantity-button"
104
+ @click=${this.handleIncrement}
105
+ aria-label="Increase quantity"
106
+ >
107
+ <span class="operator-sign">+</span>
108
+ </button>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </div>
113
+ `;
114
+ }
115
+ }
116
+
117
+ declare global {
118
+ interface HTMLElementTagNameMap {
119
+ "addon-item": AddonItem;
120
+ }
121
+ }
@@ -0,0 +1 @@
1
+ export * from "./addon-item";
@@ -0,0 +1,127 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ :host {
5
+ --transition-timing: 0.2s ease;
6
+ }
7
+
8
+ .fee-calculator-layout {
9
+ display: flex;
10
+ margin-top: 20px;
11
+ gap: 20px;
12
+ transition: margin-top var(--transition-timing),
13
+ padding var(--transition-timing), gap var(--transition-timing),
14
+ width var(--transition-timing), height var(--transition-timing);
15
+ }
16
+
17
+ .sidepanel {
18
+ flex: 0 0 300px;
19
+ display: flex;
20
+ margin-left: 20px;
21
+ background-color: white;
22
+ flex-direction: column;
23
+ max-width: 50%;
24
+ gap: 20px;
25
+ transition: width var(--transition-timing),
26
+ max-width var(--transition-timing), margin var(--transition-timing);
27
+ }
28
+
29
+ .sidepanel-section {
30
+ padding: 16px;
31
+ border-radius: 4px;
32
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
33
+ background-color: white;
34
+ transition: border-radius var(--transition-timing),
35
+ width var(--transition-timing), margin var(--transition-timing);
36
+ }
37
+
38
+ .sidepanel-section-title {
39
+ margin-top: 0;
40
+ margin-bottom: 12px;
41
+ font-size: 16px;
42
+ font-weight: 500;
43
+ color: #333;
44
+ }
45
+
46
+ .sidepanel-addons-container {
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: 12px;
50
+ }
51
+
52
+ .fees-container {
53
+ flex: 1;
54
+ display: flex;
55
+ flex-direction: column;
56
+ background-color: #f8f9fa;
57
+ gap: 16px;
58
+ transition: width var(--transition-timing), margin var(--transition-timing),
59
+ padding var(--transition-timing);
60
+ min-height: 300px;
61
+ }
62
+
63
+ .loading-container {
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ width: 100%;
68
+ height: 100%;
69
+ min-height: 300px;
70
+ flex: 1;
71
+ }
72
+
73
+ .empty-state {
74
+ display: flex;
75
+ justify-content: center;
76
+ align-items: center;
77
+ font-size: 16px;
78
+ height: 100%;
79
+ min-height: 300px;
80
+ }
81
+
82
+ @media (max-width: 768px) {
83
+ .fee-calculator-layout,
84
+ .sidepanel,
85
+ .fees-container,
86
+ .sidepanel-section {
87
+ width: 100%;
88
+ margin: 0;
89
+ padding: 0;
90
+ box-sizing: border-box;
91
+ }
92
+
93
+ .fee-calculator-layout {
94
+ flex-direction: column;
95
+ gap: 10px;
96
+ height: 100%;
97
+ }
98
+
99
+ .sidepanel {
100
+ max-width: 100%;
101
+ order: 1;
102
+ flex: none;
103
+ }
104
+
105
+ .fees-container {
106
+ order: 2;
107
+ min-height: auto;
108
+ }
109
+
110
+ .sidepanel-section {
111
+ border-radius: 0;
112
+ margin: 0 0 8px 0;
113
+ }
114
+
115
+ .loading-container {
116
+ height: auto;
117
+ min-height: 100px;
118
+ padding-top: 20px;
119
+ align-items: flex-start;
120
+ }
121
+
122
+ .empty-state {
123
+ height: auto;
124
+ min-height: 100px;
125
+ }
126
+ }
127
+ `;
@@ -0,0 +1,191 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { BuildingFee, RecurrenceFrequency } from "../../model/building-fee";
4
+ import { ALL_LAYOUTS_OPTION } from "../../constants";
5
+ import feeCalculatorLayoutStyles from "./fee-calculator-layout-styles";
6
+ import { LayoutOption } from "../../../../fetchBuildingWebchatView";
7
+ import {
8
+ CalculateQuoteResponse,
9
+ DesiredAddon,
10
+ FeeEstimate,
11
+ } from "../../../../services/fees/calculateQuote";
12
+
13
+ import "../floor-plan-selector/floor-plan-selector";
14
+ import "../fee-card/fee-card";
15
+ import "../addon-item/addon-item";
16
+ import "../../../mega-loader";
17
+
18
+ @customElement("fee-calculator-layout")
19
+ export class FeeCalculatorLayout extends LitElement {
20
+ static styles = feeCalculatorLayoutStyles;
21
+
22
+ @property({ type: String })
23
+ buildingSlug = "";
24
+
25
+ @property({ type: Boolean })
26
+ isLoading = false;
27
+
28
+ @property({ type: Number })
29
+ selectedUnitId: number | null = null;
30
+
31
+ @property({ type: Object })
32
+ quote: CalculateQuoteResponse | null = null;
33
+
34
+ @property({ type: Array })
35
+ layoutOptions: LayoutOption[] = [];
36
+
37
+ @property({ type: Array })
38
+ selectedLayoutIds: number[] = [ALL_LAYOUTS_OPTION];
39
+
40
+ @property({ type: Object })
41
+ groupedFees: Record<RecurrenceFrequency, BuildingFee[]> = {
42
+ [RecurrenceFrequency.OneTime]: [],
43
+ [RecurrenceFrequency.Daily]: [],
44
+ [RecurrenceFrequency.Weekly]: [],
45
+ [RecurrenceFrequency.BiWeekly]: [],
46
+ [RecurrenceFrequency.Monthly]: [],
47
+ [RecurrenceFrequency.Yearly]: [],
48
+ [RecurrenceFrequency.Unknown]: [],
49
+ };
50
+
51
+ @property()
52
+ onSelectLayout: ((layoutIds: number[]) => void) | null = null;
53
+
54
+ @property()
55
+ onUnitSelect: ((unitId: number) => void) | null = null;
56
+
57
+ @property()
58
+ onMoveInDateChange: ((moveInDate: Date) => void) | null = null;
59
+
60
+ @property()
61
+ onLeaseTermChange: ((leaseTerm: number) => void) | null = null;
62
+
63
+ @property()
64
+ onAddonSelect: ((addon: DesiredAddon) => void) | null = null;
65
+
66
+ get standardFees(): Record<RecurrenceFrequency, BuildingFee[]> {
67
+ const result: Record<RecurrenceFrequency, BuildingFee[]> = {} as Record<
68
+ RecurrenceFrequency,
69
+ BuildingFee[]
70
+ >;
71
+
72
+ Object.entries(this.groupedFees).forEach(([frequency, fees]) => {
73
+ result[frequency as RecurrenceFrequency] = fees.filter(
74
+ (fee) => !fee.isAddOn
75
+ );
76
+ });
77
+
78
+ return result;
79
+ }
80
+
81
+ get addOns(): BuildingFee[] {
82
+ return Object.values(this.groupedFees)
83
+ .flat()
84
+ .filter((fee) => fee.isAddOn);
85
+ }
86
+
87
+ renderRecurrenceFeeSection(
88
+ title: string,
89
+ fees: FeeEstimate[]
90
+ ): TemplateResult | null {
91
+ if (!fees?.length) return null;
92
+
93
+ return html` <fee-card .fees=${fees} title=${title}></fee-card> `;
94
+ }
95
+
96
+ renderFeeSections(): TemplateResult[] {
97
+ const sections: TemplateResult[] = [];
98
+
99
+ const frequencyOrder = [
100
+ { freq: RecurrenceFrequency.Yearly, title: "Yearly Charges" },
101
+ { freq: RecurrenceFrequency.Monthly, title: "Monthly Charges" },
102
+ { freq: RecurrenceFrequency.BiWeekly, title: "Bi-Weekly Charges" },
103
+ { freq: RecurrenceFrequency.Weekly, title: "Weekly Charges" },
104
+ { freq: RecurrenceFrequency.Daily, title: "Daily Charges" },
105
+ { freq: RecurrenceFrequency.Unknown, title: "Other Charges" },
106
+ { freq: RecurrenceFrequency.OneTime, title: "Prior to Move-In" },
107
+ ];
108
+
109
+ const unitFees =
110
+ this.quote?.units.find((unit) => unit.unitId === this.selectedUnitId)
111
+ ?.fees ?? [];
112
+
113
+ for (const { freq, title } of frequencyOrder) {
114
+ if (!unitFees.length) continue;
115
+
116
+ const fees = unitFees.filter((fee) => fee.frequency === freq);
117
+ const section = this.renderRecurrenceFeeSection(title, fees);
118
+ if (section) sections.push(section);
119
+ }
120
+
121
+ return sections;
122
+ }
123
+
124
+ renderFeesContent(): TemplateResult {
125
+ if (!this.selectedUnitId) {
126
+ return html`
127
+ <div class="fees-container empty-state">
128
+ <p>Select a unit to view estimated costs</p>
129
+ </div>
130
+ `;
131
+ }
132
+
133
+ return html`
134
+ <div class="fees-container">
135
+ ${this.isLoading
136
+ ? html`
137
+ <div class="loading-container">
138
+ <mega-loader></mega-loader>
139
+ </div>
140
+ `
141
+ : this.renderFeeSections()}
142
+ </div>
143
+ `;
144
+ }
145
+
146
+ render(): TemplateResult {
147
+ return html`
148
+ <div class="fee-calculator-layout">
149
+ <div class="sidepanel">
150
+ <div class="sidepanel-section">
151
+ <floor-plan-selector
152
+ .layoutOptions=${this.layoutOptions}
153
+ .selectedLayoutIds=${this.selectedLayoutIds}
154
+ .onSelectLayout=${this.onSelectLayout}
155
+ .onUnitSelect=${this.onUnitSelect}
156
+ .onMoveInDateChange=${this.onMoveInDateChange}
157
+ .onLeaseTermChange=${this.onLeaseTermChange}
158
+ .buildingSlug=${this.buildingSlug}
159
+ ></floor-plan-selector>
160
+ </div>
161
+
162
+ ${this.addOns.length
163
+ ? html`
164
+ <div class="sidepanel-section">
165
+ <h5 class="sidepanel-section-title">Add-Ons</h5>
166
+ <div class="sidepanel-addons-container">
167
+ ${this.addOns.map(
168
+ (addon) => html`
169
+ <add-on-item
170
+ .feeItem=${addon}
171
+ .onQuantityChange=${this.onAddonSelect}
172
+ ></add-on-item>
173
+ `
174
+ )}
175
+ </div>
176
+ </div>
177
+ `
178
+ : ""}
179
+ </div>
180
+
181
+ ${this.renderFeesContent()}
182
+ </div>
183
+ `;
184
+ }
185
+ }
186
+
187
+ declare global {
188
+ interface HTMLElementTagNameMap {
189
+ "fee-calculator-layout": FeeCalculatorLayout;
190
+ }
191
+ }
@@ -0,0 +1,65 @@
1
+ import { css } from "lit";
2
+
3
+ const collapsibleFeeSectionStyles = css`
4
+ .fee-card-section-container {
5
+ margin: 0 12px;
6
+ border-radius: 4px;
7
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
8
+ background-color: white;
9
+ overflow: hidden;
10
+ }
11
+
12
+ .fee-card-section-header {
13
+ margin: 20px 0;
14
+ padding: 0 12px;
15
+ border-bottom: 1px solid #e0e0e0;
16
+ }
17
+
18
+ .fee-item-container {
19
+ border-bottom: 1px solid #e0e0e0;
20
+ }
21
+
22
+ .fee-item-container:last-child {
23
+ border-bottom: none;
24
+ }
25
+
26
+ .fee-card-list {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 8px;
30
+ }
31
+
32
+ .section-title {
33
+ font-size: 1.2rem;
34
+ font-weight: normal;
35
+ }
36
+
37
+ .section-title-addons {
38
+ margin-top: 8px;
39
+ margin-left: 20px;
40
+ font-size: 0.8rem;
41
+ color: #868e96;
42
+ }
43
+
44
+ .total-amount,
45
+ .total-label {
46
+ font-size: 1rem;
47
+ font-weight: normal;
48
+ margin: 12px;
49
+ }
50
+
51
+ .footer-container {
52
+ background-color: #f8f9fa;
53
+ margin: 20px;
54
+ border-radius: 4px;
55
+ }
56
+
57
+ .footer {
58
+ font-size: 0.8rem;
59
+ display: flex;
60
+ margin: 12px;
61
+ justify-content: space-between;
62
+ }
63
+ `;
64
+
65
+ export default collapsibleFeeSectionStyles;
@@ -0,0 +1,91 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property, state } from "lit/decorators.js";
3
+ import { formatCurrency } from "../../../../utils";
4
+ import collapsibleFeeSectionStyles from "./fee-card-styles";
5
+ import { FeeEstimate } from "../../../../services/fees/calculateQuote";
6
+
7
+ import "../fee-item/fee-item";
8
+
9
+ @customElement("fee-card")
10
+ export class FeeCard extends LitElement {
11
+ static styles = collapsibleFeeSectionStyles;
12
+
13
+ @property({ type: String })
14
+ title = "Fees";
15
+
16
+ @property({ type: Array })
17
+ fees: FeeEstimate[] = [];
18
+
19
+ @property({ type: Number })
20
+ rent = 0;
21
+
22
+ @property({ type: Number })
23
+ quoteTotal = 0;
24
+
25
+ @state()
26
+ private buildingFeesToQuantity: Record<number, number> = {};
27
+
28
+ get totalAmount(): string {
29
+ if (this.quoteTotal) return formatCurrency(this.quoteTotal);
30
+
31
+ const total = this.fees.reduce((acc, fee) => acc + fee.amount, 0);
32
+ return formatCurrency(total);
33
+ }
34
+
35
+ get standardFees(): FeeEstimate[] {
36
+ return this.fees.filter((fee) => !fee.isAddOn);
37
+ }
38
+
39
+ get addons(): FeeEstimate[] {
40
+ return this.fees.filter((fee) => fee.isAddOn);
41
+ }
42
+
43
+ handleQuantityChange = (feeId: number, quantity: number): void => {
44
+ this.buildingFeesToQuantity[feeId] = quantity;
45
+ this.requestUpdate();
46
+ };
47
+
48
+ render(): TemplateResult {
49
+ return html`
50
+ <div class="fee-card-section-container">
51
+ <div class="fee-card-section-header">
52
+ <h1 class="section-title">${this.title}</h1>
53
+ </div>
54
+
55
+ <div class="fee-card-list">
56
+ ${this.standardFees.map(
57
+ (item) => html`<div class="fee-item-container">
58
+ <fee-item .feeItem=${item}></fee-item>
59
+ </div>`
60
+ )}
61
+ </div>
62
+
63
+ ${this.addons.length > 0
64
+ ? html`
65
+ <div class="fee-card-list">
66
+ <div class="section-title-addons">Add-Ons</div>
67
+ ${this.addons.map(
68
+ (item) => html`<div class="fee-item-container">
69
+ <fee-item .feeItem=${item}></fee-item>
70
+ </div>`
71
+ )}
72
+ </div>
73
+ `
74
+ : ""}
75
+
76
+ <div class="footer-container">
77
+ <div class="footer">
78
+ <h1 class="total-label">Estimated Total</h1>
79
+ <h1 class="total-amount">${this.totalAmount}</h1>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ `;
84
+ }
85
+ }
86
+
87
+ declare global {
88
+ interface HTMLElementTagNameMap {
89
+ "fee-card": FeeCard;
90
+ }
91
+ }