@kiva/kv-components 6.52.8 → 6.52.10
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/vue/KvLendCta.css +1 -1
- package/dist/vue/KvLendCta.js +304 -186
- package/dist/vue/KvWwwHeader/LendMenu/KvLendListMenu.css +1 -1
- package/dist/vue/KvWwwHeader/LendMenu/KvLendListMenu.js +55 -51
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMegaMenu.css +1 -1
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMegaMenu.js +63 -59
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMenu.js +54 -48
- package/dist/vue/KvWwwHeader.css +1 -1
- package/dist/vue/KvWwwHeader.js +43 -38
- package/package.json +2 -2
package/dist/vue/KvLendCta.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { mdiChevronRight as
|
|
1
|
+
import T from "graphql-tag";
|
|
2
|
+
import { mdiChevronRight as N } from "@mdi/js";
|
|
3
3
|
import { throttle as C } from "../utils/throttle.js";
|
|
4
|
-
import { getLendCtaSelectedOption as
|
|
5
|
-
import
|
|
4
|
+
import { getLendCtaSelectedOption as L, getDropdownPriceArray as I } from "../utils/loanUtils.js";
|
|
5
|
+
import R from "./KvLendAmountButton.js";
|
|
6
6
|
import S from "./KvSelect.js";
|
|
7
7
|
import F from "./KvButton.js";
|
|
8
|
-
import
|
|
9
|
-
import { resolveComponent as
|
|
8
|
+
import V from "./KvMaterialIcon.js";
|
|
9
|
+
import { resolveComponent as v, openBlock as o, createElementBlock as i, createBlock as a, withCtx as r, createTextVNode as f, toDisplayString as u, createElementVNode as h, createVNode as y, withModifiers as A, normalizeClass as w, Fragment as k, renderList as p, createCommentVNode as c } from "vue";
|
|
10
10
|
import "./KvLendCta.css";
|
|
11
|
-
import
|
|
12
|
-
const
|
|
11
|
+
import W from "../_virtual/_plugin-vue_export-helper.js";
|
|
12
|
+
const _ = "Other", E = 430, g = 480, x = 380, De = T`
|
|
13
13
|
fragment KvLendCta on LoanBasic {
|
|
14
14
|
id
|
|
15
15
|
name
|
|
16
16
|
status
|
|
17
17
|
minNoteSize
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`, ye = T`
|
|
20
20
|
fragment KvLendCtaUser on LoanBasic {
|
|
21
21
|
id
|
|
22
22
|
userProperties {
|
|
23
23
|
lentTo
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`, K = {
|
|
27
27
|
name: "KvLendCta",
|
|
28
28
|
components: {
|
|
29
|
-
KvLendAmountButton:
|
|
29
|
+
KvLendAmountButton: R,
|
|
30
30
|
KvUiButton: F,
|
|
31
31
|
KvUiSelect: S,
|
|
32
|
-
KvMaterialIcon:
|
|
32
|
+
KvMaterialIcon: V
|
|
33
33
|
},
|
|
34
34
|
props: {
|
|
35
35
|
loan: {
|
|
@@ -123,28 +123,47 @@ const p = "Other", E = 430, ce = b`
|
|
|
123
123
|
kvTrackCategory: {
|
|
124
124
|
type: String,
|
|
125
125
|
default: "Lending"
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* Breakpoint for narrow desktop layout (default: 480px)
|
|
129
|
+
* When component width is below this, it will use stacked layout even on desktop
|
|
130
|
+
*/
|
|
131
|
+
narrowSidebarBreakpoint: {
|
|
132
|
+
type: Number,
|
|
133
|
+
default: g
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* Breakpoint for narrow desktop dropdown layout (default: 380px)
|
|
137
|
+
* When component width is below this in narrow desktop mode, dropdown moves to second row
|
|
138
|
+
*/
|
|
139
|
+
narrowSidebarDropdownBreakpoint: {
|
|
140
|
+
type: Number,
|
|
141
|
+
default: x
|
|
126
142
|
}
|
|
127
143
|
},
|
|
128
144
|
data() {
|
|
129
|
-
var
|
|
145
|
+
var n, s;
|
|
130
146
|
return {
|
|
131
|
-
mdiChevronRight:
|
|
147
|
+
mdiChevronRight: N,
|
|
132
148
|
defaultAmountOptions: [25, 50, 75],
|
|
133
|
-
selectedOption:
|
|
149
|
+
selectedOption: L(
|
|
134
150
|
this.getCookie,
|
|
135
151
|
this.setCookie,
|
|
136
152
|
this.enableFiveDollarsNotes,
|
|
137
|
-
(s = (
|
|
153
|
+
(s = (n = this.route) == null ? void 0 : n.query) == null ? void 0 : s.utm_campaign,
|
|
138
154
|
this.unreservedAmount,
|
|
139
155
|
this.userBalance,
|
|
140
156
|
this.fiveDollarsSelected
|
|
141
157
|
),
|
|
142
|
-
selectedDropdownOption:
|
|
143
|
-
OTHER_OPTION:
|
|
158
|
+
selectedDropdownOption: _,
|
|
159
|
+
OTHER_OPTION: _,
|
|
144
160
|
// SSR-safe viewport width initialization
|
|
145
161
|
viewportWidth: typeof window < "u" ? window.innerWidth : 1024,
|
|
146
|
-
|
|
147
|
-
|
|
162
|
+
componentWidth: 1024,
|
|
163
|
+
resizeObserver: null,
|
|
164
|
+
MOBILE_DROPDOWN_BREAKPOINT: E,
|
|
165
|
+
NARROW_SIDEBAR_BREAKPOINT: g,
|
|
166
|
+
NARROW_SIDEBAR_DROPDOWN_BREAKPOINT: x
|
|
148
167
|
};
|
|
149
168
|
},
|
|
150
169
|
computed: {
|
|
@@ -152,52 +171,52 @@ const p = "Other", E = 430, ce = b`
|
|
|
152
171
|
return this.customLoanDetails ? "" : `/lend/${this.loanId}`;
|
|
153
172
|
},
|
|
154
173
|
loanId() {
|
|
155
|
-
var
|
|
156
|
-
return (
|
|
174
|
+
var n;
|
|
175
|
+
return (n = this.loan) == null ? void 0 : n.id;
|
|
157
176
|
},
|
|
158
177
|
status() {
|
|
159
|
-
var
|
|
160
|
-
return ((
|
|
178
|
+
var n;
|
|
179
|
+
return ((n = this.loan) == null ? void 0 : n.status) ?? "";
|
|
161
180
|
},
|
|
162
181
|
minNoteSize() {
|
|
163
|
-
var
|
|
164
|
-
return ((
|
|
182
|
+
var n;
|
|
183
|
+
return ((n = this.loan) == null ? void 0 : n.minNoteSize) ?? "";
|
|
165
184
|
},
|
|
166
185
|
lentPreviously() {
|
|
167
|
-
var
|
|
168
|
-
return ((s = (
|
|
186
|
+
var n, s;
|
|
187
|
+
return ((s = (n = this.loan) == null ? void 0 : n.userProperties) == null ? void 0 : s.lentTo) ?? !1;
|
|
169
188
|
},
|
|
170
189
|
isInBasket() {
|
|
171
|
-
var
|
|
172
|
-
return ((
|
|
190
|
+
var n;
|
|
191
|
+
return ((n = this.basketItems) == null ? void 0 : n.some((s) => s.__typename === "LoanReservation" && s.id === this.loanId)) ?? !1;
|
|
173
192
|
},
|
|
174
193
|
prices() {
|
|
175
|
-
const
|
|
194
|
+
const n = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), s = I(
|
|
176
195
|
this.unreservedAmount,
|
|
177
196
|
this.isCompleteLoanActive,
|
|
178
|
-
|
|
197
|
+
n,
|
|
179
198
|
this.enableFiveDollarsNotes,
|
|
180
199
|
this.isVisitor
|
|
181
200
|
);
|
|
182
|
-
return this.maxAmount ? s.filter((
|
|
201
|
+
return this.maxAmount ? s.filter((l) => parseFloat(l) <= parseFloat(this.maxAmount)) : s;
|
|
183
202
|
},
|
|
184
203
|
presetButtonsPrices() {
|
|
185
|
-
const
|
|
186
|
-
return this.prices.length === 4 &&
|
|
204
|
+
const n = this.prices.slice(0, 3);
|
|
205
|
+
return this.prices.length === 4 && n.push(this.prices[3]), n;
|
|
187
206
|
},
|
|
188
207
|
presetDropdownPrices() {
|
|
189
208
|
if (this.prices.length === 4)
|
|
190
209
|
return [];
|
|
191
|
-
const
|
|
192
|
-
return
|
|
210
|
+
const n = this.prices.slice(this.defaultAmountOptions.length);
|
|
211
|
+
return n.unshift(_), n;
|
|
193
212
|
},
|
|
194
213
|
loanName() {
|
|
195
|
-
var
|
|
196
|
-
return ((
|
|
214
|
+
var n;
|
|
215
|
+
return ((n = this.loan) == null ? void 0 : n.name) ?? "";
|
|
197
216
|
},
|
|
198
217
|
presetAmountCtaButtonText() {
|
|
199
|
-
var
|
|
200
|
-
return ((
|
|
218
|
+
var n;
|
|
219
|
+
return ((n = this.loan) == null ? void 0 : n.borrowerCount) > 1 ? "Support" : `Support ${this.loanName}`;
|
|
201
220
|
},
|
|
202
221
|
defaultCtaButtonText() {
|
|
203
222
|
return this.showPresetAmounts ? this.presetAmountCtaButtonText : this.primaryButtonText || "Lend";
|
|
@@ -243,8 +262,8 @@ const p = "Other", E = 430, ce = b`
|
|
|
243
262
|
return this.isAmountLessThan25(this.unreservedAmount) || this.isAmountBetween25And500(this.unreservedAmount);
|
|
244
263
|
},
|
|
245
264
|
isLendAmountButton() {
|
|
246
|
-
const
|
|
247
|
-
return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(
|
|
265
|
+
const n = this.maxAmount ? this.maxAmount : this.unreservedAmount;
|
|
266
|
+
return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(n) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
|
|
248
267
|
},
|
|
249
268
|
isFunded() {
|
|
250
269
|
return this.state === "funded" || this.state === "fully-reserved";
|
|
@@ -259,37 +278,48 @@ const p = "Other", E = 430, ce = b`
|
|
|
259
278
|
return this.isLentTo && !this.isLessThan25;
|
|
260
279
|
},
|
|
261
280
|
selectedDropdown() {
|
|
262
|
-
return this.selectedDropdownOption !==
|
|
281
|
+
return this.selectedDropdownOption !== _;
|
|
263
282
|
},
|
|
264
283
|
showFilteredDropdown() {
|
|
265
284
|
return this.presetDropdownPrices.length > 1;
|
|
266
285
|
},
|
|
267
286
|
hideLendButton() {
|
|
268
287
|
return this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
|
|
288
|
+
},
|
|
289
|
+
/**
|
|
290
|
+
* Determines if component should use narrow desktop layout
|
|
291
|
+
* This is true when we're in desktop viewport but component width is narrow
|
|
292
|
+
*/
|
|
293
|
+
isNarrowDesktop() {
|
|
294
|
+
return this.viewportWidth >= 768 && this.componentWidth < this.narrowSidebarBreakpoint;
|
|
269
295
|
}
|
|
270
296
|
},
|
|
271
297
|
watch: {
|
|
272
|
-
unreservedAmount(
|
|
273
|
-
var
|
|
274
|
-
|
|
298
|
+
unreservedAmount(n, s) {
|
|
299
|
+
var l, D;
|
|
300
|
+
n !== s && s === "" && (this.selectedOption = L(
|
|
275
301
|
this.getCookie,
|
|
276
302
|
this.setCookie,
|
|
277
303
|
this.enableFiveDollarsNotes,
|
|
278
|
-
(
|
|
279
|
-
|
|
304
|
+
(D = (l = this.route) == null ? void 0 : l.query) == null ? void 0 : D.utm_campaign,
|
|
305
|
+
n,
|
|
280
306
|
this.userBalance,
|
|
281
307
|
this.fiveDollarsSelected,
|
|
282
308
|
this.showPresetAmounts
|
|
283
|
-
)), this.showPresetAmounts && (this.selectedOption =
|
|
309
|
+
)), this.showPresetAmounts && (this.selectedOption = _);
|
|
284
310
|
}
|
|
285
311
|
},
|
|
286
312
|
mounted() {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
313
|
+
const n = () => {
|
|
314
|
+
var s;
|
|
315
|
+
this.viewportWidth = window.innerWidth, this.componentWidth = ((s = this.$refs.root) == null ? void 0 : s.offsetWidth) || 1024;
|
|
316
|
+
};
|
|
317
|
+
typeof window < "u" && (this.viewportWidth = window.innerWidth, window.ResizeObserver && this.$nextTick(() => {
|
|
318
|
+
this.resizeObserver = new window.ResizeObserver(C(n, 50)), this.$refs.root && (this.resizeObserver.observe(this.$refs.root), n());
|
|
319
|
+
}));
|
|
290
320
|
},
|
|
291
321
|
beforeDestroy() {
|
|
292
|
-
this.resizeHandler && typeof window < "u" && window.removeEventListener("resize", this.resizeHandler);
|
|
322
|
+
this.resizeHandler && typeof window < "u" && window.removeEventListener("resize", this.resizeHandler), this.resizeObserver && this.$refs.root && this.resizeObserver.disconnect();
|
|
293
323
|
},
|
|
294
324
|
methods: {
|
|
295
325
|
async addToBasket() {
|
|
@@ -301,20 +331,20 @@ const p = "Other", E = 430, ce = b`
|
|
|
301
331
|
this.amountToLend
|
|
302
332
|
), this.$emit("add-to-basket", this.amountToLend);
|
|
303
333
|
},
|
|
304
|
-
isAmountLessThan25(
|
|
305
|
-
return
|
|
334
|
+
isAmountLessThan25(n) {
|
|
335
|
+
return n < 25 && n > 0;
|
|
306
336
|
},
|
|
307
|
-
isAmountBetween25And50(
|
|
308
|
-
return
|
|
337
|
+
isAmountBetween25And50(n) {
|
|
338
|
+
return n <= 50 && n > 25;
|
|
309
339
|
},
|
|
310
|
-
isAmountBetween25And500(
|
|
311
|
-
return
|
|
340
|
+
isAmountBetween25And500(n) {
|
|
341
|
+
return n < 500 && n >= 25;
|
|
312
342
|
},
|
|
313
|
-
trackLendAmountSelection(
|
|
343
|
+
trackLendAmountSelection(n) {
|
|
314
344
|
this.showPresetAmounts && (this.selectedOption = null), this.kvTrackFunction(
|
|
315
345
|
this.kvTrackCategory,
|
|
316
346
|
"Modify lend amount",
|
|
317
|
-
|
|
347
|
+
n,
|
|
318
348
|
this.loanId,
|
|
319
349
|
this.loanId
|
|
320
350
|
);
|
|
@@ -328,17 +358,17 @@ const p = "Other", E = 430, ce = b`
|
|
|
328
358
|
this.loanId
|
|
329
359
|
);
|
|
330
360
|
},
|
|
331
|
-
clickSecondaryButton(
|
|
332
|
-
this.secondaryButtonHandler ? (
|
|
361
|
+
clickSecondaryButton(n) {
|
|
362
|
+
this.secondaryButtonHandler ? (n.preventDefault(), n.stopPropagation(), this.secondaryButtonHandler()) : this.handleCheckout();
|
|
333
363
|
},
|
|
334
|
-
clickPresetButton(
|
|
364
|
+
clickPresetButton(n) {
|
|
335
365
|
this.kvTrackFunction(
|
|
336
366
|
this.kvTrackCategory,
|
|
337
367
|
"Modify lend amount",
|
|
338
|
-
|
|
368
|
+
n,
|
|
339
369
|
this.loanId,
|
|
340
370
|
this.loanId
|
|
341
|
-
), this.selectedOption =
|
|
371
|
+
), this.selectedOption = n, this.selectedDropdownOption = _;
|
|
342
372
|
},
|
|
343
373
|
handleCheckout() {
|
|
344
374
|
this.kvTrackFunction(
|
|
@@ -348,145 +378,233 @@ const p = "Other", E = 430, ce = b`
|
|
|
348
378
|
this.loanId,
|
|
349
379
|
this.loanId
|
|
350
380
|
);
|
|
381
|
+
},
|
|
382
|
+
isNarrowComponent() {
|
|
383
|
+
return this.componentWidth < 430;
|
|
351
384
|
}
|
|
352
385
|
}
|
|
353
|
-
}, M = {
|
|
386
|
+
}, M = {
|
|
387
|
+
ref: "root",
|
|
388
|
+
class: "tw-whitespace-nowrap"
|
|
389
|
+
}, U = {
|
|
354
390
|
key: 2,
|
|
355
391
|
class: "tw-w-full tw-text-center tw-rounded tw-p-2",
|
|
356
392
|
style: { background: "#f1f1f1" }
|
|
357
|
-
},
|
|
393
|
+
}, z = { class: "tw-flex" }, H = ["disabled"], j = {
|
|
358
394
|
key: 0,
|
|
359
395
|
class: "md:tw-hidden tw-w-full"
|
|
360
|
-
},
|
|
361
|
-
key:
|
|
396
|
+
}, q = { class: "tw-flex tw-flex-col tw-gap-1 tw-w-full" }, G = { class: "tw-flex tw-gap-1 tw-w-full" }, J = ["value"], Q = { class: "tw-flex tw-gap-1" }, X = ["value"], Y = { class: "tw-flex tw-items-center tw-h-full tw-w-full" }, Z = { class: "tw-min-w-0 tw-flex-1 tw-overflow-hidden tw-text-ellipsis tw-whitespace-nowrap" }, $ = {
|
|
397
|
+
key: 1,
|
|
398
|
+
class: "tw-w-full"
|
|
399
|
+
}, ee = { class: "tw-flex tw-flex-col tw-gap-1 tw-w-full" }, te = { class: "tw-flex tw-gap-1 tw-w-full" }, ne = ["value"], se = { class: "tw-flex tw-gap-1" }, oe = ["value"], le = { class: "tw-flex tw-items-center tw-h-full tw-w-full" }, de = { class: "tw-min-w-0 tw-flex-1 tw-overflow-hidden tw-text-ellipsis tw-whitespace-nowrap" }, ie = ["value"], re = {
|
|
400
|
+
key: 3,
|
|
362
401
|
class: "amountDropdownWrapper"
|
|
363
|
-
},
|
|
364
|
-
function
|
|
365
|
-
const
|
|
366
|
-
return
|
|
367
|
-
e.isInBasket ? (
|
|
402
|
+
}, ae = ["value"];
|
|
403
|
+
function ue(n, s, l, D, d, e) {
|
|
404
|
+
const m = v("kv-ui-button"), P = v("kv-material-icon"), B = v("kv-ui-select"), O = v("kv-lend-amount-button");
|
|
405
|
+
return o(), i("div", M, [
|
|
406
|
+
e.isInBasket ? (o(), a(m, {
|
|
368
407
|
key: 0,
|
|
369
408
|
variant: "secondary",
|
|
370
409
|
class: "tw-inline-flex tw-flex-1 tw-w-full",
|
|
371
410
|
"data-testid": "bp-lend-cta-checkout-button",
|
|
372
|
-
to:
|
|
373
|
-
href:
|
|
374
|
-
onClick: s[0] || (s[0] = (
|
|
411
|
+
to: l.externalLinks ? void 0 : "/basket",
|
|
412
|
+
href: l.externalLinks ? "/basket" : void 0,
|
|
413
|
+
onClick: s[0] || (s[0] = (t) => e.clickSecondaryButton(t))
|
|
375
414
|
}, {
|
|
376
|
-
default:
|
|
377
|
-
|
|
415
|
+
default: r(() => [
|
|
416
|
+
f(u(e.loanInBasketButtonText), 1)
|
|
378
417
|
]),
|
|
379
418
|
_: 1
|
|
380
|
-
}, 8, ["to", "href"])) : e.showNonActionableLoanButton ? (
|
|
419
|
+
}, 8, ["to", "href"])) : e.showNonActionableLoanButton ? (o(), a(m, {
|
|
381
420
|
key: 1,
|
|
382
421
|
class: "tw-inline-flex tw-flex-1"
|
|
383
422
|
}, {
|
|
384
|
-
default:
|
|
385
|
-
|
|
423
|
+
default: r(() => [
|
|
424
|
+
f(u(e.ctaButtonText), 1)
|
|
386
425
|
]),
|
|
387
426
|
_: 1
|
|
388
|
-
})) : e.isFunded ? (
|
|
427
|
+
})) : e.isFunded ? (o(), i("div", U, " This loan was just funded! 🎉 ")) : l.showViewLoan ? (o(), a(m, {
|
|
389
428
|
key: 3,
|
|
390
429
|
state: `${e.allSharesReserved ? "disabled" : ""}`,
|
|
391
|
-
to:
|
|
392
|
-
href:
|
|
430
|
+
to: l.externalLinks ? void 0 : e.readMorePath,
|
|
431
|
+
href: l.externalLinks ? e.readMorePath : void 0,
|
|
393
432
|
class: "tw-mb-0",
|
|
394
|
-
onClick: s[1] || (s[1] = (
|
|
433
|
+
onClick: s[1] || (s[1] = (t) => n.$emit("show-loan-details", t))
|
|
395
434
|
}, {
|
|
396
|
-
default:
|
|
397
|
-
|
|
398
|
-
s[
|
|
399
|
-
|
|
435
|
+
default: r(() => [
|
|
436
|
+
h("span", z, [
|
|
437
|
+
s[9] || (s[9] = f(" View loan ")),
|
|
438
|
+
y(P, {
|
|
400
439
|
class: "tw-w-3 tw-h-3 tw-align-middle",
|
|
401
440
|
icon: d.mdiChevronRight
|
|
402
441
|
}, null, 8, ["icon"])
|
|
403
442
|
])
|
|
404
443
|
]),
|
|
405
444
|
_: 1
|
|
406
|
-
}, 8, ["state", "to", "href"])) : e.useFormSubmit ? (
|
|
445
|
+
}, 8, ["state", "to", "href"])) : e.useFormSubmit ? (o(), i("form", {
|
|
407
446
|
key: 4,
|
|
408
447
|
class: "tw-w-full tw-flex",
|
|
409
|
-
onSubmit: s[
|
|
448
|
+
onSubmit: s[8] || (s[8] = A((...t) => e.addToBasket && e.addToBasket(...t), ["prevent"]))
|
|
410
449
|
}, [
|
|
411
|
-
|
|
412
|
-
class:
|
|
413
|
-
"tw-flex-col md:tw-flex-row md:tw-justify-between tw-min-w-0":
|
|
414
|
-
"tw-
|
|
450
|
+
h("fieldset", {
|
|
451
|
+
class: w(["tw-w-full tw-flex", {
|
|
452
|
+
"tw-flex-col md:tw-flex-row md:tw-justify-between tw-min-w-0": l.showPresetAmounts && !e.isNarrowDesktop,
|
|
453
|
+
"tw-flex-col tw-min-w-0": l.showPresetAmounts && e.isNarrowDesktop,
|
|
454
|
+
"tw-gap-1.5": l.showPresetAmounts && !e.isLendAmountButton && !l.isAdding && !e.isNarrowDesktop
|
|
415
455
|
}]),
|
|
416
|
-
disabled:
|
|
456
|
+
disabled: l.isAdding,
|
|
417
457
|
"data-testid": "bp-lend-cta-select-and-button"
|
|
418
458
|
}, [
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
(
|
|
423
|
-
key:
|
|
459
|
+
l.showPresetAmounts && !l.isAdding && !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && !e.isNarrowDesktop ? (o(), i("div", j, [
|
|
460
|
+
h("div", q, [
|
|
461
|
+
h("div", G, [
|
|
462
|
+
(o(!0), i(k, null, p(e.presetButtonsPrices, (t) => (o(), a(m, {
|
|
463
|
+
key: t,
|
|
424
464
|
variant: "secondary",
|
|
425
|
-
class:
|
|
465
|
+
class: w(["preset-option tw-flex-1 tw-min-w-0", { "selected-option": d.selectedOption == t }]),
|
|
426
466
|
"data-testid": "bp-lend-cta-lend-button-mobile",
|
|
427
|
-
onClick: (
|
|
467
|
+
onClick: (b) => e.clickPresetButton(t)
|
|
428
468
|
}, {
|
|
429
|
-
default:
|
|
430
|
-
|
|
469
|
+
default: r(() => [
|
|
470
|
+
f(" $ " + u(t), 1)
|
|
431
471
|
]),
|
|
432
472
|
_: 2
|
|
433
473
|
}, 1032, ["class", "onClick"]))), 128)),
|
|
434
|
-
e.showFilteredDropdown && d.viewportWidth >= d.MOBILE_DROPDOWN_BREAKPOINT ? (
|
|
474
|
+
e.showFilteredDropdown && d.viewportWidth >= d.MOBILE_DROPDOWN_BREAKPOINT ? (o(), a(B, {
|
|
435
475
|
key: 0,
|
|
436
476
|
id: `LoanAmountDropdownMobile_${e.loanId}`,
|
|
437
477
|
modelValue: d.selectedDropdownOption,
|
|
438
478
|
"onUpdate:modelValue": [
|
|
439
|
-
s[2] || (s[2] = (
|
|
479
|
+
s[2] || (s[2] = (t) => d.selectedDropdownOption = t),
|
|
440
480
|
e.trackLendAmountSelection
|
|
441
481
|
],
|
|
442
|
-
class:
|
|
482
|
+
class: w(["filtered-dropdown mobile-dropdown tw-flex-1 tw-rounded", {
|
|
443
483
|
"unselected-dropdown": !e.selectedDropdown,
|
|
444
484
|
"selected-dropdown": e.selectedDropdown
|
|
445
485
|
}]),
|
|
446
486
|
"aria-label": "Lend amount",
|
|
447
|
-
onClick:
|
|
487
|
+
onClick: A(e.clickDropdown, ["stop"])
|
|
448
488
|
}, {
|
|
449
|
-
default:
|
|
450
|
-
(
|
|
451
|
-
key:
|
|
452
|
-
value:
|
|
453
|
-
}, u(
|
|
489
|
+
default: r(() => [
|
|
490
|
+
(o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
|
|
491
|
+
key: t,
|
|
492
|
+
value: t
|
|
493
|
+
}, u(t !== d.OTHER_OPTION ? `$${t}` : t), 9, J))), 128))
|
|
454
494
|
]),
|
|
455
495
|
_: 1
|
|
456
496
|
}, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0)
|
|
457
497
|
]),
|
|
458
|
-
|
|
459
|
-
e.showFilteredDropdown && d.viewportWidth < d.MOBILE_DROPDOWN_BREAKPOINT ? (
|
|
498
|
+
h("div", Q, [
|
|
499
|
+
e.showFilteredDropdown && d.viewportWidth < d.MOBILE_DROPDOWN_BREAKPOINT ? (o(), a(B, {
|
|
460
500
|
key: 0,
|
|
461
501
|
id: `LoanAmountDropdownMobile_Small_${e.loanId}`,
|
|
462
502
|
modelValue: d.selectedDropdownOption,
|
|
463
503
|
"onUpdate:modelValue": [
|
|
464
|
-
s[3] || (s[3] = (
|
|
504
|
+
s[3] || (s[3] = (t) => d.selectedDropdownOption = t),
|
|
465
505
|
e.trackLendAmountSelection
|
|
466
506
|
],
|
|
467
|
-
class:
|
|
507
|
+
class: w(["filtered-dropdown mobile-dropdown-small tw-rounded tw-w-2/5", {
|
|
468
508
|
"unselected-dropdown": !e.selectedDropdown,
|
|
469
509
|
"selected-dropdown": e.selectedDropdown
|
|
470
510
|
}]),
|
|
471
511
|
"aria-label": "Lend amount",
|
|
472
|
-
onClick:
|
|
512
|
+
onClick: A(e.clickDropdown, ["stop"])
|
|
473
513
|
}, {
|
|
474
|
-
default:
|
|
475
|
-
(
|
|
476
|
-
key: "small-" +
|
|
477
|
-
value:
|
|
478
|
-
}, u(
|
|
514
|
+
default: r(() => [
|
|
515
|
+
(o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
|
|
516
|
+
key: "small-" + t,
|
|
517
|
+
value: t
|
|
518
|
+
}, u(t !== d.OTHER_OPTION ? `$${t}` : t), 9, X))), 128))
|
|
479
519
|
]),
|
|
480
520
|
_: 1
|
|
481
521
|
}, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0),
|
|
482
|
-
|
|
483
|
-
class:
|
|
522
|
+
y(m, {
|
|
523
|
+
class: w(["tw-inline-flex tw-flex-1 button-ellipsis", d.viewportWidth < d.MOBILE_DROPDOWN_BREAKPOINT ? "tw-w-3/5" : "tw-w-full"]),
|
|
484
524
|
"data-testid": "bp-lend-cta-mobile-lend-button",
|
|
485
525
|
type: "submit"
|
|
486
526
|
}, {
|
|
487
|
-
default:
|
|
488
|
-
|
|
489
|
-
|
|
527
|
+
default: r(() => [
|
|
528
|
+
h("span", Y, [
|
|
529
|
+
h("span", Z, u(e.ctaButtonText), 1)
|
|
530
|
+
])
|
|
531
|
+
]),
|
|
532
|
+
_: 1
|
|
533
|
+
}, 8, ["class"])
|
|
534
|
+
])
|
|
535
|
+
])
|
|
536
|
+
])) : c("", !0),
|
|
537
|
+
l.showPresetAmounts && !l.isAdding && !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && e.isNarrowDesktop ? (o(), i("div", $, [
|
|
538
|
+
h("div", ee, [
|
|
539
|
+
h("div", te, [
|
|
540
|
+
(o(!0), i(k, null, p(e.presetButtonsPrices, (t) => (o(), a(m, {
|
|
541
|
+
key: t,
|
|
542
|
+
variant: "secondary",
|
|
543
|
+
class: w(["preset-option tw-flex-1 tw-min-w-0", { "selected-option": d.selectedOption == t }]),
|
|
544
|
+
"data-testid": "bp-lend-cta-lend-button-narrow-desktop",
|
|
545
|
+
onClick: (b) => e.clickPresetButton(t)
|
|
546
|
+
}, {
|
|
547
|
+
default: r(() => [
|
|
548
|
+
f(" $ " + u(t), 1)
|
|
549
|
+
]),
|
|
550
|
+
_: 2
|
|
551
|
+
}, 1032, ["class", "onClick"]))), 128)),
|
|
552
|
+
e.showFilteredDropdown && d.componentWidth >= d.NARROW_SIDEBAR_DROPDOWN_BREAKPOINT ? (o(), a(B, {
|
|
553
|
+
key: 0,
|
|
554
|
+
id: `LoanAmountDropdownNarrowDesktop_${e.loanId}`,
|
|
555
|
+
modelValue: d.selectedDropdownOption,
|
|
556
|
+
"onUpdate:modelValue": [
|
|
557
|
+
s[4] || (s[4] = (t) => d.selectedDropdownOption = t),
|
|
558
|
+
e.trackLendAmountSelection
|
|
559
|
+
],
|
|
560
|
+
class: w(["filtered-dropdown mobile-dropdown tw-flex-1 tw-rounded", {
|
|
561
|
+
"unselected-dropdown": !e.selectedDropdown,
|
|
562
|
+
"selected-dropdown": e.selectedDropdown
|
|
563
|
+
}]),
|
|
564
|
+
"aria-label": "Lend amount",
|
|
565
|
+
onClick: A(e.clickDropdown, ["stop"])
|
|
566
|
+
}, {
|
|
567
|
+
default: r(() => [
|
|
568
|
+
(o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
|
|
569
|
+
key: t,
|
|
570
|
+
value: t
|
|
571
|
+
}, u(t !== d.OTHER_OPTION ? `${t}` : t), 9, ne))), 128))
|
|
572
|
+
]),
|
|
573
|
+
_: 1
|
|
574
|
+
}, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0)
|
|
575
|
+
]),
|
|
576
|
+
h("div", se, [
|
|
577
|
+
e.showFilteredDropdown && d.componentWidth < d.NARROW_SIDEBAR_DROPDOWN_BREAKPOINT ? (o(), a(B, {
|
|
578
|
+
key: 0,
|
|
579
|
+
id: `LoanAmountDropdownNarrowDesktop_Small_${e.loanId}`,
|
|
580
|
+
modelValue: d.selectedDropdownOption,
|
|
581
|
+
"onUpdate:modelValue": [
|
|
582
|
+
s[5] || (s[5] = (t) => d.selectedDropdownOption = t),
|
|
583
|
+
e.trackLendAmountSelection
|
|
584
|
+
],
|
|
585
|
+
class: w(["filtered-dropdown mobile-dropdown-small tw-rounded tw-w-2/5", {
|
|
586
|
+
"unselected-dropdown": !e.selectedDropdown,
|
|
587
|
+
"selected-dropdown": e.selectedDropdown
|
|
588
|
+
}]),
|
|
589
|
+
"aria-label": "Lend amount",
|
|
590
|
+
onClick: A(e.clickDropdown, ["stop"])
|
|
591
|
+
}, {
|
|
592
|
+
default: r(() => [
|
|
593
|
+
(o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
|
|
594
|
+
key: "narrow-small-" + t,
|
|
595
|
+
value: t
|
|
596
|
+
}, u(t !== d.OTHER_OPTION ? `${t}` : t), 9, oe))), 128))
|
|
597
|
+
]),
|
|
598
|
+
_: 1
|
|
599
|
+
}, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0),
|
|
600
|
+
y(m, {
|
|
601
|
+
class: w(["tw-inline-flex tw-flex-1 button-ellipsis", d.componentWidth < d.NARROW_SIDEBAR_DROPDOWN_BREAKPOINT ? "tw-w-3/5" : "tw-w-full"]),
|
|
602
|
+
"data-testid": "bp-lend-cta-narrow-desktop-lend-button",
|
|
603
|
+
type: "submit"
|
|
604
|
+
}, {
|
|
605
|
+
default: r(() => [
|
|
606
|
+
h("span", le, [
|
|
607
|
+
h("span", de, u(e.ctaButtonText), 1)
|
|
490
608
|
])
|
|
491
609
|
]),
|
|
492
610
|
_: 1
|
|
@@ -494,126 +612,126 @@ function ee(t, s, o, L, d, e) {
|
|
|
494
612
|
])
|
|
495
613
|
])
|
|
496
614
|
])) : c("", !0),
|
|
497
|
-
|
|
498
|
-
key:
|
|
499
|
-
class:
|
|
615
|
+
l.showPresetAmounts && !l.isAdding && !e.isNarrowDesktop ? (o(), i("div", {
|
|
616
|
+
key: 2,
|
|
617
|
+
class: w({
|
|
500
618
|
"tw-flex tw-gap-0.5 md:tw-gap-1 lg:tw-gap-1 tw-flex-wrap md:tw-flex-nowrap": !0,
|
|
501
619
|
"tw-hidden md:tw-flex": !e.isLendAmountButton && e.presetButtonsPrices.length > 1
|
|
502
620
|
})
|
|
503
621
|
}, [
|
|
504
|
-
e.isLendAmountButton ? c("", !0) : (
|
|
505
|
-
key:
|
|
622
|
+
e.isLendAmountButton ? c("", !0) : (o(!0), i(k, { key: 0 }, p(e.presetButtonsPrices, (t) => (o(), a(m, {
|
|
623
|
+
key: t,
|
|
506
624
|
variant: "secondary",
|
|
507
|
-
class:
|
|
625
|
+
class: w(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": d.selectedOption == t }]),
|
|
508
626
|
"data-testid": "bp-lend-cta-lend-button",
|
|
509
|
-
onClick: (
|
|
627
|
+
onClick: (b) => e.clickPresetButton(t)
|
|
510
628
|
}, {
|
|
511
|
-
default:
|
|
512
|
-
|
|
629
|
+
default: r(() => [
|
|
630
|
+
f(" $" + u(t), 1)
|
|
513
631
|
]),
|
|
514
632
|
_: 2
|
|
515
633
|
}, 1032, ["class", "onClick"]))), 128)),
|
|
516
|
-
e.showFilteredDropdown ? (
|
|
634
|
+
e.showFilteredDropdown ? (o(), a(B, {
|
|
517
635
|
key: 1,
|
|
518
636
|
id: `LoanAmountDropdown_${e.loanId}`,
|
|
519
637
|
modelValue: d.selectedDropdownOption,
|
|
520
638
|
"onUpdate:modelValue": [
|
|
521
|
-
s[
|
|
639
|
+
s[6] || (s[6] = (t) => d.selectedDropdownOption = t),
|
|
522
640
|
e.trackLendAmountSelection
|
|
523
641
|
],
|
|
524
|
-
class:
|
|
642
|
+
class: w(["tw-min-w-12 tw-rounded filtered-dropdown tw-w-full", {
|
|
525
643
|
"unselected-dropdown": !e.selectedDropdown,
|
|
526
644
|
"selected-dropdown": e.selectedDropdown
|
|
527
645
|
}]),
|
|
528
646
|
"aria-label": "Lend amount",
|
|
529
|
-
onClick:
|
|
647
|
+
onClick: A(e.clickDropdown, ["stop"])
|
|
530
648
|
}, {
|
|
531
|
-
default:
|
|
532
|
-
(
|
|
533
|
-
key:
|
|
534
|
-
value:
|
|
535
|
-
}, u(
|
|
649
|
+
default: r(() => [
|
|
650
|
+
(o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
|
|
651
|
+
key: t,
|
|
652
|
+
value: t
|
|
653
|
+
}, u(t !== d.OTHER_OPTION ? `$${t}` : t), 9, ie))), 128))
|
|
536
654
|
]),
|
|
537
655
|
_: 1
|
|
538
656
|
}, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0)
|
|
539
|
-
], 2)) :
|
|
540
|
-
e.hideShowLendDropdown && !e.isLessThan25 ? (
|
|
657
|
+
], 2)) : l.showPresetAmounts ? c("", !0) : (o(), i("div", re, [
|
|
658
|
+
e.hideShowLendDropdown && !e.isLessThan25 ? (o(), a(B, {
|
|
541
659
|
key: 0,
|
|
542
660
|
id: `LoanAmountDropdown_${e.loanId}`,
|
|
543
661
|
modelValue: d.selectedOption,
|
|
544
662
|
"onUpdate:modelValue": [
|
|
545
|
-
s[
|
|
663
|
+
s[7] || (s[7] = (t) => d.selectedOption = t),
|
|
546
664
|
e.trackLendAmountSelection
|
|
547
665
|
],
|
|
548
666
|
class: "tw-min-w-12",
|
|
549
667
|
style: { "border-radius": "14px 0 0 14px" },
|
|
550
668
|
"aria-label": "Lend amount",
|
|
551
|
-
onClick:
|
|
669
|
+
onClick: A(e.clickDropdown, ["stop"])
|
|
552
670
|
}, {
|
|
553
|
-
default:
|
|
554
|
-
(
|
|
555
|
-
key:
|
|
556
|
-
value:
|
|
557
|
-
}, " $" + u(
|
|
671
|
+
default: r(() => [
|
|
672
|
+
(o(!0), i(k, null, p(e.prices, (t) => (o(), i("option", {
|
|
673
|
+
key: t,
|
|
674
|
+
value: t
|
|
675
|
+
}, " $" + u(t), 9, ae))), 128))
|
|
558
676
|
]),
|
|
559
677
|
_: 1
|
|
560
678
|
}, 8, ["id", "modelValue", "onUpdate:modelValue", "onClick"])) : c("", !0)
|
|
561
679
|
])),
|
|
562
|
-
|
|
563
|
-
class:
|
|
564
|
-
"tw-min-w-0":
|
|
565
|
-
lendButtonWrapper: e.hideShowLendDropdown && !
|
|
566
|
-
"tw-hidden": e.hideLendButton || !e.isLendAmountButton && e.presetButtonsPrices.length > 1 &&
|
|
567
|
-
"md:tw-block tw-hidden": !e.isLendAmountButton && e.presetButtonsPrices.length > 1 &&
|
|
680
|
+
h("div", {
|
|
681
|
+
class: w({
|
|
682
|
+
"tw-min-w-0": l.showPresetAmounts && !e.isNarrowDesktop,
|
|
683
|
+
lendButtonWrapper: e.hideShowLendDropdown && !l.showPresetAmounts,
|
|
684
|
+
"tw-hidden": e.hideLendButton || l.showPresetAmounts && !l.isAdding && !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && (e.isNarrowComponent() || e.isNarrowDesktop),
|
|
685
|
+
"md:tw-block tw-hidden": !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && l.showPresetAmounts && !e.isNarrowDesktop
|
|
568
686
|
})
|
|
569
687
|
}, [
|
|
570
|
-
e.lendButtonVisibility && !e.isLessThan25 ? (
|
|
688
|
+
e.lendButtonVisibility && !e.isLessThan25 ? (o(), a(m, {
|
|
571
689
|
key: "lendButton",
|
|
572
|
-
class:
|
|
690
|
+
class: w(["tw-inline-flex tw-flex-1", { "button-ellipsis tw-w-full": l.showPresetAmounts }]),
|
|
573
691
|
"data-testid": "bp-lend-cta-lend-button",
|
|
574
692
|
type: "submit"
|
|
575
693
|
}, {
|
|
576
|
-
default:
|
|
577
|
-
|
|
694
|
+
default: r(() => [
|
|
695
|
+
f(u(e.ctaButtonText), 1)
|
|
578
696
|
]),
|
|
579
697
|
_: 1
|
|
580
|
-
}, 8, ["class"])) : e.showLendAgain ? (
|
|
698
|
+
}, 8, ["class"])) : e.showLendAgain ? (o(), a(m, {
|
|
581
699
|
key: "lendAgainButton",
|
|
582
|
-
class:
|
|
700
|
+
class: w(["lend-again", { "tw-w-full": l.showPresetAmounts }]),
|
|
583
701
|
"data-testid": "bp-lend-cta-lend-again-button",
|
|
584
702
|
type: "submit"
|
|
585
703
|
}, {
|
|
586
|
-
default:
|
|
587
|
-
|
|
704
|
+
default: r(() => [
|
|
705
|
+
f(u(l.primaryButtonText || "Lend") + " again ", 1)
|
|
588
706
|
]),
|
|
589
707
|
_: 1
|
|
590
708
|
}, 8, ["class"])) : c("", !0)
|
|
591
709
|
], 2),
|
|
592
|
-
e.isLendAmountButton && !
|
|
593
|
-
key:
|
|
710
|
+
e.isLendAmountButton && !l.enableFiveDollarsNotes ? (o(), a(O, {
|
|
711
|
+
key: 4,
|
|
594
712
|
class: "tw-w-full",
|
|
595
713
|
"loan-id": e.loanId,
|
|
596
714
|
"show-now": !1,
|
|
597
715
|
"amount-left": e.amountForLendAmountButton,
|
|
598
|
-
"is-adding":
|
|
716
|
+
"is-adding": l.isAdding,
|
|
599
717
|
onAddToBasket: e.addToBasket
|
|
600
718
|
}, null, 8, ["loan-id", "amount-left", "is-adding", "onAddToBasket"])) : c("", !0),
|
|
601
|
-
!
|
|
602
|
-
key:
|
|
719
|
+
!l.isLoading && l.isAdding ? (o(), a(m, {
|
|
720
|
+
key: 5,
|
|
603
721
|
class: "tw-inline-flex tw-flex-1"
|
|
604
722
|
}, {
|
|
605
|
-
default:
|
|
606
|
-
|
|
723
|
+
default: r(() => s[10] || (s[10] = [
|
|
724
|
+
f(" Adding to basket ")
|
|
607
725
|
])),
|
|
608
726
|
_: 1
|
|
609
727
|
})) : c("", !0)
|
|
610
|
-
], 10,
|
|
728
|
+
], 10, H)
|
|
611
729
|
], 32)) : c("", !0)
|
|
612
|
-
]);
|
|
730
|
+
], 512);
|
|
613
731
|
}
|
|
614
|
-
const
|
|
732
|
+
const be = /* @__PURE__ */ W(K, [["render", ue], ["__scopeId", "data-v-629f4bdf"]]);
|
|
615
733
|
export {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
734
|
+
De as KV_LEND_CTA_FRAGMENT,
|
|
735
|
+
ye as KV_LEND_CTA_USER_FRAGMENT,
|
|
736
|
+
be as default
|
|
619
737
|
};
|