@box/unified-share-modal 1.33.0 → 1.35.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.
@@ -1,84 +1,86 @@
1
- import { useState as le, useRef as ce, useEffect as R, useCallback as x } from "react";
2
- import { createPortal as de } from "react-dom";
1
+ import { useState as ce, useRef as de, useEffect as N, useCallback as F } from "react";
2
+ import { createPortal as me } from "react-dom";
3
3
  import { useIntl as ue } from "react-intl";
4
- import { useNotification as me, useUniqueId as he, useLabelable as fe, Tooltip as pe, Focusable as be, Text as Ce, Modal as h } from "@box/blueprint-web";
4
+ import { useNotification as he, useUniqueId as fe, useLabelable as pe, Tooltip as be, Focusable as Ce, Text as ve, Modal as h } from "@box/blueprint-web";
5
5
  import { Globe as ge } from "@box/blueprint-web-assets/icons/Medium";
6
- import { UserSelectorContainer as ve } from "@box/user-selector";
7
- import { CollaborationRole as Se } from "./collaboration-role.js";
6
+ import { UserSelectorContainer as Se } from "@box/user-selector";
7
+ import { CollaborationRole as Ae } from "./collaboration-role.js";
8
8
  import { SharedWithAvatars as Le } from "./shared-with-avatars.js";
9
9
  import { ShieldRestrictionNotice as Ue } from "./shield-restriction-notice.js";
10
- import { TextAreaContainer as xe } from "./text-area-container.js";
11
- import { COLLABORATION_MESSAGE_CHARACTER_LIMIT as Fe } from "../../../constants.js";
10
+ import { TextAreaContainer as Fe } from "./text-area-container.js";
11
+ import { COLLABORATION_MESSAGE_CHARACTER_LIMIT as ye } from "../../../constants.js";
12
12
  import o from "./messages.js";
13
- import { jsxs as l, jsx as r, Fragment as ye } from "react/jsx-runtime";
14
- import { useFormValidation as Ae } from "../../../hooks/use-form-validation.js";
15
- import { useCollaborationForm as Ie } from "../../../hooks/use-collaboration-form.js";
13
+ import { jsxs as i, jsx as r, Fragment as Ie } from "react/jsx-runtime";
14
+ import { useFormValidation as _e } from "../../../hooks/use-form-validation.js";
15
+ import { useCollaborationForm as xe } from "../../../hooks/use-collaboration-form.js";
16
16
  import { useUnifiedShareFormContext as Ee } from "../../../contexts/unified-share-form-context.js";
17
17
  import { useUnifiedShareModalContext as Be } from "../../../contexts/unified-share-modal-context.js";
18
- import '../../../../../styles/collaboration-section.css';const Ve = "_container_1ixpu_2", _e = "_label_1ixpu_8", Re = "_securityIndicator_1ixpu_23", F = {
18
+ import '../../../../../styles/collaboration-section.css';const Ve = "_container_wmqot_2", Ne = "_label_wmqot_8", Re = "_securityIndicator_wmqot_23", Te = "_collaborationAccessContainer_wmqot_29", f = {
19
19
  container: Ve,
20
- label: _e,
21
- securityIndicator: Re
20
+ label: Ne,
21
+ securityIndicator: Re,
22
+ collaborationAccessContainer: Te
22
23
  };
23
- function Qe() {
24
+ function Ye() {
24
25
  const {
25
26
  formatMessage: t
26
- } = ue(), [f, y] = le(), {
27
- addNotification: T
28
- } = me(), {
29
- validateShieldRestriction: N
30
- } = Ae(), {
31
- contactValue: O,
32
- container: p,
33
- onModalOpenChange: A,
34
- onShareViewChange: b,
35
- setUserContacts: P,
36
- shareView: i,
37
- userContacts: n
27
+ } = ue(), [p, y] = ce(), {
28
+ addNotification: R
29
+ } = he(), {
30
+ validateShieldRestriction: T
31
+ } = _e(), {
32
+ contactValue: w,
33
+ container: b,
34
+ onModalOpenChange: I,
35
+ onShareViewChange: C,
36
+ setUserContacts: O,
37
+ shareView: n,
38
+ userContacts: a
38
39
  } = Ee(), {
40
+ collaborationAccess: P,
39
41
  collaborationNotices: k,
40
- config: C,
42
+ config: v,
41
43
  contactService: M,
42
- isFetching: w,
44
+ isFetching: q,
43
45
  isSubmitting: D,
44
46
  item: G,
45
47
  sharingService: W
46
48
  } = Be(), {
47
49
  permissions: j = {},
48
- type: q
50
+ type: H
49
51
  } = G, {
50
52
  getContacts: g,
51
- getContactsAvatarUrls: v
53
+ getContactsAvatarUrls: S
52
54
  } = M, {
53
- sendInvitations: H,
54
- sendSharedLink: K
55
+ sendInvitations: K,
56
+ sendSharedLink: $
55
57
  } = W;
56
- let S, L;
57
- i === "invite" && (S = H, L = "invite-collaborators"), i === "email" && (S = K, L = "email-shared-link");
58
+ let A, L;
59
+ n === "invite" && (A = K, L = "invite-collaborators"), n === "email" && (A = $, L = "email-shared-link");
58
60
  const {
59
- errors: $,
60
- handleFormReset: I,
61
- handleFormSubmit: z,
62
- handleSelectedUsersChange: E,
63
- handleUserSelectorBlur: J,
64
- isFormSubmitting: Q,
65
- updateContactValue: X
66
- } = Ie(S, L), a = i === "default" || i === "invite", s = i === "invite" || i === "email", c = D ?? Q, Y = n.some((e) => e.isExternalUser), B = ce(i === "email" ? "email" : "invite");
67
- R(() => {
68
- B.current = i === "email" ? "email" : "invite";
69
- }, [i]), R(() => {
70
- (!n.length || !n.some((e) => e.chipVariant === "error")) && y(null);
71
- }, [n]);
72
- const Z = x((e) => (e.stopPropagation(), !0), []), ee = x((e) => g ? g(e, B.current) : Promise.resolve([]), [g]), te = x((e) => v ? v(e) : Promise.resolve({}), [v]), oe = (e) => {
73
- s || b("invite"), X(e);
74
- }, re = () => {
75
- I(), b("default");
76
- }, ie = async () => {
61
+ errors: z,
62
+ handleFormReset: _,
63
+ handleFormSubmit: J,
64
+ handleSelectedUsersChange: x,
65
+ handleUserSelectorBlur: Q,
66
+ isFormSubmitting: X,
67
+ updateContactValue: Y
68
+ } = xe(A, L), s = n === "default" || n === "invite", l = n === "invite" || n === "email", c = D ?? X, Z = a.some((e) => e.isExternalUser), E = de(n === "email" ? "email" : "invite");
69
+ N(() => {
70
+ E.current = n === "email" ? "email" : "invite";
71
+ }, [n]), N(() => {
72
+ (!a.length || !a.some((e) => e.chipVariant === "error")) && y(null);
73
+ }, [a]);
74
+ const ee = F((e) => (e.stopPropagation(), !0), []), te = F((e) => g ? g(e, E.current) : Promise.resolve([]), [g]), oe = F((e) => S ? S(e) : Promise.resolve({}), [S]), re = (e) => {
75
+ l || C("invite"), Y(e);
76
+ }, ne = () => {
77
+ _(), C("default");
78
+ }, ae = async () => {
77
79
  try {
78
- if (f) {
79
- const e = N(n);
80
+ if (p) {
81
+ const e = T(a);
80
82
  if (e) {
81
- T({
83
+ R({
82
84
  closeButtonAriaLabel: t(o.closeButton),
83
85
  sensitivity: "foreground",
84
86
  styledText: e,
@@ -88,92 +90,95 @@ function Qe() {
88
90
  return;
89
91
  }
90
92
  }
91
- if (await z())
93
+ if (await J())
92
94
  return;
93
- I(), A && A(!1), b("default");
95
+ _(), I && I(!1), C("default");
94
96
  } catch (e) {
95
97
  if (!e.shieldRestriction)
96
98
  return;
97
99
  const {
98
100
  shieldRestriction: U
99
- } = e, _ = [...U.restrictedEmails ?? [], ...U.restrictedGroups ?? []], se = n.map((m) => _.includes(m.email) || _.includes(`${m.id}`) ? {
100
- ...m,
101
+ } = e, V = [...U.restrictedEmails ?? [], ...U.restrictedGroups ?? []], le = a.map((u) => V.includes(u.email) || V.includes(`${u.id}`) ? {
102
+ ...u,
101
103
  chipVariant: "error"
102
- } : m);
103
- y(U), P(se);
104
+ } : u);
105
+ y(U), O(le);
104
106
  }
105
107
  };
106
- let d, u = !1;
107
- a && !j.canInviteCollaborator && (d = t(o.inviteDisabledTooltip), u = !0), a && q === "web_link" && (d = t(o.inviteWebLinkDisabledTooltip), u = !0);
108
- const V = he("user-contacts-"), ne = t(a ? o.invitePeopleLabel : o.emailSharedLinkLabel), ae = fe(ne, V);
109
- return /* @__PURE__ */ l("form", {
110
- className: F.container,
108
+ let d, m = !1;
109
+ s && !j.canInviteCollaborator && (d = t(o.inviteDisabledTooltip), m = !0), s && H === "web_link" && (d = t(o.inviteWebLinkDisabledTooltip), m = !0);
110
+ const B = fe("user-contacts-"), ie = t(s ? o.invitePeopleLabel : o.emailSharedLinkLabel), se = pe(ie, B);
111
+ return /* @__PURE__ */ i("form", {
112
+ className: f.container,
111
113
  onSubmit: (e) => e.preventDefault(),
112
- children: [f && /* @__PURE__ */ r(Ue, {
113
- error: f,
114
+ children: [p && /* @__PURE__ */ r(Ue, {
115
+ error: p,
114
116
  isLoading: c,
115
- onSelectedUsersChange: E
116
- }), k, /* @__PURE__ */ l("div", {
117
- children: [a && C.collaborators && /* @__PURE__ */ r(Le, {}), /* @__PURE__ */ r(ae, {
118
- className: F.label
119
- }), /* @__PURE__ */ r(pe, {
117
+ onSelectedUsersChange: x
118
+ }), k, /* @__PURE__ */ i("div", {
119
+ children: [s && v.collaborators && /* @__PURE__ */ r(Le, {}), /* @__PURE__ */ r(se, {
120
+ className: f.label
121
+ }), /* @__PURE__ */ r(be, {
120
122
  content: d,
121
123
  "data-testid": "user-contacts-tooltip",
122
124
  open: d ? void 0 : !1,
123
125
  side: "bottom",
124
- children: /* @__PURE__ */ r(be, {
125
- focusable: u,
126
- children: /* @__PURE__ */ r(ve, {
126
+ children: /* @__PURE__ */ r(Ce, {
127
+ focusable: m,
128
+ children: /* @__PURE__ */ r(Se, {
127
129
  className: "collaboration-user-selector",
128
130
  clearButtonAriaLabel: t(o.clearButton),
129
131
  clearOnBlur: !1,
130
- disabled: u || c,
132
+ disabled: m || c,
131
133
  displayChipVariant: (e) => e.chipVariant,
132
- error: $["user-contact"],
133
- fetchAvatarUrls: te,
134
- fetchUsers: ee,
135
- hideOnEscape: Z,
136
- idForLabel: V,
137
- inputValue: O,
134
+ error: z["user-contact"],
135
+ fetchAvatarUrls: oe,
136
+ fetchUsers: te,
137
+ hideOnEscape: ee,
138
+ idForLabel: B,
139
+ inputValue: w,
138
140
  label: null,
139
- onBlur: J,
140
- onInputValueChange: oe,
141
- onSelectedUsersChange: E,
142
- placeholder: n.length ? "" : t(o.invitePeoplePlaceholder),
143
- portalElement: p,
144
- selectedUsers: n,
141
+ onBlur: Q,
142
+ onInputValueChange: re,
143
+ onSelectedUsersChange: x,
144
+ placeholder: a.length ? "" : t(o.invitePeoplePlaceholder),
145
+ portalElement: b,
146
+ selectedUsers: a,
145
147
  selectOnEnterOrTab: !0,
146
- variant: s ? "textarea" : "input"
148
+ variant: l ? "textarea" : "input"
147
149
  })
148
150
  })
149
- }), a && C.collaborationRole && /* @__PURE__ */ r(Se, {})]
150
- }), s && C.collaborationMessage && /* @__PURE__ */ r(xe, {
151
- maxCount: Fe
152
- }), s && Y && /* @__PURE__ */ l("div", {
153
- className: F.securityIndicator,
154
- children: [/* @__PURE__ */ r(ge, {}), /* @__PURE__ */ r(Ce, {
151
+ }), s && /* @__PURE__ */ i("div", {
152
+ className: f.collaborationAccessContainer,
153
+ children: [v.collaborationRole && /* @__PURE__ */ r(Ae, {}), P]
154
+ })]
155
+ }), l && v.collaborationMessage && /* @__PURE__ */ r(Fe, {
156
+ maxCount: ye
157
+ }), l && Z && /* @__PURE__ */ i("div", {
158
+ className: f.securityIndicator,
159
+ children: [/* @__PURE__ */ r(ge, {}), /* @__PURE__ */ r(ve, {
155
160
  as: "span",
156
161
  color: "textOnLightSecondary",
157
162
  children: t(o.contentSharedWithExternalCollaborators)
158
163
  })]
159
- }), s && p && /* @__PURE__ */ de(/* @__PURE__ */ l(ye, {
160
- children: [!w && /* @__PURE__ */ l(h.Footer, {
164
+ }), l && b && /* @__PURE__ */ me(/* @__PURE__ */ i(Ie, {
165
+ children: [!q && /* @__PURE__ */ i(h.Footer, {
161
166
  children: [/* @__PURE__ */ r(h.Footer.SecondaryButton, {
162
167
  disabled: c,
163
- onClick: re,
168
+ onClick: ne,
164
169
  children: t(o.cancelButton)
165
170
  }), /* @__PURE__ */ r(h.Footer.PrimaryButton, {
166
171
  loading: c,
167
172
  loadingAriaLabel: t(o.loadingLabel),
168
- onClick: ie,
173
+ onClick: ae,
169
174
  children: t(o.sendButton)
170
175
  })]
171
176
  }), /* @__PURE__ */ r(h.Close, {
172
177
  "aria-label": t(o.closeButton)
173
178
  })]
174
- }), p)]
179
+ }), b)]
175
180
  });
176
181
  }
177
182
  export {
178
- Qe as CollaborationSection
183
+ Ye as CollaborationSection
179
184
  };
@@ -1,58 +1,67 @@
1
- import { useIntl as p } from "react-intl";
2
- import { Text as v, Avatar as b } from "@box/blueprint-web";
3
- import { Gray10 as x } from "@box/blueprint-web-assets/tokens/tokens";
4
- import { CollaboratorAvatar as g } from "../collaborators-view/collaborator-avatar.js";
5
- import A from "./messages.js";
6
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
7
- import { callOnKeyboardEvent as _ } from "../../../utils/event.js";
8
- import { useUnifiedShareModalContext as C } from "../../../contexts/unified-share-modal-context.js";
9
- import { useUnifiedShareFormContext as S } from "../../../contexts/unified-share-form-context.js";
10
- import '../../../../../styles/shared-with-avatars.css';const y = "_container_1ku5s_2", I = "_avatars_1ku5s_19", l = {
11
- container: y,
12
- avatars: I
13
- }, c = 3;
14
- function z() {
1
+ import { useIntl as x } from "react-intl";
2
+ import { Text as C, Avatar as g } from "@box/blueprint-web";
3
+ import { Gray10 as A } from "@box/blueprint-web-assets/tokens/tokens";
4
+ import { CollaboratorAvatar as S } from "../collaborators-view/collaborator-avatar.js";
5
+ import _ from "./messages.js";
6
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
7
+ import { callOnKeyboardEvent as k } from "../../../utils/event.js";
8
+ import { useUnifiedShareModalContext as y } from "../../../contexts/unified-share-modal-context.js";
9
+ import { useUnifiedShareFormContext as I } from "../../../contexts/unified-share-form-context.js";
10
+ import '../../../../../styles/shared-with-avatars.css';const W = "_container_1ku5s_2", U = "_avatars_1ku5s_19", c = {
11
+ container: W,
12
+ avatars: U
13
+ }, m = 3;
14
+ function V() {
15
15
  const {
16
- formatMessage: m
17
- } = p(), {
18
- collaborators: d,
19
- currentUser: f,
16
+ formatMessage: d
17
+ } = x(), {
18
+ collaborators: f,
19
+ currentUser: h,
20
+ eventService: u,
20
21
  isSubmitting: o
21
- } = C(), {
22
- onShareViewChange: a
23
- } = S(), {
24
- id: s
25
- } = f, t = d.filter(({
22
+ } = y(), {
23
+ onShareViewChange: v
24
+ } = I(), {
25
+ onCollaboratorsClick: a
26
+ } = u, {
27
+ id: n
28
+ } = h, t = f.filter(({
26
29
  isCurrentUser: r,
27
- userId: u
28
- }) => !(r || s && s === u));
30
+ userId: b
31
+ }) => !(r || n && n === b));
29
32
  if (!t.length)
30
33
  return null;
31
- const h = t.slice(0, c), n = t.length - c;
32
- return /* @__PURE__ */ i("div", {
34
+ const p = t.slice(0, m), s = t.length - m, i = () => {
35
+ if (a) {
36
+ a();
37
+ return;
38
+ }
39
+ v("collaborators");
40
+ };
41
+ return /* @__PURE__ */ l("div", {
33
42
  "aria-disabled": o,
34
- className: l.container,
35
- onClick: () => a("collaborators"),
36
- onKeyDown: _(() => a("collaborators")),
43
+ className: c.container,
44
+ onClick: i,
45
+ onKeyDown: k(i),
37
46
  role: "button",
38
47
  tabIndex: o ? -1 : 0,
39
- children: [/* @__PURE__ */ e(v, {
48
+ children: [/* @__PURE__ */ e(C, {
40
49
  as: "span",
41
50
  color: "textOnLightSecondary",
42
- children: m(A.sharedWithLabel)
43
- }), /* @__PURE__ */ i("div", {
44
- className: l.avatars,
45
- children: [h.map((r) => /* @__PURE__ */ e(g, {
51
+ children: d(_.sharedWithLabel)
52
+ }), /* @__PURE__ */ l("div", {
53
+ className: c.avatars,
54
+ children: [p.map((r) => /* @__PURE__ */ e(S, {
46
55
  collaborator: r,
47
56
  size: "medium"
48
- }, r.id)), n > 0 && /* @__PURE__ */ e(b, {
49
- color: x,
57
+ }, r.id)), s > 0 && /* @__PURE__ */ e(g, {
58
+ color: A,
50
59
  size: "medium",
51
- text: `+${n}`
60
+ text: `+${s}`
52
61
  })]
53
62
  })]
54
63
  });
55
64
  }
56
65
  export {
57
- z as SharedWithAvatars
66
+ V as SharedWithAvatars
58
67
  };
@@ -1,20 +1,20 @@
1
- import { useRef as S, useState as z, useCallback as v, useEffect as E } from "react";
2
- import { useIntl as G } from "react-intl";
3
- import { Text as x, Tooltip as _, Focusable as q, Switch as H, Status as J, Link as Q, Button as W } from "@box/blueprint-web";
1
+ import { useRef as S, useState as V, useCallback as v, useEffect as N } from "react";
2
+ import { useIntl as z } from "react-intl";
3
+ import { Text as x, Tooltip as _, Focusable as G, Switch as H, Status as J, Link as Q, Button as W } from "@box/blueprint-web";
4
4
  import { ClockBadge as X } from "@box/blueprint-web-assets/icons/Line";
5
- import { Mail as Y, Globe as N } from "@box/blueprint-web-assets/icons/Medium";
5
+ import { Mail as Y, Globe as P } from "@box/blueprint-web-assets/icons/Medium";
6
6
  import { SurfaceStatusSurfaceRed as Z } from "@box/blueprint-web-assets/tokens/tokens";
7
7
  import { CopyInput as $ } from "@box/copy-input";
8
8
  import { SharedLinkAccess as ee } from "./shared-link-access.js";
9
- import { SharedLinkPermission as ie } from "./shared-link-permission.js";
10
- import i from "./messages.js";
11
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
12
- import { useUnifiedShareFormContext as te } from "../../../contexts/unified-share-form-context.js";
9
+ import { SharedLinkPermission as te } from "./shared-link-permission.js";
10
+ import t from "./messages.js";
11
+ import { jsxs as l, jsx as i } from "react/jsx-runtime";
12
+ import { useUnifiedShareFormContext as ie } from "../../../contexts/unified-share-form-context.js";
13
13
  import { useUnifiedShareModalContext as ae } from "../../../contexts/unified-share-modal-context.js";
14
- import { useSharingAction as P } from "../../../hooks/use-sharing-action.js";
14
+ import { useSharingAction as D } from "../../../hooks/use-sharing-action.js";
15
15
  import { formatDateFromTimestampToDateString as ne } from "../../../utils/date.js";
16
16
  import { callOnKeyboardEvent as oe } from "../../../utils/event.js";
17
- import '../../../../../styles/shared-link-section.css';const se = "_container_1w9vi_1", re = "_toggle_1w9vi_7", ce = "_settings_1w9vi_13", le = "_copy_1w9vi_22", de = "_access_1w9vi_30", he = "_securityIndicator_1w9vi_36", s = {
17
+ import '../../../../../styles/shared-link-section.css';const se = "_container_1b8qy_1", re = "_toggle_1b8qy_7", ce = "_settings_1b8qy_13", le = "_copy_1b8qy_22", de = "_access_1b8qy_30", he = "_securityIndicator_1b8qy_36", s = {
18
18
  container: se,
19
19
  toggle: re,
20
20
  settings: ce,
@@ -22,149 +22,149 @@ import '../../../../../styles/shared-link-section.css';const se = "_container_1w
22
22
  access: de,
23
23
  securityIndicator: he
24
24
  };
25
- function we() {
25
+ function Ie() {
26
26
  const {
27
27
  formatMessage: e
28
- } = G(), g = S(!0), k = S(null), m = S(null), {
29
- onModalViewChange: L,
30
- onShareViewChange: D
31
- } = te(), {
28
+ } = z(), g = S(!0), k = S(null), m = S(null), {
29
+ onModalViewChange: y,
30
+ onShareViewChange: w
31
+ } = ie(), {
32
32
  config: o,
33
33
  isFetching: A,
34
34
  isSubmitting: F,
35
- item: R,
35
+ item: q,
36
36
  sharedLink: n,
37
- sharingService: M
37
+ sharingService: R
38
38
  } = ae(), {
39
39
  permissions: T = {}
40
+ } = q, {
41
+ createSharedLink: M
40
42
  } = R, {
41
- createSharedLink: B
42
- } = M, {
43
43
  sharedLinkAutoCopy: d,
44
- sharedLinkAutoCreate: y
44
+ sharedLinkAutoCreate: L
45
45
  } = o;
46
- let w = "create-shared-link";
47
- d && (w = "auto-copy-shared-link");
46
+ let I = "create-shared-link";
47
+ d && (I = "auto-copy-shared-link");
48
48
  const {
49
- isLoading: O,
49
+ isLoading: B,
50
50
  onAction: b
51
- } = P(B, w), a = !!n.url, r = F ?? O, [C, U] = z(!1), p = v(async () => {
52
- a || (await b(), U(!0));
53
- }, [a, b]), j = v(async () => (p(), new Promise((c) => {
51
+ } = D(M, I), a = !!n.url, r = F ?? B, [C, O] = V(!1), p = v(async () => {
52
+ a || (await b(), O(!0));
53
+ }, [a, b]), U = v(async () => (p(), new Promise((c) => {
54
54
  m.current = {
55
55
  resolve: c
56
56
  };
57
57
  })), [p]), {
58
- onAction: I
59
- } = P(j, "auto-copy-shared-link");
60
- E(() => {
61
- !g.current || A || (d ? I() : y && p(), g.current = !1);
62
- }, [A, g, d, y, p, I]), E(() => {
58
+ onAction: E
59
+ } = D(U, "auto-copy-shared-link");
60
+ N(() => {
61
+ !g.current || A || (d ? E() : L && p(), g.current = !1);
62
+ }, [A, g, d, L, p, E]), N(() => {
63
63
  a && d && k.current && k.current.click();
64
64
  }, [a, d]);
65
- const K = v((u) => {
65
+ const j = v((u) => {
66
66
  if (!m.current)
67
67
  return;
68
68
  let c;
69
- u instanceof Error ? c = C ? e(i.autoCreateCopyErrorNoticeText) : null : c = e(C ? i.autoCreateCopySuccessNoticeText : i.autoCopySuccessNoticeText), c && m.current.resolve({
69
+ u instanceof Error ? c = C ? e(t.autoCreateCopyErrorNoticeText) : null : c = e(C ? t.autoCreateCopySuccessNoticeText : t.autoCopySuccessNoticeText), c && m.current.resolve({
70
70
  messages: [{
71
71
  text: c,
72
72
  type: "success"
73
73
  }]
74
74
  }), m.current = null;
75
- }, [e, C]), V = async (u) => {
76
- u || L("remove-shared-link"), u && await b();
75
+ }, [e, C]), K = async (u) => {
76
+ u || y("remove-shared-link"), u && await b();
77
77
  };
78
78
  let h, f = !1;
79
- return !a && !r && (h = e(i.sharedLinkToggleTooltip)), !a && !T.canShare && (h = e(i.createLinkDisabledTooltip), f = !0), a && !T.canSetShareAccess && (h = e(i.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ l("div", {
79
+ return !a && !r && (h = e(t.sharedLinkToggleTooltip)), !a && !T.canShare && (h = e(t.createLinkDisabledTooltip), f = !0), a && !T.canSetShareAccess && (h = e(t.removeLinkDisabledTooltip), f = !0), /* @__PURE__ */ l("div", {
80
80
  className: s.container,
81
- children: [/* @__PURE__ */ t(x, {
81
+ children: [/* @__PURE__ */ i(x, {
82
82
  as: "label",
83
83
  variant: "bodyDefaultBold",
84
- children: e(i.shareLinkLabel)
84
+ children: e(t.shareLinkLabel)
85
85
  }), /* @__PURE__ */ l("div", {
86
86
  className: s.toggle,
87
- children: [/* @__PURE__ */ t(_, {
87
+ children: [/* @__PURE__ */ i(_, {
88
88
  align: "start",
89
89
  content: h,
90
90
  "data-testid": "shared-link-tooltip",
91
91
  open: h ? void 0 : !1,
92
- children: /* @__PURE__ */ t(q, {
92
+ children: /* @__PURE__ */ i(G, {
93
93
  focusable: f,
94
- children: /* @__PURE__ */ t(H.Item, {
94
+ children: /* @__PURE__ */ i(H.Item, {
95
95
  checked: a,
96
96
  disabled: f || r,
97
- label: e(i.sharedLinkToggleLabel),
98
- onCheckedChange: V,
97
+ label: e(t.sharedLinkToggleLabel),
98
+ onCheckedChange: K,
99
99
  value: "shared-link"
100
100
  })
101
101
  })
102
- }), a && !!n.expiresAt && /* @__PURE__ */ t(_, {
103
- content: e(i.expirationIconTooltip, {
102
+ }), a && !!n.expiresAt && /* @__PURE__ */ i(_, {
103
+ content: e(t.expirationIconTooltip, {
104
104
  expirationDate: ne(n.expiresAt)
105
105
  }),
106
106
  "data-testid": "expiration-date-tooltip",
107
- children: /* @__PURE__ */ t(J, {
107
+ children: /* @__PURE__ */ i(J, {
108
108
  color: Z,
109
109
  hideText: !0,
110
110
  icon: X,
111
- text: e(i.expirationIconLabel)
111
+ text: e(t.expirationIconLabel)
112
112
  })
113
- }), a && o.sharedLinkSettings && /* @__PURE__ */ t(Q, {
113
+ }), a && o.sharedLinkSettings && /* @__PURE__ */ i(Q, {
114
114
  "aria-disabled": r,
115
115
  "aria-haspopup": "dialog",
116
116
  className: s.settings,
117
- onClick: () => L("shared-link-settings"),
118
- onKeyDown: oe(() => L("shared-link-settings"), {
117
+ onClick: () => y("shared-link-settings"),
118
+ onKeyDown: oe(() => y("shared-link-settings"), {
119
119
  canPreventDefault: !0
120
120
  }),
121
121
  role: "button",
122
122
  tabIndex: r ? -1 : 0,
123
123
  variant: "standalone",
124
- children: e(i.sharedLinkSettingsLabel)
124
+ children: e(t.sharedLinkSettingsLabel)
125
125
  })]
126
126
  }), a && /* @__PURE__ */ l("div", {
127
127
  className: s.copy,
128
- children: [/* @__PURE__ */ t($, {
128
+ children: [/* @__PURE__ */ i($, {
129
129
  ref: k,
130
- autoFocus: y && a,
130
+ autoFocus: L && a,
131
131
  disabled: r,
132
132
  hideLabel: !0,
133
- label: e(i.sharedLinkUrlLabel),
134
- onCopy: K,
133
+ label: e(t.sharedLinkUrlLabel),
134
+ onCopy: j,
135
135
  value: n.url
136
- }), o.sharedLinkEmail && /* @__PURE__ */ t(_, {
136
+ }), o.sharedLinkEmail && /* @__PURE__ */ i(_, {
137
137
  align: "end",
138
- content: e(i.sharedLinkEmailLabel),
139
- children: /* @__PURE__ */ t(W, {
140
- "aria-label": e(i.sharedLinkEmailLabel),
138
+ content: e(t.sharedLinkEmailLabel),
139
+ children: /* @__PURE__ */ i(W, {
140
+ "aria-label": e(t.sharedLinkEmailLabel),
141
141
  disabled: r,
142
142
  icon: Y,
143
- onClick: () => D("email"),
143
+ onClick: () => w("email"),
144
144
  size: "large",
145
145
  variant: "secondary"
146
146
  })
147
147
  })]
148
148
  }), a && (o.sharedLinkAccess || o.sharedLinkPermission) && /* @__PURE__ */ l("div", {
149
149
  className: s.access,
150
- children: [o.sharedLinkAccess && /* @__PURE__ */ t(ee, {}), o.sharedLinkPermission && /* @__PURE__ */ t(ie, {})]
150
+ children: [o.sharedLinkAccess && /* @__PURE__ */ i(ee, {}), o.sharedLinkPermission && /* @__PURE__ */ i(te, {})]
151
151
  }), a && n.access === "open" && /* @__PURE__ */ l("div", {
152
152
  className: s.securityIndicator,
153
- children: [/* @__PURE__ */ t(N, {}), /* @__PURE__ */ t(x, {
153
+ children: [/* @__PURE__ */ i(P, {}), /* @__PURE__ */ i(x, {
154
154
  as: "span",
155
155
  color: "textOnLightSecondary",
156
- children: n.permission === "can_edit" ? e(i.sharedLinkEditablePubliclyAvailable) : e(i.sharedLinkPubliclyAvailable)
156
+ children: n.permission === "can_edit" ? e(t.sharedLinkEditablePubliclyAvailable) : e(t.sharedLinkPubliclyAvailable)
157
157
  })]
158
158
  }), a && n.access === "company" && n.permission === "can_edit" && /* @__PURE__ */ l("div", {
159
159
  className: s.securityIndicator,
160
- children: [/* @__PURE__ */ t(N, {}), /* @__PURE__ */ t(x, {
160
+ children: [/* @__PURE__ */ i(P, {}), /* @__PURE__ */ i(x, {
161
161
  as: "span",
162
162
  color: "textOnLightSecondary",
163
- children: e(i.sharedLinkElevatedEditableCompanyAvailable)
163
+ children: e(t.sharedLinkElevatedEditableCompanyAvailable)
164
164
  })]
165
165
  })]
166
166
  });
167
167
  }
168
168
  export {
169
- we as SharedLinkSection
169
+ Ie as SharedLinkSection
170
170
  };