@meetelise/chat 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item/addon-item.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item/rentable-item.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +0 -7
- package/package.json +1 -1
- package/public/dist/index.js +153 -131
- package/src/WebComponent/FeeCalculator/components/addons/addon-item/addon-item.ts +27 -39
- package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +24 -21
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item/rentable-item.ts +29 -47
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +9 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +39 -27
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +39 -28
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +6 -2
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +5 -26
package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item/rentable-item.d.ts
CHANGED
|
@@ -5,14 +5,12 @@ export declare class RentableItem extends LitElement {
|
|
|
5
5
|
static styles: import("lit").CSSResult;
|
|
6
6
|
rentableItem: RentableItemSummary | null;
|
|
7
7
|
onSelect: ((rentableItem: DesiredRentableItem) => void) | null;
|
|
8
|
-
private isChecked;
|
|
9
8
|
private quantity;
|
|
10
9
|
selectedItemIds: Set<string>;
|
|
11
10
|
get totalAvailableItems(): number;
|
|
12
11
|
get quantityLeft(): number;
|
|
13
12
|
get atMaxUnits(): boolean;
|
|
14
13
|
get atMinUnits(): boolean;
|
|
15
|
-
private handleCheckboxClick;
|
|
16
14
|
private handleIncrement;
|
|
17
15
|
private handleDecrement;
|
|
18
16
|
private emitChange;
|
|
@@ -9,6 +9,7 @@ import "../fee-card/fee-card";
|
|
|
9
9
|
import "../addons/addon-item/addon-item";
|
|
10
10
|
import "../addons/rentable-item/rentable-item";
|
|
11
11
|
import "../../../loaders/skeleton-loader";
|
|
12
|
+
import "../../../loaders/mega-loader";
|
|
12
13
|
export declare class FeeCalculatorLayout extends LitElement {
|
|
13
14
|
static styles: import("lit").CSSResult;
|
|
14
15
|
buildingSlug: string;
|
|
@@ -33,6 +34,7 @@ export declare class FeeCalculatorLayout extends LitElement {
|
|
|
33
34
|
renderRecurrenceFeeSection(title: string, fees: FeeEstimate[]): TemplateResult | null;
|
|
34
35
|
renderFeeSections(): TemplateResult[];
|
|
35
36
|
renderFeesContent(): TemplateResult;
|
|
37
|
+
renderAddOns(): TemplateResult | null;
|
|
36
38
|
render(): TemplateResult;
|
|
37
39
|
}
|
|
38
40
|
declare global {
|
package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare class FloorPlanSelector extends LitElement {
|
|
|
24
24
|
handleLayoutChange: (ids: number[]) => Promise<void>;
|
|
25
25
|
handleMoveInDateChange: (e: Event) => Promise<void>;
|
|
26
26
|
handleLeaseTermChange: (e: Event) => Promise<void>;
|
|
27
|
+
renderUnitSelection: () => TemplateResult;
|
|
27
28
|
render(): TemplateResult;
|
|
28
29
|
}
|
|
29
30
|
declare global {
|
|
@@ -27,13 +27,6 @@ export declare class FeeCalculator extends LitElement {
|
|
|
27
27
|
private moveInDate;
|
|
28
28
|
private buildingWebchatView;
|
|
29
29
|
private incentives;
|
|
30
|
-
enabledChatWidgets: {
|
|
31
|
-
callDesktop: boolean;
|
|
32
|
-
chatDesktop: boolean;
|
|
33
|
-
emailDesktop: boolean;
|
|
34
|
-
textDesktop: boolean;
|
|
35
|
-
sstDesktop: boolean;
|
|
36
|
-
};
|
|
37
30
|
quote: CalculateQuoteResponse | null;
|
|
38
31
|
private groupedFees;
|
|
39
32
|
private rentableItems;
|
package/package.json
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -3382,7 +3382,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3382
3382
|
margin-right: 8px;
|
|
3383
3383
|
}
|
|
3384
3384
|
}
|
|
3385
|
-
`;var Ao=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let So=class extends oe{constructor(){super(...arguments),this.unit={},this.onUnitSelect=null,this.selected=!1}get bedAndBathText(){return`${this.unit.numberOfBedrooms}bd | ${this.unit.numberOfBathrooms}ba`}get priceRange(){return this.unit.startingPrice===this.unit.maxPrice?`$${this.unit.startingPrice}`:`$${this.unit.startingPrice} - $${this.unit.maxPrice}`}handleOnUnitSelect(){var e;this.selected||(this.selected=!this.selected,null===(e=this.onUnitSelect)||void 0===e||e.call(this,this.unit))}handleOnImgClick(e){const t=e.target;window.open(t.src,"_blank")}render(){var e;return L`
|
|
3385
|
+
`;var Ao=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let So=class extends oe{constructor(){super(...arguments),this.unit={},this.onUnitSelect=null,this.selected=!1}get bedAndBathText(){return`${0===this.unit.numberOfBedrooms?"studio":`${this.unit.numberOfBedrooms}bd`} | ${this.unit.numberOfBathrooms}ba`}get priceRange(){return this.unit.startingPrice===this.unit.maxPrice?`$${this.unit.startingPrice}`:`$${this.unit.startingPrice} - $${this.unit.maxPrice}`}handleOnUnitSelect(){var e;this.selected||(this.selected=!this.selected,null===(e=this.onUnitSelect)||void 0===e||e.call(this,this.unit))}handleOnImgClick(e){const t=e.target;window.open(t.src,"_blank")}render(){var e;return L`
|
|
3386
3386
|
<div class="floorplan-image-card ${this.selected?"selected":""}">
|
|
3387
3387
|
<div class="section-left">
|
|
3388
3388
|
<img
|
|
@@ -3393,7 +3393,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3393
3393
|
</div>
|
|
3394
3394
|
<div class="section-right" @click=${this.handleOnUnitSelect}>
|
|
3395
3395
|
<p class="image-card-title">
|
|
3396
|
-
${this.unit.
|
|
3396
|
+
Unit ${this.unit.unitNumber} | ${this.priceRange}
|
|
3397
3397
|
</p>
|
|
3398
3398
|
<p class="image-card-subtitle">
|
|
3399
3399
|
${this.bedAndBathText} | ${this.unit.squareFootage} ft |
|
|
@@ -3419,7 +3419,32 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3419
3419
|
transform: rotate(360deg);
|
|
3420
3420
|
}
|
|
3421
3421
|
}
|
|
3422
|
-
`,ko([le({type:Number})],Eo.prototype,"size",void 0),Eo=ko([ae("mega-loader")],Eo);var To=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let _o=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[uo],this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.moveInDate=pi,this.leaseTerm=12,this.units=[],this.selectedUnit=null,this.isLoading=!1,this.fetchUnits=async()=>{this.isLoading=!0;const e=1===this.selectedLayoutIds.length?0===(t=this.selectedLayoutIds[0])?0:Math.floor(t/10):void 0;var t;try{return(await wo({buildingSlug:this.buildingSlug,moveInDateEarliest:this.moveInDate?this.moveInDate:void 0,...this.selectedLayoutIds.includes(uo)?{}:{numBedrooms:e},leaseTermMin:this.leaseTerm})).filter((e=>!!e.floorplanUrl))}finally{this.isLoading=!1}},this.firstUpdated=async()=>{this.units=await this.fetchUnits()},this.handleUnitSelect=e=>{var t;this.selectedUnit=e,null===(t=this.onUnitSelect)||void 0===t||t.call(this,e)},this.handleLayoutChange=async e=>{var t;this.selectedLayoutIds=e,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds),this.units=await this.fetchUnits()},this.handleMoveInDateChange=async e=>{var t;const i=e.target.value;let n;n=i?new Date(i):pi,this.moveInDate=n,null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,n),this.units=await this.fetchUnits()},this.handleLeaseTermChange=async e=>{var t;this.leaseTerm=parseInt(e.target.value),null===(t=this.onLeaseTermChange)||void 0===t||t.call(this,this.leaseTerm),this.units=await this.fetchUnits()}
|
|
3422
|
+
`,ko([le({type:Number})],Eo.prototype,"size",void 0),Eo=ko([ae("mega-loader")],Eo);var To=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let _o=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[uo],this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.moveInDate=pi,this.leaseTerm=12,this.units=[],this.selectedUnit=null,this.isLoading=!1,this.fetchUnits=async()=>{this.isLoading=!0;const e=1===this.selectedLayoutIds.length?0===(t=this.selectedLayoutIds[0])?0:Math.floor(t/10):void 0;var t;try{return(await wo({buildingSlug:this.buildingSlug,moveInDateEarliest:this.moveInDate?this.moveInDate:void 0,...this.selectedLayoutIds.includes(uo)?{}:{numBedrooms:e},leaseTermMin:this.leaseTerm})).filter((e=>!!e.floorplanUrl))}finally{this.isLoading=!1}},this.firstUpdated=async()=>{this.units=await this.fetchUnits()},this.handleUnitSelect=e=>{var t;this.selectedUnit=e,null===(t=this.onUnitSelect)||void 0===t||t.call(this,e)},this.handleLayoutChange=async e=>{var t;this.selectedLayoutIds=e,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds),this.units=await this.fetchUnits()},this.handleMoveInDateChange=async e=>{var t;const i=e.target.value;let n;n=i?new Date(i):pi,this.moveInDate=n,null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,n),this.units=await this.fetchUnits()},this.handleLeaseTermChange=async e=>{var t;this.leaseTerm=parseInt(e.target.value),null===(t=this.onLeaseTermChange)||void 0===t||t.call(this,this.leaseTerm),this.units=await this.fetchUnits()},this.renderUnitSelection=()=>{var e,t;return this.isLoading?L`
|
|
3423
|
+
<div class="unit-selection">
|
|
3424
|
+
<div class="unit-label">Select Unit</div>
|
|
3425
|
+
<div class="loading-container">
|
|
3426
|
+
<mega-loader size="32"></mega-loader>
|
|
3427
|
+
</div>
|
|
3428
|
+
</div>
|
|
3429
|
+
`:L`
|
|
3430
|
+
<div class="unit-selection">
|
|
3431
|
+
<div class="unit-label">Select Unit</div>
|
|
3432
|
+
<div class="image-carousel">
|
|
3433
|
+
${0===(null===(e=this.units)||void 0===e?void 0:e.length)?L`
|
|
3434
|
+
<div class="no-floorplans-container">
|
|
3435
|
+
<p>No floorplans found</p>
|
|
3436
|
+
</div>
|
|
3437
|
+
`:""}
|
|
3438
|
+
${null===(t=this.units)||void 0===t?void 0:t.map((e=>{var t;return L`
|
|
3439
|
+
<floorplan-image-card
|
|
3440
|
+
.unit=${e}
|
|
3441
|
+
.onUnitSelect=${this.handleUnitSelect}
|
|
3442
|
+
.selected=${(null===(t=this.selectedUnit)||void 0===t?void 0:t.id)===e.id}
|
|
3443
|
+
></floorplan-image-card>
|
|
3444
|
+
`}))}
|
|
3445
|
+
</div>
|
|
3446
|
+
</div>
|
|
3447
|
+
`}}get displayOptions(){const e=e=>{let t=e;return Object.entries({zero:"0",one:"1",two:"2",three:"3",four:"4",five:"5",six:"6",seven:"7",eight:"8",nine:"9",ten:"10",eleven:"11",twelve:"12"}).forEach((([e,i])=>{const n=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(n,i)})),t};return[{value:uo,label:"All"},...this.layoutOptions].map((t=>({...t,label:e(t.label.replace(/bedroom/gi,"bd"))}))).sort(((e,t)=>e.value-t.value))}render(){var e,t;return L`
|
|
3423
3448
|
<div class="floor-plan-selector">
|
|
3424
3449
|
<div class="floor-plan-selector-label">Select Floor Plan</div>
|
|
3425
3450
|
<div class="floor-plan-selector-badges">
|
|
@@ -3454,28 +3479,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3454
3479
|
/>
|
|
3455
3480
|
</div>
|
|
3456
3481
|
</div>
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
<div class="image-carousel">
|
|
3460
|
-
${this.isLoading?L`
|
|
3461
|
-
<div class="loading-container">
|
|
3462
|
-
<mega-loader size="32"></mega-loader>
|
|
3463
|
-
</div>
|
|
3464
|
-
`:""}
|
|
3465
|
-
${this.isLoading||0!==(null===(i=this.units)||void 0===i?void 0:i.length)?"":L`
|
|
3466
|
-
<div class="no-floorplans-container">
|
|
3467
|
-
<p>No floorplans found</p>
|
|
3468
|
-
</div>
|
|
3469
|
-
`}
|
|
3470
|
-
${null===(n=this.units)||void 0===n?void 0:n.map((e=>{var t;return L`
|
|
3471
|
-
<floorplan-image-card
|
|
3472
|
-
.unit=${e}
|
|
3473
|
-
.onUnitSelect=${this.handleUnitSelect}
|
|
3474
|
-
.selected=${(null===(t=this.selectedUnit)||void 0===t?void 0:t.id)===e.id}
|
|
3475
|
-
></floorplan-image-card>
|
|
3476
|
-
`}))}
|
|
3477
|
-
</div>
|
|
3478
|
-
</div>
|
|
3482
|
+
|
|
3483
|
+
${this.renderUnitSelection()}
|
|
3479
3484
|
</div>
|
|
3480
3485
|
</div>
|
|
3481
3486
|
`}};_o.styles=Co,To([le({type:String})],_o.prototype,"buildingSlug",void 0),To([le({type:Array})],_o.prototype,"layoutOptions",void 0),To([le({type:Array})],_o.prototype,"selectedLayoutIds",void 0),To([le()],_o.prototype,"onSelectLayout",void 0),To([le()],_o.prototype,"onUnitSelect",void 0),To([le()],_o.prototype,"onMoveInDateChange",void 0),To([le()],_o.prototype,"onLeaseTermChange",void 0),To([ue()],_o.prototype,"moveInDate",void 0),To([ue()],_o.prototype,"leaseTerm",void 0),To([ue()],_o.prototype,"units",void 0),To([ue()],_o.prototype,"selectedUnit",void 0),To([ue()],_o.prototype,"isLoading",void 0),_o=To([ae("floor-plan-selector")],_o);const Oo=l`
|
|
@@ -3543,33 +3548,47 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3543
3548
|
display: block;
|
|
3544
3549
|
}
|
|
3545
3550
|
|
|
3551
|
+
p {
|
|
3552
|
+
margin: 0;
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3546
3555
|
.addon-container {
|
|
3547
3556
|
border: 1px solid #e5e7eb;
|
|
3548
3557
|
border-radius: 0.375rem;
|
|
3549
|
-
display: flex;
|
|
3550
|
-
padding: 0.5rem;
|
|
3551
3558
|
align-items: center;
|
|
3552
|
-
justify-content: space-between;
|
|
3553
3559
|
}
|
|
3554
3560
|
|
|
3555
|
-
.addon-
|
|
3561
|
+
.addon-inner-container {
|
|
3556
3562
|
display: flex;
|
|
3557
|
-
flex:
|
|
3563
|
+
flex-direction: column;
|
|
3564
|
+
gap: 8px;
|
|
3565
|
+
margin: 12px;
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
.addon-header {
|
|
3569
|
+
display: flex;
|
|
3570
|
+
justify-content: space-between;
|
|
3558
3571
|
}
|
|
3559
3572
|
|
|
3560
|
-
.addon-
|
|
3561
|
-
|
|
3573
|
+
.addon-header-right {
|
|
3574
|
+
color: #838385;
|
|
3562
3575
|
}
|
|
3563
3576
|
|
|
3564
3577
|
.addon-title {
|
|
3565
3578
|
font-size: 0.875rem;
|
|
3566
|
-
font-weight: 500;
|
|
3567
3579
|
color: #374151;
|
|
3568
3580
|
}
|
|
3569
3581
|
|
|
3570
|
-
.addon-
|
|
3582
|
+
.addon-body {
|
|
3583
|
+
width: 100%;
|
|
3584
|
+
}
|
|
3585
|
+
|
|
3586
|
+
.quantity-control {
|
|
3571
3587
|
display: flex;
|
|
3572
|
-
justify-content:
|
|
3588
|
+
justify-content: space-between;
|
|
3589
|
+
align-items: center;
|
|
3590
|
+
border: 1px solid #dee2e6;
|
|
3591
|
+
border-radius: 0.2;
|
|
3573
3592
|
}
|
|
3574
3593
|
|
|
3575
3594
|
.operator-sign {
|
|
@@ -3581,13 +3600,6 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3581
3600
|
text-align: center;
|
|
3582
3601
|
}
|
|
3583
3602
|
|
|
3584
|
-
.quantity-control {
|
|
3585
|
-
display: flex;
|
|
3586
|
-
align-items: center;
|
|
3587
|
-
border: 1px solid #dee2e6;
|
|
3588
|
-
border-radius: 0.2;
|
|
3589
|
-
}
|
|
3590
|
-
|
|
3591
3603
|
.quantity-button {
|
|
3592
3604
|
font-size: 1.2rem;
|
|
3593
3605
|
padding: 0.5rem;
|
|
@@ -3610,41 +3622,37 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3610
3622
|
padding: 0.25rem;
|
|
3611
3623
|
font-size: 0.875rem;
|
|
3612
3624
|
}
|
|
3613
|
-
|
|
3614
|
-
.total-cost {
|
|
3615
|
-
display: none;
|
|
3616
|
-
}
|
|
3617
|
-
`;var No=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Io=class extends oe{constructor(){super(...arguments),this.feeItem=null,this.onQuantityChange=null,this.isChecked=!1,this.quantity=0}get totalCost(){var e,t;const i=(null!==(t=null===(e=this.feeItem)||void 0===e?void 0:e.blueprint.transactionAmount)&&void 0!==t?t:0)*this.quantity;return Ci(i)}get atMaxUnits(){var e,t,i;const n=null!==(i=null===(t=null===(e=this.feeItem)||void 0===e?void 0:e.blueprint.addOnInfo)||void 0===t?void 0:t.maxUnitsAllowed)&&void 0!==i?i:1/0;return this.quantity>=n}get atMinUnits(){var e,t,i;const n=null!==(i=null===(t=null===(e=this.feeItem)||void 0===e?void 0:e.blueprint.addOnInfo)||void 0===t?void 0:t.minUnitsAllowed)&&void 0!==i?i:0;return this.quantity<=n}handleCheckboxClick(){if(!this.isChecked)return this.isChecked=!0,void(this.quantity=1);this.isChecked=!1,this.quantity=0}handleIncrement(){var e,t,i,n,o,r;this.atMaxUnits||(this.isChecked=!0,this.quantity+=1,null===(e=this.onQuantityChange)||void 0===e||e.call(this,{id:null!==(i=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==i?i:0,quantity:this.quantity,type:null!==(r=null===(o=null===(n=this.feeItem)||void 0===n?void 0:n.blueprint.addOnInfo)||void 0===o?void 0:o.addOnType)&&void 0!==r?r:""}))}handleDecrement(){var e,t,i,n,o,r;this.atMinUnits||(this.quantity=Math.max(0,this.quantity-1),this.isChecked=this.quantity>0,null===(e=this.onQuantityChange)||void 0===e||e.call(this,{id:null!==(i=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==i?i:0,quantity:this.quantity,type:null!==(r=null===(o=null===(n=this.feeItem)||void 0===n?void 0:n.blueprint.addOnInfo)||void 0===o?void 0:o.addOnType)&&void 0!==r?r:""}))}render(){return this.feeItem&&this.feeItem.blueprint.addOnInfo?L`
|
|
3625
|
+
`;var No=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Io=class extends oe{constructor(){super(...arguments),this.feeItem=null,this.onQuantityChange=null,this.isChecked=!1,this.quantity=0}get totalCost(){var e,t;const i=(null!==(t=null===(e=this.feeItem)||void 0===e?void 0:e.blueprint.transactionAmount)&&void 0!==t?t:0)*this.quantity;return Ci(i)}get atMaxUnits(){var e,t,i;const n=null!==(i=null===(t=null===(e=this.feeItem)||void 0===e?void 0:e.blueprint.addOnInfo)||void 0===t?void 0:t.maxUnitsAllowed)&&void 0!==i?i:1/0;return this.quantity>=n}get atMinUnits(){var e,t,i;const n=null!==(i=null===(t=null===(e=this.feeItem)||void 0===e?void 0:e.blueprint.addOnInfo)||void 0===t?void 0:t.minUnitsAllowed)&&void 0!==i?i:0;return this.quantity<=n}handleIncrement(){var e,t,i,n,o,r;this.atMaxUnits||(this.quantity+=1,null===(e=this.onQuantityChange)||void 0===e||e.call(this,{id:null!==(i=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==i?i:0,quantity:this.quantity,type:null!==(r=null===(o=null===(n=this.feeItem)||void 0===n?void 0:n.blueprint.addOnInfo)||void 0===o?void 0:o.addOnType)&&void 0!==r?r:""}))}handleDecrement(){var e,t,i,n,o,r;this.atMinUnits||(this.quantity=Math.max(0,this.quantity-1),null===(e=this.onQuantityChange)||void 0===e||e.call(this,{id:null!==(i=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==i?i:0,quantity:this.quantity,type:null!==(r=null===(o=null===(n=this.feeItem)||void 0===n?void 0:n.blueprint.addOnInfo)||void 0===o?void 0:o.addOnType)&&void 0!==r?r:""}))}render(){return this.feeItem&&this.feeItem.blueprint.addOnInfo?L`
|
|
3618
3626
|
<div class="addon-container">
|
|
3619
|
-
<div class="addon-
|
|
3620
|
-
<
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
<p class="addon-title">${this.feeItem.displayName("Add-On")}</p>
|
|
3627
|
+
<div class="addon-inner-container">
|
|
3628
|
+
<div class="addon-header">
|
|
3629
|
+
<div class="addon-header-left">
|
|
3630
|
+
<p class="addon-title">${this.feeItem.displayName("Add-On")}</p>
|
|
3631
|
+
</div>
|
|
3632
|
+
<!-- TODO(Leo): If we add max_units_allowed, put that here -->
|
|
3633
|
+
<div class="addon-header-right"></div>
|
|
3627
3634
|
</div>
|
|
3628
|
-
</div>
|
|
3629
3635
|
|
|
3630
|
-
|
|
3631
|
-
<div class="
|
|
3632
|
-
<
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3636
|
+
<!-- TODO: Need to create one control per type in matrix -->
|
|
3637
|
+
<div class="addon-body">
|
|
3638
|
+
<div class="quantity-control">
|
|
3639
|
+
<button
|
|
3640
|
+
class="quantity-button"
|
|
3641
|
+
@click=${this.handleDecrement}
|
|
3642
|
+
?disabled=${this.quantity<=0}
|
|
3643
|
+
aria-label="Decrease quantity"
|
|
3644
|
+
>
|
|
3645
|
+
<span class="operator-sign">−</span>
|
|
3646
|
+
</button>
|
|
3647
|
+
<span class="quantity-value">${this.quantity}</span>
|
|
3648
|
+
<button
|
|
3649
|
+
class="quantity-button"
|
|
3650
|
+
@click=${this.handleIncrement}
|
|
3651
|
+
aria-label="Increase quantity"
|
|
3652
|
+
>
|
|
3653
|
+
<span class="operator-sign">+</span>
|
|
3654
|
+
</button>
|
|
3655
|
+
</div>
|
|
3648
3656
|
</div>
|
|
3649
3657
|
</div>
|
|
3650
3658
|
</div>
|
|
@@ -3783,6 +3791,15 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3783
3791
|
min-height: 300px;
|
|
3784
3792
|
}
|
|
3785
3793
|
|
|
3794
|
+
.sidepanel-loading-container {
|
|
3795
|
+
display: flex;
|
|
3796
|
+
justify-content: center;
|
|
3797
|
+
align-items: center;
|
|
3798
|
+
width: 100%;
|
|
3799
|
+
height: 100%;
|
|
3800
|
+
min-height: 5rem;
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3786
3803
|
.loading-container {
|
|
3787
3804
|
display: flex;
|
|
3788
3805
|
justify-content: flex-start;
|
|
@@ -3854,43 +3871,42 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3854
3871
|
box-sizing: border-box;
|
|
3855
3872
|
}
|
|
3856
3873
|
}
|
|
3857
|
-
`;var jo=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Ho=class extends oe{constructor(){super(...arguments),this.rentableItem=null,this.onSelect=null,this.
|
|
3874
|
+
`;var jo=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Ho=class extends oe{constructor(){super(...arguments),this.rentableItem=null,this.onSelect=null,this.quantity=0,this.selectedItemIds=new Set}get totalAvailableItems(){var e,t,i;return null!==(i=null===(t=null===(e=this.rentableItem)||void 0===e?void 0:e.allItems)||void 0===t?void 0:t.filter((e=>e.available)).length)&&void 0!==i?i:0}get quantityLeft(){return this.totalAvailableItems-this.quantity}get atMaxUnits(){return this.quantity>=this.totalAvailableItems}get atMinUnits(){return this.quantity<=0}handleIncrement(){this.atMaxUnits||(this.quantity+=1,this.emitChange())}handleDecrement(){this.atMinUnits||(this.quantity=Math.max(0,this.quantity-1),this.emitChange())}emitChange(){var e;if(!this.rentableItem)return;const t=this.rentableItem.allItems.find((e=>e.available&&!this.selectedItemIds.has(e.id)));t&&(this.selectedItemIds.add(t.id),null===(e=this.onSelect)||void 0===e||e.call(this,{id:parseInt(t.id),type:this.rentableItem.type}))}render(){if(!this.rentableItem)return L``;const e=this.totalAvailableItems>0;return L`
|
|
3858
3875
|
<div class="addon-container">
|
|
3859
|
-
<div class="addon-
|
|
3860
|
-
<
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
<p class="addon-title">${this.rentableItem.description}</p>
|
|
3876
|
+
<div class="addon-inner-container">
|
|
3877
|
+
<div class="addon-header">
|
|
3878
|
+
<div class="addon-header-left">
|
|
3879
|
+
<p class="addon-title">${this.rentableItem.type}</p>
|
|
3880
|
+
</div>
|
|
3881
|
+
<div class="addon-header-right">
|
|
3882
|
+
<p>${this.quantityLeft} Max</p>
|
|
3883
|
+
</div>
|
|
3868
3884
|
</div>
|
|
3869
|
-
</div>
|
|
3870
3885
|
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3886
|
+
<div class="addon-body">
|
|
3887
|
+
<div class="quantity-control">
|
|
3888
|
+
<button
|
|
3889
|
+
class="quantity-button"
|
|
3890
|
+
@click=${this.handleDecrement}
|
|
3891
|
+
?disabled=${this.quantity<=0}
|
|
3892
|
+
aria-label="Decrease quantity"
|
|
3893
|
+
>
|
|
3894
|
+
<span class="operator-sign">−</span>
|
|
3895
|
+
</button>
|
|
3896
|
+
<span class="quantity-value">${this.quantity}</span>
|
|
3897
|
+
<button
|
|
3898
|
+
class="quantity-button"
|
|
3899
|
+
@click=${this.handleIncrement}
|
|
3900
|
+
?disabled=${!e||this.atMaxUnits}
|
|
3901
|
+
aria-label="Increase quantity"
|
|
3902
|
+
>
|
|
3903
|
+
<span class="operator-sign">+</span>
|
|
3904
|
+
</button>
|
|
3905
|
+
</div>
|
|
3890
3906
|
</div>
|
|
3891
3907
|
</div>
|
|
3892
3908
|
</div>
|
|
3893
|
-
`}};Ho.styles=Po,jo([le({type:Object})],Ho.prototype,"rentableItem",void 0),jo([le({type:Function})],Ho.prototype,"onSelect",void 0),jo([ue()],Ho.prototype,"
|
|
3909
|
+
`}};Ho.styles=Po,jo([le({type:Object})],Ho.prototype,"rentableItem",void 0),jo([le({type:Function})],Ho.prototype,"onSelect",void 0),jo([ue()],Ho.prototype,"quantity",void 0),jo([ue()],Ho.prototype,"selectedItemIds",void 0),Ho=jo([ae("rentable-item")],Ho);const Fo=l`
|
|
3894
3910
|
:host {
|
|
3895
3911
|
--skeleton-bg-color: #eaeaea;
|
|
3896
3912
|
--skeleton-highlight-color: #f5f5f5;
|
|
@@ -4017,7 +4033,32 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4017
4033
|
<div class="fees-container empty-state">
|
|
4018
4034
|
<p>Select a unit to view estimated costs</p>
|
|
4019
4035
|
</div>
|
|
4020
|
-
`}
|
|
4036
|
+
`}renderAddOns(){return this.isLoading||this.addOns.length?L`
|
|
4037
|
+
<div class="sidepanel-section">
|
|
4038
|
+
<h5 class="sidepanel-section-title">Add-Ons</h5>
|
|
4039
|
+
${this.isLoading?L`
|
|
4040
|
+
<div class="sidepanel-loading-container">
|
|
4041
|
+
<mega-loader size="32"></mega-loader>
|
|
4042
|
+
</div>
|
|
4043
|
+
`:L`
|
|
4044
|
+
<div class="sidepanel-addons-container">
|
|
4045
|
+
${this.addOns.map((e=>L`
|
|
4046
|
+
${e instanceof no?L`
|
|
4047
|
+
<add-on-item
|
|
4048
|
+
.feeItem=${e}
|
|
4049
|
+
.onQuantityChange=${this.onAddonSelect}
|
|
4050
|
+
></add-on-item>
|
|
4051
|
+
`:L`
|
|
4052
|
+
<rentable-item
|
|
4053
|
+
.rentableItem=${e}
|
|
4054
|
+
.onSelect=${this.onRentableItemSelect}
|
|
4055
|
+
></rentable-item>
|
|
4056
|
+
`}
|
|
4057
|
+
`))}
|
|
4058
|
+
</div>
|
|
4059
|
+
`}
|
|
4060
|
+
</div>
|
|
4061
|
+
`:null}render(){return L`
|
|
4021
4062
|
<div class="fee-calculator-layout">
|
|
4022
4063
|
<div class="sidepanel">
|
|
4023
4064
|
<div class="sidepanel-section">
|
|
@@ -4031,27 +4072,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4031
4072
|
.buildingSlug=${this.buildingSlug}
|
|
4032
4073
|
></floor-plan-selector>
|
|
4033
4074
|
</div>
|
|
4034
|
-
|
|
4035
|
-
${this.addOns.length?L`
|
|
4036
|
-
<div class="sidepanel-section">
|
|
4037
|
-
<h5 class="sidepanel-section-title">Add-Ons</h5>
|
|
4038
|
-
<div class="sidepanel-addons-container">
|
|
4039
|
-
${this.addOns.map((e=>L`
|
|
4040
|
-
${e instanceof no?L`
|
|
4041
|
-
<add-on-item
|
|
4042
|
-
.feeItem=${e}
|
|
4043
|
-
.onQuantityChange=${this.onAddonSelect}
|
|
4044
|
-
></add-on-item>
|
|
4045
|
-
`:L`
|
|
4046
|
-
<rentable-item
|
|
4047
|
-
.rentableItem=${e}
|
|
4048
|
-
.onSelect=${this.onRentableItemSelect}
|
|
4049
|
-
></rentable-item>
|
|
4050
|
-
`}
|
|
4051
|
-
`))}
|
|
4052
|
-
</div>
|
|
4053
|
-
</div>
|
|
4054
|
-
`:""}
|
|
4075
|
+
${this.renderAddOns()}
|
|
4055
4076
|
</div>
|
|
4056
4077
|
|
|
4057
4078
|
${this.renderFeesContent()}
|
|
@@ -4146,7 +4167,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4146
4167
|
</p>
|
|
4147
4168
|
</div>
|
|
4148
4169
|
</div>
|
|
4149
|
-
`:L``}};er.styles=Zo,Jo([le({type:Object})],er.prototype,"incentive",void 0),er=Jo([ae("incentive-banner")],er);var tr=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let ir=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Me,this.backgroundColor=De,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isLoading=!1,this.selectedLayoutIds=[uo],this.selectedUnit=null,this.desiredAddons=[],this.desiredRentableItems=[],this.leaseTerm=12,this.moveInDate=pi,this.buildingWebchatView=null,this.incentives=[],this.
|
|
4170
|
+
`:L``}};er.styles=Zo,Jo([le({type:Object})],er.prototype,"incentive",void 0),er=Jo([ae("incentive-banner")],er);var tr=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let ir=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Me,this.backgroundColor=De,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isLoading=!1,this.selectedLayoutIds=[uo],this.selectedUnit=null,this.desiredAddons=[],this.desiredRentableItems=[],this.leaseTerm=12,this.moveInDate=pi,this.buildingWebchatView=null,this.incentives=[],this.quote=null,this.groupedFees={[oo.OneTime]:[],[oo.Daily]:[],[oo.Weekly]:[],[oo.BiWeekly]:[],[oo.Monthly]:[],[oo.Yearly]:[],[oo.Unknown]:[]},this.rentableItems=[],this.debouncedCalculateQuote=fo()((async()=>{var e;if(!this.selectedUnit||!this.moveInDate)return;const i=this.moveInDate<new Date(this.selectedUnit.earliestAvailable)?this.selectedUnit.earliestAvailable:null===(e=this.moveInDate)||void 0===e?void 0:e.toISOString().split("T")[0];try{this.quote=await(async({buildingSlug:e,unitId:i,addons:n,rentableItems:o,leaseTerm:r,moveInDate:a})=>{try{const s=await t().post(`${hi}/platformApi/webchat/${e}/fees/calculate`,gi({unitId:i,addons:n,rentableItems:o,leaseTerm:r,moveInDate:a}));if(s.data){const e=fi(s.data);return{...e,units:e.units.map((e=>({...e,fees:e.fees.map(ho)})))}}}catch(t){vn({logType:bn.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t}})}return{units:[]}})({buildingSlug:this.buildingSlug,unitId:this.selectedUnit.id,addons:this.desiredAddons,rentableItems:this.desiredRentableItems,leaseTerm:this.leaseTerm,moveInDate:i})}finally{this.isLoading=!1}}),1e3),this.firstUpdated=async()=>{this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor),await this.setupCalculator()},this.setupCalculator=async()=>{if(!this.buildingSlug||!this.orgSlug)return;this.isLoading=!0;const[e,t]=await Promise.all([Pn(this.orgSlug,this.buildingSlug),lo(this.buildingSlug)]);e&&t&&(this.buildingWebchatView=e,this.groupedFees=this.groupFees(t.fees),this.rentableItems=t.rentableItems,this.isLoading=!1)},this.calculateQuote=async()=>{this.selectedUnit&&this.moveInDate&&(this.isLoading=!0,this.debouncedCalculateQuote())},this.handleUnitSelect=e=>{this.selectedUnit=e,this.calculateQuote()},this.handleMoveInDateChange=e=>{this.moveInDate=e,this.calculateQuote()},this.handleLeaseTermChange=e=>{this.leaseTerm=e,this.calculateQuote()},this.handleAddonSelect=e=>{const t=this.desiredAddons.some((t=>t.id===e.id));t&&0===e.quantity?this.desiredAddons=this.desiredAddons.filter((t=>t.id!==e.id)):t?this.desiredAddons=this.desiredAddons.map((t=>t.id===e.id?{...t,quantity:e.quantity}:t)):this.desiredAddons.push(e),this.calculateQuote()},this.handleRentableItemSelect=e=>{this.desiredRentableItems.some((t=>t.id===e.id))?this.desiredRentableItems=this.desiredRentableItems.filter((t=>t.id!==e.id)):this.desiredRentableItems.push(e),this.calculateQuote()},this.groupFees=e=>e.reduce(((e,t)=>{var i,n;const o=null==t.layoutIds,r=this.selectedLayoutIds.includes(uo);if(!o&&!r&&!(null===(i=t.layoutIds)||void 0===i?void 0:i.some((e=>this.selectedLayoutIds.includes(e)))))return e;const a=(null===(n=t.blueprint.recurrenceInfo)||void 0===n?void 0:n.frequency)||oo.Unknown;return e[a]=[...e[a]||[],t],e}),{}),this.handleClickEmailOption=e=>{this.handleClose(),this.onClickEmailOption&&this.onClickEmailOption(e)},this.handleClickPhoneOption=e=>{this.handleClose(),this.onClickPhoneOption&&this.onClickPhoneOption(e)},this.handleClickSSTOption=e=>{this.handleClose(),this.onClickSSTOption&&this.onClickSSTOption(e)},this.handleClickTextUsOption=e=>{this.handleClose(),this.onClickTextUsOption&&this.onClickTextUsOption(e)},this.handleClose=()=>{var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this)},this.handleSelectLayout=e=>{this.selectedLayoutIds=e}}get layouts(){var e,t;return null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.layoutOptions)&&void 0!==t?t:[]}updated(e){(e.has("primaryColor")||e.has("backgroundColor"))&&(this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor))}render(){return L`
|
|
4150
4171
|
<div
|
|
4151
4172
|
class="fee-calculator-container"
|
|
4152
4173
|
@keydown=${e=>e.stopPropagation()}
|
|
@@ -4156,8 +4177,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4156
4177
|
<h1>Estimated Cost Calculator</h1>
|
|
4157
4178
|
|
|
4158
4179
|
<div class="calculator-header-right">
|
|
4159
|
-
|
|
4160
|
-
<button class="
|
|
4180
|
+
<!-- TODO(Leo): Return once reqs are clear; also need apps link -->
|
|
4181
|
+
<!-- <button class="share-button">Share</button> -->
|
|
4182
|
+
<!-- <button class="apply-button">Apply</button> -->
|
|
4161
4183
|
<button
|
|
4162
4184
|
aria-label="Close fee calculator"
|
|
4163
4185
|
class="close-button"
|
|
@@ -4203,7 +4225,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4203
4225
|
<p>Prices subject to change. Additional fees may apply.</p>
|
|
4204
4226
|
</div>
|
|
4205
4227
|
</div>
|
|
4206
|
-
`}};ir.styles=io,tr([le({attribute:!0})],ir.prototype,"buildingSlug",void 0),tr([le({attribute:!0})],ir.prototype,"orgSlug",void 0),tr([le({type:String})],ir.prototype,"primaryColor",void 0),tr([le({type:String})],ir.prototype,"backgroundColor",void 0),tr([le()],ir.prototype,"onCloseClicked",void 0),tr([le()],ir.prototype,"onClickEmailOption",void 0),tr([le()],ir.prototype,"onClickPhoneOption",void 0),tr([le()],ir.prototype,"onClickSSTOption",void 0),tr([le()],ir.prototype,"onClickTextUsOption",void 0),tr([ue()],ir.prototype,"isLoading",void 0),tr([ue()],ir.prototype,"selectedLayoutIds",void 0),tr([ue()],ir.prototype,"selectedUnit",void 0),tr([ue()],ir.prototype,"desiredAddons",void 0),tr([ue()],ir.prototype,"desiredRentableItems",void 0),tr([ue()],ir.prototype,"leaseTerm",void 0),tr([ue()],ir.prototype,"moveInDate",void 0),tr([ue()],ir.prototype,"buildingWebchatView",void 0),tr([ue()],ir.prototype,"incentives",void 0),tr([ue()],ir.prototype,"
|
|
4228
|
+
`}};ir.styles=io,tr([le({attribute:!0})],ir.prototype,"buildingSlug",void 0),tr([le({attribute:!0})],ir.prototype,"orgSlug",void 0),tr([le({type:String})],ir.prototype,"primaryColor",void 0),tr([le({type:String})],ir.prototype,"backgroundColor",void 0),tr([le()],ir.prototype,"onCloseClicked",void 0),tr([le()],ir.prototype,"onClickEmailOption",void 0),tr([le()],ir.prototype,"onClickPhoneOption",void 0),tr([le()],ir.prototype,"onClickSSTOption",void 0),tr([le()],ir.prototype,"onClickTextUsOption",void 0),tr([ue()],ir.prototype,"isLoading",void 0),tr([ue()],ir.prototype,"selectedLayoutIds",void 0),tr([ue()],ir.prototype,"selectedUnit",void 0),tr([ue()],ir.prototype,"desiredAddons",void 0),tr([ue()],ir.prototype,"desiredRentableItems",void 0),tr([ue()],ir.prototype,"leaseTerm",void 0),tr([ue()],ir.prototype,"moveInDate",void 0),tr([ue()],ir.prototype,"buildingWebchatView",void 0),tr([ue()],ir.prototype,"incentives",void 0),tr([ue()],ir.prototype,"quote",void 0),tr([ue()],ir.prototype,"groupedFees",void 0),tr([ue()],ir.prototype,"rentableItems",void 0),ir=tr([ae("fee-calculator")],ir);const nr=l`
|
|
4207
4229
|
#minimize-mobile {
|
|
4208
4230
|
position: absolute;
|
|
4209
4231
|
top: -12px;
|
|
@@ -39,19 +39,8 @@ export class AddonItem extends LitElement {
|
|
|
39
39
|
return this.quantity <= minUnits;
|
|
40
40
|
}
|
|
41
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
42
|
private handleIncrement(): void {
|
|
53
43
|
if (this.atMaxUnits) return;
|
|
54
|
-
this.isChecked = true;
|
|
55
44
|
this.quantity += 1;
|
|
56
45
|
this.onQuantityChange?.({
|
|
57
46
|
id: this.feeItem?.id ?? 0,
|
|
@@ -63,7 +52,6 @@ export class AddonItem extends LitElement {
|
|
|
63
52
|
private handleDecrement(): void {
|
|
64
53
|
if (this.atMinUnits) return;
|
|
65
54
|
this.quantity = Math.max(0, this.quantity - 1);
|
|
66
|
-
this.isChecked = this.quantity > 0;
|
|
67
55
|
this.onQuantityChange?.({
|
|
68
56
|
id: this.feeItem?.id ?? 0,
|
|
69
57
|
quantity: this.quantity,
|
|
@@ -76,35 +64,35 @@ export class AddonItem extends LitElement {
|
|
|
76
64
|
|
|
77
65
|
return html`
|
|
78
66
|
<div class="addon-container">
|
|
79
|
-
<div class="addon-
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<p class="addon-title">${this.feeItem.displayName("Add-On")}</p>
|
|
67
|
+
<div class="addon-inner-container">
|
|
68
|
+
<div class="addon-header">
|
|
69
|
+
<div class="addon-header-left">
|
|
70
|
+
<p class="addon-title">${this.feeItem.displayName("Add-On")}</p>
|
|
71
|
+
</div>
|
|
72
|
+
<!-- TODO(Leo): If we add max_units_allowed, put that here -->
|
|
73
|
+
<div class="addon-header-right"></div>
|
|
87
74
|
</div>
|
|
88
|
-
</div>
|
|
89
75
|
|
|
90
|
-
|
|
91
|
-
<div class="
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
76
|
+
<!-- TODO: Need to create one control per type in matrix -->
|
|
77
|
+
<div class="addon-body">
|
|
78
|
+
<div class="quantity-control">
|
|
79
|
+
<button
|
|
80
|
+
class="quantity-button"
|
|
81
|
+
@click=${this.handleDecrement}
|
|
82
|
+
?disabled=${this.quantity <= 0}
|
|
83
|
+
aria-label="Decrease quantity"
|
|
84
|
+
>
|
|
85
|
+
<span class="operator-sign">−</span>
|
|
86
|
+
</button>
|
|
87
|
+
<span class="quantity-value">${this.quantity}</span>
|
|
88
|
+
<button
|
|
89
|
+
class="quantity-button"
|
|
90
|
+
@click=${this.handleIncrement}
|
|
91
|
+
aria-label="Increase quantity"
|
|
92
|
+
>
|
|
93
|
+
<span class="operator-sign">+</span>
|
|
94
|
+
</button>
|
|
95
|
+
</div>
|
|
108
96
|
</div>
|
|
109
97
|
</div>
|
|
110
98
|
</div>
|
|
@@ -5,33 +5,47 @@ export default css`
|
|
|
5
5
|
display: block;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
p {
|
|
9
|
+
margin: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
.addon-container {
|
|
9
13
|
border: 1px solid #e5e7eb;
|
|
10
14
|
border-radius: 0.375rem;
|
|
11
|
-
display: flex;
|
|
12
|
-
padding: 0.5rem;
|
|
13
15
|
align-items: center;
|
|
14
|
-
justify-content: space-between;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
.addon-
|
|
18
|
+
.addon-inner-container {
|
|
18
19
|
display: flex;
|
|
19
|
-
flex:
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
margin: 12px;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
.addon-
|
|
23
|
-
|
|
25
|
+
.addon-header {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.addon-header-right {
|
|
31
|
+
color: #838385;
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
.addon-title {
|
|
27
35
|
font-size: 0.875rem;
|
|
28
|
-
font-weight: 500;
|
|
29
36
|
color: #374151;
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
.addon-
|
|
39
|
+
.addon-body {
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.quantity-control {
|
|
33
44
|
display: flex;
|
|
34
|
-
justify-content:
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
align-items: center;
|
|
47
|
+
border: 1px solid #dee2e6;
|
|
48
|
+
border-radius: 0.2;
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
.operator-sign {
|
|
@@ -43,13 +57,6 @@ export default css`
|
|
|
43
57
|
text-align: center;
|
|
44
58
|
}
|
|
45
59
|
|
|
46
|
-
.quantity-control {
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
border: 1px solid #dee2e6;
|
|
50
|
-
border-radius: 0.2;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
60
|
.quantity-button {
|
|
54
61
|
font-size: 1.2rem;
|
|
55
62
|
padding: 0.5rem;
|
|
@@ -72,8 +79,4 @@ export default css`
|
|
|
72
79
|
padding: 0.25rem;
|
|
73
80
|
font-size: 0.875rem;
|
|
74
81
|
}
|
|
75
|
-
|
|
76
|
-
.total-cost {
|
|
77
|
-
display: none;
|
|
78
|
-
}
|
|
79
82
|
`;
|
|
@@ -15,9 +15,6 @@ export class RentableItem extends LitElement {
|
|
|
15
15
|
@property({ type: Function })
|
|
16
16
|
onSelect: ((rentableItem: DesiredRentableItem) => void) | null = null;
|
|
17
17
|
|
|
18
|
-
@state()
|
|
19
|
-
private isChecked = false;
|
|
20
|
-
|
|
21
18
|
@state()
|
|
22
19
|
private quantity = 0;
|
|
23
20
|
|
|
@@ -26,7 +23,7 @@ export class RentableItem extends LitElement {
|
|
|
26
23
|
|
|
27
24
|
get totalAvailableItems(): number {
|
|
28
25
|
return (
|
|
29
|
-
this.rentableItem?.allItems
|
|
26
|
+
this.rentableItem?.allItems?.filter((item) => item.available).length ?? 0
|
|
30
27
|
);
|
|
31
28
|
}
|
|
32
29
|
|
|
@@ -42,21 +39,8 @@ export class RentableItem extends LitElement {
|
|
|
42
39
|
return this.quantity <= 0;
|
|
43
40
|
}
|
|
44
41
|
|
|
45
|
-
private handleCheckboxClick(): void {
|
|
46
|
-
if (!this.isChecked) {
|
|
47
|
-
this.isChecked = true;
|
|
48
|
-
this.quantity = 1;
|
|
49
|
-
this.emitChange();
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
this.isChecked = false;
|
|
53
|
-
this.quantity = 0;
|
|
54
|
-
this.emitChange();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
42
|
private handleIncrement(): void {
|
|
58
43
|
if (this.atMaxUnits) return;
|
|
59
|
-
this.isChecked = true;
|
|
60
44
|
this.quantity += 1;
|
|
61
45
|
this.emitChange();
|
|
62
46
|
}
|
|
@@ -64,7 +48,6 @@ export class RentableItem extends LitElement {
|
|
|
64
48
|
private handleDecrement(): void {
|
|
65
49
|
if (this.atMinUnits) return;
|
|
66
50
|
this.quantity = Math.max(0, this.quantity - 1);
|
|
67
|
-
this.isChecked = this.quantity > 0;
|
|
68
51
|
this.emitChange();
|
|
69
52
|
}
|
|
70
53
|
|
|
@@ -93,37 +76,36 @@ export class RentableItem extends LitElement {
|
|
|
93
76
|
|
|
94
77
|
return html`
|
|
95
78
|
<div class="addon-container">
|
|
96
|
-
<div class="addon-
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<p class="addon-title">${this.rentableItem.description}</p>
|
|
79
|
+
<div class="addon-inner-container">
|
|
80
|
+
<div class="addon-header">
|
|
81
|
+
<div class="addon-header-left">
|
|
82
|
+
<p class="addon-title">${this.rentableItem.type}</p>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="addon-header-right">
|
|
85
|
+
<p>${this.quantityLeft} Max</p>
|
|
86
|
+
</div>
|
|
105
87
|
</div>
|
|
106
|
-
</div>
|
|
107
88
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
89
|
+
<div class="addon-body">
|
|
90
|
+
<div class="quantity-control">
|
|
91
|
+
<button
|
|
92
|
+
class="quantity-button"
|
|
93
|
+
@click=${this.handleDecrement}
|
|
94
|
+
?disabled=${this.quantity <= 0}
|
|
95
|
+
aria-label="Decrease quantity"
|
|
96
|
+
>
|
|
97
|
+
<span class="operator-sign">−</span>
|
|
98
|
+
</button>
|
|
99
|
+
<span class="quantity-value">${this.quantity}</span>
|
|
100
|
+
<button
|
|
101
|
+
class="quantity-button"
|
|
102
|
+
@click=${this.handleIncrement}
|
|
103
|
+
?disabled=${!hasAvailableItems || this.atMaxUnits}
|
|
104
|
+
aria-label="Increase quantity"
|
|
105
|
+
>
|
|
106
|
+
<span class="operator-sign">+</span>
|
|
107
|
+
</button>
|
|
108
|
+
</div>
|
|
127
109
|
</div>
|
|
128
110
|
</div>
|
|
129
111
|
</div>
|
|
@@ -59,6 +59,15 @@ export default css`
|
|
|
59
59
|
min-height: 300px;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
.sidepanel-loading-container {
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
align-items: center;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
min-height: 5rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
.loading-container {
|
|
63
72
|
display: flex;
|
|
64
73
|
justify-content: flex-start;
|
package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts
CHANGED
|
@@ -18,6 +18,7 @@ import "../fee-card/fee-card";
|
|
|
18
18
|
import "../addons/addon-item/addon-item";
|
|
19
19
|
import "../addons/rentable-item/rentable-item";
|
|
20
20
|
import "../../../loaders/skeleton-loader";
|
|
21
|
+
import "../../../loaders/mega-loader";
|
|
21
22
|
|
|
22
23
|
@customElement("fee-calculator-layout")
|
|
23
24
|
export class FeeCalculatorLayout extends LitElement {
|
|
@@ -176,6 +177,43 @@ export class FeeCalculatorLayout extends LitElement {
|
|
|
176
177
|
`;
|
|
177
178
|
}
|
|
178
179
|
|
|
180
|
+
renderAddOns(): TemplateResult | null {
|
|
181
|
+
if (!this.isLoading && !this.addOns.length) return null;
|
|
182
|
+
|
|
183
|
+
return html`
|
|
184
|
+
<div class="sidepanel-section">
|
|
185
|
+
<h5 class="sidepanel-section-title">Add-Ons</h5>
|
|
186
|
+
${this.isLoading
|
|
187
|
+
? html`
|
|
188
|
+
<div class="sidepanel-loading-container">
|
|
189
|
+
<mega-loader size="32"></mega-loader>
|
|
190
|
+
</div>
|
|
191
|
+
`
|
|
192
|
+
: html`
|
|
193
|
+
<div class="sidepanel-addons-container">
|
|
194
|
+
${this.addOns.map((addon) => {
|
|
195
|
+
return html`
|
|
196
|
+
${addon instanceof BuildingFee
|
|
197
|
+
? html`
|
|
198
|
+
<add-on-item
|
|
199
|
+
.feeItem=${addon}
|
|
200
|
+
.onQuantityChange=${this.onAddonSelect}
|
|
201
|
+
></add-on-item>
|
|
202
|
+
`
|
|
203
|
+
: html`
|
|
204
|
+
<rentable-item
|
|
205
|
+
.rentableItem=${addon}
|
|
206
|
+
.onSelect=${this.onRentableItemSelect}
|
|
207
|
+
></rentable-item>
|
|
208
|
+
`}
|
|
209
|
+
`;
|
|
210
|
+
})}
|
|
211
|
+
</div>
|
|
212
|
+
`}
|
|
213
|
+
</div>
|
|
214
|
+
`;
|
|
215
|
+
}
|
|
216
|
+
|
|
179
217
|
render(): TemplateResult {
|
|
180
218
|
return html`
|
|
181
219
|
<div class="fee-calculator-layout">
|
|
@@ -191,33 +229,7 @@ export class FeeCalculatorLayout extends LitElement {
|
|
|
191
229
|
.buildingSlug=${this.buildingSlug}
|
|
192
230
|
></floor-plan-selector>
|
|
193
231
|
</div>
|
|
194
|
-
|
|
195
|
-
${this.addOns.length
|
|
196
|
-
? html`
|
|
197
|
-
<div class="sidepanel-section">
|
|
198
|
-
<h5 class="sidepanel-section-title">Add-Ons</h5>
|
|
199
|
-
<div class="sidepanel-addons-container">
|
|
200
|
-
${this.addOns.map((addon) => {
|
|
201
|
-
return html`
|
|
202
|
-
${addon instanceof BuildingFee
|
|
203
|
-
? html`
|
|
204
|
-
<add-on-item
|
|
205
|
-
.feeItem=${addon}
|
|
206
|
-
.onQuantityChange=${this.onAddonSelect}
|
|
207
|
-
></add-on-item>
|
|
208
|
-
`
|
|
209
|
-
: html`
|
|
210
|
-
<rentable-item
|
|
211
|
-
.rentableItem=${addon}
|
|
212
|
-
.onSelect=${this.onRentableItemSelect}
|
|
213
|
-
></rentable-item>
|
|
214
|
-
`}
|
|
215
|
-
`;
|
|
216
|
-
})}
|
|
217
|
-
</div>
|
|
218
|
-
</div>
|
|
219
|
-
`
|
|
220
|
-
: ""}
|
|
232
|
+
${this.renderAddOns()}
|
|
221
233
|
</div>
|
|
222
234
|
|
|
223
235
|
${this.renderFeesContent()}
|
package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts
CHANGED
|
@@ -154,6 +154,43 @@ export class FloorPlanSelector extends LitElement {
|
|
|
154
154
|
this.units = await this.fetchUnits();
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
+
renderUnitSelection = (): TemplateResult => {
|
|
158
|
+
if (this.isLoading) {
|
|
159
|
+
return html`
|
|
160
|
+
<div class="unit-selection">
|
|
161
|
+
<div class="unit-label">Select Unit</div>
|
|
162
|
+
<div class="loading-container">
|
|
163
|
+
<mega-loader size="32"></mega-loader>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
`;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return html`
|
|
170
|
+
<div class="unit-selection">
|
|
171
|
+
<div class="unit-label">Select Unit</div>
|
|
172
|
+
<div class="image-carousel">
|
|
173
|
+
${this.units?.length === 0
|
|
174
|
+
? html`
|
|
175
|
+
<div class="no-floorplans-container">
|
|
176
|
+
<p>No floorplans found</p>
|
|
177
|
+
</div>
|
|
178
|
+
`
|
|
179
|
+
: ""}
|
|
180
|
+
${this.units?.map(
|
|
181
|
+
(unit) => html`
|
|
182
|
+
<floorplan-image-card
|
|
183
|
+
.unit=${unit}
|
|
184
|
+
.onUnitSelect=${this.handleUnitSelect}
|
|
185
|
+
.selected=${this.selectedUnit?.id === unit.id}
|
|
186
|
+
></floorplan-image-card>
|
|
187
|
+
`
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
`;
|
|
192
|
+
};
|
|
193
|
+
|
|
157
194
|
render(): TemplateResult {
|
|
158
195
|
return html`
|
|
159
196
|
<div class="floor-plan-selector">
|
|
@@ -196,34 +233,8 @@ export class FloorPlanSelector extends LitElement {
|
|
|
196
233
|
/>
|
|
197
234
|
</div>
|
|
198
235
|
</div>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<div class="image-carousel">
|
|
202
|
-
${this.isLoading
|
|
203
|
-
? html`
|
|
204
|
-
<div class="loading-container">
|
|
205
|
-
<mega-loader size="32"></mega-loader>
|
|
206
|
-
</div>
|
|
207
|
-
`
|
|
208
|
-
: ""}
|
|
209
|
-
${!this.isLoading && this.units?.length === 0
|
|
210
|
-
? html`
|
|
211
|
-
<div class="no-floorplans-container">
|
|
212
|
-
<p>No floorplans found</p>
|
|
213
|
-
</div>
|
|
214
|
-
`
|
|
215
|
-
: ""}
|
|
216
|
-
${this.units?.map(
|
|
217
|
-
(unit) => html`
|
|
218
|
-
<floorplan-image-card
|
|
219
|
-
.unit=${unit}
|
|
220
|
-
.onUnitSelect=${this.handleUnitSelect}
|
|
221
|
-
.selected=${this.selectedUnit?.id === unit.id}
|
|
222
|
-
></floorplan-image-card>
|
|
223
|
-
`
|
|
224
|
-
)}
|
|
225
|
-
</div>
|
|
226
|
-
</div>
|
|
236
|
+
|
|
237
|
+
${this.renderUnitSelection()}
|
|
227
238
|
</div>
|
|
228
239
|
</div>
|
|
229
240
|
`;
|
package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts
CHANGED
|
@@ -19,7 +19,11 @@ export class FloorplanImageCard extends LitElement {
|
|
|
19
19
|
selected = false;
|
|
20
20
|
|
|
21
21
|
get bedAndBathText(): string {
|
|
22
|
-
|
|
22
|
+
const bedRooms =
|
|
23
|
+
this.unit.numberOfBedrooms === 0
|
|
24
|
+
? "studio"
|
|
25
|
+
: `${this.unit.numberOfBedrooms}bd`;
|
|
26
|
+
return `${bedRooms} | ${this.unit.numberOfBathrooms}ba`;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
get priceRange(): string {
|
|
@@ -53,7 +57,7 @@ export class FloorplanImageCard extends LitElement {
|
|
|
53
57
|
</div>
|
|
54
58
|
<div class="section-right" @click=${this.handleOnUnitSelect}>
|
|
55
59
|
<p class="image-card-title">
|
|
56
|
-
${this.unit.
|
|
60
|
+
Unit ${this.unit.unitNumber} | ${this.priceRange}
|
|
57
61
|
</p>
|
|
58
62
|
<p class="image-card-subtitle">
|
|
59
63
|
${this.bedAndBathText} | ${this.unit.squareFootage} ft |
|
|
@@ -90,21 +90,6 @@ export class FeeCalculator extends LitElement {
|
|
|
90
90
|
@state()
|
|
91
91
|
private incentives: IncentiveV2[] = [];
|
|
92
92
|
|
|
93
|
-
@state()
|
|
94
|
-
enabledChatWidgets: {
|
|
95
|
-
callDesktop: boolean;
|
|
96
|
-
chatDesktop: boolean;
|
|
97
|
-
emailDesktop: boolean;
|
|
98
|
-
textDesktop: boolean;
|
|
99
|
-
sstDesktop: boolean;
|
|
100
|
-
} = {
|
|
101
|
-
callDesktop: false,
|
|
102
|
-
chatDesktop: false,
|
|
103
|
-
emailDesktop: false,
|
|
104
|
-
textDesktop: false,
|
|
105
|
-
sstDesktop: false,
|
|
106
|
-
};
|
|
107
|
-
|
|
108
93
|
@state()
|
|
109
94
|
quote: CalculateQuoteResponse | null = null;
|
|
110
95
|
|
|
@@ -160,6 +145,7 @@ export class FeeCalculator extends LitElement {
|
|
|
160
145
|
setupCalculator = async (): Promise<void> => {
|
|
161
146
|
if (!this.buildingSlug || !this.orgSlug) return;
|
|
162
147
|
|
|
148
|
+
this.isLoading = true;
|
|
163
149
|
const [buildingWebchatView, buildingFeeResponse] = await Promise.all([
|
|
164
150
|
fetchBuildingWebchatView(this.orgSlug, this.buildingSlug),
|
|
165
151
|
fetchBuildingFees(this.buildingSlug),
|
|
@@ -170,17 +156,9 @@ export class FeeCalculator extends LitElement {
|
|
|
170
156
|
this.buildingWebchatView = buildingWebchatView;
|
|
171
157
|
this.groupedFees = this.groupFees(buildingFeeResponse.fees);
|
|
172
158
|
this.rentableItems = buildingFeeResponse.rentableItems;
|
|
173
|
-
|
|
174
159
|
// TODO(Leo): Re-enable
|
|
175
160
|
// this.incentives = buildingFeeResponse.buildingIncentives;
|
|
176
|
-
|
|
177
|
-
this.enabledChatWidgets = {
|
|
178
|
-
callDesktop: this.buildingWebchatView?.shouldShowPhoneDesktop ?? false,
|
|
179
|
-
chatDesktop: this.buildingWebchatView?.shouldShowChatDesktop ?? false,
|
|
180
|
-
emailDesktop: this.buildingWebchatView?.shouldShowEmailDesktop ?? false,
|
|
181
|
-
sstDesktop: this.buildingWebchatView?.shouldShowSstDesktop ?? false,
|
|
182
|
-
textDesktop: this.buildingWebchatView?.shouldShowTextDesktop ?? false,
|
|
183
|
-
};
|
|
161
|
+
this.isLoading = false;
|
|
184
162
|
};
|
|
185
163
|
|
|
186
164
|
updated(changedProperties: Map<string, unknown>): void {
|
|
@@ -309,8 +287,9 @@ export class FeeCalculator extends LitElement {
|
|
|
309
287
|
<h1>Estimated Cost Calculator</h1>
|
|
310
288
|
|
|
311
289
|
<div class="calculator-header-right">
|
|
312
|
-
|
|
313
|
-
<button class="
|
|
290
|
+
<!-- TODO(Leo): Return once reqs are clear; also need apps link -->
|
|
291
|
+
<!-- <button class="share-button">Share</button> -->
|
|
292
|
+
<!-- <button class="apply-button">Apply</button> -->
|
|
314
293
|
<button
|
|
315
294
|
aria-label="Close fee calculator"
|
|
316
295
|
class="close-button"
|