dara-core 1.14.0a0__py3-none-any.whl → 1.14.0a1__py3-none-any.whl

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.
dara/core/auth/base.py CHANGED
@@ -69,6 +69,14 @@ class BaseAuthConfig(BaseModel, abc.ABC):
69
69
  Defines components to use for auth routes
70
70
  """
71
71
 
72
+ supports_token_refresh: ClassVar[bool] = False
73
+ """
74
+ Whether this auth config supports token refresh.
75
+
76
+ If an auth config supports token refresh, it should override the refresh_token method
77
+ and set this to True.
78
+ """
79
+
72
80
  @abc.abstractmethod
73
81
  def get_token(self, body: SessionRequestBody) -> Union[TokenResponse, RedirectResponse]:
74
82
  """
@@ -91,10 +99,13 @@ class BaseAuthConfig(BaseModel, abc.ABC):
91
99
  :param token: encoded token
92
100
  """
93
101
 
94
- def refresh_token(self, refresh_token: str) -> tuple[str, str]:
102
+ def refresh_token(self, old_token: TokenData, refresh_token: str) -> tuple[str, str]:
95
103
  """
96
104
  Create a new session token and refresh token from a refresh token.
97
105
 
106
+ Note: the new issued session token should include the same session_id as the old token
107
+
108
+ :param old_token: old session token data
98
109
  :param refresh_token: encoded refresh token
99
110
  :return: new session token, new refresh token
100
111
  """
dara/core/auth/routes.py CHANGED
@@ -32,6 +32,7 @@ from dara.core.auth.definitions import (
32
32
  AuthError,
33
33
  SessionRequestBody,
34
34
  )
35
+ from dara.core.auth.utils import decode_token
35
36
  from dara.core.logging import dev_logger
36
37
 
37
38
  auth_router = APIRouter()
@@ -108,6 +109,7 @@ async def _revoke_session(response: Response, credentials: HTTPAuthorizationCred
108
109
  async def handle_refresh_token(
109
110
  response: Response,
110
111
  dara_refresh_token: Union[str, None] = Cookie(default=None),
112
+ credentials: HTTPAuthorizationCredentials = Depends(HTTPBearer()),
111
113
  ):
112
114
  """
113
115
  Given a refresh token, issues a new session token and refresh token cookie.
@@ -119,13 +121,25 @@ async def handle_refresh_token(
119
121
  if dara_refresh_token is None:
120
122
  raise HTTPException(status_code=400, detail=BAD_REQUEST_ERROR('No refresh token provided'))
121
123
 
124
+ # Check scheme is correct
125
+ if credentials.scheme != 'Bearer':
126
+ raise HTTPException(
127
+ status_code=400,
128
+ detail=BAD_REQUEST_ERROR(
129
+ 'Invalid authentication scheme, previous Bearer token must be included in the refresh request'
130
+ ),
131
+ )
132
+
122
133
  from dara.core.internal.registries import auth_registry
123
134
 
124
135
  auth_config: BaseAuthConfig = auth_registry.get('auth_config')
125
136
 
126
137
  try:
127
- # Refresh logic up to implementation
128
- session_token, refresh_token = auth_config.refresh_token(dara_refresh_token)
138
+ # decode the old token ignoring expiry date
139
+ old_token_data = decode_token(credentials.credentials, options={'verify_exp': False})
140
+
141
+ # Refresh logic up to implementation - passing in old token data so session_id can be preserved
142
+ session_token, refresh_token = auth_config.refresh_token(old_token_data, dara_refresh_token)
129
143
 
130
144
  # Using 'Strict' as it is only used for the refresh-token endpoint so cross-site requests are not expected
131
145
  response.set_cookie(
dara/core/auth/utils.py CHANGED
@@ -33,12 +33,15 @@ from dara.core.internal.settings import get_settings
33
33
  from dara.core.logging import dev_logger
34
34
 
35
35
 
36
- def decode_token(token: str) -> TokenData:
36
+ def decode_token(token: str, **kwargs) -> TokenData:
37
37
  """
38
38
  Decode a JWT token
39
+
40
+ :param token: the JWT token to decode
41
+ :param kwargs: additional arguments to pass to the jwt.decode function
39
42
  """
40
43
  try:
41
- return TokenData.parse_obj(jwt.decode(token, get_settings().jwt_secret, algorithms=[JWT_ALGO]))
44
+ return TokenData.parse_obj(jwt.decode(token, get_settings().jwt_secret, algorithms=[JWT_ALGO], **kwargs))
42
45
  except jwt.ExpiredSignatureError:
43
46
  raise AuthError(code=401, detail=EXPIRED_TOKEN_ERROR)
44
47
  except jwt.DecodeError:
@@ -52,11 +55,13 @@ def sign_jwt(
52
55
  groups: List[str],
53
56
  id_token: Optional[str] = None,
54
57
  exp: Optional[Union[datetime, int]] = None,
58
+ session_id: Optional[str] = None,
55
59
  ):
56
60
  """
57
61
  Create a new Dara JWT token
58
62
  """
59
- session_id = str(uuid.uuid4())
63
+ if session_id is None:
64
+ session_id = str(uuid.uuid4())
60
65
 
61
66
  # Default expiry is 1 day unless specified
62
67
  if exp is None:
@@ -208,9 +208,12 @@ def create_router(config: Configuration):
208
208
  'application_name': get_settings().project_name,
209
209
  }
210
210
 
211
- @core_api_router.get('/auth-components')
212
- async def get_auth_components(): # pylint: disable=unused-variable
213
- return config.auth_config.component_config
211
+ @core_api_router.get('/auth-config')
212
+ async def get_auth_config(): # pylint: disable=unused-variable
213
+ return {
214
+ 'auth_components': config.auth_config.component_config.dict(),
215
+ 'supports_token_refresh': config.auth_config.supports_token_refresh,
216
+ }
214
217
 
215
218
  @core_api_router.get('/components', dependencies=[Depends(verify_session)])
216
219
  async def get_components(name: Optional[str] = None): # pylint: disable=unused-variable
@@ -1200,7 +1200,7 @@ var __privateMethod = (obj, member, method) => {
1200
1200
  * This source code is licensed under the MIT license found in the
1201
1201
  * LICENSE file in the root directory of this source tree.
1202
1202
  */
1203
- var b$1 = "function" === typeof Symbol && Symbol.for, c$1 = b$1 ? Symbol.for("react.element") : 60103, d$2 = b$1 ? Symbol.for("react.portal") : 60106, e$2 = b$1 ? Symbol.for("react.fragment") : 60107, f$2 = b$1 ? Symbol.for("react.strict_mode") : 60108, g$1 = b$1 ? Symbol.for("react.profiler") : 60114, h$1 = b$1 ? Symbol.for("react.provider") : 60109, k$2 = b$1 ? Symbol.for("react.context") : 60110, l$3 = b$1 ? Symbol.for("react.async_mode") : 60111, m$2 = b$1 ? Symbol.for("react.concurrent_mode") : 60111, n$3 = b$1 ? Symbol.for("react.forward_ref") : 60112, p$3 = b$1 ? Symbol.for("react.suspense") : 60113, q$2 = b$1 ? Symbol.for("react.suspense_list") : 60120, r$2 = b$1 ? Symbol.for("react.memo") : 60115, t$1 = b$1 ? Symbol.for("react.lazy") : 60116, v$1 = b$1 ? Symbol.for("react.block") : 60121, w$2 = b$1 ? Symbol.for("react.fundamental") : 60117, x$1 = b$1 ? Symbol.for("react.responder") : 60118, y$1 = b$1 ? Symbol.for("react.scope") : 60119;
1203
+ var b$1 = "function" === typeof Symbol && Symbol.for, c$1 = b$1 ? Symbol.for("react.element") : 60103, d$2 = b$1 ? Symbol.for("react.portal") : 60106, e$3 = b$1 ? Symbol.for("react.fragment") : 60107, f$2 = b$1 ? Symbol.for("react.strict_mode") : 60108, g$1 = b$1 ? Symbol.for("react.profiler") : 60114, h$1 = b$1 ? Symbol.for("react.provider") : 60109, k$2 = b$1 ? Symbol.for("react.context") : 60110, l$3 = b$1 ? Symbol.for("react.async_mode") : 60111, m$2 = b$1 ? Symbol.for("react.concurrent_mode") : 60111, n$4 = b$1 ? Symbol.for("react.forward_ref") : 60112, p$3 = b$1 ? Symbol.for("react.suspense") : 60113, q$2 = b$1 ? Symbol.for("react.suspense_list") : 60120, r$3 = b$1 ? Symbol.for("react.memo") : 60115, t$2 = b$1 ? Symbol.for("react.lazy") : 60116, v$1 = b$1 ? Symbol.for("react.block") : 60121, w$2 = b$1 ? Symbol.for("react.fundamental") : 60117, x$1 = b$1 ? Symbol.for("react.responder") : 60118, y$1 = b$1 ? Symbol.for("react.scope") : 60119;
1204
1204
  function z$1(a2) {
1205
1205
  if ("object" === typeof a2 && null !== a2) {
1206
1206
  var u2 = a2.$$typeof;
@@ -1209,7 +1209,7 @@ var __privateMethod = (obj, member, method) => {
1209
1209
  switch (a2 = a2.type, a2) {
1210
1210
  case l$3:
1211
1211
  case m$2:
1212
- case e$2:
1212
+ case e$3:
1213
1213
  case g$1:
1214
1214
  case f$2:
1215
1215
  case p$3:
@@ -1217,9 +1217,9 @@ var __privateMethod = (obj, member, method) => {
1217
1217
  default:
1218
1218
  switch (a2 = a2 && a2.$$typeof, a2) {
1219
1219
  case k$2:
1220
- case n$3:
1221
- case t$1:
1222
- case r$2:
1220
+ case n$4:
1221
+ case t$2:
1222
+ case r$3:
1223
1223
  case h$1:
1224
1224
  return a2;
1225
1225
  default:
@@ -1239,10 +1239,10 @@ var __privateMethod = (obj, member, method) => {
1239
1239
  reactIs_production_min$1.ContextConsumer = k$2;
1240
1240
  reactIs_production_min$1.ContextProvider = h$1;
1241
1241
  reactIs_production_min$1.Element = c$1;
1242
- reactIs_production_min$1.ForwardRef = n$3;
1243
- reactIs_production_min$1.Fragment = e$2;
1244
- reactIs_production_min$1.Lazy = t$1;
1245
- reactIs_production_min$1.Memo = r$2;
1242
+ reactIs_production_min$1.ForwardRef = n$4;
1243
+ reactIs_production_min$1.Fragment = e$3;
1244
+ reactIs_production_min$1.Lazy = t$2;
1245
+ reactIs_production_min$1.Memo = r$3;
1246
1246
  reactIs_production_min$1.Portal = d$2;
1247
1247
  reactIs_production_min$1.Profiler = g$1;
1248
1248
  reactIs_production_min$1.StrictMode = f$2;
@@ -1261,16 +1261,16 @@ var __privateMethod = (obj, member, method) => {
1261
1261
  return "object" === typeof a2 && null !== a2 && a2.$$typeof === c$1;
1262
1262
  };
1263
1263
  reactIs_production_min$1.isForwardRef = function(a2) {
1264
- return z$1(a2) === n$3;
1264
+ return z$1(a2) === n$4;
1265
1265
  };
1266
1266
  reactIs_production_min$1.isFragment = function(a2) {
1267
- return z$1(a2) === e$2;
1267
+ return z$1(a2) === e$3;
1268
1268
  };
1269
1269
  reactIs_production_min$1.isLazy = function(a2) {
1270
- return z$1(a2) === t$1;
1270
+ return z$1(a2) === t$2;
1271
1271
  };
1272
1272
  reactIs_production_min$1.isMemo = function(a2) {
1273
- return z$1(a2) === r$2;
1273
+ return z$1(a2) === r$3;
1274
1274
  };
1275
1275
  reactIs_production_min$1.isPortal = function(a2) {
1276
1276
  return z$1(a2) === d$2;
@@ -1285,7 +1285,7 @@ var __privateMethod = (obj, member, method) => {
1285
1285
  return z$1(a2) === p$3;
1286
1286
  };
1287
1287
  reactIs_production_min$1.isValidElementType = function(a2) {
1288
- return "string" === typeof a2 || "function" === typeof a2 || a2 === e$2 || a2 === m$2 || a2 === g$1 || a2 === f$2 || a2 === p$3 || a2 === q$2 || "object" === typeof a2 && null !== a2 && (a2.$$typeof === t$1 || a2.$$typeof === r$2 || a2.$$typeof === h$1 || a2.$$typeof === k$2 || a2.$$typeof === n$3 || a2.$$typeof === w$2 || a2.$$typeof === x$1 || a2.$$typeof === y$1 || a2.$$typeof === v$1);
1288
+ return "string" === typeof a2 || "function" === typeof a2 || a2 === e$3 || a2 === m$2 || a2 === g$1 || a2 === f$2 || a2 === p$3 || a2 === q$2 || "object" === typeof a2 && null !== a2 && (a2.$$typeof === t$2 || a2.$$typeof === r$3 || a2.$$typeof === h$1 || a2.$$typeof === k$2 || a2.$$typeof === n$4 || a2.$$typeof === w$2 || a2.$$typeof === x$1 || a2.$$typeof === y$1 || a2.$$typeof === v$1);
1289
1289
  };
1290
1290
  reactIs_production_min$1.typeOf = z$1;
1291
1291
  (function(module2) {
@@ -12153,7 +12153,7 @@ var __privateMethod = (obj, member, method) => {
12153
12153
  * This source code is licensed under the MIT license found in the
12154
12154
  * LICENSE file in the root directory of this source tree.
12155
12155
  */
12156
- var f$1 = React__default.default, k$1 = Symbol.for("react.element"), l$2 = Symbol.for("react.fragment"), m$1 = Object.prototype.hasOwnProperty, n$2 = f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$2 = { key: true, ref: true, __self: true, __source: true };
12156
+ var f$1 = React__default.default, k$1 = Symbol.for("react.element"), l$2 = Symbol.for("react.fragment"), m$1 = Object.prototype.hasOwnProperty, n$3 = f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$2 = { key: true, ref: true, __self: true, __source: true };
12157
12157
  function q$1(c2, a2, g2) {
12158
12158
  var b2, d2 = {}, e3 = null, h2 = null;
12159
12159
  void 0 !== g2 && (e3 = "" + g2);
@@ -12164,7 +12164,7 @@ var __privateMethod = (obj, member, method) => {
12164
12164
  if (c2 && c2.defaultProps)
12165
12165
  for (b2 in a2 = c2.defaultProps, a2)
12166
12166
  void 0 === d2[b2] && (d2[b2] = a2[b2]);
12167
- return { $$typeof: k$1, type: c2, key: e3, ref: h2, props: d2, _owner: n$2.current };
12167
+ return { $$typeof: k$1, type: c2, key: e3, ref: h2, props: d2, _owner: n$3.current };
12168
12168
  }
12169
12169
  reactJsxRuntime_production_min.Fragment = l$2;
12170
12170
  reactJsxRuntime_production_min.jsx = q$1;
@@ -34373,23 +34373,23 @@ var __privateMethod = (obj, member, method) => {
34373
34373
  * This source code is licensed under the MIT license found in the
34374
34374
  * LICENSE file in the root directory of this source tree.
34375
34375
  */
34376
- var b = 60103, c = 60106, d = 60107, e$1 = 60108, f = 60114, g = 60109, h = 60110, k = 60112, l$1 = 60113, m = 60120, n$1 = 60115, p = 60116, q = 60121, r$1 = 60122, u = 60117, v = 60129, w = 60131;
34376
+ var b = 60103, c = 60106, d = 60107, e$2 = 60108, f = 60114, g = 60109, h = 60110, k = 60112, l$1 = 60113, m = 60120, n$2 = 60115, p = 60116, q = 60121, r$2 = 60122, u = 60117, v = 60129, w = 60131;
34377
34377
  if ("function" === typeof Symbol && Symbol.for) {
34378
34378
  var x = Symbol.for;
34379
34379
  b = x("react.element");
34380
34380
  c = x("react.portal");
34381
34381
  d = x("react.fragment");
34382
- e$1 = x("react.strict_mode");
34382
+ e$2 = x("react.strict_mode");
34383
34383
  f = x("react.profiler");
34384
34384
  g = x("react.provider");
34385
34385
  h = x("react.context");
34386
34386
  k = x("react.forward_ref");
34387
34387
  l$1 = x("react.suspense");
34388
34388
  m = x("react.suspense_list");
34389
- n$1 = x("react.memo");
34389
+ n$2 = x("react.memo");
34390
34390
  p = x("react.lazy");
34391
34391
  q = x("react.block");
34392
- r$1 = x("react.server.block");
34392
+ r$2 = x("react.server.block");
34393
34393
  u = x("react.fundamental");
34394
34394
  v = x("react.debug_trace_mode");
34395
34395
  w = x("react.legacy_hidden");
@@ -34402,7 +34402,7 @@ var __privateMethod = (obj, member, method) => {
34402
34402
  switch (a2 = a2.type, a2) {
34403
34403
  case d:
34404
34404
  case f:
34405
- case e$1:
34405
+ case e$2:
34406
34406
  case l$1:
34407
34407
  case m:
34408
34408
  return a2;
@@ -34411,7 +34411,7 @@ var __privateMethod = (obj, member, method) => {
34411
34411
  case h:
34412
34412
  case k:
34413
34413
  case p:
34414
- case n$1:
34414
+ case n$2:
34415
34415
  case g:
34416
34416
  return a2;
34417
34417
  default:
@@ -34423,7 +34423,7 @@ var __privateMethod = (obj, member, method) => {
34423
34423
  }
34424
34424
  }
34425
34425
  }
34426
- var z = g, A = b, B = k, C = d, D = p, E = n$1, F = c, G = f, H = e$1, I = l$1;
34426
+ var z = g, A = b, B = k, C = d, D = p, E = n$2, F = c, G = f, H = e$2, I = l$1;
34427
34427
  reactIs_production_min.ContextConsumer = h;
34428
34428
  reactIs_production_min.ContextProvider = z;
34429
34429
  reactIs_production_min.Element = A;
@@ -34460,7 +34460,7 @@ var __privateMethod = (obj, member, method) => {
34460
34460
  return y(a2) === p;
34461
34461
  };
34462
34462
  reactIs_production_min.isMemo = function(a2) {
34463
- return y(a2) === n$1;
34463
+ return y(a2) === n$2;
34464
34464
  };
34465
34465
  reactIs_production_min.isPortal = function(a2) {
34466
34466
  return y(a2) === c;
@@ -34469,13 +34469,13 @@ var __privateMethod = (obj, member, method) => {
34469
34469
  return y(a2) === f;
34470
34470
  };
34471
34471
  reactIs_production_min.isStrictMode = function(a2) {
34472
- return y(a2) === e$1;
34472
+ return y(a2) === e$2;
34473
34473
  };
34474
34474
  reactIs_production_min.isSuspense = function(a2) {
34475
34475
  return y(a2) === l$1;
34476
34476
  };
34477
34477
  reactIs_production_min.isValidElementType = function(a2) {
34478
- return "string" === typeof a2 || "function" === typeof a2 || a2 === d || a2 === f || a2 === v || a2 === e$1 || a2 === l$1 || a2 === m || a2 === w || "object" === typeof a2 && null !== a2 && (a2.$$typeof === p || a2.$$typeof === n$1 || a2.$$typeof === g || a2.$$typeof === h || a2.$$typeof === k || a2.$$typeof === u || a2.$$typeof === q || a2[0] === r$1) ? true : false;
34478
+ return "string" === typeof a2 || "function" === typeof a2 || a2 === d || a2 === f || a2 === v || a2 === e$2 || a2 === l$1 || a2 === m || a2 === w || "object" === typeof a2 && null !== a2 && (a2.$$typeof === p || a2.$$typeof === n$2 || a2.$$typeof === g || a2.$$typeof === h || a2.$$typeof === k || a2.$$typeof === u || a2.$$typeof === q || a2[0] === r$2) ? true : false;
34479
34479
  };
34480
34480
  reactIs_production_min.typeOf = y;
34481
34481
  (function(module2) {
@@ -34483,10 +34483,10 @@ var __privateMethod = (obj, member, method) => {
34483
34483
  module2.exports = reactIs_production_min;
34484
34484
  }
34485
34485
  })(reactIs);
34486
- let e = (e3) => "object" == typeof e3 && null != e3 && 1 === e3.nodeType, t = (e3, t2) => (!t2 || "hidden" !== e3) && ("visible" !== e3 && "clip" !== e3), n = (e3, n2) => {
34486
+ let e$1 = (e3) => "object" == typeof e3 && null != e3 && 1 === e3.nodeType, t$1 = (e3, t2) => (!t2 || "hidden" !== e3) && ("visible" !== e3 && "clip" !== e3), n$1 = (e3, n2) => {
34487
34487
  if (e3.clientHeight < e3.scrollHeight || e3.clientWidth < e3.scrollWidth) {
34488
34488
  let l2 = getComputedStyle(e3, null);
34489
- return t(l2.overflowY, n2) || t(l2.overflowX, n2) || ((e4) => {
34489
+ return t$1(l2.overflowY, n2) || t$1(l2.overflowX, n2) || ((e4) => {
34490
34490
  let t2 = ((e6) => {
34491
34491
  if (!e6.ownerDocument || !e6.ownerDocument.defaultView)
34492
34492
  return null;
@@ -34504,20 +34504,20 @@ var __privateMethod = (obj, member, method) => {
34504
34504
  let t2 = e3.parentElement;
34505
34505
  return null == t2 ? e3.getRootNode().host || null : t2;
34506
34506
  };
34507
- var o = (t2, o2) => {
34507
+ var o$1 = (t2, o2) => {
34508
34508
  var r2, d2, h2, f2, u2, s;
34509
34509
  if ("undefined" == typeof document)
34510
34510
  return [];
34511
34511
  let { scrollMode: a2, block: c2, inline: g2, boundary: m2, skipOverflowHiddenElements: p2 } = o2, w2 = "function" == typeof m2 ? m2 : (e3) => e3 !== m2;
34512
- if (!e(t2))
34512
+ if (!e$1(t2))
34513
34513
  throw new TypeError("Invalid target");
34514
34514
  let W = document.scrollingElement || document.documentElement, H2 = [], b2 = t2;
34515
- for (; e(b2) && w2(b2); ) {
34515
+ for (; e$1(b2) && w2(b2); ) {
34516
34516
  if (b2 = i(b2), b2 === W) {
34517
34517
  H2.push(b2);
34518
34518
  break;
34519
34519
  }
34520
- null != b2 && b2 === document.body && n(b2) && !n(document.documentElement) || null != b2 && n(b2, p2) && H2.push(b2);
34520
+ null != b2 && b2 === document.body && n$1(b2) && !n$1(document.documentElement) || null != b2 && n$1(b2, p2) && H2.push(b2);
34521
34521
  }
34522
34522
  let v2 = null != (d2 = null == (r2 = window.visualViewport) ? void 0 : r2.width) ? d2 : innerWidth, y2 = null != (f2 = null == (h2 = window.visualViewport) ? void 0 : h2.height) ? f2 : innerHeight, E2 = null != (u2 = window.scrollX) ? u2 : pageXOffset, M = null != (s = window.scrollY) ? s : pageYOffset, { height: x2, width: I2, top: C2, right: R, bottom: T, left: V } = t2.getBoundingClientRect(), k2 = "start" === c2 || "nearest" === c2 ? C2 : "end" === c2 ? T : C2 + x2 / 2, B2 = "center" === g2 ? V + I2 / 2 : "end" === g2 ? R : V, D2 = [];
34523
34523
  for (let e3 = 0; e3 < H2.length; e3++) {
@@ -34799,7 +34799,7 @@ var __privateMethod = (obj, member, method) => {
34799
34799
  if (!node) {
34800
34800
  return;
34801
34801
  }
34802
- var actions = o(node, {
34802
+ var actions = o$1(node, {
34803
34803
  boundary: menuNode,
34804
34804
  block: "nearest",
34805
34805
  scrollMode: "if-needed"
@@ -36777,7 +36777,7 @@ var __privateMethod = (obj, member, method) => {
36777
36777
  }
36778
36778
  })();
36779
36779
  })(classnames);
36780
- const r = classnames.exports;
36780
+ const r$1 = classnames.exports;
36781
36781
  function _typeof(o2) {
36782
36782
  "@babel/helpers - typeof";
36783
36783
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
@@ -42072,7 +42072,7 @@ var __privateMethod = (obj, member, method) => {
42072
42072
  var e3 = this.dropdownRef.current;
42073
42073
  e3 && (e3.scrollTop = e3.scrollHeight / 2 - e3.clientHeight / 2);
42074
42074
  } }, { key: "render", value: function() {
42075
- var t2 = r({ "react-datepicker__year-dropdown": true, "react-datepicker__year-dropdown--scrollable": this.props.scrollableYearDropdown });
42075
+ var t2 = r$1({ "react-datepicker__year-dropdown": true, "react-datepicker__year-dropdown--scrollable": this.props.scrollableYearDropdown });
42076
42076
  return React__default.default.createElement("div", { className: t2, ref: this.dropdownRef }, this.renderOptions());
42077
42077
  } }]), a2;
42078
42078
  }()), gt = function(t2) {
@@ -42215,7 +42215,7 @@ var __privateMethod = (obj, member, method) => {
42215
42215
  }), r2.state = { monthYearsList: Ct(r2.props.minDate, r2.props.maxDate) }, r2;
42216
42216
  }
42217
42217
  return le(o2, [{ key: "render", value: function() {
42218
- var t3 = r({ "react-datepicker__month-year-dropdown": true, "react-datepicker__month-year-dropdown--scrollable": this.props.scrollableMonthYearDropdown });
42218
+ var t3 = r$1({ "react-datepicker__month-year-dropdown": true, "react-datepicker__month-year-dropdown--scrollable": this.props.scrollableMonthYearDropdown });
42219
42219
  return React__default.default.createElement("div", { className: t3 }, this.renderOptions());
42220
42220
  } }]), o2;
42221
42221
  }()), _t = function(t2) {
@@ -42330,7 +42330,7 @@ var __privateMethod = (obj, member, method) => {
42330
42330
  return t3.isSameDay(t3.props.selected);
42331
42331
  }), de(ye(t3), "getClassNames", function(e3) {
42332
42332
  var n3 = t3.props.dayClassName ? t3.props.dayClassName(e3) : void 0;
42333
- return r("react-datepicker__day", n3, "react-datepicker__day--" + Oe(t3.props.day), { "react-datepicker__day--disabled": t3.isDisabled(), "react-datepicker__day--excluded": t3.isExcluded(), "react-datepicker__day--selected": t3.isSelected(), "react-datepicker__day--keyboard-selected": t3.isKeyboardSelected(), "react-datepicker__day--range-start": t3.isRangeStart(), "react-datepicker__day--range-end": t3.isRangeEnd(), "react-datepicker__day--in-range": t3.isInRange(), "react-datepicker__day--in-selecting-range": t3.isInSelectingRange(), "react-datepicker__day--selecting-range-start": t3.isSelectingRangeStart(), "react-datepicker__day--selecting-range-end": t3.isSelectingRangeEnd(), "react-datepicker__day--today": t3.isCurrentDay(), "react-datepicker__day--weekend": t3.isWeekend(), "react-datepicker__day--outside-month": t3.isAfterMonth() || t3.isBeforeMonth() }, t3.getHighLightedClass("react-datepicker__day--highlighted"));
42333
+ return r$1("react-datepicker__day", n3, "react-datepicker__day--" + Oe(t3.props.day), { "react-datepicker__day--disabled": t3.isDisabled(), "react-datepicker__day--excluded": t3.isExcluded(), "react-datepicker__day--selected": t3.isSelected(), "react-datepicker__day--keyboard-selected": t3.isKeyboardSelected(), "react-datepicker__day--range-start": t3.isRangeStart(), "react-datepicker__day--range-end": t3.isRangeEnd(), "react-datepicker__day--in-range": t3.isInRange(), "react-datepicker__day--in-selecting-range": t3.isInSelectingRange(), "react-datepicker__day--selecting-range-start": t3.isSelectingRangeStart(), "react-datepicker__day--selecting-range-end": t3.isSelectingRangeEnd(), "react-datepicker__day--today": t3.isCurrentDay(), "react-datepicker__day--weekend": t3.isWeekend(), "react-datepicker__day--outside-month": t3.isAfterMonth() || t3.isBeforeMonth() }, t3.getHighLightedClass("react-datepicker__day--highlighted"));
42334
42334
  }), de(ye(t3), "getAriaLabel", function() {
42335
42335
  var e3 = t3.props, r2 = e3.day, n3 = e3.ariaLabelPrefixWhenEnabled, o3 = void 0 === n3 ? "Choose" : n3, a3 = e3.ariaLabelPrefixWhenDisabled, s2 = void 0 === a3 ? "Not available" : a3, i3 = t3.isDisabled() || t3.isExcluded() ? s2 : o3;
42336
42336
  return "".concat(i3, " ").concat(Ee(r2, "PPPP", t3.props.locale));
@@ -42365,7 +42365,7 @@ var __privateMethod = (obj, member, method) => {
42365
42365
  }
42366
42366
  return le(o2, [{ key: "render", value: function() {
42367
42367
  var t3 = this.props, n3 = t3.weekNumber, o3 = t3.ariaLabelPrefix, a2 = void 0 === o3 ? "week " : o3, s = { "react-datepicker__week-number": true, "react-datepicker__week-number--clickable": !!t3.onClick };
42368
- return React__default.default.createElement("div", { className: r(s), "aria-label": "".concat(a2, " ").concat(this.props.weekNumber), onClick: this.handleClick }, n3);
42368
+ return React__default.default.createElement("div", { className: r$1(s), "aria-label": "".concat(a2, " ").concat(this.props.weekNumber), onClick: this.handleClick }, n3);
42369
42369
  } }]), o2;
42370
42370
  }(), Et = function(t2) {
42371
42371
  he(n2, React__default.default.Component);
@@ -42473,7 +42473,7 @@ var __privateMethod = (obj, member, method) => {
42473
42473
  t3.handleDayClick(Fe(setQuarter(t3.props.day, r2)), e3);
42474
42474
  }), de(ye(t3), "getMonthClassNames", function(e3) {
42475
42475
  var n3 = t3.props, o3 = n3.day, a3 = n3.startDate, s2 = n3.endDate, i3 = n3.selected, p2 = n3.minDate, c2 = n3.maxDate, l2 = n3.preSelection, d2 = n3.monthClassName, u2 = d2 ? d2(o3) : void 0;
42476
- return r("react-datepicker__month-text", "react-datepicker__month-".concat(e3), u2, { "react-datepicker__month--disabled": (p2 || c2) && Ze(setMonth(o3, e3), t3.props), "react-datepicker__month--selected": t3.isSelectedMonth(o3, e3, i3), "react-datepicker__month-text--keyboard-selected": getMonth(l2) === e3, "react-datepicker__month--in-range": et(a3, s2, e3, o3), "react-datepicker__month--range-start": t3.isRangeStartMonth(e3), "react-datepicker__month--range-end": t3.isRangeEndMonth(e3), "react-datepicker__month-text--today": t3.isCurrentMonth(o3, e3) });
42476
+ return r$1("react-datepicker__month-text", "react-datepicker__month-".concat(e3), u2, { "react-datepicker__month--disabled": (p2 || c2) && Ze(setMonth(o3, e3), t3.props), "react-datepicker__month--selected": t3.isSelectedMonth(o3, e3, i3), "react-datepicker__month-text--keyboard-selected": getMonth(l2) === e3, "react-datepicker__month--in-range": et(a3, s2, e3, o3), "react-datepicker__month--range-start": t3.isRangeStartMonth(e3), "react-datepicker__month--range-end": t3.isRangeEndMonth(e3), "react-datepicker__month-text--today": t3.isCurrentMonth(o3, e3) });
42477
42477
  }), de(ye(t3), "getTabIndex", function(e3) {
42478
42478
  var r2 = getMonth(t3.props.preSelection);
42479
42479
  return t3.props.disabledKeyboardNavigation || e3 !== r2 ? "-1" : "0";
@@ -42482,7 +42482,7 @@ var __privateMethod = (obj, member, method) => {
42482
42482
  return "".concat(c2, " ").concat(Ee(p2, "MMMM yyyy"));
42483
42483
  }), de(ye(t3), "getQuarterClassNames", function(e3) {
42484
42484
  var n3 = t3.props, o3 = n3.day, a3 = n3.startDate, s2 = n3.endDate, i3 = n3.selected, p2 = n3.minDate, c2 = n3.maxDate;
42485
- return r("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(e3), { "react-datepicker__quarter--disabled": (p2 || c2) && tt(setQuarter(o3, e3), t3.props), "react-datepicker__quarter--selected": t3.isSelectedQuarter(o3, e3, i3), "react-datepicker__quarter--in-range": nt(a3, s2, e3, o3), "react-datepicker__quarter--range-start": t3.isRangeStartQuarter(e3), "react-datepicker__quarter--range-end": t3.isRangeEndQuarter(e3) });
42485
+ return r$1("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(e3), { "react-datepicker__quarter--disabled": (p2 || c2) && tt(setQuarter(o3, e3), t3.props), "react-datepicker__quarter--selected": t3.isSelectedQuarter(o3, e3, i3), "react-datepicker__quarter--in-range": nt(a3, s2, e3, o3), "react-datepicker__quarter--range-start": t3.isRangeStartQuarter(e3), "react-datepicker__quarter--range-end": t3.isRangeEndQuarter(e3) });
42486
42486
  }), de(ye(t3), "renderMonths", function() {
42487
42487
  var r2 = t3.props, n3 = r2.showFullMonthYearPicker, o3 = r2.showTwoColumnMonthYearPicker, a3 = r2.showFourColumnMonthYearPicker, s2 = r2.locale, i3 = r2.day, p2 = r2.selected;
42488
42488
  return (a3 ? [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] : o3 ? [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11]] : [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]]).map(function(r3, o4) {
@@ -42505,7 +42505,7 @@ var __privateMethod = (obj, member, method) => {
42505
42505
  var e3 = t3.props;
42506
42506
  e3.day;
42507
42507
  var n3 = e3.selectingDate, o3 = e3.selectsStart, a3 = e3.selectsEnd, s2 = e3.showMonthYearPicker, i3 = e3.showQuarterYearPicker;
42508
- return r("react-datepicker__month", { "react-datepicker__month--selecting-range": n3 && (o3 || a3) }, { "react-datepicker__monthPicker": s2 }, { "react-datepicker__quarterPicker": i3 });
42508
+ return r$1("react-datepicker__month", { "react-datepicker__month--selecting-range": n3 && (o3 || a3) }, { "react-datepicker__monthPicker": s2 }, { "react-datepicker__quarterPicker": i3 });
42509
42509
  }), t3;
42510
42510
  }
42511
42511
  return le(o2, [{ key: "render", value: function() {
@@ -42611,7 +42611,7 @@ var __privateMethod = (obj, member, method) => {
42611
42611
  }
42612
42612
  }), de(ye(a2), "getYearClassNames", function(e3) {
42613
42613
  var t4 = a2.props, n3 = t4.minDate, o3 = t4.maxDate, s = t4.selected;
42614
- return r("react-datepicker__year-text", { "react-datepicker__year-text--selected": e3 === getYear(s), "react-datepicker__year-text--disabled": (n3 || o3) && rt(e3, a2.props), "react-datepicker__year-text--keyboard-selected": a2.isKeyboardSelected(e3), "react-datepicker__year-text--today": a2.isCurrentYear(e3) });
42614
+ return r$1("react-datepicker__year-text", { "react-datepicker__year-text--selected": e3 === getYear(s), "react-datepicker__year-text--disabled": (n3 || o3) && rt(e3, a2.props), "react-datepicker__year-text--keyboard-selected": a2.isKeyboardSelected(e3), "react-datepicker__year-text--today": a2.isCurrentYear(e3) });
42615
42615
  }), de(ye(a2), "getYearTabIndex", function(e3) {
42616
42616
  return a2.props.disabledKeyboardNavigation ? "-1" : e3 === getYear(a2.props.preSelection) ? "0" : "-1";
42617
42617
  }), a2;
@@ -42723,7 +42723,7 @@ var __privateMethod = (obj, member, method) => {
42723
42723
  var t4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : a2.state.date, n3 = Te(t4, a2.props.locale, a2.props.calendarStartDay), o3 = [];
42724
42724
  return a2.props.showWeekNumbers && o3.push(React__default.default.createElement("div", { key: "W", className: "react-datepicker__day-name" }, a2.props.weekLabel || "#")), o3.concat([0, 1, 2, 3, 4, 5, 6].map(function(t5) {
42725
42725
  var o4 = addDays(n3, t5), s = a2.formatWeekday(o4, a2.props.locale), i2 = a2.props.weekDayClassName ? a2.props.weekDayClassName(o4) : void 0;
42726
- return React__default.default.createElement("div", { key: t5, className: r("react-datepicker__day-name", i2) }, s);
42726
+ return React__default.default.createElement("div", { key: t5, className: r$1("react-datepicker__day-name", i2) }, s);
42727
42727
  }));
42728
42728
  }), de(ye(a2), "formatWeekday", function(e3, t4) {
42729
42729
  return a2.props.formatWeekDay ? function(e4, t5, r2) {
@@ -42865,7 +42865,7 @@ var __privateMethod = (obj, member, method) => {
42865
42865
  this.props.preSelection && !We(this.props.preSelection, e3.preSelection) ? this.setState({ date: this.props.preSelection }) : this.props.openToDate && !We(this.props.openToDate, e3.openToDate) && this.setState({ date: this.props.openToDate });
42866
42866
  } }, { key: "render", value: function() {
42867
42867
  var t3 = this.props.container || It;
42868
- return React__default.default.createElement("div", { ref: this.containerRef }, React__default.default.createElement(t3, { className: r("react-datepicker", this.props.className, { "react-datepicker--time-only": this.props.showTimeSelectOnly }), showPopperArrow: this.props.showPopperArrow, arrowProps: this.props.arrowProps }, this.renderPreviousButton(), this.renderNextButton(), this.renderMonths(), this.renderYears(), this.renderTodayButton(), this.renderTimeSection(), this.renderInputTimeSection(), this.props.children));
42868
+ return React__default.default.createElement("div", { ref: this.containerRef }, React__default.default.createElement(t3, { className: r$1("react-datepicker", this.props.className, { "react-datepicker--time-only": this.props.showTimeSelectOnly }), showPopperArrow: this.props.showPopperArrow, arrowProps: this.props.arrowProps }, this.renderPreviousButton(), this.renderNextButton(), this.renderMonths(), this.renderYears(), this.renderTodayButton(), this.renderTimeSection(), this.renderInputTimeSection(), this.props.children));
42869
42869
  } }], [{ key: "defaultProps", get: function() {
42870
42870
  return { onDropdownFocus: function() {
42871
42871
  }, monthsShown: 1, monthSelectedIn: 0, forceShowMonthNavigation: false, timeCaption: "Time", previousYearButtonLabel: "Previous Year", nextYearButtonLabel: "Next Year", previousMonthButtonLabel: "Previous Month", nextMonthButtonLabel: "Next Month", customTimeInput: null, yearItemNumber: 12 };
@@ -42915,14 +42915,14 @@ var __privateMethod = (obj, member, method) => {
42915
42915
  return le(o2, [{ key: "render", value: function() {
42916
42916
  var t3, n3 = this.props, o3 = n3.className, a2 = n3.wrapperClassName, s = n3.hidePopper, i2 = n3.popperComponent, p2 = n3.popperModifiers, c2 = n3.popperPlacement, l2 = n3.popperProps, d2 = n3.targetComponent, u2 = n3.enableTabLoop, h2 = n3.popperOnKeyDown, m2 = n3.portalId, f2 = n3.portalHost;
42917
42917
  if (!s) {
42918
- var y2 = r("react-datepicker-popper", o3);
42918
+ var y2 = r$1("react-datepicker-popper", o3);
42919
42919
  t3 = React__default.default.createElement(Popper, ue({ modifiers: p2, placement: c2 }, l2), function(t4) {
42920
42920
  var r2 = t4.ref, n4 = t4.style, o4 = t4.placement, a3 = t4.arrowProps;
42921
42921
  return React__default.default.createElement(At, { enableTabLoop: u2 }, React__default.default.createElement("div", { ref: r2, style: n4, className: y2, "data-placement": o4, onKeyDown: h2 }, React__default.default.cloneElement(i2, { arrowProps: a3 })));
42922
42922
  });
42923
42923
  }
42924
42924
  this.props.popperContainer && (t3 = React__default.default.createElement(this.props.popperContainer, {}, t3)), m2 && !s && (t3 = React__default.default.createElement(Rt, { portalId: m2, portalHost: f2 }, t3));
42925
- var v2 = r("react-datepicker-wrapper", a2);
42925
+ var v2 = r$1("react-datepicker-wrapper", a2);
42926
42926
  return React__default.default.createElement(Manager, { className: "react-datepicker-manager" }, React__default.default.createElement(Reference, null, function(t4) {
42927
42927
  var r2 = t4.ref;
42928
42928
  return React__default.default.createElement("div", { ref: r2, className: v2 }, d2);
@@ -43100,7 +43100,7 @@ var __privateMethod = (obj, member, method) => {
43100
43100
  s.calendar = e3;
43101
43101
  }, locale: s.props.locale, calendarStartDay: s.props.calendarStartDay, chooseDayAriaLabelPrefix: s.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: s.props.disabledDayAriaLabelPrefix, weekAriaLabelPrefix: s.props.weekAriaLabelPrefix, monthAriaLabelPrefix: s.props.monthAriaLabelPrefix, adjustDateOnChange: s.props.adjustDateOnChange, setOpen: s.setOpen, shouldCloseOnSelect: s.props.shouldCloseOnSelect, dateFormat: s.props.dateFormatCalendar, useWeekdaysShort: s.props.useWeekdaysShort, formatWeekDay: s.props.formatWeekDay, dropdownMode: s.props.dropdownMode, selected: s.props.selected, preSelection: s.state.preSelection, onSelect: s.handleSelect, onWeekSelect: s.props.onWeekSelect, openToDate: s.props.openToDate, minDate: s.props.minDate, maxDate: s.props.maxDate, selectsStart: s.props.selectsStart, selectsEnd: s.props.selectsEnd, selectsRange: s.props.selectsRange, startDate: s.props.startDate, endDate: s.props.endDate, excludeDates: s.props.excludeDates, excludeDateIntervals: s.props.excludeDateIntervals, filterDate: s.props.filterDate, onClickOutside: s.handleCalendarClickOutside, formatWeekNumber: s.props.formatWeekNumber, highlightDates: s.state.highlightDates, includeDates: s.props.includeDates, includeDateIntervals: s.props.includeDateIntervals, includeTimes: s.props.includeTimes, injectTimes: s.props.injectTimes, inline: s.props.inline, shouldFocusDayInline: s.state.shouldFocusDayInline, peekNextMonth: s.props.peekNextMonth, showMonthDropdown: s.props.showMonthDropdown, showPreviousMonths: s.props.showPreviousMonths, useShortMonthInDropdown: s.props.useShortMonthInDropdown, showMonthYearDropdown: s.props.showMonthYearDropdown, showWeekNumbers: s.props.showWeekNumbers, showYearDropdown: s.props.showYearDropdown, withPortal: s.props.withPortal, forceShowMonthNavigation: s.props.forceShowMonthNavigation, showDisabledMonthNavigation: s.props.showDisabledMonthNavigation, scrollableYearDropdown: s.props.scrollableYearDropdown, scrollableMonthYearDropdown: s.props.scrollableMonthYearDropdown, todayButton: s.props.todayButton, weekLabel: s.props.weekLabel, outsideClickIgnoreClass: "react-datepicker-ignore-onclickoutside", fixedHeight: s.props.fixedHeight, monthsShown: s.props.monthsShown, monthSelectedIn: s.state.monthSelectedIn, onDropdownFocus: s.handleDropdownFocus, onMonthChange: s.props.onMonthChange, onYearChange: s.props.onYearChange, dayClassName: s.props.dayClassName, weekDayClassName: s.props.weekDayClassName, monthClassName: s.props.monthClassName, timeClassName: s.props.timeClassName, showTimeSelect: s.props.showTimeSelect, showTimeSelectOnly: s.props.showTimeSelectOnly, onTimeChange: s.handleTimeChange, timeFormat: s.props.timeFormat, timeIntervals: s.props.timeIntervals, minTime: s.props.minTime, maxTime: s.props.maxTime, excludeTimes: s.props.excludeTimes, filterTime: s.props.filterTime, timeCaption: s.props.timeCaption, className: s.props.calendarClassName, container: s.props.calendarContainer, yearItemNumber: s.props.yearItemNumber, yearDropdownItemNumber: s.props.yearDropdownItemNumber, previousMonthAriaLabel: s.props.previousMonthAriaLabel, previousMonthButtonLabel: s.props.previousMonthButtonLabel, nextMonthAriaLabel: s.props.nextMonthAriaLabel, nextMonthButtonLabel: s.props.nextMonthButtonLabel, previousYearAriaLabel: s.props.previousYearAriaLabel, previousYearButtonLabel: s.props.previousYearButtonLabel, nextYearAriaLabel: s.props.nextYearAriaLabel, nextYearButtonLabel: s.props.nextYearButtonLabel, timeInputLabel: s.props.timeInputLabel, disabledKeyboardNavigation: s.props.disabledKeyboardNavigation, renderCustomHeader: s.props.renderCustomHeader, popperProps: s.props.popperProps, renderDayContents: s.props.renderDayContents, onDayMouseEnter: s.props.onDayMouseEnter, onMonthMouseLeave: s.props.onMonthMouseLeave, selectsDisabledDaysInRange: s.props.selectsDisabledDaysInRange, showTimeInput: s.props.showTimeInput, showMonthYearPicker: s.props.showMonthYearPicker, showFullMonthYearPicker: s.props.showFullMonthYearPicker, showTwoColumnMonthYearPicker: s.props.showTwoColumnMonthYearPicker, showFourColumnMonthYearPicker: s.props.showFourColumnMonthYearPicker, showYearPicker: s.props.showYearPicker, showQuarterYearPicker: s.props.showQuarterYearPicker, showPopperArrow: s.props.showPopperArrow, excludeScrollbar: s.props.excludeScrollbar, handleOnKeyDown: s.props.onKeyDown, handleOnDayKeyDown: s.onDayKeyDown, isInputFocused: s.state.focused, customTimeInput: s.props.customTimeInput, setPreSelection: s.setPreSelection }, s.props.children) : null;
43102
43102
  }), de(ye(s), "renderDateInput", function() {
43103
- var t4, n2 = r(s.props.className, de({}, "react-datepicker-ignore-onclickoutside", s.state.open)), o3 = s.props.customInput || React__default.default.createElement("input", { type: "text" }), a3 = s.props.customInputRef || "ref", i2 = "string" == typeof s.props.value ? s.props.value : "string" == typeof s.state.inputValue ? s.state.inputValue : s.props.selectsRange ? function(e3, t5, r2) {
43103
+ var t4, n2 = r$1(s.props.className, de({}, "react-datepicker-ignore-onclickoutside", s.state.open)), o3 = s.props.customInput || React__default.default.createElement("input", { type: "text" }), a3 = s.props.customInputRef || "ref", i2 = "string" == typeof s.props.value ? s.props.value : "string" == typeof s.state.inputValue ? s.state.inputValue : s.props.selectsRange ? function(e3, t5, r2) {
43104
43104
  if (!e3)
43105
43105
  return "";
43106
43106
  var n3 = Ne(e3, r2), o4 = t5 ? Ne(t5, r2) : "";
@@ -43108,7 +43108,7 @@ var __privateMethod = (obj, member, method) => {
43108
43108
  }(s.props.startDate, s.props.endDate, s.props) : Ne(s.props.selected, s.props);
43109
43109
  return React__default.default.cloneElement(o3, (de(t4 = {}, a3, function(e3) {
43110
43110
  s.input = e3;
43111
- }), de(t4, "value", i2), de(t4, "onBlur", s.handleBlur), de(t4, "onChange", s.handleChange), de(t4, "onClick", s.onInputClick), de(t4, "onFocus", s.handleFocus), de(t4, "onKeyDown", s.onInputKeyDown), de(t4, "id", s.props.id), de(t4, "name", s.props.name), de(t4, "autoFocus", s.props.autoFocus), de(t4, "placeholder", s.props.placeholderText), de(t4, "disabled", s.props.disabled), de(t4, "autoComplete", s.props.autoComplete), de(t4, "className", r(o3.props.className, n2)), de(t4, "title", s.props.title), de(t4, "readOnly", s.props.readOnly), de(t4, "required", s.props.required), de(t4, "tabIndex", s.props.tabIndex), de(t4, "aria-describedby", s.props.ariaDescribedBy), de(t4, "aria-invalid", s.props.ariaInvalid), de(t4, "aria-labelledby", s.props.ariaLabelledBy), de(t4, "aria-required", s.props.ariaRequired), t4));
43111
+ }), de(t4, "value", i2), de(t4, "onBlur", s.handleBlur), de(t4, "onChange", s.handleChange), de(t4, "onClick", s.onInputClick), de(t4, "onFocus", s.handleFocus), de(t4, "onKeyDown", s.onInputKeyDown), de(t4, "id", s.props.id), de(t4, "name", s.props.name), de(t4, "autoFocus", s.props.autoFocus), de(t4, "placeholder", s.props.placeholderText), de(t4, "disabled", s.props.disabled), de(t4, "autoComplete", s.props.autoComplete), de(t4, "className", r$1(o3.props.className, n2)), de(t4, "title", s.props.title), de(t4, "readOnly", s.props.readOnly), de(t4, "required", s.props.required), de(t4, "tabIndex", s.props.tabIndex), de(t4, "aria-describedby", s.props.ariaDescribedBy), de(t4, "aria-invalid", s.props.ariaInvalid), de(t4, "aria-labelledby", s.props.ariaLabelledBy), de(t4, "aria-required", s.props.ariaRequired), t4));
43112
43112
  }), de(ye(s), "renderClearButton", function() {
43113
43113
  var t4 = s.props, r2 = t4.isClearable, n2 = t4.selected, o3 = t4.startDate, a3 = t4.endDate, i2 = t4.clearButtonTitle, p2 = t4.clearButtonClassName, c2 = void 0 === p2 ? "" : p2, l2 = t4.ariaLabelClose, d2 = void 0 === l2 ? "Close" : l2;
43114
43114
  return !r2 || null == n2 && null == o3 && null == a3 ? null : React__default.default.createElement("button", { type: "button", className: "react-datepicker__close-icon ".concat(c2).trim(), "aria-label": d2, onClick: s.onClearClick, title: i2, tabIndex: -1 });
@@ -56141,11 +56141,11 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56141
56141
  message.reason
56142
56142
  );
56143
56143
  }
56144
- function useAuthComponents() {
56144
+ function useAuthConfig() {
56145
56145
  return reactQuery.useQuery(
56146
- ["auth-components"],
56146
+ ["auth-config"],
56147
56147
  async () => {
56148
- const response = await request("/api/core/auth-components", {
56148
+ const response = await request("/api/core/auth-config", {
56149
56149
  method: HTTP_METHOD.GET
56150
56150
  });
56151
56151
  return response.json();
@@ -58960,6 +58960,57 @@ Inferred class string: "${iconClasses}."`
58960
58960
  }
58961
58961
  return templateCopy;
58962
58962
  }
58963
+ function e(e3) {
58964
+ this.message = e3;
58965
+ }
58966
+ e.prototype = new Error(), e.prototype.name = "InvalidCharacterError";
58967
+ var r = "undefined" != typeof window && window.atob && window.atob.bind(window) || function(r2) {
58968
+ var t2 = String(r2).replace(/=+$/, "");
58969
+ if (t2.length % 4 == 1)
58970
+ throw new e("'atob' failed: The string to be decoded is not correctly encoded.");
58971
+ for (var n2, o2, a2 = 0, i2 = 0, c2 = ""; o2 = t2.charAt(i2++); ~o2 && (n2 = a2 % 4 ? 64 * n2 + o2 : o2, a2++ % 4) ? c2 += String.fromCharCode(255 & n2 >> (-2 * a2 & 6)) : 0)
58972
+ o2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o2);
58973
+ return c2;
58974
+ };
58975
+ function t(e3) {
58976
+ var t2 = e3.replace(/-/g, "+").replace(/_/g, "/");
58977
+ switch (t2.length % 4) {
58978
+ case 0:
58979
+ break;
58980
+ case 2:
58981
+ t2 += "==";
58982
+ break;
58983
+ case 3:
58984
+ t2 += "=";
58985
+ break;
58986
+ default:
58987
+ throw "Illegal base64url string!";
58988
+ }
58989
+ try {
58990
+ return function(e4) {
58991
+ return decodeURIComponent(r(e4).replace(/(.)/g, function(e6, r2) {
58992
+ var t3 = r2.charCodeAt(0).toString(16).toUpperCase();
58993
+ return t3.length < 2 && (t3 = "0" + t3), "%" + t3;
58994
+ }));
58995
+ }(t2);
58996
+ } catch (e4) {
58997
+ return r(t2);
58998
+ }
58999
+ }
59000
+ function n(e3) {
59001
+ this.message = e3;
59002
+ }
59003
+ function o(e3, r2) {
59004
+ if ("string" != typeof e3)
59005
+ throw new n("Invalid token specified");
59006
+ var o2 = true === (r2 = r2 || {}).header ? 0 : 1;
59007
+ try {
59008
+ return JSON.parse(t(e3.split(".")[o2]));
59009
+ } catch (e4) {
59010
+ throw new n("Invalid token specified: " + e4.message);
59011
+ }
59012
+ }
59013
+ n.prototype = new Error(), n.prototype.name = "InvalidTokenError";
58963
59014
  const Wrapper$2 = styled__default.default.div`
58964
59015
  display: flex;
58965
59016
  align-items: center;
@@ -59097,6 +59148,28 @@ Inferred class string: "${iconClasses}."`
59097
59148
  }
59098
59149
  return isLoading ? /* @__PURE__ */ React__default.default.createElement(DefaultFallback, null) : children;
59099
59150
  }
59151
+ async function checkTokenExpiry(token) {
59152
+ if (token) {
59153
+ try {
59154
+ const decoded = o(token);
59155
+ if (decoded.exp * 1e3 - Date.now() < 5 * 60 * 1e3) {
59156
+ const res = await request("/api/auth/refresh-token", {
59157
+ headers: {
59158
+ Accept: "application/json",
59159
+ "Content-Type": "application/json"
59160
+ },
59161
+ method: "POST"
59162
+ });
59163
+ if (res.ok) {
59164
+ const { token: newToken } = await res.json();
59165
+ return newToken;
59166
+ }
59167
+ }
59168
+ } catch (e3) {
59169
+ console.warn("Failed to refresh token", e3);
59170
+ }
59171
+ }
59172
+ }
59100
59173
  function DynamicAuthComponent(props) {
59101
59174
  const importers = React.useContext(importersCtx);
59102
59175
  const [component, setComponent] = React.useState(() => /* @__PURE__ */ React__default.default.createElement(DefaultFallback, null));
@@ -59120,12 +59193,25 @@ Inferred class string: "${iconClasses}."`
59120
59193
  return component;
59121
59194
  }
59122
59195
  function AuthWrapper(props) {
59123
- const { data: authComponents, isLoading } = useAuthComponents();
59196
+ const { data: authConfig, isLoading } = useAuthConfig();
59124
59197
  const isMounted = React.useRef(false);
59125
59198
  if (!isMounted.current) {
59126
59199
  isMounted.current = true;
59127
59200
  store.setValue("sessionToken", getToken());
59128
59201
  }
59202
+ React.useEffect(() => {
59203
+ if (!(authConfig == null ? void 0 : authConfig.supports_token_refresh)) {
59204
+ return;
59205
+ }
59206
+ const interval = setInterval(async () => {
59207
+ const token = await store.getValue("sessionToken");
59208
+ const newToken = await checkTokenExpiry(token);
59209
+ if (newToken) {
59210
+ store.setValue("sessionToken", newToken);
59211
+ }
59212
+ }, 60 * 1e3);
59213
+ return () => clearInterval(interval);
59214
+ }, [authConfig]);
59129
59215
  React.useEffect(() => {
59130
59216
  return store.subscribe("sessionToken", (newToken) => {
59131
59217
  const key = getTokenKey();
@@ -59139,7 +59225,7 @@ Inferred class string: "${iconClasses}."`
59139
59225
  if (isLoading) {
59140
59226
  return /* @__PURE__ */ React__default.default.createElement(Center, null, /* @__PURE__ */ React__default.default.createElement(DefaultFallback, null));
59141
59227
  }
59142
- const { login, logout, ...extraRoutes } = authComponents;
59228
+ const { login, logout, ...extraRoutes } = authConfig.auth_components;
59143
59229
  return /* @__PURE__ */ React__default.default.createElement(Switch$1, null, /* @__PURE__ */ React__default.default.createElement(Route, { path: "/login" }, /* @__PURE__ */ React__default.default.createElement(DynamicAuthComponent, { component: login })), /* @__PURE__ */ React__default.default.createElement(Route, { path: "/logout" }, /* @__PURE__ */ React__default.default.createElement(DynamicAuthComponent, { component: logout })), Object.entries(extraRoutes).map(([path, component]) => /* @__PURE__ */ React__default.default.createElement(Route, { key: path, path: `/${path}` }, /* @__PURE__ */ React__default.default.createElement(DynamicAuthComponent, { component }))), /* @__PURE__ */ React__default.default.createElement(Route, { component: ErrorPage, path: "/error" }), /* @__PURE__ */ React__default.default.createElement(Route, { path: "/", render: () => /* @__PURE__ */ React__default.default.createElement(PrivateRoute, null, props.children) }));
59144
59230
  }
59145
59231
  const index = "";
@@ -86454,6 +86540,7 @@ Inferred class string: "${iconClasses}."`
86454
86540
  exports.combineFilters = combineFilters;
86455
86541
  exports.default = run;
86456
86542
  exports.getIcon = getIcon;
86543
+ exports.getSessionToken = getSessionToken;
86457
86544
  exports.getToken = getToken;
86458
86545
  exports.getTokenKey = getTokenKey;
86459
86546
  exports.handleAuthErrors = handleAuthErrors;
@@ -86464,6 +86551,7 @@ Inferred class string: "${iconClasses}."`
86464
86551
  exports.request = request;
86465
86552
  exports.resolveValue = resolveValue;
86466
86553
  exports.revokeSession = revokeSession;
86554
+ exports.setSessionToken = setSessionToken;
86467
86555
  exports.useAction = useAction;
86468
86556
  exports.useActionIsLoading = useActionIsLoading;
86469
86557
  exports.useAnyVariable = useAnyVariable;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dara-core
3
- Version: 1.14.0a0
3
+ Version: 1.14.0a1
4
4
  Summary: Dara Framework Core
5
5
  Home-page: https://dara.causalens.com/
6
6
  License: Apache-2.0
@@ -20,10 +20,10 @@ Requires-Dist: async-asgi-testclient (>=1.4.11,<2.0.0)
20
20
  Requires-Dist: certifi (>=2024.7.4)
21
21
  Requires-Dist: click (==8.1.3)
22
22
  Requires-Dist: colorama (>=0.4.6,<0.5.0)
23
- Requires-Dist: create-dara-app (==1.14.0-alpha.0)
23
+ Requires-Dist: create-dara-app (==1.14.0-alpha.1)
24
24
  Requires-Dist: croniter (>=1.0.15,<2.0.0)
25
25
  Requires-Dist: cryptography (>=42.0.4)
26
- Requires-Dist: dara-components (==1.14.0-alpha.0) ; extra == "all"
26
+ Requires-Dist: dara-components (==1.14.0-alpha.1) ; extra == "all"
27
27
  Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0)
28
28
  Requires-Dist: fastapi (==0.109.0)
29
29
  Requires-Dist: fastapi-vite (==0.3.1)
@@ -51,7 +51,7 @@ Description-Content-Type: text/markdown
51
51
 
52
52
  # Dara Application Framework
53
53
 
54
- <img src="https://github.com/causalens/dara/blob/v1.14.0-alpha.0/img/dara_light.svg?raw=true">
54
+ <img src="https://github.com/causalens/dara/blob/v1.14.0-alpha.1/img/dara_light.svg?raw=true">
55
55
 
56
56
  ![Master tests](https://github.com/causalens/dara/actions/workflows/tests.yml/badge.svg?branch=master)
57
57
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
@@ -96,7 +96,7 @@ source .venv/bin/activate
96
96
  dara start
97
97
  ```
98
98
 
99
- ![Dara App](https://github.com/causalens/dara/blob/v1.14.0-alpha.0/img/components_gallery.png?raw=true)
99
+ ![Dara App](https://github.com/causalens/dara/blob/v1.14.0-alpha.1/img/components_gallery.png?raw=true)
100
100
 
101
101
  Note: `pip` installation uses [PEP 660](https://peps.python.org/pep-0660/) `pyproject.toml`-based editable installs which require `pip >= 21.3` and `setuptools >= 64.0.0`. You can upgrade both with:
102
102
 
@@ -113,9 +113,9 @@ Explore some of our favorite apps - a great way of getting started and getting t
113
113
 
114
114
  | Dara App | Description |
115
115
  | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
- | ![Large Language Model](https://github.com/causalens/dara/blob/v1.14.0-alpha.0/img/llm.png?raw=true) | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
117
- | ![Plot Interactivity](https://github.com/causalens/dara/blob/v1.14.0-alpha.0/img/plot_interactivity.png?raw=true) | Demonstrates how to enable the user to interact with plots, trigger actions based on clicks, mouse movements and other interactions with `Bokeh` or `Plotly` plots |
118
- | ![Graph Editor](https://github.com/causalens/dara/blob/v1.14.0-alpha.0/img/graph_viewer.png?raw=true) | Demonstrates how to use the `CausalGraphViewer` component to display your graphs or networks, customising the displayed information through colors and tooltips, and updating the page based on user interaction. |
116
+ | ![Large Language Model](https://github.com/causalens/dara/blob/v1.14.0-alpha.1/img/llm.png?raw=true) | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
117
+ | ![Plot Interactivity](https://github.com/causalens/dara/blob/v1.14.0-alpha.1/img/plot_interactivity.png?raw=true) | Demonstrates how to enable the user to interact with plots, trigger actions based on clicks, mouse movements and other interactions with `Bokeh` or `Plotly` plots |
118
+ | ![Graph Editor](https://github.com/causalens/dara/blob/v1.14.0-alpha.1/img/graph_viewer.png?raw=true) | Demonstrates how to use the `CausalGraphViewer` component to display your graphs or networks, customising the displayed information through colors and tooltips, and updating the page based on user interaction. |
119
119
 
120
120
  Check out our [App Gallery](https://dara.causalens.com/gallery) for more inspiration!
121
121
 
@@ -142,9 +142,9 @@ And the supporting UI packages and tools.
142
142
  - `ui-utils` - miscellaneous utility functions
143
143
  - `ui-widgets` - widget components
144
144
 
145
- More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.14.0-alpha.0/CONTRIBUTING.md) file.
145
+ More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.14.0-alpha.1/CONTRIBUTING.md) file.
146
146
 
147
147
  ## License
148
148
 
149
- Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.14.0-alpha.0/LICENSE).
149
+ Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.14.0-alpha.1/LICENSE).
150
150
 
@@ -1,11 +1,11 @@
1
1
  dara/core/__init__.py,sha256=w3OUU03lGXA45_Sf99CsNWL6SZ7tr7y4wRYq6pdGmhM,2186
2
2
  dara/core/actions.py,sha256=gARcrrtzYuBAVJUCtuHwpFc6PPVPb7x3ITIISCLw0GA,965
3
3
  dara/core/auth/__init__.py,sha256=H0bJoXff5wIRZmHvvQ3y9p5SXA9lM8OuLCGceYGqfb0,851
4
- dara/core/auth/base.py,sha256=OYMS29YP8uSqnUhgSddN2mGyfIztJjhsmPWrsX12-UI,3034
4
+ dara/core/auth/base.py,sha256=EX80DszIaAX276bbqTQuynkfCOD7o_xdzFCrqMTy4bw,3439
5
5
  dara/core/auth/basic.py,sha256=IMkoC1OeeRmnmjIqPHpybs8zSdbLlNKYLRvj08ajirg,4692
6
6
  dara/core/auth/definitions.py,sha256=fx-VCsElP9X97gM0Eql-4lFpLa0UryokmGZhQQat2NU,3511
7
- dara/core/auth/routes.py,sha256=ShujHmVZ7jMvnp5ETnTRSPzKRdsnBRH-qsCRwq5Nf4Q,6467
8
- dara/core/auth/utils.py,sha256=DKIXFRj9YeAjo3Oh2PCdqlSW7vMuHsyVqMEuJ0kpNxM,2855
7
+ dara/core/auth/routes.py,sha256=uaytzxMm6aOueRZ2ovQFg9Rx5F4OCu0TtCEI8hEN5h0,7108
8
+ dara/core/auth/utils.py,sha256=ngOi5j71Xu-G59yWxGoejBEmMnVyGS67aF7czt_0i7A,3062
9
9
  dara/core/base_definitions.py,sha256=r_W_qk6_VvvskbPEPjTF6xUh3o_lkNBWMFhN1Pic8Ks,14868
10
10
  dara/core/cli.py,sha256=ycTB7QHCB-74OnKnjXqkXq-GBqyjBqo7u4v1kTgv2jE,7656
11
11
  dara/core/configuration.py,sha256=8VynDds7a_uKXSpeNvjOUK3qfclg0WPniFEspL-6fi8,21153
@@ -54,7 +54,7 @@ dara/core/internal/port_utils.py,sha256=AQOUNiFNBYKVUwQ7i9UlY1NQ3sWb5xh5GkO6P1Bm
54
54
  dara/core/internal/registries.py,sha256=9WDczIsNeSmzi6aViIq_b14lmmYGGkdsUGHpv0Sg9zo,3278
55
55
  dara/core/internal/registry.py,sha256=ONCDusqaL0q59Py_r8-fFVN3vbkkDf5TXzNvbB9SrGQ,4305
56
56
  dara/core/internal/registry_lookup.py,sha256=8snHu2wUUsngXjHyHh6eZqL_WwonTTQB6-WBX-R_WZg,2238
57
- dara/core/internal/routing.py,sha256=dEnuK0zp9-4SLsK5_2M3NUKzROpDItPwMfBPnDA2MYY,22739
57
+ dara/core/internal/routing.py,sha256=pMsvv-a-P8bXK7_4oHXFlHFB8PO7yu8C4qeyultsys8,22863
58
58
  dara/core/internal/scheduler.py,sha256=z6OYwazBf3GYo8CzMC9IuGC2P96gI7JwxquT8GaoTMk,12944
59
59
  dara/core/internal/settings.py,sha256=wAWxl-HXjq7PW3twe_CrR-UuMRw9VBudC3eRmevZAhM,3869
60
60
  dara/core/internal/store.py,sha256=qVyU7JfC3zE2vYC2mfjmvECWMlFS9b-nMF1k-alg4Y8,7756
@@ -81,7 +81,7 @@ dara/core/metrics/cache.py,sha256=ybofUhZO0TCHeyhB_AtldWk1QTmTKh7GucTXpOkeTFA,25
81
81
  dara/core/metrics/runtime.py,sha256=YP-6Dz0GeI9_Yr7bUk_-OqShyFySGH_AKpDO126l6es,1833
82
82
  dara/core/metrics/utils.py,sha256=rYlBinxFc7VehFT5cTNXLk8gC74UEj7ZGq6vLgIDpSg,2247
83
83
  dara/core/persistence.py,sha256=TO94rPAN7jxZKVCC5YA4eE7GGDoNlCPe-BkkItV2VUE,10379
84
- dara/core/umd/dara.core.umd.js,sha256=bJedHgo9fFmh31_bRtCpuDPGjhz29_JKPXo8ExpqdKI,4877903
84
+ dara/core/umd/dara.core.umd.js,sha256=aoI0q4aTvmfTHfpfm7kibJ5smW0g8fw73Yhm413ivqk,4880827
85
85
  dara/core/umd/style.css,sha256=YQtQ4veiSktnyONl0CU1iU1kKfcQhreH4iASi1MP7Ak,4095007
86
86
  dara/core/visual/__init__.py,sha256=QN0wbG9HPQ_vXh8BO8DnBXeYLIENVTNtRmYzZf1lx7c,577
87
87
  dara/core/visual/components/__init__.py,sha256=O-Em_glGdZNO0LLl2RWmJSrQiXKxliXg_PuhVXGT81I,1811
@@ -105,8 +105,8 @@ dara/core/visual/themes/__init__.py,sha256=aM4mgoIYo2neBSw5FRzswsht7PUKjLthiHLmF
105
105
  dara/core/visual/themes/dark.py,sha256=UQGDooOc8ric73eHs9E0ltYP4UCrwqQ3QxqN_fb4PwY,1942
106
106
  dara/core/visual/themes/definitions.py,sha256=m3oN0txs65MZepqjj7AKMMxybf2aq5fTjcTwJmHqEbk,2744
107
107
  dara/core/visual/themes/light.py,sha256=-Tviq8oEwGbdFULoDOqPuHO0UpAZGsBy8qFi0kAGolQ,1944
108
- dara_core-1.14.0a0.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
109
- dara_core-1.14.0a0.dist-info/METADATA,sha256=GL9mjDN9_67kKik1JGInnVH8YFgTKzlgtgLM8Tyz7Bo,7457
110
- dara_core-1.14.0a0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
- dara_core-1.14.0a0.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
112
- dara_core-1.14.0a0.dist-info/RECORD,,
108
+ dara_core-1.14.0a1.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
109
+ dara_core-1.14.0a1.dist-info/METADATA,sha256=JB08LXBABVJNycKVooSE4d8HBimcoqfn4eRVezp8DK0,7457
110
+ dara_core-1.14.0a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
+ dara_core-1.14.0a1.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
112
+ dara_core-1.14.0a1.dist-info/RECORD,,