@nylas/react 1.4.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +7 -0
  2. package/dist/add-circle-icon_2.entry-8a1c55bc.cjs +1 -0
  3. package/dist/{add-circle-icon_2.entry-615fc101.js → add-circle-icon_2.entry-b4bbcfee.js} +3 -3
  4. package/dist/archive-icon.entry-a2492cf3.js +16 -0
  5. package/dist/archive-icon.entry-e48d2356.cjs +1 -0
  6. package/dist/{arrow-icon.entry-da152ec2.js → arrow-icon.entry-9414299f.js} +5 -5
  7. package/dist/arrow-icon.entry-b1ecb2aa.cjs +1 -0
  8. package/dist/{bold-icon.entry-61046c15.js → bold-icon.entry-b72aed9f.js} +4 -4
  9. package/dist/{bold-icon.entry-58679992.cjs → bold-icon.entry-c781e9c1.cjs} +1 -1
  10. package/dist/{button-component_2.entry-db53e00a.js → button-component_2.entry-36e49459.js} +9 -9
  11. package/dist/{button-component_2.entry-53bfdc19.cjs → button-component_2.entry-73f76545.cjs} +1 -1
  12. package/dist/calendar-agenda-fill-icon_36.entry-e9b92e0e.cjs +6 -0
  13. package/dist/{calendar-agenda-fill-icon_36.entry-76796ea7.js → calendar-agenda-fill-icon_36.entry-efa7ad26.js} +100 -100
  14. package/dist/{calendar-cancel-icon.entry-e5032d71.cjs → calendar-cancel-icon.entry-01c388eb.cjs} +1 -1
  15. package/dist/{calendar-cancel-icon.entry-f3b8ae99.js → calendar-cancel-icon.entry-0f739a8a.js} +4 -4
  16. package/dist/{calendar-check-icon_2.entry-7303362a.cjs → calendar-check-icon_2.entry-5febbadf.cjs} +1 -1
  17. package/dist/{calendar-check-icon_2.entry-27dc91f7.js → calendar-check-icon_2.entry-dfb0036d.js} +3 -3
  18. package/dist/{calendar-icon.entry-4f432baf.cjs → calendar-icon.entry-9743e0b7.cjs} +1 -1
  19. package/dist/{calendar-icon.entry-48fc45d6.js → calendar-icon.entry-f197396d.js} +2 -2
  20. package/dist/{checkbox-component.entry-8fad4faf.cjs → checkbox-component.entry-1aa5782f.cjs} +1 -1
  21. package/dist/{checkbox-component.entry-a15ffc4c.js → checkbox-component.entry-72a6aa72.js} +4 -4
  22. package/dist/checkmark-icon_15.entry-35dd97b7.cjs +5 -0
  23. package/dist/{checkmark-icon_15.entry-9f926a70.js → checkmark-icon_15.entry-5c09cff5.js} +225 -223
  24. package/dist/{chevron-icon_3.entry-5130fbba.js → chevron-icon_3.entry-4a72f211.js} +6 -6
  25. package/dist/chevron-icon_3.entry-e0608b7c.cjs +1 -0
  26. package/dist/{clock-icon_4.entry-40a393c9.js → clock-icon_4.entry-0afe79c2.js} +8 -8
  27. package/dist/{clock-icon_4.entry-ac65deae.cjs → clock-icon_4.entry-202ce025.cjs} +1 -1
  28. package/dist/constants-f51538ef-cd2a67c4.cjs +1 -0
  29. package/dist/{constants-3d8016e3-3c080f00.js → constants-f51538ef-e0a5f026.js} +27 -32
  30. package/dist/{customParseFormat-a4d9ea69-763f219e.cjs → customParseFormat-d1de5ed0-65a0bba3.cjs} +1 -1
  31. package/dist/{customParseFormat-a4d9ea69-7caebeb2.js → customParseFormat-d1de5ed0-c0ef002d.js} +1 -1
  32. package/dist/{delete-icon.entry-78e44eba.js → delete-icon.entry-580bfcc9.js} +4 -4
  33. package/dist/{delete-icon.entry-770dac8c.cjs → delete-icon.entry-762ac892.cjs} +1 -1
  34. package/dist/{document-refresh-icon.entry-d331f844.cjs → document-refresh-icon.entry-4e0f0c61.cjs} +1 -1
  35. package/dist/document-refresh-icon.entry-e500b4e3.js +16 -0
  36. package/dist/elements/index.d.ts +0 -8
  37. package/dist/{feedbackSync-57bb471a-ee800a95.js → feedbackSync-172f942c-42124493.js} +1 -1
  38. package/dist/{feedbackSync-57bb471a-5afb7715.cjs → feedbackSync-172f942c-62f72bd2.cjs} +1 -1
  39. package/dist/{folder-icon.entry-163e0aee.cjs → folder-icon.entry-2694e253.cjs} +1 -1
  40. package/dist/{folder-icon.entry-42650400.js → folder-icon.entry-54c3cc66.js} +2 -2
  41. package/dist/{forward-icon.entry-d60b6e31.js → forward-icon.entry-5e540f05.js} +5 -5
  42. package/dist/{forward-icon.entry-0a499b38.cjs → forward-icon.entry-f07102d8.cjs} +1 -1
  43. package/dist/{globe-icon_2.entry-19359092.cjs → globe-icon_2.entry-14a4c168.cjs} +1 -1
  44. package/dist/{globe-icon_2.entry-5afa8049.js → globe-icon_2.entry-aaceb196.js} +90 -80
  45. package/dist/{google-logo-icon_6.entry-d2febb78.js → google-logo-icon_6.entry-00d40db2.js} +473 -439
  46. package/dist/google-logo-icon_6.entry-fa76ffe3.cjs +2 -0
  47. package/dist/{google-meet-icon_5.entry-4a94137f.cjs → google-meet-icon_5.entry-6c20e149.cjs} +1 -1
  48. package/dist/{google-meet-icon_5.entry-7b1b36f2.js → google-meet-icon_5.entry-f1f05903.js} +12 -12
  49. package/dist/inbox-icon.entry-9a4628f2.cjs +1 -0
  50. package/dist/inbox-icon.entry-aa78ba8c.js +16 -0
  51. package/dist/index-1e75512f.cjs +57 -0
  52. package/dist/{index-9243e481.js → index-e8380973.js} +5687 -4802
  53. package/dist/{index.es-13ff6710-0f748bd2.cjs → index.es-fc8588de-034ead51.cjs} +6 -6
  54. package/dist/{index.es-13ff6710-73fa05e6.js → index.es-fc8588de-c943eef6.js} +827 -1065
  55. package/dist/{info-icon_2.entry-ba869bab.js → info-icon_2.entry-b3b313ab.js} +3 -3
  56. package/dist/{info-icon_2.entry-6667923a.cjs → info-icon_2.entry-bbcefb9a.cjs} +1 -1
  57. package/dist/{input-component.entry-7396acf1.js → input-component.entry-401b9ba5.js} +9 -9
  58. package/dist/{input-component.entry-db84f917.cjs → input-component.entry-ec8e8e7c.cjs} +1 -1
  59. package/dist/input-dropdown_2.entry-8cb11601.cjs +1 -0
  60. package/dist/{input-dropdown_2.entry-20f2031b.js → input-dropdown_2.entry-c37f392c.js} +6 -6
  61. package/dist/italic-icon.entry-0e85d0d9.js +16 -0
  62. package/dist/italic-icon.entry-6675558a.cjs +1 -0
  63. package/dist/{multi-select-dropdown_2.entry-81740b34.js → multi-select-dropdown_2.entry-3eecf18a.js} +22 -16
  64. package/dist/{multi-select-dropdown_2.entry-8e07b42b.cjs → multi-select-dropdown_2.entry-e37c501d.cjs} +1 -1
  65. package/dist/{nylas-booked-event-card_12.entry-e56c8e92.js → nylas-booked-event-card_12.entry-e7464ae7.js} +226 -224
  66. package/dist/nylas-booked-event-card_12.entry-fddc9ab8.cjs +1 -0
  67. package/dist/{nylas-event-calendar_3.entry-2504c7c0.js → nylas-event-calendar_3.entry-9abd46c2.js} +2360 -2238
  68. package/dist/nylas-event-calendar_3.entry-e6669bbf.cjs +11 -0
  69. package/dist/{nylas-form-card.entry-98903549.js → nylas-form-card.entry-a3186807.js} +3 -3
  70. package/dist/{nylas-form-card.entry-c406e3d3.cjs → nylas-form-card.entry-cbb00fba.cjs} +1 -1
  71. package/dist/nylas-scheduler-editor.entry-5c92901a.cjs +2 -0
  72. package/dist/{nylas-scheduler-editor.entry-670cc0b8.js → nylas-scheduler-editor.entry-7b188a38.js} +83 -50
  73. package/dist/nylas-scheduling.entry-970240f6.cjs +1 -0
  74. package/dist/nylas-scheduling.entry-e9929b03.js +968 -0
  75. package/dist/{person-icon.entry-bdaa899b.cjs → person-icon.entry-8998fdb8.cjs} +1 -1
  76. package/dist/{person-icon.entry-3bca6e51.js → person-icon.entry-d2856f08.js} +4 -4
  77. package/dist/{play-icon.entry-ecc86e85.cjs → play-icon.entry-99eb969b.cjs} +1 -1
  78. package/dist/play-icon.entry-f949a80f.js +16 -0
  79. package/dist/{radio-button-group.entry-9851076c.js → radio-button-group.entry-bc3b12fd.js} +2 -2
  80. package/dist/{radio-button-group.entry-6965ad34.cjs → radio-button-group.entry-d66edd04.cjs} +1 -1
  81. package/dist/react.cjs +1 -1
  82. package/dist/react.js +96 -104
  83. package/dist/{refresh-icon.entry-90d52ab3.cjs → refresh-icon.entry-99d1982d.cjs} +1 -1
  84. package/dist/{refresh-icon.entry-d776c4a7.js → refresh-icon.entry-d6df8b1c.js} +2 -2
  85. package/dist/{register-component-02a05665-2e992621.js → register-component-62d792d4-448b6a43.js} +1 -1
  86. package/dist/{register-component-02a05665-75652287.cjs → register-component-62d792d4-c6e7d129.cjs} +1 -1
  87. package/dist/{reply-all-icon.entry-24f7c0fe.js → reply-all-icon.entry-7ebf01a0.js} +2 -2
  88. package/dist/{reply-all-icon.entry-6e49eb03.cjs → reply-all-icon.entry-d7c44139.cjs} +1 -1
  89. package/dist/{reply-icon.entry-7fff25c9.cjs → reply-icon.entry-058c00e8.cjs} +1 -1
  90. package/dist/{reply-icon.entry-d5d26d65.js → reply-icon.entry-d1622d85.js} +5 -5
  91. package/dist/sent-icon.entry-6c604512.cjs +1 -0
  92. package/dist/sent-icon.entry-fe12bc2f.js +16 -0
  93. package/dist/spam-icon.entry-45e5292e.cjs +1 -0
  94. package/dist/spam-icon.entry-b97c7709.js +16 -0
  95. package/dist/{star-icon.entry-3c57a35c.cjs → star-icon.entry-4db13fdb.cjs} +1 -1
  96. package/dist/{star-icon.entry-c2e743a9.js → star-icon.entry-98b80645.js} +6 -6
  97. package/dist/{stop-icon.entry-0b9563d5.js → stop-icon.entry-0290fd30.js} +2 -2
  98. package/dist/{stop-icon.entry-cf4c4e63.cjs → stop-icon.entry-9d7b53fd.cjs} +1 -1
  99. package/dist/{textarea-component.entry-2eccc173.cjs → textarea-component.entry-9b474ab5.cjs} +1 -1
  100. package/dist/{textarea-component.entry-60e7a4d0.js → textarea-component.entry-a62c257b.js} +2 -2
  101. package/dist/{toggle-switch.entry-612744fd.cjs → toggle-switch.entry-5dbfcd48.cjs} +1 -1
  102. package/dist/{toggle-switch.entry-0a6b01e6.js → toggle-switch.entry-e423b793.js} +2 -2
  103. package/dist/{translate-icon.entry-ede5f77d.js → translate-icon.entry-60c55a2e.js} +4 -4
  104. package/dist/{translate-icon.entry-8adc4146.cjs → translate-icon.entry-f82fa6fc.cjs} +1 -1
  105. package/dist/trash-fill-icon.entry-095caae3.cjs +1 -0
  106. package/dist/trash-fill-icon.entry-825055fd.js +16 -0
  107. package/dist/{underline-icon.entry-d2fe2da6.cjs → underline-icon.entry-0807a43d.cjs} +1 -1
  108. package/dist/{underline-icon.entry-b2b43ba2.js → underline-icon.entry-40028bc6.js} +2 -2
  109. package/dist/{warning-icon.entry-0a5c7337.js → warning-icon.entry-24e37759.js} +2 -2
  110. package/dist/{warning-icon.entry-85822f4d.cjs → warning-icon.entry-fce7c14f.cjs} +1 -1
  111. package/package.json +2 -2
  112. package/dist/add-circle-icon_2.entry-e616ece6.cjs +0 -1
  113. package/dist/archive-icon.entry-41938a61.cjs +0 -1
  114. package/dist/archive-icon.entry-bd81d2d9.js +0 -16
  115. package/dist/arrow-icon.entry-4103be57.cjs +0 -1
  116. package/dist/calendar-agenda-fill-icon_36.entry-917e4a9d.cjs +0 -6
  117. package/dist/checkmark-icon_15.entry-08c8b107.cjs +0 -5
  118. package/dist/chevron-icon_3.entry-2f75c3c4.cjs +0 -1
  119. package/dist/constants-3d8016e3-fd6c3848.cjs +0 -1
  120. package/dist/document-refresh-icon.entry-f6dfe744.js +0 -16
  121. package/dist/google-logo-icon_6.entry-896a10a5.cjs +0 -2
  122. package/dist/inbox-icon.entry-24ec450f.cjs +0 -1
  123. package/dist/inbox-icon.entry-b71acde0.js +0 -16
  124. package/dist/index-efb6db79.cjs +0 -57
  125. package/dist/input-dropdown_2.entry-0c219620.cjs +0 -1
  126. package/dist/italic-icon.entry-a9324a8a.cjs +0 -1
  127. package/dist/italic-icon.entry-c42f8112.js +0 -16
  128. package/dist/notebook-store-b61693cd-5657061b.js +0 -14
  129. package/dist/notebook-store-b61693cd-6515d345.cjs +0 -5
  130. package/dist/nylas-booked-event-card_12.entry-7c7afae5.cjs +0 -1
  131. package/dist/nylas-call-summary.entry-4bf7284f.cjs +0 -1
  132. package/dist/nylas-call-summary.entry-ad6fb46a.js +0 -16
  133. package/dist/nylas-event-calendar_3.entry-f747f6a8.cjs +0 -6
  134. package/dist/nylas-if-state.entry-6b071705.cjs +0 -1
  135. package/dist/nylas-if-state.entry-7468854a.js +0 -95
  136. package/dist/nylas-key-points.entry-7af8da1a.cjs +0 -1
  137. package/dist/nylas-key-points.entry-c186445e.js +0 -29
  138. package/dist/nylas-login.entry-171bd025.cjs +0 -1
  139. package/dist/nylas-login.entry-d85c1473.js +0 -74
  140. package/dist/nylas-provider.entry-ab1f6886.js +0 -265
  141. package/dist/nylas-provider.entry-e4231b93.cjs +0 -1
  142. package/dist/nylas-scheduler-editor.entry-d522ca98.cjs +0 -2
  143. package/dist/nylas-scheduling.entry-9e81c6fc.js +0 -439
  144. package/dist/nylas-scheduling.entry-c52edb14.cjs +0 -1
  145. package/dist/nylas-transcript.entry-a1fa7e17.cjs +0 -6
  146. package/dist/nylas-transcript.entry-fb39b5af.js +0 -128
  147. package/dist/nylas-video-player.entry-25e8cd9a.js +0 -39
  148. package/dist/nylas-video-player.entry-89842545.cjs +0 -1
  149. package/dist/nylas-video-preview.entry-28a0bd60.cjs +0 -1
  150. package/dist/nylas-video-preview.entry-80171531.js +0 -16
  151. package/dist/play-icon.entry-d548464e.js +0 -16
  152. package/dist/scheduler-config-store-d6729d8d-50920e8c.js +0 -29
  153. package/dist/scheduler-config-store-d6729d8d-a0bdda83.cjs +0 -1
  154. package/dist/scheduler-store-fe9e85a4-1dcfddfa.js +0 -533
  155. package/dist/scheduler-store-fe9e85a4-baabf78a.cjs +0 -1
  156. package/dist/sent-icon.entry-42ce5bcb.cjs +0 -1
  157. package/dist/sent-icon.entry-858fe83e.js +0 -16
  158. package/dist/spam-icon.entry-0827144e.js +0 -16
  159. package/dist/spam-icon.entry-bf1a48b6.cjs +0 -1
  160. package/dist/trash-fill-icon.entry-b6456ec8.cjs +0 -1
  161. package/dist/trash-fill-icon.entry-d48f72c5.js +0 -16
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-efb6db79.cjs"),u=require("./register-component-02a05665-75652287.cjs");require("react");require("react/jsx-runtime");require("react-dom");const c=":host{display:block}div{height:inherit}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fade-in{animation:fadeIn 1.5s}.fade-out{animation:fadeOut 1.5s}@keyframes slideIn{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes slideOut{0%{transform:translateY(0)}100%{transform:translateY(100%)}}.slide-in{animation:slideIn 1.5s}.slide-out{animation:slideOut 1.5s}@keyframes swipeIn{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes swipeOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}.swipe-in{animation:swipeIn 1.5s}.swipe-out{animation:swipeOut 1.5s}",h=c;var m=function(e,n,s,a){var t=arguments.length,o=t<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,s):a,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,n,s,a);else for(var f=e.length-1;f>=0;f--)(r=e[f])&&(o=(t<3?r(o):t>3?r(n,s,o):r(n,s))||o);return t>3&&o&&Object.defineProperty(n,s,o),o},l=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)};const d=class{constructor(e){i.registerInstance(this,e),this.state=void 0,this.isStateSet=void 0,this.isBoolean=void 0,this.getStore=void 0,this.transition="none",this.show=!1,this.classes={},this.initTransition=this.initTransition.bind(this)}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){i.debug("[nylas-if-state] Component will load"),this.watchStore(!0)}async componentDidLoad(){i.debug("[nylas-if-state] Component did load")}shouldRender(){const[e,n]=this.state?this.state.split("."):["",""],s=this.getStore;if(typeof s>"u")return i.debug(`[nylas-if-state] Store name: ${e} | State name: ${n}`,{getStore:s}),!1;const a=s(e);if(typeof a>"u")return i.debug(`[nylas-if-state] Store name: ${e} | State name: ${n}`,{store:a}),!1;const t=a.state[n];return typeof this.isStateSet=="boolean"?this.isStateSet===!1&&(typeof t>"u"||t===null||t.length===0)||this.isStateSet===!0&&typeof t<"u"&&t!==null:typeof this.isBoolean=="boolean"?this.isBoolean===!0&&typeof t<"u"&&t===!0||this.isBoolean===!1&&typeof t<"u"&&t===!1:!1}onGetStoreChange(){this.watchStore(!0)}watchStore(e=!1){const[n,s]=this.state?this.state.split("."):["",""],a=this.getStore;if(typeof a>"u")return i.debug(`[nylas-if-state] Store name: ${n} | State name: ${s}`,{getStore:a}),null;const t=a(n);if(typeof t>"u")return i.debug(`[nylas-if-state] Store name: ${n} | State name: ${s}`,{store:t}),null;e===!0&&this.initTransition(),t.onChange(s,this.initTransition)}initTransition(){const e=this.shouldRender();switch(this.transition){case"fade":case"slide":case"swipe":this.classes={[`${this.transition}-in`]:e,[`${this.transition}-out`]:!e},setTimeout(()=>{this.show=e},150);break;default:this.show=this.shouldRender();break}}render(){return i.h(i.Host,{key:"38321c4fa1d8c27d1d212c23d1a30b3c03be33a4"},i.h("div",{key:"eeaddfba88d99a7542cfaff75be7e279b456b812",class:this.classes},this.show&&i.h("slot",null)))}static get watchers(){return{getStore:["onGetStoreChange"]}}};m([u.RegisterComponent({name:"nylas-if-state",getStoresToProp:"getStore",fireRegisterEvent:!0}),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],d.prototype,"render",null);d.style=h;exports.nylas_if_state=d;
@@ -1,95 +0,0 @@
1
- import { r as h, d as o, h as l, H as u } from "./index-9243e481.js";
2
- import { R as m } from "./register-component-02a05665-2e992621.js";
3
- import "react";
4
- import "react/jsx-runtime";
5
- import "react-dom";
6
- const p = ":host{display:block}div{height:inherit}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fade-in{animation:fadeIn 1.5s}.fade-out{animation:fadeOut 1.5s}@keyframes slideIn{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes slideOut{0%{transform:translateY(0)}100%{transform:translateY(100%)}}.slide-in{animation:slideIn 1.5s}.slide-out{animation:slideOut 1.5s}@keyframes swipeIn{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes swipeOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}.swipe-in{animation:swipeIn 1.5s}.swipe-out{animation:swipeOut 1.5s}", y = p;
7
- var S = function(e, s, n, a) {
8
- var t = arguments.length, i = t < 3 ? s : a === null ? a = Object.getOwnPropertyDescriptor(s, n) : a, r;
9
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
10
- i = Reflect.decorate(e, s, n, a);
11
- else
12
- for (var f = e.length - 1; f >= 0; f--)
13
- (r = e[f]) && (i = (t < 3 ? r(i) : t > 3 ? r(s, n, i) : r(s, n)) || i);
14
- return t > 3 && i && Object.defineProperty(s, n, i), i;
15
- }, d = function(e, s) {
16
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
17
- return Reflect.metadata(e, s);
18
- };
19
- const c = class {
20
- constructor(e) {
21
- h(this, e), this.state = void 0, this.isStateSet = void 0, this.isBoolean = void 0, this.getStore = void 0, this.transition = "none", this.show = !1, this.classes = {}, this.initTransition = this.initTransition.bind(this);
22
- }
23
- connectedCallback() {
24
- }
25
- disconnectedCallback() {
26
- }
27
- async componentWillLoad() {
28
- o("[nylas-if-state] Component will load"), this.watchStore(!0);
29
- }
30
- async componentDidLoad() {
31
- o("[nylas-if-state] Component did load");
32
- }
33
- shouldRender() {
34
- const [e, s] = this.state ? this.state.split(".") : ["", ""], n = this.getStore;
35
- if (typeof n > "u")
36
- return o(`[nylas-if-state] Store name: ${e} | State name: ${s}`, { getStore: n }), !1;
37
- const a = n(e);
38
- if (typeof a > "u")
39
- return o(`[nylas-if-state] Store name: ${e} | State name: ${s}`, { store: a }), !1;
40
- const t = a.state[s];
41
- return typeof this.isStateSet == "boolean" ? this.isStateSet === !1 && (typeof t > "u" || t === null || t.length === 0) || this.isStateSet === !0 && typeof t < "u" && t !== null : typeof this.isBoolean == "boolean" ? this.isBoolean === !0 && typeof t < "u" && t === !0 || this.isBoolean === !1 && typeof t < "u" && t === !1 : !1;
42
- }
43
- onGetStoreChange() {
44
- this.watchStore(!0);
45
- }
46
- watchStore(e = !1) {
47
- const [s, n] = this.state ? this.state.split(".") : ["", ""], a = this.getStore;
48
- if (typeof a > "u")
49
- return o(`[nylas-if-state] Store name: ${s} | State name: ${n}`, { getStore: a }), null;
50
- const t = a(s);
51
- if (typeof t > "u")
52
- return o(`[nylas-if-state] Store name: ${s} | State name: ${n}`, { store: t }), null;
53
- e === !0 && this.initTransition(), t.onChange(n, this.initTransition);
54
- }
55
- initTransition() {
56
- const e = this.shouldRender();
57
- switch (this.transition) {
58
- case "fade":
59
- case "slide":
60
- case "swipe":
61
- this.classes = {
62
- [`${this.transition}-in`]: e,
63
- [`${this.transition}-out`]: !e
64
- }, setTimeout(() => {
65
- this.show = e;
66
- }, 150);
67
- break;
68
- default:
69
- this.show = this.shouldRender();
70
- break;
71
- }
72
- }
73
- render() {
74
- return l(u, { key: "38321c4fa1d8c27d1d212c23d1a30b3c03be33a4" }, l("div", { key: "eeaddfba88d99a7542cfaff75be7e279b456b812", class: this.classes }, this.show && l("slot", null)));
75
- }
76
- static get watchers() {
77
- return {
78
- getStore: ["onGetStoreChange"]
79
- };
80
- }
81
- };
82
- S([
83
- m({
84
- name: "nylas-if-state",
85
- getStoresToProp: "getStore",
86
- fireRegisterEvent: !0
87
- }),
88
- d("design:type", Function),
89
- d("design:paramtypes", []),
90
- d("design:returntype", void 0)
91
- ], c.prototype, "render", null);
92
- c.style = y;
93
- export {
94
- c as nylas_if_state
95
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-efb6db79.cjs"),r=require("./notebook-store-b61693cd-6515d345.cjs");require("react");require("react/jsx-runtime");require("react-dom");const a=".key-points{padding:24px 20px;background-color:white;font-size:14px;letter-spacing:-4%;line-height:22px;border:1px solid #c7dbf9;border-radius:8px}.key-points .title{font-size:18px;font-weight:600}.key-points-item{display:flex;align-items:center;margin-top:16px;gap:20px;line-height:24px;font-weight:400;padding:5px;border-radius:6px}.key-points-item .time{color:#9747ff;font-weight:500}.key-points-item.active{background-color:#ebeff6}",c=a;function d(e){const s=Math.floor(e/60),i=e%60;return`${String(s).padStart(2,"0")}:${String(i).padStart(2,"0")}`}const n=class{constructor(e){t.registerInstance(this,e),this.keyPoints=[]}transcripts(){const e=r.videoStore.get("videoTime"),s=this.keyPoints.findIndex(i=>i.time>=e)-1;return this.keyPoints.map((i,o)=>({...i,active:o===s}))}render(){return t.h("div",{key:"5d4dcfe1427e773265ec415e9d1f32969b51905b",class:"key-points"},t.h("div",{key:"00e5ca8bcdeb405c65c1555a883f39a3f87f9680",class:"title"},"Key Points"),this.transcripts().map(e=>t.h("div",{class:{"key-points-item":!0,active:e.active}},t.h("div",{class:"time"},d(e.time)),t.h("div",{class:"text"},e.text))))}};n.style=c;exports.nylas_key_points=n;
@@ -1,29 +0,0 @@
1
- import { r as o, h as i } from "./index-9243e481.js";
2
- import { v as r } from "./notebook-store-b61693cd-5657061b.js";
3
- import "react";
4
- import "react/jsx-runtime";
5
- import "react-dom";
6
- const a = ".key-points{padding:24px 20px;background-color:white;font-size:14px;letter-spacing:-4%;line-height:22px;border:1px solid #c7dbf9;border-radius:8px}.key-points .title{font-size:18px;font-weight:600}.key-points-item{display:flex;align-items:center;margin-top:16px;gap:20px;line-height:24px;font-weight:400;padding:5px;border-radius:6px}.key-points-item .time{color:#9747ff;font-weight:500}.key-points-item.active{background-color:#ebeff6}", c = a;
7
- function p(t) {
8
- const s = Math.floor(t / 60), e = t % 60;
9
- return `${String(s).padStart(2, "0")}:${String(e).padStart(2, "0")}`;
10
- }
11
- const d = class {
12
- constructor(t) {
13
- o(this, t), this.keyPoints = [];
14
- }
15
- transcripts() {
16
- const t = r.get("videoTime"), s = this.keyPoints.findIndex((e) => e.time >= t) - 1;
17
- return this.keyPoints.map((e, n) => ({
18
- ...e,
19
- active: n === s
20
- }));
21
- }
22
- render() {
23
- return i("div", { key: "5d4dcfe1427e773265ec415e9d1f32969b51905b", class: "key-points" }, i("div", { key: "00e5ca8bcdeb405c65c1555a883f39a3f87f9680", class: "title" }, "Key Points"), this.transcripts().map((t) => i("div", { class: { "key-points-item": !0, active: t.active } }, i("div", { class: "time" }, p(t.time)), i("div", { class: "text" }, t.text))));
24
- }
25
- };
26
- d.style = c;
27
- export {
28
- d as nylas_key_points
29
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-efb6db79.cjs"),h=require("./register-component-02a05665-75652287.cjs");require("react");require("react/jsx-runtime");require("react-dom");const u=":host{font-family:'Arial', sans-serif;background:var(--nylas-color-primary-50);color:var(--nylas-color-primary-800);margin:0;display:contents}input{box-sizing:border-box}.login-container{display:flex;justify-content:center;align-items:center;height:100%}.login-box{width:300px;padding:20px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-color-primary-50);text-align:center}.login-box h1{margin-top:0;margin-bottom:0.5em}.login-box p{margin-bottom:1em}.login-methods button{display:block;width:100%;padding:10px 10px 10px 50px;margin-bottom:10px;border:none;border-radius:var(--nylas-border-radius);border:1px solid var(--nylas-color-primary-300);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-600);cursor:pointer;transition:background 0.3s ease;position:relative;text-align:left}.login-methods button svg{position:absolute;left:16px;top:50%;transform:translateY(-50%)}.login-methods button:hover{background:var(--nylas-color-primary-200);}.login-form label{display:block;margin-bottom:5px;text-align:left}.login-form input{width:100%;padding:10px;margin-bottom:10px;border:1px solid var(--nylas-color-primary-200);border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-800);}.login-form button{width:100%;padding:10px;border:none;border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-500);color:var(--nylas-color-primary-50);cursor:pointer;transition:background 0.3s ease}.login-form button:hover{background:var(--nylas-color-primary-600);}",p=u;var g=function(n,o,i,e){var a=arguments.length,r=a<3?o:e===null?e=Object.getOwnPropertyDescriptor(o,i):e,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,o,i,e);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(r=(a<3?s(r):a>3?s(o,i,r):s(o,i))||r);return a>3&&r&&Object.defineProperty(o,i,r),r},c=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)};const d=class{constructor(n){t.registerInstance(this,n),this.buttonClick=t.createEvent(this,"buttonClick",7),this._handleLoginRedirect=async()=>{var e;const o=await((e=this.nylasConnector)==null?void 0:e.auth.getHostedAuthRedirectURL(this.scopes));this.buttonClick.emit({url:o}).defaultPrevented||o&&(window.location.href=o)},this._onGoogleButtonClick=async o=>{var e;o.preventDefault();const i=await((e=this.nylasConnector)==null?void 0:e.auth.getHostedAuthRedirectURL(this.scopes,void 0,"google"));i&&(window.location.href=i)},this._onMicrosoftButtonClick=async o=>{var e;o.preventDefault();const i=await((e=this.nylasConnector)==null?void 0:e.auth.getHostedAuthRedirectURL(this.scopes,void 0,"microsoft"));i&&(window.location.href=i)},this._onFormSubmit=async o=>{var e;o.preventDefault();const i=await((e=this.nylasConnector)==null?void 0:e.auth.getHostedAuthRedirectURL(this.scopes,this.email));i&&(window.location.href=i)},this.isAuthenticated=!1,this.nylasConnector=void 0,this.scopes=void 0,this.loginMethod="redirect",this.companyName="Nylas",this.logoUrl="https://www.nylas.com/wp-content/uploads/main-logo.svg",this.logoWidth="min-content",this.providers="google,microsoft",this.buttonText="Login",this.email=""}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}async componentDidLoad(){var o;await((o=this.nylasConnector)==null?void 0:o.auth.manageHostedAuthCodeExchange(window.location.href))&&window.history.replaceState({},document.title,window.location.pathname)}render(){var o;const n=((o=this.providers)==null?void 0:o.split(","))||[];return t.h(t.Host,{key:"27d4a3f463e79c5d471cb6bd487bb1e5ed79f736"},this.loginMethod==="redirect"&&t.h("div",{class:"redirect-container"},!this.isAuthenticated&&t.h("button",{part:"button",onClick:this._handleLoginRedirect},this.buttonText)),this.loginMethod==="emebded"&&t.h("main",{class:"login-container"},t.h("section",{class:"login-box"},t.h("header",null,t.h("img",{src:this.logoUrl,alt:`${this.companyName} logo`,width:"100%",style:{minWidth:this.logoWidth}}),t.h("h1",null,"Welcome")),t.h("p",null,"Log in to your account to continue to ",this.companyName),t.h("div",{class:"login-methods"},n.includes("google")&&t.h("button",{class:"login-google",onClick:this._onGoogleButtonClick},t.h("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"18",height:"18",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 256 262"},t.h("path",{fill:"#4285F4",d:"M255.6 131.6c0-8.2-.8-16.2-2.2-23.9H130v45.3h70.3c-3 16.1-12.4 29.7-26.3 38.9v32.4h42.6c25-23 39.4-56.7 39.4-97.7z"}),t.h("path",{fill:"#34A853",d:"M130 262c35.3 0 64.9-11.7 86.5-31.7l-42.6-32.4c-11.7 7.9-26.7 12.6-43.9 12.6-33.7 0-62.3-22.7-72.5-53.4H14.5v33.3A130.3 130.3 0 00130 262z"}),t.h("path",{fill:"#FBBC05",d:"M57.5 158.1a72.7 72.7 0 010-54.2V70.6H14.5a130.4 130.4 0 000 120.8l43-33.3z"}),t.h("path",{fill:"#EA4335",d:"M130 51.6c19 0 36 6.5 49.4 19.2l37-36C195 13.1 165.2 0 130 0A130.3 130.3 0 0014.5 70.6l43 33.3c10.2-30.7 38.8-53.3 72.5-53.3z"})),"Continue with Google"),n.includes("microsoft")&&t.h("button",{class:"login-microsoft",onClick:this._onMicrosoftButtonClick},t.h("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"18",height:"18",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 448 512"},t.h("path",{fill:"#F3F3F3",d:"M0 32v192h192V32H0zm256 0v192h192V32H256zm192 256v192h-192V288h192zM0 224v192h192V224H0z"})),"Continue with Microsoft")),t.h("form",{class:"login-form",method:"POST",onSubmit:this._onFormSubmit},t.h("label",{htmlFor:"email"},"Email"),t.h("input",{type:"email",id:"email",name:"email",required:!0,value:this.email}),t.h("button",{type:"submit"},"Next")))))}};g([h.RegisterComponent({name:"nylas-login",connectorToProp:"nylasConnector",stateToProps:new Map([["auth.isAuthenticated","isAuthenticated"]]),fireRegisterEvent:!0}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],d.prototype,"render",null);d.style=p;exports.nylas_login=d;
@@ -1,74 +0,0 @@
1
- import { r as h, c as p, h as o, H as u } from "./index-9243e481.js";
2
- import { R as m } from "./register-component-02a05665-2e992621.js";
3
- import "react";
4
- import "react/jsx-runtime";
5
- import "react-dom";
6
- const g = ":host{font-family:'Arial', sans-serif;background:var(--nylas-color-primary-50);color:var(--nylas-color-primary-800);margin:0;display:contents}input{box-sizing:border-box}.login-container{display:flex;justify-content:center;align-items:center;height:100%}.login-box{width:300px;padding:20px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-color-primary-50);text-align:center}.login-box h1{margin-top:0;margin-bottom:0.5em}.login-box p{margin-bottom:1em}.login-methods button{display:block;width:100%;padding:10px 10px 10px 50px;margin-bottom:10px;border:none;border-radius:var(--nylas-border-radius);border:1px solid var(--nylas-color-primary-300);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-600);cursor:pointer;transition:background 0.3s ease;position:relative;text-align:left}.login-methods button svg{position:absolute;left:16px;top:50%;transform:translateY(-50%)}.login-methods button:hover{background:var(--nylas-color-primary-200);}.login-form label{display:block;margin-bottom:5px;text-align:left}.login-form input{width:100%;padding:10px;margin-bottom:10px;border:1px solid var(--nylas-color-primary-200);border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-800);}.login-form button{width:100%;padding:10px;border:none;border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-500);color:var(--nylas-color-primary-50);cursor:pointer;transition:background 0.3s ease}.login-form button:hover{background:var(--nylas-color-primary-600);}", y = g;
7
- var f = function(n, t, i, e) {
8
- var a = arguments.length, r = a < 3 ? t : e === null ? e = Object.getOwnPropertyDescriptor(t, i) : e, s;
9
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
10
- r = Reflect.decorate(n, t, i, e);
11
- else
12
- for (var l = n.length - 1; l >= 0; l--)
13
- (s = n[l]) && (r = (a < 3 ? s(r) : a > 3 ? s(t, i, r) : s(t, i)) || r);
14
- return a > 3 && r && Object.defineProperty(t, i, r), r;
15
- }, c = function(n, t) {
16
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
17
- return Reflect.metadata(n, t);
18
- };
19
- const d = class {
20
- constructor(n) {
21
- h(this, n), this.buttonClick = p(this, "buttonClick", 7), this._handleLoginRedirect = async () => {
22
- var e;
23
- const t = await ((e = this.nylasConnector) == null ? void 0 : e.auth.getHostedAuthRedirectURL(this.scopes));
24
- this.buttonClick.emit({ url: t }).defaultPrevented || t && (window.location.href = t);
25
- }, this._onGoogleButtonClick = async (t) => {
26
- var e;
27
- t.preventDefault();
28
- const i = await ((e = this.nylasConnector) == null ? void 0 : e.auth.getHostedAuthRedirectURL(this.scopes, void 0, "google"));
29
- i && (window.location.href = i);
30
- }, this._onMicrosoftButtonClick = async (t) => {
31
- var e;
32
- t.preventDefault();
33
- const i = await ((e = this.nylasConnector) == null ? void 0 : e.auth.getHostedAuthRedirectURL(this.scopes, void 0, "microsoft"));
34
- i && (window.location.href = i);
35
- }, this._onFormSubmit = async (t) => {
36
- var e;
37
- t.preventDefault();
38
- const i = await ((e = this.nylasConnector) == null ? void 0 : e.auth.getHostedAuthRedirectURL(this.scopes, this.email));
39
- i && (window.location.href = i);
40
- }, this.isAuthenticated = !1, this.nylasConnector = void 0, this.scopes = void 0, this.loginMethod = "redirect", this.companyName = "Nylas", this.logoUrl = "https://www.nylas.com/wp-content/uploads/main-logo.svg", this.logoWidth = "min-content", this.providers = "google,microsoft", this.buttonText = "Login", this.email = "";
41
- }
42
- connectedCallback() {
43
- }
44
- disconnectedCallback() {
45
- }
46
- componentWillLoad() {
47
- }
48
- async componentDidLoad() {
49
- var t;
50
- await ((t = this.nylasConnector) == null ? void 0 : t.auth.manageHostedAuthCodeExchange(window.location.href)) && window.history.replaceState({}, document.title, window.location.pathname);
51
- }
52
- render() {
53
- var t;
54
- const n = ((t = this.providers) == null ? void 0 : t.split(",")) || [];
55
- return o(u, { key: "27d4a3f463e79c5d471cb6bd487bb1e5ed79f736" }, this.loginMethod === "redirect" && o("div", { class: "redirect-container" }, !this.isAuthenticated && o("button", { part: "button", onClick: this._handleLoginRedirect }, this.buttonText)), this.loginMethod === "emebded" && o("main", { class: "login-container" }, o("section", { class: "login-box" }, o("header", null, o("img", { src: this.logoUrl, alt: `${this.companyName} logo`, width: "100%", style: {
56
- minWidth: this.logoWidth
57
- } }), o("h1", null, "Welcome")), o("p", null, "Log in to your account to continue to ", this.companyName), o("div", { class: "login-methods" }, n.includes("google") && o("button", { class: "login-google", onClick: this._onGoogleButtonClick }, o("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "img", width: "18", height: "18", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 256 262" }, o("path", { fill: "#4285F4", d: "M255.6 131.6c0-8.2-.8-16.2-2.2-23.9H130v45.3h70.3c-3 16.1-12.4 29.7-26.3 38.9v32.4h42.6c25-23 39.4-56.7 39.4-97.7z" }), o("path", { fill: "#34A853", d: "M130 262c35.3 0 64.9-11.7 86.5-31.7l-42.6-32.4c-11.7 7.9-26.7 12.6-43.9 12.6-33.7 0-62.3-22.7-72.5-53.4H14.5v33.3A130.3 130.3 0 00130 262z" }), o("path", { fill: "#FBBC05", d: "M57.5 158.1a72.7 72.7 0 010-54.2V70.6H14.5a130.4 130.4 0 000 120.8l43-33.3z" }), o("path", { fill: "#EA4335", d: "M130 51.6c19 0 36 6.5 49.4 19.2l37-36C195 13.1 165.2 0 130 0A130.3 130.3 0 0014.5 70.6l43 33.3c10.2-30.7 38.8-53.3 72.5-53.3z" })), "Continue with Google"), n.includes("microsoft") && o("button", { class: "login-microsoft", onClick: this._onMicrosoftButtonClick }, o("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "img", width: "18", height: "18", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 448 512" }, o("path", { fill: "#F3F3F3", d: "M0 32v192h192V32H0zm256 0v192h192V32H256zm192 256v192h-192V288h192zM0 224v192h192V224H0z" })), "Continue with Microsoft")), o("form", { class: "login-form", method: "POST", onSubmit: this._onFormSubmit }, o("label", { htmlFor: "email" }, "Email"), o("input", { type: "email", id: "email", name: "email", required: !0, value: this.email }), o("button", { type: "submit" }, "Next")))));
58
- }
59
- };
60
- f([
61
- m({
62
- name: "nylas-login",
63
- connectorToProp: "nylasConnector",
64
- stateToProps: /* @__PURE__ */ new Map([["auth.isAuthenticated", "isAuthenticated"]]),
65
- fireRegisterEvent: !0
66
- }),
67
- c("design:type", Function),
68
- c("design:paramtypes", []),
69
- c("design:returntype", void 0)
70
- ], d.prototype, "render", null);
71
- d.style = y;
72
- export {
73
- d as nylas_login
74
- };
@@ -1,265 +0,0 @@
1
- import { r as g, c as u, d as r, h as d, H as y, g as f, a as C } from "./index-9243e481.js";
2
- import { N as A, e as R } from "./index.es-13ff6710-73fa05e6.js";
3
- import { C as S, N as p } from "./scheduler-store-fe9e85a4-1dcfddfa.js";
4
- import { C as m } from "./scheduler-config-store-d6729d8d-50920e8c.js";
5
- import "react";
6
- import "react/jsx-runtime";
7
- import "react-dom";
8
- class w {
9
- constructor(t, e) {
10
- this.nylasAuth = t, this.nylasAuthStore = e;
11
- }
12
- async validateSession() {
13
- const t = await this.isAccessTokenValid();
14
- if (!t)
15
- this.logout();
16
- else {
17
- let e = await this.nylasAuth.getTokenInfo();
18
- if (e) {
19
- const o = Math.floor(Date.now() / 1e3);
20
- if (e.expires_in && e.expires_in - o < 3e5 && (r("[NylasAuthConnectorMixin] Refreshing access token"), e = await this.nylasAuth.refreshAccessToken(), !e)) {
21
- r("[NylasAuthConnectorMixin] Token is expired and could not be refreshed. Logging out."), this.logout();
22
- return;
23
- }
24
- this.nylasAuthStore.state.tokenInfo = e;
25
- }
26
- }
27
- this.nylasAuthStore.state.isAuthenticated = t;
28
- }
29
- async isAuthenticated() {
30
- return this.nylasAuth.isAuthenticated();
31
- }
32
- async getTokenInfo() {
33
- return this.nylasAuth.getTokenInfo();
34
- }
35
- async isAccessTokenValid() {
36
- return this.nylasAuth.isAccessTokenValid();
37
- }
38
- async logout() {
39
- await this.nylasAuth.logout();
40
- }
41
- async getHostedAuthRedirectURL(t, e, n) {
42
- return this.nylasAuth.getHostedAuthRedirectURL(t, e, n);
43
- }
44
- async manageHostedAuthCodeExchange(t) {
45
- const n = new URL(t).searchParams.get("code");
46
- if (n) {
47
- const o = await this.nylasAuth.exchangeAuthCodeForTokenInfo(n);
48
- if (o)
49
- return this.nylasAuthStore.state.tokenInfo = o, this.nylasAuthStore.state.isAuthenticated = !0, o;
50
- }
51
- return null;
52
- }
53
- }
54
- class P {
55
- constructor(t, e, n, o, a, i = "https://api.us.nylas.com") {
56
- this.router = t, this.schedulerAPIURL = i, this.nylasAuth = e, this.nylasAuthStore = n, this.nylasSchedulerStore = o, this.nylasSchedulerConfigStore = a;
57
- }
58
- init() {
59
- r("NylasConnector init");
60
- }
61
- get authStore() {
62
- return this.nylasAuthStore;
63
- }
64
- get schedulerStore() {
65
- return this.nylasSchedulerStore;
66
- }
67
- get schedulerConfigStore() {
68
- return this.nylasSchedulerConfigStore;
69
- }
70
- get auth() {
71
- return this._authConnector ? this._authConnector : (this._authConnector = new w(this.nylasAuth, this.nylasAuthStore), this._authConnector);
72
- }
73
- get scheduler() {
74
- return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new p({
75
- schedulerAPIURL: this.schedulerAPIURL,
76
- schedulerStore: this.schedulerStore
77
- }), this._schedulerAPIConnector);
78
- }
79
- getAuth() {
80
- return this.nylasAuth;
81
- }
82
- resetStores() {
83
- this.nylasAuthStore.reset();
84
- }
85
- async logout() {
86
- await this.nylasAuth.logout(), this.resetStores();
87
- }
88
- }
89
- class v extends Event {
90
- constructor(t, e) {
91
- super(t, e), this.oldURL = e.oldURL, this.newURL = e.newURL;
92
- }
93
- }
94
- class L {
95
- constructor() {
96
- this.routeChangeListeners = [], r("HashRouter constructor");
97
- }
98
- destroy() {
99
- r("HashRouter destroy"), window.removeEventListener("hashchange", this.onRouteChange.bind(this));
100
- }
101
- init() {
102
- if (r("HashRouter init"), window.addEventListener("hashchange", this.onRouteChange.bind(this)), typeof HashChangeEvent < "u") {
103
- const t = new HashChangeEvent("hashchange", { oldURL: "", newURL: window.location.href });
104
- this.onRouteChange(t);
105
- } else {
106
- const t = new v("hashchange", { oldURL: "", newURL: window.location.href });
107
- this.onRouteChange(t);
108
- }
109
- }
110
- addRouteChangeListener(t, e) {
111
- r("HashRouter addRouteChangeListener"), this.routeChangeListeners.push([t, e]);
112
- }
113
- navigate(t, e) {
114
- if (r("HashRouter navigate"), e)
115
- return window.history.pushState(null, "", `#${t}`);
116
- window.location.hash = t;
117
- }
118
- setRoute(t) {
119
- r("HashRouter setRoute"), window.location.hash = t;
120
- }
121
- matchRoute(t, e) {
122
- const n = t.split("/"), o = e.split("/");
123
- if (r(`HashRouter matchRoute route=${t} path=${e}`, { routeParts: n, pathParts: o }), n[1] === "" && o[0] === "")
124
- return !0;
125
- if (n.length !== o.length)
126
- return !1;
127
- for (let a = 0; a < n.length; a++) {
128
- const i = n[a], h = o[a];
129
- if (!i.startsWith(":") && i !== h)
130
- return !1;
131
- }
132
- return !0;
133
- }
134
- getRouteParams(t) {
135
- r("HashRouter getRouteParams");
136
- const e = {}, n = t.split("/"), o = window.location.hash.split("/");
137
- return n.forEach((a, i) => {
138
- if (a.startsWith(":")) {
139
- const h = a.substring(1);
140
- e[h] = o[i];
141
- }
142
- }), e;
143
- }
144
- getRouteWithParams(t, e) {
145
- r("HashRouter getRouteWithParams");
146
- let n = t;
147
- return Object.keys(e).forEach((o) => {
148
- n = n.replace(`:${o}`, e[o]);
149
- }), n;
150
- }
151
- getRoute() {
152
- return r("HashRouter getRoute"), window.location.hash;
153
- }
154
- onRouteChange(t) {
155
- this.routeChangeListeners.forEach(async ([e, n]) => {
156
- const o = t.newURL.indexOf("#") === -1 ? "" : t.newURL.substring(t.newURL.indexOf("#") + 1);
157
- if (r(`HashRouter onRouteChange route=${e} path=${o}`, { event: t }), !this.matchRoute(e, o)) {
158
- r(`HashRouter onRouteChange route=${e} path=${o} does not match`);
159
- return;
160
- }
161
- const a = this.getRouteParams(e);
162
- await n(e, o, a);
163
- });
164
- }
165
- getBasePath() {
166
- return r("HashRouter getBasePath"), "";
167
- }
168
- }
169
- function b(s = {}) {
170
- const t = {
171
- isAuthenticated: !1,
172
- tokenInfo: null,
173
- state: "ready",
174
- ...s
175
- }, e = C(t);
176
- return e.reset = () => {
177
- for (const n in t) {
178
- const o = t[n];
179
- e.set(n, o);
180
- }
181
- }, e;
182
- }
183
- const H = ":host{display:contents}", I = H, k = class {
184
- constructor(s) {
185
- g(this, s), this.init = u(this, "init", 7), this.loggedIn = u(this, "loggedIn", 7), this.loggedOut = u(this, "loggedOut", 7), this.handleAuthChange = async (t) => {
186
- t ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host);
187
- }, this.authConfig = void 0, this.eventOverrides = {}, this.automaticComponentRegistration = !0;
188
- }
189
- connectedCallback() {
190
- r("[nylas-provider] connectedCallback");
191
- }
192
- async componentWillLoad() {
193
- var a, i, h, c, l;
194
- r("[nylas-provider] componentWillLoad"), this.stores = {
195
- auth: b(),
196
- scheduler: S(),
197
- schedulerConfig: m()
198
- }, this.baseProvider = new A(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
199
- const s = new L();
200
- this.nylasAuth = R({
201
- apiUri: "https://api.us.nylas.com",
202
- elementsApiUri: "https://elements.us.nylas.com",
203
- storageType: "indexeddb",
204
- clientId: "YOUR_CLIENT_ID",
205
- defaultScopes: [],
206
- redirectURI: "/",
207
- ...this.authConfig
208
- });
209
- const t = (a = this.baseProvider) == null ? void 0 : a.getStore("auth");
210
- if (!t)
211
- throw new Error("The auth store is not set");
212
- const e = (i = this.baseProvider) == null ? void 0 : i.getStore("scheduler");
213
- if (!e)
214
- throw new Error("The scheduler store is not set");
215
- const n = (h = this.baseProvider) == null ? void 0 : h.getStore("schedulerConfig");
216
- if (!n)
217
- throw new Error("The scheduler config store is not set");
218
- this.nylasConnector = new P(s, this.nylasAuth, t, e, n), this.init.emit(this.host).defaultPrevented || await ((c = this.nylasConnector) == null ? void 0 : c.auth.validateSession()), this.handleAuthChange(t.state.isAuthenticated), (l = this.baseProvider) == null || l.componentWillLoad(this.nylasConnector);
219
- }
220
- componentDidLoad() {
221
- var t, e;
222
- const s = (t = this.baseProvider) == null ? void 0 : t.getStore("auth");
223
- s == null || s.onChange("isAuthenticated", this.handleAuthChange), (e = this.baseProvider) == null || e.componentDidLoad();
224
- }
225
- componentDisconnected() {
226
- var s;
227
- (s = this.baseProvider) == null || s.componentDisconnected();
228
- }
229
- async registerComponentHandler(s) {
230
- var t;
231
- (t = this.baseProvider) == null || t.registerComponent(s.detail);
232
- }
233
- async unregisterComponentHandler(s) {
234
- var t;
235
- (t = this.baseProvider) == null || t.unregisterComponent(s.detail);
236
- }
237
- async getNylasAuth() {
238
- return this.nylasAuth;
239
- }
240
- async getNylasConnector() {
241
- return this.nylasConnector;
242
- }
243
- async getAuthStore() {
244
- var s;
245
- return (s = this.baseProvider) == null ? void 0 : s.getStore("auth");
246
- }
247
- async getNylasSchedulerStore() {
248
- var s;
249
- return (s = this.baseProvider) == null ? void 0 : s.getStore("scheduler");
250
- }
251
- async getNylasSchedulerConfigStore() {
252
- var s;
253
- return (s = this.baseProvider) == null ? void 0 : s.getStore("schedulerConfig");
254
- }
255
- render() {
256
- return d(y, { key: "76eef3db651be4914d776517c3b45b4f66ae0d6e" }, d("slot", { key: "fa05da1325ee5c8872fd1f6f21842563d6b4b568" }));
257
- }
258
- get host() {
259
- return f(this);
260
- }
261
- };
262
- k.style = I;
263
- export {
264
- k as nylas_provider
265
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-efb6db79.cjs"),l=require("./index.es-13ff6710-0f748bd2.cjs"),d=require("./scheduler-store-fe9e85a4-baabf78a.cjs"),y=require("./scheduler-config-store-d6729d8d-a0bdda83.cjs");require("react");require("react/jsx-runtime");require("react-dom");class f{constructor(e,t){this.nylasAuth=e,this.nylasAuthStore=t}async validateSession(){const e=await this.isAccessTokenValid();if(!e)this.logout();else{let t=await this.nylasAuth.getTokenInfo();if(t){const r=Math.floor(Date.now()/1e3);if(t.expires_in&&t.expires_in-r<3e5&&(o.debug("[NylasAuthConnectorMixin] Refreshing access token"),t=await this.nylasAuth.refreshAccessToken(),!t)){o.debug("[NylasAuthConnectorMixin] Token is expired and could not be refreshed. Logging out."),this.logout();return}this.nylasAuthStore.state.tokenInfo=t}}this.nylasAuthStore.state.isAuthenticated=e}async isAuthenticated(){return this.nylasAuth.isAuthenticated()}async getTokenInfo(){return this.nylasAuth.getTokenInfo()}async isAccessTokenValid(){return this.nylasAuth.isAccessTokenValid()}async logout(){await this.nylasAuth.logout()}async getHostedAuthRedirectURL(e,t,n){return this.nylasAuth.getHostedAuthRedirectURL(e,t,n)}async manageHostedAuthCodeExchange(e){const n=new URL(e).searchParams.get("code");if(n){const r=await this.nylasAuth.exchangeAuthCodeForTokenInfo(n);if(r)return this.nylasAuthStore.state.tokenInfo=r,this.nylasAuthStore.state.isAuthenticated=!0,r}return null}}class C{constructor(e,t,n,r,i,a="https://api.us.nylas.com"){this.router=e,this.schedulerAPIURL=a,this.nylasAuth=t,this.nylasAuthStore=n,this.nylasSchedulerStore=r,this.nylasSchedulerConfigStore=i}init(){o.debug("NylasConnector init")}get authStore(){return this.nylasAuthStore}get schedulerStore(){return this.nylasSchedulerStore}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new f(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new d.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore}),this._schedulerAPIConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}class A extends Event{constructor(e,t){super(e,t),this.oldURL=t.oldURL,this.newURL=t.newURL}}class R{constructor(){this.routeChangeListeners=[],o.debug("HashRouter constructor")}destroy(){o.debug("HashRouter destroy"),window.removeEventListener("hashchange",this.onRouteChange.bind(this))}init(){if(o.debug("HashRouter init"),window.addEventListener("hashchange",this.onRouteChange.bind(this)),typeof HashChangeEvent<"u"){const e=new HashChangeEvent("hashchange",{oldURL:"",newURL:window.location.href});this.onRouteChange(e)}else{const e=new A("hashchange",{oldURL:"",newURL:window.location.href});this.onRouteChange(e)}}addRouteChangeListener(e,t){o.debug("HashRouter addRouteChangeListener"),this.routeChangeListeners.push([e,t])}navigate(e,t){if(o.debug("HashRouter navigate"),t)return window.history.pushState(null,"",`#${e}`);window.location.hash=e}setRoute(e){o.debug("HashRouter setRoute"),window.location.hash=e}matchRoute(e,t){const n=e.split("/"),r=t.split("/");if(o.debug(`HashRouter matchRoute route=${e} path=${t}`,{routeParts:n,pathParts:r}),n[1]===""&&r[0]==="")return!0;if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const a=n[i],h=r[i];if(!a.startsWith(":")&&a!==h)return!1}return!0}getRouteParams(e){o.debug("HashRouter getRouteParams");const t={},n=e.split("/"),r=window.location.hash.split("/");return n.forEach((i,a)=>{if(i.startsWith(":")){const h=i.substring(1);t[h]=r[a]}}),t}getRouteWithParams(e,t){o.debug("HashRouter getRouteWithParams");let n=e;return Object.keys(t).forEach(r=>{n=n.replace(`:${r}`,t[r])}),n}getRoute(){return o.debug("HashRouter getRoute"),window.location.hash}onRouteChange(e){this.routeChangeListeners.forEach(async([t,n])=>{const r=e.newURL.indexOf("#")===-1?"":e.newURL.substring(e.newURL.indexOf("#")+1);if(o.debug(`HashRouter onRouteChange route=${t} path=${r}`,{event:e}),!this.matchRoute(t,r)){o.debug(`HashRouter onRouteChange route=${t} path=${r} does not match`);return}const i=this.getRouteParams(t);await n(t,r,i)})}getBasePath(){return o.debug("HashRouter getBasePath"),""}}function S(s={}){const e={isAuthenticated:!1,tokenInfo:null,state:"ready",...s},t=o.createStore(e);return t.reset=()=>{for(const n in e){const r=e[n];t.set(n,r)}},t}const b=":host{display:contents}",w=b,g=class{constructor(s){o.registerInstance(this,s),this.init=o.createEvent(this,"init",7),this.loggedIn=o.createEvent(this,"loggedIn",7),this.loggedOut=o.createEvent(this,"loggedOut",7),this.handleAuthChange=async e=>{e?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host)},this.authConfig=void 0,this.eventOverrides={},this.automaticComponentRegistration=!0}connectedCallback(){o.debug("[nylas-provider] connectedCallback")}async componentWillLoad(){var i,a,h,u,c;o.debug("[nylas-provider] componentWillLoad"),this.stores={auth:S(),scheduler:d.CreateNylasSchedulerStore(),schedulerConfig:y.CreateNylasSchedulerConfigStore()},this.baseProvider=new l.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const s=new R;this.nylasAuth=l.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const e=(i=this.baseProvider)==null?void 0:i.getStore("auth");if(!e)throw new Error("The auth store is not set");const t=(a=this.baseProvider)==null?void 0:a.getStore("scheduler");if(!t)throw new Error("The scheduler store is not set");const n=(h=this.baseProvider)==null?void 0:h.getStore("schedulerConfig");if(!n)throw new Error("The scheduler config store is not set");this.nylasConnector=new C(s,this.nylasAuth,e,t,n),this.init.emit(this.host).defaultPrevented||await((u=this.nylasConnector)==null?void 0:u.auth.validateSession()),this.handleAuthChange(e.state.isAuthenticated),(c=this.baseProvider)==null||c.componentWillLoad(this.nylasConnector)}componentDidLoad(){var e,t;const s=(e=this.baseProvider)==null?void 0:e.getStore("auth");s==null||s.onChange("isAuthenticated",this.handleAuthChange),(t=this.baseProvider)==null||t.componentDidLoad()}componentDisconnected(){var s;(s=this.baseProvider)==null||s.componentDisconnected()}async registerComponentHandler(s){var e;(e=this.baseProvider)==null||e.registerComponent(s.detail)}async unregisterComponentHandler(s){var e;(e=this.baseProvider)==null||e.unregisterComponent(s.detail)}async getNylasAuth(){return this.nylasAuth}async getNylasConnector(){return this.nylasConnector}async getAuthStore(){var s;return(s=this.baseProvider)==null?void 0:s.getStore("auth")}async getNylasSchedulerStore(){var s;return(s=this.baseProvider)==null?void 0:s.getStore("scheduler")}async getNylasSchedulerConfigStore(){var s;return(s=this.baseProvider)==null?void 0:s.getStore("schedulerConfig")}render(){return o.h(o.Host,{key:"76eef3db651be4914d776517c3b45b4f66ae0d6e"},o.h("slot",{key:"fa05da1325ee5c8872fd1f6f21842563d6b4b568"}))}get host(){return o.getElement(this)}};g.style=w;exports.nylas_provider=g;