@sync-in/server 1.6.1 → 1.7.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/environment/environment.dist.yaml +8 -2
  3. package/package.json +1 -1
  4. package/server/authentication/auth.config.js +15 -0
  5. package/server/authentication/auth.config.js.map +1 -1
  6. package/server/authentication/constants/auth-ldap.js +2 -1
  7. package/server/authentication/constants/auth-ldap.js.map +1 -1
  8. package/server/authentication/guards/auth-basic.strategy.js +2 -0
  9. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  10. package/server/authentication/guards/auth-local.strategy.js +2 -0
  11. package/server/authentication/guards/auth-local.strategy.js.map +1 -1
  12. package/server/authentication/services/auth-methods/auth-method-ldap.service.js +75 -32
  13. package/server/authentication/services/auth-methods/auth-method-ldap.service.js.map +1 -1
  14. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js +2 -1
  15. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js.map +1 -1
  16. package/static/{chunk-Y7EH7G5K.js → chunk-3GFGJYMK.js} +1 -1
  17. package/static/{chunk-7FUM3JGM.js → chunk-4YGJGZZZ.js} +1 -1
  18. package/static/{chunk-34MKICK5.js → chunk-5K7HEX3C.js} +1 -1
  19. package/static/{chunk-U34OZUZ7.js → chunk-5KLMS6A4.js} +1 -1
  20. package/static/{chunk-QQ6UQQBR.js → chunk-BB4G55KE.js} +1 -1
  21. package/static/{chunk-S75P2FFI.js → chunk-DJYJ66UF.js} +1 -1
  22. package/static/{chunk-AWQ2YTVC.js → chunk-EVIE5F2U.js} +1 -1
  23. package/static/{chunk-JUNZFADM.js → chunk-EWKSX76T.js} +1 -1
  24. package/static/{chunk-2I4CUFUA.js → chunk-FHLACA7V.js} +1 -1
  25. package/static/{chunk-EFKMBLRE.js → chunk-GCATNU55.js} +1 -1
  26. package/static/{chunk-5O3DIUU3.js → chunk-GYODPCIE.js} +1 -1
  27. package/static/{chunk-27YQB3TE.js → chunk-HZTFYLM5.js} +1 -1
  28. package/static/{chunk-JQ5FTO2M.js → chunk-JSUKJT6Z.js} +1 -1
  29. package/static/{chunk-DSOE3FEP.js → chunk-LTGFCQR7.js} +1 -1
  30. package/static/{chunk-JASU3CIH.js → chunk-LV3PYKWO.js} +1 -1
  31. package/static/{chunk-HCDLWTMW.js → chunk-N2WFNW6M.js} +1 -1
  32. package/static/{chunk-QJX6ITLW.js → chunk-OUTBJSMW.js} +1 -1
  33. package/static/{chunk-LUWQFIWR.js → chunk-PTGDOWV3.js} +1 -1
  34. package/static/{chunk-ZQQPUYLU.js → chunk-QNJFQVYI.js} +1 -1
  35. package/static/{chunk-LJUKI4SQ.js → chunk-RS2PX32L.js} +1 -1
  36. package/static/{chunk-S2HDY3OL.js → chunk-RSSWH3S2.js} +1 -1
  37. package/static/{chunk-7DN7ZAPU.js → chunk-SIPE37PA.js} +1 -1
  38. package/static/{chunk-FUFKVHPU.js → chunk-TKTCBDOG.js} +1 -1
  39. package/static/{chunk-Q7D6RN4N.js → chunk-V6K2N46L.js} +1 -1
  40. package/static/{chunk-2MTM6SWN.js → chunk-XLCCZSQL.js} +1 -1
  41. package/static/{chunk-6NMVZIIT.js → chunk-YPEH66GG.js} +1 -1
  42. package/static/{chunk-T3EYFSVZ.js → chunk-YPOIUQ57.js} +1 -1
  43. package/static/{chunk-7P27WBGC.js → chunk-ZKCFO2OA.js} +1 -1
  44. package/static/index.html +1 -1
  45. package/static/{main-7SQDDVMD.js → main-MZ7HWZXO.js} +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../backend/src/authentication/services/auth-methods/auth-method-ldap.service.spec.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { Test, TestingModule } from '@nestjs/testing'\nimport { Mocked } from 'jest-mock'\nimport { Client, InvalidCredentialsError } from 'ldapts'\nimport { CONNECT_ERROR_CODE } from '../../../app.constants'\nimport { UserModel } from '../../../applications/users/models/user.model'\nimport { AdminUsersManager } from '../../../applications/users/services/admin-users-manager.service'\nimport { UsersManager } from '../../../applications/users/services/users-manager.service'\nimport * as commonFunctions from '../../../common/functions'\nimport { configuration } from '../../../configuration/config.environment'\nimport { LDAP_LOGIN_ATTR } from '../../constants/auth-ldap'\nimport { AuthMethodLdapService } from './auth-method-ldap.service'\n\n// Mock ldapts Client to simulate LDAP behaviors\njest.mock('ldapts', () => {\n const actual = jest.requireActual('ldapts')\n const mockClientInstance = {\n bind: jest.fn(),\n search: jest.fn(),\n unbind: jest.fn()\n }\n const Client = jest.fn().mockImplementation(() => mockClientInstance)\n // Conserver tous les autres exports réels (dont EqualityFilter, AndFilter, InvalidCredentialsError, etc.)\n return { ...actual, Client }\n})\n\n// --- Test helpers (DRY) ---\n// Reusable LDAP mocks\nconst mockBindResolve = (ldapClient: any) => {\n ldapClient.bind.mockResolvedValue(undefined)\n ldapClient.unbind.mockResolvedValue(undefined)\n}\nconst mockBindRejectInvalid = (ldapClient: any, InvalidCredentialsErrorCtor: any, message = 'invalid') => {\n ldapClient.bind.mockRejectedValue(new InvalidCredentialsErrorCtor(message))\n ldapClient.unbind.mockResolvedValue(undefined)\n}\nconst mockSearchEntries = (ldapClient: any, entries: any[]) => {\n ldapClient.search.mockResolvedValue({ searchEntries: entries })\n}\nconst mockSearchReject = (ldapClient: any, err: Error) => {\n ldapClient.search.mockRejectedValue(err)\n}\n// User factory\nconst buildUser = (overrides: Partial<UserModel> = {}) =>\n ({\n id: 0,\n login: 'john',\n email: 'old@example.org',\n password: 'hashed',\n isGuest: false,\n isActive: true,\n makePaths: jest.fn().mockResolvedValue(undefined),\n setFullName: jest.fn(), // needed when firstName/lastName change\n ...overrides\n }) as any\n\n// --------------------------\n\ndescribe(AuthMethodLdapService.name, () => {\n let authMethodLdapService: AuthMethodLdapService\n let usersManager: Mocked<UsersManager>\n let adminUsersManager: Mocked<AdminUsersManager>\n const ldapClient = {\n bind: jest.fn(),\n search: jest.fn(),\n unbind: jest.fn()\n }\n ;(Client as Mocked<any>).mockImplementation(() => ldapClient)\n\n // Local helpers (need access to authMethodLdapService and ldapClient in this scope)\n const setupLdapSuccess = (entries: any[]) => {\n mockBindResolve(ldapClient)\n mockSearchEntries(ldapClient, entries)\n }\n const spyLoggerError = () => jest.spyOn(authMethodLdapService['logger'], 'error').mockImplementation(() => undefined as any)\n\n beforeAll(async () => {\n configuration.auth.ldap = {\n servers: ['ldap://localhost:389'],\n attributes: { login: LDAP_LOGIN_ATTR.UID, email: 'mail' },\n baseDN: 'ou=people,dc=example,dc=org',\n filter: ''\n }\n\n const module: TestingModule = await Test.createTestingModule({\n providers: [\n AuthMethodLdapService,\n {\n provide: UsersManager,\n useValue: {\n findUser: jest.fn(),\n logUser: jest.fn(),\n updateAccesses: jest.fn().mockResolvedValue(undefined),\n validateAppPassword: jest.fn(),\n fromUserId: jest.fn()\n }\n },\n {\n provide: AdminUsersManager,\n useValue: {\n createUserOrGuest: jest.fn(),\n updateUserOrGuest: jest.fn()\n }\n }\n ]\n }).compile()\n\n module.useLogger(['fatal'])\n authMethodLdapService = module.get<AuthMethodLdapService>(AuthMethodLdapService)\n adminUsersManager = module.get<Mocked<AdminUsersManager>>(AdminUsersManager)\n usersManager = module.get<Mocked<UsersManager>>(UsersManager)\n })\n\n it('should be defined', () => {\n expect(authMethodLdapService).toBeDefined()\n expect(usersManager).toBeDefined()\n expect(adminUsersManager).toBeDefined()\n expect(ldapClient).toBeDefined()\n })\n\n it('should authenticate a guest user via database and bypass LDAP', async () => {\n // Arrange\n const guestUser: any = { id: 1, login: 'guest1', isGuest: true, isActive: true }\n usersManager.findUser.mockResolvedValue(guestUser)\n const dbAuthResult: any = { ...guestUser, token: 'jwt' }\n usersManager.logUser.mockResolvedValue(dbAuthResult)\n const res = await authMethodLdapService.validateUser('guest1', 'pass', '127.0.0.1')\n expect(res).toEqual(dbAuthResult)\n expect(usersManager.logUser).toHaveBeenCalledWith(guestUser, 'pass', '127.0.0.1')\n expect(Client).not.toHaveBeenCalled() // client should not be constructed\n })\n\n it('should throw FORBIDDEN for locked account and resolve null for LDAP login mismatch', async () => {\n // Phase 1: locked account\n usersManager.findUser.mockResolvedValue({ login: 'john', isGuest: false, isActive: false } as UserModel)\n const loggerErrorSpy1 = jest.spyOn(authMethodLdapService['logger'], 'error').mockImplementation(() => undefined as any)\n await expect(authMethodLdapService.validateUser('john', 'pwd')).rejects.toThrow(/account locked/i)\n expect(loggerErrorSpy1).toHaveBeenCalled()\n\n // Phase 2: mismatch between requested login and LDAP returned login -> service renvoie null\n const existingUser: any = buildUser({ id: 8 })\n usersManager.findUser.mockResolvedValue(existingUser)\n mockBindResolve(ldapClient)\n mockSearchEntries(ldapClient, [{ uid: 'jane', cn: 'john', mail: 'jane@example.org' }])\n await expect(authMethodLdapService.validateUser('john', 'pwd')).rejects.toThrow(/account matching error/i)\n })\n\n it('should handle invalid LDAP credentials for both existing and unknown users', async () => {\n // Phase 1: existing user -> updateAccesses invoked with success=false and logger.error intercepted\n const existingUser: any = buildUser({ id: 1 })\n usersManager.findUser.mockResolvedValue(existingUser)\n // Make LDAP bind throw InvalidCredentialsError\n mockBindRejectInvalid(ldapClient, InvalidCredentialsError, 'invalid credentials')\n // Force updateAccesses to reject to hit the catch and logger.error\n const loggerErrorSpy = jest.spyOn(authMethodLdapService['logger'], 'error').mockImplementation(() => undefined as any)\n usersManager.updateAccesses.mockRejectedValueOnce(new Error('updateAccesses boom'))\n const res1 = await authMethodLdapService.validateUser('john', 'badpwd', '10.0.0.1')\n expect(res1).toBeNull()\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '10.0.0.1', false)\n expect(loggerErrorSpy).toHaveBeenCalled()\n\n // Phase 2: unknown user → no access update\n usersManager.updateAccesses.mockClear()\n usersManager.findUser.mockResolvedValue(null)\n ldapClient.bind.mockRejectedValue(new InvalidCredentialsError('invalid'))\n ldapClient.unbind.mockResolvedValue(undefined)\n const res2 = await authMethodLdapService.validateUser('jane', 'badpwd')\n expect(res2).toBeNull()\n expect(usersManager.updateAccesses).not.toHaveBeenCalled()\n })\n\n it('should handle LDAP new-user flow: missing fields, creation success, and multi-email selection', async () => {\n // Phase 1: incomplete LDAP entry -> null + error log, no creation\n usersManager.findUser.mockResolvedValue(null)\n mockBindResolve(ldapClient)\n // Simulate an entry with missing mail\n mockSearchEntries(ldapClient, [{ uid: 'jane', cn: 'Jane Doe', mail: undefined }])\n const loggerErrorSpy = jest.spyOn(authMethodLdapService['logger'], 'error').mockImplementation(() => undefined as any)\n const resA = await authMethodLdapService.validateUser('jane', 'pwd')\n expect(resA).toBeNull()\n expect(adminUsersManager.createUserOrGuest).not.toHaveBeenCalled()\n expect(loggerErrorSpy).toHaveBeenCalled()\n\n // Phase 2: create a new user (success, single email)\n // Stub directement checkAuth pour retourner une entrée LDAP valide\n const checkAuthSpy = jest.spyOn<any, any>(authMethodLdapService as any, 'checkAuth')\n checkAuthSpy.mockResolvedValueOnce({ uid: 'john', cn: 'John Doe', mail: 'john@example.org' } as any)\n adminUsersManager.createUserOrGuest.mockClear()\n usersManager.findUser.mockResolvedValue(null)\n const createdUser: any = { id: 2, login: 'john', isGuest: false, isActive: true, makePaths: jest.fn() }\n adminUsersManager.createUserOrGuest.mockResolvedValue(createdUser)\n // If the service reloads the user via fromUserId after creation\n usersManager.fromUserId.mockResolvedValue(createdUser)\n // Cover the success-flow catch branch\n const loggerErrorSpy2 = spyLoggerError()\n usersManager.updateAccesses.mockRejectedValueOnce(new Error('updateAccesses success flow boom'))\n const resB = await authMethodLdapService.validateUser('john', 'pwd', '192.168.1.10')\n expect(adminUsersManager.createUserOrGuest).toHaveBeenCalledWith(\n { login: 'john', email: 'john@example.org', password: 'pwd', firstName: 'John', lastName: 'Doe' },\n expect.anything() // USER_ROLE.USER\n )\n expect(resB).toBe(createdUser)\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(createdUser, '192.168.1.10', true)\n expect(loggerErrorSpy2).toHaveBeenCalled()\n // Phase 3: multiple emails -> keep the first\n adminUsersManager.createUserOrGuest.mockClear()\n usersManager.findUser.mockResolvedValue(null)\n setupLdapSuccess([{ uid: 'multi', cn: 'Multi Mail', mail: ['first@example.org', 'second@example.org'] }])\n const createdUser2: any = { id: 9, login: 'multi', makePaths: jest.fn() }\n adminUsersManager.createUserOrGuest.mockResolvedValue(createdUser2)\n usersManager.fromUserId.mockResolvedValue(createdUser2)\n const resC = await authMethodLdapService.validateUser('multi', 'pwd')\n expect(adminUsersManager.createUserOrGuest).toHaveBeenCalledWith(expect.objectContaining({ email: 'first@example.org' }), expect.anything())\n expect(resC).toBe(createdUser2)\n })\n\n it('should update existing user profile when LDAP identity changed (except password assigned back)', async () => {\n // Arrange: existing user with different profile and an old password\n const existingUser: any = buildUser({ id: 5 })\n usersManager.findUser.mockResolvedValue(existingUser)\n // LDAP succeeds and returns different email and same uid\n setupLdapSuccess([{ uid: 'john', cn: 'John Doe', mail: 'john@example.org' }])\n // Admin manager successfully updates a user\n adminUsersManager.updateUserOrGuest.mockResolvedValue(undefined)\n // Ensure password is considered changed so the update payload includes it,\n // which then triggers the deletion and local assignment branches after update\n const compareSpy = jest.spyOn(commonFunctions, 'comparePassword').mockResolvedValue(false)\n const res = await authMethodLdapService.validateUser('john', 'new-plain-password', '127.0.0.2')\n expect(adminUsersManager.updateUserOrGuest).toHaveBeenCalledWith(\n 5,\n expect.objectContaining({\n email: 'john@example.org',\n firstName: 'John',\n lastName: 'Doe'\n })\n )\n // Password should not be assigned back onto the user object (it is deleted before Object.assign)\n expect(existingUser.password).toBe('hashed')\n // Other fields should be updated locally\n expect(existingUser.email).toBe('john@example.org')\n expect(existingUser).toMatchObject({ firstName: 'John', lastName: 'Doe' })\n // Accesses updated as success\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '127.0.0.2', true)\n // Returned user is the same instance\n expect(res).toBe(existingUser)\n\n // Second run: password unchanged (comparePassword => true) to cover the null branch for password\n adminUsersManager.updateUserOrGuest.mockClear()\n usersManager.updateAccesses.mockClear()\n // Force another non-password change so an update occurs\n existingUser.email = 'old@example.org'\n compareSpy.mockResolvedValue(true)\n const res2 = await authMethodLdapService.validateUser('john', 'same-plain-password', '127.0.0.3')\n // Update should be called without password, only with changed fields\n expect(adminUsersManager.updateUserOrGuest).toHaveBeenCalled()\n const updateArgs = adminUsersManager.updateUserOrGuest.mock.calls[0]\n expect(updateArgs[0]).toBe(5)\n expect(updateArgs[1]).toEqual(\n expect.objectContaining({\n email: 'john@example.org'\n })\n )\n expect(updateArgs[1]).toEqual(expect.not.objectContaining({ password: expect.anything() }))\n // Password remains unchanged locally\n expect(existingUser.password).toBe('hashed')\n // Accesses updated as success\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '127.0.0.3', true)\n // Returned user is the same instance\n expect(res2).toBe(existingUser)\n // Third run: no changes at all (identityHasChanged is empty) to cover the else branch\n adminUsersManager.updateUserOrGuest.mockClear()\n usersManager.updateAccesses.mockClear()\n compareSpy.mockResolvedValue(true)\n // Local user already matches LDAP identity; call again\n const res3 = await authMethodLdapService.validateUser('john', 'same-plain-password', '127.0.0.4')\n // No update should be triggered\n expect(adminUsersManager.updateUserOrGuest).not.toHaveBeenCalled()\n // Access should still be updated as success\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '127.0.0.4', true)\n // Returned user is the same instance\n expect(res3).toBe(existingUser)\n })\n\n it('should log failed access when LDAP search returns no entry or throws after bind', async () => {\n // Phase 1: no entry found after a successful bind -> failed access\n const existingUser: any = { id: 7, login: 'ghost', isGuest: false, isActive: true }\n usersManager.findUser.mockResolvedValue(existingUser)\n setupLdapSuccess([])\n const resA = await authMethodLdapService.validateUser('ghost', 'pwd', '10.10.0.1')\n expect(resA).toBeNull()\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '10.10.0.1', false)\n\n // Phase 2: exception during search after a bind -> failed access\n jest.clearAllMocks()\n const existingUser2: any = { id: 10, login: 'john', isGuest: false, isActive: true }\n usersManager.findUser.mockResolvedValue(existingUser2)\n mockBindResolve(ldapClient)\n mockSearchReject(ldapClient, new Error('search failed'))\n const resB = await authMethodLdapService.validateUser('john', 'pwd', '1.1.1.1')\n expect(resB).toBeNull()\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser2, '1.1.1.1', false)\n })\n\n it('should allow app password when LDAP fails and scope is provided', async () => {\n const existingUser: any = buildUser({ id: 42 })\n usersManager.findUser.mockResolvedValue(existingUser)\n // LDAP invalid credentials\n mockBindRejectInvalid(ldapClient, InvalidCredentialsError, 'invalid credentials')\n // App password success\n usersManager.validateAppPassword.mockResolvedValue(true)\n const res = await authMethodLdapService.validateUser('john', 'app-password', '10.0.0.2', 'webdav' as any)\n expect(res).toBe(existingUser)\n expect(usersManager.validateAppPassword).toHaveBeenCalledWith(existingUser, 'app-password', '10.0.0.2', 'webdav')\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '10.0.0.2', true)\n })\n\n it('should throw 500 when LDAP connection error occurs during bind', async () => {\n // Arrange: no existing user to reach checkAuth flow\n usersManager.findUser.mockResolvedValue(null)\n const err1 = new Error('socket hang up')\n const err2 = Object.assign(new Error('connect ECONNREFUSED'), { code: Array.from(CONNECT_ERROR_CODE)[0] })\n ldapClient.bind.mockRejectedValue({ errors: [err1, err2] })\n ldapClient.unbind.mockResolvedValue(undefined)\n\n // First scenario: recognized connection error -> throws 500\n await expect(authMethodLdapService.validateUser('john', 'pwd')).rejects.toThrow(/authentication service/i)\n\n // Second scenario: generic error (no code, not InvalidCredentialsError) -> resolves to null and no access update\n ldapClient.bind.mockReset()\n ldapClient.unbind.mockReset()\n usersManager.updateAccesses.mockClear()\n usersManager.findUser.mockResolvedValue(null as any)\n ldapClient.bind.mockRejectedValue(new Error('unexpected failure'))\n ldapClient.unbind.mockResolvedValue(undefined)\n\n const res = await authMethodLdapService.validateUser('john', 'pwd')\n expect(res).toBeNull()\n expect(usersManager.updateAccesses).not.toHaveBeenCalled()\n })\n\n it('should log update failure when updating existing user', async () => {\n // Arrange: existing user with changed identity\n const existingUser: any = buildUser({ id: 11, email: 'old@ex.org' })\n usersManager.findUser.mockResolvedValue(existingUser)\n // Ensure LDAP loginAttribute matches uid for this test (a previous test sets it to 'cn')\n setupLdapSuccess([{ uid: 'john', cn: 'John Doe', mail: 'john@example.org' }])\n adminUsersManager.updateUserOrGuest.mockRejectedValue(new Error('db error'))\n // Force identity to be considered changed only for this test\n jest.spyOn(commonFunctions, 'comparePassword').mockResolvedValue(false)\n jest.spyOn(commonFunctions, 'splitFullName').mockReturnValue({ firstName: 'John', lastName: 'Doe' })\n const res = await authMethodLdapService.validateUser('john', 'pwd')\n expect(adminUsersManager.updateUserOrGuest).toHaveBeenCalled()\n // Local fields unchanged since update failed\n expect(existingUser.email).toBe('old@ex.org')\n expect(res).toBe(existingUser)\n })\n\n it('should skip non-matching LDAP entries then update user with changed password without reassigning it', async () => {\n // Phase A: LDAP returns an entry but loginAttribute value does not match -> checkAccess returns false (covers return after loop)\n const userA: any = { id: 20, login: 'john', isGuest: false, isActive: true }\n usersManager.findUser.mockResolvedValue(userA)\n ldapClient.bind.mockResolvedValue(undefined)\n\n // Phase B: Matching entry + password considered changed -> updateUserOrGuest called, password not reassigned locally\n jest.clearAllMocks()\n const userB: any = buildUser({ id: 21, email: 'old@ex.org' })\n usersManager.findUser.mockResolvedValue(userB)\n setupLdapSuccess([{ uid: 'john', cn: 'John Doe', mail: 'john@example.org' }])\n adminUsersManager.updateUserOrGuest.mockResolvedValue(undefined)\n\n // Force password to be considered changed to execute deletion + Object.assign branch\n jest.spyOn(commonFunctions, 'comparePassword').mockResolvedValue(false)\n jest.spyOn(commonFunctions, 'splitFullName').mockReturnValue({ firstName: 'John', lastName: 'Doe' })\n const resB = await authMethodLdapService.validateUser('john', 'newpwd', '4.4.4.4')\n\n // Line 132: updateUserOrGuest call\n expect(adminUsersManager.updateUserOrGuest).toHaveBeenCalledWith(\n 21,\n expect.objectContaining({ email: 'john@example.org', firstName: 'John', lastName: 'Doe' })\n )\n\n // Lines 139-142: password removed from local assign, other fields assigned\n expect(userB.password).toBe('hashed')\n expect(userB.email).toBe('john@example.org')\n expect(userB).toMatchObject({ firstName: 'John', lastName: 'Doe' })\n expect(resB).toBe(userB)\n })\n})\n"],"names":["jest","mock","actual","requireActual","mockClientInstance","bind","fn","search","unbind","Client","mockImplementation","mockBindResolve","ldapClient","mockResolvedValue","undefined","mockBindRejectInvalid","InvalidCredentialsErrorCtor","message","mockRejectedValue","mockSearchEntries","entries","searchEntries","mockSearchReject","err","buildUser","overrides","id","login","email","password","isGuest","isActive","makePaths","setFullName","describe","AuthMethodLdapService","name","authMethodLdapService","usersManager","adminUsersManager","setupLdapSuccess","spyLoggerError","spyOn","beforeAll","configuration","auth","ldap","servers","attributes","LDAP_LOGIN_ATTR","UID","baseDN","filter","module","Test","createTestingModule","providers","provide","UsersManager","useValue","findUser","logUser","updateAccesses","validateAppPassword","fromUserId","AdminUsersManager","createUserOrGuest","updateUserOrGuest","compile","useLogger","get","it","expect","toBeDefined","guestUser","dbAuthResult","token","res","validateUser","toEqual","toHaveBeenCalledWith","not","toHaveBeenCalled","loggerErrorSpy1","rejects","toThrow","existingUser","uid","cn","mail","InvalidCredentialsError","loggerErrorSpy","mockRejectedValueOnce","Error","res1","toBeNull","mockClear","res2","resA","checkAuthSpy","mockResolvedValueOnce","createdUser","loggerErrorSpy2","resB","firstName","lastName","anything","toBe","createdUser2","resC","objectContaining","compareSpy","commonFunctions","toMatchObject","updateArgs","calls","res3","clearAllMocks","existingUser2","err1","err2","Object","assign","code","Array","from","CONNECT_ERROR_CODE","errors","mockReset","mockReturnValue","userA","userB"],"mappings":"AAAA;;;;CAIC;;;;yBAEmC;wBAEY;8BACb;0CAED;qCACL;mEACI;mCACH;0BACE;uCACM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MF,OAAO,MAAMlE,sBAAsByC,YAAY,CAAC,QAAQ,UAAU;QAExE,mCAAmC;QACnCN,OAAOjC,kBAAkB4B,iBAAiB,EAAEa,oBAAoB,CAC9D,IACAR,OAAOsC,gBAAgB,CAAC;YAAElF,OAAO;YAAoB4E,WAAW;YAAQC,UAAU;QAAM;QAG1F,2EAA2E;QAC3EjC,OAAO2D,MAAMtG,QAAQ,EAAE8E,IAAI,CAAC;QAC5BnC,OAAO2D,MAAMvG,KAAK,EAAE+E,IAAI,CAAC;QACzBnC,OAAO2D,OAAOlB,aAAa,CAAC;YAAET,WAAW;YAAQC,UAAU;QAAM;QACjEjC,OAAO+B,MAAMI,IAAI,CAACwB;IACpB;AACF"}
1
+ {"version":3,"sources":["../../../../../backend/src/authentication/services/auth-methods/auth-method-ldap.service.spec.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { Test, TestingModule } from '@nestjs/testing'\nimport { Mocked } from 'jest-mock'\nimport { Client, InvalidCredentialsError } from 'ldapts'\nimport { CONNECT_ERROR_CODE } from '../../../app.constants'\nimport { UserModel } from '../../../applications/users/models/user.model'\nimport { AdminUsersManager } from '../../../applications/users/services/admin-users-manager.service'\nimport { UsersManager } from '../../../applications/users/services/users-manager.service'\nimport * as commonFunctions from '../../../common/functions'\nimport { configuration } from '../../../configuration/config.environment'\nimport { LDAP_LOGIN_ATTR } from '../../constants/auth-ldap'\nimport { AuthMethodLdapService } from './auth-method-ldap.service'\n\n// Mock ldapts Client to simulate LDAP behaviors\njest.mock('ldapts', () => {\n const actual = jest.requireActual('ldapts')\n const mockClientInstance = {\n bind: jest.fn(),\n search: jest.fn(),\n unbind: jest.fn()\n }\n const Client = jest.fn().mockImplementation(() => mockClientInstance)\n // Conserver tous les autres exports réels (dont EqualityFilter, AndFilter, InvalidCredentialsError, etc.)\n return { ...actual, Client }\n})\n\n// --- Test helpers (DRY) ---\n// Reusable LDAP mocks\nconst mockBindResolve = (ldapClient: any) => {\n ldapClient.bind.mockResolvedValue(undefined)\n ldapClient.unbind.mockResolvedValue(undefined)\n}\nconst mockBindRejectInvalid = (ldapClient: any, InvalidCredentialsErrorCtor: any, message = 'invalid') => {\n ldapClient.bind.mockRejectedValue(new InvalidCredentialsErrorCtor(message))\n ldapClient.unbind.mockResolvedValue(undefined)\n}\nconst mockSearchEntries = (ldapClient: any, entries: any[]) => {\n ldapClient.search.mockResolvedValue({ searchEntries: entries })\n}\nconst mockSearchReject = (ldapClient: any, err: Error) => {\n ldapClient.search.mockRejectedValue(err)\n}\n// User factory\nconst buildUser = (overrides: Partial<UserModel> = {}) =>\n ({\n id: 0,\n login: 'john',\n email: 'old@example.org',\n password: 'hashed',\n isGuest: false,\n isActive: true,\n makePaths: jest.fn().mockResolvedValue(undefined),\n setFullName: jest.fn(), // needed when firstName/lastName change\n ...overrides\n }) as any\n\n// --------------------------\n\ndescribe(AuthMethodLdapService.name, () => {\n let authMethodLdapService: AuthMethodLdapService\n let usersManager: Mocked<UsersManager>\n let adminUsersManager: Mocked<AdminUsersManager>\n const ldapClient = {\n bind: jest.fn(),\n search: jest.fn(),\n unbind: jest.fn()\n }\n ;(Client as Mocked<any>).mockImplementation(() => ldapClient)\n\n // Local helpers (need access to authMethodLdapService and ldapClient in this scope)\n const setupLdapSuccess = (entries: any[]) => {\n mockBindResolve(ldapClient)\n mockSearchEntries(ldapClient, entries)\n }\n const spyLoggerError = () => jest.spyOn(authMethodLdapService['logger'], 'error').mockImplementation(() => undefined as any)\n\n beforeAll(async () => {\n configuration.auth.ldap = {\n servers: ['ldap://localhost:389'],\n attributes: { login: LDAP_LOGIN_ATTR.UID, email: 'mail' },\n baseDN: 'ou=people,dc=example,dc=org',\n filter: ''\n }\n\n const module: TestingModule = await Test.createTestingModule({\n providers: [\n AuthMethodLdapService,\n {\n provide: UsersManager,\n useValue: {\n findUser: jest.fn(),\n logUser: jest.fn(),\n updateAccesses: jest.fn().mockResolvedValue(undefined),\n validateAppPassword: jest.fn(),\n fromUserId: jest.fn()\n }\n },\n {\n provide: AdminUsersManager,\n useValue: {\n createUserOrGuest: jest.fn(),\n updateUserOrGuest: jest.fn()\n }\n }\n ]\n }).compile()\n\n module.useLogger(['fatal'])\n authMethodLdapService = module.get<AuthMethodLdapService>(AuthMethodLdapService)\n adminUsersManager = module.get<Mocked<AdminUsersManager>>(AdminUsersManager)\n usersManager = module.get<Mocked<UsersManager>>(UsersManager)\n })\n\n it('should be defined', () => {\n expect(authMethodLdapService).toBeDefined()\n expect(usersManager).toBeDefined()\n expect(adminUsersManager).toBeDefined()\n expect(ldapClient).toBeDefined()\n })\n\n it('should authenticate a guest user via database and bypass LDAP', async () => {\n // Arrange\n const guestUser: any = { id: 1, login: 'guest1', isGuest: true, isActive: true }\n usersManager.findUser.mockResolvedValue(guestUser)\n const dbAuthResult: any = { ...guestUser, token: 'jwt' }\n usersManager.logUser.mockResolvedValue(dbAuthResult)\n const res = await authMethodLdapService.validateUser('guest1', 'pass', '127.0.0.1')\n expect(res).toEqual(dbAuthResult)\n expect(usersManager.logUser).toHaveBeenCalledWith(guestUser, 'pass', '127.0.0.1')\n expect(Client).not.toHaveBeenCalled() // client should not be constructed\n })\n\n it('should throw FORBIDDEN for locked account and resolve null for LDAP login mismatch', async () => {\n // Phase 1: locked account\n usersManager.findUser.mockResolvedValue({ login: 'john', isGuest: false, isActive: false } as UserModel)\n const loggerErrorSpy1 = jest.spyOn(authMethodLdapService['logger'], 'error').mockImplementation(() => undefined as any)\n await expect(authMethodLdapService.validateUser('john', 'pwd')).rejects.toThrow(/account locked/i)\n expect(loggerErrorSpy1).toHaveBeenCalled()\n\n // Phase 2: mismatch between requested login and LDAP returned login -> service renvoie null\n const existingUser: any = buildUser({ id: 8 })\n usersManager.findUser.mockResolvedValue(existingUser)\n mockBindResolve(ldapClient)\n mockSearchEntries(ldapClient, [{ uid: 'jane', cn: 'john', mail: 'jane@example.org' }])\n await expect(authMethodLdapService.validateUser('john', 'pwd')).rejects.toThrow(/account matching error/i)\n })\n\n it('should handle invalid LDAP credentials for both existing and unknown users', async () => {\n // Phase 1: existing user -> updateAccesses invoked with success=false and logger.error intercepted\n const existingUser: any = buildUser({ id: 1 })\n usersManager.findUser.mockResolvedValue(existingUser)\n // Make LDAP bind throw InvalidCredentialsError\n mockBindRejectInvalid(ldapClient, InvalidCredentialsError, 'invalid credentials')\n // Force updateAccesses to reject to hit the catch and logger.error\n const loggerErrorSpy = jest.spyOn(authMethodLdapService['logger'], 'error').mockImplementation(() => undefined as any)\n usersManager.updateAccesses.mockRejectedValueOnce(new Error('updateAccesses boom'))\n const res1 = await authMethodLdapService.validateUser('john', 'badpwd', '10.0.0.1')\n expect(res1).toBeNull()\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '10.0.0.1', false)\n expect(loggerErrorSpy).toHaveBeenCalled()\n\n // Phase 2: unknown user → no access update\n usersManager.updateAccesses.mockClear()\n usersManager.findUser.mockResolvedValue(null)\n ldapClient.bind.mockRejectedValue(new InvalidCredentialsError('invalid'))\n ldapClient.unbind.mockResolvedValue(undefined)\n const res2 = await authMethodLdapService.validateUser('jane', 'badpwd')\n expect(res2).toBeNull()\n expect(usersManager.updateAccesses).not.toHaveBeenCalled()\n })\n\n it('should handle LDAP new-user flow: missing fields, creation success, and multi-email selection', async () => {\n // Phase 1: incomplete LDAP entry -> null + error log, no creation\n usersManager.findUser.mockResolvedValue(null)\n mockBindResolve(ldapClient)\n // Simulate an entry with missing mail\n mockSearchEntries(ldapClient, [{ uid: 'jane', cn: 'Jane Doe', mail: undefined }])\n const loggerErrorSpy = jest.spyOn(authMethodLdapService['logger'], 'error').mockImplementation(() => undefined as any)\n const resA = await authMethodLdapService.validateUser('jane', 'pwd')\n expect(resA).toBeNull()\n expect(adminUsersManager.createUserOrGuest).not.toHaveBeenCalled()\n expect(loggerErrorSpy).toHaveBeenCalled()\n\n // Phase 2: create a new user (success, single email)\n // Stub directement checkAuth pour retourner une entrée LDAP valide\n const checkAuthSpy = jest.spyOn<any, any>(authMethodLdapService as any, 'checkAuth')\n checkAuthSpy.mockResolvedValueOnce({ uid: 'john', cn: 'John Doe', mail: 'john@example.org' } as any)\n adminUsersManager.createUserOrGuest.mockClear()\n usersManager.findUser.mockResolvedValue(null)\n const createdUser: any = { id: 2, login: 'john', isGuest: false, isActive: true, makePaths: jest.fn() }\n adminUsersManager.createUserOrGuest.mockResolvedValue(createdUser)\n // If the service reloads the user via fromUserId after creation\n usersManager.fromUserId.mockResolvedValue(createdUser)\n // Cover the success-flow catch branch\n const loggerErrorSpy2 = spyLoggerError()\n usersManager.updateAccesses.mockRejectedValueOnce(new Error('updateAccesses success flow boom'))\n const resB = await authMethodLdapService.validateUser('john', 'pwd', '192.168.1.10')\n expect(adminUsersManager.createUserOrGuest).toHaveBeenCalledWith(\n { login: 'john', email: 'john@example.org', password: 'pwd', firstName: 'John', lastName: 'Doe', role: 1 },\n expect.anything() // USER_ROLE.USER\n )\n expect(resB).toBe(createdUser)\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(createdUser, '192.168.1.10', true)\n expect(loggerErrorSpy2).toHaveBeenCalled()\n // Phase 3: multiple emails -> keep the first\n adminUsersManager.createUserOrGuest.mockClear()\n usersManager.findUser.mockResolvedValue(null)\n setupLdapSuccess([{ uid: 'multi', cn: 'Multi Mail', mail: ['first@example.org', 'second@example.org'] }])\n const createdUser2: any = { id: 9, login: 'multi', makePaths: jest.fn() }\n adminUsersManager.createUserOrGuest.mockResolvedValue(createdUser2)\n usersManager.fromUserId.mockResolvedValue(createdUser2)\n const resC = await authMethodLdapService.validateUser('multi', 'pwd')\n expect(adminUsersManager.createUserOrGuest).toHaveBeenCalledWith(expect.objectContaining({ email: 'first@example.org' }), expect.anything())\n expect(resC).toBe(createdUser2)\n })\n\n it('should update existing user profile when LDAP identity changed (except password assigned back)', async () => {\n // Arrange: existing user with different profile and an old password\n const existingUser: any = buildUser({ id: 5 })\n usersManager.findUser.mockResolvedValue(existingUser)\n // LDAP succeeds and returns different email and same uid\n setupLdapSuccess([{ uid: 'john', cn: 'John Doe', mail: 'john@example.org' }])\n // Admin manager successfully updates a user\n adminUsersManager.updateUserOrGuest.mockResolvedValue(undefined)\n // Ensure password is considered changed so the update payload includes it,\n // which then triggers the deletion and local assignment branches after update\n const compareSpy = jest.spyOn(commonFunctions, 'comparePassword').mockResolvedValue(false)\n const res = await authMethodLdapService.validateUser('john', 'new-plain-password', '127.0.0.2')\n expect(adminUsersManager.updateUserOrGuest).toHaveBeenCalledWith(\n 5,\n expect.objectContaining({\n email: 'john@example.org',\n firstName: 'John',\n lastName: 'Doe'\n })\n )\n // Password should not be assigned back onto the user object (it is deleted before Object.assign)\n expect(existingUser.password).toBe('hashed')\n // Other fields should be updated locally\n expect(existingUser.email).toBe('john@example.org')\n expect(existingUser).toMatchObject({ firstName: 'John', lastName: 'Doe' })\n // Accesses updated as success\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '127.0.0.2', true)\n // Returned user is the same instance\n expect(res).toBe(existingUser)\n\n // Second run: password unchanged (comparePassword => true) to cover the null branch for password\n adminUsersManager.updateUserOrGuest.mockClear()\n usersManager.updateAccesses.mockClear()\n // Force another non-password change so an update occurs\n existingUser.email = 'old@example.org'\n compareSpy.mockResolvedValue(true)\n const res2 = await authMethodLdapService.validateUser('john', 'same-plain-password', '127.0.0.3')\n // Update should be called without password, only with changed fields\n expect(adminUsersManager.updateUserOrGuest).toHaveBeenCalled()\n const updateArgs = adminUsersManager.updateUserOrGuest.mock.calls[0]\n expect(updateArgs[0]).toBe(5)\n expect(updateArgs[1]).toEqual(\n expect.objectContaining({\n email: 'john@example.org'\n })\n )\n expect(updateArgs[1]).toEqual(expect.not.objectContaining({ password: expect.anything() }))\n // Password remains unchanged locally\n expect(existingUser.password).toBe('hashed')\n // Accesses updated as success\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '127.0.0.3', true)\n // Returned user is the same instance\n expect(res2).toBe(existingUser)\n // Third run: no changes at all (identityHasChanged is empty) to cover the else branch\n adminUsersManager.updateUserOrGuest.mockClear()\n usersManager.updateAccesses.mockClear()\n compareSpy.mockResolvedValue(true)\n // Local user already matches LDAP identity; call again\n const res3 = await authMethodLdapService.validateUser('john', 'same-plain-password', '127.0.0.4')\n // No update should be triggered\n expect(adminUsersManager.updateUserOrGuest).not.toHaveBeenCalled()\n // Access should still be updated as success\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '127.0.0.4', true)\n // Returned user is the same instance\n expect(res3).toBe(existingUser)\n })\n\n it('should log failed access when LDAP search returns no entry or throws after bind', async () => {\n // Phase 1: no entry found after a successful bind -> failed access\n const existingUser: any = { id: 7, login: 'ghost', isGuest: false, isActive: true }\n usersManager.findUser.mockResolvedValue(existingUser)\n setupLdapSuccess([])\n const resA = await authMethodLdapService.validateUser('ghost', 'pwd', '10.10.0.1')\n expect(resA).toBeNull()\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '10.10.0.1', false)\n\n // Phase 2: exception during search after a bind -> failed access\n jest.clearAllMocks()\n const existingUser2: any = { id: 10, login: 'john', isGuest: false, isActive: true }\n usersManager.findUser.mockResolvedValue(existingUser2)\n mockBindResolve(ldapClient)\n mockSearchReject(ldapClient, new Error('search failed'))\n const resB = await authMethodLdapService.validateUser('john', 'pwd', '1.1.1.1')\n expect(resB).toBeNull()\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser2, '1.1.1.1', false)\n })\n\n it('should allow app password when LDAP fails and scope is provided', async () => {\n const existingUser: any = buildUser({ id: 42 })\n usersManager.findUser.mockResolvedValue(existingUser)\n // LDAP invalid credentials\n mockBindRejectInvalid(ldapClient, InvalidCredentialsError, 'invalid credentials')\n // App password success\n usersManager.validateAppPassword.mockResolvedValue(true)\n const res = await authMethodLdapService.validateUser('john', 'app-password', '10.0.0.2', 'webdav' as any)\n expect(res).toBe(existingUser)\n expect(usersManager.validateAppPassword).toHaveBeenCalledWith(existingUser, 'app-password', '10.0.0.2', 'webdav')\n expect(usersManager.updateAccesses).toHaveBeenCalledWith(existingUser, '10.0.0.2', true)\n })\n\n it('should throw 500 when LDAP connection error occurs during bind', async () => {\n // Arrange: no existing user to reach checkAuth flow\n usersManager.findUser.mockResolvedValue(null)\n const err1 = new Error('socket hang up')\n const err2 = Object.assign(new Error('connect ECONNREFUSED'), { code: Array.from(CONNECT_ERROR_CODE)[0] })\n ldapClient.bind.mockRejectedValue({ errors: [err1, err2] })\n ldapClient.unbind.mockResolvedValue(undefined)\n\n // First scenario: recognized connection error -> throws 500\n await expect(authMethodLdapService.validateUser('john', 'pwd')).rejects.toThrow(/authentication service/i)\n\n // Second scenario: generic error (no code, not InvalidCredentialsError) -> resolves to null and no access update\n ldapClient.bind.mockReset()\n ldapClient.unbind.mockReset()\n usersManager.updateAccesses.mockClear()\n usersManager.findUser.mockResolvedValue(null as any)\n ldapClient.bind.mockRejectedValue(new Error('unexpected failure'))\n ldapClient.unbind.mockResolvedValue(undefined)\n\n const res = await authMethodLdapService.validateUser('john', 'pwd')\n expect(res).toBeNull()\n expect(usersManager.updateAccesses).not.toHaveBeenCalled()\n })\n\n it('should log update failure when updating existing user', async () => {\n // Arrange: existing user with changed identity\n const existingUser: any = buildUser({ id: 11, email: 'old@ex.org' })\n usersManager.findUser.mockResolvedValue(existingUser)\n // Ensure LDAP loginAttribute matches uid for this test (a previous test sets it to 'cn')\n setupLdapSuccess([{ uid: 'john', cn: 'John Doe', mail: 'john@example.org' }])\n adminUsersManager.updateUserOrGuest.mockRejectedValue(new Error('db error'))\n // Force identity to be considered changed only for this test\n jest.spyOn(commonFunctions, 'comparePassword').mockResolvedValue(false)\n jest.spyOn(commonFunctions, 'splitFullName').mockReturnValue({ firstName: 'John', lastName: 'Doe' })\n const res = await authMethodLdapService.validateUser('john', 'pwd')\n expect(adminUsersManager.updateUserOrGuest).toHaveBeenCalled()\n // Local fields unchanged since update failed\n expect(existingUser.email).toBe('old@ex.org')\n expect(res).toBe(existingUser)\n })\n\n it('should skip non-matching LDAP entries then update user with changed password without reassigning it', async () => {\n // Phase A: LDAP returns an entry but loginAttribute value does not match -> checkAccess returns false (covers return after loop)\n const userA: any = { id: 20, login: 'john', isGuest: false, isActive: true }\n usersManager.findUser.mockResolvedValue(userA)\n ldapClient.bind.mockResolvedValue(undefined)\n\n // Phase B: Matching entry + password considered changed -> updateUserOrGuest called, password not reassigned locally\n jest.clearAllMocks()\n const userB: any = buildUser({ id: 21, email: 'old@ex.org' })\n usersManager.findUser.mockResolvedValue(userB)\n setupLdapSuccess([{ uid: 'john', cn: 'John Doe', mail: 'john@example.org' }])\n adminUsersManager.updateUserOrGuest.mockResolvedValue(undefined)\n\n // Force password to be considered changed to execute deletion + Object.assign branch\n jest.spyOn(commonFunctions, 'comparePassword').mockResolvedValue(false)\n jest.spyOn(commonFunctions, 'splitFullName').mockReturnValue({ firstName: 'John', lastName: 'Doe' })\n const resB = await authMethodLdapService.validateUser('john', 'newpwd', '4.4.4.4')\n\n // Line 132: updateUserOrGuest call\n expect(adminUsersManager.updateUserOrGuest).toHaveBeenCalledWith(\n 21,\n expect.objectContaining({ email: 'john@example.org', firstName: 'John', lastName: 'Doe' })\n )\n\n // Lines 139-142: password removed from local assign, other fields assigned\n expect(userB.password).toBe('hashed')\n expect(userB.email).toBe('john@example.org')\n expect(userB).toMatchObject({ firstName: 'John', lastName: 'Doe' })\n expect(resB).toBe(userB)\n })\n})\n"],"names":["jest","mock","actual","requireActual","mockClientInstance","bind","fn","search","unbind","Client","mockImplementation","mockBindResolve","ldapClient","mockResolvedValue","undefined","mockBindRejectInvalid","InvalidCredentialsErrorCtor","message","mockRejectedValue","mockSearchEntries","entries","searchEntries","mockSearchReject","err","buildUser","overrides","id","login","email","password","isGuest","isActive","makePaths","setFullName","describe","AuthMethodLdapService","name","authMethodLdapService","usersManager","adminUsersManager","setupLdapSuccess","spyLoggerError","spyOn","beforeAll","configuration","auth","ldap","servers","attributes","LDAP_LOGIN_ATTR","UID","baseDN","filter","module","Test","createTestingModule","providers","provide","UsersManager","useValue","findUser","logUser","updateAccesses","validateAppPassword","fromUserId","AdminUsersManager","createUserOrGuest","updateUserOrGuest","compile","useLogger","get","it","expect","toBeDefined","guestUser","dbAuthResult","token","res","validateUser","toEqual","toHaveBeenCalledWith","not","toHaveBeenCalled","loggerErrorSpy1","rejects","toThrow","existingUser","uid","cn","mail","InvalidCredentialsError","loggerErrorSpy","mockRejectedValueOnce","Error","res1","toBeNull","mockClear","res2","resA","checkAuthSpy","mockResolvedValueOnce","createdUser","loggerErrorSpy2","resB","firstName","lastName","role","anything","toBe","createdUser2","resC","objectContaining","compareSpy","commonFunctions","toMatchObject","updateArgs","calls","res3","clearAllMocks","existingUser2","err1","err2","Object","assign","code","Array","from","CONNECT_ERROR_CODE","errors","mockReset","mockReturnValue","userA","userB"],"mappings":"AAAA;;;;CAIC;;;;yBAEmC;wBAEY;8BACb;0CAED;qCACL;mEACI;mCACH;0BACE;uCACM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,gDAAgD;AAChDA,KAAKC,IAAI,CAAC,UAAU;IAClB,MAAMC,SAASF,KAAKG,aAAa,CAAC;IAClC,MAAMC,qBAAqB;QACzBC,MAAML,KAAKM,EAAE;QACbC,QAAQP,KAAKM,EAAE;QACfE,QAAQR,KAAKM,EAAE;IACjB;IACA,MAAMG,SAAST,KAAKM,EAAE,GAAGI,kBAAkB,CAAC,IAAMN;IAClD,0GAA0G;IAC1G,OAAO;QAAE,GAAGF,MAAM;QAAEO;IAAO;AAC7B;AAEA,6BAA6B;AAC7B,sBAAsB;AACtB,MAAME,kBAAkB,CAACC;IACvBA,WAAWP,IAAI,CAACQ,iBAAiB,CAACC;IAClCF,WAAWJ,MAAM,CAACK,iBAAiB,CAACC;AACtC;AACA,MAAMC,wBAAwB,CAACH,YAAiBI,6BAAkCC,UAAU,SAAS;IACnG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import{Da as U,V as N,Y as R,Ya as k,fb as h,nb as C,qa as O,ua as l,yb as H,zb as P}from"./chunk-2MTM6SWN.js";import{d as g}from"./chunk-ORMRCEGT.js";import{$ as _,G as a,O as f,Pc as I,Z as m,ca as x,ha as i,p as o,q as u,v as n}from"./chunk-ATP3BFHV.js";var F="Client token is expired";var E={BASE:"auth",LOGIN:"login"};var se=(()=>{let s=class s{constructor(){this.http=i(I),this.router=i(g),this.store=i(C),this.userService=i(b),this.layout=i(P),this.electron=i(H),this._refreshExpiration=parseInt(localStorage.getItem("refresh_expiration")||"0",10)||0,this._accessExpiration=parseInt(localStorage.getItem("access_expiration")||"0",10)||0}get refreshExpiration(){return this._refreshExpiration}set refreshExpiration(e){this._refreshExpiration=e!==0?e+60:e,localStorage.setItem("refresh_expiration",e.toString())}get accessExpiration(){return this._accessExpiration}set accessExpiration(e){this._accessExpiration=e!==0?e+60:e,localStorage.setItem("access_expiration",e.toString())}login(e,t){return this.http.post(T,{login:e,password:t}).pipe(n(r=>r.server.twoFaEnabled&&r.user.twoFaEnabled?(this.accessExpiration=r.token.access_2fa_expiration,this.refreshExpiration=this.accessExpiration,{success:!0,twoFaEnabled:!0,message:null}):(this.initUserFromResponse(r),{success:!0,message:null})),a(r=>(console.warn(r),o({success:!1,message:r.error.message||r.message}))))}loginElectron(){return this.electron.authenticate().pipe(m(e=>this.http.post(N,e).pipe(n(t=>(this.accessExpiration=t.token.access_expiration,this.refreshExpiration=t.token.refresh_expiration,this.userService.initUser(t.user),t?.client_token_update&&this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_UPDATE,t.client_token_update),!0)),a(t=>(console.warn(t),t.error.message===F?this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_EXPIRED):this.electron.send(h.SERVER.AUTHENTICATION_FAILED),o(!1))))))}logout(e=!0,t=!1){if((e||t)&&this.store.userImpersonate()){this.logoutImpersonateUser();return}this.userService.disconnectWebSocket(),this.clearCookies().pipe(f(()=>{this.accessExpiration=0,this.refreshExpiration=0,this.layout.clean(),this.store.clean(),e&&this.router.navigate([E.BASE,E.LOGIN]).catch(console.error),t&&this.layout.sendNotification("warning","Session has expired","Please sign in")})).subscribe()}logoutImpersonateUser(){this.http.post(O,null).subscribe({next:e=>{this.userService.disconnectWebSocket(),this.initUserFromResponse(e),this.router.navigate([l.BASE,l.ACCOUNT]).catch(console.error)},error:e=>{console.error(e),this.layout.sendNotification("error","Impersonate identity","logout",e)}})}initUserFromResponse(e,t=!1){e!==null&&(this.accessExpiration=e.token.access_expiration,this.refreshExpiration=e.token.refresh_expiration,this.userService.initUser(e.user,t),this.setServerConfig(e.server))}isLogged(){return!this.refreshTokenHasExpired()}refreshToken(){return this.http.post(d,null).pipe(n(e=>(this.accessExpiration=e.access_expiration,this.refreshExpiration=e.refresh_expiration,!0)),a(e=>(console.debug("token has expired"),this.electron.enabled?(console.debug("login with app"),this.loginElectron()):(this.logout(!0,!0),u(()=>e)))))}checkUserAuthAndLoad(e){return this.refreshTokenHasExpired()?this.electron.enabled?this.loginElectron():(this.returnUrl=e.length>1?e:null,this.logout(),o(!1)):this.store.user.getValue()?o(!0):this.http.get(R).pipe(_(t=>{this.userService.initUser(t.user),this.setServerConfig(t.server)}),n(()=>!0),a(t=>(t.status===401?this.logout():console.warn(t),o(!1))))}checkCSRF(e){return e.headers.has(c)?e.clone({headers:e.headers.set(c,k(c))}):e}loginWith2Fa(e){return this.http.post(A,e)}setServerConfig(e){e&&this.store.server.set(e)}refreshTokenHasExpired(){return this.refreshExpiration===0||U()>=this.refreshExpiration}clearCookies(){return this.http.post(S,null)}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"});let p=s;return p})();export{E as a,se as b};
1
+ import{a as T,b as S,c as d,d as A,e as c,p as b}from"./chunk-EWKSX76T.js";import{Da as U,V as N,Y as R,Ya as k,fb as h,nb as C,qa as O,ua as l,yb as H,zb as P}from"./chunk-XLCCZSQL.js";import{d as g}from"./chunk-ORMRCEGT.js";import{$ as _,G as a,O as f,Pc as I,Z as m,ca as x,ha as i,p as o,q as u,v as n}from"./chunk-ATP3BFHV.js";var F="Client token is expired";var E={BASE:"auth",LOGIN:"login"};var se=(()=>{let s=class s{constructor(){this.http=i(I),this.router=i(g),this.store=i(C),this.userService=i(b),this.layout=i(P),this.electron=i(H),this._refreshExpiration=parseInt(localStorage.getItem("refresh_expiration")||"0",10)||0,this._accessExpiration=parseInt(localStorage.getItem("access_expiration")||"0",10)||0}get refreshExpiration(){return this._refreshExpiration}set refreshExpiration(e){this._refreshExpiration=e!==0?e+60:e,localStorage.setItem("refresh_expiration",e.toString())}get accessExpiration(){return this._accessExpiration}set accessExpiration(e){this._accessExpiration=e!==0?e+60:e,localStorage.setItem("access_expiration",e.toString())}login(e,t){return this.http.post(T,{login:e,password:t}).pipe(n(r=>r.server.twoFaEnabled&&r.user.twoFaEnabled?(this.accessExpiration=r.token.access_2fa_expiration,this.refreshExpiration=this.accessExpiration,{success:!0,twoFaEnabled:!0,message:null}):(this.initUserFromResponse(r),{success:!0,message:null})),a(r=>(console.warn(r),o({success:!1,message:r.error.message||r.message}))))}loginElectron(){return this.electron.authenticate().pipe(m(e=>this.http.post(N,e).pipe(n(t=>(this.accessExpiration=t.token.access_expiration,this.refreshExpiration=t.token.refresh_expiration,this.userService.initUser(t.user),t?.client_token_update&&this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_UPDATE,t.client_token_update),!0)),a(t=>(console.warn(t),t.error.message===F?this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_EXPIRED):this.electron.send(h.SERVER.AUTHENTICATION_FAILED),o(!1))))))}logout(e=!0,t=!1){if((e||t)&&this.store.userImpersonate()){this.logoutImpersonateUser();return}this.userService.disconnectWebSocket(),this.clearCookies().pipe(f(()=>{this.accessExpiration=0,this.refreshExpiration=0,this.layout.clean(),this.store.clean(),e&&this.router.navigate([E.BASE,E.LOGIN]).catch(console.error),t&&this.layout.sendNotification("warning","Session has expired","Please sign in")})).subscribe()}logoutImpersonateUser(){this.http.post(O,null).subscribe({next:e=>{this.userService.disconnectWebSocket(),this.initUserFromResponse(e),this.router.navigate([l.BASE,l.ACCOUNT]).catch(console.error)},error:e=>{console.error(e),this.layout.sendNotification("error","Impersonate identity","logout",e)}})}initUserFromResponse(e,t=!1){e!==null&&(this.accessExpiration=e.token.access_expiration,this.refreshExpiration=e.token.refresh_expiration,this.userService.initUser(e.user,t),this.setServerConfig(e.server))}isLogged(){return!this.refreshTokenHasExpired()}refreshToken(){return this.http.post(d,null).pipe(n(e=>(this.accessExpiration=e.access_expiration,this.refreshExpiration=e.refresh_expiration,!0)),a(e=>(console.debug("token has expired"),this.electron.enabled?(console.debug("login with app"),this.loginElectron()):(this.logout(!0,!0),u(()=>e)))))}checkUserAuthAndLoad(e){return this.refreshTokenHasExpired()?this.electron.enabled?this.loginElectron():(this.returnUrl=e.length>1?e:null,this.logout(),o(!1)):this.store.user.getValue()?o(!0):this.http.get(R).pipe(_(t=>{this.userService.initUser(t.user),this.setServerConfig(t.server)}),n(()=>!0),a(t=>(t.status===401?this.logout():console.warn(t),o(!1))))}checkCSRF(e){return e.headers.has(c)?e.clone({headers:e.headers.set(c,k(c))}):e}loginWith2Fa(e){return this.http.post(A,e)}setServerConfig(e){e&&this.store.server.set(e)}refreshTokenHasExpired(){return this.refreshExpiration===0||U()>=this.refreshExpiration}clearCookies(){return this.http.post(S,null)}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"});let p=s;return p})();export{E as a,se as b};
@@ -1 +1 @@
1
- import{Ab as r,B as l,Db as N,Eb as C,Fb as k,Ia as c,Lb as p,Pb as U,Rb as h,Ta as d,Tb as A,Wb as u,lb as w,ob as m,rb as x,sb as b}from"./chunk-2MTM6SWN.js";import{c as a,d as I,h as E,m as $}from"./chunk-22EANI6R.js";import{Pc as M,ca as T,ha as _,v as n}from"./chunk-ATP3BFHV.js";function R(i){i.file?.id?(i.file.isDir&&(i.file.mime=i.parent?.alias?I:a),i.mimeUrl=E(i.file.mime)):i.mimeUrl=E(i.parent?.alias?I:a)}function y(i){let e,o=i.file.path?i.file.path.split("/").filter(s=>s&&s!=="."):[];if(i.parent?.id){if(!o.length)return[p.SPACES_SHARES,i.parent.alias];e=`${p.SPACES_SHARES}/${i.parent.alias}`}else i.file.space?.alias?i.file.inTrash?e=`${p.SPACES_TRASH}/${i.file.space.alias}`:(e=`${p.SPACES_FILES}/${i.file.space.alias}`,i.file.space?.root?.alias&&(o.length?e=`${e}/${i.file.space.root.alias}`:o.push(i.file.space.root.name))):i.file?.ownerId?e=`${i.file.inTrash?p.PERSONAL_TRASH:p.PERSONAL_FILES}`:console.warn("unable to find the right file path",i);let t=o.pop();return e&&o.length&&(e=`${e}/${o.join("/")}`),[e,t]}var g=class{constructor(e){this.hTimeExpirationAgo=0,this.hPerms={},this.newly=0,Object.assign(this,e),R(this),this.updatePermission(),this.updateTimes()}fallBackMimeUrl(){this.mimeUrl=$}updatePermission(){this.hPerms=h(this.link.permissions)}updateTimes(){if(this.hTimeAccessAgo=(0,l.default)(this.link.currentAccess).fromNow(!0),this.newly=d(this.link.currentAccess),this.link.expiresAt){this.link.expiresAt=new Date((0,l.default)(this.link.expiresAt).local().format("YYYY-MM-DD"));let e=Math.max(0,(0,l.default)(this.link.expiresAt).diff((0,l.default)(),"hours"));e===0?this.hTimeExpirationAgo=0:e<=24?this.hTimeExpirationAgo=1:this.hTimeExpirationAgo=Math.round(e/24)+1}else this.hTimeExpirationAgo=0}};var B=(function(i){return i[i.COMMON=0]="COMMON",i[i.LINK=1]="LINK",i})(B||{}),D=Object.values(m).filter(i=>i!==m.SHARE_INSIDE).sort().join(":");var P=class{constructor(e){this.members=[],this.links=[],this.hPerms={},this.setMembers(c("members",e),e.externalPath||e.file?.isDir?[m.SHARE_INSIDE]:[]),Object.assign(this,e),R(this),this.checkFile(),this.setPermissions()}fallBackMimeUrl(){this.mimeUrl=$}setMembers(e,o){if(e)for(let t of e)t.linkId?this.links.push(new A(t,[...o,m.SHARE_OUTSIDE])):this.members.push(new A(t,o))}checkFile(){this.file&&(!this.file.path&&this.file.space.root?.name&&(this.file.path=this.file.space.root.name,this.file.name=this.file.space.root.name),this.file.permissions&&(this.file.permissions=this.file.permissions.split(":").filter(e=>e===m.SHARE_INSIDE||e===m.ADD&&this.file.id&&!this.file.isDir?!1:!(e===m.DELETE&&this.file.id&&!this.file.isDir)).join(":")))}setPermissions(){typeof this.file?.permissions=="string"?this.hPerms=h(this.file.permissions):this.externalPath&&(this.hPerms=h(D))}};var f=class{constructor(e){this.roots=[],this.managers=[],this.members=[],this.links=[],this.hPerms={},this.newly=0,this.hPerms=h(e.permissions),this.setMembers(c("members",e)),this.setRoots(c("roots",e)),Object.assign(this,e),this.hTimeAgo=(0,l.default)(this.modifiedAt).fromNow(!0),this.newly=d(this.modifiedAt),this.sort()}addRoot(e,o=!1){e.hPerms=U(e.permissions,[m.SHARE_INSIDE]),e.owner?.login&&(e.owner.avatarUrl=w(e.owner.login)),e.file.mimeUrl=E(e.file?.mime?e.file.mime:a),o?this.roots.unshift(e):this.roots.push(e),e.isDir=e.file.mime===a||!!e.externalPath}havePermission(e){return this.permissions.indexOf(e)>-1}setMembers(e){if(e)for(let o of e){let t=new A(o);t.isLink?this.links.push(t):t.spaceRole===x.IS_MANAGER?this.managers.push(t):this.members.push(t)}}setRoots(e){if(e)for(let o of e)this.addRoot(o)}sort(){u(this.roots,"createdAt",!1),u(this.managers,"createdAt",!1),u(this.members,"createdAt",!1),u(this.links,"createdAt",!1)}};var Oe=(()=>{let e=class e{constructor(){this.http=_(M)}listSpaces(){return this.http.get(N).pipe(n(t=>t.map(s=>new f(s))))}getSpace(t){return this.http.get(`${r.BASE}/${t}`).pipe(n(s=>new f(s)))}getUserSpaceRoots(t){return this.http.get(`${r.BASE}/${t}/${r.ROOTS}`)}createUserSpaceRoots(t,s){return this.http.post(`${r.BASE}/${t}/${r.ROOTS}`,s)}updateUserSpaceRoots(t,s){return this.http.put(`${r.BASE}/${t}/${r.ROOTS}`,s)}updateSpace(t){return this.http.put(`${r.BASE}/${t.id}`,t).pipe(n(s=>s?new f(s):null))}createSpace(t){return this.http.post(r.BASE,t).pipe(n(s=>(s.permissions=b,new f(s))))}deleteSpace(t,s){return this.http.request("delete",`${r.BASE}/${t}`,{body:s})}searchSpaces(t){return this.http.request("search",r.BASE,{body:t})}listSpaceShares(t){return this.http.get(`${r.BASE}/${t}/${r.SHARES}`)}getSpaceShare(t,s){return this.http.get(`${r.BASE}/${t}/${r.SHARES}/${s}`).pipe(n(S=>new P(S)))}updateSpaceShare(t,s){return this.http.put(`${r.BASE}/${t}/${r.SHARES}/${s.id}`,s).pipe(n(S=>new P(S)))}deleteSpaceShare(t,s){return this.http.delete(`${r.BASE}/${t}/${r.SHARES}/${s}`)}getSpaceShareLink(t,s){return this.http.get(`${r.BASE}/${t}/${r.LINKS}/${s}`).pipe(n(S=>new g(S)))}listTrashBins(){return this.http.get(C)}checkSpaceRootPath(t){return this.http.post(k,{path:t})}};e.\u0275fac=function(s){return new(s||e)},e.\u0275prov=T({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();export{B as a,R as b,y as c,P as d,g as e,f,Oe as g};
1
+ import{Ab as r,B as l,Db as N,Eb as C,Fb as k,Ia as c,Lb as p,Pb as U,Rb as h,Ta as d,Tb as A,Wb as u,lb as w,ob as m,rb as x,sb as b}from"./chunk-XLCCZSQL.js";import{c as a,d as I,h as E,m as $}from"./chunk-22EANI6R.js";import{Pc as M,ca as T,ha as _,v as n}from"./chunk-ATP3BFHV.js";function R(i){i.file?.id?(i.file.isDir&&(i.file.mime=i.parent?.alias?I:a),i.mimeUrl=E(i.file.mime)):i.mimeUrl=E(i.parent?.alias?I:a)}function y(i){let e,o=i.file.path?i.file.path.split("/").filter(s=>s&&s!=="."):[];if(i.parent?.id){if(!o.length)return[p.SPACES_SHARES,i.parent.alias];e=`${p.SPACES_SHARES}/${i.parent.alias}`}else i.file.space?.alias?i.file.inTrash?e=`${p.SPACES_TRASH}/${i.file.space.alias}`:(e=`${p.SPACES_FILES}/${i.file.space.alias}`,i.file.space?.root?.alias&&(o.length?e=`${e}/${i.file.space.root.alias}`:o.push(i.file.space.root.name))):i.file?.ownerId?e=`${i.file.inTrash?p.PERSONAL_TRASH:p.PERSONAL_FILES}`:console.warn("unable to find the right file path",i);let t=o.pop();return e&&o.length&&(e=`${e}/${o.join("/")}`),[e,t]}var g=class{constructor(e){this.hTimeExpirationAgo=0,this.hPerms={},this.newly=0,Object.assign(this,e),R(this),this.updatePermission(),this.updateTimes()}fallBackMimeUrl(){this.mimeUrl=$}updatePermission(){this.hPerms=h(this.link.permissions)}updateTimes(){if(this.hTimeAccessAgo=(0,l.default)(this.link.currentAccess).fromNow(!0),this.newly=d(this.link.currentAccess),this.link.expiresAt){this.link.expiresAt=new Date((0,l.default)(this.link.expiresAt).local().format("YYYY-MM-DD"));let e=Math.max(0,(0,l.default)(this.link.expiresAt).diff((0,l.default)(),"hours"));e===0?this.hTimeExpirationAgo=0:e<=24?this.hTimeExpirationAgo=1:this.hTimeExpirationAgo=Math.round(e/24)+1}else this.hTimeExpirationAgo=0}};var B=(function(i){return i[i.COMMON=0]="COMMON",i[i.LINK=1]="LINK",i})(B||{}),D=Object.values(m).filter(i=>i!==m.SHARE_INSIDE).sort().join(":");var P=class{constructor(e){this.members=[],this.links=[],this.hPerms={},this.setMembers(c("members",e),e.externalPath||e.file?.isDir?[m.SHARE_INSIDE]:[]),Object.assign(this,e),R(this),this.checkFile(),this.setPermissions()}fallBackMimeUrl(){this.mimeUrl=$}setMembers(e,o){if(e)for(let t of e)t.linkId?this.links.push(new A(t,[...o,m.SHARE_OUTSIDE])):this.members.push(new A(t,o))}checkFile(){this.file&&(!this.file.path&&this.file.space.root?.name&&(this.file.path=this.file.space.root.name,this.file.name=this.file.space.root.name),this.file.permissions&&(this.file.permissions=this.file.permissions.split(":").filter(e=>e===m.SHARE_INSIDE||e===m.ADD&&this.file.id&&!this.file.isDir?!1:!(e===m.DELETE&&this.file.id&&!this.file.isDir)).join(":")))}setPermissions(){typeof this.file?.permissions=="string"?this.hPerms=h(this.file.permissions):this.externalPath&&(this.hPerms=h(D))}};var f=class{constructor(e){this.roots=[],this.managers=[],this.members=[],this.links=[],this.hPerms={},this.newly=0,this.hPerms=h(e.permissions),this.setMembers(c("members",e)),this.setRoots(c("roots",e)),Object.assign(this,e),this.hTimeAgo=(0,l.default)(this.modifiedAt).fromNow(!0),this.newly=d(this.modifiedAt),this.sort()}addRoot(e,o=!1){e.hPerms=U(e.permissions,[m.SHARE_INSIDE]),e.owner?.login&&(e.owner.avatarUrl=w(e.owner.login)),e.file.mimeUrl=E(e.file?.mime?e.file.mime:a),o?this.roots.unshift(e):this.roots.push(e),e.isDir=e.file.mime===a||!!e.externalPath}havePermission(e){return this.permissions.indexOf(e)>-1}setMembers(e){if(e)for(let o of e){let t=new A(o);t.isLink?this.links.push(t):t.spaceRole===x.IS_MANAGER?this.managers.push(t):this.members.push(t)}}setRoots(e){if(e)for(let o of e)this.addRoot(o)}sort(){u(this.roots,"createdAt",!1),u(this.managers,"createdAt",!1),u(this.members,"createdAt",!1),u(this.links,"createdAt",!1)}};var Oe=(()=>{let e=class e{constructor(){this.http=_(M)}listSpaces(){return this.http.get(N).pipe(n(t=>t.map(s=>new f(s))))}getSpace(t){return this.http.get(`${r.BASE}/${t}`).pipe(n(s=>new f(s)))}getUserSpaceRoots(t){return this.http.get(`${r.BASE}/${t}/${r.ROOTS}`)}createUserSpaceRoots(t,s){return this.http.post(`${r.BASE}/${t}/${r.ROOTS}`,s)}updateUserSpaceRoots(t,s){return this.http.put(`${r.BASE}/${t}/${r.ROOTS}`,s)}updateSpace(t){return this.http.put(`${r.BASE}/${t.id}`,t).pipe(n(s=>s?new f(s):null))}createSpace(t){return this.http.post(r.BASE,t).pipe(n(s=>(s.permissions=b,new f(s))))}deleteSpace(t,s){return this.http.request("delete",`${r.BASE}/${t}`,{body:s})}searchSpaces(t){return this.http.request("search",r.BASE,{body:t})}listSpaceShares(t){return this.http.get(`${r.BASE}/${t}/${r.SHARES}`)}getSpaceShare(t,s){return this.http.get(`${r.BASE}/${t}/${r.SHARES}/${s}`).pipe(n(S=>new P(S)))}updateSpaceShare(t,s){return this.http.put(`${r.BASE}/${t}/${r.SHARES}/${s.id}`,s).pipe(n(S=>new P(S)))}deleteSpaceShare(t,s){return this.http.delete(`${r.BASE}/${t}/${r.SHARES}/${s}`)}getSpaceShareLink(t,s){return this.http.get(`${r.BASE}/${t}/${r.LINKS}/${s}`).pipe(n(S=>new g(S)))}listTrashBins(){return this.http.get(C)}checkSpaceRootPath(t){return this.http.post(k,{path:t})}};e.\u0275fac=function(s){return new(s||e)},e.\u0275prov=T({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();export{B as a,R as b,y as c,P as d,g as e,f,Oe as g};
@@ -1,4 +1,4 @@
1
- import{a as kr}from"./chunk-ZQQPUYLU.js";import{c as Tr}from"./chunk-JXZCNFW7.js";import{a as Mr}from"./chunk-U34OZUZ7.js";import{a as xr,b as wr,c as Ar,d as Dr,e as Nr,h as Or}from"./chunk-7P27WBGC.js";import{b as Lr,c as xi,d as Ir,e as Mi}from"./chunk-2I4CUFUA.js";import{a as Pr,d as Jt,g as Ot}from"./chunk-7FUM3JGM.js";import{m as Si,p as _i}from"./chunk-JUNZFADM.js";import{Ab as Sr,Ba as hr,Ca as mr,Cb as _r,Da as gr,Jb as Ci,Ka as vr,Kb as ee,Lb as Dt,Na as xt,P as rt,Pa as Mt,Qa as br,ab as on,f as tr,lb as yr,nb as wt,ob as At,pb as le,qb as Be,sb as Cr,zb as H}from"./chunk-2MTM6SWN.js";import{a as Ei,c as je,d as zr,h as st,m as Nt}from"./chunk-22EANI6R.js";import{d as Xn}from"./chunk-ORMRCEGT.js";import{$ as Gn,$b as bt,$c as Qn,Ab as ke,Ac as Ve,Ad as Et,B as T,C as Gt,Cb as b,Db as qn,Dc as nt,Eb as f,Fb as Wt,Ga as ze,Gb as Kt,Gd as er,Ha as $n,Hb as et,Hc as be,Hd as Ce,Ib as Me,Jb as J,Jf as dr,Kb as Z,L as pt,La as Ji,Lb as Yt,Ld as ir,Lf as ur,Ma as l,Mb as j,Me as or,Na as Zi,Nb as V,Nc as Qt,Ob as Fe,Pb as h,Pc as He,Qa as ht,Qb as R,Ra as me,Rb as se,Sa as en,Tb as mt,Ub as gt,Ue as ar,Uf as fr,Vb as vt,X as jn,Xa as y,Xb as Re,Ya as ge,Yc as gi,Za as xe,Zb as tt,Zf as pr,_a as tn,_b as it,_c as ye,ab as P,ad as Jn,ba as Un,bb as L,bc as Wn,bd as vi,bf as lr,c as Hn,ca as Q,cb as Ut,cc as hi,da as he,dc as ve,ec as mi,ef as yi,f as Bt,fc as yt,fd as Ct,gg as Er,ha as p,hc as Xt,jb as D,kb as N,kd as St,ma as S,na as _,nb as nn,ne as nr,nf as cr,ob as rn,pb as u,qb as c,qc as sn,rb as d,rc as Kn,sb as g,se as rr,tb as $t,u as Qi,ub as qt,ud as bi,v as jt,va as Qe,vb as pi,ve as sr,w as Bn,wb as Je,xb as Ze,ya as ae,yb as Ie,yd as _t,zb as F,zc as Yn,zd as Zn}from"./chunk-ATP3BFHV.js";import{a as oe,b as Ye,j as Xe}from"./chunk-RTRJ3KFH.js";var ml={prefix:"far",iconName:"bell",icon:[448,512,[128276,61602],"f0f3","M224 0c-13.3 0-24 10.7-24 24l0 9.7C118.6 45.3 56 115.4 56 200l0 14.5c0 37.7-10 74.7-29 107.3L5.1 359.2C1.8 365 0 371.5 0 378.2 0 399.1 16.9 416 37.8 416l372.4 0c20.9 0 37.8-16.9 37.8-37.8 0-6.7-1.8-13.3-5.1-19L421 321.7c-19-32.6-29-69.6-29-107.3l0-14.5c0-84.6-62.6-154.7-144-166.3l0-9.7c0-13.3-10.7-24-24-24zM392.4 368l-336.9 0 12.9-22.1C91.7 306 104 260.6 104 214.5l0-14.5c0-66.3 53.7-120 120-120s120 53.7 120 120l0 14.5c0 46.2 12.3 91.5 35.5 131.4L392.4 368zM156.1 464c9.9 28 36.6 48 67.9 48s58-20 67.9-48l-135.8 0z"]};var go={prefix:"far",iconName:"file-zipper",icon:[384,512,["file-archive"],"f1c6","M64 48l112 0 0 88c0 39.8 32.2 72 72 72l88 0 0 240c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16zM224 67.9l92.1 92.1-68.1 0c-13.3 0-24-10.7-24-24l0-68.1zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-261.5c0-17-6.7-33.3-18.7-45.3L242.7 18.7C230.7 6.7 214.5 0 197.5 0L64 0zM80 104c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0c-13.3 0-24 10.7-24 24zm0 80c0 13.3 10.7 24 24 24l32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0c-13.3 0-24 10.7-24 24zm64 56l-32 0c-17.7 0-32 14.3-32 32l0 48c0 26.5 21.5 48 48 48s48-21.5 48-48l0-48c0-17.7-14.3-32-32-32zm-16 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]},gl=go;var vl={prefix:"far",iconName:"clock",icon:[512,512,[128339,"clock-four"],"f017","M464 256a208 208 0 1 1 -416 0 208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0 256 256 0 1 0 -512 0zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]};var wi={prefix:"far",iconName:"file",icon:[384,512,[128196,128459,61462],"f15b","M176 48L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-240-88 0c-39.8 0-72-32.2-72-72l0-88zM316.1 160L224 67.9 224 136c0 13.3 10.7 24 24 24l68.1 0zM0 64C0 28.7 28.7 0 64 0L197.5 0c17 0 33.3 6.7 45.3 18.7L365.3 141.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64z"]};var bl={prefix:"far",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M166.2-16c-13.3 0-25.3 8.3-30 20.8L120 48 24 48C10.7 48 0 58.7 0 72S10.7 96 24 96l400 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-96 0-16.2-43.2C307.1-7.7 295.2-16 281.8-16L166.2-16zM32 144l0 304c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-304-48 0 0 304c0 8.8-7.2 16-16 16L96 464c-8.8 0-16-7.2-16-16l0-304-48 0zm160 72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 176c0 13.3 10.7 24 24 24s24-10.7 24-24l0-176zm112 0c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 176c0 13.3 10.7 24 24 24s24-10.7 24-24l0-176z"]};var yl={prefix:"far",iconName:"user",icon:[448,512,[128100,62144,62470,"user-alt","user-large"],"f007","M144 128a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zm208 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0zM48 480c0-70.7 57.3-128 128-128l96 0c70.7 0 128 57.3 128 128l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8c0-97.2-78.8-176-176-176l-96 0C78.8 304 0 382.8 0 480l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8z"]};var Cl={prefix:"far",iconName:"file-lines",icon:[384,512,[128441,128462,61686,"file-alt","file-text"],"f15c","M64 48l112 0 0 88c0 39.8 32.2 72 72 72l88 0 0 240c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16zM224 67.9l92.1 92.1-68.1 0c-13.3 0-24-10.7-24-24l0-68.1zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-261.5c0-17-6.7-33.3-18.7-45.3L242.7 18.7C230.7 6.7 214.5 0 197.5 0L64 0zm56 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]};var Sl={prefix:"far",iconName:"comment-dots",icon:[512,512,[128172,62075,"commenting"],"f4ad","M0 240c0 54.4 19.3 104.6 51.9 144.9L3.1 474.3c-2 3.7-3.1 7.9-3.1 12.2 0 14.1 11.4 25.5 25.5 25.5 4 0 7.8-.6 11.5-2.1L153.4 460c31.4 12.9 66.1 20 102.6 20 141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240zM94 407.9c9.3-17.1 7.4-38.1-4.8-53.2-26.1-32.3-41.2-71.9-41.2-114.7 0-103.2 90.2-192 208-192s208 88.8 208 192-90.2 192-208 192c-30.2 0-58.7-5.9-84.3-16.4-11.9-4.9-25.3-4.8-37.1 .3L76 440.9 94 407.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]};var _l={prefix:"far",iconName:"flag",icon:[448,512,[127988,61725],"f024","M48 24C48 10.7 37.3 0 24 0S0 10.7 0 24L0 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-100 80.3-20.1c41.1-10.3 84.6-5.5 122.5 13.4 44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30l0-279.7c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0-35.1-17.6-75.4-22-113.5-12.5L48 52 48 24zm0 77.5l96.6-24.2c27-6.7 55.5-3.6 80.4 8.8 54.9 27.4 118.7 29.7 175 6.8l0 241.8-24.4 9.1c-33.7 12.6-71.2 10.7-103.4-5.4-48.2-24.1-103.3-30.1-155.6-17.1l-68.6 17.2 0-237z"]};var El={prefix:"far",iconName:"window-restore",icon:[576,512,[],"f2d2","M512 80L224 80c-8.8 0-16 7.2-16 16l0 16-48 0 0-16c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64l-48 0 0-48 48 0c8.8 0 16-7.2 16-16l0-192c0-8.8-7.2-16-16-16zM368 288l-320 0 0 128c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16l0-128zM64 160l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64z"]};var Fr={prefix:"far",iconName:"folder-closed",icon:[512,512,[],"e185","M448 400L64 400c-8.8 0-16-7.2-16-16l0-144 416 0 0 144c0 8.8-7.2 16-16 16zm16-208l-416 0 0-96c0-8.8 7.2-16 16-16l138.7 0c3.5 0 6.8 1.1 9.6 3.2L250.7 112c13.8 10.4 30.7 16 48 16L448 128c8.8 0 16 7.2 16 16l0 48zM64 448l384 0c35.3 0 64-28.7 64-64l0-240c0-35.3-28.7-64-64-64L298.7 80c-6.9 0-13.7-2.2-19.2-6.4L241.1 44.8C230 36.5 216.5 32 202.7 32L64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64z"]};var Rr=(()=>{let e=class e{transform(t,n=0,s=void 0){return Mt(t,n,s)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275pipe=tn({name:"pathSlice",type:e,pure:!0});let i=e;return i})();var dn=function(i,e){return dn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n])},dn(i,e)};function Yr(i,e){dn(i,e);function r(){this.constructor=i}i.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var te=function(){return te=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},te.apply(this,arguments)};function Xr(i,e){var r=typeof Symbol=="function"&&i[Symbol.iterator];if(!r)return i;var t=r.call(i),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=t.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return s}function un(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(Xr(arguments[e]));return i}var vo="An invariant failed, however the error is obfuscated because this is an production build.",Ni=[];Object.freeze(Ni);var vn={};Object.freeze(vn);var bo={};function fn(){return typeof window<"u"?window:typeof global<"u"?global:bo}function ie(){return++v.mobxGuid}function k(i){throw ei(!1,i),"X"}function ei(i,e){if(!i)throw new Error("[mobx] "+(e||vo))}var Vr=[];function De(i,e){return!1}function bn(i){var e=!1;return function(){if(!e)return e=!0,i.apply(this,arguments)}}var Hr=function(){};function yo(i){var e=[];return i.forEach(function(r){e.indexOf(r)===-1&&e.push(r)}),e}function yn(i){return i!==null&&typeof i=="object"}function zt(i){if(i===null||typeof i!="object")return!1;var e=Object.getPrototypeOf(i);return e===Object.prototype||e===null}function Co(i){return It(i)||ut(i)?i:Array.isArray(i)?new Map(i):zt(i)?new Map(Object.entries(i)):k("Cannot convert to map from '"+i+"'")}function So(i,e){for(var r=0;r<e.length;r++)ct(i,e[r],i[e[r]])}function ct(i,e,r){Object.defineProperty(i,e,{enumerable:!1,writable:!0,configurable:!0,value:r})}function ri(i,e,r){Object.defineProperty(i,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}function qe(i,e){var r="isMobX"+i;return e.prototype[r]=!0,function(t){return yn(t)&&t[r]===!0}}function _o(i,e){return typeof i=="number"&&typeof e=="number"&&isNaN(i)&&isNaN(e)}function It(i){return fn().Map!==void 0&&i instanceof fn().Map}function si(i){return i instanceof Set}function Pt(i){for(var e=[];;){var r=i.next();if(r.done)break;e.push(r.value)}return e}function Qr(){return typeof Symbol=="function"&&Symbol.toPrimitive||"@@toPrimitive"}function Jr(i){return i===null?null:typeof i=="object"?""+i:i}function Cn(){return typeof Symbol=="function"&&Symbol.iterator||"@@iterator"}function Sn(i,e){ri(i,Cn(),e)}function ti(i){return i[Cn()]=Eo,i}function _n(){return typeof Symbol=="function"&&Symbol.toStringTag||"@@toStringTag"}function Eo(){return this}var Ii=(function(){function i(e){e===void 0&&(e="Atom@"+ie()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=O.NOT_TRACKING}return i.prototype.onBecomeUnobserved=function(){},i.prototype.onBecomeObserved=function(){},i.prototype.reportObserved=function(){return fs(this)},i.prototype.reportChanged=function(){Ne(),qo(this),Oe()},i.prototype.toString=function(){return this.name},i})(),En=qe("Atom",Ii);function xo(i,e,r){e===void 0&&(e=Hr),r===void 0&&(r=Hr);var t=new Ii(i);return ra(t,e),vs(t,r),t}function Zr(i,e){return i===e}function Mo(i,e){return An(i,e)}function wo(i,e){return An(i,e,1)}function Ao(i,e){return _o(i,e)||Zr(i,e)}var Lt={identity:Zr,structural:Mo,default:Ao,shallow:wo},Do={},No={};function Oo(i,e){var r=e?Do:No;return r[i]||(r[i]={configurable:!0,enumerable:e,get:function(){return at(this),this[i]},set:function(t){at(this),this[i]=t}})}function at(i){if(i.__mobxDidRunLazyInitializers!==!0){var e=i.__mobxDecorators;if(e){ct(i,"__mobxDidRunLazyInitializers",!0);for(var r in e){var t=e[r];t.propertyCreator(i,t.prop,t.descriptor,t.decoratorTarget,t.decoratorArguments)}}}}function es(i,e){return function(){var t,n=function(o,a,m,C){if(C===!0)return e(o,a,m,o,t),null;if(!Object.prototype.hasOwnProperty.call(o,"__mobxDecorators")){var I=o.__mobxDecorators;ct(o,"__mobxDecorators",te({},I))}return o.__mobxDecorators[a]={prop:a,propertyCreator:e,descriptor:m,decoratorTarget:o,decoratorArguments:t},Oo(a,i)};return To(arguments)?(t=Ni,n.apply(null,arguments)):(t=Array.prototype.slice.call(arguments),n)}}function To(i){return(i.length===2||i.length===3)&&typeof i[1]=="string"||i.length===4&&i[3]===!0}function oi(i,e,r){return Cs(i)?i:Array.isArray(i)?M.array(i,{name:r}):zt(i)?M.object(i,void 0,{name:r}):It(i)?M.map(i,{name:r}):si(i)?M.set(i,{name:r}):i}function Po(i,e,r){return i==null||ni(i)||Vi(i)||ut(i)||Ft(i)?i:Array.isArray(i)?M.array(i,{name:r,deep:!1}):zt(i)?M.object(i,void 0,{name:r,deep:!1}):It(i)?M.map(i,{name:r,deep:!1}):si(i)?M.set(i,{name:r,deep:!1}):k(!1)}function ii(i){return i}function Lo(i,e,r){return An(i,e)?e:i}function ki(i){var e=es(!0,function(t,n,s,o,a){var m=s?s.initializer?s.initializer.call(t):s.value:void 0;ba(t,n,m,i)}),r=(typeof process<"u"&&process.env,e);return r.enhancer=i,r}var ts={deep:!0,name:void 0,defaultDecorator:void 0},zo={deep:!1,name:void 0,defaultDecorator:void 0};Object.freeze(ts);Object.freeze(zo);function Tt(i){return i==null?ts:typeof i=="string"?{name:i,deep:!0}:i}function Ai(i){return i.defaultDecorator?i.defaultDecorator.enhancer:i.deep===!1?ii:oi}var xn=ki(oi),Io=ki(Po),is=ki(ii),ko=ki(Lo);function Fo(i,e,r){if(typeof arguments[1]=="string")return xn.apply(null,arguments);if(Cs(i))return i;var t=zt(i)?M.object(i,e,r):Array.isArray(i)?M.array(i,e):It(i)?M.map(i,e):si(i)?M.set(i,e):i;if(t!==i)return t;k(!1)}var Br={box:function(i,e){arguments.length>2&&we("box");var r=Tt(e);return new Ue(i,Ai(r),r.name,!0,r.equals)},shallowBox:function(i,e){return arguments.length>2&&we("shallowBox"),De("observable.shallowBox","observable.box(value, { deep: false })"),M.box(i,{name:e,deep:!1})},array:function(i,e){arguments.length>2&&we("array");var r=Tt(e);return new Pe(i,Ai(r),r.name)},shallowArray:function(i,e){return arguments.length>2&&we("shallowArray"),De("observable.shallowArray","observable.array(values, { deep: false })"),M.array(i,{name:e,deep:!1})},map:function(i,e){arguments.length>2&&we("map");var r=Tt(e);return new Hi(i,Ai(r),r.name)},shallowMap:function(i,e){return arguments.length>2&&we("shallowMap"),De("observable.shallowMap","observable.map(values, { deep: false })"),M.map(i,{name:e,deep:!1})},set:function(i,e){arguments.length>2&&we("set");var r=Tt(e);return new Bi(i,Ai(r),r.name)},object:function(i,e,r){typeof arguments[1]=="string"&&we("object");var t=Tt(r);return sa({},i,e,t)},shallowObject:function(i,e){return typeof arguments[1]=="string"&&we("shallowObject"),De("observable.shallowObject","observable.object(values, {}, { deep: false })"),M.object(i,{},{name:e,deep:!1})},ref:is,shallow:Io,deep:xn,struct:ko},M=Fo;Object.keys(Br).forEach(function(i){return M[i]=Br[i]});function we(i){k("Expected one or two arguments to observable."+i+". Did you accidentally try to use observable."+i+" as decorator?")}var Oi=es(!1,function(i,e,r,t,n){var s=r.get,o=r.set,a=n[0]||{};ya(i,e,te({get:s,set:o},a))}),Ro=Oi({equals:Lt.structural}),U=function(e,r,t){if(typeof r=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Oi.apply(null,arguments);var n=typeof r=="object"?r:{};return n.get=e,n.set=typeof r=="function"?r:n.set,n.name=n.name||e.name||"",new $e(n)};U.struct=Ro;var O=(function(i){return i[i.NOT_TRACKING=-1]="NOT_TRACKING",i[i.UP_TO_DATE=0]="UP_TO_DATE",i[i.POSSIBLY_STALE=1]="POSSIBLY_STALE",i[i.STALE=2]="STALE",i})(O||{}),Se=(function(i){return i[i.NONE=0]="NONE",i[i.LOG=1]="LOG",i[i.BREAK=2]="BREAK",i})(Se||{}),Ti=(function(){function i(e){this.cause=e}return i})();function Zt(i){return i instanceof Ti}function pn(i){switch(i.dependenciesState){case O.UP_TO_DATE:return!1;case O.NOT_TRACKING:case O.STALE:return!0;case O.POSSIBLY_STALE:{for(var e=kt(),r=i.observing,t=r.length,n=0;n<t;n++){var s=r[n];if(Ri(s)){if(v.disableErrorBoundaries)s.get();else try{s.get()}catch{return Ge(e),!0}if(i.dependenciesState===O.STALE)return Ge(e),!0}}return as(i),Ge(e),!1}}}function Fi(i){var e=i.observers.length>0;v.computationDepth>0&&e&&k(!1),!v.allowStateChanges&&(e||v.enforceActions==="strict")&&k(!1)}function ns(i,e,r){var t=ss(!0);as(i),i.newObserving=new Array(i.observing.length+100),i.unboundDepsCount=0,i.runId=++v.runId;var n=v.trackingDerivation;v.trackingDerivation=i;var s;if(v.disableErrorBoundaries===!0)s=e.call(r);else try{s=e.call(r)}catch(o){s=new Ti(o)}return v.trackingDerivation=n,Vo(i),i.observing.length===0&&void 0,os(t),s}function Vo(i){for(var e=i.observing,r=i.observing=i.newObserving,t=O.UP_TO_DATE,n=0,s=i.unboundDepsCount,o=0;o<s;o++){var a=r[o];a.diffValue===0&&(a.diffValue=1,n!==o&&(r[n]=a),n++),a.dependenciesState>t&&(t=a.dependenciesState)}for(r.length=n,i.newObserving=null,s=e.length;s--;){var a=e[s];a.diffValue===0&&ds(a,i),a.diffValue=0}for(;n--;){var a=r[n];a.diffValue===1&&(a.diffValue=0,$o(a,i))}t!==O.UP_TO_DATE&&(i.dependenciesState=t,i.onBecomeStale())}function hn(i){var e=i.observing;i.observing=[];for(var r=e.length;r--;)ds(e[r],i);i.dependenciesState=O.NOT_TRACKING}function rs(i){var e=kt(),r=i();return Ge(e),r}function kt(){var i=v.trackingDerivation;return v.trackingDerivation=null,i}function Ge(i){v.trackingDerivation=i}function ss(i){var e=v.allowStateReads;return v.allowStateReads=i,e}function os(i){v.allowStateReads=i}function as(i){if(i.dependenciesState!==O.UP_TO_DATE){i.dependenciesState=O.UP_TO_DATE;for(var e=i.observing,r=e.length;r--;)e[r].lowestObserverState=O.UP_TO_DATE}}var Pi=0,Ho=1;function ot(i,e){var r=function(){return Bo(i,e,this,arguments)};return r.isMobxAction=!0,r}function Bo(i,e,r,t){var n=jo(i,r,t);try{return e.apply(r,t)}catch(s){throw n.error=s,s}finally{Go(n)}}function jo(i,e,r){var t=K()&&!!i,n=0;if(t){n=Date.now();var s=r&&r.length||0,o=new Array(s);if(s>0)for(var a=0;a<s;a++)o[a]=r[a];ce({type:"action",name:i,object:e,arguments:o})}var m=kt();Ne();var C=ls(!0),I=ss(!0),ne={prevDerivation:m,prevAllowStateChanges:C,prevAllowStateReads:I,notifySpy:t,startTime:n,actionId:Ho++,parentActionId:Pi};return Pi=ne.actionId,ne}function Go(i){Pi!==i.actionId&&k("invalid action stack. did you forget to finish an action?"),Pi=i.parentActionId,i.error!==void 0&&(v.suppressReactionErrors=!0),cs(i.prevAllowStateChanges),os(i.prevAllowStateReads),Oe(),Ge(i.prevDerivation),i.notifySpy&&de({time:Date.now()-i.startTime}),v.suppressReactionErrors=!1}function ls(i){var e=v.allowStateChanges;return v.allowStateChanges=i,e}function cs(i){v.allowStateChanges=i}var Ue=(function(i){Yr(e,i);function e(r,t,n,s,o){n===void 0&&(n="ObservableValue@"+ie()),s===void 0&&(s=!0),o===void 0&&(o=Lt.default);var a=i.call(this,n)||this;return a.enhancer=t,a.name=n,a.equals=o,a.hasUnreportedChange=!1,a.value=t(r,void 0,n),s&&K()&&lt({type:"create",name:a.name,newValue:""+a.value}),a}return e.prototype.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.prototype.set=function(r){var t=this.value;if(r=this.prepareNewValue(r),r!==v.UNCHANGED){var n=K();n&&ce({type:"update",name:this.name,newValue:r,oldValue:t}),this.setNewValue(r),n&&de()}},e.prototype.prepareNewValue=function(r){if(Fi(this),_e(this)){var t=Ee(this,{object:this,type:"update",newValue:r});if(!t)return v.UNCHANGED;r=t.newValue}return r=this.enhancer(r,this.value,this.name),this.equals(this.value,r)?v.UNCHANGED:r},e.prototype.setNewValue=function(r){var t=this.value;this.value=r,this.reportChanged(),ue(this)&&fe(this,{type:"update",object:this,newValue:r,oldValue:t})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(r){return li(this,r)},e.prototype.observe=function(r,t){return t&&r({object:this,type:"update",newValue:this.value,oldValue:void 0}),ci(this,r)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Jr(this.get())},e})(Ii);Ue.prototype[Qr()]=Ue.prototype.valueOf;var Al=qe("ObservableValue",Ue),$e=(function(){function i(e){this.dependenciesState=O.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=O.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+ie(),this.value=new Ti(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Se.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+ie(),e.set&&(this.setter=ot(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?Lt.structural:Lt.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return i.prototype.onBecomeStale=function(){Ko(this)},i.prototype.onBecomeUnobserved=function(){},i.prototype.onBecomeObserved=function(){},i.prototype.get=function(){this.isComputing&&k("Cycle detected in computation "+this.name+": "+this.derivation),v.inBatch===0&&this.observers.length===0&&!this.keepAlive?pn(this)&&(this.warnAboutUntrackedRead(),Ne(),this.value=this.computeValue(!1),Oe()):(fs(this),pn(this)&&this.trackAndCompute()&&Wo(this));var e=this.value;if(Zt(e))throw e.cause;return e},i.prototype.peek=function(){var e=this.computeValue(!1);if(Zt(e))throw e.cause;return e},i.prototype.set=function(e){if(this.setter){ei(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else ei(!1,!1)},i.prototype.trackAndCompute=function(){K()&&lt({object:this.scope,type:"compute",name:this.name});var e=this.value,r=this.dependenciesState===O.NOT_TRACKING,t=this.computeValue(!0),n=r||Zt(e)||Zt(t)||!this.equals(e,t);return n&&(this.value=t),n},i.prototype.computeValue=function(e){this.isComputing=!0,v.computationDepth++;var r;if(e)r=ns(this,this.derivation,this.scope);else if(v.disableErrorBoundaries===!0)r=this.derivation.call(this.scope);else try{r=this.derivation.call(this.scope)}catch(t){r=new Ti(t)}return v.computationDepth--,this.isComputing=!1,r},i.prototype.suspend=function(){this.keepAlive||(hn(this),this.value=void 0)},i.prototype.observe=function(e,r){var t=this,n=!0,s=void 0;return ai(function(){var o=t.get();if(!n||r){var a=kt();e({type:"update",object:t,newValue:o,oldValue:s}),Ge(a)}n=!1,s=o})},i.prototype.warnAboutUntrackedRead=function(){},i.prototype.toJSON=function(){return this.get()},i.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},i.prototype.valueOf=function(){return Jr(this.get())},i})();$e.prototype[Qr()]=$e.prototype.valueOf;var Ri=qe("ComputedValue",$e);var an=(function(){function i(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return i})(),ln=!0,Uo=!1,v=(function(){var i=fn();return i.__mobxInstanceCount>0&&!i.__mobxGlobals&&(ln=!1),i.__mobxGlobals&&i.__mobxGlobals.version!==new an().version&&(ln=!1),ln?i.__mobxGlobals?(i.__mobxInstanceCount+=1,i.__mobxGlobals.UNCHANGED||(i.__mobxGlobals.UNCHANGED={}),i.__mobxGlobals):(i.__mobxInstanceCount=1,i.__mobxGlobals=new an):(setTimeout(function(){Uo||k("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new an)})();function $o(i,e){var r=i.observers.length;r&&(i.observersIndexes[e.__mapid]=r),i.observers[r]=e,i.lowestObserverState>e.dependenciesState&&(i.lowestObserverState=e.dependenciesState)}function ds(i,e){if(i.observers.length===1)i.observers.length=0,us(i);else{var r=i.observers,t=i.observersIndexes,n=r.pop();if(n!==e){var s=t[e.__mapid]||0;s?t[n.__mapid]=s:delete t[n.__mapid],r[s]=n}delete t[e.__mapid]}}function us(i){i.isPendingUnobservation===!1&&(i.isPendingUnobservation=!0,v.pendingUnobservations.push(i))}function Ne(){v.inBatch++}function Oe(){if(--v.inBatch===0){ms();for(var i=v.pendingUnobservations,e=0;e<i.length;e++){var r=i[e];r.isPendingUnobservation=!1,r.observers.length===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBecomeUnobserved()),r instanceof $e&&r.suspend())}v.pendingUnobservations=[]}}function fs(i){var e=v.trackingDerivation;return e!==null?(e.runId!==i.lastAccessedBy&&(i.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=i,i.isBeingObserved||(i.isBeingObserved=!0,i.onBecomeObserved())),!0):(i.observers.length===0&&v.inBatch>0&&us(i),!1)}function qo(i){if(i.lowestObserverState!==O.STALE){i.lowestObserverState=O.STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.UP_TO_DATE&&(t.isTracing!==Se.NONE&&ps(t,i),t.onBecomeStale()),t.dependenciesState=O.STALE}}}function Wo(i){if(i.lowestObserverState!==O.STALE){i.lowestObserverState=O.STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.POSSIBLY_STALE?t.dependenciesState=O.STALE:t.dependenciesState===O.UP_TO_DATE&&(i.lowestObserverState=O.UP_TO_DATE)}}}function Ko(i){if(i.lowestObserverState===O.UP_TO_DATE){i.lowestObserverState=O.POSSIBLY_STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.UP_TO_DATE&&(t.dependenciesState=O.POSSIBLY_STALE,t.isTracing!==Se.NONE&&ps(t,i),t.onBecomeStale())}}}function ps(i,e){if(console.log("[mobx.trace] '"+i.name+"' is invalidated due to a change in: '"+e.name+"'"),i.isTracing===Se.BREAK){var r=[];hs(oa(i),r,1),new Function(`debugger;
1
+ import{a as kr}from"./chunk-QNJFQVYI.js";import{c as Tr}from"./chunk-JXZCNFW7.js";import{a as Mr}from"./chunk-5KLMS6A4.js";import{a as xr,b as wr,c as Ar,d as Dr,e as Nr,h as Or}from"./chunk-ZKCFO2OA.js";import{b as Lr,c as xi,d as Ir,e as Mi}from"./chunk-FHLACA7V.js";import{a as Pr,d as Jt,g as Ot}from"./chunk-4YGJGZZZ.js";import{m as Si,p as _i}from"./chunk-EWKSX76T.js";import{Ab as Sr,Ba as hr,Ca as mr,Cb as _r,Da as gr,Jb as Ci,Ka as vr,Kb as ee,Lb as Dt,Na as xt,P as rt,Pa as Mt,Qa as br,ab as on,f as tr,lb as yr,nb as wt,ob as At,pb as le,qb as Be,sb as Cr,zb as H}from"./chunk-XLCCZSQL.js";import{a as Ei,c as je,d as zr,h as st,m as Nt}from"./chunk-22EANI6R.js";import{d as Xn}from"./chunk-ORMRCEGT.js";import{$ as Gn,$b as bt,$c as Qn,Ab as ke,Ac as Ve,Ad as Et,B as T,C as Gt,Cb as b,Db as qn,Dc as nt,Eb as f,Fb as Wt,Ga as ze,Gb as Kt,Gd as er,Ha as $n,Hb as et,Hc as be,Hd as Ce,Ib as Me,Jb as J,Jf as dr,Kb as Z,L as pt,La as Ji,Lb as Yt,Ld as ir,Lf as ur,Ma as l,Mb as j,Me as or,Na as Zi,Nb as V,Nc as Qt,Ob as Fe,Pb as h,Pc as He,Qa as ht,Qb as R,Ra as me,Rb as se,Sa as en,Tb as mt,Ub as gt,Ue as ar,Uf as fr,Vb as vt,X as jn,Xa as y,Xb as Re,Ya as ge,Yc as gi,Za as xe,Zb as tt,Zf as pr,_a as tn,_b as it,_c as ye,ab as P,ad as Jn,ba as Un,bb as L,bc as Wn,bd as vi,bf as lr,c as Hn,ca as Q,cb as Ut,cc as hi,da as he,dc as ve,ec as mi,ef as yi,f as Bt,fc as yt,fd as Ct,gg as Er,ha as p,hc as Xt,jb as D,kb as N,kd as St,ma as S,na as _,nb as nn,ne as nr,nf as cr,ob as rn,pb as u,qb as c,qc as sn,rb as d,rc as Kn,sb as g,se as rr,tb as $t,u as Qi,ub as qt,ud as bi,v as jt,va as Qe,vb as pi,ve as sr,w as Bn,wb as Je,xb as Ze,ya as ae,yb as Ie,yd as _t,zb as F,zc as Yn,zd as Zn}from"./chunk-ATP3BFHV.js";import{a as oe,b as Ye,j as Xe}from"./chunk-RTRJ3KFH.js";var ml={prefix:"far",iconName:"bell",icon:[448,512,[128276,61602],"f0f3","M224 0c-13.3 0-24 10.7-24 24l0 9.7C118.6 45.3 56 115.4 56 200l0 14.5c0 37.7-10 74.7-29 107.3L5.1 359.2C1.8 365 0 371.5 0 378.2 0 399.1 16.9 416 37.8 416l372.4 0c20.9 0 37.8-16.9 37.8-37.8 0-6.7-1.8-13.3-5.1-19L421 321.7c-19-32.6-29-69.6-29-107.3l0-14.5c0-84.6-62.6-154.7-144-166.3l0-9.7c0-13.3-10.7-24-24-24zM392.4 368l-336.9 0 12.9-22.1C91.7 306 104 260.6 104 214.5l0-14.5c0-66.3 53.7-120 120-120s120 53.7 120 120l0 14.5c0 46.2 12.3 91.5 35.5 131.4L392.4 368zM156.1 464c9.9 28 36.6 48 67.9 48s58-20 67.9-48l-135.8 0z"]};var go={prefix:"far",iconName:"file-zipper",icon:[384,512,["file-archive"],"f1c6","M64 48l112 0 0 88c0 39.8 32.2 72 72 72l88 0 0 240c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16zM224 67.9l92.1 92.1-68.1 0c-13.3 0-24-10.7-24-24l0-68.1zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-261.5c0-17-6.7-33.3-18.7-45.3L242.7 18.7C230.7 6.7 214.5 0 197.5 0L64 0zM80 104c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0c-13.3 0-24 10.7-24 24zm0 80c0 13.3 10.7 24 24 24l32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0c-13.3 0-24 10.7-24 24zm64 56l-32 0c-17.7 0-32 14.3-32 32l0 48c0 26.5 21.5 48 48 48s48-21.5 48-48l0-48c0-17.7-14.3-32-32-32zm-16 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]},gl=go;var vl={prefix:"far",iconName:"clock",icon:[512,512,[128339,"clock-four"],"f017","M464 256a208 208 0 1 1 -416 0 208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0 256 256 0 1 0 -512 0zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]};var wi={prefix:"far",iconName:"file",icon:[384,512,[128196,128459,61462],"f15b","M176 48L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-240-88 0c-39.8 0-72-32.2-72-72l0-88zM316.1 160L224 67.9 224 136c0 13.3 10.7 24 24 24l68.1 0zM0 64C0 28.7 28.7 0 64 0L197.5 0c17 0 33.3 6.7 45.3 18.7L365.3 141.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64z"]};var bl={prefix:"far",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M166.2-16c-13.3 0-25.3 8.3-30 20.8L120 48 24 48C10.7 48 0 58.7 0 72S10.7 96 24 96l400 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-96 0-16.2-43.2C307.1-7.7 295.2-16 281.8-16L166.2-16zM32 144l0 304c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-304-48 0 0 304c0 8.8-7.2 16-16 16L96 464c-8.8 0-16-7.2-16-16l0-304-48 0zm160 72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 176c0 13.3 10.7 24 24 24s24-10.7 24-24l0-176zm112 0c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 176c0 13.3 10.7 24 24 24s24-10.7 24-24l0-176z"]};var yl={prefix:"far",iconName:"user",icon:[448,512,[128100,62144,62470,"user-alt","user-large"],"f007","M144 128a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zm208 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0zM48 480c0-70.7 57.3-128 128-128l96 0c70.7 0 128 57.3 128 128l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8c0-97.2-78.8-176-176-176l-96 0C78.8 304 0 382.8 0 480l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8z"]};var Cl={prefix:"far",iconName:"file-lines",icon:[384,512,[128441,128462,61686,"file-alt","file-text"],"f15c","M64 48l112 0 0 88c0 39.8 32.2 72 72 72l88 0 0 240c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16zM224 67.9l92.1 92.1-68.1 0c-13.3 0-24-10.7-24-24l0-68.1zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-261.5c0-17-6.7-33.3-18.7-45.3L242.7 18.7C230.7 6.7 214.5 0 197.5 0L64 0zm56 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]};var Sl={prefix:"far",iconName:"comment-dots",icon:[512,512,[128172,62075,"commenting"],"f4ad","M0 240c0 54.4 19.3 104.6 51.9 144.9L3.1 474.3c-2 3.7-3.1 7.9-3.1 12.2 0 14.1 11.4 25.5 25.5 25.5 4 0 7.8-.6 11.5-2.1L153.4 460c31.4 12.9 66.1 20 102.6 20 141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240zM94 407.9c9.3-17.1 7.4-38.1-4.8-53.2-26.1-32.3-41.2-71.9-41.2-114.7 0-103.2 90.2-192 208-192s208 88.8 208 192-90.2 192-208 192c-30.2 0-58.7-5.9-84.3-16.4-11.9-4.9-25.3-4.8-37.1 .3L76 440.9 94 407.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]};var _l={prefix:"far",iconName:"flag",icon:[448,512,[127988,61725],"f024","M48 24C48 10.7 37.3 0 24 0S0 10.7 0 24L0 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-100 80.3-20.1c41.1-10.3 84.6-5.5 122.5 13.4 44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30l0-279.7c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0-35.1-17.6-75.4-22-113.5-12.5L48 52 48 24zm0 77.5l96.6-24.2c27-6.7 55.5-3.6 80.4 8.8 54.9 27.4 118.7 29.7 175 6.8l0 241.8-24.4 9.1c-33.7 12.6-71.2 10.7-103.4-5.4-48.2-24.1-103.3-30.1-155.6-17.1l-68.6 17.2 0-237z"]};var El={prefix:"far",iconName:"window-restore",icon:[576,512,[],"f2d2","M512 80L224 80c-8.8 0-16 7.2-16 16l0 16-48 0 0-16c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64l-48 0 0-48 48 0c8.8 0 16-7.2 16-16l0-192c0-8.8-7.2-16-16-16zM368 288l-320 0 0 128c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16l0-128zM64 160l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64z"]};var Fr={prefix:"far",iconName:"folder-closed",icon:[512,512,[],"e185","M448 400L64 400c-8.8 0-16-7.2-16-16l0-144 416 0 0 144c0 8.8-7.2 16-16 16zm16-208l-416 0 0-96c0-8.8 7.2-16 16-16l138.7 0c3.5 0 6.8 1.1 9.6 3.2L250.7 112c13.8 10.4 30.7 16 48 16L448 128c8.8 0 16 7.2 16 16l0 48zM64 448l384 0c35.3 0 64-28.7 64-64l0-240c0-35.3-28.7-64-64-64L298.7 80c-6.9 0-13.7-2.2-19.2-6.4L241.1 44.8C230 36.5 216.5 32 202.7 32L64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64z"]};var Rr=(()=>{let e=class e{transform(t,n=0,s=void 0){return Mt(t,n,s)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275pipe=tn({name:"pathSlice",type:e,pure:!0});let i=e;return i})();var dn=function(i,e){return dn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n])},dn(i,e)};function Yr(i,e){dn(i,e);function r(){this.constructor=i}i.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var te=function(){return te=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},te.apply(this,arguments)};function Xr(i,e){var r=typeof Symbol=="function"&&i[Symbol.iterator];if(!r)return i;var t=r.call(i),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=t.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return s}function un(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(Xr(arguments[e]));return i}var vo="An invariant failed, however the error is obfuscated because this is an production build.",Ni=[];Object.freeze(Ni);var vn={};Object.freeze(vn);var bo={};function fn(){return typeof window<"u"?window:typeof global<"u"?global:bo}function ie(){return++v.mobxGuid}function k(i){throw ei(!1,i),"X"}function ei(i,e){if(!i)throw new Error("[mobx] "+(e||vo))}var Vr=[];function De(i,e){return!1}function bn(i){var e=!1;return function(){if(!e)return e=!0,i.apply(this,arguments)}}var Hr=function(){};function yo(i){var e=[];return i.forEach(function(r){e.indexOf(r)===-1&&e.push(r)}),e}function yn(i){return i!==null&&typeof i=="object"}function zt(i){if(i===null||typeof i!="object")return!1;var e=Object.getPrototypeOf(i);return e===Object.prototype||e===null}function Co(i){return It(i)||ut(i)?i:Array.isArray(i)?new Map(i):zt(i)?new Map(Object.entries(i)):k("Cannot convert to map from '"+i+"'")}function So(i,e){for(var r=0;r<e.length;r++)ct(i,e[r],i[e[r]])}function ct(i,e,r){Object.defineProperty(i,e,{enumerable:!1,writable:!0,configurable:!0,value:r})}function ri(i,e,r){Object.defineProperty(i,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}function qe(i,e){var r="isMobX"+i;return e.prototype[r]=!0,function(t){return yn(t)&&t[r]===!0}}function _o(i,e){return typeof i=="number"&&typeof e=="number"&&isNaN(i)&&isNaN(e)}function It(i){return fn().Map!==void 0&&i instanceof fn().Map}function si(i){return i instanceof Set}function Pt(i){for(var e=[];;){var r=i.next();if(r.done)break;e.push(r.value)}return e}function Qr(){return typeof Symbol=="function"&&Symbol.toPrimitive||"@@toPrimitive"}function Jr(i){return i===null?null:typeof i=="object"?""+i:i}function Cn(){return typeof Symbol=="function"&&Symbol.iterator||"@@iterator"}function Sn(i,e){ri(i,Cn(),e)}function ti(i){return i[Cn()]=Eo,i}function _n(){return typeof Symbol=="function"&&Symbol.toStringTag||"@@toStringTag"}function Eo(){return this}var Ii=(function(){function i(e){e===void 0&&(e="Atom@"+ie()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=O.NOT_TRACKING}return i.prototype.onBecomeUnobserved=function(){},i.prototype.onBecomeObserved=function(){},i.prototype.reportObserved=function(){return fs(this)},i.prototype.reportChanged=function(){Ne(),qo(this),Oe()},i.prototype.toString=function(){return this.name},i})(),En=qe("Atom",Ii);function xo(i,e,r){e===void 0&&(e=Hr),r===void 0&&(r=Hr);var t=new Ii(i);return ra(t,e),vs(t,r),t}function Zr(i,e){return i===e}function Mo(i,e){return An(i,e)}function wo(i,e){return An(i,e,1)}function Ao(i,e){return _o(i,e)||Zr(i,e)}var Lt={identity:Zr,structural:Mo,default:Ao,shallow:wo},Do={},No={};function Oo(i,e){var r=e?Do:No;return r[i]||(r[i]={configurable:!0,enumerable:e,get:function(){return at(this),this[i]},set:function(t){at(this),this[i]=t}})}function at(i){if(i.__mobxDidRunLazyInitializers!==!0){var e=i.__mobxDecorators;if(e){ct(i,"__mobxDidRunLazyInitializers",!0);for(var r in e){var t=e[r];t.propertyCreator(i,t.prop,t.descriptor,t.decoratorTarget,t.decoratorArguments)}}}}function es(i,e){return function(){var t,n=function(o,a,m,C){if(C===!0)return e(o,a,m,o,t),null;if(!Object.prototype.hasOwnProperty.call(o,"__mobxDecorators")){var I=o.__mobxDecorators;ct(o,"__mobxDecorators",te({},I))}return o.__mobxDecorators[a]={prop:a,propertyCreator:e,descriptor:m,decoratorTarget:o,decoratorArguments:t},Oo(a,i)};return To(arguments)?(t=Ni,n.apply(null,arguments)):(t=Array.prototype.slice.call(arguments),n)}}function To(i){return(i.length===2||i.length===3)&&typeof i[1]=="string"||i.length===4&&i[3]===!0}function oi(i,e,r){return Cs(i)?i:Array.isArray(i)?M.array(i,{name:r}):zt(i)?M.object(i,void 0,{name:r}):It(i)?M.map(i,{name:r}):si(i)?M.set(i,{name:r}):i}function Po(i,e,r){return i==null||ni(i)||Vi(i)||ut(i)||Ft(i)?i:Array.isArray(i)?M.array(i,{name:r,deep:!1}):zt(i)?M.object(i,void 0,{name:r,deep:!1}):It(i)?M.map(i,{name:r,deep:!1}):si(i)?M.set(i,{name:r,deep:!1}):k(!1)}function ii(i){return i}function Lo(i,e,r){return An(i,e)?e:i}function ki(i){var e=es(!0,function(t,n,s,o,a){var m=s?s.initializer?s.initializer.call(t):s.value:void 0;ba(t,n,m,i)}),r=(typeof process<"u"&&process.env,e);return r.enhancer=i,r}var ts={deep:!0,name:void 0,defaultDecorator:void 0},zo={deep:!1,name:void 0,defaultDecorator:void 0};Object.freeze(ts);Object.freeze(zo);function Tt(i){return i==null?ts:typeof i=="string"?{name:i,deep:!0}:i}function Ai(i){return i.defaultDecorator?i.defaultDecorator.enhancer:i.deep===!1?ii:oi}var xn=ki(oi),Io=ki(Po),is=ki(ii),ko=ki(Lo);function Fo(i,e,r){if(typeof arguments[1]=="string")return xn.apply(null,arguments);if(Cs(i))return i;var t=zt(i)?M.object(i,e,r):Array.isArray(i)?M.array(i,e):It(i)?M.map(i,e):si(i)?M.set(i,e):i;if(t!==i)return t;k(!1)}var Br={box:function(i,e){arguments.length>2&&we("box");var r=Tt(e);return new Ue(i,Ai(r),r.name,!0,r.equals)},shallowBox:function(i,e){return arguments.length>2&&we("shallowBox"),De("observable.shallowBox","observable.box(value, { deep: false })"),M.box(i,{name:e,deep:!1})},array:function(i,e){arguments.length>2&&we("array");var r=Tt(e);return new Pe(i,Ai(r),r.name)},shallowArray:function(i,e){return arguments.length>2&&we("shallowArray"),De("observable.shallowArray","observable.array(values, { deep: false })"),M.array(i,{name:e,deep:!1})},map:function(i,e){arguments.length>2&&we("map");var r=Tt(e);return new Hi(i,Ai(r),r.name)},shallowMap:function(i,e){return arguments.length>2&&we("shallowMap"),De("observable.shallowMap","observable.map(values, { deep: false })"),M.map(i,{name:e,deep:!1})},set:function(i,e){arguments.length>2&&we("set");var r=Tt(e);return new Bi(i,Ai(r),r.name)},object:function(i,e,r){typeof arguments[1]=="string"&&we("object");var t=Tt(r);return sa({},i,e,t)},shallowObject:function(i,e){return typeof arguments[1]=="string"&&we("shallowObject"),De("observable.shallowObject","observable.object(values, {}, { deep: false })"),M.object(i,{},{name:e,deep:!1})},ref:is,shallow:Io,deep:xn,struct:ko},M=Fo;Object.keys(Br).forEach(function(i){return M[i]=Br[i]});function we(i){k("Expected one or two arguments to observable."+i+". Did you accidentally try to use observable."+i+" as decorator?")}var Oi=es(!1,function(i,e,r,t,n){var s=r.get,o=r.set,a=n[0]||{};ya(i,e,te({get:s,set:o},a))}),Ro=Oi({equals:Lt.structural}),U=function(e,r,t){if(typeof r=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Oi.apply(null,arguments);var n=typeof r=="object"?r:{};return n.get=e,n.set=typeof r=="function"?r:n.set,n.name=n.name||e.name||"",new $e(n)};U.struct=Ro;var O=(function(i){return i[i.NOT_TRACKING=-1]="NOT_TRACKING",i[i.UP_TO_DATE=0]="UP_TO_DATE",i[i.POSSIBLY_STALE=1]="POSSIBLY_STALE",i[i.STALE=2]="STALE",i})(O||{}),Se=(function(i){return i[i.NONE=0]="NONE",i[i.LOG=1]="LOG",i[i.BREAK=2]="BREAK",i})(Se||{}),Ti=(function(){function i(e){this.cause=e}return i})();function Zt(i){return i instanceof Ti}function pn(i){switch(i.dependenciesState){case O.UP_TO_DATE:return!1;case O.NOT_TRACKING:case O.STALE:return!0;case O.POSSIBLY_STALE:{for(var e=kt(),r=i.observing,t=r.length,n=0;n<t;n++){var s=r[n];if(Ri(s)){if(v.disableErrorBoundaries)s.get();else try{s.get()}catch{return Ge(e),!0}if(i.dependenciesState===O.STALE)return Ge(e),!0}}return as(i),Ge(e),!1}}}function Fi(i){var e=i.observers.length>0;v.computationDepth>0&&e&&k(!1),!v.allowStateChanges&&(e||v.enforceActions==="strict")&&k(!1)}function ns(i,e,r){var t=ss(!0);as(i),i.newObserving=new Array(i.observing.length+100),i.unboundDepsCount=0,i.runId=++v.runId;var n=v.trackingDerivation;v.trackingDerivation=i;var s;if(v.disableErrorBoundaries===!0)s=e.call(r);else try{s=e.call(r)}catch(o){s=new Ti(o)}return v.trackingDerivation=n,Vo(i),i.observing.length===0&&void 0,os(t),s}function Vo(i){for(var e=i.observing,r=i.observing=i.newObserving,t=O.UP_TO_DATE,n=0,s=i.unboundDepsCount,o=0;o<s;o++){var a=r[o];a.diffValue===0&&(a.diffValue=1,n!==o&&(r[n]=a),n++),a.dependenciesState>t&&(t=a.dependenciesState)}for(r.length=n,i.newObserving=null,s=e.length;s--;){var a=e[s];a.diffValue===0&&ds(a,i),a.diffValue=0}for(;n--;){var a=r[n];a.diffValue===1&&(a.diffValue=0,$o(a,i))}t!==O.UP_TO_DATE&&(i.dependenciesState=t,i.onBecomeStale())}function hn(i){var e=i.observing;i.observing=[];for(var r=e.length;r--;)ds(e[r],i);i.dependenciesState=O.NOT_TRACKING}function rs(i){var e=kt(),r=i();return Ge(e),r}function kt(){var i=v.trackingDerivation;return v.trackingDerivation=null,i}function Ge(i){v.trackingDerivation=i}function ss(i){var e=v.allowStateReads;return v.allowStateReads=i,e}function os(i){v.allowStateReads=i}function as(i){if(i.dependenciesState!==O.UP_TO_DATE){i.dependenciesState=O.UP_TO_DATE;for(var e=i.observing,r=e.length;r--;)e[r].lowestObserverState=O.UP_TO_DATE}}var Pi=0,Ho=1;function ot(i,e){var r=function(){return Bo(i,e,this,arguments)};return r.isMobxAction=!0,r}function Bo(i,e,r,t){var n=jo(i,r,t);try{return e.apply(r,t)}catch(s){throw n.error=s,s}finally{Go(n)}}function jo(i,e,r){var t=K()&&!!i,n=0;if(t){n=Date.now();var s=r&&r.length||0,o=new Array(s);if(s>0)for(var a=0;a<s;a++)o[a]=r[a];ce({type:"action",name:i,object:e,arguments:o})}var m=kt();Ne();var C=ls(!0),I=ss(!0),ne={prevDerivation:m,prevAllowStateChanges:C,prevAllowStateReads:I,notifySpy:t,startTime:n,actionId:Ho++,parentActionId:Pi};return Pi=ne.actionId,ne}function Go(i){Pi!==i.actionId&&k("invalid action stack. did you forget to finish an action?"),Pi=i.parentActionId,i.error!==void 0&&(v.suppressReactionErrors=!0),cs(i.prevAllowStateChanges),os(i.prevAllowStateReads),Oe(),Ge(i.prevDerivation),i.notifySpy&&de({time:Date.now()-i.startTime}),v.suppressReactionErrors=!1}function ls(i){var e=v.allowStateChanges;return v.allowStateChanges=i,e}function cs(i){v.allowStateChanges=i}var Ue=(function(i){Yr(e,i);function e(r,t,n,s,o){n===void 0&&(n="ObservableValue@"+ie()),s===void 0&&(s=!0),o===void 0&&(o=Lt.default);var a=i.call(this,n)||this;return a.enhancer=t,a.name=n,a.equals=o,a.hasUnreportedChange=!1,a.value=t(r,void 0,n),s&&K()&&lt({type:"create",name:a.name,newValue:""+a.value}),a}return e.prototype.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.prototype.set=function(r){var t=this.value;if(r=this.prepareNewValue(r),r!==v.UNCHANGED){var n=K();n&&ce({type:"update",name:this.name,newValue:r,oldValue:t}),this.setNewValue(r),n&&de()}},e.prototype.prepareNewValue=function(r){if(Fi(this),_e(this)){var t=Ee(this,{object:this,type:"update",newValue:r});if(!t)return v.UNCHANGED;r=t.newValue}return r=this.enhancer(r,this.value,this.name),this.equals(this.value,r)?v.UNCHANGED:r},e.prototype.setNewValue=function(r){var t=this.value;this.value=r,this.reportChanged(),ue(this)&&fe(this,{type:"update",object:this,newValue:r,oldValue:t})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(r){return li(this,r)},e.prototype.observe=function(r,t){return t&&r({object:this,type:"update",newValue:this.value,oldValue:void 0}),ci(this,r)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Jr(this.get())},e})(Ii);Ue.prototype[Qr()]=Ue.prototype.valueOf;var Al=qe("ObservableValue",Ue),$e=(function(){function i(e){this.dependenciesState=O.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=O.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+ie(),this.value=new Ti(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Se.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+ie(),e.set&&(this.setter=ot(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?Lt.structural:Lt.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return i.prototype.onBecomeStale=function(){Ko(this)},i.prototype.onBecomeUnobserved=function(){},i.prototype.onBecomeObserved=function(){},i.prototype.get=function(){this.isComputing&&k("Cycle detected in computation "+this.name+": "+this.derivation),v.inBatch===0&&this.observers.length===0&&!this.keepAlive?pn(this)&&(this.warnAboutUntrackedRead(),Ne(),this.value=this.computeValue(!1),Oe()):(fs(this),pn(this)&&this.trackAndCompute()&&Wo(this));var e=this.value;if(Zt(e))throw e.cause;return e},i.prototype.peek=function(){var e=this.computeValue(!1);if(Zt(e))throw e.cause;return e},i.prototype.set=function(e){if(this.setter){ei(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else ei(!1,!1)},i.prototype.trackAndCompute=function(){K()&&lt({object:this.scope,type:"compute",name:this.name});var e=this.value,r=this.dependenciesState===O.NOT_TRACKING,t=this.computeValue(!0),n=r||Zt(e)||Zt(t)||!this.equals(e,t);return n&&(this.value=t),n},i.prototype.computeValue=function(e){this.isComputing=!0,v.computationDepth++;var r;if(e)r=ns(this,this.derivation,this.scope);else if(v.disableErrorBoundaries===!0)r=this.derivation.call(this.scope);else try{r=this.derivation.call(this.scope)}catch(t){r=new Ti(t)}return v.computationDepth--,this.isComputing=!1,r},i.prototype.suspend=function(){this.keepAlive||(hn(this),this.value=void 0)},i.prototype.observe=function(e,r){var t=this,n=!0,s=void 0;return ai(function(){var o=t.get();if(!n||r){var a=kt();e({type:"update",object:t,newValue:o,oldValue:s}),Ge(a)}n=!1,s=o})},i.prototype.warnAboutUntrackedRead=function(){},i.prototype.toJSON=function(){return this.get()},i.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},i.prototype.valueOf=function(){return Jr(this.get())},i})();$e.prototype[Qr()]=$e.prototype.valueOf;var Ri=qe("ComputedValue",$e);var an=(function(){function i(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return i})(),ln=!0,Uo=!1,v=(function(){var i=fn();return i.__mobxInstanceCount>0&&!i.__mobxGlobals&&(ln=!1),i.__mobxGlobals&&i.__mobxGlobals.version!==new an().version&&(ln=!1),ln?i.__mobxGlobals?(i.__mobxInstanceCount+=1,i.__mobxGlobals.UNCHANGED||(i.__mobxGlobals.UNCHANGED={}),i.__mobxGlobals):(i.__mobxInstanceCount=1,i.__mobxGlobals=new an):(setTimeout(function(){Uo||k("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new an)})();function $o(i,e){var r=i.observers.length;r&&(i.observersIndexes[e.__mapid]=r),i.observers[r]=e,i.lowestObserverState>e.dependenciesState&&(i.lowestObserverState=e.dependenciesState)}function ds(i,e){if(i.observers.length===1)i.observers.length=0,us(i);else{var r=i.observers,t=i.observersIndexes,n=r.pop();if(n!==e){var s=t[e.__mapid]||0;s?t[n.__mapid]=s:delete t[n.__mapid],r[s]=n}delete t[e.__mapid]}}function us(i){i.isPendingUnobservation===!1&&(i.isPendingUnobservation=!0,v.pendingUnobservations.push(i))}function Ne(){v.inBatch++}function Oe(){if(--v.inBatch===0){ms();for(var i=v.pendingUnobservations,e=0;e<i.length;e++){var r=i[e];r.isPendingUnobservation=!1,r.observers.length===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBecomeUnobserved()),r instanceof $e&&r.suspend())}v.pendingUnobservations=[]}}function fs(i){var e=v.trackingDerivation;return e!==null?(e.runId!==i.lastAccessedBy&&(i.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=i,i.isBeingObserved||(i.isBeingObserved=!0,i.onBecomeObserved())),!0):(i.observers.length===0&&v.inBatch>0&&us(i),!1)}function qo(i){if(i.lowestObserverState!==O.STALE){i.lowestObserverState=O.STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.UP_TO_DATE&&(t.isTracing!==Se.NONE&&ps(t,i),t.onBecomeStale()),t.dependenciesState=O.STALE}}}function Wo(i){if(i.lowestObserverState!==O.STALE){i.lowestObserverState=O.STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.POSSIBLY_STALE?t.dependenciesState=O.STALE:t.dependenciesState===O.UP_TO_DATE&&(i.lowestObserverState=O.UP_TO_DATE)}}}function Ko(i){if(i.lowestObserverState===O.UP_TO_DATE){i.lowestObserverState=O.POSSIBLY_STALE;for(var e=i.observers,r=e.length;r--;){var t=e[r];t.dependenciesState===O.UP_TO_DATE&&(t.dependenciesState=O.POSSIBLY_STALE,t.isTracing!==Se.NONE&&ps(t,i),t.onBecomeStale())}}}function ps(i,e){if(console.log("[mobx.trace] '"+i.name+"' is invalidated due to a change in: '"+e.name+"'"),i.isTracing===Se.BREAK){var r=[];hs(oa(i),r,1),new Function(`debugger;
2
2
  /*
3
3
  Tracing '`+i.name+`'
4
4
 
@@ -1 +1 @@
1
- import{v as C,w}from"./chunk-2MTM6SWN.js";import{Ad as x,Eb as n,Fe as y,Ga as p,Gd as _,Mb as m,Xa as u,Yb as s,_c as g,dc as h,fc as f,ha as d,jb as c,kb as l,pb as o,sb as a,se as U,ve as v}from"./chunk-ATP3BFHV.js";function P(i,e){if(i&1&&a(0,"img",0),i&2){let t=n(2);o("tooltip",s("",t.user.name," (",t.user.description,")"))("height",t.height)("width",t.width)("src",t.user.avatarUrl,p)("placement",t.tooltipPlacement)("container",t.container)}}function T(i,e){if(i&1&&(a(0,"fa-icon",2),h(1,"translate")),i&2){let t=n(2);m("min-width",t.width,"px")("min-height",t.height,"px")("font-size",t.fontSize,"px"),o("tooltip",s("",t.user.name," (",f(1,12,t.user.type,t.locale.language),")"))("icon",t.icons.faUsers)("placement",t.tooltipPlacement)("container",t.container)}}function b(i,e){if(i&1&&c(0,P,1,8,"img",0)(1,T,2,15,"fa-icon",1),i&2){let t=n();l(t.user.isUser?0:1)}}function I(i,e){if(i&1&&a(0,"img",0),i&2){let t=n(2);o("tooltip",s("",t.user.fullName," (",t.user.email,")"))("height",t.height)("width",t.width)("src",t.user.avatarUrl,p)("placement",t.tooltipPlacement)("container",t.container)}}function S(i,e){if(i&1&&(a(0,"fa-icon",4),h(1,"translate")),i&2){let t=n(2);m("min-width",t.width,"px")("min-height",t.height,"px")("font-size",t.fontSize,"px"),o("icon",t.unknownUserAsInfo?t.icons.faLightbulb:t.icons.faUserShield)("tooltip",f(1,10,t.unknownUserAsInfo?"Information":"Administrator",t.locale.language))("placement",t.tooltipPlacement)("container",t.container)}}function M(i,e){if(i&1&&c(0,I,1,8,"img",0)(1,S,2,13,"fa-icon",3),i&2){let t=n();l(t.user.login?0:1)}}var G=(()=>{let e=class e{constructor(){this.isMember=!1,this.unknownUserAsInfo=!1,this.height=30,this.width=30,this.fontSize=16,this.tooltipPlacement="auto",this.container=null,this.locale=d(x),this.icons={faUsers:U,faUserShield:v,faLightbulb:y}}ngOnInit(){this.height<28&&(this.fontSize=13)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=u({type:e,selectors:[["app-user-avatar"]],inputs:{user:"user",isMember:"isMember",unknownUserAsInfo:"unknownUserAsInfo",height:"height",width:"width",fontSize:"fontSize",tooltipPlacement:"tooltipPlacement",container:"container"},decls:2,vars:1,consts:[["alt","",1,"avatar-base-img","cursor-pointer","me-1",3,"height","width","src","tooltip","placement","container"],[1,"circle-primary-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container","min-width","min-height","font-size"],[1,"circle-primary-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container"],[1,"circle-gray-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container","min-width","min-height","font-size"],[1,"circle-gray-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container"]],template:function(r,z){r&1&&c(0,b,2,1)(1,M,2,1),r&2&&l(z.isMember?0:1)},dependencies:[w,C,g,_],encapsulation:2,changeDetection:0});let i=e;return i})();export{G as a};
1
+ import{v as C,w}from"./chunk-XLCCZSQL.js";import{Ad as x,Eb as n,Fe as y,Ga as p,Gd as _,Mb as m,Xa as u,Yb as s,_c as g,dc as h,fc as f,ha as d,jb as c,kb as l,pb as o,sb as a,se as U,ve as v}from"./chunk-ATP3BFHV.js";function P(i,e){if(i&1&&a(0,"img",0),i&2){let t=n(2);o("tooltip",s("",t.user.name," (",t.user.description,")"))("height",t.height)("width",t.width)("src",t.user.avatarUrl,p)("placement",t.tooltipPlacement)("container",t.container)}}function T(i,e){if(i&1&&(a(0,"fa-icon",2),h(1,"translate")),i&2){let t=n(2);m("min-width",t.width,"px")("min-height",t.height,"px")("font-size",t.fontSize,"px"),o("tooltip",s("",t.user.name," (",f(1,12,t.user.type,t.locale.language),")"))("icon",t.icons.faUsers)("placement",t.tooltipPlacement)("container",t.container)}}function b(i,e){if(i&1&&c(0,P,1,8,"img",0)(1,T,2,15,"fa-icon",1),i&2){let t=n();l(t.user.isUser?0:1)}}function I(i,e){if(i&1&&a(0,"img",0),i&2){let t=n(2);o("tooltip",s("",t.user.fullName," (",t.user.email,")"))("height",t.height)("width",t.width)("src",t.user.avatarUrl,p)("placement",t.tooltipPlacement)("container",t.container)}}function S(i,e){if(i&1&&(a(0,"fa-icon",4),h(1,"translate")),i&2){let t=n(2);m("min-width",t.width,"px")("min-height",t.height,"px")("font-size",t.fontSize,"px"),o("icon",t.unknownUserAsInfo?t.icons.faLightbulb:t.icons.faUserShield)("tooltip",f(1,10,t.unknownUserAsInfo?"Information":"Administrator",t.locale.language))("placement",t.tooltipPlacement)("container",t.container)}}function M(i,e){if(i&1&&c(0,I,1,8,"img",0)(1,S,2,13,"fa-icon",3),i&2){let t=n();l(t.user.login?0:1)}}var G=(()=>{let e=class e{constructor(){this.isMember=!1,this.unknownUserAsInfo=!1,this.height=30,this.width=30,this.fontSize=16,this.tooltipPlacement="auto",this.container=null,this.locale=d(x),this.icons={faUsers:U,faUserShield:v,faLightbulb:y}}ngOnInit(){this.height<28&&(this.fontSize=13)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=u({type:e,selectors:[["app-user-avatar"]],inputs:{user:"user",isMember:"isMember",unknownUserAsInfo:"unknownUserAsInfo",height:"height",width:"width",fontSize:"fontSize",tooltipPlacement:"tooltipPlacement",container:"container"},decls:2,vars:1,consts:[["alt","",1,"avatar-base-img","cursor-pointer","me-1",3,"height","width","src","tooltip","placement","container"],[1,"circle-primary-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container","min-width","min-height","font-size"],[1,"circle-primary-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container"],[1,"circle-gray-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container","min-width","min-height","font-size"],[1,"circle-gray-icon","cursor-pointer","me-1",3,"icon","tooltip","placement","container"]],template:function(r,z){r&1&&c(0,b,2,1)(1,M,2,1),r&2&&l(z.isMember?0:1)},dependencies:[w,C,g,_],encapsulation:2,changeDetection:0});let i=e;return i})();export{G as a};
@@ -1 +1 @@
1
- import{e as N}from"./chunk-2I4CUFUA.js";import"./chunk-7FUM3JGM.js";import"./chunk-IPAC4VAF.js";import"./chunk-Y7EH7G5K.js";import"./chunk-JUNZFADM.js";import"./chunk-2MTM6SWN.js";import{k as F,l as I}from"./chunk-22EANI6R.js";import{b as _,e as P}from"./chunk-ORMRCEGT.js";import{Ad as T,Cb as p,Ga as h,Gd as E,Hd as U,Ma as i,Pb as g,Tb as v,Ub as k,Vb as y,Xa as f,_c as S,bd as L,ce as D,dc as b,fc as w,fd as C,ha as l,ie as R,kd as A,pb as n,qb as t,rb as o,sb as a,yd as M}from"./chunk-ATP3BFHV.js";import"./chunk-RTRJ3KFH.js";var Q=(()=>{let r=class r{constructor(){this.locale=l(T),this.logoUrl=F,this.linkProtected=I,this.icons={faKey:D,faSignInAlt:R},this.password="",this.activatedRoute=l(_),this.linksService=l(N),this.activatedRoute.params.subscribe(c=>this.uuid=c.uuid)}validPassword(){this.password&&this.linksService.linkAuthentication(this.uuid,this.password).subscribe(()=>this.password="")}};r.\u0275fac=function(s){return new(s||r)},r.\u0275cmp=f({type:r,selectors:[["app-public-link-auth"]],decls:18,vars:10,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],["alt","","height","96",1,"cursor-pointer",3,"click","src"],[1,"d-flex","mt-2","ms-auto","me-auto",2,"width","250px"],[1,"input-group"],[1,"input-group-text","bg-gray-light"],[3,"icon"],["autocomplete","off","type","password",1,"form-control","border-0",3,"ngModelChange","keyup.enter","ngModel","placeholder"],["type","button",1,"btn","btn-default","btn-custom","border-0",3,"click","disabled"],[1,"error-text","no-select"],[1,"hr"],["l10nTranslate","",1,"solve"]],template:function(s,e){s&1&&(t(0,"div",0)(1,"div",1)(2,"a",2),a(3,"img",3),o()(),t(4,"img",4),p("click",function(){return e.validPassword()}),o(),t(5,"div",5)(6,"div",6)(7,"span",7),a(8,"fa-icon",8),o(),t(9,"input",9),b(10,"translate"),y("ngModelChange",function(m){return k(e.password,m)||(e.password=m),m}),p("keyup.enter",function(){return e.validPassword()}),o(),t(11,"button",10),p("click",function(){return e.validPassword()}),a(12,"fa-icon",8),o()()(),t(13,"div",11),a(14,"span",12),t(15,"div")(16,"span",13),g(17,"This share is protected by a password"),o()()()()),s&2&&(i(3),n("src",e.logoUrl,h),i(),n("src",e.linkProtected,h),i(4),n("icon",e.icons.faKey),i(),v("ngModel",e.password),n("placeholder",w(10,7,"Password",e.locale.language)),i(2),n("disabled",!(e.password!=null&&e.password.length)),i(),n("icon",e.icons.faSignInAlt))},dependencies:[P,M,L,C,A,S,U,E],encapsulation:2});let d=r;return d})();export{Q as PublicLinkAuthComponent};
1
+ import{e as N}from"./chunk-FHLACA7V.js";import"./chunk-4YGJGZZZ.js";import"./chunk-IPAC4VAF.js";import"./chunk-3GFGJYMK.js";import"./chunk-EWKSX76T.js";import"./chunk-XLCCZSQL.js";import{k as F,l as I}from"./chunk-22EANI6R.js";import{b as _,e as P}from"./chunk-ORMRCEGT.js";import{Ad as T,Cb as p,Ga as h,Gd as E,Hd as U,Ma as i,Pb as g,Tb as v,Ub as k,Vb as y,Xa as f,_c as S,bd as L,ce as D,dc as b,fc as w,fd as C,ha as l,ie as R,kd as A,pb as n,qb as t,rb as o,sb as a,yd as M}from"./chunk-ATP3BFHV.js";import"./chunk-RTRJ3KFH.js";var Q=(()=>{let r=class r{constructor(){this.locale=l(T),this.logoUrl=F,this.linkProtected=I,this.icons={faKey:D,faSignInAlt:R},this.password="",this.activatedRoute=l(_),this.linksService=l(N),this.activatedRoute.params.subscribe(c=>this.uuid=c.uuid)}validPassword(){this.password&&this.linksService.linkAuthentication(this.uuid,this.password).subscribe(()=>this.password="")}};r.\u0275fac=function(s){return new(s||r)},r.\u0275cmp=f({type:r,selectors:[["app-public-link-auth"]],decls:18,vars:10,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],["alt","","height","96",1,"cursor-pointer",3,"click","src"],[1,"d-flex","mt-2","ms-auto","me-auto",2,"width","250px"],[1,"input-group"],[1,"input-group-text","bg-gray-light"],[3,"icon"],["autocomplete","off","type","password",1,"form-control","border-0",3,"ngModelChange","keyup.enter","ngModel","placeholder"],["type","button",1,"btn","btn-default","btn-custom","border-0",3,"click","disabled"],[1,"error-text","no-select"],[1,"hr"],["l10nTranslate","",1,"solve"]],template:function(s,e){s&1&&(t(0,"div",0)(1,"div",1)(2,"a",2),a(3,"img",3),o()(),t(4,"img",4),p("click",function(){return e.validPassword()}),o(),t(5,"div",5)(6,"div",6)(7,"span",7),a(8,"fa-icon",8),o(),t(9,"input",9),b(10,"translate"),y("ngModelChange",function(m){return k(e.password,m)||(e.password=m),m}),p("keyup.enter",function(){return e.validPassword()}),o(),t(11,"button",10),p("click",function(){return e.validPassword()}),a(12,"fa-icon",8),o()()(),t(13,"div",11),a(14,"span",12),t(15,"div")(16,"span",13),g(17,"This share is protected by a password"),o()()()()),s&2&&(i(3),n("src",e.logoUrl,h),i(),n("src",e.linkProtected,h),i(4),n("icon",e.icons.faKey),i(),v("ngModel",e.password),n("placeholder",w(10,7,"Password",e.locale.language)),i(2),n("disabled",!(e.password!=null&&e.password.length)),i(),n("icon",e.icons.faSignInAlt))},dependencies:[P,M,L,C,A,S,U,E],encapsulation:2});let d=r;return d})();export{Q as PublicLinkAuthComponent};
@@ -1 +1 @@
1
- import{k as F,m as y,s as b,t as _}from"./chunk-2MTM6SWN.js";import{$b as H,Cb as w,E as D,Fb as N,Gb as L,Na as k,Nb as C,Qa as p,Ra as o,Sa as g,Xa as I,Ya as O,Za as u,Zb as E,bb as f,ca as m,da as M,ib as A,pb as S,qb as R,qc as v,rb as j,xc as P,ya as l}from"./chunk-ATP3BFHV.js";var U=["*"],V=s=>({dropdown:s}),B=(()=>{let t=class t{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})(),c=(()=>{let t=class t{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new f,this.isDisabledChange=new f,this.toggleClick=new f,this.counts=0,this.dropdownMenu=new Promise(e=>{this.resolveDropdownMenu=e})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"platform"});let s=t;return s})(),K="220ms cubic-bezier(0, 0, 0.2, 1)",T=[y({height:0,overflow:"hidden"}),F(K,y({height:"*",overflow:"hidden"}))],q=(()=>{let t=class t{get direction(){return this._state.direction}constructor(e,i,n,d,a){this._state=e,this.cd=i,this._renderer=n,this._element=d,this.isOpen=!1,this._factoryDropDownAnimation=a.build(T),this._subscription=e.isOpenChange.subscribe(h=>{this.isOpen=h;let r=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),r&&(this._renderer.addClass(r,"show"),(r.classList.contains("dropdown-menu-right")||r.classList.contains("dropdown-menu-end"))&&(this._renderer.setStyle(r,"left","auto"),this._renderer.setStyle(r,"right","0")),this.direction==="up"&&(this._renderer.setStyle(r,"top","auto"),this._renderer.setStyle(r,"transform","translateY(-101%)"))),r&&this._state.isAnimated&&this._factoryDropDownAnimation.create(r).play(),this.cd.markForCheck(),this.cd.detectChanges()})}_contains(e){return this._element.nativeElement.contains(e)}ngOnDestroy(){this._subscription.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(c),o(v),o(p),o(l),o(b))},t.\u0275cmp=I({type:t,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:U,decls:2,vars:9,consts:[[3,"ngClass"]],template:function(i,n){i&1&&(N(),R(0,"div",0),L(1),j()),i&2&&(C("dropup",n.direction==="up")("show",n.isOpen)("open",n.isOpen),S("ngClass",H(7,V,n.direction==="down")))},dependencies:[P],encapsulation:2,changeDetection:0});let s=t;return s})(),Y=(()=>{let t=class t{set autoClose(e){this._state.autoClose=e}get autoClose(){return this._state.autoClose}set isAnimated(e){this._state.isAnimated=e}get isAnimated(){return this._state.isAnimated}set insideClick(e){this._state.insideClick=e}get insideClick(){return this._state.insideClick}set isDisabled(e){this._isDisabled=e,this._state.isDisabledChange.emit(e),e&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(e){e?this.show():this.hide()}get _showInline(){return!this.container}constructor(e,i,n,d,a,h,r){this._elementRef=e,this._renderer=i,this._viewContainerRef=n,this._cis=d,this._state=a,this._config=h,this.dropup=!1,this._isInlineOpen=!1,this._isDisabled=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._state.stopOnClickPropagation=this._config.stopOnClickPropagation,this._factoryDropDownAnimation=r.build(T),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:c,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(e=>this.toggle(e))),this._subscriptions.push(this._state.isDisabledChange.pipe(D(e=>e)).subscribe(()=>this.hide())))}show(){if(!(this.isOpen||this.isDisabled)){if(this._showInline){this._inlinedMenu||this._state.dropdownMenu.then(e=>{this._dropdown.attachInline(e.viewContainer,e.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._inlinedMenu&&this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),this.playAnimation();return}this._state.dropdownMenu.then(e=>{let i=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=i?"up":"down";let n=this.placement||(i?"top start":"bottom start");this._dropdown.attach(q).to(this.container).position({attachment:n}).show({content:e.templateRef,placement:n}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){this.isOpen&&(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(e){return this.isOpen||!e?this.hide():this.show()}_contains(e){return this._elementRef.nativeElement.contains(e.target)||this._dropdown.instance&&this._dropdown.instance._contains(e.target)}navigationClick(e){let i=this._elementRef.nativeElement.querySelector(".dropdown-menu");if(!i)return;let n=this._elementRef.nativeElement.ownerDocument.activeElement,d=i.querySelectorAll(".dropdown-item");switch(e.keyCode){case 38:this._state.counts>0&&d[--this._state.counts].focus();break;case 40:this._state.counts+1<d.length&&(n.classList!==d[this._state.counts].classList?d[this._state.counts].focus():d[++this._state.counts].focus());break;default:}e.preventDefault()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles()}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._inlinedMenu&&this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){let e=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right")||this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-end");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",e?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",e?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}};t.\u0275fac=function(i){return new(i||t)(o(l),o(p),o(g),o(_),o(c),o(B),o(b))},t.\u0275dir=u({type:t,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(i,n){i&1&&w("keydown.arrowDown",function(a){return n.navigationClick(a)})("keydown.arrowUp",function(a){return n.navigationClick(a)}),i&2&&C("dropup",n.dropup)("open",n.isOpen)("show",n.isOpen)},inputs:{placement:"placement",triggers:"triggers",container:"container",dropup:"dropup",autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",onShown:"onShown",onHidden:"onHidden"},exportAs:["bs-dropdown"],features:[E([c,_,B])]});let s=t;return s})(),ae=(()=>{let t=class t{constructor(e,i,n){e.resolveDropdownMenu({templateRef:n,viewContainer:i})}};t.\u0275fac=function(i){return new(i||t)(o(c),o(g),o(k))},t.\u0275dir=u({type:t,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]});let s=t;return s})(),he=(()=>{let t=class t{constructor(e,i,n,d,a){this._changeDetectorRef=e,this._dropdown=i,this._element=n,this._renderer=d,this._state=a,this.isOpen=!1,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(h=>{this.isOpen=h,h?(this._documentClickListener=this._renderer.listen("document","click",r=>{this._state.autoClose&&r.button!==2&&!this._element.nativeElement.contains(r.target)&&!(this._state.insideClick&&this._dropdown._contains(r))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(h=>this.isDisabled=h||void 0))}onClick(e){this._state.stopOnClickPropagation&&e.stopPropagation(),!this.isDisabled&&this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(let e of this._subscriptions)e.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(v),o(Y),o(l),o(p),o(c))},t.\u0275dir=u({type:t,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(i,n){i&1&&w("click",function(a){return n.onClick(a)}),i&2&&A("aria-haspopup",!0)("disabled",n.isDisabled)("aria-expanded",n.isOpen)},exportAs:["bs-dropdown-toggle"]});let s=t;return s})(),ce=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=O({type:t}),t.\u0275inj=M({});let s=t;return s})();export{Y as a,ae as b,he as c,ce as d};
1
+ import{k as F,m as y,s as b,t as _}from"./chunk-XLCCZSQL.js";import{$b as H,Cb as w,E as D,Fb as N,Gb as L,Na as k,Nb as C,Qa as p,Ra as o,Sa as g,Xa as I,Ya as O,Za as u,Zb as E,bb as f,ca as m,da as M,ib as A,pb as S,qb as R,qc as v,rb as j,xc as P,ya as l}from"./chunk-ATP3BFHV.js";var U=["*"],V=s=>({dropdown:s}),B=(()=>{let t=class t{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})(),c=(()=>{let t=class t{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new f,this.isDisabledChange=new f,this.toggleClick=new f,this.counts=0,this.dropdownMenu=new Promise(e=>{this.resolveDropdownMenu=e})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"platform"});let s=t;return s})(),K="220ms cubic-bezier(0, 0, 0.2, 1)",T=[y({height:0,overflow:"hidden"}),F(K,y({height:"*",overflow:"hidden"}))],q=(()=>{let t=class t{get direction(){return this._state.direction}constructor(e,i,n,d,a){this._state=e,this.cd=i,this._renderer=n,this._element=d,this.isOpen=!1,this._factoryDropDownAnimation=a.build(T),this._subscription=e.isOpenChange.subscribe(h=>{this.isOpen=h;let r=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),r&&(this._renderer.addClass(r,"show"),(r.classList.contains("dropdown-menu-right")||r.classList.contains("dropdown-menu-end"))&&(this._renderer.setStyle(r,"left","auto"),this._renderer.setStyle(r,"right","0")),this.direction==="up"&&(this._renderer.setStyle(r,"top","auto"),this._renderer.setStyle(r,"transform","translateY(-101%)"))),r&&this._state.isAnimated&&this._factoryDropDownAnimation.create(r).play(),this.cd.markForCheck(),this.cd.detectChanges()})}_contains(e){return this._element.nativeElement.contains(e)}ngOnDestroy(){this._subscription.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(c),o(v),o(p),o(l),o(b))},t.\u0275cmp=I({type:t,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:U,decls:2,vars:9,consts:[[3,"ngClass"]],template:function(i,n){i&1&&(N(),R(0,"div",0),L(1),j()),i&2&&(C("dropup",n.direction==="up")("show",n.isOpen)("open",n.isOpen),S("ngClass",H(7,V,n.direction==="down")))},dependencies:[P],encapsulation:2,changeDetection:0});let s=t;return s})(),Y=(()=>{let t=class t{set autoClose(e){this._state.autoClose=e}get autoClose(){return this._state.autoClose}set isAnimated(e){this._state.isAnimated=e}get isAnimated(){return this._state.isAnimated}set insideClick(e){this._state.insideClick=e}get insideClick(){return this._state.insideClick}set isDisabled(e){this._isDisabled=e,this._state.isDisabledChange.emit(e),e&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(e){e?this.show():this.hide()}get _showInline(){return!this.container}constructor(e,i,n,d,a,h,r){this._elementRef=e,this._renderer=i,this._viewContainerRef=n,this._cis=d,this._state=a,this._config=h,this.dropup=!1,this._isInlineOpen=!1,this._isDisabled=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._state.stopOnClickPropagation=this._config.stopOnClickPropagation,this._factoryDropDownAnimation=r.build(T),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:c,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(e=>this.toggle(e))),this._subscriptions.push(this._state.isDisabledChange.pipe(D(e=>e)).subscribe(()=>this.hide())))}show(){if(!(this.isOpen||this.isDisabled)){if(this._showInline){this._inlinedMenu||this._state.dropdownMenu.then(e=>{this._dropdown.attachInline(e.viewContainer,e.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._inlinedMenu&&this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),this.playAnimation();return}this._state.dropdownMenu.then(e=>{let i=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=i?"up":"down";let n=this.placement||(i?"top start":"bottom start");this._dropdown.attach(q).to(this.container).position({attachment:n}).show({content:e.templateRef,placement:n}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){this.isOpen&&(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(e){return this.isOpen||!e?this.hide():this.show()}_contains(e){return this._elementRef.nativeElement.contains(e.target)||this._dropdown.instance&&this._dropdown.instance._contains(e.target)}navigationClick(e){let i=this._elementRef.nativeElement.querySelector(".dropdown-menu");if(!i)return;let n=this._elementRef.nativeElement.ownerDocument.activeElement,d=i.querySelectorAll(".dropdown-item");switch(e.keyCode){case 38:this._state.counts>0&&d[--this._state.counts].focus();break;case 40:this._state.counts+1<d.length&&(n.classList!==d[this._state.counts].classList?d[this._state.counts].focus():d[++this._state.counts].focus());break;default:}e.preventDefault()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles()}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._inlinedMenu&&this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){let e=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right")||this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-end");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",e?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",e?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}};t.\u0275fac=function(i){return new(i||t)(o(l),o(p),o(g),o(_),o(c),o(B),o(b))},t.\u0275dir=u({type:t,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(i,n){i&1&&w("keydown.arrowDown",function(a){return n.navigationClick(a)})("keydown.arrowUp",function(a){return n.navigationClick(a)}),i&2&&C("dropup",n.dropup)("open",n.isOpen)("show",n.isOpen)},inputs:{placement:"placement",triggers:"triggers",container:"container",dropup:"dropup",autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",onShown:"onShown",onHidden:"onHidden"},exportAs:["bs-dropdown"],features:[E([c,_,B])]});let s=t;return s})(),ae=(()=>{let t=class t{constructor(e,i,n){e.resolveDropdownMenu({templateRef:n,viewContainer:i})}};t.\u0275fac=function(i){return new(i||t)(o(c),o(g),o(k))},t.\u0275dir=u({type:t,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]});let s=t;return s})(),he=(()=>{let t=class t{constructor(e,i,n,d,a){this._changeDetectorRef=e,this._dropdown=i,this._element=n,this._renderer=d,this._state=a,this.isOpen=!1,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(h=>{this.isOpen=h,h?(this._documentClickListener=this._renderer.listen("document","click",r=>{this._state.autoClose&&r.button!==2&&!this._element.nativeElement.contains(r.target)&&!(this._state.insideClick&&this._dropdown._contains(r))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(h=>this.isDisabled=h||void 0))}onClick(e){this._state.stopOnClickPropagation&&e.stopPropagation(),!this.isDisabled&&this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(let e of this._subscriptions)e.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(v),o(Y),o(l),o(p),o(c))},t.\u0275dir=u({type:t,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(i,n){i&1&&w("click",function(a){return n.onClick(a)}),i&2&&A("aria-haspopup",!0)("disabled",n.isDisabled)("aria-expanded",n.isOpen)},exportAs:["bs-dropdown-toggle"]});let s=t;return s})(),ce=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=O({type:t}),t.\u0275inj=M({});let s=t;return s})();export{Y as a,ae as b,he as c,ce as d};
@@ -1 +1 @@
1
- import{x as xe,z as Se}from"./chunk-34MKICK5.js";import{a as be}from"./chunk-U34OZUZ7.js";import{g as ge}from"./chunk-7P27WBGC.js";import{g as Ce}from"./chunk-7FUM3JGM.js";import{q as fe,r as _e}from"./chunk-JUNZFADM.js";import{Aa as le,Fa as ce,Kb as de,Mb as ue,Sb as he,_a as pe,eb as y,v as te,w as ie,zb as me}from"./chunk-2MTM6SWN.js";import{Ad as J,Cb as h,Eb as r,Ga as V,Gc as Q,Gd as Z,Hd as ee,Ib as $,Jb as L,Jf as re,Kb as W,L as j,Ma as s,Nb as I,Ob as M,Pb as d,Qa as N,Qb as g,Tb as K,Ub as H,Vb as X,Xa as R,Xb as k,Za as U,_c as F,bb as T,dc as C,ec as q,ef as ne,f as A,fc as x,fd as z,ha as b,jb as f,kb as _,kd as Y,ma as S,na as v,nb as w,nf as oe,ob as P,pb as p,qb as l,rb as c,rf as ae,sb as m,ya as B,yd as G,yf as se,zb as E}from"./chunk-ATP3BFHV.js";import{a as O,b as D}from"./chunk-RTRJ3KFH.js";var ye=(()=>{let o=class o{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new T(!0),this.renamingInProgress=new T(!0),this.elementRef=b(B),this.renderer=b(N),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm())}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275dir=U({type:o,selectors:[["","appInputEdit",""]],hostBindings:function(t,a){t&1&&h("blur",function(){return a.onBlur()})("keyup.enter",function(){return a.onEnter()})("keyup.esc",function(){return a.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=o;return i})();var Ee=["InputRename"],Fe=(i,o)=>o.alias,Te=(i,o)=>o.key;function we(i,o){if(i&1&&m(0,"app-user-avatar",14)(1,"div",9),i&2){let n=r().$implicit;p("user",n.owner)}}function Pe(i,o){if(i&1){let n=E();l(0,"input",15,0),h("updateObject",function(t){S(n);let a=r(2);return v(a.onRenameRoot(t))}),c()}if(i&2){let n=r().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,o){if(i&1&&(l(0,"span"),d(1),c()),i&2){let n=r(2).$implicit;s(),g(n.externalPath)}}function Me(i,o){if(i&1&&(l(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=r(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,o){if(i&1&&(l(0,"div",16)(1,"span"),d(2),c()(),l(3,"div",17),f(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=r().$implicit,e=r();s(2),g(n.name),s(2),_(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,o){if(i&1&&(l(0,"div",7)(1,"div",18),d(2),c(),l(3,"div",18),d(4),C(5,"amTimeAgo"),c()()),i&2){let n=r().$implicit;s(2),g(n.alias),s(2),g(q(5,2,n.createdAt))}}function De(i,o){if(i&1){let n=E();l(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let a=r().$implicit,u=r().$implicit;return H(u.hPerms[a.key],t)||(u.hPerms[a.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=r(2).$implicit,a=r();return v(a.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=r().$implicit,e=r().$implicit,t=r();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,o){if(i&1&&(l(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=r().$implicit,e=r().$implicit,t=r();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function je(i,o){if(i&1&&f(0,De,3,9,"button",19)(1,Ae,3,7,"button",20),i&2){let n=r().$implicit,e=r();_(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function Be(i,o){if(i&1){let n=E();l(0,"div",1)(1,"div",2)(2,"div",3),f(3,we,2,1),m(4,"img",4),l(5,"div",5),f(6,Pe,2,2,"input",6)(7,ke,6,2),c()(),f(8,Oe,6,4,"div",7),l(9,"div",8),m(10,"div",9),w(11,je,2,1,null,null,Te),C(13,"keyvalue"),m(14,"div",10),l(15,"button",11),C(16,"translate"),h("click",function(){let t=S(n).$implicit,a=r();return v(a.setRenamed(t))}),m(17,"fa-icon",12),c(),l(18,"button",13),C(19,"translate"),h("click",function(){let t=S(n).$implicit,a=r();return v(a.removeRoot(t))}),m(20,"fa-icon",12),c()()()()}if(i&2){let n=o.$implicit,e=r();s(3),_(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),_(n.isRenamed?6:7),s(2),_(e.showInfos?8:-1),s(3),P(x(13,14,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(16,17,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(19,20,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let o=class o{constructor(){this.showInfos=!0,this.showUsers=!0,this.addRootFile=null,this.locale=b(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(a=>a.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(a=>a.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=R({type:o,selectors:[["app-space-manage-roots"]],viewQuery:function(t,a){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(a.inputRename=u.first)}},inputs:{space:"space",user:"user",showInfos:"showInfos",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xxxs","text-truncate"],[1,"d-flex","justify-content-end"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(t,a){t&1&&w(0,Be,21,23,"div",1,Fe),t&2&&P(a.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=o;return i})();function Ve(i,o){if(i&1&&m(0,"fa-icon",3),i&2){let n=r();p("icon",n.icons.faSpinner)}}function Ne(i,o){i&1&&(l(0,"span",5),d(1,"You have no files anchored on this space"),c())}var wt=(()=>{let o=class o{constructor(){this.layout=b(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=b(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=R({type:o,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,a){t&1&&(l(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),l(3,"span"),d(4),c()(),f(5,Ve,1,1,"fa-icon",3),l(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),l(9,"button",6),h("click",function(){return a.layout.closeDialog()}),c()(),l(10,"div",7),m(11,"app-space-manage-roots",8),f(12,Ne,2,0,"span",5),c(),l(13,"div",9)(14,"button",10),h("click",function(){return a.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),l(18,"button",12),h("click",function(){return a.layout.closeDialog()}),d(19,"Cancel"),c(),l(20,"button",13),h("click",function(){return a.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",a.icons.SPACES),s(2),g(a.space.name),s(),_(a.loading?5:-1),s(6),p("space",a.space)("user",a.user)("showUsers",!1)("addRootFile",a.addRootFileEvent),s(),_(a.space.roots.length?-1:12),s(3),p("icon",a.icons.faPlus),s(),p("icon",a.icons.faAnchor),s(4),p("disabled",a.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=o;return i})();export{ye as a,Re as b,wt as c};
1
+ import{x as xe,z as Se}from"./chunk-5K7HEX3C.js";import{a as be}from"./chunk-5KLMS6A4.js";import{g as ge}from"./chunk-ZKCFO2OA.js";import{g as Ce}from"./chunk-4YGJGZZZ.js";import{q as fe,r as _e}from"./chunk-EWKSX76T.js";import{Aa as le,Fa as ce,Kb as de,Mb as ue,Sb as he,_a as pe,eb as y,v as te,w as ie,zb as me}from"./chunk-XLCCZSQL.js";import{Ad as J,Cb as h,Eb as r,Ga as V,Gc as Q,Gd as Z,Hd as ee,Ib as $,Jb as L,Jf as re,Kb as W,L as j,Ma as s,Nb as I,Ob as M,Pb as d,Qa as N,Qb as g,Tb as K,Ub as H,Vb as X,Xa as R,Xb as k,Za as U,_c as F,bb as T,dc as C,ec as q,ef as ne,f as A,fc as x,fd as z,ha as b,jb as f,kb as _,kd as Y,ma as S,na as v,nb as w,nf as oe,ob as P,pb as p,qb as l,rb as c,rf as ae,sb as m,ya as B,yd as G,yf as se,zb as E}from"./chunk-ATP3BFHV.js";import{a as O,b as D}from"./chunk-RTRJ3KFH.js";var ye=(()=>{let o=class o{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new T(!0),this.renamingInProgress=new T(!0),this.elementRef=b(B),this.renderer=b(N),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm())}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275dir=U({type:o,selectors:[["","appInputEdit",""]],hostBindings:function(t,a){t&1&&h("blur",function(){return a.onBlur()})("keyup.enter",function(){return a.onEnter()})("keyup.esc",function(){return a.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=o;return i})();var Ee=["InputRename"],Fe=(i,o)=>o.alias,Te=(i,o)=>o.key;function we(i,o){if(i&1&&m(0,"app-user-avatar",14)(1,"div",9),i&2){let n=r().$implicit;p("user",n.owner)}}function Pe(i,o){if(i&1){let n=E();l(0,"input",15,0),h("updateObject",function(t){S(n);let a=r(2);return v(a.onRenameRoot(t))}),c()}if(i&2){let n=r().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,o){if(i&1&&(l(0,"span"),d(1),c()),i&2){let n=r(2).$implicit;s(),g(n.externalPath)}}function Me(i,o){if(i&1&&(l(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=r(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,o){if(i&1&&(l(0,"div",16)(1,"span"),d(2),c()(),l(3,"div",17),f(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=r().$implicit,e=r();s(2),g(n.name),s(2),_(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,o){if(i&1&&(l(0,"div",7)(1,"div",18),d(2),c(),l(3,"div",18),d(4),C(5,"amTimeAgo"),c()()),i&2){let n=r().$implicit;s(2),g(n.alias),s(2),g(q(5,2,n.createdAt))}}function De(i,o){if(i&1){let n=E();l(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let a=r().$implicit,u=r().$implicit;return H(u.hPerms[a.key],t)||(u.hPerms[a.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=r(2).$implicit,a=r();return v(a.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=r().$implicit,e=r().$implicit,t=r();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,o){if(i&1&&(l(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=r().$implicit,e=r().$implicit,t=r();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function je(i,o){if(i&1&&f(0,De,3,9,"button",19)(1,Ae,3,7,"button",20),i&2){let n=r().$implicit,e=r();_(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function Be(i,o){if(i&1){let n=E();l(0,"div",1)(1,"div",2)(2,"div",3),f(3,we,2,1),m(4,"img",4),l(5,"div",5),f(6,Pe,2,2,"input",6)(7,ke,6,2),c()(),f(8,Oe,6,4,"div",7),l(9,"div",8),m(10,"div",9),w(11,je,2,1,null,null,Te),C(13,"keyvalue"),m(14,"div",10),l(15,"button",11),C(16,"translate"),h("click",function(){let t=S(n).$implicit,a=r();return v(a.setRenamed(t))}),m(17,"fa-icon",12),c(),l(18,"button",13),C(19,"translate"),h("click",function(){let t=S(n).$implicit,a=r();return v(a.removeRoot(t))}),m(20,"fa-icon",12),c()()()()}if(i&2){let n=o.$implicit,e=r();s(3),_(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),_(n.isRenamed?6:7),s(2),_(e.showInfos?8:-1),s(3),P(x(13,14,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(16,17,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(19,20,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let o=class o{constructor(){this.showInfos=!0,this.showUsers=!0,this.addRootFile=null,this.locale=b(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(a=>a.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(a=>a.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=R({type:o,selectors:[["app-space-manage-roots"]],viewQuery:function(t,a){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(a.inputRename=u.first)}},inputs:{space:"space",user:"user",showInfos:"showInfos",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xxxs","text-truncate"],[1,"d-flex","justify-content-end"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(t,a){t&1&&w(0,Be,21,23,"div",1,Fe),t&2&&P(a.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=o;return i})();function Ve(i,o){if(i&1&&m(0,"fa-icon",3),i&2){let n=r();p("icon",n.icons.faSpinner)}}function Ne(i,o){i&1&&(l(0,"span",5),d(1,"You have no files anchored on this space"),c())}var wt=(()=>{let o=class o{constructor(){this.layout=b(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=b(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=R({type:o,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,a){t&1&&(l(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),l(3,"span"),d(4),c()(),f(5,Ve,1,1,"fa-icon",3),l(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),l(9,"button",6),h("click",function(){return a.layout.closeDialog()}),c()(),l(10,"div",7),m(11,"app-space-manage-roots",8),f(12,Ne,2,0,"span",5),c(),l(13,"div",9)(14,"button",10),h("click",function(){return a.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),l(18,"button",12),h("click",function(){return a.layout.closeDialog()}),d(19,"Cancel"),c(),l(20,"button",13),h("click",function(){return a.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",a.icons.SPACES),s(2),g(a.space.name),s(),_(a.loading?5:-1),s(6),p("space",a.space)("user",a.user)("showUsers",!1)("addRootFile",a.addRootFileEvent),s(),_(a.space.roots.length?-1:12),s(3),p("icon",a.icons.faPlus),s(),p("icon",a.icons.faAnchor),s(4),p("disabled",a.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=o;return i})();export{ye as a,Re as b,wt as c};