@nylas/react 1.1.0-canary.4 → 1.1.0-canary.7
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/elements/index.d.ts +1 -0
- package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-6078b875.js} +1 -1
- package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-96e197ca.cjs} +1 -1
- package/dist/focus-visible-e8093c16-018ffd63.cjs +1 -0
- package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-ab01d60a.js} +5 -3
- package/dist/index-1fd24ccf.js +3582 -0
- package/dist/index-823fdc6f.cjs +36 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +53 -52
- package/package.json +3 -3
- package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
- package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
- package/dist/add-circle-icon_22.entry-077661c3.cjs +0 -1
- package/dist/add-circle-icon_22.entry-f699d91e.js +0 -1733
- package/dist/archive-icon_7.entry-40b7ef3b.js +0 -75
- package/dist/archive-icon_7.entry-e8630de9.cjs +0 -1
- package/dist/arrow-icon.entry-58246303.js +0 -15
- package/dist/arrow-icon.entry-ffa53114.cjs +0 -1
- package/dist/bold-icon_3.entry-106a4e77.cjs +0 -1
- package/dist/bold-icon_3.entry-f5f1643d.js +0 -35
- package/dist/calendar-cancel-icon.entry-6ae0fd0f.cjs +0 -1
- package/dist/calendar-cancel-icon.entry-75b15b19.js +0 -15
- package/dist/calendar-check-icon_2.entry-57339318.js +0 -25
- package/dist/calendar-check-icon_2.entry-c57f83f3.cjs +0 -1
- package/dist/calendar-icon.entry-2069fec6.js +0 -15
- package/dist/calendar-icon.entry-492c2630.cjs +0 -1
- package/dist/chevron-icon_3.entry-83df50c3.js +0 -117
- package/dist/chevron-icon_3.entry-878ff6df.cjs +0 -1
- package/dist/close-icon.entry-480c199d.js +0 -15
- package/dist/close-icon.entry-8015ca05.cjs +0 -1
- package/dist/constants-6ee60d6d-4cd16450.js +0 -3740
- package/dist/constants-6ee60d6d-6c0540db.cjs +0 -15
- package/dist/document-refresh-icon.entry-06f7972b.cjs +0 -1
- package/dist/document-refresh-icon.entry-09870b14.js +0 -15
- package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
- package/dist/forward-icon_6.entry-8bb201eb.js +0 -955
- package/dist/forward-icon_6.entry-eeecf2a2.cjs +0 -3
- package/dist/globe-icon.entry-a690028c.cjs +0 -1
- package/dist/globe-icon.entry-d515cbfa.js +0 -15
- package/dist/google-logo-icon_3.entry-2164cec1.js +0 -258
- package/dist/google-logo-icon_3.entry-b2b85284.cjs +0 -1
- package/dist/index-2b8437d6.cjs +0 -30
- package/dist/index-db0c5017.js +0 -1824
- package/dist/index.es-2578c6a5-098d48d0.cjs +0 -7
- package/dist/index.es-2578c6a5-71441142.js +0 -3133
- package/dist/info-icon_2.entry-300ef196.js +0 -34
- package/dist/info-icon_2.entry-e286aaa5.cjs +0 -1
- package/dist/loading-icon.entry-6d8adaa4.js +0 -15
- package/dist/loading-icon.entry-dc40e97d.cjs +0 -1
- package/dist/mailbox-store-bb21512c-649a374c.js +0 -381
- package/dist/mailbox-store-bb21512c-fc3c8c03.cjs +0 -1
- package/dist/nylas-additional-participants.entry-4afba192.js +0 -83
- package/dist/nylas-additional-participants.entry-db05e510.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-1ebbe0c0.js +0 -784
- package/dist/nylas-booked-event-card_10.entry-6b6fdfae.cjs +0 -1
- package/dist/nylas-form-card.entry-70b20571.cjs +0 -1
- package/dist/nylas-form-card.entry-7bc23695.js +0 -56
- package/dist/nylas-if-state.entry-3829cb3d.js +0 -96
- package/dist/nylas-if-state.entry-ebeffe22.cjs +0 -1
- package/dist/nylas-list-folders.entry-191688f2.cjs +0 -1
- package/dist/nylas-list-folders.entry-7347e78d.js +0 -122
- package/dist/nylas-list-threads.entry-432a8d8c.js +0 -72
- package/dist/nylas-list-threads.entry-44658578.cjs +0 -1
- package/dist/nylas-login.entry-5311f0a7.js +0 -75
- package/dist/nylas-login.entry-db17a3d2.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-20150fb2.js +0 -103
- package/dist/nylas-mailbox-pagination.entry-9d3f5baa.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-6c0f7299.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-eec426d5.js +0 -84
- package/dist/nylas-mailbox.entry-b6c758b9.js +0 -136
- package/dist/nylas-mailbox.entry-d41401e0.cjs +0 -1
- package/dist/nylas-provider.entry-271cafd2.js +0 -147
- package/dist/nylas-provider.entry-6173b721.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-0c75d39e.cjs +0 -7
- package/dist/nylas-scheduler-editor.entry-b51ad4b1.js +0 -2192
- package/dist/nylas-scheduling.entry-081c8825.cjs +0 -1
- package/dist/nylas-scheduling.entry-0a8d1da8.js +0 -237
- package/dist/nylas-threads-refresh.entry-72dd854e.js +0 -76
- package/dist/nylas-threads-refresh.entry-c3509e6a.cjs +0 -1
- package/dist/nylas-threads-search.entry-16a59ef6.cjs +0 -1
- package/dist/nylas-threads-search.entry-4750a187.js +0 -71
- package/dist/nylas-view-thread.entry-27df3349.cjs +0 -1
- package/dist/nylas-view-thread.entry-c6adce43.js +0 -205
- package/dist/people-icon.entry-342be0c8.js +0 -15
- package/dist/people-icon.entry-35252ca9.cjs +0 -1
- package/dist/play-icon_2.entry-0787352c.js +0 -25
- package/dist/play-icon_2.entry-f83fa92a.cjs +0 -1
- package/dist/refresh-icon.entry-8fbabfe7.js +0 -15
- package/dist/refresh-icon.entry-ddbc5446.cjs +0 -1
- package/dist/register-component-dc659dc3-e43e8fae.js +0 -105
- package/dist/register-component-dc659dc3-fb85ee68.cjs +0 -1
- package/dist/scheduler-config-store-51ee4f42-66f8c2ac.js +0 -14
- package/dist/scheduler-config-store-51ee4f42-d7d9c25d.cjs +0 -1
- package/dist/scheduler-store-72116723-ce4c7a69.cjs +0 -1
- package/dist/scheduler-store-72116723-e5f87122.js +0 -294
- package/dist/time-period-selector.entry-333942a8.js +0 -78
- package/dist/time-period-selector.entry-78d5b3c2.cjs +0 -1
- package/dist/translate-icon.entry-87a62108.js +0 -15
- package/dist/translate-icon.entry-cb19864c.cjs +0 -1
- package/dist/utils-c00bdc3c-89ab163d.js +0 -2111
- package/dist/utils-c00bdc3c-94b9c3b6.cjs +0 -8
- package/dist/warning-icon.entry-50755d91.cjs +0 -1
- package/dist/warning-icon.entry-7a72e24a.js +0 -15
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-2b8437d6.cjs"),b=require("./register-component-dc659dc3-fb85ee68.cjs"),c=require("./utils-c00bdc3c-94b9c3b6.cjs"),d=require("./constants-6ee60d6d-6c0540db.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const q=':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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 0;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:1rem;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}',V=q;var G=function(e,t,n,s){var o=arguments.length,i=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},g=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const I=class{constructor(e){a.registerInstance(this,e),this.cancelBookingButtonClicked=a.createEvent(this,"cancelBookingButtonClicked",7),this.rescheduleButtonClicked=a.createEvent(this,"rescheduleButtonClicked",7),this.rescheduleBookedEventError=a.createEvent(this,"rescheduleBookedEventError",7),this.handleCancelBookingButtonClicked=()=>{this.cancelBookingButtonClicked.emit({bookingId:this.eventInfo.booking_id})},this.handleRescheduleButtonClicked=()=>{const t=n=>{this.rescheduleBookedEventError.emit(n)};this.rescheduleButtonClicked.emit({bookingId:this.eventInfo.booking_id,errorHandler:t})},this.getOrganizer=t=>t==null?void 0:t.organizer,this.getPaticipantType=t=>{switch(t){case"host":return"Host";case"you":return"You";default:return""}},this.eventInfo=void 0,this.rescheduleBookingId=void 0,this.bookingInfo=void 0,this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.selectedTimeslot=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){c.debug("[nylas-booked-event-card] Component will load")}async componentDidLoad(){c.debug("[nylas-booked-event-card] Component did load")}render(){var e,t,n,s,o,i;return a.h(a.Host,{key:"1585329ee957e66c757861d989d29a9c1bb1451f",part:"nbec"},a.h("sp-theme",{key:"113da8c82dd485188d40f1dea9f814be0c408ca2",theme:"spectrum",color:"dark",scale:"medium"},a.h("div",{key:"af6b0a085e582f2d7bdb5503b9d5b6d3c7042fd3",class:"booked-event-timezone"},a.h("globe-icon",{key:"0c3fbff398a24c97d82bb74434d9da574349919f"}),d.TIMEZONE_MAP[this.selectedTimezone]),a.h("div",{key:"136d5341ef1d252b525359418e8df0a43f4160a0",class:"event-card-wrapper",part:"nbec__card"},a.h("div",{key:"767bcbb50f4ae8c294f3ab3733fe99cd7c4c78e1",class:"calendar-icon"},a.h("calendar-check-icon",{key:"e6fd3ec502795fbcaaf9d34b5b5c4cee2d732d4f"})),a.h("div",{key:"7dfa8cc7719760d396716ec81ab0022c01bbe22f",class:"booked-event-header"},a.h("h2",{key:"34a452c275a3880f64575735a9e67db5a8cdea45",slot:"card-title",part:"nbec__title"},"Booking ",this.rescheduleBookingId?"rescheduled":"confirmed","!"),a.h("div",{key:"a081b1a3791e2e80dd651d1f9dbf5de2f2057f9a",part:"nbec__description"},((e=this.getOrganizer(this.eventInfo))==null?void 0:e.name)||((t=this.getOrganizer(this.eventInfo))==null?void 0:t.email)," & ",((s=(n=this.bookingInfo)==null?void 0:n.primaryParticipant)==null?void 0:s.name)||((i=(o=this.bookingInfo)==null?void 0:o.primaryParticipant)==null?void 0:i.email))),a.h("sp-divider",{key:"0744f0fa4f3fff8f2dc0dec978632496d26bfae6"}),a.h("div",{key:"38460fbfbe5d19b4f0d48cb0df02e6d12c2f2740",class:"booking-date-time"},a.h("checkmark-circle-icon",{key:"1e282c329489e4def089d8fca1bd532557f91b92"}),a.h("h3",{key:"34bebd074562352d54628f763c339ccd4c44918a"},"Booking date and time"),a.h("p",{key:"d897859d30e6dd6651c0d4b0079bf0eab1df0356"},new Date(this.selectedTimeslot.start_time).toLocaleDateString(void 0,{dateStyle:"full"})," ",a.h("br",{key:"2aa56898e654721616459102329cbe498232d3e8"}),new Date(this.selectedTimeslot.start_time).toLocaleTimeString(void 0,{timeStyle:"short"})," -"," ",new Date(this.selectedTimeslot.end_time).toLocaleTimeString(void 0,{timeStyle:"short"}))),a.h("div",{key:"5009ca55f795c2fd1240ed8bbc50216c4e66be87",class:"booking-participants"}),a.h("sp-divider",{key:"4b5b4325dda3f935387218429823b850d2a12f0e"}),a.h("div",{key:"d25cc602a134085c19f0acea006db0707ceae7e5",class:"footer"},a.h("sp-button",{key:"4625e515f2f79d6ecb0bb37813efe100c03cdaf2",variant:"secondary",treatment:"outline",class:"cancel",onClick:this.handleCancelBookingButtonClicked,part:"nbec__button-outline nbec__cancel-cta"},"Cancel booking"),a.h("sp-button",{key:"9cbdc95cd53aa2d536751984b91ef5974e71179d",variant:"secondary",treatment:"outline",class:"reschedule",onClick:this.handleRescheduleButtonClicked,part:"nbec__button-outline nbec__reschedule-cta"},"Reschedule")))))}};G([b.RegisterComponent({name:"nylas-booked-event-card",stateToProps:new Map([["scheduler.bookingInfo","bookingInfo"],["scheduler.rescheduleBookingId","rescheduleBookingId"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.selectedTimeslot","selectedTimeslot"]]),eventToProps:{cancelBookingButtonClicked:async(e,t)=>{t.scheduler.setCancel(e.detail.bookingId)},rescheduleButtonClicked:async(e,t)=>{const n=await t.scheduler.setReschedule(e.detail.bookingId),{errorHandler:s}=e.detail;s&&(!n||"error"in n)&&s(n)}},fireRegisterEvent:!0}),g("design:type",Function),g("design:paramtypes",[]),g("design:returntype",void 0)],I.prototype,"render",null);I.style=V;const U=':host{display:block;height:100%;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family)}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}',W=U;var X=function(e,t,n,s){var o=arguments.length,i=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},v=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const k=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,S=class{constructor(e){a.registerInstance(this,e),this.nameChanged=a.createEvent(this,"nameChanged",7),this.emailChanged=a.createEvent(this,"emailChanged",7),this.backButtonClicked=a.createEvent(this,"backButtonClicked",7),this.detailsConfirmed=a.createEvent(this,"detailsConfirmed",7),this.bookingFormError=a.createEvent(this,"bookingFormError",7),this.handleGuestChange=(t,n)=>{this.resetGuestEmailError(t);const s=[...this.guestEmails];s[t]=n,this.guestEmails=[...s]},this.handleGuestBlur=(t,n)=>{if(this.resetGuestEmailError(t),n===""){this.guestEmailErrors[t]="Email is required";return}if(!k.test(n)){this.guestEmailErrors[t]="Enter a valid email address";return}this.handleGuestChange(t,n)},this.addGuestButtonClickedHandler=()=>{this.guestEmails=[...this.guestEmails,""]},this.removeGuestButtonClickHandler=(t,n)=>{t.preventDefault(),this.resetGuestEmailError(n);const s=[...this.guestEmails];s.splice(n,1),this.guestEmails=[...s]},this.handleBackButtonClicked=()=>{this.backButtonClicked.emit()},this.bookButtonClickedHandler=async t=>{var i,r,l,f,h,N,F;t.preventDefault(),c.debug("nylas-booking-form","bookButtonClickedHandler",this.bookingInfo);const n=this.name||((r=(i=this.bookingInfo)==null?void 0:i.primaryParticipant)==null?void 0:r.name),s=this.email||((f=(l=this.bookingInfo)==null?void 0:l.primaryParticipant)==null?void 0:f.email);if(!n||n===""){this.isNameValid=!1,this.validationError.name="Name is required",this.bookingFormError.emit({title:"Booking form error",description:"Name is required"});return}if(!s||s===""){this.isEmailValid=!1,this.validationError.email="Email is required",this.bookingFormError.emit({title:"Booking form error",description:"Email is required"});return}if(!k.test(s)){this.isEmailValid=!1,this.validationError.email="Enter a valid email address",this.bookingFormError.emit({title:"Booking form error",description:"Invalid email"});return}let o=[];if(this.guestEmails.length>0){let u=!1;if(this.guestEmails.forEach((m,H)=>{m===""?(u=!0,this.guestEmailErrors={...this.guestEmailErrors,[H]:"Email is required"}):k.test(m)||(u=!0,this.guestEmailErrors={...this.guestEmailErrors,[H]:"Enter a valid email address"})}),u){this.bookingFormError.emit({title:"Booking form error",description:"Invalid guest email"});return}o=this.guestEmails.map(m=>({name:"",email:m.trim()}))}else(h=this.bookingInfo)!=null&&h.guests&&(o=(N=this.bookingInfo)==null?void 0:N.guests);this.detailsConfirmed.emit({primaryParticipant:{name:n,email:s},guests:o,additionalFields:{...(F=this.bookingInfo)==null?void 0:F.additionalFields}})},this.isLoading=void 0,this.bookingInfo=void 0,this.eventInfo=void 0,this.name="",this.email="",this.guestEmails=[],this.guestEmailErrors={},this.isNameValid=!0,this.isEmailValid=!0,this.validationError={name:"",email:""}}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){var e,t;c.debug("nylas-booking-form","componentWillLoad",this.bookingInfo),this.bookingInfo&&(this.name=(e=this.bookingInfo.primaryParticipant)==null?void 0:e.name,this.email=(t=this.bookingInfo.primaryParticipant)==null?void 0:t.email)}bookingInfoChangedHandler(e){e&&e.primaryParticipant&&(this.name=e.primaryParticipant.name,this.email=e.primaryParticipant.email)}changeName(e){this.isNameValid=!0,this.validationError.name="",this.name=e,this.nameChanged.emit(e)}changeEmail(e){this.isEmailValid=!0,this.validationError.email="",this.email=e,this.emailChanged.emit(e)}resetGuestEmailError(e){const t={...this.guestEmailErrors};delete t[e],this.guestEmailErrors={...t}}render(){return a.h(a.Host,{key:"5a255277a21fa84d100bb53d13bb9dce0ce58e24"},a.h("form",{key:"19b7aecb9223557f0ff9d4c062968c3242026f0c",onSubmit:e=>this.bookButtonClickedHandler(e),noValidate:!0},a.h("div",{key:"49276b2a59934eeaeb38c06db6968f957b7b9bee",class:"nylas-booking-form"},a.h("slot",{key:"ee0a8c29c1fb6b7273d6a2d3c8cb88180f0e9dbf",name:"custom-booking-form"},a.h("div",{key:"662e46f3a7925282f824547a069f52584b94d564",class:"input-wrapper"},a.h("label",{key:"a01c1903ee983e1555006ad14e75cd1b2c3036ff",htmlFor:"name",class:{"input-label":!0,error:!this.isNameValid},part:"nbf__input-label"},"Name ",a.h("span",{key:"4729d580bbf9d851c2ac8b686dc826c4e3e4616f",class:"required"},"*")),a.h("input",{key:"51754a63345f1d0332a38f646dde6a8a998c8dee",id:"name",type:"text",placeholder:"Enter your name",value:this.name,class:{input:!0,error:!this.isNameValid},part:"nbf__input-textfield",onInput:e=>{var t;return this.changeName((t=e.target)==null?void 0:t.value)}}),a.h("p",{key:"b8a6660e959a877421bdfffdb87279d8f09123b8",class:"help-text"},this.validationError.name)),a.h("div",{key:"e78a74e67abde7e61c1d3c555c234817770a4040",class:"input-wrapper"},a.h("label",{key:"d5507037f5c668f58e14031dba4276900ef5ed09",htmlFor:"email",class:{"input-label":!0,error:!this.isEmailValid},part:"nbf__input-label"},"Email ",a.h("span",{key:"514f00587069ac1cfc6d16bfd30750d6d501817d",class:"required"},"*")),a.h("input",{key:"0b80ded98b2174f783fa9e7c951a47661aa894f6",id:"email",type:"email",placeholder:"Enter your email",value:this.email,class:{input:!0,error:!this.isEmailValid},part:"nbf__input-textfield",onInput:e=>{var t;return this.changeEmail((t=e.target)==null?void 0:t.value)}}),a.h("p",{key:"ba185ccb2bec87049e94d8c5f8d211a838de0025",class:"help-text"},this.validationError.email)))),a.h("div",{key:"56e2cce79371533ad66cccad95a79dd8935fe3eb",class:"cta"},a.h("sp-button",{key:"2b6410b3cf2b7634737aa858396290ad065dfcfc",treatment:"outline",variant:"secondary",class:"back",part:"nbf__button-outline",onClick:this.handleBackButtonClicked},a.h("slot",{key:"4ba60a2fb3542434ede16ea382ec4ca80cb8d422",name:"booking-form-back-label"},"Back")),a.h("sp-button",{key:"49dd32531d7b55529bb73bc82eb0b91820c6ea33",variant:"primary",class:"book",part:"nbf__button-primary",type:"submit"},this.isLoading&&a.h("loading-icon",{slot:"icon"}),a.h("slot",{key:"a57ae44c1c3a1b020a110f0156435f27897410c6",name:"booking-form-book-label"},"Book now")))))}get host(){return a.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChangedHandler"]}}};X([b.RegisterComponent({name:"nylas-booking-form",stateToProps:new Map([["scheduler.isLoading","isLoading"],["scheduler.bookingInfo","bookingInfo"],["scheduler.eventInfo","eventInfo"]]),eventToProps:{backButtonClicked:async(e,t)=>{t.scheduler.toggleAdditionalData(!1)},nameChanged:async(e,t)=>{t.scheduler.setParticipantName(e.detail)},emailChanged:async(e,t)=>{t.scheduler.setParticipantEmail(e.detail)}},fireRegisterEvent:!0}),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",void 0)],S.prototype,"render",null);S.style=W;const Y=':host{display:block;width:400px;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}',J=Y;var K=function(e,t,n,s){var o=arguments.length,i=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},x=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const B=class{constructor(e){a.registerInstance(this,e),this.goBackButtonClicked=a.createEvent(this,"goBackButtonClicked",7),this.cancelBookingFormSubmitted=a.createEvent(this,"cancelBookingFormSubmitted",7),this.cancelBookedEventError=a.createEvent(this,"cancelBookedEventError",7),this.cancelBookingFormError=a.createEvent(this,"cancelBookingFormError",7),this.handleGoBackClicked=()=>{this.goBackButtonClicked.emit()},this.handleSubmitCancelBooking=t=>{if(t.preventDefault(),!this.cancellationReason){this.cancellationError="Please provide a reason for cancellation.",this.cancelBookingFormError.emit({title:"Cancel booking form error",description:"Please provide a reason for cancellation."});return}c.debug(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);const n=s=>{this.cancelBookedEventError.emit(s)};this.cancelBookingFormSubmitted.emit({bookingId:this.cancelBookingId,reason:this.cancellationReason,errorHandler:n})},this.handleOnChangeCancellationReason=t=>{this.cancellationError="",this.cancellationReason=t.target.value},this.cancelBookingId=void 0,this.cancellationReason="",this.cancellationError=""}connectedCallback(){c.debug("[nylas-cancel-booking-form] Component connected")}async componentWillLoad(){c.debug("[nylas-cancel-booking-form] Component will load")}async componentDidLoad(){c.debug("[nylas-cancel-booking-form] Component did load")}disconnectedCallback(){c.debug("[nylas-cancel-booking-form] Component disconnected")}render(){return a.h(a.Host,{key:"3e77b83049c0b9cd2ed968cc97e665017f76837e",part:"ncec"},a.h("sp-theme",{key:"857ac295df09b0f642eb1e9d01021531b935c7ad",theme:"spectrum",scale:"medium"},a.h("div",{key:"9f52787bc3efc81618e5eac14219c5674f4efe5a",class:"nylas-cancel-booking-form",part:"ncec__card"},a.h("div",{key:"07ddd2cd5664aacf4e123d822bde07af562a8571",class:"nylas-cancel-booking-form__calendar-icon",part:"ncec__icon"},a.h("calendar-cancel-icon",{key:"04ccbf1eb7ccd7d9053265e1991f8fd494b7e4ae"})),a.h("h3",{key:"2fdbd40021dae8eb98e4288793af8719d3cc6226",class:"nylas-cancel-booking-form__title",part:"ncec__title"},"Cancel booking?"),a.h("div",{key:"3af3918de0c111bcf90f6ad44a468efdcab185ac",class:"nylas-cancel-booking-form__description",part:"ncec__description"},"Your current timeslot will become available to others."),a.h("form",{key:"7e136e261b22e513b395e47dfc2db696aced945f",onSubmit:this.handleSubmitCancelBooking},a.h("sp-field-label",{key:"fa566625fafbc74f98bb7c012dcb1c71093c0227",for:"cancel-reason",class:this.cancellationError?"error":""},"Reason for cancellation ",a.h("span",{key:"fb567a86677bfc33c63b6118ed9ce71eed7a5084",class:"required"},"*")),a.h("sp-textfield",{key:"c585d1f070700a4ccb39d52fdc7dba764c19d43f",id:"cancel-reason",class:this.cancellationError?"error":"",part:"ncec__reason-textarea",multiline:!0,value:this.cancellationReason,onInput:this.handleOnChangeCancellationReason,onFocus:this.handleOnChangeCancellationReason,invalid:!!this.cancellationError},a.h("sp-help-text",{key:"cf6d0e82b648ee662fa9244a793cfcaa64913c4c",slot:"negative-help-text"},this.cancellationError)),a.h("sp-button",{key:"b8e17a34e57faaaa61585ea4beb2205537c38c49",variant:"primary",class:"cancel",type:"submit",part:"ncec__button-cta"},"Cancel booking"),a.h("sp-button",{key:"eafb068d14d0680d8ea5cd7e42fd358d3582e99a",variant:"secondary",class:"back",treatment:"outline",part:"ncec__button-outline",onClick:this.handleGoBackClicked},"Go back")))))}};K([b.RegisterComponent({name:"nylas-cancel-booking-form",eventToProps:{cancelBookingFormSubmitted:async(e,t)=>{const n=await t.scheduler.cancelBooking(e.detail.bookingId),{errorHandler:s}=e.detail;s&&(!n||"error"in n)&&s(n)}},fireRegisterEvent:!0}),x("design:type",Function),x("design:paramtypes",[]),x("design:returntype",void 0)],B.prototype,"render",null);B.style=J;const Q=':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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}',ee=Q;var te=function(e,t,n,s){var o=arguments.length,i=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},C=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const R=class{constructor(e){a.registerInstance(this,e),this.closeCancelEventCardClicked=a.createEvent(this,"closeCancelEventCardClicked",7),this.handleCloseClicked=()=>{this.closeCancelEventCardClicked.emit()},this.cancelledEventInfo=void 0}connectedCallback(){c.debug("[nylas-cancelled-event-card] Component connected")}async componentWillLoad(){c.debug("[nylas-cancelled-event-card] Component will load")}async componentDidLoad(){c.debug("[nylas-cancelled-event-card] Component did load")}disconnectedCallback(){c.debug("[nylas-cancelled-event-card] Component disconnected")}render(){return a.h(a.Host,{key:"52b1d729c8df61770be08c165665671f54189c9a",part:"ncec"},a.h("sp-theme",{key:"94633560e146be20b9321e9548edb007bf570e1c",theme:"spectrum",color:"dark",scale:"medium"},a.h("div",{key:"a18a0006aa5e84e58daa6f9446e2b85908867196",class:"nylas-cancelled-event-card",part:"ncec__card"},a.h("div",{key:"67cc5524db58cb7777feaf9b249070e5d713b17b",class:"nylas-cancelled-event-card__calendar-icon",part:"ncec__icon"},a.h("calendar-cancel-icon",{key:"87b0379d4847388505e4f6ddd62d059af9156303"})),a.h("h3",{key:"b7d36ece20f5926c8bb2d0e796a35ed44772e8cf",class:"nylas-cancelled-event-card__title",part:"ncec__title"},"Your booking has been cancelled successfully!"),a.h("div",{key:"808a6cdf14cec2782990c85e06c23e5b9936bc56",class:"nylas-cancelled-event-card__description",part:"ncec__description"},"A cancellation email has been sent to the participants."),a.h("div",{key:"cfd161ea961c637ab2247a568143e659bfb1b7da",class:"nylas-cancelled-event-card__cta"},a.h("sp-button",{key:"ab549c146571e0dd4e86cce46d9947875794a437",variant:"secondary",treatment:"outline",part:"ncec__button-outline",onClick:this.handleCloseClicked},"Close")))))}};te([b.RegisterComponent({name:"nylas-cancelled-event-card",eventToProps:{},fireRegisterEvent:!0}),C("design:type",Function),C("design:paramtypes",[]),C("design:returntype",void 0)],R.prototype,"render",null);R.style=ee;const w=new Date,_=new Date;function y(e,t,n,s){function o(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(e(i=new Date(+i)),i),o.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),o.round=i=>{const r=o(i),l=o.ceil(i);return i-r<l-i?r:l},o.offset=(i,r)=>(t(i=new Date(+i),r==null?1:Math.floor(r)),i),o.range=(i,r,l)=>{const f=[];if(i=o.ceil(i),l=l==null?1:Math.floor(l),!(i<r)||!(l>0))return f;let h;do f.push(h=new Date(+i)),t(i,l),e(i);while(h<i&&i<r);return f},o.filter=i=>y(r=>{if(r>=r)for(;e(r),!i(r);)r.setTime(r-1)},(r,l)=>{if(r>=r)if(l<0)for(;++l<=0;)for(;t(r,-1),!i(r););else for(;--l>=0;)for(;t(r,1),!i(r););}),n&&(o.count=(i,r)=>(w.setTime(+i),_.setTime(+r),e(w),e(_),Math.floor(n(w,_))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(s?r=>s(r)%i===0:r=>o.count(0,r)%i===0):o)),o}const ae=1e3,$=ae*60,ne=$*60,p=ne*24,E=y(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$)/p,e=>e.getDate()-1);y(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/p,e=>e.getUTCDate()-1);y(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/p,e=>Math.floor(e/p));const ie=':host{display:block;min-height:444px;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:1rem}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}',se=ie;var re=function(e,t,n,s){var o=arguments.length,i=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},T=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const j=class{constructor(e){a.registerInstance(this,e),this.dateSelected=a.createEvent(this,"dateSelected",7),this.monthChanged=a.createEvent(this,"monthChanged",7),this.selectableDates=void 0,this.selectedDate=void 0,this.isLoading=void 0,this.month=this.selectedDate||new Date,this.dates=this.getDates()}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}getDates(){const e=c.getLastDayOfMonth(this.month),t=c.getFirstDayOfMonth(this.month);return E.range(E.offset(t,-t.getDay()),E.offset(e,7-e.getDay()))}selectDate(e){this.dateSelected.emit(e)}changeMonth(e){this.month=new Date(this.month.getFullYear(),this.month.getMonth()+e,1),this.dates=this.getDates(),this.monthChanged.emit(this.month),this.selectDate()}isSelected(e,t,n){return e&&t&&c.isSameDay(e,t)&&n&&(n==null?void 0:n.length)>0}isDisabled(e,t){return e&&(t==null?void 0:t.find(n=>c.isSameDay(n,e)))===void 0}render(){var e,t;return a.h(a.Host,{key:"da3c7e290b60613575379d559e03d5e1dca04535",part:"ndp"},a.h("div",{key:"4bb1b14f4f609f601b27f7ad2eb4baeed6cc4d55",class:"nylas-date-picker"},a.h("div",{key:"5d6c68298c5e9606bae9e45a99f0c59da3d36854",class:"header flex-row"},a.h("h2",{key:"2504a779961e1e07a881f2eb2f5ffa5d8329e627",part:"ndp__month-header"},a.h("strong",{key:"433fdd38ccf5b49144bafd3b284acd26b94d19c4"},this.month.toLocaleDateString(void 0,{month:"long"}))," ",this.month.toLocaleDateString(void 0,{year:"numeric"})),a.h("div",{key:"ffaa3276b249a85dc197828625835ad1f2278179",class:"pagination"},a.h("button",{key:"451c9d09fc01e4c7ae35742d7c6b4b2f3da4d3ee",onClick:()=>this.changeMonth(-1),class:{"chevron-left":!0,button:!0},disabled:!((e=this.selectableDates)!=null&&e.length)||this.month<=new Date,part:"ndp__month-button"},a.h("chevron-icon",{key:"3a23fa0fb325feab4b56477602f122b800dce5ce"})),a.h("button",{key:"56b81156d02525a70c6c567e5facb1d9995ea2de",onClick:()=>this.changeMonth(1),class:{"chevron-right":!0,button:!0},disabled:!((t=this.selectableDates)!=null&&t.length),part:"ndp__month-button"},a.h("chevron-icon",{key:"1329d513678bffec6bc21d579b240e7af29ec530"})))),a.h("div",{key:"14eb94fe04ca2797f3377057a87825689b818719",class:"dates"},["SUN","MON","TUE","WED","THU","FRI","SAT"].map(n=>a.h("div",{class:"day",part:"ndp__day"},n)),this.dates.map((n,s)=>{var i;const o=this.isDisabled(n,this.selectableDates);return this.isLoading?a.h("button",{disabled:!0,class:{"date day-skeleton":!0,"current-month":c.isSameMonth(n,this.month)},style:{animationDelay:`${s*20}ms`},part:"ndp__date"},n.getDate()):a.h("button",{class:{date:!0,selected:!!(this.selectedDate&&c.isSameDay(n,this.selectedDate)&&this.selectableDates&&((i=this.selectableDates)==null?void 0:i.length)>0),"current-day":c.isSameDay(n,new Date),"current-month":c.isSameMonth(n,this.month)},"aria-lang":n.toLocaleDateString(void 0,{dateStyle:"full"}),disabled:o,onClick:()=>this.selectDate(n),part:`ndp__date ${this.isSelected(n,this.selectedDate,this.selectableDates)?"ndp__date--selected":""} ${c.isSameDay(n,new Date)?"ndp__date--current-day":""} ${c.isSameMonth(n,this.month)?"ndp__date--current-month":""}`},n.getDate())}))))}};re([b.RegisterComponent({name:"nylas-date-picker",stateToProps:new Map([["scheduler.selectableDates","selectableDates"],["scheduler.selectedDate","selectedDate"],["scheduler.isLoading","isLoading"]]),eventToProps:{dateSelected:async(e,t)=>{t.scheduler.selectDate(e.detail)}},fireRegisterEvent:!0}),T("design:type",Function),T("design:paramtypes",[]),T("design:returntype",void 0)],j.prototype,"render",null);j.style=se;const oe=':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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}',le=oe;var ce=function(e,t,n,s){var o=arguments.length,i=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},D=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const P=class{constructor(e){a.registerInstance(this,e),this.timezoneChanged=a.createEvent(this,"timezoneChanged",7),this.languageChanged=a.createEvent(this,"languageChanged",7),this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.selectedLanguage=navigator.language}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}changeTimezone(e){this.selectedTimezone=e,this.timezoneChanged.emit(e)}changeLanguage(e){this.selectedLanguage=e,this.languageChanged.emit(e)}selectedOptionChangedHandler(e){const{name:t,value:n}=e.detail;t==="timezone"?this.changeTimezone(n):t==="language"&&this.changeLanguage(n)}getTimezoneLabelHTML(e){const t=d.getTimezoneOffset(e);return a.h("span",{class:"timezone-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"-webkit-fill-available"}},d.TIMEZONE_MAP[e]," ",a.h("span",{class:"timezone-offset",style:{fontSize:"14px",fontWeight:"400",color:"var(--nylas-base-500)"}},t))}render(){const e=Object.keys(d.TIMEZONE_MAP).map(n=>({labelHTML:this.getTimezoneLabelHTML(n),label:d.TIMEZONE_MAP[n],value:n})),t=Object.keys(d.LANGUAGE_MAP).map(n=>({label:d.LANGUAGE_MAP[n],value:n}));return a.h(a.Host,{key:"688b90cbd1410a8025a8becfd3f979fc854c60a2"},a.h("div",{key:"a4f485ce6204d89e16336c93809dbcf5ebf862ef",class:"nylas-locale-switch"},a.h("div",{key:"5525e493d2f8e3258a2fe8b4c739db49d7ef1a35",class:{"select-wrapper":!0,timezone:!0}},a.h("select-dropdown",{key:"68f7f48a2cada4cc0c7327431f15384d17ebc261",name:"timezone",options:e,defaultSelectedOption:e.find(n=>n.value==this.selectedTimezone)},a.h("span",{key:"d1213a8cba28b2163997cdb4bce7e13d7485e869",slot:"select-icon"},a.h("globe-icon",{key:"f11285b20c93a42a0f195f89966bc7ff7b2d7322",width:"20",height:"20"})))),a.h("div",{key:"0287627954a80ef5092ded694e61ec2a19606667",class:{"select-wrapper":!0,language:!0}},a.h("select-dropdown",{key:"1bd58884de605b22cb6a5631b8e9f960cfa058d4",name:"language",options:t,defaultSelectedOption:t.find(n=>n.value==this.selectedLanguage)},a.h("span",{key:"0681b6c8296d60c258c2df3bcb60d895c0e0c533",slot:"select-icon"},a.h("translate-icon",{key:"bd3f346f56da2a139c5050799c9e2774d311d72c",width:"20",height:"20"}))))))}};ce([b.RegisterComponent({name:"nylas-locale-switch",stateToProps:new Map([["scheduler.selectedLanguage","selectedLanguage"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{timezoneChanged:async(e,t)=>{t.scheduler.selectTimezone(e.detail)}},fireRegisterEvent:!0}),D("design:type",Function),D("design:paramtypes",[]),D("design:returntype",void 0)],P.prototype,"render",null);P.style=le;const de=".sc-nylas-logo-h{display:flex}",be=de,A=class{constructor(e){a.registerInstance(this,e),this.width="69",this.height="24"}render(){return a.h("svg",{key:"a305694aba91cff6d13167eab106e824536728cd",width:this.width,height:this.height,viewBox:"0 0 69 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.h("g",{key:"790edf0bee99fea0fe2cef131ed9a3340ff1ec70","clip-path":"url(#clip0_455_3543)"},a.h("path",{key:"bd29c1fe02931e4a6dceee45711ef6c212164d77",d:"M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z",fill:"currentColor"}),a.h("path",{key:"6ad33f3a2c1524777ef9f33d8fccdefa87c6c4de",d:"M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z",fill:"currentColor"}),a.h("path",{key:"cff70a4c9e84c0c16cbbc8f3a1e9432200e2f6c7",d:"M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z",fill:"currentColor"}),a.h("path",{key:"f8deff8d4ba7374b51cd83e2dd01d58b75cc751a",d:"M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z",fill:"currentColor"}),a.h("path",{key:"0cc0f9ff674f031b72ebff2b4b4642f678a74a08",d:"M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z",fill:"currentColor"}),a.h("path",{key:"fbc997ce655d72115a3f091a0c3df101d4311842",d:"M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z",fill:"currentColor"}),a.h("path",{key:"1000a3c24e6495f474df5ffc6af307466f4c6fb6",d:"M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z",fill:"currentColor"}),a.h("path",{key:"048a76e10c0489b5361747c3ff711e0c771071fc",d:"M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z",fill:"currentColor"})),a.h("defs",{key:"2ecd1149d28e4b4d5d5fce2e3775933ae12a1983"},a.h("clipPath",{key:"b0b608b033eafd9eb2ada24432d379f539f725e3",id:"clip0_455_3543"},a.h("rect",{key:"0277917a58837afc24f997ef1a66f8f415b9072e",width:"68.7123",height:"19.2877",fill:"white",transform:"translate(0.144043 0.356201)"}))))}};A.style=be;const fe=':host{display:block;margin-bottom:-12px;width:100%;z-index: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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}',he=fe,Z=class{constructor(e){a.registerInstance(this,e),this.ttl=5e3,this.allowedCategories=["component","api","validation","invalid_session"],this.notifications=[]}onError(e){c.debug(`[nylas-notification] Error: ${e.detail.title}`),this.handleNotification(e)}onWarning(e){c.debug(`[nylas-notification] Warning: ${e.detail.title}`),this.handleNotification(e)}onInfo(e){c.debug(`[nylas-notification] Info: ${e.detail.title}`),this.handleNotification(e)}onSuccess(e){c.debug(`[nylas-notification] Success: ${e.detail.title}`),this.handleNotification(e)}handleNotification(e){if(e.defaultPrevented){c.debug("[nylas-notification] Event default prevented");return}if(this.ttl===0){c.debug("[nylas-notification] TTL is 0");return}if(this.allowedCategories.length>0&&!this.allowedCategories.includes(e.detail.category)){c.debug("[nylas-notification] Category not allowed");return}if(this.notifications=[...this.notifications,{...e.detail}],e.detail.ttl!=="none"){const t=e.detail.ttl?e.detail.ttl:this.ttl;window.setTimeout(()=>{this.notifications=this.notifications.filter(n=>n.id!==e.detail.id)},t)}}dismissNotification(e){this.notifications=this.notifications.filter(t=>t.id!==e)}render(){return a.h(a.Host,{key:"947c58f3617a73e55731cc6f6c03c1931008d000"},a.h(a.Fragment,{key:"d84045b56a35c322a194e4bf4c9d3982a5ce6d32"},this.notifications.map(e=>a.h("div",{class:`notif ${e.type}`,key:e.id},a.h("div",{class:"content"},a.h("span",{class:`icon ${e.type}`},(e.type==="error"||e.type==="warning")&&a.h("warning-icon",null)),a.h("span",{class:"message"},a.h("span",{class:"title"},e.title),e.description&&a.h("span",{class:"description"},e.description))),a.h("button",{class:"dismiss-btn",onClick:()=>this.dismissNotification(e.id)},a.h("close-icon",null)))),a.h("slot",{key:"e246e847f46fe0d99370eb909cc89a3546186089"})))}};Z.style=he;const me=":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:min(max(14px, 3vw), 16px);font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}",pe=me;var ye=function(e,t,n,s){var o=arguments.length,i=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},z=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const M=class{constructor(e){a.registerInstance(this,e),this.selectedDate=void 0,this.selectedTimeslot=void 0,this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.startTime="",this.endTime=""}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){c.debug("[nylas-selected-event-card] Component will load")}async componentDidLoad(){c.debug("[nylas-selected-event-card] Component did load")}handleSelectedTimeslotChange(e){this.startTime=new Date(e==null?void 0:e.start_time).toLocaleString(void 0,{timeStyle:"short"}),this.endTime=new Date(e==null?void 0:e.end_time).toLocaleString(void 0,{timeStyle:"short"})}render(){var e;return a.h(a.Host,{key:"1104fd2969ab03bb794c17bbf08f1600a200448c",part:"nsec"},a.h("sp-theme",{key:"674934ecb54519d9e8c227a9946b9725518b77e5",theme:"spectrum",color:"dark",scale:"medium"},a.h("div",{key:"4d492e825e93b93ff96af4970812178656de4ab8",class:"event-card",part:"nsec__card"},a.h("div",{key:"239131412dab45da5b1f7bfe3b4a2eda45a2978b",class:"calendar-icon",part:"nsec__icon"},a.h("calendar-icon",{key:"a2fa2f47b94a2c331d4cac88ef736faef3e30dae"})),a.h("div",{key:"81c873d5c2019b6ae1d8b746685dbe5efc2d7d0b",class:"nylas-selected-event-card__date",part:"nsec__date"},(e=this.selectedDate)==null?void 0:e.toLocaleDateString(void 0,{dateStyle:"full"})),a.h("div",{key:"67348e66fd879ead10594b216a2d66cf7da272aa",class:"nylas-selected-event-card__time",part:"nsec__time"},this.startTime," - ",this.endTime)),a.h("div",{key:"0fc6452dae7c5998a70d116c9bdfe25ab109661c",class:"event-timezone",part:"nsec__timezone"},a.h("globe-icon",{key:"86c4a1e2728a30e34805a7c286378fe9adef110e"}),d.TIMEZONE_MAP[this.selectedTimezone])))}static get watchers(){return{selectedTimeslot:["handleSelectedTimeslotChange"]}}};ye([b.RegisterComponent({name:"nylas-selected-event-card",stateToProps:new Map([["scheduler.selectedDate","selectedDate"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{},fireRegisterEvent:!0}),z("design:type",Function),z("design:paramtypes",[]),z("design:returntype",void 0)],M.prototype,"render",null);M.style=pe;const ue=":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}",ge=ue;var ve=function(e,t,n,s){var o=arguments.length,i=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},L=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const O=class{constructor(e){a.registerInstance(this,e),this.timeslotSelected=a.createEvent(this,"timeslotSelected",7),this.timeslotConfirmed=a.createEvent(this,"timeslotConfirmed",7),this.handleConfirmedTimeslot=async(t,n)=>{t.preventDefault(),c.debug("[nylas-timeslot-picker] Confirm timeslot",n),this.timeslotConfirmed.emit(n)},this.handleMouseEnter=t=>{this.hoveredTimeslotIndex=t},this.handleMouseLeave=()=>{this.hoveredTimeslotIndex=-1},this.selectedDate=new Date,this.availability=void 0,this.selectedTimeslot=void 0,this.isLoading=void 0,this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.times=[],this.hoveredTimeslotIndex=void 0,this.selectedTimeslotIndex=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){var t;const e=(t=this.availability)==null?void 0:t.filter(n=>this.selectedDate&&c.isSameDay(n.start_time,this.selectedDate)).map(n=>n);this.times=e||[],c.debug("[nylas-timeslot-picker] Component will load",{selectedDate:this.selectedDate,availability:this.availability,times:this.times})}async componentDidLoad(){c.debug("[nylas-timeslot-picker] Component did load")}getTimeslotId(e,t){return`${e.toLocaleDateString()}-${t}`}onClickSelectTime(e,t){c.debug("[nylas-timeslot-picker] Time selected",e,t),this.selectedTimeslotIndex=this.getTimeslotId(e.start_time,t),this.timeslotSelected.emit({start_time:e.start_time,end_time:e.end_time})}getTimeSlotLabel(e){const t=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"numeric",timeZone:this.selectedTimezone});return`${t.format(e.start_time)} - ${t.format(e.end_time)}`}selectedDateChanged(e){var t;if(c.debug("[nylas-timeslot-picker] Selected date changed",{newVal:e}),e&&(this.selectedTimeslotIndex="",typeof e<"u")){const n=(t=this.availability)==null?void 0:t.filter(s=>c.isSameDay(s.start_time,e)).map(s=>s);this.times=n||[]}}availabilityChanged(e){if(c.debug("[nylas-timeslot-picker] Available times changed",{newVal:e,selectedDate:this.selectedDate}),typeof e<"u"){const t=e==null?void 0:e.filter(n=>this.selectedDate&&c.isSameDay(n.start_time,this.selectedDate)).map(n=>n);this.times=t||[]}}render(){return this.isLoading?a.h(a.Host,null,a.h("div",{class:"loading"},new Array(6).fill(0).map((e,t)=>a.h("div",{class:"time-slot-skeleton",style:{animationDelay:`${t*20}ms`}})))):this.availability&&this.availability.length===0?a.h(a.Host,null,a.h("div",{class:"empty"},a.h("span",null,"No dates available"))):(!this.times||this.times.length===0)&&this.selectedDate?a.h(a.Host,null,a.h("div",{class:"empty"},a.h("span",null,"No time slots available for selected date"))):this.selectedDate?a.h(a.Host,{part:"ntp"},a.h("div",{class:"time-picker-wrapper"},a.h("div",{class:"time-slots"},this.times.map((e,t)=>{var n,s,o,i;return a.h("button",{part:`ntp__timeslot ${((s=(n=this.selectedTimeslot)==null?void 0:n.start_time)==null?void 0:s.getTime())===e.start_time.getTime()?"ntp__timeslot--selected":""}`,"aria-role":"button",class:{time:!0,selected:typeof this.selectedTimeslot<"u"&&((i=(o=this.selectedTimeslot)==null?void 0:o.start_time)==null?void 0:i.getTime())===e.start_time.getTime()},onClick:()=>this.onClickSelectTime(e,t),onMouseEnter:()=>this.handleMouseEnter(t),onMouseLeave:()=>this.handleMouseLeave()},this.hoveredTimeslotIndex==t||this.selectedTimeslotIndex==this.getTimeslotId(e.start_time,t)?this.getTimeSlotLabel(e):e.start_time.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",timeZone:this.selectedTimezone}))})),this.selectedTimeslot&&a.h("div",{class:"footer"},a.h("sp-button",{variant:"primary",onClick:e=>this.handleConfirmedTimeslot(e,this.selectedTimeslot),part:"ntp__button-primary"},a.h("slot",{name:"timeslot-picker-cta-label"},"Next"))))):a.h(a.Host,null)}static get watchers(){return{selectedDate:["selectedDateChanged"],availability:["availabilityChanged"]}}};ve([b.RegisterComponent({name:"nylas-timeslot-picker",stateToProps:new Map([["scheduler.selectedDate","selectedDate"],["scheduler.availability","availability"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.isLoading","isLoading"]]),eventToProps:{timeslotSelected:async(e,t)=>{t.scheduler.selectTime(e.detail)},timeslotConfirmed:async(e,t)=>{e.detail&&t.scheduler.toggleAdditionalData(!0)}},fireRegisterEvent:!0}),L("design:type",Function),L("design:paramtypes",[]),L("design:returntype",void 0)],O.prototype,"render",null);O.style=ge;exports.nylas_booked_event_card=I;exports.nylas_booking_form=S;exports.nylas_cancel_booking_form=B;exports.nylas_cancelled_event_card=R;exports.nylas_date_picker=j;exports.nylas_locale_switch=P;exports.nylas_logo=A;exports.nylas_notification=Z;exports.nylas_selected_event_card=M;exports.nylas_timeslot_picker=O;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-2b8437d6.cjs"),b=require("./register-component-dc659dc3-fb85ee68.cjs"),d=require("./utils-c00bdc3c-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const y=':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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.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)}',m=y;var u=function(e,n,r,t){var c=arguments.length,s=c<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,r):t,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,n,r,t);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(s=(c<3?l(s):c>3?l(n,r,s):l(n,r))||s);return c>3&&s&&Object.defineProperty(n,r,s),s},f=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)};const i=class{constructor(e){a.registerInstance(this,e),e.$hostElement$["s-ei"]?this.internals=e.$hostElement$["s-ei"]:(this.internals=e.$hostElement$.attachInternals(),e.$hostElement$["s-ei"]=this.internals)}connectedCallback(){d.debug("nylas-event-card","connectedCallback")}componentWillLoad(){d.debug("nylas-event-card","componentWillLoad")}componentDidLoad(){d.debug("nylas-event-card","componentDidLoad")}disconnectedCallback(){d.debug("nylas-event-card","disconnectedCallback")}render(){return a.h(a.Host,{key:"a25e6cf278893d8152895bedc42fa83584b26ed1"},a.h("div",{key:"ca83bf28168fe3cfff4e910dc80536574c33e55b",class:"nylas-form-card"},a.h("div",{key:"0bc4aa5cfc27ed26f301a29b45ab7bafd80f507f",class:"nylas-form-card__header"},a.h("slot",{key:"1df96d905cf7c3e563eaf36f9825bb67f190795a",name:"header-title"}),a.h("slot",{key:"d62a004ea3fb7a282a986b749a8b5998827cf498",name:"header-subtitle"})),a.h("div",{key:"6f2f1576516dee66795f3c423fd23725978891b0",class:"nylas-form-card__content"},a.h("slot",{key:"af397af820898e806cf64a7528563a31ce821fd3",name:"content"}))))}static get formAssociated(){return!0}};u([b.RegisterComponent({name:"nylas-form-card",eventToProps:{},fireRegisterEvent:!0}),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",void 0)],i.prototype,"render",null);i.style=m;exports.nylas_form_card=i;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { r as y, h as s, H as b } from "./index-db0c5017.js";
|
|
2
|
-
import { R as m } from "./register-component-dc659dc3-e43e8fae.js";
|
|
3
|
-
import { d as c } from "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
7
|
-
const p = ':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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.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)}', u = p;
|
|
8
|
-
var v = function(e, a, r, t) {
|
|
9
|
-
var l = arguments.length, n = l < 3 ? a : t === null ? t = Object.getOwnPropertyDescriptor(a, r) : t, o;
|
|
10
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
n = Reflect.decorate(e, a, r, t);
|
|
12
|
-
else
|
|
13
|
-
for (var d = e.length - 1; d >= 0; d--)
|
|
14
|
-
(o = e[d]) && (n = (l < 3 ? o(n) : l > 3 ? o(a, r, n) : o(a, r)) || n);
|
|
15
|
-
return l > 3 && n && Object.defineProperty(a, r, n), n;
|
|
16
|
-
}, f = function(e, a) {
|
|
17
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
|
-
return Reflect.metadata(e, a);
|
|
19
|
-
};
|
|
20
|
-
const i = class {
|
|
21
|
-
constructor(e) {
|
|
22
|
-
y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
|
|
23
|
-
}
|
|
24
|
-
connectedCallback() {
|
|
25
|
-
c("nylas-event-card", "connectedCallback");
|
|
26
|
-
}
|
|
27
|
-
componentWillLoad() {
|
|
28
|
-
c("nylas-event-card", "componentWillLoad");
|
|
29
|
-
}
|
|
30
|
-
componentDidLoad() {
|
|
31
|
-
c("nylas-event-card", "componentDidLoad");
|
|
32
|
-
}
|
|
33
|
-
disconnectedCallback() {
|
|
34
|
-
c("nylas-event-card", "disconnectedCallback");
|
|
35
|
-
}
|
|
36
|
-
render() {
|
|
37
|
-
return s(b, { key: "a25e6cf278893d8152895bedc42fa83584b26ed1" }, s("div", { key: "ca83bf28168fe3cfff4e910dc80536574c33e55b", class: "nylas-form-card" }, s("div", { key: "0bc4aa5cfc27ed26f301a29b45ab7bafd80f507f", class: "nylas-form-card__header" }, s("slot", { key: "1df96d905cf7c3e563eaf36f9825bb67f190795a", name: "header-title" }), s("slot", { key: "d62a004ea3fb7a282a986b749a8b5998827cf498", name: "header-subtitle" })), s("div", { key: "6f2f1576516dee66795f3c423fd23725978891b0", class: "nylas-form-card__content" }, s("slot", { key: "af397af820898e806cf64a7528563a31ce821fd3", name: "content" }))));
|
|
38
|
-
}
|
|
39
|
-
static get formAssociated() {
|
|
40
|
-
return !0;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
v([
|
|
44
|
-
m({
|
|
45
|
-
name: "nylas-form-card",
|
|
46
|
-
eventToProps: {},
|
|
47
|
-
fireRegisterEvent: !0
|
|
48
|
-
}),
|
|
49
|
-
f("design:type", Function),
|
|
50
|
-
f("design:paramtypes", []),
|
|
51
|
-
f("design:returntype", void 0)
|
|
52
|
-
], i.prototype, "render", null);
|
|
53
|
-
i.style = u;
|
|
54
|
-
export {
|
|
55
|
-
i as nylas_form_card
|
|
56
|
-
};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { r as h, h as l, H as u } from "./index-db0c5017.js";
|
|
2
|
-
import { R as m } from "./register-component-dc659dc3-e43e8fae.js";
|
|
3
|
-
import { d as o } from "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
7
|
-
const p = ":host{display:block}div{height:inherit}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fade-in{animation:fadeIn 1.5s}.fade-out{animation:fadeOut 1.5s}@keyframes slideIn{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes slideOut{0%{transform:translateY(0)}100%{transform:translateY(100%)}}.slide-in{animation:slideIn 1.5s}.slide-out{animation:slideOut 1.5s}@keyframes swipeIn{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes swipeOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}.swipe-in{animation:swipeIn 1.5s}.swipe-out{animation:swipeOut 1.5s}", y = p;
|
|
8
|
-
var S = function(e, s, n, a) {
|
|
9
|
-
var t = arguments.length, i = t < 3 ? s : a === null ? a = Object.getOwnPropertyDescriptor(s, n) : a, r;
|
|
10
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
i = Reflect.decorate(e, s, n, a);
|
|
12
|
-
else
|
|
13
|
-
for (var f = e.length - 1; f >= 0; f--)
|
|
14
|
-
(r = e[f]) && (i = (t < 3 ? r(i) : t > 3 ? r(s, n, i) : r(s, n)) || i);
|
|
15
|
-
return t > 3 && i && Object.defineProperty(s, n, i), i;
|
|
16
|
-
}, d = function(e, s) {
|
|
17
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
|
-
return Reflect.metadata(e, s);
|
|
19
|
-
};
|
|
20
|
-
const c = class {
|
|
21
|
-
constructor(e) {
|
|
22
|
-
h(this, e), this.state = void 0, this.isStateSet = void 0, this.isBoolean = void 0, this.getStore = void 0, this.transition = "none", this.show = !1, this.classes = {}, this.initTransition = this.initTransition.bind(this);
|
|
23
|
-
}
|
|
24
|
-
connectedCallback() {
|
|
25
|
-
}
|
|
26
|
-
disconnectedCallback() {
|
|
27
|
-
}
|
|
28
|
-
async componentWillLoad() {
|
|
29
|
-
o("[nylas-if-state] Component will load"), this.watchStore(!0);
|
|
30
|
-
}
|
|
31
|
-
async componentDidLoad() {
|
|
32
|
-
o("[nylas-if-state] Component did load");
|
|
33
|
-
}
|
|
34
|
-
shouldRender() {
|
|
35
|
-
const [e, s] = this.state ? this.state.split(".") : ["", ""], n = this.getStore;
|
|
36
|
-
if (typeof n > "u")
|
|
37
|
-
return o(`[nylas-if-state] Store name: ${e} | State name: ${s}`, { getStore: n }), !1;
|
|
38
|
-
const a = n(e);
|
|
39
|
-
if (typeof a > "u")
|
|
40
|
-
return o(`[nylas-if-state] Store name: ${e} | State name: ${s}`, { store: a }), !1;
|
|
41
|
-
const t = a.state[s];
|
|
42
|
-
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;
|
|
43
|
-
}
|
|
44
|
-
onGetStoreChange() {
|
|
45
|
-
this.watchStore(!0);
|
|
46
|
-
}
|
|
47
|
-
watchStore(e = !1) {
|
|
48
|
-
const [s, n] = this.state ? this.state.split(".") : ["", ""], a = this.getStore;
|
|
49
|
-
if (typeof a > "u")
|
|
50
|
-
return o(`[nylas-if-state] Store name: ${s} | State name: ${n}`, { getStore: a }), null;
|
|
51
|
-
const t = a(s);
|
|
52
|
-
if (typeof t > "u")
|
|
53
|
-
return o(`[nylas-if-state] Store name: ${s} | State name: ${n}`, { store: t }), null;
|
|
54
|
-
e === !0 && this.initTransition(), t.onChange(n, this.initTransition);
|
|
55
|
-
}
|
|
56
|
-
initTransition() {
|
|
57
|
-
const e = this.shouldRender();
|
|
58
|
-
switch (this.transition) {
|
|
59
|
-
case "fade":
|
|
60
|
-
case "slide":
|
|
61
|
-
case "swipe":
|
|
62
|
-
this.classes = {
|
|
63
|
-
[`${this.transition}-in`]: e,
|
|
64
|
-
[`${this.transition}-out`]: !e
|
|
65
|
-
}, setTimeout(() => {
|
|
66
|
-
this.show = e;
|
|
67
|
-
}, 150);
|
|
68
|
-
break;
|
|
69
|
-
default:
|
|
70
|
-
this.show = this.shouldRender();
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
render() {
|
|
75
|
-
return l(u, { key: "91d17bc89a09742106ef3bd9365c5ce48cf14e86" }, l("div", { key: "9d0070be4bf5d9a5f405fc4a0733e6d832fa669a", class: this.classes }, this.show && l("slot", null)));
|
|
76
|
-
}
|
|
77
|
-
static get watchers() {
|
|
78
|
-
return {
|
|
79
|
-
getStore: ["onGetStoreChange"]
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
S([
|
|
84
|
-
m({
|
|
85
|
-
name: "nylas-if-state",
|
|
86
|
-
getStoresToProp: "getStore",
|
|
87
|
-
fireRegisterEvent: !0
|
|
88
|
-
}),
|
|
89
|
-
d("design:type", Function),
|
|
90
|
-
d("design:paramtypes", []),
|
|
91
|
-
d("design:returntype", void 0)
|
|
92
|
-
], c.prototype, "render", null);
|
|
93
|
-
c.style = y;
|
|
94
|
-
export {
|
|
95
|
-
c as nylas_if_state
|
|
96
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-2b8437d6.cjs"),c=require("./register-component-dc659dc3-fb85ee68.cjs"),o=require("./utils-c00bdc3c-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const h=":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}",m=h;var y=function(e,s,n,i){var t=arguments.length,a=t<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,n):i,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,s,n,i);else for(var l=e.length-1;l>=0;l--)(f=e[l])&&(a=(t<3?f(a):t>3?f(s,n,a):f(s,n))||a);return t>3&&a&&Object.defineProperty(s,n,a),a},d=function(e,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,s)};const u=class{constructor(e){r.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(){o.debug("[nylas-if-state] Component will load"),this.watchStore(!0)}async componentDidLoad(){o.debug("[nylas-if-state] Component did load")}shouldRender(){const[e,s]=this.state?this.state.split("."):["",""],n=this.getStore;if(typeof n>"u")return o.debug(`[nylas-if-state] Store name: ${e} | State name: ${s}`,{getStore:n}),!1;const i=n(e);if(typeof i>"u")return o.debug(`[nylas-if-state] Store name: ${e} | State name: ${s}`,{store:i}),!1;const t=i.state[s];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[s,n]=this.state?this.state.split("."):["",""],i=this.getStore;if(typeof i>"u")return o.debug(`[nylas-if-state] Store name: ${s} | State name: ${n}`,{getStore:i}),null;const t=i(s);if(typeof t>"u")return o.debug(`[nylas-if-state] Store name: ${s} | State name: ${n}`,{store:t}),null;e===!0&&this.initTransition(),t.onChange(n,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 r.h(r.Host,{key:"91d17bc89a09742106ef3bd9365c5ce48cf14e86"},r.h("div",{key:"9d0070be4bf5d9a5f405fc4a0733e6d832fa669a",class:this.classes},this.show&&r.h("slot",null)))}static get watchers(){return{getStore:["onGetStoreChange"]}}};y([c.RegisterComponent({name:"nylas-if-state",getStoresToProp:"getStore",fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],u.prototype,"render",null);u.style=m;exports.nylas_if_state=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-2b8437d6.cjs"),u=require("./register-component-dc659dc3-fb85ee68.cjs"),a=require("./utils-c00bdc3c-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const h=":host{display:block}.folders{display:flex;flex-direction:column;align-items:self-start}.folders .folder{border:1px solid var(--nylas-color-primary-100);padding:0.5rem 0.75rem;margin-bottom:0.5rem;justify-content:left;width:100%;min-width:200px;border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-50)}.folders .folder:last-child{margin-bottom:0}.folders .folder.selected{background-color:var(--nylas-color-primary-100)}.folders .folder .icon{margin-right:0.5rem;stroke:var(--nylas-color-primary-900);fill:none}hr{width:100%;margin:1rem 0;border:0;border-top:1px solid var(--nylas-color-primary-100)}",m=h;var p=function(t,r,e,o){var s=arguments.length,n=s<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,e):o,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,r,e,o);else for(var i=t.length-1;i>=0;i--)(d=t[i])&&(n=(s<3?d(n):s>3?d(r,e,n):d(r,e))||n);return s>3&&n&&Object.defineProperty(r,e,n),n},c=function(t,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,r)};const f=class{constructor(t){l.registerInstance(this,t),this.folderSelected=l.createEvent(this,"folderSelected",7),this.folderSelectedHandler=r=>{var e;(e=this.folderSelected)==null||e.emit(r)},this.folders=void 0,this.selectedFolder=void 0,this.defaultFolders=void 0,this.otherFolders=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){a.debug("[nylas-list-folders] Component will load")}async componentDidLoad(){a.debug("[nylas-list-folders] Component did load")}watchFolders(t){a.debug("[nylas-list-folders] watchFolders",{newFolders:t});const r=["inbox","drafts","sent","starred","spam","archive","trash"];this.defaultFolders=r.filter(e=>t.find(o=>{var s;return((s=o.name)==null?void 0:s.toLowerCase())===e.toLowerCase()})).map(e=>t.find(o=>{var s;return((s=o.name)==null?void 0:s.toLowerCase())===e.toLowerCase()})).filter(e=>typeof e<"u").sort((e,o)=>r.indexOf((e==null?void 0:e.name)??"")-r.indexOf((o==null?void 0:o.name)??"")),this.otherFolders=t.filter(e=>!r.find(o=>{var s;return((s=e.name)==null?void 0:s.toLowerCase())===o.toLowerCase()})).sort((e,o)=>(e.name??"").localeCompare(o.name??""))}formatFolderName(t){var r;return a.toTitleCase(((r=t.name)==null?void 0:r.replace("CATEGORY_",""))??"Unknown")}getFolderIcon(t){var r;switch((r=t.name)==null?void 0:r.toLowerCase()){case"inbox":return l.h("inbox-icon",null);case"drafts":return l.h("drafts-icon",null);case"sent":return l.h("sent-icon",null);case"starred":return l.h("star-icon",null);case"spam":return l.h("spam-icon",null);case"archive":return l.h("archive-icon",null);case"trash":return l.h("trash-icon",null);default:return l.h("folder-icon",null)}}render(){var t,r;return l.h(l.Host,{key:"216a4856e0e4484bd21a13c8b52f60056838e355"},l.h("div",{key:"3dfa827f612e13c3abec08c7e50a3f52ece2f677",class:"folders"},(t=this.defaultFolders)==null?void 0:t.map(e=>{var o;return l.h("sp-button",{onClick:()=>this.folderSelectedHandler(e),class:{folder:!0,selected:a.formatFolderName(e.name??"inbox").toLowerCase()===((o=this.selectedFolder)==null?void 0:o.toLowerCase())}},l.h("div",{slot:"icon",class:"icon"},this.getFolderIcon(e)),this.formatFolderName(e))})),this.otherFolders&&l.h(l.Fragment,null,l.h("hr",null),l.h("div",{class:"folders"},(r=this.otherFolders)==null?void 0:r.map(e=>{var o;return l.h("sp-button",{onClick:()=>this.folderSelectedHandler(e),class:{folder:!0,selected:a.formatFolderName(e.name??"inbox").toLowerCase()===((o=this.selectedFolder)==null?void 0:o.toLowerCase())}},l.h("div",{slot:"icon",class:"icon"},this.getFolderIcon(e)),this.formatFolderName(e))}))))}static get watchers(){return{folders:["watchFolders"]}}};p([u.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.folders","folders"],["mailbox.selectedFolder","selectedFolder"]]),eventToProps:{folderSelected:async(t,r)=>{a.debug("[nylas-list-folders] folderSelected event",{_event:t}),await r.threads.getThreads({page_token:void 0,in:a.formatFolderName(t.detail.id??"inbox")})}},fireRegisterEvent:!0}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],f.prototype,"render",null);f.style=m;exports.nylas_list_folders=f;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { r as u, c as p, h as s, F as h, H as y } from "./index-db0c5017.js";
|
|
2
|
-
import { R as b } from "./register-component-dc659dc3-e43e8fae.js";
|
|
3
|
-
import { d, t as F, f } from "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
7
|
-
const g = ":host{display:block}.folders{display:flex;flex-direction:column;align-items:self-start}.folders .folder{border:1px solid var(--nylas-color-primary-100);padding:0.5rem 0.75rem;margin-bottom:0.5rem;justify-content:left;width:100%;min-width:200px;border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-50)}.folders .folder:last-child{margin-bottom:0}.folders .folder.selected{background-color:var(--nylas-color-primary-100)}.folders .folder .icon{margin-right:0.5rem;stroke:var(--nylas-color-primary-900);fill:none}hr{width:100%;margin:1rem 0;border:0;border-top:1px solid var(--nylas-color-primary-100)}", C = g;
|
|
8
|
-
var v = function(r, t, e, o) {
|
|
9
|
-
var l = arguments.length, a = l < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, e) : o, n;
|
|
10
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
a = Reflect.decorate(r, t, e, o);
|
|
12
|
-
else
|
|
13
|
-
for (var i = r.length - 1; i >= 0; i--)
|
|
14
|
-
(n = r[i]) && (a = (l < 3 ? n(a) : l > 3 ? n(t, e, a) : n(t, e)) || a);
|
|
15
|
-
return l > 3 && a && Object.defineProperty(t, e, a), a;
|
|
16
|
-
}, c = function(r, t) {
|
|
17
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
|
-
return Reflect.metadata(r, t);
|
|
19
|
-
};
|
|
20
|
-
const m = class {
|
|
21
|
-
constructor(r) {
|
|
22
|
-
u(this, r), this.folderSelected = p(this, "folderSelected", 7), this.folderSelectedHandler = (t) => {
|
|
23
|
-
var e;
|
|
24
|
-
(e = this.folderSelected) == null || e.emit(t);
|
|
25
|
-
}, this.folders = void 0, this.selectedFolder = void 0, this.defaultFolders = void 0, this.otherFolders = void 0;
|
|
26
|
-
}
|
|
27
|
-
connectedCallback() {
|
|
28
|
-
}
|
|
29
|
-
disconnectedCallback() {
|
|
30
|
-
}
|
|
31
|
-
async componentWillLoad() {
|
|
32
|
-
d("[nylas-list-folders] Component will load");
|
|
33
|
-
}
|
|
34
|
-
async componentDidLoad() {
|
|
35
|
-
d("[nylas-list-folders] Component did load");
|
|
36
|
-
}
|
|
37
|
-
watchFolders(r) {
|
|
38
|
-
d("[nylas-list-folders] watchFolders", { newFolders: r });
|
|
39
|
-
const t = ["inbox", "drafts", "sent", "starred", "spam", "archive", "trash"];
|
|
40
|
-
this.defaultFolders = t.filter((e) => r.find((o) => {
|
|
41
|
-
var l;
|
|
42
|
-
return ((l = o.name) == null ? void 0 : l.toLowerCase()) === e.toLowerCase();
|
|
43
|
-
})).map((e) => r.find((o) => {
|
|
44
|
-
var l;
|
|
45
|
-
return ((l = o.name) == null ? void 0 : l.toLowerCase()) === e.toLowerCase();
|
|
46
|
-
})).filter((e) => typeof e < "u").sort((e, o) => t.indexOf((e == null ? void 0 : e.name) ?? "") - t.indexOf((o == null ? void 0 : o.name) ?? "")), this.otherFolders = r.filter((e) => !t.find((o) => {
|
|
47
|
-
var l;
|
|
48
|
-
return ((l = e.name) == null ? void 0 : l.toLowerCase()) === o.toLowerCase();
|
|
49
|
-
})).sort((e, o) => (e.name ?? "").localeCompare(o.name ?? ""));
|
|
50
|
-
}
|
|
51
|
-
formatFolderName(r) {
|
|
52
|
-
var t;
|
|
53
|
-
return F(((t = r.name) == null ? void 0 : t.replace("CATEGORY_", "")) ?? "Unknown");
|
|
54
|
-
}
|
|
55
|
-
getFolderIcon(r) {
|
|
56
|
-
var t;
|
|
57
|
-
switch ((t = r.name) == null ? void 0 : t.toLowerCase()) {
|
|
58
|
-
case "inbox":
|
|
59
|
-
return s("inbox-icon", null);
|
|
60
|
-
case "drafts":
|
|
61
|
-
return s("drafts-icon", null);
|
|
62
|
-
case "sent":
|
|
63
|
-
return s("sent-icon", null);
|
|
64
|
-
case "starred":
|
|
65
|
-
return s("star-icon", null);
|
|
66
|
-
case "spam":
|
|
67
|
-
return s("spam-icon", null);
|
|
68
|
-
case "archive":
|
|
69
|
-
return s("archive-icon", null);
|
|
70
|
-
case "trash":
|
|
71
|
-
return s("trash-icon", null);
|
|
72
|
-
default:
|
|
73
|
-
return s("folder-icon", null);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
render() {
|
|
77
|
-
var r, t;
|
|
78
|
-
return s(y, { key: "216a4856e0e4484bd21a13c8b52f60056838e355" }, s("div", { key: "3dfa827f612e13c3abec08c7e50a3f52ece2f677", class: "folders" }, (r = this.defaultFolders) == null ? void 0 : r.map((e) => {
|
|
79
|
-
var o;
|
|
80
|
-
return s("sp-button", { onClick: () => this.folderSelectedHandler(e), class: {
|
|
81
|
-
folder: !0,
|
|
82
|
-
selected: f(e.name ?? "inbox").toLowerCase() === ((o = this.selectedFolder) == null ? void 0 : o.toLowerCase())
|
|
83
|
-
} }, s("div", { slot: "icon", class: "icon" }, this.getFolderIcon(e)), this.formatFolderName(e));
|
|
84
|
-
})), this.otherFolders && s(h, null, s("hr", null), s("div", { class: "folders" }, (t = this.otherFolders) == null ? void 0 : t.map((e) => {
|
|
85
|
-
var o;
|
|
86
|
-
return s("sp-button", { onClick: () => this.folderSelectedHandler(e), class: {
|
|
87
|
-
folder: !0,
|
|
88
|
-
selected: f(e.name ?? "inbox").toLowerCase() === ((o = this.selectedFolder) == null ? void 0 : o.toLowerCase())
|
|
89
|
-
} }, s("div", { slot: "icon", class: "icon" }, this.getFolderIcon(e)), this.formatFolderName(e));
|
|
90
|
-
}))));
|
|
91
|
-
}
|
|
92
|
-
static get watchers() {
|
|
93
|
-
return {
|
|
94
|
-
folders: ["watchFolders"]
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
v([
|
|
99
|
-
b({
|
|
100
|
-
name: "nylas-pagination",
|
|
101
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
102
|
-
["mailbox.folders", "folders"],
|
|
103
|
-
["mailbox.selectedFolder", "selectedFolder"]
|
|
104
|
-
]),
|
|
105
|
-
eventToProps: {
|
|
106
|
-
folderSelected: async (r, t) => {
|
|
107
|
-
d("[nylas-list-folders] folderSelected event", { _event: r }), await t.threads.getThreads({
|
|
108
|
-
page_token: void 0,
|
|
109
|
-
in: f(r.detail.id ?? "inbox")
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
fireRegisterEvent: !0
|
|
114
|
-
}),
|
|
115
|
-
c("design:type", Function),
|
|
116
|
-
c("design:paramtypes", []),
|
|
117
|
-
c("design:returntype", void 0)
|
|
118
|
-
], m.prototype, "render", null);
|
|
119
|
-
m.style = C;
|
|
120
|
-
export {
|
|
121
|
-
m as nylas_list_folders
|
|
122
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { r as m, c as u, h as a, H as h } from "./index-db0c5017.js";
|
|
2
|
-
import { R as y } from "./register-component-dc659dc3-e43e8fae.js";
|
|
3
|
-
import { d as n, a as f, b } from "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
7
|
-
const v = ':host{display:block;font-size:var(--nylas-font-size, inherit);font-family:var(--nylas-font-family, inherit)}.list-thread{display:grid;grid-auto-flow:row;color:var(--nylas-color-primary-800);width:100%}.thread{position:relative;width:100%;display:grid;padding:0.5rem 1rem;column-gap:0.25rem;grid-template-areas:"........ from count ....... date actions" "checkbox subject subject subject subject actions" "........ snippet snippet snippet snippet actions";grid-template-columns:auto auto auto auto auto auto;margin-bottom:0.75rem;border-radius:var(--nylas-border-radius-2x);color:var(--nylas-color-primary-00);background-color:var(--nylas-color-primary-50);border:0;box-sizing:border-box;text-align:left;cursor:pointer;box-shadow:1px 1px 3px 0px rgba(0, 0, 0, 0.3);font-size:inherit;font-family:inherit}.thread.loading{animation:pulsate 1.5s infinite ease-in-out;width:100%;height:90px}.thread:last-of-type{margin-bottom:0}.thread.selected{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread:hover{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread>div{align-self:center;pointer-events:all !important}.thread .actions{grid-area:actions}.thread .actions sp-action-menu{pointer-events:initial !important}.thread .actions sp-action-button{pointer-events:initial !important}.thread .actions sp-menu-item{pointer-events:initial !important}.thread .checkbox{grid-area:checkbox;margin-right:0.5rem;pointer-events:initial !important}.thread .checkbox sp-checkbox{pointer-events:initial !important}.thread .star{grid-area:star;justify-self:end}.thread .from{grid-area:from;color:var(--nylas-color-primary-600)}.thread .count{grid-area:count;color:var(--nylas-color-primary-600)}.thread .subject{grid-area:subject;color:var(--nylas-color-primary-600)}.thread .snippet{grid-area:snippet;color:var(--nylas-color-primary-500)}.thread .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-500)}.thread.unread .from,.thread.unread .count,.thread.unread .subject,.thread.unread .date{font-weight:600;color:var(--nylas-color-primary-800)}.thread.unread .snippet{color:var(--nylas-color-primary-700)}.thread .from{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .snippet{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .subject{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (min-width: 768px){.thread{column-gap:1rem;grid-template-areas:"checkbox from count subject snippet date actions";grid-template-columns:auto minmax(auto, 200px) auto auto 1fr auto auto;margin-bottom:0.5rem;border:1px solid var(--nylas-color-primary-100)}.thread.no-checkbox{grid-template-areas:"from count subject snippet date actions";grid-template-columns:minmax(auto, 200px) auto auto 1fr auto auto}.thread .checkbox{margin-right:0}}@keyframes pulsate{0%{background-color:var(--nylas-color-primary-50)}50%{background-color:var(--nylas-color-primary-100)}100%{background-color:var(--nylas-color-primary-50)}}', g = v;
|
|
8
|
-
var x = function(e, t, r, i) {
|
|
9
|
-
var s = arguments.length, o = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, r) : i, l;
|
|
10
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
o = Reflect.decorate(e, t, r, i);
|
|
12
|
-
else
|
|
13
|
-
for (var c = e.length - 1; c >= 0; c--)
|
|
14
|
-
(l = e[c]) && (o = (s < 3 ? l(o) : s > 3 ? l(t, r, o) : l(t, r)) || o);
|
|
15
|
-
return s > 3 && o && Object.defineProperty(t, r, o), o;
|
|
16
|
-
}, d = function(e, t) {
|
|
17
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
|
-
return Reflect.metadata(e, t);
|
|
19
|
-
};
|
|
20
|
-
const p = class {
|
|
21
|
-
constructor(e) {
|
|
22
|
-
m(this, e), this.threadSelected = u(this, "threadSelected", 7), this.handleThreadSelected = async (t) => {
|
|
23
|
-
n("[nylas-list-threads] Thread selected", { thread: t }), this.threadSelected.emit(t).defaultPrevented || n("[nylas-list-threads] Default event not prevented, selecting thread");
|
|
24
|
-
}, this.handleCheckboxClick = async (t) => {
|
|
25
|
-
n("[nylas-list-threads] Checkbox clicked", { event: t }), t.stopPropagation();
|
|
26
|
-
}, this.threads = [], this.isAuthenticated = !1, this.tokenInfo = void 0, this.state = "ready", this.showCheckbox = !1;
|
|
27
|
-
}
|
|
28
|
-
connectedCallback() {
|
|
29
|
-
}
|
|
30
|
-
disconnectedCallback() {
|
|
31
|
-
}
|
|
32
|
-
async componentWillLoad() {
|
|
33
|
-
n("[nylas-list-threads] Component will load");
|
|
34
|
-
}
|
|
35
|
-
async componentDidLoad() {
|
|
36
|
-
n("[nylas-list-threads] Component did load", { isAuthenticated: this.isAuthenticated });
|
|
37
|
-
}
|
|
38
|
-
render() {
|
|
39
|
-
return a(h, { key: "4cd99954b325347a5bcf2fdda5440224f188ca4d" }, a("div", { key: "876dd6bf8cd63ce8c8ca9894559b32b3c5885597", class: "list-thread", part: "list-thread" }, this.state === "loading" && new Array(10).fill(0).map((e, t) => a("div", { class: "thread loading", style: { animationDelay: `${t * 20}ms` } })), this.state === "ready" && this.threads.map((e) => {
|
|
40
|
-
var t, r, i, s;
|
|
41
|
-
return a("button", { key: e == null ? void 0 : e.id, class: {
|
|
42
|
-
thread: !0,
|
|
43
|
-
unread: (e == null ? void 0 : e.unread) === !0,
|
|
44
|
-
"no-checkbox": this.showCheckbox === !1
|
|
45
|
-
}, part: "thread", "aria-label": `Thread with subject ${e == null ? void 0 : e.subject}`, onClick: () => this.handleThreadSelected(e) }, this.showCheckbox && a("div", { class: "checkbox", part: "checkbox" }, a("sp-checkbox", { size: "s", value: e == null ? void 0 : e.id, onClick: this.handleCheckboxClick })), a("div", { class: "from", part: "from" }, f(e.participants ?? [], (t = this.tokenInfo) == null ? void 0 : t.email, ((r = e == null ? void 0 : e.message_ids) == null ? void 0 : r.length) || 1, 1)), a("div", { class: "subject", part: "subject" }, e == null ? void 0 : e.subject), a("div", { class: "count", part: "count" }, ((i = e == null ? void 0 : e.message_ids) == null ? void 0 : i.length) || 1), a("div", { class: "snippet", part: "snippet" }, (s = e == null ? void 0 : e.snippet) == null ? void 0 : s.trim()), e.latest_message_received_date && a("div", { class: "date", "aria-label": `${Intl.DateTimeFormat(void 0, { dateStyle: "full" }).format(new Date(e.latest_message_received_date * 1e3))}`, part: "date" }, b(e.latest_message_received_date)));
|
|
46
|
-
})));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
x([
|
|
50
|
-
y({
|
|
51
|
-
name: "nylas-list-threads",
|
|
52
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
53
|
-
["auth.isAuthenticated", "isAuthenticated"],
|
|
54
|
-
["auth.tokenInfo", "tokenInfo"],
|
|
55
|
-
["mailbox.threads", "threads"],
|
|
56
|
-
["mailbox.state", "state"]
|
|
57
|
-
]),
|
|
58
|
-
eventToProps: {
|
|
59
|
-
threadSelected: async (e, t) => {
|
|
60
|
-
n("[nylas-list-threads] Thread selected", { event: e }), await t.threads.selectThread(e.detail);
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
fireRegisterEvent: !0
|
|
64
|
-
}),
|
|
65
|
-
d("design:type", Function),
|
|
66
|
-
d("design:paramtypes", []),
|
|
67
|
-
d("design:returntype", void 0)
|
|
68
|
-
], p.prototype, "render", null);
|
|
69
|
-
p.style = g;
|
|
70
|
-
export {
|
|
71
|
-
p as nylas_list_threads
|
|
72
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-2b8437d6.cjs"),u=require("./register-component-dc659dc3-fb85ee68.cjs"),i=require("./utils-c00bdc3c-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const h=':host{display:block;font-size:var(--nylas-font-size, inherit);font-family:var(--nylas-font-family, inherit)}.list-thread{display:grid;grid-auto-flow:row;color:var(--nylas-color-primary-800);width:100%}.thread{position:relative;width:100%;display:grid;padding:0.5rem 1rem;column-gap:0.25rem;grid-template-areas:"........ from count ....... date actions" "checkbox subject subject subject subject actions" "........ snippet snippet snippet snippet actions";grid-template-columns:auto auto auto auto auto auto;margin-bottom:0.75rem;border-radius:var(--nylas-border-radius-2x);color:var(--nylas-color-primary-00);background-color:var(--nylas-color-primary-50);border:0;box-sizing:border-box;text-align:left;cursor:pointer;box-shadow:1px 1px 3px 0px rgba(0, 0, 0, 0.3);font-size:inherit;font-family:inherit}.thread.loading{animation:pulsate 1.5s infinite ease-in-out;width:100%;height:90px}.thread:last-of-type{margin-bottom:0}.thread.selected{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread:hover{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread>div{align-self:center;pointer-events:all !important}.thread .actions{grid-area:actions}.thread .actions sp-action-menu{pointer-events:initial !important}.thread .actions sp-action-button{pointer-events:initial !important}.thread .actions sp-menu-item{pointer-events:initial !important}.thread .checkbox{grid-area:checkbox;margin-right:0.5rem;pointer-events:initial !important}.thread .checkbox sp-checkbox{pointer-events:initial !important}.thread .star{grid-area:star;justify-self:end}.thread .from{grid-area:from;color:var(--nylas-color-primary-600)}.thread .count{grid-area:count;color:var(--nylas-color-primary-600)}.thread .subject{grid-area:subject;color:var(--nylas-color-primary-600)}.thread .snippet{grid-area:snippet;color:var(--nylas-color-primary-500)}.thread .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-500)}.thread.unread .from,.thread.unread .count,.thread.unread .subject,.thread.unread .date{font-weight:600;color:var(--nylas-color-primary-800)}.thread.unread .snippet{color:var(--nylas-color-primary-700)}.thread .from{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .snippet{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .subject{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (min-width: 768px){.thread{column-gap:1rem;grid-template-areas:"checkbox from count subject snippet date actions";grid-template-columns:auto minmax(auto, 200px) auto auto 1fr auto auto;margin-bottom:0.5rem;border:1px solid var(--nylas-color-primary-100)}.thread.no-checkbox{grid-template-areas:"from count subject snippet date actions";grid-template-columns:minmax(auto, 200px) auto auto 1fr auto auto}.thread .checkbox{margin-right:0}}@keyframes pulsate{0%{background-color:var(--nylas-color-primary-50)}50%{background-color:var(--nylas-color-primary-100)}100%{background-color:var(--nylas-color-primary-50)}}',m=h;var y=function(e,t,r,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,s);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(o=(n<3?l(o):n>3?l(t,r,o):l(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},d=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const p=class{constructor(e){a.registerInstance(this,e),this.threadSelected=a.createEvent(this,"threadSelected",7),this.handleThreadSelected=async t=>{i.debug("[nylas-list-threads] Thread selected",{thread:t}),this.threadSelected.emit(t).defaultPrevented||i.debug("[nylas-list-threads] Default event not prevented, selecting thread")},this.handleCheckboxClick=async t=>{i.debug("[nylas-list-threads] Checkbox clicked",{event:t}),t.stopPropagation()},this.threads=[],this.isAuthenticated=!1,this.tokenInfo=void 0,this.state="ready",this.showCheckbox=!1}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){i.debug("[nylas-list-threads] Component will load")}async componentDidLoad(){i.debug("[nylas-list-threads] Component did load",{isAuthenticated:this.isAuthenticated})}render(){return a.h(a.Host,{key:"4cd99954b325347a5bcf2fdda5440224f188ca4d"},a.h("div",{key:"876dd6bf8cd63ce8c8ca9894559b32b3c5885597",class:"list-thread",part:"list-thread"},this.state==="loading"&&new Array(10).fill(0).map((e,t)=>a.h("div",{class:"thread loading",style:{animationDelay:`${t*20}ms`}})),this.state==="ready"&&this.threads.map(e=>{var t,r,s,n;return a.h("button",{key:e==null?void 0:e.id,class:{thread:!0,unread:(e==null?void 0:e.unread)===!0,"no-checkbox":this.showCheckbox===!1},part:"thread","aria-label":`Thread with subject ${e==null?void 0:e.subject}`,onClick:()=>this.handleThreadSelected(e)},this.showCheckbox&&a.h("div",{class:"checkbox",part:"checkbox"},a.h("sp-checkbox",{size:"s",value:e==null?void 0:e.id,onClick:this.handleCheckboxClick})),a.h("div",{class:"from",part:"from"},i.formatParticipants(e.participants??[],(t=this.tokenInfo)==null?void 0:t.email,((r=e==null?void 0:e.message_ids)==null?void 0:r.length)||1,1)),a.h("div",{class:"subject",part:"subject"},e==null?void 0:e.subject),a.h("div",{class:"count",part:"count"},((s=e==null?void 0:e.message_ids)==null?void 0:s.length)||1),a.h("div",{class:"snippet",part:"snippet"},(n=e==null?void 0:e.snippet)==null?void 0:n.trim()),e.latest_message_received_date&&a.h("div",{class:"date","aria-label":`${Intl.DateTimeFormat(void 0,{dateStyle:"full"}).format(new Date(e.latest_message_received_date*1e3))}`,part:"date"},i.formatDateTime(e.latest_message_received_date)))})))}};y([u.RegisterComponent({name:"nylas-list-threads",stateToProps:new Map([["auth.isAuthenticated","isAuthenticated"],["auth.tokenInfo","tokenInfo"],["mailbox.threads","threads"],["mailbox.state","state"]]),eventToProps:{threadSelected:async(e,t)=>{i.debug("[nylas-list-threads] Thread selected",{event:e}),await t.threads.selectThread(e.detail)}},fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],p.prototype,"render",null);p.style=m;exports.nylas_list_threads=p;
|