@autenticar-me/vue 0.1.0 → 0.3.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 (83) hide show
  1. package/dist/components/AuthSwitcher.vue.d.ts +2 -2
  2. package/dist/components/AuthSwitcher.vue.d.ts.map +1 -0
  3. package/dist/components/Buttons/SignInButton.vue.d.ts +2 -2
  4. package/dist/components/Buttons/SignInButton.vue.d.ts.map +1 -0
  5. package/dist/components/Buttons/SignOutButton.vue.d.ts +2 -2
  6. package/dist/components/Buttons/SignOutButton.vue.d.ts.map +1 -0
  7. package/dist/components/Buttons/SignUpButton.vue.d.ts +2 -2
  8. package/dist/components/Buttons/SignUpButton.vue.d.ts.map +1 -0
  9. package/dist/components/Layout/SignedIn.vue.d.ts +12 -7
  10. package/dist/components/Layout/SignedIn.vue.d.ts.map +1 -0
  11. package/dist/components/Layout/SignedOut.vue.d.ts +12 -7
  12. package/dist/components/Layout/SignedOut.vue.d.ts.map +1 -0
  13. package/dist/components/Modals/Modal.vue.d.ts +15 -10
  14. package/dist/components/Modals/Modal.vue.d.ts.map +1 -0
  15. package/dist/components/Modals/SignInModal.vue.d.ts +4 -4
  16. package/dist/components/Modals/SignInModal.vue.d.ts.map +1 -0
  17. package/dist/components/Modals/SignUpModal.vue.d.ts +4 -4
  18. package/dist/components/Modals/SignUpModal.vue.d.ts.map +1 -0
  19. package/dist/components/Notification.vue.d.ts +3 -3
  20. package/dist/components/Notification.vue.d.ts.map +1 -0
  21. package/dist/components/SignIn.vue.d.ts +7 -4
  22. package/dist/components/SignIn.vue.d.ts.map +1 -0
  23. package/dist/components/SignUp.vue.d.ts +7 -4
  24. package/dist/components/SignUp.vue.d.ts.map +1 -0
  25. package/dist/components/UserProfile.vue.d.ts +4 -2
  26. package/dist/components/UserProfile.vue.d.ts.map +1 -0
  27. package/dist/composables/useAtm.d.ts +5 -4
  28. package/dist/composables/useAtm.d.ts.map +1 -0
  29. package/dist/composables/useAtmClient.d.ts +2 -1
  30. package/dist/composables/useAtmClient.d.ts.map +1 -0
  31. package/dist/composables/useAuth.d.ts +3 -2
  32. package/dist/composables/useAuth.d.ts.map +1 -0
  33. package/dist/index.cjs +2278 -0
  34. package/dist/index.cjs.map +1 -0
  35. package/dist/index.d.ts +18 -16
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +2277 -31
  38. package/dist/index.js.map +1 -0
  39. package/dist/plugin.d.ts +2 -1
  40. package/dist/plugin.d.ts.map +1 -0
  41. package/dist/types/configurations.type.d.ts +10 -0
  42. package/dist/types/configurations.type.d.ts.map +1 -0
  43. package/dist/types/session.type.d.ts +1 -0
  44. package/dist/types/session.type.d.ts.map +1 -0
  45. package/dist/types/user-attribute.type.d.ts +1 -0
  46. package/dist/types/user-attribute.type.d.ts.map +1 -0
  47. package/dist/types/user.type.d.ts +2 -1
  48. package/dist/types/user.type.d.ts.map +1 -0
  49. package/dist/utils/device.d.ts +2 -1
  50. package/dist/utils/device.d.ts.map +1 -0
  51. package/dist/utils/fetch-configurations.d.ts +3 -2
  52. package/dist/utils/fetch-configurations.d.ts.map +1 -0
  53. package/dist/utils/fetch-user.d.ts +3 -2
  54. package/dist/utils/fetch-user.d.ts.map +1 -0
  55. package/dist/utils/tokens.d.ts +1 -0
  56. package/dist/utils/tokens.d.ts.map +1 -0
  57. package/package.json +28 -5
  58. package/.claude/settings.local.json +0 -7
  59. package/dist/components/AuthSwitcher.vue.js +0 -76
  60. package/dist/components/Buttons/SignInButton.vue.js +0 -110
  61. package/dist/components/Buttons/SignOutButton.vue.js +0 -68
  62. package/dist/components/Buttons/SignUpButton.vue.js +0 -86
  63. package/dist/components/Layout/SignedIn.vue.js +0 -54
  64. package/dist/components/Layout/SignedOut.vue.js +0 -54
  65. package/dist/components/Modals/Modal.vue.js +0 -133
  66. package/dist/components/Modals/SignInModal.vue.js +0 -149
  67. package/dist/components/Modals/SignUpModal.vue.js +0 -165
  68. package/dist/components/Notification.vue.js +0 -95
  69. package/dist/components/SignIn.vue.js +0 -485
  70. package/dist/components/SignUp.vue.js +0 -339
  71. package/dist/components/UserProfile.vue.js +0 -916
  72. package/dist/composables/useAtm.js +0 -11
  73. package/dist/composables/useAtmClient.js +0 -8
  74. package/dist/composables/useAuth.js +0 -38
  75. package/dist/plugin.js +0 -33
  76. package/dist/types/configurations.type.js +0 -2
  77. package/dist/types/session.type.js +0 -2
  78. package/dist/types/user-attribute.type.js +0 -2
  79. package/dist/types/user.type.js +0 -2
  80. package/dist/utils/device.js +0 -46
  81. package/dist/utils/fetch-configurations.js +0 -45
  82. package/dist/utils/fetch-user.js +0 -36
  83. package/dist/utils/tokens.js +0 -46
package/dist/index.cjs ADDED
@@ -0,0 +1,2278 @@
1
+
2
+ (function() {
3
+ if (typeof document !== 'undefined') {
4
+ const style = document.createElement('style');
5
+ style.textContent = "\n.atm-overlay[data-v-c347df44] {\n position: fixed;\n inset: 0;\n z-index: 99999;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n overflow-y: auto;\n padding: 1.5rem 0;\n}\n.atm-container[data-v-c347df44] {\n padding: 0 1.5rem;\n width: 100%;\n margin: auto;\n}\n.atm-fade-layer[data-v-c347df44] {\n position: fixed;\n inset: 0;\n transition: opacity 0.2s ease;\n pointer-events: none;\n}\n.atm-fade-bg[data-v-c347df44] {\n position: absolute;\n inset: 0;\n opacity: 0.75;\n}\n.atm-modal[data-v-c347df44] {\n position: relative;\n display: inline-block;\n vertical-align: bottom;\n background-color: #ffffff;\n border-radius: 0.5rem;\n text-align: left;\n box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);\n transform: translate(0);\n transition: all 0.2s ease-in-out;\n max-width: 32rem;\n width: 100%;\n max-height: calc(100vh - 3rem);\n display: flex;\n flex-direction: column;\n}\n.atm-close-button[data-v-c347df44] {\n position: absolute;\n top: 1rem;\n right: 1rem;\n color: #9ca3af;\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10;\n}\n.atm-close-button[data-v-c347df44]:hover {\n color: #4b5563;\n}\n.atm-icon[data-v-c347df44] {\n width: 1.5rem;\n height: 1.5rem;\n}\n.atm-modal-content[data-v-c347df44] {\n padding: 1.25rem;\n overflow-y: auto;\n flex: 1;\n min-height: 0;\n}\n.atm-modal-title[data-v-c347df44] {\n font-size: 1.125rem;\n font-weight: 500;\n color: #111827;\n margin: 0;\n margin-bottom: 0.75rem;\n}\n@media (max-width: 768px) {\n.atm-overlay[data-v-c347df44] {\n padding: 1rem 0;\n}\n.atm-container[data-v-c347df44] {\n padding: 0 1rem;\n}\n.atm-modal[data-v-c347df44] {\n border-radius: 0.375rem;\n max-height: calc(100vh - 2rem);\n}\n.atm-modal-content[data-v-c347df44] {\n padding: 1rem;\n}\n.atm-modal-title[data-v-c347df44] {\n font-size: 1rem;\n margin-bottom: 0.75rem;\n}\n.atm-close-button[data-v-c347df44] {\n top: 0.75rem;\n right: 0.75rem;\n}\n.atm-icon[data-v-c347df44] {\n width: 1.25rem;\n height: 1.25rem;\n}\n}\n@media (max-width: 480px) {\n.atm-overlay[data-v-c347df44] {\n padding: 0.5rem 0;\n}\n.atm-container[data-v-c347df44] {\n padding: 0 0.5rem;\n}\n.atm-modal[data-v-c347df44] {\n border-radius: 0.25rem;\n max-width: 100%;\n max-height: calc(100vh - 1rem);\n}\n.atm-modal-content[data-v-c347df44] {\n padding: 0.875rem;\n}\n.atm-modal-title[data-v-c347df44] {\n font-size: 0.9375rem;\n margin-bottom: 0.625rem;\n}\n.atm-close-button[data-v-c347df44] {\n top: 0.5rem;\n right: 0.5rem;\n}\n}\n@media (max-width: 360px) {\n.atm-overlay[data-v-c347df44] {\n padding: 0.25rem 0;\n}\n.atm-container[data-v-c347df44] {\n padding: 0 0.25rem;\n}\n.atm-modal[data-v-c347df44] {\n max-height: calc(100vh - 0.5rem);\n}\n.atm-modal-content[data-v-c347df44] {\n padding: 0.75rem;\n}\n.atm-modal-title[data-v-c347df44] {\n font-size: 0.875rem;\n margin-bottom: 0.5rem;\n}\n}\n\n.atm-login-container[data-v-69af412a] {\n background: #ffffff;\n border-radius: 8px;\n font-family: 'Segoe UI', system-ui, sans-serif;\n text-align: center;\n}\n.atm-logo-container[data-v-69af412a] {\n margin-bottom: 12px;\n}\n.atm-logo-placeholder[data-v-69af412a] {\n width: 44px;\n height: 44px;\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #f0f0f0;\n border-radius: 50%;\n color: #888;\n font-size: 11px;\n}\n.atm-logo-image[data-v-69af412a] {\n max-width: 44px;\n max-height: 44px;\n margin: 0 auto;\n display: block;\n border-radius: 4px;\n object-fit: contain;\n}\n.atm-project-name[data-v-69af412a] {\n margin: 0 0 4px 0;\n font-size: 18px;\n color: var(--e2d4c99e);\n font-weight: 600;\n}\n.atm-welcome-text[data-v-69af412a] {\n margin: 0 0 16px 0;\n font-size: 14px;\n color: #666;\n}\n.atm-form-group[data-v-69af412a] {\n margin-bottom: 12px;\n text-align: left;\n}\n.atm-input-label[data-v-69af412a] {\n display: block;\n margin-bottom: 4px;\n font-size: 13px;\n color: #555;\n font-weight: 500;\n}\n.atm-input-field[data-v-69af412a] {\n width: 100%;\n padding: 8px 10px;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n box-sizing: border-box;\n transition: border-color 0.2s;\n}\n.atm-input-field[data-v-69af412a]:focus {\n outline: none;\n border-color: var(--e2d4c99e);\n box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);\n}\n.atm-input-field[data-v-69af412a]:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n}\n.atm-field-error[data-v-69af412a] {\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n text-align: left;\n}\n.atm-alternative-options[data-v-69af412a] {\n margin-top: 8px;\n text-align: center;\n}\n.atm-forgot-password-link[data-v-69af412a] {\n font-size: 12px;\n background: none;\n border: none;\n color: var(--v182122ff);\n cursor: pointer;\n text-decoration: none;\n padding: 0;\n font-family: inherit;\n}\n.atm-forgot-password-link[data-v-69af412a]:hover:not(:disabled) {\n text-decoration: underline;\n}\n.atm-forgot-password-link[data-v-69af412a]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.atm-strategy-choice[data-v-69af412a] {\n text-align: center;\n margin-bottom: 12px;\n}\n.atm-strategy-title[data-v-69af412a] {\n font-size: 14px;\n color: #666;\n margin-bottom: 12px;\n}\n.atm-strategy-buttons[data-v-69af412a] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.atm-strategy-button[data-v-69af412a] {\n width: 100%;\n padding: 10px;\n background: #f8f9fa;\n color: #333;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n}\n.atm-strategy-button[data-v-69af412a]:hover:not(:disabled) {\n background: #e9ecef;\n border-color: var(--e2d4c99e);\n}\n.atm-strategy-button[data-v-69af412a]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.atm-email-link-text[data-v-69af412a] {\n font-size: 14px;\n color: #666;\n margin: 0;\n text-align: center;\n}\n.atm-login-button[data-v-69af412a] {\n width: 100%;\n padding: 10px;\n margin-top: 4px;\n background: var(--e2d4c99e);\n color: #fff;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n min-height: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.atm-login-button[data-v-69af412a]:hover:not(:disabled) {\n opacity: 0.9;\n transform: translateY(-1px);\n}\n.atm-login-button[data-v-69af412a]:disabled {\n opacity: 0.8;\n cursor: not-allowed;\n transform: none;\n}\n.button-spinner[data-v-69af412a] {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n color: #fff;\n font-weight: 500;\n}\n.spinner-svg[data-v-69af412a] {\n animation: spin-69af412a 1s linear infinite;\n width: 18px;\n height: 18px;\n stroke: #fff;\n}\n.spinner-circle[data-v-69af412a] {\n stroke-dasharray: 90, 150;\n stroke-linecap: round;\n}\n@keyframes spin-69af412a {\n0% {\n transform: rotate(0deg);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n.atm-footer-links[data-v-69af412a] {\n margin-top: 16px;\n font-size: 13px;\n}\n.atm-signup-text[data-v-69af412a] {\n color: #666;\n margin-bottom: 6px;\n}\n.atm-signup-link[data-v-69af412a] {\n color: var(--v182122ff);\n text-decoration: none;\n cursor: pointer;\n}\n.atm-signup-link[data-v-69af412a]:hover {\n text-decoration: underline;\n}\n.atm-powered-by[data-v-69af412a] {\n color: #999;\n font-size: 11px;\n margin: 0;\n}\n@media (max-width: 768px) {\n.atm-project-name[data-v-69af412a] {\n font-size: 17px;\n}\n.atm-welcome-text[data-v-69af412a] {\n font-size: 13px;\n margin-bottom: 14px;\n}\n.atm-form-group[data-v-69af412a] {\n margin-bottom: 10px;\n}\n.atm-input-label[data-v-69af412a] {\n font-size: 12px;\n margin-bottom: 4px;\n}\n.atm-input-field[data-v-69af412a] {\n padding: 8px 10px;\n font-size: 13px;\n}\n.atm-login-button[data-v-69af412a] {\n font-size: 13px;\n padding: 9px;\n min-height: 40px;\n}\n.atm-strategy-button[data-v-69af412a] {\n padding: 9px;\n font-size: 13px;\n}\n.atm-footer-links[data-v-69af412a] {\n margin-top: 14px;\n font-size: 12px;\n}\n}\n@media (max-width: 480px) {\n.atm-logo-placeholder[data-v-69af412a] {\n width: 40px;\n height: 40px;\n font-size: 10px;\n}\n.atm-logo-image[data-v-69af412a] {\n max-width: 40px;\n max-height: 40px;\n}\n.atm-project-name[data-v-69af412a] {\n font-size: 16px;\n margin-bottom: 4px;\n}\n.atm-welcome-text[data-v-69af412a] {\n font-size: 12px;\n margin-bottom: 12px;\n}\n.atm-form-group[data-v-69af412a] {\n margin-bottom: 10px;\n}\n.atm-input-label[data-v-69af412a] {\n font-size: 12px;\n margin-bottom: 3px;\n}\n.atm-input-field[data-v-69af412a] {\n padding: 7px 9px;\n font-size: 13px;\n}\n.atm-login-button[data-v-69af412a] {\n font-size: 13px;\n padding: 9px;\n min-height: 38px;\n}\n.atm-forgot-password-link[data-v-69af412a] {\n font-size: 11px;\n}\n.atm-strategy-title[data-v-69af412a] {\n font-size: 13px;\n margin-bottom: 10px;\n}\n.atm-strategy-button[data-v-69af412a] {\n padding: 9px;\n font-size: 13px;\n}\n.atm-email-link-text[data-v-69af412a] {\n font-size: 13px;\n}\n.atm-footer-links[data-v-69af412a] {\n margin-top: 12px;\n font-size: 12px;\n}\n.atm-powered-by[data-v-69af412a] {\n font-size: 10px;\n}\n.spinner-svg[data-v-69af412a] {\n width: 16px;\n height: 16px;\n}\n.button-spinner[data-v-69af412a] {\n gap: 6px;\n}\n}\n@media (max-width: 360px) {\n.atm-logo-placeholder[data-v-69af412a] {\n width: 36px;\n height: 36px;\n font-size: 9px;\n}\n.atm-logo-image[data-v-69af412a] {\n max-width: 36px;\n max-height: 36px;\n}\n.atm-project-name[data-v-69af412a] {\n font-size: 15px;\n margin-bottom: 3px;\n}\n.atm-welcome-text[data-v-69af412a] {\n font-size: 11px;\n margin-bottom: 10px;\n}\n.atm-form-group[data-v-69af412a] {\n margin-bottom: 8px;\n}\n.atm-input-label[data-v-69af412a] {\n font-size: 11px;\n margin-bottom: 3px;\n}\n.atm-input-field[data-v-69af412a] {\n padding: 6px 8px;\n font-size: 12px;\n}\n.atm-login-button[data-v-69af412a] {\n font-size: 12px;\n padding: 8px;\n min-height: 36px;\n}\n.atm-strategy-button[data-v-69af412a] {\n padding: 8px;\n font-size: 12px;\n}\n.atm-footer-links[data-v-69af412a] {\n margin-top: 10px;\n font-size: 11px;\n}\n.spinner-svg[data-v-69af412a] {\n width: 14px;\n height: 14px;\n}\n}\n\n.atm-notification-container[data-v-f5e47084] {\n font-family: Arial, Helvetica, sans-serif;\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 99999;\n pointer-events: none;\n}\n.atm-notification[data-v-f5e47084] {\n padding: 12px 16px;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n min-width: 250px;\n max-width: 350px;\n pointer-events: auto;\n}\n.atm-notification--error[data-v-f5e47084] {\n background: #ff3333;\n color: #FFF;\n}\n.atm-notification--success[data-v-f5e47084] {\n background: #00a622;\n color: #FFF;\n}\n.atm-notification--warning[data-v-f5e47084] {\n background: #ffa500;\n color: #FFF;\n}\n.atm-notification-enter-active[data-v-f5e47084] {\n transition: all 0.3s ease-out;\n}\n.atm-notification-leave-active[data-v-f5e47084] {\n transition: all 0.3s ease-in;\n}\n.atm-notification-enter-from[data-v-f5e47084] {\n transform: translateX(100%);\n opacity: 0;\n}\n.atm-notification-leave-to[data-v-f5e47084] {\n transform: translateX(100%);\n opacity: 0;\n}\n@media (max-width: 768px) {\n.atm-notification-container[data-v-f5e47084] {\n top: 16px;\n right: 16px;\n left: 16px;\n}\n.atm-notification[data-v-f5e47084] {\n min-width: auto;\n max-width: 100%;\n padding: 11px 14px;\n font-size: 13px;\n}\n}\n@media (max-width: 480px) {\n.atm-notification-container[data-v-f5e47084] {\n top: 12px;\n right: 12px;\n left: 12px;\n}\n.atm-notification[data-v-f5e47084] {\n padding: 10px 12px;\n font-size: 12px;\n border-radius: 5px;\n}\n}\n@media (max-width: 360px) {\n.atm-notification-container[data-v-f5e47084] {\n top: 10px;\n right: 10px;\n left: 10px;\n}\n.atm-notification[data-v-f5e47084] {\n padding: 9px 11px;\n font-size: 11px;\n border-radius: 4px;\n}\n}\n\n.atm-signup-container[data-v-de716df2] {\n width: 100%;\n border-radius: 8px;\n font-family: 'Segoe UI', system-ui, sans-serif;\n text-align: center;\n}\n.atm-logo-container[data-v-de716df2] {\n margin-bottom: 12px;\n}\n.atm-logo-placeholder[data-v-de716df2] {\n width: 44px;\n height: 44px;\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #f0f0f0;\n border-radius: 50%;\n color: #888;\n font-size: 11px;\n}\n.atm-logo-image[data-v-de716df2] {\n max-width: 44px;\n max-height: 44px;\n margin: 0 auto;\n display: block;\n border-radius: 4px;\n object-fit: contain;\n}\n.atm-project-name[data-v-de716df2] {\n margin: 0 0 4px 0;\n font-size: 18px;\n color: var(--v8c008960);\n font-weight: 600;\n}\n.atm-welcome-text[data-v-de716df2] {\n margin: 0 0 16px 0;\n font-size: 14px;\n color: #666;\n}\n.atm-form-group[data-v-de716df2] {\n margin-bottom: 12px;\n text-align: left;\n}\n.atm-input-label[data-v-de716df2] {\n display: block;\n margin-bottom: 4px;\n font-size: 13px;\n color: #555;\n font-weight: 500;\n}\n.atm-input-field[data-v-de716df2] {\n width: 100%;\n padding: 8px 10px;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n box-sizing: border-box;\n transition: border-color 0.2s;\n}\n.atm-input-field[data-v-de716df2]:focus {\n outline: none;\n border-color: var(--v8c008960);\n box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);\n}\n.atm-input-field[data-v-de716df2]:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n}\n.atm-field-error[data-v-de716df2] {\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n text-align: left;\n}\n.atm-signup-button[data-v-de716df2] {\n width: 100%;\n padding: 10px;\n margin-top: 4px;\n background: var(--v8c008960);\n color: #fff;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n min-height: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.atm-signup-button[data-v-de716df2]:hover:not(:disabled) {\n opacity: 0.9;\n transform: translateY(-1px);\n}\n.atm-signup-button[data-v-de716df2]:disabled {\n opacity: 0.8;\n cursor: not-allowed;\n transform: none;\n}\n.button-spinner[data-v-de716df2] {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n color: #fff;\n font-weight: 500;\n}\n.spinner-svg[data-v-de716df2] {\n animation: spin-de716df2 1s linear infinite;\n width: 18px;\n height: 18px;\n stroke: #fff;\n}\n.spinner-circle[data-v-de716df2] {\n stroke-dasharray: 90, 150;\n stroke-linecap: round;\n}\n@keyframes spin-de716df2 {\n0% {\n transform: rotate(0deg);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n.atm-footer-links[data-v-de716df2] {\n margin-top: 16px;\n font-size: 13px;\n}\n.atm-login-text[data-v-de716df2] {\n color: #666;\n margin-bottom: 6px;\n}\n.atm-login-link[data-v-de716df2] {\n color: var(--v1183b75e);\n text-decoration: none;\n cursor: pointer;\n transition: opacity 0.2s;\n}\n.atm-login-link[data-v-de716df2]:hover:not(.disabled-link) {\n text-decoration: underline;\n}\n.atm-login-link.disabled-link[data-v-de716df2] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n.atm-powered-by[data-v-de716df2] {\n color: #999;\n font-size: 11px;\n margin: 0;\n}\n@media (max-width: 768px) {\n.atm-project-name[data-v-de716df2] {\n font-size: 17px;\n}\n.atm-welcome-text[data-v-de716df2] {\n font-size: 13px;\n margin-bottom: 14px;\n}\n.atm-form-group[data-v-de716df2] {\n margin-bottom: 10px;\n}\n.atm-input-label[data-v-de716df2] {\n font-size: 12px;\n margin-bottom: 4px;\n}\n.atm-input-field[data-v-de716df2] {\n padding: 8px 10px;\n font-size: 13px;\n}\n.atm-signup-button[data-v-de716df2] {\n font-size: 13px;\n padding: 9px;\n min-height: 40px;\n}\n.atm-footer-links[data-v-de716df2] {\n margin-top: 14px;\n font-size: 12px;\n}\n}\n@media (max-width: 480px) {\n.atm-logo-placeholder[data-v-de716df2] {\n width: 40px;\n height: 40px;\n font-size: 10px;\n}\n.atm-logo-image[data-v-de716df2] {\n max-width: 40px;\n max-height: 40px;\n}\n.atm-project-name[data-v-de716df2] {\n font-size: 16px;\n margin-bottom: 4px;\n}\n.atm-welcome-text[data-v-de716df2] {\n font-size: 12px;\n margin-bottom: 12px;\n}\n.atm-form-group[data-v-de716df2] {\n margin-bottom: 10px;\n}\n.atm-input-label[data-v-de716df2] {\n font-size: 12px;\n margin-bottom: 3px;\n}\n.atm-input-field[data-v-de716df2] {\n padding: 7px 9px;\n font-size: 13px;\n}\n.atm-signup-button[data-v-de716df2] {\n font-size: 13px;\n padding: 9px;\n min-height: 38px;\n}\n.atm-footer-links[data-v-de716df2] {\n margin-top: 12px;\n font-size: 12px;\n}\n.atm-powered-by[data-v-de716df2] {\n font-size: 10px;\n}\n.spinner-svg[data-v-de716df2] {\n width: 16px;\n height: 16px;\n}\n.button-spinner[data-v-de716df2] {\n gap: 6px;\n}\n}\n@media (max-width: 360px) {\n.atm-logo-placeholder[data-v-de716df2] {\n width: 36px;\n height: 36px;\n font-size: 9px;\n}\n.atm-logo-image[data-v-de716df2] {\n max-width: 36px;\n max-height: 36px;\n}\n.atm-project-name[data-v-de716df2] {\n font-size: 15px;\n margin-bottom: 3px;\n}\n.atm-welcome-text[data-v-de716df2] {\n font-size: 11px;\n margin-bottom: 10px;\n}\n.atm-form-group[data-v-de716df2] {\n margin-bottom: 8px;\n}\n.atm-input-label[data-v-de716df2] {\n font-size: 11px;\n margin-bottom: 3px;\n}\n.atm-input-field[data-v-de716df2] {\n padding: 6px 8px;\n font-size: 12px;\n}\n.atm-signup-button[data-v-de716df2] {\n font-size: 12px;\n padding: 8px;\n min-height: 36px;\n}\n.atm-footer-links[data-v-de716df2] {\n margin-top: 10px;\n font-size: 11px;\n}\n.spinner-svg[data-v-de716df2] {\n width: 14px;\n height: 14px;\n}\n}\n\n.atm-signin-btn[data-v-4139c6d0] {\n padding: 12px;\n margin-top: 8px;\n background: var(--v0f0ded3a);\n color: #FFF;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n min-height: 44px;\n}\n.atm-signin-btn[data-v-4139c6d0]:hover {\n opacity: 0.9;\n}\n@media (max-width: 768px) {\n.atm-signin-btn[data-v-4139c6d0] {\n padding: 11px;\n font-size: 13px;\n min-height: 42px;\n}\n}\n@media (max-width: 480px) {\n.atm-signin-btn[data-v-4139c6d0] {\n padding: 10px;\n font-size: 13px;\n min-height: 40px;\n}\n}\n@media (max-width: 360px) {\n.atm-signin-btn[data-v-4139c6d0] {\n padding: 9px;\n font-size: 12px;\n min-height: 38px;\n}\n}\n\n.atm-signup-btn[data-v-959aa7ef] {\n padding: 12px;\n margin-top: 8px;\n background: var(--v1112fbaa);\n color: #FFF;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n min-height: 44px;\n}\n.atm-signup-btn[data-v-959aa7ef]:hover {\n opacity: 0.9;\n}\n@media (max-width: 768px) {\n.atm-signup-btn[data-v-959aa7ef] {\n padding: 11px;\n font-size: 13px;\n min-height: 42px;\n}\n}\n@media (max-width: 480px) {\n.atm-signup-btn[data-v-959aa7ef] {\n padding: 10px;\n font-size: 13px;\n min-height: 40px;\n}\n}\n@media (max-width: 360px) {\n.atm-signup-btn[data-v-959aa7ef] {\n padding: 9px;\n font-size: 12px;\n min-height: 38px;\n}\n}\n\n.atm-profile-container {\n position: relative;\n display: inline-block;\n font-family: 'Segoe UI', system-ui, sans-serif;\n}\n.atm-profile-button {\n display: flex;\n align-items: center;\n gap: 8px;\n background: none;\n border: none;\n cursor: pointer;\n padding: 8px 12px;\n border-radius: 6px;\n transition: background 0.2s;\n}\n.atm-profile-button:hover {\n background: #f0f0f0;\n}\n.atm-profile-avatar {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background-color: var(--v1982ae74);\n color: white;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: 500;\n}\n.atm-profile-avatar.large {\n width: 48px;\n height: 48px;\n font-size: 16px;\n}\n.atm-profile-avatar-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 50%;\n}\n.atm-profile-name {\n font-size: 14px;\n color: #333;\n font-weight: 500;\n}\n.atm-profile-arrow {\n width: 16px;\n height: 16px;\n transition: transform 0.2s;\n}\n.atm-rotate {\n transform: rotate(180deg);\n}\n.atm-profile-menu {\n position: absolute;\n top: 100%;\n left: 0;\n width: 280px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n overflow: hidden;\n margin-top: 4px;\n}\n.atm-profile-info {\n display: flex;\n gap: 12px;\n padding: 16px;\n border-bottom: 1px solid #f0f0f0;\n}\n.atm-profile-details {\n flex: 1;\n min-width: 0;\n}\n.atm-profile-fullname {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.atm-profile-email {\n margin: 4px 0 0;\n font-size: 13px;\n color: #666;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.atm-profile-options {\n padding: 8px 0;\n}\n.atm-profile-option {\n display: flex;\n align-items: center;\n width: 100%;\n padding: 10px 16px;\n background: none;\n border: none;\n text-align: left;\n cursor: pointer;\n font-size: 14px;\n color: #333;\n gap: 10px;\n transition: background 0.2s;\n}\n.atm-profile-option:hover {\n background: #f5f5f5;\n}\n.atm-profile-icon {\n width: 18px;\n height: 18px;\n color: #666;\n}\n.atm-fade-enter-active,\n.atm-fade-leave-active {\n transition: opacity 0.2s, transform 0.2s;\n}\n.atm-fade-enter-from,\n.atm-fade-leave-to {\n opacity: 0;\n transform: translateY(-10px);\n}\n.atm-profile-modal {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow-y: auto;\n padding: 1.5rem;\n}\n.atm-profile-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n pointer-events: none;\n}\n.atm-profile-content {\n position: relative;\n width: 100%;\n max-width: 450px;\n background: white;\n border-radius: 12px;\n box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);\n z-index: 1;\n max-height: calc(100vh - 3rem);\n display: flex;\n flex-direction: column;\n margin: auto;\n}\n.atm-profile-header {\n padding: 16px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n align-items: center;\n}\n.atm-profile-close {\n background: none;\n border: none;\n font-size: 24px;\n cursor: pointer;\n padding: 8px;\n margin-right: 12px;\n color: #666;\n}\n.atm-profile-title {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #333;\n}\n.atm-profile-tabs {\n display: flex;\n border-bottom: 1px solid #f0f0f0;\n background: #f8f9fa;\n}\n.atm-tab {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 12px 16px;\n background: none;\n border: none;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n color: #666;\n transition: all 0.2s;\n}\n.atm-tab:hover {\n background: #e9ecef;\n}\n.atm-tab-active {\n color: var(--v1982ae74) !important;\n background: white;\n border-bottom: 2px solid var(--v1982ae74);\n}\n.atm-tab-icon {\n width: 16px;\n height: 16px;\n}\n.atm-profile-body {\n padding: 24px;\n text-align: center;\n overflow-y: auto;\n flex: 1;\n min-height: 0;\n}\n.atm-profile-avatar-large {\n width: 80px;\n height: 80px;\n border-radius: 50%;\n background-color: var(--v1982ae74);\n color: white;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 24px;\n font-weight: 600;\n margin: 0 auto 20px;\n}\n.atm-profile-info-grid {\n width: 100%;\n text-align: left;\n margin-top: 20px;\n}\n.atm-profile-info-row {\n display: flex;\n flex-direction: column;\n margin-bottom: 16px;\n}\n.atm-profile-info-label {\n font-size: 13px;\n color: #666;\n margin-bottom: 4px;\n}\n.atm-profile-info-value {\n font-size: 16px;\n color: #333;\n font-weight: 500;\n}\n.atm-profile-edit-form {\n width: 100%;\n text-align: left;\n margin-top: 20px;\n}\n.atm-form-group {\n margin-bottom: 16px;\n}\n.atm-input-label {\n display: block;\n margin-bottom: 6px;\n font-size: 13px;\n color: #555;\n font-weight: 500;\n}\n.atm-input-field {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n box-sizing: border-box;\n transition: border-color 0.2s;\n}\n.atm-input-field:focus {\n outline: none;\n border-color: var(--v1982ae74);\n box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);\n}\n.atm-form-actions {\n display: flex;\n gap: 12px;\n margin-top: 24px;\n}\n.atm-save-btn,\n.atm-edit-profile-btn,\n.atm-reset-password-btn,\n.atm-add-email-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px;\n background: var(--v1982ae74);\n color: #FFF;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n justify-content: center;\n}\n.atm-save-btn:hover,\n.atm-edit-profile-btn:hover,\n.atm-reset-password-btn:hover,\n.atm-add-email-btn:hover {\n opacity: 0.9;\n}\n.atm-cancel-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n padding: 12px;\n background: #f8f9fa;\n color: #666;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n justify-content: center;\n}\n.atm-cancel-btn:hover {\n background: #e9ecef;\n}\n.atm-btn-icon {\n width: 16px;\n height: 16px;\n}\n.atm-email-add-section {\n margin-bottom: 24px;\n text-align: left;\n}\n.atm-email-list {\n display: flex;\n flex-direction: column;\n gap: 12px;\n text-align: left;\n}\n.atm-email-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px;\n background: #f8f9fa;\n border-radius: 6px;\n border: 1px solid #e9ecef;\n}\n.atm-email-info {\n display: flex;\n flex-direction: column;\n gap: 8px;\n flex: 1;\n}\n.atm-email-address {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.atm-email-icon {\n width: 16px;\n height: 16px;\n color: var(--c7d31cfc);\n}\n.atm-email-badges {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n}\n.atm-badge {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 500;\n border-radius: 12px;\n text-transform: uppercase;\n}\n.atm-badge-icon {\n width: 12px;\n height: 12px;\n}\n.atm-badge-primary {\n background: #e3f2fd;\n color: #1976d2;\n}\n.atm-badge-verified {\n background: #e8f5e8;\n color: #2e7d32;\n}\n.atm-badge-unverified {\n background: #fff3e0;\n color: #f57c00;\n}\n.atm-email-actions {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.atm-verify-btn {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 12px;\n background: var(--v1982ae74);\n color: white;\n border: none;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n}\n.atm-verify-btn:hover {\n opacity: 0.9;\n}\n.atm-delete-btn {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 12px;\n background: #dc3545;\n color: white;\n border: none;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n}\n.atm-delete-btn:hover {\n opacity: 0.9;\n}\n.atm-password-section {\n text-align: left;\n}\n.atm-sessions-section {\n text-align: left;\n}\n.atm-sessions-info {\n margin-bottom: 20px;\n}\n.atm-sessions-description {\n margin: 0;\n font-size: 14px;\n color: #666;\n line-height: 1.5;\n}\n.atm-sessions-list {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n.atm-session-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n background: #f8f9fa;\n border-radius: 8px;\n border: 1px solid #e9ecef;\n gap: 16px;\n}\n.atm-session-header {\n display: flex;\n gap: 12px;\n align-items: flex-start;\n}\n.atm-session-icon {\n width: 24px;\n height: 24px;\n color: var(--c7d31cfc);\n flex-shrink: 0;\n}\n.atm-session-details {\n flex: 1;\n min-width: 0;\n}\n.atm-session-title {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 4px;\n font-size: 15px;\n font-weight: 600;\n color: #333;\n}\n.atm-session-device-info {\n font-size: 13px;\n color: #666;\n margin-bottom: 8px;\n}\n.atm-badge-current {\n background: #d1f4e0;\n color: #0f9d58;\n}\n.atm-session-timestamps {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.atm-session-timestamp {\n display: flex;\n gap: 6px;\n font-size: 13px;\n color: #666;\n}\n.atm-timestamp-label {\n font-weight: 500;\n color: #555;\n}\n.atm-session-actions {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.atm-close-session-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 14px;\n background: #dc3545;\n color: white;\n border: none;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n white-space: nowrap;\n}\n.atm-close-session-btn:hover {\n opacity: 0.9;\n}\n@media (max-width: 768px) {\n.atm-profile-button {\n padding: 6px 10px;\n gap: 6px;\n}\n.atm-profile-name {\n font-size: 13px;\n}\n.atm-profile-menu {\n width: 260px;\n}\n.atm-profile-modal {\n padding: 1rem;\n}\n.atm-profile-content {\n max-width: 90%;\n max-height: calc(100vh - 2rem);\n}\n.atm-profile-header {\n padding: 14px;\n}\n.atm-profile-title {\n font-size: 16px;\n}\n.atm-profile-body {\n padding: 20px;\n}\n.atm-tab {\n padding: 10px 12px;\n font-size: 13px;\n gap: 4px;\n}\n.atm-tab-icon {\n width: 14px;\n height: 14px;\n}\n.atm-profile-avatar-large {\n width: 70px;\n height: 70px;\n font-size: 22px;\n}\n.atm-email-item {\n flex-direction: column;\n gap: 12px;\n align-items: flex-start;\n}\n.atm-email-actions {\n flex-direction: row;\n width: 100%;\n}\n.atm-verify-btn,\n .atm-delete-btn {\n flex: 1;\n justify-content: center;\n}\n.atm-session-item {\n flex-direction: column;\n align-items: flex-start;\n}\n.atm-session-actions {\n width: 100%;\n}\n.atm-close-session-btn {\n width: 100%;\n justify-content: center;\n}\n}\n@media (max-width: 480px) {\n.atm-profile-button {\n padding: 4px 8px;\n gap: 4px;\n}\n.atm-profile-avatar {\n width: 28px;\n height: 28px;\n font-size: 11px;\n}\n.atm-profile-avatar.large {\n width: 40px;\n height: 40px;\n font-size: 14px;\n}\n.atm-profile-name {\n font-size: 12px;\n}\n.atm-profile-arrow {\n width: 14px;\n height: 14px;\n}\n.atm-profile-menu {\n width: calc(100vw - 20px);\n max-width: 240px;\n}\n.atm-profile-info {\n padding: 12px;\n gap: 10px;\n}\n.atm-profile-fullname {\n font-size: 13px;\n}\n.atm-profile-email {\n font-size: 12px;\n}\n.atm-profile-option {\n padding: 8px 12px;\n font-size: 13px;\n gap: 8px;\n}\n.atm-profile-icon {\n width: 16px;\n height: 16px;\n}\n.atm-profile-modal {\n padding: 0.5rem;\n}\n.atm-profile-content {\n max-width: 95%;\n max-height: calc(100vh - 1rem);\n}\n.atm-profile-header {\n padding: 12px;\n}\n.atm-profile-close {\n font-size: 20px;\n padding: 4px;\n margin-right: 8px;\n}\n.atm-profile-title {\n font-size: 15px;\n}\n.atm-profile-body {\n padding: 16px;\n}\n.atm-tab {\n padding: 8px 8px;\n font-size: 12px;\n gap: 3px;\n}\n.atm-tab-icon {\n width: 13px;\n height: 13px;\n}\n.atm-profile-avatar-large {\n width: 60px;\n height: 60px;\n font-size: 20px;\n margin-bottom: 16px;\n}\n.atm-profile-info-label {\n font-size: 12px;\n}\n.atm-profile-info-value {\n font-size: 14px;\n}\n.atm-input-label {\n font-size: 12px;\n}\n.atm-input-field {\n padding: 8px 10px;\n font-size: 13px;\n}\n.atm-form-actions {\n flex-direction: column;\n gap: 8px;\n}\n.atm-save-btn,\n .atm-cancel-btn,\n .atm-edit-profile-btn,\n .atm-reset-password-btn {\n width: 100%;\n padding: 10px;\n font-size: 13px;\n}\n.atm-email-item {\n padding: 10px;\n}\n.atm-email-address {\n font-size: 13px;\n}\n.atm-badge {\n font-size: 10px;\n padding: 2px 6px;\n}\n}\n@media (max-width: 360px) {\n.atm-profile-button {\n padding: 4px 6px;\n}\n.atm-profile-avatar {\n width: 26px;\n height: 26px;\n font-size: 10px;\n}\n.atm-profile-name {\n display: none;\n}\n.atm-profile-menu {\n width: calc(100vw - 16px);\n max-width: 220px;\n}\n.atm-profile-modal {\n padding: 0.25rem;\n}\n.atm-profile-content {\n max-width: 98%;\n max-height: calc(100vh - 0.5rem);\n}\n.atm-profile-body {\n padding: 12px;\n}\n.atm-tab {\n padding: 8px 6px;\n font-size: 11px;\n flex-direction: column;\n gap: 2px;\n}\n.atm-profile-avatar-large {\n width: 50px;\n height: 50px;\n font-size: 18px;\n}\n.atm-email-item {\n padding: 8px;\n}\n}\n\n.atm-auth-buttons[data-v-0c63ecb8] {\n display: flex;\n flex-wrap: wrap;\n gap: 16px;\n}\n@media (max-width: 768px) {\n.atm-auth-buttons[data-v-0c63ecb8] {\n gap: 14px;\n}\n}\n@media (max-width: 480px) {\n.atm-auth-buttons[data-v-0c63ecb8] {\n gap: 12px;\n flex-direction: column;\n}\n}\n@media (max-width: 360px) {\n.atm-auth-buttons[data-v-0c63ecb8] {\n gap: 10px;\n}\n}\n\n.atm-logout-btn[data-v-7157f989] {\n padding: 12px;\n margin-top: 8px;\n background: var(--v2ec0f896);\n color: #FFF;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n min-height: 44px;\n}\n.atm-logout-btn[data-v-7157f989]:hover {\n opacity: 0.9;\n}\n@media (max-width: 768px) {\n.atm-logout-btn[data-v-7157f989] {\n padding: 11px;\n font-size: 13px;\n min-height: 42px;\n}\n}\n@media (max-width: 480px) {\n.atm-logout-btn[data-v-7157f989] {\n padding: 10px;\n font-size: 13px;\n min-height: 40px;\n}\n}\n@media (max-width: 360px) {\n.atm-logout-btn[data-v-7157f989] {\n padding: 9px;\n font-size: 12px;\n min-height: 38px;\n}\n}\n";
6
+ document.head.appendChild(style);
7
+ }
8
+ })();
9
+ "use strict";
10
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
11
+ const vue = require("vue");
12
+ const UniversalCookie = require("universal-cookie");
13
+ const clientJs = require("@autenticar-me/client-js");
14
+ const writeAccessTokenInCookie = (accessToken) => {
15
+ const cookies = new UniversalCookie();
16
+ if (accessToken === null) {
17
+ cookies.remove("atm_access_token");
18
+ } else {
19
+ cookies.set("atm_access_token", accessToken);
20
+ }
21
+ };
22
+ const getAccessToken = async () => {
23
+ const cookies = new UniversalCookie();
24
+ return cookies.get("atm_access_token");
25
+ };
26
+ const writeRefreshTokenInCookie = (refreshToken) => {
27
+ const cookies = new UniversalCookie();
28
+ if (refreshToken === null) {
29
+ cookies.remove("atm_refresh_token");
30
+ } else {
31
+ cookies.set("atm_refresh_token", refreshToken);
32
+ }
33
+ };
34
+ const fetchUser = async (client, user) => {
35
+ let accessToken = await getAccessToken();
36
+ if (accessToken == null) {
37
+ user.value = null;
38
+ return;
39
+ }
40
+ const response = await client.value.account(accessToken).getProfile();
41
+ user.value = {
42
+ id: response.id,
43
+ username: response.username,
44
+ firstName: response.first_name,
45
+ lastName: response.last_name,
46
+ primaryEmailAddress: response.primary_email_address,
47
+ primaryEmailAddressId: response.primary_email_address_id,
48
+ profileImage: response.profile_image,
49
+ attributes: response.attributes.map((atribute) => ({
50
+ key: atribute.key,
51
+ mode: atribute.mode,
52
+ value: atribute.value
53
+ }))
54
+ };
55
+ };
56
+ function useAtm() {
57
+ const ctx = vue.inject("atm");
58
+ if (!ctx) {
59
+ throw new Error("[Autenticar.me] É necessário configurar o plugin no main.ts");
60
+ }
61
+ return ctx;
62
+ }
63
+ function useAuth() {
64
+ const { client, user } = useAtm();
65
+ const signInByAccessToken = async (accessToken) => {
66
+ writeAccessTokenInCookie(accessToken);
67
+ await fetchUser(client, user);
68
+ };
69
+ const logout = async () => {
70
+ const accessToken = await getAccessToken();
71
+ if (accessToken == null) {
72
+ return;
73
+ }
74
+ await client.value.account(accessToken).logout();
75
+ user.value = null;
76
+ writeAccessTokenInCookie(null);
77
+ };
78
+ return {
79
+ user,
80
+ signInByAccessToken,
81
+ getAccessToken,
82
+ fetchUser,
83
+ logout
84
+ };
85
+ }
86
+ const _hoisted_1$8 = { class: "atm-overlay" };
87
+ const _hoisted_2$3 = { class: "atm-modal" };
88
+ const _hoisted_3$3 = { class: "atm-modal-content" };
89
+ const _hoisted_4$3 = {
90
+ key: 0,
91
+ class: "atm-modal-title"
92
+ };
93
+ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
94
+ __name: "Modal",
95
+ props: {
96
+ title: {
97
+ type: String,
98
+ required: false,
99
+ default: null
100
+ },
101
+ maxWidth: {
102
+ type: Number,
103
+ required: false,
104
+ default: 672
105
+ }
106
+ },
107
+ emits: [
108
+ "close"
109
+ ],
110
+ setup(__props, { emit: __emit }) {
111
+ const emit = __emit;
112
+ const close = () => {
113
+ emit("close");
114
+ };
115
+ return (_ctx, _cache) => {
116
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
117
+ vue.createElementVNode("div", {
118
+ class: "atm-container",
119
+ style: vue.normalizeStyle({ maxWidth: `${__props.maxWidth}px` })
120
+ }, [
121
+ _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "atm-fade-layer" }, [
122
+ vue.createElementVNode("div", { class: "atm-fade-bg" })
123
+ ], -1)),
124
+ vue.createElementVNode("div", _hoisted_2$3, [
125
+ vue.createElementVNode("button", {
126
+ class: "atm-close-button",
127
+ onClick: _cache[0] || (_cache[0] = ($event) => close())
128
+ }, [..._cache[1] || (_cache[1] = [
129
+ vue.createElementVNode("svg", {
130
+ class: "atm-icon",
131
+ fill: "none",
132
+ stroke: "currentColor",
133
+ viewBox: "0 0 24 24"
134
+ }, [
135
+ vue.createElementVNode("path", {
136
+ "stroke-linecap": "round",
137
+ "stroke-linejoin": "round",
138
+ "stroke-width": "2",
139
+ d: "M6 18L18 6M6 6l12 12"
140
+ })
141
+ ], -1)
142
+ ])]),
143
+ vue.createElementVNode("div", _hoisted_3$3, [
144
+ __props.title ? (vue.openBlock(), vue.createElementBlock("h3", _hoisted_4$3, vue.toDisplayString(__props.title), 1)) : vue.createCommentVNode("", true),
145
+ vue.createElementVNode("div", null, [
146
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
147
+ ])
148
+ ])
149
+ ])
150
+ ], 4)
151
+ ]);
152
+ };
153
+ }
154
+ });
155
+ const _export_sfc = (sfc, props) => {
156
+ const target = sfc.__vccOpts || sfc;
157
+ for (const [key, val] of props) {
158
+ target[key] = val;
159
+ }
160
+ return target;
161
+ };
162
+ const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-c347df44"]]);
163
+ function useAtmClient() {
164
+ const { client } = useAtm();
165
+ return client.value;
166
+ }
167
+ const DEVICE_TOKEN_KEY = "atm_device_token";
168
+ const getDeviceToken = async (client) => {
169
+ try {
170
+ const storedToken = localStorage.getItem(DEVICE_TOKEN_KEY);
171
+ if (storedToken) {
172
+ return storedToken;
173
+ }
174
+ const response = await fetch(`${client.getProjectUrl()}/api/v1/devices`, {
175
+ method: "POST",
176
+ headers: {
177
+ "accept": "application/json",
178
+ "x-public-key": client.getPublicKey()
179
+ }
180
+ });
181
+ if (!response.ok) {
182
+ const errorBody = await response.json();
183
+ throw new Error(errorBody.message || "Falha ao criar o token do dispositivo.");
184
+ }
185
+ const data = await response.json();
186
+ if (!data.token) {
187
+ throw new Error("O token do dispositivo não foi retornado pelo servidor.");
188
+ }
189
+ localStorage.setItem(DEVICE_TOKEN_KEY, data.token);
190
+ return data.token;
191
+ } catch (error) {
192
+ throw error;
193
+ }
194
+ };
195
+ const _hoisted_1$7 = { class: "atm-login-container" };
196
+ const _hoisted_2$2 = { class: "atm-logo-container" };
197
+ const _hoisted_3$2 = ["src"];
198
+ const _hoisted_4$2 = {
199
+ key: 1,
200
+ class: "atm-logo-placeholder"
201
+ };
202
+ const _hoisted_5$2 = { class: "atm-project-name" };
203
+ const _hoisted_6$2 = { key: 0 };
204
+ const _hoisted_7$2 = {
205
+ key: 0,
206
+ class: "atm-form-group"
207
+ };
208
+ const _hoisted_8$2 = { class: "atm-input-label" };
209
+ const _hoisted_9$2 = ["placeholder", "disabled"];
210
+ const _hoisted_10$2 = {
211
+ key: 0,
212
+ class: "atm-field-error"
213
+ };
214
+ const _hoisted_11$2 = {
215
+ key: 1,
216
+ class: "atm-form-group"
217
+ };
218
+ const _hoisted_12$2 = ["disabled"];
219
+ const _hoisted_13$2 = {
220
+ key: 0,
221
+ class: "atm-field-error"
222
+ };
223
+ const _hoisted_14$2 = {
224
+ class: "atm-alternative-options",
225
+ style: { "margin-top": "4px" }
226
+ };
227
+ const _hoisted_15$2 = ["disabled"];
228
+ const _hoisted_16$2 = {
229
+ key: 2,
230
+ class: "atm-strategy-choice"
231
+ };
232
+ const _hoisted_17$2 = { class: "atm-strategy-buttons" };
233
+ const _hoisted_18$2 = ["onClick", "disabled"];
234
+ const _hoisted_19$2 = { key: 0 };
235
+ const _hoisted_20$2 = {
236
+ key: 3,
237
+ class: "atm-form-group"
238
+ };
239
+ const _hoisted_21$2 = {
240
+ key: 1,
241
+ class: "atm-forgot-password-message",
242
+ style: { "text-align": "center", "color": "#333", "margin-bottom": "16px" }
243
+ };
244
+ const _hoisted_22$2 = ["disabled"];
245
+ const _hoisted_23$2 = { key: 0 };
246
+ const _hoisted_24$2 = {
247
+ key: 1,
248
+ class: "button-spinner"
249
+ };
250
+ const _hoisted_25$2 = { key: 0 };
251
+ const _hoisted_26$2 = { key: 1 };
252
+ const _hoisted_27$2 = { class: "atm-footer-links" };
253
+ const _hoisted_28$1 = { class: "atm-signup-text" };
254
+ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
255
+ __name: "SignIn",
256
+ emits: [
257
+ "completed",
258
+ "sign-up"
259
+ ],
260
+ setup(__props, { emit: __emit }) {
261
+ vue.useCssVars((_ctx) => ({
262
+ "e2d4c99e": atmPrimaryColor.value,
263
+ "v182122ff": atmSecondaryColor.value
264
+ }));
265
+ const emit = __emit;
266
+ const showNotification = vue.inject("showNotification");
267
+ const form = vue.ref({
268
+ emailAddress: "",
269
+ password: ""
270
+ });
271
+ const currentStep = vue.ref("email");
272
+ const signInStep = vue.ref(null);
273
+ const availableStrategies = vue.ref([]);
274
+ const selectedStrategy = vue.ref(null);
275
+ const serverStep = vue.ref(null);
276
+ const isLoading = vue.ref(false);
277
+ const emailInput = vue.ref(null);
278
+ const passwordInput = vue.ref(null);
279
+ const fieldErrors = vue.ref({
280
+ emailAddress: [],
281
+ password: []
282
+ });
283
+ const client = useAtmClient();
284
+ const { signInByAccessToken } = useAuth();
285
+ const { configurations } = useAtm();
286
+ const atmPrimaryColor = vue.computed(() => configurations.value?.design?.primaryColor);
287
+ const atmSecondaryColor = vue.computed(() => configurations.value?.design?.secondaryColor);
288
+ const logoUrl = vue.computed(() => configurations.value?.project?.logo || "");
289
+ const buttonText = vue.computed(() => {
290
+ if (currentStep.value === "email") return "Entrar";
291
+ if (currentStep.value === "choose_strategy") return "";
292
+ if (currentStep.value === "forgot_password_message") return "";
293
+ return "Finalizar";
294
+ });
295
+ const showEmailField = vue.computed(() => currentStep.value === "email" || currentStep.value === "forgot_password_message");
296
+ const showPasswordField = vue.computed(() => currentStep.value === "password");
297
+ const showStrategyChoice = vue.computed(() => currentStep.value === "choose_strategy");
298
+ const labelText = vue.computed(() => {
299
+ if (configurations.value?.username?.enable === false) {
300
+ return "Email";
301
+ }
302
+ return "Email ou Nome de usuário";
303
+ });
304
+ const inputPlaceholder = vue.computed(() => {
305
+ if (configurations.value?.username?.enable === false) {
306
+ return "email@exemplo.com";
307
+ }
308
+ return "email@exemplo.com ou seu username";
309
+ });
310
+ const processAvailableStrategies = (stepData) => {
311
+ const strategies = stepData?.supported?.first_factors || [];
312
+ return {
313
+ password: strategies.find((s) => s.strategy === "password"),
314
+ emailLink: strategies.find((s) => s.strategy === "email_link")
315
+ };
316
+ };
317
+ const clearErrors = () => {
318
+ fieldErrors.value = {
319
+ emailAddress: [],
320
+ password: []
321
+ };
322
+ };
323
+ const handleEmailStep = async () => {
324
+ if (!form.value.emailAddress.trim()) {
325
+ showNotification?.("Email ou nome de usuário é obrigatório");
326
+ return false;
327
+ }
328
+ try {
329
+ const deviceToken = await getDeviceToken(client);
330
+ const stepData = await client.auth().signInByEmailAddress(form.value.emailAddress, deviceToken);
331
+ signInStep.value = stepData;
332
+ serverStep.value = stepData.step;
333
+ const strategies = processAvailableStrategies(stepData);
334
+ if (strategies.password) {
335
+ selectedStrategy.value = strategies.password;
336
+ currentStep.value = "password";
337
+ } else if (strategies.emailLink) {
338
+ availableStrategies.value = [strategies.emailLink].filter(Boolean);
339
+ currentStep.value = "choose_strategy";
340
+ } else {
341
+ showNotification?.("Nenhum método de autenticação disponível");
342
+ return false;
343
+ }
344
+ return true;
345
+ } catch (error) {
346
+ if (error.errors && typeof error.errors === "object") {
347
+ if (error.errors.email_address) {
348
+ fieldErrors.value.emailAddress = error.errors.email_address;
349
+ }
350
+ } else {
351
+ showNotification?.(error.message || "Erro ao verificar email");
352
+ }
353
+ return false;
354
+ }
355
+ };
356
+ const selectStrategy = (strategy) => {
357
+ selectedStrategy.value = strategy;
358
+ currentStep.value = strategy.strategy;
359
+ if (strategy.strategy === "email_link") {
360
+ handleEmailLinkStep();
361
+ }
362
+ };
363
+ const handlePasswordStep = async () => {
364
+ if (!form.value.password.trim()) {
365
+ showNotification?.("Senha é obrigatória");
366
+ return false;
367
+ }
368
+ try {
369
+ if (!signInStep.value) {
370
+ showNotification?.("Estado de autenticação inválido");
371
+ return false;
372
+ }
373
+ if (serverStep.value !== "first_factor") {
374
+ showNotification?.("Etapa inválida para autenticação com senha");
375
+ return false;
376
+ }
377
+ const attemptToken = signInStep.value.sign_in_attempt_token;
378
+ if (!attemptToken) {
379
+ showNotification?.("Token de tentativa não encontrado");
380
+ return false;
381
+ }
382
+ const response = await client.auth().authenticateWithPassword(signInStep.value.id, attemptToken, form.value.password);
383
+ if (response?.step) {
384
+ serverStep.value = response.step;
385
+ signInStep.value = { ...signInStep.value, ...response };
386
+ }
387
+ return true;
388
+ } catch (error) {
389
+ if (error.errors && typeof error.errors === "object") {
390
+ if (error.errors.password) {
391
+ fieldErrors.value.password = error.errors.password;
392
+ }
393
+ } else {
394
+ showNotification?.(error.message || "Senha incorreta");
395
+ }
396
+ return false;
397
+ }
398
+ };
399
+ const handleEmailLinkStep = async () => {
400
+ try {
401
+ await client.auth().sendEmailLink(signInStep.value.id, selectedStrategy.value?.email_address_id);
402
+ showNotification?.("Link de verificação enviado para seu email", "success");
403
+ return true;
404
+ } catch (error) {
405
+ showNotification?.(error.message || "Erro ao enviar link de verificação");
406
+ return false;
407
+ }
408
+ };
409
+ const sendResetPasswordLink = async () => {
410
+ if (!form.value.emailAddress.trim()) {
411
+ showNotification?.("Informe o email para enviar o link de recuperação");
412
+ return;
413
+ }
414
+ try {
415
+ await client.auth().resetPassword({ email_address: form.value.emailAddress });
416
+ currentStep.value = "forgot_password_message";
417
+ } catch (error) {
418
+ showNotification?.(error.message || "Erro ao solicitar recuperação de senha");
419
+ }
420
+ };
421
+ const completeAuthentication = async () => {
422
+ try {
423
+ const attemptToken = signInStep.value.sign_in_attempt_token;
424
+ if (!attemptToken) {
425
+ showNotification?.("Token de tentativa não encontrado");
426
+ isLoading.value = false;
427
+ return;
428
+ }
429
+ const tokens = await client.auth().generateTokens(signInStep.value.id, attemptToken);
430
+ signInByAccessToken(tokens.access_token);
431
+ writeRefreshTokenInCookie(tokens.refresh_token);
432
+ showNotification?.("Login realizado com sucesso!", "success");
433
+ setTimeout(() => {
434
+ emit("completed");
435
+ }, 1e3);
436
+ } catch (error) {
437
+ showNotification?.(error.message || "Erro ao finalizar autenticação");
438
+ isLoading.value = false;
439
+ }
440
+ };
441
+ const submit = async () => {
442
+ if (isLoading.value) return;
443
+ clearErrors();
444
+ try {
445
+ isLoading.value = true;
446
+ let stepSuccess = false;
447
+ let shouldCompleteAuth = false;
448
+ if (currentStep.value === "email") {
449
+ stepSuccess = await handleEmailStep();
450
+ if (stepSuccess) {
451
+ isLoading.value = false;
452
+ }
453
+ } else if (currentStep.value === "password") {
454
+ stepSuccess = await handlePasswordStep();
455
+ if (stepSuccess) {
456
+ shouldCompleteAuth = true;
457
+ }
458
+ } else if (currentStep.value === "choose_strategy") {
459
+ return;
460
+ } else if (currentStep.value === "email_link") {
461
+ return;
462
+ } else if (currentStep.value === "forgot_password_message") {
463
+ return;
464
+ }
465
+ if (shouldCompleteAuth) {
466
+ await completeAuthentication();
467
+ } else if (!stepSuccess) {
468
+ isLoading.value = false;
469
+ }
470
+ } catch (error) {
471
+ if (error.errors && typeof error.errors === "object") {
472
+ const mappedErrors = {};
473
+ if (error.errors.email_address) {
474
+ mappedErrors.emailAddress = error.errors.email_address;
475
+ }
476
+ if (error.errors.password) {
477
+ mappedErrors.password = error.errors.password;
478
+ }
479
+ fieldErrors.value = { ...fieldErrors.value, ...mappedErrors };
480
+ } else {
481
+ showNotification?.(error.message || "Erro durante o processo de login");
482
+ }
483
+ isLoading.value = false;
484
+ }
485
+ };
486
+ const signUp = () => emit("sign-up");
487
+ vue.onMounted(() => {
488
+ vue.nextTick(() => {
489
+ if (emailInput.value) {
490
+ emailInput.value.focus();
491
+ }
492
+ });
493
+ });
494
+ vue.watch(currentStep, (newStep) => {
495
+ vue.nextTick(() => {
496
+ if (newStep === "password" && passwordInput.value) {
497
+ passwordInput.value.focus();
498
+ }
499
+ });
500
+ });
501
+ return (_ctx, _cache) => {
502
+ return vue.unref(configurations) ? (vue.openBlock(), vue.createElementBlock("form", {
503
+ key: 0,
504
+ onSubmit: _cache[4] || (_cache[4] = vue.withModifiers(($event) => submit(), ["prevent"]))
505
+ }, [
506
+ vue.createElementVNode("div", _hoisted_1$7, [
507
+ vue.createElementVNode("div", _hoisted_2$2, [
508
+ logoUrl.value ? (vue.openBlock(), vue.createElementBlock("img", {
509
+ key: 0,
510
+ src: logoUrl.value,
511
+ alt: "Logo",
512
+ class: "atm-logo-image"
513
+ }, null, 8, _hoisted_3$2)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, "Logo"))
514
+ ]),
515
+ vue.createElementVNode("h2", _hoisted_5$2, vue.toDisplayString(vue.unref(configurations).project.name), 1),
516
+ _cache[13] || (_cache[13] = vue.createElementVNode("p", { class: "atm-welcome-text" }, "Bem-vindo de volta! Faça login para continuar", -1)),
517
+ currentStep.value !== "forgot_password_message" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
518
+ showEmailField.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
519
+ vue.createElementVNode("label", _hoisted_8$2, vue.toDisplayString(labelText.value), 1),
520
+ vue.withDirectives(vue.createElementVNode("input", {
521
+ ref_key: "emailInput",
522
+ ref: emailInput,
523
+ type: "text",
524
+ class: "atm-input-field",
525
+ placeholder: inputPlaceholder.value,
526
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.value.emailAddress = $event),
527
+ disabled: currentStep.value !== "email" || isLoading.value
528
+ }, null, 8, _hoisted_9$2), [
529
+ [vue.vModelText, form.value.emailAddress]
530
+ ]),
531
+ fieldErrors.value.emailAddress.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$2, vue.toDisplayString(fieldErrors.value.emailAddress[0]), 1)) : vue.createCommentVNode("", true)
532
+ ])) : vue.createCommentVNode("", true),
533
+ showPasswordField.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$2, [
534
+ _cache[5] || (_cache[5] = vue.createElementVNode("label", { class: "atm-input-label" }, "Senha", -1)),
535
+ vue.withDirectives(vue.createElementVNode("input", {
536
+ ref_key: "passwordInput",
537
+ ref: passwordInput,
538
+ type: "password",
539
+ class: "atm-input-field",
540
+ placeholder: "Digite sua senha",
541
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.value.password = $event),
542
+ disabled: isLoading.value
543
+ }, null, 8, _hoisted_12$2), [
544
+ [vue.vModelText, form.value.password]
545
+ ]),
546
+ fieldErrors.value.password.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$2, vue.toDisplayString(fieldErrors.value.password[0]), 1)) : vue.createCommentVNode("", true),
547
+ vue.createElementVNode("div", _hoisted_14$2, [
548
+ vue.createElementVNode("button", {
549
+ type: "button",
550
+ onClick: _cache[2] || (_cache[2] = ($event) => sendResetPasswordLink()),
551
+ class: "atm-forgot-password-link",
552
+ disabled: isLoading.value
553
+ }, " Esqueci a minha senha ", 8, _hoisted_15$2)
554
+ ])
555
+ ])) : vue.createCommentVNode("", true),
556
+ showStrategyChoice.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$2, [
557
+ _cache[6] || (_cache[6] = vue.createElementVNode("p", { class: "atm-strategy-title" }, "Escolha como deseja fazer login:", -1)),
558
+ vue.createElementVNode("div", _hoisted_17$2, [
559
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(availableStrategies.value, (strategy) => {
560
+ return vue.openBlock(), vue.createElementBlock("button", {
561
+ key: strategy.strategy,
562
+ onClick: ($event) => selectStrategy(strategy),
563
+ type: "button",
564
+ class: "atm-strategy-button",
565
+ disabled: isLoading.value
566
+ }, [
567
+ strategy.strategy === "email_link" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_19$2, "Usar link por email")) : vue.createCommentVNode("", true)
568
+ ], 8, _hoisted_18$2);
569
+ }), 128))
570
+ ])
571
+ ])) : vue.createCommentVNode("", true),
572
+ currentStep.value === "email_link" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_20$2, [..._cache[7] || (_cache[7] = [
573
+ vue.createElementVNode("p", { class: "atm-email-link-text" }, " Link de verificação enviado para seu email. Verifique sua caixa de entrada. ", -1)
574
+ ])])) : vue.createCommentVNode("", true)
575
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_21$2, [
576
+ vue.createElementVNode("p", null, [
577
+ _cache[8] || (_cache[8] = vue.createTextVNode("Foi enviado um link para resetar a senha para o email ", -1)),
578
+ vue.createElementVNode("strong", null, vue.toDisplayString(form.value.emailAddress), 1),
579
+ _cache[9] || (_cache[9] = vue.createTextVNode(". Verifique sua caixa de entrada.", -1))
580
+ ])
581
+ ])),
582
+ buttonText.value ? (vue.openBlock(), vue.createElementBlock("button", {
583
+ key: 2,
584
+ type: "submit",
585
+ class: "atm-login-button",
586
+ disabled: isLoading.value
587
+ }, [
588
+ !isLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_23$2, vue.toDisplayString(buttonText.value), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_24$2, [
589
+ _cache[10] || (_cache[10] = vue.createElementVNode("svg", {
590
+ class: "spinner-svg",
591
+ viewBox: "0 0 50 50"
592
+ }, [
593
+ vue.createElementVNode("circle", {
594
+ class: "spinner-circle",
595
+ cx: "25",
596
+ cy: "25",
597
+ r: "20",
598
+ fill: "none",
599
+ "stroke-width": "5"
600
+ })
601
+ ], -1)),
602
+ currentStep.value === "email" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_25$2, "Verificando...")) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_26$2, "Entrando..."))
603
+ ]))
604
+ ], 8, _hoisted_22$2)) : vue.createCommentVNode("", true),
605
+ vue.createElementVNode("div", _hoisted_27$2, [
606
+ vue.createElementVNode("p", _hoisted_28$1, [
607
+ _cache[11] || (_cache[11] = vue.createTextVNode(" Ainda não tem uma conta? ", -1)),
608
+ vue.createElementVNode("a", {
609
+ onClick: _cache[3] || (_cache[3] = ($event) => signUp()),
610
+ class: "atm-signup-link"
611
+ }, "Cadastre aqui")
612
+ ]),
613
+ _cache[12] || (_cache[12] = vue.createElementVNode("p", { class: "atm-powered-by" }, [
614
+ vue.createTextVNode(" Secured by "),
615
+ vue.createElementVNode("strong", null, "Autenticar.me")
616
+ ], -1))
617
+ ])
618
+ ])
619
+ ], 32)) : vue.createCommentVNode("", true);
620
+ };
621
+ }
622
+ });
623
+ const SignIn = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-69af412a"]]);
624
+ const _hoisted_1$6 = {
625
+ key: 0,
626
+ class: "atm-notification-container"
627
+ };
628
+ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
629
+ __name: "Notification",
630
+ props: {
631
+ show: { type: Boolean },
632
+ message: {},
633
+ type: { default: "error" }
634
+ },
635
+ setup(__props) {
636
+ return (_ctx, _cache) => {
637
+ return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
638
+ vue.createVNode(vue.Transition, { name: "atm-notification" }, {
639
+ default: vue.withCtx(() => [
640
+ __props.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
641
+ vue.createElementVNode("div", {
642
+ class: vue.normalizeClass(["atm-notification", `atm-notification--${__props.type}`])
643
+ }, vue.toDisplayString(__props.message), 3)
644
+ ])) : vue.createCommentVNode("", true)
645
+ ]),
646
+ _: 1
647
+ })
648
+ ]);
649
+ };
650
+ }
651
+ });
652
+ const Notification = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-f5e47084"]]);
653
+ const _hoisted_1$5 = { class: "atm-signup-container" };
654
+ const _hoisted_2$1 = { class: "atm-logo-container" };
655
+ const _hoisted_3$1 = ["src"];
656
+ const _hoisted_4$1 = {
657
+ key: 1,
658
+ class: "atm-logo-placeholder"
659
+ };
660
+ const _hoisted_5$1 = { class: "atm-project-name" };
661
+ const _hoisted_6$1 = {
662
+ key: 0,
663
+ class: "atm-form-group"
664
+ };
665
+ const _hoisted_7$1 = { class: "atm-input-label" };
666
+ const _hoisted_8$1 = ["disabled"];
667
+ const _hoisted_9$1 = {
668
+ key: 0,
669
+ class: "atm-field-error"
670
+ };
671
+ const _hoisted_10$1 = {
672
+ key: 1,
673
+ class: "atm-form-group"
674
+ };
675
+ const _hoisted_11$1 = { class: "atm-input-label" };
676
+ const _hoisted_12$1 = ["disabled"];
677
+ const _hoisted_13$1 = {
678
+ key: 0,
679
+ class: "atm-field-error"
680
+ };
681
+ const _hoisted_14$1 = { class: "atm-form-group" };
682
+ const _hoisted_15$1 = ["disabled"];
683
+ const _hoisted_16$1 = {
684
+ key: 0,
685
+ class: "atm-field-error"
686
+ };
687
+ const _hoisted_17$1 = {
688
+ key: 2,
689
+ class: "atm-form-group"
690
+ };
691
+ const _hoisted_18$1 = ["disabled"];
692
+ const _hoisted_19$1 = {
693
+ key: 0,
694
+ class: "atm-field-error"
695
+ };
696
+ const _hoisted_20$1 = {
697
+ key: 3,
698
+ class: "atm-form-group"
699
+ };
700
+ const _hoisted_21$1 = ["disabled"];
701
+ const _hoisted_22$1 = {
702
+ key: 0,
703
+ class: "atm-field-error"
704
+ };
705
+ const _hoisted_23$1 = ["disabled"];
706
+ const _hoisted_24$1 = { key: 0 };
707
+ const _hoisted_25$1 = {
708
+ key: 1,
709
+ class: "button-spinner"
710
+ };
711
+ const _hoisted_26$1 = { class: "atm-footer-links" };
712
+ const _hoisted_27$1 = { class: "atm-login-text" };
713
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
714
+ __name: "SignUp",
715
+ emits: ["completed", "sign-in"],
716
+ setup(__props, { emit: __emit }) {
717
+ vue.useCssVars((_ctx) => ({
718
+ "v8c008960": atmPrimaryColor.value,
719
+ "v1183b75e": atmSecondaryColor.value
720
+ }));
721
+ const emit = __emit;
722
+ const { configurations } = useAtm();
723
+ const form = vue.ref({
724
+ first_name: "",
725
+ last_name: "",
726
+ email_address: "",
727
+ password: "",
728
+ confirm_password: ""
729
+ });
730
+ const notification = vue.ref({
731
+ show: false,
732
+ message: "",
733
+ type: "error"
734
+ });
735
+ const isLoading = vue.ref(false);
736
+ const firstNameInput = vue.ref(null);
737
+ const emailInput = vue.ref(null);
738
+ const fieldErrors = vue.ref({
739
+ first_name: [],
740
+ last_name: [],
741
+ email_address: [],
742
+ password: [],
743
+ confirm_password: []
744
+ });
745
+ const showNotification = (message, type = "error") => {
746
+ notification.value = {
747
+ show: true,
748
+ message,
749
+ type
750
+ };
751
+ setTimeout(() => {
752
+ notification.value.show = false;
753
+ }, 3e3);
754
+ };
755
+ vue.onMounted(() => {
756
+ vue.nextTick(() => {
757
+ if (hasFirstName.value && firstNameInput.value) {
758
+ firstNameInput.value.focus();
759
+ } else if (emailInput.value) {
760
+ emailInput.value.focus();
761
+ }
762
+ });
763
+ });
764
+ const atmPrimaryColor = vue.computed(() => configurations.value?.design?.primaryColor);
765
+ const atmSecondaryColor = vue.computed(() => configurations.value?.design?.secondaryColor);
766
+ const logoUrl = vue.computed(() => configurations.value?.project?.logo || "");
767
+ const hasFirstName = vue.computed(() => configurations.value?.firstName?.required === true);
768
+ const hasLastName = vue.computed(() => configurations.value?.lastName?.required === true);
769
+ const hasPassword = vue.computed(() => configurations.value?.password?.enable !== false);
770
+ const lengthConfig = vue.computed(() => configurations.value?.password?.length);
771
+ const validatePassword = () => {
772
+ const password = form.value.password;
773
+ const minLength = lengthConfig.value?.min ?? 8;
774
+ const maxLength = lengthConfig.value?.max ?? 64;
775
+ if (password.length < minLength) {
776
+ return `Senha deve ter pelo menos ${minLength} caracteres`;
777
+ }
778
+ if (password.length > maxLength) {
779
+ return `Senha deve ter no máximo ${maxLength} caracteres`;
780
+ }
781
+ if (configurations.value?.password?.uppercase && !/[A-Z]/.test(password)) {
782
+ return "Senha deve conter pelo menos uma letra maiúscula";
783
+ }
784
+ if (configurations.value?.password?.lowercase && !/[a-z]/.test(password)) {
785
+ return "Senha deve conter pelo menos uma letra minúscula";
786
+ }
787
+ if (configurations.value?.password?.numbers && !/\d/.test(password)) {
788
+ return "Senha deve conter pelo menos um número";
789
+ }
790
+ if (configurations.value?.password?.symbols && !/[!@#$%^&*(),.?":{}|<>]/.test(password)) {
791
+ return "Senha deve conter pelo menos um símbolo especial";
792
+ }
793
+ return null;
794
+ };
795
+ const client = useAtmClient();
796
+ const { signInByAccessToken } = useAuth();
797
+ const clearErrors = () => {
798
+ fieldErrors.value = {
799
+ first_name: [],
800
+ last_name: [],
801
+ email_address: [],
802
+ password: [],
803
+ confirm_password: []
804
+ };
805
+ };
806
+ const submit = async () => {
807
+ if (isLoading.value) return;
808
+ clearErrors();
809
+ if (hasFirstName.value && !form.value.first_name.trim()) {
810
+ showNotification("Nome é obrigatório");
811
+ return;
812
+ }
813
+ if (hasLastName.value && !form.value.last_name.trim()) {
814
+ showNotification("Sobrenome é obrigatório");
815
+ return;
816
+ }
817
+ if (!form.value.email_address.trim()) {
818
+ showNotification("Email é obrigatório");
819
+ return;
820
+ }
821
+ if (hasPassword.value) {
822
+ if (!form.value.password.trim()) {
823
+ showNotification("Senha é obrigatória");
824
+ return;
825
+ }
826
+ const passwordError = validatePassword();
827
+ if (passwordError) {
828
+ showNotification(passwordError);
829
+ return;
830
+ }
831
+ if (!form.value.confirm_password.trim()) {
832
+ showNotification("Confirmação de senha é obrigatória");
833
+ return;
834
+ }
835
+ if (form.value.password !== form.value.confirm_password) {
836
+ showNotification("Senhas não coincidem");
837
+ return;
838
+ }
839
+ }
840
+ try {
841
+ isLoading.value = true;
842
+ await client.auth().register({
843
+ first_name: form.value.first_name,
844
+ last_name: form.value.last_name,
845
+ email_address: form.value.email_address,
846
+ password: form.value.password
847
+ });
848
+ showNotification("Conta criada com sucesso!", "success");
849
+ const deviceToken = await getDeviceToken(client);
850
+ const signInStep = await client.auth().signInByEmailAddress(form.value.email_address, deviceToken);
851
+ const attemptToken = signInStep.token;
852
+ if (!attemptToken) {
853
+ throw new Error("Token de tentativa não encontrado");
854
+ }
855
+ await client.auth().authenticateWithPassword(signInStep.id, attemptToken, form.value.password);
856
+ const tokens = await client.auth().generateTokens(signInStep.id, attemptToken);
857
+ signInByAccessToken(tokens.access_token);
858
+ writeRefreshTokenInCookie(tokens.refresh_token);
859
+ showNotification("Login realizado com sucesso!", "success");
860
+ setTimeout(() => {
861
+ emit("completed");
862
+ }, 1e3);
863
+ } catch (error) {
864
+ if (error.errors && typeof error.errors === "object") {
865
+ fieldErrors.value = { ...fieldErrors.value, ...error.errors };
866
+ } else {
867
+ showNotification(error.message || "Erro ao registrar usuário", "error");
868
+ }
869
+ isLoading.value = false;
870
+ }
871
+ };
872
+ const signIn = () => emit("sign-in");
873
+ return (_ctx, _cache) => {
874
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
875
+ vue.createVNode(Notification, {
876
+ show: notification.value.show,
877
+ message: notification.value.message,
878
+ type: notification.value.type
879
+ }, null, 8, ["show", "message", "type"]),
880
+ vue.unref(configurations) ? (vue.openBlock(), vue.createElementBlock("form", {
881
+ key: 0,
882
+ onSubmit: vue.withModifiers(submit, ["prevent"])
883
+ }, [
884
+ vue.createElementVNode("div", _hoisted_1$5, [
885
+ vue.createElementVNode("div", _hoisted_2$1, [
886
+ logoUrl.value ? (vue.openBlock(), vue.createElementBlock("img", {
887
+ key: 0,
888
+ src: logoUrl.value,
889
+ alt: "Logo",
890
+ class: "atm-logo-image"
891
+ }, null, 8, _hoisted_3$1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, "Logo"))
892
+ ]),
893
+ vue.createElementVNode("h2", _hoisted_5$1, vue.toDisplayString(vue.unref(configurations).project.name), 1),
894
+ _cache[11] || (_cache[11] = vue.createElementVNode("p", { class: "atm-welcome-text" }, "Crie sua conta para começar", -1)),
895
+ hasFirstName.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, [
896
+ vue.createElementVNode("label", _hoisted_7$1, " Primeiro Nome " + vue.toDisplayString(vue.unref(configurations).firstName?.required ? "*" : ""), 1),
897
+ vue.withDirectives(vue.createElementVNode("input", {
898
+ ref_key: "firstNameInput",
899
+ ref: firstNameInput,
900
+ type: "text",
901
+ class: "atm-input-field",
902
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.value.first_name = $event),
903
+ placeholder: "Digite seu primeiro nome",
904
+ disabled: isLoading.value
905
+ }, null, 8, _hoisted_8$1), [
906
+ [vue.vModelText, form.value.first_name]
907
+ ]),
908
+ fieldErrors.value.first_name.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, vue.toDisplayString(fieldErrors.value.first_name[0]), 1)) : vue.createCommentVNode("", true)
909
+ ])) : vue.createCommentVNode("", true),
910
+ hasLastName.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$1, [
911
+ vue.createElementVNode("label", _hoisted_11$1, " Sobrenome " + vue.toDisplayString(vue.unref(configurations).lastName?.required ? "*" : ""), 1),
912
+ vue.withDirectives(vue.createElementVNode("input", {
913
+ type: "text",
914
+ class: "atm-input-field",
915
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.value.last_name = $event),
916
+ placeholder: "Digite seu sobrenome",
917
+ disabled: isLoading.value
918
+ }, null, 8, _hoisted_12$1), [
919
+ [vue.vModelText, form.value.last_name]
920
+ ]),
921
+ fieldErrors.value.last_name.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, vue.toDisplayString(fieldErrors.value.last_name[0]), 1)) : vue.createCommentVNode("", true)
922
+ ])) : vue.createCommentVNode("", true),
923
+ vue.createElementVNode("div", _hoisted_14$1, [
924
+ _cache[5] || (_cache[5] = vue.createElementVNode("label", { class: "atm-input-label" }, "Email ou Nome de usuário *", -1)),
925
+ vue.withDirectives(vue.createElementVNode("input", {
926
+ ref_key: "emailInput",
927
+ ref: emailInput,
928
+ type: "text",
929
+ class: "atm-input-field",
930
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form.value.email_address = $event),
931
+ placeholder: "email@exemplo.com ou seuusername",
932
+ disabled: isLoading.value
933
+ }, null, 8, _hoisted_15$1), [
934
+ [vue.vModelText, form.value.email_address]
935
+ ]),
936
+ fieldErrors.value.email_address.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$1, vue.toDisplayString(fieldErrors.value.email_address[0]), 1)) : vue.createCommentVNode("", true)
937
+ ]),
938
+ hasPassword.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$1, [
939
+ _cache[6] || (_cache[6] = vue.createElementVNode("label", { class: "atm-input-label" }, "Senha *", -1)),
940
+ vue.withDirectives(vue.createElementVNode("input", {
941
+ type: "password",
942
+ class: "atm-input-field",
943
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => form.value.password = $event),
944
+ placeholder: "",
945
+ disabled: isLoading.value
946
+ }, null, 8, _hoisted_18$1), [
947
+ [vue.vModelText, form.value.password]
948
+ ]),
949
+ fieldErrors.value.password.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19$1, vue.toDisplayString(fieldErrors.value.password[0]), 1)) : vue.createCommentVNode("", true)
950
+ ])) : vue.createCommentVNode("", true),
951
+ hasPassword.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_20$1, [
952
+ _cache[7] || (_cache[7] = vue.createElementVNode("label", { class: "atm-input-label" }, "Confirmar Senha *", -1)),
953
+ vue.withDirectives(vue.createElementVNode("input", {
954
+ type: "password",
955
+ class: "atm-input-field",
956
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => form.value.confirm_password = $event),
957
+ placeholder: "",
958
+ disabled: isLoading.value
959
+ }, null, 8, _hoisted_21$1), [
960
+ [vue.vModelText, form.value.confirm_password]
961
+ ]),
962
+ fieldErrors.value.confirm_password.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22$1, vue.toDisplayString(fieldErrors.value.confirm_password[0]), 1)) : vue.createCommentVNode("", true)
963
+ ])) : vue.createCommentVNode("", true),
964
+ vue.createElementVNode("button", {
965
+ type: "submit",
966
+ class: "atm-signup-button",
967
+ disabled: isLoading.value
968
+ }, [
969
+ !isLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_24$1, "Criar Conta")) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_25$1, [..._cache[8] || (_cache[8] = [
970
+ vue.createElementVNode("svg", {
971
+ class: "spinner-svg",
972
+ viewBox: "0 0 50 50"
973
+ }, [
974
+ vue.createElementVNode("circle", {
975
+ class: "spinner-circle",
976
+ cx: "25",
977
+ cy: "25",
978
+ r: "20",
979
+ fill: "none",
980
+ "stroke-width": "5"
981
+ })
982
+ ], -1),
983
+ vue.createTextVNode(" Criando... ", -1)
984
+ ])]))
985
+ ], 8, _hoisted_23$1),
986
+ vue.createElementVNode("div", _hoisted_26$1, [
987
+ vue.createElementVNode("p", _hoisted_27$1, [
988
+ _cache[9] || (_cache[9] = vue.createTextVNode(" Já tem uma conta? ", -1)),
989
+ vue.createElementVNode("a", {
990
+ onClick: signIn,
991
+ class: vue.normalizeClass(["atm-login-link", { "disabled-link": isLoading.value }])
992
+ }, "Faça login", 2)
993
+ ]),
994
+ _cache[10] || (_cache[10] = vue.createElementVNode("p", { class: "atm-powered-by" }, [
995
+ vue.createTextVNode("Secured by "),
996
+ vue.createElementVNode("strong", null, "Autenticar.me")
997
+ ], -1))
998
+ ])
999
+ ])
1000
+ ], 32)) : vue.createCommentVNode("", true)
1001
+ ], 64);
1002
+ };
1003
+ }
1004
+ });
1005
+ const SignUp = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-de716df2"]]);
1006
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
1007
+ __name: "SignInModal",
1008
+ emits: [
1009
+ "close"
1010
+ ],
1011
+ setup(__props, { emit: __emit }) {
1012
+ const emit = __emit;
1013
+ const close = () => {
1014
+ emit("close");
1015
+ };
1016
+ const component = vue.ref("sign-in");
1017
+ const signUp = () => component.value = "sign-up";
1018
+ const signIn = () => component.value = "sign-in";
1019
+ const windowWidth = vue.ref(typeof window !== "undefined" ? window.innerWidth : 1024);
1020
+ const maxWidth = vue.computed(() => {
1021
+ if (windowWidth.value <= 360) return 340;
1022
+ if (windowWidth.value <= 480) return windowWidth.value - 20;
1023
+ if (windowWidth.value <= 768) return 400;
1024
+ return 420;
1025
+ });
1026
+ const updateWidth = () => {
1027
+ windowWidth.value = window.innerWidth;
1028
+ };
1029
+ vue.onMounted(() => {
1030
+ window.addEventListener("resize", updateWidth);
1031
+ });
1032
+ vue.onUnmounted(() => {
1033
+ window.removeEventListener("resize", updateWidth);
1034
+ });
1035
+ return (_ctx, _cache) => {
1036
+ return vue.openBlock(), vue.createBlock(Modal, {
1037
+ "max-width": maxWidth.value,
1038
+ onClose: _cache[4] || (_cache[4] = ($event) => close())
1039
+ }, {
1040
+ default: vue.withCtx(() => [
1041
+ component.value === "sign-in" ? (vue.openBlock(), vue.createBlock(SignIn, {
1042
+ key: 0,
1043
+ onSignUp: _cache[0] || (_cache[0] = ($event) => signUp()),
1044
+ onCompleted: _cache[1] || (_cache[1] = ($event) => close())
1045
+ })) : vue.createCommentVNode("", true),
1046
+ component.value === "sign-up" ? (vue.openBlock(), vue.createBlock(SignUp, {
1047
+ key: 1,
1048
+ onSignIn: _cache[2] || (_cache[2] = ($event) => signIn()),
1049
+ onCompleted: _cache[3] || (_cache[3] = ($event) => close())
1050
+ })) : vue.createCommentVNode("", true)
1051
+ ]),
1052
+ _: 1
1053
+ }, 8, ["max-width"]);
1054
+ };
1055
+ }
1056
+ });
1057
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
1058
+ __name: "SignInButton",
1059
+ setup(__props) {
1060
+ vue.useCssVars((_ctx) => ({
1061
+ "v0f0ded3a": atmPrimaryColor.value
1062
+ }));
1063
+ const showSignInModal = vue.ref(false);
1064
+ const { configurations } = useAtm();
1065
+ const atmPrimaryColor = vue.computed(() => configurations.value?.design?.primaryColor);
1066
+ const notification = vue.ref({
1067
+ show: false,
1068
+ message: "",
1069
+ type: "error"
1070
+ });
1071
+ const showNotification = (message, type = "error") => {
1072
+ notification.value = {
1073
+ show: true,
1074
+ message,
1075
+ type
1076
+ };
1077
+ setTimeout(() => {
1078
+ notification.value.show = false;
1079
+ }, 3e3);
1080
+ };
1081
+ vue.provide("showNotification", showNotification);
1082
+ const signIn = () => {
1083
+ showSignInModal.value = true;
1084
+ };
1085
+ return (_ctx, _cache) => {
1086
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1087
+ vue.createVNode(Notification, {
1088
+ show: notification.value.show,
1089
+ message: notification.value.message,
1090
+ type: notification.value.type
1091
+ }, null, 8, ["show", "message", "type"]),
1092
+ showSignInModal.value ? (vue.openBlock(), vue.createBlock(_sfc_main$8, {
1093
+ key: 0,
1094
+ onClose: _cache[0] || (_cache[0] = () => showSignInModal.value = false)
1095
+ })) : vue.createCommentVNode("", true),
1096
+ vue.createElementVNode("button", {
1097
+ onClick: _cache[1] || (_cache[1] = ($event) => signIn()),
1098
+ class: "atm-signin-btn"
1099
+ }, " Entrar ")
1100
+ ], 64);
1101
+ };
1102
+ }
1103
+ });
1104
+ const SignInButton = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-4139c6d0"]]);
1105
+ const _hoisted_1$4 = {
1106
+ key: 2,
1107
+ style: { "padding": "24px", "text-align": "center" }
1108
+ };
1109
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
1110
+ __name: "SignUpModal",
1111
+ emits: [
1112
+ "close"
1113
+ ],
1114
+ setup(__props, { emit: __emit }) {
1115
+ const { configurations } = useAtm();
1116
+ const emit = __emit;
1117
+ const close = () => {
1118
+ emit("close");
1119
+ };
1120
+ const component = vue.ref("sign-up");
1121
+ const isRegistrationAllowed = vue.computed(() => configurations.value?.register?.enable !== false);
1122
+ const signUp = () => component.value = "sign-up";
1123
+ const signIn = () => component.value = "sign-in";
1124
+ const windowWidth = vue.ref(typeof window !== "undefined" ? window.innerWidth : 1024);
1125
+ const maxWidth = vue.computed(() => {
1126
+ if (windowWidth.value <= 360) return 340;
1127
+ if (windowWidth.value <= 480) return windowWidth.value - 20;
1128
+ if (windowWidth.value <= 768) return 400;
1129
+ return 420;
1130
+ });
1131
+ const updateWidth = () => {
1132
+ windowWidth.value = window.innerWidth;
1133
+ };
1134
+ vue.onMounted(() => {
1135
+ window.addEventListener("resize", updateWidth);
1136
+ });
1137
+ vue.onUnmounted(() => {
1138
+ window.removeEventListener("resize", updateWidth);
1139
+ });
1140
+ return (_ctx, _cache) => {
1141
+ return vue.openBlock(), vue.createBlock(Modal, {
1142
+ "max-width": maxWidth.value,
1143
+ onClose: _cache[5] || (_cache[5] = ($event) => close())
1144
+ }, {
1145
+ default: vue.withCtx(() => [
1146
+ component.value === "sign-in" ? (vue.openBlock(), vue.createBlock(SignIn, {
1147
+ key: 0,
1148
+ onSignUp: _cache[0] || (_cache[0] = ($event) => signUp()),
1149
+ onCompleted: _cache[1] || (_cache[1] = ($event) => close())
1150
+ })) : vue.createCommentVNode("", true),
1151
+ component.value === "sign-up" && isRegistrationAllowed.value ? (vue.openBlock(), vue.createBlock(SignUp, {
1152
+ key: 1,
1153
+ onSignIn: _cache[2] || (_cache[2] = ($event) => signIn()),
1154
+ onCompleted: _cache[3] || (_cache[3] = ($event) => close())
1155
+ })) : component.value === "sign-up" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
1156
+ _cache[6] || (_cache[6] = vue.createElementVNode("p", { style: { "margin-bottom": "16px" } }, "Registro não está disponível no momento", -1)),
1157
+ vue.createElementVNode("button", {
1158
+ onClick: _cache[4] || (_cache[4] = ($event) => signIn()),
1159
+ style: { "padding": "12px 24px", "background": "#007bff", "color": "white", "border": "none", "border-radius": "6px", "cursor": "pointer" }
1160
+ }, "Fazer login")
1161
+ ])) : vue.createCommentVNode("", true)
1162
+ ]),
1163
+ _: 1
1164
+ }, 8, ["max-width"]);
1165
+ };
1166
+ }
1167
+ });
1168
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
1169
+ __name: "SignUpButton",
1170
+ setup(__props) {
1171
+ vue.useCssVars((_ctx) => ({
1172
+ "v1112fbaa": atmPrimaryColor.value
1173
+ }));
1174
+ const showSignUpModal = vue.ref(false);
1175
+ const { configurations } = useAtm();
1176
+ const atmPrimaryColor = vue.computed(() => configurations.value?.design?.primaryColor);
1177
+ const isRegistrationAllowed = vue.computed(() => configurations.value?.register?.enable !== false);
1178
+ const signUp = () => {
1179
+ showSignUpModal.value = true;
1180
+ };
1181
+ return (_ctx, _cache) => {
1182
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1183
+ showSignUpModal.value ? (vue.openBlock(), vue.createBlock(_sfc_main$6, {
1184
+ key: 0,
1185
+ onClose: _cache[0] || (_cache[0] = () => showSignUpModal.value = false)
1186
+ })) : vue.createCommentVNode("", true),
1187
+ isRegistrationAllowed.value ? (vue.openBlock(), vue.createElementBlock("button", {
1188
+ key: 1,
1189
+ onClick: _cache[1] || (_cache[1] = ($event) => signUp()),
1190
+ class: "atm-signup-btn"
1191
+ }, " Cadastrar-se ")) : vue.createCommentVNode("", true)
1192
+ ], 64);
1193
+ };
1194
+ }
1195
+ });
1196
+ const SignUpButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-959aa7ef"]]);
1197
+ const _hoisted_1$3 = {
1198
+ key: 0,
1199
+ class: "atm-profile-container"
1200
+ };
1201
+ const _hoisted_2 = ["src"];
1202
+ const _hoisted_3 = { key: 1 };
1203
+ const _hoisted_4 = {
1204
+ key: 2,
1205
+ viewBox: "0 0 24 24",
1206
+ class: "atm-btn-icon",
1207
+ style: { "width": "20px", "height": "20px", "color": "white" }
1208
+ };
1209
+ const _hoisted_5 = {
1210
+ key: 0,
1211
+ class: "atm-profile-name"
1212
+ };
1213
+ const _hoisted_6 = {
1214
+ key: 0,
1215
+ class: "atm-profile-menu"
1216
+ };
1217
+ const _hoisted_7 = { class: "atm-profile-info" };
1218
+ const _hoisted_8 = ["src"];
1219
+ const _hoisted_9 = { key: 1 };
1220
+ const _hoisted_10 = {
1221
+ key: 2,
1222
+ viewBox: "0 0 24 24",
1223
+ class: "atm-btn-icon",
1224
+ style: { "width": "40px", "height": "40px", "color": "white" }
1225
+ };
1226
+ const _hoisted_11 = { class: "atm-profile-details" };
1227
+ const _hoisted_12 = {
1228
+ key: 0,
1229
+ class: "atm-profile-fullname"
1230
+ };
1231
+ const _hoisted_13 = {
1232
+ key: 1,
1233
+ class: "atm-profile-fullname"
1234
+ };
1235
+ const _hoisted_14 = { class: "atm-profile-email" };
1236
+ const _hoisted_15 = {
1237
+ key: 0,
1238
+ class: "atm-profile-modal",
1239
+ role: "dialog",
1240
+ "aria-modal": "true",
1241
+ "aria-labelledby": "profile-modal-title"
1242
+ };
1243
+ const _hoisted_16 = { class: "atm-profile-content" };
1244
+ const _hoisted_17 = { class: "atm-profile-tabs" };
1245
+ const _hoisted_18 = {
1246
+ key: 0,
1247
+ class: "atm-profile-body"
1248
+ };
1249
+ const _hoisted_19 = ["src"];
1250
+ const _hoisted_20 = { key: 1 };
1251
+ const _hoisted_21 = {
1252
+ key: 2,
1253
+ viewBox: "0 0 24 24",
1254
+ class: "atm-btn-icon",
1255
+ style: { "width": "80px", "height": "80px", "color": "white", "margin": "0 auto" }
1256
+ };
1257
+ const _hoisted_22 = {
1258
+ key: 0,
1259
+ class: "atm-profile-info-grid"
1260
+ };
1261
+ const _hoisted_23 = { class: "atm-profile-info-row" };
1262
+ const _hoisted_24 = {
1263
+ key: 0,
1264
+ class: "atm-profile-info-value"
1265
+ };
1266
+ const _hoisted_25 = {
1267
+ key: 1,
1268
+ class: "atm-profile-info-value"
1269
+ };
1270
+ const _hoisted_26 = { class: "atm-profile-info-row" };
1271
+ const _hoisted_27 = {
1272
+ key: 0,
1273
+ class: "atm-profile-info-value"
1274
+ };
1275
+ const _hoisted_28 = {
1276
+ key: 1,
1277
+ class: "atm-profile-info-value"
1278
+ };
1279
+ const _hoisted_29 = { class: "atm-profile-info-row" };
1280
+ const _hoisted_30 = { class: "atm-profile-info-value" };
1281
+ const _hoisted_31 = {
1282
+ key: 1,
1283
+ class: "atm-profile-edit-form"
1284
+ };
1285
+ const _hoisted_32 = { class: "atm-form-group" };
1286
+ const _hoisted_33 = { class: "atm-form-group" };
1287
+ const _hoisted_34 = {
1288
+ key: 1,
1289
+ class: "atm-profile-body"
1290
+ };
1291
+ const _hoisted_35 = { class: "atm-email-add-section" };
1292
+ const _hoisted_36 = { class: "atm-form-group" };
1293
+ const _hoisted_37 = { class: "atm-badge" };
1294
+ const _hoisted_38 = { class: "atm-email-list" };
1295
+ const _hoisted_39 = { class: "atm-email-info" };
1296
+ const _hoisted_40 = { class: "atm-email-address" };
1297
+ const _hoisted_41 = { class: "atm-email-badges" };
1298
+ const _hoisted_42 = {
1299
+ key: 0,
1300
+ class: "atm-badge atm-badge-primary"
1301
+ };
1302
+ const _hoisted_43 = {
1303
+ key: 1,
1304
+ class: "atm-badge atm-badge-verified"
1305
+ };
1306
+ const _hoisted_44 = {
1307
+ key: 2,
1308
+ class: "atm-badge atm-badge-unverified"
1309
+ };
1310
+ const _hoisted_45 = { class: "atm-email-actions" };
1311
+ const _hoisted_46 = ["onClick"];
1312
+ const _hoisted_47 = ["onClick"];
1313
+ const _hoisted_48 = {
1314
+ key: 2,
1315
+ class: "atm-profile-body"
1316
+ };
1317
+ const _hoisted_49 = {
1318
+ key: 3,
1319
+ class: "atm-profile-body"
1320
+ };
1321
+ const _hoisted_50 = { class: "atm-sessions-section" };
1322
+ const _hoisted_51 = { class: "atm-sessions-list" };
1323
+ const _hoisted_52 = { class: "atm-session-info" };
1324
+ const _hoisted_53 = { class: "atm-session-header" };
1325
+ const _hoisted_54 = {
1326
+ viewBox: "0 0 24 24",
1327
+ class: "atm-session-icon"
1328
+ };
1329
+ const _hoisted_55 = ["d"];
1330
+ const _hoisted_56 = { class: "atm-session-details" };
1331
+ const _hoisted_57 = { class: "atm-session-title" };
1332
+ const _hoisted_58 = {
1333
+ key: 0,
1334
+ class: "atm-badge atm-badge-current"
1335
+ };
1336
+ const _hoisted_59 = {
1337
+ key: 0,
1338
+ class: "atm-session-device-info"
1339
+ };
1340
+ const _hoisted_60 = { key: 0 };
1341
+ const _hoisted_61 = { key: 1 };
1342
+ const _hoisted_62 = { key: 2 };
1343
+ const _hoisted_63 = { class: "atm-session-timestamps" };
1344
+ const _hoisted_64 = { class: "atm-session-timestamp" };
1345
+ const _hoisted_65 = { class: "atm-session-timestamp" };
1346
+ const _hoisted_66 = { class: "atm-session-actions" };
1347
+ const _hoisted_67 = ["onClick"];
1348
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
1349
+ __name: "UserProfile",
1350
+ setup(__props) {
1351
+ vue.useCssVars((_ctx) => ({
1352
+ "v1982ae74": atmPrimaryColor.value,
1353
+ "c7d31cfc": atmSecondaryColor.value
1354
+ }));
1355
+ const { user, logout } = useAuth();
1356
+ const { configurations } = useAtm();
1357
+ const atmPrimaryColor = vue.computed(() => configurations.value?.design?.primaryColor);
1358
+ const atmSecondaryColor = vue.computed(() => configurations.value?.design?.secondaryColor);
1359
+ const isDropdownOpen = vue.ref(false);
1360
+ const isProfileModalOpen = vue.ref(false);
1361
+ const isEditingProfile = vue.ref(false);
1362
+ const buttonRef = vue.ref(null);
1363
+ const emailAddresses = vue.ref([]);
1364
+ const newEmail = vue.ref("");
1365
+ const activeTab = vue.ref("geral");
1366
+ const sessions = vue.ref([]);
1367
+ const client = useAtmClient();
1368
+ const profileForm = vue.ref({
1369
+ firstName: "",
1370
+ lastName: "",
1371
+ primaryEmailAddress: ""
1372
+ });
1373
+ const notification = vue.ref({
1374
+ show: false,
1375
+ message: "",
1376
+ type: "error"
1377
+ });
1378
+ const showNotification = (message, type = "error") => {
1379
+ notification.value = {
1380
+ show: true,
1381
+ message,
1382
+ type
1383
+ };
1384
+ setTimeout(() => {
1385
+ notification.value.show = false;
1386
+ }, 3e3);
1387
+ };
1388
+ vue.provide("showNotification", showNotification);
1389
+ const userInitials = vue.computed(() => {
1390
+ if (!user.value || !user.value.firstName) return "";
1391
+ return (user.value.firstName.charAt(0) + (user.value.lastName?.charAt(0) || "")).toUpperCase();
1392
+ });
1393
+ const toggleMenu = () => isDropdownOpen.value = !isDropdownOpen.value;
1394
+ const closeMenu = (event) => {
1395
+ if (buttonRef.value && !buttonRef.value.contains(event.target)) {
1396
+ isDropdownOpen.value = false;
1397
+ }
1398
+ };
1399
+ const openProfileModal = async () => {
1400
+ isDropdownOpen.value = false;
1401
+ isProfileModalOpen.value = true;
1402
+ activeTab.value = "geral";
1403
+ resetProfileForm();
1404
+ await loadEmailAddresses();
1405
+ await loadSessions();
1406
+ };
1407
+ const closeProfileModal = () => {
1408
+ isProfileModalOpen.value = false;
1409
+ isEditingProfile.value = false;
1410
+ resetProfileForm();
1411
+ emailAddresses.value = [];
1412
+ newEmail.value = "";
1413
+ sessions.value = [];
1414
+ activeTab.value = "geral";
1415
+ };
1416
+ const resetProfileForm = () => {
1417
+ if (user.value) {
1418
+ profileForm.value = {
1419
+ firstName: user.value.firstName || "",
1420
+ lastName: user.value.lastName || "",
1421
+ primaryEmailAddress: user.value.primaryEmailAddress || ""
1422
+ };
1423
+ }
1424
+ };
1425
+ const updateProfileFormWithData = (profileDataUpdated) => {
1426
+ if (profileDataUpdated.first_name) {
1427
+ profileForm.value.firstName = profileDataUpdated.first_name;
1428
+ }
1429
+ if (profileDataUpdated.last_name) {
1430
+ profileForm.value.lastName = profileDataUpdated.last_name;
1431
+ }
1432
+ if (profileDataUpdated.primary_email_address) {
1433
+ profileForm.value.primaryEmailAddress = profileDataUpdated.primary_email_address;
1434
+ }
1435
+ };
1436
+ const loadEmailAddresses = async () => {
1437
+ try {
1438
+ const token = getCookie("atm_access_token");
1439
+ if (!token) {
1440
+ showNotification("Token de acesso não encontrado", "error");
1441
+ return;
1442
+ }
1443
+ const emails = await client.account(token).getEmailsAddresses();
1444
+ emailAddresses.value = emails;
1445
+ } catch (error) {
1446
+ showNotification("Erro ao carregar endereços de email", "error");
1447
+ }
1448
+ };
1449
+ const requestEmailVerification = async (emailId) => {
1450
+ try {
1451
+ const token = getCookie("atm_access_token");
1452
+ if (!token) {
1453
+ showNotification("Token de acesso não encontrado", "error");
1454
+ return;
1455
+ }
1456
+ await client.account(token).requestEmailVerification(emailId);
1457
+ showNotification("Link de verificação enviado para o email", "success");
1458
+ await loadEmailAddresses();
1459
+ } catch (error) {
1460
+ showNotification("Erro ao enviar verificação de email", "error");
1461
+ }
1462
+ };
1463
+ const deleteEmailAddress = async (emailId) => {
1464
+ try {
1465
+ const token = getCookie("atm_access_token");
1466
+ if (!token) {
1467
+ showNotification("Token de acesso não encontrado", "error");
1468
+ return;
1469
+ }
1470
+ await client.account(token).deleteEmailAddress(emailId);
1471
+ showNotification("Email removido com sucesso", "success");
1472
+ await loadEmailAddresses();
1473
+ } catch (error) {
1474
+ showNotification("Erro ao remover email", "error");
1475
+ }
1476
+ };
1477
+ const createEmailAddress = async () => {
1478
+ try {
1479
+ const token = getCookie("atm_access_token");
1480
+ if (!token) {
1481
+ showNotification("Token de acesso não encontrado", "error");
1482
+ return;
1483
+ }
1484
+ if (!newEmail.value.trim()) {
1485
+ showNotification("Informe o novo email", "error");
1486
+ return;
1487
+ }
1488
+ await client.account(token).createEmailAddress(newEmail.value.trim());
1489
+ showNotification("Email adicionado. Verifique sua caixa de entrada.", "success");
1490
+ newEmail.value = "";
1491
+ await loadEmailAddresses();
1492
+ } catch (error) {
1493
+ showNotification("Erro ao adicionar email", "error");
1494
+ }
1495
+ };
1496
+ const startEditing = () => {
1497
+ isEditingProfile.value = true;
1498
+ };
1499
+ const cancelEditing = () => {
1500
+ isEditingProfile.value = false;
1501
+ resetProfileForm();
1502
+ };
1503
+ const getCookie = (name) => {
1504
+ const value = `; ${document.cookie}`;
1505
+ const parts = value.split(`; ${name}=`);
1506
+ if (parts.length === 2) return parts.pop()?.split(";").shift() || null;
1507
+ return null;
1508
+ };
1509
+ const updateProfile = async () => {
1510
+ try {
1511
+ if (!profileForm.value.firstName.trim()) {
1512
+ showNotification("Nome é obrigatório", "error");
1513
+ return;
1514
+ }
1515
+ if (!profileForm.value.lastName.trim()) {
1516
+ showNotification("Sobrenome é obrigatório", "error");
1517
+ return;
1518
+ }
1519
+ const updateData = {};
1520
+ if (profileForm.value.firstName !== user.value?.firstName) {
1521
+ updateData.first_name = profileForm.value.firstName.trim();
1522
+ }
1523
+ if (profileForm.value.lastName !== user.value?.lastName) {
1524
+ updateData.last_name = profileForm.value.lastName.trim();
1525
+ }
1526
+ if (Object.keys(updateData).length === 0) {
1527
+ showNotification("Nenhuma alteração foi feita", "warning");
1528
+ isEditingProfile.value = false;
1529
+ return;
1530
+ }
1531
+ const token = getCookie("atm_access_token");
1532
+ if (!token) {
1533
+ showNotification("Token de acesso não encontrado", "error");
1534
+ return;
1535
+ }
1536
+ await client.account(token).updateProfile(updateData);
1537
+ const profileDataUpdated = await client.account(token).getProfile();
1538
+ updateProfileFormWithData(profileDataUpdated);
1539
+ showNotification("Perfil atualizado com sucesso!", "success");
1540
+ isEditingProfile.value = false;
1541
+ } catch (error) {
1542
+ showNotification(error.message || "Erro ao atualizar perfil", "error");
1543
+ }
1544
+ };
1545
+ const logoutUser = () => {
1546
+ logout();
1547
+ isDropdownOpen.value = false;
1548
+ };
1549
+ const sendResetPasswordLink = async () => {
1550
+ if (!user.value?.primaryEmailAddress) {
1551
+ showNotification("Informe o email para enviar o link de recuperação", "error");
1552
+ return;
1553
+ }
1554
+ try {
1555
+ await client.auth().resetPassword({ email_address: user.value.primaryEmailAddress });
1556
+ showNotification(`Foi enviado um link para resetar a senha para o email ${user.value.primaryEmailAddress}.`, "success");
1557
+ } catch (e) {
1558
+ showNotification(e.message || "Erro ao solicitar recuperação de senha", "error");
1559
+ }
1560
+ };
1561
+ const loadSessions = async () => {
1562
+ try {
1563
+ const token = getCookie("atm_access_token");
1564
+ if (!token) {
1565
+ showNotification("Token de acesso não encontrado", "error");
1566
+ return;
1567
+ }
1568
+ const sessionsData = await client.account(token).getSessions();
1569
+ sessions.value = sessionsData;
1570
+ } catch (error) {
1571
+ showNotification("Erro ao carregar sessões", "error");
1572
+ }
1573
+ };
1574
+ const closeSessionById = async (sessionId) => {
1575
+ try {
1576
+ const token = getCookie("atm_access_token");
1577
+ if (!token) {
1578
+ showNotification("Token de acesso não encontrado", "error");
1579
+ return;
1580
+ }
1581
+ await client.account(token).closeSession(sessionId);
1582
+ showNotification("Sessão encerrada com sucesso", "success");
1583
+ await loadSessions();
1584
+ } catch (error) {
1585
+ showNotification("Erro ao encerrar sessão", "error");
1586
+ }
1587
+ };
1588
+ const formatDate = (dateString) => {
1589
+ const date = new Date(dateString);
1590
+ return date.toLocaleString("pt-BR", {
1591
+ day: "2-digit",
1592
+ month: "2-digit",
1593
+ year: "numeric",
1594
+ hour: "2-digit",
1595
+ minute: "2-digit"
1596
+ });
1597
+ };
1598
+ const getDeviceIcon = (device) => {
1599
+ const platform = device.platform?.toLowerCase() || "";
1600
+ const browser = device.browser?.toLowerCase() || "";
1601
+ if (platform.includes("windows") || platform.includes("win32") || platform.includes("win64")) {
1602
+ return "M0,0V11H11V0ZM13,0V11H24V0ZM0,13V24H11V13ZM13,13V24H24V13Z";
1603
+ }
1604
+ if (platform.includes("mac") || platform.includes("darwin") || platform.includes("os x")) {
1605
+ return "M12,1C7,1 3,5 3,10C3,14 6,17 9,18V22H15V18C18,17 21,14 21,10C21,5 17,1 12,1M12,3C15.9,3 19,6.1 19,10C19,13.4 16.6,16.2 13.4,16.8L13,16.9V20H11V16.9L10.6,16.8C7.4,16.2 5,13.4 5,10C5,6.1 8.1,3 12,3Z";
1606
+ }
1607
+ if (platform.includes("iphone") || platform.includes("ipad") || platform.includes("ipod") || platform.includes("ios")) {
1608
+ return "M15.5,1H8.5C7.67,1 7,1.67 7,2.5V21.5C7,22.33 7.67,23 8.5,23H15.5C16.33,23 17,22.33 17,21.5V2.5C17,1.67 16.33,1 15.5,1M12,22C11.45,22 11,21.55 11,21C11,20.45 11.45,20 12,20C12.55,20 13,20.45 13,21C13,21.55 12.55,22 12,22M15,19H9V4H15V19Z";
1609
+ }
1610
+ if (platform.includes("android")) {
1611
+ return "M16.61,15.15C16.15,15.15 15.77,15.53 15.77,16C15.77,16.46 16.15,16.85 16.61,16.85C17.07,16.85 17.46,16.46 17.46,16C17.46,15.53 17.07,15.15 16.61,15.15M7.41,15.15C6.95,15.15 6.57,15.53 6.57,16C6.57,16.46 6.95,16.85 7.41,16.85C7.87,16.85 8.26,16.46 8.26,16C8.26,15.53 7.87,15.15 7.41,15.15M16.91,10.14L18.58,7.26C18.67,7.09 18.61,6.88 18.45,6.79C18.28,6.69 18.07,6.75 18,6.92L16.29,9.83C14.95,9.22 13.5,8.9 12,8.91C10.47,8.91 9,9.24 7.73,9.82L6.04,6.91C5.95,6.74 5.74,6.68 5.57,6.78C5.4,6.87 5.35,7.08 5.44,7.25L7.1,10.13C4.25,11.69 2.29,14.58 2,18H22C21.72,14.59 19.77,11.7 16.91,10.14Z";
1612
+ }
1613
+ if (platform.includes("linux") || platform.includes("ubuntu") || platform.includes("debian") || platform.includes("fedora") || platform.includes("centos") || platform.includes("arch")) {
1614
+ return "M12,2C11.5,2 11,2.19 10.59,2.59L2.59,10.59C1.8,11.37 1.8,12.63 2.59,13.41L10.59,21.41C11.37,22.2 12.63,22.2 13.41,21.41L21.41,13.41C22.2,12.63 22.2,11.37 21.41,10.59L13.41,2.59C13,2.19 12.5,2 12,2M12,4L20,12L12,20L4,12M12.5,7V13H11V7M12.5,15V17H11V15";
1615
+ }
1616
+ if (platform.includes("chrome") || browser.includes("chrome")) {
1617
+ return "M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C14.6,4 16.94,5.27 18.35,7.25L15.5,12C15.29,11.41 15,10.87 14.62,10.41C13.69,9.31 12.36,8.63 10.88,8.63C10.75,8.63 10.62,8.64 10.5,8.65L12,4.03C12,4.03 12,4 12,4M4.26,8.09C5.61,6.19 7.82,5 10.29,5L8.5,9.5C7.12,10.5 6.25,12.18 6.25,14.06C6.25,14.66 6.35,15.23 6.53,15.78L4.26,8.09M19.74,8.09L17.47,15.78C18.5,14.16 19.13,12.19 19.13,10.06C19.13,9.38 19.04,8.72 18.88,8.09H19.74M6.06,17C4.5,15.5 3.5,13.38 3.5,11C3.5,10.66 3.53,10.33 3.57,10H7.03C7,10.33 7,10.66 7,11C7,12.96 7.81,14.73 9.11,16L6.06,17M12,20C9.4,20 7.06,18.73 5.65,16.75L8.5,12C8.71,12.59 9,13.13 9.38,13.59C10.31,14.69 11.64,15.37 13.12,15.37C13.25,15.37 13.38,15.36 13.5,15.35L12,19.97C12,19.97 12,20 12,20M17.94,17L15.96,11C17.21,9.89 18,8.21 18,6.31C18,5.71 17.9,5.14 17.72,4.59L19.74,8.09C20.26,9.25 20.55,10.56 20.55,11.94C20.55,14.27 19.64,16.38 18.18,17.91L17.94,17Z";
1618
+ }
1619
+ if (browser.includes("firefox") || browser.includes("mozilla")) {
1620
+ return "M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M15.84,15.5C15.57,16.17 15.16,16.75 14.63,17.23C13.96,17.82 13.17,18.21 12.29,18.42C11.38,18.63 10.47,18.63 9.56,18.42C9,18.29 8.5,18.06 8.04,17.75C7.27,17.23 6.69,16.5 6.32,15.63C5.95,14.76 5.79,13.81 5.86,12.86C5.93,11.91 6.24,11.03 6.77,10.24C7.3,9.45 8,8.84 8.84,8.45C9.68,8.06 10.58,7.93 11.5,8.07C12.41,8.21 13.24,8.59 13.94,9.18C14.64,9.77 15.16,10.53 15.45,11.38C15.74,12.23 15.79,13.13 15.59,14C15.39,14.87 14.96,15.67 14.34,16.32L15.84,15.5Z";
1621
+ }
1622
+ if (browser.includes("safari")) {
1623
+ return "M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M9.5,9.5L14,12L12,14L10.5,14.5L9.5,9.5M12,11A1,1 0 0,1 13,12A1,1 0 0,1 12,13A1,1 0 0,1 11,12A1,1 0 0,1 12,11Z";
1624
+ }
1625
+ if (browser.includes("edge") || browser.includes("edg")) {
1626
+ return "M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,14.5 5.2,16.7 7.1,18C8,17 9.3,16.5 10.7,16.5C12.1,16.5 13.4,17 14.3,18C16.2,16.7 17.4,14.5 17.4,12C17.4,9.5 16.2,7.3 14.3,6C13.4,7 12.1,7.5 10.7,7.5C9.3,7.5 8,7 7.1,6C5.2,7.3 4,9.5 4,12M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10Z";
1627
+ }
1628
+ if (browser.includes("opera")) {
1629
+ return "M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4C7.92,4 4.55,7.05 4.07,11H8.92C9.45,8.7 10.6,7 12,7C13.4,7 14.55,8.7 15.08,11H19.93C19.45,7.05 16.08,4 12,4M4.07,13C4.55,16.95 7.92,20 12,20C16.08,20 19.45,16.95 19.93,13H15.08C14.55,15.3 13.4,17 12,17C10.6,17 9.45,15.3 8.92,13H4.07Z";
1630
+ }
1631
+ if (platform.includes("tablet") || platform.includes("ipad")) {
1632
+ return "M19,18H5V6H19M21,4H3C1.89,4 1,4.89 1,6V18A2,2 0 0,0 3,20H21A2,2 0 0,0 23,18V6C23,4.89 22.1,4 21,4Z";
1633
+ }
1634
+ return "M17,19H7V5H17M17,1H7C5.89,1 5,1.89 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3C19,1.89 18.1,1 17,1Z";
1635
+ };
1636
+ const hasFullName = vue.computed(() => {
1637
+ return !!(user.value?.firstName && user.value?.lastName);
1638
+ });
1639
+ vue.onMounted(() => document.addEventListener("click", closeMenu));
1640
+ vue.onUnmounted(() => document.removeEventListener("click", closeMenu));
1641
+ return (_ctx, _cache) => {
1642
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1643
+ vue.createVNode(Notification, {
1644
+ show: notification.value.show,
1645
+ message: notification.value.message,
1646
+ type: notification.value.type
1647
+ }, null, 8, ["show", "message", "type"]),
1648
+ vue.unref(user) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
1649
+ vue.createElementVNode("button", {
1650
+ class: "atm-profile-button",
1651
+ onClick: toggleMenu,
1652
+ ref_key: "buttonRef",
1653
+ ref: buttonRef
1654
+ }, [
1655
+ vue.createElementVNode("div", {
1656
+ class: "atm-profile-avatar",
1657
+ style: vue.normalizeStyle(vue.unref(user)?.profileImage ? {} : { backgroundColor: atmPrimaryColor.value })
1658
+ }, [
1659
+ vue.unref(user)?.profileImage ? (vue.openBlock(), vue.createElementBlock("img", {
1660
+ key: 0,
1661
+ src: vue.unref(user).profileImage,
1662
+ alt: "Profile",
1663
+ class: "atm-profile-avatar-img"
1664
+ }, null, 8, _hoisted_2)) : hasFullName.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3, vue.toDisplayString(userInitials.value), 1)) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4, [..._cache[7] || (_cache[7] = [
1665
+ vue.createElementVNode("path", {
1666
+ fill: "currentColor",
1667
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1668
+ }, null, -1)
1669
+ ])]))
1670
+ ], 4),
1671
+ hasFullName.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5, vue.toDisplayString(vue.unref(user).firstName), 1)) : vue.createCommentVNode("", true),
1672
+ (vue.openBlock(), vue.createElementBlock("svg", {
1673
+ class: vue.normalizeClass(["atm-profile-arrow", { "atm-rotate": isDropdownOpen.value }]),
1674
+ viewBox: "0 0 24 24"
1675
+ }, [..._cache[8] || (_cache[8] = [
1676
+ vue.createElementVNode("path", {
1677
+ fill: "currentColor",
1678
+ d: "M7,10L12,15L17,10H7Z"
1679
+ }, null, -1)
1680
+ ])], 2))
1681
+ ], 512),
1682
+ vue.createVNode(vue.Transition, { name: "atm-fade" }, {
1683
+ default: vue.withCtx(() => [
1684
+ isDropdownOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
1685
+ vue.createElementVNode("div", _hoisted_7, [
1686
+ vue.createElementVNode("div", {
1687
+ class: "atm-profile-avatar large",
1688
+ style: vue.normalizeStyle(vue.unref(user)?.profileImage ? {} : { backgroundColor: atmPrimaryColor.value })
1689
+ }, [
1690
+ vue.unref(user)?.profileImage ? (vue.openBlock(), vue.createElementBlock("img", {
1691
+ key: 0,
1692
+ src: vue.unref(user).profileImage,
1693
+ alt: "Profile",
1694
+ class: "atm-profile-avatar-img"
1695
+ }, null, 8, _hoisted_8)) : hasFullName.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9, vue.toDisplayString(userInitials.value), 1)) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_10, [..._cache[9] || (_cache[9] = [
1696
+ vue.createElementVNode("path", {
1697
+ fill: "currentColor",
1698
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1699
+ }, null, -1)
1700
+ ])]))
1701
+ ], 4),
1702
+ vue.createElementVNode("div", _hoisted_11, [
1703
+ hasFullName.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_12, vue.toDisplayString(vue.unref(user).firstName) + " " + vue.toDisplayString(vue.unref(user).lastName), 1)) : (vue.openBlock(), vue.createElementBlock("p", _hoisted_13, "Usuário")),
1704
+ vue.createElementVNode("p", _hoisted_14, vue.toDisplayString(vue.unref(user).primaryEmailAddress), 1)
1705
+ ])
1706
+ ]),
1707
+ vue.createElementVNode("div", { class: "atm-profile-options" }, [
1708
+ vue.createElementVNode("button", {
1709
+ class: "atm-profile-option",
1710
+ onClick: openProfileModal,
1711
+ type: "button"
1712
+ }, [..._cache[10] || (_cache[10] = [
1713
+ vue.createElementVNode("svg", {
1714
+ viewBox: "0 0 24 24",
1715
+ class: "atm-profile-icon"
1716
+ }, [
1717
+ vue.createElementVNode("path", {
1718
+ fill: "currentColor",
1719
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1720
+ })
1721
+ ], -1),
1722
+ vue.createTextVNode(" Meu Perfil ", -1)
1723
+ ])]),
1724
+ vue.createElementVNode("button", {
1725
+ class: "atm-profile-option",
1726
+ onClick: logoutUser,
1727
+ type: "button"
1728
+ }, [..._cache[11] || (_cache[11] = [
1729
+ vue.createElementVNode("svg", {
1730
+ viewBox: "0 0 24 24",
1731
+ class: "atm-profile-icon"
1732
+ }, [
1733
+ vue.createElementVNode("path", {
1734
+ fill: "currentColor",
1735
+ d: "M16,17V14H9V10H16V7L21,12L16,17M14,2A2,2 0 0,1 16,4V6H14V4H5V20H14V18H16V20A2,2 0 0,1 14,22H5A2,2 0 0,1 3,20V4A2,2 0 0,1 5,2H14Z"
1736
+ })
1737
+ ], -1),
1738
+ vue.createTextVNode(" Sair ", -1)
1739
+ ])])
1740
+ ])
1741
+ ])) : vue.createCommentVNode("", true)
1742
+ ]),
1743
+ _: 1
1744
+ }),
1745
+ isProfileModalOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15, [
1746
+ vue.createElementVNode("div", {
1747
+ class: "atm-profile-overlay",
1748
+ onClick: closeProfileModal
1749
+ }),
1750
+ vue.createElementVNode("div", _hoisted_16, [
1751
+ vue.createElementVNode("div", { class: "atm-profile-header" }, [
1752
+ vue.createElementVNode("button", {
1753
+ onClick: closeProfileModal,
1754
+ class: "atm-profile-close",
1755
+ "aria-label": "Fechar"
1756
+ }, "×"),
1757
+ _cache[12] || (_cache[12] = vue.createElementVNode("h2", {
1758
+ id: "profile-modal-title",
1759
+ class: "atm-profile-title"
1760
+ }, "Meu Perfil", -1))
1761
+ ]),
1762
+ vue.createElementVNode("div", _hoisted_17, [
1763
+ vue.createElementVNode("button", {
1764
+ onClick: _cache[0] || (_cache[0] = ($event) => activeTab.value = "geral"),
1765
+ class: vue.normalizeClass(["atm-tab", { "atm-tab-active": activeTab.value === "geral" }])
1766
+ }, [..._cache[13] || (_cache[13] = [
1767
+ vue.createElementVNode("svg", {
1768
+ viewBox: "0 0 24 24",
1769
+ class: "atm-tab-icon"
1770
+ }, [
1771
+ vue.createElementVNode("path", {
1772
+ fill: "currentColor",
1773
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1774
+ })
1775
+ ], -1),
1776
+ vue.createTextVNode(" Geral ", -1)
1777
+ ])], 2),
1778
+ vue.createElementVNode("button", {
1779
+ onClick: _cache[1] || (_cache[1] = ($event) => activeTab.value = "emails"),
1780
+ class: vue.normalizeClass(["atm-tab", { "atm-tab-active": activeTab.value === "emails" }])
1781
+ }, [..._cache[14] || (_cache[14] = [
1782
+ vue.createElementVNode("svg", {
1783
+ viewBox: "0 0 24 24",
1784
+ class: "atm-tab-icon"
1785
+ }, [
1786
+ vue.createElementVNode("path", {
1787
+ fill: "currentColor",
1788
+ d: "M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"
1789
+ })
1790
+ ], -1),
1791
+ vue.createTextVNode(" Emails ", -1)
1792
+ ])], 2),
1793
+ vue.createElementVNode("button", {
1794
+ onClick: _cache[2] || (_cache[2] = ($event) => activeTab.value = "senha"),
1795
+ class: vue.normalizeClass(["atm-tab", { "atm-tab-active": activeTab.value === "senha" }])
1796
+ }, [..._cache[15] || (_cache[15] = [
1797
+ vue.createElementVNode("svg", {
1798
+ viewBox: "0 0 24 24",
1799
+ class: "atm-tab-icon"
1800
+ }, [
1801
+ vue.createElementVNode("path", {
1802
+ fill: "currentColor",
1803
+ d: "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"
1804
+ })
1805
+ ], -1),
1806
+ vue.createTextVNode(" Senha ", -1)
1807
+ ])], 2),
1808
+ vue.createElementVNode("button", {
1809
+ onClick: _cache[3] || (_cache[3] = ($event) => activeTab.value = "sessoes"),
1810
+ class: vue.normalizeClass(["atm-tab", { "atm-tab-active": activeTab.value === "sessoes" }])
1811
+ }, [..._cache[16] || (_cache[16] = [
1812
+ vue.createElementVNode("svg", {
1813
+ viewBox: "0 0 24 24",
1814
+ class: "atm-tab-icon"
1815
+ }, [
1816
+ vue.createElementVNode("path", {
1817
+ fill: "currentColor",
1818
+ d: "M4,6H20V16H4M20,18A2,2 0 0,0 22,16V6C22,4.89 21.1,4 20,4H4C2.89,4 2,4.89 2,6V16A2,2 0 0,0 4,18H0V20H24V18H20Z"
1819
+ })
1820
+ ], -1),
1821
+ vue.createTextVNode(" Sessões ", -1)
1822
+ ])], 2)
1823
+ ]),
1824
+ activeTab.value === "geral" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18, [
1825
+ vue.createElementVNode("div", {
1826
+ class: "atm-profile-avatar-large",
1827
+ style: vue.normalizeStyle(vue.unref(user)?.profileImage ? {} : { backgroundColor: atmPrimaryColor.value })
1828
+ }, [
1829
+ vue.unref(user)?.profileImage ? (vue.openBlock(), vue.createElementBlock("img", {
1830
+ key: 0,
1831
+ src: vue.unref(user).profileImage,
1832
+ alt: "Profile",
1833
+ class: "atm-profile-avatar-img"
1834
+ }, null, 8, _hoisted_19)) : hasFullName.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_20, vue.toDisplayString(userInitials.value), 1)) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_21, [..._cache[17] || (_cache[17] = [
1835
+ vue.createElementVNode("path", {
1836
+ fill: "currentColor",
1837
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1838
+ }, null, -1)
1839
+ ])]))
1840
+ ], 4),
1841
+ !isEditingProfile.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22, [
1842
+ vue.createElementVNode("div", _hoisted_23, [
1843
+ _cache[18] || (_cache[18] = vue.createElementVNode("span", { class: "atm-profile-info-label" }, "Nome", -1)),
1844
+ hasFullName.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_24, vue.toDisplayString(profileForm.value.firstName), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_25, "Não informado"))
1845
+ ]),
1846
+ vue.createElementVNode("div", _hoisted_26, [
1847
+ _cache[19] || (_cache[19] = vue.createElementVNode("span", { class: "atm-profile-info-label" }, "Sobrenome", -1)),
1848
+ hasFullName.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_27, vue.toDisplayString(profileForm.value.lastName), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_28, "Não informado"))
1849
+ ]),
1850
+ vue.createElementVNode("div", _hoisted_29, [
1851
+ _cache[20] || (_cache[20] = vue.createElementVNode("span", { class: "atm-profile-info-label" }, "Email Principal", -1)),
1852
+ vue.createElementVNode("span", _hoisted_30, vue.toDisplayString(profileForm.value.primaryEmailAddress), 1)
1853
+ ]),
1854
+ vue.createElementVNode("div", { class: "atm-profile-info-row" }, [
1855
+ vue.createElementVNode("button", {
1856
+ class: "atm-edit-profile-btn",
1857
+ onClick: startEditing,
1858
+ type: "button"
1859
+ }, [..._cache[21] || (_cache[21] = [
1860
+ vue.createElementVNode("svg", {
1861
+ viewBox: "0 0 24 24",
1862
+ class: "atm-btn-icon"
1863
+ }, [
1864
+ vue.createElementVNode("path", {
1865
+ fill: "currentColor",
1866
+ d: "M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"
1867
+ })
1868
+ ], -1),
1869
+ vue.createTextVNode(" Editar Perfil ", -1)
1870
+ ])])
1871
+ ])
1872
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_31, [
1873
+ vue.createElementVNode("div", _hoisted_32, [
1874
+ _cache[22] || (_cache[22] = vue.createElementVNode("label", { class: "atm-input-label" }, "Nome", -1)),
1875
+ vue.withDirectives(vue.createElementVNode("input", {
1876
+ type: "text",
1877
+ class: "atm-input-field",
1878
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => profileForm.value.firstName = $event),
1879
+ placeholder: "Digite seu nome"
1880
+ }, null, 512), [
1881
+ [vue.vModelText, profileForm.value.firstName]
1882
+ ])
1883
+ ]),
1884
+ vue.createElementVNode("div", _hoisted_33, [
1885
+ _cache[23] || (_cache[23] = vue.createElementVNode("label", { class: "atm-input-label" }, "Sobrenome", -1)),
1886
+ vue.withDirectives(vue.createElementVNode("input", {
1887
+ type: "text",
1888
+ class: "atm-input-field",
1889
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => profileForm.value.lastName = $event),
1890
+ placeholder: "Digite seu sobrenome"
1891
+ }, null, 512), [
1892
+ [vue.vModelText, profileForm.value.lastName]
1893
+ ])
1894
+ ]),
1895
+ vue.createElementVNode("div", { class: "atm-form-actions" }, [
1896
+ vue.createElementVNode("button", {
1897
+ class: "atm-save-btn",
1898
+ onClick: updateProfile,
1899
+ type: "button"
1900
+ }, [..._cache[24] || (_cache[24] = [
1901
+ vue.createElementVNode("svg", {
1902
+ viewBox: "0 0 24 24",
1903
+ class: "atm-btn-icon"
1904
+ }, [
1905
+ vue.createElementVNode("path", {
1906
+ fill: "currentColor",
1907
+ d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
1908
+ })
1909
+ ], -1),
1910
+ vue.createTextVNode(" Salvar ", -1)
1911
+ ])]),
1912
+ vue.createElementVNode("button", {
1913
+ class: "atm-cancel-btn",
1914
+ onClick: cancelEditing,
1915
+ type: "button"
1916
+ }, [..._cache[25] || (_cache[25] = [
1917
+ vue.createElementVNode("svg", {
1918
+ viewBox: "0 0 24 24",
1919
+ class: "atm-btn-icon"
1920
+ }, [
1921
+ vue.createElementVNode("path", {
1922
+ fill: "currentColor",
1923
+ d: "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
1924
+ })
1925
+ ], -1),
1926
+ vue.createTextVNode(" Cancelar ", -1)
1927
+ ])])
1928
+ ])
1929
+ ]))
1930
+ ])) : vue.createCommentVNode("", true),
1931
+ activeTab.value === "emails" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_34, [
1932
+ vue.createElementVNode("div", _hoisted_35, [
1933
+ vue.createElementVNode("div", _hoisted_36, [
1934
+ _cache[27] || (_cache[27] = vue.createElementVNode("label", { class: "atm-input-label" }, "Adicionar novo email", -1)),
1935
+ vue.createElementVNode("div", _hoisted_37, [
1936
+ vue.withDirectives(vue.createElementVNode("input", {
1937
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => newEmail.value = $event),
1938
+ type: "email",
1939
+ class: "atm-input-field",
1940
+ placeholder: "novo@email.com"
1941
+ }, null, 512), [
1942
+ [vue.vModelText, newEmail.value]
1943
+ ]),
1944
+ vue.createElementVNode("button", {
1945
+ onClick: createEmailAddress,
1946
+ class: "atm-add-email-btn",
1947
+ type: "button"
1948
+ }, [..._cache[26] || (_cache[26] = [
1949
+ vue.createElementVNode("svg", {
1950
+ viewBox: "0 0 24 24",
1951
+ class: "atm-btn-icon"
1952
+ }, [
1953
+ vue.createElementVNode("path", {
1954
+ fill: "currentColor",
1955
+ d: "M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
1956
+ })
1957
+ ], -1)
1958
+ ])])
1959
+ ])
1960
+ ])
1961
+ ]),
1962
+ vue.createElementVNode("div", _hoisted_38, [
1963
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(emailAddresses.value, (email) => {
1964
+ return vue.openBlock(), vue.createElementBlock("div", {
1965
+ key: email.id,
1966
+ class: "atm-email-item"
1967
+ }, [
1968
+ vue.createElementVNode("div", _hoisted_39, [
1969
+ vue.createElementVNode("div", _hoisted_40, [
1970
+ _cache[28] || (_cache[28] = vue.createElementVNode("svg", {
1971
+ viewBox: "0 0 24 24",
1972
+ class: "atm-email-icon"
1973
+ }, [
1974
+ vue.createElementVNode("path", {
1975
+ fill: "currentColor",
1976
+ d: "M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"
1977
+ })
1978
+ ], -1)),
1979
+ vue.createElementVNode("span", null, vue.toDisplayString(email.email_address), 1)
1980
+ ]),
1981
+ vue.createElementVNode("div", _hoisted_41, [
1982
+ email.primary ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_42, "Principal")) : vue.createCommentVNode("", true),
1983
+ email.verified ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_43, [..._cache[29] || (_cache[29] = [
1984
+ vue.createElementVNode("svg", {
1985
+ viewBox: "0 0 24 24",
1986
+ class: "atm-badge-icon"
1987
+ }, [
1988
+ vue.createElementVNode("path", {
1989
+ fill: "currentColor",
1990
+ d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
1991
+ })
1992
+ ], -1),
1993
+ vue.createTextVNode(" Verificado ", -1)
1994
+ ])])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_44, [..._cache[30] || (_cache[30] = [
1995
+ vue.createElementVNode("svg", {
1996
+ viewBox: "0 0 24 24",
1997
+ class: "atm-badge-icon"
1998
+ }, [
1999
+ vue.createElementVNode("path", {
2000
+ fill: "currentColor",
2001
+ d: "M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"
2002
+ })
2003
+ ], -1),
2004
+ vue.createTextVNode(" Não verificado ", -1)
2005
+ ])]))
2006
+ ])
2007
+ ]),
2008
+ vue.createElementVNode("div", _hoisted_45, [
2009
+ !email.verified ? (vue.openBlock(), vue.createElementBlock("button", {
2010
+ key: 0,
2011
+ onClick: ($event) => requestEmailVerification(email.id),
2012
+ class: "atm-verify-btn",
2013
+ type: "button"
2014
+ }, [..._cache[31] || (_cache[31] = [
2015
+ vue.createElementVNode("svg", {
2016
+ viewBox: "0 0 24 24",
2017
+ class: "atm-btn-icon"
2018
+ }, [
2019
+ vue.createElementVNode("path", {
2020
+ fill: "currentColor",
2021
+ d: "M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M10,17L6,13L7.41,11.59L10,14.17L16.59,7.58L18,9L10,17Z"
2022
+ })
2023
+ ], -1),
2024
+ vue.createTextVNode(" Verificar ", -1)
2025
+ ])], 8, _hoisted_46)) : vue.createCommentVNode("", true),
2026
+ !email.primary ? (vue.openBlock(), vue.createElementBlock("button", {
2027
+ key: 1,
2028
+ onClick: ($event) => deleteEmailAddress(email.id),
2029
+ class: "atm-delete-btn",
2030
+ type: "button"
2031
+ }, [..._cache[32] || (_cache[32] = [
2032
+ vue.createElementVNode("svg", {
2033
+ viewBox: "0 0 24 24",
2034
+ class: "atm-btn-icon"
2035
+ }, [
2036
+ vue.createElementVNode("path", {
2037
+ fill: "currentColor",
2038
+ d: "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"
2039
+ })
2040
+ ], -1),
2041
+ vue.createTextVNode(" Remover ", -1)
2042
+ ])], 8, _hoisted_47)) : vue.createCommentVNode("", true)
2043
+ ])
2044
+ ]);
2045
+ }), 128))
2046
+ ])
2047
+ ])) : vue.createCommentVNode("", true),
2048
+ activeTab.value === "senha" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_48, [
2049
+ vue.createElementVNode("div", { class: "atm-password-section" }, [
2050
+ _cache[34] || (_cache[34] = vue.createElementVNode("div", { class: "atm-profile-info-row" }, [
2051
+ vue.createElementVNode("span", { class: "atm-profile-info-label" }, "Redefinir Senha"),
2052
+ vue.createElementVNode("span", { class: "atm-profile-info-value" }, " Enviaremos um link para redefinir sua senha no email principal ")
2053
+ ], -1)),
2054
+ vue.createElementVNode("div", { class: "atm-profile-info-row" }, [
2055
+ vue.createElementVNode("button", {
2056
+ class: "atm-reset-password-btn",
2057
+ onClick: sendResetPasswordLink,
2058
+ type: "button"
2059
+ }, [..._cache[33] || (_cache[33] = [
2060
+ vue.createElementVNode("svg", {
2061
+ viewBox: "0 0 24 24",
2062
+ class: "atm-btn-icon"
2063
+ }, [
2064
+ vue.createElementVNode("path", {
2065
+ fill: "currentColor",
2066
+ d: "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"
2067
+ })
2068
+ ], -1),
2069
+ vue.createTextVNode(" Resetar Senha ", -1)
2070
+ ])])
2071
+ ])
2072
+ ])
2073
+ ])) : vue.createCommentVNode("", true),
2074
+ activeTab.value === "sessoes" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_49, [
2075
+ vue.createElementVNode("div", _hoisted_50, [
2076
+ _cache[38] || (_cache[38] = vue.createElementVNode("div", { class: "atm-sessions-info" }, [
2077
+ vue.createElementVNode("p", { class: "atm-sessions-description" }, " Gerencie os dispositivos conectados à sua conta. Você pode encerrar sessões em dispositivos que não reconhece. ")
2078
+ ], -1)),
2079
+ vue.createElementVNode("div", _hoisted_51, [
2080
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sessions.value, (session) => {
2081
+ return vue.openBlock(), vue.createElementBlock("div", {
2082
+ key: session.id,
2083
+ class: "atm-session-item"
2084
+ }, [
2085
+ vue.createElementVNode("div", _hoisted_52, [
2086
+ vue.createElementVNode("div", _hoisted_53, [
2087
+ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_54, [
2088
+ vue.createElementVNode("path", {
2089
+ fill: "currentColor",
2090
+ d: getDeviceIcon(session.device)
2091
+ }, null, 8, _hoisted_55)
2092
+ ])),
2093
+ vue.createElementVNode("div", _hoisted_56, [
2094
+ vue.createElementVNode("div", _hoisted_57, [
2095
+ vue.createElementVNode("span", null, vue.toDisplayString(session.ip_address), 1),
2096
+ session.current === 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_58, "Atual")) : vue.createCommentVNode("", true)
2097
+ ]),
2098
+ session.device.browser || session.device.platform ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_59, [
2099
+ session.device.browser ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_60, vue.toDisplayString(session.device.browser) + vue.toDisplayString(session.device.browser_version ? ` ${session.device.browser_version}` : ""), 1)) : vue.createCommentVNode("", true),
2100
+ session.device.browser && session.device.platform ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_61, " • ")) : vue.createCommentVNode("", true),
2101
+ session.device.platform ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_62, vue.toDisplayString(session.device.platform), 1)) : vue.createCommentVNode("", true)
2102
+ ])) : vue.createCommentVNode("", true),
2103
+ vue.createElementVNode("div", _hoisted_63, [
2104
+ vue.createElementVNode("div", _hoisted_64, [
2105
+ _cache[35] || (_cache[35] = vue.createElementVNode("span", { class: "atm-timestamp-label" }, "Iniciada:", -1)),
2106
+ vue.createElementVNode("span", null, vue.toDisplayString(formatDate(session.started_at)), 1)
2107
+ ]),
2108
+ vue.createElementVNode("div", _hoisted_65, [
2109
+ _cache[36] || (_cache[36] = vue.createElementVNode("span", { class: "atm-timestamp-label" }, "Última atividade:", -1)),
2110
+ vue.createElementVNode("span", null, vue.toDisplayString(formatDate(session.last_activity_at)), 1)
2111
+ ])
2112
+ ])
2113
+ ])
2114
+ ])
2115
+ ]),
2116
+ vue.createElementVNode("div", _hoisted_66, [
2117
+ session.current !== 1 ? (vue.openBlock(), vue.createElementBlock("button", {
2118
+ key: 0,
2119
+ onClick: ($event) => closeSessionById(session.id),
2120
+ class: "atm-close-session-btn",
2121
+ type: "button"
2122
+ }, [..._cache[37] || (_cache[37] = [
2123
+ vue.createElementVNode("svg", {
2124
+ viewBox: "0 0 24 24",
2125
+ class: "atm-btn-icon"
2126
+ }, [
2127
+ vue.createElementVNode("path", {
2128
+ fill: "currentColor",
2129
+ d: "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
2130
+ })
2131
+ ], -1),
2132
+ vue.createTextVNode(" Encerrar ", -1)
2133
+ ])], 8, _hoisted_67)) : vue.createCommentVNode("", true)
2134
+ ])
2135
+ ]);
2136
+ }), 128))
2137
+ ])
2138
+ ])
2139
+ ])) : vue.createCommentVNode("", true)
2140
+ ])
2141
+ ])) : vue.createCommentVNode("", true)
2142
+ ])) : vue.createCommentVNode("", true)
2143
+ ], 64);
2144
+ };
2145
+ }
2146
+ });
2147
+ const _hoisted_1$2 = {
2148
+ key: 1,
2149
+ class: "atm-auth-buttons"
2150
+ };
2151
+ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
2152
+ __name: "AuthSwitcher",
2153
+ setup(__props) {
2154
+ const { user } = useAuth();
2155
+ return (_ctx, _cache) => {
2156
+ return vue.openBlock(), vue.createElementBlock("div", null, [
2157
+ vue.unref(user)?.id ? (vue.openBlock(), vue.createBlock(_sfc_main$4, { key: 0 })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
2158
+ vue.createVNode(SignInButton),
2159
+ vue.createVNode(SignUpButton)
2160
+ ]))
2161
+ ]);
2162
+ };
2163
+ }
2164
+ });
2165
+ const AuthSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0c63ecb8"]]);
2166
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
2167
+ __name: "SignOutButton",
2168
+ setup(__props) {
2169
+ vue.useCssVars((_ctx) => ({
2170
+ "v2ec0f896": atmPrimaryColor.value
2171
+ }));
2172
+ const { logout, user } = useAuth();
2173
+ const { configurations } = useAtm();
2174
+ const atmPrimaryColor = vue.computed(() => configurations.value?.design?.primaryColor);
2175
+ return (_ctx, _cache) => {
2176
+ return vue.unref(user) ? (vue.openBlock(), vue.createElementBlock("button", {
2177
+ key: 0,
2178
+ onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(logout)()),
2179
+ class: "atm-logout-btn"
2180
+ }, " Sair ")) : vue.createCommentVNode("", true);
2181
+ };
2182
+ }
2183
+ });
2184
+ const SignOutButton = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7157f989"]]);
2185
+ const _hoisted_1$1 = { key: 0 };
2186
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
2187
+ __name: "SignedIn",
2188
+ setup(__props) {
2189
+ const { isSignedIn } = useAtm();
2190
+ return (_ctx, _cache) => {
2191
+ return vue.unref(isSignedIn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
2192
+ vue.renderSlot(_ctx.$slots, "default")
2193
+ ])) : vue.createCommentVNode("", true);
2194
+ };
2195
+ }
2196
+ });
2197
+ const _hoisted_1 = { key: 0 };
2198
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
2199
+ __name: "SignedOut",
2200
+ setup(__props) {
2201
+ const { isLoaded, isSignedIn } = useAtm();
2202
+ return (_ctx, _cache) => {
2203
+ return vue.unref(isLoaded) && !vue.unref(isSignedIn) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
2204
+ vue.renderSlot(_ctx.$slots, "default")
2205
+ ])) : vue.createCommentVNode("", true);
2206
+ };
2207
+ }
2208
+ });
2209
+ const fetchConfigurations = async (client, configurations) => {
2210
+ const response = await client.value.project().configurations();
2211
+ configurations.value = {
2212
+ project: {
2213
+ name: response.project.name,
2214
+ domain: response.project.domain
2215
+ },
2216
+ design: {
2217
+ primaryColor: response.design.primary_color,
2218
+ secondaryColor: response.design.secondary_color
2219
+ },
2220
+ username: {
2221
+ enable: response.username.enable,
2222
+ length: {
2223
+ min: response.username.length.min,
2224
+ max: response.username.length.max
2225
+ }
2226
+ },
2227
+ password: {
2228
+ enable: response.password.enable
2229
+ },
2230
+ firstName: {
2231
+ required: response.first_name.required
2232
+ },
2233
+ lastName: {
2234
+ required: response.last_name.required
2235
+ },
2236
+ register: {
2237
+ enable: response.register.enable
2238
+ }
2239
+ };
2240
+ };
2241
+ const atmPlugin = {
2242
+ install(app, pluginOptions) {
2243
+ const atmClient = new clientJs.AtmClient({
2244
+ domain: pluginOptions.domain,
2245
+ publicKey: pluginOptions.publicKey,
2246
+ ssl: false
2247
+ });
2248
+ const client = vue.ref(atmClient);
2249
+ const user = vue.ref(null);
2250
+ const configurations = vue.ref(null);
2251
+ const isSignedIn = vue.computed(() => user.value !== void 0 && user.value !== null);
2252
+ const isLoaded = vue.ref(false);
2253
+ Promise.all([
2254
+ fetchUser(client, user),
2255
+ fetchConfigurations(client, configurations)
2256
+ ]).then(() => isLoaded.value = true);
2257
+ app.provide("atm", {
2258
+ client,
2259
+ user,
2260
+ configurations,
2261
+ isSignedIn,
2262
+ isLoaded
2263
+ });
2264
+ }
2265
+ };
2266
+ exports.AuthSwitcher = AuthSwitcher;
2267
+ exports.SignInButton = SignInButton;
2268
+ exports.SignOutButton = SignOutButton;
2269
+ exports.SignUpButton = SignUpButton;
2270
+ exports.SignedIn = _sfc_main$1;
2271
+ exports.SignedOut = _sfc_main;
2272
+ exports.UserProfile = _sfc_main$4;
2273
+ exports.atmPlugin = atmPlugin;
2274
+ exports.getDeviceToken = getDeviceToken;
2275
+ exports.useAtm = useAtm;
2276
+ exports.useAtmClient = useAtmClient;
2277
+ exports.useAuth = useAuth;
2278
+ //# sourceMappingURL=index.cjs.map