@wix/members 1.0.542 → 1.0.544
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/build/cjs/context-account-details.d.ts +9 -6
- package/build/cjs/context-account-details.js +94 -89
- package/build/cjs/context-account-details.js.map +1 -1
- package/build/cjs/context-addresses.js +2 -2
- package/build/cjs/context-addresses.js.map +1 -1
- package/build/es/context-account-details.d.mts +9 -6
- package/build/es/context-account-details.mjs +94 -89
- package/build/es/context-account-details.mjs.map +1 -1
- package/build/es/context-addresses.mjs +2 -2
- package/build/es/context-addresses.mjs.map +1 -1
- package/build/internal/cjs/context-account-details.d.ts +9 -6
- package/build/internal/es/context-account-details.d.mts +9 -6
- package/context-runtime/context-account-details/runtime.d.ts +9 -6
- package/context-runtime/context-account-details/runtime.js +3 -3
- package/context-runtime/context-addresses/runtime.js +3 -3
- package/package.json +2 -14
- package/account-home-context-provider/package.json +0 -3
- package/build/cjs/context-account-home.d.ts +0 -54
- package/build/cjs/context-account-home.js +0 -719
- package/build/cjs/context-account-home.js.map +0 -1
- package/build/es/context-account-home.d.mts +0 -54
- package/build/es/context-account-home.mjs +0 -690
- package/build/es/context-account-home.mjs.map +0 -1
- package/build/internal/cjs/context-account-home.d.ts +0 -54
- package/build/internal/es/context-account-home.d.mts +0 -54
- package/context/account-home/package.json +0 -3
- package/context-runtime/context-account-home/runtime.d.ts +0 -54
- package/context-runtime/context-account-home/runtime.js +0 -2
|
@@ -113,9 +113,9 @@ interface NamedFieldBinding {
|
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/extensions/account-settings/context-providers/account-named-fields.d.ts
|
|
115
115
|
/**
|
|
116
|
-
* The platform's own field vocabulary, named as the
|
|
117
|
-
*
|
|
118
|
-
*
|
|
116
|
+
* The platform's own field vocabulary, each named as the site names it. A `SYSTEM` or `CONTACT` field
|
|
117
|
+
* exists on every site, so each one is addressable by name. Site-specific fields are excluded from
|
|
118
|
+
* Phase 0. The contact email is absent on purpose: the API refuses a write to it.
|
|
119
119
|
*/
|
|
120
120
|
declare const NAMED_FIELD_KEYS: {
|
|
121
121
|
readonly firstName: "customfields.system.firstname";
|
|
@@ -124,12 +124,15 @@ declare const NAMED_FIELD_KEYS: {
|
|
|
124
124
|
readonly title: "customfields.system.title";
|
|
125
125
|
readonly birthdate: "customfields.contact.birthdate";
|
|
126
126
|
readonly company: "customfields.contact.company";
|
|
127
|
-
readonly
|
|
127
|
+
readonly position: "customfields.contact.position";
|
|
128
128
|
};
|
|
129
129
|
type NamedFieldName = keyof typeof NAMED_FIELD_KEYS;
|
|
130
|
-
type NamedValidationErrors = Record<NamedFieldName, MemberFieldValidationError | null
|
|
130
|
+
type NamedValidationErrors = Record<NamedFieldName, MemberFieldValidationError | null> & {
|
|
131
|
+
/** @internal `position`'s, under the name pages saved before it still bind. */jobTitle: MemberFieldValidationError | null;
|
|
132
|
+
};
|
|
131
133
|
type NamedAccountFields = Record<NamedFieldName, NamedFieldBinding> & {
|
|
132
|
-
/** Every named field's fault, grouped so the binding picker lists them under one heading. */
|
|
134
|
+
/** @internal `position`, under the name pages saved before it still bind. */jobTitle: NamedFieldBinding; /** Every named field's fault, grouped so the binding picker lists them under one heading. */
|
|
135
|
+
validationErrors: NamedValidationErrors;
|
|
133
136
|
};
|
|
134
137
|
//#endregion
|
|
135
138
|
//#region src/extensions/account-settings/login-info/credential-restriction.d.ts
|
|
@@ -3288,7 +3288,7 @@ var no = (e11) => {
|
|
|
3288
3288
|
}
|
|
3289
3289
|
return n2;
|
|
3290
3290
|
};
|
|
3291
|
-
var ro = [...`--wst-button-primary-background-color.--wst-button-primary-background-image.--wst-button-primary-padding-top.--wst-button-primary-border-top-color.--wst-button-primary-border-top-width.--wst-button-primary-border-top-style.--wst-button-primary-padding-right.--wst-button-primary-border-right-color.--wst-button-primary-border-right-width.--wst-button-primary-border-right-style.--wst-button-primary-padding-bottom.--wst-button-primary-border-bottom-color.--wst-button-primary-border-bottom-width.--wst-button-primary-border-bottom-style.--wst-button-primary-padding-left.--wst-button-primary-border-left-color.--wst-button-primary-border-left-width.--wst-button-primary-border-left-style.--wst-button-primary-border-top-left-radius.--wst-button-primary-border-top-right-radius.--wst-button-primary-border-bottom-right-radius.--wst-button-primary-border-bottom-left-radius.--wst-button-primary-box-shadow.--wst-button-primary-column-gap.--wst-button-primary-row-gap.--wst-button-primary-letter-spacing.--wst-button-primary-text-decoration.--wst-button-primary-text-transform.--wst-button-primary-text-shadow.--wst-button-secondary-background-color.--wst-button-secondary-background-image.--wst-button-secondary-padding-top.--wst-button-secondary-border-top-color.--wst-button-secondary-border-top-width.--wst-button-secondary-border-top-style.--wst-button-secondary-padding-right.--wst-button-secondary-border-right-color.--wst-button-secondary-border-right-width.--wst-button-secondary-border-right-style.--wst-button-secondary-padding-bottom.--wst-button-secondary-border-bottom-color.--wst-button-secondary-border-bottom-width.--wst-button-secondary-border-bottom-style.--wst-button-secondary-padding-left.--wst-button-secondary-border-left-color.--wst-button-secondary-border-left-width.--wst-button-secondary-border-left-style.--wst-button-secondary-border-top-left-radius.--wst-button-secondary-border-top-right-radius.--wst-button-secondary-border-bottom-right-radius.--wst-button-secondary-border-bottom-left-radius.--wst-button-secondary-box-shadow.--wst-button-secondary-column-gap.--wst-button-secondary-row-gap.--wst-button-secondary-letter-spacing.--wst-button-secondary-text-decoration.--wst-button-secondary-text-transform.--wst-button-secondary-text-shadow`.split(`.`), `--wst-graphics-1-color`, `--wst-system-line-1-color`, `--wst-system-line-1-width`, `--wst-system-disabled-color`, `--wst-primary-background-color`, `--wst-secondary-background-color`, `--wst-shade-2-color`, `--wst-shade-3-color`, `--wst-paragraph-1-color`, `--wst-paragraph-1-font`, `--wst-paragraph-2-color`, `--wst-paragraph-2-font`, `--wst-paragraph-3-color`, `--wst-paragraph-3-font`, `--wst-heading-5-color`, `--wst-heading-5-font`, `--wst-heading-6-color`, `--wst-heading-6-font`, `--wst-button-primary-color`, `--wst-button-primary-font`, `--wst-button-secondary-color`, `--wst-button-secondary-font`, `--wst-button-tertiary-color`, `--wst-button-tertiary-font`, `--wst-links-and-actions-color`, `--wst-system-alert-color`, `--wst-system-error-color`, `--wst-system-success-color`, `--wst-system-default-light-color`, `--wst-system-default-dark-color`];
|
|
3291
|
+
var ro = [...`--wst-button-primary-background-color.--wst-button-primary-background-image.--wst-button-primary-padding-top.--wst-button-primary-border-top-color.--wst-button-primary-border-top-width.--wst-button-primary-border-top-style.--wst-button-primary-padding-right.--wst-button-primary-border-right-color.--wst-button-primary-border-right-width.--wst-button-primary-border-right-style.--wst-button-primary-padding-bottom.--wst-button-primary-border-bottom-color.--wst-button-primary-border-bottom-width.--wst-button-primary-border-bottom-style.--wst-button-primary-padding-left.--wst-button-primary-border-left-color.--wst-button-primary-border-left-width.--wst-button-primary-border-left-style.--wst-button-primary-border-top-left-radius.--wst-button-primary-border-top-right-radius.--wst-button-primary-border-bottom-right-radius.--wst-button-primary-border-bottom-left-radius.--wst-button-primary-box-shadow.--wst-button-primary-column-gap.--wst-button-primary-row-gap.--wst-button-primary-letter-spacing.--wst-button-primary-text-decoration.--wst-button-primary-text-transform.--wst-button-primary-text-shadow.--wst-button-secondary-background-color.--wst-button-secondary-background-image.--wst-button-secondary-padding-top.--wst-button-secondary-border-top-color.--wst-button-secondary-border-top-width.--wst-button-secondary-border-top-style.--wst-button-secondary-padding-right.--wst-button-secondary-border-right-color.--wst-button-secondary-border-right-width.--wst-button-secondary-border-right-style.--wst-button-secondary-padding-bottom.--wst-button-secondary-border-bottom-color.--wst-button-secondary-border-bottom-width.--wst-button-secondary-border-bottom-style.--wst-button-secondary-padding-left.--wst-button-secondary-border-left-color.--wst-button-secondary-border-left-width.--wst-button-secondary-border-left-style.--wst-button-secondary-border-top-left-radius.--wst-button-secondary-border-top-right-radius.--wst-button-secondary-border-bottom-right-radius.--wst-button-secondary-border-bottom-left-radius.--wst-button-secondary-box-shadow.--wst-button-secondary-column-gap.--wst-button-secondary-row-gap.--wst-button-secondary-letter-spacing.--wst-button-secondary-text-decoration.--wst-button-secondary-text-transform.--wst-button-secondary-text-shadow`.split(`.`), `--wst-graphics-1-color`, `--wst-system-line-1-color`, `--wst-system-line-1-width`, `--wst-system-disabled-color`, `--wst-primary-background-color`, `--wst-secondary-background-color`, `--wst-shade-2-color`, `--wst-shade-3-color`, `--wst-paragraph-1-color`, `--wst-paragraph-1-font`, `--wst-paragraph-2-color`, `--wst-paragraph-2-font`, `--wst-paragraph-2-letter-spacing`, `--wst-paragraph-2-text-decoration`, `--wst-paragraph-3-color`, `--wst-paragraph-3-font`, `--wst-paragraph-3-letter-spacing`, `--wst-paragraph-3-text-decoration`, `--wst-heading-2-font`, `--wst-heading-2-letter-spacing`, `--wst-heading-2-text-decoration`, `--wst-heading-5-color`, `--wst-heading-5-font`, `--wst-heading-6-color`, `--wst-heading-6-font`, `--wst-button-primary-color`, `--wst-button-primary-font`, `--wst-button-secondary-color`, `--wst-button-secondary-font`, `--wst-button-tertiary-color`, `--wst-button-tertiary-font`, `--wst-button-tertiary-letter-spacing`, `--wst-button-tertiary-text-decoration`, `--wst-links-and-actions-color`, `--wst-system-alert-color`, `--wst-system-error-color`, `--wst-system-success-color`, `--wst-system-default-light-color`, `--wst-system-default-dark-color`];
|
|
3292
3292
|
var io = `--builder-base`;
|
|
3293
3293
|
var ao = (e11) => {
|
|
3294
3294
|
let [, t2] = l(false);
|
|
@@ -9141,13 +9141,17 @@ var Bb = (e11) => {
|
|
|
9141
9141
|
};
|
|
9142
9142
|
var Vb = (e11) => ({ name: e11.label, value: e11.value });
|
|
9143
9143
|
var Hb = (e11, t2) => t2.validity[e11.id] ?? null;
|
|
9144
|
-
var Ub = { firstName: `customfields.system.firstname`, lastName: `customfields.system.lastname`, phone: `customfields.system.phone`, title: `customfields.system.title`, birthdate: `customfields.contact.birthdate`, company: `customfields.contact.company`,
|
|
9145
|
-
var Wb =
|
|
9146
|
-
var Gb = Object.
|
|
9147
|
-
var Kb =
|
|
9148
|
-
var qb =
|
|
9149
|
-
|
|
9150
|
-
|
|
9144
|
+
var Ub = { firstName: `customfields.system.firstname`, lastName: `customfields.system.lastname`, phone: `customfields.system.phone`, title: `customfields.system.title`, birthdate: `customfields.contact.birthdate`, company: `customfields.contact.company`, position: `customfields.contact.position` };
|
|
9145
|
+
var Wb = { jobTitle: `position` };
|
|
9146
|
+
var Gb = new Set(Object.values(Ub));
|
|
9147
|
+
var Kb = Object.keys(Ub);
|
|
9148
|
+
var qb = (e11) => {
|
|
9149
|
+
let t2 = Object.fromEntries(Kb.map((t3) => [t3, e11(t3)]));
|
|
9150
|
+
return { ...t2, ...Object.fromEntries(Object.entries(Wb).map(([e12, n2]) => [e12, t2[n2]])) };
|
|
9151
|
+
};
|
|
9152
|
+
var Jb = { ...qb(() => ({ name: void 0, value: `` })), validationErrors: qb(() => null) };
|
|
9153
|
+
var Yb = { name: null, value: `` };
|
|
9154
|
+
var Xb = (e11) => {
|
|
9151
9155
|
let t2 = /* @__PURE__ */ new Map();
|
|
9152
9156
|
return e11.forEach((e12) => {
|
|
9153
9157
|
e12.fields.forEach((e13) => {
|
|
@@ -9155,130 +9159,131 @@ var Yb = (e11) => {
|
|
|
9155
9159
|
});
|
|
9156
9160
|
}), t2;
|
|
9157
9161
|
};
|
|
9158
|
-
var
|
|
9159
|
-
let n2 =
|
|
9160
|
-
return { ...
|
|
9162
|
+
var Zb = (e11, t2) => {
|
|
9163
|
+
let n2 = Xb(e11), r2 = (e12) => n2.get(Ub[e12]);
|
|
9164
|
+
return { ...qb((e12) => {
|
|
9161
9165
|
let t3 = r2(e12);
|
|
9162
|
-
return t3 ? Vb(t3) :
|
|
9163
|
-
}), validationErrors:
|
|
9166
|
+
return t3 ? Vb(t3) : Yb;
|
|
9167
|
+
}), validationErrors: qb((e12) => {
|
|
9164
9168
|
let n3 = r2(e12);
|
|
9165
9169
|
return n3 ? Hb(n3, t2) : null;
|
|
9166
9170
|
}) };
|
|
9167
9171
|
};
|
|
9168
|
-
var
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
var $b =
|
|
9175
|
-
var ex =
|
|
9176
|
-
|
|
9172
|
+
var Qb = (e11, t2) => {
|
|
9173
|
+
let n2 = Object.hasOwn(Wb, t2) ? Wb[t2] : t2;
|
|
9174
|
+
if (!Object.hasOwn(Ub, n2)) return null;
|
|
9175
|
+
let r2 = Xb(e11).get(Ub[n2]);
|
|
9176
|
+
return r2 && !r2.isReadOnly ? r2.id : null;
|
|
9177
|
+
};
|
|
9178
|
+
var $b = t_;
|
|
9179
|
+
var ex = /^\d{4}-\d{2}-\d{2}$/;
|
|
9180
|
+
var tx = (e11) => {
|
|
9181
|
+
if (!ex.test(e11)) return false;
|
|
9177
9182
|
let [t2, n2, r2] = e11.split(`-`).map(Number), i2 = new Date(Date.UTC(t2, n2 - 1, r2));
|
|
9178
9183
|
return i2.getUTCFullYear() === t2 && i2.getUTCMonth() === n2 - 1 && i2.getUTCDate() === r2;
|
|
9179
9184
|
};
|
|
9180
|
-
var
|
|
9185
|
+
var nx = (e11) => {
|
|
9181
9186
|
try {
|
|
9182
9187
|
return new URL(e11.includes(`://`) ? e11 : `https://${e11}`).hostname.includes(`.`);
|
|
9183
9188
|
} catch {
|
|
9184
9189
|
return false;
|
|
9185
9190
|
}
|
|
9186
9191
|
};
|
|
9187
|
-
var
|
|
9192
|
+
var rx = (e11) => {
|
|
9188
9193
|
let t2 = e11.value.trim();
|
|
9189
|
-
if (!t2) return e11.isRequired ?
|
|
9190
|
-
if (e11.key === Ub.phone) return Bb(t2) ? null :
|
|
9194
|
+
if (!t2) return e11.isRequired ? $b.REQUIRED : null;
|
|
9195
|
+
if (e11.key === Ub.phone) return Bb(t2) ? null : $b.PHONE;
|
|
9191
9196
|
switch (e11.kind) {
|
|
9192
9197
|
case r_.NUMBER:
|
|
9193
|
-
return Number.isFinite(Number(t2)) ? null :
|
|
9198
|
+
return Number.isFinite(Number(t2)) ? null : $b.NUMBER;
|
|
9194
9199
|
case r_.DATE:
|
|
9195
|
-
return
|
|
9200
|
+
return tx(t2) ? null : $b.DATE;
|
|
9196
9201
|
case r_.URL:
|
|
9197
9202
|
case r_.SOCIAL:
|
|
9198
|
-
return
|
|
9203
|
+
return nx(t2) ? null : $b.URL;
|
|
9199
9204
|
case r_.CHOICE:
|
|
9200
|
-
return !e11.options?.length || e11.options.some((e12) => e12.value === t2) ? null :
|
|
9205
|
+
return !e11.options?.length || e11.options.some((e12) => e12.value === t2) ? null : $b.CHOICE;
|
|
9201
9206
|
default:
|
|
9202
9207
|
return null;
|
|
9203
9208
|
}
|
|
9204
9209
|
};
|
|
9205
|
-
var
|
|
9210
|
+
var ix = (e11) => {
|
|
9206
9211
|
let t2 = {};
|
|
9207
9212
|
return e11.forEach((e12) => {
|
|
9208
9213
|
e12.fields.forEach((e13) => {
|
|
9209
9214
|
if (e13.isReadOnly) return;
|
|
9210
|
-
let n2 =
|
|
9215
|
+
let n2 = rx(e13);
|
|
9211
9216
|
n2 && (t2[e13.id] = n2);
|
|
9212
9217
|
});
|
|
9213
9218
|
}), t2;
|
|
9214
9219
|
};
|
|
9215
|
-
var
|
|
9216
|
-
var
|
|
9217
|
-
function
|
|
9220
|
+
var ax = (e11) => e11.flatMap((e12) => e12.fields.filter((e13) => !e13.isReadOnly && rx(e13) !== null).map((e13) => e13.id));
|
|
9221
|
+
var ox = { LOGIN_EMAIL: `LOGIN_EMAIL`, PASSWORD: `PASSWORD` };
|
|
9222
|
+
function sx(e11) {
|
|
9218
9223
|
return e11;
|
|
9219
9224
|
}
|
|
9220
|
-
var
|
|
9221
|
-
function
|
|
9222
|
-
let { reportBi: e11 } = u(
|
|
9225
|
+
var cx = sx(`@wix/site-service-business-logger`);
|
|
9226
|
+
function lx() {
|
|
9227
|
+
let { reportBi: e11 } = u(cx);
|
|
9223
9228
|
return i(({ src: t2, evid: n2, endpoint: r2, params: i2 }) => e11({ src: t2, evid: n2, ...i2 }, { endpoint: r2 }), [e11]);
|
|
9224
9229
|
}
|
|
9225
|
-
function
|
|
9230
|
+
function ux(e11) {
|
|
9226
9231
|
return { evid: 815, src: 69, endpoint: `members-app-uou`, params: e11 };
|
|
9227
9232
|
}
|
|
9228
|
-
function
|
|
9233
|
+
function dx(e11) {
|
|
9229
9234
|
return { evid: 5001, src: 5, endpoint: ``, params: e11 };
|
|
9230
9235
|
}
|
|
9231
|
-
function
|
|
9236
|
+
function fx(e11) {
|
|
9232
9237
|
return { evid: 5002, src: 5, endpoint: ``, params: e11 };
|
|
9233
9238
|
}
|
|
9234
|
-
function
|
|
9239
|
+
function px(e11) {
|
|
9235
9240
|
return { evid: 5003, src: 5, endpoint: ``, params: e11 };
|
|
9236
9241
|
}
|
|
9237
|
-
function
|
|
9242
|
+
function mx(e11) {
|
|
9238
9243
|
return { evid: 5005, src: 5, endpoint: ``, params: e11 };
|
|
9239
9244
|
}
|
|
9240
|
-
function
|
|
9245
|
+
function hx(e11) {
|
|
9241
9246
|
return { evid: 5006, src: 5, endpoint: ``, params: e11 };
|
|
9242
9247
|
}
|
|
9243
|
-
function
|
|
9248
|
+
function gx(e11) {
|
|
9244
9249
|
return { evid: 5007, src: 5, endpoint: ``, params: e11 };
|
|
9245
9250
|
}
|
|
9246
|
-
function
|
|
9251
|
+
function _x(e11) {
|
|
9247
9252
|
return { evid: 5008, src: 5, endpoint: ``, params: e11 };
|
|
9248
9253
|
}
|
|
9249
|
-
var
|
|
9250
|
-
var
|
|
9251
|
-
var
|
|
9252
|
-
var
|
|
9253
|
-
var
|
|
9254
|
-
var
|
|
9255
|
-
var Cx = () => ux({});
|
|
9254
|
+
var vx = { EXIT: `exit`, CANCEL: `cancel`, RESET_OR_CREATE_PASSWORD: `reset_or_create_password` };
|
|
9255
|
+
var yx = `my_account`;
|
|
9256
|
+
var bx = ({ role: e11, isProfilePublic: t2 }) => ({ ...e11 ? { role: e11 } : {}, is_social: t2 });
|
|
9257
|
+
var xx = (e11, t2) => e11 ? `${e11}, ${t2}` : t2;
|
|
9258
|
+
var Sx = (e11) => e11.reduce((e12, t2) => t2.key === Ub.title ? { ...e12, titleChanged: true } : t2.origin === `SYSTEM` ? { ...e12, systemFieldsChanged: xx(e12.systemFieldsChanged, t2.label) } : t2.origin === `CONTACT` ? { ...e12, contactsFieldsChanges: xx(e12.contactsFieldsChanges, t2.label) } : e12, {});
|
|
9259
|
+
var Cx = (e11, t2) => ux({ ...bx(e11), saveOrigin: yx, componentType: `builder`, privacyChanged: false, urlChanged: false, ...Sx(t2) });
|
|
9256
9260
|
var wx = () => dx({});
|
|
9257
9261
|
var Tx = () => fx({});
|
|
9258
|
-
var Ex = () =>
|
|
9259
|
-
var Dx = (
|
|
9260
|
-
var Ox = (e11
|
|
9261
|
-
var kx = (e11, t2) =>
|
|
9262
|
-
var Ax =
|
|
9263
|
-
var jx =
|
|
9264
|
-
var Mx =
|
|
9265
|
-
var Nx = {
|
|
9266
|
-
var Px = (
|
|
9267
|
-
var Fx =
|
|
9262
|
+
var Ex = () => px({});
|
|
9263
|
+
var Dx = () => hx({});
|
|
9264
|
+
var Ox = (e11) => gx({ button_click: e11 });
|
|
9265
|
+
var kx = (e11, t2) => mx({ is_success: e11, failure_reason: t2 });
|
|
9266
|
+
var Ax = (e11, t2) => _x({ is_success: e11, failure_reason: t2 });
|
|
9267
|
+
var jx = { NONE: `NONE`, SITE_OWNER: `SITE_OWNER`, SITE_COLLABORATOR: `SITE_COLLABORATOR` };
|
|
9268
|
+
var Mx = (e11) => e11?.owner === true || e11?.role === `OWNER` ? jx.SITE_OWNER : e11?.role === `CONTRIBUTOR` ? jx.SITE_COLLABORATOR : jx.NONE;
|
|
9269
|
+
var Nx = { memberId: ``, rawMember: {}, loginEmail: ``, credentialRestriction: jx.NONE, definitions: [], fieldSections: [], fieldOrigins: {}, biMember: { role: ``, isProfilePublic: false } };
|
|
9270
|
+
var Px = { [ox.LOGIN_EMAIL]: () => [wx(), Ex()], [ox.PASSWORD]: () => [Tx(), Dx()] };
|
|
9271
|
+
var Fx = (e11, t2) => ({ ...e11, rawMember: t2, loginEmail: t2.loginEmail || e11.loginEmail, fieldSections: m_({ member: t2, definitions: e11.definitions }), biMember: { ...e11.biMember, isProfilePublic: t2.privacyStatus === `PUBLIC` } });
|
|
9272
|
+
var Ix = async (e11, t2) => {
|
|
9268
9273
|
try {
|
|
9269
9274
|
let n2 = await t2.getMemberDetails?.(), r2 = (await e11.getCurrentMember().catch((e12) => {
|
|
9270
9275
|
if (Jg(e12)) return null;
|
|
9271
9276
|
throw e12;
|
|
9272
9277
|
}))?.member, i2 = r2?._id;
|
|
9273
|
-
if (!r2 || !i2) return { ok: true, data:
|
|
9274
|
-
let [{ fields: a2 }, { results: o2 }] = await Promise.all([e11.listCustomFields(), e11.getMemberCustomFieldApplications(i2)]), s2 = new Set((o2?.[0]?.applications ?? []).filter((e12) => e12.applies).map((e12) => e12.customFieldKey)), c2 = (a2 ?? []).filter((e12) => s2.has(e12.key) && e12.fieldOrigin !== `CUSTOM` &&
|
|
9275
|
-
return { ok: true, data: { memberId: i2, rawMember: r2, loginEmail: r2.loginEmail ?? ``, credentialRestriction:
|
|
9278
|
+
if (!r2 || !i2) return { ok: true, data: Nx };
|
|
9279
|
+
let [{ fields: a2 }, { results: o2 }] = await Promise.all([e11.listCustomFields(), e11.getMemberCustomFieldApplications(i2)]), s2 = new Set((o2?.[0]?.applications ?? []).filter((e12) => e12.applies).map((e12) => e12.customFieldKey)), c2 = (a2 ?? []).filter((e12) => s2.has(e12.key) && e12.fieldOrigin !== `CUSTOM` && Gb.has(e12.key ?? ``)), l2 = c2.map((e12) => ({ id: e12._id ?? e12.key ?? ``, key: e12.key ?? ``, name: e12.name ?? ``, fieldType: String(e12.fieldType ?? ``), socialType: e12.socialType, section: String(e12.section ?? ``) }));
|
|
9280
|
+
return { ok: true, data: { memberId: i2, rawMember: r2, loginEmail: r2.loginEmail ?? ``, credentialRestriction: Mx(n2), definitions: l2, fieldSections: m_({ member: r2, definitions: l2 }), fieldOrigins: Object.fromEntries(c2.map((e12) => [e12._id ?? e12.key ?? ``, String(e12.fieldOrigin ?? ``)])), biMember: { role: n2?.role ?? ``, isProfilePublic: r2.privacyStatus === `PUBLIC` } } };
|
|
9276
9281
|
} catch (e12) {
|
|
9277
9282
|
return { ok: false, error: kh(e12).message, cause: e12 };
|
|
9278
9283
|
}
|
|
9279
9284
|
};
|
|
9280
|
-
var
|
|
9281
|
-
let t2 = u(Ba), n2 =
|
|
9285
|
+
var Lx = ({ children: e11 }) => {
|
|
9286
|
+
let t2 = u(Ba), n2 = lx(), r2 = s(() => $g(t2), [t2]), a2 = dl(), d2 = no(Ah.toasts), f2 = i(() => Ix(r2, t2), [r2, t2]), [p2, h2] = l(null), g2 = c(null), [_2, v2] = l(false), [y2, b2] = l(false), [x2, S2] = l({}), [C2, ee2] = l(0), [w2, T2] = l(i_), [te2, ne2] = l(null), [re2, ie2] = l(null), ae2 = c(f2), oe2 = c(t2), [E2, se2] = l(0), D2 = c(0), ce2 = c(null), le2 = c(0), O2 = c(null), [k2, ue2] = l(false), de2 = c(null), A2 = c(null), j2 = i(() => {
|
|
9282
9287
|
le2.current += 1;
|
|
9283
9288
|
let e12 = le2.current, t3 = D2.current;
|
|
9284
9289
|
return b2(true), () => le2.current === e12 && D2.current === t3;
|
|
@@ -9325,9 +9330,9 @@ var Ix = ({ children: e11 }) => {
|
|
|
9325
9330
|
}, [E2, j2, M2]);
|
|
9326
9331
|
let fe2 = i((e12, t3) => {
|
|
9327
9332
|
S2((n3) => ({ ...n3, [e12]: t3 }));
|
|
9328
|
-
}, []), P2 = p2 ??
|
|
9329
|
-
F2 && te2 !== e12 && (ne2(e12),
|
|
9330
|
-
}, [F2, te2, n2]), me2 = i(() => pe2(
|
|
9333
|
+
}, []), P2 = p2 ?? Nx, F2 = !!P2.memberId && P2.credentialRestriction === jx.NONE, pe2 = i((e12) => {
|
|
9334
|
+
F2 && te2 !== e12 && (ne2(e12), Px[e12]().forEach(n2));
|
|
9335
|
+
}, [F2, te2, n2]), me2 = i(() => pe2(ox.LOGIN_EMAIL), [pe2]), he2 = i(() => pe2(ox.PASSWORD), [pe2]), ge2 = i(() => ne2(null), []), I2 = s(() => h_(P2.fieldSections, x2), [P2.fieldSections, x2]), _e2 = s(() => ({ validity: ix(I2) }), [I2]), ve2 = s(() => p2 === null ? Jb : Zb(I2, _e2), [p2, I2, _e2]), ye2 = __(I2).length > 0 || k2;
|
|
9331
9336
|
o(() => {
|
|
9332
9337
|
if (!ye2) return;
|
|
9333
9338
|
let e12 = (e13) => {
|
|
@@ -9340,14 +9345,14 @@ var Ix = ({ children: e11 }) => {
|
|
|
9340
9345
|
let be2 = i(async () => {
|
|
9341
9346
|
let e12 = D2.current;
|
|
9342
9347
|
if (!P2.memberId) return false;
|
|
9343
|
-
if (
|
|
9348
|
+
if (ax(I2).length) return ee2((e13) => e13 + 1), false;
|
|
9344
9349
|
let t3 = __(I2);
|
|
9345
9350
|
if (O2.current === e12) return !t3.length && de2.current ? de2.current : new Promise((t4) => {
|
|
9346
9351
|
let n3 = A2.current ?? { session: e12, drafts: x2, resolvers: [] };
|
|
9347
9352
|
n3.drafts = x2, n3.resolvers.push(t4), A2.current = n3;
|
|
9348
9353
|
});
|
|
9349
9354
|
if (!t3.length) return a2.success(d2.personalInfoSaved), true;
|
|
9350
|
-
n2(
|
|
9355
|
+
n2(Cx(P2.biMember, t3.map((e13) => ({ key: e13.key, label: e13.label, origin: P2.fieldOrigins[e13.id] ?? `` }))));
|
|
9351
9356
|
let i2 = N2(), o2 = () => {
|
|
9352
9357
|
O2.current === e12 && (O2.current = null, ue2(false));
|
|
9353
9358
|
}, s2 = g2.current ?? P2, c2 = x2, { member: l2, cleared: u2 } = v_(P2.rawMember, I2);
|
|
@@ -9361,7 +9366,7 @@ var Ix = ({ children: e11 }) => {
|
|
|
9361
9366
|
}
|
|
9362
9367
|
if (!i2()) return false;
|
|
9363
9368
|
let t4 = false, n3 = g2.current ?? P2;
|
|
9364
|
-
return M2({ ok: true, data:
|
|
9369
|
+
return M2({ ok: true, data: Fx(n3, { ...e13, loginEmail: n3.loginEmail }) }, { isCurrent: j2(), always: o2, onCommitted: () => {
|
|
9365
9370
|
t4 = true, a2.success(d2.personalInfoSaved);
|
|
9366
9371
|
} }), t4;
|
|
9367
9372
|
} catch (e13) {
|
|
@@ -9392,15 +9397,15 @@ var Ix = ({ children: e11 }) => {
|
|
|
9392
9397
|
if (await r2.verifyPassword(P2.loginEmail, t3), !i2()) return false;
|
|
9393
9398
|
let { member: o2 } = await r2.changeLoginEmail(P2.memberId, e12);
|
|
9394
9399
|
if (!i2()) return false;
|
|
9395
|
-
n2(
|
|
9400
|
+
n2(kx(true));
|
|
9396
9401
|
let s2 = g2.current ?? P2, c2 = false;
|
|
9397
|
-
return M2({ ok: true, data: { ...
|
|
9402
|
+
return M2({ ok: true, data: { ...Fx(s2, { ...s2.rawMember, loginEmail: o2?.loginEmail || e12 }), fieldSections: s2.fieldSections } }, { isCurrent: j2(), always: () => T2((e13) => ({ ...e13, isSaving: false })), onCommitted: () => {
|
|
9398
9403
|
T2(i_), c2 = true, a2.success(d2.loginEmailChanged);
|
|
9399
9404
|
} }), c2;
|
|
9400
9405
|
} catch (e13) {
|
|
9401
9406
|
if (!i2()) return false;
|
|
9402
9407
|
let t4 = qg(e13);
|
|
9403
|
-
return n2(
|
|
9408
|
+
return n2(kx(false, t4)), T2({ isSaving: false, error: t4 }), t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
|
|
9404
9409
|
}
|
|
9405
9410
|
}, [F2, P2, N2, j2, n2, r2, M2, d2.loginEmailChanged, a2]), Se2 = i(async (e12, t3) => {
|
|
9406
9411
|
if (!F2) return false;
|
|
@@ -9413,15 +9418,15 @@ var Ix = ({ children: e11 }) => {
|
|
|
9413
9418
|
} finally {
|
|
9414
9419
|
ce2.current = null;
|
|
9415
9420
|
}
|
|
9416
|
-
return !i2() || (await r2.changePassword(t3), !i2()) ? false : (n2(
|
|
9421
|
+
return !i2() || (await r2.changePassword(t3), !i2()) ? false : (n2(Ax(true)), T2(i_), a2.success(d2.passwordChanged), true);
|
|
9417
9422
|
} catch (e13) {
|
|
9418
9423
|
if (!i2()) return false;
|
|
9419
9424
|
let t4 = qg(e13);
|
|
9420
|
-
return n2(
|
|
9425
|
+
return n2(Ax(false, t4)), T2({ isSaving: false, error: t4 }), e13 instanceof Qg ? a2.error(d2.passwordSignInUnconfirmed) : t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
|
|
9421
9426
|
}
|
|
9422
9427
|
}, [F2, P2, N2, n2, r2, d2.passwordChanged, d2.passwordSignInUnconfirmed, a2]), Ce2 = i(async () => {
|
|
9423
9428
|
if (!F2) return false;
|
|
9424
|
-
n2(
|
|
9429
|
+
n2(Ox(vx.RESET_OR_CREATE_PASSWORD));
|
|
9425
9430
|
let e12 = N2();
|
|
9426
9431
|
T2({ isSaving: true, error: null });
|
|
9427
9432
|
try {
|
|
@@ -9434,29 +9439,29 @@ var Ix = ({ children: e11 }) => {
|
|
|
9434
9439
|
}, [F2, P2, N2, n2, r2, d2.setPasswordEmailSent, a2]), we2 = s(() => {
|
|
9435
9440
|
let e12 = !!P2.memberId, t3 = (t4) => p2 === null ? void 0 : e12 ? t4 : null;
|
|
9436
9441
|
return { isLoading: !_2 || y2, ...ve2, focusRequest: C2, updateNamedField: (e13, t4) => {
|
|
9437
|
-
let n3 =
|
|
9442
|
+
let n3 = Qb(I2, e13);
|
|
9438
9443
|
n3 && fe2(n3, String(t4.target.value ?? ``));
|
|
9439
9444
|
}, loginEmail: t3(P2.loginEmail || null), credentialRestriction: t3(P2.credentialRestriction), credentialSaving: w2.isSaving, credentialError: w2.error, credentialDialog: te2, openChangeLoginEmailDialog: me2, openChangePasswordDialog: he2, closeCredentialDialog: ge2, savePersonalInfo: be2, changeLoginEmail: xe2, changePassword: Se2, sendSetPasswordEmail: Ce2 };
|
|
9440
9445
|
}, [p2, _2, P2, I2, ve2, C2, fe2, y2, w2, te2, me2, he2, ge2, be2, xe2, Se2, Ce2]);
|
|
9441
9446
|
if (re2) throw re2.cause;
|
|
9442
9447
|
return m(a_.Provider, { value: we2, children: [e11, a2.themeAnchor] });
|
|
9443
9448
|
};
|
|
9444
|
-
|
|
9445
|
-
var
|
|
9449
|
+
Lx.displayName = `AccountSettingsProviderBody`;
|
|
9450
|
+
var Rx = ({ children: e11 }) => {
|
|
9446
9451
|
let t2 = Qa($a);
|
|
9447
|
-
return p(Ra, { i18n: t2, children: p(
|
|
9452
|
+
return p(Ra, { i18n: t2, children: p(Lx, { children: e11 }) });
|
|
9448
9453
|
};
|
|
9449
|
-
var
|
|
9454
|
+
var zx = On(`f8f3ae80-3fdf-4c8f-a197-d3bb73f04444`);
|
|
9450
9455
|
export {
|
|
9451
|
-
|
|
9456
|
+
Rx as AccountDetailsContextProvider,
|
|
9452
9457
|
a_ as AccountSettingsContext,
|
|
9453
|
-
|
|
9458
|
+
ox as CREDENTIAL_DIALOG,
|
|
9454
9459
|
Q as CREDENTIAL_ERROR,
|
|
9455
9460
|
r_ as FIELD_KIND,
|
|
9456
9461
|
Ub as NAMED_FIELD_KEYS,
|
|
9457
9462
|
n_ as SECTION_KIND,
|
|
9458
|
-
|
|
9459
|
-
|
|
9463
|
+
Rx as default,
|
|
9464
|
+
zx as injectAccessTokenGetter,
|
|
9460
9465
|
o_ as useAccountSettings
|
|
9461
9466
|
};
|
|
9462
9467
|
//# sourceMappingURL=context-account-details.mjs.map
|