@wodira/browser 1.2.3 → 1.3.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/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/boxes/cdn.js +1 -1
- package/dist/ui/boxes/index.js +7 -0
- package/dist/ui/components.d.ts +10 -1
- package/dist/ui/components.d.ts.map +1 -1
- package/dist/ui/i18n.d.ts +1 -1
- package/dist/ui/i18n.d.ts.map +1 -1
- package/dist/ui/{index-3eb6xc34.js → index-4eecjr6y.js} +70 -1
- package/dist/ui/index.js +137 -44
- package/dist/ui/shirt-sponsors/cdn.js +90 -22
- package/dist/ui/shirt-sponsors/index.js +2 -2
- package/dist/ui/styles.d.ts +1 -0
- package/dist/ui/styles.d.ts.map +1 -1
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/waiver-document-kemkgn03.js +4120 -0
- package/dist/ui/waiver-document.d.ts +2 -0
- package/dist/ui/waiver-document.d.ts.map +1 -0
- package/package.json +3 -1
package/dist/ui/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export,
|
|
3
|
+
__preload,
|
|
3
4
|
__chunks,
|
|
4
5
|
css,
|
|
5
6
|
html,
|
|
@@ -10,14 +11,15 @@ import {
|
|
|
10
11
|
} from "./index-1zshfsk6.js";
|
|
11
12
|
import {
|
|
12
13
|
wodiraUiStyles,
|
|
14
|
+
waiverDocumentStyles,
|
|
13
15
|
WodiraShirtAuction2,
|
|
14
16
|
defineWodiraShirtElements2
|
|
15
|
-
} from "./index-
|
|
17
|
+
} from "./index-4eecjr6y.js";
|
|
16
18
|
import {
|
|
17
19
|
WodiraRoute3d2,
|
|
18
20
|
defineWodiraRouteElements2
|
|
19
21
|
} from "./index-3qe91gk8.js";
|
|
20
|
-
__chunks(import.meta.url,["
|
|
22
|
+
__chunks(import.meta.url,["10wnpxb1","kemkgn03","1zshfsk6","4eecjr6y","3qe91gk8","jyks1h8f","rn3jgtqn","xdhg885t"],[["./index.js",2,3,4],["./waiver-document-kemkgn03.js"],["./index-1zshfsk6.js"],["./index-4eecjr6y.js",2],["./index-3qe91gk8.js",2],["./shirt-3d-renderer-jyks1h8f.js",7],["./map-view-rn3jgtqn.js",4],["./index-xdhg885t.js"]],0);
|
|
21
23
|
|
|
22
24
|
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
23
25
|
var exports_iso = {};
|
|
@@ -134,6 +136,8 @@ var es = {
|
|
|
134
136
|
priceTiers: "Tramos de precio",
|
|
135
137
|
readLess: "Ver menos",
|
|
136
138
|
readMore: "Leer más",
|
|
139
|
+
closeWaiverDocument: "Cerrar",
|
|
140
|
+
readWaiverDocument: "Leer documento",
|
|
137
141
|
registerData: "Datos de inscripción",
|
|
138
142
|
registrationReceiptEmail: "Email de la inscripción",
|
|
139
143
|
registrationReceiptFound: "Inscripción encontrada",
|
|
@@ -267,6 +271,8 @@ var en = {
|
|
|
267
271
|
priceTiers: "Price tiers",
|
|
268
272
|
readLess: "Show less",
|
|
269
273
|
readMore: "Read more",
|
|
274
|
+
closeWaiverDocument: "Close",
|
|
275
|
+
readWaiverDocument: "Read document",
|
|
270
276
|
registerData: "Registration details",
|
|
271
277
|
registrationReceiptEmail: "Registration email",
|
|
272
278
|
registrationReceiptFound: "Registration found",
|
|
@@ -6608,8 +6614,9 @@ var teamParticipantCompletionSchema = object({
|
|
|
6608
6614
|
fieldId: string2().min(1),
|
|
6609
6615
|
value: union([
|
|
6610
6616
|
boolean2(),
|
|
6611
|
-
|
|
6612
|
-
|
|
6617
|
+
number2(),
|
|
6618
|
+
string2(),
|
|
6619
|
+
array(string2())
|
|
6613
6620
|
])
|
|
6614
6621
|
})).max(250).optional(),
|
|
6615
6622
|
legalSignature: teamParticipantLegalSignatureSchema.optional()
|
|
@@ -6965,7 +6972,17 @@ function eventFormAnswerSchema(field) {
|
|
|
6965
6972
|
function matchesRegistrationVisibilityCondition(condition, participants = []) {
|
|
6966
6973
|
return condition == null || participants.some((answers) => answers.some(({ fieldId, value }) => fieldId === condition.fieldId && value === condition.value));
|
|
6967
6974
|
}
|
|
6968
|
-
|
|
6975
|
+
function hasParticipantConditionalRegistrationSupplement(supplements, fields, categoryId) {
|
|
6976
|
+
return applicableEventWaivers(supplements, categoryId).some(({ isActive, visibilityCondition }) => {
|
|
6977
|
+
if (isActive === false || visibilityCondition == null)
|
|
6978
|
+
return false;
|
|
6979
|
+
if (typeof visibilityCondition !== "object" || !("fieldId" in visibilityCondition) || !("value" in visibilityCondition) || typeof visibilityCondition.fieldId !== "string" || typeof visibilityCondition.value !== "string" && typeof visibilityCondition.value !== "boolean")
|
|
6980
|
+
return true;
|
|
6981
|
+
const fieldId = visibilityCondition.fieldId;
|
|
6982
|
+
const field = fields.find(({ id }) => id === fieldId);
|
|
6983
|
+
return !field || field.target === "ATHLETE" && field.responseScope !== "REGISTRATION" && applicableEventWaivers([field], categoryId).length > 0;
|
|
6984
|
+
});
|
|
6985
|
+
}
|
|
6969
6986
|
// src/ui/events.ts
|
|
6970
6987
|
function emitWodiraEvent(target, name, detail) {
|
|
6971
6988
|
target.dispatchEvent(new CustomEvent(name, {
|
|
@@ -7624,6 +7641,13 @@ var wodiraUiParts = [
|
|
|
7624
7641
|
"empty",
|
|
7625
7642
|
"success",
|
|
7626
7643
|
"waiver",
|
|
7644
|
+
"waiver-item",
|
|
7645
|
+
"waiver-read",
|
|
7646
|
+
"waiver-dialog",
|
|
7647
|
+
"waiver-dialog-header",
|
|
7648
|
+
"waiver-close",
|
|
7649
|
+
"waiver-document",
|
|
7650
|
+
"waiver-document-plain",
|
|
7627
7651
|
"supplement",
|
|
7628
7652
|
"eligibility-summary",
|
|
7629
7653
|
"participant-mode",
|
|
@@ -8436,7 +8460,7 @@ class WodiraPricingCards extends RegistrationWindowElement {
|
|
|
8436
8460
|
}
|
|
8437
8461
|
|
|
8438
8462
|
class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
8439
|
-
static styles = [wodiraUiStyles, wodiraLayoutStyles];
|
|
8463
|
+
static styles = [wodiraUiStyles, wodiraLayoutStyles, waiverDocumentStyles];
|
|
8440
8464
|
static properties = {
|
|
8441
8465
|
publishableKey: { type: String, attribute: "publishable-key" },
|
|
8442
8466
|
baseUrl: { type: String, attribute: "base-url" },
|
|
@@ -8461,6 +8485,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8461
8485
|
pendingParticipantPositions: { state: true },
|
|
8462
8486
|
customFieldValues: { state: true },
|
|
8463
8487
|
waiversAccepted: { state: true },
|
|
8488
|
+
waiverDocument: { state: true },
|
|
8464
8489
|
signatureDraft: { state: true },
|
|
8465
8490
|
selectedSupplementIds: { state: true },
|
|
8466
8491
|
supplementSelections: { state: true },
|
|
@@ -8522,6 +8547,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8522
8547
|
disconnectedCallback() {
|
|
8523
8548
|
clearTimeout(this.summaryTimer);
|
|
8524
8549
|
this.summaryRequestId++;
|
|
8550
|
+
this.waiverDocument = undefined;
|
|
8525
8551
|
super.disconnectedCallback();
|
|
8526
8552
|
}
|
|
8527
8553
|
updated(changed) {
|
|
@@ -8539,6 +8565,8 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8539
8565
|
[undefined, ...this.guestRegistrations].map((guest) => {
|
|
8540
8566
|
const categoryId = guest?.categoryId ?? this.categoryId;
|
|
8541
8567
|
const answers = this.conditionAnswers(categoryId, guest);
|
|
8568
|
+
const sharedFieldIds = new Set(this.registrationFields(categoryId).filter((field) => field.responseScope === "REGISTRATION").map((field) => field.id));
|
|
8569
|
+
const sharedAnswers = answers[0]?.filter(({ fieldId }) => sharedFieldIds.has(fieldId));
|
|
8542
8570
|
const conditionalWaivers = waiverEntries.filter((entry) => entry.guest === guest && entry.waiver.requiresSignature && entry.waiver.visibilityCondition != null).map(({ waiver }) => waiver);
|
|
8543
8571
|
const participants = (guest?.athletes ?? this.athletes).map((athlete, position) => ({ athlete, position })).filter(({ position }) => guest || !this.isParticipantDeferred(position));
|
|
8544
8572
|
return [
|
|
@@ -8551,7 +8579,8 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8551
8579
|
athlete.email,
|
|
8552
8580
|
athlete.birthDate,
|
|
8553
8581
|
conditionalWaivers.filter((waiver) => matchesRegistrationVisibilityCondition(waiver.visibilityCondition, [
|
|
8554
|
-
answers[index] ?? []
|
|
8582
|
+
answers[index] ?? [],
|
|
8583
|
+
sharedAnswers ?? []
|
|
8555
8584
|
])).map(({ id }) => id)
|
|
8556
8585
|
])
|
|
8557
8586
|
];
|
|
@@ -8584,7 +8613,9 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8584
8613
|
if (changed.has("summary") || changed.has("event"))
|
|
8585
8614
|
this.syncDeferredParticipantPositions();
|
|
8586
8615
|
const previousAthletes = changed.get("athletes");
|
|
8587
|
-
const
|
|
8616
|
+
const previousValues = changed.get("customFieldValues");
|
|
8617
|
+
const conditionIds = this.conditionFieldIds(this.categoryId);
|
|
8618
|
+
const conditionalAnswersChanged = conditionIds.size > 0 && (changed.has("pendingParticipantPositions") || [...conditionIds].some((id) => changed.has("customFieldValues") && this.customFieldValues[id] !== previousValues?.[id] || changed.has("athletes") && this.athletes.some((athlete, index) => athlete.customFieldValues?.[id] !== previousAthletes?.[index]?.customFieldValues?.[id])));
|
|
8588
8619
|
if (conditionalAnswersChanged)
|
|
8589
8620
|
this.syncRequiredSupplements();
|
|
8590
8621
|
if (changed.has("guestRegistrations"))
|
|
@@ -8660,6 +8691,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8660
8691
|
</div>
|
|
8661
8692
|
</div>
|
|
8662
8693
|
</form>
|
|
8694
|
+
${this.renderWaiverDocument()}
|
|
8663
8695
|
`;
|
|
8664
8696
|
}
|
|
8665
8697
|
get registrationUnavailableMessage() {
|
|
@@ -8678,8 +8710,9 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8678
8710
|
if (summaryDecision) {
|
|
8679
8711
|
return summaryDecision.available && this.deferredTeamCompletionDeadline > Date.now();
|
|
8680
8712
|
}
|
|
8681
|
-
if (this.
|
|
8713
|
+
if (this.deferredTeamCompletionBlockedBySignature || hasParticipantConditionalRegistrationSupplement(this.event?.supplements ?? [], this.event?.eventFormFields ?? [], category.id)) {
|
|
8682
8714
|
return false;
|
|
8715
|
+
}
|
|
8683
8716
|
return this.deferredTeamCompletionDeadline > Date.now();
|
|
8684
8717
|
}
|
|
8685
8718
|
get deferredTeamCompletionDeadline() {
|
|
@@ -8702,24 +8735,33 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8702
8735
|
getSupplementsForCategory(categoryId, answers = this.conditionAnswers(categoryId)) {
|
|
8703
8736
|
return (this.event?.supplements ?? []).filter((supplement) => supplement.isActive !== false && isSupplementAvailableForCategory(supplement, categoryId) && matchesRegistrationVisibilityCondition(supplement.visibilityCondition, answers));
|
|
8704
8737
|
}
|
|
8705
|
-
|
|
8706
|
-
return (this.event?.eventFormFields ?? []).
|
|
8707
|
-
|
|
8708
|
-
|
|
8738
|
+
registrationFields(categoryId) {
|
|
8739
|
+
return (this.event?.eventFormFields ?? []).filter((field) => isFormFieldTargetAthlete(field) && isFormFieldAvailableForCategory(field, categoryId));
|
|
8740
|
+
}
|
|
8741
|
+
isParticipantField(field, conditionIds) {
|
|
8742
|
+
return field.responseScope == null ? conditionIds.has(field.id) : field.responseScope === "PARTICIPANT";
|
|
8743
|
+
}
|
|
8744
|
+
fieldAnswers(categoryId, values, participantOnly = false) {
|
|
8745
|
+
if (!values)
|
|
8746
|
+
return [];
|
|
8747
|
+
const conditionIds = participantOnly ? this.conditionFieldIds(categoryId) : undefined;
|
|
8748
|
+
return this.registrationFields(categoryId).flatMap((field) => {
|
|
8749
|
+
const value = values[field.id];
|
|
8750
|
+
return !isBlank(value) && (!conditionIds || this.isParticipantField(field, conditionIds)) ? [{ fieldId: field.id, value }] : [];
|
|
8709
8751
|
});
|
|
8710
8752
|
}
|
|
8711
8753
|
conditionAnswers(categoryId, guest) {
|
|
8712
8754
|
const conditionIds = this.conditionFieldIds(categoryId);
|
|
8713
|
-
const answersFor = (values) => this.fieldAnswers(categoryId, values).filter(({ fieldId }) => conditionIds.has(fieldId));
|
|
8755
|
+
const answersFor = (values, participantOnly = false) => this.fieldAnswers(categoryId, values, participantOnly).filter(({ fieldId }) => conditionIds.has(fieldId));
|
|
8714
8756
|
const mainAnswers = answersFor(guest ? guest.customFieldValues : this.customFieldValues);
|
|
8715
8757
|
const athletes = guest?.athletes ?? this.athletes;
|
|
8716
8758
|
return [
|
|
8717
8759
|
mainAnswers,
|
|
8718
|
-
...athletes.slice(1).flatMap((athlete, index) => !guest && this.isParticipantDeferred(index + 1) ? [] : [answersFor(athlete.
|
|
8760
|
+
...athletes.slice(1).flatMap((athlete, index) => !guest && this.isParticipantDeferred(index + 1) ? [] : [answersFor(athlete.customFieldValues, true)])
|
|
8719
8761
|
];
|
|
8720
8762
|
}
|
|
8721
8763
|
conditionFieldIds(categoryId) {
|
|
8722
|
-
const eligibleFields = new Set(
|
|
8764
|
+
const eligibleFields = new Set(this.registrationFields(categoryId).map((field) => field.id));
|
|
8723
8765
|
return new Set([
|
|
8724
8766
|
...applicableEventWaivers(this.event?.waivers ?? [], categoryId),
|
|
8725
8767
|
...(this.event?.supplements ?? []).filter((supplement) => supplement.isActive !== false && isSupplementAvailableForCategory(supplement, categoryId))
|
|
@@ -8981,7 +9023,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8981
9023
|
renderCustomFields(categoryId = this.categoryId, guestIndex, participantIndex) {
|
|
8982
9024
|
const conditionIds = this.conditionFieldIds(categoryId);
|
|
8983
9025
|
const isTeam = (this.getCategory(categoryId)?.teamSize ?? 1) > 1;
|
|
8984
|
-
const fields = this.
|
|
9026
|
+
const fields = this.registrationFields(categoryId).filter((field) => !isTeam || this.isParticipantField(field, conditionIds) === (participantIndex !== undefined));
|
|
8985
9027
|
if (!fields.length)
|
|
8986
9028
|
return nothing;
|
|
8987
9029
|
const answerIndex = participantIndex === 0 ? undefined : participantIndex;
|
|
@@ -8997,7 +9039,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
8997
9039
|
renderCustomField(field, drivesVisibility, guestIndex, participantIndex) {
|
|
8998
9040
|
const guest = guestIndex === undefined ? undefined : this.guestRegistrations[guestIndex];
|
|
8999
9041
|
const athlete = participantIndex === undefined ? undefined : (guest?.athletes ?? this.athletes)[participantIndex];
|
|
9000
|
-
const values = participantIndex === undefined ? guest ? guest.customFieldValues ?? {} : this.customFieldValues : athlete?.
|
|
9042
|
+
const values = participantIndex === undefined ? guest ? guest.customFieldValues ?? {} : this.customFieldValues : athlete?.customFieldValues ?? {};
|
|
9001
9043
|
const errorKey = this.customFieldErrorKey(field.id, guestIndex, participantIndex);
|
|
9002
9044
|
const update = (value) => this.updateCustomField(field.id, value, guestIndex, participantIndex);
|
|
9003
9045
|
const id = fieldErrorId(errorKey);
|
|
@@ -9519,22 +9561,76 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
9519
9561
|
const acceptanceKey = this.waiverAcceptanceKey(waiver, guest);
|
|
9520
9562
|
const errorKey = `waivers.${acceptanceKey}`;
|
|
9521
9563
|
return html`
|
|
9522
|
-
<
|
|
9523
|
-
<
|
|
9524
|
-
<
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9564
|
+
<div part="waiver-item">
|
|
9565
|
+
<label part="label checkbox waiver">
|
|
9566
|
+
<span>
|
|
9567
|
+
<input
|
|
9568
|
+
part="checkbox"
|
|
9569
|
+
type="checkbox"
|
|
9570
|
+
.checked=${this.waiversAccepted[acceptanceKey] === true}
|
|
9571
|
+
aria-invalid=${this.fieldErrors[errorKey] ? "true" : "false"}
|
|
9572
|
+
@change=${(event) => this.updateWaiver(acceptanceKey, event.target.checked)}
|
|
9573
|
+
/>
|
|
9574
|
+
${waiver.name}${waiver.isRequired ? " *" : ""}
|
|
9575
|
+
</span>
|
|
9576
|
+
${this.renderFieldError(errorKey)}
|
|
9577
|
+
</label>
|
|
9578
|
+
${waiver.bodyText?.trim() ? html`<button
|
|
9579
|
+
part="button secondary text-button waiver-read"
|
|
9580
|
+
type="button"
|
|
9581
|
+
aria-haspopup="dialog"
|
|
9582
|
+
aria-label=${`${t(this.locale, "readWaiverDocument")} · ${waiver.name}`}
|
|
9583
|
+
@click=${(event) => this.openWaiverDocument(waiver, event.currentTarget)}
|
|
9584
|
+
>${t(this.locale, "readWaiverDocument")}</button>` : nothing}
|
|
9585
|
+
</div>
|
|
9586
|
+
`;
|
|
9587
|
+
}
|
|
9588
|
+
renderWaiverDocument() {
|
|
9589
|
+
if (!this.waiverDocument)
|
|
9590
|
+
return nothing;
|
|
9591
|
+
const { title, body, content } = this.waiverDocument;
|
|
9592
|
+
return html`
|
|
9593
|
+
<dialog part="waiver-dialog" aria-labelledby="waiver-document-title"
|
|
9594
|
+
@close=${this.closeWaiverDocument}>
|
|
9595
|
+
<header part="waiver-dialog-header">
|
|
9596
|
+
<h2 id="waiver-document-title">${title}</h2>
|
|
9597
|
+
<button part="button secondary waiver-close" type="button" autofocus
|
|
9598
|
+
@click=${(event) => event.currentTarget.closest("dialog")?.close()}>
|
|
9599
|
+
${t(this.locale, "closeWaiverDocument")}
|
|
9600
|
+
</button>
|
|
9601
|
+
</header>
|
|
9602
|
+
<div part="waiver-document" tabindex="0">
|
|
9603
|
+
${content ?? html`<p part="waiver-document-plain">${body}</p>`}
|
|
9604
|
+
</div>
|
|
9605
|
+
</dialog>
|
|
9536
9606
|
`;
|
|
9537
9607
|
}
|
|
9608
|
+
async openWaiverDocument(waiver, trigger) {
|
|
9609
|
+
const body = waiver.bodyText?.trim();
|
|
9610
|
+
if (!body)
|
|
9611
|
+
return;
|
|
9612
|
+
const document2 = { title: waiver.name, body, trigger };
|
|
9613
|
+
this.waiverDocument = document2;
|
|
9614
|
+
await this.updateComplete;
|
|
9615
|
+
if (this.waiverDocument !== document2 || !this.isConnected)
|
|
9616
|
+
return;
|
|
9617
|
+
const dialog = this.renderRoot.querySelector('[part~="waiver-dialog"]');
|
|
9618
|
+
if (!dialog)
|
|
9619
|
+
return;
|
|
9620
|
+
if (!dialog.open)
|
|
9621
|
+
dialog.showModal();
|
|
9622
|
+
try {
|
|
9623
|
+
const { renderWaiverDocumentBody } = await (__preload("kemkgn03"), import("./waiver-document-kemkgn03.js"));
|
|
9624
|
+
if (this.waiverDocument === document2) {
|
|
9625
|
+
this.waiverDocument = { ...document2, content: renderWaiverDocumentBody(body) };
|
|
9626
|
+
}
|
|
9627
|
+
} catch {}
|
|
9628
|
+
}
|
|
9629
|
+
closeWaiverDocument() {
|
|
9630
|
+
const trigger = this.waiverDocument?.trigger;
|
|
9631
|
+
this.waiverDocument = undefined;
|
|
9632
|
+
trigger?.focus();
|
|
9633
|
+
}
|
|
9538
9634
|
renderSummary() {
|
|
9539
9635
|
if (this.summaryError)
|
|
9540
9636
|
return html`<aside part="card summary">
|
|
@@ -9861,7 +9957,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
9861
9957
|
updateCustomField(fieldId, value, guestIndex, participantIndex) {
|
|
9862
9958
|
const updateAthletes = (athletes) => athletes.map((athlete, position) => position === participantIndex ? {
|
|
9863
9959
|
...athlete,
|
|
9864
|
-
|
|
9960
|
+
customFieldValues: { ...athlete.customFieldValues, [fieldId]: value }
|
|
9865
9961
|
} : athlete);
|
|
9866
9962
|
if (guestIndex === undefined) {
|
|
9867
9963
|
if (participantIndex === undefined) {
|
|
@@ -9916,8 +10012,8 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
9916
10012
|
}
|
|
9917
10013
|
validateRegistrationFields(errors, categoryId, values, guestIndex, participantIndex) {
|
|
9918
10014
|
const conditions = this.conditionFieldIds(categoryId);
|
|
9919
|
-
for (const field of this.
|
|
9920
|
-
if (
|
|
10015
|
+
for (const field of this.registrationFields(categoryId)) {
|
|
10016
|
+
if (participantIndex !== undefined && !this.isParticipantField(field, conditions))
|
|
9921
10017
|
continue;
|
|
9922
10018
|
const value = values?.[field.id];
|
|
9923
10019
|
const input = isCheckboxField(field) && conditions.has(field.id) ? {
|
|
@@ -9984,7 +10080,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
9984
10080
|
errors[`guestRegistrations.${guestIndex}.categoryId`] = guestUnavailable;
|
|
9985
10081
|
for (const [athleteIndex, athlete] of guest.athletes.entries()) {
|
|
9986
10082
|
if (athleteIndex > 0)
|
|
9987
|
-
this.validateRegistrationFields(errors, guest.categoryId, athlete.
|
|
10083
|
+
this.validateRegistrationFields(errors, guest.categoryId, athlete.customFieldValues, guestIndex, athleteIndex);
|
|
9988
10084
|
setValidationError(errors, this.locale, `guestRegistrations.${guestIndex}.athletes.${athleteIndex}.fullname`, validateRequiredText(athlete.fullname));
|
|
9989
10085
|
setValidationError(errors, this.locale, `guestRegistrations.${guestIndex}.athletes.${athleteIndex}.email`, validateEmail(athlete.email, true));
|
|
9990
10086
|
setValidationError(errors, this.locale, `guestRegistrations.${guestIndex}.athletes.${athleteIndex}.phone`, validateRequiredText(athlete.phone));
|
|
@@ -10013,7 +10109,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
10013
10109
|
this.validateRegistrationFields(errors, this.categoryId, this.customFieldValues);
|
|
10014
10110
|
for (const [index, athlete] of this.athletes.entries()) {
|
|
10015
10111
|
if (index > 0 && !this.isParticipantDeferred(index))
|
|
10016
|
-
this.validateRegistrationFields(errors, this.categoryId, athlete.
|
|
10112
|
+
this.validateRegistrationFields(errors, this.categoryId, athlete.customFieldValues, undefined, index);
|
|
10017
10113
|
}
|
|
10018
10114
|
for (const { waiver, guest } of this.waiverEntries) {
|
|
10019
10115
|
const acceptanceKey = this.waiverAcceptanceKey(waiver, guest);
|
|
@@ -10045,8 +10141,8 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
10045
10141
|
}));
|
|
10046
10142
|
}
|
|
10047
10143
|
checkoutAthlete(athlete, categoryId) {
|
|
10048
|
-
const {
|
|
10049
|
-
const customFields = this.fieldAnswers(categoryId,
|
|
10144
|
+
const { customFieldValues, ...details } = athlete;
|
|
10145
|
+
const customFields = this.fieldAnswers(categoryId, customFieldValues, true);
|
|
10050
10146
|
return {
|
|
10051
10147
|
...details,
|
|
10052
10148
|
fullname: details.fullname.trim(),
|
|
@@ -10067,9 +10163,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
10067
10163
|
...guest.club.trim() ? { club: guest.club.trim() } : {},
|
|
10068
10164
|
selectedSupplementIds: guest.selectedSupplementIds,
|
|
10069
10165
|
...guest.supplementSelections?.length ? { supplementSelections: guest.supplementSelections } : {},
|
|
10070
|
-
...guest.customFieldValues ? {
|
|
10071
|
-
customFields: Object.entries(guest.customFieldValues).filter(([fieldId, value]) => !isBlank(value) && this.event?.eventFormFields.some((field) => field.id === fieldId && isFormFieldTargetAthlete(field) && isFormFieldAvailableForCategory(field, guest.categoryId))).map(([fieldId, value]) => ({ fieldId, value }))
|
|
10072
|
-
} : {},
|
|
10166
|
+
...guest.customFieldValues ? { customFields: this.fieldAnswers(guest.categoryId, guest.customFieldValues) } : {},
|
|
10073
10167
|
waiversAccepted: this.checkoutWaiverAcceptances(guest),
|
|
10074
10168
|
athletes: guest.athletes.map((athlete) => this.checkoutAthlete(athlete, guest.categoryId))
|
|
10075
10169
|
}));
|
|
@@ -10205,8 +10299,7 @@ class WodiraRegistrationForm extends RegistrationWindowElement {
|
|
|
10205
10299
|
eventId: this.eventId,
|
|
10206
10300
|
categoryId: this.categoryId
|
|
10207
10301
|
});
|
|
10208
|
-
const
|
|
10209
|
-
const customFields = Object.entries(this.customFieldValues).filter(([fieldId, value]) => activeFieldIds.has(fieldId) && !isBlank(value)).map(([fieldId, value]) => ({ fieldId, value }));
|
|
10302
|
+
const customFields = this.fieldAnswers(this.categoryId, this.customFieldValues);
|
|
10210
10303
|
const client = createClient({
|
|
10211
10304
|
publishableKey: this.publishableKey.trim(),
|
|
10212
10305
|
baseUrl: this.baseUrl
|