@nylas/react 1.1.0-canary.17 → 1.1.0-canary.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/add-circle-icon_2.entry-3ca337a6.js +25 -0
  2. package/dist/add-circle-icon_2.entry-adde5fdf.cjs +1 -0
  3. package/dist/{archive-icon_7.entry-8c8317e9.cjs → archive-icon_7.entry-2b56ef80.cjs} +1 -1
  4. package/dist/{archive-icon_7.entry-60e900b6.js → archive-icon_7.entry-896a1054.js} +14 -14
  5. package/dist/{arrow-icon.entry-2d4e9572.cjs → arrow-icon.entry-0288f3fc.cjs} +1 -1
  6. package/dist/arrow-icon.entry-9aaa93fd.js +15 -0
  7. package/dist/{bold-icon_3.entry-557c6007.js → bold-icon_3.entry-0061cf1f.js} +6 -6
  8. package/dist/{bold-icon_3.entry-ba732761.cjs → bold-icon_3.entry-e7810620.cjs} +1 -1
  9. package/dist/button-component_4.entry-276606e6.js +115 -0
  10. package/dist/button-component_4.entry-e53a8f37.cjs +1 -0
  11. package/dist/calendar-agenda-fill-icon_35.entry-a19cae9c.js +4178 -0
  12. package/dist/calendar-agenda-fill-icon_35.entry-fa968081.cjs +7 -0
  13. package/dist/{calendar-cancel-icon.entry-820cf967.js → calendar-cancel-icon.entry-71eae711.js} +5 -5
  14. package/dist/{calendar-cancel-icon.entry-b2657caf.cjs → calendar-cancel-icon.entry-8e8b25b6.cjs} +1 -1
  15. package/dist/{calendar-check-icon_2.entry-b13e7cbb.cjs → calendar-check-icon_2.entry-562e98cf.cjs} +1 -1
  16. package/dist/{calendar-check-icon_2.entry-128a5d67.js → calendar-check-icon_2.entry-6f971ca2.js} +9 -9
  17. package/dist/{calendar-icon.entry-d17d7cfb.cjs → calendar-icon.entry-3a59af30.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-a43e6011.js → calendar-icon.entry-3e496896.js} +2 -2
  19. package/dist/{chevron-icon_3.entry-e0796c69.js → chevron-icon_3.entry-7eac0ed5.js} +37 -34
  20. package/dist/chevron-icon_3.entry-7ff10540.cjs +1 -0
  21. package/dist/{clock-icon_2.entry-e959ae50.js → clock-icon_2.entry-120d672e.js} +9 -9
  22. package/dist/{clock-icon_2.entry-267614c2.cjs → clock-icon_2.entry-43873262.cjs} +1 -1
  23. package/dist/{constants-f34b9c6e-ebc2e19c.cjs → constants-7ce66b44-a951d78c.cjs} +5 -5
  24. package/dist/{constants-f34b9c6e-efe2836b.js → constants-7ce66b44-e7ca66c2.js} +484 -383
  25. package/dist/copy-icon_4.entry-57874c4f.cjs +1 -0
  26. package/dist/copy-icon_4.entry-9a949d24.js +45 -0
  27. package/dist/{document-refresh-icon.entry-b4c217df.js → document-refresh-icon.entry-f0d95ac8.js} +5 -5
  28. package/dist/{document-refresh-icon.entry-b8850675.cjs → document-refresh-icon.entry-f1d3f32d.cjs} +1 -1
  29. package/dist/elements/index.d.ts +14 -0
  30. package/dist/{elements-dc5b338e-a33785e3.cjs → elements-dc5b338e-62b53496.cjs} +1 -1
  31. package/dist/{elements-dc5b338e-b0a290ae.js → elements-dc5b338e-974e2077.js} +1 -1
  32. package/dist/{focus-visible-e8093c16-5f1ae916.js → focus-visible-e8093c16-7a512fc0.js} +1 -1
  33. package/dist/{focus-visible-e8093c16-d2afb13d.cjs → focus-visible-e8093c16-923e1041.cjs} +1 -1
  34. package/dist/{forward-icon_6.entry-0009e4f0.cjs → forward-icon_6.entry-45b70066.cjs} +2 -2
  35. package/dist/{forward-icon_6.entry-53683e82.js → forward-icon_6.entry-675c0b73.js} +9 -9
  36. package/dist/{globe-icon.entry-dbb47687.js → globe-icon.entry-3296e427.js} +2 -2
  37. package/dist/{globe-icon.entry-df67eab8.cjs → globe-icon.entry-7ecd6221.cjs} +1 -1
  38. package/dist/google-logo-icon_4.entry-aa9f8b35.js +584 -0
  39. package/dist/google-logo-icon_4.entry-fd734a59.cjs +1 -0
  40. package/dist/index-53420959-1c0d390d.js +5 -0
  41. package/dist/index-53420959-8e7b10db.cjs +1 -0
  42. package/dist/{index-5851f0a2.js → index-5efb84b8.js} +813 -793
  43. package/dist/{index-6d9eeb53-2f37342f.js → index-6d9eeb53-4e2a7f9f.js} +2 -2
  44. package/dist/{index-6d9eeb53-ded66877.cjs → index-6d9eeb53-aa1dfa96.cjs} +1 -1
  45. package/dist/index-d36b8fb8.cjs +42 -0
  46. package/dist/{index.es-9cc0eb3c-2cf4632f.js → index.es-9cc0eb3c-65f8af0c.js} +1 -1
  47. package/dist/{index.es-9cc0eb3c-e8de46e6.cjs → index.es-9cc0eb3c-8eefd4fc.cjs} +1 -1
  48. package/dist/{info-icon_2.entry-e355fb7d.cjs → info-icon_2.entry-e612f1d6.cjs} +1 -1
  49. package/dist/{info-icon_2.entry-c27ac645.js → info-icon_2.entry-f06c8dd0.js} +3 -3
  50. package/dist/{input-dropdown_2.entry-9e50060e.cjs → input-dropdown_2.entry-ad380260.cjs} +1 -1
  51. package/dist/{input-dropdown_2.entry-ce1da1b3.js → input-dropdown_2.entry-ccd95678.js} +3 -3
  52. package/dist/loading-icon.entry-678a6b3f.cjs +1 -0
  53. package/dist/{loading-icon.entry-4ab88ed8.js → loading-icon.entry-9e6670d5.js} +2 -2
  54. package/dist/{mailbox-store-64b4ef7c-ebe84c96.cjs → mailbox-store-64b4ef7c-9bd02ffd.cjs} +1 -1
  55. package/dist/{mailbox-store-64b4ef7c-47dac9aa.js → mailbox-store-64b4ef7c-b56d5e78.js} +2 -2
  56. package/dist/multi-select-dropdown.entry-5bb80d89.cjs +1 -0
  57. package/dist/multi-select-dropdown.entry-edf10867.js +91 -0
  58. package/dist/{nylas-booked-event-card_10.entry-ef9c2d62.js → nylas-booked-event-card_10.entry-92f6e85d.js} +276 -244
  59. package/dist/nylas-booked-event-card_10.entry-ad4671b2.cjs +1 -0
  60. package/dist/{nylas-custom-booking-flow.entry-f31400e2.js → nylas-custom-booking-flow.entry-b39a2bf2.js} +3 -3
  61. package/dist/{nylas-custom-booking-flow.entry-c59c1306.cjs → nylas-custom-booking-flow.entry-cef0041a.cjs} +1 -1
  62. package/dist/{nylas-form-card.entry-b189e066.js → nylas-form-card.entry-bf4545e2.js} +18 -18
  63. package/dist/{nylas-form-card.entry-bc048703.cjs → nylas-form-card.entry-fba5d623.cjs} +1 -1
  64. package/dist/{nylas-if-state.entry-5bdf8669.js → nylas-if-state.entry-2739dc10.js} +3 -3
  65. package/dist/{nylas-if-state.entry-933c79e0.cjs → nylas-if-state.entry-d7b818a6.cjs} +1 -1
  66. package/dist/{nylas-list-folders.entry-5d1bef7f.cjs → nylas-list-folders.entry-0ec6ba20.cjs} +1 -1
  67. package/dist/{nylas-list-folders.entry-f0e7ae4e.js → nylas-list-folders.entry-3197e390.js} +3 -3
  68. package/dist/{nylas-list-threads.entry-3e300e7e.cjs → nylas-list-threads.entry-2a7e1e84.cjs} +1 -1
  69. package/dist/{nylas-list-threads.entry-3f7451ad.js → nylas-list-threads.entry-9004c490.js} +3 -3
  70. package/dist/{nylas-login.entry-dbf9e11f.cjs → nylas-login.entry-c2ffd6a5.cjs} +1 -1
  71. package/dist/{nylas-login.entry-e3b757a0.js → nylas-login.entry-f2927406.js} +7 -7
  72. package/dist/{nylas-mailbox-pagination.entry-0db12a01.cjs → nylas-mailbox-pagination.entry-839c9ad3.cjs} +1 -1
  73. package/dist/{nylas-mailbox-pagination.entry-6c845a2a.js → nylas-mailbox-pagination.entry-e9356835.js} +2 -2
  74. package/dist/{nylas-mailbox-toolbar-button.entry-ec196947.js → nylas-mailbox-toolbar-button.entry-298a3c47.js} +4 -4
  75. package/dist/{nylas-mailbox-toolbar-button.entry-553f041a.cjs → nylas-mailbox-toolbar-button.entry-43812d51.cjs} +1 -1
  76. package/dist/{nylas-mailbox.entry-1552ad11.js → nylas-mailbox.entry-aa42f6c4.js} +7 -7
  77. package/dist/{nylas-mailbox.entry-c0bbca56.cjs → nylas-mailbox.entry-cf13ddf5.cjs} +1 -1
  78. package/dist/{nylas-provider.entry-6d286e92.js → nylas-provider.entry-1a3a195f.js} +8 -8
  79. package/dist/{nylas-provider.entry-d4bf23c2.cjs → nylas-provider.entry-843b5593.cjs} +1 -1
  80. package/dist/nylas-scheduler-editor.entry-048e7a8f.cjs +2 -0
  81. package/dist/{nylas-scheduler-editor.entry-caa1026b.js → nylas-scheduler-editor.entry-d56d6d2a.js} +138 -119
  82. package/dist/nylas-scheduling.entry-0ad9b1d0.cjs +1 -0
  83. package/dist/{nylas-scheduling.entry-19ff3d50.js → nylas-scheduling.entry-7039a890.js} +52 -52
  84. package/dist/{nylas-threads-refresh.entry-bc4c10ea.cjs → nylas-threads-refresh.entry-9cae6ac8.cjs} +1 -1
  85. package/dist/{nylas-threads-refresh.entry-6acf3c2b.js → nylas-threads-refresh.entry-d951050a.js} +4 -4
  86. package/dist/{nylas-threads-search.entry-ee28712c.cjs → nylas-threads-search.entry-0d34c5a8.cjs} +1 -1
  87. package/dist/{nylas-threads-search.entry-82fa1504.js → nylas-threads-search.entry-7a4bbc75.js} +8 -8
  88. package/dist/{nylas-time-window-picker.entry-131f84b4.cjs → nylas-time-window-picker.entry-062bc8c1.cjs} +1 -1
  89. package/dist/{nylas-time-window-picker.entry-3c45d82e.js → nylas-time-window-picker.entry-210c3f1a.js} +2 -2
  90. package/dist/{nylas-view-thread.entry-695a7b0b.js → nylas-view-thread.entry-8b39a997.js} +6 -6
  91. package/dist/{nylas-view-thread.entry-0d9a4aa9.cjs → nylas-view-thread.entry-db78ed9c.cjs} +1 -1
  92. package/dist/play-icon_2.entry-19271982.cjs +1 -0
  93. package/dist/play-icon_2.entry-c53f3cac.js +25 -0
  94. package/dist/react.cjs +1 -1
  95. package/dist/react.js +115 -101
  96. package/dist/{refresh-icon.entry-43267155.js → refresh-icon.entry-75139a0c.js} +2 -2
  97. package/dist/{refresh-icon.entry-28e3ade7.cjs → refresh-icon.entry-e695cf7f.cjs} +1 -1
  98. package/dist/{register-component-a5a9ca5d-538c35c3.js → register-component-a5a9ca5d-d69a7a05.js} +1 -1
  99. package/dist/{register-component-a5a9ca5d-8b06415c.cjs → register-component-a5a9ca5d-eebf89e7.cjs} +1 -1
  100. package/dist/scheduler-config-store-9ccfba4d-22a58b7d.cjs +1 -0
  101. package/dist/{scheduler-config-store-4a50a03d-4a2e2abf.js → scheduler-config-store-9ccfba4d-fd62a421.js} +8 -6
  102. package/dist/{scheduler-store-f02ce045-121c1e09.js → scheduler-store-8a400448-3b007d4d.js} +125 -96
  103. package/dist/scheduler-store-8a400448-44e0edad.cjs +1 -0
  104. package/dist/{textarea-component.entry-402a369b.cjs → textarea-component.entry-48feabb3.cjs} +1 -1
  105. package/dist/{textarea-component.entry-1ec19adb.js → textarea-component.entry-ead5ab00.js} +7 -6
  106. package/dist/{translate-icon.entry-d412697e.js → translate-icon.entry-55043beb.js} +6 -6
  107. package/dist/{translate-icon.entry-59f4e190.cjs → translate-icon.entry-5f62bc61.cjs} +1 -1
  108. package/dist/{warning-icon.entry-aa6b2c2c.cjs → warning-icon.entry-2e0a80da.cjs} +1 -1
  109. package/dist/{warning-icon.entry-3ee1f451.js → warning-icon.entry-fa644462.js} +5 -5
  110. package/package.json +3 -3
  111. package/dist/add-circle-icon_2.entry-936fd73b.cjs +0 -1
  112. package/dist/add-circle-icon_2.entry-ce6aaa1d.js +0 -25
  113. package/dist/arrow-icon.entry-057db95a.js +0 -15
  114. package/dist/button-component.entry-22d0ac2e.js +0 -16
  115. package/dist/button-component.entry-385f9581.cjs +0 -1
  116. package/dist/calendar-info-icon_28.entry-b4f09bfe.cjs +0 -1
  117. package/dist/calendar-info-icon_28.entry-b71c23c5.js +0 -2083
  118. package/dist/chevron-icon_3.entry-4807a0b1.cjs +0 -1
  119. package/dist/google-logo-icon_4.entry-77f3b86e.js +0 -454
  120. package/dist/google-logo-icon_4.entry-c5db1be3.cjs +0 -1
  121. package/dist/index-53420959-16700a42.cjs +0 -1
  122. package/dist/index-53420959-f0c4f9af.js +0 -5
  123. package/dist/index-769f0fdd.cjs +0 -42
  124. package/dist/input-component.entry-a38a65da.js +0 -45
  125. package/dist/input-component.entry-ef2b397d.cjs +0 -1
  126. package/dist/loading-icon.entry-175aca19.cjs +0 -1
  127. package/dist/nylas-booked-event-card_10.entry-6de99d57.cjs +0 -1
  128. package/dist/nylas-scheduler-editor.entry-00a71304.cjs +0 -2
  129. package/dist/nylas-scheduling.entry-f1fb67d2.cjs +0 -1
  130. package/dist/play-icon_2.entry-ab47588e.js +0 -25
  131. package/dist/play-icon_2.entry-b1167d3a.cjs +0 -1
  132. package/dist/scheduler-config-store-4a50a03d-40e87f35.cjs +0 -1
  133. package/dist/scheduler-store-f02ce045-f11cfad9.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-769f0fdd.cjs");require("react");require("react-dom");const h=".sc-chevron-icon-h{display:flex}",c=h,r=class{constructor(e){i.registerInstance(this,e),this.width="24",this.height="24"}render(){return i.h("svg",{key:"4ba6273520a7838da14673321dc5eb2318fddeda",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none"},i.h("path",{key:"081c33497ba302b5749c947d191e9df31d749a15",fill:"currentColor",d:"M15.53 4.22a.75.75 0 0 1 0 1.06L8.81 12l6.72 6.72a.75.75 0 1 1-1.06 1.06l-7.25-7.25a.75.75 0 0 1 0-1.06l7.25-7.25a.75.75 0 0 1 1.06 0Z"}))}};r.style=c;const p=".sc-search-icon-h{display:flex}",f=p,l=class{constructor(e){i.registerInstance(this,e),this.width="15",this.height="15"}render(){return i.h("svg",{key:"c5f52e97100ef84d45a60c75a6edad451b809b47",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{key:"83edc5203bf11c7774aa44c1d8442c5b6b0e4f1c",fill:"currentColor",d:"M5.5 0C8.53757 0 11 2.46243 11 5.5C11 6.83879 10.5217 8.06586 9.72656 9.01962L13.8536 13.1464C14.0488 13.3417 14.0488 13.6583 13.8536 13.8536C13.68 14.0271 13.4106 14.0464 13.2157 13.9114L13.1464 13.8536L9.01962 9.72656C8.06586 10.5217 6.83879 11 5.5 11C2.46243 11 0 8.53757 0 5.5C0 2.46243 2.46243 0 5.5 0ZM5.5 1C3.01472 1 1 3.01472 1 5.5C1 7.98528 3.01472 10 5.5 10C7.98528 10 10 7.98528 10 5.5C10 3.01472 7.98528 1 5.5 1Z"}))}};l.style=f;const b=':host{display:block;position:relative;--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;width:100%}@media screen and (max-width: 768px){:host{position:unset}}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.dropdown{display:inline-block;width:inherit}.dropbtn{color:var(--nylas-base-800);padding:14px;font-size:1rem;font-family:var(--nylas-font-family);cursor:pointer;display:flex;justify-content:space-between;gap:0.5rem;background:transparent;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x)}.dropbtn.error{border:1px solid var(--nylas-error)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{outline:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.chevron{display:flex;align-self:center}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropbtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.dropbtn span.selected-option{max-width:124px;font-size:16px}}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1)}@media screen and (max-width: 768px){.dropdown-content{right:0;width:325px;max-width:unset}}.search-box{border-bottom:1px solid var(--nylas-base-200);padding:10px;position:sticky;top:0;background:var(--nylas-base-0)}.search-box .icon{position:absolute;top:1.25rem;left:1.25rem;color:var(--nylas-base-300)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content .selected{background-color:#e7e7e7}input[type=text]{width:-webkit-fill-available;padding:inherit;border:1px solid #ccc;border-radius:4px;position:sticky;background:no-repeat scroll 7px 7px;padding-left:30px;background-size:16px 16px}',u=b,d=class{constructor(e){i.registerInstance(this,e),this.nylasFormDropdownChanged=i.createEvent(this,"nylasFormDropdownChanged",7),this.name=void 0,this.options=[],this.defaultSelectedOption=void 0,this.withSearch=!0,this.label=void 0,this.required=!1,this.pluralizedLabel="",this.selectedOption=this.defaultSelectedOption||null,this.isOpen=!1,this.searchValue="",this.filteredOptions=[...this.options],this.ariaActivedescendant="",this.errorMessage=""}optionsChangedHandler(e,s){e!==s&&(this.filteredOptions=e)}defaultSelectedOptionChangedHandler(e,s){e.label!==s.label&&(this.selectedOption=e)}componentWillLoad(){this.filteredOptions=this.options,!this.selectedOption&&this.defaultSelectedOption&&(this.selectedOption=this.defaultSelectedOption),!this.selectedOption&&this.options.length>0&&(this.selectedOption=this.options[0])}handleBookingFormSubmitted(e){var s;this.validate(((s=this.selectedOption)==null?void 0:s.value)||""),this.errorMessage&&e.preventDefault()}validate(e){this.required&&!e?this.errorMessage=`${this.label} is required.`:this.errorMessage=""}toggleDropdown(){this.isOpen=!this.isOpen}filterOptions(e){const s=e.target.value;this.searchValue=s,this.filteredOptions=this.options.filter(t=>t.label.toLowerCase().includes(s.toLowerCase()))}selectOption(e){this.errorMessage="",this.selectedOption=e,this.toggleDropdown(),this.nylasFormDropdownChanged.emit({value:e.value,name:this.name,error:this.errorMessage,label:this.label})}handleSelectButtonKeyDown(e){var s;switch(e.key){case"ArrowDown":case"Enter":e.preventDefault(),this.isOpen||this.toggleDropdown(),(s=this.inputRef)==null||s.focus();break;case"Escape":this.isOpen=!1;break}}handleListboxKeydown(e){var a,o;const s=this.filteredOptions,t=s.findIndex(n=>n.value===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){if(e.preventDefault(),t===s.length-1){this.ariaActivedescendant="",(a=this.inputRef)==null||a.focus();return}const n=t+1<s.length?t+1:0;this.ariaActivedescendant=s[n].value,this.focusOption(n)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){if(e.preventDefault(),t===0){this.ariaActivedescendant="",(o=this.inputRef)==null||o.focus();return}const n=t-1>=0?t-1:s.length-1;this.ariaActivedescendant=s[n].value,this.focusOption(n)}else e.key==="Enter"?(e.preventDefault(),this.ariaActivedescendant&&this.selectOption(s[t])):e.key==="Escape"&&(this.isOpen=!1)}focusOption(e){var o;const s=this.filteredOptions[e];if(!s)return;const t=s.value,a=(o=this.el.shadowRoot)==null?void 0:o.getElementById(t);a&&(a.focus(),a.scrollIntoView({behavior:"smooth",block:"nearest"}))}handleComboboxKeyDown(e){e.key==="ArrowDown"||e.key=="Tab"&&!e.shiftKey?(e.preventDefault(),this.ariaActivedescendant=this.filteredOptions[0].value,this.focusOption(0)):e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey?(e.preventDefault(),this.ariaActivedescendant=this.filteredOptions[this.filteredOptions.length-1].value,this.focusOption(this.filteredOptions.length-1)):e.key==="Escape"&&(this.isOpen=!1)}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.isOpen&&(this.isOpen=!1)}render(){var e,s;return i.h("div",{key:"5d9cc53d425973e986cf7861f68db93652264ea2",class:"dropdown",part:"sd_dropdown"},i.h("label",{key:"780b94df48c831b5228ca846f3349359e19fcae5",part:"sd_dropdown_label",class:{error:!!this.errorMessage}},this.label&&i.h("p",null,i.h("span",{class:"label"},this.label),this.required&&i.h("span",{class:"required"},"*")),i.h("button",{key:"c8aa297b734fe94b31e7dadff937e9339e997d57",part:"sd_dropdown-button",class:{dropbtn:!0,open:this.isOpen,error:!!this.errorMessage},onClick:()=>this.toggleDropdown(),"aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false","aria-label":this.name,onKeyDown:t=>this.handleSelectButtonKeyDown(t)},i.h("slot",{key:"35a42b7da19ae19d26c63f6555748b1756d8b509",name:"select-icon","aria-hidden":"true"}),i.h("span",{key:"0df568c4115508f832dbf15d29f6a2f91e855df5",class:"selected-option",part:"sd_dropdown-button-selected-label"},(e=this.selectedOption)!=null&&e.label?`${((s=this.selectedOption)==null?void 0:s.label)+this.pluralizedLabel}`:""),i.h("span",{key:"c1c2dab85d068a4da6550a45d505f7e44bef3098",class:{open:this.isOpen,closed:!this.isOpen,chevron:!0},"aria-hidden":"true"},i.h("chevron-icon",{key:"8a99c927af95bd100cea219d07afb9960ac11f33",width:"16",height:"16"}))),this.errorMessage&&i.h("span",{class:"error help-text"},this.errorMessage)),this.isOpen?i.h("div",{class:"dropdown-content",part:"sd_dropdown-content"},this.withSearch&&i.h("div",{class:{"search-box":!0,open:this.isOpen}},i.h("search-icon",{width:"15",height:"15",class:"icon"}),i.h("input",{type:"text",role:"combobox",placeholder:"Search",value:this.searchValue,ref:t=>this.inputRef=t,onInput:t=>this.filterOptions(t),onKeyDown:t=>this.handleComboboxKeyDown(t)})),i.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:t=>this.handleListboxKeydown(t)},this.filteredOptions.map(t=>t.value&&i.h("li",{tabindex:"0",key:t.value,id:t.value,onClick:()=>this.selectOption(t),role:"option"},t.labelHTML?t.labelHTML:t.label)))):null)}get el(){return i.getElement(this)}static get watchers(){return{options:["optionsChangedHandler"],defaultSelectedOption:["defaultSelectedOptionChangedHandler"]}}};d.style=u;exports.chevron_icon=r;exports.search_icon=l;exports.select_dropdown=d;
@@ -1,454 +0,0 @@
1
- import { r as H, h as e, c as m, x as at, d, y as q, H as K, g as Q } from "./index-5851f0a2.js";
2
- import { R as X } from "./register-component-a5a9ca5d-538c35c3.js";
3
- import { D as W } from "./constants-f34b9c6e-efe2836b.js";
4
- import "react";
5
- import "react-dom";
6
- const nt = ".sc-google-logo-icon-h{display:flex}", it = nt, st = class {
7
- constructor(t) {
8
- H(this, t), this.width = "24", this.height = "24";
9
- }
10
- render() {
11
- return e("svg", { key: "2b6d66fd099e97716cdb808f575b5aadf1503a06", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("g", { key: "2d02d3ca40389d13f189bddba578ae683c487d3e", "clip-path": "url(#clip0_959_12452)" }, e("path", { key: "41eeee9cdd77323ffee094ce688e222c2ae95461", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), e("path", { key: "7a8f1123dc6b8b29324eb255637f7b536982e112", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), e("path", { key: "e71780d270c31b20d6617deb912a0b74b3dc8004", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), e("path", { key: "4e8795414ed616287f7e315d9d4ae7882832c56c", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), e("defs", { key: "9ad522ed57a9d8c75d8515e0e0a1e64d1dcde3a0" }, e("clipPath", { key: "da8c3ef1116cd32e06a73e30c5c4bc335f209d5b", id: "clip0_959_12452" }, e("rect", { key: "8936b3346ec26a6c0901073adca44b8021661be6", width: 24, height: 24, fill: "white" }))));
12
- }
13
- };
14
- st.style = it;
15
- const ot = ".sc-microsoft-logo-icon-h{display:flex}", rt = ot, lt = class {
16
- constructor(t) {
17
- H(this, t), this.width = "22", this.height = "22";
18
- }
19
- render() {
20
- return e("svg", { key: "deae127512c4d2b6ef876ab1311fb6ab4d5cd368", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "ea58fbe3dac4c5a6455acec95fe9677068999d53", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), e("path", { key: "e8a2faf14e8a7cdf15808a1fac1b16fba79f6051", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), e("path", { key: "56644908156e19d4ba9eedfec54a9ffa9b9744bd", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), e("path", { key: "24c76e1b54ed1cdbc97ec6e56888db403169d74f", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
21
- }
22
- };
23
- lt.style = rt;
24
- function dt({ id: t, formState: a, activeTab: n, calendars: s }) {
25
- var o;
26
- switch (n) {
27
- case "eventInfo":
28
- const i = a.title, l = a.description, r = parseInt(a.duration), c = a.location;
29
- return e(
30
- "div",
31
- { key: t },
32
- e(
33
- "nylas-event-info",
34
- null,
35
- e(
36
- "div",
37
- { slot: "inputs" },
38
- e("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
39
- e("nylas-event-duration", { name: "duration", eventDurationMinutes: r, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
40
- e("nylas-event-location", { name: "location", eventLocation: c, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
41
- e("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
42
- )
43
- )
44
- );
45
- case "availability":
46
- const b = a.availability.openHours, f = a.availability.timezone ? a.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, p = (o = a.participants) == null ? void 0 : o.find((w) => w.is_organizer), g = (p == null ? void 0 : p.email) ?? "primary", _ = a.calendarIds.length > 0 ? a.calendarIds : [g], v = a.bookingCalendar == "primary" ? g : a.bookingCalendar;
47
- return e(
48
- "div",
49
- { key: t },
50
- e("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: s ?? [], defaultBookingCalendar: v, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
51
- e("nylas-calendar-picker", { name: "calendars", calendars: s ?? [], defaultSelectedCalendars: _, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
52
- e("nylas-availability-picker", { name: "availability", openHours: b, defaultTimezone: f, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
53
- );
54
- case "bookingOptions":
55
- return e(
56
- "div",
57
- { key: t },
58
- e("nylas-buffer-time", { name: "buffer-time", buffer: a.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
59
- e(
60
- "nylas-event-limits",
61
- null,
62
- e(
63
- "div",
64
- { slot: "inputs" },
65
- e("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: a.minBookingNotice, exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
66
- e("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: a.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
67
- e("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: a.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
68
- e("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: a.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
69
- )
70
- ),
71
- e("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(a.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
72
- e("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
73
- );
74
- case "participants":
75
- return e(
76
- "div",
77
- { key: t },
78
- e("nylas-additional-participants", { name: "participants", eventParticipants: a.participants, exportparts: "nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant" }),
79
- e("nylas-participants-custom-availability", { name: "participant-custom-availability", participants: a.participants, exportparts: "npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider" })
80
- );
81
- }
82
- }
83
- const ct = '.sc-nylas-editor-tabs-h{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}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', bt = ct;
84
- var ut = function(t, a, n, s) {
85
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, l;
86
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
87
- i = Reflect.decorate(t, a, n, s);
88
- else
89
- for (var r = t.length - 1; r >= 0; r--)
90
- (l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(a, n, i) : l(a, n)) || i);
91
- return o > 3 && i && Object.defineProperty(a, n, i), i;
92
- }, F = function(t, a) {
93
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
94
- return Reflect.metadata(t, a);
95
- };
96
- const Y = class {
97
- constructor(t) {
98
- H(this, t), this.schedulerConfigChanged = m(this, "schedulerConfigChanged", 7), this.cancelButtonClick = m(this, "cancelButtonClick", 7), this.formSubmitted = m(this, "formSubmitted", 7), this.previewButtonClicked = m(this, "previewButtonClicked", 7), this.setError = (a) => {
99
- this.error = a.message;
100
- }, this.formSubmissionHandler = async (a) => {
101
- var P, E, R, N, z, j, M, V, A, $, U;
102
- if (a.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
103
- return;
104
- this.isLoading = !0, this.hasUnsavedChanges = !1;
105
- const s = this.updateFormState(), { title: o, description: i, duration: l, availability: r, calendarIds: c, bookingCalendar: b, location: f, bookingType: p, buffer: g, availableDaysInFuture: _, minCancellationNotice: v, minBookingNotice: w, cancellationPolicy: S, timeslotInterval: h, additionalGuestsHidden: L, hideCancellationOptions: B, hideReschedulingOptions: D, participants: k, participantOpenHours: y } = s, C = l ? parseInt(l) : 30, x = {
106
- ...((P = this.selectedConfiguration) == null ? void 0 : P.id) && { id: this.selectedConfiguration.id },
107
- version: ((E = this.selectedConfiguration) == null ? void 0 : E.version) ?? "1.0.0",
108
- availability: {
109
- duration_minutes: C,
110
- interval_minutes: (h == null ? void 0 : h.interval) ?? C,
111
- round_to: h == null ? void 0 : h.roundTo,
112
- availability_rules: {
113
- availability_method: ((z = (N = (R = this.selectedConfiguration) == null ? void 0 : R.availability) == null ? void 0 : N.availability_rules) == null ? void 0 : z.availability_method) ?? "collective",
114
- buffer: g || { before: 0, after: 0 },
115
- default_open_hours: (r == null ? void 0 : r.openHours) ?? ((V = (M = (j = this.selectedConfiguration) == null ? void 0 : j.availability) == null ? void 0 : M.availability_rules) == null ? void 0 : V.default_open_hours) ?? W,
116
- round_robin_group_id: ((U = ($ = (A = this.selectedConfiguration) == null ? void 0 : A.availability) == null ? void 0 : $.availability_rules) == null ? void 0 : U.round_robin_group_id) ?? ""
117
- }
118
- },
119
- participants: [
120
- ...(k == null ? void 0 : k.map((u) => {
121
- var Z, G, J;
122
- return u.is_organizer ? {
123
- name: u.name ?? u.email,
124
- email: u.email,
125
- is_organizer: !0,
126
- availability: {
127
- calendar_ids: c != null && c.length ? c : ["primary"],
128
- open_hours: (y == null ? void 0 : y[u.email]) ?? ((Z = u.availability) == null ? void 0 : Z.open_hours) ?? []
129
- },
130
- booking: {
131
- calendar_id: b && b !== "" ? b : "primary"
132
- }
133
- } : {
134
- ...u,
135
- availability: {
136
- calendar_ids: ((G = u.availability) == null ? void 0 : G.calendar_ids) ?? ["primary"],
137
- open_hours: (y == null ? void 0 : y[u.email]) ?? ((J = u.availability) == null ? void 0 : J.open_hours) ?? []
138
- }
139
- };
140
- })) ?? []
141
- ],
142
- event_booking: {
143
- title: (o == null ? void 0 : o.toString()) ?? "",
144
- description: (i == null ? void 0 : i.toString()) ?? "",
145
- location: (f == null ? void 0 : f.toString()) ?? "",
146
- booking_type: (p == null ? void 0 : p.toString()) ?? "booking",
147
- timezone: (r == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
148
- },
149
- scheduler: {
150
- cancellation_policy: S ?? "",
151
- available_days_in_future: _ ?? 30,
152
- min_cancellation_notice: v ?? 0,
153
- min_booking_notice: w ?? 60,
154
- hide_additional_guests: L ?? !1,
155
- hide_cancellation_options: B ?? !1,
156
- hide_rescheduling_options: D ?? !1
157
- }
158
- }, T = at(x, this.selectedConfiguration), I = this.action === "create" ? T : x, et = (u) => {
159
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
160
- this.changesSaved = !1;
161
- }, 5e3);
162
- };
163
- this.schedulerConfigChanged.emit({ config: I, resetLoadingState: et, setError: this.setError, action: this.action });
164
- }, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
165
- }
166
- configChangedHandler(t) {
167
- d("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
168
- ...this.getFormStateFromConfig(t)
169
- }, t.id ? this.action = "edit" : this.action = "create";
170
- }
171
- connectedCallback() {
172
- d("[nylas-editor-tabs]", "connectedCallback");
173
- }
174
- componentWillLoad() {
175
- d("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
176
- }
177
- componentDidLoad() {
178
- d("[nylas-editor-tabs]", "componentDidLoad");
179
- }
180
- disconnectedCallback() {
181
- d("[nylas-editor-tabs]", "disconnectedCallback");
182
- }
183
- handleValueChanged(t) {
184
- d("[nylas-editor-tabs]", "handleValueChanged", t);
185
- const { name: a, value: n } = t.detail;
186
- this.setFormState(n, a), this.formState = { ...this.formState }, this.hasUnsavedChanges = !0, this.error = "";
187
- }
188
- getFormStateFromConfig(t) {
189
- var n, s, o, i, l, r, c, b, f, p, g, _, v, w, S, h, L, B, D, k, y, C, x, T;
190
- const a = (n = t == null ? void 0 : t.participants) == null ? void 0 : n.find((I) => I.is_organizer);
191
- return {
192
- title: ((s = t == null ? void 0 : t.event_booking) == null ? void 0 : s.title) ?? "",
193
- description: ((o = t == null ? void 0 : t.event_booking) == null ? void 0 : o.description) ?? "",
194
- duration: ((l = (i = t == null ? void 0 : t.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "30",
195
- availability: {
196
- timezone: ((r = t == null ? void 0 : t.event_booking) == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
197
- openHours: ((b = (c = t == null ? void 0 : t.availability) == null ? void 0 : c.availability_rules) == null ? void 0 : b.default_open_hours) ?? W
198
- },
199
- calendarIds: ((f = a == null ? void 0 : a.availability) == null ? void 0 : f.calendar_ids) ?? [],
200
- participants: (t == null ? void 0 : t.participants) ?? [],
201
- bookingCalendar: ((p = a == null ? void 0 : a.booking) == null ? void 0 : p.calendar_id) ?? (a == null ? void 0 : a.email) ?? "",
202
- location: ((g = t == null ? void 0 : t.event_booking) == null ? void 0 : g.location) ?? "",
203
- bookingType: ((_ = t == null ? void 0 : t.event_booking) == null ? void 0 : _.booking_type) ?? "booking",
204
- buffer: ((w = (v = t == null ? void 0 : t.availability) == null ? void 0 : v.availability_rules) == null ? void 0 : w.buffer) ?? { before: 0, after: 0 },
205
- cancellationPolicy: ((S = t == null ? void 0 : t.scheduler) == null ? void 0 : S.cancellation_policy) ?? "",
206
- availableDaysInFuture: ((h = t == null ? void 0 : t.scheduler) == null ? void 0 : h.available_days_in_future) ?? 30,
207
- minCancellationNotice: ((L = t == null ? void 0 : t.scheduler) == null ? void 0 : L.min_cancellation_notice) ?? 0,
208
- minBookingNotice: ((B = t == null ? void 0 : t.scheduler) == null ? void 0 : B.min_booking_notice) ?? 60,
209
- timeslotInterval: {
210
- interval: ((D = t == null ? void 0 : t.availability) == null ? void 0 : D.interval_minutes) ?? ((k = t == null ? void 0 : t.availability) == null ? void 0 : k.duration_minutes) ?? 10,
211
- roundTo: (y = t == null ? void 0 : t.availability) == null ? void 0 : y.round_to
212
- },
213
- additionalGuestsHidden: ((C = t == null ? void 0 : t.scheduler) == null ? void 0 : C.hide_additional_guests) ?? !1,
214
- hideCancellationOptions: ((x = t == null ? void 0 : t.scheduler) == null ? void 0 : x.hide_cancellation_options) ?? !1,
215
- hideReschedulingOptions: ((T = t == null ? void 0 : t.scheduler) == null ? void 0 : T.hide_rescheduling_options) ?? !1
216
- };
217
- }
218
- setFormState(t, a) {
219
- switch (a) {
220
- case "title":
221
- this.formState.title = t.toString();
222
- break;
223
- case "description":
224
- this.formState.description = t.toString();
225
- break;
226
- case "duration":
227
- this.formState.duration = t.toString();
228
- break;
229
- case "availability":
230
- this.formState.availability = JSON.parse(t.toString());
231
- break;
232
- case "participants":
233
- this.formState.participants = JSON.parse(t.toString());
234
- break;
235
- case "calendars":
236
- this.formState.calendarIds = t.toString().split(",");
237
- break;
238
- case "booking-calendar":
239
- this.formState.bookingCalendar = t.toString();
240
- break;
241
- case "location":
242
- this.formState.location = t.toString();
243
- break;
244
- case "booking-type":
245
- this.formState.bookingType = t.toString();
246
- break;
247
- case "buffer-time":
248
- this.formState.buffer = JSON.parse(t.toString());
249
- break;
250
- case "limit-future-bookings":
251
- this.formState.availableDaysInFuture = parseInt(t.toString());
252
- break;
253
- case "min-cancellation-notice":
254
- this.formState.minCancellationNotice = parseInt(t.toString());
255
- break;
256
- case "min-booking-notice":
257
- this.formState.minBookingNotice = parseInt(t.toString());
258
- break;
259
- case "cancellation-policy":
260
- this.formState.cancellationPolicy = t.toString();
261
- break;
262
- case "timeslot-interval":
263
- this.formState.timeslotInterval = JSON.parse(t.toString());
264
- break;
265
- case "customize-booking-settings":
266
- const n = JSON.parse(t.toString());
267
- this.formState.additionalGuestsHidden = n.additionalGuestsHidden, this.formState.hideCancellationOptions = n.hideCancellationOptions, this.formState.hideReschedulingOptions = n.hideReschedulingOptions;
268
- break;
269
- case "participant-custom-availability":
270
- const s = JSON.parse(t.toString());
271
- this.formState.participantOpenHours = s;
272
- break;
273
- }
274
- }
275
- updateFormState() {
276
- return new FormData(this.formRef).forEach((a, n) => {
277
- this.setFormState(a, n);
278
- }), this.formState = { ...this.formState }, this.formState;
279
- }
280
- setActiveTab(t, a) {
281
- t.preventDefault(), this.updateFormState(), this.activeTab = a;
282
- }
283
- render() {
284
- var a;
285
- d("[nylas-editor-tabs]", "render", this.formState);
286
- const t = localStorage.getItem("nylas") === "Nylas Developer";
287
- return e(K, { key: "ccfd780da5c6ce1688f60384796bbaa98fe6094d" }, e("form", { key: "2e5d1c16a5373a5b623869925a7cab71f52f98ce", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (n) => this.formRef = n, noValidate: !0 }, this.mode === "app" ? e("div", { class: "form-contents" }, e("div", { class: "tabs" }, e("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (n) => this.setActiveTab(n, "eventInfo") }, e("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), e("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (n) => this.setActiveTab(n, "availability") }, e("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), e("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (n) => this.setActiveTab(n, "bookingOptions") }, e("flow-icon", { width: "16", height: "16" }), "Booking Options"), t && e("button", { class: { tab: !0, active: this.activeTab == "participants" }, onClick: (n) => this.setActiveTab(n, "participants") }, e("people-icon", { width: "16", height: "16" }), "Participants")), e("div", { class: "tab-content" }, e(dt, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((a = this.selectedConfiguration) == null ? void 0 : a.id) ?? "new" }))) : e("slot", null), e("div", { key: "f11d2767c5fc65ad7a72f346e9b3940b8151d7a3", class: "footer" }, e("div", { key: "858c5dac4d006f28b05347be3feba2d6dd336b15", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && e("button-component", { type: "button", disabled: this.isLoading, clickHandler: (n) => {
288
- n.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(q(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
289
- }, variant: "basic" }, "Preview")), e("div", { key: "c5225165887e64b467570a3f90222479fb259494", class: "buttons" }, e("p", { key: "50b2861f9c99e3dc91e58f77097fa753ba02cd1b", class: {
290
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
291
- "saved-changes": this.changesSaved,
292
- error: this.error !== "",
293
- "error-full-width": this.error !== "" && this.action === "create"
294
- } }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "9934c2cf6faf7e74b135add1728e3524bc29e13f", type: "button", disabled: this.isLoading, clickHandler: (n) => {
295
- n.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
296
- }, variant: "basic" }, "Cancel"), e("button-component", { key: "872f1a24204c38948d484b2bf99aa72d78ba7a37", type: "submit", disabled: this.isLoading }, this.isLoading ? e("span", null, "Saving", e("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
297
- }
298
- get host() {
299
- return Q(this);
300
- }
301
- static get watchers() {
302
- return {
303
- selectedConfiguration: ["configChangedHandler"]
304
- };
305
- }
306
- };
307
- ut([
308
- X({
309
- name: "nylas-editor-tabs",
310
- stateToProps: /* @__PURE__ */ new Map([
311
- ["schedulerConfig.calendars", "calendars"],
312
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
313
- ["schedulerConfig.currentUser", "currentUser"]
314
- ]),
315
- eventToProps: {
316
- schedulerConfigChanged: async (t, a) => {
317
- const { resetLoadingState: n, setError: s, action: o, config: i } = t.detail, l = (r) => {
318
- const [c, b] = r;
319
- !c && b && s && s(b), n && n(t);
320
- };
321
- if (o === "edit") {
322
- const r = await a.schedulerConfig.updateConfiguration(i);
323
- l(r);
324
- } else {
325
- const r = await a.schedulerConfig.createConfiguration(i);
326
- l(r);
327
- }
328
- },
329
- cancelButtonClick: async (t, a) => {
330
- a.schedulerConfigStore.state.action = null;
331
- },
332
- previewButtonClicked: async (t, a) => {
333
- d("[nylas-editor-tabs]", "previewButtonClicked", a);
334
- },
335
- formSubmitted: async (t, a) => {
336
- d("[nylas-editor-tabs]", "formSubmitted", a);
337
- }
338
- },
339
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
340
- fireRegisterEvent: !0
341
- }),
342
- F("design:type", Function),
343
- F("design:paramtypes", []),
344
- F("design:returntype", void 0)
345
- ], Y.prototype, "render", null);
346
- Y.style = bt;
347
- const pt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--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}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}', ht = pt;
348
- var yt = function(t, a, n, s) {
349
- var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, l;
350
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
351
- i = Reflect.decorate(t, a, n, s);
352
- else
353
- for (var r = t.length - 1; r >= 0; r--)
354
- (l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(a, n, i) : l(a, n)) || i);
355
- return o > 3 && i && Object.defineProperty(a, n, i), i;
356
- }, O = function(t, a) {
357
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
358
- return Reflect.metadata(t, a);
359
- };
360
- const tt = class {
361
- constructor(t) {
362
- H(this, t), this.initListConfigurations = m(this, "initListConfigurations", 7), this.createButtonClick = m(this, "createButtonClick", 7), this.editButtonClick = m(this, "editButtonClick", 7), this.deleteButtonClick = m(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "", this.copiedButtonIndex = -1;
363
- }
364
- connectedCallback() {
365
- d("[nylas-list-configurations]", "connectedCallback");
366
- }
367
- componentWillLoad() {
368
- d("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
369
- }
370
- componentDidLoad() {
371
- d("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
372
- }
373
- disconnectedCallback() {
374
- d("[nylas-list-configurations]", "disconnectedCallback");
375
- }
376
- async getState() {
377
- return this.state;
378
- }
379
- async setState(t) {
380
- this.state = t;
381
- }
382
- async setError(t) {
383
- this.error = t;
384
- }
385
- getDurationString(t) {
386
- const a = Math.floor(t / 60), n = t % 60;
387
- return `${a || ""} ${a ? `${a > 1 ? "hours" : "hour"}` : ""} ${n || ""} ${n ? `${n > 1 ? "mins" : "min"}` : ""}`;
388
- }
389
- render() {
390
- return e(K, null, e("div", { class: "header" }, e("div", { class: "description" }, e("h2", null, "All scheduling pages"), e("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && e("div", { class: "actions" }, e("button-component", { clickHandler: () => {
391
- this.createButtonClick.emit(this.host);
392
- } }, "Create new"))), e("div", { class: "configurations" }, e("table", { class: {
393
- "no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
394
- } }, e("tr", { class: {
395
- hide: this.state === "loading" || this.configurations && this.configurations.length === 0
396
- } }, e("th", null, "Scheduling page title"), e("th", null, "Duration"), e("th", { class: "actions-header" }, "Actions")), this.state === "loading" && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("h3", null, "Loading..."), e("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("calendar-icon", { width: "48", height: "48" }), e("h3", null, "No scheduling pages found"), e("p", null, "Get started with creating your first scheduling page"), e("button-component", { clickHandler: () => {
397
- this.createButtonClick.emit(this.host);
398
- } }, "Create new")))), this.state !== "loading" && this.configurations.map((t, a) => e("tr", { key: t.id }, e("td", null, e("div", { class: "title" }, e("span", { class: "config-event-title" }, t.event_booking.title), e("span", { class: "config-event-description" }, t.event_booking.description))), e("td", null, e("div", null, this.getDurationString(t.availability.duration_minutes))), e("td", null, e("div", { class: "actions" }, e("button-component", { variant: "basic", id: "copy", key: `copy-${a}`, clickHandler: async (n) => {
399
- n.preventDefault();
400
- const s = q(this.schedulerPreviewLink, t);
401
- await navigator.clipboard.writeText(s), this.copiedButtonIndex = a, setTimeout(() => {
402
- this.copiedButtonIndex = -1;
403
- }, 3e3);
404
- } }, this.copiedButtonIndex === a ? "Copied!" : "Copy link"), e("button-component", { variant: "basic", key: `edit-${a}`, clickHandler: (n) => {
405
- n.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
406
- } }, "Edit"), e("button-component", { variant: "basic", key: `delete-${a}`, clickHandler: (n) => {
407
- n.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: t });
408
- } }, "Delete"))))))), this.state === "error" && e("div", { class: "error-container" }, e("p", { class: "error" }, this.error)));
409
- }
410
- get host() {
411
- return Q(this);
412
- }
413
- };
414
- yt([
415
- X({
416
- name: "nylas-list-configurations",
417
- stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
418
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
419
- eventToProps: {
420
- initListConfigurations: async (t, a) => {
421
- const n = t.detail;
422
- await n.setState("loading");
423
- const [s, o] = await a.schedulerConfig.getConfigurations();
424
- if (!s && o && o.message) {
425
- await n.setState("error"), await n.setError(o.message);
426
- return;
427
- }
428
- await n.setState("loaded");
429
- },
430
- createButtonClick: async (t, a) => {
431
- a.schedulerConfigStore.resetSelectedConfiguration(), a.schedulerConfigStore.state.action = "create";
432
- },
433
- deleteButtonClick: async (t, a) => {
434
- const { host: n, configuration: s } = t.detail, [o, i] = await a.schedulerConfig.deleteConfiguration(s.id);
435
- !o && i && i.message && (await n.setState("error"), await n.setError(i.message));
436
- },
437
- editButtonClick: async (t, a) => {
438
- const { configuration: n } = t.detail;
439
- a.schedulerConfigStore.state.selectedConfiguration = n, a.schedulerConfigStore.state.action = "edit";
440
- }
441
- },
442
- fireRegisterEvent: !0
443
- }),
444
- O("design:type", Function),
445
- O("design:paramtypes", []),
446
- O("design:returntype", void 0)
447
- ], tt.prototype, "render", null);
448
- tt.style = ht;
449
- export {
450
- st as google_logo_icon,
451
- lt as microsoft_logo_icon,
452
- Y as nylas_editor_tabs,
453
- tt as nylas_list_configurations
454
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-769f0fdd.cjs"),q=require("./register-component-a5a9ca5d-8b06415c.cjs"),J=require("./constants-f34b9c6e-ebc2e19c.cjs");require("react");require("react-dom");const X=".sc-google-logo-icon-h{display:flex}",Y=X,W=class{constructor(t){e.registerInstance(this,t),this.width="24",this.height="24"}render(){return e.h("svg",{key:"2b6d66fd099e97716cdb808f575b5aadf1503a06",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("g",{key:"2d02d3ca40389d13f189bddba578ae683c487d3e","clip-path":"url(#clip0_959_12452)"},e.h("path",{key:"41eeee9cdd77323ffee094ce688e222c2ae95461",d:"M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z",fill:"#4285F4"}),e.h("path",{key:"7a8f1123dc6b8b29324eb255637f7b536982e112",d:"M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z",fill:"#34A853"}),e.h("path",{key:"e71780d270c31b20d6617deb912a0b74b3dc8004",d:"M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z",fill:"#FBBC05"}),e.h("path",{key:"4e8795414ed616287f7e315d9d4ae7882832c56c",d:"M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z",fill:"#EA4335"})),e.h("defs",{key:"9ad522ed57a9d8c75d8515e0e0a1e64d1dcde3a0"},e.h("clipPath",{key:"da8c3ef1116cd32e06a73e30c5c4bc335f209d5b",id:"clip0_959_12452"},e.h("rect",{key:"8936b3346ec26a6c0901073adca44b8021661be6",width:24,height:24,fill:"white"}))))}};W.style=Y;const tt=".sc-microsoft-logo-icon-h{display:flex}",et=tt,K=class{constructor(t){e.registerInstance(this,t),this.width="22",this.height="22"}render(){return e.h("svg",{key:"deae127512c4d2b6ef876ab1311fb6ab4d5cd368",width:this.width,height:this.height,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"ea58fbe3dac4c5a6455acec95fe9677068999d53",d:"M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z",fill:"#F35325"}),e.h("path",{key:"e8a2faf14e8a7cdf15808a1fac1b16fba79f6051",d:"M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z",fill:"#81BC06"}),e.h("path",{key:"56644908156e19d4ba9eedfec54a9ffa9b9744bd",d:"M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z",fill:"#05A6F0"}),e.h("path",{key:"24c76e1b54ed1cdbc97ec6e56888db403169d74f",d:"M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z",fill:"#FFBA08"}))}};K.style=et;function nt({id:t,formState:n,activeTab:a,calendars:s}){var o;switch(a){case"eventInfo":const i=n.title,l=n.description,r=parseInt(n.duration),d=n.location;return e.h("div",{key:t},e.h("nylas-event-info",null,e.h("div",{slot:"inputs"},e.h("nylas-event-title",{name:"title",eventTitle:i,exportparts:"net, net__title, net__dropdown-content"}),e.h("nylas-event-duration",{name:"duration",eventDurationMinutes:r,exportparts:"ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content"}),e.h("nylas-event-location",{name:"location",eventLocation:d,exportparts:"nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content"}),e.h("nylas-event-description",{name:"description",eventDescription:l,exportparts:"nedesc, nedesc__textarea"}))));case"availability":const c=n.availability.openHours,y=n.availability.timezone?n.availability.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,b=(o=n.participants)==null?void 0:o.find(_=>_.is_organizer),f=(b==null?void 0:b.email)??"primary",m=n.calendarIds.length>0?n.calendarIds:[f],g=n.bookingCalendar=="primary"?f:n.bookingCalendar;return e.h("div",{key:t},e.h("nylas-booking-calendar-picker",{name:"booking-calendar",calendars:s??[],defaultBookingCalendar:g,exportparts:"nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content"}),e.h("nylas-calendar-picker",{name:"calendars",calendars:s??[],defaultSelectedCalendars:m,exportparts:"ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content"}),e.h("nylas-availability-picker",{name:"availability",openHours:c,defaultTimezone:y,exportparts:"nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times"}));case"bookingOptions":return e.h("div",{key:t},e.h("nylas-buffer-time",{name:"buffer-time",buffer:n.buffer,exportparts:"nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview"}),e.h("nylas-event-limits",null,e.h("div",{slot:"inputs"},e.h("nylas-min-booking-notice",{name:"min-booking-notice",minBookingNotice:n.minBookingNotice,exportparts:"nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content"}),e.h("nylas-limit-future-bookings",{name:"limit-future-bookings",availableDaysInFuture:n.availableDaysInFuture,exportparts:"nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content"}),e.h("nylas-min-cancellation-notice",{name:"min-cancellation-notice",minCancellationNotice:n.minCancellationNotice,exportparts:"nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content"}),e.h("nylas-cancellation-policy",{name:"cancellation-policy",cancellationPolicy:n.cancellationPolicy,exportparts:"ncpolicy, ncpolicy__textarea"}))),e.h("nylas-timeslot-interval",{name:"timeslot-interval",eventDurationMinutes:parseInt(n.duration),exportparts:"nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content"}),e.h("nylas-customize-booking-settings",{name:"customize-booking-settings",exportparts:"ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options"}));case"participants":return e.h("div",{key:t},e.h("nylas-additional-participants",{name:"participants",eventParticipants:n.participants,exportparts:"nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant"}),e.h("nylas-participants-custom-availability",{name:"participant-custom-availability",participants:n.participants,exportparts:"npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider"}))}}const at='.sc-nylas-editor-tabs-h{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}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}',it=at;var st=function(t,n,a,s){var o=arguments.length,i=o<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,n,a,s);else for(var r=t.length-1;r>=0;r--)(l=t[r])&&(i=(o<3?l(i):o>3?l(n,a,i):l(n,a))||i);return o>3&&i&&Object.defineProperty(n,a,i),i},D=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)};const I=class{constructor(t){e.registerInstance(this,t),this.schedulerConfigChanged=e.createEvent(this,"schedulerConfigChanged",7),this.cancelButtonClick=e.createEvent(this,"cancelButtonClick",7),this.formSubmitted=e.createEvent(this,"formSubmitted",7),this.previewButtonClicked=e.createEvent(this,"previewButtonClicked",7),this.setError=n=>{this.error=n.message},this.formSubmissionHandler=async n=>{var F,O,P,R,N,z,j,M,V,A,U;if(n.preventDefault(),this.formSubmitted.emit(),!this.formRef.checkValidity())return;this.isLoading=!0,this.hasUnsavedChanges=!1;const s=this.updateFormState(),{title:o,description:i,duration:l,availability:r,calendarIds:d,bookingCalendar:c,location:y,bookingType:b,buffer:f,availableDaysInFuture:m,minCancellationNotice:g,minBookingNotice:_,cancellationPolicy:C,timeslotInterval:u,additionalGuestsHidden:x,hideCancellationOptions:S,hideReschedulingOptions:L,participants:v,participantOpenHours:p}=s,w=l?parseInt(l):30,k={...((F=this.selectedConfiguration)==null?void 0:F.id)&&{id:this.selectedConfiguration.id},version:((O=this.selectedConfiguration)==null?void 0:O.version)??"1.0.0",availability:{duration_minutes:w,interval_minutes:(u==null?void 0:u.interval)??w,round_to:u==null?void 0:u.roundTo,availability_rules:{availability_method:((N=(R=(P=this.selectedConfiguration)==null?void 0:P.availability)==null?void 0:R.availability_rules)==null?void 0:N.availability_method)??"collective",buffer:f||{before:0,after:0},default_open_hours:(r==null?void 0:r.openHours)??((M=(j=(z=this.selectedConfiguration)==null?void 0:z.availability)==null?void 0:j.availability_rules)==null?void 0:M.default_open_hours)??J.DEFAULT_OPEN_HOURS,round_robin_group_id:((U=(A=(V=this.selectedConfiguration)==null?void 0:V.availability)==null?void 0:A.availability_rules)==null?void 0:U.round_robin_group_id)??""}},participants:[...(v==null?void 0:v.map(h=>{var $,Z,G;return h.is_organizer?{name:h.name??h.email,email:h.email,is_organizer:!0,availability:{calendar_ids:d!=null&&d.length?d:["primary"],open_hours:(p==null?void 0:p[h.email])??(($=h.availability)==null?void 0:$.open_hours)??[]},booking:{calendar_id:c&&c!==""?c:"primary"}}:{...h,availability:{calendar_ids:((Z=h.availability)==null?void 0:Z.calendar_ids)??["primary"],open_hours:(p==null?void 0:p[h.email])??((G=h.availability)==null?void 0:G.open_hours)??[]}}}))??[]],event_booking:{title:(o==null?void 0:o.toString())??"",description:(i==null?void 0:i.toString())??"",location:(y==null?void 0:y.toString())??"",booking_type:(b==null?void 0:b.toString())??"booking",timezone:(r==null?void 0:r.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone},scheduler:{cancellation_policy:C??"",available_days_in_future:m??30,min_cancellation_notice:g??0,min_booking_notice:_??60,hide_additional_guests:x??!1,hide_cancellation_options:S??!1,hide_rescheduling_options:L??!1}},B=e.mergeDeep(k,this.selectedConfiguration),T=this.action==="create"?B:k,Q=h=>{this.isLoading=!1,this.changesSaved=!0,setTimeout(()=>{this.changesSaved=!1},5e3)};this.schedulerConfigChanged.emit({config:T,resetLoadingState:Q,setError:this.setError,action:this.action})},this.calendars=void 0,this.selectedConfiguration=void 0,this.currentUser=void 0,this.schedulerPreviewLink="",this.mode="app",this.action="create",this.activeTab="eventInfo",this.isLoading=!1,this.hasUnsavedChanges=!1,this.changesSaved=!1,this.formState={},this.error=""}configChangedHandler(t){e.debug("[nylas-editor-tabs]","configChangedHandler",t,this.selectedConfiguration),this.formState={...this.getFormStateFromConfig(t)},t.id?this.action="edit":this.action="create"}connectedCallback(){e.debug("[nylas-editor-tabs]","connectedCallback")}componentWillLoad(){e.debug("[nylas-editor-tabs]","componentWillLoad"),this.formState=this.getFormStateFromConfig(this.selectedConfiguration)}componentDidLoad(){e.debug("[nylas-editor-tabs]","componentDidLoad")}disconnectedCallback(){e.debug("[nylas-editor-tabs]","disconnectedCallback")}handleValueChanged(t){e.debug("[nylas-editor-tabs]","handleValueChanged",t);const{name:n,value:a}=t.detail;this.setFormState(a,n),this.formState={...this.formState},this.hasUnsavedChanges=!0,this.error=""}getFormStateFromConfig(t){var a,s,o,i,l,r,d,c,y,b,f,m,g,_,C,u,x,S,L,v,p,w,k,B;const n=(a=t==null?void 0:t.participants)==null?void 0:a.find(T=>T.is_organizer);return{title:((s=t==null?void 0:t.event_booking)==null?void 0:s.title)??"",description:((o=t==null?void 0:t.event_booking)==null?void 0:o.description)??"",duration:((l=(i=t==null?void 0:t.availability)==null?void 0:i.duration_minutes)==null?void 0:l.toString())??"30",availability:{timezone:((r=t==null?void 0:t.event_booking)==null?void 0:r.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone,openHours:((c=(d=t==null?void 0:t.availability)==null?void 0:d.availability_rules)==null?void 0:c.default_open_hours)??J.DEFAULT_OPEN_HOURS},calendarIds:((y=n==null?void 0:n.availability)==null?void 0:y.calendar_ids)??[],participants:(t==null?void 0:t.participants)??[],bookingCalendar:((b=n==null?void 0:n.booking)==null?void 0:b.calendar_id)??(n==null?void 0:n.email)??"",location:((f=t==null?void 0:t.event_booking)==null?void 0:f.location)??"",bookingType:((m=t==null?void 0:t.event_booking)==null?void 0:m.booking_type)??"booking",buffer:((_=(g=t==null?void 0:t.availability)==null?void 0:g.availability_rules)==null?void 0:_.buffer)??{before:0,after:0},cancellationPolicy:((C=t==null?void 0:t.scheduler)==null?void 0:C.cancellation_policy)??"",availableDaysInFuture:((u=t==null?void 0:t.scheduler)==null?void 0:u.available_days_in_future)??30,minCancellationNotice:((x=t==null?void 0:t.scheduler)==null?void 0:x.min_cancellation_notice)??0,minBookingNotice:((S=t==null?void 0:t.scheduler)==null?void 0:S.min_booking_notice)??60,timeslotInterval:{interval:((L=t==null?void 0:t.availability)==null?void 0:L.interval_minutes)??((v=t==null?void 0:t.availability)==null?void 0:v.duration_minutes)??10,roundTo:(p=t==null?void 0:t.availability)==null?void 0:p.round_to},additionalGuestsHidden:((w=t==null?void 0:t.scheduler)==null?void 0:w.hide_additional_guests)??!1,hideCancellationOptions:((k=t==null?void 0:t.scheduler)==null?void 0:k.hide_cancellation_options)??!1,hideReschedulingOptions:((B=t==null?void 0:t.scheduler)==null?void 0:B.hide_rescheduling_options)??!1}}setFormState(t,n){switch(n){case"title":this.formState.title=t.toString();break;case"description":this.formState.description=t.toString();break;case"duration":this.formState.duration=t.toString();break;case"availability":this.formState.availability=JSON.parse(t.toString());break;case"participants":this.formState.participants=JSON.parse(t.toString());break;case"calendars":this.formState.calendarIds=t.toString().split(",");break;case"booking-calendar":this.formState.bookingCalendar=t.toString();break;case"location":this.formState.location=t.toString();break;case"booking-type":this.formState.bookingType=t.toString();break;case"buffer-time":this.formState.buffer=JSON.parse(t.toString());break;case"limit-future-bookings":this.formState.availableDaysInFuture=parseInt(t.toString());break;case"min-cancellation-notice":this.formState.minCancellationNotice=parseInt(t.toString());break;case"min-booking-notice":this.formState.minBookingNotice=parseInt(t.toString());break;case"cancellation-policy":this.formState.cancellationPolicy=t.toString();break;case"timeslot-interval":this.formState.timeslotInterval=JSON.parse(t.toString());break;case"customize-booking-settings":const a=JSON.parse(t.toString());this.formState.additionalGuestsHidden=a.additionalGuestsHidden,this.formState.hideCancellationOptions=a.hideCancellationOptions,this.formState.hideReschedulingOptions=a.hideReschedulingOptions;break;case"participant-custom-availability":const s=JSON.parse(t.toString());this.formState.participantOpenHours=s;break}}updateFormState(){return new FormData(this.formRef).forEach((n,a)=>{this.setFormState(n,a)}),this.formState={...this.formState},this.formState}setActiveTab(t,n){t.preventDefault(),this.updateFormState(),this.activeTab=n}render(){var n;e.debug("[nylas-editor-tabs]","render",this.formState);const t=localStorage.getItem("nylas")==="Nylas Developer";return e.h(e.Host,{key:"ccfd780da5c6ce1688f60384796bbaa98fe6094d"},e.h("form",{key:"2e5d1c16a5373a5b623869925a7cab71f52f98ce",onSubmit:this.formSubmissionHandler,class:"scheduler-editor",ref:a=>this.formRef=a,noValidate:!0},this.mode==="app"?e.h("div",{class:"form-contents"},e.h("div",{class:"tabs"},e.h("button",{class:{tab:!0,active:this.activeTab=="eventInfo"},onClick:a=>this.setActiveTab(a,"eventInfo")},e.h("calendar-info-icon",{width:"16",height:"16"}),"Event Info"),e.h("button",{class:{tab:!0,active:this.activeTab=="availability"},onClick:a=>this.setActiveTab(a,"availability")},e.h("calendar-patterns-icon",{width:"16",height:"16"}),"Availability"),e.h("button",{class:{tab:!0,active:this.activeTab=="bookingOptions"},onClick:a=>this.setActiveTab(a,"bookingOptions")},e.h("flow-icon",{width:"16",height:"16"}),"Booking Options"),t&&e.h("button",{class:{tab:!0,active:this.activeTab=="participants"},onClick:a=>this.setActiveTab(a,"participants")},e.h("people-icon",{width:"16",height:"16"}),"Participants")),e.h("div",{class:"tab-content"},e.h(nt,{formState:this.formState,activeTab:this.activeTab,calendars:this.calendars,id:((n=this.selectedConfiguration)==null?void 0:n.id)??"new"}))):e.h("slot",null),e.h("div",{key:"f11d2767c5fc65ad7a72f346e9b3940b8151d7a3",class:"footer"},e.h("div",{key:"858c5dac4d006f28b05347be3feba2d6dd336b15",class:"preview"},this.schedulerPreviewLink!==""&&this.action==="edit"&&e.h("button-component",{type:"button",disabled:this.isLoading,clickHandler:a=>{a.preventDefault(),this.previewButtonClicked.emit(this.host).defaultPrevented||window.open(e.parsePreviewLink(this.schedulerPreviewLink,this.selectedConfiguration),"_blank")},variant:"basic"},"Preview")),e.h("div",{key:"c5225165887e64b467570a3f90222479fb259494",class:"buttons"},e.h("p",{key:"50b2861f9c99e3dc91e58f77097fa753ba02cd1b",class:{"unsaved-changes":this.hasUnsavedChanges&&!this.changesSaved,"saved-changes":this.changesSaved,error:this.error!=="","error-full-width":this.error!==""&&this.action==="create"}},this.error!==""?this.error:"",this.error==""&&this.hasUnsavedChanges&&!this.changesSaved?"Unsaved changes":this.error==""&&this.changesSaved?"Changes saved!":""),e.h("button-component",{key:"9934c2cf6faf7e74b135add1728e3524bc29e13f",type:"button",disabled:this.isLoading,clickHandler:a=>{a.preventDefault(),this.cancelButtonClick.emit(),this.error=""},variant:"basic"},"Cancel"),e.h("button-component",{key:"872f1a24204c38948d484b2bf99aa72d78ba7a37",type:"submit",disabled:this.isLoading},this.isLoading?e.h("span",null,"Saving",e.h("loading-icon",null)," "):this.action=="create"?"Create":"Save changes")))))}get host(){return e.getElement(this)}static get watchers(){return{selectedConfiguration:["configChangedHandler"]}}};st([q.RegisterComponent({name:"nylas-editor-tabs",stateToProps:new Map([["schedulerConfig.calendars","calendars"],["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.currentUser","currentUser"]]),eventToProps:{schedulerConfigChanged:async(t,n)=>{const{resetLoadingState:a,setError:s,action:o,config:i}=t.detail,l=r=>{const[d,c]=r;!d&&c&&s&&s(c),a&&a(t)};if(o==="edit"){const r=await n.schedulerConfig.updateConfiguration(i);l(r)}else{const r=await n.schedulerConfig.createConfiguration(i);l(r)}},cancelButtonClick:async(t,n)=>{n.schedulerConfigStore.state.action=null},previewButtonClicked:async(t,n)=>{e.debug("[nylas-editor-tabs]","previewButtonClicked",n)},formSubmitted:async(t,n)=>{e.debug("[nylas-editor-tabs]","formSubmitted",n)}},localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),fireRegisterEvent:!0}),D("design:type",Function),D("design:paramtypes",[]),D("design:returntype",void 0)],I.prototype,"render",null);I.style=it;const ot=':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--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}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}',rt=ot;var lt=function(t,n,a,s){var o=arguments.length,i=o<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,n,a,s);else for(var r=t.length-1;r>=0;r--)(l=t[r])&&(i=(o<3?l(i):o>3?l(n,a,i):l(n,a))||i);return o>3&&i&&Object.defineProperty(n,a,i),i},H=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)};const E=class{constructor(t){e.registerInstance(this,t),this.initListConfigurations=e.createEvent(this,"initListConfigurations",7),this.createButtonClick=e.createEvent(this,"createButtonClick",7),this.editButtonClick=e.createEvent(this,"editButtonClick",7),this.deleteButtonClick=e.createEvent(this,"deleteButtonClick",7),this.configurations=[],this.schedulerPreviewLink="",this.state="loading",this.error="",this.copiedButtonIndex=-1}connectedCallback(){e.debug("[nylas-list-configurations]","connectedCallback")}componentWillLoad(){e.debug("[nylas-list-configurations]","componentWillLoad"),this.configurations&&this.configurations.length>0&&(this.state="loaded")}componentDidLoad(){e.debug("[nylas-list-configurations]","componentDidLoad"),this.initListConfigurations.emit(this.host)}disconnectedCallback(){e.debug("[nylas-list-configurations]","disconnectedCallback")}async getState(){return this.state}async setState(t){this.state=t}async setError(t){this.error=t}getDurationString(t){const n=Math.floor(t/60),a=t%60;return`${n||""} ${n?`${n>1?"hours":"hour"}`:""} ${a||""} ${a?`${a>1?"mins":"min"}`:""}`}render(){return e.h(e.Host,null,e.h("div",{class:"header"},e.h("div",{class:"description"},e.h("h2",null,"All scheduling pages"),e.h("p",null,"Create, edit and manage all your scheduling pages.")),this.configurations&&this.configurations.length>0&&e.h("div",{class:"actions"},e.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new"))),e.h("div",{class:"configurations"},e.h("table",{class:{"no-configurations":this.state!=="loading"&&(!this.configurations||this.configurations.length===0)}},e.h("tr",{class:{hide:this.state==="loading"||this.configurations&&this.configurations.length===0}},e.h("th",null,"Scheduling page title"),e.h("th",null,"Duration"),e.h("th",{class:"actions-header"},"Actions")),this.state==="loading"&&e.h("tr",{class:"no-configurations"},e.h("td",{colSpan:3},e.h("div",null,e.h("h3",null,"Loading..."),e.h("p",null,"Please wait while we fetch the scheduling pages")))),this.state!=="loading"&&(!this.configurations||this.configurations.length===0)&&e.h("tr",{class:"no-configurations"},e.h("td",{colSpan:3},e.h("div",null,e.h("calendar-icon",{width:"48",height:"48"}),e.h("h3",null,"No scheduling pages found"),e.h("p",null,"Get started with creating your first scheduling page"),e.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new")))),this.state!=="loading"&&this.configurations.map((t,n)=>e.h("tr",{key:t.id},e.h("td",null,e.h("div",{class:"title"},e.h("span",{class:"config-event-title"},t.event_booking.title),e.h("span",{class:"config-event-description"},t.event_booking.description))),e.h("td",null,e.h("div",null,this.getDurationString(t.availability.duration_minutes))),e.h("td",null,e.h("div",{class:"actions"},e.h("button-component",{variant:"basic",id:"copy",key:`copy-${n}`,clickHandler:async a=>{a.preventDefault();const s=e.parsePreviewLink(this.schedulerPreviewLink,t);await navigator.clipboard.writeText(s),this.copiedButtonIndex=n,setTimeout(()=>{this.copiedButtonIndex=-1},3e3)}},this.copiedButtonIndex===n?"Copied!":"Copy link"),e.h("button-component",{variant:"basic",key:`edit-${n}`,clickHandler:a=>{a.preventDefault(),this.editButtonClick.emit({host:this.host,configuration:t})}},"Edit"),e.h("button-component",{variant:"basic",key:`delete-${n}`,clickHandler:a=>{a.preventDefault(),this.deleteButtonClick.emit({host:this.host,configuration:t})}},"Delete"))))))),this.state==="error"&&e.h("div",{class:"error-container"},e.h("p",{class:"error"},this.error)))}get host(){return e.getElement(this)}};lt([q.RegisterComponent({name:"nylas-list-configurations",stateToProps:new Map([["schedulerConfig.configurations","configurations"]]),localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),eventToProps:{initListConfigurations:async(t,n)=>{const a=t.detail;await a.setState("loading");const[s,o]=await n.schedulerConfig.getConfigurations();if(!s&&o&&o.message){await a.setState("error"),await a.setError(o.message);return}await a.setState("loaded")},createButtonClick:async(t,n)=>{n.schedulerConfigStore.resetSelectedConfiguration(),n.schedulerConfigStore.state.action="create"},deleteButtonClick:async(t,n)=>{const{host:a,configuration:s}=t.detail,[o,i]=await n.schedulerConfig.deleteConfiguration(s.id);!o&&i&&i.message&&(await a.setState("error"),await a.setError(i.message))},editButtonClick:async(t,n)=>{const{configuration:a}=t.detail;n.schedulerConfigStore.state.selectedConfiguration=a,n.schedulerConfigStore.state.action="edit"}},fireRegisterEvent:!0}),H("design:type",Function),H("design:paramtypes",[]),H("design:returntype",void 0)],E.prototype,"render",null);E.style=rt;exports.google_logo_icon=W;exports.microsoft_logo_icon=K;exports.nylas_editor_tabs=I;exports.nylas_list_configurations=E;
@@ -1 +0,0 @@
1
- "use strict";const s=require("./index-769f0fdd.cjs");var e=s.commonjsGlobal.process;exports.process=e;
@@ -1,5 +0,0 @@
1
- import { i as o } from "./index-5851f0a2.js";
2
- var r = o.process;
3
- export {
4
- r as p
5
- };