@aiquants/auth-react-router 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.js +1 -1
- package/dist/admin.mjs +1 -1
- package/package.json +3 -3
package/dist/admin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveVirtualScrollLocale as rt}from"@aiquants/virtualscroll";var Q={title:"Users & Groups",locale:"en",formatLocale:"en-US",timeZone:"UTC",heading:"\u{1F464} User administration",common:{create:"Create",edit:"Edit",delete:"Delete",save:"Save",cancel:"Cancel",actions:"Actions",status:"Status",id:"ID",readOnly:"Read-only",managedUpstream:"Managed upstream",idTemplate:"#{id}",none:"-"},errors:{unknownUpstream:"No group named {key} exists upstream. Check the spelling, or pick one from the list.",directoryDisabled:"This deployment has no directory configured, so groups cannot be linked.",invalidField:"\u201C{field}\u201D is missing or not a value this operation accepts.",unknownIntent:"This screen does not perform that operation.",fieldNames:{groupId:"Group",userId:"User",entryId:"Entry",displayName:"Display name",email:"Email",groupKey:"Group key",name:"Name",provider:"Directory provider",externalKey:"Directory group address",membershipMode:"Membership expansion",isActive:"Active",isSyncEnabled:"Synchronization",pattern:"Pattern",type:"Type"},invalidAllowlistType:"The allowlist type must be either an address or a domain.",unexpected:"The operation failed. The reason is in the server log.",alreadyLinked:"{key} is already linked to {group}. One upstream group can back only one local group.",forbidden:"You do not have permission for this operation. The badge in the header shows what you currently hold; ask an administrator for the rest.",requestTooLarge:"The request was too large to process."},permissions:{label:"Your permissions:",canWrite:"Editable",canRead:"Read only",canDelete:"Delete only",none:"No access",unknown:"Unknown"},tabs:{users:"\u{1F464} Users",groups:"\u{1F465} Groups",groupMembers:"\u{1F517} Members",allowlist:"\u2709\uFE0F Allowlist",directory:"\u{1F504} Directory"},usersView:{title:"Users",sortBy:"Sort by {column}",searchPlaceholder:"Search by name or email...",searchLabel:"Search users",addUser:"\uFF0B Add user",editUser:"Edit user",displayName:"Name",email:"Email",active:"Active",inactive:"Inactive",activate:"Activate",deactivate:"Deactivate",editUserAria:"Edit {user}",activateAria:"Activate {user}",deactivateAria:"Deactivate {user}",emptyFiltered:"No user matches this search.",listSummary:"Showing {shown} of {total} users.",sortedAscending:"{column}, sorted ascending. Activate to sort descending.",sortedDescending:"{column}, sorted descending. Activate to sort ascending.",confirmDeactivate:"Deactivate {user}? They will no longer be able to sign in.",empty:"No user is registered yet."},groupsView:{emptyFiltered:"No group matches this search",createModeLabel:"How to create the group",createModeLocal:"Create locally",createModeUpstream:"Create from a directory group",pickUpstream:"Directory group",pickUpstreamPlaceholder:"Search by name or address...",upstreamOptionMembers:"{count} members",upstreamAlreadyLinked:"already linked to {group}",providerUnset:"This deployment has no directory provider configured, so a directory group cannot be linked yet. Ask an administrator to set it.",pickUpstreamFirst:"Pick a directory group first.",allUpstreamLinked:"Every directory group is already linked to a local group. One upstream group can back only one local group, so unlink one first.",catalogEmpty:"The directory reported no groups as of {at}. Creating from a directory group is unavailable until one exists upstream.",catalogUnavailable:"The directory could not be reached, so the group list is unavailable. Enter the address by hand instead. ({reason})",catalogUnavailableHere:"The directory could not be reached, so creating from a directory group is unavailable. Create the group locally, then link it on the Directory tab. ({reason})",catalogObservedAt:"This list is the directory as of {at}.",catalogStale:"\u26A0 This list is the directory as of {at} and is overdue for a refresh \u2014 a group created since then will not appear.",catalogFailures:{denied:"the directory refused this deployment's credential",rateLimited:"the directory is rate-limiting this deployment",upstreamError:"the directory reported an internal error",neverObserved:"the directory has not been read yet \u2014 the synchronization job may not be running",unknown:"the reason is in the server log"},createUpstreamNotice:"Creates the group and links it in one step. The directory then owns its membership \u2014 and this screen can no longer rename, describe or delete the group. Unlinking is the only way back, and it removes the member ledger and the group-based sign-in permission.",openMembers:"Members",openMembersAria:"Show the members of {group}",title:"Groups",searchPlaceholder:"Search by group name or key...",searchLabel:"Search groups",addGroup:"\uFF0B Add group",editGroup:"Edit group",groupKey:"Group key",name:"Name",description:"Description",memberCountTemplate:"{count} members",confirmDelete:"Delete {group}? Its {count} membership record(s) go with it, and anyone who could sign in only through this group will be locked out.",confirmCreateLinked:"Create {group} and hand its membership to {upstream}? Renaming and deleting it here becomes impossible.",editGroupAria:"Edit {group}",deleteGroupAria:"Delete {group}",noDescription:"No description",groupKeyPlaceholder:"e.g. dev-team",namePlaceholder:"e.g. Development team",empty:"No groups registered"},groupMembersView:{title:"Group members",searchLabel:"Search users",searchPlaceholder:"Search by name or email...",onlyMembers:"Members only ({count})",emptyFiltered:"No user matches this search",summary:"Showing {shown} of {total} users. This group has {members} member(s).",selectGroup:"Select a group",selectPrompt:"Select a group to manage its members",noGroups:"No group exists yet. Create one on the Groups tab first.",emptyNoMembers:"This group has no members yet. Untick \u201CMembers only\u201D to add someone.",noUsers:"No user is registered yet. Add one on the Users tab first.",deepLinkMissed:"Group {id} was not found \u2014 it may have been deleted. Showing {group} instead.",actionAdd:"Add",actionRemove:"Remove",actionAddAria:"Add {user} to this group",actionRemoveAria:"Remove {user} from this group",upstreamNotice:"Membership of this group is owned by the upstream directory. Edit it there \u2014 a local change would be reverted at the next synchronization.",membersOfTemplate:"Members of {group}",groupKeyLabel:"Group key"},allowlistView:{title:"Sign-in allowlist",addEntry:"\uFF0B Add pattern",pattern:"Pattern (e.g. @example.com or user@example.com)",type:"Type",emailType:"Exact email match",domainType:"Domain match",emailTypeShort:"Email",domainTypeShort:"Domain",groupTypeShort:"Group",target:"Target",description:"Description",deploymentOwner:"Deployment-wide",confirmDelete:"Remove {target} from the sign-in allowlist? Anyone who could sign in only through it will be locked out.",deleteAria:"Remove the allowlist entry for {target}",empty:"No allowlist entries registered"},directoryView:{title:"Directory synchronization",membershipMode:"Membership",directMode:"Direct only",transitiveMode:"Nested expanded",lastSynced:"Last synced",neverSynced:"Never",unresolvedTemplate:"{count} unresolved",syncPaused:"Paused",syncEnabled:"Active",syncNow:"Sync now",syncQueued:"Queued",syncAlreadyPending:"A synchronization request for this scope is already waiting, so nothing was queued. If it never completes, the synchronization job may not be running.",linkSyncNotQueued:'The link was created, but a synchronization request could not be queued. Use "Sync now" on the Directory tab.',staleWarning:"Synchronization is overdue. Until it runs, people removed upstream keep their access.",disabledWarning:"Directory synchronization is not wired for this deployment. Existing memberships remain in force and are no longer being refreshed.",pausedTemplate:"{paused} of {total} links are paused",erroredTemplate:"Last synchronization failed for {groups}",erroredItemTemplate:"{group}: {reason}",listSeparator:", ",oldestSyncedTemplate:"oldest successful sync: {at}",pendingTemplate:"{count} sync requests are queued",nothingToLink:"Every group is already linked to a directory.",noGroupsToLink:"No group exists yet. Create one on the Groups tab first.",notWiredNotice:"Directory synchronization is not wired for this deployment, so links cannot be created or changed here.",syncNowAria:"Synchronize {group} now",syncQueuedAria:"A synchronization of {group} is queued",pauseAria:"Pause synchronization of {group}",resumeAria:"Resume synchronization of {group}",allowGroupAria:"Allow members of {group} to sign in",disallowGroupAria:"Stop allowing members of {group} to sign in",unlinkAria:"Unlink {group} from the directory",confirmDisallow:"Stop allowing {group} to sign in? Anyone who could sign in only through it will be locked out.",link:"Link to a directory group",unlink:"Unlink",externalKey:"Upstream group",empty:"No groups are linked to a directory",selectGroup:"Group to link",pickUpstreamPlaceholder:"Search by name or address...",pickerNoOptions:"No matching group",pickerClear:"Clear the selection",pickerToggle:"Show the group list",pickerSelected:"Selected: {value}",externalKeyPlaceholder:"e.g. dev-team@example.com",confirmLink:"Hand {group}'s membership to {upstream}? Renaming, deleting, and editing its members here becomes impossible.",confirmUnlink:"Unlink {group} from {upstream}? Its member ledger and group-based sign-in permission are removed.",pause:"Pause",resume:"Resume",allowGroup:"Allow sign-in",disallowGroup:"Stop allowing sign-in",groupOptionTemplate:"{name} ({key})"}},Pt={title:"\u30E6\u30FC\u30B6\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7\u7BA1\u7406",locale:"ja",formatLocale:"ja-JP",timeZone:"Asia/Tokyo",heading:"\u{1F464} \u30E6\u30FC\u30B6\u30FC\u7BA1\u7406",common:{create:"\u4F5C\u6210",edit:"\u7DE8\u96C6",delete:"\u524A\u9664",save:"\u4FDD\u5B58",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",actions:"\u64CD\u4F5C",status:"\u72B6\u614B",id:"ID",readOnly:"\u5909\u66F4\u4E0D\u53EF",managedUpstream:"\u4E0A\u6D41\u304C\u6240\u6709",idTemplate:"#{id}",none:"-"},errors:{unknownUpstream:"\u4E0A\u6D41\u306B {key} \u3068\u3044\u3046\u30B0\u30EB\u30FC\u30D7\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u7DB4\u308A\u3092\u78BA\u8A8D\u3059\u308B\u304B\u3001\u4E00\u89A7\u304B\u3089\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",directoryDisabled:"\u3053\u306E\u914D\u5099\u306B\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30B0\u30EB\u30FC\u30D7\u3092\u9023\u643A\u3067\u304D\u307E\u305B\u3093\u3002",invalidField:"\u300C{field}\u300D\u304C\u672A\u6307\u5B9A\u304B\u3001\u3053\u306E\u64CD\u4F5C\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u306A\u3044\u5024\u3067\u3059\u3002",unknownIntent:"\u3053\u306E\u753B\u9762\u3067\u306F\u3001\u305D\u306E\u64CD\u4F5C\u3092\u884C\u3044\u307E\u305B\u3093\u3002",fieldNames:{groupId:"\u30B0\u30EB\u30FC\u30D7",userId:"\u30E6\u30FC\u30B6\u30FC",entryId:"\u9805\u76EE",displayName:"\u8868\u793A\u540D",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",groupKey:"\u30B0\u30EB\u30FC\u30D7\u30AD\u30FC",name:"\u540D\u524D",provider:"\u9023\u643A\u30D7\u30ED\u30D0\u30A4\u30C0",externalKey:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u30A2\u30C9\u30EC\u30B9",membershipMode:"\u6240\u5C5E\u306E\u5C55\u958B",isActive:"\u6709\u52B9",isSyncEnabled:"\u540C\u671F",pattern:"\u30D1\u30BF\u30FC\u30F3",type:"\u7A2E\u5225"},invalidAllowlistType:"\u8A31\u53EF\u30EA\u30B9\u30C8\u306E\u7A2E\u5225\u306F\u3001\u30A2\u30C9\u30EC\u30B9\u304B\u30C9\u30E1\u30A4\u30F3\u306E\u3044\u305A\u308C\u304B\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",unexpected:"\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u7406\u7531\u306F\u30B5\u30FC\u30D0\u30FC\u306E\u30ED\u30B0\u306B\u51FA\u3066\u3044\u307E\u3059\u3002",alreadyLinked:"{key} \u306F\u65E2\u306B {group} \u3068\u9023\u643A\u3057\u3066\u3044\u307E\u3059\u30021 \u3064\u306E\u4E0A\u6D41\u30B0\u30EB\u30FC\u30D7\u3092 2 \u3064\u306E\u30ED\u30FC\u30AB\u30EB\u30B0\u30EB\u30FC\u30D7\u3078\u7E4B\u3050\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002",forbidden:"\u3053\u306E\u64CD\u4F5C\u3092\u884C\u3046\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u4ECA\u306E\u6A29\u9650\u306F\u30D8\u30C3\u30C0\u30FC\u306E\u30D0\u30C3\u30B8\u306B\u51FA\u3066\u3044\u307E\u3059\u3002\u5FC5\u8981\u3067\u3042\u308C\u3070\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",requestTooLarge:"\u9001\u4FE1\u3055\u308C\u305F\u5185\u5BB9\u304C\u5927\u304D\u3059\u304E\u308B\u305F\u3081\u51E6\u7406\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},permissions:{label:"\u3042\u306A\u305F\u306E\u6A29\u9650:",canWrite:"\u7DE8\u96C6\u53EF",canRead:"\u95B2\u89A7\u306E\u307F",canDelete:"\u524A\u9664\u306E\u307F",none:"\u6A29\u9650\u306A\u3057",unknown:"\u6A29\u9650\u4E0D\u660E"},tabs:{users:"\u{1F464} \u30E6\u30FC\u30B6\u30FC\u4E00\u89A7",groups:"\u{1F465} \u30E6\u30FC\u30B6\u30FC\u30B0\u30EB\u30FC\u30D7",groupMembers:"\u{1F517} \u30B0\u30EB\u30FC\u30D7\u30E1\u30F3\u30D0\u30FC",allowlist:"\u2709\uFE0F \u30A2\u30AF\u30BB\u30B9\u8A31\u53EF\u30EA\u30B9\u30C8",directory:"\u{1F504} \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u9023\u643A"},usersView:{title:"\u30E6\u30FC\u30B6\u30FC\u7BA1\u7406",sortBy:"{column} \u3067\u4E26\u3079\u66FF\u3048",searchPlaceholder:"\u8868\u793A\u540D\u3084 Email \u3067\u691C\u7D22...",searchLabel:"\u30E6\u30FC\u30B6\u30FC\u3092\u691C\u7D22",addUser:"\uFF0B \u30E6\u30FC\u30B6\u30FC\u8FFD\u52A0",editUser:"\u30E6\u30FC\u30B6\u30FC\u7DE8\u96C6",displayName:"\u8868\u793A\u540D",email:"Email",active:"\u6709\u52B9",inactive:"\u7121\u52B9",activate:"\u6709\u52B9\u5316",deactivate:"\u7121\u52B9\u5316",editUserAria:"{user} \u3092\u7DE8\u96C6",activateAria:"{user} \u3092\u6709\u52B9\u5316",deactivateAria:"{user} \u3092\u7121\u52B9\u5316",emptyFiltered:"\u691C\u7D22\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u5229\u7528\u8005\u306F\u3044\u307E\u305B\u3093\u3002",listSummary:"{total} \u4EBA\u4E2D {shown} \u4EBA\u3092\u8868\u793A\u3057\u3066\u3044\u307E\u3059\u3002",sortedAscending:"{column} (\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048\u4E2D)\u3002\u62BC\u3059\u3068\u964D\u9806\u306B\u306A\u308A\u307E\u3059\u3002",sortedDescending:"{column} (\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048\u4E2D)\u3002\u62BC\u3059\u3068\u6607\u9806\u306B\u306A\u308A\u307E\u3059\u3002",confirmDeactivate:"{user} \u3092\u7121\u52B9\u5316\u3057\u307E\u3059\u304B\uFF1F \u4EE5\u5F8C\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",empty:"\u30E6\u30FC\u30B6\u30FC\u304C\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},groupsView:{emptyFiltered:"\u691C\u7D22\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u30B0\u30EB\u30FC\u30D7\u306F\u3042\u308A\u307E\u305B\u3093",createModeLabel:"\u4F5C\u6210\u65B9\u6CD5",createModeLocal:"\u30ED\u30FC\u30AB\u30EB\u306B\u4F5C\u6210",createModeUpstream:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u4F5C\u6210",pickUpstream:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7",pickUpstreamPlaceholder:"\u540D\u524D\u304B\u30A2\u30C9\u30EC\u30B9\u3067\u691C\u7D22...",upstreamOptionMembers:"{count} \u540D",upstreamAlreadyLinked:"{group} \u3068\u9023\u643A\u6E08\u307F",providerUnset:"\u3053\u306E\u914D\u5099\u306B\u306F\u9023\u643A\u30D7\u30ED\u30D0\u30A4\u30C0\u540D\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u9023\u643A\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u8A2D\u5B9A\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",pickUpstreamFirst:"\u5148\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",allUpstreamLinked:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u306F\u3059\u3079\u3066\u3001\u3044\u305A\u308C\u304B\u306E\u30ED\u30FC\u30AB\u30EB\u30B0\u30EB\u30FC\u30D7\u3068\u9023\u643A\u6E08\u307F\u3067\u3059\u30021 \u3064\u306E\u4E0A\u6D41\u30B0\u30EB\u30FC\u30D7\u3092\u7E4B\u3052\u308B\u5148\u306F 1 \u3064\u3060\u3051\u306A\u306E\u3067\u3001\u7E4B\u304E\u66FF\u3048\u308B\u306B\u306F\u3069\u308C\u304B\u306E\u9023\u643A\u3092\u89E3\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",catalogEmpty:"{at} \u6642\u70B9\u3067\u3001\u4E0A\u6D41\u306B\u30B0\u30EB\u30FC\u30D7\u304C 1 \u3064\u3082\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u4E0A\u6D41\u306B\u30B0\u30EB\u30FC\u30D7\u304C\u3067\u304D\u308B\u307E\u3067\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u4F5C\u6210\u306F\u3067\u304D\u307E\u305B\u3093\u3002",catalogUnavailable:"\u4E0A\u6D41\u3078\u5230\u9054\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30B0\u30EB\u30FC\u30D7\u4E00\u89A7\u3092\u51FA\u305B\u307E\u305B\u3093\u3002\u30A2\u30C9\u30EC\u30B9\u3092\u624B\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002({reason})",catalogUnavailableHere:"\u4E0A\u6D41\u3078\u5230\u9054\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u4F5C\u6210\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u30ED\u30FC\u30AB\u30EB\u306B\u4F5C\u6210\u3057\u305F\u3046\u3048\u3067\u3001\u9023\u643A\u30BF\u30D6\u304B\u3089\u9023\u643A\u3057\u3066\u304F\u3060\u3055\u3044\u3002({reason})",catalogObservedAt:"\u3053\u306E\u4E00\u89A7\u306F {at} \u6642\u70B9\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\u3002",catalogStale:"\u26A0 \u3053\u306E\u4E00\u89A7\u306F {at} \u6642\u70B9\u306E\u3082\u306E\u3067\u3001\u66F4\u65B0\u304C\u6EDE\u3063\u3066\u3044\u307E\u3059\u3002\u305D\u308C\u4EE5\u964D\u306B\u4F5C\u3089\u308C\u305F\u30B0\u30EB\u30FC\u30D7\u306F\u51FA\u3066\u304D\u307E\u305B\u3093\u3002",catalogFailures:{denied:"\u3053\u306E\u914D\u5099\u306E\u8CC7\u683C\u60C5\u5831\u304C\u4E0A\u6D41\u306B\u62D2\u5426\u3055\u308C\u307E\u3057\u305F",rateLimited:"\u4E0A\u6D41\u304C\u3053\u306E\u914D\u5099\u306E\u547C\u3073\u51FA\u3057\u3092\u5236\u9650\u3057\u3066\u3044\u307E\u3059",upstreamError:"\u4E0A\u6D41\u304C\u5185\u90E8\u30A8\u30E9\u30FC\u3092\u8FD4\u3057\u307E\u3057\u305F",neverObserved:"\u4E0A\u6D41\u3092\u307E\u3060\u4E00\u5EA6\u3082\u8AAD\u3081\u3066\u3044\u307E\u305B\u3093 (\u540C\u671F\u30B8\u30E7\u30D6\u304C\u52D5\u3044\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)",unknown:"\u7406\u7531\u306F\u30B5\u30FC\u30D0\u30FC\u306E\u30ED\u30B0\u306B\u51FA\u3066\u3044\u307E\u3059"},createUpstreamNotice:"\u30B0\u30EB\u30FC\u30D7\u306E\u4F5C\u6210\u3068\u9023\u643A\u3092 1 \u624B\u3067\u884C\u3044\u307E\u3059\u3002\u4EE5\u5F8C\u3001\u6240\u5C5E\u306F\u4E0A\u6D41\u304C\u6240\u6709\u3057 \u2014 \u3053\u306E\u753B\u9762\u304B\u3089\u306F\u540D\u79F0\u30FB\u8AAC\u660E\u306E\u5909\u66F4\u3082\u524A\u9664\u3082\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002\u623B\u3059\u624B\u6BB5\u306F\u9023\u643A\u89E3\u9664\u3060\u3051\u3067\u3001\u305D\u308C\u306F\u30E1\u30F3\u30D0\u30FC\u53F0\u5E33\u3068\u30B0\u30EB\u30FC\u30D7\u5358\u4F4D\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u3092\u6D88\u3057\u307E\u3059\u3002",openMembers:"\u30E1\u30F3\u30D0\u30FC",openMembersAria:"{group} \u306E\u30E1\u30F3\u30D0\u30FC\u3092\u8868\u793A",title:"\u30E6\u30FC\u30B6\u30FC\u30B0\u30EB\u30FC\u30D7\u7BA1\u7406",searchPlaceholder:"\u30B0\u30EB\u30FC\u30D7\u540D\u3084\u30AD\u30FC\u3067\u691C\u7D22...",searchLabel:"\u30B0\u30EB\u30FC\u30D7\u3092\u691C\u7D22",addGroup:"\uFF0B \u30B0\u30EB\u30FC\u30D7\u8FFD\u52A0",editGroup:"\u30B0\u30EB\u30FC\u30D7\u7DE8\u96C6",groupKey:"\u30B0\u30EB\u30FC\u30D7\u30AD\u30FC",name:"\u540D\u79F0",description:"\u8AAC\u660E",memberCountTemplate:"\u6240\u5C5E {count} \u540D",confirmDelete:"{group} \u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F \u6240\u5C5E {count} \u4EF6\u3082\u4E00\u7DD2\u306B\u6D88\u3048\u3001\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u3067\u3057\u304B\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u3044\u4EBA\u306F\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",confirmCreateLinked:"{group} \u3092\u4F5C\u6210\u3057\u3001\u305D\u306E\u6240\u5C5E\u3092 {upstream} \u306B\u59D4\u306D\u307E\u3059\u304B\uFF1F \u4EE5\u5F8C\u3053\u306E\u753B\u9762\u304B\u3089\u540D\u79F0\u5909\u66F4\u3068\u524A\u9664\u304C\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",editGroupAria:"{group} \u3092\u7DE8\u96C6",deleteGroupAria:"{group} \u3092\u524A\u9664",noDescription:"\u8AAC\u660E\u306A\u3057",groupKeyPlaceholder:"\u4F8B: dev-team",namePlaceholder:"\u4F8B: \u958B\u767A\u30C1\u30FC\u30E0",empty:"\u30E6\u30FC\u30B6\u30FC\u30B0\u30EB\u30FC\u30D7\u304C\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},groupMembersView:{title:"\u30B0\u30EB\u30FC\u30D7\u30E1\u30F3\u30D0\u30FC\u7BA1\u7406",searchLabel:"\u5229\u7528\u8005\u3092\u691C\u7D22",searchPlaceholder:"\u8868\u793A\u540D\u3084 Email \u3067\u691C\u7D22...",onlyMembers:"\u6240\u5C5E\u306E\u307F\u8868\u793A ({count} \u540D)",emptyFiltered:"\u691C\u7D22\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u5229\u7528\u8005\u306F\u3044\u307E\u305B\u3093",summary:"{total} \u540D\u306E\u3046\u3061 {shown} \u540D\u3092\u8868\u793A\u4E2D\u3002\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u306E\u6240\u5C5E\u306F {members} \u540D\u3067\u3059\u3002",selectGroup:"\u30B0\u30EB\u30FC\u30D7\u9078\u629E",selectPrompt:"\u30B0\u30EB\u30FC\u30D7\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",noGroups:"\u30B0\u30EB\u30FC\u30D7\u304C\u307E\u3060 1 \u3064\u3082\u3042\u308A\u307E\u305B\u3093\u3002\u5148\u306B\u30B0\u30EB\u30FC\u30D7\u30BF\u30D6\u3067\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",emptyNoMembers:"\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u306B\u306F\u307E\u3060\u30E1\u30F3\u30D0\u30FC\u304C\u3044\u307E\u305B\u3093\u3002\u300C\u6240\u5C5E\u306E\u307F\u8868\u793A\u300D\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5916\u3059\u3068\u8FFD\u52A0\u3067\u304D\u307E\u3059\u3002",noUsers:"\u5229\u7528\u8005\u304C\u307E\u3060 1 \u4EBA\u3082\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5148\u306B\u30E6\u30FC\u30B6\u30FC\u30BF\u30D6\u3067\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",deepLinkMissed:"\u30B0\u30EB\u30FC\u30D7 {id} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F (\u524A\u9664\u3055\u308C\u305F\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)\u3002\u4EE3\u308F\u308A\u306B {group} \u3092\u8868\u793A\u3057\u3066\u3044\u307E\u3059\u3002",actionAdd:"\u8FFD\u52A0",actionRemove:"\u9664\u5916",actionAddAria:"{user} \u3092\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u3078\u8FFD\u52A0",actionRemoveAria:"{user} \u3092\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u9664\u5916",upstreamNotice:"\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u306E\u6240\u5C5E\u306F\u4E0A\u6D41\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u6240\u6709\u3057\u3066\u3044\u307E\u3059\u3002\u5909\u66F4\u306F\u4E0A\u6D41\u3067\u884C\u3063\u3066\u304F\u3060\u3055\u3044 (\u3053\u3053\u3067\u5909\u3048\u3066\u3082\u6B21\u306E\u540C\u671F\u3067\u5143\u306B\u623B\u308A\u307E\u3059)\u3002",membersOfTemplate:"{group} \u306E\u6240\u5C5E\u30E1\u30F3\u30D0\u30FC",groupKeyLabel:"\u30B0\u30EB\u30FC\u30D7\u30AD\u30FC"},allowlistView:{title:"\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u30EA\u30B9\u30C8",addEntry:"\uFF0B \u30D1\u30BF\u30FC\u30F3\u8FFD\u52A0",pattern:"\u30D1\u30BF\u30FC\u30F3 (\u4F8B: @example.com \u307E\u305F\u306F user@example.com)",type:"\u7A2E\u5225",emailType:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u5B8C\u5168\u4E00\u81F4",domainType:"\u30C9\u30E1\u30A4\u30F3\u4E00\u81F4",emailTypeShort:"\u30E1\u30FC\u30EB",domainTypeShort:"\u30C9\u30E1\u30A4\u30F3",groupTypeShort:"\u30B0\u30EB\u30FC\u30D7",target:"\u5BFE\u8C61",description:"\u8AAC\u660E / \u5099\u8003",deploymentOwner:"\u914D\u5099\u5171\u901A",confirmDelete:"{target} \u3092\u8A31\u53EF\u30EA\u30B9\u30C8\u304B\u3089\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F \u3053\u308C\u3067\u3057\u304B\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u3044\u4EBA\u306F\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",deleteAria:"{target} \u306E\u8A31\u53EF\u3092\u524A\u9664",empty:"\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u30EA\u30B9\u30C8\u306B\u767B\u9332\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},directoryView:{title:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540C\u671F",membershipMode:"\u6240\u5C5E\u306E\u5C55\u958B",directMode:"\u76F4\u63A5\u6240\u5C5E\u306E\u307F",transitiveMode:"\u5165\u308C\u5B50\u3092\u5C55\u958B",lastSynced:"\u6700\u7D42\u540C\u671F",neverSynced:"\u672A\u5B9F\u884C",unresolvedTemplate:"{count} \u4EF6\u304C\u672A\u89E3\u6C7A",syncPaused:"\u505C\u6B62\u4E2D",syncEnabled:"\u6709\u52B9",syncNow:"\u4ECA\u3059\u3050\u540C\u671F",syncQueued:"\u540C\u671F\u3092\u8981\u6C42\u3057\u307E\u3057\u305F",syncAlreadyPending:"\u3053\u306E\u7BC4\u56F2\u306E\u540C\u671F\u8981\u6C42\u306F\u65E2\u306B\u5F85\u6A5F\u4E2D\u306E\u305F\u3081\u3001\u65B0\u3057\u304F\u306F\u7A4D\u307F\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3044\u3064\u307E\u3067\u3082\u5B8C\u4E86\u3057\u306A\u3044\u5834\u5408\u3001\u540C\u671F\u30B8\u30E7\u30D6\u304C\u52D5\u3044\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",linkSyncNotQueued:"\u9023\u643A\u306F\u4F5C\u6210\u3057\u307E\u3057\u305F\u304C\u3001\u540C\u671F\u8981\u6C42\u3092\u7A4D\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u9023\u643A\u30BF\u30D6\u306E\u300C\u4ECA\u3059\u3050\u540C\u671F\u300D\u3067\u8981\u6C42\u3057\u3066\u304F\u3060\u3055\u3044\u3002",staleWarning:"\u540C\u671F\u304C\u6EDE\u3063\u3066\u3044\u307E\u3059\u3002\u5B9F\u884C\u3055\u308C\u308B\u307E\u3067\u3001\u4E0A\u6D41\u304B\u3089\u5916\u308C\u305F\u4EBA\u306E\u30A2\u30AF\u30BB\u30B9\u306F\u6B8B\u308A\u7D9A\u3051\u307E\u3059\u3002",disabledWarning:"\u3053\u306E\u914D\u5099\u3067\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540C\u671F\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u65E2\u5B58\u306E\u6240\u5C5E\u306F\u305D\u306E\u307E\u307E\u6709\u52B9\u3067\u3001\u66F4\u65B0\u3060\u3051\u304C\u6B62\u307E\u3063\u3066\u3044\u307E\u3059\u3002",pausedTemplate:"\u9023\u643A {total} \u4EF6\u306E\u3046\u3061 {paused} \u4EF6\u304C\u505C\u6B62\u4E2D",erroredTemplate:"\u76F4\u8FD1\u306E\u540C\u671F\u306B\u5931\u6557\u3057\u305F\u30B0\u30EB\u30FC\u30D7: {groups}",erroredItemTemplate:"{group}: {reason}",listSeparator:" / ",oldestSyncedTemplate:"\u6700\u3082\u53E4\u3044\u540C\u671F\u6210\u529F: {at}",pendingTemplate:"{count} \u4EF6\u306E\u540C\u671F\u8981\u6C42\u304C\u672A\u51E6\u7406",nothingToLink:"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u304C\u65E2\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3068\u9023\u643A\u3057\u3066\u3044\u307E\u3059\u3002",noGroupsToLink:"\u30B0\u30EB\u30FC\u30D7\u304C\u307E\u3060 1 \u3064\u3082\u3042\u308A\u307E\u305B\u3093\u3002\u5148\u306B\u30B0\u30EB\u30FC\u30D7\u30BF\u30D6\u3067\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",notWiredNotice:"\u3053\u306E\u914D\u5099\u3067\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540C\u671F\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u3053\u3053\u304B\u3089\u9023\u643A\u306E\u4F5C\u6210\u30FB\u5909\u66F4\u306F\u3067\u304D\u307E\u305B\u3093\u3002",syncNowAria:"{group} \u3092\u4ECA\u3059\u3050\u540C\u671F",syncQueuedAria:"{group} \u306E\u540C\u671F\u3092\u8981\u6C42\u6E08\u307F",pauseAria:"{group} \u306E\u540C\u671F\u3092\u4E00\u6642\u505C\u6B62",resumeAria:"{group} \u306E\u540C\u671F\u3092\u518D\u958B",allowGroupAria:"{group} \u306E\u30E1\u30F3\u30D0\u30FC\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u3092\u8A31\u53EF",disallowGroupAria:"{group} \u306E\u30E1\u30F3\u30D0\u30FC\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u3092\u5916\u3059",unlinkAria:"{group} \u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u9023\u643A\u3092\u89E3\u9664",confirmDisallow:"{group} \u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u3092\u5916\u3057\u307E\u3059\u304B\uFF1F \u3053\u308C\u3067\u3057\u304B\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u3044\u4EBA\u306F\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",link:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u3068\u9023\u643A\u3059\u308B",unlink:"\u9023\u643A\u3092\u89E3\u9664",externalKey:"\u4E0A\u6D41\u30B0\u30EB\u30FC\u30D7",empty:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3068\u9023\u643A\u3057\u3066\u3044\u308B\u30B0\u30EB\u30FC\u30D7\u306F\u3042\u308A\u307E\u305B\u3093",selectGroup:"\u9023\u643A\u3059\u308B\u30B0\u30EB\u30FC\u30D7",pickUpstreamPlaceholder:"\u540D\u524D\u304B\u30A2\u30C9\u30EC\u30B9\u3067\u691C\u7D22...",pickerNoOptions:"\u4E00\u81F4\u3059\u308B\u30B0\u30EB\u30FC\u30D7\u304C\u3042\u308A\u307E\u305B\u3093",pickerClear:"\u9078\u629E\u3092\u89E3\u9664",pickerToggle:"\u30B0\u30EB\u30FC\u30D7\u4E00\u89A7\u3092\u958B\u304F",pickerSelected:"\u9078\u629E\u4E2D: {value}",externalKeyPlaceholder:"\u4F8B: dev-team@example.com",confirmLink:"{group} \u306E\u6240\u5C5E\u3092 {upstream} \u306B\u59D4\u306D\u307E\u3059\u304B\uFF1F \u4EE5\u5F8C\u3053\u306E\u753B\u9762\u304B\u3089\u540D\u79F0\u5909\u66F4\u30FB\u524A\u9664\u30FB\u30E1\u30F3\u30D0\u30FC\u7DE8\u96C6\u304C\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",confirmUnlink:"{group} \u3068 {upstream} \u306E\u9023\u643A\u3092\u89E3\u9664\u3057\u307E\u3059\u304B\uFF1F \u30E1\u30F3\u30D0\u30FC\u53F0\u5E33\u3068\u30B0\u30EB\u30FC\u30D7\u5358\u4F4D\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u304C\u5931\u308F\u308C\u307E\u3059\u3002",pause:"\u4E00\u6642\u505C\u6B62",resume:"\u518D\u958B",allowGroup:"\u30B5\u30A4\u30F3\u30A4\u30F3\u3092\u8A31\u53EF",disallowGroup:"\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u3092\u5916\u3059",groupOptionTemplate:"{name} ({key})"}};function ot(e){if(e===void 0)return Q.locale;try{return rt(e)}catch(o){throw o instanceof RangeError?new RangeError(`[auth-react-router] labels.locale is the UI language, not a BCP 47 tag (dates and sorting read labels.formatLocale): ${o.message}`,{cause:o}):o}}function Le(e){let o=Q;return e?{title:e.title??o.title,locale:ot(e.locale),formatLocale:e.formatLocale??o.formatLocale,timeZone:e.timeZone??o.timeZone,heading:e.heading??o.heading,common:{...o.common,...e.common},errors:{...o.errors,...e.errors},permissions:{...o.permissions,...e.permissions},tabs:{...o.tabs,...e.tabs},usersView:{...o.usersView,...e.usersView},groupsView:{...o.groupsView,...e.groupsView},groupMembersView:{...o.groupMembersView,...e.groupMembersView},allowlistView:{...o.allowlistView,...e.allowlistView},directoryView:{...o.directoryView,...e.directoryView}}:o}import{data as le}from"react-router";function x(e,o){return e.replace(/\{(\w+)\}/g,(n,p)=>Object.hasOwn(o,p)?String(o[p]):n)}function te(e,o){let n=/(?:Z|[+-]\d{2}:?\d{2})$/.test(e)?e:`${e}Z`;try{return new Intl.DateTimeFormat(o.formatLocale,{timeZone:o.timeZone,dateStyle:"medium",timeStyle:"short"}).format(new Date(n))}catch{return e}}function Ot(e){let o=e?.users??[{id:1,email:"admin@example.com",displayName:"\u30B7\u30B9\u30C6\u30E0\u7BA1\u7406\u8005",isActive:!0},{id:2,email:"user1@example.com",displayName:"\u958B\u767A \u592A\u90CE",isActive:!0},{id:3,email:"user2@example.com",displayName:"\u55B6\u696D \u82B1\u5B50",isActive:!0}],n=e?.groups??[{id:1,groupKey:"dev-team",name:"\u958B\u767A\u30C1\u30FC\u30E0",description:"\u30B7\u30B9\u30C6\u30E0\u958B\u767A\u62C5\u5F53\u30B0\u30EB\u30FC\u30D7",isActive:!0,readOnly:!1},{id:2,groupKey:"sales-dept",name:"\u55B6\u696D\u90E8",description:"\u55B6\u696D\u30BD\u30EA\u30E5\u30FC\u30B7\u30E7\u30F3\u62C5\u5F53",isActive:!0,readOnly:!1}],p=e?.groupMembers??[{id:1,groupId:1,userId:2},{id:2,groupId:2,userId:3}],d=e?.allowlist??[{id:1,pattern:"admin@example.com",type:"email",description:"\u521D\u671F\u7BA1\u7406\u8005",owner:{kind:"tenant",tenantId:"default"},readOnly:!1},{id:2,pattern:"@example.com",type:"domain",description:"\u793E\u5185\u30C9\u30E1\u30A4\u30F3",owner:{kind:"tenant",tenantId:"default"},readOnly:!1}];return{async listUsers(){return[...o]},async createUser(r){let i={id:Math.max(...o.map(y=>y.id),0)+1,email:r.email,displayName:r.displayName,isActive:!0};return o.push(i),i},async updateUser(r,i){let y=o.findIndex(w=>w.id===r);if(y===-1)throw new W(`User not found: ${r}`);return o[y]={...o[y],displayName:i.displayName,email:i.email},o[y]},async toggleUserActive(r,i){let y=o.findIndex(w=>w.id===r);if(y===-1)throw new W(`User not found: ${r}`);return o[y]={...o[y],isActive:i},o[y]},async listGroups(){return[...n]},async createGroup(r){let i={id:Math.max(...n.map(y=>y.id),0)+1,groupKey:r.groupKey,name:r.name,description:r.description,isActive:!0,readOnly:!1};return n.push(i),i},async updateGroup(r,i){let y=n.findIndex(w=>w.id===r);if(y===-1)throw new W(`Group not found: ${r}`);return n[y]={...n[y],name:i.name,description:i.description},n[y]},async deleteGroup(r){n=n.filter(i=>i.id!==r),p=p.filter(i=>i.groupId!==r)},async listGroupMembers(){return[...p]},async addGroupMember(r,i){let y=p.find(U=>U.groupId===r&&U.userId===i);if(y)return y;let w={id:Math.max(...p.map(U=>U.id),0)+1,groupId:r,userId:i};return p.push(w),w},async removeGroupMember(r,i){p=p.filter(y=>!(y.groupId===r&&y.userId===i))},async listAllowlist(){return[...d]},async addAllowlistEntry(r){let i={id:Math.max(...d.map(y=>y.id),0)+1,pattern:r.pattern,type:r.type,description:r.description,owner:{kind:"tenant",tenantId:"default"},readOnly:!1};return d.push(i),i},async removeAllowlistEntry(r){d=d.filter(i=>i.id!==r)},async addAllowlistGroup(r,i){let y=n.find(w=>w.id===r);if(!y)throw new W(`Group not found: ${r}`);d=[...d,{id:Math.max(...d.map(w=>w.id),0)+1,type:"group",groupId:r,groupKey:y.groupKey,groupName:y.name,description:i,owner:{kind:"tenant",tenantId:"default"},readOnly:!1}]},async removeAllowlistGroup(r){d=d.filter(i=>!(i.type==="group"&&i.id===r))},async linkDirectoryGroup(){throw new W("This in-memory store has no upstream directory; inject a real store to link groups.")},async createLinkedGroup(){throw new W("This in-memory store has no upstream directory; inject a real store to create a linked group.")},async unlinkDirectoryGroup(){throw new W("This in-memory store has no upstream directory; inject a real store to unlink groups.")},async setDirectorySyncEnabled(){throw new W("This in-memory store has no upstream directory; inject a real store to pause synchronization.")},async requestDirectorySync(){throw new W("This in-memory store has no upstream directory; inject a real store to request a sync.")},async getDirectoryStatus(){return{isEnabled:!1,provider:"",linkedGroupCount:0,isStale:!1,pausedGroupCount:0,stalenessThresholdSec:0,erroredGroupIds:[],pendingRequestCount:0}}}}function it(e,o){let n=Number.isFinite(o)&&o>0?o:at;return(Date.now()-e.getTime())/1e3>n}var nt=64*1024,at=5400;async function Ge(e,o,n,p){if(!e)return{kind:"not-wired"};if(!o)return{kind:"not-wired"};try{let{groups:d,observedAt:r}=await e.listGroups(n);return r===null||!Number.isFinite(r.getTime())?{kind:"unavailable",reason:"neverObserved"}:{kind:"ready",groups:d,observedAt:r.toISOString(),isStale:it(r,p)}}catch(d){return console.error("[@aiquants/auth-react-router] directoryCatalog.listGroups failed; the picker falls back to manual entry:",d),{kind:"unavailable",reason:pt(d)}}}function O(e){return e.trim().toLowerCase()}var W=class extends Error{constructor(n){super(n);this.operatorFacing=!0;this.name="UserAdminOperatorError"}};function st(e){return e instanceof W||typeof e=="object"&&e!==null&&e.operatorFacing===!0&&e instanceof Error}var $=class extends Error{constructor(n,p={}){super(n);this.labelKey=n;this.values=p;this.name="UserAdminInputError"}};function Me(e){return typeof e=="object"&&e!==null&&e.status===403}function lt(e){let o=String(e.get("type")??"");if(o==="email"||o==="domain")return o;throw new $("invalidAllowlistType")}var dt=["users","groups","group_members","allowlist","directory"];function ut(e){let o=e.replace(/\.data$/,"").split("/").filter(Boolean),n=o[o.length-1]??"";return dt.includes(n)?n:"users"}var ge=new Map([["createUser",["create"]],["updateUser",["update"]],["toggleUserActive",["update"]],["createGroup",["create"]],["updateGroup",["update"]],["deleteGroup",["delete"]],["addGroupMember",["create"]],["removeGroupMember",["delete"]],["addAllowlistEntry",["create"]],["removeAllowlistEntry",["delete"]],["addAllowlistGroup",["create"]],["removeAllowlistGroup",["delete"]],["createLinkedGroup",["create","update","delete"]],["linkDirectoryGroup",["update","create","delete"]],["unlinkDirectoryGroup",["update","delete"]],["setDirectorySyncEnabled",["update"]],["requestDirectorySync",["update"]],["catalog",["update","create","delete"]]]),Re="read";function qt(){return[...ge.keys()]}function Bt(e){return ge.get(e)??[]}function pt(e){let o=typeof e=="object"&&e!==null&&"status"in e?e.status:void 0;return typeof o!="number"?"unknown":o===401||o===403?"denied":o===429?"rateLimited":o>=500?"upstreamError":"unknown"}function F(e,o){let n=e.get(o),p=Number(n);if(n===null||String(n).trim()===""||!Number.isInteger(p)||p<=0)throw new $("invalidField",{field:o});return p}function K(e,o){let n=String(e.get(o)??"").trim();if(n==="")throw new $("invalidField",{field:o});return n}function ct(e,o){let n=String(e.get(o)??"");if(n!=="true"&&n!=="false")throw new $("invalidField",{field:o});return n==="true"}function Te(e){let o=String(e.get("membershipMode")??"");if(o!=="direct"&&o!=="transitive")throw new $("invalidField",{field:"membershipMode"});return o}function de(e,o){let n=String(e.get(o)??"").trim();return n===""?void 0:n}function Kt(e){let o=Le(e.labels);async function n(g){if(!e.resolveActor)return"user-admin";try{return await e.resolveActor(g)||"user-admin"}catch(a){return console.error("[@aiquants/auth-react-router] resolveActor failed; recording the request as an unnamed actor:",a),"user-admin"}}async function p(g,a){try{return await e.store.requestDirectorySync(g,await n(a))}catch(l){return console.error(`[@aiquants/auth-react-router] the link for group ${g} was created, but its sync request could not be queued:`,l),"not-queued"}}async function d(g){if(!e.directoryCatalog)return!1;let a=ge.get("catalog");if(a===void 0||a.length===0)return!1;try{for(let l of a)await e.guards.requireAccess(g,{action:l,intent:"catalog"});return!0}catch(l){try{e.guards.onDenied?.({intent:"catalog",actions:a,error:l})}catch(b){console.error("[@aiquants/auth-react-router] onDenied threw; the denial itself still stands:",b)}return!1}}async function r(g){try{await e.guards.requireAccess(g,{action:Re,intent:"loader"})}catch(a){if(a instanceof Response||!Me(a))throw a;try{e.guards.onDenied?.({intent:"loader",actions:[Re],error:a})}catch(l){console.error("[@aiquants/auth-react-router] onDenied threw; the denial itself still stands:",l)}throw le(o.errors.forbidden,{status:403,statusText:"Forbidden"})}}async function i({request:g}){await r(g);let a=ut(new URL(g.url).pathname),l=(a==="groups"||a==="directory")&&await d(g),[b,C,L,f,h,G]=await Promise.all([e.store.listUsers(),e.store.listGroups(),e.store.listGroupMembers(),e.store.listAllowlist(),e.store.getDirectoryStatus(),e.getMyPermissions?e.getMyPermissions(g).catch(M=>(console.error("[@aiquants/auth-react-router] getMyPermissions failed; rendering the permission badge as unknown:",M),null)):Promise.resolve(null)]),V=await Ge(e.directoryCatalog,l,g,h.stalenessThresholdSec);return{resourceLabels:e.resourceLabels,segment:a,users:b,groups:C,groupMembers:L,allowlist:f,directoryStatus:h,myPermissions:G,catalog:V,labels:o}}async function y({request:g}){let a=Number(g.headers.get("content-length")??Number.NaN);if(Number.isFinite(a)&&a>nt)return le({ok:!1,error:o.errors.requestTooLarge},{status:413});let l=await g.formData(),b=String(l.get("intent")??""),C=ge.get(b);if(!C)return le({ok:!1,error:o.errors.unknownIntent},{status:400});let L=h=>Me(h),f=h=>{try{e.guards.onDenied?.({intent:b,actions:C,error:h})}catch{}return le({ok:!1,error:o.errors.forbidden},{status:403})};try{for(let h of C)await e.guards.requireAccess(g,{action:h,intent:b})}catch(h){if(!L(h))throw h;return f(h)}try{return await A(b,l,g)}catch(h){if(L(h))return f(h);if(h instanceof Response)throw h;if(h instanceof $){let G=h.values.field,V=typeof G=="string"?{...h.values,field:o.errors.fieldNames[G]??G}:h.values,M=o.errors[h.labelKey];return{ok:!1,error:x(typeof M=="string"?M:String(h.labelKey),V)}}return console.error(`[@aiquants/auth-react-router] intent "${b}" failed:`,h),{ok:!1,error:st(h)?h.message:o.errors.unexpected}}}function w(g,a,l){let b=String(g.get("externalId")??"").trim();if(l.kind==="ready"){if(b!==""&&l.groups.some(f=>f.externalId===b))return b;let C=O(a),L=l.groups.find(f=>O(f.externalKey)===C);if(L)return L.externalId}return b===""?a:b}function U(g){let a=g.provider.trim();if(!g.isEnabled||a==="")throw new $("directoryDisabled");return a}async function v(g,a){let l=O(g),b=O(a),L=(await e.store.listGroups()).find(f=>f.externalLink!==void 0&&(O(f.externalLink.externalId)===l||O(f.externalLink.externalKey)===b));if(L)throw new $("alreadyLinked",{key:a,group:L.name})}function R(g,a,l){if(l.kind!=="ready")return;let b=O(g),C=O(a);if(!l.groups.some(L=>O(L.externalId)===b&&O(L.externalKey)===C))throw new $("unknownUpstream",{key:a})}async function A(g,a,l){let b=null,C=async()=>(b??(b=await e.store.getDirectoryStatus()),b),L=async()=>Ge(e.directoryCatalog,!0,l,(await C()).stalenessThresholdSec);if(g==="createUser")return await e.store.createUser({displayName:K(a,"displayName"),email:K(a,"email")}),{ok:!0};if(g==="updateUser")return await e.store.updateUser(F(a,"userId"),{displayName:K(a,"displayName"),email:K(a,"email")}),{ok:!0};if(g==="toggleUserActive"){let f=String(a.get("isActive")??"");if(f!=="true"&&f!=="false")throw new $("invalidField",{field:"isActive"});return await e.store.toggleUserActive(F(a,"userId"),f==="true"),{ok:!0}}if(g==="createGroup")return await e.store.createGroup({groupKey:K(a,"groupKey"),name:K(a,"name"),description:de(a,"description")}),{ok:!0};if(g==="updateGroup")return await e.store.updateGroup(F(a,"groupId"),{name:K(a,"name"),description:de(a,"description")}),{ok:!0};if(g==="deleteGroup")return await e.store.deleteGroup(F(a,"groupId")),{ok:!0};if(g==="addGroupMember")return await e.store.addGroupMember(F(a,"groupId"),F(a,"userId")),{ok:!0};if(g==="removeGroupMember")return await e.store.removeGroupMember(F(a,"groupId"),F(a,"userId")),{ok:!0};if(g==="addAllowlistEntry"){let f=lt(a);return await e.store.addAllowlistEntry({pattern:K(a,"pattern"),type:f,description:de(a,"description")}),{ok:!0}}if(g==="addAllowlistGroup")return await e.store.addAllowlistGroup(F(a,"groupId"),de(a,"description")),{ok:!0};if(g==="removeAllowlistGroup")return await e.store.removeAllowlistGroup(F(a,"entryId")),{ok:!0};if(g==="createLinkedGroup"){let f=K(a,"externalKey"),h=U(await C()),G=await L(),V=w(a,f,G);await v(V,f),R(V,f,G);let M=await e.store.createLinkedGroup({groupKey:K(a,"groupKey"),name:K(a,"name"),description:de(a,"description"),provider:h,externalId:V,externalKey:f,membershipMode:Te(a)});return{ok:!0,syncRequest:await p(M.id,l)}}if(g==="linkDirectoryGroup"){let f=K(a,"externalKey"),h=U(await C()),G=await L(),V=w(a,f,G);await v(V,f),R(V,f,G);let M=F(a,"groupId");return await e.store.linkDirectoryGroup(M,{provider:h,externalId:V,externalKey:f,membershipMode:Te(a)}),{ok:!0,syncRequest:await p(M,l)}}if(g==="unlinkDirectoryGroup")return await e.store.unlinkDirectoryGroup(F(a,"groupId")),{ok:!0};if(g==="setDirectorySyncEnabled")return await e.store.setDirectorySyncEnabled(F(a,"groupId"),ct(a,"isSyncEnabled")),{ok:!0};if(g==="requestDirectorySync"){let f=String(a.get("groupId")??"").trim();return{ok:!0,syncRequest:await e.store.requestDirectorySync(f===""?null:F(a,"groupId"),await n(l))}}return g==="removeAllowlistEntry"?(await e.store.removeAllowlistEntry(F(a,"entryId")),{ok:!0}):(console.error(`[@aiquants/auth-react-router] intent "${g}" is in the permission table but has no handler`),le({ok:!1,error:o.errors.unknownIntent},{status:400}))}return{loader:i,action:y}}import{useEffect as mt,useRef as gt}from"react";import{Link as yt,useLoaderData as bt,useRevalidator as ft}from"react-router";var S={minWidth:"44px",minHeight:"44px",boxSizing:"border-box"},ie={...S,display:"inline-flex",alignItems:"center"};var _="var(--aqau-font-size-body, 0.8125rem)",j="var(--aqau-line-height-body, 1.25rem)",xe="var(--aqau-font-size-caption, 0.6875rem)",ve="var(--aqau-line-height-caption, 1.25rem)";import{jsx as q,jsxs as re}from"react/jsx-runtime";var ht={intervalMs:3e3,maxMs:3e5};function wt(e,o){let n=ft(),p=gt(n.state);p.current=n.state;let{revalidate:d}=n,{intervalMs:r,maxMs:i}=o;mt(()=>{if(e<=0)return;let y=Date.now(),w=setInterval(()=>{if(Date.now()-y>=i){clearInterval(w);return}p.current==="idle"&&d()},r);return()=>clearInterval(w)},[e,r,i,d])}function Ee({label:e,summary:o}){return re("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.18rem",fontSize:xe,padding:"0.08rem 0.35rem",borderRadius:"9999px",backgroundColor:o.bgColor,color:o.color,border:`1px solid ${o.borderColor}`,fontWeight:600,lineHeight:ve},children:[re("span",{children:[e,":"]}),q("span",{children:o.text})]})}function xt({status:e,labels:o,groups:n}){if(!e||e.linkedGroupCount===0)return null;let p=o.directoryView,d=[];if(e.isEnabled||d.push({id:"disabled",text:p.disabledWarning}),e.pausedGroupCount>0&&d.push({id:"paused",text:x(p.pausedTemplate,{paused:e.pausedGroupCount,total:e.linkedGroupCount})}),e.isStale){let r=e.oldestSyncedAt?te(e.oldestSyncedAt,o):p.neverSynced;d.push({id:"stale",text:`${p.staleWarning} ${x(p.oldestSyncedTemplate,{at:r})}`})}if(e.erroredGroupIds.length>0){let r=e.erroredGroupIds.map(i=>{let y=n.find(U=>U.id===i);if(!y)return x(o.common.idTemplate,{id:i});let w=y.externalLink?.syncError;return w?x(p.erroredItemTemplate,{group:y.name,reason:w}):y.name});d.push({id:"errored",text:x(p.erroredTemplate,{groups:r.join(p.listSeparator)})})}return e.pendingRequestCount>0&&d.push({id:"pending",text:x(p.pendingTemplate,{count:e.pendingRequestCount})}),d.length===0?null:re("section",{"aria-labelledby":"directory-sync-heading","data-testid":"directory-sync-banner",style:{display:"flex",flexDirection:"column",gap:"0.35rem",padding:"0.7rem 1rem",marginBottom:"1rem",borderRadius:"6px",border:"1px solid #fde68a",backgroundColor:"#fffbeb",color:"#92400e",fontSize:"0.85rem"},children:[q("h2",{id:"directory-sync-heading",style:{margin:0,fontSize:"0.9rem",fontWeight:700},children:p.title}),d.map(r=>q("span",{"data-directory-warning":r.id,children:r.text},r.id))]})}function Ve({children:e,renderHeader:o,pendingSyncPolling:n,basePath:p}){let d=bt();wt(d?.directoryStatus?.pendingRequestCount??0,n??ht);let r=d?.segment??"users",i=d?.labels??Q,y=d?.myPermissions??null,w=d?.resourceLabels??{},U=b=>Object.hasOwn(w,b)?w[b]:b,v=[{key:"users",label:i.tabs.users,href:p},{key:"groups",label:i.tabs.groups,href:`${p}/groups`},{key:"group_members",label:i.tabs.groupMembers,href:`${p}/group_members`},{key:"allowlist",label:i.tabs.allowlist,href:`${p}/allowlist`}],R=(d?.groups??[]).some(b=>b.externalLink);(d?.directoryStatus?.isEnabled||(d?.directoryStatus?.linkedGroupCount??0)>0||R)&&v.push({key:"directory",label:i.tabs.directory,href:`${p}/directory`});let A=Object.entries(y??{}),g={text:i.permissions.unknown,color:"#92400e",bgColor:"#fffbeb",borderColor:"#fde68a"},a=b=>b===void 0?g:b.canWrite?{text:i.permissions.canWrite,color:"#047857",bgColor:"#ecfdf5",borderColor:"#a7f3d0"}:b.canRead?{text:i.permissions.canRead,color:"#1d4ed8",bgColor:"#eff6ff",borderColor:"#bfdbfe"}:b.canDelete?{text:i.permissions.canDelete,color:"#b91c1c",bgColor:"#fef2f2",borderColor:"#fecaca"}:{text:i.permissions.none,color:"#475569",bgColor:"#f1f5f9",borderColor:"#cbd5e1"},l=re("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem"},"data-testid":"user-admin-header-annotation",children:[q("span",{style:{fontSize:"0.75rem",backgroundColor:"#e0f2fe",color:"#0369a1",padding:"2px 8px",borderRadius:"12px",fontWeight:600},children:i.heading}),re("div",{style:{display:"inline-flex",alignItems:"center",gap:"0.25rem",fontSize:xe,lineHeight:ve,color:"#475569"},"data-testid":"user-admin-permissions-badge",children:[q("span",{style:{fontWeight:600,color:"#334155"},children:i.permissions.label}),q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.18rem"},children:A.length===0?q("span",{"data-testid":"user-admin-permission-unavailable",children:q(Ee,{label:i.heading,summary:g})}):A.map(([b,C])=>q(Ee,{label:U(b),summary:a(C)},b))})]})]});return re("div",{"data-testid":"user-admin-shell",style:{width:"100%",minHeight:"100vh",backgroundColor:"#f8fafc",padding:"1.5rem",boxSizing:"border-box"},children:[o?o({title:i.title,annotation:l}):re("div",{style:{marginBottom:"1.5rem",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[q("h1",{style:{margin:0,fontSize:"1.5rem",fontWeight:700,color:"#0f172a"},children:i.title}),l]}),q("nav",{"aria-label":i.title,style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",marginBottom:"1.2rem",borderBottom:"2px solid #e2e8f0",paddingBottom:"0.5rem"},children:v.map(b=>{let C=r===b.key;return q(yt,{to:b.href,"data-testid":`user-admin-tab-${b.key}`,"aria-current":C?"page":void 0,style:{...ie,padding:"0.5rem 1rem",borderRadius:"6px 6px 0 0",fontSize:"0.88rem",fontWeight:C?700:500,color:C?"#0284c7":"#64748b",backgroundColor:C?"#ffffff":"transparent",textDecoration:"none",borderBottom:C?"3px solid #0284c7":"3px solid transparent",transition:"all 0.15s ease"},children:b.label},b.key)})}),q(xt,{status:d?.directoryStatus,labels:i,groups:d?.groups??[]}),q("main",{children:e})]})}import{SelectBox as Ne}from"@aiquants/select-box";import De,{useEffect as ze,useMemo as ne,useRef as oe,useState as P}from"react";import{Link as vt,useFetcher as ue,useLoaderData as se,useSearchParams as kt}from"react-router";import{Fragment as ke,jsx as t,jsxs as c}from"react/jsx-runtime";function Z({result:e,id:o}){let n=e;return n?.ok!==!1||!n.error?null:t("div",{id:o,"data-testid":"user-admin-action-error",role:"alert",style:{padding:"0.7rem 1rem",borderRadius:"6px",border:"1px solid #fecaca",backgroundColor:"#fef2f2",color:"#b91c1c",fontSize:"0.85rem"},children:n.error})}function pe(e){let o=oe(null),[n,p]=P(void 0),d=e.data===n?void 0:e.data;return ze(()=>{if(e.state!=="idle"||e.data===void 0)return;let y=o.current;y&&(o.current=null,e.data.ok===!0&&y(e.data))},[e.state,e.data]),{submit:(y,w)=>{o.current=w??null,p(void 0),e.submit(y,{method:"post"})},resetResult:()=>p(e.data),result:d}}function be(e,o,n){let p=oe(null),d=oe(o);return d.current=o,ze(()=>{if(!e)return;let r=p.current,i=n?.current??document.activeElement,y=()=>{let v=Array.from(r?.querySelectorAll('a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])')??[]).filter(A=>!(A.disabled||A.hasAttribute("inert"))&&A.closest("[inert]")===null&&A.getAttribute("aria-hidden")!=="true"),R=new Set;return v.filter(A=>{let g=A instanceof HTMLInputElement&&A.type==="radio"?A:null;return!g||g.name===""?!0:!g.checked&&v.some(a=>a instanceof HTMLInputElement&&a.type==="radio"&&a.name===g.name&&a.checked)||R.has(g.name)?!1:(R.add(g.name),!0)})},w=y();(w.find(v=>!v.hasAttribute("data-aqar-visually-hidden"))??w[0])?.focus();let U=v=>{if(v.key==="Escape"){if(v.isComposing||v.keyCode===229||v.defaultPrevented)return;v.preventDefault(),d.current();return}if(v.key!=="Tab")return;let R=y();if(R.length===0)return;let A=R[0],g=R[R.length-1],a=document.activeElement,l=!r?.contains(a);v.shiftKey&&(a===A||l)?(v.preventDefault(),g.focus()):!v.shiftKey&&(a===g||l)&&(v.preventDefault(),A.focus())};return document.addEventListener("keydown",U),()=>{document.removeEventListener("keydown",U),i?.focus?.()}},[e,n]),p}function Fe(e,o,n){return e.kind!=="ready"?[]:e.groups.map(p=>{let d=o.get(O(p.externalId))??o.get(O(p.externalKey)),r=d!==void 0,i=p.memberCount===void 0?"":x(n.groupsView.upstreamOptionMembers,{count:p.memberCount});return{label:x(n.directoryView.groupOptionTemplate,{name:p.name,key:p.externalKey}),value:p.externalId,note:r?x(n.groupsView.upstreamAlreadyLinked,{group:d}):i,...r?{disabled:!0}:{},entry:p}})}function Oe({observedAt:e,isStale:o,labels:n}){return t("p",{"data-testid":"catalog-freshness","data-stale":o?"":void 0,style:{margin:"0.35rem 0 0 0",fontSize:"0.72rem",color:o?"#92400e":"#64748b"},children:x(o?n.groupsView.catalogStale:n.groupsView.catalogObservedAt,{at:te(e,n)})})}function fe(e){return typeof e=="object"&&e!==null&&e.ok===!1&&typeof e.error=="string"}var At={exact:{backgroundColor:"#d1fae5",color:"#064e3b",borderRadius:"2px"},fuzzy:{backgroundColor:"#fef3c7",color:"#78350f",borderRadius:"2px"}};function qe(e,o){if(typeof e!="object"||e===null)return null;let n=e.syncRequest;return n==="already-pending"?o.directoryView.syncAlreadyPending:n==="not-queued"?o.directoryView.linkSyncNotQueued:null}function Be(e){let o=new Map;for(let n of e){let p=n.externalLink;p&&(o.set(O(p.externalId),n.name),o.set(O(p.externalKey),n.name))}return o}function Ke(e,o){let{label:n,note:p}=e;return c("span",{"data-aqar-upstream-option":!0,title:p===""?n:`${n} \u2014 ${p}`,style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"0.75rem",width:"100%",minWidth:0},children:[t("span",{"data-aqar-upstream-option-label":!0,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.highlight(n).map((d,r)=>t("span",{"data-aqar-match":d.matchType==="none"?void 0:d.matchType,style:d.matchType==="none"?void 0:At[d.matchType],children:d.text},r))}),p===""?null:t("span",{"data-aqar-upstream-option-note":!0,style:{flexShrink:0,fontSize:"0.72rem",opacity:.75},children:p})]})}function We(e){let o=e.directoryView;return{noOptions:o.pickerNoOptions,clear:o.pickerClear,toggle:o.pickerToggle,selection:n=>x(o.pickerSelected,{value:n.map(p=>p.label).join(", ")})}}function St(e){try{return new Intl.Collator(e).compare}catch{return new Intl.Collator().compare}}function Ct(e){return(e.split("@")[0]??e).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function $e(){let e=se(),o=ue(),{submit:n,resetResult:p,result:d}=pe(o),r=e.labels??Q,[i,y]=P(""),[w,U]=P(null),v=w?.kind==="edit"?w.user:null,R=w?.kind==="create",A=oe(null),g=(m,N)=>{A.current=N.currentTarget,p(),m.kind==="create"&&(l(""),C("")),U(m)},[a,l]=P(""),[b,C]=P(""),L=be(R,()=>U(null),A),f=be(v!==null,()=>U(null),A),h=o.state!=="idle",[G,V]=P({column:"displayName",ascending:!0}),M=St(r.formatLocale),B=i.trim().toLowerCase(),k=e.users.filter(m=>m.displayName.toLowerCase().includes(B)||m.email.toLowerCase().includes(B)).slice().sort((m,N)=>{let Y=G.ascending?1:-1;return G.column==="id"?(m.id-N.id)*Y:G.column==="isActive"?(Number(m.isActive)-Number(N.isActive))*Y:M(m[G.column],N[G.column])*Y}),I=m=>{V(N=>N.column===m?{column:m,ascending:!N.ascending}:{column:m,ascending:!0})},u=m=>{h||m.isActive&&!window.confirm(x(r.usersView.confirmDeactivate,{user:m.displayName}))||n({intent:"toggleUserActive",userId:String(m.id),isActive:String(!m.isActive)})},T=m=>{if(m.preventDefault(),!(a&&b))return;let N=a,Y=b;n({intent:"createUser",displayName:N,email:Y},()=>{l(X=>X===N?"":X),C(X=>X===Y?"":X),U(null)})},D=m=>{m.preventDefault(),v&&n({intent:"updateUser",userId:String(v.id),displayName:v.displayName,email:v.email},()=>U(null))};return c("section",{"data-testid":"users-view-section",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t("h2",{style:ce,children:r.usersView.title}),!w&&t(Z,{result:d}),c("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",justifyContent:"space-between",alignItems:"center",backgroundColor:"#ffffff",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:[t("input",{type:"text","aria-label":r.usersView.searchLabel,placeholder:r.usersView.searchPlaceholder,value:i,onChange:m=>y(m.target.value),"data-testid":"users-search-input",style:{...S,padding:"6px 12px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem",width:"260px",maxWidth:"100%"}}),t("button",{type:"button",onClick:m=>g({kind:"create"},m),"data-testid":"users-add-button",style:{...S,padding:"6px 14px",borderRadius:"6px",backgroundColor:"#0284c7",color:"#ffffff",border:"none",fontSize:"0.85rem",fontWeight:600,cursor:"pointer"},children:r.usersView.addUser})]}),t("p",{"data-testid":"users-summary",role:"status","aria-live":"polite",style:{margin:0,fontSize:"0.78rem",color:"#475569"},children:x(r.usersView.listSummary,{shown:k.length,total:e.users.length})}),t("div",{style:Ae,children:c("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.85rem",textAlign:"left"},children:[t("thead",{children:c("tr",{style:{backgroundColor:"#f8fafc",borderBottom:"1px solid #e2e8f0",color:"#475569"},children:[[["id",r.common.id],["displayName",r.usersView.displayName],["email",r.usersView.email],["isActive",r.common.status]].map(([m,N])=>t("th",{scope:"col",style:{padding:0},"aria-sort":G.column===m?G.ascending?"ascending":"descending":"none",children:c("button",{type:"button","data-testid":`users-sort-${m}`,onClick:()=>I(m),"aria-label":x(G.column===m?G.ascending?r.usersView.sortedAscending:r.usersView.sortedDescending:r.usersView.sortBy,{column:N}),style:{...S,width:"100%",padding:"10px 14px",textAlign:"left",background:"transparent",border:"none",cursor:"pointer",font:"inherit",color:"inherit",fontWeight:G.column===m?700:500},children:[N,t("span",{"aria-hidden":"true",style:{marginLeft:"4px",opacity:G.column===m?1:.35},children:G.column===m?G.ascending?"\u25B2":"\u25BC":"\u21C5"})]})},m)),t("th",{scope:"col",style:{padding:"10px 14px",textAlign:"right"},children:r.common.actions})]})}),c("tbody",{children:[k.map(m=>c("tr",{style:{borderBottom:"1px solid #f1f5f9"},"data-testid":`user-row-${m.id}`,children:[t("td",{style:{padding:"10px 14px",color:"#475569"},children:x(r.common.idTemplate,{id:m.id})}),t("td",{style:{padding:"10px 14px",fontWeight:600,color:"#0f172a"},children:m.displayName}),t("td",{style:{padding:"10px 14px",color:"#475569"},children:m.email}),t("td",{style:{padding:"10px 14px"},children:t("span",{style:{fontSize:"0.75rem",padding:"2px 8px",borderRadius:"10px",backgroundColor:m.isActive?"#dcfce7":"#fee2e2",color:m.isActive?"#15803d":"#b91c1c",fontWeight:600},children:m.isActive?r.usersView.active:r.usersView.inactive})}),t("td",{style:{padding:"4px 14px",textAlign:"right"},children:c("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:"6px"},children:[t("button",{type:"button",onClick:N=>g({kind:"edit",user:m},N),"aria-label":x(r.usersView.editUserAria,{user:m.displayName}),"data-testid":`edit-user-btn-${m.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",fontSize:_,lineHeight:j,cursor:"pointer"},children:r.common.edit}),t("button",{type:"button",onClick:()=>u(m),...ee(h),"aria-label":x(m.isActive?r.usersView.deactivateAria:r.usersView.activateAria,{user:m.displayName}),"data-testid":`toggle-user-btn-${m.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",fontSize:_,lineHeight:j,cursor:h?"default":"pointer",color:m.isActive?"#b91c1c":"#15803d"},children:m.isActive?r.usersView.deactivate:r.usersView.activate})]})})]},m.id)),k.length===0&&t("tr",{children:t("td",{colSpan:5,style:{padding:"2rem",textAlign:"center",color:"#475569"},children:B===""?r.usersView.empty:r.usersView.emptyFiltered})})]})]})}),R&&t("div",{style:he,children:c("form",{ref:L,onSubmit:T,role:"dialog","aria-modal":"true","aria-labelledby":"create-user-title",...fe(d)?{"aria-describedby":"create-user-error"}:{},"data-testid":"user-create-modal",style:we,children:[t("h3",{id:"create-user-title",style:{margin:"0 0 1rem 0",fontSize:"1.1rem"},children:r.usersView.addUser}),t(Z,{result:d,id:"create-user-error"}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"create-user-display-name-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:r.usersView.displayName}),t("input",{id:"create-user-display-name-input",type:"text",value:a,onChange:m=>l(m.target.value),required:!0,"data-testid":"create-user-display-name",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1.2rem"},children:[t("label",{htmlFor:"create-user-email-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:r.usersView.email}),t("input",{id:"create-user-email-input",type:"email",value:b,onChange:m=>C(m.target.value),required:!0,"data-testid":"create-user-email",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[t("button",{type:"button",onClick:()=>U(null),"data-testid":"cancel-create-user",style:{...S,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer"},children:r.common.cancel}),t("button",{type:"submit","data-testid":"submit-create-user",disabled:h,"aria-busy":h,style:{...S,padding:"6px 12px",borderRadius:"4px",backgroundColor:"#0284c7",color:"#ffffff",border:"none",cursor:"pointer"},children:r.common.create})]})]})}),v&&t("div",{style:he,children:c("form",{ref:f,onSubmit:D,role:"dialog","aria-modal":"true","aria-labelledby":"edit-user-title",...fe(d)?{"aria-describedby":"edit-user-error"}:{},"data-testid":"user-edit-modal",style:we,children:[t("h3",{id:"edit-user-title",style:{margin:"0 0 1rem 0",fontSize:"1.1rem"},children:r.usersView.editUser}),t(Z,{result:d,id:"edit-user-error"}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"edit-user-display-name-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:r.usersView.displayName}),t("input",{id:"edit-user-display-name-input",type:"text",value:v.displayName,onChange:m=>U({kind:"edit",user:{...v,displayName:m.target.value}}),required:!0,"data-testid":"edit-user-display-name",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1.2rem"},children:[t("label",{htmlFor:"edit-user-email-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:r.usersView.email}),t("input",{id:"edit-user-email-input",type:"email",value:v.email,onChange:m=>U({kind:"edit",user:{...v,email:m.target.value}}),required:!0,"data-testid":"edit-user-email",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[t("button",{type:"button",onClick:()=>U(null),style:{...S,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer"},children:r.common.cancel}),t("button",{type:"submit","data-testid":"submit-edit-user",disabled:h,"aria-busy":h,style:{...S,padding:"6px 12px",borderRadius:"4px",backgroundColor:"#0284c7",color:"#ffffff",border:"none",cursor:"pointer"},children:r.common.save})]})]})})]})}var He=De.createContext(null);function Ut(){return De.useContext(He)??""}function Lt(){let e=Ut(),o=se(),n=ue(),{submit:p,resetResult:d,result:r}=pe(n),i=o.labels??Q,y=qe(r,i),[w,U]=P(""),[v,R]=P(null),A=v?.kind==="edit"?v.group:null,g=v?.kind==="create",a=oe(null),l=(s,E)=>{a.current=E.currentTarget,d(),s.kind==="create"&&Ze(),R(s)},b=n.state!=="idle",[C,L]=P(""),[f,h]=P(""),[G,V]=P(""),[M,B]=P("local"),[k,I]=P(null),[u,T]=P(null),[D,m]=P("direct"),N=oe(null),Y=ne(()=>{let s=new Map;for(let E of o.groupMembers)s.set(E.groupId,(s.get(E.groupId)??0)+1);return s},[o.groupMembers]),X=ne(()=>Be(o.groups),[o.groups]),me=ne(()=>Fe(o.catalog,X,i),[o.catalog,X,i]),_e=ne(()=>me.filter(s=>s.disabled!==!0).length,[me]),Se=o.catalog.kind==="ready"&&o.catalog.groups.length>0&&o.directoryStatus.provider!=="",je=be(g,()=>R(null),a),Qe=be(A!==null,()=>R(null),a),Ce=w.trim().toLowerCase(),Ue=o.groups.filter(s=>s.name.toLowerCase().includes(Ce)||s.groupKey.toLowerCase().includes(Ce)),Ze=()=>{L(""),h(""),V(""),B("local"),T(null),m("direct"),N.current=null},Ye=s=>{if(s.preventDefault(),!(C&&f)||M==="upstream"&&u===null||M==="upstream"&&u!==null&&!window.confirm(x(i.groupsView.confirmCreateLinked,{group:f,upstream:u.externalKey})))return;let E={key:C,name:f,description:G},z=()=>{L(J=>J===E.key?"":J),h(J=>J===E.name?"":J),V(J=>J===E.description?"":J),T(null),R(null)};if(M==="upstream"&&u!==null){p({intent:"createLinkedGroup",groupKey:E.key,name:E.name,description:E.description,provider:o.directoryStatus.provider,externalKey:u.externalKey,membershipMode:D},z);return}p({intent:"createGroup",groupKey:E.key,name:E.name,description:E.description},z)},Xe=s=>{if(T(s),!s)return;let E={key:Ct(s.externalKey),name:s.name,description:s.description??""};h(E.name),L(E.key),V(E.description),N.current=E},Je=s=>{if(B(s),s==="upstream")return;T(null);let E=N.current;E&&(L(z=>z===E.key?"":z),h(z=>z===E.name?"":z),V(z=>z===E.description?"":z),N.current=null)},et=s=>{s.preventDefault(),A&&p({intent:"updateGroup",groupId:String(A.id),name:A.name,description:A.description??""},()=>R(null))},tt=s=>{if(b)return;let E=o.groupMembers.filter(z=>z.groupId===s.id).length;window.confirm(x(i.groupsView.confirmDelete,{group:s.name,count:E}))&&p({intent:"deleteGroup",groupId:String(s.id)})};return c("section",{"data-testid":"groups-view-section",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t("h2",{style:ce,children:i.groupsView.title}),!v&&t(Z,{result:r}),t("p",{"data-testid":"groups-sync-request-notice",role:"status","aria-live":"polite",hidden:y===null,style:y===null?void 0:{margin:0,padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.8rem"},children:y}),c("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",justifyContent:"space-between",alignItems:"center",backgroundColor:"#ffffff",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:[t("input",{type:"text","aria-label":i.groupsView.searchLabel,placeholder:i.groupsView.searchPlaceholder,value:w,onChange:s=>U(s.target.value),"data-testid":"groups-search-input",style:{...S,padding:"6px 12px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem",width:"260px",maxWidth:"100%"}}),t("button",{type:"button",onClick:s=>l({kind:"create"},s),"data-testid":"groups-add-button",style:{...S,padding:"6px 14px",borderRadius:"6px",backgroundColor:"#4338ca",color:"#ffffff",border:"none",fontSize:"0.85rem",fontWeight:600,cursor:"pointer"},children:i.groupsView.addGroup})]}),t("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"1rem"},children:Ue.map(s=>{let E=Y.get(s.id)??0;return c("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e2e8f0",padding:"1rem",display:"flex",flexDirection:"column",justifyContent:"space-between"},"data-testid":`group-card-${s.id}`,"data-group-readonly":s.readOnly?"true":"false",children:[c("div",{children:[c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.5rem"},children:[t("h3",{style:{margin:0,fontSize:"1rem",color:"#0f172a"},children:s.name}),t("span",{style:{fontSize:"0.72rem",backgroundColor:"#e0e7ff",color:"#4338ca",padding:"2px 6px",borderRadius:"4px",fontFamily:"monospace"},children:s.groupKey})]}),t("p",{style:{margin:"0 0 0.8rem 0",fontSize:"0.82rem",color:"#64748b",minHeight:"2.4em"},children:s.description||i.groupsView.noDescription}),s.externalLink&&c("div",{"data-testid":`group-source-${s.id}`,style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap",marginBottom:"0.6rem"},children:[t("span",{style:{fontSize:"0.72rem",padding:"2px 8px",borderRadius:"10px",backgroundColor:"#ede9fe",color:"#6d28d9",fontWeight:600},children:i.common.managedUpstream}),t("span",{style:{fontSize:"0.72rem",fontFamily:"monospace",color:"#64748b"},children:s.externalLink.externalKey}),s.externalLink.unresolvedCount>0&&t("span",{"data-testid":`group-unresolved-${s.id}`,style:{fontSize:"0.72rem",color:"#b45309"},children:x(i.directoryView.unresolvedTemplate,{count:s.externalLink.unresolvedCount})})]})]}),c("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid #f1f5f9",paddingTop:"0.6rem"},children:[t(vt,{to:`${e}/group_members?group=${s.id}`,"data-testid":`group-open-members-${s.id}`,"aria-label":x(i.groupsView.openMembersAria,{group:s.name}),style:{...ie,fontSize:_,lineHeight:j,color:"#1d4ed8",textDecoration:"none"},children:x(i.groupsView.memberCountTemplate,{count:E})}),s.readOnly?t("span",{"data-testid":`readonly-group-${s.id}`,style:{fontSize:"0.75rem",color:"#475569"},children:i.common.readOnly}):c("div",{style:{display:"flex",gap:"4px"},children:[t("button",{type:"button",onClick:z=>l({kind:"edit",group:s},z),...ee(b),"aria-label":x(i.groupsView.editGroupAria,{group:s.name}),"data-testid":`edit-group-btn-${s.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",fontSize:_,lineHeight:j,cursor:"pointer"},children:i.common.edit}),t("button",{type:"button",onClick:()=>tt(s),...ee(b),"aria-label":x(i.groupsView.deleteGroupAria,{group:s.name}),"data-testid":`delete-group-btn-${s.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #fee2e2",backgroundColor:"#fff5f5",color:"#b91c1c",fontSize:_,lineHeight:j,cursor:"pointer"},children:i.common.delete})]})]})]},s.id)})}),Ue.length===0&&t("div",{"data-testid":"groups-empty",style:{padding:"2rem",textAlign:"center",color:"#475569",backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e2e8f0"},children:o.groups.length===0?i.groupsView.empty:i.groupsView.emptyFiltered}),g&&t("div",{style:he,children:c("form",{ref:je,onSubmit:Ye,role:"dialog","aria-modal":"true","aria-labelledby":"create-group-title",...fe(r)?{"aria-describedby":"create-group-error"}:{},"data-testid":"group-create-modal",style:we,children:[t("h3",{id:"create-group-title",style:{margin:"0 0 1rem 0",fontSize:"1.1rem"},children:i.groupsView.addGroup}),t(Z,{result:r,id:"create-group-error"}),Se&&c("fieldset",{"data-testid":"create-group-mode",style:{display:"flex",gap:"0.25rem",marginBottom:"1rem",border:"none",padding:0,margin:"0 0 1rem 0"},children:[t("legend",{style:Pe,children:i.groupsView.createModeLabel}),["local","upstream"].map(s=>c("label",{"data-aqar-create-mode":s,"data-selected":M===s?"":void 0,"data-focused":k===s?"":void 0,style:{...ie,justifyContent:"center",outline:k===s?"2px solid #4338ca":void 0,outlineOffset:"2px",flex:1,padding:"0.4rem 0.6rem",fontSize:_,lineHeight:j,borderRadius:"6px",cursor:"pointer",textAlign:"center",border:M===s?"1px solid #4338ca":"1px solid #cbd5e1",backgroundColor:M===s?"#eef2ff":"#ffffff",color:M===s?"#3730a3":"#475569",fontWeight:M===s?700:500},children:[t("input",{type:"radio",name:"create-group-mode",value:s,checked:M===s,onChange:()=>Je(s),"data-testid":`create-group-mode-${s}`,"data-aqar-visually-hidden":!0,onFocus:()=>I(s),onBlur:()=>I(E=>E===s?null:E),style:Pe}),s==="local"?i.groupsView.createModeLocal:i.groupsView.createModeUpstream]},s))]}),o.catalog.kind==="ready"&&o.catalog.groups.length===0&&t("p",{"data-testid":"create-group-catalog-empty",role:"note",style:{margin:"0 0 1rem 0",padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#f8fafc",border:"1px solid #e2e8f0",color:"#475569",fontSize:"0.78rem"},children:x(i.groupsView.catalogEmpty,{at:te(o.catalog.observedAt??"",i)})}),o.catalog.kind==="ready"&&o.catalog.groups.length>0&&o.directoryStatus.provider===""&&t("p",{"data-testid":"create-group-provider-unset",role:"note",style:{margin:"0 0 1rem 0",padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.78rem"},children:i.groupsView.providerUnset}),o.catalog.kind==="unavailable"&&t("p",{"data-testid":"create-group-catalog-unavailable",role:"note",style:{margin:"0 0 1rem 0",padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.78rem"},children:x(i.groupsView.catalogUnavailableHere,{reason:i.groupsView.catalogFailures[o.catalog.reason]})}),M==="upstream"&&Se&&o.catalog.kind==="ready"&&c("div",{style:{marginBottom:"1rem"},children:[t("p",{"data-testid":"create-group-upstream-notice",role:"note",style:{margin:"0 0 0.5rem 0",fontSize:"0.78rem",color:"#5b21b6"},children:i.groupsView.createUpstreamNotice}),t("div",{id:"create-group-upstream-label",style:ae,children:i.groupsView.pickUpstream}),t("div",{"data-testid":"create-group-upstream-picker",onKeyDown:s=>{s.nativeEvent.isComposing||s.nativeEvent.keyCode===229||s.key==="Enter"&&s.preventDefault()},children:t(Ne,{options:me,value:u===null?null:me.find(s=>s.value===u.externalId)??null,onChange:s=>Xe(s===null?null:s.entry),placeholder:i.groupsView.pickUpstreamPlaceholder,ariaLabelledBy:"create-group-upstream-label",renderOption:Ke,locale:i.locale,labels:We(i),clearable:!0})}),t(Oe,{observedAt:o.catalog.observedAt,isStale:o.catalog.isStale,labels:i}),c("div",{style:{marginTop:"0.6rem"},children:[t("label",{htmlFor:"create-group-membership-mode",style:ae,children:i.directoryView.membershipMode}),c("select",{id:"create-group-membership-mode","data-testid":"create-group-membership-mode",value:D,onChange:s=>m(s.target.value),style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"},children:[t("option",{value:"direct",children:i.directoryView.directMode}),t("option",{value:"transitive",children:i.directoryView.transitiveMode})]})]})]}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"create-group-key-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.groupKey}),t("input",{id:"create-group-key-input",type:"text",value:C,onChange:s=>L(s.target.value),placeholder:i.groupsView.groupKeyPlaceholder,required:!0,"data-testid":"create-group-key",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"create-group-name-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.name}),t("input",{id:"create-group-name-input",type:"text",value:f,onChange:s=>h(s.target.value),placeholder:i.groupsView.namePlaceholder,required:!0,"data-testid":"create-group-name",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1.2rem"},children:[t("label",{htmlFor:"create-group-desc-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.description}),t("textarea",{id:"create-group-desc-input",value:G,onChange:s=>V(s.target.value),"data-testid":"create-group-description",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1",height:"60px"}})]}),M==="upstream"&&u===null&&t("p",{id:"create-group-submit-hint","data-testid":"create-group-submit-hint",style:{margin:"0 0 0.6rem 0",fontSize:"0.78rem",color:"#475569",textAlign:"right"},children:_e>0?i.groupsView.pickUpstreamFirst:i.groupsView.allUpstreamLinked}),c("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[t("button",{type:"button",onClick:()=>R(null),"data-testid":"cancel-create-group",style:{...S,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer"},children:i.common.cancel}),t("button",{type:"submit","data-testid":"submit-create-group",disabled:b||M==="upstream"&&u===null,"aria-busy":b,...M==="upstream"&&u===null?{"aria-describedby":"create-group-submit-hint"}:{},style:{...S,padding:"6px 12px",borderRadius:"4px",backgroundColor:b||M==="upstream"&&u===null?"#a5b4fc":"#4338ca",color:"#ffffff",border:"none",cursor:b||M==="upstream"&&u===null?"not-allowed":"pointer"},children:i.common.create})]})]})}),A&&t("div",{style:he,children:c("form",{ref:Qe,onSubmit:et,role:"dialog","aria-modal":"true","aria-labelledby":"edit-group-title",...fe(r)?{"aria-describedby":"edit-group-error"}:{},"data-testid":"group-edit-modal",style:we,children:[t("h3",{id:"edit-group-title",style:{margin:"0 0 1rem 0",fontSize:"1.1rem"},children:i.groupsView.editGroup}),t(Z,{result:r,id:"edit-group-error"}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"edit-group-name-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.name}),t("input",{id:"edit-group-name-input",type:"text",value:A.name,onChange:s=>R({kind:"edit",group:{...A,name:s.target.value}}),required:!0,"data-testid":"edit-group-name",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1.2rem"},children:[t("label",{htmlFor:"edit-group-desc-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.description}),t("textarea",{id:"edit-group-desc-input",value:A.description??"",onChange:s=>R({kind:"edit",group:{...A,description:s.target.value}}),"data-testid":"edit-group-description",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1",height:"60px"}})]}),c("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[t("button",{type:"button",onClick:()=>R(null),style:{...S,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer"},children:i.common.cancel}),t("button",{type:"submit","data-testid":"submit-edit-group",disabled:b,"aria-busy":b,style:{...S,padding:"6px 12px",borderRadius:"4px",backgroundColor:"#4338ca",color:"#ffffff",border:"none",cursor:"pointer"},children:i.common.save})]})]})})]})}function Gt(){let e=se(),o=ue(),{submit:n,result:p}=pe(o),d=o.state!=="idle",r=e.labels??Q,[i]=kt(),y=Number(i.get("group")??""),w=Number.isInteger(y)&&y>0?y:null,[U,v]=P(null),[R,A]=P(new Set),g=oe(w);g.current!==w&&(g.current=w,w!==null&&(v(w),A(new Set)));let[a,l]=P(""),[b,C]=P(!1),L=U??w??e.groups[0]?.id??null,f=e.groups.find(k=>k.id===L)??e.groups[0],h=L!==null&&f!==void 0&&f.id!==L?L:null,G=new Set(e.groupMembers.filter(k=>k.groupId===f?.id).map(k=>k.userId)),V=a.trim().toLowerCase(),M=e.users.filter(k=>b&&!G.has(k.id)&&!R.has(k.id)?!1:V===""?!0:k.displayName.toLowerCase().includes(V)||k.email.toLowerCase().includes(V)),B=(k,I)=>{if(d||!f)return;let u=String(f.id);I?(A(T=>new Set(T).add(k)),n({intent:"removeGroupMember",groupId:u,userId:String(k)})):(A(T=>{if(!T.has(k))return T;let D=new Set(T);return D.delete(k),D}),n({intent:"addGroupMember",groupId:u,userId:String(k)}))};return c("section",{"data-testid":"group-members-view-section",style:{display:"flex",flexDirection:"column",gap:"1.2rem"},children:[t("h2",{style:ce,children:r.groupMembersView.title}),t(Z,{result:p}),h!==null&&t("p",{"data-testid":"member-deep-link-missed",role:"note",style:{margin:0,padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.8rem"},children:x(r.groupMembersView.deepLinkMissed,{id:h,group:f?.name??""})}),c("div",{"data-testid":"group-members-layout",style:{display:"flex",flexWrap:"wrap",gap:"1.2rem"},children:[c("div",{"data-testid":"group-members-picker",style:{flexGrow:1,flexBasis:"240px",boxSizing:"border-box",backgroundColor:"#ffffff",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:[t("h3",{style:{margin:"0 0 0.8rem 0",fontSize:"0.9rem",color:"#475569"},children:r.groupMembersView.selectGroup}),t("div",{style:{display:"flex",flexDirection:"column",gap:"0.4rem"},children:e.groups.map(k=>{let I=k.id===f?.id;return c("button",{type:"button",onClick:()=>{v(k.id),A(new Set)},"data-testid":`select-group-btn-${k.id}`,style:{...S,textAlign:"left",padding:"8px 10px",borderRadius:"6px",border:I?"1px solid #6366f1":"1px solid #e2e8f0",backgroundColor:I?"#e0e7ff":"#ffffff",color:I?"#3730a3":"#0f172a",cursor:"pointer",fontWeight:I?600:400,fontSize:"0.85rem"},children:[k.name,k.readOnly?t("span",{"data-testid":`group-upstream-marker-${k.id}`,style:{marginLeft:"6px",fontSize:"0.7rem",color:"#7c3aed"},children:r.common.managedUpstream}):null]},k.id)})})]}),t("div",{"data-testid":"group-members-panel",style:{flexGrow:999,flexBasis:0,minWidth:"50%",boxSizing:"border-box",backgroundColor:"#ffffff",padding:"1.2rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:f?c(ke,{children:[c("div",{style:{marginBottom:"1rem",borderBottom:"1px solid #e2e8f0",paddingBottom:"0.8rem"},children:[t("h3",{style:{margin:0,fontSize:"1.1rem",color:"#0f172a"},children:x(r.groupMembersView.membersOfTemplate,{group:f.name})}),c("span",{style:{fontSize:"0.8rem",color:"#64748b"},children:[r.groupMembersView.groupKeyLabel,": ",f.groupKey]}),f.readOnly?t("div",{"data-testid":"group-members-upstream-notice",role:"note",style:{marginTop:"0.5rem",padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#f5f3ff",border:"1px solid #ddd6fe",color:"#5b21b6",fontSize:"0.8rem"},children:r.groupMembersView.upstreamNotice}):null]}),c("div",{style:{display:"flex",gap:"0.75rem",alignItems:"center",flexWrap:"wrap",marginBottom:"0.8rem"},children:[t("input",{type:"search","aria-label":r.groupMembersView.searchLabel,placeholder:r.groupMembersView.searchPlaceholder,value:a,onChange:k=>l(k.target.value),"data-testid":"member-search-input",style:{...S,flex:1,minWidth:"220px",padding:"6px 12px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem"}}),c("label",{style:{...ie,gap:"0.35rem",fontSize:_,lineHeight:j,color:"#475569",cursor:"pointer"},children:[t("input",{type:"checkbox","data-testid":"member-only-toggle",checked:b,onChange:k=>{C(k.target.checked),A(new Set)}}),x(r.groupMembersView.onlyMembers,{count:G.size})]})]}),t("p",{"data-testid":"member-summary",role:"status","aria-live":"polite",style:{margin:"0 0 0.6rem 0",fontSize:"0.78rem",color:"#475569"},children:x(r.groupMembersView.summary,{shown:M.length,total:e.users.length,members:G.size})}),M.length===0&&t("p",{"data-testid":"member-empty-filtered",style:{margin:"0 0 0.6rem 0",fontSize:"0.85rem",color:"#475569"},children:e.users.length===0?r.groupMembersView.noUsers:V===""&&b?r.groupMembersView.emptyNoMembers:r.groupMembersView.emptyFiltered}),t("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:M.map(k=>{let I=G.has(k.id);return c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"0.5rem",padding:"4px 12px",borderRadius:"6px",border:"1px solid #f1f5f9",backgroundColor:I?"#f0fdf4":"#ffffff"},"data-testid":`member-row-${k.id}`,children:[c("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[t("span",{style:{fontWeight:600,fontSize:"0.88rem",color:"#0f172a",marginRight:"8px"},children:k.displayName}),c("span",{style:{fontSize:"0.78rem",color:"#64748b"},children:["(",k.email,")"]})]}),f.readOnly?I?t("span",{"data-testid":`member-readonly-${k.id}`,style:{fontSize:"0.75rem",color:"#475569"},children:r.common.managedUpstream}):null:t("button",{type:"button",onClick:()=>B(k.id,I),...ee(d),"aria-label":x(I?r.groupMembersView.actionRemoveAria:r.groupMembersView.actionAddAria,{user:k.displayName}),"data-testid":`toggle-member-btn-${k.id}`,style:{...S,padding:"4px 12px",borderRadius:"4px",border:I?"1px solid #b91c1c":"1px solid #0284c7",backgroundColor:I?"#ffffff":"#0284c7",color:I?"#b91c1c":"#ffffff",fontSize:_,lineHeight:j,fontWeight:600,cursor:"pointer"},children:I?r.groupMembersView.actionRemove:r.groupMembersView.actionAdd})]},k.id)})})]}):t("div",{"data-testid":"member-no-groups",style:{color:"#475569",textAlign:"center",padding:"2rem"},children:e.groups.length===0?r.groupMembersView.noGroups:r.groupMembersView.selectPrompt})})]})]})}function Mt(e){return e==="email"?{backgroundColor:"#e0f2fe",color:"#0369a1"}:e==="domain"?{backgroundColor:"#fef3c7",color:"#b45309"}:{backgroundColor:"#ede9fe",color:"#6d28d9"}}function Rt(e,o){return e==="email"?o.allowlistView.emailTypeShort:e==="domain"?o.allowlistView.domainTypeShort:o.allowlistView.groupTypeShort}function Tt(){let e=se(),o=ue(),n=e.labels??Q,{submit:p,result:d}=pe(o),r=o.state!=="idle",[i,y]=P(""),[w,U]=P("email"),[v,R]=P(""),A=l=>{if(l.preventDefault(),!i)return;let b={pattern:i,description:v};p({intent:"addAllowlistEntry",pattern:b.pattern,type:w,description:b.description},()=>{y(C=>C===b.pattern?"":C),R(C=>C===b.description?"":C)})},g=l=>{p({intent:"removeAllowlistEntry",entryId:String(l)})},a=l=>{p({intent:"removeAllowlistGroup",entryId:String(l)})};return c("section",{"data-testid":"allowlist-view-section",style:{display:"flex",flexDirection:"column",gap:"1.2rem"},children:[t("h2",{style:ce,children:n.allowlistView.title}),t(Z,{result:d}),c("form",{onSubmit:A,style:{backgroundColor:"#ffffff",padding:"1.2rem",borderRadius:"8px",border:"1px solid #e2e8f0",display:"flex",flexWrap:"wrap",gap:"0.8rem",alignItems:"flex-end"},children:[c("div",{style:{flex:2,minWidth:"220px"},children:[t("label",{htmlFor:"allowlist-pattern-input-field",style:{display:"block",fontSize:"0.78rem",color:"#475569",marginBottom:"4px"},children:n.allowlistView.pattern}),t("input",{id:"allowlist-pattern-input-field",type:"text",value:i,onChange:l=>y(l.target.value),required:!0,"data-testid":"allowlist-pattern-input",style:{...S,width:"100%",padding:"6px 10px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem"}})]}),c("div",{style:{flex:1,minWidth:"140px"},children:[t("label",{htmlFor:"allowlist-type-select-field",style:{display:"block",fontSize:"0.78rem",color:"#475569",marginBottom:"4px"},children:n.allowlistView.type}),c("select",{id:"allowlist-type-select-field",value:w,onChange:l=>U(l.target.value),"data-testid":"allowlist-type-select",style:{...S,width:"100%",padding:"6px 10px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem"},children:[t("option",{value:"email",children:n.allowlistView.emailType}),t("option",{value:"domain",children:n.allowlistView.domainType})]})]}),c("div",{style:{flex:2,minWidth:"200px"},children:[t("label",{htmlFor:"allowlist-desc-input-field",style:{display:"block",fontSize:"0.78rem",color:"#475569",marginBottom:"4px"},children:n.allowlistView.description}),t("input",{id:"allowlist-desc-input-field",type:"text",value:v,onChange:l=>R(l.target.value),"data-testid":"allowlist-desc-input",style:{...S,width:"100%",padding:"6px 10px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem"}})]}),t("button",{type:"submit","data-testid":"submit-allowlist-add",disabled:r,"aria-busy":r,style:{...S,padding:"7px 16px",borderRadius:"6px",backgroundColor:"#047857",color:"#ffffff",border:"none",fontSize:"0.85rem",fontWeight:600,cursor:"pointer"},children:n.allowlistView.addEntry})]}),t("div",{style:Ae,children:c("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.85rem",textAlign:"left"},children:[t("thead",{children:c("tr",{style:{backgroundColor:"#f8fafc",borderBottom:"1px solid #e2e8f0",color:"#475569"},children:[t("th",{scope:"col",style:{padding:"10px 14px"},children:n.common.id}),t("th",{scope:"col",style:{padding:"10px 14px"},children:n.allowlistView.target}),t("th",{scope:"col",style:{padding:"10px 14px"},children:n.allowlistView.type}),t("th",{scope:"col",style:{padding:"10px 14px"},children:n.allowlistView.description}),t("th",{scope:"col",style:{padding:"10px 14px",textAlign:"right"},children:n.common.actions})]})}),c("tbody",{children:[e.allowlist.map(l=>c("tr",{style:{borderBottom:"1px solid #f1f5f9"},"data-testid":`allowlist-row-${l.type}-${l.id}`,"data-allowlist-type":l.type,children:[t("td",{style:{padding:"10px 14px",color:"#475569"},children:x(n.common.idTemplate,{id:l.id})}),t("td",{style:{padding:"10px 14px",fontWeight:600,color:"#0f172a"},children:l.type==="group"?c("span",{"data-testid":`allowlist-group-${l.type}-${l.id}`,children:[l.groupName,t("span",{style:{marginLeft:"6px",fontFamily:"monospace",fontSize:"0.78rem",color:"#64748b"},children:l.groupKey})]}):t("span",{style:{fontFamily:"monospace"},children:l.pattern})}),t("td",{style:{padding:"10px 14px"},children:t("span",{style:{fontSize:"0.75rem",padding:"2px 8px",borderRadius:"10px",...Mt(l.type),fontWeight:600},children:Rt(l.type,n)})}),c("td",{style:{padding:"10px 14px",color:"#475569"},children:[l.description||n.common.none,l.owner.kind==="deployment"&&t("span",{"data-testid":`allowlist-owner-${l.type}-${l.id}`,style:{marginLeft:"8px",fontSize:"0.72rem",color:"#475569"},children:n.allowlistView.deploymentOwner})]}),t("td",{style:{padding:"4px 14px",textAlign:"right"},children:l.readOnly?t("span",{"data-testid":`readonly-allowlist-${l.type}-${l.id}`,style:{fontSize:"0.75rem",color:"#475569"},children:n.common.readOnly}):t("button",{type:"button",onClick:()=>{window.confirm(x(n.allowlistView.confirmDelete,{target:l.type==="group"?l.groupName:l.pattern}))&&(l.type==="group"?a(l.id):g(l.id))},disabled:r,"aria-busy":r,"aria-label":x(n.allowlistView.deleteAria,{target:l.type==="group"?l.groupName:l.pattern}),"data-testid":`remove-allowlist-btn-${l.type}-${l.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #fee2e2",backgroundColor:"#fff5f5",color:"#b91c1c",fontSize:_,lineHeight:j,cursor:"pointer"},children:n.common.delete})})]},`${l.type}-${l.id}`)),e.allowlist.length===0&&t("tr",{children:t("td",{colSpan:5,style:{padding:"2rem",textAlign:"center",color:"#475569"},children:n.allowlistView.empty})})]})]})})]})}function Et(){let e=se(),o=ue(),{submit:n,result:p}=pe(o),d=e.labels??Q,r=d.directoryView,i=e.groups.filter(u=>!u.externalLink),[y,w]=P(""),[U,v]=P(""),[R,A]=P(""),[g,a]=P("direct"),l=e.groups.filter(u=>u.externalLink),b=new Set(e.allowlist.filter(u=>u.type==="group").map(u=>u.groupId)),C=u=>e.allowlist.find(T=>T.type==="group"&&T.groupId===u),L=o.state!=="idle",[f,h]=P(null),G=qe(p,d),V=f===null||(e.groups.find(D=>D.id===f.groupId)?.externalLink?.syncedAt??null)!==f.syncedAtAtPress?null:f.groupId,M=e.directoryStatus.isEnabled&&e.directoryStatus.provider!=="",B=ne(()=>Fe(e.catalog,Be(l),d),[e.catalog,l,d]),k=ne(()=>B.filter(u=>u.disabled!==!0).length,[B]),I=u=>{if(u.preventDefault(),!(y&&U))return;let T=i.find(m=>String(m.id)===y);if(!window.confirm(x(r.confirmLink,{group:T?.name??y,upstream:U})))return;let D=U;n({intent:"linkDirectoryGroup",groupId:y,provider:e.directoryStatus.provider,externalKey:D,externalId:R,membershipMode:g},()=>{v(m=>m===D?"":m),A(m=>U===D?"":m),w("")})};return c("section",{"data-testid":"directory-view-section",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t("h2",{style:ce,children:r.title}),t(Z,{result:p}),!M&&t("p",{"data-testid":"directory-not-wired",style:{margin:0,padding:"0.7rem 1rem",borderRadius:"6px",border:"1px solid #e2e8f0",backgroundColor:"#f8fafc",color:"#475569",fontSize:"0.85rem"},children:r.notWiredNotice}),M&&e.groups.length===0&&t("p",{"data-testid":"directory-no-groups",style:{margin:0,padding:"0.7rem 1rem",borderRadius:"6px",border:"1px solid #e2e8f0",backgroundColor:"#f8fafc",color:"#475569",fontSize:"0.85rem"},children:r.noGroupsToLink}),M&&e.groups.length>0&&i.length===0&&t("p",{"data-testid":"directory-nothing-to-link",style:{margin:0,padding:"0.7rem 1rem",borderRadius:"6px",border:"1px solid #e2e8f0",backgroundColor:"#f8fafc",color:"#475569",fontSize:"0.85rem"},children:r.nothingToLink}),t("p",{"data-testid":"directory-sync-already-pending",role:"status","aria-live":"polite",hidden:G===null,style:G===null?void 0:{margin:0,padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.8rem"},children:G}),M&&i.length>0&&c("form",{onSubmit:I,"data-testid":"directory-link-form",style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",alignItems:"flex-end",backgroundColor:"#ffffff",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:[c("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",minWidth:0},children:[t("label",{htmlFor:"directory-group-select-input",style:ae,children:r.selectGroup}),c("select",{id:"directory-group-select-input","data-testid":"directory-group-select",value:y,onChange:u=>w(u.target.value),style:{...S,width:"100%",padding:"0.5rem",borderRadius:"6px",border:"1px solid #cbd5e1"},children:[t("option",{value:"",children:r.selectGroup}),i.map(u=>t("option",{value:String(u.id),children:x(r.groupOptionTemplate,{name:u.name,key:u.groupKey})},u.id))]})]}),t("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",flex:"1 1 260px",minWidth:0},children:e.catalog.kind==="ready"&&e.catalog.groups.length>0?c(ke,{children:[t("div",{id:"directory-external-key-label",style:ae,children:r.externalKey}),t("div",{"data-testid":"directory-external-key-picker",onKeyDown:u=>{u.nativeEvent.isComposing||u.nativeEvent.keyCode===229||u.key==="Enter"&&u.preventDefault()},children:t(Ne,{options:B,value:R===""?null:B.find(u=>u.value===R)??null,onChange:u=>{if(u===null){A(""),v("");return}A(u.value),v(u.entry.externalKey)},placeholder:r.pickUpstreamPlaceholder,ariaLabelledBy:"directory-external-key-label",renderOption:Ke,locale:d.locale,labels:We(d),clearable:!0})}),k===0&&t("span",{"data-testid":"directory-all-upstream-linked",style:{fontSize:"0.72rem",color:"#92400e"},children:d.groupsView.allUpstreamLinked}),t(Oe,{observedAt:e.catalog.observedAt,isStale:e.catalog.isStale,labels:d})]}):c(ke,{children:[t("label",{htmlFor:"directory-external-key-input",style:ae,children:r.externalKey}),t("input",{id:"directory-external-key-input",type:"email",required:!0,"data-testid":"directory-external-key",placeholder:r.externalKeyPlaceholder,value:U,onChange:u=>{A(""),v(u.target.value)},style:{...S,width:"100%",padding:"0.5rem",borderRadius:"6px",border:"1px solid #cbd5e1"}}),e.catalog.kind==="unavailable"&&t("span",{"data-testid":"directory-catalog-unavailable",style:{fontSize:"0.72rem",color:"#92400e"},children:x(d.groupsView.catalogUnavailable,{reason:d.groupsView.catalogFailures[e.catalog.reason]})}),e.catalog.kind==="ready"&&t("span",{"data-testid":"directory-catalog-empty",style:{fontSize:"0.72rem",color:"#475569"},children:x(d.groupsView.catalogEmpty,{at:te(e.catalog.observedAt,d)})})]})}),c("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",minWidth:0},children:[t("label",{htmlFor:"directory-membership-mode-input",style:ae,children:r.membershipMode}),c("select",{id:"directory-membership-mode-input","data-testid":"directory-membership-mode",value:g,onChange:u=>a(u.target.value),style:{...S,width:"100%",padding:"0.5rem",borderRadius:"6px",border:"1px solid #cbd5e1"},children:[t("option",{value:"direct",children:r.directMode}),t("option",{value:"transitive",children:r.transitiveMode})]})]}),t("button",{type:"submit","data-testid":"directory-link-submit",disabled:!(y&&U)||L,"aria-busy":L,style:{...S,padding:"0.5rem 1rem",borderRadius:"6px",border:"none",backgroundColor:y&&U&&!L?"#2563eb":"#94a3b8",color:"#fff",fontWeight:600},children:r.link})]}),l.length===0?t("div",{"data-testid":"directory-empty",style:{padding:"2rem",textAlign:"center",color:"#64748b",backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e2e8f0"},children:r.empty}):t("div",{style:Ae,children:c("table",{"data-testid":"directory-table",style:{width:"100%",borderCollapse:"collapse"},children:[t("thead",{children:c("tr",{style:{backgroundColor:"#f8fafc",textAlign:"left"},children:[t("th",{scope:"col",style:H,children:d.groupsView.name}),t("th",{scope:"col",style:H,children:r.externalKey}),t("th",{scope:"col",style:H,children:r.membershipMode}),t("th",{scope:"col",style:H,children:r.lastSynced}),t("th",{scope:"col",style:H,children:d.common.status}),t("th",{scope:"col",style:H,children:d.common.actions})]})}),t("tbody",{children:l.map(u=>{let T=u.externalLink,D=b.has(u.id);return c("tr",{"data-testid":`directory-row-${u.id}`,"data-sync-enabled":String(T.isSyncEnabled),style:{borderTop:"1px solid #e2e8f0"},children:[c("td",{style:H,children:[u.name,t("div",{style:{fontSize:"0.75rem",color:"#64748b"},children:u.groupKey})]}),t("td",{style:H,"data-testid":`directory-external-${u.id}`,children:T.externalKey}),t("td",{style:H,children:T.membershipMode==="direct"?r.directMode:r.transitiveMode}),c("td",{style:H,"data-testid":`directory-synced-${u.id}`,children:[T.syncedAt?te(T.syncedAt,d):r.neverSynced,T.unresolvedCount>0?t("div",{style:{fontSize:"0.75rem",color:"#b45309"},"data-testid":`directory-unresolved-${u.id}`,children:x(r.unresolvedTemplate,{count:T.unresolvedCount})}):null]}),c("td",{style:H,children:[t("span",{"data-testid":`directory-status-${u.id}`,style:{fontSize:"0.75rem",padding:"2px 8px",borderRadius:"10px",backgroundColor:T.isSyncEnabled?"#dcfce7":"#fee2e2",color:T.isSyncEnabled?"#166534":"#b91c1c",fontWeight:600},children:T.isSyncEnabled?r.syncEnabled:r.syncPaused}),T.syncError?t("div",{style:{fontSize:"0.75rem",color:"#b91c1c",marginTop:"0.25rem"},"data-testid":`directory-error-${u.id}`,children:T.syncError}):null]}),t("td",{style:H,children:c("div",{style:{display:"flex",gap:"0.35rem",flexWrap:"wrap"},children:[t("button",{type:"button","data-testid":`directory-sync-now-${u.id}`,...ee(L),"aria-label":x(V===u.id?r.syncQueuedAria:r.syncNowAria,{group:u.name}),onClick:()=>n({intent:"requestDirectorySync",groupId:String(u.id)},m=>{m?.syncRequest==="queued"&&h({groupId:u.id,syncedAtAtPress:u.externalLink?.syncedAt??null})}),style:ye,children:V===u.id?r.syncQueued:r.syncNow}),t("button",{type:"button","data-testid":`directory-toggle-sync-${u.id}`,...ee(L),"aria-label":x(T.isSyncEnabled?r.pauseAria:r.resumeAria,{group:u.name}),onClick:()=>{h(null),n({intent:"setDirectorySyncEnabled",groupId:String(u.id),isSyncEnabled:String(!T.isSyncEnabled)})},style:ye,children:T.isSyncEnabled?r.pause:r.resume}),t("button",{type:"button","data-testid":`directory-allow-${u.id}`,...ee(L),"aria-label":x(D?r.disallowGroupAria:r.allowGroupAria,{group:u.name}),onClick:()=>{let m=C(u.id);if(D&&m){if(!window.confirm(x(r.confirmDisallow,{group:u.name})))return;n({intent:"removeAllowlistGroup",entryId:String(m.id)})}else n({intent:"addAllowlistGroup",groupId:String(u.id)})},style:ye,children:D?r.disallowGroup:r.allowGroup}),t("button",{type:"button","data-testid":`directory-unlink-${u.id}`,...ee(L),"aria-label":x(r.unlinkAria,{group:u.name}),onClick:()=>{window.confirm(x(r.confirmUnlink,{group:u.name,upstream:u.externalLink?.externalKey??""}))&&n({intent:"unlinkDirectoryGroup",groupId:String(u.id)})},style:{...ye,color:"#b91c1c",borderColor:"#fecaca"},children:r.unlink})]})})]},u.id)})})]})})]})}var ae={fontSize:"0.78rem",color:"#475569",fontWeight:600},Pe={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},ce={margin:0,fontSize:"1.05rem",fontWeight:700,color:"#0f172a"},Ae={backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e2e8f0",overflowX:"auto"},H={padding:"0.6rem 0.75rem",fontSize:"0.85rem",verticalAlign:"top"},he={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.4)",display:"flex",overflowY:"auto",padding:"1rem",boxSizing:"border-box",zIndex:100},we={margin:"auto",backgroundColor:"#ffffff",padding:"1.5rem",borderRadius:"8px",width:"360px",maxWidth:"calc(100% - 3rem)",boxShadow:"0 10px 25px rgba(0,0,0,0.15)"};function ee(e){return{"aria-disabled":e,"aria-busy":e,"data-busy":e?"true":void 0}}var ye={...S,padding:"0.25rem 0.6rem",fontSize:_,lineHeight:j,borderRadius:"6px",border:"1px solid #cbd5e1",backgroundColor:"#fff",cursor:"pointer"},Ie={users:$e,groups:Lt,group_members:Gt,allowlist:Tt,directory:Et};function ur({renderHeader:e,pendingSyncPolling:o,basePath:n}){let d=se()?.segment??"users",r=Object.hasOwn(Ie,d)?Ie[d]:$e;return t(Ve,{renderHeader:e,pendingSyncPolling:o,basePath:n,children:t(He.Provider,{value:n,children:t(r,{})})})}export{Tt as AllowlistView,ur as AuthUserAdminAppView,ht as DEFAULT_PENDING_SYNC_POLLING,Et as DirectoryView,Gt as GroupMembersView,Lt as GroupsView,$ as UserAdminInputError,W as UserAdminOperatorError,Ve as UserAdminShell,$e as UsersView,Ot as createInMemoryUserAdminStore,Kt as createUserAdminApp,Q as defaultUserAdminLabels,Pt as jaUserAdminLabels,O as normalizeUpstreamKey,Le as resolveUserAdminLabels,Bt as userAdminAccessFor,qt as userAdminIntents};
|
|
1
|
+
import{resolveVirtualScrollLocale as rt}from"@aiquants/virtualscroll";var Q={title:"Users & Groups",locale:"en",formatLocale:"en-US",timeZone:"UTC",heading:"\u{1F464} User administration",common:{create:"Create",edit:"Edit",delete:"Delete",save:"Save",cancel:"Cancel",actions:"Actions",status:"Status",id:"ID",readOnly:"Read-only",managedUpstream:"Managed upstream",idTemplate:"#{id}",none:"-"},errors:{unknownUpstream:"No group named {key} exists upstream. Check the spelling, or pick one from the list.",directoryDisabled:"This deployment has no directory configured, so groups cannot be linked.",invalidField:"\u201C{field}\u201D is missing or not a value this operation accepts.",unknownIntent:"This screen does not perform that operation.",fieldNames:{groupId:"Group",userId:"User",entryId:"Entry",displayName:"Display name",email:"Email",groupKey:"Group key",name:"Name",provider:"Directory provider",externalKey:"Directory group address",membershipMode:"Membership expansion",isActive:"Active",isSyncEnabled:"Synchronization",pattern:"Pattern",type:"Type"},invalidAllowlistType:"The allowlist type must be either an address or a domain.",unexpected:"The operation failed. The reason is in the server log.",alreadyLinked:"{key} is already linked to {group}. One upstream group can back only one local group.",forbidden:"You do not have permission for this operation. The badge in the header shows what you currently hold; ask an administrator for the rest.",requestTooLarge:"The request was too large to process."},permissions:{label:"Your permissions:",canWrite:"Editable",canRead:"Read only",canDelete:"Delete only",none:"No access",unknown:"Unknown"},tabs:{users:"\u{1F464} Users",groups:"\u{1F465} Groups",groupMembers:"\u{1F517} Members",allowlist:"\u2709\uFE0F Allowlist",directory:"\u{1F504} Directory"},usersView:{title:"Users",sortBy:"Sort by {column}",searchPlaceholder:"Search by name or email...",searchLabel:"Search users",addUser:"\uFF0B Add user",editUser:"Edit user",displayName:"Name",email:"Email",active:"Active",inactive:"Inactive",activate:"Activate",deactivate:"Deactivate",editUserAria:"Edit {user}",activateAria:"Activate {user}",deactivateAria:"Deactivate {user}",emptyFiltered:"No user matches this search.",listSummary:"Showing {shown} of {total} users.",sortedAscending:"{column}, sorted ascending. Activate to sort descending.",sortedDescending:"{column}, sorted descending. Activate to sort ascending.",confirmDeactivate:"Deactivate {user}? They will no longer be able to sign in.",empty:"No user is registered yet."},groupsView:{emptyFiltered:"No group matches this search",createModeLabel:"How to create the group",createModeLocal:"Create locally",createModeUpstream:"Create from a directory group",pickUpstream:"Directory group",pickUpstreamPlaceholder:"Search by name or address...",upstreamOptionMembers:"{count} members",upstreamAlreadyLinked:"already linked to {group}",providerUnset:"This deployment has no directory provider configured, so a directory group cannot be linked yet. Ask an administrator to set it.",pickUpstreamFirst:"Pick a directory group first.",allUpstreamLinked:"Every directory group is already linked to a local group. One upstream group can back only one local group, so unlink one first.",catalogEmpty:"The directory reported no groups as of {at}. Creating from a directory group is unavailable until one exists upstream.",catalogUnavailable:"The directory could not be reached, so the group list is unavailable. Enter the address by hand instead. ({reason})",catalogUnavailableHere:"The directory could not be reached, so creating from a directory group is unavailable. Create the group locally, then link it on the Directory tab. ({reason})",catalogObservedAt:"This list is the directory as of {at}.",catalogStale:"\u26A0 This list is the directory as of {at} and is overdue for a refresh \u2014 a group created since then will not appear.",catalogFailures:{denied:"the directory refused this deployment's credential",rateLimited:"the directory is rate-limiting this deployment",upstreamError:"the directory reported an internal error",neverObserved:"the directory has not been read yet \u2014 the synchronization job may not be running",unknown:"the reason is in the server log"},createUpstreamNotice:"Creates the group and links it in one step. The directory then owns its membership \u2014 and this screen can no longer rename, describe or delete the group. Unlinking is the only way back, and it removes the member ledger and the group-based sign-in permission.",openMembers:"Members",openMembersAria:"Show the members of {group}",title:"Groups",searchPlaceholder:"Search by group name or key...",searchLabel:"Search groups",addGroup:"\uFF0B Add group",editGroup:"Edit group",groupKey:"Group key",name:"Name",description:"Description",memberCountTemplate:"{count} members",confirmDelete:"Delete {group}? Its {count} membership record(s) go with it, and anyone who could sign in only through this group will be locked out.",confirmCreateLinked:"Create {group} and hand its membership to {upstream}? Renaming and deleting it here becomes impossible.",editGroupAria:"Edit {group}",deleteGroupAria:"Delete {group}",noDescription:"No description",groupKeyPlaceholder:"e.g. dev-team",namePlaceholder:"e.g. Development team",empty:"No groups registered"},groupMembersView:{title:"Group members",searchLabel:"Search users",searchPlaceholder:"Search by name or email...",onlyMembers:"Members only ({count})",emptyFiltered:"No user matches this search",summary:"Showing {shown} of {total} users. This group has {members} member(s).",selectGroup:"Select a group",selectPrompt:"Select a group to manage its members",noGroups:"No group exists yet. Create one on the Groups tab first.",emptyNoMembers:"This group has no members yet. Untick \u201CMembers only\u201D to add someone.",noUsers:"No user is registered yet. Add one on the Users tab first.",deepLinkMissed:"Group {id} was not found \u2014 it may have been deleted. Showing {group} instead.",actionAdd:"Add",actionRemove:"Remove",actionAddAria:"Add {user} to this group",actionRemoveAria:"Remove {user} from this group",upstreamNotice:"Membership of this group is owned by the upstream directory. Edit it there \u2014 a local change would be reverted at the next synchronization.",membersOfTemplate:"Members of {group}",groupKeyLabel:"Group key"},allowlistView:{title:"Sign-in allowlist",addEntry:"\uFF0B Add pattern",pattern:"Pattern (e.g. @example.com or user@example.com)",type:"Type",emailType:"Exact email match",domainType:"Domain match",emailTypeShort:"Email",domainTypeShort:"Domain",groupTypeShort:"Group",target:"Target",description:"Description",deploymentOwner:"Deployment-wide",confirmDelete:"Remove {target} from the sign-in allowlist? Anyone who could sign in only through it will be locked out.",deleteAria:"Remove the allowlist entry for {target}",empty:"No allowlist entries registered"},directoryView:{title:"Directory synchronization",membershipMode:"Membership",directMode:"Direct only",transitiveMode:"Nested expanded",lastSynced:"Last synced",neverSynced:"Never",unresolvedTemplate:"{count} unresolved",syncPaused:"Paused",syncEnabled:"Active",syncNow:"Sync now",syncQueued:"Queued",syncAlreadyPending:"A synchronization request for this scope is already waiting, so nothing was queued. If it never completes, the synchronization job may not be running.",linkSyncNotQueued:'The link was created, but a synchronization request could not be queued. Use "Sync now" on the Directory tab.',staleWarning:"Synchronization is overdue. Until it runs, people removed upstream keep their access.",disabledWarning:"Directory synchronization is not wired for this deployment. Existing memberships remain in force and are no longer being refreshed.",pausedTemplate:"{paused} of {total} links are paused",erroredTemplate:"Last synchronization failed for {groups}",erroredItemTemplate:"{group}: {reason}",listSeparator:", ",oldestSyncedTemplate:"oldest successful sync: {at}",pendingTemplate:"{count} sync requests are queued",nothingToLink:"Every group is already linked to a directory.",noGroupsToLink:"No group exists yet. Create one on the Groups tab first.",notWiredNotice:"Directory synchronization is not wired for this deployment, so links cannot be created or changed here.",syncNowAria:"Synchronize {group} now",syncQueuedAria:"A synchronization of {group} is queued",pauseAria:"Pause synchronization of {group}",resumeAria:"Resume synchronization of {group}",allowGroupAria:"Allow members of {group} to sign in",disallowGroupAria:"Stop allowing members of {group} to sign in",unlinkAria:"Unlink {group} from the directory",confirmDisallow:"Stop allowing {group} to sign in? Anyone who could sign in only through it will be locked out.",link:"Link to a directory group",unlink:"Unlink",externalKey:"Upstream group",empty:"No groups are linked to a directory",selectGroup:"Group to link",pickUpstreamPlaceholder:"Search by name or address...",pickerNoOptions:"No matching group",pickerClear:"Clear the selection",pickerToggle:"Show the group list",pickerSelected:"Selected: {value}",externalKeyPlaceholder:"e.g. dev-team@example.com",confirmLink:"Hand {group}'s membership to {upstream}? Renaming, deleting, and editing its members here becomes impossible.",confirmUnlink:"Unlink {group} from {upstream}? Its member ledger and group-based sign-in permission are removed.",pause:"Pause",resume:"Resume",allowGroup:"Allow sign-in",disallowGroup:"Stop allowing sign-in",groupOptionTemplate:"{name} ({key})"}},Pt={title:"\u30E6\u30FC\u30B6\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7\u7BA1\u7406",locale:"ja",formatLocale:"ja-JP",timeZone:"Asia/Tokyo",heading:"\u{1F464} \u30E6\u30FC\u30B6\u30FC\u7BA1\u7406",common:{create:"\u4F5C\u6210",edit:"\u7DE8\u96C6",delete:"\u524A\u9664",save:"\u4FDD\u5B58",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",actions:"\u64CD\u4F5C",status:"\u72B6\u614B",id:"ID",readOnly:"\u5909\u66F4\u4E0D\u53EF",managedUpstream:"\u4E0A\u6D41\u304C\u6240\u6709",idTemplate:"#{id}",none:"-"},errors:{unknownUpstream:"\u4E0A\u6D41\u306B {key} \u3068\u3044\u3046\u30B0\u30EB\u30FC\u30D7\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u7DB4\u308A\u3092\u78BA\u8A8D\u3059\u308B\u304B\u3001\u4E00\u89A7\u304B\u3089\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",directoryDisabled:"\u3053\u306E\u914D\u5099\u306B\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30B0\u30EB\u30FC\u30D7\u3092\u9023\u643A\u3067\u304D\u307E\u305B\u3093\u3002",invalidField:"\u300C{field}\u300D\u304C\u672A\u6307\u5B9A\u304B\u3001\u3053\u306E\u64CD\u4F5C\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u306A\u3044\u5024\u3067\u3059\u3002",unknownIntent:"\u3053\u306E\u753B\u9762\u3067\u306F\u3001\u305D\u306E\u64CD\u4F5C\u3092\u884C\u3044\u307E\u305B\u3093\u3002",fieldNames:{groupId:"\u30B0\u30EB\u30FC\u30D7",userId:"\u30E6\u30FC\u30B6\u30FC",entryId:"\u9805\u76EE",displayName:"\u8868\u793A\u540D",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",groupKey:"\u30B0\u30EB\u30FC\u30D7\u30AD\u30FC",name:"\u540D\u524D",provider:"\u9023\u643A\u30D7\u30ED\u30D0\u30A4\u30C0",externalKey:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u30A2\u30C9\u30EC\u30B9",membershipMode:"\u6240\u5C5E\u306E\u5C55\u958B",isActive:"\u6709\u52B9",isSyncEnabled:"\u540C\u671F",pattern:"\u30D1\u30BF\u30FC\u30F3",type:"\u7A2E\u5225"},invalidAllowlistType:"\u8A31\u53EF\u30EA\u30B9\u30C8\u306E\u7A2E\u5225\u306F\u3001\u30A2\u30C9\u30EC\u30B9\u304B\u30C9\u30E1\u30A4\u30F3\u306E\u3044\u305A\u308C\u304B\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",unexpected:"\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u7406\u7531\u306F\u30B5\u30FC\u30D0\u30FC\u306E\u30ED\u30B0\u306B\u51FA\u3066\u3044\u307E\u3059\u3002",alreadyLinked:"{key} \u306F\u65E2\u306B {group} \u3068\u9023\u643A\u3057\u3066\u3044\u307E\u3059\u30021 \u3064\u306E\u4E0A\u6D41\u30B0\u30EB\u30FC\u30D7\u3092 2 \u3064\u306E\u30ED\u30FC\u30AB\u30EB\u30B0\u30EB\u30FC\u30D7\u3078\u7E4B\u3050\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002",forbidden:"\u3053\u306E\u64CD\u4F5C\u3092\u884C\u3046\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u4ECA\u306E\u6A29\u9650\u306F\u30D8\u30C3\u30C0\u30FC\u306E\u30D0\u30C3\u30B8\u306B\u51FA\u3066\u3044\u307E\u3059\u3002\u5FC5\u8981\u3067\u3042\u308C\u3070\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",requestTooLarge:"\u9001\u4FE1\u3055\u308C\u305F\u5185\u5BB9\u304C\u5927\u304D\u3059\u304E\u308B\u305F\u3081\u51E6\u7406\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},permissions:{label:"\u3042\u306A\u305F\u306E\u6A29\u9650:",canWrite:"\u7DE8\u96C6\u53EF",canRead:"\u95B2\u89A7\u306E\u307F",canDelete:"\u524A\u9664\u306E\u307F",none:"\u6A29\u9650\u306A\u3057",unknown:"\u6A29\u9650\u4E0D\u660E"},tabs:{users:"\u{1F464} \u30E6\u30FC\u30B6\u30FC\u4E00\u89A7",groups:"\u{1F465} \u30E6\u30FC\u30B6\u30FC\u30B0\u30EB\u30FC\u30D7",groupMembers:"\u{1F517} \u30B0\u30EB\u30FC\u30D7\u30E1\u30F3\u30D0\u30FC",allowlist:"\u2709\uFE0F \u30A2\u30AF\u30BB\u30B9\u8A31\u53EF\u30EA\u30B9\u30C8",directory:"\u{1F504} \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u9023\u643A"},usersView:{title:"\u30E6\u30FC\u30B6\u30FC\u7BA1\u7406",sortBy:"{column} \u3067\u4E26\u3079\u66FF\u3048",searchPlaceholder:"\u8868\u793A\u540D\u3084 Email \u3067\u691C\u7D22...",searchLabel:"\u30E6\u30FC\u30B6\u30FC\u3092\u691C\u7D22",addUser:"\uFF0B \u30E6\u30FC\u30B6\u30FC\u8FFD\u52A0",editUser:"\u30E6\u30FC\u30B6\u30FC\u7DE8\u96C6",displayName:"\u8868\u793A\u540D",email:"Email",active:"\u6709\u52B9",inactive:"\u7121\u52B9",activate:"\u6709\u52B9\u5316",deactivate:"\u7121\u52B9\u5316",editUserAria:"{user} \u3092\u7DE8\u96C6",activateAria:"{user} \u3092\u6709\u52B9\u5316",deactivateAria:"{user} \u3092\u7121\u52B9\u5316",emptyFiltered:"\u691C\u7D22\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u5229\u7528\u8005\u306F\u3044\u307E\u305B\u3093\u3002",listSummary:"{total} \u4EBA\u4E2D {shown} \u4EBA\u3092\u8868\u793A\u3057\u3066\u3044\u307E\u3059\u3002",sortedAscending:"{column} (\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048\u4E2D)\u3002\u62BC\u3059\u3068\u964D\u9806\u306B\u306A\u308A\u307E\u3059\u3002",sortedDescending:"{column} (\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048\u4E2D)\u3002\u62BC\u3059\u3068\u6607\u9806\u306B\u306A\u308A\u307E\u3059\u3002",confirmDeactivate:"{user} \u3092\u7121\u52B9\u5316\u3057\u307E\u3059\u304B\uFF1F \u4EE5\u5F8C\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",empty:"\u30E6\u30FC\u30B6\u30FC\u304C\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},groupsView:{emptyFiltered:"\u691C\u7D22\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u30B0\u30EB\u30FC\u30D7\u306F\u3042\u308A\u307E\u305B\u3093",createModeLabel:"\u4F5C\u6210\u65B9\u6CD5",createModeLocal:"\u30ED\u30FC\u30AB\u30EB\u306B\u4F5C\u6210",createModeUpstream:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u4F5C\u6210",pickUpstream:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7",pickUpstreamPlaceholder:"\u540D\u524D\u304B\u30A2\u30C9\u30EC\u30B9\u3067\u691C\u7D22...",upstreamOptionMembers:"{count} \u540D",upstreamAlreadyLinked:"{group} \u3068\u9023\u643A\u6E08\u307F",providerUnset:"\u3053\u306E\u914D\u5099\u306B\u306F\u9023\u643A\u30D7\u30ED\u30D0\u30A4\u30C0\u540D\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u9023\u643A\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u8A2D\u5B9A\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",pickUpstreamFirst:"\u5148\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",allUpstreamLinked:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u306F\u3059\u3079\u3066\u3001\u3044\u305A\u308C\u304B\u306E\u30ED\u30FC\u30AB\u30EB\u30B0\u30EB\u30FC\u30D7\u3068\u9023\u643A\u6E08\u307F\u3067\u3059\u30021 \u3064\u306E\u4E0A\u6D41\u30B0\u30EB\u30FC\u30D7\u3092\u7E4B\u3052\u308B\u5148\u306F 1 \u3064\u3060\u3051\u306A\u306E\u3067\u3001\u7E4B\u304E\u66FF\u3048\u308B\u306B\u306F\u3069\u308C\u304B\u306E\u9023\u643A\u3092\u89E3\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",catalogEmpty:"{at} \u6642\u70B9\u3067\u3001\u4E0A\u6D41\u306B\u30B0\u30EB\u30FC\u30D7\u304C 1 \u3064\u3082\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u4E0A\u6D41\u306B\u30B0\u30EB\u30FC\u30D7\u304C\u3067\u304D\u308B\u307E\u3067\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u4F5C\u6210\u306F\u3067\u304D\u307E\u305B\u3093\u3002",catalogUnavailable:"\u4E0A\u6D41\u3078\u5230\u9054\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30B0\u30EB\u30FC\u30D7\u4E00\u89A7\u3092\u51FA\u305B\u307E\u305B\u3093\u3002\u30A2\u30C9\u30EC\u30B9\u3092\u624B\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002({reason})",catalogUnavailableHere:"\u4E0A\u6D41\u3078\u5230\u9054\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304B\u3089\u306E\u4F5C\u6210\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u30ED\u30FC\u30AB\u30EB\u306B\u4F5C\u6210\u3057\u305F\u3046\u3048\u3067\u3001\u9023\u643A\u30BF\u30D6\u304B\u3089\u9023\u643A\u3057\u3066\u304F\u3060\u3055\u3044\u3002({reason})",catalogObservedAt:"\u3053\u306E\u4E00\u89A7\u306F {at} \u6642\u70B9\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\u3002",catalogStale:"\u26A0 \u3053\u306E\u4E00\u89A7\u306F {at} \u6642\u70B9\u306E\u3082\u306E\u3067\u3001\u66F4\u65B0\u304C\u6EDE\u3063\u3066\u3044\u307E\u3059\u3002\u305D\u308C\u4EE5\u964D\u306B\u4F5C\u3089\u308C\u305F\u30B0\u30EB\u30FC\u30D7\u306F\u51FA\u3066\u304D\u307E\u305B\u3093\u3002",catalogFailures:{denied:"\u3053\u306E\u914D\u5099\u306E\u8CC7\u683C\u60C5\u5831\u304C\u4E0A\u6D41\u306B\u62D2\u5426\u3055\u308C\u307E\u3057\u305F",rateLimited:"\u4E0A\u6D41\u304C\u3053\u306E\u914D\u5099\u306E\u547C\u3073\u51FA\u3057\u3092\u5236\u9650\u3057\u3066\u3044\u307E\u3059",upstreamError:"\u4E0A\u6D41\u304C\u5185\u90E8\u30A8\u30E9\u30FC\u3092\u8FD4\u3057\u307E\u3057\u305F",neverObserved:"\u4E0A\u6D41\u3092\u307E\u3060\u4E00\u5EA6\u3082\u8AAD\u3081\u3066\u3044\u307E\u305B\u3093 (\u540C\u671F\u30B8\u30E7\u30D6\u304C\u52D5\u3044\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)",unknown:"\u7406\u7531\u306F\u30B5\u30FC\u30D0\u30FC\u306E\u30ED\u30B0\u306B\u51FA\u3066\u3044\u307E\u3059"},createUpstreamNotice:"\u30B0\u30EB\u30FC\u30D7\u306E\u4F5C\u6210\u3068\u9023\u643A\u3092 1 \u624B\u3067\u884C\u3044\u307E\u3059\u3002\u4EE5\u5F8C\u3001\u6240\u5C5E\u306F\u4E0A\u6D41\u304C\u6240\u6709\u3057 \u2014 \u3053\u306E\u753B\u9762\u304B\u3089\u306F\u540D\u79F0\u30FB\u8AAC\u660E\u306E\u5909\u66F4\u3082\u524A\u9664\u3082\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002\u623B\u3059\u624B\u6BB5\u306F\u9023\u643A\u89E3\u9664\u3060\u3051\u3067\u3001\u305D\u308C\u306F\u30E1\u30F3\u30D0\u30FC\u53F0\u5E33\u3068\u30B0\u30EB\u30FC\u30D7\u5358\u4F4D\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u3092\u6D88\u3057\u307E\u3059\u3002",openMembers:"\u30E1\u30F3\u30D0\u30FC",openMembersAria:"{group} \u306E\u30E1\u30F3\u30D0\u30FC\u3092\u8868\u793A",title:"\u30E6\u30FC\u30B6\u30FC\u30B0\u30EB\u30FC\u30D7\u7BA1\u7406",searchPlaceholder:"\u30B0\u30EB\u30FC\u30D7\u540D\u3084\u30AD\u30FC\u3067\u691C\u7D22...",searchLabel:"\u30B0\u30EB\u30FC\u30D7\u3092\u691C\u7D22",addGroup:"\uFF0B \u30B0\u30EB\u30FC\u30D7\u8FFD\u52A0",editGroup:"\u30B0\u30EB\u30FC\u30D7\u7DE8\u96C6",groupKey:"\u30B0\u30EB\u30FC\u30D7\u30AD\u30FC",name:"\u540D\u79F0",description:"\u8AAC\u660E",memberCountTemplate:"\u6240\u5C5E {count} \u540D",confirmDelete:"{group} \u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F \u6240\u5C5E {count} \u4EF6\u3082\u4E00\u7DD2\u306B\u6D88\u3048\u3001\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u3067\u3057\u304B\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u3044\u4EBA\u306F\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",confirmCreateLinked:"{group} \u3092\u4F5C\u6210\u3057\u3001\u305D\u306E\u6240\u5C5E\u3092 {upstream} \u306B\u59D4\u306D\u307E\u3059\u304B\uFF1F \u4EE5\u5F8C\u3053\u306E\u753B\u9762\u304B\u3089\u540D\u79F0\u5909\u66F4\u3068\u524A\u9664\u304C\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",editGroupAria:"{group} \u3092\u7DE8\u96C6",deleteGroupAria:"{group} \u3092\u524A\u9664",noDescription:"\u8AAC\u660E\u306A\u3057",groupKeyPlaceholder:"\u4F8B: dev-team",namePlaceholder:"\u4F8B: \u958B\u767A\u30C1\u30FC\u30E0",empty:"\u30E6\u30FC\u30B6\u30FC\u30B0\u30EB\u30FC\u30D7\u304C\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},groupMembersView:{title:"\u30B0\u30EB\u30FC\u30D7\u30E1\u30F3\u30D0\u30FC\u7BA1\u7406",searchLabel:"\u5229\u7528\u8005\u3092\u691C\u7D22",searchPlaceholder:"\u8868\u793A\u540D\u3084 Email \u3067\u691C\u7D22...",onlyMembers:"\u6240\u5C5E\u306E\u307F\u8868\u793A ({count} \u540D)",emptyFiltered:"\u691C\u7D22\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u5229\u7528\u8005\u306F\u3044\u307E\u305B\u3093",summary:"{total} \u540D\u306E\u3046\u3061 {shown} \u540D\u3092\u8868\u793A\u4E2D\u3002\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u306E\u6240\u5C5E\u306F {members} \u540D\u3067\u3059\u3002",selectGroup:"\u30B0\u30EB\u30FC\u30D7\u9078\u629E",selectPrompt:"\u30B0\u30EB\u30FC\u30D7\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",noGroups:"\u30B0\u30EB\u30FC\u30D7\u304C\u307E\u3060 1 \u3064\u3082\u3042\u308A\u307E\u305B\u3093\u3002\u5148\u306B\u30B0\u30EB\u30FC\u30D7\u30BF\u30D6\u3067\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",emptyNoMembers:"\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u306B\u306F\u307E\u3060\u30E1\u30F3\u30D0\u30FC\u304C\u3044\u307E\u305B\u3093\u3002\u300C\u6240\u5C5E\u306E\u307F\u8868\u793A\u300D\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5916\u3059\u3068\u8FFD\u52A0\u3067\u304D\u307E\u3059\u3002",noUsers:"\u5229\u7528\u8005\u304C\u307E\u3060 1 \u4EBA\u3082\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5148\u306B\u30E6\u30FC\u30B6\u30FC\u30BF\u30D6\u3067\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",deepLinkMissed:"\u30B0\u30EB\u30FC\u30D7 {id} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F (\u524A\u9664\u3055\u308C\u305F\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)\u3002\u4EE3\u308F\u308A\u306B {group} \u3092\u8868\u793A\u3057\u3066\u3044\u307E\u3059\u3002",actionAdd:"\u8FFD\u52A0",actionRemove:"\u9664\u5916",actionAddAria:"{user} \u3092\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u3078\u8FFD\u52A0",actionRemoveAria:"{user} \u3092\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u9664\u5916",upstreamNotice:"\u3053\u306E\u30B0\u30EB\u30FC\u30D7\u306E\u6240\u5C5E\u306F\u4E0A\u6D41\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u6240\u6709\u3057\u3066\u3044\u307E\u3059\u3002\u5909\u66F4\u306F\u4E0A\u6D41\u3067\u884C\u3063\u3066\u304F\u3060\u3055\u3044 (\u3053\u3053\u3067\u5909\u3048\u3066\u3082\u6B21\u306E\u540C\u671F\u3067\u5143\u306B\u623B\u308A\u307E\u3059)\u3002",membersOfTemplate:"{group} \u306E\u6240\u5C5E\u30E1\u30F3\u30D0\u30FC",groupKeyLabel:"\u30B0\u30EB\u30FC\u30D7\u30AD\u30FC"},allowlistView:{title:"\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u30EA\u30B9\u30C8",addEntry:"\uFF0B \u30D1\u30BF\u30FC\u30F3\u8FFD\u52A0",pattern:"\u30D1\u30BF\u30FC\u30F3 (\u4F8B: @example.com \u307E\u305F\u306F user@example.com)",type:"\u7A2E\u5225",emailType:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u5B8C\u5168\u4E00\u81F4",domainType:"\u30C9\u30E1\u30A4\u30F3\u4E00\u81F4",emailTypeShort:"\u30E1\u30FC\u30EB",domainTypeShort:"\u30C9\u30E1\u30A4\u30F3",groupTypeShort:"\u30B0\u30EB\u30FC\u30D7",target:"\u5BFE\u8C61",description:"\u8AAC\u660E / \u5099\u8003",deploymentOwner:"\u914D\u5099\u5171\u901A",confirmDelete:"{target} \u3092\u8A31\u53EF\u30EA\u30B9\u30C8\u304B\u3089\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F \u3053\u308C\u3067\u3057\u304B\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u3044\u4EBA\u306F\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",deleteAria:"{target} \u306E\u8A31\u53EF\u3092\u524A\u9664",empty:"\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u30EA\u30B9\u30C8\u306B\u767B\u9332\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},directoryView:{title:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540C\u671F",membershipMode:"\u6240\u5C5E\u306E\u5C55\u958B",directMode:"\u76F4\u63A5\u6240\u5C5E\u306E\u307F",transitiveMode:"\u5165\u308C\u5B50\u3092\u5C55\u958B",lastSynced:"\u6700\u7D42\u540C\u671F",neverSynced:"\u672A\u5B9F\u884C",unresolvedTemplate:"{count} \u4EF6\u304C\u672A\u89E3\u6C7A",syncPaused:"\u505C\u6B62\u4E2D",syncEnabled:"\u6709\u52B9",syncNow:"\u4ECA\u3059\u3050\u540C\u671F",syncQueued:"\u540C\u671F\u3092\u8981\u6C42\u3057\u307E\u3057\u305F",syncAlreadyPending:"\u3053\u306E\u7BC4\u56F2\u306E\u540C\u671F\u8981\u6C42\u306F\u65E2\u306B\u5F85\u6A5F\u4E2D\u306E\u305F\u3081\u3001\u65B0\u3057\u304F\u306F\u7A4D\u307F\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3044\u3064\u307E\u3067\u3082\u5B8C\u4E86\u3057\u306A\u3044\u5834\u5408\u3001\u540C\u671F\u30B8\u30E7\u30D6\u304C\u52D5\u3044\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002",linkSyncNotQueued:"\u9023\u643A\u306F\u4F5C\u6210\u3057\u307E\u3057\u305F\u304C\u3001\u540C\u671F\u8981\u6C42\u3092\u7A4D\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u9023\u643A\u30BF\u30D6\u306E\u300C\u4ECA\u3059\u3050\u540C\u671F\u300D\u3067\u8981\u6C42\u3057\u3066\u304F\u3060\u3055\u3044\u3002",staleWarning:"\u540C\u671F\u304C\u6EDE\u3063\u3066\u3044\u307E\u3059\u3002\u5B9F\u884C\u3055\u308C\u308B\u307E\u3067\u3001\u4E0A\u6D41\u304B\u3089\u5916\u308C\u305F\u4EBA\u306E\u30A2\u30AF\u30BB\u30B9\u306F\u6B8B\u308A\u7D9A\u3051\u307E\u3059\u3002",disabledWarning:"\u3053\u306E\u914D\u5099\u3067\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540C\u671F\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u65E2\u5B58\u306E\u6240\u5C5E\u306F\u305D\u306E\u307E\u307E\u6709\u52B9\u3067\u3001\u66F4\u65B0\u3060\u3051\u304C\u6B62\u307E\u3063\u3066\u3044\u307E\u3059\u3002",pausedTemplate:"\u9023\u643A {total} \u4EF6\u306E\u3046\u3061 {paused} \u4EF6\u304C\u505C\u6B62\u4E2D",erroredTemplate:"\u76F4\u8FD1\u306E\u540C\u671F\u306B\u5931\u6557\u3057\u305F\u30B0\u30EB\u30FC\u30D7: {groups}",erroredItemTemplate:"{group}: {reason}",listSeparator:" / ",oldestSyncedTemplate:"\u6700\u3082\u53E4\u3044\u540C\u671F\u6210\u529F: {at}",pendingTemplate:"{count} \u4EF6\u306E\u540C\u671F\u8981\u6C42\u304C\u672A\u51E6\u7406",nothingToLink:"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u304C\u65E2\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3068\u9023\u643A\u3057\u3066\u3044\u307E\u3059\u3002",noGroupsToLink:"\u30B0\u30EB\u30FC\u30D7\u304C\u307E\u3060 1 \u3064\u3082\u3042\u308A\u307E\u305B\u3093\u3002\u5148\u306B\u30B0\u30EB\u30FC\u30D7\u30BF\u30D6\u3067\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",notWiredNotice:"\u3053\u306E\u914D\u5099\u3067\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540C\u671F\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u3053\u3053\u304B\u3089\u9023\u643A\u306E\u4F5C\u6210\u30FB\u5909\u66F4\u306F\u3067\u304D\u307E\u305B\u3093\u3002",syncNowAria:"{group} \u3092\u4ECA\u3059\u3050\u540C\u671F",syncQueuedAria:"{group} \u306E\u540C\u671F\u3092\u8981\u6C42\u6E08\u307F",pauseAria:"{group} \u306E\u540C\u671F\u3092\u4E00\u6642\u505C\u6B62",resumeAria:"{group} \u306E\u540C\u671F\u3092\u518D\u958B",allowGroupAria:"{group} \u306E\u30E1\u30F3\u30D0\u30FC\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u3092\u8A31\u53EF",disallowGroupAria:"{group} \u306E\u30E1\u30F3\u30D0\u30FC\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u3092\u5916\u3059",unlinkAria:"{group} \u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u9023\u643A\u3092\u89E3\u9664",confirmDisallow:"{group} \u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u3092\u5916\u3057\u307E\u3059\u304B\uFF1F \u3053\u308C\u3067\u3057\u304B\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u3044\u4EBA\u306F\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",link:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30B0\u30EB\u30FC\u30D7\u3068\u9023\u643A\u3059\u308B",unlink:"\u9023\u643A\u3092\u89E3\u9664",externalKey:"\u4E0A\u6D41\u30B0\u30EB\u30FC\u30D7",empty:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3068\u9023\u643A\u3057\u3066\u3044\u308B\u30B0\u30EB\u30FC\u30D7\u306F\u3042\u308A\u307E\u305B\u3093",selectGroup:"\u9023\u643A\u3059\u308B\u30B0\u30EB\u30FC\u30D7",pickUpstreamPlaceholder:"\u540D\u524D\u304B\u30A2\u30C9\u30EC\u30B9\u3067\u691C\u7D22...",pickerNoOptions:"\u4E00\u81F4\u3059\u308B\u30B0\u30EB\u30FC\u30D7\u304C\u3042\u308A\u307E\u305B\u3093",pickerClear:"\u9078\u629E\u3092\u89E3\u9664",pickerToggle:"\u30B0\u30EB\u30FC\u30D7\u4E00\u89A7\u3092\u958B\u304F",pickerSelected:"\u9078\u629E\u4E2D: {value}",externalKeyPlaceholder:"\u4F8B: dev-team@example.com",confirmLink:"{group} \u306E\u6240\u5C5E\u3092 {upstream} \u306B\u59D4\u306D\u307E\u3059\u304B\uFF1F \u4EE5\u5F8C\u3053\u306E\u753B\u9762\u304B\u3089\u540D\u79F0\u5909\u66F4\u30FB\u524A\u9664\u30FB\u30E1\u30F3\u30D0\u30FC\u7DE8\u96C6\u304C\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",confirmUnlink:"{group} \u3068 {upstream} \u306E\u9023\u643A\u3092\u89E3\u9664\u3057\u307E\u3059\u304B\uFF1F \u30E1\u30F3\u30D0\u30FC\u53F0\u5E33\u3068\u30B0\u30EB\u30FC\u30D7\u5358\u4F4D\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u304C\u5931\u308F\u308C\u307E\u3059\u3002",pause:"\u4E00\u6642\u505C\u6B62",resume:"\u518D\u958B",allowGroup:"\u30B5\u30A4\u30F3\u30A4\u30F3\u3092\u8A31\u53EF",disallowGroup:"\u30B5\u30A4\u30F3\u30A4\u30F3\u8A31\u53EF\u3092\u5916\u3059",groupOptionTemplate:"{name} ({key})"}};function ot(e){if(e===void 0)return Q.locale;try{return rt(e)}catch(o){throw o instanceof RangeError?new RangeError(`[auth-react-router] labels.locale is the UI language, not a BCP 47 tag (dates and sorting read labels.formatLocale): ${o.message}`,{cause:o}):o}}function Le(e){let o=Q;return e?{title:e.title??o.title,locale:ot(e.locale),formatLocale:e.formatLocale??o.formatLocale,timeZone:e.timeZone??o.timeZone,heading:e.heading??o.heading,common:{...o.common,...e.common},errors:{...o.errors,...e.errors},permissions:{...o.permissions,...e.permissions},tabs:{...o.tabs,...e.tabs},usersView:{...o.usersView,...e.usersView},groupsView:{...o.groupsView,...e.groupsView},groupMembersView:{...o.groupMembersView,...e.groupMembersView},allowlistView:{...o.allowlistView,...e.allowlistView},directoryView:{...o.directoryView,...e.directoryView}}:o}import{data as le}from"react-router";function x(e,o){return e.replace(/\{(\w+)\}/g,(n,p)=>Object.hasOwn(o,p)?String(o[p]):n)}function te(e,o){let n=/(?:Z|[+-]\d{2}:?\d{2})$/.test(e)?e:`${e}Z`;try{return new Intl.DateTimeFormat(o.formatLocale,{timeZone:o.timeZone,dateStyle:"medium",timeStyle:"short"}).format(new Date(n))}catch{return e}}function Ot(e){let o=e?.users??[{id:1,email:"admin@example.com",displayName:"\u30B7\u30B9\u30C6\u30E0\u7BA1\u7406\u8005",isActive:!0},{id:2,email:"user1@example.com",displayName:"\u958B\u767A \u592A\u90CE",isActive:!0},{id:3,email:"user2@example.com",displayName:"\u55B6\u696D \u82B1\u5B50",isActive:!0}],n=e?.groups??[{id:1,groupKey:"dev-team",name:"\u958B\u767A\u30C1\u30FC\u30E0",description:"\u30B7\u30B9\u30C6\u30E0\u958B\u767A\u62C5\u5F53\u30B0\u30EB\u30FC\u30D7",isActive:!0,readOnly:!1},{id:2,groupKey:"sales-dept",name:"\u55B6\u696D\u90E8",description:"\u55B6\u696D\u30BD\u30EA\u30E5\u30FC\u30B7\u30E7\u30F3\u62C5\u5F53",isActive:!0,readOnly:!1}],p=e?.groupMembers??[{id:1,groupId:1,userId:2},{id:2,groupId:2,userId:3}],d=e?.allowlist??[{id:1,pattern:"admin@example.com",type:"email",description:"\u521D\u671F\u7BA1\u7406\u8005",owner:{kind:"tenant",tenantId:"default"},readOnly:!1},{id:2,pattern:"@example.com",type:"domain",description:"\u793E\u5185\u30C9\u30E1\u30A4\u30F3",owner:{kind:"tenant",tenantId:"default"},readOnly:!1}];return{async listUsers(){return[...o]},async createUser(r){let i={id:Math.max(...o.map(y=>y.id),0)+1,email:r.email,displayName:r.displayName,isActive:!0};return o.push(i),i},async updateUser(r,i){let y=o.findIndex(w=>w.id===r);if(y===-1)throw new W(`User not found: ${r}`);return o[y]={...o[y],displayName:i.displayName,email:i.email},o[y]},async toggleUserActive(r,i){let y=o.findIndex(w=>w.id===r);if(y===-1)throw new W(`User not found: ${r}`);return o[y]={...o[y],isActive:i},o[y]},async listGroups(){return[...n]},async createGroup(r){let i={id:Math.max(...n.map(y=>y.id),0)+1,groupKey:r.groupKey,name:r.name,description:r.description,isActive:!0,readOnly:!1};return n.push(i),i},async updateGroup(r,i){let y=n.findIndex(w=>w.id===r);if(y===-1)throw new W(`Group not found: ${r}`);return n[y]={...n[y],name:i.name,description:i.description},n[y]},async deleteGroup(r){n=n.filter(i=>i.id!==r),p=p.filter(i=>i.groupId!==r)},async listGroupMembers(){return[...p]},async addGroupMember(r,i){let y=p.find(U=>U.groupId===r&&U.userId===i);if(y)return y;let w={id:Math.max(...p.map(U=>U.id),0)+1,groupId:r,userId:i};return p.push(w),w},async removeGroupMember(r,i){p=p.filter(y=>!(y.groupId===r&&y.userId===i))},async listAllowlist(){return[...d]},async addAllowlistEntry(r){let i={id:Math.max(...d.map(y=>y.id),0)+1,pattern:r.pattern,type:r.type,description:r.description,owner:{kind:"tenant",tenantId:"default"},readOnly:!1};return d.push(i),i},async removeAllowlistEntry(r){d=d.filter(i=>i.id!==r)},async addAllowlistGroup(r,i){let y=n.find(w=>w.id===r);if(!y)throw new W(`Group not found: ${r}`);d=[...d,{id:Math.max(...d.map(w=>w.id),0)+1,type:"group",groupId:r,groupKey:y.groupKey,groupName:y.name,description:i,owner:{kind:"tenant",tenantId:"default"},readOnly:!1}]},async removeAllowlistGroup(r){d=d.filter(i=>!(i.type==="group"&&i.id===r))},async linkDirectoryGroup(){throw new W("This in-memory store has no upstream directory; inject a real store to link groups.")},async createLinkedGroup(){throw new W("This in-memory store has no upstream directory; inject a real store to create a linked group.")},async unlinkDirectoryGroup(){throw new W("This in-memory store has no upstream directory; inject a real store to unlink groups.")},async setDirectorySyncEnabled(){throw new W("This in-memory store has no upstream directory; inject a real store to pause synchronization.")},async requestDirectorySync(){throw new W("This in-memory store has no upstream directory; inject a real store to request a sync.")},async getDirectoryStatus(){return{isEnabled:!1,provider:"",linkedGroupCount:0,isStale:!1,pausedGroupCount:0,stalenessThresholdSec:0,erroredGroupIds:[],pendingRequestCount:0}}}}function it(e,o){let n=Number.isFinite(o)&&o>0?o:at;return(Date.now()-e.getTime())/1e3>n}var nt=64*1024,at=5400;async function Ge(e,o,n,p){if(!e)return{kind:"not-wired"};if(!o)return{kind:"not-wired"};try{let{groups:d,observedAt:r}=await e.listGroups(n);return r===null||!Number.isFinite(r.getTime())?{kind:"unavailable",reason:"neverObserved"}:{kind:"ready",groups:d,observedAt:r.toISOString(),isStale:it(r,p)}}catch(d){return console.error("[@aiquants/auth-react-router] directoryCatalog.listGroups failed; the picker falls back to manual entry:",d),{kind:"unavailable",reason:pt(d)}}}function O(e){return e.trim().toLowerCase()}var W=class extends Error{constructor(n){super(n);this.operatorFacing=!0;this.name="UserAdminOperatorError"}};function st(e){return e instanceof W||typeof e=="object"&&e!==null&&e.operatorFacing===!0&&e instanceof Error}var $=class extends Error{constructor(n,p={}){super(n);this.labelKey=n;this.values=p;this.name="UserAdminInputError"}};function Me(e){return typeof e=="object"&&e!==null&&e.status===403}function lt(e){let o=String(e.get("type")??"");if(o==="email"||o==="domain")return o;throw new $("invalidAllowlistType")}var dt=["users","groups","group_members","allowlist","directory"];function ut(e){let o=e.replace(/\.data$/,"").split("/").filter(Boolean),n=o[o.length-1]??"";return dt.includes(n)?n:"users"}var ge=new Map([["createUser",["create"]],["updateUser",["update"]],["toggleUserActive",["update"]],["createGroup",["create"]],["updateGroup",["update"]],["deleteGroup",["delete"]],["addGroupMember",["create"]],["removeGroupMember",["delete"]],["addAllowlistEntry",["create"]],["removeAllowlistEntry",["delete"]],["addAllowlistGroup",["create"]],["removeAllowlistGroup",["delete"]],["createLinkedGroup",["create","update","delete"]],["linkDirectoryGroup",["update","create","delete"]],["unlinkDirectoryGroup",["update","delete"]],["setDirectorySyncEnabled",["update"]],["requestDirectorySync",["update"]],["catalog",["update","create","delete"]]]),Re="read";function qt(){return[...ge.keys()]}function Bt(e){return ge.get(e)??[]}function pt(e){let o=typeof e=="object"&&e!==null&&"status"in e?e.status:void 0;return typeof o!="number"?"unknown":o===401||o===403?"denied":o===429?"rateLimited":o>=500?"upstreamError":"unknown"}function F(e,o){let n=e.get(o),p=Number(n);if(n===null||String(n).trim()===""||!Number.isInteger(p)||p<=0)throw new $("invalidField",{field:o});return p}function K(e,o){let n=String(e.get(o)??"").trim();if(n==="")throw new $("invalidField",{field:o});return n}function ct(e,o){let n=String(e.get(o)??"");if(n!=="true"&&n!=="false")throw new $("invalidField",{field:o});return n==="true"}function Te(e){let o=String(e.get("membershipMode")??"");if(o!=="direct"&&o!=="transitive")throw new $("invalidField",{field:"membershipMode"});return o}function de(e,o){let n=String(e.get(o)??"").trim();return n===""?void 0:n}function Kt(e){let o=Le(e.labels);async function n(g){if(!e.resolveActor)return"user-admin";try{return await e.resolveActor(g)||"user-admin"}catch(a){return console.error("[@aiquants/auth-react-router] resolveActor failed; recording the request as an unnamed actor:",a),"user-admin"}}async function p(g,a){try{return await e.store.requestDirectorySync(g,await n(a))}catch(l){return console.error(`[@aiquants/auth-react-router] the link for group ${g} was created, but its sync request could not be queued:`,l),"not-queued"}}async function d(g){if(!e.directoryCatalog)return!1;let a=ge.get("catalog");if(a===void 0||a.length===0)return!1;try{for(let l of a)await e.guards.requireAccess(g,{action:l,intent:"catalog"});return!0}catch(l){try{e.guards.onDenied?.({intent:"catalog",actions:a,error:l})}catch(b){console.error("[@aiquants/auth-react-router] onDenied threw; the denial itself still stands:",b)}return!1}}async function r(g){try{await e.guards.requireAccess(g,{action:Re,intent:"loader"})}catch(a){if(a instanceof Response||!Me(a))throw a;try{e.guards.onDenied?.({intent:"loader",actions:[Re],error:a})}catch(l){console.error("[@aiquants/auth-react-router] onDenied threw; the denial itself still stands:",l)}throw le(o.errors.forbidden,{status:403,statusText:"Forbidden"})}}async function i({request:g}){await r(g);let a=ut(new URL(g.url).pathname),l=(a==="groups"||a==="directory")&&await d(g),[b,C,L,f,h,G]=await Promise.all([e.store.listUsers(),e.store.listGroups(),e.store.listGroupMembers(),e.store.listAllowlist(),e.store.getDirectoryStatus(),e.getMyPermissions?e.getMyPermissions(g).catch(M=>(console.error("[@aiquants/auth-react-router] getMyPermissions failed; rendering the permission badge as unknown:",M),null)):Promise.resolve(null)]),V=await Ge(e.directoryCatalog,l,g,h.stalenessThresholdSec);return{resourceLabels:e.resourceLabels,segment:a,users:b,groups:C,groupMembers:L,allowlist:f,directoryStatus:h,myPermissions:G,catalog:V,labels:o}}async function y({request:g}){let a=Number(g.headers.get("content-length")??Number.NaN);if(Number.isFinite(a)&&a>nt)return le({ok:!1,error:o.errors.requestTooLarge},{status:413});let l=await g.formData(),b=String(l.get("intent")??""),C=ge.get(b);if(!C)return le({ok:!1,error:o.errors.unknownIntent},{status:400});let L=h=>Me(h),f=h=>{try{e.guards.onDenied?.({intent:b,actions:C,error:h})}catch{}return le({ok:!1,error:o.errors.forbidden},{status:403})};try{for(let h of C)await e.guards.requireAccess(g,{action:h,intent:b})}catch(h){if(!L(h))throw h;return f(h)}try{return await A(b,l,g)}catch(h){if(L(h))return f(h);if(h instanceof Response)throw h;if(h instanceof $){let G=h.values.field,V=typeof G=="string"?{...h.values,field:o.errors.fieldNames[G]??G}:h.values,M=o.errors[h.labelKey];return{ok:!1,error:x(typeof M=="string"?M:String(h.labelKey),V)}}return console.error(`[@aiquants/auth-react-router] intent "${b}" failed:`,h),{ok:!1,error:st(h)?h.message:o.errors.unexpected}}}function w(g,a,l){let b=String(g.get("externalId")??"").trim();if(l.kind==="ready"){if(b!==""&&l.groups.some(f=>f.externalId===b))return b;let C=O(a),L=l.groups.find(f=>O(f.externalKey)===C);if(L)return L.externalId}return b===""?a:b}function U(g){let a=g.provider.trim();if(!g.isEnabled||a==="")throw new $("directoryDisabled");return a}async function v(g,a){let l=O(g),b=O(a),L=(await e.store.listGroups()).find(f=>f.externalLink!==void 0&&(O(f.externalLink.externalId)===l||O(f.externalLink.externalKey)===b));if(L)throw new $("alreadyLinked",{key:a,group:L.name})}function R(g,a,l){if(l.kind!=="ready")return;let b=O(g),C=O(a);if(!l.groups.some(L=>O(L.externalId)===b&&O(L.externalKey)===C))throw new $("unknownUpstream",{key:a})}async function A(g,a,l){let b=null,C=async()=>(b??(b=await e.store.getDirectoryStatus()),b),L=async()=>Ge(e.directoryCatalog,!0,l,(await C()).stalenessThresholdSec);if(g==="createUser")return await e.store.createUser({displayName:K(a,"displayName"),email:K(a,"email")}),{ok:!0};if(g==="updateUser")return await e.store.updateUser(F(a,"userId"),{displayName:K(a,"displayName"),email:K(a,"email")}),{ok:!0};if(g==="toggleUserActive"){let f=String(a.get("isActive")??"");if(f!=="true"&&f!=="false")throw new $("invalidField",{field:"isActive"});return await e.store.toggleUserActive(F(a,"userId"),f==="true"),{ok:!0}}if(g==="createGroup")return await e.store.createGroup({groupKey:K(a,"groupKey"),name:K(a,"name"),description:de(a,"description")}),{ok:!0};if(g==="updateGroup")return await e.store.updateGroup(F(a,"groupId"),{name:K(a,"name"),description:de(a,"description")}),{ok:!0};if(g==="deleteGroup")return await e.store.deleteGroup(F(a,"groupId")),{ok:!0};if(g==="addGroupMember")return await e.store.addGroupMember(F(a,"groupId"),F(a,"userId")),{ok:!0};if(g==="removeGroupMember")return await e.store.removeGroupMember(F(a,"groupId"),F(a,"userId")),{ok:!0};if(g==="addAllowlistEntry"){let f=lt(a);return await e.store.addAllowlistEntry({pattern:K(a,"pattern"),type:f,description:de(a,"description")}),{ok:!0}}if(g==="addAllowlistGroup")return await e.store.addAllowlistGroup(F(a,"groupId"),de(a,"description")),{ok:!0};if(g==="removeAllowlistGroup")return await e.store.removeAllowlistGroup(F(a,"entryId")),{ok:!0};if(g==="createLinkedGroup"){let f=K(a,"externalKey"),h=U(await C()),G=await L(),V=w(a,f,G);await v(V,f),R(V,f,G);let M=await e.store.createLinkedGroup({groupKey:K(a,"groupKey"),name:K(a,"name"),description:de(a,"description"),provider:h,externalId:V,externalKey:f,membershipMode:Te(a)});return{ok:!0,syncRequest:await p(M.id,l)}}if(g==="linkDirectoryGroup"){let f=K(a,"externalKey"),h=U(await C()),G=await L(),V=w(a,f,G);await v(V,f),R(V,f,G);let M=F(a,"groupId");return await e.store.linkDirectoryGroup(M,{provider:h,externalId:V,externalKey:f,membershipMode:Te(a)}),{ok:!0,syncRequest:await p(M,l)}}if(g==="unlinkDirectoryGroup")return await e.store.unlinkDirectoryGroup(F(a,"groupId")),{ok:!0};if(g==="setDirectorySyncEnabled")return await e.store.setDirectorySyncEnabled(F(a,"groupId"),ct(a,"isSyncEnabled")),{ok:!0};if(g==="requestDirectorySync"){let f=String(a.get("groupId")??"").trim();return{ok:!0,syncRequest:await e.store.requestDirectorySync(f===""?null:F(a,"groupId"),await n(l))}}return g==="removeAllowlistEntry"?(await e.store.removeAllowlistEntry(F(a,"entryId")),{ok:!0}):(console.error(`[@aiquants/auth-react-router] intent "${g}" is in the permission table but has no handler`),le({ok:!1,error:o.errors.unknownIntent},{status:400}))}return{loader:i,action:y}}import{useEffect as mt,useRef as gt}from"react";import{Link as yt,useLoaderData as bt,useRevalidator as ft}from"react-router";var S={minWidth:"44px",minHeight:"44px",boxSizing:"border-box"},ie={...S,display:"inline-flex",alignItems:"center"};var _="var(--aqau-font-size-body, 0.8125rem)",j="var(--aqau-line-height-body, 1.25rem)",xe="var(--aqau-font-size-caption, 0.6875rem)",ve="var(--aqau-line-height-caption, 1.25rem)";import{jsx as q,jsxs as re}from"react/jsx-runtime";var ht={intervalMs:3e3,maxMs:3e5};function wt(e,o){let n=ft(),p=gt(n.state);p.current=n.state;let{revalidate:d}=n,{intervalMs:r,maxMs:i}=o;mt(()=>{if(e<=0)return;let y=Date.now(),w=setInterval(()=>{if(Date.now()-y>=i){clearInterval(w);return}p.current==="idle"&&d()},r);return()=>clearInterval(w)},[e,r,i,d])}function Ee({label:e,summary:o}){return re("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.18rem",fontSize:xe,padding:"0.08rem 0.35rem",borderRadius:"9999px",backgroundColor:o.bgColor,color:o.color,border:`1px solid ${o.borderColor}`,fontWeight:600,lineHeight:ve},children:[re("span",{children:[e,":"]}),q("span",{children:o.text})]})}function xt({status:e,labels:o,groups:n}){if(!e||e.linkedGroupCount===0)return null;let p=o.directoryView,d=[];if(e.isEnabled||d.push({id:"disabled",text:p.disabledWarning}),e.pausedGroupCount>0&&d.push({id:"paused",text:x(p.pausedTemplate,{paused:e.pausedGroupCount,total:e.linkedGroupCount})}),e.isStale){let r=e.oldestSyncedAt?te(e.oldestSyncedAt,o):p.neverSynced;d.push({id:"stale",text:`${p.staleWarning} ${x(p.oldestSyncedTemplate,{at:r})}`})}if(e.erroredGroupIds.length>0){let r=e.erroredGroupIds.map(i=>{let y=n.find(U=>U.id===i);if(!y)return x(o.common.idTemplate,{id:i});let w=y.externalLink?.syncError;return w?x(p.erroredItemTemplate,{group:y.name,reason:w}):y.name});d.push({id:"errored",text:x(p.erroredTemplate,{groups:r.join(p.listSeparator)})})}return e.pendingRequestCount>0&&d.push({id:"pending",text:x(p.pendingTemplate,{count:e.pendingRequestCount})}),d.length===0?null:re("section",{"aria-labelledby":"directory-sync-heading","data-testid":"directory-sync-banner",style:{display:"flex",flexDirection:"column",gap:"0.35rem",padding:"0.7rem 1rem",marginBottom:"1rem",borderRadius:"6px",border:"1px solid #fde68a",backgroundColor:"#fffbeb",color:"#92400e",fontSize:"0.85rem"},children:[q("h2",{id:"directory-sync-heading",style:{margin:0,fontSize:"0.9rem",fontWeight:700},children:p.title}),d.map(r=>q("span",{"data-directory-warning":r.id,children:r.text},r.id))]})}function Ve({children:e,renderHeader:o,pendingSyncPolling:n,basePath:p}){let d=bt();wt(d?.directoryStatus?.pendingRequestCount??0,n??ht);let r=d?.segment??"users",i=d?.labels??Q,y=d?.myPermissions??null,w=d?.resourceLabels??{},U=b=>Object.hasOwn(w,b)?w[b]:b,v=[{key:"users",label:i.tabs.users,href:p},{key:"groups",label:i.tabs.groups,href:`${p}/groups`},{key:"group_members",label:i.tabs.groupMembers,href:`${p}/group_members`},{key:"allowlist",label:i.tabs.allowlist,href:`${p}/allowlist`}],R=(d?.groups??[]).some(b=>b.externalLink);(d?.directoryStatus?.isEnabled||(d?.directoryStatus?.linkedGroupCount??0)>0||R)&&v.push({key:"directory",label:i.tabs.directory,href:`${p}/directory`});let A=Object.entries(y??{}),g={text:i.permissions.unknown,color:"#92400e",bgColor:"#fffbeb",borderColor:"#fde68a"},a=b=>b===void 0?g:b.canWrite?{text:i.permissions.canWrite,color:"#047857",bgColor:"#ecfdf5",borderColor:"#a7f3d0"}:b.canRead?{text:i.permissions.canRead,color:"#1d4ed8",bgColor:"#eff6ff",borderColor:"#bfdbfe"}:b.canDelete?{text:i.permissions.canDelete,color:"#b91c1c",bgColor:"#fef2f2",borderColor:"#fecaca"}:{text:i.permissions.none,color:"#475569",bgColor:"#f1f5f9",borderColor:"#cbd5e1"},l=re("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem"},"data-testid":"user-admin-header-annotation",children:[q("span",{style:{fontSize:"0.75rem",backgroundColor:"#e0f2fe",color:"#0369a1",padding:"2px 8px",borderRadius:"12px",fontWeight:600},children:i.heading}),re("div",{style:{display:"inline-flex",alignItems:"center",gap:"0.25rem",fontSize:xe,lineHeight:ve,color:"#475569"},"data-testid":"user-admin-permissions-badge",children:[q("span",{style:{fontWeight:600,color:"#334155"},children:i.permissions.label}),q("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.18rem"},children:A.length===0?q("span",{"data-testid":"user-admin-permission-unavailable",children:q(Ee,{label:i.heading,summary:g})}):A.map(([b,C])=>q(Ee,{label:U(b),summary:a(C)},b))})]})]});return re("div",{"data-testid":"user-admin-shell",style:{width:"100%",minHeight:"100vh",backgroundColor:"#f8fafc",padding:"1.5rem",boxSizing:"border-box"},children:[o?o({title:i.title,annotation:l}):re("div",{style:{marginBottom:"1.5rem",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[q("h1",{style:{margin:0,fontSize:"1.5rem",fontWeight:700,color:"#0f172a"},children:i.title}),l]}),q("nav",{"aria-label":i.title,style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",marginBottom:"1.2rem",borderBottom:"2px solid #e2e8f0",paddingBottom:"0.5rem"},children:v.map(b=>{let C=r===b.key;return q(yt,{to:b.href,"data-testid":`user-admin-tab-${b.key}`,"aria-current":C?"page":void 0,style:{...ie,padding:"0.5rem 1rem",borderRadius:"6px 6px 0 0",fontSize:"0.88rem",fontWeight:C?700:500,color:C?"#0284c7":"#64748b",backgroundColor:C?"#ffffff":"transparent",textDecoration:"none",borderBottom:C?"3px solid #0284c7":"3px solid transparent",transition:"all 0.15s ease"},children:b.label},b.key)})}),q(xt,{status:d?.directoryStatus,labels:i,groups:d?.groups??[]}),q("main",{children:e})]})}import{SelectBox as Ne}from"@aiquants/select-box";import De,{useEffect as ze,useMemo as ne,useRef as oe,useState as P}from"react";import{Link as vt,useFetcher as ue,useLoaderData as se,useSearchParams as kt}from"react-router";import{Fragment as ke,jsx as t,jsxs as c}from"react/jsx-runtime";function Z({result:e,id:o}){let n=e;return n?.ok!==!1||!n.error?null:t("div",{id:o,"data-testid":"user-admin-action-error",role:"alert",style:{padding:"0.7rem 1rem",borderRadius:"6px",border:"1px solid #fecaca",backgroundColor:"#fef2f2",color:"#b91c1c",fontSize:"0.85rem"},children:n.error})}function pe(e){let o=oe(null),[n,p]=P(void 0),d=e.data===n?void 0:e.data;return ze(()=>{if(e.state!=="idle"||e.data===void 0)return;let y=o.current;y&&(o.current=null,e.data.ok===!0&&y(e.data))},[e.state,e.data]),{submit:(y,w)=>{o.current=w??null,p(void 0),e.submit(y,{method:"post"})},resetResult:()=>p(e.data),result:d}}function be(e,o,n){let p=oe(null),d=oe(o);return d.current=o,ze(()=>{if(!e)return;let r=p.current,i=n?.current??document.activeElement,y=()=>{let v=Array.from(r?.querySelectorAll('a[href],button,input:not([type="hidden"]),select,textarea,[tabindex]')??[]).filter(A=>A.tabIndex>=0&&!(A.disabled||A.hasAttribute("inert"))&&A.closest("[inert]")===null&&A.getAttribute("aria-hidden")!=="true"),R=new Set;return v.filter(A=>{let g=A instanceof HTMLInputElement&&A.type==="radio"?A:null;return!g||g.name===""?!0:!g.checked&&v.some(a=>a instanceof HTMLInputElement&&a.type==="radio"&&a.name===g.name&&a.checked)||R.has(g.name)?!1:(R.add(g.name),!0)})},w=y();(w.find(v=>!v.hasAttribute("data-aqar-visually-hidden"))??w[0])?.focus();let U=v=>{if(v.key==="Escape"){if(v.isComposing||v.keyCode===229||v.defaultPrevented)return;v.preventDefault(),d.current();return}if(v.key!=="Tab")return;let R=y();if(R.length===0)return;let A=R[0],g=R[R.length-1],a=document.activeElement,l=!r?.contains(a);v.shiftKey&&(a===A||l)?(v.preventDefault(),g.focus()):!v.shiftKey&&(a===g||l)&&(v.preventDefault(),A.focus())};return document.addEventListener("keydown",U),()=>{document.removeEventListener("keydown",U),i?.focus?.()}},[e,n]),p}function Fe(e,o,n){return e.kind!=="ready"?[]:e.groups.map(p=>{let d=o.get(O(p.externalId))??o.get(O(p.externalKey)),r=d!==void 0,i=p.memberCount===void 0?"":x(n.groupsView.upstreamOptionMembers,{count:p.memberCount});return{label:x(n.directoryView.groupOptionTemplate,{name:p.name,key:p.externalKey}),value:p.externalId,note:r?x(n.groupsView.upstreamAlreadyLinked,{group:d}):i,...r?{disabled:!0}:{},entry:p}})}function Oe({observedAt:e,isStale:o,labels:n}){return t("p",{"data-testid":"catalog-freshness","data-stale":o?"":void 0,style:{margin:"0.35rem 0 0 0",fontSize:"0.72rem",color:o?"#92400e":"#64748b"},children:x(o?n.groupsView.catalogStale:n.groupsView.catalogObservedAt,{at:te(e,n)})})}function fe(e){return typeof e=="object"&&e!==null&&e.ok===!1&&typeof e.error=="string"}var At={exact:{backgroundColor:"#d1fae5",color:"#064e3b",borderRadius:"2px"},fuzzy:{backgroundColor:"#fef3c7",color:"#78350f",borderRadius:"2px"}};function qe(e,o){if(typeof e!="object"||e===null)return null;let n=e.syncRequest;return n==="already-pending"?o.directoryView.syncAlreadyPending:n==="not-queued"?o.directoryView.linkSyncNotQueued:null}function Be(e){let o=new Map;for(let n of e){let p=n.externalLink;p&&(o.set(O(p.externalId),n.name),o.set(O(p.externalKey),n.name))}return o}function Ke(e,o){let{label:n,note:p}=e;return c("span",{"data-aqar-upstream-option":!0,title:p===""?n:`${n} \u2014 ${p}`,style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"0.75rem",width:"100%",minWidth:0},children:[t("span",{"data-aqar-upstream-option-label":!0,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.highlight(n).map((d,r)=>t("span",{"data-aqar-match":d.matchType==="none"?void 0:d.matchType,style:d.matchType==="none"?void 0:At[d.matchType],children:d.text},r))}),p===""?null:t("span",{"data-aqar-upstream-option-note":!0,style:{flexShrink:0,fontSize:"0.72rem",opacity:.75},children:p})]})}function We(e){let o=e.directoryView;return{noOptions:o.pickerNoOptions,clear:o.pickerClear,toggle:o.pickerToggle,selection:n=>x(o.pickerSelected,{value:n.map(p=>p.label).join(", ")})}}function St(e){try{return new Intl.Collator(e).compare}catch{return new Intl.Collator().compare}}function Ct(e){return(e.split("@")[0]??e).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function $e(){let e=se(),o=ue(),{submit:n,resetResult:p,result:d}=pe(o),r=e.labels??Q,[i,y]=P(""),[w,U]=P(null),v=w?.kind==="edit"?w.user:null,R=w?.kind==="create",A=oe(null),g=(m,N)=>{A.current=N.currentTarget,p(),m.kind==="create"&&(l(""),C("")),U(m)},[a,l]=P(""),[b,C]=P(""),L=be(R,()=>U(null),A),f=be(v!==null,()=>U(null),A),h=o.state!=="idle",[G,V]=P({column:"displayName",ascending:!0}),M=St(r.formatLocale),B=i.trim().toLowerCase(),k=e.users.filter(m=>m.displayName.toLowerCase().includes(B)||m.email.toLowerCase().includes(B)).slice().sort((m,N)=>{let Y=G.ascending?1:-1;return G.column==="id"?(m.id-N.id)*Y:G.column==="isActive"?(Number(m.isActive)-Number(N.isActive))*Y:M(m[G.column],N[G.column])*Y}),I=m=>{V(N=>N.column===m?{column:m,ascending:!N.ascending}:{column:m,ascending:!0})},u=m=>{h||m.isActive&&!window.confirm(x(r.usersView.confirmDeactivate,{user:m.displayName}))||n({intent:"toggleUserActive",userId:String(m.id),isActive:String(!m.isActive)})},T=m=>{if(m.preventDefault(),!(a&&b))return;let N=a,Y=b;n({intent:"createUser",displayName:N,email:Y},()=>{l(X=>X===N?"":X),C(X=>X===Y?"":X),U(null)})},D=m=>{m.preventDefault(),v&&n({intent:"updateUser",userId:String(v.id),displayName:v.displayName,email:v.email},()=>U(null))};return c("section",{"data-testid":"users-view-section",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t("h2",{style:ce,children:r.usersView.title}),!w&&t(Z,{result:d}),c("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",justifyContent:"space-between",alignItems:"center",backgroundColor:"#ffffff",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:[t("input",{type:"text","aria-label":r.usersView.searchLabel,placeholder:r.usersView.searchPlaceholder,value:i,onChange:m=>y(m.target.value),"data-testid":"users-search-input",style:{...S,padding:"6px 12px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem",width:"260px",maxWidth:"100%"}}),t("button",{type:"button",onClick:m=>g({kind:"create"},m),"data-testid":"users-add-button",style:{...S,padding:"6px 14px",borderRadius:"6px",backgroundColor:"#0284c7",color:"#ffffff",border:"none",fontSize:"0.85rem",fontWeight:600,cursor:"pointer"},children:r.usersView.addUser})]}),t("p",{"data-testid":"users-summary",role:"status","aria-live":"polite",style:{margin:0,fontSize:"0.78rem",color:"#475569"},children:x(r.usersView.listSummary,{shown:k.length,total:e.users.length})}),t("div",{style:Ae,children:c("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.85rem",textAlign:"left"},children:[t("thead",{children:c("tr",{style:{backgroundColor:"#f8fafc",borderBottom:"1px solid #e2e8f0",color:"#475569"},children:[[["id",r.common.id],["displayName",r.usersView.displayName],["email",r.usersView.email],["isActive",r.common.status]].map(([m,N])=>t("th",{scope:"col",style:{padding:0},"aria-sort":G.column===m?G.ascending?"ascending":"descending":"none",children:c("button",{type:"button","data-testid":`users-sort-${m}`,onClick:()=>I(m),"aria-label":x(G.column===m?G.ascending?r.usersView.sortedAscending:r.usersView.sortedDescending:r.usersView.sortBy,{column:N}),style:{...S,width:"100%",padding:"10px 14px",textAlign:"left",background:"transparent",border:"none",cursor:"pointer",font:"inherit",color:"inherit",fontWeight:G.column===m?700:500},children:[N,t("span",{"aria-hidden":"true",style:{marginLeft:"4px",opacity:G.column===m?1:.35},children:G.column===m?G.ascending?"\u25B2":"\u25BC":"\u21C5"})]})},m)),t("th",{scope:"col",style:{padding:"10px 14px",textAlign:"right"},children:r.common.actions})]})}),c("tbody",{children:[k.map(m=>c("tr",{style:{borderBottom:"1px solid #f1f5f9"},"data-testid":`user-row-${m.id}`,children:[t("td",{style:{padding:"10px 14px",color:"#475569"},children:x(r.common.idTemplate,{id:m.id})}),t("td",{style:{padding:"10px 14px",fontWeight:600,color:"#0f172a"},children:m.displayName}),t("td",{style:{padding:"10px 14px",color:"#475569"},children:m.email}),t("td",{style:{padding:"10px 14px"},children:t("span",{style:{fontSize:"0.75rem",padding:"2px 8px",borderRadius:"10px",backgroundColor:m.isActive?"#dcfce7":"#fee2e2",color:m.isActive?"#15803d":"#b91c1c",fontWeight:600},children:m.isActive?r.usersView.active:r.usersView.inactive})}),t("td",{style:{padding:"4px 14px",textAlign:"right"},children:c("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:"6px"},children:[t("button",{type:"button",onClick:N=>g({kind:"edit",user:m},N),"aria-label":x(r.usersView.editUserAria,{user:m.displayName}),"data-testid":`edit-user-btn-${m.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",fontSize:_,lineHeight:j,cursor:"pointer"},children:r.common.edit}),t("button",{type:"button",onClick:()=>u(m),...ee(h),"aria-label":x(m.isActive?r.usersView.deactivateAria:r.usersView.activateAria,{user:m.displayName}),"data-testid":`toggle-user-btn-${m.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",fontSize:_,lineHeight:j,cursor:h?"default":"pointer",color:m.isActive?"#b91c1c":"#15803d"},children:m.isActive?r.usersView.deactivate:r.usersView.activate})]})})]},m.id)),k.length===0&&t("tr",{children:t("td",{colSpan:5,style:{padding:"2rem",textAlign:"center",color:"#475569"},children:B===""?r.usersView.empty:r.usersView.emptyFiltered})})]})]})}),R&&t("div",{style:he,children:c("form",{ref:L,onSubmit:T,role:"dialog","aria-modal":"true","aria-labelledby":"create-user-title",...fe(d)?{"aria-describedby":"create-user-error"}:{},"data-testid":"user-create-modal",style:we,children:[t("h3",{id:"create-user-title",style:{margin:"0 0 1rem 0",fontSize:"1.1rem"},children:r.usersView.addUser}),t(Z,{result:d,id:"create-user-error"}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"create-user-display-name-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:r.usersView.displayName}),t("input",{id:"create-user-display-name-input",type:"text",value:a,onChange:m=>l(m.target.value),required:!0,"data-testid":"create-user-display-name",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1.2rem"},children:[t("label",{htmlFor:"create-user-email-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:r.usersView.email}),t("input",{id:"create-user-email-input",type:"email",value:b,onChange:m=>C(m.target.value),required:!0,"data-testid":"create-user-email",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[t("button",{type:"button",onClick:()=>U(null),"data-testid":"cancel-create-user",style:{...S,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer"},children:r.common.cancel}),t("button",{type:"submit","data-testid":"submit-create-user",disabled:h,"aria-busy":h,style:{...S,padding:"6px 12px",borderRadius:"4px",backgroundColor:"#0284c7",color:"#ffffff",border:"none",cursor:"pointer"},children:r.common.create})]})]})}),v&&t("div",{style:he,children:c("form",{ref:f,onSubmit:D,role:"dialog","aria-modal":"true","aria-labelledby":"edit-user-title",...fe(d)?{"aria-describedby":"edit-user-error"}:{},"data-testid":"user-edit-modal",style:we,children:[t("h3",{id:"edit-user-title",style:{margin:"0 0 1rem 0",fontSize:"1.1rem"},children:r.usersView.editUser}),t(Z,{result:d,id:"edit-user-error"}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"edit-user-display-name-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:r.usersView.displayName}),t("input",{id:"edit-user-display-name-input",type:"text",value:v.displayName,onChange:m=>U({kind:"edit",user:{...v,displayName:m.target.value}}),required:!0,"data-testid":"edit-user-display-name",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1.2rem"},children:[t("label",{htmlFor:"edit-user-email-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:r.usersView.email}),t("input",{id:"edit-user-email-input",type:"email",value:v.email,onChange:m=>U({kind:"edit",user:{...v,email:m.target.value}}),required:!0,"data-testid":"edit-user-email",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[t("button",{type:"button",onClick:()=>U(null),style:{...S,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer"},children:r.common.cancel}),t("button",{type:"submit","data-testid":"submit-edit-user",disabled:h,"aria-busy":h,style:{...S,padding:"6px 12px",borderRadius:"4px",backgroundColor:"#0284c7",color:"#ffffff",border:"none",cursor:"pointer"},children:r.common.save})]})]})})]})}var He=De.createContext(null);function Ut(){return De.useContext(He)??""}function Lt(){let e=Ut(),o=se(),n=ue(),{submit:p,resetResult:d,result:r}=pe(n),i=o.labels??Q,y=qe(r,i),[w,U]=P(""),[v,R]=P(null),A=v?.kind==="edit"?v.group:null,g=v?.kind==="create",a=oe(null),l=(s,E)=>{a.current=E.currentTarget,d(),s.kind==="create"&&Ze(),R(s)},b=n.state!=="idle",[C,L]=P(""),[f,h]=P(""),[G,V]=P(""),[M,B]=P("local"),[k,I]=P(null),[u,T]=P(null),[D,m]=P("direct"),N=oe(null),Y=ne(()=>{let s=new Map;for(let E of o.groupMembers)s.set(E.groupId,(s.get(E.groupId)??0)+1);return s},[o.groupMembers]),X=ne(()=>Be(o.groups),[o.groups]),me=ne(()=>Fe(o.catalog,X,i),[o.catalog,X,i]),_e=ne(()=>me.filter(s=>s.disabled!==!0).length,[me]),Se=o.catalog.kind==="ready"&&o.catalog.groups.length>0&&o.directoryStatus.provider!=="",je=be(g,()=>R(null),a),Qe=be(A!==null,()=>R(null),a),Ce=w.trim().toLowerCase(),Ue=o.groups.filter(s=>s.name.toLowerCase().includes(Ce)||s.groupKey.toLowerCase().includes(Ce)),Ze=()=>{L(""),h(""),V(""),B("local"),T(null),m("direct"),N.current=null},Ye=s=>{if(s.preventDefault(),!(C&&f)||M==="upstream"&&u===null||M==="upstream"&&u!==null&&!window.confirm(x(i.groupsView.confirmCreateLinked,{group:f,upstream:u.externalKey})))return;let E={key:C,name:f,description:G},z=()=>{L(J=>J===E.key?"":J),h(J=>J===E.name?"":J),V(J=>J===E.description?"":J),T(null),R(null)};if(M==="upstream"&&u!==null){p({intent:"createLinkedGroup",groupKey:E.key,name:E.name,description:E.description,provider:o.directoryStatus.provider,externalKey:u.externalKey,membershipMode:D},z);return}p({intent:"createGroup",groupKey:E.key,name:E.name,description:E.description},z)},Xe=s=>{if(T(s),!s)return;let E={key:Ct(s.externalKey),name:s.name,description:s.description??""};h(E.name),L(E.key),V(E.description),N.current=E},Je=s=>{if(B(s),s==="upstream")return;T(null);let E=N.current;E&&(L(z=>z===E.key?"":z),h(z=>z===E.name?"":z),V(z=>z===E.description?"":z),N.current=null)},et=s=>{s.preventDefault(),A&&p({intent:"updateGroup",groupId:String(A.id),name:A.name,description:A.description??""},()=>R(null))},tt=s=>{if(b)return;let E=o.groupMembers.filter(z=>z.groupId===s.id).length;window.confirm(x(i.groupsView.confirmDelete,{group:s.name,count:E}))&&p({intent:"deleteGroup",groupId:String(s.id)})};return c("section",{"data-testid":"groups-view-section",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t("h2",{style:ce,children:i.groupsView.title}),!v&&t(Z,{result:r}),t("p",{"data-testid":"groups-sync-request-notice",role:"status","aria-live":"polite",hidden:y===null,style:y===null?void 0:{margin:0,padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.8rem"},children:y}),c("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",justifyContent:"space-between",alignItems:"center",backgroundColor:"#ffffff",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:[t("input",{type:"text","aria-label":i.groupsView.searchLabel,placeholder:i.groupsView.searchPlaceholder,value:w,onChange:s=>U(s.target.value),"data-testid":"groups-search-input",style:{...S,padding:"6px 12px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem",width:"260px",maxWidth:"100%"}}),t("button",{type:"button",onClick:s=>l({kind:"create"},s),"data-testid":"groups-add-button",style:{...S,padding:"6px 14px",borderRadius:"6px",backgroundColor:"#4338ca",color:"#ffffff",border:"none",fontSize:"0.85rem",fontWeight:600,cursor:"pointer"},children:i.groupsView.addGroup})]}),t("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"1rem"},children:Ue.map(s=>{let E=Y.get(s.id)??0;return c("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e2e8f0",padding:"1rem",display:"flex",flexDirection:"column",justifyContent:"space-between"},"data-testid":`group-card-${s.id}`,"data-group-readonly":s.readOnly?"true":"false",children:[c("div",{children:[c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.5rem"},children:[t("h3",{style:{margin:0,fontSize:"1rem",color:"#0f172a"},children:s.name}),t("span",{style:{fontSize:"0.72rem",backgroundColor:"#e0e7ff",color:"#4338ca",padding:"2px 6px",borderRadius:"4px",fontFamily:"monospace"},children:s.groupKey})]}),t("p",{style:{margin:"0 0 0.8rem 0",fontSize:"0.82rem",color:"#64748b",minHeight:"2.4em"},children:s.description||i.groupsView.noDescription}),s.externalLink&&c("div",{"data-testid":`group-source-${s.id}`,style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap",marginBottom:"0.6rem"},children:[t("span",{style:{fontSize:"0.72rem",padding:"2px 8px",borderRadius:"10px",backgroundColor:"#ede9fe",color:"#6d28d9",fontWeight:600},children:i.common.managedUpstream}),t("span",{style:{fontSize:"0.72rem",fontFamily:"monospace",color:"#64748b"},children:s.externalLink.externalKey}),s.externalLink.unresolvedCount>0&&t("span",{"data-testid":`group-unresolved-${s.id}`,style:{fontSize:"0.72rem",color:"#b45309"},children:x(i.directoryView.unresolvedTemplate,{count:s.externalLink.unresolvedCount})})]})]}),c("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid #f1f5f9",paddingTop:"0.6rem"},children:[t(vt,{to:`${e}/group_members?group=${s.id}`,"data-testid":`group-open-members-${s.id}`,"aria-label":x(i.groupsView.openMembersAria,{group:s.name}),style:{...ie,fontSize:_,lineHeight:j,color:"#1d4ed8",textDecoration:"none"},children:x(i.groupsView.memberCountTemplate,{count:E})}),s.readOnly?t("span",{"data-testid":`readonly-group-${s.id}`,style:{fontSize:"0.75rem",color:"#475569"},children:i.common.readOnly}):c("div",{style:{display:"flex",gap:"4px"},children:[t("button",{type:"button",onClick:z=>l({kind:"edit",group:s},z),...ee(b),"aria-label":x(i.groupsView.editGroupAria,{group:s.name}),"data-testid":`edit-group-btn-${s.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",fontSize:_,lineHeight:j,cursor:"pointer"},children:i.common.edit}),t("button",{type:"button",onClick:()=>tt(s),...ee(b),"aria-label":x(i.groupsView.deleteGroupAria,{group:s.name}),"data-testid":`delete-group-btn-${s.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #fee2e2",backgroundColor:"#fff5f5",color:"#b91c1c",fontSize:_,lineHeight:j,cursor:"pointer"},children:i.common.delete})]})]})]},s.id)})}),Ue.length===0&&t("div",{"data-testid":"groups-empty",style:{padding:"2rem",textAlign:"center",color:"#475569",backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e2e8f0"},children:o.groups.length===0?i.groupsView.empty:i.groupsView.emptyFiltered}),g&&t("div",{style:he,children:c("form",{ref:je,onSubmit:Ye,role:"dialog","aria-modal":"true","aria-labelledby":"create-group-title",...fe(r)?{"aria-describedby":"create-group-error"}:{},"data-testid":"group-create-modal",style:we,children:[t("h3",{id:"create-group-title",style:{margin:"0 0 1rem 0",fontSize:"1.1rem"},children:i.groupsView.addGroup}),t(Z,{result:r,id:"create-group-error"}),Se&&c("fieldset",{"data-testid":"create-group-mode",style:{display:"flex",gap:"0.25rem",marginBottom:"1rem",border:"none",padding:0,margin:"0 0 1rem 0"},children:[t("legend",{style:Pe,children:i.groupsView.createModeLabel}),["local","upstream"].map(s=>c("label",{"data-aqar-create-mode":s,"data-selected":M===s?"":void 0,"data-focused":k===s?"":void 0,style:{...ie,justifyContent:"center",outline:k===s?"2px solid #4338ca":void 0,outlineOffset:"2px",flex:1,padding:"0.4rem 0.6rem",fontSize:_,lineHeight:j,borderRadius:"6px",cursor:"pointer",textAlign:"center",border:M===s?"1px solid #4338ca":"1px solid #cbd5e1",backgroundColor:M===s?"#eef2ff":"#ffffff",color:M===s?"#3730a3":"#475569",fontWeight:M===s?700:500},children:[t("input",{type:"radio",name:"create-group-mode",value:s,checked:M===s,onChange:()=>Je(s),"data-testid":`create-group-mode-${s}`,"data-aqar-visually-hidden":!0,onFocus:()=>I(s),onBlur:()=>I(E=>E===s?null:E),style:Pe}),s==="local"?i.groupsView.createModeLocal:i.groupsView.createModeUpstream]},s))]}),o.catalog.kind==="ready"&&o.catalog.groups.length===0&&t("p",{"data-testid":"create-group-catalog-empty",role:"note",style:{margin:"0 0 1rem 0",padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#f8fafc",border:"1px solid #e2e8f0",color:"#475569",fontSize:"0.78rem"},children:x(i.groupsView.catalogEmpty,{at:te(o.catalog.observedAt??"",i)})}),o.catalog.kind==="ready"&&o.catalog.groups.length>0&&o.directoryStatus.provider===""&&t("p",{"data-testid":"create-group-provider-unset",role:"note",style:{margin:"0 0 1rem 0",padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.78rem"},children:i.groupsView.providerUnset}),o.catalog.kind==="unavailable"&&t("p",{"data-testid":"create-group-catalog-unavailable",role:"note",style:{margin:"0 0 1rem 0",padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.78rem"},children:x(i.groupsView.catalogUnavailableHere,{reason:i.groupsView.catalogFailures[o.catalog.reason]})}),M==="upstream"&&Se&&o.catalog.kind==="ready"&&c("div",{style:{marginBottom:"1rem"},children:[t("p",{"data-testid":"create-group-upstream-notice",role:"note",style:{margin:"0 0 0.5rem 0",fontSize:"0.78rem",color:"#5b21b6"},children:i.groupsView.createUpstreamNotice}),t("div",{id:"create-group-upstream-label",style:ae,children:i.groupsView.pickUpstream}),t("div",{"data-testid":"create-group-upstream-picker",onKeyDown:s=>{s.nativeEvent.isComposing||s.nativeEvent.keyCode===229||s.key==="Enter"&&s.preventDefault()},children:t(Ne,{options:me,value:u===null?null:me.find(s=>s.value===u.externalId)??null,onChange:s=>Xe(s===null?null:s.entry),placeholder:i.groupsView.pickUpstreamPlaceholder,ariaLabelledBy:"create-group-upstream-label",renderOption:Ke,locale:i.locale,labels:We(i),clearable:!0})}),t(Oe,{observedAt:o.catalog.observedAt,isStale:o.catalog.isStale,labels:i}),c("div",{style:{marginTop:"0.6rem"},children:[t("label",{htmlFor:"create-group-membership-mode",style:ae,children:i.directoryView.membershipMode}),c("select",{id:"create-group-membership-mode","data-testid":"create-group-membership-mode",value:D,onChange:s=>m(s.target.value),style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"},children:[t("option",{value:"direct",children:i.directoryView.directMode}),t("option",{value:"transitive",children:i.directoryView.transitiveMode})]})]})]}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"create-group-key-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.groupKey}),t("input",{id:"create-group-key-input",type:"text",value:C,onChange:s=>L(s.target.value),placeholder:i.groupsView.groupKeyPlaceholder,required:!0,"data-testid":"create-group-key",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"create-group-name-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.name}),t("input",{id:"create-group-name-input",type:"text",value:f,onChange:s=>h(s.target.value),placeholder:i.groupsView.namePlaceholder,required:!0,"data-testid":"create-group-name",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1.2rem"},children:[t("label",{htmlFor:"create-group-desc-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.description}),t("textarea",{id:"create-group-desc-input",value:G,onChange:s=>V(s.target.value),"data-testid":"create-group-description",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1",height:"60px"}})]}),M==="upstream"&&u===null&&t("p",{id:"create-group-submit-hint","data-testid":"create-group-submit-hint",style:{margin:"0 0 0.6rem 0",fontSize:"0.78rem",color:"#475569",textAlign:"right"},children:_e>0?i.groupsView.pickUpstreamFirst:i.groupsView.allUpstreamLinked}),c("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[t("button",{type:"button",onClick:()=>R(null),"data-testid":"cancel-create-group",style:{...S,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer"},children:i.common.cancel}),t("button",{type:"submit","data-testid":"submit-create-group",disabled:b||M==="upstream"&&u===null,"aria-busy":b,...M==="upstream"&&u===null?{"aria-describedby":"create-group-submit-hint"}:{},style:{...S,padding:"6px 12px",borderRadius:"4px",backgroundColor:b||M==="upstream"&&u===null?"#a5b4fc":"#4338ca",color:"#ffffff",border:"none",cursor:b||M==="upstream"&&u===null?"not-allowed":"pointer"},children:i.common.create})]})]})}),A&&t("div",{style:he,children:c("form",{ref:Qe,onSubmit:et,role:"dialog","aria-modal":"true","aria-labelledby":"edit-group-title",...fe(r)?{"aria-describedby":"edit-group-error"}:{},"data-testid":"group-edit-modal",style:we,children:[t("h3",{id:"edit-group-title",style:{margin:"0 0 1rem 0",fontSize:"1.1rem"},children:i.groupsView.editGroup}),t(Z,{result:r,id:"edit-group-error"}),c("div",{style:{marginBottom:"1rem"},children:[t("label",{htmlFor:"edit-group-name-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.name}),t("input",{id:"edit-group-name-input",type:"text",value:A.name,onChange:s=>R({kind:"edit",group:{...A,name:s.target.value}}),required:!0,"data-testid":"edit-group-name",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1"}})]}),c("div",{style:{marginBottom:"1.2rem"},children:[t("label",{htmlFor:"edit-group-desc-input",style:{display:"block",fontSize:"0.8rem",color:"#475569",marginBottom:"4px"},children:i.groupsView.description}),t("textarea",{id:"edit-group-desc-input",value:A.description??"",onChange:s=>R({kind:"edit",group:{...A,description:s.target.value}}),"data-testid":"edit-group-description",style:{...S,width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid #cbd5e1",height:"60px"}})]}),c("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem"},children:[t("button",{type:"button",onClick:()=>R(null),style:{...S,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer"},children:i.common.cancel}),t("button",{type:"submit","data-testid":"submit-edit-group",disabled:b,"aria-busy":b,style:{...S,padding:"6px 12px",borderRadius:"4px",backgroundColor:"#4338ca",color:"#ffffff",border:"none",cursor:"pointer"},children:i.common.save})]})]})})]})}function Gt(){let e=se(),o=ue(),{submit:n,result:p}=pe(o),d=o.state!=="idle",r=e.labels??Q,[i]=kt(),y=Number(i.get("group")??""),w=Number.isInteger(y)&&y>0?y:null,[U,v]=P(null),[R,A]=P(new Set),g=oe(w);g.current!==w&&(g.current=w,w!==null&&(v(w),A(new Set)));let[a,l]=P(""),[b,C]=P(!1),L=U??w??e.groups[0]?.id??null,f=e.groups.find(k=>k.id===L)??e.groups[0],h=L!==null&&f!==void 0&&f.id!==L?L:null,G=new Set(e.groupMembers.filter(k=>k.groupId===f?.id).map(k=>k.userId)),V=a.trim().toLowerCase(),M=e.users.filter(k=>b&&!G.has(k.id)&&!R.has(k.id)?!1:V===""?!0:k.displayName.toLowerCase().includes(V)||k.email.toLowerCase().includes(V)),B=(k,I)=>{if(d||!f)return;let u=String(f.id);I?(A(T=>new Set(T).add(k)),n({intent:"removeGroupMember",groupId:u,userId:String(k)})):(A(T=>{if(!T.has(k))return T;let D=new Set(T);return D.delete(k),D}),n({intent:"addGroupMember",groupId:u,userId:String(k)}))};return c("section",{"data-testid":"group-members-view-section",style:{display:"flex",flexDirection:"column",gap:"1.2rem"},children:[t("h2",{style:ce,children:r.groupMembersView.title}),t(Z,{result:p}),h!==null&&t("p",{"data-testid":"member-deep-link-missed",role:"note",style:{margin:0,padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.8rem"},children:x(r.groupMembersView.deepLinkMissed,{id:h,group:f?.name??""})}),c("div",{"data-testid":"group-members-layout",style:{display:"flex",flexWrap:"wrap",gap:"1.2rem"},children:[c("div",{"data-testid":"group-members-picker",style:{flexGrow:1,flexBasis:"240px",boxSizing:"border-box",backgroundColor:"#ffffff",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:[t("h3",{style:{margin:"0 0 0.8rem 0",fontSize:"0.9rem",color:"#475569"},children:r.groupMembersView.selectGroup}),t("div",{style:{display:"flex",flexDirection:"column",gap:"0.4rem"},children:e.groups.map(k=>{let I=k.id===f?.id;return c("button",{type:"button",onClick:()=>{v(k.id),A(new Set)},"data-testid":`select-group-btn-${k.id}`,style:{...S,textAlign:"left",padding:"8px 10px",borderRadius:"6px",border:I?"1px solid #6366f1":"1px solid #e2e8f0",backgroundColor:I?"#e0e7ff":"#ffffff",color:I?"#3730a3":"#0f172a",cursor:"pointer",fontWeight:I?600:400,fontSize:"0.85rem"},children:[k.name,k.readOnly?t("span",{"data-testid":`group-upstream-marker-${k.id}`,style:{marginLeft:"6px",fontSize:"0.7rem",color:"#7c3aed"},children:r.common.managedUpstream}):null]},k.id)})})]}),t("div",{"data-testid":"group-members-panel",style:{flexGrow:999,flexBasis:0,minWidth:"50%",boxSizing:"border-box",backgroundColor:"#ffffff",padding:"1.2rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:f?c(ke,{children:[c("div",{style:{marginBottom:"1rem",borderBottom:"1px solid #e2e8f0",paddingBottom:"0.8rem"},children:[t("h3",{style:{margin:0,fontSize:"1.1rem",color:"#0f172a"},children:x(r.groupMembersView.membersOfTemplate,{group:f.name})}),c("span",{style:{fontSize:"0.8rem",color:"#64748b"},children:[r.groupMembersView.groupKeyLabel,": ",f.groupKey]}),f.readOnly?t("div",{"data-testid":"group-members-upstream-notice",role:"note",style:{marginTop:"0.5rem",padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#f5f3ff",border:"1px solid #ddd6fe",color:"#5b21b6",fontSize:"0.8rem"},children:r.groupMembersView.upstreamNotice}):null]}),c("div",{style:{display:"flex",gap:"0.75rem",alignItems:"center",flexWrap:"wrap",marginBottom:"0.8rem"},children:[t("input",{type:"search","aria-label":r.groupMembersView.searchLabel,placeholder:r.groupMembersView.searchPlaceholder,value:a,onChange:k=>l(k.target.value),"data-testid":"member-search-input",style:{...S,flex:1,minWidth:"220px",padding:"6px 12px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem"}}),c("label",{style:{...ie,gap:"0.35rem",fontSize:_,lineHeight:j,color:"#475569",cursor:"pointer"},children:[t("input",{type:"checkbox","data-testid":"member-only-toggle",checked:b,onChange:k=>{C(k.target.checked),A(new Set)}}),x(r.groupMembersView.onlyMembers,{count:G.size})]})]}),t("p",{"data-testid":"member-summary",role:"status","aria-live":"polite",style:{margin:"0 0 0.6rem 0",fontSize:"0.78rem",color:"#475569"},children:x(r.groupMembersView.summary,{shown:M.length,total:e.users.length,members:G.size})}),M.length===0&&t("p",{"data-testid":"member-empty-filtered",style:{margin:"0 0 0.6rem 0",fontSize:"0.85rem",color:"#475569"},children:e.users.length===0?r.groupMembersView.noUsers:V===""&&b?r.groupMembersView.emptyNoMembers:r.groupMembersView.emptyFiltered}),t("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:M.map(k=>{let I=G.has(k.id);return c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"0.5rem",padding:"4px 12px",borderRadius:"6px",border:"1px solid #f1f5f9",backgroundColor:I?"#f0fdf4":"#ffffff"},"data-testid":`member-row-${k.id}`,children:[c("div",{style:{minWidth:0,overflowWrap:"anywhere"},children:[t("span",{style:{fontWeight:600,fontSize:"0.88rem",color:"#0f172a",marginRight:"8px"},children:k.displayName}),c("span",{style:{fontSize:"0.78rem",color:"#64748b"},children:["(",k.email,")"]})]}),f.readOnly?I?t("span",{"data-testid":`member-readonly-${k.id}`,style:{fontSize:"0.75rem",color:"#475569"},children:r.common.managedUpstream}):null:t("button",{type:"button",onClick:()=>B(k.id,I),...ee(d),"aria-label":x(I?r.groupMembersView.actionRemoveAria:r.groupMembersView.actionAddAria,{user:k.displayName}),"data-testid":`toggle-member-btn-${k.id}`,style:{...S,padding:"4px 12px",borderRadius:"4px",border:I?"1px solid #b91c1c":"1px solid #0284c7",backgroundColor:I?"#ffffff":"#0284c7",color:I?"#b91c1c":"#ffffff",fontSize:_,lineHeight:j,fontWeight:600,cursor:"pointer"},children:I?r.groupMembersView.actionRemove:r.groupMembersView.actionAdd})]},k.id)})})]}):t("div",{"data-testid":"member-no-groups",style:{color:"#475569",textAlign:"center",padding:"2rem"},children:e.groups.length===0?r.groupMembersView.noGroups:r.groupMembersView.selectPrompt})})]})]})}function Mt(e){return e==="email"?{backgroundColor:"#e0f2fe",color:"#0369a1"}:e==="domain"?{backgroundColor:"#fef3c7",color:"#b45309"}:{backgroundColor:"#ede9fe",color:"#6d28d9"}}function Rt(e,o){return e==="email"?o.allowlistView.emailTypeShort:e==="domain"?o.allowlistView.domainTypeShort:o.allowlistView.groupTypeShort}function Tt(){let e=se(),o=ue(),n=e.labels??Q,{submit:p,result:d}=pe(o),r=o.state!=="idle",[i,y]=P(""),[w,U]=P("email"),[v,R]=P(""),A=l=>{if(l.preventDefault(),!i)return;let b={pattern:i,description:v};p({intent:"addAllowlistEntry",pattern:b.pattern,type:w,description:b.description},()=>{y(C=>C===b.pattern?"":C),R(C=>C===b.description?"":C)})},g=l=>{p({intent:"removeAllowlistEntry",entryId:String(l)})},a=l=>{p({intent:"removeAllowlistGroup",entryId:String(l)})};return c("section",{"data-testid":"allowlist-view-section",style:{display:"flex",flexDirection:"column",gap:"1.2rem"},children:[t("h2",{style:ce,children:n.allowlistView.title}),t(Z,{result:d}),c("form",{onSubmit:A,style:{backgroundColor:"#ffffff",padding:"1.2rem",borderRadius:"8px",border:"1px solid #e2e8f0",display:"flex",flexWrap:"wrap",gap:"0.8rem",alignItems:"flex-end"},children:[c("div",{style:{flex:2,minWidth:"220px"},children:[t("label",{htmlFor:"allowlist-pattern-input-field",style:{display:"block",fontSize:"0.78rem",color:"#475569",marginBottom:"4px"},children:n.allowlistView.pattern}),t("input",{id:"allowlist-pattern-input-field",type:"text",value:i,onChange:l=>y(l.target.value),required:!0,"data-testid":"allowlist-pattern-input",style:{...S,width:"100%",padding:"6px 10px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem"}})]}),c("div",{style:{flex:1,minWidth:"140px"},children:[t("label",{htmlFor:"allowlist-type-select-field",style:{display:"block",fontSize:"0.78rem",color:"#475569",marginBottom:"4px"},children:n.allowlistView.type}),c("select",{id:"allowlist-type-select-field",value:w,onChange:l=>U(l.target.value),"data-testid":"allowlist-type-select",style:{...S,width:"100%",padding:"6px 10px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem"},children:[t("option",{value:"email",children:n.allowlistView.emailType}),t("option",{value:"domain",children:n.allowlistView.domainType})]})]}),c("div",{style:{flex:2,minWidth:"200px"},children:[t("label",{htmlFor:"allowlist-desc-input-field",style:{display:"block",fontSize:"0.78rem",color:"#475569",marginBottom:"4px"},children:n.allowlistView.description}),t("input",{id:"allowlist-desc-input-field",type:"text",value:v,onChange:l=>R(l.target.value),"data-testid":"allowlist-desc-input",style:{...S,width:"100%",padding:"6px 10px",borderRadius:"6px",border:"1px solid #cbd5e1",fontSize:"0.85rem"}})]}),t("button",{type:"submit","data-testid":"submit-allowlist-add",disabled:r,"aria-busy":r,style:{...S,padding:"7px 16px",borderRadius:"6px",backgroundColor:"#047857",color:"#ffffff",border:"none",fontSize:"0.85rem",fontWeight:600,cursor:"pointer"},children:n.allowlistView.addEntry})]}),t("div",{style:Ae,children:c("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.85rem",textAlign:"left"},children:[t("thead",{children:c("tr",{style:{backgroundColor:"#f8fafc",borderBottom:"1px solid #e2e8f0",color:"#475569"},children:[t("th",{scope:"col",style:{padding:"10px 14px"},children:n.common.id}),t("th",{scope:"col",style:{padding:"10px 14px"},children:n.allowlistView.target}),t("th",{scope:"col",style:{padding:"10px 14px"},children:n.allowlistView.type}),t("th",{scope:"col",style:{padding:"10px 14px"},children:n.allowlistView.description}),t("th",{scope:"col",style:{padding:"10px 14px",textAlign:"right"},children:n.common.actions})]})}),c("tbody",{children:[e.allowlist.map(l=>c("tr",{style:{borderBottom:"1px solid #f1f5f9"},"data-testid":`allowlist-row-${l.type}-${l.id}`,"data-allowlist-type":l.type,children:[t("td",{style:{padding:"10px 14px",color:"#475569"},children:x(n.common.idTemplate,{id:l.id})}),t("td",{style:{padding:"10px 14px",fontWeight:600,color:"#0f172a"},children:l.type==="group"?c("span",{"data-testid":`allowlist-group-${l.type}-${l.id}`,children:[l.groupName,t("span",{style:{marginLeft:"6px",fontFamily:"monospace",fontSize:"0.78rem",color:"#64748b"},children:l.groupKey})]}):t("span",{style:{fontFamily:"monospace"},children:l.pattern})}),t("td",{style:{padding:"10px 14px"},children:t("span",{style:{fontSize:"0.75rem",padding:"2px 8px",borderRadius:"10px",...Mt(l.type),fontWeight:600},children:Rt(l.type,n)})}),c("td",{style:{padding:"10px 14px",color:"#475569"},children:[l.description||n.common.none,l.owner.kind==="deployment"&&t("span",{"data-testid":`allowlist-owner-${l.type}-${l.id}`,style:{marginLeft:"8px",fontSize:"0.72rem",color:"#475569"},children:n.allowlistView.deploymentOwner})]}),t("td",{style:{padding:"4px 14px",textAlign:"right"},children:l.readOnly?t("span",{"data-testid":`readonly-allowlist-${l.type}-${l.id}`,style:{fontSize:"0.75rem",color:"#475569"},children:n.common.readOnly}):t("button",{type:"button",onClick:()=>{window.confirm(x(n.allowlistView.confirmDelete,{target:l.type==="group"?l.groupName:l.pattern}))&&(l.type==="group"?a(l.id):g(l.id))},disabled:r,"aria-busy":r,"aria-label":x(n.allowlistView.deleteAria,{target:l.type==="group"?l.groupName:l.pattern}),"data-testid":`remove-allowlist-btn-${l.type}-${l.id}`,style:{...S,padding:"3px 8px",borderRadius:"4px",border:"1px solid #fee2e2",backgroundColor:"#fff5f5",color:"#b91c1c",fontSize:_,lineHeight:j,cursor:"pointer"},children:n.common.delete})})]},`${l.type}-${l.id}`)),e.allowlist.length===0&&t("tr",{children:t("td",{colSpan:5,style:{padding:"2rem",textAlign:"center",color:"#475569"},children:n.allowlistView.empty})})]})]})})]})}function Et(){let e=se(),o=ue(),{submit:n,result:p}=pe(o),d=e.labels??Q,r=d.directoryView,i=e.groups.filter(u=>!u.externalLink),[y,w]=P(""),[U,v]=P(""),[R,A]=P(""),[g,a]=P("direct"),l=e.groups.filter(u=>u.externalLink),b=new Set(e.allowlist.filter(u=>u.type==="group").map(u=>u.groupId)),C=u=>e.allowlist.find(T=>T.type==="group"&&T.groupId===u),L=o.state!=="idle",[f,h]=P(null),G=qe(p,d),V=f===null||(e.groups.find(D=>D.id===f.groupId)?.externalLink?.syncedAt??null)!==f.syncedAtAtPress?null:f.groupId,M=e.directoryStatus.isEnabled&&e.directoryStatus.provider!=="",B=ne(()=>Fe(e.catalog,Be(l),d),[e.catalog,l,d]),k=ne(()=>B.filter(u=>u.disabled!==!0).length,[B]),I=u=>{if(u.preventDefault(),!(y&&U))return;let T=i.find(m=>String(m.id)===y);if(!window.confirm(x(r.confirmLink,{group:T?.name??y,upstream:U})))return;let D=U;n({intent:"linkDirectoryGroup",groupId:y,provider:e.directoryStatus.provider,externalKey:D,externalId:R,membershipMode:g},()=>{v(m=>m===D?"":m),A(m=>U===D?"":m),w("")})};return c("section",{"data-testid":"directory-view-section",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t("h2",{style:ce,children:r.title}),t(Z,{result:p}),!M&&t("p",{"data-testid":"directory-not-wired",style:{margin:0,padding:"0.7rem 1rem",borderRadius:"6px",border:"1px solid #e2e8f0",backgroundColor:"#f8fafc",color:"#475569",fontSize:"0.85rem"},children:r.notWiredNotice}),M&&e.groups.length===0&&t("p",{"data-testid":"directory-no-groups",style:{margin:0,padding:"0.7rem 1rem",borderRadius:"6px",border:"1px solid #e2e8f0",backgroundColor:"#f8fafc",color:"#475569",fontSize:"0.85rem"},children:r.noGroupsToLink}),M&&e.groups.length>0&&i.length===0&&t("p",{"data-testid":"directory-nothing-to-link",style:{margin:0,padding:"0.7rem 1rem",borderRadius:"6px",border:"1px solid #e2e8f0",backgroundColor:"#f8fafc",color:"#475569",fontSize:"0.85rem"},children:r.nothingToLink}),t("p",{"data-testid":"directory-sync-already-pending",role:"status","aria-live":"polite",hidden:G===null,style:G===null?void 0:{margin:0,padding:"0.5rem 0.7rem",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fde68a",color:"#92400e",fontSize:"0.8rem"},children:G}),M&&i.length>0&&c("form",{onSubmit:I,"data-testid":"directory-link-form",style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",alignItems:"flex-end",backgroundColor:"#ffffff",padding:"1rem",borderRadius:"8px",border:"1px solid #e2e8f0"},children:[c("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",minWidth:0},children:[t("label",{htmlFor:"directory-group-select-input",style:ae,children:r.selectGroup}),c("select",{id:"directory-group-select-input","data-testid":"directory-group-select",value:y,onChange:u=>w(u.target.value),style:{...S,width:"100%",padding:"0.5rem",borderRadius:"6px",border:"1px solid #cbd5e1"},children:[t("option",{value:"",children:r.selectGroup}),i.map(u=>t("option",{value:String(u.id),children:x(r.groupOptionTemplate,{name:u.name,key:u.groupKey})},u.id))]})]}),t("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",flex:"1 1 260px",minWidth:0},children:e.catalog.kind==="ready"&&e.catalog.groups.length>0?c(ke,{children:[t("div",{id:"directory-external-key-label",style:ae,children:r.externalKey}),t("div",{"data-testid":"directory-external-key-picker",onKeyDown:u=>{u.nativeEvent.isComposing||u.nativeEvent.keyCode===229||u.key==="Enter"&&u.preventDefault()},children:t(Ne,{options:B,value:R===""?null:B.find(u=>u.value===R)??null,onChange:u=>{if(u===null){A(""),v("");return}A(u.value),v(u.entry.externalKey)},placeholder:r.pickUpstreamPlaceholder,ariaLabelledBy:"directory-external-key-label",renderOption:Ke,locale:d.locale,labels:We(d),clearable:!0})}),k===0&&t("span",{"data-testid":"directory-all-upstream-linked",style:{fontSize:"0.72rem",color:"#92400e"},children:d.groupsView.allUpstreamLinked}),t(Oe,{observedAt:e.catalog.observedAt,isStale:e.catalog.isStale,labels:d})]}):c(ke,{children:[t("label",{htmlFor:"directory-external-key-input",style:ae,children:r.externalKey}),t("input",{id:"directory-external-key-input",type:"email",required:!0,"data-testid":"directory-external-key",placeholder:r.externalKeyPlaceholder,value:U,onChange:u=>{A(""),v(u.target.value)},style:{...S,width:"100%",padding:"0.5rem",borderRadius:"6px",border:"1px solid #cbd5e1"}}),e.catalog.kind==="unavailable"&&t("span",{"data-testid":"directory-catalog-unavailable",style:{fontSize:"0.72rem",color:"#92400e"},children:x(d.groupsView.catalogUnavailable,{reason:d.groupsView.catalogFailures[e.catalog.reason]})}),e.catalog.kind==="ready"&&t("span",{"data-testid":"directory-catalog-empty",style:{fontSize:"0.72rem",color:"#475569"},children:x(d.groupsView.catalogEmpty,{at:te(e.catalog.observedAt,d)})})]})}),c("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",minWidth:0},children:[t("label",{htmlFor:"directory-membership-mode-input",style:ae,children:r.membershipMode}),c("select",{id:"directory-membership-mode-input","data-testid":"directory-membership-mode",value:g,onChange:u=>a(u.target.value),style:{...S,width:"100%",padding:"0.5rem",borderRadius:"6px",border:"1px solid #cbd5e1"},children:[t("option",{value:"direct",children:r.directMode}),t("option",{value:"transitive",children:r.transitiveMode})]})]}),t("button",{type:"submit","data-testid":"directory-link-submit",disabled:!(y&&U)||L,"aria-busy":L,style:{...S,padding:"0.5rem 1rem",borderRadius:"6px",border:"none",backgroundColor:y&&U&&!L?"#2563eb":"#94a3b8",color:"#fff",fontWeight:600},children:r.link})]}),l.length===0?t("div",{"data-testid":"directory-empty",style:{padding:"2rem",textAlign:"center",color:"#64748b",backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e2e8f0"},children:r.empty}):t("div",{style:Ae,children:c("table",{"data-testid":"directory-table",style:{width:"100%",borderCollapse:"collapse"},children:[t("thead",{children:c("tr",{style:{backgroundColor:"#f8fafc",textAlign:"left"},children:[t("th",{scope:"col",style:H,children:d.groupsView.name}),t("th",{scope:"col",style:H,children:r.externalKey}),t("th",{scope:"col",style:H,children:r.membershipMode}),t("th",{scope:"col",style:H,children:r.lastSynced}),t("th",{scope:"col",style:H,children:d.common.status}),t("th",{scope:"col",style:H,children:d.common.actions})]})}),t("tbody",{children:l.map(u=>{let T=u.externalLink,D=b.has(u.id);return c("tr",{"data-testid":`directory-row-${u.id}`,"data-sync-enabled":String(T.isSyncEnabled),style:{borderTop:"1px solid #e2e8f0"},children:[c("td",{style:H,children:[u.name,t("div",{style:{fontSize:"0.75rem",color:"#64748b"},children:u.groupKey})]}),t("td",{style:H,"data-testid":`directory-external-${u.id}`,children:T.externalKey}),t("td",{style:H,children:T.membershipMode==="direct"?r.directMode:r.transitiveMode}),c("td",{style:H,"data-testid":`directory-synced-${u.id}`,children:[T.syncedAt?te(T.syncedAt,d):r.neverSynced,T.unresolvedCount>0?t("div",{style:{fontSize:"0.75rem",color:"#b45309"},"data-testid":`directory-unresolved-${u.id}`,children:x(r.unresolvedTemplate,{count:T.unresolvedCount})}):null]}),c("td",{style:H,children:[t("span",{"data-testid":`directory-status-${u.id}`,style:{fontSize:"0.75rem",padding:"2px 8px",borderRadius:"10px",backgroundColor:T.isSyncEnabled?"#dcfce7":"#fee2e2",color:T.isSyncEnabled?"#166534":"#b91c1c",fontWeight:600},children:T.isSyncEnabled?r.syncEnabled:r.syncPaused}),T.syncError?t("div",{style:{fontSize:"0.75rem",color:"#b91c1c",marginTop:"0.25rem"},"data-testid":`directory-error-${u.id}`,children:T.syncError}):null]}),t("td",{style:H,children:c("div",{style:{display:"flex",gap:"0.35rem",flexWrap:"wrap"},children:[t("button",{type:"button","data-testid":`directory-sync-now-${u.id}`,...ee(L),"aria-label":x(V===u.id?r.syncQueuedAria:r.syncNowAria,{group:u.name}),onClick:()=>n({intent:"requestDirectorySync",groupId:String(u.id)},m=>{m?.syncRequest==="queued"&&h({groupId:u.id,syncedAtAtPress:u.externalLink?.syncedAt??null})}),style:ye,children:V===u.id?r.syncQueued:r.syncNow}),t("button",{type:"button","data-testid":`directory-toggle-sync-${u.id}`,...ee(L),"aria-label":x(T.isSyncEnabled?r.pauseAria:r.resumeAria,{group:u.name}),onClick:()=>{h(null),n({intent:"setDirectorySyncEnabled",groupId:String(u.id),isSyncEnabled:String(!T.isSyncEnabled)})},style:ye,children:T.isSyncEnabled?r.pause:r.resume}),t("button",{type:"button","data-testid":`directory-allow-${u.id}`,...ee(L),"aria-label":x(D?r.disallowGroupAria:r.allowGroupAria,{group:u.name}),onClick:()=>{let m=C(u.id);if(D&&m){if(!window.confirm(x(r.confirmDisallow,{group:u.name})))return;n({intent:"removeAllowlistGroup",entryId:String(m.id)})}else n({intent:"addAllowlistGroup",groupId:String(u.id)})},style:ye,children:D?r.disallowGroup:r.allowGroup}),t("button",{type:"button","data-testid":`directory-unlink-${u.id}`,...ee(L),"aria-label":x(r.unlinkAria,{group:u.name}),onClick:()=>{window.confirm(x(r.confirmUnlink,{group:u.name,upstream:u.externalLink?.externalKey??""}))&&n({intent:"unlinkDirectoryGroup",groupId:String(u.id)})},style:{...ye,color:"#b91c1c",borderColor:"#fecaca"},children:r.unlink})]})})]},u.id)})})]})})]})}var ae={fontSize:"0.78rem",color:"#475569",fontWeight:600},Pe={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},ce={margin:0,fontSize:"1.05rem",fontWeight:700,color:"#0f172a"},Ae={backgroundColor:"#ffffff",borderRadius:"8px",border:"1px solid #e2e8f0",overflowX:"auto"},H={padding:"0.6rem 0.75rem",fontSize:"0.85rem",verticalAlign:"top"},he={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.4)",display:"flex",overflowY:"auto",padding:"1rem",boxSizing:"border-box",zIndex:100},we={margin:"auto",backgroundColor:"#ffffff",padding:"1.5rem",borderRadius:"8px",width:"360px",maxWidth:"calc(100% - 3rem)",boxShadow:"0 10px 25px rgba(0,0,0,0.15)"};function ee(e){return{"aria-disabled":e,"aria-busy":e,"data-busy":e?"true":void 0}}var ye={...S,padding:"0.25rem 0.6rem",fontSize:_,lineHeight:j,borderRadius:"6px",border:"1px solid #cbd5e1",backgroundColor:"#fff",cursor:"pointer"},Ie={users:$e,groups:Lt,group_members:Gt,allowlist:Tt,directory:Et};function ur({renderHeader:e,pendingSyncPolling:o,basePath:n}){let d=se()?.segment??"users",r=Object.hasOwn(Ie,d)?Ie[d]:$e;return t(Ve,{renderHeader:e,pendingSyncPolling:o,basePath:n,children:t(He.Provider,{value:n,children:t(r,{})})})}export{Tt as AllowlistView,ur as AuthUserAdminAppView,ht as DEFAULT_PENDING_SYNC_POLLING,Et as DirectoryView,Gt as GroupMembersView,Lt as GroupsView,$ as UserAdminInputError,W as UserAdminOperatorError,Ve as UserAdminShell,$e as UsersView,Ot as createInMemoryUserAdminStore,Kt as createUserAdminApp,Q as defaultUserAdminLabels,Pt as jaUserAdminLabels,O as normalizeUpstreamKey,Le as resolveUserAdminLabels,Bt as userAdminAccessFor,qt as userAdminIntents};
|