@trii/components 2.0.16 → 2.0.17
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/cjs/index.js +50 -674
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +3 -4
- package/dist/cjs/types/components/ContactInfoPopup/components/Header/Header.d.ts +4 -8
- package/dist/cjs/types/components/ContactInfoPopup/components/index.d.ts +0 -3
- package/dist/esm/index.js +52 -676
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +3 -4
- package/dist/esm/types/components/ContactInfoPopup/components/Header/Header.d.ts +4 -8
- package/dist/esm/types/components/ContactInfoPopup/components/index.d.ts +0 -3
- package/dist/index.d.ts +3 -4
- package/package.json +99 -99
- package/readme +71 -71
- package/dist/cjs/types/components/ContactInfoPopup/components/BusinessSection/BusinessSection.d.ts +0 -7
- package/dist/cjs/types/components/ContactInfoPopup/components/BusinessSection/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/LabelsSection/LabelsSection.d.ts +0 -7
- package/dist/cjs/types/components/ContactInfoPopup/components/LabelsSection/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/MemberItem/MemberItem.d.ts +0 -5
- package/dist/cjs/types/components/ContactInfoPopup/components/MemberItem/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/MembersSection.d.ts +0 -7
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/MemberItem.d.ts +0 -4
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/index.d.ts +0 -1
- package/dist/cjs/types/components/ContactInfoPopup/hooks/useContactInfoPopupTranslation.d.ts +0 -24
- package/dist/cjs/types/components/ContactInfoPopup/types/is-business.typeguard.d.ts +0 -7
- package/dist/cjs/types/components/ContactInfoPopup/types/is-contact.typeguard.d.ts +0 -7
- package/dist/cjs/types/components/LanguageSelector.d.ts +0 -2
- package/dist/cjs/types/contexts/LanguageContext.d.ts +0 -10
- package/dist/cjs/types/i18n.d.ts +0 -2
- package/dist/cjs/types/translations/en.d.ts +0 -31
- package/dist/cjs/types/translations/es.d.ts +0 -31
- package/dist/cjs/types/translations/index.d.ts +0 -2
- package/dist/cjs/types/types/translations.d.ts +0 -25
- package/dist/cjs/types/utils/translation.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/components/BusinessSection/BusinessSection.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/components/BusinessSection/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/LabelsSection/LabelsSection.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/components/LabelsSection/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/MemberItem/MemberItem.d.ts +0 -5
- package/dist/esm/types/components/ContactInfoPopup/components/MemberItem/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/MembersSection.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/MemberItem.d.ts +0 -4
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/index.d.ts +0 -1
- package/dist/esm/types/components/ContactInfoPopup/hooks/useContactInfoPopupTranslation.d.ts +0 -24
- package/dist/esm/types/components/ContactInfoPopup/types/is-business.typeguard.d.ts +0 -7
- package/dist/esm/types/components/ContactInfoPopup/types/is-contact.typeguard.d.ts +0 -7
- package/dist/esm/types/components/LanguageSelector.d.ts +0 -2
- package/dist/esm/types/contexts/LanguageContext.d.ts +0 -10
- package/dist/esm/types/i18n.d.ts +0 -2
- package/dist/esm/types/translations/en.d.ts +0 -31
- package/dist/esm/types/translations/es.d.ts +0 -31
- package/dist/esm/types/translations/index.d.ts +0 -2
- package/dist/esm/types/types/translations.d.ts +0 -25
- package/dist/esm/types/utils/translation.d.ts +0 -7
package/dist/cjs/index.js
CHANGED
|
@@ -3042,422 +3042,6 @@ var capitalize = /*#__PURE__*/Object.freeze({
|
|
|
3042
3042
|
default: capitalize$1
|
|
3043
3043
|
});
|
|
3044
3044
|
|
|
3045
|
-
/**
|
|
3046
|
-
* Safe chained function.
|
|
3047
|
-
*
|
|
3048
|
-
* Will only create a new function if needed,
|
|
3049
|
-
* otherwise will pass back existing functions or null.
|
|
3050
|
-
*/
|
|
3051
|
-
function createChainedFunction(...funcs) {
|
|
3052
|
-
return funcs.reduce((acc, func) => {
|
|
3053
|
-
if (func == null) {
|
|
3054
|
-
return acc;
|
|
3055
|
-
}
|
|
3056
|
-
return function chainedFunction(...args) {
|
|
3057
|
-
acc.apply(this, args);
|
|
3058
|
-
func.apply(this, args);
|
|
3059
|
-
};
|
|
3060
|
-
}, () => {});
|
|
3061
|
-
}
|
|
3062
|
-
|
|
3063
|
-
// Corresponds to 10 frames at 60 Hz.
|
|
3064
|
-
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
|
|
3065
|
-
function debounce(func, wait = 166) {
|
|
3066
|
-
let timeout;
|
|
3067
|
-
function debounced(...args) {
|
|
3068
|
-
const later = () => {
|
|
3069
|
-
// @ts-ignore
|
|
3070
|
-
func.apply(this, args);
|
|
3071
|
-
};
|
|
3072
|
-
clearTimeout(timeout);
|
|
3073
|
-
timeout = setTimeout(later, wait);
|
|
3074
|
-
}
|
|
3075
|
-
debounced.clear = () => {
|
|
3076
|
-
clearTimeout(timeout);
|
|
3077
|
-
};
|
|
3078
|
-
return debounced;
|
|
3079
|
-
}
|
|
3080
|
-
|
|
3081
|
-
function deprecatedPropType(validator, reason) {
|
|
3082
|
-
if (process.env.NODE_ENV === 'production') {
|
|
3083
|
-
return () => null;
|
|
3084
|
-
}
|
|
3085
|
-
return (props, propName, componentName, location, propFullName) => {
|
|
3086
|
-
const componentNameSafe = componentName || '<<anonymous>>';
|
|
3087
|
-
const propFullNameSafe = propFullName || propName;
|
|
3088
|
-
if (typeof props[propName] !== 'undefined') {
|
|
3089
|
-
return new Error(`The ${location} \`${propFullNameSafe}\` of ` + `\`${componentNameSafe}\` is deprecated. ${reason}`);
|
|
3090
|
-
}
|
|
3091
|
-
return null;
|
|
3092
|
-
};
|
|
3093
|
-
}
|
|
3094
|
-
|
|
3095
|
-
function isMuiElement(element, muiNames) {
|
|
3096
|
-
var _muiName, _element$type;
|
|
3097
|
-
return /*#__PURE__*/React__namespace.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
|
|
3098
|
-
// relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
|
|
3099
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
3100
|
-
(_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;
|
|
3101
|
-
}
|
|
3102
|
-
|
|
3103
|
-
function ownerDocument(node) {
|
|
3104
|
-
return node && node.ownerDocument || document;
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
|
-
function ownerWindow(node) {
|
|
3108
|
-
const doc = ownerDocument(node);
|
|
3109
|
-
return doc.defaultView || window;
|
|
3110
|
-
}
|
|
3111
|
-
|
|
3112
|
-
function requirePropFactory(componentNameInError, Component) {
|
|
3113
|
-
if (process.env.NODE_ENV === 'production') {
|
|
3114
|
-
return () => null;
|
|
3115
|
-
}
|
|
3116
|
-
|
|
3117
|
-
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
3118
|
-
const prevPropTypes = Component ? _extends$1({}, Component.propTypes) : null;
|
|
3119
|
-
const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
|
|
3120
|
-
const propFullNameSafe = propFullName || propName;
|
|
3121
|
-
const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];
|
|
3122
|
-
if (defaultTypeChecker) {
|
|
3123
|
-
const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);
|
|
3124
|
-
if (typeCheckerResult) {
|
|
3125
|
-
return typeCheckerResult;
|
|
3126
|
-
}
|
|
3127
|
-
}
|
|
3128
|
-
if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {
|
|
3129
|
-
return new Error(`The prop \`${propFullNameSafe}\` of ` + `\`${componentNameInError}\` can only be used together with the \`${requiredProp}\` prop.`);
|
|
3130
|
-
}
|
|
3131
|
-
return null;
|
|
3132
|
-
};
|
|
3133
|
-
return requireProp;
|
|
3134
|
-
}
|
|
3135
|
-
|
|
3136
|
-
/**
|
|
3137
|
-
* TODO v5: consider making it private
|
|
3138
|
-
*
|
|
3139
|
-
* passes {value} to {ref}
|
|
3140
|
-
*
|
|
3141
|
-
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
3142
|
-
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
3143
|
-
* https://github.com/mui/material-ui/issues/13539
|
|
3144
|
-
*
|
|
3145
|
-
* Useful if you want to expose the ref of an inner component to the public API
|
|
3146
|
-
* while still using it inside the component.
|
|
3147
|
-
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
3148
|
-
*/
|
|
3149
|
-
function setRef(ref, value) {
|
|
3150
|
-
if (typeof ref === 'function') {
|
|
3151
|
-
ref(value);
|
|
3152
|
-
} else if (ref) {
|
|
3153
|
-
ref.current = value;
|
|
3154
|
-
}
|
|
3155
|
-
}
|
|
3156
|
-
|
|
3157
|
-
/**
|
|
3158
|
-
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
|
3159
|
-
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
|
3160
|
-
*
|
|
3161
|
-
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
3162
|
-
* and confirm it doesn't apply to your use-case.
|
|
3163
|
-
*/
|
|
3164
|
-
const useEnhancedEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
3165
|
-
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
3166
|
-
|
|
3167
|
-
let globalId = 0;
|
|
3168
|
-
function useGlobalId(idOverride) {
|
|
3169
|
-
const [defaultId, setDefaultId] = React__namespace.useState(idOverride);
|
|
3170
|
-
const id = idOverride || defaultId;
|
|
3171
|
-
React__namespace.useEffect(() => {
|
|
3172
|
-
if (defaultId == null) {
|
|
3173
|
-
// Fallback to this default id when possible.
|
|
3174
|
-
// Use the incrementing value for client-side rendering only.
|
|
3175
|
-
// We can't use it server-side.
|
|
3176
|
-
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
3177
|
-
globalId += 1;
|
|
3178
|
-
setDefaultId(`mui-${globalId}`);
|
|
3179
|
-
}
|
|
3180
|
-
}, [defaultId]);
|
|
3181
|
-
return id;
|
|
3182
|
-
}
|
|
3183
|
-
|
|
3184
|
-
// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
3185
|
-
const maybeReactUseId = React__namespace['useId'.toString()];
|
|
3186
|
-
/**
|
|
3187
|
-
*
|
|
3188
|
-
* @example <div id={useId()} />
|
|
3189
|
-
* @param idOverride
|
|
3190
|
-
* @returns {string}
|
|
3191
|
-
*/
|
|
3192
|
-
function useId(idOverride) {
|
|
3193
|
-
if (maybeReactUseId !== undefined) {
|
|
3194
|
-
const reactId = maybeReactUseId();
|
|
3195
|
-
return idOverride != null ? idOverride : reactId;
|
|
3196
|
-
}
|
|
3197
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
|
|
3198
|
-
return useGlobalId(idOverride);
|
|
3199
|
-
}
|
|
3200
|
-
|
|
3201
|
-
function unsupportedProp(props, propName, componentName, location, propFullName) {
|
|
3202
|
-
if (process.env.NODE_ENV === 'production') {
|
|
3203
|
-
return null;
|
|
3204
|
-
}
|
|
3205
|
-
const propFullNameSafe = propFullName || propName;
|
|
3206
|
-
if (typeof props[propName] !== 'undefined') {
|
|
3207
|
-
return new Error(`The prop \`${propFullNameSafe}\` is not supported. Please remove it.`);
|
|
3208
|
-
}
|
|
3209
|
-
return null;
|
|
3210
|
-
}
|
|
3211
|
-
|
|
3212
|
-
function useControlled({
|
|
3213
|
-
controlled,
|
|
3214
|
-
default: defaultProp,
|
|
3215
|
-
name,
|
|
3216
|
-
state = 'value'
|
|
3217
|
-
}) {
|
|
3218
|
-
// isControlled is ignored in the hook dependency lists as it should never change.
|
|
3219
|
-
const {
|
|
3220
|
-
current: isControlled
|
|
3221
|
-
} = React__namespace.useRef(controlled !== undefined);
|
|
3222
|
-
const [valueState, setValue] = React__namespace.useState(defaultProp);
|
|
3223
|
-
const value = isControlled ? controlled : valueState;
|
|
3224
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3225
|
-
React__namespace.useEffect(() => {
|
|
3226
|
-
if (isControlled !== (controlled !== undefined)) {
|
|
3227
|
-
console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
|
|
3228
|
-
}
|
|
3229
|
-
}, [state, name, controlled]);
|
|
3230
|
-
const {
|
|
3231
|
-
current: defaultValue
|
|
3232
|
-
} = React__namespace.useRef(defaultProp);
|
|
3233
|
-
React__namespace.useEffect(() => {
|
|
3234
|
-
if (!isControlled && defaultValue !== defaultProp) {
|
|
3235
|
-
console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\n'));
|
|
3236
|
-
}
|
|
3237
|
-
}, [JSON.stringify(defaultProp)]);
|
|
3238
|
-
}
|
|
3239
|
-
const setValueIfUncontrolled = React__namespace.useCallback(newValue => {
|
|
3240
|
-
if (!isControlled) {
|
|
3241
|
-
setValue(newValue);
|
|
3242
|
-
}
|
|
3243
|
-
}, []);
|
|
3244
|
-
return [value, setValueIfUncontrolled];
|
|
3245
|
-
}
|
|
3246
|
-
|
|
3247
|
-
/**
|
|
3248
|
-
* Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3249
|
-
* See RFC in https://github.com/reactjs/rfcs/pull/220
|
|
3250
|
-
*/
|
|
3251
|
-
|
|
3252
|
-
function useEventCallback(fn) {
|
|
3253
|
-
const ref = React__namespace.useRef(fn);
|
|
3254
|
-
useEnhancedEffect$1(() => {
|
|
3255
|
-
ref.current = fn;
|
|
3256
|
-
});
|
|
3257
|
-
return React__namespace.useRef((...args) =>
|
|
3258
|
-
// @ts-expect-error hide `this`
|
|
3259
|
-
(0, ref.current)(...args)).current;
|
|
3260
|
-
}
|
|
3261
|
-
|
|
3262
|
-
function useForkRef(...refs) {
|
|
3263
|
-
/**
|
|
3264
|
-
* This will create a new function if the refs passed to this hook change and are all defined.
|
|
3265
|
-
* This means react will call the old forkRef with `null` and the new forkRef
|
|
3266
|
-
* with the ref. Cleanup naturally emerges from this behavior.
|
|
3267
|
-
*/
|
|
3268
|
-
return React__namespace.useMemo(() => {
|
|
3269
|
-
if (refs.every(ref => ref == null)) {
|
|
3270
|
-
return null;
|
|
3271
|
-
}
|
|
3272
|
-
return instance => {
|
|
3273
|
-
refs.forEach(ref => {
|
|
3274
|
-
setRef(ref, instance);
|
|
3275
|
-
});
|
|
3276
|
-
};
|
|
3277
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3278
|
-
}, refs);
|
|
3279
|
-
}
|
|
3280
|
-
|
|
3281
|
-
class Timeout {
|
|
3282
|
-
constructor() {
|
|
3283
|
-
this.currentId = null;
|
|
3284
|
-
this.clear = () => {
|
|
3285
|
-
if (this.currentId !== null) {
|
|
3286
|
-
clearTimeout(this.currentId);
|
|
3287
|
-
this.currentId = null;
|
|
3288
|
-
}
|
|
3289
|
-
};
|
|
3290
|
-
this.disposeEffect = () => {
|
|
3291
|
-
return this.clear;
|
|
3292
|
-
};
|
|
3293
|
-
}
|
|
3294
|
-
static create() {
|
|
3295
|
-
return new Timeout();
|
|
3296
|
-
}
|
|
3297
|
-
/**
|
|
3298
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
3299
|
-
*/
|
|
3300
|
-
start(delay, fn) {
|
|
3301
|
-
this.clear();
|
|
3302
|
-
this.currentId = setTimeout(() => {
|
|
3303
|
-
this.currentId = null;
|
|
3304
|
-
fn();
|
|
3305
|
-
}, delay);
|
|
3306
|
-
}
|
|
3307
|
-
}
|
|
3308
|
-
|
|
3309
|
-
let hadKeyboardEvent = true;
|
|
3310
|
-
let hadFocusVisibleRecently = false;
|
|
3311
|
-
const hadFocusVisibleRecentlyTimeout = new Timeout();
|
|
3312
|
-
const inputTypesWhitelist = {
|
|
3313
|
-
text: true,
|
|
3314
|
-
search: true,
|
|
3315
|
-
url: true,
|
|
3316
|
-
tel: true,
|
|
3317
|
-
email: true,
|
|
3318
|
-
password: true,
|
|
3319
|
-
number: true,
|
|
3320
|
-
date: true,
|
|
3321
|
-
month: true,
|
|
3322
|
-
week: true,
|
|
3323
|
-
time: true,
|
|
3324
|
-
datetime: true,
|
|
3325
|
-
'datetime-local': true
|
|
3326
|
-
};
|
|
3327
|
-
|
|
3328
|
-
/**
|
|
3329
|
-
* Computes whether the given element should automatically trigger the
|
|
3330
|
-
* `focus-visible` class being added, i.e. whether it should always match
|
|
3331
|
-
* `:focus-visible` when focused.
|
|
3332
|
-
* @param {Element} node
|
|
3333
|
-
* @returns {boolean}
|
|
3334
|
-
*/
|
|
3335
|
-
function focusTriggersKeyboardModality(node) {
|
|
3336
|
-
const {
|
|
3337
|
-
type,
|
|
3338
|
-
tagName
|
|
3339
|
-
} = node;
|
|
3340
|
-
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
|
|
3341
|
-
return true;
|
|
3342
|
-
}
|
|
3343
|
-
if (tagName === 'TEXTAREA' && !node.readOnly) {
|
|
3344
|
-
return true;
|
|
3345
|
-
}
|
|
3346
|
-
if (node.isContentEditable) {
|
|
3347
|
-
return true;
|
|
3348
|
-
}
|
|
3349
|
-
return false;
|
|
3350
|
-
}
|
|
3351
|
-
|
|
3352
|
-
/**
|
|
3353
|
-
* Keep track of our keyboard modality state with `hadKeyboardEvent`.
|
|
3354
|
-
* If the most recent user interaction was via the keyboard;
|
|
3355
|
-
* and the key press did not include a meta, alt/option, or control key;
|
|
3356
|
-
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
3357
|
-
* @param {KeyboardEvent} event
|
|
3358
|
-
*/
|
|
3359
|
-
function handleKeyDown(event) {
|
|
3360
|
-
if (event.metaKey || event.altKey || event.ctrlKey) {
|
|
3361
|
-
return;
|
|
3362
|
-
}
|
|
3363
|
-
hadKeyboardEvent = true;
|
|
3364
|
-
}
|
|
3365
|
-
|
|
3366
|
-
/**
|
|
3367
|
-
* If at any point a user clicks with a pointing device, ensure that we change
|
|
3368
|
-
* the modality away from keyboard.
|
|
3369
|
-
* This avoids the situation where a user presses a key on an already focused
|
|
3370
|
-
* element, and then clicks on a different element, focusing it with a
|
|
3371
|
-
* pointing device, while we still think we're in keyboard modality.
|
|
3372
|
-
*/
|
|
3373
|
-
function handlePointerDown() {
|
|
3374
|
-
hadKeyboardEvent = false;
|
|
3375
|
-
}
|
|
3376
|
-
function handleVisibilityChange() {
|
|
3377
|
-
if (this.visibilityState === 'hidden') {
|
|
3378
|
-
// If the tab becomes active again, the browser will handle calling focus
|
|
3379
|
-
// on the element (Safari actually calls it twice).
|
|
3380
|
-
// If this tab change caused a blur on an element with focus-visible,
|
|
3381
|
-
// re-apply the class when the user switches back to the tab.
|
|
3382
|
-
if (hadFocusVisibleRecently) {
|
|
3383
|
-
hadKeyboardEvent = true;
|
|
3384
|
-
}
|
|
3385
|
-
}
|
|
3386
|
-
}
|
|
3387
|
-
function prepare(doc) {
|
|
3388
|
-
doc.addEventListener('keydown', handleKeyDown, true);
|
|
3389
|
-
doc.addEventListener('mousedown', handlePointerDown, true);
|
|
3390
|
-
doc.addEventListener('pointerdown', handlePointerDown, true);
|
|
3391
|
-
doc.addEventListener('touchstart', handlePointerDown, true);
|
|
3392
|
-
doc.addEventListener('visibilitychange', handleVisibilityChange, true);
|
|
3393
|
-
}
|
|
3394
|
-
function isFocusVisible(event) {
|
|
3395
|
-
const {
|
|
3396
|
-
target
|
|
3397
|
-
} = event;
|
|
3398
|
-
try {
|
|
3399
|
-
return target.matches(':focus-visible');
|
|
3400
|
-
} catch (error) {
|
|
3401
|
-
// Browsers not implementing :focus-visible will throw a SyntaxError.
|
|
3402
|
-
// We use our own heuristic for those browsers.
|
|
3403
|
-
// Rethrow might be better if it's not the expected error but do we really
|
|
3404
|
-
// want to crash if focus-visible malfunctioned?
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
|
-
// No need for validFocusTarget check. The user does that by attaching it to
|
|
3408
|
-
// focusable events only.
|
|
3409
|
-
return hadKeyboardEvent || focusTriggersKeyboardModality(target);
|
|
3410
|
-
}
|
|
3411
|
-
function useIsFocusVisible() {
|
|
3412
|
-
const ref = React__namespace.useCallback(node => {
|
|
3413
|
-
if (node != null) {
|
|
3414
|
-
prepare(node.ownerDocument);
|
|
3415
|
-
}
|
|
3416
|
-
}, []);
|
|
3417
|
-
const isFocusVisibleRef = React__namespace.useRef(false);
|
|
3418
|
-
|
|
3419
|
-
/**
|
|
3420
|
-
* Should be called if a blur event is fired
|
|
3421
|
-
*/
|
|
3422
|
-
function handleBlurVisible() {
|
|
3423
|
-
// checking against potential state variable does not suffice if we focus and blur synchronously.
|
|
3424
|
-
// React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
|
|
3425
|
-
// Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
|
|
3426
|
-
// This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
|
|
3427
|
-
// TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
|
|
3428
|
-
if (isFocusVisibleRef.current) {
|
|
3429
|
-
// To detect a tab/window switch, we look for a blur event followed
|
|
3430
|
-
// rapidly by a visibility change.
|
|
3431
|
-
// If we don't see a visibility change within 100ms, it's probably a
|
|
3432
|
-
// regular focus change.
|
|
3433
|
-
hadFocusVisibleRecently = true;
|
|
3434
|
-
hadFocusVisibleRecentlyTimeout.start(100, () => {
|
|
3435
|
-
hadFocusVisibleRecently = false;
|
|
3436
|
-
});
|
|
3437
|
-
isFocusVisibleRef.current = false;
|
|
3438
|
-
return true;
|
|
3439
|
-
}
|
|
3440
|
-
return false;
|
|
3441
|
-
}
|
|
3442
|
-
|
|
3443
|
-
/**
|
|
3444
|
-
* Should be called if a blur event is fired
|
|
3445
|
-
*/
|
|
3446
|
-
function handleFocusVisible(event) {
|
|
3447
|
-
if (isFocusVisible(event)) {
|
|
3448
|
-
isFocusVisibleRef.current = true;
|
|
3449
|
-
return true;
|
|
3450
|
-
}
|
|
3451
|
-
return false;
|
|
3452
|
-
}
|
|
3453
|
-
return {
|
|
3454
|
-
isFocusVisibleRef,
|
|
3455
|
-
onFocus: handleFocusVisible,
|
|
3456
|
-
onBlur: handleBlurVisible,
|
|
3457
|
-
ref
|
|
3458
|
-
};
|
|
3459
|
-
}
|
|
3460
|
-
|
|
3461
3045
|
/**
|
|
3462
3046
|
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
3463
3047
|
* @param {object} defaultProps
|
|
@@ -7071,7 +6655,7 @@ var require$$1 = /*@__PURE__*/getAugmentedNamespace(formatMuiErrorMessage);
|
|
|
7071
6655
|
|
|
7072
6656
|
var require$$2 = /*@__PURE__*/getAugmentedNamespace(clamp);
|
|
7073
6657
|
|
|
7074
|
-
var _interopRequireDefault$
|
|
6658
|
+
var _interopRequireDefault$1 = interopRequireDefaultExports;
|
|
7075
6659
|
Object.defineProperty(colorManipulator, "__esModule", {
|
|
7076
6660
|
value: true
|
|
7077
6661
|
});
|
|
@@ -7093,8 +6677,8 @@ colorManipulator.private_safeEmphasize = private_safeEmphasize;
|
|
|
7093
6677
|
colorManipulator.private_safeLighten = private_safeLighten;
|
|
7094
6678
|
colorManipulator.recomposeColor = recomposeColor;
|
|
7095
6679
|
colorManipulator.rgbToHex = rgbToHex;
|
|
7096
|
-
var _formatMuiErrorMessage2 = _interopRequireDefault$
|
|
7097
|
-
var _clamp = _interopRequireDefault$
|
|
6680
|
+
var _formatMuiErrorMessage2 = _interopRequireDefault$1(require$$1);
|
|
6681
|
+
var _clamp = _interopRequireDefault$1(require$$2);
|
|
7098
6682
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
7099
6683
|
|
|
7100
6684
|
/**
|
|
@@ -8216,21 +7800,21 @@ var require$$7 = /*@__PURE__*/getAugmentedNamespace(createTheme$1);
|
|
|
8216
7800
|
|
|
8217
7801
|
var require$$8 = /*@__PURE__*/getAugmentedNamespace(styleFunctionSx);
|
|
8218
7802
|
|
|
8219
|
-
var _interopRequireDefault
|
|
7803
|
+
var _interopRequireDefault = interopRequireDefaultExports;
|
|
8220
7804
|
Object.defineProperty(createStyled$1, "__esModule", {
|
|
8221
7805
|
value: true
|
|
8222
7806
|
});
|
|
8223
7807
|
var _default = createStyled$1.default = createStyled;
|
|
8224
7808
|
createStyled$1.shouldForwardProp = shouldForwardProp;
|
|
8225
7809
|
createStyled$1.systemDefaultTheme = void 0;
|
|
8226
|
-
var _extends2 = _interopRequireDefault
|
|
8227
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault
|
|
7810
|
+
var _extends2 = _interopRequireDefault(require_extends());
|
|
7811
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(requireObjectWithoutPropertiesLoose());
|
|
8228
7812
|
var _styledEngine = _interopRequireWildcard(require$$3);
|
|
8229
7813
|
var _deepmerge = require$$4;
|
|
8230
|
-
var _capitalize = _interopRequireDefault
|
|
8231
|
-
var _getDisplayName = _interopRequireDefault
|
|
8232
|
-
var _createTheme = _interopRequireDefault
|
|
8233
|
-
var _styleFunctionSx = _interopRequireDefault
|
|
7814
|
+
var _capitalize = _interopRequireDefault(require$$5);
|
|
7815
|
+
var _getDisplayName = _interopRequireDefault(require$$6);
|
|
7816
|
+
var _createTheme = _interopRequireDefault(require$$7);
|
|
7817
|
+
var _styleFunctionSx = _interopRequireDefault(require$$8);
|
|
8234
7818
|
const _excluded$1 = ["ownerState"],
|
|
8235
7819
|
_excluded2 = ["variants"],
|
|
8236
7820
|
_excluded3 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
@@ -8660,7 +8244,7 @@ process.env.NODE_ENV !== "production" ? SvgIcon.propTypes /* remove-proptypes */
|
|
|
8660
8244
|
SvgIcon.muiName = 'SvgIcon';
|
|
8661
8245
|
var SvgIcon$1 = SvgIcon;
|
|
8662
8246
|
|
|
8663
|
-
function createSvgIcon
|
|
8247
|
+
function createSvgIcon(path, displayName) {
|
|
8664
8248
|
function Component(props, ref) {
|
|
8665
8249
|
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon$1, _extends$1({
|
|
8666
8250
|
"data-testid": `${displayName}Icon`,
|
|
@@ -8678,127 +8262,45 @@ function createSvgIcon$1(path, displayName) {
|
|
|
8678
8262
|
return /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(Component));
|
|
8679
8263
|
}
|
|
8680
8264
|
|
|
8681
|
-
|
|
8682
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8683
|
-
const unstable_ClassNameGenerator = {
|
|
8684
|
-
configure: generator => {
|
|
8685
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
8686
|
-
console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\n'));
|
|
8687
|
-
}
|
|
8688
|
-
ClassNameGenerator$1.configure(generator);
|
|
8689
|
-
}
|
|
8690
|
-
};
|
|
8691
|
-
|
|
8692
|
-
var utils = /*#__PURE__*/Object.freeze({
|
|
8693
|
-
__proto__: null,
|
|
8694
|
-
capitalize: capitalize$1,
|
|
8695
|
-
createChainedFunction: createChainedFunction,
|
|
8696
|
-
createSvgIcon: createSvgIcon$1,
|
|
8697
|
-
debounce: debounce,
|
|
8698
|
-
deprecatedPropType: deprecatedPropType,
|
|
8699
|
-
isMuiElement: isMuiElement,
|
|
8700
|
-
ownerDocument: ownerDocument,
|
|
8701
|
-
ownerWindow: ownerWindow,
|
|
8702
|
-
requirePropFactory: requirePropFactory,
|
|
8703
|
-
setRef: setRef,
|
|
8704
|
-
unstable_ClassNameGenerator: unstable_ClassNameGenerator,
|
|
8705
|
-
unstable_useEnhancedEffect: useEnhancedEffect$1,
|
|
8706
|
-
unstable_useId: useId,
|
|
8707
|
-
unsupportedProp: unsupportedProp,
|
|
8708
|
-
useControlled: useControlled,
|
|
8709
|
-
useEventCallback: useEventCallback,
|
|
8710
|
-
useForkRef: useForkRef,
|
|
8711
|
-
useIsFocusVisible: useIsFocusVisible
|
|
8712
|
-
});
|
|
8713
|
-
|
|
8714
|
-
var Email = createSvgIcon$1( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8265
|
+
var Email = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8715
8266
|
d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"
|
|
8716
8267
|
}), 'Email');
|
|
8717
8268
|
|
|
8718
|
-
var Facebook = createSvgIcon
|
|
8269
|
+
var Facebook = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8719
8270
|
d: "M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m13 2h-2.5A3.5 3.5 0 0 0 12 8.5V11h-2v3h2v7h3v-7h3v-3h-3V9a1 1 0 0 1 1-1h2V5z"
|
|
8720
8271
|
}), 'Facebook');
|
|
8721
8272
|
|
|
8722
|
-
var Handyman = createSvgIcon
|
|
8273
|
+
var Handyman = createSvgIcon([/*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8723
8274
|
d: "m21.67 18.17-5.3-5.3h-.99l-2.54 2.54v.99l5.3 5.3c.39.39 1.02.39 1.41 0l2.12-2.12c.39-.38.39-1.02 0-1.41"
|
|
8724
8275
|
}, "0"), /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8725
8276
|
d: "m17.34 10.19 1.41-1.41 2.12 2.12c1.17-1.17 1.17-3.07 0-4.24l-3.54-3.54-1.41 1.41V1.71l-.7-.71-3.54 3.54.71.71h2.83l-1.41 1.41 1.06 1.06-2.89 2.89-4.13-4.13V5.06L4.83 2.04 2 4.87 5.03 7.9h1.41l4.13 4.13-.85.85H7.6l-5.3 5.3c-.39.39-.39 1.02 0 1.41l2.12 2.12c.39.39 1.02.39 1.41 0l5.3-5.3v-2.12l5.15-5.15z"
|
|
8726
8277
|
}, "1")], 'Handyman');
|
|
8727
8278
|
|
|
8728
|
-
var Instagram = createSvgIcon
|
|
8279
|
+
var Instagram = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8729
8280
|
d: "M7.8 2h8.4C19.4 2 22 4.6 22 7.8v8.4a5.8 5.8 0 0 1-5.8 5.8H7.8C4.6 22 2 19.4 2 16.2V7.8A5.8 5.8 0 0 1 7.8 2m-.2 2A3.6 3.6 0 0 0 4 7.6v8.8C4 18.39 5.61 20 7.6 20h8.8a3.6 3.6 0 0 0 3.6-3.6V7.6C20 5.61 18.39 4 16.4 4H7.6m9.65 1.5a1.25 1.25 0 0 1 1.25 1.25A1.25 1.25 0 0 1 17.25 8 1.25 1.25 0 0 1 16 6.75a1.25 1.25 0 0 1 1.25-1.25M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3z"
|
|
8730
8281
|
}), 'Instagram');
|
|
8731
8282
|
|
|
8732
|
-
var
|
|
8283
|
+
var OpenInNew = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8284
|
+
d: "M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"
|
|
8285
|
+
}), 'OpenInNew');
|
|
8286
|
+
|
|
8287
|
+
var PhoneEnabled = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8733
8288
|
d: "m17.38 10.79-2.2-2.2c-.28-.28-.36-.67-.25-1.02.37-1.12.57-2.32.57-3.57 0-.55.45-1 1-1H20c.55 0 1 .45 1 1 0 9.39-7.61 17-17 17-.55 0-1-.45-1-1v-3.49c0-.55.45-1 1-1 1.24 0 2.45-.2 3.57-.57.35-.12.75-.03 1.02.24l2.2 2.2c2.83-1.45 5.15-3.76 6.59-6.59"
|
|
8734
8289
|
}), 'PhoneEnabled');
|
|
8735
8290
|
|
|
8736
|
-
var ThreeP = createSvgIcon
|
|
8291
|
+
var ThreeP = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8737
8292
|
d: "M20 2H4.01c-1.1 0-2 .9-2 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8 4c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m4 8H8v-.57c0-.81.48-1.53 1.22-1.85.85-.37 1.79-.58 2.78-.58.99 0 1.93.21 2.78.58.74.32 1.22 1.04 1.22 1.85z"
|
|
8738
8293
|
}), 'ThreeP');
|
|
8739
8294
|
|
|
8740
|
-
var WhatsApp = createSvgIcon
|
|
8295
|
+
var WhatsApp = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
8741
8296
|
d: "M16.75 13.96c.25.13.41.2.46.3.06.11.04.61-.21 1.18-.2.56-1.24 1.1-1.7 1.12-.46.02-.47.36-2.96-.73-2.49-1.09-3.99-3.75-4.11-3.92-.12-.17-.96-1.38-.92-2.61.05-1.22.69-1.8.95-2.04.24-.26.51-.29.68-.26h.47c.15 0 .36-.06.55.45l.69 1.87c.06.13.1.28.01.44l-.27.41-.39.42c-.12.12-.26.25-.12.5.12.26.62 1.09 1.32 1.78.91.88 1.71 1.17 1.95 1.3.24.14.39.12.54-.04l.81-.94c.19-.25.35-.19.58-.11l1.67.88M12 2a10 10 0 0 1 10 10 10 10 0 0 1-10 10c-1.97 0-3.8-.57-5.35-1.55L2 22l1.55-4.65A9.969 9.969 0 0 1 2 12 10 10 0 0 1 12 2m0 2a8 8 0 0 0-8 8c0 1.72.54 3.31 1.46 4.61L4.5 19.5l2.89-.96A7.95 7.95 0 0 0 12 20a8 8 0 0 0 8-8 8 8 0 0 0-8-8z"
|
|
8742
8297
|
}), 'WhatsApp');
|
|
8743
8298
|
|
|
8744
|
-
var ArrowForward = {};
|
|
8745
|
-
|
|
8746
|
-
var createSvgIcon = {};
|
|
8747
|
-
|
|
8748
|
-
var require$$0 = /*@__PURE__*/getAugmentedNamespace(utils);
|
|
8749
|
-
|
|
8750
|
-
var hasRequiredCreateSvgIcon;
|
|
8751
|
-
|
|
8752
|
-
function requireCreateSvgIcon () {
|
|
8753
|
-
if (hasRequiredCreateSvgIcon) return createSvgIcon;
|
|
8754
|
-
hasRequiredCreateSvgIcon = 1;
|
|
8755
|
-
(function (exports) {
|
|
8756
|
-
'use client';
|
|
8757
|
-
|
|
8758
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8759
|
-
value: true
|
|
8760
|
-
});
|
|
8761
|
-
Object.defineProperty(exports, "default", {
|
|
8762
|
-
enumerable: true,
|
|
8763
|
-
get: function () {
|
|
8764
|
-
return _utils.createSvgIcon;
|
|
8765
|
-
}
|
|
8766
|
-
});
|
|
8767
|
-
var _utils = require$$0;
|
|
8768
|
-
} (createSvgIcon));
|
|
8769
|
-
return createSvgIcon;
|
|
8770
|
-
}
|
|
8771
|
-
|
|
8772
|
-
var _interopRequireDefault$1 = interopRequireDefaultExports;
|
|
8773
|
-
Object.defineProperty(ArrowForward, "__esModule", {
|
|
8774
|
-
value: true
|
|
8775
|
-
});
|
|
8776
|
-
var default_1$1 = ArrowForward.default = void 0;
|
|
8777
|
-
var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon());
|
|
8778
|
-
var _jsxRuntime$1 = jsxRuntimeExports;
|
|
8779
|
-
default_1$1 = ArrowForward.default = (0, _createSvgIcon$1.default)( /*#__PURE__*/(0, _jsxRuntime$1.jsx)("path", {
|
|
8780
|
-
d: "m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"
|
|
8781
|
-
}), 'ArrowForward');
|
|
8782
|
-
|
|
8783
|
-
var Message = {};
|
|
8784
|
-
|
|
8785
|
-
var _interopRequireDefault = interopRequireDefaultExports;
|
|
8786
|
-
Object.defineProperty(Message, "__esModule", {
|
|
8787
|
-
value: true
|
|
8788
|
-
});
|
|
8789
|
-
var default_1 = Message.default = void 0;
|
|
8790
|
-
var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
|
|
8791
|
-
var _jsxRuntime = jsxRuntimeExports;
|
|
8792
|
-
default_1 = Message.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
8793
|
-
d: "M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"
|
|
8794
|
-
}), 'Message');
|
|
8795
|
-
|
|
8796
8299
|
const ButtonsContainer = material.styled(material.Box)(({ theme }) => ({
|
|
8797
8300
|
position: 'absolute',
|
|
8798
8301
|
top: 8,
|
|
8799
8302
|
right: 8,
|
|
8800
8303
|
display: 'flex',
|
|
8801
|
-
flexDirection: 'column',
|
|
8802
8304
|
gap: 4,
|
|
8803
8305
|
zIndex: 1,
|
|
8804
8306
|
//@ts-ignore
|
|
@@ -8812,7 +8314,6 @@ const HeaderContainer = material.styled(material.Box)({
|
|
|
8812
8314
|
flexDirection: 'column',
|
|
8813
8315
|
alignItems: 'center',
|
|
8814
8316
|
marginBottom: '16px',
|
|
8815
|
-
position: 'relative',
|
|
8816
8317
|
});
|
|
8817
8318
|
const ContactAvatar = material.styled(material.Avatar)({
|
|
8818
8319
|
width: 60,
|
|
@@ -8826,57 +8327,14 @@ const ContactName = material.styled(material.Typography)({
|
|
|
8826
8327
|
maxWidth: 200,
|
|
8827
8328
|
textAlign: 'center',
|
|
8828
8329
|
});
|
|
8829
|
-
const
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
});
|
|
8837
|
-
const Header = ({ imgUrl, name, contactId, navigate, isLoading = false, onError, onClose, }) => {
|
|
8838
|
-
const handleNavigation = React.useCallback((url) => (event) => {
|
|
8839
|
-
try {
|
|
8840
|
-
event.preventDefault();
|
|
8841
|
-
event.stopPropagation();
|
|
8842
|
-
if (!url) {
|
|
8843
|
-
throw new Error('Navigation URL is required');
|
|
8844
|
-
}
|
|
8845
|
-
const isNewTab = event.ctrlKey || event.metaKey || event.button === 1; // Ctrl+Click, Cmd+Click, Middle Mouse
|
|
8846
|
-
if (isNewTab) {
|
|
8847
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
8848
|
-
}
|
|
8849
|
-
else {
|
|
8850
|
-
navigate(url);
|
|
8851
|
-
}
|
|
8852
|
-
}
|
|
8853
|
-
catch (error) {
|
|
8854
|
-
onError?.(error instanceof Error ? error : new Error('Navigation failed'));
|
|
8855
|
-
}
|
|
8856
|
-
}, [navigate, onError]);
|
|
8857
|
-
const handleNavigateToContacts = handleNavigation(`/a/contacts/contacts/${contactId}`);
|
|
8858
|
-
const handleNavigateToConversations = handleNavigation('/a/conversations/conversations');
|
|
8859
|
-
const displayName = name || 'Unknown Contact';
|
|
8860
|
-
const avatarAlt = `Avatar for ${displayName}`;
|
|
8861
|
-
return (jsxRuntimeExports.jsxs(HeaderContainer, { children: [jsxRuntimeExports.jsxs(ButtonsContainer, { children: [jsxRuntimeExports.jsx(SmallIconButton, { color: "info", size: "small", onClick: (e) => {
|
|
8862
|
-
handleNavigateToContacts(e);
|
|
8863
|
-
onClose();
|
|
8864
|
-
}, onMouseDown: (e) => {
|
|
8865
|
-
if (e.button === 1) {
|
|
8866
|
-
// Middle mouse button
|
|
8867
|
-
handleNavigateToContacts(e);
|
|
8868
|
-
onClose();
|
|
8869
|
-
}
|
|
8870
|
-
}, disabled: !contactId, "aria-label": "View contact details", children: jsxRuntimeExports.jsx(default_1$1, { fontSize: "small" }) }), jsxRuntimeExports.jsx(SmallIconButton, { color: "info", size: "small", onClick: (e) => {
|
|
8871
|
-
handleNavigateToConversations(e);
|
|
8872
|
-
onClose();
|
|
8873
|
-
}, onMouseDown: (e) => {
|
|
8874
|
-
if (e.button === 1) {
|
|
8875
|
-
// Middle mouse button
|
|
8876
|
-
handleNavigateToConversations(e);
|
|
8877
|
-
onClose();
|
|
8878
|
-
}
|
|
8879
|
-
}, "aria-label": "Go to conversations", children: jsxRuntimeExports.jsx(default_1, { fontSize: "small" }) })] }), isLoading ? (jsxRuntimeExports.jsx(LoadingContainer, { children: jsxRuntimeExports.jsx(material.CircularProgress, { size: 24 }) })) : (jsxRuntimeExports.jsx(ContactAvatar, { src: imgUrl, alt: avatarAlt, onError: () => onError?.(new Error('Failed to load avatar')) })), jsxRuntimeExports.jsx(ContactName, { variant: "h6", title: displayName, children: displayName })] }));
|
|
8330
|
+
const Header = ({ imgUrl, name, contactId, }) => {
|
|
8331
|
+
const handleOpenInNewTab = (event) => {
|
|
8332
|
+
event.preventDefault();
|
|
8333
|
+
event.stopPropagation();
|
|
8334
|
+
const url = `/a/contacts/contacts/${contactId}`;
|
|
8335
|
+
window.open(url, '_blank');
|
|
8336
|
+
};
|
|
8337
|
+
return (jsxRuntimeExports.jsxs(HeaderContainer, { children: [jsxRuntimeExports.jsx(ButtonsContainer, { children: jsxRuntimeExports.jsx(SmallIconButton, { color: "info", size: "small", onClick: handleOpenInNewTab, children: jsxRuntimeExports.jsx(OpenInNew, { fontSize: "small" }) }) }), jsxRuntimeExports.jsx(ContactAvatar, { src: imgUrl, alt: "Contact Avatar" }), jsxRuntimeExports.jsx(ContactName, { variant: "h6", children: name })] }));
|
|
8880
8338
|
};
|
|
8881
8339
|
|
|
8882
8340
|
const Container$1 = material.styled(material.Box)({
|
|
@@ -14725,7 +14183,7 @@ const Container = material.styled(material.Box)({
|
|
|
14725
14183
|
alignItems: 'center',
|
|
14726
14184
|
gap: 8,
|
|
14727
14185
|
});
|
|
14728
|
-
const SectionTitle$
|
|
14186
|
+
const SectionTitle$1 = material.styled(material.Typography)({
|
|
14729
14187
|
borderBottom: `1px solid lightgray`,
|
|
14730
14188
|
width: '100%',
|
|
14731
14189
|
});
|
|
@@ -14783,100 +14241,7 @@ const Properties = ({ properties, title }) => {
|
|
|
14783
14241
|
}
|
|
14784
14242
|
return value;
|
|
14785
14243
|
};
|
|
14786
|
-
return (jsxRuntimeExports.jsxs(Container, { children: [jsxRuntimeExports.jsx(SectionTitle$
|
|
14787
|
-
};
|
|
14788
|
-
|
|
14789
|
-
const SectionTitle$2 = material.styled(material.Typography)({
|
|
14790
|
-
fontWeight: 'bold',
|
|
14791
|
-
marginBottom: '8px',
|
|
14792
|
-
marginTop: '16px',
|
|
14793
|
-
borderBottom: `1px solid lightgray`,
|
|
14794
|
-
});
|
|
14795
|
-
const TagContainer = material.styled(material.Box)({
|
|
14796
|
-
marginBottom: 16,
|
|
14797
|
-
});
|
|
14798
|
-
const StyledChip = material.styled(material.Chip)(({ theme }) => ({
|
|
14799
|
-
marginRight: 8,
|
|
14800
|
-
marginBottom: 8,
|
|
14801
|
-
backgroundColor: `${theme.palette.primary.main}b3`,
|
|
14802
|
-
}));
|
|
14803
|
-
const LabelsSection = ({ contactData, title }) => {
|
|
14804
|
-
if (!contactData)
|
|
14805
|
-
return null;
|
|
14806
|
-
if (!contactData.tags?.length)
|
|
14807
|
-
return null;
|
|
14808
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(SectionTitle$2, { gutterBottom: true, mt: 2, variant: "subtitle1", children: title }), jsxRuntimeExports.jsx(TagContainer, { children: contactData?.tags
|
|
14809
|
-
?.filter((tag) => tag.name?.trim())
|
|
14810
|
-
.map((tag) => (jsxRuntimeExports.jsx(StyledChip, { label: tag.name, color: "primary", size: "small" }, tag.id))) })] }));
|
|
14811
|
-
};
|
|
14812
|
-
|
|
14813
|
-
/**
|
|
14814
|
-
* Type guard to check if an object is an IContact
|
|
14815
|
-
* @param obj The object to check
|
|
14816
|
-
* @returns True if the object is an IContact
|
|
14817
|
-
*/
|
|
14818
|
-
function isContact(obj) {
|
|
14819
|
-
return (obj !== null &&
|
|
14820
|
-
typeof obj === 'object' &&
|
|
14821
|
-
typeof obj.id === 'string' &&
|
|
14822
|
-
typeof obj.spaceId === 'string' &&
|
|
14823
|
-
typeof obj.name === 'string' &&
|
|
14824
|
-
typeof obj.firstName === 'string' &&
|
|
14825
|
-
typeof obj.lastName === 'string' &&
|
|
14826
|
-
Array.isArray(obj.phones) &&
|
|
14827
|
-
Array.isArray(obj.emails) &&
|
|
14828
|
-
'origin' in obj &&
|
|
14829
|
-
typeof obj.isSpam === 'boolean' &&
|
|
14830
|
-
(!obj.businessId || typeof obj.businessId === 'string'));
|
|
14831
|
-
}
|
|
14832
|
-
|
|
14833
|
-
const SectionTitle$1 = material.styled(material.Typography)({
|
|
14834
|
-
fontWeight: 'bold',
|
|
14835
|
-
marginBottom: '8px',
|
|
14836
|
-
marginTop: '16px',
|
|
14837
|
-
borderBottom: `1px solid lightgray`,
|
|
14838
|
-
});
|
|
14839
|
-
const BusinessSection = ({ contactData, title }) => {
|
|
14840
|
-
if (!contactData || !isContact(contactData))
|
|
14841
|
-
return null;
|
|
14842
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(SectionTitle$1, { gutterBottom: true, mt: 2, variant: "subtitle1", children: title }), jsxRuntimeExports.jsx(material.Typography, { variant: "body2", color: "text.secondary", children: contactData?.businessName })] }));
|
|
14843
|
-
};
|
|
14844
|
-
|
|
14845
|
-
/**
|
|
14846
|
-
* Type guard to check if an object is an IBusiness
|
|
14847
|
-
* @param obj The object to check
|
|
14848
|
-
* @returns True if the object is an IBusiness
|
|
14849
|
-
*/
|
|
14850
|
-
function isBusiness(obj) {
|
|
14851
|
-
return (obj !== null &&
|
|
14852
|
-
typeof obj === 'object' &&
|
|
14853
|
-
typeof obj.id === 'string' &&
|
|
14854
|
-
typeof obj.spaceId === 'string' &&
|
|
14855
|
-
typeof obj.name === 'string' &&
|
|
14856
|
-
Array.isArray(obj.membersId) &&
|
|
14857
|
-
Array.isArray(obj.members) &&
|
|
14858
|
-
Array.isArray(obj.phones) &&
|
|
14859
|
-
Array.isArray(obj.emails) &&
|
|
14860
|
-
typeof obj.imageUrl === 'string' &&
|
|
14861
|
-
!('firstName' in obj) &&
|
|
14862
|
-
!('lastName' in obj));
|
|
14863
|
-
}
|
|
14864
|
-
|
|
14865
|
-
// Components
|
|
14866
|
-
const MemberItem = ({ name }) => {
|
|
14867
|
-
return (jsxRuntimeExports.jsx(material.Typography, { variant: "body2", color: "text.secondary", children: name }));
|
|
14868
|
-
};
|
|
14869
|
-
|
|
14870
|
-
const SectionTitle = material.styled(material.Typography)({
|
|
14871
|
-
fontWeight: 'bold',
|
|
14872
|
-
marginBottom: '8px',
|
|
14873
|
-
marginTop: '16px',
|
|
14874
|
-
borderBottom: `1px solid lightgray`,
|
|
14875
|
-
});
|
|
14876
|
-
const MembersSection = ({ contactData, title }) => {
|
|
14877
|
-
if (!contactData || !isBusiness(contactData) || !contactData.members?.length)
|
|
14878
|
-
return null;
|
|
14879
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(SectionTitle, { gutterBottom: true, mt: 2, variant: "subtitle1", children: title }), jsxRuntimeExports.jsx(material.Typography, { variant: "body2", color: "text.secondary", children: contactData?.members.map((member) => (jsxRuntimeExports.jsx(MemberItem, { name: member.name }, member.id))) })] }));
|
|
14244
|
+
return (jsxRuntimeExports.jsxs(Container, { children: [jsxRuntimeExports.jsx(SectionTitle$1, { fontWeight: "bold", gutterBottom: true, mt: 2, variant: "subtitle1", children: title }), properties?.map((property, i) => property.value.length > 0 && (jsxRuntimeExports.jsxs(PropertyItem, { children: [jsxRuntimeExports.jsx(PropertyIcon, {}), jsxRuntimeExports.jsxs(PropertyText, { children: [getPropertyTitle(property.nameKey), ":", ' ', formatPropertyValue(property.value, property.type)] })] }, i)))] }));
|
|
14880
14245
|
};
|
|
14881
14246
|
|
|
14882
14247
|
const PopupContainer = material.styled(material.Box)(({ theme }) => ({
|
|
@@ -14906,17 +14271,28 @@ const PopupContainer = material.styled(material.Box)(({ theme }) => ({
|
|
|
14906
14271
|
background: '#616161',
|
|
14907
14272
|
},
|
|
14908
14273
|
}));
|
|
14909
|
-
const
|
|
14274
|
+
const SectionTitle = material.styled(material.Typography)({
|
|
14275
|
+
fontWeight: 'bold',
|
|
14276
|
+
marginBottom: '8px',
|
|
14277
|
+
marginTop: '16px',
|
|
14278
|
+
borderBottom: `1px solid lightgray`,
|
|
14279
|
+
});
|
|
14280
|
+
const TagContainer = material.styled(material.Box)({
|
|
14281
|
+
marginBottom: 16,
|
|
14282
|
+
});
|
|
14283
|
+
const StyledChip = material.styled(material.Chip)(({ theme }) => ({
|
|
14284
|
+
marginRight: 8,
|
|
14285
|
+
marginBottom: 8,
|
|
14286
|
+
backgroundColor: `${theme.palette.primary.main}b3`
|
|
14287
|
+
}));
|
|
14288
|
+
const ContactInfoPopup = ({ open, anchorEl, onClose, contactData, avatarImgUrl, t = (key) => ({
|
|
14910
14289
|
labels: 'Etiquetas',
|
|
14911
14290
|
phone: 'Teléfono',
|
|
14912
14291
|
business: 'Empresa',
|
|
14913
|
-
businessMembers: 'Miembros de la empresa',
|
|
14914
14292
|
properties: 'Propiedades',
|
|
14915
14293
|
view: 'Ver',
|
|
14916
|
-
|
|
14294
|
+
'E-mail Address': 'Correo Electrónico'
|
|
14917
14295
|
}[key] || key), }) => {
|
|
14918
|
-
const dataIsBusiness = isBusiness(contactData);
|
|
14919
|
-
const dataIsContact = isContact(contactData);
|
|
14920
14296
|
const contactMethods = [
|
|
14921
14297
|
{
|
|
14922
14298
|
icon: jsxRuntimeExports.jsx(PhoneEnabled, { fontSize: "small" }),
|
|
@@ -14926,7 +14302,7 @@ const ContactInfoPopup = ({ open, anchorEl, onClose, contactData, avatarImgUrl,
|
|
|
14926
14302
|
},
|
|
14927
14303
|
{
|
|
14928
14304
|
icon: jsxRuntimeExports.jsx(Email, { fontSize: "small" }),
|
|
14929
|
-
title: t('
|
|
14305
|
+
title: t('E-mail Address'),
|
|
14930
14306
|
contactList: contactData?.emails || [],
|
|
14931
14307
|
showTitle: true,
|
|
14932
14308
|
},
|
|
@@ -14965,7 +14341,7 @@ const ContactInfoPopup = ({ open, anchorEl, onClose, contactData, avatarImgUrl,
|
|
|
14965
14341
|
window.removeEventListener('keydown', handleKeyDown);
|
|
14966
14342
|
};
|
|
14967
14343
|
}, [open, onClose]);
|
|
14968
|
-
return (jsxRuntimeExports.jsx(material.Popper, { sx: { zIndex: 1300 }, open: open, anchorEl: anchorEl, placement: "bottom-start", "data-popper-child": "true", children: jsxRuntimeExports.jsx(material.ClickAwayListener, { onClickAway: onClose, children: jsxRuntimeExports.jsx(PopupContainer, { children: jsxRuntimeExports.jsxs(material.CardContent, { children: [jsxRuntimeExports.jsx(Header, {
|
|
14344
|
+
return (jsxRuntimeExports.jsx(material.Popper, { sx: { zIndex: 1300 }, open: open, anchorEl: anchorEl, placement: "bottom-start", "data-popper-child": "true", children: jsxRuntimeExports.jsx(material.ClickAwayListener, { onClickAway: onClose, children: jsxRuntimeExports.jsx(PopupContainer, { children: jsxRuntimeExports.jsxs(material.CardContent, { children: [jsxRuntimeExports.jsx(Header, { contactId: contactData?.id, imgUrl: avatarImgUrl, name: contactData?.name }), jsxRuntimeExports.jsx(SectionTitle, { gutterBottom: true, mt: 2, variant: "subtitle1", children: t('labels') }), jsxRuntimeExports.jsx(TagContainer, { children: contactData?.tags?.map((tag) => (jsxRuntimeExports.jsx(StyledChip, { label: tag.name, color: "primary", size: "small" }, tag.id))) }), jsxRuntimeExports.jsx(SectionTitle, { gutterBottom: true, mt: 2, variant: "subtitle1", children: t('business') }), jsxRuntimeExports.jsx(material.Typography, { variant: "body2", color: "text.secondary", children: contactData?.businessName }), contactMethods.map((method, index) => (jsxRuntimeExports.jsx(ContactMethod, { icon: method.icon, title: method.title, contactList: method.contactList, showTitle: method.showTitle }, index))), jsxRuntimeExports.jsx(Properties, { properties: contactData?.properties, title: t('properties') })] }) }) }) }));
|
|
14969
14345
|
};
|
|
14970
14346
|
|
|
14971
14347
|
exports.ContactInfoPopup = ContactInfoPopup;
|