uapp-communication-sdk 1.0.0-dev.81 → 1.0.0-dev.82

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.
@@ -1,4 +1,4 @@
1
- (function(){window.__COMMHUB_SDK_CSS__=`._spinner_164a8_1{border-style:solid;border-color:currentColor #0000 currentColor currentColor;border-radius:50%;animation:.6s linear infinite _spin_164a8_1;display:inline-block}._sm_164a8_10{border-width:2px;width:1rem;height:1rem}._md_164a8_15{border-width:3px;width:1.5rem;height:1.5rem}._lg_164a8_20{border-width:4px;width:2.5rem;height:2.5rem}@keyframes _spin_164a8_1{to{transform:rotate(360deg)}}._button_1xtk2_1{border-radius:var(--radius-md);font:inherit;letter-spacing:-.01em;cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);white-space:nowrap;border:1px solid #0000;justify-content:center;align-items:center;gap:.5rem;font-weight:600;display:inline-flex}._button_1xtk2_1:disabled{opacity:.6;cursor:not-allowed}._button_1xtk2_1:active:not(:disabled){transform:translateY(1px)scale(.985)}._button_1xtk2_1:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}._sm_1xtk2_36{padding:.35rem .75rem;font-size:.85rem}._md_1xtk2_40{padding:.55rem 1rem;font-size:.95rem}._lg_1xtk2_44{padding:.75rem 1.4rem;font-size:1.05rem}._primary_1xtk2_50{background-color:var(--color-primary);color:var(--color-on-primary)}._primary_1xtk2_50:hover:not(:disabled){background-color:var(--color-primary-strong);box-shadow:0 6px 18px var(--color-primary-30);transform:translateY(-1px)}._primary_1xtk2_50:active:not(:disabled){box-shadow:0 2px 8px var(--color-primary-30)}._secondary_1xtk2_63{background-color:var(--color-surface);color:var(--color-text);border-color:var(--color-border-strong)}._secondary_1xtk2_63:hover:not(:disabled){border-color:var(--color-primary);box-shadow:var(--shadow-sm);transform:translateY(-1px)}._ghost_1xtk2_74{color:var(--color-text);background-color:#0000}._ghost_1xtk2_74:hover:not(:disabled){background-color:var(--color-surface-muted)}._danger_1xtk2_82{background-color:var(--color-danger);color:var(--color-on-primary)}._danger_1xtk2_82:hover:not(:disabled){background-color:var(--color-danger-strong);box-shadow:0 6px 18px var(--color-danger-soft);transform:translateY(-1px)}._fullWidth_1xtk2_92{width:100%}._loadingTextHidden_1xtk2_96{display:none}._alert_r5ybz_1{border-radius:var(--radius-md);border:1px solid #0000;align-items:flex-start;gap:.6rem;padding:.75rem 1rem;font-size:.9rem;line-height:1.4;display:flex}._error_r5ybz_12{background-color:var(--color-danger-soft);border-color:var(--color-danger);color:var(--color-danger-strong)}._info_r5ybz_18{background-color:var(--color-surface-muted);border-color:var(--color-border);color:var(--color-text)}._success_r5ybz_24{background-color:var(--color-success-soft);border-color:var(--color-success);color:var(--color-success-strong)}._title_r5ybz_30{margin:0 0 .15rem;font-weight:600}._body_r5ybz_35{white-space:pre-line;margin:0}._field_i2e93_1{flex-direction:column;gap:.35rem;display:flex}._label_i2e93_7{color:var(--color-text);font-size:.85rem;font-weight:600}._input_i2e93_13{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);font:inherit;padding:.6rem .75rem}._input_i2e93_13:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-focus);outline:none}._invalid_i2e93_28{border-color:var(--color-danger)}._error_i2e93_32{color:var(--color-danger-strong);font-size:.8rem}._select_1yaeg_3{height:var(--height-input,38px);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);appearance:none;color:var(--color-text);transition:border-color var(--dur-fast) var(--ease-out);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");background-position:right 10px center;background-repeat:no-repeat;outline:none;padding:0 34px 0 12px;font-family:inherit;font-size:13px}._select_1yaeg_3:focus-visible{border-color:var(--color-primary-border)}._select_1yaeg_3:disabled{opacity:.6;cursor:not-allowed}._iconButton_2jhbr_1{border-radius:var(--radius-md);width:2rem;height:2rem;color:var(--color-text);cursor:pointer;background-color:#0000;border:1px solid #0000;justify-content:center;align-items:center;padding:0;line-height:1;transition:background-color .15s,color .15s;display:inline-flex}._iconButton_2jhbr_1:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}._iconButton_2jhbr_1:disabled{opacity:.6;cursor:not-allowed}._ghost_2jhbr_29:hover:not(:disabled){background-color:var(--color-surface-muted)}._danger_2jhbr_33{color:var(--color-danger-strong)}._danger_2jhbr_33:hover:not(:disabled){background-color:var(--color-danger-soft)}._overlay_1u32w_1{background-color:var(--color-overlay);z-index:90;position:fixed;inset:0}._positioner_1u32w_11{z-index:91;width:calc(100% - 2rem);max-width:440px;height:fit-content;max-height:calc(100vh - 2rem);margin:auto;display:flex;position:fixed;inset:0}._positionerMedium_1u32w_25{max-width:560px}._positionerWide_1u32w_30{max-width:960px}._overlayHi_1u32w_35{z-index:100}._positionerHi_1u32w_39{z-index:101}._positioner_1u32w_11:focus-visible{outline:none}._content_1u32w_9{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);width:100%;max-height:calc(100vh - 2rem);box-shadow:var(--shadow-lg);flex-direction:column;gap:1rem;padding:1.5rem;display:flex;overflow:hidden}._header_1u32w_62{flex-shrink:0;justify-content:space-between;align-items:flex-start;gap:1rem;display:flex}._heading_1u32w_70{flex-direction:column;gap:.25rem;display:flex}._title_1u32w_76{color:var(--color-text);margin:0;font-size:1.15rem;font-weight:600}._description_1u32w_83{color:var(--color-text-muted);margin:0;font-size:.9rem}._body_1u32w_89{min-height:0;color:var(--color-text);margin:-2px -4px;padding:2px 4px;font-size:.95rem;overflow-y:auto}._footer_1u32w_98{flex-shrink:0;justify-content:flex-end;gap:.5rem;display:flex}@media (width<=768px){._positioner_1u32w_11{width:100%;max-width:none;height:auto;max-height:90vh;margin:0;inset:auto 0 0}._content_1u32w_9{border-radius:var(--radius-lg) var(--radius-lg) 0 0;max-height:90vh;padding-bottom:calc(1.5rem + env(safe-area-inset-bottom,0px));border-bottom:none;border-left:none;border-right:none}}@media (width<=480px){._footer_1u32w_98{flex-direction:column-reverse;align-items:stretch}._footer_1u32w_98>*{border-color:var(--color-border-strong);width:100%}}._overlay_1rzp2_1{background-color:var(--color-overlay);z-index:80;position:fixed;inset:0}._overlay_1rzp2_1[data-state=open]{animation:.16s _drawerFadeIn_1rzp2_1}._overlay_1rzp2_1[data-state=closed]{animation:.14s forwards _drawerFadeOut_1rzp2_1}._panelLeft_1rzp2_17,._panelRight_1rzp2_18{background-color:var(--color-surface);width:min(286px,86vw);box-shadow:var(--shadow-lg);z-index:81;flex-direction:column;display:flex;position:fixed;top:0;bottom:0;overflow:hidden}._body_1rzp2_32{flex:1;min-height:0;overflow-y:auto}._footer_1rzp2_38{flex-shrink:0}._panelLeft_1rzp2_17{left:0}._panelRight_1rzp2_18{width:min(420px,92vw);right:0}._panelWide_1rzp2_52{width:min(760px,96vw)}._panelLeft_1rzp2_17[data-state=open]{animation:.28s cubic-bezier(.16,1,.3,1) _drawerSlideInLeft_1rzp2_1}._panelLeft_1rzp2_17[data-state=closed]{animation:.2s ease-in forwards _drawerSlideOutLeft_1rzp2_1}._panelRight_1rzp2_18[data-state=open]{animation:.28s cubic-bezier(.16,1,.3,1) _drawerSlideInRight_1rzp2_1}._panelRight_1rzp2_18[data-state=closed]{animation:.2s ease-in forwards _drawerSlideOutRight_1rzp2_1}@keyframes _drawerFadeIn_1rzp2_1{0%{opacity:0}to{opacity:1}}@keyframes _drawerFadeOut_1rzp2_1{0%{opacity:1}to{opacity:0}}@keyframes _drawerSlideInLeft_1rzp2_1{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes _drawerSlideOutLeft_1rzp2_1{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes _drawerSlideInRight_1rzp2_1{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes _drawerSlideOutRight_1rzp2_1{0%{transform:translate(0)}to{transform:translate(100%)}}@media (prefers-reduced-motion:reduce){._overlay_1rzp2_1[data-state=open],._overlay_1rzp2_1[data-state=closed],._panelLeft_1rzp2_17[data-state=open],._panelLeft_1rzp2_17[data-state=closed],._panelRight_1rzp2_18[data-state=open],._panelRight_1rzp2_18[data-state=closed]{animation:none}}._srOnly_1rzp2_138{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}._content_5rs2x_1{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);min-width:180px;box-shadow:var(--shadow-md);z-index:1000;flex-direction:column;gap:.125rem;padding:.35rem;display:flex}._header_5rs2x_14{padding:.35rem .35rem .15rem}._separator_5rs2x_18{background-color:var(--color-border);height:1px;margin:.2rem .15rem}._item_5rs2x_24{border-radius:var(--radius-md);color:var(--color-text);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;align-items:center;gap:.5rem;padding:.45rem .6rem;font-size:.9rem;display:flex}._item_5rs2x_24[data-highlighted]{background-color:var(--color-surface-muted)}._item_5rs2x_24[data-disabled]{opacity:.5;pointer-events:none}._danger_5rs2x_46{color:var(--color-danger-strong)}._danger_5rs2x_46[data-highlighted]{background-color:var(--color-danger-soft)}._icon_5rs2x_54{align-items:center;display:inline-flex}._subChevron_5rs2x_60{opacity:.55;margin-left:auto}._item_5rs2x_24[data-state=open]{background-color:var(--color-surface-muted)}._content_19re1_1{--tooltip-bg:#334155;--tooltip-color:#fff;background-color:var(--tooltip-bg);color:var(--tooltip-color);border-radius:var(--radius-md);box-shadow:var(--shadow-md);z-index:70;-webkit-user-select:none;user-select:none;padding:.35rem .55rem;font-size:.8rem;line-height:1.3}._arrow_19re1_16{fill:var(--tooltip-bg)}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])) ._content_19re1_1{--tooltip-bg:#1d3135;--tooltip-color:#3fb5b7}}:host([data-theme=dark]) ._content_19re1_1{--tooltip-bg:#1d3135;--tooltip-color:#3fb5b7}._container_yjtbg_1{top:var(--space-6);z-index:1000;align-items:center;gap:var(--space-2);pointer-events:none;flex-direction:column;display:flex;position:fixed;left:50%;transform:translate(-50%)}._toast_yjtbg_14{background-color:var(--color-surface);color:var(--color-text);padding:10px var(--space-4);border-radius:var(--radius-full);box-shadow:var(--shadow-lg);border:1px solid var(--color-border);pointer-events:auto;cursor:pointer;align-items:center;gap:10px;min-width:250px;display:flex}._iconWrap_yjtbg_29{justify-content:center;align-items:center;display:flex}._type_success_yjtbg_35{color:var(--color-success)}._type_error_yjtbg_39{color:var(--color-danger)}._type_info_yjtbg_43{color:var(--color-primary)}._message_yjtbg_47{font-size:var(--font-sm);font-weight:500}._card_mk3l2_1{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);min-width:0}._padSm_mk3l2_8{padding:var(--space-3)}._padMd_mk3l2_12{padding:var(--space-4)}._padLg_mk3l2_16{padding:var(--space-5)}._shadowSm_mk3l2_20{box-shadow:var(--shadow-sm)}._shadowMd_mk3l2_24{box-shadow:var(--shadow-md)}._interactive_mk3l2_28{cursor:pointer;transition:border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out)}._interactive_mk3l2_28:hover{border-color:var(--color-primary-border);box-shadow:var(--shadow-lg);transform:translateY(-2px)}._interactive_mk3l2_28:active{box-shadow:var(--shadow-sm);transform:translateY(0)}._avatar_eiy4h_1{width:var(--avatar-size,36px);height:var(--avatar-size,36px);background-color:var(--avatar-color,var(--color-primary));color:var(--color-on-primary);font-size:var(--avatar-font,13px);text-transform:uppercase;-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;font-weight:700;line-height:1;display:inline-flex}._circle_eiy4h_17{border-radius:50%}._rounded_eiy4h_21{border-radius:var(--radius-md)}._badge_cz5qm_1{border-radius:var(--radius-full);font-size:var(--font-xs);white-space:nowrap;border:1px solid #0000;align-items:center;gap:4px;padding:3px 9px;font-weight:700;line-height:1;display:inline-flex}._sm_cz5qm_14{padding:2px 7px;font-size:10px}._toneNeutral_cz5qm_20{--tone:var(--color-text-soft)}._tonePrimary_cz5qm_24{--tone:var(--color-primary)}._toneSecondary_cz5qm_28{--tone:var(--color-secondary)}._toneSuccess_cz5qm_32{--tone:var(--color-success)}._toneDanger_cz5qm_36{--tone:var(--color-danger)}._toneWarn_cz5qm_40{--tone:var(--color-warn)}._soft_cz5qm_44{background-color:color-mix(in srgb, var(--tone) 12%, transparent);color:var(--tone);border-color:color-mix(in srgb, var(--tone) 22%, transparent)}._solid_cz5qm_50{background-color:var(--tone);color:var(--color-on-primary)}._outline_cz5qm_55{color:var(--tone);border-color:color-mix(in srgb, var(--tone) 42%, transparent)}._skeleton_qqc08_1{background-color:var(--color-surface-muted);animation:1.5s ease-in-out infinite _skeletonPulse_qqc08_1;display:block}._line_qqc08_7{width:var(--sk-w,100%);height:var(--sk-h,12px);border-radius:var(--radius-sm)}._circle_qqc08_13{width:var(--sk-w,36px);height:var(--sk-h,36px);border-radius:50%}._block_qqc08_19{width:var(--sk-w,100%);height:var(--sk-h,80px);border-radius:var(--radius-md)}@keyframes _skeletonPulse_qqc08_1{0%,to{opacity:1}50%{opacity:.5}}@media (prefers-reduced-motion:reduce){._skeleton_qqc08_1{animation:none}}._group_dsmc8_1{border-radius:var(--radius-full);background-color:var(--color-surface-muted);flex-wrap:wrap;gap:4px;padding:4px;display:inline-flex}@media (width<=640px){._group_dsmc8_1{scrollbar-width:none;-ms-overflow-style:none;flex-wrap:nowrap;display:flex;overflow-x:auto}._group_dsmc8_1::-webkit-scrollbar{display:none}._seg_dsmc8_21{white-space:nowrap;flex-shrink:0}}._seg_dsmc8_21{border-radius:var(--radius-full);color:var(--color-text-soft);font:inherit;font-size:var(--font-sm);cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;padding:6px 14px;font-weight:600;transition:background-color .15s,color .15s;display:inline-flex}._seg_dsmc8_21:hover{color:var(--color-text)}._segActive_dsmc8_49,._segActive_dsmc8_49:hover{background-color:var(--color-surface);color:var(--color-primary);box-shadow:var(--shadow-sm)}._seg_dsmc8_21:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}._count_dsmc8_61{border-radius:var(--radius-full);background-color:color-mix(in srgb, currentColor 16%, transparent);padding:0 6px;font-size:10px;font-weight:700}._container_wnsra_3{width:100%;display:inline-flex;position:relative}._trigger_wnsra_9{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;height:32px;color:var(--color-text);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);justify-content:space-between;align-items:center;gap:6px;padding:0 8px;font-family:inherit;font-size:12.5px;font-weight:600;display:inline-flex}._trigger_wnsra_9:hover:not(:disabled){border-color:var(--color-border-strong);background-color:var(--color-surface-hover,var(--color-surface))}._trigger_wnsra_9:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary-10);outline:none}._triggerActive_wnsra_43{border-color:var(--color-primary)}._trigger_wnsra_9:disabled{opacity:.4;cursor:not-allowed}._timeText_wnsra_52{font-feature-settings:"tnum";font-variant-numeric:tabular-nums;white-space:nowrap}._icon_wnsra_58{color:var(--color-text-soft);flex-shrink:0}._popover_wnsra_65{z-index:1000;border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-lg,0 10px 25px -5px #0006);flex-direction:column;gap:8px;width:220px;padding:8px;display:flex;position:absolute}._popoverTop_wnsra_79{bottom:calc(100% + 4px)}._popoverBottom_wnsra_83{top:calc(100% + 4px)}._popoverLeft_wnsra_87{left:0}._popoverRight_wnsra_91{right:0}._headerPills_wnsra_97{gap:4px;width:100%;display:flex}._pill_wnsra_103{border-radius:var(--radius-sm,4px);background-color:var(--color-primary-10);border:1px solid var(--color-primary-border);height:28px;color:var(--color-primary);font-feature-settings:"tnum";flex:1;justify-content:center;align-items:center;font-size:13px;font-weight:700;display:flex}._pickerBody_wnsra_120{gap:4px;width:100%;height:160px;display:flex}._column_wnsra_127{scrollbar-width:thin;border-radius:var(--radius-sm,4px);background-color:var(--color-bg);border:1px solid var(--color-border);flex-direction:column;flex:1;gap:2px;padding:4px 2px;display:flex;overflow-y:auto}._column_wnsra_127::-webkit-scrollbar{width:3px}._column_wnsra_127::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:var(--radius-full)}._wheelItem_wnsra_149{border-radius:var(--radius-sm,4px);height:30px;min-height:30px;color:var(--color-text-mid);cursor:pointer;transition:all var(--dur-fast) var(--ease-out);background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;font-family:inherit;font-size:12.5px;font-weight:500;display:flex}._wheelItem_wnsra_149:hover{background-color:var(--color-surface-hover,#ffffff14);color:var(--color-text)}._wheelItemActive_wnsra_172,._wheelItemActive_wnsra_172:hover{background-color:var(--color-primary);color:var(--color-on-primary);font-weight:700}._wheelItemDisabled_wnsra_179,._wheelItemDisabled_wnsra_179:hover{opacity:.3;cursor:not-allowed;color:var(--color-text-soft);pointer-events:none;background:0 0}._root_1d1de_1{height:100%;min-height:0;display:flex}._fullCenter_1d1de_7{flex:1;place-items:center;display:grid}._list_1d1de_14{border-right:1px solid var(--color-border);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;width:360px;min-height:0;display:flex}._listHead_1d1de_24{justify-content:space-between;align-items:center;padding:16px 18px 8px;display:flex}._listTitle_1d1de_31{font-size:var(--font-lg);color:var(--color-text);margin:0;font-weight:600}._composeBtn_1d1de_38{border-radius:var(--radius-md);background-color:var(--color-primary-10);width:32px;height:32px;color:var(--color-primary);cursor:pointer;border:none;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .14s,transform .14s;display:inline-flex}._composeBtn_1d1de_38:hover{background-color:var(--color-primary);color:var(--color-on-primary);transform:translateY(-1px)}._menuItemContent_1d1de_61{align-items:center;gap:12px;padding:4px 2px;display:flex}._chatIconTile_1d1de_68,._groupIconTile_1d1de_69{border-radius:var(--radius-md);flex-shrink:0;justify-content:center;align-items:center;width:38px;height:38px;display:inline-flex}._chatIconTile_1d1de_68{background-color:var(--color-primary-10);color:var(--color-primary)}._groupIconTile_1d1de_69{background-color:var(--color-secondary-10);color:var(--color-secondary)}._menuItemText_1d1de_89{text-align:left;flex-direction:column;align-items:flex-start;gap:2px;display:flex}._menuItemTitle_1d1de_97{color:var(--color-text);font-size:13.5px;font-weight:600;line-height:1.2}._menuItemSub_1d1de_104{color:var(--color-text-soft);font-size:11.5px;line-height:1.2}._search_1d1de_110{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:36px;color:var(--color-text-soft);align-items:center;gap:8px;margin:0 14px 8px;padding:0 10px;display:flex}._searchInput_1d1de_122{color:var(--color-text);background:0 0;border:none;outline:none;flex:1;font-size:13px}._searchClearBtn_1d1de_131{color:var(--color-text-soft);cursor:pointer;border-radius:var(--radius-sm);background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:color .14s;display:inline-flex}._searchClearBtn_1d1de_131:hover{color:var(--color-text)}._tabsWrapper_1d1de_148{align-items:center;display:flex;position:relative}._tabs_1d1de_148{border-bottom:1px solid var(--color-border);scrollbar-width:none;gap:2px;width:100%;padding:0 12px 8px;display:flex;overflow-x:auto}._tabs_1d1de_148::-webkit-scrollbar{display:none}._arrowBtn_1d1de_168{border-radius:var(--radius-full);color:#045d5e;cursor:pointer;z-index:10;width:24px;height:24px;box-shadow:var(--shadow-sm);background-color:#aecacb;border:1px solid #045d5e;justify-content:center;align-items:center;margin-top:-4px;transition:background-color .14s,color .14s,border-color .14s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}._arrowBtn_1d1de_168:hover{color:#045d5e;background-color:#aecacb;border-color:#045d5e}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])) ._arrowBtn_1d1de_168,:host(:not([data-theme=light])) ._arrowBtn_1d1de_168:hover{color:#3fb5b7;background-color:#1d3135;border-color:#3fb5b7}}:host([data-theme=dark]) ._arrowBtn_1d1de_168,:host([data-theme=dark]) ._arrowBtn_1d1de_168:hover{color:#3fb5b7;background-color:#1d3135;border-color:#3fb5b7}._arrowLeft_1d1de_223{left:4px}._arrowRight_1d1de_227{right:4px}._tabs_1d1de_148:after{content:"";flex:0 0 8px}._tab_1d1de_148{color:var(--color-text-soft);border-radius:var(--radius-full);cursor:pointer;white-space:nowrap;background:0 0;border:none;flex-shrink:0;align-items:center;gap:5px;padding:6px 10px;font-size:11.5px;font-weight:600;display:inline-flex;position:relative}._tab_1d1de_148:hover{color:var(--color-text)}._tabActive_1d1de_259,._tabActive_1d1de_259:hover{color:var(--color-primary)}._tabBg_1d1de_264{z-index:0;border-radius:var(--radius-full);background-color:var(--color-primary-10);box-shadow:inset 0 0 0 1px var(--color-primary-border);position:absolute;inset:0}._tabLabel_1d1de_273{z-index:1;position:relative}._tabCount_1d1de_278{z-index:1;border-radius:var(--radius-full);background-color:var(--color-secondary);min-width:16px;color:var(--color-on-primary);text-align:center;padding:0 5px;font-size:9px;font-weight:700;line-height:16px;position:relative}._tabDot_1d1de_292{z-index:1;background-color:var(--color-secondary);border-radius:50%;width:6px;height:6px;position:relative}._rows_1d1de_301{scrollbar-width:none;flex:1;min-height:0;padding:6px 0;overflow-y:auto}@media (width<=425px){._rows_1d1de_301{padding-bottom:var(--bottom-nav-offset,50px);transition:padding-bottom var(--dur-base) var(--ease-out)}}._rows_1d1de_301:hover{scrollbar-width:thin}._rows_1d1de_301::-webkit-scrollbar{background:0 0;width:5px}._rows_1d1de_301::-webkit-scrollbar-thumb{border-radius:var(--radius-full);background:0 0}._rows_1d1de_301:hover::-webkit-scrollbar-thumb{background:var(--color-border)}._rows_1d1de_301:hover::-webkit-scrollbar-thumb:hover{background:var(--color-border-strong)}._empty_1d1de_338{text-align:center;color:var(--color-text-soft);padding:24px 18px;font-size:13px}._sentinel_1d1de_347{flex-shrink:0;height:1px}._loadMore_1d1de_352{justify-content:center;align-items:center;padding:12px 0 16px;display:flex}._row_1d1de_301{border-left:3px solid #0000;align-items:center;display:flex;position:relative}._row_1d1de_301:hover{background-color:var(--color-surface-muted)}._rowActive_1d1de_370{border-left-color:var(--color-primary);background-color:var(--color-primary-05)}._rowMain_1d1de_375{cursor:pointer;text-align:left;background:0 0;border:none;flex:1;align-items:center;gap:11px;min-width:0;padding:9px 4px 9px 15px;display:flex}._rowMenuBtn_1d1de_388{border-radius:var(--radius-md);width:28px;height:28px;color:var(--color-text-soft);cursor:pointer;opacity:1;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;margin-right:10px;transition:background-color .12s,color .12s;display:inline-flex}._rowMenuBtn_1d1de_388:hover{background-color:var(--color-border);color:var(--color-text)}._rowPin_1d1de_412{width:12px;height:12px;color:var(--color-text-soft);flex-shrink:0}._rowStar_1d1de_419{width:12px;height:12px;color:var(--color-secondary);flex-shrink:0}._rowAvatar_1d1de_426{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:12px;font-weight:700;display:flex;position:relative}._onlineDot_1d1de_441{background-color:var(--color-success);border:2px solid var(--color-surface);border-radius:50%;width:9px;height:9px;position:absolute;bottom:0;right:0}._rowBody_1d1de_452{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._rowTop_1d1de_460{justify-content:space-between;align-items:center;gap:6px;display:flex}._rowName_1d1de_467{min-width:0;font-size:var(--font-base);color:var(--color-text);flex:1;align-items:center;gap:4px;font-weight:600;display:flex}._rowTitle_1d1de_478{line-clamp:2;-webkit-line-clamp:2;word-break:break-word;-webkit-box-orient:vertical;flex:1;min-width:0;line-height:1.3;display:-webkit-box;overflow:hidden}._rowTime_1d1de_490{font-size:var(--font-xs);color:var(--color-text-soft);flex-shrink:0}._rowBottom_1d1de_496{justify-content:space-between;align-items:center;gap:6px;display:flex}._rowPreview_1d1de_503{color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}._rowRole_1d1de_511{color:var(--color-primary);font-size:9px;font-weight:600}._unread_1d1de_517{text-align:center;border-radius:var(--radius-full);background-color:var(--color-secondary);min-width:16px;color:var(--color-on-primary);flex-shrink:0;padding:1px 6px;font-size:9.5px;font-weight:700}._view_1d1de_530{background-color:var(--color-bg);flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}._viewEmpty_1d1de_542{text-align:center;background-color:var(--color-bg);flex-direction:column;flex:1;justify-content:center;align-items:center;padding:40px;display:flex}._emptyIconWrap_1d1de_553{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:64px;height:64px;color:var(--color-text-soft);justify-content:center;align-items:center;margin-bottom:16px;display:flex}._emptyTitle_1d1de_565{font-size:var(--font-lg);color:var(--color-text);margin:0 0 8px;font-weight:700}._emptyText_1d1de_572{font-size:var(--font-sm);color:var(--color-text-soft);max-width:250px;margin:0;line-height:1.5}._viewHead_1d1de_580{background-color:var(--color-surface);border-bottom:1px solid var(--color-border);flex-shrink:0;align-items:center;gap:11px;padding:12px 20px;display:flex}._viewAvatarWrap_1d1de_590{flex-shrink:0;display:inline-flex;position:relative}._viewAvatar_1d1de_590{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);border-radius:50%;justify-content:center;align-items:center;font-size:12px;font-weight:700;display:flex}._viewPresenceDot_1d1de_609{width:12px;height:12px}._viewHeadText_1d1de_614{flex-direction:column;flex:1;min-width:0;line-height:1.25;display:flex}._viewIcon_1d1de_622{border-radius:var(--radius-md);background-color:color-mix(in srgb, var(--avatar-color) 16%, transparent);width:36px;height:36px;color:var(--avatar-color);flex-shrink:0;justify-content:center;align-items:center;display:flex}._viewTitleRow_1d1de_634{flex:1;align-items:center;gap:6px;min-width:0;display:flex}._viewTitle_1d1de_634{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:700;overflow:hidden}._statusPill_1d1de_653{background-color:var(--pill);color:var(--color-on-primary);letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;border-radius:5px;flex-shrink:0;padding:3px 7px;font-size:9px;font-weight:700}._adminBadge_1d1de_666{background-color:var(--color-primary-10);color:var(--color-primary);letter-spacing:.05em;text-transform:uppercase;white-space:nowrap;border-radius:5px;flex-shrink:0;padding:2px 7px;font-size:8.5px;font-weight:800}._viewSub_1d1de_679{color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;font-size:11.5px;overflow:hidden}._headEnd_1d1de_687{flex-shrink:0;align-items:center;gap:6px;display:flex}._memberStack_1d1de_694{align-items:center;display:flex}._memberAvatar_1d1de_699{border:2px solid var(--color-surface);border-radius:50%;line-height:0;display:inline-flex}._memberAvatar_1d1de_699:not(:first-child){margin-left:-8px}._memberMore_1d1de_710{border:2px solid var(--color-surface);background-color:var(--color-surface-muted);width:26px;height:26px;color:var(--color-text-mid);border-radius:50%;justify-content:center;align-items:center;margin-left:-8px;font-size:10px;font-weight:700;display:inline-flex}._headMenuBtn_1d1de_725{border-radius:var(--radius-md);width:32px;height:32px;color:var(--color-text-mid);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}._headMenuBtn_1d1de_725:hover{background-color:var(--color-surface-muted)}._threadWrap_1d1de_743{flex-direction:column;flex:1;min-height:0;display:flex;position:relative}._messages_1d1de_535{background-color:var(--color-bg);background-image:radial-gradient(var(--color-border-strong) .5px, transparent .5px);background-size:22px 22px;flex-direction:column;flex:1;padding:20px;display:flex;overflow:hidden auto}._thread_1d1de_743{flex-direction:column;gap:2px;margin-top:auto;display:flex}._center_1d1de_776{place-items:center;padding:24px 0;display:grid}._olderRow_1d1de_783{flex-shrink:0;justify-content:center;padding:4px 0 8px;display:flex}._newPill_1d1de_791{z-index:5;border:1px solid var(--color-primary-border);border-radius:var(--radius-full);background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;box-shadow:var(--shadow-lg);align-items:center;gap:4px;padding:6px 14px;font-size:11px;font-weight:600;transition:background-color .12s;display:inline-flex;position:absolute;bottom:12px;left:50%;transform:translate(-50%)}._newPill_1d1de_791:hover{background-color:var(--color-primary-strong)}._sendFailed_1d1de_817{align-items:center;gap:4px;display:inline-flex}._sendFailedText_1d1de_823{opacity:.85;font-size:9.5px;font-weight:600}._retryBtn_1d1de_829{color:inherit;cursor:pointer;background:0 0;border:none;padding:0;font-size:9.5px;font-weight:700;text-decoration:underline}._retryBtn_1d1de_829:hover{opacity:.85}._systemRow_1d1de_844{justify-content:center;margin:8px 0;padding:2px 0;display:flex}._systemPill_1d1de_851{border-radius:var(--radius-full);background-color:var(--color-surface-muted);max-width:82%;color:var(--color-text-soft);text-align:center;padding:4px 12px;font-size:11px;font-weight:500}._msgRow_1d1de_768{justify-content:flex-start;align-items:flex-end;gap:8px;display:flex}._msgRowGroupStart_1d1de_768{margin-top:10px}._msgRowMe_1d1de_875{justify-content:flex-end}._msgAvatarSpacer_1d1de_880{flex-shrink:0;width:28px}._dateSep_1d1de_886{justify-content:center;margin:8px 0 2px;display:flex}._dateSepPill_1d1de_892{border-radius:var(--radius-full);background-color:var(--color-surface);color:var(--color-text-soft);letter-spacing:.02em;border:1px solid var(--color-border);box-shadow:var(--shadow-sm);padding:3px 12px;font-size:10.5px;font-weight:600}._msgBubbleWrap_1d1de_904{align-items:center;gap:4px;display:flex;position:relative}._msgRowMe_1d1de_875 ._msgBubbleWrap_1d1de_904{flex-direction:row-reverse}._reactWrap_1d1de_915{flex-shrink:0;position:relative}._reactBtn_1d1de_920{width:24px;height:24px;color:var(--color-text-soft);cursor:pointer;opacity:0;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;transition:opacity .12s,background-color .12s;display:inline-flex}._msgRow_1d1de_768:hover ._reactBtn_1d1de_920{opacity:1}._reactBtn_1d1de_920:hover{background-color:var(--color-surface-muted);color:var(--color-primary)}._reactPop_1d1de_946{z-index:20;border-radius:var(--radius-full);background-color:var(--color-surface);border:1px solid var(--color-border);box-shadow:var(--shadow-lg);gap:2px;max-width:calc(100vw - 32px);padding:3px;display:flex;position:absolute;bottom:calc(100% + 6px)}._reactPopRight_1d1de_961{left:-50px;right:auto}._reactPopLeft_1d1de_967{left:auto;right:-27px}._reactPopBtn_1d1de_972{cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;width:24px;height:26px;font-size:15px;transition:transform .1s;display:inline-flex}._reactPopBtn_1d1de_972:hover{background-color:var(--color-surface-muted);transform:scale(1.18)}._msgAvatar_1d1de_880{background-color:var(--avatar-color);width:28px;height:28px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:10px;font-weight:700;display:flex}._msgCol_1d1de_1005{flex-direction:column;min-width:0;max-width:65%;display:flex}._msgColWithReactions_1d1de_1012{padding-bottom:12px}._bubble_1d1de_1016{font-size:12.5px;line-height:var(--line-body);overflow-wrap:anywhere;flex-direction:column;padding:9px 13px;display:flex;box-shadow:0 1px 3px #045d5e0f}._bubbleThem_1d1de_1026{background-color:var(--color-surface);color:var(--color-text);border:1px solid var(--color-border);border-radius:14px 14px 14px 4px}._bubbleMe_1d1de_1033{background-color:var(--color-primary);color:var(--color-on-primary);border-radius:14px 14px 4px}._msgAuthor_1d1de_1039{color:var(--color-primary);white-space:nowrap;text-overflow:ellipsis;margin-bottom:2px;font-size:11px;font-weight:700;overflow:hidden}._bubbleMe_1d1de_1033 ._msgAuthor_1d1de_1039{color:var(--color-on-primary)}._msgText_1d1de_1053{white-space:pre-wrap;word-break:break-word}._msgTextDeleted_1d1de_1058{opacity:.75;font-style:italic}._msgMeta_1d1de_1063{white-space:nowrap;flex-shrink:0;align-self:flex-end;align-items:center;gap:4px;margin-top:1px;display:inline-flex}._msgTime_1d1de_1073{opacity:.7;font-size:9.5px;font-weight:500}._tick_1d1de_1080{opacity:.7;align-items:center;display:inline-flex}._tickRead_1d1de_1086{opacity:1;color:var(--color-primary-light)}._reactionPill_1d1de_1091{z-index:2;border-radius:var(--radius-full);background-color:var(--color-surface);border:1.5px solid var(--color-border);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:4px;padding:2px 6px;transition:transform .12s,border-color .12s,background-color .12s;display:inline-flex;position:absolute;bottom:-11px;box-shadow:0 2px 4px #0000000f,0 1px 2px #0000000a}._reactionPill_1d1de_1091:hover{border-color:var(--color-primary-border);background-color:var(--color-surface-muted);transform:scale(1.05)}._reactionPillActive_1d1de_1119{background-color:var(--color-primary-10);border-color:var(--color-primary-border)}._reactionsMe_1d1de_1124{right:14px}._reactionsThem_1d1de_1128{left:14px}._reactionEmojis_1d1de_1132{letter-spacing:-1.5px;align-items:center;padding-right:1.5px;font-size:11px;display:inline-flex}._reactionCount_1d1de_1140{color:var(--color-text-mid);font-size:10px;font-weight:700;line-height:1}._reactionPillActive_1d1de_1119 ._reactionCount_1d1de_1140{color:var(--color-primary)}._reactionOn_1d1de_1151:hover{background-color:var(--color-primary-10)}._composer_1d1de_1156{background-color:var(--color-surface);border-top:1px solid var(--color-border);flex-shrink:0;align-items:flex-end;gap:6px;padding:12px 20px;display:flex}._removedComposer_1d1de_1167{background-color:var(--color-surface-muted);border-top:1px solid var(--color-border);color:var(--color-text-soft);text-align:center;flex-shrink:0;justify-content:center;align-items:center;gap:8px;padding:14px 20px;font-size:12.5px;display:flex}._attachTray_1d1de_1182{background-color:var(--color-surface-muted);border-top:1px solid var(--color-border);flex-wrap:wrap;flex-shrink:0;align-items:center;gap:8px;max-height:176px;padding:10px 20px;display:flex;overflow-y:auto}._attachItem_1d1de_1195{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);flex-shrink:0;width:72px;height:72px;position:relative;overflow:hidden}._attachThumb_1d1de_1206{object-fit:cover;width:100%;height:100%;display:block}._attachFile_1d1de_1213{width:100%;height:100%;color:var(--color-text-soft);flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:6px;display:flex}._attachFileName_1d1de_1225{text-overflow:ellipsis;white-space:nowrap;max-width:100%;font-size:9px;line-height:1.2;overflow:hidden}._attachRemove_1d1de_1234{border:1px solid var(--color-border);background-color:var(--color-surface);width:18px;height:18px;color:var(--color-text);cursor:pointer;box-shadow:var(--shadow-sm);border-radius:50%;justify-content:center;align-items:center;transition:color .12s;display:inline-flex;position:absolute;top:3px;right:3px}._attachRemove_1d1de_1234:hover{color:var(--color-danger)}._attachAdd_1d1de_1256{border:1px dashed var(--color-border-strong);border-radius:var(--radius-md);background-color:var(--color-surface);width:72px;height:72px;color:var(--color-text-soft);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;transition:color .12s,border-color .12s;display:inline-flex}._attachAdd_1d1de_1256:hover{color:var(--color-primary);border-color:var(--color-primary-border)}._composerIcon_1d1de_1278{width:38px;height:38px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .12s,color .12s;display:inline-flex}._composerIcon_1d1de_1278:hover{background-color:var(--color-surface-muted);color:var(--color-primary)}._composerInput_1d1de_1300{border:1px solid var(--color-border);background-color:var(--color-bg);min-height:40px;max-height:120px;color:var(--color-text);resize:none;border-radius:19px;outline:none;flex:1;padding:10px 16px;font-family:inherit;font-size:13px;line-height:1.4;transition:border-color .12s,box-shadow .12s}._composerInput_1d1de_1300:focus{border-color:var(--color-primary-border);box-shadow:0 0 0 3px var(--color-primary-10)}._emojiWrap_1d1de_1325{flex-shrink:0;position:relative}._emojiBackdrop_1d1de_1330{z-index:15;cursor:default;background:0 0;border:none;position:fixed;inset:0}._emojiPop_1d1de_1339{z-index:20;border-radius:var(--radius-lg);background-color:var(--color-surface);border:1px solid var(--color-border);width:224px;box-shadow:var(--shadow-lg);grid-template-columns:repeat(5,1fr);gap:2px;padding:8px;display:grid;position:absolute;bottom:calc(100% + 8px);left:0}._emojiBtn_1d1de_1355{border-radius:var(--radius-md);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;width:38px;height:38px;font-size:18px;transition:background-color .1s,transform .1s;display:inline-flex}._emojiBtn_1d1de_1355:hover{background-color:var(--color-surface-muted);transform:scale(1.12)}._sendBtn_1d1de_1376{background-color:var(--color-primary);width:40px;height:40px;color:var(--color-on-primary);cursor:pointer;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;display:flex}._sendBtn_1d1de_1376:disabled{opacity:.5;cursor:not-allowed}._memberStackBtn_1d1de_1396{border-radius:var(--radius-full);cursor:pointer;background:0 0;border:none;padding:2px;transition:background-color .12s;display:inline-flex}._memberStackBtn_1d1de_1396:hover{background-color:var(--color-surface-muted)}._membersBody_1d1de_1410{flex-direction:column;gap:10px;display:flex}._unsavedBar_1d1de_1416{border-radius:var(--radius-full);background-color:var(--color-secondary-10);color:var(--color-secondary-strong);align-self:flex-start;padding:3px 10px;font-size:11px;font-weight:700}._addMemberCta_1d1de_1426{border-radius:var(--radius-md);background-color:var(--color-primary-05);width:100%;color:var(--color-primary);border:1px dashed var(--color-primary-border);cursor:pointer;justify-content:center;align-items:center;gap:7px;padding:10px 14px;font-size:12.5px;font-weight:700;transition:background-color .12s;display:inline-flex}._addMemberCta_1d1de_1426:hover{background-color:var(--color-primary-10)}._membersSectionLabel_1d1de_1447{letter-spacing:.06em;color:var(--color-text-soft);font-size:9.5px;font-weight:700}._membersList_1d1de_1454{flex-direction:column;gap:2px;display:flex}._memberRow_1d1de_1460{border-radius:var(--radius-md);border:1px solid #0000;align-items:center;gap:11px;padding:8px;display:flex}._memberRow_1d1de_1460:hover{background-color:var(--color-surface-muted)}._memberRowNew_1d1de_1473{background-color:var(--color-success-soft);border-color:color-mix(in srgb, var(--color-success) 30%, transparent)}._memberRowNew_1d1de_1473:hover{background-color:var(--color-success-soft)}._memberRowAvatar_1d1de_1482{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:12px;font-weight:700;display:flex}._memberRowBody_1d1de_1496{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._memberRowName_1d1de_1504{color:var(--color-text);flex-wrap:wrap;align-items:center;gap:6px;font-size:12.5px;font-weight:600;display:flex}._memberRowYou_1d1de_1514{color:var(--color-text-soft);font-weight:500}._memberRowRole_1d1de_1519{font-size:var(--font-xs);color:var(--color-text-soft);align-items:center;gap:6px;display:inline-flex}._memberBadgeAdmin_1d1de_1529{letter-spacing:.04em;background-color:var(--color-secondary);color:var(--color-on-primary);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:800}._memberBadge_1d1de_1529{letter-spacing:.04em;background-color:var(--color-bg);color:var(--color-text-soft);border:1px solid var(--color-border);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:700}._memberPillNew_1d1de_1550{letter-spacing:.04em;background-color:var(--color-success);color:var(--color-on-primary);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:800}._memberPillUp_1d1de_1560{letter-spacing:.04em;background-color:var(--color-secondary-10);color:var(--color-secondary-strong);border:1px solid var(--color-secondary-border);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:800}._memberPillDown_1d1de_1571{letter-spacing:.04em;background-color:var(--color-surface-muted);color:var(--color-text-mid);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:800}._memberRowMenuBtn_1d1de_1581{border-radius:var(--radius-md);width:30px;height:30px;color:var(--color-text-mid);cursor:pointer;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .12s;display:inline-flex}._memberRowMenuBtn_1d1de_1581:hover{background-color:var(--color-border);color:var(--color-text)}._removedLabel_1d1de_1601{letter-spacing:.06em;color:var(--color-danger);padding:10px 2px 4px;font-size:9.5px;font-weight:700}._removedRow_1d1de_1609{border-radius:var(--radius-md);background-color:var(--color-danger-soft);border:1px solid color-mix(in srgb, var(--color-danger) 25%, transparent);align-items:center;gap:11px;margin-bottom:2px;padding:8px;display:flex}._removedRow_1d1de_1609 ._memberRowAvatar_1d1de_1482{opacity:.6}._removedName_1d1de_1624{color:var(--color-text);text-decoration:line-through;-webkit-text-decoration-color:var(--color-danger);text-decoration-color:var(--color-danger);font-size:12.5px;font-weight:600}._undoBtn_1d1de_1632{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);font-size:var(--font-xs);cursor:pointer;flex-shrink:0;align-items:center;gap:5px;padding:4px 10px;font-weight:700;transition:background-color .12s;display:inline-flex}._undoBtn_1d1de_1632:hover{background-color:var(--color-surface-muted)}._addPanel_1d1de_1653{flex-direction:column;gap:10px;display:flex}._addPanelHead_1d1de_1659{align-items:center;gap:8px;display:flex}._addPanelTitle_1d1de_1665{color:var(--color-text);font-size:13px;font-weight:700}._addPanelSearch_1d1de_1671{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:36px;color:var(--color-text-soft);align-items:center;gap:8px;padding:0 10px;display:flex}._addPanelList_1d1de_1682{flex-direction:column;gap:2px;max-height:320px;display:flex;overflow-y:auto}._addPanelEmpty_1d1de_1690{text-align:center;color:var(--color-text-soft);padding:20px;font-size:13px}._addMemberBtn_1d1de_1697{border-radius:var(--radius-md);background-color:var(--color-primary-10);color:var(--color-primary);font-size:var(--font-xs);cursor:pointer;border:none;flex-shrink:0;align-items:center;gap:5px;padding:5px 12px;font-weight:700;transition:background-color .12s,transform .12s;display:inline-flex}._addMemberBtn_1d1de_1697:hover{background-color:var(--color-primary);color:var(--color-on-primary);transform:translateY(-1px)}._newGroupBody_1d1de_1722{flex-direction:column;gap:12px;display:flex}._staffPickRow_1d1de_1728{border-radius:var(--radius-md);text-align:left;cursor:pointer;background-color:#0000;border:1px solid #0000;align-items:center;gap:11px;width:100%;padding:8px;transition:background-color .12s,border-color .12s;display:flex}._staffPickRow_1d1de_1728:hover{background-color:var(--color-surface-muted)}._staffPickRow_1d1de_1728:disabled{opacity:.6;cursor:default}._staffPickRowOn_1d1de_1753{background-color:var(--color-primary-10);border-color:color-mix(in srgb, var(--color-primary) 30%, transparent)}._staffPickRowOn_1d1de_1753:hover{background-color:var(--color-primary-10)}._pickCheck_1d1de_1762{border:1.5px solid var(--color-border);width:20px;height:20px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._pickCheckOn_1d1de_1774{background-color:var(--color-primary);border-color:var(--color-primary)}._pickerPending_1d1de_1779{justify-content:center;padding:10px 0 2px;display:flex}@media (width<=1023px){._composer_1d1de_1156{padding:10px 14px}}._connPill_1d1de_1793{border-radius:var(--radius-full);background-color:var(--color-warning-soft,var(--color-primary-10));color:var(--color-text-muted);font-size:var(--font-xs);white-space:nowrap;flex-shrink:0;align-items:center;gap:4px;padding:3px 8px;font-weight:600;display:inline-flex}._typingRow_1d1de_1807{color:var(--color-text-muted);flex-shrink:0;align-items:center;gap:8px;padding:4px 20px 8px;display:flex}._typingText_1d1de_1816{font-size:var(--font-xs);font-weight:500}._typingDots_1d1de_1821{align-items:center;gap:3px;display:inline-flex}._typingDots_1d1de_1821 span{background-color:var(--color-text-muted);border-radius:50%;width:5px;height:5px;animation:1.2s ease-in-out infinite _typingBounce_1d1de_1}._typingDots_1d1de_1821 span:nth-child(2){animation-delay:.18s}._typingDots_1d1de_1821 span:nth-child(3){animation-delay:.36s}@keyframes _typingBounce_1d1de_1{0%,60%,to{opacity:.5;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}@media (prefers-reduced-motion:reduce){._typingDots_1d1de_1821 span{animation:none}}._memberRowAvatarWrap_1d1de_1863{flex-shrink:0;display:inline-flex;position:relative}._presenceDot_1d1de_1869{background-color:var(--color-success);border:2px solid var(--color-surface);border-radius:50%;width:11px;height:11px;position:absolute;bottom:-1px;right:-1px}._replyPreview_1d1de_1880{border-left:3.5px solid var(--color-secondary);background-color:var(--color-surface-muted);color:var(--color-text-soft);border-radius:8px;margin-bottom:3px;padding:7px 10px;font-size:11.5px;display:block}._bubbleMe_1d1de_1033 ._replyPreview_1d1de_1880{border-left-color:var(--color-secondary)}:host([data-theme=dark]) ._replyPreview_1d1de_1880,:host([data-theme=dark]) ._bubbleMe_1d1de_1033 ._replyPreview_1d1de_1880{border-left-color:var(--color-on-primary)}._replyPreviewAuthor_1d1de_1900{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;max-width:300px;margin-bottom:1px;font-size:11.5px;font-weight:600;display:block;overflow:hidden}._replyPreviewText_1d1de_1913{white-space:nowrap;text-overflow:ellipsis;max-width:300px;font-size:11.5px;display:block;overflow:hidden}@media (width<=480px){._replyPreviewAuthor_1d1de_1900,._replyPreviewText_1d1de_1913{max-width:220px}}._replyBar_1d1de_1929{border-radius:var(--radius-md);background-color:var(--color-surface-muted);align-items:center;gap:8px;margin:0 12px 8px;padding:8px 10px;font-size:13px;display:flex}._replyBarText_1d1de_1940{min-width:0;color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}._replyBarClose_1d1de_1949{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;padding:4px}._msgMedia_1d1de_1957{border-radius:var(--radius-md);background:var(--color-surface-muted);border:1px solid var(--color-border);object-fit:cover;cursor:pointer;max-width:260px;max-height:300px;margin-top:6px;transition:transform .2s,box-shadow .2s,filter .2s;display:block}._msgMedia_1d1de_1957:hover{box-shadow:var(--shadow-md);filter:brightness(1.03);transform:scale(1.02)}._msgMediaLoading_1d1de_1981,._msgMediaFallback_1d1de_1982{border-radius:var(--radius-md);background:var(--color-surface-muted);width:240px;max-width:100%;height:140px;color:var(--color-text-soft);justify-content:center;align-items:center;gap:6px;margin-top:6px;font-size:12px;display:flex}._albumGrid_1d1de_1998{grid-template-columns:repeat(2,1fr);gap:3px;width:240px;max-width:100%;margin-top:6px;display:grid}._albumCell_1d1de_2007{aspect-ratio:1;cursor:pointer;position:relative}._albumCell_1d1de_2007:first-child:nth-last-child(odd){aspect-ratio:16/9;grid-column:span 2}._albumCellMedia_1d1de_2007{border-radius:var(--radius-sm);background:var(--color-surface-muted);position:absolute;inset:0;overflow:hidden}._albumCellMedia_1d1de_2007 img,._albumCellMedia_1d1de_2007>div{object-fit:cover;border:none;border-radius:0;width:100%;max-width:none;height:100%;max-height:none;margin-top:0;transition:transform .25s,filter .2s}._albumCell_1d1de_2007:hover ._albumCellMedia_1d1de_2007 img{filter:brightness(1.05);transform:scale(1.06)}._albumCellActions_1d1de_2052{z-index:4;border-radius:var(--radius-full);background:var(--color-overlay);opacity:0;align-items:center;gap:2px;padding:2px;transition:opacity .14s;display:flex;position:absolute;top:5px;right:5px}._albumCell_1d1de_2007:hover ._albumCellActions_1d1de_2052{opacity:1}._albumCellActions_1d1de_2052 ._reactBtn_1d1de_920{opacity:1;color:var(--color-on-primary)}._albumCellActions_1d1de_2052 ._reactBtn_1d1de_920:hover,._albumActionBtn_1d1de_2078:hover{background-color:var(--color-overlay);color:var(--color-on-primary)}._albumActionBtn_1d1de_2078{border-radius:var(--radius-full);width:24px;height:24px;color:var(--color-on-primary);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;transition:background-color .12s;display:inline-flex}._albumCellReactions_1d1de_2097{z-index:4;position:absolute;bottom:4px;left:5px}._mediaButton_1d1de_2106{cursor:pointer;background:0 0;border:none;padding:0;line-height:0;display:inline-block}._mediaButtonFill_1d1de_2115{width:100%;height:100%;display:block}._viewerBackdrop_1d1de_2122{z-index:200;justify-content:center;align-items:center;padding:40px;display:flex;position:fixed;inset:0}._viewerScrim_1d1de_2132{background-color:var(--color-media-scrim);cursor:zoom-out;border:none;animation:.16s _viewerFade_1d1de_1;position:absolute;inset:0}._viewerStage_1d1de_2141{z-index:1;color:#ffffffe6;pointer-events:none;justify-content:center;align-items:center;max-width:92vw;max-height:86vh;display:flex;position:relative}._viewerImg_1d1de_2155{object-fit:contain;border-radius:var(--radius-md);pointer-events:auto;max-width:92vw;max-height:86vh;animation:.18s _viewerZoom_1d1de_1;box-shadow:0 20px 60px #00000080}._viewerFallback_1d1de_2165{color:#ffffffbf;flex-direction:column;align-items:center;gap:10px;font-size:13px;display:flex}._viewerClose_1d1de_2174,._viewerNav_1d1de_2175{z-index:2;color:#fff;cursor:pointer;background-color:#ffffff1f;border:none;border-radius:50%;justify-content:center;align-items:center;transition:background-color .15s,transform .15s;display:inline-flex;position:absolute}._viewerClose_1d1de_2174:hover,._viewerNav_1d1de_2175:hover:not(:disabled){background-color:#ffffff3d}._viewerNav_1d1de_2175:disabled{opacity:.35;cursor:default}._viewerClose_1d1de_2174{width:40px;height:40px;top:20px;right:24px}._viewerNav_1d1de_2175{width:46px;height:46px;top:50%;transform:translateY(-50%)}._viewerNav_1d1de_2175:hover:not(:disabled){transform:translateY(-50%)scale(1.06)}._viewerNavPrev_1d1de_2219{left:20px}._viewerNavNext_1d1de_2223{right:20px}._viewerCount_1d1de_2227{z-index:2;border-radius:var(--radius-full);color:#fff;background-color:#ffffff1f;padding:4px 12px;font-size:12px;font-weight:600;position:absolute;bottom:24px;left:50%;transform:translate(-50%)}@keyframes _viewerFade_1d1de_1{0%{opacity:0}to{opacity:1}}@keyframes _viewerZoom_1d1de_1{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}._fileCard_1d1de_2264{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface-muted);text-align:left;cursor:pointer;align-items:center;gap:10px;width:260px;max-width:100%;margin-top:6px;padding:9px 11px;transition:background .14s,opacity .14s;display:flex}._fileCardMe_1d1de_2282{background:var(--color-surface)}._fileCard_1d1de_2264:hover:not(:disabled){border-color:var(--color-border-strong)}._fileCard_1d1de_2264:disabled{cursor:default;opacity:.65}._fileCardIcon_1d1de_2295{border-radius:var(--radius-sm);background:var(--color-bg);width:38px;height:38px;color:var(--color-primary);flex-shrink:0;justify-content:center;align-items:center;display:flex}._fileCardInfo_1d1de_2307{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}._fileCardName_1d1de_2315{color:var(--color-text);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;overflow:hidden}._fileCardMetaLabel_1d1de_2324{color:var(--color-text-soft);font-size:11px}._fileCardDownload_1d1de_2329{color:var(--color-text-soft);flex-shrink:0;justify-content:center;align-items:center;display:flex}._msgActions_1d1de_2337{opacity:0;gap:4px;margin-left:6px;transition:opacity .14s;display:inline-flex}._msgRow_1d1de_768:hover ._msgActions_1d1de_2337{opacity:1}._msgActionBtn_1d1de_2349{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;padding:2px 4px;font-size:11px}._msgActionBtn_1d1de_2349:hover{color:var(--color-text)}._editedLabel_1d1de_2362{color:var(--color-text-soft);margin-left:4px;font-size:11px;font-style:italic}._hiddenFileInput_1d1de_2369{display:none}._viewPaneWrapper_1d1de_2373{flex-direction:column;flex:1;min-width:0;height:100%;display:flex}._emptyFloating1_1d1de_2381{color:var(--color-primary-20);opacity:.35;pointer-events:none;position:absolute;top:25%;left:28%}._emptyFloating2_1d1de_2390{color:var(--color-secondary-20);opacity:.45;pointer-events:none;position:absolute;bottom:30%;right:28%}._emptyFloating3_1d1de_2399{color:var(--color-primary-light);opacity:.25;pointer-events:none;position:absolute;top:55%;right:32%}._backBtn_1d1de_2408{display:none}@media (width<=1024px){._viewTitleRow_1d1de_634{flex-wrap:wrap;gap:4px 6px}._viewTitle_1d1de_634{flex:100%;max-width:100%}._adminBadge_1d1de_666,._statusPill_1d1de_653{margin-top:1px}}@media (width<=1023px){._root_1d1de_1{flex:1!important;height:100%!important}._msgCol_1d1de_1005{max-width:88%}._viewHead_1d1de_580{gap:8px;padding:10px 14px}._viewTitleRow_1d1de_634{flex-wrap:wrap;gap:4px}._root_1d1de_1:not(._hasActiveChat_1d1de_2449) ._viewPaneWrapper_1d1de_2373,._root_1d1de_1:not(._hasActiveChat_1d1de_2449) ._viewEmpty_1d1de_542{display:none!important}._root_1d1de_1:not(._hasActiveChat_1d1de_2449) ._list_1d1de_14{flex:1!important;width:100%!important;height:100%!important;max-height:100%!important}._root_1d1de_1._hasActiveChat_1d1de_2449 ._list_1d1de_14{display:none!important}._root_1d1de_1._hasActiveChat_1d1de_2449 ._viewPaneWrapper_1d1de_2373,._root_1d1de_1._hasActiveChat_1d1de_2449 ._viewEmpty_1d1de_542{width:100%!important;height:100%!important;display:flex!important}._backBtn_1d1de_2408{color:var(--color-text-soft);border-radius:var(--radius-md);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;margin-right:4px;padding:6px;transition:background-color .12s;display:inline-flex}._backBtn_1d1de_2408:hover{background-color:var(--color-surface-muted);color:var(--color-text)}}@media (width<=1280px){._composer_1d1de_1156{align-items:center;gap:4px;padding:10px 12px}._composerIcon_1d1de_1278{width:34px;height:34px}._composerInput_1d1de_1300{min-height:38px;padding:9px 12px;font-size:12.5px;line-height:1.35}._sendBtn_1d1de_1376{width:36px;height:36px}}@media (width<=768px){._composer_1d1de_1156{align-items:center;gap:4px;padding:8px}._composerIcon_1d1de_1278{width:32px;height:32px}._composerInput_1d1de_1300{min-height:36px;padding:9px 12px;font-size:12px;line-height:1.35}._sendBtn_1d1de_1376{width:34px;height:34px}}@media (width<=480px){._viewHead_1d1de_580{gap:4px;padding:8px}._memberStack_1d1de_694 ._memberAvatar_1d1de_699:nth-child(n+3){display:none}._memberStack_1d1de_694 ._memberAvatar_1d1de_699:not(:first-child){margin-left:-12px}._composer_1d1de_1156{align-items:center;gap:3px;padding:8px 6px}._composerIcon_1d1de_1278{width:30px;height:30px}._composerInput_1d1de_1300{min-height:34px;padding:8px 10px;font-size:11.5px;line-height:1.35}._sendBtn_1d1de_1376{width:32px;height:32px}}._standardHeader_1d1de_2580{align-items:center;gap:12px;width:100%;display:flex}._mobileSelectionHeader_1d1de_2587{justify-content:space-between;align-items:center;gap:8px;width:100%;padding:2px 0;display:none}._selectionLeft_1d1de_2596{flex:1;align-items:center;gap:10px;min-width:0;display:flex}._selectionTitle_1d1de_2604{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;overflow:hidden}._selectionActions_1d1de_2613{flex-shrink:0;align-items:center;gap:4px;display:flex}._selectionActionBtn_1d1de_2620{border-radius:var(--radius-md);width:32px;height:32px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;transition:background-color .12s,color .12s;display:inline-flex}._selectionActionBtn_1d1de_2620:hover,._selectionActionBtn_1d1de_2620:active{background-color:var(--color-primary-10);color:var(--color-primary)}._selectionActionDanger_1d1de_2642:hover,._selectionActionDanger_1d1de_2642:active{background-color:var(--color-error-10,#ef44441a);color:var(--color-error,#ef4444)}@media (width<=1024px){._msgActions_1d1de_2337,._hasMobileSelection_1d1de_2653 ._standardHeader_1d1de_2580{display:none!important}._hasMobileSelection_1d1de_2653 ._mobileSelectionHeader_1d1de_2587{display:flex!important}._bubbleSelected_1d1de_2661{outline:2px solid var(--color-primary);background-color:var(--color-primary-10)!important}}._root_1tuup_1{height:100%;min-height:0;display:flex}._list_1tuup_7{border-right:1px solid var(--color-border);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;width:340px;min-height:0;display:flex}._listHead_1tuup_17{padding:16px 18px 8px}._title_1tuup_21{border-radius:var(--radius-sm);background-color:var(--color-surface-muted);width:120px;height:24px;margin-bottom:16px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._search_1tuup_30{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:36px;margin:0 14px 16px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._rows_1tuup_38{flex-direction:column;flex:1;padding:6px 0;display:flex}._row_1tuup_38{align-items:center;gap:11px;width:100%;padding:9px 18px;display:flex}._rowAvatar_1tuup_53{background-color:var(--color-surface-muted);border-radius:50%;flex-shrink:0;width:36px;height:36px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._rowBody_1tuup_62{flex-direction:column;flex:1;gap:6px;display:flex}._line_1tuup_69{background-color:var(--color-surface-muted);border-radius:var(--radius-sm);height:12px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._line_1tuup_69._medium_1tuup_76{width:60%}._line_1tuup_69._full_1tuup_80{width:90%}._view_1tuup_84{background-color:var(--color-bg);flex-direction:column;flex:1;display:flex}._viewHead_1tuup_91{background-color:var(--color-surface);border-bottom:1px solid var(--color-border);align-items:center;gap:11px;padding:12px 20px;display:flex}._messages_1tuup_100{flex-direction:column;flex:1;gap:12px;padding:20px;display:flex}._bubbleWrap_1tuup_108{align-items:flex-end;gap:8px;display:flex}._bubbleWrap_1tuup_108._me_1tuup_76{justify-content:flex-end}._bubbleAvatar_1tuup_118{background-color:var(--color-surface-muted);border-radius:50%;width:28px;height:28px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._bubble_1tuup_108{background-color:var(--color-surface-muted);border-radius:14px 14px 14px 4px;width:200px;height:40px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._bubbleWrap_1tuup_108._me_1tuup_76 ._bubble_1tuup_108{border-radius:14px 14px 4px;width:150px}._line_1tuup_69._narrow_1tuup_139{width:30%}._bubble_1tuup_108._wide_1tuup_143{width:250px}@keyframes _pulse_1tuup_1{0%,to{opacity:1}50%{opacity:.5}}@media (width<=768px){._root_1tuup_1{flex-direction:column}._list_1tuup_7{border-right:none;border-bottom:1px solid var(--color-border);width:100%}._view_1tuup_84{display:none}}._screen_hgbdz_1{flex-direction:column;gap:14px;width:100%;padding:24px 32px 48px;display:flex}@media (width<=640px){._screen_hgbdz_1{padding:16px 16px 32px}}._center_hgbdz_15{place-items:center;padding:40px 0;display:grid}._head_hgbdz_21{flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:12px;display:flex}._crumb_hgbdz_29{color:var(--color-text-soft);font-size:11.5px}._title_hgbdz_34{font-size:var(--font-xl);color:var(--color-text);align-items:center;gap:8px;margin:2px 0 0;font-weight:600;display:flex}._subtitle_hgbdz_44{color:var(--color-text-soft);margin:4px 0 0;font-size:13px}._muted_hgbdz_50{color:var(--color-text-soft);font-size:12.5px}._strong_hgbdz_55{color:var(--color-text);font-weight:600}._code_hgbdz_60{color:var(--color-text-mid);font-family:ui-monospace,monospace;font-size:11.5px}._tabs_hgbdz_67{border-bottom:1px solid var(--color-divider);scrollbar-width:none;gap:2px;display:flex;overflow-x:auto}._tabs_hgbdz_67::-webkit-scrollbar{display:none}._tab_hgbdz_67{color:var(--color-text-soft);white-space:nowrap;cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-1px;padding:9px 14px;font-size:12.5px;font-weight:600}._tabActive_hgbdz_93{color:var(--color-primary);border-bottom-color:var(--color-primary)}._filterBar_hgbdz_99{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;display:flex}._pillsContainer_hgbdz_107{flex-direction:column;align-items:flex-start;gap:8px;width:100%;display:flex}._pills_hgbdz_107{border-radius:var(--radius-full);background-color:var(--color-surface-muted);flex-wrap:wrap;gap:4px;width:100%;padding:4px;display:flex}@media (width<=640px){._pills_hgbdz_107{scrollbar-width:none;-ms-overflow-style:none;flex-wrap:nowrap;overflow-x:auto}._pills_hgbdz_107::-webkit-scrollbar{display:none}._pill_hgbdz_107,._pillAdd_hgbdz_142{white-space:nowrap;flex-shrink:0}}._pill_hgbdz_107{color:var(--color-text-soft);border-radius:var(--radius-full);cursor:pointer;background:0 0;border:none;padding:6px 13px;font-size:12px;font-weight:600;transition:color .16s;position:relative}._pill_hgbdz_107:hover{color:var(--color-text)}._pillBg_hgbdz_166{border-radius:var(--radius-full);background-color:var(--color-surface);box-shadow:var(--shadow-sm);position:absolute;inset:0}._pillLabel_hgbdz_174{z-index:1;position:relative}._pillActive_hgbdz_179{color:var(--color-primary)}._pillChipActive_hgbdz_183{background-color:var(--color-primary-10);color:var(--color-primary);border:1px solid var(--color-primary-border)}._select_hgbdz_189,._input_hgbdz_190{height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);width:100%;padding:0 10px;font-family:inherit;font-size:13px}._select_hgbdz_189:focus-visible,._input_hgbdz_190:focus-visible{outline:2px solid var(--color-border-strong);outline-offset:0px;border-color:var(--color-border-strong)}._inputInvalid_hgbdz_209,._inputInvalid_hgbdz_209:focus-visible{border-color:var(--color-danger);outline:none}._fieldError_hgbdz_215{color:var(--color-danger);font-size:11.5px;font-weight:500}._select_hgbdz_189{width:170px;min-width:170px}._kpiRow_hgbdz_227{grid-template-columns:repeat(4,1fr);gap:12px;display:grid}._kpiCard_hgbdz_233{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;gap:4px;padding:14px 16px;display:flex}._kpiIcon_hgbdz_244{border-radius:var(--radius-md);width:30px;height:30px;color:var(--color-on-primary);background-color:var(--kpi-color);justify-content:center;align-items:center;display:inline-flex}._kpiValue_hgbdz_255{font-size:var(--font-xl);color:var(--color-text);font-weight:700}._kpiLabel_hgbdz_261{color:var(--color-text-soft);font-size:11.5px;font-weight:600}._tableWrap_hgbdz_268{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);overflow-x:auto}._table_hgbdz_268{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12.5px}._th_hgbdz_283{text-align:left;text-transform:uppercase;letter-spacing:.03em;color:var(--color-text-soft);background-color:var(--color-surface-muted);border-bottom:1px solid var(--color-border);padding:10px 12px;font-size:11px;font-weight:700}._row_hgbdz_295 td{border-bottom:1px solid var(--color-divider);color:var(--color-text);vertical-align:middle;padding:10px 12px}._row_hgbdz_295:hover td{background-color:var(--color-surface-muted)}._barTrack_hgbdz_306{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:120px;height:6px;overflow:hidden}._barFill_hgbdz_314{height:100%;width:var(--bar);background-color:var(--bar-color);display:block}._barLabel_hgbdz_321{color:var(--color-text-soft);font-size:10.5px}._pillBadge_hgbdz_326{border-radius:var(--radius-full);padding:2px 9px;font-size:10.5px;font-weight:700}._pillOk_hgbdz_333{background-color:var(--color-success-soft);color:var(--color-success)}._pillBad_hgbdz_326{background-color:var(--color-danger-soft);color:var(--color-danger)}._field_hgbdz_215{flex-direction:column;gap:6px;margin-bottom:12px;display:flex}._label_hgbdz_351{color:var(--color-text-mid);font-size:12px;font-weight:600}._req_hgbdz_357{color:var(--color-danger);margin-left:2px}._formGrid_hgbdz_362{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;display:grid}._swatches_hgbdz_368{flex-wrap:wrap;gap:6px;display:flex}._swatch_hgbdz_368{background-color:var(--swatch);cursor:pointer;border:2px solid #0000;border-radius:50%;width:22px;height:22px}._swatchActive_hgbdz_383{border-color:var(--color-text)}._checkbox_hgbdz_387{color:var(--color-text-mid);cursor:pointer;align-items:center;gap:8px;font-size:12.5px;font-weight:600;display:inline-flex}._checkbox_hgbdz_387 input{accent-color:var(--color-primary)}._formFooter_hgbdz_401{justify-content:flex-end;gap:10px;padding-top:6px;display:flex}._editBtn_hgbdz_408,._deleteBtn_hgbdz_409{border-radius:var(--radius-sm);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:28px;display:inline-flex}._editBtn_hgbdz_408{border:1px solid var(--color-primary-20);background-color:var(--color-primary-05);color:var(--color-primary)}._deleteBtn_hgbdz_409{border:1px solid color-mix(in srgb, var(--color-danger) 20%, transparent);background-color:var(--color-danger-soft);color:var(--color-danger)}._prefsWrap_hgbdz_433,._catWrap_hgbdz_434,._promoWrap_hgbdz_435,._tplWrap_hgbdz_436,._guide_hgbdz_437,._retryList_hgbdz_438{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;gap:12px;padding:16px;display:flex}._prefBlock_hgbdz_449{flex-direction:column;gap:6px;display:flex}._prefHeading_hgbdz_455{color:var(--color-text);margin:0 0 4px;font-size:13px;font-weight:700}._prefRow_hgbdz_462,._catRow_hgbdz_463,._promoRow_hgbdz_464{background-color:var(--color-surface);border-bottom:1px solid var(--color-divider);align-items:center;gap:12px;padding:14px 18px;transition:opacity .15s,box-shadow .15s;display:flex}@media (width<=640px){._promoRow_hgbdz_464{border-bottom:1px solid var(--color-divider);background-color:var(--color-surface);grid-template-rows:auto auto;grid-template-columns:auto auto 1fr auto;align-items:center;gap:12px 10px;padding:16px;display:grid}._promoRow_hgbdz_464 ._dragHandle_hgbdz_488{grid-area:1/1}._promoRow_hgbdz_464 ._priorityBadge_hgbdz_492{grid-area:1/2}._promoRow_hgbdz_464 ._prefDot_hgbdz_496{grid-area:1/4;justify-self:end}._promoRow_hgbdz_464 ._promoNameBtn_hgbdz_501{grid-area:1/3;padding-right:4px}._promoRow_hgbdz_464 ._activeCheck_hgbdz_506{border-top:1px dashed var(--color-divider);grid-area:2/1/2/5;align-items:center;margin-top:8px;padding-top:12px;display:flex}._promoRow_hgbdz_464 ._editBtn_hgbdz_408{z-index:2;grid-area:2/1/2/5;justify-self:end;margin-top:8px;margin-right:36px}._promoRow_hgbdz_464 ._deleteBtn_hgbdz_409{z-index:2;grid-area:2/1/2/5;justify-self:end;margin-top:8px}}._promoRowDragging_hgbdz_531{opacity:.5}._promoRowDragOver_hgbdz_535{box-shadow:inset 0 2px 0 0 var(--color-primary)}._prefDot_hgbdz_496{background-color:var(--dot);border-radius:50%;flex-shrink:0;width:10px;height:10px}._dragHandle_hgbdz_488{color:var(--color-text-very-soft);cursor:grab;flex-shrink:0;align-items:center;display:inline-flex}._dragHandle_hgbdz_488:active{cursor:grabbing}._dragHandleOff_hgbdz_559{color:var(--color-border-strong);cursor:not-allowed}._prefName_hgbdz_564,._catLabel_hgbdz_565{color:var(--color-text);flex:1;font-size:13px;font-weight:600}._prefBtns_hgbdz_572{gap:4px;display:flex}._prefBtn_hgbdz_572{border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-soft);border-radius:var(--radius-md);cursor:pointer;padding:5px 10px;font-size:11.5px;font-weight:600}._prefBtnActive_hgbdz_588{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._catActions_hgbdz_595{justify-content:flex-end;display:flex}._catHead_hgbdz_600{justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:4px;display:flex}@media (width<=640px){._catHead_hgbdz_600{flex-direction:column;align-items:stretch;gap:12px}}._webhookFilterBar_hgbdz_616{justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1rem;display:flex}@media (width<=640px){._webhookFilterBar_hgbdz_616{flex-direction:column;align-items:stretch;gap:12px}._webhookFilterBar_hgbdz_616>button{justify-content:center;width:100%}}._catHeadDesc_hgbdz_636{max-width:62ch;color:var(--color-text-soft);margin:0;font-size:13px;line-height:1.5}._catList_hgbdz_644{flex-direction:column;display:flex}._catKey_hgbdz_649{color:var(--color-text-soft);border-radius:var(--radius-sm);background-color:var(--color-surface-muted);padding:2px 6px;font-family:ui-monospace,monospace;font-size:11px}._promoList_hgbdz_659{border:1px solid var(--color-border);background-color:var(--color-surface);border-radius:12px;flex-direction:column;display:flex;overflow:hidden}._promoList_hgbdz_659>div:last-child>._promoRow_hgbdz_464{border-bottom:none}._promoRowOff_hgbdz_672{opacity:.6}._reorder_hgbdz_676{flex-direction:column;display:flex}._reorderBtn_hgbdz_681{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;padding:0;line-height:1}._priorityBadge_hgbdz_492{background-color:var(--cat-tint);width:24px;height:24px;color:var(--cat);border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;font-size:11px;font-weight:800;display:inline-flex}._priorityBadgeOff_hgbdz_704{background-color:var(--color-surface-muted);color:var(--color-text-very-soft)}._activeCheck_hgbdz_506{color:var(--color-text-soft);cursor:pointer;flex-shrink:0;align-items:center;gap:6px;font-size:11.5px;display:inline-flex}._activeCheck_hgbdz_506 input{width:15px;height:15px;accent-color:var(--color-primary);cursor:pointer}._tplHint_hgbdz_726{color:var(--color-text-soft);margin:0;font-size:12px}._tplEditLayout_hgbdz_732{grid-template-columns:1fr minmax(280px,360px);align-items:start;gap:20px;display:grid}._tplEditForm_hgbdz_739{flex-direction:column;display:flex}._tplEditPreview_hgbdz_744{flex-direction:column;gap:12px;display:flex;position:sticky;top:12px}._tplLiveHead_hgbdz_752{letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);align-items:center;gap:7px;font-size:11px;font-weight:700;display:inline-flex}._tplMirrorHead_hgbdz_764{border-top:1px dashed var(--color-divider);letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);align-items:center;gap:7px;margin-top:10px;padding-top:14px;font-size:11px;font-weight:700;display:inline-flex}._tplLiveDot_hgbdz_778{background-color:var(--color-success);border-radius:50%;width:8px;height:8px;animation:1.6s ease-in-out infinite _tplPulse_hgbdz_1}@keyframes _tplPulse_hgbdz_1{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.8)}}@media (prefers-reduced-motion:reduce){._tplLiveDot_hgbdz_778{animation:none}}@media (width<=860px){._tplEditLayout_hgbdz_732{grid-template-columns:1fr}}._promoNameBtn_hgbdz_501{cursor:pointer;text-align:left;background:0 0;border:none;flex-direction:column;flex:1;align-items:flex-start;gap:3px;min-width:0;padding:0;display:flex}._promoNameTop_hgbdz_826{color:var(--color-text-very-soft);align-items:center;gap:6px;display:inline-flex}._promoName_hgbdz_501{color:var(--color-text);font-size:14px;font-weight:600}._promoNameOff_hgbdz_839{color:var(--color-text-soft);text-decoration:line-through}._promoNameMeta_hgbdz_844{align-items:center;gap:8px;display:inline-flex}@media (width<=640px){._promoNameMeta_hgbdz_844{flex-direction:column;align-items:flex-start;gap:4px}}._tplBadge_hgbdz_858{background-color:var(--color-primary-10);color:var(--color-primary);border-radius:4px;padding:1px 6px;font-size:10.5px;font-weight:600}._catCount_hgbdz_867{color:var(--color-text-soft);font-size:11px}._campaignBox_hgbdz_872{background-color:var(--color-bg);border-bottom:1px solid var(--color-divider);flex-direction:column;gap:10px;padding:14px 18px 16px 56px;display:flex}._promoList_hgbdz_659>div:last-child>._campaignBox_hgbdz_872{border-bottom:none}._campaignHead_hgbdz_885{justify-content:space-between;align-items:center;gap:12px;display:flex}._campaignHeadTitle_hgbdz_892{letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);align-items:center;gap:8px;font-size:11px;font-weight:700;display:inline-flex}._campaignCount_hgbdz_903{border-radius:var(--radius-full);background-color:var(--color-surface-muted);min-width:20px;height:18px;color:var(--color-text-mid);letter-spacing:0;justify-content:center;align-items:center;padding:0 6px;font-size:11px;font-weight:700;display:inline-flex}._campaignList_hgbdz_918{flex-direction:column;gap:6px;display:flex}._seeAll_hgbdz_924{color:var(--color-primary);cursor:pointer;background:0 0;border:none;align-self:flex-start;padding:4px 2px;font-size:12px;font-weight:600}._seeAll_hgbdz_924:hover{text-decoration:underline}._cpTop_hgbdz_940{z-index:1;background-color:var(--color-surface);border-bottom:1px solid var(--color-divider);flex-direction:column;gap:12px;padding:20px 22px 14px;display:flex;position:sticky;top:0}._cpHead_hgbdz_952{justify-content:space-between;align-items:baseline;gap:12px;display:flex}._cpTitle_hgbdz_959{font-size:var(--font-lg);color:var(--color-text);margin:0;font-weight:700}._cpCount_hgbdz_966{color:var(--color-text-soft);flex-shrink:0;font-size:12px;font-weight:600}._cpSearch_hgbdz_973{align-items:center;display:flex;position:relative}._cpSearchIcon_hgbdz_979{color:var(--color-text-soft);position:absolute;left:10px}._cpSearchInput_hgbdz_985{border:1px solid var(--color-border);border-radius:var(--radius-md);background-color:var(--color-bg);width:100%;color:var(--color-text);padding:8px 12px 8px 30px;font-size:13px}._cpList_hgbdz_995{flex-direction:column;gap:8px;padding:14px 22px 18px;display:flex}._cpFooter_hgbdz_1002{border-top:1px solid var(--color-divider);background-color:var(--color-surface);padding:14px 22px}._cpFooter_hgbdz_1002 button{justify-content:center;width:100%}._campaignEmpty_hgbdz_1013{border:1px dashed var(--color-border);border-radius:var(--radius-md);color:var(--color-text-soft);background-color:var(--color-surface);margin:0;padding:12px 14px;font-size:12px}._campaignRow_hgbdz_1023{border-radius:var(--radius-md);border:1px solid var(--color-border);border-left:3px solid var(--cat);background-color:var(--color-surface);align-items:center;gap:10px;padding:8px 12px;display:flex}._campaignText_hgbdz_1034{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}._campaignTitle_hgbdz_1042{color:var(--color-text);font-size:12.5px;font-weight:600}._campaignSub_hgbdz_1048{color:var(--color-text-soft);font-size:11px}._campaignMeta_hgbdz_1053{flex-wrap:wrap;gap:6px;margin-top:6px;display:flex}._campaignChip_hgbdz_1060{border-radius:var(--radius-full);background-color:var(--color-surface-muted);color:var(--color-text);align-items:center;gap:5px;padding:2px 8px;font-size:11px;font-weight:600;display:inline-flex}._campaignChipLabel_hgbdz_1072{color:var(--color-text-soft);font-weight:600}._campaignAmount_hgbdz_1077{color:var(--color-secondary);font-size:12px;font-weight:700}._campaignBadge_hgbdz_1083{border-radius:var(--radius-full);background-color:var(--color-surface-muted);color:var(--color-text-mid);padding:2px 8px;font-size:10.5px;font-weight:700}._promoPreview_hgbdz_1092{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-md);flex-direction:column;flex-shrink:0;gap:8px;max-width:420px;padding:20px 18px 16px;display:flex;position:relative;overflow:hidden}._promoCard_hgbdz_1110{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);flex-shrink:0;position:relative;overflow:hidden}._promoCardHeader_hgbdz_1119{background-color:color-mix(in srgb, var(--cat) 3.1%, transparent);border-bottom:1px solid color-mix(in srgb, var(--cat) 8.2%, transparent);justify-content:space-between;align-items:center;padding:10px 12px;display:flex}._promoCardStatus_hgbdz_1128{letter-spacing:.06em;text-transform:uppercase;color:var(--cat);align-items:center;gap:7px;font-size:9px;font-weight:700;display:inline-flex}._promoCardHeading_hgbdz_1139{color:var(--color-text);margin:0;font-size:15px;font-weight:700;line-height:1.25}._promoCardBody_hgbdz_1147{flex-direction:column;gap:4px;padding:8px 10px;display:flex}._promoItem_hgbdz_1154{border-radius:var(--radius-sm);background-color:var(--color-bg);border:1px solid var(--color-border);justify-content:space-between;align-items:flex-start;gap:8px;padding:8px 10px;display:flex}._promoItemText_hgbdz_1165{flex-direction:column;flex:1;align-items:flex-start;gap:2px;min-width:0;display:flex}._promoItemTitle_hgbdz_1174{color:var(--color-text);text-overflow:ellipsis;white-space:nowrap;width:100%;font-size:12.5px;font-weight:600;overflow:hidden}._promoItemSub_hgbdz_1184{color:var(--color-text-soft);white-space:pre-wrap;width:100%;font-size:11px}._promoItemDate_hgbdz_1191{color:var(--color-text-very-soft);text-overflow:ellipsis;white-space:nowrap;width:100%;font-size:11px;overflow:hidden}._promoItemBadge_hgbdz_1200{background-color:color-mix(in srgb, var(--cat) 7%, transparent);color:var(--cat);border-radius:6px;padding:2px 6px;font-size:9px;font-weight:700}._promoItemAmount_hgbdz_1209{background-color:color-mix(in srgb, var(--cat) 7%, transparent);color:var(--cat);border-radius:6px;flex-shrink:0;padding:2px 6px;font-size:9px;font-weight:700}._promoViewAll_hgbdz_1219{border-radius:var(--radius-sm);border:1px solid color-mix(in srgb, var(--cat) 12.5%, transparent);width:100%;color:var(--cat);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;text-align:center;background-color:#0000;margin-top:2px;padding:7px 8px;font-size:11px;font-weight:600;overflow:hidden}._promoPreview_hgbdz_1092:before{content:"";background:linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));height:4px;position:absolute;inset:0 0 auto}._promoStatus_hgbdz_1249{letter-spacing:.04em;color:var(--accent);font-size:10.5px;font-weight:800}._promoHeader_hgbdz_1256{font-size:var(--font-md);color:var(--color-text);margin:0;font-weight:700}._promoCardInner_hgbdz_1263{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:4px;padding:12px;display:flex}._promoCardTitle_hgbdz_1273{color:var(--color-text);font-weight:700}._promoCardSub_hgbdz_1278,._promoDate_hgbdz_1279{color:var(--color-text-soft);font-size:12px}._promoCardFoot_hgbdz_1284{justify-content:space-between;align-items:center;margin-top:4px;display:flex}._promoBadge_hgbdz_1291{border-radius:var(--radius-full);background-color:color-mix(in srgb, var(--accent) 12%, transparent);color:var(--accent);padding:2px 9px;font-size:10.5px;font-weight:700}._promoAmount_hgbdz_1300{color:var(--color-secondary);font-weight:800}._promoCta_hgbdz_1305{color:var(--accent);font-size:12px;font-weight:700}._tplLayout_hgbdz_1312{grid-template-columns:240px 1fr;align-items:start;gap:14px;width:100%;min-width:0;display:grid}._tplList_hgbdz_1321{flex-direction:column;gap:6px;min-width:0;display:flex}._tplItem_hgbdz_1328{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);cursor:pointer;text-align:left;align-items:center;gap:10px;min-width:0;padding:10px 12px;display:flex}._tplItemActive_hgbdz_1341{border-color:var(--color-primary-border);background-color:var(--color-primary-05)}._tplDot_hgbdz_1346{background-color:var(--dot);border-radius:50%;flex-shrink:0;width:12px;height:12px}._tplItemText_hgbdz_1354{flex-direction:column;min-width:0;display:flex;overflow:hidden}._tplItemName_hgbdz_1361{color:var(--color-text);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;overflow:hidden}._tplItemMeta_hgbdz_1370{color:var(--color-text-soft);font-size:10.5px}._editorPane_hgbdz_1375{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;gap:10px;width:100%;min-width:0;padding:16px;display:flex}._editorName_hgbdz_1388{height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);color:var(--color-text);font-size:var(--font-md);width:100%;min-width:0;padding:0 10px;font-weight:700}._editorMeta_hgbdz_1401{flex-wrap:wrap;align-items:center;gap:14px;display:flex}._editorMetaCard_hgbdz_1408{flex-direction:column;gap:10px;width:100%;min-width:0;display:flex}._editorMetaCard_hgbdz_1408 ._input_hgbdz_190{width:100%;min-width:0}._iconPicker_hgbdz_1422{flex-wrap:wrap;gap:6px;display:flex}._iconChoice_hgbdz_1428{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:32px;height:32px;color:var(--color-text-soft);cursor:pointer;justify-content:center;align-items:center;display:inline-flex}._iconChoice_hgbdz_1428:hover{border-color:var(--color-border-strong);color:var(--color-text-mid)}._iconChoiceActive_hgbdz_1446{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._intGuide_hgbdz_1453{border-top:1px dashed var(--color-border);margin-top:2px;padding-top:10px}._intToggle_hgbdz_1459{color:var(--color-primary);cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;padding:0;font-size:12.5px;font-weight:600;display:inline-flex}._intChevron_hgbdz_1472{transition:transform .15s}._intChevronOpen_hgbdz_1476{transform:rotate(180deg)}._intSteps_hgbdz_1480{flex-direction:column;gap:14px;margin:12px 0 0;padding:0;list-style:none;display:flex}._intStep_hgbdz_1480{gap:10px;display:flex}._intNum_hgbdz_1494{background-color:var(--color-primary-10);width:22px;height:22px;color:var(--color-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:11px;font-weight:700;display:inline-flex}._intStepBody_hgbdz_1508{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}._intStepTitle_hgbdz_1516{color:var(--color-text);font-size:12.5px;font-weight:700}._intText_hgbdz_1522{color:var(--color-text-soft);margin:0;font-size:12px;line-height:1.5}._intText_hgbdz_1522 code{background-color:var(--color-surface-muted);border-radius:var(--radius-sm);color:var(--color-text-mid);padding:1px 5px;font-family:ui-monospace,monospace;font-size:11px}._intIntro_hgbdz_1538{color:var(--color-text-soft);margin:12px 0 0;font-size:12px;line-height:1.5}._intList_hgbdz_1545{border-left:2px solid var(--color-border);color:var(--color-text-soft);flex-direction:column;gap:6px;margin:4px 0 0;padding:2px 0 2px 12px;font-size:12px;line-height:1.5;list-style:none;display:flex}._intOl_hgbdz_1558{color:var(--color-text-soft);flex-direction:column;gap:4px;margin:4px 0 0;padding-left:20px;font-size:12px;line-height:1.5;list-style:decimal;display:flex}._intList_hgbdz_1545 code,._intOl_hgbdz_1558 code{background-color:var(--color-surface-muted);border-radius:var(--radius-sm);color:var(--color-text-mid);padding:1px 5px;font-family:ui-monospace,monospace;font-size:11px}._registry_hgbdz_1581{flex-direction:column;gap:14px;display:flex}._regStats_hgbdz_1587{grid-template-columns:repeat(3,1fr);gap:12px;display:grid}._regList_hgbdz_1593{flex-direction:column;gap:8px;display:flex}._regRow_hgbdz_1599{text-align:left;border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);width:100%;box-shadow:var(--shadow-sm);cursor:pointer;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}._regRow_hgbdz_1599:hover{border-color:var(--color-border-strong)}._regRowMain_hgbdz_1618{flex-direction:column;gap:3px;min-width:0;display:flex}._regRowName_hgbdz_1625{color:var(--color-text);font-size:13px;font-weight:600}._regRowMeta_hgbdz_1631{color:var(--color-text-soft);font-size:11.5px}._regRowEnd_hgbdz_1636{flex-shrink:0;align-items:center;gap:10px;display:flex}._regRate_hgbdz_1643{color:var(--color-text-mid);font-size:12px;font-weight:600}._regDetail_hgbdz_1649{flex-direction:column;gap:14px;width:100%;padding:20px;display:flex}._regDetailHead_hgbdz_1657{align-items:center;gap:10px;display:flex}._regDetailTitle_hgbdz_1663{font-size:var(--font-md);color:var(--color-text);font-weight:700}._feedEmpty_hgbdz_1670{border-radius:var(--radius-md);border:1px dashed var(--color-border-strong);color:var(--color-text-soft);align-items:center;gap:12px;padding:14px;display:flex}._feedEmptyText_hgbdz_1680{flex:1;min-width:0}._feedEmptyTitle_hgbdz_1685{color:var(--color-text);margin:0 0 2px;font-size:13px;font-weight:600}._feedHead_hgbdz_1692{justify-content:space-between;align-items:center;gap:10px;display:flex}._feedTitle_hgbdz_1699{color:var(--color-text);align-items:center;gap:6px;font-size:13px;font-weight:600;display:inline-flex}._feedMeta_hgbdz_1708{flex-wrap:wrap;gap:4px 16px;display:flex}._feedActions_hgbdz_1714{justify-content:flex-end;gap:8px;display:flex}._tplPreview_hgbdz_1721{border-radius:var(--radius-lg);border:1px solid var(--color-border);background:linear-gradient(180deg, var(--color-surface-muted), var(--color-surface));flex-direction:column;gap:6px;padding:14px;display:flex}._tplPreviewLabel_hgbdz_1731{text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-soft);font-size:10.5px;font-weight:700}._tplPreviewCard_hgbdz_1739{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);align-items:center;gap:12px;width:100%;min-width:0;padding:10px 12px;display:flex}._tplPreviewAvatar_hgbdz_1752{border-radius:var(--radius-md);width:38px;height:38px;color:var(--color-on-primary);background-color:var(--accent);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._tplPreviewText_hgbdz_1764{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._tplPreviewTitleRow_hgbdz_1772{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;display:flex}._tplPreviewTitle_hgbdz_1772{font-size:var(--font-md);color:var(--color-text);word-break:break-word;overflow-wrap:anywhere;min-width:0;font-weight:700}._tplPreviewPill_hgbdz_1789{border-radius:var(--radius-full);color:var(--accent);background-color:color-mix(in srgb, var(--accent) 14%, transparent);padding:2px 9px;font-size:10.5px;font-weight:700}._tplPreviewSub_hgbdz_1798{color:var(--color-text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}._fieldsHead_hgbdz_1806{justify-content:space-between;align-items:center;margin-top:6px;display:flex}._fieldList_hgbdz_1813{flex-direction:column;gap:8px;display:flex}._fieldCard_hgbdz_1819{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:8px;padding:10px 12px;display:flex}._fieldCardMain_hgbdz_1829{grid-template-columns:auto 1fr 132px auto auto;align-items:center;gap:8px;display:grid}._fieldLabelInput_hgbdz_1836{border-radius:var(--radius-sm);border:1px solid var(--color-border);background-color:var(--color-surface);height:32px;color:var(--color-text);width:100%;padding:0 10px;font-family:inherit;font-size:13px;font-weight:600}._fieldTypeSelect_hgbdz_1849{border-radius:var(--radius-sm);border:1px solid var(--color-border);background-color:var(--color-surface);height:32px;color:var(--color-text-mid);width:100%;padding:0 8px;font-family:inherit;font-size:12px}._fieldKeyRow_hgbdz_1861{align-items:center;gap:8px;padding-left:30px;display:flex}._fieldKeyLabel_hgbdz_1868{color:var(--color-text-soft);flex-shrink:0;font-size:11px;font-weight:600}._fieldKeyInput_hgbdz_1875{border-radius:var(--radius-sm);border:1px solid var(--color-border);background-color:var(--color-surface-muted);height:28px;color:var(--color-text-mid);flex:1;padding:0 8px;font-family:ui-monospace,monospace;font-size:11.5px}._iconToggle_hgbdz_1887{border-radius:var(--radius-sm);border:1px solid var(--color-border);background-color:var(--color-surface);width:28px;height:28px;color:var(--color-text-soft);cursor:pointer;justify-content:center;align-items:center;display:inline-flex}._iconToggleOn_hgbdz_1900{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._webhookBox_hgbdz_1906{border-radius:var(--radius-md);border:1px dashed var(--color-border-strong);flex-direction:column;gap:10px;width:100%;min-width:0;margin-top:8px;padding:12px;display:flex}._schema_hgbdz_1919{border-radius:var(--radius-md);background-color:var(--color-surface-muted);color:var(--color-text);white-space:pre;margin:0;padding:12px;font-family:ui-monospace,monospace;font-size:11.5px;overflow-x:auto}._retryItem_hgbdz_1931{border-radius:var(--radius-md);border:1px solid var(--color-border);justify-content:space-between;align-items:center;gap:12px;padding:12px;display:flex}._retryInfo_hgbdz_1941{flex-direction:column;gap:2px;display:flex}._retryError_hgbdz_1947{color:var(--color-danger);font-size:11.5px}._retryActions_hgbdz_1952{flex-shrink:0;gap:8px;display:flex}._tplGrid_hgbdz_1958{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;display:grid}._tplCard_hgbdz_1964{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;align-items:flex-start;gap:8px;padding:14px;display:flex}._tplCardHead_hgbdz_1976{justify-content:space-between;align-items:center;width:100%;display:flex}._tplCat_hgbdz_1983{color:var(--color-primary);background-color:var(--color-primary-10);border-radius:var(--radius-full);padding:2px 8px;font-size:10.5px;font-weight:700}@media (width<=1024px){._kpiRow_hgbdz_227{grid-template-columns:repeat(2,1fr)}._tplLayout_hgbdz_1312{grid-template-columns:1fr}._fieldRow_hgbdz_2001{grid-template-columns:auto 1fr auto auto}}@media (width<=768px){._kpiRow_hgbdz_227{grid-template-columns:1fr}}@media (width<=480px){._feedEmpty_hgbdz_1670{flex-direction:column;align-items:flex-start;gap:12px;padding:16px}._feedEmptyText_hgbdz_1680{width:100%}}._tplSidebar_hgbdz_2026{flex-direction:column;gap:10px;display:flex}._tplLock_hgbdz_2032{color:var(--color-text-soft);vertical-align:-1px;margin-left:6px}._lockBadge_hgbdz_2038{border-radius:var(--radius-full);background-color:var(--color-primary-10);color:var(--color-primary);letter-spacing:.04em;text-transform:uppercase;align-self:flex-start;align-items:center;padding:2px 8px;font-size:9.5px;font-weight:700;display:inline-flex}._footerBtns_hgbdz_2052{align-items:center;gap:8px;margin-left:auto;display:flex}._copyRow_hgbdz_2059{align-items:stretch;gap:6px;display:flex}._copyRow_hgbdz_2059 ._input_hgbdz_190{flex:1;min-width:0}._copyBtn_hgbdz_2070{border:1px solid var(--color-border);border-radius:var(--radius-md);background-color:var(--color-surface);width:34px;color:var(--color-text-mid);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .15s,color .15s;display:flex}._copyBtn_hgbdz_2070:hover{background-color:var(--color-primary-05);color:var(--color-primary);border-color:var(--color-primary-border)}._webhookFoot_hgbdz_2092{justify-content:space-between;align-items:center;gap:10px;margin-top:4px;display:flex}._testBtn_hgbdz_2100{border-radius:var(--radius-md);border:1px solid var(--color-primary-border);background-color:var(--color-primary-05);color:var(--color-primary);cursor:pointer;align-items:center;gap:6px;padding:6px 12px;font-size:11.5px;font-weight:600;display:inline-flex}._testBtn_hgbdz_2100:hover{background-color:var(--color-primary-10)}._fieldRef_hgbdz_2119{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-bg);margin-top:6px;overflow:hidden}._fieldRefHead_hgbdz_2127{border-bottom:1px solid var(--color-divider);letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-mid);align-items:center;gap:7px;padding:10px 12px;font-size:11px;font-weight:700;display:flex}._fieldRefHead_hgbdz_2127 svg{color:var(--color-primary)}._fieldRefHint_hgbdz_2144{letter-spacing:0;text-transform:none;color:var(--color-text-soft);margin-left:auto;font-size:10.5px;font-weight:500}._fieldRefList_hgbdz_2153{flex-direction:column;display:flex}._fieldRefItem_hgbdz_2158{border:none;border-top:1px solid var(--color-divider);text-align:left;cursor:pointer;background:0 0;align-items:baseline;gap:10px;padding:8px 12px;transition:background-color .12s;display:flex}._fieldRefItem_hgbdz_2158:first-child{border-top:none}._fieldRefItem_hgbdz_2158:hover{background-color:var(--color-primary-05)}._fieldRefToken_hgbdz_2179{color:var(--color-primary);background-color:var(--color-primary-10);border-radius:var(--radius-sm);white-space:nowrap;flex-shrink:0;padding:2px 7px;font-family:ui-monospace,monospace;font-size:11.5px;font-weight:600}._fieldRefDesc_hgbdz_2191{color:var(--color-text-soft);font-size:11.5px;line-height:1.4}._tokenWarn_hgbdz_2197{border-radius:var(--radius-md);background-color:var(--color-secondary-10);border:1px solid var(--color-secondary-border);color:var(--color-secondary-strong);align-items:flex-start;gap:7px;margin-top:10px;padding:9px 11px;font-size:11.5px;line-height:1.45;display:flex}._tokenWarn_hgbdz_2197 svg{flex-shrink:0;margin-top:1px}._tplEditMain_hgbdz_2217{flex-direction:column;gap:10px;display:flex}._tplEditSide_hgbdz_2223{flex-direction:column;gap:14px;display:flex}._tplEditWrap_hgbdz_2230{flex-direction:column;gap:6px;display:flex}._tplEditBar_hgbdz_2236{border-top:1px solid var(--color-divider);align-items:center;gap:12px;margin-top:8px;padding-top:14px;display:flex}._tplBarSpacer_hgbdz_2245{flex:1}@media (width<=640px){._tplEditBar_hgbdz_2236{flex-wrap:wrap;gap:8px}._tplBarSpacer_hgbdz_2245{flex-basis:100%;height:0;margin:0}._tplBarSpacer_hgbdz_2245+span{margin-left:auto}}._pillAdd_hgbdz_142{border:1px dashed var(--color-border-strong);color:var(--color-text-soft);border-radius:var(--radius-full);cursor:pointer;background:0 0;align-self:flex-end;align-items:center;gap:4px;padding:5px 12px;font-size:12px;font-weight:600;transition:color .16s,border-color .16s;display:inline-flex}._pillAdd_hgbdz_142:hover{color:var(--color-primary);border-color:var(--color-primary-border)}._tcFieldsHead_hgbdz_2291{justify-content:space-between;align-items:baseline;gap:10px;margin-top:6px;margin-bottom:6px;display:flex}._tcRows_hgbdz_2300{flex-direction:column;gap:10px;display:flex}._tcCard_hgbdz_2307{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:7px;padding:11px 12px;display:flex}._tcCardTop_hgbdz_2317{align-items:center;gap:8px;display:flex}._tcGrow_hgbdz_2323{min-width:0;height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);flex:1;padding:0 10px;font-family:inherit;font-size:13px;font-weight:600}._tcType_hgbdz_2337{height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);cursor:pointer;flex-shrink:0;padding:0 8px;font-family:inherit;font-size:12px}._tcToken_hgbdz_2350{border-radius:var(--radius-sm);background-color:var(--color-primary-10);max-width:100%;color:var(--color-primary);text-overflow:ellipsis;white-space:nowrap;align-self:flex-start;padding:2px 7px;font-family:ui-monospace,monospace;font-size:10.5px;overflow:hidden}._currencyWrap_hgbdz_2365{align-items:center;gap:6px;padding:0 10px;display:flex}._currencyPrefix_hgbdz_2372{color:var(--color-text-soft);flex-shrink:0;font-weight:700}._currencyInput_hgbdz_2378{min-width:0;height:100%;color:var(--color-text);background:0 0;border:none;flex:1;font-family:inherit;font-size:13px}._currencyInput_hgbdz_2378:focus-visible{outline:none}._tokenRead_hgbdz_2394{cursor:text;border-radius:var(--radius-sm);outline-offset:2px;white-space:pre-wrap;word-break:break-word;outline:2px solid #0000;min-height:1.3em;transition:outline-color .12s,background-color .12s;display:block}._tokenRead_hgbdz_2394:hover{background-color:color-mix(in srgb, var(--accent) 6%, transparent)}._tokenRead_hgbdz_2394:focus-visible{outline-color:var(--accent)}._tokenReadOver_hgbdz_2416{outline-color:var(--accent);background-color:color-mix(in srgb, var(--accent) 12%, transparent)}._tokenReadStatic_hgbdz_2422{cursor:default}._tokenReadStatic_hgbdz_2422:hover{background-color:#0000}._tokenInput_hgbdz_2430{border-radius:var(--radius-sm);background-color:color-mix(in srgb, var(--accent) 8%, transparent);outline:1px solid var(--accent);border:none;width:100%;padding:0 2px;font-family:inherit;display:block}._tokenPlaceholder_hgbdz_2441{color:var(--color-text-very-soft);font-style:italic}._tokenChip_hgbdz_2446{border-radius:var(--radius-full);background-color:color-mix(in srgb, var(--accent) 14%, transparent);color:var(--accent);border:1px solid color-mix(in srgb, var(--accent) 30%, transparent);white-space:nowrap;align-items:center;gap:3px;margin:0 1px;padding:1px 4px 1px 7px;font-family:ui-monospace,monospace;font-size:10.5px;font-weight:700;display:inline-flex}._tokenChipBad_hgbdz_2462{background-color:var(--color-danger-soft);color:var(--color-danger);border-color:color-mix(in srgb, var(--color-danger) 30%, transparent)}._tokenChipX_hgbdz_2468{background-color:color-mix(in srgb, currentColor 15%, transparent);width:14px;height:14px;color:inherit;cursor:pointer;opacity:1;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;margin-left:2px;padding:0;display:inline-flex}._tokenChipX_hgbdz_2468 svg{stroke:currentColor;width:9px;height:9px;display:block}._tokenChipX_hgbdz_2468:hover{background-color:color-mix(in srgb, currentColor 30%, transparent)}._palette_hgbdz_2497{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:12px;padding:14px;display:flex}._paletteGroup_hgbdz_2507{flex-direction:column;gap:7px;display:flex}._paletteGroupLabel_hgbdz_2513{letter-spacing:.08em;text-transform:uppercase;color:var(--color-text-soft);font-size:9.5px;font-weight:700}._paletteChips_hgbdz_2521{flex-direction:column;gap:5px;display:flex}._paletteChipWrap_hgbdz_2527{display:block}._paletteChipWrap_hgbdz_2527>._paletteChip_hgbdz_2521{width:100%}._paletteChip_hgbdz_2521{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);cursor:grab;text-align:left;align-items:center;gap:8px;padding:7px 9px;transition:border-color .12s,box-shadow .12s;display:flex}._paletteChip_hgbdz_2521:hover{border-color:var(--color-primary-border);box-shadow:var(--shadow-sm)}._paletteChip_hgbdz_2521:active{cursor:grabbing}._paletteGrip_hgbdz_2559{color:var(--color-text-very-soft);flex-shrink:0}._paletteToken_hgbdz_2564{border-radius:var(--radius-sm);background-color:var(--color-primary-10);color:var(--color-primary);flex-shrink:0;padding:2px 7px;font-family:ui-monospace,monospace;font-size:11px;font-weight:700}._paletteDesc_hgbdz_2575{color:var(--color-text-soft);font-size:11px;line-height:1.35}._paletteHint_hgbdz_2581{font-size:var(--font-xs);color:var(--color-text-soft);margin:2px 0 0}._simMemberRow_hgbdz_2588{align-items:center;gap:8px;margin-bottom:6px;display:flex}._simMemberRemove_hgbdz_2595{border:1px solid var(--color-border);background:var(--color-surface);width:34px;height:34px;color:var(--color-danger,#dc2626);cursor:pointer;border-radius:8px;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._signatureContainer_hgbdz_2610{margin-top:12px;margin-bottom:12px;padding:8px 0}._signatureLabel_hgbdz_2616{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:12px;display:flex}._signatureCheckbox_hgbdz_2624{width:18px;height:18px;accent-color:var(--color-primary);cursor:pointer;flex-shrink:0;margin:0}._signatureText_hgbdz_2633{flex-direction:column;gap:2px;display:flex}._signatureTitle_hgbdz_2639{color:var(--color-text);font-size:14px;font-weight:600;line-height:1.25}._signatureDesc_hgbdz_2646{color:var(--color-text-soft);font-size:12px}._overlay_1agsz_5{z-index:200;pointer-events:none;position:fixed;inset:0}._card_1agsz_12{pointer-events:auto;border-radius:var(--radius-xl,22px);background-color:var(--color-surface);border:1px solid var(--color-border);width:min(340px,100vw - 40px);box-shadow:var(--shadow-lg);flex-direction:column;gap:14px;padding:16px 18px;display:flex;position:absolute;bottom:20px;left:20px}._draggable_1agsz_30{cursor:grab;touch-action:none}._draggable_1agsz_30:active{cursor:grabbing}._head_1agsz_40{align-items:center;gap:14px;display:flex}._info_1agsz_46{flex-direction:column;gap:2px;min-width:0;display:flex}._avatarRing_1agsz_53{border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:56px;height:56px;display:flex;position:relative}._avatarRingPulse_1agsz_65:before,._avatarRingPulse_1agsz_65:after{content:"";border:2px solid var(--avatar-color,var(--color-primary));opacity:0;border-radius:50%;animation:2s cubic-bezier(.4,0,.2,1) infinite _callPulse_1agsz_1;position:absolute;inset:0}._avatarRingPulse_1agsz_65:after{animation-delay:1s}@keyframes _callPulse_1agsz_1{0%{opacity:.6;transform:scale(.9)}to{opacity:0;transform:scale(1.5)}}._avatar_1agsz_53{background-color:var(--avatar-color,var(--color-primary));color:#fff;letter-spacing:.02em;z-index:1;border-radius:50%;justify-content:center;align-items:center;width:52px;height:52px;font-size:19px;font-weight:700;display:flex;box-shadow:0 4px 14px #0000002e}._name_1agsz_107{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:16px;font-weight:700;line-height:1.25;overflow:hidden}._status_1agsz_117{color:var(--color-text-soft);font-size:13px;font-weight:500}._timer_1agsz_123{font-variant-numeric:tabular-nums;color:var(--color-text-mid);font-size:14px;font-weight:600}._actions_1agsz_130{justify-content:flex-end;align-items:center;gap:14px;display:flex}._btn_1agsz_137{cursor:pointer;color:#fff;width:46px;height:46px;transition:transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:none;border-radius:50%;justify-content:center;align-items:center;display:flex;box-shadow:0 6px 16px #0000002e}._btn_1agsz_137:hover{transform:translateY(-2px)scale(1.04);box-shadow:0 10px 22px #00000038}._btn_1agsz_137:active{transform:scale(.95)}._accept_1agsz_163{background-color:var(--color-success,#16a34a);animation:1.4s ease-in-out infinite _acceptBob_1agsz_1}@keyframes _acceptBob_1agsz_1{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}._decline_1agsz_178{background-color:var(--color-danger,#dc2626)}._mute_1agsz_182{background-color:var(--color-surface-muted);width:42px;height:42px;color:var(--color-text-mid);border:1px solid var(--color-border);box-shadow:none}._muteOn_1agsz_191{background-color:var(--color-text);color:var(--color-surface);border-color:var(--color-text)}@media (prefers-reduced-motion:reduce){._avatarRingPulse_1agsz_65:before,._avatarRingPulse_1agsz_65:after,._accept_1agsz_163{animation:none}}._popped_1agsz_208{pointer-events:auto;position:static}._popped_1agsz_208 ._card_1agsz_12{width:auto;height:100vh;box-shadow:none;border:none;border-radius:0;justify-content:center;position:static}._popOut_1agsz_224{width:28px;height:28px;color:var(--color-text-muted,#6b7280);cursor:pointer;background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._popOut_1agsz_224:hover{background-color:var(--color-surface-hover,#0000000f);color:var(--color-text)}._callBtn_1q44j_1{border:1px solid var(--color-border);background-color:var(--color-surface);width:36px;height:36px;color:var(--color-primary);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);border-radius:50%;justify-content:center;align-items:center;display:inline-flex}._callBtn_1q44j_1:hover:not(:disabled){background-color:var(--color-primary-10);border-color:var(--color-primary-border)}._callBtn_1q44j_1:disabled{opacity:.5;cursor:not-allowed}._card_1bdwl_1{background:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);text-align:left;cursor:pointer;appearance:none;width:100%;max-width:320px;margin-top:8px;padding:0;font-family:inherit;transition:border-color .2s,box-shadow .2s,transform .2s;display:block;overflow:hidden;box-shadow:0 2px 4px #0000000a}._card_1bdwl_1:hover,._card_1bdwl_1:focus-visible{border-color:var(--color-primary-40);outline:none;box-shadow:0 4px 12px #00000014}._header_1bdwl_29{background:var(--color-primary-05);border-bottom:1px solid var(--color-border);color:var(--color-primary);letter-spacing:.05em;text-transform:uppercase;align-items:center;gap:6px;padding:8px 14px;font-size:10px;font-weight:700;display:flex}._body_1bdwl_43{padding:14px}._authorRow_1bdwl_47{align-items:center;gap:10px;margin-bottom:10px;display:flex}._avatar_1bdwl_54{background:var(--avatar-color,var(--color-primary));width:26px;height:26px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:11px;font-weight:600;display:flex}._authorInfo_1bdwl_68{flex:1;min-width:0}._authorName_1bdwl_73{color:var(--color-text);font-size:12px;font-weight:600;line-height:1.2}._category_1bdwl_80{color:var(--cat-color,var(--color-text-soft));align-items:center;gap:5px;margin-top:3px;font-size:10.5px;font-weight:600;display:inline-flex}._catDot_1bdwl_90{background:var(--cat-color,var(--color-text-soft));border-radius:50%;width:6px;height:6px}._title_1bdwl_97{color:var(--color-text);margin-bottom:6px;font-size:14px;font-weight:600;line-height:1.4}._snippet_1bdwl_105{color:var(--color-text-mid);-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;font-size:13px;line-height:1.5;display:-webkit-box;overflow:hidden}._footer_1bdwl_116{border-top:1px solid var(--color-border);color:var(--color-primary);align-items:center;gap:4px;margin-top:12px;padding-top:10px;font-size:12px;font-weight:600;transition:color .2s;display:flex}._card_1bdwl_1:hover ._footer_1bdwl_116{color:var(--color-primary-dark,var(--color-primary))}:host{contain:layout style;height:100%;min-height:24rem;display:block}:host .commhub-widget-root{height:100%;font-family:var(--font-sans);font-size:var(--font-base);font-variant:normal;font-style:normal;font-weight:400;font-stretch:100%;line-height:var(--line-body);letter-spacing:-.01em;word-spacing:normal;text-align:start;text-indent:0;text-transform:none;text-shadow:none;white-space:normal;word-break:normal;overflow-wrap:normal;tab-size:4;color:var(--color-text);visibility:visible;opacity:1;writing-mode:horizontal-tb;cursor:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-feature-settings:"cv05", "cv11", "ss01";direction:ltr;list-style:none;display:block;overflow-y:auto;container-type:inline-size}:host{--color-primary:#045d5e;--color-primary-strong:#033f40;--color-primary-light:#067a7b;--color-primary-30:#045d5e2e;--color-primary-20:#045d5e1f;--color-primary-10:#045d5e0f;--color-primary-05:#045d5e09;--color-primary-border:#045d5e38;--color-on-primary:#fff;--color-secondary:#fc7300;--color-secondary-strong:#e16500;--color-secondary-30:#fc730033;--color-secondary-20:#fc73001f;--color-secondary-10:#fc730012;--color-secondary-border:#fc73004d;--color-bg:#f8fafc;--color-surface:#fff;--color-surface-muted:#f1f5f9;--color-off-hours:#f4f6f9;--color-text:#0f172a;--color-text-mid:#475569;--color-text-soft:#64748b;--color-text-muted:#64748b;--color-text-very-soft:#94a3b8;--color-border:#0f172a0f;--color-border-strong:#0f172a1a;--color-divider:#0f172a0a;--shadow-sm:0 1px 2px #0f172a0a, 0 1px 1px #0f172a08;--shadow-md:0 2px 4px #0f172a0a, 0 8px 18px #0f172a12;--shadow-lg:0 4px 10px #0f172a0d, 0 18px 44px #0f172a1a;--color-success:#10b981;--color-success-strong:#15803d;--color-success-soft:#10b98114;--color-danger:#ef4444;--color-danger-strong:#b91c1c;--color-danger-soft:#ef44440f;--color-warn:#f59e0b;--color-warn-soft:#f59e0b14;--color-focus:#3b82f6;--color-overlay:#0f172a73;--color-media-scrim:#090c10eb;--font-sans:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--font-xs:11.5px;--font-sm:13px;--font-base:14px;--font-md:15px;--font-lg:19px;--font-xl:24px;--font-2xl:30px;--line-body:1.55;--line-tight:1.28;--tracking-tight:-.02em;--tracking-tighter:-.03em;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-7:32px;--radius-sm:6px;--radius-md:10px;--radius-lg:14px;--radius-xl:16px;--radius-full:999px;--ease-out:cubic-bezier(.22, 1, .36, 1);--ease-in-out:cubic-bezier(.65, 0, .35, 1);--dur-fast:.14s;--dur-base:.2s;--dur-slow:.32s;--height-btn:36px;--height-input:40px;--height-row:52px;--height-nav:42px;--badge-h:20px;--badge-font:11px;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-primary:#3fb5b7;--color-primary-strong:#2d9799;--color-primary-light:#67d4d6;--color-primary-30:#3fb5b747;--color-primary-20:#3fb5b72e;--color-primary-10:#3fb5b71a;--color-primary-05:#3fb5b70f;--color-primary-border:#3fb5b752;--color-secondary:#ff8a2e;--color-secondary-strong:#e16500;--color-secondary-30:#ff8a2e4d;--color-secondary-20:#ff8a2e2e;--color-secondary-10:#ff8a2e1f;--color-secondary-border:#ff8a2e61;--color-bg:#0f1517;--color-surface:#1a2226;--color-surface-muted:#222c30;--color-off-hours:#11181b;--color-text:#e8edef;--color-text-mid:#a8b5bd;--color-text-soft:#7c8a92;--color-text-muted:#7c8a92;--color-text-very-soft:#536069;--color-border:#ffffff12;--color-border-strong:#ffffff21;--color-divider:#ffffff0a;--shadow-sm:0 1px 2px #0000004d, 0 1px 1px #0003;--shadow-md:0 2px 4px #0000004d, 0 8px 18px #0006;--shadow-lg:0 4px 10px #00000059, 0 18px 44px #00000080;--color-success:#34d399;--color-success-soft:#34d3991f;--color-danger:#f87171;--color-danger-soft:#f871711f;--color-warn:#fbbf24;--color-warn-soft:#fbbf241f}}:host([data-theme=dark]){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-primary:#3fb5b7;--color-primary-strong:#2d9799;--color-primary-light:#67d4d6;--color-primary-30:#3fb5b747;--color-primary-20:#3fb5b72e;--color-primary-10:#3fb5b71a;--color-primary-05:#3fb5b70f;--color-primary-border:#3fb5b752;--color-secondary:#ff8a2e;--color-secondary-strong:#e16500;--color-secondary-30:#ff8a2e4d;--color-secondary-20:#ff8a2e2e;--color-secondary-10:#ff8a2e1f;--color-secondary-border:#ff8a2e61;--color-bg:#0f1517;--color-surface:#1a2226;--color-surface-muted:#222c30;--color-off-hours:#11181b;--color-text:#e8edef;--color-text-mid:#a8b5bd;--color-text-soft:#7c8a92;--color-text-muted:#7c8a92;--color-text-very-soft:#536069;--color-border:#ffffff12;--color-border-strong:#ffffff21;--color-divider:#ffffff0a;--shadow-sm:0 1px 2px #00000040;--shadow-md:0 4px 12px #00000059;--shadow-lg:0 12px 32px #00000073;--color-success:#34d399;--color-success-soft:#34d3991f;--color-danger:#f87171;--color-danger-soft:#f871711f;--color-warn:#fbbf24;--color-warn-soft:#fbbf241f}:host,*{box-sizing:border-box}:host,.commhub-widget-root{height:100%}.route-fallback{place-items:center;min-height:100vh;display:grid}.content-fallback{place-items:center;height:100%;min-height:240px;display:grid}:host{font-family:var(--font-sans);background-color:var(--color-bg);color:var(--color-text);font-size:var(--font-base);line-height:var(--line-body);letter-spacing:-.01em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-feature-settings:"cv05", "cv11", "ss01";margin:0}::selection{background-color:var(--color-primary-20);color:var(--color-text)}:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}:host,*{scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:var(--radius-full);background-clip:padding-box;border:2px solid #0000}::-webkit-scrollbar-thumb:hover{background-color:var(--color-text-very-soft)}@media (width<=768px){:host{--height-btn:44px;--height-input:44px;--height-nav:56px}}._notice_184jj_6{color:#b91c1c;background-color:#fef2f2;border:1px solid #fecaca;border-radius:8px;margin:0;padding:16px;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:13px;line-height:1.5}._title_184jj_23{margin-bottom:4px;font-weight:600;display:block}._detail_184jj_29{word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}._scope_p8b6f_6{display:contents}._screen_1hhf0_1{flex-direction:column;min-height:100%;display:flex}._toolbar_1hhf0_8{background-color:var(--color-surface);border-bottom:1px solid var(--color-divider);padding:14px 0}._toolbarContainer_1hhf0_14{gap:22px;width:100%;max-width:1080px;margin:0 auto;padding:0 20px;display:flex}._search_1hhf0_23{flex:720px;width:100%;min-width:0;max-width:720px;position:relative}._toolbarRailSpacer_1hhf0_31{flex-shrink:0;width:330px}._searchIcon_1hhf0_36{color:var(--color-text-soft);position:absolute;top:50%;left:13px;transform:translateY(-50%)}._searchInput_1hhf0_44{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);outline:none;padding:10px 14px 10px 36px;font-size:13px}._searchInput_1hhf0_44:focus{border-color:var(--color-primary-border)}._textareaError_1hhf0_59,._commentComposerError_1hhf0_60,._shareCommentError_1hhf0_61{border-color:var(--color-danger)!important;border-radius:var(--radius-md)!important;box-shadow:inset 0 0 0 1.5px var(--color-danger), 0 0 8px #ef444440!important}._wrapper_1hhf0_70{align-items:flex-start;gap:22px;width:100%;max-width:1080px;margin:0 auto;padding:22px 20px 48px;display:flex}._column_1hhf0_80{flex-direction:column;flex:720px;gap:16px;width:100%;min-width:0;max-width:720px;display:flex}._rail_1hhf0_91{flex-direction:column;flex-shrink:0;align-self:flex-start;width:330px;max-height:calc(100vh - 130px);display:flex;position:sticky;top:22px}._railHead_1hhf0_102{justify-content:space-between;align-items:center;padding:2px 4px 10px;display:flex}._railHeadTitle_1hhf0_109{font-size:var(--font-xs);color:var(--color-text-soft);letter-spacing:.08em;align-items:center;gap:6px;font-weight:700;display:inline-flex}._railHeadTitle_1hhf0_109 svg{color:var(--color-secondary)}._railSeeAll_1hhf0_123{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;font-size:11px;font-weight:600}._railList_1hhf0_132{flex-direction:column;flex:1;gap:12px;min-height:0;padding-right:4px;display:flex;overflow-y:auto}._cardBody_1hhf0_142{white-space:pre-wrap;word-break:break-word;color:var(--color-text-body);margin:0;font-size:14px;line-height:1.6}._seeMoreBtn_1hhf0_151{color:var(--color-primary);cursor:pointer;background:0 0;border:none;margin-left:4px;padding:0;font-size:14px;font-weight:600}._seeMoreBtn_1hhf0_151:hover{text-decoration:underline}._railFoot_1hhf0_166{border-top:1px solid var(--color-divider);font-size:var(--font-xs);color:var(--color-text-very-soft);text-align:center;flex-shrink:0;margin-top:8px;padding-top:8px}._missed_1hhf0_177{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);padding:12px 14px}._missedHead_1hhf0_184{align-items:center;gap:9px;margin-bottom:10px;padding:0 2px;display:flex}._missedSpark_1hhf0_192{color:var(--color-primary)}._missedTitle_1hhf0_196{font-size:var(--font-xs);color:var(--color-text);letter-spacing:.1em;font-weight:700}._missedBadge_1hhf0_203{background-color:var(--color-primary-10);color:var(--color-primary);border-radius:var(--radius-full);padding:1px 7px;font-size:9.5px;font-weight:700}._missedScroller_1hhf0_212{position:relative}._missedScrollerFade_1hhf0_217 ._missedTrack_1hhf0_217{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 26px),#0000);mask-image:linear-gradient(90deg,#000 calc(100% - 26px),#0000)}._missedTrack_1hhf0_217{scroll-snap-type:x mandatory;gap:10px;padding:4px 2px 10px;display:flex;overflow-x:auto}._missedNav_1hhf0_229{z-index:2;border:1px solid var(--color-border);background-color:var(--color-surface);width:30px;height:30px;color:var(--color-text-mid);box-shadow:var(--shadow-md);cursor:pointer;opacity:0;border-radius:50%;justify-content:center;align-items:center;transition:opacity .15s,background-color .15s,color .15s,border-color .15s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}._missedScroller_1hhf0_212:hover ._missedNav_1hhf0_229,._missedScroller_1hhf0_212:focus-within ._missedNav_1hhf0_229{opacity:1}._missedNav_1hhf0_229:hover{background-color:var(--color-primary);color:var(--color-on-primary);border-color:var(--color-primary)}._missedNavLeft_1hhf0_264{left:-6px}._missedNavRight_1hhf0_268{right:-6px}._missedCard_1hhf0_272{background-color:var(--color-bg);border:1px solid var(--color-border);border-radius:var(--radius-md);scroll-snap-align:start;flex-shrink:0;width:280px;padding:11px 12px}._missedCardTop_1hhf0_282{align-items:center;gap:6px;margin-bottom:7px;display:flex}._missedDot_1hhf0_289{background-color:var(--dot);border-radius:50%;flex-shrink:0;width:6px;height:6px}._missedCat_1hhf0_297{color:var(--color-text-mid);letter-spacing:.02em;font-size:9.5px;font-weight:600}._missedTime_1hhf0_304{font-size:var(--font-xs);color:var(--color-text-soft);margin-left:auto;margin-right:24px}._missedSummary_1hhf0_311{color:var(--color-text);-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;margin:0 0 8px;font-size:11.5px;line-height:1.5;display:-webkit-box;overflow:hidden}._missedFoot_1hhf0_323{justify-content:space-between;align-items:center;display:flex}._missedCta_1hhf0_329{font-size:var(--font-xs);color:var(--color-primary);align-items:center;gap:3px;font-weight:700;display:inline-flex}._missedPriority_1hhf0_338{color:var(--color-primary);background-color:var(--color-primary-05);border:1px solid var(--color-primary-30);letter-spacing:.04em;text-transform:uppercase;border-radius:4px;align-items:center;gap:3px;padding:1px 6px;font-size:9px;font-weight:700;display:inline-flex}._compChips_1hhf0_354{flex-wrap:wrap;gap:6px;padding:0 16px 8px;display:flex}._compChip_1hhf0_354{border-radius:var(--radius-full);background-color:var(--color-bg);border:1px solid var(--color-border);font-size:var(--font-xs);color:var(--color-text);align-items:center;gap:4px;padding:3px 9px;font-weight:600;display:inline-flex}._actionBar_1hhf0_374{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);justify-content:space-between;align-items:center;gap:8px;margin:0 16px 12px;padding:8px 12px;display:flex}._actionBarLabel_1hhf0_386{color:var(--color-text-mid);font-size:11.5px;font-weight:600}._actionBarBtns_1hhf0_392{gap:2px;display:flex}._actionIcon_1hhf0_397{width:32px;height:32px;color:var(--color-text-mid);cursor:pointer;background:0 0;border:none;border-radius:7px;justify-content:center;align-items:center;display:flex}._actionIcon_1hhf0_397:hover{background-color:var(--color-bg)}._actionIconActive_1hhf0_414{background-color:var(--color-primary-05);color:var(--color-primary)}._sheet_1hhf0_419{border-radius:var(--radius-md);background-color:var(--color-bg);border:1px solid var(--color-border);margin:0 16px 12px;padding:12px 14px}._sheetHead_1hhf0_427{justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px;display:flex}._sheetLabel_1hhf0_435{font-size:var(--font-xs);color:var(--color-text-mid);letter-spacing:.06em;text-transform:uppercase;font-weight:700}._sheetClose_1hhf0_443{border-radius:var(--radius-sm);width:24px;height:24px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .15s,color .15s;display:flex}._sheetClose_1hhf0_443:hover{background-color:var(--color-surface-muted);color:var(--color-text)}._sheetChips_1hhf0_465{flex-wrap:wrap;gap:6px;display:flex}._catChip_1hhf0_471{border-radius:var(--radius-full);font-size:var(--font-xs);background-color:color-mix(in srgb, var(--chip) 10%, transparent);color:var(--chip);border:1px solid color-mix(in srgb, var(--chip) 30%, transparent);cursor:pointer;letter-spacing:.03em;padding:5px 11px;font-weight:700}._catChipOn_1hhf0_483{background-color:var(--chip);color:var(--color-on-primary)}._feelGrid_1hhf0_488{grid-template-columns:repeat(4,1fr);gap:6px;display:grid}._feelBtn_1hhf0_494{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-mid);cursor:pointer;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;font-size:10.5px;font-weight:600;display:flex}._feelBtnOn_1hhf0_509{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._feelEmoji_1hhf0_515{font-size:20px}._photoInput_1hhf0_519{display:none}._photoZone_1hhf0_523{border-radius:var(--radius-md);margin:0 16px 24px}._photoZoneDrag_1hhf0_528{outline:2px dashed var(--color-primary);outline-offset:3px}._dropzone_1hhf0_533{border-radius:var(--radius-md);border:1.5px dashed var(--color-border-strong);background-color:var(--color-surface);cursor:pointer;flex-direction:column;align-items:center;gap:4px;width:100%;padding:22px 16px;transition:border-color .15s,background-color .15s;display:flex}._dropzone_1hhf0_533:hover{border-color:var(--color-primary);background-color:var(--color-primary-05)}._dropIcon_1hhf0_554{background-color:var(--color-primary-10);width:40px;height:40px;color:var(--color-primary);border-radius:50%;justify-content:center;align-items:center;margin-bottom:2px;display:flex}._dropTitle_1hhf0_566{color:var(--color-text);font-size:12.5px;font-weight:600}._dropHint_1hhf0_572{font-size:var(--font-xs);color:var(--color-text-soft)}._photoGrid_1hhf0_577{grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px;display:grid}._photoThumb_1hhf0_584{aspect-ratio:1;border-radius:var(--radius-md);border:1px solid var(--color-border);position:relative;overflow:hidden}._photoImg_1hhf0_592{object-fit:cover;width:100%;height:100%;display:block}._photoRemove_1hhf0_599{color:#fff;cursor:pointer;background-color:#0d1f1f8c;border:none;border-radius:50%;justify-content:center;align-items:center;width:22px;height:22px;display:flex;position:absolute;top:5px;right:5px}._photoRemove_1hhf0_599:hover{background-color:#0d1f1fc7}._photoAddMore_1hhf0_619{aspect-ratio:1;border-radius:var(--radius-md);border:1.5px dashed var(--color-border-strong);background-color:var(--color-surface);color:var(--color-text-soft);cursor:pointer;justify-content:center;align-items:center;transition:border-color .15s,color .15s,background-color .15s;display:flex}._photoAddMore_1hhf0_619:hover{border-color:var(--color-primary);color:var(--color-primary);background-color:var(--color-primary-05)}._mobilePromoTrigger_1hhf0_642{display:none}@keyframes _promoPulseGlow_1hhf0_1{0%{box-shadow:0 0 #00909f73,0 8px 24px #00000059}70%{box-shadow:0 0 0 12px #00909f00,0 8px 24px #00000059}to{box-shadow:0 0 #00909f00,0 8px 24px #00000059}}@keyframes _promoShimmer_1hhf0_751{0%{transform:translate(-120%)rotate(25deg)}20%,to{transform:translate(180%)rotate(25deg)}}@keyframes _sparkleTwinkle_1hhf0_1{0%,to{opacity:.9;transform:scale(1)rotate(0)}50%{opacity:1;transform:scale(1.18)rotate(12deg)}}@media (width<=1024px){._rail_1hhf0_91,._toolbarRailSpacer_1hhf0_31{display:none}._mobilePromoTrigger_1hhf0_642{z-index:90;border-radius:var(--radius-full);-webkit-backdrop-filter:blur(14px);color:#fff;letter-spacing:-.01em;cursor:pointer;background:linear-gradient(135deg,#095e5ff2,#00909ffa);border:1px solid #ffffff47;align-items:center;gap:0;min-width:44px;max-width:44px;height:44px;padding:9px;font-size:13px;font-weight:600;transition:bottom .22s cubic-bezier(.22,1,.36,1),max-width .35s cubic-bezier(.16,1,.3,1),padding .35s cubic-bezier(.16,1,.3,1),gap .35s cubic-bezier(.16,1,.3,1),transform .25s cubic-bezier(.16,1,.3,1),box-shadow .25s;animation:3s infinite _promoPulseGlow_1hhf0_1;display:inline-flex;position:fixed;bottom:24px;right:20px;overflow:hidden;box-shadow:0 4px 16px #00000040}@media (width<=425px){._mobilePromoTrigger_1hhf0_642{bottom:76px}._mobilePromoTriggerBarHidden_1hhf0_732{bottom:20px}}._mobilePromoTrigger_1hhf0_642:hover,._mobilePromoExpanded_1hhf0_738{background:linear-gradient(135deg,#0b797afa,#00a8ba);border-color:#ffffff73;gap:10px;max-width:230px;padding-right:16px;transform:translateY(-3px)scale(1.02)}._mobilePromoTrigger_1hhf0_642:active{transform:translateY(0)scale(.97)}._promoShimmerSweep_1hhf0_751{pointer-events:none;background:linear-gradient(90deg,#0000,#ffffff59,#0000);width:40%;height:200%;animation:4s ease-in-out infinite _promoShimmer_1hhf0_751;position:absolute;top:-50%;left:-50%}._promoIconWrap_1hhf0_767{border-radius:var(--radius-full);color:#ffd166;background:#ffffff2e;border:1px solid #ffffff40;flex-shrink:0;justify-content:center;align-items:center;width:26px;height:26px;display:flex}._sparkleIcon_1hhf0_780{animation:2.5s ease-in-out infinite _sparkleTwinkle_1hhf0_1}._promoBtnText_1hhf0_784{color:#fff;text-shadow:0 1px 2px #0003;white-space:nowrap;opacity:0;max-width:0;font-weight:600;transition:opacity .28s,max-width .35s cubic-bezier(.16,1,.3,1);overflow:hidden}._mobilePromoTrigger_1hhf0_642:hover ._promoBtnText_1hhf0_784,._mobilePromoExpanded_1hhf0_738 ._promoBtnText_1hhf0_784{opacity:1;max-width:180px}._mobilePromoBadge_1hhf0_803{border-radius:var(--radius-full);color:#fff;letter-spacing:0;background:linear-gradient(135deg,#f37321,#ff9f1c);justify-content:center;align-items:center;min-width:22px;height:22px;padding:0 7px;font-size:11px;font-weight:800;display:inline-flex;box-shadow:0 2px 8px #f3732166}}._promoPopoverOverlay_1hhf0_820{z-index:1000;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background-color:#000000a6;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}._promoPopoverCard_1hhf0_832{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-xl);width:100%;max-width:440px;max-height:85vh;box-shadow:var(--shadow-xl);flex-direction:column;display:flex;position:relative;overflow:hidden}._popoverHeader_1hhf0_846{text-align:center;flex-direction:column;align-items:center;padding:28px 24px 16px;display:flex;position:relative}._popoverCloseX_1hhf0_855{color:var(--color-text-soft);cursor:pointer;border-radius:var(--radius-full);transition:background-color var(--dur-fast) var(--ease-out);background:0 0;border:none;justify-content:center;align-items:center;padding:6px;display:flex;position:absolute;top:16px;right:16px}._popoverCloseX_1hhf0_855:hover{background-color:var(--color-surface-muted);color:var(--color-text)}._popoverBadgeIcon_1hhf0_876{border-radius:var(--radius-full);background-color:var(--color-primary-10);width:56px;height:56px;color:var(--color-primary);justify-content:center;align-items:center;margin-bottom:14px;display:flex}._popoverTitleRow_1hhf0_888{flex-wrap:wrap;justify-content:center;align-items:center;gap:10px;margin-bottom:6px;display:flex}._popoverTitle_1hhf0_888{color:var(--color-text);margin:0;font-size:18px;font-weight:700}._popoverSeeAllBtn_1hhf0_904{background-color:var(--color-primary-10);color:var(--color-primary);border:1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);border-radius:var(--radius-full);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out);padding:3px 10px;font-size:11px;font-weight:700}._popoverSeeAllBtn_1hhf0_904:hover{background-color:var(--color-primary-20,#00000026)}._popoverSub_1hhf0_920{color:var(--color-text-muted);margin:0;font-size:13px;line-height:1.4}._popoverContent_1hhf0_927{flex-direction:column;flex:1;gap:14px;padding:12px 24px 24px;display:flex;overflow-y:auto}._popoverEmpty_1hhf0_936{text-align:center;color:var(--color-text-muted);padding:20px 0;font-size:13px}._railList_1hhf0_132{scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}._railList_1hhf0_132::-webkit-scrollbar{width:6px}._railList_1hhf0_132::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:var(--radius-full)}._railList_1hhf0_132::-webkit-scrollbar-track{background:0 0}._missedTrack_1hhf0_217{scrollbar-width:none}._missedTrack_1hhf0_217::-webkit-scrollbar{display:none}._missedCard_1hhf0_272{transition:transform .18s,border-color .18s,box-shadow .18s;position:relative}._missedCard_1hhf0_272:hover{border-color:var(--color-primary-30);transform:translateY(-1px);box-shadow:0 4px 14px #045d5e14}._missedClose_1hhf0_985{background:var(--color-surface-muted);width:20px;height:20px;color:var(--color-text-soft);cursor:pointer;opacity:.6;border:none;border-radius:5px;justify-content:center;align-items:center;transition:opacity .15s,background-color .15s,color .15s;display:flex;position:absolute;top:6px;right:6px}._missedCard_1hhf0_272:hover ._missedClose_1hhf0_985{opacity:1}._missedClose_1hhf0_985:hover{background-color:var(--color-border);color:var(--color-text)}._missedCta_1hhf0_329{cursor:pointer;background:0 0;border:none;padding:0}._missedRead_1hhf0_1022{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:6px;margin-left:auto;padding:4px 8px;font-size:11px;font-weight:600}._missedRead_1hhf0_1022:hover{background-color:var(--color-bg);color:var(--color-text)}._railSeeAll_1hhf0_123{cursor:pointer}._railSeeAll_1hhf0_123:hover{color:var(--color-primary)}._comments_1hhf0_1048{border-top:1px solid var(--color-divider);background-color:var(--color-bg);flex-direction:column;gap:8px;padding:12px 18px;display:flex}._commentRow_1hhf0_1057{gap:9px;display:flex}._commentAvatar_1hhf0_1062{background-color:var(--avatar-color);width:26px;height:26px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:10px;font-weight:700;display:flex}._commentBubble_1hhf0_1076{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:9px;flex:1;padding:7px 10px}._commentAuthor_1hhf0_1084{color:var(--color-text);font-size:11px;font-weight:700}._commentTime_1hhf0_1090{color:var(--color-text-soft);font-weight:500}._commentText_1hhf0_1095{color:var(--color-text-mid);margin-top:2px;font-size:11.5px;line-height:1.45}._commentComposer_1hhf0_60{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:9px;flex:1;align-items:center;gap:8px;padding:4px 4px 4px 12px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;display:flex}._commentComposer_1hhf0_60:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary-10)}._commentInput_1hhf0_1121{color:var(--color-text);background:0 0;border:none;outline:none;flex:1;padding:4px 0;font-size:11.5px}._commentSend_1hhf0_1131{background-color:var(--color-primary);width:28px;height:28px;color:var(--color-on-primary);cursor:pointer;border:none;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .15s,color .15s,opacity .15s;display:flex}._commentSend_1hhf0_1131:hover:not(:disabled){background-color:var(--color-primary-strong)}._commentSend_1hhf0_1131:disabled{background-color:var(--color-surface-muted);color:var(--color-text-soft);cursor:not-allowed;opacity:.6}._sharePreviewWrap_1hhf0_1161{background-color:var(--color-bg);border-bottom:1px solid var(--color-border);padding:12px 20px}._sharePreview_1hhf0_1161{border-radius:var(--radius-md);background-color:var(--color-surface);border:1px solid var(--color-border);align-items:flex-start;gap:10px;padding:10px;display:flex}._sharePreviewAvatar_1hhf0_1177{background-color:var(--avatar-color);width:28px;height:28px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:10px;font-weight:700;display:flex}._sharePreviewBody_1hhf0_1191{flex:1;min-width:0}._sharePreviewMeta_1hhf0_1196{color:var(--color-text-soft);margin-bottom:2px;font-size:11px}._sharePreviewCat_1hhf0_1202{color:var(--cat);font-weight:600}._sharePreviewTitle_1hhf0_1207{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:12.5px;font-weight:600;overflow:hidden}._shareField_1hhf0_1217{padding:12px 20px 4px}._shareComment_1hhf0_61{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:100%;color:var(--color-text);padding:9px 12px;font-family:inherit;font-size:12.5px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}._shareComment_1hhf0_61:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px var(--color-primary-10);outline:none}._shareSearchWrap_1hhf0_1241{padding:8px 20px 6px}._shareSearch_1hhf0_1241{position:relative}._shareSearch_1hhf0_1241 svg{color:var(--color-text-soft);position:absolute;top:50%;left:11px;transform:translateY(-50%)}._shareSearchInput_1hhf0_1257{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);padding:8px 12px 8px 32px;font-family:inherit;font-size:12px}._shareSearchInput_1hhf0_1257:focus{border-color:var(--color-primary);outline:none}._shareList_1hhf0_1274{flex:1;min-height:0;padding:4px 20px 12px;overflow-y:auto}._shareSectionLabel_1hhf0_1281{letter-spacing:.1em;text-transform:uppercase;color:var(--color-text-soft);padding:10px 4px 6px;font-size:9.5px;font-weight:700}._shareRow_1hhf0_1290{text-align:left;border-radius:var(--radius-md);cursor:pointer;background:0 0;border:1px solid #0000;align-items:center;gap:10px;width:100%;margin-bottom:2px;padding:8px;display:flex}._shareRow_1hhf0_1290:hover{background-color:var(--color-bg)}._shareRowOn_1hhf0_1308,._shareRowOn_1hhf0_1308:hover{background-color:var(--color-primary-10);border-color:var(--color-primary-30)}._shareAvatar_1hhf0_1314{background-color:var(--avatar-color);width:32px;height:32px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:12px;font-weight:700;display:flex}._shareAvatarSquare_1hhf0_1328{border-radius:8px}._shareRowBody_1hhf0_1332{flex-direction:column;flex:1;min-width:0;display:flex}._shareRowName_1hhf0_1339{color:var(--color-text);font-size:12.5px;font-weight:600}._shareRowSub_1hhf0_1345{font-size:var(--font-xs);color:var(--color-text-soft)}._shareCheck_1hhf0_1350{border:1.5px solid var(--color-border-strong);width:18px;height:18px;color:var(--color-on-primary);background:0 0;border-radius:5px;flex-shrink:0;justify-content:center;align-items:center;display:flex}._shareCheckOn_1hhf0_1363{background-color:var(--color-primary);border-color:var(--color-primary)}._shareEmpty_1hhf0_1368{text-align:center;color:var(--color-text-soft);padding:30px 0;font-size:12px}._shareFootText_1hhf0_1376{color:var(--color-text-mid);font-size:11.5px}._shareFootBtns_1hhf0_1381{gap:8px;display:flex}._shareCancelBtn_1hhf0_1386{border-radius:var(--radius-md);border:1px solid var(--color-border);color:var(--color-text-mid);cursor:pointer;background:0 0;padding:8px 14px;font-size:12px;font-weight:600}._shareCancelBtn_1hhf0_1386:hover{background-color:var(--color-bg)}._shareSendBtn_1hhf0_1401{border-radius:var(--radius-md);background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;align-items:center;gap:6px;padding:8px 16px;font-size:12px;font-weight:700;display:inline-flex}._shareSendBtn_1hhf0_1401:disabled{background-color:var(--color-bg);color:var(--color-text-very-soft);border:1px solid var(--color-border);cursor:not-allowed}._shareRoot_1hhf0_1422{z-index:11000;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}._shareBackdrop_1hhf0_1432{background-color:var(--color-overlay);cursor:pointer;border:none;padding:0;animation:.16s _shareFade_1hhf0_1;position:absolute;inset:0}._shareModal_1hhf0_1442{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);width:min(540px,100%);max-height:85vh;box-shadow:var(--shadow-lg);flex-direction:column;animation:.16s _shareIn_1hhf0_1;display:flex;position:relative;overflow:hidden}@keyframes _shareFade_1hhf0_1{0%{opacity:0}}@keyframes _shareIn_1hhf0_1{0%{opacity:0;transform:translateY(8px)scale(.98)}}@media (prefers-reduced-motion:reduce){._shareBackdrop_1hhf0_1432,._shareModal_1hhf0_1442{animation:none}}._shareHead_1hhf0_1476{border-bottom:1px solid var(--color-border);align-items:center;gap:10px;padding:16px 20px 12px;display:flex}._shareHeadIcon_1hhf0_1484{background-color:var(--color-primary-10);width:30px;height:30px;color:var(--color-primary);border-radius:8px;flex-shrink:0;justify-content:center;align-items:center;display:flex}._shareHeadText_1hhf0_1496{flex:1;min-width:0}._shareTitle_1hhf0_1501{font-size:var(--font-md);color:var(--color-text);margin:0;font-weight:700}._shareDesc_1hhf0_1508{color:var(--color-text-soft);margin:1px 0 0;font-size:11px}._shareCloseBtn_1hhf0_1514{width:32px;height:32px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:8px;flex-shrink:0;justify-content:center;align-items:center;display:flex}._shareCloseBtn_1hhf0_1514:hover{background-color:var(--color-surface-muted);color:var(--color-text)}._shareFooter_1hhf0_1533{border-top:1px solid var(--color-border);background-color:var(--color-bg);justify-content:space-between;align-items:center;gap:8px;padding:12px 20px;display:flex}._ppRoot_1hhf0_1544{z-index:60;justify-content:flex-end;display:flex;position:fixed;inset:0}._ppOverlay_1hhf0_1552{background-color:var(--color-overlay);cursor:pointer;border:none;padding:0;animation:.18s _ppFade_1hhf0_1;position:absolute;inset:0}._ppPanel_1hhf0_1562{background-color:var(--color-surface);width:min(480px,100%);height:100%;box-shadow:var(--shadow-lg);flex-direction:column;animation:.22s _ppSlide_1hhf0_1;display:flex;position:relative;overflow:hidden}@keyframes _ppFade_1hhf0_1{0%{opacity:0}}@keyframes _ppSlide_1hhf0_1{0%{transform:translate(100%)}}@media (prefers-reduced-motion:reduce){._ppOverlay_1hhf0_1552,._ppPanel_1hhf0_1562{animation:none}}._ppHead_1hhf0_1594{background:linear-gradient(135deg, var(--color-primary), var(--color-primary-light));color:var(--color-on-primary);align-items:flex-start;gap:13px;padding:22px 22px 20px;display:flex}._ppHeadIcon_1hhf0_1603{border-radius:var(--radius-md);background-color:#ffffff2e;flex-shrink:0;justify-content:center;align-items:center;width:40px;height:40px;display:flex}._ppHeadText_1hhf0_1614{flex:1;min-width:0}._ppTitle_1hhf0_1619{font-size:var(--font-xl);color:var(--color-on-primary);letter-spacing:-.01em;margin:0;font-weight:700}@media (width<=640px){._ppTitle_1hhf0_1619{white-space:nowrap;text-overflow:ellipsis;font-size:19px;overflow:hidden}}._ppSubtitle_1hhf0_1636{color:#ffffffe0;margin:4px 0 3px;font-size:12.5px}._ppManaged_1hhf0_1642{color:#ffffffb8;font-size:11px}._ppClose_1hhf0_1647{color:#ffffffe6;cursor:pointer;background:0 0;border:none;border-radius:9px;flex-shrink:0;justify-content:center;align-items:center;width:36px;height:36px;transition:background-color .15s;display:flex}._ppClose_1hhf0_1647:hover{color:#fff;background-color:#ffffff2e}._ppTabs_1hhf0_1667{border-bottom:1px solid var(--color-divider);flex-wrap:wrap;gap:6px;padding:14px 22px;display:flex}._ppTabs_1hhf0_1667:has(._ppTab_1hhf0_1667:only-child){display:none}._ppTabs_1hhf0_1667:has(._ppTab_1hhf0_1667:only-child)+._ppSearch_1hhf0_1676{display:none}._ppTab_1hhf0_1667{border-radius:var(--radius-full);background-color:var(--color-surface-muted);color:var(--color-text-soft);cursor:pointer;border:none;padding:7px 14px;font-size:12.5px;font-weight:600;transition:color .16s;position:relative}._ppTab_1hhf0_1667:hover{color:var(--color-text)}._ppTabActive_1hhf0_1697{color:var(--color-primary)}._ppTabBg_1hhf0_1701{border-radius:var(--radius-full);background-color:var(--color-primary-10);box-shadow:inset 0 0 0 1px var(--color-primary-border);position:absolute;inset:0}._ppTabLabel_1hhf0_1709{z-index:1;position:relative}._ppSearch_1hhf0_1676{margin:14px 22px 6px;position:relative}._ppSearchIcon_1hhf0_1719{color:var(--color-text-soft);position:absolute;top:50%;left:13px;transform:translateY(-50%)}._ppSearchInput_1hhf0_1727{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);outline:none;padding:10px 14px 10px 36px;font-size:13px;transition:border-color .15s,box-shadow .15s}._ppSearchInput_1hhf0_1727:focus{border-color:var(--color-primary-border);box-shadow:0 0 0 3px var(--color-primary-10)}._ppList_1hhf0_1746{scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent;flex:1;padding:8px 22px 24px;overflow-y:auto}._ppListInner_1hhf0_1754{flex-direction:column;gap:12px;display:flex}._ppList_1hhf0_1746::-webkit-scrollbar{width:6px}._ppList_1hhf0_1746::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:var(--radius-full)}._ppEmpty_1hhf0_1769{text-align:center;color:var(--color-text-soft);padding:32px 0;font-size:13px}@media (width<=768px){._ppPanel_1hhf0_1562{width:100%}}._emptyState_1hhf0_1783{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px dashed var(--color-border-strong);text-align:center;flex-direction:column;justify-content:center;align-items:center;padding:64px 20px;display:flex}._emptyIconWrap_1hhf0_1795{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:64px;height:64px;color:var(--color-text-soft);justify-content:center;align-items:center;margin-bottom:16px;display:flex}._emptyTitle_1hhf0_1807{font-size:var(--font-lg);color:var(--color-text);margin:0 0 8px;font-weight:700}._emptyText_1hhf0_1814{font-size:var(--font-sm);color:var(--color-text-soft);max-width:300px;margin:0;line-height:1.5}._tabs_1hhf0_1823{flex-wrap:wrap;align-items:center;gap:6px;display:inline-flex}._tab_1hhf0_1823{border-radius:var(--radius-full);border:1px solid var(--color-border);color:var(--color-text-soft);cursor:pointer;white-space:nowrap;background:0 0;align-items:center;gap:6px;padding:8px 14px;font-size:12.5px;font-weight:600;display:inline-flex}._tabActive_1hhf0_1845{background-color:var(--color-primary-20);border-color:var(--color-primary-border);color:var(--color-primary)}._tabBadge_1hhf0_1851{color:var(--color-primary);margin-left:2px;font-size:11.5px;font-weight:700}._composerCollapsed_1hhf0_1859{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);align-items:center;gap:10px;padding:10px 14px;display:flex}._ccAvatar_1hhf0_1869,._compAvatar_1hhf0_1870,._avatar_1hhf0_1871{background-color:var(--avatar-color);color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-weight:700;display:flex}._ccAvatar_1hhf0_1869{width:32px;height:32px;font-size:12px}._ccInput_1hhf0_1888{text-align:left;border-radius:var(--radius-full);background-color:var(--color-bg);border:1px solid var(--color-border);color:var(--color-text-soft);cursor:pointer;flex:1;padding:9px 14px;font-size:13px;font-weight:500}._ccInput_1hhf0_1888:hover{background-color:var(--color-surface);border-color:var(--color-border-strong)}._composer_1hhf0_1859{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-md);overflow:hidden}._compHead_1hhf0_1914{align-items:flex-start;gap:11px;padding:14px 16px 0;display:flex}._compAvatarWrapper_1hhf0_1921{flex-shrink:0;position:relative}._statusDot_1hhf0_1926{background-color:var(--color-success,#10b981);border:1.5px solid var(--color-surface,#fff);border-radius:50%;width:10px;height:10px;position:absolute;bottom:0;right:0}._compAvatar_1hhf0_1870{width:40px;height:40px;font-size:13px}._compHeaderTagline_1hhf0_1943{color:var(--color-text);font-size:13px;line-height:1.4}._compMutedText_1hhf0_1949{color:var(--color-text-soft,#64748b);font-weight:400}._taggedTagline_1hhf0_1954{color:var(--color-text-soft,#64748b);margin-top:1px;margin-bottom:2px;font-size:.85rem}._taggedTagline_1hhf0_1954 strong{color:var(--color-text,#0f172a);font-weight:700}._audiencePill_1hhf0_1966{border-radius:var(--radius-full);background-color:var(--color-bg);border:1px solid var(--color-border);font-size:var(--font-xs);color:var(--color-text-mid);cursor:pointer;align-items:center;gap:5px;margin-top:4px;padding:3px 10px;font-weight:600;display:inline-flex}._audiencePill_1hhf0_1966:hover{border-color:var(--color-border-strong)}._audienceSection_1hhf0_1985{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:9px;margin:0 16px 12px;padding:12px 14px;display:flex}._audienceLabel_1hhf0_1996{letter-spacing:.06em;text-transform:uppercase;color:var(--color-text-soft);font-size:10px;font-weight:700}._audienceRow_1hhf0_2004{flex-wrap:wrap;gap:8px;display:flex}._audienceBtn_1hhf0_2010{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-mid);cursor:pointer;align-items:center;gap:6px;padding:8px 14px;font-size:12.5px;font-weight:600;display:inline-flex}._audienceBtn_1hhf0_2010:hover{border-color:var(--color-border-strong)}._audienceBtnActive_1hhf0_2028{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._compClose_1hhf0_2034{width:28px;height:28px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:7px;justify-content:center;align-items:center;margin-left:auto;display:flex}._compClose_1hhf0_2034:hover{background-color:var(--color-bg);color:var(--color-text)}._titleInput_1hhf0_2053{width:100%;color:var(--color-text);background:0 0;border:none;outline:none;padding:8px 16px 0;font-family:inherit;font-size:16px;font-weight:700;transition:box-shadow .15s ease-in-out}._titleInput_1hhf0_2053::placeholder{color:var(--color-text-very-soft);font-weight:600}._textarea_1hhf0_59{width:100%;min-height:72px;color:var(--color-text);resize:none;background:0 0;border:none;outline:none;padding:6px 16px 10px;font-family:inherit;font-size:14px;line-height:1.5;transition:box-shadow .15s ease-in-out}._compOption_1hhf0_2086{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);justify-content:space-between;align-items:center;gap:10px;margin:0 16px 12px;padding:10px 14px;display:flex}._compOptionLabel_1hhf0_2098{color:var(--color-text);align-items:center;gap:7px;font-size:12.5px;font-weight:600;display:inline-flex}._compOptionLabel_1hhf0_2098 svg{color:var(--color-primary)}._compFooter_1hhf0_2111{border-top:1px solid var(--color-divider);justify-content:space-between;align-items:center;gap:8px;padding:12px 16px;display:flex}._submitRight_1hhf0_2120{align-items:center;gap:10px;display:flex}._modeToggle_1hhf0_2126{font-size:11px}._cancelBtn_1hhf0_2130{color:var(--color-text-mid);border:1px solid var(--color-border);cursor:pointer;background:0 0;border-radius:8px;padding:8px 14px;font-size:12px;font-weight:600}._cancelBtn_1hhf0_2130:hover{background-color:var(--color-bg)}._postBtn_1hhf0_2145{background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;border-radius:8px;padding:8px 22px;font-size:12px;font-weight:700}._postBtn_1hhf0_2145:disabled{background-color:var(--color-primary-20);cursor:not-allowed}._card_1hhf0_142{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);box-shadow:var(--shadow-sm);transition:box-shadow .18s,border-color .18s;position:relative;overflow:hidden}._card_1hhf0_142:hover{box-shadow:var(--shadow-md);border-color:var(--color-border-strong)}._urgentStripe_1hhf0_2179{background-color:var(--color-primary);z-index:10;pointer-events:none;width:3px;position:absolute;top:0;bottom:0;left:0}._pinnedRow_1hhf0_2190{border-bottom:1px solid var(--color-divider);color:var(--color-text-soft);align-items:center;gap:5px;padding:5px 20px;font-size:11px;font-weight:600;display:flex}._pin_1hhf0_2190{color:var(--color-primary)}._cardHead_1hhf0_2205{gap:12px;padding:16px 20px 10px;display:flex}._avatar_1hhf0_1871{width:42px;height:42px;font-size:14px}._cardAuthor_1hhf0_2217{flex:1;min-width:0}._authorName_1hhf0_2222{color:var(--color-text);letter-spacing:-.005em;align-items:center;gap:6px;font-size:14px;font-weight:600;display:flex}._metaRow_1hhf0_2232{color:var(--color-text-soft);flex-wrap:wrap;align-items:center;gap:8px;margin-top:4px;font-size:11.5px;display:flex}._cardRight_1hhf0_2242{flex-direction:column;flex-shrink:0;align-items:flex-end;gap:6px;display:flex}._badge_1hhf0_2250{border-radius:var(--radius-full);color:var(--badge-color);background-color:color-mix(in srgb, var(--badge-color) 10%, transparent);border:1px solid color-mix(in srgb, var(--badge-color) 22%, transparent);align-items:center;gap:5px;padding:3px 9px;font-size:9.5px;font-weight:700;display:inline-flex}._badgeDot_1hhf0_2263{background-color:var(--badge-color);border-radius:50%;width:5px;height:5px}._bookmarkBtn_1hhf0_2270{width:26px;height:26px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;display:flex}._bookmarkBtn_1hhf0_2270:hover{background-color:var(--color-bg);color:var(--color-text)}._bookmarkActive_1hhf0_2288{background-color:var(--color-primary-10);color:var(--color-primary)}._pinBtn_1hhf0_2293{width:26px;height:26px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;display:flex}._pinBtn_1hhf0_2293:hover{background-color:var(--color-bg);color:var(--color-text)}._pinActive_1hhf0_2311{background-color:var(--color-primary-10);color:var(--color-primary)}._editBtn_1hhf0_2316{width:26px;height:26px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;display:flex}._editBtn_1hhf0_2316:hover{background-color:var(--color-bg);color:var(--color-text)}._cardActions_1hhf0_2334{align-items:center;gap:4px;display:flex}._cardTitle_1hhf0_2340{color:var(--color-text);letter-spacing:-.01em;margin:0;padding:0 20px 8px;font-size:17px;font-weight:700;line-height:1.3}._cardBody_1hhf0_142{color:var(--color-text-mid);white-space:pre-wrap;word-break:break-word;margin:0;padding:0 20px 12px;font-size:12.5px;line-height:1.6}._ackBanner_1hhf0_2360{background-color:var(--color-bg);border:1px solid var(--color-border);color:var(--color-text);border-radius:9px;justify-content:space-between;align-items:center;gap:10px;margin:0 20px 12px;padding:10px 12px;font-size:12px;font-weight:600;display:flex}._ackBtn_1hhf0_2375{background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;white-space:nowrap;border:none;border-radius:7px;padding:6px 12px;font-size:11px;font-weight:700}._ackDone_1hhf0_2387{background-color:var(--color-success-soft);border:1px solid color-mix(in srgb, var(--color-success) 20%, transparent);color:var(--color-success);border-radius:9px;align-items:center;gap:8px;margin:0 20px 12px;padding:8px 12px;font-size:11px;font-weight:700;display:flex}._summary_1hhf0_2401{color:var(--color-text-soft);justify-content:space-between;align-items:center;margin:0 20px;padding:2px 0 10px;font-size:11px;display:flex}._summaryLeft_1hhf0_2411{align-items:center;gap:6px;display:flex}._summaryIcons_1hhf0_2417{align-items:center;display:flex}._summaryDot_1hhf0_2422{background-color:var(--react-color,var(--color-primary));width:19px;height:19px;color:var(--color-on-primary);border:2px solid var(--color-surface);border-radius:50%;justify-content:center;align-items:center;display:flex}._summaryDot_1hhf0_2422:not(:first-child){margin-left:-5px}._summaryCount_1hhf0_2438{color:var(--color-text-mid);font-weight:600}._summaryComments_1hhf0_2443{color:var(--color-text-soft)}._summaryCommentsClickable_1hhf0_2447{cursor:pointer;-webkit-user-select:none;user-select:none}._summaryCommentsClickable_1hhf0_2447:hover{color:#045d5e}._postBar_1hhf0_2457{border-top:1px solid var(--color-divider);align-items:center;gap:6px;padding:6px 10px;display:flex}._reactWrap_1hhf0_2465{flex:1;display:flex;position:relative}._actionBtn_1hhf0_2471{color:var(--color-text-mid);cursor:pointer;background:0 0;border:none;border-radius:7px;flex:1;justify-content:center;align-items:center;gap:6px;padding:9px 10px;font-size:11.5px;font-weight:600;display:flex}._actionBtn_1hhf0_2471:hover{background-color:var(--color-surface-muted)}._actionBtn_1hhf0_2471:active{transform:scale(.97)}._actionActive_1hhf0_2495{background-color:color-mix(in srgb, var(--react-color,var(--color-primary)) 12%, transparent);color:var(--react-color,var(--color-primary))}._actionActive_1hhf0_2495:hover{background-color:color-mix(in srgb, var(--react-color,var(--color-primary)) 16%, transparent)}._picker_1hhf0_2512{background-color:var(--color-surface);border-radius:var(--radius-full);border:1px solid var(--color-border);box-shadow:var(--shadow-lg);z-index:10;opacity:0;transform-origin:0 100%;pointer-events:none;gap:4px;padding:5px;transition:opacity .16s,transform .16s;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;transform:translateY(6px)scale(.96)}._picker_1hhf0_2512:before{content:"";height:10px;position:absolute;top:100%;left:0;right:0}._pickerVisible_1hhf0_2544{opacity:1;pointer-events:auto;transform:translateY(0)scale(1)}._pickerBtn_1hhf0_2550{width:36px;height:36px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;transition:transform .14s,background-color .14s;display:flex}._pickerBtn_1hhf0_2550:hover{background-color:color-mix(in srgb, var(--react-color) 14%, transparent);color:var(--react-color);transform:scale(1.25)translateY(-2px)}._pickerActive_1hhf0_2572{background-color:color-mix(in srgb, var(--react-color) 16%, transparent);color:var(--react-color)}@media (width<=768px){._toolbar_1hhf0_8{padding:10px 14px}}@media (width<=640px){._wrapper_1hhf0_70{padding:14px 12px 40px}._cardHead_1hhf0_2205{padding:14px 14px 8px}._cardTitle_1hhf0_2340{padding:0 14px 8px}._cardBody_1hhf0_142{padding:0 14px 12px}._summary_1hhf0_2401{margin:0 14px}._postBar_1hhf0_2457{padding:4px 6px}._actionBtn_1hhf0_2471{padding:9px 6px}}._schedule_1hhf0_2615{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:12px;margin:0 16px 12px;padding:14px;display:flex}._scheduleHead_1hhf0_2626{letter-spacing:.08em;color:var(--color-text-soft);align-items:center;gap:6px;font-size:10px;font-weight:700;display:flex}._scheduleHead_1hhf0_2626 svg{color:var(--color-primary)}._scheduleGrid_1hhf0_2640{grid-template-columns:1fr 1fr;gap:12px;display:grid}._scheduleField_1hhf0_2646{flex-direction:column;gap:5px;display:flex}._scheduleLabel_1hhf0_2652{font-size:var(--font-xs);color:var(--color-text-mid);font-weight:600}._scheduleInput_1hhf0_2658{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:100%;color:var(--color-text);padding:9px 12px;font-family:inherit;font-size:13px}._scheduleInput_1hhf0_2658:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px var(--color-primary-10);outline:none}._scheduleRow_1hhf0_2675{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);justify-content:space-between;align-items:center;padding:10px 12px;display:flex}._scheduleRowLabel_1hhf0_2685{color:var(--color-text);align-items:center;gap:7px;font-size:12.5px;font-weight:600;display:inline-flex}._scheduleRowLabel_1hhf0_2685 svg{color:var(--color-text-soft)}._switch_1hhf0_2698{border-radius:var(--radius-full);background-color:var(--color-border-strong);cursor:pointer;border:none;flex-shrink:0;width:38px;height:22px;transition:background-color .18s;position:relative}._switchOn_1hhf0_2710{background-color:var(--color-primary)}._switchKnob_1hhf0_2714{background-color:#fff;border-radius:50%;width:16px;height:16px;transition:transform .18s;position:absolute;top:3px;left:3px}._switchOn_1hhf0_2710 ._switchKnob_1hhf0_2714{transform:translate(16px)}._scheduleFreq_1hhf0_2729{align-self:flex-start}._scheduleTz_1hhf0_2733{font-size:var(--font-xs);color:var(--color-text-soft);align-items:center;gap:6px;display:flex}._scheduleTz_1hhf0_2733 strong{color:var(--color-text-mid);font-weight:700}._tagSearch_1hhf0_2747{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);align-items:center;gap:8px;margin-bottom:12px;padding:8px 12px;display:flex}._tagSearchInput_1hhf0_2758{font-size:var(--font-sm);color:var(--color-text);background:0 0;border:none;outline:none;flex:1}._tagList_1hhf0_2767{flex-direction:column;gap:6px;max-height:240px;display:flex;overflow-y:auto}._tagRow_1hhf0_2775{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);cursor:pointer;text-align:left;justify-content:space-between;align-items:center;width:100%;padding:8px 12px;display:flex}._tagRow_1hhf0_2775:hover{background-color:var(--color-surface-muted)}._tagRowActive_1hhf0_2792{background-color:color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));border-color:var(--color-primary-22)}._tagRowContent_1hhf0_2797{align-items:center;gap:12px;display:flex}._tagAvatar_1hhf0_2803{background-color:var(--avatar-color,#ccc);color:#fff;width:32px;height:32px;font-size:var(--font-xs);border-radius:50%;justify-content:center;align-items:center;font-weight:700;display:flex}._tagInfo_1hhf0_2816{flex-direction:column;display:flex}._tagName_1hhf0_2821{font-size:var(--font-sm);color:var(--color-text);font-weight:600}._tagRole_1hhf0_2827{font-size:var(--font-xs);color:var(--color-text-soft)}._tagCheckbox_1hhf0_2832{border:2px solid var(--color-border);color:#0000;border-radius:4px;justify-content:center;align-items:center;width:18px;height:18px;display:flex}._tagCheckboxActive_1hhf0_2843{border-color:var(--color-primary);background-color:var(--color-primary);color:#fff}._postImagesGrid_1hhf0_2850{border-radius:var(--radius-lg);aspect-ratio:16/10;gap:6px;width:100%;max-height:500px;margin-top:12px;margin-bottom:14px;display:grid;overflow:hidden}@media (width<=600px){._postImagesGrid_1hhf0_2850{aspect-ratio:4/3;max-height:320px}}._grid1_1hhf0_2869{grid-template-columns:1fr}._grid2_1hhf0_2872{grid-template-columns:1fr 1fr}._grid3_1hhf0_2875{grid-template-rows:1fr 1fr;grid-template-columns:1.5fr 1fr}._grid4_1hhf0_2879{grid-template-rows:1fr 1fr;grid-template-columns:1fr 1fr}._gridImageWrap_1hhf0_2884{cursor:pointer;background-color:var(--color-surface-hover);width:100%;height:100%;position:relative;overflow:hidden}._gridImage_1hhf0_2884{object-fit:cover;width:100%;height:100%;transition:transform .3s}._gridImageWrap_1hhf0_2884:hover ._gridImage_1hhf0_2884{transform:scale(1.02)}._grid3_1hhf0_2875 ._gridImageWrap_1hhf0_2884:first-child{grid-row:span 2}._moreImagesOverlay_1hhf0_2910:before{content:attr(data-more);color:#fff;z-index:2;background:#0009;justify-content:center;align-items:center;font-size:24px;font-weight:700;transition:background .3s;display:flex;position:absolute;inset:0}._moreImagesOverlay_1hhf0_2910:hover:before{background:#00000080}._lightboxOverlay_1hhf0_2933{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:10000;-webkit-user-select:none;user-select:none;background-color:#0a0f1ebf;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}._lightboxContainer_1hhf0_2948{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);width:92vw;max-width:1200px;height:85vh;display:flex;position:relative;overflow:hidden;box-shadow:0 25px 50px -12px #00000080}._lightboxLeft_1hhf0_2961{background-color:#0c0d12;flex:1.5;justify-content:center;align-items:center;height:100%;display:flex;position:relative}._lightboxRight_1hhf0_2971{background-color:var(--color-surface);border-left:1px solid var(--color-divider);flex-direction:column;flex:1;height:100%;display:flex;overflow-y:auto}._lightboxScrollableContent_1hhf0_2981{flex-direction:column;gap:16px;padding:24px;display:flex}._lightboxScrollableContent_1hhf0_2981 header{padding-right:48px}._lightboxDivider_1hhf0_2992{background-color:var(--color-divider);height:1px;margin:8px 0}@media (width<=900px){._lightboxContainer_1hhf0_2948{flex-direction:column;width:95vw;height:95vh}._lightboxLeft_1hhf0_2961{flex:1;min-height:250px}._lightboxRight_1hhf0_2971{border-left:none;border-top:1px solid var(--color-divider);flex:1.5}._lightboxClose_1hhf0_3016{color:#ffffffe6;background:#0006;top:12px;right:12px}._lightboxClose_1hhf0_3016:hover{color:#fff;background:#0009}}._lightboxImage_1hhf0_3029{object-fit:contain;border-radius:var(--radius-lg);border:1px solid #ffffff26;max-width:85%;max-height:80%;box-shadow:0 25px 50px -12px #000000b3,0 0 0 1px #ffffff14}._lightboxClose_1hhf0_3016{background:var(--color-bg-hover,#0000000d);color:var(--color-text-soft,#65676b);cursor:pointer;z-index:10002;border:none;border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;transition:all .2s;display:flex;position:absolute;top:16px;right:16px}._lightboxClose_1hhf0_3016:hover{background:var(--color-bg-hover-strong,#0000001a);color:var(--color-text,#1c1e21);transform:scale(1.05)}._lightboxArrow_1hhf0_3064{color:#fff;cursor:pointer;z-index:10001;background:#ffffff14;border:1px solid #ffffff0d;border-radius:50%;justify-content:center;align-items:center;width:52px;height:52px;transition:all .2s cubic-bezier(.4,0,.2,1);display:flex;position:absolute;top:50%;transform:translateY(-50%)}._lightboxArrow_1hhf0_3064:hover{background:#ffffff2e}._lightboxArrowLeft_1hhf0_3086{left:24px}._lightboxArrowLeft_1hhf0_3086:hover{transform:translateY(-50%)scale(1.08)}._lightboxArrowRight_1hhf0_3094{right:24px}._lightboxArrowRight_1hhf0_3094:hover{transform:translateY(-50%)scale(1.08)}._lightboxCounter_1hhf0_3102{color:#fffffff2;z-index:10001;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);letter-spacing:.05em;background-color:#ffffff14;border:1px solid #ffffff1f;border-radius:9999px;padding:6px 14px;font-size:13px;font-weight:600;position:absolute;bottom:24px;box-shadow:0 4px 12px #0003}._templateSheet_1hhf0_3120{flex-direction:column;gap:0;display:flex}._templateSheetHeader_1hhf0_3126{border-bottom:1px solid var(--color-border);align-items:flex-start;gap:10px;padding:12px 14px 10px;display:flex}._templateBackBtn_1hhf0_3134{border:1px solid var(--color-border);border-radius:var(--radius-sm);width:28px;height:28px;color:var(--color-text-soft);cursor:pointer;background:0 0;flex-shrink:0;justify-content:center;align-items:center;margin-top:2px;transition:background-color .15s,color .15s;display:flex}._templateBackBtn_1hhf0_3134:hover{background-color:var(--color-surface-muted);color:var(--color-text)}._templateSheetTitle_1hhf0_3157{font-size:var(--font-xs);color:var(--color-text-mid);letter-spacing:.06em;text-transform:uppercase;font-weight:700;display:block}._templateSheetMeta_1hhf0_3166{font-size:var(--font-xs);color:var(--color-text-soft);margin-top:2px;display:block}._templateSheetMeta_1hhf0_3166 strong{color:var(--color-primary);font-weight:600}._templateSearch_1hhf0_3178{border-bottom:1px solid var(--color-border);padding:8px 14px;position:relative}._templateSearchIcon_1hhf0_3184{color:var(--color-text-soft);pointer-events:none;position:absolute;top:50%;left:26px;transform:translateY(-50%)}._templateSearchInput_1hhf0_3193{border:1px solid var(--color-border);border-radius:var(--radius-sm);background-color:var(--color-surface-muted);width:100%;color:var(--color-text);font-size:var(--font-sm);box-sizing:border-box;outline:none;padding:6px 10px 6px 30px;transition:border-color .15s}._templateSearchInput_1hhf0_3193:focus{border-color:var(--color-primary)}._templateList_1hhf0_3210{flex-direction:column;max-height:240px;display:flex;overflow-y:auto}._templateItem_1hhf0_3217{border-bottom:1px solid var(--color-border);cursor:pointer;text-align:left;background:0 0;border-top:none;border-left:none;border-right:none;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;transition:background-color .12s;display:flex}._templateItem_1hhf0_3217:last-child{border-bottom:none}._templateItem_1hhf0_3217:hover{background-color:var(--color-surface-muted)}._templateItemBody_1hhf0_3241{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._templateItemTitle_1hhf0_3249{font-size:var(--font-sm);color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-weight:600;overflow:hidden}._templateItemSub_1hhf0_3258{font-size:var(--font-xs);color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}._templateUseBtn_1hhf0_3266{border-radius:var(--radius-sm);background-color:var(--color-primary);color:#fff;letter-spacing:.06em;cursor:pointer;border:none;flex-shrink:0;align-items:center;gap:4px;padding:4px 10px;font-size:10px;font-weight:700;transition:opacity .15s;display:flex}._templateUseBtn_1hhf0_3266:hover{opacity:.85}._templateEmpty_1hhf0_3287{text-align:center;font-size:var(--font-sm);color:var(--color-text-soft);padding:20px 14px}._itemIconContainer_1hhf0_3294{border-radius:var(--radius-md);background-color:color-mix(in srgb, var(--color-primary) 10%, transparent);width:32px;height:32px;color:var(--color-primary);flex-shrink:0;justify-content:center;align-items:center;display:flex}._itemBadge_1hhf0_3306{border-radius:var(--radius-sm);background-color:var(--color-surface-muted);color:var(--color-text-soft);max-width:fit-content;padding:2px 6px;font-size:10px;font-weight:500}._itemMetaRow_1hhf0_3316{flex-wrap:wrap;gap:6px;margin-top:4px;display:flex}._lightboxOverlay_18fqf_5{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:10000;-webkit-user-select:none;user-select:none;background-color:#0a0f1ebf;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}._lightboxContainer_18fqf_20{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);width:92vw;max-width:1200px;height:85vh;display:flex;position:relative;overflow:hidden;box-shadow:0 25px 50px -12px #00000080}._lightboxLeft_18fqf_33{background-color:#0c0d12;flex:1.5;justify-content:center;align-items:center;height:100%;display:flex;position:relative}._lightboxRight_18fqf_43{background-color:var(--color-surface);border-left:1px solid var(--color-divider);flex-direction:column;flex:1;height:100%;display:flex;overflow-y:auto}._lightboxScrollableContent_18fqf_53{flex-direction:column;gap:16px;padding:24px;display:flex}._lightboxScrollableContent_18fqf_53 header{padding-right:48px}._lightboxDivider_18fqf_64{background-color:var(--color-divider);height:1px;margin:8px 0}@media (width<=900px){._lightboxContainer_18fqf_20{flex-direction:column;width:95vw;height:95vh}._lightboxLeft_18fqf_33{flex:1;min-height:250px}._lightboxRight_18fqf_43{border-left:none;border-top:1px solid var(--color-divider);flex:1.5}._lightboxClose_18fqf_88{color:#ffffffe6;background:#0006;top:12px;right:12px}._lightboxClose_18fqf_88:hover{color:#fff;background:#0009}}._lightboxImage_18fqf_101{object-fit:contain;border-radius:var(--radius-lg);border:1px solid #ffffff26;max-width:85%;max-height:80%;box-shadow:0 25px 50px -12px #000000b3,0 0 0 1px #ffffff14}._lightboxClose_18fqf_88{background:var(--color-bg-hover,#0000000d);color:var(--color-text-soft,#65676b);cursor:pointer;z-index:10002;border:none;border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;transition:all .2s;display:flex;position:absolute;top:16px;right:16px}._lightboxClose_18fqf_88:hover{background:var(--color-bg-hover-strong,#0000001a);color:var(--color-text,#1c1e21);transform:scale(1.05)}._lightboxArrow_18fqf_136{color:#fff;cursor:pointer;z-index:10001;background:#ffffff14;border:1px solid #ffffff0d;border-radius:50%;justify-content:center;align-items:center;width:52px;height:52px;transition:all .2s cubic-bezier(.4,0,.2,1);display:flex;position:absolute;top:50%;transform:translateY(-50%)}._lightboxArrow_18fqf_136:hover{background:#ffffff2e}._lightboxArrowLeft_18fqf_158{left:24px}._lightboxArrowLeft_18fqf_158:hover{transform:translateY(-50%)scale(1.08)}._lightboxArrowRight_18fqf_166{right:24px}._lightboxArrowRight_18fqf_166:hover{transform:translateY(-50%)scale(1.08)}._lightboxCounter_18fqf_174{color:#fffffff2;z-index:10001;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);letter-spacing:.05em;background-color:#ffffff14;border:1px solid #ffffff1f;border-radius:9999px;padding:6px 14px;font-size:13px;font-weight:600;position:absolute;bottom:24px;box-shadow:0 4px 12px #0003}._skeletonCard_7d381_1{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);flex-direction:column;gap:16px;padding:16px;display:flex}._skeletonHeader_7d381_11{align-items:center;gap:12px;display:flex}._skeletonAvatar_7d381_17{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:40px;height:40px;animation:1.5s ease-in-out infinite _pulse_7d381_1}._skeletonMeta_7d381_25{flex-direction:column;flex:1;gap:6px;display:flex}._skeletonLine_7d381_32{background-color:var(--color-surface-muted);border-radius:var(--radius-sm);height:12px;animation:1.5s ease-in-out infinite _pulse_7d381_1}._skeletonLine_7d381_32._short_7d381_39{width:40%}._skeletonLine_7d381_32._medium_7d381_43{width:70%}._skeletonLine_7d381_32._full_7d381_47{width:100%}._skeletonBody_7d381_51{flex-direction:column;gap:8px;display:flex}@keyframes _pulse_7d381_1{0%,to{opacity:1}50%{opacity:.5}}._bookCard_g1hkd_7{border:1px solid var(--color-border);border-radius:var(--radius-xl);background-color:var(--color-surface);box-shadow:var(--shadow-md);margin:20px 24px 24px;overflow:hidden}._bookTopBar_g1hkd_16{border-bottom:1px solid var(--color-divider);background:linear-gradient(180deg, var(--color-primary-05), transparent);justify-content:space-between;align-items:center;gap:12px;padding:13px 18px;display:flex}._bookGrid_g1hkd_26{grid-template-columns:256px 1fr 236px;display:grid}._colCalendar_g1hkd_31{border-left:1px solid var(--color-divider);border-right:1px solid var(--color-divider);padding:18px 22px}._search_g1hkd_37{margin-bottom:12px;position:relative}._searchIcon_g1hkd_42{color:var(--color-text-soft);position:absolute;top:50%;left:11px;transform:translateY(-50%)}._searchInput_g1hkd_50{border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);border-radius:8px;outline:none;padding:8px 10px 8px 32px;font-size:12px}._contactList_g1hkd_61{flex-direction:column;flex:1;gap:4px;min-height:0;max-height:440px;display:flex;overflow:hidden auto}._contactRow_g1hkd_72{border-radius:var(--radius-md);cursor:pointer;text-align:left;background:0 0;border:1.5px solid #0000;align-items:center;gap:12px;padding:9px 12px;transition:background-color .15s,border-color .15s;display:flex}._contactRow_g1hkd_72:hover{background-color:var(--color-surface-muted)}._contactActive_g1hkd_91{background-color:var(--color-primary-10);border-color:var(--color-primary-border)}._contactAvatar_g1hkd_96{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);letter-spacing:.02em;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:12.5px;font-weight:700;display:flex}._contactText_g1hkd_112{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._contactName_g1hkd_120{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;line-height:1.25;overflow:hidden}._contactActive_g1hkd_91 ._contactName_g1hkd_120{color:var(--color-primary);font-weight:700}._contactRole_g1hkd_135{color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:1.2;overflow:hidden}._contactCheck_g1hkd_144{border:2px solid var(--color-border-strong);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:20px;height:20px;transition:border-color .15s,background-color .15s;display:flex}._contactCheckOn_g1hkd_158{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-on-primary)}._contactCheckIcon_g1hkd_164{justify-content:center;align-items:center;display:inline-flex}._contactEmpty_g1hkd_170{color:var(--color-text-soft);margin:8px 4px;font-size:12px}._calHead_g1hkd_177{justify-content:space-between;align-items:center;margin-bottom:12px;display:flex}._calMonth_g1hkd_184{color:var(--color-text);font-size:14px;font-weight:600}._calNav_g1hkd_190{gap:4px;display:flex}._calNavBtn_g1hkd_195{border:1px solid var(--color-border);background-color:var(--color-surface);width:26px;height:26px;color:var(--color-text-mid);cursor:pointer;border-radius:6px;justify-content:center;align-items:center;display:flex}._calDays_g1hkd_208{grid-template-columns:repeat(7,1fr);margin-bottom:4px;display:grid}._calDayLabel_g1hkd_214{text-align:center;color:var(--color-text-soft);padding:6px 0;font-size:11px;font-weight:600}._calGrid_g1hkd_222{grid-template-columns:repeat(7,1fr);gap:2px;display:grid}._calCell_g1hkd_228{width:36px;height:36px;color:var(--color-text);cursor:pointer;background:0 0;border:1.5px solid #0000;border-radius:50%;justify-content:center;align-items:center;margin:auto;font-size:12px;font-weight:500;display:flex}._calCell_g1hkd_228:hover{background-color:var(--color-surface-muted)}._calCellToday_g1hkd_248{border-color:var(--color-secondary);color:var(--color-secondary);font-weight:700}._calCellSelected_g1hkd_254,._calCellSelected_g1hkd_254:hover{background-color:var(--color-secondary);color:var(--color-on-primary);border-color:#0000;font-weight:700}._calCellPast_g1hkd_262{color:var(--color-text-very-soft);cursor:not-allowed}._calCellBlank_g1hkd_267{visibility:hidden}._bookBar_g1hkd_272{border-top:1px solid var(--color-divider);background:linear-gradient(0deg, var(--color-primary-05), transparent);justify-content:space-between;align-items:center;gap:12px;padding:14px 18px;display:flex}._bookHint_g1hkd_282{color:var(--color-text-soft);font-size:12.5px}._bookSummary_g1hkd_287{color:var(--color-text-mid);align-items:center;gap:6px;font-size:12.5px;display:flex}._bookSummaryName_g1hkd_295{color:var(--color-text);font-weight:600}._bookSummarySlot_g1hkd_300{color:var(--color-primary);font-weight:600}._bookBtn_g1hkd_305{border-radius:var(--radius-md);background:linear-gradient(135deg, var(--color-primary), var(--color-primary-light));color:var(--color-on-primary);cursor:pointer;border:none;align-items:center;gap:7px;padding:10px 24px;font-size:12.5px;font-weight:700;display:flex;box-shadow:0 4px 14px #045d5e38}._bookBtn_g1hkd_305:disabled{background:var(--color-primary-20);box-shadow:none;cursor:not-allowed}._confirmBody_g1hkd_327{flex-direction:column;gap:16px;display:flex}._confirmWho_g1hkd_333{border-radius:var(--radius-lg);background:linear-gradient(135deg, var(--color-primary-10), var(--color-primary-05));border:1px solid var(--color-primary-border);align-items:center;gap:12px;padding:14px;display:flex}._confirmAvatar_g1hkd_343{background-color:var(--avatar-color);width:44px;height:44px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:15px;font-weight:700;display:flex}._confirmWhoText_g1hkd_357{flex-direction:column;gap:2px;min-width:0;display:flex}._confirmName_g1hkd_364{color:var(--color-text);font-size:15px;font-weight:700}._confirmRole_g1hkd_370{color:var(--color-text-soft);font-size:12px}._confirmRows_g1hkd_375{flex-direction:column;display:flex}._confirmRow_g1hkd_375{border-bottom:1px solid var(--color-divider);align-items:center;gap:10px;padding:10px 2px;display:flex}._confirmRow_g1hkd_375:last-child{border-bottom:none}._confirmRowIcon_g1hkd_392{border-radius:var(--radius-md);background-color:var(--color-surface-muted);width:30px;height:30px;color:var(--color-primary);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._confirmRowLabel_g1hkd_404{width:76px;color:var(--color-text-soft);flex-shrink:0;font-size:12.5px;font-weight:600}._confirmRowValue_g1hkd_412{min-width:0;color:var(--color-text);flex:1;font-size:12.5px;font-weight:600}._bookedNote_g1hkd_420{color:var(--color-success);align-items:center;gap:6px;font-size:12.5px;font-weight:700;display:inline-flex}._typeSelector_g1hkd_430{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:8px;padding:3px;display:inline-flex}._typeBtn_g1hkd_438{color:var(--color-text-soft);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:6px;padding:5px 12px;font-size:11.5px;font-weight:500}._typeBtn_g1hkd_438:hover{color:var(--color-text)}._typeBtnActive_g1hkd_456{background-color:var(--color-surface);color:var(--color-primary);box-shadow:var(--shadow-sm);font-weight:600}@media (width>=1440px){._contactList_g1hkd_61{max-height:460px}}@media (width<=1024px){._bookGrid_g1hkd_26{grid-template-columns:1fr}._colCalendar_g1hkd_31{border-left:none;border-right:none;border-top:1px solid var(--color-divider);border-bottom:1px solid var(--color-divider)}}@media (width<=768px){._bookCard_g1hkd_7{margin:12px 10px}._bookGrid_g1hkd_26{grid-template-columns:1fr}._colCalendar_g1hkd_31{border-left:none;border-right:none;border-top:1px solid var(--color-divider);border-bottom:1px solid var(--color-divider)}._bookBar_g1hkd_272{text-align:center;flex-direction:column;align-items:stretch;gap:10px}._bookBtn_g1hkd_305{justify-content:center}}._col_18ut1_6{flex-direction:column;min-width:0;padding:18px;display:flex}._colTitle_18ut1_13{color:var(--color-text);align-items:center;margin-bottom:12px;font-size:13.5px;font-weight:700;display:flex}._stepDot_18ut1_22{background-color:var(--color-primary-10);width:18px;height:18px;color:var(--color-primary);border-radius:50%;justify-content:center;align-items:center;margin-right:8px;font-size:10px;font-weight:800;display:inline-flex}._titleWrap_18nb9_3{margin-bottom:10px}._titleInput_18nb9_7{width:100%;padding-left:10px}._wizardContainer_pyr7v_8{background-color:var(--color-surface);border-radius:0 0 12px 12px;flex-direction:column;flex:1;display:flex;overflow:hidden}._stepper_pyr7v_17{background-color:var(--color-surface-muted);border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:center;gap:12px;padding:16px 24px;display:flex}._stepItem_pyr7v_27{flex-shrink:0;align-items:center;gap:8px;display:flex}._stepLine_pyr7v_34{background-color:var(--color-border);flex:1;height:2px}._stepLineActive_pyr7v_40{background-color:var(--color-primary)}._stepCircle_pyr7v_44{background-color:var(--color-surface);border:2px solid var(--color-border);width:24px;height:24px;color:var(--color-text-soft);transition:all var(--dur-fast) var(--ease-out);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:11px;font-weight:700;display:flex}._stepCircleActive_pyr7v_60{border-color:var(--color-primary);color:var(--color-primary);box-shadow:0 0 0 3px var(--color-primary-soft)}._stepCircleDone_pyr7v_66{background-color:var(--color-primary);border-color:var(--color-primary);color:#fff}._stepText_pyr7v_72{color:var(--color-text-soft);font-size:12px;font-weight:500}._stepTextActive_pyr7v_78{color:var(--color-text);font-weight:600}._wizardContent_pyr7v_83{flex-direction:column;flex:1;display:flex;overflow:hidden}._wizardRow_pyr7v_90{flex:1;display:flex;overflow:hidden}._wizardPanelLeft_pyr7v_96{border-right:1px solid var(--color-border);background-color:var(--color-surface);flex-direction:column;flex:1;padding:16px;display:flex;overflow:hidden}._wizardPanelRight_pyr7v_106{background-color:var(--color-surface-muted);flex-direction:column;width:320px;display:flex;overflow:hidden}._timePanelLeft_pyr7v_114{flex:0 0 240px}._timePanelLeft_pyr7v_114 ._wizardList_pyr7v_118{max-height:480px}@media (width>=1440px){._timePanelLeft_pyr7v_114 ._wizardList_pyr7v_118{max-height:580px}}._timePanelRight_pyr7v_128{flex:1}._panelHeading_pyr7v_132{color:var(--color-text);margin:0 0 4px;font-size:15px;font-weight:700}._wizardSearch_pyr7v_139{border:1px solid var(--color-border);background-color:var(--color-surface-muted);width:100%;color:var(--color-text);border-radius:6px;margin-top:8px;padding:8px 12px;font-size:12px}._wizardList_pyr7v_118{flex-direction:column;flex:1;gap:4px;max-height:440px;display:flex;overflow-y:auto}._wizardListBtn_pyr7v_159{cursor:pointer;width:100%;transition:all var(--dur-fast) var(--ease-out);background:0 0;border:1px solid #0000;border-radius:8px;align-items:center;gap:12px;padding:10px;display:flex}._wizardListBtn_pyr7v_159:hover{background-color:var(--color-surface-hover)}._wizardListBtnActive_pyr7v_176{background-color:var(--color-primary-soft);border-color:var(--color-primary-soft-border)}._avatar_pyr7v_181{color:#fff;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;font-size:12px;font-weight:700;display:inline-flex}._avatarSmall_pyr7v_193{color:#fff;border-radius:50%;justify-content:center;align-items:center;width:26px;height:26px;font-size:11px;font-weight:700;display:inline-flex}._contactName_pyr7v_205{color:var(--color-text);font-size:12.5px;font-weight:600}._contactRole_pyr7v_211{color:var(--color-text-soft);margin-top:1px;font-size:11px}._checkbox_pyr7v_217{border:1.5px solid var(--color-border-strong);width:16px;height:16px;transition:all var(--dur-fast) var(--ease-out);border-radius:4px;justify-content:center;align-items:center;display:flex}._checkboxActive_pyr7v_228{background-color:var(--color-primary);border-color:var(--color-primary);color:#fff}._panelHeader_pyr7v_234{border-bottom:1px solid var(--color-border);letter-spacing:.04em;color:var(--color-text-soft);justify-content:space-between;align-items:center;padding:16px;font-size:11px;font-weight:700;display:flex}._badge_pyr7v_246{background-color:var(--color-primary-soft);color:var(--color-primary);border-radius:12px;padding:2px 6px;font-size:10px}._selectedGrid_pyr7v_254{flex-direction:column;flex:1;gap:8px;max-height:485px;padding:12px;display:flex;overflow-y:auto}@media (width>=1440px){._wizardList_pyr7v_118{max-height:460px}._selectedGrid_pyr7v_254{max-height:505px}}._selectedEmpty_pyr7v_274{text-align:center;color:var(--color-text-soft);flex-direction:column;align-items:center;padding:32px 16px;font-size:11px;line-height:1.5;display:flex}._selectedEmptyIcon_pyr7v_285{color:var(--color-text-soft);opacity:.5;margin-bottom:8px}._selectedItemCard_pyr7v_291{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:6px;align-items:center;gap:8px;padding:8px;display:flex}._cardName_pyr7v_301{color:var(--color-text);text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;font-weight:600;overflow:hidden}._cardRole_pyr7v_310{color:var(--color-text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}._removeBtn_pyr7v_318{color:var(--color-text-soft);cursor:pointer;transition:all var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;padding:4px;display:flex}._removeBtn_pyr7v_318:hover{background-color:var(--color-danger-soft);color:var(--color-danger)}._attendeeStatusItem_pyr7v_337{background-color:var(--color-surface-muted);border-radius:6px;align-items:center;gap:8px;padding:8px;display:flex}._statusIndicator_pyr7v_346{background-color:var(--color-border-strong);border-radius:50%;width:8px;height:8px}._statusIndicatorAvail_pyr7v_353{background-color:var(--color-success)}._statusIndicatorBusy_pyr7v_357{background-color:var(--color-danger)}._statusIndicatorOoh_pyr7v_361{background-color:var(--color-text-soft);opacity:.5}._gridToolbar_pyr7v_366{border-bottom:1px solid var(--color-border);background-color:var(--color-surface);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;padding:12px 16px;display:flex}._datePickerInput_pyr7v_377{border:1px solid var(--color-border);color:var(--color-text);background-color:var(--color-surface-muted);border-radius:6px;padding:4px 8px;font-size:12px}._durationSelector_pyr7v_386{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:6px;padding:2px;display:inline-flex}._durBtn_pyr7v_394{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:4px;padding:4px 8px;font-size:11px;font-weight:600}._durBtnActive_pyr7v_405{background-color:var(--color-surface);color:var(--color-primary);box-shadow:var(--shadow-sm)}._legend_pyr7v_411{align-items:center;gap:12px;font-size:11px;display:flex}._legendItem_pyr7v_418{color:var(--color-text-soft);align-items:center;gap:4px;display:flex}._dotAvail_pyr7v_425,._dotBusy_pyr7v_426,._dotOoh_pyr7v_427{border-radius:50%;width:8px;height:8px}._dotAvail_pyr7v_425{background-color:var(--color-success)}._dotBusy_pyr7v_426{background-color:var(--color-danger)}._dotOoh_pyr7v_427{background-color:var(--color-border-strong)}._suggestedStrip_pyr7v_443{border-bottom:1px solid var(--color-border);background-color:var(--color-surface-muted);padding:12px 16px}._suggestedRow_pyr7v_449{gap:8px;padding-bottom:4px;display:flex;overflow-x:auto}._suggestedCard_pyr7v_456{background-color:var(--color-surface);border:1px solid var(--color-border);text-align:left;cursor:pointer;min-width:140px;transition:all var(--dur-fast) var(--ease-out);border-radius:8px;flex-shrink:0;padding:8px 12px}._suggestedCard_pyr7v_456:hover{border-color:var(--color-primary)}._suggestedCardActive_pyr7v_472{background-color:var(--color-primary);border-color:var(--color-primary);color:#fff;box-shadow:var(--shadow-md)}._suggestedCardFree_pyr7v_479{border-color:var(--color-success-border);background-color:var(--color-success-soft)}._suggestedCardActive_pyr7v_472._suggestedCardFree_pyr7v_479{background-color:var(--color-primary);color:#fff}._gridEmpty_pyr7v_489{color:var(--color-text-soft);text-align:center;flex-direction:column;justify-content:center;align-items:center;padding:64px 32px;font-size:12px;display:flex}._wizardConfirmContainer_pyr7v_501{width:100%;max-width:580px;margin:0 auto;padding:24px;overflow-y:auto}._confirmHeading_pyr7v_509{color:var(--color-text);margin:0 0 4px;font-size:18px;font-weight:700}._confirmSub_pyr7v_516{color:var(--color-text-soft);margin:0 0 20px;font-size:12px}._confirmCard_pyr7v_522{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:12px;flex-direction:column;gap:16px;padding:16px;display:flex}._confirmRow_pyr7v_532{border-bottom:1px solid var(--color-border);flex-direction:column;gap:4px;padding-bottom:12px;display:flex}._confirmLabel_pyr7v_540{letter-spacing:.04em;color:var(--color-text-soft);text-transform:uppercase;font-size:10px;font-weight:700}._confirmVal_pyr7v_548{color:var(--color-text);font-size:13.5px;font-weight:500}._confirmAttendeeBadge_pyr7v_554{background-color:var(--color-surface);border:1px solid var(--color-border);color:var(--color-text);border-radius:6px;align-items:center;gap:6px;padding:4px 8px;font-size:11.5px;font-weight:600;display:inline-flex}._avatarTiny_pyr7v_567{color:#fff;border-radius:50%;justify-content:center;align-items:center;width:18px;height:18px;font-size:9px;font-weight:700;display:inline-flex}._wizardFooter_pyr7v_580{background-color:var(--color-surface-muted);border-top:1px solid var(--color-border);justify-content:space-between;align-items:center;padding:12px 24px;display:flex}._wizardBackBtn_pyr7v_589{border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-soft);cursor:pointer;transition:all var(--dur-fast);border-radius:8px;align-items:center;gap:6px;padding:8px 14px;font-size:12px;font-weight:600;display:inline-flex}._wizardBackBtn_pyr7v_589:hover{background-color:var(--color-surface-hover);color:var(--color-text)}._wizardNextBtn_pyr7v_609{background-color:var(--color-primary);color:#fff;cursor:pointer;transition:all var(--dur-fast);box-shadow:var(--shadow-sm);border:none;border-radius:8px;align-items:center;gap:6px;padding:8px 16px;font-size:12px;font-weight:700;display:inline-flex}._wizardNextBtn_pyr7v_609:hover:not(:disabled){background-color:var(--color-primary-strong)}._wizardNextBtn_pyr7v_609:disabled{opacity:.5;cursor:not-allowed}._selectedStatusAlert_pyr7v_634{background-color:var(--color-primary-soft);color:var(--color-primary);border-radius:16px;align-items:center;gap:6px;padding:6px 12px;font-size:11px;font-weight:600;display:flex}._successContainer_pyr7v_647{text-align:center;flex-direction:column;justify-content:center;align-items:center;width:100%;max-width:520px;margin:0 auto;padding:48px 24px;display:flex}._successHeader_pyr7v_659{flex-direction:column;align-items:center;gap:12px;margin-bottom:24px;display:flex}._successTitle_pyr7v_667{color:var(--color-text);margin:0;font-size:20px;font-weight:700}._successSub_pyr7v_674{color:var(--color-text-soft);margin:4px 0 0;font-size:13px}._successCard_pyr7v_680{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:var(--radius-lg);text-align:left;width:100%;box-shadow:var(--shadow-sm);flex-direction:column;gap:14px;margin-bottom:28px;padding:20px;display:flex}._successRow_pyr7v_694{border-bottom:1px dashed var(--color-border);align-items:flex-start;gap:10px;padding-bottom:10px;display:flex}._successRow_pyr7v_694:last-child{border-bottom:none;padding-bottom:0}._successLabel_pyr7v_707{color:var(--color-text-soft);text-transform:uppercase;flex-shrink:0;width:90px;font-size:11px;font-weight:700}._successVal_pyr7v_716{color:var(--color-text);flex-direction:column;gap:4px;font-size:13px;font-weight:600;display:flex}._successActions_pyr7v_725{justify-content:center;align-items:center;gap:12px;width:100%;display:flex}._successBtn_pyr7v_733{cursor:pointer;transition:all var(--dur-fast);border:none;border-radius:8px;padding:10px 20px;font-size:12.5px;font-weight:700}._successBtnPrimary_pyr7v_743{background-color:var(--color-primary);color:#fff}._successBtnPrimary_pyr7v_743:hover{background-color:var(--color-primary-strong)}._successBtnSecondary_pyr7v_752{border:1px solid var(--color-border);color:var(--color-text-mid);background-color:#0000}._successBtnSecondary_pyr7v_752:hover{background-color:var(--color-surface-hover);color:var(--color-text)}@media (width<=768px){._wizardRow_pyr7v_90{flex-direction:column;overflow-y:auto}._wizardPanelLeft_pyr7v_96{border-right:none;border-bottom:1px solid var(--color-border)}._wizardPanelRight_pyr7v_106{border-left:none;border-top:1px solid var(--color-border);width:100%!important}._timePanelLeft_pyr7v_114{max-height:200px;overflow-y:auto;flex:none!important;width:100%!important}._timePanelRight_pyr7v_128{flex:1!important;width:100%!important}._gridToolbar_pyr7v_366{flex-direction:column;align-items:stretch;gap:10px;padding:12px}._wizardConfirmContainer_pyr7v_501{padding:16px}._stepper_pyr7v_17{gap:8px;padding:12px 16px}._stepText_pyr7v_72{display:none}._wizardFooter_pyr7v_580{flex-direction:column;align-items:stretch;gap:8px;padding:12px}._wizardBackBtn_pyr7v_589,._wizardNextBtn_pyr7v_609{justify-content:center;width:100%}._successActions_pyr7v_725{flex-direction:column;gap:8px}._successBtn_pyr7v_733{text-align:center;width:100%}}._titleVal_195yt_3{font-size:15px;font-weight:700}._inlineIcon_195yt_8{vertical-align:text-bottom;margin-right:4px}._agendaVal_195yt_13{font-style:italic}._lastRow_195yt_17{border-bottom:none}._guestList_195yt_21{flex-wrap:wrap;gap:6px;display:flex}._wizardDetailsForm_79bfd_3{width:100%;max-width:580px;margin:0 auto;padding:24px;overflow-y:auto}._detailsHeading_79bfd_11{color:var(--color-text);margin:0 0 4px;font-size:18px;font-weight:700}._detailsSub_79bfd_18{color:var(--color-text-soft);margin:0 0 24px;font-size:12px}._formGroup_79bfd_24{margin-bottom:16px}._formLabel_79bfd_28{letter-spacing:.04em;color:var(--color-text-soft);margin-bottom:6px;font-size:10px;font-weight:700;display:block}._formInput_79bfd_37{border:1px solid var(--color-border);background-color:var(--color-surface-muted);width:100%;color:var(--color-text);transition:border-color var(--dur-fast);border-radius:8px;padding:10px 12px;font-size:13px;font-weight:500}._formInput_79bfd_37:focus{border-color:var(--color-primary);outline:none}._formTextarea_79bfd_54{border:1px solid var(--color-border);background-color:var(--color-surface-muted);width:100%;color:var(--color-text);resize:vertical;transition:border-color var(--dur-fast);border-radius:8px;padding:10px 12px;font-family:inherit;font-size:12.5px}._formTextarea_79bfd_54:focus{border-color:var(--color-primary);outline:none}@media (width<=768px){._wizardDetailsForm_79bfd_3{padding:16px}}._searchWrap_3i51q_3{padding:0 8px 12px}._contactMeta_3i51q_7{text-align:left;flex:1;min-width:0}._selectedMeta_3i51q_13{flex:1;min-width:0}._timelineContainer_11xrs_3{-webkit-user-select:none;user-select:none;flex-direction:column;flex:1;max-height:380px;display:flex;overflow:auto}@media (width>=1440px){._timelineContainer_11xrs_3{max-height:500px}}._timelineHeaderRow_11xrs_18{background-color:var(--color-surface);border-bottom:1px solid var(--color-border-strong);z-index:5;display:flex;position:sticky;top:0}._timelineTimeCell_11xrs_27{width:64px;color:var(--color-text-soft);border-right:1px solid var(--color-border);background-color:var(--color-surface);flex-shrink:0;padding:8px;font-size:10px;font-weight:700}._timelineHeaderCell_11xrs_38{color:var(--color-text);border-right:1px solid var(--color-border);text-align:center;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:70px;padding:8px;font-size:11px;font-weight:600;overflow:hidden}._timelineBody_11xrs_52{flex-direction:column;display:flex}._timelineRow_11xrs_57{border-bottom:1px dashed var(--color-border);height:28px;display:flex}._timelineRow_11xrs_57:nth-child(2n){border-bottom:1px solid var(--color-border-strong)}._timelineRow_11xrs_57 ._timelineTimeCell_11xrs_27{cursor:pointer;transition:background-color var(--dur-fast);justify-content:center;align-items:center;display:flex}._timelineTimeCellActive_11xrs_75{background-color:var(--color-primary-soft);color:var(--color-primary);font-weight:700}._timelineCell_11xrs_81{border-right:1px solid var(--color-border);cursor:pointer;transition:all var(--dur-fast);flex:1;min-width:70px;position:relative}._cellAvail_11xrs_90{background-color:var(--color-success-soft)}._cellBusy_11xrs_94{background-color:var(--color-danger-soft)}._cellOoh_11xrs_98{background-color:var(--color-surface-muted);background-image:repeating-linear-gradient(45deg,#0000,#0000 4px,#00000008 4px 8px)}._cellSelected_11xrs_109{box-shadow:inset 0 0 0 2px var(--color-primary);z-index:2}._gridTooltip_11xrs_114{background-color:var(--color-text);color:var(--color-surface);z-index:10;white-space:nowrap;box-shadow:var(--shadow-md);pointer-events:none;border-radius:4px;margin-bottom:6px;padding:4px 8px;font-size:10px;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}._header_1afpk_3{padding:0 8px 12px}._slotNote_1afpk_7{color:var(--color-text-soft);font-size:11px}._cardMeta_1afpk_12{flex:1;min-width:0}._toolbarGroup_1hpun_3{align-items:center;gap:8px;display:flex}._toolbarLabel_1hpun_9{color:var(--color-text-soft);font-size:10px;font-weight:600}._suggestedHeader_1hpun_15{align-items:center;gap:6px;margin-bottom:8px;display:flex}._suggestedTitle_1hpun_22{letter-spacing:.04em;color:var(--color-text-mid);font-size:10px;font-weight:700}._freeBadge_1hpun_29{font-size:9px;font-weight:700}._slotTime_1hpun_34{margin-top:2px;font-size:12px;font-weight:700}._noSlots_1hpun_40{color:var(--color-text-mid);padding:4px 0;font-size:11px}._emptyIcon_1hpun_46{color:var(--color-text-soft);margin-bottom:8px}._wizardContentClip_14i7n_3{position:relative;overflow:hidden}._wizardStep_14i7n_8{flex:1;height:100%;min-height:0;display:flex}._slotsDate_1rdif_3{color:var(--color-text-mid);margin-bottom:12px;font-size:11.5px;font-weight:600}._slotsEmpty_1rdif_10{text-align:center;min-height:180px;color:var(--color-text-soft);flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;margin-top:8px;font-size:12px;display:flex}._slotsEmptyIcon_1rdif_24{border-radius:var(--radius-full);background-color:var(--color-primary-05);width:56px;height:56px;color:var(--color-primary);justify-content:center;align-items:center;margin-bottom:4px;display:inline-flex}._slotsEmptyTitle_1rdif_36{color:var(--color-text);font-size:14px;font-weight:700}._slotList_1rdif_42{flex-direction:column;flex:1;gap:6px;min-height:0;max-height:440px;padding-right:2px;display:flex;overflow-y:auto}@media (width>=1440px){._slotList_1rdif_42{max-height:460px}}._slot_1rdif_3{border-radius:var(--radius-md);border:1.5px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;gap:8px;padding:11px 14px;font-size:12.5px;font-weight:600;display:flex}._slot_1rdif_3:hover{border-color:var(--color-primary-border);box-shadow:var(--shadow-sm)}._slotActive_1rdif_86{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-on-primary);box-shadow:0 4px 14px var(--color-primary-30)}._slot_1rdif_3{flex-direction:column;align-items:stretch;gap:4px;display:flex}._slotWithConflicts_1rdif_102{border-style:dashed;border-color:var(--color-warning,#d97706);background-color:var(--color-warning-soft,#d9770614)}._slotWithConflicts_1rdif_102:hover{border-color:var(--color-warning,#d97706);box-shadow:var(--shadow-sm)}._slotMain_1rdif_113{justify-content:space-between;align-items:center;width:100%;display:flex}._slotConflictList_1rdif_120{border-top:1px dashed var(--color-border);color:var(--color-danger);align-items:center;gap:4px;margin-top:4px;padding-top:4px;font-size:10px;display:flex}._conflictLabel_1rdif_131{margin-right:2px;font-weight:500}._conflictAvatar_1rdif_136{background-color:var(--color-danger-soft);width:16px;height:16px;color:var(--color-danger);border:1px solid var(--color-danger);border-radius:50%;justify-content:center;align-items:center;font-size:8px;font-weight:700;display:inline-flex}._slotActive_1rdif_86 ._slotConflictList_1rdif_120{color:#ffffffe6;border-top-color:#ffffff40}._slotActive_1rdif_86 ._conflictAvatar_1rdif_136{background-color:var(--color-surface);color:var(--color-danger);border-color:var(--color-surface)}._noSlots_1rdif_162{text-align:center;color:var(--color-text-soft);padding:20px 0;font-size:13px}._tzWrap_n6w9w_3{flex-shrink:0;position:relative}._tzBtn_n6w9w_8{border-radius:var(--radius-md);border:1px solid var(--color-border-strong);background-color:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:7px;padding:7px 12px;font-size:12px;font-weight:600;display:inline-flex}._tzBtn_n6w9w_8:hover{border-color:var(--color-primary);box-shadow:var(--shadow-sm)}._tzBtnOffset_n6w9w_30{color:var(--color-primary);font-size:11px;font-weight:700}._tzChevron_n6w9w_36{color:var(--color-text-soft)}._tzBackdrop_n6w9w_40{z-index:30;cursor:default;background:0 0;border:none;position:fixed;inset:0}._tzPop_n6w9w_49{z-index:40;border-radius:var(--radius-lg);background-color:var(--color-surface);border:1px solid var(--color-border);width:248px;box-shadow:var(--shadow-lg);padding:8px;position:absolute;top:calc(100% + 6px);right:0}._tzSearch_n6w9w_62{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:34px;color:var(--color-text-soft);align-items:center;gap:8px;margin-bottom:6px;padding:0 10px;display:flex}._tzSearchInput_n6w9w_74{min-width:0;color:var(--color-text);background:0 0;border:none;outline:none;flex:1;font-size:12.5px}._tzList_n6w9w_84{scrollbar-width:none;flex-direction:column;gap:1px;max-height:260px;display:flex;overflow-y:auto}._tzList_n6w9w_84:hover{scrollbar-width:thin}._tzList_n6w9w_84::-webkit-scrollbar{background:0 0;width:5px}._tzList_n6w9w_84::-webkit-scrollbar-track{background:0 0}._tzList_n6w9w_84::-webkit-scrollbar-thumb{border-radius:var(--radius-full,4px);background:0 0}._tzList_n6w9w_84:hover::-webkit-scrollbar-thumb{background:var(--color-border,#cbd5e1)}._tzList_n6w9w_84:hover::-webkit-scrollbar-thumb:hover{background:var(--color-border-strong,#94a3b8)}._tzRow_n6w9w_119{border-radius:var(--radius-sm);color:var(--color-text);cursor:pointer;text-align:left;transition:background-color var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:8px;padding:8px 10px;font-size:12.5px;display:flex}._tzRow_n6w9w_119:hover{background-color:var(--color-surface-muted)}._tzRowActive_n6w9w_138{background-color:var(--color-primary-10)}._tzCity_n6w9w_142{flex:1;font-weight:600}._tzRowActive_n6w9w_138 ._tzCity_n6w9w_142{color:var(--color-primary)}._tzRowOffset_n6w9w_151{color:var(--color-text-soft);font-size:11px;font-weight:600}._tzCheck_n6w9w_157{color:var(--color-primary)}._tzEmpty_n6w9w_161{color:var(--color-text-soft);margin:8px 4px;font-size:12px}._badgeWrap_swq6w_3{width:64px;height:64px;margin:0 auto 12px;position:relative}._badgeCircle_swq6w_10{background-color:var(--color-success-soft);border:2px solid var(--color-success);border-radius:50%;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._guestRow_swq6w_21{flex-flow:wrap;gap:6px;display:flex}._eventVal_swq6w_28{font-size:14px;font-weight:700}._iconRow_swq6w_33{align-items:center;gap:6px;display:flex}._iconRowMuted_swq6w_39{color:var(--color-text-mid);align-items:center;gap:6px;margin-top:2px;display:flex}._iconRowTop_swq6w_47{align-items:flex-start;gap:6px;display:flex}._agendaVal_swq6w_53{font-style:italic;font-weight:500}._iconTop_swq6w_58{margin-top:2px}._schedWrap_1p5xn_4{flex-direction:column;gap:14px;padding:18px 28px 40px;display:flex}._bucketTabs_1p5xn_11{flex-wrap:wrap;gap:6px;display:flex}._bucketTab_1p5xn_11{border-radius:var(--radius-full);color:var(--color-text-soft);border:1px solid var(--color-border);cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;align-items:center;gap:7px;padding:7px 15px;font-size:12.5px;font-weight:500;display:flex;position:relative;overflow:hidden}._bucketTab_1p5xn_11:hover{color:var(--color-text)}._bucketTabActive_1p5xn_38,._bucketTabActive_1p5xn_38:hover{color:var(--color-primary);border-color:var(--color-primary-border);font-weight:600}._bucketBg_1p5xn_45{z-index:0;border-radius:var(--radius-full);background-color:var(--color-primary-10);position:absolute;inset:0}._bucketLabel_1p5xn_53{z-index:1;position:relative}._bucketCount_1p5xn_58{z-index:1;border-radius:var(--radius-full);text-align:center;background-color:var(--color-surface-muted);min-width:18px;color:var(--color-text-mid);padding:0 6px;font-size:11px;font-weight:700;position:relative}._bucketTabActive_1p5xn_38 ._bucketCount_1p5xn_58{background-color:var(--color-primary-10);color:var(--color-primary)}._meetingList_1p5xn_76{flex-direction:column;gap:10px;display:flex}._meeting_1p5xn_76{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);transition:box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);align-items:center;gap:14px;padding:14px 18px;display:flex}._meeting_1p5xn_76:hover{border-color:var(--color-border-strong);box-shadow:var(--shadow-md)}._datePlate_1p5xn_101{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-primary-10);flex-direction:column;justify-content:center;align-items:center;width:48px;min-width:48px;height:56px;display:flex}._datePlatePassed_1p5xn_114{background-color:var(--color-bg)}._datePlateCanceled_1p5xn_118{background-color:var(--color-danger-soft)}._datePlateMonth_1p5xn_122{letter-spacing:.06em;color:var(--color-primary);font-size:9px;font-weight:700}._datePlateDay_1p5xn_129{color:var(--color-primary);font-size:18px;font-weight:800;line-height:1}._datePlateCanceled_1p5xn_118 ._datePlateMonth_1p5xn_122,._datePlateCanceled_1p5xn_118 ._datePlateDay_1p5xn_129{color:var(--color-danger)}._meetingAvatar_1p5xn_141{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:13px;font-weight:700;display:flex}._meetingBody_1p5xn_155{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}._meetingTitle_1p5xn_163{color:var(--color-text);font-size:13px;font-weight:700}._meetingMeta_1p5xn_169{color:var(--color-text-mid);flex-wrap:wrap;align-items:center;gap:10px;font-size:11px;display:flex}._meetingMetaItem_1p5xn_178{align-items:center;gap:4px;display:inline-flex}._meetingActions_1p5xn_184{flex-shrink:0;align-items:center;gap:6px;display:flex}._acceptBtn_1p5xn_191,._joinBtn_1p5xn_192{background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;border-radius:8px;align-items:center;gap:5px;padding:7px 13px;font-size:11.5px;font-weight:600;transition:opacity .15s,background-color .15s;display:inline-flex}._joinBtnDisabled_1p5xn_209,._joinBtn_1p5xn_192:disabled{background-color:var(--color-surface-muted);color:var(--color-text-mid);cursor:not-allowed;opacity:.7}._declineBtn_1p5xn_217{border:1px solid var(--color-border);color:var(--color-text-mid);cursor:pointer;background:0 0;border-radius:8px;padding:7px 12px;font-size:11.5px;font-weight:600}._cancelBtn_1p5xn_228{border:1px solid var(--color-danger);color:var(--color-danger);cursor:pointer;background:0 0;border-radius:8px;padding:7px 12px;font-size:11.5px;font-weight:600}._cancelBtnDisabled_1p5xn_239,._cancelBtn_1p5xn_228:disabled{border-color:var(--color-border);color:var(--color-text-mid);cursor:not-allowed;opacity:.5}._statusPill_1p5xn_247{border-radius:var(--radius-full);align-items:center;gap:4px;padding:5px 11px;font-size:11px;font-weight:700;display:inline-flex}._statusAccepted_1p5xn_257{background-color:var(--color-success-soft);color:var(--color-success)}._statusPending_1p5xn_262{background-color:var(--color-warn-soft);color:var(--color-warn)}._statusRejected_1p5xn_267,._statusCanceled_1p5xn_268{background-color:var(--color-danger-soft);color:var(--color-danger)}._statusCompleted_1p5xn_273{background-color:var(--color-bg);color:var(--color-text-mid)}._empty_1p5xn_278{text-align:center;background-color:#0000;flex-direction:column;justify-content:center;align-items:center;padding:60px 20px;display:flex}._emptyIconWrap_1p5xn_288{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:64px;height:64px;color:var(--color-text-soft);justify-content:center;align-items:center;margin-bottom:16px;display:flex}._emptyTitle_1p5xn_300{font-size:var(--font-lg);color:var(--color-text);margin:0 0 8px;font-weight:700}._emptyText_1p5xn_307{font-size:var(--font-sm);color:var(--color-text-soft);max-width:300px;margin:0;line-height:1.5}@media (width<=640px){._meeting_1p5xn_76{flex-wrap:wrap;align-items:flex-start;gap:12px 14px;padding:14px}._meetingActions_1p5xn_184{flex-wrap:wrap;flex-basis:100%;gap:8px;width:100%}._acceptBtn_1p5xn_191,._joinBtn_1p5xn_192,._declineBtn_1p5xn_217,._cancelBtn_1p5xn_228{padding:9px 14px;font-size:12px}}._list_1vv5w_1{flex-direction:column;gap:10px;display:flex}._meeting_1vv5w_7{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);align-items:center;gap:14px;padding:14px 18px;display:flex}._datePlate_1vv5w_17{border-radius:var(--radius-md);background-color:var(--color-surface-muted);width:48px;min-width:48px;height:56px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}._avatar_1vv5w_26{background-color:var(--color-surface-muted);border-radius:50%;flex-shrink:0;width:36px;height:36px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}._body_1vv5w_35{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}._title_1vv5w_43{background-color:var(--color-surface-muted);border-radius:4px;width:120px;height:14px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}._meta_1vv5w_51{background-color:var(--color-surface-muted);border-radius:4px;width:180px;height:12px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}._actions_1vv5w_59{flex-shrink:0;align-items:center;gap:6px;display:flex}._btn_1vv5w_66{background-color:var(--color-surface-muted);border-radius:8px;width:64px;height:28px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}@keyframes _pulse_1vv5w_1{0%,to{opacity:1}50%{opacity:.5}}._screen_18kgg_6{flex-direction:column;min-height:100%;display:flex}._head_18kgg_13{background-color:var(--color-surface);border-bottom:1px solid var(--color-border);padding:22px 28px 0}._headTop_18kgg_19{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:12px;display:flex}._title_18kgg_27{font-size:var(--font-xl);color:var(--color-text);letter-spacing:-.02em;margin:0 0 2px;font-weight:600}._subtitle_18kgg_35{color:var(--color-text-soft);margin:0;font-size:12.5px}._headBadge_18kgg_41{border-radius:var(--radius-sm);background-color:var(--color-primary-05);padding:6px 14px}._headBadgeNum_18kgg_47{font-size:var(--font-md);color:var(--color-primary);font-weight:700}._headBadgeLabel_18kgg_53{color:var(--color-text-soft);margin-left:6px;font-size:11px}._tabs_18kgg_59{gap:0;margin-top:14px;display:flex}._tab_18kgg_59{color:var(--color-text-soft);cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:7px;padding:11px 22px;font-size:14px;font-weight:500;display:flex;position:relative}._tab_18kgg_59:hover{color:var(--color-text)}._tabActive_18kgg_84,._tabActive_18kgg_84:hover{color:var(--color-primary);font-weight:600}._tabUnderline_18kgg_90{background-color:var(--color-primary);border-radius:2px 2px 0 0;height:2.5px;position:absolute;bottom:-1px;left:16px;right:16px}._body_18kgg_100{flex:1;min-height:0;position:relative;overflow:hidden}._tabContent_18kgg_107{height:100%;overflow-y:auto}@media (width<=425px){._tabContent_18kgg_107{padding-bottom:calc(var(--bottom-nav-offset,50px) - 10px);transition:padding-bottom var(--dur-base) var(--ease-out)}}._notesInput_1ut2q_7{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);resize:vertical;padding:8px 10px;font-family:inherit;font-size:13px}._notesInput_1ut2q_7:focus{border-color:var(--color-primary-border);outline:none}._actionSpacer_1ut2q_24{flex:1}._panelHead_1ut2q_29{z-index:2;background-color:var(--color-surface);border-bottom:1px solid var(--color-divider);justify-content:space-between;align-items:center;padding:16px 20px;display:flex;position:sticky;top:0}._panelTitle_1ut2q_41{font-size:var(--font-lg);color:var(--color-text);font-weight:700}._panelForm_1ut2q_47{flex-direction:column;gap:16px;padding:18px 20px 24px;display:flex}._microLabel_1ut2q_54{letter-spacing:.06em;text-transform:uppercase;color:var(--color-text-very-soft);font-size:10px;font-weight:700}._panelInput_1ut2q_62{width:100%;height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);color:var(--color-text);padding:0 10px;font-family:inherit;font-size:13px}._panelInput_1ut2q_62:focus{border-color:var(--color-primary-border);outline:none}._inputError_1ut2q_79,._inputError_1ut2q_79:focus{border-color:var(--color-danger)}._fieldError_1ut2q_84{font-size:var(--font-xs);color:var(--color-danger);margin-top:2px}._statusPills_1ut2q_90{flex-wrap:wrap;gap:6px;display:flex}._statusPill_1ut2q_90{border-radius:var(--radius-full);border:1px solid var(--color-border);color:var(--color-text-soft);cursor:pointer;background:0 0;align-items:center;gap:5px;padding:7px 12px;font-size:12px;font-weight:600;display:inline-flex}._statusPillActive_1ut2q_110{background-color:color-mix(in srgb, var(--status-color) 14%, transparent);border-color:color-mix(in srgb, var(--status-color) 45%, transparent);color:var(--status-color)}._dtGrid_1ut2q_116{grid-template-columns:1.3fr 1fr 1fr;align-items:end;gap:10px;display:grid}@media (width<=480px){._dtGrid_1ut2q_116{grid-template-columns:1fr 1fr}._dtGrid_1ut2q_116>:first-child{grid-column:1/-1}}._checkRow_1ut2q_133{width:fit-content;color:var(--color-text);cursor:pointer;align-items:center;gap:8px;font-size:13px;display:inline-flex}._checkbox_1ut2q_143{width:16px;height:16px;accent-color:var(--color-primary);cursor:pointer}._recurToggle_1ut2q_150{border-radius:var(--radius-md);border:1px solid var(--color-border);cursor:pointer;background:0 0;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:10px 12px;display:flex}._recurToggleOn_1ut2q_163{background-color:var(--color-primary-05);border-color:var(--color-primary-30)}._recurToggleLabel_1ut2q_168{color:var(--color-text-mid);align-items:center;gap:8px;font-size:13px;font-weight:600;display:inline-flex}._recurToggleOn_1ut2q_163 ._recurToggleLabel_1ut2q_168{color:var(--color-primary)}._recurSwitch_1ut2q_181{border-radius:var(--radius-full);background-color:var(--color-border-strong);flex-shrink:0;width:34px;height:18px;transition:background-color .15s;position:relative}._recurSwitchOn_1ut2q_191{background-color:var(--color-primary)}._recurKnob_1ut2q_195{background-color:var(--color-on-primary);border-radius:50%;width:14px;height:14px;transition:transform .15s;position:absolute;top:2px;left:2px}._recurSwitchOn_1ut2q_191 ._recurKnob_1ut2q_195{transform:translate(16px)}._panelFooter_1ut2q_210{border-top:1px solid var(--color-divider);background-color:var(--color-surface)}._panelSummary_1ut2q_215{background-color:var(--color-primary-05);color:var(--color-text-mid);align-items:center;gap:8px;padding:12px 20px;font-size:12.5px;font-weight:600;display:flex}._panelActions_1ut2q_226{align-items:center;gap:8px;padding:14px 20px;display:flex}._recurSection_1ut2q_234{flex-direction:column;gap:12px;display:flex}._recurBuilder_1ut2q_240{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:12px;padding:12px;display:flex}._recurChips_1ut2q_250{flex-wrap:wrap;gap:6px;display:flex}._recurChip_1ut2q_250{border-radius:var(--radius-full);border:1px solid var(--color-border);color:var(--color-text-soft);cursor:pointer;background:0 0;padding:6px 12px;font-size:12px;font-weight:600}._recurChipActive_1ut2q_267{background-color:var(--color-primary-10);border-color:var(--color-primary-border);color:var(--color-primary)}._recurInline_1ut2q_273{color:var(--color-text-mid);align-items:center;gap:8px;font-size:13px;display:flex}._recurInlineLabel_1ut2q_281{color:var(--color-text-mid);font-size:13px}._recurNumber_1ut2q_286{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:56px;height:32px;color:var(--color-text);padding:0 8px;font-size:13px}._recurWeekdays_1ut2q_297{flex-wrap:wrap;gap:6px;display:flex}._recurDay_1ut2q_303{border:1px solid var(--color-border);width:32px;height:32px;color:var(--color-text-soft);cursor:pointer;background:0 0;border-radius:50%;font-size:12px;font-weight:700}._recurDayActive_1ut2q_315{background-color:var(--color-primary);border-color:var(--color-primary);color:var(--color-on-primary)}._recurEnds_1ut2q_321{flex-direction:column;gap:8px;display:flex}._recurRadio_1ut2q_327{color:var(--color-text-mid);align-items:center;gap:8px;font-size:13px;display:flex}._recurRadio_1ut2q_327 input[type=radio]{accent-color:var(--color-primary)}._recurDate_1ut2q_339{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);height:32px;color:var(--color-text);padding:0 8px;font-size:12.5px}._recurSummaryBox_1ut2q_349{border-radius:var(--radius-sm);background-color:var(--color-primary-05);color:var(--color-primary);text-transform:capitalize;padding:8px 10px;font-size:12px;font-weight:600}._panelSummaryError_1ut2q_360{align-items:center;gap:var(--space-1);font-weight:600;display:inline-flex;color:var(--color-danger)!important}._disabledButtonWrapper_1ut2q_368{cursor:not-allowed;display:inline-block}._resolveConflictBtn_1ut2q_373{background-color:var(--color-danger);color:#fff;border-radius:var(--radius-sm);cursor:pointer;transition:opacity var(--dur-fast) var(--ease-out);border:none;align-items:center;gap:4px;margin-left:8px;padding:4px 8px;font-size:11px;font-weight:600;display:inline-flex}._resolveConflictBtn_1ut2q_373:hover{opacity:.85}._upcomingCard_1ut2q_394{background-color:var(--color-surface-hover);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-3);margin-top:var(--space-4)}._upcomingHeader_1ut2q_402{font-size:var(--font-xs);color:var(--color-text-mid);text-transform:uppercase;letter-spacing:.05em;margin-bottom:var(--space-2);align-items:center;gap:var(--space-1);font-weight:700;display:flex}._upcomingRow_1ut2q_414{font-size:var(--font-sm);color:var(--color-text);padding:var(--space-1) 0;border-bottom:1px solid var(--color-border-subtle);justify-content:space-between;display:flex}._upcomingRow_1ut2q_414:last-child{border-bottom:none}._upcomingRowDate_1ut2q_427{font-weight:500}._upcomingRowTime_1ut2q_431{color:var(--color-text-soft);font-variant-numeric:tabular-nums}._upcomingMore_1ut2q_436{font-size:var(--font-xs);color:var(--color-text-soft);margin-top:var(--space-2);text-align:center;font-style:italic}._differentTimeRow_1ut2q_445{align-items:center;gap:var(--space-2);margin-top:var(--space-3);font-size:var(--font-sm);color:var(--color-text);cursor:pointer;-webkit-user-select:none;user-select:none;display:flex}._differentTimeList_1ut2q_456{gap:var(--space-2);margin-top:var(--space-3);background-color:var(--color-surface-muted);border:1px dashed var(--color-border);border-radius:var(--radius-md);flex-direction:column;padding:10px;display:flex}._differentTimeRowItem_1ut2q_467{align-items:center;gap:var(--space-2);display:flex}._differentTimeRowItem_1ut2q_467 input[type=time]{box-sizing:border-box;flex-shrink:0;width:90px}._differentTimeDayLabel_1ut2q_479{width:40px;font-size:var(--font-sm);color:var(--color-text);flex-shrink:0;font-weight:600;display:inline-block}._differentTimeNote_1ut2q_488{font-size:var(--font-xs);color:var(--color-text-soft);margin-top:var(--space-2);line-height:1.4}._differentTimeRowGroup_1ut2q_495{gap:var(--space-2);flex-direction:column;display:flex}._differentTimeDayLabelSpacer_1ut2q_501{flex-shrink:0;width:40px;display:inline-block}._slotActionBtn_1ut2q_507{color:var(--color-primary);cursor:pointer;padding:var(--space-1);border-radius:var(--radius-sm);transition:background-color var(--dur-fast);background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}._slotActionBtn_1ut2q_507:hover{background-color:var(--color-primary-10)}._slotActionBtnTrash_1ut2q_524{color:var(--color-text-soft);cursor:pointer;padding:var(--space-1);border-radius:var(--radius-sm);transition:color var(--dur-fast), background-color var(--dur-fast);background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}._slotActionBtnTrash_1ut2q_524:hover{color:var(--color-danger);background-color:color-mix(in srgb, var(--color-danger) 10%, transparent)}._center_10cfo_6{place-items:center;padding:40px 0;display:grid}._field_10cfo_12{flex-direction:column;gap:6px;display:flex}._dash_10cfo_18{color:var(--color-text-soft);font-size:var(--font-sm)}._timeInput_ik08d_4{margin:0;padding:4px 8px}._errorStack_q9qoj_4{flex-direction:column;align-items:flex-start;gap:4px;display:flex}._errorLine_q9qoj_11{align-items:center;gap:4px;display:inline-flex}._tzWrap_horpb_4{position:relative}._tzTrigger_horpb_8{width:100%;height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);color:var(--color-text);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:8px;padding:0 10px;font-size:13px;display:flex}._tzTrigger_horpb_8:hover{border-color:var(--color-primary)}._tzGlobe_horpb_30{color:var(--color-text-soft);flex-shrink:0}._tzTriggerLabel_horpb_35{text-align:left;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}._tzTriggerOffset_horpb_44{color:var(--color-primary);flex-shrink:0;font-size:11px;font-weight:700}._tzChevron_horpb_51{color:var(--color-text-soft);flex-shrink:0}._tzBackdrop_horpb_56{z-index:30;cursor:default;background:0 0;border:none;position:fixed;inset:0}._tzPop_horpb_65{z-index:40;border-radius:var(--radius-lg);background-color:var(--color-surface);border:1px solid var(--color-border);box-shadow:var(--shadow-lg);padding:8px;position:absolute;top:calc(100% + 6px);left:0;right:0}._tzSearch_horpb_78{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:34px;color:var(--color-text-soft);align-items:center;gap:8px;margin-bottom:6px;padding:0 10px;display:flex}._tzSearchInput_horpb_90{min-width:0;color:var(--color-text);background:0 0;border:none;outline:none;flex:1;font-size:12.5px}._tzList_horpb_100{scrollbar-width:none;flex-direction:column;gap:1px;max-height:280px;display:flex;overflow-y:auto}._tzList_horpb_100:hover{scrollbar-width:thin}._tzList_horpb_100::-webkit-scrollbar{background:0 0;width:5px}._tzList_horpb_100::-webkit-scrollbar-track{background:0 0}._tzList_horpb_100::-webkit-scrollbar-thumb{border-radius:var(--radius-full,4px);background:0 0}._tzList_horpb_100:hover::-webkit-scrollbar-thumb{background:var(--color-border,#cbd5e1)}._tzList_horpb_100:hover::-webkit-scrollbar-thumb:hover{background:var(--color-border-strong,#94a3b8)}._tzRow_horpb_135{border-radius:var(--radius-sm);color:var(--color-text);cursor:pointer;text-align:left;transition:background-color var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:8px;padding:8px 10px;font-size:12.5px;display:flex}._tzRow_horpb_135:hover{background-color:var(--color-surface-muted)}._tzRowActive_horpb_154{background-color:var(--color-primary-10)}._tzRowLabel_horpb_158{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-weight:600;overflow:hidden}._tzRowActive_horpb_154 ._tzRowLabel_horpb_158{color:var(--color-primary)}._tzRowOffset_horpb_171{color:var(--color-text-soft);flex-shrink:0;font-size:11px;font-weight:600}._tzCheck_horpb_178{color:var(--color-primary);flex-shrink:0}._tzEmpty_horpb_183{text-align:center;color:var(--color-text-soft);padding:12px;font-size:12px}._gridScroll_1vnsd_7{scrollbar-width:thin;scrollbar-color:var(--color-border) transparent;flex:1;min-width:0;overflow:auto}._gridScroll_1vnsd_7::-webkit-scrollbar{width:6px;height:6px}._gridScroll_1vnsd_7::-webkit-scrollbar-track{background:0 0}._gridScroll_1vnsd_7::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:4px}._gridScroll_1vnsd_7::-webkit-scrollbar-thumb:hover{background-color:var(--color-text-soft)}._gridInner_1vnsd_33{min-width:700px;display:flex}._gutter_1vnsd_38{border-right:1px solid var(--color-divider);flex-shrink:0;width:56px}._gutterHead_1vnsd_44{height:60px}._gutterAllDay_1vnsd_48{height:calc(var(--all-day-rows,1) * 24px + 6px);border-bottom:1px solid var(--color-divider);letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-very-soft);justify-content:flex-end;align-items:center;padding-right:8px;font-size:9px;font-weight:600;display:flex}._gutterHour_1vnsd_62{height:52px;font-size:var(--font-xs);color:var(--color-text-soft);justify-content:flex-end;align-items:flex-start;padding-right:8px;font-weight:500;display:flex}._dayCol_1vnsd_73{border-right:1px solid var(--color-divider);flex:1;min-width:90px}._dayHeader_1vnsd_79{z-index:15;background-color:var(--color-surface);border-bottom:1px solid var(--color-border);flex-direction:column;justify-content:center;align-items:center;gap:1px;height:60px;display:flex;position:sticky;top:0}._colDay_1vnsd_93{font-size:var(--font-xs);color:var(--color-text-soft);text-transform:uppercase;letter-spacing:.04em;font-weight:600}._colDayToday_1vnsd_101{color:var(--color-primary)}._dayNum_1vnsd_105{color:var(--color-text);justify-content:center;align-items:center;width:26px;height:26px;font-size:18px;font-weight:700;line-height:1;display:flex}@media (width<=480px){._dayNum_1vnsd_105{width:22px;height:22px;font-size:14px}}._dayNumToday_1vnsd_125{background-color:var(--color-primary);color:var(--color-on-primary);border-radius:50%}._dayCount_1vnsd_131{color:var(--color-text-very-soft);font-size:9px;font-weight:600}._allDayBand_1vnsd_137{min-height:30px;height:calc(var(--all-day-rows,1) * 24px + 6px);border-bottom:1px solid var(--color-divider);flex-direction:column;gap:2px;padding:3px 4px;display:flex;overflow-y:auto}._allDayChip_1vnsd_148{border:none;border-left:3px solid var(--status-color);background-color:color-mix(in srgb, var(--status-color) 16%, transparent);color:var(--status-color);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;border-radius:5px;align-items:center;gap:4px;padding:2px 6px;font-size:10px;font-weight:600;display:flex;overflow:hidden}._hoursWrap_1vnsd_168{height:var(--grid-h);background-color:var(--color-off-hours);position:relative}._workBand_1vnsd_174{left:0;right:0;top:var(--top);height:var(--h);z-index:0;background-color:var(--color-surface);position:absolute}._hourRow_1vnsd_184{z-index:1;border:none;border-bottom:1px solid var(--color-divider);cursor:pointer;width:100%;height:52px;transition:background-color var(--dur-fast) var(--ease-out);background:0 0;padding:0;display:block;position:relative}._hourRow_1vnsd_184:hover{background-color:var(--color-primary-10)}._nowLine_1vnsd_203{left:0;right:0;top:var(--top);z-index:4;border-top:2px solid var(--color-secondary);pointer-events:none;height:0;position:absolute}._nowDot_1vnsd_214{background-color:var(--color-secondary);border-radius:50%;width:7px;height:7px;position:absolute;top:-4px;left:-1px}._block_1vnsd_224{top:var(--top);height:var(--h);left:calc(2px + var(--lane) * (100% - 4px) / var(--lanes));width:calc((100% - 4px) / var(--lanes) - 2px);z-index:3;background-color:color-mix(in srgb, var(--status-color) 14%, var(--color-surface));border:none;border-left:3px solid var(--status-color);cursor:pointer;text-align:left;font:inherit;box-shadow:var(--shadow-sm);transition:background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border-radius:6px;flex-direction:column;align-items:flex-start;gap:2px;padding:4px 7px;display:flex;position:absolute;overflow:hidden}._block_1vnsd_224:hover{z-index:10;background-color:color-mix(in srgb, var(--status-color) 26%, var(--color-surface));box-shadow:var(--shadow-md,0 4px 14px #0006)}._block_1vnsd_224:focus-visible{outline:2px solid var(--color-focus);outline-offset:1px}._blockTitle_1vnsd_261{width:100%;color:var(--status-color);white-space:nowrap;text-overflow:ellipsis;flex-shrink:0;font-size:11px;font-weight:600;line-height:1.35;display:block;overflow:hidden}._blockTitle_1vnsd_261 svg{vertical-align:-2px;margin-right:3px}._blockTime_1vnsd_279{font-size:var(--font-xs);color:var(--status-color);opacity:.75;white-space:nowrap}@media (width<=640px){._blockTime_1vnsd_279{font-size:10px}}._monthScroll_1vnsd_293{background-color:var(--color-surface);flex-direction:column;flex:1;min-height:0;display:flex;overflow-y:auto}._monthHead_1vnsd_302{border-bottom:1px solid var(--color-border);flex-shrink:0;grid-template-columns:repeat(7,1fr);display:grid}._monthHeadCell_1vnsd_309{text-align:center;letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);padding:10px 8px;font-size:11px;font-weight:700}._monthGrid_1vnsd_319{flex:1;grid-template-columns:repeat(7,1fr);grid-auto-rows:minmax(96px,1fr);display:grid}._monthCell_1vnsd_326{border-right:1px solid var(--color-divider);border-bottom:1px solid var(--color-divider);cursor:pointer;min-height:0;transition:background-color var(--dur-fast) var(--ease-out);flex-direction:column;gap:3px;padding:5px 6px;display:flex;overflow:hidden}._monthCell_1vnsd_326:nth-child(7n){border-right:none}._monthCell_1vnsd_326:hover{background-color:var(--color-primary-05)}._monthCellOff_1vnsd_347{background-color:var(--color-off-hours)}._monthCellOff_1vnsd_347 ._monthDayNum_1vnsd_351{color:var(--color-text-very-soft)}._monthCellToday_1vnsd_355{background-color:var(--color-primary-05)}._monthDayNum_1vnsd_351{text-align:right;color:var(--color-text);font-size:12px;font-weight:600}._monthDayNumToday_1vnsd_366{border-radius:var(--radius-full);background-color:var(--color-primary);min-width:20px;height:20px;color:var(--color-on-primary);text-align:center;align-self:flex-end;padding:0 2px;font-weight:800;line-height:20px}._monthChip_1vnsd_379{text-align:left;border:none;border-left:2px solid var(--status-color);background-color:color-mix(in srgb, var(--status-color) 14%, var(--color-surface));width:100%;color:var(--status-color);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out);border-radius:4px;padding:1px 6px;font-size:10.5px;font-weight:600;display:block;overflow:hidden}._monthChip_1vnsd_379:hover{background-color:color-mix(in srgb, var(--status-color) 26%, var(--color-surface))}._monthMore_1vnsd_402{color:var(--color-text-soft);padding-left:4px;font-size:9.5px;font-weight:600}._agendaScroll_1vnsd_410{background-color:var(--color-bg);flex:1;min-height:0;padding:18px 24px;overflow-y:auto}._agendaGroup_1vnsd_418{margin-bottom:20px}._agendaDay_1vnsd_422{letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);margin-bottom:8px;padding-left:4px;font-size:12px;font-weight:700}._agendaItems_1vnsd_432{flex-direction:column;gap:6px;display:flex}._agendaRow_1vnsd_438{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);cursor:pointer;text-align:left;width:100%;transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:12px;padding:11px 14px;display:flex}._agendaRow_1vnsd_438:hover{border-color:var(--status-color);box-shadow:var(--shadow-sm)}._agendaAccent_1vnsd_459{background-color:var(--status-color);border-radius:2px;flex-shrink:0;width:4px;height:36px}._agendaBody_1vnsd_467{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._agendaTitle_1vnsd_475{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:13.5px;font-weight:600;overflow:hidden}._agendaMeta_1vnsd_484{color:var(--color-text-soft);font-size:11.5px}._agendaMeta_1vnsd_484 svg{vertical-align:-1px}._agendaPill_1vnsd_493{color:var(--status-color);background-color:color-mix(in srgb, var(--status-color) 14%, transparent);border-radius:6px;flex-shrink:0;align-items:center;gap:4px;padding:3px 9px;font-size:11px;font-weight:600;display:inline-flex}._agendaEmpty_1vnsd_506{text-align:center;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:60px 20px;display:flex}._agendaEmptyIcon_1vnsd_517{color:var(--color-text-very-soft);margin-bottom:4px}._agendaEmptyTitle_1vnsd_522{font-size:var(--font-md);color:var(--color-text);font-weight:700}._agendaEmptyText_1vnsd_528{color:var(--color-text-soft);font-size:13px}._agendaEmptyBtn_1vnsd_533{border-radius:var(--radius-md);background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;margin-top:8px;padding:9px 18px;font-size:13px;font-weight:700}._availabilityBand_1vnsd_546{left:3px;right:5px;top:var(--top);height:var(--h);z-index:2;cursor:pointer;box-sizing:border-box;transition:background-color var(--dur-fast) var(--ease-out), backdrop-filter var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);background-color:#22c55e14;border-top:1px dashed #22c55e40;border-bottom:1px dashed #22c55e40;border-left:3px solid #22c55e;justify-content:space-between;align-items:flex-start;padding:4px 8px;display:flex;position:absolute;overflow:hidden}._availabilityBand_1vnsd_546:hover{z-index:10;background-color:color-mix(in srgb, #22c55e 20%, var(--color-surface));-webkit-backdrop-filter:blur(8px);box-shadow:var(--shadow-md,0 4px 14px #0006)}._availabilityBandLabel_1vnsd_579{color:#15803d;align-items:center;gap:4px;font-size:11px;font-weight:700;display:flex}._availabilityBandEditBtn_1vnsd_589{color:#15803d;cursor:pointer;opacity:0;transition:opacity var(--dur-fast) var(--ease-out);background:#ffffffd9;border:1px solid #16653433;border-radius:4px;padding:1px 5px;font-size:9px;font-weight:700}._availabilityBand_1vnsd_546:hover ._availabilityBandEditBtn_1vnsd_589{opacity:1}._availabilityBandEditBtn_1vnsd_589:hover{background:#fff;border-color:#15803d}._dragSelectionHighlight_1vnsd_612{left:0;right:0;top:var(--top);height:var(--h);z-index:10;border:2px dashed var(--color-primary);pointer-events:none;box-sizing:border-box;background-color:#3b82f626;border-radius:6px;justify-content:center;align-items:center;display:flex;position:absolute}._dragSelectionLabel_1vnsd_631{color:var(--color-primary);background-color:var(--color-surface);border:1px solid var(--color-primary-border);box-shadow:var(--shadow-sm);border-radius:4px;padding:3px 8px;font-size:11px;font-weight:700}._sidebar_p4iov_4{border-left:1px solid var(--color-border);background-color:var(--color-surface);scrollbar-width:thin;scrollbar-color:var(--color-border) transparent;flex-direction:column;flex-shrink:0;gap:18px;width:260px;padding:18px 16px;display:flex;overflow-y:auto}._sidebar_p4iov_4::-webkit-scrollbar{width:6px;height:6px}._sidebar_p4iov_4::-webkit-scrollbar-track{background:0 0}._sidebar_p4iov_4::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:4px}._sidebar_p4iov_4::-webkit-scrollbar-thumb:hover{background-color:var(--color-text-soft)}._summaryGrid_p4iov_36{grid-template-columns:1fr 1fr;gap:8px;display:grid}._summaryCard_p4iov_42{border-radius:var(--radius-lg);background-color:color-mix(in srgb, var(--v) 7%, var(--color-surface));border:1px solid color-mix(in srgb, var(--v) 22%, transparent);flex-direction:column;gap:6px;padding:12px;display:flex;position:relative;overflow:hidden}._summaryTop_p4iov_54{align-items:center;gap:6px;display:flex}._summaryTopIcon_p4iov_60{color:var(--v);flex-shrink:0}._summaryValue_p4iov_65{letter-spacing:-.02em;color:var(--v);font-size:20px;font-weight:800;line-height:1}._summaryLabel_p4iov_73{color:var(--color-text-soft);text-transform:uppercase;letter-spacing:.05em;font-size:10px;font-weight:700}._sideHeader_p4iov_82{letter-spacing:.05em;text-transform:uppercase;color:var(--color-text-mid);margin-bottom:8px;font-size:11px;font-weight:800}._quickRow_p4iov_92{gap:6px;display:flex}._quickBtn_p4iov_97{color:var(--status-color);background-color:color-mix(in srgb, var(--status-color) 12%, transparent);border:1px solid color-mix(in srgb, var(--status-color) 35%, transparent);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out);border-radius:9px;flex:1;justify-content:center;align-items:center;gap:5px;padding:8px;font-size:11.5px;font-weight:600;display:inline-flex}._quickBtn_p4iov_97:hover{background-color:color-mix(in srgb, var(--status-color) 22%, transparent)}._legendIcon_p4iov_118{color:var(--status-color);flex-shrink:0}._legend_p4iov_118{flex-direction:column;gap:4px;display:flex}._legendItem_p4iov_129{border:1px solid var(--color-border);color:var(--color-text);cursor:pointer;text-align:left;transition:border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);background:0 0;border-radius:9px;align-items:center;gap:9px;padding:8px 10px;font-size:12.5px;font-weight:600;display:flex}._legendItem_p4iov_129:hover{border-color:var(--color-border-strong)}._legendItemOn_p4iov_151{background-color:color-mix(in srgb, var(--status-color) 9%, transparent);border-color:color-mix(in srgb, var(--status-color) 35%, transparent)}._legendOff_p4iov_156{opacity:.55}._legendSwatch_p4iov_160{background-color:var(--status-color);width:18px;height:18px;color:var(--color-on-primary);border-radius:5px;flex-shrink:0;justify-content:center;align-items:center;display:flex}._legendSwatchOff_p4iov_172{border:1.5px solid var(--status-color);background-color:#0000}._drawerHeader_p4iov_177{border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:center;padding-bottom:12px;display:flex}._drawerTitle_p4iov_185{color:var(--color-text);font-size:14px;font-weight:700}._drawerCloseBtn_p4iov_191{border-radius:var(--radius-md);border:1px solid var(--color-border);width:28px;height:28px;color:var(--color-text-mid);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;justify-content:center;align-items:center;display:inline-flex}._drawerCloseBtn_p4iov_191:hover{background-color:var(--color-surface-muted);color:var(--color-text)}@media (width<=1024px){._sidebar_p4iov_4{border-left:none;width:100%;height:100%;overflow-y:auto}._summaryGrid_p4iov_36{grid-template-columns:repeat(2,1fr)}}._scheduleRoot_5za8e_7{background-color:var(--color-bg);flex-direction:column;height:100%;display:flex;overflow:hidden}._toolbar_5za8e_16{background-color:var(--color-surface);border-bottom:1px solid var(--color-border);flex-wrap:wrap;flex-shrink:0;align-items:center;gap:12px;padding:14px 20px;display:flex}._scheduleSelect_5za8e_27{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);height:36px;color:var(--color-text);cursor:pointer;padding:0 10px;font-size:14px;font-weight:600}._weekNav_5za8e_39{align-items:center;gap:4px;display:flex}._dateLabel_5za8e_45{text-align:center;min-width:150px;font-size:var(--font-md);color:var(--color-text-mid);padding:0 6px;font-weight:600}._navBtn_5za8e_54{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:30px;height:30px;color:var(--color-text-mid);cursor:pointer;justify-content:center;align-items:center;transition:background-color .15s,border-color .15s;display:inline-flex}._navBtn_5za8e_54:hover{border-color:var(--color-primary-border);color:var(--color-primary)}._todayBtn_5za8e_75{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-mid);cursor:pointer;margin-left:2px;padding:6px 12px;font-size:12.5px;font-weight:600}._todayBtn_5za8e_75:hover{border-color:var(--color-primary-border);color:var(--color-primary)}._viewChips_5za8e_92{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:8px;margin-left:auto;padding:3px;display:inline-flex}._viewChip_5za8e_92{color:var(--color-text-soft);cursor:pointer;white-space:nowrap;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:6px;padding:5px 12px;font-size:11.5px;font-weight:500;position:relative}._viewChip_5za8e_92:hover{color:var(--color-text)}._viewChipBg_5za8e_119{z-index:0;background-color:var(--color-surface);box-shadow:var(--shadow-sm);border-radius:6px;position:absolute;inset:0}._viewChipLabel_5za8e_128{z-index:1;white-space:nowrap;position:relative}._viewChipActive_5za8e_134,._viewChipActive_5za8e_134:hover{color:var(--color-primary);font-weight:600}._newBtn_5za8e_140{background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;border-radius:9px;align-items:center;gap:6px;padding:9px 18px;font-size:13px;font-weight:700;display:flex;box-shadow:0 4px 12px #045d5e38}._main_5za8e_156{flex:1;min-height:0;display:flex;overflow:hidden}._calArea_5za8e_163{background-color:var(--color-surface);flex-direction:column;flex:1;min-width:0;display:flex;overflow:hidden}._hoursArea_5za8e_172{flex:1;width:100%;max-width:760px;margin:0 auto;padding:20px;overflow-y:auto}._sidebarToggleBtn_5za8e_181{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:32px;height:32px;color:var(--color-text-mid);cursor:pointer;justify-content:center;align-items:center;transition:background-color .15s,border-color .15s,color .15s;display:inline-flex}._sidebarToggleBtn_5za8e_181:hover,._sidebarToggleBtnActive_5za8e_199{border-color:var(--color-primary-border);color:var(--color-primary);background-color:color-mix(in srgb, var(--color-primary) 12%, var(--color-surface))}@media (width>=1025px){._sidebarToggleBtn_5za8e_181{display:none}}@media (width<=1024px){._sidebarToggleBtn_5za8e_181{margin-left:auto}}@media (width<=640px){._toolbar_5za8e_16{gap:8px;padding:10px}._hoursArea_5za8e_172{padding:10px 6px}._weekNav_5za8e_39{justify-content:flex-start;gap:6px;width:auto}._dateLabel_5za8e_45{min-width:auto;padding:0 4px;font-size:13px}._viewChips_5za8e_92{scrollbar-width:none;justify-content:space-between;width:100%;margin-left:0;overflow-x:auto}._viewChips_5za8e_92::-webkit-scrollbar{display:none}._viewChip_5za8e_92{flex-shrink:0;padding:5px 6px;font-size:11px}._newBtn_5za8e_140{justify-content:center;width:100%}}._hours_ftj0h_5{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;gap:10px;max-width:100%;padding:16px;display:flex;overflow-x:auto}._fieldLabel_ftj0h_18{color:var(--color-text-mid);font-size:12px;font-weight:700}._chips_ftj0h_24{flex-wrap:wrap;gap:6px;display:flex}._chipBtn_ftj0h_30{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-mid);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);padding:7px 14px;font-size:12.5px;font-weight:600;position:relative}._chipBtn_ftj0h_30:hover{border-color:var(--color-border-strong);color:var(--color-text)}._chipBtnActive_ftj0h_50,._chipBtnActive_ftj0h_50:hover{color:var(--color-primary);border-color:var(--color-primary-border)}._chipBg_ftj0h_56{z-index:0;border-radius:var(--radius-md);background-color:var(--color-primary-10);position:absolute;inset:0}._chipLabel_ftj0h_64{z-index:1;position:relative}._dayRow_ftj0h_69{border-bottom:1px solid var(--color-divider);align-items:center;gap:12px;padding:6px 0;display:flex}._toggle_ftj0h_77{border-radius:var(--radius-full);background-color:var(--color-border-strong);cursor:pointer;border:none;flex-shrink:0;align-items:center;width:36px;height:20px;padding:2px;display:flex}._toggleOn_ftj0h_90{background-color:var(--color-primary);justify-content:flex-end}._toggleKnob_ftj0h_95{background-color:var(--color-on-primary);border-radius:50%;width:16px;height:16px}._dayName_ftj0h_102{min-width:110px;color:var(--color-text);flex-direction:column;gap:2px;font-size:13.5px;font-weight:600;display:flex}._overflowLabel_ftj0h_112{color:var(--color-text-soft);white-space:nowrap;font-size:10px;font-weight:500}._dayTimes_ftj0h_119{align-items:center;gap:8px;width:100%;max-width:240px;display:flex}._timeInput_ftj0h_127{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);height:32px;color:var(--color-text);flex:1;min-width:0;padding:0 8px;font-family:inherit;font-size:12.5px}._timeInput_ftj0h_127:disabled{opacity:.4}._resetBtn_ftj0h_144{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;align-items:center;gap:4px;margin-left:auto;font-size:11.5px;font-weight:600;display:inline-flex}._resetBtn_ftj0h_144:hover{color:var(--color-primary)}._readonlyField_ftj0h_162{height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface-muted);color:var(--color-text-mid);align-items:center;width:100%;padding:0 10px;font-size:13px;display:flex}._fieldHint_ftj0h_175{font-size:var(--font-xs);color:var(--color-text-soft)}._formFooter_ftj0h_180{justify-content:flex-end;align-items:center;gap:12px;padding-top:6px;display:flex}._formStatus_ftj0h_188{color:var(--color-text-soft);font-size:12px;font-weight:600}._saveBtn_ftj0h_194{height:var(--height-btn);border-radius:var(--radius-md);background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;padding:0 18px;font-size:13px;font-weight:700}._saveBtn_ftj0h_194:disabled{opacity:.5;cursor:not-allowed}._inheritedBanner_ftj0h_212{border-radius:var(--radius-md);margin-bottom:20px;overflow:hidden}._inheritedBadge_ftj0h_218{background-color:var(--color-surface-muted);border:1px solid var(--color-border);font-size:var(--font-sm);color:var(--color-text-mid);flex-direction:column;gap:2px;padding:12px 16px;display:flex}._badgeSub_ftj0h_229{font-size:var(--font-xs);color:var(--color-text-soft)}._customBadge_ftj0h_234{background-color:color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));border:1px solid var(--color-primary-border);font-size:var(--font-sm);color:var(--color-primary);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;display:flex}._customBadgeText_ftj0h_247{font-weight:600}._resetToBranchBtn_ftj0h_251{font-size:var(--font-xs);color:var(--color-primary);border:1px solid var(--color-primary-border);background-color:var(--color-surface);border-radius:var(--radius-md);cursor:pointer;transition:all var(--dur-fast) var(--ease-out);align-items:center;gap:4px;padding:6px 12px;font-weight:600;display:inline-flex}._resetToBranchBtn_ftj0h_251:hover{background-color:var(--color-primary-10);border-color:var(--color-primary)}._settingsGrid_ftj0h_271{gap:var(--space-4);margin-bottom:var(--space-4);padding-bottom:var(--space-4);border-bottom:1px solid var(--color-border);grid-template-columns:1fr 1fr;display:grid}@media (width<=640px){._settingsGrid_ftj0h_271{grid-template-columns:1fr}._hours_ftj0h_5{padding:12px 10px}._dayRow_ftj0h_69{gap:6px;min-width:0;padding:6px 0}._dayName_ftj0h_102{flex:0 0 72px;width:72px;min-width:72px;font-size:12px}._dayTimes_ftj0h_119{gap:4px}._timeInput_ftj0h_127{height:28px;padding:0 4px;font-size:11px}._resetBtn_ftj0h_144{margin-left:4px;padding-right:11px;font-size:11px}._formFooter_ftj0h_180{justify-content:center}}/*$vite$:1*/`})();
1
+ (function(){window.__COMMHUB_SDK_CSS__=`._spinner_164a8_1{border-style:solid;border-color:currentColor #0000 currentColor currentColor;border-radius:50%;animation:.6s linear infinite _spin_164a8_1;display:inline-block}._sm_164a8_10{border-width:2px;width:1rem;height:1rem}._md_164a8_15{border-width:3px;width:1.5rem;height:1.5rem}._lg_164a8_20{border-width:4px;width:2.5rem;height:2.5rem}@keyframes _spin_164a8_1{to{transform:rotate(360deg)}}._button_1xtk2_1{border-radius:var(--radius-md);font:inherit;letter-spacing:-.01em;cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);white-space:nowrap;border:1px solid #0000;justify-content:center;align-items:center;gap:.5rem;font-weight:600;display:inline-flex}._button_1xtk2_1:disabled{opacity:.6;cursor:not-allowed}._button_1xtk2_1:active:not(:disabled){transform:translateY(1px)scale(.985)}._button_1xtk2_1:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}._sm_1xtk2_36{padding:.35rem .75rem;font-size:.85rem}._md_1xtk2_40{padding:.55rem 1rem;font-size:.95rem}._lg_1xtk2_44{padding:.75rem 1.4rem;font-size:1.05rem}._primary_1xtk2_50{background-color:var(--color-primary);color:var(--color-on-primary)}._primary_1xtk2_50:hover:not(:disabled){background-color:var(--color-primary-strong);box-shadow:0 6px 18px var(--color-primary-30);transform:translateY(-1px)}._primary_1xtk2_50:active:not(:disabled){box-shadow:0 2px 8px var(--color-primary-30)}._secondary_1xtk2_63{background-color:var(--color-surface);color:var(--color-text);border-color:var(--color-border-strong)}._secondary_1xtk2_63:hover:not(:disabled){border-color:var(--color-primary);box-shadow:var(--shadow-sm);transform:translateY(-1px)}._ghost_1xtk2_74{color:var(--color-text);background-color:#0000}._ghost_1xtk2_74:hover:not(:disabled){background-color:var(--color-surface-muted)}._danger_1xtk2_82{background-color:var(--color-danger);color:var(--color-on-primary)}._danger_1xtk2_82:hover:not(:disabled){background-color:var(--color-danger-strong);box-shadow:0 6px 18px var(--color-danger-soft);transform:translateY(-1px)}._fullWidth_1xtk2_92{width:100%}._loadingTextHidden_1xtk2_96{display:none}._alert_r5ybz_1{border-radius:var(--radius-md);border:1px solid #0000;align-items:flex-start;gap:.6rem;padding:.75rem 1rem;font-size:.9rem;line-height:1.4;display:flex}._error_r5ybz_12{background-color:var(--color-danger-soft);border-color:var(--color-danger);color:var(--color-danger-strong)}._info_r5ybz_18{background-color:var(--color-surface-muted);border-color:var(--color-border);color:var(--color-text)}._success_r5ybz_24{background-color:var(--color-success-soft);border-color:var(--color-success);color:var(--color-success-strong)}._title_r5ybz_30{margin:0 0 .15rem;font-weight:600}._body_r5ybz_35{white-space:pre-line;margin:0}._field_i2e93_1{flex-direction:column;gap:.35rem;display:flex}._label_i2e93_7{color:var(--color-text);font-size:.85rem;font-weight:600}._input_i2e93_13{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);font:inherit;padding:.6rem .75rem}._input_i2e93_13:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-focus);outline:none}._invalid_i2e93_28{border-color:var(--color-danger)}._error_i2e93_32{color:var(--color-danger-strong);font-size:.8rem}._select_1yaeg_3{height:var(--height-input,38px);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);appearance:none;color:var(--color-text);transition:border-color var(--dur-fast) var(--ease-out);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");background-position:right 10px center;background-repeat:no-repeat;outline:none;padding:0 34px 0 12px;font-family:inherit;font-size:13px}._select_1yaeg_3:focus-visible{border-color:var(--color-primary-border)}._select_1yaeg_3:disabled{opacity:.6;cursor:not-allowed}._iconButton_2jhbr_1{border-radius:var(--radius-md);width:2rem;height:2rem;color:var(--color-text);cursor:pointer;background-color:#0000;border:1px solid #0000;justify-content:center;align-items:center;padding:0;line-height:1;transition:background-color .15s,color .15s;display:inline-flex}._iconButton_2jhbr_1:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}._iconButton_2jhbr_1:disabled{opacity:.6;cursor:not-allowed}._ghost_2jhbr_29:hover:not(:disabled){background-color:var(--color-surface-muted)}._danger_2jhbr_33{color:var(--color-danger-strong)}._danger_2jhbr_33:hover:not(:disabled){background-color:var(--color-danger-soft)}._overlay_1u32w_1{background-color:var(--color-overlay);z-index:90;position:fixed;inset:0}._positioner_1u32w_11{z-index:91;width:calc(100% - 2rem);max-width:440px;height:fit-content;max-height:calc(100vh - 2rem);margin:auto;display:flex;position:fixed;inset:0}._positionerMedium_1u32w_25{max-width:560px}._positionerWide_1u32w_30{max-width:960px}._overlayHi_1u32w_35{z-index:100}._positionerHi_1u32w_39{z-index:101}._positioner_1u32w_11:focus-visible{outline:none}._content_1u32w_9{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);width:100%;max-height:calc(100vh - 2rem);box-shadow:var(--shadow-lg);flex-direction:column;gap:1rem;padding:1.5rem;display:flex;overflow:hidden}._header_1u32w_62{flex-shrink:0;justify-content:space-between;align-items:flex-start;gap:1rem;display:flex}._heading_1u32w_70{flex-direction:column;gap:.25rem;display:flex}._title_1u32w_76{color:var(--color-text);margin:0;font-size:1.15rem;font-weight:600}._description_1u32w_83{color:var(--color-text-muted);margin:0;font-size:.9rem}._body_1u32w_89{min-height:0;color:var(--color-text);margin:-2px -4px;padding:2px 4px;font-size:.95rem;overflow-y:auto}._footer_1u32w_98{flex-shrink:0;justify-content:flex-end;gap:.5rem;display:flex}@media (width<=768px){._positioner_1u32w_11{width:100%;max-width:none;height:auto;max-height:90vh;margin:0;inset:auto 0 0}._content_1u32w_9{border-radius:var(--radius-lg) var(--radius-lg) 0 0;max-height:90vh;padding-bottom:calc(1.5rem + env(safe-area-inset-bottom,0px));border-bottom:none;border-left:none;border-right:none}}@media (width<=480px){._footer_1u32w_98{flex-direction:column-reverse;align-items:stretch}._footer_1u32w_98>*{border-color:var(--color-border-strong);width:100%}}._overlay_1rzp2_1{background-color:var(--color-overlay);z-index:80;position:fixed;inset:0}._overlay_1rzp2_1[data-state=open]{animation:.16s _drawerFadeIn_1rzp2_1}._overlay_1rzp2_1[data-state=closed]{animation:.14s forwards _drawerFadeOut_1rzp2_1}._panelLeft_1rzp2_17,._panelRight_1rzp2_18{background-color:var(--color-surface);width:min(286px,86vw);box-shadow:var(--shadow-lg);z-index:81;flex-direction:column;display:flex;position:fixed;top:0;bottom:0;overflow:hidden}._body_1rzp2_32{flex:1;min-height:0;overflow-y:auto}._footer_1rzp2_38{flex-shrink:0}._panelLeft_1rzp2_17{left:0}._panelRight_1rzp2_18{width:min(420px,92vw);right:0}._panelWide_1rzp2_52{width:min(760px,96vw)}._panelLeft_1rzp2_17[data-state=open]{animation:.28s cubic-bezier(.16,1,.3,1) _drawerSlideInLeft_1rzp2_1}._panelLeft_1rzp2_17[data-state=closed]{animation:.2s ease-in forwards _drawerSlideOutLeft_1rzp2_1}._panelRight_1rzp2_18[data-state=open]{animation:.28s cubic-bezier(.16,1,.3,1) _drawerSlideInRight_1rzp2_1}._panelRight_1rzp2_18[data-state=closed]{animation:.2s ease-in forwards _drawerSlideOutRight_1rzp2_1}@keyframes _drawerFadeIn_1rzp2_1{0%{opacity:0}to{opacity:1}}@keyframes _drawerFadeOut_1rzp2_1{0%{opacity:1}to{opacity:0}}@keyframes _drawerSlideInLeft_1rzp2_1{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes _drawerSlideOutLeft_1rzp2_1{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes _drawerSlideInRight_1rzp2_1{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes _drawerSlideOutRight_1rzp2_1{0%{transform:translate(0)}to{transform:translate(100%)}}@media (prefers-reduced-motion:reduce){._overlay_1rzp2_1[data-state=open],._overlay_1rzp2_1[data-state=closed],._panelLeft_1rzp2_17[data-state=open],._panelLeft_1rzp2_17[data-state=closed],._panelRight_1rzp2_18[data-state=open],._panelRight_1rzp2_18[data-state=closed]{animation:none}}._srOnly_1rzp2_138{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}._content_5rs2x_1{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);min-width:180px;box-shadow:var(--shadow-md);z-index:1000;flex-direction:column;gap:.125rem;padding:.35rem;display:flex}._header_5rs2x_14{padding:.35rem .35rem .15rem}._separator_5rs2x_18{background-color:var(--color-border);height:1px;margin:.2rem .15rem}._item_5rs2x_24{border-radius:var(--radius-md);color:var(--color-text);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;align-items:center;gap:.5rem;padding:.45rem .6rem;font-size:.9rem;display:flex}._item_5rs2x_24[data-highlighted]{background-color:var(--color-surface-muted)}._item_5rs2x_24[data-disabled]{opacity:.5;pointer-events:none}._danger_5rs2x_46{color:var(--color-danger-strong)}._danger_5rs2x_46[data-highlighted]{background-color:var(--color-danger-soft)}._icon_5rs2x_54{align-items:center;display:inline-flex}._subChevron_5rs2x_60{opacity:.55;margin-left:auto}._item_5rs2x_24[data-state=open]{background-color:var(--color-surface-muted)}._content_19re1_1{--tooltip-bg:#334155;--tooltip-color:#fff;background-color:var(--tooltip-bg);color:var(--tooltip-color);border-radius:var(--radius-md);box-shadow:var(--shadow-md);z-index:70;-webkit-user-select:none;user-select:none;padding:.35rem .55rem;font-size:.8rem;line-height:1.3}._arrow_19re1_16{fill:var(--tooltip-bg)}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])) ._content_19re1_1{--tooltip-bg:#1d3135;--tooltip-color:#3fb5b7}}:host([data-theme=dark]) ._content_19re1_1{--tooltip-bg:#1d3135;--tooltip-color:#3fb5b7}._container_yjtbg_1{top:var(--space-6);z-index:1000;align-items:center;gap:var(--space-2);pointer-events:none;flex-direction:column;display:flex;position:fixed;left:50%;transform:translate(-50%)}._toast_yjtbg_14{background-color:var(--color-surface);color:var(--color-text);padding:10px var(--space-4);border-radius:var(--radius-full);box-shadow:var(--shadow-lg);border:1px solid var(--color-border);pointer-events:auto;cursor:pointer;align-items:center;gap:10px;min-width:250px;display:flex}._iconWrap_yjtbg_29{justify-content:center;align-items:center;display:flex}._type_success_yjtbg_35{color:var(--color-success)}._type_error_yjtbg_39{color:var(--color-danger)}._type_info_yjtbg_43{color:var(--color-primary)}._message_yjtbg_47{font-size:var(--font-sm);font-weight:500}._card_mk3l2_1{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);min-width:0}._padSm_mk3l2_8{padding:var(--space-3)}._padMd_mk3l2_12{padding:var(--space-4)}._padLg_mk3l2_16{padding:var(--space-5)}._shadowSm_mk3l2_20{box-shadow:var(--shadow-sm)}._shadowMd_mk3l2_24{box-shadow:var(--shadow-md)}._interactive_mk3l2_28{cursor:pointer;transition:border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out)}._interactive_mk3l2_28:hover{border-color:var(--color-primary-border);box-shadow:var(--shadow-lg);transform:translateY(-2px)}._interactive_mk3l2_28:active{box-shadow:var(--shadow-sm);transform:translateY(0)}._avatar_eiy4h_1{width:var(--avatar-size,36px);height:var(--avatar-size,36px);background-color:var(--avatar-color,var(--color-primary));color:var(--color-on-primary);font-size:var(--avatar-font,13px);text-transform:uppercase;-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;font-weight:700;line-height:1;display:inline-flex}._circle_eiy4h_17{border-radius:50%}._rounded_eiy4h_21{border-radius:var(--radius-md)}._badge_cz5qm_1{border-radius:var(--radius-full);font-size:var(--font-xs);white-space:nowrap;border:1px solid #0000;align-items:center;gap:4px;padding:3px 9px;font-weight:700;line-height:1;display:inline-flex}._sm_cz5qm_14{padding:2px 7px;font-size:10px}._toneNeutral_cz5qm_20{--tone:var(--color-text-soft)}._tonePrimary_cz5qm_24{--tone:var(--color-primary)}._toneSecondary_cz5qm_28{--tone:var(--color-secondary)}._toneSuccess_cz5qm_32{--tone:var(--color-success)}._toneDanger_cz5qm_36{--tone:var(--color-danger)}._toneWarn_cz5qm_40{--tone:var(--color-warn)}._soft_cz5qm_44{background-color:color-mix(in srgb, var(--tone) 12%, transparent);color:var(--tone);border-color:color-mix(in srgb, var(--tone) 22%, transparent)}._solid_cz5qm_50{background-color:var(--tone);color:var(--color-on-primary)}._outline_cz5qm_55{color:var(--tone);border-color:color-mix(in srgb, var(--tone) 42%, transparent)}._skeleton_qqc08_1{background-color:var(--color-surface-muted);animation:1.5s ease-in-out infinite _skeletonPulse_qqc08_1;display:block}._line_qqc08_7{width:var(--sk-w,100%);height:var(--sk-h,12px);border-radius:var(--radius-sm)}._circle_qqc08_13{width:var(--sk-w,36px);height:var(--sk-h,36px);border-radius:50%}._block_qqc08_19{width:var(--sk-w,100%);height:var(--sk-h,80px);border-radius:var(--radius-md)}@keyframes _skeletonPulse_qqc08_1{0%,to{opacity:1}50%{opacity:.5}}@media (prefers-reduced-motion:reduce){._skeleton_qqc08_1{animation:none}}._group_dsmc8_1{border-radius:var(--radius-full);background-color:var(--color-surface-muted);flex-wrap:wrap;gap:4px;padding:4px;display:inline-flex}@media (width<=640px){._group_dsmc8_1{scrollbar-width:none;-ms-overflow-style:none;flex-wrap:nowrap;display:flex;overflow-x:auto}._group_dsmc8_1::-webkit-scrollbar{display:none}._seg_dsmc8_21{white-space:nowrap;flex-shrink:0}}._seg_dsmc8_21{border-radius:var(--radius-full);color:var(--color-text-soft);font:inherit;font-size:var(--font-sm);cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;padding:6px 14px;font-weight:600;transition:background-color .15s,color .15s;display:inline-flex}._seg_dsmc8_21:hover{color:var(--color-text)}._segActive_dsmc8_49,._segActive_dsmc8_49:hover{background-color:var(--color-surface);color:var(--color-primary);box-shadow:var(--shadow-sm)}._seg_dsmc8_21:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}._count_dsmc8_61{border-radius:var(--radius-full);background-color:color-mix(in srgb, currentColor 16%, transparent);padding:0 6px;font-size:10px;font-weight:700}._container_wnsra_3{width:100%;display:inline-flex;position:relative}._trigger_wnsra_9{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;height:32px;color:var(--color-text);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);justify-content:space-between;align-items:center;gap:6px;padding:0 8px;font-family:inherit;font-size:12.5px;font-weight:600;display:inline-flex}._trigger_wnsra_9:hover:not(:disabled){border-color:var(--color-border-strong);background-color:var(--color-surface-hover,var(--color-surface))}._trigger_wnsra_9:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary-10);outline:none}._triggerActive_wnsra_43{border-color:var(--color-primary)}._trigger_wnsra_9:disabled{opacity:.4;cursor:not-allowed}._timeText_wnsra_52{font-feature-settings:"tnum";font-variant-numeric:tabular-nums;white-space:nowrap}._icon_wnsra_58{color:var(--color-text-soft);flex-shrink:0}._popover_wnsra_65{z-index:1000;border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-lg,0 10px 25px -5px #0006);flex-direction:column;gap:8px;width:220px;padding:8px;display:flex;position:absolute}._popoverTop_wnsra_79{bottom:calc(100% + 4px)}._popoverBottom_wnsra_83{top:calc(100% + 4px)}._popoverLeft_wnsra_87{left:0}._popoverRight_wnsra_91{right:0}._headerPills_wnsra_97{gap:4px;width:100%;display:flex}._pill_wnsra_103{border-radius:var(--radius-sm,4px);background-color:var(--color-primary-10);border:1px solid var(--color-primary-border);height:28px;color:var(--color-primary);font-feature-settings:"tnum";flex:1;justify-content:center;align-items:center;font-size:13px;font-weight:700;display:flex}._pickerBody_wnsra_120{gap:4px;width:100%;height:160px;display:flex}._column_wnsra_127{scrollbar-width:thin;border-radius:var(--radius-sm,4px);background-color:var(--color-bg);border:1px solid var(--color-border);flex-direction:column;flex:1;gap:2px;padding:4px 2px;display:flex;overflow-y:auto}._column_wnsra_127::-webkit-scrollbar{width:3px}._column_wnsra_127::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:var(--radius-full)}._wheelItem_wnsra_149{border-radius:var(--radius-sm,4px);height:30px;min-height:30px;color:var(--color-text-mid);cursor:pointer;transition:all var(--dur-fast) var(--ease-out);background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;font-family:inherit;font-size:12.5px;font-weight:500;display:flex}._wheelItem_wnsra_149:hover{background-color:var(--color-surface-hover,#ffffff14);color:var(--color-text)}._wheelItemActive_wnsra_172,._wheelItemActive_wnsra_172:hover{background-color:var(--color-primary);color:var(--color-on-primary);font-weight:700}._wheelItemDisabled_wnsra_179,._wheelItemDisabled_wnsra_179:hover{opacity:.3;cursor:not-allowed;color:var(--color-text-soft);pointer-events:none;background:0 0}._root_1d1de_1{height:100%;min-height:0;display:flex}._fullCenter_1d1de_7{flex:1;place-items:center;display:grid}._list_1d1de_14{border-right:1px solid var(--color-border);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;width:360px;min-height:0;display:flex}._listHead_1d1de_24{justify-content:space-between;align-items:center;padding:16px 18px 8px;display:flex}._listTitle_1d1de_31{font-size:var(--font-lg);color:var(--color-text);margin:0;font-weight:600}._composeBtn_1d1de_38{border-radius:var(--radius-md);background-color:var(--color-primary-10);width:32px;height:32px;color:var(--color-primary);cursor:pointer;border:none;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .14s,transform .14s;display:inline-flex}._composeBtn_1d1de_38:hover{background-color:var(--color-primary);color:var(--color-on-primary);transform:translateY(-1px)}._menuItemContent_1d1de_61{align-items:center;gap:12px;padding:4px 2px;display:flex}._chatIconTile_1d1de_68,._groupIconTile_1d1de_69{border-radius:var(--radius-md);flex-shrink:0;justify-content:center;align-items:center;width:38px;height:38px;display:inline-flex}._chatIconTile_1d1de_68{background-color:var(--color-primary-10);color:var(--color-primary)}._groupIconTile_1d1de_69{background-color:var(--color-secondary-10);color:var(--color-secondary)}._menuItemText_1d1de_89{text-align:left;flex-direction:column;align-items:flex-start;gap:2px;display:flex}._menuItemTitle_1d1de_97{color:var(--color-text);font-size:13.5px;font-weight:600;line-height:1.2}._menuItemSub_1d1de_104{color:var(--color-text-soft);font-size:11.5px;line-height:1.2}._search_1d1de_110{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:36px;color:var(--color-text-soft);align-items:center;gap:8px;margin:0 14px 8px;padding:0 10px;display:flex}._searchInput_1d1de_122{color:var(--color-text);background:0 0;border:none;outline:none;flex:1;font-size:13px}._searchClearBtn_1d1de_131{color:var(--color-text-soft);cursor:pointer;border-radius:var(--radius-sm);background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:color .14s;display:inline-flex}._searchClearBtn_1d1de_131:hover{color:var(--color-text)}._tabsWrapper_1d1de_148{align-items:center;display:flex;position:relative}._tabs_1d1de_148{border-bottom:1px solid var(--color-border);scrollbar-width:none;gap:2px;width:100%;padding:0 12px 8px;display:flex;overflow-x:auto}._tabs_1d1de_148::-webkit-scrollbar{display:none}._arrowBtn_1d1de_168{border-radius:var(--radius-full);color:#045d5e;cursor:pointer;z-index:10;width:24px;height:24px;box-shadow:var(--shadow-sm);background-color:#aecacb;border:1px solid #045d5e;justify-content:center;align-items:center;margin-top:-4px;transition:background-color .14s,color .14s,border-color .14s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}._arrowBtn_1d1de_168:hover{color:#045d5e;background-color:#aecacb;border-color:#045d5e}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])) ._arrowBtn_1d1de_168,:host(:not([data-theme=light])) ._arrowBtn_1d1de_168:hover{color:#3fb5b7;background-color:#1d3135;border-color:#3fb5b7}}:host([data-theme=dark]) ._arrowBtn_1d1de_168,:host([data-theme=dark]) ._arrowBtn_1d1de_168:hover{color:#3fb5b7;background-color:#1d3135;border-color:#3fb5b7}._arrowLeft_1d1de_223{left:4px}._arrowRight_1d1de_227{right:4px}._tabs_1d1de_148:after{content:"";flex:0 0 8px}._tab_1d1de_148{color:var(--color-text-soft);border-radius:var(--radius-full);cursor:pointer;white-space:nowrap;background:0 0;border:none;flex-shrink:0;align-items:center;gap:5px;padding:6px 10px;font-size:11.5px;font-weight:600;display:inline-flex;position:relative}._tab_1d1de_148:hover{color:var(--color-text)}._tabActive_1d1de_259,._tabActive_1d1de_259:hover{color:var(--color-primary)}._tabBg_1d1de_264{z-index:0;border-radius:var(--radius-full);background-color:var(--color-primary-10);box-shadow:inset 0 0 0 1px var(--color-primary-border);position:absolute;inset:0}._tabLabel_1d1de_273{z-index:1;position:relative}._tabCount_1d1de_278{z-index:1;border-radius:var(--radius-full);background-color:var(--color-secondary);min-width:16px;color:var(--color-on-primary);text-align:center;padding:0 5px;font-size:9px;font-weight:700;line-height:16px;position:relative}._tabDot_1d1de_292{z-index:1;background-color:var(--color-secondary);border-radius:50%;width:6px;height:6px;position:relative}._rows_1d1de_301{scrollbar-width:none;flex:1;min-height:0;padding:6px 0;overflow-y:auto}@media (width<=425px){._rows_1d1de_301{padding-bottom:var(--bottom-nav-offset,50px);transition:padding-bottom var(--dur-base) var(--ease-out)}}._rows_1d1de_301:hover{scrollbar-width:thin}._rows_1d1de_301::-webkit-scrollbar{background:0 0;width:5px}._rows_1d1de_301::-webkit-scrollbar-thumb{border-radius:var(--radius-full);background:0 0}._rows_1d1de_301:hover::-webkit-scrollbar-thumb{background:var(--color-border)}._rows_1d1de_301:hover::-webkit-scrollbar-thumb:hover{background:var(--color-border-strong)}._empty_1d1de_338{text-align:center;color:var(--color-text-soft);padding:24px 18px;font-size:13px}._sentinel_1d1de_347{flex-shrink:0;height:1px}._loadMore_1d1de_352{justify-content:center;align-items:center;padding:12px 0 16px;display:flex}._row_1d1de_301{border-left:3px solid #0000;align-items:center;display:flex;position:relative}._row_1d1de_301:hover{background-color:var(--color-surface-muted)}._rowActive_1d1de_370{border-left-color:var(--color-primary);background-color:var(--color-primary-05)}._rowMain_1d1de_375{cursor:pointer;text-align:left;background:0 0;border:none;flex:1;align-items:center;gap:11px;min-width:0;padding:9px 4px 9px 15px;display:flex}._rowMenuBtn_1d1de_388{border-radius:var(--radius-md);width:28px;height:28px;color:var(--color-text-soft);cursor:pointer;opacity:1;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;margin-right:10px;transition:background-color .12s,color .12s;display:inline-flex}._rowMenuBtn_1d1de_388:hover{background-color:var(--color-border);color:var(--color-text)}._rowPin_1d1de_412{width:12px;height:12px;color:var(--color-text-soft);flex-shrink:0}._rowStar_1d1de_419{width:12px;height:12px;color:var(--color-secondary);flex-shrink:0}._rowAvatar_1d1de_426{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:12px;font-weight:700;display:flex;position:relative}._onlineDot_1d1de_441{background-color:var(--color-success);border:2px solid var(--color-surface);border-radius:50%;width:9px;height:9px;position:absolute;bottom:0;right:0}._rowBody_1d1de_452{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._rowTop_1d1de_460{justify-content:space-between;align-items:center;gap:6px;display:flex}._rowName_1d1de_467{min-width:0;font-size:var(--font-base);color:var(--color-text);flex:1;align-items:center;gap:4px;font-weight:600;display:flex}._rowTitle_1d1de_478{line-clamp:2;-webkit-line-clamp:2;word-break:break-word;-webkit-box-orient:vertical;flex:1;min-width:0;line-height:1.3;display:-webkit-box;overflow:hidden}._rowTime_1d1de_490{font-size:var(--font-xs);color:var(--color-text-soft);flex-shrink:0}._rowBottom_1d1de_496{justify-content:space-between;align-items:center;gap:6px;display:flex}._rowPreview_1d1de_503{color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}._rowRole_1d1de_511{color:var(--color-primary);font-size:9px;font-weight:600}._unread_1d1de_517{text-align:center;border-radius:var(--radius-full);background-color:var(--color-secondary);min-width:16px;color:var(--color-on-primary);flex-shrink:0;padding:1px 6px;font-size:9.5px;font-weight:700}._view_1d1de_530{background-color:var(--color-bg);flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}._viewEmpty_1d1de_542{text-align:center;background-color:var(--color-bg);flex-direction:column;flex:1;justify-content:center;align-items:center;padding:40px;display:flex}._emptyIconWrap_1d1de_553{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:64px;height:64px;color:var(--color-text-soft);justify-content:center;align-items:center;margin-bottom:16px;display:flex}._emptyTitle_1d1de_565{font-size:var(--font-lg);color:var(--color-text);margin:0 0 8px;font-weight:700}._emptyText_1d1de_572{font-size:var(--font-sm);color:var(--color-text-soft);max-width:250px;margin:0;line-height:1.5}._viewHead_1d1de_580{background-color:var(--color-surface);border-bottom:1px solid var(--color-border);flex-shrink:0;align-items:center;gap:11px;padding:12px 20px;display:flex}._viewAvatarWrap_1d1de_590{flex-shrink:0;display:inline-flex;position:relative}._viewAvatar_1d1de_590{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);border-radius:50%;justify-content:center;align-items:center;font-size:12px;font-weight:700;display:flex}._viewPresenceDot_1d1de_609{width:12px;height:12px}._viewHeadText_1d1de_614{flex-direction:column;flex:1;min-width:0;line-height:1.25;display:flex}._viewIcon_1d1de_622{border-radius:var(--radius-md);background-color:color-mix(in srgb, var(--avatar-color) 16%, transparent);width:36px;height:36px;color:var(--avatar-color);flex-shrink:0;justify-content:center;align-items:center;display:flex}._viewTitleRow_1d1de_634{flex:1;align-items:center;gap:6px;min-width:0;display:flex}._viewTitle_1d1de_634{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:700;overflow:hidden}._statusPill_1d1de_653{background-color:var(--pill);color:var(--color-on-primary);letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;border-radius:5px;flex-shrink:0;padding:3px 7px;font-size:9px;font-weight:700}._adminBadge_1d1de_666{background-color:var(--color-primary-10);color:var(--color-primary);letter-spacing:.05em;text-transform:uppercase;white-space:nowrap;border-radius:5px;flex-shrink:0;padding:2px 7px;font-size:8.5px;font-weight:800}._viewSub_1d1de_679{color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;font-size:11.5px;overflow:hidden}._headEnd_1d1de_687{flex-shrink:0;align-items:center;gap:6px;display:flex}._memberStack_1d1de_694{align-items:center;display:flex}._memberAvatar_1d1de_699{border:2px solid var(--color-surface);border-radius:50%;line-height:0;display:inline-flex}._memberAvatar_1d1de_699:not(:first-child){margin-left:-8px}._memberMore_1d1de_710{border:2px solid var(--color-surface);background-color:var(--color-surface-muted);width:26px;height:26px;color:var(--color-text-mid);border-radius:50%;justify-content:center;align-items:center;margin-left:-8px;font-size:10px;font-weight:700;display:inline-flex}._headMenuBtn_1d1de_725{border-radius:var(--radius-md);width:32px;height:32px;color:var(--color-text-mid);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}._headMenuBtn_1d1de_725:hover{background-color:var(--color-surface-muted)}._threadWrap_1d1de_743{flex-direction:column;flex:1;min-height:0;display:flex;position:relative}._messages_1d1de_535{background-color:var(--color-bg);background-image:radial-gradient(var(--color-border-strong) .5px, transparent .5px);background-size:22px 22px;flex-direction:column;flex:1;padding:20px;display:flex;overflow:hidden auto}._thread_1d1de_743{flex-direction:column;gap:2px;margin-top:auto;display:flex}._center_1d1de_776{place-items:center;padding:24px 0;display:grid}._olderRow_1d1de_783{flex-shrink:0;justify-content:center;padding:4px 0 8px;display:flex}._newPill_1d1de_791{z-index:5;border:1px solid var(--color-primary-border);border-radius:var(--radius-full);background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;box-shadow:var(--shadow-lg);align-items:center;gap:4px;padding:6px 14px;font-size:11px;font-weight:600;transition:background-color .12s;display:inline-flex;position:absolute;bottom:12px;left:50%;transform:translate(-50%)}._newPill_1d1de_791:hover{background-color:var(--color-primary-strong)}._sendFailed_1d1de_817{align-items:center;gap:4px;display:inline-flex}._sendFailedText_1d1de_823{opacity:.85;font-size:9.5px;font-weight:600}._retryBtn_1d1de_829{color:inherit;cursor:pointer;background:0 0;border:none;padding:0;font-size:9.5px;font-weight:700;text-decoration:underline}._retryBtn_1d1de_829:hover{opacity:.85}._systemRow_1d1de_844{justify-content:center;margin:8px 0;padding:2px 0;display:flex}._systemPill_1d1de_851{border-radius:var(--radius-full);background-color:var(--color-surface-muted);max-width:82%;color:var(--color-text-soft);text-align:center;padding:4px 12px;font-size:11px;font-weight:500}._msgRow_1d1de_768{justify-content:flex-start;align-items:flex-end;gap:8px;display:flex}._msgRowGroupStart_1d1de_768{margin-top:10px}._msgRowMe_1d1de_875{justify-content:flex-end}._msgAvatarSpacer_1d1de_880{flex-shrink:0;width:28px}._dateSep_1d1de_886{justify-content:center;margin:8px 0 2px;display:flex}._dateSepPill_1d1de_892{border-radius:var(--radius-full);background-color:var(--color-surface);color:var(--color-text-soft);letter-spacing:.02em;border:1px solid var(--color-border);box-shadow:var(--shadow-sm);padding:3px 12px;font-size:10.5px;font-weight:600}._msgBubbleWrap_1d1de_904{align-items:center;gap:4px;display:flex;position:relative}._msgRowMe_1d1de_875 ._msgBubbleWrap_1d1de_904{flex-direction:row-reverse}._reactWrap_1d1de_915{flex-shrink:0;position:relative}._reactBtn_1d1de_920{width:24px;height:24px;color:var(--color-text-soft);cursor:pointer;opacity:0;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;transition:opacity .12s,background-color .12s;display:inline-flex}._msgRow_1d1de_768:hover ._reactBtn_1d1de_920{opacity:1}._reactBtn_1d1de_920:hover{background-color:var(--color-surface-muted);color:var(--color-primary)}._reactPop_1d1de_946{z-index:20;border-radius:var(--radius-full);background-color:var(--color-surface);border:1px solid var(--color-border);box-shadow:var(--shadow-lg);gap:2px;max-width:calc(100vw - 32px);padding:3px;display:flex;position:absolute;bottom:calc(100% + 6px)}._reactPopRight_1d1de_961{left:-50px;right:auto}._reactPopLeft_1d1de_967{left:auto;right:-27px}._reactPopBtn_1d1de_972{cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;width:24px;height:26px;font-size:15px;transition:transform .1s;display:inline-flex}._reactPopBtn_1d1de_972:hover{background-color:var(--color-surface-muted);transform:scale(1.18)}._msgAvatar_1d1de_880{background-color:var(--avatar-color);width:28px;height:28px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:10px;font-weight:700;display:flex}._msgCol_1d1de_1005{flex-direction:column;min-width:0;max-width:65%;display:flex}._msgColWithReactions_1d1de_1012{padding-bottom:12px}._bubble_1d1de_1016{font-size:12.5px;line-height:var(--line-body);overflow-wrap:anywhere;flex-direction:column;padding:9px 13px;display:flex;box-shadow:0 1px 3px #045d5e0f}._bubbleThem_1d1de_1026{background-color:var(--color-surface);color:var(--color-text);border:1px solid var(--color-border);border-radius:14px 14px 14px 4px}._bubbleMe_1d1de_1033{background-color:var(--color-primary);color:var(--color-on-primary);border-radius:14px 14px 4px}._msgAuthor_1d1de_1039{color:var(--color-primary);white-space:nowrap;text-overflow:ellipsis;margin-bottom:2px;font-size:11px;font-weight:700;overflow:hidden}._bubbleMe_1d1de_1033 ._msgAuthor_1d1de_1039{color:var(--color-on-primary)}._msgText_1d1de_1053{white-space:pre-wrap;word-break:break-word}._msgTextDeleted_1d1de_1058{opacity:.75;font-style:italic}._msgMeta_1d1de_1063{white-space:nowrap;flex-shrink:0;align-self:flex-end;align-items:center;gap:4px;margin-top:1px;display:inline-flex}._msgTime_1d1de_1073{opacity:.7;font-size:9.5px;font-weight:500}._tick_1d1de_1080{opacity:.7;align-items:center;display:inline-flex}._tickRead_1d1de_1086{opacity:1;color:var(--color-primary-light)}._reactionPill_1d1de_1091{z-index:2;border-radius:var(--radius-full);background-color:var(--color-surface);border:1.5px solid var(--color-border);cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:4px;padding:2px 6px;transition:transform .12s,border-color .12s,background-color .12s;display:inline-flex;position:absolute;bottom:-11px;box-shadow:0 2px 4px #0000000f,0 1px 2px #0000000a}._reactionPill_1d1de_1091:hover{border-color:var(--color-primary-border);background-color:var(--color-surface-muted);transform:scale(1.05)}._reactionPillActive_1d1de_1119{background-color:var(--color-primary-10);border-color:var(--color-primary-border)}._reactionsMe_1d1de_1124{right:14px}._reactionsThem_1d1de_1128{left:14px}._reactionEmojis_1d1de_1132{letter-spacing:-1.5px;align-items:center;padding-right:1.5px;font-size:11px;display:inline-flex}._reactionCount_1d1de_1140{color:var(--color-text-mid);font-size:10px;font-weight:700;line-height:1}._reactionPillActive_1d1de_1119 ._reactionCount_1d1de_1140{color:var(--color-primary)}._reactionOn_1d1de_1151:hover{background-color:var(--color-primary-10)}._composer_1d1de_1156{background-color:var(--color-surface);border-top:1px solid var(--color-border);flex-shrink:0;align-items:flex-end;gap:6px;padding:12px 20px;display:flex}._removedComposer_1d1de_1167{background-color:var(--color-surface-muted);border-top:1px solid var(--color-border);color:var(--color-text-soft);text-align:center;flex-shrink:0;justify-content:center;align-items:center;gap:8px;padding:14px 20px;font-size:12.5px;display:flex}._attachTray_1d1de_1182{background-color:var(--color-surface-muted);border-top:1px solid var(--color-border);flex-wrap:wrap;flex-shrink:0;align-items:center;gap:8px;max-height:176px;padding:10px 20px;display:flex;overflow-y:auto}._attachItem_1d1de_1195{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);flex-shrink:0;width:72px;height:72px;position:relative;overflow:hidden}._attachThumb_1d1de_1206{object-fit:cover;width:100%;height:100%;display:block}._attachFile_1d1de_1213{width:100%;height:100%;color:var(--color-text-soft);flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:6px;display:flex}._attachFileName_1d1de_1225{text-overflow:ellipsis;white-space:nowrap;max-width:100%;font-size:9px;line-height:1.2;overflow:hidden}._attachRemove_1d1de_1234{border:1px solid var(--color-border);background-color:var(--color-surface);width:18px;height:18px;color:var(--color-text);cursor:pointer;box-shadow:var(--shadow-sm);border-radius:50%;justify-content:center;align-items:center;transition:color .12s;display:inline-flex;position:absolute;top:3px;right:3px}._attachRemove_1d1de_1234:hover{color:var(--color-danger)}._attachAdd_1d1de_1256{border:1px dashed var(--color-border-strong);border-radius:var(--radius-md);background-color:var(--color-surface);width:72px;height:72px;color:var(--color-text-soft);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;transition:color .12s,border-color .12s;display:inline-flex}._attachAdd_1d1de_1256:hover{color:var(--color-primary);border-color:var(--color-primary-border)}._composerIcon_1d1de_1278{width:38px;height:38px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .12s,color .12s;display:inline-flex}._composerIcon_1d1de_1278:hover{background-color:var(--color-surface-muted);color:var(--color-primary)}._composerInput_1d1de_1300{border:1px solid var(--color-border);background-color:var(--color-bg);min-height:40px;max-height:120px;color:var(--color-text);resize:none;border-radius:19px;outline:none;flex:1;padding:10px 16px;font-family:inherit;font-size:13px;line-height:1.4;transition:border-color .12s,box-shadow .12s}._composerInput_1d1de_1300:focus{border-color:var(--color-primary-border);box-shadow:0 0 0 3px var(--color-primary-10)}._emojiWrap_1d1de_1325{flex-shrink:0;position:relative}._emojiBackdrop_1d1de_1330{z-index:15;cursor:default;background:0 0;border:none;position:fixed;inset:0}._emojiPop_1d1de_1339{z-index:20;border-radius:var(--radius-lg);background-color:var(--color-surface);border:1px solid var(--color-border);width:224px;box-shadow:var(--shadow-lg);grid-template-columns:repeat(5,1fr);gap:2px;padding:8px;display:grid;position:absolute;bottom:calc(100% + 8px);left:0}._emojiBtn_1d1de_1355{border-radius:var(--radius-md);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;width:38px;height:38px;font-size:18px;transition:background-color .1s,transform .1s;display:inline-flex}._emojiBtn_1d1de_1355:hover{background-color:var(--color-surface-muted);transform:scale(1.12)}._sendBtn_1d1de_1376{background-color:var(--color-primary);width:40px;height:40px;color:var(--color-on-primary);cursor:pointer;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;display:flex}._sendBtn_1d1de_1376:disabled{opacity:.5;cursor:not-allowed}._memberStackBtn_1d1de_1396{border-radius:var(--radius-full);cursor:pointer;background:0 0;border:none;padding:2px;transition:background-color .12s;display:inline-flex}._memberStackBtn_1d1de_1396:hover{background-color:var(--color-surface-muted)}._membersBody_1d1de_1410{flex-direction:column;gap:10px;display:flex}._unsavedBar_1d1de_1416{border-radius:var(--radius-full);background-color:var(--color-secondary-10);color:var(--color-secondary-strong);align-self:flex-start;padding:3px 10px;font-size:11px;font-weight:700}._addMemberCta_1d1de_1426{border-radius:var(--radius-md);background-color:var(--color-primary-05);width:100%;color:var(--color-primary);border:1px dashed var(--color-primary-border);cursor:pointer;justify-content:center;align-items:center;gap:7px;padding:10px 14px;font-size:12.5px;font-weight:700;transition:background-color .12s;display:inline-flex}._addMemberCta_1d1de_1426:hover{background-color:var(--color-primary-10)}._membersSectionLabel_1d1de_1447{letter-spacing:.06em;color:var(--color-text-soft);font-size:9.5px;font-weight:700}._membersList_1d1de_1454{flex-direction:column;gap:2px;display:flex}._memberRow_1d1de_1460{border-radius:var(--radius-md);border:1px solid #0000;align-items:center;gap:11px;padding:8px;display:flex}._memberRow_1d1de_1460:hover{background-color:var(--color-surface-muted)}._memberRowNew_1d1de_1473{background-color:var(--color-success-soft);border-color:color-mix(in srgb, var(--color-success) 30%, transparent)}._memberRowNew_1d1de_1473:hover{background-color:var(--color-success-soft)}._memberRowAvatar_1d1de_1482{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:12px;font-weight:700;display:flex}._memberRowBody_1d1de_1496{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._memberRowName_1d1de_1504{color:var(--color-text);flex-wrap:wrap;align-items:center;gap:6px;font-size:12.5px;font-weight:600;display:flex}._memberRowYou_1d1de_1514{color:var(--color-text-soft);font-weight:500}._memberRowRole_1d1de_1519{font-size:var(--font-xs);color:var(--color-text-soft);align-items:center;gap:6px;display:inline-flex}._memberBadgeAdmin_1d1de_1529{letter-spacing:.04em;background-color:var(--color-secondary);color:var(--color-on-primary);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:800}._memberBadge_1d1de_1529{letter-spacing:.04em;background-color:var(--color-bg);color:var(--color-text-soft);border:1px solid var(--color-border);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:700}._memberPillNew_1d1de_1550{letter-spacing:.04em;background-color:var(--color-success);color:var(--color-on-primary);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:800}._memberPillUp_1d1de_1560{letter-spacing:.04em;background-color:var(--color-secondary-10);color:var(--color-secondary-strong);border:1px solid var(--color-secondary-border);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:800}._memberPillDown_1d1de_1571{letter-spacing:.04em;background-color:var(--color-surface-muted);color:var(--color-text-mid);border-radius:3px;padding:1px 6px;font-size:8.5px;font-weight:800}._memberRowMenuBtn_1d1de_1581{border-radius:var(--radius-md);width:30px;height:30px;color:var(--color-text-mid);cursor:pointer;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .12s;display:inline-flex}._memberRowMenuBtn_1d1de_1581:hover{background-color:var(--color-border);color:var(--color-text)}._removedLabel_1d1de_1601{letter-spacing:.06em;color:var(--color-danger);padding:10px 2px 4px;font-size:9.5px;font-weight:700}._removedRow_1d1de_1609{border-radius:var(--radius-md);background-color:var(--color-danger-soft);border:1px solid color-mix(in srgb, var(--color-danger) 25%, transparent);align-items:center;gap:11px;margin-bottom:2px;padding:8px;display:flex}._removedRow_1d1de_1609 ._memberRowAvatar_1d1de_1482{opacity:.6}._removedName_1d1de_1624{color:var(--color-text);text-decoration:line-through;-webkit-text-decoration-color:var(--color-danger);text-decoration-color:var(--color-danger);font-size:12.5px;font-weight:600}._undoBtn_1d1de_1632{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);font-size:var(--font-xs);cursor:pointer;flex-shrink:0;align-items:center;gap:5px;padding:4px 10px;font-weight:700;transition:background-color .12s;display:inline-flex}._undoBtn_1d1de_1632:hover{background-color:var(--color-surface-muted)}._addPanel_1d1de_1653{flex-direction:column;gap:10px;display:flex}._addPanelHead_1d1de_1659{align-items:center;gap:8px;display:flex}._addPanelTitle_1d1de_1665{color:var(--color-text);font-size:13px;font-weight:700}._addPanelSearch_1d1de_1671{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:36px;color:var(--color-text-soft);align-items:center;gap:8px;padding:0 10px;display:flex}._addPanelList_1d1de_1682{flex-direction:column;gap:2px;max-height:320px;display:flex;overflow-y:auto}._addPanelEmpty_1d1de_1690{text-align:center;color:var(--color-text-soft);padding:20px;font-size:13px}._addMemberBtn_1d1de_1697{border-radius:var(--radius-md);background-color:var(--color-primary-10);color:var(--color-primary);font-size:var(--font-xs);cursor:pointer;border:none;flex-shrink:0;align-items:center;gap:5px;padding:5px 12px;font-weight:700;transition:background-color .12s,transform .12s;display:inline-flex}._addMemberBtn_1d1de_1697:hover{background-color:var(--color-primary);color:var(--color-on-primary);transform:translateY(-1px)}._newGroupBody_1d1de_1722{flex-direction:column;gap:12px;display:flex}._staffPickRow_1d1de_1728{border-radius:var(--radius-md);text-align:left;cursor:pointer;background-color:#0000;border:1px solid #0000;align-items:center;gap:11px;width:100%;padding:8px;transition:background-color .12s,border-color .12s;display:flex}._staffPickRow_1d1de_1728:hover{background-color:var(--color-surface-muted)}._staffPickRow_1d1de_1728:disabled{opacity:.6;cursor:default}._staffPickRowOn_1d1de_1753{background-color:var(--color-primary-10);border-color:color-mix(in srgb, var(--color-primary) 30%, transparent)}._staffPickRowOn_1d1de_1753:hover{background-color:var(--color-primary-10)}._pickCheck_1d1de_1762{border:1.5px solid var(--color-border);width:20px;height:20px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._pickCheckOn_1d1de_1774{background-color:var(--color-primary);border-color:var(--color-primary)}._pickerPending_1d1de_1779{justify-content:center;padding:10px 0 2px;display:flex}@media (width<=1023px){._composer_1d1de_1156{padding:10px 14px}}._connPill_1d1de_1793{border-radius:var(--radius-full);background-color:var(--color-warning-soft,var(--color-primary-10));color:var(--color-text-muted);font-size:var(--font-xs);white-space:nowrap;flex-shrink:0;align-items:center;gap:4px;padding:3px 8px;font-weight:600;display:inline-flex}._typingRow_1d1de_1807{color:var(--color-text-muted);flex-shrink:0;align-items:center;gap:8px;padding:4px 20px 8px;display:flex}._typingText_1d1de_1816{font-size:var(--font-xs);font-weight:500}._typingDots_1d1de_1821{align-items:center;gap:3px;display:inline-flex}._typingDots_1d1de_1821 span{background-color:var(--color-text-muted);border-radius:50%;width:5px;height:5px;animation:1.2s ease-in-out infinite _typingBounce_1d1de_1}._typingDots_1d1de_1821 span:nth-child(2){animation-delay:.18s}._typingDots_1d1de_1821 span:nth-child(3){animation-delay:.36s}@keyframes _typingBounce_1d1de_1{0%,60%,to{opacity:.5;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}@media (prefers-reduced-motion:reduce){._typingDots_1d1de_1821 span{animation:none}}._memberRowAvatarWrap_1d1de_1863{flex-shrink:0;display:inline-flex;position:relative}._presenceDot_1d1de_1869{background-color:var(--color-success);border:2px solid var(--color-surface);border-radius:50%;width:11px;height:11px;position:absolute;bottom:-1px;right:-1px}._replyPreview_1d1de_1880{border-left:3.5px solid var(--color-secondary);background-color:var(--color-surface-muted);color:var(--color-text-soft);border-radius:8px;margin-bottom:3px;padding:7px 10px;font-size:11.5px;display:block}._bubbleMe_1d1de_1033 ._replyPreview_1d1de_1880{border-left-color:var(--color-secondary)}:host([data-theme=dark]) ._replyPreview_1d1de_1880,:host([data-theme=dark]) ._bubbleMe_1d1de_1033 ._replyPreview_1d1de_1880{border-left-color:var(--color-on-primary)}._replyPreviewAuthor_1d1de_1900{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;max-width:300px;margin-bottom:1px;font-size:11.5px;font-weight:600;display:block;overflow:hidden}._replyPreviewText_1d1de_1913{white-space:nowrap;text-overflow:ellipsis;max-width:300px;font-size:11.5px;display:block;overflow:hidden}@media (width<=480px){._replyPreviewAuthor_1d1de_1900,._replyPreviewText_1d1de_1913{max-width:220px}}._replyBar_1d1de_1929{border-radius:var(--radius-md);background-color:var(--color-surface-muted);align-items:center;gap:8px;margin:0 12px 8px;padding:8px 10px;font-size:13px;display:flex}._replyBarText_1d1de_1940{min-width:0;color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}._replyBarClose_1d1de_1949{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;padding:4px}._msgMedia_1d1de_1957{border-radius:var(--radius-md);background:var(--color-surface-muted);border:1px solid var(--color-border);object-fit:cover;cursor:pointer;max-width:260px;max-height:300px;margin-top:6px;transition:transform .2s,box-shadow .2s,filter .2s;display:block}._msgMedia_1d1de_1957:hover{box-shadow:var(--shadow-md);filter:brightness(1.03);transform:scale(1.02)}._msgMediaLoading_1d1de_1981,._msgMediaFallback_1d1de_1982{border-radius:var(--radius-md);background:var(--color-surface-muted);width:240px;max-width:100%;height:140px;color:var(--color-text-soft);justify-content:center;align-items:center;gap:6px;margin-top:6px;font-size:12px;display:flex}._albumGrid_1d1de_1998{grid-template-columns:repeat(2,1fr);gap:3px;width:240px;max-width:100%;margin-top:6px;display:grid}._albumCell_1d1de_2007{aspect-ratio:1;cursor:pointer;position:relative}._albumCell_1d1de_2007:first-child:nth-last-child(odd){aspect-ratio:16/9;grid-column:span 2}._albumCellMedia_1d1de_2007{border-radius:var(--radius-sm);background:var(--color-surface-muted);position:absolute;inset:0;overflow:hidden}._albumCellMedia_1d1de_2007 img,._albumCellMedia_1d1de_2007>div{object-fit:cover;border:none;border-radius:0;width:100%;max-width:none;height:100%;max-height:none;margin-top:0;transition:transform .25s,filter .2s}._albumCell_1d1de_2007:hover ._albumCellMedia_1d1de_2007 img{filter:brightness(1.05);transform:scale(1.06)}._albumCellActions_1d1de_2052{z-index:4;border-radius:var(--radius-full);background:var(--color-overlay);opacity:0;align-items:center;gap:2px;padding:2px;transition:opacity .14s;display:flex;position:absolute;top:5px;right:5px}._albumCell_1d1de_2007:hover ._albumCellActions_1d1de_2052{opacity:1}._albumCellActions_1d1de_2052 ._reactBtn_1d1de_920{opacity:1;color:var(--color-on-primary)}._albumCellActions_1d1de_2052 ._reactBtn_1d1de_920:hover,._albumActionBtn_1d1de_2078:hover{background-color:var(--color-overlay);color:var(--color-on-primary)}._albumActionBtn_1d1de_2078{border-radius:var(--radius-full);width:24px;height:24px;color:var(--color-on-primary);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;transition:background-color .12s;display:inline-flex}._albumCellReactions_1d1de_2097{z-index:4;position:absolute;bottom:4px;left:5px}._mediaButton_1d1de_2106{cursor:pointer;background:0 0;border:none;padding:0;line-height:0;display:inline-block}._mediaButtonFill_1d1de_2115{width:100%;height:100%;display:block}._viewerBackdrop_1d1de_2122{z-index:200;justify-content:center;align-items:center;padding:40px;display:flex;position:fixed;inset:0}._viewerScrim_1d1de_2132{background-color:var(--color-media-scrim);cursor:zoom-out;border:none;animation:.16s _viewerFade_1d1de_1;position:absolute;inset:0}._viewerStage_1d1de_2141{z-index:1;color:#ffffffe6;pointer-events:none;justify-content:center;align-items:center;max-width:92vw;max-height:86vh;display:flex;position:relative}._viewerImg_1d1de_2155{object-fit:contain;border-radius:var(--radius-md);pointer-events:auto;max-width:92vw;max-height:86vh;animation:.18s _viewerZoom_1d1de_1;box-shadow:0 20px 60px #00000080}._viewerFallback_1d1de_2165{color:#ffffffbf;flex-direction:column;align-items:center;gap:10px;font-size:13px;display:flex}._viewerClose_1d1de_2174,._viewerNav_1d1de_2175{z-index:2;color:#fff;cursor:pointer;background-color:#ffffff1f;border:none;border-radius:50%;justify-content:center;align-items:center;transition:background-color .15s,transform .15s;display:inline-flex;position:absolute}._viewerClose_1d1de_2174:hover,._viewerNav_1d1de_2175:hover:not(:disabled){background-color:#ffffff3d}._viewerNav_1d1de_2175:disabled{opacity:.35;cursor:default}._viewerClose_1d1de_2174{width:40px;height:40px;top:20px;right:24px}._viewerNav_1d1de_2175{width:46px;height:46px;top:50%;transform:translateY(-50%)}._viewerNav_1d1de_2175:hover:not(:disabled){transform:translateY(-50%)scale(1.06)}._viewerNavPrev_1d1de_2219{left:20px}._viewerNavNext_1d1de_2223{right:20px}._viewerCount_1d1de_2227{z-index:2;border-radius:var(--radius-full);color:#fff;background-color:#ffffff1f;padding:4px 12px;font-size:12px;font-weight:600;position:absolute;bottom:24px;left:50%;transform:translate(-50%)}@keyframes _viewerFade_1d1de_1{0%{opacity:0}to{opacity:1}}@keyframes _viewerZoom_1d1de_1{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}._fileCard_1d1de_2264{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface-muted);text-align:left;cursor:pointer;align-items:center;gap:10px;width:260px;max-width:100%;margin-top:6px;padding:9px 11px;transition:background .14s,opacity .14s;display:flex}._fileCardMe_1d1de_2282{background:var(--color-surface)}._fileCard_1d1de_2264:hover:not(:disabled){border-color:var(--color-border-strong)}._fileCard_1d1de_2264:disabled{cursor:default;opacity:.65}._fileCardIcon_1d1de_2295{border-radius:var(--radius-sm);background:var(--color-bg);width:38px;height:38px;color:var(--color-primary);flex-shrink:0;justify-content:center;align-items:center;display:flex}._fileCardInfo_1d1de_2307{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}._fileCardName_1d1de_2315{color:var(--color-text);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;overflow:hidden}._fileCardMetaLabel_1d1de_2324{color:var(--color-text-soft);font-size:11px}._fileCardDownload_1d1de_2329{color:var(--color-text-soft);flex-shrink:0;justify-content:center;align-items:center;display:flex}._msgActions_1d1de_2337{opacity:0;gap:4px;margin-left:6px;transition:opacity .14s;display:inline-flex}._msgRow_1d1de_768:hover ._msgActions_1d1de_2337{opacity:1}._msgActionBtn_1d1de_2349{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;padding:2px 4px;font-size:11px}._msgActionBtn_1d1de_2349:hover{color:var(--color-text)}._editedLabel_1d1de_2362{color:var(--color-text-soft);margin-left:4px;font-size:11px;font-style:italic}._hiddenFileInput_1d1de_2369{display:none}._viewPaneWrapper_1d1de_2373{flex-direction:column;flex:1;min-width:0;height:100%;display:flex}._emptyFloating1_1d1de_2381{color:var(--color-primary-20);opacity:.35;pointer-events:none;position:absolute;top:25%;left:28%}._emptyFloating2_1d1de_2390{color:var(--color-secondary-20);opacity:.45;pointer-events:none;position:absolute;bottom:30%;right:28%}._emptyFloating3_1d1de_2399{color:var(--color-primary-light);opacity:.25;pointer-events:none;position:absolute;top:55%;right:32%}._backBtn_1d1de_2408{display:none}@media (width<=1024px){._viewTitleRow_1d1de_634{flex-wrap:wrap;gap:4px 6px}._viewTitle_1d1de_634{flex:100%;max-width:100%}._adminBadge_1d1de_666,._statusPill_1d1de_653{margin-top:1px}}@media (width<=1023px){._root_1d1de_1{flex:1!important;height:100%!important}._msgCol_1d1de_1005{max-width:88%}._viewHead_1d1de_580{gap:8px;padding:10px 14px}._viewTitleRow_1d1de_634{flex-wrap:wrap;gap:4px}._root_1d1de_1:not(._hasActiveChat_1d1de_2449) ._viewPaneWrapper_1d1de_2373,._root_1d1de_1:not(._hasActiveChat_1d1de_2449) ._viewEmpty_1d1de_542{display:none!important}._root_1d1de_1:not(._hasActiveChat_1d1de_2449) ._list_1d1de_14{flex:1!important;width:100%!important;height:100%!important;max-height:100%!important}._root_1d1de_1._hasActiveChat_1d1de_2449 ._list_1d1de_14{display:none!important}._root_1d1de_1._hasActiveChat_1d1de_2449 ._viewPaneWrapper_1d1de_2373,._root_1d1de_1._hasActiveChat_1d1de_2449 ._viewEmpty_1d1de_542{width:100%!important;height:100%!important;display:flex!important}._backBtn_1d1de_2408{color:var(--color-text-soft);border-radius:var(--radius-md);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;margin-right:4px;padding:6px;transition:background-color .12s;display:inline-flex}._backBtn_1d1de_2408:hover{background-color:var(--color-surface-muted);color:var(--color-text)}}@media (width<=1280px){._composer_1d1de_1156{align-items:center;gap:4px;padding:10px 12px}._composerIcon_1d1de_1278{width:34px;height:34px}._composerInput_1d1de_1300{min-height:38px;padding:9px 12px;font-size:12.5px;line-height:1.35}._sendBtn_1d1de_1376{width:36px;height:36px}}@media (width<=768px){._composer_1d1de_1156{align-items:center;gap:4px;padding:8px}._composerIcon_1d1de_1278{width:32px;height:32px}._composerInput_1d1de_1300{min-height:36px;padding:9px 12px;font-size:12px;line-height:1.35}._sendBtn_1d1de_1376{width:34px;height:34px}}@media (width<=480px){._viewHead_1d1de_580{gap:4px;padding:8px}._memberStack_1d1de_694 ._memberAvatar_1d1de_699:nth-child(n+3){display:none}._memberStack_1d1de_694 ._memberAvatar_1d1de_699:not(:first-child){margin-left:-12px}._composer_1d1de_1156{align-items:center;gap:3px;padding:8px 6px}._composerIcon_1d1de_1278{width:30px;height:30px}._composerInput_1d1de_1300{min-height:34px;padding:8px 10px;font-size:11.5px;line-height:1.35}._sendBtn_1d1de_1376{width:32px;height:32px}}._standardHeader_1d1de_2580{align-items:center;gap:12px;width:100%;display:flex}._mobileSelectionHeader_1d1de_2587{justify-content:space-between;align-items:center;gap:8px;width:100%;padding:2px 0;display:none}._selectionLeft_1d1de_2596{flex:1;align-items:center;gap:10px;min-width:0;display:flex}._selectionTitle_1d1de_2604{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;overflow:hidden}._selectionActions_1d1de_2613{flex-shrink:0;align-items:center;gap:4px;display:flex}._selectionActionBtn_1d1de_2620{border-radius:var(--radius-md);width:32px;height:32px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;transition:background-color .12s,color .12s;display:inline-flex}._selectionActionBtn_1d1de_2620:hover,._selectionActionBtn_1d1de_2620:active{background-color:var(--color-primary-10);color:var(--color-primary)}._selectionActionDanger_1d1de_2642:hover,._selectionActionDanger_1d1de_2642:active{background-color:var(--color-error-10,#ef44441a);color:var(--color-error,#ef4444)}@media (width<=1024px){._msgActions_1d1de_2337,._hasMobileSelection_1d1de_2653 ._standardHeader_1d1de_2580{display:none!important}._hasMobileSelection_1d1de_2653 ._mobileSelectionHeader_1d1de_2587{display:flex!important}._bubbleSelected_1d1de_2661{outline:2px solid var(--color-primary);background-color:var(--color-primary-10)!important}}._root_1tuup_1{height:100%;min-height:0;display:flex}._list_1tuup_7{border-right:1px solid var(--color-border);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;width:340px;min-height:0;display:flex}._listHead_1tuup_17{padding:16px 18px 8px}._title_1tuup_21{border-radius:var(--radius-sm);background-color:var(--color-surface-muted);width:120px;height:24px;margin-bottom:16px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._search_1tuup_30{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:36px;margin:0 14px 16px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._rows_1tuup_38{flex-direction:column;flex:1;padding:6px 0;display:flex}._row_1tuup_38{align-items:center;gap:11px;width:100%;padding:9px 18px;display:flex}._rowAvatar_1tuup_53{background-color:var(--color-surface-muted);border-radius:50%;flex-shrink:0;width:36px;height:36px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._rowBody_1tuup_62{flex-direction:column;flex:1;gap:6px;display:flex}._line_1tuup_69{background-color:var(--color-surface-muted);border-radius:var(--radius-sm);height:12px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._line_1tuup_69._medium_1tuup_76{width:60%}._line_1tuup_69._full_1tuup_80{width:90%}._view_1tuup_84{background-color:var(--color-bg);flex-direction:column;flex:1;display:flex}._viewHead_1tuup_91{background-color:var(--color-surface);border-bottom:1px solid var(--color-border);align-items:center;gap:11px;padding:12px 20px;display:flex}._messages_1tuup_100{flex-direction:column;flex:1;gap:12px;padding:20px;display:flex}._bubbleWrap_1tuup_108{align-items:flex-end;gap:8px;display:flex}._bubbleWrap_1tuup_108._me_1tuup_76{justify-content:flex-end}._bubbleAvatar_1tuup_118{background-color:var(--color-surface-muted);border-radius:50%;width:28px;height:28px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._bubble_1tuup_108{background-color:var(--color-surface-muted);border-radius:14px 14px 14px 4px;width:200px;height:40px;animation:1.5s ease-in-out infinite _pulse_1tuup_1}._bubbleWrap_1tuup_108._me_1tuup_76 ._bubble_1tuup_108{border-radius:14px 14px 4px;width:150px}._line_1tuup_69._narrow_1tuup_139{width:30%}._bubble_1tuup_108._wide_1tuup_143{width:250px}@keyframes _pulse_1tuup_1{0%,to{opacity:1}50%{opacity:.5}}@media (width<=768px){._root_1tuup_1{flex-direction:column}._list_1tuup_7{border-right:none;border-bottom:1px solid var(--color-border);width:100%}._view_1tuup_84{display:none}}._screen_hgbdz_1{flex-direction:column;gap:14px;width:100%;padding:24px 32px 48px;display:flex}@media (width<=640px){._screen_hgbdz_1{padding:16px 16px 32px}}._center_hgbdz_15{place-items:center;padding:40px 0;display:grid}._head_hgbdz_21{flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:12px;display:flex}._crumb_hgbdz_29{color:var(--color-text-soft);font-size:11.5px}._title_hgbdz_34{font-size:var(--font-xl);color:var(--color-text);align-items:center;gap:8px;margin:2px 0 0;font-weight:600;display:flex}._subtitle_hgbdz_44{color:var(--color-text-soft);margin:4px 0 0;font-size:13px}._muted_hgbdz_50{color:var(--color-text-soft);font-size:12.5px}._strong_hgbdz_55{color:var(--color-text);font-weight:600}._code_hgbdz_60{color:var(--color-text-mid);font-family:ui-monospace,monospace;font-size:11.5px}._tabs_hgbdz_67{border-bottom:1px solid var(--color-divider);scrollbar-width:none;gap:2px;display:flex;overflow-x:auto}._tabs_hgbdz_67::-webkit-scrollbar{display:none}._tab_hgbdz_67{color:var(--color-text-soft);white-space:nowrap;cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-1px;padding:9px 14px;font-size:12.5px;font-weight:600}._tabActive_hgbdz_93{color:var(--color-primary);border-bottom-color:var(--color-primary)}._filterBar_hgbdz_99{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;display:flex}._pillsContainer_hgbdz_107{flex-direction:column;align-items:flex-start;gap:8px;width:100%;display:flex}._pills_hgbdz_107{border-radius:var(--radius-full);background-color:var(--color-surface-muted);flex-wrap:wrap;gap:4px;width:100%;padding:4px;display:flex}@media (width<=640px){._pills_hgbdz_107{scrollbar-width:none;-ms-overflow-style:none;flex-wrap:nowrap;overflow-x:auto}._pills_hgbdz_107::-webkit-scrollbar{display:none}._pill_hgbdz_107,._pillAdd_hgbdz_142{white-space:nowrap;flex-shrink:0}}._pill_hgbdz_107{color:var(--color-text-soft);border-radius:var(--radius-full);cursor:pointer;background:0 0;border:none;padding:6px 13px;font-size:12px;font-weight:600;transition:color .16s;position:relative}._pill_hgbdz_107:hover{color:var(--color-text)}._pillBg_hgbdz_166{border-radius:var(--radius-full);background-color:var(--color-surface);box-shadow:var(--shadow-sm);position:absolute;inset:0}._pillLabel_hgbdz_174{z-index:1;position:relative}._pillActive_hgbdz_179{color:var(--color-primary)}._pillChipActive_hgbdz_183{background-color:var(--color-primary-10);color:var(--color-primary);border:1px solid var(--color-primary-border)}._select_hgbdz_189,._input_hgbdz_190{height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);width:100%;padding:0 10px;font-family:inherit;font-size:13px}._select_hgbdz_189:focus-visible,._input_hgbdz_190:focus-visible{outline:2px solid var(--color-border-strong);outline-offset:0px;border-color:var(--color-border-strong)}._inputInvalid_hgbdz_209,._inputInvalid_hgbdz_209:focus-visible{border-color:var(--color-danger);outline:none}._fieldError_hgbdz_215{color:var(--color-danger);font-size:11.5px;font-weight:500}._select_hgbdz_189{width:170px;min-width:170px}._kpiRow_hgbdz_227{grid-template-columns:repeat(4,1fr);gap:12px;display:grid}._kpiCard_hgbdz_233{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;gap:4px;padding:14px 16px;display:flex}._kpiIcon_hgbdz_244{border-radius:var(--radius-md);width:30px;height:30px;color:var(--color-on-primary);background-color:var(--kpi-color);justify-content:center;align-items:center;display:inline-flex}._kpiValue_hgbdz_255{font-size:var(--font-xl);color:var(--color-text);font-weight:700}._kpiLabel_hgbdz_261{color:var(--color-text-soft);font-size:11.5px;font-weight:600}._tableWrap_hgbdz_268{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);overflow-x:auto}._table_hgbdz_268{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12.5px}._th_hgbdz_283{text-align:left;text-transform:uppercase;letter-spacing:.03em;color:var(--color-text-soft);background-color:var(--color-surface-muted);border-bottom:1px solid var(--color-border);padding:10px 12px;font-size:11px;font-weight:700}._row_hgbdz_295 td{border-bottom:1px solid var(--color-divider);color:var(--color-text);vertical-align:middle;padding:10px 12px}._row_hgbdz_295:hover td{background-color:var(--color-surface-muted)}._barTrack_hgbdz_306{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:120px;height:6px;overflow:hidden}._barFill_hgbdz_314{height:100%;width:var(--bar);background-color:var(--bar-color);display:block}._barLabel_hgbdz_321{color:var(--color-text-soft);font-size:10.5px}._pillBadge_hgbdz_326{border-radius:var(--radius-full);padding:2px 9px;font-size:10.5px;font-weight:700}._pillOk_hgbdz_333{background-color:var(--color-success-soft);color:var(--color-success)}._pillBad_hgbdz_326{background-color:var(--color-danger-soft);color:var(--color-danger)}._field_hgbdz_215{flex-direction:column;gap:6px;margin-bottom:12px;display:flex}._label_hgbdz_351{color:var(--color-text-mid);font-size:12px;font-weight:600}._req_hgbdz_357{color:var(--color-danger);margin-left:2px}._formGrid_hgbdz_362{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;display:grid}._swatches_hgbdz_368{flex-wrap:wrap;gap:6px;display:flex}._swatch_hgbdz_368{background-color:var(--swatch);cursor:pointer;border:2px solid #0000;border-radius:50%;width:22px;height:22px}._swatchActive_hgbdz_383{border-color:var(--color-text)}._checkbox_hgbdz_387{color:var(--color-text-mid);cursor:pointer;align-items:center;gap:8px;font-size:12.5px;font-weight:600;display:inline-flex}._checkbox_hgbdz_387 input{accent-color:var(--color-primary)}._formFooter_hgbdz_401{justify-content:flex-end;gap:10px;padding-top:6px;display:flex}._editBtn_hgbdz_408,._deleteBtn_hgbdz_409{border-radius:var(--radius-sm);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:28px;display:inline-flex}._editBtn_hgbdz_408{border:1px solid var(--color-primary-20);background-color:var(--color-primary-05);color:var(--color-primary)}._deleteBtn_hgbdz_409{border:1px solid color-mix(in srgb, var(--color-danger) 20%, transparent);background-color:var(--color-danger-soft);color:var(--color-danger)}._prefsWrap_hgbdz_433,._catWrap_hgbdz_434,._promoWrap_hgbdz_435,._tplWrap_hgbdz_436,._guide_hgbdz_437,._retryList_hgbdz_438{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;gap:12px;padding:16px;display:flex}._prefBlock_hgbdz_449{flex-direction:column;gap:6px;display:flex}._prefHeading_hgbdz_455{color:var(--color-text);margin:0 0 4px;font-size:13px;font-weight:700}._prefRow_hgbdz_462,._catRow_hgbdz_463,._promoRow_hgbdz_464{background-color:var(--color-surface);border-bottom:1px solid var(--color-divider);align-items:center;gap:12px;padding:14px 18px;transition:opacity .15s,box-shadow .15s;display:flex}@media (width<=640px){._promoRow_hgbdz_464{border-bottom:1px solid var(--color-divider);background-color:var(--color-surface);grid-template-rows:auto auto;grid-template-columns:auto auto 1fr auto;align-items:center;gap:12px 10px;padding:16px;display:grid}._promoRow_hgbdz_464 ._dragHandle_hgbdz_488{grid-area:1/1}._promoRow_hgbdz_464 ._priorityBadge_hgbdz_492{grid-area:1/2}._promoRow_hgbdz_464 ._prefDot_hgbdz_496{grid-area:1/4;justify-self:end}._promoRow_hgbdz_464 ._promoNameBtn_hgbdz_501{grid-area:1/3;padding-right:4px}._promoRow_hgbdz_464 ._activeCheck_hgbdz_506{border-top:1px dashed var(--color-divider);grid-area:2/1/2/5;align-items:center;margin-top:8px;padding-top:12px;display:flex}._promoRow_hgbdz_464 ._editBtn_hgbdz_408{z-index:2;grid-area:2/1/2/5;justify-self:end;margin-top:8px;margin-right:36px}._promoRow_hgbdz_464 ._deleteBtn_hgbdz_409{z-index:2;grid-area:2/1/2/5;justify-self:end;margin-top:8px}}._promoRowDragging_hgbdz_531{opacity:.5}._promoRowDragOver_hgbdz_535{box-shadow:inset 0 2px 0 0 var(--color-primary)}._prefDot_hgbdz_496{background-color:var(--dot);border-radius:50%;flex-shrink:0;width:10px;height:10px}._dragHandle_hgbdz_488{color:var(--color-text-very-soft);cursor:grab;flex-shrink:0;align-items:center;display:inline-flex}._dragHandle_hgbdz_488:active{cursor:grabbing}._dragHandleOff_hgbdz_559{color:var(--color-border-strong);cursor:not-allowed}._prefName_hgbdz_564,._catLabel_hgbdz_565{color:var(--color-text);flex:1;font-size:13px;font-weight:600}._prefBtns_hgbdz_572{gap:4px;display:flex}._prefBtn_hgbdz_572{border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-soft);border-radius:var(--radius-md);cursor:pointer;padding:5px 10px;font-size:11.5px;font-weight:600}._prefBtnActive_hgbdz_588{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._catActions_hgbdz_595{justify-content:flex-end;display:flex}._catHead_hgbdz_600{justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:4px;display:flex}@media (width<=640px){._catHead_hgbdz_600{flex-direction:column;align-items:stretch;gap:12px}}._webhookFilterBar_hgbdz_616{justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1rem;display:flex}@media (width<=640px){._webhookFilterBar_hgbdz_616{flex-direction:column;align-items:stretch;gap:12px}._webhookFilterBar_hgbdz_616>button{justify-content:center;width:100%}}._catHeadDesc_hgbdz_636{max-width:62ch;color:var(--color-text-soft);margin:0;font-size:13px;line-height:1.5}._catList_hgbdz_644{flex-direction:column;display:flex}._catKey_hgbdz_649{color:var(--color-text-soft);border-radius:var(--radius-sm);background-color:var(--color-surface-muted);padding:2px 6px;font-family:ui-monospace,monospace;font-size:11px}._promoList_hgbdz_659{border:1px solid var(--color-border);background-color:var(--color-surface);border-radius:12px;flex-direction:column;display:flex;overflow:hidden}._promoList_hgbdz_659>div:last-child>._promoRow_hgbdz_464{border-bottom:none}._promoRowOff_hgbdz_672{opacity:.6}._reorder_hgbdz_676{flex-direction:column;display:flex}._reorderBtn_hgbdz_681{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;padding:0;line-height:1}._priorityBadge_hgbdz_492{background-color:var(--cat-tint);width:24px;height:24px;color:var(--cat);border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;font-size:11px;font-weight:800;display:inline-flex}._priorityBadgeOff_hgbdz_704{background-color:var(--color-surface-muted);color:var(--color-text-very-soft)}._activeCheck_hgbdz_506{color:var(--color-text-soft);cursor:pointer;flex-shrink:0;align-items:center;gap:6px;font-size:11.5px;display:inline-flex}._activeCheck_hgbdz_506 input{width:15px;height:15px;accent-color:var(--color-primary);cursor:pointer}._tplHint_hgbdz_726{color:var(--color-text-soft);margin:0;font-size:12px}._tplEditLayout_hgbdz_732{grid-template-columns:1fr minmax(280px,360px);align-items:start;gap:20px;display:grid}._tplEditForm_hgbdz_739{flex-direction:column;display:flex}._tplEditPreview_hgbdz_744{flex-direction:column;gap:12px;display:flex;position:sticky;top:12px}._tplLiveHead_hgbdz_752{letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);align-items:center;gap:7px;font-size:11px;font-weight:700;display:inline-flex}._tplMirrorHead_hgbdz_764{border-top:1px dashed var(--color-divider);letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);align-items:center;gap:7px;margin-top:10px;padding-top:14px;font-size:11px;font-weight:700;display:inline-flex}._tplLiveDot_hgbdz_778{background-color:var(--color-success);border-radius:50%;width:8px;height:8px;animation:1.6s ease-in-out infinite _tplPulse_hgbdz_1}@keyframes _tplPulse_hgbdz_1{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.8)}}@media (prefers-reduced-motion:reduce){._tplLiveDot_hgbdz_778{animation:none}}@media (width<=860px){._tplEditLayout_hgbdz_732{grid-template-columns:1fr}}._promoNameBtn_hgbdz_501{cursor:pointer;text-align:left;background:0 0;border:none;flex-direction:column;flex:1;align-items:flex-start;gap:3px;min-width:0;padding:0;display:flex}._promoNameTop_hgbdz_826{color:var(--color-text-very-soft);align-items:center;gap:6px;display:inline-flex}._promoName_hgbdz_501{color:var(--color-text);font-size:14px;font-weight:600}._promoNameOff_hgbdz_839{color:var(--color-text-soft);text-decoration:line-through}._promoNameMeta_hgbdz_844{align-items:center;gap:8px;display:inline-flex}@media (width<=640px){._promoNameMeta_hgbdz_844{flex-direction:column;align-items:flex-start;gap:4px}}._tplBadge_hgbdz_858{background-color:var(--color-primary-10);color:var(--color-primary);border-radius:4px;padding:1px 6px;font-size:10.5px;font-weight:600}._catCount_hgbdz_867{color:var(--color-text-soft);font-size:11px}._campaignBox_hgbdz_872{background-color:var(--color-bg);border-bottom:1px solid var(--color-divider);flex-direction:column;gap:10px;padding:14px 18px 16px 56px;display:flex}._promoList_hgbdz_659>div:last-child>._campaignBox_hgbdz_872{border-bottom:none}._campaignHead_hgbdz_885{justify-content:space-between;align-items:center;gap:12px;display:flex}._campaignHeadTitle_hgbdz_892{letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);align-items:center;gap:8px;font-size:11px;font-weight:700;display:inline-flex}._campaignCount_hgbdz_903{border-radius:var(--radius-full);background-color:var(--color-surface-muted);min-width:20px;height:18px;color:var(--color-text-mid);letter-spacing:0;justify-content:center;align-items:center;padding:0 6px;font-size:11px;font-weight:700;display:inline-flex}._campaignList_hgbdz_918{flex-direction:column;gap:6px;display:flex}._seeAll_hgbdz_924{color:var(--color-primary);cursor:pointer;background:0 0;border:none;align-self:flex-start;padding:4px 2px;font-size:12px;font-weight:600}._seeAll_hgbdz_924:hover{text-decoration:underline}._cpTop_hgbdz_940{z-index:1;background-color:var(--color-surface);border-bottom:1px solid var(--color-divider);flex-direction:column;gap:12px;padding:20px 22px 14px;display:flex;position:sticky;top:0}._cpHead_hgbdz_952{justify-content:space-between;align-items:baseline;gap:12px;display:flex}._cpTitle_hgbdz_959{font-size:var(--font-lg);color:var(--color-text);margin:0;font-weight:700}._cpCount_hgbdz_966{color:var(--color-text-soft);flex-shrink:0;font-size:12px;font-weight:600}._cpSearch_hgbdz_973{align-items:center;display:flex;position:relative}._cpSearchIcon_hgbdz_979{color:var(--color-text-soft);position:absolute;left:10px}._cpSearchInput_hgbdz_985{border:1px solid var(--color-border);border-radius:var(--radius-md);background-color:var(--color-bg);width:100%;color:var(--color-text);padding:8px 12px 8px 30px;font-size:13px}._cpList_hgbdz_995{flex-direction:column;gap:8px;padding:14px 22px 18px;display:flex}._cpFooter_hgbdz_1002{border-top:1px solid var(--color-divider);background-color:var(--color-surface);padding:14px 22px}._cpFooter_hgbdz_1002 button{justify-content:center;width:100%}._campaignEmpty_hgbdz_1013{border:1px dashed var(--color-border);border-radius:var(--radius-md);color:var(--color-text-soft);background-color:var(--color-surface);margin:0;padding:12px 14px;font-size:12px}._campaignRow_hgbdz_1023{border-radius:var(--radius-md);border:1px solid var(--color-border);border-left:3px solid var(--cat);background-color:var(--color-surface);align-items:center;gap:10px;padding:8px 12px;display:flex}._campaignText_hgbdz_1034{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}._campaignTitle_hgbdz_1042{color:var(--color-text);font-size:12.5px;font-weight:600}._campaignSub_hgbdz_1048{color:var(--color-text-soft);font-size:11px}._campaignMeta_hgbdz_1053{flex-wrap:wrap;gap:6px;margin-top:6px;display:flex}._campaignChip_hgbdz_1060{border-radius:var(--radius-full);background-color:var(--color-surface-muted);color:var(--color-text);align-items:center;gap:5px;padding:2px 8px;font-size:11px;font-weight:600;display:inline-flex}._campaignChipLabel_hgbdz_1072{color:var(--color-text-soft);font-weight:600}._campaignAmount_hgbdz_1077{color:var(--color-secondary);font-size:12px;font-weight:700}._campaignBadge_hgbdz_1083{border-radius:var(--radius-full);background-color:var(--color-surface-muted);color:var(--color-text-mid);padding:2px 8px;font-size:10.5px;font-weight:700}._promoPreview_hgbdz_1092{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-md);flex-direction:column;flex-shrink:0;gap:8px;max-width:420px;padding:20px 18px 16px;display:flex;position:relative;overflow:hidden}._promoCard_hgbdz_1110{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);flex-shrink:0;position:relative;overflow:hidden}._promoCardHeader_hgbdz_1119{background-color:color-mix(in srgb, var(--cat) 3.1%, transparent);border-bottom:1px solid color-mix(in srgb, var(--cat) 8.2%, transparent);justify-content:space-between;align-items:center;padding:10px 12px;display:flex}._promoCardStatus_hgbdz_1128{letter-spacing:.06em;text-transform:uppercase;color:var(--cat);align-items:center;gap:7px;font-size:9px;font-weight:700;display:inline-flex}._promoCardHeading_hgbdz_1139{color:var(--color-text);margin:0;font-size:15px;font-weight:700;line-height:1.25}._promoCardBody_hgbdz_1147{flex-direction:column;gap:4px;padding:8px 10px;display:flex}._promoItem_hgbdz_1154{border-radius:var(--radius-sm);background-color:var(--color-bg);border:1px solid var(--color-border);justify-content:space-between;align-items:flex-start;gap:8px;padding:8px 10px;display:flex}._promoItemText_hgbdz_1165{flex-direction:column;flex:1;align-items:flex-start;gap:2px;min-width:0;display:flex}._promoItemTitle_hgbdz_1174{color:var(--color-text);text-overflow:ellipsis;white-space:nowrap;width:100%;font-size:12.5px;font-weight:600;overflow:hidden}._promoItemSub_hgbdz_1184{color:var(--color-text-soft);white-space:pre-wrap;width:100%;font-size:11px}._promoItemDate_hgbdz_1191{color:var(--color-text-very-soft);text-overflow:ellipsis;white-space:nowrap;width:100%;font-size:11px;overflow:hidden}._promoItemBadge_hgbdz_1200{background-color:color-mix(in srgb, var(--cat) 7%, transparent);color:var(--cat);border-radius:6px;padding:2px 6px;font-size:9px;font-weight:700}._promoItemAmount_hgbdz_1209{background-color:color-mix(in srgb, var(--cat) 7%, transparent);color:var(--cat);border-radius:6px;flex-shrink:0;padding:2px 6px;font-size:9px;font-weight:700}._promoViewAll_hgbdz_1219{border-radius:var(--radius-sm);border:1px solid color-mix(in srgb, var(--cat) 12.5%, transparent);width:100%;color:var(--cat);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;text-align:center;background-color:#0000;margin-top:2px;padding:7px 8px;font-size:11px;font-weight:600;overflow:hidden}._promoPreview_hgbdz_1092:before{content:"";background:linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));height:4px;position:absolute;inset:0 0 auto}._promoStatus_hgbdz_1249{letter-spacing:.04em;color:var(--accent);font-size:10.5px;font-weight:800}._promoHeader_hgbdz_1256{font-size:var(--font-md);color:var(--color-text);margin:0;font-weight:700}._promoCardInner_hgbdz_1263{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:4px;padding:12px;display:flex}._promoCardTitle_hgbdz_1273{color:var(--color-text);font-weight:700}._promoCardSub_hgbdz_1278,._promoDate_hgbdz_1279{color:var(--color-text-soft);font-size:12px}._promoCardFoot_hgbdz_1284{justify-content:space-between;align-items:center;margin-top:4px;display:flex}._promoBadge_hgbdz_1291{border-radius:var(--radius-full);background-color:color-mix(in srgb, var(--accent) 12%, transparent);color:var(--accent);padding:2px 9px;font-size:10.5px;font-weight:700}._promoAmount_hgbdz_1300{color:var(--color-secondary);font-weight:800}._promoCta_hgbdz_1305{color:var(--accent);font-size:12px;font-weight:700}._tplLayout_hgbdz_1312{grid-template-columns:240px 1fr;align-items:start;gap:14px;width:100%;min-width:0;display:grid}._tplList_hgbdz_1321{flex-direction:column;gap:6px;min-width:0;display:flex}._tplItem_hgbdz_1328{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);cursor:pointer;text-align:left;align-items:center;gap:10px;min-width:0;padding:10px 12px;display:flex}._tplItemActive_hgbdz_1341{border-color:var(--color-primary-border);background-color:var(--color-primary-05)}._tplDot_hgbdz_1346{background-color:var(--dot);border-radius:50%;flex-shrink:0;width:12px;height:12px}._tplItemText_hgbdz_1354{flex-direction:column;min-width:0;display:flex;overflow:hidden}._tplItemName_hgbdz_1361{color:var(--color-text);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;overflow:hidden}._tplItemMeta_hgbdz_1370{color:var(--color-text-soft);font-size:10.5px}._editorPane_hgbdz_1375{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;gap:10px;width:100%;min-width:0;padding:16px;display:flex}._editorName_hgbdz_1388{height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);color:var(--color-text);font-size:var(--font-md);width:100%;min-width:0;padding:0 10px;font-weight:700}._editorMeta_hgbdz_1401{flex-wrap:wrap;align-items:center;gap:14px;display:flex}._editorMetaCard_hgbdz_1408{flex-direction:column;gap:10px;width:100%;min-width:0;display:flex}._editorMetaCard_hgbdz_1408 ._input_hgbdz_190{width:100%;min-width:0}._iconPicker_hgbdz_1422{flex-wrap:wrap;gap:6px;display:flex}._iconChoice_hgbdz_1428{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:32px;height:32px;color:var(--color-text-soft);cursor:pointer;justify-content:center;align-items:center;display:inline-flex}._iconChoice_hgbdz_1428:hover{border-color:var(--color-border-strong);color:var(--color-text-mid)}._iconChoiceActive_hgbdz_1446{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._intGuide_hgbdz_1453{border-top:1px dashed var(--color-border);margin-top:2px;padding-top:10px}._intToggle_hgbdz_1459{color:var(--color-primary);cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;padding:0;font-size:12.5px;font-weight:600;display:inline-flex}._intChevron_hgbdz_1472{transition:transform .15s}._intChevronOpen_hgbdz_1476{transform:rotate(180deg)}._intSteps_hgbdz_1480{flex-direction:column;gap:14px;margin:12px 0 0;padding:0;list-style:none;display:flex}._intStep_hgbdz_1480{gap:10px;display:flex}._intNum_hgbdz_1494{background-color:var(--color-primary-10);width:22px;height:22px;color:var(--color-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:11px;font-weight:700;display:inline-flex}._intStepBody_hgbdz_1508{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}._intStepTitle_hgbdz_1516{color:var(--color-text);font-size:12.5px;font-weight:700}._intText_hgbdz_1522{color:var(--color-text-soft);margin:0;font-size:12px;line-height:1.5}._intText_hgbdz_1522 code{background-color:var(--color-surface-muted);border-radius:var(--radius-sm);color:var(--color-text-mid);padding:1px 5px;font-family:ui-monospace,monospace;font-size:11px}._intIntro_hgbdz_1538{color:var(--color-text-soft);margin:12px 0 0;font-size:12px;line-height:1.5}._intList_hgbdz_1545{border-left:2px solid var(--color-border);color:var(--color-text-soft);flex-direction:column;gap:6px;margin:4px 0 0;padding:2px 0 2px 12px;font-size:12px;line-height:1.5;list-style:none;display:flex}._intOl_hgbdz_1558{color:var(--color-text-soft);flex-direction:column;gap:4px;margin:4px 0 0;padding-left:20px;font-size:12px;line-height:1.5;list-style:decimal;display:flex}._intList_hgbdz_1545 code,._intOl_hgbdz_1558 code{background-color:var(--color-surface-muted);border-radius:var(--radius-sm);color:var(--color-text-mid);padding:1px 5px;font-family:ui-monospace,monospace;font-size:11px}._registry_hgbdz_1581{flex-direction:column;gap:14px;display:flex}._regStats_hgbdz_1587{grid-template-columns:repeat(3,1fr);gap:12px;display:grid}._regList_hgbdz_1593{flex-direction:column;gap:8px;display:flex}._regRow_hgbdz_1599{text-align:left;border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);width:100%;box-shadow:var(--shadow-sm);cursor:pointer;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}._regRow_hgbdz_1599:hover{border-color:var(--color-border-strong)}._regRowMain_hgbdz_1618{flex-direction:column;gap:3px;min-width:0;display:flex}._regRowName_hgbdz_1625{color:var(--color-text);font-size:13px;font-weight:600}._regRowMeta_hgbdz_1631{color:var(--color-text-soft);font-size:11.5px}._regRowEnd_hgbdz_1636{flex-shrink:0;align-items:center;gap:10px;display:flex}._regRate_hgbdz_1643{color:var(--color-text-mid);font-size:12px;font-weight:600}._regDetail_hgbdz_1649{flex-direction:column;gap:14px;width:100%;padding:20px;display:flex}._regDetailHead_hgbdz_1657{align-items:center;gap:10px;display:flex}._regDetailTitle_hgbdz_1663{font-size:var(--font-md);color:var(--color-text);font-weight:700}._feedEmpty_hgbdz_1670{border-radius:var(--radius-md);border:1px dashed var(--color-border-strong);color:var(--color-text-soft);align-items:center;gap:12px;padding:14px;display:flex}._feedEmptyText_hgbdz_1680{flex:1;min-width:0}._feedEmptyTitle_hgbdz_1685{color:var(--color-text);margin:0 0 2px;font-size:13px;font-weight:600}._feedHead_hgbdz_1692{justify-content:space-between;align-items:center;gap:10px;display:flex}._feedTitle_hgbdz_1699{color:var(--color-text);align-items:center;gap:6px;font-size:13px;font-weight:600;display:inline-flex}._feedMeta_hgbdz_1708{flex-wrap:wrap;gap:4px 16px;display:flex}._feedActions_hgbdz_1714{justify-content:flex-end;gap:8px;display:flex}._tplPreview_hgbdz_1721{border-radius:var(--radius-lg);border:1px solid var(--color-border);background:linear-gradient(180deg, var(--color-surface-muted), var(--color-surface));flex-direction:column;gap:6px;padding:14px;display:flex}._tplPreviewLabel_hgbdz_1731{text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-soft);font-size:10.5px;font-weight:700}._tplPreviewCard_hgbdz_1739{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);align-items:center;gap:12px;width:100%;min-width:0;padding:10px 12px;display:flex}._tplPreviewAvatar_hgbdz_1752{border-radius:var(--radius-md);width:38px;height:38px;color:var(--color-on-primary);background-color:var(--accent);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._tplPreviewText_hgbdz_1764{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._tplPreviewTitleRow_hgbdz_1772{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;display:flex}._tplPreviewTitle_hgbdz_1772{font-size:var(--font-md);color:var(--color-text);word-break:break-word;overflow-wrap:anywhere;min-width:0;font-weight:700}._tplPreviewPill_hgbdz_1789{border-radius:var(--radius-full);color:var(--accent);background-color:color-mix(in srgb, var(--accent) 14%, transparent);padding:2px 9px;font-size:10.5px;font-weight:700}._tplPreviewSub_hgbdz_1798{color:var(--color-text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}._fieldsHead_hgbdz_1806{justify-content:space-between;align-items:center;margin-top:6px;display:flex}._fieldList_hgbdz_1813{flex-direction:column;gap:8px;display:flex}._fieldCard_hgbdz_1819{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:8px;padding:10px 12px;display:flex}._fieldCardMain_hgbdz_1829{grid-template-columns:auto 1fr 132px auto auto;align-items:center;gap:8px;display:grid}._fieldLabelInput_hgbdz_1836{border-radius:var(--radius-sm);border:1px solid var(--color-border);background-color:var(--color-surface);height:32px;color:var(--color-text);width:100%;padding:0 10px;font-family:inherit;font-size:13px;font-weight:600}._fieldTypeSelect_hgbdz_1849{border-radius:var(--radius-sm);border:1px solid var(--color-border);background-color:var(--color-surface);height:32px;color:var(--color-text-mid);width:100%;padding:0 8px;font-family:inherit;font-size:12px}._fieldKeyRow_hgbdz_1861{align-items:center;gap:8px;padding-left:30px;display:flex}._fieldKeyLabel_hgbdz_1868{color:var(--color-text-soft);flex-shrink:0;font-size:11px;font-weight:600}._fieldKeyInput_hgbdz_1875{border-radius:var(--radius-sm);border:1px solid var(--color-border);background-color:var(--color-surface-muted);height:28px;color:var(--color-text-mid);flex:1;padding:0 8px;font-family:ui-monospace,monospace;font-size:11.5px}._iconToggle_hgbdz_1887{border-radius:var(--radius-sm);border:1px solid var(--color-border);background-color:var(--color-surface);width:28px;height:28px;color:var(--color-text-soft);cursor:pointer;justify-content:center;align-items:center;display:inline-flex}._iconToggleOn_hgbdz_1900{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._webhookBox_hgbdz_1906{border-radius:var(--radius-md);border:1px dashed var(--color-border-strong);flex-direction:column;gap:10px;width:100%;min-width:0;margin-top:8px;padding:12px;display:flex}._schema_hgbdz_1919{border-radius:var(--radius-md);background-color:var(--color-surface-muted);color:var(--color-text);white-space:pre;margin:0;padding:12px;font-family:ui-monospace,monospace;font-size:11.5px;overflow-x:auto}._retryItem_hgbdz_1931{border-radius:var(--radius-md);border:1px solid var(--color-border);justify-content:space-between;align-items:center;gap:12px;padding:12px;display:flex}._retryInfo_hgbdz_1941{flex-direction:column;gap:2px;display:flex}._retryError_hgbdz_1947{color:var(--color-danger);font-size:11.5px}._retryActions_hgbdz_1952{flex-shrink:0;gap:8px;display:flex}._tplGrid_hgbdz_1958{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;display:grid}._tplCard_hgbdz_1964{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;align-items:flex-start;gap:8px;padding:14px;display:flex}._tplCardHead_hgbdz_1976{justify-content:space-between;align-items:center;width:100%;display:flex}._tplCat_hgbdz_1983{color:var(--color-primary);background-color:var(--color-primary-10);border-radius:var(--radius-full);padding:2px 8px;font-size:10.5px;font-weight:700}@media (width<=1024px){._kpiRow_hgbdz_227{grid-template-columns:repeat(2,1fr)}._tplLayout_hgbdz_1312{grid-template-columns:1fr}._fieldRow_hgbdz_2001{grid-template-columns:auto 1fr auto auto}}@media (width<=768px){._kpiRow_hgbdz_227{grid-template-columns:1fr}}@media (width<=480px){._feedEmpty_hgbdz_1670{flex-direction:column;align-items:flex-start;gap:12px;padding:16px}._feedEmptyText_hgbdz_1680{width:100%}}._tplSidebar_hgbdz_2026{flex-direction:column;gap:10px;display:flex}._tplLock_hgbdz_2032{color:var(--color-text-soft);vertical-align:-1px;margin-left:6px}._lockBadge_hgbdz_2038{border-radius:var(--radius-full);background-color:var(--color-primary-10);color:var(--color-primary);letter-spacing:.04em;text-transform:uppercase;align-self:flex-start;align-items:center;padding:2px 8px;font-size:9.5px;font-weight:700;display:inline-flex}._footerBtns_hgbdz_2052{align-items:center;gap:8px;margin-left:auto;display:flex}._copyRow_hgbdz_2059{align-items:stretch;gap:6px;display:flex}._copyRow_hgbdz_2059 ._input_hgbdz_190{flex:1;min-width:0}._copyBtn_hgbdz_2070{border:1px solid var(--color-border);border-radius:var(--radius-md);background-color:var(--color-surface);width:34px;color:var(--color-text-mid);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .15s,color .15s;display:flex}._copyBtn_hgbdz_2070:hover{background-color:var(--color-primary-05);color:var(--color-primary);border-color:var(--color-primary-border)}._webhookFoot_hgbdz_2092{justify-content:space-between;align-items:center;gap:10px;margin-top:4px;display:flex}._testBtn_hgbdz_2100{border-radius:var(--radius-md);border:1px solid var(--color-primary-border);background-color:var(--color-primary-05);color:var(--color-primary);cursor:pointer;align-items:center;gap:6px;padding:6px 12px;font-size:11.5px;font-weight:600;display:inline-flex}._testBtn_hgbdz_2100:hover{background-color:var(--color-primary-10)}._fieldRef_hgbdz_2119{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-bg);margin-top:6px;overflow:hidden}._fieldRefHead_hgbdz_2127{border-bottom:1px solid var(--color-divider);letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-mid);align-items:center;gap:7px;padding:10px 12px;font-size:11px;font-weight:700;display:flex}._fieldRefHead_hgbdz_2127 svg{color:var(--color-primary)}._fieldRefHint_hgbdz_2144{letter-spacing:0;text-transform:none;color:var(--color-text-soft);margin-left:auto;font-size:10.5px;font-weight:500}._fieldRefList_hgbdz_2153{flex-direction:column;display:flex}._fieldRefItem_hgbdz_2158{border:none;border-top:1px solid var(--color-divider);text-align:left;cursor:pointer;background:0 0;align-items:baseline;gap:10px;padding:8px 12px;transition:background-color .12s;display:flex}._fieldRefItem_hgbdz_2158:first-child{border-top:none}._fieldRefItem_hgbdz_2158:hover{background-color:var(--color-primary-05)}._fieldRefToken_hgbdz_2179{color:var(--color-primary);background-color:var(--color-primary-10);border-radius:var(--radius-sm);white-space:nowrap;flex-shrink:0;padding:2px 7px;font-family:ui-monospace,monospace;font-size:11.5px;font-weight:600}._fieldRefDesc_hgbdz_2191{color:var(--color-text-soft);font-size:11.5px;line-height:1.4}._tokenWarn_hgbdz_2197{border-radius:var(--radius-md);background-color:var(--color-secondary-10);border:1px solid var(--color-secondary-border);color:var(--color-secondary-strong);align-items:flex-start;gap:7px;margin-top:10px;padding:9px 11px;font-size:11.5px;line-height:1.45;display:flex}._tokenWarn_hgbdz_2197 svg{flex-shrink:0;margin-top:1px}._tplEditMain_hgbdz_2217{flex-direction:column;gap:10px;display:flex}._tplEditSide_hgbdz_2223{flex-direction:column;gap:14px;display:flex}._tplEditWrap_hgbdz_2230{flex-direction:column;gap:6px;display:flex}._tplEditBar_hgbdz_2236{border-top:1px solid var(--color-divider);align-items:center;gap:12px;margin-top:8px;padding-top:14px;display:flex}._tplBarSpacer_hgbdz_2245{flex:1}@media (width<=640px){._tplEditBar_hgbdz_2236{flex-wrap:wrap;gap:8px}._tplBarSpacer_hgbdz_2245{flex-basis:100%;height:0;margin:0}._tplBarSpacer_hgbdz_2245+span{margin-left:auto}}._pillAdd_hgbdz_142{border:1px dashed var(--color-border-strong);color:var(--color-text-soft);border-radius:var(--radius-full);cursor:pointer;background:0 0;align-self:flex-end;align-items:center;gap:4px;padding:5px 12px;font-size:12px;font-weight:600;transition:color .16s,border-color .16s;display:inline-flex}._pillAdd_hgbdz_142:hover{color:var(--color-primary);border-color:var(--color-primary-border)}._tcFieldsHead_hgbdz_2291{justify-content:space-between;align-items:baseline;gap:10px;margin-top:6px;margin-bottom:6px;display:flex}._tcRows_hgbdz_2300{flex-direction:column;gap:10px;display:flex}._tcCard_hgbdz_2307{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:7px;padding:11px 12px;display:flex}._tcCardTop_hgbdz_2317{align-items:center;gap:8px;display:flex}._tcGrow_hgbdz_2323{min-width:0;height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);flex:1;padding:0 10px;font-family:inherit;font-size:13px;font-weight:600}._tcType_hgbdz_2337{height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);cursor:pointer;flex-shrink:0;padding:0 8px;font-family:inherit;font-size:12px}._tcToken_hgbdz_2350{border-radius:var(--radius-sm);background-color:var(--color-primary-10);max-width:100%;color:var(--color-primary);text-overflow:ellipsis;white-space:nowrap;align-self:flex-start;padding:2px 7px;font-family:ui-monospace,monospace;font-size:10.5px;overflow:hidden}._currencyWrap_hgbdz_2365{align-items:center;gap:6px;padding:0 10px;display:flex}._currencyPrefix_hgbdz_2372{color:var(--color-text-soft);flex-shrink:0;font-weight:700}._currencyInput_hgbdz_2378{min-width:0;height:100%;color:var(--color-text);background:0 0;border:none;flex:1;font-family:inherit;font-size:13px}._currencyInput_hgbdz_2378:focus-visible{outline:none}._tokenRead_hgbdz_2394{cursor:text;border-radius:var(--radius-sm);outline-offset:2px;white-space:pre-wrap;word-break:break-word;outline:2px solid #0000;min-height:1.3em;transition:outline-color .12s,background-color .12s;display:block}._tokenRead_hgbdz_2394:hover{background-color:color-mix(in srgb, var(--accent) 6%, transparent)}._tokenRead_hgbdz_2394:focus-visible{outline-color:var(--accent)}._tokenReadOver_hgbdz_2416{outline-color:var(--accent);background-color:color-mix(in srgb, var(--accent) 12%, transparent)}._tokenReadStatic_hgbdz_2422{cursor:default}._tokenReadStatic_hgbdz_2422:hover{background-color:#0000}._tokenInput_hgbdz_2430{border-radius:var(--radius-sm);background-color:color-mix(in srgb, var(--accent) 8%, transparent);outline:1px solid var(--accent);border:none;width:100%;padding:0 2px;font-family:inherit;display:block}._tokenPlaceholder_hgbdz_2441{color:var(--color-text-very-soft);font-style:italic}._tokenChip_hgbdz_2446{border-radius:var(--radius-full);background-color:color-mix(in srgb, var(--accent) 14%, transparent);color:var(--accent);border:1px solid color-mix(in srgb, var(--accent) 30%, transparent);white-space:nowrap;align-items:center;gap:3px;margin:0 1px;padding:1px 4px 1px 7px;font-family:ui-monospace,monospace;font-size:10.5px;font-weight:700;display:inline-flex}._tokenChipBad_hgbdz_2462{background-color:var(--color-danger-soft);color:var(--color-danger);border-color:color-mix(in srgb, var(--color-danger) 30%, transparent)}._tokenChipX_hgbdz_2468{background-color:color-mix(in srgb, currentColor 15%, transparent);width:14px;height:14px;color:inherit;cursor:pointer;opacity:1;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;margin-left:2px;padding:0;display:inline-flex}._tokenChipX_hgbdz_2468 svg{stroke:currentColor;width:9px;height:9px;display:block}._tokenChipX_hgbdz_2468:hover{background-color:color-mix(in srgb, currentColor 30%, transparent)}._palette_hgbdz_2497{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:12px;padding:14px;display:flex}._paletteGroup_hgbdz_2507{flex-direction:column;gap:7px;display:flex}._paletteGroupLabel_hgbdz_2513{letter-spacing:.08em;text-transform:uppercase;color:var(--color-text-soft);font-size:9.5px;font-weight:700}._paletteChips_hgbdz_2521{flex-direction:column;gap:5px;display:flex}._paletteChipWrap_hgbdz_2527{display:block}._paletteChipWrap_hgbdz_2527>._paletteChip_hgbdz_2521{width:100%}._paletteChip_hgbdz_2521{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);cursor:grab;text-align:left;align-items:center;gap:8px;padding:7px 9px;transition:border-color .12s,box-shadow .12s;display:flex}._paletteChip_hgbdz_2521:hover{border-color:var(--color-primary-border);box-shadow:var(--shadow-sm)}._paletteChip_hgbdz_2521:active{cursor:grabbing}._paletteGrip_hgbdz_2559{color:var(--color-text-very-soft);flex-shrink:0}._paletteToken_hgbdz_2564{border-radius:var(--radius-sm);background-color:var(--color-primary-10);color:var(--color-primary);flex-shrink:0;padding:2px 7px;font-family:ui-monospace,monospace;font-size:11px;font-weight:700}._paletteDesc_hgbdz_2575{color:var(--color-text-soft);font-size:11px;line-height:1.35}._paletteHint_hgbdz_2581{font-size:var(--font-xs);color:var(--color-text-soft);margin:2px 0 0}._simMemberRow_hgbdz_2588{align-items:center;gap:8px;margin-bottom:6px;display:flex}._simMemberRemove_hgbdz_2595{border:1px solid var(--color-border);background:var(--color-surface);width:34px;height:34px;color:var(--color-danger,#dc2626);cursor:pointer;border-radius:8px;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._signatureContainer_hgbdz_2610{margin-top:12px;margin-bottom:12px;padding:8px 0}._signatureLabel_hgbdz_2616{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:12px;display:flex}._signatureCheckbox_hgbdz_2624{width:18px;height:18px;accent-color:var(--color-primary);cursor:pointer;flex-shrink:0;margin:0}._signatureText_hgbdz_2633{flex-direction:column;gap:2px;display:flex}._signatureTitle_hgbdz_2639{color:var(--color-text);font-size:14px;font-weight:600;line-height:1.25}._signatureDesc_hgbdz_2646{color:var(--color-text-soft);font-size:12px}._overlay_1agsz_5{z-index:200;pointer-events:none;position:fixed;inset:0}._card_1agsz_12{pointer-events:auto;border-radius:var(--radius-xl,22px);background-color:var(--color-surface);border:1px solid var(--color-border);width:min(340px,100vw - 40px);box-shadow:var(--shadow-lg);flex-direction:column;gap:14px;padding:16px 18px;display:flex;position:absolute;bottom:20px;left:20px}._draggable_1agsz_30{cursor:grab;touch-action:none}._draggable_1agsz_30:active{cursor:grabbing}._head_1agsz_40{align-items:center;gap:14px;display:flex}._info_1agsz_46{flex-direction:column;gap:2px;min-width:0;display:flex}._avatarRing_1agsz_53{border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:56px;height:56px;display:flex;position:relative}._avatarRingPulse_1agsz_65:before,._avatarRingPulse_1agsz_65:after{content:"";border:2px solid var(--avatar-color,var(--color-primary));opacity:0;border-radius:50%;animation:2s cubic-bezier(.4,0,.2,1) infinite _callPulse_1agsz_1;position:absolute;inset:0}._avatarRingPulse_1agsz_65:after{animation-delay:1s}@keyframes _callPulse_1agsz_1{0%{opacity:.6;transform:scale(.9)}to{opacity:0;transform:scale(1.5)}}._avatar_1agsz_53{background-color:var(--avatar-color,var(--color-primary));color:#fff;letter-spacing:.02em;z-index:1;border-radius:50%;justify-content:center;align-items:center;width:52px;height:52px;font-size:19px;font-weight:700;display:flex;box-shadow:0 4px 14px #0000002e}._name_1agsz_107{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:16px;font-weight:700;line-height:1.25;overflow:hidden}._status_1agsz_117{color:var(--color-text-soft);font-size:13px;font-weight:500}._timer_1agsz_123{font-variant-numeric:tabular-nums;color:var(--color-text-mid);font-size:14px;font-weight:600}._actions_1agsz_130{justify-content:flex-end;align-items:center;gap:14px;display:flex}._btn_1agsz_137{cursor:pointer;color:#fff;width:46px;height:46px;transition:transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:none;border-radius:50%;justify-content:center;align-items:center;display:flex;box-shadow:0 6px 16px #0000002e}._btn_1agsz_137:hover{transform:translateY(-2px)scale(1.04);box-shadow:0 10px 22px #00000038}._btn_1agsz_137:active{transform:scale(.95)}._accept_1agsz_163{background-color:var(--color-success,#16a34a);animation:1.4s ease-in-out infinite _acceptBob_1agsz_1}@keyframes _acceptBob_1agsz_1{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}._decline_1agsz_178{background-color:var(--color-danger,#dc2626)}._mute_1agsz_182{background-color:var(--color-surface-muted);width:42px;height:42px;color:var(--color-text-mid);border:1px solid var(--color-border);box-shadow:none}._muteOn_1agsz_191{background-color:var(--color-text);color:var(--color-surface);border-color:var(--color-text)}@media (prefers-reduced-motion:reduce){._avatarRingPulse_1agsz_65:before,._avatarRingPulse_1agsz_65:after,._accept_1agsz_163{animation:none}}._popped_1agsz_208{pointer-events:auto;position:static}._popped_1agsz_208 ._card_1agsz_12{width:auto;height:100vh;box-shadow:none;border:none;border-radius:0;justify-content:center;position:static}._popOut_1agsz_224{width:28px;height:28px;color:var(--color-text-muted,#6b7280);cursor:pointer;background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._popOut_1agsz_224:hover{background-color:var(--color-surface-hover,#0000000f);color:var(--color-text)}._callBtn_1q44j_1{border:1px solid var(--color-border);background-color:var(--color-surface);width:36px;height:36px;color:var(--color-primary);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);border-radius:50%;justify-content:center;align-items:center;display:inline-flex}._callBtn_1q44j_1:hover:not(:disabled){background-color:var(--color-primary-10);border-color:var(--color-primary-border)}._callBtn_1q44j_1:disabled{opacity:.5;cursor:not-allowed}._card_1bdwl_1{background:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);text-align:left;cursor:pointer;appearance:none;width:100%;max-width:320px;margin-top:8px;padding:0;font-family:inherit;transition:border-color .2s,box-shadow .2s,transform .2s;display:block;overflow:hidden;box-shadow:0 2px 4px #0000000a}._card_1bdwl_1:hover,._card_1bdwl_1:focus-visible{border-color:var(--color-primary-40);outline:none;box-shadow:0 4px 12px #00000014}._header_1bdwl_29{background:var(--color-primary-05);border-bottom:1px solid var(--color-border);color:var(--color-primary);letter-spacing:.05em;text-transform:uppercase;align-items:center;gap:6px;padding:8px 14px;font-size:10px;font-weight:700;display:flex}._body_1bdwl_43{padding:14px}._authorRow_1bdwl_47{align-items:center;gap:10px;margin-bottom:10px;display:flex}._avatar_1bdwl_54{background:var(--avatar-color,var(--color-primary));width:26px;height:26px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:11px;font-weight:600;display:flex}._authorInfo_1bdwl_68{flex:1;min-width:0}._authorName_1bdwl_73{color:var(--color-text);font-size:12px;font-weight:600;line-height:1.2}._category_1bdwl_80{color:var(--cat-color,var(--color-text-soft));align-items:center;gap:5px;margin-top:3px;font-size:10.5px;font-weight:600;display:inline-flex}._catDot_1bdwl_90{background:var(--cat-color,var(--color-text-soft));border-radius:50%;width:6px;height:6px}._title_1bdwl_97{color:var(--color-text);margin-bottom:6px;font-size:14px;font-weight:600;line-height:1.4}._snippet_1bdwl_105{color:var(--color-text-mid);-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;font-size:13px;line-height:1.5;display:-webkit-box;overflow:hidden}._footer_1bdwl_116{border-top:1px solid var(--color-border);color:var(--color-primary);align-items:center;gap:4px;margin-top:12px;padding-top:10px;font-size:12px;font-weight:600;transition:color .2s;display:flex}._card_1bdwl_1:hover ._footer_1bdwl_116{color:var(--color-primary-dark,var(--color-primary))}:host{contain:layout style;height:100%;min-height:24rem;display:block}:host .commhub-widget-root{height:100%;font-family:var(--font-sans);font-size:var(--font-base);font-variant:normal;font-style:normal;font-weight:400;font-stretch:100%;line-height:var(--line-body);letter-spacing:-.01em;word-spacing:normal;text-align:start;text-indent:0;text-transform:none;text-shadow:none;white-space:normal;word-break:normal;overflow-wrap:normal;tab-size:4;color:var(--color-text);visibility:visible;opacity:1;writing-mode:horizontal-tb;cursor:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-feature-settings:"cv05", "cv11", "ss01";direction:ltr;list-style:none;display:block;overflow-y:auto;container-type:inline-size}:host{--color-primary:#045d5e;--color-primary-strong:#033f40;--color-primary-light:#067a7b;--color-primary-30:#045d5e2e;--color-primary-20:#045d5e1f;--color-primary-10:#045d5e0f;--color-primary-05:#045d5e09;--color-primary-border:#045d5e38;--color-on-primary:#fff;--color-secondary:#fc7300;--color-secondary-strong:#e16500;--color-secondary-30:#fc730033;--color-secondary-20:#fc73001f;--color-secondary-10:#fc730012;--color-secondary-border:#fc73004d;--color-bg:#f8fafc;--color-surface:#fff;--color-surface-muted:#f1f5f9;--color-off-hours:#f4f6f9;--color-text:#0f172a;--color-text-mid:#475569;--color-text-soft:#64748b;--color-text-muted:#64748b;--color-text-very-soft:#94a3b8;--color-border:#0f172a0f;--color-border-strong:#0f172a1a;--color-divider:#0f172a0a;--shadow-sm:0 1px 2px #0f172a0a, 0 1px 1px #0f172a08;--shadow-md:0 2px 4px #0f172a0a, 0 8px 18px #0f172a12;--shadow-lg:0 4px 10px #0f172a0d, 0 18px 44px #0f172a1a;--color-success:#10b981;--color-success-strong:#15803d;--color-success-soft:#10b98114;--color-danger:#ef4444;--color-danger-strong:#b91c1c;--color-danger-soft:#ef44440f;--color-warn:#f59e0b;--color-warn-soft:#f59e0b14;--color-focus:#3b82f6;--color-overlay:#0f172a73;--color-media-scrim:#090c10eb;--font-sans:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--font-xs:11.5px;--font-sm:13px;--font-base:14px;--font-md:15px;--font-lg:19px;--font-xl:24px;--font-2xl:30px;--line-body:1.55;--line-tight:1.28;--tracking-tight:-.02em;--tracking-tighter:-.03em;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-7:32px;--radius-sm:6px;--radius-md:10px;--radius-lg:14px;--radius-xl:16px;--radius-full:999px;--ease-out:cubic-bezier(.22, 1, .36, 1);--ease-in-out:cubic-bezier(.65, 0, .35, 1);--dur-fast:.14s;--dur-base:.2s;--dur-slow:.32s;--height-btn:36px;--height-input:40px;--height-row:52px;--height-nav:42px;--badge-h:20px;--badge-font:11px;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-primary:#3fb5b7;--color-primary-strong:#2d9799;--color-primary-light:#67d4d6;--color-primary-30:#3fb5b747;--color-primary-20:#3fb5b72e;--color-primary-10:#3fb5b71a;--color-primary-05:#3fb5b70f;--color-primary-border:#3fb5b752;--color-secondary:#ff8a2e;--color-secondary-strong:#e16500;--color-secondary-30:#ff8a2e4d;--color-secondary-20:#ff8a2e2e;--color-secondary-10:#ff8a2e1f;--color-secondary-border:#ff8a2e61;--color-bg:#0f1517;--color-surface:#1a2226;--color-surface-muted:#222c30;--color-off-hours:#11181b;--color-text:#e8edef;--color-text-mid:#a8b5bd;--color-text-soft:#7c8a92;--color-text-muted:#7c8a92;--color-text-very-soft:#536069;--color-border:#ffffff12;--color-border-strong:#ffffff21;--color-divider:#ffffff0a;--shadow-sm:0 1px 2px #0000004d, 0 1px 1px #0003;--shadow-md:0 2px 4px #0000004d, 0 8px 18px #0006;--shadow-lg:0 4px 10px #00000059, 0 18px 44px #00000080;--color-success:#34d399;--color-success-soft:#34d3991f;--color-danger:#f87171;--color-danger-soft:#f871711f;--color-warn:#fbbf24;--color-warn-soft:#fbbf241f}}:host([data-theme=dark]){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-primary:#3fb5b7;--color-primary-strong:#2d9799;--color-primary-light:#67d4d6;--color-primary-30:#3fb5b747;--color-primary-20:#3fb5b72e;--color-primary-10:#3fb5b71a;--color-primary-05:#3fb5b70f;--color-primary-border:#3fb5b752;--color-secondary:#ff8a2e;--color-secondary-strong:#e16500;--color-secondary-30:#ff8a2e4d;--color-secondary-20:#ff8a2e2e;--color-secondary-10:#ff8a2e1f;--color-secondary-border:#ff8a2e61;--color-bg:#0f1517;--color-surface:#1a2226;--color-surface-muted:#222c30;--color-off-hours:#11181b;--color-text:#e8edef;--color-text-mid:#a8b5bd;--color-text-soft:#7c8a92;--color-text-muted:#7c8a92;--color-text-very-soft:#536069;--color-border:#ffffff12;--color-border-strong:#ffffff21;--color-divider:#ffffff0a;--shadow-sm:0 1px 2px #00000040;--shadow-md:0 4px 12px #00000059;--shadow-lg:0 12px 32px #00000073;--color-success:#34d399;--color-success-soft:#34d3991f;--color-danger:#f87171;--color-danger-soft:#f871711f;--color-warn:#fbbf24;--color-warn-soft:#fbbf241f}:host,*{box-sizing:border-box}:host,.commhub-widget-root{height:100%}.route-fallback{place-items:center;min-height:100vh;display:grid}.content-fallback{place-items:center;height:100%;min-height:240px;display:grid}:host{font-family:var(--font-sans);background-color:var(--color-bg);color:var(--color-text);font-size:var(--font-base);line-height:var(--line-body);letter-spacing:-.01em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-feature-settings:"cv05", "cv11", "ss01";margin:0}::selection{background-color:var(--color-primary-20);color:var(--color-text)}:focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}:host,*{scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:var(--radius-full);background-clip:padding-box;border:2px solid #0000}::-webkit-scrollbar-thumb:hover{background-color:var(--color-text-very-soft)}@media (width<=768px){:host{--height-btn:44px;--height-input:44px;--height-nav:56px}}._notice_184jj_6{color:#b91c1c;background-color:#fef2f2;border:1px solid #fecaca;border-radius:8px;margin:0;padding:16px;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:13px;line-height:1.5}._title_184jj_23{margin-bottom:4px;font-weight:600;display:block}._detail_184jj_29{word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}._scope_p8b6f_6{display:contents}._screen_ltjgo_1{flex-direction:column;min-height:100%;display:flex}._toolbar_ltjgo_8{background-color:var(--color-surface);border-bottom:1px solid var(--color-divider);padding:14px 0}._toolbarContainer_ltjgo_14{gap:22px;width:100%;max-width:1080px;margin:0 auto;padding:0 20px;display:flex}._search_ltjgo_23{flex:720px;width:100%;min-width:0;max-width:720px;position:relative}._toolbarRailSpacer_ltjgo_31{flex-shrink:0;width:330px}._searchIcon_ltjgo_36{color:var(--color-text-soft);position:absolute;top:50%;left:13px;transform:translateY(-50%)}._searchInput_ltjgo_44{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);outline:none;padding:10px 14px 10px 36px;font-size:13px}._searchInput_ltjgo_44:focus{border-color:var(--color-primary-border)}._textareaError_ltjgo_59,._commentComposerError_ltjgo_60,._shareCommentError_ltjgo_61{border-color:var(--color-danger)!important;border-radius:var(--radius-md)!important;box-shadow:inset 0 0 0 1.5px var(--color-danger), 0 0 8px #ef444440!important}._wrapper_ltjgo_70{align-items:flex-start;gap:22px;width:100%;max-width:1080px;margin:0 auto;padding:22px 20px 48px;display:flex}._column_ltjgo_80{flex-direction:column;flex:720px;gap:16px;width:100%;min-width:0;max-width:720px;display:flex}._rail_ltjgo_91{flex-direction:column;flex-shrink:0;align-self:flex-start;width:330px;max-height:calc(100vh - 130px);display:flex;position:sticky;top:22px}._railHead_ltjgo_102{justify-content:space-between;align-items:center;padding:2px 4px 10px;display:flex}._railHeadTitle_ltjgo_109{font-size:var(--font-xs);color:var(--color-text-soft);letter-spacing:.08em;align-items:center;gap:6px;font-weight:700;display:inline-flex}._railHeadTitle_ltjgo_109 svg{color:var(--color-secondary)}._railSeeAll_ltjgo_123{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;font-size:11px;font-weight:600}._railList_ltjgo_132{flex-direction:column;flex:1;gap:12px;min-height:0;padding-right:4px;display:flex;overflow-y:auto}._cardBody_ltjgo_142{white-space:pre-wrap;word-break:break-word;color:var(--color-text-body);margin:0;font-size:14px;line-height:1.6}._seeMoreBtn_ltjgo_151{color:var(--color-primary);cursor:pointer;background:0 0;border:none;margin-left:4px;padding:0;font-size:14px;font-weight:600}._seeMoreBtn_ltjgo_151:hover{text-decoration:underline}._railFoot_ltjgo_166{border-top:1px solid var(--color-divider);font-size:var(--font-xs);color:var(--color-text-very-soft);text-align:center;flex-shrink:0;margin-top:8px;padding-top:8px}._missed_ltjgo_177{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);padding:12px 14px}._missedHead_ltjgo_184{align-items:center;gap:9px;margin-bottom:10px;padding:0 2px;display:flex}._missedSpark_ltjgo_192{color:var(--color-primary)}._missedTitle_ltjgo_196{font-size:var(--font-xs);color:var(--color-text);letter-spacing:.1em;font-weight:700}._missedBadge_ltjgo_203{background-color:var(--color-primary-10);color:var(--color-primary);border-radius:var(--radius-full);padding:1px 7px;font-size:9.5px;font-weight:700}._missedScroller_ltjgo_212{position:relative}._missedScrollerFade_ltjgo_217 ._missedTrack_ltjgo_217{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 26px),#0000);mask-image:linear-gradient(90deg,#000 calc(100% - 26px),#0000)}._missedTrack_ltjgo_217{scroll-snap-type:x mandatory;gap:10px;padding:4px 2px 10px;display:flex;overflow-x:auto}._missedNav_ltjgo_229{z-index:2;border:1px solid var(--color-border);background-color:var(--color-surface);width:30px;height:30px;color:var(--color-text-mid);box-shadow:var(--shadow-md);cursor:pointer;opacity:0;border-radius:50%;justify-content:center;align-items:center;transition:opacity .15s,background-color .15s,color .15s,border-color .15s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}._missedScroller_ltjgo_212:hover ._missedNav_ltjgo_229,._missedScroller_ltjgo_212:focus-within ._missedNav_ltjgo_229{opacity:1}._missedNav_ltjgo_229:hover{background-color:var(--color-primary);color:var(--color-on-primary);border-color:var(--color-primary)}._missedNavLeft_ltjgo_264{left:-6px}._missedNavRight_ltjgo_268{right:-6px}._missedCard_ltjgo_272{background-color:var(--color-bg);border:1px solid var(--color-border);border-radius:var(--radius-md);scroll-snap-align:start;flex-shrink:0;width:280px;padding:11px 12px}._missedCardTop_ltjgo_282{align-items:center;gap:6px;margin-bottom:7px;display:flex}._missedDot_ltjgo_289{background-color:var(--dot);border-radius:50%;flex-shrink:0;width:6px;height:6px}._missedCat_ltjgo_297{color:var(--color-text-mid);letter-spacing:.02em;font-size:9.5px;font-weight:600}._missedTime_ltjgo_304{font-size:var(--font-xs);color:var(--color-text-soft);margin-left:auto;margin-right:24px}._missedSummary_ltjgo_311{color:var(--color-text);-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;margin:0 0 8px;font-size:11.5px;line-height:1.5;display:-webkit-box;overflow:hidden}._missedFoot_ltjgo_323{justify-content:space-between;align-items:center;display:flex}._missedCta_ltjgo_329{font-size:var(--font-xs);color:var(--color-primary);align-items:center;gap:3px;font-weight:700;display:inline-flex}._missedPriority_ltjgo_338{color:var(--color-primary);background-color:var(--color-primary-05);border:1px solid var(--color-primary-30);letter-spacing:.04em;text-transform:uppercase;border-radius:4px;align-items:center;gap:3px;padding:1px 6px;font-size:9px;font-weight:700;display:inline-flex}._compChips_ltjgo_354{flex-wrap:wrap;gap:6px;padding:0 16px 8px;display:flex}._compChip_ltjgo_354{border-radius:var(--radius-full);background-color:var(--color-bg);border:1px solid var(--color-border);font-size:var(--font-xs);color:var(--color-text);align-items:center;gap:4px;padding:3px 9px;font-weight:600;display:inline-flex}._actionBar_ltjgo_374{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);justify-content:space-between;align-items:center;gap:8px;margin:0 16px 12px;padding:8px 12px;display:flex}._actionBarLabel_ltjgo_386{color:var(--color-text-mid);font-size:11.5px;font-weight:600}._actionBarBtns_ltjgo_392{gap:2px;display:flex}._actionIcon_ltjgo_397{width:32px;height:32px;color:var(--color-text-mid);cursor:pointer;background:0 0;border:none;border-radius:7px;justify-content:center;align-items:center;display:flex}._actionIcon_ltjgo_397:hover{background-color:var(--color-bg)}._actionIconActive_ltjgo_414{background-color:var(--color-primary-05);color:var(--color-primary)}._sheet_ltjgo_419{border-radius:var(--radius-md);background-color:var(--color-bg);border:1px solid var(--color-border);margin:0 16px 12px;padding:12px 14px}._sheetHead_ltjgo_427{justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px;display:flex}._sheetLabel_ltjgo_435{font-size:var(--font-xs);color:var(--color-text-mid);letter-spacing:.06em;text-transform:uppercase;font-weight:700}._sheetClose_ltjgo_443{border-radius:var(--radius-sm);width:24px;height:24px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .15s,color .15s;display:flex}._sheetClose_ltjgo_443:hover{background-color:var(--color-surface-muted);color:var(--color-text)}._sheetChips_ltjgo_465{flex-wrap:wrap;gap:6px;display:flex}._catChip_ltjgo_471{border-radius:var(--radius-full);font-size:var(--font-xs);background-color:color-mix(in srgb, var(--chip) 10%, transparent);color:var(--chip);border:1px solid color-mix(in srgb, var(--chip) 30%, transparent);cursor:pointer;letter-spacing:.03em;padding:5px 11px;font-weight:700}._catChipOn_ltjgo_483{background-color:var(--chip);color:var(--color-on-primary)}._feelGrid_ltjgo_488{grid-template-columns:repeat(4,1fr);gap:6px;display:grid}._feelBtn_ltjgo_494{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-mid);cursor:pointer;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;font-size:10.5px;font-weight:600;display:flex}._feelBtnOn_ltjgo_509{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._feelEmoji_ltjgo_515{font-size:20px}._photoInput_ltjgo_519{display:none}._photoZone_ltjgo_523{border-radius:var(--radius-md);margin:0 16px 24px}._photoZoneDrag_ltjgo_528{outline:2px dashed var(--color-primary);outline-offset:3px}._dropzone_ltjgo_533{border-radius:var(--radius-md);border:1.5px dashed var(--color-border-strong);background-color:var(--color-surface);cursor:pointer;flex-direction:column;align-items:center;gap:4px;width:100%;padding:22px 16px;transition:border-color .15s,background-color .15s;display:flex}._dropzone_ltjgo_533:hover{border-color:var(--color-primary);background-color:var(--color-primary-05)}._dropIcon_ltjgo_554{background-color:var(--color-primary-10);width:40px;height:40px;color:var(--color-primary);border-radius:50%;justify-content:center;align-items:center;margin-bottom:2px;display:flex}._dropTitle_ltjgo_566{color:var(--color-text);font-size:12.5px;font-weight:600}._dropHint_ltjgo_572{font-size:var(--font-xs);color:var(--color-text-soft)}._photoGrid_ltjgo_577{grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px;display:grid}._photoThumb_ltjgo_584{aspect-ratio:1;border-radius:var(--radius-md);border:1px solid var(--color-border);position:relative;overflow:hidden}._photoImg_ltjgo_592{object-fit:cover;width:100%;height:100%;display:block}._photoRemove_ltjgo_599{color:#fff;cursor:pointer;background-color:#0d1f1f8c;border:none;border-radius:50%;justify-content:center;align-items:center;width:22px;height:22px;display:flex;position:absolute;top:5px;right:5px}._photoRemove_ltjgo_599:hover{background-color:#0d1f1fc7}._photoAddMore_ltjgo_619{aspect-ratio:1;border-radius:var(--radius-md);border:1.5px dashed var(--color-border-strong);background-color:var(--color-surface);color:var(--color-text-soft);cursor:pointer;justify-content:center;align-items:center;transition:border-color .15s,color .15s,background-color .15s;display:flex}._photoAddMore_ltjgo_619:hover{border-color:var(--color-primary);color:var(--color-primary);background-color:var(--color-primary-05)}._mobilePromoTrigger_ltjgo_642{display:none}@keyframes _promoPulseGlow_ltjgo_1{0%{box-shadow:0 0 #00909f73,0 8px 24px #00000059}70%{box-shadow:0 0 0 12px #00909f00,0 8px 24px #00000059}to{box-shadow:0 0 #00909f00,0 8px 24px #00000059}}@keyframes _promoShimmer_ltjgo_758{0%{transform:translate(-120%)rotate(25deg)}20%,to{transform:translate(180%)rotate(25deg)}}@keyframes _sparkleTwinkle_ltjgo_1{0%,to{opacity:.9;transform:scale(1)rotate(0)}50%{opacity:1;transform:scale(1.18)rotate(12deg)}}@media (width<=1024px){._rail_ltjgo_91,._toolbarRailSpacer_ltjgo_31{display:none}._mobilePromoTrigger_ltjgo_642{z-index:90;border-radius:var(--radius-full);-webkit-backdrop-filter:blur(14px);color:#fff;letter-spacing:-.01em;cursor:pointer;background:linear-gradient(135deg,#095e5ff2,#00909ffa);border:1px solid #ffffff47;align-items:center;gap:0;min-width:44px;max-width:44px;height:44px;padding:9px;font-size:13px;font-weight:600;transition:bottom .22s cubic-bezier(.22,1,.36,1),max-width .35s cubic-bezier(.16,1,.3,1),padding .35s cubic-bezier(.16,1,.3,1),gap .35s cubic-bezier(.16,1,.3,1),transform .25s cubic-bezier(.16,1,.3,1),box-shadow .25s;animation:3s infinite _promoPulseGlow_ltjgo_1;display:inline-flex;position:fixed;bottom:24px;right:20px;overflow:hidden;box-shadow:0 4px 16px #00000040}@media (width<=425px){._mobilePromoTrigger_ltjgo_642{bottom:76px}._mobilePromoTriggerBarHidden_ltjgo_739{bottom:20px}}._mobilePromoTrigger_ltjgo_642:hover,._mobilePromoExpanded_ltjgo_745{background:linear-gradient(135deg,#0b797afa,#00a8ba);border-color:#ffffff73;gap:10px;max-width:230px;padding-right:16px;transform:translateY(-3px)scale(1.02)}._mobilePromoTrigger_ltjgo_642:active{transform:translateY(0)scale(.97)}._promoShimmerSweep_ltjgo_758{pointer-events:none;background:linear-gradient(90deg,#0000,#ffffff59,#0000);width:40%;height:200%;animation:4s ease-in-out infinite _promoShimmer_ltjgo_758;position:absolute;top:-50%;left:-50%}._promoIconWrap_ltjgo_774{border-radius:var(--radius-full);color:#ffd166;background:#ffffff2e;border:1px solid #ffffff40;flex-shrink:0;justify-content:center;align-items:center;width:26px;height:26px;display:flex}._sparkleIcon_ltjgo_787{animation:2.5s ease-in-out infinite _sparkleTwinkle_ltjgo_1}._promoBtnText_ltjgo_791{color:#fff;text-shadow:0 1px 2px #0003;white-space:nowrap;opacity:0;max-width:0;font-weight:600;transition:opacity .28s,max-width .35s cubic-bezier(.16,1,.3,1);overflow:hidden}._mobilePromoTrigger_ltjgo_642:hover ._promoBtnText_ltjgo_791,._mobilePromoExpanded_ltjgo_745 ._promoBtnText_ltjgo_791{opacity:1;max-width:180px}._mobilePromoBadge_ltjgo_810{border-radius:var(--radius-full);color:#fff;letter-spacing:0;background:linear-gradient(135deg,#f37321,#ff9f1c);justify-content:center;align-items:center;min-width:22px;height:22px;padding:0 7px;font-size:11px;font-weight:800;display:inline-flex;box-shadow:0 2px 8px #f3732166}}._promoPopoverOverlay_ltjgo_827{z-index:1000;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background-color:#000000a6;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}._promoPopoverCard_ltjgo_839{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-xl);width:100%;max-width:440px;max-height:85vh;box-shadow:var(--shadow-xl);flex-direction:column;display:flex;position:relative;overflow:hidden}._popoverHeader_ltjgo_853{text-align:center;flex-direction:column;align-items:center;padding:28px 24px 16px;display:flex;position:relative}._popoverCloseX_ltjgo_862{color:var(--color-text-soft);cursor:pointer;border-radius:var(--radius-full);transition:background-color var(--dur-fast) var(--ease-out);background:0 0;border:none;justify-content:center;align-items:center;padding:6px;display:flex;position:absolute;top:16px;right:16px}._popoverCloseX_ltjgo_862:hover{background-color:var(--color-surface-muted);color:var(--color-text)}._popoverBadgeIcon_ltjgo_883{border-radius:var(--radius-full);background-color:var(--color-primary-10);width:56px;height:56px;color:var(--color-primary);justify-content:center;align-items:center;margin-bottom:14px;display:flex}._popoverTitleRow_ltjgo_895{flex-wrap:wrap;justify-content:center;align-items:center;gap:10px;margin-bottom:6px;display:flex}._popoverTitle_ltjgo_895{color:var(--color-text);margin:0;font-size:18px;font-weight:700}._popoverSeeAllBtn_ltjgo_911{background-color:var(--color-primary-10);color:var(--color-primary);border:1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);border-radius:var(--radius-full);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out);padding:3px 10px;font-size:11px;font-weight:700}._popoverSeeAllBtn_ltjgo_911:hover{background-color:var(--color-primary-20,#00000026)}._popoverSub_ltjgo_927{color:var(--color-text-muted);margin:0;font-size:13px;line-height:1.4}._popoverContent_ltjgo_934{flex-direction:column;flex:1;gap:14px;padding:12px 24px 24px;display:flex;overflow-y:auto}._popoverEmpty_ltjgo_943{text-align:center;color:var(--color-text-muted);padding:20px 0;font-size:13px}._railList_ltjgo_132{scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}._railList_ltjgo_132::-webkit-scrollbar{width:6px}._railList_ltjgo_132::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:var(--radius-full)}._railList_ltjgo_132::-webkit-scrollbar-track{background:0 0}._missedTrack_ltjgo_217{scrollbar-width:none}._missedTrack_ltjgo_217::-webkit-scrollbar{display:none}._missedCard_ltjgo_272{transition:transform .18s,border-color .18s,box-shadow .18s;position:relative}._missedCard_ltjgo_272:hover{border-color:var(--color-primary-30);transform:translateY(-1px);box-shadow:0 4px 14px #045d5e14}._missedClose_ltjgo_992{background:var(--color-surface-muted);width:20px;height:20px;color:var(--color-text-soft);cursor:pointer;opacity:.6;border:none;border-radius:5px;justify-content:center;align-items:center;transition:opacity .15s,background-color .15s,color .15s;display:flex;position:absolute;top:6px;right:6px}._missedCard_ltjgo_272:hover ._missedClose_ltjgo_992{opacity:1}._missedClose_ltjgo_992:hover{background-color:var(--color-border);color:var(--color-text)}._missedCta_ltjgo_329{cursor:pointer;background:0 0;border:none;padding:0}._missedRead_ltjgo_1029{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:6px;margin-left:auto;padding:4px 8px;font-size:11px;font-weight:600}._missedRead_ltjgo_1029:hover{background-color:var(--color-bg);color:var(--color-text)}._railSeeAll_ltjgo_123{cursor:pointer}._railSeeAll_ltjgo_123:hover{color:var(--color-primary)}._comments_ltjgo_1055{border-top:1px solid var(--color-divider);background-color:var(--color-bg);flex-direction:column;gap:8px;padding:12px 18px;display:flex}._commentRow_ltjgo_1064{gap:9px;display:flex}._commentAvatar_ltjgo_1069{background-color:var(--avatar-color);width:26px;height:26px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:10px;font-weight:700;display:flex}._commentBubble_ltjgo_1083{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:9px;flex:1;padding:7px 10px}._commentAuthor_ltjgo_1091{color:var(--color-text);font-size:11px;font-weight:700}._commentTime_ltjgo_1097{color:var(--color-text-soft);font-weight:500}._commentText_ltjgo_1102{color:var(--color-text-mid);margin-top:2px;font-size:11.5px;line-height:1.45}._commentComposer_ltjgo_60{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:9px;flex:1;align-items:center;gap:8px;padding:4px 4px 4px 12px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;display:flex}._commentComposer_ltjgo_60:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary-10)}._commentInput_ltjgo_1128{color:var(--color-text);background:0 0;border:none;outline:none;flex:1;padding:4px 0;font-size:11.5px}._commentSend_ltjgo_1138{background-color:var(--color-primary);width:28px;height:28px;color:var(--color-on-primary);cursor:pointer;border:none;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;transition:background-color .15s,color .15s,opacity .15s;display:flex}._commentSend_ltjgo_1138:hover:not(:disabled){background-color:var(--color-primary-strong)}._commentSend_ltjgo_1138:disabled{background-color:var(--color-surface-muted);color:var(--color-text-soft);cursor:not-allowed;opacity:.6}._sharePreviewWrap_ltjgo_1168{background-color:var(--color-bg);border-bottom:1px solid var(--color-border);padding:12px 20px}._sharePreview_ltjgo_1168{border-radius:var(--radius-md);background-color:var(--color-surface);border:1px solid var(--color-border);align-items:flex-start;gap:10px;padding:10px;display:flex}._sharePreviewAvatar_ltjgo_1184{background-color:var(--avatar-color);width:28px;height:28px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:10px;font-weight:700;display:flex}._sharePreviewBody_ltjgo_1198{flex:1;min-width:0}._sharePreviewMeta_ltjgo_1203{color:var(--color-text-soft);margin-bottom:2px;font-size:11px}._sharePreviewCat_ltjgo_1209{color:var(--cat);font-weight:600}._sharePreviewTitle_ltjgo_1214{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:12.5px;font-weight:600;overflow:hidden}._shareField_ltjgo_1224{padding:12px 20px 4px}._shareComment_ltjgo_61{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:100%;color:var(--color-text);padding:9px 12px;font-family:inherit;font-size:12.5px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}._shareComment_ltjgo_61:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px var(--color-primary-10);outline:none}._shareSearchWrap_ltjgo_1248{padding:8px 20px 6px}._shareSearch_ltjgo_1248{position:relative}._shareSearch_ltjgo_1248 svg{color:var(--color-text-soft);position:absolute;top:50%;left:11px;transform:translateY(-50%)}._shareSearchInput_ltjgo_1264{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);padding:8px 12px 8px 32px;font-family:inherit;font-size:12px}._shareSearchInput_ltjgo_1264:focus{border-color:var(--color-primary);outline:none}._shareList_ltjgo_1281{flex:1;min-height:0;padding:4px 20px 12px;overflow-y:auto}._shareSectionLabel_ltjgo_1288{letter-spacing:.1em;text-transform:uppercase;color:var(--color-text-soft);padding:10px 4px 6px;font-size:9.5px;font-weight:700}._shareRow_ltjgo_1297{text-align:left;border-radius:var(--radius-md);cursor:pointer;background:0 0;border:1px solid #0000;align-items:center;gap:10px;width:100%;margin-bottom:2px;padding:8px;display:flex}._shareRow_ltjgo_1297:hover{background-color:var(--color-bg)}._shareRowOn_ltjgo_1315,._shareRowOn_ltjgo_1315:hover{background-color:var(--color-primary-10);border-color:var(--color-primary-30)}._shareAvatar_ltjgo_1321{background-color:var(--avatar-color);width:32px;height:32px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:12px;font-weight:700;display:flex}._shareAvatarSquare_ltjgo_1335{border-radius:8px}._shareRowBody_ltjgo_1339{flex-direction:column;flex:1;min-width:0;display:flex}._shareRowName_ltjgo_1346{color:var(--color-text);font-size:12.5px;font-weight:600}._shareRowSub_ltjgo_1352{font-size:var(--font-xs);color:var(--color-text-soft)}._shareCheck_ltjgo_1357{border:1.5px solid var(--color-border-strong);width:18px;height:18px;color:var(--color-on-primary);background:0 0;border-radius:5px;flex-shrink:0;justify-content:center;align-items:center;display:flex}._shareCheckOn_ltjgo_1370{background-color:var(--color-primary);border-color:var(--color-primary)}._shareEmpty_ltjgo_1375{text-align:center;color:var(--color-text-soft);padding:30px 0;font-size:12px}._shareFootText_ltjgo_1383{color:var(--color-text-mid);font-size:11.5px}._shareFootBtns_ltjgo_1388{gap:8px;display:flex}._shareCancelBtn_ltjgo_1393{border-radius:var(--radius-md);border:1px solid var(--color-border);color:var(--color-text-mid);cursor:pointer;background:0 0;padding:8px 14px;font-size:12px;font-weight:600}._shareCancelBtn_ltjgo_1393:hover{background-color:var(--color-bg)}._shareSendBtn_ltjgo_1408{border-radius:var(--radius-md);background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;align-items:center;gap:6px;padding:8px 16px;font-size:12px;font-weight:700;display:inline-flex}._shareSendBtn_ltjgo_1408:disabled{background-color:var(--color-bg);color:var(--color-text-very-soft);border:1px solid var(--color-border);cursor:not-allowed}._shareRoot_ltjgo_1429{z-index:11000;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}._shareBackdrop_ltjgo_1439{background-color:var(--color-overlay);cursor:pointer;border:none;padding:0;animation:.16s _shareFade_ltjgo_1;position:absolute;inset:0}._shareModal_ltjgo_1449{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);width:min(540px,100%);max-height:85vh;box-shadow:var(--shadow-lg);flex-direction:column;animation:.16s _shareIn_ltjgo_1;display:flex;position:relative;overflow:hidden}@keyframes _shareFade_ltjgo_1{0%{opacity:0}}@keyframes _shareIn_ltjgo_1{0%{opacity:0;transform:translateY(8px)scale(.98)}}@media (prefers-reduced-motion:reduce){._shareBackdrop_ltjgo_1439,._shareModal_ltjgo_1449{animation:none}}._shareHead_ltjgo_1483{border-bottom:1px solid var(--color-border);align-items:center;gap:10px;padding:16px 20px 12px;display:flex}._shareHeadIcon_ltjgo_1491{background-color:var(--color-primary-10);width:30px;height:30px;color:var(--color-primary);border-radius:8px;flex-shrink:0;justify-content:center;align-items:center;display:flex}._shareHeadText_ltjgo_1503{flex:1;min-width:0}._shareTitle_ltjgo_1508{font-size:var(--font-md);color:var(--color-text);margin:0;font-weight:700}._shareDesc_ltjgo_1515{color:var(--color-text-soft);margin:1px 0 0;font-size:11px}._shareCloseBtn_ltjgo_1521{width:32px;height:32px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:8px;flex-shrink:0;justify-content:center;align-items:center;display:flex}._shareCloseBtn_ltjgo_1521:hover{background-color:var(--color-surface-muted);color:var(--color-text)}._shareFooter_ltjgo_1540{border-top:1px solid var(--color-border);background-color:var(--color-bg);justify-content:space-between;align-items:center;gap:8px;padding:12px 20px;display:flex}._ppRoot_ltjgo_1551{z-index:60;justify-content:flex-end;display:flex;position:fixed;inset:0}._ppOverlay_ltjgo_1559{background-color:var(--color-overlay);cursor:pointer;border:none;padding:0;animation:.18s _ppFade_ltjgo_1;position:absolute;inset:0}._ppPanel_ltjgo_1569{background-color:var(--color-surface);width:min(480px,100%);height:100%;box-shadow:var(--shadow-lg);flex-direction:column;animation:.22s _ppSlide_ltjgo_1;display:flex;position:relative;overflow:hidden}@keyframes _ppFade_ltjgo_1{0%{opacity:0}}@keyframes _ppSlide_ltjgo_1{0%{transform:translate(100%)}}@media (prefers-reduced-motion:reduce){._ppOverlay_ltjgo_1559,._ppPanel_ltjgo_1569{animation:none}}._ppHead_ltjgo_1601{background:linear-gradient(135deg, var(--color-primary), var(--color-primary-light));color:var(--color-on-primary);align-items:flex-start;gap:13px;padding:22px 22px 20px;display:flex}._ppHeadIcon_ltjgo_1610{border-radius:var(--radius-md);background-color:#ffffff2e;flex-shrink:0;justify-content:center;align-items:center;width:40px;height:40px;display:flex}._ppHeadText_ltjgo_1621{flex:1;min-width:0}._ppTitle_ltjgo_1626{font-size:var(--font-xl);color:var(--color-on-primary);letter-spacing:-.01em;margin:0;font-weight:700}@media (width<=640px){._ppTitle_ltjgo_1626{white-space:nowrap;text-overflow:ellipsis;font-size:19px;overflow:hidden}}._ppSubtitle_ltjgo_1643{color:#ffffffe0;margin:4px 0 3px;font-size:12.5px}._ppManaged_ltjgo_1649{color:#ffffffb8;font-size:11px}._ppClose_ltjgo_1654{color:#ffffffe6;cursor:pointer;background:0 0;border:none;border-radius:9px;flex-shrink:0;justify-content:center;align-items:center;width:36px;height:36px;transition:background-color .15s;display:flex}._ppClose_ltjgo_1654:hover{color:#fff;background-color:#ffffff2e}._ppTabs_ltjgo_1674{border-bottom:1px solid var(--color-divider);flex-wrap:wrap;gap:6px;padding:14px 22px;display:flex}._ppTabs_ltjgo_1674:has(._ppTab_ltjgo_1674:only-child){display:none}._ppTabs_ltjgo_1674:has(._ppTab_ltjgo_1674:only-child)+._ppSearch_ltjgo_1683{display:none}._ppTab_ltjgo_1674{border-radius:var(--radius-full);background-color:var(--color-surface-muted);color:var(--color-text-soft);cursor:pointer;border:none;padding:7px 14px;font-size:12.5px;font-weight:600;transition:color .16s;position:relative}._ppTab_ltjgo_1674:hover{color:var(--color-text)}._ppTabActive_ltjgo_1704{color:var(--color-primary)}._ppTabBg_ltjgo_1708{border-radius:var(--radius-full);background-color:var(--color-primary-10);box-shadow:inset 0 0 0 1px var(--color-primary-border);position:absolute;inset:0}._ppTabLabel_ltjgo_1716{z-index:1;position:relative}._ppSearch_ltjgo_1683{margin:14px 22px 6px;position:relative}._ppSearchIcon_ltjgo_1726{color:var(--color-text-soft);position:absolute;top:50%;left:13px;transform:translateY(-50%)}._ppSearchInput_ltjgo_1734{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);outline:none;padding:10px 14px 10px 36px;font-size:13px;transition:border-color .15s,box-shadow .15s}._ppSearchInput_ltjgo_1734:focus{border-color:var(--color-primary-border);box-shadow:0 0 0 3px var(--color-primary-10)}._ppList_ltjgo_1753{scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent;flex:1;padding:8px 22px 24px;overflow-y:auto}._ppListInner_ltjgo_1761{flex-direction:column;gap:12px;display:flex}._ppList_ltjgo_1753::-webkit-scrollbar{width:6px}._ppList_ltjgo_1753::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:var(--radius-full)}._ppEmpty_ltjgo_1776{text-align:center;color:var(--color-text-soft);padding:32px 0;font-size:13px}@media (width<=768px){._ppPanel_ltjgo_1569{width:100%}}._emptyState_ltjgo_1790{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px dashed var(--color-border-strong);text-align:center;flex-direction:column;justify-content:center;align-items:center;padding:64px 20px;display:flex}._emptyIconWrap_ltjgo_1802{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:64px;height:64px;color:var(--color-text-soft);justify-content:center;align-items:center;margin-bottom:16px;display:flex}._emptyTitle_ltjgo_1814{font-size:var(--font-lg);color:var(--color-text);margin:0 0 8px;font-weight:700}._emptyText_ltjgo_1821{font-size:var(--font-sm);color:var(--color-text-soft);max-width:300px;margin:0;line-height:1.5}._tabs_ltjgo_1830{flex-wrap:wrap;align-items:center;gap:6px;display:inline-flex}._tab_ltjgo_1830{border-radius:var(--radius-full);border:1px solid var(--color-border);color:var(--color-text-soft);cursor:pointer;white-space:nowrap;background:0 0;align-items:center;gap:6px;padding:8px 14px;font-size:12.5px;font-weight:600;display:inline-flex}._tabActive_ltjgo_1852{background-color:var(--color-primary-20);border-color:var(--color-primary-border);color:var(--color-primary)}._tabBadge_ltjgo_1858{color:var(--color-primary);margin-left:2px;font-size:11.5px;font-weight:700}._composerCollapsed_ltjgo_1866{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);align-items:center;gap:10px;padding:10px 14px;display:flex}._ccAvatar_ltjgo_1876,._compAvatar_ltjgo_1877,._avatar_ltjgo_1878{background-color:var(--avatar-color);color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-weight:700;display:flex}._ccAvatar_ltjgo_1876{width:32px;height:32px;font-size:12px}._ccInput_ltjgo_1895{text-align:left;border-radius:var(--radius-full);background-color:var(--color-bg);border:1px solid var(--color-border);color:var(--color-text-soft);cursor:pointer;flex:1;padding:9px 14px;font-size:13px;font-weight:500}._ccInput_ltjgo_1895:hover{background-color:var(--color-surface);border-color:var(--color-border-strong)}._composer_ltjgo_1866{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-md);overflow:hidden}._compHead_ltjgo_1921{align-items:flex-start;gap:11px;padding:14px 16px 0;display:flex}._compAvatarWrapper_ltjgo_1928{flex-shrink:0;position:relative}._statusDot_ltjgo_1933{background-color:var(--color-success,#10b981);border:1.5px solid var(--color-surface,#fff);border-radius:50%;width:10px;height:10px;position:absolute;bottom:0;right:0}._compAvatar_ltjgo_1877{width:40px;height:40px;font-size:13px}._compHeaderTagline_ltjgo_1950{color:var(--color-text);font-size:13px;line-height:1.4}._compMutedText_ltjgo_1956{color:var(--color-text-soft,#64748b);font-weight:400}._taggedTagline_ltjgo_1961{color:var(--color-text-soft,#64748b);margin-top:1px;margin-bottom:2px;font-size:.85rem}._taggedTagline_ltjgo_1961 strong{color:var(--color-text,#0f172a);font-weight:700}._audiencePill_ltjgo_1973{border-radius:var(--radius-full);background-color:var(--color-bg);border:1px solid var(--color-border);font-size:var(--font-xs);color:var(--color-text-mid);cursor:pointer;align-items:center;gap:5px;margin-top:4px;padding:3px 10px;font-weight:600;display:inline-flex}._audiencePill_ltjgo_1973:hover{border-color:var(--color-border-strong)}._audienceSection_ltjgo_1992{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:9px;margin:0 16px 12px;padding:12px 14px;display:flex}._audienceLabel_ltjgo_2003{letter-spacing:.06em;text-transform:uppercase;color:var(--color-text-soft);font-size:10px;font-weight:700}._audienceRow_ltjgo_2011{flex-wrap:wrap;gap:8px;display:flex}._audienceBtn_ltjgo_2017{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-mid);cursor:pointer;align-items:center;gap:6px;padding:8px 14px;font-size:12.5px;font-weight:600;display:inline-flex}._audienceBtn_ltjgo_2017:hover{border-color:var(--color-border-strong)}._audienceBtnActive_ltjgo_2035{border-color:var(--color-primary-border);background-color:var(--color-primary-10);color:var(--color-primary)}._compClose_ltjgo_2041{width:28px;height:28px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:7px;justify-content:center;align-items:center;margin-left:auto;display:flex}._compClose_ltjgo_2041:hover{background-color:var(--color-bg);color:var(--color-text)}._titleInput_ltjgo_2060{width:100%;color:var(--color-text);background:0 0;border:none;outline:none;padding:8px 16px 0;font-family:inherit;font-size:16px;font-weight:700;transition:box-shadow .15s ease-in-out}._titleInput_ltjgo_2060::placeholder{color:var(--color-text-very-soft);font-weight:600}._textarea_ltjgo_59{width:100%;min-height:72px;color:var(--color-text);resize:none;background:0 0;border:none;outline:none;padding:6px 16px 10px;font-family:inherit;font-size:14px;line-height:1.5;transition:box-shadow .15s ease-in-out}._compOption_ltjgo_2093{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);justify-content:space-between;align-items:center;gap:10px;margin:0 16px 12px;padding:10px 14px;display:flex}._compOptionLabel_ltjgo_2105{color:var(--color-text);align-items:center;gap:7px;font-size:12.5px;font-weight:600;display:inline-flex}._compOptionLabel_ltjgo_2105 svg{color:var(--color-primary)}._compFooter_ltjgo_2118{border-top:1px solid var(--color-divider);justify-content:space-between;align-items:center;gap:8px;padding:12px 16px;display:flex}._submitRight_ltjgo_2127{align-items:center;gap:10px;display:flex}._modeToggle_ltjgo_2133{font-size:11px}._cancelBtn_ltjgo_2137{color:var(--color-text-mid);border:1px solid var(--color-border);cursor:pointer;background:0 0;border-radius:8px;padding:8px 14px;font-size:12px;font-weight:600}._cancelBtn_ltjgo_2137:hover{background-color:var(--color-bg)}._postBtn_ltjgo_2152{background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;border-radius:8px;padding:8px 22px;font-size:12px;font-weight:700}._postBtn_ltjgo_2152:disabled{background-color:var(--color-primary-20);cursor:not-allowed}._card_ltjgo_142{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);box-shadow:var(--shadow-sm);transition:box-shadow .18s,border-color .18s;position:relative;overflow:hidden}._card_ltjgo_142:hover{box-shadow:var(--shadow-md);border-color:var(--color-border-strong)}._urgentStripe_ltjgo_2186{background-color:var(--color-primary);z-index:10;pointer-events:none;width:3px;position:absolute;top:0;bottom:0;left:0}._pinnedRow_ltjgo_2197{border-bottom:1px solid var(--color-divider);color:var(--color-text-soft);align-items:center;gap:5px;padding:5px 20px;font-size:11px;font-weight:600;display:flex}._pin_ltjgo_2197{color:var(--color-primary)}._cardHead_ltjgo_2212{gap:12px;padding:16px 20px 10px;display:flex}._avatar_ltjgo_1878{width:42px;height:42px;font-size:14px}._cardAuthor_ltjgo_2224{flex:1;min-width:0}._authorName_ltjgo_2229{color:var(--color-text);letter-spacing:-.005em;align-items:center;gap:6px;font-size:14px;font-weight:600;display:flex}._metaRow_ltjgo_2239{color:var(--color-text-soft);flex-wrap:wrap;align-items:center;gap:8px;margin-top:4px;font-size:11.5px;display:flex}._cardRight_ltjgo_2249{flex-direction:column;flex-shrink:0;align-items:flex-end;gap:6px;display:flex}._badge_ltjgo_2257{border-radius:var(--radius-full);color:var(--badge-color);background-color:color-mix(in srgb, var(--badge-color) 10%, transparent);border:1px solid color-mix(in srgb, var(--badge-color) 22%, transparent);align-items:center;gap:5px;padding:3px 9px;font-size:9.5px;font-weight:700;display:inline-flex}._badgeDot_ltjgo_2270{background-color:var(--badge-color);border-radius:50%;width:5px;height:5px}._bookmarkBtn_ltjgo_2277{width:26px;height:26px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;display:flex}._bookmarkBtn_ltjgo_2277:hover{background-color:var(--color-bg);color:var(--color-text)}._bookmarkActive_ltjgo_2295{background-color:var(--color-primary-10);color:var(--color-primary)}._pinBtn_ltjgo_2300{width:26px;height:26px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;display:flex}._pinBtn_ltjgo_2300:hover{background-color:var(--color-bg);color:var(--color-text)}._pinActive_ltjgo_2318{background-color:var(--color-primary-10);color:var(--color-primary)}._editBtn_ltjgo_2323{width:26px;height:26px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;display:flex}._editBtn_ltjgo_2323:hover{background-color:var(--color-bg);color:var(--color-text)}._cardActions_ltjgo_2341{align-items:center;gap:4px;display:flex}._cardTitle_ltjgo_2347{color:var(--color-text);letter-spacing:-.01em;margin:0;padding:0 20px 8px;font-size:17px;font-weight:700;line-height:1.3}._cardBody_ltjgo_142{color:var(--color-text-mid);white-space:pre-wrap;word-break:break-word;margin:0;padding:0 20px 12px;font-size:12.5px;line-height:1.6}._ackBanner_ltjgo_2367{background-color:var(--color-bg);border:1px solid var(--color-border);color:var(--color-text);border-radius:9px;justify-content:space-between;align-items:center;gap:10px;margin:0 20px 12px;padding:10px 12px;font-size:12px;font-weight:600;display:flex}._ackBtn_ltjgo_2382{background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;white-space:nowrap;border:none;border-radius:7px;padding:6px 12px;font-size:11px;font-weight:700}._ackDone_ltjgo_2394{background-color:var(--color-success-soft);border:1px solid color-mix(in srgb, var(--color-success) 20%, transparent);color:var(--color-success);border-radius:9px;align-items:center;gap:8px;margin:0 20px 12px;padding:8px 12px;font-size:11px;font-weight:700;display:flex}._summary_ltjgo_2408{color:var(--color-text-soft);justify-content:space-between;align-items:center;margin:0 20px;padding:2px 0 10px;font-size:11px;display:flex}._summaryLeft_ltjgo_2418{align-items:center;gap:6px;display:flex}._summaryIcons_ltjgo_2424{align-items:center;display:flex}._summaryDot_ltjgo_2429{background-color:var(--react-color,var(--color-primary));width:19px;height:19px;color:var(--color-on-primary);border:2px solid var(--color-surface);border-radius:50%;justify-content:center;align-items:center;display:flex}._summaryDot_ltjgo_2429:not(:first-child){margin-left:-5px}._summaryCount_ltjgo_2445{color:var(--color-text-mid);font-weight:600}._summaryComments_ltjgo_2450{color:var(--color-text-soft)}._summaryCommentsClickable_ltjgo_2454{cursor:pointer;-webkit-user-select:none;user-select:none}._summaryCommentsClickable_ltjgo_2454:hover{color:#045d5e}._postBar_ltjgo_2464{border-top:1px solid var(--color-divider);align-items:center;gap:6px;padding:6px 10px;display:flex}._reactWrap_ltjgo_2472{flex:1;display:flex;position:relative}._actionBtn_ltjgo_2478{color:var(--color-text-mid);cursor:pointer;background:0 0;border:none;border-radius:7px;flex:1;justify-content:center;align-items:center;gap:6px;padding:9px 10px;font-size:11.5px;font-weight:600;display:flex}._actionBtn_ltjgo_2478:hover{background-color:var(--color-surface-muted)}._actionBtn_ltjgo_2478:active{transform:scale(.97)}._actionActive_ltjgo_2502{background-color:color-mix(in srgb, var(--react-color,var(--color-primary)) 12%, transparent);color:var(--react-color,var(--color-primary))}._actionActive_ltjgo_2502:hover{background-color:color-mix(in srgb, var(--react-color,var(--color-primary)) 16%, transparent)}._picker_ltjgo_2519{background-color:var(--color-surface);border-radius:var(--radius-full);border:1px solid var(--color-border);box-shadow:var(--shadow-lg);z-index:10;opacity:0;transform-origin:0 100%;pointer-events:none;gap:4px;padding:5px;transition:opacity .16s,transform .16s;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;transform:translateY(6px)scale(.96)}._picker_ltjgo_2519:before{content:"";height:10px;position:absolute;top:100%;left:0;right:0}._pickerVisible_ltjgo_2551{opacity:1;pointer-events:auto;transform:translateY(0)scale(1)}._pickerBtn_ltjgo_2557{width:36px;height:36px;color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;transition:transform .14s,background-color .14s;display:flex}._pickerBtn_ltjgo_2557:hover{background-color:color-mix(in srgb, var(--react-color) 14%, transparent);color:var(--react-color);transform:scale(1.25)translateY(-2px)}._pickerActive_ltjgo_2579{background-color:color-mix(in srgb, var(--react-color) 16%, transparent);color:var(--react-color)}@media (width<=768px){._toolbar_ltjgo_8{padding:10px 14px}}@media (width<=640px){._wrapper_ltjgo_70{padding:14px 12px 40px}._cardHead_ltjgo_2212{padding:14px 14px 8px}._cardTitle_ltjgo_2347{padding:0 14px 8px}._cardBody_ltjgo_142{padding:0 14px 12px}._summary_ltjgo_2408{margin:0 14px}._postBar_ltjgo_2464{padding:4px 6px}._actionBtn_ltjgo_2478{padding:9px 6px}}._schedule_ltjgo_2622{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:12px;margin:0 16px 12px;padding:14px;display:flex}._scheduleHead_ltjgo_2633{letter-spacing:.08em;color:var(--color-text-soft);align-items:center;gap:6px;font-size:10px;font-weight:700;display:flex}._scheduleHead_ltjgo_2633 svg{color:var(--color-primary)}._scheduleGrid_ltjgo_2647{grid-template-columns:1fr 1fr;gap:12px;display:grid}._scheduleField_ltjgo_2653{flex-direction:column;gap:5px;display:flex}._scheduleLabel_ltjgo_2659{font-size:var(--font-xs);color:var(--color-text-mid);font-weight:600}._scheduleInput_ltjgo_2665{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:100%;color:var(--color-text);padding:9px 12px;font-family:inherit;font-size:13px}._scheduleInput_ltjgo_2665:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px var(--color-primary-10);outline:none}._scheduleRow_ltjgo_2682{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);justify-content:space-between;align-items:center;padding:10px 12px;display:flex}._scheduleRowLabel_ltjgo_2692{color:var(--color-text);align-items:center;gap:7px;font-size:12.5px;font-weight:600;display:inline-flex}._scheduleRowLabel_ltjgo_2692 svg{color:var(--color-text-soft)}._switch_ltjgo_2705{border-radius:var(--radius-full);background-color:var(--color-border-strong);cursor:pointer;border:none;flex-shrink:0;width:38px;height:22px;transition:background-color .18s;position:relative}._switchOn_ltjgo_2717{background-color:var(--color-primary)}._switchKnob_ltjgo_2721{background-color:#fff;border-radius:50%;width:16px;height:16px;transition:transform .18s;position:absolute;top:3px;left:3px}._switchOn_ltjgo_2717 ._switchKnob_ltjgo_2721{transform:translate(16px)}._scheduleFreq_ltjgo_2736{align-self:flex-start}._scheduleTz_ltjgo_2740{font-size:var(--font-xs);color:var(--color-text-soft);align-items:center;gap:6px;display:flex}._scheduleTz_ltjgo_2740 strong{color:var(--color-text-mid);font-weight:700}._tagSearch_ltjgo_2754{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);align-items:center;gap:8px;margin-bottom:12px;padding:8px 12px;display:flex}._tagSearchInput_ltjgo_2765{font-size:var(--font-sm);color:var(--color-text);background:0 0;border:none;outline:none;flex:1}._tagList_ltjgo_2774{flex-direction:column;gap:6px;max-height:240px;display:flex;overflow-y:auto}._tagRow_ltjgo_2782{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);cursor:pointer;text-align:left;justify-content:space-between;align-items:center;width:100%;padding:8px 12px;display:flex}._tagRow_ltjgo_2782:hover{background-color:var(--color-surface-muted)}._tagRowActive_ltjgo_2799{background-color:color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));border-color:var(--color-primary-22)}._tagRowContent_ltjgo_2804{align-items:center;gap:12px;display:flex}._tagAvatar_ltjgo_2810{background-color:var(--avatar-color,#ccc);color:#fff;width:32px;height:32px;font-size:var(--font-xs);border-radius:50%;justify-content:center;align-items:center;font-weight:700;display:flex}._tagInfo_ltjgo_2823{flex-direction:column;display:flex}._tagName_ltjgo_2828{font-size:var(--font-sm);color:var(--color-text);font-weight:600}._tagRole_ltjgo_2834{font-size:var(--font-xs);color:var(--color-text-soft)}._tagCheckbox_ltjgo_2839{border:2px solid var(--color-border);color:#0000;border-radius:4px;justify-content:center;align-items:center;width:18px;height:18px;display:flex}._tagCheckboxActive_ltjgo_2850{border-color:var(--color-primary);background-color:var(--color-primary);color:#fff}._postImagesGrid_ltjgo_2857{border-radius:var(--radius-lg);aspect-ratio:16/10;gap:6px;width:100%;max-height:500px;margin-top:12px;margin-bottom:14px;display:grid;overflow:hidden}@media (width<=600px){._postImagesGrid_ltjgo_2857{aspect-ratio:4/3;max-height:320px}}._grid1_ltjgo_2876{grid-template-columns:1fr}._grid2_ltjgo_2880{grid-template-columns:1fr 1fr}._grid3_ltjgo_2884{grid-template-rows:1fr 1fr;grid-template-columns:1.5fr 1fr}._grid4_ltjgo_2889{grid-template-rows:1fr 1fr;grid-template-columns:1fr 1fr}._gridImageWrap_ltjgo_2894{cursor:pointer;background-color:var(--color-surface-hover);width:100%;height:100%;position:relative;overflow:hidden}._gridImage_ltjgo_2894{object-fit:cover;width:100%;height:100%;transition:transform .3s}._gridImageWrap_ltjgo_2894:hover ._gridImage_ltjgo_2894{transform:scale(1.02)}._grid3_ltjgo_2884 ._gridImageWrap_ltjgo_2894:first-child{grid-row:span 2}._moreImagesOverlay_ltjgo_2920:before{content:attr(data-more);color:#fff;z-index:2;background:#0009;justify-content:center;align-items:center;font-size:24px;font-weight:700;transition:background .3s;display:flex;position:absolute;inset:0}._moreImagesOverlay_ltjgo_2920:hover:before{background:#00000080}._lightboxOverlay_ltjgo_2943{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:10000;-webkit-user-select:none;user-select:none;background-color:#0a0f1ebf;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}._lightboxContainer_ltjgo_2960{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);width:92vw;max-width:1200px;height:85vh;display:flex;position:relative;overflow:hidden;box-shadow:0 25px 50px -12px #00000080}._lightboxLeft_ltjgo_2973{background-color:#0c0d12;flex:1.5;justify-content:center;align-items:center;height:100%;display:flex;position:relative}._lightboxRight_ltjgo_2983{background-color:var(--color-surface);border-left:1px solid var(--color-divider);flex-direction:column;flex:1;height:100%;display:flex;overflow-y:auto}._lightboxScrollableContent_ltjgo_2993{flex-direction:column;gap:16px;padding:24px;display:flex}._lightboxScrollableContent_ltjgo_2993 header{padding-right:48px}._lightboxDivider_ltjgo_3004{background-color:var(--color-divider);height:1px;margin:8px 0}@media (width<=900px){._lightboxContainer_ltjgo_2960{flex-direction:column;width:95vw;height:95vh}._lightboxLeft_ltjgo_2973{flex:1;min-height:250px}._lightboxRight_ltjgo_2983{border-left:none;border-top:1px solid var(--color-divider);flex:1.5}._lightboxClose_ltjgo_3028{color:#ffffffe6;background:#0006;top:12px;right:12px}._lightboxClose_ltjgo_3028:hover{color:#fff;background:#0009}}._lightboxImage_ltjgo_3041{object-fit:contain;border-radius:var(--radius-lg);border:1px solid #ffffff26;max-width:85%;max-height:80%;box-shadow:0 25px 50px -12px #000000b3,0 0 0 1px #ffffff14}._lightboxClose_ltjgo_3028{background:var(--color-bg-hover,#0000000d);color:var(--color-text-soft,#65676b);cursor:pointer;z-index:10002;border:none;border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;transition:all .2s;display:flex;position:absolute;top:16px;right:16px}._lightboxClose_ltjgo_3028:hover{background:var(--color-bg-hover-strong,#0000001a);color:var(--color-text,#1c1e21);transform:scale(1.05)}._lightboxArrow_ltjgo_3077{color:#fff;cursor:pointer;z-index:10001;background:#ffffff14;border:1px solid #ffffff0d;border-radius:50%;justify-content:center;align-items:center;width:52px;height:52px;transition:all .2s cubic-bezier(.4,0,.2,1);display:flex;position:absolute;top:50%;transform:translateY(-50%)}._lightboxArrow_ltjgo_3077:hover{background:#ffffff2e}._lightboxArrowLeft_ltjgo_3099{left:24px}._lightboxArrowLeft_ltjgo_3099:hover{transform:translateY(-50%)scale(1.08)}._lightboxArrowRight_ltjgo_3107{right:24px}._lightboxArrowRight_ltjgo_3107:hover{transform:translateY(-50%)scale(1.08)}._lightboxCounter_ltjgo_3115{color:#fffffff2;z-index:10001;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);letter-spacing:.05em;background-color:#ffffff14;border:1px solid #ffffff1f;border-radius:9999px;padding:6px 14px;font-size:13px;font-weight:600;position:absolute;bottom:24px;box-shadow:0 4px 12px #0003}._templateSheet_ltjgo_3133{flex-direction:column;gap:0;display:flex}._templateSheetHeader_ltjgo_3139{border-bottom:1px solid var(--color-border);align-items:flex-start;gap:10px;padding:12px 14px 10px;display:flex}._templateBackBtn_ltjgo_3147{border:1px solid var(--color-border);border-radius:var(--radius-sm);width:28px;height:28px;color:var(--color-text-soft);cursor:pointer;background:0 0;flex-shrink:0;justify-content:center;align-items:center;margin-top:2px;transition:background-color .15s,color .15s;display:flex}._templateBackBtn_ltjgo_3147:hover{background-color:var(--color-surface-muted);color:var(--color-text)}._templateSheetTitle_ltjgo_3170{font-size:var(--font-xs);color:var(--color-text-mid);letter-spacing:.06em;text-transform:uppercase;font-weight:700;display:block}._templateSheetMeta_ltjgo_3179{font-size:var(--font-xs);color:var(--color-text-soft);margin-top:2px;display:block}._templateSheetMeta_ltjgo_3179 strong{color:var(--color-primary);font-weight:600}._templateSearch_ltjgo_3191{border-bottom:1px solid var(--color-border);padding:8px 14px;position:relative}._templateSearchIcon_ltjgo_3197{color:var(--color-text-soft);pointer-events:none;position:absolute;top:50%;left:26px;transform:translateY(-50%)}._templateSearchInput_ltjgo_3206{border:1px solid var(--color-border);border-radius:var(--radius-sm);background-color:var(--color-surface-muted);width:100%;color:var(--color-text);font-size:var(--font-sm);box-sizing:border-box;outline:none;padding:6px 10px 6px 30px;transition:border-color .15s}._templateSearchInput_ltjgo_3206:focus{border-color:var(--color-primary)}._templateList_ltjgo_3223{flex-direction:column;max-height:240px;display:flex;overflow-y:auto}._templateItem_ltjgo_3230{border-bottom:1px solid var(--color-border);cursor:pointer;text-align:left;background:0 0;border-top:none;border-left:none;border-right:none;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;transition:background-color .12s;display:flex}._templateItem_ltjgo_3230:last-child{border-bottom:none}._templateItem_ltjgo_3230:hover{background-color:var(--color-surface-muted)}._templateItemBody_ltjgo_3254{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._templateItemTitle_ltjgo_3262{font-size:var(--font-sm);color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-weight:600;overflow:hidden}._templateItemSub_ltjgo_3271{font-size:var(--font-xs);color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}._templateUseBtn_ltjgo_3279{border-radius:var(--radius-sm);background-color:var(--color-primary);color:#fff;letter-spacing:.06em;cursor:pointer;border:none;flex-shrink:0;align-items:center;gap:4px;padding:4px 10px;font-size:10px;font-weight:700;transition:opacity .15s;display:flex}._templateUseBtn_ltjgo_3279:hover{opacity:.85}._templateEmpty_ltjgo_3300{text-align:center;font-size:var(--font-sm);color:var(--color-text-soft);padding:20px 14px}._itemIconContainer_ltjgo_3307{border-radius:var(--radius-md);background-color:color-mix(in srgb, var(--color-primary) 10%, transparent);width:32px;height:32px;color:var(--color-primary);flex-shrink:0;justify-content:center;align-items:center;display:flex}._itemBadge_ltjgo_3319{border-radius:var(--radius-sm);background-color:var(--color-surface-muted);color:var(--color-text-soft);max-width:fit-content;padding:2px 6px;font-size:10px;font-weight:500}._itemMetaRow_ltjgo_3329{flex-wrap:wrap;gap:6px;margin-top:4px;display:flex}._lightboxOverlay_18fqf_5{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:10000;-webkit-user-select:none;user-select:none;background-color:#0a0f1ebf;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}._lightboxContainer_18fqf_20{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);width:92vw;max-width:1200px;height:85vh;display:flex;position:relative;overflow:hidden;box-shadow:0 25px 50px -12px #00000080}._lightboxLeft_18fqf_33{background-color:#0c0d12;flex:1.5;justify-content:center;align-items:center;height:100%;display:flex;position:relative}._lightboxRight_18fqf_43{background-color:var(--color-surface);border-left:1px solid var(--color-divider);flex-direction:column;flex:1;height:100%;display:flex;overflow-y:auto}._lightboxScrollableContent_18fqf_53{flex-direction:column;gap:16px;padding:24px;display:flex}._lightboxScrollableContent_18fqf_53 header{padding-right:48px}._lightboxDivider_18fqf_64{background-color:var(--color-divider);height:1px;margin:8px 0}@media (width<=900px){._lightboxContainer_18fqf_20{flex-direction:column;width:95vw;height:95vh}._lightboxLeft_18fqf_33{flex:1;min-height:250px}._lightboxRight_18fqf_43{border-left:none;border-top:1px solid var(--color-divider);flex:1.5}._lightboxClose_18fqf_88{color:#ffffffe6;background:#0006;top:12px;right:12px}._lightboxClose_18fqf_88:hover{color:#fff;background:#0009}}._lightboxImage_18fqf_101{object-fit:contain;border-radius:var(--radius-lg);border:1px solid #ffffff26;max-width:85%;max-height:80%;box-shadow:0 25px 50px -12px #000000b3,0 0 0 1px #ffffff14}._lightboxClose_18fqf_88{background:var(--color-bg-hover,#0000000d);color:var(--color-text-soft,#65676b);cursor:pointer;z-index:10002;border:none;border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;transition:all .2s;display:flex;position:absolute;top:16px;right:16px}._lightboxClose_18fqf_88:hover{background:var(--color-bg-hover-strong,#0000001a);color:var(--color-text,#1c1e21);transform:scale(1.05)}._lightboxArrow_18fqf_136{color:#fff;cursor:pointer;z-index:10001;background:#ffffff14;border:1px solid #ffffff0d;border-radius:50%;justify-content:center;align-items:center;width:52px;height:52px;transition:all .2s cubic-bezier(.4,0,.2,1);display:flex;position:absolute;top:50%;transform:translateY(-50%)}._lightboxArrow_18fqf_136:hover{background:#ffffff2e}._lightboxArrowLeft_18fqf_158{left:24px}._lightboxArrowLeft_18fqf_158:hover{transform:translateY(-50%)scale(1.08)}._lightboxArrowRight_18fqf_166{right:24px}._lightboxArrowRight_18fqf_166:hover{transform:translateY(-50%)scale(1.08)}._lightboxCounter_18fqf_174{color:#fffffff2;z-index:10001;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);letter-spacing:.05em;background-color:#ffffff14;border:1px solid #ffffff1f;border-radius:9999px;padding:6px 14px;font-size:13px;font-weight:600;position:absolute;bottom:24px;box-shadow:0 4px 12px #0003}._skeletonCard_7d381_1{background-color:var(--color-surface);border-radius:var(--radius-lg);border:1px solid var(--color-border);flex-direction:column;gap:16px;padding:16px;display:flex}._skeletonHeader_7d381_11{align-items:center;gap:12px;display:flex}._skeletonAvatar_7d381_17{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:40px;height:40px;animation:1.5s ease-in-out infinite _pulse_7d381_1}._skeletonMeta_7d381_25{flex-direction:column;flex:1;gap:6px;display:flex}._skeletonLine_7d381_32{background-color:var(--color-surface-muted);border-radius:var(--radius-sm);height:12px;animation:1.5s ease-in-out infinite _pulse_7d381_1}._skeletonLine_7d381_32._short_7d381_39{width:40%}._skeletonLine_7d381_32._medium_7d381_43{width:70%}._skeletonLine_7d381_32._full_7d381_47{width:100%}._skeletonBody_7d381_51{flex-direction:column;gap:8px;display:flex}@keyframes _pulse_7d381_1{0%,to{opacity:1}50%{opacity:.5}}._bookCard_g1hkd_7{border:1px solid var(--color-border);border-radius:var(--radius-xl);background-color:var(--color-surface);box-shadow:var(--shadow-md);margin:20px 24px 24px;overflow:hidden}._bookTopBar_g1hkd_16{border-bottom:1px solid var(--color-divider);background:linear-gradient(180deg, var(--color-primary-05), transparent);justify-content:space-between;align-items:center;gap:12px;padding:13px 18px;display:flex}._bookGrid_g1hkd_26{grid-template-columns:256px 1fr 236px;display:grid}._colCalendar_g1hkd_31{border-left:1px solid var(--color-divider);border-right:1px solid var(--color-divider);padding:18px 22px}._search_g1hkd_37{margin-bottom:12px;position:relative}._searchIcon_g1hkd_42{color:var(--color-text-soft);position:absolute;top:50%;left:11px;transform:translateY(-50%)}._searchInput_g1hkd_50{border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);border-radius:8px;outline:none;padding:8px 10px 8px 32px;font-size:12px}._contactList_g1hkd_61{flex-direction:column;flex:1;gap:4px;min-height:0;max-height:440px;display:flex;overflow:hidden auto}._contactRow_g1hkd_72{border-radius:var(--radius-md);cursor:pointer;text-align:left;background:0 0;border:1.5px solid #0000;align-items:center;gap:12px;padding:9px 12px;transition:background-color .15s,border-color .15s;display:flex}._contactRow_g1hkd_72:hover{background-color:var(--color-surface-muted)}._contactActive_g1hkd_91{background-color:var(--color-primary-10);border-color:var(--color-primary-border)}._contactAvatar_g1hkd_96{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);letter-spacing:.02em;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:12.5px;font-weight:700;display:flex}._contactText_g1hkd_112{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._contactName_g1hkd_120{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;line-height:1.25;overflow:hidden}._contactActive_g1hkd_91 ._contactName_g1hkd_120{color:var(--color-primary);font-weight:700}._contactRole_g1hkd_135{color:var(--color-text-soft);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:1.2;overflow:hidden}._contactCheck_g1hkd_144{border:2px solid var(--color-border-strong);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:20px;height:20px;transition:border-color .15s,background-color .15s;display:flex}._contactCheckOn_g1hkd_158{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-on-primary)}._contactCheckIcon_g1hkd_164{justify-content:center;align-items:center;display:inline-flex}._contactEmpty_g1hkd_170{color:var(--color-text-soft);margin:8px 4px;font-size:12px}._calHead_g1hkd_177{justify-content:space-between;align-items:center;margin-bottom:12px;display:flex}._calMonth_g1hkd_184{color:var(--color-text);font-size:14px;font-weight:600}._calNav_g1hkd_190{gap:4px;display:flex}._calNavBtn_g1hkd_195{border:1px solid var(--color-border);background-color:var(--color-surface);width:26px;height:26px;color:var(--color-text-mid);cursor:pointer;border-radius:6px;justify-content:center;align-items:center;display:flex}._calDays_g1hkd_208{grid-template-columns:repeat(7,1fr);margin-bottom:4px;display:grid}._calDayLabel_g1hkd_214{text-align:center;color:var(--color-text-soft);padding:6px 0;font-size:11px;font-weight:600}._calGrid_g1hkd_222{grid-template-columns:repeat(7,1fr);gap:2px;display:grid}._calCell_g1hkd_228{width:36px;height:36px;color:var(--color-text);cursor:pointer;background:0 0;border:1.5px solid #0000;border-radius:50%;justify-content:center;align-items:center;margin:auto;font-size:12px;font-weight:500;display:flex}._calCell_g1hkd_228:hover{background-color:var(--color-surface-muted)}._calCellToday_g1hkd_248{border-color:var(--color-secondary);color:var(--color-secondary);font-weight:700}._calCellSelected_g1hkd_254,._calCellSelected_g1hkd_254:hover{background-color:var(--color-secondary);color:var(--color-on-primary);border-color:#0000;font-weight:700}._calCellPast_g1hkd_262{color:var(--color-text-very-soft);cursor:not-allowed}._calCellBlank_g1hkd_267{visibility:hidden}._bookBar_g1hkd_272{border-top:1px solid var(--color-divider);background:linear-gradient(0deg, var(--color-primary-05), transparent);justify-content:space-between;align-items:center;gap:12px;padding:14px 18px;display:flex}._bookHint_g1hkd_282{color:var(--color-text-soft);font-size:12.5px}._bookSummary_g1hkd_287{color:var(--color-text-mid);align-items:center;gap:6px;font-size:12.5px;display:flex}._bookSummaryName_g1hkd_295{color:var(--color-text);font-weight:600}._bookSummarySlot_g1hkd_300{color:var(--color-primary);font-weight:600}._bookBtn_g1hkd_305{border-radius:var(--radius-md);background:linear-gradient(135deg, var(--color-primary), var(--color-primary-light));color:var(--color-on-primary);cursor:pointer;border:none;align-items:center;gap:7px;padding:10px 24px;font-size:12.5px;font-weight:700;display:flex;box-shadow:0 4px 14px #045d5e38}._bookBtn_g1hkd_305:disabled{background:var(--color-primary-20);box-shadow:none;cursor:not-allowed}._confirmBody_g1hkd_327{flex-direction:column;gap:16px;display:flex}._confirmWho_g1hkd_333{border-radius:var(--radius-lg);background:linear-gradient(135deg, var(--color-primary-10), var(--color-primary-05));border:1px solid var(--color-primary-border);align-items:center;gap:12px;padding:14px;display:flex}._confirmAvatar_g1hkd_343{background-color:var(--avatar-color);width:44px;height:44px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:15px;font-weight:700;display:flex}._confirmWhoText_g1hkd_357{flex-direction:column;gap:2px;min-width:0;display:flex}._confirmName_g1hkd_364{color:var(--color-text);font-size:15px;font-weight:700}._confirmRole_g1hkd_370{color:var(--color-text-soft);font-size:12px}._confirmRows_g1hkd_375{flex-direction:column;display:flex}._confirmRow_g1hkd_375{border-bottom:1px solid var(--color-divider);align-items:center;gap:10px;padding:10px 2px;display:flex}._confirmRow_g1hkd_375:last-child{border-bottom:none}._confirmRowIcon_g1hkd_392{border-radius:var(--radius-md);background-color:var(--color-surface-muted);width:30px;height:30px;color:var(--color-primary);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}._confirmRowLabel_g1hkd_404{width:76px;color:var(--color-text-soft);flex-shrink:0;font-size:12.5px;font-weight:600}._confirmRowValue_g1hkd_412{min-width:0;color:var(--color-text);flex:1;font-size:12.5px;font-weight:600}._bookedNote_g1hkd_420{color:var(--color-success);align-items:center;gap:6px;font-size:12.5px;font-weight:700;display:inline-flex}._typeSelector_g1hkd_430{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:8px;padding:3px;display:inline-flex}._typeBtn_g1hkd_438{color:var(--color-text-soft);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:6px;padding:5px 12px;font-size:11.5px;font-weight:500}._typeBtn_g1hkd_438:hover{color:var(--color-text)}._typeBtnActive_g1hkd_456{background-color:var(--color-surface);color:var(--color-primary);box-shadow:var(--shadow-sm);font-weight:600}@media (width>=1440px){._contactList_g1hkd_61{max-height:460px}}@media (width<=1024px){._bookGrid_g1hkd_26{grid-template-columns:1fr}._colCalendar_g1hkd_31{border-left:none;border-right:none;border-top:1px solid var(--color-divider);border-bottom:1px solid var(--color-divider)}}@media (width<=768px){._bookCard_g1hkd_7{margin:12px 10px}._bookGrid_g1hkd_26{grid-template-columns:1fr}._colCalendar_g1hkd_31{border-left:none;border-right:none;border-top:1px solid var(--color-divider);border-bottom:1px solid var(--color-divider)}._bookBar_g1hkd_272{text-align:center;flex-direction:column;align-items:stretch;gap:10px}._bookBtn_g1hkd_305{justify-content:center}}._col_18ut1_6{flex-direction:column;min-width:0;padding:18px;display:flex}._colTitle_18ut1_13{color:var(--color-text);align-items:center;margin-bottom:12px;font-size:13.5px;font-weight:700;display:flex}._stepDot_18ut1_22{background-color:var(--color-primary-10);width:18px;height:18px;color:var(--color-primary);border-radius:50%;justify-content:center;align-items:center;margin-right:8px;font-size:10px;font-weight:800;display:inline-flex}._titleWrap_18nb9_3{margin-bottom:10px}._titleInput_18nb9_7{width:100%;padding-left:10px}._wizardContainer_pyr7v_8{background-color:var(--color-surface);border-radius:0 0 12px 12px;flex-direction:column;flex:1;display:flex;overflow:hidden}._stepper_pyr7v_17{background-color:var(--color-surface-muted);border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:center;gap:12px;padding:16px 24px;display:flex}._stepItem_pyr7v_27{flex-shrink:0;align-items:center;gap:8px;display:flex}._stepLine_pyr7v_34{background-color:var(--color-border);flex:1;height:2px}._stepLineActive_pyr7v_40{background-color:var(--color-primary)}._stepCircle_pyr7v_44{background-color:var(--color-surface);border:2px solid var(--color-border);width:24px;height:24px;color:var(--color-text-soft);transition:all var(--dur-fast) var(--ease-out);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:11px;font-weight:700;display:flex}._stepCircleActive_pyr7v_60{border-color:var(--color-primary);color:var(--color-primary);box-shadow:0 0 0 3px var(--color-primary-soft)}._stepCircleDone_pyr7v_66{background-color:var(--color-primary);border-color:var(--color-primary);color:#fff}._stepText_pyr7v_72{color:var(--color-text-soft);font-size:12px;font-weight:500}._stepTextActive_pyr7v_78{color:var(--color-text);font-weight:600}._wizardContent_pyr7v_83{flex-direction:column;flex:1;display:flex;overflow:hidden}._wizardRow_pyr7v_90{flex:1;display:flex;overflow:hidden}._wizardPanelLeft_pyr7v_96{border-right:1px solid var(--color-border);background-color:var(--color-surface);flex-direction:column;flex:1;padding:16px;display:flex;overflow:hidden}._wizardPanelRight_pyr7v_106{background-color:var(--color-surface-muted);flex-direction:column;width:320px;display:flex;overflow:hidden}._timePanelLeft_pyr7v_114{flex:0 0 240px}._timePanelLeft_pyr7v_114 ._wizardList_pyr7v_118{max-height:480px}@media (width>=1440px){._timePanelLeft_pyr7v_114 ._wizardList_pyr7v_118{max-height:580px}}._timePanelRight_pyr7v_128{flex:1}._panelHeading_pyr7v_132{color:var(--color-text);margin:0 0 4px;font-size:15px;font-weight:700}._wizardSearch_pyr7v_139{border:1px solid var(--color-border);background-color:var(--color-surface-muted);width:100%;color:var(--color-text);border-radius:6px;margin-top:8px;padding:8px 12px;font-size:12px}._wizardList_pyr7v_118{flex-direction:column;flex:1;gap:4px;max-height:440px;display:flex;overflow-y:auto}._wizardListBtn_pyr7v_159{cursor:pointer;width:100%;transition:all var(--dur-fast) var(--ease-out);background:0 0;border:1px solid #0000;border-radius:8px;align-items:center;gap:12px;padding:10px;display:flex}._wizardListBtn_pyr7v_159:hover{background-color:var(--color-surface-hover)}._wizardListBtnActive_pyr7v_176{background-color:var(--color-primary-soft);border-color:var(--color-primary-soft-border)}._avatar_pyr7v_181{color:#fff;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;font-size:12px;font-weight:700;display:inline-flex}._avatarSmall_pyr7v_193{color:#fff;border-radius:50%;justify-content:center;align-items:center;width:26px;height:26px;font-size:11px;font-weight:700;display:inline-flex}._contactName_pyr7v_205{color:var(--color-text);font-size:12.5px;font-weight:600}._contactRole_pyr7v_211{color:var(--color-text-soft);margin-top:1px;font-size:11px}._checkbox_pyr7v_217{border:1.5px solid var(--color-border-strong);width:16px;height:16px;transition:all var(--dur-fast) var(--ease-out);border-radius:4px;justify-content:center;align-items:center;display:flex}._checkboxActive_pyr7v_228{background-color:var(--color-primary);border-color:var(--color-primary);color:#fff}._panelHeader_pyr7v_234{border-bottom:1px solid var(--color-border);letter-spacing:.04em;color:var(--color-text-soft);justify-content:space-between;align-items:center;padding:16px;font-size:11px;font-weight:700;display:flex}._badge_pyr7v_246{background-color:var(--color-primary-soft);color:var(--color-primary);border-radius:12px;padding:2px 6px;font-size:10px}._selectedGrid_pyr7v_254{flex-direction:column;flex:1;gap:8px;max-height:485px;padding:12px;display:flex;overflow-y:auto}@media (width>=1440px){._wizardList_pyr7v_118{max-height:460px}._selectedGrid_pyr7v_254{max-height:505px}}._selectedEmpty_pyr7v_274{text-align:center;color:var(--color-text-soft);flex-direction:column;align-items:center;padding:32px 16px;font-size:11px;line-height:1.5;display:flex}._selectedEmptyIcon_pyr7v_285{color:var(--color-text-soft);opacity:.5;margin-bottom:8px}._selectedItemCard_pyr7v_291{background-color:var(--color-surface);border:1px solid var(--color-border);border-radius:6px;align-items:center;gap:8px;padding:8px;display:flex}._cardName_pyr7v_301{color:var(--color-text);text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;font-weight:600;overflow:hidden}._cardRole_pyr7v_310{color:var(--color-text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}._removeBtn_pyr7v_318{color:var(--color-text-soft);cursor:pointer;transition:all var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;padding:4px;display:flex}._removeBtn_pyr7v_318:hover{background-color:var(--color-danger-soft);color:var(--color-danger)}._attendeeStatusItem_pyr7v_337{background-color:var(--color-surface-muted);border-radius:6px;align-items:center;gap:8px;padding:8px;display:flex}._statusIndicator_pyr7v_346{background-color:var(--color-border-strong);border-radius:50%;width:8px;height:8px}._statusIndicatorAvail_pyr7v_353{background-color:var(--color-success)}._statusIndicatorBusy_pyr7v_357{background-color:var(--color-danger)}._statusIndicatorOoh_pyr7v_361{background-color:var(--color-text-soft);opacity:.5}._gridToolbar_pyr7v_366{border-bottom:1px solid var(--color-border);background-color:var(--color-surface);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;padding:12px 16px;display:flex}._datePickerInput_pyr7v_377{border:1px solid var(--color-border);color:var(--color-text);background-color:var(--color-surface-muted);border-radius:6px;padding:4px 8px;font-size:12px}._durationSelector_pyr7v_386{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:6px;padding:2px;display:inline-flex}._durBtn_pyr7v_394{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;border-radius:4px;padding:4px 8px;font-size:11px;font-weight:600}._durBtnActive_pyr7v_405{background-color:var(--color-surface);color:var(--color-primary);box-shadow:var(--shadow-sm)}._legend_pyr7v_411{align-items:center;gap:12px;font-size:11px;display:flex}._legendItem_pyr7v_418{color:var(--color-text-soft);align-items:center;gap:4px;display:flex}._dotAvail_pyr7v_425,._dotBusy_pyr7v_426,._dotOoh_pyr7v_427{border-radius:50%;width:8px;height:8px}._dotAvail_pyr7v_425{background-color:var(--color-success)}._dotBusy_pyr7v_426{background-color:var(--color-danger)}._dotOoh_pyr7v_427{background-color:var(--color-border-strong)}._suggestedStrip_pyr7v_443{border-bottom:1px solid var(--color-border);background-color:var(--color-surface-muted);padding:12px 16px}._suggestedRow_pyr7v_449{gap:8px;padding-bottom:4px;display:flex;overflow-x:auto}._suggestedCard_pyr7v_456{background-color:var(--color-surface);border:1px solid var(--color-border);text-align:left;cursor:pointer;min-width:140px;transition:all var(--dur-fast) var(--ease-out);border-radius:8px;flex-shrink:0;padding:8px 12px}._suggestedCard_pyr7v_456:hover{border-color:var(--color-primary)}._suggestedCardActive_pyr7v_472{background-color:var(--color-primary);border-color:var(--color-primary);color:#fff;box-shadow:var(--shadow-md)}._suggestedCardFree_pyr7v_479{border-color:var(--color-success-border);background-color:var(--color-success-soft)}._suggestedCardActive_pyr7v_472._suggestedCardFree_pyr7v_479{background-color:var(--color-primary);color:#fff}._gridEmpty_pyr7v_489{color:var(--color-text-soft);text-align:center;flex-direction:column;justify-content:center;align-items:center;padding:64px 32px;font-size:12px;display:flex}._wizardConfirmContainer_pyr7v_501{width:100%;max-width:580px;margin:0 auto;padding:24px;overflow-y:auto}._confirmHeading_pyr7v_509{color:var(--color-text);margin:0 0 4px;font-size:18px;font-weight:700}._confirmSub_pyr7v_516{color:var(--color-text-soft);margin:0 0 20px;font-size:12px}._confirmCard_pyr7v_522{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:12px;flex-direction:column;gap:16px;padding:16px;display:flex}._confirmRow_pyr7v_532{border-bottom:1px solid var(--color-border);flex-direction:column;gap:4px;padding-bottom:12px;display:flex}._confirmLabel_pyr7v_540{letter-spacing:.04em;color:var(--color-text-soft);text-transform:uppercase;font-size:10px;font-weight:700}._confirmVal_pyr7v_548{color:var(--color-text);font-size:13.5px;font-weight:500}._confirmAttendeeBadge_pyr7v_554{background-color:var(--color-surface);border:1px solid var(--color-border);color:var(--color-text);border-radius:6px;align-items:center;gap:6px;padding:4px 8px;font-size:11.5px;font-weight:600;display:inline-flex}._avatarTiny_pyr7v_567{color:#fff;border-radius:50%;justify-content:center;align-items:center;width:18px;height:18px;font-size:9px;font-weight:700;display:inline-flex}._wizardFooter_pyr7v_580{background-color:var(--color-surface-muted);border-top:1px solid var(--color-border);justify-content:space-between;align-items:center;padding:12px 24px;display:flex}._wizardBackBtn_pyr7v_589{border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-soft);cursor:pointer;transition:all var(--dur-fast);border-radius:8px;align-items:center;gap:6px;padding:8px 14px;font-size:12px;font-weight:600;display:inline-flex}._wizardBackBtn_pyr7v_589:hover{background-color:var(--color-surface-hover);color:var(--color-text)}._wizardNextBtn_pyr7v_609{background-color:var(--color-primary);color:#fff;cursor:pointer;transition:all var(--dur-fast);box-shadow:var(--shadow-sm);border:none;border-radius:8px;align-items:center;gap:6px;padding:8px 16px;font-size:12px;font-weight:700;display:inline-flex}._wizardNextBtn_pyr7v_609:hover:not(:disabled){background-color:var(--color-primary-strong)}._wizardNextBtn_pyr7v_609:disabled{opacity:.5;cursor:not-allowed}._selectedStatusAlert_pyr7v_634{background-color:var(--color-primary-soft);color:var(--color-primary);border-radius:16px;align-items:center;gap:6px;padding:6px 12px;font-size:11px;font-weight:600;display:flex}._successContainer_pyr7v_647{text-align:center;flex-direction:column;justify-content:center;align-items:center;width:100%;max-width:520px;margin:0 auto;padding:48px 24px;display:flex}._successHeader_pyr7v_659{flex-direction:column;align-items:center;gap:12px;margin-bottom:24px;display:flex}._successTitle_pyr7v_667{color:var(--color-text);margin:0;font-size:20px;font-weight:700}._successSub_pyr7v_674{color:var(--color-text-soft);margin:4px 0 0;font-size:13px}._successCard_pyr7v_680{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:var(--radius-lg);text-align:left;width:100%;box-shadow:var(--shadow-sm);flex-direction:column;gap:14px;margin-bottom:28px;padding:20px;display:flex}._successRow_pyr7v_694{border-bottom:1px dashed var(--color-border);align-items:flex-start;gap:10px;padding-bottom:10px;display:flex}._successRow_pyr7v_694:last-child{border-bottom:none;padding-bottom:0}._successLabel_pyr7v_707{color:var(--color-text-soft);text-transform:uppercase;flex-shrink:0;width:90px;font-size:11px;font-weight:700}._successVal_pyr7v_716{color:var(--color-text);flex-direction:column;gap:4px;font-size:13px;font-weight:600;display:flex}._successActions_pyr7v_725{justify-content:center;align-items:center;gap:12px;width:100%;display:flex}._successBtn_pyr7v_733{cursor:pointer;transition:all var(--dur-fast);border:none;border-radius:8px;padding:10px 20px;font-size:12.5px;font-weight:700}._successBtnPrimary_pyr7v_743{background-color:var(--color-primary);color:#fff}._successBtnPrimary_pyr7v_743:hover{background-color:var(--color-primary-strong)}._successBtnSecondary_pyr7v_752{border:1px solid var(--color-border);color:var(--color-text-mid);background-color:#0000}._successBtnSecondary_pyr7v_752:hover{background-color:var(--color-surface-hover);color:var(--color-text)}@media (width<=768px){._wizardRow_pyr7v_90{flex-direction:column;overflow-y:auto}._wizardPanelLeft_pyr7v_96{border-right:none;border-bottom:1px solid var(--color-border)}._wizardPanelRight_pyr7v_106{border-left:none;border-top:1px solid var(--color-border);width:100%!important}._timePanelLeft_pyr7v_114{max-height:200px;overflow-y:auto;flex:none!important;width:100%!important}._timePanelRight_pyr7v_128{flex:1!important;width:100%!important}._gridToolbar_pyr7v_366{flex-direction:column;align-items:stretch;gap:10px;padding:12px}._wizardConfirmContainer_pyr7v_501{padding:16px}._stepper_pyr7v_17{gap:8px;padding:12px 16px}._stepText_pyr7v_72{display:none}._wizardFooter_pyr7v_580{flex-direction:column;align-items:stretch;gap:8px;padding:12px}._wizardBackBtn_pyr7v_589,._wizardNextBtn_pyr7v_609{justify-content:center;width:100%}._successActions_pyr7v_725{flex-direction:column;gap:8px}._successBtn_pyr7v_733{text-align:center;width:100%}}._titleVal_195yt_3{font-size:15px;font-weight:700}._inlineIcon_195yt_8{vertical-align:text-bottom;margin-right:4px}._agendaVal_195yt_13{font-style:italic}._lastRow_195yt_17{border-bottom:none}._guestList_195yt_21{flex-wrap:wrap;gap:6px;display:flex}._wizardDetailsForm_79bfd_3{width:100%;max-width:580px;margin:0 auto;padding:24px;overflow-y:auto}._detailsHeading_79bfd_11{color:var(--color-text);margin:0 0 4px;font-size:18px;font-weight:700}._detailsSub_79bfd_18{color:var(--color-text-soft);margin:0 0 24px;font-size:12px}._formGroup_79bfd_24{margin-bottom:16px}._formLabel_79bfd_28{letter-spacing:.04em;color:var(--color-text-soft);margin-bottom:6px;font-size:10px;font-weight:700;display:block}._formInput_79bfd_37{border:1px solid var(--color-border);background-color:var(--color-surface-muted);width:100%;color:var(--color-text);transition:border-color var(--dur-fast);border-radius:8px;padding:10px 12px;font-size:13px;font-weight:500}._formInput_79bfd_37:focus{border-color:var(--color-primary);outline:none}._formTextarea_79bfd_54{border:1px solid var(--color-border);background-color:var(--color-surface-muted);width:100%;color:var(--color-text);resize:vertical;transition:border-color var(--dur-fast);border-radius:8px;padding:10px 12px;font-family:inherit;font-size:12.5px}._formTextarea_79bfd_54:focus{border-color:var(--color-primary);outline:none}@media (width<=768px){._wizardDetailsForm_79bfd_3{padding:16px}}._searchWrap_3i51q_3{padding:0 8px 12px}._contactMeta_3i51q_7{text-align:left;flex:1;min-width:0}._selectedMeta_3i51q_13{flex:1;min-width:0}._timelineContainer_11xrs_3{-webkit-user-select:none;user-select:none;flex-direction:column;flex:1;max-height:380px;display:flex;overflow:auto}@media (width>=1440px){._timelineContainer_11xrs_3{max-height:500px}}._timelineHeaderRow_11xrs_18{background-color:var(--color-surface);border-bottom:1px solid var(--color-border-strong);z-index:5;display:flex;position:sticky;top:0}._timelineTimeCell_11xrs_27{width:64px;color:var(--color-text-soft);border-right:1px solid var(--color-border);background-color:var(--color-surface);flex-shrink:0;padding:8px;font-size:10px;font-weight:700}._timelineHeaderCell_11xrs_38{color:var(--color-text);border-right:1px solid var(--color-border);text-align:center;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:70px;padding:8px;font-size:11px;font-weight:600;overflow:hidden}._timelineBody_11xrs_52{flex-direction:column;display:flex}._timelineRow_11xrs_57{border-bottom:1px dashed var(--color-border);height:28px;display:flex}._timelineRow_11xrs_57:nth-child(2n){border-bottom:1px solid var(--color-border-strong)}._timelineRow_11xrs_57 ._timelineTimeCell_11xrs_27{cursor:pointer;transition:background-color var(--dur-fast);justify-content:center;align-items:center;display:flex}._timelineTimeCellActive_11xrs_75{background-color:var(--color-primary-soft);color:var(--color-primary);font-weight:700}._timelineCell_11xrs_81{border-right:1px solid var(--color-border);cursor:pointer;transition:all var(--dur-fast);flex:1;min-width:70px;position:relative}._cellAvail_11xrs_90{background-color:var(--color-success-soft)}._cellBusy_11xrs_94{background-color:var(--color-danger-soft)}._cellOoh_11xrs_98{background-color:var(--color-surface-muted);background-image:repeating-linear-gradient(45deg,#0000,#0000 4px,#00000008 4px 8px)}._cellSelected_11xrs_109{box-shadow:inset 0 0 0 2px var(--color-primary);z-index:2}._gridTooltip_11xrs_114{background-color:var(--color-text);color:var(--color-surface);z-index:10;white-space:nowrap;box-shadow:var(--shadow-md);pointer-events:none;border-radius:4px;margin-bottom:6px;padding:4px 8px;font-size:10px;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}._header_1afpk_3{padding:0 8px 12px}._slotNote_1afpk_7{color:var(--color-text-soft);font-size:11px}._cardMeta_1afpk_12{flex:1;min-width:0}._toolbarGroup_1hpun_3{align-items:center;gap:8px;display:flex}._toolbarLabel_1hpun_9{color:var(--color-text-soft);font-size:10px;font-weight:600}._suggestedHeader_1hpun_15{align-items:center;gap:6px;margin-bottom:8px;display:flex}._suggestedTitle_1hpun_22{letter-spacing:.04em;color:var(--color-text-mid);font-size:10px;font-weight:700}._freeBadge_1hpun_29{font-size:9px;font-weight:700}._slotTime_1hpun_34{margin-top:2px;font-size:12px;font-weight:700}._noSlots_1hpun_40{color:var(--color-text-mid);padding:4px 0;font-size:11px}._emptyIcon_1hpun_46{color:var(--color-text-soft);margin-bottom:8px}._wizardContentClip_14i7n_3{position:relative;overflow:hidden}._wizardStep_14i7n_8{flex:1;height:100%;min-height:0;display:flex}._slotsDate_1rdif_3{color:var(--color-text-mid);margin-bottom:12px;font-size:11.5px;font-weight:600}._slotsEmpty_1rdif_10{text-align:center;min-height:180px;color:var(--color-text-soft);flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;margin-top:8px;font-size:12px;display:flex}._slotsEmptyIcon_1rdif_24{border-radius:var(--radius-full);background-color:var(--color-primary-05);width:56px;height:56px;color:var(--color-primary);justify-content:center;align-items:center;margin-bottom:4px;display:inline-flex}._slotsEmptyTitle_1rdif_36{color:var(--color-text);font-size:14px;font-weight:700}._slotList_1rdif_42{flex-direction:column;flex:1;gap:6px;min-height:0;max-height:440px;padding-right:2px;display:flex;overflow-y:auto}@media (width>=1440px){._slotList_1rdif_42{max-height:460px}}._slot_1rdif_3{border-radius:var(--radius-md);border:1.5px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;gap:8px;padding:11px 14px;font-size:12.5px;font-weight:600;display:flex}._slot_1rdif_3:hover{border-color:var(--color-primary-border);box-shadow:var(--shadow-sm)}._slotActive_1rdif_86{border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-on-primary);box-shadow:0 4px 14px var(--color-primary-30)}._slot_1rdif_3{flex-direction:column;align-items:stretch;gap:4px;display:flex}._slotWithConflicts_1rdif_102{border-style:dashed;border-color:var(--color-warning,#d97706);background-color:var(--color-warning-soft,#d9770614)}._slotWithConflicts_1rdif_102:hover{border-color:var(--color-warning,#d97706);box-shadow:var(--shadow-sm)}._slotMain_1rdif_113{justify-content:space-between;align-items:center;width:100%;display:flex}._slotConflictList_1rdif_120{border-top:1px dashed var(--color-border);color:var(--color-danger);align-items:center;gap:4px;margin-top:4px;padding-top:4px;font-size:10px;display:flex}._conflictLabel_1rdif_131{margin-right:2px;font-weight:500}._conflictAvatar_1rdif_136{background-color:var(--color-danger-soft);width:16px;height:16px;color:var(--color-danger);border:1px solid var(--color-danger);border-radius:50%;justify-content:center;align-items:center;font-size:8px;font-weight:700;display:inline-flex}._slotActive_1rdif_86 ._slotConflictList_1rdif_120{color:#ffffffe6;border-top-color:#ffffff40}._slotActive_1rdif_86 ._conflictAvatar_1rdif_136{background-color:var(--color-surface);color:var(--color-danger);border-color:var(--color-surface)}._noSlots_1rdif_162{text-align:center;color:var(--color-text-soft);padding:20px 0;font-size:13px}._tzWrap_n6w9w_3{flex-shrink:0;position:relative}._tzBtn_n6w9w_8{border-radius:var(--radius-md);border:1px solid var(--color-border-strong);background-color:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:7px;padding:7px 12px;font-size:12px;font-weight:600;display:inline-flex}._tzBtn_n6w9w_8:hover{border-color:var(--color-primary);box-shadow:var(--shadow-sm)}._tzBtnOffset_n6w9w_30{color:var(--color-primary);font-size:11px;font-weight:700}._tzChevron_n6w9w_36{color:var(--color-text-soft)}._tzBackdrop_n6w9w_40{z-index:30;cursor:default;background:0 0;border:none;position:fixed;inset:0}._tzPop_n6w9w_49{z-index:40;border-radius:var(--radius-lg);background-color:var(--color-surface);border:1px solid var(--color-border);width:248px;box-shadow:var(--shadow-lg);padding:8px;position:absolute;top:calc(100% + 6px);right:0}._tzSearch_n6w9w_62{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:34px;color:var(--color-text-soft);align-items:center;gap:8px;margin-bottom:6px;padding:0 10px;display:flex}._tzSearchInput_n6w9w_74{min-width:0;color:var(--color-text);background:0 0;border:none;outline:none;flex:1;font-size:12.5px}._tzList_n6w9w_84{scrollbar-width:none;flex-direction:column;gap:1px;max-height:260px;display:flex;overflow-y:auto}._tzList_n6w9w_84:hover{scrollbar-width:thin}._tzList_n6w9w_84::-webkit-scrollbar{background:0 0;width:5px}._tzList_n6w9w_84::-webkit-scrollbar-track{background:0 0}._tzList_n6w9w_84::-webkit-scrollbar-thumb{border-radius:var(--radius-full,4px);background:0 0}._tzList_n6w9w_84:hover::-webkit-scrollbar-thumb{background:var(--color-border,#cbd5e1)}._tzList_n6w9w_84:hover::-webkit-scrollbar-thumb:hover{background:var(--color-border-strong,#94a3b8)}._tzRow_n6w9w_119{border-radius:var(--radius-sm);color:var(--color-text);cursor:pointer;text-align:left;transition:background-color var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:8px;padding:8px 10px;font-size:12.5px;display:flex}._tzRow_n6w9w_119:hover{background-color:var(--color-surface-muted)}._tzRowActive_n6w9w_138{background-color:var(--color-primary-10)}._tzCity_n6w9w_142{flex:1;font-weight:600}._tzRowActive_n6w9w_138 ._tzCity_n6w9w_142{color:var(--color-primary)}._tzRowOffset_n6w9w_151{color:var(--color-text-soft);font-size:11px;font-weight:600}._tzCheck_n6w9w_157{color:var(--color-primary)}._tzEmpty_n6w9w_161{color:var(--color-text-soft);margin:8px 4px;font-size:12px}._badgeWrap_swq6w_3{width:64px;height:64px;margin:0 auto 12px;position:relative}._badgeCircle_swq6w_10{background-color:var(--color-success-soft);border:2px solid var(--color-success);border-radius:50%;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._guestRow_swq6w_21{flex-flow:wrap;gap:6px;display:flex}._eventVal_swq6w_28{font-size:14px;font-weight:700}._iconRow_swq6w_33{align-items:center;gap:6px;display:flex}._iconRowMuted_swq6w_39{color:var(--color-text-mid);align-items:center;gap:6px;margin-top:2px;display:flex}._iconRowTop_swq6w_47{align-items:flex-start;gap:6px;display:flex}._agendaVal_swq6w_53{font-style:italic;font-weight:500}._iconTop_swq6w_58{margin-top:2px}._schedWrap_1p5xn_4{flex-direction:column;gap:14px;padding:18px 28px 40px;display:flex}._bucketTabs_1p5xn_11{flex-wrap:wrap;gap:6px;display:flex}._bucketTab_1p5xn_11{border-radius:var(--radius-full);color:var(--color-text-soft);border:1px solid var(--color-border);cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;align-items:center;gap:7px;padding:7px 15px;font-size:12.5px;font-weight:500;display:flex;position:relative;overflow:hidden}._bucketTab_1p5xn_11:hover{color:var(--color-text)}._bucketTabActive_1p5xn_38,._bucketTabActive_1p5xn_38:hover{color:var(--color-primary);border-color:var(--color-primary-border);font-weight:600}._bucketBg_1p5xn_45{z-index:0;border-radius:var(--radius-full);background-color:var(--color-primary-10);position:absolute;inset:0}._bucketLabel_1p5xn_53{z-index:1;position:relative}._bucketCount_1p5xn_58{z-index:1;border-radius:var(--radius-full);text-align:center;background-color:var(--color-surface-muted);min-width:18px;color:var(--color-text-mid);padding:0 6px;font-size:11px;font-weight:700;position:relative}._bucketTabActive_1p5xn_38 ._bucketCount_1p5xn_58{background-color:var(--color-primary-10);color:var(--color-primary)}._meetingList_1p5xn_76{flex-direction:column;gap:10px;display:flex}._meeting_1p5xn_76{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);transition:box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);align-items:center;gap:14px;padding:14px 18px;display:flex}._meeting_1p5xn_76:hover{border-color:var(--color-border-strong);box-shadow:var(--shadow-md)}._datePlate_1p5xn_101{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-primary-10);flex-direction:column;justify-content:center;align-items:center;width:48px;min-width:48px;height:56px;display:flex}._datePlatePassed_1p5xn_114{background-color:var(--color-bg)}._datePlateCanceled_1p5xn_118{background-color:var(--color-danger-soft)}._datePlateMonth_1p5xn_122{letter-spacing:.06em;color:var(--color-primary);font-size:9px;font-weight:700}._datePlateDay_1p5xn_129{color:var(--color-primary);font-size:18px;font-weight:800;line-height:1}._datePlateCanceled_1p5xn_118 ._datePlateMonth_1p5xn_122,._datePlateCanceled_1p5xn_118 ._datePlateDay_1p5xn_129{color:var(--color-danger)}._meetingAvatar_1p5xn_141{background-color:var(--avatar-color);width:36px;height:36px;color:var(--color-on-primary);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;font-size:13px;font-weight:700;display:flex}._meetingBody_1p5xn_155{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}._meetingTitle_1p5xn_163{color:var(--color-text);font-size:13px;font-weight:700}._meetingMeta_1p5xn_169{color:var(--color-text-mid);flex-wrap:wrap;align-items:center;gap:10px;font-size:11px;display:flex}._meetingMetaItem_1p5xn_178{align-items:center;gap:4px;display:inline-flex}._meetingActions_1p5xn_184{flex-shrink:0;align-items:center;gap:6px;display:flex}._acceptBtn_1p5xn_191,._joinBtn_1p5xn_192{background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;border-radius:8px;align-items:center;gap:5px;padding:7px 13px;font-size:11.5px;font-weight:600;transition:opacity .15s,background-color .15s;display:inline-flex}._joinBtnDisabled_1p5xn_209,._joinBtn_1p5xn_192:disabled{background-color:var(--color-surface-muted);color:var(--color-text-mid);cursor:not-allowed;opacity:.7}._declineBtn_1p5xn_217{border:1px solid var(--color-border);color:var(--color-text-mid);cursor:pointer;background:0 0;border-radius:8px;padding:7px 12px;font-size:11.5px;font-weight:600}._cancelBtn_1p5xn_228{border:1px solid var(--color-danger);color:var(--color-danger);cursor:pointer;background:0 0;border-radius:8px;padding:7px 12px;font-size:11.5px;font-weight:600}._cancelBtnDisabled_1p5xn_239,._cancelBtn_1p5xn_228:disabled{border-color:var(--color-border);color:var(--color-text-mid);cursor:not-allowed;opacity:.5}._statusPill_1p5xn_247{border-radius:var(--radius-full);align-items:center;gap:4px;padding:5px 11px;font-size:11px;font-weight:700;display:inline-flex}._statusAccepted_1p5xn_257{background-color:var(--color-success-soft);color:var(--color-success)}._statusPending_1p5xn_262{background-color:var(--color-warn-soft);color:var(--color-warn)}._statusRejected_1p5xn_267,._statusCanceled_1p5xn_268{background-color:var(--color-danger-soft);color:var(--color-danger)}._statusCompleted_1p5xn_273{background-color:var(--color-bg);color:var(--color-text-mid)}._empty_1p5xn_278{text-align:center;background-color:#0000;flex-direction:column;justify-content:center;align-items:center;padding:60px 20px;display:flex}._emptyIconWrap_1p5xn_288{border-radius:var(--radius-full);background-color:var(--color-surface-muted);width:64px;height:64px;color:var(--color-text-soft);justify-content:center;align-items:center;margin-bottom:16px;display:flex}._emptyTitle_1p5xn_300{font-size:var(--font-lg);color:var(--color-text);margin:0 0 8px;font-weight:700}._emptyText_1p5xn_307{font-size:var(--font-sm);color:var(--color-text-soft);max-width:300px;margin:0;line-height:1.5}@media (width<=640px){._meeting_1p5xn_76{flex-wrap:wrap;align-items:flex-start;gap:12px 14px;padding:14px}._meetingActions_1p5xn_184{flex-wrap:wrap;flex-basis:100%;gap:8px;width:100%}._acceptBtn_1p5xn_191,._joinBtn_1p5xn_192,._declineBtn_1p5xn_217,._cancelBtn_1p5xn_228{padding:9px 14px;font-size:12px}}._list_1vv5w_1{flex-direction:column;gap:10px;display:flex}._meeting_1vv5w_7{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);align-items:center;gap:14px;padding:14px 18px;display:flex}._datePlate_1vv5w_17{border-radius:var(--radius-md);background-color:var(--color-surface-muted);width:48px;min-width:48px;height:56px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}._avatar_1vv5w_26{background-color:var(--color-surface-muted);border-radius:50%;flex-shrink:0;width:36px;height:36px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}._body_1vv5w_35{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}._title_1vv5w_43{background-color:var(--color-surface-muted);border-radius:4px;width:120px;height:14px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}._meta_1vv5w_51{background-color:var(--color-surface-muted);border-radius:4px;width:180px;height:12px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}._actions_1vv5w_59{flex-shrink:0;align-items:center;gap:6px;display:flex}._btn_1vv5w_66{background-color:var(--color-surface-muted);border-radius:8px;width:64px;height:28px;animation:1.5s ease-in-out infinite _pulse_1vv5w_1}@keyframes _pulse_1vv5w_1{0%,to{opacity:1}50%{opacity:.5}}._screen_18kgg_6{flex-direction:column;min-height:100%;display:flex}._head_18kgg_13{background-color:var(--color-surface);border-bottom:1px solid var(--color-border);padding:22px 28px 0}._headTop_18kgg_19{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:12px;display:flex}._title_18kgg_27{font-size:var(--font-xl);color:var(--color-text);letter-spacing:-.02em;margin:0 0 2px;font-weight:600}._subtitle_18kgg_35{color:var(--color-text-soft);margin:0;font-size:12.5px}._headBadge_18kgg_41{border-radius:var(--radius-sm);background-color:var(--color-primary-05);padding:6px 14px}._headBadgeNum_18kgg_47{font-size:var(--font-md);color:var(--color-primary);font-weight:700}._headBadgeLabel_18kgg_53{color:var(--color-text-soft);margin-left:6px;font-size:11px}._tabs_18kgg_59{gap:0;margin-top:14px;display:flex}._tab_18kgg_59{color:var(--color-text-soft);cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:7px;padding:11px 22px;font-size:14px;font-weight:500;display:flex;position:relative}._tab_18kgg_59:hover{color:var(--color-text)}._tabActive_18kgg_84,._tabActive_18kgg_84:hover{color:var(--color-primary);font-weight:600}._tabUnderline_18kgg_90{background-color:var(--color-primary);border-radius:2px 2px 0 0;height:2.5px;position:absolute;bottom:-1px;left:16px;right:16px}._body_18kgg_100{flex:1;min-height:0;position:relative;overflow:hidden}._tabContent_18kgg_107{height:100%;overflow-y:auto}@media (width<=425px){._tabContent_18kgg_107{padding-bottom:calc(var(--bottom-nav-offset,50px) - 10px);transition:padding-bottom var(--dur-base) var(--ease-out)}}._notesInput_1ut2q_7{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);width:100%;color:var(--color-text);resize:vertical;padding:8px 10px;font-family:inherit;font-size:13px}._notesInput_1ut2q_7:focus{border-color:var(--color-primary-border);outline:none}._actionSpacer_1ut2q_24{flex:1}._panelHead_1ut2q_29{z-index:2;background-color:var(--color-surface);border-bottom:1px solid var(--color-divider);justify-content:space-between;align-items:center;padding:16px 20px;display:flex;position:sticky;top:0}._panelTitle_1ut2q_41{font-size:var(--font-lg);color:var(--color-text);font-weight:700}._panelForm_1ut2q_47{flex-direction:column;gap:16px;padding:18px 20px 24px;display:flex}._microLabel_1ut2q_54{letter-spacing:.06em;text-transform:uppercase;color:var(--color-text-very-soft);font-size:10px;font-weight:700}._panelInput_1ut2q_62{width:100%;height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);color:var(--color-text);padding:0 10px;font-family:inherit;font-size:13px}._panelInput_1ut2q_62:focus{border-color:var(--color-primary-border);outline:none}._inputError_1ut2q_79,._inputError_1ut2q_79:focus{border-color:var(--color-danger)}._fieldError_1ut2q_84{font-size:var(--font-xs);color:var(--color-danger);margin-top:2px}._statusPills_1ut2q_90{flex-wrap:wrap;gap:6px;display:flex}._statusPill_1ut2q_90{border-radius:var(--radius-full);border:1px solid var(--color-border);color:var(--color-text-soft);cursor:pointer;background:0 0;align-items:center;gap:5px;padding:7px 12px;font-size:12px;font-weight:600;display:inline-flex}._statusPillActive_1ut2q_110{background-color:color-mix(in srgb, var(--status-color) 14%, transparent);border-color:color-mix(in srgb, var(--status-color) 45%, transparent);color:var(--status-color)}._dtGrid_1ut2q_116{grid-template-columns:1.3fr 1fr 1fr;align-items:end;gap:10px;display:grid}@media (width<=480px){._dtGrid_1ut2q_116{grid-template-columns:1fr 1fr}._dtGrid_1ut2q_116>:first-child{grid-column:1/-1}}._checkRow_1ut2q_133{width:fit-content;color:var(--color-text);cursor:pointer;align-items:center;gap:8px;font-size:13px;display:inline-flex}._checkbox_1ut2q_143{width:16px;height:16px;accent-color:var(--color-primary);cursor:pointer}._recurToggle_1ut2q_150{border-radius:var(--radius-md);border:1px solid var(--color-border);cursor:pointer;background:0 0;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:10px 12px;display:flex}._recurToggleOn_1ut2q_163{background-color:var(--color-primary-05);border-color:var(--color-primary-30)}._recurToggleLabel_1ut2q_168{color:var(--color-text-mid);align-items:center;gap:8px;font-size:13px;font-weight:600;display:inline-flex}._recurToggleOn_1ut2q_163 ._recurToggleLabel_1ut2q_168{color:var(--color-primary)}._recurSwitch_1ut2q_181{border-radius:var(--radius-full);background-color:var(--color-border-strong);flex-shrink:0;width:34px;height:18px;transition:background-color .15s;position:relative}._recurSwitchOn_1ut2q_191{background-color:var(--color-primary)}._recurKnob_1ut2q_195{background-color:var(--color-on-primary);border-radius:50%;width:14px;height:14px;transition:transform .15s;position:absolute;top:2px;left:2px}._recurSwitchOn_1ut2q_191 ._recurKnob_1ut2q_195{transform:translate(16px)}._panelFooter_1ut2q_210{border-top:1px solid var(--color-divider);background-color:var(--color-surface)}._panelSummary_1ut2q_215{background-color:var(--color-primary-05);color:var(--color-text-mid);align-items:center;gap:8px;padding:12px 20px;font-size:12.5px;font-weight:600;display:flex}._panelActions_1ut2q_226{align-items:center;gap:8px;padding:14px 20px;display:flex}._recurSection_1ut2q_234{flex-direction:column;gap:12px;display:flex}._recurBuilder_1ut2q_240{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);flex-direction:column;gap:12px;padding:12px;display:flex}._recurChips_1ut2q_250{flex-wrap:wrap;gap:6px;display:flex}._recurChip_1ut2q_250{border-radius:var(--radius-full);border:1px solid var(--color-border);color:var(--color-text-soft);cursor:pointer;background:0 0;padding:6px 12px;font-size:12px;font-weight:600}._recurChipActive_1ut2q_267{background-color:var(--color-primary-10);border-color:var(--color-primary-border);color:var(--color-primary)}._recurInline_1ut2q_273{color:var(--color-text-mid);align-items:center;gap:8px;font-size:13px;display:flex}._recurInlineLabel_1ut2q_281{color:var(--color-text-mid);font-size:13px}._recurNumber_1ut2q_286{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:56px;height:32px;color:var(--color-text);padding:0 8px;font-size:13px}._recurWeekdays_1ut2q_297{flex-wrap:wrap;gap:6px;display:flex}._recurDay_1ut2q_303{border:1px solid var(--color-border);width:32px;height:32px;color:var(--color-text-soft);cursor:pointer;background:0 0;border-radius:50%;font-size:12px;font-weight:700}._recurDayActive_1ut2q_315{background-color:var(--color-primary);border-color:var(--color-primary);color:var(--color-on-primary)}._recurEnds_1ut2q_321{flex-direction:column;gap:8px;display:flex}._recurRadio_1ut2q_327{color:var(--color-text-mid);align-items:center;gap:8px;font-size:13px;display:flex}._recurRadio_1ut2q_327 input[type=radio]{accent-color:var(--color-primary)}._recurDate_1ut2q_339{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);height:32px;color:var(--color-text);padding:0 8px;font-size:12.5px}._recurSummaryBox_1ut2q_349{border-radius:var(--radius-sm);background-color:var(--color-primary-05);color:var(--color-primary);text-transform:capitalize;padding:8px 10px;font-size:12px;font-weight:600}._panelSummaryError_1ut2q_360{align-items:center;gap:var(--space-1);font-weight:600;display:inline-flex;color:var(--color-danger)!important}._disabledButtonWrapper_1ut2q_368{cursor:not-allowed;display:inline-block}._resolveConflictBtn_1ut2q_373{background-color:var(--color-danger);color:#fff;border-radius:var(--radius-sm);cursor:pointer;transition:opacity var(--dur-fast) var(--ease-out);border:none;align-items:center;gap:4px;margin-left:8px;padding:4px 8px;font-size:11px;font-weight:600;display:inline-flex}._resolveConflictBtn_1ut2q_373:hover{opacity:.85}._upcomingCard_1ut2q_394{background-color:var(--color-surface-hover);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-3);margin-top:var(--space-4)}._upcomingHeader_1ut2q_402{font-size:var(--font-xs);color:var(--color-text-mid);text-transform:uppercase;letter-spacing:.05em;margin-bottom:var(--space-2);align-items:center;gap:var(--space-1);font-weight:700;display:flex}._upcomingRow_1ut2q_414{font-size:var(--font-sm);color:var(--color-text);padding:var(--space-1) 0;border-bottom:1px solid var(--color-border-subtle);justify-content:space-between;display:flex}._upcomingRow_1ut2q_414:last-child{border-bottom:none}._upcomingRowDate_1ut2q_427{font-weight:500}._upcomingRowTime_1ut2q_431{color:var(--color-text-soft);font-variant-numeric:tabular-nums}._upcomingMore_1ut2q_436{font-size:var(--font-xs);color:var(--color-text-soft);margin-top:var(--space-2);text-align:center;font-style:italic}._differentTimeRow_1ut2q_445{align-items:center;gap:var(--space-2);margin-top:var(--space-3);font-size:var(--font-sm);color:var(--color-text);cursor:pointer;-webkit-user-select:none;user-select:none;display:flex}._differentTimeList_1ut2q_456{gap:var(--space-2);margin-top:var(--space-3);background-color:var(--color-surface-muted);border:1px dashed var(--color-border);border-radius:var(--radius-md);flex-direction:column;padding:10px;display:flex}._differentTimeRowItem_1ut2q_467{align-items:center;gap:var(--space-2);display:flex}._differentTimeRowItem_1ut2q_467 input[type=time]{box-sizing:border-box;flex-shrink:0;width:90px}._differentTimeDayLabel_1ut2q_479{width:40px;font-size:var(--font-sm);color:var(--color-text);flex-shrink:0;font-weight:600;display:inline-block}._differentTimeNote_1ut2q_488{font-size:var(--font-xs);color:var(--color-text-soft);margin-top:var(--space-2);line-height:1.4}._differentTimeRowGroup_1ut2q_495{gap:var(--space-2);flex-direction:column;display:flex}._differentTimeDayLabelSpacer_1ut2q_501{flex-shrink:0;width:40px;display:inline-block}._slotActionBtn_1ut2q_507{color:var(--color-primary);cursor:pointer;padding:var(--space-1);border-radius:var(--radius-sm);transition:background-color var(--dur-fast);background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}._slotActionBtn_1ut2q_507:hover{background-color:var(--color-primary-10)}._slotActionBtnTrash_1ut2q_524{color:var(--color-text-soft);cursor:pointer;padding:var(--space-1);border-radius:var(--radius-sm);transition:color var(--dur-fast), background-color var(--dur-fast);background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}._slotActionBtnTrash_1ut2q_524:hover{color:var(--color-danger);background-color:color-mix(in srgb, var(--color-danger) 10%, transparent)}._center_10cfo_6{place-items:center;padding:40px 0;display:grid}._field_10cfo_12{flex-direction:column;gap:6px;display:flex}._dash_10cfo_18{color:var(--color-text-soft);font-size:var(--font-sm)}._timeInput_ik08d_4{margin:0;padding:4px 8px}._errorStack_q9qoj_4{flex-direction:column;align-items:flex-start;gap:4px;display:flex}._errorLine_q9qoj_11{align-items:center;gap:4px;display:inline-flex}._tzWrap_horpb_4{position:relative}._tzTrigger_horpb_8{width:100%;height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);color:var(--color-text);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:8px;padding:0 10px;font-size:13px;display:flex}._tzTrigger_horpb_8:hover{border-color:var(--color-primary)}._tzGlobe_horpb_30{color:var(--color-text-soft);flex-shrink:0}._tzTriggerLabel_horpb_35{text-align:left;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}._tzTriggerOffset_horpb_44{color:var(--color-primary);flex-shrink:0;font-size:11px;font-weight:700}._tzChevron_horpb_51{color:var(--color-text-soft);flex-shrink:0}._tzBackdrop_horpb_56{z-index:30;cursor:default;background:0 0;border:none;position:fixed;inset:0}._tzPop_horpb_65{z-index:40;border-radius:var(--radius-lg);background-color:var(--color-surface);border:1px solid var(--color-border);box-shadow:var(--shadow-lg);padding:8px;position:absolute;top:calc(100% + 6px);left:0;right:0}._tzSearch_horpb_78{border-radius:var(--radius-md);background-color:var(--color-surface-muted);height:34px;color:var(--color-text-soft);align-items:center;gap:8px;margin-bottom:6px;padding:0 10px;display:flex}._tzSearchInput_horpb_90{min-width:0;color:var(--color-text);background:0 0;border:none;outline:none;flex:1;font-size:12.5px}._tzList_horpb_100{scrollbar-width:none;flex-direction:column;gap:1px;max-height:280px;display:flex;overflow-y:auto}._tzList_horpb_100:hover{scrollbar-width:thin}._tzList_horpb_100::-webkit-scrollbar{background:0 0;width:5px}._tzList_horpb_100::-webkit-scrollbar-track{background:0 0}._tzList_horpb_100::-webkit-scrollbar-thumb{border-radius:var(--radius-full,4px);background:0 0}._tzList_horpb_100:hover::-webkit-scrollbar-thumb{background:var(--color-border,#cbd5e1)}._tzList_horpb_100:hover::-webkit-scrollbar-thumb:hover{background:var(--color-border-strong,#94a3b8)}._tzRow_horpb_135{border-radius:var(--radius-sm);color:var(--color-text);cursor:pointer;text-align:left;transition:background-color var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:8px;padding:8px 10px;font-size:12.5px;display:flex}._tzRow_horpb_135:hover{background-color:var(--color-surface-muted)}._tzRowActive_horpb_154{background-color:var(--color-primary-10)}._tzRowLabel_horpb_158{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-weight:600;overflow:hidden}._tzRowActive_horpb_154 ._tzRowLabel_horpb_158{color:var(--color-primary)}._tzRowOffset_horpb_171{color:var(--color-text-soft);flex-shrink:0;font-size:11px;font-weight:600}._tzCheck_horpb_178{color:var(--color-primary);flex-shrink:0}._tzEmpty_horpb_183{text-align:center;color:var(--color-text-soft);padding:12px;font-size:12px}._gridScroll_1vnsd_7{scrollbar-width:thin;scrollbar-color:var(--color-border) transparent;flex:1;min-width:0;overflow:auto}._gridScroll_1vnsd_7::-webkit-scrollbar{width:6px;height:6px}._gridScroll_1vnsd_7::-webkit-scrollbar-track{background:0 0}._gridScroll_1vnsd_7::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:4px}._gridScroll_1vnsd_7::-webkit-scrollbar-thumb:hover{background-color:var(--color-text-soft)}._gridInner_1vnsd_33{min-width:700px;display:flex}._gutter_1vnsd_38{border-right:1px solid var(--color-divider);flex-shrink:0;width:56px}._gutterHead_1vnsd_44{height:60px}._gutterAllDay_1vnsd_48{height:calc(var(--all-day-rows,1) * 24px + 6px);border-bottom:1px solid var(--color-divider);letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-very-soft);justify-content:flex-end;align-items:center;padding-right:8px;font-size:9px;font-weight:600;display:flex}._gutterHour_1vnsd_62{height:52px;font-size:var(--font-xs);color:var(--color-text-soft);justify-content:flex-end;align-items:flex-start;padding-right:8px;font-weight:500;display:flex}._dayCol_1vnsd_73{border-right:1px solid var(--color-divider);flex:1;min-width:90px}._dayHeader_1vnsd_79{z-index:15;background-color:var(--color-surface);border-bottom:1px solid var(--color-border);flex-direction:column;justify-content:center;align-items:center;gap:1px;height:60px;display:flex;position:sticky;top:0}._colDay_1vnsd_93{font-size:var(--font-xs);color:var(--color-text-soft);text-transform:uppercase;letter-spacing:.04em;font-weight:600}._colDayToday_1vnsd_101{color:var(--color-primary)}._dayNum_1vnsd_105{color:var(--color-text);justify-content:center;align-items:center;width:26px;height:26px;font-size:18px;font-weight:700;line-height:1;display:flex}@media (width<=480px){._dayNum_1vnsd_105{width:22px;height:22px;font-size:14px}}._dayNumToday_1vnsd_125{background-color:var(--color-primary);color:var(--color-on-primary);border-radius:50%}._dayCount_1vnsd_131{color:var(--color-text-very-soft);font-size:9px;font-weight:600}._allDayBand_1vnsd_137{min-height:30px;height:calc(var(--all-day-rows,1) * 24px + 6px);border-bottom:1px solid var(--color-divider);flex-direction:column;gap:2px;padding:3px 4px;display:flex;overflow-y:auto}._allDayChip_1vnsd_148{border:none;border-left:3px solid var(--status-color);background-color:color-mix(in srgb, var(--status-color) 16%, transparent);color:var(--status-color);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;border-radius:5px;align-items:center;gap:4px;padding:2px 6px;font-size:10px;font-weight:600;display:flex;overflow:hidden}._hoursWrap_1vnsd_168{height:var(--grid-h);background-color:var(--color-off-hours);position:relative}._workBand_1vnsd_174{left:0;right:0;top:var(--top);height:var(--h);z-index:0;background-color:var(--color-surface);position:absolute}._hourRow_1vnsd_184{z-index:1;border:none;border-bottom:1px solid var(--color-divider);cursor:pointer;width:100%;height:52px;transition:background-color var(--dur-fast) var(--ease-out);background:0 0;padding:0;display:block;position:relative}._hourRow_1vnsd_184:hover{background-color:var(--color-primary-10)}._nowLine_1vnsd_203{left:0;right:0;top:var(--top);z-index:4;border-top:2px solid var(--color-secondary);pointer-events:none;height:0;position:absolute}._nowDot_1vnsd_214{background-color:var(--color-secondary);border-radius:50%;width:7px;height:7px;position:absolute;top:-4px;left:-1px}._block_1vnsd_224{top:var(--top);height:var(--h);left:calc(2px + var(--lane) * (100% - 4px) / var(--lanes));width:calc((100% - 4px) / var(--lanes) - 2px);z-index:3;background-color:color-mix(in srgb, var(--status-color) 14%, var(--color-surface));border:none;border-left:3px solid var(--status-color);cursor:pointer;text-align:left;font:inherit;box-shadow:var(--shadow-sm);transition:background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border-radius:6px;flex-direction:column;align-items:flex-start;gap:2px;padding:4px 7px;display:flex;position:absolute;overflow:hidden}._block_1vnsd_224:hover{z-index:10;background-color:color-mix(in srgb, var(--status-color) 26%, var(--color-surface));box-shadow:var(--shadow-md,0 4px 14px #0006)}._block_1vnsd_224:focus-visible{outline:2px solid var(--color-focus);outline-offset:1px}._blockTitle_1vnsd_261{width:100%;color:var(--status-color);white-space:nowrap;text-overflow:ellipsis;flex-shrink:0;font-size:11px;font-weight:600;line-height:1.35;display:block;overflow:hidden}._blockTitle_1vnsd_261 svg{vertical-align:-2px;margin-right:3px}._blockTime_1vnsd_279{font-size:var(--font-xs);color:var(--status-color);opacity:.75;white-space:nowrap}@media (width<=640px){._blockTime_1vnsd_279{font-size:10px}}._monthScroll_1vnsd_293{background-color:var(--color-surface);flex-direction:column;flex:1;min-height:0;display:flex;overflow-y:auto}._monthHead_1vnsd_302{border-bottom:1px solid var(--color-border);flex-shrink:0;grid-template-columns:repeat(7,1fr);display:grid}._monthHeadCell_1vnsd_309{text-align:center;letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);padding:10px 8px;font-size:11px;font-weight:700}._monthGrid_1vnsd_319{flex:1;grid-template-columns:repeat(7,1fr);grid-auto-rows:minmax(96px,1fr);display:grid}._monthCell_1vnsd_326{border-right:1px solid var(--color-divider);border-bottom:1px solid var(--color-divider);cursor:pointer;min-height:0;transition:background-color var(--dur-fast) var(--ease-out);flex-direction:column;gap:3px;padding:5px 6px;display:flex;overflow:hidden}._monthCell_1vnsd_326:nth-child(7n){border-right:none}._monthCell_1vnsd_326:hover{background-color:var(--color-primary-05)}._monthCellOff_1vnsd_347{background-color:var(--color-off-hours)}._monthCellOff_1vnsd_347 ._monthDayNum_1vnsd_351{color:var(--color-text-very-soft)}._monthCellToday_1vnsd_355{background-color:var(--color-primary-05)}._monthDayNum_1vnsd_351{text-align:right;color:var(--color-text);font-size:12px;font-weight:600}._monthDayNumToday_1vnsd_366{border-radius:var(--radius-full);background-color:var(--color-primary);min-width:20px;height:20px;color:var(--color-on-primary);text-align:center;align-self:flex-end;padding:0 2px;font-weight:800;line-height:20px}._monthChip_1vnsd_379{text-align:left;border:none;border-left:2px solid var(--status-color);background-color:color-mix(in srgb, var(--status-color) 14%, var(--color-surface));width:100%;color:var(--status-color);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out);border-radius:4px;padding:1px 6px;font-size:10.5px;font-weight:600;display:block;overflow:hidden}._monthChip_1vnsd_379:hover{background-color:color-mix(in srgb, var(--status-color) 26%, var(--color-surface))}._monthMore_1vnsd_402{color:var(--color-text-soft);padding-left:4px;font-size:9.5px;font-weight:600}._agendaScroll_1vnsd_410{background-color:var(--color-bg);flex:1;min-height:0;padding:18px 24px;overflow-y:auto}._agendaGroup_1vnsd_418{margin-bottom:20px}._agendaDay_1vnsd_422{letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-soft);margin-bottom:8px;padding-left:4px;font-size:12px;font-weight:700}._agendaItems_1vnsd_432{flex-direction:column;gap:6px;display:flex}._agendaRow_1vnsd_438{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);cursor:pointer;text-align:left;width:100%;transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:12px;padding:11px 14px;display:flex}._agendaRow_1vnsd_438:hover{border-color:var(--status-color);box-shadow:var(--shadow-sm)}._agendaAccent_1vnsd_459{background-color:var(--status-color);border-radius:2px;flex-shrink:0;width:4px;height:36px}._agendaBody_1vnsd_467{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}._agendaTitle_1vnsd_475{color:var(--color-text);white-space:nowrap;text-overflow:ellipsis;font-size:13.5px;font-weight:600;overflow:hidden}._agendaMeta_1vnsd_484{color:var(--color-text-soft);font-size:11.5px}._agendaMeta_1vnsd_484 svg{vertical-align:-1px}._agendaPill_1vnsd_493{color:var(--status-color);background-color:color-mix(in srgb, var(--status-color) 14%, transparent);border-radius:6px;flex-shrink:0;align-items:center;gap:4px;padding:3px 9px;font-size:11px;font-weight:600;display:inline-flex}._agendaEmpty_1vnsd_506{text-align:center;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:60px 20px;display:flex}._agendaEmptyIcon_1vnsd_517{color:var(--color-text-very-soft);margin-bottom:4px}._agendaEmptyTitle_1vnsd_522{font-size:var(--font-md);color:var(--color-text);font-weight:700}._agendaEmptyText_1vnsd_528{color:var(--color-text-soft);font-size:13px}._agendaEmptyBtn_1vnsd_533{border-radius:var(--radius-md);background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;margin-top:8px;padding:9px 18px;font-size:13px;font-weight:700}._availabilityBand_1vnsd_546{left:3px;right:5px;top:var(--top);height:var(--h);z-index:2;cursor:pointer;box-sizing:border-box;transition:background-color var(--dur-fast) var(--ease-out), backdrop-filter var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);background-color:#22c55e14;border-top:1px dashed #22c55e40;border-bottom:1px dashed #22c55e40;border-left:3px solid #22c55e;justify-content:space-between;align-items:flex-start;padding:4px 8px;display:flex;position:absolute;overflow:hidden}._availabilityBand_1vnsd_546:hover{z-index:10;background-color:color-mix(in srgb, #22c55e 20%, var(--color-surface));-webkit-backdrop-filter:blur(8px);box-shadow:var(--shadow-md,0 4px 14px #0006)}._availabilityBandLabel_1vnsd_579{color:#15803d;align-items:center;gap:4px;font-size:11px;font-weight:700;display:flex}._availabilityBandEditBtn_1vnsd_589{color:#15803d;cursor:pointer;opacity:0;transition:opacity var(--dur-fast) var(--ease-out);background:#ffffffd9;border:1px solid #16653433;border-radius:4px;padding:1px 5px;font-size:9px;font-weight:700}._availabilityBand_1vnsd_546:hover ._availabilityBandEditBtn_1vnsd_589{opacity:1}._availabilityBandEditBtn_1vnsd_589:hover{background:#fff;border-color:#15803d}._dragSelectionHighlight_1vnsd_612{left:0;right:0;top:var(--top);height:var(--h);z-index:10;border:2px dashed var(--color-primary);pointer-events:none;box-sizing:border-box;background-color:#3b82f626;border-radius:6px;justify-content:center;align-items:center;display:flex;position:absolute}._dragSelectionLabel_1vnsd_631{color:var(--color-primary);background-color:var(--color-surface);border:1px solid var(--color-primary-border);box-shadow:var(--shadow-sm);border-radius:4px;padding:3px 8px;font-size:11px;font-weight:700}._sidebar_p4iov_4{border-left:1px solid var(--color-border);background-color:var(--color-surface);scrollbar-width:thin;scrollbar-color:var(--color-border) transparent;flex-direction:column;flex-shrink:0;gap:18px;width:260px;padding:18px 16px;display:flex;overflow-y:auto}._sidebar_p4iov_4::-webkit-scrollbar{width:6px;height:6px}._sidebar_p4iov_4::-webkit-scrollbar-track{background:0 0}._sidebar_p4iov_4::-webkit-scrollbar-thumb{background-color:var(--color-border-strong);border-radius:4px}._sidebar_p4iov_4::-webkit-scrollbar-thumb:hover{background-color:var(--color-text-soft)}._summaryGrid_p4iov_36{grid-template-columns:1fr 1fr;gap:8px;display:grid}._summaryCard_p4iov_42{border-radius:var(--radius-lg);background-color:color-mix(in srgb, var(--v) 7%, var(--color-surface));border:1px solid color-mix(in srgb, var(--v) 22%, transparent);flex-direction:column;gap:6px;padding:12px;display:flex;position:relative;overflow:hidden}._summaryTop_p4iov_54{align-items:center;gap:6px;display:flex}._summaryTopIcon_p4iov_60{color:var(--v);flex-shrink:0}._summaryValue_p4iov_65{letter-spacing:-.02em;color:var(--v);font-size:20px;font-weight:800;line-height:1}._summaryLabel_p4iov_73{color:var(--color-text-soft);text-transform:uppercase;letter-spacing:.05em;font-size:10px;font-weight:700}._sideHeader_p4iov_82{letter-spacing:.05em;text-transform:uppercase;color:var(--color-text-mid);margin-bottom:8px;font-size:11px;font-weight:800}._quickRow_p4iov_92{gap:6px;display:flex}._quickBtn_p4iov_97{color:var(--status-color);background-color:color-mix(in srgb, var(--status-color) 12%, transparent);border:1px solid color-mix(in srgb, var(--status-color) 35%, transparent);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out);border-radius:9px;flex:1;justify-content:center;align-items:center;gap:5px;padding:8px;font-size:11.5px;font-weight:600;display:inline-flex}._quickBtn_p4iov_97:hover{background-color:color-mix(in srgb, var(--status-color) 22%, transparent)}._legendIcon_p4iov_118{color:var(--status-color);flex-shrink:0}._legend_p4iov_118{flex-direction:column;gap:4px;display:flex}._legendItem_p4iov_129{border:1px solid var(--color-border);color:var(--color-text);cursor:pointer;text-align:left;transition:border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);background:0 0;border-radius:9px;align-items:center;gap:9px;padding:8px 10px;font-size:12.5px;font-weight:600;display:flex}._legendItem_p4iov_129:hover{border-color:var(--color-border-strong)}._legendItemOn_p4iov_151{background-color:color-mix(in srgb, var(--status-color) 9%, transparent);border-color:color-mix(in srgb, var(--status-color) 35%, transparent)}._legendOff_p4iov_156{opacity:.55}._legendSwatch_p4iov_160{background-color:var(--status-color);width:18px;height:18px;color:var(--color-on-primary);border-radius:5px;flex-shrink:0;justify-content:center;align-items:center;display:flex}._legendSwatchOff_p4iov_172{border:1.5px solid var(--status-color);background-color:#0000}._drawerHeader_p4iov_177{border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:center;padding-bottom:12px;display:flex}._drawerTitle_p4iov_185{color:var(--color-text);font-size:14px;font-weight:700}._drawerCloseBtn_p4iov_191{border-radius:var(--radius-md);border:1px solid var(--color-border);width:28px;height:28px;color:var(--color-text-mid);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;justify-content:center;align-items:center;display:inline-flex}._drawerCloseBtn_p4iov_191:hover{background-color:var(--color-surface-muted);color:var(--color-text)}@media (width<=1024px){._sidebar_p4iov_4{border-left:none;width:100%;height:100%;overflow-y:auto}._summaryGrid_p4iov_36{grid-template-columns:repeat(2,1fr)}}._scheduleRoot_5za8e_7{background-color:var(--color-bg);flex-direction:column;height:100%;display:flex;overflow:hidden}._toolbar_5za8e_16{background-color:var(--color-surface);border-bottom:1px solid var(--color-border);flex-wrap:wrap;flex-shrink:0;align-items:center;gap:12px;padding:14px 20px;display:flex}._scheduleSelect_5za8e_27{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);height:36px;color:var(--color-text);cursor:pointer;padding:0 10px;font-size:14px;font-weight:600}._weekNav_5za8e_39{align-items:center;gap:4px;display:flex}._dateLabel_5za8e_45{text-align:center;min-width:150px;font-size:var(--font-md);color:var(--color-text-mid);padding:0 6px;font-weight:600}._navBtn_5za8e_54{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:30px;height:30px;color:var(--color-text-mid);cursor:pointer;justify-content:center;align-items:center;transition:background-color .15s,border-color .15s;display:inline-flex}._navBtn_5za8e_54:hover{border-color:var(--color-primary-border);color:var(--color-primary)}._todayBtn_5za8e_75{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-mid);cursor:pointer;margin-left:2px;padding:6px 12px;font-size:12.5px;font-weight:600}._todayBtn_5za8e_75:hover{border-color:var(--color-primary-border);color:var(--color-primary)}._viewChips_5za8e_92{background-color:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:8px;margin-left:auto;padding:3px;display:inline-flex}._viewChip_5za8e_92{color:var(--color-text-soft);cursor:pointer;white-space:nowrap;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:6px;padding:5px 12px;font-size:11.5px;font-weight:500;position:relative}._viewChip_5za8e_92:hover{color:var(--color-text)}._viewChipBg_5za8e_119{z-index:0;background-color:var(--color-surface);box-shadow:var(--shadow-sm);border-radius:6px;position:absolute;inset:0}._viewChipLabel_5za8e_128{z-index:1;white-space:nowrap;position:relative}._viewChipActive_5za8e_134,._viewChipActive_5za8e_134:hover{color:var(--color-primary);font-weight:600}._newBtn_5za8e_140{background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;border-radius:9px;align-items:center;gap:6px;padding:9px 18px;font-size:13px;font-weight:700;display:flex;box-shadow:0 4px 12px #045d5e38}._main_5za8e_156{flex:1;min-height:0;display:flex;overflow:hidden}._calArea_5za8e_163{background-color:var(--color-surface);flex-direction:column;flex:1;min-width:0;display:flex;overflow:hidden}._hoursArea_5za8e_172{flex:1;width:100%;max-width:760px;margin:0 auto;padding:20px;overflow-y:auto}._sidebarToggleBtn_5za8e_181{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);width:32px;height:32px;color:var(--color-text-mid);cursor:pointer;justify-content:center;align-items:center;transition:background-color .15s,border-color .15s,color .15s;display:inline-flex}._sidebarToggleBtn_5za8e_181:hover,._sidebarToggleBtnActive_5za8e_199{border-color:var(--color-primary-border);color:var(--color-primary);background-color:color-mix(in srgb, var(--color-primary) 12%, var(--color-surface))}@media (width>=1025px){._sidebarToggleBtn_5za8e_181{display:none}}@media (width<=1024px){._sidebarToggleBtn_5za8e_181{margin-left:auto}}@media (width<=640px){._toolbar_5za8e_16{gap:8px;padding:10px}._hoursArea_5za8e_172{padding:10px 6px}._weekNav_5za8e_39{justify-content:flex-start;gap:6px;width:auto}._dateLabel_5za8e_45{min-width:auto;padding:0 4px;font-size:13px}._viewChips_5za8e_92{scrollbar-width:none;justify-content:space-between;width:100%;margin-left:0;overflow-x:auto}._viewChips_5za8e_92::-webkit-scrollbar{display:none}._viewChip_5za8e_92{flex-shrink:0;padding:5px 6px;font-size:11px}._newBtn_5za8e_140{justify-content:center;width:100%}}._hours_ftj0h_5{border-radius:var(--radius-lg);border:1px solid var(--color-border);background-color:var(--color-surface);box-shadow:var(--shadow-sm);flex-direction:column;gap:10px;max-width:100%;padding:16px;display:flex;overflow-x:auto}._fieldLabel_ftj0h_18{color:var(--color-text-mid);font-size:12px;font-weight:700}._chips_ftj0h_24{flex-wrap:wrap;gap:6px;display:flex}._chipBtn_ftj0h_30{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface);color:var(--color-text-mid);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);padding:7px 14px;font-size:12.5px;font-weight:600;position:relative}._chipBtn_ftj0h_30:hover{border-color:var(--color-border-strong);color:var(--color-text)}._chipBtnActive_ftj0h_50,._chipBtnActive_ftj0h_50:hover{color:var(--color-primary);border-color:var(--color-primary-border)}._chipBg_ftj0h_56{z-index:0;border-radius:var(--radius-md);background-color:var(--color-primary-10);position:absolute;inset:0}._chipLabel_ftj0h_64{z-index:1;position:relative}._dayRow_ftj0h_69{border-bottom:1px solid var(--color-divider);align-items:center;gap:12px;padding:6px 0;display:flex}._toggle_ftj0h_77{border-radius:var(--radius-full);background-color:var(--color-border-strong);cursor:pointer;border:none;flex-shrink:0;align-items:center;width:36px;height:20px;padding:2px;display:flex}._toggleOn_ftj0h_90{background-color:var(--color-primary);justify-content:flex-end}._toggleKnob_ftj0h_95{background-color:var(--color-on-primary);border-radius:50%;width:16px;height:16px}._dayName_ftj0h_102{min-width:110px;color:var(--color-text);flex-direction:column;gap:2px;font-size:13.5px;font-weight:600;display:flex}._overflowLabel_ftj0h_112{color:var(--color-text-soft);white-space:nowrap;font-size:10px;font-weight:500}._dayTimes_ftj0h_119{align-items:center;gap:8px;width:100%;max-width:240px;display:flex}._timeInput_ftj0h_127{border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-bg);height:32px;color:var(--color-text);flex:1;min-width:0;padding:0 8px;font-family:inherit;font-size:12.5px}._timeInput_ftj0h_127:disabled{opacity:.4}._resetBtn_ftj0h_144{color:var(--color-text-soft);cursor:pointer;background:0 0;border:none;align-items:center;gap:4px;margin-left:auto;font-size:11.5px;font-weight:600;display:inline-flex}._resetBtn_ftj0h_144:hover{color:var(--color-primary)}._readonlyField_ftj0h_162{height:var(--height-input);border-radius:var(--radius-md);border:1px solid var(--color-border);background-color:var(--color-surface-muted);color:var(--color-text-mid);align-items:center;width:100%;padding:0 10px;font-size:13px;display:flex}._fieldHint_ftj0h_175{font-size:var(--font-xs);color:var(--color-text-soft)}._formFooter_ftj0h_180{justify-content:flex-end;align-items:center;gap:12px;padding-top:6px;display:flex}._formStatus_ftj0h_188{color:var(--color-text-soft);font-size:12px;font-weight:600}._saveBtn_ftj0h_194{height:var(--height-btn);border-radius:var(--radius-md);background-color:var(--color-primary);color:var(--color-on-primary);cursor:pointer;border:none;padding:0 18px;font-size:13px;font-weight:700}._saveBtn_ftj0h_194:disabled{opacity:.5;cursor:not-allowed}._inheritedBanner_ftj0h_212{border-radius:var(--radius-md);margin-bottom:20px;overflow:hidden}._inheritedBadge_ftj0h_218{background-color:var(--color-surface-muted);border:1px solid var(--color-border);font-size:var(--font-sm);color:var(--color-text-mid);flex-direction:column;gap:2px;padding:12px 16px;display:flex}._badgeSub_ftj0h_229{font-size:var(--font-xs);color:var(--color-text-soft)}._customBadge_ftj0h_234{background-color:color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));border:1px solid var(--color-primary-border);font-size:var(--font-sm);color:var(--color-primary);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;display:flex}._customBadgeText_ftj0h_247{font-weight:600}._resetToBranchBtn_ftj0h_251{font-size:var(--font-xs);color:var(--color-primary);border:1px solid var(--color-primary-border);background-color:var(--color-surface);border-radius:var(--radius-md);cursor:pointer;transition:all var(--dur-fast) var(--ease-out);align-items:center;gap:4px;padding:6px 12px;font-weight:600;display:inline-flex}._resetToBranchBtn_ftj0h_251:hover{background-color:var(--color-primary-10);border-color:var(--color-primary)}._settingsGrid_ftj0h_271{gap:var(--space-4);margin-bottom:var(--space-4);padding-bottom:var(--space-4);border-bottom:1px solid var(--color-border);grid-template-columns:1fr 1fr;display:grid}@media (width<=640px){._settingsGrid_ftj0h_271{grid-template-columns:1fr}._hours_ftj0h_5{padding:12px 10px}._dayRow_ftj0h_69{gap:6px;min-width:0;padding:6px 0}._dayName_ftj0h_102{flex:0 0 72px;width:72px;min-width:72px;font-size:12px}._dayTimes_ftj0h_119{gap:4px}._timeInput_ftj0h_127{height:28px;padding:0 4px;font-size:11px}._resetBtn_ftj0h_144{margin-left:4px;padding-right:11px;font-size:11px}._formFooter_ftj0h_180{justify-content:center}}/*$vite$:1*/`})();
2
2
  Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./jsx-runtime-VQ627FC0.cjs");let t=require("react"),n=e.o(t,1);t=e.o(t);let r=require("react-dom"),i=e.o(r,1);r=e.o(r);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(null,arguments)}var o;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(o||={});function s(e){e===void 0&&(e={});let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>h(e,typeof e==`string`?null:e.state,t===0?`default`:void 0));let a=u(n??i.length-1),s=o.Pop,c=null;function u(e){return Math.min(Math.max(e,0),i.length-1)}function m(){return i[a]}function h(e,t,n){t===void 0&&(t=null);let r=d(i?m().pathname:`/`,e,t,n);return l(r.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: `+JSON.stringify(e)),r}function g(e){return typeof e==`string`?e:f(e)}return{get index(){return a},get action(){return s},get location(){return m()},createHref:g,createURL(e){return new URL(g(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?p(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){s=o.Push;let n=h(e,t);a+=1,i.splice(a,i.length,n),r&&c&&c({action:s,location:n,delta:1})},replace(e,t){s=o.Replace;let n=h(e,t);i[a]=n,r&&c&&c({action:s,location:n,delta:0})},go(e){s=o.Pop;let t=u(a+e),n=i[t];a=t,c&&c({action:s,location:n,delta:e})},listen(e){return c=e,()=>{c=null}}}}function c(e,t){if(e===!1||e==null)throw Error(t)}function l(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function u(){return Math.random().toString(36).substr(2,8)}function d(e,t,n,r){return n===void 0&&(n=null),a({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?p(t):t,{state:n,key:t&&t.key||r||u()})}function f(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function p(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var m;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(m||={});function h(e,t,n){return n===void 0&&(n=`/`),g(e,t,n,!1)}function g(e,t,n,r){let i=ue((typeof t==`string`?p(t):t).pathname||`/`,n);if(i==null)return null;let a=v(e);b(a);let o=null,s=le(i);for(let e=0;o==null&&e<a.length;++e)o=oe(a[e],s,r);return o}function _(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function v(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(c(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=be([r,o.relativePath]),l=n.concat(o);e.children&&e.children.length>0&&(c(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),v(e.children,t,l,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:ie(s,e.index),routesMeta:l})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of y(e.path))i(e,t,n)}),t}function y(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=y(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function b(e){e.sort((e,t)=>e.score===t.score?ae(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var x=/^:[\w-]+$/,S=3,C=2,ee=1,te=10,ne=-2,re=e=>e===`*`;function ie(e,t){let n=e.split(`/`),r=n.length;return n.some(re)&&(r+=ne),t&&(r+=C),n.filter(e=>!re(e)).reduce((e,t)=>e+(x.test(t)?S:t===``?ee:te),r)}function ae(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function oe(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=se({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=se({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:be([a,u.pathname]),pathnameBase:xe(be([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=be([a,u.pathnameBase]))}return o}function se(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ce(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ce(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),l(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function le(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return l(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function ue(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var de=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fe=e=>de.test(e);function pe(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?p(e):e,a;if(n)if(fe(n))a=n;else{if(n.includes(`//`)){let e=n;n=ye(n),l(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?me(n.substring(1),`/`):me(n,t)}else a=t;return{pathname:a,search:Se(r),hash:Ce(i)}}function me(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function he(e,t,n,r){return`Cannot include a '`+e+`' character in a manually specified `+("`to."+t+"` field ["+JSON.stringify(r)+`]. Please separate it out to the `)+("`to."+n+"` field. Alternatively you may provide the full path as ")+`a string in <Link to="..."> and the router will parse it for you.`}function ge(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function _e(e,t){let n=ge(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function ve(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=p(e):(i=a({},e),c(!i.pathname||!i.pathname.includes(`?`),he(`?`,`pathname`,`search`,i)),c(!i.pathname||!i.pathname.includes(`#`),he(`#`,`pathname`,`hash`,i)),c(!i.search||!i.search.includes(`#`),he(`#`,`search`,`hash`,i)));let o=e===``||i.pathname===``,s=o?`/`:i.pathname,l;if(s==null)l=n;else{let e=t.length-1;if(!r&&s.startsWith(`..`)){let t=s.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}l=e>=0?t[e]:`/`}let u=pe(i,l),d=s&&s!==`/`&&s.endsWith(`/`),f=(o||s===`.`)&&n.endsWith(`/`);return!u.pathname.endsWith(`/`)&&(d||f)&&(u.pathname+=`/`),u}var ye=e=>e.replace(/\/\/+/g,`/`),be=e=>ye(e.join(`/`)),xe=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Se=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ce=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function we(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var Te=[`post`,`put`,`patch`,`delete`];new Set(Te);var Ee=[`get`,...Te];new Set(Ee);function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(null,arguments)}var Oe=t.createContext(null);process.env.NODE_ENV!==`production`&&(Oe.displayName=`DataRouter`);var ke=t.createContext(null);process.env.NODE_ENV!==`production`&&(ke.displayName=`DataRouterState`);var Ae=t.createContext(null);process.env.NODE_ENV!==`production`&&(Ae.displayName=`Await`);var je=t.createContext(null);process.env.NODE_ENV!==`production`&&(je.displayName=`Navigation`);var Me=t.createContext(null);process.env.NODE_ENV!==`production`&&(Me.displayName=`Location`);var Ne=t.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!==`production`&&(Ne.displayName=`Route`);var Pe=t.createContext(null);process.env.NODE_ENV!==`production`&&(Pe.displayName=`RouteError`);function Fe(e,n){let{relative:r}=n===void 0?{}:n;!Ie()&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`useHref() may be used only in the context of a <Router> component.`));let{basename:i,navigator:a}=t.useContext(je),{hash:o,pathname:s,search:l}=Ge(e,{relative:r}),u=s;return i!==`/`&&(u=s===`/`?i:be([i,s])),a.createHref({pathname:u,search:l,hash:o})}function Ie(){return t.useContext(Me)!=null}function Le(){return!Ie()&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`useLocation() may be used only in the context of a <Router> component.`)),t.useContext(Me).location}var Re=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ze(e){t.useContext(je).static||t.useLayoutEffect(e)}function Be(){let{isDataRoute:e}=t.useContext(Ne);return e?ut():Ve()}function Ve(){!Ie()&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`useNavigate() may be used only in the context of a <Router> component.`));let e=t.useContext(Oe),{basename:n,future:r,navigator:i}=t.useContext(je),{matches:a}=t.useContext(Ne),{pathname:o}=Le(),s=JSON.stringify(_e(a,r.v7_relativeSplatPath)),u=t.useRef(!1);return ze(()=>{u.current=!0}),t.useCallback(function(t,r){if(r===void 0&&(r={}),process.env.NODE_ENV!==`production`&&l(u.current,Re),!u.current)return;if(typeof t==`number`){i.go(t);return}let a=ve(t,JSON.parse(s),o,r.relative===`path`);e==null&&n!==`/`&&(a.pathname=a.pathname===`/`?n:be([n,a.pathname])),(r.replace?i.replace:i.push)(a,r.state,r)},[n,i,s,o,e])}var He=t.createContext(null);function Ue(e){let n=t.useContext(Ne).outlet;return n&&t.createElement(He.Provider,{value:e},n)}function We(){let{matches:e}=t.useContext(Ne),n=e[e.length-1];return n?n.params:{}}function Ge(e,n){let{relative:r}=n===void 0?{}:n,{future:i}=t.useContext(je),{matches:a}=t.useContext(Ne),{pathname:o}=Le(),s=JSON.stringify(_e(a,i.v7_relativeSplatPath));return t.useMemo(()=>ve(e,JSON.parse(s),o,r===`path`),[e,s,o,r])}function Ke(e,t){return qe(e,t)}function qe(e,n,r,i){!Ie()&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`useRoutes() may be used only in the context of a <Router> component.`));let{navigator:a}=t.useContext(je),{matches:s}=t.useContext(Ne),u=s[s.length-1],d=u?u.params:{},f=u?u.pathname:`/`,m=u?u.pathnameBase:`/`,g=u&&u.route;if(process.env.NODE_ENV!==`production`){let e=g&&g.path||``;ft(f,!g||e.endsWith(`*`),"You rendered descendant <Routes> (or called `useRoutes()`) at "+(`"`+f+`" (under <Route path="`+e+`">) but the `)+`parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3
3
 
4
4
  `+(`Please change the parent <Route path="`+e+`"> to <Route `)+(`path="`+(e===`/`?`*`:e+`/*`)+`">.`))}let _=Le(),v;if(n){let e=typeof n==`string`?p(n):n;!(m===`/`||e.pathname?.startsWith(m))&&(process.env.NODE_ENV===`production`?c(!1):c(!1,"When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was "+(`matched by all parent routes. The current pathname base is "`+m+`" `)+(`but pathname "`+e.pathname+'" was given in the `location` prop.'))),v=e}else v=_;let y=v.pathname||`/`,b=y;if(m!==`/`){let e=m.replace(/^\//,``).split(`/`);b=`/`+y.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let x=h(e,{pathname:b});process.env.NODE_ENV!==`production`&&(process.env.NODE_ENV!==`production`&&l(g||x!=null,`No routes matched location "`+v.pathname+v.search+v.hash+`" `),process.env.NODE_ENV!==`production`&&l(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "`+v.pathname+v.search+v.hash+`" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let S=Qe(x&&x.map(e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:be([m,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?m:be([m,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),s,r,i);return n&&S?t.createElement(Me.Provider,{value:{location:De({pathname:`/`,search:``,hash:``,state:null,key:`default`},v),navigationType:o.Pop}},S):S}function Je(){let e=lt(),n=we(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return process.env.NODE_ENV!==`production`&&(console.error(`Error handled by React Router default ErrorBoundary:`,e),s=t.createElement(t.Fragment,null,t.createElement(`p`,null,`💿 Hey developer 👋`),t.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,t.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,t.createElement(`code`,{style:o},`errorElement`),` prop on your route.`))),t.createElement(t.Fragment,null,t.createElement(`h2`,null,`Unexpected Application Error!`),t.createElement(`h3`,{style:{fontStyle:`italic`}},n),r?t.createElement(`pre`,{style:a},r):null,s)}var Ye=t.createElement(Je,null),Xe=class extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:t.createElement(Ne.Provider,{value:this.props.routeContext},t.createElement(Pe.Provider,{value:this.state.error,children:this.props.component}))}};function Ze(e){let{routeContext:n,match:r,children:i}=e,a=t.useContext(Oe);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(Ne.Provider,{value:n},i)}function Qe(e,n,r,i){if(n===void 0&&(n=[]),r===void 0&&(r=null),i===void 0&&(i=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=i)!=null&&a.v7_partialHydration&&n.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=r?.errors;if(s!=null){let e=o.findIndex(e=>e.route.id&&s?.[e.route.id]!==void 0);!(e>=0)&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`Could not find a matching route for errors on route IDs: `+Object.keys(s).join(`,`))),o=o.slice(0,Math.min(o.length,e+1))}let l=!1,u=-1;if(r&&i&&i.v7_partialHydration)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=r,i=t.route.loader&&e[t.route.id]===void 0&&(!n||n[t.route.id]===void 0);if(t.route.lazy||i){l=!0,o=u>=0?o.slice(0,u+1):[o[0]];break}}}return o.reduceRight((e,i,a)=>{let c,d=!1,f=null,p=null;r&&(c=s&&i.route.id?s[i.route.id]:void 0,f=i.route.errorElement||Ye,l&&(u<0&&a===0?(ft(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):u===a&&(d=!0,p=i.route.hydrateFallbackElement||null)));let m=n.concat(o.slice(0,a+1)),h=()=>{let n;return n=c?f:d?p:i.route.Component?t.createElement(i.route.Component,null):i.route.element?i.route.element:e,t.createElement(Ze,{match:i,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:n})};return r&&(i.route.ErrorBoundary||i.route.errorElement||a===0)?t.createElement(Xe,{location:r.location,revalidation:r.revalidation,component:f,error:c,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()},null)}var $e=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}($e||{}),et=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(et||{});function tt(e){return e+` must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.`}function nt(e){let n=t.useContext(Oe);return!n&&(process.env.NODE_ENV===`production`?c(!1):c(!1,tt(e))),n}function rt(e){let n=t.useContext(ke);return!n&&(process.env.NODE_ENV===`production`?c(!1):c(!1,tt(e))),n}function it(e){let n=t.useContext(Ne);return!n&&(process.env.NODE_ENV===`production`?c(!1):c(!1,tt(e))),n}function at(e){let t=it(e),n=t.matches[t.matches.length-1];return!n.route.id&&(process.env.NODE_ENV===`production`?c(!1):c(!1,e+` can only be used on routes that contain a unique "id"`)),n.route.id}function ot(){return at(et.UseRouteId)}function st(){return rt(et.UseNavigation).navigation}function ct(){let{matches:e,loaderData:n}=rt(et.UseMatches);return t.useMemo(()=>e.map(e=>_(e,n)),[e,n])}function lt(){let e=t.useContext(Pe),n=rt(et.UseRouteError),r=at(et.UseRouteError);return e===void 0?n.errors?.[r]:e}function ut(){let{router:e}=nt($e.UseNavigateStable),n=at(et.UseNavigateStable),r=t.useRef(!1);return ze(()=>{r.current=!0}),t.useCallback(function(t,i){i===void 0&&(i={}),process.env.NODE_ENV!==`production`&&l(r.current,Re),r.current&&(typeof t==`number`?e.navigate(t):e.navigate(t,De({fromRouteId:n},i)))},[e,n])}var dt={};function ft(e,t,n){!t&&!dt[e]&&(dt[e]=!0,process.env.NODE_ENV!==`production`&&l(!1,n))}var pt={};function mt(e,t){process.env.NODE_ENV!==`production`&&!pt[t]&&(pt[t]=!0,console.warn(t))}var ht=(e,t,n)=>mt(e,`⚠️ React Router Future Flag Warning: `+t+`. `+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`));function gt(e,t){e?.v7_startTransition===void 0&&ht(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&ht(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&ht(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&ht(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&ht(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&ht(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}var _t=t.startTransition;function vt(e){let{basename:n,children:r,initialEntries:i,initialIndex:a,future:o}=e,c=t.useRef();c.current??=s({initialEntries:i,initialIndex:a,v5Compat:!0});let l=c.current,[u,d]=t.useState({action:l.action,location:l.location}),{v7_startTransition:f}=o||{},p=t.useCallback(e=>{f&&_t?_t(()=>d(e)):d(e)},[d,f]);return t.useLayoutEffect(()=>l.listen(p),[l,p]),t.useEffect(()=>gt(o),[o]),t.createElement(xt,{basename:n,children:r,location:u.location,navigationType:u.action,navigator:l,future:o})}function yt(e){let{to:n,replace:r,state:i,relative:a}=e;!Ie()&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`<Navigate> may be used only in the context of a <Router> component.`));let{future:o,static:s}=t.useContext(je);process.env.NODE_ENV!==`production`&&l(!s,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:u}=t.useContext(Ne),{pathname:d}=Le(),f=Be(),p=ve(n,_e(u,o.v7_relativeSplatPath),d,a===`path`),m=JSON.stringify(p);return t.useEffect(()=>f(JSON.parse(m),{replace:r,state:i,relative:a}),[f,m,a,r,i]),null}function bt(e){process.env.NODE_ENV===`production`?c(!1):c(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function xt(e){let{basename:n=`/`,children:r=null,location:i,navigationType:a=o.Pop,navigator:s,static:u=!1,future:d}=e;Ie()&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`));let f=n.replace(/^\/*/,`/`),m=t.useMemo(()=>({basename:f,navigator:s,static:u,future:De({v7_relativeSplatPath:!1},d)}),[f,d,s,u]);typeof i==`string`&&(i=p(i));let{pathname:h=`/`,search:g=``,hash:_=``,state:v=null,key:y=`default`}=i,b=t.useMemo(()=>{let e=ue(h,f);return e==null?null:{location:{pathname:e,search:g,hash:_,state:v,key:y},navigationType:a}},[f,h,g,_,v,y,a]);return process.env.NODE_ENV!==`production`&&l(b!=null,`<Router basename="`+f+`"> is not able to match the URL `+(`"`+h+g+_+`" because it does not start with the `)+`basename, so the <Router> won't render anything.`),b==null?null:t.createElement(je.Provider,{value:m},t.createElement(Me.Provider,{children:r,value:b}))}function St(e){let{children:t,location:n}=e;return Ke(wt(t),n)}var Ct=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(Ct||{});new Promise(()=>{}),t.Component;function wt(e,n){n===void 0&&(n=[]);let r=[];return t.Children.forEach(e,(e,i)=>{if(!t.isValidElement(e))return;let a=[...n,i];if(e.type===t.Fragment){r.push.apply(r,wt(e.props.children,a));return}e.type!==bt&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`[`+(typeof e.type==`string`?e.type:e.type.name)+`] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`)),!(!e.props.index||!e.props.children)&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`An index route cannot have child routes.`));let o={id:e.props.id||a.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=wt(e.props.children,a)),r.push(o)}),r}function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tt.apply(null,arguments)}function Et(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Dt=`get`,Ot=`application/x-www-form-urlencoded`;function kt(e){return e!=null&&typeof e.tagName==`string`}function At(e){return kt(e)&&e.tagName.toLowerCase()===`button`}function jt(e){return kt(e)&&e.tagName.toLowerCase()===`form`}function Mt(e){return kt(e)&&e.tagName.toLowerCase()===`input`}function Nt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Pt(e,t){return e.button===0&&(!t||t===`_self`)&&!Nt(e)}function Ft(e){return e===void 0&&(e=``),new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function It(e,t){let n=Ft(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Lt=null;function Rt(){if(Lt===null)try{new FormData(document.createElement(`form`),0),Lt=!1}catch{Lt=!0}return Lt}var zt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Bt(e){return e!=null&&!zt.has(e)?(process.env.NODE_ENV!==`production`&&l(!1,`"`+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` and will default to "application/x-www-form-urlencoded"'),null):e}function Vt(e,t){let n,r,i,a,o;if(jt(e)){let o=e.getAttribute(`action`);r=o?ue(o,t):null,n=e.getAttribute(`method`)||Dt,i=Bt(e.getAttribute(`enctype`))||Ot,a=new FormData(e)}else if(At(e)||Mt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ue(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Dt,i=Bt(e.getAttribute(`formenctype`))||Bt(o.getAttribute(`enctype`))||Ot,a=new FormData(o,e),!Rt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?t+`.`:``;a.append(e+`x`,`0`),a.append(e+`y`,`0`)}else t&&a.append(t,r)}}else if(kt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Dt,r=null,i=Ot,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var Ht=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`viewTransition`],Ut=[`aria-current`,`caseSensitive`,`className`,`end`,`style`,`to`,`viewTransition`,`children`],Wt=[`fetcherKey`,`navigate`,`reloadDocument`,`replace`,`state`,`method`,`action`,`onSubmit`,`relative`,`preventScrollReset`,`viewTransition`],Gt=`6`;try{window.__reactRouterVersion=Gt}catch{}var Kt=t.createContext({isTransitioning:!1});process.env.NODE_ENV!==`production`&&(Kt.displayName=`ViewTransition`);var qt=t.createContext(new Map);process.env.NODE_ENV!==`production`&&(qt.displayName=`Fetchers`);var Jt=t.startTransition;function Yt(e){let{basename:n,children:r,future:i,history:a}=e,[o,s]=t.useState({action:a.action,location:a.location}),{v7_startTransition:c}=i||{},l=t.useCallback(e=>{c&&Jt?Jt(()=>s(e)):s(e)},[s,c]);return t.useLayoutEffect(()=>a.listen(l),[a,l]),t.useEffect(()=>gt(i),[i]),t.createElement(xt,{basename:n,children:r,location:o.location,navigationType:o.action,navigator:a,future:i})}process.env.NODE_ENV!==`production`&&(Yt.displayName=`unstable_HistoryRouter`);var Xt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Zt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qt=t.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:s,target:c,to:u,preventScrollReset:d,viewTransition:f}=e,p=Et(e,Ht),{basename:m}=t.useContext(je),h,g=!1;if(typeof u==`string`&&Zt.test(u)&&(h=u,Xt))try{let e=new URL(window.location.href),t=u.startsWith(`//`)?new URL(e.protocol+u):new URL(u),n=ue(t.pathname,m);t.origin===e.origin&&n!=null?u=n+t.search+t.hash:g=!0}catch{process.env.NODE_ENV!==`production`&&l(!1,`<Link to="`+u+`"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=Fe(u,{relative:i}),v=cn(u,{replace:o,state:s,target:c,preventScrollReset:d,relative:i,viewTransition:f});function y(e){r&&r(e),e.defaultPrevented||v(e)}return t.createElement(`a`,Tt({},p,{href:h||_,onClick:g||a?r:y,ref:n,target:c}))});process.env.NODE_ENV!==`production`&&(Qt.displayName=`Link`);var $t=t.forwardRef(function(e,n){let{"aria-current":r=`page`,caseSensitive:i=!1,className:a=``,end:o=!1,style:s,to:c,viewTransition:l,children:u}=e,d=Et(e,Ut),f=Ge(c,{relative:d.relative}),p=Le(),m=t.useContext(ke),{navigator:h,basename:g}=t.useContext(je),_=m!=null&&yn(f)&&l===!0,v=h.encodeLocation?h.encodeLocation(f).pathname:f.pathname,y=p.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&g&&(b=ue(b,g)||b);let x=v!==`/`&&v.endsWith(`/`)?v.length-1:v.length,S=y===v||!o&&y.startsWith(v)&&y.charAt(x)===`/`,C=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)===`/`),ee={isActive:S,isPending:C,isTransitioning:_},te=S?r:void 0,ne;ne=typeof a==`function`?a(ee):[a,S?`active`:null,C?`pending`:null,_?`transitioning`:null].filter(Boolean).join(` `);let re=typeof s==`function`?s(ee):s;return t.createElement(Qt,Tt({},d,{"aria-current":te,className:ne,ref:n,style:re,to:c,viewTransition:l}),typeof u==`function`?u(ee):u)});process.env.NODE_ENV!==`production`&&($t.displayName=`NavLink`);var en=t.forwardRef((e,n)=>{let{fetcherKey:r,navigate:i,reloadDocument:a,replace:o,state:s,method:c=Dt,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p}=e,m=Et(e,Wt),h=pn(),g=mn(l,{relative:d}),_=c.toLowerCase()===`get`?`get`:`post`;return t.createElement(`form`,Tt({ref:n,method:_,action:g,onSubmit:a?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,n=t?.getAttribute(`formmethod`)||c;h(t||e.currentTarget,{fetcherKey:r,method:n,navigate:i,replace:o,state:s,relative:d,preventScrollReset:f,viewTransition:p})}},m))});process.env.NODE_ENV!==`production`&&(en.displayName=`Form`);function tn(e){let{getKey:t,storageKey:n}=e;return _n({getKey:t,storageKey:n}),null}process.env.NODE_ENV!==`production`&&(tn.displayName=`ScrollRestoration`);var nn;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(nn||={});var rn;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(rn||={});function an(e){return e+` must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.`}function on(e){let n=t.useContext(Oe);return!n&&(process.env.NODE_ENV===`production`?c(!1):c(!1,an(e))),n}function sn(e){let n=t.useContext(ke);return!n&&(process.env.NODE_ENV===`production`?c(!1):c(!1,an(e))),n}function cn(e,n){let{target:r,replace:i,state:a,preventScrollReset:o,relative:s,viewTransition:c}=n===void 0?{}:n,l=Be(),u=Le(),d=Ge(e,{relative:s});return t.useCallback(t=>{Pt(t,r)&&(t.preventDefault(),l(e,{replace:i===void 0?f(u)===f(d):i,state:a,preventScrollReset:o,relative:s,viewTransition:c}))},[u,l,d,i,a,r,e,o,s,c])}function ln(e){process.env.NODE_ENV!==`production`&&l(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=t.useRef(Ft(e)),r=t.useRef(!1),i=Le(),a=t.useMemo(()=>It(i.search,r.current?null:n.current),[i.search]),o=Be();return[a,t.useCallback((e,t)=>{let n=Ft(typeof e==`function`?e(a):e);r.current=!0,o(`?`+n,t)},[o,a])]}function un(){if(typeof document>`u`)throw Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}var dn=0,fn=()=>`__`+String(++dn)+`__`;function pn(){let{router:e}=on(nn.UseSubmit),{basename:n}=t.useContext(je),r=ot();return t.useCallback(function(t,i){i===void 0&&(i={}),un();let{action:a,method:o,encType:s,formData:c,body:l}=Vt(t,n);if(i.navigate===!1){let t=i.fetcherKey||fn();e.fetch(t,r,i.action||a,{preventScrollReset:i.preventScrollReset,formData:c,body:l,formMethod:i.method||o,formEncType:i.encType||s,flushSync:i.flushSync})}else e.navigate(i.action||a,{preventScrollReset:i.preventScrollReset,formData:c,body:l,formMethod:i.method||o,formEncType:i.encType||s,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,n,r])}function mn(e,n){let{relative:r}=n===void 0?{}:n,{basename:i}=t.useContext(je),a=t.useContext(Ne);!a&&(process.env.NODE_ENV===`production`?c(!1):c(!1,`useFormAction must be used inside a RouteContext`));let[o]=a.matches.slice(-1),s=Tt({},Ge(e||`.`,{relative:r})),l=Le();if(e==null){s.search=l.search;let e=new URLSearchParams(s.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();s.search=n?`?`+n:``}}return(!e||e===`.`)&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,`?index&`):`?index`),i!==`/`&&(s.pathname=s.pathname===`/`?i:be([i,s.pathname])),f(s)}var hn=`react-router-scroll-positions`,gn={};function _n(e){let{getKey:n,storageKey:r}=e===void 0?{}:e,{router:i}=on(nn.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=sn(rn.UseScrollRestoration),{basename:s}=t.useContext(je),c=Le(),u=ct(),d=st();t.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),vn(t.useCallback(()=>{if(d.state===`idle`){let e=(n?n(c,u):null)||c.key;gn[e]=window.scrollY}try{sessionStorage.setItem(r||hn,JSON.stringify(gn))}catch(e){process.env.NODE_ENV!==`production`&&l(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (`+e+`).`)}window.history.scrollRestoration=`auto`},[r,n,d.state,c,u])),typeof document<`u`&&(t.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(r||hn);e&&(gn=JSON.parse(e))}catch{}},[r]),t.useLayoutEffect(()=>{let e=n&&s!==`/`?(e,t)=>n(Tt({},e,{pathname:ue(e.pathname,s)||e.pathname}),t):n,t=i?.enableScrollRestoration(gn,()=>window.scrollY,e);return()=>t&&t()},[i,s,n]),t.useLayoutEffect(()=>{if(a!==!1){if(typeof a==`number`){window.scrollTo(0,a);return}if(c.hash){let e=document.getElementById(decodeURIComponent(c.hash.slice(1)));if(e){e.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[c,a,o]))}function vn(e,n){let{capture:r}=n||{};t.useEffect(()=>{let t=r==null?void 0:{capture:r};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,r])}function yn(e,n){n===void 0&&(n={});let r=t.useContext(Kt);r??(process.env.NODE_ENV===`production`?c(!1):c(!1,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"));let{basename:i}=on(nn.useViewTransitionState),a=Ge(e,{relative:n.relative});if(!r.isTransitioning)return!1;let o=ue(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=ue(r.nextLocation.pathname,i)||r.nextLocation.pathname;return se(a.pathname,s)!=null||se(a.pathname,o)!=null}var bn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),xn=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Sn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Cn=e=>{let t=Sn(e);return t.charAt(0).toUpperCase()+t.slice(1)},wn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Tn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},En=(0,n.createContext)({}),Dn=()=>(0,n.useContext)(En),On=(0,n.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,...c},l)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=Dn()??{},h=i??f?Number(r??d)*24/Number(t??u):r??d;return(0,n.createElement)(`svg`,{ref:l,...wn,width:t??u??wn.width,height:t??u??wn.height,stroke:e??p,strokeWidth:h,className:bn(`lucide`,m,a),...!o&&!Tn(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(o)?o:[o]])}),w=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...i},a)=>(0,n.createElement)(On,{ref:a,iconNode:t,className:bn(`lucide-${xn(Cn(e))}`,`lucide-${e}`,r),...i}));return r.displayName=Cn(e),r},kn=w(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),An=w(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),jn=w(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Mn=w(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Nn=w(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),Pn=w(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),Fn=w(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),In=w(`bookmark`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),Ln=w(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Rn=w(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),zn=w(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Bn=w(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Vn=w(`calendar-x`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`m14 14-4 4`,key:`rymu2i`}],[`path`,{d:`m10 14 4 4`,key:`3sz06r`}]]),Hn=w(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Un=w(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),Wn=w(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Gn=w(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Kn=w(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),qn=w(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Jn=w(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Yn=w(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Xn=w(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Zn=w(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Qn=w(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),$n=w(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),er=w(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),tr=w(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),nr=w(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),rr=w(`file-headphone`,[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]]),ir=w(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),ar=w(`file-play`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z`,key:`1tzo1f`}]]),or=w(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),sr=w(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),cr=w(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),lr=w(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ur=w(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),dr=w(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),fr=w(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),pr=w(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),mr=w(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),hr=w(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),gr=w(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),_r=w(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),vr=w(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),yr=w(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),br=w(`megaphone`,[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]),xr=w(`message-square-dashed`,[[`path`,{d:`M14 3h2`,key:`1d12a5`}],[`path`,{d:`M16 19h-2`,key:`1agirb`}],[`path`,{d:`M2 12v-2`,key:`1ey295`}],[`path`,{d:`M2 16v5.286a.71.71 0 0 0 1.212.502l1.149-1.149`,key:`120k8q`}],[`path`,{d:`M20 19a2 2 0 0 0 2-2v-1`,key:`ior8tn`}],[`path`,{d:`M22 10v2`,key:`rmlecy`}],[`path`,{d:`M22 6V5a2 2 0 0 0-2-2`,key:`sp3k6r`}],[`path`,{d:`M4 3a2 2 0 0 0-2 2v1`,key:`11zt7s`}],[`path`,{d:`M8 19h2`,key:`jnunrx`}],[`path`,{d:`M8 3h2`,key:`ysbsee`}]]),Sr=w(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Cr=w(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),wr=w(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),Tr=w(`newspaper`,[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]),Er=w(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Dr=w(`party-popper`,[[`path`,{d:`M5.8 11.3 2 22l10.7-3.79`,key:`gwxi1d`}],[`path`,{d:`M4 3h.01`,key:`1vcuye`}],[`path`,{d:`M22 8h.01`,key:`1mrtc2`}],[`path`,{d:`M15 2h.01`,key:`1cjtqr`}],[`path`,{d:`M22 20h.01`,key:`1mrys2`}],[`path`,{d:`m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10`,key:`hbicv8`}],[`path`,{d:`m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17`,key:`1i94pl`}],[`path`,{d:`m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7`,key:`1cofks`}],[`path`,{d:`M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z`,key:`4kbmks`}]]),Or=w(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),kr=w(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ar=w(`phone-off`,[[`path`,{d:`M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272`,key:`1wngk7`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}],[`path`,{d:`M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473`,key:`10hv5p`}]]),jr=w(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),Mr=w(`picture-in-picture-2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),Nr=w(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Pr=w(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Fr=w(`presentation`,[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]),Ir=w(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Lr=w(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Rr=w(`repeat-2`,[[`path`,{d:`m2 9 3-3 3 3`,key:`1ltn5i`}],[`path`,{d:`M13 18H7a2 2 0 0 1-2-2V6`,key:`1r6tfw`}],[`path`,{d:`m22 15-3 3-3-3`,key:`4rnwn2`}],[`path`,{d:`M11 6h6a2 2 0 0 1 2 2v10`,key:`2f72bc`}]]),zr=w(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),Br=w(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),Vr=w(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Hr=w(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ur=w(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Wr=w(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Gr=w(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Kr=w(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),qr=w(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Jr=w(`smile-plus`,[[`path`,{d:`M22 11v1a10 10 0 1 1-9-10`,key:`ew0xw9`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}],[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}]]),Yr=w(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Xr=w(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Zr=w(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Qr=w(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),$r=w(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),ei=w(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),ti=w(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),ni=w(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ri=w(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),ii=w(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),ai=w(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),oi=w(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),si=w(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ci=w(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),T=(...e)=>e.filter(e=>!!e).join(` `),li=class extends Error{context;constructor(e,t){super(e),this.name=new.target.name,t?.cause!==void 0&&(this.cause=t.cause),t?.context!==void 0&&(this.context=Object.freeze({...t.context})),Object.setPrototypeOf(this,new.target.prototype)}},ui=class extends li{},E=e=>e,di=e=>{let t=e.trim().replace(/([a-z])([A-Z])/g,`$1 $2`).split(/\s+/).filter(e=>e.length>0);return t.length===0?`?`:`${t[0]?.[0]??``}${t.length>1?t[t.length-1]?.[0]??``:``}`.toUpperCase()},fi=e=>{let t=0;for(let n=0;n<e.length;n+=1)t=e.charCodeAt(n)+((t<<5)-t);let n=Math.abs(t)%360;return`hsl(${String(n)} 58% 42%)`},pi=(e,t,n=Math.floor(t*.9))=>{let r=e.length,i=r>t;return{length:r,isOverLimit:i,showCounter:r>=n,counterColor:i?`danger`:`soft`}},mi=e=>{let[t,r]=(0,n.useState)(()=>window.matchMedia(e).matches);return(0,n.useEffect)(()=>{let t=window.matchMedia(e),n=()=>{r(t.matches)};return r(t.matches),t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}},[e]),t},D=e.t(),hi={spinner:`_spinner_164a8_1`,spin:`_spin_164a8_1`,sm:`_sm_164a8_10`,md:`_md_164a8_15`,lg:`_lg_164a8_20`},gi=({size:e=`md`,label:t=`Loading`})=>(0,D.jsx)(`span`,{className:T(hi.spinner,hi[e]),role:`status`,"aria-label":t}),_i={button:`_button_1xtk2_1`,sm:`_sm_1xtk2_36`,md:`_md_1xtk2_40`,lg:`_lg_1xtk2_44`,primary:`_primary_1xtk2_50`,secondary:`_secondary_1xtk2_63`,ghost:`_ghost_1xtk2_74`,danger:`_danger_1xtk2_82`,fullWidth:`_fullWidth_1xtk2_92`,loadingTextHidden:`_loadingTextHidden_1xtk2_96`},vi=({variant:e=`primary`,size:t=`md`,isLoading:n=!1,fullWidth:r=!1,disabled:i,type:a=`button`,className:o,children:s,...c})=>(0,D.jsxs)(`button`,{type:a,className:T(_i.button,_i[e],_i[t],r&&_i.fullWidth,o),disabled:i===!0||n,"aria-busy":n,...c,children:[n?(0,D.jsx)(gi,{size:`sm`}):null,(0,D.jsx)(`span`,{className:T(n&&_i.loadingTextHidden),children:s})]}),yi={alert:`_alert_r5ybz_1`,error:`_error_r5ybz_12`,info:`_info_r5ybz_18`,success:`_success_r5ybz_24`,title:`_title_r5ybz_30`,body:`_body_r5ybz_35`},bi=({tone:e=`info`,title:t,children:n})=>(0,D.jsx)(`div`,{className:T(yi.alert,yi[e]),role:e===`error`?`alert`:`status`,children:(0,D.jsxs)(`div`,{children:[t===void 0?null:(0,D.jsx)(`p`,{className:yi.title,children:t}),(0,D.jsx)(`p`,{className:yi.body,children:n})]})}),xi={field:`_field_i2e93_1`,label:`_label_i2e93_7`,input:`_input_i2e93_13`,invalid:`_invalid_i2e93_28`,error:`_error_i2e93_32`},Si=(0,n.forwardRef)(({label:e,error:t,className:r,...i},a)=>{let o=(0,n.useId)(),s=`${o}-error`,c=t!==void 0&&t.length>0;return(0,D.jsxs)(`div`,{className:xi.field,children:[(0,D.jsx)(`label`,{className:xi.label,htmlFor:o,children:e}),(0,D.jsx)(`input`,{id:o,ref:a,className:T(xi.input,c&&xi.invalid,r),"aria-invalid":c,"aria-describedby":c?s:void 0,...i}),c?(0,D.jsx)(`span`,{id:s,className:xi.error,children:t}):null]})});Si.displayName=`TextField`;var Ci={select:`_select_1yaeg_3`},wi=(0,n.forwardRef)(({className:e,children:t,...n},r)=>(0,D.jsx)(`select`,{ref:r,className:T(Ci.select,e),...n,children:t}));wi.displayName=`Select`;var Ti={iconButton:`_iconButton_2jhbr_1`,ghost:`_ghost_2jhbr_29`,danger:`_danger_2jhbr_33`},Ei=({label:e,variant:t=`ghost`,type:n=`button`,className:r,children:i,...a})=>(0,D.jsx)(`button`,{type:n,"aria-label":e,title:e,className:T(Ti.iconButton,Ti[t],r),...a,children:i});typeof window<`u`&&window.document&&window.document.createElement;function O(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Di(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Oi(...e){return t=>{let n=!1,r=e.map(e=>{let r=Di(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Di(e[t],null)}}}}function ki(...e){return n.useCallback(Oi(...e),e)}function Ai(e,t=[]){let r=[];function i(t,i){let a=n.createContext(i);a.displayName=t+`Context`;let o=r.length;r=[...r,i];let s=t=>{let{scope:r,children:i,...s}=t,c=r?.[e]?.[o]||a,l=n.useMemo(()=>s,Object.values(s));return(0,D.jsx)(c.Provider,{value:l,children:i})};s.displayName=t+`Provider`;function c(r,s){let c=s?.[e]?.[o]||a,l=n.useContext(c);if(l)return l;if(i!==void 0)return i;throw Error(`\`${r}\` must be used within \`${t}\``)}return[s,c]}let a=()=>{let t=r.map(e=>n.createContext(e));return function(r){let i=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:i}}),[r,i])}};return a.scopeName=e,[i,ji(a,...t)]}function ji(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let i=r.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Mi=globalThis?.document?n.useLayoutEffect:()=>{},Ni=n.useId||(()=>void 0),Pi=0;function Fi(e){let[t,r]=n.useState(Ni());return Mi(()=>{e||r(e=>e??String(Pi++))},[e]),e||(t?`radix-${t}`:``)}var Ii=n.useInsertionEffect||Mi;function Li({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){let[a,o,s]=Ri({defaultProp:t,onChange:r}),c=e!==void 0,l=c?e:a;{let t=n.useRef(e!==void 0);n.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${i} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,i])}return[l,n.useCallback(t=>{if(c){let n=zi(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}function Ri({defaultProp:e,onChange:t}){let[r,i]=n.useState(e),a=n.useRef(r),o=n.useRef(t);return Ii(()=>{o.current=t},[t]),n.useEffect(()=>{a.current!==r&&(o.current?.(r),a.current=r)},[r,a]),[r,i,o]}function zi(e){return typeof e==`function`}function Bi(e){let t=n.forwardRef((t,r)=>{let{children:i,...a}=t,o=null,s=!1,c=[];Ji(i)&&typeof Qi==`function`&&(i=Qi(i._payload)),n.Children.forEach(i,e=>{if(Ki(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ji(n)&&typeof Qi==`function`&&(n=Qi(n._payload)),o=Ui(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=n.cloneElement(o,void 0,c):!s&&n.Children.count(i)===1&&n.isValidElement(i)&&(o=i);let l=o?Gi(o):void 0,u=ki(r,l);if(!o){if(i||i===0)throw Error(s?Zi(e):Xi(e));return i}let d=Wi(a,o.props??{});return o.type!==n.Fragment&&(d.ref=r?u:l),n.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}var Vi=Symbol.for(`radix.slottable`);function Hi(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=Vi,t}var Ui=(e,t)=>{if(`child`in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null};function Wi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Gi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ki(e){return n.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Vi}var qi=Symbol.for(`react.lazy`);function Ji(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===qi&&`_payload`in e&&Yi(e._payload)}function Yi(e){return typeof e==`object`&&!!e&&`then`in e}var Xi=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Zi=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Qi=n.use,$i=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let r=Bi(`Primitive.${t}`),i=n.forwardRef((e,n)=>{let{asChild:i,...a}=e,o=i?r:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,D.jsx)(o,{...a,ref:n})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function ea(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}function ta(e){let t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>((...e)=>t.current?.(...e)),[])}function na(e,t=globalThis?.document){let r=ta(e);n.useEffect(()=>{let e=e=>{e.key===`Escape`&&r(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[r,t])}var ra=`DismissableLayer`,ia=`dismissableLayer.update`,aa=`dismissableLayer.pointerDownOutside`,oa=`dismissableLayer.focusOutside`,sa,ca=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),la=n.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=n.useContext(ca),[f,p]=n.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=n.useState({}),g=ki(t,e=>p(e)),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=_.indexOf(v),b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=n.useRef(!1),ee=pa(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...d.branches].some(e=>e.contains(t));!S||n||(o?.(e),c?.(e),e.defaultPrevented||l?.())},{ownerDocument:m,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces}),te=ma(e=>{if(i&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m);return na(e=>{b===d.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},m),n.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(sa=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ha(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=sa))}},[f,m,r,d]),n.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ha())},[f,d]),n.useEffect(()=>{let e=()=>h({});return document.addEventListener(ia,e),()=>document.removeEventListener(ia,e)},[]),(0,D.jsx)($i.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:O(e.onFocusCapture,te.onFocusCapture),onBlurCapture:O(e.onBlurCapture,te.onBlurCapture),onPointerDownCapture:O(e.onPointerDownCapture,ee.onPointerDownCapture)})});la.displayName=ra;var ua=`DismissableLayerBranch`,da=n.forwardRef((e,t)=>{let r=n.useContext(ca),i=n.useRef(null),a=ki(t,i);return n.useEffect(()=>{let e=i.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,D.jsx)($i.div,{...e,ref:a})});da.displayName=ua;function fa(){let e=n.useContext(ca),[t,r]=n.useState(null);return n.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}function pa(e,t){let{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:o}=t,s=ta(e),c=n.useRef(!1),l=n.useRef(!1),u=n.useRef(new Map),d=n.useRef(()=>{});return n.useEffect(()=>{function e(){l.current=!1,a.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function n(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function f(e){l.current&&u.current.set(e.type,!1)}let p=n=>{if(n.target&&!c.current){let o=function(){r.removeEventListener(`click`,d.current);let n=t();e(),n||ga(aa,s,c,{discrete:!0})},c={originalEvent:n};l.current=!0,a.current=i&&n.button===0,u.current.clear(),!i||n.button!==0?o():(r.removeEventListener(`click`,d.current),d.current=o,r.addEventListener(`click`,d.current,{once:!0}))}else r.removeEventListener(`click`,d.current),e();c.current=!1},m=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of m)r.addEventListener(e,n,!0),r.addEventListener(e,f);let h=window.setTimeout(()=>{r.addEventListener(`pointerdown`,p)},0);return()=>{window.clearTimeout(h),r.removeEventListener(`pointerdown`,p),r.removeEventListener(`click`,d.current);for(let e of m)r.removeEventListener(e,n,!0),r.removeEventListener(e,f)}},[r,s,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function ma(e,t=globalThis?.document){let r=ta(e),i=n.useRef(!1);return n.useEffect(()=>{let e=e=>{e.target&&!i.current&&ga(oa,r,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function ha(){let e=new CustomEvent(ia);document.dispatchEvent(e)}function ga(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ea(i,a):i.dispatchEvent(a)}var _a=`focusScope.autoFocusOnMount`,va=`focusScope.autoFocusOnUnmount`,ya={bubbles:!1,cancelable:!0},ba=`FocusScope`,xa=n.forwardRef((e,t)=>{let{loop:r=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=n.useState(null),u=ta(a),d=ta(o),f=n.useRef(null),p=ki(t,e=>l(e)),m=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(i){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:Oa(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||Oa(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Oa(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[i,c,m.paused]),n.useEffect(()=>{if(c){ka.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(_a,ya);c.addEventListener(_a,u),c.dispatchEvent(t),t.defaultPrevented||(Sa(Ma(wa(c)),{select:!0}),document.activeElement===e&&Oa(c))}return()=>{c.removeEventListener(_a,u),setTimeout(()=>{let t=new CustomEvent(va,ya);c.addEventListener(va,d),c.dispatchEvent(t),t.defaultPrevented||Oa(e??document.body,{select:!0}),c.removeEventListener(va,d),ka.remove(m)},0)}}},[c,u,d,m]);let h=n.useCallback(e=>{if(!r&&!i||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[i,a]=Ca(t);i&&a?!e.shiftKey&&n===a?(e.preventDefault(),r&&Oa(i,{select:!0})):e.shiftKey&&n===i&&(e.preventDefault(),r&&Oa(a,{select:!0})):n===t&&e.preventDefault()}},[r,i,m.paused]);return(0,D.jsx)($i.div,{tabIndex:-1,...s,ref:p,onKeyDown:h})});xa.displayName=ba;function Sa(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Oa(r,{select:t}),document.activeElement!==n)return}function Ca(e){let t=wa(e);return[Ta(t,e),Ta(t.reverse(),e)]}function wa(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ta(e,t){for(let n of e)if(!Ea(n,{upTo:t}))return n}function Ea(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Da(e){return e instanceof HTMLInputElement&&`select`in e}function Oa(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Da(e)&&t&&e.select()}}var ka=Aa();function Aa(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ja(e,t),e.unshift(t)},remove(t){e=ja(e,t),e[0]?.resume()}}}function ja(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ma(e){return e.filter(e=>e.tagName!==`A`)}var Na=`Portal`,Pa=n.forwardRef((e,t)=>{let{container:r,...a}=e,[o,s]=n.useState(!1);Mi(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?i.createPortal((0,D.jsx)($i.div,{...a,ref:t}),c):null});Pa.displayName=Na;function Fa(e,t){return n.useReducer((e,n)=>t[e][n]??e,e)}var Ia=e=>{let{present:t,children:r}=e,i=La(t),a=typeof r==`function`?r({present:i.isPresent}):n.Children.only(r),o=za(i.ref,Va(a));return typeof r==`function`||i.isPresent?n.cloneElement(a,{ref:o}):null};Ia.displayName=`Presence`;function La(e){let[t,r]=n.useState(),i=n.useRef(null),a=n.useRef(e),o=n.useRef(`none`),[s,c]=Fa(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return n.useEffect(()=>{let e=Ba(i.current);o.current=s===`mounted`?e:`none`},[s]),Mi(()=>{let t=i.current,n=a.current;if(n!==e){let r=o.current,i=Ba(t);e?c(`MOUNT`):i===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==i?`ANIMATION_OUT`:`UNMOUNT`),a.current=e}},[e,c]),Mi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,r=r=>{let o=Ba(i.current).includes(CSS.escape(r.animationName));if(r.target===t&&o&&(c(`ANIMATION_END`),!a.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(o.current=Ba(i.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,r),t.addEventListener(`animationend`,r),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,r),t.removeEventListener(`animationend`,r)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:n.useCallback(e=>{i.current=e?getComputedStyle(e):null,r(e)},[])}}function Ra(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function za(...e){let t=n.useRef(e);return t.current=e,n.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ra(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ra(n[e],null)}}},[])}function Ba(e){return e?.animationName||`none`}function Va(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ha=0,Ua=null;function Wa(){n.useEffect(()=>{Ua||={start:Ga(),end:Ga()};let{start:e,end:t}=Ua;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ha++,()=>{Ha===1&&(Ua?.start.remove(),Ua?.end.remove(),Ua=null),Ha=Math.max(0,Ha-1)}},[])}function Ga(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Ka=function(){return Ka=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ka.apply(this,arguments)};function qa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ja(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ya=`right-scroll-bar-position`,Xa=`width-before-scroll-bar`,Za=`with-scroll-bars-hidden`,Qa=`--removed-body-scroll-bar-size`;function $a(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function eo(e,n){var r=(0,t.useState)(function(){return{value:e,callback:n,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0];return r.callback=n,r.facade}var to=typeof window<`u`?t.useLayoutEffect:t.useEffect,no=new WeakMap;function ro(e,t){var n=eo(t||null,function(t){return e.forEach(function(e){return $a(e,t)})});return to(function(){var t=no.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$a(e,null)}),i.forEach(function(e){r.has(e)||$a(e,a)})}no.set(n,e)},[e]),n}function io(e){return e}function ao(e,t){t===void 0&&(t=io);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function oo(e){e===void 0&&(e={});var t=ao(null);return t.options=Ka({async:!0,ssr:!1},e),t}var so=function(e){var n=e.sideCar,r=qa(e,[`sideCar`]);if(!n)throw Error("Sidecar: please provide `sideCar` property to import the right car");var i=n.read();if(!i)throw Error(`Sidecar medium not found`);return t.createElement(i,Ka({},r))};so.isSideCarExport=!0;function co(e,t){return e.useMedium(t),so}var lo=oo(),uo=function(){},fo=t.forwardRef(function(e,n){var r=t.useRef(null),i=t.useState({onScrollCapture:uo,onWheelCapture:uo,onTouchMoveCapture:uo}),a=i[0],o=i[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=qa(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ro([r,n]),ee=Ka(Ka({},x),a);return t.createElement(t.Fragment,null,d&&t.createElement(S,{sideCar:lo,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:o,allowPinchZoom:!!_,lockRef:r,gapMode:b}),s?t.cloneElement(t.Children.only(c),Ka(Ka({},ee),{ref:C})):t.createElement(y,Ka({},ee,{className:l,ref:C}),c))});fo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},fo.classNames={fullWidth:Xa,zeroRight:Ya};var po,mo=function(){if(po)return po;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ho(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=mo();return t&&e.setAttribute(`nonce`,t),e}function go(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _o(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var vo=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ho())&&(go(t,n),_o(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yo=function(){var e=vo();return function(n,r){t.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&r])}},bo=function(){var e=yo();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},xo={left:0,top:0,right:0,gap:0},So=function(e){return parseInt(e||``,10)||0},Co=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[So(n),So(r),So(i)]},wo=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return xo;var t=Co(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},To=bo(),Eo=`data-scroll-locked`,Do=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
@@ -55,5 +55,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
55
55
  color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function vD(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var yD=(e,t)=>Math.abs(e-t)<1.01,bD=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},xD,SD=()=>{if(xD!==void 0)return xD;if(typeof navigator>`u`)return xD=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return xD=!0;let e=navigator.maxTouchPoints;return xD=navigator.platform===`MacIntel`&&e!==void 0&&e>0},CD=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},wD=e=>e,TD=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},ED=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(CD(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(CD(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},DD={passive:!0},OD=typeof window>`u`?!0:`onscrollend`in window,kD=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&OD,o=0,s=a?null:bD(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,DD),a&&r.addEventListener(`scrollend`,u,DD),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},AD=(e,t)=>kD(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),jD=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},MD=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},ND=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:wD,rangeExtractor:TD,onChange:()=>{},measureElement:jD,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=_D(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:process.env.NODE_ENV!==`production`&&`maybeNotify`,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{t&&this._intendedScrollOffset===null&&e===this.scrollOffset||(this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify())})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!SD()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,DD),e.addEventListener(`touchend`,n,DD),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(SD()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=_D(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=_D(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=gD(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!==`production`&&`getMeasurements`,debug:()=>this.options.debug}),this.calculateRange=_D(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?FD({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:process.env.NODE_ENV!==`production`&&`calculateRange`,debug:()=>this.options.debug}),this.getVirtualIndexes=_D(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:process.env.NODE_ENV!==`production`&&`getVirtualIndexes`,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=_D(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:process.env.NODE_ENV!==`production`&&`getVirtualItems`,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return vD(t[PD(0,t.length-1,r?e=>n[e*2]:e=>vD(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(process.env.NODE_ENV!==`production`&&this.options.debug&&console.info(`correction`,e),SD()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&yD(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},PD=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function FD({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=PD(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}var ID=typeof document<`u`?n.useLayoutEffect:n.useEffect;function LD({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:r=`transform`,...a}){let o=n.useReducer(e=>e+1,0)[1],s=n.useRef({enabled:t,mode:r,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});s.current.enabled=t,s.current.mode=r;let c=e=>{let t=s.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,a=r?`left`:`top`,o=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let s=n.start-o,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==s&&(t.lastPositions.set(c,s),i?c.style.transform=r?`translate3d(${s}px, 0, 0)`:`translate3d(0, ${s}px, 0)`:c.style[a]=`${s}px`)}},l={...a,onChange:(t,n)=>{var r;let l=s.current,u=!0;if(l.enabled){c(t);let e=t.range,n=l.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(l.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n?(0,i.flushSync)(o):o()),(r=a.onChange)==null||r.call(a,t,n)}},[u]=n.useState(()=>{let e=new ND(l);return Object.assign(e,{containerRef:t=>{let n=s.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return u.setOptions(l),ID(()=>u._didMount(),[]),ID(()=>u._willUpdate()),ID(()=>{c(u)}),u}function RD(e){return LD({observeElementRect:ED,observeElementOffset:AD,scrollToFn:MD,...e})}var zD=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`get-availability`)}async execute(){let e=await this.scheduleGateway.getAvailability();return e.ok||this.logger.warn(`Loading availability failed`,{code:e.error.code}),e}},BD=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`get-effective-availability`)}async execute(){let e=await this.scheduleGateway.getEffectiveAvailability();return e.ok||this.logger.warn(`Loading effective availability failed`,{code:e.error.code}),e}},M=e=>({ok:!0,value:e}),N=e=>({ok:!1,error:e}),VD=e=>e.ok,HD=e=>!e.ok,UD=e=>{if(HD(e))throw e.error;return e.value},P=async e=>UD(await e),WD=class extends ui{code=`INVALID_EMAIL`;constructor(e){super(`"${e}" is not a valid email address.`,{context:{value:e}})}},GD=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,KD=class e{value;constructor(e){this.value=e}static create(t){let n=t.trim().toLowerCase();return GD.test(n)?M(new e(n)):N(new WD(t))}equals(e){return this.value===e.value}toString(){return this.value}},qD=[{id:`mon`,short:`Mon`,long:`Monday`},{id:`tue`,short:`Tue`,long:`Tuesday`},{id:`wed`,short:`Wed`,long:`Wednesday`},{id:`thu`,short:`Thu`,long:`Thursday`},{id:`fri`,short:`Fri`,long:`Friday`},{id:`sat`,short:`Sat`,long:`Saturday`},{id:`sun`,short:`Sun`,long:`Sunday`}],JD=class extends ui{code=`INVALID_TIME`;constructor(e){super(`"${e}" is not a valid 24-hour time.`,{context:{value:e}})}},YD=/^([01]\d|2[0-3]):([0-5]\d)$/,XD=60,ZD=class e{minutes;normalized;constructor(e,t){this.minutes=e,this.normalized=t}static create(t){let n=YD.exec(t.trim());if(n===null)return N(new JD(t));let r=Number(n[1]),i=Number(n[2]);return M(new e(r*XD+i,`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`))}get minutesSinceMidnight(){return this.minutes}get value(){return this.normalized}equals(e){return this.minutes===e.minutes}isBefore(e){return this.minutes<e.minutes}isAfter(e){return this.minutes>e.minutes}toString(){return this.normalized}},QD=class e{start;end;constructor(e,t){this.start=e,this.end=t}static create(t,n){let r=ZD.create(t);if(!r.ok)return r;let i=ZD.create(n);return i.ok?t===n?N(new JD(`${t}–${n}`)):M(new e(r.value,i.value)):i}get from(){return this.start}get to(){return this.end}get minutes(){let e=this.end.minutesSinceMidnight-this.start.minutesSinceMidnight;return e<0?e+1440:e}},$D=class extends ui{},eO=class extends $D{code=`SCHEDULE_UNAVAILABLE`;constructor(e){super(`Your schedule is currently unavailable. Please try again.`,{cause:e})}},tO=class extends $D{code=`SCHEDULE_INVALID_AVAILABILITY`;constructor(){super(`Each working day must end after it starts.`)}},nO=class extends $D{code=`SCHEDULE_INVALID_BLOCK`;constructor(e=`Give the block a title and an end time after its start.`){super(e)}},rO=class extends $D{code=`SCHEDULE_BLOCK_NOT_FOUND`;constructor(){super(`That schedule block no longer exists.`)}},iO=e=>{let t=new Date(e);return t.getHours()*60+t.getMinutes()},aO=(e,t)=>Math.max(0,Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)),oO=(e,t)=>new Date(t).getTime()>new Date(e).getTime(),sO=e=>(new Date(e).getDay()+6)%7,cO=e=>{let t=typeof e==`string`?new Date(e):e;return`${String(t.getFullYear())}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`},lO=e=>{let t={mon:{active:e.mon.active,slots:[]},tue:{active:e.tue.active,slots:[]},wed:{active:e.wed.active,slots:[]},thu:{active:e.thu.active,slots:[]},fri:{active:e.fri.active,slots:[]},sat:{active:e.sat.active,slots:[]},sun:{active:e.sun.active,slots:[]}},n=e=>qD[(e+1)%7]?.id??`mon`;qD.forEach((r,i)=>{let a=e[r.id].slots,o=t[r.id].slots;for(let e of a)if(e.from>e.to&&e.from!==e.to){if(o.push({id:e.id,from:e.from,to:`23:59`}),e.to>`00:00`){let r=n(i),a=t[r].slots;a.push({id:crypto.randomUUID(),from:`00:00`,to:e.to}),t[r]={active:!0,slots:a}}}else o.push({...e})});for(let e of qD)t[e.id].slots.sort((e,t)=>e.from.localeCompare(t.from));return t},uO={mon:{active:!0,slots:[{id:`default-mon-1`,from:`09:00`,to:`17:00`}]},tue:{active:!0,slots:[{id:`default-tue-1`,from:`09:00`,to:`17:00`}]},wed:{active:!0,slots:[{id:`default-wed-1`,from:`09:00`,to:`17:00`}]},thu:{active:!0,slots:[{id:`default-thu-1`,from:`09:00`,to:`17:00`}]},fri:{active:!0,slots:[{id:`default-fri-1`,from:`09:00`,to:`17:00`}]},sat:{active:!1,slots:[{id:`default-sat-1`,from:`10:00`,to:`14:00`}]},sun:{active:!1,slots:[{id:`default-sun-1`,from:`10:00`,to:`14:00`}]}},dO=qD.map(e=>e.id),fO=e=>dO[(e.getDay()+6)%7]??`mon`,pO=(e,t)=>e??t??uO,mO=(e,t)=>e[fO(t)],hO=1500,gO=(e,t)=>new Date(e,t+1,0).getDate(),_O=e=>Math.min(5,Math.ceil(e.getDate()/7)),vO=(e,t,n,r)=>{if(n===5){let n=gO(e,t),i=new Date(e,t,n);return new Date(e,t,n-(i.getDay()-r+7)%7)}let i=1+(r-new Date(e,t,1).getDay()+7)%7+(n-1)*7;return i>gO(e,t)?null:new Date(e,t,i)},yO=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),bO=(e,t,n)=>{let r=[],i=yO(e),a=Math.max(1,t);for(;i<=n&&r.length<1500;)r.push(new Date(i)),i.setDate(i.getDate()+a);return r},xO=(e,t,n)=>{let r=Math.max(1,t.interval),i=(t.weekdays.length>0?[...t.weekdays]:[e.getDay()]).sort((e,t)=>e-t),a=yO(e);a.setDate(a.getDate()-a.getDay());let o=[];for(let e=0;o.length<hO;e+=r){let t=new Date(a);if(t.setDate(t.getDate()+e*7),t>n)break;for(let e of i){let r=new Date(t);r.setDate(r.getDate()+e),r<=n&&o.push(r)}}return o},SO=(e,t,n,r)=>t.monthlyMode===`dayOfMonth`?new Date(n,r,Math.min(e.getDate(),gO(n,r))):vO(n,r,_O(e),e.getDay()),CO=(e,t,n,r)=>{let i=[],a=Math.max(1,t.interval),o=r?12*a:a;for(let r=0;r<600&&i.length<1500;r+=1){let a=e.getMonth()+r*o,s=e.getFullYear()+Math.floor(a/12),c=(a%12+12)%12;if(new Date(s,c,1)>n&&r>0)break;let l=SO(e,t,s,c);l&&l<=n&&i.push(l)}return i},wO=(e,t,n)=>{switch(t.freq){case`daily`:return bO(e,t.interval,n);case`weekly`:return xO(e,t,n);case`monthly`:return CO(e,t,n,!1);case`yearly`:return CO(e,t,n,!0)}},TO=[{id:`daily`,label:`Daily`},{id:`weekly`,label:`Weekly`},{id:`monthly`,label:`Monthly`},{id:`yearly`,label:`Yearly`}],EO=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],DO=[`first`,`second`,`third`,`fourth`,`last`],OO=e=>({freq:`weekly`,interval:1,weekdays:[new Date(e).getDay()],monthlyMode:`dayOfMonth`,endType:`never`,endCount:13,endDate:``,exceptions:[]}),kO=e=>e.endType===`on`&&e.endDate!==``?new Date(`${e.endDate}T23:59:59`):null,AO=(e,t,n)=>{let[r,i]=t.split(`:`),[a,o]=n.split(`:`);return{start:new Date(e.getFullYear(),e.getMonth(),e.getDate(),Number(r??`0`),Number(i??`0`),0,0),end:new Date(e.getFullYear(),e.getMonth(),e.getDate(),Number(a??`0`),Number(o??`0`),0,0)}},jO=({day:e,rec:t,endDate:n,exceptions:r,range:i,count:a,out:o})=>{let s=a,c=e.getDay(),l=t.weekdayTimes?.[c];if(!l||l.length===0)return{count:s,broken:!1};for(let a of l){let{start:c,end:l}=AO(e,a.start,a.end);if(n!==null&&c>n)return{count:s,broken:!0};if(!r.has(cO(c))){if(s+=1,t.endType===`after`&&s>t.endCount)return{count:s,broken:!0};c>=i.start&&c<=i.end&&o.push({start:c.toISOString(),end:l.toISOString()})}}return{count:s,broken:!1}},MO=(e,t)=>{if(!t.differentTimes||!t.weekdayTimes)return!1;let n=t.weekdayTimes[e.getDay()];return n!==void 0&&n.length>0},NO=({day:e,base:t,dur:n,rec:r,endDate:i,exceptions:a,range:o,count:s,out:c})=>{if(MO(e,r))return jO({day:e,rec:r,endDate:i,exceptions:a,range:o,count:s,out:c});let l=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),0,0);if(l<t)return{count:s,broken:!1};if(i!==null&&l>i)return{count:s,broken:!0};if(a.has(cO(l)))return{count:s,broken:!1};let u=s+1;return r.endType===`after`&&u>r.endCount?{count:u,broken:!0}:(l>=o.start&&l<=o.end&&c.push({start:l.toISOString(),end:new Date(l.getTime()+n).toISOString()}),{count:u,broken:!1})},PO=(e,t,n,r)=>{let i=kO(n),a=new Set(n.exceptions),o=[],s=0;for(let c of wO(e,n,r.end)){let l=NO({day:c,base:e,dur:t,rec:n,endDate:i,exceptions:a,range:r,count:s,out:o});if(s=l.count,l.broken)break}return o},FO=(e,t,n)=>{let r=new Date(e.start);return e.recurrence===null?r>=t&&r<=n?[{start:e.start,end:e.end}]:[]:PO(r,new Date(e.end).getTime()-r.getTime(),e.recurrence,{start:t,end:n})},IO=(e,t,n)=>{let r=Math.max(0,new Date(e.end).getTime()-new Date(e.start).getTime()),i=new Date(t.getTime()-r),a=t.getTime(),o=n.getTime();return FO(e,i,n).filter(e=>{let t=new Date(e.start).getTime(),n=new Date(e.end).getTime();return t<=o&&n>a})},LO=e=>{let t={daily:`day`,weekly:`week`,monthly:`month`,yearly:`year`}[e.freq];return e.interval>1?`every ${String(e.interval)} ${t}s`:`every ${t}`},RO=(e,t)=>e.freq===`weekly`?` on ${(e.weekdays.length>0?[...e.weekdays]:[t.getDay()]).sort((e,t)=>e-t).map(e=>EO[e]).join(`, `)}`:e.freq===`monthly`||e.freq===`yearly`?e.monthlyMode===`nthWeekday`?` on the ${DO[_O(t)-1]??`first`} ${EO[t.getDay()]??``}`:` on day ${String(t.getDate())}`:``,zO=e=>e.endType===`after`?`, ${String(e.endCount)} times`:e.endType===`on`&&e.endDate!==``?`, until ${new Date(`${e.endDate}T00:00:00`).toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`})}`:``,BO=(e,t)=>{if(e.differentTimes){let n=RO(e,new Date(t));return`${LO(e)}${n} with different times per day${zO(e)}`}return`${LO(e)}${RO(e,new Date(t))}${zO(e)}`},VO=class{id;userId;title;status;start;end;allDay;notes;recurrence;constructor(e){this.id=e.id,this.userId=e.userId,this.title=e.title,this.status=e.status,this.start=e.start,this.end=e.end,this.allDay=e.allDay,this.notes=e.notes,this.recurrence=e.recurrence}get durationMinutes(){return aO(this.start,this.end)}get isRecurring(){return this.recurrence!==null}get hasNotes(){return this.notes.trim().length>0}},HO=e=>{let t=e.title.trim();if(t.length===0)return N(new nO(`Give the block a title.`));if(!oO(e.start,e.end))return N(new nO(`The block must end after it starts.`));let n=e.allDay?26:24;return aO(e.start,e.end)>n*60?N(new nO(`A single block can't span more than ${String(n)} hours. Use a recurring block for events that repeat across days.`)):M({...e,title:t})},UO=[15,30,45,60],WO=[0,5,10,15],GO=[`Europe/London`,`America/New_York`,`America/Los_Angeles`,`Asia/Dhaka`,`Europe/Bucharest`,`Asia/Dubai`],KO=[{id:`available`,label:`Available`},{id:`busy`,label:`Busy`},{id:`meeting`,label:`Meeting`},{id:`focus`,label:`Focus`},{id:`away`,label:`Away`}],qO=e=>Math.round(e*10)/10,JO=(e,t)=>qO(e.filter(e=>!e.block.allDay&&e.block.status===t).reduce((e,t)=>e+aO(t.start,t.end),0)/60),YO=(e,t)=>{let n=cO(t),r=e.filter(e=>e.date===n);return{busyHours:JO(r,`busy`),meetingCount:r.filter(e=>!e.block.allDay&&e.block.status===`meeting`).length,focusHours:JO(r,`focus`)}},XO=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0),ZO=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t,0,0,0,0),QO=(e,t,n)=>{let r=[],i=new Date(t.start).getTime(),a=new Date(t.end).getTime(),o=cO(t.start),s=XO(new Date(t.start)),c=!0;s.getTime()<n.start.getTime()&&(s=XO(n.start),c=!1);for(let l=0;s.getTime()<a&&s.getTime()<=n.end.getTime()&&l<400;l+=1){let l=ZO(s,1),u=Math.max(i,s.getTime()),d=Math.min(a,l.getTime());if(d>u&&s.getTime()>=n.start.getTime()){let n=cO(s),l=u===i?t.start:new Date(u).toISOString(),f=d===a?t.end:new Date(d).toISOString(),p=u>i,m=d<a;r.push({key:c?`${e.id}@${o}`:`${e.id}@${o}+${n}`,block:e,dayIndex:sO(l),date:n,start:l,end:f,...p?{continuesFromPrevDay:!0}:{},...m?{continuesToNextDay:!0}:{}})}c=!1,s=l}return r},$O=(e,t,n)=>{let r=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0),i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59,999),a=[];for(let e of n)for(let t of IO(e,r,i))for(let n of QO(e,t,{start:r,end:i}))a.push(n);return a},ek=(e,t)=>{let n=t[0],r=t[6];return n===void 0||r===void 0?[]:$O(n,r,e)},tk=e=>{let[t,n]=e.split(`:`);return Number(t??`0`)*60+Number(n??`0`)},nk=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`save-availability`)}async execute(e){return e!==null&&qD.some(t=>{let n=e[t.id];if(!n.active||n.slots.length===0)return!1;if(n.slots.some(e=>{let t=QD.create(e.from,e.to);return!t.ok||t.value.from.minutesSinceMidnight>=t.value.to.minutesSinceMidnight}))return!0;let r=[...n.slots].sort((e,t)=>e.from.localeCompare(t.from)),i=``;for(let e of r){if(e.from<i)return!0;i=e.to}return!1})?(this.logger.warn(`Rejected invalid availability`),N(new tO)):this.scheduleGateway.saveAvailability(e)}},rk=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`list-schedule-blocks`)}async execute(){let e=await this.scheduleGateway.listBlocks();return e.ok||this.logger.warn(`Listing schedule blocks failed`,{code:e.error.code}),e}},ik=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`create-schedule-block`)}async execute(e){let t=HO(e);return HD(t)?(this.logger.warn(`Rejected invalid block`,{code:t.error.code}),N(t.error)):this.scheduleGateway.createBlock(t.value)}},ak=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`update-schedule-block`)}async execute({id:e,draft:t}){let n=HO(t);return HD(n)?(this.logger.warn(`Rejected invalid block edit`,{code:n.error.code}),N(n.error)):this.scheduleGateway.updateBlock(e,n.value)}},ok=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`delete-schedule-block`)}async execute(e){let t=await this.scheduleGateway.deleteBlock(e);return t.ok||this.logger.warn(`Deleting schedule block failed`,{code:t.error.code}),t}},sk=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`get-preferences`)}async execute(){let e=await this.scheduleGateway.getPreferences();return e.ok||this.logger.warn(`Loading preferences failed`,{code:e.error.code}),e}},ck=class{scheduleGateway;logger;constructor(e){this.scheduleGateway=e.scheduleGateway,this.logger=e.logger.child(`save-preferences`)}async execute(e){let t=await this.scheduleGateway.savePreferences(e);return t.ok||this.logger.warn(`Saving preferences failed`,{code:t.error.code}),t}},lk=class extends li{code=`HTTP`;status;statusText;url;body;retryAfterMs;constructor(e){super(`HTTP ${String(e.status)} ${e.statusText} for ${e.url}`,{context:{status:e.status,url:e.url}}),this.status=e.status,this.statusText=e.statusText,this.url=e.url,this.body=e.body,this.retryAfterMs=e.retryAfterMs}isUnauthorized(){return this.status===401}isForbidden(){return this.status===403}isNotFound(){return this.status===404}isConflict(){return this.status===409}isTooManyRequests(){return this.status===429}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500&&this.status<600}},uk=class extends li{code=`NETWORK`;constructor(e,t){super(`Network request to ${e} failed`,{cause:t,context:{url:e}})}},dk=class{baseUrl;logger;getAuthToken;constructor(e){this.baseUrl=e.baseUrl,this.logger=e.logger.child(`http`),this.getAuthToken=e.getAuthToken}get(e,t){return this.send(`GET`,e,void 0,t)}async getBlob(e,t){let n=this.buildUrl(e,t?.query),r={method:`GET`,headers:this.buildHeaders(void 0,t),redirect:`error`};t?.signal!==void 0&&(r.signal=t.signal);let i;try{i=await fetch(n,r)}catch(e){throw this.logger.error(`Blob request failed before a response was received`,e,{url:n}),new uk(n,e)}if(!i.ok)throw this.logger.warn(`Blob request returned a non-2xx status`,{url:n,status:i.status}),new lk({status:i.status,statusText:i.statusText,url:n,body:void 0,retryAfterMs:this.parseRetryAfter(i.headers.get(`Retry-After`))});return i.blob()}post(e,t,n){return this.send(`POST`,e,this.jsonBody(t),n)}put(e,t,n){return this.send(`PUT`,e,this.jsonBody(t),n)}patch(e,t,n){return this.send(`PATCH`,e,this.jsonBody(t),n)}delete(e,t){return this.send(`DELETE`,e,void 0,t)}postForm(e,t,n){let r=new URLSearchParams(t).toString();return this.send(`POST`,e,{body:r,contentType:fk},n)}jsonBody(e){if(e!==void 0)return e instanceof FormData?{body:e,contentType:null}:{body:JSON.stringify(e),contentType:`application/json`}}async send(e,t,n,r){let i=this.buildUrl(t,r?.query),a=this.buildHeaders(n,r);n?.body instanceof FormData&&a.delete(`Content-Type`);let o={method:e,headers:a};n!==void 0&&(o.body=n.body),r?.signal!==void 0&&(o.signal=r.signal);let s;try{s=await fetch(i,o)}catch(e){throw this.logger.error(`Request failed before a response was received`,e,{url:i}),new uk(i,e)}return this.handleResponse(s,i)}async handleResponse(e,t){let n=await this.readBody(e);if(!e.ok){this.logger.warn(`Request returned a non-2xx status`,{url:t,status:e.status});let r=this.parseRetryAfter(e.headers.get(`Retry-After`));throw new lk({status:e.status,statusText:e.statusText,url:t,body:n,retryAfterMs:r})}return n}parseRetryAfter(e){if(e===null||e.length===0)return null;let t=Number(e);if(!Number.isNaN(t))return t>=0?t*1e3:null;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async readBody(e){if(e.status===204||e.status===205)return;let t=await e.text();if(t.length!==0){if(!(e.headers.get(`content-type`)??``).includes(`application/json`))return t;try{return JSON.parse(t)}catch(t){throw new uk(e.url,t)}}}buildHeaders(e,t){let n=new Headers({Accept:`application/json`,...t?.headers});if(e&&e.contentType!==null&&n.set(`Content-Type`,e.contentType),!t?.anonymous){let e=this.getAuthToken();e&&n.set(`Authorization`,`Bearer ${e}`)}return n}buildUrl(e,t){let n=e.startsWith(`http://`)||e.startsWith(`https://`)?e:`${this.baseUrl}${e.startsWith(`/`)?e:`/${e}`}`,r=new URL(n);return t&&this.appendQuery(r,t),r.toString()}appendQuery(e,t){for(let[n,r]of Object.entries(t))if(r!==void 0)if(Array.isArray(r))for(let t of r)e.searchParams.append(n,String(t));else e.searchParams.set(n,String(r))}},fk=`application/x-www-form-urlencoded`,pk=class{inner;timeoutMs;logger;constructor(e,t){this.inner=e,this.timeoutMs=t.timeoutMs,this.logger=t.logger.child(`http-timeout`)}get(e,t){return this.withTimeout(t=>this.inner.get(e,t),t)}getBlob(e,t){return this.withTimeout(t=>this.inner.getBlob(e,t),t)}post(e,t,n){return this.withTimeout(n=>this.inner.post(e,t,n),n)}put(e,t,n){return this.withTimeout(n=>this.inner.put(e,t,n),n)}patch(e,t,n){return this.withTimeout(n=>this.inner.patch(e,t,n),n)}delete(e,t){return this.withTimeout(t=>this.inner.delete(e,t),t)}postForm(e,t,n){return this.withTimeout(n=>this.inner.postForm(e,t,n),n)}async withTimeout(e,t){let n=new AbortController,r=setTimeout(()=>{this.logger.warn(`Request exceeded timeout; aborting`,{timeoutMs:this.timeoutMs}),n.abort(new DOMException(`Request timed out`,`TimeoutError`))},this.timeoutMs),i=[n.signal];t?.signal!==void 0&&i.push(t.signal);let a=AbortSignal.any(i);try{return await e({...t,signal:a})}finally{clearTimeout(r)}}},mk=2,hk=300,gk=5e3,_k=class{inner;maxRetries;baseDelayMs;maxDelayMs;logger;constructor(e,t){this.inner=e,this.maxRetries=t.maxRetries??mk,this.baseDelayMs=t.baseDelayMs??hk,this.maxDelayMs=t.maxDelayMs??gk,this.logger=t.logger.child(`http-retry`)}get(e,t){return this.withRetry(()=>this.inner.get(e,t),t)}getBlob(e,t){return this.withRetry(()=>this.inner.getBlob(e,t),t)}post(e,t,n){return this.inner.post(e,t,n)}put(e,t,n){return this.inner.put(e,t,n)}patch(e,t,n){return this.inner.patch(e,t,n)}delete(e,t){return this.inner.delete(e,t)}postForm(e,t,n){return this.inner.postForm(e,t,n)}async withRetry(e,t){let n=0;for(;;)try{return await e()}catch(e){if(n+=1,n>this.maxRetries||!this.isRetryable(e)||t?.signal?.aborted===!0)throw e;let r=this.computeDelay(e,n);this.logger.warn(`Request failed; retrying`,{attempt:n,delay:r}),await this.sleep(r,t?.signal)}}isRetryable(e){return e instanceof uk?!0:e instanceof lk?e.status===429||e.status===503||e.status>=500:!1}computeDelay(e,t){return e instanceof lk&&e.retryAfterMs!==null?Math.min(e.retryAfterMs,this.maxDelayMs):Math.min(this.maxDelayMs,this.baseDelayMs*2**(t-1))*(.5+Math.random()*.5)}sleep(e,t){return new Promise(n=>{let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{t?.removeEventListener(`abort`,r),n()},e);t!==void 0&&t.addEventListener(`abort`,r,{once:!0})})}},vk=class{inner;refresh;logger;inFlightRefresh=null;constructor(e,t){this.inner=e,this.refresh=t.refresh,this.logger=t.logger.child(`http-auth-refresh`)}get(e,t){return this.withRefresh(t=>this.inner.get(e,t),t)}getBlob(e,t){return this.withRefresh(t=>this.inner.getBlob(e,t),t)}post(e,t,n){return this.withRefresh(n=>this.inner.post(e,t,n),n)}put(e,t,n){return this.withRefresh(n=>this.inner.put(e,t,n),n)}patch(e,t,n){return this.withRefresh(n=>this.inner.patch(e,t,n),n)}delete(e,t){return this.withRefresh(t=>this.inner.delete(e,t),t)}postForm(e,t,n){return this.withRefresh(n=>this.inner.postForm(e,t,n),n)}async withRefresh(e,t){try{return await e(t)}catch(n){if(t?.anonymous===!0||!(n instanceof lk)||n.status!==401||!await this.refreshOnce())throw n;return e(t)}}refreshOnce(){return this.inFlightRefresh??=this.runRefresh(),this.inFlightRefresh}async runRefresh(){try{return await this.refresh()}catch(e){return this.logger.warn(`Token refresh threw; treating as failed`,{error:e instanceof Error?e.message:String(e)}),!1}finally{this.inFlightRefresh=null}}},yk={debug:10,info:20,warn:30,error:40,silent:100},bk=class e{minLevel;scope;minWeight;constructor(e,t){this.minLevel=e,this.scope=t,this.minWeight=yk[e]}debug(e,t){this.write(`debug`,console.debug,e,t)}info(e,t){this.write(`info`,console.info,e,t)}warn(e,t){this.write(`warn`,console.warn,e,t)}error(e,t,n){this.minWeight>yk.error||console.error(this.format(e),{error:t,...n})}child(t){let n=this.scope?`${this.scope}:${t}`:t;return new e(this.minLevel,n)}write(e,t,n,r){this.minWeight>yk[e]||(r?t(this.format(n),r):t(this.format(n)))}format(e){return this.scope?`[${this.scope}] ${e}`:e}},xk;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(xk||={});var Sk;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Sk||={});var F=xk.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Ck=e=>{switch(typeof e){case`undefined`:return F.undefined;case`string`:return F.string;case`number`:return Number.isNaN(e)?F.nan:F.number;case`boolean`:return F.boolean;case`function`:return F.function;case`bigint`:return F.bigint;case`symbol`:return F.symbol;case`object`:return Array.isArray(e)?F.array:e===null?F.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?F.promise:typeof Map<`u`&&e instanceof Map?F.map:typeof Set<`u`&&e instanceof Set?F.set:typeof Date<`u`&&e instanceof Date?F.date:F.object;default:return F.unknown}},I=xk.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),wk=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,xk.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};wk.create=e=>new wk(e);var Tk=(e,t)=>{let n;switch(e.code){case I.invalid_type:n=e.received===F.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,xk.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${xk.joinValues(e.keys,`, `)}`;break;case I.invalid_union:n=`Invalid input`;break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${xk.joinValues(e.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${xk.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:n=`Invalid function arguments`;break;case I.invalid_return_type:n=`Invalid function return type`;break;case I.invalid_date:n=`Invalid date`;break;case I.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:xk.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case I.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case I.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case I.custom:n=`Invalid input`;break;case I.invalid_intersection_types:n=`Intersection results could not be merged`;break;case I.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,xk.assertNever(e)}return{message:n}},Ek=Tk;function Dk(){return Ek}var Ok=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function L(e,t){let n=Dk(),r=Ok({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Tk?void 0:Tk].filter(e=>!!e)});e.common.issues.push(r)}var kk=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return R;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return R;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},R=Object.freeze({status:`aborted`}),Ak=e=>({status:`dirty`,value:e}),jk=e=>({status:`valid`,value:e}),Mk=e=>e.status===`aborted`,Nk=e=>e.status===`dirty`,Pk=e=>e.status===`valid`,Fk=e=>typeof Promise<`u`&&e instanceof Promise,z;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(z||={});var Ik=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Lk=(e,t)=>{if(Pk(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new wk(e.common.issues);return this._error=t,this._error}}};function Rk(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var zk=class{get description(){return this._def.description}_getType(e){return Ck(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ck(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new kk,ctx:{common:e.parent.common,data:e.data,parsedType:Ck(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Fk(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ck(e)};return Lk(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ck(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Pk(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Pk(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ck(e)},r=this._parse({data:e,path:n.path,parent:n});return Lk(n,await(Fk(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:I.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new HA({schema:this,typeName:B.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return UA.create(this,this._def)}nullable(){return WA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return CA.create(this)}promise(){return VA.create(this,this._def)}or(e){return EA.create([this,e],this._def)}and(e){return AA.create(this,e,this._def)}transform(e){return new HA({...Rk(this._def),schema:this,typeName:B.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new GA({...Rk(this._def),innerType:this,defaultValue:t,typeName:B.ZodDefault})}brand(){return new JA({typeName:B.ZodBranded,type:this,...Rk(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new KA({...Rk(this._def),innerType:this,catchValue:t,typeName:B.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return YA.create(this,e)}readonly(){return XA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Bk=/^c[^\s-]{8,}$/i,Vk=/^[0-9a-z]+$/,Hk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Uk=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Wk=/^[a-z0-9_-]{21}$/i,Gk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Kk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jk=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Yk,Xk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Qk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$k=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nA=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,rA=RegExp(`^${nA}$`);function iA(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function aA(e){return RegExp(`^${iA(e)}$`)}function oA(e){let t=`${nA}T${iA(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function sA(e,t){return!!((t===`v4`||!t)&&Xk.test(e)||(t===`v6`||!t)&&Qk.test(e))}function cA(e,t){if(!Gk.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function lA(e,t){return!!((t===`v4`||!t)&&Zk.test(e)||(t===`v6`||!t)&&$k.test(e))}var uA=class e extends zk{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==F.string){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.string,received:t.parsedType}),R}let t=new kk,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),L(n,{code:I.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),L(n,{code:I.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?L(n,{code:I.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&L(n,{code:I.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)qk.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`email`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Yk||=new RegExp(Jk,`u`),Yk.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`emoji`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Uk.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`uuid`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Wk.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`nanoid`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Bk.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`cuid`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Vk.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`cuid2`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Hk.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`ulid`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),L(n,{validation:`url`,code:I.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`regex`,code:I.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?oA(r).test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?rA.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?aA(r).test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Kk.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`duration`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?sA(e.data,r.version)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`ip`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?cA(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`jwt`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?lA(e.data,r.version)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`cidr`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?eA.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`base64`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?tA.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`base64url`,code:I.invalid_string,message:r.message}),t.dirty()):xk.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:I.invalid_string,...z.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...z.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...z.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...z.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...z.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...z.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...z.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...z.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...z.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...z.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...z.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...z.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...z.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...z.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...z.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...z.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...z.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...z.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...z.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...z.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...z.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...z.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...z.errToObj(t)})}nonempty(e){return this.min(1,z.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};uA.create=e=>new uA({checks:[],typeName:B.ZodString,coerce:e?.coerce??!1,...Rk(e)});function dA(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var fA=class e extends zk{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==F.number){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.number,received:t.parsedType}),R}let t,n=new kk;for(let r of this._def.checks)r.kind===`int`?xk.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),L(t,{code:I.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),L(t,{code:I.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),L(t,{code:I.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?dA(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),L(t,{code:I.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),L(t,{code:I.not_finite,message:r.message}),n.dirty()):xk.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,z.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,z.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,z.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,z.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:z.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:z.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:z.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:z.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:z.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:z.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&xk.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};fA.create=e=>new fA({checks:[],typeName:B.ZodNumber,coerce:e?.coerce||!1,...Rk(e)});var pA=class e extends zk{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==F.bigint)return this._getInvalidInput(e);let t,n=new kk;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),L(t,{code:I.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),L(t,{code:I.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),L(t,{code:I.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):xk.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.bigint,received:t.parsedType}),R}gte(e,t){return this.setLimit(`min`,e,!0,z.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,z.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,z.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,z.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:z.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:z.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};pA.create=e=>new pA({checks:[],typeName:B.ZodBigInt,coerce:e?.coerce??!1,...Rk(e)});var mA=class extends zk{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==F.boolean){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.boolean,received:t.parsedType}),R}return jk(e.data)}};mA.create=e=>new mA({typeName:B.ZodBoolean,coerce:e?.coerce||!1,...Rk(e)});var hA=class e extends zk{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==F.date){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.date,received:t.parsedType}),R}if(Number.isNaN(e.data.getTime()))return L(this._getOrReturnCtx(e),{code:I.invalid_date}),R;let t=new kk,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),L(n,{code:I.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),L(n,{code:I.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):xk.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:z.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:z.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};hA.create=e=>new hA({checks:[],coerce:e?.coerce||!1,typeName:B.ZodDate,...Rk(e)});var gA=class extends zk{_parse(e){if(this._getType(e)!==F.symbol){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.symbol,received:t.parsedType}),R}return jk(e.data)}};gA.create=e=>new gA({typeName:B.ZodSymbol,...Rk(e)});var _A=class extends zk{_parse(e){if(this._getType(e)!==F.undefined){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.undefined,received:t.parsedType}),R}return jk(e.data)}};_A.create=e=>new _A({typeName:B.ZodUndefined,...Rk(e)});var vA=class extends zk{_parse(e){if(this._getType(e)!==F.null){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.null,received:t.parsedType}),R}return jk(e.data)}};vA.create=e=>new vA({typeName:B.ZodNull,...Rk(e)});var yA=class extends zk{constructor(){super(...arguments),this._any=!0}_parse(e){return jk(e.data)}};yA.create=e=>new yA({typeName:B.ZodAny,...Rk(e)});var bA=class extends zk{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jk(e.data)}};bA.create=e=>new bA({typeName:B.ZodUnknown,...Rk(e)});var xA=class extends zk{_parse(e){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.never,received:t.parsedType}),R}};xA.create=e=>new xA({typeName:B.ZodNever,...Rk(e)});var SA=class extends zk{_parse(e){if(this._getType(e)!==F.undefined){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.void,received:t.parsedType}),R}return jk(e.data)}};SA.create=e=>new SA({typeName:B.ZodVoid,...Rk(e)});var CA=class e extends zk{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==F.array)return L(t,{code:I.invalid_type,expected:F.array,received:t.parsedType}),R;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(L(t,{code:e?I.too_big:I.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(L(t,{code:I.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(L(t,{code:I.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Ik(t,e,t.path,n)))).then(e=>kk.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Ik(t,e,t.path,n)));return kk.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:z.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:z.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:z.toString(n)}})}nonempty(e){return this.min(1,e)}};CA.create=(e,t)=>new CA({type:e,minLength:null,maxLength:null,exactLength:null,typeName:B.ZodArray,...Rk(t)});function wA(e){if(e instanceof TA){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=UA.create(wA(r))}return new TA({...e._def,shape:()=>t})}else if(e instanceof CA)return new CA({...e._def,type:wA(e.element)});else if(e instanceof UA)return UA.create(wA(e.unwrap()));else if(e instanceof WA)return WA.create(wA(e.unwrap()));else if(e instanceof jA)return jA.create(e.items.map(e=>wA(e)));else return e}var TA=class e extends zk{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=xk.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==F.object){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.object,received:t.parsedType}),R}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof xA&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Ik(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof xA){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(L(n,{code:I.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Ik(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>kk.mergeObjectSync(t,e)):kk.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return z.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:z.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:B.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of xk.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of xk.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return wA(this)}partial(t){let n={};for(let e of xk.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of xk.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof UA;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return RA(xk.objectKeys(this.shape))}};TA.create=(e,t)=>new TA({shape:()=>e,unknownKeys:`strip`,catchall:xA.create(),typeName:B.ZodObject,...Rk(t)}),TA.strictCreate=(e,t)=>new TA({shape:()=>e,unknownKeys:`strict`,catchall:xA.create(),typeName:B.ZodObject,...Rk(t)}),TA.lazycreate=(e,t)=>new TA({shape:e,unknownKeys:`strip`,catchall:xA.create(),typeName:B.ZodObject,...Rk(t)});var EA=class extends zk{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new wk(e.ctx.common.issues));return L(t,{code:I.invalid_union,unionErrors:n}),R}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new wk(e));return L(t,{code:I.invalid_union,unionErrors:i}),R}}get options(){return this._def.options}};EA.create=(e,t)=>new EA({options:e,typeName:B.ZodUnion,...Rk(t)});var DA=e=>e instanceof IA?DA(e.schema):e instanceof HA?DA(e.innerType()):e instanceof LA?[e.value]:e instanceof zA?e.options:e instanceof BA?xk.objectValues(e.enum):e instanceof GA?DA(e._def.innerType):e instanceof _A?[void 0]:e instanceof vA?[null]:e instanceof UA?[void 0,...DA(e.unwrap())]:e instanceof WA?[null,...DA(e.unwrap())]:e instanceof JA||e instanceof XA?DA(e.unwrap()):e instanceof KA?DA(e._def.innerType):[],OA=class e extends zk{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==F.object)return L(t,{code:I.invalid_type,expected:F.object,received:t.parsedType}),R;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(L(t,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),R)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=DA(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:B.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Rk(r)})}};function kA(e,t){let n=Ck(e),r=Ck(t);if(e===t)return{valid:!0,data:e};if(n===F.object&&r===F.object){let n=xk.objectKeys(t),r=xk.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=kA(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===F.array&&r===F.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=kA(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===F.date&&r===F.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var AA=class extends zk{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Mk(e)||Mk(r))return R;let i=kA(e.value,r.value);return i.valid?((Nk(e)||Nk(r))&&t.dirty(),{status:t.value,value:i.data}):(L(n,{code:I.invalid_intersection_types}),R)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};AA.create=(e,t,n)=>new AA({left:e,right:t,typeName:B.ZodIntersection,...Rk(n)});var jA=class e extends zk{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.array)return L(n,{code:I.invalid_type,expected:F.array,received:n.parsedType}),R;if(n.data.length<this._def.items.length)return L(n,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),R;!this._def.rest&&n.data.length>this._def.items.length&&(L(n,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Ik(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>kk.mergeArray(t,e)):kk.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};jA.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new jA({items:e,typeName:B.ZodTuple,rest:null,...Rk(t)})};var MA=class e extends zk{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.object)return L(n,{code:I.invalid_type,expected:F.object,received:n.parsedType}),R;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Ik(n,e,n.path,e)),value:a._parse(new Ik(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?kk.mergeObjectAsync(t,r):kk.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof zk?new e({keyType:t,valueType:n,typeName:B.ZodRecord,...Rk(r)}):new e({keyType:uA.create(),valueType:t,typeName:B.ZodRecord,...Rk(n)})}},NA=class extends zk{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.map)return L(n,{code:I.invalid_type,expected:F.map,received:n.parsedType}),R;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Ik(n,e,n.path,[a,`key`])),value:i._parse(new Ik(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return R;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return R;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};NA.create=(e,t,n)=>new NA({valueType:t,keyType:e,typeName:B.ZodMap,...Rk(n)});var PA=class e extends zk{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.set)return L(n,{code:I.invalid_type,expected:F.set,received:n.parsedType}),R;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(L(n,{code:I.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(L(n,{code:I.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return R;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Ik(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:z.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:z.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};PA.create=(e,t)=>new PA({valueType:e,minSize:null,maxSize:null,typeName:B.ZodSet,...Rk(t)});var FA=class e extends zk{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==F.function)return L(t,{code:I.invalid_type,expected:F.function,received:t.parsedType}),R;function n(e,n){return Ok({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dk(),Tk].filter(e=>!!e),issueData:{code:I.invalid_arguments,argumentsError:n}})}function r(e,n){return Ok({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dk(),Tk].filter(e=>!!e),issueData:{code:I.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof VA){let e=this;return jk(async function(...t){let o=new wk([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return jk(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new wk([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new wk([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:jA.create(t).rest(bA.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||jA.create([]).rest(bA.create()),returns:n||bA.create(),typeName:B.ZodFunction,...Rk(r)})}},IA=class extends zk{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};IA.create=(e,t)=>new IA({getter:e,typeName:B.ZodLazy,...Rk(t)});var LA=class extends zk{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return L(t,{received:t.data,code:I.invalid_literal,expected:this._def.value}),R}return{status:`valid`,value:e.data}}get value(){return this._def.value}};LA.create=(e,t)=>new LA({value:e,typeName:B.ZodLiteral,...Rk(t)});function RA(e,t){return new zA({values:e,typeName:B.ZodEnum,...Rk(t)})}var zA=class e extends zk{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return L(t,{expected:xk.joinValues(n),received:t.parsedType,code:I.invalid_type}),R}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return L(t,{received:t.data,code:I.invalid_enum_value,options:n}),R}return jk(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};zA.create=RA;var BA=class extends zk{_parse(e){let t=xk.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==F.string&&n.parsedType!==F.number){let e=xk.objectValues(t);return L(n,{expected:xk.joinValues(e),received:n.parsedType,code:I.invalid_type}),R}if(this._cache||=new Set(xk.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=xk.objectValues(t);return L(n,{received:n.data,code:I.invalid_enum_value,options:e}),R}return jk(e.data)}get enum(){return this._def.values}};BA.create=(e,t)=>new BA({values:e,typeName:B.ZodNativeEnum,...Rk(t)});var VA=class extends zk{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==F.promise&&t.common.async===!1?(L(t,{code:I.invalid_type,expected:F.promise,received:t.parsedType}),R):jk((t.parsedType===F.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};VA.create=(e,t)=>new VA({type:e,typeName:B.ZodPromise,...Rk(t)});var HA=class extends zk{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===B.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{L(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return R;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?R:r.status===`dirty`||t.value===`dirty`?Ak(r.value):r});{if(t.value===`aborted`)return R;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?R:r.status===`dirty`||t.value===`dirty`?Ak(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?R:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?R:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Pk(e))return R;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Pk(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):R);xk.assertNever(r)}};HA.create=(e,t,n)=>new HA({schema:e,typeName:B.ZodEffects,effect:t,...Rk(n)}),HA.createWithPreprocess=(e,t,n)=>new HA({schema:t,effect:{type:`preprocess`,transform:e},typeName:B.ZodEffects,...Rk(n)});var UA=class extends zk{_parse(e){return this._getType(e)===F.undefined?jk(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};UA.create=(e,t)=>new UA({innerType:e,typeName:B.ZodOptional,...Rk(t)});var WA=class extends zk{_parse(e){return this._getType(e)===F.null?jk(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};WA.create=(e,t)=>new WA({innerType:e,typeName:B.ZodNullable,...Rk(t)});var GA=class extends zk{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===F.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};GA.create=(e,t)=>new GA({innerType:e,typeName:B.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Rk(t)});var KA=class extends zk{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Fk(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new wk(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new wk(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};KA.create=(e,t)=>new KA({innerType:e,typeName:B.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Rk(t)});var qA=class extends zk{_parse(e){if(this._getType(e)!==F.nan){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.nan,received:t.parsedType}),R}return{status:`valid`,value:e.data}}};qA.create=e=>new qA({typeName:B.ZodNaN,...Rk(e)});var JA=class extends zk{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},YA=class e extends zk{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?R:e.status===`dirty`?(t.dirty(),Ak(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?R:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:B.ZodPipeline})}},XA=class extends zk{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Pk(e)&&(e.value=Object.freeze(e.value)),e);return Fk(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};XA.create=(e,t)=>new XA({innerType:e,typeName:B.ZodReadonly,...Rk(t)});function ZA(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function QA(e,t={},n){return e?yA.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=ZA(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=ZA(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):yA.create()}TA.lazycreate;var B;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(B||={});var V=uA.create,H=fA.create;qA.create,pA.create;var U=mA.create;hA.create,gA.create,_A.create,vA.create;var $A=yA.create;bA.create,xA.create,SA.create;var W=CA.create,G=TA.create;TA.strictCreate;var ej=EA.create,tj=OA.create;AA.create;var nj=jA.create,rj=MA.create;NA.create,PA.create,FA.create,IA.create;var ij=LA.create,aj=zA.create;BA.create,VA.create,HA.create,UA.create,WA.create,HA.createWithPreprocess,YA.create;var oj=G({freq:H(),interval:H(),weekdaysCsv:V(),monthlyMode:H(),endType:H(),endCount:H(),endDate:V(),exceptionsCsv:V(),differentTimes:U().optional(),weekdayTimesJson:V().nullable().optional()}),sj=G({id:V(),ownerUserId:V(),title:V(),status:H(),start:V(),end:V(),allDay:U(),notes:V(),recurrence:oj.nullable().optional()}).passthrough(),cj=W(sj),lj=G({from:V(),to:V()}),uj=G({active:U(),slots:W(lj).default([])}),dj=G({mon:uj,tue:uj,wed:uj,thu:uj,fri:uj,sat:uj,sun:uj}),fj=G({weekly:dj,isOverride:U(),source:V()}),pj=G({meetingDuration:H(),bufferMinutes:H(),workStart:V(),workEnd:V(),timezone:V(),branchId:V(),availabilityTimezone:V().optional()}),mj={0:`available`,1:`busy`,2:`meeting`,3:`focus`,4:`away`},hj={available:0,busy:1,meeting:2,focus:3,away:4},gj={0:`daily`,1:`weekly`,2:`monthly`,3:`yearly`},_j={daily:0,weekly:1,monthly:2,yearly:3},vj={0:`dayOfMonth`,1:`nthWeekday`},yj={dayOfMonth:0,nthWeekday:1},bj={0:`never`,1:`after`,2:`on`},xj={never:0,after:1,on:2},Sj=e=>e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0).map(Number).filter(e=>!Number.isNaN(e)),Cj=e=>e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0),wj=/[zZ]|[+-]\d{2}:?\d{2}$/,Tj=e=>{let t=wj.test(e)?e:`${e}Z`,n=new Date(t);return Number.isNaN(n.getTime())?e:n.toISOString()},Ej=e=>{let t;if(e.weekdayTimesJson)try{t=JSON.parse(e.weekdayTimesJson)}catch{}return{freq:gj[e.freq]??`daily`,interval:e.interval,weekdays:Sj(e.weekdaysCsv),monthlyMode:vj[e.monthlyMode]??`dayOfMonth`,endType:bj[e.endType]??`never`,endCount:e.endCount,endDate:e.endDate,exceptions:Cj(e.exceptionsCsv),differentTimes:e.differentTimes??!1,...t?{weekdayTimes:t}:{}}},Dj=e=>new VO({id:e.id,userId:e.ownerUserId,title:e.title,status:mj[e.status]??`busy`,start:Tj(e.start),end:Tj(e.end),allDay:e.allDay,notes:e.notes,recurrence:e.recurrence!==null&&e.recurrence!==void 0?Ej(e.recurrence):null}),Oj=e=>({active:e.active,slots:e.slots.map(e=>({id:crypto.randomUUID(),from:e.from,to:e.to}))}),kj=e=>lO({mon:Oj(e.mon),tue:Oj(e.tue),wed:Oj(e.wed),thu:Oj(e.thu),fri:Oj(e.fri),sat:Oj(e.sat),sun:Oj(e.sun)}),Aj=[`personal`,`branch`,`org`,`default`],jj=e=>Aj.find(t=>t===e)??`default`,Mj=e=>({weekly:kj(e.weekly),isOverride:e.isOverride,source:jj(e.source)}),Nj=e=>({meetingDuration:e.meetingDuration,bufferMinutes:e.bufferMinutes,workStart:e.workStart,workEnd:e.workEnd,timezone:e.timezone,branchId:e.branchId,availabilityTimezone:e.availabilityTimezone??``}),Pj=e=>({freq:_j[e.freq],interval:e.interval,weekdaysCsv:e.weekdays.join(`,`),monthlyMode:yj[e.monthlyMode],endType:xj[e.endType],endCount:e.endCount,endDate:e.endDate,exceptionsCsv:e.exceptions.join(`,`),differentTimes:e.differentTimes,weekdayTimesJson:e.weekdayTimes?JSON.stringify(e.weekdayTimes):null}),Fj=e=>({title:e.title,status:hj[e.status],start:e.start,end:e.end,allDay:e.allDay,notes:e.notes,recurrence:e.recurrence===null?null:Pj(e.recurrence)}),Ij=e=>({active:e.active,slots:e.slots.map(e=>({from:e.from,to:e.to}))}),Lj=e=>({mon:Ij(e.mon),tue:Ij(e.tue),wed:Ij(e.wed),thu:Ij(e.thu),fri:Ij(e.fri),sat:Ij(e.sat),sun:Ij(e.sun)}),Rj=e=>({meetingDuration:e.meetingDuration,bufferMinutes:e.bufferMinutes,workStart:e.workStart,workEnd:e.workEnd,timezone:e.timezone,branchId:e.branchId}),zj=(e,t,n)=>(e.error(`Schedule ${t} returned an unexpected shape`,n),N(new eO(n))),Bj=(e,t)=>t instanceof lk&&t.status===404?new rO:(e.error(`Schedule request failed`,t),new eO(t)),Vj={blocks:`/api/app/schedule-block`,availability:`/api/app/schedule-availability/availability`,effectiveAvailability:`/api/app/schedule-availability/effective-availability`,saveAvailability:`/api/app/schedule-availability/save-availability`,clearAvailability:`/api/app/schedule-availability/clear-availability`,preferences:`/api/app/schedule-preferences/preferences`,savePreferences:`/api/app/schedule-preferences/save-preferences`},Hj=e=>`/api/app/schedule-block/${encodeURIComponent(e)}`,Uj=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-schedule-gateway`)}async getAvailability(){try{let e=await this.httpClient.get(Vj.availability);if(e==null)return M(null);let t=dj.safeParse(e);return t.success?M(kj(t.data)):zj(this.logger,`availability`,t.error)}catch(e){return N(Bj(this.logger,e))}}async getEffectiveAvailability(){try{let e=await this.httpClient.get(Vj.effectiveAvailability),t=fj.safeParse(e);return t.success?M(Mj(t.data)):zj(this.logger,`effective-availability`,t.error)}catch(e){return N(Bj(this.logger,e))}}async saveAvailability(e){if(e===null)try{return await this.httpClient.post(Vj.clearAvailability),M(null)}catch(e){return N(Bj(this.logger,e))}try{let t=await this.httpClient.post(Vj.saveAvailability,Lj(e)),n=dj.safeParse(t);return n.success?M(kj(n.data)):zj(this.logger,`save-availability`,n.error)}catch(e){return N(Bj(this.logger,e))}}async listBlocks(){try{let e=await this.httpClient.get(Vj.blocks),t=cj.safeParse(e);return t.success?M(t.data.map(Dj)):zj(this.logger,`blocks`,t.error)}catch(e){return N(Bj(this.logger,e))}}createBlock(e){return this.saveBlock(this.httpClient.post(Vj.blocks,Fj(e)),`create-block`)}updateBlock(e,t){return this.saveBlock(this.httpClient.put(Hj(e),Fj(t)),`update-block`)}async saveBlock(e,t){try{let n=await e,r=sj.safeParse(n);return r.success?M(Dj(r.data)):zj(this.logger,t,r.error)}catch(e){return N(Bj(this.logger,e))}}async deleteBlock(e){try{return await this.httpClient.delete(Hj(e)),M(void 0)}catch(e){return N(Bj(this.logger,e))}}async getPreferences(){try{let e=await this.httpClient.get(Vj.preferences),t=pj.safeParse(e);return t.success?M(Nj(t.data)):zj(this.logger,`preferences`,t.error)}catch(e){return N(Bj(this.logger,e))}}async savePreferences(e){try{let t=await this.httpClient.post(Vj.savePreferences,Rj(e)),n=pj.safeParse(t);return n.success?M(Nj(n.data)):zj(this.logger,`save-preferences`,n.error)}catch(e){return N(Bj(this.logger,e))}}addMeetingBlocks(e){this.logger.debug(`addMeetingBlocks is a no-op (server owns meeting→calendar sync)`)}},Wj=e=>{let t=new Uj({httpClient:e.httpClient,logger:e.logger}),n={scheduleGateway:t,logger:e.logger};return{getAvailability:new zD(n),getEffectiveAvailability:new BD(n),saveAvailability:new nk(n),listBlocks:new rk(n),createBlock:new ik(n),updateBlock:new ak(n),deleteBlock:new ok(n),getPreferences:new sk(n),savePreferences:new ck(n),calendarSink:t,clock:e.clock}},Gj=(0,n.createContext)(null),Kj=({module:e,children:t})=>(0,D.jsx)(Gj.Provider,{value:e,children:t}),qj=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Jj=new class extends qj{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Yj={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Xj=new class{#e=Yj;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!==`production`&&this.#t&&e!==this.#e&&console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!==`production`&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!==`production`&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!==`production`&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Zj(e){setTimeout(e,0)}var Qj=typeof window>`u`||`Deno`in globalThis;function $j(){}function eM(e,t){return typeof e==`function`?e(t):e}function tM(e){return typeof e==`number`&&e>=0&&e!==1/0}function nM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function rM(e,t){return typeof e==`function`?e(t):e}function iM(e,t){return typeof e==`function`?e(t):e}function aM(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==sM(o,t.options))return!1}else if(!lM(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function oM(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(cM(t.options.mutationKey)!==cM(a))return!1}else if(!lM(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function sM(e,t){return(t?.queryKeyHashFn||cM)(e)}function cM(e){return JSON.stringify(e,(e,t)=>mM(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function lM(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>lM(e[n],t[n])):!1}var uM=Object.prototype.hasOwnProperty;function dM(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=pM(e)&&pM(t);if(!r&&!(mM(e)&&mM(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:uM.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=dM(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function fM(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function pM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mM(e){if(!hM(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!hM(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function hM(e){return Object.prototype.toString.call(e)===`[object Object]`}function gM(e){return new Promise(t=>{Xj.setTimeout(t,e)})}function _M(e,t,n){if(typeof n.structuralSharing==`function`)return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!==`production`)try{return dM(e,t)}catch(e){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`),e}return dM(e,t)}return t}function vM(e){return e}function yM(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function bM(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xM=Symbol();function SM(e,t){return process.env.NODE_ENV!==`production`&&e.queryFn===xM&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===xM?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function CM(e,t){return typeof e==`function`?e(...t):!!e}function wM(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var TM=(()=>{let e=()=>Qj;return{isServer(){return e()},setIsServer(t){e=t}}})();function EM(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var DM=Zj;function OM(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=DM,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var kM=OM(),AM=new class extends qj{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function jM(e){return Math.min(1e3*2**e,3e4)}function MM(e){return(e??`online`)===`online`?AM.isOnline():!0}var NM=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function PM(e){let t=!1,n=0,r,i=EM(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new NM(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Jj.isFocused()&&(e.networkMode===`always`||AM.isOnline())&&e.canRun(),u=()=>MM(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(TM.isServer()?0:3),o=e.retryDelay??jM,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),gM(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var FM=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tM(this.gcTime)&&(this.#e=Xj.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(TM.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Xj.clearTimeout(this.#e),this.#e=void 0)}};function IM(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{wM(e,()=>t.signal,()=>n=!0)},u=SM(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?bM:yM;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?RM:LM,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:LM(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function LM(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function RM(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function zM(e,t){return t?LM(e,t)!=null:!1}function BM(e,t){return!t||!e.getPreviousPageParam?!1:RM(e,t)!=null}var VM=class extends FM{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=WM(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=WM(this.options);e.data!==void 0&&(this.setState(UM(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=_M(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then($j).catch($j):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>iM(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xM||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>rM(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!nM(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}process.env.NODE_ENV!==`production`&&(Array.isArray(this.options.queryKey)||console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`));let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=SM(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?IM(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=PM({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof NM&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw process.env.NODE_ENV!==`production`&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof NM){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...HM(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...UM(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),kM.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function HM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:MM(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function UM(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function WM(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var GM=class extends qj{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=EM(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),qM(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return JM(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return JM(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof iM(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!fM(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&YM(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||iM(this.options.enabled,this.#t)!==iM(t.enabled,this.#t)||rM(this.options.staleTime,this.#t)!==rM(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||iM(this.options.enabled,this.#t)!==iM(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ZM(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch($j)),t}#g(){this.#b();let e=rM(this.options.staleTime,this.#t);if(TM.isServer()||this.#r.isStale||!tM(e))return;let t=nM(this.#r.dataUpdatedAt,e)+1;this.#d=Xj.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(TM.isServer()||iM(this.options.enabled,this.#t)===!1||!tM(this.#p)||this.#p===0)&&(this.#f=Xj.setInterval(()=>{(this.options.refetchIntervalInBackground||Jj.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Xj.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Xj.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&qM(e,t),o=i&&YM(e,n,t,r);(a||o)&&(l={...l,...HM(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=_M(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=_M(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:XM(e,t),refetch:this.refetch,promise:this.#o,isEnabled:iM(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=EM())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!fM(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){kM.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function KM(e,t){return iM(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&iM(t.retryOnMount,e)===!1)}function qM(e,t){return KM(e,t)||e.state.data!==void 0&&JM(e,t,t.refetchOnMount)}function JM(e,t,n){if(iM(t.enabled,e)!==!1&&rM(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&XM(e,t)}return!1}function YM(e,t,n,r){return(e!==t||iM(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&XM(e,n)}function XM(e,t){return iM(t.enabled,e)!==!1&&e.isStaleByTime(rM(t.staleTime,e))}function ZM(e,t){return!fM(e.getCurrentResult(),t)}var QM=class extends GM{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:zM(t,n.data),hasPreviousPage:BM(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},$M=class extends FM{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||eN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=PM({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),kM.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function eN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var tN=class extends qj{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new $M({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=nN(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=nN(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=nN(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=nN(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){kM.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>oM(t,e))}findAll(e={}){return this.getAll().filter(t=>oM(e,t))}notify(e){kM.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return kM.batch(()=>Promise.all(e.map(e=>e.continue().catch($j))))}};function nN(e){return e.options.scope?.id}var rN=class extends qj{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),fM(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&cM(t.mutationKey)!==cM(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??eN();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){kM.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},iN=class extends qj{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??sM(r,t),a=this.get(i);return a||(a=new VM({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){kM.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>aM(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>aM(e,t)):t}notify(e){kM.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){kM.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){kM.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},aN=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new iN,this.#t=e.mutationCache||new tN,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Jj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=AM.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(rM(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=eM(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return kM.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;kM.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return kM.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=kM.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then($j).catch($j)}invalidateQueries(e,t={}){return kM.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=kM.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch($j)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then($j)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(rM(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($j).catch($j)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($j).catch($j)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return AM.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(cM(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{lM(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(cM(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{lM(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=sM(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===xM&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},oN=n.createContext(void 0),sN=e=>{let t=n.useContext(oN);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},cN=({client:e,children:t})=>(n.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,D.jsx)(oN.Provider,{value:e,children:t})),lN=n.createContext(!1),uN=()=>n.useContext(lN);lN.Provider;function dN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fN=n.createContext(dN()),pN=()=>n.useContext(fN),mN=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?CM(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},hN=e=>{n.useEffect(()=>{e.clearReset()},[e])},gN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||CM(n,[e.error,r])),_N=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},vN=(e,t)=>e.isLoading&&e.isFetching&&!t,yN=(e,t)=>e?.suspense&&t.isPending,bN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function xN(e,t,r){if(process.env.NODE_ENV!==`production`&&(typeof e!=`object`||Array.isArray(e)))throw Error(`Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object`);let i=uN(),a=pN(),o=sN(r),s=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=o.getQueryCache().get(s.queryHash);process.env.NODE_ENV!==`production`&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));let l=e.subscribed!==!1;s._optimisticResults=i?`isRestoring`:l?`optimistic`:void 0,_N(s),mN(s,a,c),hN(a);let u=!o.getQueryCache().get(s.queryHash),[d]=n.useState(()=>new t(o,s)),f=d.getOptimisticResult(s),p=!i&&l;if(n.useSyncExternalStore(n.useCallback(e=>{let t=p?d.subscribe(kM.batchCalls(e)):$j;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),n.useEffect(()=>{d.setOptions(s)},[s,d]),yN(s,f))throw bN(s,d,a);if(gN({result:f,errorResetBoundary:a,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,f),s.experimental_prefetchInRender&&!TM.isServer()&&vN(f,i)&&(u?bN(s,d,a):c?.promise)?.catch($j).finally(()=>{d.updateResult()}),s.notifyOnChangeProps?f:d.trackResult(f)}function SN(e,t){return xN(e,GM,t)}function CN(e,t){let r=sN(t),[i]=n.useState(()=>new rN(r,e));n.useEffect(()=>{i.setOptions(e)},[i,e]);let a=n.useSyncExternalStore(n.useCallback(e=>i.subscribe(kM.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=n.useCallback((e,t)=>{i.mutate(e,t).catch($j)},[i]);if(a.error&&CM(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function wN(e,t){return xN(e,QM,t)}var TN=()=>{let e=(0,n.useContext)(Gj);if(e===null)throw Error(`Schedule hooks must be used within <ScheduleModuleProvider>.`);return e},EN=[`schedule`,`availability`],DN=[`schedule`,`effective-availability`],ON=[`schedule`,`blocks`],kN=[`schedule`,`preferences`],AN=()=>{let{getAvailability:e}=TN();return SN({queryKey:EN,queryFn:()=>P(e.execute())})},jN=()=>{let{getEffectiveAvailability:e}=TN();return SN({queryKey:DN,queryFn:()=>P(e.execute())})},MN=()=>{let{saveAvailability:e}=TN(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{t.invalidateQueries({queryKey:EN}),t.invalidateQueries({queryKey:DN})}})},NN=()=>{let{listBlocks:e}=TN();return SN({queryKey:ON,queryFn:()=>P(e.execute())})},PN=()=>{let{createBlock:e}=TN(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{t.invalidateQueries({queryKey:ON})}})},FN=()=>{let{updateBlock:e}=TN(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{t.invalidateQueries({queryKey:ON})}})},IN=()=>{let{deleteBlock:e}=TN(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{t.invalidateQueries({queryKey:ON})}})},LN=()=>{let{getPreferences:e}=TN();return SN({queryKey:kN,queryFn:()=>P(e.execute())})},RN=()=>{let{savePreferences:e}=TN(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{t.invalidateQueries({queryKey:kN})}})},zN=class{now(){return new Date}},BN=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,VN=(e,t)=>{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}).formatToParts(e),r=e=>Number(n.find(t=>t.type===e)?.value??`0`);return{year:r(`year`),month:r(`month`),day:r(`day`),hour:r(`hour`)===24?0:r(`hour`),minute:r(`minute`),second:r(`second`)}},HN=(e,t)=>{let n=VN(t,e),r=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second);return Math.round((r-t.getTime())/6e4)},UN=e=>String(e).padStart(2,`0`),WN=(e,t,n)=>{let r=Date.parse(`${e}T${t}:00Z`);if(Number.isNaN(r))throw Error(`Invalid date/time`);let i=HN(n,new Date(r)),a=HN(n,new Date(r-i*6e4));return new Date(r-a*6e4).toISOString()},GN=e=>{let t=e<0?`-`:`+`,n=Math.abs(e);return`GMT${t}${UN(Math.floor(n/60))}:${UN(n%60)}`},KN=e=>e.find(e=>e!==void 0&&e!==``),qN=class e{display;anchor;constructor(e,t){this.display=e,this.anchor=t}static from(t){let n=KN([t.anchor,t.personal])??`UTC`;return new e(KN([t.pick,t.personal])??(n===`UTC`?BN():n),n)}get displayMatchesAnchor(){return this.display===this.anchor}formatTime(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hour12:!1,timeZone:this.display})}formatTimeRange(e,t){return!e||!t?``:`${this.formatTime(e)} – ${this.formatTime(t)}`}formatUntil(e,t=new Date){let n=this.formatTime(e),r=this.calendarDaysAhead(t,new Date(e));return r<=0?n:r===1?`tomorrow ${n}`:r<7?`${this.formatDate(e,{weekday:`short`})} ${n}`:`${this.formatDate(e)} ${n}`}calendarDaysAhead(e,t){let n=e=>Date.parse(`${e.toLocaleDateString(`en-CA`,{timeZone:this.display})}T00:00:00Z`);return Math.round((n(t)-n(e))/864e5)}formatDate(e,t={weekday:`short`,day:`numeric`,month:`short`}){return new Date(e).toLocaleDateString(`en-US`,{...t,timeZone:this.display})}},JN=e=>{let t=LN().data;return qN.from({pick:e,personal:t?.timezone,anchor:t?.availabilityTimezone})},YN=5e3,XN={},ZN={delivered:0,read:0},QN={status:`disconnected`,presence:{},typing:{},receipts:{},pending:{},activeConversationId:null,removedConversationIds:[]},$N=(e,t)=>({...e,status:t}),eP=(e,t,n,r)=>({...e,presence:{...e.presence,[t]:{online:n,lastSeenUtc:r}}}),tP=(e,t)=>{let{conversationId:n,userId:r,isTyping:i,nowMs:a}=t,o=e.typing[n]??{},s=i?{...o,[r]:a+YN}:Object.fromEntries(Object.entries(o).filter(([e])=>e!==r));return{...e,typing:{...e.typing,[n]:s}}},nP=(e,t,n)=>t===`delivered`?{...e,delivered:Math.max(e.delivered,n)}:{...e,read:Math.max(e.read,n)},rP=(e,t)=>{let{conversationId:n,userId:r,kind:i,uptoSequence:a}=t,o=e.receipts[n]??XN,s=o[r]??ZN,c={...o,[r]:nP(s,i,a)};return{...e,receipts:{...e.receipts,[n]:c}}},iP=(e,t,n)=>{let r={...e.receipts[t]??XN};for(let e of n){let t=r[e.userId]??ZN;r[e.userId]={delivered:Math.max(t.delivered,e.deliveredUpto),read:Math.max(t.read,e.readUpto)}}return{...e,receipts:{...e.receipts,[t]:r}}},aP=(e,t,n)=>{let r=e.typing[t];return r===void 0?[]:Object.entries(r).filter(([,e])=>e>n).map(([e])=>e)},oP=(e,t)=>e.receipts[t]??XN,sP=(e,t,n)=>({...e,pending:{...e.pending,[t]:n}}),cP=(e,t)=>sP(e,t,`sending`),lP=(e,t)=>sP(e,t,`failed`),uP=(e,t)=>{if(e.pending[t]===void 0)return e;let n=Object.fromEntries(Object.entries(e.pending).filter(([e])=>e!==t));return{...e,pending:n}},dP=(e,t)=>e.pending[t]??null,fP=(e,t)=>e.activeConversationId===t?e:{...e,activeConversationId:t},pP=(e,t)=>e.removedConversationIds.includes(t)?e:{...e,removedConversationIds:[...e.removedConversationIds,t]},mP=(e,t)=>e.removedConversationIds.includes(t),hP=()=>AE((e,t)=>({...QN,setStatus:t=>{e(e=>$N(e,t))},applyPresence:(t,n,r)=>{e(e=>eP(e,t,n,r))},applyTyping:(t,n,r,i)=>{e(e=>tP(e,{conversationId:t,userId:n,isTyping:r,nowMs:i}))},applyReceipt:(t,n,r,i)=>{e(e=>rP(e,{conversationId:t,userId:n,kind:r,uptoSequence:i}))},seedReceipts:(t,n)=>{e(e=>iP(e,t,n))},markSending:t=>{e(e=>cP(e,t))},markFailed:t=>{e(e=>lP(e,t))},clearPending:t=>{e(e=>uP(e,t))},setActiveConversationId:t=>{e(e=>fP(e,t))},markRemovedFromConversation:t=>{e(e=>pP(e,t))},isRemovedFromConversation:e=>mP(t(),e),clear:()=>{e(QN)},typingUserIds:(e,n)=>aP(t(),e,n),receiptsFor:e=>oP(t(),e),pendingStatus:e=>dP(t(),e)})),gP=(0,n.createContext)(null),_P=()=>{let e=(0,n.useContext)(gP);if(e===null)throw Error(`Chat realtime hooks must be used within <ChatModuleProvider>.`);return e},vP=e=>ME(_P(),e),yP=class extends ui{},bP=class extends yP{code=`CHAT_UNAVAILABLE`;constructor(e,t){super(t??`Chat is currently unavailable. Please try again.`,{cause:e})}},xP=class extends yP{code=`CHAT_EMPTY_MESSAGE`;constructor(){super(`Write something before sending.`)}},SP=class extends yP{code=`CHAT_MESSAGE_TOO_LONG`;constructor(e){super(`Message must be ${String(e)} characters or less.`)}},CP=class extends yP{code=`CHAT_EMPTY_GROUP_TITLE`;constructor(){super(`Give the group a name before creating it.`)}},wP=class extends yP{code=`CHAT_EMPTY_GROUP_MEMBERS`;constructor(){super(`Add at least one member before creating the group.`)}},TP=class extends yP{code=`CHAT_MISSING_DIRECT_RECIPIENT`;constructor(){super(`Choose someone to start a conversation with.`)}},EP=3600*1e3,DP=900*1e3,OP=/([zZ]|[+-]\d{2}:?\d{2})$/,kP=e=>new Date(e.length>0&&!OP.test(e)?`${e}Z`:e),AP=class e{id;kind;authorName;authorInitials;authorColor;text;time;sentAt;fromViewer;reactions;sequence;senderId;clientMessageId;replyTo;mediaUrl;mediaContentType;mediaFileName;isEdited;deletedForEveryone;constructor(e){this.id=e.id,this.kind=e.kind,this.authorName=e.authorName,this.authorInitials=e.authorInitials,this.authorColor=e.authorColor,this.text=e.text,this.time=e.time,this.sentAt=e.sentAt??``,this.fromViewer=e.fromViewer,this.reactions=e.reactions,this.sequence=e.sequence,this.senderId=e.senderId,this.clientMessageId=e.clientMessageId,this.replyTo=e.replyTo??null,this.mediaUrl=e.mediaUrl??null,this.mediaContentType=e.mediaContentType??null,this.mediaFileName=e.mediaFileName??null,this.isEdited=e.isEdited??!1,this.deletedForEveryone=e.deletedForEveryone??!1}get isSystem(){return this.kind===`system`}canDeleteForEveryone(e){if(!this.fromViewer||this.isSystem||this.deletedForEveryone)return!1;let t=kP(this.sentAt).getTime();return Number.isNaN(t)?!0:Math.max(0,e-t)<=EP}get isSharedCard(){return this.text.startsWith(`__UAPP_SHARED_CARD__::`)}canEdit(e){if(!this.fromViewer||this.isSystem||this.deletedForEveryone||this.isSharedCard)return!1;let t=kP(this.sentAt).getTime();return Number.isNaN(t)?!0:Math.max(0,e-t)<=DP}with(t){return new e({id:this.id,kind:this.kind,authorName:this.authorName,authorInitials:this.authorInitials,authorColor:this.authorColor,text:this.text,time:this.time,sentAt:this.sentAt,fromViewer:this.fromViewer,reactions:this.reactions,sequence:this.sequence,senderId:this.senderId,clientMessageId:this.clientMessageId,replyTo:this.replyTo,mediaUrl:this.mediaUrl,mediaContentType:this.mediaContentType,mediaFileName:this.mediaFileName,isEdited:this.isEdited,deletedForEveryone:this.deletedForEveryone,...t})}withFallbackSentAt(e){return this.sentAt.length>0||e.length===0?this:this.with({sentAt:e})}asDeletedForEveryone(){return this.deletedForEveryone?this:this.with({text:``,reactions:[],replyTo:null,mediaUrl:null,mediaContentType:null,mediaFileName:null,isEdited:!1,deletedForEveryone:!0})}},jP=class e{id;kind;title;subtitle;initials;color;online;status;statusUntilUtc;unread;pinned;favourite;archived;admin;lastMessage;lastTime;lastMessageAt;lastSynced;tenantId;categoryId;members;adminIds;data;peerUserId;memberReceipts;constructor(e){this.id=e.id,this.kind=e.kind,this.title=e.title,this.subtitle=e.subtitle,this.initials=e.initials,this.color=e.color,this.online=e.online,this.status=e.status??`offline`,this.statusUntilUtc=e.statusUntilUtc??null,this.unread=e.unread,this.pinned=e.pinned,this.favourite=e.favourite,this.archived=e.archived,this.admin=e.admin,this.lastMessage=e.lastMessage,this.lastTime=e.lastTime,this.lastMessageAt=e.lastMessageAt??null,this.lastSynced=e.lastSynced,this.tenantId=e.tenantId,this.categoryId=e.categoryId,this.members=e.members,this.adminIds=e.adminIds,this.data=e.data,this.peerUserId=e.peerUserId,this.memberReceipts=e.memberReceipts}get isUnread(){return this.unread>0}get isGroup(){return this.kind===`group`}get isDm(){return this.kind===`dm`}get hasCategory(){return this.categoryId!==null}get memberCount(){return this.members.length}isAdmin(e){return this.adminIds.includes(e)}canManageMembers(e){return this.isAdmin(e)}with(t){return new e({id:this.id,kind:this.kind,title:this.title,subtitle:this.subtitle,initials:this.initials,color:this.color,online:this.online,status:this.status,statusUntilUtc:this.statusUntilUtc,unread:this.unread,pinned:this.pinned,favourite:this.favourite,archived:this.archived,admin:this.admin,lastMessage:this.lastMessage,lastTime:this.lastTime,lastMessageAt:this.lastMessageAt,lastSynced:this.lastSynced,tenantId:this.tenantId,categoryId:this.categoryId,members:this.members,adminIds:this.adminIds,data:this.data,peerUserId:this.peerUserId,memberReceipts:this.memberReceipts,...t})}},MP=(e,t)=>{if(e.length===0)return``;let n=kP(e);return Number.isNaN(n.getTime())?``:n.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0,timeZone:t&&t.length>0?t:void 0})},K={root:`_root_1d1de_1`,fullCenter:`_fullCenter_1d1de_7`,list:`_list_1d1de_14`,listHead:`_listHead_1d1de_24`,listTitle:`_listTitle_1d1de_31`,composeBtn:`_composeBtn_1d1de_38`,menuItemContent:`_menuItemContent_1d1de_61`,chatIconTile:`_chatIconTile_1d1de_68`,groupIconTile:`_groupIconTile_1d1de_69`,menuItemText:`_menuItemText_1d1de_89`,menuItemTitle:`_menuItemTitle_1d1de_97`,menuItemSub:`_menuItemSub_1d1de_104`,search:`_search_1d1de_110`,searchInput:`_searchInput_1d1de_122`,searchClearBtn:`_searchClearBtn_1d1de_131`,tabsWrapper:`_tabsWrapper_1d1de_148`,tabs:`_tabs_1d1de_148`,arrowBtn:`_arrowBtn_1d1de_168`,arrowLeft:`_arrowLeft_1d1de_223`,arrowRight:`_arrowRight_1d1de_227`,tab:`_tab_1d1de_148`,tabActive:`_tabActive_1d1de_259`,tabBg:`_tabBg_1d1de_264`,tabLabel:`_tabLabel_1d1de_273`,tabCount:`_tabCount_1d1de_278`,tabDot:`_tabDot_1d1de_292`,rows:`_rows_1d1de_301`,empty:`_empty_1d1de_338`,sentinel:`_sentinel_1d1de_347`,loadMore:`_loadMore_1d1de_352`,row:`_row_1d1de_301`,rowActive:`_rowActive_1d1de_370`,rowMain:`_rowMain_1d1de_375`,rowMenuBtn:`_rowMenuBtn_1d1de_388`,rowPin:`_rowPin_1d1de_412`,rowStar:`_rowStar_1d1de_419`,rowAvatar:`_rowAvatar_1d1de_426`,onlineDot:`_onlineDot_1d1de_441`,rowBody:`_rowBody_1d1de_452`,rowTop:`_rowTop_1d1de_460`,rowName:`_rowName_1d1de_467`,rowTitle:`_rowTitle_1d1de_478`,rowTime:`_rowTime_1d1de_490`,rowBottom:`_rowBottom_1d1de_496`,rowPreview:`_rowPreview_1d1de_503`,rowRole:`_rowRole_1d1de_511`,unread:`_unread_1d1de_517`,view:`_view_1d1de_530`,viewEmpty:`_viewEmpty_1d1de_542`,emptyIconWrap:`_emptyIconWrap_1d1de_553`,emptyTitle:`_emptyTitle_1d1de_565`,emptyText:`_emptyText_1d1de_572`,viewHead:`_viewHead_1d1de_580`,viewAvatarWrap:`_viewAvatarWrap_1d1de_590`,viewAvatar:`_viewAvatar_1d1de_590`,viewPresenceDot:`_viewPresenceDot_1d1de_609`,viewHeadText:`_viewHeadText_1d1de_614`,viewIcon:`_viewIcon_1d1de_622`,viewTitleRow:`_viewTitleRow_1d1de_634`,viewTitle:`_viewTitle_1d1de_634`,statusPill:`_statusPill_1d1de_653`,adminBadge:`_adminBadge_1d1de_666`,viewSub:`_viewSub_1d1de_679`,headEnd:`_headEnd_1d1de_687`,memberStack:`_memberStack_1d1de_694`,memberAvatar:`_memberAvatar_1d1de_699`,memberMore:`_memberMore_1d1de_710`,headMenuBtn:`_headMenuBtn_1d1de_725`,threadWrap:`_threadWrap_1d1de_743`,messages:`_messages_1d1de_535`,thread:`_thread_1d1de_743`,center:`_center_1d1de_776`,olderRow:`_olderRow_1d1de_783`,newPill:`_newPill_1d1de_791`,sendFailed:`_sendFailed_1d1de_817`,sendFailedText:`_sendFailedText_1d1de_823`,retryBtn:`_retryBtn_1d1de_829`,systemRow:`_systemRow_1d1de_844`,systemPill:`_systemPill_1d1de_851`,msgRow:`_msgRow_1d1de_768`,msgRowGroupStart:`_msgRowGroupStart_1d1de_768`,msgRowMe:`_msgRowMe_1d1de_875`,msgAvatarSpacer:`_msgAvatarSpacer_1d1de_880`,dateSep:`_dateSep_1d1de_886`,dateSepPill:`_dateSepPill_1d1de_892`,msgBubbleWrap:`_msgBubbleWrap_1d1de_904`,reactWrap:`_reactWrap_1d1de_915`,reactBtn:`_reactBtn_1d1de_920`,reactPop:`_reactPop_1d1de_946`,reactPopRight:`_reactPopRight_1d1de_961`,reactPopLeft:`_reactPopLeft_1d1de_967`,reactPopBtn:`_reactPopBtn_1d1de_972`,msgAvatar:`_msgAvatar_1d1de_880`,msgCol:`_msgCol_1d1de_1005`,msgColWithReactions:`_msgColWithReactions_1d1de_1012`,bubble:`_bubble_1d1de_1016`,bubbleThem:`_bubbleThem_1d1de_1026`,bubbleMe:`_bubbleMe_1d1de_1033`,msgAuthor:`_msgAuthor_1d1de_1039`,msgText:`_msgText_1d1de_1053`,msgTextDeleted:`_msgTextDeleted_1d1de_1058`,msgMeta:`_msgMeta_1d1de_1063`,msgTime:`_msgTime_1d1de_1073`,tick:`_tick_1d1de_1080`,tickRead:`_tickRead_1d1de_1086`,reactionPill:`_reactionPill_1d1de_1091`,reactionPillActive:`_reactionPillActive_1d1de_1119`,reactionsMe:`_reactionsMe_1d1de_1124`,reactionsThem:`_reactionsThem_1d1de_1128`,reactionEmojis:`_reactionEmojis_1d1de_1132`,reactionCount:`_reactionCount_1d1de_1140`,reactionOn:`_reactionOn_1d1de_1151`,composer:`_composer_1d1de_1156`,removedComposer:`_removedComposer_1d1de_1167`,attachTray:`_attachTray_1d1de_1182`,attachItem:`_attachItem_1d1de_1195`,attachThumb:`_attachThumb_1d1de_1206`,attachFile:`_attachFile_1d1de_1213`,attachFileName:`_attachFileName_1d1de_1225`,attachRemove:`_attachRemove_1d1de_1234`,attachAdd:`_attachAdd_1d1de_1256`,composerIcon:`_composerIcon_1d1de_1278`,composerInput:`_composerInput_1d1de_1300`,emojiWrap:`_emojiWrap_1d1de_1325`,emojiBackdrop:`_emojiBackdrop_1d1de_1330`,emojiPop:`_emojiPop_1d1de_1339`,emojiBtn:`_emojiBtn_1d1de_1355`,sendBtn:`_sendBtn_1d1de_1376`,memberStackBtn:`_memberStackBtn_1d1de_1396`,membersBody:`_membersBody_1d1de_1410`,unsavedBar:`_unsavedBar_1d1de_1416`,addMemberCta:`_addMemberCta_1d1de_1426`,membersSectionLabel:`_membersSectionLabel_1d1de_1447`,membersList:`_membersList_1d1de_1454`,memberRow:`_memberRow_1d1de_1460`,memberRowNew:`_memberRowNew_1d1de_1473`,memberRowAvatar:`_memberRowAvatar_1d1de_1482`,memberRowBody:`_memberRowBody_1d1de_1496`,memberRowName:`_memberRowName_1d1de_1504`,memberRowYou:`_memberRowYou_1d1de_1514`,memberRowRole:`_memberRowRole_1d1de_1519`,memberBadgeAdmin:`_memberBadgeAdmin_1d1de_1529`,memberBadge:`_memberBadge_1d1de_1529`,memberPillNew:`_memberPillNew_1d1de_1550`,memberPillUp:`_memberPillUp_1d1de_1560`,memberPillDown:`_memberPillDown_1d1de_1571`,memberRowMenuBtn:`_memberRowMenuBtn_1d1de_1581`,removedLabel:`_removedLabel_1d1de_1601`,removedRow:`_removedRow_1d1de_1609`,removedName:`_removedName_1d1de_1624`,undoBtn:`_undoBtn_1d1de_1632`,addPanel:`_addPanel_1d1de_1653`,addPanelHead:`_addPanelHead_1d1de_1659`,addPanelTitle:`_addPanelTitle_1d1de_1665`,addPanelSearch:`_addPanelSearch_1d1de_1671`,addPanelList:`_addPanelList_1d1de_1682`,addPanelEmpty:`_addPanelEmpty_1d1de_1690`,addMemberBtn:`_addMemberBtn_1d1de_1697`,newGroupBody:`_newGroupBody_1d1de_1722`,staffPickRow:`_staffPickRow_1d1de_1728`,staffPickRowOn:`_staffPickRowOn_1d1de_1753`,pickCheck:`_pickCheck_1d1de_1762`,pickCheckOn:`_pickCheckOn_1d1de_1774`,pickerPending:`_pickerPending_1d1de_1779`,connPill:`_connPill_1d1de_1793`,typingRow:`_typingRow_1d1de_1807`,typingText:`_typingText_1d1de_1816`,typingDots:`_typingDots_1d1de_1821`,typingBounce:`_typingBounce_1d1de_1`,memberRowAvatarWrap:`_memberRowAvatarWrap_1d1de_1863`,presenceDot:`_presenceDot_1d1de_1869`,replyPreview:`_replyPreview_1d1de_1880`,replyPreviewAuthor:`_replyPreviewAuthor_1d1de_1900`,replyPreviewText:`_replyPreviewText_1d1de_1913`,replyBar:`_replyBar_1d1de_1929`,replyBarText:`_replyBarText_1d1de_1940`,replyBarClose:`_replyBarClose_1d1de_1949`,msgMedia:`_msgMedia_1d1de_1957`,msgMediaLoading:`_msgMediaLoading_1d1de_1981`,msgMediaFallback:`_msgMediaFallback_1d1de_1982`,albumGrid:`_albumGrid_1d1de_1998`,albumCell:`_albumCell_1d1de_2007`,albumCellMedia:`_albumCellMedia_1d1de_2007`,albumCellActions:`_albumCellActions_1d1de_2052`,albumActionBtn:`_albumActionBtn_1d1de_2078`,albumCellReactions:`_albumCellReactions_1d1de_2097`,mediaButton:`_mediaButton_1d1de_2106`,mediaButtonFill:`_mediaButtonFill_1d1de_2115`,viewerBackdrop:`_viewerBackdrop_1d1de_2122`,viewerScrim:`_viewerScrim_1d1de_2132`,viewerFade:`_viewerFade_1d1de_1`,viewerStage:`_viewerStage_1d1de_2141`,viewerImg:`_viewerImg_1d1de_2155`,viewerZoom:`_viewerZoom_1d1de_1`,viewerFallback:`_viewerFallback_1d1de_2165`,viewerClose:`_viewerClose_1d1de_2174`,viewerNav:`_viewerNav_1d1de_2175`,viewerNavPrev:`_viewerNavPrev_1d1de_2219`,viewerNavNext:`_viewerNavNext_1d1de_2223`,viewerCount:`_viewerCount_1d1de_2227`,fileCard:`_fileCard_1d1de_2264`,fileCardMe:`_fileCardMe_1d1de_2282`,fileCardIcon:`_fileCardIcon_1d1de_2295`,fileCardInfo:`_fileCardInfo_1d1de_2307`,fileCardName:`_fileCardName_1d1de_2315`,fileCardMetaLabel:`_fileCardMetaLabel_1d1de_2324`,fileCardDownload:`_fileCardDownload_1d1de_2329`,msgActions:`_msgActions_1d1de_2337`,msgActionBtn:`_msgActionBtn_1d1de_2349`,editedLabel:`_editedLabel_1d1de_2362`,hiddenFileInput:`_hiddenFileInput_1d1de_2369`,viewPaneWrapper:`_viewPaneWrapper_1d1de_2373`,emptyFloating1:`_emptyFloating1_1d1de_2381`,emptyFloating2:`_emptyFloating2_1d1de_2390`,emptyFloating3:`_emptyFloating3_1d1de_2399`,backBtn:`_backBtn_1d1de_2408`,hasActiveChat:`_hasActiveChat_1d1de_2449`,standardHeader:`_standardHeader_1d1de_2580`,mobileSelectionHeader:`_mobileSelectionHeader_1d1de_2587`,selectionLeft:`_selectionLeft_1d1de_2596`,selectionTitle:`_selectionTitle_1d1de_2604`,selectionActions:`_selectionActions_1d1de_2613`,selectionActionBtn:`_selectionActionBtn_1d1de_2620`,selectionActionDanger:`_selectionActionDanger_1d1de_2642`,hasMobileSelection:`_hasMobileSelection_1d1de_2653`,bubbleSelected:`_bubbleSelected_1d1de_2661`},NP=({conversation:e,actions:t,onRequestDelete:n})=>{let r={label:e.isGroup?`Delete group`:`Delete chat`,icon:(0,D.jsx)(ni,{size:14}),danger:!0,onSelect:()=>{n(e)}};return e.archived?[{label:`Unarchive`,icon:(0,D.jsx)(kn,{size:14}),onSelect:()=>{t.toggleArchive(e)}},r]:[{label:e.favourite?`Remove from Favourites`:`Add to Favourites`,icon:(0,D.jsx)(Zr,{size:14}),onSelect:()=>{t.toggleFavourite(e)}},{label:e.pinned?`Unpin`:`Pin to top`,icon:(0,D.jsx)(Nr,{size:14}),onSelect:()=>{t.togglePin(e)}},{label:`Archive`,icon:(0,D.jsx)(An,{size:14}),onSelect:()=>{t.toggleArchive(e)}},r]},PP=e=>(0,D.jsx)(FT,{align:`end`,trigger:(0,D.jsx)(`button`,{type:`button`,className:K.rowMenuBtn,"aria-label":`Chat options`,children:(0,D.jsx)(tr,{size:15})}),items:NP(e)}),FP=({conversation:e,active:t,actions:n,onSelect:r,onRequestDelete:i})=>{let a=JN(),o=e.peerUserId,s=vP(e=>o===null?void 0:e.presence[o]?.online),c=o===null?e.online:s??e.online,l=MP(e.lastMessageAt??``,a.display)||e.lastTime;return(0,D.jsxs)(A.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:T(K.row,t&&K.rowActive),children:[(0,D.jsxs)(`button`,{type:`button`,className:K.rowMain,onClick:r,children:[(0,D.jsxs)(`span`,{className:K.rowAvatar,style:E({"--avatar-color":e.color}),children:[e.initials,c&&(0,D.jsx)(`span`,{className:K.onlineDot})]}),(0,D.jsxs)(`span`,{className:K.rowBody,children:[(0,D.jsxs)(`span`,{className:K.rowTop,children:[(0,D.jsxs)(`span`,{className:K.rowName,children:[e.pinned&&(0,D.jsx)(Nr,{size:12,className:K.rowPin}),e.favourite&&(0,D.jsx)(Zr,{size:12,className:K.rowStar}),(0,D.jsx)(`span`,{className:K.rowTitle,children:e.title})]}),(0,D.jsx)(`span`,{className:K.rowTime,children:l})]}),(0,D.jsxs)(`span`,{className:K.rowBottom,children:[(0,D.jsxs)(`span`,{className:K.rowPreview,children:[(0,D.jsx)(`span`,{className:K.rowRole,children:e.subtitle}),` `,e.lastMessage]}),e.unread>0&&(0,D.jsx)(`span`,{className:K.unread,children:e.unread})]})]})]}),(0,D.jsx)(PP,{conversation:e,actions:n,onRequestDelete:i})]})},IP=(0,n.createContext)(null),LP=()=>{let e=(0,n.useContext)(IP);if(e===null)throw Error(`Chat hooks must be used within <ChatModuleProvider>.`);return e},RP=[`chat`,`conversations`],zP=[`chat`,`conversation-counts`],BP=e=>[`chat`,`conversation`,e],VP=20,HP=(e,t,n={})=>{let{listConversations:r}=LP(),i=t.trim(),a=wN({queryKey:[...RP,e,i],enabled:n.enabled??!0,initialPageParam:0,queryFn:({pageParam:t})=>P(r.execute({scope:e,filter:i,skipCount:t,maxResultCount:VP})),placeholderData:vM,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.items.length,0);return n<e.totalCount?n:void 0}});return{data:a.data?.pages.flatMap(e=>e.items),isPending:a.isPending,isSuccess:a.isSuccess,error:a.error,hasNextPage:a.hasNextPage,isFetchingNextPage:a.isFetchingNextPage,fetchNextPage:()=>{a.fetchNextPage()}}},UP=()=>{let{getConversationCounts:e}=LP();return SN({queryKey:zP,queryFn:()=>P(e.execute())})},WP=(e,t)=>{let n=e.getQueryCache().findAll({queryKey:RP});for(let e of n){let n=e.state.data?.pages.flatMap(e=>e.items).find(e=>e.id===t);if(n!==void 0)return{conversation:n,updatedAt:e.state.dataUpdatedAt}}},GP=e=>{let{getConversation:t}=LP(),n=sN(),r=e===null?void 0:WP(n,e);return SN({queryKey:BP(e??``),enabled:e!==null,retry:!1,queryFn:()=>P(t.execute(e??``)),...r===void 0?{}:{initialData:r.conversation,initialDataUpdatedAt:r.updatedAt}})},KP=e=>{e.invalidateQueries({queryKey:RP,refetchType:`all`}),e.invalidateQueries({queryKey:zP})},qP=e=>{KP(e),e.invalidateQueries({queryKey:[`chat`,`conversation`]})},JP=e=>{e.invalidateQueries({queryKey:RP,refetchType:`all`}),e.invalidateQueries({queryKey:[`chat`,`conversation`]})},YP=(e,t,n)=>{e.setQueriesData({queryKey:RP},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?n(e):e)}))}),e.setQueryData(BP(t),e=>e===void 0?e:n(e))},XP=(e,t)=>{e.setQueriesData({queryKey:RP},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.filter(e=>e.id!==t),totalCount:Math.max(0,e.totalCount-1)}))}),e.removeQueries({queryKey:BP(t)})},ZP=(e,t)=>e.map(e=>{if(e.emoji===t||!e.reacted)return e;let n=e.count-1;return n>0?{...e,count:n,reacted:!1}:null}).filter(e=>e!==null),QP=(e,t,n)=>{let r=t.byUserId===n?ZP(e,t.emoji):e;return r.find(e=>e.emoji===t.emoji)===void 0?[...r,{emoji:t.emoji,count:1,reacted:t.byUserId===n}]:r.map(e=>e.emoji===t.emoji?{...e,count:e.count+1,reacted:e.reacted||t.byUserId===n}:e)},$P=(e,t,n)=>e.map(e=>e.emoji===t.emoji?{...e,count:e.count-1,reacted:t.byUserId===n?!1:e.reacted}:e).filter(e=>e.count>0),eF=(e,t,n)=>{if(!t.added&&!e.reactions.some(e=>e.emoji===t.emoji))return e;let r=t.added?QP(e.reactions,t,n):$P(e.reactions,t,n);return e.with({reactions:r})},tF=(e,t)=>new jP({id:e.id,kind:e.kind,title:e.title,subtitle:e.subtitle,initials:e.initials,color:e.color,online:e.online,unread:t,pinned:e.pinned,favourite:e.favourite,archived:e.archived,admin:e.admin,lastMessage:e.lastMessage,lastTime:e.lastTime,lastMessageAt:e.lastMessageAt,lastSynced:e.lastSynced,tenantId:e.tenantId,categoryId:e.categoryId,members:e.members,adminIds:e.adminIds,data:e.data,peerUserId:e.peerUserId,memberReceipts:e.memberReceipts}),nF=(e,t,n)=>{e.setQueryData(zP,{...t,unread:Math.max(0,t.unread-1),favourites:n.favourite?Math.max(0,t.favourites-1):t.favourites,groups:n.group?Math.max(0,t.groups-1):t.groups,archived:n.archived?Math.max(0,t.archived-1):t.archived})},rF=async(e,t)=>{await e.cancelQueries({queryKey:zP}),await e.cancelQueries({queryKey:BP(t)});let n=e.getQueriesData({queryKey:RP}),r=e.getQueryData(zP),i=e.getQueryData(BP(t)),a=!1,o=!1,s=!1,c=!1;return i&&(a=i.unread>0,o=i.favourite,s=i.isGroup,c=i.archived,e.setQueryData(BP(t),tF(i,0))),e.setQueriesData({queryKey:RP},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?(i||(a=e.unread>0,o=e.favourite,s=e.isGroup,c=e.archived),tF(e,0)):e)}))}),a&&r&&nF(e,r,{favourite:o,group:s,archived:c}),{previousConversations:n,previousCounts:r,previousSingleConversation:i,conversationId:t}},iF=(e,t)=>{t&&(t.previousSingleConversation&&e.setQueryData(BP(t.conversationId),t.previousSingleConversation),t.previousConversations.forEach(([t,n])=>{e.setQueryData(t,n)}),t.previousCounts&&e.setQueryData(zP,t.previousCounts))},aF=()=>{let{markRead:e}=LP(),t=sN();return CN({mutationFn:({conversationId:t,uptoSequence:n})=>P(e.execute(t,n)),onMutate:({conversationId:e})=>rF(t,e),onError:(e,n,r)=>{iF(t,r)},onSettled:()=>{t.invalidateQueries({queryKey:zP})}})},oF=(e,t=`directory`)=>[`chat`,`staff`,t,e?.trim().toLowerCase()??``],sF=[`chat`,`viewer`],cF=e=>[`chat`,`messages`,e],lF=(e,t=`directory`)=>{let{listStaff:n,getGroupMemberPool:r}=LP(),i=e?.trim()??``,a=t===`groupPool`?r:n;return SN({queryKey:oF(i,t),queryFn:()=>P(a.execute(i||void 0))})},uF=()=>{let{getViewer:e}=LP();return SN({queryKey:sF,queryFn:()=>P(e.execute()),retry:1})},dF=e=>{let{getMessages:t}=LP();return SN({queryKey:cF(e??``),enabled:e!==null,queryFn:()=>P(t.execute(e??``))})},fF=e=>{let t=sN();return CN({mutationFn:e,onSuccess:()=>{qP(t)}})},pF=()=>{let{setFavourite:e}=LP(),t=sN();return CN({mutationFn:({id:t,value:n})=>P(e.execute(t,n)),onSuccess:(e,{id:n,value:r})=>{YP(t,n,e=>e.with({favourite:r})),qP(t)}})},mF=()=>{let{setArchived:e}=LP(),t=sN();return CN({mutationFn:({id:t,value:n})=>P(e.execute(t,n)),onSuccess:(e,{id:n,value:r})=>{YP(t,n,e=>e.with({archived:r})),qP(t)}})},hF=()=>{let{setPinned:e}=LP(),t=sN();return CN({mutationFn:({id:t,value:n})=>P(e.execute(t,n)),onSuccess:(e,{id:n,value:r})=>{YP(t,n,e=>e.with({pinned:r})),qP(t)}})},gF=()=>{let{deleteConversation:e}=LP(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:(e,n)=>{XP(t,n),qP(t)}})},_F=()=>{let{leaveConversation:e}=LP(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:(e,n)=>{XP(t,n),qP(t)}})},vF=()=>{let{refreshPortal:e}=LP();return fF(t=>P(e.execute(t)))},yF=e=>{let{saveMembers:t}=LP(),n=sN(),{data:r}=uF();return CN({mutationFn:({members:n,adminIds:r})=>P(t.execute(e,n,r)),onSuccess:(t,{members:i,adminIds:a})=>{let o=r?.id??``,s=i.some(e=>e.id===o);o!==``&&!s?XP(n,e):YP(n,e,e=>e.with({members:i,adminIds:a,admin:a.includes(o)})),JP(n),n.invalidateQueries({queryKey:cF(e)})}})},bF=()=>{let{startDirect:e}=LP(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{qP(t)}})},xF=()=>{let{createGroup:e}=LP(),t=sN();return CN({mutationFn:({title:t,memberIds:n})=>P(e.execute(t,n)),onSuccess:()=>{qP(t)}})},SF=e=>{let{reactToMessage:t}=LP(),n=sN(),r=uF().data?.id??``,i=cF(e);return CN({mutationFn:({messageId:n,emoji:r})=>P(t.execute(e,n,r)),onMutate:async({messageId:e,emoji:t})=>{await n.cancelQueries({queryKey:i});let a=n.getQueryData(i),o=!((a?.find(t=>t.id===e))?.reactions.some(e=>e.emoji===t&&e.reacted)??!1);return n.setQueryData(i,n=>n?.map(n=>n.id===e?eF(n,{emoji:t,byUserId:r,added:o},r):n)),{previous:a}},onError:(e,t,r)=>{r?.previous!==void 0&&n.setQueryData(i,r.previous)}})},CF=e=>{let{editMessage:t}=LP(),n=sN();return CN({mutationFn:({messageId:n,text:r})=>P(t.execute(e,n,r)),onSuccess:t=>{n.setQueryData(cF(e),e=>e?.map(e=>e.id===t.id?t:e)??[t])}})},wF=e=>{let{deleteMessage:t}=LP(),n=sN();return CN({mutationFn:n=>P(t.execute(e,n)),onSuccess:(t,r)=>{n.setQueryData(cF(e),e=>e?.map(e=>e.id===r?e.asDeletedForEveryone():e)??[])}})},TF=e=>{let{deleteMessageForMe:t}=LP();return CN({mutationFn:n=>P(t.execute(e,n))})},EF=(e,t)=>e.trim().length>0&&t.length>0,DF=(e,t)=>e.includes(t)?e.filter(e=>e!==t):[...e,t],OF=(e,t)=>{let[r,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let n=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(n)}},[e,t]),r},kF=(e,t=`directory`)=>{let[r,i]=(0,n.useState)(``),a=OF(r,250),o=lF(a,t);return{search:r,setSearch:i,results:(o.data??[]).filter(t=>!e.includes(t.id)),loading:o.isFetching,hasQuery:a.trim().length>0}},AF=({excludeIds:e,selectedIds:t,onToggle:n})=>{let{search:r,setSearch:i,results:a,loading:o,hasQuery:s}=kF(e,`groupPool`);return(0,D.jsxs)(`div`,{className:K.addPanel,children:[(0,D.jsxs)(`div`,{className:K.addPanelSearch,children:[(0,D.jsx)(Hr,{size:14}),(0,D.jsx)(`input`,{className:K.searchInput,placeholder:`Search staff`,value:r,onChange:e=>{i(e.target.value)}}),o&&(0,D.jsx)(gi,{size:`sm`,label:`Searching staff`})]}),(0,D.jsxs)(`div`,{className:K.addPanelList,children:[a.map(e=>{let r=t.includes(e.id);return(0,D.jsxs)(`button`,{type:`button`,className:T(K.staffPickRow,r&&K.staffPickRowOn),"aria-pressed":r,onClick:()=>{n(e.id)},children:[(0,D.jsx)(`span`,{className:K.memberRowAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:K.memberRowBody,children:[(0,D.jsx)(`span`,{className:K.memberRowName,children:e.name}),(0,D.jsx)(`span`,{className:K.memberRowRole,children:e.role})]}),(0,D.jsx)(`span`,{className:T(K.pickCheck,r&&K.pickCheckOn),children:r&&(0,D.jsx)(Wn,{size:13})})]},e.id)}),a.length===0&&!o&&(0,D.jsx)(`p`,{className:K.addPanelEmpty,children:s?`No staff match your search.`:`No teammates available to add yet.`})]})]})},jF=({valid:e,saving:t,onCancel:n,onSubmit:r})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(vi,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,D.jsx)(vi,{variant:`primary`,isLoading:t,disabled:!e,onClick:r,children:`Create group`})]}),MF=({open:e,excludeIds:t,onClose:r,onCreated:i})=>{let a=xF(),[o,s]=(0,n.useState)(``),[c,l]=(0,n.useState)([]),u=EF(o,c),d=()=>{s(``),l([]),r()};return(0,D.jsx)(Ky,{open:e,onOpenChange:e=>{e||d()},title:`New group`,description:`Name the group and pick the staff to add.`,footer:(0,D.jsx)(jF,{valid:u,saving:a.isPending,onCancel:d,onSubmit:()=>{u&&a.mutate({title:o,memberIds:c},{onSuccess:e=>{s(``),l([]),i(e)}})}}),children:(0,D.jsxs)(`div`,{className:K.newGroupBody,children:[(0,D.jsx)(Si,{label:`Group name`,placeholder:`e.g. Autumn Intake Counsellors`,value:o,onChange:e=>{s(e.target.value)}}),(0,D.jsxs)(`div`,{className:K.membersSectionLabel,children:[`MEMBERS · `,c.length]}),(0,D.jsx)(AF,{excludeIds:t,selectedIds:c,onToggle:e=>{l(t=>DF(t,e))}}),a.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not create group`,children:a.error.message})]})})},NF=({excludeIds:e,isPending:t,onPick:n})=>{let{search:r,setSearch:i,results:a,loading:o,hasQuery:s}=kF(e);return(0,D.jsxs)(`div`,{className:K.addPanel,children:[(0,D.jsxs)(`div`,{className:K.addPanelSearch,children:[(0,D.jsx)(Hr,{size:14}),(0,D.jsx)(`input`,{className:K.searchInput,placeholder:`Search staff`,value:r,onChange:e=>{i(e.target.value)}}),o&&(0,D.jsx)(gi,{size:`sm`,label:`Searching staff`})]}),(0,D.jsxs)(`div`,{className:K.addPanelList,children:[a.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:K.staffPickRow,disabled:t,onClick:()=>{n(e)},children:[(0,D.jsx)(`span`,{className:K.memberRowAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:K.memberRowBody,children:[(0,D.jsx)(`span`,{className:K.memberRowName,children:e.name}),(0,D.jsx)(`span`,{className:K.memberRowRole,children:e.role})]})]},e.id)),a.length===0&&!o&&(0,D.jsx)(`p`,{className:K.addPanelEmpty,children:s?`No staff match your search.`:`No teammates available to message yet.`})]}),t&&(0,D.jsx)(`div`,{className:K.pickerPending,children:(0,D.jsx)(gi,{size:`sm`,label:`Starting chat`})})]})},PF=({onSelectDirect:e,onSelectGroup:t})=>[{id:`new-chat`,label:(0,D.jsxs)(`div`,{className:K.menuItemContent,children:[(0,D.jsx)(`div`,{className:K.chatIconTile,children:(0,D.jsx)(Sr,{size:18})}),(0,D.jsxs)(`div`,{className:K.menuItemText,children:[(0,D.jsx)(`span`,{className:K.menuItemTitle,children:`New chat`}),(0,D.jsx)(`span`,{className:K.menuItemSub,children:`Direct message a contact`})]})]}),onSelect:e},{id:`new-group`,label:(0,D.jsxs)(`div`,{className:K.menuItemContent,children:[(0,D.jsx)(`div`,{className:K.groupIconTile,children:(0,D.jsx)(ai,{size:18})}),(0,D.jsxs)(`div`,{className:K.menuItemText,children:[(0,D.jsx)(`span`,{className:K.menuItemTitle,children:`New group`}),(0,D.jsx)(`span`,{className:K.menuItemSub,children:`Create a group chat`})]})]}),onSelect:t}],FF=({onOpenConversation:e})=>{let[t,r]=(0,n.useState)(`none`),i=uF(),a=bF(),o=i.data?[i.data.id]:[],s=()=>{r(`none`)},c=t=>{s(),e(t.id)},l=e=>{a.mutate(e.id,{onSuccess:c,onError:()=>{j.error(`Could not start that chat`)}})},u=PF({onSelectDirect:()=>{r(`direct`)},onSelectGroup:()=>{r(`group`)}});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(FT,{align:`end`,trigger:(0,D.jsx)(`button`,{type:`button`,className:K.composeBtn,"aria-label":`New conversation`,children:(0,D.jsx)(Or,{size:16})}),items:u}),(0,D.jsx)(Ky,{open:t===`direct`,onOpenChange:e=>{e||s()},title:`New direct message`,description:`Pick a staff member to message.`,children:(0,D.jsx)(NF,{excludeIds:o,isPending:a.isPending,onPick:l})}),(0,D.jsx)(MF,{open:t===`group`,excludeIds:o,onClose:s,onCreated:c})]})},IF=[{id:`all`,label:`All`},{id:`unread`,label:`Unread`},{id:`favourites`,label:`Favourites`},{id:`groups`,label:`Groups`},{id:`archive`,label:`Archive`}],LF=(e,t)=>{if(e===void 0)return null;let n=t===`archive`?e.archived:t===`unread`?e.unread:t===`favourites`?e.favourites:t===`groups`?e.groups:0;return n>0?n:null},RF=e=>(e?.unread??0)>0,zF={type:`spring`,stiffness:420,damping:34},BF=({entry:e,active:t,counts:n,onSelect:r})=>{let i=e.id===t,a=LF(n,e.id),o=e.id===`all`&&RF(n);return(0,D.jsxs)(`button`,{type:`button`,className:T(K.tab,i&&K.tabActive),onClick:()=>{r(e.id)},children:[i&&(0,D.jsx)(A.span,{layoutId:`chatTabBg`,className:K.tabBg,transition:zF}),(0,D.jsx)(`span`,{className:K.tabLabel,children:e.label}),a!==null&&(0,D.jsx)(`span`,{className:K.tabCount,children:a}),o&&(0,D.jsx)(`span`,{className:K.tabDot})]})},VF=({active:e,counts:t,onSelect:r})=>{let i=(0,n.useRef)(null),[a,o]=(0,n.useState)(!1),[s,c]=(0,n.useState)(!1),l=()=>{let e=i.current;e&&(o(e.scrollLeft>1),c(e.scrollLeft<e.scrollWidth-e.clientWidth-1))};(0,n.useEffect)(()=>{let e=i.current;if(e)return l(),e.addEventListener(`scroll`,l),window.addEventListener(`resize`,l),()=>{e.removeEventListener(`scroll`,l),window.removeEventListener(`resize`,l)}},[t,e]);let u=e=>{i.current?.scrollBy({left:e===`left`?-80:80,behavior:`smooth`})};return(0,D.jsxs)(`div`,{className:K.tabsWrapper,children:[a&&(0,D.jsx)(`button`,{type:`button`,className:T(K.arrowBtn,K.arrowLeft),onClick:()=>{u(`left`)},"aria-label":`Scroll left`,children:(0,D.jsx)(Kn,{size:14})}),(0,D.jsx)(`div`,{className:K.tabs,ref:i,children:IF.map(n=>(0,D.jsx)(BF,{entry:n,active:e,counts:t,onSelect:r},n.id))}),s&&(0,D.jsx)(`button`,{type:`button`,className:T(K.arrowBtn,K.arrowRight),onClick:()=>{u(`right`)},"aria-label":`Scroll right`,children:(0,D.jsx)(qn,{size:14})})]})},HF=({virtualRow:e,measureElement:t,isLoaderRow:n,conversation:r,activeId:i,actions:a,isFetchingNextPage:o,onRequestDelete:s,onSelect:c})=>n?(0,D.jsx)(`div`,{ref:t,"data-index":e.index,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${String(e.start)}px)`},children:o&&(0,D.jsx)(`div`,{className:K.loadMore,children:(0,D.jsx)(gi,{size:`sm`,label:`Loading more chats`})})}):r?(0,D.jsx)(`div`,{ref:t,"data-index":e.index,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${String(e.start)}px)`},children:(0,D.jsx)(FP,{conversation:r,active:r.id===i,actions:a,onSelect:()=>{c(r.id)},onRequestDelete:s})}):null,UF=({conversations:e,activeId:t,actions:r,hasNextPage:i,isFetchingNextPage:a,onLoadMore:o,onRequestDelete:s,onSelect:c})=>{let l=(0,n.useRef)(null),u=RD({count:i?e.length+1:e.length,getScrollElement:()=>l.current,estimateSize:()=>54,overscan:10}),d=u.getVirtualItems();return(0,n.useEffect)(()=>{let t=d[d.length-1];t!==void 0&&t.index>=e.length-1&&i&&!a&&o()},[d,i,a,e.length,o]),(0,D.jsxs)(`div`,{className:K.rows,ref:l,children:[(0,D.jsx)(`div`,{style:{height:`${String(u.getTotalSize())}px`,width:`100%`,position:`relative`},children:d.map(n=>(0,D.jsx)(HF,{virtualRow:n,measureElement:u.measureElement,isLoaderRow:n.index>e.length-1,conversation:e[n.index],activeId:t,actions:r,isFetchingNextPage:a,onRequestDelete:s,onSelect:c},n.index>e.length-1?`loader`:e[n.index]?.id??n.index))}),e.length===0&&!i&&!a&&(0,D.jsx)(`p`,{className:K.empty,children:`No conversations here.`})]})},WF=({conversations:e,activeId:t,actions:n,filter:r,hasNextPage:i,isFetchingNextPage:a,onLoadMore:o,onRequestDelete:s,onSelect:c})=>(0,D.jsxs)(`div`,{className:K.list,children:[(0,D.jsxs)(`div`,{className:K.listHead,children:[(0,D.jsx)(`h1`,{className:K.listTitle,children:`Chats`}),(0,D.jsx)(FF,{onOpenConversation:c})]}),(0,D.jsxs)(`div`,{className:K.search,children:[(0,D.jsx)(Hr,{size:14}),(0,D.jsx)(`input`,{className:K.searchInput,placeholder:`Search conversations`,value:r.search,onChange:e=>{r.onSearchChange(e.target.value)}}),r.search.length>0&&(0,D.jsx)(`button`,{type:`button`,className:K.searchClearBtn,"aria-label":`Clear search`,onClick:()=>{r.onSearchChange(``)},children:(0,D.jsx)(ci,{size:14})})]}),(0,D.jsx)(VF,{active:r.tab,counts:r.counts,onSelect:r.onTabChange}),(0,D.jsx)(UF,{conversations:e,activeId:t,actions:n,hasNextPage:i,isFetchingNextPage:a,onLoadMore:o,onRequestDelete:s,onSelect:c})]}),GF={root:`_root_1tuup_1`,list:`_list_1tuup_7`,listHead:`_listHead_1tuup_17`,title:`_title_1tuup_21`,pulse:`_pulse_1tuup_1`,search:`_search_1tuup_30`,rows:`_rows_1tuup_38`,row:`_row_1tuup_38`,rowAvatar:`_rowAvatar_1tuup_53`,rowBody:`_rowBody_1tuup_62`,line:`_line_1tuup_69`,medium:`_medium_1tuup_76`,full:`_full_1tuup_80`,view:`_view_1tuup_84`,viewHead:`_viewHead_1tuup_91`,messages:`_messages_1tuup_100`,bubbleWrap:`_bubbleWrap_1tuup_108`,me:`_me_1tuup_76`,bubbleAvatar:`_bubbleAvatar_1tuup_118`,bubble:`_bubble_1tuup_108`,narrow:`_narrow_1tuup_139`,wide:`_wide_1tuup_143`},KF=()=>(0,D.jsxs)(`div`,{className:GF.root,children:[(0,D.jsxs)(`div`,{className:GF.list,children:[(0,D.jsx)(`div`,{className:GF.listHead,children:(0,D.jsx)(`div`,{className:GF.title})}),(0,D.jsx)(`div`,{className:GF.search}),(0,D.jsx)(`div`,{className:GF.rows,children:[1,2,3,4,5].map(e=>(0,D.jsxs)(`div`,{className:GF.row,children:[(0,D.jsx)(`div`,{className:GF.rowAvatar}),(0,D.jsxs)(`div`,{className:GF.rowBody,children:[(0,D.jsx)(`div`,{className:T(GF.line,GF.medium)}),(0,D.jsx)(`div`,{className:T(GF.line,GF.full)})]})]},e))})]}),(0,D.jsxs)(`div`,{className:GF.view,children:[(0,D.jsxs)(`div`,{className:GF.viewHead,children:[(0,D.jsx)(`div`,{className:GF.rowAvatar}),(0,D.jsxs)(`div`,{className:GF.rowBody,children:[(0,D.jsx)(`div`,{className:T(GF.line,GF.medium)}),(0,D.jsx)(`div`,{className:T(GF.line,GF.medium,GF.narrow)})]})]}),(0,D.jsxs)(`div`,{className:GF.messages,children:[(0,D.jsxs)(`div`,{className:GF.bubbleWrap,children:[(0,D.jsx)(`div`,{className:GF.bubbleAvatar}),(0,D.jsx)(`div`,{className:GF.bubble})]}),(0,D.jsx)(`div`,{className:T(GF.bubbleWrap,GF.me),children:(0,D.jsx)(`div`,{className:GF.bubble})}),(0,D.jsxs)(`div`,{className:GF.bubbleWrap,children:[(0,D.jsx)(`div`,{className:GF.bubbleAvatar}),(0,D.jsx)(`div`,{className:T(GF.bubble,GF.wide)})]})]})]})]}),qF=class{gateway;constructor(e){this.gateway=e.usageGateway}execute(e){return this.gateway.listUsage(e)}},JF=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.rotateSecret(e)}},YF=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(){return this.gateway.getWebhookData()}},XF=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.retryWebhook(e)}},ZF=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.skipWebhook(e)}},QF=class{gateway;constructor(e){this.gateway=e.groupCategoriesGateway}execute(){return this.gateway.listGroupCategories()}},$F=class{gateway;constructor(e){this.gateway=e.groupCategoriesGateway}execute(e){return this.gateway.saveGroupCategory(e)}},eI=class{gateway;constructor(e){this.gateway=e.groupCategoriesGateway}execute(e){return this.gateway.deleteGroupCategory(e)}},tI=class{gateway;constructor(e){this.gateway=e.groupProvisioningGateway}execute(e){return this.gateway.provisionGroup(e)}},nI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(){return this.gateway.listWebhookEndpoints()}},rI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.saveWebhookEndpoint(e)}},iI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.deleteWebhookEndpoint(e)}},aI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.sendTestEvent(e)}},oI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(){return this.gateway.listPromoCategories()}},sI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.savePromoCategories(e)}},cI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(){return this.gateway.listCommTemplates()}},lI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.saveCommTemplate(e)}},uI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.deleteCommTemplate(e)}},dI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(){return this.gateway.listPromotions()}},fI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.savePromotion(e)}},pI=class{gateway;constructor(e){this.gateway=e.settingsGateway}execute(e){return this.gateway.deletePromotion(e)}},mI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}execute(){return this.gateway.getContentPrefs()}},hI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}execute(e){return this.gateway.saveContentPrefs(e)}},gI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}execute(){return this.gateway.listFeedCategories()}},_I=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}execute(e){return this.gateway.saveFeedCategories(e)}},vI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}async execute(){return this.gateway.listFeedTemplates()}},yI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}async execute(e){return this.gateway.saveFeedTemplate(e)}},bI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}async execute(e){return this.gateway.deleteFeedTemplate(e)}},xI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}async execute(e){return this.gateway.listFeedCategoryItems(e)}},SI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}async execute(e,t){return this.gateway.listExternalFeedCategoryItems(e,t)}},CI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}async execute(e){return this.gateway.saveFeedCategoryItem(e)}},wI=class{gateway;constructor(e){this.gateway=e.feedPrefsGateway}async execute(e){return this.gateway.deleteFeedCategoryItem(e)}},TI=class extends ui{},q=class extends TI{code=`SETTINGS_UNAVAILABLE`;constructor(e){super(`This settings area is currently unavailable. Please try again.`,{cause:e})}},EI=class extends TI{code=`SETTINGS_INVALID_FIELD`;constructor(e){super(e)}},DI=[{id:`text`,label:`Text`},{id:`id`,label:`ID / Code`},{id:`pill`,label:`Status pill`},{id:`date`,label:`Date`},{id:`link`,label:`Link`},{id:`person`,label:`Person`}],OI=[`Hash`,`GraduationCap`,`Users`,`Building2`,`Briefcase`,`BookOpen`,`Globe`],kI=(e,t)=>e.branchHours[t]??e.defaultHours,AI=e=>Object.values(e).every(e=>e.active?QD.create(e.from,e.to).ok:!0),jI=e=>AI(e.defaultHours)&&Object.values(e.branchHours).every(e=>AI(e));({commission:[{token:`university`,label:`University`,description:`Partner university name`},{token:`commission_amount`,label:`Commission amount`,description:`Payout per enrolled student`,type:`currency`},{token:`commission_group`,label:`Commission group`,description:`Tier / group label (e.g. Gold)`,type:`badge`},{token:`minimum_student_requirement`,label:`Minimum students`,description:`Students needed to qualify`,type:`number`},{token:`account_intake`,label:`Intake`,description:`Eligible intake window`},{token:`start_from`,label:`Start date`,description:`When the deal becomes active`,type:`date`}],university:[{token:`university_name`,label:`University name`,description:`Name of the new university`},{token:`location`,label:`Location`,description:`City / country`},{token:`ranking`,label:`Ranking`,description:`League-table position or "New"`,type:`badge`},{token:`added_date`,label:`Added date`,description:`When it joined the catalog`,type:`date`}],course:[{token:`course_name`,label:`Course name`,description:`Name of the new course`},{token:`university`,label:`University`,description:`University offering the course`},{token:`level`,label:`Level`,description:`e.g. Undergraduate, Masters`},{token:`intake`,label:`Intake`,description:`Available intake window`},{token:`mode`,label:`Mode`,description:`On-campus, Online or Blended`}],event:[{token:`event_title`,label:`Event title`,description:`Name of the event`},{token:`event_location`,label:`Event location`,description:`Venue or "Online"`},{token:`event_date`,label:`Event date`,description:`When the event runs`,type:`date`},{token:`event_type`,label:`Event type`,description:`Webinar, Open day, Workshop…`,type:`badge`}],generic:[{token:`item_title`,label:`Item title`,description:`Title of each promo item you add`},{token:`item_description`,label:`Item description`,description:`Short line under the title`},{token:`category_name`,label:`Category name`,description:`The category's display name`},{token:`badge`,label:`Badge`,description:`Small label, e.g. "New" or "Hot"`,type:`badge`}]}).generic;var MI=e=>[...e.matchAll(/\{\{\s*([a-z0-9_]+)\s*\}\}/gi)].map(e=>e[1]??``).filter(e=>e!==``),NI=(e,t)=>{let n=MI(e);return n.length>0&&n.every(e=>(t[e]??``)===``)?``:e.replace(/\{\{\s*([a-z0-9_]+)\s*\}\}/gi,(e,n)=>t[n]??``)},PI=(e,t)=>({statusLabel:NI(e.statusLabel,t),mainHeader:NI(e.mainHeader,t),cardTitle:NI(e.cardTitle,t),cardSubtitle:NI(e.cardSubtitle,t),dateLine:NI(e.dateLine,t),badgeText:NI(e.badgeText,t),amountText:NI(e.amountText,t),ctaText:NI(e.ctaText,t)}),FI={2:3e3,3:2500,4:2e3,5:1500},II=class{id;name;role;level;msgs;audioCalls;audioMins;videoCalls;videoMins;constructor(e){this.id=e.id,this.name=e.name,this.role=e.role,this.level=e.level,this.msgs=e.msgs,this.audioCalls=e.audioCalls,this.audioMins=e.audioMins,this.videoCalls=e.videoCalls,this.videoMins=e.videoMins}get creditLimit(){return FI[this.level]??1500}get usagePct(){return Math.round(this.msgs/this.creditLimit*100)}},LI=class{gateway;constructor(e){this.gateway=e.orgSettingsGateway}execute(){return this.gateway.getOrgSettings()}},RI=class{gateway;constructor(e){this.gateway=e.orgSettingsGateway}execute(e){return jI(e)?this.gateway.saveOrgSettings(e):Promise.resolve(N(new EI(`Work hours start and end times cannot be identical.`)))}},zI=W(G({id:V(),name:V(),role:V(),level:H().int(),msgs:H().int(),audioCalls:H().int(),audioMins:H().int(),videoCalls:H().int(),videoMins:H().int(),creditLimit:H().int(),usagePct:H().int()})),BI=G({id:V().uuid(),name:V(),direction:ej([V(),H()]),owner:V().nullable().optional(),url:V().nullable().optional(),eventKey:V(),templateKey:V().optional(),isDataSource:U().optional(),secret:V(),status:ej([V(),H()]),health:G({lastDelivery:V().nullable().optional(),succeeded:H().int().nullable().optional(),failed:H().int().nullable().optional()}).nullable().optional(),extraProperties:rj($A()).optional()}),VI=G({items:W(BI),totalCount:H().int()}),HI=G({key:V(),label:V(),type:V(),icon:V().nullable().optional(),source:V().nullable().optional(),visible:U()});G({items:W(G({id:V().uuid(),tenantId:V().uuid().nullable().optional(),name:V(),description:V().nullable().optional(),accent:V(),icon:V(),locked:U(),fields:W(HI),webhookId:V().uuid().nullable().optional()})),totalCount:H().int()});var UI=G({id:V(),name:V(),slug:V(),desc:V(),cat:V(),url:V(),color:V(),status:ej([V(),H()]),webhooks:H().int(),lastSync:V()}),WI=G({key:V(),app:V(),desc:V(),ver:V(),hooks:H().int(),schema:V()}),GI=G({id:V(),webhook:V(),event:V(),reqId:V(),status:V(),code:H().int(),duration:H().int(),attempts:H().int(),ts:V()}),KI=G({id:V(),webhook:V(),event:V(),attempt:H().int(),nextRetry:V(),error:V()}),qI=G({id:V(),name:V(),desc:V(),cat:V(),fields:W(V()),event:V(),method:V(),url:V(),payload:V()}),JI=G({apps:W(UI),events:W(WI),logs:W(GI),retryQueue:W(KI),templates:W(qI)}),YI=e=>new II({id:e.id,name:e.name,role:e.role,level:e.level,msgs:e.msgs,audioCalls:e.audioCalls,audioMins:e.audioMins,videoCalls:e.videoCalls,videoMins:e.videoMins}),XI=e=>{if(typeof e==`number`)return e===1?`paused`:e===2?`error`:`active`;let t=e.toLowerCase();return t===`paused`?`paused`:t===`error`?`error`:`active`},ZI=e=>typeof e==`number`?e===1?`outbound`:`inbound`:e.toLowerCase()===`outbound`?`outbound`:`inbound`,QI=e=>{let t=e?.succeeded??0,n=e?.failed??0,r=t+n;return{lastDelivery:e?.lastDelivery??null,successRate:r===0?100:Math.round(t/r*100),failures:n}},$I=e=>({id:e.id,name:e.name,direction:ZI(e.direction),owner:e.owner??``,url:e.url??``,eventKey:e.eventKey,templateKey:e.templateKey??``,isDataSource:e.isDataSource??!1,secret:e.secret,status:XI(e.status),health:QI(e.health),extraProperties:e.extraProperties??{}}),eL=e=>({apps:e.apps.map(e=>({id:e.id,name:e.name,slug:e.slug,desc:e.desc,cat:e.cat,url:e.url,color:e.color,status:XI(e.status),webhooks:e.webhooks,lastSync:e.lastSync})),events:e.events.map(e=>({key:e.key,app:e.app,desc:e.desc,ver:e.ver,hooks:e.hooks,schema:e.schema})),logs:e.logs.map(e=>({id:e.id,webhook:e.webhook,event:e.event,reqId:e.reqId,status:e.status,code:e.code,duration:e.duration,attempts:e.attempts,ts:e.ts})),retryQueue:e.retryQueue.map(e=>({id:e.id,webhook:e.webhook,event:e.event,attempt:e.attempt,nextRetry:e.nextRetry,error:e.error})),templates:e.templates.map(e=>({id:e.id,name:e.name,desc:e.desc,cat:e.cat,fields:e.fields,event:e.event,method:e.method,url:e.url,payload:e.payload}))}),tL=`/api/app/usage`,nL={week:`Week`,month:`Month`,quarter:`Quarter`,all:`All`},rL=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-usage-gateway`)}async listUsage(e){try{let t=await this.httpClient.get(`${tL}?period=${nL[e]}`),n=zI.safeParse(t);return n.success?M(n.data.map(YI)):(this.logger.error(`Usage returned an unexpected shape`,n.error),N(new q(n.error)))}catch(e){return this.logger.error(`List usage failed`,e),N(new q(e))}}},iL=W(G({key:V(),label:V(),color:V(),templateIds:W(V()).optional().default([]),dataTemplateIds:W(V()).optional().default([]),webhookId:V().nullable().optional()})),aL=G({seeMore:W(V()),seeLess:W(V()),muted:W(V()),preferredDepts:W(V()),hiddenDepts:W(V()),priorityOn:U()}),oL=G({id:V().uuid(),name:V(),priority:H().int(),color:V(),active:U(),templateId:V(),webhookId:V().uuid().nullable().optional()}),sL=G({items:W(oL),totalCount:H().int()}),cL=W(oL),lL=G({token:V(),label:V(),description:V(),type:V()}),uL=G({id:V().uuid(),type:V(),name:V(),statusLabel:V(),mainHeader:V(),cardTitle:V(),cardSubtitle:V(),dateLine:V(),badgeText:V(),amountText:V(),ctaText:V(),custom:U(),fields:W(lL)}),dL=G({items:W(uL),totalCount:H().int()}),fL=G({id:V().uuid(),categoryId:V(),values:rj(V())}),pL=G({items:W(fL),totalCount:H().int()}),mL=G({id:V().uuid(),type:V(),name:V(),postTitle:V().optional().default(``),postBody:V().optional().default(``),custom:U().optional().default(!1),fields:W(lL).optional().default([])}),hL=G({items:W(mL),totalCount:H().int()}),gL=G({id:V().uuid(),categoryKey:V(),values:rj(V())}),_L=W(gL),vL=e=>({key:e.key,label:e.label,color:e.color,templateIds:e.templateIds,dataTemplateIds:e.dataTemplateIds,webhookId:e.webhookId??void 0}),yL=e=>({seeMore:e.seeMore,seeLess:e.seeLess,muted:e.muted,preferredDepts:e.preferredDepts,hiddenDepts:e.hiddenDepts,priorityOn:e.priorityOn}),bL=e=>({id:e.id,type:e.type,name:e.name,postTitle:e.postTitle,postBody:e.postBody,custom:e.custom,fields:e.fields.map(e=>({token:e.token,label:e.label,description:e.description,type:e.type}))}),xL=e=>({id:e.id,categoryKey:e.categoryKey,values:e.values}),SL=class{httpClient;settingsLogger;constructor(e){this.httpClient=e.httpClient,this.settingsLogger=e.logger.child(`http-feed-preferences-gateway`)}async getContentPrefs(){try{let e=await this.httpClient.get(`/api/app/feed/content-prefs`),t=aL.safeParse(e);return t.success?M(yL(t.data)):(this.settingsLogger.error(`Content preferences returned an unexpected shape`,t.error),N(new q(t.error)))}catch(e){return this.settingsLogger.error(`Get content preferences failed`,e),N(new q(e))}}async saveContentPrefs(e){try{let t=await this.httpClient.post(`/api/app/feed/save-content-prefs`,e),n=aL.safeParse(t);return n.success?M(yL(n.data)):(this.settingsLogger.error(`Saved content preferences returned an unexpected shape`,n.error),N(new q(n.error)))}catch(e){return this.settingsLogger.error(`Save content preferences failed`,e),N(new q(e))}}async listFeedCategories(){try{let e=await this.httpClient.get(`/api/app/feed/feed-categories`),t=iL.safeParse(e);return t.success?M(t.data.map(vL)):(this.settingsLogger.error(`Feed categories returned an unexpected shape`,t.error),N(new q(t.error)))}catch(e){return this.settingsLogger.error(`List feed categories failed`,e),N(new q(e))}}async saveFeedCategories(e){try{let t=await this.httpClient.post(`/api/app/feed/save-feed-categories`,{categories:[...e]}),n=iL.safeParse(t);return n.success?M(n.data.map(vL)):(this.settingsLogger.error(`Saved feed categories returned an unexpected shape`,n.error),N(new q(n.error)))}catch(e){return this.settingsLogger.error(`Save feed categories failed`,e),N(new q(e))}}async listFeedTemplates(){try{let e=await this.httpClient.get(`/api/app/feed/feed-templates`),t=hL.safeParse(e);return t.success?M(t.data.items.map(bL)):(this.settingsLogger.error(`Feed templates returned an unexpected shape`,t.error),N(new q(t.error)))}catch(e){return this.settingsLogger.error(`List feed templates failed`,e),N(new q(e))}}async saveFeedTemplate(e){try{let t={id:e.id.startsWith(`tpl-`)?null:e.id,type:e.type,name:e.name,postTitle:e.postTitle,postBody:e.postBody,custom:e.custom??!1,fields:e.fields??[]},n=await this.httpClient.post(`/api/app/feed/save-feed-template`,t),r=mL.safeParse(n);return r.success?M(bL(r.data)):(this.settingsLogger.error(`Save feed template returned an unexpected shape`,r.error),N(new q(r.error)))}catch(e){return this.settingsLogger.error(`Save feed template failed`,e),N(new q(e))}}async deleteFeedTemplate(e){try{return await this.httpClient.delete(`/api/app/feed/${e}/feed-template`),M(e)}catch(e){return this.settingsLogger.error(`Delete feed template failed`,e),N(new q(e))}}async listFeedCategoryItems(e){try{let t=e?`?categoryKey=${encodeURIComponent(e)}`:``,n=await this.httpClient.get(`/api/app/feed/feed-category-items${t}`),r=_L.safeParse(n);return r.success?M(r.data.map(xL)):(this.settingsLogger.error(`Feed category items returned an unexpected shape`,r.error),N(new q(r.error)))}catch(e){return this.settingsLogger.error(`List feed category items failed`,e),N(new q(e))}}async listExternalFeedCategoryItems(e,t){try{let n=t?`&query=${encodeURIComponent(t)}`:``,r=await this.httpClient.get(`/api/app/feed/external-category-items?categoryKey=${encodeURIComponent(e)}${n}`),i=_L.safeParse(r);return i.success?M(i.data.map(xL)):(this.settingsLogger.error(`External feed category items returned an unexpected shape`,i.error),N(new q(i.error)))}catch(e){return this.settingsLogger.error(`List external feed category items failed`,e),N(new q(e))}}async saveFeedCategoryItem(e){try{let t={id:e.id.startsWith(`item-`)||e.id.startsWith(`promo-`)?null:e.id,categoryKey:e.categoryKey,values:e.values},n=await this.httpClient.post(`/api/app/feed/save-feed-category-item`,t),r=gL.safeParse(n);return r.success?M(xL(r.data)):(this.settingsLogger.error(`Save feed category item returned an unexpected shape`,r.error),N(new q(r.error)))}catch(e){return this.settingsLogger.error(`Save feed category item failed`,e),N(new q(e))}}async deleteFeedCategoryItem(e){try{return await this.httpClient.delete(`/api/app/feed/${e}/feed-category-item`),M(e)}catch(e){return this.settingsLogger.error(`Delete feed category item failed`,e),N(new q(e))}}},CL=G({active:U(),from:V(),to:V()}),wL=G({mon:CL,tue:CL,wed:CL,thu:CL,fri:CL,sat:CL,sun:CL}),TL=G({id:V(),name:V(),address:V(),flag:V(),color:V(),timezone:V()}),EL=G({details:G({name:V(),headquarters:V()}),branches:W(TL),defaultHours:wL,branchHours:rj(V(),wL)}),DL=e=>({active:e.active,from:e.from,to:e.to}),OL=e=>({mon:DL(e.mon),tue:DL(e.tue),wed:DL(e.wed),thu:DL(e.thu),fri:DL(e.fri),sat:DL(e.sat),sun:DL(e.sun)}),kL=e=>({id:e.id,name:e.name,address:e.address,flag:e.flag,color:e.color,timezone:e.timezone}),AL=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]=OL(r);return t},jL=e=>({details:{name:e.details.name,headquarters:e.details.headquarters},branches:e.branches.map(kL),defaultHours:OL(e.defaultHours),branchHours:AL(e.branchHours)}),ML=e=>({name:e.details.name,headquarters:e.details.headquarters,branches:e.branches,defaultHours:e.defaultHours,branchHours:e.branchHours}),NL=`/api/app/org-settings`,PL=`/api/app/org-settings/save`,FL=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-org-settings-gateway`)}async getOrgSettings(){try{let e=await this.httpClient.get(NL);return this.parse(e,`Org settings`)}catch(e){return this.logger.error(`Get org settings failed`,e),N(new q(e))}}async saveOrgSettings(e){try{let t=await this.httpClient.post(PL,ML(e));return this.parse(t,`Saved org settings`)}catch(e){return this.logger.error(`Save org settings failed`,e),N(new q(e))}}parse(e,t){let n=EL.safeParse(e);return n.success?M(jL(n.data)):(this.logger.error(`${t} returned an unexpected shape`,n.error),N(new q(n.error)))}},IL=e=>({id:e.id,name:e.name,priority:e.priority,color:e.color,active:e.active,templateId:e.templateId,webhookId:e.webhookId??null}),LL=e=>({id:e.id,type:e.type,name:e.name,statusLabel:e.statusLabel,mainHeader:e.mainHeader,cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,dateLine:e.dateLine,badgeText:e.badgeText,amountText:e.amountText,ctaText:e.ctaText,custom:e.custom,fields:e.fields.map(e=>({token:e.token,label:e.label,description:e.description,type:e.type||`text`}))}),RL=e=>({id:e.id,categoryId:e.categoryId,values:{...e.values}}),zL=class{httpClient;settingsLogger;constructor(e){this.httpClient=e.httpClient,this.settingsLogger=e.logger.child(`http-promotions-gateway`)}async listPromoCategories(){try{let e=await this.httpClient.get(`/api/app/promo-category?maxResultCount=1000`),t=sL.safeParse(e);return t.success?M(t.data.items.map(IL)):(this.settingsLogger.error(`Promo categories returned an unexpected shape`,t.error),N(new q(t.error)))}catch(e){return this.settingsLogger.error(`List promo categories failed`,e),N(new q(e))}}async savePromoCategories(e){try{let t=e.map(e=>({id:e.id.startsWith(`pc-`)||e.id===`new`?null:e.id,name:e.name,color:e.color,active:e.active,templateId:e.templateId,webhookId:e.webhookId})),n=await this.httpClient.post(`/api/app/promo-category/save-list`,t),r=cL.safeParse(n);return r.success?M(r.data.map(IL)):(this.settingsLogger.error(`Save promo categories returned an unexpected shape`,r.error),N(new q(r.error)))}catch(e){return this.settingsLogger.error(`Save promo categories failed`,e),N(new q(e))}}async listCommTemplates(){try{let e=await this.httpClient.get(`/api/app/comm-template?maxResultCount=1000`),t=dL.safeParse(e);return t.success?M(t.data.items.map(LL)):(this.settingsLogger.error(`Comm templates returned an unexpected shape`,t.error),N(new q(t.error)))}catch(e){return this.settingsLogger.error(`List comm templates failed`,e),N(new q(e))}}async saveCommTemplate(e){try{let t={id:e.id.startsWith(`tpl-`)?null:e.id,type:e.type,name:e.name,statusLabel:e.statusLabel,mainHeader:e.mainHeader,cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,dateLine:e.dateLine,badgeText:e.badgeText,amountText:e.amountText,ctaText:e.ctaText,custom:e.custom??!1,fields:e.fields??[]},n=await this.httpClient.post(`/api/app/comm-template/save`,t),r=uL.safeParse(n);return r.success?M(LL(r.data)):(this.settingsLogger.error(`Save comm template returned an unexpected shape`,r.error),N(new q(r.error)))}catch(e){return this.settingsLogger.error(`Save comm template failed`,e),N(new q(e))}}async deleteCommTemplate(e){try{return await this.httpClient.delete(`/api/app/comm-template/${e}`),M(e)}catch(e){return this.settingsLogger.error(`Delete comm template failed`,e),N(new q(e))}}async listPromotions(){try{let e=await this.httpClient.get(`/api/app/promotion?maxResultCount=1000`),t=pL.safeParse(e);return t.success?M(t.data.items.map(RL)):(this.settingsLogger.error(`Promotions returned an unexpected shape`,t.error),N(new q(t.error)))}catch(e){return this.settingsLogger.error(`List promotions failed`,e),N(new q(e))}}async savePromotion(e){try{let t={id:e.id,categoryId:e.categoryId,values:e.values},n=await this.httpClient.post(`/api/app/promotion/save`,t),r=fL.safeParse(n);return r.success?M(RL(r.data)):(this.settingsLogger.error(`Save promotion returned an unexpected shape`,r.error),N(new q(r.error)))}catch(e){return this.settingsLogger.error(`Save promotion failed`,e),N(new q(e))}}async deletePromotion(e){try{return await this.httpClient.delete(`/api/app/promotion/${e}`),M(e)}catch(e){return this.settingsLogger.error(`Delete promotion failed`,e),N(new q(e))}}},BL=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-webhook-gateway`)}async listWebhookEndpoints(){try{let e=await this.httpClient.get(`/api/app/webhook-endpoint?maxResultCount=1000`),t=VI.safeParse(e);return t.success?M(t.data.items.map($I)):(this.logger.error(`Webhook endpoints returned unexpected shape`,t.error),N(new q(t.error)))}catch(e){return this.logger.error(`List webhook endpoints failed`,e),N(new q(e))}}async saveWebhookEndpoint(e){try{let t={id:e.id,name:e.name,direction:e.direction===`inbound`?0:1,owner:e.owner,url:e.url,eventKey:e.eventKey,templateKey:e.templateKey,secret:e.secret,status:e.status===`active`?0:e.status===`paused`?1:2,extraProperties:e.extraProperties},n=await this.httpClient.post(`/api/app/webhook-endpoint/save`,t),r=BI.safeParse(n);return r.success?M($I(r.data)):(this.logger.error(`Saved webhook endpoint returned unexpected shape`,r.error),N(new q(r.error)))}catch(e){return this.logger.error(`Save webhook endpoint failed`,e),N(new q(e))}}async deleteWebhookEndpoint(e){try{return await this.httpClient.delete(`/api/app/webhook-endpoint/${e}`),M(e)}catch(e){return this.logger.error(`Delete webhook endpoint failed`,e),N(new q(e))}}async rotateSecret(e){try{let t=await this.httpClient.post(`/api/app/webhook-endpoint/${e}/rotate-secret`),n=BI.safeParse(t);return n.success?M($I(n.data)):(this.logger.error(`Rotated secret returned unexpected shape`,n.error),N(new q(n.error)))}catch(e){return this.logger.error(`Rotate signing secret failed`,e),N(new q(e))}}async getWebhookData(){try{let e=await this.httpClient.get(`/api/app/webhook-endpoint/webhook-data`),t=JI.safeParse(e);return t.success?M(eL(t.data)):(this.logger.error(`Webhook overview data returned unexpected shape`,t.error),N(new q(t.error)))}catch(e){return this.logger.error(`Get webhook overview data failed`,e),N(new q(e))}}async sendTestEvent(e){try{return await this.httpClient.post(`/api/app/webhook-endpoint/${e}/send-test-event`),M(void 0)}catch(e){return this.logger.error(`Send test event failed`,e),N(new q(e))}}async retryWebhook(e){try{return await this.httpClient.post(`/api/app/webhook-delivery/${e}/retry`),M(void 0)}catch(e){return this.logger.error(`Retry webhook delivery failed`,e),N(new q(e))}}async skipWebhook(e){try{return await this.httpClient.post(`/api/app/webhook-delivery/${e}/skip`),M(void 0)}catch(e){return this.logger.error(`Skip webhook delivery failed`,e),N(new q(e))}}},VL=G({key:V(),label:V(),type:H(),icon:V(),source:V(),visible:U()}),HL=G({id:V(),name:V(),locked:U(),description:V(),accent:V(),icon:H(),webhookId:V().nullable().optional(),fields:W(VL)}).passthrough(),UL=G({items:W(HL),totalCount:H()}),WL=e=>OI[e]??`Hash`,GL=e=>{let t=OI.indexOf(e);return t<0?0:t},KL=e=>DI[e]?.id??`text`,qL=e=>{let t=DI.findIndex(t=>t.id===e);return t<0?0:t},JL=e=>({id:e.id,tenantId:``,name:e.name,locked:e.locked,description:e.description,accent:e.accent,icon:WL(e.icon),webhookId:e.webhookId??null,fields:e.fields.map(t=>({id:`${e.id}:${t.key}`,key:t.key,label:t.label,type:KL(t.type),icon:t.icon,source:t.source,visible:t.visible}))}),YL=e=>({id:e.id,name:e.name,description:e.description,accent:e.accent,icon:GL(e.icon),webhookId:e.webhookId,fields:e.fields.map(e=>({key:e.key,label:e.label,type:qL(e.type),icon:e.icon,source:e.source,visible:e.visible}))}),XL=e=>{let t=[];for(let n of e)if(typeof n==`object`&&n&&`message`in n){let e=n;typeof e.message==`string`&&e.message.trim().length>0&&t.push(e.message.trim())}return t.length===0?null:Array.from(new Set(t)).join(`
56
56
  `)},ZL=e=>{if(Array.isArray(e.validationErrors)&&e.validationErrors.length>0){let t=XL(e.validationErrors);if(t!==null)return t}return typeof e.details==`string`&&e.details.trim().length>0?e.details.trim():typeof e.message==`string`&&e.message.trim().length>0?e.message.trim():null},QL=e=>{if(typeof e!=`object`||!e)return null;let t=e;return ZL(`error`in t&&typeof t.error==`object`&&t.error!==null?t.error:t)},$L=(e,t)=>{let n=t instanceof lk?QL(t.body):null;return n===null?(e.error(`Settings request failed`,t),new q(t)):(e.warn(`Settings request failed with server message`,{message:n}),new EI(n))},eR=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-group-categories-gateway`)}async listGroupCategories(){try{let e=await this.httpClient.get(`/api/app/group-category?maxResultCount=1000`),t=UL.safeParse(e);return t.success?M(t.data.items.map(JL)):(this.logger.error(`Group categories returned unexpected shape`,t.error),N(new q(t.error)))}catch(e){return N($L(this.logger,e))}}async saveGroupCategory(e){try{let t=await this.httpClient.post(`/api/app/group-category/save`,YL(e)),n=HL.safeParse(t);return n.success?M(JL(n.data)):(this.logger.error(`Saved group category returned unexpected shape`,n.error),N(new q(n.error)))}catch(e){return N($L(this.logger,e))}}async deleteGroupCategory(e){try{return await this.httpClient.delete(`/api/app/group-category/${e}`),M(e)}catch(e){return N($L(this.logger,e))}}},tR=G({conversationId:V(),isNew:U(),skipped:U()}),nR=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-group-provisioning-gateway`)}async provisionGroup(e){try{let t=await this.httpClient.post(`/api/app/group-provisioning/provision`,e),n=tR.safeParse(t);return n.success?M(n.data):(this.logger.error(`Provision group returned unexpected shape`,n.error),N(new q(n.error)))}catch(e){return N($L(this.logger,e))}}},rR=e=>{let t=new rL({httpClient:e.httpClient,logger:e.logger}),n=new BL({httpClient:e.httpClient,logger:e.logger}),r=new SL({httpClient:e.httpClient,logger:e.logger}),i=new FL({httpClient:e.httpClient,logger:e.logger}),a=new zL({httpClient:e.httpClient,logger:e.logger}),o=new nR({httpClient:e.httpClient,logger:e.logger}),s=new eR({httpClient:e.httpClient,logger:e.logger}),c={usageGateway:t,logger:e.logger},l={groupCategoriesGateway:s,logger:e.logger},u={feedPrefsGateway:r,logger:e.logger},d={orgSettingsGateway:i,logger:e.logger},f={settingsGateway:a,logger:e.logger},p={settingsGateway:n,logger:e.logger};return{listUsage:new qF(c),getWebhookData:new YF(p),listGroupCategories:new QF(l),saveGroupCategory:new $F(l),deleteGroupCategory:new eI(l),listWebhookEndpoints:new nI(p),saveWebhookEndpoint:new rI(p),deleteWebhookEndpoint:new iI(p),rotateSecret:new JF(p),sendTestEvent:new aI(p),retryWebhook:new XF(p),skipWebhook:new ZF(p),listPromoCategories:new oI(f),savePromoCategories:new sI(f),listCommTemplates:new cI(f),saveCommTemplate:new lI(f),deleteCommTemplate:new uI(f),listPromotions:new dI(f),savePromotion:new fI(f),deletePromotion:new pI(f),getOrgSettings:new LI(d),saveOrgSettings:new RI(d),getContentPrefs:new mI(u),saveContentPrefs:new hI(u),listFeedCategories:new gI(u),saveFeedCategories:new _I(u),listFeedTemplates:new vI(u),saveFeedTemplate:new yI(u),deleteFeedTemplate:new bI(u),listFeedCategoryItems:new xI(u),listExternalFeedCategoryItems:new SI(u),saveFeedCategoryItem:new CI(u),deleteFeedCategoryItem:new wI(u),provisionGroup:new tI({groupProvisioningGateway:o,logger:e.logger})}},iR=(0,n.createContext)(null),aR=({module:e,children:t})=>(0,D.jsx)(iR.Provider,{value:e,children:t}),oR=()=>{let e=(0,n.useContext)(iR);if(e===null)throw Error(`Settings hooks must be used within <SettingsModuleProvider>.`);return e},sR={promoCategories:[`settings`,`promo-categories`],commTemplates:[`settings`,`comm-templates`],promotions:[`settings`,`promotions`]},cR=()=>{let{listPromoCategories:e}=oR();return SN({queryKey:sR.promoCategories,queryFn:()=>P(e.execute())})},lR=()=>{let{listCommTemplates:e}=oR();return SN({queryKey:sR.commTemplates,queryFn:()=>P(e.execute())})},uR=()=>{let{listPromotions:e}=oR();return SN({queryKey:sR.promotions,queryFn:()=>P(e.execute())})},dR={usage:[`settings`,`usage`],groupCategories:[`settings`,`group-categories`],orgSettings:[`settings`,`org-settings`],contentPrefs:[`settings`,`content-prefs`],feedCategories:[`settings`,`feed-categories`],feedTemplates:[`settings`,`feed-templates`],feedCategoryItems:[`settings`,`feed-category-items`]},fR=()=>{let{listGroupCategories:e}=oR();return SN({queryKey:dR.groupCategories,queryFn:()=>P(e.execute())})},pR=()=>{let{getOrgSettings:e}=oR();return SN({queryKey:dR.orgSettings,queryFn:()=>P(e.execute())})},mR=()=>{let{listFeedTemplates:e}=oR();return SN({queryKey:dR.feedTemplates,queryFn:()=>P(e.execute())})},hR=e=>{let{listFeedCategoryItems:t}=oR();return SN({queryKey:[...dR.feedCategoryItems,e??`all`],queryFn:()=>P(t.execute(e))})},gR=(e,t,n=!0)=>{let{listExternalFeedCategoryItems:r}=oR();return SN({queryKey:[...dR.feedCategoryItems,`external`,e,t??``],queryFn:()=>P(r.execute(e,t)),enabled:n&&e!==``})},_R={screen:`_screen_hgbdz_1`,center:`_center_hgbdz_15`,head:`_head_hgbdz_21`,crumb:`_crumb_hgbdz_29`,title:`_title_hgbdz_34`,subtitle:`_subtitle_hgbdz_44`,muted:`_muted_hgbdz_50`,strong:`_strong_hgbdz_55`,code:`_code_hgbdz_60`,tabs:`_tabs_hgbdz_67`,tab:`_tab_hgbdz_67`,tabActive:`_tabActive_hgbdz_93`,filterBar:`_filterBar_hgbdz_99`,pillsContainer:`_pillsContainer_hgbdz_107`,pills:`_pills_hgbdz_107`,pill:`_pill_hgbdz_107`,pillAdd:`_pillAdd_hgbdz_142`,pillBg:`_pillBg_hgbdz_166`,pillLabel:`_pillLabel_hgbdz_174`,pillActive:`_pillActive_hgbdz_179`,pillChipActive:`_pillChipActive_hgbdz_183`,select:`_select_hgbdz_189`,input:`_input_hgbdz_190`,inputInvalid:`_inputInvalid_hgbdz_209`,fieldError:`_fieldError_hgbdz_215`,kpiRow:`_kpiRow_hgbdz_227`,kpiCard:`_kpiCard_hgbdz_233`,kpiIcon:`_kpiIcon_hgbdz_244`,kpiValue:`_kpiValue_hgbdz_255`,kpiLabel:`_kpiLabel_hgbdz_261`,tableWrap:`_tableWrap_hgbdz_268`,table:`_table_hgbdz_268`,th:`_th_hgbdz_283`,row:`_row_hgbdz_295`,barTrack:`_barTrack_hgbdz_306`,barFill:`_barFill_hgbdz_314`,barLabel:`_barLabel_hgbdz_321`,pillBadge:`_pillBadge_hgbdz_326`,pillOk:`_pillOk_hgbdz_333`,pillBad:`_pillBad_hgbdz_326`,field:`_field_hgbdz_215`,label:`_label_hgbdz_351`,req:`_req_hgbdz_357`,formGrid:`_formGrid_hgbdz_362`,swatches:`_swatches_hgbdz_368`,swatch:`_swatch_hgbdz_368`,swatchActive:`_swatchActive_hgbdz_383`,checkbox:`_checkbox_hgbdz_387`,formFooter:`_formFooter_hgbdz_401`,editBtn:`_editBtn_hgbdz_408`,deleteBtn:`_deleteBtn_hgbdz_409`,prefsWrap:`_prefsWrap_hgbdz_433`,catWrap:`_catWrap_hgbdz_434`,promoWrap:`_promoWrap_hgbdz_435`,tplWrap:`_tplWrap_hgbdz_436`,guide:`_guide_hgbdz_437`,retryList:`_retryList_hgbdz_438`,prefBlock:`_prefBlock_hgbdz_449`,prefHeading:`_prefHeading_hgbdz_455`,prefRow:`_prefRow_hgbdz_462`,catRow:`_catRow_hgbdz_463`,promoRow:`_promoRow_hgbdz_464`,dragHandle:`_dragHandle_hgbdz_488`,priorityBadge:`_priorityBadge_hgbdz_492`,prefDot:`_prefDot_hgbdz_496`,promoNameBtn:`_promoNameBtn_hgbdz_501`,activeCheck:`_activeCheck_hgbdz_506`,promoRowDragging:`_promoRowDragging_hgbdz_531`,promoRowDragOver:`_promoRowDragOver_hgbdz_535`,dragHandleOff:`_dragHandleOff_hgbdz_559`,prefName:`_prefName_hgbdz_564`,catLabel:`_catLabel_hgbdz_565`,prefBtns:`_prefBtns_hgbdz_572`,prefBtn:`_prefBtn_hgbdz_572`,prefBtnActive:`_prefBtnActive_hgbdz_588`,catActions:`_catActions_hgbdz_595`,catHead:`_catHead_hgbdz_600`,webhookFilterBar:`_webhookFilterBar_hgbdz_616`,catHeadDesc:`_catHeadDesc_hgbdz_636`,catList:`_catList_hgbdz_644`,catKey:`_catKey_hgbdz_649`,promoList:`_promoList_hgbdz_659`,promoRowOff:`_promoRowOff_hgbdz_672`,reorder:`_reorder_hgbdz_676`,reorderBtn:`_reorderBtn_hgbdz_681`,priorityBadgeOff:`_priorityBadgeOff_hgbdz_704`,tplHint:`_tplHint_hgbdz_726`,tplEditLayout:`_tplEditLayout_hgbdz_732`,tplEditForm:`_tplEditForm_hgbdz_739`,tplEditPreview:`_tplEditPreview_hgbdz_744`,tplLiveHead:`_tplLiveHead_hgbdz_752`,tplMirrorHead:`_tplMirrorHead_hgbdz_764`,tplLiveDot:`_tplLiveDot_hgbdz_778`,tplPulse:`_tplPulse_hgbdz_1`,promoNameTop:`_promoNameTop_hgbdz_826`,promoName:`_promoName_hgbdz_501`,promoNameOff:`_promoNameOff_hgbdz_839`,promoNameMeta:`_promoNameMeta_hgbdz_844`,tplBadge:`_tplBadge_hgbdz_858`,catCount:`_catCount_hgbdz_867`,campaignBox:`_campaignBox_hgbdz_872`,campaignHead:`_campaignHead_hgbdz_885`,campaignHeadTitle:`_campaignHeadTitle_hgbdz_892`,campaignCount:`_campaignCount_hgbdz_903`,campaignList:`_campaignList_hgbdz_918`,seeAll:`_seeAll_hgbdz_924`,cpTop:`_cpTop_hgbdz_940`,cpHead:`_cpHead_hgbdz_952`,cpTitle:`_cpTitle_hgbdz_959`,cpCount:`_cpCount_hgbdz_966`,cpSearch:`_cpSearch_hgbdz_973`,cpSearchIcon:`_cpSearchIcon_hgbdz_979`,cpSearchInput:`_cpSearchInput_hgbdz_985`,cpList:`_cpList_hgbdz_995`,cpFooter:`_cpFooter_hgbdz_1002`,campaignEmpty:`_campaignEmpty_hgbdz_1013`,campaignRow:`_campaignRow_hgbdz_1023`,campaignText:`_campaignText_hgbdz_1034`,campaignTitle:`_campaignTitle_hgbdz_1042`,campaignSub:`_campaignSub_hgbdz_1048`,campaignMeta:`_campaignMeta_hgbdz_1053`,campaignChip:`_campaignChip_hgbdz_1060`,campaignChipLabel:`_campaignChipLabel_hgbdz_1072`,campaignAmount:`_campaignAmount_hgbdz_1077`,campaignBadge:`_campaignBadge_hgbdz_1083`,promoPreview:`_promoPreview_hgbdz_1092`,promoCard:`_promoCard_hgbdz_1110`,promoCardHeader:`_promoCardHeader_hgbdz_1119`,promoCardStatus:`_promoCardStatus_hgbdz_1128`,promoCardHeading:`_promoCardHeading_hgbdz_1139`,promoCardBody:`_promoCardBody_hgbdz_1147`,promoItem:`_promoItem_hgbdz_1154`,promoItemText:`_promoItemText_hgbdz_1165`,promoItemTitle:`_promoItemTitle_hgbdz_1174`,promoItemSub:`_promoItemSub_hgbdz_1184`,promoItemDate:`_promoItemDate_hgbdz_1191`,promoItemBadge:`_promoItemBadge_hgbdz_1200`,promoItemAmount:`_promoItemAmount_hgbdz_1209`,promoViewAll:`_promoViewAll_hgbdz_1219`,promoStatus:`_promoStatus_hgbdz_1249`,promoHeader:`_promoHeader_hgbdz_1256`,promoCardInner:`_promoCardInner_hgbdz_1263`,promoCardTitle:`_promoCardTitle_hgbdz_1273`,promoCardSub:`_promoCardSub_hgbdz_1278`,promoDate:`_promoDate_hgbdz_1279`,promoCardFoot:`_promoCardFoot_hgbdz_1284`,promoBadge:`_promoBadge_hgbdz_1291`,promoAmount:`_promoAmount_hgbdz_1300`,promoCta:`_promoCta_hgbdz_1305`,tplLayout:`_tplLayout_hgbdz_1312`,tplList:`_tplList_hgbdz_1321`,tplItem:`_tplItem_hgbdz_1328`,tplItemActive:`_tplItemActive_hgbdz_1341`,tplDot:`_tplDot_hgbdz_1346`,tplItemText:`_tplItemText_hgbdz_1354`,tplItemName:`_tplItemName_hgbdz_1361`,tplItemMeta:`_tplItemMeta_hgbdz_1370`,editorPane:`_editorPane_hgbdz_1375`,editorName:`_editorName_hgbdz_1388`,editorMeta:`_editorMeta_hgbdz_1401`,editorMetaCard:`_editorMetaCard_hgbdz_1408`,iconPicker:`_iconPicker_hgbdz_1422`,iconChoice:`_iconChoice_hgbdz_1428`,iconChoiceActive:`_iconChoiceActive_hgbdz_1446`,intGuide:`_intGuide_hgbdz_1453`,intToggle:`_intToggle_hgbdz_1459`,intChevron:`_intChevron_hgbdz_1472`,intChevronOpen:`_intChevronOpen_hgbdz_1476`,intSteps:`_intSteps_hgbdz_1480`,intStep:`_intStep_hgbdz_1480`,intNum:`_intNum_hgbdz_1494`,intStepBody:`_intStepBody_hgbdz_1508`,intStepTitle:`_intStepTitle_hgbdz_1516`,intText:`_intText_hgbdz_1522`,intIntro:`_intIntro_hgbdz_1538`,intList:`_intList_hgbdz_1545`,intOl:`_intOl_hgbdz_1558`,registry:`_registry_hgbdz_1581`,regStats:`_regStats_hgbdz_1587`,regList:`_regList_hgbdz_1593`,regRow:`_regRow_hgbdz_1599`,regRowMain:`_regRowMain_hgbdz_1618`,regRowName:`_regRowName_hgbdz_1625`,regRowMeta:`_regRowMeta_hgbdz_1631`,regRowEnd:`_regRowEnd_hgbdz_1636`,regRate:`_regRate_hgbdz_1643`,regDetail:`_regDetail_hgbdz_1649`,regDetailHead:`_regDetailHead_hgbdz_1657`,regDetailTitle:`_regDetailTitle_hgbdz_1663`,feedEmpty:`_feedEmpty_hgbdz_1670`,feedEmptyText:`_feedEmptyText_hgbdz_1680`,feedEmptyTitle:`_feedEmptyTitle_hgbdz_1685`,feedHead:`_feedHead_hgbdz_1692`,feedTitle:`_feedTitle_hgbdz_1699`,feedMeta:`_feedMeta_hgbdz_1708`,feedActions:`_feedActions_hgbdz_1714`,tplPreview:`_tplPreview_hgbdz_1721`,tplPreviewLabel:`_tplPreviewLabel_hgbdz_1731`,tplPreviewCard:`_tplPreviewCard_hgbdz_1739`,tplPreviewAvatar:`_tplPreviewAvatar_hgbdz_1752`,tplPreviewText:`_tplPreviewText_hgbdz_1764`,tplPreviewTitleRow:`_tplPreviewTitleRow_hgbdz_1772`,tplPreviewTitle:`_tplPreviewTitle_hgbdz_1772`,tplPreviewPill:`_tplPreviewPill_hgbdz_1789`,tplPreviewSub:`_tplPreviewSub_hgbdz_1798`,fieldsHead:`_fieldsHead_hgbdz_1806`,fieldList:`_fieldList_hgbdz_1813`,fieldCard:`_fieldCard_hgbdz_1819`,fieldCardMain:`_fieldCardMain_hgbdz_1829`,fieldLabelInput:`_fieldLabelInput_hgbdz_1836`,fieldTypeSelect:`_fieldTypeSelect_hgbdz_1849`,fieldKeyRow:`_fieldKeyRow_hgbdz_1861`,fieldKeyLabel:`_fieldKeyLabel_hgbdz_1868`,fieldKeyInput:`_fieldKeyInput_hgbdz_1875`,iconToggle:`_iconToggle_hgbdz_1887`,iconToggleOn:`_iconToggleOn_hgbdz_1900`,webhookBox:`_webhookBox_hgbdz_1906`,schema:`_schema_hgbdz_1919`,retryItem:`_retryItem_hgbdz_1931`,retryInfo:`_retryInfo_hgbdz_1941`,retryError:`_retryError_hgbdz_1947`,retryActions:`_retryActions_hgbdz_1952`,tplGrid:`_tplGrid_hgbdz_1958`,tplCard:`_tplCard_hgbdz_1964`,tplCardHead:`_tplCardHead_hgbdz_1976`,tplCat:`_tplCat_hgbdz_1983`,fieldRow:`_fieldRow_hgbdz_2001`,tplSidebar:`_tplSidebar_hgbdz_2026`,tplLock:`_tplLock_hgbdz_2032`,lockBadge:`_lockBadge_hgbdz_2038`,footerBtns:`_footerBtns_hgbdz_2052`,copyRow:`_copyRow_hgbdz_2059`,copyBtn:`_copyBtn_hgbdz_2070`,webhookFoot:`_webhookFoot_hgbdz_2092`,testBtn:`_testBtn_hgbdz_2100`,fieldRef:`_fieldRef_hgbdz_2119`,fieldRefHead:`_fieldRefHead_hgbdz_2127`,fieldRefHint:`_fieldRefHint_hgbdz_2144`,fieldRefList:`_fieldRefList_hgbdz_2153`,fieldRefItem:`_fieldRefItem_hgbdz_2158`,fieldRefToken:`_fieldRefToken_hgbdz_2179`,fieldRefDesc:`_fieldRefDesc_hgbdz_2191`,tokenWarn:`_tokenWarn_hgbdz_2197`,tplEditMain:`_tplEditMain_hgbdz_2217`,tplEditSide:`_tplEditSide_hgbdz_2223`,tplEditWrap:`_tplEditWrap_hgbdz_2230`,tplEditBar:`_tplEditBar_hgbdz_2236`,tplBarSpacer:`_tplBarSpacer_hgbdz_2245`,tcFieldsHead:`_tcFieldsHead_hgbdz_2291`,tcRows:`_tcRows_hgbdz_2300`,tcCard:`_tcCard_hgbdz_2307`,tcCardTop:`_tcCardTop_hgbdz_2317`,tcGrow:`_tcGrow_hgbdz_2323`,tcType:`_tcType_hgbdz_2337`,tcToken:`_tcToken_hgbdz_2350`,currencyWrap:`_currencyWrap_hgbdz_2365`,currencyPrefix:`_currencyPrefix_hgbdz_2372`,currencyInput:`_currencyInput_hgbdz_2378`,tokenRead:`_tokenRead_hgbdz_2394`,tokenReadOver:`_tokenReadOver_hgbdz_2416`,tokenReadStatic:`_tokenReadStatic_hgbdz_2422`,tokenInput:`_tokenInput_hgbdz_2430`,tokenPlaceholder:`_tokenPlaceholder_hgbdz_2441`,tokenChip:`_tokenChip_hgbdz_2446`,tokenChipBad:`_tokenChipBad_hgbdz_2462`,tokenChipX:`_tokenChipX_hgbdz_2468`,palette:`_palette_hgbdz_2497`,paletteGroup:`_paletteGroup_hgbdz_2507`,paletteGroupLabel:`_paletteGroupLabel_hgbdz_2513`,paletteChips:`_paletteChips_hgbdz_2521`,paletteChipWrap:`_paletteChipWrap_hgbdz_2527`,paletteChip:`_paletteChip_hgbdz_2521`,paletteGrip:`_paletteGrip_hgbdz_2559`,paletteToken:`_paletteToken_hgbdz_2564`,paletteDesc:`_paletteDesc_hgbdz_2575`,paletteHint:`_paletteHint_hgbdz_2581`,simMemberRow:`_simMemberRow_hgbdz_2588`,simMemberRemove:`_simMemberRemove_hgbdz_2595`,signatureContainer:`_signatureContainer_hgbdz_2610`,signatureLabel:`_signatureLabel_hgbdz_2616`,signatureCheckbox:`_signatureCheckbox_hgbdz_2624`,signatureText:`_signatureText_hgbdz_2633`,signatureTitle:`_signatureTitle_hgbdz_2639`,signatureDesc:`_signatureDesc_hgbdz_2646`},vR=(e,t)=>{let n=new Date;return{item_count:String(t),current_year:String(n.getFullYear()),current_date:n.toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`}),...e}},yR=({card:e})=>(0,D.jsxs)(`div`,{className:_R.promoItem,children:[(0,D.jsxs)(`span`,{className:_R.promoItemText,children:[e.cardTitle!==``&&(0,D.jsx)(`span`,{className:_R.promoItemTitle,children:e.cardTitle}),e.cardSubtitle!==``&&(0,D.jsx)(`span`,{className:_R.promoItemSub,children:e.cardSubtitle}),e.dateLine!==``&&(0,D.jsx)(`span`,{className:_R.promoItemDate,children:e.dateLine})]}),e.amountText!==``&&(0,D.jsx)(`span`,{className:_R.promoItemAmount,children:e.amountText}),e.badgeText!==``&&e.amountText===``&&(0,D.jsx)(`span`,{className:_R.promoItemBadge,children:e.badgeText})]}),bR=({template:e,color:t,name:n,count:r,items:i,onViewAll:a})=>{let o=i[0];if(o===void 0)return null;let s=PI(e,vR(o.values,r));return(0,D.jsxs)(A.div,{className:_R.promoCard,style:E({"--cat":t}),initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.22,ease:`easeOut`},children:[(0,D.jsxs)(`div`,{className:_R.promoCardHeader,children:[s.statusLabel!==``&&(0,D.jsx)(`span`,{className:_R.promoCardStatus,children:s.statusLabel}),(0,D.jsx)(Ln,{size:11,color:t})]}),(0,D.jsxs)(`div`,{className:_R.promoCardBody,children:[i.map(t=>(0,D.jsx)(yR,{card:PI(e,vR(t.values,r))},t.id)),a!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:_R.promoViewAll,onClick:a,children:s.ctaText===``?`View all`:s.ctaText})]})]})},xR=[`available`,`busy`,`inMeeting`,`focus`,`away`,`offline`],SR=e=>xR[e??-1]??`offline`,CR=e=>xR.indexOf(e),wR=[{id:`available`,label:`Available`,tone:`success`},{id:`busy`,label:`Busy`,tone:`danger`},{id:`inMeeting`,label:`In a meeting`,tone:`danger`},{id:`focus`,label:`Focus`,tone:`primary`},{id:`away`,label:`Away`,tone:`warn`},{id:`offline`,label:`Offline`,tone:`neutral`}],TR={id:`offline`,label:`Offline`,tone:`neutral`},ER=e=>wR.find(t=>t.id===e)??TR,DR=(e,t,n)=>{let{label:r}=ER(e);return t==null||e===`offline`?r:`${r} until ${n(t)}`},OR=PE(e=>({byUser:{},watchers:{},apply:(t,n,r)=>{e(e=>({byUser:{...e.byUser,[t]:{status:n,untilUtc:r}}}))},applyMany:t=>{t.length!==0&&e(e=>{let n={...e.byUser};for(let e of t)n[e.userId]={status:e.status,untilUtc:e.untilUtc};return{byUser:n}})},watch:t=>{e(e=>({watchers:{...e.watchers,[t]:(e.watchers[t]??0)+1}}))},unwatch:t=>{e(e=>{let n=e.watchers[t]??0;if(n<=1){let{[t]:n,...r}=e.watchers;return{watchers:r}}return{watchers:{...e.watchers,[t]:n-1}}})},reset:()=>{e({byUser:{}})}})),kR=e=>{let t=OR(e=>e.watch),r=OR(e=>e.unwatch);return(0,n.useEffect)(()=>{if(e!=null)return t(e),()=>{r(e)}},[e,t,r]),OR(t=>e==null?void 0:t.byUser[e])},AR=()=>OR(e=>Object.keys(e.watchers).sort().join(`,`)),jR=(e,t,n)=>{OR.getState().apply(e,t,n)},MR=e=>{OR.getState().applyMany(e)},NR=()=>{OR.getState().reset()},PR=({status:e,untilUtc:t,formatUntil:n,size:r=`sm`})=>{let i=ER(e);return(0,D.jsx)(YE,{tone:i.tone,variant:`soft`,size:r,children:n===void 0?i.label:DR(e,t,n)})},FR=[`override`,`activity`,`calendar`,`connection`],IR=e=>FR[e??-1]??`connection`,LR=class extends li{code=`PRESENCE_UNAVAILABLE`;constructor(e){super(`Your status is unavailable right now. Please try again.`,{cause:e})}},RR=class{gateway;constructor(e){this.gateway=e.presenceGateway}execute(){return this.gateway.getMine()}},zR=class{gateway;constructor(e){this.gateway=e.presenceGateway}execute(e){return this.gateway.setMine(e)}},BR=class{gateway;constructor(e){this.gateway=e.presenceGateway}execute(){return this.gateway.clearMine()}},VR=class{gateway;constructor(e){this.gateway=e.presenceGateway}execute(e){return this.gateway.getOf(e)}},HR=G({status:H(),source:H(),untilUtc:V().nullish(),note:V().nullish(),hasOverride:U()}),UR=W(G({userId:V(),online:U(),status:H(),untilUtc:V().nullish()})),WR={mine:`/api/app/presence/mine`,setMine:`/api/app/presence/set-mine`,clearMine:`/api/app/presence/clear-mine`,of:e=>`/api/app/presence/of?${e.map(e=>`Ids=${encodeURIComponent(e)}`).join(`&`)}`},GR=e=>({status:SR(e.status),source:IR(e.source),untilUtc:e.untilUtc??null,note:e.note??null,hasOverride:e.hasOverride}),KR=e=>({status:CR(e.status),minutes:e.minutes,...e.note===void 0?{}:{note:e.note}}),qR=e=>({userId:e.userId,online:e.online,status:SR(e.status),untilUtc:e.untilUtc??null}),JR=class{http;logger;constructor(e){this.http=e.httpClient,this.logger=e.logger.child(`http-presence-gateway`)}getMine(){return this.request(()=>this.http.get(WR.mine),`getMine`)}setMine(e){return this.request(()=>this.http.post(WR.setMine,KR(e)),`setMine`)}async getOf(e){if(e.length===0)return M([]);try{let t=UR.safeParse(await this.http.get(WR.of(e)));return t.success?M(t.data.map(qR)):(this.logger.error(`getOf: unexpected response shape`,t.error),N(new LR(t.error)))}catch(e){return this.logger.error(`getOf failed`,e),N(new LR(e))}}clearMine(){return this.request(()=>this.http.post(WR.clearMine,{}),`clearMine`)}async request(e,t){try{let n=HR.safeParse(await e());return n.success?M(GR(n.data)):(this.logger.error(`${t}: unexpected response shape`,n.error),N(new LR(n.error)))}catch(e){return this.logger.error(`${t} failed`,e),N(new LR(e))}}},YR=e=>{let t={presenceGateway:new JR({httpClient:e.httpClient,logger:e.logger}),logger:e.logger};return{getMyPresence:new RR(t),setMyPresence:new zR(t),clearMyPresence:new BR(t),getPresenceOf:new VR(t),logger:e.logger}},XR=(0,n.createContext)(null),ZR=()=>{let e=(0,n.useContext)(XR);if(e===null)throw Error(`Presence hooks must be used within <PresenceModuleProvider>.`);return e},QR=3e4,$R=()=>{let{getPresenceOf:e}=ZR(),t=AR(),r=(0,n.useMemo)(()=>t===``?[]:t.split(`,`),[t]),{data:i}=SN({queryKey:[`presence`,`of`,t],enabled:r.length>0,queryFn:()=>P(e.execute(r)),refetchInterval:QR,refetchOnWindowFocus:!0,retry:!1});(0,n.useEffect)(()=>{i!==void 0&&MR(i)},[i])},ez=()=>($R(),null),tz=({module:e,children:t})=>(0,D.jsxs)(XR.Provider,{value:e,children:[(0,D.jsx)(ez,{}),t]});wR.filter(e=>e.id!==`offline`);var nz=({status:e,untilUtc:t,size:n})=>{let r=JN();return(0,D.jsx)(PR,{status:e,untilUtc:t??null,formatUntil:e=>r.formatUntil(e),...n===void 0?{}:{size:n}})},rz=class{callGateway;logger;constructor(e){this.callGateway=e.callGateway,this.logger=e.logger.child(`start-call`)}async execute(e,t=`audio`){let n=await this.callGateway.start(e,t);return n.ok||this.logger.warn(`Start call failed`,{code:n.error.code}),n}},iz=class{callGateway;logger;constructor(e){this.callGateway=e.callGateway,this.logger=e.logger.child(`accept-call`)}async execute(e){let t=await this.callGateway.accept(e);return t.ok||this.logger.warn(`Accept call failed`,{code:t.error.code}),t}},az=class{callGateway;logger;constructor(e){this.callGateway=e.callGateway,this.logger=e.logger.child(`decline-call`)}async execute(e){let t=await this.callGateway.decline(e);return t.ok||this.logger.warn(`Decline call failed`,{code:t.error.code}),t}},oz=class{callGateway;logger;constructor(e){this.callGateway=e.callGateway,this.logger=e.logger.child(`cancel-call`)}async execute(e){let t=await this.callGateway.cancel(e);return t.ok||this.logger.warn(`Cancel call failed`,{code:t.error.code}),t}},sz=class{callGateway;logger;constructor(e){this.callGateway=e.callGateway,this.logger=e.logger.child(`end-call`)}async execute(e){let t=await this.callGateway.end(e);return t.ok||this.logger.warn(`End call failed`,{code:t.error.code}),t}},cz=class{callGateway;logger;constructor(e){this.callGateway=e.callGateway,this.logger=e.logger.child(`get-call-history`)}async execute(e=0,t=20){let n=await this.callGateway.history(e,t);return n.ok||this.logger.warn(`Get call history failed`,{code:n.error.code}),n}},lz=`ringing`,uz=`callee_unavailable`,dz=class extends ui{},fz=class extends dz{code=`CALL_FAILED`;constructor(e=`The call could not be completed. Please try again.`,t){super(e,{cause:t})}},pz=G({token:V(),providerType:V(),roomId:V(),participantName:V()}).passthrough(),mz=G({callId:V(),status:V(),joinTicket:pz.nullish()}).passthrough(),hz=G({id:V(),callerUserId:V(),callerName:V(),calleeUserId:V(),calleeName:V(),type:V(),status:V(),endReason:V(),inbound:U(),ringingAtUtc:V(),answeredAtUtc:V().nullish(),endedAtUtc:V().nullish(),durationSeconds:H()}).passthrough(),gz=G({totalCount:H(),items:W(hz)}).passthrough(),_z=e=>e===`video`?`video`:`audio`,vz=e=>({token:e.token,providerType:e.providerType,roomId:e.roomId,participantName:e.participantName}),yz=e=>({callId:e.callId,status:e.status===`callee_unavailable`?uz:lz,joinTicket:e.joinTicket?vz(e.joinTicket):null}),bz=e=>({id:e.id,callerUserId:e.callerUserId,callerName:e.callerName,calleeUserId:e.calleeUserId,calleeName:e.calleeName,type:_z(e.type),status:e.status,endReason:e.endReason,inbound:e.inbound,ringingAtUtc:e.ringingAtUtc,answeredAtUtc:e.answeredAtUtc??null,endedAtUtc:e.endedAtUtc??null,durationSeconds:e.durationSeconds}),xz=e=>({items:e.items.map(bz),total:e.totalCount}),Sz=encodeURIComponent,Cz=`/api/app/call`,wz={start:`${Cz}/start`,accept:e=>`${Cz}/${Sz(e)}/accept`,decline:e=>`${Cz}/${Sz(e)}/decline`,cancel:e=>`${Cz}/${Sz(e)}/cancel`,end:e=>`${Cz}/${Sz(e)}/end`,history:(e,t)=>`${Cz}/history?SkipCount=${String(e)}&MaxResultCount=${String(t)}`},Tz=class{http;logger;constructor(e){this.http=e.httpClient,this.logger=e.logger.child(`http-call-gateway`)}async start(e,t){try{let n=await this.http.post(wz.start,{calleeUserId:e,type:t}),r=mz.safeParse(n);return r.success?M(yz(r.data)):this.fail(`Start returned an unexpected shape`,r.error)}catch(e){return this.fail(`Placing the call failed`,e)}}async accept(e){try{let t=await this.http.post(wz.accept(e)),n=pz.safeParse(t);return n.success?M(vz(n.data)):this.fail(`Accept returned an unexpected shape`,n.error)}catch(e){return this.fail(`Answering the call failed`,e)}}decline(e){return this.signal(wz.decline(e),`Declining the call failed`)}cancel(e){return this.signal(wz.cancel(e),`Canceling the call failed`)}end(e){return this.signal(wz.end(e),`Ending the call failed`)}async history(e,t){try{let n=await this.http.get(wz.history(e,t)),r=gz.safeParse(n);return r.success?M(xz(r.data)):this.fail(`History returned an unexpected shape`,r.error)}catch(e){return this.fail(`Loading call history failed`,e)}}async signal(e,t){try{return await this.http.post(e),M(void 0)}catch(e){return this.fail(t,e)}}fail(e,t){return this.logger.error(e,t),N(new fz(e,t))}},Ez={IncomingCall:`IncomingCall`,CallAccepted:`CallAccepted`,CallDeclined:`CallDeclined`,CallCanceled:`CallCanceled`,CallEnded:`CallEnded`},Dz=G({callId:V(),callerUserId:V(),callerName:V(),callerInitials:V().optional().default(``),callerColor:V().optional().default(``),type:V()}).passthrough(),Oz=G({callId:V()}).passthrough(),kz=G({callId:V(),reason:V()}).passthrough(),Az=(e,t,n)=>{let r=Dz.safeParse(e);return r.success?r.data:(n.warn(`Ignoring malformed call realtime payload`,{event:t}),null)},jz=(e,t,n)=>{let r=Oz.safeParse(e);return r.success?r.data:(n.warn(`Ignoring malformed call realtime payload`,{event:t}),null)},Mz=(e,t,n)=>{let r=kz.safeParse(e);return r.success?r.data:(n.warn(`Ignoring malformed call realtime payload`,{event:t}),null)},Nz={phase:`idle`,callId:null,direction:null,peerUserId:null,peerName:``,peerInitials:``,peerColor:``,mediaType:`audio`,dialId:null,ticket:null,muted:!1,connected:!1,activeSinceMs:null,endReason:null},Pz=()=>AE(e=>({...Nz,incoming:({callId:t,peer:n,mediaType:r})=>{e({...Nz,phase:`incoming`,callId:t,direction:`incoming`,peerUserId:n.userId,peerName:n.name,peerInitials:n.initials,peerColor:n.color,mediaType:r})},dialing:({peer:t,mediaType:n,dialId:r})=>{e({...Nz,phase:`outgoing`,direction:`outgoing`,peerUserId:t.userId,peerName:t.name,peerInitials:t.initials,peerColor:t.color,mediaType:n,dialId:r})},attachOutgoing:({callId:t,ticket:n})=>{e(e=>e.direction!==`outgoing`||e.phase!==`outgoing`&&e.phase!==`active`?e:{callId:t,ticket:n})},activate:(t,n)=>{e(e=>({phase:`active`,ticket:t??e.ticket,activeSinceMs:e.activeSinceMs??n}))},markConnected:()=>{e({connected:!0})},ended:t=>{e({phase:`ended`,endReason:t,ticket:null,connected:!1})},reset:()=>{e({...Nz})},setMuted:t=>{e({muted:t})}})),Fz=e=>{let t={callGateway:new Tz({httpClient:e.httpClient,logger:e.logger}),logger:e.logger};return{startCall:new rz(t),acceptCall:new iz(t),declineCall:new az(t),cancelCall:new oz(t),endCall:new sz(t),getCallHistory:new cz(t),realtime:e.realtime,store:Pz(),logger:e.logger.child(`calls-realtime`)}},Iz=(0,n.createContext)(null),Lz=({module:e,children:t})=>(0,D.jsx)(Iz.Provider,{value:e,children:t}),Rz=class extends ui{},zz=class extends Rz{code=`AUTH_INVALID_CREDENTIALS`;constructor(){super(`Your sign-in could not be completed. The link may have expired — please try again.`)}},Bz=class extends Rz{code=`AUTH_SERVICE_UNAVAILABLE`;constructor(e){super(`The authentication service is currently unavailable. Please try again.`,{cause:e})}},Vz=class{id;email;fullName;userType;roles;constructor(e){if(e.id.trim().length===0)throw Error(`AuthenticatedUser requires a non-empty id.`);this.id=e.id,this.email=e.email,this.fullName=e.fullName.trim().length>0?e.fullName:e.email.value,this.userType=e.userType,this.roles=new Set(e.roles.map(e=>e.toLowerCase()))}hasRole(e){return this.roles.has(e.toLowerCase())}hasAnyRole(e){return e.some(e=>this.hasRole(e))}get roleNames(){return[...this.roles]}},Hz=30,Uz=class e{user;accessToken;refreshToken;tokenType;expiresAt;constructor(e){this.user=e.user,this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.tokenType=e.tokenType,this.expiresAt=e.expiresAt}isExpired(e){return this.expiresAt.getTime()-Hz*1e3<=e.getTime()}isValid(e){return this.accessToken.length>0&&!this.isExpired(e)}get canRefresh(){return this.refreshToken!==null&&this.refreshToken.length>0}authorizationHeader(){return`${this.tokenType} ${this.accessToken}`}snapshot(){return{user:{id:this.user.id,email:this.user.email.value,fullName:this.user.fullName,roles:this.user.roleNames,userType:this.user.userType},accessToken:this.accessToken,refreshToken:this.refreshToken,tokenType:this.tokenType,expiresAtIso:this.expiresAt.toISOString()}}static restore(t){let n=KD.create(t.user.email);return HD(n)?n:M(new e({user:new Vz({id:t.user.id,email:n.value,fullName:t.user.fullName,roles:t.user.roles,userType:t.user.userType}),accessToken:t.accessToken,refreshToken:t.refreshToken,tokenType:t.tokenType,expiresAt:new Date(t.expiresAtIso)}))}},Wz=class{authGateway;sessionStore;logger;constructor(e){this.authGateway=e.authGateway,this.sessionStore=e.sessionStore,this.logger=e.logger.child(`complete-sso-login`)}async execute(e){if(e.trim().length===0)return this.logger.warn(`SSO callback carried no secret`),N(new zz);let t=await this.authGateway.exchangeSsoSecret(e);return HD(t)?(this.logger.warn(`SSO secret exchange failed`,{code:t.error.code}),t):(this.sessionStore.save(t.value),this.logger.info(`User authenticated via UAPP SSO`,{userId:t.value.user.id}),t)}},Gz=class{authGateway;sessionStore;logger;constructor(e){this.authGateway=e.authGateway,this.sessionStore=e.sessionStore,this.logger=e.logger.child(`logout`)}async execute(e){e!==null&&await this.authGateway.signOut(e),this.sessionStore.clear(),this.logger.info(`Session cleared`)}},Kz=class{authGateway;sessionStore;clock;logger;constructor(e){this.authGateway=e.authGateway,this.sessionStore=e.sessionStore,this.clock=e.clock,this.logger=e.logger.child(`restore-session`)}async execute(){let e=this.sessionStore.load();if(e===null)return M(null);if(e.isValid(this.clock.now()))return M(e);let t=e.refreshToken;if(t===null||t.length===0)return this.sessionStore.clear(),M(null);let n=await this.authGateway.refresh(t);return HD(n)?(this.logger.info(`Could not refresh session; signing out`,{code:n.error.code}),this.sessionStore.clear(),M(null)):(this.sessionStore.save(n.value),M(n.value))}},qz=class{authGateway;sessionStore;logger;constructor(e){this.authGateway=e.authGateway,this.sessionStore=e.sessionStore,this.logger=e.logger.child(`refresh-session`)}async execute(e){let t=e.refreshToken;if(t===null||t.length===0)return this.logger.info(`No refresh token available; signing out`),this.sessionStore.clear(),N(new zz);let n=await this.authGateway.refresh(t);return HD(n)?(this.logger.info(`Could not refresh session; signing out`,{code:n.error.code}),this.sessionStore.clear(),n):(this.sessionStore.save(n.value),n)}},Jz=G({access_token:V().min(1),token_type:V().min(1).optional().default(`Bearer`),expires_in:H().int().positive(),refresh_token:V().min(1).nullable().optional()}),Yz=G({error:V().optional(),error_description:V().optional()}),Xz=G({sub:V().min(1),email:V().optional(),name:V().optional(),role:ej([V(),W(V())]).optional()}).passthrough(),Zz=e=>e.role===void 0?[]:typeof e.role==`string`?[e.role]:e.role,Qz=e=>{let t=e.split(`.`)[1];if(t===void 0||t.length===0)return N(new Bz(`Access token is not a JWT.`));let n=$z(t);if(n===null)return N(new Bz(`Access token payload is not valid base64url.`));let r;try{r=JSON.parse(n)}catch(e){return N(new Bz(e))}let i=Xz.safeParse(r);return i.success?M(i.data):N(new Bz(i.error))},$z=e=>{let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(Math.ceil(t.length/4)*4,`=`);try{let e=atob(n),t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return new TextDecoder().decode(t)}catch{return null}},eB=(e,t)=>{let n=Qz(e.access_token);if(HD(n))return n;let r=n.value.email??n.value.name;if(r===void 0||r.length===0)return N(new Bz(`Access token carries no email/name claim.`));let i=KD.create(r);return HD(i)?N(new Bz(i.error)):M(new Uz({user:new Vz({id:n.value.sub,email:i.value,fullName:n.value.name??i.value.value,roles:Zz(n.value),userType:null}),accessToken:e.access_token,refreshToken:e.refresh_token??null,tokenType:e.token_type,expiresAt:new Date(t.getTime()+e.expires_in*1e3)}))},tB=`/connect/token`,nB=`CommunicationHub_App`,rB=`CommunicationHub offline_access`,iB=`uapp_sso`,aB=`refresh_token`,oB=`secret`,sB=class{httpClient;clock;logger;constructor(e){this.httpClient=e.httpClient,this.clock=e.clock,this.logger=e.logger.child(`uapp-sso-gateway`)}exchangeSsoSecret(e){return e.trim().length===0?Promise.resolve(N(new zz)):this.requestToken({grant_type:iB,[oB]:e,client_id:nB,scope:rB})}refresh(e){return this.requestToken({grant_type:aB,refresh_token:e,client_id:nB,scope:rB})}signOut(e){return this.logger.debug(`Sign-out is local-only for the SSO client; no server call made.`),Promise.resolve()}async requestToken(e){try{let t=await this.httpClient.postForm(tB,e,{anonymous:!0}),n=Jz.safeParse(t);return n.success?eB(n.data,this.clock.now()):(this.logger.error(`Token endpoint returned an unexpected shape`,n.error),N(new Bz(n.error)))}catch(e){return N(this.mapError(e))}}mapError(e){return e instanceof lk?e.status===400||e.status===401?(this.logger.warn(`Token request was rejected`,{reason:cB(e.body)}),new zz):(this.logger.error(`Token request failed with an unexpected status`,e),new Bz(e)):(this.logger.error(`Token request failed`,e),new Bz(e))}},cB=e=>{let t=Yz.safeParse(e);return t.success?t.data.error_description??t.data.error??`unknown`:`unknown`},lB=`auth.session`,uB=e=>`${e}.${lB}`,dB=G({user:G({id:V(),email:V(),fullName:V(),roles:W(V()),userType:V().nullable()}),accessToken:V(),refreshToken:V().nullable(),tokenType:V(),expiresAtIso:V()}),fB=class{storage;logger;key;constructor(e){this.storage=e.storage,this.logger=e.logger.child(`session-store`),this.key=uB(e.namespace)}load(){let e=this.storage.getItem(this.key);if(e===null)return null;let t=dB.safeParse(this.tryParseJson(e));if(!t.success)return this.logger.warn(`Discarding corrupt persisted session`),this.clear(),null;let n=Uz.restore(t.data);return HD(n)?(this.logger.warn(`Discarding unrestorable persisted session`),this.clear(),null):n.value}save(e){this.storage.setItem(this.key,JSON.stringify(e.snapshot()))}clear(){this.storage.removeItem(this.key)}tryParseJson(e){try{return JSON.parse(e)}catch{return null}}},pB=e=>AE((t,n)=>({status:`initializing`,session:null,error:null,loginUrl:e.loginUrl,initialize:async()=>{t({status:`initializing`,error:null});let n=await e.restoreSessionUseCase.execute(),r=HD(n)?null:n.value;e.setAccessToken(r?.accessToken??null),t({status:r?`authenticated`:`unauthenticated`,session:r})},completeLogin:async n=>{t({status:`authenticating`,error:null});let r=await e.completeSsoLoginUseCase.execute(n);return HD(r)?(t({status:`unauthenticated`,session:null,error:r.error.message}),!1):(e.setAccessToken(r.value.accessToken),t({status:`authenticated`,session:r.value,error:null}),!0)},logout:async()=>{await e.logoutUseCase.execute(n().session),e.setAccessToken(null),t({status:`unauthenticated`,session:null,error:null})},refreshSession:async()=>{let r=n().session;if(r===null)return!1;let i=await e.refreshSessionUseCase.execute(r);return HD(i)?(e.setAccessToken(null),t({status:`unauthenticated`,session:null}),!1):(e.setAccessToken(i.value.accessToken),t({status:`authenticated`,session:i.value,error:null}),!0)},clearError:()=>{t({error:null})}})),mB=(0,n.createContext)(null),hB=({store:e,children:t})=>((0,n.useEffect)(()=>{e.getState().initialize()},[e]),(0,D.jsx)(mB.Provider,{value:e,children:t})),gB=e=>{let t=(0,n.useContext)(mB);if(t===null)throw Error(`Auth hooks must be used within <AuthStoreProvider>.`);return ME(t,e)},_B=()=>{let e=sN(),t=gB(e=>e.status),n=gB(e=>e.session?.user??null),r=gB(e=>e.error),i=gB(e=>e.loginUrl),a=gB(e=>e.completeLogin),o=gB(e=>e.logout),s=gB(e=>e.clearError);return{status:t,user:n,error:r,isAuthenticated:t===`authenticated`,isInitializing:t===`initializing`,isBusy:t===`authenticating`,loginUrl:i,completeLogin:a,logout:async()=>{e.clear(),await o()},clearError:s}},vB=(e,t)=>{let n=e.status===`connected`;return e.onStatusChange(e=>{e===`connected`&&(n&&t.getState().phase===`outgoing`&&t.getState().reset(),n=!0)})},yB=e=>{let{connection:t,store:n,declineCall:r,logger:i}=e,a=[vB(t,n),t.on(Ez.IncomingCall,e=>{let t=Az(e,Ez.IncomingCall,i);if(t===null)return;let a=n.getState().phase;if(a!==`idle`&&a!==`ended`){r.execute(t.callId);return}n.getState().incoming({callId:t.callId,peer:{userId:t.callerUserId,name:t.callerName,initials:t.callerInitials,color:t.callerColor},mediaType:t.type===`video`?`video`:`audio`})}),t.on(Ez.CallAccepted,e=>{let t=jz(e,Ez.CallAccepted,i);if(t===null)return;let r=n.getState();r.callId===t.callId&&(r.direction===`outgoing`?r.activate(null,Date.now()):r.phase===`incoming`&&r.reset())}),t.on(Ez.CallDeclined,e=>{let t=jz(e,Ez.CallDeclined,i);t!==null&&n.getState().callId===t.callId&&n.getState().ended(`declined`)}),t.on(Ez.CallCanceled,e=>{let t=jz(e,Ez.CallCanceled,i);t!==null&&n.getState().callId===t.callId&&n.getState().reset()}),t.on(Ez.CallEnded,e=>{let t=Mz(e,Ez.CallEnded,i);t!==null&&n.getState().callId===t.callId&&n.getState().ended(t.reason)})];return()=>{for(let e of a)e()}},bB=()=>{let e=(0,n.useContext)(Iz);if(e===null)throw Error(`Calls hooks must be used within <CallsModuleProvider>.`);return e},xB=e=>ME(bB().store,e),SB=()=>{let{isAuthenticated:e}=_B(),{realtime:t,store:r,declineCall:i,logger:a}=bB();(0,n.useEffect)(()=>yB({connection:t,store:r,declineCall:i,logger:a}),[t,r,i,a]),(0,n.useEffect)(()=>{if(!e){t.stop(),r.getState().reset();return}return t.start().catch(()=>void 0),()=>{t.stop()}},[e,t,r])},CB=({children:e})=>(SB(),(0,D.jsx)(D.Fragment,{children:e})),wB=(e,t)=>{let n=e.currentTime+t.atMs/1e3,r=t.durMs/1e3,i=e.createGain();i.connect(e.destination),i.gain.setValueAtTime(1e-4,n),i.gain.linearRampToValueAtTime(t.volume,n+.02),i.gain.exponentialRampToValueAtTime(Math.max(1e-4,t.volume*.5),n+r*.6),i.gain.linearRampToValueAtTime(1e-4,n+r);let a=e.createOscillator();a.type=t.type??`triangle`,a.frequency.value=t.freq,a.connect(i),a.start(n),a.stop(n+r+.03)},TB=()=>{let e=globalThis,t=e.AudioContext??e.webkitAudioContext;return typeof t==`function`?t:null},EB=()=>{let e=null,t=null,n=()=>{if(e!==null)return e;let t=TB();return t===null?null:(e=new t,e)},r=()=>{t!==null&&(window.clearInterval(t),t=null)},i=e=>{let t=n();t!==null&&wB(t,e)},a=(e,i)=>{r();let a=n();a!==null&&(a.resume().catch(()=>void 0),e(),t=window.setInterval(e,i))};return{unlock:()=>{let e=n();e!==null&&e.resume().catch(()=>void 0)},playRing:()=>{let e=e=>{i({freq:440,atMs:e+0,durMs:230,volume:.38}),i({freq:554,atMs:e+190,durMs:230,volume:.38}),i({freq:659,atMs:e+380,durMs:230,volume:.38}),i({freq:880,atMs:e+570,durMs:340,volume:.4})};a(()=>{e(0),e(900)},3e3)},playRingback:()=>{a(()=>{i({freq:440,atMs:0,durMs:1200,volume:.13,type:`sine`}),i({freq:480,atMs:0,durMs:1200,volume:.11,type:`sine`})},3e3)},stop:r,dispose:()=>{r(),e!==null&&(e.close().catch(()=>void 0),e=null)}}},DB=(0,n.lazy)(()=>Promise.resolve().then(()=>require("./realtimekit-call-media-Bw4ob8QT.cjs")).then(e=>({default:e.RealtimeKitCallMedia}))),OB=e=>{let t=e.ticket.providerType;return(0,D.jsx)(n.Suspense,{fallback:null,children:t===`cloudflare`?(0,D.jsx)(DB,{...e}):null})},kB=(e=window)=>e.documentPictureInPicture!==void 0,AB=(e=window)=>e.documentPictureInPicture?.window??null,jB=(e,t)=>{let n=Reflect.get(e,t);return n===void 0?[]:Array.from(n)},MB=e=>[...jB(e,`styleSheets`),...jB(e,`adoptedStyleSheets`)],NB=e=>{try{return Array.from(e.cssRules).map(e=>e.cssText).join(`
57
57
  `)}catch{return null}},PB=(e,t=document)=>{for(let n of MB(t)){let t=NB(n);if(t!==null){let n=e.document.createElement(`style`);n.textContent=t,e.document.head.append(n)}else if(n.href!==null){let t=e.document.createElement(`link`);t.rel=`stylesheet`,t.href=n.href,e.document.head.append(t)}}},FB=(e,t=document)=>{let n=t.documentElement,r=n.getAttribute(`data-theme`);r!==null&&e.document.documentElement.setAttribute(`data-theme`,r),e.document.documentElement.setAttribute(`class`,n.className),e.document.body.setAttribute(`class`,t.body.className)},IB=(e,t)=>{let n=e.document.createElement(`div`);e.document.body.append(n);let r=n.attachShadow({mode:`open`}),i=MB(t).map(NB).filter(e=>e!==null).join(`
58
- `),a=Reflect.get(e,`CSSStyleSheet`);if(typeof a?.prototype.replaceSync!=`function`){let t=e.document.createElement(`style`);t.textContent=i,r.append(t)}else{let e=new a;e.replaceSync(i),r.adoptedStyleSheets=[e]}let o=t.host,s=o.getAttribute(`data-theme`);return s!==null&&n.setAttribute(`data-theme`,s),n.setAttribute(`style`,o.getAttribute(`style`)??``),r},LB=async(e={},t=document,n=window)=>{let r=n.documentPictureInPicture;if(r===void 0)return null;try{let n=await r.requestWindow({width:e.width??320,height:e.height??220});return t instanceof ShadowRoot?{window:n,container:IB(n,t)}:(PB(n,t),FB(n,t),{window:n,container:n.document.body})}catch{return null}},RB=(e,t)=>{let[r,i]=(0,n.useState)(null),a=(0,n.useRef)(null);a.current=r;let o=(0,n.useRef)(t);o.current=t;let s=(0,n.useCallback)(()=>{a.current?.window.close(),i(null)},[]),c=(0,n.useCallback)(async()=>{if(a.current!==null)return;let e=o.current.current?.getRootNode(),t=await LB({},e instanceof ShadowRoot||e instanceof Document?e:document);t!==null&&(t.window.addEventListener(`pagehide`,()=>{i(null)}),i(t))},[]),l=(0,n.useCallback)(()=>{c()},[c]);return(0,n.useEffect)(()=>{let t=Reflect.get(navigator,`mediaSession`);if(!e||!kB()||t===void 0)return;let n=`enterpictureinpicture`;try{t.setActionHandler(n,()=>{c()})}catch{return}return()=>{try{t.setActionHandler(n,null)}catch{}}},[e,c]),(0,n.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&s()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[s]),(0,n.useEffect)(()=>{e||(s(),AB()?.close())},[e,s]),(0,n.useEffect)(()=>s,[s]),{mount:r,popOut:l}},zB={overlay:`_overlay_1agsz_5`,card:`_card_1agsz_12`,draggable:`_draggable_1agsz_30`,head:`_head_1agsz_40`,info:`_info_1agsz_46`,avatarRing:`_avatarRing_1agsz_53`,avatarRingPulse:`_avatarRingPulse_1agsz_65`,callPulse:`_callPulse_1agsz_1`,avatar:`_avatar_1agsz_53`,name:`_name_1agsz_107`,status:`_status_1agsz_117`,timer:`_timer_1agsz_123`,actions:`_actions_1agsz_130`,btn:`_btn_1agsz_137`,accept:`_accept_1agsz_163`,acceptBob:`_acceptBob_1agsz_1`,decline:`_decline_1agsz_178`,mute:`_mute_1agsz_182`,muteOn:`_muteOn_1agsz_191`,popped:`_popped_1agsz_208`,popOut:`_popOut_1agsz_224`},BB=e=>{let t=e.trim().split(/\s+/).filter(e=>e.length>0);if(t.length===0)return`?`;let n=t[0]??``,r=t.length>1?t[t.length-1]??``:``;return(n.charAt(0)+r.charAt(0)).toUpperCase()},VB=e=>e===`unavailable`?`Unavailable`:e===`failed`?`Call failed`:`Call ended`,HB=(e,t,n,r)=>{let i=t===`video`?`video`:`voice`;switch(e){case`incoming`:return`Incoming ${i} call`;case`outgoing`:return n?`Ringing…`:`Calling…`;case`active`:return`Connecting…`;case`ended`:return VB(r);case`idle`:return``}},UB=({sinceMs:e})=>{let[t,r]=(0,n.useState)(()=>Date.now());(0,n.useEffect)(()=>{let e=window.setInterval(()=>{r(Date.now())},1e3);return()=>{window.clearInterval(e)}},[]);let i=Math.max(0,Math.floor((t-e)/1e3)),a=String(Math.floor(i/60)).padStart(2,`0`),o=String(i%60).padStart(2,`0`);return(0,D.jsxs)(`span`,{className:zB.timer,children:[a,`:`,o]})},WB=({phase:e,muted:t,actions:n})=>e===`ended`?null:e===`incoming`?(0,D.jsxs)(`div`,{className:zB.actions,children:[(0,D.jsx)(`button`,{type:`button`,className:T(zB.btn,zB.decline),onClick:()=>{n.decline()},"aria-label":`Decline call`,children:(0,D.jsx)(Ar,{size:24})}),(0,D.jsx)(`button`,{type:`button`,className:T(zB.btn,zB.accept),onClick:()=>{n.accept()},"aria-label":`Accept call`,children:(0,D.jsx)(jr,{size:24})})]}):(0,D.jsxs)(`div`,{className:zB.actions,children:[e===`active`&&(0,D.jsx)(`button`,{type:`button`,className:T(zB.btn,zB.mute,t&&zB.muteOn),onClick:()=>{n.toggleMute()},"aria-label":t?`Unmute`:`Mute`,children:t?(0,D.jsx)(Cr,{size:20}):(0,D.jsx)(wr,{size:20})}),(0,D.jsx)(`button`,{type:`button`,className:T(zB.btn,zB.decline),onClick:()=>{n.hangup()},"aria-label":`Hang up`,children:(0,D.jsx)(Ar,{size:24})})]}),GB=e=>{let t=e.phase===`outgoing`&&e.callId!==null,n=e.phase===`active`&&e.connected&&e.activeSinceMs!==null;return{ringing:e.phase===`incoming`||e.phase===`outgoing`,initials:e.peerInitials===``?BB(e.peerName):e.peerInitials,status:n?(0,D.jsx)(UB,{sinceMs:e.activeSinceMs}):HB(e.phase,e.mediaType,t,e.endReason)}},KB=({peerName:e,initials:t,peerColor:n,ringing:r,status:i,onPopOut:a})=>(0,D.jsxs)(`div`,{className:zB.head,children:[(0,D.jsx)(`div`,{className:T(zB.avatarRing,r&&zB.avatarRingPulse),children:(0,D.jsx)(`div`,{className:zB.avatar,style:n===``?void 0:E({"--avatar-color":n}),"aria-hidden":`true`,children:t})}),(0,D.jsxs)(`div`,{className:zB.info,children:[(0,D.jsx)(`div`,{className:zB.name,children:e===``?`Unknown caller`:e}),(0,D.jsx)(`div`,{className:zB.status,children:i})]}),a!==null&&(0,D.jsx)(`button`,{type:`button`,className:zB.popOut,onClick:a,"aria-label":`Keep call on top`,title:`Keep call on top`,children:(0,D.jsx)(Mr,{size:16})})]}),qB=({actions:e})=>{let t=xB(e=>e.phase),r=xB(e=>e.callId),a=xB(e=>e.peerName),o=xB(e=>e.peerInitials),s=xB(e=>e.peerColor),c=xB(e=>e.mediaType),l=xB(e=>e.muted),u=xB(e=>e.connected),d=xB(e=>e.activeSinceMs),f=xB(e=>e.endReason),p=(0,n.useRef)(null),{mount:m,popOut:h}=RB(t===`incoming`||t===`outgoing`||t===`active`,p);if(t===`idle`)return null;let g=m!==null,_=t===`active`&&!g,{ringing:v,initials:y,status:b}=GB({phase:t,callId:r,peerName:a,peerInitials:o,mediaType:c,connected:u,activeSinceMs:d,endReason:f}),x=(0,D.jsx)(`div`,{className:T(zB.overlay,g&&zB.popped),ref:p,role:`dialog`,"aria-label":`Call`,children:(0,D.jsxs)(A.div,{className:T(zB.card,_&&zB.draggable),variants:Hy,initial:`hidden`,animate:`visible`,drag:_,dragConstraints:p,dragElastic:.12,dragMomentum:!1,children:[(0,D.jsx)(KB,{peerName:a,initials:y,peerColor:s,ringing:v,status:b,onPopOut:!g&&kB()?h:null}),(0,D.jsx)(WB,{phase:t,muted:l,actions:e})]})});return m===null?x:(0,i.createPortal)(x,m.container)},JB=0,YB=(e,t)=>{let n=e.getState();return n.direction===`outgoing`&&n.phase===`outgoing`&&n.callId===null&&n.dialId===t},XB=async({store:e,cancelCall:t,dialId:n,result:r})=>{let i=YB(e,n);if(!r.ok){i&&e.getState().ended(`failed`);return}let a=r.value;if(a.status===`callee_unavailable`||a.joinTicket===null){i&&e.getState().ended(`unavailable`);return}if(!i){await t.execute(a.callId);return}e.getState().attachOutgoing({callId:a.callId,ticket:a.joinTicket})},ZB=()=>{let{store:e,startCall:t,acceptCall:r,declineCall:i,cancelCall:a,endCall:o}=bB();return{startCall:(0,n.useCallback)(async n=>{if(n.userId===``)return;let r=e.getState().phase;if(r!==`idle`&&r!==`ended`)return;let i=String(JB+=1);e.getState().dialing({peer:n,mediaType:`audio`,dialId:i}),await XB({store:e,cancelCall:a,dialId:i,result:await t.execute(n.userId,`audio`)})},[e,t,a]),accept:(0,n.useCallback)(async()=>{let{callId:t,direction:n}=e.getState();if(t===null||n!==`incoming`)return;e.getState().activate(null,Date.now());let i=await r.execute(t);if(!i.ok){e.getState().ended(`failed`);return}e.getState().activate(i.value,Date.now())},[e,r]),decline:(0,n.useCallback)(async()=>{let{callId:t}=e.getState();e.getState().reset(),t!==null&&await i.execute(t)},[e,i]),hangup:(0,n.useCallback)(async()=>{let{callId:t,phase:n}=e.getState();e.getState().ended(`hung_up`),t!==null&&(n===`active`?await o.execute(t):await a.execute(t))},[e,o,a]),toggleMute:(0,n.useCallback)(()=>{let t=e.getState();t.setMuted(!t.muted)},[e])}},QB=()=>{let e=xB(e=>e.phase),t=xB(e=>e.ticket),r=xB(e=>e.muted),i=bB().store,a=ZB(),o=(0,n.useRef)(null);o.current??=EB();let s=o.current;return(0,n.useEffect)(()=>{let e=()=>{s.unlock()};return window.addEventListener(`pointerdown`,e,{once:!0}),()=>{window.removeEventListener(`pointerdown`,e)}},[s]),(0,n.useEffect)(()=>{e===`incoming`?s.playRing():e===`outgoing`?s.playRingback():s.stop()},[e,s]),(0,n.useEffect)(()=>()=>{s.dispose()},[s]),(0,n.useEffect)(()=>{if(e!==`ended`)return;let t=window.setTimeout(()=>{i.getState().reset()},2500);return()=>{window.clearTimeout(t)}},[e,i]),e===`idle`?null:(0,D.jsxs)(D.Fragment,{children:[t!==null&&(e===`outgoing`||e===`active`)&&(0,D.jsx)(OB,{ticket:t,muted:r,onConnected:()=>{i.getState().markConnected()},onEnded:()=>{i.getState().ended(`ended`)}}),(0,D.jsx)(qB,{actions:a})]})},$B=()=>{let{startCall:e}=ZB(),t=xB(e=>e.phase);return{start:t=>{e(t)},busy:t!==`idle`&&t!==`ended`}},eV={callBtn:`_callBtn_1q44j_1`},tV=({calleeUserId:e,calleeName:t,calleeInitials:n=``,calleeColor:r=``,className:i})=>{let{start:a,busy:o}=$B();return e===``?null:(0,D.jsx)(`button`,{type:`button`,className:T(eV.callBtn,i),disabled:o,onClick:()=>{a({userId:e,name:t,initials:n,color:r})},"aria-label":`Call ${t}`,title:`Call ${t}`,children:(0,D.jsx)(jr,{size:18})})},nV=({conversation:e})=>e.isGroup||e.peerUserId===null?null:(0,D.jsx)(`div`,{className:K.headEnd,children:(0,D.jsx)(tV,{calleeUserId:e.peerUserId,calleeName:e.title,calleeInitials:e.initials,calleeColor:e.color})}),rV=6e4,iV=36e5,aV=864e5,oV=(e,t)=>{if(e===null)return null;let n=Date.parse(e);if(Number.isNaN(n))return null;let r=Math.max(0,t-n);return r<rV?`Last seen just now`:r<iV?`Last seen ${String(Math.floor(r/rV))}m ago`:r<aV?`Last seen ${String(Math.floor(r/iV))}h ago`:`Last seen ${String(Math.floor(r/aV))}d ago`},sV=({conversation:e,live:t,liveStatus:n,nowMs:r})=>{if(t?.online??(n===void 0?e.online:n.status!==`offline`)){let t=n?.status??e.status;return{online:!0,subtitle:`Online`,status:t!==`offline`&&t!==`available`?t:null}}return{online:!1,subtitle:(t===void 0?null:oV(t.lastSeenUtc,r))??`Offline`,status:null}},cV=`This message was deleted`,lV=e=>{if(e.startsWith(`__UAPP_SHARED_CARD__::`))try{let t=e.substring(22);return JSON.parse(t)}catch{return null}return null},uV=e=>{if(e.startsWith(`__UAPP_SHARED_CARD__::`)){let t=lV(e);if(t!==null){let e=t.card.title;return e.length>0?`Shared Post: ${e}`:`Shared Post`}return`Shared Post`}return e},dV=(e,t=null)=>t?.text.startsWith(`__UAPP_SHARED_CARD__::`)?{messageId:e.id,authorName:t.authorName,text:t.text}:e.replyTo?.text.startsWith(`__UAPP_SHARED_CARD__::`)?{messageId:e.id,authorName:e.replyTo.authorName,text:e.replyTo.text}:{messageId:e.id,authorName:e.authorName,text:e.text},fV=(e,t)=>{if(e.replyTo===null)return null;let n=t.get(e.replyTo.messageId),r=n?.deletedForEveryone?cV:n?.text??e.replyTo.text,i=n?.authorName??e.replyTo.authorName;return r.startsWith(`__UAPP_SHARED_CARD__::`)?{author:i,text:r}:null},pV=(e,t)=>{if(e===null)return null;if(e.authorName.length>0||e.text.length>0)return e;let n=t.get(e.messageId);if(n===void 0)return e;let r=n.authorName,i=n.deletedForEveryone?cV:n.text,a=fV(n,t);return a!==null&&(r=a.author,i=a.text),{messageId:e.messageId,authorName:r,text:i}},mV=(e,t)=>e.some(e=>e.id===t.id)?e:t.clientMessageId!==null&&e.some(e=>e.clientMessageId===t.clientMessageId)?e.map(e=>e.clientMessageId===t.clientMessageId?t.withFallbackSentAt(e.sentAt):e):[...e,t].sort((e,t)=>e.sequence-t.sequence),hV=`pending:`,gV=e=>`${hV}${e}`,_V=e=>e.id.startsWith(hV),vV=e=>e.reduce((e,t)=>Math.max(e,t.sequence),0),yV=e=>e.filter(e=>!_V(e)).reduce((e,t)=>Math.max(e,t.sequence),0),bV=e=>new AP({id:gV(e.clientMessageId),kind:`text`,authorName:e.viewer.name,authorInitials:e.viewer.initials,authorColor:e.viewer.color,text:e.text.trim(),time:e.timeLabel,sentAt:e.sentAt??``,fromViewer:!0,reactions:[],sequence:e.sequence,senderId:e.viewer.id,clientMessageId:e.clientMessageId,replyTo:e.replyTo??null,mediaUrl:null,isEdited:!1}),xV=e=>new AP({id:gV(e.clientMessageId),kind:`media`,authorName:e.viewer.name,authorInitials:e.viewer.initials,authorColor:e.viewer.color,text:e.caption.trim(),time:``,sentAt:e.sentAt,fromViewer:!0,reactions:[],sequence:e.sequence,senderId:e.viewer.id,clientMessageId:e.clientMessageId,replyTo:e.replyTo??null,mediaUrl:e.fileUrl,mediaContentType:e.contentType,mediaFileName:e.fileName,isEdited:!1}),SV=(e,t)=>mV(e??[],t),CV=(e,t)=>mV(e??[],t),wV=({selectedMessage:e,onClearSelection:t,onReply:n,onStartEdit:r,onDelete:i})=>{let a=_V(e),o=e.fromViewer&&!e.deletedForEveryone&&e.canEdit(Date.now());return(0,D.jsxs)(`div`,{className:K.mobileSelectionHeader,children:[(0,D.jsxs)(`div`,{className:K.selectionLeft,children:[(0,D.jsx)(`button`,{type:`button`,className:K.selectionActionBtn,"aria-label":`Clear selection`,onClick:t,children:(0,D.jsx)(ci,{size:18})}),(0,D.jsx)(`span`,{className:K.selectionTitle,children:`1 Selected`})]}),(0,D.jsxs)(`div`,{className:K.selectionActions,children:[!a&&n!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:K.selectionActionBtn,title:`Reply`,"aria-label":`Reply`,onClick:()=>{n(dV(e)),t!==void 0&&t()},children:(0,D.jsx)(Br,{size:17})}),!a&&o&&r!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:K.selectionActionBtn,title:`Edit message`,"aria-label":`Edit message`,onClick:()=>{r(e),t!==void 0&&t()},children:(0,D.jsx)(kr,{size:17})}),!a&&e.fromViewer&&i!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:T(K.selectionActionBtn,K.selectionActionDanger),title:`Delete message`,"aria-label":`Delete message`,onClick:()=>{i(e.id),t!==void 0&&t()},children:(0,D.jsx)(ni,{size:17})})]})]})},TV=(e,t,n)=>[...e.lastSynced===null?[]:[{label:`Last synced ${e.lastSynced}`,icon:(0,D.jsx)(Ir,{size:14}),onSelect:()=>{t.refresh(e)}}],{label:`Manage members`,icon:(0,D.jsx)(ai,{size:14}),onSelect:n.onManageMembers},{label:e.favourite?`Remove from Favourites`:`Add to Favourites`,icon:(0,D.jsx)(Zr,{size:14}),onSelect:()=>{t.toggleFavourite(e)}},{label:e.pinned?`Unpin`:`Pin to top`,icon:(0,D.jsx)(Nr,{size:14}),onSelect:()=>{t.togglePin(e)}},{label:e.archived?`Unarchive`:`Archive`,icon:e.archived?(0,D.jsx)(kn,{size:14}):(0,D.jsx)(An,{size:14}),onSelect:()=>{t.toggleArchive(e)}},{label:`Leave group`,icon:(0,D.jsx)(vr,{size:14}),onSelect:()=>{n.onRequestLeave(e)}},{label:`Delete group`,icon:(0,D.jsx)(ni,{size:14}),danger:!0,onSelect:()=>{n.onRequestDelete(e)}}],EV=(e,t)=>{let n=t.find(t=>t.id===e.categoryId&&t.tenantId===e.tenantId);return n===void 0?t.find(t=>t.locked&&t.tenantId===e.tenantId)??null:n},DV=e=>{let t=Object.entries(e.data).filter(([e,t])=>e!==`statusColor`&&t!==``).map(([,e])=>e).slice(0,4);return t.length>0?t.join(` · `):e.subtitle},OV=(e,t)=>{let n=EV(e,t);if(n===null)return{icon:null,accent:e.color,pill:null,subtitle:e.subtitle};let r=t=>e.data[t]??``,i=n.fields.filter(e=>e.visible&&r(e.key)!==``);if(i.length===0)return{icon:n.icon,accent:n.accent,pill:null,subtitle:DV(e)};let a=i.find(e=>e.type===`pill`),o=i.filter(e=>e.type!==`pill`).slice(0,4).map(e=>r(e.key));return{icon:n.icon,accent:n.accent,pill:a===void 0?null:{value:r(a.key),color:e.data.statusColor??n.accent},subtitle:o.length>0?o.join(` · `):e.subtitle}},kV=4,AV={Hash:dr,GraduationCap:ur,Users:ai,Building2:Rn,Briefcase:Ln,BookOpen:Fn,Globe:lr},jV=({conversation:e,header:t,dmOnline:n})=>{let r=t?.icon??null,i=r===null?void 0:AV[r];return i===void 0?(0,D.jsxs)(`span`,{className:K.viewAvatarWrap,children:[(0,D.jsx)(`span`,{className:K.viewAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),n===!0&&(0,D.jsx)(`span`,{className:T(K.presenceDot,K.viewPresenceDot),"aria-label":`Online`})]}):(0,D.jsx)(`span`,{className:K.viewIcon,style:E({"--avatar-color":t?.accent??e.color}),children:(0,D.jsx)(i,{size:18})})},MV=({members:e})=>{if(e.length===0)return null;let t=e.length-kV;return(0,D.jsxs)(`div`,{className:K.memberStack,children:[e.slice(0,kV).map(e=>(0,D.jsx)(`span`,{className:K.memberAvatar,title:e.name,children:(0,D.jsx)(GE,{initials:e.initials,color:e.color,size:`xs`})},e.id)),t>0&&(0,D.jsxs)(`span`,{className:K.memberMore,children:[`+`,t]})]})},NV=(e,t)=>{let n=`${String(e.memberCount)} member${e.memberCount===1?``:`s`}`,r=t?.subtitle??e.subtitle;return r===``||r===e.title?n:`${n} · ${r}`},PV=({conversation:e,pill:t,presence:n,statusPill:r,subtitle:i})=>(0,D.jsxs)(`span`,{className:K.viewHeadText,children:[(0,D.jsxs)(`span`,{className:K.viewTitleRow,children:[(0,D.jsx)(`span`,{className:K.viewTitle,children:e.title}),e.admin&&(0,D.jsx)(`span`,{className:K.adminBadge,children:`You're admin`}),t?(0,D.jsx)(`span`,{className:K.statusPill,style:E({"--pill":t.color}),children:t.value}):null,n===null?null:(0,D.jsx)(nz,{untilUtc:e.statusUntilUtc,status:n}),r]}),(0,D.jsx)(`span`,{className:K.viewSub,children:i})]}),FV=({conversation:e,header:t,dmOnline:n,dmStatus:r,pill:i,statusPill:a,subtitle:o,actions:s,onManageMembers:c,onRequestDelete:l,onRequestLeave:u})=>{let d=Be();return(0,D.jsxs)(`div`,{className:K.standardHeader,children:[(0,D.jsx)(`button`,{type:`button`,className:K.backBtn,"aria-label":`Back to conversations`,onClick:()=>{d(`/comms/chats`)},children:(0,D.jsx)(jn,{size:18})}),(0,D.jsx)(jV,{conversation:e,header:t,dmOnline:n}),(0,D.jsx)(PV,{conversation:e,pill:i,presence:r,statusPill:a,subtitle:o}),e.isGroup&&(0,D.jsxs)(`div`,{className:K.headEnd,children:[(0,D.jsx)(`button`,{type:`button`,className:K.memberStackBtn,"aria-label":`Manage members`,onClick:c,children:(0,D.jsx)(MV,{members:e.members})}),(0,D.jsx)(FT,{align:`end`,trigger:(0,D.jsx)(`button`,{type:`button`,className:K.headMenuBtn,"aria-label":`Group options`,children:(0,D.jsx)(tr,{size:16})}),items:TV(e,s,{onManageMembers:c,onRequestDelete:l,onRequestLeave:u})})]}),(0,D.jsx)(nV,{conversation:e})]})},IV=({conversation:e,categories:t,actions:n,statusPill:r,onManageMembers:i,onRequestDelete:a,onRequestLeave:o,selectedMessage:s=null,onClearSelection:c,onReply:l,onStartEdit:u,onDelete:d})=>{let f=e.isGroup?OV(e,t):null,p=f?.pill??null,m=e.peerUserId,h=sV({conversation:e,live:vP(e=>m===null?void 0:e.presence[m]),liveStatus:kR(m),nowMs:Date.now()}),g=e.isGroup?NV(e,f):h.subtitle,_=s!==null;return(0,D.jsxs)(`header`,{className:T(K.viewHead,_&&K.hasMobileSelection),children:[s!==null&&(0,D.jsx)(wV,{selectedMessage:s,onClearSelection:c,onReply:l,onStartEdit:u,onDelete:d}),(0,D.jsx)(FV,{conversation:e,header:f,dmOnline:e.isGroup?null:h.online,dmStatus:e.isGroup?null:h.status,pill:p,statusPill:r,subtitle:g,actions:n,onManageMembers:i,onRequestDelete:a,onRequestLeave:o})]})},LV=({excludeIds:e,onAdd:t,onBack:n})=>{let{search:r,setSearch:i,results:a,loading:o,hasQuery:s}=kF(e,`groupPool`);return(0,D.jsxs)(`div`,{className:K.addPanel,children:[(0,D.jsxs)(`div`,{className:K.addPanelHead,children:[(0,D.jsx)(`button`,{type:`button`,className:K.memberRowMenuBtn,"aria-label":`Back to members`,onClick:n,children:(0,D.jsx)(jn,{size:15})}),(0,D.jsx)(`span`,{className:K.addPanelTitle,children:`Add member`})]}),(0,D.jsxs)(`div`,{className:K.addPanelSearch,children:[(0,D.jsx)(Hr,{size:14}),(0,D.jsx)(`input`,{className:K.searchInput,placeholder:`Search staff`,value:r,onChange:e=>{i(e.target.value)}}),o&&(0,D.jsx)(gi,{size:`sm`,label:`Searching staff`})]}),(0,D.jsxs)(`div`,{className:K.addPanelList,children:[(0,D.jsx)(Kg,{initial:!1,children:a.map(e=>(0,D.jsxs)(A.div,{layout:!0,variants:Vy,initial:`hidden`,animate:`visible`,exit:`exit`,className:K.memberRow,children:[(0,D.jsx)(`span`,{className:K.memberRowAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:K.memberRowBody,children:[(0,D.jsx)(`span`,{className:K.memberRowName,children:e.name}),(0,D.jsx)(`span`,{className:K.memberRowRole,children:e.role})]}),(0,D.jsxs)(`button`,{type:`button`,className:K.addMemberBtn,onClick:()=>{t(e)},children:[(0,D.jsx)(Pr,{size:13}),` Add`]})]},e.id))}),a.length===0&&!o&&(0,D.jsx)(`p`,{className:K.addPanelEmpty,children:s?`No staff match your search.`:`Everyone is already in this group.`})]})]})},RV=e=>{let{member:t,isAdmin:n,adminCount:r,onMakeAdmin:i,onRemoveAdmin:a,onRemove:o}=e,s=[];return n||s.push({label:`Make admin`,icon:(0,D.jsx)(Kr,{size:14}),onSelect:()=>{i(t.id)}}),n&&r>1&&s.push({label:`Remove admin`,icon:(0,D.jsx)(Gr,{size:14}),onSelect:()=>{a(t.id)}}),s.push({label:`Remove from group`,icon:(0,D.jsx)(ni,{size:14}),danger:!0,onSelect:()=>{o(t.id)}}),s},zV=({member:e})=>{let t=kR(e.id),n=t?.status??e.status??`offline`;return n===`offline`?null:(0,D.jsx)(nz,{status:n,untilUtc:t===void 0?e.statusUntilUtc??null:t.untilUtc})},BV=e=>{let{member:t,isAdmin:n,isSelf:r,isNew:i,isPromoted:a,isDemoted:o,canManage:s}=e,c=vP(e=>e.presence[t.id]?.online??!1);return(0,D.jsxs)(A.div,{layout:!0,variants:Vy,initial:`hidden`,animate:`visible`,className:T(K.memberRow,i&&K.memberRowNew),children:[(0,D.jsxs)(`span`,{className:K.memberRowAvatarWrap,children:[(0,D.jsx)(`span`,{className:K.memberRowAvatar,style:E({"--avatar-color":t.color}),children:t.initials}),c&&(0,D.jsx)(`span`,{className:K.presenceDot,"aria-label":`Online`})]}),(0,D.jsxs)(`span`,{className:K.memberRowBody,children:[(0,D.jsxs)(`span`,{className:K.memberRowName,children:[t.name,r&&(0,D.jsx)(`span`,{className:K.memberRowYou,children:` (You)`}),n?(0,D.jsx)(`span`,{className:K.memberBadgeAdmin,children:`ADMIN`}):(0,D.jsx)(`span`,{className:K.memberBadge,children:`MEMBER`}),i&&(0,D.jsx)(`span`,{className:K.memberPillNew,children:`+ NEW`}),a&&!i&&(0,D.jsx)(`span`,{className:K.memberPillUp,children:`↑ PROMOTED`}),o&&(0,D.jsx)(`span`,{className:K.memberPillDown,children:`↓ DEMOTED`})]}),(0,D.jsxs)(`span`,{className:K.memberRowRole,children:[t.role,(0,D.jsx)(zV,{member:t})]})]}),s&&!r&&(0,D.jsx)(FT,{align:`end`,trigger:(0,D.jsx)(`button`,{type:`button`,className:K.memberRowMenuBtn,"aria-label":`Actions for ${t.name}`,children:(0,D.jsx)(tr,{size:14})}),items:RV(e)})]})},VV=(e,t,n,r)=>{let i=e.map(e=>e.id),a=n.map(e=>e.id),o=a.filter(e=>!i.includes(e)),s=i.filter(e=>!a.includes(e)),c=r.filter(e=>!t.includes(e)&&a.includes(e)),l=t.filter(e=>!r.includes(e)&&a.includes(e));return{addedIds:o,removedIds:s,promotedIds:c,demotedIds:l,total:o.length+s.length+c.length+l.length}},HV=(e,t)=>t.some(t=>e.some(e=>e.id===t)),UV=e=>{let{addedIds:t,removedIds:n,promotedIds:r,demotedIds:i,total:a}=e;if(a===0)return`Save changes`;if(t.length===a)return t.length===1?`Add member`:`Add ${String(t.length)}`;if(n.length===a)return n.length===1?`Remove member`:`Remove ${String(n.length)}`;let o=r.length+i.length;return o===a?o===1?`Confirm`:`Confirm ${String(o)}`:`Save changes (${String(a)})`},WV=(e,t)=>{let[r,i]=(0,n.useState)(e.members),[a,o]=(0,n.useState)(e.adminIds),[s,c]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{t&&(i(e.members),o(e.adminIds),c(!1))},[t,e.id,e.members,e.adminIds]),{members:r,adminIds:a,adding:s,diff:VV(e.members,e.adminIds,r,a),adminCount:a.filter(e=>r.some(t=>t.id===e)).length,setAdding:c,addMember:e=>{i(t=>[...t,e]),c(!1)},removeMember:e=>{i(t=>t.filter(t=>t.id!==e)),o(t=>t.filter(t=>t!==e))},makeAdmin:e=>{o(t=>t.includes(e)?t:[...t,e])},removeAdmin:e=>{o(t=>t.filter(t=>t!==e))},undoRemove:e=>{i(t=>[...t,e])}}},GV=({member:e,onUndo:t})=>(0,D.jsxs)(`div`,{className:K.removedRow,children:[(0,D.jsx)(`span`,{className:K.memberRowAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:K.memberRowBody,children:[(0,D.jsx)(`span`,{className:K.removedName,children:e.name}),(0,D.jsx)(`span`,{className:K.memberRowRole,children:e.role})]}),(0,D.jsxs)(`button`,{type:`button`,className:K.undoBtn,onClick:t,children:[(0,D.jsx)(Vr,{size:12}),` Undo`]})]}),KV=e=>{let{conversation:t,draftMembers:n,draftAdminIds:r,diff:i,adminCount:a,iAmAdmin:o}=e,{viewerId:s}=e;return(0,D.jsxs)(`div`,{className:K.membersBody,children:[i.total>0&&(0,D.jsxs)(`div`,{className:K.unsavedBar,children:[i.total,` unsaved `,i.total===1?`change`:`changes`]}),o&&(0,D.jsxs)(`button`,{type:`button`,className:K.addMemberCta,onClick:e.onAddClick,children:[(0,D.jsx)(ii,{size:14}),` Add member`]}),(0,D.jsxs)(`div`,{className:K.membersSectionLabel,children:[`MEMBERS · `,n.length]}),(0,D.jsxs)(`div`,{className:K.membersList,children:[(0,D.jsx)(Kg,{initial:!1,children:n.map(t=>(0,D.jsx)(BV,{member:t,isAdmin:r.includes(t.id),isSelf:t.id===s,isNew:i.addedIds.includes(t.id),isPromoted:i.promotedIds.includes(t.id),isDemoted:i.demotedIds.includes(t.id),canManage:o,adminCount:a,onMakeAdmin:e.onMakeAdmin,onRemoveAdmin:e.onRemoveAdmin,onRemove:e.onRemove},t.id))}),i.removedIds.length>0&&(0,D.jsxs)(A.div,{variants:Vy,initial:`hidden`,animate:`visible`,children:[(0,D.jsxs)(`div`,{className:K.removedLabel,children:[`WILL BE REMOVED · `,i.removedIds.length]}),i.removedIds.map(n=>{let r=t.members.find(e=>e.id===n);return r===void 0?null:(0,D.jsx)(GV,{member:r,onUndo:()=>{e.onUndoRemove(r)}},n)})]})]})]})},qV=({diff:e,saving:t,onCancel:n,onSave:r})=>{let i=e.removedIds.length===e.total&&e.total>0;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(vi,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,D.jsx)(vi,{variant:i?`danger`:`primary`,isLoading:t,disabled:e.total===0,onClick:r,children:UV(e)})]})},JV=({conversation:e,open:t,onClose:n})=>{let r=yF(e.id),i=WV(e,t),{data:a}=uF(),o=a?.id??``,s=()=>{if(i.diff.total===0){n();return}if(!HV(i.members,i.adminIds)){j.error(`A group must keep at least one admin`);return}r.mutate({members:i.members,adminIds:i.adminIds},{onSuccess:()=>{j.success(`Members updated`),n()}})},c=i.members.length===1?`member`:`members`,l=i.adminCount===1?`admin`:`admins`;return(0,D.jsx)(Ky,{open:t,onOpenChange:e=>{e||n()},title:`Manage members`,description:`${e.title} · ${String(i.members.length)} ${c} · ${String(i.adminCount)} ${l}`,footer:i.adding?void 0:(0,D.jsx)(qV,{diff:i.diff,saving:r.isPending,onCancel:n,onSave:s}),children:i.adding?(0,D.jsx)(LV,{excludeIds:i.members.map(e=>e.id),onAdd:i.addMember,onBack:()=>{i.setAdding(!1)}}):(0,D.jsx)(KV,{conversation:e,draftMembers:i.members,draftAdminIds:i.adminIds,diff:i.diff,adminCount:i.adminCount,iAmAdmin:e.canManageMembers(o),viewerId:o,onAddClick:()=>{i.setAdding(!0)},onMakeAdmin:i.makeAdmin,onRemoveAdmin:i.removeAdmin,onRemove:i.removeMember,onUndoRemove:i.undoRemove})})},YV=({open:e,canDeleteForEveryone:t,onDeleteForMe:n,onDeleteForEveryone:r,onCancel:i})=>(0,D.jsx)(Ky,{open:e,onOpenChange:e=>{e||i()},title:`Delete message?`,footer:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(vi,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,D.jsx)(vi,{variant:`secondary`,onClick:n,children:`Delete for me`}),t&&(0,D.jsx)(vi,{variant:`danger`,onClick:r,children:`Delete for everyone`})]}),children:t?`Delete this message for everyone, or just remove it from this device?`:`This message can only be removed from this device — the time limit to delete it for everyone has passed.`}),XV=e=>e===1?`typing…`:`${String(e)} people typing…`,ZV=({conversationId:e})=>{let t=vP(t=>t.typingUserIds(e,Date.now()).length);return(0,D.jsx)(Kg,{children:t>0&&(0,D.jsxs)(A.div,{className:K.typingRow,variants:Uy,initial:`hidden`,animate:`visible`,exit:`exit`,children:[(0,D.jsxs)(`span`,{className:K.typingDots,"aria-hidden":!0,children:[(0,D.jsx)(`span`,{}),(0,D.jsx)(`span`,{}),(0,D.jsx)(`span`,{})]}),(0,D.jsx)(`span`,{className:K.typingText,children:XV(t)})]})})},QV=()=>{let e=vP(e=>e.status);if(e===`connected`||e===`connecting`)return null;let t=e===`reconnecting`?`Reconnecting…`:`Offline`;return(0,D.jsxs)(`span`,{className:K.connPill,children:[(0,D.jsx)(si,{size:12}),` `,t]})},$V=20*1024*1024,eH=(e,t,n)=>{let r=[],i=!1;for(let a of e){if(r.length>=t)break;if(a.size>n){i=!0;continue}r.push(a)}let a=e.reduce((e,t)=>e+ +(t.size<=n),0);return{accepted:r,skippedOversize:i,overflowed:a>t}},tH=()=>{let[e,t]=(0,n.useState)([]),r=(0,n.useRef)([]);return r.current=e,(0,n.useEffect)(()=>()=>{for(let e of r.current)e.previewUrl!==null&&URL.revokeObjectURL(e.previewUrl)},[]),{items:e,add:e=>{let n=10-r.current.length;if(n<=0){j.error(`You can attach up to 10 files at once.`);return}let{accepted:i,skippedOversize:a,overflowed:o}=eH(Array.from(e),n,$V);if(a&&j.error(`That file is over the 20 MB limit — please send a smaller file.`),o&&j.error(`You can attach up to 10 files at once.`),i.length===0)return;let s=i.map(e=>({id:crypto.randomUUID(),file:e,previewUrl:e.type.startsWith(`image/`)?URL.createObjectURL(e):null}));t(e=>[...e,...s])},remove:e=>{let n=r.current.find(t=>t.id===e);n!==void 0&&n.previewUrl!==null&&URL.revokeObjectURL(n.previewUrl),t(t=>t.filter(t=>t.id!==e))},clear:()=>{for(let e of r.current)e.previewUrl!==null&&URL.revokeObjectURL(e.previewUrl);t([])}}},nH=(e,t,n,r)=>{let i=()=>{n.current?.click()},a=()=>{e.items.length>0?(r.onSendMedia(e.items.map(e=>e.file),t),e.clear()):r.onSubmit()};return{openPicker:i,send:a,handleKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),a())},handlePaste:t=>{let n=t.clipboardData.files;n.length>0&&(t.preventDefault(),e.add(n))},onFileChange:t=>{t.target.files!==null&&t.target.files.length>0&&e.add(t.target.files);let r=n.current;r!==null&&(r.value=``)}}},rH=[`👍`,`🎉`,`❤️`,`😂`,`🙌`,`👏`],iH=[`😀`,`😄`,`😁`,`😂`,`😍`,`😎`,`🤝`,`🙏`,`👍`,`👏`,`🙌`,`🔥`,`🎉`,`⭐`,`✅`,`❤️`,`💡`,`📌`,`🚀`,`😢`],aH=({onPick:e})=>{let[t,r]=(0,n.useState)(!1);return(0,D.jsxs)(`div`,{className:K.emojiWrap,children:[(0,D.jsx)(`button`,{type:`button`,className:K.composerIcon,"aria-label":`Insert emoji`,"aria-expanded":t,onClick:()=>{r(e=>!e)},children:(0,D.jsx)(Yr,{size:18})}),(0,D.jsx)(Kg,{children:t&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:K.emojiBackdrop,"aria-label":`Close emoji picker`,onClick:()=>{r(!1)}}),(0,D.jsx)(A.div,{className:K.emojiPop,variants:Hy,initial:`hidden`,animate:`visible`,exit:`exit`,children:iH.map(t=>(0,D.jsx)(`button`,{type:`button`,className:K.emojiBtn,onClick:()=>{e(t),r(!1)},children:t},t))})]})})]})},oH=({replyTo:e,onClear:t})=>(0,D.jsxs)(`div`,{className:K.replyBar,children:[(0,D.jsxs)(`span`,{className:K.replyBarText,children:[`Replying to `,e.authorName,`: `,uV(e.text)]}),(0,D.jsx)(`button`,{type:`button`,className:K.replyBarClose,"aria-label":`Cancel reply`,onClick:t,children:(0,D.jsx)(ci,{size:16})})]}),sH=({attachments:e,onRemove:t,onAddMore:n})=>(0,D.jsxs)(A.div,{className:K.attachTray,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.16},children:[e.map(e=>(0,D.jsxs)(`div`,{className:K.attachItem,children:[e.previewUrl===null?(0,D.jsxs)(`div`,{className:K.attachFile,children:[(0,D.jsx)(sr,{size:20}),(0,D.jsx)(`span`,{className:K.attachFileName,children:e.file.name})]}):(0,D.jsx)(`img`,{className:K.attachThumb,src:e.previewUrl,alt:e.file.name}),(0,D.jsx)(`button`,{type:`button`,className:K.attachRemove,"aria-label":`Remove ${e.file.name}`,onClick:()=>{t(e.id)},children:(0,D.jsx)(ci,{size:13})})]},e.id)),(0,D.jsx)(`button`,{type:`button`,className:K.attachAdd,"aria-label":`Add more files`,onClick:n,children:(0,D.jsx)(Pr,{size:20})})]}),cH=({fileRef:e,onAttach:t,onFileChange:n})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`input`,{ref:e,type:`file`,multiple:!0,className:K.hiddenFileInput,accept:`image/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip`,onChange:n}),(0,D.jsx)(`button`,{type:`button`,className:K.composerIcon,"aria-label":`Attach files`,onClick:t,children:(0,D.jsx)(Er,{size:18})})]}),lH=({value:e,title:t,hasAttachments:n,isSending:r,canSend:i,fileRef:a,onChange:o,onTyping:s,onKeyDown:c,onPaste:l,onAttach:u,onFileChange:d,onSend:f})=>{let p=mi(`(max-width: 1024px)`),m=pi(e,4e3);return(0,D.jsxs)(`div`,{className:K.composer,children:[(0,D.jsx)(aH,{onPick:t=>{o(e+t)}}),(0,D.jsx)(cH,{fileRef:a,onAttach:u,onFileChange:d}),(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,D.jsx)(`textarea`,{className:T(K.composerInput,m.isOverLimit&&K.composerInputError),rows:1,placeholder:n?`Add a caption…`:p?`Message ${t}…`:`Message ${t}… (Shift+Enter for new line)`,value:e,onChange:e=>{o(e.target.value),s()},onKeyDown:c,onPaste:l}),m.showCounter&&(0,D.jsxs)(`div`,{style:{alignSelf:`flex-end`,fontSize:`10px`,color:m.counterColor===`danger`?`var(--color-danger)`:`var(--color-text-soft)`,marginRight:`8px`,fontWeight:500},children:[m.length,` / 4000`]})]}),(0,D.jsx)(`button`,{type:`button`,className:K.sendBtn,"aria-label":n?`Send attachments`:`Send message`,disabled:r||!i||m.isOverLimit,onClick:f,children:(0,D.jsx)(Ur,{size:16})})]})},uH=({editingText:e,onClear:t})=>(0,D.jsxs)(`div`,{className:K.replyBar,children:[(0,D.jsx)(kr,{size:15,style:{marginRight:6}}),(0,D.jsxs)(`span`,{className:K.replyBarText,children:[`Editing message: `,uV(e)]}),(0,D.jsx)(`button`,{type:`button`,className:K.replyBarClose,"aria-label":`Cancel edit`,onClick:t,children:(0,D.jsx)(ci,{size:16})})]}),dH=({value:e,isSending:t,title:r,replyTo:i,editingMessage:a=null,onChange:o,onSubmit:s,onClearReply:c,onClearEditing:l,onSendMedia:u,onTyping:d})=>{let f=(0,n.useRef)(null),p=tH(),m=p.items.length>0,h=m||e.trim().length>0,{openPicker:g,send:_,handleKeyDown:v,handlePaste:y,onFileChange:b}=nH(p,e,f,{onSubmit:s,onSendMedia:u});return(0,D.jsxs)(D.Fragment,{children:[a!==null&&l!==void 0&&(0,D.jsx)(uH,{editingText:a.text,onClear:l}),i!==null&&(0,D.jsx)(oH,{replyTo:i,onClear:c}),m&&(0,D.jsx)(sH,{attachments:p.items,onRemove:p.remove,onAddMore:g}),(0,D.jsx)(lH,{value:e,title:r,hasAttachments:m,isSending:t,canSend:h,fileRef:f,onChange:o,onTyping:d,onKeyDown:v,onPaste:y,onAttach:g,onFileChange:b,onSend:_})]})},fH=({conversation:e,conversationId:t,text:n,replyTo:r,editingMessage:i=null,isSending:a,onChange:o,onSubmit:s,onClearReply:c,onClearEditing:l,onSendMedia:u,onTyping:d})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(ZV,{conversationId:t}),(0,D.jsx)(dH,{value:n,isSending:a,title:e.title,replyTo:r,editingMessage:i,onChange:o,onSubmit:s,onClearReply:c,onClearEditing:l,onSendMedia:u,onTyping:d})]}),pH=(e,t,n,r)=>(e[t]?.[n]??0)>=r,mH=(e,t,n)=>pH(t,e,`read`,n)?`read`:pH(t,e,`delivered`,n)?`delivered`:`sent`,hH=(e,t,n)=>e.length===0?`sent`:e.every(e=>pH(t,e,`read`,n))?`read`:e.every(e=>pH(t,e,`delivered`,n))?`delivered`:`sent`,gH=(e,t)=>t.peerUserId===null?hH(t.otherMemberIds,t.receipts,e.sequence):mH(t.peerUserId,t.receipts,e.sequence),_H=(e,t)=>{if(t.length===0)return e;let n=new Map;for(let r of[...t,...e])n.set(r.id,r);return[...n.values()].sort((e,t)=>e.sequence-t.sequence)},vH=e=>{let t=e[0];return t===void 0?null:e.reduce((e,t)=>Math.min(e,t.sequence),t.sequence)},yH=e=>{let{getMessagesBefore:t}=LP(),r=sN(),[i,a]=(0,n.useState)(!0),[o,s]=(0,n.useState)(!1),c=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{a(!0),s(!1),c.current=!1},[e]),{loadOlder:(0,n.useCallback)(()=>{if(e===null||c.current||!i)return;let n=cF(e),o=vH(r.getQueryData(n)??[]);o!==null&&(c.current=!0,s(!0),P(t.execute(e,o,50)).then(e=>{r.setQueryData(n,t=>_H(t??[],e)),e.length<50&&a(!1)}).catch(()=>{}).finally(()=>{c.current=!1,s(!1)}))},[e,t,i,r]),hasMore:i,isLoadingOlder:o}},bH=80,xH=60,SH={tailKey:``,headKey:``,count:0,lastFromViewer:!1},CH=e=>{let t=e.at(-1);return{tailKey:t?.id??``,headKey:e[0]?.id??``,count:e.length,lastFromViewer:t?.fromViewer??!1}},wH=(e,t)=>{e!==null&&e.scrollTo({top:e.scrollHeight,behavior:t?`smooth`:`auto`})},TH=(e,t,r)=>{let i=(0,n.useRef)(null),[a,o]=(0,n.useState)(!0),[s,c]=(0,n.useState)(!1),l=(0,n.useRef)(SH),u=(0,n.useRef)(!0),d=(0,n.useRef)(null),f=(0,n.useRef)(r);f.current=r;let p=(0,n.useCallback)(e=>{wH(i.current,e),c(!1)},[]),m=(0,n.useCallback)(()=>{let e=i.current;if(e===null)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<bH;u.current=t,o(t),t&&c(!1),e.scrollTop<xH&&(d.current=e.scrollHeight,f.current())},[]);return(0,n.useLayoutEffect)(()=>{l.current=SH,u.current=!0,d.current=null,o(!0),c(!1)},[e]),(0,n.useLayoutEffect)(()=>{let e=CH(t),n=l.current;l.current=e;let r=i.current;if(e.tailKey===``||r===null)return;if(n.tailKey===``){wH(r,!1);return}let a=e.count>n.count,o=a&&e.tailKey!==n.tailKey;a&&e.headKey!==n.headKey&&d.current!==null&&(r.scrollTop+=r.scrollHeight-d.current,d.current=null),o&&(u.current||e.lastFromViewer)?(wH(r,!0),c(!1)):o&&c(!0)},[t]),(0,n.useEffect)(()=>{m()},[m]),{scrollRef:i,isAtBottom:a,hasNewBelow:s,scrollToBottom:p,onScroll:m}},EH={card:`_card_1bdwl_1`,header:`_header_1bdwl_29`,body:`_body_1bdwl_43`,authorRow:`_authorRow_1bdwl_47`,avatar:`_avatar_1bdwl_54`,authorInfo:`_authorInfo_1bdwl_68`,authorName:`_authorName_1bdwl_73`,category:`_category_1bdwl_80`,catDot:`_catDot_1bdwl_90`,title:`_title_1bdwl_97`,snippet:`_snippet_1bdwl_105`,footer:`_footer_1bdwl_116`},DH=/\/feed\/posts\/([a-zA-Z0-9-]+)$/,OH=({title:e,body:t,authorName:n,authorInitials:r,authorColor:i,categoryLabel:a,categoryColor:o,link:s})=>{let c=Be();return(0,D.jsxs)(`button`,{type:`button`,onClick:e=>{e.preventDefault();let t=DH.exec(s);if(t?.[1]!==void 0){let e=t[1];c(`/comms/feed?postId=${e}`)}else (s.startsWith(`/`)||s.toLowerCase().startsWith(`http://`)||s.toLowerCase().startsWith(`https://`))&&window.open(s,`_blank`,`noopener,noreferrer`)},className:EH.card,style:{textAlign:`left`},children:[(0,D.jsxs)(`div`,{className:EH.header,children:[(0,D.jsx)(Tr,{size:10}),`Shared from News Feed`]}),(0,D.jsxs)(`div`,{className:EH.body,children:[(0,D.jsxs)(`div`,{className:EH.authorRow,children:[(0,D.jsx)(`span`,{className:EH.avatar,style:E({"--avatar-color":i}),children:r}),(0,D.jsxs)(`div`,{className:EH.authorInfo,children:[(0,D.jsx)(`div`,{className:EH.authorName,children:n}),a!==null&&o!==null&&(0,D.jsxs)(`div`,{className:EH.category,style:E({"--cat-color":o}),children:[(0,D.jsx)(`span`,{className:EH.catDot}),a]})]})]}),(0,D.jsx)(`div`,{className:EH.title,children:e}),(0,D.jsx)(`div`,{className:EH.snippet,children:t}),(0,D.jsx)(`div`,{className:EH.footer,children:`Open in News Feed >`})]})]})},kH=e=>e.startsWith(`blob:`),AH=e=>e.type.length>0?URL.createObjectURL(e):URL.createObjectURL(new Blob([e],{type:`image/jpeg`})),jH=e=>{let{downloadChatMedia:t}=LP(),[r,i]=(0,n.useState)(!1),a=e!==null&&kH(e),o=e!==null&&!a?e:null,s=SN({queryKey:[`chat-media`,o],queryFn:()=>P(t.execute(o??``)),enabled:o!==null&&o.length>0,staleTime:1/0,gcTime:12e4,retry:1}),[c,l]=(0,n.useState)(null);(0,n.useEffect)(()=>{i(!1),l(null)},[e]),(0,n.useEffect)(()=>{let e=s.data;if(e===void 0)return;let t=AH(e);return l(t),()=>{URL.revokeObjectURL(t)}},[s.data]);let u=(0,n.useCallback)(()=>{i(!0)},[]);if(a)return{src:r?null:e,isLoading:!1,isError:r,onImageError:u};let d=s.isPending||s.isFetching;return{src:r?null:c,isLoading:d,isError:s.isError||r,onImageError:u}},MH=PE(e=>({open:!1,urls:[],index:0,openViewer:(t,n)=>{t.length!==0&&e({open:!0,urls:t,index:Math.max(0,Math.min(n,t.length-1))})},close:()=>{e({open:!1})},next:()=>{e(e=>({index:Math.min(e.index+1,e.urls.length-1)}))},prev:()=>{e(e=>({index:Math.max(e.index-1,0)}))}})),NH=({mediaUrl:e,album:t,index:n=0})=>{let{src:r,isLoading:i,isError:a,onImageError:o}=jH(e),s=MH(e=>e.openViewer);return a?(0,D.jsxs)(`div`,{className:K.msgMediaFallback,children:[(0,D.jsx)(fr,{size:18}),(0,D.jsx)(`span`,{children:`Image unavailable`})]}):r===null||i?(0,D.jsx)(`div`,{className:K.msgMediaLoading,children:(0,D.jsx)(gi,{size:`sm`})}):(0,D.jsx)(`button`,{type:`button`,className:T(K.mediaButton,t!==void 0&&K.mediaButtonFill),"aria-label":`Open image preview`,onClick:()=>{s(t??[e],n)},children:(0,D.jsx)(`img`,{className:K.msgMedia,src:r,alt:``,onError:o})})},PH=e=>(e??``).toLowerCase().split(`.`).pop()??``,FH=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`svg`,`avif`,`heic`],IH=(e,t)=>e!==null&&e.length>0?e.startsWith(`image/`):FH.includes(PH(t)),LH={pdf:`pdf`,zip:`archive`,rar:`archive`,"7z":`archive`,gz:`archive`,tar:`archive`,doc:`document`,docx:`document`,txt:`document`,rtf:`document`,odt:`document`,xls:`spreadsheet`,xlsx:`spreadsheet`,csv:`spreadsheet`,ods:`spreadsheet`,ppt:`presentation`,pptx:`presentation`,odp:`presentation`,mp3:`audio`,wav:`audio`,ogg:`audio`,m4a:`audio`,aac:`audio`,mp4:`video`,mov:`video`,webm:`video`,mkv:`video`,avi:`video`},RH=e=>{if(e===`application/pdf`)return`pdf`;if(e.startsWith(`audio/`))return`audio`;if(e.startsWith(`video/`))return`video`;if(e.startsWith(`text/`))return`document`;if(/zip|compressed|tar/.test(e))return`archive`;if(/spreadsheet|excel/.test(e))return`spreadsheet`;if(/presentation|powerpoint/.test(e))return`presentation`;if(e.includes(`word`))return`document`},zH=(e,t)=>IH(e,t)?`image`:RH(e??``)??LH[PH(t)]??`generic`,BH={image:`Image`,pdf:`PDF Document`,archive:`Archive`,document:`Document`,spreadsheet:`Spreadsheet`,presentation:`Presentation`,audio:`Audio`,video:`Video`,generic:`File`},VH=e=>BH[e],HH={image:ir,pdf:sr,archive:nr,document:sr,spreadsheet:or,presentation:Fr,audio:rr,video:ar,generic:cr},UH=(e,t)=>{let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t.length>0?t:`download`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)},WH=({mediaUrl:e,contentType:t,fileName:r,fromViewer:i})=>{let{downloadChatMedia:a}=LP(),[o,s]=(0,n.useState)(!1),c=zH(t,r),l=HH[c],u=r!==null&&r.length>0?r:`Attachment`,d=(0,n.useCallback)(()=>{s(!0),a.execute(e).then(e=>{s(!1),e.ok?UH(e.value,u):j.error(`Could not download the file.`)})},[a,e,u]);return(0,D.jsxs)(`button`,{type:`button`,className:T(K.fileCard,i?K.fileCardMe:K.fileCardThem),onClick:d,disabled:o,"aria-label":`Download ${u}`,children:[(0,D.jsx)(`span`,{className:K.fileCardIcon,children:(0,D.jsx)(l,{size:22})}),(0,D.jsxs)(`span`,{className:K.fileCardInfo,children:[(0,D.jsx)(`span`,{className:K.fileCardName,children:u}),(0,D.jsx)(`span`,{className:K.fileCardMetaLabel,children:VH(c)})]}),(0,D.jsx)(`span`,{className:K.fileCardDownload,children:o?(0,D.jsx)(gi,{size:`sm`}):(0,D.jsx)(er,{size:16})})]})},GH=({tick:e})=>e===`read`?(0,D.jsx)(`span`,{className:T(K.tick,K.tickRead),"aria-label":`Read`,children:(0,D.jsx)(Un,{size:13})}):e===`delivered`?(0,D.jsx)(`span`,{className:K.tick,"aria-label":`Delivered`,children:(0,D.jsx)(Un,{size:13})}):(0,D.jsx)(`span`,{className:K.tick,"aria-label":`Sent`,children:(0,D.jsx)(Wn,{size:13})}),KH=({message:e,pending:t,tick:n,onRetry:r})=>t===`sending`?(0,D.jsx)(`span`,{className:K.tick,"aria-label":`Sending`,children:(0,D.jsx)(Qn,{size:13})}):t===`failed`?(0,D.jsxs)(`span`,{className:K.sendFailed,children:[(0,D.jsx)(`span`,{className:K.sendFailedText,children:`Not delivered`}),(0,D.jsx)(`button`,{type:`button`,className:K.retryBtn,onClick:()=>{e.clientMessageId!==null&&r(e.clientMessageId,e.text)},children:`Retry`})]}):n===null?null:(0,D.jsx)(GH,{tick:n}),qH=({initial:e,onSave:t})=>{let[r,i]=(0,n.useState)(e);return(0,D.jsxs)(`span`,{className:K.msgActions,children:[(0,D.jsx)(`input`,{className:K.composerInput,value:r,onChange:e=>{i(e.target.value)}}),(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{r.trim().length>0&&t(r.trim())},children:`Save`})]})},JH=({message:e,fromViewer:t,onReply:r,onEdit:i,onDelete:a,resolvedReplyTo:o=null})=>{let[s,c]=(0,n.useState)(!1),l=dV(e,o);return _V(e)?(0,D.jsx)(`span`,{className:K.msgActions}):t?s?(0,D.jsx)(qH,{initial:e.text,onSave:t=>{i(e.id,t),c(!1)}}):(0,D.jsxs)(`span`,{className:K.msgActions,children:[(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{r(l)},children:`Reply`}),e.canEdit(Date.now())&&(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{c(!0)},children:`Edit`}),(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{a(e.id)},children:`Delete`})]}):(0,D.jsx)(`span`,{className:K.msgActions,children:(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{r(l)},children:`Reply`})})},YH=`This message was deleted`,XH=({message:e})=>{let t=e.mediaUrl;return t===null||t.length===0?null:IH(e.mediaContentType,e.mediaFileName)?(0,D.jsx)(NH,{mediaUrl:t}):(0,D.jsx)(WH,{mediaUrl:t,contentType:e.mediaContentType,fileName:e.mediaFileName,fromViewer:e.fromViewer})},ZH=({replyTo:e})=>{let t=lV(e.text);if(t!==null)return(0,D.jsx)(`div`,{style:{marginBottom:6,display:`block`,width:`100%`},children:(0,D.jsx)(OH,{...t.card})});let n=e.text.trim().length>0;return(0,D.jsxs)(`span`,{className:K.replyPreview,children:[e.authorName.length>0&&(0,D.jsx)(`span`,{className:K.replyPreviewAuthor,children:e.authorName}),(0,D.jsx)(`span`,{className:K.replyPreviewText,children:n?uV(e.text):`Message`})]})},QH=({message:e,fromViewer:t,deletedForEveryone:n,pending:r,tick:i,onRetry:a})=>{let o=JN();return(0,D.jsxs)(`span`,{className:K.msgMeta,children:[(0,D.jsx)(`span`,{className:K.msgTime,children:MP(e.sentAt,o.display)||e.time}),!n&&e.isEdited&&(0,D.jsx)(`span`,{className:K.editedLabel,children:`edited`}),t&&(e.kind===`text`||e.kind===`media`)&&(0,D.jsx)(KH,{message:e,pending:r,tick:i,onRetry:a})]})},$H=/(https?:\/\/[^\s]+)/g,eU=({text:e})=>e?(0,D.jsx)(D.Fragment,{children:e.split($H).map((e,t)=>e.match($H)?(0,D.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:K.msgLink,children:e},t):(0,D.jsx)(n.Fragment,{children:e},t))}):(0,D.jsx)(D.Fragment,{children:e}),tU=({sharedComment:e,sharedCardProps:t})=>(0,D.jsxs)(D.Fragment,{children:[e.length>0&&(0,D.jsx)(`span`,{className:T(K.msgText,K.msgTextWithCard),children:(0,D.jsx)(eU,{text:e})}),(0,D.jsx)(OH,{...t})]}),nU=({messageText:e,deletedForEveryone:t})=>(0,D.jsx)(`span`,{className:T(K.msgText,t&&K.msgTextDeleted),children:t?YH:(0,D.jsx)(eU,{text:e})}),rU=({message:e,authorName:t,showAuthor:n,replyTo:r,fromViewer:i,deletedForEveryone:a,pending:o,tick:s,onRetry:c,isSelected:l,onSelect:u})=>{let d=a?null:lV(e.text);return(0,D.jsxs)(`div`,{className:T(K.bubble,i?K.bubbleMe:K.bubbleThem,l&&K.bubbleSelected),onClick:()=>{u!==void 0&&u(e)},children:[n&&(0,D.jsx)(`span`,{className:K.msgAuthor,children:t}),!a&&r!==null&&(0,D.jsx)(ZH,{replyTo:r}),!a&&(0,D.jsx)(XH,{message:e}),d===null?(0,D.jsx)(nU,{messageText:e.text,deletedForEveryone:a}):(0,D.jsx)(tU,{sharedComment:d.comment,sharedCardProps:d.card}),(0,D.jsx)(QH,{message:e,fromViewer:i,deletedForEveryone:a,pending:o,tick:s,onRetry:c})]})},iU=({message:e,identity:t,replyTo:n,isSelected:r,onSelect:i,showAvatar:a,showAuthor:o,tick:s,pending:c,onRetry:l,onReply:u,onEdit:d,onDelete:f,quickReact:p,reactions:m})=>{let{fromViewer:h,deletedForEveryone:g}=e,_=!_V(e)&&!g,v=m!==null;return(0,D.jsxs)(D.Fragment,{children:[!h&&(a?(0,D.jsx)(`span`,{className:K.msgAvatar,style:E({"--avatar-color":t.color}),children:t.initials}):(0,D.jsx)(`span`,{className:K.msgAvatarSpacer,"aria-hidden":`true`})),(0,D.jsx)(`div`,{className:T(K.msgCol,v&&K.msgColWithReactions),children:(0,D.jsxs)(`div`,{className:K.msgBubbleWrap,children:[(0,D.jsx)(rU,{message:e,authorName:t.name,showAuthor:o,replyTo:n,fromViewer:h,deletedForEveryone:g,pending:c,tick:s,onRetry:l,isSelected:r,onSelect:i}),v&&m,_&&p,_&&(0,D.jsx)(JH,{message:e,fromViewer:h,onReply:u,onEdit:d,onDelete:f,resolvedReplyTo:n})]})})]})},aU=e=>e.trim().toLowerCase(),oU=(e,t)=>aU(e)===aU(t),sU=(e,t)=>{if(e.fromViewer)return{name:e.authorName,initials:e.authorInitials,color:e.authorColor};let n=t.members.find(t=>oU(t.id,e.senderId));return n===void 0?t.kind===`dm`&&t.peerUserId!==null&&oU(t.peerUserId,e.senderId)?{name:t.title,initials:t.initials,color:t.color}:{name:e.authorName,initials:e.authorInitials,color:e.authorColor}:{name:n.name,initials:n.initials,color:n.color}},cU=({align:e,onPick:t})=>{let[r,i]=(0,n.useState)(!1);return(0,D.jsxs)(`div`,{className:K.reactWrap,children:[(0,D.jsx)(`button`,{type:`button`,className:K.reactBtn,"aria-label":`Add reaction`,onClick:()=>{i(e=>!e)},children:(0,D.jsx)(Jr,{size:14})}),(0,D.jsx)(Kg,{children:r&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:K.emojiBackdrop,"aria-label":`Close reaction picker`,onClick:()=>{i(!1)}}),(0,D.jsx)(A.div,{className:T(K.reactPop,e===`right`?K.reactPopRight:K.reactPopLeft),variants:Hy,initial:`hidden`,animate:`visible`,exit:`exit`,children:rH.map(e=>(0,D.jsx)(`button`,{type:`button`,className:K.reactPopBtn,onClick:()=>{t(e),i(!1)},children:e},e))})]})})]})},lU=({message:e,onReact:t,fromViewer:n})=>{let r=e.reactions.reduce((e,t)=>e+t.count,0);if(r===0)return null;let i=e.reactions.find(e=>e.reacted);return(0,D.jsxs)(`button`,{type:`button`,className:T(K.reactionPill,n?K.reactionsMe:K.reactionsThem,i!==void 0&&K.reactionPillActive),onClick:()=>{if(i!==void 0)t(e.id,i.emoji);else if(e.reactions.length>0){let n=e.reactions[0]?.emoji;n!==void 0&&t(e.id,n)}},"aria-label":`Reactions`,children:[(0,D.jsx)(`span`,{className:K.reactionEmojis,children:e.reactions.map(e=>e.emoji).join(``)}),r>1&&(0,D.jsx)(`span`,{className:K.reactionCount,children:r})]})},uU=({text:e})=>(0,D.jsx)(A.div,{className:K.systemRow,variants:Vy,initial:`hidden`,animate:`visible`,children:(0,D.jsx)(`span`,{className:K.systemPill,children:e})}),dU=(e,t,n)=>!e.deletedForEveryone&&e.reactions.length>0?(0,D.jsx)(lU,{message:e,onReact:n,fromViewer:t}):null,fU=({conversation:e,message:t,layoutStatic:n=!1,firstOfGroup:r=!0,lastOfGroup:i=!0,replyTo:a,isSelected:o,onSelect:s,onReact:c,tick:l,pending:u,onRetry:d,onReply:f,onEdit:p,onDelete:m})=>{if(t.isSystem)return(0,D.jsx)(uU,{text:t.text});let{fromViewer:h}=t,g=sU(t,e),_=T(K.msgRow,h&&K.msgRowMe,r&&K.msgRowGroupStart),v=(0,D.jsx)(iU,{message:t,identity:g,replyTo:a??t.replyTo,isSelected:o,onSelect:s,showAvatar:i,showAuthor:r&&e.isGroup,tick:l,pending:u,onRetry:d,onReply:f,onEdit:p,onDelete:m,quickReact:(0,D.jsx)(cU,{align:h?`right`:`left`,onPick:e=>{c(t.id,e)}}),reactions:dU(t,h,c)});return n?(0,D.jsx)(`div`,{id:`msg-${t.id}`,className:_,children:v}):(0,D.jsx)(A.div,{id:`msg-${t.id}`,className:_,variants:Vy,initial:`hidden`,animate:`visible`,whileHover:{y:-1,scale:1.005},transition:{type:`spring`,stiffness:500,damping:30},children:v})},pU=()=>void 0,mU=e=>e.find(e=>e.text.trim().length>0)?.text??``,hU=({fromViewer:e,lastOfGroup:t,identity:n})=>e?null:t?(0,D.jsx)(`span`,{className:K.msgAvatar,style:E({"--avatar-color":n.color}),children:n.initials}):(0,D.jsx)(`span`,{className:K.msgAvatarSpacer,"aria-hidden":`true`}),gU=({message:e,onReact:t,onReply:n,onDelete:r})=>(0,D.jsxs)(`div`,{className:K.albumCellActions,children:[(0,D.jsx)(cU,{align:e.fromViewer?`right`:`left`,onPick:n=>{t(e.id,n)}}),(0,D.jsx)(`button`,{type:`button`,className:K.albumActionBtn,"aria-label":`Reply`,onClick:()=>{n(dV(e))},children:(0,D.jsx)(Br,{size:13})}),e.fromViewer&&(0,D.jsx)(`button`,{type:`button`,className:K.albumActionBtn,"aria-label":`Delete`,onClick:()=>{r(e.id)},children:(0,D.jsx)(ni,{size:13})})]}),_U=e=>{let{message:t,album:n,index:r}=e,i=!_V(t)&&!t.deletedForEveryone,a=!t.deletedForEveryone&&t.reactions.length>0;return(0,D.jsxs)(`div`,{id:`msg-${t.id}`,className:K.albumCell,children:[(0,D.jsx)(`div`,{className:K.albumCellMedia,children:t.mediaUrl!==null&&t.mediaUrl.length>0&&(0,D.jsx)(NH,{mediaUrl:t.mediaUrl,album:n,index:r})}),i&&(0,D.jsx)(gU,{...e}),a&&(0,D.jsx)(`div`,{className:K.albumCellReactions,children:(0,D.jsx)(lU,{message:t,onReact:e.onReact,fromViewer:t.fromViewer})})]})},vU=({last:e,fromViewer:t,tick:n,pending:r})=>{let i=JN();return(0,D.jsxs)(`span`,{className:K.msgMeta,children:[(0,D.jsx)(`span`,{className:K.msgTime,children:MP(e.sentAt,i.display)||e.time}),t&&(0,D.jsx)(KH,{message:e,pending:r,tick:n,onRetry:pU})]})},yU=({conversation:e,messages:t,firstOfGroup:n,lastOfGroup:r,tick:i,pending:a,onReact:o,onReply:s,onDelete:c})=>{let l=t.at(0),u=t.at(-1);if(l===void 0||u===void 0)return(0,D.jsx)(D.Fragment,{});let{fromViewer:d}=l,f=sU(l,e),p=mU(t),m=n&&e.isGroup,h=t.map(e=>e.mediaUrl??``);return(0,D.jsxs)(`div`,{id:`msg-${u.id}`,className:T(K.msgRow,d&&K.msgRowMe,n&&K.msgRowGroupStart),children:[(0,D.jsx)(hU,{fromViewer:d,lastOfGroup:r,identity:f}),(0,D.jsx)(`div`,{className:K.msgCol,children:(0,D.jsx)(`div`,{className:K.msgBubbleWrap,children:(0,D.jsxs)(`div`,{className:T(K.bubble,d?K.bubbleMe:K.bubbleThem),children:[m&&(0,D.jsx)(`span`,{className:K.msgAuthor,children:f.name}),(0,D.jsx)(`div`,{className:K.albumGrid,children:t.map((e,t)=>(0,D.jsx)(_U,{message:e,album:h,index:t,onReact:o,onReply:s,onDelete:c},e.id))}),p.length>0&&(0,D.jsx)(`span`,{className:K.msgText,children:p}),(0,D.jsx)(vU,{last:u,fromViewer:d,tick:i,pending:a})]})})})]})},bU=(e,t)=>{if(e.length===0)return null;let n=kP(e);if(Number.isNaN(n.getTime()))return null;if(t&&t.length>0){let e=VN(n,t),r=String(e.month).padStart(2,`0`),i=String(e.day).padStart(2,`0`);return`${String(e.year)}-${r}-${i}`}let r=String(n.getMonth()+1).padStart(2,`0`),i=String(n.getDate()).padStart(2,`0`);return`${String(n.getFullYear())}-${r}-${i}`},xU=(e,t)=>{let[n,r,i]=e.split(`-`);return new Date(Date.UTC(Number(n),Number(r)-1,Number(i))).toLocaleDateString(`en-US`,{weekday:`short`,day:`numeric`,month:`short`,year:`numeric`,timeZone:`UTC`})},SU=(e,t)=>!e.isSystem&&!t.isSystem&&e.senderId===t.senderId,CU=(e,t)=>{let n=[],r=null;return e.forEach((i,a)=>{let o=bU(i.sentAt,t),s=o!==null&&o!==r;s&&n.push({kind:`date`,key:`date:${o}`,label:xU(o,t)}),r=o??r;let c=e[a-1],l=e[a+1],u=s||c===void 0||!SU(c,i),d=l===void 0||!SU(i,l)||bU(l.sentAt,t)!==o;n.push({kind:`message`,key:i.id,row:{message:i,firstOfGroup:u,lastOfGroup:d}})}),n},wU=2,TU=e=>e.kind===`message`&&e.row.message.kind===`media`&&!e.row.message.isSystem&&!e.row.message.deletedForEveryone&&(e.row.message.mediaUrl??``).length>0&&IH(e.row.message.mediaContentType,e.row.message.mediaFileName),EU=e=>e.kind===`message`&&e.row.message.kind===`media`&&!e.row.message.isSystem&&e.row.message.deletedForEveryone,DU=e=>TU(e)||EU(e),OU=(e,t,n)=>({kind:`album`,key:`album:${(e[0]??t).row.message.id}`,messages:e.map(e=>e.row.message),firstOfGroup:t.row.firstOfGroup,lastOfGroup:n.row.lastOfGroup}),kU=(e,t,n)=>({kind:`message`,key:e.key,row:{message:e.row.message,firstOfGroup:t.row.firstOfGroup,lastOfGroup:n.row.lastOfGroup}}),AU=(e,t)=>{let n=e[0],r=e[e.length-1];if(n===void 0||r===void 0)return;let i=e.filter(TU);if(i.length>=wU){t.push(OU(i,n,r));return}if(i.length===1&&i[0]!==void 0){t.push(kU(i[0],n,r));return}t.push(kU(n,n,r))},jU=e=>{let t=[],n=[];for(let r of e){if(DU(r)){let e=n.at(-1);e!==void 0&&e.row.message.senderId!==r.row.message.senderId&&(AU(n,t),n=[]),n.push(r);continue}AU(n,t),n=[],t.push(r)}return AU(n,t),t},MU=(e,t)=>!(e.fromViewer&&(e.kind===`text`||e.kind===`media`))||e.clientMessageId===null?null:t[e.clientMessageId]??null,NU=({label:e})=>(0,D.jsx)(`div`,{className:K.dateSep,children:(0,D.jsx)(`span`,{className:K.dateSepPill,children:e})}),PU=({conversation:e,messages:t,pending:r,selectedMessageId:i,onSelectMessage:a,onReact:o,onRetry:s,onReply:c,onEdit:l,onDelete:u,tickFor:d})=>{let f=JN(),p=(0,n.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]);return(0,D.jsx)(D.Fragment,{children:jU(CU(t,f.display)).map(t=>{if(t.kind===`date`)return(0,D.jsx)(NU,{label:t.label},t.key);if(t.kind===`album`){let n=t.messages.at(-1);return(0,D.jsx)(yU,{conversation:e,messages:t.messages,firstOfGroup:t.firstOfGroup,lastOfGroup:t.lastOfGroup,tick:n===void 0?null:d(n),pending:n===void 0?null:MU(n,r),onReact:o,onReply:c,onDelete:u},t.key)}return(0,D.jsx)(fU,{layoutStatic:!0,firstOfGroup:t.row.firstOfGroup,lastOfGroup:t.row.lastOfGroup,conversation:e,message:t.row.message,isSelected:i===t.row.message.id,onSelect:a,replyTo:pV(t.row.message.replyTo,p),onReact:o,pending:MU(t.row.message,r),tick:d(t.row.message),onRetry:s,onReply:c,onEdit:l,onDelete:u},t.key)})})},FU={id:`u-shamim`,name:`Shamim Rahman`,initials:`SR`,color:`#e9445a`},IU=`t-uapp`,LU={id:`u-andreea`,name:`Andreea Cinpoi`,initials:`AN`,color:`#7c3aed`,role:`Sales Manager`},RU={id:`u-laura`,name:`Laura Tomova`,initials:`LA`,color:`#3a7bd5`,role:`Compliance Officer`},zU={id:`s-mahmud`,name:`Mahmud Hasan`,initials:`MH`,color:`#16a34a`,role:`Student`},BU={id:`u-mihadul`,name:`Mihadul Islam`,initials:`MI`,color:`#65a30d`,role:`Admission Officer`},VU={id:`u-nur`,name:`Nur Mohammad`,initials:`NM`,color:`#8b5cf6`,role:`Team Leader`},HU={id:`u-md-shamim`,name:`Md Shamim`,initials:`MS`,color:`#0a6e6f`,role:`Sales Lead`};FU.id,FU.name,FU.initials,FU.color;var UU=(e,t)=>({...t,admin:!1,lastSynced:null,tenantId:IU,categoryId:null,members:[],adminIds:[],data:{},peerUserId:e,memberReceipts:[]});FU.id,zU.id,FU.id,BU.id,VU.id,zU.id,FU.id,HU.id,LU.id,FU.id,LU.id,RU.id,{...UU(`u-tousif`,{id:`c-tousif`,kind:`dm`,title:`Tousif Sadman`,subtitle:`Consultant`,initials:`TS`,color:`#0e7c66`,online:!0,unread:2,pinned:!1,favourite:!0,archived:!1,lastMessage:`Sure, I'll send the documents`,lastTime:`5m`})},FU.id,UU(`u-raj`,{id:`c-raj`,kind:`dm`,title:`Raj Ahmed`,subtitle:`Global Admission Manager`,initials:`RA`,color:`#0ea5e9`,online:!0,unread:1,pinned:!1,favourite:!1,archived:!1,lastMessage:`The offer letter is ready`,lastTime:`1h`}),UU(`u-andreea`,{id:`c-andreea`,kind:`dm`,title:`Andreea Cinpoi`,subtitle:`Sales Manager`,initials:`AN`,color:`#7c3aed`,online:!1,unread:0,pinned:!1,favourite:!1,archived:!1,lastMessage:`Thanks for the update`,lastTime:`2h`}),UU(`u-jennifer`,{id:`c-jennifer`,kind:`dm`,title:`Jennifer Aboje`,subtitle:`Branch Manager`,initials:`JA`,color:`#fc7300`,online:!1,unread:0,pinned:!1,favourite:!1,archived:!1,lastMessage:`Let me check with the team`,lastTime:`Yesterday`}),UU(`u-laura`,{id:`c-laura`,kind:`dm`,title:`Laura Tomova`,subtitle:`Compliance Officer`,initials:`LA`,color:`#3a7bd5`,online:!1,unread:0,pinned:!1,favourite:!1,archived:!0,lastMessage:`Archived — visa file closed`,lastTime:`3d`});var WU=G({id:V(),name:V(),initials:V(),color:V(),role:V(),status:H().optional(),statusUntilUtc:V().nullish()}),GU=G({userId:V(),deliveredUpto:H(),readUpto:H()}),KU=G({id:V(),type:H(),title:V(),subtitle:V(),initials:V(),color:V(),online:U(),status:H().optional(),statusUntilUtc:V().nullish(),unread:H(),pinned:U(),favourite:U(),archived:U(),unreadCount:H(),admin:U(),lastMessage:V(),lastTime:V(),lastMessageAt:V().nullable().optional(),lastSyncedAt:V().nullable(),categoryId:V().nullable(),headerFields:rj(V(),V()).optional(),members:W(WU),adminIds:W(V()),peerUserId:V().nullable().optional().default(null),memberReceipts:W(GU).optional().default([])}).passthrough(),qU=G({emoji:V(),count:H(),reacted:U()}),JU=G({id:V(),conversationId:V(),kind:H(),senderId:V(),authorName:V(),authorInitials:V(),authorColor:V(),text:V(),sentAt:V(),time:V(),sequence:H(),clientMessageId:V().nullable(),fromViewer:U(),reactions:W(qU),replyToMessageId:V().nullable().optional().default(null),replyToAuthorName:V().optional().default(``),replyToText:V().optional().default(``),mediaUrl:V().nullable().optional().default(null),mediaContentType:V().nullable().optional().default(null),mediaFileName:V().nullable().optional().default(null),editedAt:V().nullable().optional().default(null),isEdited:U().optional().default(!1),deletedForEveryone:U().optional().default(!1)}),YU=G({id:V(),name:V(),initials:V(),color:V()}),XU=W(KU),ZU=W(WU),QU=G({totalCount:H(),items:XU}),$U=G({unread:H(),favourites:H(),groups:H(),archived:H()}),eW=G({blobName:V(),url:V(),contentType:V().optional().default(`application/octet-stream`),fileName:V().nullable().optional().default(null)}),tW=W(JU),nW=6e4,rW=60*nW,iW=24*rW,aW=(e,t)=>{let n=t.getTime()-e.getTime();return n<nW?`just now`:n<rW?`${String(Math.floor(n/nW))}m`:n<iW?`${String(Math.floor(n/rW))}h`:`${String(Math.floor(n/iW))}d`},oW=e=>e===0?`dm`:`group`,sW=e=>e===1?`system`:e===2?`media`:`text`,cW=e=>({id:e.id,name:e.name,initials:e.initials,color:e.color,role:e.role,status:SR(e.status),statusUntilUtc:e.statusUntilUtc??null}),lW=e=>({id:e.id,name:e.name,initials:e.initials,color:e.color}),uW=e=>{if(e.startsWith(`__UAPP_SHARED_CARD__::`))try{let t=e.substring(22),n=JSON.parse(t).card?.title??``;return n.length>0?`Shared Post: ${n}`:`Shared Post`}catch{return`Shared Post`}return e},dW=(e,t)=>new jP({id:e.id,kind:oW(e.type),title:e.title,subtitle:e.subtitle,initials:e.initials,color:e.color,online:e.online,status:SR(e.status),statusUntilUtc:e.statusUntilUtc??null,unread:e.unreadCount,pinned:e.pinned,favourite:e.favourite,archived:e.archived,admin:e.admin,lastMessage:uW(e.lastMessage),lastTime:e.lastTime,lastMessageAt:e.lastMessageAt??null,lastSynced:e.lastSyncedAt===null?null:aW(new Date(e.lastSyncedAt),t),tenantId:``,categoryId:e.categoryId,members:e.members.map(cW),adminIds:e.adminIds,data:e.headerFields??{},peerUserId:e.peerUserId,memberReceipts:e.memberReceipts.map(e=>({userId:e.userId,deliveredUpto:e.deliveredUpto,readUpto:e.readUpto}))}),fW=e=>{let t=e.replyToMessageId!==null&&e.replyToMessageId.length>0?{messageId:e.replyToMessageId,authorName:e.replyToAuthorName,text:e.replyToText}:null;return new AP({id:e.id,kind:sW(e.kind),authorName:e.authorName,authorInitials:e.authorInitials,authorColor:e.authorColor,text:e.text,time:e.time,sentAt:e.sentAt,fromViewer:e.fromViewer,reactions:e.reactions.map(e=>({emoji:e.emoji,count:e.count,reacted:e.reacted})),sequence:e.sequence,senderId:e.senderId,clientMessageId:e.clientMessageId,replyTo:t,mediaUrl:e.mediaUrl,mediaContentType:e.mediaContentType,mediaFileName:e.mediaFileName,isEdited:e.deletedForEveryone?!1:(e.editedAt??``).length>0||e.isEdited,deletedForEveryone:e.deletedForEveryone})},pW=(e,t,n)=>(e.error(`Chat ${t} returned an unexpected shape`,n),N(new bP(n))),mW=e=>{if(e.length===0)return;let t=e[0];if(t&&typeof t==`object`&&`message`in t){let e=t.message;if(typeof e==`string`&&e.trim().length>0)return e}},hW=e=>{if(Array.isArray(e.validationErrors)){let t=mW(e.validationErrors);if(t!==void 0)return t}if(typeof e.details==`string`&&e.details.trim().length>0&&!e.details.includes(`The following errors were detected`))return e.details;if(typeof e.message==`string`&&e.message.trim().length>0)return e.message},gW=e=>{if(!e||typeof e!=`object`||!(`body`in e))return;let t=e.body;if(!t||typeof t!=`object`)return;let n=t;return hW(`error`in n&&n.error&&typeof n.error==`object`?n.error:n)},_W=(e,t)=>(e.error(`Chat request failed`,t),new bP(t,gW(t))),vW=(e,t,n)=>{let r=tW.safeParse(n);return r.success?M(r.data.map(fW)):pW(e,t,r.error)},yW=(e,t,n,r)=>{let i=KU.safeParse(r);return i.success?M(dW(i.data,t.now())):pW(e,n,i.error)},bW=`/api/app/chat-media/download?blobName=`,xW=e=>`${bW}${encodeURIComponent(decodeURIComponent(e))}`,SW=e=>{if(!e.startsWith(`http://`)&&!e.startsWith(`https://`))return e;try{let t=new URL(e);return`${t.pathname}${t.search}`}catch{return e}},CW=e=>{let t=/^\/api\/app\/chat-media\/download\?blobName=([^&]+)/.exec(e);if(t?.[1]!==void 0)return t[1];let n=/^\/api\/app\/chat-media\?blobName=([^&]+)/.exec(e);if(n?.[1]!==void 0)return n[1];let r=/^\/api\/app\/chat-media\/([^/?]+)/.exec(e)?.[1];if(r!==void 0&&r!==`upload`&&r!==`download`)return r},wW=e=>{let t=e.trim();if(t.length===0)return t;let n=SW(t),r=CW(n);return r===void 0?n.startsWith(`/`)?n:`/${n}`:xW(r)},TW={conversations:`/api/app/chat/conversations`,conversationCounts:`/api/app/chat/conversation-scope-counts`,listStaff:`/api/app/chat/list-staff`,groupMemberPool:`/api/app/chat/group-member-pool`,viewer:`/api/app/chat/viewer`,createGroup:`/api/app/chat/group`,uploadChatMedia:`/api/app/chat-media/upload`,subscribePush:`/api/app/web-push/subscribe`},EW={afterSequence:`afterSequence`,beforeSequence:`beforeSequence`,skipCount:`skipCount`,maxResultCount:`maxResultCount`,filter:`filter`,scope:`scope`,uptoSequence:`uptoSequence`,favourite:`favourite`,archived:`archived`,pinned:`pinned`},DW=e=>encodeURIComponent(e),OW={conversation:e=>`/api/app/chat/conversation/${DW(e)}`,messages:e=>`/api/app/chat/messages/${DW(e)}`,messagesBefore:e=>`/api/app/chat/messages-before/${DW(e)}`,messagesSince:e=>`/api/app/chat/messages-since/${DW(e)}`,sendMessage:e=>`/api/app/chat/send-message/${DW(e)}`,sendMediaMessage:e=>`/api/app/chat/send-media-message/${DW(e)}`,markDelivered:e=>`/api/app/chat/mark-delivered/${DW(e)}`,markRead:e=>`/api/app/chat/mark-read/${DW(e)}`,reactToMessage:e=>`/api/app/chat/react-to-message/${DW(e)}`,saveMembers:e=>`/api/app/chat/save-members/${DW(e)}`,leaveConversation:e=>`/api/app/chat/leave-conversation/${DW(e)}`,setFavourite:e=>`/api/app/chat/set-favourite/${DW(e)}`,setArchived:e=>`/api/app/chat/set-archived/${DW(e)}`,setPinned:e=>`/api/app/chat/set-pinned/${DW(e)}`,deleteConversation:e=>`/api/app/chat/conversation/${DW(e)}`,refreshPortal:e=>`/api/app/chat/refresh-portal/${DW(e)}`,startDirect:e=>`/api/app/chat/start-direct/${DW(e)}`,editMessage:e=>`/api/app/chat/edit-message/${DW(e)}`,deleteMessage:e=>`/api/app/chat/message/${DW(e)}`,deleteMessageForMe:e=>`/api/app/chat/message-for-me/${DW(e)}`},kW=async(e,t,n,r)=>{try{let i=new FormData;i.append(`file`,n,r);let a=await e.httpClient.post(TW.uploadChatMedia,i,{query:{conversationId:t}}),o=eW.safeParse(a);return o.success?M({mediaId:o.data.blobName,url:o.data.url}):pW(e.logger,`upload-media`,o.error)}catch(t){return N(_W(e.logger,t))}},AW=async(e,t)=>{try{let n=await kW(e,t.conversationId,t.file,t.fileName);if(!n.ok)return n;let r={blobName:n.value.mediaId,clientMessageId:t.clientMessageId};t.file.type.length>0&&(r.contentType=t.file.type),t.fileName.length>0&&(r.fileName=t.fileName),t.caption!==void 0&&t.caption.trim().length>0&&(r.caption=t.caption.trim()),t.replyToMessageId!==void 0&&t.replyToMessageId!==null&&(r.replyToMessageId=t.replyToMessageId);let i=await e.httpClient.post(OW.sendMediaMessage(t.conversationId),r),a=JU.safeParse(i);return a.success?M(fW(a.data)):pW(e.logger,`send-media-message`,a.error)}catch(t){return N(_W(e.logger,t))}},jW=async(e,t)=>{try{let n=wW(t),r=await e.httpClient.getBlob(n,{headers:{Accept:`image/*,*/*`}});return r.size===0?N(new bP(`Chat media response was empty`)):M(r)}catch(t){return N(_W(e.logger,t))}},MW=async(e,t,n,r)=>{try{let t=await e.httpClient.post(OW.editMessage(n),{text:r}),i=JU.safeParse(t);return i.success?M(fW(i.data)):pW(e.logger,`edit-message`,i.error)}catch(t){return N(_W(e.logger,t))}},NW=async(e,t,n)=>{try{return await e.httpClient.delete(OW.deleteMessage(n)),M(void 0)}catch(t){return N(_W(e.logger,t))}},PW=async(e,t,n)=>{try{return await e.httpClient.delete(OW.deleteMessageForMe(n)),M(void 0)}catch(t){return N(_W(e.logger,t))}},FW=async(e,t)=>{try{return await e.httpClient.post(TW.subscribePush,{endpoint:t.endpoint,p256dh:t.p256dh,auth:t.auth}),M(void 0)}catch(t){return N(_W(e.logger,t))}},IW=async(e,t,n,r)=>{try{return await e.post(n,void 0,{query:r}),M(void 0)}catch(e){return N(_W(t,e))}},LW=async e=>{try{return await e.httpClient.post(e.path,e.body,{query:e.query}),M(void 0)}catch(t){return N(_W(e.logger,t))}},RW=async(e,t,n)=>{try{return await e.delete(n),M(void 0)}catch(e){return N(_W(t,e))}},zW=(e,t,n)=>IW(e.httpClient,e.logger,OW.markDelivered(t),{[EW.uptoSequence]:n}),BW=(e,t,n)=>IW(e.httpClient,e.logger,OW.markRead(t),{[EW.uptoSequence]:n}),VW=(e,t,n)=>IW(e.httpClient,e.logger,OW.setFavourite(t),{[EW.favourite]:n}),HW=(e,t,n)=>IW(e.httpClient,e.logger,OW.setArchived(t),{[EW.archived]:n}),UW=(e,t,n)=>IW(e.httpClient,e.logger,OW.setPinned(t),{[EW.pinned]:n}),WW=(e,t)=>IW(e.httpClient,e.logger,OW.leaveConversation(t),{}),GW=(e,t)=>IW(e.httpClient,e.logger,OW.refreshPortal(t),{}),KW=(e,t,n)=>LW({httpClient:e.httpClient,logger:e.logger,path:OW.reactToMessage(t),query:{},body:{emoji:n}}),qW=(e,t,n,r)=>LW({httpClient:e.httpClient,logger:e.logger,path:OW.saveMembers(t),query:{},body:{members:n.map(e=>({id:e.id,name:e.name,initials:e.initials,color:e.color,role:e.role})),adminIds:[...r]}}),JW=(e,t)=>RW(e.httpClient,e.logger,OW.deleteConversation(t)),YW={all:`All`,unread:`Unread`,favourites:`Favourites`,groups:`Groups`,archive:`Archive`},XW=async(e,t)=>{let n=t.filter?.trim();try{let r=await e.httpClient.get(TW.conversations,{query:{[EW.scope]:YW[t.scope],[EW.filter]:n===void 0||n===``?void 0:n,[EW.skipCount]:t.skipCount,[EW.maxResultCount]:t.maxResultCount}}),i=QU.safeParse(r);if(!i.success)return pW(e.logger,`conversations`,i.error);let a=e.clock.now();return M({items:i.data.items.map(e=>dW(e,a)),totalCount:i.data.totalCount})}catch(t){return N(_W(e.logger,t))}},ZW=async e=>{try{let t=await e.httpClient.get(TW.conversationCounts),n=$U.safeParse(t);return n.success?M(n.data):pW(e.logger,`conversation-counts`,n.error)}catch(t){return N(_W(e.logger,t))}},QW=async(e,t)=>{try{let n=await e.httpClient.get(OW.conversation(t));return yW(e.logger,e.clock,`conversation`,n)}catch(t){return N(_W(e.logger,t))}},$W=async(e,t)=>{let n=t?.trim();try{let t=await e.httpClient.post(TW.listStaff,void 0,{query:{[EW.filter]:n===void 0||n===``?void 0:n}}),r=ZU.safeParse(t);return r.success?M(r.data.map(cW)):pW(e.logger,`list-staff`,r.error)}catch(t){return N(_W(e.logger,t))}},eG=async(e,t)=>{let n=t?.trim();try{let t=await e.httpClient.get(TW.groupMemberPool,{query:{[EW.filter]:n===void 0||n===``?void 0:n}}),r=ZU.safeParse(t);return r.success?M(r.data.map(cW)):pW(e.logger,`group-member-pool`,r.error)}catch(t){return N(_W(e.logger,t))}},tG=async e=>{try{let t=await e.httpClient.get(TW.viewer),n=YU.safeParse(t);return n.success?M(lW(n.data)):pW(e.logger,`viewer`,n.error)}catch(t){return N(_W(e.logger,t))}},nG=async(e,t,n)=>{try{let r=n===void 0?void 0:{query:{[EW.maxResultCount]:n}},i=await e.httpClient.get(OW.messages(t),r);return vW(e.logger,`messages`,i)}catch(t){return N(_W(e.logger,t))}},rG=async(e,t,n,r)=>{try{let i=await e.httpClient.get(OW.messagesSince(t),{query:{[EW.afterSequence]:n,[EW.maxResultCount]:r}});return vW(e.logger,`messages-since`,i)}catch(t){return N(_W(e.logger,t))}},iG=async(e,t,n,r)=>{try{let i=await e.httpClient.get(OW.messagesBefore(t),{query:{[EW.beforeSequence]:n,[EW.maxResultCount]:r}});return vW(e.logger,`messages-before`,i)}catch(t){return N(_W(e.logger,t))}},aG=async(e,t)=>{try{let n=await e.httpClient.post(OW.startDirect(t),void 0);return yW(e.logger,e.clock,`start-direct`,n)}catch(t){return N(_W(e.logger,t))}},oG=async(e,t,n)=>{try{let r={title:t,memberIds:[...n]},i=await e.httpClient.post(TW.createGroup,r);return yW(e.logger,e.clock,`group`,i)}catch(t){return N(_W(e.logger,t))}},sG=async e=>{let{deps:t,conversationId:n,text:r,clientMessageId:i,replyToMessageId:a}=e;try{let e={text:r,clientMessageId:i};a!=null&&(e.replyToMessageId=a);let o=await t.httpClient.post(OW.sendMessage(n),e),s=JU.safeParse(o);return s.success?M(fW(s.data)):pW(t.logger,`send-message`,s.error)}catch(e){return N(_W(t.logger,e))}},cG=class{httpClient;clock;logger;constructor(e){this.httpClient=e.httpClient,this.clock=e.clock,this.logger=e.logger.child(`http-chat-gateway`)}deps(){return{httpClient:this.httpClient,logger:this.logger}}queryDeps(){return{httpClient:this.httpClient,clock:this.clock,logger:this.logger}}listConversations(e){return XW(this.queryDeps(),e)}getConversationCounts(){return ZW(this.deps())}getConversation(e){return QW(this.queryDeps(),e)}listStaff(e){return $W(this.deps(),e)}getGroupMemberPool(e){return eG(this.deps(),e)}getViewer(){return tG(this.deps())}getMessages(e,t){return nG(this.deps(),e,t)}getMessagesSince(e,t,n){return rG(this.deps(),e,t,n)}getMessagesBefore(e,t,n){return iG(this.deps(),e,t,n)}startDirect(e){return aG(this.queryDeps(),e)}createGroup(e,t){return oG(this.queryDeps(),e,t)}sendMessage(e,t,n,r){return sG({deps:this.deps(),conversationId:e,text:t,clientMessageId:n,replyToMessageId:r})}uploadChatMedia(e,t,n){return kW(this.deps(),e,t,n)}sendMediaMessage(e){return AW(this.deps(),e)}downloadMedia(e){return jW(this.deps(),e)}editMessage(e,t,n){return MW(this.deps(),e,t,n)}deleteMessage(e,t){return NW(this.deps(),e,t)}deleteMessageForMe(e,t){return PW(this.deps(),e,t)}subscribePush(e){return FW(this.deps(),e)}markDelivered(e,t){return zW(this.deps(),e,t)}markRead(e,t){return BW(this.deps(),e,t)}setFavourite(e,t){return VW(this.deps(),e,t)}setArchived(e,t){return HW(this.deps(),e,t)}setPinned(e,t){return UW(this.deps(),e,t)}deleteConversation(e){return JW(this.deps(),e)}leaveConversation(e){return WW(this.deps(),e)}refreshPortal(e){return GW(this.deps(),e)}reactToMessage(e,t,n){return KW(this.deps(),t,n)}saveMembers(e,t,n){return qW(this.deps(),e,t,n)}};function lG(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function uG(e,t){let n,r=()=>{if(n)return n;let r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(t),n=lG(r),n.then(e=>{e.onclose=()=>n=void 0},()=>{}),n};return(e,n)=>r().then(r=>n(r.transaction(t,e).objectStore(t)))}var dG;function fG(){return dG||=uG(`keyval-store`,`keyval`),dG}function pG(e,t=fG()){return t(`readonly`,t=>lG(t.get(e)))}function mG(e,t,n=fG()){return n(`readwrite`,n=>(n.put(t,e),lG(n.transaction)))}function hG(e,t=fG()){return t(`readwrite`,t=>(t.delete(e),lG(t.transaction)))}function gG(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},lG(e.transaction)}function _G(e=fG()){return e(`readonly`,e=>{if(e.getAllKeys)return lG(e.getAllKeys());let t=[];return gG(e,e=>t.push(e.key)).then(()=>t)})}var vG=uG(`chat-outbox`,`pending-sends`),yG=e=>`send:${e}`,bG=()=>({put:async e=>{await mG(yG(e.clientMessageId),e,vG)},remove:async e=>{await hG(yG(e),vG)},listAll:async()=>{let e=await _G(vG);return(await Promise.all(e.map(async e=>pG(e,vG)))).filter(e=>e!==void 0)},listByConversation:async e=>{let t=await _G(vG);return(await Promise.all(t.map(async e=>pG(e,vG)))).filter(t=>t?.conversationId===e)}}),xG={MessageReceived:`MessageReceived`,MessageEdited:`MessageEdited`,MessageDeleted:`MessageDeleted`,MessageDelivered:`MessageDelivered`,MessageRead:`MessageRead`,Typing:`Typing`,PresenceChanged:`PresenceChanged`,StatusChanged:`StatusChanged`,ReactionToggled:`ReactionToggled`,RemovedFromConversation:`RemovedFromConversation`},SG={MarkRead:`MarkRead`,MarkDelivered:`MarkDelivered`,Typing:`Typing`},CG=G({conversationId:V(),byUserId:V(),uptoSequence:H()}),wG=G({conversationId:V(),userId:V(),isTyping:U()}),TG=G({userId:V(),online:U(),lastSeenUtc:V().nullable()}),EG=G({userId:V(),status:H(),untilUtc:V().nullish()}),DG=G({conversationId:V(),messageId:V(),byUserId:V(),emoji:V(),added:U()}),OG=G({conversationId:V(),messageId:V()}),kG=G({conversationId:V()}),AG=(e,t,n,r)=>{let i=e.safeParse(t);return!i.success||i.data===void 0?(r.warn(`Ignoring malformed realtime payload`,{event:n}),null):i.data},jG=(e,t,n)=>AG(JU,e,t,n),MG=(e,t,n)=>AG(CG,e,t,n),NG=(e,t,n)=>AG(wG,e,t,n),PG=(e,t,n)=>AG(TG,e,t,n),FG=(e,t,n)=>AG(EG,e,t,n),IG=(e,t,n)=>AG(DG,e,t,n),LG=(e,t,n)=>AG(OG,e,t,n),RG=(e,t,n)=>AG(kG,e,t,n),zG=`chat.hidden-messages`,BG=W(V()),VG=()=>{try{let e=window.localStorage.getItem(zG);if(e===null)return[];let t=BG.safeParse(JSON.parse(e));return t.success?t.data:[]}catch{return[]}},HG=e=>{try{window.localStorage.setItem(zG,JSON.stringify(e))}catch{}},UG=PE((e,t)=>({hidden:new Set(VG()),hideForMe:n=>{if(t().hidden.has(n))return;let r=new Set(t().hidden);r.add(n),HG([...r]),e({hidden:r})}})),WG=(e,t)=>t.length>0&&oU(e,t),GG=(e,t)=>{let n=WG(e.senderId,t),r=n?e.reactions:e.reactions.map(e=>e.reacted?{...e,reacted:!1}:e),i=r.length===e.reactions.length&&r.every((t,n)=>{let r=e.reactions[n];return r===void 0?!1:t.reacted===r.reacted&&t.emoji===r.emoji&&t.count===r.count});return n===e.fromViewer&&i?e:e.with({fromViewer:n,reactions:r})},KG=(e,t)=>t.length===0?e:e.map(e=>GG(e,t)),qG=[],JG=({isLoadingOlder:e,hasMessages:t})=>!t||!e?null:(0,D.jsx)(`div`,{className:K.olderRow,children:(0,D.jsx)(gi,{size:`sm`,label:`Loading older messages`})}),YG=(e,t,n,r)=>!(e.fromViewer&&(e.kind===`text`||e.kind===`media`))||_V(e)?null:gH(e,{peerUserId:t,otherMemberIds:n,receipts:r}),XG=({conversation:e,viewerId:t,messages:r,selectedMessageId:i,onSelectMessage:a,onReact:o,onRetry:s,onReply:c,onEdit:l,onDelete:u})=>{let d=e.id,f=UG(e=>e.hidden),p=(0,n.useMemo)(()=>KG(r.data??qG,t).filter(e=>!f.has(e.id)),[r.data,t,f]),m=vP(e=>e.receipts[d]),h=vP(e=>e.pending),g=e.members.map(e=>e.id).filter(e=>e!==t),_=yH(d),v=TH(d,p,_.loadOlder);return(0,D.jsxs)(`div`,{className:K.threadWrap,children:[(0,D.jsx)(`div`,{className:K.messages,ref:v.scrollRef,onScroll:v.onScroll,children:(0,D.jsxs)(`div`,{className:K.thread,children:[(0,D.jsx)(JG,{isLoadingOlder:_.isLoadingOlder,hasMessages:p.length>0}),r.isPending&&(0,D.jsx)(`div`,{className:K.center,children:(0,D.jsx)(gi,{label:`Loading messages`})}),r.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not load messages`,children:r.error.message}),p.length>0&&(0,D.jsx)(PU,{conversation:e,messages:p,pending:h,selectedMessageId:i,onSelectMessage:a,tickFor:t=>YG(t,e.peerUserId,g,m??{}),onReact:o,onRetry:s,onReply:c,onEdit:l,onDelete:u})]})}),v.hasNewBelow&&(0,D.jsxs)(`button`,{type:`button`,className:T(K.newPill),onClick:()=>{v.scrollToBottom(!0)},children:[(0,D.jsx)(Gn,{size:14}),`New messages`]})]})},ZG=e=>(0,D.jsx)(XG,{...e}),QG=(e,t,r,i)=>{let[a,o]=(0,n.useState)(null),s=()=>{o(null)};return{requestDelete:t=>{o(e.find(e=>e.id===t)??null)},dialogProps:{open:a!==null,canDeleteForEveryone:a?.canDeleteForEveryone(i.now().getTime())??!1,onDeleteForMe:()=>{a!==null&&r(a.id),s()},onDeleteForEveryone:()=>{a!==null&&t(a.id),s()},onCancel:s}}},$G=`now`,eK=(e,t,n)=>{e.outbox.put({clientMessageId:t.clientMessageId,conversationId:e.conversationId,text:t.text,failedAt:n})},tK=(e,t,n)=>{e.queryClient.setQueryData(cF(e.conversationId),r=>SV(r,bV({viewer:t,text:n.text,clientMessageId:n.clientMessageId,sequence:vV(r??[])+1,timeLabel:$G,sentAt:e.clock.now().toISOString(),replyTo:n.replyTo??null}))),e.store.getState().markSending(n.clientMessageId),eK(e,n,null)},nK=(e,t,n)=>{e.queryClient.setQueryData(cF(e.conversationId),e=>CV(e,t)),e.store.getState().clearPending(n),e.outbox.remove(n),KP(e.queryClient)},rK=(e,t,n)=>P(t.execute(e.conversationId,n.text,n.clientMessageId,n.replyToMessageId)),iK=e=>{let{sendMessage:t,outbox:r,clock:i}=LP(),a=sN(),o=_P(),s=uF().data??null,c={queryClient:a,store:o,outbox:r,conversationId:e,clock:i},l=CN({mutationFn:e=>rK(c,t,e),onMutate:e=>{s!==null&&tK(c,s,e)},onSuccess:(e,t)=>{nK(c,e,t.clientMessageId)},onError:(e,t)=>{j.error(e instanceof Error?e.message:`Failed to send message`),o.getState().markFailed(t.clientMessageId),eK(c,t,c.clock.now().toISOString()),j.error(e.message)}}),u=(0,n.useCallback)(()=>{r.listByConversation(e).then(e=>{for(let t of e)t.failedAt!==null&&(o.getState().markSending(t.clientMessageId),l.mutate({text:t.text,clientMessageId:t.clientMessageId}))})},[e,l,r,o]);return(0,n.useEffect)(()=>{let e=()=>{u()};return window.addEventListener(`online`,e),()=>{window.removeEventListener(`online`,e)}},[u]),{send:(0,n.useCallback)((e,t=null)=>{l.mutate({text:e,clientMessageId:crypto.randomUUID(),replyToMessageId:t?.messageId??null,replyTo:t})},[l]),retry:(0,n.useCallback)((e,t)=>{o.getState().markSending(e),l.mutate({text:t,clientMessageId:e})},[l,o]),isSending:l.isPending}},aK=(e,t)=>{let n=e.then(t,t);return{run:n,next:n.then(()=>void 0,()=>void 0)}},oK=(e,t)=>{let n=e.get(t);n!==void 0&&(e.delete(t),globalThis.setTimeout(()=>{URL.revokeObjectURL(n)},250))},sK=(e,t)=>{let n=e.viewer;if(n===null)return;let r=URL.createObjectURL(t.file);e.urls.set(t.clientMessageId,r);let i=e.nowIso();e.queryClient.setQueryData(cF(e.conversationId),e=>SV(e,xV({viewer:n,fileUrl:r,caption:t.caption??``,clientMessageId:t.clientMessageId,sequence:vV(e??[])+1,sentAt:i,contentType:t.file.type,fileName:t.fileName}))),e.store.getState().markSending(t.clientMessageId)},cK=(e,t,n)=>{e.queryClient.setQueryData(cF(e.conversationId),e=>CV(e,t)),e.store.getState().clearPending(n),oK(e.urls,n),KP(e.queryClient)},lK=(e,t)=>{let n=gV(t.clientMessageId);e.queryClient.setQueryData(cF(e.conversationId),e=>e?.filter(e=>e.id!==n)??[]),e.store.getState().clearPending(t.clientMessageId),oK(e.urls,t.clientMessageId),j.error(`Couldn't send ${t.fileName}.`)},uK=e=>{let{sendMediaMessage:t,clock:r}=LP(),i=sN(),a=_P(),o=uF().data??null,s=(0,n.useRef)(new Map),c=(0,n.useRef)(Promise.resolve()),l={queryClient:i,store:a,viewer:o,conversationId:e,nowIso:()=>r.now().toISOString(),urls:s.current},u=CN({mutationFn:e=>{let{run:n,next:r}=aK(c.current,()=>P(t.execute(e)));return c.current=r,n},onMutate:e=>{sK(l,e)},onSuccess:(e,t)=>{cK(l,e,t.clientMessageId)},onError:(e,t)=>{lK(l,t)}});return{sendMedia:(0,n.useCallback)((t,n,r)=>{let i={conversationId:e,file:t,fileName:t.name,clientMessageId:crypto.randomUUID(),...n!==void 0&&n.trim().length>0?{caption:n}:{},...r===void 0?{}:{replyToMessageId:r}};u.mutate(i)},[e,u]),isSending:u.isPending}},dK=(e,t)=>{let r=aF(),i=(0,n.useRef)({conversationId:null,upto:0,acknowledge:(e,t)=>{}});i.current.acknowledge=(e,t)=>{r.mutate({conversationId:e,uptoSequence:t})},(0,n.useEffect)(()=>{if(e===null||t===void 0||t.length===0)return;let n=yV(t),r=i.current;r.conversationId===e&&n<=r.upto||(r.conversationId=e,r.upto=n,r.acknowledge(e,n))},[e,t])},fK=2e3,pK=3e3,mK=e=>{let{realtime:t,logger:r}=LP(),i=vP(e=>e.status===`connected`),a=(0,n.useRef)(0),o=(0,n.useRef)(!1),s=(0,n.useRef)(null),c=(0,n.useCallback)(n=>{e===null||!i||t.invoke(SG.Typing,e,n).catch(()=>{r.debug(`Typing signal dropped (best-effort)`)})},[e,i,t,r]),l=(0,n.useCallback)(()=>{s.current!==null&&(clearTimeout(s.current),s.current=null)},[]),u=(0,n.useCallback)(()=>{l(),o.current&&(o.current=!1,a.current=0,c(!1))},[l,c]),d=(0,n.useCallback)(()=>{let e=Date.now();(!o.current||e-a.current>fK)&&(o.current=!0,a.current=e,c(!0)),l(),s.current=setTimeout(u,pK)},[l,c,u]);return(0,n.useEffect)(()=>u,[e,u]),{onInput:d,stop:u}},hK=e=>{let{subscribePush:t}=LP();(0,n.useEffect)(()=>{!e||!(`serviceWorker`in navigator)||`PushManager`in window},[e,t])},gK=()=>{let[e,t]=(0,n.useState)(``),[r,i]=(0,n.useState)(null),[a,o]=(0,n.useState)(null);return{text:e,setText:t,replyTo:r,setReplyTo:i,editingMessage:a,setEditingMessage:o}},_K=({messages:e,send:t,media:n,draft:r,actions:i})=>({messages:e,send:t,media:n,text:r.text,setText:r.setText,replyTo:r.replyTo,setReplyTo:r.setReplyTo,editingMessage:r.editingMessage,startEdit:i.startEdit,clearEditing:i.clearEditing,onReact:i.onReact,onEdit:i.onEdit,onDelete:i.onDelete,onDeleteForMe:i.onDeleteForMe,submit:i.submit,onSendMedia:i.onSendMedia,onTyping:i.onTyping,isSending:t.isSending||n.isSending}),vK=e=>{let t=dF(e),n=iK(e),r=uK(e),i=SF(e),a=CF(e),o=wF(e),s=TF(e),c=UG(e=>e.hideForMe),l=mK(e),u=gK();return hK(!0),dK(e,t.data),_K({messages:t,send:n,media:r,draft:u,actions:{startEdit:e=>{u.setEditingMessage({id:e.id,text:e.text}),u.setText(e.text),u.setReplyTo(null)},clearEditing:()=>{u.setEditingMessage(null),u.setText(``)},onReact:(e,t)=>{i.mutate({messageId:e,emoji:t})},onEdit:(e,t)=>{a.mutate({messageId:e,text:t})},onDelete:e=>{o.mutate(e)},onDeleteForMe:e=>{c(e),s.mutate(e)},submit:()=>{if(u.text.trim().length!==0){if(l.stop(),u.editingMessage!==null){a.mutate({messageId:u.editingMessage.id,text:u.text.trim()}),u.setEditingMessage(null),u.setText(``);return}n.send(u.text,u.replyTo),u.setText(``),u.setReplyTo(null)}},onSendMedia:(e,t)=>{e.forEach((e,n)=>{r.sendMedia(e,n===0?t:void 0,n===0?u.replyTo?.messageId??null:null)}),u.setText(``),u.setReplyTo(null)},onTyping:l.onInput}})},yK=()=>(0,D.jsxs)(`div`,{className:K.removedComposer,children:[(0,D.jsx)(Nn,{size:15}),(0,D.jsx)(`span`,{children:`You can no longer send messages here — you’re no longer a member of this group.`})]}),bK=({conversation:e,conversationId:t,active:n,removed:r})=>r?(0,D.jsx)(yK,{}):(0,D.jsx)(fH,{conversation:e,conversationId:t,text:n.text,replyTo:n.replyTo,editingMessage:n.editingMessage,isSending:n.isSending,onChange:n.setText,onSubmit:n.submit,onClearReply:()=>{n.setReplyTo(null)},onClearEditing:n.clearEditing,onSendMedia:n.onSendMedia,onTyping:n.onTyping}),xK=({conversation:e,conversationId:t,actions:r,onRequestDelete:i,onRequestLeave:a})=>{let o=fR(),s=uF(),{clock:c}=LP(),l=vK(t),u=QG(l.messages.data??[],l.onDelete,l.onDeleteForMe,c),d=vP(e=>e.isRemovedFromConversation(t)),[f,p]=(0,n.useState)(!1),[m,h]=(0,n.useState)(null);return(0,n.useEffect)(()=>{h(null)},[t]),(0,D.jsxs)(`div`,{className:K.view,children:[(0,D.jsx)(IV,{conversation:e,categories:o.data??[],actions:r,statusPill:(0,D.jsx)(QV,{}),onManageMembers:()=>{p(!0)},onRequestDelete:i,onRequestLeave:a,selectedMessage:m,onClearSelection:()=>{h(null)},onReply:l.setReplyTo,onStartEdit:l.startEdit,onDelete:u.requestDelete}),(0,D.jsx)(ZG,{conversation:e,viewerId:s.data?.id??``,messages:l.messages,selectedMessageId:m?.id??null,onSelectMessage:e=>{h(t=>t?.id===e.id?null:e)},onReact:l.onReact,onRetry:l.send.retry,onReply:l.setReplyTo,onEdit:l.onEdit,onDelete:u.requestDelete}),(0,D.jsx)(bK,{conversation:e,conversationId:t,active:l,removed:d}),e.isGroup&&(0,D.jsx)(JV,{conversation:e,open:f,onClose:()=>{p(!1)}}),(0,D.jsx)(YV,{...u.dialogProps})]})},SK=()=>(0,D.jsxs)(`div`,{className:K.viewEmpty,children:[(0,D.jsx)(`div`,{className:K.emptyIconWrap,children:(0,D.jsx)(Nn,{size:32})}),(0,D.jsx)(`h3`,{className:K.emptyTitle,children:`No longer available`}),(0,D.jsx)(`p`,{className:K.emptyText,children:`You no longer have access to this conversation — you may have been removed from the group, or it was deleted. You can no longer read or send messages here.`})]}),CK=()=>{let e=Ny(0),t=Ny(0),n=By(e,{stiffness:60,damping:20}),r=By(t,{stiffness:60,damping:20}),i=Iy(n,[-1,1],[-25,25]),a=Iy(r,[-1,1],[-25,25]),o=Iy(n,[-1,1],[20,-20]),s=Iy(r,[-1,1],[-15,15]),c=Iy(n,[-1,1],[-15,15]),l=Iy(r,[-1,1],[20,-20]);return(0,D.jsxs)(`div`,{className:K.viewEmpty,onMouseMove:n=>{let r=n.currentTarget.getBoundingClientRect(),i=(n.clientX-r.left-r.width/2)/(r.width/2),a=(n.clientY-r.top-r.height/2)/(r.height/2);e.set(i),t.set(a)},onMouseLeave:()=>{e.set(0),t.set(0)},children:[(0,D.jsx)(A.div,{className:K.emptyFloating1,style:{x:i,y:a},children:(0,D.jsx)(Sr,{size:24})}),(0,D.jsx)(A.div,{className:K.emptyFloating2,style:{x:o,y:s},children:(0,D.jsx)(Xr,{size:20})}),(0,D.jsx)(A.div,{className:K.emptyFloating3,style:{x:c,y:l},children:(0,D.jsx)(Ur,{size:16})}),(0,D.jsx)(`div`,{className:K.emptyIconWrap,children:(0,D.jsx)(xr,{size:32})}),(0,D.jsx)(`h3`,{className:K.emptyTitle,children:`Your Messages`}),(0,D.jsx)(`p`,{className:K.emptyText,children:`Select a conversation from the sidebar or start a new chat.`})]})},wK=({conversation:e,conversationId:t,lostAccess:r,actions:i,onRequestDelete:a,onRequestLeave:o})=>{let s=_P();return(0,n.useEffect)(()=>(s.getState().setActiveConversationId(t),()=>{s.getState().setActiveConversationId(null)}),[t,s]),e===void 0||t===null?r?(0,D.jsx)(SK,{}):(0,D.jsx)(CK,{}):(0,D.jsx)(A.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{type:`spring`,stiffness:350,damping:28},className:K.viewPaneWrapper,children:(0,D.jsx)(xK,{conversation:e,conversationId:t,actions:i,onRequestDelete:a,onRequestLeave:o})},t)},TK=({mediaUrl:e})=>{let{src:t,isLoading:n,isError:r,onImageError:i}=jH(e);return r?(0,D.jsxs)(`div`,{className:K.viewerFallback,children:[(0,D.jsx)(fr,{size:30}),(0,D.jsx)(`span`,{children:`Image unavailable`})]}):t===null||n?(0,D.jsx)(gi,{label:`Loading image`}):(0,D.jsx)(`img`,{className:K.viewerImg,src:t,alt:``,onError:i})},EK=(e,t,r,i)=>{(0,n.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`?t():e.key===`ArrowRight`?r():e.key===`ArrowLeft`&&i()};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n)}},[e,t,r,i])},DK=()=>{let e=MH(e=>e.open),t=MH(e=>e.urls),n=MH(e=>e.index),r=MH(e=>e.close),a=MH(e=>e.next),o=MH(e=>e.prev),s=Bs();EK(e,r,a,o);let c=t[n];if(!e||c===void 0)return null;let l=t.length>1;return(0,i.createPortal)((0,D.jsxs)(`div`,{className:K.viewerBackdrop,role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview`,children:[(0,D.jsx)(`button`,{type:`button`,className:K.viewerScrim,"aria-label":`Close preview`,onClick:r}),(0,D.jsx)(`button`,{type:`button`,className:K.viewerClose,"aria-label":`Close preview`,onClick:r,children:(0,D.jsx)(ci,{size:22})}),l&&(0,D.jsx)(`button`,{type:`button`,className:T(K.viewerNav,K.viewerNavPrev),"aria-label":`Previous image`,disabled:n===0,onClick:o,children:(0,D.jsx)(Kn,{size:26})}),(0,D.jsx)(`div`,{className:K.viewerStage,children:(0,D.jsx)(TK,{mediaUrl:c})}),l&&(0,D.jsx)(`button`,{type:`button`,className:T(K.viewerNav,K.viewerNavNext),"aria-label":`Next image`,disabled:n===t.length-1,onClick:a,children:(0,D.jsx)(qn,{size:26})}),l&&(0,D.jsxs)(`span`,{className:K.viewerCount,children:[n+1,` / `,t.length]})]}),s??document.body)},OK=()=>{let e=pF(),t=hF(),n=mF(),r=gF(),i=_F(),a=vF();return{toggleFavourite:t=>{e.mutate({id:t.id,value:!t.favourite},{onSuccess:()=>{j.success(t.favourite?`Removed from Favourites`:`Added to Favourites`)}})},togglePin:e=>{t.mutate({id:e.id,value:!e.pinned},{onSuccess:()=>{j.success(e.pinned?`Unpinned`:`Pinned to top`)}})},toggleArchive:e=>{n.mutate({id:e.id,value:!e.archived},{onSuccess:()=>{j.success(e.archived?`Chat unarchived`:`Chat archived`)}})},remove:e=>{r.mutate(e,{onSuccess:()=>{j.success(`Chat deleted`)}})},leave:e=>{i.mutate(e.id,{onSuccess:()=>{j.success(`You left "${e.title}"`)}})},refresh:e=>{a.mutate(e.id,{onSuccess:()=>{j.success(`Portal data refreshed`)}})}}},kK=e=>{let t=_P();(0,n.useEffect)(()=>{let{seedReceipts:n}=t.getState();for(let t of e)n(t.id,t.memberReceipts)},[t,e])},AK=[],jK=(e,t,n)=>{let r=HP(e,t),i=HP(e,``),a=UP(),o=r.data??AK,s=i.data??AK,c=n??s[0]?.id??o[0]?.id??null,l=GP(c);return kK(o),{conversations:r,counts:a.data,list:o,activeId:c,active:l.data??o.find(e=>e.id===c),lostAccess:n!==null&&l.isError}},MK=`/comms/chats`,NK=(e,t,r)=>{let[i,a]=(0,n.useState)(null),[o,s]=(0,n.useState)(null);return{pendingDelete:i,pendingLeave:o,requestDelete:a,requestLeave:s,confirmDelete:()=>{i!==null&&(e.remove(i.id),i.id===t&&r(MK)),a(null)},confirmLeave:()=>{o!==null&&(e.leave(o),o.id===t&&r(MK)),s(null)},cancelDelete:()=>{a(null)},cancelLeave:()=>{s(null)}}},PK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,FK=`--`,IK=e=>e.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/u,``),LK=e=>{let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return t+`=`.repeat((4-t.length%4)%4)},RK=e=>{let t=e.replace(/-/g,``),n=``;for(let e=0;e<t.length;e+=2)n+=String.fromCharCode(Number.parseInt(t.slice(e,e+2),16));return IK(btoa(n))},zK=e=>{let t;try{t=atob(LK(e))}catch{return null}if(t.length!==16)return null;let n=``;for(let e=0;e<t.length;e+=1)n+=t.charCodeAt(e).toString(16).padStart(2,`0`);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`},BK=e=>PK.test(e)?RK(e):`~${IK(btoa(e))}`,VK=e=>{if(e.startsWith(`~`))try{return atob(LK(e.slice(1)))}catch{return null}return zK(e)},HK=e=>{let t=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,40);return t.length>0?t:`chat`},UK=(e,t)=>`/comms/chats/${HK(t)}${FK}${BK(e)}`,WK=e=>{let t=e.indexOf(FK),n=t>=0?e.slice(t+2):e;return PK.test(n)?n:VK(n)},GK=()=>{let e=Ue(),[t,r]=(0,n.useState)(`all`),[i,a]=(0,n.useState)(``),o=OF(i,250),{conversationId:s}=We(),c=s===void 0?null:WK(s),{conversations:l,counts:u,list:d,activeId:f,active:p,lostAccess:m}=jK(t,o,c),h=OK(),g=Be(),_=NK(h,c,g);return l.isPending?(0,D.jsx)(KF,{}):l.isSuccess?(0,D.jsxs)(`div`,{className:T(K.root,c!==null&&K.hasActiveChat),children:[(0,D.jsx)(WF,{conversations:d,activeId:f,actions:h,filter:{tab:t,onTabChange:r,search:i,onSearchChange:a,counts:u},hasNextPage:l.hasNextPage,isFetchingNextPage:l.isFetchingNextPage,onLoadMore:l.fetchNextPage,onRequestDelete:_.requestDelete,onSelect:e=>{g(UK(e,d.find(t=>t.id===e)?.title??``))}}),(0,D.jsx)(wK,{conversation:p,conversationId:f,lostAccess:m,actions:h,onRequestDelete:_.requestDelete,onRequestLeave:_.requestLeave}),(0,D.jsx)(hD,{pendingDelete:_.pendingDelete,pendingLeave:_.pendingLeave,onConfirmDelete:_.confirmDelete,onConfirmLeave:_.confirmLeave,onCancelDelete:_.cancelDelete,onCancelLeave:_.cancelLeave}),(0,D.jsx)(DK,{}),e]}):(0,D.jsx)(`div`,{className:K.fullCenter,children:(0,D.jsx)(bi,{tone:`error`,title:`Could not load chats`,children:l.error?.message??`Please try again.`})})},KK=`/comms/chats`,qK=()=>(0,D.jsxs)(St,{children:[(0,D.jsxs)(bt,{path:KK,element:(0,D.jsx)(GK,{}),children:[(0,D.jsx)(bt,{index:!0,element:null}),(0,D.jsx)(bt,{path:`:conversationId`,element:null})]}),(0,D.jsx)(bt,{path:`*`,element:(0,D.jsx)(yt,{to:KK,replace:!0})})]}),JK=e.n((e=>{var t=require("react-dom");if(process.env.NODE_ENV===`production`)e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot;else{var n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e.createRoot=function(e,r){n.usingClientEntryPoint=!0;try{return t.createRoot(e,r)}finally{n.usingClientEntryPoint=!1}},e.hydrateRoot=function(e,r,i){n.usingClientEntryPoint=!0;try{return t.hydrateRoot(e,r,i)}finally{n.usingClientEntryPoint=!1}}}}))(),YK=`__COMMHUB_SDK_CSS__`,XK,ZK=()=>{let e=globalThis[YK];return typeof e==`string`?e:``},QK=()=>typeof CSSStyleSheet==`function`&&typeof CSSStyleSheet.prototype.replaceSync==`function`,$K=()=>{let e=ZK();if(e===``||!QK())return[];if(XK===void 0)try{let t=new CSSStyleSheet;t.replaceSync(e),XK=t}catch{XK=null}return XK===null?[]:[XK]},eq=()=>{let e=ZK();if(e===``)return null;let t=document.createElement(`style`);return t.textContent=e,t},tq=`commhub-widget-root`;function nq(e,t,n=[]){if(customElements.get(e))return;class r extends HTMLElement{reactRoot=null;mountPoint;configValue={};static get observedAttributes(){return n}get config(){return this.configValue}set config(e){this.configValue=e,this.render()}constructor(){super();let e=this.attachShadow({mode:`open`}),t=$K();if(t.length>0)e.adoptedStyleSheets=[...t];else{let t=eq();t!==null&&e.appendChild(t)}this.mountPoint=document.createElement(`div`),this.mountPoint.className=tq,e.appendChild(this.mountPoint)}connectedCallback(){this.render()}disconnectedCallback(){let e=this.reactRoot;e!==null&&(this.reactRoot=null,queueMicrotask(()=>{if(this.isConnected){this.reactRoot??=e;return}e.unmount()}))}attributeChangedCallback(){this.reactRoot!==null&&this.render()}render(){this.isConnected&&(this.reactRoot??=(0,JK.createRoot)(this.mountPoint),this.reactRoot.render(t(this)))}}customElements.define(e,r)}var rq={notice:`_notice_184jj_6`,title:`_title_184jj_23`,detail:`_detail_184jj_29`},iq=({tagName:e,detail:t})=>(0,D.jsxs)(`div`,{className:rq.notice,role:`alert`,children:[(0,D.jsxs)(`strong`,{className:rq.title,children:[`<`,e,`> could not start: invalid configuration`]}),(0,D.jsx)(`span`,{className:rq.detail,children:t})]}),aq=class{entries=new Map;getItem(e){return this.entries.get(e)??null}setItem(e,t){this.entries.set(e,t)}removeItem(e){this.entries.delete(e)}},oq=e=>{let t=new fB({storage:new aq,logger:e.logger,namespace:e.storageNamespace});return pB({completeSsoLoginUseCase:new Wz({authGateway:e.authGateway,sessionStore:t,logger:e.logger}),logoutUseCase:new Gz({authGateway:e.authGateway,sessionStore:t,logger:e.logger}),restoreSessionUseCase:new Kz({authGateway:e.authGateway,sessionStore:t,clock:e.clock,logger:e.logger}),refreshSessionUseCase:new qz({authGateway:e.authGateway,sessionStore:t,logger:e.logger}),setAccessToken:e.setAccessToken,loginUrl:``})},sq=`sdk_signed`,cq=`assertion`,lq=`CommunicationHub`,uq=class{httpClient;clock;logger;clientKey;scope;constructor(e){this.httpClient=e.httpClient,this.clock=e.clock,this.logger=e.logger.child(`sdk-signed-gateway`),this.clientKey=e.clientKey,this.scope=[lq,...e.modules].join(` `)}exchangeSsoSecret(e){return e.trim().length===0||this.clientKey.trim().length===0?Promise.resolve(N(new zz)):this.requestToken({grant_type:sq,client_id:this.clientKey,[cq]:e,scope:this.scope})}refresh(e){return Promise.resolve(N(new Bz(`sdk_signed re-authenticates with a fresh host assertion, not a refresh token.`)))}signOut(e){return Promise.resolve()}async requestToken(e){try{let t=await this.httpClient.postForm(tB,e,{anonymous:!0}),n=Jz.safeParse(t);return n.success?eB(n.data,this.clock.now()):(this.logger.error(`Token endpoint returned an unexpected shape`,n.error),N(new Bz(n.error)))}catch(e){return e instanceof lk&&e.isClientError()?(this.logger.warn(`Signed assertion was rejected`,{status:e.status}),N(new zz)):(this.logger.error(`Failed to exchange signed assertion`,{error:e}),N(new Bz(e)))}}},dq=class{clock;logger;constructor(e){this.clock=e.clock,this.logger=e.logger.child(`sdk-host-token-gateway`)}exchangeSsoSecret(e){if(e.trim().length===0)return Promise.resolve(N(new zz));try{let t=Qz(e);if(HD(t))return this.logger.error(`Invalid JWT token provided by host`,t.error),Promise.resolve(N(new Bz(`Invalid host token provided.`)));let n=t.value.exp;if(typeof n!=`number`)return Promise.resolve(N(new Bz(`Host token missing or invalid exp claim.`)));let r=n-Math.floor(this.clock.now().getTime()/1e3);return r<=0?Promise.resolve(N(new Bz(`Host token is already expired.`))):Promise.resolve(eB({access_token:e,token_type:`Bearer`,expires_in:r,refresh_token:null},this.clock.now()))}catch(e){return this.logger.error(`Failed to parse host token`,{error:e}),Promise.resolve(N(new Bz(e)))}}refresh(e){return Promise.resolve(N(new Bz(`host-token does not support traditional refresh tokens.`)))}signOut(e){return Promise.resolve()}},fq={feed:`CommunicationHub.Feed`,chat:`CommunicationHub.Chat`,meetings:`CommunicationHub.Meetings`,schedule:`CommunicationHub.Schedule`,users:`CommunicationHub.Users`,accessControl:`CommunicationHub.AccessControl`,usage:`CommunicationHub.Usage`,groupCategories:`CommunicationHub.GroupCategories`,webhooks:`CommunicationHub.Webhooks`,promotions:`CommunicationHub.Promotions`,orgSettings:`CommunicationHub.OrgSettings`,orgAccess:`CommunicationHub.OrgAccess`,feedPreference:`CommunicationHub.FeedPreference`,apiKeys:`CommunicationHub.SdkClients`},pq=class extends ui{},mq=class extends pq{code=`MODULE_ACCESS_UNAVAILABLE`;constructor(e){super(`Your menu access could not be loaded. Please try again.`,{cause:e})}},hq=[`commhub.chat`,`commhub.bookings`,`commhub.schedule`,`commhub.feed`],gq={"commhub.chat":fq.chat,"commhub.feed":fq.feed,"commhub.schedule":fq.schedule,"commhub.bookings":fq.meetings},_q=e=>Object.hasOwn(gq,e),vq=e=>hq.filter(t=>e.has(gq[t])),yq=(e,t)=>e.filter(e=>!t.has(gq[e])),bq=1e4,xq=1e3,Sq=6e4,Cq=class{deps;timer=null;unwatch=null;started=!1;disposed=!1;inFlight=!1;failures=0;authenticated=!1;constructor(e){this.deps=e}start(){this.started||this.isDisposed()||(this.started=!0,this.watchSession(),this.run())}isDisposed(){return this.disposed}dispose(){this.disposed=!0,this.clearTimer(),this.unwatch?.(),this.unwatch=null}async run(){if(!(this.isDisposed()||this.inFlight)){this.inFlight=!0;try{let e=await this.deps.requestCredential(),t=await this.deps.authStore.getState().completeLogin(e);if(this.isDisposed())return;if(t){await this.onAuthenticated();return}this.onExpired()}catch(e){if(this.isDisposed())return;let t=e instanceof Error?e.message:String(e);this.deps.logger.error(`SDK handshake failed`,{error:e}),this.deps.emit({type:`error`,payload:{code:`HANDSHAKE_FAILED`,message:t}}),this.scheduleRetry()}finally{this.inFlight=!1}}}async onAuthenticated(){this.failures=0,this.authenticated=!0;let e=await this.deps.moduleAccessModule.getModuleAccess.execute();if(!this.isDisposed()){if(e.ok){let t=e.value.grantedModules;this.deps.emit({type:`ready`,payload:{apiVersion:`1.0`,modules:vq(t)}});let n=yq(this.deps.requestedModules,t);n.length>0&&this.deps.emit({type:`scope-denied`,payload:{required:[...n],granted:vq(t)}})}this.scheduleRenewal()}}onExpired(){(this.authenticated||this.failures===0)&&this.deps.emit({type:`auth-expired`,payload:{}}),this.authenticated=!1,this.scheduleRetry()}scheduleRetry(){let e=Math.min(Sq,xq*2**this.failures);this.failures+=1,this.scheduleAt(e)}scheduleRenewal(){if(!this.deps.renewable)return;let e=this.deps.authStore.getState().session;if(!e)return;let t=e.expiresAt.getTime()-Date.now();this.scheduleAt(Math.max(0,t-bq))}scheduleAt(e){this.clearTimer(),!this.isDisposed()&&(this.timer=setTimeout(()=>{this.timer=null,this.run()},e))}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}watchSession(){this.unwatch=this.deps.authStore.subscribe(e=>{this.inFlight||e.status===`unauthenticated`&&this.authenticated&&(this.deps.logger.warn(`SDK session expired mid-session; re-handshaking`),this.onExpired())})}},wq=class{createRunner;eventListeners=new Set;statusListeners=new Set;runner=null;currentStatus=`pending`;constructor(e){this.createRunner=e}get status(){return this.currentStatus}attach(e){let t=e;t!==void 0&&this.eventListeners.add(t),this.runner??=this.createRunner(e=>{this.emit(e)}),this.runner.start();let n=!1;return()=>{n||(n=!0,t!==void 0&&this.eventListeners.delete(t),this.eventListeners.size===0&&this.statusListeners.size===0&&(this.runner?.dispose(),this.runner=null,this.setStatus(`pending`)))}}subscribeStatus(e){return this.statusListeners.add(e),()=>{this.statusListeners.delete(e)}}dispose(){this.runner?.dispose(),this.runner=null,this.eventListeners.clear(),this.statusListeners.clear(),this.currentStatus=`pending`}emit(e){e.type===`ready`?this.setStatus(`ready`):e.type===`error`?this.setStatus(`failed`):e.type===`auth-expired`&&this.setStatus(`pending`);for(let t of[...this.eventListeners])t(e)}setStatus(e){if(this.currentStatus!==e){this.currentStatus=e;for(let e of[...this.statusListeners])e()}}},Tq=class extends Error{constructor(e,t){let n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}},Eq=class extends Error{constructor(e=`A timeout occurred.`){let t=new.target.prototype;super(e),this.__proto__=t}},Dq=class extends Error{constructor(e=`An abort occurred.`){let t=new.target.prototype;super(e),this.__proto__=t}},Oq=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType=`UnsupportedTransportError`,this.__proto__=n}},kq=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType=`DisabledTransportError`,this.__proto__=n}},Aq=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType=`FailedToStartTransportError`,this.__proto__=n}},jq=class extends Error{constructor(e){let t=new.target.prototype;super(e),this.errorType=`FailedToNegotiateWithServerError`,this.__proto__=t}},Mq=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}},Nq=class{constructor(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}},Pq=class{get(e,t){return this.send({...t,method:`GET`,url:e})}post(e,t){return this.send({...t,method:`POST`,url:e})}delete(e,t){return this.send({...t,method:`DELETE`,url:e})}getCookieString(e){return``}},J;(function(e){e[e.Trace=0]=`Trace`,e[e.Debug=1]=`Debug`,e[e.Information=2]=`Information`,e[e.Warning=3]=`Warning`,e[e.Error=4]=`Error`,e[e.Critical=5]=`Critical`,e[e.None=6]=`None`})(J||={});var Fq=class{constructor(){}log(e,t){}};Fq.instance=new Fq;var Iq=`10.0.0`,Lq=class{static isRequired(e,t){if(e==null)throw Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,n){if(!(e in t))throw Error(`Unknown ${n} value: ${e}.`)}},Rq=class e{static get isBrowser(){return!e.isNode&&typeof window==`object`&&typeof window.document==`object`}static get isWebWorker(){return!e.isNode&&typeof self==`object`&&`importScripts`in self}static get isReactNative(){return!e.isNode&&typeof window==`object`&&window.document===void 0}static get isNode(){return typeof process<`u`&&process.release&&process.release.name===`node`}};function zq(e,t){let n=``;return Vq(e)?(n=`Binary data of length ${e.byteLength}`,t&&(n+=`. Content: '${Bq(e)}'`)):typeof e==`string`&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function Bq(e){let t=new Uint8Array(e),n=``;return t.forEach(e=>{n+=`0x${e<16?`0`:``}${e.toString(16)} `}),n.substring(0,n.length-1)}function Vq(e){return e&&typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name===`ArrayBuffer`)}async function Hq(e,t,n,r,i,a){let o={},[s,c]=Kq();o[s]=c,e.log(J.Trace,`(${t} transport) sending data. ${zq(i,a.logMessageContent)}.`);let l=Vq(i)?`arraybuffer`:`text`,u=await n.post(r,{content:i,headers:{...o,...a.headers},responseType:l,timeout:a.timeout,withCredentials:a.withCredentials});e.log(J.Trace,`(${t} transport) request complete. Response status: ${u.statusCode}.`)}function Uq(e){return e===void 0?new Gq(J.Information):e===null?Fq.instance:e.log===void 0?new Gq(e):e}var Wq=class{constructor(e,t){this._subject=e,this._observer=t}dispose(){let e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(e=>{})}},Gq=class{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){let n=`[${new Date().toISOString()}] ${J[e]}: ${t}`;switch(e){case J.Critical:case J.Error:this.out.error(n);break;case J.Warning:this.out.warn(n);break;case J.Information:this.out.info(n);break;default:this.out.log(n);break}}}};function Kq(){let e=`X-SignalR-User-Agent`;return Rq.isNode&&(e=`User-Agent`),[e,qq(Iq,Jq(),Xq(),Yq())]}function qq(e,t,n,r){let i=`Microsoft SignalR/`,a=e.split(`.`);return i+=`${a[0]}.${a[1]}`,i+=` (${e}; `,t&&t!==``?i+=`${t}; `:i+=`Unknown OS; `,i+=`${n}`,r?i+=`; ${r}`:i+=`; Unknown Runtime Version`,i+=`)`,i}function Jq(){if(Rq.isNode)switch(process.platform){case`win32`:return`Windows NT`;case`darwin`:return`macOS`;case`linux`:return`Linux`;default:return process.platform}else return``}function Yq(){if(Rq.isNode)return process.versions.node}function Xq(){return Rq.isNode?`NodeJS`:`Browser`}function Zq(e){return e.stack?e.stack:e.message?e.message:`${e}`}function Qq(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`could not find global`)}var $q=class extends Pq{constructor(e){if(super(),this._logger=e,typeof fetch>`u`||Rq.isNode){let e=typeof __webpack_require__==`function`?__non_webpack_require__:require;this._jar=new(e(`tough-cookie`)).CookieJar,typeof fetch>`u`?this._fetchType=e(`node-fetch`):this._fetchType=fetch,this._fetchType=e(`fetch-cookie`)(this._fetchType,this._jar)}else this._fetchType=fetch.bind(Qq());if(typeof AbortController>`u`){let e=typeof __webpack_require__==`function`?__non_webpack_require__:require;this._abortControllerType=e(`abort-controller`)}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new Dq;if(!e.method)throw Error(`No method defined.`);if(!e.url)throw Error(`No url defined.`);let t=new this._abortControllerType,n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new Dq});let r=null;if(e.timeout){let i=e.timeout;r=setTimeout(()=>{t.abort(),this._logger.log(J.Warning,`Timeout from HTTP request.`),n=new Eq},i)}e.content===``&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Vq(e.content)?e.headers[`Content-Type`]=`application/octet-stream`:e.headers[`Content-Type`]=`text/plain;charset=UTF-8`);let i;try{i=await this._fetchType(e.url,{body:e.content,cache:`no-cache`,credentials:e.withCredentials===!0?`include`:`same-origin`,headers:{"X-Requested-With":`XMLHttpRequest`,...e.headers},method:e.method,mode:`cors`,redirect:`follow`,signal:t.signal})}catch(e){throw n||(this._logger.log(J.Warning,`Error from HTTP request. ${e}.`),e)}finally{r&&clearTimeout(r),e.abortSignal&&(e.abortSignal.onabort=null)}if(!i.ok)throw new Tq(await eJ(i,`text`)||i.statusText,i.status);let a=await eJ(i,e.responseType);return new Nq(i.status,i.statusText,a)}getCookieString(e){let t=``;return Rq.isNode&&this._jar&&this._jar.getCookies(e,(e,n)=>t=n.join(`; `)),t}};function eJ(e,t){let n;switch(t){case`arraybuffer`:n=e.arrayBuffer();break;case`text`:n=e.text();break;case`blob`:case`document`:case`json`:throw Error(`${t} is not supported.`);default:n=e.text();break}return n}var tJ=class extends Pq{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Dq):e.method?e.url?new Promise((t,n)=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),r.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,r.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),e.content===``&&(e.content=void 0),e.content&&(Vq(e.content)?r.setRequestHeader(`Content-Type`,`application/octet-stream`):r.setRequestHeader(`Content-Type`,`text/plain;charset=UTF-8`));let i=e.headers;i&&Object.keys(i).forEach(e=>{r.setRequestHeader(e,i[e])}),e.responseType&&(r.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{r.abort(),n(new Dq)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new Nq(r.status,r.statusText,r.response||r.responseText)):n(new Tq(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(J.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),n(new Tq(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(J.Warning,`Timeout from HTTP request.`),n(new Eq)},r.send(e.content)}):Promise.reject(Error(`No url defined.`)):Promise.reject(Error(`No method defined.`))}},nJ=class extends Pq{constructor(e){if(super(),typeof fetch<`u`||Rq.isNode)this._httpClient=new $q(e);else if(typeof XMLHttpRequest<`u`)this._httpClient=new tJ(e);else throw Error(`No usable HttpClient found.`)}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Dq):e.method?e.url?this._httpClient.send(e):Promise.reject(Error(`No url defined.`)):Promise.reject(Error(`No method defined.`))}getCookieString(e){return this._httpClient.getCookieString(e)}},rJ=class e{static write(t){return`${t}${e.RecordSeparator}`}static parse(t){if(t[t.length-1]!==e.RecordSeparator)throw Error(`Message is incomplete.`);let n=t.split(e.RecordSeparator);return n.pop(),n}};rJ.RecordSeparatorCode=30,rJ.RecordSeparator=String.fromCharCode(rJ.RecordSeparatorCode);var iJ=class{writeHandshakeRequest(e){return rJ.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(Vq(e)){let r=new Uint8Array(e),i=r.indexOf(rJ.RecordSeparatorCode);if(i===-1)throw Error(`Message is incomplete.`);let a=i+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(r.slice(0,a))),n=r.byteLength>a?r.slice(a).buffer:null}else{let r=e,i=r.indexOf(rJ.RecordSeparator);if(i===-1)throw Error(`Message is incomplete.`);let a=i+1;t=r.substring(0,a),n=r.length>a?r.substring(a):null}let r=rJ.parse(t),i=JSON.parse(r[0]);if(i.type)throw Error(`Expected a handshake response from the server.`);return[n,i]}},aJ;(function(e){e[e.Invocation=1]=`Invocation`,e[e.StreamItem=2]=`StreamItem`,e[e.Completion=3]=`Completion`,e[e.StreamInvocation=4]=`StreamInvocation`,e[e.CancelInvocation=5]=`CancelInvocation`,e[e.Ping=6]=`Ping`,e[e.Close=7]=`Close`,e[e.Ack=8]=`Ack`,e[e.Sequence=9]=`Sequence`})(aJ||={});var oJ=class{constructor(){this.observers=[]}next(e){for(let t of this.observers)t.next(e)}error(e){for(let t of this.observers)t.error&&t.error(e)}complete(){for(let e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Wq(this,e)}},sJ=class{constructor(e,t,n){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=n}async _send(e){let t=this._protocol.writeMessage(e),n=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let e=()=>{},r=()=>{};Vq(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(n=new Promise((t,n)=>{e=t,r=n})),this._messages.push(new cJ(t,this._totalMessageCount,e,r))}try{this._reconnectInProgress||await this._connection.send(t)}catch{this._disconnected()}await n}_ack(e){let t=-1;for(let n=0;n<this._messages.length;n++){let r=this._messages[n];if(r._id<=e.sequenceId)t=n,Vq(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else if(this._bufferedByteCount<this._bufferSize)r._resolver();else break}t!==-1&&(this._messages=this._messages.slice(t+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type===aJ.Sequence?(this._waitForSequenceMessage=!1,!0):!1;if(!this._isInvocationMessage(e))return!0;let t=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,t<=this._latestReceivedSequenceId?(t===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=t,this._ackTimer(),!0)}_resetSequence(e){if(e.sequenceId>this._nextReceivingSequenceId){this._connection.stop(Error(`Sequence ID greater than amount of messages we've received.`));return}this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){let e=this._messages.length===0?this._totalMessageCount+1:this._messages[0]._id;await this._connection.send(this._protocol.writeMessage({type:aJ.Sequence,sequenceId:e}));let t=this._messages;for(let e of t)await this._connection.send(e._message);this._reconnectInProgress=!1}_dispose(e){e??=Error(`Unable to reconnect to server.`);for(let t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case aJ.Invocation:case aJ.StreamItem:case aJ.Completion:case aJ.StreamInvocation:case aJ.CancelInvocation:return!0;case aJ.Close:case aJ.Sequence:case aJ.Ping:case aJ.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:aJ.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}},cJ=class{constructor(e,t,n,r){this._message=e,this._id=t,this._resolver=n,this._rejector=r}},lJ=30*1e3,uJ=15*1e3,dJ=1e5,fJ;(function(e){e.Disconnected=`Disconnected`,e.Connecting=`Connecting`,e.Connected=`Connected`,e.Disconnecting=`Disconnecting`,e.Reconnecting=`Reconnecting`})(fJ||={});var pJ=class e{static create(t,n,r,i,a,o,s){return new e(t,n,r,i,a,o,s)}constructor(e,t,n,r,i,a,o){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(J.Warning,`The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep`)},Lq.isRequired(e,`connection`),Lq.isRequired(t,`logger`),Lq.isRequired(n,`protocol`),this.serverTimeoutInMilliseconds=i??lJ,this.keepAliveIntervalInMilliseconds=a??uJ,this._statefulReconnectBufferSize=o??dJ,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new iJ,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=fJ.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:aJ.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||``}set baseUrl(e){if(this._connectionState!==fJ.Disconnected&&this._connectionState!==fJ.Reconnecting)throw Error(`The HubConnection must be in the Disconnected or Reconnecting state to change the url.`);if(!e)throw Error(`The HubConnection url must be a valid url.`);this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==fJ.Disconnected)return Promise.reject(Error(`Cannot start a HubConnection that is not in the 'Disconnected' state.`));this._connectionState=fJ.Connecting,this._logger.log(J.Debug,`Starting HubConnection.`);try{await this._startInternal(),Rq.isBrowser&&window.document.addEventListener(`freeze`,this._freezeEventListener),this._connectionState=fJ.Connected,this._connectionStarted=!0,this._logger.log(J.Debug,`HubConnection connected successfully.`)}catch(e){return this._connectionState=fJ.Disconnected,this._logger.log(J.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;let e=new Promise((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t});await this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);let n={protocol:this._protocol.name,version:t};if(this._logger.log(J.Debug,`Sending handshake request.`),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),this._logger.log(J.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new sJ(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(J.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){let e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===fJ.Disconnected)return this._logger.log(J.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===fJ.Disconnecting)return this._logger.log(J.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;let t=this._connectionState;return this._connectionState=fJ.Disconnecting,this._logger.log(J.Debug,`Stopping HubConnection.`),this._reconnectDelayHandle?(this._logger.log(J.Debug,`Connection stopped during reconnect delay. Done reconnecting.`),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===fJ.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Dq(`The connection was stopped before the hub handshake could complete.`),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...t){let[n,r]=this._replaceStreamingParams(t),i=this._createStreamInvocation(e,t,r),a,o=new oJ;return o.cancelCallback=()=>{let e=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],a.then(()=>this._sendWithProtocol(e))},this._callbacks[i.invocationId]=(e,t)=>{if(t){o.error(t);return}else e&&(e.type===aJ.Completion?e.error?o.error(Error(e.error)):o.complete():o.next(e.item))},a=this._sendWithProtocol(i).catch(e=>{o.error(e),delete this._callbacks[i.invocationId]}),this._launchStreams(n,a),o}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){let[n,r]=this._replaceStreamingParams(t),i=this._sendWithProtocol(this._createInvocation(e,t,!0,r));return this._launchStreams(n,i),i}invoke(e,...t){let[n,r]=this._replaceStreamingParams(t),i=this._createInvocation(e,t,!1,r);return new Promise((e,t)=>{this._callbacks[i.invocationId]=(n,r)=>{if(r){t(r);return}else n&&(n.type===aJ.Completion?n.error?t(Error(n.error)):e(n.result):t(Error(`Unexpected message type: ${n.type}`)))};let r=this._sendWithProtocol(i).catch(e=>{t(e),delete this._callbacks[i.invocationId]});this._launchStreams(n,r)})}on(e,t){!e||!t||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();let n=this._methods[e];if(n)if(t){let r=n.indexOf(t);r!==-1&&(n.splice(r,1),n.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||=(e=this._processHandshakeResponse(e),!0),e){let t=this._protocol.parseMessages(e,this._logger);for(let e of t)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(e)))switch(e.type){case aJ.Invocation:this._invokeClientMethod(e).catch(e=>{this._logger.log(J.Error,`Invoke client method threw error: ${Zq(e)}`)});break;case aJ.StreamItem:case aJ.Completion:{let t=this._callbacks[e.invocationId];if(t){e.type===aJ.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(J.Error,`Stream callback threw error: ${Zq(e)}`)}}break}case aJ.Ping:break;case aJ.Close:{this._logger.log(J.Information,`Close message received from server.`);let t=e.error?Error(`Server returned an error on close: `+e.error):void 0;e.allowReconnect===!0?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}case aJ.Ack:this._messageBuffer&&this._messageBuffer._ack(e);break;case aJ.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(e);break;default:this._logger.log(J.Warning,`Invalid message type: ${e.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){let t=`Error parsing handshake response: `+e;this._logger.log(J.Error,t);let n=Error(t);throw this._handshakeRejecter(n),n}if(t.error){let e=`Server returned handshake error: `+t.error;this._logger.log(J.Error,e);let n=Error(e);throw this._handshakeRejecter(n),n}else this._logger.log(J.Debug,`Server handshake complete.`);return this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!this.connection.features||!this.connection.features.inherentKeepAlive){this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds);let e=this._nextKeepAlive-new Date().getTime();if(e<0){this._connectionState===fJ.Connected&&this._trySendPingMessage();return}this._pingServerHandle===void 0&&(e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{this._connectionState===fJ.Connected&&await this._trySendPingMessage()},e))}}serverTimeout(){this.connection.stop(Error(`Server timeout elapsed without receiving a message from the server.`))}async _invokeClientMethod(e){let t=e.target.toLowerCase(),n=this._methods[t];if(!n){this._logger.log(J.Warning,`No client method with the name '${t}' found.`),e.invocationId&&(this._logger.log(J.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,`Client didn't provide a result.`,null)));return}let r=n.slice(),i=!!e.invocationId,a,o,s;for(let n of r)try{let r=a;a=await n.apply(this,e.arguments),i&&a&&r&&(this._logger.log(J.Error,`Multiple results provided for '${t}'. Sending error to server.`),s=this._createCompletionMessage(e.invocationId,`Client provided multiple results.`,null)),o=void 0}catch(e){o=e,this._logger.log(J.Error,`A callback for the method '${t}' threw error '${e}'.`)}s?await this._sendWithProtocol(s):i?(o?s=this._createCompletionMessage(e.invocationId,`${o}`,null):a===void 0?(this._logger.log(J.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),s=this._createCompletionMessage(e.invocationId,`Client didn't provide a result.`,null)):s=this._createCompletionMessage(e.invocationId,null,a),await this._sendWithProtocol(s)):a&&this._logger.log(J.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(J.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Dq(`The underlying connection was closed before the hub handshake could complete.`),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||Error(`Invocation canceled due to the underlying connection being closed.`)),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===fJ.Disconnecting?this._completeClose(e):this._connectionState===fJ.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===fJ.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=fJ.Disconnected,this._connectionStarted=!1,this._messageBuffer&&=(this._messageBuffer._dispose(e??Error(`Connection closed.`)),void 0),Rq.isBrowser&&window.document.removeEventListener(`freeze`,this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(J.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){let t=Date.now(),n=0,r=e===void 0?Error(`Attempting to reconnect due to a unknown error.`):e,i=this._getNextRetryDelay(n,0,r);if(i===null){this._logger.log(J.Debug,`Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.`),this._completeClose(e);return}if(this._connectionState=fJ.Reconnecting,e?this._logger.log(J.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(J.Information,`Connection reconnecting.`),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(J.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==fJ.Reconnecting){this._logger.log(J.Debug,`Connection left the reconnecting state in onreconnecting callback. Done reconnecting.`);return}}for(;i!==null;){if(this._logger.log(J.Information,`Reconnect attempt number ${n+1} will start in ${i} ms.`),await new Promise(e=>{this._reconnectDelayHandle=setTimeout(e,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==fJ.Reconnecting){this._logger.log(J.Debug,`Connection left the reconnecting state during reconnect delay. Done reconnecting.`);return}try{if(await this._startInternal(),this._connectionState=fJ.Connected,this._logger.log(J.Information,`HubConnection reconnected successfully.`),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(e=>e.apply(this,[this.connection.connectionId]))}catch(e){this._logger.log(J.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(J.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==fJ.Reconnecting){this._logger.log(J.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===fJ.Disconnecting&&this._completeClose();return}n++,r=e instanceof Error?e:Error(e.toString()),i=this._getNextRetryDelay(n,Date.now()-t,r)}}this._logger.log(J.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(n){return this._logger.log(J.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){let t=this._callbacks;this._callbacks={},Object.keys(t).forEach(n=>{let r=t[n];try{r(null,e)}catch(t){this._logger.log(J.Error,`Stream 'error' callback called with '${e}' threw error: ${Zq(t)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&=(clearTimeout(this._pingServerHandle),void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,r){if(n)return r.length===0?{target:e,arguments:t,type:aJ.Invocation}:{target:e,arguments:t,streamIds:r,type:aJ.Invocation};{let n=this._invocationId;return this._invocationId++,r.length===0?{target:e,arguments:t,invocationId:n.toString(),type:aJ.Invocation}:{target:e,arguments:t,invocationId:n.toString(),streamIds:r,type:aJ.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||=Promise.resolve();for(let n in e)e[n].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n)))},error:e=>{let r;r=e instanceof Error?e.message:e&&e.toString?e.toString():`Unknown error`,t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n,r)))},next:e=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(n,e)))}})}}_replaceStreamingParams(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if(this._isObservable(i)){let a=this._invocationId;this._invocationId++,t[a]=i,n.push(a.toString()),e.splice(r,1)}}return[t,n]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe==`function`}_createStreamInvocation(e,t,n){let r=this._invocationId;return this._invocationId++,n.length===0?{target:e,arguments:t,invocationId:r.toString(),type:aJ.StreamInvocation}:{target:e,arguments:t,invocationId:r.toString(),streamIds:n,type:aJ.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:aJ.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:aJ.StreamItem}}_createCompletionMessage(e,t,n){return t?{error:t,invocationId:e,type:aJ.Completion}:{invocationId:e,result:n,type:aJ.Completion}}_createCloseMessage(){return{type:aJ.Close}}async _trySendPingMessage(){try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}},mJ=[0,2e3,1e4,3e4,null],hJ=class{constructor(e){this._retryDelays=e===void 0?mJ:[...e,null]}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}},gJ=class{};gJ.Authorization=`Authorization`,gJ.Cookie=`Cookie`;var _J=class extends Pq{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}async send(e){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf(`/negotiate?`)>0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);let n=await this._innerClient.send(e);return t&&n.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):n}_setAuthorizationHeader(e){e.headers||={},this._accessToken?e.headers[gJ.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[gJ.Authorization]&&delete e.headers[gJ.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}},vJ;(function(e){e[e.None=0]=`None`,e[e.WebSockets=1]=`WebSockets`,e[e.ServerSentEvents=2]=`ServerSentEvents`,e[e.LongPolling=4]=`LongPolling`})(vJ||={});var yJ;(function(e){e[e.Text=1]=`Text`,e[e.Binary=2]=`Binary`})(yJ||={});var bJ=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}},xJ=class{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new bJ,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if(Lq.isRequired(e,`url`),Lq.isRequired(t,`transferFormat`),Lq.isIn(t,yJ,`transferFormat`),this._url=e,this._logger.log(J.Trace,`(LongPolling transport) Connecting.`),t===yJ.Binary&&typeof XMLHttpRequest<`u`&&typeof new XMLHttpRequest().responseType!=`string`)throw Error(`Binary protocols over XmlHttpRequest not implementing advanced features are not supported.`);let[n,r]=Kq(),i={[n]:r,...this._options.headers},a={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};t===yJ.Binary&&(a.responseType=`arraybuffer`);let o=`${e}&_=${Date.now()}`;this._logger.log(J.Trace,`(LongPolling transport) polling: ${o}.`);let s=await this._httpClient.get(o,a);s.statusCode===200?this._running=!0:(this._logger.log(J.Error,`(LongPolling transport) Unexpected response code: ${s.statusCode}.`),this._closeError=new Tq(s.statusText||``,s.statusCode),this._running=!1),this._receiving=this._poll(this._url,a)}async _poll(e,t){try{for(;this._running;)try{let n=`${e}&_=${Date.now()}`;this._logger.log(J.Trace,`(LongPolling transport) polling: ${n}.`);let r=await this._httpClient.get(n,t);r.statusCode===204?(this._logger.log(J.Information,`(LongPolling transport) Poll terminated by server.`),this._running=!1):r.statusCode===200?r.content?(this._logger.log(J.Trace,`(LongPolling transport) data received. ${zq(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(J.Trace,`(LongPolling transport) Poll timed out, reissuing.`):(this._logger.log(J.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new Tq(r.statusText||``,r.statusCode),this._running=!1)}catch(e){this._running?e instanceof Eq?this._logger.log(J.Trace,`(LongPolling transport) Poll timed out, reissuing.`):(this._closeError=e,this._running=!1):this._logger.log(J.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(J.Trace,`(LongPolling transport) Polling complete.`),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Hq(this._logger,`LongPolling`,this._httpClient,this._url,e,this._options):Promise.reject(Error(`Cannot send until the transport is connected`))}async stop(){this._logger.log(J.Trace,`(LongPolling transport) Stopping polling.`),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(J.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);let e={},[t,n]=Kq();e[t]=n;let r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials},i;try{await this._httpClient.delete(this._url,r)}catch(e){i=e}i?i instanceof Tq&&(i.statusCode===404?this._logger.log(J.Trace,`(LongPolling transport) A 404 response was returned from sending a DELETE request.`):this._logger.log(J.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(J.Trace,`(LongPolling transport) DELETE request accepted.`)}finally{this._logger.log(J.Trace,`(LongPolling transport) Stop finished.`),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e=`(LongPolling transport) Firing onclose event.`;this._closeError&&(e+=` Error: `+this._closeError),this._logger.log(J.Trace,e),this.onclose(this._closeError)}}},SJ=class{constructor(e,t,n,r){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,t){return Lq.isRequired(e,`url`),Lq.isRequired(t,`transferFormat`),Lq.isIn(t,yJ,`transferFormat`),this._logger.log(J.Trace,`(SSE transport) Connecting.`),this._url=e,this._accessToken&&(e+=(e.indexOf(`?`)<0?`?`:`&`)+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((n,r)=>{let i=!1;if(t!==yJ.Text){r(Error(`The Server-Sent Events transport only supports the 'Text' transfer format`));return}let a;if(Rq.isBrowser||Rq.isWebWorker)a=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{let t=this._httpClient.getCookieString(e),n={};n.Cookie=t;let[r,i]=Kq();n[r]=i,a=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...n,...this._options.headers}})}try{a.onmessage=e=>{if(this.onreceive)try{this._logger.log(J.Trace,`(SSE transport) data received. ${zq(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){this._close(e);return}},a.onerror=e=>{i?this._close():r(Error(`EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled.`))},a.onopen=()=>{this._logger.log(J.Information,`SSE connected to ${this._url}`),this._eventSource=a,i=!0,n()}}catch(e){r(e);return}})}async send(e){return this._eventSource?Hq(this._logger,`SSE`,this._httpClient,this._url,e,this._options):Promise.reject(Error(`Cannot send until the transport is connected`))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}},CJ=class{constructor(e,t,n,r,i,a){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=a}async connect(e,t){Lq.isRequired(e,`url`),Lq.isRequired(t,`transferFormat`),Lq.isIn(t,yJ,`transferFormat`),this._logger.log(J.Trace,`(WebSockets transport) Connecting.`);let n;return this._accessTokenFactory&&(n=await this._accessTokenFactory()),new Promise((r,i)=>{e=e.replace(/^http/,`ws`);let a,o=this._httpClient.getCookieString(e),s=!1;if(Rq.isNode||Rq.isReactNative){let t={},[r,i]=Kq();t[r]=i,n&&(t[gJ.Authorization]=`Bearer ${n}`),o&&(t[gJ.Cookie]=o),a=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}else n&&(e+=(e.indexOf(`?`)<0?`?`:`&`)+`access_token=${encodeURIComponent(n)}`);a||=new this._webSocketConstructor(e),t===yJ.Binary&&(a.binaryType=`arraybuffer`),a.onopen=t=>{this._logger.log(J.Information,`WebSocket connected to ${e}.`),this._webSocket=a,s=!0,r()},a.onerror=e=>{let t=null;t=typeof ErrorEvent<`u`&&e instanceof ErrorEvent?e.error:`There was an error with the transport`,this._logger.log(J.Information,`(WebSockets transport) ${t}.`)},a.onmessage=e=>{if(this._logger.log(J.Trace,`(WebSockets transport) data received. ${zq(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){this._close(e);return}},a.onclose=e=>{if(s)this._close(e);else{let t=null;t=typeof ErrorEvent<`u`&&e instanceof ErrorEvent?e.error:`WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.`,i(Error(t))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(J.Trace,`(WebSockets transport) sending data. ${zq(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject(`WebSocket is not in the OPEN state`)}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&=(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),void 0),this._logger.log(J.Trace,`(WebSockets transport) socket closed.`),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(Error(`WebSocket closed with status code: ${e.code} (${e.reason||`no reason given`}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean==`boolean`&&typeof e.code==`number`}},wJ=100,TJ=class{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Lq.isRequired(e,`url`),this._logger=Uq(t.logger),this.baseUrl=this._resolveUrl(e),t||={},t.logMessageContent=t.logMessageContent===void 0?!1:t.logMessageContent,typeof t.withCredentials==`boolean`||t.withCredentials===void 0)t.withCredentials=t.withCredentials===void 0?!0:t.withCredentials;else throw Error(`withCredentials option was not a 'boolean' or 'undefined' value`);t.timeout=t.timeout===void 0?100*1e3:t.timeout;let n=null,r=null;if(Rq.isNode&&typeof require<`u`){let e=typeof __webpack_require__==`function`?__non_webpack_require__:require;n=e(`ws`),r=e(`eventsource`)}!Rq.isNode&&typeof WebSocket<`u`&&!t.WebSocket?t.WebSocket=WebSocket:Rq.isNode&&!t.WebSocket&&n&&(t.WebSocket=n),!Rq.isNode&&typeof EventSource<`u`&&!t.EventSource?t.EventSource=EventSource:Rq.isNode&&!t.EventSource&&r!==void 0&&(t.EventSource=r),this._httpClient=new _J(t.httpClient||new nJ(this._logger),t.accessTokenFactory),this._connectionState=`Disconnected`,this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e||=yJ.Binary,Lq.isIn(e,yJ,`transferFormat`),this._logger.log(J.Debug,`Starting connection with transfer format '${yJ[e]}'.`),this._connectionState!==`Disconnected`)return Promise.reject(Error(`Cannot start an HttpConnection that is not in the 'Disconnected' state.`));if(this._connectionState=`Connecting`,this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,this._connectionState===`Disconnecting`){let e=`Failed to start the HttpConnection before stop() was called.`;return this._logger.log(J.Error,e),await this._stopPromise,Promise.reject(new Dq(e))}else if(this._connectionState!==`Connected`){let e=`HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!`;return this._logger.log(J.Error,e),Promise.reject(new Dq(e))}this._connectionStarted=!0}send(e){return this._connectionState===`Connected`?(this._sendQueue||=new DJ(this.transport),this._sendQueue.send(e)):Promise.reject(Error(`Cannot send data if the connection is not in the 'Connected' State.`))}async stop(e){if(this._connectionState===`Disconnected`)return this._logger.log(J.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState===`Disconnecting`)return this._logger.log(J.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState=`Disconnecting`,this._stopPromise=new Promise(e=>{this._stopPromiseResolver=e}),await this._stopInternal(e),await this._stopPromise}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(J.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(J.Debug,`HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.`)}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===vJ.WebSockets)this.transport=this._constructTransport(vJ.WebSockets),await this._startTransport(t,e);else throw Error(`Negotiation can only be skipped when using the WebSocket transport directly.`);else{let n=null,r=0;do{if(n=await this._getNegotiationResponse(t),this._connectionState===`Disconnecting`||this._connectionState===`Disconnected`)throw new Dq(`The connection was stopped during negotiation.`);if(n.error)throw Error(n.error);if(n.ProtocolVersion)throw Error(`Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.`);if(n.url&&(t=n.url),n.accessToken){let e=n.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}r++}while(n.url&&r<wJ);if(r===wJ&&n.url)throw Error(`Negotiate redirection limit exceeded.`);await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof xJ&&(this.features.inherentKeepAlive=!0),this._connectionState===`Connecting`&&(this._logger.log(J.Debug,`The HttpConnection connected successfully.`),this._connectionState=`Connected`)}catch(e){return this._logger.log(J.Error,`Failed to start the connection: `+e),this._connectionState=`Disconnected`,this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){let t={},[n,r]=Kq();t[n]=r;let i=this._resolveNegotiateUrl(e);this._logger.log(J.Debug,`Sending negotiation request: ${i}.`);try{let e=await this._httpClient.post(i,{content:``,headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(e.statusCode!==200)return Promise.reject(Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));let n=JSON.parse(e.content);return(!n.negotiateVersion||n.negotiateVersion<1)&&(n.connectionToken=n.connectionId),n.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new jq(`Client didn't negotiate Stateful Reconnect but the server did.`)):n}catch(e){let t=`Failed to complete negotiation with the server: `+e;return e instanceof Tq&&e.statusCode===404&&(t+=` Either this is not a SignalR endpoint or there is a proxy blocking the connection.`),this._logger.log(J.Error,t),Promise.reject(new jq(t))}}_createConnectUrl(e,t){return t?e+(e.indexOf(`?`)===-1?`?`:`&`)+`id=${t}`:e}async _createTransport(e,t,n,r){let i=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t)){this._logger.log(J.Debug,`Connection was provided an instance of ITransport, using that directly.`),this.transport=t,await this._startTransport(i,r),this.connectionId=n.connectionId;return}let a=[],o=n.availableTransports||[],s=n;for(let n of o){let o=this._resolveTransportOrError(n,t,r,s?.useStatefulReconnect===!0);if(o instanceof Error)a.push(`${n.transport} failed:`),a.push(o);else if(this._isITransport(o)){if(this.transport=o,!s){try{s=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}i=this._createConnectUrl(e,s.connectionToken)}try{await this._startTransport(i,r),this.connectionId=s.connectionId;return}catch(e){if(this._logger.log(J.Error,`Failed to start the transport '${n.transport}': ${e}`),s=void 0,a.push(new Aq(`${n.transport} failed: ${e}`,vJ[n.transport])),this._connectionState!==`Connecting`){let e=`Failed to select transport before stop() was called.`;return this._logger.log(J.Debug,e),Promise.reject(new Dq(e))}}}}return a.length>0?Promise.reject(new Mq(`Unable to connect to the server with any of the available transports. ${a.join(` `)}`,a)):Promise.reject(Error(`None of the transports supported by the client are supported by the server.`))}_constructTransport(e){switch(e){case vJ.WebSockets:if(!this._options.WebSocket)throw Error(`'WebSocket' is not supported in your environment.`);return new CJ(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case vJ.ServerSentEvents:if(!this._options.EventSource)throw Error(`'EventSource' is not supported in your environment.`);return new SJ(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case vJ.LongPolling:return new xJ(this._httpClient,this._logger,this._options);default:throw Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async n=>{let r=!1;if(this.features.reconnect)try{this.features.disconnected(),await this.transport.connect(e,t),await this.features.resend()}catch{r=!0}else{this._stopConnection(n);return}r&&this._stopConnection(n)}:this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n,r){let i=vJ[e.transport];if(i==null)return this._logger.log(J.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(EJ(t,i))if(e.transferFormats.map(e=>yJ[e]).indexOf(n)>=0){if(i===vJ.WebSockets&&!this._options.WebSocket||i===vJ.ServerSentEvents&&!this._options.EventSource)return this._logger.log(J.Debug,`Skipping transport '${vJ[i]}' because it is not supported in your environment.'`),new Oq(`'${vJ[i]}' is not supported in your environment.`,i);this._logger.log(J.Debug,`Selecting transport '${vJ[i]}'.`);try{return this.features.reconnect=i===vJ.WebSockets?r:void 0,this._constructTransport(i)}catch(e){return e}}else return this._logger.log(J.Debug,`Skipping transport '${vJ[i]}' because it does not support the requested transfer format '${yJ[n]}'.`),Error(`'${vJ[i]}' does not support ${yJ[n]}.`);else return this._logger.log(J.Debug,`Skipping transport '${vJ[i]}' because it was disabled by the client.`),new kq(`'${vJ[i]}' is disabled by the client.`,i)}_isITransport(e){return e&&typeof e==`object`&&`connect`in e}_stopConnection(e){if(this._logger.log(J.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState===`Disconnected`){this._logger.log(J.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState===`Connecting`)throw this._logger.log(J.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState===`Disconnecting`&&this._stopPromiseResolver(),e?this._logger.log(J.Error,`Connection disconnected with error '${e}'.`):this._logger.log(J.Information,`Connection disconnected.`),this._sendQueue&&=(this._sendQueue.stop().catch(e=>{this._logger.log(J.Error,`TransportSendQueue.stop() threw error '${e}'.`)}),void 0),this.connectionId=void 0,this._connectionState=`Disconnected`,this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(J.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}_resolveUrl(e){if(e.lastIndexOf(`https://`,0)===0||e.lastIndexOf(`http://`,0)===0)return e;if(!Rq.isBrowser)throw Error(`Cannot resolve '${e}'.`);let t=window.document.createElement(`a`);return t.href=e,this._logger.log(J.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){let t=new URL(e);t.pathname.endsWith(`/`)?t.pathname+=`negotiate`:t.pathname+=`/negotiate`;let n=new URLSearchParams(t.searchParams);return n.has(`negotiateVersion`)||n.append(`negotiateVersion`,this._negotiateVersion.toString()),n.has(`useStatefulReconnect`)?n.get(`useStatefulReconnect`)===`true`&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&n.append(`useStatefulReconnect`,`true`),t.search=n.toString(),t.toString()}};function EJ(e,t){return!e||(t&e)!==0}var DJ=class e{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new OJ,this._transportResult=new OJ,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||=new OJ,this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject(`Connection stopped.`);break}this._sendBufferedData=new OJ;let t=this._transportResult;this._transportResult=void 0;let n=typeof this._buffer[0]==`string`?this._buffer.join(``):e._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),t.resolve()}catch(e){t.reject(e)}}}static _concatBuffers(e){let t=e.map(e=>e.byteLength).reduce((e,t)=>e+t),n=new Uint8Array(t),r=0;for(let t of e)n.set(new Uint8Array(t),r),r+=t.byteLength;return n.buffer}},OJ=class{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}},kJ=`json`,AJ=class{constructor(){this.name=kJ,this.version=2,this.transferFormat=yJ.Text}parseMessages(e,t){if(typeof e!=`string`)throw Error(`Invalid input for JSON hub protocol. Expected a string.`);if(!e)return[];t===null&&(t=Fq.instance);let n=rJ.parse(e),r=[];for(let e of n){let n=JSON.parse(e);if(typeof n.type!=`number`)throw Error(`Invalid payload.`);switch(n.type){case aJ.Invocation:this._isInvocationMessage(n);break;case aJ.StreamItem:this._isStreamItemMessage(n);break;case aJ.Completion:this._isCompletionMessage(n);break;case aJ.Ping:break;case aJ.Close:break;case aJ.Ack:this._isAckMessage(n);break;case aJ.Sequence:this._isSequenceMessage(n);break;default:t.log(J.Information,`Unknown message type '`+n.type+`' ignored.`);continue}r.push(n)}return r}writeMessage(e){return rJ.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,`Invalid payload for Invocation message.`),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,`Invalid payload for Invocation message.`)}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,`Invalid payload for StreamItem message.`),e.item===void 0)throw Error(`Invalid payload for StreamItem message.`)}_isCompletionMessage(e){if(e.result&&e.error)throw Error(`Invalid payload for Completion message.`);!e.result&&e.error&&this._assertNotEmptyString(e.error,`Invalid payload for Completion message.`),this._assertNotEmptyString(e.invocationId,`Invalid payload for Completion message.`)}_isAckMessage(e){if(typeof e.sequenceId!=`number`)throw Error(`Invalid SequenceId for Ack message.`)}_isSequenceMessage(e){if(typeof e.sequenceId!=`number`)throw Error(`Invalid SequenceId for Sequence message.`)}_assertNotEmptyString(e,t){if(typeof e!=`string`||e===``)throw Error(t)}},jJ={trace:J.Trace,debug:J.Debug,info:J.Information,information:J.Information,warn:J.Warning,warning:J.Warning,error:J.Error,critical:J.Critical,none:J.None};function MJ(e){let t=jJ[e.toLowerCase()];if(t!==void 0)return t;throw Error(`Unknown log level: ${e}`)}var NJ=class{configureLogging(e){if(Lq.isRequired(e,`logging`),PJ(e))this.logger=e;else if(typeof e==`string`){let t=MJ(e);this.logger=new Gq(t)}else this.logger=new Gq(e);return this}withUrl(e,t){return Lq.isRequired(e,`url`),Lq.isNotEmpty(e,`url`),this.url=e,typeof t==`object`?this.httpConnectionOptions={...this.httpConnectionOptions,...t}:this.httpConnectionOptions={...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return Lq.isRequired(e,`protocol`),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw Error(`A reconnectPolicy has already been set.`);return e?Array.isArray(e)?this.reconnectPolicy=new hJ(e):this.reconnectPolicy=e:this.reconnectPolicy=new hJ,this}withServerTimeout(e){return Lq.isRequired(e,`milliseconds`),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return Lq.isRequired(e,`milliseconds`),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){let e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw Error(`The 'HubConnectionBuilder.withUrl' method must be called before building the connection.`);let t=new TJ(this.url,e);return pJ.create(t,this.logger||Fq.instance,this.protocol||new AJ,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}};function PJ(e){return e.log!==void 0}var FJ=15e3,IJ=5,LJ=(e,t=Math.random)=>{let n=Math.min(FJ,1e3*2**Math.min(Math.max(e,0),IJ));return Math.round(t()*n)},RJ=class{nextRetryDelayInMilliseconds(e){return LJ(e.previousRetryCount)}},zJ=e=>({log(t,n){t>=J.Error?e.error(n):t>=J.Warning?e.warn(n):e.debug(n)}}),BJ=e=>{switch(e){case fJ.Connected:return`connected`;case fJ.Connecting:return`connecting`;case fJ.Reconnecting:return`reconnecting`;case fJ.Disconnected:case fJ.Disconnecting:return`disconnected`;default:return`disconnected`}},VJ=class{connection;logger;statusHandlers=new Set;starting=null;intentionallyStopped=!0;reconnectTimer=null;reconnectAttempt=0;constructor(e,t){this.logger=t.child(`realtime`),this.connection=new NJ().withUrl(e.url,{accessTokenFactory:()=>e.accessTokenProvider()??``}).withAutomaticReconnect(new RJ).configureLogging(zJ(this.logger)).build(),this.connection.onreconnecting(()=>{this.emitStatus(`reconnecting`)}),this.connection.onreconnected(()=>{this.reconnectAttempt=0,this.emitStatus(`connected`)}),this.connection.onclose(()=>{this.emitStatus(`disconnected`),this.scheduleReconnect()})}get status(){return BJ(this.connection.state)}async start(){if(this.intentionallyStopped=!1,this.clearReconnectTimer(),this.connection.state===fJ.Disconnecting)for(;this.connection.state===fJ.Disconnecting;)await new Promise(e=>setTimeout(e,50));if(this.connection.state===fJ.Disconnected)return this.starting===null?(this.emitStatus(`connecting`),this.starting=this.connection.start().then(()=>{this.reconnectAttempt=0,this.emitStatus(`connected`)}).catch(e=>{throw this.emitStatus(`disconnected`),this.logger.warn(`Realtime connection failed to start`),e}).finally(()=>{this.starting=null}),this.starting):this.starting}async stop(){this.intentionallyStopped=!0,this.clearReconnectTimer(),await this.connection.stop(),this.emitStatus(`disconnected`)}on(e,t){let n=e=>{t(e)};return this.connection.on(e,n),()=>{this.connection.off(e,n)}}invoke(e,...t){return this.connection.invoke(e,...t)}onStatusChange(e){return this.statusHandlers.add(e),e(this.status),()=>{this.statusHandlers.delete(e)}}scheduleReconnect(){if(this.intentionallyStopped)return;this.clearReconnectTimer();let e=LJ(this.reconnectAttempt);this.reconnectAttempt+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectNow()},e)}async reconnectNow(){if(this.reconnectTimer=null,!(this.intentionallyStopped||this.connection.state!==fJ.Disconnected)){if(!this.isOnline()){this.scheduleReconnect();return}this.emitStatus(`reconnecting`);try{await this.connection.start(),this.reconnectAttempt=0,this.emitStatus(`connected`)}catch{this.emitStatus(`disconnected`),this.scheduleReconnect()}}}clearReconnectTimer(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}isOnline(){return typeof navigator>`u`?!0:navigator.onLine}emitStatus(e){for(let t of this.statusHandlers)t(e)}},HJ=class{logger;constructor(e){this.logger=e.logger}create(e){return new VJ(e,this.logger)}},UJ=class{status=`disconnected`;async start(){return Promise.resolve()}async stop(){return Promise.resolve()}on(e,t){return()=>{}}async invoke(e,...t){return Promise.reject(Error(`Cannot invoke method on NullRealtimeConnection`))}onStatusChange(e){return()=>{}}},WJ=class{moduleAccessGateway;logger;constructor(e){this.moduleAccessGateway=e.moduleAccessGateway,this.logger=e.logger.child(`get-module-access`)}async execute(){let e=await this.moduleAccessGateway.getModuleAccess();return e.ok||this.logger.warn(`Loading module access failed`,{code:e.error.code}),e}},GJ=`/api/app/sdk-capabilities`,KJ=G({apiVersion:V(),modules:W(V())}),qJ=e=>{let t=new Set;for(let n of e.modules)_q(n)&&t.add(gq[n]);return{grantedModules:t,grantedPolicies:new Set,canManageUserAccess:!1}},JJ=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`sdk-module-access`)}async getModuleAccess(){let e;try{e=await this.httpClient.get(GJ)}catch(e){return this.logger.error(`Failed to fetch SDK capabilities`,{error:e}),N(new mq(e))}let t=KJ.safeParse(e);return t.success?M(qJ(t.data)):(this.logger.error(`Malformed capabilities response`,{error:t.error}),N(new mq(t.error)))}},YJ=e=>({getModuleAccess:new WJ({moduleAccessGateway:new JJ({httpClient:e.httpClient,logger:e.logger}),logger:e.logger}),gateMode:`fail-closed`}),XJ=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`list-conversations`)}async execute(e){let t=await this.chatGateway.listConversations(e);return t.ok||this.logger.warn(`Listing conversations failed`,{code:t.error.code}),t}},ZJ=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-conversation`)}async execute(e){let t=await this.chatGateway.getConversation(e);return t.ok||this.logger.warn(`Fetching conversation failed`,{code:t.error.code}),t}},QJ=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-conversation-counts`)}async execute(){let e=await this.chatGateway.getConversationCounts();return e.ok||this.logger.warn(`Fetching conversation counts failed`,{code:e.error.code}),e}},$J=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`list-staff`)}async execute(e){let t=await this.chatGateway.listStaff(e);return t.ok||this.logger.warn(`Listing staff failed`,{code:t.error.code}),t}},eY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-group-member-pool`)}async execute(e){let t=await this.chatGateway.getGroupMemberPool(e);return t.ok||this.logger.warn(`Fetching the group member pool failed`,{code:t.error.code}),t}},tY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-viewer`)}async execute(){let e=await this.chatGateway.getViewer();return e.ok||this.logger.warn(`Loading viewer failed`,{code:e.error.code}),e}},nY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-messages`)}async execute(e){let t=await this.chatGateway.getMessages(e,50);return t.ok||this.logger.warn(`Loading messages failed`,{code:t.error.code}),t}},rY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-messages-since`)}async execute(e,t,n){let r=await this.chatGateway.getMessagesSince(e,t,n);return r.ok||this.logger.warn(`Loading messages since cursor failed`,{code:r.error.code}),r}},iY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-messages-before`)}async execute(e,t,n){let r=await this.chatGateway.getMessagesBefore(e,t,n);return r.ok||this.logger.warn(`Loading messages before cursor failed`,{code:r.error.code}),r}},aY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`start-direct`)}async execute(e){let t=e.trim();return t.length===0?(this.logger.warn(`Rejected start-direct with no recipient`),N(new TP)):this.chatGateway.startDirect(t)}},oY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`create-group`)}async execute(e,t){let n=e.trim();return n.length===0?(this.logger.warn(`Rejected group with no title`),N(new CP)):t.length===0?(this.logger.warn(`Rejected group with no members`),N(new wP)):this.chatGateway.createGroup(n,t)}},sY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`send-message`)}async execute(e,t,n,r){let i=t.trim();return i.length===0?(this.logger.warn(`Rejected empty message`,{conversationId:e}),N(new xP)):i.length>4e3?(this.logger.warn(`Rejected oversized message`,{conversationId:e}),N(new SP(4e3))):this.chatGateway.sendMessage(e,i,n,r)}},cY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`mark-delivered`)}execute(e,t){return this.logger.debug(`Mark delivered`,{conversationId:e,uptoSequence:t}),this.chatGateway.markDelivered(e,t)}},lY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`mark-read`)}execute(e,t){return this.logger.debug(`Mark read`,{conversationId:e,uptoSequence:t}),this.chatGateway.markRead(e,t)}},uY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`set-favourite`)}async execute(e,t){return this.logger.info(`Set favourite`,{conversationId:e,favourite:t}),this.chatGateway.setFavourite(e,t)}},dY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`set-archived`)}async execute(e,t){return this.logger.info(`Set archived`,{conversationId:e,archived:t}),this.chatGateway.setArchived(e,t)}},fY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`set-pinned`)}async execute(e,t){return this.logger.info(`Set pinned`,{conversationId:e,pinned:t}),this.chatGateway.setPinned(e,t)}},pY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`delete-conversation`)}async execute(e){return this.logger.info(`Delete conversation`,{conversationId:e}),this.chatGateway.deleteConversation(e)}},mY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`leave-conversation`)}async execute(e){return this.logger.info(`Leave conversation`,{conversationId:e}),this.chatGateway.leaveConversation(e)}},hY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`refresh-portal`)}async execute(e){return this.logger.info(`Refresh portal data`,{conversationId:e}),this.chatGateway.refreshPortal(e)}},gY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`react-to-message`)}async execute(e,t,n){return n.trim().length===0?(this.logger.warn(`Rejected empty reaction`,{conversationId:e,messageId:t}),N(new bP)):this.chatGateway.reactToMessage(e,t,n)}},_Y=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`save-members`)}async execute(e,t,n){return this.logger.info(`Save members`,{conversationId:e,members:t.length,admins:n.length}),this.chatGateway.saveMembers(e,t,n)}},vY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`edit-message`)}async execute(e,t,n){let r=n.trim(),i=await this.chatGateway.editMessage(e,t,r);return i.ok||this.logger.warn(`Edit message failed`,{code:i.error.code}),i}},yY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`delete-message`)}async execute(e,t){let n=await this.chatGateway.deleteMessage(e,t);return n.ok||this.logger.warn(`Delete message failed`,{code:n.error.code}),n}},bY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`delete-message-for-me`)}async execute(e,t){let n=await this.chatGateway.deleteMessageForMe(e,t);return n.ok||this.logger.warn(`Delete message for me failed`,{code:n.error.code}),n}},xY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`send-media-message`)}async execute(e){let t=await this.chatGateway.sendMediaMessage(e);return t.ok||this.logger.warn(`Send media message failed`,{code:t.error.code}),t}},SY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`download-chat-media`)}async execute(e){let t=await this.chatGateway.downloadMedia(e);return t.ok||this.logger.warn(`Downloading media failed`,{code:t.error.code}),t}},CY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`subscribe-push`)}async execute(e){let t=await this.chatGateway.subscribePush(e);return t.ok||this.logger.warn(`Subscribe push failed`,{code:t.error.code}),t}},wY=e=>{let t={chatGateway:new cG({httpClient:e.httpClient,clock:e.clock,logger:e.logger}),logger:e.logger},n=bG();return{listConversations:new XJ(t),getConversation:new ZJ(t),getConversationCounts:new QJ(t),listStaff:new $J(t),getGroupMemberPool:new eY(t),getViewer:new tY(t),getMessages:new nY(t),getMessagesSince:new rY(t),getMessagesBefore:new iY(t),startDirect:new aY(t),createGroup:new oY(t),sendMessage:new sY(t),sendMediaMessage:new xY(t),downloadChatMedia:new SY(t),editMessage:new vY(t),deleteMessage:new yY(t),deleteMessageForMe:new bY(t),subscribePush:new CY(t),markDelivered:new cY(t),markRead:new lY(t),setFavourite:new uY(t),setArchived:new dY(t),setPinned:new fY(t),deleteConversation:new pY(t),leaveConversation:new mY(t),refreshPortal:new hY(t),reactToMessage:new gY(t),saveMembers:new _Y(t),clock:e.clock,realtime:e.realtime,realtimeStore:hP(),logger:e.logger.child(`chat-realtime`),outbox:n}},TY=({module:e,children:t})=>(0,D.jsx)(IP.Provider,{value:e,children:(0,D.jsx)(gP.Provider,{value:e.realtimeStore,children:t})}),EY=e=>e.connection.on(xG.MessageReceived,t=>{let n=jG(t,xG.MessageReceived,e.logger);if(n===null)return;let r=e.viewerId()??``,i=GG(fW(n),r);if(e.queryClient.setQueryData(cF(n.conversationId),e=>mV(e??[],i)),KP(e.queryClient),i.kind===`system`){if(i.text.endsWith(` left the group`)){let t=i.text.slice(0,-15).trim().toLowerCase();YP(e.queryClient,n.conversationId,e=>{let n=e.members.find(e=>e.name.toLowerCase()===t);return n===void 0?e:e.with({members:e.members.filter(e=>e.id!==n.id),adminIds:e.adminIds.filter(e=>e!==n.id)})})}e.queryClient.refetchQueries({queryKey:BP(n.conversationId)})}}),DY=(e,t,n)=>e.connection.on(t,r=>{let i=MG(r,t,e.logger);i===null||i.byUserId===e.viewerId()||e.store.getState().applyReceipt(i.conversationId,i.byUserId,n,i.uptoSequence)}),OY=e=>e.connection.on(xG.Typing,t=>{let n=NG(t,xG.Typing,e.logger);n===null||n.userId===e.viewerId()||e.store.getState().applyTyping(n.conversationId,n.userId,n.isTyping,Date.now())}),kY=e=>e.connection.on(xG.ReactionToggled,t=>{let n=IG(t,xG.ReactionToggled,e.logger),r=e.viewerId();n===null||n.byUserId===r||e.queryClient.setQueryData(cF(n.conversationId),e=>e?.map(e=>e.id===n.messageId?eF(e,n,r??``):e))}),AY=e=>e.connection.on(xG.MessageEdited,t=>{let n=jG(t,xG.MessageEdited,e.logger);if(n===null)return;let r=e.viewerId()??``,i=GG(fW(n),r);e.queryClient.setQueryData(cF(n.conversationId),e=>e?.map(e=>e.id===i.id?i:e)??[i])}),jY=e=>e.connection.on(xG.MessageDeleted,t=>{let n=LG(t,xG.MessageDeleted,e.logger);n!==null&&(e.queryClient.setQueryData(cF(n.conversationId),e=>e?.map(e=>e.id===n.messageId?e.asDeletedForEveryone():e)??[]),KP(e.queryClient))}),MY=e=>e.connection.on(xG.RemovedFromConversation,t=>{let n=RG(t,xG.RemovedFromConversation,e.logger);n!==null&&e.store.getState().markRemovedFromConversation(n.conversationId)}),NY=e=>e.connection.on(xG.PresenceChanged,t=>{let n=PG(t,xG.PresenceChanged,e.logger);n!==null&&e.store.getState().applyPresence(n.userId,n.online,n.lastSeenUtc)}),PY=e=>e.connection.on(xG.StatusChanged,t=>{let n=FG(t,xG.StatusChanged,e.logger);n!==null&&jR(n.userId,SR(n.status),n.untilUtc??null)}),FY=e=>{let t=[EY(e),AY(e),jY(e),DY(e,xG.MessageDelivered,`delivered`),DY(e,xG.MessageRead,`read`),OY(e),NY(e),PY(e),kY(e),MY(e)];return()=>{for(let e of t)e()}},IY=(e,t,n)=>{n.length!==0&&e.setQueryData(cF(t),e=>n.reduce((e,t)=>mV(e,t),e??[]))},LY=async(e,t,n,r)=>{let i=e.getState().activeConversationId;if(i===null){qP(t);return}let a=yV(t.getQueryData(cF(i))??[]);try{IY(t,i,await P(n.execute(i,a,50)))}catch{r.warn(`Reconnect sync failed; conversation list will still refresh`)}qP(t)},RY=()=>{let{realtime:e,getMessagesSince:t,logger:r}=LP(),i=_P(),a=sN();(0,n.useEffect)(()=>{let n=e.status;return e.onStatusChange(e=>{e===`connected`&&n!==`connected`&&LY(i,a,t,r),n=e})},[e,i,a,t,r])},zY=()=>{let{isAuthenticated:e}=_B(),{realtime:t,logger:r}=LP(),i=_P(),a=sN(),o=uF();RY();let s=(0,n.useRef)(null);s.current=o.data?.id??null,(0,n.useEffect)(()=>t.onStatusChange(e=>{i.getState().setStatus(e)}),[t,i]),(0,n.useEffect)(()=>FY({connection:t,store:i,queryClient:a,viewerId:()=>s.current,logger:r}),[t,i,a,r]),(0,n.useEffect)(()=>{if(!e){t.stop(),i.getState().clear(),NR();return}return t.start().catch(()=>{}),()=>{t.stop()}},[e,t,i])},BY=({children:e})=>(zY(),(0,D.jsx)(D.Fragment,{children:e})),VY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`list-feed`)}async execute(e){let t=await this.feedGateway.listPosts(e.scope,e.skipCount,e.maxResultCount);return t.ok||this.logger.warn(`Listing feed failed`,{code:t.error.code,scope:e.scope}),t}},HY=class extends ui{},UY=class extends HY{code=`FEED_UNAVAILABLE`;constructor(e){super(`The news feed is currently unavailable. Please try again.`,{cause:e})}},WY=class extends HY{code=`FEED_EMPTY_POST`;constructor(){super(`Write something before posting.`)}},GY=class{id;authorUserId;authorName;authorInitials;authorColor;authorRole;categoryLabel;categoryColor;audienceLabel;timestamp;createdAt;pinned;mustAcknowledge;acknowledged;title;body;reactions;myReaction;commentCount;comments;seenCount;bookmarked;taggedUserIds;locationLabel;imageUrls;department;audienceId;feelingId;feelingLabel;feelingEmoji;scheduledAt;isRecurring;recurrenceFrequency;constructor(e){this.id=e.id,this.authorUserId=e.authorUserId,this.authorName=e.authorName,this.authorInitials=e.authorInitials,this.authorColor=e.authorColor,this.authorRole=e.authorRole,this.categoryLabel=e.categoryLabel,this.categoryColor=e.categoryColor,this.audienceLabel=e.audienceLabel,this.timestamp=e.timestamp,this.createdAt=e.createdAt,this.pinned=e.pinned,this.mustAcknowledge=e.mustAcknowledge,this.acknowledged=e.acknowledged,this.title=e.title,this.body=e.body,this.reactions=e.reactions,this.myReaction=e.myReaction,this.commentCount=e.commentCount,this.comments=e.comments,this.seenCount=e.seenCount,this.bookmarked=e.bookmarked,this.taggedUserIds=e.taggedUserIds,this.locationLabel=e.locationLabel,this.imageUrls=e.imageUrls,this.department=e.department,this.audienceId=e.audienceId,this.feelingId=e.feelingId,this.feelingLabel=e.feelingLabel,this.feelingEmoji=e.feelingEmoji,this.scheduledAt=e.scheduledAt??null,this.isRecurring=e.isRecurring??!1,this.recurrenceFrequency=e.recurrenceFrequency??null}get totalReactions(){return this.reactions.like+this.reactions.insightful+this.reactions.celebrate}get needsAcknowledgement(){return this.mustAcknowledge&&!this.acknowledged}},KY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`create-post`)}async execute(e){return e.body.trim().length===0?(this.logger.warn(`Rejected empty post`),N(new WY)):this.feedGateway.createPost({...e,body:e.body.trim()})}},qY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`update-post`)}async execute(e,t){return t.body.trim().length===0?(this.logger.warn(`Rejected empty body for post update`),N(new WY)):this.feedGateway.updatePost(e,{...t,body:t.body.trim()})}},JY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`react-to-post`)}async execute(e,t){let n=await this.feedGateway.react(e,t);return n.ok||this.logger.warn(`Reacting to post failed`,{code:n.error.code}),n}},YY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`toggle-bookmark`)}async execute(e){let t=await this.feedGateway.toggleBookmark(e);return t.ok||this.logger.warn(`Bookmarking post failed`,{code:t.error.code}),t}},XY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`acknowledge-post`)}async execute(e){let t=await this.feedGateway.acknowledge(e);return t.ok||this.logger.warn(`Acknowledging post failed`,{code:t.error.code}),t}},ZY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`add-comment`)}async execute({postId:e,text:t}){if(t.trim().length===0)return this.logger.warn(`Rejected empty comment`,{postId:e}),N(new UY);let n=await this.feedGateway.addComment(e,t.trim());return n.ok||this.logger.warn(`Adding comment failed`,{code:n.error.code}),n}},QY=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.listCategories()}},$Y=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.listAudiences()}},eX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.listFeelings()}},tX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(e){return this.feedGateway.searchUsers(e)}},nX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.detectLocation()}},rX=class{gateway;logger;constructor(e){this.gateway=e.feedGateway,this.logger=e.logger.child(`upload-feed-image-use-case`)}async execute(e){return this.logger.debug(`Uploading feed image`),this.gateway.uploadImage(e)}},iX=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`mark-seen`)}async execute(e){let t=await this.feedGateway.markSeen(e);return t.ok||this.logger.warn(`Marking post as seen failed`,{code:t.error.code}),t}},aX=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`set-post-pinned`)}async execute(e,t){let n=await this.feedGateway.setPinned(e,t);return n.ok||this.logger.warn(`Pinning post failed`,{code:n.error.code,pinned:t}),n}},oX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.getNotifications()}},sX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(e){return this.feedGateway.markNotificationAsRead(e)}};function cX(e){return e.replace(/\s+(division|province|district|state|region)$/i,``).trim()}function lX(e){let t=cX(e.regionName??e.region??``),n=t.length>0?t:(e.cityName??e.city??``).trim(),r=(e.countryName??e.country_name??``).trim();return n.length>0&&r.length>0?`${n}, ${r}`:r.length>0?r:null}function uX(){try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e){let t=e.split(`/`),n=t[t.length-1];if(n)return n.replace(/_/g,` `)}}catch{}return`London Office`}async function dX(e){try{let t=await fetch(`/ip-geolocation`);if(t.ok){let e=lX(await t.json());if(e!==null)return M(e)}e.warn(`Proxy location fetch returned unexpected response, falling back to local timezone`)}catch(t){e.warn(`Failed to fetch location via dev proxy, falling back to local timezone`,{error:t})}return M(uX())}var fX=G({type:H(),count:H(),reacted:U()}),pX=G({id:V(),authorUserId:V(),authorName:V(),authorInitials:V(),authorColor:V(),text:V(),createdAt:V(),time:V()}),mX=G({id:V(),authorUserId:V(),authorName:V(),authorInitials:V(),authorColor:V(),authorRole:V(),department:V().nullable().optional(),categoryLabel:V(),categoryColor:V(),audienceLabel:V(),createdAt:V(),timestamp:V(),pinned:U(),mustAcknowledge:U(),acknowledged:U(),title:V().nullable(),body:V(),reactions:W(fX),myReaction:H().nullable().optional(),commentCount:H(),comments:W(pX),seenCount:H(),bookmarked:U(),audienceId:V(),taggedUserIds:W(V()).optional(),scheduledAt:V().nullable().optional(),isRecurring:U().optional(),recurrenceFrequency:V().nullable().optional(),nextOccurrenceTime:V().nullable().optional(),feelingId:V().nullable().optional(),feelingLabel:V().nullable().optional(),feelingEmoji:V().nullable().optional(),locationLabel:V().nullable().optional(),imageUrls:W(V()).optional()}).passthrough();W(mX);var hX=G({totalCount:H(),items:W(mX)}),gX=W(G({id:V(),name:V(),email:V(),userName:V(),role:V(),initials:V(),color:V()})),_X=W(G({id:V(),key:V().optional(),label:V(),color:V(),templateIds:W(V()).optional(),dataTemplateIds:W(V()).optional(),webhookId:V().nullable().optional()})),vX=W(G({key:V(),label:V()})),yX=W(G({id:V(),label:V(),emoji:V()})),bX=e=>e===1?`insightful`:e===2?`celebrate`:`like`,xX=e=>{let t={like:0,insightful:0,celebrate:0};for(let n of e){let e=bX(n.type);t[e]=n.count}return t},SX=e=>({id:e.id,authorName:e.authorName,authorInitials:e.authorInitials,authorColor:e.authorColor,text:e.text,time:e.time,createdAt:e.createdAt}),CX=e=>e==null?null:bX(e),wX=e=>({department:e.department??null,feelingId:e.feelingId??null,feelingLabel:e.feelingLabel??null,feelingEmoji:e.feelingEmoji??null,locationLabel:e.locationLabel??null}),TX=e=>{let t=wX(e);return new GY({id:e.id,authorUserId:e.authorUserId,authorName:e.authorName,authorInitials:e.authorInitials,authorColor:e.authorColor,authorRole:e.authorRole,categoryLabel:e.categoryLabel,categoryColor:e.categoryColor,audienceLabel:e.audienceLabel,createdAt:e.createdAt,timestamp:e.timestamp,pinned:e.pinned,mustAcknowledge:e.mustAcknowledge,acknowledged:e.acknowledged,title:e.title,body:e.body,reactions:xX(e.reactions),myReaction:CX(e.myReaction),commentCount:e.commentCount,comments:e.comments.map(SX),seenCount:e.seenCount,bookmarked:e.bookmarked,taggedUserIds:e.taggedUserIds??[],imageUrls:e.imageUrls??[],audienceId:e.audienceId,scheduledAt:e.scheduledAt??null,isRecurring:e.isRecurring??!1,recurrenceFrequency:e.recurrenceFrequency??null,...t})},EX=e=>({id:e.key??e.id,label:e.label,color:e.color,categoryKey:e.key??e.id,templateIds:e.templateIds??[],dataTemplateIds:e.dataTemplateIds??[],webhookId:e.webhookId??void 0}),DX=e=>({id:e.key,label:e.label}),OX=e=>({id:e.id,label:e.label,emoji:e.emoji}),kX=(e,t,n)=>(e.error(`Feed ${t} returned an unexpected shape`,n),N(new UY(n))),AX=(e,t)=>(e.error(`Feed request failed`,t),new UY(t)),jX=(e,t,n)=>{let r=hX.safeParse(n);return r.success?M({totalCount:r.data.totalCount,items:r.data.items.map(TX)}):kX(e,t,r.error)},MX=(e,t,n)=>{let r=mX.safeParse(n);return r.success?M(TX(r.data)):kX(e,t,r.error)},NX=(e,t,n)=>{let r=_X.safeParse(n);return r.success?M(r.data.map(EX)):kX(e,t,r.error)},PX=(e,t,n)=>{let r=vX.safeParse(n);return r.success?M(r.data.map(DX)):kX(e,t,r.error)},FX=(e,t,n)=>{let r=yX.safeParse(n);return r.success?M(r.data.map(OX)):kX(e,t,r.error)},IX=(e,t,n)=>{let r=gX.safeParse(n);return r.success?M(r.data):kX(e,t,r.error)},LX=W(G({id:V(),userId:V(),kind:aj([`meeting`,`group`,`feed`,`member`]),actorName:V(),initials:V(),color:V(),message:V(),detail:V().nullable().optional(),postId:V().nullable().optional(),isRead:U(),creationTime:V()})),RX={for_you:0,team:1,company:2,saved:3},zX={like:0,insightful:1,celebrate:2},BX=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-feed-gateway`)}async listPosts(e,t,n){try{let r=RX[e],i=await this.httpClient.get(`/api/app/feed/posts`,{query:{scope:r,...t!==void 0&&{skipCount:t},...n!==void 0&&{maxResultCount:n}}});return jX(this.logger,`listPosts`,i)}catch(e){return N(AX(this.logger,e))}}async createPost(e){try{let t=await this.httpClient.post(`/api/app/feed/post`,e);return MX(this.logger,`createPost`,t)}catch(e){return N(AX(this.logger,e))}}async updatePost(e,t){try{let n=await this.httpClient.put(`/api/app/feed/post/${e}`,t);return MX(this.logger,`updatePost`,n)}catch(e){return N(AX(this.logger,e))}}async react(e,t){try{let n=await this.httpClient.post(`/api/app/feed/react-to-post/${e}`,{type:zX[t]});return MX(this.logger,`react`,n)}catch(e){return N(AX(this.logger,e))}}async toggleBookmark(e){try{let t=await this.httpClient.post(`/api/app/feed/toggle-bookmark/${e}`,void 0);return MX(this.logger,`toggleBookmark`,t)}catch(e){return N(AX(this.logger,e))}}async setPinned(e,t){try{let n=await this.httpClient.post(`/api/app/feed/set-pinned/${e}`,{pinned:t});return MX(this.logger,`setPinned`,n)}catch(e){return N(AX(this.logger,e))}}async acknowledge(e){try{let t=await this.httpClient.post(`/api/app/feed/acknowledge/${e}`,void 0);return MX(this.logger,`acknowledge`,t)}catch(e){return N(AX(this.logger,e))}}async markSeen(e){try{let t=await this.httpClient.post(`/api/app/feed/mark-seen/${e}`,void 0);return MX(this.logger,`markSeen`,t)}catch(e){return N(AX(this.logger,e))}}async addComment(e,t){try{let n=await this.httpClient.post(`/api/app/feed/comment/${e}`,{text:t});return MX(this.logger,`addComment`,n)}catch(e){return N(AX(this.logger,e))}}async listCategories(){try{let e=await this.httpClient.get(`/api/app/feed/feed-categories`);return NX(this.logger,`listCategories`,e)}catch(e){return N(AX(this.logger,e))}}async listAudiences(){try{let e=await this.httpClient.get(`/api/app/feed/feed-audiences`);return PX(this.logger,`listAudiences`,e)}catch(e){return N(AX(this.logger,e))}}async listFeelings(){try{let e=await this.httpClient.get(`/api/app/feed/feed-feelings`);return FX(this.logger,`listFeelings`,e)}catch(e){return N(AX(this.logger,e))}}async searchUsers(e){try{let t=await this.httpClient.get(`/api/app/feed/search-users`,{query:{filter:e}});return IX(this.logger,`searchUsers`,t)}catch(e){return N(AX(this.logger,e))}}async detectLocation(){return dX(this.logger)}async uploadImage(e){try{let t=new FormData;t.append(`file`,e);let n=await this.httpClient.post(`/api/app/file/upload?category=FeedPost`,t);return typeof n==`object`&&n&&`id`in n&&typeof n.id==`string`?M(n.id):N(new UY(`Invalid response shape`))}catch(e){return N(AX(this.logger,e))}}async getNotifications(){try{let e=await this.httpClient.get(`/api/app/notification`);return M(LX.parse(e).map(e=>({id:e.id,kind:e.kind,initials:e.initials,color:e.color,actor:e.actorName,message:e.message,creationTime:e.creationTime,...e.detail!==null&&e.detail!==void 0?{detail:e.detail}:{},...e.postId!==null&&e.postId!==void 0?{postId:e.postId}:{}})))}catch(e){return N(AX(this.logger,e))}}async markNotificationAsRead(e){try{return await this.httpClient.post(`/api/app/notification/${e}/mark-as-read`,void 0),M(void 0)}catch(e){return N(AX(this.logger,e))}}async deleteNotification(e){try{return await this.httpClient.delete(`/api/app/notification/${e}`),M(void 0)}catch(e){return N(AX(this.logger,e))}}},VX=e=>{let t={feedGateway:new BX({httpClient:e.httpClient,logger:e.logger}),logger:e.logger};return{listFeed:new VY(t),createPost:new KY(t),updatePost:new qY(t),reactToPost:new JY(t),toggleBookmark:new YY(t),acknowledgePost:new XY(t),addComment:new ZY(t),listFeedCategories:new QY(t),listFeedAudiences:new $Y(t),listFeedFeelings:new eX(t),searchFeedUsers:new tX(t),detectLocation:new nX(t),uploadFeedImage:new rX(t),setPostPinned:new aX(t),markSeen:new iX(t),getNotifications:new oX(t),markNotificationRead:new sX(t),notificationRealtime:e.notificationRealtime,logger:e.logger}},HX=(0,n.createContext)(null),UX=({module:e,children:t})=>(0,D.jsx)(HX.Provider,{value:e,children:t}),WX=()=>{let e=(0,n.useContext)(HX);if(e===null)throw Error(`Feed hooks must be used within <FeedModuleProvider>.`);return e},GX=e=>[`feed`,e],KX=e=>{e.invalidateQueries({queryKey:[`feed`]})},qX=(e,t)=>{e.setQueriesData({queryKey:[`feed`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t.id?t:e)}))})},JX=e=>{let{listFeed:t}=WX();return wN({queryKey:GX(e),queryFn:({pageParam:n})=>P(t.execute({scope:e,skipCount:n,maxResultCount:10})),initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.items.length,0);if(!(n>=e.totalCount))return n}})},YX=()=>{let{createPost:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{KX(t)}})},XX=()=>{let{updatePost:e}=WX(),t=sN();return CN({mutationFn:({postId:t,input:n})=>P(e.execute(t,n)),onSuccess:e=>{qX(t,e)}})},ZX=()=>{let{reactToPost:e}=WX(),t=sN();return CN({mutationFn:({postId:t,type:n})=>P(e.execute(t,n)),onSuccess:e=>{qX(t,e)}})},QX=()=>{let{toggleBookmark:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{qX(t,e),t.invalidateQueries({queryKey:GX(`saved`)})}})},$X=()=>{let{acknowledgePost:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{qX(t,e)}})},eZ=()=>{let{markSeen:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{qX(t,e)}})},tZ=()=>{let{addComment:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{qX(t,e)}})},nZ=()=>{let{setPostPinned:e}=WX(),t=sN();return CN({mutationFn:({postId:t,pinned:n})=>P(e.execute(t,n)),onSuccess:e=>{qX(t,e)}})},rZ=()=>{let{listFeedCategories:e}=WX();return SN({queryKey:[`feed-categories`],queryFn:()=>P(e.execute())})},iZ=()=>{let{listFeedAudiences:e}=WX();return SN({queryKey:[`feed-audiences`],queryFn:()=>P(e.execute())})},aZ=()=>{let{listFeedFeelings:e}=WX();return SN({queryKey:[`feed-feelings`],queryFn:()=>P(e.execute())})},oZ=e=>{let{searchFeedUsers:t}=WX();return SN({queryKey:[`feed-search-users`,e],queryFn:()=>P(t.execute(e)),enabled:e.trim().length>0})},sZ=()=>{let{uploadFeedImage:e}=WX();return CN({mutationFn:t=>P(e.execute(t))})},cZ=e=>{let{data:t=[]}=rZ(),n=t.find(t=>t.id===e.department);return{categoryLabel:n?.label??e.categoryLabel,categoryColor:n?.color??e.categoryColor}},lZ=e=>{if(e.length===0)return[];let t=e[0]?.fullName??e[0]?.name??``;if(e.length===1)return[{text:`with `,bold:!1},{text:t,bold:!0}];let n=e[1]?.fullName??e[1]?.name??``;return e.length===2?[{text:`with `,bold:!1},{text:t,bold:!0},{text:` and `,bold:!1},{text:n,bold:!0}]:[{text:`with `,bold:!1},{text:t,bold:!0},{text:`, `,bold:!1},{text:n,bold:!0},{text:` and `,bold:!1},{text:`${String(e.length-2)} others`,bold:!0}]},uZ=e=>{let t=e;return/^\d{4}-\d{2}-\d{2}T/.test(e)&&!e.endsWith(`Z`)&&!/[+-]\d{2}:?\d{2}$/.test(e)&&(t=`${e}Z`),new Date(t)},dZ=e=>{let t=String(e.minute).padStart(2,`0`),n=e.hour>=12?`PM`:`AM`,r=e.hour%12;return`${String(r===0?12:r)}:${t} ${n}`},fZ=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],pZ=(e,t)=>e.year===t.year&&e.month===t.month&&e.day===t.day,mZ=(e,t,n)=>{let r=n.getTime()-t.getTime();if(r<0){let t=new Date(e);if(!Number.isNaN(t.getTime())){let e=n.getTime()-t.getTime();if(e>=0)return e}}return r},hZ=(e,t,n)=>{let r=uZ(e);if(Number.isNaN(r.getTime()))return null;let i=r.getTime()-t.getTime();if(i<=0)return null;let a=60*1e3,o=60*a,s=24*o;if(i<a)return`Publishes shortly`;if(i<o){let e=Math.floor(i/a);return`Publishes in ${String(e)}m`}if(i<s){let e=Math.floor(i/o);return`Publishes in ${String(e)} ${e===1?`hour`:`hours`}`}let c=VN(r,n);return pZ(c,VN(new Date(t.getTime()+s),n))?`Scheduled for tomorrow at ${dZ(c)}`:`Scheduled for ${fZ[c.month-1]??``} ${String(c.day)} at ${dZ(c)}`},gZ=(e,t,n=null,r=new Date)=>{if(n){let e=hZ(n,r,t);if(e!==null)return e}let i=uZ(e);if(Number.isNaN(i.getTime()))return`now`;let a=mZ(e,i,r),o=60*1e3,s=60*o,c=24*s;if(a<o)return`now`;if(a<s){let e=Math.floor(a/o);return`${String(e)}m ago`}if(a<c){let e=Math.floor(a/s);return`${String(e)} ${e===1?`hour`:`hours`} ago`}let l=VN(i,t);return pZ(l,VN(new Date(r.getTime()-c),t))?`Yesterday at ${dZ(l)}`:`${fZ[l.month-1]??``} ${String(l.day)} at ${dZ(l)}`},_Z=(e,t,n)=>{let r=document.getElementById(e),i=document.getElementById(t);if(r&&i){let e=i.getBoundingClientRect(),t=r.getBoundingClientRect(),a=t.top-e.top,o=i.scrollTop+a;n===`center`&&(o=o-e.height/2+t.height/2),i.scrollTo({top:o,behavior:`smooth`})}},vZ=(e,t=1600,n=1600,r=.8)=>new Promise(i=>{if(!e.type.startsWith(`image/`)){i(e);return}let a=new Image;a.src=URL.createObjectURL(e),a.onload=()=>{URL.revokeObjectURL(a.src);let o=a.width,s=a.height;if(o>t||s>n){let e=Math.min(t/o,n/s);o=Math.round(o*e),s=Math.round(s*e)}let c=document.createElement(`canvas`);c.width=o,c.height=s;let l=c.getContext(`2d`);if(!l){i(e);return}l.drawImage(a,0,0,o,s),c.toBlob(t=>{if(!t){i(e);return}i(new File([t],e.name.replace(/\.[^/.]+$/,``)+`.jpg`,{type:`image/jpeg`,lastModified:Date.now()}))},`image/jpeg`,r)},a.onerror=()=>{i(e)}}),yZ={ReceiveNotification:`ReceiveNotification`},bZ=G({id:V(),kind:aj([`meeting`,`group`,`feed`,`member`]),initials:V(),color:V(),actor:V(),time:V(),message:V().nullable().optional(),detail:V().nullable().optional(),postId:V().nullable().optional()}),xZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`list-contacts`)}async execute(e){let t=await this.meetingGateway.listContacts(e);return t.ok||this.logger.warn(`Listing booking contacts failed`,{code:t.error.code}),t}},SZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`list-available-slots`)}async execute(e){let t=await this.meetingGateway.getAvailableSlots(e);return t.ok||this.logger.warn(`Listing available slots failed`,{code:t.error.code}),t}},CZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`list-attendee-availability`)}async execute(e){let t=await this.meetingGateway.listAttendeeAvailability(e);return t.ok||this.logger.warn(`Listing attendee availability failed`,{code:t.error.code}),t}},wZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`list-meetings`)}async execute(){let e=await this.meetingGateway.listMeetings();return e.ok||this.logger.warn(`Listing meetings failed`,{code:e.error.code}),e}},TZ=class extends ui{},EZ=class extends TZ{code=`MEETINGS_UNAVAILABLE`;constructor(e){super(`Meetings are currently unavailable. Please try again.`,{cause:e})}},DZ=class extends TZ{code=`MEETINGS_INCOMPLETE_BOOKING`;constructor(){super(`Pick a person, a date, and a time slot to book a meeting.`)}},OZ=class{id;title;withName;withInitials;withColor;dateLabel;startUtc;endUtc;location;isOrganizer;myStatus;bucket;isGroup;attendeeIds;description;awaitingResponse;constructor(e){this.id=e.id,this.title=e.title,this.withName=e.withName,this.withInitials=e.withInitials,this.withColor=e.withColor,this.dateLabel=e.dateLabel,this.startUtc=e.startUtc,this.endUtc=e.endUtc,this.location=e.location,this.isOrganizer=e.isOrganizer,this.myStatus=e.myStatus,this.bucket=e.bucket,this.isGroup=e.isGroup,this.attendeeIds=e.attendeeIds,this.description=e.description,this.awaitingResponse=e.awaitingResponse}},kZ=[{id:`Pacific/Honolulu`,city:`Honolulu`,offset:`GMT-10`},{id:`America/Anchorage`,city:`Anchorage`,offset:`GMT-9`},{id:`America/Los_Angeles`,city:`Los Angeles`,offset:`GMT-8`},{id:`America/Denver`,city:`Denver`,offset:`GMT-7`},{id:`America/Chicago`,city:`Chicago`,offset:`GMT-6`},{id:`America/New_York`,city:`New York`,offset:`GMT-5`},{id:`America/Sao_Paulo`,city:`São Paulo`,offset:`GMT-3`},{id:`Atlantic/Reykjavik`,city:`Reykjavik`,offset:`GMT+0`},{id:`Europe/London`,city:`London`,offset:`GMT+1`},{id:`Europe/Paris`,city:`Paris`,offset:`GMT+2`},{id:`Europe/Athens`,city:`Athens`,offset:`GMT+3`},{id:`Africa/Nairobi`,city:`Nairobi`,offset:`GMT+3`},{id:`Asia/Dubai`,city:`Dubai`,offset:`GMT+4`},{id:`Asia/Karachi`,city:`Karachi`,offset:`GMT+5`},{id:`Asia/Kolkata`,city:`Mumbai`,offset:`GMT+5:30`},{id:`Asia/Dhaka`,city:`Dhaka`,offset:`GMT+6`},{id:`Asia/Bangkok`,city:`Bangkok`,offset:`GMT+7`},{id:`Asia/Singapore`,city:`Singapore`,offset:`GMT+8`},{id:`Asia/Shanghai`,city:`Shanghai`,offset:`GMT+8`},{id:`Asia/Tokyo`,city:`Tokyo`,offset:`GMT+9`},{id:`Australia/Sydney`,city:`Sydney`,offset:`GMT+11`},{id:`Pacific/Auckland`,city:`Auckland`,offset:`GMT+13`}],AZ={id:`Europe/London`,city:`London`,offset:`GMT+1`};AZ.id;var jZ=e=>{try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`);if(t){let e=t.value;if(e===`GMT`)return`GMT+0`;e=e.replace(/^GMT/,``);let n=e.startsWith(`-`)?`-`:`+`,[r=`0`,i=`0`]=e.replace(/^[+-]/,``).split(`:`),a=parseInt(r,10),o=parseInt(i,10);return o===0?`GMT${n}${String(a)}`:`GMT${n}${String(a)}:${String(o)}`}}catch{}return`GMT+0`},MZ=e=>{let t=kZ.find(t=>t.id===e);if(t)return t;try{let t=jZ(e),n=e.split(`/`);return{id:e,city:(n[n.length-1]??``).replace(/_/g,` `),offset:t}}catch{return AZ}},NZ=e=>MZ(e),PZ=(e,t,n)=>{let r=new Date(n.start).getTime(),i=new Date(n.end).getTime();return e.getTime()<i&&t.getTime()>r},FZ=(e,t,n)=>e.userId===t||t===n&&n!==``&&e.userId===void 0,IZ=(e,t)=>e.allBlocks.filter(t=>FZ(t,e.userId,e.selfUserId)&&t.status!==`available`).flatMap(e=>IO(e,t.start,t.end)),LZ=(e,t)=>e.allBlocks.filter(t=>FZ(t,e.userId,e.selfUserId)&&t.status===`available`).flatMap(e=>IO(e,t.start,t.end)).map(e=>({start:new Date(e.start),end:new Date(e.end)})),RZ=(e,t,n)=>t.getTime()>=e.start.getTime()&&n.getTime()<=e.end.getTime(),zZ=e=>{let t={start:e.rangeStart,end:e.rangeEnd},n={userId:e.userId,selfUserId:e.selfUserId,allBlocks:e.allBlocks},r=e.workWindows.some(t=>RZ(t,e.slotStart,e.slotEnd)),i=LZ(n,t).some(t=>RZ(t,e.slotStart,e.slotEnd));return!r&&!i?`ooh`:IZ(n,t).some(t=>PZ(e.slotStart,e.slotEnd,t))?`busy`:`available`},BZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`book-meeting`)}async execute(e){return e.contactId.length===0||e.dateLabel.length===0||e.slot.length===0?(this.logger.warn(`Rejected incomplete booking`),N(new DZ)):this.meetingGateway.book(e)}},VZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`respond-to-meeting`)}async execute(e,t){let n=await this.meetingGateway.respond(e,t);return n.ok||this.logger.warn(`Responding to meeting failed`,{code:n.error.code}),n}},HZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`cancel-meeting`)}async execute(e){let t=await this.meetingGateway.cancel(e);return t.ok||this.logger.warn(`Cancelling meeting failed`,{code:t.error.code}),t}},UZ=`Online — link generated automatically`,WZ=null;WZ??=[{id:`mt-1`,title:`1:1 Catch-up`,withName:`Andreea Cinpoi`,withInitials:`AN`,withColor:`#7c3aed`,dateLabel:`Tue, 24 Jun`,startUtc:`2026-06-24T14:00:00Z`,endUtc:`2026-06-24T15:00:00Z`,location:UZ,isOrganizer:!0,myStatus:`accepted`,bucket:`upcoming`},{id:`mt-2`,title:`Application review`,withName:`Raj Ahmed`,withInitials:`RA`,withColor:`#0ea5e9`,dateLabel:`Wed, 25 Jun`,startUtc:`2026-06-25T11:00:00Z`,endUtc:`2026-06-25T12:00:00Z`,location:UZ,isOrganizer:!1,myStatus:`pending`,bucket:`upcoming`},{id:`mt-3`,title:`Visa cases sync`,withName:`Jennifer Aboje`,withInitials:`JA`,withColor:`#fc7300`,dateLabel:`Thu, 26 Jun`,startUtc:`2026-06-26T10:00:00Z`,endUtc:`2026-06-26T10:30:00Z`,location:UZ,isOrganizer:!1,myStatus:`accepted`,bucket:`upcoming`},{id:`mt-4`,title:`Consultant onboarding`,withName:`Tousif Sadman`,withInitials:`TS`,withColor:`#0e7c66`,dateLabel:`Mon, 16 Jun`,startUtc:`2026-06-16T09:00:00Z`,endUtc:`2026-06-16T09:30:00Z`,location:UZ,isOrganizer:!0,myStatus:`accepted`,bucket:`passed`},{id:`mt-5`,title:`Compliance check`,withName:`Nur Mohammad`,withInitials:`NM`,withColor:`#8b5cf6`,dateLabel:`Fri, 13 Jun`,startUtc:`2026-06-13T15:00:00Z`,endUtc:`2026-06-13T16:00:00Z`,location:UZ,isOrganizer:!0,myStatus:`accepted`,bucket:`canceled`}];var GZ=encodeURIComponent,KZ={list:`/api/app/meeting`,contacts:`/api/app/meeting/list-contacts`,availableSlots:`/api/app/meeting/list-available-slots`,attendeeAvailability:`/api/app/meeting/list-attendee-availability`,book:`/api/app/meeting/book`,respond:e=>`/api/app/meeting/${GZ(e)}/respond`,cancel:e=>`/api/app/meeting/${GZ(e)}/cancel`},qZ=G({id:V(),organizerUserId:V(),title:V(),withName:V(),withInitials:V(),withColor:V(),dateLabel:V(),start:V(),end:V(),location:V(),isOrganizer:U(),myStatus:H(),bucket:H(),awaitingResponse:U().optional(),isGroup:U(),attendeeIds:W(V()),description:V()}).passthrough(),JZ=W(qZ),YZ=W(G({id:V(),name:V(),initials:V(),color:V(),role:V()}).passthrough()),XZ=W(G({label:V(),startUtc:V(),endUtc:V(),conflicts:W(V())}).passthrough()),ZZ=W(G({userId:V(),busy:W(G({startUtc:V(),endUtc:V()})),workingHours:W(G({startUtc:V(),endUtc:V()})).optional()}).passthrough()),QZ={0:`pending`,1:`accepted`,2:`rejected`},$Z={0:`upcoming`,1:`passed`,2:`canceled`},eQ=/[zZ]|[+-]\d{2}:?\d{2}$/,tQ=e=>eQ.test(e)?e:`${e}Z`,nQ=e=>new OZ({id:e.id,title:e.title,withName:e.withName,withInitials:e.withInitials,withColor:e.withColor,dateLabel:e.dateLabel,startUtc:tQ(e.start),endUtc:tQ(e.end),location:e.location,isOrganizer:e.isOrganizer,myStatus:QZ[e.myStatus]??`pending`,bucket:$Z[e.bucket]??`upcoming`,isGroup:e.isGroup,attendeeIds:e.attendeeIds,description:e.description,awaitingResponse:e.awaitingResponse??!1}),rQ=e=>({id:e.id,name:e.name,initials:e.initials,color:e.color,role:e.role}),iQ=e=>({label:e.label,startUtc:e.startUtc,endUtc:e.endUtc,conflicts:e.conflicts}),aQ=e=>({userId:e.userId,busy:e.busy.map(e=>({startUtc:e.startUtc,endUtc:e.endUtc})),workingHours:(e.workingHours??[]).map(e=>({startUtc:e.startUtc,endUtc:e.endUtc}))}),oQ=e=>({contactId:e.isGroup===!0?null:e.contactId,attendeeIds:e.attendeeIds??[],dateLabel:e.dateLabel,slot:e.slot,isoDate:e.isoDate,startUtc:e.startUtc,endUtc:e.endUtc,isGroup:e.isGroup??!1,title:e.title,location:e.location,description:e.description}),sQ=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-meeting-gateway`)}async listContacts(e){try{let t=e?.trim(),n=await this.httpClient.post(KZ.contacts,void 0,{query:{search:t===void 0||t===``?void 0:t}}),r=YZ.safeParse(n);return r.success?M(r.data.map(rQ)):this.fail(`List contacts returned an unexpected shape`,r.error)}catch(e){return this.fail(`List contacts failed`,e)}}async getAvailableSlots(e){try{let t=await this.httpClient.post(KZ.availableSlots,{isoDate:e.isoDate,timeZone:e.timeZone??void 0,isGroup:e.isGroup,contactId:e.contactId??void 0,attendeeIds:e.attendeeIds}),n=XZ.safeParse(t);return n.success?M(n.data.map(iQ)):this.fail(`Available slots returned an unexpected shape`,n.error)}catch(e){return this.fail(`Available slots failed`,e)}}async listAttendeeAvailability(e){try{let t=await this.httpClient.post(KZ.attendeeAvailability,{isoDate:e.isoDate,attendeeIds:e.attendeeIds}),n=ZZ.safeParse(t);return n.success?M(n.data.map(aQ)):this.fail(`Attendee availability returned an unexpected shape`,n.error)}catch(e){return this.fail(`Attendee availability failed`,e)}}async listMeetings(){try{let e=await this.httpClient.get(KZ.list),t=JZ.safeParse(e);return t.success?M(t.data.map(nQ)):this.fail(`List meetings returned an unexpected shape`,t.error)}catch(e){return this.fail(`List meetings failed`,e)}}async book(e){try{let t=await this.httpClient.post(KZ.book,oQ(e));return this.parseMeeting(t,`Book meeting`)}catch(e){return this.fail(`Book meeting failed`,e)}}async respond(e,t){try{let n=await this.httpClient.post(KZ.respond(e),void 0,{query:{accept:t}});return this.parseMeeting(n,`Respond to meeting`)}catch(e){return this.fail(`Respond to meeting failed`,e)}}async cancel(e){try{let t=await this.httpClient.post(KZ.cancel(e));return this.parseMeeting(t,`Cancel meeting`)}catch(e){return this.fail(`Cancel meeting failed`,e)}}parseMeeting(e,t){let n=qZ.safeParse(e);return n.success?M(nQ(n.data)):this.fail(`${t} returned an unexpected shape`,n.error)}fail(e,t){return this.logger.error(e,t),N(new EZ(t))}},cQ=e=>{let t={meetingGateway:new sQ({httpClient:e.httpClient,logger:e.logger}),logger:e.logger};return{listContacts:new xZ(t),listAvailableSlots:new SZ(t),listAttendeeAvailability:new CZ(t),listMeetings:new wZ(t),bookMeeting:new BZ(t),respondToMeeting:new VZ(t),cancelMeeting:new HZ(t)}},lQ=(0,n.createContext)(null),uQ=({module:e,children:t})=>(0,D.jsx)(lQ.Provider,{value:e,children:t}),dQ=()=>{let e=(0,n.useContext)(lQ);if(e===null)throw Error(`Meetings hooks must be used within <MeetingsModuleProvider>.`);return e},fQ=[`meetings`,`list`],pQ=[`meetings`,`contacts`],mQ=[`meetings`,`available-slots`],hQ=[`meetings`,`attendee-availability`],gQ=(e,t)=>{e.setQueryData(fQ,e=>e===void 0?[t]:e.map(e=>e.id===t.id?t:e))},_Q=e=>{let{listContacts:t}=dQ(),n=e?.trim()??``;return SN({queryKey:[...pQ,n],queryFn:()=>P(t.execute(n||void 0)),placeholderData:vM})},vQ=e=>{let{listMeetings:t}=dQ();return SN({queryKey:fQ,queryFn:()=>P(t.execute()),staleTime:0,refetchOnWindowFocus:!0,...e===void 0?{}:{refetchInterval:e}})},yQ=e=>{let{listAvailableSlots:t}=dQ();return SN({queryKey:[...mQ,e],queryFn:()=>e===null?Promise.resolve([]):P(t.execute(e)),enabled:e!==null,staleTime:0,refetchOnWindowFocus:!0})},bQ=(e,t)=>{let{listAttendeeAvailability:n}=dQ(),r=t!==null&&e.length>0;return SN({queryKey:[...hQ,t,[...e].sort()],queryFn:()=>r?P(n.execute({isoDate:t,attendeeIds:e})):Promise.resolve([]),enabled:r,staleTime:0,refetchOnWindowFocus:!0})},xQ=()=>{let{bookMeeting:e}=dQ(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{t.invalidateQueries({queryKey:fQ})}})},SQ=()=>{let{respondToMeeting:e}=dQ(),t=sN();return CN({mutationFn:({meetingId:t,accept:n})=>P(e.execute(t,n)),onSuccess:e=>{gQ(t,e)}})},CQ=()=>{let{cancelMeeting:e}=dQ(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{gQ(t,e)}})},wQ=class{userGateway;logger;constructor(e){this.userGateway=e.userGateway,this.logger=e.logger.child(`list-users`)}async execute(e){let t=await this.userGateway.list(e);return t.ok||this.logger.warn(`Listing users failed`,{code:t.error.code}),t}},TQ=class{userGateway;logger;constructor(e){this.userGateway=e.userGateway,this.logger=e.logger.child(`list-directory-facets`)}async execute(){let[e,t,n]=await Promise.all([this.userGateway.getDepartments(),this.userGateway.getAccessRoles(),this.userGateway.getBranches()]);return e.ok?t.ok?n.ok?M({departments:e.value,accessRoles:t.value,branches:n.value}):(this.logger.warn(`Loading directory facets failed`,{code:n.error.code}),N(n.error)):(this.logger.warn(`Loading directory facets failed`,{code:t.error.code}),N(t.error)):(this.logger.warn(`Loading directory facets failed`,{code:e.error.code}),N(e.error))}},EQ=class extends ui{},DQ=class extends EQ{code=`USERS_UNAVAILABLE`;constructor(e){super(`The users directory is currently unavailable. Please try again.`,{cause:e})}},OQ=class{id;fullName;email;roleName;department;branchKey;branchName;level;online;status;statusUntilUtc;hasAccount;initials;color;permissionSetName;permissionSetColor;constructor(e){this.id=e.id,this.fullName=e.fullName,this.email=e.email,this.roleName=e.roleName,this.department=e.department,this.branchKey=e.branchKey,this.branchName=e.branchName,this.level=e.level,this.online=e.online,this.status=e.status??`offline`,this.statusUntilUtc=e.statusUntilUtc??null,this.hasAccount=e.hasAccount??!0,this.initials=e.initials,this.color=e.color,this.permissionSetName=e.permissionSetName,this.permissionSetColor=e.permissionSetColor}get isSenior(){return this.level<=3}},kQ=G({id:V(),fullName:V(),email:V(),roleName:V(),department:V(),branchKey:V().nullish(),branchName:V().nullish(),level:H(),online:U(),status:H().nullish(),statusUntilUtc:V().nullish(),hasAccount:U().nullish(),initials:V(),color:V(),permissionSetName:V().nullish(),permissionSetColor:V().nullish()}),AQ=G({totalCount:H(),items:W(kQ)}),jQ=(e,t)=>(e.error(`Users request failed`,t),new DQ(t)),MQ={staffMembers:`/api/app/staff-member`,departments:`/api/app/staff-member/departments`,accessRoles:`/api/app/staff-member/access-roles`,branches:`/api/app/staff-member/branches`},NQ={skipCount:`skipCount`,maxResultCount:`maxResultCount`,filter:`filter`,department:`department`,accessRole:`accessRole`,branch:`branch`,online:`online`},PQ=e=>new OQ({id:e.id,fullName:e.fullName,email:e.email,roleName:e.roleName,department:e.department,branchKey:e.branchKey??``,branchName:e.branchName??``,level:e.level,online:e.online,status:SR(e.status),statusUntilUtc:e.statusUntilUtc??null,hasAccount:e.hasAccount??!0,initials:e.initials,color:e.color,permissionSetName:e.permissionSetName??void 0,permissionSetColor:e.permissionSetColor??void 0}),FQ=W(V()),IQ=W(G({key:V(),name:V()})),LQ=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger}async list(e){try{let t={[NQ.skipCount]:(e.page-1)*e.pageSize,[NQ.maxResultCount]:e.pageSize};e.filter!==``&&(t[NQ.filter]=e.filter),e.department!==``&&(t[NQ.department]=e.department),e.accessRole!==``&&(t[NQ.accessRole]=e.accessRole),e.branch!==``&&(t[NQ.branch]=e.branch),e.status!==`all`&&(t[NQ.online]=e.status===`online`);let n=await this.httpClient.get(MQ.staffMembers,{query:t}),r=AQ.safeParse(n);if(!r.success)throw this.logger.error(`Users staff-member list returned an unexpected shape`,r.error),new DQ(r.error);return M({users:r.data.items.map(PQ),totalCount:r.data.totalCount})}catch(e){return N(jQ(this.logger,e))}}async getDepartments(){return this.getStringList(MQ.departments,`departments`)}async getAccessRoles(){return this.getStringList(MQ.accessRoles,`access roles`)}async getBranches(){try{let e=await this.httpClient.get(MQ.branches),t=IQ.safeParse(e);if(!t.success)throw this.logger.error(`Users branches returned an unexpected shape`,t.error),new DQ(t.error);return M(t.data)}catch(e){return N(jQ(this.logger,e))}}async getStringList(e,t){try{let n=await this.httpClient.get(e),r=FQ.safeParse(n);if(!r.success)throw this.logger.error(`Users ${t} returned an unexpected shape`,r.error),new DQ(r.error);return M(r.data)}catch(e){return N(jQ(this.logger,e))}}},RQ=e=>{let t={userGateway:new LQ({httpClient:e.httpClient,logger:e.logger}),logger:e.logger};return{listUsers:new wQ(t),listDirectoryFacets:new TQ(t)}},zQ=(0,n.createContext)(null),BQ=({module:e,children:t})=>(0,D.jsx)(zQ.Provider,{value:e,children:t}),VQ=()=>{let e=(0,n.useContext)(zQ);if(e===null)throw Error(`Users hooks must be used within <UsersModuleProvider>.`);return e},HQ=[`users`],UQ=e=>{let{listUsers:t}=VQ();return SN({queryKey:[...HQ,e],queryFn:()=>P(t.execute(e)),placeholderData:vM,staleTime:3e4})},WQ=class{gateway;logger;constructor(e){this.gateway=e.meetingVideoGateway,this.logger=e.logger.child(`join-meeting-video`)}async execute(e){let t=await this.gateway.join(e);return t.ok||this.logger.warn(`Joining meeting video failed`,{code:t.error.code}),t}},GQ=class extends ui{},KQ=class extends GQ{code=`MEETING_VIDEO_UNAVAILABLE`;constructor(e){super(`This meeting could not be joined right now. Please try again.`,{cause:e})}},qQ=G({token:V(),providerType:V(),roomId:V(),participantName:V(),title:V().nullish()}).passthrough(),JQ=encodeURIComponent,YQ={join:e=>`/api/app/meeting-video/${JQ(e)}/join`},XQ=e=>({token:e.token,providerType:e.providerType,roomId:e.roomId,participantName:e.participantName,title:e.title??``}),ZQ=class{http;logger;constructor(e){this.http=e.httpClient,this.logger=e.logger.child(`http-meeting-video-gateway`)}async join(e){try{let t=await this.http.post(YQ.join(e)),n=qQ.safeParse(t);return n.success?M(XQ(n.data)):this.fail(`Join returned an unexpected shape`,n.error)}catch(e){return this.fail(`Joining meeting video failed`,e)}}fail(e,t){return this.logger.error(e,t),N(new KQ(t))}},QQ=e=>({joinMeetingVideo:new WQ({meetingVideoGateway:new ZQ({httpClient:e.httpClient,logger:e.logger}),logger:e.logger})}),$Q=(0,n.createContext)(null),e$=({module:e,children:t})=>(0,D.jsx)($Q.Provider,{value:e,children:t}),t$=PE(e=>({activeMeeting:null,isJoined:!1,requestedMeetingId:null,setActiveMeeting:t=>{e({activeMeeting:t})},setJoined:t=>{e({isJoined:t})},setRequestedMeetingId:t=>{e({requestedMeetingId:t})},leaveActiveMeeting:()=>{e({activeMeeting:null,isJoined:!1,requestedMeetingId:null})}})),n$=15e3,r$=5*6e4,i$=(e,t,n)=>{let r=new HJ({logger:t}),i=t=>e.modules===void 0||e.modules.includes(t);return{chat:i(`commhub.chat`)?r.create({url:`${e.apiBaseUrl}/signalr/chat`,accessTokenProvider:n}):new UJ,calls:i(`commhub.chat`)?r.create({url:`${e.apiBaseUrl}/signalr/calls`,accessTokenProvider:n}):new UJ,notifications:i(`commhub.feed`)?r.create({url:`${e.apiBaseUrl}/signalr/notifications`,accessTokenProvider:n}):new UJ}},a$=e=>{let t=e.logger??new bk(`info`),n=new zN,r=e.authStore,i=r.getState().session?.accessToken??null,a=r.subscribe(e=>{i=e.session?.accessToken??null}),o=()=>i??void 0,s=new vk(new _k(new pk(new dk({logger:t,baseUrl:e.apiBaseUrl,getAuthToken:o}),{timeoutMs:n$,logger:t}),{logger:t}),{logger:t,refresh:()=>r.getState().refreshSession()}),c=new aN({defaultOptions:{queries:{staleTime:r$,retry:1,refetchOnWindowFocus:!0}}}),l=i$(e,t,o);return{logger:t,authStore:r,moduleAccessModule:YJ({httpClient:s,logger:t}),chatModule:wY({logger:t,httpClient:s,realtime:l.chat,clock:n}),feedModule:VX({logger:t,httpClient:s,notificationRealtime:l.notifications}),meetingsModule:cQ({logger:t,httpClient:s}),meetingVideoModule:QQ({logger:t,httpClient:s}),scheduleModule:Wj({logger:t,httpClient:s,clock:n}),settingsModule:rR({logger:t,httpClient:s}),usersModule:RQ({logger:t,httpClient:s}),presenceModule:YR({logger:t,httpClient:s}),callsModule:Fz({logger:t,httpClient:s,realtime:l.calls}),queryClient:c,dispose:async()=>{a(),c.clear(),await Promise.all([l.chat.stop(),l.calls.stop(),l.notifications.stop()])}}},o$=new Map,s$=e=>`${e.apiBaseUrl}|${e.clientKey}|${e.authKind}`,c$=(e,t,n)=>{let r=o$.get(e);if(r===void 0){let n=t();r={composition:n.composition,handshake:n.handshake,refCount:0},o$.set(e,r)}r.refCount+=1;let i=!1,a=r;return{composition:a.composition,handshake:a.handshake,release:()=>{i||(i=!0,--a.refCount,!(a.refCount>0)&&(o$.get(e)===a&&o$.delete(e),a.handshake.dispose(),a.composition.dispose().catch(e=>{n?.warn(`Disposing the shared SDK runtime failed`,{error:e})})))}}},l$=`*`,u$=e=>{switch(e.kind){case`sso`:return e.getSecret();case`signed`:return e.getAssertion();case`host-token`:return e.getToken()}},d$=e=>{let t=new zN,n=new dk({logger:e.logger,baseUrl:e.apiBaseUrl,getAuthToken:()=>void 0});switch(e.kind){case`sso`:return new sB({httpClient:n,clock:t,logger:e.logger});case`signed`:return new uq({httpClient:n,clock:t,logger:e.logger,clientKey:e.clientKey,modules:e.modules});case`host-token`:return new dq({clock:t,logger:e.logger})}},f$=e=>{let{apiBaseUrl:t,clientKey:r,authKind:i}=e,a=e.modules===void 0?l$:e.modules.join(`,`),o=(0,n.useRef)(e.logger);o.current=e.logger;let s=(0,n.useMemo)(()=>a===l$?void 0:p$(a),[a]),c=(0,n.useRef)(e.requestCredential);c.current=e.requestCredential;let l=s$({apiBaseUrl:t,clientKey:r,authKind:i}),[u]=(0,n.useState)(()=>c$(l,()=>{let e=o.current??new bk(`info`,`commhub-sdk`),n=d$({kind:i,clientKey:r,apiBaseUrl:t,logger:e,modules:s??[]}),a=a$({apiBaseUrl:t,authStore:oq({clock:new zN,logger:e,storageNamespace:`sdk:${r}`,authGateway:n,setAccessToken:()=>{}}),modules:s,logger:e});return{composition:a,handshake:new wq(t=>new Cq({authStore:a.authStore,moduleAccessModule:a.moduleAccessModule,requestCredential:()=>c.current(),requestedModules:s??[],emit:t,logger:e,renewable:i!==`sso`}))}},o.current));return(0,n.useEffect)(()=>()=>{u.release()},[u]),{composition:u.composition,handshake:u.handshake}},p$=e=>e===``?[]:e.split(`,`),m$=({handshake:e,auth:t,onEvent:r})=>{let i=(0,n.useRef)(r);i.current=r;let a=(0,n.useRef)(t);return a.current=t,(0,n.useEffect)(()=>e.attach(e=>{i.current?.(e)}),[e]),(0,n.useSyncExternalStore)(t=>e.subscribeStatus(t),()=>e.status,()=>e.status)},h$=e=>Math.min(100,Math.max(0,e)),g$=([e,t,n],r=0)=>`hsl(${String(e)} ${String(h$(t))}% ${String(h$(n+r))}%)`,_$=([e,t,n],r)=>`hsl(${String(e)} ${String(h$(t))}% ${String(h$(n))}% / ${String(r)})`,v$=60,y$=e=>e[2]>v$?`#0f172a`:`#ffffff`,b$={a30:.18,a20:.12,a10:.06,a05:.035,border:.22},x$=e=>`${String(Math.max(0,Math.round(e)))}px`,S$=e=>({"--color-primary":g$(e),"--color-primary-strong":g$(e,-12),"--color-primary-light":g$(e,12),"--color-primary-30":_$(e,b$.a30),"--color-primary-20":_$(e,b$.a20),"--color-primary-10":_$(e,b$.a10),"--color-primary-05":_$(e,b$.a05),"--color-primary-border":_$(e,b$.border),"--color-on-primary":y$(e)}),C$=e=>({"--color-secondary":g$(e),"--color-secondary-strong":g$(e,-12),"--color-secondary-30":_$(e,.3),"--color-secondary-20":_$(e,b$.a20),"--color-secondary-10":_$(e,.07),"--color-secondary-border":_$(e,.3)}),w$=e=>({"--radius-sm":x$(e-4),"--radius-md":x$(e),"--radius-lg":x$(e+4),"--radius-xl":x$(e+6)}),T$=[4,6,9,12,15,18,24],E$=()=>{let e={"--height-btn":x$(32),"--height-input":x$(34),"--height-row":x$(44),"--height-nav":x$(36)};return T$.forEach((t,n)=>{e[`--space-${String(n+1)}`]=x$(t)}),e},D$=e=>e?{...e.brand?S$(e.brand):{},...e.accent?C$(e.accent):{},...e.radius===void 0?{}:w$(e.radius),...e.font===void 0?{}:{"--font-sans":e.font},...e.density===`compact`?E$():{}}:{},O$=e=>{let t=e?.mode??`system`;return t===`system`?null:t},k$=`data-theme`,A$=e=>{let t=e.getRootNode();return t instanceof ShadowRoot?t.host:e},j$=e=>{let t=(0,n.useRef)(null),r=JSON.stringify(e??null),i=(0,n.useMemo)(()=>JSON.parse(r),[r]);return(0,n.useEffect)(()=>{let e=t.current;if(e===null)return;let n=A$(e),r=D$(i??void 0),a=O$(i??void 0);for(let[e,t]of Object.entries(r))n.style.setProperty(e,t);return a===null?n.removeAttribute(k$):n.setAttribute(k$,a),()=>{for(let e of Object.keys(r))n.style.removeProperty(e);n.removeAttribute(k$)}},[i]),t},M$=e=>{if(e)return e;try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e)return e}catch{}return`UTC`},N$=class extends n.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.logger.error(`Unhandled error inside the Communication Hub widget`,e,{componentStack:t.componentStack}),this.props.onEvent?.({type:`error`,payload:{code:`WIDGET_CRASHED`,message:e.message}})}render(){let{error:e}=this.state;return e===null?this.props.children:(0,D.jsx)(bi,{tone:`error`,title:`This widget could not be displayed`,children:`Something went wrong inside the Communication Hub widget. Reloading the page usually fixes it.`})}};G({grantedModules:W(V()).nullish(),grantedPolicies:W(V()).nullish(),canManageUserAccess:U().nullish()});var P$=(0,n.createContext)(null),F$=({module:e,children:t})=>(0,D.jsx)(P$.Provider,{value:e,children:t}),I$=e=>{let t=bZ.safeParse(e);if(!t.success)return null;let{id:n,kind:r,actor:i,message:a,detail:o,time:s,postId:c}=t.data;return{id:n,kind:r,actor:i,occurredAt:s,...a==null?{}:{message:a},...o==null?{}:{detail:o},...c==null?{}:{postId:c}}},L$=({onEvent:e})=>{let{notificationRealtime:t,logger:r}=WX();return(0,n.useEffect)(()=>{if(e===void 0)return;let n=t.on(yZ.ReceiveNotification,t=>{let n=I$(t);if(n===null){r.error(`Discarded a malformed notification payload`,{rawPayload:t});return}e({type:`notification`,payload:n})});return t.start().catch(e=>{r.error(`Could not open the notification connection`,e)}),()=>{n()}},[t,r,e]),null},R$=({composition:e,children:t,onEvent:n})=>(0,D.jsx)(cN,{client:e.queryClient,children:(0,D.jsx)(s_,{reducedMotion:`user`,children:(0,D.jsx)(OE,{children:(0,D.jsx)(hB,{store:e.authStore,children:(0,D.jsx)(F$,{module:e.moduleAccessModule,children:(0,D.jsx)(TY,{module:e.chatModule,children:(0,D.jsx)(BY,{children:(0,D.jsx)(UX,{module:e.feedModule,children:(0,D.jsx)(uQ,{module:e.meetingsModule,children:(0,D.jsx)(e$,{module:e.meetingVideoModule,children:(0,D.jsx)(Kj,{module:e.scheduleModule,children:(0,D.jsx)(aR,{module:e.settingsModule,children:(0,D.jsx)(BQ,{module:e.usersModule,children:(0,D.jsx)(tz,{module:e.presenceModule,children:(0,D.jsx)(Lz,{module:e.callsModule,children:(0,D.jsxs)(CB,{children:[t,(0,D.jsx)(QB,{}),(0,D.jsx)(L$,{onEvent:n}),(0,D.jsx)(zE,{})]})})})})})})})})})})})})})})})}),z$={scope:`_scope_p8b6f_6`},B$=e=>{let{auth:t,apiBaseUrl:r,clientKey:i,modules:a,theme:o,timezone:s,logger:c,onEvent:l}=e,{composition:u,handshake:d}=f$({apiBaseUrl:r,clientKey:i,authKind:t.kind,modules:a,logger:c,requestCredential:()=>u$(t)}),f=m$({handshake:d,auth:t,onEvent:l}),p=j$(o),[m,h]=(0,n.useState)(null);return(0,D.jsx)(`div`,{ref:e=>{p.current=e,h(e)},className:z$.scope,"data-timezone":M$(s),"data-handshake":f,children:(0,D.jsx)(mD,{container:m,children:(0,D.jsx)(N$,{logger:u.logger,onEvent:l,children:f===`ready`?(0,D.jsx)(R$,{composition:u,onEvent:l,children:e.children}):null})})})},V$=({children:e,initialRoute:t,...n})=>(0,D.jsx)(B$,{...n,children:(0,D.jsx)(vt,{initialEntries:[t??`/`],children:e})}),H$=class extends li{code=`SDK_WIDGET_CONFIG_INVALID`},U$=()=>QA(e=>typeof e==`function`,{message:`Expected a function`}),W$=tj(`kind`,[G({kind:ij(`signed`),getAssertion:U$()})]),G$=nj([H(),H(),H()]),K$=G({brand:G$.optional(),accent:G$.optional(),radius:H().optional(),font:V().optional(),density:aj([`comfortable`,`compact`]).optional(),mode:aj([`light`,`dark`,`system`]).optional()}),q$=G({apiBaseUrl:V().url(),clientKey:V().min(1),auth:W$,modules:W(aj(hq)).optional(),theme:K$.optional(),timezone:V().optional(),locale:V().optional(),logger:QA().optional(),onEvent:U$().optional()}),J$=e=>{let t=q$.safeParse(e);return t.success?M(t.data):N(new H$(t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)))},Y$=`route`,X$=(e,t,n=[])=>{nq(e,n=>{let r=J$(n.config);if(!r.ok)return(0,D.jsx)(iq,{tagName:e,detail:r.error.message});let i=n.getAttribute(Y$);return(0,D.jsx)(V$,{...r.value,...i===null?{}:{initialRoute:i},children:t()})},[Y$,...n])},Z$=()=>{X$(`uapp-chat`,()=>(0,D.jsx)(qK,{}))},Q$={date:``,time:``,recurring:!1,frequency:`weekly`},$$=[{value:`now`,label:`Post now`},{value:`schedule`,label:`Schedule`}],e1=[{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}],t1={photo:`Add photos`,tag:`Tag people`,feeling:`How are you feeling?`,category:`POST CATEGORY`,item:`Select Item`,template:`Choose Template`},Y={screen:`_screen_1hhf0_1`,toolbar:`_toolbar_1hhf0_8`,toolbarContainer:`_toolbarContainer_1hhf0_14`,search:`_search_1hhf0_23`,toolbarRailSpacer:`_toolbarRailSpacer_1hhf0_31`,searchIcon:`_searchIcon_1hhf0_36`,searchInput:`_searchInput_1hhf0_44`,textareaError:`_textareaError_1hhf0_59`,commentComposerError:`_commentComposerError_1hhf0_60`,shareCommentError:`_shareCommentError_1hhf0_61`,wrapper:`_wrapper_1hhf0_70`,column:`_column_1hhf0_80`,rail:`_rail_1hhf0_91`,railHead:`_railHead_1hhf0_102`,railHeadTitle:`_railHeadTitle_1hhf0_109`,railSeeAll:`_railSeeAll_1hhf0_123`,railList:`_railList_1hhf0_132`,cardBody:`_cardBody_1hhf0_142`,seeMoreBtn:`_seeMoreBtn_1hhf0_151`,railFoot:`_railFoot_1hhf0_166`,missed:`_missed_1hhf0_177`,missedHead:`_missedHead_1hhf0_184`,missedSpark:`_missedSpark_1hhf0_192`,missedTitle:`_missedTitle_1hhf0_196`,missedBadge:`_missedBadge_1hhf0_203`,missedScroller:`_missedScroller_1hhf0_212`,missedScrollerFade:`_missedScrollerFade_1hhf0_217`,missedTrack:`_missedTrack_1hhf0_217`,missedNav:`_missedNav_1hhf0_229`,missedNavLeft:`_missedNavLeft_1hhf0_264`,missedNavRight:`_missedNavRight_1hhf0_268`,missedCard:`_missedCard_1hhf0_272`,missedCardTop:`_missedCardTop_1hhf0_282`,missedDot:`_missedDot_1hhf0_289`,missedCat:`_missedCat_1hhf0_297`,missedTime:`_missedTime_1hhf0_304`,missedSummary:`_missedSummary_1hhf0_311`,missedFoot:`_missedFoot_1hhf0_323`,missedCta:`_missedCta_1hhf0_329`,missedPriority:`_missedPriority_1hhf0_338`,compChips:`_compChips_1hhf0_354`,compChip:`_compChip_1hhf0_354`,actionBar:`_actionBar_1hhf0_374`,actionBarLabel:`_actionBarLabel_1hhf0_386`,actionBarBtns:`_actionBarBtns_1hhf0_392`,actionIcon:`_actionIcon_1hhf0_397`,actionIconActive:`_actionIconActive_1hhf0_414`,sheet:`_sheet_1hhf0_419`,sheetHead:`_sheetHead_1hhf0_427`,sheetLabel:`_sheetLabel_1hhf0_435`,sheetClose:`_sheetClose_1hhf0_443`,sheetChips:`_sheetChips_1hhf0_465`,catChip:`_catChip_1hhf0_471`,catChipOn:`_catChipOn_1hhf0_483`,feelGrid:`_feelGrid_1hhf0_488`,feelBtn:`_feelBtn_1hhf0_494`,feelBtnOn:`_feelBtnOn_1hhf0_509`,feelEmoji:`_feelEmoji_1hhf0_515`,photoInput:`_photoInput_1hhf0_519`,photoZone:`_photoZone_1hhf0_523`,photoZoneDrag:`_photoZoneDrag_1hhf0_528`,dropzone:`_dropzone_1hhf0_533`,dropIcon:`_dropIcon_1hhf0_554`,dropTitle:`_dropTitle_1hhf0_566`,dropHint:`_dropHint_1hhf0_572`,photoGrid:`_photoGrid_1hhf0_577`,photoThumb:`_photoThumb_1hhf0_584`,photoImg:`_photoImg_1hhf0_592`,photoRemove:`_photoRemove_1hhf0_599`,photoAddMore:`_photoAddMore_1hhf0_619`,mobilePromoTrigger:`_mobilePromoTrigger_1hhf0_642`,promoPulseGlow:`_promoPulseGlow_1hhf0_1`,mobilePromoTriggerBarHidden:`_mobilePromoTriggerBarHidden_1hhf0_732`,mobilePromoExpanded:`_mobilePromoExpanded_1hhf0_738`,promoShimmerSweep:`_promoShimmerSweep_1hhf0_751`,promoShimmer:`_promoShimmer_1hhf0_751`,promoIconWrap:`_promoIconWrap_1hhf0_767`,sparkleIcon:`_sparkleIcon_1hhf0_780`,sparkleTwinkle:`_sparkleTwinkle_1hhf0_1`,promoBtnText:`_promoBtnText_1hhf0_784`,mobilePromoBadge:`_mobilePromoBadge_1hhf0_803`,promoPopoverOverlay:`_promoPopoverOverlay_1hhf0_820`,promoPopoverCard:`_promoPopoverCard_1hhf0_832`,popoverHeader:`_popoverHeader_1hhf0_846`,popoverCloseX:`_popoverCloseX_1hhf0_855`,popoverBadgeIcon:`_popoverBadgeIcon_1hhf0_876`,popoverTitleRow:`_popoverTitleRow_1hhf0_888`,popoverTitle:`_popoverTitle_1hhf0_888`,popoverSeeAllBtn:`_popoverSeeAllBtn_1hhf0_904`,popoverSub:`_popoverSub_1hhf0_920`,popoverContent:`_popoverContent_1hhf0_927`,popoverEmpty:`_popoverEmpty_1hhf0_936`,missedClose:`_missedClose_1hhf0_985`,missedRead:`_missedRead_1hhf0_1022`,comments:`_comments_1hhf0_1048`,commentRow:`_commentRow_1hhf0_1057`,commentAvatar:`_commentAvatar_1hhf0_1062`,commentBubble:`_commentBubble_1hhf0_1076`,commentAuthor:`_commentAuthor_1hhf0_1084`,commentTime:`_commentTime_1hhf0_1090`,commentText:`_commentText_1hhf0_1095`,commentComposer:`_commentComposer_1hhf0_60`,commentInput:`_commentInput_1hhf0_1121`,commentSend:`_commentSend_1hhf0_1131`,sharePreviewWrap:`_sharePreviewWrap_1hhf0_1161`,sharePreview:`_sharePreview_1hhf0_1161`,sharePreviewAvatar:`_sharePreviewAvatar_1hhf0_1177`,sharePreviewBody:`_sharePreviewBody_1hhf0_1191`,sharePreviewMeta:`_sharePreviewMeta_1hhf0_1196`,sharePreviewCat:`_sharePreviewCat_1hhf0_1202`,sharePreviewTitle:`_sharePreviewTitle_1hhf0_1207`,shareField:`_shareField_1hhf0_1217`,shareComment:`_shareComment_1hhf0_61`,shareSearchWrap:`_shareSearchWrap_1hhf0_1241`,shareSearch:`_shareSearch_1hhf0_1241`,shareSearchInput:`_shareSearchInput_1hhf0_1257`,shareList:`_shareList_1hhf0_1274`,shareSectionLabel:`_shareSectionLabel_1hhf0_1281`,shareRow:`_shareRow_1hhf0_1290`,shareRowOn:`_shareRowOn_1hhf0_1308`,shareAvatar:`_shareAvatar_1hhf0_1314`,shareAvatarSquare:`_shareAvatarSquare_1hhf0_1328`,shareRowBody:`_shareRowBody_1hhf0_1332`,shareRowName:`_shareRowName_1hhf0_1339`,shareRowSub:`_shareRowSub_1hhf0_1345`,shareCheck:`_shareCheck_1hhf0_1350`,shareCheckOn:`_shareCheckOn_1hhf0_1363`,shareEmpty:`_shareEmpty_1hhf0_1368`,shareFootText:`_shareFootText_1hhf0_1376`,shareFootBtns:`_shareFootBtns_1hhf0_1381`,shareCancelBtn:`_shareCancelBtn_1hhf0_1386`,shareSendBtn:`_shareSendBtn_1hhf0_1401`,shareRoot:`_shareRoot_1hhf0_1422`,shareBackdrop:`_shareBackdrop_1hhf0_1432`,shareFade:`_shareFade_1hhf0_1`,shareModal:`_shareModal_1hhf0_1442`,shareIn:`_shareIn_1hhf0_1`,shareHead:`_shareHead_1hhf0_1476`,shareHeadIcon:`_shareHeadIcon_1hhf0_1484`,shareHeadText:`_shareHeadText_1hhf0_1496`,shareTitle:`_shareTitle_1hhf0_1501`,shareDesc:`_shareDesc_1hhf0_1508`,shareCloseBtn:`_shareCloseBtn_1hhf0_1514`,shareFooter:`_shareFooter_1hhf0_1533`,ppRoot:`_ppRoot_1hhf0_1544`,ppOverlay:`_ppOverlay_1hhf0_1552`,ppFade:`_ppFade_1hhf0_1`,ppPanel:`_ppPanel_1hhf0_1562`,ppSlide:`_ppSlide_1hhf0_1`,ppHead:`_ppHead_1hhf0_1594`,ppHeadIcon:`_ppHeadIcon_1hhf0_1603`,ppHeadText:`_ppHeadText_1hhf0_1614`,ppTitle:`_ppTitle_1hhf0_1619`,ppSubtitle:`_ppSubtitle_1hhf0_1636`,ppManaged:`_ppManaged_1hhf0_1642`,ppClose:`_ppClose_1hhf0_1647`,ppTabs:`_ppTabs_1hhf0_1667`,ppTab:`_ppTab_1hhf0_1667`,ppSearch:`_ppSearch_1hhf0_1676`,ppTabActive:`_ppTabActive_1hhf0_1697`,ppTabBg:`_ppTabBg_1hhf0_1701`,ppTabLabel:`_ppTabLabel_1hhf0_1709`,ppSearchIcon:`_ppSearchIcon_1hhf0_1719`,ppSearchInput:`_ppSearchInput_1hhf0_1727`,ppList:`_ppList_1hhf0_1746`,ppListInner:`_ppListInner_1hhf0_1754`,ppEmpty:`_ppEmpty_1hhf0_1769`,emptyState:`_emptyState_1hhf0_1783`,emptyIconWrap:`_emptyIconWrap_1hhf0_1795`,emptyTitle:`_emptyTitle_1hhf0_1807`,emptyText:`_emptyText_1hhf0_1814`,tabs:`_tabs_1hhf0_1823`,tab:`_tab_1hhf0_1823`,tabActive:`_tabActive_1hhf0_1845`,tabBadge:`_tabBadge_1hhf0_1851`,composerCollapsed:`_composerCollapsed_1hhf0_1859`,ccAvatar:`_ccAvatar_1hhf0_1869`,compAvatar:`_compAvatar_1hhf0_1870`,avatar:`_avatar_1hhf0_1871`,ccInput:`_ccInput_1hhf0_1888`,composer:`_composer_1hhf0_1859`,compHead:`_compHead_1hhf0_1914`,compAvatarWrapper:`_compAvatarWrapper_1hhf0_1921`,statusDot:`_statusDot_1hhf0_1926`,compHeaderTagline:`_compHeaderTagline_1hhf0_1943`,compMutedText:`_compMutedText_1hhf0_1949`,taggedTagline:`_taggedTagline_1hhf0_1954`,audiencePill:`_audiencePill_1hhf0_1966`,audienceSection:`_audienceSection_1hhf0_1985`,audienceLabel:`_audienceLabel_1hhf0_1996`,audienceRow:`_audienceRow_1hhf0_2004`,audienceBtn:`_audienceBtn_1hhf0_2010`,audienceBtnActive:`_audienceBtnActive_1hhf0_2028`,compClose:`_compClose_1hhf0_2034`,titleInput:`_titleInput_1hhf0_2053`,textarea:`_textarea_1hhf0_59`,compOption:`_compOption_1hhf0_2086`,compOptionLabel:`_compOptionLabel_1hhf0_2098`,compFooter:`_compFooter_1hhf0_2111`,submitRight:`_submitRight_1hhf0_2120`,modeToggle:`_modeToggle_1hhf0_2126`,cancelBtn:`_cancelBtn_1hhf0_2130`,postBtn:`_postBtn_1hhf0_2145`,card:`_card_1hhf0_142`,urgentStripe:`_urgentStripe_1hhf0_2179`,pinnedRow:`_pinnedRow_1hhf0_2190`,pin:`_pin_1hhf0_2190`,cardHead:`_cardHead_1hhf0_2205`,cardAuthor:`_cardAuthor_1hhf0_2217`,authorName:`_authorName_1hhf0_2222`,metaRow:`_metaRow_1hhf0_2232`,cardRight:`_cardRight_1hhf0_2242`,badge:`_badge_1hhf0_2250`,badgeDot:`_badgeDot_1hhf0_2263`,bookmarkBtn:`_bookmarkBtn_1hhf0_2270`,bookmarkActive:`_bookmarkActive_1hhf0_2288`,pinBtn:`_pinBtn_1hhf0_2293`,pinActive:`_pinActive_1hhf0_2311`,editBtn:`_editBtn_1hhf0_2316`,cardActions:`_cardActions_1hhf0_2334`,cardTitle:`_cardTitle_1hhf0_2340`,ackBanner:`_ackBanner_1hhf0_2360`,ackBtn:`_ackBtn_1hhf0_2375`,ackDone:`_ackDone_1hhf0_2387`,summary:`_summary_1hhf0_2401`,summaryLeft:`_summaryLeft_1hhf0_2411`,summaryIcons:`_summaryIcons_1hhf0_2417`,summaryDot:`_summaryDot_1hhf0_2422`,summaryCount:`_summaryCount_1hhf0_2438`,summaryComments:`_summaryComments_1hhf0_2443`,summaryCommentsClickable:`_summaryCommentsClickable_1hhf0_2447`,postBar:`_postBar_1hhf0_2457`,reactWrap:`_reactWrap_1hhf0_2465`,actionBtn:`_actionBtn_1hhf0_2471`,actionActive:`_actionActive_1hhf0_2495`,picker:`_picker_1hhf0_2512`,pickerVisible:`_pickerVisible_1hhf0_2544`,pickerBtn:`_pickerBtn_1hhf0_2550`,pickerActive:`_pickerActive_1hhf0_2572`,schedule:`_schedule_1hhf0_2615`,scheduleHead:`_scheduleHead_1hhf0_2626`,scheduleGrid:`_scheduleGrid_1hhf0_2640`,scheduleField:`_scheduleField_1hhf0_2646`,scheduleLabel:`_scheduleLabel_1hhf0_2652`,scheduleInput:`_scheduleInput_1hhf0_2658`,scheduleRow:`_scheduleRow_1hhf0_2675`,scheduleRowLabel:`_scheduleRowLabel_1hhf0_2685`,switch:`_switch_1hhf0_2698`,switchOn:`_switchOn_1hhf0_2710`,switchKnob:`_switchKnob_1hhf0_2714`,scheduleFreq:`_scheduleFreq_1hhf0_2729`,scheduleTz:`_scheduleTz_1hhf0_2733`,tagSearch:`_tagSearch_1hhf0_2747`,tagSearchInput:`_tagSearchInput_1hhf0_2758`,tagList:`_tagList_1hhf0_2767`,tagRow:`_tagRow_1hhf0_2775`,tagRowActive:`_tagRowActive_1hhf0_2792`,tagRowContent:`_tagRowContent_1hhf0_2797`,tagAvatar:`_tagAvatar_1hhf0_2803`,tagInfo:`_tagInfo_1hhf0_2816`,tagName:`_tagName_1hhf0_2821`,tagRole:`_tagRole_1hhf0_2827`,tagCheckbox:`_tagCheckbox_1hhf0_2832`,tagCheckboxActive:`_tagCheckboxActive_1hhf0_2843`,postImagesGrid:`_postImagesGrid_1hhf0_2850`,grid1:`_grid1_1hhf0_2869`,grid2:`_grid2_1hhf0_2872`,grid3:`_grid3_1hhf0_2875`,grid4:`_grid4_1hhf0_2879`,gridImageWrap:`_gridImageWrap_1hhf0_2884`,gridImage:`_gridImage_1hhf0_2884`,moreImagesOverlay:`_moreImagesOverlay_1hhf0_2910`,lightboxOverlay:`_lightboxOverlay_1hhf0_2933`,lightboxContainer:`_lightboxContainer_1hhf0_2948`,lightboxLeft:`_lightboxLeft_1hhf0_2961`,lightboxRight:`_lightboxRight_1hhf0_2971`,lightboxScrollableContent:`_lightboxScrollableContent_1hhf0_2981`,lightboxDivider:`_lightboxDivider_1hhf0_2992`,lightboxClose:`_lightboxClose_1hhf0_3016`,lightboxImage:`_lightboxImage_1hhf0_3029`,lightboxArrow:`_lightboxArrow_1hhf0_3064`,lightboxArrowLeft:`_lightboxArrowLeft_1hhf0_3086`,lightboxArrowRight:`_lightboxArrowRight_1hhf0_3094`,lightboxCounter:`_lightboxCounter_1hhf0_3102`,templateSheet:`_templateSheet_1hhf0_3120`,templateSheetHeader:`_templateSheetHeader_1hhf0_3126`,templateBackBtn:`_templateBackBtn_1hhf0_3134`,templateSheetTitle:`_templateSheetTitle_1hhf0_3157`,templateSheetMeta:`_templateSheetMeta_1hhf0_3166`,templateSearch:`_templateSearch_1hhf0_3178`,templateSearchIcon:`_templateSearchIcon_1hhf0_3184`,templateSearchInput:`_templateSearchInput_1hhf0_3193`,templateList:`_templateList_1hhf0_3210`,templateItem:`_templateItem_1hhf0_3217`,templateItemBody:`_templateItemBody_1hhf0_3241`,templateItemTitle:`_templateItemTitle_1hhf0_3249`,templateItemSub:`_templateItemSub_1hhf0_3258`,templateUseBtn:`_templateUseBtn_1hhf0_3266`,templateEmpty:`_templateEmpty_1hhf0_3287`,itemIconContainer:`_itemIconContainer_1hhf0_3294`,itemBadge:`_itemBadge_1hhf0_3306`,itemMetaRow:`_itemMetaRow_1hhf0_3316`},n1=({on:e,label:t,onToggle:n})=>(0,D.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":t,className:T(Y.switch,e&&Y.switchOn),onClick:n,children:(0,D.jsx)(`span`,{className:Y.switchKnob})}),r1=({value:e,onChange:t,timezone:n})=>{let r=VN(new Date,n),i=`${String(r.year)}-${String(r.month).padStart(2,`0`)}-${String(r.day).padStart(2,`0`)}`,a=e.date===i,o=`${String(r.hour).padStart(2,`0`)}:${String(r.minute).padStart(2,`0`)}`;return(0,D.jsxs)(`div`,{className:Y.schedule,children:[(0,D.jsxs)(`div`,{className:Y.scheduleHead,children:[(0,D.jsx)(zn,{size:13}),` SCHEDULE THIS POST`]}),(0,D.jsxs)(`div`,{className:Y.scheduleGrid,children:[(0,D.jsxs)(`label`,{className:Y.scheduleField,children:[(0,D.jsx)(`span`,{className:Y.scheduleLabel,children:`Date`}),(0,D.jsx)(`input`,{type:`date`,className:Y.scheduleInput,value:e.date,min:i,onChange:n=>{t({...e,date:n.target.value})}})]}),(0,D.jsxs)(`label`,{className:Y.scheduleField,children:[(0,D.jsx)(`span`,{className:Y.scheduleLabel,children:`Time`}),(0,D.jsx)(`input`,{type:`time`,className:Y.scheduleInput,value:e.time,min:a?o:void 0,onChange:n=>{t({...e,time:n.target.value})}})]})]}),(0,D.jsxs)(`div`,{className:Y.scheduleRow,children:[(0,D.jsxs)(`span`,{className:Y.scheduleRowLabel,children:[(0,D.jsx)(Vr,{size:13}),` Recurring`]}),(0,D.jsx)(n1,{on:e.recurring,label:`Repeat this post`,onToggle:()=>{t({...e,recurring:!e.recurring})}})]}),e.recurring&&(0,D.jsx)($E,{ariaLabel:`Repeat frequency`,className:Y.scheduleFreq??``,options:e1,value:e.frequency,onChange:n=>{t({...e,frequency:n})}}),(0,D.jsxs)(`div`,{className:Y.scheduleTz,children:[(0,D.jsx)(lr,{size:12}),` Timezone: `,(0,D.jsx)(`strong`,{children:n})]})]})},i1=({mode:e,disabled:t,onMode:n,onCancel:r,onSubmit:i})=>(0,D.jsxs)(`div`,{className:Y.compFooter,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.cancelBtn,onClick:r,children:`Cancel`}),(0,D.jsxs)(`div`,{className:Y.submitRight,children:[(0,D.jsx)($E,{ariaLabel:`Publish timing`,className:Y.modeToggle??``,options:$$,value:e,onChange:n}),(0,D.jsx)(`button`,{type:`button`,className:Y.postBtn,disabled:t,onClick:i,children:e===`schedule`?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Qn,{size:12}),` Schedule post`]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ur,{size:12}),` Post now`]})})]})]});function a1(e,t,n){if(e===`schedule`)return WN(t.date,t.time,n)}function o1(){let[e,t]=(0,n.useState)(``),[r,i]=(0,n.useState)(``),[a,o]=(0,n.useState)(!1),[s,c]=(0,n.useState)(`general`),[l,u]=(0,n.useState)(`all`),[d,f]=(0,n.useState)(null),[p,m]=(0,n.useState)(null),[h,g]=(0,n.useState)(null),[_,v]=(0,n.useState)(`now`),[y,b]=(0,n.useState)(Q$),[x,S]=(0,n.useState)([]),[C,ee]=(0,n.useState)([]),[te,ne]=(0,n.useState)(null);return{body:e,setBody:t,title:r,setTitle:i,mustRead:a,setMustRead:o,categoryId:s,setCategoryId:c,audienceId:l,setAudienceId:u,feeling:d,setFeeling:f,location:p,setLocation:m,sheet:h,setSheet:g,mode:_,setMode:v,schedule:y,setSchedule:b,taggedUsers:x,setTaggedUsers:S,photos:C,setPhotos:ee,selectedItem:te,setSelectedItem:ne}}function s1(e,t){return e.title.trim().length>300?`Post title cannot exceed 300 characters.`:e.body.trim().length>8e3?`Post body cannot exceed 8000 characters.`:e.mode===`schedule`&&t&&Date.parse(t)<Date.now()?`Schedule time must be in the future.`:null}function c1(e,t,n){let r=YX(),i=sZ(),a=e.body.trim().length===0||r.isPending||i.isPending||e.mode===`schedule`&&(!e.schedule.date||!e.schedule.time);return{submitDisabled:a,submit:async()=>{if(a)return;let o=a1(e.mode,e.schedule,n),s=s1(e,o);if(s){j.error(s);return}try{let n=[];e.photos.length>0&&(n=await Promise.all(e.photos.map(e=>i.mutateAsync(e)))),r.mutate({body:e.body,categoryId:e.categoryId,audienceId:e.audienceId,mustAcknowledge:e.mustRead,taggedUserIds:e.taggedUsers.map(e=>e.id),...e.title.trim()?{title:e.title.trim()}:{},scheduledAt:o,isRecurring:e.mode===`schedule`?e.schedule.recurring:!1,recurrenceFrequency:e.mode===`schedule`&&e.schedule.recurring?e.schedule.frequency:void 0,locationLabel:e.location??void 0,imageIds:n.length>0?n:void 0},{onSuccess:()=>{e.mode===`schedule`&&j.success(`Post scheduled for ${e.schedule.date} at ${e.schedule.time}`),t()},onError:()=>{j.error(`Failed to publish post. Please try again.`)}})}catch{j.error(`Invalid schedule date or time, or image upload failed.`)}}}}function l1(e,t){let n=o1(),r=JN().display,{submitDisabled:i,submit:a}=c1(n,e,r),o=e=>{n.setTaggedUsers(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])},s=(e,t)=>{n.setTitle(e),n.setBody(t),n.setSheet(null),n.setSelectedItem(null)},c=e=>{let t=typeof e==`function`?e(n.mode):e;if(n.setMode(t),t===`schedule`&&!n.schedule.date){let e=VN(new Date,r),t=`${String(e.year)}-${String(e.month).padStart(2,`0`)}-${String(e.day).padStart(2,`0`)}`,i=`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}`;n.setSchedule({...n.schedule,date:t,time:i})}};return{...n,setMode:c,category:t.find(e=>e.id===n.categoryId),timezone:r,submitDisabled:i,toggleTag:o,applyTemplate:s,submit:a}}var u1=e=>{let t=e.values,n=[`item_title`,`student_name`,`university_name`,`course_name`,`name`,`title`].find(e=>{let n=t[e];return n?n.trim()!==``:!1}),r=n===void 0?void 0:t[n],i=Object.entries(t).find(([e,t])=>t.trim()!==``),a=r??i?.[1]??e.id,o=n??i?.[0],s=[`item_description`,`university`,`status`].find(e=>{let n=t[e];return n?n.trim()!==``:!1}),c=s===void 0?void 0:t[s],l=Object.entries(t).find(([e,t])=>e!==o&&t.trim()!==``),u=c??l?.[1]??``;return{id:e.id,label:a,sublabel:u,values:t}},d1=(e,t)=>e===void 0?[]:t.filter(t=>e.templateIds.includes(t.id)||e.dataTemplateIds.includes(t.id)),f1=(e,t)=>{let n=!!e?.webhookId,r=hR(n?void 0:e?.categoryKey),i=gR(e?.categoryKey??``,t,n),a=n?i:r;return{rawItems:a.data??[],isLoadingItems:a.isPending,hasWebhook:n}},p1={all:ai,sales:Ln,admission:ur,leadership:Zr},m1=e=>p1[e]??ai,h1=({audienceId:e,onChange:t})=>{let{data:n=[]}=iZ(),r=n.find(t=>t.id===e)??n[0],i=m1(r?.id??`all`);return(0,D.jsx)(FT,{align:`start`,trigger:(0,D.jsxs)(`button`,{type:`button`,className:Y.audiencePill,"aria-label":`Audience`,children:[(0,D.jsx)(i,{size:12}),` `,r?.label??`Everyone`,(0,D.jsx)(Gn,{size:12})]}),items:n.map(e=>{let n=m1(e.id);return{label:e.label,icon:(0,D.jsx)(n,{size:14}),onSelect:()=>{t(e.id)}}})})},g1=({audienceId:e,onChange:t})=>{let{data:n=[]}=iZ();return(0,D.jsxs)(`div`,{className:Y.audienceSection,children:[(0,D.jsx)(`span`,{className:Y.audienceLabel,children:`Who can see this post?`}),(0,D.jsx)(`div`,{className:Y.audienceRow,children:n.map(n=>{let r=m1(n.id),i=n.id===e;return(0,D.jsxs)(`button`,{type:`button`,className:T(Y.audienceBtn,i&&Y.audienceBtnActive),"aria-pressed":i,onClick:()=>{t(n.id)},children:[(0,D.jsx)(r,{size:14}),` `,n.label,i&&(0,D.jsx)(Wn,{size:13})]},n.id)})})]})},_1=({user:e,isSelected:t,onToggleTag:n})=>(0,D.jsxs)(`button`,{type:`button`,className:T(Y.tagRow,t&&Y.tagRowActive),onClick:()=>{n(e)},children:[(0,D.jsxs)(`div`,{className:Y.tagRowContent,children:[(0,D.jsx)(`span`,{className:Y.tagAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`div`,{className:Y.tagInfo,children:[(0,D.jsx)(`span`,{className:Y.tagName,children:e.name}),(0,D.jsx)(`span`,{className:Y.tagRole,children:e.role})]})]}),(0,D.jsx)(`div`,{className:T(Y.tagCheckbox,t&&Y.tagCheckboxActive),children:(0,D.jsx)(Wn,{size:12})})]}),v1=({isSearching:e,isPending:t,search:n,activeList:r,taggedUserIds:i,onToggleTag:a})=>e?t?(0,D.jsx)(`span`,{className:Y.actionBarLabel,style:{display:`block`,textAlign:`center`,padding:`20px 0`},children:`Searching...`}):r.length===0?(0,D.jsxs)(`span`,{className:Y.actionBarLabel,style:{display:`block`,textAlign:`center`,padding:`20px 0`},children:[`No teammates found matching "`,n,`".`]}):(0,D.jsx)(D.Fragment,{children:r.map(e=>(0,D.jsx)(_1,{user:e,isSelected:i.includes(e.id),onToggleTag:a},e.id))}):(0,D.jsx)(`span`,{className:Y.actionBarLabel,style:{display:`block`,textAlign:`center`,padding:`20px 0`},children:`Type a name or email to search teammates.`}),y1=({taggedUserIds:e,onToggleTag:t})=>{let[r,i]=(0,n.useState)(``),a=oZ(r),{user:o}=_B(),s=r.trim().length>0,c=(a.data??[]).filter(e=>e.id!==o?.id);return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:Y.tagSearch,children:[(0,D.jsx)(Hr,{size:14,className:Y.actionBarLabel}),(0,D.jsx)(`input`,{type:`text`,className:Y.tagSearchInput,placeholder:`Search teammates`,value:r,onChange:e=>{i(e.target.value)}}),r&&(0,D.jsx)(`button`,{type:`button`,onClick:()=>{i(``)},style:{border:`none`,background:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`2px`,color:`var(--color-text-soft)`,borderRadius:`50%`},"aria-label":`Clear search`,children:(0,D.jsx)(ci,{size:14})})]}),(0,D.jsx)(`div`,{className:Y.tagList,children:(0,D.jsx)(v1,{isSearching:s,isPending:a.isPending,search:r,activeList:c,taggedUserIds:e,onToggleTag:t})})]})},b1=({categoryId:e,onCategory:t})=>{let{data:n=[]}=rZ();return(0,D.jsx)(`div`,{className:Y.sheetChips,children:n.map(n=>(0,D.jsx)(`button`,{type:`button`,className:T(Y.catChip,e===n.id&&Y.catChipOn),style:E({"--chip":n.color}),onClick:()=>{t(n)},children:n.label},n.id))})},x1=({feeling:e,onFeeling:t})=>{let{data:n=[]}=aZ();return(0,D.jsx)(`div`,{className:Y.feelGrid,children:n.map(n=>(0,D.jsxs)(`button`,{type:`button`,className:T(Y.feelBtn,e===n.id&&Y.feelBtnOn),onClick:()=>{t(n.id)},children:[(0,D.jsx)(`span`,{className:Y.feelEmoji,children:n.emoji}),n.label]},n.id))})},S1=(e,t)=>{let n={};return Object.entries(t).forEach(([e,t])=>{n[e.toLowerCase()]=t}),e.replace(/\{\{\s*([a-z0-9_]+)\s*\}\}/gi,(e,t)=>n[t.toLowerCase()]??``)},C1=e=>e.length>120?`${e.slice(0,120)}…`:e,w1=(e,t,n,r)=>{t(e),e.dataTemplateIds.length>0||e.templateIds.length>0?n(`item`):r()},T1=(e,t)=>{t(`item`)},E1=e=>{let t=new Set,n=/\{\{\s*([a-z0-9_]+)\s*\}\}/gi;return e.forEach(e=>{let r=`${e.postTitle} ${e.postBody}`.matchAll(n);for(let e of r)e[1]!==void 0&&t.add(e[1].toLowerCase())}),t},D1=({item:e,templates:t})=>{let n=E1(t),r=Object.entries(e.values).filter(([e,t])=>(n.size===0||n.has(e.toLowerCase()))&&e!==`item_title`&&e!==`student_name`&&e!==`university_name`&&e!==`course_name`&&e!==`name`&&e!==`title`&&e!==`item_description`&&e!==`university`&&e!==`status`&&t.trim()!==``);return r.length===0?null:(0,D.jsx)(`div`,{className:Y.itemMetaRow,children:r.map(([e,t])=>(0,D.jsxs)(`span`,{className:Y.itemBadge,children:[e.replace(/_/g,` `),`: `,t]},e))})},O1=({item:e,templates:t,onSelect:n})=>{let r=e.label,i=(0,D.jsxs)(D.Fragment,{children:[e.sublabel!==``&&(0,D.jsx)(`span`,{className:Y.templateItemSub,children:e.sublabel}),(0,D.jsx)(D1,{item:e,templates:t})]});if(t.length>0&&t[0]!==void 0){let n=t[0],a=new Date,o={item_count:`1`,current_year:String(a.getFullYear()),current_date:a.toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`}),...e.values};r=S1(n.postTitle,o),i=(0,D.jsx)(`span`,{className:Y.templateItemSub,children:C1(S1(n.postBody,o))})}return(0,D.jsxs)(`button`,{type:`button`,className:Y.templateItem,onClick:()=>{n(e)},children:[(0,D.jsx)(`div`,{className:Y.itemIconContainer,children:(0,D.jsx)(sr,{size:16})}),(0,D.jsxs)(`div`,{className:Y.templateItemBody,children:[(0,D.jsx)(`span`,{className:Y.templateItemTitle,children:r}),i]}),(0,D.jsx)(`span`,{className:Y.templateUseBtn,children:`SELECT`})]})},k1=({category:e,items:t,templates:r,searchQuery:i,onSearchQuery:a,isLoading:o,onBack:s,onSelectItem:c})=>{let[l,u]=(0,n.useState)(``),d=a!==void 0,f=d?i??``:l,p=d?a:u,m=d||f.trim()===``?t:t.filter(e=>[e.label,e.sublabel,e.id].join(` `).toLowerCase().includes(f.toLowerCase()));return(0,D.jsxs)(`div`,{className:Y.templateSheet,children:[(0,D.jsxs)(`div`,{className:Y.templateSheetHeader,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.templateBackBtn,onClick:s,children:(0,D.jsx)(jn,{size:14})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:Y.templateSheetTitle,children:`Select Item`}),(0,D.jsxs)(`span`,{className:Y.templateSheetMeta,children:[`Showing items for `,(0,D.jsx)(`strong`,{children:e.label})]})]})]}),(0,D.jsxs)(`div`,{className:Y.templateSearch,children:[(0,D.jsx)(Hr,{size:13,className:Y.templateSearchIcon}),(0,D.jsx)(`input`,{type:`text`,className:Y.templateSearchInput,placeholder:`Search items…`,value:f,onChange:e=>{p(e.target.value)}}),o&&m.length>0&&(0,D.jsx)(`div`,{style:{marginLeft:`8px`,display:`flex`,alignItems:`center`},children:(0,D.jsx)(gi,{size:`sm`})})]}),(0,D.jsx)(`div`,{className:Y.templateList,children:o&&m.length===0?(0,D.jsx)(`div`,{style:{padding:`2rem`,display:`flex`,justifyContent:`center`},children:(0,D.jsx)(gi,{})}):m.length===0?(0,D.jsx)(`p`,{className:Y.templateEmpty,children:`No items found.`}):m.map(e=>(0,D.jsx)(O1,{item:e,templates:r,onSelect:c},e.id))})]})},A1=({selectedItem:e,templates:t,onBack:n,onUse:r})=>(0,D.jsxs)(`div`,{className:Y.templateSheet,children:[(0,D.jsxs)(`div`,{className:Y.templateSheetHeader,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.templateBackBtn,onClick:n,children:(0,D.jsx)(jn,{size:14})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:Y.templateSheetTitle,children:`Choose Template`}),(0,D.jsxs)(`span`,{className:Y.templateSheetMeta,children:[e.label,` · `,(0,D.jsx)(`strong`,{children:e.sublabel})]})]})]}),(0,D.jsx)(`div`,{className:Y.templateList,children:t.length===0?(0,D.jsx)(`p`,{className:Y.templateEmpty,children:`No templates linked to this category.`}):t.map(t=>{let n=new Date,i={item_count:`1`,current_year:String(n.getFullYear()),current_date:n.toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`}),...e.values},a=S1(t.postBody,i),o=S1(t.postTitle,i);return(0,D.jsxs)(`button`,{type:`button`,className:Y.templateItem,onClick:()=>{r(o,a)},children:[(0,D.jsxs)(`div`,{className:Y.templateItemBody,children:[(0,D.jsx)(`span`,{className:Y.templateItemTitle,children:t.name}),(0,D.jsx)(`span`,{className:Y.templateItemSub,children:C1(a)})]}),(0,D.jsxs)(`span`,{className:Y.templateUseBtn,children:[(0,D.jsx)(Wn,{size:11}),`USE`]})]},t.id)})})]}),j1=({category:e})=>e===void 0?null:(0,D.jsx)(`div`,{className:Y.compChips,children:(0,D.jsxs)(`span`,{className:Y.compChip,children:[`🏷️ `,e.label]})}),M1=({sheet:e,location:t,onSheet:n,onToggleLocation:r,showPhoto:i=!0})=>(0,D.jsxs)(`div`,{className:Y.actionBar,children:[(0,D.jsx)(`span`,{className:Y.actionBarLabel,children:`Add to your post`}),(0,D.jsxs)(`div`,{className:Y.actionBarBtns,children:[i&&(0,D.jsx)(`button`,{type:`button`,title:`Photo/video`,className:T(Y.actionIcon,e===`photo`&&Y.actionIconActive),onClick:()=>{n(`photo`)},children:(0,D.jsx)(mr,{size:15})}),(0,D.jsx)(`button`,{type:`button`,title:`Tag people`,className:T(Y.actionIcon,e===`tag`&&Y.actionIconActive),onClick:()=>{n(`tag`)},children:(0,D.jsx)(ii,{size:15})}),(0,D.jsx)(`button`,{type:`button`,title:`Feeling/activity`,className:T(Y.actionIcon,e===`feeling`&&Y.actionIconActive),onClick:()=>{n(`feeling`)},children:(0,D.jsx)(Yr,{size:15})}),(0,D.jsx)(`button`,{type:`button`,title:`Location`,className:T(Y.actionIcon,t!==null&&Y.actionIconActive),onClick:r,children:(0,D.jsx)(yr,{size:15})}),(0,D.jsx)(`button`,{type:`button`,title:`Category`,className:T(Y.actionIcon,(e===`category`||e===`item`||e===`template`)&&Y.actionIconActive),onClick:()=>{n(`category`)},children:(0,D.jsx)(Qr,{size:15})})]})]}),N1=({currentCategory:e,categoryItems:t,categoryTemplates:n,searchQuery:r,onSearchQuery:i,isLoadingItems:a,onSetSheet:o,onSelectItem:s})=>(0,D.jsx)(k1,{category:e,items:t,templates:n.filter(t=>e.dataTemplateIds.includes(t.id)),searchQuery:r,onSearchQuery:i,isLoading:a,onBack:()=>{o(`category`)},onSelectItem:e=>{s(e),o(`template`)}}),P1=({currentCategory:e,categoryTemplates:t,selectedItem:n,onSetSheet:r,onApplyTemplate:i})=>n===null?null:(0,D.jsx)(A1,{selectedItem:n,templates:t.filter(t=>e?.templateIds.includes(t.id)),onBack:()=>{T1(e,r)},onUse:i}),F1=e=>{let{sheet:t,categoryId:n,feeling:r,taggedUserIds:i,selectedItem:a,categoryItems:o,categoryTemplates:s,currentCategory:c,onCategory:l,onFeeling:u,onToggleTag:d,onSelectItem:f,onApplyTemplate:p,onClose:m,onSetSheet:h,searchQuery:g,onSearchQuery:_,isLoadingItems:v}=e;switch(t){case`category`:return(0,D.jsx)(b1,{categoryId:n,onCategory:e=>{w1(e,l,h,m)}});case`feeling`:return(0,D.jsx)(x1,{feeling:r,onFeeling:u});case`tag`:return(0,D.jsx)(y1,{taggedUserIds:i,onToggleTag:d});case`item`:return c===void 0?null:(0,D.jsx)(N1,{currentCategory:c,categoryItems:o,categoryTemplates:s,searchQuery:g,onSearchQuery:_,isLoadingItems:v,onSetSheet:h,onSelectItem:f});case`template`:return(0,D.jsx)(P1,{currentCategory:c,categoryTemplates:s,selectedItem:a,onSetSheet:h,onApplyTemplate:p});case null:case`photo`:return null;default:return null}},I1=e=>{let{sheet:t,onClose:n}=e;if(t===null||t===`photo`)return null;let r=t!==`item`&&t!==`template`;return(0,D.jsxs)(`div`,{className:Y.sheet,children:[r&&(0,D.jsxs)(`div`,{className:Y.sheetHead,children:[(0,D.jsx)(`span`,{className:Y.sheetLabel,children:t1[t]}),(0,D.jsx)(`button`,{type:`button`,className:Y.sheetClose,"aria-label":`Close`,onClick:n,children:(0,D.jsx)(ci,{size:14})})]}),(0,D.jsx)(F1,{...e})]})},L1=e=>e.map(e=>({url:URL.createObjectURL(e),name:e.name,size:e.size,file:e})),R1=({onOpen:e})=>(0,D.jsxs)(`button`,{type:`button`,className:Y.dropzone,onClick:e,children:[(0,D.jsx)(`span`,{className:Y.dropIcon,children:(0,D.jsx)($n,{size:20})}),(0,D.jsx)(`span`,{className:Y.dropTitle,children:`Click to upload or drag & drop`}),(0,D.jsx)(`span`,{className:Y.dropHint,children:`Supported image formats: PNG, JPG, JPEG, GIF, WEBP, HEIC (Max 10MB)`})]}),z1=({photos:e,onOpen:t,onRemove:n})=>(0,D.jsxs)(`div`,{className:Y.photoGrid,children:[e.map(e=>(0,D.jsxs)(`div`,{className:Y.photoThumb,children:[(0,D.jsx)(`img`,{src:e.url,alt:e.name,className:Y.photoImg}),(0,D.jsx)(`button`,{type:`button`,className:Y.photoRemove,"aria-label":`Remove ${e.name}`,onClick:()=>{n(e.id)},children:(0,D.jsx)(ci,{size:12})})]},e.id)),(0,D.jsx)(`button`,{type:`button`,className:Y.photoAddMore,"aria-label":`Add more photos`,onClick:t,children:(0,D.jsx)(pr,{size:18})})]}),B1=(e,t)=>L1(e).map((e,n)=>({id:`${e.name}-${String(e.size)}-${String(t+n)}`,url:e.url,name:e.name,file:e.file})),V1=async e=>{if(e.files===null)return;let t=5-e.currentCount;if(t<=0){j.error(`You can only upload a maximum of 5 images.`);return}let n=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/heic`,`image/heif`],r=e=>{if(n.includes(e.type))return!0;let t=e.name.split(`.`).pop()?.toLowerCase();return t===`heic`||t===`heif`},i=10*1024*1024,a=Array.from(e.files);a.some(e=>!r(e))&&j.error(`Only PNG, JPG, JPEG, GIF, WEBP, and HEIC images are supported.`);let o=a.filter(r);o.filter(e=>e.size>i).length>0&&j.error(`Some images exceed the 10MB limit and were skipped.`);let s=o.filter(e=>e.size<=i).slice(0,t);if(s.length===0)return;o.length>t&&j.error(`Only the first ${String(t)} images were added. Maximum limit is 5.`);let c=B1(await Promise.all(s.map(e=>vZ(e))),e.existingPicked.length);if(c.length===0)return;let l=[...e.existingPicked,...c];e.onResult(l,l.map(e=>e.file))},H1=({photos:e,setPhotos:t})=>{let[r,i]=(0,n.useState)([]),[a,o]=(0,n.useState)(!1),s=(0,n.useRef)(null),c=(0,n.useRef)([]);c.current=r,(0,n.useEffect)(()=>()=>{for(let e of c.current)URL.revokeObjectURL(e.url)},[]);let l=n=>{V1({files:n,currentCount:e.length,existingPicked:r,onResult:(e,n)=>{i(e),t(n)}})};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`input`,{ref:s,type:`file`,accept:`image/*`,multiple:!0,className:Y.photoInput,onChange:e=>{l(e.target.files),s.current!==null&&(s.current.value=``)}}),(0,D.jsx)(`div`,{className:T(Y.photoZone,a&&Y.photoZoneDrag),onDragOver:e=>{e.preventDefault(),o(!0)},onDragLeave:()=>{o(!1)},onDrop:e=>{e.preventDefault(),o(!1),l(e.dataTransfer.files)},children:r.length===0?(0,D.jsx)(R1,{onOpen:()=>s.current?.click()}):(0,D.jsx)(z1,{photos:r,onOpen:()=>s.current?.click(),onRemove:e=>{i(n=>{let r=n.find(t=>t.id===e);r!==void 0&&URL.revokeObjectURL(r.url);let i=n.filter(t=>t.id!==e);return t(i.map(e=>e.file)),i})}})})]})},U1=({value:e,onChange:t,className:n})=>(0,D.jsx)(`input`,{className:T(Y.titleInput,n),placeholder:`Add a headline (optional)`,value:e,onChange:e=>{t(e.target.value)}}),W1=({on:e,onToggle:t})=>(0,D.jsxs)(`div`,{className:Y.compOption,children:[(0,D.jsxs)(`span`,{className:Y.compOptionLabel,children:[(0,D.jsx)(Xn,{size:14}),` Must-read — require acknowledgement`]}),(0,D.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":`Require acknowledgement`,className:T(Y.switch,e&&Y.switchOn),onClick:t,children:(0,D.jsx)(`span`,{className:Y.switchKnob})})]}),G1=(e,t)=>{let{detectLocation:n}=WX();return()=>{if(e!==null){t(null);return}t(`Detecting location...`),n.execute().then(e=>{t(t=>t===`Detecting location...`?e.ok?e.value:`London Office`:t)})}},K1=e=>{let{category:t,feeling:n,location:r,sheet:i,categoryId:a,audienceId:o,mustRead:s,taggedUserIds:c,selectedItem:l,categoryItems:u,categoryTemplates:d,setSheet:f,setLocation:p,setCategoryId:m,setFeeling:h,setAudienceId:g,setMustRead:_,onToggleTag:v,onSelectItem:y,onApplyTemplate:b,photos:x,setPhotos:S,isEditMode:C,editImagesNode:ee}=e,te=G1(r,p);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(j1,{category:t}),C?ee:(i===`photo`||x.length>0)&&(0,D.jsx)(H1,{photos:x,setPhotos:S}),(0,D.jsx)(M1,{sheet:i,location:r,onSheet:e=>{f(t=>t===e?null:e)},onToggleLocation:te,showPhoto:!C||ee===void 0||i===`photo`}),(0,D.jsx)(I1,{sheet:i,categoryId:a,feeling:n,taggedUserIds:c,selectedItem:l,categoryItems:u,categoryTemplates:d,currentCategory:t,onCategory:m,onFeeling:e=>{h(t=>t===e?null:e)},onToggleTag:v,onSelectItem:y,onApplyTemplate:b,onClose:()=>{f(null)},onSetSheet:f,searchQuery:e.searchQuery,onSearchQuery:e.onSearchQuery,isLoadingItems:e.isLoadingItems}),(0,D.jsx)(g1,{audienceId:o,onChange:g}),(0,D.jsx)(W1,{on:s,onToggle:()=>{_(e=>!e)}})]})},q1=({length:e,limit:t,color:n,fontSize:r,padding:i})=>(0,D.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,fontSize:r,color:n===`danger`?`var(--color-danger)`:`var(--color-text-soft)`,padding:i,fontWeight:500},children:[e,` / `,t]}),J1=e=>{let{title:t,setTitle:n,body:r,setBody:i,bodyPlaceholder:a,isEditMode:o=!1,editImagesNode:s}=e,c=pi(t,300,250),l=pi(r,8e3,7e3);return(0,D.jsxs)(D.Fragment,{children:[o?(0,D.jsx)(`input`,{type:`text`,className:T(Y.titleInput,c.isOverLimit&&Y.textareaError),value:t,placeholder:`Add a headline (optional)...`,onChange:e=>{n(e.target.value)},style:{width:`100%`}}):(0,D.jsx)(U1,{value:t,onChange:n,className:c.isOverLimit?Y.textareaError:void 0}),c.showCounter&&(0,D.jsx)(q1,{length:c.length,limit:300,color:c.counterColor,fontSize:`11px`,padding:`2px 16px 4px`}),(0,D.jsx)(`textarea`,{className:T(Y.textarea,l.isOverLimit&&Y.textareaError),placeholder:a,value:r,onChange:e=>{i(e.target.value)},style:o?{width:`100%`,minHeight:`100px`}:void 0}),l.showCounter&&(0,D.jsx)(q1,{length:l.length,limit:8e3,color:l.counterColor,fontSize:`12px`,padding:`2px 16px 6px`}),(0,D.jsx)(K1,{...e,isEditMode:o,...s===void 0?{}:{editImagesNode:s}})]})},Y1=({authorInfo:e,audienceId:t,taggedUsers:n,feeling:r,location:i,onAudience:a,onClose:o})=>{let{data:s=[]}=aZ(),c=s.find(e=>e.id===r);return(0,D.jsxs)(`div`,{className:Y.compHead,style:o?void 0:{borderBottom:`none`,padding:`0 0 10px`},children:[(0,D.jsxs)(`div`,{className:Y.compAvatarWrapper,children:[(0,D.jsx)(`span`,{className:Y.compAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),o&&(0,D.jsx)(`span`,{className:Y.statusDot})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:Y.compHeaderTagline,children:[(0,D.jsx)(`strong`,{children:e.name}),c&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:Y.compMutedText,children:` is feeling `}),(0,D.jsxs)(`strong`,{children:[c.emoji,` `,c.label]})]}),i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:Y.compMutedText,children:r||n.length>0?n.length>0?` at `:` — at `:` is at `}),(0,D.jsx)(`strong`,{children:i===`Detecting location...`?`Detecting...`:i})]})]}),n.length>0&&(0,D.jsx)(`div`,{className:Y.taggedTagline,children:lZ(n).map((e,t)=>{let n=!o&&t===0&&e.text.startsWith(`with `)&&!r?`is ${e.text}`:e.text;return e.bold?(0,D.jsx)(`strong`,{children:n},t):n})}),(0,D.jsx)(h1,{audienceId:t,onChange:a})]}),o&&(0,D.jsx)(`button`,{type:`button`,className:Y.compClose,"aria-label":`Close`,onClick:o,children:(0,D.jsx)(ci,{size:16})})]})},X1=e=>e.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `),Z1=e=>X1((e.split(`@`)[0]??e).replace(/[._-]+/g,` `)),Q1=(e,t)=>{let n=e.length>0?e:t;return n.includes(`@`)?Z1(n):n},$1=(e,t,n)=>{let r=e.length>0?e:t;return r.length===0||r.includes(`@`)?Q1(t,n):r},e0=(e,t,n)=>e!==void 0&&e.trim().length>0?e:t?di(n):`?`,t0=(e,t,n)=>e!==void 0&&e.trim().length>0?e:t?fi(n):`#6b7280`,n0=(e,t)=>{if(!t)return{name:``,initials:`?`,color:`#6b7280`};let n=$1(e?e.name:``,t.fullName,t.email.value);return{name:n,initials:e0(e?e.initials:void 0,!0,n),color:t0(e?e.color:void 0,!0,t.id)}};function r0({profile:e,onClose:t}){let{data:r=[]}=rZ(),i=l1(t,r),a=i.category,[o,s]=(0,n.useState)(``),{rawItems:c,isLoadingItems:l,hasWebhook:u}=f1(a,o),{data:d=[]}=mR(),f=d1(a,d),p=c.map(u1);return(0,D.jsxs)(`div`,{className:Y.composer,children:[(0,D.jsx)(Y1,{authorInfo:e,audienceId:i.audienceId,taggedUsers:i.taggedUsers,feeling:i.feeling,location:i.location,onAudience:i.setAudienceId,onClose:t}),(0,D.jsx)(J1,{title:i.title,setTitle:i.setTitle,body:i.body,setBody:i.setBody,bodyPlaceholder:`What's on your mind, ${e.name.split(` `)[0]??``}?`,category:i.category,feeling:i.feeling,location:i.location,sheet:i.sheet,categoryId:i.categoryId,audienceId:i.audienceId,mustRead:i.mustRead,taggedUserIds:i.taggedUsers.map(e=>e.id),selectedItem:i.selectedItem,categoryItems:p,categoryTemplates:f,setSheet:i.setSheet,setLocation:i.setLocation,setCategoryId:e=>{s(``),i.setCategoryId(e.id)},setFeeling:i.setFeeling,setAudienceId:i.setAudienceId,setMustRead:i.setMustRead,onToggleTag:i.toggleTag,onSelectItem:i.setSelectedItem,onApplyTemplate:i.applyTemplate,photos:i.photos,setPhotos:i.setPhotos,isEditMode:!1,searchQuery:o,onSearchQuery:u?s:void 0,isLoadingItems:l}),i.mode===`schedule`&&(0,D.jsx)(r1,{value:i.schedule,onChange:i.setSchedule,timezone:i.timezone}),(0,D.jsx)(i1,{mode:i.mode,disabled:i.submitDisabled,onMode:i.setMode,onCancel:t,onSubmit:()=>{i.submit()}})]})}var i0=()=>{let[e,t]=(0,n.useState)(!1),{user:r}=_B(),i=uF(),a=n0(i.data,r),o=i.isPending;if(!e){let e=o?``:a.name.split(` `)[0]??``,n=e.length>0?`What's on your mind, ${e}?`:`What's on your mind?`;return(0,D.jsxs)(`div`,{className:Y.composerCollapsed,children:[o?(0,D.jsx)(ZE,{variant:`circle`,width:`36px`,height:`36px`}):(0,D.jsx)(`span`,{className:Y.ccAvatar,style:E({"--avatar-color":a.color}),children:a.initials}),(0,D.jsx)(`button`,{type:`button`,className:Y.ccInput,onClick:()=>{t(!0)},children:n})]})}return(0,D.jsx)(r0,{profile:a,onClose:()=>{t(!1)}})},a0=()=>(0,D.jsxs)(`div`,{className:Y.emptyState,children:[(0,D.jsx)(`div`,{className:Y.emptyIconWrap,children:(0,D.jsx)(hr,{size:32})}),(0,D.jsx)(`h3`,{className:Y.emptyTitle,children:`It's quiet in here`}),(0,D.jsx)(`p`,{className:Y.emptyText,children:`There are no posts in this feed yet. Be the first to share an update!`})]}),o0=({post:e,taggedUsers:t})=>(0,D.jsxs)(`div`,{className:Y.compHeaderTagline,style:{display:`block`,fontSize:`14px`,lineHeight:`1.4`},children:[(0,D.jsx)(`span`,{className:Y.authorName,style:{fontWeight:600,color:`var(--color-text-main)`},children:e.authorName}),e.feelingEmoji&&e.feelingLabel&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{style:{color:`var(--color-text-soft)`},children:` is feeling `}),(0,D.jsxs)(`span`,{style:{fontWeight:600,color:`var(--color-text-main)`},children:[e.feelingEmoji,` `,e.feelingLabel]})]}),t.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{children:` `}),lZ(t).map((t,n)=>{let r=n===0&&t.text.startsWith(`with `)&&!e.feelingId?`is ${t.text}`:t.text;return(0,D.jsx)(`span`,{style:{fontWeight:t.bold?600:`normal`,color:t.bold?`var(--color-text-main)`:`var(--color-text-soft)`},children:r},n)})]}),e.locationLabel&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{style:{color:`var(--color-text-soft)`},children:e.feelingId||t.length>0?t.length>0?` at `:` — at `:` is at `}),(0,D.jsx)(`span`,{style:{fontWeight:600,color:`var(--color-text-main)`},children:e.locationLabel})]})]}),s0=({post:e,taggedUsers:t})=>{let n=JN().display;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:Y.avatar,style:E({"--avatar-color":e.authorColor}),children:e.authorInitials}),(0,D.jsxs)(`div`,{className:Y.cardAuthor,children:[(0,D.jsx)(o0,{post:e,taggedUsers:t}),(0,D.jsxs)(`div`,{className:Y.metaRow,style:{marginTop:`4px`,display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`12px`,color:`var(--color-text-soft)`},children:[e.authorRole&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{children:e.authorRole}),(0,D.jsx)(`span`,{style:{color:`var(--color-text-muted)`},children:`·`})]}),(0,D.jsx)(`span`,{children:gZ(e.createdAt,n,e.scheduledAt)}),(0,D.jsx)(`span`,{style:{color:`var(--color-text-muted)`},children:`·`}),(0,D.jsx)(`span`,{children:e.audienceLabel}),(0,D.jsx)(`span`,{style:{color:`var(--color-text-muted)`},children:`·`}),(0,D.jsxs)(`span`,{children:[e.seenCount,` `,e.seenCount===1?`view`:`views`]})]})]})]})},c0=e=>{let t=UQ({page:1,pageSize:1e3,filter:``,department:``,accessRole:``,branch:``,status:`all`}).data;return t?t.users.filter(t=>e.includes(t.id)):[]},l0=({post:e,onBookmark:t,onPin:n,showPinButton:r,onEdit:i,showEditButton:a})=>{let o=c0(e.taggedUserIds),{categoryLabel:s,categoryColor:c}=cZ(e);return(0,D.jsxs)(`header`,{className:Y.cardHead,children:[(0,D.jsx)(s0,{post:e,taggedUsers:o}),(0,D.jsxs)(`div`,{className:Y.cardRight,children:[(0,D.jsxs)(`span`,{className:Y.badge,style:E({"--badge-color":c}),children:[(0,D.jsx)(`span`,{className:Y.badgeDot}),s]}),(0,D.jsxs)(`div`,{className:Y.cardActions,children:[(0,D.jsx)(`button`,{type:`button`,className:T(Y.bookmarkBtn,e.bookmarked&&Y.bookmarkActive),"aria-label":e.bookmarked?`Remove bookmark`:`Save post`,onClick:t,children:(0,D.jsx)(In,{size:15,fill:e.bookmarked?`currentColor`:`none`})}),r&&n&&(0,D.jsx)(`button`,{type:`button`,className:T(Y.pinBtn,e.pinned&&Y.pinActive),"aria-label":e.pinned?`Unpin post`:`Pin post`,onClick:n,children:(0,D.jsx)(Nr,{size:15,fill:e.pinned?`currentColor`:`none`})}),a&&i&&(0,D.jsx)(`button`,{type:`button`,className:Y.editBtn,"aria-label":`Edit post`,onClick:i,children:(0,D.jsx)(kr,{size:15})})]})]})]})},u0=({url:e,onRemove:t})=>(0,D.jsxs)(`div`,{className:Y.photoThumb,children:[(0,D.jsx)(`img`,{src:e,alt:`thumbnail`,className:Y.photoImg}),(0,D.jsx)(`button`,{type:`button`,onClick:t,className:Y.photoRemove,children:(0,D.jsx)(ci,{size:12})})]}),d0=({file:e,onRemove:t})=>{let[r,i]=(0,n.useState)(``);return(0,n.useEffect)(()=>{let t=URL.createObjectURL(e);return i(t),()=>{URL.revokeObjectURL(t)}},[e]),r?(0,D.jsx)(u0,{url:r,onRemove:t}):null},f0=({existingImages:e,newPhotos:t,onAddPhotos:r,onRemoveExisting:i,onRemoveNew:a})=>{let o=(0,n.useRef)(null);return e.length===0&&t.length===0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`input`,{ref:o,type:`file`,multiple:!0,accept:`image/*`,onChange:e=>{e.target.files!==null&&e.target.files.length>0&&r(e.target.files)},style:{display:`none`}}),(0,D.jsx)(R1,{onOpen:()=>o.current?.click()})]}):(0,D.jsxs)(`div`,{className:Y.photoGrid,children:[e.map(e=>(0,D.jsx)(u0,{url:e,onRemove:()=>{i(e)}},e)),t.map((e,t)=>(0,D.jsx)(d0,{file:e,onRemove:()=>{a(t)}},t)),(0,D.jsxs)(`label`,{className:Y.photoAddMore,children:[(0,D.jsx)(pr,{size:18}),(0,D.jsx)(`input`,{type:`file`,multiple:!0,accept:`image/*`,onChange:e=>{e.target.files!==null&&e.target.files.length>0&&r(e.target.files)},style:{display:`none`}})]})]})},p0=e=>({id:e.id,name:e.fullName,email:e.email,userName:e.fullName,role:e.roleName,initials:e.initials,color:e.color}),m0=e=>{let[t,r]=(0,n.useState)(e),[i,a]=(0,n.useState)([]);return{existingImages:t,setExistingImages:r,newPhotos:i,setNewPhotos:a,handleAddPhotos:async e=>{let n=5-(t.length+i.length);if(n<=0){j.error(`You can only have a maximum of 5 images.`);return}let r=Array.from(e).filter(e=>e.type.startsWith(`image/`)||e.name.toLowerCase().endsWith(`.heic`)||e.name.toLowerCase().endsWith(`.heif`)),o=10*1024*1024;r.filter(e=>e.size>o).length>0&&j.error(`Some images exceed the 10MB limit and were skipped.`);let s=r.filter(e=>e.size<=o),c=s.slice(0,n);s.length>n&&j.error(`Only the first ${String(n)} images were added. Maximum limit is 5.`);let l=await Promise.all(c.map(e=>vZ(e)));a(e=>[...e,...l])},handleRemoveExisting:e=>{r(t=>t.filter(t=>t!==e))},handleRemoveNew:e=>{a(t=>t.filter((t,n)=>n!==e))}}},h0=(e,t,r)=>{let[i,a]=(0,n.useState)(e.department??`general`),[o,s]=(0,n.useState)(e.audienceId),[c,l]=(0,n.useState)(e.feelingId),[u,d]=(0,n.useState)(e.locationLabel),[f,p]=(0,n.useState)(e.mustAcknowledge),[m,h]=(0,n.useState)(null),[g,_]=(0,n.useState)(null),[v,y]=(0,n.useState)(t.filter(t=>e.taggedUserIds.includes(t.id)).map(p0));return{categoryId:i,setCategoryId:a,audienceId:o,setAudienceId:s,feeling:c,setFeeling:l,location:u,setLocation:d,mustRead:f,setMustRead:p,taggedUsers:v,setTaggedUsers:y,sheet:m,setSheet:h,selectedItem:g,setSelectedItem:_,toggleTag:e=>{y(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])},handleToggleLocation:()=>{if(u!==null){d(null);return}d(`Detecting location...`),r.execute().then(e=>{d(t=>t===`Detecting location...`?e.ok?e.value:`London Office`:t)})}}},g0=e=>{let t=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,n=e.indexOf(`#`);if(n!==-1){let r=e.substring(n+1);if(t.test(r))return r}let r=(e.split(`?`)[0]??e).split(`/`).pop()??``;return t.test(r)?r:null},_0=e=>e.map(e=>g0(e)).filter(e=>e!==null),v0=async(e,t)=>{if(e.length===0)return[];let n=await Promise.allSettled(e.map(e=>t(e))),r=[],i=0;for(let e of n)e.status===`fulfilled`?r.push(e.value):i+=1;return i>0&&j.error(`${String(i)} image${i>1?`s`:``} failed to upload.`),r},y0=async({post:e,editTitle:t,editBody:n,photosState:r,composerState:i,updatePostMutation:a,uploadImageMutation:o,setIsEditing:s})=>{if(t.trim().length>300){j.error(`Post title cannot exceed 300 characters.`);return}if(n.trim().length>8e3){j.error(`Post body cannot exceed 8000 characters.`);return}try{let c=await v0(r.newPhotos,e=>o.mutateAsync(e)),l=_0(r.existingImages);a.mutate({postId:e.id,input:{title:t.trim()||null,body:n,imageIds:[...l,...c],categoryId:i.categoryId,audienceId:i.audienceId,mustAcknowledge:i.mustRead,taggedUserIds:i.taggedUsers.map(e=>e.id),feelingId:i.feeling,locationLabel:i.location,scheduledAt:e.scheduledAt,isRecurring:e.isRecurring,recurrenceFrequency:e.recurrenceFrequency}},{onSuccess:()=>{s(!1),r.setNewPhotos([])},onError:()=>{j.error(`Failed to update the post. Please try again.`)}})}catch{j.error(`Failed to process post images. Please try again.`)}},b0=({post:e,setTitle:t,setBody:n,photos:r,composer:i,allUsers:a})=>{t(e.title??``),n(e.body),r.setExistingImages(e.imageUrls),r.setNewPhotos([]),i.setCategoryId(e.department??`general`),i.setAudienceId(e.audienceId),i.setFeeling(e.feelingId),i.setLocation(e.locationLabel),i.setMustRead(e.mustAcknowledge),i.setSheet(null),i.setSelectedItem(null),i.setTaggedUsers(a.filter(t=>e.taggedUserIds.includes(t.id)).map(p0))},x0=()=>{let[e,t]=(0,n.useState)(!1),[r,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(null),[s,c]=(0,n.useState)(!1);return{commentsOpen:e,setCommentsOpen:t,shareOpen:r,setShareOpen:i,lightboxIndex:a,setLightboxIndex:o,isEditing:s,setIsEditing:c}},S0={page:1,pageSize:1e3,filter:``,department:``,accessRole:``,branch:``,status:`all`},C0=e=>{let t=x0(),[r,i]=(0,n.useState)(e.title??``),[a,o]=(0,n.useState)(e.body),s=UQ(S0).data?.users??[],{detectLocation:c}=WX(),l=m0(e.imageUrls),u=h0(e,s,c),d=XX(),f=sZ();return(0,n.useEffect)(()=>{t.isEditing||b0({post:e,setTitle:i,setBody:o,photos:l,composer:u,allUsers:s})},[t.isEditing,e,s]),{...t,editTitle:r,setEditTitle:i,editBody:a,setEditBody:o,existingImages:l.existingImages,newPhotos:l.newPhotos,isPending:d.isPending||f.isPending,handleAddPhotos:e=>{l.handleAddPhotos(e)},handleRemoveExisting:l.handleRemoveExisting,handleRemoveNew:l.handleRemoveNew,handleSave:()=>{y0({post:e,editTitle:r,editBody:a,photosState:l,composerState:u,updatePostMutation:d,uploadImageMutation:f,setIsEditing:t.setIsEditing})},handleCancel:()=>{b0({post:e,setTitle:i,setBody:o,photos:l,composer:u,allUsers:s}),t.setIsEditing(!1)},categoryId:u.categoryId,setCategoryId:u.setCategoryId,audienceId:u.audienceId,setAudienceId:u.setAudienceId,feeling:u.feeling,setFeeling:u.setFeeling,location:u.location,setLocation:u.setLocation,mustRead:u.mustRead,setMustRead:u.setMustRead,taggedUsers:u.taggedUsers,sheet:u.sheet,setSheet:u.setSheet,selectedItem:u.selectedItem,setSelectedItem:u.setSelectedItem,toggleTag:u.toggleTag,handleToggleLocation:u.handleToggleLocation}},w0=()=>{},T0=({isPending:e,body:t,onSave:n,onCancel:r})=>(0,D.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`},children:[(0,D.jsx)(`button`,{type:`button`,onClick:r,style:{padding:`6px 12px`,borderRadius:`6px`,border:`1px solid var(--color-border)`,background:`transparent`,color:`var(--color-text-soft)`,cursor:`pointer`},children:`Cancel`}),(0,D.jsx)(`button`,{type:`button`,disabled:e||!t.trim(),onClick:n,style:{padding:`6px 12px`,borderRadius:`6px`,border:`none`,background:`var(--color-primary)`,color:`white`,cursor:`pointer`,opacity:e||!t.trim()?.6:1},children:e?`Saving...`:`Save`})]}),E0=e=>{if(!(e.existingImages.length===0&&e.newPhotos.length===0&&e.sheet!==`photo`))return(0,D.jsx)(f0,{existingImages:e.existingImages,newPhotos:e.newPhotos,onAddPhotos:t=>{e.handleAddPhotos(t)},onRemoveExisting:e.handleRemoveExisting,onRemoveNew:e.handleRemoveNew})},D0=({post:e,state:t})=>{let{data:r=[]}=rZ(),i=r.find(e=>e.id===t.categoryId),[a,o]=(0,n.useState)(``),{rawItems:s,isLoadingItems:c,hasWebhook:l}=f1(i,a),{data:u=[]}=mR(),d=d1(i,u),f=s.map(u1);return(0,D.jsxs)(`div`,{style:{padding:`20px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,D.jsx)(Y1,{authorInfo:{name:e.authorName,initials:e.authorInitials,color:e.authorColor},audienceId:t.audienceId,taggedUsers:t.taggedUsers,feeling:t.feeling,location:t.location,onAudience:t.setAudienceId}),(0,D.jsx)(J1,{title:t.editTitle,setTitle:t.setEditTitle,body:t.editBody,setBody:t.setEditBody,bodyPlaceholder:`What's on your mind?`,category:i,feeling:t.feeling,location:t.location,sheet:t.sheet,categoryId:t.categoryId,audienceId:t.audienceId,mustRead:t.mustRead,taggedUserIds:t.taggedUsers.map(e=>e.id),setSheet:t.setSheet,setLocation:t.setLocation,setCategoryId:e=>{o(``),t.setCategoryId(e.id)},selectedItem:t.selectedItem,categoryItems:f,categoryTemplates:d,onSelectItem:t.setSelectedItem,onApplyTemplate:(e,n)=>{t.setEditTitle(e),t.setEditBody(n),t.setSheet(null),t.setSelectedItem(null)},setFeeling:t.setFeeling,setAudienceId:t.setAudienceId,setMustRead:t.setMustRead,onToggleTag:t.toggleTag,photos:[],setPhotos:w0,isEditMode:!0,searchQuery:a,onSearchQuery:l?o:void 0,isLoadingItems:c,editImagesNode:E0(t)}),(0,D.jsx)(T0,{isPending:t.isPending,body:t.editBody,onSave:t.handleSave,onCancel:t.handleCancel})]})},O0=({comment:e,displayZone:t})=>(0,D.jsxs)(`div`,{className:Y.commentRow,children:[(0,D.jsx)(`span`,{className:Y.commentAvatar,style:E({"--avatar-color":e.authorColor}),children:e.authorInitials}),(0,D.jsxs)(`div`,{className:Y.commentBubble,children:[(0,D.jsxs)(`div`,{className:Y.commentAuthor,children:[e.authorName,` `,(0,D.jsxs)(`span`,{className:Y.commentTime,children:[`· `,gZ(e.createdAt,t)]})]}),(0,D.jsx)(`div`,{className:Y.commentText,children:e.text})]})]}),k0=({profile:e,isViewerLoading:t,pending:r,onAdd:i})=>{let[a,o]=(0,n.useState)(``),s=pi(a,4e3),c=()=>{a.trim()!==``&&(i(a.trim()),o(``))};return(0,D.jsxs)(`div`,{className:Y.commentRow,children:[t?(0,D.jsx)(ZE,{variant:`circle`,width:`26px`,height:`26px`}):(0,D.jsx)(`span`,{className:Y.commentAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:`4px`},children:[(0,D.jsxs)(`div`,{className:T(Y.commentComposer,s.isOverLimit&&Y.commentComposerError),children:[(0,D.jsx)(`input`,{className:Y.commentInput,placeholder:`Write a comment…`,value:a,onChange:e=>{o(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&!s.isOverLimit&&c()}}),(0,D.jsx)(`button`,{type:`button`,className:Y.commentSend,disabled:a.trim()===``||r||s.isOverLimit,onClick:c,children:(0,D.jsx)(Ur,{size:13})})]}),s.showCounter&&(0,D.jsxs)(`div`,{style:{alignSelf:`flex-end`,fontSize:`10px`,color:s.counterColor===`danger`?`var(--color-danger)`:`var(--color-text-soft)`,marginRight:`8px`,fontWeight:500},children:[s.length,` / 4000`]})]})]})},A0=({comments:e,pending:t,onAdd:n})=>{let{user:r}=_B(),i=uF(),a=JN().display,o=n0(i.data,r);return(0,D.jsxs)(`div`,{className:Y.comments,children:[e.map(e=>(0,D.jsx)(O0,{comment:e,displayZone:a},e.id)),(0,D.jsx)(k0,{profile:o,isViewerLoading:i.isPending,pending:t,onAdd:n})]})},j0=({url:e,alt:t,className:n})=>(0,D.jsx)(`img`,{src:e,alt:t,className:n,loading:`lazy`}),M0=({urls:e,onImageClick:t})=>{let n=e.length;if(n===0)return null;let r=Y.grid1;n===2&&(r=Y.grid2),n===3&&(r=Y.grid3),n>=4&&(r=Y.grid4);let i=n>4?e.slice(0,4):e;return(0,D.jsx)(`div`,{className:T(Y.postImagesGrid,r),children:i.map((e,r)=>{let i=r===3&&n>4;return(0,D.jsx)(`div`,{className:T(Y.gridImageWrap,i&&Y.moreImagesOverlay),"data-more":i?`+${String(n-4)}`:void 0,onClick:()=>{t(r)},role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&t(r)},children:(0,D.jsx)(j0,{url:e,alt:`Attached`,className:Y.gridImage})},r)})})},N0=({onClose:e})=>(0,D.jsxs)(`div`,{className:Y.shareHead,children:[(0,D.jsx)(`div`,{className:Y.shareHeadIcon,children:(0,D.jsx)(Rr,{size:15})}),(0,D.jsxs)(`div`,{className:Y.shareHeadText,children:[(0,D.jsx)(`h3`,{className:Y.shareTitle,children:`Share Post`}),(0,D.jsx)(`p`,{className:Y.shareDesc,children:`Share this post to chat conversations`})]}),(0,D.jsx)(`button`,{type:`button`,className:Y.shareCloseBtn,"aria-label":`Close`,onClick:e,children:(0,D.jsx)(ci,{size:18})})]}),P0=({count:e,disabled:t,onCancel:n,onSend:r})=>(0,D.jsxs)(`div`,{className:Y.shareFooter,children:[(0,D.jsx)(`span`,{className:Y.shareFootText,children:e===0?`Select at least one chat`:`${String(e)} ${e===1?`chat`:`chats`} selected`}),(0,D.jsxs)(`div`,{className:Y.shareFootBtns,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.shareCancelBtn,onClick:n,children:`Cancel`}),(0,D.jsxs)(`button`,{type:`button`,className:Y.shareSendBtn,disabled:e===0||t,onClick:r,children:[(0,D.jsx)(Ur,{size:12}),` Send`]})]})]}),F0=({post:e})=>(0,D.jsx)(`div`,{className:Y.sharePreviewWrap,children:(0,D.jsxs)(`div`,{className:Y.sharePreview,children:[(0,D.jsx)(`span`,{className:Y.sharePreviewAvatar,style:E({"--avatar-color":e.authorColor}),children:e.authorInitials}),(0,D.jsxs)(`div`,{className:Y.sharePreviewBody,children:[(0,D.jsxs)(`div`,{className:Y.sharePreviewMeta,children:[e.authorName,` ·`,` `,(0,D.jsx)(`span`,{className:Y.sharePreviewCat,style:E({"--cat":e.categoryColor}),children:e.categoryLabel})]}),e.authorRole?(0,D.jsx)(`div`,{style:{fontSize:`11px`,color:`var(--color-text-soft)`,marginTop:`1px`,marginBottom:`2px`},children:e.authorRole}):null,(0,D.jsx)(`div`,{className:Y.sharePreviewTitle,children:e.title})]})]})}),I0=({target:e,selected:t,onToggle:n})=>(0,D.jsxs)(`button`,{type:`button`,className:T(Y.shareRow,t&&Y.shareRowOn),"aria-pressed":t,onClick:()=>{n(e.id)},children:[(0,D.jsx)(`span`,{className:T(Y.shareAvatar,e.square&&Y.shareAvatarSquare),style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:Y.shareRowBody,children:[(0,D.jsx)(`span`,{className:Y.shareRowName,children:e.name}),(0,D.jsx)(`span`,{className:Y.shareRowSub,children:e.subtitle})]}),(0,D.jsx)(`span`,{className:T(Y.shareCheck,t&&Y.shareCheckOn),children:t&&(0,D.jsx)(Wn,{size:11,strokeWidth:3})})]}),L0=({label:e,targets:t,selected:n,onToggle:r})=>t.length===0?null:(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:Y.shareSectionLabel,children:e}),t.map(e=>(0,D.jsx)(I0,{target:e,selected:n.has(e.id),onToggle:r},e.id))]}),R0=(e,t,n)=>e===``||t.toLowerCase().includes(e)||n.toLowerCase().includes(e),z0=({comment:e,query:t,onComment:n,onQuery:r})=>{let i=pi(e,1e3);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:Y.shareField,style:{display:`flex`,flexDirection:`column`,gap:`4px`},children:[(0,D.jsx)(`input`,{className:T(Y.shareComment,i.isOverLimit&&Y.shareCommentError),placeholder:`Add a comment (optional)`,value:e,onChange:e=>{n(e.target.value)}}),i.showCounter&&(0,D.jsxs)(`div`,{style:{alignSelf:`flex-end`,fontSize:`10px`,color:i.counterColor===`danger`?`var(--color-danger)`:`var(--color-text-soft)`,marginRight:`8px`,fontWeight:500},children:[i.length,` / 1000`]})]}),(0,D.jsx)(`div`,{className:Y.shareSearchWrap,children:(0,D.jsxs)(`div`,{className:Y.shareSearch,children:[(0,D.jsx)(Hr,{size:13}),(0,D.jsx)(`input`,{className:Y.shareSearchInput,placeholder:`Search people or groups…`,value:t,onChange:e=>{r(e.target.value)}})]})})]})},B0=e=>({id:e.id,name:e.title,subtitle:e.subtitle||(e.kind===`group`?`${String(e.memberCount)} members`:``),initials:e.initials,color:e.color,square:e.kind===`group`}),V0=({groups:e,dms:t,selected:n,onToggle:r})=>(0,D.jsxs)(`div`,{className:Y.shareList,children:[(0,D.jsx)(L0,{label:`Groups`,targets:e,selected:n,onToggle:r}),(0,D.jsx)(L0,{label:`Direct messages`,targets:t,selected:n,onToggle:r}),e.length===0&&t.length===0&&(0,D.jsx)(`div`,{className:Y.shareEmpty,children:`No matches.`})]}),H0=({post:e,comment:t,selected:n,sendMessage:r,setIsSending:i,close:a,count:o})=>{i(!0);let s=`${window.location.origin}/feed/posts/${e.postId}`,c={comment:t.trim(),card:{title:e.title,body:e.bodySnippet,authorName:e.authorName,authorInitials:e.authorInitials,authorColor:e.authorColor,categoryLabel:e.categoryLabel,categoryColor:e.categoryColor,link:s}},l=`__UAPP_SHARED_CARD__::${JSON.stringify(c)}`,u=Array.from(n).map(e=>r.execute(e,l,crypto.randomUUID()));Promise.allSettled(u).then(()=>{j.success(`Shared to ${String(o)} ${o===1?`chat`:`chats`}`),a()}).catch(()=>{j.error(`Failed to share post`),i(!1)})},U0=(e,t,r)=>{let[i,a]=(0,n.useState)(``),[o,s]=(0,n.useState)(``),[c,l]=(0,n.useState)(()=>new Set),[u,d]=(0,n.useState)(!1),{sendMessage:f}=LP(),{data:p=[]}=HP(`all`,``,{enabled:r}),m=o.trim().toLowerCase(),h=p.filter(e=>e.kind===`dm`).map(B0).filter(e=>R0(m,e.name,e.subtitle)),g=p.filter(e=>e.kind===`group`).map(B0).filter(e=>R0(m,e.name,e.subtitle)),_=c.size,v=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},y=()=>{a(``),s(``),l(new Set),d(!1),t()};return{comment:i,setComment:a,query:o,setQuery:s,selected:c,isSending:u,dms:h,groups:g,count:_,toggle:v,close:y,send:()=>{_===0||u||i.length>1e3||H0({post:e,comment:i,selected:c,sendMessage:f,setIsSending:d,close:y,count:_})}}},W0=({open:e,post:t,onClose:n})=>{let r=U0(t,n,e),a=Bs();return e?(0,i.createPortal)((0,D.jsxs)(`div`,{className:Y.shareRoot,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.shareBackdrop,"aria-label":`Close`,onClick:r.close}),(0,D.jsxs)(`div`,{className:Y.shareModal,role:`dialog`,"aria-label":`Share post`,children:[(0,D.jsx)(N0,{onClose:r.close}),(0,D.jsx)(F0,{post:t}),(0,D.jsx)(z0,{comment:r.comment,query:r.query,onComment:r.setComment,onQuery:r.setQuery}),(0,D.jsx)(V0,{groups:r.groups,dms:r.dms,selected:r.selected,onToggle:r.toggle}),(0,D.jsx)(P0,{count:r.count,disabled:r.comment.length>1e3,onCancel:r.close,onSend:r.send})]})]}),a??document.body):null},G0=[{id:`like`,label:`Like`,Icon:ti,color:`#2563eb`},{id:`insightful`,label:`Insightful`,Icon:_r,color:`#f59e0b`},{id:`celebrate`,label:`Celebrate`,Icon:Dr,color:`#ec4899`}],K0=({post:e,onCommentClick:t})=>{if(e.totalReactions===0&&e.commentCount===0)return null;let n=G0.filter(t=>e.reactions[t.id]>0).slice(0,3);return(0,D.jsxs)(`div`,{className:Y.summary,children:[(0,D.jsxs)(`div`,{className:Y.summaryLeft,children:[n.length>0&&(0,D.jsx)(`span`,{className:Y.summaryIcons,children:n.map(({id:e,Icon:t,color:n})=>(0,D.jsx)(`span`,{className:Y.summaryDot,style:E({"--react-color":n}),children:(0,D.jsx)(t,{size:10})},e))}),e.totalReactions>0&&(0,D.jsx)(`span`,{className:Y.summaryCount,children:e.totalReactions})]}),e.commentCount>0&&(0,D.jsxs)(`span`,{className:T(Y.summaryComments,t!==void 0&&Y.summaryCommentsClickable),onClick:t,role:t===void 0?void 0:`button`,tabIndex:t===void 0?void 0:0,onKeyDown:t===void 0?void 0:e=>{(e.key===`Enter`||e.key===` `)&&t()},children:[e.commentCount,` `,e.commentCount===1?`comment`:`comments`]})]})},q0=({post:e,commentsOpen:t,onReact:r,onComment:i,onShare:a})=>{let[o,s]=(0,n.useState)(!1),c=G0.find(t=>t.id===e.myReaction),l=c?.Icon??ti;return(0,D.jsxs)(`div`,{className:Y.postBar,children:[(0,D.jsxs)(`div`,{className:Y.reactWrap,onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)},children:[(0,D.jsxs)(`button`,{type:`button`,className:T(Y.actionBtn,c!==void 0&&Y.actionActive),style:c===void 0?void 0:E({"--react-color":c.color}),onClick:()=>{r(e.myReaction??`like`),s(!1)},children:[(0,D.jsx)(l,{size:16}),` `,c?.label??`Like`]}),(0,D.jsx)(`div`,{className:T(Y.picker,o&&Y.pickerVisible),children:G0.map(({id:t,label:n,Icon:i,color:a})=>(0,D.jsx)(`button`,{type:`button`,className:T(Y.pickerBtn,e.myReaction===t&&Y.pickerActive),style:E({"--react-color":a}),title:n,onClick:()=>{r(t),s(!1)},children:(0,D.jsx)(i,{size:18})},t))})]}),(0,D.jsxs)(`button`,{type:`button`,className:T(Y.actionBtn,t&&Y.actionActive),onClick:i,children:[(0,D.jsx)(Sr,{size:16}),` Comment`]}),(0,D.jsxs)(`button`,{type:`button`,className:Y.actionBtn,onClick:a,children:[(0,D.jsx)(Wr,{size:16}),` Share`]})]})},J0=({post:e,onAcknowledge:t})=>e.mustAcknowledge?e.acknowledged?(0,D.jsx)(`div`,{className:Y.ackDone,children:`✓ You acknowledged this`}):(0,D.jsxs)(`div`,{className:Y.ackBanner,children:[(0,D.jsx)(`span`,{children:`Must read — please confirm you have seen this.`}),(0,D.jsx)(`button`,{type:`button`,className:Y.ackBtn,onClick:t,children:`Acknowledge`})]}):null,Y0={lightboxOverlay:`_lightboxOverlay_18fqf_5`,lightboxContainer:`_lightboxContainer_18fqf_20`,lightboxLeft:`_lightboxLeft_18fqf_33`,lightboxRight:`_lightboxRight_18fqf_43`,lightboxScrollableContent:`_lightboxScrollableContent_18fqf_53`,lightboxDivider:`_lightboxDivider_18fqf_64`,lightboxClose:`_lightboxClose_18fqf_88`,lightboxImage:`_lightboxImage_18fqf_101`,lightboxArrow:`_lightboxArrow_18fqf_136`,lightboxArrowLeft:`_lightboxArrowLeft_18fqf_158`,lightboxArrowRight:`_lightboxArrowRight_18fqf_166`,lightboxCounter:`_lightboxCounter_18fqf_174`},X0=({urls:e,index:t,onPrev:n,onNext:r})=>(0,D.jsxs)(`div`,{className:Y0.lightboxLeft,children:[e.length>1&&(0,D.jsx)(`button`,{type:`button`,className:T(Y0.lightboxArrow,Y0.lightboxArrowLeft),onClick:n,"aria-label":`Previous image`,children:(0,D.jsx)(Kn,{size:24})}),(0,D.jsx)(j0,{url:e[t]??``,alt:`Fullscreen view`,className:Y0.lightboxImage}),e.length>1&&(0,D.jsx)(`button`,{type:`button`,className:T(Y0.lightboxArrow,Y0.lightboxArrowRight),onClick:r,"aria-label":`Next image`,children:(0,D.jsx)(qn,{size:24})}),(0,D.jsxs)(`div`,{className:Y0.lightboxCounter,children:[t+1,` / `,e.length]})]}),Z0=({post:e,commentPending:t,onReact:n,onBookmark:r,onAcknowledge:i,onAddComment:a,onShare:o})=>(0,D.jsx)(`div`,{className:Y0.lightboxRight,children:(0,D.jsxs)(`div`,{className:Y0.lightboxScrollableContent,children:[(0,D.jsx)(l0,{post:e,onBookmark:r}),e.title!==null&&(0,D.jsx)(`h2`,{className:Y.cardTitle,children:e.title}),(0,D.jsx)(`p`,{className:Y.cardBody,children:e.body}),(0,D.jsx)(J0,{post:e,onAcknowledge:i}),(0,D.jsx)(`div`,{className:Y0.lightboxDivider}),(0,D.jsx)(K0,{post:e}),(0,D.jsx)(q0,{post:e,commentsOpen:!0,onReact:n,onComment:()=>{},onShare:o}),(0,D.jsx)(`div`,{className:Y0.lightboxDivider}),(0,D.jsx)(A0,{comments:e.comments,pending:t,onAdd:a})]})}),Q0=({urls:e,index:t,onClose:r,onChange:a,post:o,commentPending:s,onReact:c,onBookmark:l,onAcknowledge:u,onAddComment:d,onShare:f})=>{let p=Bs();return(0,n.useEffect)(()=>{let n=n=>{n.key===`Escape`&&r(),n.key===`ArrowLeft`&&a((t-1+e.length)%e.length),n.key===`ArrowRight`&&a((t+1)%e.length)};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n)}},[t,r,a,e.length]),(0,i.createPortal)((0,D.jsx)(`div`,{className:Y0.lightboxOverlay,onClick:r,role:`presentation`,children:(0,D.jsxs)(`div`,{className:Y0.lightboxContainer,onClick:e=>{e.stopPropagation()},role:`presentation`,children:[(0,D.jsx)(`button`,{type:`button`,className:Y0.lightboxClose,onClick:r,"aria-label":`Close lightbox`,children:(0,D.jsx)(ci,{size:20})}),(0,D.jsx)(X0,{urls:e,index:t,onPrev:()=>{a((t-1+e.length)%e.length)},onNext:()=>{a((t+1)%e.length)}}),(0,D.jsx)(Z0,{post:o,commentPending:s,onReact:c,onBookmark:l,onAcknowledge:u,onAddComment:d,onShare:f})]})}),p??document.body)},$0=({open:e,post:t,onClose:n})=>{let{categoryLabel:r,categoryColor:i}=cZ(t);return(0,D.jsx)(W0,{open:e,post:{postId:t.id,authorName:t.authorName,authorRole:t.authorRole,authorInitials:t.authorInitials,authorColor:t.authorColor,categoryLabel:r,categoryColor:i,title:t.title??t.body,bodySnippet:t.body.length>150?`${t.body.slice(0,150)}...`:t.body},onClose:n})},e2=({index:e,post:t,commentPending:n,onReact:r,onBookmark:i,onAcknowledge:a,onAddComment:o,onShare:s,onClose:c,onChange:l})=>e===null?null:(0,D.jsx)(Q0,{urls:t.imageUrls,index:e,post:t,commentPending:n,onReact:r,onBookmark:i,onAcknowledge:a,onAddComment:o,onShare:s,onClose:c,onChange:l}),t2=({body:e,onSeeMore:t})=>{let[r,i]=(0,n.useState)(!1),a=e.length>200;return(0,D.jsxs)(`p`,{className:Y.cardBody,children:[a&&!r?`${e.slice(0,200)}...`:e,a&&(0,D.jsx)(`button`,{type:`button`,className:Y.seeMoreBtn,onClick:()=>{r||t(),i(e=>!e)},children:r?` See less`:` See more`})]})},n2=({post:e,commentsOpen:t,commentPending:n,shareOpen:r,lightboxIndex:i,onReact:a,onBookmark:o,onAcknowledge:s,onAddComment:c,toggleComments:l,setShareOpen:u,setLightboxIndex:d})=>{let f=eZ(),p=()=>{u(!0),f.mutate(e.id)};return(0,D.jsxs)(D.Fragment,{children:[e.title!==null&&(0,D.jsx)(`h2`,{className:Y.cardTitle,children:e.title}),(0,D.jsx)(t2,{body:e.body,onSeeMore:()=>{f.mutate(e.id)}}),(0,D.jsx)(M0,{urls:e.imageUrls,onImageClick:t=>{d(t),t!==null&&f.mutate(e.id)}}),(0,D.jsx)(J0,{post:e,onAcknowledge:s}),(0,D.jsx)(K0,{post:e,onCommentClick:l}),(0,D.jsx)(q0,{post:e,commentsOpen:t,onReact:a,onComment:l,onShare:p}),t&&(0,D.jsx)(A0,{comments:e.comments,pending:n,onAdd:c}),(0,D.jsx)($0,{open:r,post:e,onClose:()=>{u(!1)}}),(0,D.jsx)(e2,{index:i,post:e,commentPending:n,onReact:a,onBookmark:o,onAcknowledge:s,onAddComment:c,onShare:p,onClose:()=>{d(null)},onChange:d})]})},r2=e=>{let t=(0,n.useRef)(null);(0,n.useEffect)(()=>{t.current=document.getElementById(`app-scroll-container`)},[]);let{scrollYProgress:r}=My({target:e,container:t,offset:[`start end`,`end start`]});return Iy(r,[0,1],[-12,12])},i2=({post:e,state:t})=>(0,D.jsx)(D0,{post:e,state:t}),a2=({post:e,isAuthor:t,commentPending:n,onBookmark:r,onPin:i,showPinButton:a,onReact:o,onAcknowledge:s,onAddComment:c,state:l,cardY:u,elementRef:d})=>(0,D.jsxs)(A.article,{id:`feed-post-${e.id}`,ref:d,style:{y:u},className:Y.card,children:[e.needsAcknowledgement&&(0,D.jsx)(`span`,{className:Y.urgentStripe}),e.pinned&&(0,D.jsxs)(`div`,{className:Y.pinnedRow,children:[(0,D.jsx)(Nr,{size:10,className:Y.pin}),` Pinned`]}),!l.isEditing&&(0,D.jsx)(l0,{post:e,onBookmark:r,onPin:i,showPinButton:a,showEditButton:t,onEdit:()=>{l.setIsEditing(!0)}}),l.isEditing?(0,D.jsx)(i2,{post:e,state:l}):(0,D.jsx)(n2,{post:e,commentsOpen:l.commentsOpen,commentPending:n,shareOpen:l.shareOpen,lightboxIndex:l.lightboxIndex,onReact:o,onBookmark:r,onAcknowledge:s,onAddComment:c,toggleComments:()=>{l.setCommentsOpen(e=>!e)},setShareOpen:l.setShareOpen,setLightboxIndex:l.setLightboxIndex})]}),o2=({post:e,commentPending:t,onReact:r,onBookmark:i,onAcknowledge:a,onAddComment:o})=>{let s=C0(e),{user:c}=_B(),l=e.authorUserId===c?.id,u=nZ(),d=c!==null&&(c.hasRole(`admin`)||c.hasRole(`system-admin`)||c.hasRole(`FullAccess`)),f=()=>{u.mutateAsync({postId:e.id,pinned:!e.pinned})},p=(0,n.useRef)(null);return(0,D.jsx)(a2,{post:e,isAuthor:l,commentPending:t,onBookmark:i,onPin:f,showPinButton:d,onReact:r,onAcknowledge:a,onAddComment:o,state:s,cardY:r2(p),elementRef:p})},s2=({posts:e})=>{let t=ZX(),n=QX(),r=$X(),i=tZ();return(0,D.jsx)(D.Fragment,{children:e.map(e=>(0,D.jsx)(o2,{post:e,commentPending:i.isPending,onReact:n=>{t.mutate({postId:e.id,type:n})},onBookmark:()=>{n.mutate(e.id),j.success(e.bookmarked?`Bookmark removed`:`Post saved to bookmarks`)},onAcknowledge:()=>{r.mutate(e.id),j.success(`Post acknowledged`)},onAddComment:t=>{i.mutate({postId:e.id,text:t})}},e.id))})},c2=2,l2=e=>[...e].filter(e=>e.active).sort((e,t)=>e.priority-t.priority),u2=(e,t)=>e.find(e=>e.id===t.templateId),d2=(e,t,n)=>l2(e).map(e=>{let r=t.filter(t=>t.categoryId===e.id);return{id:e.id,name:e.name,color:e.color,count:r.length,template:u2(n,e),items:r.slice(0,c2)}}).filter(e=>e.count>0),f2=e=>[{id:`all`,label:`All`},...l2(e).map(e=>({id:e.id,label:e.name}))],p2=e=>Object.values(e.values).join(` `).toLowerCase(),m2=(e,t,n)=>{let r=[];for(let i of l2(e.categories)){if(t!==`all`&&i.id!==t)continue;let a=u2(e.templates,i);if(a===void 0)continue;let o=e.promotions.filter(e=>e.categoryId===i.id),s=n===``?o:o.filter(e=>p2(e).includes(n));s.length>0&&r.push({category:i,template:a,items:s,count:o.length})}return r},h2=({onClose:e})=>(0,D.jsxs)(`div`,{className:Y.ppHead,children:[(0,D.jsx)(`span`,{className:Y.ppHeadIcon,children:(0,D.jsx)(br,{size:18})}),(0,D.jsxs)(`div`,{className:Y.ppHeadText,children:[(0,D.jsx)(`h2`,{className:Y.ppTitle,children:`Promotions & Campaigns`}),(0,D.jsx)(`p`,{className:Y.ppSubtitle,children:`Latest campaigns, university updates, intake alerts and events.`}),(0,D.jsx)(`span`,{className:Y.ppManaged,children:`Read-only · Managed by System Admin`})]}),(0,D.jsx)(`button`,{type:`button`,className:Y.ppClose,"aria-label":`Close`,onClick:e,children:(0,D.jsx)(ci,{size:18})})]}),g2=({tabs:e,active:t,onSelect:n})=>(0,D.jsx)(`div`,{className:Y.ppTabs,children:e.map(e=>{let r=e.id===t;return(0,D.jsxs)(`button`,{type:`button`,className:T(Y.ppTab,r&&Y.ppTabActive),onClick:()=>{n(e.id)},children:[r&&(0,D.jsx)(A.span,{layoutId:`ppTabBg`,className:Y.ppTabBg,transition:{type:`spring`,stiffness:420,damping:34}}),(0,D.jsx)(`span`,{className:Y.ppTabLabel,children:e.label})]},e.id)})}),_2=({categories:e,promotions:t,templates:r,initialTab:i,onClose:a})=>{let[o,s]=(0,n.useState)(i),[c,l]=(0,n.useState)(``),u=f2(e),d=m2({categories:e,promotions:t,templates:r},o,c.trim().toLowerCase());return(0,D.jsxs)(`div`,{className:Y.ppRoot,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.ppOverlay,"aria-label":`Close promotions`,onClick:a}),(0,D.jsxs)(`div`,{className:Y.ppPanel,role:`dialog`,"aria-label":`Promotions & Campaigns`,children:[(0,D.jsx)(h2,{onClose:a}),(0,D.jsx)(g2,{tabs:u,active:o,onSelect:s}),(0,D.jsxs)(`div`,{className:Y.ppSearch,children:[(0,D.jsx)(Hr,{size:14,className:Y.ppSearchIcon}),(0,D.jsx)(`input`,{type:`search`,className:Y.ppSearchInput,placeholder:`Search promotions…`,value:c,onChange:e=>{l(e.target.value)}})]}),(0,D.jsx)(`div`,{className:Y.ppList,children:(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsx)(A.div,{className:Y.ppListInner,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.18,ease:`easeOut`},children:d.length===0?(0,D.jsx)(`p`,{className:Y.ppEmpty,children:c.trim()===``?`No active promotions right now.`:`No promotions match.`}):d.map(e=>(0,D.jsx)(bR,{template:e.template,color:e.category.color,name:e.category.name,count:e.count,items:e.items},e.category.id))},o)})})]})]})},v2=({sections:e,onClose:t,onSeeAll:n,onSelectTab:r})=>(0,D.jsx)(A.div,{className:Y.promoPopoverOverlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:e=>{e.target===e.currentTarget&&t()},children:(0,D.jsxs)(A.div,{className:Y.promoPopoverCard,initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:`spring`,damping:25,stiffness:300},children:[(0,D.jsxs)(`div`,{className:Y.popoverHeader,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.popoverCloseX,onClick:t,"aria-label":`Close promotions modal`,children:(0,D.jsx)(ci,{size:18})}),(0,D.jsx)(`div`,{className:Y.popoverBadgeIcon,children:(0,D.jsx)(br,{size:24})}),(0,D.jsxs)(`div`,{className:Y.popoverTitleRow,children:[(0,D.jsx)(`h3`,{className:Y.popoverTitle,children:`Promotions & Campaigns`}),(0,D.jsx)(`button`,{type:`button`,className:Y.popoverSeeAllBtn,onClick:()=>{t(),n()},children:`See all`})]}),(0,D.jsx)(`p`,{className:Y.popoverSub,children:`Stay updated with active promotions and university campaigns`})]}),(0,D.jsx)(`div`,{className:Y.popoverContent,children:e.length===0?(0,D.jsx)(`p`,{className:Y.popoverEmpty,children:`No active promotions right now.`}):e.map(e=>e.template===void 0?null:(0,D.jsx)(bR,{template:e.template,color:e.color,name:e.name,count:e.count,items:e.items,onViewAll:()=>{t(),r(e.id)}},e.id))})]})}),y2=({sections:e,onSeeAll:t,onSelectTab:n})=>(0,D.jsxs)(`aside`,{className:Y.rail,children:[(0,D.jsxs)(`div`,{className:Y.railHead,children:[(0,D.jsxs)(`span`,{className:Y.railHeadTitle,children:[(0,D.jsx)(br,{size:11}),` PROMOTIONS & CAMPAIGNS`]}),(0,D.jsx)(`button`,{type:`button`,className:Y.railSeeAll,onClick:t,children:`See all`})]}),(0,D.jsx)(`div`,{className:Y.railList,children:e.length===0?(0,D.jsx)(`p`,{className:Y.railFoot,children:`No active promotions right now.`}):e.map(e=>e.template===void 0?null:(0,D.jsx)(bR,{template:e.template,color:e.color,name:e.name,count:e.count,items:e.items,onViewAll:()=>{n(e.id)}},e.id))}),(0,D.jsx)(`div`,{className:Y.railFoot,children:`Managed by System Admin`})]}),b2=({onOpen:e})=>{let[t,r]=(0,n.useState)(!1),[i,a]=(0,n.useState)(!1),o=(0,n.useRef)(0);return(0,n.useEffect)(()=>{let e=document.getElementById(`app-scroll-container`);if(!e)return;let t=()=>{let t=e.scrollTop;t<=4||t<o.current?a(!1):a(!0),o.current=t};return e.addEventListener(`scroll`,t,{passive:!0}),()=>{e.removeEventListener(`scroll`,t)}},[]),(0,n.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>{r(!1)},4e3);return()=>{clearTimeout(e)}},[t]),(0,D.jsxs)(`button`,{type:`button`,className:T(Y.mobilePromoTrigger,t&&Y.mobilePromoExpanded,i&&Y.mobilePromoTriggerBarHidden),onClick:()=>{t?(r(!1),e()):r(!0)},"aria-label":`Promotions & Campaigns`,children:[(0,D.jsx)(`span`,{className:Y.promoShimmerSweep}),(0,D.jsx)(`span`,{className:Y.promoIconWrap,children:(0,D.jsx)(br,{size:15,className:Y.sparkleIcon})}),(0,D.jsx)(`span`,{className:Y.promoBtnText,children:`Promotions & Campaigns`})]})},x2=()=>{let e=cR(),t=uR(),r=lR(),[i,a]=(0,n.useState)(null),[o,s]=(0,n.useState)(!1),c=e.data??[],l=t.data??[],u=r.data??[],d=d2(c,l,u);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(y2,{sections:d,onSeeAll:()=>{a(`all`)},onSelectTab:e=>{a(e)}}),(0,D.jsx)(b2,{onOpen:()=>{s(!0)}}),(0,D.jsx)(Kg,{children:o&&(0,D.jsx)(v2,{sections:d,onClose:()=>{s(!1)},onSeeAll:()=>{a(`all`)},onSelectTab:e=>{a(e)}})}),i!==null&&(0,D.jsx)(_2,{categories:c,promotions:l,templates:u,initialTab:i,onClose:()=>{a(null)}})]})},S2=[{id:`for_you`,label:`For You`},{id:`team`,label:`Team Updates`},{id:`company`,label:`Company Wide`},{id:`saved`,label:`Saved Posts`,icon:In}],C2=({scope:e,onChange:t})=>{let n=JX(`saved`).data?.pages[0]?.totalCount;return(0,D.jsx)(`div`,{className:Y.tabs,children:S2.map(r=>{let i=r.icon;return(0,D.jsxs)(`button`,{type:`button`,className:T(Y.tab,e===r.id&&Y.tabActive),onClick:()=>{t(r.id)},children:[i!==void 0&&(0,D.jsx)(i,{size:13}),r.label,r.id===`saved`&&n!==void 0&&n>0&&(0,D.jsx)(`span`,{className:Y.tabBadge,children:n})]},r.id)})})},w2={skeletonCard:`_skeletonCard_7d381_1`,skeletonHeader:`_skeletonHeader_7d381_11`,skeletonAvatar:`_skeletonAvatar_7d381_17`,pulse:`_pulse_7d381_1`,skeletonMeta:`_skeletonMeta_7d381_25`,skeletonLine:`_skeletonLine_7d381_32`,short:`_short_7d381_39`,medium:`_medium_7d381_43`,full:`_full_7d381_47`,skeletonBody:`_skeletonBody_7d381_51`},T2=({count:e=3})=>(0,D.jsx)(D.Fragment,{children:Array.from({length:e}).map((e,t)=>(0,D.jsxs)(`div`,{className:w2.skeletonCard,children:[(0,D.jsxs)(`div`,{className:w2.skeletonHeader,children:[(0,D.jsx)(`div`,{className:w2.skeletonAvatar}),(0,D.jsxs)(`div`,{className:w2.skeletonMeta,children:[(0,D.jsx)(`div`,{className:T(w2.skeletonLine,w2.medium)}),(0,D.jsx)(`div`,{className:T(w2.skeletonLine,w2.short)})]})]}),(0,D.jsxs)(`div`,{className:w2.skeletonBody,children:[(0,D.jsx)(`div`,{className:T(w2.skeletonLine,w2.full)}),(0,D.jsx)(`div`,{className:T(w2.skeletonLine,w2.full)}),(0,D.jsx)(`div`,{className:T(w2.skeletonLine,w2.medium)})]})]},t))}),E2=e=>{_Z(`feed-post-${e}`,`app-scroll-container`,`start`)},D2=({post:e,onView:t,onDismiss:n,displayZone:r})=>{let{categoryLabel:i,categoryColor:a}=cZ(e);return(0,D.jsxs)(`div`,{className:Y.missedCard,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.missedClose,"aria-label":`Dismiss`,onClick:n,children:(0,D.jsx)(ci,{size:11,strokeWidth:2.5})}),(0,D.jsxs)(`div`,{className:Y.missedCardTop,children:[(0,D.jsx)(`span`,{className:Y.missedDot,style:E({"--dot":a})}),(0,D.jsx)(`span`,{className:Y.missedCat,children:i}),(0,D.jsx)(`span`,{className:Y.missedTime,children:gZ(e.createdAt,r,e.scheduledAt)})]}),(0,D.jsx)(`p`,{className:Y.missedSummary,children:e.title??e.body}),(0,D.jsxs)(`div`,{className:Y.missedFoot,children:[(0,D.jsxs)(`button`,{type:`button`,className:Y.missedCta,onClick:t,children:[`View post `,(0,D.jsx)(qn,{size:10,strokeWidth:3})]}),e.mustAcknowledge&&(0,D.jsxs)(`span`,{className:Y.missedPriority,children:[(0,D.jsx)(Yn,{size:8}),` Priority`]})]})]})},O2=({posts:e})=>{let[t,r]=(0,n.useState)(new Set),[i,a]=(0,n.useState)(!1),o=(0,n.useRef)(null),s=JN().display,c=e.filter(e=>e.mustAcknowledge&&!t.has(e.id)&&!e.acknowledged);if(i||c.length===0)return null;let l=e=>{o.current?.scrollBy({left:e*300,behavior:`smooth`})},u=c.length>2;return(0,D.jsxs)(`div`,{className:Y.missed,children:[(0,D.jsxs)(`div`,{className:Y.missedHead,children:[(0,D.jsx)(Pn,{size:14,className:Y.missedSpark}),(0,D.jsx)(`span`,{className:Y.missedTitle,children:`WHAT YOU MISSED`}),(0,D.jsx)(`span`,{className:Y.missedBadge,children:c.length}),(0,D.jsx)(`button`,{type:`button`,className:Y.missedRead,onClick:()=>{a(!0)},children:`Mark all read`})]}),(0,D.jsxs)(`div`,{className:T(Y.missedScroller,u&&Y.missedScrollerFade),children:[u&&(0,D.jsx)(`button`,{type:`button`,className:T(Y.missedNav,Y.missedNavLeft),"aria-label":`Scroll left`,onClick:()=>{l(-1)},children:(0,D.jsx)(Kn,{size:16})}),(0,D.jsx)(`div`,{className:Y.missedTrack,ref:o,children:c.map(e=>(0,D.jsx)(D2,{post:e,displayZone:s,onView:()=>{E2(e.id)},onDismiss:()=>{r(t=>new Set(t).add(e.id))}},e.id))}),u&&(0,D.jsx)(`button`,{type:`button`,className:T(Y.missedNav,Y.missedNavRight),"aria-label":`Scroll right`,onClick:()=>{l(1)},children:(0,D.jsx)(qn,{size:16})})]})]})},k2=e=>{let{isSuccess:t,posts:r,hasNextPage:i,isFetchingNextPage:a,fetchNextPage:o}=e,[s,c]=ln(),l=s.get(`postId`),u=sN();(0,n.useEffect)(()=>{l!==null&&u.invalidateQueries({queryKey:[`feed`]})},[l,u]),(0,n.useEffect)(()=>{!t||l===null||a||!r.some(e=>e.id===l)&&i&&o()},[t,l,r,i,a,o]),(0,n.useEffect)(()=>{if(!t||l===null)return;let e,n=0,r=setInterval(()=>{if(document.getElementById(`feed-post-${l}`)){clearInterval(r);let t=document.getElementById(`app-scroll-container`);t&&(t.style.paddingBottom=`80vh`),_Z(`feed-post-${l}`,`app-scroll-container`,`center`),e=setTimeout(()=>{t&&(t.style.paddingBottom=``);let e=new URLSearchParams(window.location.search);e.has(`postId`)&&(e.delete(`postId`),c(e,{replace:!0}))},1e3)}else n++,n>=100&&clearInterval(r)},50);return()=>{clearInterval(r),e&&clearTimeout(e)}},[t,l,s,c])},A2=(e,t)=>{let n=t.trim();if(n===``)return e;let r=n.replace(/\s+/g,` `).toLowerCase();return e.filter(e=>[e.authorName,e.authorRole,e.audienceLabel,e.timestamp,e.title,e.body].filter(Boolean).join(` `).replace(/\s+/g,` `).toLowerCase().includes(r))},j2=(e,t,r)=>{let i=(0,n.useRef)(null),a=(0,n.useCallback)(n=>{n[0]?.isIntersecting&&e&&!t&&r()},[e,t,r]);return(0,n.useEffect)(()=>{let e=i.current;if(!e)return;let t=new IntersectionObserver(a,{rootMargin:`2000px`});return t.observe(e),()=>{t.disconnect()}},[a]),i},M2=()=>{let[e,t]=(0,n.useState)(`for_you`),[r,i]=(0,n.useState)(``),a=JX(e),{hasNextPage:o,isFetchingNextPage:s,fetchNextPage:c}=a,l=a.data?a.data.pages.flatMap(e=>e.items):[],u=A2(l,r);k2({isSuccess:a.isSuccess,posts:l,hasNextPage:o,isFetchingNextPage:s,fetchNextPage:c});let d=j2(o,s,c);return(0,D.jsxs)(`div`,{className:Y.screen,children:[(0,D.jsx)(`div`,{className:Y.toolbar,children:(0,D.jsxs)(`div`,{className:Y.toolbarContainer,children:[(0,D.jsxs)(`div`,{className:Y.search,children:[(0,D.jsx)(Hr,{size:14,className:Y.searchIcon}),(0,D.jsx)(`input`,{type:`search`,className:Y.searchInput,placeholder:`Search posts by keyword, title, author, or role…`,value:r,onChange:e=>{i(e.target.value)}})]}),(0,D.jsx)(`div`,{className:Y.toolbarRailSpacer})]})}),(0,D.jsxs)(`div`,{className:Y.wrapper,children:[(0,D.jsxs)(`div`,{className:Y.column,children:[(0,D.jsx)(C2,{scope:e,onChange:e=>{t(e)}}),(0,D.jsx)(O2,{posts:u}),(0,D.jsx)(i0,{}),a.isPending&&(0,D.jsx)(T2,{count:3}),a.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not load the feed`,children:a.error.message}),a.isSuccess&&u.length===0&&(0,D.jsx)(a0,{}),(0,D.jsx)(s2,{posts:u}),(0,D.jsx)(`div`,{ref:d,style:{height:`20px`,width:`100%`},children:a.isFetchingNextPage&&(0,D.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`1rem`},children:(0,D.jsx)(gi,{})})})]}),(0,D.jsx)(x2,{})]})]})},N2=({path:e,children:t})=>(0,D.jsxs)(St,{children:[(0,D.jsx)(bt,{path:e,element:(0,D.jsx)(D.Fragment,{children:t})}),(0,D.jsx)(bt,{path:`*`,element:(0,D.jsx)(yt,{to:e,replace:!0})})]}),P2=()=>{X$(`uapp-feed`,()=>(0,D.jsx)(N2,{path:`/comms/feed`,children:(0,D.jsx)(M2,{})}))},F2=e=>{let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:((t[0]?.[0]??``)+(t.length>1?t[t.length-1]?.[0]??``:``)).toUpperCase()},I2=()=>{let{user:e}=_B(),t=e?.fullName??``;return{id:e?.id??``,name:t,initials:F2(t),color:`#0f1f1f`,role:`Organizer`}},L2=(e,t,n)=>{let r=new Date(e).getTime(),i=new Date(t).getTime();return n.some(e=>new Date(e.startUtc).getTime()<i&&new Date(e.endUtc).getTime()>r)},R2=(e,t,n)=>{let r=new Date(e).getTime(),i=new Date(t).getTime();return n.some(e=>new Date(e.startUtc).getTime()<=r&&new Date(e.endUtc).getTime()>=i)},z2=e=>{let t=e=>{let[t,n]=e.split(`:`).map(Number);return(t??0)*60+(n??0)},n=e=>`${String(Math.floor(e/60)).padStart(2,`0`)}:${String(e%60).padStart(2,`0`)}`,r=t(e.end),i=[];for(let a=t(e.start);a+30<=r;a+=30)i.push({start:n(a),end:n(a+30),label:`${n(a)} – ${n(a+30)}`});return i},B2=(e,t)=>{let n=e??t,r=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,`0`),a=String(n.getDate()).padStart(2,`0`);return`${String(r)}-${i}-${a}`},V2=(e,t)=>new Date(e).toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0,timeZone:t}),H2=(e,t,n)=>!e||!t?``:`${V2(e,n)} – ${V2(t,n)}`,U2=(e,t)=>e?new Date(e).toLocaleDateString(`en-US`,{weekday:`short`,day:`numeric`,month:`short`,timeZone:t}):``,W2=(e,t)=>t.id!==``&&e===t.id,G2=(e,t,n)=>{if(W2(e,n))return n.name.split(` `)[0]??n.name;let r=t.find(t=>t.id===e);return r===void 0?``:r.name.split(` `)[0]??``},K2=(e,t,n)=>{if(W2(e,n))return{name:`${n.name} (You)`,role:n.role,initials:n.initials,color:n.color};let r=t.find(t=>t.id===e);return{name:r?.name??``,role:r?.role??``,initials:r?.initials??``,color:r?.color??`#555`}},q2=(e,t,n)=>{let r=new Date(WN(e,`00:00`,t));return{rangeStart:r,rangeEnd:new Date(r.getTime()+1440*60*1e3),workWindows:n?.active?n.slots.map(n=>({start:new Date(WN(e,n.from,t)),end:new Date(WN(e,n.to,t))})):[]}},J2=(e,t,n,r)=>{let i=[],a=(e,t)=>{i.push({startUtc:new Date(e).getTime(),endUtc:new Date(t).getTime()})};r.workWindows.forEach(e=>{a(e.start,e.end)}),n.forEach(e=>{IO(e,r.rangeStart,r.rangeEnd).forEach(e=>{a(e.start,e.end)})}),e.forEach(e=>{let n=t.get(e);n&&(n.workingHours.forEach(e=>{a(e.startUtc,e.endUtc)}),n.busy.forEach(e=>{a(e.startUtc,e.endUtc)}))});let o=r.rangeStart.getTime(),s=r.rangeEnd.getTime(),c=i.filter(e=>e.startUtc<s&&e.endUtc>o).map(e=>({startOffsetMs:Math.max(e.startUtc,o)-o,endOffsetMs:Math.min(e.endUtc,s)-o}));if(c.length===0)return{start:`09:00`,end:`17:00`};let l=1440*60*1e3,u=0;c.forEach(e=>{e.startOffsetMs<l&&(l=e.startOffsetMs),e.endOffsetMs>u&&(u=e.endOffsetMs)});let d=Math.floor(Math.max(0,l/6e4-60)/30)*30,f=Math.ceil(Math.min(1440,u/6e4+60)/30)*30,p=e=>`${String(Math.floor(e/60)).padStart(2,`0`)}:${String(e%60).padStart(2,`0`)}`;return{start:p(d),end:p(f)}},X={bookCard:`_bookCard_g1hkd_7`,bookTopBar:`_bookTopBar_g1hkd_16`,bookGrid:`_bookGrid_g1hkd_26`,colCalendar:`_colCalendar_g1hkd_31`,search:`_search_g1hkd_37`,searchIcon:`_searchIcon_g1hkd_42`,searchInput:`_searchInput_g1hkd_50`,contactList:`_contactList_g1hkd_61`,contactRow:`_contactRow_g1hkd_72`,contactActive:`_contactActive_g1hkd_91`,contactAvatar:`_contactAvatar_g1hkd_96`,contactText:`_contactText_g1hkd_112`,contactName:`_contactName_g1hkd_120`,contactRole:`_contactRole_g1hkd_135`,contactCheck:`_contactCheck_g1hkd_144`,contactCheckOn:`_contactCheckOn_g1hkd_158`,contactCheckIcon:`_contactCheckIcon_g1hkd_164`,contactEmpty:`_contactEmpty_g1hkd_170`,calHead:`_calHead_g1hkd_177`,calMonth:`_calMonth_g1hkd_184`,calNav:`_calNav_g1hkd_190`,calNavBtn:`_calNavBtn_g1hkd_195`,calDays:`_calDays_g1hkd_208`,calDayLabel:`_calDayLabel_g1hkd_214`,calGrid:`_calGrid_g1hkd_222`,calCell:`_calCell_g1hkd_228`,calCellToday:`_calCellToday_g1hkd_248`,calCellSelected:`_calCellSelected_g1hkd_254`,calCellPast:`_calCellPast_g1hkd_262`,calCellBlank:`_calCellBlank_g1hkd_267`,bookBar:`_bookBar_g1hkd_272`,bookHint:`_bookHint_g1hkd_282`,bookSummary:`_bookSummary_g1hkd_287`,bookSummaryName:`_bookSummaryName_g1hkd_295`,bookSummarySlot:`_bookSummarySlot_g1hkd_300`,bookBtn:`_bookBtn_g1hkd_305`,confirmBody:`_confirmBody_g1hkd_327`,confirmWho:`_confirmWho_g1hkd_333`,confirmAvatar:`_confirmAvatar_g1hkd_343`,confirmWhoText:`_confirmWhoText_g1hkd_357`,confirmName:`_confirmName_g1hkd_364`,confirmRole:`_confirmRole_g1hkd_370`,confirmRows:`_confirmRows_g1hkd_375`,confirmRow:`_confirmRow_g1hkd_375`,confirmRowIcon:`_confirmRowIcon_g1hkd_392`,confirmRowLabel:`_confirmRowLabel_g1hkd_404`,confirmRowValue:`_confirmRowValue_g1hkd_412`,bookedNote:`_bookedNote_g1hkd_420`,typeSelector:`_typeSelector_g1hkd_430`,typeBtn:`_typeBtn_g1hkd_438`,typeBtnActive:`_typeBtnActive_g1hkd_456`},Y2=({spanKey:e,name:t,dateLabel:n,formattedSlot:r})=>(0,D.jsxs)(A.span,{className:X.bookSummary,initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0},children:[(0,D.jsx)(`span`,{className:X.bookSummaryName,children:t}),` · `,n,` ·`,` `,(0,D.jsx)(`span`,{className:X.bookSummarySlot,children:r})]},e),X2=({meetingType:e,contact:t,dateLabel:n,slot:r,selectedContactIds:i,groupTitle:a,formattedSlot:o})=>e===`1:1`?t!==null&&n!==``&&r!==null?(0,D.jsx)(Y2,{spanKey:`summary`,name:t.name,dateLabel:n,formattedSlot:o}):null:i.length>0&&n!==``&&r!==null?(0,D.jsx)(Y2,{spanKey:`group-summary`,name:`${a||`Group Meeting`} (${String(i.length)} guests)`,dateLabel:n,formattedSlot:o}):null,Z2=({success:e,meetingType:t,contact:n,dateLabel:r,slot:i,selectedContactIds:a,groupTitle:o,selectedSlot:s,tzId:c})=>{if(e)return(0,D.jsxs)(A.span,{className:X.bookedNote,initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0},children:[(0,D.jsx)(Wn,{size:14,strokeWidth:3}),` Meeting booked — see the Scheduled tab.`]},`done`);let l=X2({meetingType:t,contact:n,dateLabel:r,slot:i,selectedContactIds:a,groupTitle:o,formattedSlot:s?H2(s.startUtc,s.endUtc,c):``});return l===null?(0,D.jsx)(`span`,{className:X.bookHint,children:t===`1:1`?`Pick a person, a date, and a time to book.`:`Select participants, set group title, pick a date and a time to book.`},`hint`):l},Q2=({contact:e,dateLabel:t,slot:n,canBook:r,success:i,meetingType:a,selectedContactIds:o,groupTitle:s,onBook:c,selectedSlot:l,tzId:u})=>(0,D.jsxs)(`div`,{className:X.bookBar,children:[(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsx)(Z2,{success:i,meetingType:a,contact:e,dateLabel:t,slot:n,selectedContactIds:o,groupTitle:s,selectedSlot:l,tzId:u})}),(0,D.jsxs)(A.button,{type:`button`,className:X.bookBtn,disabled:!r,...r?{whileTap:{scale:.97}}:{},onClick:()=>{c()},children:[`Confirm booking `,(0,D.jsx)(Mn,{size:15})]})]}),$2=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],e4=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],t4=e=>e.toLocaleDateString(`en-GB`,{weekday:`short`,day:`2-digit`,month:`short`}),n4=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),r4=(e,t,n)=>{let r=new Date(e,t,1).getDay(),i=new Date(e,t+1,0).getDate(),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=Array.from({length:r},()=>null);for(let r=1;r<=i;r+=1){let i=new Date(e,t,r);o.push({day:r,date:i,past:i<a,today:n4(i,n)})}return o},i4={col:`_col_18ut1_6`,colTitle:`_colTitle_18ut1_13`,stepDot:`_stepDot_18ut1_22`},a4=({cell:e,selected:t,onPick:n})=>(0,D.jsx)(A.button,{type:`button`,disabled:e.past,...e.past?{}:{whileHover:{scale:1.12},whileTap:{scale:.9}},className:T(X.calCell,e.past&&X.calCellPast,e.today&&X.calCellToday,t?.toDateString()===e.date.toDateString()&&X.calCellSelected),onClick:()=>{n(e.date)},children:e.day}),o4=({view:e,today:t,selected:n,onShift:r,onPick:i})=>(0,D.jsxs)(`div`,{className:X.colCalendar,children:[(0,D.jsxs)(`div`,{className:i4.colTitle,children:[(0,D.jsx)(`span`,{className:i4.stepDot,children:`2`}),` Pick a date`]}),(0,D.jsxs)(`div`,{className:X.calHead,children:[(0,D.jsxs)(`span`,{className:X.calMonth,children:[e4[e.month],` `,e.year]}),(0,D.jsxs)(`div`,{className:X.calNav,children:[(0,D.jsx)(A.button,{type:`button`,"aria-label":`Previous month`,className:X.calNavBtn,whileTap:{scale:.88},onClick:()=>{r(-1)},children:(0,D.jsx)(Kn,{size:15})}),(0,D.jsx)(A.button,{type:`button`,"aria-label":`Next month`,className:X.calNavBtn,whileTap:{scale:.88},onClick:()=>{r(1)},children:(0,D.jsx)(qn,{size:15})})]})]}),(0,D.jsx)(`div`,{className:X.calDays,children:$2.map(e=>(0,D.jsx)(`span`,{className:X.calDayLabel,children:e},e))}),(0,D.jsx)(A.div,{className:X.calGrid,initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.22,1,.36,1]},children:r4(e.year,e.month,t).map((e,t)=>e===null?(0,D.jsx)(`span`,{className:X.calCellBlank},`blank-${String(t)}`):(0,D.jsx)(a4,{cell:e,selected:n,onPick:i},e.day))},`${String(e.year)}-${String(e.month)}`)]}),s4={hidden:{},visible:{transition:{staggerChildren:.05,delayChildren:.05}}},c4={hidden:{opacity:0,x:-8},visible:{opacity:1,x:0,transition:{duration:.18,ease:`easeOut`}}},l4=({icon:e,label:t,value:n})=>(0,D.jsxs)(A.div,{className:X.confirmRow,variants:c4,children:[(0,D.jsx)(`span`,{className:X.confirmRowIcon,children:e}),(0,D.jsx)(`span`,{className:X.confirmRowLabel,children:t}),(0,D.jsx)(`span`,{className:X.confirmRowValue,children:n})]}),u4=({open:e,contact:t,dateLabel:n,slot:r,zone:i,pending:a,onConfirm:o,onClose:s,selectedSlot:c,tzId:l})=>{let u=H2(c?.startUtc,c?.endUtc,l);return(0,D.jsx)(Ky,{open:e&&t!==null&&r!==null&&n!==``,onOpenChange:e=>{e||s()},title:`Confirm your booking`,description:`A calendar invite is sent to both of you once confirmed.`,footer:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(vi,{variant:`ghost`,onClick:s,children:`Back`}),(0,D.jsx)(vi,{isLoading:a,onClick:o,children:`Confirm booking`})]}),children:t!==null&&r!==null?(0,D.jsxs)(`div`,{className:X.confirmBody,children:[(0,D.jsxs)(`div`,{className:X.confirmWho,children:[(0,D.jsx)(`span`,{className:X.confirmAvatar,style:E({"--avatar-color":t.color}),children:t.initials}),(0,D.jsxs)(`span`,{className:X.confirmWhoText,children:[(0,D.jsx)(`span`,{className:X.confirmName,children:t.name}),(0,D.jsx)(`span`,{className:X.confirmRole,children:t.role})]})]}),(0,D.jsxs)(A.div,{className:X.confirmRows,variants:s4,initial:`hidden`,animate:`visible`,children:[(0,D.jsx)(l4,{icon:(0,D.jsx)(Bn,{size:15}),label:`Date`,value:n}),(0,D.jsx)(l4,{icon:(0,D.jsx)(Qn,{size:15}),label:`Time`,value:u}),(0,D.jsx)(l4,{icon:(0,D.jsx)(lr,{size:15}),label:`Timezone`,value:`${i.city} · ${i.offset}`}),(0,D.jsx)(l4,{icon:(0,D.jsx)(oi,{size:15}),label:`Location`,value:`Online — link generated automatically`})]})]}):null})},d4={titleWrap:`_titleWrap_18nb9_3`,titleInput:`_titleInput_18nb9_7`},f4={hidden:{},visible:{transition:{staggerChildren:.04}}},p4=({contact:e,active:t,onSelect:n})=>(0,D.jsxs)(A.button,{type:`button`,layout:!0,variants:Vy,whileHover:{x:3},whileTap:{scale:.985},transition:{type:`spring`,stiffness:500,damping:34},className:T(X.contactRow,t&&X.contactActive),onClick:n,children:[(0,D.jsx)(`span`,{className:X.contactAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:X.contactText,children:[(0,D.jsx)(`span`,{className:X.contactName,children:e.name}),(0,D.jsx)(`span`,{className:X.contactRole,children:e.role})]}),(0,D.jsx)(`span`,{className:T(X.contactCheck,t&&X.contactCheckOn),children:(0,D.jsx)(Kg,{children:t&&(0,D.jsx)(A.span,{className:X.contactCheckIcon,initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:`spring`,stiffness:500,damping:28},children:(0,D.jsx)(Wn,{size:11,strokeWidth:3})})})})]}),m4=({contacts:e,selectedId:t,search:n,onSearch:r,onSelect:i,mode:a=`1:1`,selectedIds:o=[],onSelectGroup:s,groupTitle:c=``,onGroupTitleChange:l})=>(0,D.jsxs)(`div`,{className:i4.col,children:[(0,D.jsxs)(`div`,{className:i4.colTitle,children:[(0,D.jsx)(`span`,{className:i4.stepDot,children:`1`}),` `,a===`group`?`Configure Group Event`:`Choose a person`]}),a===`group`&&l&&(0,D.jsx)(`div`,{className:d4.titleWrap,children:(0,D.jsx)(`input`,{type:`text`,className:T(X.searchInput,d4.titleInput),placeholder:`Group Event Title (e.g. Team Sync)`,value:c,onChange:e=>{l(e.target.value)}})}),(0,D.jsxs)(`div`,{className:X.search,children:[(0,D.jsx)(Hr,{size:14,className:X.searchIcon}),(0,D.jsx)(`input`,{type:`search`,className:X.searchInput,placeholder:`Search people…`,value:n,onChange:e=>{r(e.target.value)}})]}),(0,D.jsxs)(A.div,{className:X.contactList,variants:f4,initial:`hidden`,animate:`visible`,children:[(0,D.jsx)(Kg,{initial:!1,children:e.map(e=>(0,D.jsx)(p4,{contact:e,active:a===`group`?o.includes(e.id):t===e.id,onSelect:()=>{a===`group`&&s?s(o.includes(e.id)?o.filter(t=>t!==e.id):[...o,e.id]):i(e.id)}},e.id))}),e.length===0&&(0,D.jsx)(`p`,{className:X.contactEmpty,children:`No people match.`})]})]}),Z={wizardContainer:`_wizardContainer_pyr7v_8`,stepper:`_stepper_pyr7v_17`,stepItem:`_stepItem_pyr7v_27`,stepLine:`_stepLine_pyr7v_34`,stepLineActive:`_stepLineActive_pyr7v_40`,stepCircle:`_stepCircle_pyr7v_44`,stepCircleActive:`_stepCircleActive_pyr7v_60`,stepCircleDone:`_stepCircleDone_pyr7v_66`,stepText:`_stepText_pyr7v_72`,stepTextActive:`_stepTextActive_pyr7v_78`,wizardContent:`_wizardContent_pyr7v_83`,wizardRow:`_wizardRow_pyr7v_90`,wizardPanelLeft:`_wizardPanelLeft_pyr7v_96`,wizardPanelRight:`_wizardPanelRight_pyr7v_106`,timePanelLeft:`_timePanelLeft_pyr7v_114`,wizardList:`_wizardList_pyr7v_118`,timePanelRight:`_timePanelRight_pyr7v_128`,panelHeading:`_panelHeading_pyr7v_132`,wizardSearch:`_wizardSearch_pyr7v_139`,wizardListBtn:`_wizardListBtn_pyr7v_159`,wizardListBtnActive:`_wizardListBtnActive_pyr7v_176`,avatar:`_avatar_pyr7v_181`,avatarSmall:`_avatarSmall_pyr7v_193`,contactName:`_contactName_pyr7v_205`,contactRole:`_contactRole_pyr7v_211`,checkbox:`_checkbox_pyr7v_217`,checkboxActive:`_checkboxActive_pyr7v_228`,panelHeader:`_panelHeader_pyr7v_234`,badge:`_badge_pyr7v_246`,selectedGrid:`_selectedGrid_pyr7v_254`,selectedEmpty:`_selectedEmpty_pyr7v_274`,selectedEmptyIcon:`_selectedEmptyIcon_pyr7v_285`,selectedItemCard:`_selectedItemCard_pyr7v_291`,cardName:`_cardName_pyr7v_301`,cardRole:`_cardRole_pyr7v_310`,removeBtn:`_removeBtn_pyr7v_318`,attendeeStatusItem:`_attendeeStatusItem_pyr7v_337`,statusIndicator:`_statusIndicator_pyr7v_346`,statusIndicatorAvail:`_statusIndicatorAvail_pyr7v_353`,statusIndicatorBusy:`_statusIndicatorBusy_pyr7v_357`,statusIndicatorOoh:`_statusIndicatorOoh_pyr7v_361`,gridToolbar:`_gridToolbar_pyr7v_366`,datePickerInput:`_datePickerInput_pyr7v_377`,durationSelector:`_durationSelector_pyr7v_386`,durBtn:`_durBtn_pyr7v_394`,durBtnActive:`_durBtnActive_pyr7v_405`,legend:`_legend_pyr7v_411`,legendItem:`_legendItem_pyr7v_418`,dotAvail:`_dotAvail_pyr7v_425`,dotBusy:`_dotBusy_pyr7v_426`,dotOoh:`_dotOoh_pyr7v_427`,suggestedStrip:`_suggestedStrip_pyr7v_443`,suggestedRow:`_suggestedRow_pyr7v_449`,suggestedCard:`_suggestedCard_pyr7v_456`,suggestedCardActive:`_suggestedCardActive_pyr7v_472`,suggestedCardFree:`_suggestedCardFree_pyr7v_479`,gridEmpty:`_gridEmpty_pyr7v_489`,wizardConfirmContainer:`_wizardConfirmContainer_pyr7v_501`,confirmHeading:`_confirmHeading_pyr7v_509`,confirmSub:`_confirmSub_pyr7v_516`,confirmCard:`_confirmCard_pyr7v_522`,confirmRow:`_confirmRow_pyr7v_532`,confirmLabel:`_confirmLabel_pyr7v_540`,confirmVal:`_confirmVal_pyr7v_548`,confirmAttendeeBadge:`_confirmAttendeeBadge_pyr7v_554`,avatarTiny:`_avatarTiny_pyr7v_567`,wizardFooter:`_wizardFooter_pyr7v_580`,wizardBackBtn:`_wizardBackBtn_pyr7v_589`,wizardNextBtn:`_wizardNextBtn_pyr7v_609`,selectedStatusAlert:`_selectedStatusAlert_pyr7v_634`,successContainer:`_successContainer_pyr7v_647`,successHeader:`_successHeader_pyr7v_659`,successTitle:`_successTitle_pyr7v_667`,successSub:`_successSub_pyr7v_674`,successCard:`_successCard_pyr7v_680`,successRow:`_successRow_pyr7v_694`,successLabel:`_successLabel_pyr7v_707`,successVal:`_successVal_pyr7v_716`,successActions:`_successActions_pyr7v_725`,successBtn:`_successBtn_pyr7v_733`,successBtnPrimary:`_successBtnPrimary_pyr7v_743`,successBtnSecondary:`_successBtnSecondary_pyr7v_752`},h4={titleVal:`_titleVal_195yt_3`,inlineIcon:`_inlineIcon_195yt_8`,agendaVal:`_agendaVal_195yt_13`,lastRow:`_lastRow_195yt_17`,guestList:`_guestList_195yt_21`},g4=({d:e})=>{let t=e.selectedContactIds.map(t=>e.list.find(e=>e.id===t)),n=e.groupTitle.trim()===``?`Group Meeting`:e.groupTitle,r=e.selectedSlot?H2(e.selectedSlot.startUtc,e.selectedSlot.endUtc,e.tzId):`No time selected`,i=e.selectedSlot?U2(e.selectedSlot.startUtc,e.tzId):e.dateLabel;return(0,D.jsxs)(`div`,{className:Z.wizardConfirmContainer,children:[(0,D.jsx)(`h3`,{className:Z.confirmHeading,children:`Review group meeting`}),(0,D.jsx)(`p`,{className:Z.confirmSub,children:`Ensure everything is correct before sending invitations.`}),(0,D.jsxs)(`div`,{className:Z.confirmCard,children:[(0,D.jsxs)(`div`,{className:Z.confirmRow,children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Title`}),(0,D.jsx)(`span`,{className:T(Z.confirmVal,h4.titleVal),children:n})]}),(0,D.jsxs)(`div`,{className:Z.confirmRow,children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Date & Time`}),(0,D.jsxs)(`span`,{className:Z.confirmVal,children:[i,` @ `,r,` (`,e.zone.offset,`)`]})]}),(0,D.jsxs)(`div`,{className:Z.confirmRow,children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Location`}),(0,D.jsxs)(`span`,{className:Z.confirmVal,children:[(0,D.jsx)(yr,{size:13,className:h4.inlineIcon}),e.groupLocation]})]}),e.groupDescription.trim()&&(0,D.jsxs)(`div`,{className:Z.confirmRow,children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Agenda`}),(0,D.jsx)(`span`,{className:T(Z.confirmVal,h4.agendaVal),children:e.groupDescription})]}),(0,D.jsxs)(`div`,{className:T(Z.confirmRow,h4.lastRow),children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Invited Guests`}),(0,D.jsx)(`div`,{className:T(Z.confirmVal,h4.guestList),children:t.map(e=>e===void 0?null:(0,D.jsxs)(`span`,{className:Z.confirmAttendeeBadge,children:[(0,D.jsx)(`span`,{className:Z.avatarTiny,style:{backgroundColor:e.color},children:e.initials}),e.name]},e.id))})]})]})]})},_4={wizardDetailsForm:`_wizardDetailsForm_79bfd_3`,detailsHeading:`_detailsHeading_79bfd_11`,detailsSub:`_detailsSub_79bfd_18`,formGroup:`_formGroup_79bfd_24`,formLabel:`_formLabel_79bfd_28`,formInput:`_formInput_79bfd_37`,formTextarea:`_formTextarea_79bfd_54`},v4=({d:e})=>(0,D.jsxs)(`div`,{className:_4.wizardDetailsForm,children:[(0,D.jsx)(`h3`,{className:_4.detailsHeading,children:`Meeting details`}),(0,D.jsx)(`p`,{className:_4.detailsSub,children:`Add context to the invite so attendees know what to expect.`}),(0,D.jsxs)(`div`,{className:_4.formGroup,children:[(0,D.jsx)(`label`,{className:_4.formLabel,children:`MEETING TITLE *`}),(0,D.jsx)(`input`,{type:`text`,className:_4.formInput,placeholder:`e.g. Weekly Admissions Alignment`,value:e.groupTitle,onChange:t=>{e.setGroupTitle(t.target.value)}})]}),(0,D.jsxs)(`div`,{className:_4.formGroup,children:[(0,D.jsx)(`label`,{className:_4.formLabel,children:`LOCATION / TYPE *`}),(0,D.jsx)(`input`,{type:`text`,className:_4.formInput,placeholder:`e.g. Google Meet, Room 402`,value:e.groupLocation,onChange:t=>{e.setGroupLocation(t.target.value)}})]}),(0,D.jsxs)(`div`,{className:_4.formGroup,children:[(0,D.jsx)(`label`,{className:_4.formLabel,children:`AGENDA / DESCRIPTION`}),(0,D.jsx)(`textarea`,{className:_4.formTextarea,rows:5,placeholder:`What will you cover in this meeting? (optional)`,value:e.groupDescription,onChange:t=>{e.setGroupDescription(t.target.value)}})]})]}),y4={searchWrap:`_searchWrap_3i51q_3`,contactMeta:`_contactMeta_3i51q_7`,selectedMeta:`_selectedMeta_3i51q_13`},b4=({d:e,isSelected:t,onToggle:n})=>(0,D.jsxs)(`div`,{className:Z.wizardPanelLeft,children:[(0,D.jsxs)(`div`,{className:y4.searchWrap,children:[(0,D.jsx)(`h3`,{className:Z.panelHeading,children:`Add participants`}),(0,D.jsx)(`input`,{type:`text`,className:Z.wizardSearch,placeholder:`Search by name, role or department...`,value:e.search,onChange:t=>{e.setSearch(t.target.value)}})]}),(0,D.jsx)(`div`,{className:Z.wizardList,children:e.searchResults.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:T(Z.wizardListBtn,t(e.id)&&Z.wizardListBtnActive),onClick:()=>{n(e.id)},children:[(0,D.jsx)(`span`,{className:Z.avatar,style:{backgroundColor:e.color},children:e.initials}),(0,D.jsxs)(`div`,{className:y4.contactMeta,children:[(0,D.jsx)(`div`,{className:Z.contactName,children:e.name}),(0,D.jsx)(`div`,{className:Z.contactRole,children:e.role})]}),(0,D.jsx)(`div`,{className:T(Z.checkbox,t(e.id)&&Z.checkboxActive),children:t(e.id)&&(0,D.jsx)(Wn,{size:10,strokeWidth:3})})]},e.id))})]}),x4=({d:e,onToggle:t})=>(0,D.jsxs)(`div`,{className:Z.wizardPanelRight,children:[(0,D.jsxs)(`div`,{className:Z.panelHeader,children:[(0,D.jsx)(`span`,{children:`SELECTED`}),(0,D.jsxs)(`span`,{className:Z.badge,children:[String(e.selectedContactIds.length),` guests`]})]}),(0,D.jsx)(`div`,{className:Z.selectedGrid,children:(0,D.jsx)(Kg,{initial:!1,children:e.selectedContactIds.length===0?(0,D.jsxs)(A.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:Z.selectedEmpty,children:[(0,D.jsx)(ai,{size:22,className:Z.selectedEmptyIcon}),(0,D.jsx)(`span`,{children:`Select people on the left to add them to the meeting.`})]},`empty`):e.selectedContactIds.map(n=>{let r=e.list.find(e=>e.id===n);return r===void 0?null:(0,D.jsxs)(A.div,{layout:!0,initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.9,x:20},transition:{type:`spring`,stiffness:300,damping:25},className:Z.selectedItemCard,children:[(0,D.jsx)(`span`,{className:Z.avatarSmall,style:{backgroundColor:r.color},children:r.initials}),(0,D.jsxs)(`div`,{className:y4.selectedMeta,children:[(0,D.jsx)(`div`,{className:Z.cardName,children:r.name}),(0,D.jsx)(`div`,{className:Z.cardRole,children:r.role})]}),(0,D.jsx)(`button`,{type:`button`,className:Z.removeBtn,onClick:()=>{t(n)},children:(0,D.jsx)(ni,{size:13})})]},n)})})})]}),S4=({d:e})=>{let t=t=>e.selectedContactIds.includes(t),n=n=>{t(n)?e.setSelectedContactIds(e.selectedContactIds.filter(e=>e!==n)):e.setSelectedContactIds([...e.selectedContactIds,n])};return(0,D.jsxs)(`div`,{className:Z.wizardRow,children:[(0,D.jsx)(b4,{d:e,isSelected:t,onToggle:n}),(0,D.jsx)(x4,{d:e,onToggle:n})]})},C4={timelineContainer:`_timelineContainer_11xrs_3`,timelineHeaderRow:`_timelineHeaderRow_11xrs_18`,timelineTimeCell:`_timelineTimeCell_11xrs_27`,timelineHeaderCell:`_timelineHeaderCell_11xrs_38`,timelineBody:`_timelineBody_11xrs_52`,timelineRow:`_timelineRow_11xrs_57`,timelineTimeCellActive:`_timelineTimeCellActive_11xrs_75`,timelineCell:`_timelineCell_11xrs_81`,cellAvail:`_cellAvail_11xrs_90`,cellBusy:`_cellBusy_11xrs_94`,cellOoh:`_cellOoh_11xrs_98`,cellSelected:`_cellSelected_11xrs_109`,gridTooltip:`_gridTooltip_11xrs_114`},w4=30,T4=(e,t,n)=>{let r=WN(t,e.start,n);return{startUtc:r,endUtc:new Date(new Date(r).getTime()+w4*6e4).toISOString()}},E4=(e,t,n)=>{let r=new Date(new Date(n.startUtc).getTime()+e.groupDuration*6e4).toISOString();e.pickSlot({label:t,startUtc:n.startUtc,endUtc:r,conflicts:[]})},D4=({id:e,d:t,rowInstants:n,serverBusy:r,selfBounds:i,allBlocks:a})=>{let o=r.get(e);return o===void 0?t.selected===null?`ooh`:zZ({userId:e,selfUserId:t.viewer.id,slotStart:new Date(n.startUtc),slotEnd:new Date(n.endUtc),allBlocks:a,rangeStart:i.rangeStart,rangeEnd:i.rangeEnd,workWindows:i.workWindows}):L2(n.startUtc,n.endUtc,o.busy)?`busy`:o.workingHours.length>0&&!R2(n.startUtc,n.endUtc,o.workingHours)?`ooh`:`available`},O4=({id:e,slotItem:t,d:n,allBlocks:r,serverBusy:i,rowInstants:a,selfBounds:o,isSelected:s,hoverCell:c,setHoverCell:l})=>{let u=D4({id:e,d:n,rowInstants:a,serverBusy:i,selfBounds:o,allBlocks:r}),d=c!==null&&c.userId===e&&c.slotLabel===t.label;return(0,D.jsx)(`div`,{className:T(C4.timelineCell,u===`available`&&C4.cellAvail,u===`busy`&&C4.cellBusy,u===`ooh`&&C4.cellOoh,s&&C4.cellSelected),onClick:()=>{E4(n,t.label,a)},onMouseEnter:()=>{l({userId:e,slotLabel:t.label})},onMouseLeave:()=>{l(null)},children:d&&(0,D.jsxs)(`div`,{className:C4.gridTooltip,children:[(0,D.jsx)(`strong`,{children:G2(e,n.list,n.viewer)}),` ·`,` `,u.toUpperCase()]})})},k4=({slotItem:e,d:t,activeAttendees:n,allBlocks:r,serverBusy:i,isoDate:a,displayZone:o,selfBounds:s,hoverCell:c,setHoverCell:l})=>{let u=t.slot===e.label,d=T4(e,a,o),f=qN.from({pick:o}).formatTime(d.startUtc);return(0,D.jsxs)(`div`,{className:C4.timelineRow,children:[(0,D.jsx)(`button`,{type:`button`,className:T(C4.timelineTimeCell,u&&C4.timelineTimeCellActive),onClick:()=>{E4(t,e.label,d)},children:f}),n.map(n=>(0,D.jsx)(O4,{id:n,slotItem:e,d:t,allBlocks:r,serverBusy:i,rowInstants:d,selfBounds:s,isSelected:u,hoverCell:c,setHoverCell:l},n+`-`+e.label))]})},A4=({d:e,activeAttendees:t,allBlocks:n,serverBusy:r,isoDate:i,hoverCell:a,setHoverCell:o})=>{let s=e.tzId,c=q2(i,s,e.hostDayWindow),l=z2(J2(t,r,n,c));return(0,D.jsxs)(`div`,{className:C4.timelineContainer,children:[(0,D.jsxs)(`div`,{className:C4.timelineHeaderRow,children:[(0,D.jsx)(`div`,{className:C4.timelineTimeCell}),t.map(t=>(0,D.jsx)(`div`,{className:C4.timelineHeaderCell,children:G2(t,e.list,e.viewer)},t))]}),(0,D.jsx)(`div`,{className:C4.timelineBody,children:l.map(l=>(0,D.jsx)(k4,{slotItem:l,d:e,activeAttendees:t,allBlocks:n,serverBusy:r,isoDate:i,displayZone:s,selfBounds:c,hoverCell:a,setHoverCell:o},l.label))})]})},j4={header:`_header_1afpk_3`,slotNote:`_slotNote_1afpk_7`,cardMeta:`_cardMeta_1afpk_12`},M4=({userId:e,selfUserId:t,startStr:n,endStr:r,anchorTzId:i,isoDate:a,allBlocks:o,dayWindow:s})=>{let c=s?.active?s.slots.map(e=>({start:new Date(WN(a,e.from,i)),end:new Date(WN(a,e.to,i))})):[],l=new Date(WN(a,`00:00`,i)),u=new Date(l.getTime()+1440*60*1e3);return zZ({userId:e,selfUserId:t,slotStart:new Date(WN(a,n,i)),slotEnd:new Date(WN(a,r,i)),allBlocks:o,rangeStart:l,rangeEnd:u,workWindows:c})},N4=(e,t,n)=>{let{id:r,d:i,allBlocks:a,serverBusy:o,anchorTzId:s,isoDate:c}=e,l=i.hostDayWindow;if(i.selected===null||l===null)return`available`;let u=o.get(r);if(u!==void 0){let e=WN(c,t,s),r=WN(c,n,s);return L2(e,r,u.busy)?`busy`:u.workingHours.length>0&&!R2(e,r,u.workingHours)?`ooh`:`available`}return M4({userId:r,selfUserId:i.viewer.id,startStr:t,endStr:n,anchorTzId:s,isoDate:c,allBlocks:a,dayWindow:l})},P4=e=>{let{id:t,d:n,curSlot:r}=e,i=K2(t,n.list,n.viewer),[a,o]=r?r.split(` – `):[null,null],s=a&&o?N4(e,a,o):`available`;return(0,D.jsxs)(`div`,{className:Z.attendeeStatusItem,children:[(0,D.jsx)(`span`,{className:Z.avatarSmall,style:{backgroundColor:i.color},children:i.initials}),(0,D.jsxs)(`div`,{className:j4.cardMeta,children:[(0,D.jsx)(`div`,{className:Z.cardName,children:i.name}),(0,D.jsx)(`div`,{className:Z.cardRole,children:i.role})]}),(0,D.jsx)(`span`,{className:T(Z.statusIndicator,s===`available`&&Z.statusIndicatorAvail,s===`busy`&&Z.statusIndicatorBusy,s===`ooh`&&Z.statusIndicatorOoh)})]})},F4=({d:e,activeAttendees:t,curSlot:n,allBlocks:r,serverBusy:i,anchorTzId:a,isoDate:o})=>(0,D.jsxs)(`div`,{className:T(Z.wizardPanelLeft,Z.timePanelLeft),children:[(0,D.jsxs)(`div`,{className:j4.header,children:[(0,D.jsx)(`h3`,{className:Z.panelHeading,children:`Attendees Availability`}),(0,D.jsxs)(`span`,{className:j4.slotNote,children:[`For selected slot: `,n??`None`]})]}),(0,D.jsx)(`div`,{className:Z.wizardList,children:t.map(t=>(0,D.jsx)(P4,{id:t,d:e,curSlot:n,allBlocks:r,serverBusy:i,anchorTzId:a,isoDate:o},t))})]}),I4={toolbarGroup:`_toolbarGroup_1hpun_3`,toolbarLabel:`_toolbarLabel_1hpun_9`,suggestedHeader:`_suggestedHeader_1hpun_15`,suggestedTitle:`_suggestedTitle_1hpun_22`,freeBadge:`_freeBadge_1hpun_29`,slotTime:`_slotTime_1hpun_34`,noSlots:`_noSlots_1hpun_40`,emptyIcon:`_emptyIcon_1hpun_46`},L4=({suggestedOptions:e,slot:t,activeAttendeesCount:n,setSlot:r,tzId:i})=>(0,D.jsxs)(`div`,{className:Z.suggestedRow,children:[e.map(e=>{let a=t===e.label,o=n-e.conflicts.length,s=H2(e.startUtc,e.endUtc,i);return(0,D.jsxs)(`button`,{type:`button`,className:T(Z.suggestedCard,a&&Z.suggestedCardActive,e.conflicts.length===0&&Z.suggestedCardFree),onClick:()=>{r(e.label)},children:[(0,D.jsx)(`div`,{className:I4.freeBadge,children:e.conflicts.length===0?`ALL FREE`:`${String(o)}/${String(n)} FREE`}),(0,D.jsx)(`div`,{className:I4.slotTime,children:s})]},e.label)}),e.length===0&&(0,D.jsx)(`div`,{className:I4.noSlots,children:`No suggested slots found.`})]}),R4=({d:e})=>(0,D.jsxs)(`div`,{className:Z.gridToolbar,children:[(0,D.jsxs)(`div`,{className:I4.toolbarGroup,children:[(0,D.jsx)(Bn,{size:14,color:`var(--color-primary)`}),(0,D.jsx)(`input`,{type:`date`,className:Z.datePickerInput,value:e.selected?e.selected.toISOString().substring(0,10):``,onChange:t=>{t.target.value&&e.pickDate(new Date(t.target.value))}})]}),(0,D.jsxs)(`div`,{className:I4.toolbarGroup,children:[(0,D.jsx)(`span`,{className:I4.toolbarLabel,children:`DURATION`}),(0,D.jsx)(`div`,{className:Z.durationSelector,children:[30,60,90,120].map(t=>(0,D.jsx)(`button`,{type:`button`,className:T(Z.durBtn,e.groupDuration===t&&Z.durBtnActive),onClick:()=>{e.setGroupDuration(t)},children:t<60?`${String(t)}m`:`${String(t/60)}h`},t))})]}),(0,D.jsxs)(`div`,{className:Z.legend,children:[(0,D.jsxs)(`span`,{className:Z.legendItem,children:[(0,D.jsx)(`span`,{className:Z.dotAvail}),` Free`]}),(0,D.jsxs)(`span`,{className:Z.legendItem,children:[(0,D.jsx)(`span`,{className:Z.dotBusy}),` Busy`]}),(0,D.jsxs)(`span`,{className:Z.legendItem,children:[(0,D.jsx)(`span`,{className:Z.dotOoh}),` Out of hours`]})]})]}),z4=({d:e,activeAttendees:t,allBlocks:n,serverBusy:r,isoDate:i,hoverCell:a,setHoverCell:o})=>e.selected===null?(0,D.jsxs)(`div`,{className:Z.gridEmpty,children:[(0,D.jsx)(Qn,{size:28,className:I4.emptyIcon}),(0,D.jsx)(`span`,{children:`Select a date above to display the availability grid.`})]}):(0,D.jsx)(A4,{d:e,activeAttendees:t,allBlocks:n,serverBusy:r,isoDate:i,hoverCell:a,setHoverCell:o}),B4=e=>{let t=NN().data??[],r=JN().anchor,i=e.selected===null?null:B2(e.selected,e.today),a=bQ(e.selectedContactIds,i);return{allBlocks:t,anchorTzId:r,isoDate:i,serverBusy:(0,n.useMemo)(()=>{let e=new Map;for(let t of a.data??[])e.set(t.userId,{busy:t.busy,workingHours:t.workingHours});return e},[a.data]),activeAttendees:e.viewer.id===``?[...e.selectedContactIds]:[e.viewer.id,...e.selectedContactIds],curSlot:e.slot}},V4=({d:e})=>{let{allBlocks:t,anchorTzId:r,isoDate:i,serverBusy:a,activeAttendees:o,curSlot:s}=B4(e),[c,l]=(0,n.useState)(null);return(0,D.jsxs)(`div`,{className:Z.wizardRow,children:[(0,D.jsx)(F4,{d:e,activeAttendees:o,curSlot:s,allBlocks:t,serverBusy:a,anchorTzId:r,isoDate:i??``}),(0,D.jsxs)(`div`,{className:T(Z.wizardPanelRight,Z.timePanelRight),children:[(0,D.jsx)(R4,{d:e}),(0,D.jsxs)(`div`,{className:Z.suggestedStrip,children:[(0,D.jsxs)(`div`,{className:I4.suggestedHeader,children:[(0,D.jsx)(Xr,{size:12,color:`var(--color-secondary)`}),(0,D.jsx)(`span`,{className:I4.suggestedTitle,children:`SUGGESTED TIMESLOTS`})]}),(0,D.jsx)(L4,{suggestedOptions:e.availableSlots.slice(0,4),slot:e.slot,activeAttendeesCount:o.length,setSlot:e.setSlot,tzId:e.tzId})]}),(0,D.jsx)(z4,{d:e,activeAttendees:o,allBlocks:t,serverBusy:a,isoDate:i??``,hoverCell:c,setHoverCell:l})]})]})},H4=()=>{let[e,t]=(0,n.useState)(`participants`),[r,i]=(0,n.useState)(30),[a,o]=(0,n.useState)(`Online Meeting`),[s,c]=(0,n.useState)(``);return{groupStep:e,groupDuration:r,groupLocation:a,groupDescription:s,setGroupStep:t,setGroupDuration:i,setGroupLocation:o,setGroupDescription:c,resetGroupWizardState:()=>{t(`participants`),i(30),o(`Online Meeting`),c(``)}}},U4=(e,t,n,r)=>{let i=e.s.meetingType===`group`;return{contactId:i?e.s.selectedContactIds[0]??``:e.s.contactId??``,dateLabel:t4(t),slot:n,title:i?e.s.groupTitle||`Group Meeting`:void 0,isGroup:i,attendeeIds:i?e.s.selectedContactIds:void 0,location:i?e.gw.groupLocation:void 0,description:i?e.gw.groupDescription:void 0,isoDate:B2(t,e.today),startUtc:r?.startUtc,endUtc:r?.endUtc}},W4=e=>e.s.pickedSlot??(e.s.slot===null?null:e.availableSlots.find(t=>t.label===e.s.slot)??null),G4=e=>()=>{if(e.s.slot===null||e.s.selected===null)return;let t=W4(e);e.book.mutate(U4(e,e.s.selected,e.s.slot,t),{onSuccess:()=>{e.s.setBookedSlot(t),e.s.setSlot(null),e.s.setPickedSlot(null),e.s.setConfirmOpen(!1)},onError:e=>{j.error(e.message)}})},K4=e=>({setMeetingType:t=>{e.s.setMeetingType(t),t===`group`&&e.resetGroupWizard()},setContactId:t=>{e.s.setContactId(t),e.s.setSlot(null),e.s.setPickedSlot(null)},setSelectedContactIds:t=>{e.s.setSelectedContactIds(t),e.s.setSlot(null),e.s.setPickedSlot(null)},setGroupTitle:e.s.setGroupTitle,setSearch:e.s.setSearch,setTzId:e.setTzId,setSlot:t=>{e.s.setSlot(t),e.s.setPickedSlot(null)},pickSlot:t=>{e.s.setSlot(t.label),e.s.setPickedSlot(t)},setConfirmOpen:e.s.setConfirmOpen,shift:t=>{e.s.setView(e=>({year:e.year+Math.floor((e.month+t)/12),month:((e.month+t)%12+12)%12}))},pickDate:t=>{e.s.setSelected(t),e.s.setSlot(null),e.s.setPickedSlot(null)},setGroupStep:e.gw.setGroupStep,setGroupDuration:e.gw.setGroupDuration,setGroupLocation:e.gw.setGroupLocation,setGroupDescription:e.gw.setGroupDescription,resetGroupWizard:e.resetGroupWizard,reset:e.reset,confirm:G4(e)}),q4=e=>{let t=K4(e);return{today:e.today,viewer:e.viewer,meetingType:e.s.meetingType,contactId:e.s.contactId,selectedContactIds:e.s.selectedContactIds,groupTitle:e.s.groupTitle,search:e.s.search,tzId:e.tzId,view:e.s.view,selected:e.s.selected,slot:e.s.slot,selectedSlot:W4(e),bookedSlot:e.s.bookedSlot,confirmOpen:e.s.confirmOpen,list:e.list,searchResults:e.searchResults,contact:e.contact,dateLabel:e.s.selected===null?``:t4(e.s.selected),zone:NZ(e.tzId),canBook:(e.s.meetingType===`1:1`?e.s.contactId!==null:e.s.selectedContactIds.length>0)&&e.s.selected!==null&&e.s.slot!==null&&!e.book.isPending,pending:e.book.isPending,success:e.book.isSuccess,availableSlots:e.availableSlots,hostDayWindow:e.hostDayWindow,groupStep:e.gw.groupStep,groupDuration:e.gw.groupDuration,groupLocation:e.gw.groupLocation,groupDescription:e.gw.groupDescription,...t}},J4=(e,t)=>{let[r,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let n=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(n)}},[e,t]),r},Y4=e=>`${String(e.getFullYear())}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,X4=e=>{let t=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],n={};for(let r of t)n[r]={active:e[r].active,slots:e[r].active?[{id:r+`-default`,from:e[r].from,to:e[r].to}]:[]};return n},Z4=(e,t)=>e.selected===null?null:e.meetingType===`group`?e.selectedContactIds.length===0?null:{isoDate:Y4(e.selected),timeZone:t,isGroup:!0,contactId:void 0,attendeeIds:[...e.selectedContactIds].sort()}:e.contactId===null?null:{isoDate:Y4(e.selected),timeZone:t,isGroup:!1,contactId:e.contactId,attendeeIds:void 0},Q4=e=>{let[t,r]=(0,n.useState)(`1:1`),[i,a]=(0,n.useState)(null),[o,s]=(0,n.useState)([]),[c,l]=(0,n.useState)(``),[u,d]=(0,n.useState)(``),[f,p]=(0,n.useState)(``),[m,h]=(0,n.useState)({year:e.getFullYear(),month:e.getMonth()}),[g,_]=(0,n.useState)(null),[v,y]=(0,n.useState)(null),[b,x]=(0,n.useState)(null),[S,C]=(0,n.useState)(null),[ee,te]=(0,n.useState)(!1);return{meetingType:t,setMeetingType:r,contactId:i,setContactId:a,selectedContactIds:o,setSelectedContactIds:s,groupTitle:c,setGroupTitle:l,search:u,setSearch:d,tzId:f,setTzIdState:p,view:m,setView:h,selected:g,setSelected:_,slot:v,setSlot:y,pickedSlot:b,setPickedSlot:x,bookedSlot:S,setBookedSlot:C,confirmOpen:ee,setConfirmOpen:te}},$4=()=>{let e=xQ(),t=I2(),n=new Date,r=H4(),i=Q4(n),a=J4(i.search,250),o=_Q(),s=_Q(a),c=LN(),l=AN(),u=pR(),d=o.data??[],f=d,p=s.data??[],m=d.find(e=>e.id===i.contactId)??null,h=c.data??{meetingDuration:r.groupDuration,bufferMinutes:5,workStart:`09:00`,workEnd:`17:00`,timezone:`Europe/London`,branchId:`uk`,availabilityTimezone:`Europe/London`},g=qN.from({pick:i.tzId,personal:h.timezone,anchor:h.availabilityTimezone}).display,_=u.data?X4(kI(u.data,h.branchId)):null,v=pO(l.data??null,_),y=i.selected===null?null:mO(v,i.selected);return q4({today:n,viewer:t,s:i,gw:r,book:e,list:f,searchResults:p,contact:m,availableSlots:yQ(Z4(i,g)).data??[],hostDayWindow:y,tzId:g,setTzId:e=>{i.setTzIdState(e)},resetGroupWizard:()=>{r.resetGroupWizardState(),i.setSelectedContactIds([]),i.setGroupTitle(``),i.setSlot(null),i.setPickedSlot(null),i.setSelected(null)},reset:()=>{e.reset(),i.setContactId(null),i.setSelectedContactIds([]),i.setGroupTitle(``),i.setSlot(null),i.setPickedSlot(null),i.setBookedSlot(null),i.setSelected(null),r.resetGroupWizardState()}})},e3={wizardContentClip:`_wizardContentClip_14i7n_3`,wizardStep:`_wizardStep_14i7n_8`},t3=({currentStep:e})=>{let t=[{id:`participants`,label:`Participants`},{id:`time`,label:`Find a time`},{id:`details`,label:`Details`},{id:`confirm`,label:`Confirm`}],r=(e=>t.findIndex(t=>t.id===e))(e);return(0,D.jsx)(`div`,{className:Z.stepper,children:t.map((e,t)=>{let i=t<r,a=t===r;return(0,D.jsxs)(n.Fragment,{children:[t>0&&(0,D.jsx)(`div`,{className:T(Z.stepLine,t<=r&&Z.stepLineActive)}),(0,D.jsxs)(`div`,{className:Z.stepItem,children:[(0,D.jsx)(`div`,{className:T(Z.stepCircle,a&&Z.stepCircleActive,i&&Z.stepCircleDone),children:i?(0,D.jsx)(Wn,{size:12,strokeWidth:3}):t+1}),(0,D.jsx)(`span`,{className:T(Z.stepText,a&&Z.stepTextActive),children:e.label})]})]},e.id)})})},n3=e=>e===`participants`?`time`:e===`time`?`details`:e===`details`?`confirm`:null,r3=e=>e===`time`?`participants`:e===`details`?`time`:e===`confirm`?`details`:null,i3=({step:e,selectedContactIds:t,slot:n,title:r,location:i,pending:a})=>e===`participants`?t.length===0:e===`time`?n===null:e===`details`?r.trim()===``||i.trim()===``:a,a3=e=>e===`participants`?`Next: Find a time`:e===`time`?`Next: Details`:e===`details`?`Next: Confirm`:`Confirm Booking`,o3=({d:e})=>{let t=()=>{let t=r3(e.groupStep);t?e.setGroupStep(t):e.setMeetingType(`1:1`)},n=()=>{let t=n3(e.groupStep);t?e.setGroupStep(t):e.confirm()},r=i3({step:e.groupStep,selectedContactIds:e.selectedContactIds,slot:e.slot,title:e.groupTitle,location:e.groupLocation,pending:e.pending}),i=a3(e.groupStep);return(0,D.jsxs)(`div`,{className:Z.wizardContainer,children:[(0,D.jsx)(t3,{currentStep:e.groupStep}),(0,D.jsx)(`div`,{className:T(Z.wizardContent,e3.wizardContentClip),children:(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsxs)(A.div,{initial:{opacity:0,x:15},animate:{opacity:1,x:0},exit:{opacity:0,x:-15},transition:{duration:.18,ease:`easeInOut`},className:e3.wizardStep,children:[e.groupStep===`participants`&&(0,D.jsx)(S4,{d:e}),e.groupStep===`time`&&(0,D.jsx)(V4,{d:e}),e.groupStep===`details`&&(0,D.jsx)(v4,{d:e}),e.groupStep===`confirm`&&(0,D.jsx)(g4,{d:e})]},e.groupStep)})}),(0,D.jsxs)(`div`,{className:Z.wizardFooter,children:[(0,D.jsxs)(`button`,{type:`button`,className:Z.wizardBackBtn,onClick:t,disabled:e.pending,children:[(0,D.jsx)(Kn,{size:16}),` Back`]}),e.groupStep===`time`&&e.slot&&(0,D.jsxs)(`div`,{className:Z.selectedStatusAlert,children:[(0,D.jsx)(Yn,{size:14,color:`var(--color-primary)`}),(0,D.jsxs)(`span`,{children:[`Selected: `,e.slot]})]}),(0,D.jsxs)(`button`,{type:`button`,className:Z.wizardNextBtn,disabled:r||e.pending,onClick:n,children:[e.pending?`Booking...`:i,!e.pending&&(0,D.jsx)(qn,{size:16})]})]})]})},s3={slotsDate:`_slotsDate_1rdif_3`,slotsEmpty:`_slotsEmpty_1rdif_10`,slotsEmptyIcon:`_slotsEmptyIcon_1rdif_24`,slotsEmptyTitle:`_slotsEmptyTitle_1rdif_36`,slotList:`_slotList_1rdif_42`,slot:`_slot_1rdif_3`,slotActive:`_slotActive_1rdif_86`,slotWithConflicts:`_slotWithConflicts_1rdif_102`,slotMain:`_slotMain_1rdif_113`,slotConflictList:`_slotConflictList_1rdif_120`,conflictLabel:`_conflictLabel_1rdif_131`,conflictAvatar:`_conflictAvatar_1rdif_136`,noSlots:`_noSlots_1rdif_162`},c3={hidden:{},visible:{transition:{staggerChildren:.03}}},l3=`You're not available at this time — you can still book.`,u3=({option:e,isSelected:t,onSlot:n,contactsList:r,viewer:i,tzId:a})=>{let o=H2(e.startUtc,e.endUtc,a),s=e.conflicts.length>0,c=e.conflicts.includes(i.id);return(0,D.jsxs)(A.button,{type:`button`,variants:Vy,whileTap:{scale:.97},className:T(s3.slot,t&&s3.slotActive,s&&!t&&s3.slotWithConflicts),title:c?l3:void 0,onClick:()=>{n(e.label)},children:[(0,D.jsxs)(`div`,{className:s3.slotMain,children:[(0,D.jsx)(`span`,{children:o}),t&&(0,D.jsx)(Wn,{size:14,strokeWidth:3})]}),s&&(0,D.jsxs)(`div`,{className:s3.slotConflictList,children:[(0,D.jsx)(`span`,{className:s3.conflictLabel,children:c?`You're busy —`:`Conflict:`}),e.conflicts.map(e=>{let t=e===i.id,n=r.find(t=>t.id===e);return(0,D.jsx)(`span`,{className:s3.conflictAvatar,title:t?l3:`${n?.name??``} is busy / unavailable`,children:t?i.initials||`YOU`:n?.initials??``},e)})]})]})},d3=({dateLabel:e,slot:t,offset:n,onSlot:r,slots:i,contactsList:a,viewer:o,tzId:s})=>(0,D.jsxs)(`div`,{className:i4.col,children:[(0,D.jsxs)(`div`,{className:i4.colTitle,children:[(0,D.jsx)(`span`,{className:i4.stepDot,children:`3`}),` Available times`]}),e===``?(0,D.jsxs)(`div`,{className:s3.slotsEmpty,children:[(0,D.jsx)(`span`,{className:s3.slotsEmptyIcon,children:(0,D.jsx)(Qn,{size:28})}),(0,D.jsx)(`span`,{className:s3.slotsEmptyTitle,children:`Pick a date`}),(0,D.jsx)(`span`,{children:`Choose a day to see open times.`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:s3.slotsDate,children:[e,` · times in `,n]}),(0,D.jsxs)(A.div,{className:s3.slotList,variants:c3,initial:`hidden`,animate:`visible`,children:[i.map(e=>(0,D.jsx)(u3,{option:e,isSelected:t===e.label,onSlot:r,contactsList:a,viewer:o,tzId:s},e.label)),i.length===0&&(0,D.jsx)(`div`,{className:s3.noSlots,children:`No available timeslots found for this day.`})]})]})]}),f3={tzWrap:`_tzWrap_n6w9w_3`,tzBtn:`_tzBtn_n6w9w_8`,tzBtnOffset:`_tzBtnOffset_n6w9w_30`,tzChevron:`_tzChevron_n6w9w_36`,tzBackdrop:`_tzBackdrop_n6w9w_40`,tzPop:`_tzPop_n6w9w_49`,tzSearch:`_tzSearch_n6w9w_62`,tzSearchInput:`_tzSearchInput_n6w9w_74`,tzList:`_tzList_n6w9w_84`,tzRow:`_tzRow_n6w9w_119`,tzRowActive:`_tzRowActive_n6w9w_138`,tzCity:`_tzCity_n6w9w_142`,tzRowOffset:`_tzRowOffset_n6w9w_151`,tzCheck:`_tzCheck_n6w9w_157`,tzEmpty:`_tzEmpty_n6w9w_161`},p3=({search:e,list:t,value:n,onSearch:r,onPick:i})=>(0,D.jsxs)(A.div,{className:f3.tzPop,variants:Hy,initial:`hidden`,animate:`visible`,exit:`exit`,children:[(0,D.jsxs)(`div`,{className:f3.tzSearch,children:[(0,D.jsx)(Hr,{size:13}),(0,D.jsx)(`input`,{className:f3.tzSearchInput,placeholder:`Search timezones…`,value:e,onChange:e=>{r(e.target.value)}})]}),(0,D.jsxs)(`div`,{className:f3.tzList,children:[t.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:T(f3.tzRow,e.id===n&&f3.tzRowActive),onClick:()=>{i(e.id)},children:[(0,D.jsx)(`span`,{className:f3.tzCity,children:e.city}),(0,D.jsx)(`span`,{className:f3.tzRowOffset,children:e.offset}),e.id===n&&(0,D.jsx)(Wn,{size:13,className:f3.tzCheck})]},e.id)),t.length===0&&(0,D.jsx)(`p`,{className:f3.tzEmpty,children:`No timezones match.`})]})]}),m3=({value:e,onChange:t})=>{let[r,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(``),s=NZ(e),c=a.trim().toLowerCase(),l=(kZ.some(e=>e.id===s.id)?kZ:[s,...kZ]).filter(e=>c===``||e.city.toLowerCase().includes(c)||e.offset.toLowerCase().includes(c)||e.id.toLowerCase().includes(c));return(0,D.jsxs)(`div`,{className:f3.tzWrap,children:[(0,D.jsxs)(`button`,{type:`button`,className:f3.tzBtn,"aria-expanded":r,"aria-label":`Change timezone`,onClick:()=>{i(e=>!e)},children:[(0,D.jsx)(lr,{size:13}),(0,D.jsx)(`span`,{className:f3.tzBtnCity,children:s.city}),(0,D.jsx)(`span`,{className:f3.tzBtnOffset,children:s.offset}),(0,D.jsx)(Gn,{size:13,className:f3.tzChevron})]}),(0,D.jsx)(Kg,{children:r&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:f3.tzBackdrop,"aria-label":`Close timezone picker`,onClick:()=>{i(!1)}}),(0,D.jsx)(p3,{search:a,list:l,value:e,onSearch:o,onPick:e=>{t(e),o(``),i(!1)}})]})})]})},h3={badgeWrap:`_badgeWrap_swq6w_3`,badgeCircle:`_badgeCircle_swq6w_10`,guestRow:`_guestRow_swq6w_21`,eventVal:`_eventVal_swq6w_28`,iconRow:`_iconRow_swq6w_33`,iconRowMuted:`_iconRowMuted_swq6w_39`,iconRowTop:`_iconRowTop_swq6w_47`,agendaVal:`_agendaVal_swq6w_53`,iconTop:`_iconTop_swq6w_58`},g3=()=>(0,D.jsxs)(`div`,{className:Z.successHeader,children:[(0,D.jsx)(`div`,{className:h3.badgeWrap,children:(0,D.jsx)(A.div,{initial:{scale:0},animate:{scale:1},transition:{type:`spring`,stiffness:260,damping:20},className:h3.badgeCircle,children:(0,D.jsx)(A.div,{initial:{scale:0,rotate:-45},animate:{scale:1,rotate:0},transition:{delay:.2,type:`spring`,stiffness:200,damping:15},children:(0,D.jsx)(Wn,{size:32,color:`var(--color-success)`,strokeWidth:3})})})}),(0,D.jsx)(`h2`,{className:Z.successTitle,children:`Booking Confirmed!`}),(0,D.jsx)(`p`,{className:Z.successSub,children:`A calendar invite has been sent to all participants.`})]}),_3=({d:e})=>{let t=e.meetingType===`group`;return(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:t?`Invited Guests`:`Attendee`}),(0,D.jsx)(`div`,{className:T(Z.successVal,h3.guestRow),children:t?e.selectedContactIds.map(t=>{let n=e.list.find(e=>e.id===t);return n===void 0?null:(0,D.jsxs)(`span`,{className:Z.confirmAttendeeBadge,children:[(0,D.jsx)(`span`,{className:Z.avatarTiny,style:{backgroundColor:n.color},children:n.initials}),n.name]},n.id)}):e.contact?(0,D.jsxs)(`span`,{className:Z.confirmAttendeeBadge,children:[(0,D.jsx)(`span`,{className:Z.avatarTiny,style:{backgroundColor:e.contact.color},children:e.contact.initials}),e.contact.name]}):`None`})]})},v3=({d:e})=>{let t=e.meetingType===`group`,n=t?e.groupTitle||`Group Meeting`:`1:1 with ${e.contact?.name??`Attendee`}`,r=t?e.groupLocation:`Online — link generated automatically`,i=t?e.groupDescription:``,a=H2(e.bookedSlot?.startUtc,e.bookedSlot?.endUtc,e.tzId);return(0,D.jsxs)(A.div,{className:Z.successCard,initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:.3,duration:.25,ease:`easeOut`},children:[(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:`Event`}),(0,D.jsx)(`span`,{className:T(Z.successVal,h3.eventVal),children:n})]}),(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:`Date & Time`}),(0,D.jsxs)(`span`,{className:Z.successVal,children:[(0,D.jsxs)(`span`,{className:h3.iconRow,children:[(0,D.jsx)(Bn,{size:14,color:`var(--color-primary)`}),e.dateLabel]}),(0,D.jsxs)(`span`,{className:h3.iconRowMuted,children:[(0,D.jsx)(Qn,{size:14}),a,` (`,e.zone.offset,`)`]})]})]}),(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:`Location`}),(0,D.jsx)(`span`,{className:Z.successVal,children:(0,D.jsxs)(`span`,{className:h3.iconRow,children:[(0,D.jsx)(yr,{size:14,color:`var(--color-primary)`}),r]})})]}),(0,D.jsx)(_3,{d:e}),t&&i.trim()!==``&&(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:`Agenda`}),(0,D.jsx)(`span`,{className:T(Z.successVal,h3.agendaVal),children:(0,D.jsxs)(`span`,{className:h3.iconRowTop,children:[(0,D.jsx)(ei,{size:14,className:h3.iconTop}),i]})})]})]})},y3=({d:e,onViewScheduled:t})=>(0,D.jsxs)(`div`,{className:Z.successActions,children:[(0,D.jsx)(`button`,{type:`button`,className:T(Z.successBtn,Z.successBtnPrimary),onClick:()=>{t!==void 0&&t()},children:`View Scheduled Meetings`}),(0,D.jsx)(`button`,{type:`button`,className:T(Z.successBtn,Z.successBtnSecondary),onClick:()=>{e.reset()},children:`Book Another Meeting`})]}),b3=({d:e,onViewScheduled:t})=>(0,D.jsxs)(`div`,{className:Z.successContainer,children:[(0,D.jsx)(g3,{}),(0,D.jsx)(v3,{d:e}),(0,D.jsx)(y3,{d:e,onViewScheduled:t})]}),x3=({d:e})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:X.bookGrid,children:[(0,D.jsx)(m4,{contacts:e.searchResults,selectedId:e.contactId,search:e.search,onSearch:t=>{e.setSearch(t)},onSelect:t=>{e.setContactId(t)},mode:e.meetingType,selectedIds:e.selectedContactIds,onSelectGroup:t=>{e.setSelectedContactIds(t)},groupTitle:e.groupTitle,onGroupTitleChange:t=>{e.setGroupTitle(t)}}),(0,D.jsx)(o4,{view:e.view,today:e.today,selected:e.selected,onShift:t=>{e.shift(t)},onPick:t=>{e.pickDate(t)}}),(0,D.jsx)(d3,{dateLabel:e.dateLabel,slot:e.slot,offset:e.zone.offset,onSlot:t=>{e.setSlot(t)},slots:e.availableSlots,contactsList:e.list,viewer:e.viewer,tzId:e.tzId})]}),(0,D.jsx)(Q2,{contact:e.contact,dateLabel:e.dateLabel,slot:e.slot,canBook:e.canBook,success:e.success,meetingType:e.meetingType,selectedContactIds:e.selectedContactIds,groupTitle:e.groupTitle,onBook:()=>{e.setConfirmOpen(!0)},selectedSlot:e.selectedSlot,tzId:e.tzId}),(0,D.jsx)(u4,{open:e.confirmOpen,contact:e.contact,dateLabel:e.dateLabel,slot:e.slot,zone:e.zone,pending:e.pending,onConfirm:()=>{e.confirm()},onClose:()=>{e.setConfirmOpen(!1)},selectedSlot:e.selectedSlot,tzId:e.tzId})]}),S3=({onViewScheduled:e})=>{let t=$4();return t.success?(0,D.jsx)(b3,{d:t,onViewScheduled:e}):(0,D.jsxs)(`div`,{className:X.bookCard,children:[(0,D.jsxs)(`div`,{className:X.bookTopBar,children:[(0,D.jsxs)(`div`,{className:X.typeSelector,children:[(0,D.jsx)(`button`,{type:`button`,className:T(X.typeBtn,t.meetingType===`1:1`&&X.typeBtnActive),onClick:()=>{t.setMeetingType(`1:1`)},children:`1:1 Meeting`}),(0,D.jsx)(`button`,{type:`button`,className:T(X.typeBtn,t.meetingType===`group`&&X.typeBtnActive),onClick:()=>{t.setMeetingType(`group`)},children:`Group Meeting (1:Many)`})]}),(0,D.jsx)(m3,{value:t.tzId,onChange:e=>{t.setTzId(e)}})]}),t.meetingType===`group`?(0,D.jsx)(o3,{d:t}):(0,D.jsx)(x3,{d:t})]})},C3={schedWrap:`_schedWrap_1p5xn_4`,bucketTabs:`_bucketTabs_1p5xn_11`,bucketTab:`_bucketTab_1p5xn_11`,bucketTabActive:`_bucketTabActive_1p5xn_38`,bucketBg:`_bucketBg_1p5xn_45`,bucketLabel:`_bucketLabel_1p5xn_53`,bucketCount:`_bucketCount_1p5xn_58`,meetingList:`_meetingList_1p5xn_76`,meeting:`_meeting_1p5xn_76`,datePlate:`_datePlate_1p5xn_101`,datePlatePassed:`_datePlatePassed_1p5xn_114`,datePlateCanceled:`_datePlateCanceled_1p5xn_118`,datePlateMonth:`_datePlateMonth_1p5xn_122`,datePlateDay:`_datePlateDay_1p5xn_129`,meetingAvatar:`_meetingAvatar_1p5xn_141`,meetingBody:`_meetingBody_1p5xn_155`,meetingTitle:`_meetingTitle_1p5xn_163`,meetingMeta:`_meetingMeta_1p5xn_169`,meetingMetaItem:`_meetingMetaItem_1p5xn_178`,meetingActions:`_meetingActions_1p5xn_184`,acceptBtn:`_acceptBtn_1p5xn_191`,joinBtn:`_joinBtn_1p5xn_192`,joinBtnDisabled:`_joinBtnDisabled_1p5xn_209`,declineBtn:`_declineBtn_1p5xn_217`,cancelBtn:`_cancelBtn_1p5xn_228`,cancelBtnDisabled:`_cancelBtnDisabled_1p5xn_239`,statusPill:`_statusPill_1p5xn_247`,statusAccepted:`_statusAccepted_1p5xn_257`,statusPending:`_statusPending_1p5xn_262`,statusRejected:`_statusRejected_1p5xn_267`,statusCanceled:`_statusCanceled_1p5xn_268`,statusCompleted:`_statusCompleted_1p5xn_273`,empty:`_empty_1p5xn_278`,emptyIconWrap:`_emptyIconWrap_1p5xn_288`,emptyTitle:`_emptyTitle_1p5xn_300`,emptyText:`_emptyText_1p5xn_307`},w3=e=>e.isGroup?e.title===``||/^group (meeting|event)$/i.test(e.title.trim())?`Group Meeting`:`${e.title} · Group Meeting`:/^1:1\b/i.test(e.title.trim())||e.title===``?`1:1 with ${e.withName}`:e.withName===``?e.title:`${e.title} · ${e.withName}`,T3=e=>e===`accepted`?`Accepted`:e===`rejected`?`Declined`:`Pending`,E3=1800*1e3,D3=e=>{let t=Math.max(1,Math.ceil(e/6e4)),n=Math.floor(t/1440);if(n>=1){let e=Math.floor((t-n*60*24)/60);return e>0?`in ${String(n)}d ${String(e)}h`:`in ${String(n)}d`}let r=Math.floor(t/60),i=t%60;return r>=1?i>0?`in ${String(r)}h ${String(i)}m`:`in ${String(r)}h`:`in ${String(i)}m`},O3=({onRespond:e})=>(0,D.jsxs)(`div`,{className:C3.meetingActions,children:[(0,D.jsxs)(`button`,{type:`button`,className:C3.acceptBtn,onClick:()=>{e(!0)},children:[(0,D.jsx)(Wn,{size:12,strokeWidth:3}),` Accept`]}),(0,D.jsx)(`button`,{type:`button`,className:C3.declineBtn,onClick:()=>{e(!1)},children:`Decline`})]}),k3=e=>e===`accepted`?C3.statusAccepted??!1:e===`rejected`?C3.statusRejected??!1:C3.statusPending??!1,A3=({meeting:e,onCancel:t,onJoin:n,canJoin:r,joinHint:i})=>{let a=t$(e=>e.activeMeeting),o=t$(e=>e.isJoined)&&a!==null&&a.meetingId===e.id,s=e.myStatus===`accepted`,c=!r||o,l=o?`You are currently in this meeting`:i,u=o?`Leave the active call before canceling`:`Cancel meeting`;return(0,D.jsxs)(`div`,{className:C3.meetingActions,children:[(0,D.jsx)(`span`,{className:T(C3.statusPill,k3(e.myStatus)),children:T3(e.myStatus)}),s&&(0,D.jsx)(DE,{label:l,side:`top`,children:(0,D.jsxs)(`button`,{type:`button`,className:T(C3.joinBtn,c&&C3.joinBtnDisabled),disabled:c,"aria-label":l,onClick:n,children:[(0,D.jsx)(oi,{size:13}),` `,o?`Joined`:`Join`]})}),e.isOrganizer&&(0,D.jsx)(DE,{label:u,side:`top`,children:(0,D.jsx)(`button`,{type:`button`,className:T(C3.cancelBtn,o&&C3.cancelBtnDisabled),disabled:o,"aria-label":u,onClick:t,children:`Cancel`})})]})},j3=e=>{let{meeting:t,onRespond:n}=e;return t.awaitingResponse?(0,D.jsx)(O3,{onRespond:n}):t.bucket===`canceled`?(0,D.jsx)(`span`,{className:T(C3.statusPill,C3.statusCanceled),children:`Canceled`}):t.bucket===`passed`?(0,D.jsx)(`span`,{className:T(C3.statusPill,C3.statusCompleted),children:`Completed`}):(0,D.jsx)(A3,{...e})},M3=(e,t)=>({month:e.toLocaleDateString(`en-US`,{month:`short`,timeZone:t}).toUpperCase(),day:e.toLocaleDateString(`en-US`,{day:`numeric`,timeZone:t})}),N3=(e,t)=>{let[r,i]=(0,n.useState)(()=>Date.now());(0,n.useEffect)(()=>{let e=setInterval(()=>{i(Date.now())},3e4);return()=>{clearInterval(e)}},[]);let a=r>=e-E3&&r<=t;return{canJoin:a,joinHint:a?`Join the meeting`:r>t?`This meeting has ended`:`Join opens 30 min before — starts ${D3(e-r)}`}},P3=e=>{let{meeting:t}=e,r=JN(),i=new Date(t.startUtc),a=new Date(t.endUtc),o=r.formatTime(t.startUtc),s=r.formatTime(t.endUtc),c=M3(i,r.display),l=` (${NZ(r.display).offset})`,{canJoin:u,joinHint:d}=N3(i.getTime(),a.getTime()),f=(0,n.useRef)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{p.current=document.getElementById(`app-scroll-container`)},[]);let{scrollYProgress:m}=My({target:f,container:p,offset:[`start end`,`end start`]}),h=Iy(m,[0,1],[-8,8]);return(0,D.jsxs)(A.article,{ref:f,style:{y:h},className:C3.meeting,variants:Vy,whileHover:{y:-2},transition:{type:`spring`,stiffness:400,damping:30},children:[(0,D.jsxs)(`div`,{className:T(C3.datePlate,t.bucket===`passed`&&C3.datePlatePassed,t.bucket===`canceled`&&C3.datePlateCanceled),children:[(0,D.jsx)(`span`,{className:C3.datePlateMonth,children:c.month}),(0,D.jsx)(`span`,{className:C3.datePlateDay,children:c.day})]}),(0,D.jsx)(`span`,{className:C3.meetingAvatar,style:E({"--avatar-color":t.withColor}),children:t.withInitials}),(0,D.jsxs)(`div`,{className:C3.meetingBody,children:[(0,D.jsx)(`span`,{className:C3.meetingTitle,children:w3(t)}),(0,D.jsxs)(`div`,{className:C3.meetingMeta,children:[(0,D.jsxs)(`span`,{className:C3.meetingMetaItem,children:[(0,D.jsx)(Qn,{size:11}),` `,o,`–`,s,l]}),(0,D.jsxs)(`span`,{className:C3.meetingMetaItem,children:[(0,D.jsx)(yr,{size:11}),` `,t.location]})]})]}),(0,D.jsx)(j3,{...e,canJoin:u,joinHint:d})]})},F3={list:`_list_1vv5w_1`,meeting:`_meeting_1vv5w_7`,datePlate:`_datePlate_1vv5w_17`,pulse:`_pulse_1vv5w_1`,avatar:`_avatar_1vv5w_26`,body:`_body_1vv5w_35`,title:`_title_1vv5w_43`,meta:`_meta_1vv5w_51`,actions:`_actions_1vv5w_59`,btn:`_btn_1vv5w_66`},I3=()=>(0,D.jsx)(`div`,{className:F3.list,children:Array.from({length:3}).map((e,t)=>(0,D.jsxs)(`div`,{className:F3.meeting,children:[(0,D.jsx)(`div`,{className:F3.datePlate}),(0,D.jsx)(`div`,{className:F3.avatar}),(0,D.jsxs)(`div`,{className:F3.body,children:[(0,D.jsx)(`div`,{className:F3.title}),(0,D.jsx)(`div`,{className:F3.meta})]}),(0,D.jsxs)(`div`,{className:F3.actions,children:[(0,D.jsx)(`div`,{className:F3.btn}),(0,D.jsx)(`div`,{className:F3.btn})]})]},`skel-${String(t)}`))}),L3=[{id:`upcoming`,label:`Upcoming`},{id:`passed`,label:`Past`},{id:`canceled`,label:`Canceled`}],R3={type:`spring`,stiffness:420,damping:34},z3={hidden:{},visible:{transition:{staggerChildren:.05}}},B3=({bucket:e,counts:t,onSelect:n})=>(0,D.jsx)(`div`,{className:C3.bucketTabs,children:L3.map(r=>{let i=e===r.id;return(0,D.jsxs)(`button`,{type:`button`,className:T(C3.bucketTab,i&&C3.bucketTabActive),onClick:()=>{n(r.id)},children:[i&&(0,D.jsx)(A.span,{layoutId:`bucketBg`,className:C3.bucketBg,transition:R3}),(0,D.jsx)(`span`,{className:C3.bucketLabel,children:r.label}),(0,D.jsx)(`span`,{className:C3.bucketCount,children:t[r.id]})]},r.id)})}),V3=1e4,H3=()=>{let e=Be(),t=vQ(V3),r=SQ(),i=CQ(),[a,o]=(0,n.useState)(`upcoming`),s=t.data??[],c=[...s].filter(e=>e.bucket===a).sort((e,t)=>new Date(e.startUtc).getTime()-new Date(t.startUtc).getTime()),l={upcoming:s.filter(e=>e.bucket===`upcoming`).length,passed:s.filter(e=>e.bucket===`passed`).length,canceled:s.filter(e=>e.bucket===`canceled`).length};return(0,D.jsxs)(`div`,{className:C3.schedWrap,children:[(0,D.jsx)(B3,{bucket:a,counts:l,onSelect:o}),t.isPending?(0,D.jsx)(I3,{}):null,t.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not load meetings`,children:t.error.message}),t.isSuccess&&c.length===0?(0,D.jsxs)(`div`,{className:C3.empty,children:[(0,D.jsx)(`div`,{className:C3.emptyIconWrap,children:(0,D.jsx)(Vn,{size:32})}),(0,D.jsxs)(`span`,{className:C3.emptyTitle,children:[`No `,a,` meetings`]}),(0,D.jsx)(`span`,{className:C3.emptyText,children:`Nothing scheduled here yet.`})]}):null,t.isSuccess&&c.length>0?(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsx)(A.div,{className:C3.meetingList,variants:z3,initial:`hidden`,animate:`visible`,children:c.map(t=>(0,D.jsx)(P3,{meeting:t,onRespond:e=>{r.mutate({meetingId:t.id,accept:e})},onCancel:()=>{i.mutate(t.id)},onJoin:()=>{e(`/comms/meetings/${t.id}/room`)}},t.id))},a)}):null]})},U3={screen:`_screen_18kgg_6`,head:`_head_18kgg_13`,headTop:`_headTop_18kgg_19`,title:`_title_18kgg_27`,subtitle:`_subtitle_18kgg_35`,headBadge:`_headBadge_18kgg_41`,headBadgeNum:`_headBadgeNum_18kgg_47`,headBadgeLabel:`_headBadgeLabel_18kgg_53`,tabs:`_tabs_18kgg_59`,tab:`_tab_18kgg_59`,tabActive:`_tabActive_18kgg_84`,tabUnderline:`_tabUnderline_18kgg_90`,body:`_body_18kgg_100`,tabContent:`_tabContent_18kgg_107`},W3=()=>{let[e,t]=(0,n.useState)(`scheduled`),r=(vQ().data??[]).filter(e=>e.bucket===`upcoming`).length;return(0,D.jsxs)(`div`,{className:U3.screen,children:[(0,D.jsxs)(`header`,{className:U3.head,children:[(0,D.jsxs)(`div`,{className:U3.headTop,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:U3.title,children:`Meetings`}),(0,D.jsx)(`p`,{className:U3.subtitle,children:`Book 1:1 meetings and manage your invitations.`})]}),(0,D.jsxs)(`div`,{className:U3.headBadge,children:[(0,D.jsx)(`span`,{className:U3.headBadgeNum,children:r}),(0,D.jsx)(`span`,{className:U3.headBadgeLabel,children:`upcoming`})]})]}),(0,D.jsxs)(`div`,{className:U3.tabs,children:[(0,D.jsxs)(`button`,{type:`button`,className:T(U3.tab,e===`book`&&U3.tabActive),onClick:()=>{t(`book`)},children:[(0,D.jsx)(Bn,{size:15}),` Book a Meeting`,e===`book`&&(0,D.jsx)(A.span,{layoutId:`bookTabUnderline`,className:U3.tabUnderline,transition:{type:`spring`,stiffness:420,damping:34}})]}),(0,D.jsxs)(`button`,{type:`button`,className:T(U3.tab,e===`scheduled`&&U3.tabActive),onClick:()=>{t(`scheduled`)},children:[(0,D.jsx)(Qn,{size:15}),` Scheduled`,e===`scheduled`&&(0,D.jsx)(A.span,{layoutId:`bookTabUnderline`,className:U3.tabUnderline,transition:{type:`spring`,stiffness:420,damping:34}})]})]})]}),(0,D.jsx)(`div`,{className:U3.body,children:(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsx)(A.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2,ease:`easeOut`},className:U3.tabContent,children:e===`book`?(0,D.jsx)(S3,{onViewScheduled:()=>{t(`scheduled`)}}):(0,D.jsx)(H3,{})},e)})})]})},G3=()=>{let{meetingId:e}=We(),t=t$(e=>e.setRequestedMeetingId);return(0,n.useEffect)(()=>{e!==void 0&&t(e)},[e,t]),(0,D.jsx)(D.Fragment,{})},K3=`/comms/bookings`,q3=`/comms/meetings/:meetingId/room`,J3=()=>(0,D.jsxs)(St,{children:[(0,D.jsx)(bt,{path:K3,element:(0,D.jsx)(W3,{})}),(0,D.jsx)(bt,{path:q3,element:(0,D.jsx)(G3,{})}),(0,D.jsx)(bt,{path:`*`,element:(0,D.jsx)(yt,{to:K3,replace:!0})})]}),Y3=()=>{X$(`uapp-bookings`,()=>(0,D.jsx)(J3,{}))},X3=(e,t=0)=>{let n=new Date(e);return n.setHours(0,0,0,0),n.setDate(e.getDate()-(e.getDay()+6)%7+t*7),Array.from({length:7},(e,t)=>{let r=new Date(n);return r.setDate(n.getDate()+t),r})},Z3=(e,t)=>{let n=cO(e);return X3(e,t).map(e=>({date:e,dayNumber:e.getDate(),isToday:cO(e)===n}))},Q3=(e,t)=>e.toLocaleDateString(void 0,t),$3=(e,t)=>{let n=X3(e,t),r=n[0]??e,i=n[6]??e,a=r.getFullYear()===i.getFullYear();return a&&r.getMonth()===i.getMonth()?`${String(r.getDate())} – ${Q3(i,{day:`numeric`,month:`long`,year:`numeric`})}`:a?`${Q3(r,{day:`numeric`,month:`short`})} – ${Q3(i,{day:`numeric`,month:`short`,year:`numeric`})}`:`${Q3(r,{day:`numeric`,month:`short`,year:`numeric`})} – ${Q3(i,{day:`numeric`,month:`short`,year:`numeric`})}`},e6=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,1),t6=(e,t)=>e6(e,t).toLocaleDateString(void 0,{month:`long`,year:`numeric`}),n6=(e,t)=>{let n=e6(e,t),r=(n.getDay()+6)%7,i=new Date(n.getFullYear(),n.getMonth()+1,0).getDate(),a=Math.ceil((r+i)/7),o=new Date(n);return o.setDate(n.getDate()-r),Array.from({length:a*7},(e,t)=>{let n=new Date(o);return n.setDate(o.getDate()+t),n})},r6=e=>{if(e<60)return`${String(e)}m`;let t=Math.floor(e/60),n=e%60;return n===0?`${String(t)}h`:`${String(t)}h ${String(n)}m`},i6=e=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`},a6=e=>new Date(e).toLocaleDateString(void 0,{weekday:`short`,day:`numeric`,month:`short`}),o6=e=>cO(e),s6=e=>i6(e),c6=(e,t)=>{let[n,r,i]=e.split(`-`),[a,o]=t.split(`:`);return new Date(Number(n??`1970`),Number(r??`1`)-1,Number(i??`1`),Number(a??`0`),Number(o??`0`),0,0).toISOString()},l6={available:{label:`Available`,color:`#22c55e`,Icon:Wn},busy:{label:`Busy`,color:`#ef4444`,Icon:Nn},meeting:{label:`Meeting`,color:`#3b82f6`,Icon:oi},focus:{label:`Focus`,color:`#8b5cf6`,Icon:$r},away:{label:`Away`,color:`#94a3b8`,Icon:Qn}},u6=e=>e===0||e===24?`12 AM`:e===12?`12 PM`:e<12?`${String(e)} AM`:`${String(e-12)} PM`,d6=(e,t)=>{let n=iO(e),r=iO(t);return r<=n?1440:r},f6=(e,t)=>{let n=tk(t);return n<=tk(e)?1440:n},p6=(e,t,n)=>{let r=tk(n)<=tk(t)?0:Math.max(0,Math.floor(tk(t)/60)-1),i=Math.min(24,Math.ceil(f6(t,n)/60)+1);for(let t of e){let e=t.block.status===`available`&&(t.continuesFromPrevDay===!0||t.continuesToNextDay===!0);t.block.allDay&&!e||(r=Math.min(r,Math.floor(iO(t.start)/60)),i=Math.max(i,Math.ceil(d6(t.start,t.end)/60)))}return r=Math.max(0,Math.min(r,22)),i=Math.min(24,Math.max(i,r+2)),{startHour:r,endHour:i}},m6=e=>Array.from({length:e.endHour-e.startHour},(t,n)=>e.startHour+n),h6=e=>(e.endHour-e.startHour)*52,g6=(e,t,n)=>{let r=iO(e),i=d6(e,t);return{top:(r-n.startHour*60)*52/60,height:Math.max(20,(i-r)*52/60-2)}},_6=(e,t,n)=>{let r=n.startHour*60,i=Math.max(e,r),a=Math.min(t,n.endHour*60);return a<=i?null:{top:(i-r)*52/60,height:(a-i)*52/60}},v6=(e,t,n)=>e?t.flatMap(e=>{let t=tk(e.from),r=tk(e.to);if(r<=t)return[_6(t,1440,n),_6(0,r,n)].filter(e=>e!==null);let i=_6(t,r,n);return i===null?[]:[i]}):[],y6=(e,t)=>{let n=e.getHours()*60+e.getMinutes();return n<t.startHour*60||n>t.endHour*60?null:(n-t.startHour*60)*52/60},b6=(e,t,n,r=90)=>((tk(t)<=tk(e)?0:tk(e))-n*60)*52/60-r*52/60,x6=(e,t,n=90)=>(e.getHours()*60+e.getMinutes()-t*60)*52/60-n*52/60,S6=e=>{let t=[...e].sort((e,t)=>iO(e.start)-iO(t.start)||d6(e.start,e.end)-d6(t.start,t.end)),n=[],r=[],i=[],a=()=>{let e=Math.max(1,i.length);for(let t of r)n.push({occurrence:t.occurrence,lane:t.lane,lanes:e});r=[],i=[]};for(let e of t){let t=iO(e.start),n=d6(e.start,e.end);r.length>0&&t>=Math.max(...i)&&a();let o=i.findIndex(e=>e<=t);o===-1?(o=i.length,i.push(n)):i[o]=n,r.push({occurrence:e,lane:o})}return a(),n},C6=e=>{let t=e.filter(e=>e.end>e.start).slice().sort((e,t)=>e.start-t.start),n=[];for(let e of t){let t=n[n.length-1];t!==void 0&&e.start<=t.end?n[n.length-1]={start:t.start,end:Math.max(t.end,e.end)}:n.push(e)}return n},w6=e=>e.reduce((e,t)=>e+(t.end-t.start),0),T6=(e,t,n)=>{let r=cO(t),i=e.filter(e=>e.date===r&&!e.block.allDay),a=C6([...n.map(e=>{let t=tk(e.from),n=tk(e.to);return{start:t,end:n<=t?1440:n}}),...i.filter(e=>e.block.status===`available`).map(e=>({start:iO(e.start),end:d6(e.start,e.end)}))]),o=i.filter(e=>e.block.status!==`available`).map(e=>({start:iO(e.start),end:d6(e.start,e.end)})),s=0;for(let e of a){let t=C6(o.map(t=>({start:Math.max(e.start,t.start),end:Math.min(e.end,t.end)})));s+=e.end-e.start-w6(t)}return Math.max(0,Math.round(s/60))},E6=(e,t)=>new Date(new Date(e).getTime()+t*6e4).toISOString(),D6=(e,t)=>{let n=new Date(e),r=HN(t,n)-HN(BN(),n);return r===0?e:new Date(n.getTime()-r*6e4).toISOString()},O6=(e,t)=>{let n=new Date(e),r=HN(t,n)-HN(BN(),n);return r===0?e:new Date(n.getTime()+r*6e4).toISOString()},k6=(e,t)=>({...e,start:D6(e.start,t),end:D6(e.end,t)}),A6=e=>{if(e.mode===`edit`){let{block:t}=e;return{title:t.title,status:t.status,start:t.start,end:t.allDay?t.end:c6(o6(t.start),s6(t.end)),allDay:t.allDay,notes:t.notes,recurrence:t.recurrence}}let t=e.start,n=e.end??E6(t,60),r=null,i=cO(t);if(i!==cO(n)){n=c6(i,s6(n));let a=new Date(t),o=new Date(e.end??n),s=[],c=new Date(a),l=0;for(;cO(c)<=cO(o)&&l<100;)l++,s.push(c.getDay()),c.setDate(c.getDate()+1);r={freq:`weekly`,interval:1,weekdays:s,monthlyMode:`dayOfMonth`,endType:`on`,endCount:13,endDate:cO(o),exceptions:[]}}return{title:e.title??``,status:e.status??`available`,start:t,end:n,allDay:!1,notes:``,recurrence:r}},j6=e=>({...e,recurrence:e.recurrence===null?OO(e.start):null}),M6=(e,t)=>({...e,recurrence:t}),N6=(e,t)=>({...e,start:c6(t,s6(e.start)),end:c6(t,s6(e.end))}),P6=(e,t)=>{let n=c6(o6(e.start),t),r=new Date(n).getTime()-new Date(e.start).getTime();return{...e,start:n,end:new Date(new Date(e.end).getTime()+r).toISOString()}},F6=(e,t)=>({...e,end:c6(o6(e.start),t)}),I6=(e,t)=>{let n=o6(e.start);return t?{...e,allDay:!0,start:c6(n,`00:00`),end:c6(n,`23:59`)}:{...e,allDay:!1,start:c6(n,`09:00`),end:c6(n,`10:00`)}},Q={notesInput:`_notesInput_1ut2q_7`,actionSpacer:`_actionSpacer_1ut2q_24`,panelHead:`_panelHead_1ut2q_29`,panelTitle:`_panelTitle_1ut2q_41`,panelForm:`_panelForm_1ut2q_47`,microLabel:`_microLabel_1ut2q_54`,panelInput:`_panelInput_1ut2q_62`,inputError:`_inputError_1ut2q_79`,fieldError:`_fieldError_1ut2q_84`,statusPills:`_statusPills_1ut2q_90`,statusPill:`_statusPill_1ut2q_90`,statusPillActive:`_statusPillActive_1ut2q_110`,dtGrid:`_dtGrid_1ut2q_116`,checkRow:`_checkRow_1ut2q_133`,checkbox:`_checkbox_1ut2q_143`,recurToggle:`_recurToggle_1ut2q_150`,recurToggleOn:`_recurToggleOn_1ut2q_163`,recurToggleLabel:`_recurToggleLabel_1ut2q_168`,recurSwitch:`_recurSwitch_1ut2q_181`,recurSwitchOn:`_recurSwitchOn_1ut2q_191`,recurKnob:`_recurKnob_1ut2q_195`,panelFooter:`_panelFooter_1ut2q_210`,panelSummary:`_panelSummary_1ut2q_215`,panelActions:`_panelActions_1ut2q_226`,recurSection:`_recurSection_1ut2q_234`,recurBuilder:`_recurBuilder_1ut2q_240`,recurChips:`_recurChips_1ut2q_250`,recurChip:`_recurChip_1ut2q_250`,recurChipActive:`_recurChipActive_1ut2q_267`,recurInline:`_recurInline_1ut2q_273`,recurInlineLabel:`_recurInlineLabel_1ut2q_281`,recurNumber:`_recurNumber_1ut2q_286`,recurWeekdays:`_recurWeekdays_1ut2q_297`,recurDay:`_recurDay_1ut2q_303`,recurDayActive:`_recurDayActive_1ut2q_315`,recurEnds:`_recurEnds_1ut2q_321`,recurRadio:`_recurRadio_1ut2q_327`,recurDate:`_recurDate_1ut2q_339`,recurSummaryBox:`_recurSummaryBox_1ut2q_349`,panelSummaryError:`_panelSummaryError_1ut2q_360`,disabledButtonWrapper:`_disabledButtonWrapper_1ut2q_368`,resolveConflictBtn:`_resolveConflictBtn_1ut2q_373`,upcomingCard:`_upcomingCard_1ut2q_394`,upcomingHeader:`_upcomingHeader_1ut2q_402`,upcomingRow:`_upcomingRow_1ut2q_414`,upcomingRowDate:`_upcomingRowDate_1ut2q_427`,upcomingRowTime:`_upcomingRowTime_1ut2q_431`,upcomingMore:`_upcomingMore_1ut2q_436`,differentTimeRow:`_differentTimeRow_1ut2q_445`,differentTimeList:`_differentTimeList_1ut2q_456`,differentTimeRowItem:`_differentTimeRowItem_1ut2q_467`,differentTimeDayLabel:`_differentTimeDayLabel_1ut2q_479`,differentTimeNote:`_differentTimeNote_1ut2q_488`,differentTimeRowGroup:`_differentTimeRowGroup_1ut2q_495`,differentTimeDayLabelSpacer:`_differentTimeDayLabelSpacer_1ut2q_501`,slotActionBtn:`_slotActionBtn_1ut2q_507`,slotActionBtnTrash:`_slotActionBtnTrash_1ut2q_524`},L6={center:`_center_10cfo_6`,field:`_field_10cfo_12`,dash:`_dash_10cfo_18`},R6={timeInput:`_timeInput_ik08d_4`},z6=[{wd:1,label:`M`,longLabel:`Mon`},{wd:2,label:`T`,longLabel:`Tue`},{wd:3,label:`W`,longLabel:`Wed`},{wd:4,label:`T`,longLabel:`Thu`},{wd:5,label:`F`,longLabel:`Fri`},{wd:6,label:`S`,longLabel:`Sat`},{wd:0,label:`S`,longLabel:`Sun`}],B6=e=>{let[t,n]=e.split(`:`).map(Number);return(t??0)*60+(n??0)},V6=e=>{let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`},H6=e=>{if(!e)return{start:`09:00`,end:`17:00`};let t=B6(e.start),n=B6(e.end),r=n>t?n-t:60,i=n,a=i+r;return i>=1439?{start:`23:00`,end:`23:59`}:(a>1439&&(a=1439),{start:V6(i),end:V6(a)})},U6=({slot:e,index:t,dayMeta:n,dayName:r,showTrash:i,onUpdateStart:a,onUpdateEnd:o,onAdd:s,onRemove:c})=>(0,D.jsxs)(`div`,{className:Q.differentTimeRowItem,children:[t===0?(0,D.jsx)(`span`,{className:Q.differentTimeDayLabel,children:n?.longLabel??r}):(0,D.jsx)(`span`,{className:Q.differentTimeDayLabelSpacer}),(0,D.jsx)(`input`,{type:`time`,className:T(Q.recurDate,R6.timeInput),value:e.start,onChange:e=>{a(e.target.value)}}),(0,D.jsx)(`span`,{className:L6.dash,children:`–`}),(0,D.jsx)(`input`,{type:`time`,className:T(Q.recurDate,R6.timeInput),value:e.end,onChange:e=>{o(e.target.value)}}),(0,D.jsx)(`button`,{type:`button`,className:Q.slotActionBtn,onClick:s,children:(0,D.jsx)(Pr,{size:14})}),i&&(0,D.jsx)(`button`,{type:`button`,className:Q.slotActionBtnTrash,onClick:c,children:(0,D.jsx)(ni,{size:12})})]}),W6=({dayMeta:e,dayName:t,slots:n,startIso:r,endIso:i,onChangeSlots:a})=>{let o=n.length>0?n:[{start:s6(r),end:s6(i??r)}];return(0,D.jsx)(`div`,{className:Q.differentTimeRowGroup,children:o.map((n,r)=>(0,D.jsx)(U6,{slot:n,index:r,dayMeta:e,dayName:t,showTrash:o.length>1,onUpdateStart:e=>{let t=[...o];t[r]={...n,start:e},a(t)},onUpdateEnd:e=>{let t=[...o];t[r]={...n,end:e},a(t)},onAdd:()=>{let e=o[o.length-1];a([...o,H6(e)])},onRemove:()=>{a(o.filter((e,t)=>t!==r))}},r))})},G6=({rec:e,onChange:t,startIso:n,endIso:r})=>e.weekdays.length===0?(0,D.jsx)(D.Fragment,{}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`label`,{className:Q.differentTimeRow,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:e.differentTimes??!1,onChange:n=>{t({...e,differentTimes:n.target.checked})}}),(0,D.jsx)(`span`,{children:`Different time per day`})]}),e.differentTimes&&(0,D.jsxs)(`div`,{className:Q.differentTimeList,children:[e.weekdays.map(i=>{let a=z6.find(e=>e.wd===i);return(0,D.jsx)(W6,{dayMeta:a,dayName:a?a.longLabel:``,slots:e.weekdayTimes?.[i]??[],startIso:n,endIso:r,onChangeSlots:n=>{let r={...e.weekdayTimes,[i]:n};t({...e,weekdayTimes:r})}},i)}),(0,D.jsx)(`div`,{className:Q.differentTimeNote,children:`Defaults to the base event time when not overridden. Use + to add multiple slots per day.`})]})]}),K6=({recurrence:e,startIso:t,endIso:n})=>{let r=new Date(t),i=n===void 0?new Date(r.getTime()+1800*1e3):new Date(n),a=r,o=new Date(r.getTime()+2160*60*60*1e3),s=FO({start:t,end:i.toISOString(),recurrence:e},a,o),c=s.slice(0,5);return c.length===0?(0,D.jsx)(D.Fragment,{}):(0,D.jsxs)(`div`,{className:Q.upcomingCard,children:[(0,D.jsxs)(`div`,{className:Q.upcomingHeader,children:[(0,D.jsx)(Hn,{size:12}),` Upcoming Occurrences`]}),(0,D.jsx)(`div`,{children:c.map((e,t)=>{let n=new Date(e.start).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`}),r=`${i6(e.start)} – ${i6(e.end)}`;return(0,D.jsxs)(`div`,{className:Q.upcomingRow,children:[(0,D.jsx)(`span`,{className:Q.upcomingRowDate,children:n}),(0,D.jsx)(`span`,{className:Q.upcomingRowTime,children:r})]},t)})}),s.length>5&&(0,D.jsx)(`div`,{className:Q.upcomingMore,children:`...and more beyond`})]})},q6=[{wd:1,label:`M`},{wd:2,label:`T`},{wd:3,label:`W`},{wd:4,label:`T`},{wd:5,label:`F`},{wd:6,label:`S`},{wd:0,label:`S`}],J6={daily:`day`,weekly:`week`,monthly:`month`,yearly:`year`},Y6=[{id:`dayOfMonth`,label:`Day of month`},{id:`nthWeekday`,label:`Day of week`}],X6=({rec:e,onChange:t})=>(0,D.jsx)(`div`,{className:Q.recurChips,children:TO.map(n=>(0,D.jsx)(`button`,{type:`button`,className:T(Q.recurChip,e.freq===n.id&&Q.recurChipActive),"aria-pressed":e.freq===n.id,onClick:()=>{t({...e,freq:n.id})},children:n.label},n.id))}),Z6=({rec:e,onChange:t})=>(0,D.jsxs)(`label`,{className:Q.recurInline,children:[(0,D.jsx)(`span`,{className:Q.recurInlineLabel,children:`Every`}),(0,D.jsx)(`input`,{type:`number`,min:1,max:99,className:Q.recurNumber,value:e.interval,onChange:n=>{t({...e,interval:Math.max(1,Number(n.target.value)||1)})}}),(0,D.jsxs)(`span`,{className:Q.recurInlineLabel,children:[J6[e.freq],e.interval>1?`s`:``]})]}),Q6=({rec:e,onChange:t})=>(0,D.jsx)(`div`,{className:Q.recurWeekdays,children:q6.map(({wd:n,label:r})=>{let i=e.weekdays.includes(n);return(0,D.jsx)(`button`,{type:`button`,className:T(Q.recurDay,i&&Q.recurDayActive),"aria-pressed":i,onClick:()=>{t({...e,weekdays:i?e.weekdays.filter(e=>e!==n):[...e.weekdays,n]})},children:r},n)})}),$6=({rec:e,onChange:t})=>(0,D.jsx)(`div`,{className:Q.recurChips,children:Y6.map(n=>(0,D.jsx)(`button`,{type:`button`,className:T(Q.recurChip,e.monthlyMode===n.id&&Q.recurChipActive),onClick:()=>{t({...e,monthlyMode:n.id})},children:n.label},n.id))}),e8=({rec:e,startIso:t,onChange:n})=>(0,D.jsxs)(`div`,{className:Q.recurEnds,children:[(0,D.jsxs)(`label`,{className:Q.recurRadio,children:[(0,D.jsx)(`input`,{type:`radio`,name:`recur-end`,checked:e.endType===`never`,onChange:()=>{n({...e,endType:`never`})}}),(0,D.jsx)(`span`,{children:`Never ends`})]}),(0,D.jsxs)(`label`,{className:Q.recurRadio,children:[(0,D.jsx)(`input`,{type:`radio`,name:`recur-end`,checked:e.endType===`after`,onChange:()=>{n({...e,endType:`after`})}}),(0,D.jsx)(`span`,{children:`After`}),(0,D.jsx)(`input`,{type:`number`,min:1,max:365,className:Q.recurNumber,value:e.endCount,disabled:e.endType!==`after`,onChange:t=>{n({...e,endType:`after`,endCount:Math.max(1,Number(t.target.value)||1)})}}),(0,D.jsx)(`span`,{children:`times`})]}),(0,D.jsxs)(`label`,{className:Q.recurRadio,children:[(0,D.jsx)(`input`,{type:`radio`,name:`recur-end`,checked:e.endType===`on`,onChange:()=>{n({...e,endType:`on`})}}),(0,D.jsx)(`span`,{children:`On`}),(0,D.jsx)(`input`,{type:`date`,className:Q.recurDate,min:t.slice(0,10),value:e.endDate,disabled:e.endType!==`on`,onChange:t=>{n({...e,endType:`on`,endDate:t.target.value})}})]})]}),t8=({recurrence:e,startIso:t,endIso:n,onChange:r})=>{let i=e.freq===`weekly`,a=e.freq===`monthly`||e.freq===`yearly`;return(0,D.jsxs)(`div`,{className:Q.recurBuilder,children:[(0,D.jsx)(X6,{rec:e,onChange:r}),(0,D.jsx)(Z6,{rec:e,onChange:r}),i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Q6,{rec:e,onChange:r}),(0,D.jsx)(G6,{rec:e,onChange:r,startIso:t,endIso:n})]}),a&&(0,D.jsx)($6,{rec:e,onChange:r}),(0,D.jsx)(e8,{rec:e,startIso:t,onChange:r}),(0,D.jsx)(`div`,{className:Q.recurSummaryBox,children:BO(e,t)}),(0,D.jsx)(K6,{recurrence:e,startIso:t,endIso:n})]})},n8=({draft:e,onChange:t})=>(0,D.jsxs)(`div`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Status`}),(0,D.jsx)(`div`,{className:Q.statusPills,children:KO.map(n=>{let r=l6[n.id],i=e.status===n.id;return(0,D.jsxs)(`button`,{type:`button`,className:T(Q.statusPill,i&&Q.statusPillActive),style:E({"--status-color":r.color}),"aria-pressed":i,onClick:()=>{t({...e,status:n.id})},children:[(0,D.jsx)(r.Icon,{size:13}),` `,n.label]},n.id)})})]}),r8=({draft:e,onChange:t})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:e.allDay?L6.field:Q.dtGrid,children:[(0,D.jsxs)(`label`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Date`}),(0,D.jsx)(`input`,{type:`date`,className:Q.panelInput,value:o6(e.start),onChange:n=>{t(N6(e,n.target.value))}})]}),!e.allDay&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`label`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Start`}),(0,D.jsx)(pD,{value:s6(e.start),onChange:n=>{t(P6(e,n))}})]}),(0,D.jsxs)(`label`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`End`}),(0,D.jsx)(pD,{align:`end`,value:s6(e.end),onChange:n=>{t(F6(e,n))}})]})]})]}),(0,D.jsxs)(`label`,{className:Q.checkRow,children:[(0,D.jsx)(`input`,{type:`checkbox`,className:Q.checkbox,checked:e.allDay,onChange:n=>{t(I6(e,n.target.checked))}}),(0,D.jsx)(`span`,{children:`All-day`})]})]}),i8=({draft:e,onChange:t})=>{let n=e.recurrence!==null;return(0,D.jsxs)(`div`,{className:Q.recurSection,children:[(0,D.jsxs)(`button`,{type:`button`,className:T(Q.recurToggle,n&&Q.recurToggleOn),"aria-pressed":n,onClick:()=>{t(j6(e))},children:[(0,D.jsxs)(`span`,{className:Q.recurToggleLabel,children:[(0,D.jsx)(Vr,{size:13}),` Recurring`]}),(0,D.jsx)(`span`,{className:T(Q.recurSwitch,n&&Q.recurSwitchOn),children:(0,D.jsx)(`span`,{className:Q.recurKnob})})]}),e.recurrence!==null&&(0,D.jsx)(t8,{recurrence:e.recurrence,startIso:e.start,endIso:e.end,onChange:n=>{t(M6(e,n))}})]})},a8=({draft:e,onChange:t})=>(0,D.jsxs)(`div`,{className:Q.panelForm,children:[(0,D.jsxs)(`label`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Title`}),(0,D.jsx)(`input`,{type:`text`,className:T(Q.panelInput,e.title.length>200&&Q.inputError),value:e.title,placeholder:`e.g. Morning availability`,onChange:n=>{t({...e,title:n.target.value})}}),e.title.length>200&&(0,D.jsx)(`span`,{className:Q.fieldError,children:`The field Title must be a string with a maximum length of 200.`})]}),(0,D.jsx)(n8,{draft:e,onChange:t}),(0,D.jsx)(r8,{draft:e,onChange:t}),(0,D.jsx)(i8,{draft:e,onChange:t}),(0,D.jsxs)(`label`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Notes`}),(0,D.jsx)(`textarea`,{className:Q.notesInput,rows:3,value:e.notes,placeholder:`Optional notes`,onChange:n=>{t({...e,notes:n.target.value})}})]})]}),o8=(e,t,n,r)=>{let i=new Date(e).getTime(),a=new Date(t).getTime(),o=new Date(n).getTime(),s=new Date(r).getTime();return i<=o&&a>=s?{type:`delete`}:i>o&&a<s?{type:`split`,updateEnd:new Date(i).toISOString(),createStart:new Date(a).toISOString(),createEnd:new Date(s).toISOString()}:i<=o&&a>o&&a<s?{type:`update`,start:new Date(a).toISOString(),end:r}:i>o&&i<s&&a>=s?{type:`update`,start:n,end:new Date(i).toISOString()}:null},s8=(e,t)=>{let n=new Date(e.start).getTime(),r=new Date(e.end).getTime(),i=new Date(t.start).getTime();return n<new Date(t.end).getTime()&&r>i},c8=(e,t)=>{let n=e.block.status===`available`&&t.block.status===`available`,r=e.block.status!==`available`&&t.block.status!==`available`;return(n||r)&&s8(e,t)},l8=(e,t,n)=>{let r=ek([new VO({id:`draft`,...e})],n),i=ek(t,n),a=[];for(let e of i)r.some(t=>c8(t,e))&&a.push(e);return a},u8=e=>({userId:e.userId,title:e.title,status:e.status,start:e.start,end:e.end,allDay:e.allDay,notes:e.notes,recurrence:e.recurrence}),d8=(e,t,n)=>({...u8(e),start:t,end:n,recurrence:null}),f8=(e,t)=>{let n=e.recurrence;if(n===null)return u8(e);let r=Array.from(new Set([...n.exceptions,...t]));return{...u8(e),recurrence:{...n,exceptions:r}}},p8=(e,t,n)=>n.type===`delete`?[]:n.type===`update`?[d8(e,n.start,n.end)]:[d8(e,t.start,n.updateEnd),d8(e,n.createStart,n.createEnd)],m8=(e,t,n)=>{let r=o8(n.start,n.end,t.start,t.end);return r===null?[]:r.type===`delete`?[{kind:`delete`,blockId:e.id}]:r.type===`update`?[{kind:`update`,blockId:e.id,draft:d8(e,r.start,r.end)}]:[{kind:`update`,blockId:e.id,draft:d8(e,t.start,r.updateEnd)},{kind:`create`,draft:d8(e,r.createStart,r.createEnd)}]},h8=(e,t,n)=>{let r=[],i=[];for(let a of t){let t=o8(n.start,n.end,a.start,a.end);if(t!==null){r.push(a.date);for(let n of p8(e,a,t))i.push({kind:`create`,draft:n})}}return r.length===0?[]:[{kind:`update`,blockId:e.id,draft:f8(e,r)},...i]},g8=(e,t)=>{let n=new Map;for(let e of t){let t=n.get(e.block.id)??[];t.push(e),n.set(e.block.id,t)}let r=[];for(let t of n.values()){let n=t[0];if(n===void 0)continue;let i=n.block.recurrence===null?m8(n.block,n,e):h8(n.block,t,e);r.push(...i)}return r},_8=(e,t)=>e.filter(e=>t.mode!==`edit`||e.id!==t.block.id),v8=(e,t,n)=>{let r=new Map;for(let i of l8(e,t,n))r.set(i.block.id,i.block);return[...r.values()]},y8=300*1e3,b8=(e,t,n,r)=>{if(!(n.mode!==`edit`||t.start!==k6({...e,start:n.block.start,end:n.block.end},r).start)||new Date(t.start).getTime()>=Date.now()-y8)return null;let i=new Date(t.end).getTime();return e.allDay&&i>Date.now()?`All-day events cannot be scheduled for today as part of the day has passed. Please uncheck 'All-day' to select a specific time.`:`Cannot schedule an event in the past.`},x8=(e,t)=>{if(t.length===0)return null;let n=t[0];if(n===void 0)return null;let r=t.some(e=>e.status===`meeting`);return e===`available`&&n.status===`available`?{error:`This block overlaps with an existing availability.`,code:`overlap_availability`,hasMeetingConflict:r}:{error:r?`This block overlaps with a scheduled Meeting. Meetings cannot be auto-adjusted or overwritten.`:`This block overlaps with an existing event.`,code:`overlap_event`,hasMeetingConflict:r}},S8=(e,t,n,r)=>{if(e.title.trim().length===0)return{error:`Event title is required.`,code:`empty_title`};if(e.title.length>200)return{error:`The field Title must be a string with a maximum length of 200.`,code:`title_too_long`};if(!oO(e.start,e.end))return{error:`End time must be after start time.`,code:`invalid_time`};let i=k6(e,r),a=b8(e,i,n,r);if(a!==null)return{error:a,code:`invalid_time`};let o=X3(new Date(i.start),0),s=v8(i,_8(t,n),o);return x8(e.status,s)??{error:null}},C8=(e,t,n)=>{let r=PN(),i=FN(),a=IN(),o=async e=>{if(e.kind===`delete`){await a.mutateAsync(e.blockId);return}if(e.kind===`update`){await i.mutateAsync({id:e.blockId,draft:e.draft});return}await r.mutateAsync(e.draft)};return{resolve:async(r,i)=>{let a=k6(e,n),s=X3(new Date(a.start),0),c=g8(a,l8(a,_8(r,t),s));try{await Promise.all(c.map(o)),j.success(`Conflicts resolved successfully!`),i()}catch(e){let t=e instanceof Error?e.message:String(e);j.error(`Failed to resolve conflicts: ${t}`)}}}},w8={errorStack:`_errorStack_q9qoj_4`,errorLine:`_errorLine_q9qoj_11`},T8=` · `,E8=` – `,D8=e=>{let t=cO(e.start)===cO(e.end)?a6(e.start):`${a6(e.start)}${E8}${a6(e.end)}`,n=e.recurrence===null?``:`${T8}${BO(e.recurrence,e.start)}`;return e.allDay?`${t}${T8}All day${n}`:e.recurrence?.differentTimes?`${t}${n}`:`${t}${T8}${`${i6(e.start)}${E8}${i6(e.end)}`}${T8}${r6(aO(e.start,e.end))}${n}`},O8=({isEdit:e,busy:t,canSave:n,validationError:r,isConflict:i,summary:a,onSave:o,onDelete:s,onCancel:c,onResolveConflicts:l})=>(0,D.jsxs)(`div`,{className:Q.panelFooter,children:[(0,D.jsx)(`div`,{className:T(Q.panelSummary,r!==null&&Q.panelSummaryError),children:r===null?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Bn,{size:14}),` `,a]}):(0,D.jsxs)(`div`,{className:w8.errorStack,children:[(0,D.jsxs)(`span`,{className:w8.errorLine,children:[(0,D.jsx)(Yn,{size:14}),` `,r]}),i&&(0,D.jsxs)(`button`,{type:`button`,className:Q.resolveConflictBtn,onClick:l,disabled:t,children:[(0,D.jsx)(Lr,{size:11}),` Auto-adjust blocks to fit`]})]})}),(0,D.jsxs)(`div`,{className:Q.panelActions,children:[e&&(0,D.jsxs)(vi,{variant:`ghost`,onClick:s,disabled:t,children:[(0,D.jsx)(ni,{size:15}),` Delete`]}),(0,D.jsx)(`span`,{className:Q.actionSpacer}),(0,D.jsx)(vi,{variant:`secondary`,onClick:c,disabled:t,children:`Cancel`}),n?(0,D.jsx)(vi,{onClick:o,isLoading:t,children:e?`Save changes`:`Create`}):(0,D.jsx)(DE,{label:r??`Cannot save`,side:`top`,children:(0,D.jsx)(`span`,{className:Q.disabledButtonWrapper,children:(0,D.jsx)(vi,{onClick:o,isLoading:t,disabled:!0,children:e?`Save changes`:`Create`})})})]})]}),k8=(e,t,n,r)=>{let i=PN(),a=FN(),o=IN();return{busy:i.isPending||a.isPending||o.isPending,onSave:()=>{let o=k6(t,n),s=e=>{j.success(e),r()};if(e.mode===`edit`){a.mutate({id:e.block.id,draft:o},{onSuccess:()=>{s(`Event updated`)},onError:e=>{j.error(e.message)}});return}i.mutate(o,{onSuccess:()=>{s(`Event added`)},onError:e=>{j.error(e.message)}})},onDelete:()=>{e.mode===`edit`&&o.mutate(e.block.id,{onSuccess:()=>{j.success(`Event removed`),r()},onError:e=>{j.error(e.message)}})}}},A8=({state:e,timezone:t,onClose:r})=>{let[i,a]=(0,n.useState)(()=>A6(e)),{busy:o,onSave:s,onDelete:c}=k8(e,i,t,r),{data:l=[]}=NN(),u=C8(i,e,t),d=e.mode===`edit`,f=S8(i,l,e,t),p=f.code===`title_too_long`?null:f.error,m=f.error===null,h=(f.code===`overlap_availability`||f.code===`overlap_event`)&&!f.hasMeetingConflict;return(0,D.jsxs)(Xy,{open:!0,side:`right`,title:d?`Edit Event`:`New Event`,onOpenChange:e=>{e||r()},footer:(0,D.jsx)(O8,{isEdit:d,busy:o,canSave:m,validationError:p,isConflict:h,summary:D8(i),onSave:s,onDelete:c,onCancel:r,onResolveConflicts:()=>{u.resolve(l,s)}}),children:[(0,D.jsxs)(`header`,{className:Q.panelHead,children:[(0,D.jsx)(`span`,{className:Q.panelTitle,children:d?`Edit Event`:`New Event`}),(0,D.jsx)(Ei,{label:`Close`,onClick:r,children:(0,D.jsx)(ci,{size:18})})]}),(0,D.jsx)(a8,{draft:i,onChange:a})]})},j8=()=>{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):GO},M8=/^(\d{1,2}):(\d{2})$/,N8=e=>String(e).padStart(2,`0`),P8=e=>{let t=M8.exec(e);return t===null?0:Number(t[1])*60+Number(t[2])},F8=e=>{let t=Math.max(0,Math.min(1439,e)),n=Math.floor(t/60),r=t%60;return`${N8(n)}:${N8(r)}`},I8=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],L8=e=>I8[(e+6)%7]??`sun`,R8=e=>I8[(e+1)%7]??`mon`,z8=e=>I8[e]??`mon`,B8=(e,t,n)=>{if(e>=0)return null;let r=e+1440,i=Math.min(0,t)+1440;return i<=r?null:{targetDay:L8(n),from:r,to:i,id:crypto.randomUUID()}},V8=(e,t,n)=>{if(t<=1440)return null;let r=Math.max(1440,e)-1440,i=t-1440;return i<=r?null:{targetDay:R8(n),from:r,to:i,id:crypto.randomUUID()}},H8=(e,t,n,r)=>{let i=Math.max(0,e),a=Math.min(1440,t);return a<=i?null:{targetDay:z8(n),from:i,to:a,id:r}},U8=(e,t,n)=>{let r=P8(e.from),i=e.to===`23:59`||e.to===`24:00`||e.to===`00:00`?1440:P8(e.to);if(i<=r)return[];let a=r+n,o=i+n;return[B8(a,o,t),H8(a,o,t,e.id),V8(a,o,t)].filter(e=>e!==null)},W8=(e,t,n)=>{e.sort((e,t)=>e.from-t.from);let r=[];for(let t of e){let e=r[r.length-1];e!==void 0&&t.from<=e.to+1?e.to=Math.max(e.to,t.to):r.push({...t})}let i=r.map(e=>({id:e.id,from:F8(e.from),to:e.to>=1440?`23:59`:F8(e.to)}));return{active:i.length>0&&t,slots:i.length>0?i:n.map(e=>({...e}))}},G8=(e,t,n,r)=>{if(t===n)return e;let i=HN(n,r)-HN(t,r);if(i===0)return e;let a={mon:[],tue:[],wed:[],thu:[],fri:[],sat:[],sun:[]},o={mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1};return qD.forEach((t,n)=>{let r=e[t.id];r.active&&r.slots.length>0&&r.slots.forEach(e=>{U8(e,n,i).forEach(e=>{a[e.targetDay].push({from:e.from,to:e.to,id:e.id}),o[e.targetDay]=!0})})}),{mon:W8(a.mon,o.mon,e.mon.slots),tue:W8(a.tue,o.tue,e.tue.slots),wed:W8(a.wed,o.wed,e.wed.slots),thu:W8(a.thu,o.thu,e.thu.slots),fri:W8(a.fri,o.fri,e.fri.slots),sat:W8(a.sat,o.sat,e.sat.slots),sun:W8(a.sun,o.sun,e.sun.slots)}},K8=(e,t)=>{let n=j8();return(n.includes(t)?n:[t,...n]).map(t=>({id:t,offset:GN(HN(t,e))}))},q8={tzWrap:`_tzWrap_horpb_4`,tzTrigger:`_tzTrigger_horpb_8`,tzGlobe:`_tzGlobe_horpb_30`,tzTriggerLabel:`_tzTriggerLabel_horpb_35`,tzTriggerOffset:`_tzTriggerOffset_horpb_44`,tzChevron:`_tzChevron_horpb_51`,tzBackdrop:`_tzBackdrop_horpb_56`,tzPop:`_tzPop_horpb_65`,tzSearch:`_tzSearch_horpb_78`,tzSearchInput:`_tzSearchInput_horpb_90`,tzList:`_tzList_horpb_100`,tzRow:`_tzRow_horpb_135`,tzRowActive:`_tzRowActive_horpb_154`,tzRowLabel:`_tzRowLabel_horpb_158`,tzRowOffset:`_tzRowOffset_horpb_171`,tzCheck:`_tzCheck_horpb_178`,tzEmpty:`_tzEmpty_horpb_183`},J8=(e,t)=>t===``||e.id.toLowerCase().includes(t)||e.offset.toLowerCase().includes(t),Y8=({search:e,list:t,value:n,onSearch:r,onPick:i})=>(0,D.jsxs)(A.div,{className:q8.tzPop,variants:Hy,initial:`hidden`,animate:`visible`,exit:`exit`,children:[(0,D.jsxs)(`div`,{className:q8.tzSearch,children:[(0,D.jsx)(Hr,{size:13}),(0,D.jsx)(`input`,{className:q8.tzSearchInput,placeholder:`Search timezones…`,value:e,onChange:e=>{r(e.target.value)}})]}),(0,D.jsxs)(`div`,{className:q8.tzList,children:[t.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:T(q8.tzRow,e.id===n&&q8.tzRowActive),onClick:()=>{i(e.id)},children:[(0,D.jsx)(`span`,{className:q8.tzRowLabel,children:e.id}),(0,D.jsx)(`span`,{className:q8.tzRowOffset,children:e.offset}),e.id===n&&(0,D.jsx)(Wn,{size:13,className:q8.tzCheck})]},e.id)),t.length===0&&(0,D.jsx)(`p`,{className:q8.tzEmpty,children:`No timezones match.`})]})]}),X8=({value:e,now:t,onChange:r})=>{let[i,a]=(0,n.useState)(!1),[o,s]=(0,n.useState)(``),c=(0,n.useMemo)(()=>K8(t,e),[t,e]),l=c.find(t=>t.id===e)??{id:e,offset:``},u=o.trim().toLowerCase(),d=c.filter(e=>J8(e,u));return(0,D.jsxs)(`div`,{className:q8.tzWrap,children:[(0,D.jsxs)(`button`,{type:`button`,className:q8.tzTrigger,"aria-expanded":i,"aria-label":`Change timezone`,onClick:()=>{a(e=>!e)},children:[(0,D.jsx)(lr,{size:14,className:q8.tzGlobe}),(0,D.jsx)(`span`,{className:q8.tzTriggerLabel,children:l.id}),(0,D.jsx)(`span`,{className:q8.tzTriggerOffset,children:l.offset}),(0,D.jsx)(Gn,{size:15,className:q8.tzChevron})]}),(0,D.jsx)(Kg,{children:i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:q8.tzBackdrop,"aria-label":`Close timezone picker`,onClick:()=>{a(!1)}}),(0,D.jsx)(Y8,{search:o,list:d,value:e,onSearch:s,onPick:e=>{r(e),s(``),a(!1)}})]})})]})},$={gridScroll:`_gridScroll_1vnsd_7`,gridInner:`_gridInner_1vnsd_33`,gutter:`_gutter_1vnsd_38`,gutterHead:`_gutterHead_1vnsd_44`,gutterAllDay:`_gutterAllDay_1vnsd_48`,gutterHour:`_gutterHour_1vnsd_62`,dayCol:`_dayCol_1vnsd_73`,dayHeader:`_dayHeader_1vnsd_79`,colDay:`_colDay_1vnsd_93`,colDayToday:`_colDayToday_1vnsd_101`,dayNum:`_dayNum_1vnsd_105`,dayNumToday:`_dayNumToday_1vnsd_125`,dayCount:`_dayCount_1vnsd_131`,allDayBand:`_allDayBand_1vnsd_137`,allDayChip:`_allDayChip_1vnsd_148`,hoursWrap:`_hoursWrap_1vnsd_168`,workBand:`_workBand_1vnsd_174`,hourRow:`_hourRow_1vnsd_184`,nowLine:`_nowLine_1vnsd_203`,nowDot:`_nowDot_1vnsd_214`,block:`_block_1vnsd_224`,blockTitle:`_blockTitle_1vnsd_261`,blockTime:`_blockTime_1vnsd_279`,monthScroll:`_monthScroll_1vnsd_293`,monthHead:`_monthHead_1vnsd_302`,monthHeadCell:`_monthHeadCell_1vnsd_309`,monthGrid:`_monthGrid_1vnsd_319`,monthCell:`_monthCell_1vnsd_326`,monthCellOff:`_monthCellOff_1vnsd_347`,monthDayNum:`_monthDayNum_1vnsd_351`,monthCellToday:`_monthCellToday_1vnsd_355`,monthDayNumToday:`_monthDayNumToday_1vnsd_366`,monthChip:`_monthChip_1vnsd_379`,monthMore:`_monthMore_1vnsd_402`,agendaScroll:`_agendaScroll_1vnsd_410`,agendaGroup:`_agendaGroup_1vnsd_418`,agendaDay:`_agendaDay_1vnsd_422`,agendaItems:`_agendaItems_1vnsd_432`,agendaRow:`_agendaRow_1vnsd_438`,agendaAccent:`_agendaAccent_1vnsd_459`,agendaBody:`_agendaBody_1vnsd_467`,agendaTitle:`_agendaTitle_1vnsd_475`,agendaMeta:`_agendaMeta_1vnsd_484`,agendaPill:`_agendaPill_1vnsd_493`,agendaEmpty:`_agendaEmpty_1vnsd_506`,agendaEmptyIcon:`_agendaEmptyIcon_1vnsd_517`,agendaEmptyTitle:`_agendaEmptyTitle_1vnsd_522`,agendaEmptyText:`_agendaEmptyText_1vnsd_528`,agendaEmptyBtn:`_agendaEmptyBtn_1vnsd_533`,availabilityBand:`_availabilityBand_1vnsd_546`,availabilityBandLabel:`_availabilityBandLabel_1vnsd_579`,availabilityBandEditBtn:`_availabilityBandEditBtn_1vnsd_589`,dragSelectionHighlight:`_dragSelectionHighlight_1vnsd_612`,dragSelectionLabel:`_dragSelectionLabel_1vnsd_631`},Z8={hidden:{},visible:{transition:{staggerChildren:.04}}},Q8=e=>{let t=[...e].sort((e,t)=>e.start<t.start?-1:1),n=new Map;for(let e of t){let t=n.get(e.date);t===void 0?n.set(e.date,{key:e.date,label:new Date(e.start).toLocaleDateString(void 0,{weekday:`long`,day:`numeric`,month:`long`}),items:[e]}):t.items.push(e)}return[...n.values()]},$8=({occurrence:e,onSelect:t})=>{let{block:n}=e,r=l6[n.status],i=n.allDay?`All day`:`${i6(e.start)} – ${i6(e.end)}`;return(0,D.jsxs)(A.button,{type:`button`,variants:Vy,whileHover:{x:3},className:$.agendaRow,style:E({"--status-color":r.color}),onClick:()=>{t(n)},children:[(0,D.jsx)(`span`,{className:$.agendaAccent}),(0,D.jsxs)(`span`,{className:$.agendaBody,children:[(0,D.jsx)(`span`,{className:$.agendaTitle,children:n.title}),(0,D.jsxs)(`span`,{className:$.agendaMeta,children:[i,n.recurrence!==null&&(0,D.jsxs)(D.Fragment,{children:[` · `,(0,D.jsx)(zr,{size:10}),` Recurring`]})]})]}),(0,D.jsxs)(`span`,{className:$.agendaPill,children:[(0,D.jsx)(r.Icon,{size:10}),` `,r.label]})]})},e5=({occurrences:e,onSelectBlock:t,onCreate:n})=>{let r=Q8(e);return r.length===0?(0,D.jsxs)(`div`,{className:$.agendaEmpty,children:[(0,D.jsx)(`span`,{className:$.agendaEmptyIcon,children:(0,D.jsx)(Vn,{size:30})}),(0,D.jsx)(`span`,{className:$.agendaEmptyTitle,children:`Nothing scheduled this month`}),(0,D.jsx)(`span`,{className:$.agendaEmptyText,children:`Create a block to fill your week.`}),(0,D.jsx)(`button`,{type:`button`,className:$.agendaEmptyBtn,onClick:n,children:`Create New Event`})]}):(0,D.jsx)(`div`,{className:$.agendaScroll,children:r.map(e=>(0,D.jsxs)(`div`,{className:$.agendaGroup,children:[(0,D.jsx)(`div`,{className:$.agendaDay,children:e.label}),(0,D.jsx)(A.div,{className:$.agendaItems,variants:Z8,initial:`hidden`,animate:`visible`,children:e.items.map(e=>(0,D.jsx)($8,{occurrence:e,onSelect:t},e.key))})]},e.key))})},t5=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],n5=3,r5=e=>{let t=new Map;for(let n of e){let e=t.get(n.date)??[];e.push(n),t.set(n.date,e)}for(let e of t.values())e.sort((e,t)=>e.start<t.start?-1:1);return t},i5=e=>{let{date:t,inMonth:n,isToday:r,occs:i}=e,a=i.length-n5;return(0,D.jsxs)(`div`,{className:T($.monthCell,!n&&$.monthCellOff,r&&$.monthCellToday),onClick:()=>{e.onSelectSlot(c6(cO(t),`09:00`))},children:[(0,D.jsx)(`span`,{className:T($.monthDayNum,r&&$.monthDayNumToday),children:t.getDate()}),i.slice(0,n5).map(t=>(0,D.jsx)(`button`,{type:`button`,className:$.monthChip,style:E({"--status-color":l6[t.block.status].color}),onClick:n=>{n.stopPropagation(),e.onSelectBlock(t.block)},children:t.block.title},t.key)),a>0&&(0,D.jsxs)(`span`,{className:$.monthMore,children:[`+`,a,` more`]})]})},a5=({dates:e,anchor:t,occurrences:n,today:r,onSelectBlock:i,onSelectSlot:a})=>{let o=r5(n),s=cO(r);return(0,D.jsxs)(`div`,{className:$.monthScroll,children:[(0,D.jsx)(`div`,{className:$.monthHead,children:t5.map(e=>(0,D.jsx)(`span`,{className:$.monthHeadCell,children:e},e))}),(0,D.jsx)(A.div,{className:$.monthGrid,initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.22,1,.36,1]},children:e.map(e=>{let n=cO(e);return(0,D.jsx)(i5,{date:e,inMonth:e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),isToday:n===s,occs:o.get(n)??[],onSelectBlock:i,onSelectSlot:a},n)})})]})},o5={sidebar:`_sidebar_p4iov_4`,summaryGrid:`_summaryGrid_p4iov_36`,summaryCard:`_summaryCard_p4iov_42`,summaryTop:`_summaryTop_p4iov_54`,summaryTopIcon:`_summaryTopIcon_p4iov_60`,summaryValue:`_summaryValue_p4iov_65`,summaryLabel:`_summaryLabel_p4iov_73`,sideHeader:`_sideHeader_p4iov_82`,quickRow:`_quickRow_p4iov_92`,quickBtn:`_quickBtn_p4iov_97`,legendIcon:`_legendIcon_p4iov_118`,legend:`_legend_p4iov_118`,legendItem:`_legendItem_p4iov_129`,legendItemOn:`_legendItemOn_p4iov_151`,legendOff:`_legendOff_p4iov_156`,legendSwatch:`_legendSwatch_p4iov_160`,legendSwatchOff:`_legendSwatchOff_p4iov_172`,drawerHeader:`_drawerHeader_p4iov_177`,drawerTitle:`_drawerTitle_p4iov_185`,drawerCloseBtn:`_drawerCloseBtn_p4iov_191`},s5={hidden:{},visible:{transition:{staggerChildren:.05}}},c5=({occurrences:e,today:t,availability:n})=>{let r=YO(e,t),i=qD[(t.getDay()+6)%7]?.id??`mon`,a=n?.[i],o=a?.active?a.slots:[],s=[{label:`Free`,value:`${String(T6(e,t,o))}h`,color:`var(--color-primary)`,Icon:Qn},{label:`Busy`,value:`${String(r.busyHours)}h`,color:l6.busy.color,Icon:l6.busy.Icon},{label:`Meetings`,value:String(r.meetingCount),color:l6.meeting.color,Icon:l6.meeting.Icon},{label:`Focus`,value:`${String(r.focusHours)}h`,color:l6.focus.color,Icon:l6.focus.Icon}];return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:o5.sideHeader,children:`Today`}),(0,D.jsx)(A.div,{className:o5.summaryGrid,variants:s5,initial:`hidden`,animate:`visible`,children:s.map(e=>(0,D.jsxs)(A.div,{className:o5.summaryCard,style:E({"--v":e.color}),variants:Vy,whileHover:{y:-2},children:[(0,D.jsxs)(`span`,{className:o5.summaryTop,children:[(0,D.jsx)(e.Icon,{size:12,strokeWidth:2.4,className:o5.summaryTopIcon}),(0,D.jsx)(`span`,{className:o5.summaryLabel,children:e.label})]}),(0,D.jsx)(`span`,{className:o5.summaryValue,children:e.value})]},e.label))})]})},l5=({onQuickAdd:e})=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:o5.sideHeader,children:`Quick add`}),(0,D.jsx)(`div`,{className:o5.quickRow,children:[{status:`focus`,minutes:60,title:`Deep work`,label:`Focus 1h`},{status:`busy`,minutes:30,title:`Busy`,label:`Busy 30m`}].map(t=>{let n=l6[t.status];return(0,D.jsxs)(A.button,{type:`button`,whileTap:{scale:.96},className:o5.quickBtn,style:E({"--status-color":n.color}),onClick:()=>{e(t.status,t.minutes,t.title)},children:[(0,D.jsx)(n.Icon,{size:11}),` `,t.label]},t.label)})})]}),u5=({activeStatuses:e,onToggleStatus:t})=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:o5.sideHeader,children:`Status legend`}),(0,D.jsx)(`div`,{className:o5.legend,children:KO.map(n=>{let r=l6[n.id],i=e.has(n.id);return(0,D.jsxs)(A.button,{type:`button`,whileTap:{scale:.97},className:T(o5.legendItem,i?o5.legendItemOn:o5.legendOff),style:E({"--status-color":r.color}),onClick:()=>{t(n.id)},children:[(0,D.jsx)(`span`,{className:T(o5.legendSwatch,!i&&o5.legendSwatchOff),children:(0,D.jsx)(Kg,{children:i&&(0,D.jsx)(A.span,{initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:`spring`,stiffness:500,damping:28},children:(0,D.jsx)(Wn,{size:11,strokeWidth:3})})})}),(0,D.jsx)(r.Icon,{size:12,className:o5.legendIcon}),n.label]},n.id)})})]}),d5=e=>(0,D.jsxs)(`aside`,{className:o5.sidebar,children:[e.onClose!==void 0&&(0,D.jsxs)(`div`,{className:o5.drawerHeader,children:[(0,D.jsx)(`span`,{className:o5.drawerTitle,children:`Schedule Settings`}),(0,D.jsx)(`button`,{type:`button`,className:o5.drawerCloseBtn,onClick:e.onClose,"aria-label":`Close schedule settings`,children:(0,D.jsx)(ci,{size:16})})]}),(0,D.jsx)(c5,{occurrences:e.occurrences,today:e.today,availability:e.availability}),(0,D.jsx)(l5,{onQuickAdd:e.onQuickAdd}),(0,D.jsx)(u5,{activeStatuses:e.activeStatuses,onToggleStatus:e.onToggleStatus})]}),f5=(e,t,n,r)=>{let i=Math.min(e,t),a=Math.max(e,t);if(e===t){let e=r-1;return{firstDayIdx:i,lastDayIdx:a,startHour:Math.min(n,e),endHour:Math.max(n,e)+1}}return e>t?{firstDayIdx:i,lastDayIdx:a,startHour:r-1,endHour:n}:{firstDayIdx:i,lastDayIdx:a,startHour:n,endHour:r}},p5=({item:e,range:t,onSelect:n})=>{let{occurrence:r}=e,{block:i}=r,a=l6[i.status],o=g6(r.start,r.end,t),s=r.continuesFromPrevDay===!0,c=r.continuesToNextDay===!0,l=s?`Continued from the previous day`:c?`Continues into the next day`:void 0;return(0,D.jsxs)(A.button,{type:`button`,draggable:!0,title:l,onDragStartCapture:e=>{e.dataTransfer.setData(`text/plain`,i.id)},initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},transition:{duration:.18,ease:[.22,1,.36,1]},className:$.block,style:{...E({"--status-color":a.color,"--top":`${String(o.top)}px`,"--h":`${String(o.height)}px`,"--lane":e.lane,"--lanes":e.lanes}),...s?{borderTopLeftRadius:0,borderTopRightRadius:0}:{},...c?{borderBottomLeftRadius:0,borderBottomRightRadius:0}:{}},onClick:()=>{n(i)},children:[(0,D.jsxs)(`span`,{className:$.blockTitle,children:[s&&(0,D.jsx)(Jn,{size:10,"aria-hidden":!0}),` `,(0,D.jsx)(a.Icon,{size:10}),` `,i.title]}),o.height>=30&&(0,D.jsxs)(`span`,{className:$.blockTime,children:[i6(r.start),` – `,i6(r.end),c&&(0,D.jsx)(Gn,{size:10,"aria-hidden":!0})]})]})},m5=({occurrence:e,onSelect:t})=>{let{block:n}=e,r=l6[n.status];return(0,D.jsxs)(`button`,{type:`button`,className:$.allDayChip,style:E({"--status-color":r.color}),onClick:()=>{t(n)},children:[(0,D.jsx)(r.Icon,{size:10}),` `,n.title]})},h5=e=>`${String(e).padStart(2,`0`)}:00`,g5=({bands:e,range:t,onSelectSlot:n,onSelectBlock:r})=>(0,D.jsx)(D.Fragment,{children:e.map(e=>{let i=e.block.allDay&&e.continuesFromPrevDay!==!0&&e.continuesToNextDay!==!0?{top:0,height:h6(t)}:g6(e.start,e.end,t);return(0,D.jsxs)(`div`,{className:$.availabilityBand,style:E({"--top":`${String(i.top)}px`,"--h":`${String(i.height)}px`}),onClick:()=>{n(e.start,e.end)},children:[(0,D.jsxs)(`span`,{className:$.availabilityBandLabel,children:[(0,D.jsx)(Wn,{size:11,strokeWidth:3}),` Available`]}),(0,D.jsx)(`button`,{type:`button`,className:$.availabilityBandEditBtn,onClick:t=>{t.stopPropagation(),r(e.block)},children:`Edit`})]},e.key)})}),_5=({day:e,cell:t,dayIndex:n,range:r,onDragSelectStart:i,onDragSelectEnter:a,onDropBlock:o,onSelectSlot:s})=>(0,D.jsx)(D.Fragment,{children:m6(r).map(r=>(0,D.jsx)(`button`,{type:`button`,className:$.hourRow,"aria-label":`Add a block on ${e.long} at ${u6(r)}`,onMouseDown:e=>{e.button===0&&(e.preventDefault(),i(n,r))},onMouseEnter:e=>{a(n,r,e.buttons)},onDragOver:e=>{e.preventDefault()},onDrop:e=>{let n=e.dataTransfer.getData(`text/plain`);n&&o(n,c6(cO(t.date),h5(r)))},onClick:()=>{s(c6(cO(t.date),h5(r)))}},r))}),v5=e=>e===0?``:e===1?`1 event`:`${String(e)} events`,y5=({day:e,cell:t,count:n,off:r})=>(0,D.jsxs)(`div`,{className:$.dayHeader,children:[(0,D.jsx)(`span`,{className:T($.colDay,t.isToday&&$.colDayToday),children:e.short}),(0,D.jsx)(`span`,{className:T($.dayNum,t.isToday&&$.dayNumToday),children:t.dayNumber}),(0,D.jsx)(`span`,{className:$.dayCount,children:r?`Day off`:v5(n)})]}),b5=({allDay:e,onSelectBlock:t})=>(0,D.jsx)(`div`,{className:$.allDayBand,children:e.map(e=>(0,D.jsx)(m5,{occurrence:e,onSelect:t},e.key))}),x5=({dayIndex:e,dragSelect:t,rangeStartHour:n})=>t===null||e<Math.min(t.startDayIndex,t.endDayIndex)||e>Math.max(t.startDayIndex,t.endDayIndex)?null:(0,D.jsx)(`div`,{className:$.dragSelectionHighlight,style:E({"--top":`${String((Math.min(t.startHour,t.endHour-1)-n)*52)}px`,"--h":`${String(Math.abs(t.endHour-t.startHour)*52)}px`}),children:(0,D.jsxs)(`span`,{className:$.dragSelectionLabel,children:[u6(Math.min(t.startHour,t.endHour)),` –`,` `,u6(Math.max(t.startHour,t.endHour))]})}),S5=(e,t)=>{let n=e.filter(e=>e.dayIndex===t);return{dayOccs:n,allDay:n.filter(e=>e.block.allDay&&e.block.status!==`available`),availabilityBands:n.filter(e=>e.block.status===`available`),laid:S6(n.filter(e=>!e.block.allDay&&e.block.status!==`available`))}},C5=({active:e,slots:t,range:n,cell:r,day:i,dayIndex:a,now:o,availabilityBands:s,laid:c,dragSelect:l,onDragSelectStart:u,onDragSelectEnter:d,onDropBlock:f,onSelectSlot:p,onSelectBlock:m})=>{let h=v6(e,t,n),g=r.isToday?y6(o,n):null;return(0,D.jsxs)(`div`,{className:$.hoursWrap,style:E({"--grid-h":`${String(h6(n))}px`}),children:[h.map(e=>(0,D.jsx)(`div`,{className:$.workBand,style:E({"--top":`${String(e.top)}px`,"--h":`${String(e.height)}px`})},e.top)),(0,D.jsx)(g5,{bands:s,range:n,onSelectSlot:p,onSelectBlock:m}),(0,D.jsx)(_5,{day:i,cell:r,dayIndex:a,range:n,onDragSelectStart:u,onDragSelectEnter:d,onDropBlock:f,onSelectSlot:p}),(0,D.jsx)(x5,{dayIndex:a,dragSelect:l,rangeStartHour:n.startHour}),g!==null&&(0,D.jsx)(`div`,{className:$.nowLine,style:E({"--top":`${String(g)}px`}),children:(0,D.jsx)(`span`,{className:$.nowDot})}),c.map(e=>(0,D.jsx)(p5,{item:e,range:n,onSelect:m},e.occurrence.key))]})},w5=e=>{let{day:t,cell:n,dayIndex:r,occurrences:i,onSelectBlock:a,active:o}=e,{dayOccs:s,allDay:c,availabilityBands:l,laid:u}=S5(i,r),d=!o;return(0,D.jsxs)(`div`,{className:T($.dayCol,n.isToday&&$.dayColToday),children:[(0,D.jsx)(y5,{day:t,cell:n,count:s.length,off:d}),(0,D.jsx)(b5,{allDay:c,onSelectBlock:a}),(0,D.jsx)(C5,{...e,availabilityBands:l,laid:u})]})},T5=({range:e})=>(0,D.jsxs)(`div`,{className:$.gutter,children:[(0,D.jsx)(`div`,{className:$.gutterHead}),(0,D.jsx)(`div`,{className:$.gutterAllDay,children:`all-day`}),Array.from({length:e.endHour-e.startHour},(t,n)=>e.startHour+n).map(e=>(0,D.jsx)(`div`,{className:$.gutterHour,children:u6(e)},e))]}),E5=(e,t)=>{let[r,i]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let n=()=>{if(r!==null){let{firstDayIdx:n,lastDayIdx:a,startHour:o,endHour:s}=f5(r.startDayIndex,r.endDayIndex,r.startHour,r.endHour),c=e[n],l=e[a];c&&l&&t(c6(cO(c.date),`${String(o).padStart(2,`0`)}:00`),c6(cO(l.date),`${String(s).padStart(2,`0`)}:00`)),i(null)}};return window.addEventListener(`mouseup`,n),()=>{window.removeEventListener(`mouseup`,n)}},[r,e,t]),{dragSelect:r,startDrag:(e,t)=>{i({startDayIndex:e,endDayIndex:e,startHour:t,endHour:t+1})},enterDrag:(e,t,n)=>{if(r!==null){if(n!==1){i(null);return}i({...r,endDayIndex:e,endHour:t+1})}}}},D5=e=>{let t=FN();return{dropBlock:(n,r)=>{let i=e.find(e=>e.block.id===n);if(!i)return;let a=i.block.durationMinutes,o=new Date(new Date(r).getTime()+a*6e4).toISOString();t.mutate({id:n,draft:{title:i.block.title,status:i.block.status,start:r,end:o,allDay:i.block.allDay,notes:i.block.notes,recurrence:i.block.recurrence}})}}},O5=e=>({active:e?e.active:!0,slots:e?.slots??[{from:`09:00`,to:`17:00`}]}),k5=({days:e,cells:t,occurrences:r,availability:i,workStart:a,workEnd:o,range:s,now:c,onSelectBlock:l,onSelectSlot:u})=>{let d=(0,n.useRef)(null),{dragSelect:f,startDrag:p,enterDrag:m}=E5(t,u),{dropBlock:h}=D5(r),g=(0,n.useRef)(c);g.current=c;let{startHour:_,endHour:v}=s,y=c.getHours()*60+c.getMinutes(),b=t.some(e=>e.isToday)&&y>=_*60&&y<=v*60;(0,n.useEffect)(()=>{let e=d.current;if(e===null)return;let t=b?x6(g.current,_):b6(a,o,_);e.scrollTo({top:Math.max(0,Math.min(t,e.scrollHeight-e.clientHeight))})},[_,a,o,b]);let x=Math.max(1,...e.map(e=>{let t=qD.findIndex(t=>t.id===e.id);return r.filter(e=>e.dayIndex===t&&e.block.allDay).length}));return(0,D.jsx)(`div`,{className:$.gridScroll,ref:d,children:(0,D.jsxs)(`div`,{className:$.gridInner,style:E({"--all-day-rows":x}),children:[(0,D.jsx)(T5,{range:s}),e.map(e=>{let n=qD.findIndex(t=>t.id===e.id),a=t[n]??t[0];if(a===void 0)return null;let{active:o,slots:d}=O5(i?i[e.id]:null);return(0,D.jsx)(w5,{day:e,cell:a,dayIndex:n,active:o,slots:d,range:s,now:c,occurrences:r,dragSelect:f,onDragSelectStart:p,onDragSelectEnter:m,onDropBlock:h,onSelectBlock:l,onSelectSlot:u},e.id)})]})})},A5=[{id:`day`,label:`Day`},{id:`week`,label:`Week`},{id:`workweek`,label:`Work Week`},{id:`month`,label:`Month`},{id:`agenda`,label:`Agenda`},{id:`hours`,label:`Working Hours`}],j5=e=>e===`month`||e===`agenda`,M5=(e,t)=>{let n=new Set(e);return t===`agenda`?n.delete(`available`):t!==`hours`&&n.add(`available`),n},N5=(e,t)=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n},P5=()=>{let[e,t]=(0,n.useState)(`week`),[r,i]=(0,n.useState)(0),[a,o]=(0,n.useState)(0),[s,c]=(0,n.useState)(null),[l,u]=(0,n.useState)(()=>new Set(KO.map(e=>e.id))),[d,f]=(0,n.useState)(``),p=JN(d).display;return{view:e,setView:e=>{t(e),u(t=>M5(t,e))},dayOffset:r,monthOffset:a,goPrev:()=>{j5(e)?o(e=>e-1):i(e===`day`?e=>e-1:e=>e-7)},goNext:()=>{j5(e)?o(e=>e+1):i(e===`day`?e=>e+1:e=>e+7)},goToday:()=>{i(0),o(0)},active:l,toggle:e=>{u(t=>N5(t,e))},editor:s,openCreate:(e,t)=>{c({mode:`create`,start:e,...t===void 0?{}:{end:t}})},openQuick:(e,t,n)=>{let r=new Date(O6(new Date().toISOString(),p));r.setSeconds(0,0),r.setMinutes(Math.ceil(r.getMinutes()/5)*5);let i=new Date(r.getTime()+t*6e4);c({mode:`create`,start:r.toISOString(),end:i.toISOString(),status:e,title:n})},openEdit:e=>{c({mode:`edit`,block:e})},closeEditor:()=>{c(null)},timezone:p,setTimezone:f}},F5={scheduleRoot:`_scheduleRoot_5za8e_7`,toolbar:`_toolbar_5za8e_16`,scheduleSelect:`_scheduleSelect_5za8e_27`,weekNav:`_weekNav_5za8e_39`,dateLabel:`_dateLabel_5za8e_45`,navBtn:`_navBtn_5za8e_54`,todayBtn:`_todayBtn_5za8e_75`,viewChips:`_viewChips_5za8e_92`,viewChip:`_viewChip_5za8e_92`,viewChipBg:`_viewChipBg_5za8e_119`,viewChipLabel:`_viewChipLabel_5za8e_128`,viewChipActive:`_viewChipActive_5za8e_134`,newBtn:`_newBtn_5za8e_140`,main:`_main_5za8e_156`,calArea:`_calArea_5za8e_163`,hoursArea:`_hoursArea_5za8e_172`,sidebarToggleBtn:`_sidebarToggleBtn_5za8e_181`,sidebarToggleBtnActive:`_sidebarToggleBtnActive_5za8e_199`},I5=e=>e.view===`month`?(0,D.jsx)(a5,{dates:e.monthDates,anchor:e.monthAnchor,occurrences:e.monthOccurrences,today:e.today,onSelectBlock:e.onSelectBlock,onSelectSlot:e.onSelectSlot}):e.view===`agenda`?(0,D.jsx)(e5,{occurrences:e.monthOccurrences,onSelectBlock:e.onSelectBlock,onCreate:e.onCreate}):(0,D.jsx)(k5,{days:e.days,cells:e.cells,occurrences:e.weekOccurrences,availability:e.availability,workStart:e.workStart,workEnd:e.workEnd,range:e.range,now:e.today,onSelectBlock:e.onSelectBlock,onSelectSlot:e.onSelectSlot}),L5=e=>{let t=mi(`(max-width: 1024px)`);return(0,D.jsxs)(`div`,{className:F5.main,children:[(0,D.jsxs)(`div`,{className:F5.calArea,children:[e.query.isPending&&(0,D.jsx)(`div`,{className:L6.center,children:(0,D.jsx)(gi,{label:`Loading schedule`})}),e.query.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not load schedule`,children:e.query.error.message}),e.query.isSuccess&&I5(e)]}),!t&&(0,D.jsx)(d5,{occurrences:e.summary,today:e.today,availability:e.availability,workStart:e.workStart,workEnd:e.workEnd,activeStatuses:e.active,onToggleStatus:e.onToggle,onQuickAdd:e.onQuickAdd}),t&&(0,D.jsx)(Xy,{open:e.isSidebarOpen??!1,onOpenChange:t=>{!t&&e.onCloseSidebar!==void 0&&e.onCloseSidebar()},title:`Schedule Settings`,side:`right`,children:(0,D.jsx)(d5,{occurrences:e.summary,today:e.today,availability:e.availability,workStart:e.workStart,workEnd:e.workEnd,activeStatuses:e.active,onToggleStatus:e.onToggle,onQuickAdd:e.onQuickAdd,onClose:e.onCloseSidebar})})]})},R5=(e,t)=>e.meetingDuration!==t.meetingDuration||e.bufferMinutes!==t.bufferMinutes,z5=(e,t,n)=>{let r=qN.from({personal:t.timezone,anchor:t.availabilityTimezone});return{anchorZone:r.anchor,initialTimezone:r.display,initialInZone:G8(e,r.anchor,r.display,n)}},B5=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]={active:r.active,slots:r.slots.map(e=>({from:e.from,to:e.to}))};return t},V5=(e,t,r)=>{let i=MN(),a=RN(),[o]=(0,n.useState)(()=>r.now()),[{anchorZone:s,initialTimezone:c,initialInZone:l}]=(0,n.useState)(()=>z5(e,t,o)),[u,d]=(0,n.useState)(l),[f,p]=(0,n.useState)(c),[m,h]=(0,n.useState)(t.meetingDuration),[g,_]=(0,n.useState)(t.bufferMinutes),v=G8(u,f,s,o),y=JSON.stringify(B5(v))!==JSON.stringify(B5(e)),b=R5({meetingDuration:m,bufferMinutes:g},t);return(0,n.useEffect)(()=>{i.isSuccess&&d(G8(e,s,f,o))},[e,i.isSuccess,s,f,o]),(0,n.useEffect)(()=>{a.isSuccess&&(h(t.meetingDuration),_(t.bufferMinutes))},[t,a.isSuccess]),{draft:u,timezone:f,meetingDuration:m,bufferMinutes:g,now:o,dirty:y||b,isSaving:i.isPending||a.isPending,isSuccess:i.isSuccess||a.isSuccess,isError:i.isError||a.isError,errorMsg:i.error?.message??a.error?.message??``,setMeetingDuration:h,setBufferMinutes:_,patchDay:(e,t)=>{i.reset(),a.reset(),d(n=>({...n,[e]:{...n[e],...t}}))},changeTimezone:e=>{i.reset(),a.reset(),d(t=>G8(t,f,e,o)),p(e)},reset:()=>{i.mutate(null,{onSuccess:()=>{j.success(`Reverted to your branch default hours.`)},onError:()=>{j.error(`Could not revert to branch defaults. Please try again.`)}})},onSave:()=>{i.reset(),a.reset(),y&&i.mutate(v),b&&a.mutate({...t,meetingDuration:m,bufferMinutes:g})}}},H5={hours:`_hours_ftj0h_5`,fieldLabel:`_fieldLabel_ftj0h_18`,chips:`_chips_ftj0h_24`,chipBtn:`_chipBtn_ftj0h_30`,chipBtnActive:`_chipBtnActive_ftj0h_50`,chipBg:`_chipBg_ftj0h_56`,chipLabel:`_chipLabel_ftj0h_64`,dayRow:`_dayRow_ftj0h_69`,toggle:`_toggle_ftj0h_77`,toggleOn:`_toggleOn_ftj0h_90`,toggleKnob:`_toggleKnob_ftj0h_95`,dayName:`_dayName_ftj0h_102`,overflowLabel:`_overflowLabel_ftj0h_112`,dayTimes:`_dayTimes_ftj0h_119`,timeInput:`_timeInput_ftj0h_127`,resetBtn:`_resetBtn_ftj0h_144`,readonlyField:`_readonlyField_ftj0h_162`,fieldHint:`_fieldHint_ftj0h_175`,formFooter:`_formFooter_ftj0h_180`,formStatus:`_formStatus_ftj0h_188`,saveBtn:`_saveBtn_ftj0h_194`,inheritedBanner:`_inheritedBanner_ftj0h_212`,inheritedBadge:`_inheritedBadge_ftj0h_218`,badgeSub:`_badgeSub_ftj0h_229`,customBadge:`_customBadge_ftj0h_234`,customBadgeText:`_customBadgeText_ftj0h_247`,resetToBranchBtn:`_resetToBranchBtn_ftj0h_251`,settingsGrid:`_settingsGrid_ftj0h_271`},U5=({name:e,options:t,selected:n,onSelect:r})=>(0,D.jsx)(`div`,{className:H5.chips,children:t.map(t=>{let i=n===t;return(0,D.jsxs)(`button`,{type:`button`,className:T(H5.chipBtn,i&&H5.chipBtnActive),onClick:()=>{r(t)},children:[i&&(0,D.jsx)(A.span,{layoutId:`chip-${e}`,className:H5.chipBg,transition:{type:`spring`,stiffness:420,damping:34}}),(0,D.jsxs)(`span`,{className:H5.chipLabel,children:[t,`m`]})]},t)})}),W5=({meetingDuration:e,bufferMinutes:t,onDurationChange:n,onBufferChange:r})=>(0,D.jsxs)(`div`,{className:H5.settingsGrid,children:[(0,D.jsxs)(`div`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:H5.fieldLabel,children:`Meeting duration`}),(0,D.jsx)(U5,{name:`duration`,options:UO,selected:e,onSelect:n})]}),(0,D.jsxs)(`div`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:H5.fieldLabel,children:`Buffer between meetings`}),(0,D.jsx)(U5,{name:`buffer`,options:WO,selected:t,onSelect:r})]})]}),G5=({slot:e,index:t,slots:n,active:r,onChange:i})=>{let a=n[t-1],o=n[t+1],s=a===void 0?void 0:a.to,c=e.to,l=e.from,u=o===void 0?void 0:o.from;return(0,D.jsxs)(`div`,{className:H5.dayTimes,children:[(0,D.jsx)(pD,{value:e.from,minTime:s,maxTime:c,disabled:!r,onChange:r=>{let a=[...n];a[t]={...e,from:r},i(a)}}),(0,D.jsx)(`span`,{className:L6.dash,children:`–`}),(0,D.jsx)(pD,{value:e.to,minTime:l,maxTime:u,disabled:!r,align:`end`,onChange:r=>{let a=[...n];a[t]={...e,to:r},i(a)}}),(0,D.jsx)(`button`,{type:`button`,className:H5.resetBtn,disabled:!r||n.length===1,onClick:()=>{i(n.filter((e,n)=>n!==t))},children:`Delete`})]})},K5=({day:e,value:t,onChange:n})=>(0,D.jsxs)(`div`,{className:H5.dayRow,children:[(0,D.jsx)(`button`,{type:`button`,className:T(H5.toggle,t.active&&H5.toggleOn),"aria-pressed":t.active,onClick:()=>{n({active:!t.active})},children:(0,D.jsx)(`span`,{className:H5.toggleKnob})}),(0,D.jsx)(`span`,{className:H5.dayName,children:e.long}),(0,D.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,flex:1},children:[t.slots.map((e,r)=>(0,D.jsx)(G5,{slot:e,index:r,slots:t.slots,active:t.active,onChange:e=>{n({slots:e})}},e.id)),(0,D.jsx)(`button`,{type:`button`,className:H5.resetBtn,style:{alignSelf:`flex-start`,margin:0},disabled:!t.active,onClick:()=>{let e=t.slots[t.slots.length-1],r=`09:00`,i=`17:00`;e!==void 0&&e.to<`22:00`&&(r=e.to,i=`23:00`),n({slots:[...t.slots,{id:crypto.randomUUID(),from:r,to:i}]})},children:`+ Add Time`})]}),(0,D.jsxs)(`button`,{type:`button`,className:H5.resetBtn,onClick:()=>{n({active:!0,slots:[{id:crypto.randomUUID(),from:`09:00`,to:`17:00`}]})},children:[(0,D.jsx)(Ir,{size:13}),` Reset`]})]}),q5=({timezone:e,branchName:t,now:n,onTimezoneChange:r})=>(0,D.jsxs)(`div`,{className:H5.settingsGrid,children:[(0,D.jsxs)(`div`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:H5.fieldLabel,children:`Timezone`}),(0,D.jsx)(X8,{value:e,now:n,onChange:r}),(0,D.jsx)(`span`,{className:H5.fieldHint,children:`Preview only — set your saved timezone in Profile`})]}),(0,D.jsxs)(`div`,{className:L6.field,children:[(0,D.jsx)(`span`,{className:H5.fieldLabel,children:`Home Branch`}),(0,D.jsx)(`div`,{className:H5.readonlyField,children:t}),(0,D.jsx)(`span`,{className:H5.fieldHint,children:`Assigned from your UAPP account`})]})]}),J5=({isOverride:e,branchName:t,onReset:n})=>(0,D.jsx)(`div`,{className:H5.inheritedBanner,children:e?(0,D.jsxs)(`div`,{className:H5.customBadge,children:[(0,D.jsxs)(`span`,{className:H5.customBadgeText,children:[`Customized Working Hours (overrides `,t,`)`]}),(0,D.jsxs)(`button`,{type:`button`,className:H5.resetToBranchBtn,onClick:n,children:[(0,D.jsx)(ri,{size:13}),` Use Branch Defaults`]})]}):(0,D.jsxs)(`div`,{className:H5.inheritedBadge,children:[(0,D.jsxs)(`span`,{children:[`Inheriting default hours from `,(0,D.jsx)(`strong`,{children:t})]}),(0,D.jsx)(`span`,{className:H5.badgeSub,children:`Modifying the hours below will create a personal override.`})]})}),Y5=({statusText:e,disabled:t,onClick:n})=>(0,D.jsxs)(`div`,{className:H5.formFooter,children:[(0,D.jsx)(`span`,{className:H5.formStatus,children:e}),(0,D.jsx)(`button`,{type:`button`,className:H5.saveBtn,disabled:t,onClick:n,children:`Save changes`})]}),X5=(e,t)=>e?`Unsaved changes`:t?`Saved`:``,Z5=({initial:e,isOverride:t,branchName:n,prefs:r})=>{let{clock:i}=TN(),a=V5(e,r,i),o=X5(a.dirty,a.isSuccess);return(0,D.jsxs)(`div`,{className:H5.hours,children:[(0,D.jsx)(q5,{timezone:a.timezone,branchName:n,now:a.now,onTimezoneChange:a.changeTimezone}),(0,D.jsx)(W5,{meetingDuration:a.meetingDuration,bufferMinutes:a.bufferMinutes,onDurationChange:a.setMeetingDuration,onBufferChange:a.setBufferMinutes}),(0,D.jsx)(J5,{isOverride:t,branchName:n,onReset:a.reset}),qD.map(e=>(0,D.jsx)(K5,{day:e,value:a.draft[e.id],onChange:t=>{a.patchDay(e.id,t)}},e.id)),a.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not save`,children:a.errorMsg}),(0,D.jsx)(Y5,{statusText:o,disabled:!a.dirty||a.isSaving,onClick:a.onSave})]})},Q5=(e,t,n)=>e?.message??t?.message??n?.message??`Unknown error`,$5=(e,t)=>e?.branches.find(e=>e.id===t)?.name??`your branch`,e7=()=>{let e=jN(),t=pR(),n=LN();if(e.isPending||t.isPending||n.isPending)return(0,D.jsx)(`div`,{className:L6.center,children:(0,D.jsx)(gi,{label:`Loading working hours`})});if(e.isError||t.isError||n.isError)return(0,D.jsx)(bi,{tone:`error`,title:`Could not load working hours`,children:Q5(e.error,t.error,n.error)});let r=$5(t.data,n.data.branchId);return(0,D.jsx)(Z5,{initial:e.data.weekly,isOverride:e.data.isOverride,branchName:r,prefs:n.data},`${String(e.data.isOverride)}:${e.data.source}`)},t7={workStart:`09:00`,workEnd:`17:00`,branchId:`uk`},n7=(e,t)=>e===`day`?qD.slice(t,t+1):e===`workweek`?qD.slice(0,5):qD,r7=e=>{let[t]=e.split(`:`);return Number(t??`0`)},i7=(e,t,n)=>{if(e!==null)return e;if(t){let e=kI(t,n),r={};for(let t of qD){let n=e[t.id];r[t.id]={active:n.active,slots:[{id:crypto.randomUUID(),from:n.from,to:n.to}]}}return r}let r={};for(let e of qD)r[e.id]={active:e.id!==`sat`&&e.id!==`sun`,slots:[{id:crypto.randomUUID(),from:`09:00`,to:`17:00`}]};return r},a7=(e,t,n,r)=>t!==``&&t!==n?G8(e,t,n,r):e,o7=e=>{let t=Object.values(e).filter(e=>e.active).flatMap(e=>e.slots),n=t.length>0?Math.min(...t.map(e=>r7(e.from))):9,r=t.length>0?Math.max(...t.map(e=>r7(e.to))):17;return{workStart:`${String(Math.max(0,n)).padStart(2,`0`)}:00`,workEnd:`${String(Math.min(24,r)).padStart(2,`0`)}:00`}},s7=(e,t)=>(0,n.useMemo)(()=>{let n=e??[],r=BN();if(t===r)return n;let i=e=>{let n=new Date(e),i=HN(t,n)-HN(r,n);return i===0?e:new Date(n.getTime()+i*6e4).toISOString()};return n.map(e=>new VO({id:e.id,userId:e.userId,title:e.title,status:e.status,start:i(e.start),end:i(e.end),allDay:e.allDay,notes:e.notes,recurrence:e.recurrence}))},[e,t]),c7=e=>{let t=NN(),r=AN().data??null,i=LN().data,a=i??t7,o=pR(),s=new Date,c=HN(e.timezone,s)-HN(BN(),s),l=new Date(s.getTime()+c*6e4),u=e.view===`month`||e.view===`agenda`,d=t=>e.active.has(t.block.status),f=a.branchId,p=a7((0,n.useMemo)(()=>i7(r,o.data,f),[r,o.data,f]),i?.availabilityTimezone??``,e.timezone,s),{workStart:m,workEnd:h}=o7(p),g=e.timezone,_=s7(t.data,g),v=(l.getDay()+6)%7,y=Math.floor((e.dayOffset+v)/7),b=((e.dayOffset+v)%7+7)%7,x=ek(_,X3(l,y)),S=n6(l,e.monthOffset),C=$O(S[0]??l,S[S.length-1]??l,_),ee=new Date(l);return ee.setSeconds(0,0),ee.setMinutes(Math.ceil(ee.getMinutes()/30)*30),{query:t,today:l,days:n7(e.view,b),cells:Z3(l,y),weekOccurrences:x.filter(d),availability:p,workStart:m,workEnd:h,range:p6(x,m,h),monthDates:S,monthAnchor:e6(l,e.monthOffset),monthOccurrences:C.filter(d),summary:u?C:x,rangeText:u?t6(l,e.monthOffset):$3(l,y),defaultStart:ee.toISOString()}},l7=({view:e,onView:t})=>(0,D.jsx)(`div`,{className:F5.viewChips,children:A5.map(n=>{let r=e===n.id;return(0,D.jsxs)(`button`,{type:`button`,className:T(F5.viewChip,r&&F5.viewChipActive),onClick:()=>{t(n.id)},children:[r&&(0,D.jsx)(A.span,{layoutId:`schedViewBg`,className:F5.viewChipBg,transition:{type:`spring`,stiffness:420,damping:34}}),(0,D.jsx)(`span`,{className:F5.viewChipLabel,children:n.label})]},n.id)})}),u7=({view:e,onView:t,rangeText:n,showNav:r,onPrev:i,onNext:a,onToday:o,onNew:s,timezone:c,setTimezone:l,todayDate:u,onToggleSidebar:d,isSidebarOpen:f})=>(0,D.jsxs)(`div`,{className:F5.toolbar,children:[(0,D.jsx)(`select`,{className:F5.scheduleSelect,"aria-label":`Calendar`,defaultValue:`my`,children:(0,D.jsx)(`option`,{value:`my`,children:`My Schedule`})}),e!==`hours`&&(0,D.jsx)(X8,{value:c,onChange:l,now:u}),r&&(0,D.jsxs)(`div`,{className:F5.weekNav,children:[(0,D.jsx)(`button`,{type:`button`,className:F5.todayBtn,onClick:o,children:`Today`}),(0,D.jsx)(`button`,{type:`button`,className:F5.navBtn,"aria-label":`Previous week`,onClick:i,children:(0,D.jsx)(Kn,{size:16})}),(0,D.jsx)(`button`,{type:`button`,className:F5.navBtn,"aria-label":`Next week`,onClick:a,children:(0,D.jsx)(qn,{size:16})}),(0,D.jsx)(`span`,{className:F5.dateLabel,children:n})]}),e!==`hours`&&d!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:T(F5.sidebarToggleBtn,f&&F5.sidebarToggleBtnActive),"aria-label":`Schedule settings`,title:`Schedule settings`,onClick:d,children:(0,D.jsx)(qr,{size:15})}),(0,D.jsx)(l7,{view:e,onView:t}),(0,D.jsxs)(`button`,{type:`button`,className:F5.newBtn,onClick:s,children:[(0,D.jsx)(Pr,{size:14,strokeWidth:2.5}),` New`]})]}),d7=()=>{let[e,t]=(0,n.useState)(!1),r=P5(),i=c7(r),a=()=>{r.openCreate(i.defaultStart)};return(0,D.jsxs)(`div`,{className:F5.scheduleRoot,children:[(0,D.jsx)(u7,{view:r.view,onView:r.setView,rangeText:i.rangeText,showNav:r.view!==`hours`,onPrev:r.goPrev,onNext:r.goNext,onToday:r.goToday,onNew:a,timezone:r.timezone,setTimezone:r.setTimezone,todayDate:i.today,onToggleSidebar:()=>{t(e=>!e)},isSidebarOpen:e}),r.view===`hours`?(0,D.jsx)(`div`,{className:F5.hoursArea,children:(0,D.jsx)(e7,{})}):(0,D.jsx)(L5,{query:i.query,view:r.view,today:i.today,days:i.days,cells:i.cells,weekOccurrences:i.weekOccurrences,availability:i.availability,workStart:i.workStart,workEnd:i.workEnd,range:i.range,monthDates:i.monthDates,monthAnchor:i.monthAnchor,monthOccurrences:i.monthOccurrences,summary:i.summary,active:r.active,onToggle:r.toggle,onSelectBlock:r.openEdit,onSelectSlot:r.openCreate,onCreate:a,onQuickAdd:r.openQuick,isSidebarOpen:e,onCloseSidebar:()=>{t(!1)}}),r.editor!==null&&(0,D.jsx)(A8,{state:r.editor,timezone:r.timezone,onClose:r.closeEditor})]})},f7=()=>{X$(`uapp-schedule`,()=>(0,D.jsx)(N2,{path:`/comms/schedule`,children:(0,D.jsx)(d7,{})}))},p7=6e4,m7=e=>{let t=e.logger??new bk(`info`),n=new zN,r,i=0,a=new _k(new pk(new dk({logger:t,baseUrl:e.apiBaseUrl,getAuthToken:()=>r}),{timeoutMs:2e4,logger:t}),{logger:t}),o=new uq({httpClient:a,clock:n,logger:t,clientKey:e.clientKey,modules:e.modules});return{httpClient:a,logger:t,token:async()=>{if(r!==void 0&&n.now().getTime()<i-p7)return r;let a=await e.getAssertion(),s=await o.exchangeSsoSecret(a);if(!s.ok){t.error(`Could not exchange the assertion for a token`,s.error);return}return r=s.value.accessToken,i=s.value.expiresAt.getTime(),r},currentToken:()=>r}},h7=`/api/app/notification`,g7=async(e,t)=>{try{let t=await e.get(h7);return(Array.isArray(t)?t:[]).map(I$).filter(e=>e!==null)}catch(e){return t.error(`Could not load unread notifications`,e),[]}},_7=(e,t,n)=>new HJ({logger:t}).create({url:`${e}/signalr/notifications`,accessTokenProvider:n}),v7=e=>{let t=m7({apiBaseUrl:e.apiBaseUrl,clientKey:e.clientKey,getAssertion:e.getAssertion,modules:e.modules??[`commhub.feed`],...e.logger===void 0?{}:{logger:e.logger}}),{httpClient:n,logger:r,token:i}=t,a=null,o=null,s=[];return{start:async()=>{a===null&&await i()!==void 0&&(s=await g7(n,r),s.forEach(e.onNotification),a=_7(e.apiBaseUrl,r,t.currentToken),o=a.on(yZ.ReceiveNotification,t=>{let n=I$(t);if(n===null){r.error(`Discarded a malformed notification payload`,{rawPayload:t});return}s=[n,...s.filter(e=>e.id!==n.id)],e.onNotification(n)}),await a.start())},stop:async()=>{o?.(),o=null,await a?.stop(),a=null},markAsRead:async e=>{await i()!==void 0&&(await n.post(`${h7}/${e}/mark-as-read`,{}),s=s.filter(t=>t.id!==e))},unread:()=>s}},y7=e=>{let t=m7({apiBaseUrl:e.apiBaseUrl,clientKey:e.clientKey,getAssertion:e.getAssertion,modules:e.modules??[`commhub.chat`],...e.logger===void 0?{}:{logger:e.logger}}),n=new JR({httpClient:t.httpClient,logger:t.logger}),r=async e=>{if(await t.token()===void 0)return null;let n=await e();return VD(n)?n.value:null};return{getMine:()=>r(()=>n.getMine()),setMine:e=>r(()=>n.setMine(e)),clearMine:()=>r(()=>n.clearMine()),getOf:async e=>{if(await t.token()===void 0)return null;let r=await n.getOf(e);return VD(r)?r.value:null}}},b7=()=>{Z$(),P2(),Y3(),f7()};exports.CommsProvider=B$,exports.SDK_MODULE_SCOPES=hq,exports.WidgetRoot=V$,exports.createNotificationClient=v7,exports.createPresenceClient=y7,exports.defineCustomElements=b7,exports.registerBookingsWidget=Y3,exports.registerChatWidget=Z$,exports.registerFeedWidget=P2,exports.registerScheduleWidget=f7;
58
+ `),a=Reflect.get(e,`CSSStyleSheet`);if(typeof a?.prototype.replaceSync!=`function`){let t=e.document.createElement(`style`);t.textContent=i,r.append(t)}else{let e=new a;e.replaceSync(i),r.adoptedStyleSheets=[e]}let o=t.host,s=o.getAttribute(`data-theme`);return s!==null&&n.setAttribute(`data-theme`,s),n.setAttribute(`style`,o.getAttribute(`style`)??``),r},LB=async(e={},t=document,n=window)=>{let r=n.documentPictureInPicture;if(r===void 0)return null;try{let n=await r.requestWindow({width:e.width??320,height:e.height??220});return t instanceof ShadowRoot?{window:n,container:IB(n,t)}:(PB(n,t),FB(n,t),{window:n,container:n.document.body})}catch{return null}},RB=(e,t)=>{let[r,i]=(0,n.useState)(null),a=(0,n.useRef)(null);a.current=r;let o=(0,n.useRef)(t);o.current=t;let s=(0,n.useCallback)(()=>{a.current?.window.close(),i(null)},[]),c=(0,n.useCallback)(async()=>{if(a.current!==null)return;let e=o.current.current?.getRootNode(),t=await LB({},e instanceof ShadowRoot||e instanceof Document?e:document);t!==null&&(t.window.addEventListener(`pagehide`,()=>{i(null)}),i(t))},[]),l=(0,n.useCallback)(()=>{c()},[c]);return(0,n.useEffect)(()=>{let t=Reflect.get(navigator,`mediaSession`);if(!e||!kB()||t===void 0)return;let n=`enterpictureinpicture`;try{t.setActionHandler(n,()=>{c()})}catch{return}return()=>{try{t.setActionHandler(n,null)}catch{}}},[e,c]),(0,n.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&s()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[s]),(0,n.useEffect)(()=>{e||(s(),AB()?.close())},[e,s]),(0,n.useEffect)(()=>s,[s]),{mount:r,popOut:l}},zB={overlay:`_overlay_1agsz_5`,card:`_card_1agsz_12`,draggable:`_draggable_1agsz_30`,head:`_head_1agsz_40`,info:`_info_1agsz_46`,avatarRing:`_avatarRing_1agsz_53`,avatarRingPulse:`_avatarRingPulse_1agsz_65`,callPulse:`_callPulse_1agsz_1`,avatar:`_avatar_1agsz_53`,name:`_name_1agsz_107`,status:`_status_1agsz_117`,timer:`_timer_1agsz_123`,actions:`_actions_1agsz_130`,btn:`_btn_1agsz_137`,accept:`_accept_1agsz_163`,acceptBob:`_acceptBob_1agsz_1`,decline:`_decline_1agsz_178`,mute:`_mute_1agsz_182`,muteOn:`_muteOn_1agsz_191`,popped:`_popped_1agsz_208`,popOut:`_popOut_1agsz_224`},BB=e=>{let t=e.trim().split(/\s+/).filter(e=>e.length>0);if(t.length===0)return`?`;let n=t[0]??``,r=t.length>1?t[t.length-1]??``:``;return(n.charAt(0)+r.charAt(0)).toUpperCase()},VB=e=>e===`unavailable`?`Unavailable`:e===`failed`?`Call failed`:`Call ended`,HB=(e,t,n,r)=>{let i=t===`video`?`video`:`voice`;switch(e){case`incoming`:return`Incoming ${i} call`;case`outgoing`:return n?`Ringing…`:`Calling…`;case`active`:return`Connecting…`;case`ended`:return VB(r);case`idle`:return``}},UB=({sinceMs:e})=>{let[t,r]=(0,n.useState)(()=>Date.now());(0,n.useEffect)(()=>{let e=window.setInterval(()=>{r(Date.now())},1e3);return()=>{window.clearInterval(e)}},[]);let i=Math.max(0,Math.floor((t-e)/1e3)),a=String(Math.floor(i/60)).padStart(2,`0`),o=String(i%60).padStart(2,`0`);return(0,D.jsxs)(`span`,{className:zB.timer,children:[a,`:`,o]})},WB=({phase:e,muted:t,actions:n})=>e===`ended`?null:e===`incoming`?(0,D.jsxs)(`div`,{className:zB.actions,children:[(0,D.jsx)(`button`,{type:`button`,className:T(zB.btn,zB.decline),onClick:()=>{n.decline()},"aria-label":`Decline call`,children:(0,D.jsx)(Ar,{size:24})}),(0,D.jsx)(`button`,{type:`button`,className:T(zB.btn,zB.accept),onClick:()=>{n.accept()},"aria-label":`Accept call`,children:(0,D.jsx)(jr,{size:24})})]}):(0,D.jsxs)(`div`,{className:zB.actions,children:[e===`active`&&(0,D.jsx)(`button`,{type:`button`,className:T(zB.btn,zB.mute,t&&zB.muteOn),onClick:()=>{n.toggleMute()},"aria-label":t?`Unmute`:`Mute`,children:t?(0,D.jsx)(Cr,{size:20}):(0,D.jsx)(wr,{size:20})}),(0,D.jsx)(`button`,{type:`button`,className:T(zB.btn,zB.decline),onClick:()=>{n.hangup()},"aria-label":`Hang up`,children:(0,D.jsx)(Ar,{size:24})})]}),GB=e=>{let t=e.phase===`outgoing`&&e.callId!==null,n=e.phase===`active`&&e.connected&&e.activeSinceMs!==null;return{ringing:e.phase===`incoming`||e.phase===`outgoing`,initials:e.peerInitials===``?BB(e.peerName):e.peerInitials,status:n?(0,D.jsx)(UB,{sinceMs:e.activeSinceMs}):HB(e.phase,e.mediaType,t,e.endReason)}},KB=({peerName:e,initials:t,peerColor:n,ringing:r,status:i,onPopOut:a})=>(0,D.jsxs)(`div`,{className:zB.head,children:[(0,D.jsx)(`div`,{className:T(zB.avatarRing,r&&zB.avatarRingPulse),children:(0,D.jsx)(`div`,{className:zB.avatar,style:n===``?void 0:E({"--avatar-color":n}),"aria-hidden":`true`,children:t})}),(0,D.jsxs)(`div`,{className:zB.info,children:[(0,D.jsx)(`div`,{className:zB.name,children:e===``?`Unknown caller`:e}),(0,D.jsx)(`div`,{className:zB.status,children:i})]}),a!==null&&(0,D.jsx)(`button`,{type:`button`,className:zB.popOut,onClick:a,"aria-label":`Keep call on top`,title:`Keep call on top`,children:(0,D.jsx)(Mr,{size:16})})]}),qB=({actions:e})=>{let t=xB(e=>e.phase),r=xB(e=>e.callId),a=xB(e=>e.peerName),o=xB(e=>e.peerInitials),s=xB(e=>e.peerColor),c=xB(e=>e.mediaType),l=xB(e=>e.muted),u=xB(e=>e.connected),d=xB(e=>e.activeSinceMs),f=xB(e=>e.endReason),p=(0,n.useRef)(null),{mount:m,popOut:h}=RB(t===`incoming`||t===`outgoing`||t===`active`,p);if(t===`idle`)return null;let g=m!==null,_=t===`active`&&!g,{ringing:v,initials:y,status:b}=GB({phase:t,callId:r,peerName:a,peerInitials:o,mediaType:c,connected:u,activeSinceMs:d,endReason:f}),x=(0,D.jsx)(`div`,{className:T(zB.overlay,g&&zB.popped),ref:p,role:`dialog`,"aria-label":`Call`,children:(0,D.jsxs)(A.div,{className:T(zB.card,_&&zB.draggable),variants:Hy,initial:`hidden`,animate:`visible`,drag:_,dragConstraints:p,dragElastic:.12,dragMomentum:!1,children:[(0,D.jsx)(KB,{peerName:a,initials:y,peerColor:s,ringing:v,status:b,onPopOut:!g&&kB()?h:null}),(0,D.jsx)(WB,{phase:t,muted:l,actions:e})]})});return m===null?x:(0,i.createPortal)(x,m.container)},JB=0,YB=(e,t)=>{let n=e.getState();return n.direction===`outgoing`&&n.phase===`outgoing`&&n.callId===null&&n.dialId===t},XB=async({store:e,cancelCall:t,dialId:n,result:r})=>{let i=YB(e,n);if(!r.ok){i&&e.getState().ended(`failed`);return}let a=r.value;if(a.status===`callee_unavailable`||a.joinTicket===null){i&&e.getState().ended(`unavailable`);return}if(!i){await t.execute(a.callId);return}e.getState().attachOutgoing({callId:a.callId,ticket:a.joinTicket})},ZB=()=>{let{store:e,startCall:t,acceptCall:r,declineCall:i,cancelCall:a,endCall:o}=bB();return{startCall:(0,n.useCallback)(async n=>{if(n.userId===``)return;let r=e.getState().phase;if(r!==`idle`&&r!==`ended`)return;let i=String(JB+=1);e.getState().dialing({peer:n,mediaType:`audio`,dialId:i}),await XB({store:e,cancelCall:a,dialId:i,result:await t.execute(n.userId,`audio`)})},[e,t,a]),accept:(0,n.useCallback)(async()=>{let{callId:t,direction:n}=e.getState();if(t===null||n!==`incoming`)return;e.getState().activate(null,Date.now());let i=await r.execute(t);if(!i.ok){e.getState().ended(`failed`);return}e.getState().activate(i.value,Date.now())},[e,r]),decline:(0,n.useCallback)(async()=>{let{callId:t}=e.getState();e.getState().reset(),t!==null&&await i.execute(t)},[e,i]),hangup:(0,n.useCallback)(async()=>{let{callId:t,phase:n}=e.getState();e.getState().ended(`hung_up`),t!==null&&(n===`active`?await o.execute(t):await a.execute(t))},[e,o,a]),toggleMute:(0,n.useCallback)(()=>{let t=e.getState();t.setMuted(!t.muted)},[e])}},QB=()=>{let e=xB(e=>e.phase),t=xB(e=>e.ticket),r=xB(e=>e.muted),i=bB().store,a=ZB(),o=(0,n.useRef)(null);o.current??=EB();let s=o.current;return(0,n.useEffect)(()=>{let e=()=>{s.unlock()};return window.addEventListener(`pointerdown`,e,{once:!0}),()=>{window.removeEventListener(`pointerdown`,e)}},[s]),(0,n.useEffect)(()=>{e===`incoming`?s.playRing():e===`outgoing`?s.playRingback():s.stop()},[e,s]),(0,n.useEffect)(()=>()=>{s.dispose()},[s]),(0,n.useEffect)(()=>{if(e!==`ended`)return;let t=window.setTimeout(()=>{i.getState().reset()},2500);return()=>{window.clearTimeout(t)}},[e,i]),e===`idle`?null:(0,D.jsxs)(D.Fragment,{children:[t!==null&&(e===`outgoing`||e===`active`)&&(0,D.jsx)(OB,{ticket:t,muted:r,onConnected:()=>{i.getState().markConnected()},onEnded:()=>{i.getState().ended(`ended`)}}),(0,D.jsx)(qB,{actions:a})]})},$B=()=>{let{startCall:e}=ZB(),t=xB(e=>e.phase);return{start:t=>{e(t)},busy:t!==`idle`&&t!==`ended`}},eV={callBtn:`_callBtn_1q44j_1`},tV=({calleeUserId:e,calleeName:t,calleeInitials:n=``,calleeColor:r=``,className:i})=>{let{start:a,busy:o}=$B();return e===``?null:(0,D.jsx)(`button`,{type:`button`,className:T(eV.callBtn,i),disabled:o,onClick:()=>{a({userId:e,name:t,initials:n,color:r})},"aria-label":`Call ${t}`,title:`Call ${t}`,children:(0,D.jsx)(jr,{size:18})})},nV=({conversation:e})=>e.isGroup||e.peerUserId===null?null:(0,D.jsx)(`div`,{className:K.headEnd,children:(0,D.jsx)(tV,{calleeUserId:e.peerUserId,calleeName:e.title,calleeInitials:e.initials,calleeColor:e.color})}),rV=6e4,iV=36e5,aV=864e5,oV=(e,t)=>{if(e===null)return null;let n=Date.parse(e);if(Number.isNaN(n))return null;let r=Math.max(0,t-n);return r<rV?`Last seen just now`:r<iV?`Last seen ${String(Math.floor(r/rV))}m ago`:r<aV?`Last seen ${String(Math.floor(r/iV))}h ago`:`Last seen ${String(Math.floor(r/aV))}d ago`},sV=({conversation:e,live:t,liveStatus:n,nowMs:r})=>{if(t?.online??(n===void 0?e.online:n.status!==`offline`)){let t=n?.status??e.status;return{online:!0,subtitle:`Online`,status:t!==`offline`&&t!==`available`?t:null}}return{online:!1,subtitle:(t===void 0?null:oV(t.lastSeenUtc,r))??`Offline`,status:null}},cV=`This message was deleted`,lV=e=>{if(e.startsWith(`__UAPP_SHARED_CARD__::`))try{let t=e.substring(22);return JSON.parse(t)}catch{return null}return null},uV=e=>{if(e.startsWith(`__UAPP_SHARED_CARD__::`)){let t=lV(e);if(t!==null){let e=t.card.title;return e.length>0?`Shared Post: ${e}`:`Shared Post`}return`Shared Post`}return e},dV=(e,t=null)=>t?.text.startsWith(`__UAPP_SHARED_CARD__::`)?{messageId:e.id,authorName:t.authorName,text:t.text}:e.replyTo?.text.startsWith(`__UAPP_SHARED_CARD__::`)?{messageId:e.id,authorName:e.replyTo.authorName,text:e.replyTo.text}:{messageId:e.id,authorName:e.authorName,text:e.text},fV=(e,t)=>{if(e.replyTo===null)return null;let n=t.get(e.replyTo.messageId),r=n?.deletedForEveryone?cV:n?.text??e.replyTo.text,i=n?.authorName??e.replyTo.authorName;return r.startsWith(`__UAPP_SHARED_CARD__::`)?{author:i,text:r}:null},pV=(e,t)=>{if(e===null)return null;if(e.authorName.length>0||e.text.length>0)return e;let n=t.get(e.messageId);if(n===void 0)return e;let r=n.authorName,i=n.deletedForEveryone?cV:n.text,a=fV(n,t);return a!==null&&(r=a.author,i=a.text),{messageId:e.messageId,authorName:r,text:i}},mV=(e,t)=>e.some(e=>e.id===t.id)?e:t.clientMessageId!==null&&e.some(e=>e.clientMessageId===t.clientMessageId)?e.map(e=>e.clientMessageId===t.clientMessageId?t.withFallbackSentAt(e.sentAt):e):[...e,t].sort((e,t)=>e.sequence-t.sequence),hV=`pending:`,gV=e=>`${hV}${e}`,_V=e=>e.id.startsWith(hV),vV=e=>e.reduce((e,t)=>Math.max(e,t.sequence),0),yV=e=>e.filter(e=>!_V(e)).reduce((e,t)=>Math.max(e,t.sequence),0),bV=e=>new AP({id:gV(e.clientMessageId),kind:`text`,authorName:e.viewer.name,authorInitials:e.viewer.initials,authorColor:e.viewer.color,text:e.text.trim(),time:e.timeLabel,sentAt:e.sentAt??``,fromViewer:!0,reactions:[],sequence:e.sequence,senderId:e.viewer.id,clientMessageId:e.clientMessageId,replyTo:e.replyTo??null,mediaUrl:null,isEdited:!1}),xV=e=>new AP({id:gV(e.clientMessageId),kind:`media`,authorName:e.viewer.name,authorInitials:e.viewer.initials,authorColor:e.viewer.color,text:e.caption.trim(),time:``,sentAt:e.sentAt,fromViewer:!0,reactions:[],sequence:e.sequence,senderId:e.viewer.id,clientMessageId:e.clientMessageId,replyTo:e.replyTo??null,mediaUrl:e.fileUrl,mediaContentType:e.contentType,mediaFileName:e.fileName,isEdited:!1}),SV=(e,t)=>mV(e??[],t),CV=(e,t)=>mV(e??[],t),wV=({selectedMessage:e,onClearSelection:t,onReply:n,onStartEdit:r,onDelete:i})=>{let a=_V(e),o=e.fromViewer&&!e.deletedForEveryone&&e.canEdit(Date.now());return(0,D.jsxs)(`div`,{className:K.mobileSelectionHeader,children:[(0,D.jsxs)(`div`,{className:K.selectionLeft,children:[(0,D.jsx)(`button`,{type:`button`,className:K.selectionActionBtn,"aria-label":`Clear selection`,onClick:t,children:(0,D.jsx)(ci,{size:18})}),(0,D.jsx)(`span`,{className:K.selectionTitle,children:`1 Selected`})]}),(0,D.jsxs)(`div`,{className:K.selectionActions,children:[!a&&n!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:K.selectionActionBtn,title:`Reply`,"aria-label":`Reply`,onClick:()=>{n(dV(e)),t!==void 0&&t()},children:(0,D.jsx)(Br,{size:17})}),!a&&o&&r!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:K.selectionActionBtn,title:`Edit message`,"aria-label":`Edit message`,onClick:()=>{r(e),t!==void 0&&t()},children:(0,D.jsx)(kr,{size:17})}),!a&&e.fromViewer&&i!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:T(K.selectionActionBtn,K.selectionActionDanger),title:`Delete message`,"aria-label":`Delete message`,onClick:()=>{i(e.id),t!==void 0&&t()},children:(0,D.jsx)(ni,{size:17})})]})]})},TV=(e,t,n)=>[...e.lastSynced===null?[]:[{label:`Last synced ${e.lastSynced}`,icon:(0,D.jsx)(Ir,{size:14}),onSelect:()=>{t.refresh(e)}}],{label:`Manage members`,icon:(0,D.jsx)(ai,{size:14}),onSelect:n.onManageMembers},{label:e.favourite?`Remove from Favourites`:`Add to Favourites`,icon:(0,D.jsx)(Zr,{size:14}),onSelect:()=>{t.toggleFavourite(e)}},{label:e.pinned?`Unpin`:`Pin to top`,icon:(0,D.jsx)(Nr,{size:14}),onSelect:()=>{t.togglePin(e)}},{label:e.archived?`Unarchive`:`Archive`,icon:e.archived?(0,D.jsx)(kn,{size:14}):(0,D.jsx)(An,{size:14}),onSelect:()=>{t.toggleArchive(e)}},{label:`Leave group`,icon:(0,D.jsx)(vr,{size:14}),onSelect:()=>{n.onRequestLeave(e)}},{label:`Delete group`,icon:(0,D.jsx)(ni,{size:14}),danger:!0,onSelect:()=>{n.onRequestDelete(e)}}],EV=(e,t)=>{let n=t.find(t=>t.id===e.categoryId&&t.tenantId===e.tenantId);return n===void 0?t.find(t=>t.locked&&t.tenantId===e.tenantId)??null:n},DV=e=>{let t=Object.entries(e.data).filter(([e,t])=>e!==`statusColor`&&t!==``).map(([,e])=>e).slice(0,4);return t.length>0?t.join(` · `):e.subtitle},OV=(e,t)=>{let n=EV(e,t);if(n===null)return{icon:null,accent:e.color,pill:null,subtitle:e.subtitle};let r=t=>e.data[t]??``,i=n.fields.filter(e=>e.visible&&r(e.key)!==``);if(i.length===0)return{icon:n.icon,accent:n.accent,pill:null,subtitle:DV(e)};let a=i.find(e=>e.type===`pill`),o=i.filter(e=>e.type!==`pill`).slice(0,4).map(e=>r(e.key));return{icon:n.icon,accent:n.accent,pill:a===void 0?null:{value:r(a.key),color:e.data.statusColor??n.accent},subtitle:o.length>0?o.join(` · `):e.subtitle}},kV=4,AV={Hash:dr,GraduationCap:ur,Users:ai,Building2:Rn,Briefcase:Ln,BookOpen:Fn,Globe:lr},jV=({conversation:e,header:t,dmOnline:n})=>{let r=t?.icon??null,i=r===null?void 0:AV[r];return i===void 0?(0,D.jsxs)(`span`,{className:K.viewAvatarWrap,children:[(0,D.jsx)(`span`,{className:K.viewAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),n===!0&&(0,D.jsx)(`span`,{className:T(K.presenceDot,K.viewPresenceDot),"aria-label":`Online`})]}):(0,D.jsx)(`span`,{className:K.viewIcon,style:E({"--avatar-color":t?.accent??e.color}),children:(0,D.jsx)(i,{size:18})})},MV=({members:e})=>{if(e.length===0)return null;let t=e.length-kV;return(0,D.jsxs)(`div`,{className:K.memberStack,children:[e.slice(0,kV).map(e=>(0,D.jsx)(`span`,{className:K.memberAvatar,title:e.name,children:(0,D.jsx)(GE,{initials:e.initials,color:e.color,size:`xs`})},e.id)),t>0&&(0,D.jsxs)(`span`,{className:K.memberMore,children:[`+`,t]})]})},NV=(e,t)=>{let n=`${String(e.memberCount)} member${e.memberCount===1?``:`s`}`,r=t?.subtitle??e.subtitle;return r===``||r===e.title?n:`${n} · ${r}`},PV=({conversation:e,pill:t,presence:n,statusPill:r,subtitle:i})=>(0,D.jsxs)(`span`,{className:K.viewHeadText,children:[(0,D.jsxs)(`span`,{className:K.viewTitleRow,children:[(0,D.jsx)(`span`,{className:K.viewTitle,children:e.title}),e.admin&&(0,D.jsx)(`span`,{className:K.adminBadge,children:`You're admin`}),t?(0,D.jsx)(`span`,{className:K.statusPill,style:E({"--pill":t.color}),children:t.value}):null,n===null?null:(0,D.jsx)(nz,{untilUtc:e.statusUntilUtc,status:n}),r]}),(0,D.jsx)(`span`,{className:K.viewSub,children:i})]}),FV=({conversation:e,header:t,dmOnline:n,dmStatus:r,pill:i,statusPill:a,subtitle:o,actions:s,onManageMembers:c,onRequestDelete:l,onRequestLeave:u})=>{let d=Be();return(0,D.jsxs)(`div`,{className:K.standardHeader,children:[(0,D.jsx)(`button`,{type:`button`,className:K.backBtn,"aria-label":`Back to conversations`,onClick:()=>{d(`/comms/chats`)},children:(0,D.jsx)(jn,{size:18})}),(0,D.jsx)(jV,{conversation:e,header:t,dmOnline:n}),(0,D.jsx)(PV,{conversation:e,pill:i,presence:r,statusPill:a,subtitle:o}),e.isGroup&&(0,D.jsxs)(`div`,{className:K.headEnd,children:[(0,D.jsx)(`button`,{type:`button`,className:K.memberStackBtn,"aria-label":`Manage members`,onClick:c,children:(0,D.jsx)(MV,{members:e.members})}),(0,D.jsx)(FT,{align:`end`,trigger:(0,D.jsx)(`button`,{type:`button`,className:K.headMenuBtn,"aria-label":`Group options`,children:(0,D.jsx)(tr,{size:16})}),items:TV(e,s,{onManageMembers:c,onRequestDelete:l,onRequestLeave:u})})]}),(0,D.jsx)(nV,{conversation:e})]})},IV=({conversation:e,categories:t,actions:n,statusPill:r,onManageMembers:i,onRequestDelete:a,onRequestLeave:o,selectedMessage:s=null,onClearSelection:c,onReply:l,onStartEdit:u,onDelete:d})=>{let f=e.isGroup?OV(e,t):null,p=f?.pill??null,m=e.peerUserId,h=sV({conversation:e,live:vP(e=>m===null?void 0:e.presence[m]),liveStatus:kR(m),nowMs:Date.now()}),g=e.isGroup?NV(e,f):h.subtitle,_=s!==null;return(0,D.jsxs)(`header`,{className:T(K.viewHead,_&&K.hasMobileSelection),children:[s!==null&&(0,D.jsx)(wV,{selectedMessage:s,onClearSelection:c,onReply:l,onStartEdit:u,onDelete:d}),(0,D.jsx)(FV,{conversation:e,header:f,dmOnline:e.isGroup?null:h.online,dmStatus:e.isGroup?null:h.status,pill:p,statusPill:r,subtitle:g,actions:n,onManageMembers:i,onRequestDelete:a,onRequestLeave:o})]})},LV=({excludeIds:e,onAdd:t,onBack:n})=>{let{search:r,setSearch:i,results:a,loading:o,hasQuery:s}=kF(e,`groupPool`);return(0,D.jsxs)(`div`,{className:K.addPanel,children:[(0,D.jsxs)(`div`,{className:K.addPanelHead,children:[(0,D.jsx)(`button`,{type:`button`,className:K.memberRowMenuBtn,"aria-label":`Back to members`,onClick:n,children:(0,D.jsx)(jn,{size:15})}),(0,D.jsx)(`span`,{className:K.addPanelTitle,children:`Add member`})]}),(0,D.jsxs)(`div`,{className:K.addPanelSearch,children:[(0,D.jsx)(Hr,{size:14}),(0,D.jsx)(`input`,{className:K.searchInput,placeholder:`Search staff`,value:r,onChange:e=>{i(e.target.value)}}),o&&(0,D.jsx)(gi,{size:`sm`,label:`Searching staff`})]}),(0,D.jsxs)(`div`,{className:K.addPanelList,children:[(0,D.jsx)(Kg,{initial:!1,children:a.map(e=>(0,D.jsxs)(A.div,{layout:!0,variants:Vy,initial:`hidden`,animate:`visible`,exit:`exit`,className:K.memberRow,children:[(0,D.jsx)(`span`,{className:K.memberRowAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:K.memberRowBody,children:[(0,D.jsx)(`span`,{className:K.memberRowName,children:e.name}),(0,D.jsx)(`span`,{className:K.memberRowRole,children:e.role})]}),(0,D.jsxs)(`button`,{type:`button`,className:K.addMemberBtn,onClick:()=>{t(e)},children:[(0,D.jsx)(Pr,{size:13}),` Add`]})]},e.id))}),a.length===0&&!o&&(0,D.jsx)(`p`,{className:K.addPanelEmpty,children:s?`No staff match your search.`:`Everyone is already in this group.`})]})]})},RV=e=>{let{member:t,isAdmin:n,adminCount:r,onMakeAdmin:i,onRemoveAdmin:a,onRemove:o}=e,s=[];return n||s.push({label:`Make admin`,icon:(0,D.jsx)(Kr,{size:14}),onSelect:()=>{i(t.id)}}),n&&r>1&&s.push({label:`Remove admin`,icon:(0,D.jsx)(Gr,{size:14}),onSelect:()=>{a(t.id)}}),s.push({label:`Remove from group`,icon:(0,D.jsx)(ni,{size:14}),danger:!0,onSelect:()=>{o(t.id)}}),s},zV=({member:e})=>{let t=kR(e.id),n=t?.status??e.status??`offline`;return n===`offline`?null:(0,D.jsx)(nz,{status:n,untilUtc:t===void 0?e.statusUntilUtc??null:t.untilUtc})},BV=e=>{let{member:t,isAdmin:n,isSelf:r,isNew:i,isPromoted:a,isDemoted:o,canManage:s}=e,c=vP(e=>e.presence[t.id]?.online??!1);return(0,D.jsxs)(A.div,{layout:!0,variants:Vy,initial:`hidden`,animate:`visible`,className:T(K.memberRow,i&&K.memberRowNew),children:[(0,D.jsxs)(`span`,{className:K.memberRowAvatarWrap,children:[(0,D.jsx)(`span`,{className:K.memberRowAvatar,style:E({"--avatar-color":t.color}),children:t.initials}),c&&(0,D.jsx)(`span`,{className:K.presenceDot,"aria-label":`Online`})]}),(0,D.jsxs)(`span`,{className:K.memberRowBody,children:[(0,D.jsxs)(`span`,{className:K.memberRowName,children:[t.name,r&&(0,D.jsx)(`span`,{className:K.memberRowYou,children:` (You)`}),n?(0,D.jsx)(`span`,{className:K.memberBadgeAdmin,children:`ADMIN`}):(0,D.jsx)(`span`,{className:K.memberBadge,children:`MEMBER`}),i&&(0,D.jsx)(`span`,{className:K.memberPillNew,children:`+ NEW`}),a&&!i&&(0,D.jsx)(`span`,{className:K.memberPillUp,children:`↑ PROMOTED`}),o&&(0,D.jsx)(`span`,{className:K.memberPillDown,children:`↓ DEMOTED`})]}),(0,D.jsxs)(`span`,{className:K.memberRowRole,children:[t.role,(0,D.jsx)(zV,{member:t})]})]}),s&&!r&&(0,D.jsx)(FT,{align:`end`,trigger:(0,D.jsx)(`button`,{type:`button`,className:K.memberRowMenuBtn,"aria-label":`Actions for ${t.name}`,children:(0,D.jsx)(tr,{size:14})}),items:RV(e)})]})},VV=(e,t,n,r)=>{let i=e.map(e=>e.id),a=n.map(e=>e.id),o=a.filter(e=>!i.includes(e)),s=i.filter(e=>!a.includes(e)),c=r.filter(e=>!t.includes(e)&&a.includes(e)),l=t.filter(e=>!r.includes(e)&&a.includes(e));return{addedIds:o,removedIds:s,promotedIds:c,demotedIds:l,total:o.length+s.length+c.length+l.length}},HV=(e,t)=>t.some(t=>e.some(e=>e.id===t)),UV=e=>{let{addedIds:t,removedIds:n,promotedIds:r,demotedIds:i,total:a}=e;if(a===0)return`Save changes`;if(t.length===a)return t.length===1?`Add member`:`Add ${String(t.length)}`;if(n.length===a)return n.length===1?`Remove member`:`Remove ${String(n.length)}`;let o=r.length+i.length;return o===a?o===1?`Confirm`:`Confirm ${String(o)}`:`Save changes (${String(a)})`},WV=(e,t)=>{let[r,i]=(0,n.useState)(e.members),[a,o]=(0,n.useState)(e.adminIds),[s,c]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{t&&(i(e.members),o(e.adminIds),c(!1))},[t,e.id,e.members,e.adminIds]),{members:r,adminIds:a,adding:s,diff:VV(e.members,e.adminIds,r,a),adminCount:a.filter(e=>r.some(t=>t.id===e)).length,setAdding:c,addMember:e=>{i(t=>[...t,e]),c(!1)},removeMember:e=>{i(t=>t.filter(t=>t.id!==e)),o(t=>t.filter(t=>t!==e))},makeAdmin:e=>{o(t=>t.includes(e)?t:[...t,e])},removeAdmin:e=>{o(t=>t.filter(t=>t!==e))},undoRemove:e=>{i(t=>[...t,e])}}},GV=({member:e,onUndo:t})=>(0,D.jsxs)(`div`,{className:K.removedRow,children:[(0,D.jsx)(`span`,{className:K.memberRowAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:K.memberRowBody,children:[(0,D.jsx)(`span`,{className:K.removedName,children:e.name}),(0,D.jsx)(`span`,{className:K.memberRowRole,children:e.role})]}),(0,D.jsxs)(`button`,{type:`button`,className:K.undoBtn,onClick:t,children:[(0,D.jsx)(Vr,{size:12}),` Undo`]})]}),KV=e=>{let{conversation:t,draftMembers:n,draftAdminIds:r,diff:i,adminCount:a,iAmAdmin:o}=e,{viewerId:s}=e;return(0,D.jsxs)(`div`,{className:K.membersBody,children:[i.total>0&&(0,D.jsxs)(`div`,{className:K.unsavedBar,children:[i.total,` unsaved `,i.total===1?`change`:`changes`]}),o&&(0,D.jsxs)(`button`,{type:`button`,className:K.addMemberCta,onClick:e.onAddClick,children:[(0,D.jsx)(ii,{size:14}),` Add member`]}),(0,D.jsxs)(`div`,{className:K.membersSectionLabel,children:[`MEMBERS · `,n.length]}),(0,D.jsxs)(`div`,{className:K.membersList,children:[(0,D.jsx)(Kg,{initial:!1,children:n.map(t=>(0,D.jsx)(BV,{member:t,isAdmin:r.includes(t.id),isSelf:t.id===s,isNew:i.addedIds.includes(t.id),isPromoted:i.promotedIds.includes(t.id),isDemoted:i.demotedIds.includes(t.id),canManage:o,adminCount:a,onMakeAdmin:e.onMakeAdmin,onRemoveAdmin:e.onRemoveAdmin,onRemove:e.onRemove},t.id))}),i.removedIds.length>0&&(0,D.jsxs)(A.div,{variants:Vy,initial:`hidden`,animate:`visible`,children:[(0,D.jsxs)(`div`,{className:K.removedLabel,children:[`WILL BE REMOVED · `,i.removedIds.length]}),i.removedIds.map(n=>{let r=t.members.find(e=>e.id===n);return r===void 0?null:(0,D.jsx)(GV,{member:r,onUndo:()=>{e.onUndoRemove(r)}},n)})]})]})]})},qV=({diff:e,saving:t,onCancel:n,onSave:r})=>{let i=e.removedIds.length===e.total&&e.total>0;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(vi,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,D.jsx)(vi,{variant:i?`danger`:`primary`,isLoading:t,disabled:e.total===0,onClick:r,children:UV(e)})]})},JV=({conversation:e,open:t,onClose:n})=>{let r=yF(e.id),i=WV(e,t),{data:a}=uF(),o=a?.id??``,s=()=>{if(i.diff.total===0){n();return}if(!HV(i.members,i.adminIds)){j.error(`A group must keep at least one admin`);return}r.mutate({members:i.members,adminIds:i.adminIds},{onSuccess:()=>{j.success(`Members updated`),n()}})},c=i.members.length===1?`member`:`members`,l=i.adminCount===1?`admin`:`admins`;return(0,D.jsx)(Ky,{open:t,onOpenChange:e=>{e||n()},title:`Manage members`,description:`${e.title} · ${String(i.members.length)} ${c} · ${String(i.adminCount)} ${l}`,footer:i.adding?void 0:(0,D.jsx)(qV,{diff:i.diff,saving:r.isPending,onCancel:n,onSave:s}),children:i.adding?(0,D.jsx)(LV,{excludeIds:i.members.map(e=>e.id),onAdd:i.addMember,onBack:()=>{i.setAdding(!1)}}):(0,D.jsx)(KV,{conversation:e,draftMembers:i.members,draftAdminIds:i.adminIds,diff:i.diff,adminCount:i.adminCount,iAmAdmin:e.canManageMembers(o),viewerId:o,onAddClick:()=>{i.setAdding(!0)},onMakeAdmin:i.makeAdmin,onRemoveAdmin:i.removeAdmin,onRemove:i.removeMember,onUndoRemove:i.undoRemove})})},YV=({open:e,canDeleteForEveryone:t,onDeleteForMe:n,onDeleteForEveryone:r,onCancel:i})=>(0,D.jsx)(Ky,{open:e,onOpenChange:e=>{e||i()},title:`Delete message?`,footer:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(vi,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,D.jsx)(vi,{variant:`secondary`,onClick:n,children:`Delete for me`}),t&&(0,D.jsx)(vi,{variant:`danger`,onClick:r,children:`Delete for everyone`})]}),children:t?`Delete this message for everyone, or just remove it from this device?`:`This message can only be removed from this device — the time limit to delete it for everyone has passed.`}),XV=e=>e===1?`typing…`:`${String(e)} people typing…`,ZV=({conversationId:e})=>{let t=vP(t=>t.typingUserIds(e,Date.now()).length);return(0,D.jsx)(Kg,{children:t>0&&(0,D.jsxs)(A.div,{className:K.typingRow,variants:Uy,initial:`hidden`,animate:`visible`,exit:`exit`,children:[(0,D.jsxs)(`span`,{className:K.typingDots,"aria-hidden":!0,children:[(0,D.jsx)(`span`,{}),(0,D.jsx)(`span`,{}),(0,D.jsx)(`span`,{})]}),(0,D.jsx)(`span`,{className:K.typingText,children:XV(t)})]})})},QV=()=>{let e=vP(e=>e.status);if(e===`connected`||e===`connecting`)return null;let t=e===`reconnecting`?`Reconnecting…`:`Offline`;return(0,D.jsxs)(`span`,{className:K.connPill,children:[(0,D.jsx)(si,{size:12}),` `,t]})},$V=20*1024*1024,eH=(e,t,n)=>{let r=[],i=!1;for(let a of e){if(r.length>=t)break;if(a.size>n){i=!0;continue}r.push(a)}let a=e.reduce((e,t)=>e+ +(t.size<=n),0);return{accepted:r,skippedOversize:i,overflowed:a>t}},tH=()=>{let[e,t]=(0,n.useState)([]),r=(0,n.useRef)([]);return r.current=e,(0,n.useEffect)(()=>()=>{for(let e of r.current)e.previewUrl!==null&&URL.revokeObjectURL(e.previewUrl)},[]),{items:e,add:e=>{let n=10-r.current.length;if(n<=0){j.error(`You can attach up to 10 files at once.`);return}let{accepted:i,skippedOversize:a,overflowed:o}=eH(Array.from(e),n,$V);if(a&&j.error(`That file is over the 20 MB limit — please send a smaller file.`),o&&j.error(`You can attach up to 10 files at once.`),i.length===0)return;let s=i.map(e=>({id:crypto.randomUUID(),file:e,previewUrl:e.type.startsWith(`image/`)?URL.createObjectURL(e):null}));t(e=>[...e,...s])},remove:e=>{let n=r.current.find(t=>t.id===e);n!==void 0&&n.previewUrl!==null&&URL.revokeObjectURL(n.previewUrl),t(t=>t.filter(t=>t.id!==e))},clear:()=>{for(let e of r.current)e.previewUrl!==null&&URL.revokeObjectURL(e.previewUrl);t([])}}},nH=(e,t,n,r)=>{let i=()=>{n.current?.click()},a=()=>{e.items.length>0?(r.onSendMedia(e.items.map(e=>e.file),t),e.clear()):r.onSubmit()};return{openPicker:i,send:a,handleKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),a())},handlePaste:t=>{let n=t.clipboardData.files;n.length>0&&(t.preventDefault(),e.add(n))},onFileChange:t=>{t.target.files!==null&&t.target.files.length>0&&e.add(t.target.files);let r=n.current;r!==null&&(r.value=``)}}},rH=[`👍`,`🎉`,`❤️`,`😂`,`🙌`,`👏`],iH=[`😀`,`😄`,`😁`,`😂`,`😍`,`😎`,`🤝`,`🙏`,`👍`,`👏`,`🙌`,`🔥`,`🎉`,`⭐`,`✅`,`❤️`,`💡`,`📌`,`🚀`,`😢`],aH=({onPick:e})=>{let[t,r]=(0,n.useState)(!1);return(0,D.jsxs)(`div`,{className:K.emojiWrap,children:[(0,D.jsx)(`button`,{type:`button`,className:K.composerIcon,"aria-label":`Insert emoji`,"aria-expanded":t,onClick:()=>{r(e=>!e)},children:(0,D.jsx)(Yr,{size:18})}),(0,D.jsx)(Kg,{children:t&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:K.emojiBackdrop,"aria-label":`Close emoji picker`,onClick:()=>{r(!1)}}),(0,D.jsx)(A.div,{className:K.emojiPop,variants:Hy,initial:`hidden`,animate:`visible`,exit:`exit`,children:iH.map(t=>(0,D.jsx)(`button`,{type:`button`,className:K.emojiBtn,onClick:()=>{e(t),r(!1)},children:t},t))})]})})]})},oH=({replyTo:e,onClear:t})=>(0,D.jsxs)(`div`,{className:K.replyBar,children:[(0,D.jsxs)(`span`,{className:K.replyBarText,children:[`Replying to `,e.authorName,`: `,uV(e.text)]}),(0,D.jsx)(`button`,{type:`button`,className:K.replyBarClose,"aria-label":`Cancel reply`,onClick:t,children:(0,D.jsx)(ci,{size:16})})]}),sH=({attachments:e,onRemove:t,onAddMore:n})=>(0,D.jsxs)(A.div,{className:K.attachTray,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.16},children:[e.map(e=>(0,D.jsxs)(`div`,{className:K.attachItem,children:[e.previewUrl===null?(0,D.jsxs)(`div`,{className:K.attachFile,children:[(0,D.jsx)(sr,{size:20}),(0,D.jsx)(`span`,{className:K.attachFileName,children:e.file.name})]}):(0,D.jsx)(`img`,{className:K.attachThumb,src:e.previewUrl,alt:e.file.name}),(0,D.jsx)(`button`,{type:`button`,className:K.attachRemove,"aria-label":`Remove ${e.file.name}`,onClick:()=>{t(e.id)},children:(0,D.jsx)(ci,{size:13})})]},e.id)),(0,D.jsx)(`button`,{type:`button`,className:K.attachAdd,"aria-label":`Add more files`,onClick:n,children:(0,D.jsx)(Pr,{size:20})})]}),cH=({fileRef:e,onAttach:t,onFileChange:n})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`input`,{ref:e,type:`file`,multiple:!0,className:K.hiddenFileInput,accept:`image/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip`,onChange:n}),(0,D.jsx)(`button`,{type:`button`,className:K.composerIcon,"aria-label":`Attach files`,onClick:t,children:(0,D.jsx)(Er,{size:18})})]}),lH=({value:e,title:t,hasAttachments:n,isSending:r,canSend:i,fileRef:a,onChange:o,onTyping:s,onKeyDown:c,onPaste:l,onAttach:u,onFileChange:d,onSend:f})=>{let p=mi(`(max-width: 1024px)`),m=pi(e,4e3);return(0,D.jsxs)(`div`,{className:K.composer,children:[(0,D.jsx)(aH,{onPick:t=>{o(e+t)}}),(0,D.jsx)(cH,{fileRef:a,onAttach:u,onFileChange:d}),(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,D.jsx)(`textarea`,{className:T(K.composerInput,m.isOverLimit&&K.composerInputError),rows:1,placeholder:n?`Add a caption…`:p?`Message ${t}…`:`Message ${t}… (Shift+Enter for new line)`,value:e,onChange:e=>{o(e.target.value),s()},onKeyDown:c,onPaste:l}),m.showCounter&&(0,D.jsxs)(`div`,{style:{alignSelf:`flex-end`,fontSize:`10px`,color:m.counterColor===`danger`?`var(--color-danger)`:`var(--color-text-soft)`,marginRight:`8px`,fontWeight:500},children:[m.length,` / 4000`]})]}),(0,D.jsx)(`button`,{type:`button`,className:K.sendBtn,"aria-label":n?`Send attachments`:`Send message`,disabled:r||!i||m.isOverLimit,onClick:f,children:(0,D.jsx)(Ur,{size:16})})]})},uH=({editingText:e,onClear:t})=>(0,D.jsxs)(`div`,{className:K.replyBar,children:[(0,D.jsx)(kr,{size:15,style:{marginRight:6}}),(0,D.jsxs)(`span`,{className:K.replyBarText,children:[`Editing message: `,uV(e)]}),(0,D.jsx)(`button`,{type:`button`,className:K.replyBarClose,"aria-label":`Cancel edit`,onClick:t,children:(0,D.jsx)(ci,{size:16})})]}),dH=({value:e,isSending:t,title:r,replyTo:i,editingMessage:a=null,onChange:o,onSubmit:s,onClearReply:c,onClearEditing:l,onSendMedia:u,onTyping:d})=>{let f=(0,n.useRef)(null),p=tH(),m=p.items.length>0,h=m||e.trim().length>0,{openPicker:g,send:_,handleKeyDown:v,handlePaste:y,onFileChange:b}=nH(p,e,f,{onSubmit:s,onSendMedia:u});return(0,D.jsxs)(D.Fragment,{children:[a!==null&&l!==void 0&&(0,D.jsx)(uH,{editingText:a.text,onClear:l}),i!==null&&(0,D.jsx)(oH,{replyTo:i,onClear:c}),m&&(0,D.jsx)(sH,{attachments:p.items,onRemove:p.remove,onAddMore:g}),(0,D.jsx)(lH,{value:e,title:r,hasAttachments:m,isSending:t,canSend:h,fileRef:f,onChange:o,onTyping:d,onKeyDown:v,onPaste:y,onAttach:g,onFileChange:b,onSend:_})]})},fH=({conversation:e,conversationId:t,text:n,replyTo:r,editingMessage:i=null,isSending:a,onChange:o,onSubmit:s,onClearReply:c,onClearEditing:l,onSendMedia:u,onTyping:d})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(ZV,{conversationId:t}),(0,D.jsx)(dH,{value:n,isSending:a,title:e.title,replyTo:r,editingMessage:i,onChange:o,onSubmit:s,onClearReply:c,onClearEditing:l,onSendMedia:u,onTyping:d})]}),pH=(e,t,n,r)=>(e[t]?.[n]??0)>=r,mH=(e,t,n)=>pH(t,e,`read`,n)?`read`:pH(t,e,`delivered`,n)?`delivered`:`sent`,hH=(e,t,n)=>e.length===0?`sent`:e.every(e=>pH(t,e,`read`,n))?`read`:e.every(e=>pH(t,e,`delivered`,n))?`delivered`:`sent`,gH=(e,t)=>t.peerUserId===null?hH(t.otherMemberIds,t.receipts,e.sequence):mH(t.peerUserId,t.receipts,e.sequence),_H=(e,t)=>{if(t.length===0)return e;let n=new Map;for(let r of[...t,...e])n.set(r.id,r);return[...n.values()].sort((e,t)=>e.sequence-t.sequence)},vH=e=>{let t=e[0];return t===void 0?null:e.reduce((e,t)=>Math.min(e,t.sequence),t.sequence)},yH=e=>{let{getMessagesBefore:t}=LP(),r=sN(),[i,a]=(0,n.useState)(!0),[o,s]=(0,n.useState)(!1),c=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{a(!0),s(!1),c.current=!1},[e]),{loadOlder:(0,n.useCallback)(()=>{if(e===null||c.current||!i)return;let n=cF(e),o=vH(r.getQueryData(n)??[]);o!==null&&(c.current=!0,s(!0),P(t.execute(e,o,50)).then(e=>{r.setQueryData(n,t=>_H(t??[],e)),e.length<50&&a(!1)}).catch(()=>{}).finally(()=>{c.current=!1,s(!1)}))},[e,t,i,r]),hasMore:i,isLoadingOlder:o}},bH=80,xH=60,SH={tailKey:``,headKey:``,count:0,lastFromViewer:!1},CH=e=>{let t=e.at(-1);return{tailKey:t?.id??``,headKey:e[0]?.id??``,count:e.length,lastFromViewer:t?.fromViewer??!1}},wH=(e,t)=>{e!==null&&e.scrollTo({top:e.scrollHeight,behavior:t?`smooth`:`auto`})},TH=(e,t,r)=>{let i=(0,n.useRef)(null),[a,o]=(0,n.useState)(!0),[s,c]=(0,n.useState)(!1),l=(0,n.useRef)(SH),u=(0,n.useRef)(!0),d=(0,n.useRef)(null),f=(0,n.useRef)(r);f.current=r;let p=(0,n.useCallback)(e=>{wH(i.current,e),c(!1)},[]),m=(0,n.useCallback)(()=>{let e=i.current;if(e===null)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<bH;u.current=t,o(t),t&&c(!1),e.scrollTop<xH&&(d.current=e.scrollHeight,f.current())},[]);return(0,n.useLayoutEffect)(()=>{l.current=SH,u.current=!0,d.current=null,o(!0),c(!1)},[e]),(0,n.useLayoutEffect)(()=>{let e=CH(t),n=l.current;l.current=e;let r=i.current;if(e.tailKey===``||r===null)return;if(n.tailKey===``){wH(r,!1);return}let a=e.count>n.count,o=a&&e.tailKey!==n.tailKey;a&&e.headKey!==n.headKey&&d.current!==null&&(r.scrollTop+=r.scrollHeight-d.current,d.current=null),o&&(u.current||e.lastFromViewer)?(wH(r,!0),c(!1)):o&&c(!0)},[t]),(0,n.useEffect)(()=>{m()},[m]),{scrollRef:i,isAtBottom:a,hasNewBelow:s,scrollToBottom:p,onScroll:m}},EH={card:`_card_1bdwl_1`,header:`_header_1bdwl_29`,body:`_body_1bdwl_43`,authorRow:`_authorRow_1bdwl_47`,avatar:`_avatar_1bdwl_54`,authorInfo:`_authorInfo_1bdwl_68`,authorName:`_authorName_1bdwl_73`,category:`_category_1bdwl_80`,catDot:`_catDot_1bdwl_90`,title:`_title_1bdwl_97`,snippet:`_snippet_1bdwl_105`,footer:`_footer_1bdwl_116`},DH=/\/feed\/posts\/([a-zA-Z0-9-]+)$/,OH=({title:e,body:t,authorName:n,authorInitials:r,authorColor:i,categoryLabel:a,categoryColor:o,link:s})=>{let c=Be();return(0,D.jsxs)(`button`,{type:`button`,onClick:e=>{e.preventDefault();let t=DH.exec(s);if(t?.[1]!==void 0){let e=t[1];c(`/comms/feed?postId=${e}`)}else (s.startsWith(`/`)||s.toLowerCase().startsWith(`http://`)||s.toLowerCase().startsWith(`https://`))&&window.open(s,`_blank`,`noopener,noreferrer`)},className:EH.card,style:{textAlign:`left`},children:[(0,D.jsxs)(`div`,{className:EH.header,children:[(0,D.jsx)(Tr,{size:10}),`Shared from News Feed`]}),(0,D.jsxs)(`div`,{className:EH.body,children:[(0,D.jsxs)(`div`,{className:EH.authorRow,children:[(0,D.jsx)(`span`,{className:EH.avatar,style:E({"--avatar-color":i}),children:r}),(0,D.jsxs)(`div`,{className:EH.authorInfo,children:[(0,D.jsx)(`div`,{className:EH.authorName,children:n}),a!==null&&o!==null&&(0,D.jsxs)(`div`,{className:EH.category,style:E({"--cat-color":o}),children:[(0,D.jsx)(`span`,{className:EH.catDot}),a]})]})]}),(0,D.jsx)(`div`,{className:EH.title,children:e}),(0,D.jsx)(`div`,{className:EH.snippet,children:t}),(0,D.jsx)(`div`,{className:EH.footer,children:`Open in News Feed >`})]})]})},kH=e=>e.startsWith(`blob:`),AH=e=>e.type.length>0?URL.createObjectURL(e):URL.createObjectURL(new Blob([e],{type:`image/jpeg`})),jH=e=>{let{downloadChatMedia:t}=LP(),[r,i]=(0,n.useState)(!1),a=e!==null&&kH(e),o=e!==null&&!a?e:null,s=SN({queryKey:[`chat-media`,o],queryFn:()=>P(t.execute(o??``)),enabled:o!==null&&o.length>0,staleTime:1/0,gcTime:12e4,retry:1}),[c,l]=(0,n.useState)(null);(0,n.useEffect)(()=>{i(!1),l(null)},[e]),(0,n.useEffect)(()=>{let e=s.data;if(e===void 0)return;let t=AH(e);return l(t),()=>{URL.revokeObjectURL(t)}},[s.data]);let u=(0,n.useCallback)(()=>{i(!0)},[]);if(a)return{src:r?null:e,isLoading:!1,isError:r,onImageError:u};let d=s.isPending||s.isFetching;return{src:r?null:c,isLoading:d,isError:s.isError||r,onImageError:u}},MH=PE(e=>({open:!1,urls:[],index:0,openViewer:(t,n)=>{t.length!==0&&e({open:!0,urls:t,index:Math.max(0,Math.min(n,t.length-1))})},close:()=>{e({open:!1})},next:()=>{e(e=>({index:Math.min(e.index+1,e.urls.length-1)}))},prev:()=>{e(e=>({index:Math.max(e.index-1,0)}))}})),NH=({mediaUrl:e,album:t,index:n=0})=>{let{src:r,isLoading:i,isError:a,onImageError:o}=jH(e),s=MH(e=>e.openViewer);return a?(0,D.jsxs)(`div`,{className:K.msgMediaFallback,children:[(0,D.jsx)(fr,{size:18}),(0,D.jsx)(`span`,{children:`Image unavailable`})]}):r===null||i?(0,D.jsx)(`div`,{className:K.msgMediaLoading,children:(0,D.jsx)(gi,{size:`sm`})}):(0,D.jsx)(`button`,{type:`button`,className:T(K.mediaButton,t!==void 0&&K.mediaButtonFill),"aria-label":`Open image preview`,onClick:()=>{s(t??[e],n)},children:(0,D.jsx)(`img`,{className:K.msgMedia,src:r,alt:``,onError:o})})},PH=e=>(e??``).toLowerCase().split(`.`).pop()??``,FH=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`svg`,`avif`,`heic`],IH=(e,t)=>e!==null&&e.length>0?e.startsWith(`image/`):FH.includes(PH(t)),LH={pdf:`pdf`,zip:`archive`,rar:`archive`,"7z":`archive`,gz:`archive`,tar:`archive`,doc:`document`,docx:`document`,txt:`document`,rtf:`document`,odt:`document`,xls:`spreadsheet`,xlsx:`spreadsheet`,csv:`spreadsheet`,ods:`spreadsheet`,ppt:`presentation`,pptx:`presentation`,odp:`presentation`,mp3:`audio`,wav:`audio`,ogg:`audio`,m4a:`audio`,aac:`audio`,mp4:`video`,mov:`video`,webm:`video`,mkv:`video`,avi:`video`},RH=e=>{if(e===`application/pdf`)return`pdf`;if(e.startsWith(`audio/`))return`audio`;if(e.startsWith(`video/`))return`video`;if(e.startsWith(`text/`))return`document`;if(/zip|compressed|tar/.test(e))return`archive`;if(/spreadsheet|excel/.test(e))return`spreadsheet`;if(/presentation|powerpoint/.test(e))return`presentation`;if(e.includes(`word`))return`document`},zH=(e,t)=>IH(e,t)?`image`:RH(e??``)??LH[PH(t)]??`generic`,BH={image:`Image`,pdf:`PDF Document`,archive:`Archive`,document:`Document`,spreadsheet:`Spreadsheet`,presentation:`Presentation`,audio:`Audio`,video:`Video`,generic:`File`},VH=e=>BH[e],HH={image:ir,pdf:sr,archive:nr,document:sr,spreadsheet:or,presentation:Fr,audio:rr,video:ar,generic:cr},UH=(e,t)=>{let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t.length>0?t:`download`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)},WH=({mediaUrl:e,contentType:t,fileName:r,fromViewer:i})=>{let{downloadChatMedia:a}=LP(),[o,s]=(0,n.useState)(!1),c=zH(t,r),l=HH[c],u=r!==null&&r.length>0?r:`Attachment`,d=(0,n.useCallback)(()=>{s(!0),a.execute(e).then(e=>{s(!1),e.ok?UH(e.value,u):j.error(`Could not download the file.`)})},[a,e,u]);return(0,D.jsxs)(`button`,{type:`button`,className:T(K.fileCard,i?K.fileCardMe:K.fileCardThem),onClick:d,disabled:o,"aria-label":`Download ${u}`,children:[(0,D.jsx)(`span`,{className:K.fileCardIcon,children:(0,D.jsx)(l,{size:22})}),(0,D.jsxs)(`span`,{className:K.fileCardInfo,children:[(0,D.jsx)(`span`,{className:K.fileCardName,children:u}),(0,D.jsx)(`span`,{className:K.fileCardMetaLabel,children:VH(c)})]}),(0,D.jsx)(`span`,{className:K.fileCardDownload,children:o?(0,D.jsx)(gi,{size:`sm`}):(0,D.jsx)(er,{size:16})})]})},GH=({tick:e})=>e===`read`?(0,D.jsx)(`span`,{className:T(K.tick,K.tickRead),"aria-label":`Read`,children:(0,D.jsx)(Un,{size:13})}):e===`delivered`?(0,D.jsx)(`span`,{className:K.tick,"aria-label":`Delivered`,children:(0,D.jsx)(Un,{size:13})}):(0,D.jsx)(`span`,{className:K.tick,"aria-label":`Sent`,children:(0,D.jsx)(Wn,{size:13})}),KH=({message:e,pending:t,tick:n,onRetry:r})=>t===`sending`?(0,D.jsx)(`span`,{className:K.tick,"aria-label":`Sending`,children:(0,D.jsx)(Qn,{size:13})}):t===`failed`?(0,D.jsxs)(`span`,{className:K.sendFailed,children:[(0,D.jsx)(`span`,{className:K.sendFailedText,children:`Not delivered`}),(0,D.jsx)(`button`,{type:`button`,className:K.retryBtn,onClick:()=>{e.clientMessageId!==null&&r(e.clientMessageId,e.text)},children:`Retry`})]}):n===null?null:(0,D.jsx)(GH,{tick:n}),qH=({initial:e,onSave:t})=>{let[r,i]=(0,n.useState)(e);return(0,D.jsxs)(`span`,{className:K.msgActions,children:[(0,D.jsx)(`input`,{className:K.composerInput,value:r,onChange:e=>{i(e.target.value)}}),(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{r.trim().length>0&&t(r.trim())},children:`Save`})]})},JH=({message:e,fromViewer:t,onReply:r,onEdit:i,onDelete:a,resolvedReplyTo:o=null})=>{let[s,c]=(0,n.useState)(!1),l=dV(e,o);return _V(e)?(0,D.jsx)(`span`,{className:K.msgActions}):t?s?(0,D.jsx)(qH,{initial:e.text,onSave:t=>{i(e.id,t),c(!1)}}):(0,D.jsxs)(`span`,{className:K.msgActions,children:[(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{r(l)},children:`Reply`}),e.canEdit(Date.now())&&(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{c(!0)},children:`Edit`}),(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{a(e.id)},children:`Delete`})]}):(0,D.jsx)(`span`,{className:K.msgActions,children:(0,D.jsx)(`button`,{type:`button`,className:K.msgActionBtn,onClick:()=>{r(l)},children:`Reply`})})},YH=`This message was deleted`,XH=({message:e})=>{let t=e.mediaUrl;return t===null||t.length===0?null:IH(e.mediaContentType,e.mediaFileName)?(0,D.jsx)(NH,{mediaUrl:t}):(0,D.jsx)(WH,{mediaUrl:t,contentType:e.mediaContentType,fileName:e.mediaFileName,fromViewer:e.fromViewer})},ZH=({replyTo:e})=>{let t=lV(e.text);if(t!==null)return(0,D.jsx)(`div`,{style:{marginBottom:6,display:`block`,width:`100%`},children:(0,D.jsx)(OH,{...t.card})});let n=e.text.trim().length>0;return(0,D.jsxs)(`span`,{className:K.replyPreview,children:[e.authorName.length>0&&(0,D.jsx)(`span`,{className:K.replyPreviewAuthor,children:e.authorName}),(0,D.jsx)(`span`,{className:K.replyPreviewText,children:n?uV(e.text):`Message`})]})},QH=({message:e,fromViewer:t,deletedForEveryone:n,pending:r,tick:i,onRetry:a})=>{let o=JN();return(0,D.jsxs)(`span`,{className:K.msgMeta,children:[(0,D.jsx)(`span`,{className:K.msgTime,children:MP(e.sentAt,o.display)||e.time}),!n&&e.isEdited&&(0,D.jsx)(`span`,{className:K.editedLabel,children:`edited`}),t&&(e.kind===`text`||e.kind===`media`)&&(0,D.jsx)(KH,{message:e,pending:r,tick:i,onRetry:a})]})},$H=/(https?:\/\/[^\s]+)/g,eU=({text:e})=>e?(0,D.jsx)(D.Fragment,{children:e.split($H).map((e,t)=>e.match($H)?(0,D.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:K.msgLink,children:e},t):(0,D.jsx)(n.Fragment,{children:e},t))}):(0,D.jsx)(D.Fragment,{children:e}),tU=({sharedComment:e,sharedCardProps:t})=>(0,D.jsxs)(D.Fragment,{children:[e.length>0&&(0,D.jsx)(`span`,{className:T(K.msgText,K.msgTextWithCard),children:(0,D.jsx)(eU,{text:e})}),(0,D.jsx)(OH,{...t})]}),nU=({messageText:e,deletedForEveryone:t})=>(0,D.jsx)(`span`,{className:T(K.msgText,t&&K.msgTextDeleted),children:t?YH:(0,D.jsx)(eU,{text:e})}),rU=({message:e,authorName:t,showAuthor:n,replyTo:r,fromViewer:i,deletedForEveryone:a,pending:o,tick:s,onRetry:c,isSelected:l,onSelect:u})=>{let d=a?null:lV(e.text);return(0,D.jsxs)(`div`,{className:T(K.bubble,i?K.bubbleMe:K.bubbleThem,l&&K.bubbleSelected),onClick:()=>{u!==void 0&&u(e)},children:[n&&(0,D.jsx)(`span`,{className:K.msgAuthor,children:t}),!a&&r!==null&&(0,D.jsx)(ZH,{replyTo:r}),!a&&(0,D.jsx)(XH,{message:e}),d===null?(0,D.jsx)(nU,{messageText:e.text,deletedForEveryone:a}):(0,D.jsx)(tU,{sharedComment:d.comment,sharedCardProps:d.card}),(0,D.jsx)(QH,{message:e,fromViewer:i,deletedForEveryone:a,pending:o,tick:s,onRetry:c})]})},iU=({message:e,identity:t,replyTo:n,isSelected:r,onSelect:i,showAvatar:a,showAuthor:o,tick:s,pending:c,onRetry:l,onReply:u,onEdit:d,onDelete:f,quickReact:p,reactions:m})=>{let{fromViewer:h,deletedForEveryone:g}=e,_=!_V(e)&&!g,v=m!==null;return(0,D.jsxs)(D.Fragment,{children:[!h&&(a?(0,D.jsx)(`span`,{className:K.msgAvatar,style:E({"--avatar-color":t.color}),children:t.initials}):(0,D.jsx)(`span`,{className:K.msgAvatarSpacer,"aria-hidden":`true`})),(0,D.jsx)(`div`,{className:T(K.msgCol,v&&K.msgColWithReactions),children:(0,D.jsxs)(`div`,{className:K.msgBubbleWrap,children:[(0,D.jsx)(rU,{message:e,authorName:t.name,showAuthor:o,replyTo:n,fromViewer:h,deletedForEveryone:g,pending:c,tick:s,onRetry:l,isSelected:r,onSelect:i}),v&&m,_&&p,_&&(0,D.jsx)(JH,{message:e,fromViewer:h,onReply:u,onEdit:d,onDelete:f,resolvedReplyTo:n})]})})]})},aU=e=>e.trim().toLowerCase(),oU=(e,t)=>aU(e)===aU(t),sU=(e,t)=>{if(e.fromViewer)return{name:e.authorName,initials:e.authorInitials,color:e.authorColor};let n=t.members.find(t=>oU(t.id,e.senderId));return n===void 0?t.kind===`dm`&&t.peerUserId!==null&&oU(t.peerUserId,e.senderId)?{name:t.title,initials:t.initials,color:t.color}:{name:e.authorName,initials:e.authorInitials,color:e.authorColor}:{name:n.name,initials:n.initials,color:n.color}},cU=({align:e,onPick:t})=>{let[r,i]=(0,n.useState)(!1);return(0,D.jsxs)(`div`,{className:K.reactWrap,children:[(0,D.jsx)(`button`,{type:`button`,className:K.reactBtn,"aria-label":`Add reaction`,onClick:()=>{i(e=>!e)},children:(0,D.jsx)(Jr,{size:14})}),(0,D.jsx)(Kg,{children:r&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:K.emojiBackdrop,"aria-label":`Close reaction picker`,onClick:()=>{i(!1)}}),(0,D.jsx)(A.div,{className:T(K.reactPop,e===`right`?K.reactPopRight:K.reactPopLeft),variants:Hy,initial:`hidden`,animate:`visible`,exit:`exit`,children:rH.map(e=>(0,D.jsx)(`button`,{type:`button`,className:K.reactPopBtn,onClick:()=>{t(e),i(!1)},children:e},e))})]})})]})},lU=({message:e,onReact:t,fromViewer:n})=>{let r=e.reactions.reduce((e,t)=>e+t.count,0);if(r===0)return null;let i=e.reactions.find(e=>e.reacted);return(0,D.jsxs)(`button`,{type:`button`,className:T(K.reactionPill,n?K.reactionsMe:K.reactionsThem,i!==void 0&&K.reactionPillActive),onClick:()=>{if(i!==void 0)t(e.id,i.emoji);else if(e.reactions.length>0){let n=e.reactions[0]?.emoji;n!==void 0&&t(e.id,n)}},"aria-label":`Reactions`,children:[(0,D.jsx)(`span`,{className:K.reactionEmojis,children:e.reactions.map(e=>e.emoji).join(``)}),r>1&&(0,D.jsx)(`span`,{className:K.reactionCount,children:r})]})},uU=({text:e})=>(0,D.jsx)(A.div,{className:K.systemRow,variants:Vy,initial:`hidden`,animate:`visible`,children:(0,D.jsx)(`span`,{className:K.systemPill,children:e})}),dU=(e,t,n)=>!e.deletedForEveryone&&e.reactions.length>0?(0,D.jsx)(lU,{message:e,onReact:n,fromViewer:t}):null,fU=({conversation:e,message:t,layoutStatic:n=!1,firstOfGroup:r=!0,lastOfGroup:i=!0,replyTo:a,isSelected:o,onSelect:s,onReact:c,tick:l,pending:u,onRetry:d,onReply:f,onEdit:p,onDelete:m})=>{if(t.isSystem)return(0,D.jsx)(uU,{text:t.text});let{fromViewer:h}=t,g=sU(t,e),_=T(K.msgRow,h&&K.msgRowMe,r&&K.msgRowGroupStart),v=(0,D.jsx)(iU,{message:t,identity:g,replyTo:a??t.replyTo,isSelected:o,onSelect:s,showAvatar:i,showAuthor:r&&e.isGroup,tick:l,pending:u,onRetry:d,onReply:f,onEdit:p,onDelete:m,quickReact:(0,D.jsx)(cU,{align:h?`right`:`left`,onPick:e=>{c(t.id,e)}}),reactions:dU(t,h,c)});return n?(0,D.jsx)(`div`,{id:`msg-${t.id}`,className:_,children:v}):(0,D.jsx)(A.div,{id:`msg-${t.id}`,className:_,variants:Vy,initial:`hidden`,animate:`visible`,whileHover:{y:-1,scale:1.005},transition:{type:`spring`,stiffness:500,damping:30},children:v})},pU=()=>void 0,mU=e=>e.find(e=>e.text.trim().length>0)?.text??``,hU=({fromViewer:e,lastOfGroup:t,identity:n})=>e?null:t?(0,D.jsx)(`span`,{className:K.msgAvatar,style:E({"--avatar-color":n.color}),children:n.initials}):(0,D.jsx)(`span`,{className:K.msgAvatarSpacer,"aria-hidden":`true`}),gU=({message:e,onReact:t,onReply:n,onDelete:r})=>(0,D.jsxs)(`div`,{className:K.albumCellActions,children:[(0,D.jsx)(cU,{align:e.fromViewer?`right`:`left`,onPick:n=>{t(e.id,n)}}),(0,D.jsx)(`button`,{type:`button`,className:K.albumActionBtn,"aria-label":`Reply`,onClick:()=>{n(dV(e))},children:(0,D.jsx)(Br,{size:13})}),e.fromViewer&&(0,D.jsx)(`button`,{type:`button`,className:K.albumActionBtn,"aria-label":`Delete`,onClick:()=>{r(e.id)},children:(0,D.jsx)(ni,{size:13})})]}),_U=e=>{let{message:t,album:n,index:r}=e,i=!_V(t)&&!t.deletedForEveryone,a=!t.deletedForEveryone&&t.reactions.length>0;return(0,D.jsxs)(`div`,{id:`msg-${t.id}`,className:K.albumCell,children:[(0,D.jsx)(`div`,{className:K.albumCellMedia,children:t.mediaUrl!==null&&t.mediaUrl.length>0&&(0,D.jsx)(NH,{mediaUrl:t.mediaUrl,album:n,index:r})}),i&&(0,D.jsx)(gU,{...e}),a&&(0,D.jsx)(`div`,{className:K.albumCellReactions,children:(0,D.jsx)(lU,{message:t,onReact:e.onReact,fromViewer:t.fromViewer})})]})},vU=({last:e,fromViewer:t,tick:n,pending:r})=>{let i=JN();return(0,D.jsxs)(`span`,{className:K.msgMeta,children:[(0,D.jsx)(`span`,{className:K.msgTime,children:MP(e.sentAt,i.display)||e.time}),t&&(0,D.jsx)(KH,{message:e,pending:r,tick:n,onRetry:pU})]})},yU=({conversation:e,messages:t,firstOfGroup:n,lastOfGroup:r,tick:i,pending:a,onReact:o,onReply:s,onDelete:c})=>{let l=t.at(0),u=t.at(-1);if(l===void 0||u===void 0)return(0,D.jsx)(D.Fragment,{});let{fromViewer:d}=l,f=sU(l,e),p=mU(t),m=n&&e.isGroup,h=t.map(e=>e.mediaUrl??``);return(0,D.jsxs)(`div`,{id:`msg-${u.id}`,className:T(K.msgRow,d&&K.msgRowMe,n&&K.msgRowGroupStart),children:[(0,D.jsx)(hU,{fromViewer:d,lastOfGroup:r,identity:f}),(0,D.jsx)(`div`,{className:K.msgCol,children:(0,D.jsx)(`div`,{className:K.msgBubbleWrap,children:(0,D.jsxs)(`div`,{className:T(K.bubble,d?K.bubbleMe:K.bubbleThem),children:[m&&(0,D.jsx)(`span`,{className:K.msgAuthor,children:f.name}),(0,D.jsx)(`div`,{className:K.albumGrid,children:t.map((e,t)=>(0,D.jsx)(_U,{message:e,album:h,index:t,onReact:o,onReply:s,onDelete:c},e.id))}),p.length>0&&(0,D.jsx)(`span`,{className:K.msgText,children:p}),(0,D.jsx)(vU,{last:u,fromViewer:d,tick:i,pending:a})]})})})]})},bU=(e,t)=>{if(e.length===0)return null;let n=kP(e);if(Number.isNaN(n.getTime()))return null;if(t&&t.length>0){let e=VN(n,t),r=String(e.month).padStart(2,`0`),i=String(e.day).padStart(2,`0`);return`${String(e.year)}-${r}-${i}`}let r=String(n.getMonth()+1).padStart(2,`0`),i=String(n.getDate()).padStart(2,`0`);return`${String(n.getFullYear())}-${r}-${i}`},xU=(e,t)=>{let[n,r,i]=e.split(`-`);return new Date(Date.UTC(Number(n),Number(r)-1,Number(i))).toLocaleDateString(`en-US`,{weekday:`short`,day:`numeric`,month:`short`,year:`numeric`,timeZone:`UTC`})},SU=(e,t)=>!e.isSystem&&!t.isSystem&&e.senderId===t.senderId,CU=(e,t)=>{let n=[],r=null;return e.forEach((i,a)=>{let o=bU(i.sentAt,t),s=o!==null&&o!==r;s&&n.push({kind:`date`,key:`date:${o}`,label:xU(o,t)}),r=o??r;let c=e[a-1],l=e[a+1],u=s||c===void 0||!SU(c,i),d=l===void 0||!SU(i,l)||bU(l.sentAt,t)!==o;n.push({kind:`message`,key:i.id,row:{message:i,firstOfGroup:u,lastOfGroup:d}})}),n},wU=2,TU=e=>e.kind===`message`&&e.row.message.kind===`media`&&!e.row.message.isSystem&&!e.row.message.deletedForEveryone&&(e.row.message.mediaUrl??``).length>0&&IH(e.row.message.mediaContentType,e.row.message.mediaFileName),EU=e=>e.kind===`message`&&e.row.message.kind===`media`&&!e.row.message.isSystem&&e.row.message.deletedForEveryone,DU=e=>TU(e)||EU(e),OU=(e,t,n)=>({kind:`album`,key:`album:${(e[0]??t).row.message.id}`,messages:e.map(e=>e.row.message),firstOfGroup:t.row.firstOfGroup,lastOfGroup:n.row.lastOfGroup}),kU=(e,t,n)=>({kind:`message`,key:e.key,row:{message:e.row.message,firstOfGroup:t.row.firstOfGroup,lastOfGroup:n.row.lastOfGroup}}),AU=(e,t)=>{let n=e[0],r=e[e.length-1];if(n===void 0||r===void 0)return;let i=e.filter(TU);if(i.length>=wU){t.push(OU(i,n,r));return}if(i.length===1&&i[0]!==void 0){t.push(kU(i[0],n,r));return}t.push(kU(n,n,r))},jU=e=>{let t=[],n=[];for(let r of e){if(DU(r)){let e=n.at(-1);e!==void 0&&e.row.message.senderId!==r.row.message.senderId&&(AU(n,t),n=[]),n.push(r);continue}AU(n,t),n=[],t.push(r)}return AU(n,t),t},MU=(e,t)=>!(e.fromViewer&&(e.kind===`text`||e.kind===`media`))||e.clientMessageId===null?null:t[e.clientMessageId]??null,NU=({label:e})=>(0,D.jsx)(`div`,{className:K.dateSep,children:(0,D.jsx)(`span`,{className:K.dateSepPill,children:e})}),PU=({conversation:e,messages:t,pending:r,selectedMessageId:i,onSelectMessage:a,onReact:o,onRetry:s,onReply:c,onEdit:l,onDelete:u,tickFor:d})=>{let f=JN(),p=(0,n.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]);return(0,D.jsx)(D.Fragment,{children:jU(CU(t,f.display)).map(t=>{if(t.kind===`date`)return(0,D.jsx)(NU,{label:t.label},t.key);if(t.kind===`album`){let n=t.messages.at(-1);return(0,D.jsx)(yU,{conversation:e,messages:t.messages,firstOfGroup:t.firstOfGroup,lastOfGroup:t.lastOfGroup,tick:n===void 0?null:d(n),pending:n===void 0?null:MU(n,r),onReact:o,onReply:c,onDelete:u},t.key)}return(0,D.jsx)(fU,{layoutStatic:!0,firstOfGroup:t.row.firstOfGroup,lastOfGroup:t.row.lastOfGroup,conversation:e,message:t.row.message,isSelected:i===t.row.message.id,onSelect:a,replyTo:pV(t.row.message.replyTo,p),onReact:o,pending:MU(t.row.message,r),tick:d(t.row.message),onRetry:s,onReply:c,onEdit:l,onDelete:u},t.key)})})},FU={id:`u-shamim`,name:`Shamim Rahman`,initials:`SR`,color:`#e9445a`},IU=`t-uapp`,LU={id:`u-andreea`,name:`Andreea Cinpoi`,initials:`AN`,color:`#7c3aed`,role:`Sales Manager`},RU={id:`u-laura`,name:`Laura Tomova`,initials:`LA`,color:`#3a7bd5`,role:`Compliance Officer`},zU={id:`s-mahmud`,name:`Mahmud Hasan`,initials:`MH`,color:`#16a34a`,role:`Student`},BU={id:`u-mihadul`,name:`Mihadul Islam`,initials:`MI`,color:`#65a30d`,role:`Admission Officer`},VU={id:`u-nur`,name:`Nur Mohammad`,initials:`NM`,color:`#8b5cf6`,role:`Team Leader`},HU={id:`u-md-shamim`,name:`Md Shamim`,initials:`MS`,color:`#0a6e6f`,role:`Sales Lead`};FU.id,FU.name,FU.initials,FU.color;var UU=(e,t)=>({...t,admin:!1,lastSynced:null,tenantId:IU,categoryId:null,members:[],adminIds:[],data:{},peerUserId:e,memberReceipts:[]});FU.id,zU.id,FU.id,BU.id,VU.id,zU.id,FU.id,HU.id,LU.id,FU.id,LU.id,RU.id,{...UU(`u-tousif`,{id:`c-tousif`,kind:`dm`,title:`Tousif Sadman`,subtitle:`Consultant`,initials:`TS`,color:`#0e7c66`,online:!0,unread:2,pinned:!1,favourite:!0,archived:!1,lastMessage:`Sure, I'll send the documents`,lastTime:`5m`})},FU.id,UU(`u-raj`,{id:`c-raj`,kind:`dm`,title:`Raj Ahmed`,subtitle:`Global Admission Manager`,initials:`RA`,color:`#0ea5e9`,online:!0,unread:1,pinned:!1,favourite:!1,archived:!1,lastMessage:`The offer letter is ready`,lastTime:`1h`}),UU(`u-andreea`,{id:`c-andreea`,kind:`dm`,title:`Andreea Cinpoi`,subtitle:`Sales Manager`,initials:`AN`,color:`#7c3aed`,online:!1,unread:0,pinned:!1,favourite:!1,archived:!1,lastMessage:`Thanks for the update`,lastTime:`2h`}),UU(`u-jennifer`,{id:`c-jennifer`,kind:`dm`,title:`Jennifer Aboje`,subtitle:`Branch Manager`,initials:`JA`,color:`#fc7300`,online:!1,unread:0,pinned:!1,favourite:!1,archived:!1,lastMessage:`Let me check with the team`,lastTime:`Yesterday`}),UU(`u-laura`,{id:`c-laura`,kind:`dm`,title:`Laura Tomova`,subtitle:`Compliance Officer`,initials:`LA`,color:`#3a7bd5`,online:!1,unread:0,pinned:!1,favourite:!1,archived:!0,lastMessage:`Archived — visa file closed`,lastTime:`3d`});var WU=G({id:V(),name:V(),initials:V(),color:V(),role:V(),status:H().optional(),statusUntilUtc:V().nullish()}),GU=G({userId:V(),deliveredUpto:H(),readUpto:H()}),KU=G({id:V(),type:H(),title:V(),subtitle:V(),initials:V(),color:V(),online:U(),status:H().optional(),statusUntilUtc:V().nullish(),unread:H(),pinned:U(),favourite:U(),archived:U(),unreadCount:H(),admin:U(),lastMessage:V(),lastTime:V(),lastMessageAt:V().nullable().optional(),lastSyncedAt:V().nullable(),categoryId:V().nullable(),headerFields:rj(V(),V()).optional(),members:W(WU),adminIds:W(V()),peerUserId:V().nullable().optional().default(null),memberReceipts:W(GU).optional().default([])}).passthrough(),qU=G({emoji:V(),count:H(),reacted:U()}),JU=G({id:V(),conversationId:V(),kind:H(),senderId:V(),authorName:V(),authorInitials:V(),authorColor:V(),text:V(),sentAt:V(),time:V(),sequence:H(),clientMessageId:V().nullable(),fromViewer:U(),reactions:W(qU),replyToMessageId:V().nullable().optional().default(null),replyToAuthorName:V().optional().default(``),replyToText:V().optional().default(``),mediaUrl:V().nullable().optional().default(null),mediaContentType:V().nullable().optional().default(null),mediaFileName:V().nullable().optional().default(null),editedAt:V().nullable().optional().default(null),isEdited:U().optional().default(!1),deletedForEveryone:U().optional().default(!1)}),YU=G({id:V(),name:V(),initials:V(),color:V()}),XU=W(KU),ZU=W(WU),QU=G({totalCount:H(),items:XU}),$U=G({unread:H(),favourites:H(),groups:H(),archived:H()}),eW=G({blobName:V(),url:V(),contentType:V().optional().default(`application/octet-stream`),fileName:V().nullable().optional().default(null)}),tW=W(JU),nW=6e4,rW=60*nW,iW=24*rW,aW=(e,t)=>{let n=t.getTime()-e.getTime();return n<nW?`just now`:n<rW?`${String(Math.floor(n/nW))}m`:n<iW?`${String(Math.floor(n/rW))}h`:`${String(Math.floor(n/iW))}d`},oW=e=>e===0?`dm`:`group`,sW=e=>e===1?`system`:e===2?`media`:`text`,cW=e=>({id:e.id,name:e.name,initials:e.initials,color:e.color,role:e.role,status:SR(e.status),statusUntilUtc:e.statusUntilUtc??null}),lW=e=>({id:e.id,name:e.name,initials:e.initials,color:e.color}),uW=e=>{if(e.startsWith(`__UAPP_SHARED_CARD__::`))try{let t=e.substring(22),n=JSON.parse(t).card?.title??``;return n.length>0?`Shared Post: ${n}`:`Shared Post`}catch{return`Shared Post`}return e},dW=(e,t)=>new jP({id:e.id,kind:oW(e.type),title:e.title,subtitle:e.subtitle,initials:e.initials,color:e.color,online:e.online,status:SR(e.status),statusUntilUtc:e.statusUntilUtc??null,unread:e.unreadCount,pinned:e.pinned,favourite:e.favourite,archived:e.archived,admin:e.admin,lastMessage:uW(e.lastMessage),lastTime:e.lastTime,lastMessageAt:e.lastMessageAt??null,lastSynced:e.lastSyncedAt===null?null:aW(new Date(e.lastSyncedAt),t),tenantId:``,categoryId:e.categoryId,members:e.members.map(cW),adminIds:e.adminIds,data:e.headerFields??{},peerUserId:e.peerUserId,memberReceipts:e.memberReceipts.map(e=>({userId:e.userId,deliveredUpto:e.deliveredUpto,readUpto:e.readUpto}))}),fW=e=>{let t=e.replyToMessageId!==null&&e.replyToMessageId.length>0?{messageId:e.replyToMessageId,authorName:e.replyToAuthorName,text:e.replyToText}:null;return new AP({id:e.id,kind:sW(e.kind),authorName:e.authorName,authorInitials:e.authorInitials,authorColor:e.authorColor,text:e.text,time:e.time,sentAt:e.sentAt,fromViewer:e.fromViewer,reactions:e.reactions.map(e=>({emoji:e.emoji,count:e.count,reacted:e.reacted})),sequence:e.sequence,senderId:e.senderId,clientMessageId:e.clientMessageId,replyTo:t,mediaUrl:e.mediaUrl,mediaContentType:e.mediaContentType,mediaFileName:e.mediaFileName,isEdited:e.deletedForEveryone?!1:(e.editedAt??``).length>0||e.isEdited,deletedForEveryone:e.deletedForEveryone})},pW=(e,t,n)=>(e.error(`Chat ${t} returned an unexpected shape`,n),N(new bP(n))),mW=e=>{if(e.length===0)return;let t=e[0];if(t&&typeof t==`object`&&`message`in t){let e=t.message;if(typeof e==`string`&&e.trim().length>0)return e}},hW=e=>{if(Array.isArray(e.validationErrors)){let t=mW(e.validationErrors);if(t!==void 0)return t}if(typeof e.details==`string`&&e.details.trim().length>0&&!e.details.includes(`The following errors were detected`))return e.details;if(typeof e.message==`string`&&e.message.trim().length>0)return e.message},gW=e=>{if(!e||typeof e!=`object`||!(`body`in e))return;let t=e.body;if(!t||typeof t!=`object`)return;let n=t;return hW(`error`in n&&n.error&&typeof n.error==`object`?n.error:n)},_W=(e,t)=>(e.error(`Chat request failed`,t),new bP(t,gW(t))),vW=(e,t,n)=>{let r=tW.safeParse(n);return r.success?M(r.data.map(fW)):pW(e,t,r.error)},yW=(e,t,n,r)=>{let i=KU.safeParse(r);return i.success?M(dW(i.data,t.now())):pW(e,n,i.error)},bW=`/api/app/chat-media/download?blobName=`,xW=e=>`${bW}${encodeURIComponent(decodeURIComponent(e))}`,SW=e=>{if(!e.startsWith(`http://`)&&!e.startsWith(`https://`))return e;try{let t=new URL(e);return`${t.pathname}${t.search}`}catch{return e}},CW=e=>{let t=/^\/api\/app\/chat-media\/download\?blobName=([^&]+)/.exec(e);if(t?.[1]!==void 0)return t[1];let n=/^\/api\/app\/chat-media\?blobName=([^&]+)/.exec(e);if(n?.[1]!==void 0)return n[1];let r=/^\/api\/app\/chat-media\/([^/?]+)/.exec(e)?.[1];if(r!==void 0&&r!==`upload`&&r!==`download`)return r},wW=e=>{let t=e.trim();if(t.length===0)return t;let n=SW(t),r=CW(n);return r===void 0?n.startsWith(`/`)?n:`/${n}`:xW(r)},TW={conversations:`/api/app/chat/conversations`,conversationCounts:`/api/app/chat/conversation-scope-counts`,listStaff:`/api/app/chat/list-staff`,groupMemberPool:`/api/app/chat/group-member-pool`,viewer:`/api/app/chat/viewer`,createGroup:`/api/app/chat/group`,uploadChatMedia:`/api/app/chat-media/upload`,subscribePush:`/api/app/web-push/subscribe`},EW={afterSequence:`afterSequence`,beforeSequence:`beforeSequence`,skipCount:`skipCount`,maxResultCount:`maxResultCount`,filter:`filter`,scope:`scope`,uptoSequence:`uptoSequence`,favourite:`favourite`,archived:`archived`,pinned:`pinned`},DW=e=>encodeURIComponent(e),OW={conversation:e=>`/api/app/chat/conversation/${DW(e)}`,messages:e=>`/api/app/chat/messages/${DW(e)}`,messagesBefore:e=>`/api/app/chat/messages-before/${DW(e)}`,messagesSince:e=>`/api/app/chat/messages-since/${DW(e)}`,sendMessage:e=>`/api/app/chat/send-message/${DW(e)}`,sendMediaMessage:e=>`/api/app/chat/send-media-message/${DW(e)}`,markDelivered:e=>`/api/app/chat/mark-delivered/${DW(e)}`,markRead:e=>`/api/app/chat/mark-read/${DW(e)}`,reactToMessage:e=>`/api/app/chat/react-to-message/${DW(e)}`,saveMembers:e=>`/api/app/chat/save-members/${DW(e)}`,leaveConversation:e=>`/api/app/chat/leave-conversation/${DW(e)}`,setFavourite:e=>`/api/app/chat/set-favourite/${DW(e)}`,setArchived:e=>`/api/app/chat/set-archived/${DW(e)}`,setPinned:e=>`/api/app/chat/set-pinned/${DW(e)}`,deleteConversation:e=>`/api/app/chat/conversation/${DW(e)}`,refreshPortal:e=>`/api/app/chat/refresh-portal/${DW(e)}`,startDirect:e=>`/api/app/chat/start-direct/${DW(e)}`,editMessage:e=>`/api/app/chat/edit-message/${DW(e)}`,deleteMessage:e=>`/api/app/chat/message/${DW(e)}`,deleteMessageForMe:e=>`/api/app/chat/message-for-me/${DW(e)}`},kW=async(e,t,n,r)=>{try{let i=new FormData;i.append(`file`,n,r);let a=await e.httpClient.post(TW.uploadChatMedia,i,{query:{conversationId:t}}),o=eW.safeParse(a);return o.success?M({mediaId:o.data.blobName,url:o.data.url}):pW(e.logger,`upload-media`,o.error)}catch(t){return N(_W(e.logger,t))}},AW=async(e,t)=>{try{let n=await kW(e,t.conversationId,t.file,t.fileName);if(!n.ok)return n;let r={blobName:n.value.mediaId,clientMessageId:t.clientMessageId};t.file.type.length>0&&(r.contentType=t.file.type),t.fileName.length>0&&(r.fileName=t.fileName),t.caption!==void 0&&t.caption.trim().length>0&&(r.caption=t.caption.trim()),t.replyToMessageId!==void 0&&t.replyToMessageId!==null&&(r.replyToMessageId=t.replyToMessageId);let i=await e.httpClient.post(OW.sendMediaMessage(t.conversationId),r),a=JU.safeParse(i);return a.success?M(fW(a.data)):pW(e.logger,`send-media-message`,a.error)}catch(t){return N(_W(e.logger,t))}},jW=async(e,t)=>{try{let n=wW(t),r=await e.httpClient.getBlob(n,{headers:{Accept:`image/*,*/*`}});return r.size===0?N(new bP(`Chat media response was empty`)):M(r)}catch(t){return N(_W(e.logger,t))}},MW=async(e,t,n,r)=>{try{let t=await e.httpClient.post(OW.editMessage(n),{text:r}),i=JU.safeParse(t);return i.success?M(fW(i.data)):pW(e.logger,`edit-message`,i.error)}catch(t){return N(_W(e.logger,t))}},NW=async(e,t,n)=>{try{return await e.httpClient.delete(OW.deleteMessage(n)),M(void 0)}catch(t){return N(_W(e.logger,t))}},PW=async(e,t,n)=>{try{return await e.httpClient.delete(OW.deleteMessageForMe(n)),M(void 0)}catch(t){return N(_W(e.logger,t))}},FW=async(e,t)=>{try{return await e.httpClient.post(TW.subscribePush,{endpoint:t.endpoint,p256dh:t.p256dh,auth:t.auth}),M(void 0)}catch(t){return N(_W(e.logger,t))}},IW=async(e,t,n,r)=>{try{return await e.post(n,void 0,{query:r}),M(void 0)}catch(e){return N(_W(t,e))}},LW=async e=>{try{return await e.httpClient.post(e.path,e.body,{query:e.query}),M(void 0)}catch(t){return N(_W(e.logger,t))}},RW=async(e,t,n)=>{try{return await e.delete(n),M(void 0)}catch(e){return N(_W(t,e))}},zW=(e,t,n)=>IW(e.httpClient,e.logger,OW.markDelivered(t),{[EW.uptoSequence]:n}),BW=(e,t,n)=>IW(e.httpClient,e.logger,OW.markRead(t),{[EW.uptoSequence]:n}),VW=(e,t,n)=>IW(e.httpClient,e.logger,OW.setFavourite(t),{[EW.favourite]:n}),HW=(e,t,n)=>IW(e.httpClient,e.logger,OW.setArchived(t),{[EW.archived]:n}),UW=(e,t,n)=>IW(e.httpClient,e.logger,OW.setPinned(t),{[EW.pinned]:n}),WW=(e,t)=>IW(e.httpClient,e.logger,OW.leaveConversation(t),{}),GW=(e,t)=>IW(e.httpClient,e.logger,OW.refreshPortal(t),{}),KW=(e,t,n)=>LW({httpClient:e.httpClient,logger:e.logger,path:OW.reactToMessage(t),query:{},body:{emoji:n}}),qW=(e,t,n,r)=>LW({httpClient:e.httpClient,logger:e.logger,path:OW.saveMembers(t),query:{},body:{members:n.map(e=>({id:e.id,name:e.name,initials:e.initials,color:e.color,role:e.role})),adminIds:[...r]}}),JW=(e,t)=>RW(e.httpClient,e.logger,OW.deleteConversation(t)),YW={all:`All`,unread:`Unread`,favourites:`Favourites`,groups:`Groups`,archive:`Archive`},XW=async(e,t)=>{let n=t.filter?.trim();try{let r=await e.httpClient.get(TW.conversations,{query:{[EW.scope]:YW[t.scope],[EW.filter]:n===void 0||n===``?void 0:n,[EW.skipCount]:t.skipCount,[EW.maxResultCount]:t.maxResultCount}}),i=QU.safeParse(r);if(!i.success)return pW(e.logger,`conversations`,i.error);let a=e.clock.now();return M({items:i.data.items.map(e=>dW(e,a)),totalCount:i.data.totalCount})}catch(t){return N(_W(e.logger,t))}},ZW=async e=>{try{let t=await e.httpClient.get(TW.conversationCounts),n=$U.safeParse(t);return n.success?M(n.data):pW(e.logger,`conversation-counts`,n.error)}catch(t){return N(_W(e.logger,t))}},QW=async(e,t)=>{try{let n=await e.httpClient.get(OW.conversation(t));return yW(e.logger,e.clock,`conversation`,n)}catch(t){return N(_W(e.logger,t))}},$W=async(e,t)=>{let n=t?.trim();try{let t=await e.httpClient.post(TW.listStaff,void 0,{query:{[EW.filter]:n===void 0||n===``?void 0:n}}),r=ZU.safeParse(t);return r.success?M(r.data.map(cW)):pW(e.logger,`list-staff`,r.error)}catch(t){return N(_W(e.logger,t))}},eG=async(e,t)=>{let n=t?.trim();try{let t=await e.httpClient.get(TW.groupMemberPool,{query:{[EW.filter]:n===void 0||n===``?void 0:n}}),r=ZU.safeParse(t);return r.success?M(r.data.map(cW)):pW(e.logger,`group-member-pool`,r.error)}catch(t){return N(_W(e.logger,t))}},tG=async e=>{try{let t=await e.httpClient.get(TW.viewer),n=YU.safeParse(t);return n.success?M(lW(n.data)):pW(e.logger,`viewer`,n.error)}catch(t){return N(_W(e.logger,t))}},nG=async(e,t,n)=>{try{let r=n===void 0?void 0:{query:{[EW.maxResultCount]:n}},i=await e.httpClient.get(OW.messages(t),r);return vW(e.logger,`messages`,i)}catch(t){return N(_W(e.logger,t))}},rG=async(e,t,n,r)=>{try{let i=await e.httpClient.get(OW.messagesSince(t),{query:{[EW.afterSequence]:n,[EW.maxResultCount]:r}});return vW(e.logger,`messages-since`,i)}catch(t){return N(_W(e.logger,t))}},iG=async(e,t,n,r)=>{try{let i=await e.httpClient.get(OW.messagesBefore(t),{query:{[EW.beforeSequence]:n,[EW.maxResultCount]:r}});return vW(e.logger,`messages-before`,i)}catch(t){return N(_W(e.logger,t))}},aG=async(e,t)=>{try{let n=await e.httpClient.post(OW.startDirect(t),void 0);return yW(e.logger,e.clock,`start-direct`,n)}catch(t){return N(_W(e.logger,t))}},oG=async(e,t,n)=>{try{let r={title:t,memberIds:[...n]},i=await e.httpClient.post(TW.createGroup,r);return yW(e.logger,e.clock,`group`,i)}catch(t){return N(_W(e.logger,t))}},sG=async e=>{let{deps:t,conversationId:n,text:r,clientMessageId:i,replyToMessageId:a}=e;try{let e={text:r,clientMessageId:i};a!=null&&(e.replyToMessageId=a);let o=await t.httpClient.post(OW.sendMessage(n),e),s=JU.safeParse(o);return s.success?M(fW(s.data)):pW(t.logger,`send-message`,s.error)}catch(e){return N(_W(t.logger,e))}},cG=class{httpClient;clock;logger;constructor(e){this.httpClient=e.httpClient,this.clock=e.clock,this.logger=e.logger.child(`http-chat-gateway`)}deps(){return{httpClient:this.httpClient,logger:this.logger}}queryDeps(){return{httpClient:this.httpClient,clock:this.clock,logger:this.logger}}listConversations(e){return XW(this.queryDeps(),e)}getConversationCounts(){return ZW(this.deps())}getConversation(e){return QW(this.queryDeps(),e)}listStaff(e){return $W(this.deps(),e)}getGroupMemberPool(e){return eG(this.deps(),e)}getViewer(){return tG(this.deps())}getMessages(e,t){return nG(this.deps(),e,t)}getMessagesSince(e,t,n){return rG(this.deps(),e,t,n)}getMessagesBefore(e,t,n){return iG(this.deps(),e,t,n)}startDirect(e){return aG(this.queryDeps(),e)}createGroup(e,t){return oG(this.queryDeps(),e,t)}sendMessage(e,t,n,r){return sG({deps:this.deps(),conversationId:e,text:t,clientMessageId:n,replyToMessageId:r})}uploadChatMedia(e,t,n){return kW(this.deps(),e,t,n)}sendMediaMessage(e){return AW(this.deps(),e)}downloadMedia(e){return jW(this.deps(),e)}editMessage(e,t,n){return MW(this.deps(),e,t,n)}deleteMessage(e,t){return NW(this.deps(),e,t)}deleteMessageForMe(e,t){return PW(this.deps(),e,t)}subscribePush(e){return FW(this.deps(),e)}markDelivered(e,t){return zW(this.deps(),e,t)}markRead(e,t){return BW(this.deps(),e,t)}setFavourite(e,t){return VW(this.deps(),e,t)}setArchived(e,t){return HW(this.deps(),e,t)}setPinned(e,t){return UW(this.deps(),e,t)}deleteConversation(e){return JW(this.deps(),e)}leaveConversation(e){return WW(this.deps(),e)}refreshPortal(e){return GW(this.deps(),e)}reactToMessage(e,t,n){return KW(this.deps(),t,n)}saveMembers(e,t,n){return qW(this.deps(),e,t,n)}};function lG(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function uG(e,t){let n,r=()=>{if(n)return n;let r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(t),n=lG(r),n.then(e=>{e.onclose=()=>n=void 0},()=>{}),n};return(e,n)=>r().then(r=>n(r.transaction(t,e).objectStore(t)))}var dG;function fG(){return dG||=uG(`keyval-store`,`keyval`),dG}function pG(e,t=fG()){return t(`readonly`,t=>lG(t.get(e)))}function mG(e,t,n=fG()){return n(`readwrite`,n=>(n.put(t,e),lG(n.transaction)))}function hG(e,t=fG()){return t(`readwrite`,t=>(t.delete(e),lG(t.transaction)))}function gG(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},lG(e.transaction)}function _G(e=fG()){return e(`readonly`,e=>{if(e.getAllKeys)return lG(e.getAllKeys());let t=[];return gG(e,e=>t.push(e.key)).then(()=>t)})}var vG=uG(`chat-outbox`,`pending-sends`),yG=e=>`send:${e}`,bG=()=>({put:async e=>{await mG(yG(e.clientMessageId),e,vG)},remove:async e=>{await hG(yG(e),vG)},listAll:async()=>{let e=await _G(vG);return(await Promise.all(e.map(async e=>pG(e,vG)))).filter(e=>e!==void 0)},listByConversation:async e=>{let t=await _G(vG);return(await Promise.all(t.map(async e=>pG(e,vG)))).filter(t=>t?.conversationId===e)}}),xG={MessageReceived:`MessageReceived`,MessageEdited:`MessageEdited`,MessageDeleted:`MessageDeleted`,MessageDelivered:`MessageDelivered`,MessageRead:`MessageRead`,Typing:`Typing`,PresenceChanged:`PresenceChanged`,StatusChanged:`StatusChanged`,ReactionToggled:`ReactionToggled`,RemovedFromConversation:`RemovedFromConversation`},SG={MarkRead:`MarkRead`,MarkDelivered:`MarkDelivered`,Typing:`Typing`},CG=G({conversationId:V(),byUserId:V(),uptoSequence:H()}),wG=G({conversationId:V(),userId:V(),isTyping:U()}),TG=G({userId:V(),online:U(),lastSeenUtc:V().nullable()}),EG=G({userId:V(),status:H(),untilUtc:V().nullish()}),DG=G({conversationId:V(),messageId:V(),byUserId:V(),emoji:V(),added:U()}),OG=G({conversationId:V(),messageId:V()}),kG=G({conversationId:V()}),AG=(e,t,n,r)=>{let i=e.safeParse(t);return!i.success||i.data===void 0?(r.warn(`Ignoring malformed realtime payload`,{event:n}),null):i.data},jG=(e,t,n)=>AG(JU,e,t,n),MG=(e,t,n)=>AG(CG,e,t,n),NG=(e,t,n)=>AG(wG,e,t,n),PG=(e,t,n)=>AG(TG,e,t,n),FG=(e,t,n)=>AG(EG,e,t,n),IG=(e,t,n)=>AG(DG,e,t,n),LG=(e,t,n)=>AG(OG,e,t,n),RG=(e,t,n)=>AG(kG,e,t,n),zG=`chat.hidden-messages`,BG=W(V()),VG=()=>{try{let e=window.localStorage.getItem(zG);if(e===null)return[];let t=BG.safeParse(JSON.parse(e));return t.success?t.data:[]}catch{return[]}},HG=e=>{try{window.localStorage.setItem(zG,JSON.stringify(e))}catch{}},UG=PE((e,t)=>({hidden:new Set(VG()),hideForMe:n=>{if(t().hidden.has(n))return;let r=new Set(t().hidden);r.add(n),HG([...r]),e({hidden:r})}})),WG=(e,t)=>t.length>0&&oU(e,t),GG=(e,t)=>{let n=WG(e.senderId,t),r=n?e.reactions:e.reactions.map(e=>e.reacted?{...e,reacted:!1}:e),i=r.length===e.reactions.length&&r.every((t,n)=>{let r=e.reactions[n];return r===void 0?!1:t.reacted===r.reacted&&t.emoji===r.emoji&&t.count===r.count});return n===e.fromViewer&&i?e:e.with({fromViewer:n,reactions:r})},KG=(e,t)=>t.length===0?e:e.map(e=>GG(e,t)),qG=[],JG=({isLoadingOlder:e,hasMessages:t})=>!t||!e?null:(0,D.jsx)(`div`,{className:K.olderRow,children:(0,D.jsx)(gi,{size:`sm`,label:`Loading older messages`})}),YG=(e,t,n,r)=>!(e.fromViewer&&(e.kind===`text`||e.kind===`media`))||_V(e)?null:gH(e,{peerUserId:t,otherMemberIds:n,receipts:r}),XG=({conversation:e,viewerId:t,messages:r,selectedMessageId:i,onSelectMessage:a,onReact:o,onRetry:s,onReply:c,onEdit:l,onDelete:u})=>{let d=e.id,f=UG(e=>e.hidden),p=(0,n.useMemo)(()=>KG(r.data??qG,t).filter(e=>!f.has(e.id)),[r.data,t,f]),m=vP(e=>e.receipts[d]),h=vP(e=>e.pending),g=e.members.map(e=>e.id).filter(e=>e!==t),_=yH(d),v=TH(d,p,_.loadOlder);return(0,D.jsxs)(`div`,{className:K.threadWrap,children:[(0,D.jsx)(`div`,{className:K.messages,ref:v.scrollRef,onScroll:v.onScroll,children:(0,D.jsxs)(`div`,{className:K.thread,children:[(0,D.jsx)(JG,{isLoadingOlder:_.isLoadingOlder,hasMessages:p.length>0}),r.isPending&&(0,D.jsx)(`div`,{className:K.center,children:(0,D.jsx)(gi,{label:`Loading messages`})}),r.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not load messages`,children:r.error.message}),p.length>0&&(0,D.jsx)(PU,{conversation:e,messages:p,pending:h,selectedMessageId:i,onSelectMessage:a,tickFor:t=>YG(t,e.peerUserId,g,m??{}),onReact:o,onRetry:s,onReply:c,onEdit:l,onDelete:u})]})}),v.hasNewBelow&&(0,D.jsxs)(`button`,{type:`button`,className:T(K.newPill),onClick:()=>{v.scrollToBottom(!0)},children:[(0,D.jsx)(Gn,{size:14}),`New messages`]})]})},ZG=e=>(0,D.jsx)(XG,{...e}),QG=(e,t,r,i)=>{let[a,o]=(0,n.useState)(null),s=()=>{o(null)};return{requestDelete:t=>{o(e.find(e=>e.id===t)??null)},dialogProps:{open:a!==null,canDeleteForEveryone:a?.canDeleteForEveryone(i.now().getTime())??!1,onDeleteForMe:()=>{a!==null&&r(a.id),s()},onDeleteForEveryone:()=>{a!==null&&t(a.id),s()},onCancel:s}}},$G=`now`,eK=(e,t,n)=>{e.outbox.put({clientMessageId:t.clientMessageId,conversationId:e.conversationId,text:t.text,failedAt:n})},tK=(e,t,n)=>{e.queryClient.setQueryData(cF(e.conversationId),r=>SV(r,bV({viewer:t,text:n.text,clientMessageId:n.clientMessageId,sequence:vV(r??[])+1,timeLabel:$G,sentAt:e.clock.now().toISOString(),replyTo:n.replyTo??null}))),e.store.getState().markSending(n.clientMessageId),eK(e,n,null)},nK=(e,t,n)=>{e.queryClient.setQueryData(cF(e.conversationId),e=>CV(e,t)),e.store.getState().clearPending(n),e.outbox.remove(n),KP(e.queryClient)},rK=(e,t,n)=>P(t.execute(e.conversationId,n.text,n.clientMessageId,n.replyToMessageId)),iK=e=>{let{sendMessage:t,outbox:r,clock:i}=LP(),a=sN(),o=_P(),s=uF().data??null,c={queryClient:a,store:o,outbox:r,conversationId:e,clock:i},l=CN({mutationFn:e=>rK(c,t,e),onMutate:e=>{s!==null&&tK(c,s,e)},onSuccess:(e,t)=>{nK(c,e,t.clientMessageId)},onError:(e,t)=>{j.error(e instanceof Error?e.message:`Failed to send message`),o.getState().markFailed(t.clientMessageId),eK(c,t,c.clock.now().toISOString()),j.error(e.message)}}),u=(0,n.useCallback)(()=>{r.listByConversation(e).then(e=>{for(let t of e)t.failedAt!==null&&(o.getState().markSending(t.clientMessageId),l.mutate({text:t.text,clientMessageId:t.clientMessageId}))})},[e,l,r,o]);return(0,n.useEffect)(()=>{let e=()=>{u()};return window.addEventListener(`online`,e),()=>{window.removeEventListener(`online`,e)}},[u]),{send:(0,n.useCallback)((e,t=null)=>{l.mutate({text:e,clientMessageId:crypto.randomUUID(),replyToMessageId:t?.messageId??null,replyTo:t})},[l]),retry:(0,n.useCallback)((e,t)=>{o.getState().markSending(e),l.mutate({text:t,clientMessageId:e})},[l,o]),isSending:l.isPending}},aK=(e,t)=>{let n=e.then(t,t);return{run:n,next:n.then(()=>void 0,()=>void 0)}},oK=(e,t)=>{let n=e.get(t);n!==void 0&&(e.delete(t),globalThis.setTimeout(()=>{URL.revokeObjectURL(n)},250))},sK=(e,t)=>{let n=e.viewer;if(n===null)return;let r=URL.createObjectURL(t.file);e.urls.set(t.clientMessageId,r);let i=e.nowIso();e.queryClient.setQueryData(cF(e.conversationId),e=>SV(e,xV({viewer:n,fileUrl:r,caption:t.caption??``,clientMessageId:t.clientMessageId,sequence:vV(e??[])+1,sentAt:i,contentType:t.file.type,fileName:t.fileName}))),e.store.getState().markSending(t.clientMessageId)},cK=(e,t,n)=>{e.queryClient.setQueryData(cF(e.conversationId),e=>CV(e,t)),e.store.getState().clearPending(n),oK(e.urls,n),KP(e.queryClient)},lK=(e,t)=>{let n=gV(t.clientMessageId);e.queryClient.setQueryData(cF(e.conversationId),e=>e?.filter(e=>e.id!==n)??[]),e.store.getState().clearPending(t.clientMessageId),oK(e.urls,t.clientMessageId),j.error(`Couldn't send ${t.fileName}.`)},uK=e=>{let{sendMediaMessage:t,clock:r}=LP(),i=sN(),a=_P(),o=uF().data??null,s=(0,n.useRef)(new Map),c=(0,n.useRef)(Promise.resolve()),l={queryClient:i,store:a,viewer:o,conversationId:e,nowIso:()=>r.now().toISOString(),urls:s.current},u=CN({mutationFn:e=>{let{run:n,next:r}=aK(c.current,()=>P(t.execute(e)));return c.current=r,n},onMutate:e=>{sK(l,e)},onSuccess:(e,t)=>{cK(l,e,t.clientMessageId)},onError:(e,t)=>{lK(l,t)}});return{sendMedia:(0,n.useCallback)((t,n,r)=>{let i={conversationId:e,file:t,fileName:t.name,clientMessageId:crypto.randomUUID(),...n!==void 0&&n.trim().length>0?{caption:n}:{},...r===void 0?{}:{replyToMessageId:r}};u.mutate(i)},[e,u]),isSending:u.isPending}},dK=(e,t)=>{let r=aF(),i=(0,n.useRef)({conversationId:null,upto:0,acknowledge:(e,t)=>{}});i.current.acknowledge=(e,t)=>{r.mutate({conversationId:e,uptoSequence:t})},(0,n.useEffect)(()=>{if(e===null||t===void 0||t.length===0)return;let n=yV(t),r=i.current;r.conversationId===e&&n<=r.upto||(r.conversationId=e,r.upto=n,r.acknowledge(e,n))},[e,t])},fK=2e3,pK=3e3,mK=e=>{let{realtime:t,logger:r}=LP(),i=vP(e=>e.status===`connected`),a=(0,n.useRef)(0),o=(0,n.useRef)(!1),s=(0,n.useRef)(null),c=(0,n.useCallback)(n=>{e===null||!i||t.invoke(SG.Typing,e,n).catch(()=>{r.debug(`Typing signal dropped (best-effort)`)})},[e,i,t,r]),l=(0,n.useCallback)(()=>{s.current!==null&&(clearTimeout(s.current),s.current=null)},[]),u=(0,n.useCallback)(()=>{l(),o.current&&(o.current=!1,a.current=0,c(!1))},[l,c]),d=(0,n.useCallback)(()=>{let e=Date.now();(!o.current||e-a.current>fK)&&(o.current=!0,a.current=e,c(!0)),l(),s.current=setTimeout(u,pK)},[l,c,u]);return(0,n.useEffect)(()=>u,[e,u]),{onInput:d,stop:u}},hK=e=>{let{subscribePush:t}=LP();(0,n.useEffect)(()=>{!e||!(`serviceWorker`in navigator)||`PushManager`in window},[e,t])},gK=()=>{let[e,t]=(0,n.useState)(``),[r,i]=(0,n.useState)(null),[a,o]=(0,n.useState)(null);return{text:e,setText:t,replyTo:r,setReplyTo:i,editingMessage:a,setEditingMessage:o}},_K=({messages:e,send:t,media:n,draft:r,actions:i})=>({messages:e,send:t,media:n,text:r.text,setText:r.setText,replyTo:r.replyTo,setReplyTo:r.setReplyTo,editingMessage:r.editingMessage,startEdit:i.startEdit,clearEditing:i.clearEditing,onReact:i.onReact,onEdit:i.onEdit,onDelete:i.onDelete,onDeleteForMe:i.onDeleteForMe,submit:i.submit,onSendMedia:i.onSendMedia,onTyping:i.onTyping,isSending:t.isSending||n.isSending}),vK=e=>{let t=dF(e),n=iK(e),r=uK(e),i=SF(e),a=CF(e),o=wF(e),s=TF(e),c=UG(e=>e.hideForMe),l=mK(e),u=gK();return hK(!0),dK(e,t.data),_K({messages:t,send:n,media:r,draft:u,actions:{startEdit:e=>{u.setEditingMessage({id:e.id,text:e.text}),u.setText(e.text),u.setReplyTo(null)},clearEditing:()=>{u.setEditingMessage(null),u.setText(``)},onReact:(e,t)=>{i.mutate({messageId:e,emoji:t})},onEdit:(e,t)=>{a.mutate({messageId:e,text:t})},onDelete:e=>{o.mutate(e)},onDeleteForMe:e=>{c(e),s.mutate(e)},submit:()=>{if(u.text.trim().length!==0){if(l.stop(),u.editingMessage!==null){a.mutate({messageId:u.editingMessage.id,text:u.text.trim()}),u.setEditingMessage(null),u.setText(``);return}n.send(u.text,u.replyTo),u.setText(``),u.setReplyTo(null)}},onSendMedia:(e,t)=>{e.forEach((e,n)=>{r.sendMedia(e,n===0?t:void 0,n===0?u.replyTo?.messageId??null:null)}),u.setText(``),u.setReplyTo(null)},onTyping:l.onInput}})},yK=()=>(0,D.jsxs)(`div`,{className:K.removedComposer,children:[(0,D.jsx)(Nn,{size:15}),(0,D.jsx)(`span`,{children:`You can no longer send messages here — you’re no longer a member of this group.`})]}),bK=({conversation:e,conversationId:t,active:n,removed:r})=>r?(0,D.jsx)(yK,{}):(0,D.jsx)(fH,{conversation:e,conversationId:t,text:n.text,replyTo:n.replyTo,editingMessage:n.editingMessage,isSending:n.isSending,onChange:n.setText,onSubmit:n.submit,onClearReply:()=>{n.setReplyTo(null)},onClearEditing:n.clearEditing,onSendMedia:n.onSendMedia,onTyping:n.onTyping}),xK=({conversation:e,conversationId:t,actions:r,onRequestDelete:i,onRequestLeave:a})=>{let o=fR(),s=uF(),{clock:c}=LP(),l=vK(t),u=QG(l.messages.data??[],l.onDelete,l.onDeleteForMe,c),d=vP(e=>e.isRemovedFromConversation(t)),[f,p]=(0,n.useState)(!1),[m,h]=(0,n.useState)(null);return(0,n.useEffect)(()=>{h(null)},[t]),(0,D.jsxs)(`div`,{className:K.view,children:[(0,D.jsx)(IV,{conversation:e,categories:o.data??[],actions:r,statusPill:(0,D.jsx)(QV,{}),onManageMembers:()=>{p(!0)},onRequestDelete:i,onRequestLeave:a,selectedMessage:m,onClearSelection:()=>{h(null)},onReply:l.setReplyTo,onStartEdit:l.startEdit,onDelete:u.requestDelete}),(0,D.jsx)(ZG,{conversation:e,viewerId:s.data?.id??``,messages:l.messages,selectedMessageId:m?.id??null,onSelectMessage:e=>{h(t=>t?.id===e.id?null:e)},onReact:l.onReact,onRetry:l.send.retry,onReply:l.setReplyTo,onEdit:l.onEdit,onDelete:u.requestDelete}),(0,D.jsx)(bK,{conversation:e,conversationId:t,active:l,removed:d}),e.isGroup&&(0,D.jsx)(JV,{conversation:e,open:f,onClose:()=>{p(!1)}}),(0,D.jsx)(YV,{...u.dialogProps})]})},SK=()=>(0,D.jsxs)(`div`,{className:K.viewEmpty,children:[(0,D.jsx)(`div`,{className:K.emptyIconWrap,children:(0,D.jsx)(Nn,{size:32})}),(0,D.jsx)(`h3`,{className:K.emptyTitle,children:`No longer available`}),(0,D.jsx)(`p`,{className:K.emptyText,children:`You no longer have access to this conversation — you may have been removed from the group, or it was deleted. You can no longer read or send messages here.`})]}),CK=()=>{let e=Ny(0),t=Ny(0),n=By(e,{stiffness:60,damping:20}),r=By(t,{stiffness:60,damping:20}),i=Iy(n,[-1,1],[-25,25]),a=Iy(r,[-1,1],[-25,25]),o=Iy(n,[-1,1],[20,-20]),s=Iy(r,[-1,1],[-15,15]),c=Iy(n,[-1,1],[-15,15]),l=Iy(r,[-1,1],[20,-20]);return(0,D.jsxs)(`div`,{className:K.viewEmpty,onMouseMove:n=>{let r=n.currentTarget.getBoundingClientRect(),i=(n.clientX-r.left-r.width/2)/(r.width/2),a=(n.clientY-r.top-r.height/2)/(r.height/2);e.set(i),t.set(a)},onMouseLeave:()=>{e.set(0),t.set(0)},children:[(0,D.jsx)(A.div,{className:K.emptyFloating1,style:{x:i,y:a},children:(0,D.jsx)(Sr,{size:24})}),(0,D.jsx)(A.div,{className:K.emptyFloating2,style:{x:o,y:s},children:(0,D.jsx)(Xr,{size:20})}),(0,D.jsx)(A.div,{className:K.emptyFloating3,style:{x:c,y:l},children:(0,D.jsx)(Ur,{size:16})}),(0,D.jsx)(`div`,{className:K.emptyIconWrap,children:(0,D.jsx)(xr,{size:32})}),(0,D.jsx)(`h3`,{className:K.emptyTitle,children:`Your Messages`}),(0,D.jsx)(`p`,{className:K.emptyText,children:`Select a conversation from the sidebar or start a new chat.`})]})},wK=({conversation:e,conversationId:t,lostAccess:r,actions:i,onRequestDelete:a,onRequestLeave:o})=>{let s=_P();return(0,n.useEffect)(()=>(s.getState().setActiveConversationId(t),()=>{s.getState().setActiveConversationId(null)}),[t,s]),e===void 0||t===null?r?(0,D.jsx)(SK,{}):(0,D.jsx)(CK,{}):(0,D.jsx)(A.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{type:`spring`,stiffness:350,damping:28},className:K.viewPaneWrapper,children:(0,D.jsx)(xK,{conversation:e,conversationId:t,actions:i,onRequestDelete:a,onRequestLeave:o})},t)},TK=({mediaUrl:e})=>{let{src:t,isLoading:n,isError:r,onImageError:i}=jH(e);return r?(0,D.jsxs)(`div`,{className:K.viewerFallback,children:[(0,D.jsx)(fr,{size:30}),(0,D.jsx)(`span`,{children:`Image unavailable`})]}):t===null||n?(0,D.jsx)(gi,{label:`Loading image`}):(0,D.jsx)(`img`,{className:K.viewerImg,src:t,alt:``,onError:i})},EK=(e,t,r,i)=>{(0,n.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`?t():e.key===`ArrowRight`?r():e.key===`ArrowLeft`&&i()};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n)}},[e,t,r,i])},DK=()=>{let e=MH(e=>e.open),t=MH(e=>e.urls),n=MH(e=>e.index),r=MH(e=>e.close),a=MH(e=>e.next),o=MH(e=>e.prev),s=Bs();EK(e,r,a,o);let c=t[n];if(!e||c===void 0)return null;let l=t.length>1;return(0,i.createPortal)((0,D.jsxs)(`div`,{className:K.viewerBackdrop,role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview`,children:[(0,D.jsx)(`button`,{type:`button`,className:K.viewerScrim,"aria-label":`Close preview`,onClick:r}),(0,D.jsx)(`button`,{type:`button`,className:K.viewerClose,"aria-label":`Close preview`,onClick:r,children:(0,D.jsx)(ci,{size:22})}),l&&(0,D.jsx)(`button`,{type:`button`,className:T(K.viewerNav,K.viewerNavPrev),"aria-label":`Previous image`,disabled:n===0,onClick:o,children:(0,D.jsx)(Kn,{size:26})}),(0,D.jsx)(`div`,{className:K.viewerStage,children:(0,D.jsx)(TK,{mediaUrl:c})}),l&&(0,D.jsx)(`button`,{type:`button`,className:T(K.viewerNav,K.viewerNavNext),"aria-label":`Next image`,disabled:n===t.length-1,onClick:a,children:(0,D.jsx)(qn,{size:26})}),l&&(0,D.jsxs)(`span`,{className:K.viewerCount,children:[n+1,` / `,t.length]})]}),s??document.body)},OK=()=>{let e=pF(),t=hF(),n=mF(),r=gF(),i=_F(),a=vF();return{toggleFavourite:t=>{e.mutate({id:t.id,value:!t.favourite},{onSuccess:()=>{j.success(t.favourite?`Removed from Favourites`:`Added to Favourites`)}})},togglePin:e=>{t.mutate({id:e.id,value:!e.pinned},{onSuccess:()=>{j.success(e.pinned?`Unpinned`:`Pinned to top`)}})},toggleArchive:e=>{n.mutate({id:e.id,value:!e.archived},{onSuccess:()=>{j.success(e.archived?`Chat unarchived`:`Chat archived`)}})},remove:e=>{r.mutate(e,{onSuccess:()=>{j.success(`Chat deleted`)}})},leave:e=>{i.mutate(e.id,{onSuccess:()=>{j.success(`You left "${e.title}"`)}})},refresh:e=>{a.mutate(e.id,{onSuccess:()=>{j.success(`Portal data refreshed`)}})}}},kK=e=>{let t=_P();(0,n.useEffect)(()=>{let{seedReceipts:n}=t.getState();for(let t of e)n(t.id,t.memberReceipts)},[t,e])},AK=[],jK=(e,t,n)=>{let r=HP(e,t),i=HP(e,``),a=UP(),o=r.data??AK,s=i.data??AK,c=n??s[0]?.id??o[0]?.id??null,l=GP(c);return kK(o),{conversations:r,counts:a.data,list:o,activeId:c,active:l.data??o.find(e=>e.id===c),lostAccess:n!==null&&l.isError}},MK=`/comms/chats`,NK=(e,t,r)=>{let[i,a]=(0,n.useState)(null),[o,s]=(0,n.useState)(null);return{pendingDelete:i,pendingLeave:o,requestDelete:a,requestLeave:s,confirmDelete:()=>{i!==null&&(e.remove(i.id),i.id===t&&r(MK)),a(null)},confirmLeave:()=>{o!==null&&(e.leave(o),o.id===t&&r(MK)),s(null)},cancelDelete:()=>{a(null)},cancelLeave:()=>{s(null)}}},PK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu,FK=`--`,IK=e=>e.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/u,``),LK=e=>{let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return t+`=`.repeat((4-t.length%4)%4)},RK=e=>{let t=e.replace(/-/g,``),n=``;for(let e=0;e<t.length;e+=2)n+=String.fromCharCode(Number.parseInt(t.slice(e,e+2),16));return IK(btoa(n))},zK=e=>{let t;try{t=atob(LK(e))}catch{return null}if(t.length!==16)return null;let n=``;for(let e=0;e<t.length;e+=1)n+=t.charCodeAt(e).toString(16).padStart(2,`0`);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`},BK=e=>PK.test(e)?RK(e):`~${IK(btoa(e))}`,VK=e=>{if(e.startsWith(`~`))try{return atob(LK(e.slice(1)))}catch{return null}return zK(e)},HK=e=>{let t=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,40);return t.length>0?t:`chat`},UK=(e,t)=>`/comms/chats/${HK(t)}${FK}${BK(e)}`,WK=e=>{let t=e.indexOf(FK),n=t>=0?e.slice(t+2):e;return PK.test(n)?n:VK(n)},GK=()=>{let e=Ue(),[t,r]=(0,n.useState)(`all`),[i,a]=(0,n.useState)(``),o=OF(i,250),{conversationId:s}=We(),c=s===void 0?null:WK(s),{conversations:l,counts:u,list:d,activeId:f,active:p,lostAccess:m}=jK(t,o,c),h=OK(),g=Be(),_=NK(h,c,g);return l.isPending?(0,D.jsx)(KF,{}):l.isSuccess?(0,D.jsxs)(`div`,{className:T(K.root,c!==null&&K.hasActiveChat),children:[(0,D.jsx)(WF,{conversations:d,activeId:f,actions:h,filter:{tab:t,onTabChange:r,search:i,onSearchChange:a,counts:u},hasNextPage:l.hasNextPage,isFetchingNextPage:l.isFetchingNextPage,onLoadMore:l.fetchNextPage,onRequestDelete:_.requestDelete,onSelect:e=>{g(UK(e,d.find(t=>t.id===e)?.title??``))}}),(0,D.jsx)(wK,{conversation:p,conversationId:f,lostAccess:m,actions:h,onRequestDelete:_.requestDelete,onRequestLeave:_.requestLeave}),(0,D.jsx)(hD,{pendingDelete:_.pendingDelete,pendingLeave:_.pendingLeave,onConfirmDelete:_.confirmDelete,onConfirmLeave:_.confirmLeave,onCancelDelete:_.cancelDelete,onCancelLeave:_.cancelLeave}),(0,D.jsx)(DK,{}),e]}):(0,D.jsx)(`div`,{className:K.fullCenter,children:(0,D.jsx)(bi,{tone:`error`,title:`Could not load chats`,children:l.error?.message??`Please try again.`})})},KK=`/comms/chats`,qK=()=>(0,D.jsxs)(St,{children:[(0,D.jsxs)(bt,{path:KK,element:(0,D.jsx)(GK,{}),children:[(0,D.jsx)(bt,{index:!0,element:null}),(0,D.jsx)(bt,{path:`:conversationId`,element:null})]}),(0,D.jsx)(bt,{path:`*`,element:(0,D.jsx)(yt,{to:KK,replace:!0})})]}),JK=e.n((e=>{var t=require("react-dom");if(process.env.NODE_ENV===`production`)e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot;else{var n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e.createRoot=function(e,r){n.usingClientEntryPoint=!0;try{return t.createRoot(e,r)}finally{n.usingClientEntryPoint=!1}},e.hydrateRoot=function(e,r,i){n.usingClientEntryPoint=!0;try{return t.hydrateRoot(e,r,i)}finally{n.usingClientEntryPoint=!1}}}}))(),YK=`__COMMHUB_SDK_CSS__`,XK,ZK=()=>{let e=globalThis[YK];return typeof e==`string`?e:``},QK=()=>typeof CSSStyleSheet==`function`&&typeof CSSStyleSheet.prototype.replaceSync==`function`,$K=()=>{let e=ZK();if(e===``||!QK())return[];if(XK===void 0)try{let t=new CSSStyleSheet;t.replaceSync(e),XK=t}catch{XK=null}return XK===null?[]:[XK]},eq=()=>{let e=ZK();if(e===``)return null;let t=document.createElement(`style`);return t.textContent=e,t},tq=`commhub-widget-root`;function nq(e,t,n=[]){if(customElements.get(e))return;class r extends HTMLElement{reactRoot=null;mountPoint;configValue={};static get observedAttributes(){return n}get config(){return this.configValue}set config(e){this.configValue=e,this.render()}constructor(){super();let e=this.attachShadow({mode:`open`}),t=$K();if(t.length>0)e.adoptedStyleSheets=[...t];else{let t=eq();t!==null&&e.appendChild(t)}this.mountPoint=document.createElement(`div`),this.mountPoint.className=tq,e.appendChild(this.mountPoint)}connectedCallback(){this.render()}disconnectedCallback(){let e=this.reactRoot;e!==null&&(this.reactRoot=null,queueMicrotask(()=>{if(this.isConnected){this.reactRoot??=e;return}e.unmount()}))}attributeChangedCallback(){this.reactRoot!==null&&this.render()}render(){this.isConnected&&(this.reactRoot??=(0,JK.createRoot)(this.mountPoint),this.reactRoot.render(t(this)))}}customElements.define(e,r)}var rq={notice:`_notice_184jj_6`,title:`_title_184jj_23`,detail:`_detail_184jj_29`},iq=({tagName:e,detail:t})=>(0,D.jsxs)(`div`,{className:rq.notice,role:`alert`,children:[(0,D.jsxs)(`strong`,{className:rq.title,children:[`<`,e,`> could not start: invalid configuration`]}),(0,D.jsx)(`span`,{className:rq.detail,children:t})]}),aq=class{entries=new Map;getItem(e){return this.entries.get(e)??null}setItem(e,t){this.entries.set(e,t)}removeItem(e){this.entries.delete(e)}},oq=e=>{let t=new fB({storage:new aq,logger:e.logger,namespace:e.storageNamespace});return pB({completeSsoLoginUseCase:new Wz({authGateway:e.authGateway,sessionStore:t,logger:e.logger}),logoutUseCase:new Gz({authGateway:e.authGateway,sessionStore:t,logger:e.logger}),restoreSessionUseCase:new Kz({authGateway:e.authGateway,sessionStore:t,clock:e.clock,logger:e.logger}),refreshSessionUseCase:new qz({authGateway:e.authGateway,sessionStore:t,logger:e.logger}),setAccessToken:e.setAccessToken,loginUrl:``})},sq=`sdk_signed`,cq=`assertion`,lq=`CommunicationHub`,uq=class{httpClient;clock;logger;clientKey;scope;constructor(e){this.httpClient=e.httpClient,this.clock=e.clock,this.logger=e.logger.child(`sdk-signed-gateway`),this.clientKey=e.clientKey,this.scope=[lq,...e.modules].join(` `)}exchangeSsoSecret(e){return e.trim().length===0||this.clientKey.trim().length===0?Promise.resolve(N(new zz)):this.requestToken({grant_type:sq,client_id:this.clientKey,[cq]:e,scope:this.scope})}refresh(e){return Promise.resolve(N(new Bz(`sdk_signed re-authenticates with a fresh host assertion, not a refresh token.`)))}signOut(e){return Promise.resolve()}async requestToken(e){try{let t=await this.httpClient.postForm(tB,e,{anonymous:!0}),n=Jz.safeParse(t);return n.success?eB(n.data,this.clock.now()):(this.logger.error(`Token endpoint returned an unexpected shape`,n.error),N(new Bz(n.error)))}catch(e){return e instanceof lk&&e.isClientError()?(this.logger.warn(`Signed assertion was rejected`,{status:e.status}),N(new zz)):(this.logger.error(`Failed to exchange signed assertion`,{error:e}),N(new Bz(e)))}}},dq=class{clock;logger;constructor(e){this.clock=e.clock,this.logger=e.logger.child(`sdk-host-token-gateway`)}exchangeSsoSecret(e){if(e.trim().length===0)return Promise.resolve(N(new zz));try{let t=Qz(e);if(HD(t))return this.logger.error(`Invalid JWT token provided by host`,t.error),Promise.resolve(N(new Bz(`Invalid host token provided.`)));let n=t.value.exp;if(typeof n!=`number`)return Promise.resolve(N(new Bz(`Host token missing or invalid exp claim.`)));let r=n-Math.floor(this.clock.now().getTime()/1e3);return r<=0?Promise.resolve(N(new Bz(`Host token is already expired.`))):Promise.resolve(eB({access_token:e,token_type:`Bearer`,expires_in:r,refresh_token:null},this.clock.now()))}catch(e){return this.logger.error(`Failed to parse host token`,{error:e}),Promise.resolve(N(new Bz(e)))}}refresh(e){return Promise.resolve(N(new Bz(`host-token does not support traditional refresh tokens.`)))}signOut(e){return Promise.resolve()}},fq={feed:`CommunicationHub.Feed`,chat:`CommunicationHub.Chat`,meetings:`CommunicationHub.Meetings`,schedule:`CommunicationHub.Schedule`,users:`CommunicationHub.Users`,accessControl:`CommunicationHub.AccessControl`,usage:`CommunicationHub.Usage`,groupCategories:`CommunicationHub.GroupCategories`,webhooks:`CommunicationHub.Webhooks`,promotions:`CommunicationHub.Promotions`,orgSettings:`CommunicationHub.OrgSettings`,orgAccess:`CommunicationHub.OrgAccess`,feedPreference:`CommunicationHub.FeedPreference`,apiKeys:`CommunicationHub.SdkClients`},pq=class extends ui{},mq=class extends pq{code=`MODULE_ACCESS_UNAVAILABLE`;constructor(e){super(`Your menu access could not be loaded. Please try again.`,{cause:e})}},hq=[`commhub.chat`,`commhub.bookings`,`commhub.schedule`,`commhub.feed`],gq={"commhub.chat":fq.chat,"commhub.feed":fq.feed,"commhub.schedule":fq.schedule,"commhub.bookings":fq.meetings},_q=e=>Object.hasOwn(gq,e),vq=e=>hq.filter(t=>e.has(gq[t])),yq=(e,t)=>e.filter(e=>!t.has(gq[e])),bq=1e4,xq=1e3,Sq=6e4,Cq=class{deps;timer=null;unwatch=null;started=!1;disposed=!1;inFlight=!1;failures=0;authenticated=!1;constructor(e){this.deps=e}start(){this.started||this.isDisposed()||(this.started=!0,this.watchSession(),this.run())}isDisposed(){return this.disposed}dispose(){this.disposed=!0,this.clearTimer(),this.unwatch?.(),this.unwatch=null}async run(){if(!(this.isDisposed()||this.inFlight)){this.inFlight=!0;try{let e=await this.deps.requestCredential(),t=await this.deps.authStore.getState().completeLogin(e);if(this.isDisposed())return;if(t){await this.onAuthenticated();return}this.onExpired()}catch(e){if(this.isDisposed())return;let t=e instanceof Error?e.message:String(e);this.deps.logger.error(`SDK handshake failed`,{error:e}),this.deps.emit({type:`error`,payload:{code:`HANDSHAKE_FAILED`,message:t}}),this.scheduleRetry()}finally{this.inFlight=!1}}}async onAuthenticated(){this.failures=0,this.authenticated=!0;let e=await this.deps.moduleAccessModule.getModuleAccess.execute();if(!this.isDisposed()){if(e.ok){let t=e.value.grantedModules;this.deps.emit({type:`ready`,payload:{apiVersion:`1.0`,modules:vq(t)}});let n=yq(this.deps.requestedModules,t);n.length>0&&this.deps.emit({type:`scope-denied`,payload:{required:[...n],granted:vq(t)}})}this.scheduleRenewal()}}onExpired(){(this.authenticated||this.failures===0)&&this.deps.emit({type:`auth-expired`,payload:{}}),this.authenticated=!1,this.scheduleRetry()}scheduleRetry(){let e=Math.min(Sq,xq*2**this.failures);this.failures+=1,this.scheduleAt(e)}scheduleRenewal(){if(!this.deps.renewable)return;let e=this.deps.authStore.getState().session;if(!e)return;let t=e.expiresAt.getTime()-Date.now();this.scheduleAt(Math.max(0,t-bq))}scheduleAt(e){this.clearTimer(),!this.isDisposed()&&(this.timer=setTimeout(()=>{this.timer=null,this.run()},e))}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}watchSession(){this.unwatch=this.deps.authStore.subscribe(e=>{this.inFlight||e.status===`unauthenticated`&&this.authenticated&&(this.deps.logger.warn(`SDK session expired mid-session; re-handshaking`),this.onExpired())})}},wq=class{createRunner;eventListeners=new Set;statusListeners=new Set;runner=null;currentStatus=`pending`;constructor(e){this.createRunner=e}get status(){return this.currentStatus}attach(e){let t=e;t!==void 0&&this.eventListeners.add(t),this.runner??=this.createRunner(e=>{this.emit(e)}),this.runner.start();let n=!1;return()=>{n||(n=!0,t!==void 0&&this.eventListeners.delete(t),this.eventListeners.size===0&&this.statusListeners.size===0&&(this.runner?.dispose(),this.runner=null,this.setStatus(`pending`)))}}subscribeStatus(e){return this.statusListeners.add(e),()=>{this.statusListeners.delete(e)}}dispose(){this.runner?.dispose(),this.runner=null,this.eventListeners.clear(),this.statusListeners.clear(),this.currentStatus=`pending`}emit(e){e.type===`ready`?this.setStatus(`ready`):e.type===`error`?this.setStatus(`failed`):e.type===`auth-expired`&&this.setStatus(`pending`);for(let t of[...this.eventListeners])t(e)}setStatus(e){if(this.currentStatus!==e){this.currentStatus=e;for(let e of[...this.statusListeners])e()}}},Tq=class extends Error{constructor(e,t){let n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}},Eq=class extends Error{constructor(e=`A timeout occurred.`){let t=new.target.prototype;super(e),this.__proto__=t}},Dq=class extends Error{constructor(e=`An abort occurred.`){let t=new.target.prototype;super(e),this.__proto__=t}},Oq=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType=`UnsupportedTransportError`,this.__proto__=n}},kq=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType=`DisabledTransportError`,this.__proto__=n}},Aq=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType=`FailedToStartTransportError`,this.__proto__=n}},jq=class extends Error{constructor(e){let t=new.target.prototype;super(e),this.errorType=`FailedToNegotiateWithServerError`,this.__proto__=t}},Mq=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}},Nq=class{constructor(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}},Pq=class{get(e,t){return this.send({...t,method:`GET`,url:e})}post(e,t){return this.send({...t,method:`POST`,url:e})}delete(e,t){return this.send({...t,method:`DELETE`,url:e})}getCookieString(e){return``}},J;(function(e){e[e.Trace=0]=`Trace`,e[e.Debug=1]=`Debug`,e[e.Information=2]=`Information`,e[e.Warning=3]=`Warning`,e[e.Error=4]=`Error`,e[e.Critical=5]=`Critical`,e[e.None=6]=`None`})(J||={});var Fq=class{constructor(){}log(e,t){}};Fq.instance=new Fq;var Iq=`10.0.0`,Lq=class{static isRequired(e,t){if(e==null)throw Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,n){if(!(e in t))throw Error(`Unknown ${n} value: ${e}.`)}},Rq=class e{static get isBrowser(){return!e.isNode&&typeof window==`object`&&typeof window.document==`object`}static get isWebWorker(){return!e.isNode&&typeof self==`object`&&`importScripts`in self}static get isReactNative(){return!e.isNode&&typeof window==`object`&&window.document===void 0}static get isNode(){return typeof process<`u`&&process.release&&process.release.name===`node`}};function zq(e,t){let n=``;return Vq(e)?(n=`Binary data of length ${e.byteLength}`,t&&(n+=`. Content: '${Bq(e)}'`)):typeof e==`string`&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function Bq(e){let t=new Uint8Array(e),n=``;return t.forEach(e=>{n+=`0x${e<16?`0`:``}${e.toString(16)} `}),n.substring(0,n.length-1)}function Vq(e){return e&&typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name===`ArrayBuffer`)}async function Hq(e,t,n,r,i,a){let o={},[s,c]=Kq();o[s]=c,e.log(J.Trace,`(${t} transport) sending data. ${zq(i,a.logMessageContent)}.`);let l=Vq(i)?`arraybuffer`:`text`,u=await n.post(r,{content:i,headers:{...o,...a.headers},responseType:l,timeout:a.timeout,withCredentials:a.withCredentials});e.log(J.Trace,`(${t} transport) request complete. Response status: ${u.statusCode}.`)}function Uq(e){return e===void 0?new Gq(J.Information):e===null?Fq.instance:e.log===void 0?new Gq(e):e}var Wq=class{constructor(e,t){this._subject=e,this._observer=t}dispose(){let e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(e=>{})}},Gq=class{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){let n=`[${new Date().toISOString()}] ${J[e]}: ${t}`;switch(e){case J.Critical:case J.Error:this.out.error(n);break;case J.Warning:this.out.warn(n);break;case J.Information:this.out.info(n);break;default:this.out.log(n);break}}}};function Kq(){let e=`X-SignalR-User-Agent`;return Rq.isNode&&(e=`User-Agent`),[e,qq(Iq,Jq(),Xq(),Yq())]}function qq(e,t,n,r){let i=`Microsoft SignalR/`,a=e.split(`.`);return i+=`${a[0]}.${a[1]}`,i+=` (${e}; `,t&&t!==``?i+=`${t}; `:i+=`Unknown OS; `,i+=`${n}`,r?i+=`; ${r}`:i+=`; Unknown Runtime Version`,i+=`)`,i}function Jq(){if(Rq.isNode)switch(process.platform){case`win32`:return`Windows NT`;case`darwin`:return`macOS`;case`linux`:return`Linux`;default:return process.platform}else return``}function Yq(){if(Rq.isNode)return process.versions.node}function Xq(){return Rq.isNode?`NodeJS`:`Browser`}function Zq(e){return e.stack?e.stack:e.message?e.message:`${e}`}function Qq(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`could not find global`)}var $q=class extends Pq{constructor(e){if(super(),this._logger=e,typeof fetch>`u`||Rq.isNode){let e=typeof __webpack_require__==`function`?__non_webpack_require__:require;this._jar=new(e(`tough-cookie`)).CookieJar,typeof fetch>`u`?this._fetchType=e(`node-fetch`):this._fetchType=fetch,this._fetchType=e(`fetch-cookie`)(this._fetchType,this._jar)}else this._fetchType=fetch.bind(Qq());if(typeof AbortController>`u`){let e=typeof __webpack_require__==`function`?__non_webpack_require__:require;this._abortControllerType=e(`abort-controller`)}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new Dq;if(!e.method)throw Error(`No method defined.`);if(!e.url)throw Error(`No url defined.`);let t=new this._abortControllerType,n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new Dq});let r=null;if(e.timeout){let i=e.timeout;r=setTimeout(()=>{t.abort(),this._logger.log(J.Warning,`Timeout from HTTP request.`),n=new Eq},i)}e.content===``&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Vq(e.content)?e.headers[`Content-Type`]=`application/octet-stream`:e.headers[`Content-Type`]=`text/plain;charset=UTF-8`);let i;try{i=await this._fetchType(e.url,{body:e.content,cache:`no-cache`,credentials:e.withCredentials===!0?`include`:`same-origin`,headers:{"X-Requested-With":`XMLHttpRequest`,...e.headers},method:e.method,mode:`cors`,redirect:`follow`,signal:t.signal})}catch(e){throw n||(this._logger.log(J.Warning,`Error from HTTP request. ${e}.`),e)}finally{r&&clearTimeout(r),e.abortSignal&&(e.abortSignal.onabort=null)}if(!i.ok)throw new Tq(await eJ(i,`text`)||i.statusText,i.status);let a=await eJ(i,e.responseType);return new Nq(i.status,i.statusText,a)}getCookieString(e){let t=``;return Rq.isNode&&this._jar&&this._jar.getCookies(e,(e,n)=>t=n.join(`; `)),t}};function eJ(e,t){let n;switch(t){case`arraybuffer`:n=e.arrayBuffer();break;case`text`:n=e.text();break;case`blob`:case`document`:case`json`:throw Error(`${t} is not supported.`);default:n=e.text();break}return n}var tJ=class extends Pq{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Dq):e.method?e.url?new Promise((t,n)=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),r.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,r.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),e.content===``&&(e.content=void 0),e.content&&(Vq(e.content)?r.setRequestHeader(`Content-Type`,`application/octet-stream`):r.setRequestHeader(`Content-Type`,`text/plain;charset=UTF-8`));let i=e.headers;i&&Object.keys(i).forEach(e=>{r.setRequestHeader(e,i[e])}),e.responseType&&(r.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{r.abort(),n(new Dq)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new Nq(r.status,r.statusText,r.response||r.responseText)):n(new Tq(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(J.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),n(new Tq(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(J.Warning,`Timeout from HTTP request.`),n(new Eq)},r.send(e.content)}):Promise.reject(Error(`No url defined.`)):Promise.reject(Error(`No method defined.`))}},nJ=class extends Pq{constructor(e){if(super(),typeof fetch<`u`||Rq.isNode)this._httpClient=new $q(e);else if(typeof XMLHttpRequest<`u`)this._httpClient=new tJ(e);else throw Error(`No usable HttpClient found.`)}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Dq):e.method?e.url?this._httpClient.send(e):Promise.reject(Error(`No url defined.`)):Promise.reject(Error(`No method defined.`))}getCookieString(e){return this._httpClient.getCookieString(e)}},rJ=class e{static write(t){return`${t}${e.RecordSeparator}`}static parse(t){if(t[t.length-1]!==e.RecordSeparator)throw Error(`Message is incomplete.`);let n=t.split(e.RecordSeparator);return n.pop(),n}};rJ.RecordSeparatorCode=30,rJ.RecordSeparator=String.fromCharCode(rJ.RecordSeparatorCode);var iJ=class{writeHandshakeRequest(e){return rJ.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(Vq(e)){let r=new Uint8Array(e),i=r.indexOf(rJ.RecordSeparatorCode);if(i===-1)throw Error(`Message is incomplete.`);let a=i+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(r.slice(0,a))),n=r.byteLength>a?r.slice(a).buffer:null}else{let r=e,i=r.indexOf(rJ.RecordSeparator);if(i===-1)throw Error(`Message is incomplete.`);let a=i+1;t=r.substring(0,a),n=r.length>a?r.substring(a):null}let r=rJ.parse(t),i=JSON.parse(r[0]);if(i.type)throw Error(`Expected a handshake response from the server.`);return[n,i]}},aJ;(function(e){e[e.Invocation=1]=`Invocation`,e[e.StreamItem=2]=`StreamItem`,e[e.Completion=3]=`Completion`,e[e.StreamInvocation=4]=`StreamInvocation`,e[e.CancelInvocation=5]=`CancelInvocation`,e[e.Ping=6]=`Ping`,e[e.Close=7]=`Close`,e[e.Ack=8]=`Ack`,e[e.Sequence=9]=`Sequence`})(aJ||={});var oJ=class{constructor(){this.observers=[]}next(e){for(let t of this.observers)t.next(e)}error(e){for(let t of this.observers)t.error&&t.error(e)}complete(){for(let e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Wq(this,e)}},sJ=class{constructor(e,t,n){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=n}async _send(e){let t=this._protocol.writeMessage(e),n=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let e=()=>{},r=()=>{};Vq(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(n=new Promise((t,n)=>{e=t,r=n})),this._messages.push(new cJ(t,this._totalMessageCount,e,r))}try{this._reconnectInProgress||await this._connection.send(t)}catch{this._disconnected()}await n}_ack(e){let t=-1;for(let n=0;n<this._messages.length;n++){let r=this._messages[n];if(r._id<=e.sequenceId)t=n,Vq(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else if(this._bufferedByteCount<this._bufferSize)r._resolver();else break}t!==-1&&(this._messages=this._messages.slice(t+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type===aJ.Sequence?(this._waitForSequenceMessage=!1,!0):!1;if(!this._isInvocationMessage(e))return!0;let t=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,t<=this._latestReceivedSequenceId?(t===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=t,this._ackTimer(),!0)}_resetSequence(e){if(e.sequenceId>this._nextReceivingSequenceId){this._connection.stop(Error(`Sequence ID greater than amount of messages we've received.`));return}this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){let e=this._messages.length===0?this._totalMessageCount+1:this._messages[0]._id;await this._connection.send(this._protocol.writeMessage({type:aJ.Sequence,sequenceId:e}));let t=this._messages;for(let e of t)await this._connection.send(e._message);this._reconnectInProgress=!1}_dispose(e){e??=Error(`Unable to reconnect to server.`);for(let t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case aJ.Invocation:case aJ.StreamItem:case aJ.Completion:case aJ.StreamInvocation:case aJ.CancelInvocation:return!0;case aJ.Close:case aJ.Sequence:case aJ.Ping:case aJ.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:aJ.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}},cJ=class{constructor(e,t,n,r){this._message=e,this._id=t,this._resolver=n,this._rejector=r}},lJ=30*1e3,uJ=15*1e3,dJ=1e5,fJ;(function(e){e.Disconnected=`Disconnected`,e.Connecting=`Connecting`,e.Connected=`Connected`,e.Disconnecting=`Disconnecting`,e.Reconnecting=`Reconnecting`})(fJ||={});var pJ=class e{static create(t,n,r,i,a,o,s){return new e(t,n,r,i,a,o,s)}constructor(e,t,n,r,i,a,o){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(J.Warning,`The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep`)},Lq.isRequired(e,`connection`),Lq.isRequired(t,`logger`),Lq.isRequired(n,`protocol`),this.serverTimeoutInMilliseconds=i??lJ,this.keepAliveIntervalInMilliseconds=a??uJ,this._statefulReconnectBufferSize=o??dJ,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new iJ,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=fJ.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:aJ.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||``}set baseUrl(e){if(this._connectionState!==fJ.Disconnected&&this._connectionState!==fJ.Reconnecting)throw Error(`The HubConnection must be in the Disconnected or Reconnecting state to change the url.`);if(!e)throw Error(`The HubConnection url must be a valid url.`);this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==fJ.Disconnected)return Promise.reject(Error(`Cannot start a HubConnection that is not in the 'Disconnected' state.`));this._connectionState=fJ.Connecting,this._logger.log(J.Debug,`Starting HubConnection.`);try{await this._startInternal(),Rq.isBrowser&&window.document.addEventListener(`freeze`,this._freezeEventListener),this._connectionState=fJ.Connected,this._connectionStarted=!0,this._logger.log(J.Debug,`HubConnection connected successfully.`)}catch(e){return this._connectionState=fJ.Disconnected,this._logger.log(J.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;let e=new Promise((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t});await this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);let n={protocol:this._protocol.name,version:t};if(this._logger.log(J.Debug,`Sending handshake request.`),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),this._logger.log(J.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new sJ(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(J.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){let e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===fJ.Disconnected)return this._logger.log(J.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===fJ.Disconnecting)return this._logger.log(J.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;let t=this._connectionState;return this._connectionState=fJ.Disconnecting,this._logger.log(J.Debug,`Stopping HubConnection.`),this._reconnectDelayHandle?(this._logger.log(J.Debug,`Connection stopped during reconnect delay. Done reconnecting.`),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===fJ.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Dq(`The connection was stopped before the hub handshake could complete.`),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...t){let[n,r]=this._replaceStreamingParams(t),i=this._createStreamInvocation(e,t,r),a,o=new oJ;return o.cancelCallback=()=>{let e=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],a.then(()=>this._sendWithProtocol(e))},this._callbacks[i.invocationId]=(e,t)=>{if(t){o.error(t);return}else e&&(e.type===aJ.Completion?e.error?o.error(Error(e.error)):o.complete():o.next(e.item))},a=this._sendWithProtocol(i).catch(e=>{o.error(e),delete this._callbacks[i.invocationId]}),this._launchStreams(n,a),o}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){let[n,r]=this._replaceStreamingParams(t),i=this._sendWithProtocol(this._createInvocation(e,t,!0,r));return this._launchStreams(n,i),i}invoke(e,...t){let[n,r]=this._replaceStreamingParams(t),i=this._createInvocation(e,t,!1,r);return new Promise((e,t)=>{this._callbacks[i.invocationId]=(n,r)=>{if(r){t(r);return}else n&&(n.type===aJ.Completion?n.error?t(Error(n.error)):e(n.result):t(Error(`Unexpected message type: ${n.type}`)))};let r=this._sendWithProtocol(i).catch(e=>{t(e),delete this._callbacks[i.invocationId]});this._launchStreams(n,r)})}on(e,t){!e||!t||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();let n=this._methods[e];if(n)if(t){let r=n.indexOf(t);r!==-1&&(n.splice(r,1),n.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||=(e=this._processHandshakeResponse(e),!0),e){let t=this._protocol.parseMessages(e,this._logger);for(let e of t)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(e)))switch(e.type){case aJ.Invocation:this._invokeClientMethod(e).catch(e=>{this._logger.log(J.Error,`Invoke client method threw error: ${Zq(e)}`)});break;case aJ.StreamItem:case aJ.Completion:{let t=this._callbacks[e.invocationId];if(t){e.type===aJ.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(J.Error,`Stream callback threw error: ${Zq(e)}`)}}break}case aJ.Ping:break;case aJ.Close:{this._logger.log(J.Information,`Close message received from server.`);let t=e.error?Error(`Server returned an error on close: `+e.error):void 0;e.allowReconnect===!0?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}case aJ.Ack:this._messageBuffer&&this._messageBuffer._ack(e);break;case aJ.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(e);break;default:this._logger.log(J.Warning,`Invalid message type: ${e.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){let t=`Error parsing handshake response: `+e;this._logger.log(J.Error,t);let n=Error(t);throw this._handshakeRejecter(n),n}if(t.error){let e=`Server returned handshake error: `+t.error;this._logger.log(J.Error,e);let n=Error(e);throw this._handshakeRejecter(n),n}else this._logger.log(J.Debug,`Server handshake complete.`);return this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!this.connection.features||!this.connection.features.inherentKeepAlive){this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds);let e=this._nextKeepAlive-new Date().getTime();if(e<0){this._connectionState===fJ.Connected&&this._trySendPingMessage();return}this._pingServerHandle===void 0&&(e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{this._connectionState===fJ.Connected&&await this._trySendPingMessage()},e))}}serverTimeout(){this.connection.stop(Error(`Server timeout elapsed without receiving a message from the server.`))}async _invokeClientMethod(e){let t=e.target.toLowerCase(),n=this._methods[t];if(!n){this._logger.log(J.Warning,`No client method with the name '${t}' found.`),e.invocationId&&(this._logger.log(J.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,`Client didn't provide a result.`,null)));return}let r=n.slice(),i=!!e.invocationId,a,o,s;for(let n of r)try{let r=a;a=await n.apply(this,e.arguments),i&&a&&r&&(this._logger.log(J.Error,`Multiple results provided for '${t}'. Sending error to server.`),s=this._createCompletionMessage(e.invocationId,`Client provided multiple results.`,null)),o=void 0}catch(e){o=e,this._logger.log(J.Error,`A callback for the method '${t}' threw error '${e}'.`)}s?await this._sendWithProtocol(s):i?(o?s=this._createCompletionMessage(e.invocationId,`${o}`,null):a===void 0?(this._logger.log(J.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),s=this._createCompletionMessage(e.invocationId,`Client didn't provide a result.`,null)):s=this._createCompletionMessage(e.invocationId,null,a),await this._sendWithProtocol(s)):a&&this._logger.log(J.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(J.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Dq(`The underlying connection was closed before the hub handshake could complete.`),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||Error(`Invocation canceled due to the underlying connection being closed.`)),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===fJ.Disconnecting?this._completeClose(e):this._connectionState===fJ.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===fJ.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=fJ.Disconnected,this._connectionStarted=!1,this._messageBuffer&&=(this._messageBuffer._dispose(e??Error(`Connection closed.`)),void 0),Rq.isBrowser&&window.document.removeEventListener(`freeze`,this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(J.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){let t=Date.now(),n=0,r=e===void 0?Error(`Attempting to reconnect due to a unknown error.`):e,i=this._getNextRetryDelay(n,0,r);if(i===null){this._logger.log(J.Debug,`Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.`),this._completeClose(e);return}if(this._connectionState=fJ.Reconnecting,e?this._logger.log(J.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(J.Information,`Connection reconnecting.`),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(J.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==fJ.Reconnecting){this._logger.log(J.Debug,`Connection left the reconnecting state in onreconnecting callback. Done reconnecting.`);return}}for(;i!==null;){if(this._logger.log(J.Information,`Reconnect attempt number ${n+1} will start in ${i} ms.`),await new Promise(e=>{this._reconnectDelayHandle=setTimeout(e,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==fJ.Reconnecting){this._logger.log(J.Debug,`Connection left the reconnecting state during reconnect delay. Done reconnecting.`);return}try{if(await this._startInternal(),this._connectionState=fJ.Connected,this._logger.log(J.Information,`HubConnection reconnected successfully.`),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(e=>e.apply(this,[this.connection.connectionId]))}catch(e){this._logger.log(J.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(J.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==fJ.Reconnecting){this._logger.log(J.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===fJ.Disconnecting&&this._completeClose();return}n++,r=e instanceof Error?e:Error(e.toString()),i=this._getNextRetryDelay(n,Date.now()-t,r)}}this._logger.log(J.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(n){return this._logger.log(J.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){let t=this._callbacks;this._callbacks={},Object.keys(t).forEach(n=>{let r=t[n];try{r(null,e)}catch(t){this._logger.log(J.Error,`Stream 'error' callback called with '${e}' threw error: ${Zq(t)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&=(clearTimeout(this._pingServerHandle),void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,r){if(n)return r.length===0?{target:e,arguments:t,type:aJ.Invocation}:{target:e,arguments:t,streamIds:r,type:aJ.Invocation};{let n=this._invocationId;return this._invocationId++,r.length===0?{target:e,arguments:t,invocationId:n.toString(),type:aJ.Invocation}:{target:e,arguments:t,invocationId:n.toString(),streamIds:r,type:aJ.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||=Promise.resolve();for(let n in e)e[n].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n)))},error:e=>{let r;r=e instanceof Error?e.message:e&&e.toString?e.toString():`Unknown error`,t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n,r)))},next:e=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(n,e)))}})}}_replaceStreamingParams(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if(this._isObservable(i)){let a=this._invocationId;this._invocationId++,t[a]=i,n.push(a.toString()),e.splice(r,1)}}return[t,n]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe==`function`}_createStreamInvocation(e,t,n){let r=this._invocationId;return this._invocationId++,n.length===0?{target:e,arguments:t,invocationId:r.toString(),type:aJ.StreamInvocation}:{target:e,arguments:t,invocationId:r.toString(),streamIds:n,type:aJ.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:aJ.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:aJ.StreamItem}}_createCompletionMessage(e,t,n){return t?{error:t,invocationId:e,type:aJ.Completion}:{invocationId:e,result:n,type:aJ.Completion}}_createCloseMessage(){return{type:aJ.Close}}async _trySendPingMessage(){try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}},mJ=[0,2e3,1e4,3e4,null],hJ=class{constructor(e){this._retryDelays=e===void 0?mJ:[...e,null]}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}},gJ=class{};gJ.Authorization=`Authorization`,gJ.Cookie=`Cookie`;var _J=class extends Pq{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}async send(e){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf(`/negotiate?`)>0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);let n=await this._innerClient.send(e);return t&&n.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):n}_setAuthorizationHeader(e){e.headers||={},this._accessToken?e.headers[gJ.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[gJ.Authorization]&&delete e.headers[gJ.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}},vJ;(function(e){e[e.None=0]=`None`,e[e.WebSockets=1]=`WebSockets`,e[e.ServerSentEvents=2]=`ServerSentEvents`,e[e.LongPolling=4]=`LongPolling`})(vJ||={});var yJ;(function(e){e[e.Text=1]=`Text`,e[e.Binary=2]=`Binary`})(yJ||={});var bJ=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}},xJ=class{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new bJ,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if(Lq.isRequired(e,`url`),Lq.isRequired(t,`transferFormat`),Lq.isIn(t,yJ,`transferFormat`),this._url=e,this._logger.log(J.Trace,`(LongPolling transport) Connecting.`),t===yJ.Binary&&typeof XMLHttpRequest<`u`&&typeof new XMLHttpRequest().responseType!=`string`)throw Error(`Binary protocols over XmlHttpRequest not implementing advanced features are not supported.`);let[n,r]=Kq(),i={[n]:r,...this._options.headers},a={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};t===yJ.Binary&&(a.responseType=`arraybuffer`);let o=`${e}&_=${Date.now()}`;this._logger.log(J.Trace,`(LongPolling transport) polling: ${o}.`);let s=await this._httpClient.get(o,a);s.statusCode===200?this._running=!0:(this._logger.log(J.Error,`(LongPolling transport) Unexpected response code: ${s.statusCode}.`),this._closeError=new Tq(s.statusText||``,s.statusCode),this._running=!1),this._receiving=this._poll(this._url,a)}async _poll(e,t){try{for(;this._running;)try{let n=`${e}&_=${Date.now()}`;this._logger.log(J.Trace,`(LongPolling transport) polling: ${n}.`);let r=await this._httpClient.get(n,t);r.statusCode===204?(this._logger.log(J.Information,`(LongPolling transport) Poll terminated by server.`),this._running=!1):r.statusCode===200?r.content?(this._logger.log(J.Trace,`(LongPolling transport) data received. ${zq(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(J.Trace,`(LongPolling transport) Poll timed out, reissuing.`):(this._logger.log(J.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new Tq(r.statusText||``,r.statusCode),this._running=!1)}catch(e){this._running?e instanceof Eq?this._logger.log(J.Trace,`(LongPolling transport) Poll timed out, reissuing.`):(this._closeError=e,this._running=!1):this._logger.log(J.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(J.Trace,`(LongPolling transport) Polling complete.`),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Hq(this._logger,`LongPolling`,this._httpClient,this._url,e,this._options):Promise.reject(Error(`Cannot send until the transport is connected`))}async stop(){this._logger.log(J.Trace,`(LongPolling transport) Stopping polling.`),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(J.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);let e={},[t,n]=Kq();e[t]=n;let r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials},i;try{await this._httpClient.delete(this._url,r)}catch(e){i=e}i?i instanceof Tq&&(i.statusCode===404?this._logger.log(J.Trace,`(LongPolling transport) A 404 response was returned from sending a DELETE request.`):this._logger.log(J.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(J.Trace,`(LongPolling transport) DELETE request accepted.`)}finally{this._logger.log(J.Trace,`(LongPolling transport) Stop finished.`),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e=`(LongPolling transport) Firing onclose event.`;this._closeError&&(e+=` Error: `+this._closeError),this._logger.log(J.Trace,e),this.onclose(this._closeError)}}},SJ=class{constructor(e,t,n,r){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,t){return Lq.isRequired(e,`url`),Lq.isRequired(t,`transferFormat`),Lq.isIn(t,yJ,`transferFormat`),this._logger.log(J.Trace,`(SSE transport) Connecting.`),this._url=e,this._accessToken&&(e+=(e.indexOf(`?`)<0?`?`:`&`)+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((n,r)=>{let i=!1;if(t!==yJ.Text){r(Error(`The Server-Sent Events transport only supports the 'Text' transfer format`));return}let a;if(Rq.isBrowser||Rq.isWebWorker)a=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{let t=this._httpClient.getCookieString(e),n={};n.Cookie=t;let[r,i]=Kq();n[r]=i,a=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...n,...this._options.headers}})}try{a.onmessage=e=>{if(this.onreceive)try{this._logger.log(J.Trace,`(SSE transport) data received. ${zq(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){this._close(e);return}},a.onerror=e=>{i?this._close():r(Error(`EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled.`))},a.onopen=()=>{this._logger.log(J.Information,`SSE connected to ${this._url}`),this._eventSource=a,i=!0,n()}}catch(e){r(e);return}})}async send(e){return this._eventSource?Hq(this._logger,`SSE`,this._httpClient,this._url,e,this._options):Promise.reject(Error(`Cannot send until the transport is connected`))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}},CJ=class{constructor(e,t,n,r,i,a){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=a}async connect(e,t){Lq.isRequired(e,`url`),Lq.isRequired(t,`transferFormat`),Lq.isIn(t,yJ,`transferFormat`),this._logger.log(J.Trace,`(WebSockets transport) Connecting.`);let n;return this._accessTokenFactory&&(n=await this._accessTokenFactory()),new Promise((r,i)=>{e=e.replace(/^http/,`ws`);let a,o=this._httpClient.getCookieString(e),s=!1;if(Rq.isNode||Rq.isReactNative){let t={},[r,i]=Kq();t[r]=i,n&&(t[gJ.Authorization]=`Bearer ${n}`),o&&(t[gJ.Cookie]=o),a=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}else n&&(e+=(e.indexOf(`?`)<0?`?`:`&`)+`access_token=${encodeURIComponent(n)}`);a||=new this._webSocketConstructor(e),t===yJ.Binary&&(a.binaryType=`arraybuffer`),a.onopen=t=>{this._logger.log(J.Information,`WebSocket connected to ${e}.`),this._webSocket=a,s=!0,r()},a.onerror=e=>{let t=null;t=typeof ErrorEvent<`u`&&e instanceof ErrorEvent?e.error:`There was an error with the transport`,this._logger.log(J.Information,`(WebSockets transport) ${t}.`)},a.onmessage=e=>{if(this._logger.log(J.Trace,`(WebSockets transport) data received. ${zq(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){this._close(e);return}},a.onclose=e=>{if(s)this._close(e);else{let t=null;t=typeof ErrorEvent<`u`&&e instanceof ErrorEvent?e.error:`WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.`,i(Error(t))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(J.Trace,`(WebSockets transport) sending data. ${zq(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject(`WebSocket is not in the OPEN state`)}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&=(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),void 0),this._logger.log(J.Trace,`(WebSockets transport) socket closed.`),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(Error(`WebSocket closed with status code: ${e.code} (${e.reason||`no reason given`}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean==`boolean`&&typeof e.code==`number`}},wJ=100,TJ=class{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Lq.isRequired(e,`url`),this._logger=Uq(t.logger),this.baseUrl=this._resolveUrl(e),t||={},t.logMessageContent=t.logMessageContent===void 0?!1:t.logMessageContent,typeof t.withCredentials==`boolean`||t.withCredentials===void 0)t.withCredentials=t.withCredentials===void 0?!0:t.withCredentials;else throw Error(`withCredentials option was not a 'boolean' or 'undefined' value`);t.timeout=t.timeout===void 0?100*1e3:t.timeout;let n=null,r=null;if(Rq.isNode&&typeof require<`u`){let e=typeof __webpack_require__==`function`?__non_webpack_require__:require;n=e(`ws`),r=e(`eventsource`)}!Rq.isNode&&typeof WebSocket<`u`&&!t.WebSocket?t.WebSocket=WebSocket:Rq.isNode&&!t.WebSocket&&n&&(t.WebSocket=n),!Rq.isNode&&typeof EventSource<`u`&&!t.EventSource?t.EventSource=EventSource:Rq.isNode&&!t.EventSource&&r!==void 0&&(t.EventSource=r),this._httpClient=new _J(t.httpClient||new nJ(this._logger),t.accessTokenFactory),this._connectionState=`Disconnected`,this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e||=yJ.Binary,Lq.isIn(e,yJ,`transferFormat`),this._logger.log(J.Debug,`Starting connection with transfer format '${yJ[e]}'.`),this._connectionState!==`Disconnected`)return Promise.reject(Error(`Cannot start an HttpConnection that is not in the 'Disconnected' state.`));if(this._connectionState=`Connecting`,this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,this._connectionState===`Disconnecting`){let e=`Failed to start the HttpConnection before stop() was called.`;return this._logger.log(J.Error,e),await this._stopPromise,Promise.reject(new Dq(e))}else if(this._connectionState!==`Connected`){let e=`HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!`;return this._logger.log(J.Error,e),Promise.reject(new Dq(e))}this._connectionStarted=!0}send(e){return this._connectionState===`Connected`?(this._sendQueue||=new DJ(this.transport),this._sendQueue.send(e)):Promise.reject(Error(`Cannot send data if the connection is not in the 'Connected' State.`))}async stop(e){if(this._connectionState===`Disconnected`)return this._logger.log(J.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState===`Disconnecting`)return this._logger.log(J.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState=`Disconnecting`,this._stopPromise=new Promise(e=>{this._stopPromiseResolver=e}),await this._stopInternal(e),await this._stopPromise}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(J.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(J.Debug,`HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.`)}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===vJ.WebSockets)this.transport=this._constructTransport(vJ.WebSockets),await this._startTransport(t,e);else throw Error(`Negotiation can only be skipped when using the WebSocket transport directly.`);else{let n=null,r=0;do{if(n=await this._getNegotiationResponse(t),this._connectionState===`Disconnecting`||this._connectionState===`Disconnected`)throw new Dq(`The connection was stopped during negotiation.`);if(n.error)throw Error(n.error);if(n.ProtocolVersion)throw Error(`Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.`);if(n.url&&(t=n.url),n.accessToken){let e=n.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}r++}while(n.url&&r<wJ);if(r===wJ&&n.url)throw Error(`Negotiate redirection limit exceeded.`);await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof xJ&&(this.features.inherentKeepAlive=!0),this._connectionState===`Connecting`&&(this._logger.log(J.Debug,`The HttpConnection connected successfully.`),this._connectionState=`Connected`)}catch(e){return this._logger.log(J.Error,`Failed to start the connection: `+e),this._connectionState=`Disconnected`,this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){let t={},[n,r]=Kq();t[n]=r;let i=this._resolveNegotiateUrl(e);this._logger.log(J.Debug,`Sending negotiation request: ${i}.`);try{let e=await this._httpClient.post(i,{content:``,headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(e.statusCode!==200)return Promise.reject(Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));let n=JSON.parse(e.content);return(!n.negotiateVersion||n.negotiateVersion<1)&&(n.connectionToken=n.connectionId),n.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new jq(`Client didn't negotiate Stateful Reconnect but the server did.`)):n}catch(e){let t=`Failed to complete negotiation with the server: `+e;return e instanceof Tq&&e.statusCode===404&&(t+=` Either this is not a SignalR endpoint or there is a proxy blocking the connection.`),this._logger.log(J.Error,t),Promise.reject(new jq(t))}}_createConnectUrl(e,t){return t?e+(e.indexOf(`?`)===-1?`?`:`&`)+`id=${t}`:e}async _createTransport(e,t,n,r){let i=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t)){this._logger.log(J.Debug,`Connection was provided an instance of ITransport, using that directly.`),this.transport=t,await this._startTransport(i,r),this.connectionId=n.connectionId;return}let a=[],o=n.availableTransports||[],s=n;for(let n of o){let o=this._resolveTransportOrError(n,t,r,s?.useStatefulReconnect===!0);if(o instanceof Error)a.push(`${n.transport} failed:`),a.push(o);else if(this._isITransport(o)){if(this.transport=o,!s){try{s=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}i=this._createConnectUrl(e,s.connectionToken)}try{await this._startTransport(i,r),this.connectionId=s.connectionId;return}catch(e){if(this._logger.log(J.Error,`Failed to start the transport '${n.transport}': ${e}`),s=void 0,a.push(new Aq(`${n.transport} failed: ${e}`,vJ[n.transport])),this._connectionState!==`Connecting`){let e=`Failed to select transport before stop() was called.`;return this._logger.log(J.Debug,e),Promise.reject(new Dq(e))}}}}return a.length>0?Promise.reject(new Mq(`Unable to connect to the server with any of the available transports. ${a.join(` `)}`,a)):Promise.reject(Error(`None of the transports supported by the client are supported by the server.`))}_constructTransport(e){switch(e){case vJ.WebSockets:if(!this._options.WebSocket)throw Error(`'WebSocket' is not supported in your environment.`);return new CJ(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case vJ.ServerSentEvents:if(!this._options.EventSource)throw Error(`'EventSource' is not supported in your environment.`);return new SJ(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case vJ.LongPolling:return new xJ(this._httpClient,this._logger,this._options);default:throw Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async n=>{let r=!1;if(this.features.reconnect)try{this.features.disconnected(),await this.transport.connect(e,t),await this.features.resend()}catch{r=!0}else{this._stopConnection(n);return}r&&this._stopConnection(n)}:this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n,r){let i=vJ[e.transport];if(i==null)return this._logger.log(J.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(EJ(t,i))if(e.transferFormats.map(e=>yJ[e]).indexOf(n)>=0){if(i===vJ.WebSockets&&!this._options.WebSocket||i===vJ.ServerSentEvents&&!this._options.EventSource)return this._logger.log(J.Debug,`Skipping transport '${vJ[i]}' because it is not supported in your environment.'`),new Oq(`'${vJ[i]}' is not supported in your environment.`,i);this._logger.log(J.Debug,`Selecting transport '${vJ[i]}'.`);try{return this.features.reconnect=i===vJ.WebSockets?r:void 0,this._constructTransport(i)}catch(e){return e}}else return this._logger.log(J.Debug,`Skipping transport '${vJ[i]}' because it does not support the requested transfer format '${yJ[n]}'.`),Error(`'${vJ[i]}' does not support ${yJ[n]}.`);else return this._logger.log(J.Debug,`Skipping transport '${vJ[i]}' because it was disabled by the client.`),new kq(`'${vJ[i]}' is disabled by the client.`,i)}_isITransport(e){return e&&typeof e==`object`&&`connect`in e}_stopConnection(e){if(this._logger.log(J.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState===`Disconnected`){this._logger.log(J.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState===`Connecting`)throw this._logger.log(J.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState===`Disconnecting`&&this._stopPromiseResolver(),e?this._logger.log(J.Error,`Connection disconnected with error '${e}'.`):this._logger.log(J.Information,`Connection disconnected.`),this._sendQueue&&=(this._sendQueue.stop().catch(e=>{this._logger.log(J.Error,`TransportSendQueue.stop() threw error '${e}'.`)}),void 0),this.connectionId=void 0,this._connectionState=`Disconnected`,this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(J.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}_resolveUrl(e){if(e.lastIndexOf(`https://`,0)===0||e.lastIndexOf(`http://`,0)===0)return e;if(!Rq.isBrowser)throw Error(`Cannot resolve '${e}'.`);let t=window.document.createElement(`a`);return t.href=e,this._logger.log(J.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){let t=new URL(e);t.pathname.endsWith(`/`)?t.pathname+=`negotiate`:t.pathname+=`/negotiate`;let n=new URLSearchParams(t.searchParams);return n.has(`negotiateVersion`)||n.append(`negotiateVersion`,this._negotiateVersion.toString()),n.has(`useStatefulReconnect`)?n.get(`useStatefulReconnect`)===`true`&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&n.append(`useStatefulReconnect`,`true`),t.search=n.toString(),t.toString()}};function EJ(e,t){return!e||(t&e)!==0}var DJ=class e{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new OJ,this._transportResult=new OJ,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||=new OJ,this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject(`Connection stopped.`);break}this._sendBufferedData=new OJ;let t=this._transportResult;this._transportResult=void 0;let n=typeof this._buffer[0]==`string`?this._buffer.join(``):e._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),t.resolve()}catch(e){t.reject(e)}}}static _concatBuffers(e){let t=e.map(e=>e.byteLength).reduce((e,t)=>e+t),n=new Uint8Array(t),r=0;for(let t of e)n.set(new Uint8Array(t),r),r+=t.byteLength;return n.buffer}},OJ=class{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}},kJ=`json`,AJ=class{constructor(){this.name=kJ,this.version=2,this.transferFormat=yJ.Text}parseMessages(e,t){if(typeof e!=`string`)throw Error(`Invalid input for JSON hub protocol. Expected a string.`);if(!e)return[];t===null&&(t=Fq.instance);let n=rJ.parse(e),r=[];for(let e of n){let n=JSON.parse(e);if(typeof n.type!=`number`)throw Error(`Invalid payload.`);switch(n.type){case aJ.Invocation:this._isInvocationMessage(n);break;case aJ.StreamItem:this._isStreamItemMessage(n);break;case aJ.Completion:this._isCompletionMessage(n);break;case aJ.Ping:break;case aJ.Close:break;case aJ.Ack:this._isAckMessage(n);break;case aJ.Sequence:this._isSequenceMessage(n);break;default:t.log(J.Information,`Unknown message type '`+n.type+`' ignored.`);continue}r.push(n)}return r}writeMessage(e){return rJ.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,`Invalid payload for Invocation message.`),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,`Invalid payload for Invocation message.`)}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,`Invalid payload for StreamItem message.`),e.item===void 0)throw Error(`Invalid payload for StreamItem message.`)}_isCompletionMessage(e){if(e.result&&e.error)throw Error(`Invalid payload for Completion message.`);!e.result&&e.error&&this._assertNotEmptyString(e.error,`Invalid payload for Completion message.`),this._assertNotEmptyString(e.invocationId,`Invalid payload for Completion message.`)}_isAckMessage(e){if(typeof e.sequenceId!=`number`)throw Error(`Invalid SequenceId for Ack message.`)}_isSequenceMessage(e){if(typeof e.sequenceId!=`number`)throw Error(`Invalid SequenceId for Sequence message.`)}_assertNotEmptyString(e,t){if(typeof e!=`string`||e===``)throw Error(t)}},jJ={trace:J.Trace,debug:J.Debug,info:J.Information,information:J.Information,warn:J.Warning,warning:J.Warning,error:J.Error,critical:J.Critical,none:J.None};function MJ(e){let t=jJ[e.toLowerCase()];if(t!==void 0)return t;throw Error(`Unknown log level: ${e}`)}var NJ=class{configureLogging(e){if(Lq.isRequired(e,`logging`),PJ(e))this.logger=e;else if(typeof e==`string`){let t=MJ(e);this.logger=new Gq(t)}else this.logger=new Gq(e);return this}withUrl(e,t){return Lq.isRequired(e,`url`),Lq.isNotEmpty(e,`url`),this.url=e,typeof t==`object`?this.httpConnectionOptions={...this.httpConnectionOptions,...t}:this.httpConnectionOptions={...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return Lq.isRequired(e,`protocol`),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw Error(`A reconnectPolicy has already been set.`);return e?Array.isArray(e)?this.reconnectPolicy=new hJ(e):this.reconnectPolicy=e:this.reconnectPolicy=new hJ,this}withServerTimeout(e){return Lq.isRequired(e,`milliseconds`),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return Lq.isRequired(e,`milliseconds`),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){let e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw Error(`The 'HubConnectionBuilder.withUrl' method must be called before building the connection.`);let t=new TJ(this.url,e);return pJ.create(t,this.logger||Fq.instance,this.protocol||new AJ,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}};function PJ(e){return e.log!==void 0}var FJ=15e3,IJ=5,LJ=(e,t=Math.random)=>{let n=Math.min(FJ,1e3*2**Math.min(Math.max(e,0),IJ));return Math.round(t()*n)},RJ=class{nextRetryDelayInMilliseconds(e){return LJ(e.previousRetryCount)}},zJ=e=>({log(t,n){t>=J.Error?e.error(n):t>=J.Warning?e.warn(n):e.debug(n)}}),BJ=e=>{switch(e){case fJ.Connected:return`connected`;case fJ.Connecting:return`connecting`;case fJ.Reconnecting:return`reconnecting`;case fJ.Disconnected:case fJ.Disconnecting:return`disconnected`;default:return`disconnected`}},VJ=class{connection;logger;statusHandlers=new Set;starting=null;intentionallyStopped=!0;reconnectTimer=null;reconnectAttempt=0;constructor(e,t){this.logger=t.child(`realtime`),this.connection=new NJ().withUrl(e.url,{accessTokenFactory:()=>e.accessTokenProvider()??``}).withAutomaticReconnect(new RJ).configureLogging(zJ(this.logger)).build(),this.connection.onreconnecting(()=>{this.emitStatus(`reconnecting`)}),this.connection.onreconnected(()=>{this.reconnectAttempt=0,this.emitStatus(`connected`)}),this.connection.onclose(()=>{this.emitStatus(`disconnected`),this.scheduleReconnect()})}get status(){return BJ(this.connection.state)}async start(){if(this.intentionallyStopped=!1,this.clearReconnectTimer(),this.connection.state===fJ.Disconnecting)for(;this.connection.state===fJ.Disconnecting;)await new Promise(e=>setTimeout(e,50));if(this.connection.state===fJ.Disconnected)return this.starting===null?(this.emitStatus(`connecting`),this.starting=this.connection.start().then(()=>{this.reconnectAttempt=0,this.emitStatus(`connected`)}).catch(e=>{throw this.emitStatus(`disconnected`),this.logger.warn(`Realtime connection failed to start`),e}).finally(()=>{this.starting=null}),this.starting):this.starting}async stop(){this.intentionallyStopped=!0,this.clearReconnectTimer(),await this.connection.stop(),this.emitStatus(`disconnected`)}on(e,t){let n=e=>{t(e)};return this.connection.on(e,n),()=>{this.connection.off(e,n)}}invoke(e,...t){return this.connection.invoke(e,...t)}onStatusChange(e){return this.statusHandlers.add(e),e(this.status),()=>{this.statusHandlers.delete(e)}}scheduleReconnect(){if(this.intentionallyStopped)return;this.clearReconnectTimer();let e=LJ(this.reconnectAttempt);this.reconnectAttempt+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectNow()},e)}async reconnectNow(){if(this.reconnectTimer=null,!(this.intentionallyStopped||this.connection.state!==fJ.Disconnected)){if(!this.isOnline()){this.scheduleReconnect();return}this.emitStatus(`reconnecting`);try{await this.connection.start(),this.reconnectAttempt=0,this.emitStatus(`connected`)}catch{this.emitStatus(`disconnected`),this.scheduleReconnect()}}}clearReconnectTimer(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}isOnline(){return typeof navigator>`u`?!0:navigator.onLine}emitStatus(e){for(let t of this.statusHandlers)t(e)}},HJ=class{logger;constructor(e){this.logger=e.logger}create(e){return new VJ(e,this.logger)}},UJ=class{status=`disconnected`;async start(){return Promise.resolve()}async stop(){return Promise.resolve()}on(e,t){return()=>{}}async invoke(e,...t){return Promise.reject(Error(`Cannot invoke method on NullRealtimeConnection`))}onStatusChange(e){return()=>{}}},WJ=class{moduleAccessGateway;logger;constructor(e){this.moduleAccessGateway=e.moduleAccessGateway,this.logger=e.logger.child(`get-module-access`)}async execute(){let e=await this.moduleAccessGateway.getModuleAccess();return e.ok||this.logger.warn(`Loading module access failed`,{code:e.error.code}),e}},GJ=`/api/app/sdk-capabilities`,KJ=G({apiVersion:V(),modules:W(V())}),qJ=e=>{let t=new Set;for(let n of e.modules)_q(n)&&t.add(gq[n]);return{grantedModules:t,grantedPolicies:new Set,canManageUserAccess:!1}},JJ=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`sdk-module-access`)}async getModuleAccess(){let e;try{e=await this.httpClient.get(GJ)}catch(e){return this.logger.error(`Failed to fetch SDK capabilities`,{error:e}),N(new mq(e))}let t=KJ.safeParse(e);return t.success?M(qJ(t.data)):(this.logger.error(`Malformed capabilities response`,{error:t.error}),N(new mq(t.error)))}},YJ=e=>({getModuleAccess:new WJ({moduleAccessGateway:new JJ({httpClient:e.httpClient,logger:e.logger}),logger:e.logger}),gateMode:`fail-closed`}),XJ=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`list-conversations`)}async execute(e){let t=await this.chatGateway.listConversations(e);return t.ok||this.logger.warn(`Listing conversations failed`,{code:t.error.code}),t}},ZJ=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-conversation`)}async execute(e){let t=await this.chatGateway.getConversation(e);return t.ok||this.logger.warn(`Fetching conversation failed`,{code:t.error.code}),t}},QJ=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-conversation-counts`)}async execute(){let e=await this.chatGateway.getConversationCounts();return e.ok||this.logger.warn(`Fetching conversation counts failed`,{code:e.error.code}),e}},$J=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`list-staff`)}async execute(e){let t=await this.chatGateway.listStaff(e);return t.ok||this.logger.warn(`Listing staff failed`,{code:t.error.code}),t}},eY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-group-member-pool`)}async execute(e){let t=await this.chatGateway.getGroupMemberPool(e);return t.ok||this.logger.warn(`Fetching the group member pool failed`,{code:t.error.code}),t}},tY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-viewer`)}async execute(){let e=await this.chatGateway.getViewer();return e.ok||this.logger.warn(`Loading viewer failed`,{code:e.error.code}),e}},nY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-messages`)}async execute(e){let t=await this.chatGateway.getMessages(e,50);return t.ok||this.logger.warn(`Loading messages failed`,{code:t.error.code}),t}},rY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-messages-since`)}async execute(e,t,n){let r=await this.chatGateway.getMessagesSince(e,t,n);return r.ok||this.logger.warn(`Loading messages since cursor failed`,{code:r.error.code}),r}},iY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`get-messages-before`)}async execute(e,t,n){let r=await this.chatGateway.getMessagesBefore(e,t,n);return r.ok||this.logger.warn(`Loading messages before cursor failed`,{code:r.error.code}),r}},aY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`start-direct`)}async execute(e){let t=e.trim();return t.length===0?(this.logger.warn(`Rejected start-direct with no recipient`),N(new TP)):this.chatGateway.startDirect(t)}},oY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`create-group`)}async execute(e,t){let n=e.trim();return n.length===0?(this.logger.warn(`Rejected group with no title`),N(new CP)):t.length===0?(this.logger.warn(`Rejected group with no members`),N(new wP)):this.chatGateway.createGroup(n,t)}},sY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`send-message`)}async execute(e,t,n,r){let i=t.trim();return i.length===0?(this.logger.warn(`Rejected empty message`,{conversationId:e}),N(new xP)):i.length>4e3?(this.logger.warn(`Rejected oversized message`,{conversationId:e}),N(new SP(4e3))):this.chatGateway.sendMessage(e,i,n,r)}},cY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`mark-delivered`)}execute(e,t){return this.logger.debug(`Mark delivered`,{conversationId:e,uptoSequence:t}),this.chatGateway.markDelivered(e,t)}},lY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`mark-read`)}execute(e,t){return this.logger.debug(`Mark read`,{conversationId:e,uptoSequence:t}),this.chatGateway.markRead(e,t)}},uY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`set-favourite`)}async execute(e,t){return this.logger.info(`Set favourite`,{conversationId:e,favourite:t}),this.chatGateway.setFavourite(e,t)}},dY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`set-archived`)}async execute(e,t){return this.logger.info(`Set archived`,{conversationId:e,archived:t}),this.chatGateway.setArchived(e,t)}},fY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`set-pinned`)}async execute(e,t){return this.logger.info(`Set pinned`,{conversationId:e,pinned:t}),this.chatGateway.setPinned(e,t)}},pY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`delete-conversation`)}async execute(e){return this.logger.info(`Delete conversation`,{conversationId:e}),this.chatGateway.deleteConversation(e)}},mY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`leave-conversation`)}async execute(e){return this.logger.info(`Leave conversation`,{conversationId:e}),this.chatGateway.leaveConversation(e)}},hY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`refresh-portal`)}async execute(e){return this.logger.info(`Refresh portal data`,{conversationId:e}),this.chatGateway.refreshPortal(e)}},gY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`react-to-message`)}async execute(e,t,n){return n.trim().length===0?(this.logger.warn(`Rejected empty reaction`,{conversationId:e,messageId:t}),N(new bP)):this.chatGateway.reactToMessage(e,t,n)}},_Y=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`save-members`)}async execute(e,t,n){return this.logger.info(`Save members`,{conversationId:e,members:t.length,admins:n.length}),this.chatGateway.saveMembers(e,t,n)}},vY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`edit-message`)}async execute(e,t,n){let r=n.trim(),i=await this.chatGateway.editMessage(e,t,r);return i.ok||this.logger.warn(`Edit message failed`,{code:i.error.code}),i}},yY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`delete-message`)}async execute(e,t){let n=await this.chatGateway.deleteMessage(e,t);return n.ok||this.logger.warn(`Delete message failed`,{code:n.error.code}),n}},bY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`delete-message-for-me`)}async execute(e,t){let n=await this.chatGateway.deleteMessageForMe(e,t);return n.ok||this.logger.warn(`Delete message for me failed`,{code:n.error.code}),n}},xY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`send-media-message`)}async execute(e){let t=await this.chatGateway.sendMediaMessage(e);return t.ok||this.logger.warn(`Send media message failed`,{code:t.error.code}),t}},SY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`download-chat-media`)}async execute(e){let t=await this.chatGateway.downloadMedia(e);return t.ok||this.logger.warn(`Downloading media failed`,{code:t.error.code}),t}},CY=class{chatGateway;logger;constructor(e){this.chatGateway=e.chatGateway,this.logger=e.logger.child(`subscribe-push`)}async execute(e){let t=await this.chatGateway.subscribePush(e);return t.ok||this.logger.warn(`Subscribe push failed`,{code:t.error.code}),t}},wY=e=>{let t={chatGateway:new cG({httpClient:e.httpClient,clock:e.clock,logger:e.logger}),logger:e.logger},n=bG();return{listConversations:new XJ(t),getConversation:new ZJ(t),getConversationCounts:new QJ(t),listStaff:new $J(t),getGroupMemberPool:new eY(t),getViewer:new tY(t),getMessages:new nY(t),getMessagesSince:new rY(t),getMessagesBefore:new iY(t),startDirect:new aY(t),createGroup:new oY(t),sendMessage:new sY(t),sendMediaMessage:new xY(t),downloadChatMedia:new SY(t),editMessage:new vY(t),deleteMessage:new yY(t),deleteMessageForMe:new bY(t),subscribePush:new CY(t),markDelivered:new cY(t),markRead:new lY(t),setFavourite:new uY(t),setArchived:new dY(t),setPinned:new fY(t),deleteConversation:new pY(t),leaveConversation:new mY(t),refreshPortal:new hY(t),reactToMessage:new gY(t),saveMembers:new _Y(t),clock:e.clock,realtime:e.realtime,realtimeStore:hP(),logger:e.logger.child(`chat-realtime`),outbox:n}},TY=({module:e,children:t})=>(0,D.jsx)(IP.Provider,{value:e,children:(0,D.jsx)(gP.Provider,{value:e.realtimeStore,children:t})}),EY=e=>e.connection.on(xG.MessageReceived,t=>{let n=jG(t,xG.MessageReceived,e.logger);if(n===null)return;let r=e.viewerId()??``,i=GG(fW(n),r);if(e.queryClient.setQueryData(cF(n.conversationId),e=>mV(e??[],i)),KP(e.queryClient),i.kind===`system`){if(i.text.endsWith(` left the group`)){let t=i.text.slice(0,-15).trim().toLowerCase();YP(e.queryClient,n.conversationId,e=>{let n=e.members.find(e=>e.name.toLowerCase()===t);return n===void 0?e:e.with({members:e.members.filter(e=>e.id!==n.id),adminIds:e.adminIds.filter(e=>e!==n.id)})})}e.queryClient.refetchQueries({queryKey:BP(n.conversationId)})}}),DY=(e,t,n)=>e.connection.on(t,r=>{let i=MG(r,t,e.logger);i===null||i.byUserId===e.viewerId()||e.store.getState().applyReceipt(i.conversationId,i.byUserId,n,i.uptoSequence)}),OY=e=>e.connection.on(xG.Typing,t=>{let n=NG(t,xG.Typing,e.logger);n===null||n.userId===e.viewerId()||e.store.getState().applyTyping(n.conversationId,n.userId,n.isTyping,Date.now())}),kY=e=>e.connection.on(xG.ReactionToggled,t=>{let n=IG(t,xG.ReactionToggled,e.logger),r=e.viewerId();n===null||n.byUserId===r||e.queryClient.setQueryData(cF(n.conversationId),e=>e?.map(e=>e.id===n.messageId?eF(e,n,r??``):e))}),AY=e=>e.connection.on(xG.MessageEdited,t=>{let n=jG(t,xG.MessageEdited,e.logger);if(n===null)return;let r=e.viewerId()??``,i=GG(fW(n),r);e.queryClient.setQueryData(cF(n.conversationId),e=>e?.map(e=>e.id===i.id?i:e)??[i])}),jY=e=>e.connection.on(xG.MessageDeleted,t=>{let n=LG(t,xG.MessageDeleted,e.logger);n!==null&&(e.queryClient.setQueryData(cF(n.conversationId),e=>e?.map(e=>e.id===n.messageId?e.asDeletedForEveryone():e)??[]),KP(e.queryClient))}),MY=e=>e.connection.on(xG.RemovedFromConversation,t=>{let n=RG(t,xG.RemovedFromConversation,e.logger);n!==null&&e.store.getState().markRemovedFromConversation(n.conversationId)}),NY=e=>e.connection.on(xG.PresenceChanged,t=>{let n=PG(t,xG.PresenceChanged,e.logger);n!==null&&e.store.getState().applyPresence(n.userId,n.online,n.lastSeenUtc)}),PY=e=>e.connection.on(xG.StatusChanged,t=>{let n=FG(t,xG.StatusChanged,e.logger);n!==null&&jR(n.userId,SR(n.status),n.untilUtc??null)}),FY=e=>{let t=[EY(e),AY(e),jY(e),DY(e,xG.MessageDelivered,`delivered`),DY(e,xG.MessageRead,`read`),OY(e),NY(e),PY(e),kY(e),MY(e)];return()=>{for(let e of t)e()}},IY=(e,t,n)=>{n.length!==0&&e.setQueryData(cF(t),e=>n.reduce((e,t)=>mV(e,t),e??[]))},LY=async(e,t,n,r)=>{let i=e.getState().activeConversationId;if(i===null){qP(t);return}let a=yV(t.getQueryData(cF(i))??[]);try{IY(t,i,await P(n.execute(i,a,50)))}catch{r.warn(`Reconnect sync failed; conversation list will still refresh`)}qP(t)},RY=()=>{let{realtime:e,getMessagesSince:t,logger:r}=LP(),i=_P(),a=sN();(0,n.useEffect)(()=>{let n=e.status;return e.onStatusChange(e=>{e===`connected`&&n!==`connected`&&LY(i,a,t,r),n=e})},[e,i,a,t,r])},zY=()=>{let{isAuthenticated:e}=_B(),{realtime:t,logger:r}=LP(),i=_P(),a=sN(),o=uF();RY();let s=(0,n.useRef)(null);s.current=o.data?.id??null,(0,n.useEffect)(()=>t.onStatusChange(e=>{i.getState().setStatus(e)}),[t,i]),(0,n.useEffect)(()=>FY({connection:t,store:i,queryClient:a,viewerId:()=>s.current,logger:r}),[t,i,a,r]),(0,n.useEffect)(()=>{if(!e){t.stop(),i.getState().clear(),NR();return}return t.start().catch(()=>{}),()=>{t.stop()}},[e,t,i])},BY=({children:e})=>(zY(),(0,D.jsx)(D.Fragment,{children:e})),VY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`list-feed`)}async execute(e){let t=await this.feedGateway.listPosts(e.scope,e.skipCount,e.maxResultCount);return t.ok||this.logger.warn(`Listing feed failed`,{code:t.error.code,scope:e.scope}),t}},HY=class extends ui{},UY=class extends HY{code=`FEED_UNAVAILABLE`;constructor(e){super(`The news feed is currently unavailable. Please try again.`,{cause:e})}},WY=class extends HY{code=`FEED_EMPTY_POST`;constructor(){super(`Write something before posting.`)}},GY=class{id;authorUserId;authorName;authorInitials;authorColor;authorRole;categoryLabel;categoryColor;audienceLabel;timestamp;createdAt;pinned;mustAcknowledge;acknowledged;title;body;reactions;myReaction;commentCount;comments;seenCount;bookmarked;taggedUserIds;locationLabel;imageUrls;department;audienceId;feelingId;feelingLabel;feelingEmoji;scheduledAt;isRecurring;recurrenceFrequency;constructor(e){this.id=e.id,this.authorUserId=e.authorUserId,this.authorName=e.authorName,this.authorInitials=e.authorInitials,this.authorColor=e.authorColor,this.authorRole=e.authorRole,this.categoryLabel=e.categoryLabel,this.categoryColor=e.categoryColor,this.audienceLabel=e.audienceLabel,this.timestamp=e.timestamp,this.createdAt=e.createdAt,this.pinned=e.pinned,this.mustAcknowledge=e.mustAcknowledge,this.acknowledged=e.acknowledged,this.title=e.title,this.body=e.body,this.reactions=e.reactions,this.myReaction=e.myReaction,this.commentCount=e.commentCount,this.comments=e.comments,this.seenCount=e.seenCount,this.bookmarked=e.bookmarked,this.taggedUserIds=e.taggedUserIds,this.locationLabel=e.locationLabel,this.imageUrls=e.imageUrls,this.department=e.department,this.audienceId=e.audienceId,this.feelingId=e.feelingId,this.feelingLabel=e.feelingLabel,this.feelingEmoji=e.feelingEmoji,this.scheduledAt=e.scheduledAt??null,this.isRecurring=e.isRecurring??!1,this.recurrenceFrequency=e.recurrenceFrequency??null}get totalReactions(){return this.reactions.like+this.reactions.insightful+this.reactions.celebrate}get needsAcknowledgement(){return this.mustAcknowledge&&!this.acknowledged}},KY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`create-post`)}async execute(e){return e.body.trim().length===0?(this.logger.warn(`Rejected empty post`),N(new WY)):this.feedGateway.createPost({...e,body:e.body.trim()})}},qY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`update-post`)}async execute(e,t){return t.body.trim().length===0?(this.logger.warn(`Rejected empty body for post update`),N(new WY)):this.feedGateway.updatePost(e,{...t,body:t.body.trim()})}},JY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`react-to-post`)}async execute(e,t){let n=await this.feedGateway.react(e,t);return n.ok||this.logger.warn(`Reacting to post failed`,{code:n.error.code}),n}},YY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`toggle-bookmark`)}async execute(e){let t=await this.feedGateway.toggleBookmark(e);return t.ok||this.logger.warn(`Bookmarking post failed`,{code:t.error.code}),t}},XY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`acknowledge-post`)}async execute(e){let t=await this.feedGateway.acknowledge(e);return t.ok||this.logger.warn(`Acknowledging post failed`,{code:t.error.code}),t}},ZY=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`add-comment`)}async execute({postId:e,text:t}){if(t.trim().length===0)return this.logger.warn(`Rejected empty comment`,{postId:e}),N(new UY);let n=await this.feedGateway.addComment(e,t.trim());return n.ok||this.logger.warn(`Adding comment failed`,{code:n.error.code}),n}},QY=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.listCategories()}},$Y=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.listAudiences()}},eX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.listFeelings()}},tX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(e){return this.feedGateway.searchUsers(e)}},nX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.detectLocation()}},rX=class{gateway;logger;constructor(e){this.gateway=e.feedGateway,this.logger=e.logger.child(`upload-feed-image-use-case`)}async execute(e){return this.logger.debug(`Uploading feed image`),this.gateway.uploadImage(e)}},iX=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`mark-seen`)}async execute(e){let t=await this.feedGateway.markSeen(e);return t.ok||this.logger.warn(`Marking post as seen failed`,{code:t.error.code}),t}},aX=class{feedGateway;logger;constructor(e){this.feedGateway=e.feedGateway,this.logger=e.logger.child(`set-post-pinned`)}async execute(e,t){let n=await this.feedGateway.setPinned(e,t);return n.ok||this.logger.warn(`Pinning post failed`,{code:n.error.code,pinned:t}),n}},oX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(){return this.feedGateway.getNotifications()}},sX=class{feedGateway;constructor(e){this.feedGateway=e.feedGateway}async execute(e){return this.feedGateway.markNotificationAsRead(e)}};function cX(e){return e.replace(/\s+(division|province|district|state|region)$/i,``).trim()}function lX(e){let t=cX(e.regionName??e.region??``),n=t.length>0?t:(e.cityName??e.city??``).trim(),r=(e.countryName??e.country_name??``).trim();return n.length>0&&r.length>0?`${n}, ${r}`:r.length>0?r:null}function uX(){try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e){let t=e.split(`/`),n=t[t.length-1];if(n)return n.replace(/_/g,` `)}}catch{}return`London Office`}async function dX(e){try{let t=await fetch(`/ip-geolocation`);if(t.ok){let e=lX(await t.json());if(e!==null)return M(e)}e.warn(`Proxy location fetch returned unexpected response, falling back to local timezone`)}catch(t){e.warn(`Failed to fetch location via dev proxy, falling back to local timezone`,{error:t})}return M(uX())}var fX=G({type:H(),count:H(),reacted:U()}),pX=G({id:V(),authorUserId:V(),authorName:V(),authorInitials:V(),authorColor:V(),text:V(),createdAt:V(),time:V()}),mX=G({id:V(),authorUserId:V(),authorName:V(),authorInitials:V(),authorColor:V(),authorRole:V(),department:V().nullable().optional(),categoryLabel:V(),categoryColor:V(),audienceLabel:V(),createdAt:V(),timestamp:V(),pinned:U(),mustAcknowledge:U(),acknowledged:U(),title:V().nullable(),body:V(),reactions:W(fX),myReaction:H().nullable().optional(),commentCount:H(),comments:W(pX),seenCount:H(),bookmarked:U(),audienceId:V(),taggedUserIds:W(V()).optional(),scheduledAt:V().nullable().optional(),isRecurring:U().optional(),recurrenceFrequency:V().nullable().optional(),nextOccurrenceTime:V().nullable().optional(),feelingId:V().nullable().optional(),feelingLabel:V().nullable().optional(),feelingEmoji:V().nullable().optional(),locationLabel:V().nullable().optional(),imageUrls:W(V()).optional()}).passthrough();W(mX);var hX=G({totalCount:H(),items:W(mX)}),gX=W(G({id:V(),name:V(),email:V(),userName:V(),role:V(),initials:V(),color:V()})),_X=W(G({id:V(),key:V().optional(),label:V(),color:V(),templateIds:W(V()).optional(),dataTemplateIds:W(V()).optional(),webhookId:V().nullable().optional()})),vX=W(G({key:V(),label:V()})),yX=W(G({id:V(),label:V(),emoji:V()})),bX=e=>e===1?`insightful`:e===2?`celebrate`:`like`,xX=e=>{let t={like:0,insightful:0,celebrate:0};for(let n of e){let e=bX(n.type);t[e]=n.count}return t},SX=e=>({id:e.id,authorName:e.authorName,authorInitials:e.authorInitials,authorColor:e.authorColor,text:e.text,time:e.time,createdAt:e.createdAt}),CX=e=>e==null?null:bX(e),wX=e=>({department:e.department??null,feelingId:e.feelingId??null,feelingLabel:e.feelingLabel??null,feelingEmoji:e.feelingEmoji??null,locationLabel:e.locationLabel??null}),TX=e=>{let t=wX(e);return new GY({id:e.id,authorUserId:e.authorUserId,authorName:e.authorName,authorInitials:e.authorInitials,authorColor:e.authorColor,authorRole:e.authorRole,categoryLabel:e.categoryLabel,categoryColor:e.categoryColor,audienceLabel:e.audienceLabel,createdAt:e.createdAt,timestamp:e.timestamp,pinned:e.pinned,mustAcknowledge:e.mustAcknowledge,acknowledged:e.acknowledged,title:e.title,body:e.body,reactions:xX(e.reactions),myReaction:CX(e.myReaction),commentCount:e.commentCount,comments:e.comments.map(SX),seenCount:e.seenCount,bookmarked:e.bookmarked,taggedUserIds:e.taggedUserIds??[],imageUrls:e.imageUrls??[],audienceId:e.audienceId,scheduledAt:e.scheduledAt??null,isRecurring:e.isRecurring??!1,recurrenceFrequency:e.recurrenceFrequency??null,...t})},EX=e=>({id:e.key??e.id,label:e.label,color:e.color,categoryKey:e.key??e.id,templateIds:e.templateIds??[],dataTemplateIds:e.dataTemplateIds??[],webhookId:e.webhookId??void 0}),DX=e=>({id:e.key,label:e.label}),OX=e=>({id:e.id,label:e.label,emoji:e.emoji}),kX=(e,t,n)=>(e.error(`Feed ${t} returned an unexpected shape`,n),N(new UY(n))),AX=(e,t)=>(e.error(`Feed request failed`,t),new UY(t)),jX=(e,t,n)=>{let r=hX.safeParse(n);return r.success?M({totalCount:r.data.totalCount,items:r.data.items.map(TX)}):kX(e,t,r.error)},MX=(e,t,n)=>{let r=mX.safeParse(n);return r.success?M(TX(r.data)):kX(e,t,r.error)},NX=(e,t,n)=>{let r=_X.safeParse(n);return r.success?M(r.data.map(EX)):kX(e,t,r.error)},PX=(e,t,n)=>{let r=vX.safeParse(n);return r.success?M(r.data.map(DX)):kX(e,t,r.error)},FX=(e,t,n)=>{let r=yX.safeParse(n);return r.success?M(r.data.map(OX)):kX(e,t,r.error)},IX=(e,t,n)=>{let r=gX.safeParse(n);return r.success?M(r.data):kX(e,t,r.error)},LX=W(G({id:V(),userId:V(),kind:aj([`meeting`,`group`,`feed`,`member`]),actorName:V(),initials:V(),color:V(),message:V(),detail:V().nullable().optional(),postId:V().nullable().optional(),isRead:U(),creationTime:V()})),RX={for_you:0,team:1,company:2,saved:3},zX={like:0,insightful:1,celebrate:2},BX=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-feed-gateway`)}async listPosts(e,t,n){try{let r=RX[e],i=await this.httpClient.get(`/api/app/feed/posts`,{query:{scope:r,...t!==void 0&&{skipCount:t},...n!==void 0&&{maxResultCount:n}}});return jX(this.logger,`listPosts`,i)}catch(e){return N(AX(this.logger,e))}}async createPost(e){try{let t=await this.httpClient.post(`/api/app/feed/post`,e);return MX(this.logger,`createPost`,t)}catch(e){return N(AX(this.logger,e))}}async updatePost(e,t){try{let n=await this.httpClient.put(`/api/app/feed/post/${e}`,t);return MX(this.logger,`updatePost`,n)}catch(e){return N(AX(this.logger,e))}}async react(e,t){try{let n=await this.httpClient.post(`/api/app/feed/react-to-post/${e}`,{type:zX[t]});return MX(this.logger,`react`,n)}catch(e){return N(AX(this.logger,e))}}async toggleBookmark(e){try{let t=await this.httpClient.post(`/api/app/feed/toggle-bookmark/${e}`,void 0);return MX(this.logger,`toggleBookmark`,t)}catch(e){return N(AX(this.logger,e))}}async setPinned(e,t){try{let n=await this.httpClient.post(`/api/app/feed/set-pinned/${e}`,{pinned:t});return MX(this.logger,`setPinned`,n)}catch(e){return N(AX(this.logger,e))}}async acknowledge(e){try{let t=await this.httpClient.post(`/api/app/feed/acknowledge/${e}`,void 0);return MX(this.logger,`acknowledge`,t)}catch(e){return N(AX(this.logger,e))}}async markSeen(e){try{let t=await this.httpClient.post(`/api/app/feed/mark-seen/${e}`,void 0);return MX(this.logger,`markSeen`,t)}catch(e){return N(AX(this.logger,e))}}async addComment(e,t){try{let n=await this.httpClient.post(`/api/app/feed/comment/${e}`,{text:t});return MX(this.logger,`addComment`,n)}catch(e){return N(AX(this.logger,e))}}async listCategories(){try{let e=await this.httpClient.get(`/api/app/feed/feed-categories`);return NX(this.logger,`listCategories`,e)}catch(e){return N(AX(this.logger,e))}}async listAudiences(){try{let e=await this.httpClient.get(`/api/app/feed/feed-audiences`);return PX(this.logger,`listAudiences`,e)}catch(e){return N(AX(this.logger,e))}}async listFeelings(){try{let e=await this.httpClient.get(`/api/app/feed/feed-feelings`);return FX(this.logger,`listFeelings`,e)}catch(e){return N(AX(this.logger,e))}}async searchUsers(e){try{let t=await this.httpClient.get(`/api/app/feed/search-users`,{query:{filter:e}});return IX(this.logger,`searchUsers`,t)}catch(e){return N(AX(this.logger,e))}}async detectLocation(){return dX(this.logger)}async uploadImage(e){try{let t=new FormData;t.append(`file`,e);let n=await this.httpClient.post(`/api/app/file/upload?category=FeedPost`,t);return typeof n==`object`&&n&&`id`in n&&typeof n.id==`string`?M(n.id):N(new UY(`Invalid response shape`))}catch(e){return N(AX(this.logger,e))}}async getNotifications(){try{let e=await this.httpClient.get(`/api/app/notification`);return M(LX.parse(e).map(e=>({id:e.id,kind:e.kind,initials:e.initials,color:e.color,actor:e.actorName,message:e.message,creationTime:e.creationTime,...e.detail!==null&&e.detail!==void 0?{detail:e.detail}:{},...e.postId!==null&&e.postId!==void 0?{postId:e.postId}:{}})))}catch(e){return N(AX(this.logger,e))}}async markNotificationAsRead(e){try{return await this.httpClient.post(`/api/app/notification/${e}/mark-as-read`,void 0),M(void 0)}catch(e){return N(AX(this.logger,e))}}async deleteNotification(e){try{return await this.httpClient.delete(`/api/app/notification/${e}`),M(void 0)}catch(e){return N(AX(this.logger,e))}}},VX=e=>{let t={feedGateway:new BX({httpClient:e.httpClient,logger:e.logger}),logger:e.logger};return{listFeed:new VY(t),createPost:new KY(t),updatePost:new qY(t),reactToPost:new JY(t),toggleBookmark:new YY(t),acknowledgePost:new XY(t),addComment:new ZY(t),listFeedCategories:new QY(t),listFeedAudiences:new $Y(t),listFeedFeelings:new eX(t),searchFeedUsers:new tX(t),detectLocation:new nX(t),uploadFeedImage:new rX(t),setPostPinned:new aX(t),markSeen:new iX(t),getNotifications:new oX(t),markNotificationRead:new sX(t),notificationRealtime:e.notificationRealtime,logger:e.logger}},HX=(0,n.createContext)(null),UX=({module:e,children:t})=>(0,D.jsx)(HX.Provider,{value:e,children:t}),WX=()=>{let e=(0,n.useContext)(HX);if(e===null)throw Error(`Feed hooks must be used within <FeedModuleProvider>.`);return e},GX=e=>[`feed`,e],KX=e=>{e.invalidateQueries({queryKey:[`feed`]})},qX=(e,t)=>{e.setQueriesData({queryKey:[`feed`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t.id?t:e)}))})},JX=e=>{let{listFeed:t}=WX();return wN({queryKey:GX(e),queryFn:({pageParam:n})=>P(t.execute({scope:e,skipCount:n,maxResultCount:10})),initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.items.length,0);if(!(n>=e.totalCount))return n}})},YX=()=>{let{createPost:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{KX(t)}})},XX=()=>{let{updatePost:e}=WX(),t=sN();return CN({mutationFn:({postId:t,input:n})=>P(e.execute(t,n)),onSuccess:e=>{qX(t,e)}})},ZX=()=>{let{reactToPost:e}=WX(),t=sN();return CN({mutationFn:({postId:t,type:n})=>P(e.execute(t,n)),onSuccess:e=>{qX(t,e)}})},QX=()=>{let{toggleBookmark:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{qX(t,e),t.invalidateQueries({queryKey:GX(`saved`)})}})},$X=()=>{let{acknowledgePost:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{qX(t,e)}})},eZ=()=>{let{markSeen:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{qX(t,e)}})},tZ=()=>{let{addComment:e}=WX(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{qX(t,e)}})},nZ=()=>{let{setPostPinned:e}=WX(),t=sN();return CN({mutationFn:({postId:t,pinned:n})=>P(e.execute(t,n)),onSuccess:e=>{qX(t,e)}})},rZ=()=>{let{listFeedCategories:e}=WX();return SN({queryKey:[`feed-categories`],queryFn:()=>P(e.execute())})},iZ=()=>{let{listFeedAudiences:e}=WX();return SN({queryKey:[`feed-audiences`],queryFn:()=>P(e.execute())})},aZ=()=>{let{listFeedFeelings:e}=WX();return SN({queryKey:[`feed-feelings`],queryFn:()=>P(e.execute())})},oZ=e=>{let{searchFeedUsers:t}=WX();return SN({queryKey:[`feed-search-users`,e],queryFn:()=>P(t.execute(e)),enabled:e.trim().length>0})},sZ=()=>{let{uploadFeedImage:e}=WX();return CN({mutationFn:t=>P(e.execute(t))})},cZ=e=>{let{data:t=[]}=rZ(),n=t.find(t=>t.id===e.department);return{categoryLabel:n?.label??e.categoryLabel,categoryColor:n?.color??e.categoryColor}},lZ=e=>{if(e.length===0)return[];let t=e[0]?.fullName??e[0]?.name??``;if(e.length===1)return[{text:`with `,bold:!1},{text:t,bold:!0}];let n=e[1]?.fullName??e[1]?.name??``;return e.length===2?[{text:`with `,bold:!1},{text:t,bold:!0},{text:` and `,bold:!1},{text:n,bold:!0}]:[{text:`with `,bold:!1},{text:t,bold:!0},{text:`, `,bold:!1},{text:n,bold:!0},{text:` and `,bold:!1},{text:`${String(e.length-2)} others`,bold:!0}]},uZ=e=>{let t=e;return/^\d{4}-\d{2}-\d{2}T/.test(e)&&!e.endsWith(`Z`)&&!/[+-]\d{2}:?\d{2}$/.test(e)&&(t=`${e}Z`),new Date(t)},dZ=e=>{let t=String(e.minute).padStart(2,`0`),n=e.hour>=12?`PM`:`AM`,r=e.hour%12;return`${String(r===0?12:r)}:${t} ${n}`},fZ=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],pZ=(e,t)=>e.year===t.year&&e.month===t.month&&e.day===t.day,mZ=(e,t,n)=>{let r=n.getTime()-t.getTime();if(r<0){let t=new Date(e);if(!Number.isNaN(t.getTime())){let e=n.getTime()-t.getTime();if(e>=0)return e}}return r},hZ=(e,t,n)=>{let r=uZ(e);if(Number.isNaN(r.getTime()))return null;let i=r.getTime()-t.getTime();if(i<=0)return null;let a=60*1e3,o=60*a,s=24*o;if(i<a)return`Publishes shortly`;if(i<o){let e=Math.floor(i/a);return`Publishes in ${String(e)}m`}if(i<s){let e=Math.floor(i/o);return`Publishes in ${String(e)} ${e===1?`hour`:`hours`}`}let c=VN(r,n);return pZ(c,VN(new Date(t.getTime()+s),n))?`Scheduled for tomorrow at ${dZ(c)}`:`Scheduled for ${fZ[c.month-1]??``} ${String(c.day)} at ${dZ(c)}`},gZ=(e,t,n)=>t&&uZ(t).getTime()<=n.getTime()?t:e,_Z=(e,t,n,r)=>{let i=60*1e3,a=60*i,o=24*a;if(e<i)return`now`;if(e<a)return`${String(Math.floor(e/i))}m ago`;if(e<o){let t=Math.floor(e/a);return`${String(t)} ${t===1?`hour`:`hours`} ago`}let s=VN(t,n);return pZ(s,VN(new Date(r.getTime()-o),n))?`Yesterday at ${dZ(s)}`:`${fZ[s.month-1]??``} ${String(s.day)} at ${dZ(s)}`},vZ=(e,t,n=null,r=new Date)=>{if(n&&uZ(n).getTime()>r.getTime()){let e=hZ(n,r,t);if(e!==null)return e}let i=gZ(e,n,r),a=uZ(i);return Number.isNaN(a.getTime())?`now`:_Z(mZ(i,a,r),a,t,r)},yZ=(e,t,n)=>{let r=document.getElementById(e),i=document.getElementById(t);if(r&&i){let e=i.getBoundingClientRect(),t=r.getBoundingClientRect(),a=t.top-e.top,o=i.scrollTop+a;n===`center`&&(o=o-e.height/2+t.height/2),i.scrollTo({top:o,behavior:`smooth`})}},bZ=(e,t=1600,n=1600,r=.8)=>new Promise(i=>{if(!e.type.startsWith(`image/`)){i(e);return}let a=new Image;a.src=URL.createObjectURL(e),a.onload=()=>{URL.revokeObjectURL(a.src);let o=a.width,s=a.height;if(o>t||s>n){let e=Math.min(t/o,n/s);o=Math.round(o*e),s=Math.round(s*e)}let c=document.createElement(`canvas`);c.width=o,c.height=s;let l=c.getContext(`2d`);if(!l){i(e);return}l.drawImage(a,0,0,o,s),c.toBlob(t=>{if(!t){i(e);return}i(new File([t],e.name.replace(/\.[^/.]+$/,``)+`.jpg`,{type:`image/jpeg`,lastModified:Date.now()}))},`image/jpeg`,r)},a.onerror=()=>{i(e)}}),xZ={ReceiveNotification:`ReceiveNotification`},SZ=G({id:V(),kind:aj([`meeting`,`group`,`feed`,`member`]),initials:V(),color:V(),actor:V(),time:V(),message:V().nullable().optional(),detail:V().nullable().optional(),postId:V().nullable().optional()}),CZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`list-contacts`)}async execute(e){let t=await this.meetingGateway.listContacts(e);return t.ok||this.logger.warn(`Listing booking contacts failed`,{code:t.error.code}),t}},wZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`list-available-slots`)}async execute(e){let t=await this.meetingGateway.getAvailableSlots(e);return t.ok||this.logger.warn(`Listing available slots failed`,{code:t.error.code}),t}},TZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`list-attendee-availability`)}async execute(e){let t=await this.meetingGateway.listAttendeeAvailability(e);return t.ok||this.logger.warn(`Listing attendee availability failed`,{code:t.error.code}),t}},EZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`list-meetings`)}async execute(){let e=await this.meetingGateway.listMeetings();return e.ok||this.logger.warn(`Listing meetings failed`,{code:e.error.code}),e}},DZ=class extends ui{},OZ=class extends DZ{code=`MEETINGS_UNAVAILABLE`;constructor(e){super(`Meetings are currently unavailable. Please try again.`,{cause:e})}},kZ=class extends DZ{code=`MEETINGS_INCOMPLETE_BOOKING`;constructor(){super(`Pick a person, a date, and a time slot to book a meeting.`)}},AZ=class{id;title;withName;withInitials;withColor;dateLabel;startUtc;endUtc;location;isOrganizer;myStatus;bucket;isGroup;attendeeIds;description;awaitingResponse;constructor(e){this.id=e.id,this.title=e.title,this.withName=e.withName,this.withInitials=e.withInitials,this.withColor=e.withColor,this.dateLabel=e.dateLabel,this.startUtc=e.startUtc,this.endUtc=e.endUtc,this.location=e.location,this.isOrganizer=e.isOrganizer,this.myStatus=e.myStatus,this.bucket=e.bucket,this.isGroup=e.isGroup,this.attendeeIds=e.attendeeIds,this.description=e.description,this.awaitingResponse=e.awaitingResponse}},jZ=[{id:`Pacific/Honolulu`,city:`Honolulu`,offset:`GMT-10`},{id:`America/Anchorage`,city:`Anchorage`,offset:`GMT-9`},{id:`America/Los_Angeles`,city:`Los Angeles`,offset:`GMT-8`},{id:`America/Denver`,city:`Denver`,offset:`GMT-7`},{id:`America/Chicago`,city:`Chicago`,offset:`GMT-6`},{id:`America/New_York`,city:`New York`,offset:`GMT-5`},{id:`America/Sao_Paulo`,city:`São Paulo`,offset:`GMT-3`},{id:`Atlantic/Reykjavik`,city:`Reykjavik`,offset:`GMT+0`},{id:`Europe/London`,city:`London`,offset:`GMT+1`},{id:`Europe/Paris`,city:`Paris`,offset:`GMT+2`},{id:`Europe/Athens`,city:`Athens`,offset:`GMT+3`},{id:`Africa/Nairobi`,city:`Nairobi`,offset:`GMT+3`},{id:`Asia/Dubai`,city:`Dubai`,offset:`GMT+4`},{id:`Asia/Karachi`,city:`Karachi`,offset:`GMT+5`},{id:`Asia/Kolkata`,city:`Mumbai`,offset:`GMT+5:30`},{id:`Asia/Dhaka`,city:`Dhaka`,offset:`GMT+6`},{id:`Asia/Bangkok`,city:`Bangkok`,offset:`GMT+7`},{id:`Asia/Singapore`,city:`Singapore`,offset:`GMT+8`},{id:`Asia/Shanghai`,city:`Shanghai`,offset:`GMT+8`},{id:`Asia/Tokyo`,city:`Tokyo`,offset:`GMT+9`},{id:`Australia/Sydney`,city:`Sydney`,offset:`GMT+11`},{id:`Pacific/Auckland`,city:`Auckland`,offset:`GMT+13`}],MZ={id:`Europe/London`,city:`London`,offset:`GMT+1`};MZ.id;var NZ=e=>{try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`);if(t){let e=t.value;if(e===`GMT`)return`GMT+0`;e=e.replace(/^GMT/,``);let n=e.startsWith(`-`)?`-`:`+`,[r=`0`,i=`0`]=e.replace(/^[+-]/,``).split(`:`),a=parseInt(r,10),o=parseInt(i,10);return o===0?`GMT${n}${String(a)}`:`GMT${n}${String(a)}:${String(o)}`}}catch{}return`GMT+0`},PZ=e=>{let t=jZ.find(t=>t.id===e);if(t)return t;try{let t=NZ(e),n=e.split(`/`);return{id:e,city:(n[n.length-1]??``).replace(/_/g,` `),offset:t}}catch{return MZ}},FZ=e=>PZ(e),IZ=(e,t,n)=>{let r=new Date(n.start).getTime(),i=new Date(n.end).getTime();return e.getTime()<i&&t.getTime()>r},LZ=(e,t,n)=>e.userId===t||t===n&&n!==``&&e.userId===void 0,RZ=(e,t)=>e.allBlocks.filter(t=>LZ(t,e.userId,e.selfUserId)&&t.status!==`available`).flatMap(e=>IO(e,t.start,t.end)),zZ=(e,t)=>e.allBlocks.filter(t=>LZ(t,e.userId,e.selfUserId)&&t.status===`available`).flatMap(e=>IO(e,t.start,t.end)).map(e=>({start:new Date(e.start),end:new Date(e.end)})),BZ=(e,t,n)=>t.getTime()>=e.start.getTime()&&n.getTime()<=e.end.getTime(),VZ=e=>{let t={start:e.rangeStart,end:e.rangeEnd},n={userId:e.userId,selfUserId:e.selfUserId,allBlocks:e.allBlocks},r=e.workWindows.some(t=>BZ(t,e.slotStart,e.slotEnd)),i=zZ(n,t).some(t=>BZ(t,e.slotStart,e.slotEnd));return!r&&!i?`ooh`:RZ(n,t).some(t=>IZ(e.slotStart,e.slotEnd,t))?`busy`:`available`},HZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`book-meeting`)}async execute(e){return e.contactId.length===0||e.dateLabel.length===0||e.slot.length===0?(this.logger.warn(`Rejected incomplete booking`),N(new kZ)):this.meetingGateway.book(e)}},UZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`respond-to-meeting`)}async execute(e,t){let n=await this.meetingGateway.respond(e,t);return n.ok||this.logger.warn(`Responding to meeting failed`,{code:n.error.code}),n}},WZ=class{meetingGateway;logger;constructor(e){this.meetingGateway=e.meetingGateway,this.logger=e.logger.child(`cancel-meeting`)}async execute(e){let t=await this.meetingGateway.cancel(e);return t.ok||this.logger.warn(`Cancelling meeting failed`,{code:t.error.code}),t}},GZ=`Online — link generated automatically`,KZ=null;KZ??=[{id:`mt-1`,title:`1:1 Catch-up`,withName:`Andreea Cinpoi`,withInitials:`AN`,withColor:`#7c3aed`,dateLabel:`Tue, 24 Jun`,startUtc:`2026-06-24T14:00:00Z`,endUtc:`2026-06-24T15:00:00Z`,location:GZ,isOrganizer:!0,myStatus:`accepted`,bucket:`upcoming`},{id:`mt-2`,title:`Application review`,withName:`Raj Ahmed`,withInitials:`RA`,withColor:`#0ea5e9`,dateLabel:`Wed, 25 Jun`,startUtc:`2026-06-25T11:00:00Z`,endUtc:`2026-06-25T12:00:00Z`,location:GZ,isOrganizer:!1,myStatus:`pending`,bucket:`upcoming`},{id:`mt-3`,title:`Visa cases sync`,withName:`Jennifer Aboje`,withInitials:`JA`,withColor:`#fc7300`,dateLabel:`Thu, 26 Jun`,startUtc:`2026-06-26T10:00:00Z`,endUtc:`2026-06-26T10:30:00Z`,location:GZ,isOrganizer:!1,myStatus:`accepted`,bucket:`upcoming`},{id:`mt-4`,title:`Consultant onboarding`,withName:`Tousif Sadman`,withInitials:`TS`,withColor:`#0e7c66`,dateLabel:`Mon, 16 Jun`,startUtc:`2026-06-16T09:00:00Z`,endUtc:`2026-06-16T09:30:00Z`,location:GZ,isOrganizer:!0,myStatus:`accepted`,bucket:`passed`},{id:`mt-5`,title:`Compliance check`,withName:`Nur Mohammad`,withInitials:`NM`,withColor:`#8b5cf6`,dateLabel:`Fri, 13 Jun`,startUtc:`2026-06-13T15:00:00Z`,endUtc:`2026-06-13T16:00:00Z`,location:GZ,isOrganizer:!0,myStatus:`accepted`,bucket:`canceled`}];var qZ=encodeURIComponent,JZ={list:`/api/app/meeting`,contacts:`/api/app/meeting/list-contacts`,availableSlots:`/api/app/meeting/list-available-slots`,attendeeAvailability:`/api/app/meeting/list-attendee-availability`,book:`/api/app/meeting/book`,respond:e=>`/api/app/meeting/${qZ(e)}/respond`,cancel:e=>`/api/app/meeting/${qZ(e)}/cancel`},YZ=G({id:V(),organizerUserId:V(),title:V(),withName:V(),withInitials:V(),withColor:V(),dateLabel:V(),start:V(),end:V(),location:V(),isOrganizer:U(),myStatus:H(),bucket:H(),awaitingResponse:U().optional(),isGroup:U(),attendeeIds:W(V()),description:V()}).passthrough(),XZ=W(YZ),ZZ=W(G({id:V(),name:V(),initials:V(),color:V(),role:V()}).passthrough()),QZ=W(G({label:V(),startUtc:V(),endUtc:V(),conflicts:W(V())}).passthrough()),$Z=W(G({userId:V(),busy:W(G({startUtc:V(),endUtc:V()})),workingHours:W(G({startUtc:V(),endUtc:V()})).optional()}).passthrough()),eQ={0:`pending`,1:`accepted`,2:`rejected`},tQ={0:`upcoming`,1:`passed`,2:`canceled`},nQ=/[zZ]|[+-]\d{2}:?\d{2}$/,rQ=e=>nQ.test(e)?e:`${e}Z`,iQ=e=>new AZ({id:e.id,title:e.title,withName:e.withName,withInitials:e.withInitials,withColor:e.withColor,dateLabel:e.dateLabel,startUtc:rQ(e.start),endUtc:rQ(e.end),location:e.location,isOrganizer:e.isOrganizer,myStatus:eQ[e.myStatus]??`pending`,bucket:tQ[e.bucket]??`upcoming`,isGroup:e.isGroup,attendeeIds:e.attendeeIds,description:e.description,awaitingResponse:e.awaitingResponse??!1}),aQ=e=>({id:e.id,name:e.name,initials:e.initials,color:e.color,role:e.role}),oQ=e=>({label:e.label,startUtc:e.startUtc,endUtc:e.endUtc,conflicts:e.conflicts}),sQ=e=>({userId:e.userId,busy:e.busy.map(e=>({startUtc:e.startUtc,endUtc:e.endUtc})),workingHours:(e.workingHours??[]).map(e=>({startUtc:e.startUtc,endUtc:e.endUtc}))}),cQ=e=>({contactId:e.isGroup===!0?null:e.contactId,attendeeIds:e.attendeeIds??[],dateLabel:e.dateLabel,slot:e.slot,isoDate:e.isoDate,startUtc:e.startUtc,endUtc:e.endUtc,isGroup:e.isGroup??!1,title:e.title,location:e.location,description:e.description}),lQ=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger.child(`http-meeting-gateway`)}async listContacts(e){try{let t=e?.trim(),n=await this.httpClient.post(JZ.contacts,void 0,{query:{search:t===void 0||t===``?void 0:t}}),r=ZZ.safeParse(n);return r.success?M(r.data.map(aQ)):this.fail(`List contacts returned an unexpected shape`,r.error)}catch(e){return this.fail(`List contacts failed`,e)}}async getAvailableSlots(e){try{let t=await this.httpClient.post(JZ.availableSlots,{isoDate:e.isoDate,timeZone:e.timeZone??void 0,isGroup:e.isGroup,contactId:e.contactId??void 0,attendeeIds:e.attendeeIds}),n=QZ.safeParse(t);return n.success?M(n.data.map(oQ)):this.fail(`Available slots returned an unexpected shape`,n.error)}catch(e){return this.fail(`Available slots failed`,e)}}async listAttendeeAvailability(e){try{let t=await this.httpClient.post(JZ.attendeeAvailability,{isoDate:e.isoDate,attendeeIds:e.attendeeIds}),n=$Z.safeParse(t);return n.success?M(n.data.map(sQ)):this.fail(`Attendee availability returned an unexpected shape`,n.error)}catch(e){return this.fail(`Attendee availability failed`,e)}}async listMeetings(){try{let e=await this.httpClient.get(JZ.list),t=XZ.safeParse(e);return t.success?M(t.data.map(iQ)):this.fail(`List meetings returned an unexpected shape`,t.error)}catch(e){return this.fail(`List meetings failed`,e)}}async book(e){try{let t=await this.httpClient.post(JZ.book,cQ(e));return this.parseMeeting(t,`Book meeting`)}catch(e){return this.fail(`Book meeting failed`,e)}}async respond(e,t){try{let n=await this.httpClient.post(JZ.respond(e),void 0,{query:{accept:t}});return this.parseMeeting(n,`Respond to meeting`)}catch(e){return this.fail(`Respond to meeting failed`,e)}}async cancel(e){try{let t=await this.httpClient.post(JZ.cancel(e));return this.parseMeeting(t,`Cancel meeting`)}catch(e){return this.fail(`Cancel meeting failed`,e)}}parseMeeting(e,t){let n=YZ.safeParse(e);return n.success?M(iQ(n.data)):this.fail(`${t} returned an unexpected shape`,n.error)}fail(e,t){return this.logger.error(e,t),N(new OZ(t))}},uQ=e=>{let t={meetingGateway:new lQ({httpClient:e.httpClient,logger:e.logger}),logger:e.logger};return{listContacts:new CZ(t),listAvailableSlots:new wZ(t),listAttendeeAvailability:new TZ(t),listMeetings:new EZ(t),bookMeeting:new HZ(t),respondToMeeting:new UZ(t),cancelMeeting:new WZ(t)}},dQ=(0,n.createContext)(null),fQ=({module:e,children:t})=>(0,D.jsx)(dQ.Provider,{value:e,children:t}),pQ=()=>{let e=(0,n.useContext)(dQ);if(e===null)throw Error(`Meetings hooks must be used within <MeetingsModuleProvider>.`);return e},mQ=[`meetings`,`list`],hQ=[`meetings`,`contacts`],gQ=[`meetings`,`available-slots`],_Q=[`meetings`,`attendee-availability`],vQ=(e,t)=>{e.setQueryData(mQ,e=>e===void 0?[t]:e.map(e=>e.id===t.id?t:e))},yQ=e=>{let{listContacts:t}=pQ(),n=e?.trim()??``;return SN({queryKey:[...hQ,n],queryFn:()=>P(t.execute(n||void 0)),placeholderData:vM})},bQ=e=>{let{listMeetings:t}=pQ();return SN({queryKey:mQ,queryFn:()=>P(t.execute()),staleTime:0,refetchOnWindowFocus:!0,...e===void 0?{}:{refetchInterval:e}})},xQ=e=>{let{listAvailableSlots:t}=pQ();return SN({queryKey:[...gQ,e],queryFn:()=>e===null?Promise.resolve([]):P(t.execute(e)),enabled:e!==null,staleTime:0,refetchOnWindowFocus:!0})},SQ=(e,t)=>{let{listAttendeeAvailability:n}=pQ(),r=t!==null&&e.length>0;return SN({queryKey:[..._Q,t,[...e].sort()],queryFn:()=>r?P(n.execute({isoDate:t,attendeeIds:e})):Promise.resolve([]),enabled:r,staleTime:0,refetchOnWindowFocus:!0})},CQ=()=>{let{bookMeeting:e}=pQ(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:()=>{t.invalidateQueries({queryKey:mQ})}})},wQ=()=>{let{respondToMeeting:e}=pQ(),t=sN();return CN({mutationFn:({meetingId:t,accept:n})=>P(e.execute(t,n)),onSuccess:e=>{vQ(t,e)}})},TQ=()=>{let{cancelMeeting:e}=pQ(),t=sN();return CN({mutationFn:t=>P(e.execute(t)),onSuccess:e=>{vQ(t,e)}})},EQ=class{userGateway;logger;constructor(e){this.userGateway=e.userGateway,this.logger=e.logger.child(`list-users`)}async execute(e){let t=await this.userGateway.list(e);return t.ok||this.logger.warn(`Listing users failed`,{code:t.error.code}),t}},DQ=class{userGateway;logger;constructor(e){this.userGateway=e.userGateway,this.logger=e.logger.child(`list-directory-facets`)}async execute(){let[e,t,n]=await Promise.all([this.userGateway.getDepartments(),this.userGateway.getAccessRoles(),this.userGateway.getBranches()]);return e.ok?t.ok?n.ok?M({departments:e.value,accessRoles:t.value,branches:n.value}):(this.logger.warn(`Loading directory facets failed`,{code:n.error.code}),N(n.error)):(this.logger.warn(`Loading directory facets failed`,{code:t.error.code}),N(t.error)):(this.logger.warn(`Loading directory facets failed`,{code:e.error.code}),N(e.error))}},OQ=class extends ui{},kQ=class extends OQ{code=`USERS_UNAVAILABLE`;constructor(e){super(`The users directory is currently unavailable. Please try again.`,{cause:e})}},AQ=class{id;fullName;email;roleName;department;branchKey;branchName;level;online;status;statusUntilUtc;hasAccount;initials;color;permissionSetName;permissionSetColor;constructor(e){this.id=e.id,this.fullName=e.fullName,this.email=e.email,this.roleName=e.roleName,this.department=e.department,this.branchKey=e.branchKey,this.branchName=e.branchName,this.level=e.level,this.online=e.online,this.status=e.status??`offline`,this.statusUntilUtc=e.statusUntilUtc??null,this.hasAccount=e.hasAccount??!0,this.initials=e.initials,this.color=e.color,this.permissionSetName=e.permissionSetName,this.permissionSetColor=e.permissionSetColor}get isSenior(){return this.level<=3}},jQ=G({id:V(),fullName:V(),email:V(),roleName:V(),department:V(),branchKey:V().nullish(),branchName:V().nullish(),level:H(),online:U(),status:H().nullish(),statusUntilUtc:V().nullish(),hasAccount:U().nullish(),initials:V(),color:V(),permissionSetName:V().nullish(),permissionSetColor:V().nullish()}),MQ=G({totalCount:H(),items:W(jQ)}),NQ=(e,t)=>(e.error(`Users request failed`,t),new kQ(t)),PQ={staffMembers:`/api/app/staff-member`,departments:`/api/app/staff-member/departments`,accessRoles:`/api/app/staff-member/access-roles`,branches:`/api/app/staff-member/branches`},FQ={skipCount:`skipCount`,maxResultCount:`maxResultCount`,filter:`filter`,department:`department`,accessRole:`accessRole`,branch:`branch`,online:`online`},IQ=e=>new AQ({id:e.id,fullName:e.fullName,email:e.email,roleName:e.roleName,department:e.department,branchKey:e.branchKey??``,branchName:e.branchName??``,level:e.level,online:e.online,status:SR(e.status),statusUntilUtc:e.statusUntilUtc??null,hasAccount:e.hasAccount??!0,initials:e.initials,color:e.color,permissionSetName:e.permissionSetName??void 0,permissionSetColor:e.permissionSetColor??void 0}),LQ=W(V()),RQ=W(G({key:V(),name:V()})),zQ=class{httpClient;logger;constructor(e){this.httpClient=e.httpClient,this.logger=e.logger}async list(e){try{let t={[FQ.skipCount]:(e.page-1)*e.pageSize,[FQ.maxResultCount]:e.pageSize};e.filter!==``&&(t[FQ.filter]=e.filter),e.department!==``&&(t[FQ.department]=e.department),e.accessRole!==``&&(t[FQ.accessRole]=e.accessRole),e.branch!==``&&(t[FQ.branch]=e.branch),e.status!==`all`&&(t[FQ.online]=e.status===`online`);let n=await this.httpClient.get(PQ.staffMembers,{query:t}),r=MQ.safeParse(n);if(!r.success)throw this.logger.error(`Users staff-member list returned an unexpected shape`,r.error),new kQ(r.error);return M({users:r.data.items.map(IQ),totalCount:r.data.totalCount})}catch(e){return N(NQ(this.logger,e))}}async getDepartments(){return this.getStringList(PQ.departments,`departments`)}async getAccessRoles(){return this.getStringList(PQ.accessRoles,`access roles`)}async getBranches(){try{let e=await this.httpClient.get(PQ.branches),t=RQ.safeParse(e);if(!t.success)throw this.logger.error(`Users branches returned an unexpected shape`,t.error),new kQ(t.error);return M(t.data)}catch(e){return N(NQ(this.logger,e))}}async getStringList(e,t){try{let n=await this.httpClient.get(e),r=LQ.safeParse(n);if(!r.success)throw this.logger.error(`Users ${t} returned an unexpected shape`,r.error),new kQ(r.error);return M(r.data)}catch(e){return N(NQ(this.logger,e))}}},BQ=e=>{let t={userGateway:new zQ({httpClient:e.httpClient,logger:e.logger}),logger:e.logger};return{listUsers:new EQ(t),listDirectoryFacets:new DQ(t)}},VQ=(0,n.createContext)(null),HQ=({module:e,children:t})=>(0,D.jsx)(VQ.Provider,{value:e,children:t}),UQ=()=>{let e=(0,n.useContext)(VQ);if(e===null)throw Error(`Users hooks must be used within <UsersModuleProvider>.`);return e},WQ=[`users`],GQ=e=>{let{listUsers:t}=UQ();return SN({queryKey:[...WQ,e],queryFn:()=>P(t.execute(e)),placeholderData:vM,staleTime:3e4})},KQ=class{gateway;logger;constructor(e){this.gateway=e.meetingVideoGateway,this.logger=e.logger.child(`join-meeting-video`)}async execute(e){let t=await this.gateway.join(e);return t.ok||this.logger.warn(`Joining meeting video failed`,{code:t.error.code}),t}},qQ=class extends ui{},JQ=class extends qQ{code=`MEETING_VIDEO_UNAVAILABLE`;constructor(e){super(`This meeting could not be joined right now. Please try again.`,{cause:e})}},YQ=G({token:V(),providerType:V(),roomId:V(),participantName:V(),title:V().nullish()}).passthrough(),XQ=encodeURIComponent,ZQ={join:e=>`/api/app/meeting-video/${XQ(e)}/join`},QQ=e=>({token:e.token,providerType:e.providerType,roomId:e.roomId,participantName:e.participantName,title:e.title??``}),$Q=class{http;logger;constructor(e){this.http=e.httpClient,this.logger=e.logger.child(`http-meeting-video-gateway`)}async join(e){try{let t=await this.http.post(ZQ.join(e)),n=YQ.safeParse(t);return n.success?M(QQ(n.data)):this.fail(`Join returned an unexpected shape`,n.error)}catch(e){return this.fail(`Joining meeting video failed`,e)}}fail(e,t){return this.logger.error(e,t),N(new JQ(t))}},e$=e=>({joinMeetingVideo:new KQ({meetingVideoGateway:new $Q({httpClient:e.httpClient,logger:e.logger}),logger:e.logger})}),t$=(0,n.createContext)(null),n$=({module:e,children:t})=>(0,D.jsx)(t$.Provider,{value:e,children:t}),r$=PE(e=>({activeMeeting:null,isJoined:!1,requestedMeetingId:null,setActiveMeeting:t=>{e({activeMeeting:t})},setJoined:t=>{e({isJoined:t})},setRequestedMeetingId:t=>{e({requestedMeetingId:t})},leaveActiveMeeting:()=>{e({activeMeeting:null,isJoined:!1,requestedMeetingId:null})}})),i$=15e3,a$=5*6e4,o$=(e,t,n)=>{let r=new HJ({logger:t}),i=t=>e.modules===void 0||e.modules.includes(t);return{chat:i(`commhub.chat`)?r.create({url:`${e.apiBaseUrl}/signalr/chat`,accessTokenProvider:n}):new UJ,calls:i(`commhub.chat`)?r.create({url:`${e.apiBaseUrl}/signalr/calls`,accessTokenProvider:n}):new UJ,notifications:i(`commhub.feed`)?r.create({url:`${e.apiBaseUrl}/signalr/notifications`,accessTokenProvider:n}):new UJ}},s$=e=>{let t=e.logger??new bk(`info`),n=new zN,r=e.authStore,i=r.getState().session?.accessToken??null,a=r.subscribe(e=>{i=e.session?.accessToken??null}),o=()=>i??void 0,s=new vk(new _k(new pk(new dk({logger:t,baseUrl:e.apiBaseUrl,getAuthToken:o}),{timeoutMs:i$,logger:t}),{logger:t}),{logger:t,refresh:()=>r.getState().refreshSession()}),c=new aN({defaultOptions:{queries:{staleTime:a$,retry:1,refetchOnWindowFocus:!0}}}),l=o$(e,t,o);return{logger:t,authStore:r,moduleAccessModule:YJ({httpClient:s,logger:t}),chatModule:wY({logger:t,httpClient:s,realtime:l.chat,clock:n}),feedModule:VX({logger:t,httpClient:s,notificationRealtime:l.notifications}),meetingsModule:uQ({logger:t,httpClient:s}),meetingVideoModule:e$({logger:t,httpClient:s}),scheduleModule:Wj({logger:t,httpClient:s,clock:n}),settingsModule:rR({logger:t,httpClient:s}),usersModule:BQ({logger:t,httpClient:s}),presenceModule:YR({logger:t,httpClient:s}),callsModule:Fz({logger:t,httpClient:s,realtime:l.calls}),queryClient:c,dispose:async()=>{a(),c.clear(),await Promise.all([l.chat.stop(),l.calls.stop(),l.notifications.stop()])}}},c$=new Map,l$=e=>`${e.apiBaseUrl}|${e.clientKey}|${e.authKind}`,u$=(e,t,n)=>{let r=c$.get(e);if(r===void 0){let n=t();r={composition:n.composition,handshake:n.handshake,refCount:0},c$.set(e,r)}r.refCount+=1;let i=!1,a=r;return{composition:a.composition,handshake:a.handshake,release:()=>{i||(i=!0,--a.refCount,!(a.refCount>0)&&(c$.get(e)===a&&c$.delete(e),a.handshake.dispose(),a.composition.dispose().catch(e=>{n?.warn(`Disposing the shared SDK runtime failed`,{error:e})})))}}},d$=`*`,f$=e=>{switch(e.kind){case`sso`:return e.getSecret();case`signed`:return e.getAssertion();case`host-token`:return e.getToken()}},p$=e=>{let t=new zN,n=new dk({logger:e.logger,baseUrl:e.apiBaseUrl,getAuthToken:()=>void 0});switch(e.kind){case`sso`:return new sB({httpClient:n,clock:t,logger:e.logger});case`signed`:return new uq({httpClient:n,clock:t,logger:e.logger,clientKey:e.clientKey,modules:e.modules});case`host-token`:return new dq({clock:t,logger:e.logger})}},m$=e=>{let{apiBaseUrl:t,clientKey:r,authKind:i}=e,a=e.modules===void 0?d$:e.modules.join(`,`),o=(0,n.useRef)(e.logger);o.current=e.logger;let s=(0,n.useMemo)(()=>a===d$?void 0:h$(a),[a]),c=(0,n.useRef)(e.requestCredential);c.current=e.requestCredential;let l=l$({apiBaseUrl:t,clientKey:r,authKind:i}),[u]=(0,n.useState)(()=>u$(l,()=>{let e=o.current??new bk(`info`,`commhub-sdk`),n=p$({kind:i,clientKey:r,apiBaseUrl:t,logger:e,modules:s??[]}),a=s$({apiBaseUrl:t,authStore:oq({clock:new zN,logger:e,storageNamespace:`sdk:${r}`,authGateway:n,setAccessToken:()=>{}}),modules:s,logger:e});return{composition:a,handshake:new wq(t=>new Cq({authStore:a.authStore,moduleAccessModule:a.moduleAccessModule,requestCredential:()=>c.current(),requestedModules:s??[],emit:t,logger:e,renewable:i!==`sso`}))}},o.current));return(0,n.useEffect)(()=>()=>{u.release()},[u]),{composition:u.composition,handshake:u.handshake}},h$=e=>e===``?[]:e.split(`,`),g$=({handshake:e,auth:t,onEvent:r})=>{let i=(0,n.useRef)(r);i.current=r;let a=(0,n.useRef)(t);return a.current=t,(0,n.useEffect)(()=>e.attach(e=>{i.current?.(e)}),[e]),(0,n.useSyncExternalStore)(t=>e.subscribeStatus(t),()=>e.status,()=>e.status)},_$=e=>Math.min(100,Math.max(0,e)),v$=([e,t,n],r=0)=>`hsl(${String(e)} ${String(_$(t))}% ${String(_$(n+r))}%)`,y$=([e,t,n],r)=>`hsl(${String(e)} ${String(_$(t))}% ${String(_$(n))}% / ${String(r)})`,b$=60,x$=e=>e[2]>b$?`#0f172a`:`#ffffff`,S$={a30:.18,a20:.12,a10:.06,a05:.035,border:.22},C$=e=>`${String(Math.max(0,Math.round(e)))}px`,w$=e=>({"--color-primary":v$(e),"--color-primary-strong":v$(e,-12),"--color-primary-light":v$(e,12),"--color-primary-30":y$(e,S$.a30),"--color-primary-20":y$(e,S$.a20),"--color-primary-10":y$(e,S$.a10),"--color-primary-05":y$(e,S$.a05),"--color-primary-border":y$(e,S$.border),"--color-on-primary":x$(e)}),T$=e=>({"--color-secondary":v$(e),"--color-secondary-strong":v$(e,-12),"--color-secondary-30":y$(e,.3),"--color-secondary-20":y$(e,S$.a20),"--color-secondary-10":y$(e,.07),"--color-secondary-border":y$(e,.3)}),E$=e=>({"--radius-sm":C$(e-4),"--radius-md":C$(e),"--radius-lg":C$(e+4),"--radius-xl":C$(e+6)}),D$=[4,6,9,12,15,18,24],O$=()=>{let e={"--height-btn":C$(32),"--height-input":C$(34),"--height-row":C$(44),"--height-nav":C$(36)};return D$.forEach((t,n)=>{e[`--space-${String(n+1)}`]=C$(t)}),e},k$=e=>e?{...e.brand?w$(e.brand):{},...e.accent?T$(e.accent):{},...e.radius===void 0?{}:E$(e.radius),...e.font===void 0?{}:{"--font-sans":e.font},...e.density===`compact`?O$():{}}:{},A$=e=>{let t=e?.mode??`system`;return t===`system`?null:t},j$=`data-theme`,M$=e=>{let t=e.getRootNode();return t instanceof ShadowRoot?t.host:e},N$=e=>{let t=(0,n.useRef)(null),r=JSON.stringify(e??null),i=(0,n.useMemo)(()=>JSON.parse(r),[r]);return(0,n.useEffect)(()=>{let e=t.current;if(e===null)return;let n=M$(e),r=k$(i??void 0),a=A$(i??void 0);for(let[e,t]of Object.entries(r))n.style.setProperty(e,t);return a===null?n.removeAttribute(j$):n.setAttribute(j$,a),()=>{for(let e of Object.keys(r))n.style.removeProperty(e);n.removeAttribute(j$)}},[i]),t},P$=e=>{if(e)return e;try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e)return e}catch{}return`UTC`},F$=class extends n.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.logger.error(`Unhandled error inside the Communication Hub widget`,e,{componentStack:t.componentStack}),this.props.onEvent?.({type:`error`,payload:{code:`WIDGET_CRASHED`,message:e.message}})}render(){let{error:e}=this.state;return e===null?this.props.children:(0,D.jsx)(bi,{tone:`error`,title:`This widget could not be displayed`,children:`Something went wrong inside the Communication Hub widget. Reloading the page usually fixes it.`})}};G({grantedModules:W(V()).nullish(),grantedPolicies:W(V()).nullish(),canManageUserAccess:U().nullish()});var I$=(0,n.createContext)(null),L$=({module:e,children:t})=>(0,D.jsx)(I$.Provider,{value:e,children:t}),R$=e=>{let t=SZ.safeParse(e);if(!t.success)return null;let{id:n,kind:r,actor:i,message:a,detail:o,time:s,postId:c}=t.data;return{id:n,kind:r,actor:i,occurredAt:s,...a==null?{}:{message:a},...o==null?{}:{detail:o},...c==null?{}:{postId:c}}},z$=({onEvent:e})=>{let{notificationRealtime:t,logger:r}=WX();return(0,n.useEffect)(()=>{if(e===void 0)return;let n=t.on(xZ.ReceiveNotification,t=>{let n=R$(t);if(n===null){r.error(`Discarded a malformed notification payload`,{rawPayload:t});return}e({type:`notification`,payload:n})});return t.start().catch(e=>{r.error(`Could not open the notification connection`,e)}),()=>{n()}},[t,r,e]),null},B$=({composition:e,children:t,onEvent:n})=>(0,D.jsx)(cN,{client:e.queryClient,children:(0,D.jsx)(s_,{reducedMotion:`user`,children:(0,D.jsx)(OE,{children:(0,D.jsx)(hB,{store:e.authStore,children:(0,D.jsx)(L$,{module:e.moduleAccessModule,children:(0,D.jsx)(TY,{module:e.chatModule,children:(0,D.jsx)(BY,{children:(0,D.jsx)(UX,{module:e.feedModule,children:(0,D.jsx)(fQ,{module:e.meetingsModule,children:(0,D.jsx)(n$,{module:e.meetingVideoModule,children:(0,D.jsx)(Kj,{module:e.scheduleModule,children:(0,D.jsx)(aR,{module:e.settingsModule,children:(0,D.jsx)(HQ,{module:e.usersModule,children:(0,D.jsx)(tz,{module:e.presenceModule,children:(0,D.jsx)(Lz,{module:e.callsModule,children:(0,D.jsxs)(CB,{children:[t,(0,D.jsx)(QB,{}),(0,D.jsx)(z$,{onEvent:n}),(0,D.jsx)(zE,{})]})})})})})})})})})})})})})})})}),V$={scope:`_scope_p8b6f_6`},H$=e=>{let{auth:t,apiBaseUrl:r,clientKey:i,modules:a,theme:o,timezone:s,logger:c,onEvent:l}=e,{composition:u,handshake:d}=m$({apiBaseUrl:r,clientKey:i,authKind:t.kind,modules:a,logger:c,requestCredential:()=>f$(t)}),f=g$({handshake:d,auth:t,onEvent:l}),p=N$(o),[m,h]=(0,n.useState)(null);return(0,D.jsx)(`div`,{ref:e=>{p.current=e,h(e)},className:V$.scope,"data-timezone":P$(s),"data-handshake":f,children:(0,D.jsx)(mD,{container:m,children:(0,D.jsx)(F$,{logger:u.logger,onEvent:l,children:f===`ready`?(0,D.jsx)(B$,{composition:u,onEvent:l,children:e.children}):null})})})},U$=({children:e,initialRoute:t,...n})=>(0,D.jsx)(H$,{...n,children:(0,D.jsx)(vt,{initialEntries:[t??`/`],children:e})}),W$=class extends li{code=`SDK_WIDGET_CONFIG_INVALID`},G$=()=>QA(e=>typeof e==`function`,{message:`Expected a function`}),K$=tj(`kind`,[G({kind:ij(`signed`),getAssertion:G$()})]),q$=nj([H(),H(),H()]),J$=G({brand:q$.optional(),accent:q$.optional(),radius:H().optional(),font:V().optional(),density:aj([`comfortable`,`compact`]).optional(),mode:aj([`light`,`dark`,`system`]).optional()}),Y$=G({apiBaseUrl:V().url(),clientKey:V().min(1),auth:K$,modules:W(aj(hq)).optional(),theme:J$.optional(),timezone:V().optional(),locale:V().optional(),logger:QA().optional(),onEvent:G$().optional()}),X$=e=>{let t=Y$.safeParse(e);return t.success?M(t.data):N(new W$(t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)))},Z$=`route`,Q$=(e,t,n=[])=>{nq(e,n=>{let r=X$(n.config);if(!r.ok)return(0,D.jsx)(iq,{tagName:e,detail:r.error.message});let i=n.getAttribute(Z$);return(0,D.jsx)(U$,{...r.value,...i===null?{}:{initialRoute:i},children:t()})},[Z$,...n])},$$=()=>{Q$(`uapp-chat`,()=>(0,D.jsx)(qK,{}))},e1={date:``,time:``,recurring:!1,frequency:`weekly`},t1=[{value:`now`,label:`Post now`},{value:`schedule`,label:`Schedule`}],n1=[{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}],r1={photo:`Add photos`,tag:`Tag people`,feeling:`How are you feeling?`,category:`POST CATEGORY`,item:`Select Item`,template:`Choose Template`},Y={screen:`_screen_ltjgo_1`,toolbar:`_toolbar_ltjgo_8`,toolbarContainer:`_toolbarContainer_ltjgo_14`,search:`_search_ltjgo_23`,toolbarRailSpacer:`_toolbarRailSpacer_ltjgo_31`,searchIcon:`_searchIcon_ltjgo_36`,searchInput:`_searchInput_ltjgo_44`,textareaError:`_textareaError_ltjgo_59`,commentComposerError:`_commentComposerError_ltjgo_60`,shareCommentError:`_shareCommentError_ltjgo_61`,wrapper:`_wrapper_ltjgo_70`,column:`_column_ltjgo_80`,rail:`_rail_ltjgo_91`,railHead:`_railHead_ltjgo_102`,railHeadTitle:`_railHeadTitle_ltjgo_109`,railSeeAll:`_railSeeAll_ltjgo_123`,railList:`_railList_ltjgo_132`,cardBody:`_cardBody_ltjgo_142`,seeMoreBtn:`_seeMoreBtn_ltjgo_151`,railFoot:`_railFoot_ltjgo_166`,missed:`_missed_ltjgo_177`,missedHead:`_missedHead_ltjgo_184`,missedSpark:`_missedSpark_ltjgo_192`,missedTitle:`_missedTitle_ltjgo_196`,missedBadge:`_missedBadge_ltjgo_203`,missedScroller:`_missedScroller_ltjgo_212`,missedScrollerFade:`_missedScrollerFade_ltjgo_217`,missedTrack:`_missedTrack_ltjgo_217`,missedNav:`_missedNav_ltjgo_229`,missedNavLeft:`_missedNavLeft_ltjgo_264`,missedNavRight:`_missedNavRight_ltjgo_268`,missedCard:`_missedCard_ltjgo_272`,missedCardTop:`_missedCardTop_ltjgo_282`,missedDot:`_missedDot_ltjgo_289`,missedCat:`_missedCat_ltjgo_297`,missedTime:`_missedTime_ltjgo_304`,missedSummary:`_missedSummary_ltjgo_311`,missedFoot:`_missedFoot_ltjgo_323`,missedCta:`_missedCta_ltjgo_329`,missedPriority:`_missedPriority_ltjgo_338`,compChips:`_compChips_ltjgo_354`,compChip:`_compChip_ltjgo_354`,actionBar:`_actionBar_ltjgo_374`,actionBarLabel:`_actionBarLabel_ltjgo_386`,actionBarBtns:`_actionBarBtns_ltjgo_392`,actionIcon:`_actionIcon_ltjgo_397`,actionIconActive:`_actionIconActive_ltjgo_414`,sheet:`_sheet_ltjgo_419`,sheetHead:`_sheetHead_ltjgo_427`,sheetLabel:`_sheetLabel_ltjgo_435`,sheetClose:`_sheetClose_ltjgo_443`,sheetChips:`_sheetChips_ltjgo_465`,catChip:`_catChip_ltjgo_471`,catChipOn:`_catChipOn_ltjgo_483`,feelGrid:`_feelGrid_ltjgo_488`,feelBtn:`_feelBtn_ltjgo_494`,feelBtnOn:`_feelBtnOn_ltjgo_509`,feelEmoji:`_feelEmoji_ltjgo_515`,photoInput:`_photoInput_ltjgo_519`,photoZone:`_photoZone_ltjgo_523`,photoZoneDrag:`_photoZoneDrag_ltjgo_528`,dropzone:`_dropzone_ltjgo_533`,dropIcon:`_dropIcon_ltjgo_554`,dropTitle:`_dropTitle_ltjgo_566`,dropHint:`_dropHint_ltjgo_572`,photoGrid:`_photoGrid_ltjgo_577`,photoThumb:`_photoThumb_ltjgo_584`,photoImg:`_photoImg_ltjgo_592`,photoRemove:`_photoRemove_ltjgo_599`,photoAddMore:`_photoAddMore_ltjgo_619`,mobilePromoTrigger:`_mobilePromoTrigger_ltjgo_642`,promoPulseGlow:`_promoPulseGlow_ltjgo_1`,mobilePromoTriggerBarHidden:`_mobilePromoTriggerBarHidden_ltjgo_739`,mobilePromoExpanded:`_mobilePromoExpanded_ltjgo_745`,promoShimmerSweep:`_promoShimmerSweep_ltjgo_758`,promoShimmer:`_promoShimmer_ltjgo_758`,promoIconWrap:`_promoIconWrap_ltjgo_774`,sparkleIcon:`_sparkleIcon_ltjgo_787`,sparkleTwinkle:`_sparkleTwinkle_ltjgo_1`,promoBtnText:`_promoBtnText_ltjgo_791`,mobilePromoBadge:`_mobilePromoBadge_ltjgo_810`,promoPopoverOverlay:`_promoPopoverOverlay_ltjgo_827`,promoPopoverCard:`_promoPopoverCard_ltjgo_839`,popoverHeader:`_popoverHeader_ltjgo_853`,popoverCloseX:`_popoverCloseX_ltjgo_862`,popoverBadgeIcon:`_popoverBadgeIcon_ltjgo_883`,popoverTitleRow:`_popoverTitleRow_ltjgo_895`,popoverTitle:`_popoverTitle_ltjgo_895`,popoverSeeAllBtn:`_popoverSeeAllBtn_ltjgo_911`,popoverSub:`_popoverSub_ltjgo_927`,popoverContent:`_popoverContent_ltjgo_934`,popoverEmpty:`_popoverEmpty_ltjgo_943`,missedClose:`_missedClose_ltjgo_992`,missedRead:`_missedRead_ltjgo_1029`,comments:`_comments_ltjgo_1055`,commentRow:`_commentRow_ltjgo_1064`,commentAvatar:`_commentAvatar_ltjgo_1069`,commentBubble:`_commentBubble_ltjgo_1083`,commentAuthor:`_commentAuthor_ltjgo_1091`,commentTime:`_commentTime_ltjgo_1097`,commentText:`_commentText_ltjgo_1102`,commentComposer:`_commentComposer_ltjgo_60`,commentInput:`_commentInput_ltjgo_1128`,commentSend:`_commentSend_ltjgo_1138`,sharePreviewWrap:`_sharePreviewWrap_ltjgo_1168`,sharePreview:`_sharePreview_ltjgo_1168`,sharePreviewAvatar:`_sharePreviewAvatar_ltjgo_1184`,sharePreviewBody:`_sharePreviewBody_ltjgo_1198`,sharePreviewMeta:`_sharePreviewMeta_ltjgo_1203`,sharePreviewCat:`_sharePreviewCat_ltjgo_1209`,sharePreviewTitle:`_sharePreviewTitle_ltjgo_1214`,shareField:`_shareField_ltjgo_1224`,shareComment:`_shareComment_ltjgo_61`,shareSearchWrap:`_shareSearchWrap_ltjgo_1248`,shareSearch:`_shareSearch_ltjgo_1248`,shareSearchInput:`_shareSearchInput_ltjgo_1264`,shareList:`_shareList_ltjgo_1281`,shareSectionLabel:`_shareSectionLabel_ltjgo_1288`,shareRow:`_shareRow_ltjgo_1297`,shareRowOn:`_shareRowOn_ltjgo_1315`,shareAvatar:`_shareAvatar_ltjgo_1321`,shareAvatarSquare:`_shareAvatarSquare_ltjgo_1335`,shareRowBody:`_shareRowBody_ltjgo_1339`,shareRowName:`_shareRowName_ltjgo_1346`,shareRowSub:`_shareRowSub_ltjgo_1352`,shareCheck:`_shareCheck_ltjgo_1357`,shareCheckOn:`_shareCheckOn_ltjgo_1370`,shareEmpty:`_shareEmpty_ltjgo_1375`,shareFootText:`_shareFootText_ltjgo_1383`,shareFootBtns:`_shareFootBtns_ltjgo_1388`,shareCancelBtn:`_shareCancelBtn_ltjgo_1393`,shareSendBtn:`_shareSendBtn_ltjgo_1408`,shareRoot:`_shareRoot_ltjgo_1429`,shareBackdrop:`_shareBackdrop_ltjgo_1439`,shareFade:`_shareFade_ltjgo_1`,shareModal:`_shareModal_ltjgo_1449`,shareIn:`_shareIn_ltjgo_1`,shareHead:`_shareHead_ltjgo_1483`,shareHeadIcon:`_shareHeadIcon_ltjgo_1491`,shareHeadText:`_shareHeadText_ltjgo_1503`,shareTitle:`_shareTitle_ltjgo_1508`,shareDesc:`_shareDesc_ltjgo_1515`,shareCloseBtn:`_shareCloseBtn_ltjgo_1521`,shareFooter:`_shareFooter_ltjgo_1540`,ppRoot:`_ppRoot_ltjgo_1551`,ppOverlay:`_ppOverlay_ltjgo_1559`,ppFade:`_ppFade_ltjgo_1`,ppPanel:`_ppPanel_ltjgo_1569`,ppSlide:`_ppSlide_ltjgo_1`,ppHead:`_ppHead_ltjgo_1601`,ppHeadIcon:`_ppHeadIcon_ltjgo_1610`,ppHeadText:`_ppHeadText_ltjgo_1621`,ppTitle:`_ppTitle_ltjgo_1626`,ppSubtitle:`_ppSubtitle_ltjgo_1643`,ppManaged:`_ppManaged_ltjgo_1649`,ppClose:`_ppClose_ltjgo_1654`,ppTabs:`_ppTabs_ltjgo_1674`,ppTab:`_ppTab_ltjgo_1674`,ppSearch:`_ppSearch_ltjgo_1683`,ppTabActive:`_ppTabActive_ltjgo_1704`,ppTabBg:`_ppTabBg_ltjgo_1708`,ppTabLabel:`_ppTabLabel_ltjgo_1716`,ppSearchIcon:`_ppSearchIcon_ltjgo_1726`,ppSearchInput:`_ppSearchInput_ltjgo_1734`,ppList:`_ppList_ltjgo_1753`,ppListInner:`_ppListInner_ltjgo_1761`,ppEmpty:`_ppEmpty_ltjgo_1776`,emptyState:`_emptyState_ltjgo_1790`,emptyIconWrap:`_emptyIconWrap_ltjgo_1802`,emptyTitle:`_emptyTitle_ltjgo_1814`,emptyText:`_emptyText_ltjgo_1821`,tabs:`_tabs_ltjgo_1830`,tab:`_tab_ltjgo_1830`,tabActive:`_tabActive_ltjgo_1852`,tabBadge:`_tabBadge_ltjgo_1858`,composerCollapsed:`_composerCollapsed_ltjgo_1866`,ccAvatar:`_ccAvatar_ltjgo_1876`,compAvatar:`_compAvatar_ltjgo_1877`,avatar:`_avatar_ltjgo_1878`,ccInput:`_ccInput_ltjgo_1895`,composer:`_composer_ltjgo_1866`,compHead:`_compHead_ltjgo_1921`,compAvatarWrapper:`_compAvatarWrapper_ltjgo_1928`,statusDot:`_statusDot_ltjgo_1933`,compHeaderTagline:`_compHeaderTagline_ltjgo_1950`,compMutedText:`_compMutedText_ltjgo_1956`,taggedTagline:`_taggedTagline_ltjgo_1961`,audiencePill:`_audiencePill_ltjgo_1973`,audienceSection:`_audienceSection_ltjgo_1992`,audienceLabel:`_audienceLabel_ltjgo_2003`,audienceRow:`_audienceRow_ltjgo_2011`,audienceBtn:`_audienceBtn_ltjgo_2017`,audienceBtnActive:`_audienceBtnActive_ltjgo_2035`,compClose:`_compClose_ltjgo_2041`,titleInput:`_titleInput_ltjgo_2060`,textarea:`_textarea_ltjgo_59`,compOption:`_compOption_ltjgo_2093`,compOptionLabel:`_compOptionLabel_ltjgo_2105`,compFooter:`_compFooter_ltjgo_2118`,submitRight:`_submitRight_ltjgo_2127`,modeToggle:`_modeToggle_ltjgo_2133`,cancelBtn:`_cancelBtn_ltjgo_2137`,postBtn:`_postBtn_ltjgo_2152`,card:`_card_ltjgo_142`,urgentStripe:`_urgentStripe_ltjgo_2186`,pinnedRow:`_pinnedRow_ltjgo_2197`,pin:`_pin_ltjgo_2197`,cardHead:`_cardHead_ltjgo_2212`,cardAuthor:`_cardAuthor_ltjgo_2224`,authorName:`_authorName_ltjgo_2229`,metaRow:`_metaRow_ltjgo_2239`,cardRight:`_cardRight_ltjgo_2249`,badge:`_badge_ltjgo_2257`,badgeDot:`_badgeDot_ltjgo_2270`,bookmarkBtn:`_bookmarkBtn_ltjgo_2277`,bookmarkActive:`_bookmarkActive_ltjgo_2295`,pinBtn:`_pinBtn_ltjgo_2300`,pinActive:`_pinActive_ltjgo_2318`,editBtn:`_editBtn_ltjgo_2323`,cardActions:`_cardActions_ltjgo_2341`,cardTitle:`_cardTitle_ltjgo_2347`,ackBanner:`_ackBanner_ltjgo_2367`,ackBtn:`_ackBtn_ltjgo_2382`,ackDone:`_ackDone_ltjgo_2394`,summary:`_summary_ltjgo_2408`,summaryLeft:`_summaryLeft_ltjgo_2418`,summaryIcons:`_summaryIcons_ltjgo_2424`,summaryDot:`_summaryDot_ltjgo_2429`,summaryCount:`_summaryCount_ltjgo_2445`,summaryComments:`_summaryComments_ltjgo_2450`,summaryCommentsClickable:`_summaryCommentsClickable_ltjgo_2454`,postBar:`_postBar_ltjgo_2464`,reactWrap:`_reactWrap_ltjgo_2472`,actionBtn:`_actionBtn_ltjgo_2478`,actionActive:`_actionActive_ltjgo_2502`,picker:`_picker_ltjgo_2519`,pickerVisible:`_pickerVisible_ltjgo_2551`,pickerBtn:`_pickerBtn_ltjgo_2557`,pickerActive:`_pickerActive_ltjgo_2579`,schedule:`_schedule_ltjgo_2622`,scheduleHead:`_scheduleHead_ltjgo_2633`,scheduleGrid:`_scheduleGrid_ltjgo_2647`,scheduleField:`_scheduleField_ltjgo_2653`,scheduleLabel:`_scheduleLabel_ltjgo_2659`,scheduleInput:`_scheduleInput_ltjgo_2665`,scheduleRow:`_scheduleRow_ltjgo_2682`,scheduleRowLabel:`_scheduleRowLabel_ltjgo_2692`,switch:`_switch_ltjgo_2705`,switchOn:`_switchOn_ltjgo_2717`,switchKnob:`_switchKnob_ltjgo_2721`,scheduleFreq:`_scheduleFreq_ltjgo_2736`,scheduleTz:`_scheduleTz_ltjgo_2740`,tagSearch:`_tagSearch_ltjgo_2754`,tagSearchInput:`_tagSearchInput_ltjgo_2765`,tagList:`_tagList_ltjgo_2774`,tagRow:`_tagRow_ltjgo_2782`,tagRowActive:`_tagRowActive_ltjgo_2799`,tagRowContent:`_tagRowContent_ltjgo_2804`,tagAvatar:`_tagAvatar_ltjgo_2810`,tagInfo:`_tagInfo_ltjgo_2823`,tagName:`_tagName_ltjgo_2828`,tagRole:`_tagRole_ltjgo_2834`,tagCheckbox:`_tagCheckbox_ltjgo_2839`,tagCheckboxActive:`_tagCheckboxActive_ltjgo_2850`,postImagesGrid:`_postImagesGrid_ltjgo_2857`,grid1:`_grid1_ltjgo_2876`,grid2:`_grid2_ltjgo_2880`,grid3:`_grid3_ltjgo_2884`,grid4:`_grid4_ltjgo_2889`,gridImageWrap:`_gridImageWrap_ltjgo_2894`,gridImage:`_gridImage_ltjgo_2894`,moreImagesOverlay:`_moreImagesOverlay_ltjgo_2920`,lightboxOverlay:`_lightboxOverlay_ltjgo_2943`,lightboxContainer:`_lightboxContainer_ltjgo_2960`,lightboxLeft:`_lightboxLeft_ltjgo_2973`,lightboxRight:`_lightboxRight_ltjgo_2983`,lightboxScrollableContent:`_lightboxScrollableContent_ltjgo_2993`,lightboxDivider:`_lightboxDivider_ltjgo_3004`,lightboxClose:`_lightboxClose_ltjgo_3028`,lightboxImage:`_lightboxImage_ltjgo_3041`,lightboxArrow:`_lightboxArrow_ltjgo_3077`,lightboxArrowLeft:`_lightboxArrowLeft_ltjgo_3099`,lightboxArrowRight:`_lightboxArrowRight_ltjgo_3107`,lightboxCounter:`_lightboxCounter_ltjgo_3115`,templateSheet:`_templateSheet_ltjgo_3133`,templateSheetHeader:`_templateSheetHeader_ltjgo_3139`,templateBackBtn:`_templateBackBtn_ltjgo_3147`,templateSheetTitle:`_templateSheetTitle_ltjgo_3170`,templateSheetMeta:`_templateSheetMeta_ltjgo_3179`,templateSearch:`_templateSearch_ltjgo_3191`,templateSearchIcon:`_templateSearchIcon_ltjgo_3197`,templateSearchInput:`_templateSearchInput_ltjgo_3206`,templateList:`_templateList_ltjgo_3223`,templateItem:`_templateItem_ltjgo_3230`,templateItemBody:`_templateItemBody_ltjgo_3254`,templateItemTitle:`_templateItemTitle_ltjgo_3262`,templateItemSub:`_templateItemSub_ltjgo_3271`,templateUseBtn:`_templateUseBtn_ltjgo_3279`,templateEmpty:`_templateEmpty_ltjgo_3300`,itemIconContainer:`_itemIconContainer_ltjgo_3307`,itemBadge:`_itemBadge_ltjgo_3319`,itemMetaRow:`_itemMetaRow_ltjgo_3329`},i1=({on:e,label:t,onToggle:n})=>(0,D.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":t,className:T(Y.switch,e&&Y.switchOn),onClick:n,children:(0,D.jsx)(`span`,{className:Y.switchKnob})}),a1=e=>{let t=VN(new Date,e),n=t.hour*60+t.minute+1,r=Math.floor(n/60)%24,i=n%60;return`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`},o1=({value:e,todayStr:t,clampTime:n,onChange:r})=>(0,D.jsxs)(`label`,{className:Y.scheduleField,children:[(0,D.jsx)(`span`,{className:Y.scheduleLabel,children:`Date`}),(0,D.jsx)(`input`,{type:`date`,className:Y.scheduleInput,value:e.date,min:t,onChange:i=>{let a=i.target.value;r({...e,date:a,time:a===t?n(e.time):e.time})}})]}),s1=({value:e,minTimeStr:t,isPastTime:n,clampTime:r,onChange:i})=>(0,D.jsxs)(`label`,{className:Y.scheduleField,children:[(0,D.jsx)(`span`,{className:Y.scheduleLabel,children:`Time`}),(0,D.jsx)(`input`,{type:`time`,className:T(Y.scheduleInput,n&&Y.scheduleInputError),"aria-invalid":n,"aria-describedby":n?`schedule-time-error`:void 0,value:e.time,min:t,onChange:t=>{i({...e,time:r(t.target.value)})},onBlur:()=>{n&&i({...e,time:t})}}),n&&(0,D.jsx)(`span`,{id:`schedule-time-error`,className:Y.scheduleTimeError,role:`alert`,children:`Past time — snapped to earliest available time.`})]}),c1=({value:e,onChange:t,timezone:n})=>{let r=VN(new Date,n),i=`${String(r.year)}-${String(r.month).padStart(2,`0`)}-${String(r.day).padStart(2,`0`)}`,a=e.date===i,o=a1(n),s=e=>a&&e<o?o:e,c=a&&e.time<o;return(0,D.jsxs)(`div`,{className:Y.schedule,children:[(0,D.jsxs)(`div`,{className:Y.scheduleHead,children:[(0,D.jsx)(zn,{size:13}),` SCHEDULE THIS POST`]}),(0,D.jsxs)(`div`,{className:Y.scheduleGrid,children:[(0,D.jsx)(o1,{value:e,todayStr:i,clampTime:s,onChange:t}),(0,D.jsx)(s1,{value:e,minTimeStr:o,isPastTime:c,clampTime:s,onChange:t})]}),(0,D.jsxs)(`div`,{className:Y.scheduleRow,children:[(0,D.jsxs)(`span`,{className:Y.scheduleRowLabel,children:[(0,D.jsx)(Vr,{size:13}),` Recurring`]}),(0,D.jsx)(i1,{on:e.recurring,label:`Repeat this post`,onToggle:()=>{t({...e,recurring:!e.recurring})}})]}),e.recurring&&(0,D.jsx)($E,{ariaLabel:`Repeat frequency`,className:Y.scheduleFreq??``,options:n1,value:e.frequency,onChange:n=>{t({...e,frequency:n})}}),(0,D.jsxs)(`div`,{className:Y.scheduleTz,children:[(0,D.jsx)(lr,{size:12}),` Timezone: `,(0,D.jsx)(`strong`,{children:n})]})]})},l1=({mode:e,disabled:t,submitLabels:n,hideToggle:r,onMode:i,onCancel:a,onSubmit:o})=>(0,D.jsxs)(`div`,{className:Y.compFooter,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.cancelBtn,onClick:a,children:`Cancel`}),(0,D.jsxs)(`div`,{className:Y.submitRight,children:[!r&&(0,D.jsx)($E,{ariaLabel:`Publish timing`,className:Y.modeToggle??``,options:t1,value:e,onChange:i}),(0,D.jsx)(`button`,{type:`button`,className:Y.postBtn,disabled:t,onClick:o,children:e===`schedule`?n?.schedule??(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Qn,{size:12}),` Schedule post`]}):n?.now??(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ur,{size:12}),` Post now`]})})]})]});function u1(e,t,n){if(e===`schedule`)return WN(t.date,t.time,n)}function d1(){let[e,t]=(0,n.useState)(``),[r,i]=(0,n.useState)(``),[a,o]=(0,n.useState)(!1),[s,c]=(0,n.useState)(`general`),[l,u]=(0,n.useState)(`all`),[d,f]=(0,n.useState)(null),[p,m]=(0,n.useState)(null),[h,g]=(0,n.useState)(null),[_,v]=(0,n.useState)(`now`),[y,b]=(0,n.useState)(e1),[x,S]=(0,n.useState)([]),[C,ee]=(0,n.useState)([]),[te,ne]=(0,n.useState)(null);return{body:e,setBody:t,title:r,setTitle:i,mustRead:a,setMustRead:o,categoryId:s,setCategoryId:c,audienceId:l,setAudienceId:u,feeling:d,setFeeling:f,location:p,setLocation:m,sheet:h,setSheet:g,mode:_,setMode:v,schedule:y,setSchedule:b,taggedUsers:x,setTaggedUsers:S,photos:C,setPhotos:ee,selectedItem:te,setSelectedItem:ne}}function f1(e,t){return e.title.trim().length>300?`Post title cannot exceed 300 characters.`:e.body.trim().length>8e3?`Post body cannot exceed 8000 characters.`:e.mode===`schedule`&&t&&Date.parse(t)<Date.now()?`Schedule time must be in the future.`:null}function p1(e,t,n){let r=YX(),i=sZ(),a=e.body.trim().length===0||r.isPending||i.isPending||e.mode===`schedule`&&(!e.schedule.date||!e.schedule.time);return{submitDisabled:a,submit:async()=>{if(a)return;let o=u1(e.mode,e.schedule,n),s=f1(e,o);if(s){j.error(s);return}try{let n=[];e.photos.length>0&&(n=await Promise.all(e.photos.map(e=>i.mutateAsync(e)))),r.mutate({body:e.body,categoryId:e.categoryId,audienceId:e.audienceId,mustAcknowledge:e.mustRead,taggedUserIds:e.taggedUsers.map(e=>e.id),...e.title.trim()?{title:e.title.trim()}:{},scheduledAt:o,isRecurring:e.mode===`schedule`?e.schedule.recurring:!1,recurrenceFrequency:e.mode===`schedule`&&e.schedule.recurring?e.schedule.frequency:void 0,locationLabel:e.location??void 0,imageIds:n.length>0?n:void 0},{onSuccess:()=>{e.mode===`schedule`&&j.success(`Post scheduled for ${e.schedule.date} at ${e.schedule.time}`),t()},onError:()=>{j.error(`Failed to publish post. Please try again.`)}})}catch{j.error(`Invalid schedule date or time, or image upload failed.`)}}}}function m1(e,t){let n=d1(),r=JN().display,{submitDisabled:i,submit:a}=p1(n,e,r),o=e=>{n.setTaggedUsers(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])},s=(e,t)=>{n.setTitle(e),n.setBody(t),n.setSheet(null),n.setSelectedItem(null)},c=e=>{let t=typeof e==`function`?e(n.mode):e;if(n.setMode(t),t===`schedule`&&!n.schedule.date){let e=VN(new Date,r),t=`${String(e.year)}-${String(e.month).padStart(2,`0`)}-${String(e.day).padStart(2,`0`)}`,i=`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}`;n.setSchedule({...n.schedule,date:t,time:i})}};return{...n,setMode:c,category:t.find(e=>e.id===n.categoryId),timezone:r,submitDisabled:i,toggleTag:o,applyTemplate:s,submit:a}}var h1=e=>{let t=e.values,n=[`item_title`,`student_name`,`university_name`,`course_name`,`name`,`title`].find(e=>{let n=t[e];return n?n.trim()!==``:!1}),r=n===void 0?void 0:t[n],i=Object.entries(t).find(([e,t])=>t.trim()!==``),a=r??i?.[1]??e.id,o=n??i?.[0],s=[`item_description`,`university`,`status`].find(e=>{let n=t[e];return n?n.trim()!==``:!1}),c=s===void 0?void 0:t[s],l=Object.entries(t).find(([e,t])=>e!==o&&t.trim()!==``),u=c??l?.[1]??``;return{id:e.id,label:a,sublabel:u,values:t}},g1=(e,t)=>e===void 0?[]:t.filter(t=>e.templateIds.includes(t.id)||e.dataTemplateIds.includes(t.id)),_1=(e,t)=>{let n=!!e?.webhookId,r=hR(n?void 0:e?.categoryKey),i=gR(e?.categoryKey??``,t,n),a=n?i:r;return{rawItems:a.data??[],isLoadingItems:a.isPending,hasWebhook:n}},v1={all:ai,sales:Ln,admission:ur,leadership:Zr},y1=e=>v1[e]??ai,b1=({audienceId:e,onChange:t})=>{let{data:n=[]}=iZ(),r=n.find(t=>t.id===e)??n[0],i=y1(r?.id??`all`);return(0,D.jsx)(FT,{align:`start`,trigger:(0,D.jsxs)(`button`,{type:`button`,className:Y.audiencePill,"aria-label":`Audience`,children:[(0,D.jsx)(i,{size:12}),` `,r?.label??`Everyone`,(0,D.jsx)(Gn,{size:12})]}),items:n.map(e=>{let n=y1(e.id);return{label:e.label,icon:(0,D.jsx)(n,{size:14}),onSelect:()=>{t(e.id)}}})})},x1=({audienceId:e,onChange:t})=>{let{data:n=[]}=iZ();return(0,D.jsxs)(`div`,{className:Y.audienceSection,children:[(0,D.jsx)(`span`,{className:Y.audienceLabel,children:`Who can see this post?`}),(0,D.jsx)(`div`,{className:Y.audienceRow,children:n.map(n=>{let r=y1(n.id),i=n.id===e;return(0,D.jsxs)(`button`,{type:`button`,className:T(Y.audienceBtn,i&&Y.audienceBtnActive),"aria-pressed":i,onClick:()=>{t(n.id)},children:[(0,D.jsx)(r,{size:14}),` `,n.label,i&&(0,D.jsx)(Wn,{size:13})]},n.id)})})]})},S1=({user:e,isSelected:t,onToggleTag:n})=>(0,D.jsxs)(`button`,{type:`button`,className:T(Y.tagRow,t&&Y.tagRowActive),onClick:()=>{n(e)},children:[(0,D.jsxs)(`div`,{className:Y.tagRowContent,children:[(0,D.jsx)(`span`,{className:Y.tagAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`div`,{className:Y.tagInfo,children:[(0,D.jsx)(`span`,{className:Y.tagName,children:e.name}),(0,D.jsx)(`span`,{className:Y.tagRole,children:e.role})]})]}),(0,D.jsx)(`div`,{className:T(Y.tagCheckbox,t&&Y.tagCheckboxActive),children:(0,D.jsx)(Wn,{size:12})})]}),C1=({isSearching:e,isPending:t,search:n,activeList:r,taggedUserIds:i,onToggleTag:a})=>e?t?(0,D.jsx)(`span`,{className:Y.actionBarLabel,style:{display:`block`,textAlign:`center`,padding:`20px 0`},children:`Searching...`}):r.length===0?(0,D.jsxs)(`span`,{className:Y.actionBarLabel,style:{display:`block`,textAlign:`center`,padding:`20px 0`},children:[`No teammates found matching "`,n,`".`]}):(0,D.jsx)(D.Fragment,{children:r.map(e=>(0,D.jsx)(S1,{user:e,isSelected:i.includes(e.id),onToggleTag:a},e.id))}):(0,D.jsx)(`span`,{className:Y.actionBarLabel,style:{display:`block`,textAlign:`center`,padding:`20px 0`},children:`Type a name or email to search teammates.`}),w1=({taggedUserIds:e,onToggleTag:t})=>{let[r,i]=(0,n.useState)(``),a=oZ(r),{user:o}=_B(),s=r.trim().length>0,c=(a.data??[]).filter(e=>e.id!==o?.id);return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:Y.tagSearch,children:[(0,D.jsx)(Hr,{size:14,className:Y.actionBarLabel}),(0,D.jsx)(`input`,{type:`text`,className:Y.tagSearchInput,placeholder:`Search teammates`,value:r,onChange:e=>{i(e.target.value)}}),r&&(0,D.jsx)(`button`,{type:`button`,onClick:()=>{i(``)},style:{border:`none`,background:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`2px`,color:`var(--color-text-soft)`,borderRadius:`50%`},"aria-label":`Clear search`,children:(0,D.jsx)(ci,{size:14})})]}),(0,D.jsx)(`div`,{className:Y.tagList,children:(0,D.jsx)(C1,{isSearching:s,isPending:a.isPending,search:r,activeList:c,taggedUserIds:e,onToggleTag:t})})]})},T1=({categoryId:e,onCategory:t})=>{let{data:n=[]}=rZ();return(0,D.jsx)(`div`,{className:Y.sheetChips,children:n.map(n=>(0,D.jsx)(`button`,{type:`button`,className:T(Y.catChip,e===n.id&&Y.catChipOn),style:E({"--chip":n.color}),onClick:()=>{t(n)},children:n.label},n.id))})},E1=({feeling:e,onFeeling:t})=>{let{data:n=[]}=aZ();return(0,D.jsx)(`div`,{className:Y.feelGrid,children:n.map(n=>(0,D.jsxs)(`button`,{type:`button`,className:T(Y.feelBtn,e===n.id&&Y.feelBtnOn),onClick:()=>{t(n.id)},children:[(0,D.jsx)(`span`,{className:Y.feelEmoji,children:n.emoji}),n.label]},n.id))})},D1=(e,t)=>{let n={};return Object.entries(t).forEach(([e,t])=>{n[e.toLowerCase()]=t}),e.replace(/\{\{\s*([a-z0-9_]+)\s*\}\}/gi,(e,t)=>n[t.toLowerCase()]??``)},O1=e=>e.length>120?`${e.slice(0,120)}…`:e,k1=(e,t,n,r)=>{t(e),e.dataTemplateIds.length>0||e.templateIds.length>0?n(`item`):r()},A1=(e,t)=>{t(`item`)},j1=e=>{let t=new Set,n=/\{\{\s*([a-z0-9_]+)\s*\}\}/gi;return e.forEach(e=>{let r=`${e.postTitle} ${e.postBody}`.matchAll(n);for(let e of r)e[1]!==void 0&&t.add(e[1].toLowerCase())}),t},M1=({item:e,templates:t})=>{let n=j1(t),r=Object.entries(e.values).filter(([e,t])=>(n.size===0||n.has(e.toLowerCase()))&&e!==`item_title`&&e!==`student_name`&&e!==`university_name`&&e!==`course_name`&&e!==`name`&&e!==`title`&&e!==`item_description`&&e!==`university`&&e!==`status`&&t.trim()!==``);return r.length===0?null:(0,D.jsx)(`div`,{className:Y.itemMetaRow,children:r.map(([e,t])=>(0,D.jsxs)(`span`,{className:Y.itemBadge,children:[e.replace(/_/g,` `),`: `,t]},e))})},N1=({item:e,templates:t,onSelect:n})=>{let r=e.label,i=(0,D.jsxs)(D.Fragment,{children:[e.sublabel!==``&&(0,D.jsx)(`span`,{className:Y.templateItemSub,children:e.sublabel}),(0,D.jsx)(M1,{item:e,templates:t})]});if(t.length>0&&t[0]!==void 0){let n=t[0],a=new Date,o={item_count:`1`,current_year:String(a.getFullYear()),current_date:a.toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`}),...e.values};r=D1(n.postTitle,o),i=(0,D.jsx)(`span`,{className:Y.templateItemSub,children:O1(D1(n.postBody,o))})}return(0,D.jsxs)(`button`,{type:`button`,className:Y.templateItem,onClick:()=>{n(e)},children:[(0,D.jsx)(`div`,{className:Y.itemIconContainer,children:(0,D.jsx)(sr,{size:16})}),(0,D.jsxs)(`div`,{className:Y.templateItemBody,children:[(0,D.jsx)(`span`,{className:Y.templateItemTitle,children:r}),i]}),(0,D.jsx)(`span`,{className:Y.templateUseBtn,children:`SELECT`})]})},P1=({category:e,items:t,templates:r,searchQuery:i,onSearchQuery:a,isLoading:o,onBack:s,onSelectItem:c})=>{let[l,u]=(0,n.useState)(``),d=a!==void 0,f=d?i??``:l,p=d?a:u,m=d||f.trim()===``?t:t.filter(e=>[e.label,e.sublabel,e.id].join(` `).toLowerCase().includes(f.toLowerCase()));return(0,D.jsxs)(`div`,{className:Y.templateSheet,children:[(0,D.jsxs)(`div`,{className:Y.templateSheetHeader,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.templateBackBtn,onClick:s,children:(0,D.jsx)(jn,{size:14})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:Y.templateSheetTitle,children:`Select Item`}),(0,D.jsxs)(`span`,{className:Y.templateSheetMeta,children:[`Showing items for `,(0,D.jsx)(`strong`,{children:e.label})]})]})]}),(0,D.jsxs)(`div`,{className:Y.templateSearch,children:[(0,D.jsx)(Hr,{size:13,className:Y.templateSearchIcon}),(0,D.jsx)(`input`,{type:`text`,className:Y.templateSearchInput,placeholder:`Search items…`,value:f,onChange:e=>{p(e.target.value)}}),o&&m.length>0&&(0,D.jsx)(`div`,{style:{marginLeft:`8px`,display:`flex`,alignItems:`center`},children:(0,D.jsx)(gi,{size:`sm`})})]}),(0,D.jsx)(`div`,{className:Y.templateList,children:o&&m.length===0?(0,D.jsx)(`div`,{style:{padding:`2rem`,display:`flex`,justifyContent:`center`},children:(0,D.jsx)(gi,{})}):m.length===0?(0,D.jsx)(`p`,{className:Y.templateEmpty,children:`No items found.`}):m.map(e=>(0,D.jsx)(N1,{item:e,templates:r,onSelect:c},e.id))})]})},F1=({selectedItem:e,templates:t,onBack:n,onUse:r})=>(0,D.jsxs)(`div`,{className:Y.templateSheet,children:[(0,D.jsxs)(`div`,{className:Y.templateSheetHeader,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.templateBackBtn,onClick:n,children:(0,D.jsx)(jn,{size:14})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:Y.templateSheetTitle,children:`Choose Template`}),(0,D.jsxs)(`span`,{className:Y.templateSheetMeta,children:[e.label,` · `,(0,D.jsx)(`strong`,{children:e.sublabel})]})]})]}),(0,D.jsx)(`div`,{className:Y.templateList,children:t.length===0?(0,D.jsx)(`p`,{className:Y.templateEmpty,children:`No templates linked to this category.`}):t.map(t=>{let n=new Date,i={item_count:`1`,current_year:String(n.getFullYear()),current_date:n.toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`}),...e.values},a=D1(t.postBody,i),o=D1(t.postTitle,i);return(0,D.jsxs)(`button`,{type:`button`,className:Y.templateItem,onClick:()=>{r(o,a)},children:[(0,D.jsxs)(`div`,{className:Y.templateItemBody,children:[(0,D.jsx)(`span`,{className:Y.templateItemTitle,children:t.name}),(0,D.jsx)(`span`,{className:Y.templateItemSub,children:O1(a)})]}),(0,D.jsxs)(`span`,{className:Y.templateUseBtn,children:[(0,D.jsx)(Wn,{size:11}),`USE`]})]},t.id)})})]}),I1=({category:e})=>e===void 0?null:(0,D.jsx)(`div`,{className:Y.compChips,children:(0,D.jsxs)(`span`,{className:Y.compChip,children:[`🏷️ `,e.label]})}),L1=({sheet:e,location:t,onSheet:n,onToggleLocation:r,showPhoto:i=!0})=>(0,D.jsxs)(`div`,{className:Y.actionBar,children:[(0,D.jsx)(`span`,{className:Y.actionBarLabel,children:`Add to your post`}),(0,D.jsxs)(`div`,{className:Y.actionBarBtns,children:[i&&(0,D.jsx)(`button`,{type:`button`,title:`Photo/video`,className:T(Y.actionIcon,e===`photo`&&Y.actionIconActive),onClick:()=>{n(`photo`)},children:(0,D.jsx)(mr,{size:15})}),(0,D.jsx)(`button`,{type:`button`,title:`Tag people`,className:T(Y.actionIcon,e===`tag`&&Y.actionIconActive),onClick:()=>{n(`tag`)},children:(0,D.jsx)(ii,{size:15})}),(0,D.jsx)(`button`,{type:`button`,title:`Feeling/activity`,className:T(Y.actionIcon,e===`feeling`&&Y.actionIconActive),onClick:()=>{n(`feeling`)},children:(0,D.jsx)(Yr,{size:15})}),(0,D.jsx)(`button`,{type:`button`,title:`Location`,className:T(Y.actionIcon,t!==null&&Y.actionIconActive),onClick:r,children:(0,D.jsx)(yr,{size:15})}),(0,D.jsx)(`button`,{type:`button`,title:`Category`,className:T(Y.actionIcon,(e===`category`||e===`item`||e===`template`)&&Y.actionIconActive),onClick:()=>{n(`category`)},children:(0,D.jsx)(Qr,{size:15})})]})]}),R1=({currentCategory:e,categoryItems:t,categoryTemplates:n,searchQuery:r,onSearchQuery:i,isLoadingItems:a,onSetSheet:o,onSelectItem:s})=>(0,D.jsx)(P1,{category:e,items:t,templates:n.filter(t=>e.dataTemplateIds.includes(t.id)),searchQuery:r,onSearchQuery:i,isLoading:a,onBack:()=>{o(`category`)},onSelectItem:e=>{s(e),o(`template`)}}),z1=({currentCategory:e,categoryTemplates:t,selectedItem:n,onSetSheet:r,onApplyTemplate:i})=>n===null?null:(0,D.jsx)(F1,{selectedItem:n,templates:t.filter(t=>e?.templateIds.includes(t.id)),onBack:()=>{A1(e,r)},onUse:i}),B1=e=>{let{sheet:t,categoryId:n,feeling:r,taggedUserIds:i,selectedItem:a,categoryItems:o,categoryTemplates:s,currentCategory:c,onCategory:l,onFeeling:u,onToggleTag:d,onSelectItem:f,onApplyTemplate:p,onClose:m,onSetSheet:h,searchQuery:g,onSearchQuery:_,isLoadingItems:v}=e;switch(t){case`category`:return(0,D.jsx)(T1,{categoryId:n,onCategory:e=>{k1(e,l,h,m)}});case`feeling`:return(0,D.jsx)(E1,{feeling:r,onFeeling:u});case`tag`:return(0,D.jsx)(w1,{taggedUserIds:i,onToggleTag:d});case`item`:return c===void 0?null:(0,D.jsx)(R1,{currentCategory:c,categoryItems:o,categoryTemplates:s,searchQuery:g,onSearchQuery:_,isLoadingItems:v,onSetSheet:h,onSelectItem:f});case`template`:return(0,D.jsx)(z1,{currentCategory:c,categoryTemplates:s,selectedItem:a,onSetSheet:h,onApplyTemplate:p});case null:case`photo`:return null;default:return null}},V1=e=>{let{sheet:t,onClose:n}=e;if(t===null||t===`photo`)return null;let r=t!==`item`&&t!==`template`;return(0,D.jsxs)(`div`,{className:Y.sheet,children:[r&&(0,D.jsxs)(`div`,{className:Y.sheetHead,children:[(0,D.jsx)(`span`,{className:Y.sheetLabel,children:r1[t]}),(0,D.jsx)(`button`,{type:`button`,className:Y.sheetClose,"aria-label":`Close`,onClick:n,children:(0,D.jsx)(ci,{size:14})})]}),(0,D.jsx)(B1,{...e})]})},H1=e=>e.map(e=>({url:URL.createObjectURL(e),name:e.name,size:e.size,file:e})),U1=({onOpen:e})=>(0,D.jsxs)(`button`,{type:`button`,className:Y.dropzone,onClick:e,children:[(0,D.jsx)(`span`,{className:Y.dropIcon,children:(0,D.jsx)($n,{size:20})}),(0,D.jsx)(`span`,{className:Y.dropTitle,children:`Click to upload or drag & drop`}),(0,D.jsx)(`span`,{className:Y.dropHint,children:`Supported image formats: PNG, JPG, JPEG, GIF, WEBP, HEIC (Max 10MB)`})]}),W1=({photos:e,onOpen:t,onRemove:n})=>(0,D.jsxs)(`div`,{className:Y.photoGrid,children:[e.map(e=>(0,D.jsxs)(`div`,{className:Y.photoThumb,children:[(0,D.jsx)(`img`,{src:e.url,alt:e.name,className:Y.photoImg}),(0,D.jsx)(`button`,{type:`button`,className:Y.photoRemove,"aria-label":`Remove ${e.name}`,onClick:()=>{n(e.id)},children:(0,D.jsx)(ci,{size:12})})]},e.id)),(0,D.jsx)(`button`,{type:`button`,className:Y.photoAddMore,"aria-label":`Add more photos`,onClick:t,children:(0,D.jsx)(pr,{size:18})})]}),G1=(e,t)=>H1(e).map((e,n)=>({id:`${e.name}-${String(e.size)}-${String(t+n)}`,url:e.url,name:e.name,file:e.file})),K1=async e=>{if(e.files===null)return;let t=5-e.currentCount;if(t<=0){j.error(`You can only upload a maximum of 5 images.`);return}let n=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/heic`,`image/heif`],r=e=>{if(n.includes(e.type))return!0;let t=e.name.split(`.`).pop()?.toLowerCase();return t===`heic`||t===`heif`},i=10*1024*1024,a=Array.from(e.files);a.some(e=>!r(e))&&j.error(`Only PNG, JPG, JPEG, GIF, WEBP, and HEIC images are supported.`);let o=a.filter(r);o.filter(e=>e.size>i).length>0&&j.error(`Some images exceed the 10MB limit and were skipped.`);let s=o.filter(e=>e.size<=i).slice(0,t);if(s.length===0)return;o.length>t&&j.error(`Only the first ${String(t)} images were added. Maximum limit is 5.`);let c=G1(await Promise.all(s.map(e=>bZ(e))),e.existingPicked.length);if(c.length===0)return;let l=[...e.existingPicked,...c];e.onResult(l,l.map(e=>e.file))},q1=({photos:e,setPhotos:t})=>{let[r,i]=(0,n.useState)([]),[a,o]=(0,n.useState)(!1),s=(0,n.useRef)(null),c=(0,n.useRef)([]);c.current=r,(0,n.useEffect)(()=>()=>{for(let e of c.current)URL.revokeObjectURL(e.url)},[]);let l=n=>{K1({files:n,currentCount:e.length,existingPicked:r,onResult:(e,n)=>{i(e),t(n)}})};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`input`,{ref:s,type:`file`,accept:`image/*`,multiple:!0,className:Y.photoInput,onChange:e=>{l(e.target.files),s.current!==null&&(s.current.value=``)}}),(0,D.jsx)(`div`,{className:T(Y.photoZone,a&&Y.photoZoneDrag),onDragOver:e=>{e.preventDefault(),o(!0)},onDragLeave:()=>{o(!1)},onDrop:e=>{e.preventDefault(),o(!1),l(e.dataTransfer.files)},children:r.length===0?(0,D.jsx)(U1,{onOpen:()=>s.current?.click()}):(0,D.jsx)(W1,{photos:r,onOpen:()=>s.current?.click(),onRemove:e=>{i(n=>{let r=n.find(t=>t.id===e);r!==void 0&&URL.revokeObjectURL(r.url);let i=n.filter(t=>t.id!==e);return t(i.map(e=>e.file)),i})}})})]})},J1=({value:e,onChange:t,className:n})=>(0,D.jsx)(`input`,{className:T(Y.titleInput,n),placeholder:`Add a headline (optional)`,value:e,onChange:e=>{t(e.target.value)}}),Y1=({on:e,onToggle:t})=>(0,D.jsxs)(`div`,{className:Y.compOption,children:[(0,D.jsxs)(`span`,{className:Y.compOptionLabel,children:[(0,D.jsx)(Xn,{size:14}),` Must-read — require acknowledgement`]}),(0,D.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":`Require acknowledgement`,className:T(Y.switch,e&&Y.switchOn),onClick:t,children:(0,D.jsx)(`span`,{className:Y.switchKnob})})]}),X1=(e,t)=>{let{detectLocation:n}=WX();return()=>{if(e!==null){t(null);return}t(`Detecting location...`),n.execute().then(e=>{t(t=>t===`Detecting location...`?e.ok?e.value:`London Office`:t)})}},Z1=e=>{let{category:t,feeling:n,location:r,sheet:i,categoryId:a,audienceId:o,mustRead:s,taggedUserIds:c,selectedItem:l,categoryItems:u,categoryTemplates:d,setSheet:f,setLocation:p,setCategoryId:m,setFeeling:h,setAudienceId:g,setMustRead:_,onToggleTag:v,onSelectItem:y,onApplyTemplate:b,photos:x,setPhotos:S,isEditMode:C,editImagesNode:ee}=e,te=X1(r,p);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(I1,{category:t}),C?ee:(i===`photo`||x.length>0)&&(0,D.jsx)(q1,{photos:x,setPhotos:S}),(0,D.jsx)(L1,{sheet:i,location:r,onSheet:e=>{f(t=>t===e?null:e)},onToggleLocation:te,showPhoto:!C||ee===void 0||i===`photo`}),(0,D.jsx)(V1,{sheet:i,categoryId:a,feeling:n,taggedUserIds:c,selectedItem:l,categoryItems:u,categoryTemplates:d,currentCategory:t,onCategory:m,onFeeling:e=>{h(t=>t===e?null:e)},onToggleTag:v,onSelectItem:y,onApplyTemplate:b,onClose:()=>{f(null)},onSetSheet:f,searchQuery:e.searchQuery,onSearchQuery:e.onSearchQuery,isLoadingItems:e.isLoadingItems}),(0,D.jsx)(x1,{audienceId:o,onChange:g}),(0,D.jsx)(Y1,{on:s,onToggle:()=>{_(e=>!e)}})]})},Q1=({length:e,limit:t,color:n,fontSize:r,padding:i})=>(0,D.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,fontSize:r,color:n===`danger`?`var(--color-danger)`:`var(--color-text-soft)`,padding:i,fontWeight:500},children:[e,` / `,t]}),$1=e=>{let{title:t,setTitle:n,body:r,setBody:i,bodyPlaceholder:a,isEditMode:o=!1,editImagesNode:s}=e,c=pi(t,300,250),l=pi(r,8e3,7e3);return(0,D.jsxs)(D.Fragment,{children:[o?(0,D.jsx)(`input`,{type:`text`,className:T(Y.titleInput,c.isOverLimit&&Y.textareaError),value:t,placeholder:`Add a headline (optional)...`,onChange:e=>{n(e.target.value)},style:{width:`100%`}}):(0,D.jsx)(J1,{value:t,onChange:n,className:c.isOverLimit?Y.textareaError:void 0}),c.showCounter&&(0,D.jsx)(Q1,{length:c.length,limit:300,color:c.counterColor,fontSize:`11px`,padding:`2px 16px 4px`}),(0,D.jsx)(`textarea`,{className:T(Y.textarea,l.isOverLimit&&Y.textareaError),placeholder:a,value:r,onChange:e=>{i(e.target.value)},style:o?{width:`100%`,minHeight:`100px`}:void 0}),l.showCounter&&(0,D.jsx)(Q1,{length:l.length,limit:8e3,color:l.counterColor,fontSize:`12px`,padding:`2px 16px 6px`}),(0,D.jsx)(Z1,{...e,isEditMode:o,...s===void 0?{}:{editImagesNode:s}})]})},e0=({authorInfo:e,audienceId:t,taggedUsers:n,feeling:r,location:i,onAudience:a,onClose:o})=>{let{data:s=[]}=aZ(),c=s.find(e=>e.id===r);return(0,D.jsxs)(`div`,{className:Y.compHead,style:o?void 0:{borderBottom:`none`,padding:`0 0 10px`},children:[(0,D.jsxs)(`div`,{className:Y.compAvatarWrapper,children:[(0,D.jsx)(`span`,{className:Y.compAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),o&&(0,D.jsx)(`span`,{className:Y.statusDot})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:Y.compHeaderTagline,children:[(0,D.jsx)(`strong`,{children:e.name}),c&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:Y.compMutedText,children:` is feeling `}),(0,D.jsxs)(`strong`,{children:[c.emoji,` `,c.label]})]}),i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:Y.compMutedText,children:r||n.length>0?n.length>0?` at `:` — at `:` is at `}),(0,D.jsx)(`strong`,{children:i===`Detecting location...`?`Detecting...`:i})]})]}),n.length>0&&(0,D.jsx)(`div`,{className:Y.taggedTagline,children:lZ(n).map((e,t)=>{let n=!o&&t===0&&e.text.startsWith(`with `)&&!r?`is ${e.text}`:e.text;return e.bold?(0,D.jsx)(`strong`,{children:n},t):n})}),(0,D.jsx)(b1,{audienceId:t,onChange:a})]}),o&&(0,D.jsx)(`button`,{type:`button`,className:Y.compClose,"aria-label":`Close`,onClick:o,children:(0,D.jsx)(ci,{size:16})})]})},t0=e=>e.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `),n0=e=>t0((e.split(`@`)[0]??e).replace(/[._-]+/g,` `)),r0=(e,t)=>{let n=e.length>0?e:t;return n.includes(`@`)?n0(n):n},i0=(e,t,n)=>{let r=e.length>0?e:t;return r.length===0||r.includes(`@`)?r0(t,n):r},a0=(e,t,n)=>e!==void 0&&e.trim().length>0?e:t?di(n):`?`,o0=(e,t,n)=>e!==void 0&&e.trim().length>0?e:t?fi(n):`#6b7280`,s0=(e,t)=>{if(!t)return{name:``,initials:`?`,color:`#6b7280`};let n=i0(e?e.name:``,t.fullName,t.email.value);return{name:n,initials:a0(e?e.initials:void 0,!0,n),color:o0(e?e.color:void 0,!0,t.id)}};function c0({profile:e,onClose:t}){let{data:r=[]}=rZ(),i=m1(t,r),a=i.category,[o,s]=(0,n.useState)(``),{rawItems:c,isLoadingItems:l,hasWebhook:u}=_1(a,o),{data:d=[]}=mR(),f=g1(a,d),p=c.map(h1);return(0,D.jsxs)(`div`,{className:Y.composer,children:[(0,D.jsx)(e0,{authorInfo:e,audienceId:i.audienceId,taggedUsers:i.taggedUsers,feeling:i.feeling,location:i.location,onAudience:i.setAudienceId,onClose:t}),(0,D.jsx)($1,{title:i.title,setTitle:i.setTitle,body:i.body,setBody:i.setBody,bodyPlaceholder:`What's on your mind, ${e.name.split(` `)[0]??``}?`,category:i.category,feeling:i.feeling,location:i.location,sheet:i.sheet,categoryId:i.categoryId,audienceId:i.audienceId,mustRead:i.mustRead,taggedUserIds:i.taggedUsers.map(e=>e.id),selectedItem:i.selectedItem,categoryItems:p,categoryTemplates:f,setSheet:i.setSheet,setLocation:i.setLocation,setCategoryId:e=>{s(``),i.setCategoryId(e.id)},setFeeling:i.setFeeling,setAudienceId:i.setAudienceId,setMustRead:i.setMustRead,onToggleTag:i.toggleTag,onSelectItem:i.setSelectedItem,onApplyTemplate:i.applyTemplate,photos:i.photos,setPhotos:i.setPhotos,isEditMode:!1,searchQuery:o,onSearchQuery:u?s:void 0,isLoadingItems:l}),i.mode===`schedule`&&(0,D.jsx)(c1,{value:i.schedule,onChange:i.setSchedule,timezone:i.timezone}),(0,D.jsx)(l1,{mode:i.mode,disabled:i.submitDisabled,onMode:i.setMode,onCancel:t,onSubmit:()=>{i.submit()}})]})}var l0=()=>{let[e,t]=(0,n.useState)(!1),{user:r}=_B(),i=uF(),a=s0(i.data,r),o=i.isPending;if(!e){let e=o?``:a.name.split(` `)[0]??``,n=e.length>0?`What's on your mind, ${e}?`:`What's on your mind?`;return(0,D.jsxs)(`div`,{className:Y.composerCollapsed,children:[o?(0,D.jsx)(ZE,{variant:`circle`,width:`36px`,height:`36px`}):(0,D.jsx)(`span`,{className:Y.ccAvatar,style:E({"--avatar-color":a.color}),children:a.initials}),(0,D.jsx)(`button`,{type:`button`,className:Y.ccInput,onClick:()=>{t(!0)},children:n})]})}return(0,D.jsx)(c0,{profile:a,onClose:()=>{t(!1)}})},u0=()=>(0,D.jsxs)(`div`,{className:Y.emptyState,children:[(0,D.jsx)(`div`,{className:Y.emptyIconWrap,children:(0,D.jsx)(hr,{size:32})}),(0,D.jsx)(`h3`,{className:Y.emptyTitle,children:`It's quiet in here`}),(0,D.jsx)(`p`,{className:Y.emptyText,children:`There are no posts in this feed yet. Be the first to share an update!`})]}),d0=({post:e,taggedUsers:t})=>(0,D.jsxs)(`div`,{className:Y.compHeaderTagline,style:{display:`block`,fontSize:`14px`,lineHeight:`1.4`},children:[(0,D.jsx)(`span`,{className:Y.authorName,style:{fontWeight:600,color:`var(--color-text-main)`},children:e.authorName}),e.feelingEmoji&&e.feelingLabel&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{style:{color:`var(--color-text-soft)`},children:` is feeling `}),(0,D.jsxs)(`span`,{style:{fontWeight:600,color:`var(--color-text-main)`},children:[e.feelingEmoji,` `,e.feelingLabel]})]}),t.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{children:` `}),lZ(t).map((t,n)=>{let r=n===0&&t.text.startsWith(`with `)&&!e.feelingId?`is ${t.text}`:t.text;return(0,D.jsx)(`span`,{style:{fontWeight:t.bold?600:`normal`,color:t.bold?`var(--color-text-main)`:`var(--color-text-soft)`},children:r},n)})]}),e.locationLabel&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{style:{color:`var(--color-text-soft)`},children:e.feelingId||t.length>0?t.length>0?` at `:` — at `:` is at `}),(0,D.jsx)(`span`,{style:{fontWeight:600,color:`var(--color-text-main)`},children:e.locationLabel})]})]}),f0=({post:e,taggedUsers:t})=>{let n=JN().display;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:Y.avatar,style:E({"--avatar-color":e.authorColor}),children:e.authorInitials}),(0,D.jsxs)(`div`,{className:Y.cardAuthor,children:[(0,D.jsx)(d0,{post:e,taggedUsers:t}),(0,D.jsxs)(`div`,{className:Y.metaRow,style:{marginTop:`4px`,display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`12px`,color:`var(--color-text-soft)`},children:[e.authorRole&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{children:e.authorRole}),(0,D.jsx)(`span`,{style:{color:`var(--color-text-muted)`},children:`·`})]}),(0,D.jsx)(`span`,{children:vZ(e.createdAt,n,e.scheduledAt)}),(0,D.jsx)(`span`,{style:{color:`var(--color-text-muted)`},children:`·`}),(0,D.jsx)(`span`,{children:e.audienceLabel}),(0,D.jsx)(`span`,{style:{color:`var(--color-text-muted)`},children:`·`}),(0,D.jsxs)(`span`,{children:[e.seenCount,` `,e.seenCount===1?`view`:`views`]})]})]})]})},p0=e=>{let t=GQ({page:1,pageSize:1e3,filter:``,department:``,accessRole:``,branch:``,status:`all`}).data;return t?t.users.filter(t=>e.includes(t.id)):[]},m0=({post:e,onBookmark:t,onPin:n,showPinButton:r,onEdit:i,showEditButton:a})=>{let o=p0(e.taggedUserIds),{categoryLabel:s,categoryColor:c}=cZ(e);return(0,D.jsxs)(`header`,{className:Y.cardHead,children:[(0,D.jsx)(f0,{post:e,taggedUsers:o}),(0,D.jsxs)(`div`,{className:Y.cardRight,children:[(0,D.jsxs)(`span`,{className:Y.badge,style:E({"--badge-color":c}),children:[(0,D.jsx)(`span`,{className:Y.badgeDot}),s]}),(0,D.jsxs)(`div`,{className:Y.cardActions,children:[(0,D.jsx)(`button`,{type:`button`,className:T(Y.bookmarkBtn,e.bookmarked&&Y.bookmarkActive),"aria-label":e.bookmarked?`Remove bookmark`:`Save post`,onClick:t,children:(0,D.jsx)(In,{size:15,fill:e.bookmarked?`currentColor`:`none`})}),r&&n&&(0,D.jsx)(`button`,{type:`button`,className:T(Y.pinBtn,e.pinned&&Y.pinActive),"aria-label":e.pinned?`Unpin post`:`Pin post`,onClick:n,children:(0,D.jsx)(Nr,{size:15,fill:e.pinned?`currentColor`:`none`})}),a&&i&&(0,D.jsx)(`button`,{type:`button`,className:Y.editBtn,"aria-label":`Edit post`,onClick:i,children:(0,D.jsx)(kr,{size:15})})]})]})]})},h0=({url:e,onRemove:t})=>(0,D.jsxs)(`div`,{className:Y.photoThumb,children:[(0,D.jsx)(`img`,{src:e,alt:`thumbnail`,className:Y.photoImg}),(0,D.jsx)(`button`,{type:`button`,onClick:t,className:Y.photoRemove,children:(0,D.jsx)(ci,{size:12})})]}),g0=({file:e,onRemove:t})=>{let[r,i]=(0,n.useState)(``);return(0,n.useEffect)(()=>{let t=URL.createObjectURL(e);return i(t),()=>{URL.revokeObjectURL(t)}},[e]),r?(0,D.jsx)(h0,{url:r,onRemove:t}):null},_0=({existingImages:e,newPhotos:t,onAddPhotos:r,onRemoveExisting:i,onRemoveNew:a})=>{let o=(0,n.useRef)(null);return e.length===0&&t.length===0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`input`,{ref:o,type:`file`,multiple:!0,accept:`image/*`,onChange:e=>{e.target.files!==null&&e.target.files.length>0&&r(e.target.files)},style:{display:`none`}}),(0,D.jsx)(U1,{onOpen:()=>o.current?.click()})]}):(0,D.jsxs)(`div`,{className:Y.photoGrid,children:[e.map(e=>(0,D.jsx)(h0,{url:e,onRemove:()=>{i(e)}},e)),t.map((e,t)=>(0,D.jsx)(g0,{file:e,onRemove:()=>{a(t)}},t)),(0,D.jsxs)(`label`,{className:Y.photoAddMore,children:[(0,D.jsx)(pr,{size:18}),(0,D.jsx)(`input`,{type:`file`,multiple:!0,accept:`image/*`,onChange:e=>{e.target.files!==null&&e.target.files.length>0&&r(e.target.files)},style:{display:`none`}})]})]})},v0=e=>({id:e.id,name:e.fullName,email:e.email,userName:e.fullName,role:e.roleName,initials:e.initials,color:e.color}),y0=e=>{let[t,r]=(0,n.useState)(e),[i,a]=(0,n.useState)([]);return{existingImages:t,setExistingImages:r,newPhotos:i,setNewPhotos:a,handleAddPhotos:async e=>{let n=5-(t.length+i.length);if(n<=0){j.error(`You can only have a maximum of 5 images.`);return}let r=Array.from(e).filter(e=>e.type.startsWith(`image/`)||e.name.toLowerCase().endsWith(`.heic`)||e.name.toLowerCase().endsWith(`.heif`)),o=10*1024*1024;r.filter(e=>e.size>o).length>0&&j.error(`Some images exceed the 10MB limit and were skipped.`);let s=r.filter(e=>e.size<=o),c=s.slice(0,n);s.length>n&&j.error(`Only the first ${String(n)} images were added. Maximum limit is 5.`);let l=await Promise.all(c.map(e=>bZ(e)));a(e=>[...e,...l])},handleRemoveExisting:e=>{r(t=>t.filter(t=>t!==e))},handleRemoveNew:e=>{a(t=>t.filter((t,n)=>n!==e))}}},b0=(e,t)=>{if(e.scheduledAt){let n=VN(new Date(e.scheduledAt),t);return{date:`${String(n.year)}-${String(n.month).padStart(2,`0`)}-${String(n.day).padStart(2,`0`)}`,time:`${String(n.hour).padStart(2,`0`)}:${String(n.minute).padStart(2,`0`)}`,recurring:e.isRecurring,frequency:e.recurrenceFrequency??`weekly`}}return e1},x0=(e,t,r,i)=>{let[a,o]=(0,n.useState)(e.department??`general`),[s,c]=(0,n.useState)(e.audienceId),[l,u]=(0,n.useState)(e.feelingId),[d,f]=(0,n.useState)(e.locationLabel),[p,m]=(0,n.useState)(e.mustAcknowledge),[h,g]=(0,n.useState)(null),[_,v]=(0,n.useState)(null),y=!e.scheduledAt||new Date(e.scheduledAt).getTime()<=Date.now(),[b,x]=(0,n.useState)(y?`now`:`schedule`),[S,C]=(0,n.useState)(()=>b0(e,i)),ee=e=>{let t=typeof e==`function`?e(b):e;if(x(t),t===`schedule`&&!S.date){let e=VN(new Date,i),t=`${String(e.year)}-${String(e.month).padStart(2,`0`)}-${String(e.day).padStart(2,`0`)}`,n=`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}`;C({...S,date:t,time:n})}},[te,ne]=(0,n.useState)(t.filter(t=>e.taggedUserIds.includes(t.id)).map(v0));return{categoryId:a,setCategoryId:o,audienceId:s,setAudienceId:c,feeling:l,setFeeling:u,location:d,setLocation:f,mustRead:p,setMustRead:m,taggedUsers:te,setTaggedUsers:ne,sheet:h,setSheet:g,selectedItem:_,setSelectedItem:v,mode:b,setMode:ee,schedule:S,setSchedule:C,toggleTag:e=>{ne(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])},handleToggleLocation:()=>{if(d!==null){f(null);return}f(`Detecting location...`),r.execute().then(e=>{f(t=>t===`Detecting location...`?e.ok?e.value:`London Office`:t)})},isAlreadyPublished:y}},S0=e=>{let t=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,n=e.indexOf(`#`);if(n!==-1){let r=e.substring(n+1);if(t.test(r))return r}let r=(e.split(`?`)[0]??e).split(`/`).pop()??``;return t.test(r)?r:null},C0=e=>e.map(e=>S0(e)).filter(e=>e!==null),w0=async(e,t)=>{if(e.length===0)return[];let n=await Promise.allSettled(e.map(e=>t(e))),r=[],i=0;for(let e of n)e.status===`fulfilled`?r.push(e.value):i+=1;return i>0&&j.error(`${String(i)} image${i>1?`s`:``} failed to upload.`),r},T0=async({post:e,editTitle:t,editBody:n,photosState:r,composerState:i,updatePostMutation:a,uploadImageMutation:o,setIsEditing:s,timezone:c})=>{if(t.trim().length>300){j.error(`Post title cannot exceed 300 characters.`);return}if(n.trim().length>8e3){j.error(`Post body cannot exceed 8000 characters.`);return}let l;if(i.mode===`schedule`&&(l=WN(i.schedule.date,i.schedule.time,c),l&&Date.parse(l)<Date.now())){j.error(`Schedule time must be in the future.`);return}try{let c=await w0(r.newPhotos,e=>o.mutateAsync(e)),u=C0(r.existingImages);a.mutate({postId:e.id,input:{title:t.trim()||null,body:n,imageIds:[...u,...c],categoryId:i.categoryId,audienceId:i.audienceId,mustAcknowledge:i.mustRead,taggedUserIds:i.taggedUsers.map(e=>e.id),feelingId:i.feeling,locationLabel:i.location,scheduledAt:l,isRecurring:i.mode===`schedule`?i.schedule.recurring:!1,recurrenceFrequency:i.mode===`schedule`&&i.schedule.recurring?i.schedule.frequency:void 0}},{onSuccess:()=>{s(!1),r.setNewPhotos([])},onError:()=>{j.error(`Failed to update the post. Please try again.`)}})}catch{j.error(`Failed to process post images. Please try again.`)}},E0=({post:e,setTitle:t,setBody:n,photos:r,composer:i,allUsers:a,timezone:o})=>{if(t(e.title??``),n(e.body),r.setExistingImages(e.imageUrls),r.setNewPhotos([]),i.setCategoryId(e.department??`general`),i.setAudienceId(e.audienceId),i.setFeeling(e.feelingId),i.setLocation(e.locationLabel),i.setMustRead(e.mustAcknowledge),i.setSheet(null),i.setSelectedItem(null),i.setMode(i.isAlreadyPublished?`now`:`schedule`),e.scheduledAt){let t=VN(new Date(e.scheduledAt),o),n=`${String(t.year)}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`,r=`${String(t.hour).padStart(2,`0`)}:${String(t.minute).padStart(2,`0`)}`;i.setSchedule({date:n,time:r,recurring:e.isRecurring,frequency:e.recurrenceFrequency??`weekly`})}else i.setSchedule(e1);i.setTaggedUsers(a.filter(t=>e.taggedUserIds.includes(t.id)).map(v0))},D0=()=>{let[e,t]=(0,n.useState)(!1),[r,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(null),[s,c]=(0,n.useState)(!1);return{commentsOpen:e,setCommentsOpen:t,shareOpen:r,setShareOpen:i,lightboxIndex:a,setLightboxIndex:o,isEditing:s,setIsEditing:c}},O0={page:1,pageSize:1e3,filter:``,department:``,accessRole:``,branch:``,status:`all`},k0=e=>({...e.ui,editTitle:e.editTitle,setEditTitle:e.setEditTitle,editBody:e.editBody,setEditBody:e.setEditBody,existingImages:e.photosState.existingImages,newPhotos:e.photosState.newPhotos,isPending:e.isPending,timezone:e.timezone,handleAddPhotos:t=>{e.photosState.handleAddPhotos(t)},handleRemoveExisting:e.photosState.handleRemoveExisting,handleRemoveNew:e.photosState.handleRemoveNew,handleSave:()=>{T0({post:e.post,editTitle:e.editTitle,editBody:e.editBody,photosState:e.photosState,composerState:e.composerState,updatePostMutation:e.updatePostMutation,uploadImageMutation:e.uploadImageMutation,setIsEditing:e.ui.setIsEditing,timezone:e.timezone})},handleCancel:()=>{E0({post:e.post,setTitle:e.setEditTitle,setBody:e.setEditBody,photos:e.photosState,composer:e.composerState,allUsers:e.allUsers,timezone:e.timezone}),e.ui.setIsEditing(!1)},categoryId:e.composerState.categoryId,setCategoryId:e.composerState.setCategoryId,audienceId:e.composerState.audienceId,setAudienceId:e.composerState.setAudienceId,feeling:e.composerState.feeling,setFeeling:e.composerState.setFeeling,location:e.composerState.location,setLocation:e.composerState.setLocation,mustRead:e.composerState.mustRead,setMustRead:e.composerState.setMustRead,taggedUsers:e.composerState.taggedUsers,sheet:e.composerState.sheet,setSheet:e.composerState.setSheet,selectedItem:e.composerState.selectedItem,setSelectedItem:e.composerState.setSelectedItem,mode:e.composerState.mode,setMode:e.composerState.setMode,schedule:e.composerState.schedule,setSchedule:e.composerState.setSchedule,isAlreadyPublished:e.composerState.isAlreadyPublished,toggleTag:e.composerState.toggleTag,handleToggleLocation:e.composerState.handleToggleLocation}),A0=e=>{let t=D0(),[r,i]=(0,n.useState)(e.title??``),[a,o]=(0,n.useState)(e.body),s=JN().display,c=GQ(O0).data?.users??[],{detectLocation:l}=WX(),u=y0(e.imageUrls),d=x0(e,c,l,s),f=XX(),p=sZ();return(0,n.useEffect)(()=>{t.isEditing||E0({post:e,setTitle:i,setBody:o,photos:u,composer:d,allUsers:c,timezone:s})},[t.isEditing,e,c,s]),k0({ui:t,editTitle:r,setEditTitle:i,editBody:a,setEditBody:o,timezone:s,photosState:u,composerState:d,isPending:f.isPending||p.isPending,post:e,allUsers:c,updatePostMutation:f,uploadImageMutation:p})},j0=()=>{},M0=e=>{if(!(e.existingImages.length===0&&e.newPhotos.length===0&&e.sheet!==`photo`))return(0,D.jsx)(_0,{existingImages:e.existingImages,newPhotos:e.newPhotos,onAddPhotos:t=>{e.handleAddPhotos(t)},onRemoveExisting:e.handleRemoveExisting,onRemoveNew:e.handleRemoveNew})},N0=e=>{let{data:t=[]}=rZ(),r=t.find(t=>t.id===e),[i,a]=(0,n.useState)(``),{rawItems:o,isLoadingItems:s,hasWebhook:c}=_1(r,i),{data:l=[]}=mR();return{category:r,searchQuery:i,setSearchQuery:a,isLoadingItems:s,hasWebhook:c,categoryTemplates:g1(r,l),categoryItems:o.map(h1)}},P0=e=>{let t=N0(e.categoryId),n=n=>{t.setSearchQuery(``),e.setCategoryId(n.id)},r=(t,n)=>{e.setEditTitle(t),e.setEditBody(n),e.setSheet(null),e.setSelectedItem(null)};return{...t,handleSetCategory:n,handleApplyTemplate:r}},F0=({post:e,state:t})=>{let n=P0(t);return(0,D.jsxs)(`div`,{style:{padding:`20px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,D.jsx)(e0,{authorInfo:{name:e.authorName,initials:e.authorInitials,color:e.authorColor},audienceId:t.audienceId,taggedUsers:t.taggedUsers,feeling:t.feeling,location:t.location,onAudience:t.setAudienceId}),(0,D.jsx)($1,{title:t.editTitle,setTitle:t.setEditTitle,body:t.editBody,setBody:t.setEditBody,bodyPlaceholder:`What's on your mind?`,category:n.category,feeling:t.feeling,location:t.location,sheet:t.sheet,categoryId:t.categoryId,audienceId:t.audienceId,mustRead:t.mustRead,taggedUserIds:t.taggedUsers.map(e=>e.id),setSheet:t.setSheet,setLocation:t.setLocation,setCategoryId:n.handleSetCategory,selectedItem:t.selectedItem,categoryItems:n.categoryItems,categoryTemplates:n.categoryTemplates,onSelectItem:t.setSelectedItem,onApplyTemplate:n.handleApplyTemplate,setFeeling:t.setFeeling,setAudienceId:t.setAudienceId,setMustRead:t.setMustRead,onToggleTag:t.toggleTag,photos:[],setPhotos:j0,isEditMode:!0,searchQuery:n.searchQuery,onSearchQuery:n.hasWebhook?n.setSearchQuery:void 0,isLoadingItems:n.isLoadingItems,editImagesNode:M0(t)}),t.mode===`schedule`&&(0,D.jsx)(c1,{value:t.schedule,timezone:t.timezone,onChange:t.setSchedule}),(0,D.jsx)(l1,{mode:t.mode,hideToggle:t.isAlreadyPublished,disabled:t.isPending||!t.editBody.trim(),submitLabels:{schedule:t.isPending?`Saving...`:`Save schedule`,now:t.isPending?`Saving...`:`Save`},onMode:t.setMode,onCancel:t.handleCancel,onSubmit:t.handleSave})]})},I0=({comment:e,displayZone:t})=>(0,D.jsxs)(`div`,{className:Y.commentRow,children:[(0,D.jsx)(`span`,{className:Y.commentAvatar,style:E({"--avatar-color":e.authorColor}),children:e.authorInitials}),(0,D.jsxs)(`div`,{className:Y.commentBubble,children:[(0,D.jsxs)(`div`,{className:Y.commentAuthor,children:[e.authorName,` `,(0,D.jsxs)(`span`,{className:Y.commentTime,children:[`· `,vZ(e.createdAt,t)]})]}),(0,D.jsx)(`div`,{className:Y.commentText,children:e.text})]})]}),L0=({profile:e,isViewerLoading:t,pending:r,onAdd:i})=>{let[a,o]=(0,n.useState)(``),s=pi(a,4e3),c=()=>{a.trim()!==``&&(i(a.trim()),o(``))};return(0,D.jsxs)(`div`,{className:Y.commentRow,children:[t?(0,D.jsx)(ZE,{variant:`circle`,width:`26px`,height:`26px`}):(0,D.jsx)(`span`,{className:Y.commentAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:`4px`},children:[(0,D.jsxs)(`div`,{className:T(Y.commentComposer,s.isOverLimit&&Y.commentComposerError),children:[(0,D.jsx)(`input`,{className:Y.commentInput,placeholder:`Write a comment…`,value:a,onChange:e=>{o(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&!s.isOverLimit&&c()}}),(0,D.jsx)(`button`,{type:`button`,className:Y.commentSend,disabled:a.trim()===``||r||s.isOverLimit,onClick:c,children:(0,D.jsx)(Ur,{size:13})})]}),s.showCounter&&(0,D.jsxs)(`div`,{style:{alignSelf:`flex-end`,fontSize:`10px`,color:s.counterColor===`danger`?`var(--color-danger)`:`var(--color-text-soft)`,marginRight:`8px`,fontWeight:500},children:[s.length,` / 4000`]})]})]})},R0=({comments:e,pending:t,onAdd:n})=>{let{user:r}=_B(),i=uF(),a=JN().display,o=s0(i.data,r);return(0,D.jsxs)(`div`,{className:Y.comments,children:[e.map(e=>(0,D.jsx)(I0,{comment:e,displayZone:a},e.id)),(0,D.jsx)(L0,{profile:o,isViewerLoading:i.isPending,pending:t,onAdd:n})]})},z0=({url:e,alt:t,className:n})=>(0,D.jsx)(`img`,{src:e,alt:t,className:n,loading:`lazy`}),B0=({urls:e,onImageClick:t})=>{let n=e.length;if(n===0)return null;let r=Y.grid1;n===2&&(r=Y.grid2),n===3&&(r=Y.grid3),n>=4&&(r=Y.grid4);let i=n>4?e.slice(0,4):e;return(0,D.jsx)(`div`,{className:T(Y.postImagesGrid,r),children:i.map((e,r)=>{let i=r===3&&n>4;return(0,D.jsx)(`div`,{className:T(Y.gridImageWrap,i&&Y.moreImagesOverlay),"data-more":i?`+${String(n-4)}`:void 0,onClick:()=>{t(r)},role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&t(r)},children:(0,D.jsx)(z0,{url:e,alt:`Attached`,className:Y.gridImage})},r)})})},V0=({onClose:e})=>(0,D.jsxs)(`div`,{className:Y.shareHead,children:[(0,D.jsx)(`div`,{className:Y.shareHeadIcon,children:(0,D.jsx)(Rr,{size:15})}),(0,D.jsxs)(`div`,{className:Y.shareHeadText,children:[(0,D.jsx)(`h3`,{className:Y.shareTitle,children:`Share Post`}),(0,D.jsx)(`p`,{className:Y.shareDesc,children:`Share this post to chat conversations`})]}),(0,D.jsx)(`button`,{type:`button`,className:Y.shareCloseBtn,"aria-label":`Close`,onClick:e,children:(0,D.jsx)(ci,{size:18})})]}),H0=({count:e,disabled:t,onCancel:n,onSend:r})=>(0,D.jsxs)(`div`,{className:Y.shareFooter,children:[(0,D.jsx)(`span`,{className:Y.shareFootText,children:e===0?`Select at least one chat`:`${String(e)} ${e===1?`chat`:`chats`} selected`}),(0,D.jsxs)(`div`,{className:Y.shareFootBtns,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.shareCancelBtn,onClick:n,children:`Cancel`}),(0,D.jsxs)(`button`,{type:`button`,className:Y.shareSendBtn,disabled:e===0||t,onClick:r,children:[(0,D.jsx)(Ur,{size:12}),` Send`]})]})]}),U0=({post:e})=>(0,D.jsx)(`div`,{className:Y.sharePreviewWrap,children:(0,D.jsxs)(`div`,{className:Y.sharePreview,children:[(0,D.jsx)(`span`,{className:Y.sharePreviewAvatar,style:E({"--avatar-color":e.authorColor}),children:e.authorInitials}),(0,D.jsxs)(`div`,{className:Y.sharePreviewBody,children:[(0,D.jsxs)(`div`,{className:Y.sharePreviewMeta,children:[e.authorName,` ·`,` `,(0,D.jsx)(`span`,{className:Y.sharePreviewCat,style:E({"--cat":e.categoryColor}),children:e.categoryLabel})]}),e.authorRole?(0,D.jsx)(`div`,{style:{fontSize:`11px`,color:`var(--color-text-soft)`,marginTop:`1px`,marginBottom:`2px`},children:e.authorRole}):null,(0,D.jsx)(`div`,{className:Y.sharePreviewTitle,children:e.title})]})]})}),W0=({target:e,selected:t,onToggle:n})=>(0,D.jsxs)(`button`,{type:`button`,className:T(Y.shareRow,t&&Y.shareRowOn),"aria-pressed":t,onClick:()=>{n(e.id)},children:[(0,D.jsx)(`span`,{className:T(Y.shareAvatar,e.square&&Y.shareAvatarSquare),style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:Y.shareRowBody,children:[(0,D.jsx)(`span`,{className:Y.shareRowName,children:e.name}),(0,D.jsx)(`span`,{className:Y.shareRowSub,children:e.subtitle})]}),(0,D.jsx)(`span`,{className:T(Y.shareCheck,t&&Y.shareCheckOn),children:t&&(0,D.jsx)(Wn,{size:11,strokeWidth:3})})]}),G0=({label:e,targets:t,selected:n,onToggle:r})=>t.length===0?null:(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:Y.shareSectionLabel,children:e}),t.map(e=>(0,D.jsx)(W0,{target:e,selected:n.has(e.id),onToggle:r},e.id))]}),K0=(e,t,n)=>e===``||t.toLowerCase().includes(e)||n.toLowerCase().includes(e),q0=({comment:e,query:t,onComment:n,onQuery:r})=>{let i=pi(e,1e3);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:Y.shareField,style:{display:`flex`,flexDirection:`column`,gap:`4px`},children:[(0,D.jsx)(`input`,{className:T(Y.shareComment,i.isOverLimit&&Y.shareCommentError),placeholder:`Add a comment (optional)`,value:e,onChange:e=>{n(e.target.value)}}),i.showCounter&&(0,D.jsxs)(`div`,{style:{alignSelf:`flex-end`,fontSize:`10px`,color:i.counterColor===`danger`?`var(--color-danger)`:`var(--color-text-soft)`,marginRight:`8px`,fontWeight:500},children:[i.length,` / 1000`]})]}),(0,D.jsx)(`div`,{className:Y.shareSearchWrap,children:(0,D.jsxs)(`div`,{className:Y.shareSearch,children:[(0,D.jsx)(Hr,{size:13}),(0,D.jsx)(`input`,{className:Y.shareSearchInput,placeholder:`Search people or groups…`,value:t,onChange:e=>{r(e.target.value)}})]})})]})},J0=e=>({id:e.id,name:e.title,subtitle:e.subtitle||(e.kind===`group`?`${String(e.memberCount)} members`:``),initials:e.initials,color:e.color,square:e.kind===`group`}),Y0=({groups:e,dms:t,selected:n,onToggle:r})=>(0,D.jsxs)(`div`,{className:Y.shareList,children:[(0,D.jsx)(G0,{label:`Groups`,targets:e,selected:n,onToggle:r}),(0,D.jsx)(G0,{label:`Direct messages`,targets:t,selected:n,onToggle:r}),e.length===0&&t.length===0&&(0,D.jsx)(`div`,{className:Y.shareEmpty,children:`No matches.`})]}),X0=({post:e,comment:t,selected:n,sendMessage:r,setIsSending:i,close:a,count:o})=>{i(!0);let s=`${window.location.origin}/feed/posts/${e.postId}`,c={comment:t.trim(),card:{title:e.title,body:e.bodySnippet,authorName:e.authorName,authorInitials:e.authorInitials,authorColor:e.authorColor,categoryLabel:e.categoryLabel,categoryColor:e.categoryColor,link:s}},l=`__UAPP_SHARED_CARD__::${JSON.stringify(c)}`,u=Array.from(n).map(e=>r.execute(e,l,crypto.randomUUID()));Promise.allSettled(u).then(()=>{j.success(`Shared to ${String(o)} ${o===1?`chat`:`chats`}`),a()}).catch(()=>{j.error(`Failed to share post`),i(!1)})},Z0=(e,t,r)=>{let[i,a]=(0,n.useState)(``),[o,s]=(0,n.useState)(``),[c,l]=(0,n.useState)(()=>new Set),[u,d]=(0,n.useState)(!1),{sendMessage:f}=LP(),{data:p=[]}=HP(`all`,``,{enabled:r}),m=o.trim().toLowerCase(),h=p.filter(e=>e.kind===`dm`).map(J0).filter(e=>K0(m,e.name,e.subtitle)),g=p.filter(e=>e.kind===`group`).map(J0).filter(e=>K0(m,e.name,e.subtitle)),_=c.size,v=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},y=()=>{a(``),s(``),l(new Set),d(!1),t()};return{comment:i,setComment:a,query:o,setQuery:s,selected:c,isSending:u,dms:h,groups:g,count:_,toggle:v,close:y,send:()=>{_===0||u||i.length>1e3||X0({post:e,comment:i,selected:c,sendMessage:f,setIsSending:d,close:y,count:_})}}},Q0=({open:e,post:t,onClose:n})=>{let r=Z0(t,n,e),a=Bs();return e?(0,i.createPortal)((0,D.jsxs)(`div`,{className:Y.shareRoot,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.shareBackdrop,"aria-label":`Close`,onClick:r.close}),(0,D.jsxs)(`div`,{className:Y.shareModal,role:`dialog`,"aria-label":`Share post`,children:[(0,D.jsx)(V0,{onClose:r.close}),(0,D.jsx)(U0,{post:t}),(0,D.jsx)(q0,{comment:r.comment,query:r.query,onComment:r.setComment,onQuery:r.setQuery}),(0,D.jsx)(Y0,{groups:r.groups,dms:r.dms,selected:r.selected,onToggle:r.toggle}),(0,D.jsx)(H0,{count:r.count,disabled:r.comment.length>1e3,onCancel:r.close,onSend:r.send})]})]}),a??document.body):null},$0=[{id:`like`,label:`Like`,Icon:ti,color:`#2563eb`},{id:`insightful`,label:`Insightful`,Icon:_r,color:`#f59e0b`},{id:`celebrate`,label:`Celebrate`,Icon:Dr,color:`#ec4899`}],e2=({post:e,onCommentClick:t})=>{if(e.totalReactions===0&&e.commentCount===0)return null;let n=$0.filter(t=>e.reactions[t.id]>0).slice(0,3);return(0,D.jsxs)(`div`,{className:Y.summary,children:[(0,D.jsxs)(`div`,{className:Y.summaryLeft,children:[n.length>0&&(0,D.jsx)(`span`,{className:Y.summaryIcons,children:n.map(({id:e,Icon:t,color:n})=>(0,D.jsx)(`span`,{className:Y.summaryDot,style:E({"--react-color":n}),children:(0,D.jsx)(t,{size:10})},e))}),e.totalReactions>0&&(0,D.jsx)(`span`,{className:Y.summaryCount,children:e.totalReactions})]}),e.commentCount>0&&(0,D.jsxs)(`span`,{className:T(Y.summaryComments,t!==void 0&&Y.summaryCommentsClickable),onClick:t,role:t===void 0?void 0:`button`,tabIndex:t===void 0?void 0:0,onKeyDown:t===void 0?void 0:e=>{(e.key===`Enter`||e.key===` `)&&t()},children:[e.commentCount,` `,e.commentCount===1?`comment`:`comments`]})]})},t2=({post:e,commentsOpen:t,onReact:r,onComment:i,onShare:a})=>{let[o,s]=(0,n.useState)(!1),c=$0.find(t=>t.id===e.myReaction),l=c?.Icon??ti;return(0,D.jsxs)(`div`,{className:Y.postBar,children:[(0,D.jsxs)(`div`,{className:Y.reactWrap,onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)},children:[(0,D.jsxs)(`button`,{type:`button`,className:T(Y.actionBtn,c!==void 0&&Y.actionActive),style:c===void 0?void 0:E({"--react-color":c.color}),onClick:()=>{r(e.myReaction??`like`),s(!1)},children:[(0,D.jsx)(l,{size:16}),` `,c?.label??`Like`]}),(0,D.jsx)(`div`,{className:T(Y.picker,o&&Y.pickerVisible),children:$0.map(({id:t,label:n,Icon:i,color:a})=>(0,D.jsx)(`button`,{type:`button`,className:T(Y.pickerBtn,e.myReaction===t&&Y.pickerActive),style:E({"--react-color":a}),title:n,onClick:()=>{r(t),s(!1)},children:(0,D.jsx)(i,{size:18})},t))})]}),(0,D.jsxs)(`button`,{type:`button`,className:T(Y.actionBtn,t&&Y.actionActive),onClick:i,children:[(0,D.jsx)(Sr,{size:16}),` Comment`]}),(0,D.jsxs)(`button`,{type:`button`,className:Y.actionBtn,onClick:a,children:[(0,D.jsx)(Wr,{size:16}),` Share`]})]})},n2=({post:e,onAcknowledge:t})=>e.mustAcknowledge?e.acknowledged?(0,D.jsx)(`div`,{className:Y.ackDone,children:`✓ You acknowledged this`}):(0,D.jsxs)(`div`,{className:Y.ackBanner,children:[(0,D.jsx)(`span`,{children:`Must read — please confirm you have seen this.`}),(0,D.jsx)(`button`,{type:`button`,className:Y.ackBtn,onClick:t,children:`Acknowledge`})]}):null,r2={lightboxOverlay:`_lightboxOverlay_18fqf_5`,lightboxContainer:`_lightboxContainer_18fqf_20`,lightboxLeft:`_lightboxLeft_18fqf_33`,lightboxRight:`_lightboxRight_18fqf_43`,lightboxScrollableContent:`_lightboxScrollableContent_18fqf_53`,lightboxDivider:`_lightboxDivider_18fqf_64`,lightboxClose:`_lightboxClose_18fqf_88`,lightboxImage:`_lightboxImage_18fqf_101`,lightboxArrow:`_lightboxArrow_18fqf_136`,lightboxArrowLeft:`_lightboxArrowLeft_18fqf_158`,lightboxArrowRight:`_lightboxArrowRight_18fqf_166`,lightboxCounter:`_lightboxCounter_18fqf_174`},i2=({urls:e,index:t,onPrev:n,onNext:r})=>(0,D.jsxs)(`div`,{className:r2.lightboxLeft,children:[e.length>1&&(0,D.jsx)(`button`,{type:`button`,className:T(r2.lightboxArrow,r2.lightboxArrowLeft),onClick:n,"aria-label":`Previous image`,children:(0,D.jsx)(Kn,{size:24})}),(0,D.jsx)(z0,{url:e[t]??``,alt:`Fullscreen view`,className:r2.lightboxImage}),e.length>1&&(0,D.jsx)(`button`,{type:`button`,className:T(r2.lightboxArrow,r2.lightboxArrowRight),onClick:r,"aria-label":`Next image`,children:(0,D.jsx)(qn,{size:24})}),(0,D.jsxs)(`div`,{className:r2.lightboxCounter,children:[t+1,` / `,e.length]})]}),a2=({post:e,commentPending:t,onReact:n,onBookmark:r,onAcknowledge:i,onAddComment:a,onShare:o})=>(0,D.jsx)(`div`,{className:r2.lightboxRight,children:(0,D.jsxs)(`div`,{className:r2.lightboxScrollableContent,children:[(0,D.jsx)(m0,{post:e,onBookmark:r}),e.title!==null&&(0,D.jsx)(`h2`,{className:Y.cardTitle,children:e.title}),(0,D.jsx)(`p`,{className:Y.cardBody,children:e.body}),(0,D.jsx)(n2,{post:e,onAcknowledge:i}),(0,D.jsx)(`div`,{className:r2.lightboxDivider}),(0,D.jsx)(e2,{post:e}),(0,D.jsx)(t2,{post:e,commentsOpen:!0,onReact:n,onComment:()=>{},onShare:o}),(0,D.jsx)(`div`,{className:r2.lightboxDivider}),(0,D.jsx)(R0,{comments:e.comments,pending:t,onAdd:a})]})}),o2=({urls:e,index:t,onClose:r,onChange:a,post:o,commentPending:s,onReact:c,onBookmark:l,onAcknowledge:u,onAddComment:d,onShare:f})=>{let p=Bs();return(0,n.useEffect)(()=>{let n=n=>{n.key===`Escape`&&r(),n.key===`ArrowLeft`&&a((t-1+e.length)%e.length),n.key===`ArrowRight`&&a((t+1)%e.length)};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n)}},[t,r,a,e.length]),(0,i.createPortal)((0,D.jsx)(`div`,{className:r2.lightboxOverlay,onClick:r,role:`presentation`,children:(0,D.jsxs)(`div`,{className:r2.lightboxContainer,onClick:e=>{e.stopPropagation()},role:`presentation`,children:[(0,D.jsx)(`button`,{type:`button`,className:r2.lightboxClose,onClick:r,"aria-label":`Close lightbox`,children:(0,D.jsx)(ci,{size:20})}),(0,D.jsx)(i2,{urls:e,index:t,onPrev:()=>{a((t-1+e.length)%e.length)},onNext:()=>{a((t+1)%e.length)}}),(0,D.jsx)(a2,{post:o,commentPending:s,onReact:c,onBookmark:l,onAcknowledge:u,onAddComment:d,onShare:f})]})}),p??document.body)},s2=({open:e,post:t,onClose:n})=>{let{categoryLabel:r,categoryColor:i}=cZ(t);return(0,D.jsx)(Q0,{open:e,post:{postId:t.id,authorName:t.authorName,authorRole:t.authorRole,authorInitials:t.authorInitials,authorColor:t.authorColor,categoryLabel:r,categoryColor:i,title:t.title??t.body,bodySnippet:t.body.length>150?`${t.body.slice(0,150)}...`:t.body},onClose:n})},c2=({index:e,post:t,commentPending:n,onReact:r,onBookmark:i,onAcknowledge:a,onAddComment:o,onShare:s,onClose:c,onChange:l})=>e===null?null:(0,D.jsx)(o2,{urls:t.imageUrls,index:e,post:t,commentPending:n,onReact:r,onBookmark:i,onAcknowledge:a,onAddComment:o,onShare:s,onClose:c,onChange:l}),l2=({body:e,onSeeMore:t})=>{let[r,i]=(0,n.useState)(!1),a=e.length>200;return(0,D.jsxs)(`p`,{className:Y.cardBody,children:[a&&!r?`${e.slice(0,200)}...`:e,a&&(0,D.jsx)(`button`,{type:`button`,className:Y.seeMoreBtn,onClick:()=>{r||t(),i(e=>!e)},children:r?` See less`:` See more`})]})},u2=({post:e,commentsOpen:t,commentPending:n,shareOpen:r,lightboxIndex:i,onReact:a,onBookmark:o,onAcknowledge:s,onAddComment:c,toggleComments:l,setShareOpen:u,setLightboxIndex:d})=>{let f=eZ(),p=()=>{u(!0),f.mutate(e.id)};return(0,D.jsxs)(D.Fragment,{children:[e.title!==null&&(0,D.jsx)(`h2`,{className:Y.cardTitle,children:e.title}),(0,D.jsx)(l2,{body:e.body,onSeeMore:()=>{f.mutate(e.id)}}),(0,D.jsx)(B0,{urls:e.imageUrls,onImageClick:t=>{d(t),t!==null&&f.mutate(e.id)}}),(0,D.jsx)(n2,{post:e,onAcknowledge:s}),(0,D.jsx)(e2,{post:e,onCommentClick:l}),(0,D.jsx)(t2,{post:e,commentsOpen:t,onReact:a,onComment:l,onShare:p}),t&&(0,D.jsx)(R0,{comments:e.comments,pending:n,onAdd:c}),(0,D.jsx)(s2,{open:r,post:e,onClose:()=>{u(!1)}}),(0,D.jsx)(c2,{index:i,post:e,commentPending:n,onReact:a,onBookmark:o,onAcknowledge:s,onAddComment:c,onShare:p,onClose:()=>{d(null)},onChange:d})]})},d2=e=>{let t=(0,n.useRef)(null);(0,n.useEffect)(()=>{t.current=document.getElementById(`app-scroll-container`)},[]);let{scrollYProgress:r}=My({target:e,container:t,offset:[`start end`,`end start`]});return Iy(r,[0,1],[-12,12])},f2=({post:e,state:t})=>(0,D.jsx)(F0,{post:e,state:t}),p2=({post:e,isAuthor:t,commentPending:n,onBookmark:r,onPin:i,showPinButton:a,onReact:o,onAcknowledge:s,onAddComment:c,state:l,cardY:u,elementRef:d})=>(0,D.jsxs)(A.article,{id:`feed-post-${e.id}`,ref:d,style:{y:u},className:Y.card,children:[e.needsAcknowledgement&&(0,D.jsx)(`span`,{className:Y.urgentStripe}),e.pinned&&(0,D.jsxs)(`div`,{className:Y.pinnedRow,children:[(0,D.jsx)(Nr,{size:10,className:Y.pin}),` Pinned`]}),!l.isEditing&&(0,D.jsx)(m0,{post:e,onBookmark:r,onPin:i,showPinButton:a,showEditButton:t,onEdit:()=>{l.setIsEditing(!0)}}),l.isEditing?(0,D.jsx)(f2,{post:e,state:l}):(0,D.jsx)(u2,{post:e,commentsOpen:l.commentsOpen,commentPending:n,shareOpen:l.shareOpen,lightboxIndex:l.lightboxIndex,onReact:o,onBookmark:r,onAcknowledge:s,onAddComment:c,toggleComments:()=>{l.setCommentsOpen(e=>!e)},setShareOpen:l.setShareOpen,setLightboxIndex:l.setLightboxIndex})]}),m2=({post:e,commentPending:t,onReact:r,onBookmark:i,onAcknowledge:a,onAddComment:o})=>{let s=A0(e),{user:c}=_B(),l=e.authorUserId===c?.id,u=nZ(),d=c!==null&&(c.hasRole(`admin`)||c.hasRole(`system-admin`)||c.hasRole(`FullAccess`)),f=()=>{u.mutateAsync({postId:e.id,pinned:!e.pinned})},p=(0,n.useRef)(null);return(0,D.jsx)(p2,{post:e,isAuthor:l,commentPending:t,onBookmark:i,onPin:f,showPinButton:d,onReact:r,onAcknowledge:a,onAddComment:o,state:s,cardY:d2(p),elementRef:p})},h2=({posts:e})=>{let t=ZX(),n=QX(),r=$X(),i=tZ();return(0,D.jsx)(D.Fragment,{children:e.map(e=>(0,D.jsx)(m2,{post:e,commentPending:i.isPending,onReact:n=>{t.mutate({postId:e.id,type:n})},onBookmark:()=>{n.mutate(e.id),j.success(e.bookmarked?`Bookmark removed`:`Post saved to bookmarks`)},onAcknowledge:()=>{r.mutate(e.id),j.success(`Post acknowledged`)},onAddComment:t=>{i.mutate({postId:e.id,text:t})}},e.id))})},g2=2,_2=e=>[...e].filter(e=>e.active).sort((e,t)=>e.priority-t.priority),v2=(e,t)=>e.find(e=>e.id===t.templateId),y2=(e,t,n)=>_2(e).map(e=>{let r=t.filter(t=>t.categoryId===e.id);return{id:e.id,name:e.name,color:e.color,count:r.length,template:v2(n,e),items:r.slice(0,g2)}}).filter(e=>e.count>0),b2=e=>[{id:`all`,label:`All`},..._2(e).map(e=>({id:e.id,label:e.name}))],x2=e=>Object.values(e.values).join(` `).toLowerCase(),S2=(e,t,n)=>{let r=[];for(let i of _2(e.categories)){if(t!==`all`&&i.id!==t)continue;let a=v2(e.templates,i);if(a===void 0)continue;let o=e.promotions.filter(e=>e.categoryId===i.id),s=n===``?o:o.filter(e=>x2(e).includes(n));s.length>0&&r.push({category:i,template:a,items:s,count:o.length})}return r},C2=({onClose:e})=>(0,D.jsxs)(`div`,{className:Y.ppHead,children:[(0,D.jsx)(`span`,{className:Y.ppHeadIcon,children:(0,D.jsx)(br,{size:18})}),(0,D.jsxs)(`div`,{className:Y.ppHeadText,children:[(0,D.jsx)(`h2`,{className:Y.ppTitle,children:`Promotions & Campaigns`}),(0,D.jsx)(`p`,{className:Y.ppSubtitle,children:`Latest campaigns, university updates, intake alerts and events.`}),(0,D.jsx)(`span`,{className:Y.ppManaged,children:`Read-only · Managed by System Admin`})]}),(0,D.jsx)(`button`,{type:`button`,className:Y.ppClose,"aria-label":`Close`,onClick:e,children:(0,D.jsx)(ci,{size:18})})]}),w2=({tabs:e,active:t,onSelect:n})=>(0,D.jsx)(`div`,{className:Y.ppTabs,children:e.map(e=>{let r=e.id===t;return(0,D.jsxs)(`button`,{type:`button`,className:T(Y.ppTab,r&&Y.ppTabActive),onClick:()=>{n(e.id)},children:[r&&(0,D.jsx)(A.span,{layoutId:`ppTabBg`,className:Y.ppTabBg,transition:{type:`spring`,stiffness:420,damping:34}}),(0,D.jsx)(`span`,{className:Y.ppTabLabel,children:e.label})]},e.id)})}),T2=({categories:e,promotions:t,templates:r,initialTab:i,onClose:a})=>{let[o,s]=(0,n.useState)(i),[c,l]=(0,n.useState)(``),u=b2(e),d=S2({categories:e,promotions:t,templates:r},o,c.trim().toLowerCase());return(0,D.jsxs)(`div`,{className:Y.ppRoot,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.ppOverlay,"aria-label":`Close promotions`,onClick:a}),(0,D.jsxs)(`div`,{className:Y.ppPanel,role:`dialog`,"aria-label":`Promotions & Campaigns`,children:[(0,D.jsx)(C2,{onClose:a}),(0,D.jsx)(w2,{tabs:u,active:o,onSelect:s}),(0,D.jsxs)(`div`,{className:Y.ppSearch,children:[(0,D.jsx)(Hr,{size:14,className:Y.ppSearchIcon}),(0,D.jsx)(`input`,{type:`search`,className:Y.ppSearchInput,placeholder:`Search promotions…`,value:c,onChange:e=>{l(e.target.value)}})]}),(0,D.jsx)(`div`,{className:Y.ppList,children:(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsx)(A.div,{className:Y.ppListInner,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.18,ease:`easeOut`},children:d.length===0?(0,D.jsx)(`p`,{className:Y.ppEmpty,children:c.trim()===``?`No active promotions right now.`:`No promotions match.`}):d.map(e=>(0,D.jsx)(bR,{template:e.template,color:e.category.color,name:e.category.name,count:e.count,items:e.items},e.category.id))},o)})})]})]})},E2=({sections:e,onClose:t,onSeeAll:n,onSelectTab:r})=>(0,D.jsx)(A.div,{className:Y.promoPopoverOverlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:e=>{e.target===e.currentTarget&&t()},children:(0,D.jsxs)(A.div,{className:Y.promoPopoverCard,initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:`spring`,damping:25,stiffness:300},children:[(0,D.jsxs)(`div`,{className:Y.popoverHeader,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.popoverCloseX,onClick:t,"aria-label":`Close promotions modal`,children:(0,D.jsx)(ci,{size:18})}),(0,D.jsx)(`div`,{className:Y.popoverBadgeIcon,children:(0,D.jsx)(br,{size:24})}),(0,D.jsxs)(`div`,{className:Y.popoverTitleRow,children:[(0,D.jsx)(`h3`,{className:Y.popoverTitle,children:`Promotions & Campaigns`}),(0,D.jsx)(`button`,{type:`button`,className:Y.popoverSeeAllBtn,onClick:()=>{t(),n()},children:`See all`})]}),(0,D.jsx)(`p`,{className:Y.popoverSub,children:`Stay updated with active promotions and university campaigns`})]}),(0,D.jsx)(`div`,{className:Y.popoverContent,children:e.length===0?(0,D.jsx)(`p`,{className:Y.popoverEmpty,children:`No active promotions right now.`}):e.map(e=>e.template===void 0?null:(0,D.jsx)(bR,{template:e.template,color:e.color,name:e.name,count:e.count,items:e.items,onViewAll:()=>{t(),r(e.id)}},e.id))})]})}),D2=({sections:e,onSeeAll:t,onSelectTab:n})=>(0,D.jsxs)(`aside`,{className:Y.rail,children:[(0,D.jsxs)(`div`,{className:Y.railHead,children:[(0,D.jsxs)(`span`,{className:Y.railHeadTitle,children:[(0,D.jsx)(br,{size:11}),` PROMOTIONS & CAMPAIGNS`]}),(0,D.jsx)(`button`,{type:`button`,className:Y.railSeeAll,onClick:t,children:`See all`})]}),(0,D.jsx)(`div`,{className:Y.railList,children:e.length===0?(0,D.jsx)(`p`,{className:Y.railFoot,children:`No active promotions right now.`}):e.map(e=>e.template===void 0?null:(0,D.jsx)(bR,{template:e.template,color:e.color,name:e.name,count:e.count,items:e.items,onViewAll:()=>{n(e.id)}},e.id))}),(0,D.jsx)(`div`,{className:Y.railFoot,children:`Managed by System Admin`})]}),O2=({onOpen:e})=>{let[t,r]=(0,n.useState)(!1),[i,a]=(0,n.useState)(!1),o=(0,n.useRef)(0);return(0,n.useEffect)(()=>{let e=document.getElementById(`app-scroll-container`);if(!e)return;let t=()=>{let t=e.scrollTop;t<=4||t<o.current?a(!1):a(!0),o.current=t};return e.addEventListener(`scroll`,t,{passive:!0}),()=>{e.removeEventListener(`scroll`,t)}},[]),(0,n.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>{r(!1)},4e3);return()=>{clearTimeout(e)}},[t]),(0,D.jsxs)(`button`,{type:`button`,className:T(Y.mobilePromoTrigger,t&&Y.mobilePromoExpanded,i&&Y.mobilePromoTriggerBarHidden),onClick:()=>{t?(r(!1),e()):r(!0)},"aria-label":`Promotions & Campaigns`,children:[(0,D.jsx)(`span`,{className:Y.promoShimmerSweep}),(0,D.jsx)(`span`,{className:Y.promoIconWrap,children:(0,D.jsx)(br,{size:15,className:Y.sparkleIcon})}),(0,D.jsx)(`span`,{className:Y.promoBtnText,children:`Promotions & Campaigns`})]})},k2=()=>{let e=cR(),t=uR(),r=lR(),[i,a]=(0,n.useState)(null),[o,s]=(0,n.useState)(!1),c=e.data??[],l=t.data??[],u=r.data??[],d=y2(c,l,u);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(D2,{sections:d,onSeeAll:()=>{a(`all`)},onSelectTab:e=>{a(e)}}),(0,D.jsx)(O2,{onOpen:()=>{s(!0)}}),(0,D.jsx)(Kg,{children:o&&(0,D.jsx)(E2,{sections:d,onClose:()=>{s(!1)},onSeeAll:()=>{a(`all`)},onSelectTab:e=>{a(e)}})}),i!==null&&(0,D.jsx)(T2,{categories:c,promotions:l,templates:u,initialTab:i,onClose:()=>{a(null)}})]})},A2=[{id:`for_you`,label:`For You`},{id:`team`,label:`Team Updates`},{id:`company`,label:`Company Wide`},{id:`saved`,label:`Saved Posts`,icon:In}],j2=({scope:e,onChange:t})=>{let n=JX(`saved`).data?.pages[0]?.totalCount;return(0,D.jsx)(`div`,{className:Y.tabs,children:A2.map(r=>{let i=r.icon;return(0,D.jsxs)(`button`,{type:`button`,className:T(Y.tab,e===r.id&&Y.tabActive),onClick:()=>{t(r.id)},children:[i!==void 0&&(0,D.jsx)(i,{size:13}),r.label,r.id===`saved`&&n!==void 0&&n>0&&(0,D.jsx)(`span`,{className:Y.tabBadge,children:n})]},r.id)})})},M2={skeletonCard:`_skeletonCard_7d381_1`,skeletonHeader:`_skeletonHeader_7d381_11`,skeletonAvatar:`_skeletonAvatar_7d381_17`,pulse:`_pulse_7d381_1`,skeletonMeta:`_skeletonMeta_7d381_25`,skeletonLine:`_skeletonLine_7d381_32`,short:`_short_7d381_39`,medium:`_medium_7d381_43`,full:`_full_7d381_47`,skeletonBody:`_skeletonBody_7d381_51`},N2=({count:e=3})=>(0,D.jsx)(D.Fragment,{children:Array.from({length:e}).map((e,t)=>(0,D.jsxs)(`div`,{className:M2.skeletonCard,children:[(0,D.jsxs)(`div`,{className:M2.skeletonHeader,children:[(0,D.jsx)(`div`,{className:M2.skeletonAvatar}),(0,D.jsxs)(`div`,{className:M2.skeletonMeta,children:[(0,D.jsx)(`div`,{className:T(M2.skeletonLine,M2.medium)}),(0,D.jsx)(`div`,{className:T(M2.skeletonLine,M2.short)})]})]}),(0,D.jsxs)(`div`,{className:M2.skeletonBody,children:[(0,D.jsx)(`div`,{className:T(M2.skeletonLine,M2.full)}),(0,D.jsx)(`div`,{className:T(M2.skeletonLine,M2.full)}),(0,D.jsx)(`div`,{className:T(M2.skeletonLine,M2.medium)})]})]},t))}),P2=e=>{yZ(`feed-post-${e}`,`app-scroll-container`,`start`)},F2=({post:e,onView:t,onDismiss:n,displayZone:r})=>{let{categoryLabel:i,categoryColor:a}=cZ(e);return(0,D.jsxs)(`div`,{className:Y.missedCard,children:[(0,D.jsx)(`button`,{type:`button`,className:Y.missedClose,"aria-label":`Dismiss`,onClick:n,children:(0,D.jsx)(ci,{size:11,strokeWidth:2.5})}),(0,D.jsxs)(`div`,{className:Y.missedCardTop,children:[(0,D.jsx)(`span`,{className:Y.missedDot,style:E({"--dot":a})}),(0,D.jsx)(`span`,{className:Y.missedCat,children:i}),(0,D.jsx)(`span`,{className:Y.missedTime,children:vZ(e.createdAt,r,e.scheduledAt)})]}),(0,D.jsx)(`p`,{className:Y.missedSummary,children:e.title??e.body}),(0,D.jsxs)(`div`,{className:Y.missedFoot,children:[(0,D.jsxs)(`button`,{type:`button`,className:Y.missedCta,onClick:t,children:[`View post `,(0,D.jsx)(qn,{size:10,strokeWidth:3})]}),e.mustAcknowledge&&(0,D.jsxs)(`span`,{className:Y.missedPriority,children:[(0,D.jsx)(Yn,{size:8}),` Priority`]})]})]})},I2=({posts:e})=>{let[t,r]=(0,n.useState)(new Set),[i,a]=(0,n.useState)(!1),o=(0,n.useRef)(null),s=JN().display,c=e.filter(e=>e.mustAcknowledge&&!t.has(e.id)&&!e.acknowledged);if(i||c.length===0)return null;let l=e=>{o.current?.scrollBy({left:e*300,behavior:`smooth`})},u=c.length>2;return(0,D.jsxs)(`div`,{className:Y.missed,children:[(0,D.jsxs)(`div`,{className:Y.missedHead,children:[(0,D.jsx)(Pn,{size:14,className:Y.missedSpark}),(0,D.jsx)(`span`,{className:Y.missedTitle,children:`WHAT YOU MISSED`}),(0,D.jsx)(`span`,{className:Y.missedBadge,children:c.length}),(0,D.jsx)(`button`,{type:`button`,className:Y.missedRead,onClick:()=>{a(!0)},children:`Mark all read`})]}),(0,D.jsxs)(`div`,{className:T(Y.missedScroller,u&&Y.missedScrollerFade),children:[u&&(0,D.jsx)(`button`,{type:`button`,className:T(Y.missedNav,Y.missedNavLeft),"aria-label":`Scroll left`,onClick:()=>{l(-1)},children:(0,D.jsx)(Kn,{size:16})}),(0,D.jsx)(`div`,{className:Y.missedTrack,ref:o,children:c.map(e=>(0,D.jsx)(F2,{post:e,displayZone:s,onView:()=>{P2(e.id)},onDismiss:()=>{r(t=>new Set(t).add(e.id))}},e.id))}),u&&(0,D.jsx)(`button`,{type:`button`,className:T(Y.missedNav,Y.missedNavRight),"aria-label":`Scroll right`,onClick:()=>{l(1)},children:(0,D.jsx)(qn,{size:16})})]})]})},L2=e=>{let{isSuccess:t,posts:r,hasNextPage:i,isFetchingNextPage:a,fetchNextPage:o}=e,[s,c]=ln(),l=s.get(`postId`),u=sN();(0,n.useEffect)(()=>{l!==null&&u.invalidateQueries({queryKey:[`feed`]})},[l,u]),(0,n.useEffect)(()=>{!t||l===null||a||!r.some(e=>e.id===l)&&i&&o()},[t,l,r,i,a,o]),(0,n.useEffect)(()=>{if(!t||l===null)return;let e,n=0,r=setInterval(()=>{if(document.getElementById(`feed-post-${l}`)){clearInterval(r);let t=document.getElementById(`app-scroll-container`);t&&(t.style.paddingBottom=`80vh`),yZ(`feed-post-${l}`,`app-scroll-container`,`center`),e=setTimeout(()=>{t&&(t.style.paddingBottom=``);let e=new URLSearchParams(window.location.search);e.has(`postId`)&&(e.delete(`postId`),c(e,{replace:!0}))},1e3)}else n++,n>=100&&clearInterval(r)},50);return()=>{clearInterval(r),e&&clearTimeout(e)}},[t,l,s,c])},R2=(e,t)=>{let n=t.trim();if(n===``)return e;let r=n.replace(/\s+/g,` `).toLowerCase();return e.filter(e=>[e.authorName,e.authorRole,e.audienceLabel,e.timestamp,e.title,e.body].filter(Boolean).join(` `).replace(/\s+/g,` `).toLowerCase().includes(r))},z2=(e,t,r)=>{let i=(0,n.useRef)(null),a=(0,n.useCallback)(n=>{n[0]?.isIntersecting&&e&&!t&&r()},[e,t,r]);return(0,n.useEffect)(()=>{let e=i.current;if(!e)return;let t=new IntersectionObserver(a,{rootMargin:`2000px`});return t.observe(e),()=>{t.disconnect()}},[a]),i},B2=()=>{let[e,t]=(0,n.useState)(`for_you`),[r,i]=(0,n.useState)(``),a=JX(e),{hasNextPage:o,isFetchingNextPage:s,fetchNextPage:c}=a,l=a.data?a.data.pages.flatMap(e=>e.items):[],u=R2(l,r);L2({isSuccess:a.isSuccess,posts:l,hasNextPage:o,isFetchingNextPage:s,fetchNextPage:c});let d=z2(o,s,c);return(0,D.jsxs)(`div`,{className:Y.screen,children:[(0,D.jsx)(`div`,{className:Y.toolbar,children:(0,D.jsxs)(`div`,{className:Y.toolbarContainer,children:[(0,D.jsxs)(`div`,{className:Y.search,children:[(0,D.jsx)(Hr,{size:14,className:Y.searchIcon}),(0,D.jsx)(`input`,{type:`search`,className:Y.searchInput,placeholder:`Search posts by keyword, title, author, or role…`,value:r,onChange:e=>{i(e.target.value)}})]}),(0,D.jsx)(`div`,{className:Y.toolbarRailSpacer})]})}),(0,D.jsxs)(`div`,{className:Y.wrapper,children:[(0,D.jsxs)(`div`,{className:Y.column,children:[(0,D.jsx)(j2,{scope:e,onChange:e=>{t(e)}}),(0,D.jsx)(I2,{posts:u}),(0,D.jsx)(l0,{}),a.isPending&&(0,D.jsx)(N2,{count:3}),a.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not load the feed`,children:a.error.message}),a.isSuccess&&u.length===0&&(0,D.jsx)(u0,{}),(0,D.jsx)(h2,{posts:u}),(0,D.jsx)(`div`,{ref:d,style:{height:`20px`,width:`100%`},children:a.isFetchingNextPage&&(0,D.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`1rem`},children:(0,D.jsx)(gi,{})})})]}),(0,D.jsx)(k2,{})]})]})},V2=({path:e,children:t})=>(0,D.jsxs)(St,{children:[(0,D.jsx)(bt,{path:e,element:(0,D.jsx)(D.Fragment,{children:t})}),(0,D.jsx)(bt,{path:`*`,element:(0,D.jsx)(yt,{to:e,replace:!0})})]}),H2=()=>{Q$(`uapp-feed`,()=>(0,D.jsx)(V2,{path:`/comms/feed`,children:(0,D.jsx)(B2,{})}))},U2=e=>{let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:((t[0]?.[0]??``)+(t.length>1?t[t.length-1]?.[0]??``:``)).toUpperCase()},W2=()=>{let{user:e}=_B(),t=e?.fullName??``;return{id:e?.id??``,name:t,initials:U2(t),color:`#0f1f1f`,role:`Organizer`}},G2=(e,t,n)=>{let r=new Date(e).getTime(),i=new Date(t).getTime();return n.some(e=>new Date(e.startUtc).getTime()<i&&new Date(e.endUtc).getTime()>r)},K2=(e,t,n)=>{let r=new Date(e).getTime(),i=new Date(t).getTime();return n.some(e=>new Date(e.startUtc).getTime()<=r&&new Date(e.endUtc).getTime()>=i)},q2=e=>{let t=e=>{let[t,n]=e.split(`:`).map(Number);return(t??0)*60+(n??0)},n=e=>`${String(Math.floor(e/60)).padStart(2,`0`)}:${String(e%60).padStart(2,`0`)}`,r=t(e.end),i=[];for(let a=t(e.start);a+30<=r;a+=30)i.push({start:n(a),end:n(a+30),label:`${n(a)} – ${n(a+30)}`});return i},J2=(e,t)=>{let n=e??t,r=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,`0`),a=String(n.getDate()).padStart(2,`0`);return`${String(r)}-${i}-${a}`},Y2=(e,t)=>new Date(e).toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0,timeZone:t}),X2=(e,t,n)=>!e||!t?``:`${Y2(e,n)} – ${Y2(t,n)}`,Z2=(e,t)=>e?new Date(e).toLocaleDateString(`en-US`,{weekday:`short`,day:`numeric`,month:`short`,timeZone:t}):``,Q2=(e,t)=>t.id!==``&&e===t.id,$2=(e,t,n)=>{if(Q2(e,n))return n.name.split(` `)[0]??n.name;let r=t.find(t=>t.id===e);return r===void 0?``:r.name.split(` `)[0]??``},e4=(e,t,n)=>{if(Q2(e,n))return{name:`${n.name} (You)`,role:n.role,initials:n.initials,color:n.color};let r=t.find(t=>t.id===e);return{name:r?.name??``,role:r?.role??``,initials:r?.initials??``,color:r?.color??`#555`}},t4=(e,t,n)=>{let r=new Date(WN(e,`00:00`,t));return{rangeStart:r,rangeEnd:new Date(r.getTime()+1440*60*1e3),workWindows:n?.active?n.slots.map(n=>({start:new Date(WN(e,n.from,t)),end:new Date(WN(e,n.to,t))})):[]}},n4=(e,t,n,r)=>{let i=[],a=(e,t)=>{i.push({startUtc:new Date(e).getTime(),endUtc:new Date(t).getTime()})};r.workWindows.forEach(e=>{a(e.start,e.end)}),n.forEach(e=>{IO(e,r.rangeStart,r.rangeEnd).forEach(e=>{a(e.start,e.end)})}),e.forEach(e=>{let n=t.get(e);n&&(n.workingHours.forEach(e=>{a(e.startUtc,e.endUtc)}),n.busy.forEach(e=>{a(e.startUtc,e.endUtc)}))});let o=r.rangeStart.getTime(),s=r.rangeEnd.getTime(),c=i.filter(e=>e.startUtc<s&&e.endUtc>o).map(e=>({startOffsetMs:Math.max(e.startUtc,o)-o,endOffsetMs:Math.min(e.endUtc,s)-o}));if(c.length===0)return{start:`09:00`,end:`17:00`};let l=1440*60*1e3,u=0;c.forEach(e=>{e.startOffsetMs<l&&(l=e.startOffsetMs),e.endOffsetMs>u&&(u=e.endOffsetMs)});let d=Math.floor(Math.max(0,l/6e4-60)/30)*30,f=Math.ceil(Math.min(1440,u/6e4+60)/30)*30,p=e=>`${String(Math.floor(e/60)).padStart(2,`0`)}:${String(e%60).padStart(2,`0`)}`;return{start:p(d),end:p(f)}},X={bookCard:`_bookCard_g1hkd_7`,bookTopBar:`_bookTopBar_g1hkd_16`,bookGrid:`_bookGrid_g1hkd_26`,colCalendar:`_colCalendar_g1hkd_31`,search:`_search_g1hkd_37`,searchIcon:`_searchIcon_g1hkd_42`,searchInput:`_searchInput_g1hkd_50`,contactList:`_contactList_g1hkd_61`,contactRow:`_contactRow_g1hkd_72`,contactActive:`_contactActive_g1hkd_91`,contactAvatar:`_contactAvatar_g1hkd_96`,contactText:`_contactText_g1hkd_112`,contactName:`_contactName_g1hkd_120`,contactRole:`_contactRole_g1hkd_135`,contactCheck:`_contactCheck_g1hkd_144`,contactCheckOn:`_contactCheckOn_g1hkd_158`,contactCheckIcon:`_contactCheckIcon_g1hkd_164`,contactEmpty:`_contactEmpty_g1hkd_170`,calHead:`_calHead_g1hkd_177`,calMonth:`_calMonth_g1hkd_184`,calNav:`_calNav_g1hkd_190`,calNavBtn:`_calNavBtn_g1hkd_195`,calDays:`_calDays_g1hkd_208`,calDayLabel:`_calDayLabel_g1hkd_214`,calGrid:`_calGrid_g1hkd_222`,calCell:`_calCell_g1hkd_228`,calCellToday:`_calCellToday_g1hkd_248`,calCellSelected:`_calCellSelected_g1hkd_254`,calCellPast:`_calCellPast_g1hkd_262`,calCellBlank:`_calCellBlank_g1hkd_267`,bookBar:`_bookBar_g1hkd_272`,bookHint:`_bookHint_g1hkd_282`,bookSummary:`_bookSummary_g1hkd_287`,bookSummaryName:`_bookSummaryName_g1hkd_295`,bookSummarySlot:`_bookSummarySlot_g1hkd_300`,bookBtn:`_bookBtn_g1hkd_305`,confirmBody:`_confirmBody_g1hkd_327`,confirmWho:`_confirmWho_g1hkd_333`,confirmAvatar:`_confirmAvatar_g1hkd_343`,confirmWhoText:`_confirmWhoText_g1hkd_357`,confirmName:`_confirmName_g1hkd_364`,confirmRole:`_confirmRole_g1hkd_370`,confirmRows:`_confirmRows_g1hkd_375`,confirmRow:`_confirmRow_g1hkd_375`,confirmRowIcon:`_confirmRowIcon_g1hkd_392`,confirmRowLabel:`_confirmRowLabel_g1hkd_404`,confirmRowValue:`_confirmRowValue_g1hkd_412`,bookedNote:`_bookedNote_g1hkd_420`,typeSelector:`_typeSelector_g1hkd_430`,typeBtn:`_typeBtn_g1hkd_438`,typeBtnActive:`_typeBtnActive_g1hkd_456`},r4=({spanKey:e,name:t,dateLabel:n,formattedSlot:r})=>(0,D.jsxs)(A.span,{className:X.bookSummary,initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0},children:[(0,D.jsx)(`span`,{className:X.bookSummaryName,children:t}),` · `,n,` ·`,` `,(0,D.jsx)(`span`,{className:X.bookSummarySlot,children:r})]},e),i4=({meetingType:e,contact:t,dateLabel:n,slot:r,selectedContactIds:i,groupTitle:a,formattedSlot:o})=>e===`1:1`?t!==null&&n!==``&&r!==null?(0,D.jsx)(r4,{spanKey:`summary`,name:t.name,dateLabel:n,formattedSlot:o}):null:i.length>0&&n!==``&&r!==null?(0,D.jsx)(r4,{spanKey:`group-summary`,name:`${a||`Group Meeting`} (${String(i.length)} guests)`,dateLabel:n,formattedSlot:o}):null,a4=({success:e,meetingType:t,contact:n,dateLabel:r,slot:i,selectedContactIds:a,groupTitle:o,selectedSlot:s,tzId:c})=>{if(e)return(0,D.jsxs)(A.span,{className:X.bookedNote,initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0},children:[(0,D.jsx)(Wn,{size:14,strokeWidth:3}),` Meeting booked — see the Scheduled tab.`]},`done`);let l=i4({meetingType:t,contact:n,dateLabel:r,slot:i,selectedContactIds:a,groupTitle:o,formattedSlot:s?X2(s.startUtc,s.endUtc,c):``});return l===null?(0,D.jsx)(`span`,{className:X.bookHint,children:t===`1:1`?`Pick a person, a date, and a time to book.`:`Select participants, set group title, pick a date and a time to book.`},`hint`):l},o4=({contact:e,dateLabel:t,slot:n,canBook:r,success:i,meetingType:a,selectedContactIds:o,groupTitle:s,onBook:c,selectedSlot:l,tzId:u})=>(0,D.jsxs)(`div`,{className:X.bookBar,children:[(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsx)(a4,{success:i,meetingType:a,contact:e,dateLabel:t,slot:n,selectedContactIds:o,groupTitle:s,selectedSlot:l,tzId:u})}),(0,D.jsxs)(A.button,{type:`button`,className:X.bookBtn,disabled:!r,...r?{whileTap:{scale:.97}}:{},onClick:()=>{c()},children:[`Confirm booking `,(0,D.jsx)(Mn,{size:15})]})]}),s4=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],c4=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],l4=e=>e.toLocaleDateString(`en-GB`,{weekday:`short`,day:`2-digit`,month:`short`}),u4=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),d4=(e,t,n)=>{let r=new Date(e,t,1).getDay(),i=new Date(e,t+1,0).getDate(),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=Array.from({length:r},()=>null);for(let r=1;r<=i;r+=1){let i=new Date(e,t,r);o.push({day:r,date:i,past:i<a,today:u4(i,n)})}return o},f4={col:`_col_18ut1_6`,colTitle:`_colTitle_18ut1_13`,stepDot:`_stepDot_18ut1_22`},p4=({cell:e,selected:t,onPick:n})=>(0,D.jsx)(A.button,{type:`button`,disabled:e.past,...e.past?{}:{whileHover:{scale:1.12},whileTap:{scale:.9}},className:T(X.calCell,e.past&&X.calCellPast,e.today&&X.calCellToday,t?.toDateString()===e.date.toDateString()&&X.calCellSelected),onClick:()=>{n(e.date)},children:e.day}),m4=({view:e,today:t,selected:n,onShift:r,onPick:i})=>(0,D.jsxs)(`div`,{className:X.colCalendar,children:[(0,D.jsxs)(`div`,{className:f4.colTitle,children:[(0,D.jsx)(`span`,{className:f4.stepDot,children:`2`}),` Pick a date`]}),(0,D.jsxs)(`div`,{className:X.calHead,children:[(0,D.jsxs)(`span`,{className:X.calMonth,children:[c4[e.month],` `,e.year]}),(0,D.jsxs)(`div`,{className:X.calNav,children:[(0,D.jsx)(A.button,{type:`button`,"aria-label":`Previous month`,className:X.calNavBtn,whileTap:{scale:.88},onClick:()=>{r(-1)},children:(0,D.jsx)(Kn,{size:15})}),(0,D.jsx)(A.button,{type:`button`,"aria-label":`Next month`,className:X.calNavBtn,whileTap:{scale:.88},onClick:()=>{r(1)},children:(0,D.jsx)(qn,{size:15})})]})]}),(0,D.jsx)(`div`,{className:X.calDays,children:s4.map(e=>(0,D.jsx)(`span`,{className:X.calDayLabel,children:e},e))}),(0,D.jsx)(A.div,{className:X.calGrid,initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.22,1,.36,1]},children:d4(e.year,e.month,t).map((e,t)=>e===null?(0,D.jsx)(`span`,{className:X.calCellBlank},`blank-${String(t)}`):(0,D.jsx)(p4,{cell:e,selected:n,onPick:i},e.day))},`${String(e.year)}-${String(e.month)}`)]}),h4={hidden:{},visible:{transition:{staggerChildren:.05,delayChildren:.05}}},g4={hidden:{opacity:0,x:-8},visible:{opacity:1,x:0,transition:{duration:.18,ease:`easeOut`}}},_4=({icon:e,label:t,value:n})=>(0,D.jsxs)(A.div,{className:X.confirmRow,variants:g4,children:[(0,D.jsx)(`span`,{className:X.confirmRowIcon,children:e}),(0,D.jsx)(`span`,{className:X.confirmRowLabel,children:t}),(0,D.jsx)(`span`,{className:X.confirmRowValue,children:n})]}),v4=({open:e,contact:t,dateLabel:n,slot:r,zone:i,pending:a,onConfirm:o,onClose:s,selectedSlot:c,tzId:l})=>{let u=X2(c?.startUtc,c?.endUtc,l);return(0,D.jsx)(Ky,{open:e&&t!==null&&r!==null&&n!==``,onOpenChange:e=>{e||s()},title:`Confirm your booking`,description:`A calendar invite is sent to both of you once confirmed.`,footer:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(vi,{variant:`ghost`,onClick:s,children:`Back`}),(0,D.jsx)(vi,{isLoading:a,onClick:o,children:`Confirm booking`})]}),children:t!==null&&r!==null?(0,D.jsxs)(`div`,{className:X.confirmBody,children:[(0,D.jsxs)(`div`,{className:X.confirmWho,children:[(0,D.jsx)(`span`,{className:X.confirmAvatar,style:E({"--avatar-color":t.color}),children:t.initials}),(0,D.jsxs)(`span`,{className:X.confirmWhoText,children:[(0,D.jsx)(`span`,{className:X.confirmName,children:t.name}),(0,D.jsx)(`span`,{className:X.confirmRole,children:t.role})]})]}),(0,D.jsxs)(A.div,{className:X.confirmRows,variants:h4,initial:`hidden`,animate:`visible`,children:[(0,D.jsx)(_4,{icon:(0,D.jsx)(Bn,{size:15}),label:`Date`,value:n}),(0,D.jsx)(_4,{icon:(0,D.jsx)(Qn,{size:15}),label:`Time`,value:u}),(0,D.jsx)(_4,{icon:(0,D.jsx)(lr,{size:15}),label:`Timezone`,value:`${i.city} · ${i.offset}`}),(0,D.jsx)(_4,{icon:(0,D.jsx)(oi,{size:15}),label:`Location`,value:`Online — link generated automatically`})]})]}):null})},y4={titleWrap:`_titleWrap_18nb9_3`,titleInput:`_titleInput_18nb9_7`},b4={hidden:{},visible:{transition:{staggerChildren:.04}}},x4=({contact:e,active:t,onSelect:n})=>(0,D.jsxs)(A.button,{type:`button`,layout:!0,variants:Vy,whileHover:{x:3},whileTap:{scale:.985},transition:{type:`spring`,stiffness:500,damping:34},className:T(X.contactRow,t&&X.contactActive),onClick:n,children:[(0,D.jsx)(`span`,{className:X.contactAvatar,style:E({"--avatar-color":e.color}),children:e.initials}),(0,D.jsxs)(`span`,{className:X.contactText,children:[(0,D.jsx)(`span`,{className:X.contactName,children:e.name}),(0,D.jsx)(`span`,{className:X.contactRole,children:e.role})]}),(0,D.jsx)(`span`,{className:T(X.contactCheck,t&&X.contactCheckOn),children:(0,D.jsx)(Kg,{children:t&&(0,D.jsx)(A.span,{className:X.contactCheckIcon,initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:`spring`,stiffness:500,damping:28},children:(0,D.jsx)(Wn,{size:11,strokeWidth:3})})})})]}),S4=({contacts:e,selectedId:t,search:n,onSearch:r,onSelect:i,mode:a=`1:1`,selectedIds:o=[],onSelectGroup:s,groupTitle:c=``,onGroupTitleChange:l})=>(0,D.jsxs)(`div`,{className:f4.col,children:[(0,D.jsxs)(`div`,{className:f4.colTitle,children:[(0,D.jsx)(`span`,{className:f4.stepDot,children:`1`}),` `,a===`group`?`Configure Group Event`:`Choose a person`]}),a===`group`&&l&&(0,D.jsx)(`div`,{className:y4.titleWrap,children:(0,D.jsx)(`input`,{type:`text`,className:T(X.searchInput,y4.titleInput),placeholder:`Group Event Title (e.g. Team Sync)`,value:c,onChange:e=>{l(e.target.value)}})}),(0,D.jsxs)(`div`,{className:X.search,children:[(0,D.jsx)(Hr,{size:14,className:X.searchIcon}),(0,D.jsx)(`input`,{type:`search`,className:X.searchInput,placeholder:`Search people…`,value:n,onChange:e=>{r(e.target.value)}})]}),(0,D.jsxs)(A.div,{className:X.contactList,variants:b4,initial:`hidden`,animate:`visible`,children:[(0,D.jsx)(Kg,{initial:!1,children:e.map(e=>(0,D.jsx)(x4,{contact:e,active:a===`group`?o.includes(e.id):t===e.id,onSelect:()=>{a===`group`&&s?s(o.includes(e.id)?o.filter(t=>t!==e.id):[...o,e.id]):i(e.id)}},e.id))}),e.length===0&&(0,D.jsx)(`p`,{className:X.contactEmpty,children:`No people match.`})]})]}),Z={wizardContainer:`_wizardContainer_pyr7v_8`,stepper:`_stepper_pyr7v_17`,stepItem:`_stepItem_pyr7v_27`,stepLine:`_stepLine_pyr7v_34`,stepLineActive:`_stepLineActive_pyr7v_40`,stepCircle:`_stepCircle_pyr7v_44`,stepCircleActive:`_stepCircleActive_pyr7v_60`,stepCircleDone:`_stepCircleDone_pyr7v_66`,stepText:`_stepText_pyr7v_72`,stepTextActive:`_stepTextActive_pyr7v_78`,wizardContent:`_wizardContent_pyr7v_83`,wizardRow:`_wizardRow_pyr7v_90`,wizardPanelLeft:`_wizardPanelLeft_pyr7v_96`,wizardPanelRight:`_wizardPanelRight_pyr7v_106`,timePanelLeft:`_timePanelLeft_pyr7v_114`,wizardList:`_wizardList_pyr7v_118`,timePanelRight:`_timePanelRight_pyr7v_128`,panelHeading:`_panelHeading_pyr7v_132`,wizardSearch:`_wizardSearch_pyr7v_139`,wizardListBtn:`_wizardListBtn_pyr7v_159`,wizardListBtnActive:`_wizardListBtnActive_pyr7v_176`,avatar:`_avatar_pyr7v_181`,avatarSmall:`_avatarSmall_pyr7v_193`,contactName:`_contactName_pyr7v_205`,contactRole:`_contactRole_pyr7v_211`,checkbox:`_checkbox_pyr7v_217`,checkboxActive:`_checkboxActive_pyr7v_228`,panelHeader:`_panelHeader_pyr7v_234`,badge:`_badge_pyr7v_246`,selectedGrid:`_selectedGrid_pyr7v_254`,selectedEmpty:`_selectedEmpty_pyr7v_274`,selectedEmptyIcon:`_selectedEmptyIcon_pyr7v_285`,selectedItemCard:`_selectedItemCard_pyr7v_291`,cardName:`_cardName_pyr7v_301`,cardRole:`_cardRole_pyr7v_310`,removeBtn:`_removeBtn_pyr7v_318`,attendeeStatusItem:`_attendeeStatusItem_pyr7v_337`,statusIndicator:`_statusIndicator_pyr7v_346`,statusIndicatorAvail:`_statusIndicatorAvail_pyr7v_353`,statusIndicatorBusy:`_statusIndicatorBusy_pyr7v_357`,statusIndicatorOoh:`_statusIndicatorOoh_pyr7v_361`,gridToolbar:`_gridToolbar_pyr7v_366`,datePickerInput:`_datePickerInput_pyr7v_377`,durationSelector:`_durationSelector_pyr7v_386`,durBtn:`_durBtn_pyr7v_394`,durBtnActive:`_durBtnActive_pyr7v_405`,legend:`_legend_pyr7v_411`,legendItem:`_legendItem_pyr7v_418`,dotAvail:`_dotAvail_pyr7v_425`,dotBusy:`_dotBusy_pyr7v_426`,dotOoh:`_dotOoh_pyr7v_427`,suggestedStrip:`_suggestedStrip_pyr7v_443`,suggestedRow:`_suggestedRow_pyr7v_449`,suggestedCard:`_suggestedCard_pyr7v_456`,suggestedCardActive:`_suggestedCardActive_pyr7v_472`,suggestedCardFree:`_suggestedCardFree_pyr7v_479`,gridEmpty:`_gridEmpty_pyr7v_489`,wizardConfirmContainer:`_wizardConfirmContainer_pyr7v_501`,confirmHeading:`_confirmHeading_pyr7v_509`,confirmSub:`_confirmSub_pyr7v_516`,confirmCard:`_confirmCard_pyr7v_522`,confirmRow:`_confirmRow_pyr7v_532`,confirmLabel:`_confirmLabel_pyr7v_540`,confirmVal:`_confirmVal_pyr7v_548`,confirmAttendeeBadge:`_confirmAttendeeBadge_pyr7v_554`,avatarTiny:`_avatarTiny_pyr7v_567`,wizardFooter:`_wizardFooter_pyr7v_580`,wizardBackBtn:`_wizardBackBtn_pyr7v_589`,wizardNextBtn:`_wizardNextBtn_pyr7v_609`,selectedStatusAlert:`_selectedStatusAlert_pyr7v_634`,successContainer:`_successContainer_pyr7v_647`,successHeader:`_successHeader_pyr7v_659`,successTitle:`_successTitle_pyr7v_667`,successSub:`_successSub_pyr7v_674`,successCard:`_successCard_pyr7v_680`,successRow:`_successRow_pyr7v_694`,successLabel:`_successLabel_pyr7v_707`,successVal:`_successVal_pyr7v_716`,successActions:`_successActions_pyr7v_725`,successBtn:`_successBtn_pyr7v_733`,successBtnPrimary:`_successBtnPrimary_pyr7v_743`,successBtnSecondary:`_successBtnSecondary_pyr7v_752`},C4={titleVal:`_titleVal_195yt_3`,inlineIcon:`_inlineIcon_195yt_8`,agendaVal:`_agendaVal_195yt_13`,lastRow:`_lastRow_195yt_17`,guestList:`_guestList_195yt_21`},w4=({d:e})=>{let t=e.selectedContactIds.map(t=>e.list.find(e=>e.id===t)),n=e.groupTitle.trim()===``?`Group Meeting`:e.groupTitle,r=e.selectedSlot?X2(e.selectedSlot.startUtc,e.selectedSlot.endUtc,e.tzId):`No time selected`,i=e.selectedSlot?Z2(e.selectedSlot.startUtc,e.tzId):e.dateLabel;return(0,D.jsxs)(`div`,{className:Z.wizardConfirmContainer,children:[(0,D.jsx)(`h3`,{className:Z.confirmHeading,children:`Review group meeting`}),(0,D.jsx)(`p`,{className:Z.confirmSub,children:`Ensure everything is correct before sending invitations.`}),(0,D.jsxs)(`div`,{className:Z.confirmCard,children:[(0,D.jsxs)(`div`,{className:Z.confirmRow,children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Title`}),(0,D.jsx)(`span`,{className:T(Z.confirmVal,C4.titleVal),children:n})]}),(0,D.jsxs)(`div`,{className:Z.confirmRow,children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Date & Time`}),(0,D.jsxs)(`span`,{className:Z.confirmVal,children:[i,` @ `,r,` (`,e.zone.offset,`)`]})]}),(0,D.jsxs)(`div`,{className:Z.confirmRow,children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Location`}),(0,D.jsxs)(`span`,{className:Z.confirmVal,children:[(0,D.jsx)(yr,{size:13,className:C4.inlineIcon}),e.groupLocation]})]}),e.groupDescription.trim()&&(0,D.jsxs)(`div`,{className:Z.confirmRow,children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Agenda`}),(0,D.jsx)(`span`,{className:T(Z.confirmVal,C4.agendaVal),children:e.groupDescription})]}),(0,D.jsxs)(`div`,{className:T(Z.confirmRow,C4.lastRow),children:[(0,D.jsx)(`span`,{className:Z.confirmLabel,children:`Invited Guests`}),(0,D.jsx)(`div`,{className:T(Z.confirmVal,C4.guestList),children:t.map(e=>e===void 0?null:(0,D.jsxs)(`span`,{className:Z.confirmAttendeeBadge,children:[(0,D.jsx)(`span`,{className:Z.avatarTiny,style:{backgroundColor:e.color},children:e.initials}),e.name]},e.id))})]})]})]})},T4={wizardDetailsForm:`_wizardDetailsForm_79bfd_3`,detailsHeading:`_detailsHeading_79bfd_11`,detailsSub:`_detailsSub_79bfd_18`,formGroup:`_formGroup_79bfd_24`,formLabel:`_formLabel_79bfd_28`,formInput:`_formInput_79bfd_37`,formTextarea:`_formTextarea_79bfd_54`},E4=({d:e})=>(0,D.jsxs)(`div`,{className:T4.wizardDetailsForm,children:[(0,D.jsx)(`h3`,{className:T4.detailsHeading,children:`Meeting details`}),(0,D.jsx)(`p`,{className:T4.detailsSub,children:`Add context to the invite so attendees know what to expect.`}),(0,D.jsxs)(`div`,{className:T4.formGroup,children:[(0,D.jsx)(`label`,{className:T4.formLabel,children:`MEETING TITLE *`}),(0,D.jsx)(`input`,{type:`text`,className:T4.formInput,placeholder:`e.g. Weekly Admissions Alignment`,value:e.groupTitle,onChange:t=>{e.setGroupTitle(t.target.value)}})]}),(0,D.jsxs)(`div`,{className:T4.formGroup,children:[(0,D.jsx)(`label`,{className:T4.formLabel,children:`LOCATION / TYPE *`}),(0,D.jsx)(`input`,{type:`text`,className:T4.formInput,placeholder:`e.g. Google Meet, Room 402`,value:e.groupLocation,onChange:t=>{e.setGroupLocation(t.target.value)}})]}),(0,D.jsxs)(`div`,{className:T4.formGroup,children:[(0,D.jsx)(`label`,{className:T4.formLabel,children:`AGENDA / DESCRIPTION`}),(0,D.jsx)(`textarea`,{className:T4.formTextarea,rows:5,placeholder:`What will you cover in this meeting? (optional)`,value:e.groupDescription,onChange:t=>{e.setGroupDescription(t.target.value)}})]})]}),D4={searchWrap:`_searchWrap_3i51q_3`,contactMeta:`_contactMeta_3i51q_7`,selectedMeta:`_selectedMeta_3i51q_13`},O4=({d:e,isSelected:t,onToggle:n})=>(0,D.jsxs)(`div`,{className:Z.wizardPanelLeft,children:[(0,D.jsxs)(`div`,{className:D4.searchWrap,children:[(0,D.jsx)(`h3`,{className:Z.panelHeading,children:`Add participants`}),(0,D.jsx)(`input`,{type:`text`,className:Z.wizardSearch,placeholder:`Search by name, role or department...`,value:e.search,onChange:t=>{e.setSearch(t.target.value)}})]}),(0,D.jsx)(`div`,{className:Z.wizardList,children:e.searchResults.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:T(Z.wizardListBtn,t(e.id)&&Z.wizardListBtnActive),onClick:()=>{n(e.id)},children:[(0,D.jsx)(`span`,{className:Z.avatar,style:{backgroundColor:e.color},children:e.initials}),(0,D.jsxs)(`div`,{className:D4.contactMeta,children:[(0,D.jsx)(`div`,{className:Z.contactName,children:e.name}),(0,D.jsx)(`div`,{className:Z.contactRole,children:e.role})]}),(0,D.jsx)(`div`,{className:T(Z.checkbox,t(e.id)&&Z.checkboxActive),children:t(e.id)&&(0,D.jsx)(Wn,{size:10,strokeWidth:3})})]},e.id))})]}),k4=({d:e,onToggle:t})=>(0,D.jsxs)(`div`,{className:Z.wizardPanelRight,children:[(0,D.jsxs)(`div`,{className:Z.panelHeader,children:[(0,D.jsx)(`span`,{children:`SELECTED`}),(0,D.jsxs)(`span`,{className:Z.badge,children:[String(e.selectedContactIds.length),` guests`]})]}),(0,D.jsx)(`div`,{className:Z.selectedGrid,children:(0,D.jsx)(Kg,{initial:!1,children:e.selectedContactIds.length===0?(0,D.jsxs)(A.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:Z.selectedEmpty,children:[(0,D.jsx)(ai,{size:22,className:Z.selectedEmptyIcon}),(0,D.jsx)(`span`,{children:`Select people on the left to add them to the meeting.`})]},`empty`):e.selectedContactIds.map(n=>{let r=e.list.find(e=>e.id===n);return r===void 0?null:(0,D.jsxs)(A.div,{layout:!0,initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.9,x:20},transition:{type:`spring`,stiffness:300,damping:25},className:Z.selectedItemCard,children:[(0,D.jsx)(`span`,{className:Z.avatarSmall,style:{backgroundColor:r.color},children:r.initials}),(0,D.jsxs)(`div`,{className:D4.selectedMeta,children:[(0,D.jsx)(`div`,{className:Z.cardName,children:r.name}),(0,D.jsx)(`div`,{className:Z.cardRole,children:r.role})]}),(0,D.jsx)(`button`,{type:`button`,className:Z.removeBtn,onClick:()=>{t(n)},children:(0,D.jsx)(ni,{size:13})})]},n)})})})]}),A4=({d:e})=>{let t=t=>e.selectedContactIds.includes(t),n=n=>{t(n)?e.setSelectedContactIds(e.selectedContactIds.filter(e=>e!==n)):e.setSelectedContactIds([...e.selectedContactIds,n])};return(0,D.jsxs)(`div`,{className:Z.wizardRow,children:[(0,D.jsx)(O4,{d:e,isSelected:t,onToggle:n}),(0,D.jsx)(k4,{d:e,onToggle:n})]})},j4={timelineContainer:`_timelineContainer_11xrs_3`,timelineHeaderRow:`_timelineHeaderRow_11xrs_18`,timelineTimeCell:`_timelineTimeCell_11xrs_27`,timelineHeaderCell:`_timelineHeaderCell_11xrs_38`,timelineBody:`_timelineBody_11xrs_52`,timelineRow:`_timelineRow_11xrs_57`,timelineTimeCellActive:`_timelineTimeCellActive_11xrs_75`,timelineCell:`_timelineCell_11xrs_81`,cellAvail:`_cellAvail_11xrs_90`,cellBusy:`_cellBusy_11xrs_94`,cellOoh:`_cellOoh_11xrs_98`,cellSelected:`_cellSelected_11xrs_109`,gridTooltip:`_gridTooltip_11xrs_114`},M4=30,N4=(e,t,n)=>{let r=WN(t,e.start,n);return{startUtc:r,endUtc:new Date(new Date(r).getTime()+M4*6e4).toISOString()}},P4=(e,t,n)=>{let r=new Date(new Date(n.startUtc).getTime()+e.groupDuration*6e4).toISOString();e.pickSlot({label:t,startUtc:n.startUtc,endUtc:r,conflicts:[]})},F4=({id:e,d:t,rowInstants:n,serverBusy:r,selfBounds:i,allBlocks:a})=>{let o=r.get(e);return o===void 0?t.selected===null?`ooh`:VZ({userId:e,selfUserId:t.viewer.id,slotStart:new Date(n.startUtc),slotEnd:new Date(n.endUtc),allBlocks:a,rangeStart:i.rangeStart,rangeEnd:i.rangeEnd,workWindows:i.workWindows}):G2(n.startUtc,n.endUtc,o.busy)?`busy`:o.workingHours.length>0&&!K2(n.startUtc,n.endUtc,o.workingHours)?`ooh`:`available`},I4=({id:e,slotItem:t,d:n,allBlocks:r,serverBusy:i,rowInstants:a,selfBounds:o,isSelected:s,hoverCell:c,setHoverCell:l})=>{let u=F4({id:e,d:n,rowInstants:a,serverBusy:i,selfBounds:o,allBlocks:r}),d=c!==null&&c.userId===e&&c.slotLabel===t.label;return(0,D.jsx)(`div`,{className:T(j4.timelineCell,u===`available`&&j4.cellAvail,u===`busy`&&j4.cellBusy,u===`ooh`&&j4.cellOoh,s&&j4.cellSelected),onClick:()=>{P4(n,t.label,a)},onMouseEnter:()=>{l({userId:e,slotLabel:t.label})},onMouseLeave:()=>{l(null)},children:d&&(0,D.jsxs)(`div`,{className:j4.gridTooltip,children:[(0,D.jsx)(`strong`,{children:$2(e,n.list,n.viewer)}),` ·`,` `,u.toUpperCase()]})})},L4=({slotItem:e,d:t,activeAttendees:n,allBlocks:r,serverBusy:i,isoDate:a,displayZone:o,selfBounds:s,hoverCell:c,setHoverCell:l})=>{let u=t.slot===e.label,d=N4(e,a,o),f=qN.from({pick:o}).formatTime(d.startUtc);return(0,D.jsxs)(`div`,{className:j4.timelineRow,children:[(0,D.jsx)(`button`,{type:`button`,className:T(j4.timelineTimeCell,u&&j4.timelineTimeCellActive),onClick:()=>{P4(t,e.label,d)},children:f}),n.map(n=>(0,D.jsx)(I4,{id:n,slotItem:e,d:t,allBlocks:r,serverBusy:i,rowInstants:d,selfBounds:s,isSelected:u,hoverCell:c,setHoverCell:l},n+`-`+e.label))]})},R4=({d:e,activeAttendees:t,allBlocks:n,serverBusy:r,isoDate:i,hoverCell:a,setHoverCell:o})=>{let s=e.tzId,c=t4(i,s,e.hostDayWindow),l=q2(n4(t,r,n,c));return(0,D.jsxs)(`div`,{className:j4.timelineContainer,children:[(0,D.jsxs)(`div`,{className:j4.timelineHeaderRow,children:[(0,D.jsx)(`div`,{className:j4.timelineTimeCell}),t.map(t=>(0,D.jsx)(`div`,{className:j4.timelineHeaderCell,children:$2(t,e.list,e.viewer)},t))]}),(0,D.jsx)(`div`,{className:j4.timelineBody,children:l.map(l=>(0,D.jsx)(L4,{slotItem:l,d:e,activeAttendees:t,allBlocks:n,serverBusy:r,isoDate:i,displayZone:s,selfBounds:c,hoverCell:a,setHoverCell:o},l.label))})]})},z4={header:`_header_1afpk_3`,slotNote:`_slotNote_1afpk_7`,cardMeta:`_cardMeta_1afpk_12`},B4=({userId:e,selfUserId:t,startStr:n,endStr:r,anchorTzId:i,isoDate:a,allBlocks:o,dayWindow:s})=>{let c=s?.active?s.slots.map(e=>({start:new Date(WN(a,e.from,i)),end:new Date(WN(a,e.to,i))})):[],l=new Date(WN(a,`00:00`,i)),u=new Date(l.getTime()+1440*60*1e3);return VZ({userId:e,selfUserId:t,slotStart:new Date(WN(a,n,i)),slotEnd:new Date(WN(a,r,i)),allBlocks:o,rangeStart:l,rangeEnd:u,workWindows:c})},V4=(e,t,n)=>{let{id:r,d:i,allBlocks:a,serverBusy:o,anchorTzId:s,isoDate:c}=e,l=i.hostDayWindow;if(i.selected===null||l===null)return`available`;let u=o.get(r);if(u!==void 0){let e=WN(c,t,s),r=WN(c,n,s);return G2(e,r,u.busy)?`busy`:u.workingHours.length>0&&!K2(e,r,u.workingHours)?`ooh`:`available`}return B4({userId:r,selfUserId:i.viewer.id,startStr:t,endStr:n,anchorTzId:s,isoDate:c,allBlocks:a,dayWindow:l})},H4=e=>{let{id:t,d:n,curSlot:r}=e,i=e4(t,n.list,n.viewer),[a,o]=r?r.split(` – `):[null,null],s=a&&o?V4(e,a,o):`available`;return(0,D.jsxs)(`div`,{className:Z.attendeeStatusItem,children:[(0,D.jsx)(`span`,{className:Z.avatarSmall,style:{backgroundColor:i.color},children:i.initials}),(0,D.jsxs)(`div`,{className:z4.cardMeta,children:[(0,D.jsx)(`div`,{className:Z.cardName,children:i.name}),(0,D.jsx)(`div`,{className:Z.cardRole,children:i.role})]}),(0,D.jsx)(`span`,{className:T(Z.statusIndicator,s===`available`&&Z.statusIndicatorAvail,s===`busy`&&Z.statusIndicatorBusy,s===`ooh`&&Z.statusIndicatorOoh)})]})},U4=({d:e,activeAttendees:t,curSlot:n,allBlocks:r,serverBusy:i,anchorTzId:a,isoDate:o})=>(0,D.jsxs)(`div`,{className:T(Z.wizardPanelLeft,Z.timePanelLeft),children:[(0,D.jsxs)(`div`,{className:z4.header,children:[(0,D.jsx)(`h3`,{className:Z.panelHeading,children:`Attendees Availability`}),(0,D.jsxs)(`span`,{className:z4.slotNote,children:[`For selected slot: `,n??`None`]})]}),(0,D.jsx)(`div`,{className:Z.wizardList,children:t.map(t=>(0,D.jsx)(H4,{id:t,d:e,curSlot:n,allBlocks:r,serverBusy:i,anchorTzId:a,isoDate:o},t))})]}),W4={toolbarGroup:`_toolbarGroup_1hpun_3`,toolbarLabel:`_toolbarLabel_1hpun_9`,suggestedHeader:`_suggestedHeader_1hpun_15`,suggestedTitle:`_suggestedTitle_1hpun_22`,freeBadge:`_freeBadge_1hpun_29`,slotTime:`_slotTime_1hpun_34`,noSlots:`_noSlots_1hpun_40`,emptyIcon:`_emptyIcon_1hpun_46`},G4=({suggestedOptions:e,slot:t,activeAttendeesCount:n,setSlot:r,tzId:i})=>(0,D.jsxs)(`div`,{className:Z.suggestedRow,children:[e.map(e=>{let a=t===e.label,o=n-e.conflicts.length,s=X2(e.startUtc,e.endUtc,i);return(0,D.jsxs)(`button`,{type:`button`,className:T(Z.suggestedCard,a&&Z.suggestedCardActive,e.conflicts.length===0&&Z.suggestedCardFree),onClick:()=>{r(e.label)},children:[(0,D.jsx)(`div`,{className:W4.freeBadge,children:e.conflicts.length===0?`ALL FREE`:`${String(o)}/${String(n)} FREE`}),(0,D.jsx)(`div`,{className:W4.slotTime,children:s})]},e.label)}),e.length===0&&(0,D.jsx)(`div`,{className:W4.noSlots,children:`No suggested slots found.`})]}),K4=({d:e})=>(0,D.jsxs)(`div`,{className:Z.gridToolbar,children:[(0,D.jsxs)(`div`,{className:W4.toolbarGroup,children:[(0,D.jsx)(Bn,{size:14,color:`var(--color-primary)`}),(0,D.jsx)(`input`,{type:`date`,className:Z.datePickerInput,value:e.selected?e.selected.toISOString().substring(0,10):``,onChange:t=>{t.target.value&&e.pickDate(new Date(t.target.value))}})]}),(0,D.jsxs)(`div`,{className:W4.toolbarGroup,children:[(0,D.jsx)(`span`,{className:W4.toolbarLabel,children:`DURATION`}),(0,D.jsx)(`div`,{className:Z.durationSelector,children:[30,60,90,120].map(t=>(0,D.jsx)(`button`,{type:`button`,className:T(Z.durBtn,e.groupDuration===t&&Z.durBtnActive),onClick:()=>{e.setGroupDuration(t)},children:t<60?`${String(t)}m`:`${String(t/60)}h`},t))})]}),(0,D.jsxs)(`div`,{className:Z.legend,children:[(0,D.jsxs)(`span`,{className:Z.legendItem,children:[(0,D.jsx)(`span`,{className:Z.dotAvail}),` Free`]}),(0,D.jsxs)(`span`,{className:Z.legendItem,children:[(0,D.jsx)(`span`,{className:Z.dotBusy}),` Busy`]}),(0,D.jsxs)(`span`,{className:Z.legendItem,children:[(0,D.jsx)(`span`,{className:Z.dotOoh}),` Out of hours`]})]})]}),q4=({d:e,activeAttendees:t,allBlocks:n,serverBusy:r,isoDate:i,hoverCell:a,setHoverCell:o})=>e.selected===null?(0,D.jsxs)(`div`,{className:Z.gridEmpty,children:[(0,D.jsx)(Qn,{size:28,className:W4.emptyIcon}),(0,D.jsx)(`span`,{children:`Select a date above to display the availability grid.`})]}):(0,D.jsx)(R4,{d:e,activeAttendees:t,allBlocks:n,serverBusy:r,isoDate:i,hoverCell:a,setHoverCell:o}),J4=e=>{let t=NN().data??[],r=JN().anchor,i=e.selected===null?null:J2(e.selected,e.today),a=SQ(e.selectedContactIds,i);return{allBlocks:t,anchorTzId:r,isoDate:i,serverBusy:(0,n.useMemo)(()=>{let e=new Map;for(let t of a.data??[])e.set(t.userId,{busy:t.busy,workingHours:t.workingHours});return e},[a.data]),activeAttendees:e.viewer.id===``?[...e.selectedContactIds]:[e.viewer.id,...e.selectedContactIds],curSlot:e.slot}},Y4=({d:e})=>{let{allBlocks:t,anchorTzId:r,isoDate:i,serverBusy:a,activeAttendees:o,curSlot:s}=J4(e),[c,l]=(0,n.useState)(null);return(0,D.jsxs)(`div`,{className:Z.wizardRow,children:[(0,D.jsx)(U4,{d:e,activeAttendees:o,curSlot:s,allBlocks:t,serverBusy:a,anchorTzId:r,isoDate:i??``}),(0,D.jsxs)(`div`,{className:T(Z.wizardPanelRight,Z.timePanelRight),children:[(0,D.jsx)(K4,{d:e}),(0,D.jsxs)(`div`,{className:Z.suggestedStrip,children:[(0,D.jsxs)(`div`,{className:W4.suggestedHeader,children:[(0,D.jsx)(Xr,{size:12,color:`var(--color-secondary)`}),(0,D.jsx)(`span`,{className:W4.suggestedTitle,children:`SUGGESTED TIMESLOTS`})]}),(0,D.jsx)(G4,{suggestedOptions:e.availableSlots.slice(0,4),slot:e.slot,activeAttendeesCount:o.length,setSlot:e.setSlot,tzId:e.tzId})]}),(0,D.jsx)(q4,{d:e,activeAttendees:o,allBlocks:t,serverBusy:a,isoDate:i??``,hoverCell:c,setHoverCell:l})]})]})},X4=()=>{let[e,t]=(0,n.useState)(`participants`),[r,i]=(0,n.useState)(30),[a,o]=(0,n.useState)(`Online Meeting`),[s,c]=(0,n.useState)(``);return{groupStep:e,groupDuration:r,groupLocation:a,groupDescription:s,setGroupStep:t,setGroupDuration:i,setGroupLocation:o,setGroupDescription:c,resetGroupWizardState:()=>{t(`participants`),i(30),o(`Online Meeting`),c(``)}}},Z4=(e,t,n,r)=>{let i=e.s.meetingType===`group`;return{contactId:i?e.s.selectedContactIds[0]??``:e.s.contactId??``,dateLabel:l4(t),slot:n,title:i?e.s.groupTitle||`Group Meeting`:void 0,isGroup:i,attendeeIds:i?e.s.selectedContactIds:void 0,location:i?e.gw.groupLocation:void 0,description:i?e.gw.groupDescription:void 0,isoDate:J2(t,e.today),startUtc:r?.startUtc,endUtc:r?.endUtc}},Q4=e=>e.s.pickedSlot??(e.s.slot===null?null:e.availableSlots.find(t=>t.label===e.s.slot)??null),$4=e=>()=>{if(e.s.slot===null||e.s.selected===null)return;let t=Q4(e);e.book.mutate(Z4(e,e.s.selected,e.s.slot,t),{onSuccess:()=>{e.s.setBookedSlot(t),e.s.setSlot(null),e.s.setPickedSlot(null),e.s.setConfirmOpen(!1)},onError:e=>{j.error(e.message)}})},e3=e=>({setMeetingType:t=>{e.s.setMeetingType(t),t===`group`&&e.resetGroupWizard()},setContactId:t=>{e.s.setContactId(t),e.s.setSlot(null),e.s.setPickedSlot(null)},setSelectedContactIds:t=>{e.s.setSelectedContactIds(t),e.s.setSlot(null),e.s.setPickedSlot(null)},setGroupTitle:e.s.setGroupTitle,setSearch:e.s.setSearch,setTzId:e.setTzId,setSlot:t=>{e.s.setSlot(t),e.s.setPickedSlot(null)},pickSlot:t=>{e.s.setSlot(t.label),e.s.setPickedSlot(t)},setConfirmOpen:e.s.setConfirmOpen,shift:t=>{e.s.setView(e=>({year:e.year+Math.floor((e.month+t)/12),month:((e.month+t)%12+12)%12}))},pickDate:t=>{e.s.setSelected(t),e.s.setSlot(null),e.s.setPickedSlot(null)},setGroupStep:e.gw.setGroupStep,setGroupDuration:e.gw.setGroupDuration,setGroupLocation:e.gw.setGroupLocation,setGroupDescription:e.gw.setGroupDescription,resetGroupWizard:e.resetGroupWizard,reset:e.reset,confirm:$4(e)}),t3=e=>{let t=e3(e);return{today:e.today,viewer:e.viewer,meetingType:e.s.meetingType,contactId:e.s.contactId,selectedContactIds:e.s.selectedContactIds,groupTitle:e.s.groupTitle,search:e.s.search,tzId:e.tzId,view:e.s.view,selected:e.s.selected,slot:e.s.slot,selectedSlot:Q4(e),bookedSlot:e.s.bookedSlot,confirmOpen:e.s.confirmOpen,list:e.list,searchResults:e.searchResults,contact:e.contact,dateLabel:e.s.selected===null?``:l4(e.s.selected),zone:FZ(e.tzId),canBook:(e.s.meetingType===`1:1`?e.s.contactId!==null:e.s.selectedContactIds.length>0)&&e.s.selected!==null&&e.s.slot!==null&&!e.book.isPending,pending:e.book.isPending,success:e.book.isSuccess,availableSlots:e.availableSlots,hostDayWindow:e.hostDayWindow,groupStep:e.gw.groupStep,groupDuration:e.gw.groupDuration,groupLocation:e.gw.groupLocation,groupDescription:e.gw.groupDescription,...t}},n3=(e,t)=>{let[r,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let n=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(n)}},[e,t]),r},r3=e=>`${String(e.getFullYear())}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,i3=e=>{let t=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],n={};for(let r of t)n[r]={active:e[r].active,slots:e[r].active?[{id:r+`-default`,from:e[r].from,to:e[r].to}]:[]};return n},a3=(e,t)=>e.selected===null?null:e.meetingType===`group`?e.selectedContactIds.length===0?null:{isoDate:r3(e.selected),timeZone:t,isGroup:!0,contactId:void 0,attendeeIds:[...e.selectedContactIds].sort()}:e.contactId===null?null:{isoDate:r3(e.selected),timeZone:t,isGroup:!1,contactId:e.contactId,attendeeIds:void 0},o3=e=>{let[t,r]=(0,n.useState)(`1:1`),[i,a]=(0,n.useState)(null),[o,s]=(0,n.useState)([]),[c,l]=(0,n.useState)(``),[u,d]=(0,n.useState)(``),[f,p]=(0,n.useState)(``),[m,h]=(0,n.useState)({year:e.getFullYear(),month:e.getMonth()}),[g,_]=(0,n.useState)(null),[v,y]=(0,n.useState)(null),[b,x]=(0,n.useState)(null),[S,C]=(0,n.useState)(null),[ee,te]=(0,n.useState)(!1);return{meetingType:t,setMeetingType:r,contactId:i,setContactId:a,selectedContactIds:o,setSelectedContactIds:s,groupTitle:c,setGroupTitle:l,search:u,setSearch:d,tzId:f,setTzIdState:p,view:m,setView:h,selected:g,setSelected:_,slot:v,setSlot:y,pickedSlot:b,setPickedSlot:x,bookedSlot:S,setBookedSlot:C,confirmOpen:ee,setConfirmOpen:te}},s3=()=>{let e=CQ(),t=W2(),n=new Date,r=X4(),i=o3(n),a=n3(i.search,250),o=yQ(),s=yQ(a),c=LN(),l=AN(),u=pR(),d=o.data??[],f=d,p=s.data??[],m=d.find(e=>e.id===i.contactId)??null,h=c.data??{meetingDuration:r.groupDuration,bufferMinutes:5,workStart:`09:00`,workEnd:`17:00`,timezone:`Europe/London`,branchId:`uk`,availabilityTimezone:`Europe/London`},g=qN.from({pick:i.tzId,personal:h.timezone,anchor:h.availabilityTimezone}).display,_=u.data?i3(kI(u.data,h.branchId)):null,v=pO(l.data??null,_),y=i.selected===null?null:mO(v,i.selected);return t3({today:n,viewer:t,s:i,gw:r,book:e,list:f,searchResults:p,contact:m,availableSlots:xQ(a3(i,g)).data??[],hostDayWindow:y,tzId:g,setTzId:e=>{i.setTzIdState(e)},resetGroupWizard:()=>{r.resetGroupWizardState(),i.setSelectedContactIds([]),i.setGroupTitle(``),i.setSlot(null),i.setPickedSlot(null),i.setSelected(null)},reset:()=>{e.reset(),i.setContactId(null),i.setSelectedContactIds([]),i.setGroupTitle(``),i.setSlot(null),i.setPickedSlot(null),i.setBookedSlot(null),i.setSelected(null),r.resetGroupWizardState()}})},c3={wizardContentClip:`_wizardContentClip_14i7n_3`,wizardStep:`_wizardStep_14i7n_8`},l3=({currentStep:e})=>{let t=[{id:`participants`,label:`Participants`},{id:`time`,label:`Find a time`},{id:`details`,label:`Details`},{id:`confirm`,label:`Confirm`}],r=(e=>t.findIndex(t=>t.id===e))(e);return(0,D.jsx)(`div`,{className:Z.stepper,children:t.map((e,t)=>{let i=t<r,a=t===r;return(0,D.jsxs)(n.Fragment,{children:[t>0&&(0,D.jsx)(`div`,{className:T(Z.stepLine,t<=r&&Z.stepLineActive)}),(0,D.jsxs)(`div`,{className:Z.stepItem,children:[(0,D.jsx)(`div`,{className:T(Z.stepCircle,a&&Z.stepCircleActive,i&&Z.stepCircleDone),children:i?(0,D.jsx)(Wn,{size:12,strokeWidth:3}):t+1}),(0,D.jsx)(`span`,{className:T(Z.stepText,a&&Z.stepTextActive),children:e.label})]})]},e.id)})})},u3=e=>e===`participants`?`time`:e===`time`?`details`:e===`details`?`confirm`:null,d3=e=>e===`time`?`participants`:e===`details`?`time`:e===`confirm`?`details`:null,f3=({step:e,selectedContactIds:t,slot:n,title:r,location:i,pending:a})=>e===`participants`?t.length===0:e===`time`?n===null:e===`details`?r.trim()===``||i.trim()===``:a,p3=e=>e===`participants`?`Next: Find a time`:e===`time`?`Next: Details`:e===`details`?`Next: Confirm`:`Confirm Booking`,m3=({d:e})=>{let t=()=>{let t=d3(e.groupStep);t?e.setGroupStep(t):e.setMeetingType(`1:1`)},n=()=>{let t=u3(e.groupStep);t?e.setGroupStep(t):e.confirm()},r=f3({step:e.groupStep,selectedContactIds:e.selectedContactIds,slot:e.slot,title:e.groupTitle,location:e.groupLocation,pending:e.pending}),i=p3(e.groupStep);return(0,D.jsxs)(`div`,{className:Z.wizardContainer,children:[(0,D.jsx)(l3,{currentStep:e.groupStep}),(0,D.jsx)(`div`,{className:T(Z.wizardContent,c3.wizardContentClip),children:(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsxs)(A.div,{initial:{opacity:0,x:15},animate:{opacity:1,x:0},exit:{opacity:0,x:-15},transition:{duration:.18,ease:`easeInOut`},className:c3.wizardStep,children:[e.groupStep===`participants`&&(0,D.jsx)(A4,{d:e}),e.groupStep===`time`&&(0,D.jsx)(Y4,{d:e}),e.groupStep===`details`&&(0,D.jsx)(E4,{d:e}),e.groupStep===`confirm`&&(0,D.jsx)(w4,{d:e})]},e.groupStep)})}),(0,D.jsxs)(`div`,{className:Z.wizardFooter,children:[(0,D.jsxs)(`button`,{type:`button`,className:Z.wizardBackBtn,onClick:t,disabled:e.pending,children:[(0,D.jsx)(Kn,{size:16}),` Back`]}),e.groupStep===`time`&&e.slot&&(0,D.jsxs)(`div`,{className:Z.selectedStatusAlert,children:[(0,D.jsx)(Yn,{size:14,color:`var(--color-primary)`}),(0,D.jsxs)(`span`,{children:[`Selected: `,e.slot]})]}),(0,D.jsxs)(`button`,{type:`button`,className:Z.wizardNextBtn,disabled:r||e.pending,onClick:n,children:[e.pending?`Booking...`:i,!e.pending&&(0,D.jsx)(qn,{size:16})]})]})]})},h3={slotsDate:`_slotsDate_1rdif_3`,slotsEmpty:`_slotsEmpty_1rdif_10`,slotsEmptyIcon:`_slotsEmptyIcon_1rdif_24`,slotsEmptyTitle:`_slotsEmptyTitle_1rdif_36`,slotList:`_slotList_1rdif_42`,slot:`_slot_1rdif_3`,slotActive:`_slotActive_1rdif_86`,slotWithConflicts:`_slotWithConflicts_1rdif_102`,slotMain:`_slotMain_1rdif_113`,slotConflictList:`_slotConflictList_1rdif_120`,conflictLabel:`_conflictLabel_1rdif_131`,conflictAvatar:`_conflictAvatar_1rdif_136`,noSlots:`_noSlots_1rdif_162`},g3={hidden:{},visible:{transition:{staggerChildren:.03}}},_3=`You're not available at this time — you can still book.`,v3=({option:e,isSelected:t,onSlot:n,contactsList:r,viewer:i,tzId:a})=>{let o=X2(e.startUtc,e.endUtc,a),s=e.conflicts.length>0,c=e.conflicts.includes(i.id);return(0,D.jsxs)(A.button,{type:`button`,variants:Vy,whileTap:{scale:.97},className:T(h3.slot,t&&h3.slotActive,s&&!t&&h3.slotWithConflicts),title:c?_3:void 0,onClick:()=>{n(e.label)},children:[(0,D.jsxs)(`div`,{className:h3.slotMain,children:[(0,D.jsx)(`span`,{children:o}),t&&(0,D.jsx)(Wn,{size:14,strokeWidth:3})]}),s&&(0,D.jsxs)(`div`,{className:h3.slotConflictList,children:[(0,D.jsx)(`span`,{className:h3.conflictLabel,children:c?`You're busy —`:`Conflict:`}),e.conflicts.map(e=>{let t=e===i.id,n=r.find(t=>t.id===e);return(0,D.jsx)(`span`,{className:h3.conflictAvatar,title:t?_3:`${n?.name??``} is busy / unavailable`,children:t?i.initials||`YOU`:n?.initials??``},e)})]})]})},y3=({dateLabel:e,slot:t,offset:n,onSlot:r,slots:i,contactsList:a,viewer:o,tzId:s})=>(0,D.jsxs)(`div`,{className:f4.col,children:[(0,D.jsxs)(`div`,{className:f4.colTitle,children:[(0,D.jsx)(`span`,{className:f4.stepDot,children:`3`}),` Available times`]}),e===``?(0,D.jsxs)(`div`,{className:h3.slotsEmpty,children:[(0,D.jsx)(`span`,{className:h3.slotsEmptyIcon,children:(0,D.jsx)(Qn,{size:28})}),(0,D.jsx)(`span`,{className:h3.slotsEmptyTitle,children:`Pick a date`}),(0,D.jsx)(`span`,{children:`Choose a day to see open times.`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:h3.slotsDate,children:[e,` · times in `,n]}),(0,D.jsxs)(A.div,{className:h3.slotList,variants:g3,initial:`hidden`,animate:`visible`,children:[i.map(e=>(0,D.jsx)(v3,{option:e,isSelected:t===e.label,onSlot:r,contactsList:a,viewer:o,tzId:s},e.label)),i.length===0&&(0,D.jsx)(`div`,{className:h3.noSlots,children:`No available timeslots found for this day.`})]})]})]}),b3={tzWrap:`_tzWrap_n6w9w_3`,tzBtn:`_tzBtn_n6w9w_8`,tzBtnOffset:`_tzBtnOffset_n6w9w_30`,tzChevron:`_tzChevron_n6w9w_36`,tzBackdrop:`_tzBackdrop_n6w9w_40`,tzPop:`_tzPop_n6w9w_49`,tzSearch:`_tzSearch_n6w9w_62`,tzSearchInput:`_tzSearchInput_n6w9w_74`,tzList:`_tzList_n6w9w_84`,tzRow:`_tzRow_n6w9w_119`,tzRowActive:`_tzRowActive_n6w9w_138`,tzCity:`_tzCity_n6w9w_142`,tzRowOffset:`_tzRowOffset_n6w9w_151`,tzCheck:`_tzCheck_n6w9w_157`,tzEmpty:`_tzEmpty_n6w9w_161`},x3=({search:e,list:t,value:n,onSearch:r,onPick:i})=>(0,D.jsxs)(A.div,{className:b3.tzPop,variants:Hy,initial:`hidden`,animate:`visible`,exit:`exit`,children:[(0,D.jsxs)(`div`,{className:b3.tzSearch,children:[(0,D.jsx)(Hr,{size:13}),(0,D.jsx)(`input`,{className:b3.tzSearchInput,placeholder:`Search timezones…`,value:e,onChange:e=>{r(e.target.value)}})]}),(0,D.jsxs)(`div`,{className:b3.tzList,children:[t.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:T(b3.tzRow,e.id===n&&b3.tzRowActive),onClick:()=>{i(e.id)},children:[(0,D.jsx)(`span`,{className:b3.tzCity,children:e.city}),(0,D.jsx)(`span`,{className:b3.tzRowOffset,children:e.offset}),e.id===n&&(0,D.jsx)(Wn,{size:13,className:b3.tzCheck})]},e.id)),t.length===0&&(0,D.jsx)(`p`,{className:b3.tzEmpty,children:`No timezones match.`})]})]}),S3=({value:e,onChange:t})=>{let[r,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(``),s=FZ(e),c=a.trim().toLowerCase(),l=(jZ.some(e=>e.id===s.id)?jZ:[s,...jZ]).filter(e=>c===``||e.city.toLowerCase().includes(c)||e.offset.toLowerCase().includes(c)||e.id.toLowerCase().includes(c));return(0,D.jsxs)(`div`,{className:b3.tzWrap,children:[(0,D.jsxs)(`button`,{type:`button`,className:b3.tzBtn,"aria-expanded":r,"aria-label":`Change timezone`,onClick:()=>{i(e=>!e)},children:[(0,D.jsx)(lr,{size:13}),(0,D.jsx)(`span`,{className:b3.tzBtnCity,children:s.city}),(0,D.jsx)(`span`,{className:b3.tzBtnOffset,children:s.offset}),(0,D.jsx)(Gn,{size:13,className:b3.tzChevron})]}),(0,D.jsx)(Kg,{children:r&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:b3.tzBackdrop,"aria-label":`Close timezone picker`,onClick:()=>{i(!1)}}),(0,D.jsx)(x3,{search:a,list:l,value:e,onSearch:o,onPick:e=>{t(e),o(``),i(!1)}})]})})]})},C3={badgeWrap:`_badgeWrap_swq6w_3`,badgeCircle:`_badgeCircle_swq6w_10`,guestRow:`_guestRow_swq6w_21`,eventVal:`_eventVal_swq6w_28`,iconRow:`_iconRow_swq6w_33`,iconRowMuted:`_iconRowMuted_swq6w_39`,iconRowTop:`_iconRowTop_swq6w_47`,agendaVal:`_agendaVal_swq6w_53`,iconTop:`_iconTop_swq6w_58`},w3=()=>(0,D.jsxs)(`div`,{className:Z.successHeader,children:[(0,D.jsx)(`div`,{className:C3.badgeWrap,children:(0,D.jsx)(A.div,{initial:{scale:0},animate:{scale:1},transition:{type:`spring`,stiffness:260,damping:20},className:C3.badgeCircle,children:(0,D.jsx)(A.div,{initial:{scale:0,rotate:-45},animate:{scale:1,rotate:0},transition:{delay:.2,type:`spring`,stiffness:200,damping:15},children:(0,D.jsx)(Wn,{size:32,color:`var(--color-success)`,strokeWidth:3})})})}),(0,D.jsx)(`h2`,{className:Z.successTitle,children:`Booking Confirmed!`}),(0,D.jsx)(`p`,{className:Z.successSub,children:`A calendar invite has been sent to all participants.`})]}),T3=({d:e})=>{let t=e.meetingType===`group`;return(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:t?`Invited Guests`:`Attendee`}),(0,D.jsx)(`div`,{className:T(Z.successVal,C3.guestRow),children:t?e.selectedContactIds.map(t=>{let n=e.list.find(e=>e.id===t);return n===void 0?null:(0,D.jsxs)(`span`,{className:Z.confirmAttendeeBadge,children:[(0,D.jsx)(`span`,{className:Z.avatarTiny,style:{backgroundColor:n.color},children:n.initials}),n.name]},n.id)}):e.contact?(0,D.jsxs)(`span`,{className:Z.confirmAttendeeBadge,children:[(0,D.jsx)(`span`,{className:Z.avatarTiny,style:{backgroundColor:e.contact.color},children:e.contact.initials}),e.contact.name]}):`None`})]})},E3=({d:e})=>{let t=e.meetingType===`group`,n=t?e.groupTitle||`Group Meeting`:`1:1 with ${e.contact?.name??`Attendee`}`,r=t?e.groupLocation:`Online — link generated automatically`,i=t?e.groupDescription:``,a=X2(e.bookedSlot?.startUtc,e.bookedSlot?.endUtc,e.tzId);return(0,D.jsxs)(A.div,{className:Z.successCard,initial:{opacity:0,y:15},animate:{opacity:1,y:0},transition:{delay:.3,duration:.25,ease:`easeOut`},children:[(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:`Event`}),(0,D.jsx)(`span`,{className:T(Z.successVal,C3.eventVal),children:n})]}),(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:`Date & Time`}),(0,D.jsxs)(`span`,{className:Z.successVal,children:[(0,D.jsxs)(`span`,{className:C3.iconRow,children:[(0,D.jsx)(Bn,{size:14,color:`var(--color-primary)`}),e.dateLabel]}),(0,D.jsxs)(`span`,{className:C3.iconRowMuted,children:[(0,D.jsx)(Qn,{size:14}),a,` (`,e.zone.offset,`)`]})]})]}),(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:`Location`}),(0,D.jsx)(`span`,{className:Z.successVal,children:(0,D.jsxs)(`span`,{className:C3.iconRow,children:[(0,D.jsx)(yr,{size:14,color:`var(--color-primary)`}),r]})})]}),(0,D.jsx)(T3,{d:e}),t&&i.trim()!==``&&(0,D.jsxs)(`div`,{className:Z.successRow,children:[(0,D.jsx)(`span`,{className:Z.successLabel,children:`Agenda`}),(0,D.jsx)(`span`,{className:T(Z.successVal,C3.agendaVal),children:(0,D.jsxs)(`span`,{className:C3.iconRowTop,children:[(0,D.jsx)(ei,{size:14,className:C3.iconTop}),i]})})]})]})},D3=({d:e,onViewScheduled:t})=>(0,D.jsxs)(`div`,{className:Z.successActions,children:[(0,D.jsx)(`button`,{type:`button`,className:T(Z.successBtn,Z.successBtnPrimary),onClick:()=>{t!==void 0&&t()},children:`View Scheduled Meetings`}),(0,D.jsx)(`button`,{type:`button`,className:T(Z.successBtn,Z.successBtnSecondary),onClick:()=>{e.reset()},children:`Book Another Meeting`})]}),O3=({d:e,onViewScheduled:t})=>(0,D.jsxs)(`div`,{className:Z.successContainer,children:[(0,D.jsx)(w3,{}),(0,D.jsx)(E3,{d:e}),(0,D.jsx)(D3,{d:e,onViewScheduled:t})]}),k3=({d:e})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:X.bookGrid,children:[(0,D.jsx)(S4,{contacts:e.searchResults,selectedId:e.contactId,search:e.search,onSearch:t=>{e.setSearch(t)},onSelect:t=>{e.setContactId(t)},mode:e.meetingType,selectedIds:e.selectedContactIds,onSelectGroup:t=>{e.setSelectedContactIds(t)},groupTitle:e.groupTitle,onGroupTitleChange:t=>{e.setGroupTitle(t)}}),(0,D.jsx)(m4,{view:e.view,today:e.today,selected:e.selected,onShift:t=>{e.shift(t)},onPick:t=>{e.pickDate(t)}}),(0,D.jsx)(y3,{dateLabel:e.dateLabel,slot:e.slot,offset:e.zone.offset,onSlot:t=>{e.setSlot(t)},slots:e.availableSlots,contactsList:e.list,viewer:e.viewer,tzId:e.tzId})]}),(0,D.jsx)(o4,{contact:e.contact,dateLabel:e.dateLabel,slot:e.slot,canBook:e.canBook,success:e.success,meetingType:e.meetingType,selectedContactIds:e.selectedContactIds,groupTitle:e.groupTitle,onBook:()=>{e.setConfirmOpen(!0)},selectedSlot:e.selectedSlot,tzId:e.tzId}),(0,D.jsx)(v4,{open:e.confirmOpen,contact:e.contact,dateLabel:e.dateLabel,slot:e.slot,zone:e.zone,pending:e.pending,onConfirm:()=>{e.confirm()},onClose:()=>{e.setConfirmOpen(!1)},selectedSlot:e.selectedSlot,tzId:e.tzId})]}),A3=({onViewScheduled:e})=>{let t=s3();return t.success?(0,D.jsx)(O3,{d:t,onViewScheduled:e}):(0,D.jsxs)(`div`,{className:X.bookCard,children:[(0,D.jsxs)(`div`,{className:X.bookTopBar,children:[(0,D.jsxs)(`div`,{className:X.typeSelector,children:[(0,D.jsx)(`button`,{type:`button`,className:T(X.typeBtn,t.meetingType===`1:1`&&X.typeBtnActive),onClick:()=>{t.setMeetingType(`1:1`)},children:`1:1 Meeting`}),(0,D.jsx)(`button`,{type:`button`,className:T(X.typeBtn,t.meetingType===`group`&&X.typeBtnActive),onClick:()=>{t.setMeetingType(`group`)},children:`Group Meeting (1:Many)`})]}),(0,D.jsx)(S3,{value:t.tzId,onChange:e=>{t.setTzId(e)}})]}),t.meetingType===`group`?(0,D.jsx)(m3,{d:t}):(0,D.jsx)(k3,{d:t})]})},j3={schedWrap:`_schedWrap_1p5xn_4`,bucketTabs:`_bucketTabs_1p5xn_11`,bucketTab:`_bucketTab_1p5xn_11`,bucketTabActive:`_bucketTabActive_1p5xn_38`,bucketBg:`_bucketBg_1p5xn_45`,bucketLabel:`_bucketLabel_1p5xn_53`,bucketCount:`_bucketCount_1p5xn_58`,meetingList:`_meetingList_1p5xn_76`,meeting:`_meeting_1p5xn_76`,datePlate:`_datePlate_1p5xn_101`,datePlatePassed:`_datePlatePassed_1p5xn_114`,datePlateCanceled:`_datePlateCanceled_1p5xn_118`,datePlateMonth:`_datePlateMonth_1p5xn_122`,datePlateDay:`_datePlateDay_1p5xn_129`,meetingAvatar:`_meetingAvatar_1p5xn_141`,meetingBody:`_meetingBody_1p5xn_155`,meetingTitle:`_meetingTitle_1p5xn_163`,meetingMeta:`_meetingMeta_1p5xn_169`,meetingMetaItem:`_meetingMetaItem_1p5xn_178`,meetingActions:`_meetingActions_1p5xn_184`,acceptBtn:`_acceptBtn_1p5xn_191`,joinBtn:`_joinBtn_1p5xn_192`,joinBtnDisabled:`_joinBtnDisabled_1p5xn_209`,declineBtn:`_declineBtn_1p5xn_217`,cancelBtn:`_cancelBtn_1p5xn_228`,cancelBtnDisabled:`_cancelBtnDisabled_1p5xn_239`,statusPill:`_statusPill_1p5xn_247`,statusAccepted:`_statusAccepted_1p5xn_257`,statusPending:`_statusPending_1p5xn_262`,statusRejected:`_statusRejected_1p5xn_267`,statusCanceled:`_statusCanceled_1p5xn_268`,statusCompleted:`_statusCompleted_1p5xn_273`,empty:`_empty_1p5xn_278`,emptyIconWrap:`_emptyIconWrap_1p5xn_288`,emptyTitle:`_emptyTitle_1p5xn_300`,emptyText:`_emptyText_1p5xn_307`},M3=e=>e.isGroup?e.title===``||/^group (meeting|event)$/i.test(e.title.trim())?`Group Meeting`:`${e.title} · Group Meeting`:/^1:1\b/i.test(e.title.trim())||e.title===``?`1:1 with ${e.withName}`:e.withName===``?e.title:`${e.title} · ${e.withName}`,N3=e=>e===`accepted`?`Accepted`:e===`rejected`?`Declined`:`Pending`,P3=1800*1e3,F3=e=>{let t=Math.max(1,Math.ceil(e/6e4)),n=Math.floor(t/1440);if(n>=1){let e=Math.floor((t-n*60*24)/60);return e>0?`in ${String(n)}d ${String(e)}h`:`in ${String(n)}d`}let r=Math.floor(t/60),i=t%60;return r>=1?i>0?`in ${String(r)}h ${String(i)}m`:`in ${String(r)}h`:`in ${String(i)}m`},I3=({onRespond:e})=>(0,D.jsxs)(`div`,{className:j3.meetingActions,children:[(0,D.jsxs)(`button`,{type:`button`,className:j3.acceptBtn,onClick:()=>{e(!0)},children:[(0,D.jsx)(Wn,{size:12,strokeWidth:3}),` Accept`]}),(0,D.jsx)(`button`,{type:`button`,className:j3.declineBtn,onClick:()=>{e(!1)},children:`Decline`})]}),L3=e=>e===`accepted`?j3.statusAccepted??!1:e===`rejected`?j3.statusRejected??!1:j3.statusPending??!1,R3=({meeting:e,onCancel:t,onJoin:n,canJoin:r,joinHint:i})=>{let a=r$(e=>e.activeMeeting),o=r$(e=>e.isJoined)&&a!==null&&a.meetingId===e.id,s=e.myStatus===`accepted`,c=!r||o,l=o?`You are currently in this meeting`:i,u=o?`Leave the active call before canceling`:`Cancel meeting`;return(0,D.jsxs)(`div`,{className:j3.meetingActions,children:[(0,D.jsx)(`span`,{className:T(j3.statusPill,L3(e.myStatus)),children:N3(e.myStatus)}),s&&(0,D.jsx)(DE,{label:l,side:`top`,children:(0,D.jsxs)(`button`,{type:`button`,className:T(j3.joinBtn,c&&j3.joinBtnDisabled),disabled:c,"aria-label":l,onClick:n,children:[(0,D.jsx)(oi,{size:13}),` `,o?`Joined`:`Join`]})}),e.isOrganizer&&(0,D.jsx)(DE,{label:u,side:`top`,children:(0,D.jsx)(`button`,{type:`button`,className:T(j3.cancelBtn,o&&j3.cancelBtnDisabled),disabled:o,"aria-label":u,onClick:t,children:`Cancel`})})]})},z3=e=>{let{meeting:t,onRespond:n}=e;return t.awaitingResponse?(0,D.jsx)(I3,{onRespond:n}):t.bucket===`canceled`?(0,D.jsx)(`span`,{className:T(j3.statusPill,j3.statusCanceled),children:`Canceled`}):t.bucket===`passed`?(0,D.jsx)(`span`,{className:T(j3.statusPill,j3.statusCompleted),children:`Completed`}):(0,D.jsx)(R3,{...e})},B3=(e,t)=>({month:e.toLocaleDateString(`en-US`,{month:`short`,timeZone:t}).toUpperCase(),day:e.toLocaleDateString(`en-US`,{day:`numeric`,timeZone:t})}),V3=(e,t)=>{let[r,i]=(0,n.useState)(()=>Date.now());(0,n.useEffect)(()=>{let e=setInterval(()=>{i(Date.now())},3e4);return()=>{clearInterval(e)}},[]);let a=r>=e-P3&&r<=t;return{canJoin:a,joinHint:a?`Join the meeting`:r>t?`This meeting has ended`:`Join opens 30 min before — starts ${F3(e-r)}`}},H3=e=>{let{meeting:t}=e,r=JN(),i=new Date(t.startUtc),a=new Date(t.endUtc),o=r.formatTime(t.startUtc),s=r.formatTime(t.endUtc),c=B3(i,r.display),l=` (${FZ(r.display).offset})`,{canJoin:u,joinHint:d}=V3(i.getTime(),a.getTime()),f=(0,n.useRef)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{p.current=document.getElementById(`app-scroll-container`)},[]);let{scrollYProgress:m}=My({target:f,container:p,offset:[`start end`,`end start`]}),h=Iy(m,[0,1],[-8,8]);return(0,D.jsxs)(A.article,{ref:f,style:{y:h},className:j3.meeting,variants:Vy,whileHover:{y:-2},transition:{type:`spring`,stiffness:400,damping:30},children:[(0,D.jsxs)(`div`,{className:T(j3.datePlate,t.bucket===`passed`&&j3.datePlatePassed,t.bucket===`canceled`&&j3.datePlateCanceled),children:[(0,D.jsx)(`span`,{className:j3.datePlateMonth,children:c.month}),(0,D.jsx)(`span`,{className:j3.datePlateDay,children:c.day})]}),(0,D.jsx)(`span`,{className:j3.meetingAvatar,style:E({"--avatar-color":t.withColor}),children:t.withInitials}),(0,D.jsxs)(`div`,{className:j3.meetingBody,children:[(0,D.jsx)(`span`,{className:j3.meetingTitle,children:M3(t)}),(0,D.jsxs)(`div`,{className:j3.meetingMeta,children:[(0,D.jsxs)(`span`,{className:j3.meetingMetaItem,children:[(0,D.jsx)(Qn,{size:11}),` `,o,`–`,s,l]}),(0,D.jsxs)(`span`,{className:j3.meetingMetaItem,children:[(0,D.jsx)(yr,{size:11}),` `,t.location]})]})]}),(0,D.jsx)(z3,{...e,canJoin:u,joinHint:d})]})},U3={list:`_list_1vv5w_1`,meeting:`_meeting_1vv5w_7`,datePlate:`_datePlate_1vv5w_17`,pulse:`_pulse_1vv5w_1`,avatar:`_avatar_1vv5w_26`,body:`_body_1vv5w_35`,title:`_title_1vv5w_43`,meta:`_meta_1vv5w_51`,actions:`_actions_1vv5w_59`,btn:`_btn_1vv5w_66`},W3=()=>(0,D.jsx)(`div`,{className:U3.list,children:Array.from({length:3}).map((e,t)=>(0,D.jsxs)(`div`,{className:U3.meeting,children:[(0,D.jsx)(`div`,{className:U3.datePlate}),(0,D.jsx)(`div`,{className:U3.avatar}),(0,D.jsxs)(`div`,{className:U3.body,children:[(0,D.jsx)(`div`,{className:U3.title}),(0,D.jsx)(`div`,{className:U3.meta})]}),(0,D.jsxs)(`div`,{className:U3.actions,children:[(0,D.jsx)(`div`,{className:U3.btn}),(0,D.jsx)(`div`,{className:U3.btn})]})]},`skel-${String(t)}`))}),G3=[{id:`upcoming`,label:`Upcoming`},{id:`passed`,label:`Past`},{id:`canceled`,label:`Canceled`}],K3={type:`spring`,stiffness:420,damping:34},q3={hidden:{},visible:{transition:{staggerChildren:.05}}},J3=({bucket:e,counts:t,onSelect:n})=>(0,D.jsx)(`div`,{className:j3.bucketTabs,children:G3.map(r=>{let i=e===r.id;return(0,D.jsxs)(`button`,{type:`button`,className:T(j3.bucketTab,i&&j3.bucketTabActive),onClick:()=>{n(r.id)},children:[i&&(0,D.jsx)(A.span,{layoutId:`bucketBg`,className:j3.bucketBg,transition:K3}),(0,D.jsx)(`span`,{className:j3.bucketLabel,children:r.label}),(0,D.jsx)(`span`,{className:j3.bucketCount,children:t[r.id]})]},r.id)})}),Y3=1e4,X3=()=>{let e=Be(),t=bQ(Y3),r=wQ(),i=TQ(),[a,o]=(0,n.useState)(`upcoming`),s=t.data??[],c=[...s].filter(e=>e.bucket===a).sort((e,t)=>new Date(e.startUtc).getTime()-new Date(t.startUtc).getTime()),l={upcoming:s.filter(e=>e.bucket===`upcoming`).length,passed:s.filter(e=>e.bucket===`passed`).length,canceled:s.filter(e=>e.bucket===`canceled`).length};return(0,D.jsxs)(`div`,{className:j3.schedWrap,children:[(0,D.jsx)(J3,{bucket:a,counts:l,onSelect:o}),t.isPending?(0,D.jsx)(W3,{}):null,t.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not load meetings`,children:t.error.message}),t.isSuccess&&c.length===0?(0,D.jsxs)(`div`,{className:j3.empty,children:[(0,D.jsx)(`div`,{className:j3.emptyIconWrap,children:(0,D.jsx)(Vn,{size:32})}),(0,D.jsxs)(`span`,{className:j3.emptyTitle,children:[`No `,a,` meetings`]}),(0,D.jsx)(`span`,{className:j3.emptyText,children:`Nothing scheduled here yet.`})]}):null,t.isSuccess&&c.length>0?(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsx)(A.div,{className:j3.meetingList,variants:q3,initial:`hidden`,animate:`visible`,children:c.map(t=>(0,D.jsx)(H3,{meeting:t,onRespond:e=>{r.mutate({meetingId:t.id,accept:e})},onCancel:()=>{i.mutate(t.id)},onJoin:()=>{e(`/comms/meetings/${t.id}/room`)}},t.id))},a)}):null]})},Z3={screen:`_screen_18kgg_6`,head:`_head_18kgg_13`,headTop:`_headTop_18kgg_19`,title:`_title_18kgg_27`,subtitle:`_subtitle_18kgg_35`,headBadge:`_headBadge_18kgg_41`,headBadgeNum:`_headBadgeNum_18kgg_47`,headBadgeLabel:`_headBadgeLabel_18kgg_53`,tabs:`_tabs_18kgg_59`,tab:`_tab_18kgg_59`,tabActive:`_tabActive_18kgg_84`,tabUnderline:`_tabUnderline_18kgg_90`,body:`_body_18kgg_100`,tabContent:`_tabContent_18kgg_107`},Q3=()=>{let[e,t]=(0,n.useState)(`scheduled`),r=(bQ().data??[]).filter(e=>e.bucket===`upcoming`).length;return(0,D.jsxs)(`div`,{className:Z3.screen,children:[(0,D.jsxs)(`header`,{className:Z3.head,children:[(0,D.jsxs)(`div`,{className:Z3.headTop,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:Z3.title,children:`Meetings`}),(0,D.jsx)(`p`,{className:Z3.subtitle,children:`Book 1:1 meetings and manage your invitations.`})]}),(0,D.jsxs)(`div`,{className:Z3.headBadge,children:[(0,D.jsx)(`span`,{className:Z3.headBadgeNum,children:r}),(0,D.jsx)(`span`,{className:Z3.headBadgeLabel,children:`upcoming`})]})]}),(0,D.jsxs)(`div`,{className:Z3.tabs,children:[(0,D.jsxs)(`button`,{type:`button`,className:T(Z3.tab,e===`book`&&Z3.tabActive),onClick:()=>{t(`book`)},children:[(0,D.jsx)(Bn,{size:15}),` Book a Meeting`,e===`book`&&(0,D.jsx)(A.span,{layoutId:`bookTabUnderline`,className:Z3.tabUnderline,transition:{type:`spring`,stiffness:420,damping:34}})]}),(0,D.jsxs)(`button`,{type:`button`,className:T(Z3.tab,e===`scheduled`&&Z3.tabActive),onClick:()=>{t(`scheduled`)},children:[(0,D.jsx)(Qn,{size:15}),` Scheduled`,e===`scheduled`&&(0,D.jsx)(A.span,{layoutId:`bookTabUnderline`,className:Z3.tabUnderline,transition:{type:`spring`,stiffness:420,damping:34}})]})]})]}),(0,D.jsx)(`div`,{className:Z3.body,children:(0,D.jsx)(Kg,{mode:`wait`,children:(0,D.jsx)(A.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2,ease:`easeOut`},className:Z3.tabContent,children:e===`book`?(0,D.jsx)(A3,{onViewScheduled:()=>{t(`scheduled`)}}):(0,D.jsx)(X3,{})},e)})})]})},$3=()=>{let{meetingId:e}=We(),t=r$(e=>e.setRequestedMeetingId);return(0,n.useEffect)(()=>{e!==void 0&&t(e)},[e,t]),(0,D.jsx)(D.Fragment,{})},e6=`/comms/bookings`,t6=`/comms/meetings/:meetingId/room`,n6=()=>(0,D.jsxs)(St,{children:[(0,D.jsx)(bt,{path:e6,element:(0,D.jsx)(Q3,{})}),(0,D.jsx)(bt,{path:t6,element:(0,D.jsx)($3,{})}),(0,D.jsx)(bt,{path:`*`,element:(0,D.jsx)(yt,{to:e6,replace:!0})})]}),r6=()=>{Q$(`uapp-bookings`,()=>(0,D.jsx)(n6,{}))},i6=(e,t=0)=>{let n=new Date(e);return n.setHours(0,0,0,0),n.setDate(e.getDate()-(e.getDay()+6)%7+t*7),Array.from({length:7},(e,t)=>{let r=new Date(n);return r.setDate(n.getDate()+t),r})},a6=(e,t)=>{let n=cO(e);return i6(e,t).map(e=>({date:e,dayNumber:e.getDate(),isToday:cO(e)===n}))},o6=(e,t)=>e.toLocaleDateString(void 0,t),s6=(e,t)=>{let n=i6(e,t),r=n[0]??e,i=n[6]??e,a=r.getFullYear()===i.getFullYear();return a&&r.getMonth()===i.getMonth()?`${String(r.getDate())} – ${o6(i,{day:`numeric`,month:`long`,year:`numeric`})}`:a?`${o6(r,{day:`numeric`,month:`short`})} – ${o6(i,{day:`numeric`,month:`short`,year:`numeric`})}`:`${o6(r,{day:`numeric`,month:`short`,year:`numeric`})} – ${o6(i,{day:`numeric`,month:`short`,year:`numeric`})}`},c6=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,1),l6=(e,t)=>c6(e,t).toLocaleDateString(void 0,{month:`long`,year:`numeric`}),u6=(e,t)=>{let n=c6(e,t),r=(n.getDay()+6)%7,i=new Date(n.getFullYear(),n.getMonth()+1,0).getDate(),a=Math.ceil((r+i)/7),o=new Date(n);return o.setDate(n.getDate()-r),Array.from({length:a*7},(e,t)=>{let n=new Date(o);return n.setDate(o.getDate()+t),n})},d6=e=>{if(e<60)return`${String(e)}m`;let t=Math.floor(e/60),n=e%60;return n===0?`${String(t)}h`:`${String(t)}h ${String(n)}m`},f6=e=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`},p6=e=>new Date(e).toLocaleDateString(void 0,{weekday:`short`,day:`numeric`,month:`short`}),m6=e=>cO(e),h6=e=>f6(e),g6=(e,t)=>{let[n,r,i]=e.split(`-`),[a,o]=t.split(`:`);return new Date(Number(n??`1970`),Number(r??`1`)-1,Number(i??`1`),Number(a??`0`),Number(o??`0`),0,0).toISOString()},_6={available:{label:`Available`,color:`#22c55e`,Icon:Wn},busy:{label:`Busy`,color:`#ef4444`,Icon:Nn},meeting:{label:`Meeting`,color:`#3b82f6`,Icon:oi},focus:{label:`Focus`,color:`#8b5cf6`,Icon:$r},away:{label:`Away`,color:`#94a3b8`,Icon:Qn}},v6=e=>e===0||e===24?`12 AM`:e===12?`12 PM`:e<12?`${String(e)} AM`:`${String(e-12)} PM`,y6=(e,t)=>{let n=iO(e),r=iO(t);return r<=n?1440:r},b6=(e,t)=>{let n=tk(t);return n<=tk(e)?1440:n},x6=(e,t,n)=>{let r=tk(n)<=tk(t)?0:Math.max(0,Math.floor(tk(t)/60)-1),i=Math.min(24,Math.ceil(b6(t,n)/60)+1);for(let t of e){let e=t.block.status===`available`&&(t.continuesFromPrevDay===!0||t.continuesToNextDay===!0);t.block.allDay&&!e||(r=Math.min(r,Math.floor(iO(t.start)/60)),i=Math.max(i,Math.ceil(y6(t.start,t.end)/60)))}return r=Math.max(0,Math.min(r,22)),i=Math.min(24,Math.max(i,r+2)),{startHour:r,endHour:i}},S6=e=>Array.from({length:e.endHour-e.startHour},(t,n)=>e.startHour+n),C6=e=>(e.endHour-e.startHour)*52,w6=(e,t,n)=>{let r=iO(e),i=y6(e,t);return{top:(r-n.startHour*60)*52/60,height:Math.max(20,(i-r)*52/60-2)}},T6=(e,t,n)=>{let r=n.startHour*60,i=Math.max(e,r),a=Math.min(t,n.endHour*60);return a<=i?null:{top:(i-r)*52/60,height:(a-i)*52/60}},E6=(e,t,n)=>e?t.flatMap(e=>{let t=tk(e.from),r=tk(e.to);if(r<=t)return[T6(t,1440,n),T6(0,r,n)].filter(e=>e!==null);let i=T6(t,r,n);return i===null?[]:[i]}):[],D6=(e,t)=>{let n=e.getHours()*60+e.getMinutes();return n<t.startHour*60||n>t.endHour*60?null:(n-t.startHour*60)*52/60},O6=(e,t,n,r=90)=>((tk(t)<=tk(e)?0:tk(e))-n*60)*52/60-r*52/60,k6=(e,t,n=90)=>(e.getHours()*60+e.getMinutes()-t*60)*52/60-n*52/60,A6=e=>{let t=[...e].sort((e,t)=>iO(e.start)-iO(t.start)||y6(e.start,e.end)-y6(t.start,t.end)),n=[],r=[],i=[],a=()=>{let e=Math.max(1,i.length);for(let t of r)n.push({occurrence:t.occurrence,lane:t.lane,lanes:e});r=[],i=[]};for(let e of t){let t=iO(e.start),n=y6(e.start,e.end);r.length>0&&t>=Math.max(...i)&&a();let o=i.findIndex(e=>e<=t);o===-1?(o=i.length,i.push(n)):i[o]=n,r.push({occurrence:e,lane:o})}return a(),n},j6=e=>{let t=e.filter(e=>e.end>e.start).slice().sort((e,t)=>e.start-t.start),n=[];for(let e of t){let t=n[n.length-1];t!==void 0&&e.start<=t.end?n[n.length-1]={start:t.start,end:Math.max(t.end,e.end)}:n.push(e)}return n},M6=e=>e.reduce((e,t)=>e+(t.end-t.start),0),N6=(e,t,n)=>{let r=cO(t),i=e.filter(e=>e.date===r&&!e.block.allDay),a=j6([...n.map(e=>{let t=tk(e.from),n=tk(e.to);return{start:t,end:n<=t?1440:n}}),...i.filter(e=>e.block.status===`available`).map(e=>({start:iO(e.start),end:y6(e.start,e.end)}))]),o=i.filter(e=>e.block.status!==`available`).map(e=>({start:iO(e.start),end:y6(e.start,e.end)})),s=0;for(let e of a){let t=j6(o.map(t=>({start:Math.max(e.start,t.start),end:Math.min(e.end,t.end)})));s+=e.end-e.start-M6(t)}return Math.max(0,Math.round(s/60))},P6=(e,t)=>new Date(new Date(e).getTime()+t*6e4).toISOString(),F6=(e,t)=>{let n=new Date(e),r=HN(t,n)-HN(BN(),n);return r===0?e:new Date(n.getTime()-r*6e4).toISOString()},I6=(e,t)=>{let n=new Date(e),r=HN(t,n)-HN(BN(),n);return r===0?e:new Date(n.getTime()+r*6e4).toISOString()},L6=(e,t)=>({...e,start:F6(e.start,t),end:F6(e.end,t)}),R6=e=>{if(e.mode===`edit`){let{block:t}=e;return{title:t.title,status:t.status,start:t.start,end:t.allDay?t.end:g6(m6(t.start),h6(t.end)),allDay:t.allDay,notes:t.notes,recurrence:t.recurrence}}let t=e.start,n=e.end??P6(t,60),r=null,i=cO(t);if(i!==cO(n)){n=g6(i,h6(n));let a=new Date(t),o=new Date(e.end??n),s=[],c=new Date(a),l=0;for(;cO(c)<=cO(o)&&l<100;)l++,s.push(c.getDay()),c.setDate(c.getDate()+1);r={freq:`weekly`,interval:1,weekdays:s,monthlyMode:`dayOfMonth`,endType:`on`,endCount:13,endDate:cO(o),exceptions:[]}}return{title:e.title??``,status:e.status??`available`,start:t,end:n,allDay:!1,notes:``,recurrence:r}},z6=e=>({...e,recurrence:e.recurrence===null?OO(e.start):null}),B6=(e,t)=>({...e,recurrence:t}),V6=(e,t)=>({...e,start:g6(t,h6(e.start)),end:g6(t,h6(e.end))}),H6=(e,t)=>{let n=g6(m6(e.start),t),r=new Date(n).getTime()-new Date(e.start).getTime();return{...e,start:n,end:new Date(new Date(e.end).getTime()+r).toISOString()}},U6=(e,t)=>({...e,end:g6(m6(e.start),t)}),W6=(e,t)=>{let n=m6(e.start);return t?{...e,allDay:!0,start:g6(n,`00:00`),end:g6(n,`23:59`)}:{...e,allDay:!1,start:g6(n,`09:00`),end:g6(n,`10:00`)}},Q={notesInput:`_notesInput_1ut2q_7`,actionSpacer:`_actionSpacer_1ut2q_24`,panelHead:`_panelHead_1ut2q_29`,panelTitle:`_panelTitle_1ut2q_41`,panelForm:`_panelForm_1ut2q_47`,microLabel:`_microLabel_1ut2q_54`,panelInput:`_panelInput_1ut2q_62`,inputError:`_inputError_1ut2q_79`,fieldError:`_fieldError_1ut2q_84`,statusPills:`_statusPills_1ut2q_90`,statusPill:`_statusPill_1ut2q_90`,statusPillActive:`_statusPillActive_1ut2q_110`,dtGrid:`_dtGrid_1ut2q_116`,checkRow:`_checkRow_1ut2q_133`,checkbox:`_checkbox_1ut2q_143`,recurToggle:`_recurToggle_1ut2q_150`,recurToggleOn:`_recurToggleOn_1ut2q_163`,recurToggleLabel:`_recurToggleLabel_1ut2q_168`,recurSwitch:`_recurSwitch_1ut2q_181`,recurSwitchOn:`_recurSwitchOn_1ut2q_191`,recurKnob:`_recurKnob_1ut2q_195`,panelFooter:`_panelFooter_1ut2q_210`,panelSummary:`_panelSummary_1ut2q_215`,panelActions:`_panelActions_1ut2q_226`,recurSection:`_recurSection_1ut2q_234`,recurBuilder:`_recurBuilder_1ut2q_240`,recurChips:`_recurChips_1ut2q_250`,recurChip:`_recurChip_1ut2q_250`,recurChipActive:`_recurChipActive_1ut2q_267`,recurInline:`_recurInline_1ut2q_273`,recurInlineLabel:`_recurInlineLabel_1ut2q_281`,recurNumber:`_recurNumber_1ut2q_286`,recurWeekdays:`_recurWeekdays_1ut2q_297`,recurDay:`_recurDay_1ut2q_303`,recurDayActive:`_recurDayActive_1ut2q_315`,recurEnds:`_recurEnds_1ut2q_321`,recurRadio:`_recurRadio_1ut2q_327`,recurDate:`_recurDate_1ut2q_339`,recurSummaryBox:`_recurSummaryBox_1ut2q_349`,panelSummaryError:`_panelSummaryError_1ut2q_360`,disabledButtonWrapper:`_disabledButtonWrapper_1ut2q_368`,resolveConflictBtn:`_resolveConflictBtn_1ut2q_373`,upcomingCard:`_upcomingCard_1ut2q_394`,upcomingHeader:`_upcomingHeader_1ut2q_402`,upcomingRow:`_upcomingRow_1ut2q_414`,upcomingRowDate:`_upcomingRowDate_1ut2q_427`,upcomingRowTime:`_upcomingRowTime_1ut2q_431`,upcomingMore:`_upcomingMore_1ut2q_436`,differentTimeRow:`_differentTimeRow_1ut2q_445`,differentTimeList:`_differentTimeList_1ut2q_456`,differentTimeRowItem:`_differentTimeRowItem_1ut2q_467`,differentTimeDayLabel:`_differentTimeDayLabel_1ut2q_479`,differentTimeNote:`_differentTimeNote_1ut2q_488`,differentTimeRowGroup:`_differentTimeRowGroup_1ut2q_495`,differentTimeDayLabelSpacer:`_differentTimeDayLabelSpacer_1ut2q_501`,slotActionBtn:`_slotActionBtn_1ut2q_507`,slotActionBtnTrash:`_slotActionBtnTrash_1ut2q_524`},G6={center:`_center_10cfo_6`,field:`_field_10cfo_12`,dash:`_dash_10cfo_18`},K6={timeInput:`_timeInput_ik08d_4`},q6=[{wd:1,label:`M`,longLabel:`Mon`},{wd:2,label:`T`,longLabel:`Tue`},{wd:3,label:`W`,longLabel:`Wed`},{wd:4,label:`T`,longLabel:`Thu`},{wd:5,label:`F`,longLabel:`Fri`},{wd:6,label:`S`,longLabel:`Sat`},{wd:0,label:`S`,longLabel:`Sun`}],J6=e=>{let[t,n]=e.split(`:`).map(Number);return(t??0)*60+(n??0)},Y6=e=>{let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`},X6=e=>{if(!e)return{start:`09:00`,end:`17:00`};let t=J6(e.start),n=J6(e.end),r=n>t?n-t:60,i=n,a=i+r;return i>=1439?{start:`23:00`,end:`23:59`}:(a>1439&&(a=1439),{start:Y6(i),end:Y6(a)})},Z6=({slot:e,index:t,dayMeta:n,dayName:r,showTrash:i,onUpdateStart:a,onUpdateEnd:o,onAdd:s,onRemove:c})=>(0,D.jsxs)(`div`,{className:Q.differentTimeRowItem,children:[t===0?(0,D.jsx)(`span`,{className:Q.differentTimeDayLabel,children:n?.longLabel??r}):(0,D.jsx)(`span`,{className:Q.differentTimeDayLabelSpacer}),(0,D.jsx)(`input`,{type:`time`,className:T(Q.recurDate,K6.timeInput),value:e.start,onChange:e=>{a(e.target.value)}}),(0,D.jsx)(`span`,{className:G6.dash,children:`–`}),(0,D.jsx)(`input`,{type:`time`,className:T(Q.recurDate,K6.timeInput),value:e.end,onChange:e=>{o(e.target.value)}}),(0,D.jsx)(`button`,{type:`button`,className:Q.slotActionBtn,onClick:s,children:(0,D.jsx)(Pr,{size:14})}),i&&(0,D.jsx)(`button`,{type:`button`,className:Q.slotActionBtnTrash,onClick:c,children:(0,D.jsx)(ni,{size:12})})]}),Q6=({dayMeta:e,dayName:t,slots:n,startIso:r,endIso:i,onChangeSlots:a})=>{let o=n.length>0?n:[{start:h6(r),end:h6(i??r)}];return(0,D.jsx)(`div`,{className:Q.differentTimeRowGroup,children:o.map((n,r)=>(0,D.jsx)(Z6,{slot:n,index:r,dayMeta:e,dayName:t,showTrash:o.length>1,onUpdateStart:e=>{let t=[...o];t[r]={...n,start:e},a(t)},onUpdateEnd:e=>{let t=[...o];t[r]={...n,end:e},a(t)},onAdd:()=>{let e=o[o.length-1];a([...o,X6(e)])},onRemove:()=>{a(o.filter((e,t)=>t!==r))}},r))})},$6=({rec:e,onChange:t,startIso:n,endIso:r})=>e.weekdays.length===0?(0,D.jsx)(D.Fragment,{}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`label`,{className:Q.differentTimeRow,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:e.differentTimes??!1,onChange:n=>{t({...e,differentTimes:n.target.checked})}}),(0,D.jsx)(`span`,{children:`Different time per day`})]}),e.differentTimes&&(0,D.jsxs)(`div`,{className:Q.differentTimeList,children:[e.weekdays.map(i=>{let a=q6.find(e=>e.wd===i);return(0,D.jsx)(Q6,{dayMeta:a,dayName:a?a.longLabel:``,slots:e.weekdayTimes?.[i]??[],startIso:n,endIso:r,onChangeSlots:n=>{let r={...e.weekdayTimes,[i]:n};t({...e,weekdayTimes:r})}},i)}),(0,D.jsx)(`div`,{className:Q.differentTimeNote,children:`Defaults to the base event time when not overridden. Use + to add multiple slots per day.`})]})]}),e8=({recurrence:e,startIso:t,endIso:n})=>{let r=new Date(t),i=n===void 0?new Date(r.getTime()+1800*1e3):new Date(n),a=r,o=new Date(r.getTime()+2160*60*60*1e3),s=FO({start:t,end:i.toISOString(),recurrence:e},a,o),c=s.slice(0,5);return c.length===0?(0,D.jsx)(D.Fragment,{}):(0,D.jsxs)(`div`,{className:Q.upcomingCard,children:[(0,D.jsxs)(`div`,{className:Q.upcomingHeader,children:[(0,D.jsx)(Hn,{size:12}),` Upcoming Occurrences`]}),(0,D.jsx)(`div`,{children:c.map((e,t)=>{let n=new Date(e.start).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`}),r=`${f6(e.start)} – ${f6(e.end)}`;return(0,D.jsxs)(`div`,{className:Q.upcomingRow,children:[(0,D.jsx)(`span`,{className:Q.upcomingRowDate,children:n}),(0,D.jsx)(`span`,{className:Q.upcomingRowTime,children:r})]},t)})}),s.length>5&&(0,D.jsx)(`div`,{className:Q.upcomingMore,children:`...and more beyond`})]})},t8=[{wd:1,label:`M`},{wd:2,label:`T`},{wd:3,label:`W`},{wd:4,label:`T`},{wd:5,label:`F`},{wd:6,label:`S`},{wd:0,label:`S`}],n8={daily:`day`,weekly:`week`,monthly:`month`,yearly:`year`},r8=[{id:`dayOfMonth`,label:`Day of month`},{id:`nthWeekday`,label:`Day of week`}],i8=({rec:e,onChange:t})=>(0,D.jsx)(`div`,{className:Q.recurChips,children:TO.map(n=>(0,D.jsx)(`button`,{type:`button`,className:T(Q.recurChip,e.freq===n.id&&Q.recurChipActive),"aria-pressed":e.freq===n.id,onClick:()=>{t({...e,freq:n.id})},children:n.label},n.id))}),a8=({rec:e,onChange:t})=>(0,D.jsxs)(`label`,{className:Q.recurInline,children:[(0,D.jsx)(`span`,{className:Q.recurInlineLabel,children:`Every`}),(0,D.jsx)(`input`,{type:`number`,min:1,max:99,className:Q.recurNumber,value:e.interval,onChange:n=>{t({...e,interval:Math.max(1,Number(n.target.value)||1)})}}),(0,D.jsxs)(`span`,{className:Q.recurInlineLabel,children:[n8[e.freq],e.interval>1?`s`:``]})]}),o8=({rec:e,onChange:t})=>(0,D.jsx)(`div`,{className:Q.recurWeekdays,children:t8.map(({wd:n,label:r})=>{let i=e.weekdays.includes(n);return(0,D.jsx)(`button`,{type:`button`,className:T(Q.recurDay,i&&Q.recurDayActive),"aria-pressed":i,onClick:()=>{t({...e,weekdays:i?e.weekdays.filter(e=>e!==n):[...e.weekdays,n]})},children:r},n)})}),s8=({rec:e,onChange:t})=>(0,D.jsx)(`div`,{className:Q.recurChips,children:r8.map(n=>(0,D.jsx)(`button`,{type:`button`,className:T(Q.recurChip,e.monthlyMode===n.id&&Q.recurChipActive),onClick:()=>{t({...e,monthlyMode:n.id})},children:n.label},n.id))}),c8=({rec:e,startIso:t,onChange:n})=>(0,D.jsxs)(`div`,{className:Q.recurEnds,children:[(0,D.jsxs)(`label`,{className:Q.recurRadio,children:[(0,D.jsx)(`input`,{type:`radio`,name:`recur-end`,checked:e.endType===`never`,onChange:()=>{n({...e,endType:`never`})}}),(0,D.jsx)(`span`,{children:`Never ends`})]}),(0,D.jsxs)(`label`,{className:Q.recurRadio,children:[(0,D.jsx)(`input`,{type:`radio`,name:`recur-end`,checked:e.endType===`after`,onChange:()=>{n({...e,endType:`after`})}}),(0,D.jsx)(`span`,{children:`After`}),(0,D.jsx)(`input`,{type:`number`,min:1,max:365,className:Q.recurNumber,value:e.endCount,disabled:e.endType!==`after`,onChange:t=>{n({...e,endType:`after`,endCount:Math.max(1,Number(t.target.value)||1)})}}),(0,D.jsx)(`span`,{children:`times`})]}),(0,D.jsxs)(`label`,{className:Q.recurRadio,children:[(0,D.jsx)(`input`,{type:`radio`,name:`recur-end`,checked:e.endType===`on`,onChange:()=>{n({...e,endType:`on`})}}),(0,D.jsx)(`span`,{children:`On`}),(0,D.jsx)(`input`,{type:`date`,className:Q.recurDate,min:t.slice(0,10),value:e.endDate,disabled:e.endType!==`on`,onChange:t=>{n({...e,endType:`on`,endDate:t.target.value})}})]})]}),l8=({recurrence:e,startIso:t,endIso:n,onChange:r})=>{let i=e.freq===`weekly`,a=e.freq===`monthly`||e.freq===`yearly`;return(0,D.jsxs)(`div`,{className:Q.recurBuilder,children:[(0,D.jsx)(i8,{rec:e,onChange:r}),(0,D.jsx)(a8,{rec:e,onChange:r}),i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(o8,{rec:e,onChange:r}),(0,D.jsx)($6,{rec:e,onChange:r,startIso:t,endIso:n})]}),a&&(0,D.jsx)(s8,{rec:e,onChange:r}),(0,D.jsx)(c8,{rec:e,startIso:t,onChange:r}),(0,D.jsx)(`div`,{className:Q.recurSummaryBox,children:BO(e,t)}),(0,D.jsx)(e8,{recurrence:e,startIso:t,endIso:n})]})},u8=({draft:e,onChange:t})=>(0,D.jsxs)(`div`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Status`}),(0,D.jsx)(`div`,{className:Q.statusPills,children:KO.map(n=>{let r=_6[n.id],i=e.status===n.id;return(0,D.jsxs)(`button`,{type:`button`,className:T(Q.statusPill,i&&Q.statusPillActive),style:E({"--status-color":r.color}),"aria-pressed":i,onClick:()=>{t({...e,status:n.id})},children:[(0,D.jsx)(r.Icon,{size:13}),` `,n.label]},n.id)})})]}),d8=({draft:e,onChange:t})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:e.allDay?G6.field:Q.dtGrid,children:[(0,D.jsxs)(`label`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Date`}),(0,D.jsx)(`input`,{type:`date`,className:Q.panelInput,value:m6(e.start),onChange:n=>{t(V6(e,n.target.value))}})]}),!e.allDay&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`label`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Start`}),(0,D.jsx)(pD,{value:h6(e.start),onChange:n=>{t(H6(e,n))}})]}),(0,D.jsxs)(`label`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`End`}),(0,D.jsx)(pD,{align:`end`,value:h6(e.end),onChange:n=>{t(U6(e,n))}})]})]})]}),(0,D.jsxs)(`label`,{className:Q.checkRow,children:[(0,D.jsx)(`input`,{type:`checkbox`,className:Q.checkbox,checked:e.allDay,onChange:n=>{t(W6(e,n.target.checked))}}),(0,D.jsx)(`span`,{children:`All-day`})]})]}),f8=({draft:e,onChange:t})=>{let n=e.recurrence!==null;return(0,D.jsxs)(`div`,{className:Q.recurSection,children:[(0,D.jsxs)(`button`,{type:`button`,className:T(Q.recurToggle,n&&Q.recurToggleOn),"aria-pressed":n,onClick:()=>{t(z6(e))},children:[(0,D.jsxs)(`span`,{className:Q.recurToggleLabel,children:[(0,D.jsx)(Vr,{size:13}),` Recurring`]}),(0,D.jsx)(`span`,{className:T(Q.recurSwitch,n&&Q.recurSwitchOn),children:(0,D.jsx)(`span`,{className:Q.recurKnob})})]}),e.recurrence!==null&&(0,D.jsx)(l8,{recurrence:e.recurrence,startIso:e.start,endIso:e.end,onChange:n=>{t(B6(e,n))}})]})},p8=({draft:e,onChange:t})=>(0,D.jsxs)(`div`,{className:Q.panelForm,children:[(0,D.jsxs)(`label`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Title`}),(0,D.jsx)(`input`,{type:`text`,className:T(Q.panelInput,e.title.length>200&&Q.inputError),value:e.title,placeholder:`e.g. Morning availability`,onChange:n=>{t({...e,title:n.target.value})}}),e.title.length>200&&(0,D.jsx)(`span`,{className:Q.fieldError,children:`The field Title must be a string with a maximum length of 200.`})]}),(0,D.jsx)(u8,{draft:e,onChange:t}),(0,D.jsx)(d8,{draft:e,onChange:t}),(0,D.jsx)(f8,{draft:e,onChange:t}),(0,D.jsxs)(`label`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:Q.microLabel,children:`Notes`}),(0,D.jsx)(`textarea`,{className:Q.notesInput,rows:3,value:e.notes,placeholder:`Optional notes`,onChange:n=>{t({...e,notes:n.target.value})}})]})]}),m8=(e,t,n,r)=>{let i=new Date(e).getTime(),a=new Date(t).getTime(),o=new Date(n).getTime(),s=new Date(r).getTime();return i<=o&&a>=s?{type:`delete`}:i>o&&a<s?{type:`split`,updateEnd:new Date(i).toISOString(),createStart:new Date(a).toISOString(),createEnd:new Date(s).toISOString()}:i<=o&&a>o&&a<s?{type:`update`,start:new Date(a).toISOString(),end:r}:i>o&&i<s&&a>=s?{type:`update`,start:n,end:new Date(i).toISOString()}:null},h8=(e,t)=>{let n=new Date(e.start).getTime(),r=new Date(e.end).getTime(),i=new Date(t.start).getTime();return n<new Date(t.end).getTime()&&r>i},g8=(e,t)=>{let n=e.block.status===`available`&&t.block.status===`available`,r=e.block.status!==`available`&&t.block.status!==`available`;return(n||r)&&h8(e,t)},_8=(e,t,n)=>{let r=ek([new VO({id:`draft`,...e})],n),i=ek(t,n),a=[];for(let e of i)r.some(t=>g8(t,e))&&a.push(e);return a},v8=e=>({userId:e.userId,title:e.title,status:e.status,start:e.start,end:e.end,allDay:e.allDay,notes:e.notes,recurrence:e.recurrence}),y8=(e,t,n)=>({...v8(e),start:t,end:n,recurrence:null}),b8=(e,t)=>{let n=e.recurrence;if(n===null)return v8(e);let r=Array.from(new Set([...n.exceptions,...t]));return{...v8(e),recurrence:{...n,exceptions:r}}},x8=(e,t,n)=>n.type===`delete`?[]:n.type===`update`?[y8(e,n.start,n.end)]:[y8(e,t.start,n.updateEnd),y8(e,n.createStart,n.createEnd)],S8=(e,t,n)=>{let r=m8(n.start,n.end,t.start,t.end);return r===null?[]:r.type===`delete`?[{kind:`delete`,blockId:e.id}]:r.type===`update`?[{kind:`update`,blockId:e.id,draft:y8(e,r.start,r.end)}]:[{kind:`update`,blockId:e.id,draft:y8(e,t.start,r.updateEnd)},{kind:`create`,draft:y8(e,r.createStart,r.createEnd)}]},C8=(e,t,n)=>{let r=[],i=[];for(let a of t){let t=m8(n.start,n.end,a.start,a.end);if(t!==null){r.push(a.date);for(let n of x8(e,a,t))i.push({kind:`create`,draft:n})}}return r.length===0?[]:[{kind:`update`,blockId:e.id,draft:b8(e,r)},...i]},w8=(e,t)=>{let n=new Map;for(let e of t){let t=n.get(e.block.id)??[];t.push(e),n.set(e.block.id,t)}let r=[];for(let t of n.values()){let n=t[0];if(n===void 0)continue;let i=n.block.recurrence===null?S8(n.block,n,e):C8(n.block,t,e);r.push(...i)}return r},T8=(e,t)=>e.filter(e=>t.mode!==`edit`||e.id!==t.block.id),E8=(e,t,n)=>{let r=new Map;for(let i of _8(e,t,n))r.set(i.block.id,i.block);return[...r.values()]},D8=300*1e3,O8=(e,t,n,r)=>{if(!(n.mode!==`edit`||t.start!==L6({...e,start:n.block.start,end:n.block.end},r).start)||new Date(t.start).getTime()>=Date.now()-D8)return null;let i=new Date(t.end).getTime();return e.allDay&&i>Date.now()?`All-day events cannot be scheduled for today as part of the day has passed. Please uncheck 'All-day' to select a specific time.`:`Cannot schedule an event in the past.`},k8=(e,t)=>{if(t.length===0)return null;let n=t[0];if(n===void 0)return null;let r=t.some(e=>e.status===`meeting`);return e===`available`&&n.status===`available`?{error:`This block overlaps with an existing availability.`,code:`overlap_availability`,hasMeetingConflict:r}:{error:r?`This block overlaps with a scheduled Meeting. Meetings cannot be auto-adjusted or overwritten.`:`This block overlaps with an existing event.`,code:`overlap_event`,hasMeetingConflict:r}},A8=(e,t,n,r)=>{if(e.title.trim().length===0)return{error:`Event title is required.`,code:`empty_title`};if(e.title.length>200)return{error:`The field Title must be a string with a maximum length of 200.`,code:`title_too_long`};if(!oO(e.start,e.end))return{error:`End time must be after start time.`,code:`invalid_time`};let i=L6(e,r),a=O8(e,i,n,r);if(a!==null)return{error:a,code:`invalid_time`};let o=i6(new Date(i.start),0),s=E8(i,T8(t,n),o);return k8(e.status,s)??{error:null}},j8=(e,t,n)=>{let r=PN(),i=FN(),a=IN(),o=async e=>{if(e.kind===`delete`){await a.mutateAsync(e.blockId);return}if(e.kind===`update`){await i.mutateAsync({id:e.blockId,draft:e.draft});return}await r.mutateAsync(e.draft)};return{resolve:async(r,i)=>{let a=L6(e,n),s=i6(new Date(a.start),0),c=w8(a,_8(a,T8(r,t),s));try{await Promise.all(c.map(o)),j.success(`Conflicts resolved successfully!`),i()}catch(e){let t=e instanceof Error?e.message:String(e);j.error(`Failed to resolve conflicts: ${t}`)}}}},M8={errorStack:`_errorStack_q9qoj_4`,errorLine:`_errorLine_q9qoj_11`},N8=` · `,P8=` – `,F8=e=>{let t=cO(e.start)===cO(e.end)?p6(e.start):`${p6(e.start)}${P8}${p6(e.end)}`,n=e.recurrence===null?``:`${N8}${BO(e.recurrence,e.start)}`;return e.allDay?`${t}${N8}All day${n}`:e.recurrence?.differentTimes?`${t}${n}`:`${t}${N8}${`${f6(e.start)}${P8}${f6(e.end)}`}${N8}${d6(aO(e.start,e.end))}${n}`},I8=({isEdit:e,busy:t,canSave:n,validationError:r,isConflict:i,summary:a,onSave:o,onDelete:s,onCancel:c,onResolveConflicts:l})=>(0,D.jsxs)(`div`,{className:Q.panelFooter,children:[(0,D.jsx)(`div`,{className:T(Q.panelSummary,r!==null&&Q.panelSummaryError),children:r===null?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Bn,{size:14}),` `,a]}):(0,D.jsxs)(`div`,{className:M8.errorStack,children:[(0,D.jsxs)(`span`,{className:M8.errorLine,children:[(0,D.jsx)(Yn,{size:14}),` `,r]}),i&&(0,D.jsxs)(`button`,{type:`button`,className:Q.resolveConflictBtn,onClick:l,disabled:t,children:[(0,D.jsx)(Lr,{size:11}),` Auto-adjust blocks to fit`]})]})}),(0,D.jsxs)(`div`,{className:Q.panelActions,children:[e&&(0,D.jsxs)(vi,{variant:`ghost`,onClick:s,disabled:t,children:[(0,D.jsx)(ni,{size:15}),` Delete`]}),(0,D.jsx)(`span`,{className:Q.actionSpacer}),(0,D.jsx)(vi,{variant:`secondary`,onClick:c,disabled:t,children:`Cancel`}),n?(0,D.jsx)(vi,{onClick:o,isLoading:t,children:e?`Save changes`:`Create`}):(0,D.jsx)(DE,{label:r??`Cannot save`,side:`top`,children:(0,D.jsx)(`span`,{className:Q.disabledButtonWrapper,children:(0,D.jsx)(vi,{onClick:o,isLoading:t,disabled:!0,children:e?`Save changes`:`Create`})})})]})]}),L8=(e,t,n,r)=>{let i=PN(),a=FN(),o=IN();return{busy:i.isPending||a.isPending||o.isPending,onSave:()=>{let o=L6(t,n),s=e=>{j.success(e),r()};if(e.mode===`edit`){a.mutate({id:e.block.id,draft:o},{onSuccess:()=>{s(`Event updated`)},onError:e=>{j.error(e.message)}});return}i.mutate(o,{onSuccess:()=>{s(`Event added`)},onError:e=>{j.error(e.message)}})},onDelete:()=>{e.mode===`edit`&&o.mutate(e.block.id,{onSuccess:()=>{j.success(`Event removed`),r()},onError:e=>{j.error(e.message)}})}}},R8=({state:e,timezone:t,onClose:r})=>{let[i,a]=(0,n.useState)(()=>R6(e)),{busy:o,onSave:s,onDelete:c}=L8(e,i,t,r),{data:l=[]}=NN(),u=j8(i,e,t),d=e.mode===`edit`,f=A8(i,l,e,t),p=f.code===`title_too_long`?null:f.error,m=f.error===null,h=(f.code===`overlap_availability`||f.code===`overlap_event`)&&!f.hasMeetingConflict;return(0,D.jsxs)(Xy,{open:!0,side:`right`,title:d?`Edit Event`:`New Event`,onOpenChange:e=>{e||r()},footer:(0,D.jsx)(I8,{isEdit:d,busy:o,canSave:m,validationError:p,isConflict:h,summary:F8(i),onSave:s,onDelete:c,onCancel:r,onResolveConflicts:()=>{u.resolve(l,s)}}),children:[(0,D.jsxs)(`header`,{className:Q.panelHead,children:[(0,D.jsx)(`span`,{className:Q.panelTitle,children:d?`Edit Event`:`New Event`}),(0,D.jsx)(Ei,{label:`Close`,onClick:r,children:(0,D.jsx)(ci,{size:18})})]}),(0,D.jsx)(p8,{draft:i,onChange:a})]})},z8=()=>{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):GO},B8=/^(\d{1,2}):(\d{2})$/,V8=e=>String(e).padStart(2,`0`),H8=e=>{let t=B8.exec(e);return t===null?0:Number(t[1])*60+Number(t[2])},U8=e=>{let t=Math.max(0,Math.min(1439,e)),n=Math.floor(t/60),r=t%60;return`${V8(n)}:${V8(r)}`},W8=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],G8=e=>W8[(e+6)%7]??`sun`,K8=e=>W8[(e+1)%7]??`mon`,q8=e=>W8[e]??`mon`,J8=(e,t,n)=>{if(e>=0)return null;let r=e+1440,i=Math.min(0,t)+1440;return i<=r?null:{targetDay:G8(n),from:r,to:i,id:crypto.randomUUID()}},Y8=(e,t,n)=>{if(t<=1440)return null;let r=Math.max(1440,e)-1440,i=t-1440;return i<=r?null:{targetDay:K8(n),from:r,to:i,id:crypto.randomUUID()}},X8=(e,t,n,r)=>{let i=Math.max(0,e),a=Math.min(1440,t);return a<=i?null:{targetDay:q8(n),from:i,to:a,id:r}},Z8=(e,t,n)=>{let r=H8(e.from),i=e.to===`23:59`||e.to===`24:00`||e.to===`00:00`?1440:H8(e.to);if(i<=r)return[];let a=r+n,o=i+n;return[J8(a,o,t),X8(a,o,t,e.id),Y8(a,o,t)].filter(e=>e!==null)},Q8=(e,t,n)=>{e.sort((e,t)=>e.from-t.from);let r=[];for(let t of e){let e=r[r.length-1];e!==void 0&&t.from<=e.to+1?e.to=Math.max(e.to,t.to):r.push({...t})}let i=r.map(e=>({id:e.id,from:U8(e.from),to:e.to>=1440?`23:59`:U8(e.to)}));return{active:i.length>0&&t,slots:i.length>0?i:n.map(e=>({...e}))}},$8=(e,t,n,r)=>{if(t===n)return e;let i=HN(n,r)-HN(t,r);if(i===0)return e;let a={mon:[],tue:[],wed:[],thu:[],fri:[],sat:[],sun:[]},o={mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1};return qD.forEach((t,n)=>{let r=e[t.id];r.active&&r.slots.length>0&&r.slots.forEach(e=>{Z8(e,n,i).forEach(e=>{a[e.targetDay].push({from:e.from,to:e.to,id:e.id}),o[e.targetDay]=!0})})}),{mon:Q8(a.mon,o.mon,e.mon.slots),tue:Q8(a.tue,o.tue,e.tue.slots),wed:Q8(a.wed,o.wed,e.wed.slots),thu:Q8(a.thu,o.thu,e.thu.slots),fri:Q8(a.fri,o.fri,e.fri.slots),sat:Q8(a.sat,o.sat,e.sat.slots),sun:Q8(a.sun,o.sun,e.sun.slots)}},e5=(e,t)=>{let n=z8();return(n.includes(t)?n:[t,...n]).map(t=>({id:t,offset:GN(HN(t,e))}))},t5={tzWrap:`_tzWrap_horpb_4`,tzTrigger:`_tzTrigger_horpb_8`,tzGlobe:`_tzGlobe_horpb_30`,tzTriggerLabel:`_tzTriggerLabel_horpb_35`,tzTriggerOffset:`_tzTriggerOffset_horpb_44`,tzChevron:`_tzChevron_horpb_51`,tzBackdrop:`_tzBackdrop_horpb_56`,tzPop:`_tzPop_horpb_65`,tzSearch:`_tzSearch_horpb_78`,tzSearchInput:`_tzSearchInput_horpb_90`,tzList:`_tzList_horpb_100`,tzRow:`_tzRow_horpb_135`,tzRowActive:`_tzRowActive_horpb_154`,tzRowLabel:`_tzRowLabel_horpb_158`,tzRowOffset:`_tzRowOffset_horpb_171`,tzCheck:`_tzCheck_horpb_178`,tzEmpty:`_tzEmpty_horpb_183`},n5=(e,t)=>t===``||e.id.toLowerCase().includes(t)||e.offset.toLowerCase().includes(t),r5=({search:e,list:t,value:n,onSearch:r,onPick:i})=>(0,D.jsxs)(A.div,{className:t5.tzPop,variants:Hy,initial:`hidden`,animate:`visible`,exit:`exit`,children:[(0,D.jsxs)(`div`,{className:t5.tzSearch,children:[(0,D.jsx)(Hr,{size:13}),(0,D.jsx)(`input`,{className:t5.tzSearchInput,placeholder:`Search timezones…`,value:e,onChange:e=>{r(e.target.value)}})]}),(0,D.jsxs)(`div`,{className:t5.tzList,children:[t.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:T(t5.tzRow,e.id===n&&t5.tzRowActive),onClick:()=>{i(e.id)},children:[(0,D.jsx)(`span`,{className:t5.tzRowLabel,children:e.id}),(0,D.jsx)(`span`,{className:t5.tzRowOffset,children:e.offset}),e.id===n&&(0,D.jsx)(Wn,{size:13,className:t5.tzCheck})]},e.id)),t.length===0&&(0,D.jsx)(`p`,{className:t5.tzEmpty,children:`No timezones match.`})]})]}),i5=({value:e,now:t,onChange:r})=>{let[i,a]=(0,n.useState)(!1),[o,s]=(0,n.useState)(``),c=(0,n.useMemo)(()=>e5(t,e),[t,e]),l=c.find(t=>t.id===e)??{id:e,offset:``},u=o.trim().toLowerCase(),d=c.filter(e=>n5(e,u));return(0,D.jsxs)(`div`,{className:t5.tzWrap,children:[(0,D.jsxs)(`button`,{type:`button`,className:t5.tzTrigger,"aria-expanded":i,"aria-label":`Change timezone`,onClick:()=>{a(e=>!e)},children:[(0,D.jsx)(lr,{size:14,className:t5.tzGlobe}),(0,D.jsx)(`span`,{className:t5.tzTriggerLabel,children:l.id}),(0,D.jsx)(`span`,{className:t5.tzTriggerOffset,children:l.offset}),(0,D.jsx)(Gn,{size:15,className:t5.tzChevron})]}),(0,D.jsx)(Kg,{children:i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:t5.tzBackdrop,"aria-label":`Close timezone picker`,onClick:()=>{a(!1)}}),(0,D.jsx)(r5,{search:o,list:d,value:e,onSearch:s,onPick:e=>{r(e),s(``),a(!1)}})]})})]})},$={gridScroll:`_gridScroll_1vnsd_7`,gridInner:`_gridInner_1vnsd_33`,gutter:`_gutter_1vnsd_38`,gutterHead:`_gutterHead_1vnsd_44`,gutterAllDay:`_gutterAllDay_1vnsd_48`,gutterHour:`_gutterHour_1vnsd_62`,dayCol:`_dayCol_1vnsd_73`,dayHeader:`_dayHeader_1vnsd_79`,colDay:`_colDay_1vnsd_93`,colDayToday:`_colDayToday_1vnsd_101`,dayNum:`_dayNum_1vnsd_105`,dayNumToday:`_dayNumToday_1vnsd_125`,dayCount:`_dayCount_1vnsd_131`,allDayBand:`_allDayBand_1vnsd_137`,allDayChip:`_allDayChip_1vnsd_148`,hoursWrap:`_hoursWrap_1vnsd_168`,workBand:`_workBand_1vnsd_174`,hourRow:`_hourRow_1vnsd_184`,nowLine:`_nowLine_1vnsd_203`,nowDot:`_nowDot_1vnsd_214`,block:`_block_1vnsd_224`,blockTitle:`_blockTitle_1vnsd_261`,blockTime:`_blockTime_1vnsd_279`,monthScroll:`_monthScroll_1vnsd_293`,monthHead:`_monthHead_1vnsd_302`,monthHeadCell:`_monthHeadCell_1vnsd_309`,monthGrid:`_monthGrid_1vnsd_319`,monthCell:`_monthCell_1vnsd_326`,monthCellOff:`_monthCellOff_1vnsd_347`,monthDayNum:`_monthDayNum_1vnsd_351`,monthCellToday:`_monthCellToday_1vnsd_355`,monthDayNumToday:`_monthDayNumToday_1vnsd_366`,monthChip:`_monthChip_1vnsd_379`,monthMore:`_monthMore_1vnsd_402`,agendaScroll:`_agendaScroll_1vnsd_410`,agendaGroup:`_agendaGroup_1vnsd_418`,agendaDay:`_agendaDay_1vnsd_422`,agendaItems:`_agendaItems_1vnsd_432`,agendaRow:`_agendaRow_1vnsd_438`,agendaAccent:`_agendaAccent_1vnsd_459`,agendaBody:`_agendaBody_1vnsd_467`,agendaTitle:`_agendaTitle_1vnsd_475`,agendaMeta:`_agendaMeta_1vnsd_484`,agendaPill:`_agendaPill_1vnsd_493`,agendaEmpty:`_agendaEmpty_1vnsd_506`,agendaEmptyIcon:`_agendaEmptyIcon_1vnsd_517`,agendaEmptyTitle:`_agendaEmptyTitle_1vnsd_522`,agendaEmptyText:`_agendaEmptyText_1vnsd_528`,agendaEmptyBtn:`_agendaEmptyBtn_1vnsd_533`,availabilityBand:`_availabilityBand_1vnsd_546`,availabilityBandLabel:`_availabilityBandLabel_1vnsd_579`,availabilityBandEditBtn:`_availabilityBandEditBtn_1vnsd_589`,dragSelectionHighlight:`_dragSelectionHighlight_1vnsd_612`,dragSelectionLabel:`_dragSelectionLabel_1vnsd_631`},a5={hidden:{},visible:{transition:{staggerChildren:.04}}},o5=e=>{let t=[...e].sort((e,t)=>e.start<t.start?-1:1),n=new Map;for(let e of t){let t=n.get(e.date);t===void 0?n.set(e.date,{key:e.date,label:new Date(e.start).toLocaleDateString(void 0,{weekday:`long`,day:`numeric`,month:`long`}),items:[e]}):t.items.push(e)}return[...n.values()]},s5=({occurrence:e,onSelect:t})=>{let{block:n}=e,r=_6[n.status],i=n.allDay?`All day`:`${f6(e.start)} – ${f6(e.end)}`;return(0,D.jsxs)(A.button,{type:`button`,variants:Vy,whileHover:{x:3},className:$.agendaRow,style:E({"--status-color":r.color}),onClick:()=>{t(n)},children:[(0,D.jsx)(`span`,{className:$.agendaAccent}),(0,D.jsxs)(`span`,{className:$.agendaBody,children:[(0,D.jsx)(`span`,{className:$.agendaTitle,children:n.title}),(0,D.jsxs)(`span`,{className:$.agendaMeta,children:[i,n.recurrence!==null&&(0,D.jsxs)(D.Fragment,{children:[` · `,(0,D.jsx)(zr,{size:10}),` Recurring`]})]})]}),(0,D.jsxs)(`span`,{className:$.agendaPill,children:[(0,D.jsx)(r.Icon,{size:10}),` `,r.label]})]})},c5=({occurrences:e,onSelectBlock:t,onCreate:n})=>{let r=o5(e);return r.length===0?(0,D.jsxs)(`div`,{className:$.agendaEmpty,children:[(0,D.jsx)(`span`,{className:$.agendaEmptyIcon,children:(0,D.jsx)(Vn,{size:30})}),(0,D.jsx)(`span`,{className:$.agendaEmptyTitle,children:`Nothing scheduled this month`}),(0,D.jsx)(`span`,{className:$.agendaEmptyText,children:`Create a block to fill your week.`}),(0,D.jsx)(`button`,{type:`button`,className:$.agendaEmptyBtn,onClick:n,children:`Create New Event`})]}):(0,D.jsx)(`div`,{className:$.agendaScroll,children:r.map(e=>(0,D.jsxs)(`div`,{className:$.agendaGroup,children:[(0,D.jsx)(`div`,{className:$.agendaDay,children:e.label}),(0,D.jsx)(A.div,{className:$.agendaItems,variants:a5,initial:`hidden`,animate:`visible`,children:e.items.map(e=>(0,D.jsx)(s5,{occurrence:e,onSelect:t},e.key))})]},e.key))})},l5=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],u5=3,d5=e=>{let t=new Map;for(let n of e){let e=t.get(n.date)??[];e.push(n),t.set(n.date,e)}for(let e of t.values())e.sort((e,t)=>e.start<t.start?-1:1);return t},f5=e=>{let{date:t,inMonth:n,isToday:r,occs:i}=e,a=i.length-u5;return(0,D.jsxs)(`div`,{className:T($.monthCell,!n&&$.monthCellOff,r&&$.monthCellToday),onClick:()=>{e.onSelectSlot(g6(cO(t),`09:00`))},children:[(0,D.jsx)(`span`,{className:T($.monthDayNum,r&&$.monthDayNumToday),children:t.getDate()}),i.slice(0,u5).map(t=>(0,D.jsx)(`button`,{type:`button`,className:$.monthChip,style:E({"--status-color":_6[t.block.status].color}),onClick:n=>{n.stopPropagation(),e.onSelectBlock(t.block)},children:t.block.title},t.key)),a>0&&(0,D.jsxs)(`span`,{className:$.monthMore,children:[`+`,a,` more`]})]})},p5=({dates:e,anchor:t,occurrences:n,today:r,onSelectBlock:i,onSelectSlot:a})=>{let o=d5(n),s=cO(r);return(0,D.jsxs)(`div`,{className:$.monthScroll,children:[(0,D.jsx)(`div`,{className:$.monthHead,children:l5.map(e=>(0,D.jsx)(`span`,{className:$.monthHeadCell,children:e},e))}),(0,D.jsx)(A.div,{className:$.monthGrid,initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.22,1,.36,1]},children:e.map(e=>{let n=cO(e);return(0,D.jsx)(f5,{date:e,inMonth:e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),isToday:n===s,occs:o.get(n)??[],onSelectBlock:i,onSelectSlot:a},n)})})]})},m5={sidebar:`_sidebar_p4iov_4`,summaryGrid:`_summaryGrid_p4iov_36`,summaryCard:`_summaryCard_p4iov_42`,summaryTop:`_summaryTop_p4iov_54`,summaryTopIcon:`_summaryTopIcon_p4iov_60`,summaryValue:`_summaryValue_p4iov_65`,summaryLabel:`_summaryLabel_p4iov_73`,sideHeader:`_sideHeader_p4iov_82`,quickRow:`_quickRow_p4iov_92`,quickBtn:`_quickBtn_p4iov_97`,legendIcon:`_legendIcon_p4iov_118`,legend:`_legend_p4iov_118`,legendItem:`_legendItem_p4iov_129`,legendItemOn:`_legendItemOn_p4iov_151`,legendOff:`_legendOff_p4iov_156`,legendSwatch:`_legendSwatch_p4iov_160`,legendSwatchOff:`_legendSwatchOff_p4iov_172`,drawerHeader:`_drawerHeader_p4iov_177`,drawerTitle:`_drawerTitle_p4iov_185`,drawerCloseBtn:`_drawerCloseBtn_p4iov_191`},h5={hidden:{},visible:{transition:{staggerChildren:.05}}},g5=({occurrences:e,today:t,availability:n})=>{let r=YO(e,t),i=qD[(t.getDay()+6)%7]?.id??`mon`,a=n?.[i],o=a?.active?a.slots:[],s=[{label:`Free`,value:`${String(N6(e,t,o))}h`,color:`var(--color-primary)`,Icon:Qn},{label:`Busy`,value:`${String(r.busyHours)}h`,color:_6.busy.color,Icon:_6.busy.Icon},{label:`Meetings`,value:String(r.meetingCount),color:_6.meeting.color,Icon:_6.meeting.Icon},{label:`Focus`,value:`${String(r.focusHours)}h`,color:_6.focus.color,Icon:_6.focus.Icon}];return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:m5.sideHeader,children:`Today`}),(0,D.jsx)(A.div,{className:m5.summaryGrid,variants:h5,initial:`hidden`,animate:`visible`,children:s.map(e=>(0,D.jsxs)(A.div,{className:m5.summaryCard,style:E({"--v":e.color}),variants:Vy,whileHover:{y:-2},children:[(0,D.jsxs)(`span`,{className:m5.summaryTop,children:[(0,D.jsx)(e.Icon,{size:12,strokeWidth:2.4,className:m5.summaryTopIcon}),(0,D.jsx)(`span`,{className:m5.summaryLabel,children:e.label})]}),(0,D.jsx)(`span`,{className:m5.summaryValue,children:e.value})]},e.label))})]})},_5=({onQuickAdd:e})=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:m5.sideHeader,children:`Quick add`}),(0,D.jsx)(`div`,{className:m5.quickRow,children:[{status:`focus`,minutes:60,title:`Deep work`,label:`Focus 1h`},{status:`busy`,minutes:30,title:`Busy`,label:`Busy 30m`}].map(t=>{let n=_6[t.status];return(0,D.jsxs)(A.button,{type:`button`,whileTap:{scale:.96},className:m5.quickBtn,style:E({"--status-color":n.color}),onClick:()=>{e(t.status,t.minutes,t.title)},children:[(0,D.jsx)(n.Icon,{size:11}),` `,t.label]},t.label)})})]}),v5=({activeStatuses:e,onToggleStatus:t})=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:m5.sideHeader,children:`Status legend`}),(0,D.jsx)(`div`,{className:m5.legend,children:KO.map(n=>{let r=_6[n.id],i=e.has(n.id);return(0,D.jsxs)(A.button,{type:`button`,whileTap:{scale:.97},className:T(m5.legendItem,i?m5.legendItemOn:m5.legendOff),style:E({"--status-color":r.color}),onClick:()=>{t(n.id)},children:[(0,D.jsx)(`span`,{className:T(m5.legendSwatch,!i&&m5.legendSwatchOff),children:(0,D.jsx)(Kg,{children:i&&(0,D.jsx)(A.span,{initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:`spring`,stiffness:500,damping:28},children:(0,D.jsx)(Wn,{size:11,strokeWidth:3})})})}),(0,D.jsx)(r.Icon,{size:12,className:m5.legendIcon}),n.label]},n.id)})})]}),y5=e=>(0,D.jsxs)(`aside`,{className:m5.sidebar,children:[e.onClose!==void 0&&(0,D.jsxs)(`div`,{className:m5.drawerHeader,children:[(0,D.jsx)(`span`,{className:m5.drawerTitle,children:`Schedule Settings`}),(0,D.jsx)(`button`,{type:`button`,className:m5.drawerCloseBtn,onClick:e.onClose,"aria-label":`Close schedule settings`,children:(0,D.jsx)(ci,{size:16})})]}),(0,D.jsx)(g5,{occurrences:e.occurrences,today:e.today,availability:e.availability}),(0,D.jsx)(_5,{onQuickAdd:e.onQuickAdd}),(0,D.jsx)(v5,{activeStatuses:e.activeStatuses,onToggleStatus:e.onToggleStatus})]}),b5=(e,t,n,r)=>{let i=Math.min(e,t),a=Math.max(e,t);if(e===t){let e=r-1;return{firstDayIdx:i,lastDayIdx:a,startHour:Math.min(n,e),endHour:Math.max(n,e)+1}}return e>t?{firstDayIdx:i,lastDayIdx:a,startHour:r-1,endHour:n}:{firstDayIdx:i,lastDayIdx:a,startHour:n,endHour:r}},x5=({item:e,range:t,onSelect:n})=>{let{occurrence:r}=e,{block:i}=r,a=_6[i.status],o=w6(r.start,r.end,t),s=r.continuesFromPrevDay===!0,c=r.continuesToNextDay===!0,l=s?`Continued from the previous day`:c?`Continues into the next day`:void 0;return(0,D.jsxs)(A.button,{type:`button`,draggable:!0,title:l,onDragStartCapture:e=>{e.dataTransfer.setData(`text/plain`,i.id)},initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},transition:{duration:.18,ease:[.22,1,.36,1]},className:$.block,style:{...E({"--status-color":a.color,"--top":`${String(o.top)}px`,"--h":`${String(o.height)}px`,"--lane":e.lane,"--lanes":e.lanes}),...s?{borderTopLeftRadius:0,borderTopRightRadius:0}:{},...c?{borderBottomLeftRadius:0,borderBottomRightRadius:0}:{}},onClick:()=>{n(i)},children:[(0,D.jsxs)(`span`,{className:$.blockTitle,children:[s&&(0,D.jsx)(Jn,{size:10,"aria-hidden":!0}),` `,(0,D.jsx)(a.Icon,{size:10}),` `,i.title]}),o.height>=30&&(0,D.jsxs)(`span`,{className:$.blockTime,children:[f6(r.start),` – `,f6(r.end),c&&(0,D.jsx)(Gn,{size:10,"aria-hidden":!0})]})]})},S5=({occurrence:e,onSelect:t})=>{let{block:n}=e,r=_6[n.status];return(0,D.jsxs)(`button`,{type:`button`,className:$.allDayChip,style:E({"--status-color":r.color}),onClick:()=>{t(n)},children:[(0,D.jsx)(r.Icon,{size:10}),` `,n.title]})},C5=e=>`${String(e).padStart(2,`0`)}:00`,w5=({bands:e,range:t,onSelectSlot:n,onSelectBlock:r})=>(0,D.jsx)(D.Fragment,{children:e.map(e=>{let i=e.block.allDay&&e.continuesFromPrevDay!==!0&&e.continuesToNextDay!==!0?{top:0,height:C6(t)}:w6(e.start,e.end,t);return(0,D.jsxs)(`div`,{className:$.availabilityBand,style:E({"--top":`${String(i.top)}px`,"--h":`${String(i.height)}px`}),onClick:()=>{n(e.start,e.end)},children:[(0,D.jsxs)(`span`,{className:$.availabilityBandLabel,children:[(0,D.jsx)(Wn,{size:11,strokeWidth:3}),` Available`]}),(0,D.jsx)(`button`,{type:`button`,className:$.availabilityBandEditBtn,onClick:t=>{t.stopPropagation(),r(e.block)},children:`Edit`})]},e.key)})}),T5=({day:e,cell:t,dayIndex:n,range:r,onDragSelectStart:i,onDragSelectEnter:a,onDropBlock:o,onSelectSlot:s})=>(0,D.jsx)(D.Fragment,{children:S6(r).map(r=>(0,D.jsx)(`button`,{type:`button`,className:$.hourRow,"aria-label":`Add a block on ${e.long} at ${v6(r)}`,onMouseDown:e=>{e.button===0&&(e.preventDefault(),i(n,r))},onMouseEnter:e=>{a(n,r,e.buttons)},onDragOver:e=>{e.preventDefault()},onDrop:e=>{let n=e.dataTransfer.getData(`text/plain`);n&&o(n,g6(cO(t.date),C5(r)))},onClick:()=>{s(g6(cO(t.date),C5(r)))}},r))}),E5=e=>e===0?``:e===1?`1 event`:`${String(e)} events`,D5=({day:e,cell:t,count:n,off:r})=>(0,D.jsxs)(`div`,{className:$.dayHeader,children:[(0,D.jsx)(`span`,{className:T($.colDay,t.isToday&&$.colDayToday),children:e.short}),(0,D.jsx)(`span`,{className:T($.dayNum,t.isToday&&$.dayNumToday),children:t.dayNumber}),(0,D.jsx)(`span`,{className:$.dayCount,children:r?`Day off`:E5(n)})]}),O5=({allDay:e,onSelectBlock:t})=>(0,D.jsx)(`div`,{className:$.allDayBand,children:e.map(e=>(0,D.jsx)(S5,{occurrence:e,onSelect:t},e.key))}),k5=({dayIndex:e,dragSelect:t,rangeStartHour:n})=>t===null||e<Math.min(t.startDayIndex,t.endDayIndex)||e>Math.max(t.startDayIndex,t.endDayIndex)?null:(0,D.jsx)(`div`,{className:$.dragSelectionHighlight,style:E({"--top":`${String((Math.min(t.startHour,t.endHour-1)-n)*52)}px`,"--h":`${String(Math.abs(t.endHour-t.startHour)*52)}px`}),children:(0,D.jsxs)(`span`,{className:$.dragSelectionLabel,children:[v6(Math.min(t.startHour,t.endHour)),` –`,` `,v6(Math.max(t.startHour,t.endHour))]})}),A5=(e,t)=>{let n=e.filter(e=>e.dayIndex===t);return{dayOccs:n,allDay:n.filter(e=>e.block.allDay&&e.block.status!==`available`),availabilityBands:n.filter(e=>e.block.status===`available`),laid:A6(n.filter(e=>!e.block.allDay&&e.block.status!==`available`))}},j5=({active:e,slots:t,range:n,cell:r,day:i,dayIndex:a,now:o,availabilityBands:s,laid:c,dragSelect:l,onDragSelectStart:u,onDragSelectEnter:d,onDropBlock:f,onSelectSlot:p,onSelectBlock:m})=>{let h=E6(e,t,n),g=r.isToday?D6(o,n):null;return(0,D.jsxs)(`div`,{className:$.hoursWrap,style:E({"--grid-h":`${String(C6(n))}px`}),children:[h.map(e=>(0,D.jsx)(`div`,{className:$.workBand,style:E({"--top":`${String(e.top)}px`,"--h":`${String(e.height)}px`})},e.top)),(0,D.jsx)(w5,{bands:s,range:n,onSelectSlot:p,onSelectBlock:m}),(0,D.jsx)(T5,{day:i,cell:r,dayIndex:a,range:n,onDragSelectStart:u,onDragSelectEnter:d,onDropBlock:f,onSelectSlot:p}),(0,D.jsx)(k5,{dayIndex:a,dragSelect:l,rangeStartHour:n.startHour}),g!==null&&(0,D.jsx)(`div`,{className:$.nowLine,style:E({"--top":`${String(g)}px`}),children:(0,D.jsx)(`span`,{className:$.nowDot})}),c.map(e=>(0,D.jsx)(x5,{item:e,range:n,onSelect:m},e.occurrence.key))]})},M5=e=>{let{day:t,cell:n,dayIndex:r,occurrences:i,onSelectBlock:a,active:o}=e,{dayOccs:s,allDay:c,availabilityBands:l,laid:u}=A5(i,r),d=!o;return(0,D.jsxs)(`div`,{className:T($.dayCol,n.isToday&&$.dayColToday),children:[(0,D.jsx)(D5,{day:t,cell:n,count:s.length,off:d}),(0,D.jsx)(O5,{allDay:c,onSelectBlock:a}),(0,D.jsx)(j5,{...e,availabilityBands:l,laid:u})]})},N5=({range:e})=>(0,D.jsxs)(`div`,{className:$.gutter,children:[(0,D.jsx)(`div`,{className:$.gutterHead}),(0,D.jsx)(`div`,{className:$.gutterAllDay,children:`all-day`}),Array.from({length:e.endHour-e.startHour},(t,n)=>e.startHour+n).map(e=>(0,D.jsx)(`div`,{className:$.gutterHour,children:v6(e)},e))]}),P5=(e,t)=>{let[r,i]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let n=()=>{if(r!==null){let{firstDayIdx:n,lastDayIdx:a,startHour:o,endHour:s}=b5(r.startDayIndex,r.endDayIndex,r.startHour,r.endHour),c=e[n],l=e[a];c&&l&&t(g6(cO(c.date),`${String(o).padStart(2,`0`)}:00`),g6(cO(l.date),`${String(s).padStart(2,`0`)}:00`)),i(null)}};return window.addEventListener(`mouseup`,n),()=>{window.removeEventListener(`mouseup`,n)}},[r,e,t]),{dragSelect:r,startDrag:(e,t)=>{i({startDayIndex:e,endDayIndex:e,startHour:t,endHour:t+1})},enterDrag:(e,t,n)=>{if(r!==null){if(n!==1){i(null);return}i({...r,endDayIndex:e,endHour:t+1})}}}},F5=e=>{let t=FN();return{dropBlock:(n,r)=>{let i=e.find(e=>e.block.id===n);if(!i)return;let a=i.block.durationMinutes,o=new Date(new Date(r).getTime()+a*6e4).toISOString();t.mutate({id:n,draft:{title:i.block.title,status:i.block.status,start:r,end:o,allDay:i.block.allDay,notes:i.block.notes,recurrence:i.block.recurrence}})}}},I5=e=>({active:e?e.active:!0,slots:e?.slots??[{from:`09:00`,to:`17:00`}]}),L5=({days:e,cells:t,occurrences:r,availability:i,workStart:a,workEnd:o,range:s,now:c,onSelectBlock:l,onSelectSlot:u})=>{let d=(0,n.useRef)(null),{dragSelect:f,startDrag:p,enterDrag:m}=P5(t,u),{dropBlock:h}=F5(r),g=(0,n.useRef)(c);g.current=c;let{startHour:_,endHour:v}=s,y=c.getHours()*60+c.getMinutes(),b=t.some(e=>e.isToday)&&y>=_*60&&y<=v*60;(0,n.useEffect)(()=>{let e=d.current;if(e===null)return;let t=b?k6(g.current,_):O6(a,o,_);e.scrollTo({top:Math.max(0,Math.min(t,e.scrollHeight-e.clientHeight))})},[_,a,o,b]);let x=Math.max(1,...e.map(e=>{let t=qD.findIndex(t=>t.id===e.id);return r.filter(e=>e.dayIndex===t&&e.block.allDay).length}));return(0,D.jsx)(`div`,{className:$.gridScroll,ref:d,children:(0,D.jsxs)(`div`,{className:$.gridInner,style:E({"--all-day-rows":x}),children:[(0,D.jsx)(N5,{range:s}),e.map(e=>{let n=qD.findIndex(t=>t.id===e.id),a=t[n]??t[0];if(a===void 0)return null;let{active:o,slots:d}=I5(i?i[e.id]:null);return(0,D.jsx)(M5,{day:e,cell:a,dayIndex:n,active:o,slots:d,range:s,now:c,occurrences:r,dragSelect:f,onDragSelectStart:p,onDragSelectEnter:m,onDropBlock:h,onSelectBlock:l,onSelectSlot:u},e.id)})]})})},R5=[{id:`day`,label:`Day`},{id:`week`,label:`Week`},{id:`workweek`,label:`Work Week`},{id:`month`,label:`Month`},{id:`agenda`,label:`Agenda`},{id:`hours`,label:`Working Hours`}],z5=e=>e===`month`||e===`agenda`,B5=(e,t)=>{let n=new Set(e);return t===`agenda`?n.delete(`available`):t!==`hours`&&n.add(`available`),n},V5=(e,t)=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n},H5=()=>{let[e,t]=(0,n.useState)(`week`),[r,i]=(0,n.useState)(0),[a,o]=(0,n.useState)(0),[s,c]=(0,n.useState)(null),[l,u]=(0,n.useState)(()=>new Set(KO.map(e=>e.id))),[d,f]=(0,n.useState)(``),p=JN(d).display;return{view:e,setView:e=>{t(e),u(t=>B5(t,e))},dayOffset:r,monthOffset:a,goPrev:()=>{z5(e)?o(e=>e-1):i(e===`day`?e=>e-1:e=>e-7)},goNext:()=>{z5(e)?o(e=>e+1):i(e===`day`?e=>e+1:e=>e+7)},goToday:()=>{i(0),o(0)},active:l,toggle:e=>{u(t=>V5(t,e))},editor:s,openCreate:(e,t)=>{c({mode:`create`,start:e,...t===void 0?{}:{end:t}})},openQuick:(e,t,n)=>{let r=new Date(I6(new Date().toISOString(),p));r.setSeconds(0,0),r.setMinutes(Math.ceil(r.getMinutes()/5)*5);let i=new Date(r.getTime()+t*6e4);c({mode:`create`,start:r.toISOString(),end:i.toISOString(),status:e,title:n})},openEdit:e=>{c({mode:`edit`,block:e})},closeEditor:()=>{c(null)},timezone:p,setTimezone:f}},U5={scheduleRoot:`_scheduleRoot_5za8e_7`,toolbar:`_toolbar_5za8e_16`,scheduleSelect:`_scheduleSelect_5za8e_27`,weekNav:`_weekNav_5za8e_39`,dateLabel:`_dateLabel_5za8e_45`,navBtn:`_navBtn_5za8e_54`,todayBtn:`_todayBtn_5za8e_75`,viewChips:`_viewChips_5za8e_92`,viewChip:`_viewChip_5za8e_92`,viewChipBg:`_viewChipBg_5za8e_119`,viewChipLabel:`_viewChipLabel_5za8e_128`,viewChipActive:`_viewChipActive_5za8e_134`,newBtn:`_newBtn_5za8e_140`,main:`_main_5za8e_156`,calArea:`_calArea_5za8e_163`,hoursArea:`_hoursArea_5za8e_172`,sidebarToggleBtn:`_sidebarToggleBtn_5za8e_181`,sidebarToggleBtnActive:`_sidebarToggleBtnActive_5za8e_199`},W5=e=>e.view===`month`?(0,D.jsx)(p5,{dates:e.monthDates,anchor:e.monthAnchor,occurrences:e.monthOccurrences,today:e.today,onSelectBlock:e.onSelectBlock,onSelectSlot:e.onSelectSlot}):e.view===`agenda`?(0,D.jsx)(c5,{occurrences:e.monthOccurrences,onSelectBlock:e.onSelectBlock,onCreate:e.onCreate}):(0,D.jsx)(L5,{days:e.days,cells:e.cells,occurrences:e.weekOccurrences,availability:e.availability,workStart:e.workStart,workEnd:e.workEnd,range:e.range,now:e.today,onSelectBlock:e.onSelectBlock,onSelectSlot:e.onSelectSlot}),G5=e=>{let t=mi(`(max-width: 1024px)`);return(0,D.jsxs)(`div`,{className:U5.main,children:[(0,D.jsxs)(`div`,{className:U5.calArea,children:[e.query.isPending&&(0,D.jsx)(`div`,{className:G6.center,children:(0,D.jsx)(gi,{label:`Loading schedule`})}),e.query.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not load schedule`,children:e.query.error.message}),e.query.isSuccess&&W5(e)]}),!t&&(0,D.jsx)(y5,{occurrences:e.summary,today:e.today,availability:e.availability,workStart:e.workStart,workEnd:e.workEnd,activeStatuses:e.active,onToggleStatus:e.onToggle,onQuickAdd:e.onQuickAdd}),t&&(0,D.jsx)(Xy,{open:e.isSidebarOpen??!1,onOpenChange:t=>{!t&&e.onCloseSidebar!==void 0&&e.onCloseSidebar()},title:`Schedule Settings`,side:`right`,children:(0,D.jsx)(y5,{occurrences:e.summary,today:e.today,availability:e.availability,workStart:e.workStart,workEnd:e.workEnd,activeStatuses:e.active,onToggleStatus:e.onToggle,onQuickAdd:e.onQuickAdd,onClose:e.onCloseSidebar})})]})},K5=(e,t)=>e.meetingDuration!==t.meetingDuration||e.bufferMinutes!==t.bufferMinutes,q5=(e,t,n)=>{let r=qN.from({personal:t.timezone,anchor:t.availabilityTimezone});return{anchorZone:r.anchor,initialTimezone:r.display,initialInZone:$8(e,r.anchor,r.display,n)}},J5=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]={active:r.active,slots:r.slots.map(e=>({from:e.from,to:e.to}))};return t},Y5=(e,t,r)=>{let i=MN(),a=RN(),[o]=(0,n.useState)(()=>r.now()),[{anchorZone:s,initialTimezone:c,initialInZone:l}]=(0,n.useState)(()=>q5(e,t,o)),[u,d]=(0,n.useState)(l),[f,p]=(0,n.useState)(c),[m,h]=(0,n.useState)(t.meetingDuration),[g,_]=(0,n.useState)(t.bufferMinutes),v=$8(u,f,s,o),y=JSON.stringify(J5(v))!==JSON.stringify(J5(e)),b=K5({meetingDuration:m,bufferMinutes:g},t);return(0,n.useEffect)(()=>{i.isSuccess&&d($8(e,s,f,o))},[e,i.isSuccess,s,f,o]),(0,n.useEffect)(()=>{a.isSuccess&&(h(t.meetingDuration),_(t.bufferMinutes))},[t,a.isSuccess]),{draft:u,timezone:f,meetingDuration:m,bufferMinutes:g,now:o,dirty:y||b,isSaving:i.isPending||a.isPending,isSuccess:i.isSuccess||a.isSuccess,isError:i.isError||a.isError,errorMsg:i.error?.message??a.error?.message??``,setMeetingDuration:h,setBufferMinutes:_,patchDay:(e,t)=>{i.reset(),a.reset(),d(n=>({...n,[e]:{...n[e],...t}}))},changeTimezone:e=>{i.reset(),a.reset(),d(t=>$8(t,f,e,o)),p(e)},reset:()=>{i.mutate(null,{onSuccess:()=>{j.success(`Reverted to your branch default hours.`)},onError:()=>{j.error(`Could not revert to branch defaults. Please try again.`)}})},onSave:()=>{i.reset(),a.reset(),y&&i.mutate(v),b&&a.mutate({...t,meetingDuration:m,bufferMinutes:g})}}},X5={hours:`_hours_ftj0h_5`,fieldLabel:`_fieldLabel_ftj0h_18`,chips:`_chips_ftj0h_24`,chipBtn:`_chipBtn_ftj0h_30`,chipBtnActive:`_chipBtnActive_ftj0h_50`,chipBg:`_chipBg_ftj0h_56`,chipLabel:`_chipLabel_ftj0h_64`,dayRow:`_dayRow_ftj0h_69`,toggle:`_toggle_ftj0h_77`,toggleOn:`_toggleOn_ftj0h_90`,toggleKnob:`_toggleKnob_ftj0h_95`,dayName:`_dayName_ftj0h_102`,overflowLabel:`_overflowLabel_ftj0h_112`,dayTimes:`_dayTimes_ftj0h_119`,timeInput:`_timeInput_ftj0h_127`,resetBtn:`_resetBtn_ftj0h_144`,readonlyField:`_readonlyField_ftj0h_162`,fieldHint:`_fieldHint_ftj0h_175`,formFooter:`_formFooter_ftj0h_180`,formStatus:`_formStatus_ftj0h_188`,saveBtn:`_saveBtn_ftj0h_194`,inheritedBanner:`_inheritedBanner_ftj0h_212`,inheritedBadge:`_inheritedBadge_ftj0h_218`,badgeSub:`_badgeSub_ftj0h_229`,customBadge:`_customBadge_ftj0h_234`,customBadgeText:`_customBadgeText_ftj0h_247`,resetToBranchBtn:`_resetToBranchBtn_ftj0h_251`,settingsGrid:`_settingsGrid_ftj0h_271`},Z5=({name:e,options:t,selected:n,onSelect:r})=>(0,D.jsx)(`div`,{className:X5.chips,children:t.map(t=>{let i=n===t;return(0,D.jsxs)(`button`,{type:`button`,className:T(X5.chipBtn,i&&X5.chipBtnActive),onClick:()=>{r(t)},children:[i&&(0,D.jsx)(A.span,{layoutId:`chip-${e}`,className:X5.chipBg,transition:{type:`spring`,stiffness:420,damping:34}}),(0,D.jsxs)(`span`,{className:X5.chipLabel,children:[t,`m`]})]},t)})}),Q5=({meetingDuration:e,bufferMinutes:t,onDurationChange:n,onBufferChange:r})=>(0,D.jsxs)(`div`,{className:X5.settingsGrid,children:[(0,D.jsxs)(`div`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:X5.fieldLabel,children:`Meeting duration`}),(0,D.jsx)(Z5,{name:`duration`,options:UO,selected:e,onSelect:n})]}),(0,D.jsxs)(`div`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:X5.fieldLabel,children:`Buffer between meetings`}),(0,D.jsx)(Z5,{name:`buffer`,options:WO,selected:t,onSelect:r})]})]}),$5=({slot:e,index:t,slots:n,active:r,onChange:i})=>{let a=n[t-1],o=n[t+1],s=a===void 0?void 0:a.to,c=e.to,l=e.from,u=o===void 0?void 0:o.from;return(0,D.jsxs)(`div`,{className:X5.dayTimes,children:[(0,D.jsx)(pD,{value:e.from,minTime:s,maxTime:c,disabled:!r,onChange:r=>{let a=[...n];a[t]={...e,from:r},i(a)}}),(0,D.jsx)(`span`,{className:G6.dash,children:`–`}),(0,D.jsx)(pD,{value:e.to,minTime:l,maxTime:u,disabled:!r,align:`end`,onChange:r=>{let a=[...n];a[t]={...e,to:r},i(a)}}),(0,D.jsx)(`button`,{type:`button`,className:X5.resetBtn,disabled:!r||n.length===1,onClick:()=>{i(n.filter((e,n)=>n!==t))},children:`Delete`})]})},e7=({day:e,value:t,onChange:n})=>(0,D.jsxs)(`div`,{className:X5.dayRow,children:[(0,D.jsx)(`button`,{type:`button`,className:T(X5.toggle,t.active&&X5.toggleOn),"aria-pressed":t.active,onClick:()=>{n({active:!t.active})},children:(0,D.jsx)(`span`,{className:X5.toggleKnob})}),(0,D.jsx)(`span`,{className:X5.dayName,children:e.long}),(0,D.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,flex:1},children:[t.slots.map((e,r)=>(0,D.jsx)($5,{slot:e,index:r,slots:t.slots,active:t.active,onChange:e=>{n({slots:e})}},e.id)),(0,D.jsx)(`button`,{type:`button`,className:X5.resetBtn,style:{alignSelf:`flex-start`,margin:0},disabled:!t.active,onClick:()=>{let e=t.slots[t.slots.length-1],r=`09:00`,i=`17:00`;e!==void 0&&e.to<`22:00`&&(r=e.to,i=`23:00`),n({slots:[...t.slots,{id:crypto.randomUUID(),from:r,to:i}]})},children:`+ Add Time`})]}),(0,D.jsxs)(`button`,{type:`button`,className:X5.resetBtn,onClick:()=>{n({active:!0,slots:[{id:crypto.randomUUID(),from:`09:00`,to:`17:00`}]})},children:[(0,D.jsx)(Ir,{size:13}),` Reset`]})]}),t7=({timezone:e,branchName:t,now:n,onTimezoneChange:r})=>(0,D.jsxs)(`div`,{className:X5.settingsGrid,children:[(0,D.jsxs)(`div`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:X5.fieldLabel,children:`Timezone`}),(0,D.jsx)(i5,{value:e,now:n,onChange:r}),(0,D.jsx)(`span`,{className:X5.fieldHint,children:`Preview only — set your saved timezone in Profile`})]}),(0,D.jsxs)(`div`,{className:G6.field,children:[(0,D.jsx)(`span`,{className:X5.fieldLabel,children:`Home Branch`}),(0,D.jsx)(`div`,{className:X5.readonlyField,children:t}),(0,D.jsx)(`span`,{className:X5.fieldHint,children:`Assigned from your UAPP account`})]})]}),n7=({isOverride:e,branchName:t,onReset:n})=>(0,D.jsx)(`div`,{className:X5.inheritedBanner,children:e?(0,D.jsxs)(`div`,{className:X5.customBadge,children:[(0,D.jsxs)(`span`,{className:X5.customBadgeText,children:[`Customized Working Hours (overrides `,t,`)`]}),(0,D.jsxs)(`button`,{type:`button`,className:X5.resetToBranchBtn,onClick:n,children:[(0,D.jsx)(ri,{size:13}),` Use Branch Defaults`]})]}):(0,D.jsxs)(`div`,{className:X5.inheritedBadge,children:[(0,D.jsxs)(`span`,{children:[`Inheriting default hours from `,(0,D.jsx)(`strong`,{children:t})]}),(0,D.jsx)(`span`,{className:X5.badgeSub,children:`Modifying the hours below will create a personal override.`})]})}),r7=({statusText:e,disabled:t,onClick:n})=>(0,D.jsxs)(`div`,{className:X5.formFooter,children:[(0,D.jsx)(`span`,{className:X5.formStatus,children:e}),(0,D.jsx)(`button`,{type:`button`,className:X5.saveBtn,disabled:t,onClick:n,children:`Save changes`})]}),i7=(e,t)=>e?`Unsaved changes`:t?`Saved`:``,a7=({initial:e,isOverride:t,branchName:n,prefs:r})=>{let{clock:i}=TN(),a=Y5(e,r,i),o=i7(a.dirty,a.isSuccess);return(0,D.jsxs)(`div`,{className:X5.hours,children:[(0,D.jsx)(t7,{timezone:a.timezone,branchName:n,now:a.now,onTimezoneChange:a.changeTimezone}),(0,D.jsx)(Q5,{meetingDuration:a.meetingDuration,bufferMinutes:a.bufferMinutes,onDurationChange:a.setMeetingDuration,onBufferChange:a.setBufferMinutes}),(0,D.jsx)(n7,{isOverride:t,branchName:n,onReset:a.reset}),qD.map(e=>(0,D.jsx)(e7,{day:e,value:a.draft[e.id],onChange:t=>{a.patchDay(e.id,t)}},e.id)),a.isError&&(0,D.jsx)(bi,{tone:`error`,title:`Could not save`,children:a.errorMsg}),(0,D.jsx)(r7,{statusText:o,disabled:!a.dirty||a.isSaving,onClick:a.onSave})]})},o7=(e,t,n)=>e?.message??t?.message??n?.message??`Unknown error`,s7=(e,t)=>e?.branches.find(e=>e.id===t)?.name??`your branch`,c7=()=>{let e=jN(),t=pR(),n=LN();if(e.isPending||t.isPending||n.isPending)return(0,D.jsx)(`div`,{className:G6.center,children:(0,D.jsx)(gi,{label:`Loading working hours`})});if(e.isError||t.isError||n.isError)return(0,D.jsx)(bi,{tone:`error`,title:`Could not load working hours`,children:o7(e.error,t.error,n.error)});let r=s7(t.data,n.data.branchId);return(0,D.jsx)(a7,{initial:e.data.weekly,isOverride:e.data.isOverride,branchName:r,prefs:n.data},`${String(e.data.isOverride)}:${e.data.source}`)},l7={workStart:`09:00`,workEnd:`17:00`,branchId:`uk`},u7=(e,t)=>e===`day`?qD.slice(t,t+1):e===`workweek`?qD.slice(0,5):qD,d7=e=>{let[t]=e.split(`:`);return Number(t??`0`)},f7=(e,t,n)=>{if(e!==null)return e;if(t){let e=kI(t,n),r={};for(let t of qD){let n=e[t.id];r[t.id]={active:n.active,slots:[{id:crypto.randomUUID(),from:n.from,to:n.to}]}}return r}let r={};for(let e of qD)r[e.id]={active:e.id!==`sat`&&e.id!==`sun`,slots:[{id:crypto.randomUUID(),from:`09:00`,to:`17:00`}]};return r},p7=(e,t,n,r)=>t!==``&&t!==n?$8(e,t,n,r):e,m7=e=>{let t=Object.values(e).filter(e=>e.active).flatMap(e=>e.slots),n=t.length>0?Math.min(...t.map(e=>d7(e.from))):9,r=t.length>0?Math.max(...t.map(e=>d7(e.to))):17;return{workStart:`${String(Math.max(0,n)).padStart(2,`0`)}:00`,workEnd:`${String(Math.min(24,r)).padStart(2,`0`)}:00`}},h7=(e,t)=>(0,n.useMemo)(()=>{let n=e??[],r=BN();if(t===r)return n;let i=e=>{let n=new Date(e),i=HN(t,n)-HN(r,n);return i===0?e:new Date(n.getTime()+i*6e4).toISOString()};return n.map(e=>new VO({id:e.id,userId:e.userId,title:e.title,status:e.status,start:i(e.start),end:i(e.end),allDay:e.allDay,notes:e.notes,recurrence:e.recurrence}))},[e,t]),g7=e=>{let t=NN(),r=AN().data??null,i=LN().data,a=i??l7,o=pR(),s=new Date,c=HN(e.timezone,s)-HN(BN(),s),l=new Date(s.getTime()+c*6e4),u=e.view===`month`||e.view===`agenda`,d=t=>e.active.has(t.block.status),f=a.branchId,p=p7((0,n.useMemo)(()=>f7(r,o.data,f),[r,o.data,f]),i?.availabilityTimezone??``,e.timezone,s),{workStart:m,workEnd:h}=m7(p),g=e.timezone,_=h7(t.data,g),v=(l.getDay()+6)%7,y=Math.floor((e.dayOffset+v)/7),b=((e.dayOffset+v)%7+7)%7,x=ek(_,i6(l,y)),S=u6(l,e.monthOffset),C=$O(S[0]??l,S[S.length-1]??l,_),ee=new Date(l);return ee.setSeconds(0,0),ee.setMinutes(Math.ceil(ee.getMinutes()/30)*30),{query:t,today:l,days:u7(e.view,b),cells:a6(l,y),weekOccurrences:x.filter(d),availability:p,workStart:m,workEnd:h,range:x6(x,m,h),monthDates:S,monthAnchor:c6(l,e.monthOffset),monthOccurrences:C.filter(d),summary:u?C:x,rangeText:u?l6(l,e.monthOffset):s6(l,y),defaultStart:ee.toISOString()}},_7=({view:e,onView:t})=>(0,D.jsx)(`div`,{className:U5.viewChips,children:R5.map(n=>{let r=e===n.id;return(0,D.jsxs)(`button`,{type:`button`,className:T(U5.viewChip,r&&U5.viewChipActive),onClick:()=>{t(n.id)},children:[r&&(0,D.jsx)(A.span,{layoutId:`schedViewBg`,className:U5.viewChipBg,transition:{type:`spring`,stiffness:420,damping:34}}),(0,D.jsx)(`span`,{className:U5.viewChipLabel,children:n.label})]},n.id)})}),v7=({view:e,onView:t,rangeText:n,showNav:r,onPrev:i,onNext:a,onToday:o,onNew:s,timezone:c,setTimezone:l,todayDate:u,onToggleSidebar:d,isSidebarOpen:f})=>(0,D.jsxs)(`div`,{className:U5.toolbar,children:[(0,D.jsx)(`select`,{className:U5.scheduleSelect,"aria-label":`Calendar`,defaultValue:`my`,children:(0,D.jsx)(`option`,{value:`my`,children:`My Schedule`})}),e!==`hours`&&(0,D.jsx)(i5,{value:c,onChange:l,now:u}),r&&(0,D.jsxs)(`div`,{className:U5.weekNav,children:[(0,D.jsx)(`button`,{type:`button`,className:U5.todayBtn,onClick:o,children:`Today`}),(0,D.jsx)(`button`,{type:`button`,className:U5.navBtn,"aria-label":`Previous week`,onClick:i,children:(0,D.jsx)(Kn,{size:16})}),(0,D.jsx)(`button`,{type:`button`,className:U5.navBtn,"aria-label":`Next week`,onClick:a,children:(0,D.jsx)(qn,{size:16})}),(0,D.jsx)(`span`,{className:U5.dateLabel,children:n})]}),e!==`hours`&&d!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:T(U5.sidebarToggleBtn,f&&U5.sidebarToggleBtnActive),"aria-label":`Schedule settings`,title:`Schedule settings`,onClick:d,children:(0,D.jsx)(qr,{size:15})}),(0,D.jsx)(_7,{view:e,onView:t}),(0,D.jsxs)(`button`,{type:`button`,className:U5.newBtn,onClick:s,children:[(0,D.jsx)(Pr,{size:14,strokeWidth:2.5}),` New`]})]}),y7=()=>{let[e,t]=(0,n.useState)(!1),r=H5(),i=g7(r),a=()=>{r.openCreate(i.defaultStart)};return(0,D.jsxs)(`div`,{className:U5.scheduleRoot,children:[(0,D.jsx)(v7,{view:r.view,onView:r.setView,rangeText:i.rangeText,showNav:r.view!==`hours`,onPrev:r.goPrev,onNext:r.goNext,onToday:r.goToday,onNew:a,timezone:r.timezone,setTimezone:r.setTimezone,todayDate:i.today,onToggleSidebar:()=>{t(e=>!e)},isSidebarOpen:e}),r.view===`hours`?(0,D.jsx)(`div`,{className:U5.hoursArea,children:(0,D.jsx)(c7,{})}):(0,D.jsx)(G5,{query:i.query,view:r.view,today:i.today,days:i.days,cells:i.cells,weekOccurrences:i.weekOccurrences,availability:i.availability,workStart:i.workStart,workEnd:i.workEnd,range:i.range,monthDates:i.monthDates,monthAnchor:i.monthAnchor,monthOccurrences:i.monthOccurrences,summary:i.summary,active:r.active,onToggle:r.toggle,onSelectBlock:r.openEdit,onSelectSlot:r.openCreate,onCreate:a,onQuickAdd:r.openQuick,isSidebarOpen:e,onCloseSidebar:()=>{t(!1)}}),r.editor!==null&&(0,D.jsx)(R8,{state:r.editor,timezone:r.timezone,onClose:r.closeEditor})]})},b7=()=>{Q$(`uapp-schedule`,()=>(0,D.jsx)(V2,{path:`/comms/schedule`,children:(0,D.jsx)(y7,{})}))},x7=6e4,S7=e=>{let t=e.logger??new bk(`info`),n=new zN,r,i=0,a=new _k(new pk(new dk({logger:t,baseUrl:e.apiBaseUrl,getAuthToken:()=>r}),{timeoutMs:2e4,logger:t}),{logger:t}),o=new uq({httpClient:a,clock:n,logger:t,clientKey:e.clientKey,modules:e.modules});return{httpClient:a,logger:t,token:async()=>{if(r!==void 0&&n.now().getTime()<i-x7)return r;let a=await e.getAssertion(),s=await o.exchangeSsoSecret(a);if(!s.ok){t.error(`Could not exchange the assertion for a token`,s.error);return}return r=s.value.accessToken,i=s.value.expiresAt.getTime(),r},currentToken:()=>r}},C7=`/api/app/notification`,w7=async(e,t)=>{try{let t=await e.get(C7);return(Array.isArray(t)?t:[]).map(R$).filter(e=>e!==null)}catch(e){return t.error(`Could not load unread notifications`,e),[]}},T7=(e,t,n)=>new HJ({logger:t}).create({url:`${e}/signalr/notifications`,accessTokenProvider:n}),E7=e=>{let t=S7({apiBaseUrl:e.apiBaseUrl,clientKey:e.clientKey,getAssertion:e.getAssertion,modules:e.modules??[`commhub.feed`],...e.logger===void 0?{}:{logger:e.logger}}),{httpClient:n,logger:r,token:i}=t,a=null,o=null,s=[];return{start:async()=>{a===null&&await i()!==void 0&&(s=await w7(n,r),s.forEach(e.onNotification),a=T7(e.apiBaseUrl,r,t.currentToken),o=a.on(xZ.ReceiveNotification,t=>{let n=R$(t);if(n===null){r.error(`Discarded a malformed notification payload`,{rawPayload:t});return}s=[n,...s.filter(e=>e.id!==n.id)],e.onNotification(n)}),await a.start())},stop:async()=>{o?.(),o=null,await a?.stop(),a=null},markAsRead:async e=>{await i()!==void 0&&(await n.post(`${C7}/${e}/mark-as-read`,{}),s=s.filter(t=>t.id!==e))},unread:()=>s}},D7=e=>{let t=S7({apiBaseUrl:e.apiBaseUrl,clientKey:e.clientKey,getAssertion:e.getAssertion,modules:e.modules??[`commhub.chat`],...e.logger===void 0?{}:{logger:e.logger}}),n=new JR({httpClient:t.httpClient,logger:t.logger}),r=async e=>{if(await t.token()===void 0)return null;let n=await e();return VD(n)?n.value:null};return{getMine:()=>r(()=>n.getMine()),setMine:e=>r(()=>n.setMine(e)),clearMine:()=>r(()=>n.clearMine()),getOf:async e=>{if(await t.token()===void 0)return null;let r=await n.getOf(e);return VD(r)?r.value:null}}},O7=()=>{$$(),H2(),r6(),b7()};exports.CommsProvider=H$,exports.SDK_MODULE_SCOPES=hq,exports.WidgetRoot=U$,exports.createNotificationClient=E7,exports.createPresenceClient=D7,exports.defineCustomElements=O7,exports.registerBookingsWidget=r6,exports.registerChatWidget=$$,exports.registerFeedWidget=H2,exports.registerScheduleWidget=b7;
59
59
  //# sourceMappingURL=communication-sdk.cjs.map