@nylas/react 1.4.0 → 1.4.1
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.
- package/dist/{add-circle-icon_2.entry-6e8e4e1e.cjs → add-circle-icon_2.entry-04909861.cjs} +1 -1
- package/dist/{add-circle-icon_2.entry-dbad9a3b.js → add-circle-icon_2.entry-0d9ba871.js} +1 -1
- package/dist/{archive-icon.entry-802f7877.js → archive-icon.entry-3d6d9d3f.js} +1 -1
- package/dist/{archive-icon.entry-21f532af.cjs → archive-icon.entry-88459432.cjs} +1 -1
- package/dist/{arrow-icon.entry-e3dec626.js → arrow-icon.entry-789ee889.js} +1 -1
- package/dist/{arrow-icon.entry-e9af732a.cjs → arrow-icon.entry-c35e1933.cjs} +1 -1
- package/dist/{bold-icon.entry-1a2be28a.cjs → bold-icon.entry-827e95bf.cjs} +1 -1
- package/dist/{bold-icon.entry-0492ff02.js → bold-icon.entry-fbb382d2.js} +1 -1
- package/dist/{button-component_2.entry-fea9bd3d.js → button-component_2.entry-6c012ee4.js} +8 -8
- package/dist/{button-component_2.entry-f0c7f894.cjs → button-component_2.entry-acd13f45.cjs} +1 -1
- package/dist/{calendar-agenda-fill-icon_36.entry-c85d6a79.js → calendar-agenda-fill-icon_36.entry-1bb3b1a8.js} +509 -462
- package/dist/calendar-agenda-fill-icon_36.entry-fa8121df.cjs +6 -0
- package/dist/{calendar-cancel-icon.entry-237b8c9e.cjs → calendar-cancel-icon.entry-2e97f7d8.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-e7dd5b8f.js → calendar-cancel-icon.entry-a4d040db.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-c7f47fc8.js → calendar-check-icon_2.entry-a48a358d.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-a868e0bc.cjs → calendar-check-icon_2.entry-bca4821d.cjs} +1 -1
- package/dist/{calendar-icon.entry-324de624.js → calendar-icon.entry-57727659.js} +1 -1
- package/dist/{calendar-icon.entry-071eb30d.cjs → calendar-icon.entry-a289313a.cjs} +1 -1
- package/dist/{checkbox-component.entry-5bcf4b08.cjs → checkbox-component.entry-af3e7005.cjs} +1 -1
- package/dist/{checkbox-component.entry-0f9970cc.js → checkbox-component.entry-f4f98226.js} +1 -1
- package/dist/{checkmark-icon_15.entry-7776e533.cjs → checkmark-icon_15.entry-dace1b62.cjs} +2 -2
- package/dist/{checkmark-icon_15.entry-98377585.js → checkmark-icon_15.entry-f43549b3.js} +7 -7
- package/dist/{chevron-icon_3.entry-526b4b85.cjs → chevron-icon_3.entry-219b42e6.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-ec66260c.js → chevron-icon_3.entry-25533d13.js} +5 -5
- package/dist/{clock-icon_4.entry-66d15f7c.cjs → clock-icon_4.entry-3917c667.cjs} +1 -1
- package/dist/{clock-icon_4.entry-4fa47996.js → clock-icon_4.entry-76f29f7e.js} +1 -1
- package/dist/{constants-f5ba52b9-40ab2ded.js → constants-3d8016e3-3c080f00.js} +17 -28
- package/dist/constants-3d8016e3-fd6c3848.cjs +1 -0
- package/dist/{customParseFormat-39eacb44-eeffe2bb.js → customParseFormat-6c652dbb-8a42d5b0.js} +1 -1
- package/dist/{customParseFormat-39eacb44-45ade322.cjs → customParseFormat-6c652dbb-ba81ab97.cjs} +1 -1
- package/dist/{delete-icon.entry-95d01eb8.js → delete-icon.entry-3b61864e.js} +1 -1
- package/dist/{delete-icon.entry-540aa2bb.cjs → delete-icon.entry-96420b21.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-b82d5da8.js → document-refresh-icon.entry-7333b7c9.js} +1 -1
- package/dist/{document-refresh-icon.entry-c467f082.cjs → document-refresh-icon.entry-8b5c6b9b.cjs} +1 -1
- package/dist/{feedbackSync-47d13bb0-5608d680.js → feedbackSync-352aaf4a-b2b83cfa.js} +1 -1
- package/dist/{feedbackSync-47d13bb0-9f249f33.cjs → feedbackSync-352aaf4a-ba1bf452.cjs} +1 -1
- package/dist/{folder-icon.entry-cb0dc63d.js → folder-icon.entry-bb5e2452.js} +1 -1
- package/dist/{folder-icon.entry-4d48c2ee.cjs → folder-icon.entry-d2e46d3a.cjs} +1 -1
- package/dist/{forward-icon.entry-d04aaf6d.cjs → forward-icon.entry-1fcf5a6b.cjs} +1 -1
- package/dist/{forward-icon.entry-5aa01f53.js → forward-icon.entry-af8d2147.js} +1 -1
- package/dist/{globe-icon_2.entry-87e29cdf.cjs → globe-icon_2.entry-b4b55760.cjs} +1 -1
- package/dist/{globe-icon_2.entry-c7ae78cc.js → globe-icon_2.entry-cc6d9d67.js} +3 -3
- package/dist/{google-logo-icon_6.entry-80a6bfa3.js → google-logo-icon_6.entry-aa7b5b42.js} +314 -287
- package/dist/google-logo-icon_6.entry-eefdec63.cjs +2 -0
- package/dist/{google-meet-icon_5.entry-4e71c83b.js → google-meet-icon_5.entry-9758e527.js} +1 -1
- package/dist/{google-meet-icon_5.entry-26d667b6.cjs → google-meet-icon_5.entry-c545537a.cjs} +1 -1
- package/dist/{inbox-icon.entry-60a82bfc.cjs → inbox-icon.entry-b9640d5a.cjs} +1 -1
- package/dist/{inbox-icon.entry-77e4e17b.js → inbox-icon.entry-c005ebc5.js} +1 -1
- package/dist/index-05630f15.cjs +57 -0
- package/dist/{index-04630615.js → index-78390f2e.js} +114 -87
- package/dist/{index.es-1fdb1e36-fbdb04fa.js → index.es-4a203e8e-cf485db5.js} +1 -1
- package/dist/{index.es-1fdb1e36-830a422f.cjs → index.es-4a203e8e-f668b8c2.cjs} +1 -1
- package/dist/{info-icon_2.entry-3c483f61.js → info-icon_2.entry-b17298b6.js} +1 -1
- package/dist/{info-icon_2.entry-34800b66.cjs → info-icon_2.entry-ecbc6605.cjs} +1 -1
- package/dist/{input-component.entry-f7ccf3d6.cjs → input-component.entry-24366ab8.cjs} +1 -1
- package/dist/{input-component.entry-ea4016fe.js → input-component.entry-9da5da6c.js} +1 -1
- package/dist/{input-dropdown_2.entry-d4024d2f.cjs → input-dropdown_2.entry-0109b06c.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-c7730cf8.js → input-dropdown_2.entry-d65f7152.js} +4 -4
- package/dist/{italic-icon.entry-8127c2ee.cjs → italic-icon.entry-afa4332a.cjs} +1 -1
- package/dist/{italic-icon.entry-6e0805ab.js → italic-icon.entry-d0a536f2.js} +1 -1
- package/dist/{multi-select-dropdown_2.entry-49d6f0e7.cjs → multi-select-dropdown_2.entry-2c7a1a06.cjs} +1 -1
- package/dist/{multi-select-dropdown_2.entry-d749999d.js → multi-select-dropdown_2.entry-c56b5fd2.js} +2 -2
- package/dist/{notebook-store-b61693cd-7a5576e7.js → notebook-store-b61693cd-0877e7a2.js} +1 -1
- package/dist/{notebook-store-b61693cd-84de36d2.cjs → notebook-store-b61693cd-a7b8ae37.cjs} +1 -1
- package/dist/nylas-booked-event-card_12.entry-827c7fb4.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-3fcfd6f9.js → nylas-booked-event-card_12.entry-960fdfe2.js} +347 -343
- package/dist/{nylas-call-summary.entry-38aed89a.js → nylas-call-summary.entry-1cce1446.js} +1 -1
- package/dist/{nylas-call-summary.entry-e9adcb93.cjs → nylas-call-summary.entry-f10f3c54.cjs} +1 -1
- package/dist/{nylas-event-calendar_3.entry-62d1f1f5.js → nylas-event-calendar_3.entry-8bb08ed3.js} +35 -23
- package/dist/{nylas-event-calendar_3.entry-48f656e5.cjs → nylas-event-calendar_3.entry-b656237b.cjs} +2 -2
- package/dist/{nylas-form-card.entry-b900b46e.cjs → nylas-form-card.entry-62578338.cjs} +1 -1
- package/dist/{nylas-form-card.entry-3828ccb1.js → nylas-form-card.entry-7455b8f1.js} +2 -2
- package/dist/{nylas-if-state.entry-92af0a51.cjs → nylas-if-state.entry-0897dc70.cjs} +1 -1
- package/dist/{nylas-if-state.entry-2810dcf5.js → nylas-if-state.entry-7fa6d392.js} +2 -2
- package/dist/{nylas-key-points.entry-977a6fae.js → nylas-key-points.entry-449e1be0.js} +3 -3
- package/dist/{nylas-key-points.entry-de658637.cjs → nylas-key-points.entry-693f33a1.cjs} +1 -1
- package/dist/{nylas-login.entry-4a6c11e6.cjs → nylas-login.entry-36544dc8.cjs} +1 -1
- package/dist/{nylas-login.entry-8101d3d0.js → nylas-login.entry-d7082306.js} +2 -2
- package/dist/{nylas-provider.entry-c054d68a.js → nylas-provider.entry-a0e7ce4d.js} +5 -5
- package/dist/{nylas-provider.entry-b7ac25f5.cjs → nylas-provider.entry-b93d2a62.cjs} +1 -1
- package/dist/nylas-scheduler-editor.entry-332d27e0.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-e35fad5c.js → nylas-scheduler-editor.entry-78fe5abf.js} +20 -20
- package/dist/nylas-scheduling.entry-1d80c349.cjs +1 -0
- package/dist/{nylas-scheduling.entry-360b978c.js → nylas-scheduling.entry-fa9ff55b.js} +33 -33
- package/dist/{nylas-transcript.entry-4d973027.cjs → nylas-transcript.entry-570d3abe.cjs} +3 -3
- package/dist/{nylas-transcript.entry-81e2c821.js → nylas-transcript.entry-b129565c.js} +24 -24
- package/dist/nylas-video-player.entry-9c7c9792.cjs +1 -0
- package/dist/nylas-video-player.entry-e208d443.js +39 -0
- package/dist/{nylas-video-preview.entry-320421b6.js → nylas-video-preview.entry-a3f542ad.js} +1 -1
- package/dist/{nylas-video-preview.entry-12e05e4d.cjs → nylas-video-preview.entry-bd9bdda7.cjs} +1 -1
- package/dist/{person-icon.entry-8533209c.js → person-icon.entry-82fbc43e.js} +1 -1
- package/dist/{person-icon.entry-967ad730.cjs → person-icon.entry-e4d11400.cjs} +1 -1
- package/dist/{play-icon.entry-15ee8568.js → play-icon.entry-68bc660a.js} +1 -1
- package/dist/{play-icon.entry-7b1fd79d.cjs → play-icon.entry-9cab598b.cjs} +1 -1
- package/dist/{radio-button-group.entry-24cb342f.cjs → radio-button-group.entry-6a2adf11.cjs} +1 -1
- package/dist/{radio-button-group.entry-53dcf16c.js → radio-button-group.entry-f7679911.js} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/{refresh-icon.entry-0486ae54.cjs → refresh-icon.entry-0f1e5f20.cjs} +1 -1
- package/dist/{refresh-icon.entry-f3320971.js → refresh-icon.entry-394b0814.js} +1 -1
- package/dist/{register-component-504a1cbb-89124fd8.cjs → register-component-1027b769-62812558.cjs} +1 -1
- package/dist/{register-component-504a1cbb-5f986d7f.js → register-component-1027b769-dd21b16d.js} +1 -1
- package/dist/{reply-all-icon.entry-006fd1fb.js → reply-all-icon.entry-0fad8f2f.js} +1 -1
- package/dist/{reply-all-icon.entry-2cea1a40.cjs → reply-all-icon.entry-1680f1e5.cjs} +1 -1
- package/dist/{reply-icon.entry-d27166a1.js → reply-icon.entry-5f4b7837.js} +1 -1
- package/dist/{reply-icon.entry-bd252aed.cjs → reply-icon.entry-77342442.cjs} +1 -1
- package/dist/{scheduler-config-store-d6729d8d-4a2defea.cjs → scheduler-config-store-d6729d8d-06a3a314.cjs} +1 -1
- package/dist/{scheduler-config-store-d6729d8d-63e34849.js → scheduler-config-store-d6729d8d-854b5da8.js} +1 -1
- package/dist/scheduler-store-f3e2a26f-7cee436f.cjs +1 -0
- package/dist/{scheduler-store-baf100ed-81b183dc.js → scheduler-store-f3e2a26f-85df53f7.js} +60 -60
- package/dist/{sent-icon.entry-ee434395.cjs → sent-icon.entry-20a8945d.cjs} +1 -1
- package/dist/{sent-icon.entry-bf101068.js → sent-icon.entry-2d122865.js} +1 -1
- package/dist/{spam-icon.entry-11016b63.cjs → spam-icon.entry-86178cc5.cjs} +1 -1
- package/dist/{spam-icon.entry-5193f9c6.js → spam-icon.entry-9e374d44.js} +1 -1
- package/dist/{star-icon.entry-0e269252.cjs → star-icon.entry-1b94c861.cjs} +1 -1
- package/dist/{star-icon.entry-9c7449f3.js → star-icon.entry-bb1b517d.js} +1 -1
- package/dist/{stop-icon.entry-86412c9f.cjs → stop-icon.entry-7b21833b.cjs} +1 -1
- package/dist/{stop-icon.entry-2ac11166.js → stop-icon.entry-e4d3526d.js} +1 -1
- package/dist/{textarea-component.entry-9df3fa96.js → textarea-component.entry-ba3c9311.js} +1 -1
- package/dist/{textarea-component.entry-27717409.cjs → textarea-component.entry-fdba933d.cjs} +1 -1
- package/dist/{toggle-switch.entry-a5ddfad9.js → toggle-switch.entry-4a980d1d.js} +1 -1
- package/dist/{toggle-switch.entry-9623e2b2.cjs → toggle-switch.entry-9142a3d3.cjs} +1 -1
- package/dist/{translate-icon.entry-f22293e6.js → translate-icon.entry-1657aa04.js} +1 -1
- package/dist/{translate-icon.entry-e0617680.cjs → translate-icon.entry-b4908cf3.cjs} +1 -1
- package/dist/{trash-fill-icon.entry-0275f657.cjs → trash-fill-icon.entry-a6791185.cjs} +1 -1
- package/dist/{trash-fill-icon.entry-2616c5df.js → trash-fill-icon.entry-c9e1769e.js} +1 -1
- package/dist/{underline-icon.entry-1110dcb1.js → underline-icon.entry-1ba4d923.js} +1 -1
- package/dist/{underline-icon.entry-d54b06ab.cjs → underline-icon.entry-d1f91e63.cjs} +1 -1
- package/dist/{warning-icon.entry-6d390ab7.cjs → warning-icon.entry-b1480f57.cjs} +1 -1
- package/dist/{warning-icon.entry-9a6e7913.js → warning-icon.entry-fe155c15.js} +1 -1
- package/package.json +4 -4
- package/dist/calendar-agenda-fill-icon_36.entry-70681da2.cjs +0 -6
- package/dist/constants-f5ba52b9-a0866d2f.cjs +0 -1
- package/dist/google-logo-icon_6.entry-a8b6efc0.cjs +0 -2
- package/dist/index-3d1f13d6.cjs +0 -57
- package/dist/nylas-booked-event-card_12.entry-29337b10.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-1538950d.cjs +0 -2
- package/dist/nylas-scheduling.entry-92351cd2.cjs +0 -1
- package/dist/nylas-video-player.entry-60268c07.js +0 -39
- package/dist/nylas-video-player.entry-f3c2b073.cjs +0 -1
- package/dist/scheduler-store-baf100ed-5c5d3aa5.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-05630f15.cjs"),f=require("./register-component-1027b769-62812558.cjs");require("react");require("react/jsx-runtime");require("react-dom");const b=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-form-card{width:100%;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-form-card__header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}',i=b;var u=function(l,a,o,n){var s=arguments.length,r=s<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(l,a,o,n);else for(var y=l.length-1;y>=0;y--)(c=l[y])&&(r=(s<3?c(r):s>3?c(a,o,r):c(a,o))||r);return s>3&&r&&Object.defineProperty(a,o,r),r},t=function(l,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(l,a)};const d=class{constructor(l){e.registerInstance(this,l),l.$hostElement$["s-ei"]?this.internals=l.$hostElement$["s-ei"]:(this.internals=l.$hostElement$.attachInternals(),l.$hostElement$["s-ei"]=this.internals)}connectedCallback(){e.debug("nylas-event-card","connectedCallback")}componentWillLoad(){e.debug("nylas-event-card","componentWillLoad")}componentDidLoad(){e.debug("nylas-event-card","componentDidLoad")}disconnectedCallback(){e.debug("nylas-event-card","disconnectedCallback");const l=["header-title","header-subtitle","content"];e.checkForMissingSlots(l,this.host)}render(){return e.h(e.Host,{key:"1bf7def778f8d26174861d5253a87b30978175e4"},e.h("div",{key:"77b6e4b2ffcde3640add3574e6f9211f787b20a0",class:"nylas-form-card",part:"nfc"},e.h("div",{key:"96451ec57814367e5e2b1941749241a2f72529a6",class:"nylas-form-card__header",part:"nfc__header"},e.h("slot",{key:"ea00a893f4d4dca93d007cac452c20dbaeb343d8",name:"header-title"}),e.h("slot",{key:"1a3456b5df4131ba56903131ac099b62c0008ef3",name:"header-subtitle"})),e.h("div",{key:"65bc9cc821c69e797074781d1dd16fd4e2911b15",class:"nylas-form-card__content"},e.h("slot",{key:"3e4821b0592ec46a3ada782ab114e8707647eb09",name:"content"}))))}static get formAssociated(){return!0}get host(){return e.getElement(this)}};u([f.RegisterComponent({name:"nylas-form-card",eventToProps:{},fireRegisterEvent:!0}),t("design:type",Function),t("design:paramtypes",[]),t("design:returntype",void 0)],d.prototype,"render",null);d.style=i;exports.nylas_form_card=d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as b, d as y, P as i, h as o, H as p, g as m } from "./index-
|
|
2
|
-
import { R as u } from "./register-component-
|
|
1
|
+
import { r as b, d as y, P as i, h as o, H as p, g as m } from "./index-78390f2e.js";
|
|
2
|
+
import { R as u } from "./register-component-1027b769-dd21b16d.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react-dom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-05630f15.cjs"),u=require("./register-component-1027b769-62812558.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,5 +1,5 @@
|
|
|
1
|
-
import { r as h, d as o, h as l, H as u } from "./index-
|
|
2
|
-
import { R as m } from "./register-component-
|
|
1
|
+
import { r as h, d as o, h as l, H as u } from "./index-78390f2e.js";
|
|
2
|
+
import { R as m } from "./register-component-1027b769-dd21b16d.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react-dom";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as o, h as i } from "./index-
|
|
2
|
-
import { v as r } from "./notebook-store-b61693cd-
|
|
1
|
+
import { r as o, h as i } from "./index-78390f2e.js";
|
|
2
|
+
import { v as r } from "./notebook-store-b61693cd-0877e7a2.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react-dom";
|
|
@@ -20,7 +20,7 @@ const d = class {
|
|
|
20
20
|
}));
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return i("div", { key: "
|
|
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
24
|
}
|
|
25
25
|
};
|
|
26
26
|
d.style = c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-05630f15.cjs"),r=require("./notebook-store-b61693cd-a7b8ae37.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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-05630f15.cjs"),h=require("./register-component-1027b769-62812558.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,5 +1,5 @@
|
|
|
1
|
-
import { r as h, c as p, h as o, H as u } from "./index-
|
|
2
|
-
import { R as m } from "./register-component-
|
|
1
|
+
import { r as h, c as p, h as o, H as u } from "./index-78390f2e.js";
|
|
2
|
+
import { R as m } from "./register-component-1027b769-dd21b16d.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react-dom";
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
2
|
-
import { N as A, e as R } from "./index.es-
|
|
3
|
-
import { C as S, N as p } from "./scheduler-store-
|
|
4
|
-
import { C as m } from "./scheduler-config-store-d6729d8d-
|
|
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-78390f2e.js";
|
|
2
|
+
import { N as A, e as R } from "./index.es-4a203e8e-cf485db5.js";
|
|
3
|
+
import { C as S, N as p } from "./scheduler-store-f3e2a26f-85df53f7.js";
|
|
4
|
+
import { C as m } from "./scheduler-config-store-d6729d8d-854b5da8.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "react-dom";
|
|
@@ -253,7 +253,7 @@ const H = ":host{display:contents}", I = H, k = class {
|
|
|
253
253
|
return (s = this.baseProvider) == null ? void 0 : s.getStore("schedulerConfig");
|
|
254
254
|
}
|
|
255
255
|
render() {
|
|
256
|
-
return d(y, { key: "
|
|
256
|
+
return d(y, { key: "76eef3db651be4914d776517c3b45b4f66ae0d6e" }, d("slot", { key: "fa05da1325ee5c8872fd1f6f21842563d6b4b568" }));
|
|
257
257
|
}
|
|
258
258
|
get host() {
|
|
259
259
|
return f(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-05630f15.cjs"),l=require("./index.es-4a203e8e-f668b8c2.cjs"),d=require("./scheduler-store-f3e2a26f-7cee436f.cjs"),y=require("./scheduler-config-store-d6729d8d-06a3a314.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;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var we=Object.defineProperty;var Se=(r,t,n)=>t in r?we(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var I=(r,t,n)=>(Se(r,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const index=require("./index-05630f15.cjs"),index_es4a203e8e=require("./index.es-4a203e8e-f668b8c2.cjs"),schedulerConfigStoreD6729d8d=require("./scheduler-config-store-d6729d8d-06a3a314.cjs"),constants3d8016e3=require("./constants-3d8016e3-fd6c3848.cjs");require("react");require("react/jsx-runtime");require("react-dom");index.dayjs.extend(index.utc);index.dayjs.extend(index.timezone);class NylasSchedulerConfigAPIConnector{constructor({nylasApiRequest:t,nylasSchedulerConfigStore:n}){this.nylasApiRequest=t,this.nylasSchedulerConfigStore=n}async currentUser(){return this.nylasApiRequest?this.nylasApiRequest.currentUser():(console.warn("Nylas API Request is not initialized"),null)}async getCalendars(){var s;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching calendars: Nylas API Request is not initialized"});const[t,n]=await this.nylasApiRequest.request({method:"GET",path:"calendars"});return n?index.dataResponse(null,{message:"Error fetching calendars: "+n.message}):index_es4a203e8e.Xr(t)?index.dataResponse(null,{message:"Error fetching calendars: "+((s=t.error)==null?void 0:s.message)}):(this.nylasSchedulerConfigStore.state.calendars=t.data,index.dataResponse(t.data))}async getConfigurationById(t,n=!1){var d;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching configuration: Nylas API Request is not initialized"});if(!n){const c=this.nylasSchedulerConfigStore.state.configurations.find(l=>l.id===t);if(c)return this.nylasSchedulerConfigStore.state.selectedConfiguration=c,index.dataResponse(c)}const[s,a]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${t}`});return a?index.dataResponse(null,{message:"Error fetching configuration: "+a.message}):index_es4a203e8e.Xr(s)?index.dataResponse(null,{message:"Error fetching configuration: "+((d=s.error)==null?void 0:d.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=s.data,this.nylasSchedulerConfigStore.state.configurations.find(c=>c.id===t)?this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map(c=>c.id===t?s.data:c):this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,s.data],index.dataResponse(s.data))}async getConfigurations(t){var d;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching configurations: Nylas API Request is not initialized"});const n=50,[s,a]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations?limit=${n}${t?`&page_token=${t}`:""}`});return a?index.dataResponse(null,{message:"Error fetching configurations: "+a.message}):index_es4a203e8e.Xr(s)?index.dataResponse(null,{message:"Error fetching configurations: "+((d=s.error)==null?void 0:d.message)}):(this.nylasSchedulerConfigStore.state.configurations=s.data,this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor=s.next_cursor||null,index.dataResponse(s.data))}async getMasterEventById(t){var h,u;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching master event: Nylas API Request is not initialized"});const n=this.nylasSchedulerConfigStore.state.selectedGroupEvent,s=(h=n==null?void 0:n.event)==null?void 0:h.calendar_id;if(!s)return console.warn("Calendar ID is not present"),index.dataResponse(null,{message:"Error fetching master event: Calendar ID is not present"});const a=new URLSearchParams;a.append("calendar_id",s);const[d,c]=await this.nylasApiRequest.request({method:"GET",path:`events/${t}?${a.toString()}`});if(c)return index.dataResponse(null,{message:"Error fetching master event: "+c.message});if(index_es4a203e8e.Xr(d))return index.dataResponse(null,{message:"Error fetching master event: "+((u=d.error)==null?void 0:u.message)});const l=this.nylasSchedulerConfigStore.state.masterGroupEvents;return l[t]?this.nylasSchedulerConfigStore.state.masterGroupEvents[t]=d.data:this.nylasSchedulerConfigStore.state.masterGroupEvents={...l,[t]:d.data},index.dataResponse(d.data)}async createConfiguration(t){var a;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error creating configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"POST",path:"scheduling/configurations",body:t});return s?index.dataResponse(null,{message:"Error creating configuration: "+s.message}):index_es4a203e8e.Xr(n)?index.dataResponse(null,{message:"Error creating configuration: "+((a=n.error)==null?void 0:a.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data,this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data],index.dataResponse(n.data))}async updateConfiguration(t){var a;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error updating configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"PUT",path:`scheduling/configurations/${t.id}`,body:t});return s?index.dataResponse(null,{message:"Error updating configuration: "+s.message}):index_es4a203e8e.Xr(n)?index.dataResponse(null,{message:"Error updating configuration: "+((a=n.error)==null?void 0:a.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data,this.nylasSchedulerConfigStore.state.configurations.find(d=>d.id===t.id)?this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map(d=>d.id===t.id?n.data:d):this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data],index.dataResponse(n.data))}async deleteConfiguration(t){var a,d;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error deleting configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${t}`});return s?index.dataResponse(null,{message:"Error deleting configuration: "+s.message}):index_es4a203e8e.Xr(n)?index.dataResponse(null,{message:"Error deleting configuration: "+((a=n.error)==null?void 0:a.message)}):(this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.filter(c=>c.id!==t),((d=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:d.id)===t&&this.nylasSchedulerConfigStore.resetSelectedConfiguration(),index.dataResponse(n.data))}async createGroupEvent(t,n){var d;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error creating group event: Nylas API Request is not initialized"});const[s,a]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${n}/group-events`,body:t});return a?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error creating group event: "+a.message})):index_es4a203e8e.Xr(s)?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error creating group event: "+((d=s.error)==null?void 0:d.message)})):(this.nylasSchedulerConfigStore.state.selectedGroupEvent=s.data,await this.getGroupEvents(n),this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(s.data))}async getGroupEvents(t){var l,h,u;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching group events: Nylas API Request is not initialized"});const n=new URLSearchParams;n.append("show_all","true");const s=this.nylasSchedulerConfigStore.state.calendarViewDateRange;if(s)n.append("start_time",s.start_time),n.append("end_time",s.end_time);else{const{startTime:g,endTime:f}=index.getCalendarRange(new Date().toISOString(),"week");n.append("start_time",g.toString()),n.append("end_time",f.toString())}const a=(h=(l=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:l.group_booking)==null?void 0:h.calendar_id;a&&n.append("calendar_id",a);const[d,c]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${t}/group-events?${n.toString()}`});return c?index.dataResponse(null,{message:"Error fetching group events: "+c.message}):index_es4a203e8e.Xr(d)?index.dataResponse(null,{message:"Error fetching group events: "+((u=d.error)==null?void 0:u.message)}):(this.nylasSchedulerConfigStore.state.groupEvents=d.data,index.dataResponse(d.data))}async updateGroupEventById(t,n){var c;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error updating group event: Nylas API Request is not initialized"});const s=t.id;delete t.id;const[a,d]=await this.nylasApiRequest.request({method:"PATCH",path:`scheduling/configurations/${n}/group-events/${s}`,body:t});return d?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error updating group event: "+d.message})):index_es4a203e8e.Xr(a)?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error updating group event: "+((c=a.error)==null?void 0:c.message)})):(this.nylasSchedulerConfigStore.state.selectedGroupEvent=a.data,await this.getGroupEvents(n),this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(a.data))}async updateGroupEvent(t,n,s){var f,y,p,m,S,b,v,R,T,O,P,N,k,A;this.nylasSchedulerConfigStore.state.isLoading=!0;const a=this.nylasSchedulerConfigStore.state.selectedGroupEvent,d=(f=a==null?void 0:a.event)==null?void 0:f.master_event_id,c=(y=a==null?void 0:a.event)==null?void 0:y.id,l=(m=(p=a==null?void 0:a.event)==null?void 0:p.when)==null?void 0:m.start_time,h=(b=(S=a==null?void 0:a.group_event_info)==null?void 0:S.rrule)==null?void 0:b[0],u=h?h.split(";").filter(x=>!x.startsWith("UNTIL")).join(";"):"",g=l?index.dayjs(l*1e3).subtract(1,"minute").format("YYYYMMDDTHHmmss[Z]"):"";if(n==="this")return this.updateGroupEventById({...t,id:c,recurrence:d?void 0:t.recurrence},s);if(n==="future"&&d){const x=await this.createGroupEvent(t,s),_={location:(v=a==null?void 0:a.event)==null?void 0:v.location,conferencing:(R=a==null?void 0:a.event)==null?void 0:R.conferencing,title:(T=a==null?void 0:a.event)==null?void 0:T.title,description:(O=a==null?void 0:a.event)==null?void 0:O.description,capacity:(P=a==null?void 0:a.group_event_info)==null?void 0:P.capacity,calendar_id:(N=a==null?void 0:a.event)==null?void 0:N.calendar_id,recurrence:u?[u+";UNTIL="+g]:[`RRULE:FREQ=DAILY;UNTIL=${g}`]};return await this.updateGroupEventById({..._,id:d},s),[_,x]}else if(n==="all"){const x=t==null?void 0:t.when,_=(k=a==null?void 0:a.event)==null?void 0:k.when,U=(A=this.nylasSchedulerConfigStore.state.masterGroupEvents)==null?void 0:A[d];let w=U==null?void 0:U.when;return(x==null?void 0:x.start_time)!==(_==null?void 0:_.start_time)&&(w={...w,start_time:(x==null?void 0:x.start_time)||(w==null?void 0:w.start_time)}),(x==null?void 0:x.end_time)!==(_==null?void 0:_.end_time)&&(w={...w,end_time:(x==null?void 0:x.end_time)||(w==null?void 0:w.end_time)}),(x==null?void 0:x.start_timezone)!==(_==null?void 0:_.start_timezone)&&(w={...w,start_timezone:(x==null?void 0:x.start_timezone)||(w==null?void 0:w.start_timezone)}),(x==null?void 0:x.end_timezone)!==(_==null?void 0:_.end_timezone)&&(w={...w,end_timezone:(x==null?void 0:x.end_timezone)||(w==null?void 0:w.end_timezone)}),this.updateGroupEventById({...t,when:w,id:d},s)}throw this.nylasSchedulerConfigStore.state.isLoading=!1,new Error("Invalid option")}async deleteGroupEvent(t,n,s){var y,p,m,S,b,v,R,T,O,P,N,k;this.nylasSchedulerConfigStore.state.isLoading=!0;const a=this.nylasSchedulerConfigStore.state.selectedGroupEvent,d=(y=a==null?void 0:a.event)==null?void 0:y.master_event_id,c=(p=a==null?void 0:a.event)==null?void 0:p.id,l=(S=(m=a==null?void 0:a.event)==null?void 0:m.when)==null?void 0:S.start_time,h=(v=(b=a==null?void 0:a.group_event_info)==null?void 0:b.rrule)==null?void 0:v[0],u=h?h.split(";").filter(A=>!A.startsWith("UNTIL")).join(";"):"",g=l?index.dayjs(l*1e3).format("YYYYMMDDTHHmmss[Z]"):"",f={location:(R=a==null?void 0:a.event)==null?void 0:R.location,conferencing:(T=a==null?void 0:a.event)==null?void 0:T.conferencing,title:(O=a==null?void 0:a.event)==null?void 0:O.title,description:(P=a==null?void 0:a.event)==null?void 0:P.description,capacity:(N=a==null?void 0:a.group_event_info)==null?void 0:N.capacity,calendar_id:(k=a==null?void 0:a.event)==null?void 0:k.calendar_id,recurrence:u?[u+";UNTIL="+g]:[`RRULE:UNTIL=${g}`]};if(n==="this"&&c)return this.deleteGroupEventById(c,s);if(n==="future"&&d&&c)return await this.deleteGroupEventById(c,s),await this.updateGroupEventById({...f,id:d},s);if(n==="all"&&d)return this.deleteGroupEventById(d,s);throw this.nylasSchedulerConfigStore.state.isLoading=!1,new Error("Invalid option")}async deleteGroupEventById(t,n){var l,h,u;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error deleting group event: Nylas API Request is not initialized"});const s=new URLSearchParams,a=(h=(l=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:l.group_booking)==null?void 0:h.calendar_id;a&&s.append("calendar_id",a);const[d,c]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${n}/group-events/${t}?calendar_id=${a}`});return c?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error deleting group event: "+c.message})):index_es4a203e8e.Xr(d)?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error deleting group event: "+((u=d.error)==null?void 0:u.message)})):(await this.getGroupEvents(n),this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(d.data))}async importGroupEvent(t,n){var l,h,u,g,f;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error importing group event: Nylas API Request is not initialized"});const s=new URLSearchParams,a=(h=(l=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:l.group_booking)==null?void 0:h.calendar_id;a&&s.append("calendar_id",a);const[d,c]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${n}/import-group-events?${s.toString()}`,body:t});return c?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error importing group event: "+c.message})):index_es4a203e8e.Xr(d)?(this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(null,{message:"Error importing group event: "+((u=d.error)==null?void 0:u.message)})):(((f=(g=d.data)==null?void 0:g.imported_events)==null?void 0:f.length)>0&&await this.getGroupEvents(n),this.nylasSchedulerConfigStore.state.isLoading=!1,index.dataResponse(d.data))}}class NylasSchedulerConfigConnector{constructor({nylasApiRequest:t,nylasSchedulerConfigStore:n}){this.nylasApiRequest=t,this.nylasSchedulerConfigStore=n}init(){index.debug("NylasSchedulerConfigConnector init")}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get schedulerConfig(){return this._schedulerConfigConnector?this._schedulerConfigConnector:(this._schedulerConfigConnector=new NylasSchedulerConfigAPIConnector({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore}),this._schedulerConfigConnector)}resetStores(){index.debug("NylasSchedulerConfigConnector resetStores"),this.nylasSchedulerConfigStore.reset()}async logout(){index.debug("NylasSchedulerConfigConnector logout"),this.resetStores()}}class LocalStorage{get(t){return new Promise(n=>{const s=window.localStorage.getItem(t);n(s?JSON.parse(s):null)})}async remove(t){return window.localStorage.removeItem(t),new Promise(n=>{n(null)})}set(t,n){return window.localStorage.setItem(t,JSON.stringify(n)),new Promise(s=>{s(null)})}}const PKCE_KEY="pkce",GRANT_KEY="grant",USER_KEY="user";class Storage{constructor(t){I(this,"Storage",new LocalStorage);if(t){this.Storage=t;return}}setPKCE(t){const n=index.Buffer.from(t);this.Storage.set(PKCE_KEY,n.toString("base64"))}async getPKCE(){try{const t=await this.Storage.get(PKCE_KEY);if(t)return index.Buffer.from(t,"base64").toString("utf8")}catch{return null}return null}removePKCE(){this.Storage.remove(PKCE_KEY)}setGrant(t,n=!1){const{grant_id:s}=t;this.Storage.set(`${GRANT_KEY}${n?"-"+s:""}`,t)}removeGrant(t,n=!1){this.Storage.remove(`${GRANT_KEY}${n?"-"+t:""}`)}async getGrant(t,n=!1){const s=await this.Storage.get(`${GRANT_KEY}${n?"-"+t:""}`);return s||null}async setUserToken(t){const n=await this.getUserTokens();if(n)if(n.find(a=>a.sub===t.sub)){const a=n.map(d=>(d.sub===t.sub&&(d=t),d));this.Storage.set(USER_KEY,a)}else{const a=[...n,t];this.Storage.set(USER_KEY,a)}else this.Storage.set(USER_KEY,[t])}async getUserToken(t=""){const n=await this.Storage.get(USER_KEY);return n?t===""?n[0]:n.find(a=>a.sub===t):null}async getUserTokens(){const t=await this.Storage.get(USER_KEY);return t||null}removeUserTokens(){this.Storage.remove(USER_KEY)}async removeUserToken(t){const n=await this.getUserTokens(),s=n==null?void 0:n.filter(a=>a.sub!==t);this.Storage.set(USER_KEY,s)}async clearSession(){const t=await this.getUserTokens();t==null||t.forEach(n=>{this.removeGrant(n.sub)}),this.removePKCE(),this.removeUserTokens()}}class IndexedDBStorage{constructor(){I(this,"databaseName","identity-db");I(this,"storeName","identity")}get(t){const n=this;return new Promise((s,a)=>{n.openDatabase().then(function(d){const c=d.transaction(n.storeName,"readwrite"),h=c.objectStore(n.storeName).get(t);h.onsuccess=()=>{s(h.result)},h.onerror=()=>{a(h.error)},c.oncomplete=()=>{d.close()}})})}async remove(t){const n=this;return new Promise((s,a)=>{const d=indexedDB.open(this.databaseName);d.onupgradeneeded=function(c){c.target.result.createObjectStore(n.storeName)},d.onerror=()=>{a(d.error)},d.onsuccess=c=>{const l=c.target.result,h=l.transaction(this.storeName,"readwrite"),g=h.objectStore(this.storeName).delete(t);g.onsuccess=()=>{s(null)},g.onerror=()=>{a(g.error)},h.oncomplete=()=>{l.close()}}})}set(t,n){return new Promise((s,a)=>{const d=indexedDB.open(this.databaseName);d.onerror=()=>{a(d.error)},d.onupgradeneeded=c=>{c.target.result.createObjectStore(this.storeName)},d.onsuccess=c=>{const l=c.target.result,h=l.transaction(this.storeName,"readwrite"),g=h.objectStore(this.storeName).put(n,t);g.onsuccess=()=>{s(n)},g.onerror=()=>{a(g.error)},h.oncomplete=()=>{l.close()}}})}openDatabase(){const t=this;return new Promise(function(n,s){const a=indexedDB.open(t.databaseName,2);a.onupgradeneeded=function(d){d.target.result.createObjectStore(t.storeName)},a.onsuccess=function(d){n(d.target.result)},a.onerror=function(d){s(d.error)}})}}var sha256={exports:{}};(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof index.process=="object"&&index.process.versions&&index.process.versions.node;NODE_JS?root=index.commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return typeof r=="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(r,t){return function(n){return new Sha256(t,!0).update(n)[r]()}},createMethod=function(r){var t=createOutputMethod("hex",r);NODE_JS&&(t=nodeWrap(t,r)),t.create=function(){return new Sha256(r)},t.update=function(a){return t.create().update(a)};for(var n=0;n<OUTPUT_TYPES.length;++n){var s=OUTPUT_TYPES[n];t[s]=createOutputMethod(s,r)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(r){if(typeof r=="string")return crypto.createHash(algorithm).update(r,"utf8").digest("hex");if(r==null)throw new Error(ERROR);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(r)).digest("hex"):method(r)};return nodeMethod},createHmacOutputMethod=function(r,t){return function(n,s){return new HmacSha256(n,t,!0).update(s)[r]()}},createHmacMethod=function(r){var t=createHmacOutputMethod("hex",r);t.create=function(a){return new HmacSha256(a,r)},t.update=function(a,d){return t.create(a).update(d)};for(var n=0;n<OUTPUT_TYPES.length;++n){var s=OUTPUT_TYPES[n];t[s]=createHmacOutputMethod(s,r)}return t};function Sha256(r,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=r}Sha256.prototype.update=function(r){if(!this.finalized){var t,n=typeof r;if(n!=="string"){if(n==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var s,a=0,d,c=r.length,l=this.blocks;a<c;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),t)for(d=this.start;a<c&&d<64;++a)l[d>>2]|=r[a]<<SHIFT[d++&3];else for(d=this.start;a<c&&d<64;++a)s=r.charCodeAt(a),s<128?l[d>>2]|=s<<SHIFT[d++&3]:s<2048?(l[d>>2]|=(192|s>>6)<<SHIFT[d++&3],l[d>>2]|=(128|s&63)<<SHIFT[d++&3]):s<55296||s>=57344?(l[d>>2]|=(224|s>>12)<<SHIFT[d++&3],l[d>>2]|=(128|s>>6&63)<<SHIFT[d++&3],l[d>>2]|=(128|s&63)<<SHIFT[d++&3]):(s=65536+((s&1023)<<10|r.charCodeAt(++a)&1023),l[d>>2]|=(240|s>>18)<<SHIFT[d++&3],l[d>>2]|=(128|s>>12&63)<<SHIFT[d++&3],l[d>>2]|=(128|s>>6&63)<<SHIFT[d++&3],l[d>>2]|=(128|s&63)<<SHIFT[d++&3]);this.lastByteIndex=d,this.bytes+=d-this.start,d>=64?(this.block=l[16],this.start=d-64,this.hash(),this.hashed=!0):this.start=d}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var r=this.blocks,t=this.lastByteIndex;r[16]=this.block,r[t>>2]|=EXTRA[t&3],this.block=r[16],t>=56&&(this.hashed||this.hash(),r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.hBytes<<3|this.bytes>>>29,r[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var r=this.h0,t=this.h1,n=this.h2,s=this.h3,a=this.h4,d=this.h5,c=this.h6,l=this.h7,h=this.blocks,u,g,f,y,p,m,S,b,v,R,T;for(u=16;u<64;++u)p=h[u-15],g=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,p=h[u-2],f=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,h[u]=h[u-16]+g+h[u-7]+f<<0;for(T=t&n,u=0;u<64;u+=4)this.first?(this.is224?(b=300032,p=h[0]-1413257819,l=p-150054599<<0,s=p+24177077<<0):(b=704751109,p=h[0]-210244248,l=p-1521486534<<0,s=p+143694565<<0),this.first=!1):(g=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),f=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),b=r&t,y=b^r&n^T,S=a&d^~a&c,p=l+f+S+K[u]+h[u],m=g+y,l=s+p<<0,s=p+m<<0),g=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),f=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),v=s&r,y=v^s&t^b,S=l&a^~l&d,p=c+f+S+K[u+1]+h[u+1],m=g+y,c=n+p<<0,n=p+m<<0,g=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),f=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),R=n&s,y=R^n&r^v,S=c&l^~c&a,p=d+f+S+K[u+2]+h[u+2],m=g+y,d=t+p<<0,t=p+m<<0,g=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),f=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),T=t&n,y=T^t&s^R,S=d&c^~d&l,p=a+f+S+K[u+3]+h[u+3],m=g+y,a=r+p<<0,r=p+m<<0;this.h0=this.h0+r<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+s<<0,this.h4=this.h4+a<<0,this.h5=this.h5+d<<0,this.h6=this.h6+c<<0,this.h7=this.h7+l<<0},Sha256.prototype.hex=function(){this.finalize();var r=this.h0,t=this.h1,n=this.h2,s=this.h3,a=this.h4,d=this.h5,c=this.h6,l=this.h7,h=HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[d>>28&15]+HEX_CHARS[d>>24&15]+HEX_CHARS[d>>20&15]+HEX_CHARS[d>>16&15]+HEX_CHARS[d>>12&15]+HEX_CHARS[d>>8&15]+HEX_CHARS[d>>4&15]+HEX_CHARS[d&15]+HEX_CHARS[c>>28&15]+HEX_CHARS[c>>24&15]+HEX_CHARS[c>>20&15]+HEX_CHARS[c>>16&15]+HEX_CHARS[c>>12&15]+HEX_CHARS[c>>8&15]+HEX_CHARS[c>>4&15]+HEX_CHARS[c&15];return this.is224||(h+=HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>4&15]+HEX_CHARS[l&15]),h},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var r=this.h0,t=this.h1,n=this.h2,s=this.h3,a=this.h4,d=this.h5,c=this.h6,l=this.h7,h=[r>>24&255,r>>16&255,r>>8&255,r&255,t>>24&255,t>>16&255,t>>8&255,t&255,n>>24&255,n>>16&255,n>>8&255,n&255,s>>24&255,s>>16&255,s>>8&255,s&255,a>>24&255,a>>16&255,a>>8&255,a&255,d>>24&255,d>>16&255,d>>8&255,d&255,c>>24&255,c>>16&255,c>>8&255,c&255];return this.is224||h.push(l>>24&255,l>>16&255,l>>8&255,l&255),h},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(this.is224?28:32),t=new DataView(r);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),r};function HmacSha256(r,t,n){var s,a=typeof r;if(a==="string"){var d=[],c=r.length,l=0,h;for(s=0;s<c;++s)h=r.charCodeAt(s),h<128?d[l++]=h:h<2048?(d[l++]=192|h>>6,d[l++]=128|h&63):h<55296||h>=57344?(d[l++]=224|h>>12,d[l++]=128|h>>6&63,d[l++]=128|h&63):(h=65536+((h&1023)<<10|r.charCodeAt(++s)&1023),d[l++]=240|h>>18,d[l++]=128|h>>12&63,d[l++]=128|h>>6&63,d[l++]=128|h&63);r=d}else if(a==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);r.length>64&&(r=new Sha256(t,!0).update(r).array());var u=[],g=[];for(s=0;s<64;++s){var f=r[s]||0;u[s]=92^f,g[s]=54^f}Sha256.call(this,t,n),this.update(g),this.oKeyPad=u,this.inner=!0,this.sharedMemory=n}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var r=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(r),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256);var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(r){return typeof r=="string"&®EX.test(r)}var byteToHex=[];for(var i=0;i<256;++i)byteToHex.push((i+256).toString(16).substr(1));function stringify(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(byteToHex[r[t+0]]+byteToHex[r[t+1]]+byteToHex[r[t+2]]+byteToHex[r[t+3]]+"-"+byteToHex[r[t+4]]+byteToHex[r[t+5]]+"-"+byteToHex[r[t+6]]+byteToHex[r[t+7]]+"-"+byteToHex[r[t+8]]+byteToHex[r[t+9]]+"-"+byteToHex[r[t+10]]+byteToHex[r[t+11]]+byteToHex[r[t+12]]+byteToHex[r[t+13]]+byteToHex[r[t+14]]+byteToHex[r[t+15]]).toLowerCase();if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}function v4(r,t,n){r=r||{};var s=r.random||(r.rng||rng)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){n=n||0;for(var a=0;a<16;++a)t[n+a]=s[a];return t}return stringify(s)}async function getBytes(r,t){const n=r.getReader();let s;for(;!(s=await n.read()).done;)t(s.value)}function getLines(r){let t,n,s,a=!1;return function(c){t===void 0?(t=c,n=0,s=-1):t=concat(t,c);const l=t.length;let h=0;for(;n<l;){a&&(t[n]===10&&(h=++n),a=!1);let u=-1;for(;n<l&&u===-1;++n)switch(t[n]){case 58:s===-1&&(s=n-h);break;case 13:a=!0;case 10:u=n;break}if(u===-1)break;r(t.subarray(h,u),s),h=n,s=-1}h===l?t=void 0:h!==0&&(t=t.subarray(h),n-=h)}}function getMessages(r,t,n){let s=newMessage();const a=new TextDecoder;return function(c,l){if(c.length===0)n==null||n(s),s=newMessage();else if(l>0){const h=a.decode(c.subarray(0,l)),u=l+(c[l+1]===32?2:1),g=a.decode(c.subarray(u));switch(h){case"data":s.data=s.data?s.data+`
|
|
2
|
+
`+g:g;break;case"event":s.event=g;break;case"id":r(s.id=g);break;case"retry":const f=parseInt(g,10);isNaN(f)||t(s.retry=f);break}}}}function concat(r,t){const n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),n}function newMessage(){return{data:"",event:"",id:"",retry:void 0}}var __rest=function(r,t){var n={};for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&t.indexOf(s)<0&&(n[s]=r[s]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(r);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(r,s[a])&&(n[s[a]]=r[s[a]]);return n};const EventStreamContentType="text/event-stream",DefaultRetryInterval=1e3,LastEventId="last-event-id";function fetchEventSource(r,t){var{signal:n,headers:s,onopen:a,onmessage:d,onclose:c,onerror:l,openWhenHidden:h,fetch:u}=t,g=__rest(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((f,y)=>{const p=Object.assign({},s);p.accept||(p.accept=EventStreamContentType);let m;function S(){m.abort(),document.hidden||P()}h||document.addEventListener("visibilitychange",S);let b=DefaultRetryInterval,v=0;function R(){document.removeEventListener("visibilitychange",S),window.clearTimeout(v),m.abort()}n==null||n.addEventListener("abort",()=>{R(),f()});const T=u??window.fetch,O=a??defaultOnOpen;async function P(){var N;m=new AbortController;try{const k=await T(r,Object.assign(Object.assign({},g),{headers:p,signal:m.signal}));await O(k),await getBytes(k.body,getLines(getMessages(A=>{A?p[LastEventId]=A:delete p[LastEventId]},A=>{b=A},d))),c==null||c(),R(),f()}catch(k){if(!m.signal.aborted)try{const A=(N=l==null?void 0:l(k))!==null&&N!==void 0?N:b;window.clearTimeout(v),v=window.setTimeout(P,A)}catch(A){R(),y(A)}}}P()})}function defaultOnOpen(r){const t=r.headers.get("content-type");if(!(t!=null&&t.startsWith(EventStreamContentType)))throw new Error(`Expected content-type to be ${EventStreamContentType}, Actual: ${t}`)}function Base64EncodeUrl(r){return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function getTimestamp(){return Math.floor(Date.now()/1e3)}function e(r){this.message=r}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r$1=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,s,a=0,d=0,c="";s=t.charAt(d++);~s&&(n=a%4?64*n+s:s,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);return c};function t$1(r){var t=r.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(r$1(n).replace(/(.)/g,function(s,a){var d=a.charCodeAt(0).toString(16).toUpperCase();return d.length<2&&(d="0"+d),"%"+d}))}(t)}catch{return r$1(t)}}function n$1(r){this.message=r}function o(r,t){if(typeof r!="string")throw new n$1("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(t$1(r.split(".")[n]))}catch(s){throw new n$1("Invalid token specified: "+s.message)}}n$1.prototype=new Error,n$1.prototype.name="InvalidTokenError";class NylasSessions{constructor(t){I(this,"clientId");I(this,"redirectUri");I(this,"accessType","online");I(this,"domain","http://api.nylas.com");I(this,"versioned",!1);I(this,"Storage");I(this,"hosted",!1);I(this,"multiAccount",!1);I(this,"loginId","");if(this.clientId=t.clientId,this.redirectUri=t.redirectUri,t.domain&&(this.domain=t.domain,this.domain.substring(this.domain.length-3).includes("/v")&&(this.versioned=!0)),t.multiAccount&&(this.multiAccount=t.multiAccount),t.sw){const n=new IndexedDBStorage;this.Storage=new Storage(n)}else this.Storage=new Storage;t.accessType&&(this.accessType=t.accessType),t.loginId&&(this.loginId=t.loginId),t.hosted&&(this.hosted=t.hosted),t.disableInitCodeExchange!==!0&&this.codeExchange(null)}async validateAccessToken(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const{access_token:s}=n;try{return!!(await(await fetch(`${this.domain}/connect/tokeninfo?access_token=${s}`,{method:"GET"})).json()).data}catch{return!1}}async validateIDToken(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const{id_token:s}=n;try{const a=await fetch(`${this.domain}/connect/tokeninfo?id_token=${s}`,{method:"GET"});return!(a.status!==200||!(await a.json()).data)}catch{return!1}}getDomain(){return this.domain}async auth(t){this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin))&&await this.hostedSetCodeChallenge();const n=await this.generateAuthURL(t);if(t.popup){this.popUp(n);return}return n}async generateAuthURL(t){const n=await this.getCodeChallege();let s=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;return n&&(s+=`&code_challenge=${n}&code_challenge_method=S256&options=rotate_refresh_token`),t.provider&&(s+=`&provider=${t.provider}`),t.loginHint&&(s+=`&login_hint=${t.loginHint}`,t.includeGrantScopes&&(s+=`&include_grant_scopes=${t.includeGrantScopes}`)),t.scope&&(s+=`&scope=${t.scope.join(" ")}`),t.prompt&&(s+=`&prompt=${t.prompt}`),t.metadata&&(s+=`&metadata=${t.metadata}`),(t.state||this.loginId)&&(s+=`&state=${this.loginId?this.loginId:t.state}`),s}async generateReauthURL(t,n){if(!t)throw new Error("Grant ID is required");const s=await this.Storage.getUserToken(t),a=await this.getCodeChallege();let d=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;return a&&(d+=`&code_challenge=${a}&code_challenge_method=S256&options=rotate_refresh_token`),s!=null&&s.provider&&(d+=`&provider=${s.provider}`),s!=null&&s.email&&(d+=`&login_hint=${s.email}`),n&&(d+=`&scope=${n.join(" ")}`),d}async generateCodeChallenge(){if(await this.Storage.getPKCE())return;const n=v4();this.Storage.setPKCE(n)}async hostedSetCodeChallenge(){if(!this.hosted)throw console.error("Method only used with hosted flag enabled");const n=new URLSearchParams(window.location.search).get("code_challenge");if(!n){if(await this.Storage.getPKCE())return;console.warn("Code challenge is recomended");return}this.Storage.setPKCE(n)}async getCodeChallege(){if(this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin))){const s=new URLSearchParams(window.location.search).get("code_challenge");return s||(console.warn("Code challenge is recomended"),"")}const t=await this.Storage.getPKCE();if(t){const n=sha256.exports.sha256(t);let s=index.Buffer.from(n).toString("base64");return s=Base64EncodeUrl(s),s}return""}async isLoggedIn(){if(this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin)))return!1;const t=await this.Storage.getUserTokens();return t&&t.length>0?(this.multiAccount&&await this.generateCodeChallenge(),!0):(await this.generateCodeChallenge(),!1)}isMultiAccount(){return this.multiAccount}async logout(){const t=await this.getProfile();await this.Storage.clearSession();const n={detail:t};window.dispatchEvent(new CustomEvent("onLogoutSuccess",n))}async getProfile(t=""){let n;return t?n=await this.Storage.getUserToken(t):n=await this.Storage.getUserToken(),n||null}async getProfiles(){const t=await this.Storage.getUserTokens();return t||null}async removeProfile(t){return await this.Storage.removeUserToken(t),await this.Storage.removeGrant(t),null}async authIMAP(t){const n=await this.getCodeChallege(),s={imap_username:t.imap_username,imap_password:t.imap_password,imap_host:t.imap_host,imap_port:t.imap_port,type:t.type,smtp_host:t.smtp_host,smtp_port:t.smtp_port,provider:t.provider,redirect_uri:this.redirectUri,state:t.state,public_application_id:this.clientId,access_type:this.accessType};return this.loginId&&(s.id=this.loginId),t.smtp_username&&t.smtp_password&&(s.smtp_username=t.smtp_username,s.smtp_password=t.smtp_password),n!=""&&(s.code_challenge=n,s.code_challenge_method="S256"),await(await fetch(`${this.domain}/connect/login/imap`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(s)})).json()}async authEWS(t){const n=await this.getCodeChallege(),s={...t,provider:"ews",redirect_uri:this.redirectUri,public_application_id:this.clientId,access_type:this.accessType};return this.loginId&&(s.id=this.loginId),n!=""&&(s.code_challenge=n,s.code_challenge_method="S256"),await(await fetch(`${this.domain}/connect/login/ews`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(s)})).json()}async detectEmail(t){return await(await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/providers/detect?client_id=${this.clientId}&email=${t}`,{method:"POST",headers:new Headers({"content-type":"application/json"})})).json()}async applicationInfo(){return(await(await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/applications?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})})).json()).data}async getAvailableProviders(){const t=await fetch(`${this.domain}/connect/providers/find?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})});return t?(await t.json()).data:null}onLoginSuccess(t){window.addEventListener("onLoginSuccess",n=>t(n))}onLogoutSuccess(t){window.addEventListener("onLogoutSuccess",n=>t(n))}onLoginFail(t){window.addEventListener("onLoginFail",n=>t(n))}onTokenRefreshSuccess(t){window.addEventListener("onTokenRefreshSuccess",n=>t(n))}onTokenRefreshFail(t){window.addEventListener("onTokenRefreshFail",n=>t(n))}onSessionExpired(t){window.addEventListener("onSessionExpired",n=>t(n))}async codeExchange(t){let n=new URLSearchParams(window.location.search);t&&(n=new URLSearchParams(t));const s=n.get("code"),a=n.get("state"),d=n.get("error"),c=n.get("error_description"),l=n.get("error_code");if(d&&c&&l){const u={detail:{error:d,error_description:c,error_code:l}};return window.dispatchEvent(new CustomEvent("onLoginFail",u)),window.history.pushState({},document.title,window.location.pathname),!1}if(!s)return console.warn("No code found"),!1;if(window.opener&&window.name==="uas-popup")return console.warn("Popup window detected"),!1;const h=await this.Storage.getPKCE();if(!h)return console.warn("No code verifier found"),!1;try{const u={client_id:this.clientId,redirect_uri:this.redirectUri,code:s,grant_type:"authorization_code",code_verifier:h},f=await(await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(u)})).json();if(f){if(f.error){const p={detail:f};return window.dispatchEvent(new CustomEvent("onLoginFail",p)),!0}const y=await this.handleCodeExchangeResponse(f);if(y.valid){a&&(y.data.state=a);const p={detail:y.data};window.dispatchEvent(new CustomEvent("onLoginSuccess",p)),window.history.pushState({},document.title,window.location.pathname)}else{const p={detail:y.data};return window.dispatchEvent(new CustomEvent("onLoginFail",p)),!0}}return this.Storage.removePKCE(),!0}catch(u){const g={detail:u};return window.dispatchEvent(new CustomEvent("onLoginFail",g)),window.history.pushState({},document.title,window.location.pathname),!1}}async tokenExchange(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const s=n.refresh_token;try{const a={client_id:this.clientId,redirect_uri:this.redirectUri,refresh_token:s,grant_type:"refresh_token"},c=await(await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(a)})).json();if(c){if(c.error){const g={detail:c};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",g)),!0}const l=getTimestamp();if(c.expires_in=l+c.expires_in,this.Storage.setGrant(c,this.multiAccount),!await this.validateIDToken(t)){const g={detail:c};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",g)),!0}const u={detail:c};return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess",u)),!0}this.Storage.removePKCE()}catch(a){const d={detail:a};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",d)),!1}}async handleCodeExchangeResponse(t){if(t.error)return{data:t,valid:!1};const s=getTimestamp();t.expires_in=s+t.expires_in,this.Storage.setGrant(t,this.multiAccount);const a=o(t.id_token);return a.status="authenticated",this.Storage.setUserToken(a),await this.validateIDToken(a.sub)?{data:t,valid:!0}:{data:t,valid:!1}}async popUp(t){const a=window.screenX+(window.outerWidth-500)/2,d=window.screenY+(window.outerHeight-600)/2.5,c="uas-popup",l=t,h=window.open(l,c,`width=500,height=600,left=${a},top=${d}`);if(!h)return;const u=setInterval(async()=>{if(h.closed){const g={detail:{error_description:"OAuth provider window closed"}};window.dispatchEvent(new CustomEvent("onLoginFail",g)),u&&clearInterval(u);return}try{const g=h.location.href.split("?");if(!g[0])return;const f=h.location.search;if(h.history.pushState({},document.title,window.location.pathname),g[0]===this.redirectUri&&g.length>1){const y=await this.codeExchange(f);h.close(),y&&location.reload(),u&&clearInterval(u);return}}catch{return}},1e3)}async getAccessToken(t=""){const n=getTimestamp(),s=await this.Storage.getGrant(t,this.multiAccount);if(!s)return null;const{access_token:a,expires_in:d}=s,c=a;return c&&d&&d>getTimestamp()&&d-n>30?c:(await this.tokenExchange(t),(await this.Storage.getGrant(t,this.multiAccount)).access_token)}async sse(t,n){const s=n.headers||{},a=s["Grant-ID"];let d="";if(this.multiAccount){if(!a)throw this.logout(),new Error("Grant ID is required for multi account calls");d=await this.getAccessToken(a)}else d=await this.getAccessToken();return delete s["Grant-ID"],s.Authorization=`Bearer ${d}`,s["content-type"]||(s["content-type"]="application/json"),fetchEventSource(`${this.domain}/${t}`,{...n,headers:s})}async fetch(t,n,s=!0,a){let d="",c=1;if(this.multiAccount){if(!n.grant_id)throw this.logout(),new Error("Grant ID is required for multi account calls");const h=await this.getProfiles();c=h?h.length:1,d=await this.getAccessToken(n.grant_id)}else d=await this.getAccessToken();if(!d)throw new Error("Access token not found");let l=n.headers;Headers.prototype.isPrototypeOf(l)?(l.append("Authorization",`Bearer ${d}`),l.has("content-type")||l.append("content-type","application/json")):l=new Headers({Authorization:`Bearer ${d}`,"content-type":"application/json"});try{n!=null&&n.body&&(n.body=JSON.stringify(n==null?void 0:n.body));const h=await fetch(`${a||this.domain}/${t}`,{...n,headers:l});if(!s)return h;const u=await(h==null?void 0:h.json());if(!await this.isAuthenticatedResponse(h.status,u)){if(c>1){const f=await this.getProfile(n.grant_id);if(f){f.status="unauthorized",await this.Storage.setUserToken(f);const y={detail:{user:f}};window.dispatchEvent(new CustomEvent("onSessionExpired",y))}}else{const y={detail:{user:await this.Storage.getUserToken()}};window.dispatchEvent(new CustomEvent("onSessionExpired",y))}this.logout();return}return u}catch(h){throw h}}async fetchRequest(t,n,s,a=!0,d,c){const l=await this.isLoggedIn(),h=new URL(t,d??this.domain),u=new Headers;if(u.append("Accept","application/json"),u.append("Content-Type","application/json"),u.append("User-Agent","nylas-identity"),l){const y=await this.getAccessToken();u.append("Authorization",`Bearer ${y}`)}const g=await fetch(h.toString(),{method:n||"GET",headers:u,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0,...c||{}});return a?await g.json():g.body}async isAuthenticatedResponse(t,n){var s;return!(t==401&&((s=n==null?void 0:n.error)==null?void 0:s.type)=="token.unauthorized_access")}addAPIKey(t,n,s){this.Storage.setUserToken({aud:"https://api-staging.us.nylas.com/",exp:2e9,email_verified:!0,iat:getTimestamp(),iss:"",email:n,provider:"virtual-calendar",status:"authenticated",name:n,sub:t}),this.Storage.setGrant({grant_id:t,access_token:s,expires_in:2e9},this.multiAccount)}}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(r,t,n){this.props=r,this.context=t,this.refs=D,this.updater=n||B}E.prototype.isReactComponent={};E.prototype.setState=function(r,t){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,t,"setState")};E.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(r,t,n){this.props=r,this.context=t,this.refs=D,this.updater=n||B}var H=G.prototype=new F;H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;const LoginRequired=({authenticationUrl:r})=>index.h("div",{class:"login-required",part:"nse__login-required login-component"},index.h("div",{class:"card",part:"nse__login-required-card"},index.h("p",{part:"nse__login-required-text"},"Log into your account to use the Scheduler Editor."),index.h("button",{class:"google-button",part:"nse__login-required-google-button",onClick:async t=>{t.preventDefault();const n=await r("google");n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},index.h("span",{class:"icon"},index.h("google-logo-icon",{width:"15",height:"15"})),"Continue with Google"),index.h("button",{class:"microsoft-button",part:"nse__login-required-microsoft-button",onClick:async t=>{t.preventDefault();const n=await r("microsoft");n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},index.h("span",{class:"icon"},index.h("microsoft-logo-icon",{width:"15",height:"15"})),"Continue with Microsoft"),index.h("button",{class:"other-provider-button",part:"nse__login-required-other-provider-button",onClick:async t=>{t.preventDefault();const n=await r();n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},"View all providers ",index.h("chevron-icon",{width:"17",height:"17"})),index.h("small",{class:"disclaimer-text",part:"nse__login-required-disclaimer-text"},"* You will be redirected to authenticate your account.")));function ExpressFlow({currentUser:r,calendars:t,selectedEventType:n,experimentalFeatures:s}){const a=(t==null?void 0:t.find(c=>c.is_primary))||(t==null?void 0:t[0]),d=(s==null?void 0:s[constants3d8016e3.EXPERIMENTAL_FEATURES.group_events])||!1;switch(n){case constants3d8016e3.CONFIGURATION_EVENT_TYPE.one_on_one:case constants3d8016e3.CONFIGURATION_EVENT_TYPE.max_availability:case constants3d8016e3.CONFIGURATION_EVENT_TYPE.max_fairness:return index.h(index.Fragment,null,index.h("nylas-event-info",null,index.h("div",{slot:"inputs"},index.h("nylas-event-title",null),index.h("nylas-event-duration",null),index.h("nylas-event-location",{userProvider:r.provider}))),index.h("nylas-booking-calendar-picker",{expressFlow:!0,calendars:t,currentUser:r,defaultBookingCalendar:a==null?void 0:a.id}),!d&&index.h("nylas-scheduling-method",{exportparts:"nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content"}),index.h("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}));case constants3d8016e3.CONFIGURATION_EVENT_TYPE.collective:return index.h(index.Fragment,null,index.h("nylas-event-info",null,index.h("div",{slot:"inputs"},index.h("nylas-event-title",null),index.h("nylas-event-duration",null),index.h("nylas-event-location",{userProvider:r.provider}))),index.h("nylas-booking-calendar-picker",{expressFlow:!0,calendars:t,currentUser:r,defaultBookingCalendar:a==null?void 0:a.id}),!d&&index.h("nylas-scheduling-method",{exportparts:"nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content"}),index.h("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}),index.h("nylas-additional-participants",{name:"participants",eventParticipants:[{name:(r==null?void 0:r.name)||(r==null?void 0:r.email),email:(r==null?void 0:r.email)||"",is_organizer:!0}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}));case constants3d8016e3.CONFIGURATION_EVENT_TYPE.group:return index.h(index.Fragment,null,index.h("nylas-event-info",null,index.h("div",{slot:"inputs"},index.h("nylas-event-title",null),index.h("nylas-event-description",{hideAutoPopulateButton:!0}),index.h("nylas-event-location",{userProvider:r.provider}),index.h("nylas-event-timeslot",{name:"event-timeslot"}),index.h("nylas-event-capacity",null))),index.h("nylas-booking-calendar-picker",{expressFlow:!0,calendars:t,currentUser:r,defaultBookingCalendar:a==null?void 0:a.id}),index.h("nylas-additional-participants",{name:"participants",eventParticipants:[{name:(r==null?void 0:r.name)||(r==null?void 0:r.email),email:(r==null?void 0:r.email)||"",is_organizer:!0}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}),index.h("nylas-page-name",{requirePageName:!0,pageName:"Group events page"}),index.h("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}))}}const nylasSchedulerEditorCss=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 0px 6px -2px rgba(0, 0, 0, 0.05), 0px 5px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{width:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}div.scheduler-editor-content{height:610px}div.scheduler-editor-content.scheduler-editor-content--group_feature_enabled{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content.scheduler-editor-content--group_feature_enabled{height:auto}}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-content--group{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content--group{height:auto}}div.scheduler-editor-header{display:grid;grid-template-columns:1fr auto auto;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900);min-width:924px}@media screen and (max-width: 768px){div.scheduler-editor-header{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;margin:0;font-size:18px;line-height:24px;font-weight:600}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary);background-color:transparent}div.scheduler-editor-header button:disabled{cursor:not-allowed}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button){border:none;padding:4px;margin-right:8px}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button):hover{outline:none;color:var(--nylas-primary)}@media screen and (max-width: 768px){div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){width:-webkit-fill-available;width:fill-available;width:-moz-available}}nylas-select-event-type{height:inherit;width:calc(924px + 2rem)}@media screen and (max-width: 768px){nylas-select-event-type{width:auto}}nylas-editor-tabs,nylas-editor-tabs-group{width:auto;height:inherit}nylas-editor-tabs .row,nylas-editor-tabs-group .row{display:flex;gap:1rem}nylas-editor-tabs .composable,nylas-editor-tabs-group .composable{height:inherit;overflow:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs nylas-event-limits div[slot=inputs],nylas-editor-tabs-group nylas-event-info div[slot=inputs],nylas-editor-tabs-group nylas-event-limits div[slot=inputs]{display:flex;flex-direction:column;gap:1rem}.card{display:flex;flex-direction:column;padding:2rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;max-width:fit-content;align-self:center}.login-required{height:inherit;overflow-y:auto;display:flex;flex-direction:column;justify-content:center;padding:2rem 1rem;background-color:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.login-required{height:auto}}.login-required p{margin:0 0 1rem}.login-required .microsoft-button,.login-required .google-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;margin-bottom:1rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;justify-content:center;gap:0.5rem;align-items:center}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;border:0;background-color:var(--nylas-base-0);height:48px;margin-bottom:1rem;font-size:0.95rem;justify-content:center;gap:0.25rem;align-items:center}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button svg{transform:rotate(180deg)}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .disclaimer-text{font-size:0.75rem;color:var(--nylas-base-600);align-self:center}.list-configurations{padding:2rem;height:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}',NylasSchedulerEditorStyle0=nylasSchedulerEditorCss,NylasSchedulerEditor=class{constructor(r){index.registerInstance(this,r),this.init=index.createEvent(this,"init",7),this.loggedIn=index.createEvent(this,"loggedIn",7),this.loggedOut=index.createEvent(this,"loggedOut",7),this.schedulerConfigCloseClicked=index.createEvent(this,"schedulerConfigCloseClicked",7),this.handleSchedulerConfigCloseClicked=t=>{const n=this.schedulerConfigCloseClicked.emit(this.host);"schedulerConfigCloseClicked"in this.eventOverrides&&this.eventOverrides.schedulerConfigCloseClicked(n,this.nylasSchedulerConfigConnector),n.defaultPrevented||(localStorage.removeItem("grant"),localStorage.removeItem("user"),window.location.reload())},this.authenticationUrl=async t=>this.nylasApiRequest?await this.nylasApiRequest.authenticationUrl({provider:t})||"":(console.error("[nylas-scheduler-editor] Nylas API Request is not initialized."),""),this.configurationId=void 0,this.nylasApiRequest=void 0,this.nylasSessionsConfig=void 0,this.defaultAuthArgs=void 0,this.eventOverrides={},this.schedulerPreviewLink="",this.defaultSchedulerConfigState=void 0,this.mode="app",this.additionalParticipants=void 0,this.hideEditorTabs=[],this.conferenceProviders=void 0,this.requiresSlug=!1,this.enableUserFeedback=!0,this.defaultLanguage=void 0,this.localization=void 0,this.nylasBranding=!0,this.experimentalFeatures=void 0,this.automaticComponentRegistration=!0,this.selectedLanguage=this.defaultLanguage||constants3d8016e3.LANGUAGE_CODE.en,this.langVersion=0}connectedCallback(){index.debug("[nylas-scheduler-editor] connectedCallback")}async componentWillLoad(){var s,a,d,c,l,h,u,g;index.debug("[nylas-scheduler-editor] componentWillLoad");const r=(s=this.additionalParticipants)==null?void 0:s.filter(f=>{var p;const y=((p=f.calendars)==null?void 0:p.length)>0?f.calendars.filter(m=>m.id&&m.name):[];if(f.name&&f.email&&y.length>0)return{name:f.name,email:f.email,calendars:y}});if(this.stores={schedulerConfig:schedulerConfigStoreD6729d8d.CreateNylasSchedulerConfigStore({...this.defaultSchedulerConfigState,additionalParticipants:r,conferenceProviders:this.conferenceProviders,requiresSlug:this.requiresSlug,selectedLanguage:this.defaultLanguage||constants3d8016e3.LANGUAGE_CODE.en,nylasBranding:this.nylasBranding,experimentalFeatures:this.experimentalFeatures})},!this.nylasApiRequest&&this.nylasSessionsConfig){const f=new NylasSessions(this.nylasSessionsConfig);await f.isLoggedIn(),f.onLoginSuccess(async()=>{var p,m;const y=await((m=(p=this.nylasSchedulerConfigConnector)==null?void 0:p.schedulerConfig)==null?void 0:m.currentUser());if(y){const S=this.loggedIn.emit(this.host);"loggedIn"in this.eventOverrides&&await this.eventOverrides.loggedIn(S,this.nylasSchedulerConfigConnector),S.defaultPrevented||await this.loggedInHandler(y)}}),f.onLoginFail(async()=>{var p,m;(m=(p=this.stores)==null?void 0:p.schedulerConfig)==null||m.set("currentUser",null);const y=this.loggedOut.emit(this.host);"loggedOut"in this.eventOverrides&&(await this.eventOverrides.loggedOut(y,this.nylasSchedulerConfigConnector),y.defaultPrevented)}),this.nylasApiRequest=new index.NylasIdentityRequestWrapper(f)}this.nylasApiRequest&&this.defaultAuthArgs&&this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs),this.baseProvider=new index_es4a203e8e.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const t=this.baseProvider.getStore("schedulerConfig");this.nylasSchedulerConfigConnector=new NylasSchedulerConfigConnector({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:t});const n=this.init.emit(this.host);if("init"in this.eventOverrides&&await this.eventOverrides.init(n,this.nylasSchedulerConfigConnector),!n.defaultPrevented){const f=await((d=(a=this.nylasSchedulerConfigConnector)==null?void 0:a.schedulerConfig)==null?void 0:d.currentUser());if(f){const y=this.loggedIn.emit(this.host);"loggedIn"in this.eventOverrides&&await this.eventOverrides.loggedIn(y,this.nylasSchedulerConfigConnector),y.defaultPrevented||await this.loggedInHandler(f)}else{(l=(c=this.stores)==null?void 0:c.schedulerConfig)==null||l.set("currentUser",null);const y=this.loggedOut.emit(this.host);if("loggedOut"in this.eventOverrides&&(await this.eventOverrides.loggedOut(y,this.nylasSchedulerConfigConnector),y.defaultPrevented))return}}(u=(h=this.stores)==null?void 0:h.schedulerConfig)==null||u.onChange("selectedConfiguration",async f=>{f&&f.id&&(this.configurationId=f.id)}),(g=this.baseProvider)==null||g.componentWillLoad(this.nylasSchedulerConfigConnector)}async componentDidLoad(){var r;index.debug("[nylas-scheduler-editor] componentDidLoad"),await((r=this.baseProvider)==null?void 0:r.componentDidLoad()),this.updateLocalization(this.localization)}async componentDisconnected(){var r;await((r=this.baseProvider)==null?void 0:r.componentDisconnected())}async configurationIdChanged(r){var t,n,s,a,d,c,l,h;r?(await((n=(t=this.nylasSchedulerConfigConnector)==null?void 0:t.schedulerConfig)==null?void 0:n.getConfigurationById(r)),(a=(s=this.stores)==null?void 0:s.schedulerConfig)==null||a.set("action","edit")):((c=(d=this.stores)==null?void 0:d.schedulerConfig)==null||c.set("selectedConfiguration",{}),(h=(l=this.stores)==null?void 0:l.schedulerConfig)==null||h.set("action",null))}updateLocalization(r){r&&(Object.keys(r).forEach(t=>{t in constants3d8016e3.LANGUAGE_CODE&&index.instance.addResourceBundle(t,"translation",r[t],!1,!0)}),this.langVersion++)}updateNylasBranding(r){var t,n;(n=(t=this.stores)==null?void 0:t.schedulerConfig)==null||n.set("nylasBranding",r)}updateExperimentalFeatures(r){var t,n;(n=(t=this.stores)==null?void 0:t.schedulerConfig)==null||n.set("experimentalFeatures",r)}async store(){var r;return(r=this.stores)==null?void 0:r.schedulerConfig}async schedulerConnector(){return this.nylasSchedulerConfigConnector}async registerComponentHandler(r){var t;(t=this.baseProvider)==null||t.registerComponent(r.detail)}async unregisterComponentHandler(r){var t;(t=this.baseProvider)==null||t.unregisterComponent(r.detail)}nylasFormDropdownChangedHandler(r){var s,a;const{name:t,value:n}=r.detail;t==="language"&&(this.selectedLanguage=constants3d8016e3.LANGUAGE_CODE[n],index.instance.changeLanguage(this.selectedLanguage),(a=(s=this.stores)==null?void 0:s.schedulerConfig)==null||a.set("selectedLanguage",this.selectedLanguage))}async loggedInHandler(r){var t,n,s,a,d,c,l;if((n=(t=this.stores)==null?void 0:t.schedulerConfig)==null||n.set("currentUser",r),!!this.nylasSchedulerConfigConnector&&(await((s=this.nylasSchedulerConfigConnector.schedulerConfig)==null?void 0:s.getCalendars()),this.configurationId)){const h=await((a=this.nylasSchedulerConfigConnector.schedulerConfig)==null?void 0:a.getConfigurationById(this.configurationId));h&&((d=h[0])!=null&&d.id)&&((l=(c=this.stores)==null?void 0:c.schedulerConfig)==null||l.set("action","edit"))}}render(){var a,d,c,l,h,u,g,f,y,p,m,S,b,v,R,T,O,P,N,k,A,x,_,U,w,L,$,X,j,z,Y,M,V,J,W,Z,Q,ee,te,ne,se,ie,re,oe,ae,de,le,ce,he,ue,fe,ge,pe,ye,me,xe;const r=this.host.querySelector('[slot="custom-page-style-inputs"]'),t=(c=(d=(a=this.stores)==null?void 0:a.schedulerConfig)==null?void 0:d.state.selectedConfiguration)==null?void 0:c.id,n=Object.keys(constants3d8016e3.LANGUAGE_MAP).map(q=>({label:constants3d8016e3.LANGUAGE_MAP[q],value:q})),s=((h=(l=this.stores)==null?void 0:l.schedulerConfig)==null?void 0:h.state.selectedEventType)===constants3d8016e3.CONFIGURATION_EVENT_TYPE.group||((f=(g=(u=this.stores)==null?void 0:u.schedulerConfig)==null?void 0:g.state.selectedConfiguration)==null?void 0:f.type)===constants3d8016e3.CONFIGURATION_EVENT_TYPE.group;return index.h(index.Host,{key:"0053ea345fb1297974b68e859adc7caf738f0f35"},index.h("div",{key:"e3059c866be7f1d804b451fb54e01a5c219019b1",class:"scheduler-editor-header",part:"nse__header"},index.h("h1",{key:"56712052dd6fe1b8ff8a428c8ad3f0f491beac23",class:"scheduler-editor-title",part:"nse__title"},index.h("calendar-icon",{key:"dfe74ae46374c05c480b419124ba2055606b400a",width:"18",height:"18"}),index.instance.t("schedulerEditorTitle")),index.h("div",{key:"f4ba96f86e1e6e79d720273e0808d87528d74fc1",class:{language:!0},part:"nse__language"},index.h("select-dropdown",{key:"3bfe4634f550553f0e2002aa5fec9b39b1cd9e75",name:"language",options:n,withChevron:!1,defaultSelectedOption:n.find(q=>q.value==this.selectedLanguage),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},index.h("span",{key:"9926723981f56a7606ff94f213215e93bf51c472",slot:"select-icon"},index.h("translate-icon",{key:"d22a01ac1cef04ff5f2015c2cc73932c6fd7885c",width:"20",height:"20"})))),index.h("button",{key:"8f256e2b3978b33a0887bd3af8c987ab2b6b5782",class:"scheduler-editor-close",title:"logout",onClick:q=>this.handleSchedulerConfigCloseClicked(q),part:"nse__close-button"},index.h("close-icon",{key:"acd07b2fc1509f11440f4ad5047d20b3693e0750",width:"18",height:"18"}))),index.h("div",{key:"d39be68578574cbba4993ca63d2a8f087cecff04",class:{"scheduler-editor-content":!0,"scheduler-editor-content--group_feature_enabled":!!((m=(p=(y=this.stores)==null?void 0:y.schedulerConfig)==null?void 0:p.state.experimentalFeatures)!=null&&m[constants3d8016e3.EXPERIMENTAL_FEATURES.group_events]),"scheduler-editor-content--group":s},part:"nse__content"},((b=(S=this.stores)==null?void 0:S.schedulerConfig)==null?void 0:b.state.currentUser)&&this.stores.schedulerConfig.state.action===null&&index.h("div",{class:"list-configurations",part:"nse__list-configurations"},index.h("nylas-list-configurations",{exportparts:"nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete"})),((R=(v=this.stores)==null?void 0:v.schedulerConfig)==null?void 0:R.state.currentUser)&&this.stores.schedulerConfig.state.action==="create-select"&&((P=(O=(T=this.stores)==null?void 0:T.schedulerConfig)==null?void 0:O.state.experimentalFeatures)==null?void 0:P[constants3d8016e3.EXPERIMENTAL_FEATURES.group_events])&&index.h("nylas-select-event-type",null),((k=(N=this.stores)==null?void 0:N.schedulerConfig)==null?void 0:k.state.currentUser)&&this.stores.schedulerConfig.state.action==="create"&&s&&index.h("nylas-editor-tabs-group",{mode:"composable"},index.h(ExpressFlow,{experimentalFeatures:(_=(x=(A=this.stores)==null?void 0:A.schedulerConfig)==null?void 0:x.state)==null?void 0:_.experimentalFeatures,selectedEventType:((L=(w=(U=this.stores)==null?void 0:U.schedulerConfig)==null?void 0:w.state)==null?void 0:L.selectedEventType)||constants3d8016e3.CONFIGURATION_EVENT_TYPE.one_on_one,currentUser:(X=($=this.stores)==null?void 0:$.schedulerConfig)==null?void 0:X.state.currentUser,calendars:(Y=(z=(j=this.stores)==null?void 0:j.schedulerConfig)==null?void 0:z.state)==null?void 0:Y.calendars,selectedConfiguration:(J=(V=(M=this.stores)==null?void 0:M.schedulerConfig)==null?void 0:V.state)==null?void 0:J.selectedConfiguration})),((Z=(W=this.stores)==null?void 0:W.schedulerConfig)==null?void 0:Z.state.currentUser)&&this.stores.schedulerConfig.state.action==="create"&&!s&&index.h("nylas-editor-tabs",{mode:"composable"},index.h(ExpressFlow,{experimentalFeatures:(te=(ee=(Q=this.stores)==null?void 0:Q.schedulerConfig)==null?void 0:ee.state)==null?void 0:te.experimentalFeatures,selectedEventType:((ie=(se=(ne=this.stores)==null?void 0:ne.schedulerConfig)==null?void 0:se.state)==null?void 0:ie.selectedEventType)||constants3d8016e3.CONFIGURATION_EVENT_TYPE.one_on_one,currentUser:(oe=(re=this.stores)==null?void 0:re.schedulerConfig)==null?void 0:oe.state.currentUser,calendars:(le=(de=(ae=this.stores)==null?void 0:ae.schedulerConfig)==null?void 0:de.state)==null?void 0:le.calendars,selectedConfiguration:(ue=(he=(ce=this.stores)==null?void 0:ce.schedulerConfig)==null?void 0:he.state)==null?void 0:ue.selectedConfiguration})),((ge=(fe=this.stores)==null?void 0:fe.schedulerConfig)==null?void 0:ge.state.currentUser)&&this.stores.schedulerConfig.state.action==="edit"&&s&&index.h("nylas-editor-tabs-group",{key:t,mode:this.mode},this.mode==="composable"&&index.h("slot",null),this.mode==="app"&&r&&index.h("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:t},index.h("slot",{name:"custom-page-style-inputs"}))),((ye=(pe=this.stores)==null?void 0:pe.schedulerConfig)==null?void 0:ye.state.currentUser)&&this.stores.schedulerConfig.state.action==="edit"&&!s&&index.h("nylas-editor-tabs",{key:t,mode:this.mode},this.mode==="composable"&&index.h("slot",null),this.mode==="app"&&r&&index.h("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:t},index.h("slot",{name:"custom-page-style-inputs"}))),!((xe=(me=this.stores)==null?void 0:me.schedulerConfig)!=null&&xe.state.currentUser)&&index.h("slot",{name:"login-required"},index.h(LoginRequired,{authenticationUrl:this.authenticationUrl}))))}get host(){return index.getElement(this)}static get watchers(){return{configurationId:["configurationIdChanged"],localization:["updateLocalization"],nylasBranding:["updateNylasBranding"],experimentalFeatures:["updateExperimentalFeatures"]}}};NylasSchedulerEditor.style=NylasSchedulerEditorStyle0;exports.nylas_scheduler_editor=NylasSchedulerEditor;
|
package/dist/{nylas-scheduler-editor.entry-e35fad5c.js → nylas-scheduler-editor.entry-78fe5abf.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var P = (r, t, n) => (
|
|
4
|
-
import { b as dayjs, u as utc, t as timezone, p as process, e as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, i as instance, h, H as Host, g as getElement, B as Buffer, F as Fragment, f as dataResponse, j as getCalendarRange } from "./index-
|
|
5
|
-
import { N as NylasBaseProvider, X as Xr } from "./index.es-
|
|
6
|
-
import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-d6729d8d-
|
|
7
|
-
import { L as LANGUAGE_CODE, a as LANGUAGE_MAP, C as CONFIGURATION_EVENT_TYPE, E as EXPERIMENTAL_FEATURES } from "./constants-
|
|
1
|
+
var _e = Object.defineProperty;
|
|
2
|
+
var be = (r, t, n) => t in r ? _e(r, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[t] = n;
|
|
3
|
+
var P = (r, t, n) => (be(r, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import { b as dayjs, u as utc, t as timezone, p as process, e as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, i as instance, h, H as Host, g as getElement, B as Buffer, F as Fragment, f as dataResponse, j as getCalendarRange } from "./index-78390f2e.js";
|
|
5
|
+
import { N as NylasBaseProvider, X as Xr } from "./index.es-4a203e8e-cf485db5.js";
|
|
6
|
+
import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-d6729d8d-854b5da8.js";
|
|
7
|
+
import { L as LANGUAGE_CODE, a as LANGUAGE_MAP, C as CONFIGURATION_EVENT_TYPE, E as EXPERIMENTAL_FEATURES } from "./constants-3d8016e3-3c080f00.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "react/jsx-runtime";
|
|
10
10
|
import "react-dom";
|
|
@@ -219,7 +219,7 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
219
219
|
return this.updateGroupEventById({
|
|
220
220
|
...t,
|
|
221
221
|
id: d,
|
|
222
|
-
|
|
222
|
+
recurrence: l ? void 0 : t.recurrence
|
|
223
223
|
}, s);
|
|
224
224
|
if (n === "future" && l) {
|
|
225
225
|
const S = await this.createGroupEvent(t, s), v = {
|
|
@@ -229,7 +229,7 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
229
229
|
description: (U = a == null ? void 0 : a.event) == null ? void 0 : U.description,
|
|
230
230
|
capacity: (N = a == null ? void 0 : a.group_event_info) == null ? void 0 : N.capacity,
|
|
231
231
|
calendar_id: (O = a == null ? void 0 : a.event) == null ? void 0 : O.calendar_id,
|
|
232
|
-
|
|
232
|
+
recurrence: f ? [f + ";UNTIL=" + p] : [`RRULE:FREQ=DAILY;UNTIL=${p}`]
|
|
233
233
|
};
|
|
234
234
|
return await this.updateGroupEventById({
|
|
235
235
|
...v,
|
|
@@ -268,7 +268,7 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
268
268
|
description: (N = a == null ? void 0 : a.event) == null ? void 0 : N.description,
|
|
269
269
|
capacity: (O = a == null ? void 0 : a.group_event_info) == null ? void 0 : O.capacity,
|
|
270
270
|
calendar_id: (I = a == null ? void 0 : a.event) == null ? void 0 : I.calendar_id,
|
|
271
|
-
|
|
271
|
+
recurrence: f ? [f + ";UNTIL=" + p] : [`RRULE:UNTIL=${p}`]
|
|
272
272
|
};
|
|
273
273
|
if (n === "this" && d)
|
|
274
274
|
return this.deleteGroupEventById(d, s);
|
|
@@ -1504,8 +1504,8 @@ const LoginRequired = ({ authenticationUrl: r }) => h(
|
|
|
1504
1504
|
h("small", { class: "disclaimer-text", part: "nse__login-required-disclaimer-text" }, "* You will be redirected to authenticate your account.")
|
|
1505
1505
|
)
|
|
1506
1506
|
);
|
|
1507
|
-
function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n }) {
|
|
1508
|
-
const
|
|
1507
|
+
function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n, experimentalFeatures: s }) {
|
|
1508
|
+
const a = (t == null ? void 0 : t.find((d) => d.is_primary)) || (t == null ? void 0 : t[0]), l = (s == null ? void 0 : s[EXPERIMENTAL_FEATURES.group_events]) || !1;
|
|
1509
1509
|
switch (n) {
|
|
1510
1510
|
case CONFIGURATION_EVENT_TYPE.one_on_one:
|
|
1511
1511
|
case CONFIGURATION_EVENT_TYPE.max_availability:
|
|
@@ -1524,8 +1524,8 @@ function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n }) {
|
|
|
1524
1524
|
h("nylas-event-location", { userProvider: r.provider })
|
|
1525
1525
|
)
|
|
1526
1526
|
),
|
|
1527
|
-
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar:
|
|
1528
|
-
h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
1527
|
+
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: a == null ? void 0 : a.id }),
|
|
1528
|
+
!l && h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
1529
1529
|
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
|
|
1530
1530
|
);
|
|
1531
1531
|
case CONFIGURATION_EVENT_TYPE.collective:
|
|
@@ -1543,8 +1543,8 @@ function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n }) {
|
|
|
1543
1543
|
h("nylas-event-location", { userProvider: r.provider })
|
|
1544
1544
|
)
|
|
1545
1545
|
),
|
|
1546
|
-
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar:
|
|
1547
|
-
h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
1546
|
+
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: a == null ? void 0 : a.id }),
|
|
1547
|
+
!l && h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
1548
1548
|
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
|
|
1549
1549
|
h("nylas-additional-participants", { name: "participants", eventParticipants: [{ name: (r == null ? void 0 : r.name) || (r == null ? void 0 : r.email), email: (r == null ? void 0 : r.email) || "", is_organizer: !0 }], exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" })
|
|
1550
1550
|
);
|
|
@@ -1565,9 +1565,9 @@ function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n }) {
|
|
|
1565
1565
|
h("nylas-event-capacity", null)
|
|
1566
1566
|
)
|
|
1567
1567
|
),
|
|
1568
|
-
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar:
|
|
1568
|
+
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: a == null ? void 0 : a.id }),
|
|
1569
1569
|
h("nylas-additional-participants", { name: "participants", eventParticipants: [{ name: (r == null ? void 0 : r.name) || (r == null ? void 0 : r.email), email: (r == null ? void 0 : r.email) || "", is_organizer: !0 }], exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" }),
|
|
1570
|
-
h("nylas-page-name", { pageName: "Group events page" }),
|
|
1570
|
+
h("nylas-page-name", { requirePageName: !0, pageName: "Group events page" }),
|
|
1571
1571
|
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
|
|
1572
1572
|
);
|
|
1573
1573
|
}
|
|
@@ -1697,7 +1697,7 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1697
1697
|
}
|
|
1698
1698
|
}
|
|
1699
1699
|
render() {
|
|
1700
|
-
var a, l, d, c, u, f, p, g, m, y, w, b, x, R, A, k, U, N, O, I, T, S, v, L, _, X, $, j, z, Y, M, V, J, W, Z, Q, ee, te, ne, se, re, ie, oe, ae, le, ce, de, he, ue, fe;
|
|
1700
|
+
var a, l, d, c, u, f, p, g, m, y, w, b, x, R, A, k, U, N, O, I, T, S, v, L, _, X, $, j, z, Y, M, V, J, W, Z, Q, ee, te, ne, se, re, ie, oe, ae, le, ce, de, he, ue, fe, ge, pe, ye, me, we, Se;
|
|
1701
1701
|
const r = this.host.querySelector('[slot="custom-page-style-inputs"]'), t = (d = (l = (a = this.stores) == null ? void 0 : a.schedulerConfig) == null ? void 0 : l.state.selectedConfiguration) == null ? void 0 : d.id, n = Object.keys(LANGUAGE_MAP).map((q) => ({
|
|
1702
1702
|
label: LANGUAGE_MAP[q],
|
|
1703
1703
|
value: q
|
|
@@ -1708,7 +1708,7 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1708
1708
|
"scheduler-editor-content": !0,
|
|
1709
1709
|
"scheduler-editor-content--group_feature_enabled": !!((w = (y = (m = this.stores) == null ? void 0 : m.schedulerConfig) == null ? void 0 : y.state.experimentalFeatures) != null && w[EXPERIMENTAL_FEATURES.group_events]),
|
|
1710
1710
|
"scheduler-editor-content--group": s
|
|
1711
|
-
}, part: "nse__content" }, ((x = (b = this.stores) == null ? void 0 : b.schedulerConfig) == null ? void 0 : x.state.currentUser) && this.stores.schedulerConfig.state.action === null && h("div", { class: "list-configurations", part: "nse__list-configurations" }, h("nylas-list-configurations", { exportparts: "nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" })), ((A = (R = this.stores) == null ? void 0 : R.schedulerConfig) == null ? void 0 : A.state.currentUser) && this.stores.schedulerConfig.state.action === "create-select" && ((N = (U = (k = this.stores) == null ? void 0 : k.schedulerConfig) == null ? void 0 : U.state.experimentalFeatures) == null ? void 0 : N[EXPERIMENTAL_FEATURES.group_events]) && h("nylas-select-event-type", null), ((I = (O = this.stores) == null ? void 0 : O.schedulerConfig) == null ? void 0 : I.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && s && h("nylas-editor-tabs-group", { mode: "composable" }, h(ExpressFlow, {
|
|
1711
|
+
}, part: "nse__content" }, ((x = (b = this.stores) == null ? void 0 : b.schedulerConfig) == null ? void 0 : x.state.currentUser) && this.stores.schedulerConfig.state.action === null && h("div", { class: "list-configurations", part: "nse__list-configurations" }, h("nylas-list-configurations", { exportparts: "nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" })), ((A = (R = this.stores) == null ? void 0 : R.schedulerConfig) == null ? void 0 : A.state.currentUser) && this.stores.schedulerConfig.state.action === "create-select" && ((N = (U = (k = this.stores) == null ? void 0 : k.schedulerConfig) == null ? void 0 : U.state.experimentalFeatures) == null ? void 0 : N[EXPERIMENTAL_FEATURES.group_events]) && h("nylas-select-event-type", null), ((I = (O = this.stores) == null ? void 0 : O.schedulerConfig) == null ? void 0 : I.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && s && h("nylas-editor-tabs-group", { mode: "composable" }, h(ExpressFlow, { experimentalFeatures: (v = (S = (T = this.stores) == null ? void 0 : T.schedulerConfig) == null ? void 0 : S.state) == null ? void 0 : v.experimentalFeatures, selectedEventType: ((X = (_ = (L = this.stores) == null ? void 0 : L.schedulerConfig) == null ? void 0 : _.state) == null ? void 0 : X.selectedEventType) || CONFIGURATION_EVENT_TYPE.one_on_one, currentUser: (j = ($ = this.stores) == null ? void 0 : $.schedulerConfig) == null ? void 0 : j.state.currentUser, calendars: (M = (Y = (z = this.stores) == null ? void 0 : z.schedulerConfig) == null ? void 0 : Y.state) == null ? void 0 : M.calendars, selectedConfiguration: (W = (J = (V = this.stores) == null ? void 0 : V.schedulerConfig) == null ? void 0 : J.state) == null ? void 0 : W.selectedConfiguration })), ((Q = (Z = this.stores) == null ? void 0 : Z.schedulerConfig) == null ? void 0 : Q.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && !s && h("nylas-editor-tabs", { mode: "composable" }, h(ExpressFlow, { experimentalFeatures: (ne = (te = (ee = this.stores) == null ? void 0 : ee.schedulerConfig) == null ? void 0 : te.state) == null ? void 0 : ne.experimentalFeatures, selectedEventType: ((ie = (re = (se = this.stores) == null ? void 0 : se.schedulerConfig) == null ? void 0 : re.state) == null ? void 0 : ie.selectedEventType) || CONFIGURATION_EVENT_TYPE.one_on_one, currentUser: (ae = (oe = this.stores) == null ? void 0 : oe.schedulerConfig) == null ? void 0 : ae.state.currentUser, calendars: (de = (ce = (le = this.stores) == null ? void 0 : le.schedulerConfig) == null ? void 0 : ce.state) == null ? void 0 : de.calendars, selectedConfiguration: (fe = (ue = (he = this.stores) == null ? void 0 : he.schedulerConfig) == null ? void 0 : ue.state) == null ? void 0 : fe.selectedConfiguration })), ((pe = (ge = this.stores) == null ? void 0 : ge.schedulerConfig) == null ? void 0 : pe.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && s && h("nylas-editor-tabs-group", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), ((me = (ye = this.stores) == null ? void 0 : ye.schedulerConfig) == null ? void 0 : me.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && !s && h("nylas-editor-tabs", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), !((Se = (we = this.stores) == null ? void 0 : we.schedulerConfig) != null && Se.state.currentUser) && h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl }))));
|
|
1712
1712
|
}
|
|
1713
1713
|
get host() {
|
|
1714
1714
|
return getElement(this);
|