@crystaldesign/diva-support 24.11.0-beta.4 → 24.11.0-beta.41

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.
@@ -56,7 +56,7 @@ import KeyboardArrowUp from '@material-ui/icons/KeyboardArrowUp';
56
56
  function initCometChat(supportHandler, appRegion, appId) {
57
57
  var appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(appRegion).build();
58
58
  return new Promise(function (resolve, reject) {
59
- CometChat.init(appId, appSetting).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
59
+ CometChat.init(appId, appSetting).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
60
60
  var authToken;
61
61
  return _regeneratorRuntime.wrap(function _callee$(_context) {
62
62
  while (1) switch (_context.prev = _context.next) {
@@ -7203,7 +7203,7 @@ _defineProperty(SoundManager, "onIncomingMessage", function (context) {
7203
7203
  _SoundManager.enableSoundForMessages(context).then(function (response) {
7204
7204
  if (response === true) {
7205
7205
  if (_SoundManager.incomingMessageAudio === null) {
7206
- import('./incomingmessage-ee75004e.js').then(function (response) {
7206
+ import('./incomingmessage-dc230588.js').then(function (response) {
7207
7207
  _SoundManager.incomingMessageAudio = new Audio(response["default"]);
7208
7208
  _SoundManager.playMessageAlert(_SoundManager.incomingMessageAudio);
7209
7209
  });
@@ -7217,7 +7217,7 @@ _defineProperty(SoundManager, "onIncomingOtherMessage", function (context) {
7217
7217
  _SoundManager.enableSoundForMessages(context).then(function (response) {
7218
7218
  if (response === true) {
7219
7219
  if (_SoundManager.incomingOtherMessageAudio === null) {
7220
- import('./incomingothermessage-54cc9494.js').then(function (response) {
7220
+ import('./incomingothermessage-351b75be.js').then(function (response) {
7221
7221
  _SoundManager.incomingOtherMessageAudio = new Audio(response["default"]);
7222
7222
  _SoundManager.playMessageAlert(_SoundManager.incomingOtherMessageAudio);
7223
7223
  });
@@ -7231,7 +7231,7 @@ _defineProperty(SoundManager, "onOutgoingMessage", function (context) {
7231
7231
  _SoundManager.enableSoundForMessages(context).then(function (response) {
7232
7232
  if (response === true) {
7233
7233
  if (_SoundManager.outgoingMessageAudio === null) {
7234
- import('./outgoingmessage-254c73e2.js').then(function (response) {
7234
+ import('./outgoingmessage-0a9121e2.js').then(function (response) {
7235
7235
  _SoundManager.outgoingMessageAudio = new Audio(response["default"]);
7236
7236
  _SoundManager.playMessageAlert(_SoundManager.outgoingMessageAudio);
7237
7237
  });
@@ -7249,7 +7249,7 @@ _defineProperty(SoundManager, "onIncomingCall", function (context) {
7249
7249
  _SoundManager.enableSoundForCalls(context).then(function (response) {
7250
7250
  if (response === true) {
7251
7251
  if (_SoundManager.incomingCallAudio === null) {
7252
- import('./incomingcall-feaa7e7a.js').then(function (response) {
7252
+ import('./incomingcall-ef083c12.js').then(function (response) {
7253
7253
  _SoundManager.incomingCallAudio = new Audio(response["default"]);
7254
7254
  _SoundManager.playCallAlert(_SoundManager.incomingCallAudio);
7255
7255
  });
@@ -7263,7 +7263,7 @@ _defineProperty(SoundManager, "onOutgoingCall", function (context) {
7263
7263
  _SoundManager.enableSoundForCalls(context).then(function (response) {
7264
7264
  if (response === true) {
7265
7265
  if (_SoundManager.outgoingCallAudio === null) {
7266
- import('./outgoingcall-99ebbfa7.js').then(function (response) {
7266
+ import('./outgoingcall-415e914b.js').then(function (response) {
7267
7267
  _SoundManager.outgoingCallAudio = new Audio(response["default"]);
7268
7268
  _SoundManager.playCallAlert(_SoundManager.outgoingCallAudio);
7269
7269
  });
@@ -24067,7 +24067,7 @@ var CometChatEmojiKeyboard = function CometChatEmojiKeyboard(props) {
24067
24067
  emojis: vals.emojis
24068
24068
  });
24069
24069
  /**Emoji Category List */
24070
- emojiCategoryJSX.push( /*#__PURE__*/jsx$1("div", {
24070
+ emojiCategoryJSX.push(/*#__PURE__*/jsx$1("div", {
24071
24071
  className: "emoji__autoscroll",
24072
24072
  children: /*#__PURE__*/jsx$1(CometChatListItem, {
24073
24073
  id: emojiCategory.id,
@@ -41789,7 +41789,7 @@ var InviteFriendDialog = function InviteFriendDialog(props) {
41789
41789
  email = _useState2[0],
41790
41790
  setEmail = _useState2[1];
41791
41791
  var sharePlanner = /*#__PURE__*/function () {
41792
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
41792
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
41793
41793
  var message, liveSessionUrl;
41794
41794
  return _regeneratorRuntime.wrap(function _callee$(_context) {
41795
41795
  while (1) switch (_context.prev = _context.next) {
@@ -41841,7 +41841,7 @@ var InviteFriendDialog = function InviteFriendDialog(props) {
41841
41841
  return _generateLiveSessionUrl.apply(this, arguments);
41842
41842
  }
41843
41843
  function _generateLiveSessionUrl() {
41844
- _generateLiveSessionUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(message) {
41844
+ _generateLiveSessionUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(message) {
41845
41845
  var url;
41846
41846
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
41847
41847
  while (1) switch (_context2.prev = _context2.next) {
@@ -41960,7 +41960,7 @@ var FriendsSection = function FriendsSection(props) {
41960
41960
  return _onGroupCreated.apply(this, arguments);
41961
41961
  }
41962
41962
  function _onGroupCreated() {
41963
- _onGroupCreated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
41963
+ _onGroupCreated = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
41964
41964
  return _regeneratorRuntime.wrap(function _callee$(_context) {
41965
41965
  while (1) switch (_context.prev = _context.next) {
41966
41966
  case 0:
@@ -41981,7 +41981,7 @@ var FriendsSection = function FriendsSection(props) {
41981
41981
  return _fetchFriends.apply(this, arguments);
41982
41982
  }
41983
41983
  function _fetchFriends() {
41984
- _fetchFriends = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
41984
+ _fetchFriends = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
41985
41985
  var _friends;
41986
41986
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
41987
41987
  while (1) switch (_context2.prev = _context2.next) {
@@ -42317,7 +42317,7 @@ var RequestDialog = function RequestDialog(props) {
42317
42317
  isLoading = _useState2[0],
42318
42318
  setIsLoading = _useState2[1];
42319
42319
  var doSendEmail = /*#__PURE__*/function () {
42320
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
42320
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
42321
42321
  var consultantId, clientRequest, url;
42322
42322
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42323
42323
  while (1) switch (_context.prev = _context.next) {
@@ -42429,7 +42429,7 @@ function getGeoLocationFromPLZ(_x) {
42429
42429
  return _getGeoLocationFromPLZ.apply(this, arguments);
42430
42430
  }
42431
42431
  function _getGeoLocationFromPLZ() {
42432
- _getGeoLocationFromPLZ = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(zipCode) {
42432
+ _getGeoLocationFromPLZ = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(zipCode) {
42433
42433
  var geocoder, response;
42434
42434
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42435
42435
  while (1) switch (_context.prev = _context.next) {
@@ -42495,7 +42495,7 @@ var RetailerFinder = function RetailerFinder(props) {
42495
42495
  return _calculateAndSetCenter.apply(this, arguments);
42496
42496
  }
42497
42497
  function _calculateAndSetCenter() {
42498
- _calculateAndSetCenter = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
42498
+ _calculateAndSetCenter = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
42499
42499
  var geoLocation;
42500
42500
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
42501
42501
  while (1) switch (_context2.prev = _context2.next) {
@@ -42526,7 +42526,7 @@ var RetailerFinder = function RetailerFinder(props) {
42526
42526
  return _getRetailersForArea.apply(this, arguments);
42527
42527
  }
42528
42528
  function _getRetailersForArea() {
42529
- _getRetailersForArea = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(radius) {
42529
+ _getRetailersForArea = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(radius) {
42530
42530
  var response;
42531
42531
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
42532
42532
  while (1) switch (_context3.prev = _context3.next) {
@@ -42561,7 +42561,7 @@ var RetailerFinder = function RetailerFinder(props) {
42561
42561
  return _loadRetailers.apply(this, arguments);
42562
42562
  }
42563
42563
  function _loadRetailers() {
42564
- _loadRetailers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
42564
+ _loadRetailers = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
42565
42565
  var _retailers, retailers2;
42566
42566
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42567
42567
  while (1) switch (_context.prev = _context.next) {
@@ -42710,7 +42710,7 @@ var SupportSection = function SupportSection(props) {
42710
42710
  return _onLoad.apply(this, arguments);
42711
42711
  }
42712
42712
  function _onLoad() {
42713
- _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
42713
+ _onLoad = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
42714
42714
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42715
42715
  while (1) switch (_context.prev = _context.next) {
42716
42716
  case 0:
@@ -42749,7 +42749,7 @@ var SupportSection = function SupportSection(props) {
42749
42749
  return _onGroupCreated.apply(this, arguments);
42750
42750
  }
42751
42751
  function _onGroupCreated() {
42752
- _onGroupCreated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
42752
+ _onGroupCreated = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
42753
42753
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
42754
42754
  while (1) switch (_context2.prev = _context2.next) {
42755
42755
  case 0:
@@ -42821,7 +42821,7 @@ var LiveSessionView = function LiveSessionView(_ref) {
42821
42821
  return _onPageLoad.apply(this, arguments);
42822
42822
  }
42823
42823
  function _onPageLoad() {
42824
- _onPageLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
42824
+ _onPageLoad = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
42825
42825
  var conversations;
42826
42826
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42827
42827
  while (1) switch (_context.prev = _context.next) {
@@ -42883,7 +42883,7 @@ var LiveSessionView = function LiveSessionView(_ref) {
42883
42883
  return _leavePage.apply(this, arguments);
42884
42884
  }
42885
42885
  function _leavePage() {
42886
- _leavePage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
42886
+ _leavePage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
42887
42887
  var _settings$fallbackCom;
42888
42888
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
42889
42889
  while (1) switch (_context2.prev = _context2.next) {
@@ -42983,7 +42983,7 @@ var PlanningsTab = function PlanningsTab(props) {
42983
42983
  return _onArrowClick.apply(this, arguments);
42984
42984
  }
42985
42985
  function _onArrowClick() {
42986
- _onArrowClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(activePlanning) {
42986
+ _onArrowClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(activePlanning) {
42987
42987
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42988
42988
  while (1) switch (_context.prev = _context.next) {
42989
42989
  case 0:
@@ -43123,7 +43123,7 @@ var RequestTab = function RequestTab(props) {
43123
43123
  return _onMenuItemClick.apply(this, arguments);
43124
43124
  }
43125
43125
  function _onMenuItemClick() {
43126
- _onMenuItemClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(requestStatus) {
43126
+ _onMenuItemClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(requestStatus) {
43127
43127
  return _regeneratorRuntime.wrap(function _callee$(_context) {
43128
43128
  while (1) switch (_context.prev = _context.next) {
43129
43129
  case 0:
@@ -43260,8 +43260,8 @@ var ConsultantDashboardMap = function ConsultantDashboardMap(_ref) {
43260
43260
  _useState6 = _slicedToArray(_useState5, 2),
43261
43261
  markerPositions = _useState6[0],
43262
43262
  setMarkerPositions = _useState6[1];
43263
- var onLoad = useCallback( /*#__PURE__*/function () {
43264
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mapInstance) {
43263
+ var onLoad = useCallback(/*#__PURE__*/function () {
43264
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(mapInstance) {
43265
43265
  var organisationPosition;
43266
43266
  return _regeneratorRuntime.wrap(function _callee$(_context) {
43267
43267
  while (1) switch (_context.prev = _context.next) {
@@ -43286,7 +43286,7 @@ var ConsultantDashboardMap = function ConsultantDashboardMap(_ref) {
43286
43286
  return _setMarkers.apply(this, arguments);
43287
43287
  }
43288
43288
  function _setMarkers() {
43289
- _setMarkers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
43289
+ _setMarkers = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
43290
43290
  var positions, _iterator, _step, _zipCode, position;
43291
43291
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
43292
43292
  while (1) switch (_context2.prev = _context2.next) {
@@ -43429,7 +43429,7 @@ var ConsultantDashboardView = function ConsultantDashboardView(_ref) {
43429
43429
  return _onLoad.apply(this, arguments);
43430
43430
  }
43431
43431
  function _onLoad() {
43432
- _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
43432
+ _onLoad = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
43433
43433
  var clientRequestsRequest, _activePlannings;
43434
43434
  return _regeneratorRuntime.wrap(function _callee$(_context) {
43435
43435
  while (1) switch (_context.prev = _context.next) {
@@ -43475,7 +43475,7 @@ var ConsultantDashboardView = function ConsultantDashboardView(_ref) {
43475
43475
  return _getOnlineStates.apply(this, arguments);
43476
43476
  }
43477
43477
  function _getOnlineStates() {
43478
- _getOnlineStates = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(requests) {
43478
+ _getOnlineStates = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(requests) {
43479
43479
  var userIds, response, onlineStateObject;
43480
43480
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
43481
43481
  while (1) switch (_context2.prev = _context2.next) {
@@ -43510,7 +43510,7 @@ var ConsultantDashboardView = function ConsultantDashboardView(_ref) {
43510
43510
  return _pollOnlineStates.apply(this, arguments);
43511
43511
  }
43512
43512
  function _pollOnlineStates() {
43513
- _pollOnlineStates = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(requests) {
43513
+ _pollOnlineStates = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(requests) {
43514
43514
  var intervalId;
43515
43515
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
43516
43516
  while (1) switch (_context3.prev = _context3.next) {
@@ -43559,7 +43559,7 @@ var ConsultantDashboardView = function ConsultantDashboardView(_ref) {
43559
43559
  return _onRequestClick.apply(this, arguments);
43560
43560
  }
43561
43561
  function _onRequestClick() {
43562
- _onRequestClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(request) {
43562
+ _onRequestClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(request) {
43563
43563
  var geoLocation;
43564
43564
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
43565
43565
  while (1) switch (_context4.prev = _context4.next) {
@@ -43581,7 +43581,7 @@ var ConsultantDashboardView = function ConsultantDashboardView(_ref) {
43581
43581
  return _onActivePlanningClick.apply(this, arguments);
43582
43582
  }
43583
43583
  function _onActivePlanningClick() {
43584
- _onActivePlanningClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(activePlanning) {
43584
+ _onActivePlanningClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(activePlanning) {
43585
43585
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
43586
43586
  while (1) switch (_context5.prev = _context5.next) {
43587
43587
  case 0:
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 478.diva-support.umd.min.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkCrystaldesignDivaSupport=self.webpackChunkCrystaldesignDivaSupport||[]).push([[478],{61478:(e,t,n)=>{n.r(t),n.d(t,{default:()=>q});var r=n(41594),a=n(12108),o=n(66557),i=n(28742),s=n(10725),l=n.n(s),c=n(75298),u=n(970),d=n(76666),h=n(97975),v=n(94020),p=n(1240),g=n(19681),w=n(72919),x=n.n(w),f=n(82246);function OpenId(){var e,t,n,r=(0,a.IB)(),o=r.configurationStore,i=r.authorizationStore,s=(0,g.B)().t,l=null===(e=i.state)||void 0===e?void 0:e.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(null==l?void 0:l.google)&&(0,f.jsxs)(p.A,{className:x()(c.Ob,c.q7),onClick:function onClick(){var e;return i.openOAuthLogin("google",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{}),s("auth.login.google")]}),(null==l?void 0:l.microsoft)&&(0,f.jsxs)(p.A,{className:x()(c.Ob,c.l$),onClick:function onClick(){var e;return i.openOAuthLogin("microsoft",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{}),s("auth.login.microsoft")]}),(null==l?void 0:l.generic)&&(0,f.jsxs)(p.A,{className:c.Ob,style:{backgroundColor:null!==(t=l.generic.backgroundColor)&&void 0!==t?t:o.theme.palette.secondary.main,color:null!==(n=l.generic.color)&&void 0!==n?n:o.theme.palette.secondary.contrastText},onClick:function onClick(){var e;return i.openOAuthLogin("genericOpenId",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{style:l.generic.logo?{backgroundImage:"url(".concat(l.generic.logo,")")}:{}}),s("auth.login.generic")]})]})}var m=n(85051),j=(0,m.tZ)("Framework","Login");const A=(0,u.PA)((function Login(){var e,t,n,s,u=(0,a.IB)(),w=u.authorizationStore,x=u.authorizationHandler,m=(0,r.useState)("enter"),A=(0,i.A)(m,2),k=A[0],y=A[1],C=(0,r.useState)(null!==(e=null===(t=w.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),M=(0,i.A)(C,2),L=M[0],S=M[1],N=(0,r.useState)(""),I=(0,i.A)(N,2),b=I[0],z=I[1],E=(0,r.useState)(""),D=(0,i.A)(E,2),P=D[0],O=D[1],T=(0,r.useState)(!1),F=(0,i.A)(T,2),B=F[0],_=F[1],R=(0,r.useState)(w.state.invitationId),U=(0,i.A)(R,2),$=U[0],H=U[1],V=(0,r.useState)("LOGIN"==(null===(n=w.state)||void 0===n?void 0:n.type)?w.state.error:void 0),K=(0,i.A)(V,2),Q=K[0],W=K[1],Y=(0,g.B)().t,G=function(){var e=(0,o.A)(l().mark((function _callee(){var e,t;return l().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,$){n.next=6;break}return n.next=4,x.getInvitationValue("id",L);case 4:(e=n.sent)&&(e.isNewUser&&(w.close(),w.showRegister(void 0,L,!0)),H(!0),_(!0));case 6:return n.next=8,x.fetchLoginProvider({email:L});case 8:"standard"==(t=n.sent).provider?y("login"):w.openOAuthLogin(t.provider,w.state.organizationId),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(0),j.error(new d.p$("Error while fetching login provider",{cause:n.t0})),W("auth.error.password");case 16:case"end":return n.stop()}}),_callee,null,[[0,12]])})));return function onContinue(){return e.apply(this,arguments)}}(),q=function(){var e=(0,o.A)(l().mark((function _callee2(){return l().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.gP)(w.login(L,b,!1,w.state.organizationId,w.state.invitationId,P));case 3:S(""),z(""),W(void 0),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),j.error(new d.p$("Error while logging in",{cause:e.t0})),W($?"auth.error.passwordotp":"auth.error.password");case 12:case"end":return e.stop()}}),_callee2,null,[[0,8]])})));return function onLogin(){return e.apply(this,arguments)}}(),Z=function(){var e=(0,o.A)(l().mark((function _callee3(){return l().wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:w.showRequestNewPassword(L);case 1:case"end":return e.stop()}}),_callee3)})));return function resetPassword(){return e.apply(this,arguments)}}(),X="enter"==k&&0==L.length||"enter"!=k&&0==b.length;B&&!X&&(X=0==P.length);var J=null===(s=w.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:Y("auth.title.login")}),(0,f.jsx)("p",{children:Y("auth.text.login","")}),!!Q&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{id:"loginerrortext",children:Y(Q)})]}),(0,f.jsx)(OpenId,{}),((null==J?void 0:J.generic)||(null==J?void 0:J.google)||(null==J?void 0:J.microsoft))&&J.standard&&(0,f.jsx)("div",{className:c.me,children:"or"}),(null==J?void 0:J.standard)&&(0,f.jsxs)(f.Fragment,{children:["enter"==k&&(0,f.jsxs)("form",{children:[(0,f.jsx)(v.A,{id:"username",value:L,autoComplete:"username",autoFocus:!0,placeholder:Y("auth.input.email"),onChange:function onChange(e){return S(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&G()}}),(0,f.jsx)(v.A,{value:b,id:"password",type:"password",autoComplete:"current-password",hidden:!0,autoFocus:!0,placeholder:Y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&q()}})]}),"login"==k&&(0,f.jsxs)("form",{children:[B&&(0,f.jsx)(v.A,{value:P,type:"text",autoFocus:!0,placeholder:Y("auth.input.otp"),onChange:function onChange(e){return O(e.target.value)}}),(0,f.jsx)("label",{className:c.eK,onClick:function reset(){y("enter"),S(""),z(""),W(void 0)},children:(0,f.jsx)(v.A,{value:L,readOnly:!0,placeholder:Y("auth.input.email")})}),(0,f.jsx)(v.A,{value:b,type:"password",id:"password",autoFocus:!0,placeholder:Y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&q()}}),(0,f.jsx)("div",{className:c.nf,style:{textAlign:"right"},onClick:Z,children:Y("auth.button.forgotpassword")})]}),(0,f.jsx)(p.A,{id:"submit",disabled:X,onClick:"enter"==k?G:q,children:Y("enter"==k?"auth.button.continue":"auth.button.login")})]})]})}));var k=(0,m.tZ)("Framework","RequestNewPassword");function RequestNewPassword(e){var t=e.initEmail,n=(0,a.IB)(),s=n.authorizationStore,u=n.apiHandler,h=n.loadingAndErrorStore,w=(0,r.useState)(t),x=(0,i.A)(w,2),m=x[0],j=x[1],A=(0,r.useState)(!1),y=(0,i.A)(A,2),C=y[0],M=y[1],L=(0,r.useState)(),S=(0,i.A)(L,2),N=S[0],I=S[1],b=(0,r.useState)(),z=(0,i.A)(b,2),E=z[0],D=z[1],P=(0,g.B)().t,O=function(){var e=(0,o.A)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,D(!0),h.toggleLoading("SendPassword"),e.next=5,u.sendPasswordRecoveryMail({email:m});case 5:D(!1),h.toggleLoading("SendPassword"),M(!0),I(void 0),e.next=17;break;case 11:e.prev=11,e.t0=e.catch(0),k.error(new d.p$("Error while sending password recovery mail",{cause:e.t0})),I("auth.error.resetpassword"),D(!1),h.toggleLoading("SendPassword");case 17:case"end":return e.stop()}}),_callee,null,[[0,11]])})));return function resetPassword(){return e.apply(this,arguments)}}();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:P("auth.title.resetpassword")}),(0,f.jsx)("p",{children:P("auth.info.resetdescription")}),!!N&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:P(N)})]}),C&&(0,f.jsxs)("div",{className:c.kX,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:P("auth.info.resetpassword")})]}),!C&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(v.A,{value:m,autoFocus:!0,placeholder:P("auth.input.email"),onChange:function onChange(e){return j(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&O()}}),(0,f.jsx)(p.A,{disabled:0==m.length,onClick:O,children:P("auth.button.resetpassword")})]}),C&&(0,f.jsx)(p.A,{disabled:E,onClick:function toLogin(){s.close(),s.showLogin()},children:P("auth.button.login")})]})}function Errormessage(e){var t=e.hasError,n=e.authErrorsg,r=(0,g.B)().t;return(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),"INVALID"==t&&(0,f.jsx)("div",{children:r("auth.error.verifypassword")}),"SERVER"==t&&(0,f.jsx)("div",{children:n})]})}var y=(0,m.tZ)("Framework","cfhange-password");function ChangePassword(e){var t,n=e.token,s=(0,a.IB)(),u=s.configurationStore,h=s.authorizationStore,w=s.apiHandler,x=(s.loadingAndErrorStore,(0,r.useState)("")),m=(0,i.A)(x,2),j=m[0],A=m[1],k=(0,r.useState)(""),C=(0,i.A)(k,2),M=C[0],L=C[1],S=(0,r.useState)(!1),N=(0,i.A)(S,2),I=N[0],b=N[1],z=(0,r.useState)(),E=(0,i.A)(z,2),D=E[0],P=E[1],O=(0,r.useState)(""),T=(0,i.A)(O,2),F=T[0],B=T[1],_=(0,r.useRef)(null),R=(0,g.B)().t;(0,r.useEffect)((function(){j===M&&P(void 0)}),[j,M]);var U=function(){var e=(0,o.A)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(B(R("auth.error.verifypasswordserver")),!(j.length<8||j!==M)){e.next=4;break}return P("INVALID"),e.abrupt("return");case 4:return e.prev=4,e.next=7,w.resetPassword({password:j,token:n});case 7:b(!0),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),$(e.t0);case 13:case"end":return e.stop()}}),_callee,null,[[4,10]])})));return function resetPassword(){return e.apply(this,arguments)}}(),$=function handleError(e){if(e instanceof d.p$){if("AUTH_0003"===e.name)B(R("auth.error.verifypasswordtokenerror",{errormsg:R("auth.error.tokenexpired")}));else B(R("auth.error.verifypasswordserver",e.message));y.error(e)}y.error(new d.p$("Error while resetting password",{cause:e})),P("SERVER")};return"SERVER"===D?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Errormessage,{hasError:D,authErrorsg:F}),(0,f.jsx)(p.A,{onClick:function onClickRequestNewPassword(){h.showRequestNewPassword("")},children:R("auth.button.resetpassword")})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:R("auth.title.verifypassword")}),I&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:c.kX,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:R("auth.info.verifypassword")})]}),(null===(t=u.authentication.resetPassword)||void 0===t?void 0:t.returnToLogin)&&(0,f.jsx)(p.A,{onClick:function goToLogin(){h.close(),h.showLogin()},children:R("auth.button.login")})]}),!I&&(0,f.jsxs)(f.Fragment,{children:[D&&(0,f.jsx)(Errormessage,{hasError:D,authErrorsg:F}),(0,f.jsxs)("form",{children:[(0,f.jsx)(v.A,{value:j,autoFocus:!0,placeholder:R("auth.input.password"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return A(e.target.value)},onKeyPress:function onKeyPress(e){var t;return"Enter"==e.key&&(null===(t=_.current)||void 0===t?void 0:t.focus())}}),(0,f.jsx)(v.A,{ref:_,value:M,placeholder:R("auth.input.verifypassword"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return L(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&U()}})]}),(0,f.jsx)(p.A,{disabled:!j||!M,onClick:U,children:R("auth.button.save")})]})]})}var C=n(38279);function WelcomeScreen(e){var t=e.isNewUser,n=e.invitationId,s=(0,a.IB)(),u=s.authorizationStore,d=s.authorizationHandler,h=(0,r.useState)(""),v=(0,i.A)(h,2),w=v[0],x=v[1],m=(0,g.B)().t,j=function(){var e=(0,o.A)(l().mark((function _callee(){var e;return l().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,checkInvitation();case 2:(e=t.sent)&&(u.close(),u.showLogin(void 0,void 0,void 0,n,e));case 4:case"end":return t.stop()}}),_callee)})));return function toLogin(){return e.apply(this,arguments)}}(),A=function(){var e=(0,o.A)(l().mark((function _callee2(){var e;return l().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,checkInvitation();case 2:(e=t.sent)&&(u.close(),u.showRegister(n,e));case 4:case"end":return t.stop()}}),_callee2)})));return function toRegister(){return e.apply(this,arguments)}}();function checkInvitation(){return _checkInvitation.apply(this,arguments)}function _checkInvitation(){return _checkInvitation=(0,o.A)(l().mark((function _callee3(){var e,t,n;return l().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return t=null===(e=u.state)||void 0===e?void 0:e.invitationId,r.next=3,d.getInvitationValue("email",t);case 3:if(!(n=r.sent)){r.next=8;break}return r.abrupt("return",n.email);case 8:return x("Invitation not found"),r.abrupt("return",void 0);case 10:case"end":return r.stop()}}),_callee3)}))),_checkInvitation.apply(this,arguments)}return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:m("auth.title.welcome")}),(0,f.jsx)("p",{children:m("auth.info.welcomedescription")}),w&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:m(w)})]}),t&&!w&&(0,f.jsx)(p.A,{onClick:A,children:m("auth.title.register")}),!t&&!w&&(0,f.jsx)(p.A,{onClick:j,children:m("auth.button.login")})]})}var M=n(93494),L=n(80250),S=n(90120),N=(n(13886),n(40203)),I=n(44134),b=n(98686),z=n(41635),E=n(36224),D=n(49874),P=r.forwardRef((function SwitchBase(e,t){var n=e.autoFocus,a=e.checked,o=e.checkedIcon,i=e.classes,s=e.className,l=e.defaultChecked,c=e.disabled,u=e.icon,d=e.id,h=e.inputProps,v=e.inputRef,p=e.name,g=e.onBlur,w=e.onChange,x=e.onFocus,f=e.readOnly,m=e.required,j=e.tabIndex,A=e.type,k=e.value,y=(0,S.A)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),C=(0,b.A)({controlled:a,default:Boolean(l),name:"SwitchBase",state:"checked"}),M=(0,I.A)(C,2),E=M[0],P=M[1],O=(0,z.A)(),T=c;O&&void 0===T&&(T=O.disabled);var F="checkbox"===A||"radio"===A;return r.createElement(D.A,(0,L.A)({component:"span",className:(0,N.A)(i.root,s,E&&i.checked,T&&i.disabled),disabled:T,tabIndex:null,role:void 0,onFocus:function handleFocus(e){x&&x(e),O&&O.onFocus&&O.onFocus(e)},onBlur:function handleBlur(e){g&&g(e),O&&O.onBlur&&O.onBlur(e)},ref:t},y),r.createElement("input",(0,L.A)({autoFocus:n,checked:a,defaultChecked:l,className:i.input,disabled:T,id:F&&d,name:p,onChange:function handleInputChange(e){var t=e.target.checked;P(t),w&&w(e,t)},readOnly:f,ref:v,required:m,tabIndex:j,type:A,value:k},h)),E?o:u)}));const O=(0,E.A)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(P);var T=n(95261);const F=(0,T.A)(r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),B=(0,T.A)(r.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox");var _=n(64287);const R=(0,T.A)(r.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");var U=n(10433),$=r.createElement(B,null),H=r.createElement(F,null),V=r.createElement(R,null),K=r.forwardRef((function Checkbox(e,t){var n=e.checkedIcon,a=void 0===n?$:n,o=e.classes,i=e.color,s=void 0===i?"secondary":i,l=e.icon,c=void 0===l?H:l,u=e.indeterminate,d=void 0!==u&&u,h=e.indeterminateIcon,v=void 0===h?V:h,p=e.inputProps,g=e.size,w=void 0===g?"medium":g,x=(0,S.A)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),f=d?v:c,m=d?v:a;return r.createElement(O,(0,L.A)({type:"checkbox",classes:{root:(0,N.A)(o.root,o["color".concat((0,U.A)(s))],d&&o.indeterminate),checked:o.checked,disabled:o.disabled},color:s,inputProps:(0,L.A)({"data-indeterminate":d},p),icon:r.cloneElement(f,{fontSize:void 0===f.props.fontSize&&"small"===w?w:f.props.fontSize}),checkedIcon:r.cloneElement(m,{fontSize:void 0===m.props.fontSize&&"small"===w?w:m.props.fontSize}),ref:t},x))}));const Q=(0,E.A)((function styles(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,_.Rv)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,_.Rv)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(K);var W=(0,m.tZ)("Framework","Register");const Y=(0,u.PA)((function Register(){var e,t,n,s,u,w,x=(0,a.IB)(),m=x.authorizationStore,j=x.configurationStore,A=(0,g.B)().t,k=(0,r.useState)(null!==(e=null===(t=m.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),y=(0,i.A)(k,2),C=y[0],L=y[1],S=(0,r.useState)(""),N=(0,i.A)(S,2),I=N[0],b=N[1],z=(0,r.useState)(""),E=(0,i.A)(z,2),D=E[0],P=E[1],O=(0,r.useState)(""),T=(0,i.A)(O,2),F=T[0],B=T[1],_=(0,r.useState)(""),R=(0,i.A)(_,2),U=R[0],$=R[1],H=(0,r.useState)(""),V=(0,i.A)(H,2),K=V[0],Y=V[1],G=(0,r.useState)(""),q=(0,i.A)(G,2),Z=q[0],X=q[1],J=(0,r.useState)(!1),ee=(0,i.A)(J,2),te=ee[0],ne=ee[1],re=function(){var e=(0,o.A)(l().mark((function _callee(){var e;return l().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,h.gP)(m.register(C,I,U,F,null===(e=m.state)||void 0===e?void 0:e.invitationId,Z));case 3:L(""),b(""),P(""),$(""),B(""),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),Y("auth.error.invitationotp"),W.error(new d.p$("Error while registering",{cause:t.t0}));case 14:case"end":return t.stop()}}),_callee,null,[[0,10]])})));return function onRegister(){return e.apply(this,arguments)}}(),ae=null===(n=m.state)||void 0===n?void 0:n.useOtp,oe=function validPassword(){return ae?null!=Z&&""!==Z&&I==D&&""!=I&&null!=I&&te:I==D&&""!=I&&null!=I&&te},ie=null===(s=m.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:A("auth.title.register")}),(0,f.jsx)("p",{children:A("auth.text.register","")}),!!K&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:A(K)})]}),(0,f.jsx)(OpenId,{}),((null==ie?void 0:ie.generic)||(null==ie?void 0:ie.google)||(null==ie?void 0:ie.microsoft))&&ie.standard&&(0,f.jsx)("div",{className:c.me,children:"or"}),(null==ie?void 0:ie.standard)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("form",{children:[ae&&(0,f.jsx)(v.A,{type:"text",value:Z,placeholder:A("auth.input.otp"),onChange:function onChange(e){return X(e.target.value)}}),(0,f.jsx)(v.A,{value:U,autoFocus:!0,placeholder:A("backoffice.form.userdetails.items.name"),onChange:function onChange(e){return $(e.target.value)}}),(0,f.jsx)(v.A,{value:F,autoFocus:!0,placeholder:A("backoffice.form.userdetails.items.familyName"),onChange:function onChange(e){return B(e.target.value)}}),(0,f.jsx)(v.A,{value:C,autoComplete:"email",autoFocus:!0,placeholder:A("auth.input.email"),disabled:!0}),(0,f.jsx)(v.A,{value:I,type:"password",autoFocus:!0,placeholder:A("auth.input.password"),onChange:function onChange(e){return b(e.target.value)}}),(0,f.jsx)(v.A,{value:D,type:"password",autoFocus:!0,placeholder:A("auth.input.repeatpassword"),onChange:function onChange(e){return P(e.target.value)}}),(0,f.jsxs)("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[(0,f.jsx)(Q,{name:"checkAGB",checked:te,onClick:function onClick(){return ne(!te)}}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",fontSize:9},children:[(0,f.jsx)("span",{children:A("auth.acceptprivacyandagb")}),(0,f.jsxs)("span",{children:[(0,f.jsx)("a",{target:"_blank",href:null!==(u=j.navigation.tosUrl)&&void 0!==u?u:"https://www.diva-portal.de/agb",children:A("auth.GeneralTerms")}),", ",(0,f.jsx)("a",{target:"_blank",href:null!==(w=j.navigation.privacyUrl)&&void 0!==w?w:"https://www.diva-portal.de/datenschutz",children:A("auth.privacypolicy")})]})]})]}),(0,f.jsx)(M.A,{style:{color:"#FF8C00",marginTop:10,fontSize:14},hidden:oe(),children:A("auth.input.passwordsnotmatch")})]}),(0,f.jsx)(p.A,{disabled:!oe(),onClick:oe()?re:void 0,children:A("auth.input.login")})]})]})}));var G=(0,u.PA)((function(){var e,t=(0,a.IB)().authorizationStore;switch(null===(e=t.state)||void 0===e?void 0:e.type){case"LOGIN":return(0,f.jsx)(A,{});case"REQUEST_NEW_PASSWORD":return(0,f.jsx)(RequestNewPassword,{initEmail:t.state.email});case"CHANGE_PASSWORD":return(0,f.jsx)(ChangePassword,{token:t.state.token});case"WELCOME":return(0,f.jsx)(WelcomeScreen,{isNewUser:t.state.isNewUser,invitationId:t.state.invitationId});case"REGISTER":return(0,f.jsx)(Y,{});case"INVITATION_EXPIRED":return(0,f.jsx)("h1",{children:"Abgelaufen"});default:return(0,f.jsx)(f.Fragment,{})}}));const q=(0,u.PA)((function Auth(){var e,t,n,o=(0,a.IB)(),i=o.authorizationStore,s=o.configurationStore,l=o.dataStore,u=(o.authorizationHandler,(0,r.useMemo)((function(){var e,t,n,r="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgMTAwMCAyOTMuNjUiPjxwYXRoIGQ9Ik0yNTAuODksMTQ3LjNjLTMuMTgtNzQtMzAuNC0xNDMuMTgtMTQxLjczLTE0My4xOEwwLDQuMjZBMzA3Ljg2LDMwNy44NiwwLDAsMSwyNi4xMiw2MC43aDc0LjJjNTIuODYsMCw3NiwyNS42OCw3OC42MSw4NS4yOSwyLjY2LDYxLjgxLTE4LjI5LDg3LjkyLTcxLjE1LDg3LjkySDc5LjJsLTQ2LjcxLjUyYTI4Ny4yOSwyODcuMjksMCwwLDEtMjAsNTMuODhoMTA5YzExMS4zMiwwLDEzMi42Ny02NywxMjkuNDgtMTQxTTMwNi44NCwyODloNzEuMjNWMGEzMDAuMDcsMzAwLjA3LDAsMCwxLTcxLjIzLDI1LjkyWm0zMTguOC42Mkw3MjYuNTkuODVhMzAwLDMwMCwwLDAsMS04My42NSwzMi4yNEw1NzcuMTEsMjI0LDUxMS4yOSwzMy4wOUEzMDAsMzAwLDAsMCwxLDQyNy42NC44NWwxMDEsMjg4Ljc2Wm0zNzQuMzYsNEw4OTkuMDUsNC45MUg4MDJMNzc1LjE0LDgxLjc0LDcwMS4wNSwyOTMuNjVBMzAwLjMyLDMwMC4zMiwwLDAsMSw3ODUsMjYxLjM1bDYuNzktMjEsMTkuMTQtNTcuNTRMODUwLjUyLDYybDQwLjA3LDEyMC44NSwxOC43LDU3LjU0LDcsMjFBMzAwLjIsMzAwLjIsMCwwLDEsMTAwMCwyOTMuNjUiIGZpbGw9IiNiM2IzYjMiLz48L3N2Zz4=";if(null!==(e=l.organization)&&void 0!==e&&e.logoUrl)r=null===(n=l.organization)||void 0===n?void 0:n.logoUrl;else if(null!==(t=s.navigation)&&void 0!==t&&t.logoUrl){var a;r=null===(a=s.navigation)||void 0===a?void 0:a.logoUrl}return r}),[null===(e=s.navigation)||void 0===e?void 0:e.logoUrl,null===(t=l.organization)||void 0===t?void 0:t.logoUrl]));return null==i.state?(0,f.jsx)(f.Fragment,{}):(0,f.jsxs)("div",{className:c.j2,children:[(0,f.jsxs)("div",{className:c.TG,children:[(0,f.jsx)("div",{className:c.r$,style:{height:null!==(n=s.configuration.loginLogoHeight)&&void 0!==n?n:50,backgroundImage:"url(".concat(u,")")}}),(0,f.jsx)(G,{})]}),s.authentication.contentBox&&(0,f.jsx)("div",{style:{width:"calc(100% - 400px)",height:"100%",position:"relative",overflow:"hidden"},children:(0,f.jsx)(C.s,{settings:{contentBoxProps:(0,h.HO)(s.authentication.contentBox.props)}})})]})}))}}]);
2
+ "use strict";(self.webpackChunkCrystaldesignDivaSupport=self.webpackChunkCrystaldesignDivaSupport||[]).push([[478],{61478:(e,t,n)=>{n.r(t),n.d(t,{default:()=>q});var r=n(41594),a=n(12108),o=n(66557),i=n(28742),s=n(10725),l=n.n(s),c=n(75298),u=n(970),d=n(76666),h=n(97975),v=n(94020),p=n(1240),g=n(19681),w=n(72919),x=n.n(w),f=n(82246);function OpenId(){var e,t,n,r=(0,a.IB)(),o=r.configurationStore,i=r.authorizationStore,s=(0,g.B)().t,l=null===(e=i.state)||void 0===e?void 0:e.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(null==l?void 0:l.google)&&(0,f.jsxs)(p.A,{className:x()(c.Ob,c.q7),onClick:function onClick(){var e;return i.openOAuthLogin("google",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{}),s("auth.login.google")]}),(null==l?void 0:l.microsoft)&&(0,f.jsxs)(p.A,{className:x()(c.Ob,c.l$),onClick:function onClick(){var e;return i.openOAuthLogin("microsoft",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{}),s("auth.login.microsoft")]}),(null==l?void 0:l.generic)&&(0,f.jsxs)(p.A,{className:c.Ob,style:{backgroundColor:null!==(t=l.generic.backgroundColor)&&void 0!==t?t:o.theme.palette.secondary.main,color:null!==(n=l.generic.color)&&void 0!==n?n:o.theme.palette.secondary.contrastText},onClick:function onClick(){var e;return i.openOAuthLogin("genericOpenId",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{style:l.generic.logo?{backgroundImage:"url(".concat(l.generic.logo,")")}:{}}),s("auth.login.generic")]})]})}var m=n(85051),j=(0,m.tZ)("Framework","Login");const A=(0,u.PA)((function Login(){var e,t,n,s,u=(0,a.IB)(),w=u.authorizationStore,x=u.authorizationHandler,m=(0,r.useState)("enter"),A=(0,i.A)(m,2),k=A[0],y=A[1],C=(0,r.useState)(null!==(e=null===(t=w.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),M=(0,i.A)(C,2),I=M[0],L=M[1],S=(0,r.useState)(""),N=(0,i.A)(S,2),b=N[0],z=N[1],E=(0,r.useState)(""),D=(0,i.A)(E,2),P=D[0],O=D[1],T=(0,r.useState)(!1),F=(0,i.A)(T,2),B=F[0],_=F[1],R=(0,r.useState)(w.state.invitationId),U=(0,i.A)(R,2),$=U[0],H=U[1],V=(0,r.useState)("LOGIN"==(null===(n=w.state)||void 0===n?void 0:n.type)?w.state.error:void 0),K=(0,i.A)(V,2),Q=K[0],W=K[1],Y=(0,g.B)().t,G=function(){var e=(0,o.A)(l().mark((function _callee(){var e,t;return l().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,$){n.next=6;break}return n.next=4,x.getInvitationValue("id",I);case 4:(e=n.sent)&&(e.isNewUser&&(w.close(),w.showRegister(void 0,I,!0)),H(!0),_(!0));case 6:return n.next=8,x.fetchLoginProvider({email:I});case 8:"standard"==(t=n.sent).provider?y("login"):w.openOAuthLogin(t.provider,w.state.organizationId,w.state.invitationId),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(0),j.error(new d.p$("Error while fetching login provider",{cause:n.t0})),W("auth.error.password");case 16:case"end":return n.stop()}}),_callee,null,[[0,12]])})));return function onContinue(){return e.apply(this,arguments)}}(),q=function(){var e=(0,o.A)(l().mark((function _callee2(){return l().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.gP)(w.login(I,b,!1,w.state.organizationId,w.state.invitationId,P));case 3:L(""),z(""),W(void 0),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),j.error(new d.p$("Error while logging in",{cause:e.t0})),W($?"auth.error.passwordotp":"auth.error.password");case 12:case"end":return e.stop()}}),_callee2,null,[[0,8]])})));return function onLogin(){return e.apply(this,arguments)}}(),Z=function(){var e=(0,o.A)(l().mark((function _callee3(){return l().wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:w.showRequestNewPassword(I);case 1:case"end":return e.stop()}}),_callee3)})));return function resetPassword(){return e.apply(this,arguments)}}(),X="enter"==k&&0==I.length||"enter"!=k&&0==b.length;B&&!X&&(X=0==P.length);var J=null===(s=w.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:Y("auth.title.login")}),(0,f.jsx)("p",{children:Y("auth.text.login","")}),!!Q&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{id:"loginerrortext",children:Y(Q)})]}),(0,f.jsx)(OpenId,{}),((null==J?void 0:J.generic)||(null==J?void 0:J.google)||(null==J?void 0:J.microsoft))&&J.standard&&(0,f.jsx)("div",{className:c.me,children:"or"}),(null==J?void 0:J.standard)&&(0,f.jsxs)(f.Fragment,{children:["enter"==k&&(0,f.jsxs)("form",{children:[(0,f.jsx)(v.A,{id:"username",value:I,autoComplete:"username",autoFocus:!0,placeholder:Y("auth.input.email"),onChange:function onChange(e){return L(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&G()}}),(0,f.jsx)(v.A,{value:b,id:"password",type:"password",autoComplete:"current-password",hidden:!0,autoFocus:!0,placeholder:Y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&q()}})]}),"login"==k&&(0,f.jsxs)("form",{children:[B&&(0,f.jsx)(v.A,{value:P,type:"text",autoFocus:!0,placeholder:Y("auth.input.otp"),onChange:function onChange(e){return O(e.target.value)}}),(0,f.jsx)("label",{className:c.eK,onClick:function reset(){y("enter"),L(""),z(""),W(void 0)},children:(0,f.jsx)(v.A,{value:I,readOnly:!0,placeholder:Y("auth.input.email")})}),(0,f.jsx)(v.A,{value:b,type:"password",id:"password",autoFocus:!0,placeholder:Y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&q()}}),(0,f.jsx)("div",{className:c.nf,style:{textAlign:"right"},onClick:Z,children:Y("auth.button.forgotpassword")})]}),(0,f.jsx)(p.A,{id:"submit",disabled:X,onClick:"enter"==k?G:q,children:Y("enter"==k?"auth.button.continue":"auth.button.login")})]})]})}));var k=(0,m.tZ)("Framework","RequestNewPassword");function RequestNewPassword(e){var t=e.initEmail,n=(0,a.IB)(),s=n.authorizationStore,u=n.apiHandler,h=n.loadingAndErrorStore,w=(0,r.useState)(t),x=(0,i.A)(w,2),m=x[0],j=x[1],A=(0,r.useState)(!1),y=(0,i.A)(A,2),C=y[0],M=y[1],I=(0,r.useState)(),L=(0,i.A)(I,2),S=L[0],N=L[1],b=(0,r.useState)(),z=(0,i.A)(b,2),E=z[0],D=z[1],P=(0,g.B)().t,O=function(){var e=(0,o.A)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,D(!0),h.toggleLoading("SendPassword"),e.next=5,u.sendPasswordRecoveryMail({email:m});case 5:D(!1),h.toggleLoading("SendPassword"),M(!0),N(void 0),e.next=17;break;case 11:e.prev=11,e.t0=e.catch(0),k.error(new d.p$("Error while sending password recovery mail",{cause:e.t0})),N("auth.error.resetpassword"),D(!1),h.toggleLoading("SendPassword");case 17:case"end":return e.stop()}}),_callee,null,[[0,11]])})));return function resetPassword(){return e.apply(this,arguments)}}();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:P("auth.title.resetpassword")}),(0,f.jsx)("p",{children:P("auth.info.resetdescription")}),!!S&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:P(S)})]}),C&&(0,f.jsxs)("div",{className:c.kX,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:P("auth.info.resetpassword")})]}),!C&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(v.A,{value:m,autoFocus:!0,placeholder:P("auth.input.email"),onChange:function onChange(e){return j(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&O()}}),(0,f.jsx)(p.A,{disabled:0==m.length,onClick:O,children:P("auth.button.resetpassword")})]}),C&&(0,f.jsx)(p.A,{disabled:E,onClick:function toLogin(){s.close(),s.showLogin()},children:P("auth.button.login")})]})}function Errormessage(e){var t=e.hasError,n=e.authErrorsg,r=(0,g.B)().t;return(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),"INVALID"==t&&(0,f.jsx)("div",{children:r("auth.error.verifypassword")}),"SERVER"==t&&(0,f.jsx)("div",{children:n})]})}var y=(0,m.tZ)("Framework","cfhange-password");function ChangePassword(e){var t,n=e.token,s=(0,a.IB)(),u=s.configurationStore,h=s.authorizationStore,w=s.apiHandler,x=(s.loadingAndErrorStore,(0,r.useState)("")),m=(0,i.A)(x,2),j=m[0],A=m[1],k=(0,r.useState)(""),C=(0,i.A)(k,2),M=C[0],I=C[1],L=(0,r.useState)(!1),S=(0,i.A)(L,2),N=S[0],b=S[1],z=(0,r.useState)(),E=(0,i.A)(z,2),D=E[0],P=E[1],O=(0,r.useState)(""),T=(0,i.A)(O,2),F=T[0],B=T[1],_=(0,r.useRef)(null),R=(0,g.B)().t;(0,r.useEffect)((function(){j===M&&P(void 0)}),[j,M]);var U=function(){var e=(0,o.A)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(B(R("auth.error.verifypasswordserver")),!(j.length<8||j!==M)){e.next=4;break}return P("INVALID"),e.abrupt("return");case 4:return e.prev=4,e.next=7,w.resetPassword({password:j,token:n});case 7:b(!0),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),$(e.t0);case 13:case"end":return e.stop()}}),_callee,null,[[4,10]])})));return function resetPassword(){return e.apply(this,arguments)}}(),$=function handleError(e){if(e instanceof d.p$){if("AUTH_0003"===e.name)B(R("auth.error.verifypasswordtokenerror",{errormsg:R("auth.error.tokenexpired")}));else B(R("auth.error.verifypasswordserver",e.message));y.error(e)}y.error(new d.p$("Error while resetting password",{cause:e})),P("SERVER")};return"SERVER"===D?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Errormessage,{hasError:D,authErrorsg:F}),(0,f.jsx)(p.A,{onClick:function onClickRequestNewPassword(){h.showRequestNewPassword("")},children:R("auth.button.resetpassword")})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:R("auth.title.verifypassword")}),N&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:c.kX,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:R("auth.info.verifypassword")})]}),(null===(t=u.authentication.resetPassword)||void 0===t?void 0:t.returnToLogin)&&(0,f.jsx)(p.A,{onClick:function goToLogin(){h.close(),h.showLogin()},children:R("auth.button.login")})]}),!N&&(0,f.jsxs)(f.Fragment,{children:[D&&(0,f.jsx)(Errormessage,{hasError:D,authErrorsg:F}),(0,f.jsxs)("form",{children:[(0,f.jsx)(v.A,{value:j,autoFocus:!0,placeholder:R("auth.input.password"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return A(e.target.value)},onKeyPress:function onKeyPress(e){var t;return"Enter"==e.key&&(null===(t=_.current)||void 0===t?void 0:t.focus())}}),(0,f.jsx)(v.A,{ref:_,value:M,placeholder:R("auth.input.verifypassword"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return I(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&U()}})]}),(0,f.jsx)(p.A,{disabled:!j||!M,onClick:U,children:R("auth.button.save")})]})]})}var C=n(38279);function WelcomeScreen(e){var t=e.isNewUser,n=e.invitationId,s=e.invitationOrgId,u=(0,a.IB)(),d=u.authorizationStore,h=u.authorizationHandler,v=(0,r.useState)(""),w=(0,i.A)(v,2),x=w[0],m=w[1],j=(0,g.B)().t,A=function(){var e=(0,o.A)(l().mark((function _callee(){var e;return l().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,checkInvitation();case 2:(e=t.sent)&&(d.close(),d.showLogin(void 0,void 0,s,n,e));case 4:case"end":return t.stop()}}),_callee)})));return function toLogin(){return e.apply(this,arguments)}}(),k=function(){var e=(0,o.A)(l().mark((function _callee2(){var e;return l().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,checkInvitation();case 2:(e=t.sent)&&(d.close(),d.showRegister(n,e));case 4:case"end":return t.stop()}}),_callee2)})));return function toRegister(){return e.apply(this,arguments)}}();function checkInvitation(){return _checkInvitation.apply(this,arguments)}function _checkInvitation(){return _checkInvitation=(0,o.A)(l().mark((function _callee3(){var e,t,n;return l().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return t=null===(e=d.state)||void 0===e?void 0:e.invitationId,r.next=3,h.getInvitationValue("email",t);case 3:if(!(n=r.sent)){r.next=8;break}return r.abrupt("return",n.email);case 8:return m("Invitation not found"),r.abrupt("return",void 0);case 10:case"end":return r.stop()}}),_callee3)}))),_checkInvitation.apply(this,arguments)}return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:j("auth.title.welcome")}),(0,f.jsx)("p",{children:j("auth.info.welcomedescription")}),x&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:j(x)})]}),t&&!x&&(0,f.jsx)(p.A,{onClick:k,children:j("auth.title.register")}),!t&&!x&&(0,f.jsx)(p.A,{onClick:A,children:j("auth.button.login")})]})}var M=n(93494),I=n(80250),L=n(90120),S=(n(13886),n(40203)),N=n(44134),b=n(98686),z=n(41635),E=n(36224),D=n(49874),P=r.forwardRef((function SwitchBase(e,t){var n=e.autoFocus,a=e.checked,o=e.checkedIcon,i=e.classes,s=e.className,l=e.defaultChecked,c=e.disabled,u=e.icon,d=e.id,h=e.inputProps,v=e.inputRef,p=e.name,g=e.onBlur,w=e.onChange,x=e.onFocus,f=e.readOnly,m=e.required,j=e.tabIndex,A=e.type,k=e.value,y=(0,L.A)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),C=(0,b.A)({controlled:a,default:Boolean(l),name:"SwitchBase",state:"checked"}),M=(0,N.A)(C,2),E=M[0],P=M[1],O=(0,z.A)(),T=c;O&&void 0===T&&(T=O.disabled);var F="checkbox"===A||"radio"===A;return r.createElement(D.A,(0,I.A)({component:"span",className:(0,S.A)(i.root,s,E&&i.checked,T&&i.disabled),disabled:T,tabIndex:null,role:void 0,onFocus:function handleFocus(e){x&&x(e),O&&O.onFocus&&O.onFocus(e)},onBlur:function handleBlur(e){g&&g(e),O&&O.onBlur&&O.onBlur(e)},ref:t},y),r.createElement("input",(0,I.A)({autoFocus:n,checked:a,defaultChecked:l,className:i.input,disabled:T,id:F&&d,name:p,onChange:function handleInputChange(e){var t=e.target.checked;P(t),w&&w(e,t)},readOnly:f,ref:v,required:m,tabIndex:j,type:A,value:k},h)),E?o:u)}));const O=(0,E.A)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(P);var T=n(95261);const F=(0,T.A)(r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),B=(0,T.A)(r.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox");var _=n(64287);const R=(0,T.A)(r.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");var U=n(10433),$=r.createElement(B,null),H=r.createElement(F,null),V=r.createElement(R,null),K=r.forwardRef((function Checkbox(e,t){var n=e.checkedIcon,a=void 0===n?$:n,o=e.classes,i=e.color,s=void 0===i?"secondary":i,l=e.icon,c=void 0===l?H:l,u=e.indeterminate,d=void 0!==u&&u,h=e.indeterminateIcon,v=void 0===h?V:h,p=e.inputProps,g=e.size,w=void 0===g?"medium":g,x=(0,L.A)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),f=d?v:c,m=d?v:a;return r.createElement(O,(0,I.A)({type:"checkbox",classes:{root:(0,S.A)(o.root,o["color".concat((0,U.A)(s))],d&&o.indeterminate),checked:o.checked,disabled:o.disabled},color:s,inputProps:(0,I.A)({"data-indeterminate":d},p),icon:r.cloneElement(f,{fontSize:void 0===f.props.fontSize&&"small"===w?w:f.props.fontSize}),checkedIcon:r.cloneElement(m,{fontSize:void 0===m.props.fontSize&&"small"===w?w:m.props.fontSize}),ref:t},x))}));const Q=(0,E.A)((function styles(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,_.Rv)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,_.Rv)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(K);var W=(0,m.tZ)("Framework","Register");const Y=(0,u.PA)((function Register(){var e,t,n,s,u,w,x=(0,a.IB)(),m=x.authorizationStore,j=x.configurationStore,A=(0,g.B)().t,k=(0,r.useState)(null!==(e=null===(t=m.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),y=(0,i.A)(k,2),C=y[0],I=y[1],L=(0,r.useState)(""),S=(0,i.A)(L,2),N=S[0],b=S[1],z=(0,r.useState)(""),E=(0,i.A)(z,2),D=E[0],P=E[1],O=(0,r.useState)(""),T=(0,i.A)(O,2),F=T[0],B=T[1],_=(0,r.useState)(""),R=(0,i.A)(_,2),U=R[0],$=R[1],H=(0,r.useState)(""),V=(0,i.A)(H,2),K=V[0],Y=V[1],G=(0,r.useState)(""),q=(0,i.A)(G,2),Z=q[0],X=q[1],J=(0,r.useState)(!1),ee=(0,i.A)(J,2),te=ee[0],ne=ee[1],re=function(){var e=(0,o.A)(l().mark((function _callee(){var e;return l().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,h.gP)(m.register(C,N,U,F,null===(e=m.state)||void 0===e?void 0:e.invitationId,Z));case 3:I(""),b(""),P(""),$(""),B(""),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),Y("auth.error.invitationotp"),W.error(new d.p$("Error while registering",{cause:t.t0}));case 14:case"end":return t.stop()}}),_callee,null,[[0,10]])})));return function onRegister(){return e.apply(this,arguments)}}(),ae=null===(n=m.state)||void 0===n?void 0:n.useOtp,oe=function validPassword(){return ae?null!=Z&&""!==Z&&N==D&&""!=N&&null!=N&&te:N==D&&""!=N&&null!=N&&te},ie=null===(s=m.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:A("auth.title.register")}),(0,f.jsx)("p",{children:A("auth.text.register","")}),!!K&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:A(K)})]}),(0,f.jsx)(OpenId,{}),((null==ie?void 0:ie.generic)||(null==ie?void 0:ie.google)||(null==ie?void 0:ie.microsoft))&&ie.standard&&(0,f.jsx)("div",{className:c.me,children:"or"}),(null==ie?void 0:ie.standard)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("form",{children:[ae&&(0,f.jsx)(v.A,{type:"text",value:Z,placeholder:A("auth.input.otp"),onChange:function onChange(e){return X(e.target.value)}}),(0,f.jsx)(v.A,{value:U,autoFocus:!0,placeholder:A("backoffice.form.userdetails.items.name"),onChange:function onChange(e){return $(e.target.value)}}),(0,f.jsx)(v.A,{value:F,autoFocus:!0,placeholder:A("backoffice.form.userdetails.items.familyName"),onChange:function onChange(e){return B(e.target.value)}}),(0,f.jsx)(v.A,{value:C,autoComplete:"email",autoFocus:!0,placeholder:A("auth.input.email"),disabled:!0}),(0,f.jsx)(v.A,{value:N,type:"password",autoFocus:!0,placeholder:A("auth.input.password"),onChange:function onChange(e){return b(e.target.value)}}),(0,f.jsx)(v.A,{value:D,type:"password",autoFocus:!0,placeholder:A("auth.input.repeatpassword"),onChange:function onChange(e){return P(e.target.value)}}),(0,f.jsxs)("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[(0,f.jsx)(Q,{name:"checkAGB",checked:te,onClick:function onClick(){return ne(!te)}}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",fontSize:9},children:[(0,f.jsx)("span",{children:A("auth.acceptprivacyandagb")}),(0,f.jsxs)("span",{children:[(0,f.jsx)("a",{target:"_blank",href:null!==(u=j.navigation.tosUrl)&&void 0!==u?u:"https://www.diva-portal.de/agb",children:A("auth.GeneralTerms")}),", ",(0,f.jsx)("a",{target:"_blank",href:null!==(w=j.navigation.privacyUrl)&&void 0!==w?w:"https://www.diva-portal.de/datenschutz",children:A("auth.privacypolicy")})]})]})]}),(0,f.jsx)(M.A,{style:{color:"#FF8C00",marginTop:10,fontSize:14},hidden:oe(),children:A("auth.input.passwordsnotmatch")})]}),(0,f.jsx)(p.A,{disabled:!oe(),onClick:oe()?re:void 0,children:A("auth.input.login")})]})]})}));var G=(0,u.PA)((function(){var e,t=(0,a.IB)().authorizationStore;switch(null===(e=t.state)||void 0===e?void 0:e.type){case"LOGIN":return(0,f.jsx)(A,{});case"REQUEST_NEW_PASSWORD":return(0,f.jsx)(RequestNewPassword,{initEmail:t.state.email});case"CHANGE_PASSWORD":return(0,f.jsx)(ChangePassword,{token:t.state.token});case"WELCOME":return(0,f.jsx)(WelcomeScreen,{isNewUser:t.state.isNewUser,invitationId:t.state.invitationId,invitationOrgId:t.state.invitationOrgId});case"REGISTER":return(0,f.jsx)(Y,{});case"INVITATION_EXPIRED":return(0,f.jsx)("h1",{children:"Abgelaufen"});default:return(0,f.jsx)(f.Fragment,{})}}));const q=(0,u.PA)((function Auth(){var e,t,n,o=(0,a.IB)(),i=o.authorizationStore,s=o.configurationStore,l=o.dataStore,u=(o.authorizationHandler,(0,r.useMemo)((function(){var e,t,n,r="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgMTAwMCAyOTMuNjUiPjxwYXRoIGQ9Ik0yNTAuODksMTQ3LjNjLTMuMTgtNzQtMzAuNC0xNDMuMTgtMTQxLjczLTE0My4xOEwwLDQuMjZBMzA3Ljg2LDMwNy44NiwwLDAsMSwyNi4xMiw2MC43aDc0LjJjNTIuODYsMCw3NiwyNS42OCw3OC42MSw4NS4yOSwyLjY2LDYxLjgxLTE4LjI5LDg3LjkyLTcxLjE1LDg3LjkySDc5LjJsLTQ2LjcxLjUyYTI4Ny4yOSwyODcuMjksMCwwLDEtMjAsNTMuODhoMTA5YzExMS4zMiwwLDEzMi42Ny02NywxMjkuNDgtMTQxTTMwNi44NCwyODloNzEuMjNWMGEzMDAuMDcsMzAwLjA3LDAsMCwxLTcxLjIzLDI1LjkyWm0zMTguOC42Mkw3MjYuNTkuODVhMzAwLDMwMCwwLDAsMS04My42NSwzMi4yNEw1NzcuMTEsMjI0LDUxMS4yOSwzMy4wOUEzMDAsMzAwLDAsMCwxLDQyNy42NC44NWwxMDEsMjg4Ljc2Wm0zNzQuMzYsNEw4OTkuMDUsNC45MUg4MDJMNzc1LjE0LDgxLjc0LDcwMS4wNSwyOTMuNjVBMzAwLjMyLDMwMC4zMiwwLDAsMSw3ODUsMjYxLjM1bDYuNzktMjEsMTkuMTQtNTcuNTRMODUwLjUyLDYybDQwLjA3LDEyMC44NSwxOC43LDU3LjU0LDcsMjFBMzAwLjIsMzAwLjIsMCwwLDEsMTAwMCwyOTMuNjUiIGZpbGw9IiNiM2IzYjMiLz48L3N2Zz4=";if(null!==(e=l.organization)&&void 0!==e&&e.logoUrl)r=null===(n=l.organization)||void 0===n?void 0:n.logoUrl;else if(null!==(t=s.navigation)&&void 0!==t&&t.logoUrl){var a;r=null===(a=s.navigation)||void 0===a?void 0:a.logoUrl}return r}),[null===(e=s.navigation)||void 0===e?void 0:e.logoUrl,null===(t=l.organization)||void 0===t?void 0:t.logoUrl]));return null==i.state?(0,f.jsx)(f.Fragment,{}):(0,f.jsxs)("div",{className:c.j2,children:[(0,f.jsxs)("div",{className:c.TG,children:[(0,f.jsx)("div",{className:c.r$,style:{height:null!==(n=s.configuration.loginLogoHeight)&&void 0!==n?n:50,backgroundImage:"url(".concat(u,")")}}),(0,f.jsx)(G,{})]}),s.authentication.contentBox&&(0,f.jsx)("div",{style:{width:"calc(100% - 400px)",height:"100%",position:"relative",overflow:"hidden"},children:(0,f.jsx)(C.s,{settings:{contentBoxProps:(0,h.HO)(s.authentication.contentBox.props)}})})]})}))}}]);