@peripheries/core 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +1 -1
  2. package/index.css +1 -1
  3. package/index.js +3 -3
  4. package/package.json +1 -1
  5. package/types/core/_shared/embed.d.ts +3 -0
  6. package/types/core/_shared/interact.d.ts +14 -0
  7. package/types/core/actions/FilterChips/FilterChips.d.ts +16 -0
  8. package/types/core/display/ProposedComponent/ProposedComponent.d.ts +20 -0
  9. package/types/core/events/BookEventCard/BookEventCard.d.ts +7 -10
  10. package/types/core/events/EditEventCard/EditEventCard.d.ts +51 -0
  11. package/types/core/events/EventDetail/EventDetail.d.ts +4 -0
  12. package/types/core/events/EventNoteCard/EventNoteCard.d.ts +15 -0
  13. package/types/core/events/LogCard/LogCard.d.ts +6 -1
  14. package/types/core/events/TaskCard/TaskCard.d.ts +8 -0
  15. package/types/core/events/_shared/audience.d.ts +20 -0
  16. package/types/core/events/_shared/event.d.ts +1 -0
  17. package/types/core/events/_shared/eventFields.d.ts +47 -0
  18. package/types/core/events/_shared/when.d.ts +1 -0
  19. package/types/core/forms/Checkbox/Checkbox.d.ts +1 -1
  20. package/types/core/forms/RadioGroup/RadioGroup.d.ts +1 -1
  21. package/types/core/forms/SearchField/SearchField.d.ts +2 -1
  22. package/types/core/forms/Select/Select.d.ts +1 -1
  23. package/types/core/forms/Slider/Slider.d.ts +1 -1
  24. package/types/core/forms/Switch/Switch.d.ts +1 -1
  25. package/types/core/forms/TextArea/TextArea.d.ts +1 -2
  26. package/types/core/forms/TextField/TextField.d.ts +2 -3
  27. package/types/core/forms/_shared/field.d.ts +17 -2
  28. package/types/core/text/Heading/Heading.d.ts +1 -1
  29. package/types/index.core.d.ts +6 -0
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{Children as r,cloneElement as i,createContext as a,isValidElement as o,useCallback as s,useContext as c,useEffect as l,useId as u,useLayoutEffect as d,useMemo as f,useReducer as p,useRef as m,useState as h,useSyncExternalStore as g}from"react";var _=new Set(["baseProps","data","status","actions","_traversal","isLoading","error","navigate","onNavigate","size","store"]);function v(e2){let t2={};for(let n2 in e2)_.has(n2)||(t2[n2]=e2[n2]);return t2}var y=(...e2)=>e2.filter(Boolean).join(" ")||void 0,b=e2=>e2===void 0?void 0:typeof e2=="number"?`${e2}px`:e2;function x(e2,t2){let n2=Object.fromEntries(Object.entries(e2).filter(([,e3])=>e3!==void 0));return Object.keys(n2).length||t2?{...n2,...t2}:void 0}function S({as:e2,className:n2,children:r2,...i2}){return t(e2??"div",{className:y("core-box",n2),...v(i2),children:r2})}function C({minHeight:e2,className:n2,style:r2,children:i2,...a2}){return t(S,{...a2,className:y("core-center",n2),style:x({"--core-center-min-height":b(e2)},r2),children:i2})}function w({name:e2,className:n2,style:r2,children:i2,...a2}){return t(S,{...a2,className:y("core-container",n2),style:x({"--core-container-name":e2},r2),children:i2})}function T({orientation:e2="horizontal",weight:n2="subtle",spacing:r2,className:i2,style:a2,ref:o2,...s2}){let c2={className:y("core-divider",i2),"data-weight":n2,"data-orientation":e2,style:x({"--core-divider-spacing":b(r2)},a2)};return e2==="vertical"?t("span",{role:"separator","aria-orientation":"vertical",...c2}):t("hr",{ref:o2,...v(s2),...c2})}function E({when:e2,children:n2,as:r2="span"}){return t(r2,{className:"core-hide","data-when":e2,children:n2})}function D({gap:e2,align:n2="center",justify:r2="start",wrap:i2=true,stackWhen:a2,className:o2,style:s2,children:c2,...l2}){return t(S,{...l2,className:y("core-inline",o2),"data-align":n2,"data-justify":r2,"data-wrap":i2?"true":"false","data-stack-when":a2,style:x({"--core-inline-gap":b(e2)},s2),children:c2})}var O=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[contenteditable=""]','[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function k(e2){return[...e2.querySelectorAll(O)].filter(e3=>!e3.closest("[inert]")&&!e3.hidden&&e3.getAttribute("aria-hidden")!=="true")}var A=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,j=2;function M({label:e2,snap:i2="start",children:a2,className:o2,...c2}){let u2=m(null),[d2,f2]=h({prev:false,next:false}),[p2,g2]=h(false),_2=s(()=>{let e3=u2.current;if(!e3)return;let t2=e3.scrollLeft>j,n2=e3.scrollWidth-e3.clientWidth-e3.scrollLeft>j;f2(e4=>e4.prev===t2&&e4.next===n2?e4:{prev:t2,next:n2}),g2(e3.scrollWidth>e3.clientWidth&&k(e3).length===0)},[]);l(()=>{let e3=u2.current;if(!e3)return;_2();let t2=new ResizeObserver(_2);t2.observe(e3);for(let n2 of Array.from(e3.children))t2.observe(n2);return()=>t2.disconnect()},[_2,a2]);let b2=e3=>{let t2=u2.current;t2&&t2.scrollBy({left:e3*t2.clientWidth*.8,behavior:A()?"auto":"smooth"})};return n("div",{...v(c2),className:y("core-rail",o2),"data-snap":i2,"data-prev":d2.prev?"":void 0,"data-next":d2.next?"":void 0,children:[t("button",{type:"button",className:"core-rail__arrow","data-direction":"prev","aria-label":`Scroll ${e2} back`,hidden:!d2.prev,onClick:()=>b2(-1),children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"M10 3 5 8l5 5"})})}),t("ul",{ref:u2,role:"list","aria-label":e2,className:"core-rail__track",tabIndex:p2?0:void 0,onScroll:_2,children:r.toArray(a2).map((e3,n2)=>t("li",{className:"core-rail__item",children:e3},n2))}),t("button",{type:"button",className:"core-rail__arrow","data-direction":"next","aria-label":`Scroll ${e2} forward`,hidden:!d2.next,onClick:()=>b2(1),children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"m6 3 5 5-5 5"})})})]})}function N({when:e2,children:n2,as:r2="span"}){return t(r2,{className:"core-show","data-when":e2,children:n2})}function P(e2,t2,n2){let[r2,i2]=h(t2),a2=e2!==void 0,o2=a2?e2:r2,c2=m(n2);return c2.current=n2,[o2,s(e3=>{a2||i2(e3),c2.current?.(e3)},[a2])]}function F(...e2){return t2=>{for(let n2 of e2)typeof n2=="function"?n2(t2):n2&&(n2.current=t2)}}function I(e2){let[t2,n2]=h(()=>typeof matchMedia=="function"&&matchMedia(e2).matches);return l(()=>{if(typeof matchMedia!="function")return;let t3=matchMedia(e2),r2=()=>n2(t3.matches);return r2(),t3.addEventListener("change",r2),()=>t3.removeEventListener("change",r2)},[e2]),t2}var L=(e2,t2,n2)=>Math.max(t2,Math.min(e2,n2));function R({anchor:e2,size:t2,viewport:n2,placement:r2,gap:i2=4,margin:a2=8}){let[o2,s2="center"]=r2.split("-"),c2=n2.height-a2-e2.bottom-i2,l2=e2.top-i2-a2,u2=e3=>t2.height<=e3,d2=o2;o2==="bottom"&&!u2(c2)&&l2>c2?d2="top":o2==="top"&&!u2(l2)&&c2>l2&&(d2="bottom");let f2=d2==="bottom"?e2.bottom+i2:e2.top-i2-t2.height;return{x:L(s2==="start"?e2.left:s2==="end"?e2.right-t2.width:(e2.left+e2.right)/2-t2.width/2,a2,Math.max(a2,n2.width-a2-t2.width)),y:L(f2,a2,Math.max(a2,n2.height-a2-t2.height)),placement:s2==="center"?d2:`${d2}-${s2}`}}function z(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name","--a")}var B=4;function ee({trigger:r2,label:a2,placement:o2="bottom-start",open:s2,defaultOpen:c2=false,onOpenChange:f2,popupRole:p2="dialog",initialFocus:g2,onTriggerKeyDown:_2,children:v2,className:b2}){let[x2,S2]=P(s2,c2,f2),C2=u(),w2=`--core-a${C2.replace(/\W/g,"")}`,T2=m(null),E2=m(null),[D2]=h(z),O2=m(x2);O2.current=x2;let A2=m("closed");d(()=>{let e2=T2.current;if(e2){if(x2&&A2.current==="closed")A2.current="open",e2.showPopover();else if(!x2&&A2.current==="open"){A2.current="closed";let t2=document.activeElement;(!t2||t2===document.body||e2.contains(t2))&&E2.current?.focus({preventScroll:true}),e2.hidePopover()}}},[x2]),l(()=>{let e2=T2.current;if(!e2)return;let t2=t3=>{let n3=t3.newState;if(A2.current=n3==="open"?"open":"closed",n3==="open"&&!O2.current&&S2(true),n3==="closed"&&O2.current){S2(false);let t4=document.activeElement;(!t4||t4===document.body||e2.contains(t4))&&E2.current?.focus({preventScroll:true})}},n2=t3=>{if(t3.newState!=="open"||g2===false)return;let n3=(typeof g2=="function"?g2(e2):g2?e2.querySelector(g2):null)??k(e2)[0];n3?n3.focus({preventScroll:true}):(e2.tabIndex=-1,e2.focus({preventScroll:true}))};return e2.addEventListener("beforetoggle",t2),e2.addEventListener("toggle",n2),()=>{e2.removeEventListener("beforetoggle",t2),e2.removeEventListener("toggle",n2)}},[S2,g2]),d(()=>{let e2=T2.current,t2=E2.current;if(D2||!x2||!e2||!t2)return;let n2=()=>{let n3=R({anchor:t2.getBoundingClientRect(),size:{width:e2.offsetWidth,height:e2.offsetHeight},viewport:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},placement:o2,gap:B});e2.style.setProperty("--core-popover-x",`${n3.x}px`),e2.style.setProperty("--core-popover-y",`${n3.y}px`),e2.dataset.placement=n3.placement,e2.dataset.placed=""};n2();let r3=new ResizeObserver(n2);return r3.observe(e2),window.addEventListener("resize",n2),window.addEventListener("scroll",n2,true),()=>{delete e2.dataset.placed,r3.disconnect(),window.removeEventListener("resize",n2),window.removeEventListener("scroll",n2,true)}},[D2,x2,o2]);let j2=()=>S2(false),M2=r2.props,N2={ref:F(E2,M2.ref),popoverTarget:C2,"aria-haspopup":p2,"aria-expanded":x2,"aria-controls":C2,className:y(M2.className,"core-popover-anchor"),style:{...M2.style,"--core-popover-anchor":w2},onKeyDown:e2=>{_2?.(e2),M2.onKeyDown?.(e2)}};return n(e,{children:[i(r2,N2),t("div",{ref:T2,id:C2,popover:"auto",role:p2==="menu"?void 0:p2,"aria-label":p2==="menu"?void 0:a2,className:y("core-popover",b2),"data-placement":o2,"data-placer":D2?"anchor":"script",style:{"--core-popover-anchor":w2},onBlur:e2=>{let t2=e2.relatedTarget;t2&&!e2.currentTarget.contains(t2)&&t2!==E2.current&&j2()},children:x2?typeof v2=="function"?v2({close:j2}):v2:null})]})}var V=Symbol.for("peripheries.overlay.scrollLock.v1"),H=globalThis;function U(){if(typeof document>"u")return()=>{};let e2=H[V]??={count:0,overflow:""};e2.count===0&&(e2.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),e2.count+=1;let t2=false;return()=>{t2||(t2=true,--e2.count,e2.count===0&&(document.body.style.overflow=e2.overflow))}}function W({variant:e2,open:r2,onClose:i2,title:a2,label:o2,description:s2,role:c2="dialog",initialFocus:d2,dismissOnBackdrop:f2=true,headerStart:p2,headerTools:h2,footer:g2,children:_2,className:v2}){let b2=m(null),x2=m(null),S2=m(i2);S2.current=i2;let C2=u(),w2=u();l(()=>{let e3=b2.current;if(!e3||!r2)return;let t2=document.activeElement;e3.showModal();let n2=U(),i3=(d2?e3.querySelector(d2):null)??k(e3)[0];i3?i3.focus({preventScroll:true}):e3.focus({preventScroll:true});let a3=e4=>{e4.preventDefault(),S2.current()};return e3.addEventListener("cancel",a3),()=>{e3.removeEventListener("cancel",a3),n2(),e3.open&&e3.close();let r3=document.activeElement;(!r3||r3===document.body)&&t2?.isConnected&&t2.focus({preventScroll:true})}},[r2,d2]);let T2=o2??(typeof a2=="string"?a2:"dialog");return t("dialog",{ref:b2,className:y("core-modal",v2),"data-variant":e2,role:c2==="alertdialog"?"alertdialog":void 0,"aria-labelledby":C2,"aria-describedby":s2?w2:void 0,tabIndex:-1,onKeyDown:e3=>{if(e3.key!=="Tab"||e3.defaultPrevented||e3.target.closest("dialog")!==e3.currentTarget)return;let t2=k(e3.currentTarget),n2=t2[0],r3=t2[t2.length-1];if(!n2||!r3)return e3.preventDefault();let i3=document.activeElement;e3.shiftKey&&(i3===n2||i3===e3.currentTarget)?(e3.preventDefault(),r3.focus()):!e3.shiftKey&&i3===r3&&(e3.preventDefault(),n2.focus())},onPointerDown:e3=>{x2.current=e3.target},onClick:e3=>{f2&&e3.target===e3.currentTarget&&x2.current===e3.currentTarget&&S2.current()},children:r2&&n("div",{className:"core-modal__surface",children:[n("header",{className:"core-modal__header",children:[p2,t("h2",{id:C2,className:"core-modal__title",children:a2}),t("div",{className:"core-modal__tools",children:h2}),t("button",{type:"button",className:"core-modal__close","aria-label":`Close ${T2}`,onClick:()=>S2.current(),children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),n("div",{className:"core-modal__body",children:[s2?t("p",{id:w2,className:"core-modal__description",children:s2}):null,_2]}),g2?t("footer",{className:"core-modal__footer",children:g2}):null]})})}function G({side:e2="bottom",back:n2,...r2}){let i2=n2?t("button",{type:"button",className:"core-modal__back","aria-label":`Back to ${n2.label}`,onClick:n2.onBack,children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"M13 8H3M7 4 3 8l4 4"})})}):void 0;return t(W,{variant:e2==="end"?"sheet-end":"sheet-bottom",headerStart:i2,...r2})}var te="(max-width: 640px)",ne=600,re=e2=>"type"in e2;function ie({items:r2,label:i2,onChoose:a2,onTab:o2,className:s2}){let c2=m(null),l2=m({text:"",at:0}),u2=()=>[...c2.current?.querySelectorAll('[role="menuitem"]')??[]];return t("div",{ref:c2,role:"menu","aria-label":i2,className:y("core-menu",s2),onKeyDown:e2=>{let t2=u2(),n2=t2.indexOf(document.activeElement),r3=n3=>{e2.preventDefault(),t2[(n3+t2.length)%t2.length]?.focus({preventScroll:true})};if(e2.key==="ArrowDown")r3(n2+1);else if(e2.key==="ArrowUp")r3(n2<0?-1:n2-1);else if(e2.key==="Home")r3(0);else if(e2.key==="End")r3(-1);else if(e2.key==="Tab")o2();else if(e2.key.length===1&&!e2.ctrlKey&&!e2.metaKey&&!e2.altKey&&e2.key!==" "){let r4=Date.now();l2.current.text=r4-l2.current.at>ne?e2.key.toLowerCase():l2.current.text+e2.key.toLowerCase(),l2.current.at=r4;let i3=l2.current.text,a3=[...t2.slice(n2+1),...t2.slice(0,n2+1)],o3=[...i3].every(e3=>e3===i3[0]),s3=a3.find(e3=>e3.textContent?.trim().toLowerCase().startsWith(i3))??(o3?a3.find(e3=>e3.textContent?.trim().toLowerCase().startsWith(i3[0]??"")):void 0);s3&&(e2.preventDefault(),s3.focus({preventScroll:true}))}},children:r2.map(r3=>{if(re(r3))return t("div",{role:"separator",className:"core-menu__separator"},r3.id);let i3={role:"menuitem",tabIndex:-1,className:"core-menu__item","data-tone":r3.tone,"aria-disabled":r3.disabled||void 0,onClick:e2=>{if(r3.disabled)return e2.preventDefault();a2(r3)}},o3=n(e,{children:[r3.icon?t("span",{className:"core-menu__icon","aria-hidden":"true",children:r3.icon}):null,t("span",{className:"core-menu__label",children:r3.label})]});return r3.href&&!r3.disabled?t("a",{...i3,href:r3.href,children:o3},r3.id):t("button",{...i3,type:"button",children:o3},r3.id)})})}function K({trigger:r2,items:a2,label:o2,placement:s2="bottom-start",presentation:c2="auto",defaultOpen:l2=false,onOpenChange:u2,className:d2}){let f2=I(te),p2=c2==="sheet"||c2==="auto"&&f2,[m2,g2]=P(void 0,l2,u2),[_2,v2]=h("first"),y2=t(ie,{items:a2,label:o2,onChoose:e2=>{e2.onSelect?.(),g2(false)},onTab:()=>g2(false),className:d2}),b2=e2=>{(e2.key==="ArrowDown"||e2.key==="ArrowUp")&&(e2.preventDefault(),v2(e2.key==="ArrowUp"?"last":"first"),g2(true))};if(p2){let a3=r2.props;return n(e,{children:[i(r2,{"aria-haspopup":"menu","aria-expanded":m2,onClick:e2=>{a3.onClick?.(e2),v2("first"),g2(true)},onKeyDown:e2=>{b2(e2),a3.onKeyDown?.(e2)}}),t(G,{open:m2,onClose:()=>g2(false),title:o2,initialFocus:'[role="menuitem"]',className:"core-menu-sheet",children:y2})]})}return t(ee,{trigger:r2,label:o2,placement:s2,open:m2,onOpenChange:g2,popupRole:"menu",initialFocus:e2=>{let t2=e2.querySelectorAll('[role="menuitem"]');return(_2==="last"?t2[t2.length-1]:t2[0])??null},onTriggerKeyDown:b2,className:"core-menu-popover",children:y2})}var ae=new Set;function q(e2,t2){ae.has(e2)||(ae.add(e2),typeof console<"u"&&console.warn(t2))}var oe={title:120,description:280,label:40,visible:4,perSource:2,burst:5,windowMs:1e4,defaultDuration:6e3},se=1,ce=Symbol.for("peripheries.toast.v1"),le=["neutral","info","success","warning","danger"],ue=globalThis;function de(){let e2=ue[ce];if(e2===void 0){let e3={version:se,snapshot:{toasts:[],actions:[]},listeners:new Set,handlers:new Map,sent:new Map,regionClaim:null,next:1};return ue[ce]=e3,e3}return e2.version!==se||!e2.listeners||!e2.handlers?(q("toast:version",`[toast] A toast store of version ${String(e2.version)} is on this page; this copy expects ${se}. Toasts from this copy are ignored.`),null):e2}function fe(e2,t2){e2.snapshot={toasts:t2,actions:[...e2.handlers.keys()]};for(let t3 of[...e2.listeners])t3()}var pe=(e2,t2)=>e2.length>t2?`${e2.slice(0,t2-1)}…`:e2;function me(e2){let t2=de();if(!t2)return null;if(!e2||typeof e2.title!="string"||e2.title.trim()==="")return q("toast:title","[toast] A toast needs a title of text; nothing was shown."),null;if(t2.regionClaim===null)return q("toast:region","[toast] No ToastRegion is mounted, so the toast was not shown. Mount <ToastRegion /> once, in the shell."),null;let n2=typeof e2.source=="string"&&e2.source?pe(e2.source,40):"app",r2=Date.now(),i2=(t2.sent.get(n2)??[]).filter(e3=>r2-e3<oe.windowMs);if(i2.length>=oe.burst)return q(`toast:burst:${n2}`,`[toast] "${n2}" sent more than ${oe.burst} toasts in ${oe.windowMs/1e3}s; the rest are dropped.`),t2.sent.set(n2,i2),null;t2.sent.set(n2,[...i2,r2]);let a2=le.includes(e2.tone)?e2.tone:"neutral",o2=pe(e2.title.trim(),oe.title),s2=typeof e2.description=="string"&&e2.description.trim()?pe(e2.description.trim(),oe.description):void 0,c2=e2.action&&typeof e2.action.id=="string"&&typeof e2.action.label=="string"&&e2.action.label.trim()?{id:e2.action.id,label:pe(e2.action.label.trim(),oe.label)}:void 0,l2=typeof e2.id=="string"&&e2.id?e2.id:`${a2}|${o2}|${s2??""}`,u2=c2?0:typeof e2.duration=="number"&&e2.duration>=0?e2.duration:oe.defaultDuration,d2=[...t2.snapshot.toasts],f2=d2.findIndex(e3=>e3.id===l2);if(f2>=0){let e3=d2[f2];d2[f2]={id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:e3.revision+1}}else{for(d2.push({id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:0});d2.filter(e3=>e3.source===n2).length>oe.perSource;)d2.splice(d2.findIndex(e3=>e3.source===n2),1);for(;d2.length>oe.visible;)d2=d2.slice(1)}return fe(t2,d2),l2}function he(e2){let t2=de();t2&&t2.snapshot.toasts.some(t3=>t3.id===e2)&&fe(t2,t2.snapshot.toasts.filter(t3=>t3.id!==e2))}function ge(e2){let t2=de()?.handlers.get(e2);return t2?.(),!!t2}var _e={toasts:[],actions:[]},ve=e2=>{let t2=de();return t2?.listeners.add(e2),()=>void t2?.listeners.delete(e2)},ye=()=>de()?.snapshot??_e;function be(){let e2=de();if(!e2)return null;if(e2.regionClaim!==null)return q("toast:second-region","[toast] A second ToastRegion was mounted; it does nothing, and its actions are ignored. Mount one per page."),null;let t2=Symbol("region");return e2.regionClaim=t2,{release(){e2.regionClaim===t2&&(e2.regionClaim=null,e2.handlers.clear(),fe(e2,[]))},setActions(n2){e2.regionClaim===t2&&(e2.handlers=new Map(Object.entries(n2)),fe(e2,e2.snapshot.toasts))}}}function xe(){return{toast:me,dismiss:he}}function Se({toast:e2,actionAvailable:r2=false,onAction:i2,onDismiss:a2,className:o2,...s2}){return n("div",{...s2,className:y("core-toast",o2),"data-tone":e2.tone,children:[n("div",{className:"core-toast__text",children:[t("p",{className:"core-toast__title",children:e2.title}),e2.description?t("p",{className:"core-toast__description",children:e2.description}):null]}),e2.action&&r2?t("button",{type:"button",className:"core-toast__action",onClick:i2,children:e2.action.label}):null,t("button",{type:"button",className:"core-toast__dismiss","aria-label":"Dismiss notification",onClick:a2,children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]})}function Ce({item:e2,actionAvailable:n2}){let[r2,i2]=h(false);return l(()=>{if(e2.duration===0||r2)return;let t2=setTimeout(()=>he(e2.id),e2.duration);return()=>clearTimeout(t2)},[e2.id,e2.duration,e2.revision,r2]),t("div",{className:"core-toast-slot",onPointerEnter:()=>i2(true),onPointerLeave:()=>i2(false),onFocus:()=>i2(true),onBlur:e3=>{e3.currentTarget.contains(e3.relatedTarget)||i2(false)},children:t(Se,{toast:e2,actionAvailable:n2,onAction:()=>{e2.action&&ge(e2.action.id),he(e2.id)},onDismiss:()=>he(e2.id)})})}function we({className:e2,actions:r2}){let[i2,a2]=h(false),o2=m(null),s2=m(r2);s2.current=r2;let c2=Object.keys(r2??{}).sort().join("\n"),u2=m(null),d2=m(false),{toasts:f2,actions:p2}=g(ve,ye,ye);l(()=>{let e3=be();return o2.current=e3,a2(e3!==null),()=>{e3?.release(),o2.current=null}},[]),l(()=>{o2.current?.setActions(Object.fromEntries((c2?c2.split("\n"):[]).map(e3=>[e3,()=>s2.current?.[e3]?.()])))},[c2,i2]);let _2=f2[f2.length-1],v2=_2?`${_2.id}:${_2.revision}`:"";if(l(()=>{let e3=u2.current;e3&&(d2.current&&e3.hidePopover(),d2.current=v2!=="",d2.current&&e3.showPopover())},[v2,i2]),!i2)return null;let b2=e3=>f2.filter(e3).map(e4=>t(Ce,{item:e4,actionAvailable:!!e4.action&&p2.includes(e4.action.id)},e4.id));return n("div",{ref:u2,popover:"manual",role:"region","aria-label":"Notifications",className:y("core-toast-region",e2),children:[t("div",{role:"status","aria-live":"polite",className:"core-toast-region__list",children:b2(e3=>e3.tone!=="danger")}),t("div",{role:"alert","aria-live":"assertive",className:"core-toast-region__list",children:b2(e3=>e3.tone==="danger")})]})}function Te({role:e2="dialog",dismissOnBackdrop:n2,...r2}){return t(W,{variant:"dialog",role:e2,dismissOnBackdrop:n2??e2!=="alertdialog",...r2})}function Ee({size:e2,className:n2,style:r2}){return t("span",{"aria-hidden":true,className:y("core-spacer",n2),style:x({"--core-spacer-size":b(e2)},r2)})}function De({gap:e2,align:n2="stretch",justify:r2="start",className:i2,style:a2,children:o2,...s2}){return t(S,{...s2,className:y("core-stack",i2),"data-align":n2,"data-justify":r2,style:x({"--core-stack-gap":b(e2)},a2),children:o2})}var Oe=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),ke=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function Ae({href:e2,action:t2,input:n2,actions:r2,navigate:i2,onClick:a2}){let[o2,s2]=h(false),c2=r2&&t2?r2[t2]:void 0;return{busy:o2,onClick:t3=>{if(a2)return a2(t3);if(c2){t3.preventDefault(),s2(true),c2(n2).finally(()=>s2(false));return}e2&&i2&&Oe(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!Oe(e2)&&!ke(e2)}}function je({title:e2,meta:r2,leading:i2,value:a2,trailing:o2,href:s2,navigate:c2,onClick:l2,as:u2="div",className:d2,...f2}){let p2=Ae({href:s2,navigate:c2,onClick:l2}),m2=u2,h2=s2?t("a",{className:"core-list-row__title core-list-row__link",href:s2,onClick:p2.onClick,...p2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e2}):t("span",{className:"core-list-row__title",children:e2});return n(m2,{...v(f2),className:y("core-list-row",d2),children:[i2!=null&&t("div",{className:"core-list-row__leading",children:i2}),n("div",{className:"core-list-row__main",children:[h2,r2!=null&&t("span",{className:"core-list-row__meta",children:r2})]}),a2!=null&&t("div",{className:"core-list-row__value",children:a2}),o2!=null&&t("div",{className:"core-list-row__trailing",children:o2})]})}function Me({header:e2,children:r2,measure:i2="page",className:a2,...o2}){return t("div",{...v(o2),className:y("core-page-frame",a2),"data-measure":i2,children:n("div",{className:"core-page-frame__column",children:[e2!=null&&t("header",{className:"core-page-frame__header",children:e2}),r2]})})}var Ne=["neutral","strong","accent","info","success","warning","danger"],Pe=()=>typeof process>"u"||false;function J(e2,t2="neutral"){return typeof e2=="string"&&Ne.includes(e2)?e2:(typeof e2=="string"&&e2&&Pe()&&q(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${Ne.join(", ")}); using "${t2}".`),t2)}var Fe=["subtle","on-dark","inherit"];function Ie(e2,t2){return typeof e2=="string"&&(Fe.includes(e2)||Ne.includes(e2))?e2:t2}function Le(e2){return{"data-tone":e2,toned:!Fe.includes(e2)}}function Re({children:e2,as:n2="span",tone:r2,tabular:i2=false,className:a2,style:o2}){let{toned:s2,...c2}=Le(Ie(r2,"subtle"));return t(n2,{className:y("core-eyebrow",s2&&"core-toned",a2),...c2,"data-tabular":i2?"true":void 0,style:o2,children:e2})}function ze({title:e2,level:r2=2,eyebrow:i2,intro:a2,actions:o2,className:s2,...c2}){let l2=r2===1?"h1":"h2";return n("header",{...v(c2),className:y("core-page-head",s2),children:[i2&&t(Re,{as:"p",children:i2}),n("div",{className:"core-page-head__row",children:[t(l2,{className:"core-page-head__title","data-page-title":r2===1?void 0:"",children:e2}),o2!=null&&t("div",{className:"core-page-head__actions",children:o2})]}),a2!=null&&t("p",{className:"core-page-head__intro",children:a2})]})}var Be=Symbol.for("peripheries.viewer.context.v1"),Ve=20,He=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/,Ue=Object.freeze({audience:"client",roles:Object.freeze([])});function We(e2){if(!e2||typeof e2!="object")return Ue;let t2=e2,n2=[...new Set((Array.isArray(t2.roles)?t2.roles:[]).filter(e3=>typeof e3=="string"&&He.test(e3)&&e3.length<=40))].sort().slice(0,Ve);return{audience:t2.audience==="staff"?"staff":"client",roles:n2,...t2.previewing===true?{previewing:true}:{}}}var Ge=globalThis,Ke=Ge[Be]??=a(Ue);function qe({value:e2,children:n2}){return t(Ke.Provider,{value:We(e2),children:n2})}function Je(){return c(Ke)}var Ye=e2=>e2.audience==="staff",Xe=(e2,t2)=>e2.roles.includes(t2);function Ze(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}function Qe(e2){return e2?typeof e2=="string"?e2:e2.map(e3=>e3&&typeof e3.message=="string"?e3.message:"").filter(Boolean).join(" "):""}var $e=["accepted","tentative","declined"],et=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),tt=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2});function nt(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=et(t2,"UTC").format(n3);if(!e2.endOn)return`${r3} (all day)`;let i3=new Date(new Date(`${e2.endOn}T00:00:00Z`).getTime()-864e5);return i3.getTime()<=n3.getTime()?`${r3} (all day)`:`${r3} – ${et(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=et(t2,n2).format(r2),a2=tt(t2,n2).format(r2);if(!e2.endsAt)return`${i2} · ${a2}`;let o2=new Date(e2.endsAt);return Number.isNaN(o2.getTime())||o2.getTime()===r2.getTime()?`${i2} · ${a2}`:`${i2} · ${a2} – ${tt(t2,n2).format(o2)}`}var rt=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function it(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function at(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function ot(e2){return e2.success?"":e2.code==="DENIED"?"You can't do that here.":e2.code==="CONFLICT"?"Someone changed this first. Reload and try again.":e2.code==="INVALID"?Qe(e2.errors)||"Some details are missing or not valid.":Qe(e2.errors)||"Something went wrong. Try again."}function st(e2,t2){let n2=typeof e2=="string"?new Date(e2):e2;return new Intl.DateTimeFormat("en-CA",{timeZone:t2,year:"numeric",month:"2-digit",day:"2-digit"}).format(n2)}function Y(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function ct(e2){return Y(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function lt(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Y(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Y(r2,1))n2.push(r2);return n2}return e2.startsAt?[st(e2.startsAt,t2)]:[]}var ut=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function X(e2){if(typeof e2!="string")return;let t2=e2.replace(/\s+/g," ").trim();if(t2!=="")return t2.length>60?`${t2.slice(0,59)}…`:t2}var dt="This can’t be done from here yet.";function ft(e2){let[t2,n2]=h(null),[r2,i2]=h(""),a2=m(false),o2=typeof e2=="function";return{run:s(async(t3,r3)=>{if(typeof e2!="function"||a2.current)return{ok:false};a2.current=true,n2(t3),i2("");try{let n3=await e2(r3?{action:t3,values:r3}:{action:t3});return n3&&typeof n3=="object"&&n3.success===false?(i2(ot(n3)||"Something went wrong. Try again."),{ok:false,result:n3}):{ok:true,result:n3}}catch{return i2("Something went wrong. Try again."),{ok:false}}finally{a2.current=false,n2(null)}},[e2]),busy:t2,message:r2,available:o2,clearMessage:()=>i2("")}}function pt(e2){if(typeof e2!="string")return;let t2=e2.trim();if(t2===""||/[\\\u0000-\u001f]/.test(t2))return;let n2=t2;for(let e3=0;e3<3;e3++)try{let e4=decodeURIComponent(n2);if(e4===n2)break;n2=e4}catch{return}if(/[\\\u0000-\u001f]/.test(n2)||n2.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n2))return;let r2=n2.split(/[?#]/)[0]??"";if(!(/^\/(auth|api)(\/|$)/i.test(r2.replace(/\/\.\//g,"/"))||/(^|\/)\.\.(\/|$)/.test(r2)))return/^[/?#]/.test(t2)?t2:void 0}var mt={unreleased:"wait",released:"shared",changed:"ready",staff:"stop",withdrawn:"out"};function ht(e2){if(e2?.state==="staff_only")return{words:"Staff only",mark:mt.staff};if(e2?.state==="withdrawn")return{words:"Withdrawn · not visible to client",mark:mt.withdrawn};if(e2?.state!=="released")return{words:"Not released yet",mark:mt.unreleased};let t2=e2.number,n2=e2.hasChanges===true;return{words:`Visible to client${typeof t2=="number"&&Number.isInteger(t2)&&t2>0?` · release ${t2}`:""}${n2?" · edited since":""}`,mark:n2?mt.changed:mt.released}}function gt(e2){let{release:r2,canRelease:i2=true,onIntent:a2,className:o2,style:s2}=e2,c2=u(),l2=Ye(Je()),{run:d2,busy:f2,message:p2,available:m2}=ft(a2);if(!l2)return null;let{words:h2,mark:g2}=ht(r2),_2=e2.busy===true||f2==="release",v2=pt(e2.versionsHref),b2=pt(e2.viewAsHref),x2=r2?.state==="staff_only",S2=i2!==false&&m2&&!x2,C2=_2?"Releasing…":r2?.state==="withdrawn"?"Release again":r2?.state==="released"&&r2.hasChanges===true?"Release changes":"Release",w2=[];(v2||m2)&&w2.push({id:"versions",label:"Versions",href:v2,action:"view_versions"}),!x2&&(b2||m2)&&w2.push({id:"view-as",label:"View as client",href:b2,action:"view_as_client"}),m2&&w2.push({id:"edit",label:"Edit with the assistant",action:"edit_with_assistant"});let T2=w2.map(e3=>({id:e3.id,label:e3.label,...e3.href?{href:e3.href}:{onSelect:()=>void d2(e3.action)}}));return n("div",{className:y("core-page-staff-tools",o2),style:s2,role:"group","aria-label":"Staff tools for this page","data-state":x2?"staff_only":r2?.state==="released"?"released":"unreleased","aria-busy":_2||void 0,children:[n("div",{className:"core-page-staff-tools__bar",children:[n("span",{className:"core-page-staff-tools__pill",role:"status",children:[t("span",{className:"core-page-staff-tools__mark","data-mark":g2,"aria-hidden":"true"}),h2]}),n("div",{className:"core-page-staff-tools__actions",children:[S2?t("button",{type:"button",className:"core-page-staff-tools__button","data-primary":"",disabled:_2,"aria-describedby":`${c2}-note`,onClick:()=>void d2("release"),children:C2}):null,w2.map(e3=>e3.href?t("a",{className:"core-page-staff-tools__button core-page-staff-tools__other",href:e3.href,children:e3.label},e3.id):t("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__other",onClick:()=>void d2(e3.action),children:e3.label},e3.id)),T2.length>0?t(K,{label:"Staff tools",placement:"bottom-end",items:T2,trigger:t("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__more","aria-label":"More staff tools",children:"More"})}):null]})]}),t("span",{id:`${c2}-note`,className:"core-page-staff-tools__sr",children:S2?r2?.state==="released"?"Release makes the latest changes visible to the client.":"Release makes this page visible to the client.":""}),p2?t("p",{className:"core-page-staff-tools__message",role:"alert",children:p2}):null]})}function _t({label:e2,actions:r2,children:i2,rail:a2=false,anchor:o2,className:s2,...c2}){return t("section",{...v(c2),id:o2,"aria-label":e2,className:y("core-rule-section",s2),"data-rail":a2||void 0,children:n("div",{className:"core-rule-section__grid",children:[n("div",{className:"core-rule-section__head",children:[e2&&t(Re,{as:"p",children:e2}),r2!=null&&t("div",{className:"core-rule-section__actions",children:r2})]}),t("div",{className:"core-rule-section__body",children:i2})]})})}function vt({label:r2,children:i2,arrow:a2=true,className:o2,href:s2,action:c2,input:l2,actions:u2,navigate:d2,onClick:f2,...p2}){let m2=Ae({href:s2,action:c2,input:l2,actions:u2,navigate:d2,onClick:f2}),h2=n(e,{children:[t("span",{className:"core-underlined-action__label",children:i2??r2}),a2&&t("svg",{className:"core-underlined-action__arrow",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:"M5 12h14M13 6l6 6-6 6"})})]}),g2={...v(p2),className:y("core-underlined-action",o2)};return s2?t("a",{...g2,href:s2,onClick:m2.onClick,...m2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:h2}):t("button",{...g2,type:"button",onClick:m2.onClick,disabled:m2.busy,children:h2})}var yt=(e2="")=>e2.trim().split(/\s+/).filter(Boolean).map(e3=>e3[0].toUpperCase()).filter((e3,t2,n2)=>t2===0||t2===n2.length-1).join("").slice(0,2);function bt({name:e2,initials:n2,src:r2,alt:i2,size:a2="md",className:o2,...s2}){let[c2,l2]=h(false),u2=i2??e2??"";return t("span",{...v(s2),className:y("core-avatar",o2),"data-size":a2,role:"img","aria-label":u2||void 0,children:r2&&!c2?t("img",{src:r2,alt:"",onError:()=>l2(true)}):t("span",{"aria-hidden":"true",children:n2??yt(e2)})})}function xt({code:e2,children:n2,block:r2=false,className:i2,...a2}){let o2=n2??e2;return r2?t("pre",{...v(a2),className:y("core-code",i2),"data-block":"",children:t("code",{children:o2})}):t("code",{...v(a2),className:y("core-code",i2),children:o2})}var St={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function Ct({text:e2,children:n2,level:r2=2,size:i2,anchor:a2,className:o2,...s2}){let c2=Math.min(6,Math.max(1,Math.round(r2))),l2=`h${c2}`;return t(l2,{...v(s2),id:a2,className:y("core-heading",o2),"data-size":i2??St[c2],children:n2??e2})}var wt={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function Tt({text:e2,children:n2,as:r2="span",size:i2="md",weight:a2="normal",tone:o2="default",align:s2="start",truncate:c2=false,lines:l2,className:u2,...d2}){let f2=r2,p2=l2&&l2>0?Math.min(6,Math.round(l2)):void 0;return t(f2,{...v(d2),className:y("core-text",u2),"data-role":wt[i2]??"body","data-weight":a2,"data-tone":o2,"data-align":s2,"data-truncate":c2||void 0,"data-lines":p2,children:n2??e2})}function Et({label:e2,hint:r2,error:i2,required:a2,htmlFor:o2,hintId:s2,errorId:c2,as:l2="div",children:d2,className:f2,style:p2}){let m2=u().replace(/:/g,""),h2=s2??(r2?`${o2??m2}-hint`:void 0),g2=c2??(i2?`${o2??m2}-error`:void 0),_2=l2,v2=l2==="fieldset"?"legend":"label";return n(_2,{className:y("core-field",f2),style:p2,"data-invalid":i2?"":void 0,children:[e2&&n(v2,{className:"core-field__label",...v2==="label"&&o2?{htmlFor:o2}:{},children:[e2,a2&&n("span",{className:"core-field__required","aria-hidden":"true",children:[" ","*"]})]}),r2&&t("p",{className:"core-field__hint",id:h2,children:r2}),d2,i2&&t("p",{className:"core-field__error",id:g2,children:i2})]})}function Dt(e2,t2,n2){let r2=u(),i2=e2??`f${r2.replace(/:/g,"")}`,a2=t2?`${i2}-hint`:void 0,o2=n2?`${i2}-error`:void 0;return{control:i2,hintId:a2,errorId:o2,aria:{"aria-describedby":[a2,o2].filter(Boolean).join(" ")||void 0,"aria-invalid":n2?true:void 0}}}function Ot(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function kt({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,children:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:m2,className:g2,style:_2,ref:v2}){let b2=Dt(o2,u2,d2),[x2,S2]=h(r2??false),C2=e2??x2,w2=Ot(i2,a2);return t(Et,{className:y("core-checkbox",g2),style:_2,hint:u2,error:d2,hintId:b2.hintId,errorId:b2.errorId,children:n("label",{className:"core-choices__option","data-disabled":p2?"":void 0,children:[t("input",{ref:v2,id:b2.control,type:"checkbox",name:s2,checked:C2,required:f2,"aria-required":f2||void 0,disabled:p2,"aria-readonly":m2||void 0,onChange:t2=>{m2||(e2===void 0&&S2(t2.target.checked),w2(t2.target.checked))},...b2.aria}),n("span",{children:[l2??c2,f2&&t("span",{className:"core-field__required","aria-hidden":"true",children:" *"})]})]})})}function At({options:e2,value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:m2,orientation:g2="vertical",min:_2,max:v2,className:b2,style:x2,ref:S2}){let C2=[_2===void 0?"":`at least ${_2}`,v2===void 0?"":`at most ${v2}`].filter(Boolean).join(", "),w2=[u2,C2?`Choose ${C2}.`:""].filter(Boolean).join(" ")||void 0,T2=Dt(s2,w2,d2),[E2,D2]=h(i2??[]),O2=r2??E2,k2=Ot(a2,o2),A2=v2!==void 0&&O2.length>=v2;return t(Et,{as:"fieldset",className:y("core-choices",b2),style:x2,label:l2,hint:w2,error:d2,required:f2,hintId:T2.hintId,errorId:T2.errorId,children:t("div",{className:"core-choices__list","data-orientation":g2,role:"group",...T2.aria,children:e2.map((i3,a3)=>{let o3=O2.includes(i3.value);return n("label",{className:"core-choices__option","data-disabled":i3.disabled||p2?"":void 0,children:[t("input",{ref:a3===0?S2:void 0,id:a3===0?T2.control:void 0,type:"checkbox",name:c2,value:i3.value,checked:o3,disabled:i3.disabled||p2||!o3&&A2||m2&&!o3,"aria-readonly":m2||void 0,onChange:()=>{if(m2)return;let t2=e2.map(e3=>e3.value).filter(e3=>e3===i3.value?!o3:O2.includes(e3));r2===void 0&&D2(t2),k2(t2)}}),t("span",{children:i3.label})]},i3.value)})})})}function jt({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:u2,required:d2,disabled:f2,readOnly:p2,min:m2,max:g2,fromLabel:_2="From",toLabel:v2="To",className:b2,style:x2,ref:S2}){let C2=Dt(o2,l2,u2),[w2,T2]=h(r2??{from:null,to:null}),E2=e2??w2,D2=Ot(i2,a2),O2=(t2,n2)=>{if(p2)return;let r3={...E2,[t2]:n2===""?null:n2};e2===void 0&&T2(r3),D2(r3)},k2={disabled:f2,readOnly:p2,required:d2,"aria-required":d2||void 0,className:"core-input",...C2.aria};return t(Et,{as:"fieldset",className:y("core-date-range",b2),style:x2,label:c2,hint:l2,error:u2,required:d2,hintId:C2.hintId,errorId:C2.errorId,children:n("div",{className:"core-date-range__row",children:[n("label",{className:"core-date-range__part",children:[t("span",{className:"core-date-range__label",children:_2}),t("input",{ref:S2,id:C2.control,type:"date",name:s2?`${s2}.from`:void 0,value:E2.from??"",min:m2,max:E2.to??g2,onChange:e3=>O2("from",e3.target.value),...k2})]}),n("label",{className:"core-date-range__part",children:[t("span",{className:"core-date-range__label",children:v2}),t("input",{type:"date",name:s2?`${s2}.to`:void 0,value:E2.to??"",min:E2.from??m2,max:g2,onChange:e3=>O2("to",e3.target.value),...k2})]})]})})}function Mt(e2){return!Number.isFinite(e2)||e2<0?"":e2<1024?`${e2} B`:e2<1048576?`${(e2/1024).toFixed(+(e2<10240))} KB`:`${(e2/1048576).toFixed(1)} MB`}function Nt({value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:g2,upload:_2,accept:v2,hash:b2=false,className:x2,style:S2,ref:C2}){let w2=Dt(s2,u2,d2),[T2,E2]=h(i2??null),D2=r2===void 0?T2:r2,O2=Ot(a2,o2),[k2,A2]=h({busy:false,dragging:false}),j2=m(null),M2=e2=>{r2===void 0&&E2(e2),O2(e2)},N2=async e2=>{if(e2&&_2&&!g2&&!p2){A2({busy:true,dragging:false});try{let t2=await _2(e2,{hash:b2});"error"in t2?A2({busy:false,failed:t2.error,dragging:false}):(A2({busy:false,dragging:false}),M2(t2))}catch{A2({busy:false,failed:"That file couldn’t be stored. Try again.",dragging:false})}}},P2=e2=>{e2.preventDefault(),N2(e2.dataTransfer.files?.[0])},F2=d2??k2.failed;return t(Et,{className:y("core-file-field",x2),style:S2,label:l2,hint:u2,error:F2,required:f2,htmlFor:w2.control,hintId:w2.hintId,errorId:F2?`${w2.control}-error`:void 0,children:n("div",{className:"core-file-field__box","data-dragging":k2.dragging?"":void 0,"data-busy":k2.busy?"":void 0,onDragOver:e2=>{g2||p2||!_2||(e2.preventDefault(),k2.dragging||A2(e3=>({...e3,dragging:true})))},onDragLeave:()=>A2(e2=>({...e2,dragging:false})),onDrop:P2,children:[D2?n("div",{className:"core-file-field__file",children:[t("span",{className:"core-file-field__name",children:D2.file.name}),t("span",{className:"core-file-field__size",children:Mt(D2.file.size)}),!g2&&!p2&&t("button",{type:"button",className:"core-file-field__button",onClick:()=>M2(null),"aria-label":`Remove ${D2.file.name}`,children:"Remove"})]}):k2.busy?t("span",{className:"core-file-field__status",role:"status",children:"Uploading…"}):n(e,{children:[t("button",{ref:C2,id:w2.control,type:"button",className:"core-file-field__button",disabled:p2||g2||!_2,"aria-required":f2||void 0,"aria-describedby":[w2.hintId,F2?`${w2.control}-error`:void 0].filter(Boolean).join(" ")||void 0,"aria-invalid":F2?true:void 0,onClick:()=>j2.current?.click(),children:"Choose file"}),t("span",{className:"core-file-field__drop",children:"or drop it here"})]}),t("input",{ref:j2,type:"file",name:c2,accept:v2,hidden:true,tabIndex:-1,onChange:e2=>void N2(e2.target.files?.[0])})]})})}function Pt({options:e2,value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:m2,orientation:g2="vertical",className:_2,style:v2,ref:b2}){let x2=Dt(s2,u2,d2),[S2,C2]=h(i2??null),w2=r2===void 0?S2:r2,T2=Ot(a2,o2),E2=c2??x2.control;return t(Et,{as:"fieldset",className:y("core-choices",_2),style:v2,label:l2,hint:u2,error:d2,required:f2,hintId:x2.hintId,errorId:x2.errorId,children:t("div",{className:"core-choices__list","data-orientation":g2,role:"radiogroup","aria-required":f2||void 0,...x2.aria,children:e2.map((e3,i3)=>n("label",{className:"core-choices__option","data-disabled":e3.disabled||p2?"":void 0,children:[t("input",{ref:i3===0?b2:void 0,id:i3===0?x2.control:void 0,type:"radio",name:E2,value:e3.value,checked:w2===e3.value,disabled:e3.disabled||p2||m2&&w2!==e3.value,onChange:()=>{m2||(r2===void 0&&C2(e3.value),T2(e3.value))}}),t("span",{children:e3.label})]},e3.value))})})}var Ft=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function It({type:e2="text",value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:u2,hint:d2,error:f2,required:p2,disabled:m2,readOnly:g2,placeholder:_2,inputMode:v2,autoComplete:b2,min:x2,max:S2,step:C2,prefix:w2,suffix:T2,onEnter:E2,onKeyDown:D2,onBlur:O2,className:k2,style:A2,ref:j2}){let M2=Dt(s2,d2,f2),[N2,P2]=h(i2),F2=r2===void 0?N2:r2,I2=Ot(a2,o2),L2=e3=>e3==null?"":String(e3),[R2,z2]=h(L2(F2));l(()=>{e2==="number"&&Ft(R2)!==(F2??null)&&z2(L2(F2))},[F2]);let B2=t("input",{ref:j2,id:M2.control,name:c2,type:e2==="number"?"text":e2,className:"core-input core-text-field__input",value:e2==="number"?R2:L2(F2),onChange:t2=>{let n2=t2.target.value,i3=e2==="number"?Ft(n2):n2;e2==="number"&&z2(n2),r2===void 0&&P2(i3),I2(i3)},onKeyDown:e3=>{D2?.(e3),!e3.defaultPrevented&&E2&&e3.key==="Enter"&&!e3.shiftKey&&!e3.nativeEvent.isComposing&&e3.keyCode!==229&&E2(e3)},onBlur:O2,placeholder:_2,inputMode:v2??(e2==="number"?"decimal":void 0),autoComplete:b2,min:e2==="number"?void 0:x2,max:e2==="number"?void 0:S2,step:e2==="number"?void 0:C2,required:p2,"aria-required":p2||void 0,disabled:m2,readOnly:g2,...M2.aria}),ee2=w2||T2?n("div",{className:"core-text-field__affixed",children:[w2&&t("span",{className:"core-text-field__affix","aria-hidden":"true",children:w2}),B2,T2&&t("span",{className:"core-text-field__affix","aria-hidden":"true",children:T2})]}):B2;return t(Et,{className:y("core-text-field",k2),style:A2,label:u2,hint:d2,error:f2,required:p2,htmlFor:M2.control,hintId:M2.hintId,errorId:M2.errorId,children:ee2})}function Lt({value:e2,defaultValue:r2,onChange:i2,setValue:a2,label:o2="Search",onSearch:s2,size:c2="md",className:l2,...u2}){let[d2,f2]=h(r2??""),p2=e2??d2,m2=t2=>{e2===void 0&&f2(t2),i2?.(t2),a2?.(t2)};return n("div",{className:y("core-search-field",l2),"data-filled":p2?"":void 0,"data-size":c2,children:[t(It,{...u2,label:o2,value:p2,onChange:e3=>m2(typeof e3=="string"?e3:""),onEnter:()=>s2?.(p2),inputMode:"search",className:"core-search-field__field"}),n("svg",{className:"core-search-field__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:[t("circle",{cx:"11",cy:"11",r:"6.5"}),t("path",{d:"M16 16l4 4"})]}),p2&&!u2.disabled&&!u2.readOnly&&t("button",{type:"button",className:"core-search-field__clear","aria-label":"Clear search",onClick:()=>m2(""),children:t("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function Rt({options:e2,value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:m2,placeholder:g2="Choose…",className:_2,style:v2,ref:b2}){let x2=Dt(s2,u2,d2),[S2,C2]=h(i2??null),w2=r2===void 0?S2:r2,T2=Ot(a2,o2);return t(Et,{className:y("core-select",_2),style:v2,label:l2,hint:u2,error:d2,required:f2,htmlFor:x2.control,hintId:x2.hintId,errorId:x2.errorId,children:n("select",{ref:b2,id:x2.control,name:c2,className:"core-input core-select__input",value:w2??"",onChange:e3=>{let t2=e3.target.value===""?null:e3.target.value;r2===void 0&&C2(t2),T2(t2)},required:f2,"aria-required":f2||void 0,disabled:p2||m2,"aria-readonly":m2||void 0,...x2.aria,children:[t("option",{value:"",children:g2}),e2.map(e3=>t("option",{value:e3.value,disabled:e3.disabled,children:e3.label},e3.value))]})})}function zt({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:u2,required:d2,disabled:f2,readOnly:p2,min:m2=0,max:g2=100,step:_2=1,format:v2=String,className:b2,style:x2,ref:S2}){let C2=Dt(o2,l2,u2),[w2,T2]=h(r2??m2),E2=e2??w2,D2=Ot(i2,a2);return t(Et,{className:y("core-slider",b2),style:x2,label:c2,hint:l2,error:u2,required:d2,htmlFor:C2.control,hintId:C2.hintId,errorId:C2.errorId,children:n("div",{className:"core-slider__row",children:[t("input",{ref:S2,id:C2.control,name:s2,type:"range",className:"core-slider__input",min:m2,max:g2,step:_2,value:E2,disabled:f2,"aria-readonly":p2||void 0,"aria-valuetext":v2(E2),onChange:t2=>{if(p2)return;let n2=Number(t2.target.value);e2===void 0&&T2(n2),D2(n2)},...C2.aria}),t("output",{className:"core-slider__value",htmlFor:C2.control,children:v2(E2)})]})})}function Bt({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:u2,disabled:d2,readOnly:f2,className:p2,style:m2,ref:g2}){let _2=Dt(o2,l2,u2),[v2,b2]=h(r2??false),x2=e2??v2,S2=Ot(i2,a2);return n("div",{className:y("core-switch",p2),style:m2,children:[n("button",{ref:g2,id:_2.control,name:s2,type:"button",role:"switch","aria-checked":x2,"aria-readonly":f2||void 0,disabled:d2,className:"core-switch__control",onClick:()=>{f2||(e2===void 0&&b2(!x2),S2(!x2))},..._2.aria,children:[t("span",{className:"core-switch__track","aria-hidden":"true",children:t("span",{className:"core-switch__thumb"})}),t("span",{className:"core-switch__label",children:c2})]}),l2&&t("p",{className:"core-field__hint",id:_2.hintId,children:l2}),u2&&t("p",{className:"core-field__error",id:_2.errorId,children:u2})]})}function Vt({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:u2,required:f2,disabled:p2,readOnly:g2,placeholder:_2,rows:v2=3,autoGrow:b2=true,maxLength:x2,onKeyDown:S2,onBlur:C2,className:w2,style:T2,ref:E2}){let D2=Dt(o2,l2,u2),[O2,k2]=h(r2??""),A2=e2??O2,j2=Ot(i2,a2),M2=m(null);return d(()=>{let e3=M2.current;b2&&e3&&(e3.style.height="auto",e3.style.height=`${e3.scrollHeight+2}px`)},[A2,b2]),n(Et,{className:y("core-text-area",w2),style:T2,label:c2,hint:l2,error:u2,required:f2,htmlFor:D2.control,hintId:D2.hintId,errorId:D2.errorId,children:[t("textarea",{ref:e3=>{M2.current=e3,typeof E2=="function"?E2(e3):E2&&(E2.current=e3)},id:D2.control,name:s2,className:"core-input core-text-area__input",rows:v2,value:A2,onChange:t2=>{e2===void 0&&k2(t2.target.value),j2(t2.target.value)},onKeyDown:S2,onBlur:C2,placeholder:_2,maxLength:x2,required:f2,"aria-required":f2||void 0,disabled:p2,readOnly:g2,...D2.aria}),x2!==void 0&&n("span",{className:"core-field__hint","aria-live":"polite",children:[A2.length," / ",x2]})]})}function Ht({label:e2,children:n2,tone:r2,variant:i2="soft",className:a2,...o2}){return t("span",{...v(o2),className:y("core-badge","core-toned",a2),"data-tone":J(r2),"data-variant":i2,children:n2??e2})}function Ut({message:e2,title:r2,action:i2,className:a2,...o2}){return n("div",{...v(o2),className:y("core-empty-state",a2),role:"status",children:[r2&&t("p",{className:"core-empty-state__title",children:r2}),t("p",{className:"core-empty-state__message",children:e2}),i2!=null&&t("div",{className:"core-empty-state__action",children:i2})]})}var Wt={info:"M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",success:"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",warning:"M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",danger:"M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"};function Gt({title:e2,message:r2,children:i2,tone:a2,action:o2,onDismiss:s2,className:c2,...l2}){let u2=J(a2,"info"),d2=u2==="warning"||u2==="danger";return n("div",{...v(l2),role:d2?"alert":"status",className:y("core-notice","core-toned",c2),"data-tone":u2,children:[t("svg",{className:"core-notice__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:Wt[u2]??Wt.info})}),n("div",{className:"core-notice__body",children:[e2&&t("p",{className:"core-notice__title",children:e2}),t("div",{className:"core-notice__message",children:i2??r2})]}),o2&&t("div",{className:"core-notice__action",children:o2}),s2&&t("button",{type:"button",className:"core-notice__dismiss","aria-label":"Dismiss",onClick:s2,children:t("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function Kt({value:e2,max:r2=100,label:i2,showValue:a2=false,tone:o2,size:s2="md",className:c2,style:l2,...u2}){let d2=typeof e2=="number"&&Number.isFinite(e2)&&r2>0,f2=d2?Math.max(0,Math.min(100,e2/r2*100)):0;return n("div",{...v(u2),className:y("core-progress","core-toned",c2),"data-tone":J(o2,"accent"),"data-size":s2,style:l2,children:[(i2||a2&&d2)&&n("div",{className:"core-progress__head",children:[i2&&t("span",{className:"core-progress__label",children:i2}),a2&&d2&&n("span",{className:"core-progress__value",children:[Math.round(f2),"%"]})]}),t("div",{className:"core-progress__track",role:"progressbar","aria-label":i2,"aria-valuemin":0,"aria-valuemax":d2?r2:void 0,"aria-valuenow":d2?e2:void 0,"data-indeterminate":d2?void 0:"",style:x({"--core-progress-fill":`${f2}%`}),children:t("div",{className:"core-progress__fill"})})]})}function qt({shape:e2="text",lines:n2=3,width:r2,height:i2,className:a2,style:o2,...s2}){let c2=x({"--core-skeleton-w":b(r2),"--core-skeleton-h":b(i2)},o2);if(e2!=="text")return t("span",{...v(s2),"aria-hidden":"true",className:y("core-skeleton",a2),"data-shape":e2,style:c2});let l2=Math.max(1,Math.min(12,Math.round(n2)));return t("span",{...v(s2),"aria-hidden":"true",className:y("core-skeleton-lines",a2),style:c2,children:Array.from({length:l2},(e3,n3)=>t("span",{className:"core-skeleton","data-shape":"line","data-last":n3===l2-1&&l2>1?"":void 0},n3))})}function Jt({label:e2="Loading",size:n2="md",className:r2,...i2}){return t("span",{...v(i2),role:"status","aria-label":e2,className:y("core-spinner",r2),"data-size":n2})}function Yt({content:e2,text:r2,children:i2,side:a2="top",className:o2,...s2}){let[c2,d2]=h(false),f2=u();return l(()=>{if(!c2)return;let e3=e4=>{e4.key==="Escape"&&d2(false)};return document.addEventListener("keydown",e3),()=>document.removeEventListener("keydown",e3)},[c2]),n("span",{...v(s2),className:y("core-tooltip",o2),"aria-describedby":f2,onMouseEnter:()=>d2(true),onMouseLeave:()=>d2(false),onFocus:()=>d2(true),onBlur:()=>d2(false),children:[i2,t("span",{id:f2,role:"tooltip",className:"core-tooltip__bubble","data-side":a2,"data-open":c2?"":void 0,children:e2??r2})]})}function Xt({children:r2,label:i2,variant:a2="primary",size:o2="md",tone:s2="neutral",iconLeft:c2,iconRight:l2,loading:u2=false,disabled:d2=false,type:f2="button",fullWidth:p2=false,className:m2,href:h2,action:g2,input:_2,actions:b2,navigate:x2,onClick:S2,...C2}){let w2=Ae({href:h2,action:g2,input:_2,actions:b2,navigate:x2,onClick:S2}),T2=u2||w2.busy,E2={...v(C2),className:y("core-button",m2),"data-variant":a2,"data-size":o2,"data-tone":s2,"data-full":p2||void 0,"data-busy":T2||void 0},D2=n(e,{children:[T2?t("span",{className:"core-button__spinner","aria-hidden":"true"}):c2,t("span",{className:"core-button__label",children:r2??i2}),l2]});return h2&&!d2?t("a",{...E2,href:h2,onClick:w2.onClick,"aria-busy":T2||void 0,...w2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:D2}):t("button",{...E2,type:f2,disabled:d2||T2,"aria-busy":T2||void 0,onClick:w2.onClick,children:D2})}function Zt({children:e2,label:r2,variant:i2="prompt",size:a2="md",selected:o2,onToggle:s2,iconLeft:c2,disabled:l2=false,className:u2,href:d2,action:f2,input:p2,actions:m2,navigate:h2,onClick:g2,..._2}){let b2=o2!==void 0||s2!==void 0,x2=Ae({href:d2,action:f2,input:p2,actions:m2,navigate:h2,onClick:g2??(s2?()=>s2(!o2):void 0)});return n("button",{...v(_2),type:"button",className:y("core-chip",u2),"data-variant":i2,"data-size":a2,"aria-pressed":b2?!!o2:void 0,disabled:l2||x2.busy,onClick:x2.onClick,children:[c2,t("span",{className:"core-chip__label",children:e2??r2})]})}function Qt({icon:e2,children:n2,label:r2,size:i2="md",variant:a2="ghost",pressed:o2,disabled:s2=false,className:c2,href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2,...h2}){let g2=Ae({href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2}),_2={...v(h2),className:y("core-icon-button",c2),"data-size":i2,"data-variant":a2,"aria-label":r2,title:r2},b2=t("span",{className:"core-icon-button__glyph","aria-hidden":"true",children:e2??n2});return l2&&!s2?t("a",{..._2,href:l2,onClick:g2.onClick,...g2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:b2}):t("button",{..._2,type:"button","aria-pressed":o2,disabled:s2||g2.busy,onClick:g2.onClick,children:b2})}function $t({href:r2,children:i2,label:a2,variant:o2="default",className:s2,navigate:c2,onClick:l2,...u2}){let d2=Ae({href:r2,navigate:c2,onClick:l2});return Oe(r2)||ke(r2)||/^(https?:|mailto:)/i.test(r2)?n("a",{...v(u2),className:y("core-link",s2),"data-variant":o2,href:r2,onClick:d2.onClick,...d2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[i2??a2,d2.external&&n(e,{children:[t("svg",{className:"core-link__away",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:"M7 17L17 7M8 7h9v9"})}),t("span",{className:"core-link__note",children:" (opens in a new tab)"})]})]}):t("span",{className:y("core-link",s2),children:i2??a2})}function en({options:e2,value:n2,defaultValue:r2,onChange:i2,label:a2,fullWidth:o2=false,size:s2="md",className:c2,setValue:l2,...d2}){let[f2,p2]=h(r2??e2[0]?.value),g2=n2??f2,_2=u(),b2=m([]),x2=e3=>{n2===void 0&&p2(e3),i2?.(e3),l2?.(e3)},S2=e2.map((e3,t2)=>e3.disabled?-1:t2).filter(e3=>e3>=0),C2=(t2,n3)=>{let r3=t2.key==="ArrowRight"||t2.key==="ArrowDown"?1:t2.key==="ArrowLeft"||t2.key==="ArrowUp"?-1:0;if(!r3||!S2.length)return;t2.preventDefault();let i3=S2.indexOf(n3),a3=S2[(i3+r3+S2.length)%S2.length];b2.current[a3]?.focus(),x2(e2[a3].value)};return t("div",{...v(d2),role:"radiogroup","aria-label":a2,className:y("core-segmented",c2),"data-full":o2||void 0,"data-size":s2,children:e2.map((e3,n3)=>{let r3=e3.value===g2;return t("button",{ref:e4=>{b2.current[n3]=e4},type:"button",role:"radio",name:_2,"aria-checked":r3,tabIndex:r3||g2===void 0&&n3===S2[0]?0:-1,disabled:e3.disabled,className:"core-segmented__option",onClick:()=>x2(e3.value),onKeyDown:e4=>C2(e4,n3),children:e3.label},e3.value)})})}function tn({items:e2=[],children:r2,numbered:i2=false,single:a2=false,rules:o2="subtle",className:s2,...c2}){let l2=u(),d2=i2?"ol":"ul";return n("div",{...v(c2),className:y("core-accordion",s2),"data-rules":o2,children:[e2.length>0&&t(d2,{className:"core-accordion__list","data-numbered":i2||void 0,children:e2.map((e3,r3)=>t("li",{className:"core-accordion__item",children:n("details",{className:"core-disclosure",name:a2?l2:void 0,open:e3.open||void 0,children:[n("summary",{className:"core-disclosure__summary",children:[i2&&t("span",{className:"core-accordion__number",children:r3+1}),e3.question]}),t("div",{className:"core-disclosure__content",children:e3.answer})]})},e3.id??r3))}),r2]})}function nn({media:e2,header:r2,body:i2,footer:a2,children:o2,tone:s2="plain",className:c2,...l2}){return n("article",{...v(l2),className:y("core-card",c2),"data-tone":s2,children:[e2!=null&&t("div",{className:"core-card__media",children:e2}),r2!=null&&t("header",{className:"core-card__header",children:r2}),(i2!=null||o2!=null)&&n("div",{className:"core-card__body",children:[i2,o2]}),a2!=null&&t("footer",{className:"core-card__footer",children:a2})]})}var rn={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function an({start:e2,end:r2,children:i2,ratio:a2="1:1",gap:o2,stackBelow:s2="compact",className:c2,...l2}){return n("div",{...v(l2),className:y("core-columns",c2),"data-stack":s2,children:[n("div",{className:"core-columns__grid",style:x({"--core-columns-template":rn[a2]??rn["1:1"],"--core-columns-gap":b(o2)}),children:[t("div",{className:"core-columns__start",children:e2}),t("div",{className:"core-columns__end",children:r2})]}),i2]})}var on=an;function sn({summary:e2,content:r2,children:i2,open:a2=false,onToggle:o2,className:s2,...c2}){return n("details",{...v(c2),className:y("core-disclosure",s2),open:a2||void 0,onToggle:o2?e3=>o2(e3.currentTarget.open):void 0,children:[t("summary",{className:"core-disclosure__summary",children:e2}),n("div",{className:"core-disclosure__content",children:[r2,i2]})]})}function cn({items:e2,children:n2,min:i2,columns:a2,gap:o2,className:s2,style:c2,...l2}){let u2=[...r.toArray(e2),...r.toArray(n2)];return t("div",{...v(l2),className:y("core-grid",s2),"data-capped":a2&&a2>0?"":void 0,style:x({"--core-grid-min":b(i2),"--core-grid-gap":b(o2),"--core-grid-cols":a2&&a2>0?String(Math.round(a2)):void 0},c2),children:u2})}function ln({item:e2,each:n2,as:i2,layout:a2="stack",gap:o2,min:s2,empty:c2,className:l2,style:u2,...d2}){let f2=r.toArray(e2);return f2.length?t("div",{...v(d2),className:y("core-repeat",l2),"data-layout":a2,style:x({"--core-repeat-gap":b(o2),"--core-repeat-min":b(s2)},u2),children:f2}):c2?t("p",{className:"core-repeat__empty",children:c2}):null}var un=["page-x-of-y","page-number","page-count"],dn={display:{size:46,lineHeight:.98,weight:500,tracking:"-0.032em"},heading:{size:28,lineHeight:1.05,weight:500,tracking:"-0.03em"},subhead:{size:20,lineHeight:1.15,weight:500,tracking:"-0.02em"},title:{size:17,lineHeight:1.3,weight:500,tracking:"-0.018em"},body:{size:15,lineHeight:1.65,weight:400,tracking:"-0.012em"},bodySmall:{size:13,lineHeight:1.65,weight:400,tracking:"-0.012em"},label:{size:13,lineHeight:1.4,weight:500,tracking:"-0.015em"},note:{size:12,lineHeight:1.7,weight:400,tracking:"-0.012em"},eyebrow:{size:12,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},fn={full:"var(--color-text)",muted:"var(--color-text-muted)",subtle:"var(--color-text-subtle)",border:"var(--color-border)",accent:"var(--color-accent)",accentText:"var(--color-link)",sunken:"var(--color-surface-sunken)"},pn=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],mn=[{id:"workbook",label:"Workbook",sheet:{width:"8.5in",height:"11in"},margins:{top:"0.60in",right:"0.70in",bottom:"0.55in",left:"0.95in"},measure:"6.85in",bodyMeasureCh:64,rail:{placement:"strip"},ink:fn,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:dn,floorPx:12,depth:{max:1,indent:["0"],numbering:"none"},fills:true,regions:{"page-footer":{left:"member-ref",centre:"document-id",right:"page-x-of-y"}},sections:{known:pn,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:pn,required:["next-steps","talk-it-through"]}},{id:"instrument",extends:"workbook",label:"Instrument",sheet:{width:"8.5in",height:"11in"},margins:{top:"1.00in",right:"1.00in",bottom:"1.00in",left:"1.25in"},measure:"4.50in",bodyMeasureCh:void 0,rail:{placement:"column",axis:"4.75in",width:"1.50in",gutter:"0.25in"},ink:{full:"#000000",muted:"rgba(0,0,0,0.70)",subtle:"rgba(0,0,0,0.62)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...dn,eyebrow:{...dn.eyebrow,tracking:"0.08em"}},depth:{max:3,indent:["0","0.375in","0.75in"],numbering:"ladder"},fills:false,regions:{"page-footer":{left:"execution-state",right:"page-x-of-y"}},requiredBindings:["execution-state"],sections:{required:[]}}],hn=new Map;function gn(e2){hn.set(e2.id,e2)}for(let e2 of mn)gn(e2);function _n(){return[...hn.keys()].sort()}function vn(e2){let t2=hn.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${_n().join(", ")}`);if(!t2.extends)return t2;let n2=hn.get(t2.extends);if(!n2)throw Error(`[document-profile] "${e2}" extends unknown profile "${t2.extends}"`);if(n2.extends)throw Error(`[document-profile] "${e2}" extends "${n2.id}", which extends "${n2.extends}": inheritance is one level deep.`);return{...n2,...t2,id:t2.id,extends:t2.extends}}function yn(){let e2={};for(let t2 of _n())try{e2[t2]=vn(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var bn=Object.freeze(yn()),xn="workbook";function Sn(e2,t2){try{return vn(e2)}catch{return q(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function Z(e2,t2){return e2===void 0?(q("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${xn}". If this document is an instrument, its numbering and depth are being dropped.`),Sn(xn,t2)):Sn(e2,t2)}var Cn=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),wn=["full","muted","subtle","border","accent","accentText","sunken"],Tn=["structural","hairline","head","row"],En=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],Dn=3,On="initial";function kn(e2){let t2={"--doc-sheet-width":e2.sheet.width,"--doc-sheet-height":e2.sheet.height,"--doc-margin-top":e2.margins.top,"--doc-margin-right":e2.margins.right,"--doc-margin-bottom":e2.margins.bottom,"--doc-margin-left":e2.margins.left,"--doc-measure":e2.measure,"--doc-body-measure":e2.bodyMeasureCh?`${e2.bodyMeasureCh}ch`:"none","--doc-rail-axis":e2.rail.axis??On,"--doc-rail-width":e2.rail.width??On,"--doc-rail-gutter":e2.rail.gutter??On,"--doc-floor":`${e2.floorPx}px`};for(let n2 of wn)t2[`--doc-ink-${Cn(n2)}`]=e2.ink[n2];for(let n2 of Tn)t2[`--doc-rule-${n2}`]=e2.rules[n2]??On;for(let n2 of En){let r2=e2.type[n2],i2=`--doc-type-${Cn(n2)}`;t2[`${i2}-size`]=`${r2.size}px`,t2[`${i2}-leading`]=String(r2.lineHeight),t2[`${i2}-weight`]=String(r2.weight),t2[`${i2}-tracking`]=r2.tracking,t2[`${i2}-case`]=r2.uppercase?"uppercase":"none"}for(let n2=1;n2<=Dn;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??On;return t2}var An=(e2,t2)=>`${e2} {
1
+ import{Children as e,cloneElement as t,createContext as n,isValidElement as r,useCallback as i,useContext as a,useEffect as o,useId as s,useLayoutEffect as c,useMemo as l,useReducer as u,useRef as d,useState as f,useSyncExternalStore as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";var _=new Set(["baseProps","data","status","actions","_traversal","isLoading","error","navigate","onNavigate","size","store"]);function v(e2){let t2={};for(let n2 in e2)_.has(n2)||(t2[n2]=e2[n2]);return t2}var y=(...e2)=>e2.filter(Boolean).join(" ")||void 0,b=e2=>e2===void 0?void 0:typeof e2=="number"?`${e2}px`:e2;function x(e2,t2){let n2=Object.fromEntries(Object.entries(e2).filter(([,e3])=>e3!==void 0));return Object.keys(n2).length||t2?{...n2,...t2}:void 0}var S=Symbol.for("peripheries.embed.context.v1"),C=globalThis,w=C[S]??=n(false);function T(){return a(w)}function E({as:e2,className:t2,children:n2,...r2}){return h(e2??"div",{className:y("core-box",t2),...v(r2),children:n2})}function D({minHeight:e2,className:t2,style:n2,children:r2,...i2}){return h(E,{...i2,className:y("core-center",t2),style:x({"--core-center-min-height":b(e2)},n2),children:r2})}function O({name:e2,className:t2,style:n2,children:r2,...i2}){return h(E,{...i2,className:y("core-container",t2),style:x({"--core-container-name":e2},n2),children:r2})}function k({orientation:e2="horizontal",weight:t2="subtle",spacing:n2,className:r2,style:i2,ref:a2,...o2}){let s2={className:y("core-divider",r2),"data-weight":t2,"data-orientation":e2,style:x({"--core-divider-spacing":b(n2)},i2)};return e2==="vertical"?h("span",{role:"separator","aria-orientation":"vertical",...s2}):h("hr",{ref:a2,...v(o2),...s2})}function A({when:e2,children:t2,as:n2="span"}){return h(n2,{className:"core-hide","data-when":e2,children:t2})}function j({gap:e2,align:t2="center",justify:n2="start",wrap:r2=true,stackWhen:i2,className:a2,style:o2,children:s2,...c2}){return h(E,{...c2,className:y("core-inline",a2),"data-align":t2,"data-justify":n2,"data-wrap":r2?"true":"false","data-stack-when":i2,style:x({"--core-inline-gap":b(e2)},o2),children:s2})}var M=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[contenteditable=""]','[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function N(e2){return[...e2.querySelectorAll(M)].filter(e3=>!e3.closest("[inert]")&&!e3.hidden&&e3.getAttribute("aria-hidden")!=="true")}var P=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,F=2;function I({label:t2,snap:n2="start",children:r2,className:a2,...s2}){let c2=d(null),[l2,u2]=f({prev:false,next:false}),[p2,m2]=f(false),_2=i(()=>{let e2=c2.current;if(!e2)return;let t3=e2.scrollLeft>F,n3=e2.scrollWidth-e2.clientWidth-e2.scrollLeft>F;u2(e3=>e3.prev===t3&&e3.next===n3?e3:{prev:t3,next:n3}),m2(e2.scrollWidth>e2.clientWidth&&N(e2).length===0)},[]);o(()=>{let e2=c2.current;if(!e2)return;_2();let t3=new ResizeObserver(_2);t3.observe(e2);for(let n3 of Array.from(e2.children))t3.observe(n3);return()=>t3.disconnect()},[_2,r2]);let b2=e2=>{let t3=c2.current;t3&&t3.scrollBy({left:e2*t3.clientWidth*.8,behavior:P()?"auto":"smooth"})};return g("div",{...v(s2),className:y("core-rail",a2),"data-snap":n2,"data-prev":l2.prev?"":void 0,"data-next":l2.next?"":void 0,children:[h("button",{type:"button",className:"core-rail__arrow","data-direction":"prev","aria-label":`Scroll ${t2} back`,hidden:!l2.prev,onClick:()=>b2(-1),children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M10 3 5 8l5 5"})})}),h("ul",{ref:c2,role:"list","aria-label":t2,className:"core-rail__track",tabIndex:p2?0:void 0,onScroll:_2,children:e.toArray(r2).map((e2,t3)=>h("li",{className:"core-rail__item",children:e2},t3))}),h("button",{type:"button",className:"core-rail__arrow","data-direction":"next","aria-label":`Scroll ${t2} forward`,hidden:!l2.next,onClick:()=>b2(1),children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"m6 3 5 5-5 5"})})})]})}function L({when:e2,children:t2,as:n2="span"}){return h(n2,{className:"core-show","data-when":e2,children:t2})}function R(e2,t2,n2){let[r2,a2]=f(t2),o2=e2!==void 0,s2=o2?e2:r2,c2=d(n2);return c2.current=n2,[s2,i(e3=>{o2||a2(e3),c2.current?.(e3)},[o2])]}function z(...e2){return t2=>{for(let n2 of e2)typeof n2=="function"?n2(t2):n2&&(n2.current=t2)}}function B(e2){let[t2,n2]=f(()=>typeof matchMedia=="function"&&matchMedia(e2).matches);return o(()=>{if(typeof matchMedia!="function")return;let t3=matchMedia(e2),r2=()=>n2(t3.matches);return r2(),t3.addEventListener("change",r2),()=>t3.removeEventListener("change",r2)},[e2]),t2}var ee=(e2,t2,n2)=>Math.max(t2,Math.min(e2,n2));function te({anchor:e2,size:t2,viewport:n2,placement:r2,gap:i2=4,margin:a2=8}){let[o2,s2="center"]=r2.split("-"),c2=n2.height-a2-e2.bottom-i2,l2=e2.top-i2-a2,u2=e3=>t2.height<=e3,d2=o2;o2==="bottom"&&!u2(c2)&&l2>c2?d2="top":o2==="top"&&!u2(l2)&&c2>l2&&(d2="bottom");let f2=d2==="bottom"?e2.bottom+i2:e2.top-i2-t2.height;return{x:ee(s2==="start"?e2.left:s2==="end"?e2.right-t2.width:(e2.left+e2.right)/2-t2.width/2,a2,Math.max(a2,n2.width-a2-t2.width)),y:ee(f2,a2,Math.max(a2,n2.height-a2-t2.height)),placement:s2==="center"?d2:`${d2}-${s2}`}}function V(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name","--a")}var H=4;function U({trigger:e2,label:n2,placement:r2="bottom-start",open:i2,defaultOpen:a2=false,onOpenChange:l2,popupRole:u2="dialog",initialFocus:p2,onTriggerKeyDown:_2,children:v2,className:b2}){let[x2,S2]=R(i2,a2,l2),C2=s(),w2=`--core-a${C2.replace(/\W/g,"")}`,T2=d(null),E2=d(null),[D2]=f(V),O2=d(x2);O2.current=x2;let k2=d("closed");c(()=>{let e3=T2.current;if(e3){if(x2&&k2.current==="closed")k2.current="open",e3.showPopover();else if(!x2&&k2.current==="open"){k2.current="closed";let t2=document.activeElement;(!t2||t2===document.body||e3.contains(t2))&&E2.current?.focus({preventScroll:true}),e3.hidePopover()}}},[x2]),o(()=>{let e3=T2.current;if(!e3)return;let t2=t3=>{let n4=t3.newState;if(k2.current=n4==="open"?"open":"closed",n4==="open"&&!O2.current&&S2(true),n4==="closed"&&O2.current){S2(false);let t4=document.activeElement;(!t4||t4===document.body||e3.contains(t4))&&E2.current?.focus({preventScroll:true})}},n3=t3=>{if(t3.newState!=="open"||p2===false)return;let n4=(typeof p2=="function"?p2(e3):p2?e3.querySelector(p2):null)??N(e3)[0];n4?n4.focus({preventScroll:true}):(e3.tabIndex=-1,e3.focus({preventScroll:true}))};return e3.addEventListener("beforetoggle",t2),e3.addEventListener("toggle",n3),()=>{e3.removeEventListener("beforetoggle",t2),e3.removeEventListener("toggle",n3)}},[S2,p2]),c(()=>{let e3=T2.current,t2=E2.current;if(D2||!x2||!e3||!t2)return;let n3=()=>{let n4=te({anchor:t2.getBoundingClientRect(),size:{width:e3.offsetWidth,height:e3.offsetHeight},viewport:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},placement:r2,gap:H});e3.style.setProperty("--core-popover-x",`${n4.x}px`),e3.style.setProperty("--core-popover-y",`${n4.y}px`),e3.dataset.placement=n4.placement,e3.dataset.placed=""};n3();let i3=new ResizeObserver(n3);return i3.observe(e3),window.addEventListener("resize",n3),window.addEventListener("scroll",n3,true),()=>{delete e3.dataset.placed,i3.disconnect(),window.removeEventListener("resize",n3),window.removeEventListener("scroll",n3,true)}},[D2,x2,r2]);let A2=()=>S2(false),j2=e2.props,M2={ref:z(E2,j2.ref),popoverTarget:C2,"aria-haspopup":u2,"aria-expanded":x2,"aria-controls":C2,className:y(j2.className,"core-popover-anchor"),style:{...j2.style,"--core-popover-anchor":w2},onKeyDown:e3=>{_2?.(e3),j2.onKeyDown?.(e3)}};return g(m,{children:[t(e2,M2),h("div",{ref:T2,id:C2,popover:"auto",role:u2==="menu"?void 0:u2,"aria-label":u2==="menu"?void 0:n2,className:y("core-popover",b2),"data-placement":r2,"data-placer":D2?"anchor":"script",style:{"--core-popover-anchor":w2},onBlur:e3=>{let t2=e3.relatedTarget;t2&&!e3.currentTarget.contains(t2)&&t2!==E2.current&&A2()},children:x2?typeof v2=="function"?v2({close:A2}):v2:null})]})}var W=Symbol.for("peripheries.overlay.scrollLock.v1"),G=globalThis;function ne(){if(typeof document>"u")return()=>{};let e2=G[W]??={count:0,overflow:""};e2.count===0&&(e2.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),e2.count+=1;let t2=false;return()=>{t2||(t2=true,--e2.count,e2.count===0&&(document.body.style.overflow=e2.overflow))}}function re({variant:e2,open:t2,onClose:n2,title:r2,label:i2,description:a2,role:c2="dialog",initialFocus:l2,dismissOnBackdrop:u2=true,headerStart:f2,headerTools:p2,footer:m2,children:_2,className:v2}){let b2=d(null),x2=d(null),S2=d(n2);S2.current=n2;let C2=s(),w2=s();o(()=>{let e3=b2.current;if(!e3||!t2)return;let n3=document.activeElement;e3.showModal();let r3=ne(),i3=(l2?e3.querySelector(l2):null)??N(e3)[0];i3?i3.focus({preventScroll:true}):e3.focus({preventScroll:true});let a3=e4=>{e4.preventDefault(),S2.current()};return e3.addEventListener("cancel",a3),()=>{e3.removeEventListener("cancel",a3),r3(),e3.open&&e3.close();let t3=document.activeElement;(!t3||t3===document.body)&&n3?.isConnected&&n3.focus({preventScroll:true})}},[t2,l2]);let T2=i2??(typeof r2=="string"?r2:"dialog");return h("dialog",{ref:b2,className:y("core-modal",v2),"data-variant":e2,role:c2==="alertdialog"?"alertdialog":void 0,"aria-labelledby":C2,"aria-describedby":a2?w2:void 0,tabIndex:-1,onKeyDown:e3=>{if(e3.key!=="Tab"||e3.defaultPrevented||e3.target.closest("dialog")!==e3.currentTarget)return;let t3=N(e3.currentTarget),n3=t3[0],r3=t3[t3.length-1];if(!n3||!r3)return e3.preventDefault();let i3=document.activeElement;e3.shiftKey&&(i3===n3||i3===e3.currentTarget)?(e3.preventDefault(),r3.focus()):!e3.shiftKey&&i3===r3&&(e3.preventDefault(),n3.focus())},onPointerDown:e3=>{x2.current=e3.target},onClick:e3=>{u2&&e3.target===e3.currentTarget&&x2.current===e3.currentTarget&&S2.current()},children:t2&&g("div",{className:"core-modal__surface",children:[g("header",{className:"core-modal__header",children:[f2,h("h2",{id:C2,className:"core-modal__title",children:r2}),h("div",{className:"core-modal__tools",children:p2}),h("button",{type:"button",className:"core-modal__close","aria-label":`Close ${T2}`,onClick:()=>S2.current(),children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),g("div",{className:"core-modal__body",children:[a2?h("p",{id:w2,className:"core-modal__description",children:a2}):null,_2]}),m2?h("footer",{className:"core-modal__footer",children:m2}):null]})})}function ie({side:e2="bottom",back:t2,...n2}){let r2=t2?h("button",{type:"button",className:"core-modal__back","aria-label":`Back to ${t2.label}`,onClick:t2.onBack,children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M13 8H3M7 4 3 8l4 4"})})}):void 0;return h(re,{variant:e2==="end"?"sheet-end":"sheet-bottom",headerStart:r2,...n2})}var ae="(max-width: 640px)",K=600,oe=e2=>"type"in e2;function se({items:e2,label:t2,onChoose:n2,onTab:r2,className:i2}){let a2=d(null),o2=d({text:"",at:0}),s2=()=>[...a2.current?.querySelectorAll('[role="menuitem"]')??[]];return h("div",{ref:a2,role:"menu","aria-label":t2,className:y("core-menu",i2),onKeyDown:e3=>{let t3=s2(),n3=t3.indexOf(document.activeElement),i3=n4=>{e3.preventDefault(),t3[(n4+t3.length)%t3.length]?.focus({preventScroll:true})};if(e3.key==="ArrowDown")i3(n3+1);else if(e3.key==="ArrowUp")i3(n3<0?-1:n3-1);else if(e3.key==="Home")i3(0);else if(e3.key==="End")i3(-1);else if(e3.key==="Tab")r2();else if(e3.key.length===1&&!e3.ctrlKey&&!e3.metaKey&&!e3.altKey&&e3.key!==" "){let r3=Date.now();o2.current.text=r3-o2.current.at>K?e3.key.toLowerCase():o2.current.text+e3.key.toLowerCase(),o2.current.at=r3;let i4=o2.current.text,a3=[...t3.slice(n3+1),...t3.slice(0,n3+1)],s3=[...i4].every(e4=>e4===i4[0]),c2=a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4))??(s3?a3.find(e4=>e4.textContent?.trim().toLowerCase().startsWith(i4[0]??"")):void 0);c2&&(e3.preventDefault(),c2.focus({preventScroll:true}))}},children:e2.map(e3=>{if(oe(e3))return h("div",{role:"separator",className:"core-menu__separator"},e3.id);let t3={role:"menuitem",tabIndex:-1,className:"core-menu__item","data-tone":e3.tone,"aria-disabled":e3.disabled||void 0,onClick:t4=>{if(e3.disabled)return t4.preventDefault();n2(e3)}},r3=g(m,{children:[e3.icon?h("span",{className:"core-menu__icon","aria-hidden":"true",children:e3.icon}):null,h("span",{className:"core-menu__label",children:e3.label})]});return e3.href&&!e3.disabled?h("a",{...t3,href:e3.href,children:r3},e3.id):h("button",{...t3,type:"button",children:r3},e3.id)})})}function ce({trigger:e2,items:n2,label:r2,placement:i2="bottom-start",presentation:a2="auto",defaultOpen:o2=false,onOpenChange:s2,className:c2}){let l2=B(ae),u2=a2==="sheet"||a2==="auto"&&l2,[d2,p2]=R(void 0,o2,s2),[_2,v2]=f("first"),y2=h(se,{items:n2,label:r2,onChoose:e3=>{e3.onSelect?.(),p2(false)},onTab:()=>p2(false),className:c2}),b2=e3=>{(e3.key==="ArrowDown"||e3.key==="ArrowUp")&&(e3.preventDefault(),v2(e3.key==="ArrowUp"?"last":"first"),p2(true))};if(u2){let n3=e2.props;return g(m,{children:[t(e2,{"aria-haspopup":"menu","aria-expanded":d2,onClick:e3=>{n3.onClick?.(e3),v2("first"),p2(true)},onKeyDown:e3=>{b2(e3),n3.onKeyDown?.(e3)}}),h(ie,{open:d2,onClose:()=>p2(false),title:r2,initialFocus:'[role="menuitem"]',className:"core-menu-sheet",children:y2})]})}return h(U,{trigger:e2,label:r2,placement:i2,open:d2,onOpenChange:p2,popupRole:"menu",initialFocus:e3=>{let t2=e3.querySelectorAll('[role="menuitem"]');return(_2==="last"?t2[t2.length-1]:t2[0])??null},onTriggerKeyDown:b2,className:"core-menu-popover",children:y2})}var le=new Set;function q(e2,t2){le.has(e2)||(le.add(e2),typeof console<"u"&&console.warn(t2))}var ue={title:120,description:280,label:40,visible:4,perSource:2,burst:5,windowMs:1e4,defaultDuration:6e3},de=1,fe=Symbol.for("peripheries.toast.v1"),pe=["neutral","info","success","warning","danger"],me=globalThis;function he(){let e2=me[fe];if(e2===void 0){let e3={version:de,snapshot:{toasts:[],actions:[]},listeners:new Set,handlers:new Map,sent:new Map,regionClaim:null,next:1};return me[fe]=e3,e3}return e2.version!==de||!e2.listeners||!e2.handlers?(q("toast:version",`[toast] A toast store of version ${String(e2.version)} is on this page; this copy expects ${de}. Toasts from this copy are ignored.`),null):e2}function J(e2,t2){e2.snapshot={toasts:t2,actions:[...e2.handlers.keys()]};for(let t3 of[...e2.listeners])t3()}var ge=(e2,t2)=>e2.length>t2?`${e2.slice(0,t2-1)}…`:e2;function _e(e2){let t2=he();if(!t2)return null;if(!e2||typeof e2.title!="string"||e2.title.trim()==="")return q("toast:title","[toast] A toast needs a title of text; nothing was shown."),null;if(t2.regionClaim===null)return q("toast:region","[toast] No ToastRegion is mounted, so the toast was not shown. Mount <ToastRegion /> once, in the shell."),null;let n2=typeof e2.source=="string"&&e2.source?ge(e2.source,40):"app",r2=Date.now(),i2=(t2.sent.get(n2)??[]).filter(e3=>r2-e3<ue.windowMs);if(i2.length>=ue.burst)return q(`toast:burst:${n2}`,`[toast] "${n2}" sent more than ${ue.burst} toasts in ${ue.windowMs/1e3}s; the rest are dropped.`),t2.sent.set(n2,i2),null;t2.sent.set(n2,[...i2,r2]);let a2=pe.includes(e2.tone)?e2.tone:"neutral",o2=ge(e2.title.trim(),ue.title),s2=typeof e2.description=="string"&&e2.description.trim()?ge(e2.description.trim(),ue.description):void 0,c2=e2.action&&typeof e2.action.id=="string"&&typeof e2.action.label=="string"&&e2.action.label.trim()?{id:e2.action.id,label:ge(e2.action.label.trim(),ue.label)}:void 0,l2=typeof e2.id=="string"&&e2.id?e2.id:`${a2}|${o2}|${s2??""}`,u2=c2?0:typeof e2.duration=="number"&&e2.duration>=0?e2.duration:ue.defaultDuration,d2=[...t2.snapshot.toasts],f2=d2.findIndex(e3=>e3.id===l2);if(f2>=0){let e3=d2[f2];d2[f2]={id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:e3.revision+1}}else{for(d2.push({id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:0});d2.filter(e3=>e3.source===n2).length>ue.perSource;)d2.splice(d2.findIndex(e3=>e3.source===n2),1);for(;d2.length>ue.visible;)d2=d2.slice(1)}return J(t2,d2),l2}function ve(e2){let t2=he();t2&&t2.snapshot.toasts.some(t3=>t3.id===e2)&&J(t2,t2.snapshot.toasts.filter(t3=>t3.id!==e2))}function ye(e2){let t2=he()?.handlers.get(e2);return t2?.(),!!t2}var be={toasts:[],actions:[]},xe=e2=>{let t2=he();return t2?.listeners.add(e2),()=>void t2?.listeners.delete(e2)},Se=()=>he()?.snapshot??be;function Ce(){let e2=he();if(!e2)return null;if(e2.regionClaim!==null)return q("toast:second-region","[toast] A second ToastRegion was mounted; it does nothing, and its actions are ignored. Mount one per page."),null;let t2=Symbol("region");return e2.regionClaim=t2,{release(){e2.regionClaim===t2&&(e2.regionClaim=null,e2.handlers.clear(),J(e2,[]))},setActions(n2){e2.regionClaim===t2&&(e2.handlers=new Map(Object.entries(n2)),J(e2,e2.snapshot.toasts))}}}function we(){return{toast:_e,dismiss:ve}}function Te({toast:e2,actionAvailable:t2=false,onAction:n2,onDismiss:r2,className:i2,...a2}){return g("div",{...a2,className:y("core-toast",i2),"data-tone":e2.tone,children:[g("div",{className:"core-toast__text",children:[h("p",{className:"core-toast__title",children:e2.title}),e2.description?h("p",{className:"core-toast__description",children:e2.description}):null]}),e2.action&&t2?h("button",{type:"button",className:"core-toast__action",onClick:n2,children:e2.action.label}):null,h("button",{type:"button",className:"core-toast__dismiss","aria-label":"Dismiss notification",onClick:r2,children:h("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]})}function Ee({item:e2,actionAvailable:t2}){let[n2,r2]=f(false);return o(()=>{if(e2.duration===0||n2)return;let t3=setTimeout(()=>ve(e2.id),e2.duration);return()=>clearTimeout(t3)},[e2.id,e2.duration,e2.revision,n2]),h("div",{className:"core-toast-slot",onPointerEnter:()=>r2(true),onPointerLeave:()=>r2(false),onFocus:()=>r2(true),onBlur:e3=>{e3.currentTarget.contains(e3.relatedTarget)||r2(false)},children:h(Te,{toast:e2,actionAvailable:t2,onAction:()=>{e2.action&&ye(e2.action.id),ve(e2.id)},onDismiss:()=>ve(e2.id)})})}function De({className:e2,actions:t2}){let[n2,r2]=f(false),i2=d(null),a2=d(t2);a2.current=t2;let s2=Object.keys(t2??{}).sort().join("\n"),c2=d(null),l2=d(false),{toasts:u2,actions:m2}=p(xe,Se,Se);o(()=>{let e3=Ce();return i2.current=e3,r2(e3!==null),()=>{e3?.release(),i2.current=null}},[]),o(()=>{i2.current?.setActions(Object.fromEntries((s2?s2.split("\n"):[]).map(e3=>[e3,()=>a2.current?.[e3]?.()])))},[s2,n2]);let _2=u2[u2.length-1],v2=_2?`${_2.id}:${_2.revision}`:"";if(o(()=>{let e3=c2.current;e3&&(l2.current&&e3.hidePopover(),l2.current=v2!=="",l2.current&&e3.showPopover())},[v2,n2]),!n2)return null;let b2=e3=>u2.filter(e3).map(e4=>h(Ee,{item:e4,actionAvailable:!!e4.action&&m2.includes(e4.action.id)},e4.id));return g("div",{ref:c2,popover:"manual",role:"region","aria-label":"Notifications",className:y("core-toast-region",e2),children:[h("div",{role:"status","aria-live":"polite",className:"core-toast-region__list",children:b2(e3=>e3.tone!=="danger")}),h("div",{role:"alert","aria-live":"assertive",className:"core-toast-region__list",children:b2(e3=>e3.tone==="danger")})]})}function Oe({role:e2="dialog",dismissOnBackdrop:t2,...n2}){return h(re,{variant:"dialog",role:e2,dismissOnBackdrop:t2??e2!=="alertdialog",...n2})}function ke({size:e2,className:t2,style:n2}){return h("span",{"aria-hidden":true,className:y("core-spacer",t2),style:x({"--core-spacer-size":b(e2)},n2)})}function Ae({gap:e2,align:t2="stretch",justify:n2="start",className:r2,style:i2,children:a2,...o2}){return h(E,{...o2,className:y("core-stack",r2),"data-align":t2,"data-justify":n2,style:x({"--core-stack-gap":b(e2)},i2),children:a2})}var je=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),Me=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function Ne({href:e2,action:t2,input:n2,actions:r2,navigate:i2,onClick:a2}){let[o2,s2]=f(false),c2=r2&&t2?r2[t2]:void 0;return{busy:o2,onClick:t3=>{if(a2)return a2(t3);if(c2){t3.preventDefault(),s2(true),c2(n2).finally(()=>s2(false));return}e2&&i2&&je(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!je(e2)&&!Me(e2)}}function Pe({title:e2,meta:t2,leading:n2,value:r2,trailing:i2,href:a2,navigate:o2,onClick:s2,as:c2="div",className:l2,...u2}){let d2=Ne({href:a2,navigate:o2,onClick:s2}),f2=c2,p2=a2?h("a",{className:"core-list-row__title core-list-row__link",href:a2,onClick:d2.onClick,...d2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e2}):h("span",{className:"core-list-row__title",children:e2});return g(f2,{...v(u2),className:y("core-list-row",l2),children:[n2!=null&&h("div",{className:"core-list-row__leading",children:n2}),g("div",{className:"core-list-row__main",children:[p2,t2!=null&&h("span",{className:"core-list-row__meta",children:t2})]}),r2!=null&&h("div",{className:"core-list-row__value",children:r2}),i2!=null&&h("div",{className:"core-list-row__trailing",children:i2})]})}function Fe({header:e2,children:t2,measure:n2="page",className:r2,...i2}){return h("div",{...v(i2),className:y("core-page-frame",r2),"data-measure":n2,children:g("div",{className:"core-page-frame__column",children:[e2!=null&&h("header",{className:"core-page-frame__header",children:e2}),t2]})})}var Ie=["neutral","strong","accent","info","success","warning","danger"],Le=()=>typeof process>"u"||false;function Re(e2,t2="neutral"){return typeof e2=="string"&&Ie.includes(e2)?e2:(typeof e2=="string"&&e2&&Le()&&q(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${Ie.join(", ")}); using "${t2}".`),t2)}var ze=["subtle","on-dark","inherit"];function Be(e2,t2){return typeof e2=="string"&&(ze.includes(e2)||Ie.includes(e2))?e2:t2}function Ve(e2){return{"data-tone":e2,toned:!ze.includes(e2)}}function He({children:e2,as:t2="span",tone:n2,tabular:r2=false,className:i2,style:a2}){let{toned:o2,...s2}=Ve(Be(n2,"subtle"));return h(t2,{className:y("core-eyebrow",o2&&"core-toned",i2),...s2,"data-tabular":r2?"true":void 0,style:a2,children:e2})}function Ue({title:e2,level:t2=2,eyebrow:n2,intro:r2,actions:i2,className:a2,...o2}){let s2=t2===1?"h1":"h2";return g("header",{...v(o2),className:y("core-page-head",a2),children:[n2&&h(He,{as:"p",children:n2}),g("div",{className:"core-page-head__row",children:[h(s2,{className:"core-page-head__title","data-page-title":t2===1?void 0:"",children:e2}),i2!=null&&h("div",{className:"core-page-head__actions",children:i2})]}),r2!=null&&h("p",{className:"core-page-head__intro",children:r2})]})}var We=Symbol.for("peripheries.viewer.context.v1"),Ge=20,Ke=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/,qe=Object.freeze({audience:"client",roles:Object.freeze([])});function Je(e2){if(!e2||typeof e2!="object")return qe;let t2=e2,n2=[...new Set((Array.isArray(t2.roles)?t2.roles:[]).filter(e3=>typeof e3=="string"&&Ke.test(e3)&&e3.length<=40))].sort().slice(0,Ge);return{audience:t2.audience==="staff"?"staff":"client",roles:n2,...t2.previewing===true?{previewing:true}:{}}}var Ye=globalThis,Xe=Ye[We]??=n(qe);function Ze({value:e2,children:t2}){return h(Xe.Provider,{value:Je(e2),children:t2})}function Qe(){return a(Xe)}var $e=e2=>e2.audience==="staff",et=(e2,t2)=>e2.roles.includes(t2);function tt(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}function nt(e2){return e2?typeof e2=="string"?e2:e2.map(e3=>e3&&typeof e3.message=="string"?e3.message:"").filter(Boolean).join(" "):""}var rt=["accepted","tentative","declined"],it=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),at=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2}),ot=e2=>{try{return new Intl.DateTimeFormat("en",{timeZone:e2}).resolvedOptions().timeZone}catch{return}};function st(e2,t2,n2,r2){let i2=e2.tzid?ot(e2.tzid):void 0,a2=ot(r2);return!i2||!a2||i2===a2?"":new Intl.DateTimeFormat(n2,{hour:"numeric",timeZoneName:"short",timeZone:r2}).formatToParts(t2).find(e3=>e3.type==="timeZoneName")?.value??""}function ct(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=it(t2,"UTC").format(n3);if(!e2.endOn)return`${r3} (all day)`;let i3=new Date(new Date(`${e2.endOn}T00:00:00Z`).getTime()-864e5);return i3.getTime()<=n3.getTime()?`${r3} (all day)`:`${r3} – ${it(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=it(t2,n2).format(r2),a2=at(t2,n2).format(r2),o2=st(e2,r2,t2,n2),s2=o2?` ${o2}`:"";if(!e2.endsAt)return`${i2} · ${a2}${s2}`;let c2=new Date(e2.endsAt);return Number.isNaN(c2.getTime())||c2.getTime()===r2.getTime()?`${i2} · ${a2}${s2}`:`${i2} · ${a2} – ${at(t2,n2).format(c2)}${s2}`}var lt=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function ut(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function dt(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function ft(e2){return e2.success?"":e2.code==="DENIED"?"You can't do that here.":e2.code==="CONFLICT"?"Someone changed this first. Reload and try again.":e2.code==="INVALID"?nt(e2.errors)||"Some details are missing or not valid.":nt(e2.errors)||"Something went wrong. Try again."}function pt(e2,t2){let n2=typeof e2=="string"?new Date(e2):e2;return new Intl.DateTimeFormat("en-CA",{timeZone:t2,year:"numeric",month:"2-digit",day:"2-digit"}).format(n2)}function Y(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function mt(e2){return Y(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function ht(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Y(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Y(r2,1))n2.push(r2);return n2}return e2.startsAt?[pt(e2.startsAt,t2)]:[]}var gt=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function X(e2){if(typeof e2!="string")return;let t2=e2.replace(/\s+/g," ").trim();if(t2!=="")return t2.length>60?`${t2.slice(0,59)}…`:t2}var _t="This can’t be done from here yet.";function vt(e2){let[t2,n2]=f(null),[r2,a2]=f(""),o2=d(false),s2=typeof e2=="function";return{run:i(async(t3,r3)=>{if(typeof e2!="function"||o2.current)return{ok:false};o2.current=true,n2(t3),a2("");try{let n3=await e2(r3?{action:t3,values:r3}:{action:t3});return n3&&typeof n3=="object"&&n3.success===false?(a2(ft(n3)||"Something went wrong. Try again."),{ok:false,result:n3}):{ok:true,result:n3}}catch{return a2("Something went wrong. Try again."),{ok:false}}finally{o2.current=false,n2(null)}},[e2]),busy:t2,message:r2,available:s2,clearMessage:()=>a2("")}}function yt(e2){if(typeof e2!="string")return;let t2=e2.trim();if(t2===""||/[\\\u0000-\u001f]/.test(t2))return;let n2=t2;for(let e3=0;e3<3;e3++)try{let e4=decodeURIComponent(n2);if(e4===n2)break;n2=e4}catch{return}if(/[\\\u0000-\u001f]/.test(n2)||n2.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n2))return;let r2=n2.split(/[?#]/)[0]??"";if(!(/^\/(auth|api)(\/|$)/i.test(r2.replace(/\/\.\//g,"/"))||/(^|\/)\.\.(\/|$)/.test(r2)))return/^[/?#]/.test(t2)?t2:void 0}var bt={unreleased:"wait",released:"shared",changed:"ready",staff:"stop",withdrawn:"out"};function xt(e2){if(e2?.state==="staff_only")return{words:"Staff only",mark:bt.staff};if(e2?.state==="withdrawn")return{words:"Withdrawn · not visible to client",mark:bt.withdrawn};if(e2?.state!=="released")return{words:"Not released yet",mark:bt.unreleased};let t2=e2.number,n2=e2.hasChanges===true;return{words:`Visible to client${typeof t2=="number"&&Number.isInteger(t2)&&t2>0?` · release ${t2}`:""}${n2?" · edited since":""}`,mark:n2?bt.changed:bt.released}}function St(e2){let{release:t2,canRelease:n2=true,onIntent:r2,className:i2,style:a2}=e2,o2=s(),c2=$e(Qe()),{run:l2,busy:u2,message:d2,available:f2}=vt(r2);if(!c2)return null;let{words:p2,mark:m2}=xt(t2),_2=e2.busy===true||u2==="release",v2=yt(e2.versionsHref),b2=yt(e2.viewAsHref),x2=t2?.state==="staff_only",S2=n2!==false&&f2&&!x2,C2=_2?"Releasing…":t2?.state==="withdrawn"?"Release again":t2?.state==="released"&&t2.hasChanges===true?"Release changes":"Release",w2=[];(v2||f2)&&w2.push({id:"versions",label:"Versions",href:v2,action:"view_versions"}),!x2&&(b2||f2)&&w2.push({id:"view-as",label:"View as client",href:b2,action:"view_as_client"}),f2&&w2.push({id:"edit",label:"Edit with the assistant",action:"edit_with_assistant"});let T2=w2.map(e3=>({id:e3.id,label:e3.label,...e3.href?{href:e3.href}:{onSelect:()=>void l2(e3.action)}}));return g("div",{className:y("core-page-staff-tools",i2),style:a2,role:"group","aria-label":"Staff tools for this page","data-state":x2?"staff_only":t2?.state==="released"?"released":"unreleased","aria-busy":_2||void 0,children:[g("div",{className:"core-page-staff-tools__bar",children:[g("span",{className:"core-page-staff-tools__pill",role:"status",children:[h("span",{className:"core-page-staff-tools__mark","data-mark":m2,"aria-hidden":"true"}),p2]}),g("div",{className:"core-page-staff-tools__actions",children:[S2?h("button",{type:"button",className:"core-page-staff-tools__button","data-primary":"",disabled:_2,"aria-describedby":`${o2}-note`,onClick:()=>void l2("release"),children:C2}):null,w2.map(e3=>e3.href?h("a",{className:"core-page-staff-tools__button core-page-staff-tools__other",href:e3.href,children:e3.label},e3.id):h("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__other",onClick:()=>void l2(e3.action),children:e3.label},e3.id)),T2.length>0?h(ce,{label:"Staff tools",placement:"bottom-end",items:T2,trigger:h("button",{type:"button",className:"core-page-staff-tools__button core-page-staff-tools__more","aria-label":"More staff tools",children:"More"})}):null]})]}),h("span",{id:`${o2}-note`,className:"core-page-staff-tools__sr",children:S2?t2?.state==="released"?"Release makes the latest changes visible to the client.":"Release makes this page visible to the client.":""}),d2?h("p",{className:"core-page-staff-tools__message",role:"alert",children:d2}):null]})}function Ct({label:e2,actions:t2,children:n2,rail:r2=false,anchor:i2,className:a2,...o2}){return h("section",{...v(o2),id:i2,"aria-label":e2,className:y("core-rule-section",a2),"data-rail":r2||void 0,children:g("div",{className:"core-rule-section__grid",children:[g("div",{className:"core-rule-section__head",children:[e2&&h(He,{as:"p",children:e2}),t2!=null&&h("div",{className:"core-rule-section__actions",children:t2})]}),h("div",{className:"core-rule-section__body",children:n2})]})})}function wt({label:e2,children:t2,arrow:n2=true,className:r2,href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2,...u2}){let d2=Ne({href:i2,action:a2,input:o2,actions:s2,navigate:c2,onClick:l2}),f2=g(m,{children:[h("span",{className:"core-underlined-action__label",children:t2??e2}),n2&&h("svg",{className:"core-underlined-action__arrow",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:"M5 12h14M13 6l6 6-6 6"})})]}),p2={...v(u2),className:y("core-underlined-action",r2)};return i2?h("a",{...p2,href:i2,onClick:d2.onClick,...d2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:f2}):h("button",{...p2,type:"button",onClick:d2.onClick,disabled:d2.busy,children:f2})}var Tt=(e2="")=>e2.trim().split(/\s+/).filter(Boolean).map(e3=>e3[0].toUpperCase()).filter((e3,t2,n2)=>t2===0||t2===n2.length-1).join("").slice(0,2);function Et({name:e2,initials:t2,src:n2,alt:r2,size:i2="md",className:a2,...o2}){let[s2,c2]=f(false),l2=r2??e2??"";return h("span",{...v(o2),className:y("core-avatar",a2),"data-size":i2,role:"img","aria-label":l2||void 0,children:n2&&!s2?h("img",{src:n2,alt:"",onError:()=>c2(true)}):h("span",{"aria-hidden":"true",children:t2??Tt(e2)})})}function Dt({code:e2,children:t2,block:n2=false,className:r2,...i2}){let a2=t2??e2;return n2?h("pre",{...v(i2),className:y("core-code",r2),"data-block":"",children:h("code",{children:a2})}):h("code",{...v(i2),className:y("core-code",r2),children:a2})}var Ot={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function kt({text:e2,children:t2,level:n2=2,size:r2,anchor:i2,className:a2,...o2}){let s2=Math.min(6,Math.max(1,Math.round(n2))),c2=`h${s2}`;return h(c2,{...v(o2),id:i2,className:y("core-heading",a2),"data-size":r2??Ot[s2],children:t2??e2})}var At={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function jt({text:e2,children:t2,as:n2="span",size:r2="md",weight:i2="normal",tone:a2="default",align:o2="start",truncate:s2=false,lines:c2,className:l2,...u2}){let d2=n2,f2=c2&&c2>0?Math.min(6,Math.round(c2)):void 0;return h(d2,{...v(u2),className:y("core-text",l2),"data-role":At[r2]??"body","data-weight":i2,"data-tone":a2,"data-align":o2,"data-truncate":s2||void 0,"data-lines":f2,children:t2??e2})}function Mt({label:e2,hint:t2,error:n2,required:r2,htmlFor:i2,hintId:a2,errorId:o2,as:c2="div",children:l2,className:u2,style:d2}){let f2=s().replace(/:/g,""),p2=a2??(t2?`${i2??f2}-hint`:void 0),m2=o2??(n2?`${i2??f2}-error`:void 0),_2=c2,v2=c2==="fieldset"?"legend":"label";return g(_2,{className:y("core-field",u2),style:d2,"data-invalid":n2?"":void 0,children:[e2&&g(v2,{className:"core-field__label",...v2==="label"&&i2?{htmlFor:i2}:{},children:[e2,r2&&g("span",{className:"core-field__required","aria-hidden":"true",children:[" ","*"]})]}),t2&&h("p",{className:"core-field__hint",id:p2,children:t2}),l2,n2&&h("p",{className:"core-field__error",id:m2,role:"alert",children:n2})]})}function Nt(e2,t2,n2){let r2=s(),i2=e2??`f${r2.replace(/:/g,"")}`,a2=t2?`${i2}-hint`:void 0,o2=n2?`${i2}-error`:void 0;return{control:i2,hintId:a2,errorId:o2,aria:{"aria-describedby":[a2,o2].filter(Boolean).join(" ")||void 0,"aria-invalid":n2?true:void 0}}}function Pt(e2){let t2={};for(let[n2,r2]of Object.entries(e2))(n2==="title"||n2==="autoFocus"||n2.startsWith("aria-")||n2.startsWith("data-"))&&(t2[n2]=r2);return t2}function Ft(e2,t2){return{"aria-describedby":[t2["aria-describedby"],e2.aria["aria-describedby"]].filter(Boolean).join(" ")||void 0,"aria-invalid":e2.aria["aria-invalid"]??t2["aria-invalid"]}}function It(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function Lt({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,children:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:p2,onBlur:m2,onFocus:_2,className:v2,wrapperClassName:b2,style:x2,ref:S2,...C2}){let w2=Nt(i2,c2,l2),T2=Pt(C2),[E2,D2]=f(t2??false),O2=e2??E2,k2=It(n2,r2);return h(Mt,{className:y("core-checkbox",b2),style:x2,hint:c2,error:l2,hintId:w2.hintId,errorId:w2.errorId,children:g("label",{className:"core-choices__option","data-disabled":d2?"":void 0,children:[h("input",{...T2,ref:S2,id:w2.control,type:"checkbox",className:v2,name:a2,checked:O2,required:u2,"aria-required":u2||void 0,disabled:d2,"aria-readonly":p2||void 0,onChange:t3=>{p2||(e2===void 0&&D2(t3.target.checked),k2(t3.target.checked))},onBlur:m2,onFocus:_2,...Ft(w2,T2)}),g("span",{children:[s2??o2,u2&&h("span",{className:"core-field__required","aria-hidden":"true",children:" *"})]})]})})}function Rt({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:p2,orientation:m2="vertical",min:_2,max:v2,className:b2,style:x2,ref:S2}){let C2=[_2===void 0?"":`at least ${_2}`,v2===void 0?"":`at most ${v2}`].filter(Boolean).join(", "),w2=[c2,C2?`Choose ${C2}.`:""].filter(Boolean).join(" ")||void 0,T2=Nt(a2,w2,l2),[E2,D2]=f(n2??[]),O2=t2??E2,k2=It(r2,i2),A2=v2!==void 0&&O2.length>=v2;return h(Mt,{as:"fieldset",className:y("core-choices",b2),style:x2,label:s2,hint:w2,error:l2,required:u2,hintId:T2.hintId,errorId:T2.errorId,children:h("div",{className:"core-choices__list","data-orientation":m2,role:"group",...T2.aria,children:e2.map((n3,r3)=>{let i3=O2.includes(n3.value);return g("label",{className:"core-choices__option","data-disabled":n3.disabled||d2?"":void 0,children:[h("input",{ref:r3===0?S2:void 0,id:r3===0?T2.control:void 0,type:"checkbox",name:o2,value:n3.value,checked:i3,disabled:n3.disabled||d2||!i3&&A2||p2&&!i3,"aria-readonly":p2||void 0,onChange:()=>{if(p2)return;let r4=e2.map(e3=>e3.value).filter(e3=>e3===n3.value?!i3:O2.includes(e3));t2===void 0&&D2(r4),k2(r4)}}),h("span",{children:n3.label})]},n3.value)})})})}function zt({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:p2,max:m2,fromLabel:_2="From",toLabel:v2="To",className:b2,style:x2,ref:S2}){let C2=Nt(i2,s2,c2),[w2,T2]=f(t2??{from:null,to:null}),E2=e2??w2,D2=It(n2,r2),O2=(t3,n3)=>{if(d2)return;let r3={...E2,[t3]:n3===""?null:n3};e2===void 0&&T2(r3),D2(r3)},k2={disabled:u2,readOnly:d2,required:l2,"aria-required":l2||void 0,className:"core-input",...C2.aria};return h(Mt,{as:"fieldset",className:y("core-date-range",b2),style:x2,label:o2,hint:s2,error:c2,required:l2,hintId:C2.hintId,errorId:C2.errorId,children:g("div",{className:"core-date-range__row",children:[g("label",{className:"core-date-range__part",children:[h("span",{className:"core-date-range__label",children:_2}),h("input",{ref:S2,id:C2.control,type:"date",name:a2?`${a2}.from`:void 0,value:E2.from??"",min:p2,max:E2.to??m2,onChange:e3=>O2("from",e3.target.value),...k2})]}),g("label",{className:"core-date-range__part",children:[h("span",{className:"core-date-range__label",children:v2}),h("input",{type:"date",name:a2?`${a2}.to`:void 0,value:E2.to??"",min:E2.from??p2,max:m2,onChange:e3=>O2("to",e3.target.value),...k2})]})]})})}function Bt(e2){return!Number.isFinite(e2)||e2<0?"":e2<1024?`${e2} B`:e2<1048576?`${(e2/1024).toFixed(+(e2<10240))} KB`:`${(e2/1048576).toFixed(1)} MB`}function Vt({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:p2,upload:_2,accept:v2,hash:b2=false,className:x2,style:S2,ref:C2}){let w2=Nt(i2,s2,c2),[T2,E2]=f(t2??null),D2=e2===void 0?T2:e2,O2=It(n2,r2),[k2,A2]=f({busy:false,dragging:false}),j2=d(null),M2=t3=>{e2===void 0&&E2(t3),O2(t3)},N2=async e3=>{if(e3&&_2&&!p2&&!u2){A2({busy:true,dragging:false});try{let t3=await _2(e3,{hash:b2});"error"in t3?A2({busy:false,failed:t3.error,dragging:false}):(A2({busy:false,dragging:false}),M2(t3))}catch{A2({busy:false,failed:"That file couldn’t be stored. Try again.",dragging:false})}}},P2=e3=>{e3.preventDefault(),N2(e3.dataTransfer.files?.[0])},F2=c2??k2.failed;return h(Mt,{className:y("core-file-field",x2),style:S2,label:o2,hint:s2,error:F2,required:l2,htmlFor:w2.control,hintId:w2.hintId,errorId:F2?`${w2.control}-error`:void 0,children:g("div",{className:"core-file-field__box","data-dragging":k2.dragging?"":void 0,"data-busy":k2.busy?"":void 0,onDragOver:e3=>{p2||u2||!_2||(e3.preventDefault(),k2.dragging||A2(e4=>({...e4,dragging:true})))},onDragLeave:()=>A2(e3=>({...e3,dragging:false})),onDrop:P2,children:[D2?g("div",{className:"core-file-field__file",children:[h("span",{className:"core-file-field__name",children:D2.file.name}),h("span",{className:"core-file-field__size",children:Bt(D2.file.size)}),!p2&&!u2&&h("button",{type:"button",className:"core-file-field__button",onClick:()=>M2(null),"aria-label":`Remove ${D2.file.name}`,children:"Remove"})]}):k2.busy?h("span",{className:"core-file-field__status",role:"status",children:"Uploading…"}):g(m,{children:[h("button",{ref:C2,id:w2.control,type:"button",className:"core-file-field__button",disabled:u2||p2||!_2,"aria-required":l2||void 0,"aria-describedby":[w2.hintId,F2?`${w2.control}-error`:void 0].filter(Boolean).join(" ")||void 0,"aria-invalid":F2?true:void 0,onClick:()=>j2.current?.click(),children:"Choose file"}),h("span",{className:"core-file-field__drop",children:"or drop it here"})]}),h("input",{ref:j2,type:"file",name:a2,accept:v2,hidden:true,tabIndex:-1,onChange:e3=>void N2(e3.target.files?.[0])})]})})}function Ht({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:p2,orientation:m2="vertical",className:_2,wrapperClassName:v2,style:b2,ref:x2,...S2}){let C2=Nt(a2,c2,l2),w2=Pt(S2),[T2,E2]=f(n2??null),D2=t2===void 0?T2:t2,O2=It(r2,i2),k2=o2??C2.control;return h(Mt,{as:"fieldset",className:y("core-choices",v2),style:b2,label:s2,hint:c2,error:l2,required:u2,hintId:C2.hintId,errorId:C2.errorId,children:h("div",{...w2,className:y("core-choices__list",_2),"data-orientation":m2,role:"radiogroup","aria-required":u2||void 0,...Ft(C2,w2),children:e2.map((e3,n3)=>g("label",{className:"core-choices__option","data-disabled":e3.disabled||d2?"":void 0,children:[h("input",{ref:n3===0?x2:void 0,id:n3===0?C2.control:void 0,type:"radio",name:k2,value:e3.value,checked:D2===e3.value,disabled:e3.disabled||d2||p2&&D2!==e3.value,onChange:()=>{p2||(t2===void 0&&E2(e3.value),O2(e3.value))}}),h("span",{children:e3.label})]},e3.value))})})}var Ut=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function Wt({type:e2="text",value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:s2,label:c2,hint:l2,error:u2,required:d2,disabled:p2,readOnly:m2,placeholder:_2,inputMode:v2,autoComplete:b2,min:x2,max:S2,step:C2,prefix:w2,suffix:T2,onEnter:E2,onKeyDown:D2,onBlur:O2,onFocus:k2,className:A2,wrapperClassName:j2,style:M2,ref:N2,...P2}){let F2=Nt(a2,l2,u2),I2=Pt(P2),[L2,R2]=f(n2),z2=t2===void 0?L2:t2,B2=It(r2,i2),ee2=e3=>e3==null?"":String(e3),[te2,V2]=f(ee2(z2));o(()=>{e2==="number"&&Ut(te2)!==(z2??null)&&V2(ee2(z2))},[z2]);let H2=e3=>{D2?.(e3),!e3.defaultPrevented&&E2&&e3.key==="Enter"&&!e3.shiftKey&&!e3.nativeEvent.isComposing&&e3.keyCode!==229&&E2(e3)},U2=h("input",{...I2,ref:N2,id:F2.control,name:s2,type:e2==="number"?"text":e2,className:y("core-input core-text-field__input",A2),value:e2==="number"?te2:ee2(z2),onChange:n3=>{let r3=n3.target.value,i3=e2==="number"?Ut(r3):r3;e2==="number"&&V2(r3),t2===void 0&&R2(i3),B2(i3)},onKeyDown:H2,onBlur:O2,onFocus:k2,placeholder:_2,inputMode:v2??(e2==="number"?"decimal":void 0),autoComplete:b2,min:x2,max:S2,step:C2,required:d2,"aria-required":d2||void 0,disabled:p2,readOnly:m2,...Ft(F2,I2)}),W2=w2||T2?g("div",{className:"core-text-field__affixed",children:[w2&&h("span",{className:"core-text-field__affix","aria-hidden":"true",children:w2}),U2,T2&&h("span",{className:"core-text-field__affix","aria-hidden":"true",children:T2})]}):U2;return h(Mt,{className:y("core-text-field",j2),style:M2,label:c2,hint:l2,error:u2,required:d2,htmlFor:F2.control,hintId:F2.hintId,errorId:F2.errorId,children:W2})}function Gt({value:e2,defaultValue:t2,onChange:n2,setValue:r2,label:i2="Search",onSearch:a2,onClear:o2,size:s2="md",className:c2,wrapperClassName:l2,...u2}){let[d2,p2]=f(t2??""),m2=e2??d2,_2=t3=>{e2===void 0&&p2(t3),n2?.(t3),r2?.(t3)};return g("div",{className:y("core-search-field",l2),"data-filled":m2?"":void 0,"data-size":s2,children:[h(Wt,{...u2,label:i2,value:m2,onChange:e3=>_2(typeof e3=="string"?e3:""),onEnter:()=>a2?.(m2),type:"search",inputMode:"search",className:c2,wrapperClassName:"core-search-field__field"}),g("svg",{className:"core-search-field__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:[h("circle",{cx:"11",cy:"11",r:"6.5"}),h("path",{d:"M16 16l4 4"})]}),m2&&!u2.disabled&&!u2.readOnly&&h("button",{type:"button",className:"core-search-field__clear","aria-label":"Clear search",onClick:()=>{_2(""),o2?.()},children:h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function Kt({options:e2,value:t2,defaultValue:n2,onChange:r2,setValue:i2,id:a2,name:o2,label:s2,hint:c2,error:l2,required:u2,disabled:d2,readOnly:p2,placeholder:m2="Choose…",onBlur:_2,onFocus:v2,className:b2,wrapperClassName:x2,style:S2,ref:C2,...w2}){let T2=Nt(a2,c2,l2),E2=Pt(w2),[D2,O2]=f(n2??null),k2=t2===void 0?D2:t2,A2=It(r2,i2);return h(Mt,{className:y("core-select",x2),style:S2,label:s2,hint:c2,error:l2,required:u2,htmlFor:T2.control,hintId:T2.hintId,errorId:T2.errorId,children:g("select",{...E2,ref:C2,id:T2.control,name:o2,className:y("core-input core-select__input",b2),value:k2??"",onChange:e3=>{let n3=e3.target.value===""?null:e3.target.value;t2===void 0&&O2(n3),A2(n3)},required:u2,"aria-required":u2||void 0,disabled:d2||p2,"aria-readonly":p2||void 0,onBlur:_2,onFocus:v2,...Ft(T2,E2),children:[h("option",{value:"",children:m2}),e2.map(e3=>h("option",{value:e3.value,disabled:e3.disabled,children:e3.label},e3.value))]})})}function qt({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,required:l2,disabled:u2,readOnly:d2,min:p2=0,max:m2=100,step:_2=1,format:v2=String,onBlur:b2,onFocus:x2,className:S2,wrapperClassName:C2,style:w2,ref:T2,...E2}){let D2=Nt(i2,s2,c2),O2=Pt(E2),[k2,A2]=f(t2??p2),j2=e2??k2,M2=It(n2,r2);return h(Mt,{className:y("core-slider",C2),style:w2,label:o2,hint:s2,error:c2,required:l2,htmlFor:D2.control,hintId:D2.hintId,errorId:D2.errorId,children:g("div",{className:"core-slider__row",children:[h("input",{...O2,ref:T2,id:D2.control,name:a2,type:"range",className:y("core-slider__input",S2),min:p2,max:m2,step:_2,value:j2,disabled:u2,"aria-readonly":d2||void 0,"aria-valuetext":v2(j2),onChange:t3=>{if(d2)return;let n3=Number(t3.target.value);e2===void 0&&A2(n3),M2(n3)},onBlur:b2,onFocus:x2,...Ft(D2,O2)}),h("output",{className:"core-slider__value",htmlFor:D2.control,children:v2(j2)})]})})}function Jt({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:c2,disabled:l2,readOnly:u2,onBlur:d2,onFocus:p2,className:m2,wrapperClassName:_2,style:v2,ref:b2,...x2}){let S2=Nt(i2,s2,c2),C2=Pt(x2),[w2,T2]=f(t2??false),E2=e2??w2,D2=It(n2,r2);return g("div",{className:y("core-switch",_2),style:v2,children:[g("button",{...C2,ref:b2,id:S2.control,name:a2,type:"button",role:"switch","aria-checked":E2,"aria-readonly":u2||void 0,disabled:l2,className:y("core-switch__control",m2),onClick:()=>{u2||(e2===void 0&&T2(!E2),D2(!E2))},onBlur:d2,onFocus:p2,...Ft(S2,C2),children:[h("span",{className:"core-switch__track","aria-hidden":"true",children:h("span",{className:"core-switch__thumb"})}),h("span",{className:"core-switch__label",children:o2})]}),s2&&h("p",{className:"core-field__hint",id:S2.hintId,children:s2}),c2&&h("p",{className:"core-field__error",id:S2.errorId,role:"alert",children:c2})]})}function Yt({value:e2,defaultValue:t2,onChange:n2,setValue:r2,id:i2,name:a2,label:o2,hint:s2,error:l2,required:u2,disabled:p2,readOnly:m2,placeholder:_2,rows:v2=3,autoGrow:b2=true,maxLength:x2,onKeyDown:S2,onBlur:C2,onFocus:w2,className:T2,wrapperClassName:E2,style:D2,ref:O2,...k2}){let A2=Nt(i2,s2,l2),j2=Pt(k2),[M2,N2]=f(t2??""),P2=e2??M2,F2=It(n2,r2),I2=d(null);return c(()=>{let e3=I2.current;b2&&e3&&(e3.style.height="auto",e3.style.height=`${e3.scrollHeight+2}px`)},[P2,b2]),g(Mt,{className:y("core-text-area",E2),style:D2,label:o2,hint:s2,error:l2,required:u2,htmlFor:A2.control,hintId:A2.hintId,errorId:A2.errorId,children:[h("textarea",{...j2,ref:e3=>{I2.current=e3,typeof O2=="function"?O2(e3):O2&&(O2.current=e3)},id:A2.control,name:a2,className:y("core-input core-text-area__input",T2),rows:v2,value:P2,onChange:t3=>{e2===void 0&&N2(t3.target.value),F2(t3.target.value)},onKeyDown:S2,onBlur:C2,onFocus:w2,placeholder:_2,maxLength:x2,required:u2,"aria-required":u2||void 0,disabled:p2,readOnly:m2,...Ft(A2,j2)}),x2!==void 0&&g("span",{className:"core-field__hint","aria-live":"polite",children:[P2.length," / ",x2]})]})}function Xt({label:e2,children:t2,tone:n2,variant:r2="soft",className:i2,...a2}){return h("span",{...v(a2),className:y("core-badge","core-toned",i2),"data-tone":Re(n2),"data-variant":r2,children:t2??e2})}function Zt({message:e2,title:t2,action:n2,className:r2,...i2}){return g("div",{...v(i2),className:y("core-empty-state",r2),role:"status",children:[t2&&h("p",{className:"core-empty-state__title",children:t2}),h("p",{className:"core-empty-state__message",children:e2}),n2!=null&&h("div",{className:"core-empty-state__action",children:n2})]})}var Qt={info:"M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",success:"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",warning:"M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",danger:"M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"};function $t({title:e2,message:t2,children:n2,tone:r2,action:i2,onDismiss:a2,className:o2,...s2}){let c2=Re(r2,"info"),l2=c2==="warning"||c2==="danger";return g("div",{...v(s2),role:l2?"alert":"status",className:y("core-notice","core-toned",o2),"data-tone":c2,children:[h("svg",{className:"core-notice__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:Qt[c2]??Qt.info})}),g("div",{className:"core-notice__body",children:[e2&&h("p",{className:"core-notice__title",children:e2}),h("div",{className:"core-notice__message",children:n2??t2})]}),i2&&h("div",{className:"core-notice__action",children:i2}),a2&&h("button",{type:"button",className:"core-notice__dismiss","aria-label":"Dismiss",onClick:a2,children:h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function en({value:e2,max:t2=100,label:n2,showValue:r2=false,tone:i2,size:a2="md",className:o2,style:s2,...c2}){let l2=typeof e2=="number"&&Number.isFinite(e2)&&t2>0,u2=l2?Math.max(0,Math.min(100,e2/t2*100)):0;return g("div",{...v(c2),className:y("core-progress","core-toned",o2),"data-tone":Re(i2,"accent"),"data-size":a2,style:s2,children:[(n2||r2&&l2)&&g("div",{className:"core-progress__head",children:[n2&&h("span",{className:"core-progress__label",children:n2}),r2&&l2&&g("span",{className:"core-progress__value",children:[Math.round(u2),"%"]})]}),h("div",{className:"core-progress__track",role:"progressbar","aria-label":n2,"aria-valuemin":0,"aria-valuemax":l2?t2:void 0,"aria-valuenow":l2?e2:void 0,"data-indeterminate":l2?void 0:"",style:x({"--core-progress-fill":`${u2}%`}),children:h("div",{className:"core-progress__fill"})})]})}function tn({shape:e2="text",lines:t2=3,width:n2,height:r2,className:i2,style:a2,...o2}){let s2=x({"--core-skeleton-w":b(n2),"--core-skeleton-h":b(r2)},a2);if(e2!=="text")return h("span",{...v(o2),"aria-hidden":"true",className:y("core-skeleton",i2),"data-shape":e2,style:s2});let c2=Math.max(1,Math.min(12,Math.round(t2)));return h("span",{...v(o2),"aria-hidden":"true",className:y("core-skeleton-lines",i2),style:s2,children:Array.from({length:c2},(e3,t3)=>h("span",{className:"core-skeleton","data-shape":"line","data-last":t3===c2-1&&c2>1?"":void 0},t3))})}function nn({label:e2="Loading",size:t2="md",className:n2,...r2}){return h("span",{...v(r2),role:"status","aria-label":e2,className:y("core-spinner",n2),"data-size":t2})}function rn({content:e2,text:t2,children:n2,side:r2="top",className:i2,...a2}){let[c2,l2]=f(false),u2=s();return o(()=>{if(!c2)return;let e3=e4=>{e4.key==="Escape"&&l2(false)};return document.addEventListener("keydown",e3),()=>document.removeEventListener("keydown",e3)},[c2]),g("span",{...v(a2),className:y("core-tooltip",i2),"aria-describedby":u2,onMouseEnter:()=>l2(true),onMouseLeave:()=>l2(false),onFocus:()=>l2(true),onBlur:()=>l2(false),children:[n2,h("span",{id:u2,role:"tooltip",className:"core-tooltip__bubble","data-side":r2,"data-open":c2?"":void 0,children:e2??t2})]})}function an({children:e2,label:t2,variant:n2="primary",size:r2="md",tone:i2="neutral",iconLeft:a2,iconRight:o2,loading:s2=false,disabled:c2=false,type:l2="button",fullWidth:u2=false,className:d2,href:f2,action:p2,input:_2,actions:b2,navigate:x2,onClick:S2,...C2}){let w2=Ne({href:f2,action:p2,input:_2,actions:b2,navigate:x2,onClick:S2}),T2=s2||w2.busy,E2={...v(C2),className:y("core-button",d2),"data-variant":n2,"data-size":r2,"data-tone":i2,"data-full":u2||void 0,"data-busy":T2||void 0},D2=g(m,{children:[T2?h("span",{className:"core-button__spinner","aria-hidden":"true"}):a2,h("span",{className:"core-button__label",children:e2??t2}),o2]});return f2&&!c2?h("a",{...E2,href:f2,onClick:w2.onClick,"aria-busy":T2||void 0,...w2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:D2}):h("button",{...E2,type:l2,disabled:c2||T2,"aria-busy":T2||void 0,onClick:w2.onClick,children:D2})}function on({children:e2,label:t2,variant:n2="prompt",size:r2="md",selected:i2,onToggle:a2,iconLeft:o2,disabled:s2=false,className:c2,href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2,..._2}){let b2=i2!==void 0||a2!==void 0,x2=Ne({href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2??(a2?()=>a2(!i2):void 0)});return g("button",{...v(_2),type:"button",className:y("core-chip",c2),"data-variant":n2,"data-size":r2,"aria-pressed":b2?!!i2:void 0,disabled:s2||x2.busy,onClick:x2.onClick,children:[o2,h("span",{className:"core-chip__label",children:e2??t2})]})}function sn({icon:e2,children:t2,label:n2,size:r2="md",variant:i2="ghost",pressed:a2,disabled:o2=false,className:s2,href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2,...m2}){let g2=Ne({href:c2,action:l2,input:u2,actions:d2,navigate:f2,onClick:p2}),_2={...v(m2),className:y("core-icon-button",s2),"data-size":r2,"data-variant":i2,"aria-label":n2,title:n2},b2=h("span",{className:"core-icon-button__glyph","aria-hidden":"true",children:e2??t2});return c2&&!o2?h("a",{..._2,href:c2,onClick:g2.onClick,...g2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:b2}):h("button",{..._2,type:"button","aria-pressed":a2,disabled:o2||g2.busy,onClick:g2.onClick,children:b2})}function cn({href:e2,children:t2,label:n2,variant:r2="default",className:i2,navigate:a2,onClick:o2,...s2}){let c2=Ne({href:e2,navigate:a2,onClick:o2});return je(e2)||Me(e2)||/^(https?:|mailto:)/i.test(e2)?g("a",{...v(s2),className:y("core-link",i2),"data-variant":r2,href:e2,onClick:c2.onClick,...c2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[t2??n2,c2.external&&g(m,{children:[h("svg",{className:"core-link__away",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:h("path",{d:"M7 17L17 7M8 7h9v9"})}),h("span",{className:"core-link__note",children:" (opens in a new tab)"})]})]}):h("span",{className:y("core-link",i2),children:t2??n2})}function ln(e2){let{param:t2="kind",keep:n2,label:r2="Filter",onChange:i2,className:a2,style:o2}=e2,s2=(Array.isArray(e2.options)?e2.options:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!=="");if(s2.length===0)return null;let c2=typeof e2.selected=="string"&&s2.some(t3=>t3.id===e2.selected)?e2.selected:s2[0].id;return h("form",{className:"core-filter-chips-form",method:"get",action:"",onSubmit:e3=>{if(!i2)return;e3.preventDefault();let t3=e3.nativeEvent.submitter;t3?.value&&i2(t3.value)},children:g("div",{className:y("core-filter-chips",a2),style:o2,role:"group","aria-label":r2,children:[Object.entries(n2??{}).map(([e3,t3])=>h("input",{type:"hidden",name:e3,value:t3},e3)),s2.map(e3=>h("button",{type:"submit",name:t2,value:e3.id,className:"core-chip","data-variant":"toggle","data-size":"sm","aria-pressed":e3.id===c2,children:h("span",{className:"core-chip__label",children:e3.label})},e3.id))]})})}function un({options:e2,value:t2,defaultValue:n2,onChange:r2,label:i2,fullWidth:a2=false,size:o2="md",className:c2,setValue:l2,...u2}){let[p2,m2]=f(n2??e2[0]?.value),g2=t2??p2,_2=s(),b2=d([]),x2=e3=>{t2===void 0&&m2(e3),r2?.(e3),l2?.(e3)},S2=e2.map((e3,t3)=>e3.disabled?-1:t3).filter(e3=>e3>=0),C2=(t3,n3)=>{let r3=t3.key==="ArrowRight"||t3.key==="ArrowDown"?1:t3.key==="ArrowLeft"||t3.key==="ArrowUp"?-1:0;if(!r3||!S2.length)return;t3.preventDefault();let i3=S2.indexOf(n3),a3=S2[(i3+r3+S2.length)%S2.length];b2.current[a3]?.focus(),x2(e2[a3].value)};return h("div",{...v(u2),role:"radiogroup","aria-label":i2,className:y("core-segmented",c2),"data-full":a2||void 0,"data-size":o2,children:e2.map((e3,t3)=>{let n3=e3.value===g2;return h("button",{ref:e4=>{b2.current[t3]=e4},type:"button",role:"radio",name:_2,"aria-checked":n3,tabIndex:n3||g2===void 0&&t3===S2[0]?0:-1,disabled:e3.disabled,className:"core-segmented__option",onClick:()=>x2(e3.value),onKeyDown:e4=>C2(e4,t3),children:e3.label},e3.value)})})}function dn({items:e2=[],children:t2,numbered:n2=false,single:r2=false,rules:i2="subtle",className:a2,...o2}){let c2=s(),l2=n2?"ol":"ul";return g("div",{...v(o2),className:y("core-accordion",a2),"data-rules":i2,children:[e2.length>0&&h(l2,{className:"core-accordion__list","data-numbered":n2||void 0,children:e2.map((e3,t3)=>h("li",{className:"core-accordion__item",children:g("details",{className:"core-disclosure",name:r2?c2:void 0,open:e3.open||void 0,children:[g("summary",{className:"core-disclosure__summary",children:[n2&&h("span",{className:"core-accordion__number",children:t3+1}),e3.question]}),h("div",{className:"core-disclosure__content",children:e3.answer})]})},e3.id??t3))}),t2]})}function fn({media:e2,header:t2,body:n2,footer:r2,children:i2,tone:a2="plain",className:o2,...s2}){return g("article",{...v(s2),className:y("core-card",o2),"data-tone":a2,children:[e2!=null&&h("div",{className:"core-card__media",children:e2}),t2!=null&&h("header",{className:"core-card__header",children:t2}),(n2!=null||i2!=null)&&g("div",{className:"core-card__body",children:[n2,i2]}),r2!=null&&h("footer",{className:"core-card__footer",children:r2})]})}var pn={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function mn({start:e2,end:t2,children:n2,ratio:r2="1:1",gap:i2,stackBelow:a2="compact",className:o2,...s2}){return g("div",{...v(s2),className:y("core-columns",o2),"data-stack":a2,children:[g("div",{className:"core-columns__grid",style:x({"--core-columns-template":pn[r2]??pn["1:1"],"--core-columns-gap":b(i2)}),children:[h("div",{className:"core-columns__start",children:e2}),h("div",{className:"core-columns__end",children:t2})]}),n2]})}var hn=mn;function gn({summary:e2,content:t2,children:n2,open:r2=false,onToggle:i2,className:a2,...o2}){return g("details",{...v(o2),className:y("core-disclosure",a2),open:r2||void 0,onToggle:i2?e3=>i2(e3.currentTarget.open):void 0,children:[h("summary",{className:"core-disclosure__summary",children:e2}),g("div",{className:"core-disclosure__content",children:[t2,n2]})]})}function _n({items:t2,children:n2,min:r2,columns:i2,gap:a2,className:o2,style:s2,...c2}){let l2=[...e.toArray(t2),...e.toArray(n2)];return h("div",{...v(c2),className:y("core-grid",o2),"data-capped":i2&&i2>0?"":void 0,style:x({"--core-grid-min":b(r2),"--core-grid-gap":b(a2),"--core-grid-cols":i2&&i2>0?String(Math.round(i2)):void 0},s2),children:l2})}function vn({item:t2,each:n2,as:r2,layout:i2="stack",gap:a2,min:o2,empty:s2,className:c2,style:l2,...u2}){let d2=e.toArray(t2);return d2.length?h("div",{...v(u2),className:y("core-repeat",c2),"data-layout":i2,style:x({"--core-repeat-gap":b(a2),"--core-repeat-min":b(o2)},l2),children:d2}):s2?h("p",{className:"core-repeat__empty",children:s2}):null}var yn=["page-x-of-y","page-number","page-count"],bn={display:{size:46,lineHeight:.98,weight:500,tracking:"-0.032em"},heading:{size:28,lineHeight:1.05,weight:500,tracking:"-0.03em"},subhead:{size:20,lineHeight:1.15,weight:500,tracking:"-0.02em"},title:{size:17,lineHeight:1.3,weight:500,tracking:"-0.018em"},body:{size:15,lineHeight:1.65,weight:400,tracking:"-0.012em"},bodySmall:{size:13,lineHeight:1.65,weight:400,tracking:"-0.012em"},label:{size:13,lineHeight:1.4,weight:500,tracking:"-0.015em"},note:{size:12,lineHeight:1.7,weight:400,tracking:"-0.012em"},eyebrow:{size:12,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},xn={full:"var(--color-text)",muted:"var(--color-text-muted)",subtle:"var(--color-text-subtle)",border:"var(--color-border)",accent:"var(--color-accent)",accentText:"var(--color-link)",sunken:"var(--color-surface-sunken)"},Sn=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],Cn=[{id:"workbook",label:"Workbook",sheet:{width:"8.5in",height:"11in"},margins:{top:"0.60in",right:"0.70in",bottom:"0.55in",left:"0.95in"},measure:"6.85in",bodyMeasureCh:64,rail:{placement:"strip"},ink:xn,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:bn,floorPx:12,depth:{max:1,indent:["0"],numbering:"none"},fills:true,regions:{"page-footer":{left:"member-ref",centre:"document-id",right:"page-x-of-y"}},sections:{known:Sn,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:Sn,required:["next-steps","talk-it-through"]}},{id:"instrument",extends:"workbook",label:"Instrument",sheet:{width:"8.5in",height:"11in"},margins:{top:"1.00in",right:"1.00in",bottom:"1.00in",left:"1.25in"},measure:"4.50in",bodyMeasureCh:void 0,rail:{placement:"column",axis:"4.75in",width:"1.50in",gutter:"0.25in"},ink:{full:"#000000",muted:"rgba(0,0,0,0.70)",subtle:"rgba(0,0,0,0.62)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...bn,eyebrow:{...bn.eyebrow,tracking:"0.08em"}},depth:{max:3,indent:["0","0.375in","0.75in"],numbering:"ladder"},fills:false,regions:{"page-footer":{left:"execution-state",right:"page-x-of-y"}},requiredBindings:["execution-state"],sections:{required:[]}}],wn=new Map;function Tn(e2){wn.set(e2.id,e2)}for(let e2 of Cn)Tn(e2);function En(){return[...wn.keys()].sort()}function Dn(e2){let t2=wn.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${En().join(", ")}`);if(!t2.extends)return t2;let n2=wn.get(t2.extends);if(!n2)throw Error(`[document-profile] "${e2}" extends unknown profile "${t2.extends}"`);if(n2.extends)throw Error(`[document-profile] "${e2}" extends "${n2.id}", which extends "${n2.extends}": inheritance is one level deep.`);return{...n2,...t2,id:t2.id,extends:t2.extends}}function On(){let e2={};for(let t2 of En())try{e2[t2]=Dn(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var kn=Object.freeze(On()),An="workbook";function jn(e2,t2){try{return Dn(e2)}catch{return q(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function Z(e2,t2){return e2===void 0?(q("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${An}". If this document is an instrument, its numbering and depth are being dropped.`),jn(An,t2)):jn(e2,t2)}var Mn=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),Nn=["full","muted","subtle","border","accent","accentText","sunken"],Pn=["structural","hairline","head","row"],Fn=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],In=3,Ln="initial";function Rn(e2){let t2={"--doc-sheet-width":e2.sheet.width,"--doc-sheet-height":e2.sheet.height,"--doc-margin-top":e2.margins.top,"--doc-margin-right":e2.margins.right,"--doc-margin-bottom":e2.margins.bottom,"--doc-margin-left":e2.margins.left,"--doc-measure":e2.measure,"--doc-body-measure":e2.bodyMeasureCh?`${e2.bodyMeasureCh}ch`:"none","--doc-rail-axis":e2.rail.axis??Ln,"--doc-rail-width":e2.rail.width??Ln,"--doc-rail-gutter":e2.rail.gutter??Ln,"--doc-floor":`${e2.floorPx}px`};for(let n2 of Nn)t2[`--doc-ink-${Mn(n2)}`]=e2.ink[n2];for(let n2 of Pn)t2[`--doc-rule-${n2}`]=e2.rules[n2]??Ln;for(let n2 of Fn){let r2=e2.type[n2],i2=`--doc-type-${Mn(n2)}`;t2[`${i2}-size`]=`${r2.size}px`,t2[`${i2}-leading`]=String(r2.lineHeight),t2[`${i2}-weight`]=String(r2.weight),t2[`${i2}-tracking`]=r2.tracking,t2[`${i2}-case`]=r2.uppercase?"uppercase":"none"}for(let n2=1;n2<=In;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??Ln;return t2}var zn=(e2,t2)=>`${e2} {
2
2
  ${Object.entries(t2).map(([e3,t3])=>` ${e3}: ${t3};`).join("\n")}
3
- }`;function jn(e2,t2){return e2.map(e3=>An(e3.id===t2?`:root,
4
- [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,kn(e3))).join("\n\n")}var Mn=["prose","clause","definitions","table","notice","figure","execution"],Nn=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,Pn="[a-z0-9][a-z0-9_-]*",Fn=RegExp(`^(?:(${Pn}):)?(${Pn}(?:\\.${Pn})*)(?:#(${Pn}))?$`);RegExp(`^${Pn}$`);function In(e2,t2){let n2=e2.trim(),r2=Fn.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function Ln(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function Rn(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(Nn.source,"g"))){let i2=In(r2[1],r2[2]);i2&&(r2.index>n2&&t2.push({kind:"text",text:e2.slice(n2,r2.index)}),t2.push({kind:"ref",...i2}),n2=r2.index+r2[0].length)}return n2<e2.length&&t2.push({kind:"text",text:e2.slice(n2)}),t2}function zn(e2){return e2.includes("{{ref:")}var Q=e2=>e2?{"data-profile":e2}:{},Bn=e2=>e2?.fills===false?{"data-fills":"none"}:{},Vn={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function Hn({children:e2,tone:r2="note",title:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Z(a2,"Aside"),u2=l2?.fills===false;return n("aside",{role:"note",className:y("core-aside",s2),"data-tone":r2,...Q(o2?.id??a2),...Bn(l2),style:c2,children:[u2?null:t("span",{className:"core-aside__icon","aria-hidden":true,children:Vn[r2]}),n("div",{className:"core-aside__body",children:[i2&&t("div",{className:"core-aside__title",children:i2}),t("div",{className:"core-aside__text",children:e2})]})]})}function Un({children:e2,profileId:n2,profile:r2,full:i2=false,className:a2,style:o2}){return r2||Z(n2,"Prose"),t("div",{className:y("core-prose",a2),"data-full":i2?"":void 0,...Q(r2?.id??n2),style:o2,children:e2})}function Wn({children:e2,citation:r2,className:i2,style:a2}){return n("figure",{className:y("core-quote",i2),style:a2,children:[t("blockquote",{className:"core-quote__body",children:e2}),r2&&n("figcaption",{className:"core-quote__citation",children:["— ",r2]})]})}function Gn({term:e2,description:r2,pairs:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||Z(a2,"Definition");let l2=i2??(e2===void 0?[]:[{term:e2,description:r2}]);return t("dl",{className:y("core-definition",s2),...Q(o2?.id??a2),style:c2,children:l2.map((e3,r3)=>n("div",{className:"core-definition__item",children:[t("dt",{className:"core-definition__term",children:e3.term}),t("dd",{className:"core-definition__description",children:e3.description})]},r3))})}var Kn="katex";function qn(e2){if(typeof document>"u")return false;for(let t2 of document.querySelectorAll('script[type="importmap"]'))try{if(JSON.parse(t2.textContent??"").imports?.[e2])return true}catch{}return false}var Jn=e2=>import(e2),Yn;function Xn(){return Yn??=qn(Kn)?Jn(Kn).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),Yn}function Zn({children:e2="",mode:n2="inline",className:r2}){let i2=m(null),[a2,o2]=h(null),[s2,c2]=h(null),u2=`${n2}:${e2}`;return l(()=>{let e3=true;return Xn().then(t2=>{e3&&t2&&o2(()=>t2)}),()=>{e3=false}},[]),l(()=>{if(a2&&i2.current&&s2!==u2)try{a2.render(e2,i2.current,{displayMode:n2==="block",throwOnError:false})}catch{c2(u2)}},[a2,e2,n2,u2,s2]),!a2||s2===u2?t("span",{className:y("core-math",r2),"data-mode":n2,"data-fallback":"",title:"KaTeX not available — showing TeX source",children:e2}):t("span",{ref:i2,className:y("core-math",r2),"data-mode":n2})}function Qn(e2,t2){switch(t2.type){case"register":return e2.footnotes.some(e3=>e3.id===t2.entry.id)?e2:{footnotes:[...e2.footnotes,t2.entry]};case"unregister":return{footnotes:e2.footnotes.filter(e3=>e3.id!==t2.id)};default:return e2}}var $n=a(null);function er(){return c($n)}function tr({children:e2}){let[n2,r2]=p(Qn,{footnotes:[]}),i2=m(0),a2=s(e3=>{i2.current+=1;let t2=i2.current;return r2({type:"register",entry:{...e3,number:t2}}),t2},[]),o2=s(e3=>r2({type:"unregister",id:e3}),[]),c2=f(()=>({state:n2,registerFootnote:a2,unregisterFootnote:o2}),[n2,a2,o2]);return t($n.Provider,{value:c2,children:e2})}function nr({children:e2}){let r2=u(),i2=er(),[a2,o2]=h(null);return l(()=>{if(!i2)return;let t2=i2.registerFootnote({id:r2,content:e2});return o2(t2),()=>i2.unregisterFootnote(r2)},[r2]),i2?a2===null?null:t("sup",{id:`core-footnote-ref-${a2}`,className:"core-footnote",children:n("a",{href:`#core-footnote-${a2}`,className:"core-footnote__link",children:["[",a2,"]"]})}):n("span",{className:"core-footnote","data-fallback":"",children:[" ","(",e2,")"]})}function rr({children:e2,caption:r2,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Z(i2,"Figure"),n("figure",{className:y("core-figure",o2),...Q(a2?.id??i2),style:s2,children:[t("div",{className:"core-figure__body",children:e2}),r2&&t("figcaption",{className:"core-figure__caption",children:r2})]})}function ir({className:e2}){return t("div",{className:y("core-page-break",e2),"aria-hidden":true})}function ar({children:e2,as:n2="div",profileId:r2,profile:i2,tone:a2="subtle",className:o2,style:s2}){return i2||Z(r2,"DocumentLabel"),t(n2,{className:y("core-document-label",o2),"data-tone":a2,...Q(i2?.id??r2),style:s2,children:e2})}var or=["one","two","three","four","five","six","seven","eight","nine","ten"];function sr(e2){if(e2.length!==1)return null;let t2=e2[0],n2=or[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function cr(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function lr(e2,t2,n2){let r2=n2==="ladder"&&e2!==void 0&&e2.length>0,i2=[];return t2.map(({level:t3,marker:n3})=>{let a2=Math.min(Number.isInteger(t3)&&t3>=1?t3:1,i2.length+1);return i2.length=a2,i2[a2-1]=(i2[a2-1]??0)+1,n3===void 0?r2?[...e2,...i2].join("."):void 0:n3})}function ur(e2,t2){return e2?.[t2]??t2}function dr({target:e2,form:n2,sectionReferences:r2,sectionNumbers:i2,sectionTitles:a2,sectionAnchors:o2,profileId:s2,profile:c2,className:l2,style:u2}){let d2=c2??Z(s2,"Reference"),f2=In(e2),p2=r2?.[e2],m2=p2?.openable===false,h2=f2!==null&&f2.doc===void 0,g2=f2?Ln(f2.unit):e2,_2=p2?.number??(h2&&f2.element===void 0?i2?.[g2]:void 0),v2=p2?.title??(h2&&f2.element===void 0?a2?.[g2]:void 0),b2=null;if(f2?.element!==void 0){let e3=p2?.element;b2=e3?lr(p2.number,e3.shape,d2?.depth.numbering)[e3.index]??null:null}else _2&&(b2=cr(_2));let x2=n2==="full"||f2?.doc!==void 0&&n2!=="title",S2;S2=m2?null:n2==="title"?v2??b2:x2&&b2&&v2&&f2?.element===void 0?`${b2} (${v2})`:b2??v2??null;let C2=S2!==null,w2=C2?p2?p2.href:`#${ur(o2,g2)}`:void 0,T2={className:y("core-reference",l2),"data-target":e2,"data-unresolved":C2||m2?void 0:"","data-closed":m2?"":void 0,...Q(c2?.id??s2),style:u2};return w2?t("a",{href:w2,...T2,children:S2}):t("span",{...T2,children:S2??e2})}function fr({columns:e2,rows:r2,caption:i2,profileId:a2,profile:o2,className:s2,style:c2}){return o2||Z(a2,"DocumentTable"),e2.length===0?null:n("div",{className:y("core-document-table",s2),...Q(o2?.id??a2),style:c2,children:[i2===void 0?null:t("div",{className:"core-document-table__caption",children:i2}),n("table",{className:"core-document-table__table",children:[t("thead",{children:t("tr",{children:e2.map((e3,n2)=>t("th",{scope:"col",className:"core-document-table__head","data-align":e3.align??"left",children:e3.header},n2))})}),t("tbody",{children:r2.map((n2,r3)=>t("tr",{children:e2.map((e3,r4)=>t("td",{className:"core-document-table__cell","data-align":e3.align??"left",children:n2[r4]??null},r4))},r3))})]})]})}var pr={locale:"en-CA",currency:"CAD"},mr=e2=>{if(typeof e2!="string"||!e2)return false;try{return Intl.NumberFormat.supportedLocalesOf(e2).length>0}catch{return false}},hr=e2=>{if(typeof e2!="string"||!/^[A-Za-z]{3}$/.test(e2))return false;try{return new Intl.NumberFormat("en-CA",{style:"currency",currency:e2}),true}catch{return false}};function gr(e2){let t2=typeof e2=="object"&&e2?e2:{};return{locale:mr(t2.locale)?t2.locale:pr.locale,currency:hr(t2.currency)?t2.currency.toUpperCase():pr.currency}}var _r=new Map;function vr(e2){let t2=`${e2.locale}|${e2.currency}`,n2=_r.get(t2);if(!n2){let r2=new Intl.NumberFormat(e2.locale,{style:"currency",currency:e2.currency,maximumFractionDigits:0}).formatToParts(1),i2=r2.findIndex(e3=>e3.type==="integer"),a2=r2.length-1-[...r2].reverse().findIndex(e3=>e3.type==="integer");n2={prefix:r2.slice(0,i2).filter(e3=>e3.type!=="minusSign"&&e3.type!=="plusSign").map(e3=>e3.value).join(""),suffix:r2.slice(a2+1).map(e3=>e3.value).join("")},_r.set(t2,n2)}return n2}function $(e2,t2){if(e2==null)return"";if(typeof e2=="string")return e2;let n2=e2.precision??(e2.format==="number"?yr(e2.value):void 0),r2=br(e2.format,e2.value,{precision:n2,signed:e2.signed,locale:t2});return e2.unit&&r2!=="—"?`${r2} ${e2.unit}`:r2}function yr(e2){if(typeof e2!="number"||!Number.isFinite(e2))return 0;let t2=String(Number(e2.toFixed(3))),n2=t2.indexOf(".");return n2===-1||t2.includes("e")?0:t2.length-n2-1}function br(e2,t2,n2={}){if(!Number.isFinite(t2))return"—";let r2=n2.signed===true,i2=t2<0,a2=Math.abs(t2),o2=i2?"-":r2?"+":"",s2=n2.locale??pr,c2=(e3,t3)=>e3.toLocaleString(s2.locale,{minimumFractionDigits:t3,maximumFractionDigits:t3}),l2=(e3,t3="")=>{let{prefix:n3,suffix:r3}=vr(s2);return`${o2}${n3}${e3}${t3}${r3}`};switch(e2){case"currency":return l2(c2(a2,n2.precision??0));case"currency-k":{let e3=n2.precision??0;return a2>=1e3?l2((a2/1e3).toFixed(e3),"k"):l2(a2.toFixed(0))}case"currency-m":{let e3=n2.precision??1;return a2>=1e6?l2((a2/1e6).toFixed(e3),"M"):a2>=1e3?l2((a2/1e3).toFixed(0),"k"):l2(a2.toFixed(0))}case"currency-compact":return a2>=1e9?l2((a2/1e9).toFixed(n2.precision??1),"B"):a2>=1e6?l2((a2/1e6).toFixed(n2.precision??1),"M"):a2>=1e3?l2((a2/1e3).toFixed(n2.precision??1),"k"):l2(a2.toFixed(n2.precision??0));case"currency-monthly":return`${l2(c2(a2,n2.precision??0))}/mo`;case"percent":{let e3=n2.precision??1;return`${o2}${a2.toFixed(e3)}%`}case"fraction-percent":return`${o2}${new Intl.NumberFormat(s2.locale,{style:"percent",minimumFractionDigits:n2.precision??0,maximumFractionDigits:n2.precision??1}).format(a2)}`;case"age":return`Age ${Math.round(t2)}`;case"years":{let e3=n2.precision??0;return`${o2}${a2.toFixed(e3)} yrs`}case"year":return String(Math.round(t2));case"number":return`${o2}${c2(a2,n2.precision??0)}`;default:{let e3=n2.precision??0;return l2((a2/1e3).toFixed(e3),"k")}}}var xr=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2);function Sr({items:e2,profileId:r2,profile:i2,markerWidth:a2=44,secondaryWidth:o2=190,missingLabel:s2="Not answered yet",baseProps:c2,className:l2,style:u2}){if(i2||Z(r2,"RowList"),!Array.isArray(e2)||e2.length===0)return null;let d2=gr(c2),f2=e3=>xr(e3)?$(e3,d2):e3;return t("div",{className:y("core-row-list",l2),...Q(i2?.id??r2),style:x({"--core-row-list-marker-width":b(a2),"--core-row-list-secondary-width":b(o2)},u2),children:e2.map((e3,r3)=>n("div",{className:"core-row-list__row",children:[e3.marker!==void 0&&t("div",{className:"core-row-list__marker",children:f2(e3.marker)}),t("div",{className:"core-row-list__primary",children:e3.primary}),(e3.secondary!==void 0||e3.missing)&&t("div",{className:"core-row-list__secondary","data-missing":e3.missing?"":void 0,children:e3.missing?s2:f2(e3.secondary)})]},r3))})}var Cr=190;function wr({items:e2,profileId:n2,profile:r2,missingLabel:i2="Not answered yet",answerWidth:a2=190,className:o2,style:s2}){let c2=e2.map(e3=>{let t2=typeof e3.answer=="string"&&e3.answer.trim().length>0;return{marker:e3.reference,primary:e3.question,secondary:t2?e3.answer:void 0,missing:!t2}});return t("div",{className:y("core-answer-rows",o2),...Q(r2?.id??n2),style:s2,children:t(Sr,{items:c2,profileId:n2,profile:r2,secondaryWidth:a2,missingLabel:i2})})}var Tr=40;function Er({bars:e2,target:r2,targetLabel:i2,max:a2,profileId:o2,profile:s2,baseProps:c2,className:l2,style:u2}){let d2=gr(c2),f2=s2??Z(o2,"ComparisonBars");if(e2.length===0)return null;let p2=e2.map(e3=>e3.value),m2=a2??Math.max(...p2,r2??0);if(!Number.isFinite(m2)||m2<=0)return q("ComparisonBars:no-scale","[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."),null;let h2=r2!==void 0&&r2>0&&r2<=m2?r2/m2*100:void 0;return n("figure",{className:y("core-comparison-bars",l2),...Q(s2?.id??o2),...Bn(f2),style:u2,children:[e2.map(e3=>{let r3=Math.max(0,Math.min(100,e3.value/m2*100));return n("div",{className:"core-comparison-bars__bar",style:x({"--core-comparison-bars-value":`${r3}%`}),children:[t("div",{className:"core-comparison-bars__label",children:e3.label}),n("div",{className:"core-comparison-bars__track",style:x({"--core-comparison-bars-target":h2===void 0?void 0:`${h2}%`}),children:[t("div",{className:"core-comparison-bars__fill"}),t("span",{className:"core-comparison-bars__value","data-placement":r3>Tr?"inside":"outside",children:$(e3.display,d2)}),h2!==void 0&&t("div",{className:"core-comparison-bars__target","aria-hidden":"true"})]})]},e3.label)}),r2!==void 0&&i2&&t("figcaption",{className:"core-comparison-bars__target-label",children:i2})]})}var Dr=3,Or=5;function kr({items:e2,profileId:r2,profile:i2,checkboxes:a2=true,className:o2,style:s2}){return i2||Z(r2,"NextSteps"),e2.length===0?null:((e2.length<Dr||e2.length>Or)&&q(`NextSteps:count:${e2.length}`,`[NextSteps] ${e2.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`),t("ol",{className:y("core-next-steps",o2),...Q(i2?.id??r2),style:s2,children:e2.map((e3,r3)=>n("li",{className:"core-next-steps__step",children:[t("span",{className:"core-next-steps__marker",children:e3.marker??String(r3+1).padStart(2,"0")}),a2&&t("span",{className:"core-next-steps__box","aria-hidden":"true"}),t("span",{className:"core-next-steps__body",children:e3.body})]},r3))}))}var Ar=38;function jr({title:e2="Notes",lines:r2=4,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Z(i2,"Notes"),r2<1?null:n("section",{className:y("core-notes",o2),...Q(a2?.id??i2),style:s2,children:[t("div",{className:"core-notes__title",children:e2}),t("div",{className:"core-notes__lines","aria-hidden":"true",children:Array.from({length:r2},(e3,n2)=>t("div",{className:"core-notes__line"},n2))})]})}var Mr="You left this section open, so it is not covered here.";function Nr({wouldTell:e2,openingLine:r2=Mr,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Z(i2,"SkippedSection"),n("div",{className:y("core-skipped-section",o2),...Q(a2?.id??i2),style:s2,children:[t("span",{className:"core-skipped-section__standard",children:r2})," ",t("span",{className:"core-skipped-section__would-tell",children:e2})]})}var Pr="Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";function Fr({advisor:e2,title:r2="Talk it through",invitation:i2=Pr,profileId:a2,profile:o2,className:s2,style:c2}){if(o2||Z(a2,"TalkItThrough"),!e2?.name?.trim())return q("TalkItThrough:no-advisor","[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."),null;let l2=[e2.phone,e2.email].filter(e3=>typeof e3=="string"&&e3.trim().length>0);return l2.length===0&&q("TalkItThrough:no-contact",`[TalkItThrough] "${e2.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`),n("section",{className:y("core-talk-it-through",s2),...Q(o2?.id??a2),style:c2,children:[t("h3",{className:"core-talk-it-through__title",children:r2}),t("p",{className:"core-talk-it-through__invitation",children:i2}),n("div",{className:"core-talk-it-through__advisor",children:[t("div",{className:"core-talk-it-through__name",children:e2.name}),e2.role&&t("div",{className:"core-talk-it-through__role",children:e2.role}),l2.length>0&&t("div",{className:"core-talk-it-through__contact",children:l2.map(e3=>t("span",{children:e3},e3))})]})]})}var Ir=38;function Lr({question:e2,answer:r2,lines:i2=1,profileId:a2,profile:o2,className:s2,style:c2}){o2||Z(a2,"WriteInField");let l2=typeof r2=="string"&&r2.trim().length>0,u2=Math.max(1,i2);return n("div",{className:y("core-write-in-field",s2),"data-answered":l2?"":void 0,...Q(o2?.id??a2),style:c2,children:[e2&&t("div",{className:"core-write-in-field__question",children:e2}),l2?t("div",{className:"core-write-in-field__answer",children:r2}):Array.from({length:u2},(e3,n2)=>t("div",{className:"core-write-in-field__line","aria-hidden":"true"},n2))]})}function Rr({mark:e2,identity:r2,codes:i2,profileId:a2,profile:o2,className:s2,style:c2}){return o2||Z(a2,"Masthead"),e2===void 0&&r2===void 0&&i2===void 0?null:n("header",{className:y("core-masthead",s2),"data-page-region":"page-header",...Q(o2?.id??a2),style:c2,children:[e2!==void 0&&t("div",{className:"core-masthead__mark","data-slot":"mark",children:e2}),r2!==void 0&&t("div",{className:"core-masthead__identity","data-slot":"identity",children:r2}),i2!==void 0&&t("div",{className:"core-masthead__codes","data-slot":"codes",children:i2})]})}var zr=4;function Br({fields:e2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=(i2??Z(r2,"MetaRail"))?.rail.placement??"strip";return s2==="none"||e2.length===0?null:(s2!=="column"&&e2.length>zr&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${zr}. Rendering all of them — check the layout.`),t("div",{className:y("core-meta-rail",a2),"data-placement":s2,...Q(i2?.id??r2),style:o2,children:e2.map(e3=>n("div",{className:"core-meta-rail__field",children:[t("div",{className:"core-meta-rail__label",children:e3.label}),t("div",{className:"core-meta-rail__value",children:e3.value})]},`${e3.label}:${e3.value}`))}))}var Vr={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function Hr({left:e2,centre:n2,right:r2,profileId:i2,profile:a2,className:o2,style:s2}){a2||Z(i2,"RunningFooter");let c2=[["left",e2],["centre",n2],["right",r2]].filter(([,e3])=>e3!=null);return c2.length===0?null:t("footer",{className:y("core-running-footer",o2),"data-page-region":"page-footer",...Q(a2?.id??i2),style:s2,children:c2.map(([e3,n3])=>t("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":Vr[e3],children:n3},e3))})}function Ur({children:r2,rail:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Z(a2,"DocumentShell"),u2=l2?.rail.placement==="column"&&i2!==void 0;return t(tr,{children:n("div",{className:y("core-document-shell",s2),...Q(l2?.id??a2),"data-has-rail":u2?"":void 0,style:c2,children:[t("div",{className:"core-document-shell__body",children:r2}),u2&&n(e,{children:[t("div",{className:"core-document-shell__gutter","aria-hidden":true}),t("aside",{className:"core-document-shell__rail",children:i2})]})]})})}function Wr(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function Gr({entries:e2,depth:r2,title:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Z(a2,"Contents"),u2=l2?.depth.max??Infinity,d2=e2??[],f2=r2===void 0?d2:d2.filter(e3=>e3.level<r2);if(f2.length===0)return null;let p2=l2?.depth.numbering??"none",m2=f2.some(e3=>e3.page!==void 0);return n("nav",{"aria-label":"Table of contents",className:y("core-contents",s2),...Q(o2?.id??a2),style:c2,children:[i2&&t("div",{className:"core-contents__title",children:i2}),t("ol",{className:"core-contents__list",children:f2.map(e3=>{let r3=p2==="none"?null:Wr(e3.ordinal,e3.level);return n("li",{className:"core-contents__entry","data-level":e3.level,"data-overdeep":e3.level>=u2?"":void 0,style:x({"--core-contents-level":String(e3.level)}),children:[r3&&t("span",{className:"core-contents__ordinal",children:r3}),t("a",{href:`#${e3.id}`,className:"core-contents__link",children:e3.title}),m2&&t("span",{className:"core-contents__page",children:e3.page??""})]},e3.id)})})]})}function Kr({s:e2,dated:r2}){return n("div",{className:"core-execution-block__signature",children:[n("div",{className:"core-execution-block__lines",children:[t("div",{className:"core-execution-block__line","data-line":"sign"}),r2?t("div",{className:"core-execution-block__line","data-line":"date"}):null]}),n("div",{className:"core-execution-block__captions",children:[n("div",{className:"core-execution-block__party",children:[e2.role?t("div",{className:"core-execution-block__role",children:e2.role}):null,e2.name?t("div",{className:"core-execution-block__name",children:e2.name}):null,e2.detail?t("div",{className:"core-execution-block__detail",children:e2.detail}):null]}),r2?t("div",{className:"core-execution-block__date-label",children:"Date"}):null]})]})}function qr({attestation:e2,label:r2,signatories:i2,columns:a2=1,note:o2,profileId:s2,profile:c2,className:l2,style:u2}){c2||Z(s2,"ExecutionBlock");let d2=Array.isArray(i2)?i2:[];return n("section",{className:y("core-execution-block",l2),...Q(c2?.id??s2),style:u2,children:[r2?t("div",{className:"core-execution-block__label",children:r2}):null,e2?t("div",{className:"core-execution-block__attestation",children:e2}):null,t("div",{className:"core-execution-block__signatories","data-columns":a2,children:d2.map((e3,n2)=>t(Kr,{s:e3,dated:e3.dated===true},n2))}),o2?t("div",{className:"core-execution-block__note",children:o2}):null]})}function Jr({kind:e2}){return n("div",{className:"core-document-blocks__unrenderable","data-unrenderable-block":e2,role:"alert",children:[t("strong",{children:"This provision could not be rendered."})," The document contains a block of type “",e2,"”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."]})}function Yr({blocks:e2,profileId:n2,sectionNumbers:r2,sectionAnchors:i2,sectionTitles:a2,sectionReferences:o2,sectionOrdinal:s2,className:c2,style:l2}){let u2=Z(n2,"DocumentBlocks");if(e2.length===0)return null;let d2=lr(s2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),u2?.depth.numbering),f2=0,p2=(e3,s3)=>zn(e3)?Rn(e3).map((e4,c3)=>e4.kind==="text"?e4.text:t(dr,{target:e4.key,form:e4.form,sectionReferences:o2,sectionNumbers:r2,sectionTitles:a2,sectionAnchors:i2,profileId:n2},`${s3}-ref-${c3}`)):e3,m2=e2.some(e3=>e3.kind==="execution");return t("div",{className:y("core-document-blocks",c2),"data-pinned":m2?"execution":void 0,...Q(n2),style:l2,children:e2.map((e3,r3)=>{let i3=`${e3.kind}-${r3}`;switch(e3.kind){case"prose":return t(Un,{profileId:n2,full:e3.full,children:p2(e3.text,i3)},i3);case"clause":return t(Sr,{profileId:n2,items:e3.items.map((e4,t2)=>({marker:d2[f2++],primary:p2(e4.text,`${i3}-${t2}`),secondary:e4.note?p2(e4.note,`${i3}-${t2}-n`):void 0,missing:e4.missing}))},i3);case"definitions":return t(Gn,{profileId:n2,pairs:e3.pairs.map((e4,t2)=>({term:e4.term,description:p2(e4.description,`${i3}-${t2}`)}))},i3);case"table":return t(fr,{profileId:n2,caption:e3.caption?p2(e3.caption,`${i3}-cap`):void 0,columns:e3.columns,rows:e3.rows.map((e4,t2)=>e4.map((e5,n3)=>p2(e5,`${i3}-${t2}-${n3}`)))},i3);case"notice":return t(Hn,{profileId:n2,tone:e3.tone,title:e3.title,children:p2(e3.text,i3)},i3);case"figure":return t(rr,{profileId:n2,caption:p2(e3.caption,i3),children:e3.placeholder??null},i3);case"execution":return t(qr,{profileId:n2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},i3);default:return t(Jr,{kind:String(e3.kind)},i3)}})})}var Xr=["h2","h3","h4","h5","h6"];function Zr({sectionId:e2,title:r2,level:i2=0,ordinal:a2,sectionNumbers:o2,sectionAnchors:s2,sectionTitles:c2,sectionReferences:l2,sectionLevels:u2,continued:d2=false,continuedCount:f2,children:p2,blocks:m2,profileId:h2,profile:g2,className:_2,style:v2}){let b2=g2??Z(h2,"DocumentSection"),S2=o2?.[e2],C2=u2?.[e2],w2=S2??a2,T2=C2===void 0?i2:Math.max(0,C2-1),E2=T2>=(b2?.depth.max??Infinity),D2=Math.min(T2,(b2?.depth.indent.length??1)-1)+1,O2=b2?.depth.numbering==="ladder"&&w2!==void 0&&w2.length>0,k2=O2?sr(w2):null,A2=Xr[Math.min(T2,Xr.length-1)],j2=ur(s2,e2),M2=`${j2}-doc-heading`;return n("section",{id:j2,className:y("core-document-section",_2),"data-level":T2,"data-ordinal-source":w2?S2?"derived":"baked":void 0,"data-overdeep":E2?"":void 0,"aria-labelledby":M2,...Q(g2?.id??h2),style:x({"--core-document-section-indent":`var(--doc-indent-${D2}, 0)`},v2),children:[k2&&t("div",{className:"core-document-section__article",children:k2}),n(A2,{id:M2,className:"core-document-section__heading",children:[O2&&!k2&&t("span",{className:"core-document-section__ordinal",children:w2.join(".")}),r2,d2&&t("span",{className:"core-document-section__continued",children:"continued"})]}),d2&&f2&&t("div",{className:"core-document-section__count",children:`Items ${f2.from} to ${f2.to} of ${f2.of}`}),t("div",{className:"core-document-section__body",children:p2??(m2?t(Yr,{blocks:m2,profileId:h2,sectionNumbers:o2,sectionAnchors:s2,sectionTitles:c2,sectionReferences:l2,sectionOrdinal:O2?w2:void 0}):null)})]})}var Qr={prose:{type:"object",required:["kind","text"],additionalProperties:false,properties:{kind:{const:"prose"},text:{type:"string",description:"ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."},full:{type:"boolean",description:"Fill the measure rather than the reading-width cap. For a caption or text beside a table."}}},clause:{type:"object",required:["kind","items"],additionalProperties:false,properties:{kind:{const:"clause"},items:{type:"array",minItems:1,items:{type:"object",required:["text"],additionalProperties:false,properties:{marker:{type:"string",description:'An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article ("6.3").'},level:{type:"integer",minimum:1,description:"Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."},id:{type:"string",pattern:"^[a-z0-9][a-z0-9_-]*$",description:"A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."},text:{type:"string"},note:{type:"string",description:"A parenthetical, cross-reference or jurisdictional note set beside the text."},missing:{type:"boolean",description:"The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."}}}}}},definitions:{type:"object",required:["kind","pairs"],additionalProperties:false,properties:{kind:{const:"definitions"},pairs:{type:"array",minItems:1,items:{type:"object",required:["term","description"],additionalProperties:false,properties:{term:{type:"string"},description:{type:"string"}}}}}},table:{type:"object",required:["kind","columns","rows"],additionalProperties:false,properties:{kind:{const:"table"},caption:{type:"string"},columns:{type:"array",minItems:1,items:{type:"object",required:["header"],additionalProperties:false,properties:{header:{type:"string"},align:{enum:["left","right","center"],description:"Right-align money and any other figure column."}}}},rows:{type:"array",items:{type:"array",items:{type:"string"}},description:"One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."}}},notice:{type:"object",required:["kind","tone","text"],additionalProperties:false,properties:{kind:{const:"notice"},tone:{enum:["note","warning","important"]},title:{type:"string"},text:{type:"string"}}},figure:{type:"object",required:["kind","caption"],additionalProperties:false,properties:{kind:{const:"figure"},caption:{type:"string",description:"Required. An uncaptioned exhibit cannot be cited from the text that relies on it."},src:{type:"string",description:"Reference the host resolves. Never a data URI."},placeholder:{type:"string",description:"Text stand-in when src is absent, so a figure never renders empty."}}},execution:{type:"object",required:["kind","signatories"],additionalProperties:false,properties:{kind:{const:"execution"},label:{type:"string"},attestation:{type:"string",description:"The attestation clause, as running text."},signatories:{type:"array",minItems:1,items:{type:"object",required:["role"],additionalProperties:false,properties:{role:{type:"string",description:'Capacity: "Testator", "Witness", "Grantor".'},name:{type:"string",description:"Printed BELOW the signing rule, never on it."},detail:{type:"string"},dated:{type:"boolean",description:"Add a second, shorter rule for the date."}}}},columns:{enum:[1,2]},note:{type:"string"}}}},$r=["md","lg","xl"],ei=5;function ti(e2){let t2=$r.indexOf(e2);return t2>0?$r[t2-1]:e2}var ni=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function ri(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function ii({value:e2,label:r2,size:i2="lg",tone:a2,progress:o2,progressLabel:s2,autoStepDown:c2=true,baseProps:l2,className:u2,style:d2}){let f2=ni(e2)?$(e2,gr(l2)):e2,p2=typeof f2=="string"||typeof f2=="number"?String(f2).length:0,m2=c2&&p2>ei?ti(i2):i2,h2=Ie(a2,"strong"),{toned:g2,..._2}=Le(h2),v2=o2==null?null:ri(o2);return n("div",{className:y("core-stat",g2&&"core-toned",u2),..._2,"data-size":m2,style:d2,children:[t("div",{className:"core-stat__value",children:f2}),r2!=null&&t(Re,{className:"core-stat__label",tone:h2==="on-dark"||h2==="inherit"?h2:"subtle",children:r2}),v2!==null&&t("div",{className:"core-stat__progress",role:"progressbar","aria-label":s2??(typeof r2=="string"?r2:"Progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":v2,style:x({"--core-stat-progress":`${v2}%`}),children:t("div",{className:"core-stat__progress-fill"})})]})}function ai({children:e2,minColumnWidth:n2=200,maxColumns:r2=4,gap:i2=32,className:a2,style:o2}){return t("div",{className:y("core-stat-group",a2),style:x({"--core-stat-group-min":`${n2}px`,"--core-stat-group-max":String(Math.max(1,r2)),"--core-stat-group-gap":`${i2}px`},o2),children:e2})}var oi={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function si({direction:e2="up",delay:n2=0,duration:r2=.5,threshold:i2=.15,once:a2=true,className:o2,style:s2,children:c2}){let u2=m(null),[d2,f2]=h(false);l(()=>{let e3=u2.current;if(!e3)return;if(typeof IntersectionObserver>"u"){f2(true);return}let t2=new IntersectionObserver(e4=>{let n3=e4[e4.length-1];n3&&(n3.isIntersecting?(f2(true),a2&&t2.disconnect()):a2||f2(false))},{threshold:Math.min(1,Math.max(0,i2))});return t2.observe(e3),()=>t2.disconnect()},[a2,i2]);let[p2,g2]=oi[e2];return t("div",{ref:u2,className:y("core-reveal",o2),"data-revealed":d2?"true":"false",style:x({"--core-reveal-x":`${p2}px`,"--core-reveal-y":`${g2}px`,"--core-reveal-duration":`${r2}s`,"--core-reveal-delay":`${n2}s`},s2),children:c2})}function ci({eyebrow:e2,title:r2,description:i2,trailing:a2,level:o2=2,revealDelay:s2=0,className:c2,style:l2}){let u2=o2===3,d2=u2?"h3":"h2";return t(si,{direction:"up",delay:s2,className:y("core-section-header",c2),style:l2,children:n("div",{className:"core-section-header__inner","data-described":i2?"true":void 0,"data-level":u2?"3":void 0,children:[n("div",{className:"core-section-header__text",children:[e2?t(Re,{className:"core-section-header__eyebrow",children:e2}):null,t(d2,{className:"core-section-header__title",children:r2}),i2?t("p",{className:"core-section-header__description",children:i2}):null]}),a2!=null&&a2!==""?t("div",{className:"core-section-header__trailing",children:a2}):null]})})}function li({tone:e2,label:r2,headline:i2,children:a2,trailing:o2,className:s2,style:c2}){let l2=J(e2,"accent"),u2=o2!=null&&o2!=="";return n("div",{className:y("core-highlight-box","core-toned",s2),"data-tone":l2,style:c2,children:[n("div",{className:"core-highlight-box__text",children:[r2?t("div",{className:"core-highlight-box__label",children:r2}):null,i2?t("div",{className:"core-highlight-box__headline",children:i2}):null,a2!=null&&a2!==""?t("div",{className:"core-highlight-box__body",children:a2}):null]}),u2?t("div",{className:"core-highlight-box__trailing",children:o2}):null]})}function ui({label:r2,children:i2,className:a2,style:o2}){return n("div",{className:y("core-disclaimer-block",a2),style:o2,children:[r2?n(e,{children:[t("strong",{className:"core-disclaimer-block__label",children:r2})," "]}):null,i2]})}function di(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function fi({label:e2,value:r2,fillPercent:i2,subtitle:a2,tone:o2,baseProps:s2,className:c2,style:l2}){let u2=gr(s2),d2=di(i2);return n("div",{className:y("core-stat-strip","core-toned",c2),"data-tone":J(o2,"info"),style:x({"--core-stat-strip-fill":`${d2}%`},l2),children:[n("div",{className:"core-stat-strip__row",children:[t("span",{className:"core-stat-strip__label",children:e2}),t("span",{className:"core-stat-strip__value",children:$(r2,u2)})]}),t("div",{className:"core-stat-strip__track",children:t("div",{className:"core-stat-strip__fill"})}),a2?t("div",{className:"core-stat-strip__subtitle",children:$(a2,u2)}):null]})}function pi({text:e2,tone:n2,locale:r2,className:i2}){return t("span",{className:y("core-value-badge","core-toned",i2),"data-tone":J(n2),children:$(e2,r2)})}var mi=8,hi={good:"success",warn:"warning",critical:"danger"};function gi(e2,t2,n2){let r2={series:String(n2%mi+1)},i2=e2??t2;if(typeof i2!="string"||i2==="")return r2;if(i2==="muted")return{series:"muted"};let a2=/^series-([1-9]\d*)$/.exec(i2);if(a2)return{series:String((Number(a2[1])-1)%mi+1)};let o2=hi[i2];return o2?{tone:o2}:Ne.includes(i2)?{tone:i2}:(q("OptionCard:colour",`[OptionCard] bar fill "${i2}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`),r2)}function _i(e2){return typeof e2=="number"&&Number.isFinite(e2)?{text:String(e2).padStart(2,"0"),kind:"numeral"}:typeof e2!="string"||e2.trim()===""?null:/^\d+$/.test(e2.trim())?{text:e2.trim().padStart(2,"0"),kind:"numeral"}:{text:e2,kind:"label"}}function vi(e2){let{number:r2,title:i2,description:a2,badgeText:o2,badgeTone:s2,bars:c2,tone:l2,isSelected:u2=false,className:d2,style:f2}=e2,p2=gr(e2.baseProps),m2=Array.isArray(c2)?c2:[],h2=_i(r2);return n("div",{className:y("core-option-card",d2),"data-selected":u2?"true":void 0,"data-described":a2?"true":void 0,style:f2,children:[n("div",{className:"core-option-card__head",children:[h2?t("div",{className:"core-option-card__number","data-kind":h2.kind,children:h2.text}):t("span",{}),o2!=null&&o2!==""?t(pi,{text:o2,tone:J(s2),locale:p2}):null]}),i2?t("div",{className:"core-option-card__title",children:i2}):null,a2?t("p",{className:"core-option-card__description",children:a2}):null,m2.map((e3,r3)=>{let i3=gi(e3.tone,l2,r3),a3=Math.min(100,Math.max(0,Number(e3.fillPercent)||0)),o3=e3.valueTone===void 0||e3.valueTone==="default"?void 0:J(e3.valueTone);return n("div",{className:"core-option-card__bar",children:[n("div",{className:"core-option-card__bar-head",children:[t("span",{className:"core-option-card__bar-label",children:e3.label}),t("span",{className:y("core-option-card__bar-value",o3&&"core-toned"),"data-tone":o3,children:$(e3.value,p2)})]}),t("div",{className:"core-option-card__track",children:t("div",{className:y("core-option-card__fill","tone"in i3&&"core-toned"),"data-tone":"tone"in i3?i3.tone:void 0,"data-series":"series"in i3?i3.series:void 0,style:x({"--core-option-card-fill":`${a3}%`})})})]},r3)})]})}function yi(e2){let{title:r2,subtitle:i2,rows:a2,className:o2,style:s2}=e2,c2=gr(e2.baseProps),l2=e2.tone??"info",u2=l2==="none",d2=Array.isArray(a2)?a2:[];return n("div",{className:y("core-profile-card",!u2&&"core-toned",o2),"data-tone":u2?void 0:J(l2,"info"),"data-marker":u2?"none":void 0,style:s2,children:[n("div",{className:"core-profile-card__head",children:[t("div",{className:"core-profile-card__title",children:r2}),i2?t("div",{className:"core-profile-card__subtitle",children:i2}):null]}),d2.map((e3,r3)=>n("div",{className:"core-profile-card__row",children:[t("span",{className:"core-profile-card__label",children:e3.label}),n("div",{className:"core-profile-card__end",children:[t("span",{className:"core-profile-card__value",children:$(e3.value,c2)}),e3.badge?t(pi,{text:e3.badge.text,tone:J(e3.badge.tone),locale:c2}):null]})]},r3))]})}function bi(e2){if(typeof e2=="string"){let t2=e2.trim();return t2.startsWith("+")?"up":t2.startsWith("-")||t2.startsWith("−")?"down":"flat"}return e2&&typeof e2=="object"&&typeof e2.value=="number"?e2.value>0?"up":e2.value<0?"down":"flat":"flat"}var xi={up:"▲",down:"▼",flat:"—"},Si={up:"success",down:"danger",flat:void 0},Ci=e2=>e2!=null&&e2!=="";function wi(e2){let{columns:r2=4,gap:i2="tight",minColumnWidth:a2,className:o2,style:s2}=e2,c2=gr(e2.baseProps),l2=Array.isArray(e2.cards)?e2.cards:[],u2=Math.max(1,Math.min(6,Math.round(Number(r2))||4));return t("div",{className:y("core-kpi-card-grid",o2),"data-gap":i2==="normal"?"normal":"tight",style:x({"--core-kpi-card-grid-columns":String(u2),"--core-kpi-card-grid-min":typeof a2=="number"&&a2>0?`${a2}px`:void 0},s2),children:l2.map((e3,r3)=>{let{subtitle:i3,badge:a3}=e3,o3=Ci(e3.tone)?J(e3.tone):void 0,s3=Ci(e3.delta)?bi(e3.delta):void 0,l3=s3?Si[s3]:void 0;return t(si,{direction:"up",delay:r3*.06,className:"core-kpi-card-grid__item",children:n("div",{className:y("core-kpi-card-grid__card",o3&&"core-toned"),"data-tone":o3,children:[n("div",{className:"core-kpi-card-grid__head",children:[t("div",{className:"core-kpi-card-grid__label",children:e3.label}),a3&&Ci(a3.text)?t(pi,{text:a3.text,tone:J(a3.tone),locale:c2}):null]}),t("div",{className:"core-kpi-card-grid__value",children:$(e3.value,c2)}),s3?n("div",{className:y("core-kpi-card-grid__delta",l3&&"core-toned"),"data-tone":l3,"data-direction":s3,children:[t("span",{"aria-hidden":"true",children:xi[s3]})," ",$(e3.delta,c2)]}):null,Ci(i3)?t("div",{className:"core-kpi-card-grid__subtitle",children:$(i3,c2)}):null]})},r3)})})}function Ti(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return J(e2)}var Ei=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),Di=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!o(e2)&&"value"in e2&&!("format"in e2));function Oi(e2){return Di(e2)?e2:{value:e2}}var ki=/^\d{4}-\d{2}-\d{2}$/,Ai=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function ji(e2,t2,n2){if(!Ai.test(e2))return e2;let r2=ki.test(e2),i2=new Date(r2?`${e2}T00:00:00Z`:e2.replace(" ","T"));return Number.isNaN(i2.getTime())?e2:i2.toLocaleString(n2,{year:"numeric",month:"short",day:"numeric",...t2==="datetime"&&!r2?{hour:"numeric",minute:"2-digit"}:{},...r2?{timeZone:"UTC"}:{}})}function Mi(e2){if(!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e2))return e2;let t2=e2.replace(/[_-]+/g," ");return t2[0].toUpperCase()+t2.slice(1)}var Ni=new Set(["currency","currency-k","currency-m","currency-compact","currency-monthly","percent","fraction-percent","age","years","year","number"]),Pi={fraction:"fraction-percent"};function Fi(e2,t2,n2,r2){if(t2==="unit"){let t3=typeof n2=="string"?n2.trim():"",i2=Pi[t3]??(Ni.has(t3)?t3:void 0);return $(i2?{value:e2,format:i2}:{value:e2,format:"number",...t3?{unit:t3}:{}},r2)}return t2&&Ni.has(t2)?br(t2,e2,{locale:r2}):String(e2)}function Ii(e2,t2,n2,r2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&(t2==="date"||t2==="datetime")?ji(e2,t2,r2.locale):typeof e2=="string"?$(Mi(e2),r2):Ei(e2)?$(e2,r2):typeof e2=="number"?Fi(e2,t2,n2,r2):o(e2)?e2:null}function Li({title:e2,subtitle:r2,columns:i2,rows:a2,baseProps:o2,className:s2,style:c2}){let l2=gr(o2),d2=`${u()}-title`,f2=Array.isArray(i2)?i2:[],p2=Array.isArray(a2)?a2:[],m2=e3=>f2[e3]?.align??(e3===0?"left":"right");return t(si,{direction:"up",children:n("div",{className:y("core-data-table",s2),style:c2,children:[e2||r2?n("div",{className:"core-data-table__head",children:[e2?t("div",{id:d2,className:"core-data-table__title",children:e2}):null,r2?t("div",{className:"core-data-table__subtitle",children:r2}):null]}):null,t("div",{className:"core-data-table__scroll",role:"region","aria-label":e2?void 0:"Data table, scrollable","aria-labelledby":e2?d2:void 0,tabIndex:0,children:n("table",{className:"core-data-table__table",children:[t("thead",{children:t("tr",{children:f2.map((e3,r3)=>n("th",{scope:"col",className:"core-data-table__col","data-align":m2(r3),style:x({"--core-data-table-min":typeof e3.minWidth=="number"&&e3.minWidth>0?`${e3.minWidth}px`:void 0}),children:[e3.header,e3.sublabel?t("span",{className:"core-data-table__sublabel",children:e3.sublabel}):null]},r3))})}),t("tbody",{children:p2.map((e3,n2)=>{let{highlighted:r3,total:i3}=e3,a3=e3.cells,o3=Array.isArray(a3)?a3:a3&&typeof a3=="object"?f2.map(e4=>a3[e4.key]):[];return t("tr",{className:"core-data-table__row","data-highlighted":r3?"true":void 0,"data-total":i3?"true":void 0,children:o3.map((n3,r4)=>{let i4=Oi(n3),a4=Ti(i4.tone),o4={className:y("core-data-table__cell",a4&&"core-toned"),"data-align":m2(r4),"data-tone":a4};return r4===0?t("th",{scope:"row",...o4,children:Ii(i4.value,f2[r4]?.format,e3.unit,l2)},r4):t("td",{...o4,children:Ii(i4.value,f2[r4]?.format,e3.unit,l2)},r4)})},n2)})})]})})]})})}function Ri(r2){let{event:i2,href:a2,locale:o2,timeZone:s2,size:c2,className:l2,style:u2}=r2,d2=i2&&typeof i2=="object"?i2:{name:""},f2=nt(d2,o2,s2),p2=d2.status&&d2.status!=="confirmed"?d2.status:void 0,m2=n(e,{children:[n("div",{className:"core-event-card__top",children:[d2.typeName?t("span",{className:"core-event-card__type",children:d2.typeName}):null,p2?t("span",{className:"core-event-card__status","data-status":p2,children:p2}):null]}),t("div",{className:"core-event-card__name",children:d2.name}),f2?t("div",{className:"core-event-card__when",children:f2}):null,d2.location?t("div",{className:"core-event-card__where",children:d2.location}):null]});return t("div",{className:y("core-event-card",l2),"data-kind":d2.kind,"data-status":d2.status,"data-size":c2==="compact"?"compact":void 0,style:u2,children:a2?t("a",{className:"core-event-card__link",href:a2,children:m2}):m2})}var zi={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function Bi(e2){let{actions:r2,className:i2,style:a2}=e2,[o2,s2]=h(e2.response),[c2,l2]=h(false),[u2,d2]=h(""),f2=r2?.respond,p2=async e3=>{if(!f2||c2)return;l2(true),d2("");let t2=await f2({response:e3});l2(false),t2.success?s2(e3):d2(ot(t2))};return n("div",{className:y("core-event-respond",i2),style:a2,children:[t("div",{className:"core-event-respond__choices",role:"group","aria-label":"Your response",children:$e.map(e3=>t("button",{type:"button",className:"core-event-respond__choice","aria-pressed":o2===e3,disabled:!f2||c2,onClick:()=>void p2(e3),children:zi[e3]},e3))}),u2?t("p",{className:"core-event-respond__message",role:"alert",children:u2}):null]})}function Vi(e2){let{event:r2,actions:i2,viewerResponse:a2,locale:o2,timeZone:s2,className:c2,style:l2}=e2,u2=r2&&typeof r2=="object"?r2:{name:""},d2=Array.isArray(e2.notes)?e2.notes:[],f2=Array.isArray(e2.participants)?e2.participants:[],p2=nt(u2,o2,s2);return n("article",{className:y("core-event-detail",c2),"data-status":u2.status,style:l2,children:[n("header",{className:"core-event-detail__head",children:[u2.typeName?t("div",{className:"core-event-detail__type",children:u2.typeName}):null,t("h2",{className:"core-event-detail__name",children:u2.name}),p2?t("div",{className:"core-event-detail__meta",children:p2}):null,u2.location?t("div",{className:"core-event-detail__meta",children:u2.location}):null,u2.status&&u2.status!=="confirmed"?t("div",{className:"core-event-detail__status",children:u2.status}):null]}),a2===void 0?null:t(Bi,{response:a2,actions:i2,className:"core-event-detail__respond"}),f2.length?n("section",{className:"core-event-detail__section","aria-label":"Participants",children:[t("h3",{className:"core-event-detail__heading",children:"Participants"}),t("ul",{className:"core-event-detail__list",children:f2.map((e3,r3)=>n("li",{className:"core-event-detail__person",children:[t("span",{children:e3.name}),t("span",{className:"core-event-detail__muted",children:[e3.role,e3.response&&e3.response!=="needs_action"?e3.response:void 0].filter(Boolean).join(" · ")})]},r3))})]}):null,d2.length?n("section",{className:"core-event-detail__section","aria-label":"Notes",children:[t("h3",{className:"core-event-detail__heading",children:"Notes"}),d2.map((e3,r3)=>n("div",{className:"core-event-detail__note","data-audience":e3.audience,children:[e3.audience==="staff"?t("div",{className:"core-event-detail__badge",children:"Staff only"}):null,t("p",{className:"core-event-detail__body",children:e3.body}),e3.author||e3.createdAt?t("div",{className:"core-event-detail__muted",children:[e3.author,e3.createdAt?new Date(e3.createdAt).toLocaleString(o2,{timeZone:s2}):void 0].filter(Boolean).join(" · ")}):null]},r3))]}):null]})}var Hi=e2=>{let t2=e2?.dataSchema?.properties??{},n2=new Set(e2?.dataSchema?.required??[]);return Object.entries(t2).map(([e3,t3])=>[e3,t3,n2.has(e3)])};function Ui(e2){let{orgId:r2,projectId:i2,actions:a2,onDone:o2,canWriteStaffNotes:s2,className:c2,style:l2}=e2,d2=Array.isArray(e2.types)?e2.types:[],p2=u(),[m2,g2]=h(e2.defaultTypeId??d2[0]?.id??""),_2=d2.find(e3=>e3.id===m2),v2=_2?.kind==="scheduled",[b2,x2]=h(""),[S2,C2]=h(at()),[w2,T2]=h(""),[E2,D2]=h(""),[O2,k2]=h({}),[A2,j2]=h(""),[M2,N2]=h(!!s2),[P2,F2]=h(false),[I2,L2]=h(""),R2=f(()=>Hi(_2),[_2]);if(!d2.length)return t("p",{className:y("core-event-log","core-event-log__empty",c2),style:l2,children:"There's nothing you can log here."});let z2=async t2=>{if(t2.preventDefault(),!a2?.logEvent||P2||!_2)return;F2(true),L2("");let n2=it(S2),c3={event_type_id:_2.id,org_id:r2,name:b2.trim()||_2.name,starts_at:n2,tzid:rt(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};i2&&(c3.project_id=i2),v2&&w2&&(c3.ends_at=it(w2)),E2.trim()&&(c3.location=E2.trim());let l3=A2.trim()?[{body:A2.trim(),audience:s2&&M2?"staff":"shared"}]:void 0,u2=await a2.logEvent(l3?{event:c3,notes:l3}:{event:c3});F2(false),u2.success?(x2(""),j2(""),k2({}),o2?.(u2)):L2(ot(u2))},B2=(e3,t2)=>k2(n2=>({...n2,[e3]:t2}));return n("form",{className:y("core-event-log",c2),style:l2,onSubmit:e3=>void z2(e3),children:[n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Type"}),t("select",{value:m2,onChange:e3=>{g2(e3.target.value),k2({})},children:d2.map(e3=>t("option",{value:e3.id,children:e3.name},e3.id))})]}),n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Title"}),t("input",{value:b2,onChange:e3=>x2(e3.target.value),placeholder:_2?.name})]}),n("div",{className:"core-event-log__row",children:[n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:v2?"Starts":"When"}),t("input",{type:"datetime-local",required:true,value:S2,onChange:e3=>C2(e3.target.value)})]}),v2?n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Ends"}),t("input",{type:"datetime-local",value:w2,min:S2,onChange:e3=>T2(e3.target.value)})]}):null]}),n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Where"}),t("input",{value:E2,onChange:e3=>D2(e3.target.value)})]}),R2.map(([e3,r3,i3])=>{let a3=r3.title??e3;if(r3.enum)return n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:a3}),n("select",{required:i3,value:String(O2[e3]??""),onChange:t2=>B2(e3,t2.target.value||void 0),children:[t("option",{value:"",children:"—"}),r3.enum.map(e4=>t("option",{value:e4,children:e4},e4))]})]},e3);if(r3.type==="boolean")return n("label",{className:"core-event-log__check",children:[t("input",{type:"checkbox",checked:!!O2[e3],onChange:t2=>B2(e3,t2.target.checked)}),t("span",{children:a3})]},e3);let o3=r3.type==="number"||r3.type==="integer";return n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:a3}),t("input",{type:o3?"number":"text",step:r3.type==="integer"?1:"any",required:i3,value:O2[e3]===void 0?"":String(O2[e3]),onChange:t2=>B2(e3,t2.target.value===""?void 0:o3?Number(t2.target.value):t2.target.value)})]},e3)}),n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Note"}),t("textarea",{rows:3,value:A2,onChange:e3=>j2(e3.target.value)})]}),s2&&A2.trim()?n("label",{className:"core-event-log__check",children:[t("input",{type:"checkbox",checked:M2,onChange:e3=>N2(e3.target.checked)}),t("span",{children:"Staff only: the client won't see this note"})]}):null,I2?t("p",{id:`${p2}-error`,className:"core-event-log__message",role:"alert",children:I2}):null,t("div",{className:"core-event-log__actions",children:t("button",{type:"submit",className:"core-event-log__submit",disabled:P2||!a2?.logEvent,children:P2?"Saving…":v2?"Schedule":"Log"})})]})}var Wi=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Gi(e2){let{view:r2="week",weekParam:i2="week",linkParams:a2,eventHref:o2="?panel=event:{id}",locale:s2,timeZone:c2,renderComponent:l2,label:u2="Schedule",className:d2,style:f2}=e2,p2=e3=>`?${a2?new URLSearchParams({...a2,[i2]:e3}).toString():`${i2}=${e3}`}`,m2=Array.isArray(e2.occurrences)?e2.occurrences:[],h2=st(new Date,c2),g2=ct(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:h2),_2=Array.from({length:7},(e3,t2)=>Y(g2,t2)),v2=new Map(_2.map(e3=>[e3,[]]));for(let e3 of m2)for(let t2 of lt(e3,c2))v2.get(t2)?.push(e3);for(let e3 of v2.values())e3.sort((e4,t2)=>+!e4.startOn-!t2.startOn||(e4.startsAt??"").localeCompare(t2.startsAt??""));let b2=r2==="agenda"?_2.filter(e3=>v2.get(e3).length):_2;return n("section",{className:y("core-event-schedule",d2),"data-view":r2,style:f2,"aria-label":u2,children:[n("div",{className:"core-event-schedule__nav",children:[t("a",{className:"core-event-schedule__step",href:p2(Y(g2,-7)),"aria-label":"Previous week",children:"‹"}),t("span",{className:"core-event-schedule__range",children:`${Wi(_2[0],s2)} – ${Wi(_2[6],s2)}`}),t("a",{className:"core-event-schedule__step",href:p2(Y(g2,7)),"aria-label":"Next week",children:"›"})]}),b2.length===0?t("p",{className:"core-event-schedule__empty",children:"Nothing scheduled this week."}):null,t("ol",{className:"core-event-schedule__days",children:b2.map(e3=>{let r3=v2.get(e3);return n("li",{className:"core-event-schedule__day","data-today":e3===h2||void 0,children:[t("h3",{className:"core-event-schedule__date",children:Wi(e3,s2)}),r3.length?t("ul",{className:"core-event-schedule__events",children:r3.map((e4,n2)=>t("li",{children:Ze(e4,l2,{href:ut(o2,e4.id),locale:s2,timeZone:c2})??t(Ri,{event:e4,href:ut(o2,e4.id),locale:s2,timeZone:c2})},`${e4.id??n2}-${e4.startsAt??e4.startOn??n2}`))}):t("p",{className:"core-event-schedule__none",children:"—"})]},e3)})})]})}var Ki=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function qi(e2){let{eventHref:r2="?panel=event:{id}",emptyText:i2="No activity yet.",locale:a2,timeZone:o2,renderComponent:s2,className:c2,style:l2}=e2,u2=[...(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&!Number.isNaN(new Date(e3.at).getTime()))].sort((e3,t2)=>new Date(t2.at).getTime()-new Date(e3.at).getTime()),d2=[];for(let e3 of u2){let t2=st(e3.at,o2),n2=d2[d2.length-1];n2&&n2[0]===t2?n2[1].push(e3):d2.push([t2,[e3]])}let f2=new Intl.DateTimeFormat(a2,{hour:"numeric",minute:"2-digit",timeZone:o2});return n("section",{className:y("core-event-timeline",c2),style:l2,"aria-label":"Activity",children:[d2.length===0?t("p",{className:"core-event-timeline__empty",children:i2}):null,d2.map(([e3,i3])=>n("section",{className:"core-event-timeline__day",children:[t("h3",{className:"core-event-timeline__date",children:Ki(e3,a2)}),t("ol",{className:"core-event-timeline__items",children:i3.map((e4,i4)=>n("li",{className:"core-event-timeline__item","data-op":e4.op||void 0,children:[n("div",{className:"core-event-timeline__line",children:[t("time",{className:"core-event-timeline__time",dateTime:e4.at,children:f2.format(new Date(e4.at))}),e4.summary?t("span",{className:"core-event-timeline__summary",children:e4.summary}):null,e4.actor?t("span",{className:"core-event-timeline__actor",children:e4.actor}):null]}),e4.event?Ze(e4.event,s2,{href:ut(r2,e4.event.id),locale:a2,timeZone:o2})??t(Ri,{event:e4.event,href:ut(r2,e4.event.id),locale:a2,timeZone:o2}):null]},e4.id??`${e4.at}-${i4}`))})]},e3))]})}var Ji=1440;function Yi(e2){return new Intl.DateTimeFormat("en-CA",{timeZone:e2,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Xi(e2,t2){let n2=e2 instanceof Date?e2:new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=Object.fromEntries(Yi(t2).formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${r2.year}-${r2.month}-${r2.day}`,minutes:Number(r2.hour)*60+Number(r2.minute)+Number(r2.second)/60}}var Zi=e2=>e2.busyOnly===true;function Qi(e2,t2){if(!e2.startsAt)return null;let n2=Xi(e2.startsAt,t2);if(!n2)return null;let r2=new Date(e2.startsAt).getTime(),i2=e2.endsAt?new Date(e2.endsAt).getTime():NaN,a2=Xi(Number.isFinite(i2)&&i2>r2?i2:r2+18e5,t2);return a2?{start:n2,end:a2}:null}function $i(e2,t2,{timeZone:n2,minMinutes:r2=42}={}){let i2=[],a2=[];for(let r3 of e2){if(!r3||typeof r3!="object")continue;if(r3.startOn){lt(r3).includes(t2)&&i2.push(r3);continue}let e3=Qi(r3,n2);if(!e3||e3.start.date>t2||e3.end.date<t2||e3.end.date===t2&&e3.end.minutes===0&&e3.start.date<t2)continue;let o3=e3.start.date<t2?0:e3.start.minutes,s3=e3.end.date>t2?Ji:e3.end.minutes;a2.push({event:r3,startMin:o3,endMin:Math.max(s3,o3+1),continuesBefore:e3.start.date<t2,continuesAfter:e3.end.date>t2,busyOnly:Zi(r3)})}a2.sort((e3,t3)=>e3.startMin-t3.startMin||t3.endMin-e3.endMin);let o2=[],s2=[],c2=-1,l2=[],u2=()=>{for(let e4 of s2)e4.cols=l2.length;let e3=s2.filter(e4=>!e4.busyOnly);for(let t3 of e3)t3.overlaps=e3.some(e4=>e4!==t3&&e4.startMin<t3.endMin&&t3.startMin<e4.endMin);o2.push(...s2),s2=[],l2=[],c2=-1};for(let e3 of a2){s2.length&&e3.startMin>=c2&&u2();let t3=Math.min(Math.max(e3.endMin,e3.startMin+r2),Ji),n3=l2.findIndex(t4=>t4<=e3.startMin);n3<0&&(n3=l2.length),l2[n3]=t3,c2=Math.max(c2,t3),s2.push({...e3,shownEndMin:t3,col:n3,cols:1,overlaps:false})}return u2(),i2.sort((e3,t3)=>(e3.name??"").localeCompare(t3.name??"")),{date:t2,blocks:o2,allDay:i2}}function ea(e2,t2=7,n2=19){let r2=Math.max(0,Math.min(23,t2))*60,i2=Math.max(r2/60+1,Math.min(24,n2))*60;for(let t3 of e2)for(let e3 of t3.blocks)r2=Math.min(r2,Math.floor(e3.startMin/60)*60),i2=Math.max(i2,Math.ceil(e3.shownEndMin/60)*60);return{fromMin:r2,toMin:Math.min(i2,Ji)}}function ta(e2,t2=1){let n2=Y(ct(e2),(t2%7+6)%7);return n2>e2&&(n2=Y(n2,-7)),Array.from({length:7},(e3,t3)=>Y(n2,t3))}function na(e2,t2,n2){return t2.filter(t3=>$i(e2,t3,{timeZone:n2,minMinutes:0}).blocks.some(e3=>e3.overlaps))}var ra=["circle","square","triangle","diamond","plus","hexagon"],ia={circle:"M5 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z",square:"M1.5 1.5h7v7h-7z",triangle:"M5 1.2 9 8.5H1z",diamond:"M5 .8 9.2 5 5 9.2.8 5z",plus:"M3.5 1h3v2.5H9v3H6.5V9h-3V6.5H1v-3h2.5z",hexagon:"M5 .8 8.6 2.9v4.2L5 9.2 1.4 7.1V2.9z"},aa=e2=>ra[(Math.max(1,Math.floor(e2))-1)%ra.length],oa=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>=1?(Math.floor(e2)-1)%8+1:1;function sa({series:e2,className:n2}){let r2=oa(e2);return t("svg",{className:n2?`core-series-glyph ${n2}`:"core-series-glyph",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false","data-series":r2,"data-shape":aa(r2),children:t("path",{d:ia[aa(r2)]})})}var ca=44,la=28,ua=(e2,t2,n2)=>`${((e2-t2)/n2*100).toFixed(3)}%`;function da(e2){let t2=e2===void 0?void 0:typeof e2=="number"?e2:new Date(e2).getTime(),[n2,r2]=h(()=>Date.now());return l(()=>{if(t2!==void 0)return;let e3=setInterval(()=>r2(Date.now()),6e4);return()=>clearInterval(e3)},[t2]),t2!==void 0&&Number.isFinite(t2)?t2:n2}function fa(r2){let{label:i2="Schedule",startHour:a2=7,endHour:o2=19,hourHeight:s2=64,eventHref:c2="?panel=event:{id}",locale:u2,timeZone:d2,className:f2,style:p2}=r2,g2=(Array.isArray(r2.columns)?r2.columns:[]).filter(e2=>e2&&typeof e2.date=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e2.date)),_2=da(r2.now),v2=m(null),[b2,S2]=h(false);l(()=>{let e2=v2.current;if(!e2)return;let t2=()=>S2(e2.scrollWidth>e2.clientWidth+1);t2();let n2=new ResizeObserver(t2);return n2.observe(e2),()=>n2.disconnect()},[g2.length]);let C2=Xi(_2,d2),w2=Math.ceil(ca/Math.max(s2,24)*60),T2=g2.map(e2=>$i(Array.isArray(e2.events)?e2.events:[],e2.date,{timeZone:d2,minMinutes:w2})),E2=T2.map(e2=>Math.max(ca,la*Math.max(1,...e2.blocks.map(e3=>e3.cols)))),{fromMin:D2,toMin:O2}=ea(T2,a2,o2),k2=O2-D2,A2=Array.from({length:Math.floor(k2/60)+1},(e2,t2)=>D2+t2*60),j2=new Intl.DateTimeFormat(u2,{hour:"numeric",timeZone:"UTC"}),M2=new Intl.DateTimeFormat(u2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}),N2=e2=>M2.format(new Date(Date.UTC(2e3,0,1,0,Math.min(e2,Ji-1)))),P2=e2=>e2.continuesBefore?e2.continuesAfter?"All day":`Until ${N2(e2.endMin)}`:e2.continuesAfter?`From ${N2(e2.startMin)}`:`${N2(e2.startMin)} – ${N2(e2.endMin)}`;return n("div",{ref:v2,className:y("core-hour-grid",f2),role:"group","aria-label":i2,tabIndex:b2?0:void 0,style:x({"--core-hour-grid-cols":String(g2.length),"--core-hour-grid-tracks":E2.map(e2=>`minmax(${e2}px, 1fr)`).join(" "),"--core-hour-grid-min":`${E2.reduce((e2,t2)=>e2+t2,0)}px`,"--core-hour-grid-hour":`${s2}px`,"--core-hour-grid-hours":String(k2/60)},p2),children:[n("div",{className:"core-hour-grid__head",children:[t("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),g2.map(r3=>{let i3=C2?.date===r3.date,a3=n(e,{children:[t("span",{className:"core-hour-grid__label",children:r3.label}),r3.sublabel?t("span",{className:"core-hour-grid__sublabel",children:r3.sublabel}):null]}),o3=pt(r3.href);return o3?t("a",{className:"core-hour-grid__day",href:o3,"data-today":i3||void 0,"aria-current":i3?"date":void 0,children:a3},r3.id):t("div",{className:"core-hour-grid__day","data-today":i3||void 0,"aria-current":i3?"date":void 0,children:a3},r3.id)})]}),T2.some(e2=>e2.allDay.length)?n("div",{className:"core-hour-grid__allday",children:[t("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),T2.map((e2,n2)=>t("ul",{className:"core-hour-grid__chips","aria-label":`All day, ${g2[n2].label}`,children:e2.allDay.map((e3,n3)=>{let r3=pa(e3)?void 0:pt(ut(c2,e3.id));return t("li",{className:"core-hour-grid__chip","data-busy":pa(e3)||void 0,children:pa(e3)?t("span",{className:"core-hour-grid__sr",children:"Busy all day"}):r3?t("a",{href:r3,children:e3.name}):e3.name},`${e3.id??n3}`)})},g2[n2].id))]}):null,n("div",{className:"core-hour-grid__body",children:[t("div",{className:"core-hour-grid__axis","aria-hidden":"true",children:A2.map((e2,n2)=>t("span",{className:"core-hour-grid__tick",style:{top:ua(e2,D2,k2)},"data-first":n2===0||void 0,children:n2===0?"":j2.format(new Date(Date.UTC(2e3,0,1,e2/60)))},e2))}),T2.map((r3,i3)=>{let a3=g2[i3],o3=C2?.date===a3.date;return n("section",{className:"core-hour-grid__col","aria-label":a3.label,"data-today":o3||void 0,children:[t("ol",{className:"core-hour-grid__events",children:r3.blocks.map((r4,i4)=>{let a4=r4.event,o4={"--core-hour-grid-top":ua(r4.startMin,D2,k2),"--core-hour-grid-height":`${((r4.shownEndMin-r4.startMin)/k2*100).toFixed(3)}%`,"--core-hour-grid-left":`${(r4.col/r4.cols*100).toFixed(3)}%`,"--core-hour-grid-width":`${(100/r4.cols).toFixed(3)}%`};if(r4.busyOnly)return t("li",{className:"core-hour-grid__block","data-busy":"",style:x(o4),children:t("span",{className:"core-hour-grid__sr",children:`Busy, ${P2(r4)}`})},i4);let s3=pt(ut(c2,a4.id)),l2=r4.endMin-r4.startMin,u3=l2<45?"short":l2<90?"medium":"long",d3=n(e,{children:[r4.overlaps?t("span",{className:"core-hour-grid__overlap",children:"Overlaps"}):null,n("span",{className:"core-hour-grid__name",children:[typeof a4.series=="number"?t(sa,{series:a4.series,className:"core-hour-grid__series"}):null,a4.name]}),t("span",{className:"core-hour-grid__time",children:P2(r4)}),u3==="long"&&a4.typeName?t("span",{className:"core-hour-grid__type",children:a4.typeName}):null]}),f3={className:"core-hour-grid__event","data-kind":a4.kind,"data-status":a4.status,"data-size":u3,"data-overlaps":r4.overlaps||void 0};return t("li",{className:"core-hour-grid__block","data-before":r4.continuesBefore||void 0,"data-after":r4.continuesAfter||void 0,style:x(o4),children:s3?t("a",{...f3,href:s3,children:d3}):t("div",{...f3,children:d3})},`${a4.id??"e"}-${i4}`)})}),o3&&C2&&C2.minutes>=D2&&C2.minutes<=O2?t("div",{className:"core-hour-grid__now","aria-hidden":"true",style:{top:ua(C2.minutes,D2,k2)}}):null]},a3.id)})]})]})}var pa=e2=>e2.busyOnly===true,ma=/^\d{4}-\d{2}-\d{2}$/,ha=/^\d{2}:\d{2}$/,ga=(e2,t2)=>!e2||!ma.test(e2)?"":new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`)),_a=(e2,t2)=>new Intl.DateTimeFormat(t2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(new Date(`1970-01-01T${e2}:00Z`));function va(e2,t2){if(!e2)return null;let n2=new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",timeZone:t2}),i2=Object.fromEntries(r2.formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${i2.year}-${i2.month}-${i2.day}`,time:`${i2.hour}:${i2.minute}`}}function ya(e2,t2){if(!ma.test(e2)||!ha.test(t2))return;let n2=new Date(`${e2}T${t2}:00`);if(Number.isNaN(n2.getTime()))return;let r2=-n2.getTimezoneOffset(),i2=r2<0?"-":"+",a2=Math.abs(r2);return`${e2}T${t2}:00${i2}${String(Math.floor(a2/60)).padStart(2,"0")}:${String(a2%60).padStart(2,"0")}`}function ba(e2,t2=Date.now()){let n2=e3=>new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",...e3?{timeZone:e3}:{}}).format(t2);try{return n2(e2)}catch{return n2()}}var xa=(e2,t2,n2,r2)=>`?${new URLSearchParams({...r2,[n2]:"day",[t2]:e2}).toString()}`;function Sa({days:e2,param:r2="date",viewParam:i2="view",keep:a2,locale:o2,className:s2,style:c2}){let l2=[...new Set(e2.filter(e3=>ma.test(e3)))].sort();if(l2.length===0)return null;let u2=l2.length===1,d2=u2?`Events overlap on ${ga(l2[0],o2)}.`:`Events overlap on ${l2.length} days.`;return t("div",{className:y("core-overlap-notice",s2),style:c2,children:t(Gt,{tone:"warning",message:d2,action:n("span",{className:"core-overlap-notice__links",children:[u2?null:t("span",{className:"core-overlap-notice__lead",children:"Review:"}),l2.map(e3=>t("a",{className:"core-overlap-notice__review",href:xa(e3,r2,i2,a2),"aria-label":`Review ${ga(e3,o2)}`,children:u2?"Review":ga(e3,o2)},e3))]})})})}function Ca(e2){let{param:r2="type",cancelledParam:i2="cancelled",keep:a2,label:o2="Show",onChange:s2,className:c2,style:l2}=e2,d2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!==""),f2=u(),p2=d2.map(e3=>e3.id),m2=Array.isArray(e2.selected)?e2.selected:p2,h2=e2.showCancelled===true;if(d2.length===0)return null;let g2=e3=>{let t2=new FormData(e3);return{selected:t2.getAll(r2).map(String),showCancelled:t2.has(i2)}};return n("form",{className:y("core-calendar-filters",c2),style:l2,method:"get",action:"",onChange:e3=>{s2?s2(g2(e3.currentTarget)):typeof e3.currentTarget.requestSubmit=="function"&&e3.currentTarget.requestSubmit()},onSubmit:e3=>s2&&e3.preventDefault(),children:[Object.entries(a2??{}).map(([e3,n2])=>t("input",{type:"hidden",name:e3,value:n2},e3)),n("fieldset",{className:"core-calendar-filters__set",children:[t("legend",{className:"core-calendar-filters__legend",children:o2}),d2.map((e3,i3)=>n("label",{className:"core-calendar-filters__option",children:[t("input",{type:"checkbox",name:r2,value:e3.id,defaultChecked:m2.includes(e3.id)}),t(sa,{series:oa(e3.series??i3+1)}),t("span",{className:"core-calendar-filters__label",children:e3.label})]},e3.id)),n("label",{className:"core-calendar-filters__option core-calendar-filters__option--cancelled",children:[t("input",{type:"checkbox",name:i2,value:"1",defaultChecked:h2}),t("span",{className:"core-calendar-filters__label",children:"Cancelled"})]})]}),t("button",{type:"submit",className:"core-calendar-filters__apply",id:`${f2}-apply`,children:"Apply"})]})}var wa=(e2,t2,n2)=>`?${new URLSearchParams({...e2??{},[t2]:n2}).toString()}`,Ta=(e2,t2)=>{let[n2,r2]=e2.split("-").map(Number),i2=new Date(Date.UTC(n2,r2-1+t2,1));return`${i2.getUTCFullYear()}-${String(i2.getUTCMonth()+1).padStart(2,"0")}`};function Ea({month:e2,date:r2,highlight:i2="week",occurrences:a2,weekStartsOn:o2=1,param:s2="date",monthParam:c2="month",keep:l2,locale:u2,timeZone:d2,now:f2,className:p2,style:g2}){let _2=f2===void 0?Date.now():typeof f2=="number"?f2:new Date(f2).getTime(),v2=Xi(Number.isFinite(_2)?_2:Date.now(),d2)?.date??"1970-01-01",b2=r2&&/^\d{4}-\d{2}-\d{2}$/.test(r2)?r2:v2,x2=e2&&/^\d{4}-\d{2}$/.test(e2)?e2:b2.slice(0,7),S2=`${x2}-01`,C2=ta(S2,o2)[0],w2=Array.from({length:42},(e3,t2)=>Y(C2,t2)),T2=Array.from({length:6},(e3,t2)=>w2.slice(t2*7,t2*7+7)),E2=i2==="week"?new Set(ta(b2,o2)):new Set([b2]),D2=Array.isArray(a2)?a2:[],O2=new Map(w2.map(e3=>{let t2=$i(D2,e3,{timeZone:d2,minMinutes:0});return[e3,t2.blocks.length+t2.allDay.length]})),k2=(e3,t2)=>new Intl.DateTimeFormat(u2,{...e3,timeZone:"UTC"}).format(new Date(`${t2}T00:00:00Z`)),A2=k2({month:"long",year:"numeric"},S2),j2=T2[0].map(e3=>({short:k2({weekday:"narrow"},e3),long:k2({weekday:"long"},e3)})),M2=w2.includes(b2)?b2:w2.includes(v2)?v2:S2,[N2,P2]=h(null),F2=N2&&w2.includes(N2)?N2:M2,I2=m(null),L2=e3=>{w2.includes(e3)&&(P2(e3),I2.current?.querySelector(`[data-date="${e3}"]`)?.focus())};return n("div",{className:y("core-mini-month",p2),style:g2,children:[n("div",{className:"core-mini-month__head",children:[t("a",{className:"core-mini-month__step","data-step":"prev",href:wa(l2,c2,Ta(x2,-1)),"aria-label":"Previous month",children:"‹"}),t("div",{className:"core-mini-month__title",id:`mm-${x2}`,"aria-live":"polite",children:A2}),t("a",{className:"core-mini-month__step","data-step":"next",href:wa(l2,c2,Ta(x2,1)),"aria-label":"Next month",children:"›"})]}),n("div",{ref:I2,role:"grid","aria-labelledby":`mm-${x2}`,className:"core-mini-month__grid",onKeyDown:e3=>{let t2=e3.target.closest("[data-date]")?.dataset.date;if(!t2)return;let n2=T2.find(e4=>e4.includes(t2)),r3={ArrowLeft:Y(t2,-1),ArrowRight:Y(t2,1),ArrowUp:Y(t2,-7),ArrowDown:Y(t2,7),Home:n2[0],End:n2[6]};r3[e3.key]?(e3.preventDefault(),L2(r3[e3.key])):(e3.key==="PageUp"||e3.key==="PageDown")&&(e3.preventDefault(),I2.current?.parentElement?.querySelector(`a[data-step="${e3.key==="PageUp"?"prev":"next"}"]`)?.click())},children:[t("div",{role:"row",className:"core-mini-month__row core-mini-month__row--head",children:j2.map((e3,n2)=>t("span",{role:"columnheader","aria-label":e3.long,className:"core-mini-month__weekday",children:e3.short},n2))}),T2.map(e3=>t("div",{role:"row",className:"core-mini-month__row",children:e3.map(e4=>{let r3=O2.get(e4)??0,i3=`${k2({weekday:"long",month:"long",day:"numeric"},e4)}${e4===v2?", today":""}${r3?`, ${r3} ${r3===1?"event":"events"}`:""}`;return t("span",{role:"gridcell","aria-selected":e4===b2,className:"core-mini-month__cell","data-range":E2.has(e4)||void 0,"data-outside":e4.slice(0,7)!==x2||void 0,children:n("a",{className:"core-mini-month__day",href:wa(l2,s2,e4),"data-date":e4,"data-today":e4===v2||void 0,"data-selected":e4===b2||void 0,"aria-current":e4===b2?"date":void 0,"aria-label":i3,tabIndex:e4===F2?0:-1,onFocus:()=>P2(e4),children:[t("span",{"aria-hidden":"true",children:Number(e4.slice(8))}),t("span",{className:"core-mini-month__dot","aria-hidden":"true","data-has":r3>0||void 0})]})},e4)})},e3[0]))]})]})}var Da=(e2,t2,n2)=>`?${new URLSearchParams({...n2??{},[e2]:t2}).toString()}`;function Oa({date:e2,occurrences:r2,weekStartsOn:i2=1,param:a2="date",steps:o2=true,keep:s2,locale:c2,timeZone:l2,now:u2,className:d2,style:f2}){let p2=u2===void 0?Date.now():typeof u2=="number"?u2:new Date(u2).getTime(),m2=Xi(Number.isFinite(p2)?p2:Date.now(),l2)?.date??"1970-01-01",h2=e2&&/^\d{4}-\d{2}-\d{2}$/.test(e2)?e2:m2,g2=ta(h2,i2),_2=Array.isArray(r2)?r2:[],v2=new Intl.DateTimeFormat(c2,{weekday:"short",timeZone:"UTC"}),b2=new Intl.DateTimeFormat(c2,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}),x2=e3=>new Date(`${e3}T00:00:00Z`),S2=new Map(g2.map(e3=>{let t2=$i(_2,e3,{timeZone:l2});return[e3,t2.blocks.length+t2.allDay.length]}));return t("nav",{className:y("core-week-strip",d2),style:f2,"aria-label":"Week",children:n("div",{className:"core-week-strip__frame",children:[o2?t("a",{className:"core-week-strip__step",href:Da(a2,Y(h2,-7),s2),"aria-label":"Previous week",children:"‹"}):null,t("ol",{className:"core-week-strip__days",children:g2.map(e3=>{let r3=S2.get(e3)??0;return t("li",{children:n("a",{className:"core-week-strip__day",href:Da(a2,e3,s2),"aria-current":e3===h2?"date":void 0,"aria-label":`${b2.format(x2(e3))}${e3===m2?", today":""}${r3?`, ${r3} ${r3===1?"event":"events"}`:""}`,"data-selected":e3===h2||void 0,"data-today":e3===m2||void 0,children:[t("span",{className:"core-week-strip__weekday","aria-hidden":"true",children:v2.format(x2(e3))}),t("span",{className:"core-week-strip__date","aria-hidden":"true",children:Number(e3.slice(8))}),t("span",{className:"core-week-strip__mark","aria-hidden":"true","data-has":r3>0||void 0})]})},e3)})}),o2?t("a",{className:"core-week-strip__step",href:Da(a2,Y(h2,7),s2),"aria-label":"Next week",children:"›"}):null]})})}var ka=[["day","Day"],["week","Week"],["agenda","Agenda"]];function Aa(r2){let{weekStartsOn:i2=1,viewParam:a2="view",dateParam:o2="date",eventHref:s2,newEventHref:c2,summary:l2,notice:u2,startHour:d2,endHour:f2,locale:p2,timeZone:m2,className:h2,style:g2}=r2,_2=r2.view==="day"||r2.view==="agenda"?r2.view:"week",v2=Array.isArray(r2.occurrences)?r2.occurrences:[],b2=r2.now===void 0?Date.now():typeof r2.now=="number"?r2.now:new Date(r2.now).getTime(),x2=Xi(Number.isFinite(b2)?b2:Date.now(),m2)?.date??"1970-01-01",S2=r2.date&&/^\d{4}-\d{2}-\d{2}$/.test(r2.date)?r2.date:x2,C2=(e2,t2)=>`?${new URLSearchParams({[a2]:e2,[o2]:t2}).toString()}`,w2=_2==="day"?1:7,T2=pt(c2),E2=(e2,t2)=>new Intl.DateTimeFormat(p2,{...e2,timeZone:"UTC"}).format(new Date(`${t2}T00:00:00Z`)),D2=ta(S2,i2),O2=_2==="day"?E2({weekday:"long",month:"long",day:"numeric"},S2):`${E2({month:"short",day:"numeric"},D2[0])} – ${E2({month:"short",day:"numeric",year:"numeric"},D2[6])}`,k2=(e2,n2)=>t(fa,{columns:e2,label:n2,eventHref:s2,startHour:d2,endHour:f2,locale:p2,timeZone:m2,now:r2.now}),A2=e2=>({id:e2,date:e2,label:`${E2({weekday:"short"},e2)} ${Number(e2.slice(8))}`,sublabel:e2===x2?"Today":void 0,events:v2}),j2=D2.map(e2=>({...A2(e2),href:C2("day",e2)}));return n("section",{className:y("core-calendar","core-calendar-view",h2),style:g2,"aria-label":"Schedule","data-view":_2,children:[n("header",{className:"core-calendar__head",children:[t("h2",{className:"core-calendar__title",children:O2}),n("nav",{className:"core-calendar__nav","aria-label":"Calendar",children:[_2==="agenda"?null:t("a",{className:"core-calendar__step",href:C2(_2,Y(S2,-w2)),"aria-label":_2==="day"?"Previous day":"Previous week",children:"‹"}),t("a",{className:"core-calendar__today",href:C2(_2,x2),"aria-current":S2===x2||D2.includes(x2)?"date":void 0,children:"Today"}),_2==="agenda"?null:t("a",{className:"core-calendar__step",href:C2(_2,Y(S2,w2)),"aria-label":_2==="day"?"Next day":"Next week",children:"›"})]}),t("nav",{className:"core-calendar__views","aria-label":"View",children:ka.map(([e2,n2])=>t("a",{className:"core-calendar__view",href:C2(e2,S2),"aria-current":e2===_2?"page":void 0,children:n2},e2))}),T2?t("a",{className:"core-calendar__new",href:T2,children:"New event"}):null]}),l2?t("p",{className:"core-calendar__summary",children:l2}):null,u2?t("div",{className:"core-calendar__notice",children:u2}):null,_2==="day"?k2([A2(S2)],E2({weekday:"long",month:"long",day:"numeric"},S2)):null,_2==="week"?n(e,{children:[t("div",{className:"core-calendar__wide",children:k2(j2,`Week of ${E2({month:"long",day:"numeric"},D2[0])}`)}),n("div",{className:"core-calendar__narrow",children:[t(Oa,{date:S2,occurrences:v2,weekStartsOn:i2,param:o2,steps:false,keep:{[a2]:"week"},locale:p2,timeZone:m2,now:r2.now}),k2([A2(S2)],E2({weekday:"long",month:"long",day:"numeric"},S2))]})]}):null,_2==="agenda"?t(Gi,{label:"Agenda",occurrences:v2,view:"agenda",weekOf:S2,weekParam:o2,linkParams:{[a2]:"agenda"},eventHref:s2,locale:p2,timeZone:m2}):null]})}var ja=[5,10,15,20,30,45,60,90],Ma={line:300,note:2e3,attendees:20,attendee:80},Na=(e2,t2)=>typeof e2=="string"?e2.slice(0,t2):"",Pa=e2=>e2.split(/[,\n]/).map(e3=>e3.trim()).filter(Boolean);function Fa(e2){if(!e2)return at();let t2=new Date(e2);return Number.isNaN(t2.getTime())?at():(t2.setMinutes(t2.getMinutes()-t2.getTimezoneOffset()),t2.toISOString().slice(0,16))}function Ia(e2){let{canWriteStaffNotes:r2=false,onIntent:i2,className:a2,style:o2}=e2,s2=X(e2.subjectName),c2=Array.isArray(e2.types)?e2.types.filter(e3=>e3&&typeof e3.id=="string"):[],d2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},f2=u(),{run:p2,busy:g2,message:_2,available:v2}=ft(i2),[b2,x2]=h(c2.find(e3=>e3.id===d2.typeId)?.id??c2[0]?.id??""),[S2,C2]=h(Fa(d2.startsAt)),[w2,T2]=h(typeof d2.durationMin=="number"&&d2.durationMin>0?String(Math.round(d2.durationMin)):""),[E2,D2]=h(Array.isArray(d2.attendees)?d2.attendees.filter(e3=>typeof e3=="string").slice(0,Ma.attendees).map(e3=>Na(e3,Ma.attendee)).join(", "):""),[O2,k2]=h(Na(d2.outcome,Ma.line)),[A2,j2]=h(Na(d2.followUp,Ma.line)),[M2,N2]=h(Na(d2.note,Ma.note)),[P2,F2]=h(r2),[I2,L2]=h(null),R2=m(null);l(()=>{I2&&R2.current?.focus({preventScroll:true})},[I2]);let z2=I2??(e2.logged&&typeof e2.logged=="object"?e2.logged:null);if(z2){let e3=pt(z2.href);return n("div",{ref:R2,tabIndex:-1,role:"group","aria-labelledby":`${f2}-status`,className:y("core-intent-card","core-log-card",a2),style:o2,"data-state":"logged",children:[n("div",{className:"core-intent-card__head",children:[n("span",{id:`${f2}-status`,className:"core-intent-card__eyebrow",children:["Logged",s2?` · ${s2}`:""]}),t("p",{className:"core-intent-card__title",children:z2.name??"Logged"})]}),e3?t("a",{className:"core-log-card__go",href:e3,children:"Go to event"}):null]})}if(c2.length===0)return t("p",{className:y("core-intent-card","core-log-card","core-log-card__empty",a2),style:o2,children:"There’s nothing you can log here."});let B2=c2.find(e3=>e3.id===b2),ee2=v2&&g2===null,V2=v2&&!!s2&&!!B2&&!!S2,H2=v2?s2?"":"Choose who this is about before logging.":dt,U2=async e3=>{if(e3.preventDefault(),!V2||g2!==null||!B2)return;let t2={typeId:B2.id,startsAt:it(S2),tzid:rt()};w2&&(t2.durationMin=Number(w2)),Pa(E2).length&&(t2.attendees=Pa(E2)),O2.trim()&&(t2.outcome=O2.trim()),A2.trim()&&(t2.followUp=A2.trim()),M2.trim()&&(t2.note=M2.trim(),t2.staffOnly=r2&&P2);let{ok:n2,result:i3}=await p2("log_event",t2);n2&&L2({name:B2.name,href:i3&&typeof i3=="object"?i3.data?.href:void 0})},W2=!ee2;return n("form",{className:y("core-intent-card","core-log-card",a2),style:o2,"data-state":v2?"editing":"display",onSubmit:e3=>void U2(e3),"aria-busy":g2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{className:"core-intent-card__eyebrow",children:"Log"}),t("p",{className:"core-intent-card__title",children:s2??"Who is this about?"})]}),n("div",{className:"core-intent-card__row",children:[n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Type"}),t("select",{value:b2,disabled:W2,onChange:e3=>x2(e3.target.value),children:c2.map(e3=>t("option",{value:e3.id,children:e3.name},e3.id))})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"When"}),t("input",{type:"datetime-local",required:true,value:S2,readOnly:W2,onChange:e3=>C2(e3.target.value)})]})]}),n("div",{className:"core-intent-card__row",children:[n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"How long"}),n("select",{value:w2,disabled:W2,onChange:e3=>T2(e3.target.value),children:[t("option",{value:"",children:"—"}),[...new Set([...ja,...w2?[Number(w2)]:[]])].sort((e3,t2)=>e3-t2).map(e3=>t("option",{value:e3,children:`${e3} min`},e3))]})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Who attended"}),t("input",{value:E2,maxLength:Ma.attendees*(Ma.attendee+2),readOnly:W2,placeholder:"Names, separated by commas",onChange:e3=>D2(e3.target.value)})]})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Outcome"}),t("input",{value:O2,maxLength:Ma.line,readOnly:W2,onChange:e3=>k2(e3.target.value)})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Follow-up"}),t("input",{value:A2,maxLength:Ma.line,readOnly:W2,onChange:e3=>j2(e3.target.value)})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Note"}),t("textarea",{rows:Math.min(10,Math.max(2,M2.split("\n").length+Math.floor(M2.length/40))),maxLength:Ma.note,value:M2,readOnly:W2,onChange:e3=>N2(e3.target.value)})]}),r2&&M2.trim()?n("label",{className:"core-log-card__check",children:[t("input",{type:"checkbox",checked:P2,disabled:W2,onChange:e3=>F2(e3.target.checked)}),t("span",{children:"Staff only: the client won’t see this note"})]}):null,_2?t("p",{id:`${f2}-message`,className:"core-intent-card__message",role:"alert",children:_2}):null,t("p",{className:"core-intent-card__does",id:`${f2}-does`,children:V2?`Log saves this to ${s2}’s file.`:H2}),t("div",{className:"core-intent-card__actions",children:t("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!V2||g2!==null,"aria-describedby":`${f2}-does`,children:g2==="log_event"?"Logging…":"Log"})})]})}var La=250,Ra=500,za=(e2,t2)=>{let n2=t2.trim().toLowerCase();return n2===""||e2.label.toLowerCase().includes(n2)||!!e2.description?.toLowerCase().includes(n2)};function Ba({label:e2,options:t2,loadOptions:n2,value:r2,defaultValue:i2="",onValueChange:a2,onSelect:o2,orientation:c2="vertical",debounceMs:d2=150,minChars:p2=0,closeOnSelect:g2=true,fillOnSelect:_2=false,openOnFocus:v2=false,defaultOpen:y2=false,emptyText:b2="No results",errorText:x2="Could not load results"}){let S2=u(),C2=`${S2}-list`,[w2,T2]=h(i2),E2=r2??w2,[D2,O2]=h(y2),[k2,A2]=h(y2),[j2,M2]=h([]),[N2,P2]=h("idle"),[F2,I2]=h(null),[L2,R2]=h(""),z2=m(0),B2=m({onValueChange:a2,onSelect:o2,loadOptions:n2});B2.current={onValueChange:a2,onSelect:o2,loadOptions:n2};let ee2=f(()=>n2?j2:(t2??[]).filter(e3=>za(e3,E2)),[n2,j2,t2,E2]),V2=!!n2,H2=E2.trim().length>=p2,U2=H2?ee2:[];l(()=>{if(!V2||!D2)return;if(!H2){z2.current+=1,M2([]),P2("idle");return}let e3=++z2.current,t3=new AbortController;P2("loading");let n3=setTimeout(()=>{B2.current.loadOptions?.(E2,t3.signal).then(t4=>{e3===z2.current&&(M2(t4),P2(t4.length?"ready":"empty"))},t4=>{e3===z2.current&&t4?.name!=="AbortError"&&(M2([]),P2("error"))})},d2);return()=>{clearTimeout(n3),t3.abort()}},[E2,D2,H2,V2,d2]);let W2=V2?N2:!D2||!H2?"idle":U2.length?"ready":"empty";l(()=>{F2!==null&&!U2.some(e3=>e3.id===F2)&&I2(null)},[U2,F2]),l(()=>{if(!k2||W2==="idle"){R2("");return}let e3=E2.trim().slice(0,60),t3=W2==="loading"?"Loading results":W2==="error"?x2.split("{query}").join(e3):W2==="empty"?b2.split("{query}").join(e3):`${U2.length} ${U2.length===1?"result":"results"}`,n3=setTimeout(()=>R2(t3),W2==="loading"?Ra:La);return()=>clearTimeout(n3)},[W2,U2.length,k2,E2,b2,x2]);let G2=s(e3=>{r2===void 0&&T2(e3),B2.current.onValueChange?.(e3)},[r2]),te2=s(()=>{A2(false),I2(null)},[]),ne2=s(e3=>{e3.disabled||(_2&&G2(e3.label),B2.current.onSelect?.(e3),g2&&te2())},[_2,G2,g2,te2]),re2=e3=>`${S2}-opt-${e3.id}`,ie2=k2&&U2.length>0,K2=ie2?U2.find(e3=>e3.id===F2):void 0,ae2=e3=>{if(U2.length===0)return;let t3=U2.filter(e4=>!e4.disabled);if(t3.length===0)return;let n3=t3.findIndex(e4=>e4.id===F2),r3=n3<0?e3===1?0:t3.length-1:(n3+e3+t3.length)%t3.length;I2(t3[r3].id)};return{options:U2,status:W2,statusText:L2,open:ie2,activeId:F2,close:te2,inputProps:{role:"combobox","aria-label":e2,"aria-expanded":ie2,"aria-controls":C2,"aria-autocomplete":"list","aria-activedescendant":K2?re2(K2):void 0,autoComplete:"off",value:E2,onChange:e3=>{O2(true),A2(true),I2(null),G2(e3.target.value)},onKeyDown:e3=>{if(e3.nativeEvent.isComposing||e3.altKey||e3.ctrlKey||e3.metaKey)return;let t3=c2==="horizontal"?"ArrowRight":"ArrowDown",n3=c2==="horizontal"?"ArrowLeft":"ArrowUp";e3.key==="ArrowDown"||e3.key==="ArrowUp"?(e3.preventDefault(),O2(true),k2?ae2(e3.key==="ArrowDown"?1:-1):A2(true)):(e3.key===t3||e3.key===n3)&&ie2&&K2?(e3.preventDefault(),ae2(e3.key===t3?1:-1)):e3.key==="Enter"&&K2?(e3.preventDefault(),ne2(K2)):e3.key==="Escape"&&k2?(e3.preventDefault(),e3.stopPropagation(),te2()):e3.key==="Tab"&&te2()},onFocus:()=>{v2&&(O2(true),A2(true))},onBlur:()=>te2()},listboxProps:{id:C2,role:"listbox","aria-label":e2,"aria-orientation":c2},statusProps:{role:"status","aria-live":"polite","aria-atomic":true},getOptionProps:e3=>({id:re2(e3),role:"option","aria-selected":e3.id===K2?.id,"aria-disabled":e3.disabled||void 0,"data-active":e3.id===K2?.id?"":void 0,onPointerDown:e4=>e4.preventDefault(),onClick:()=>ne2(e3)}),query:E2}}function Va({text:r2,match:i2}){let a2=i2?r2.toLowerCase().indexOf(i2.trim().toLowerCase()):-1;if(a2<0||!i2.trim())return t(e,{children:r2});let o2=a2+i2.trim().length;return n(e,{children:[r2.slice(0,a2),t("mark",{className:"core-combobox__match",children:r2.slice(a2,o2)}),r2.slice(o2)]})}function Ha({placeholder:r2,emptyText:i2="No results",errorText:a2="Could not load results",renderOption:o2,className:s2,style:c2,...d2}){let f2=Ba({...d2,emptyText:i2,errorText:a2}),p2=f2.query.trim().slice(0,60),h2=m(null),g2=d2.orientation==="horizontal",_2=u(),v2=[];for(let e2 of f2.options){let t2=g2?void 0:e2.group,n2=v2[v2.length-1];n2&&n2.group===t2?n2.options.push(e2):v2.push({group:t2,options:[e2]})}l(()=>{f2.activeId!==null&&h2.current?.querySelector("[data-active]")?.scrollIntoView({block:"nearest",inline:"nearest"})},[f2.activeId]);let b2=f2.status==="empty"?i2.split("{query}").join(p2):f2.status==="error"?a2.split("{query}").join(p2):f2.status==="loading"?"Loading…":null;return n("div",{className:y("core-combobox",s2),style:c2,"data-orientation":d2.orientation??"vertical","data-status":f2.status,children:[t("input",{...f2.inputProps,type:"text",className:"core-combobox__input",placeholder:r2}),t("ul",{ref:h2,...f2.listboxProps,className:"core-combobox__list",hidden:!f2.open,children:v2.map((r3,i3)=>{let a3=r3.options.map(r4=>t("li",{...f2.getOptionProps(r4),className:"core-combobox__option",children:o2?o2(r4,f2.query):n(e,{children:[t("span",{className:"core-combobox__label",children:t(Va,{text:r4.label,match:r4.highlight??f2.query})}),r4.description?t("span",{className:"core-combobox__description",children:r4.description}):null]})},r4.id));return r3.group?n("li",{role:"presentation",className:"core-combobox__section",children:[t("span",{id:`${_2}-${i3}`,className:"core-combobox__heading",children:r3.group}),t("ul",{role:"group","aria-labelledby":`${_2}-${i3}`,className:"core-combobox__group",children:a3})]},`g${i3}`):a3})}),b2&&!f2.open?t("p",{className:"core-combobox__note","data-status":f2.status,"aria-hidden":"true",children:b2}):null,t("span",{...f2.statusProps,className:"core-combobox__status",children:f2.statusText})]})}var Ua=["saved","assigned","event","archived","discarded","unavailable"],Wa=6e3;function Ga(r2){let{locale:i2,timeZone:a2,searchTargets:o2,onIntent:s2,className:c2,style:d2}=r2,f2=r2.note&&typeof r2.note=="object"&&(r2.note.state==="unavailable"||typeof r2.note.body=="string")?r2.note:null,p2=u(),{run:g2,busy:_2,message:v2,available:b2}=ft(s2),[x2,S2]=h(null),C2=f2?.state&&Ua.includes(f2.state)?f2.state:"saved",w2=x2&&C2==="saved"?x2:C2,[T2,E2]=h(false),D2=m(null),O2=m(null),k2=m(null);l(()=>()=>{D2.current&&clearTimeout(D2.current),O2.current?.()},[]),l(()=>{T2&&k2.current?.focus({preventScroll:true})},[T2]);let[A2,j2]=h(false),[M2,N2]=h(false),P2=m(null);l(()=>{M2&&P2.current?.focus({preventScroll:true})},[M2]);let[F2,I2]=h(void 0),[L2,R2]=h(false),z2=m(null);if(l(()=>{x2&&z2.current?.focus({preventScroll:true})},[x2]),!f2)return null;if(C2==="unavailable")return t("div",{role:"group","aria-label":"Note",className:y("core-intent-card","core-quick-note-card","core-note-card",c2),style:d2,"data-state":"unavailable",children:t("p",{className:"core-note-card__unavailable",children:"This note is no longer available"})});let B2=w2==="saved"&&!T2,ee2=f2.createdAt&&!Number.isNaN(new Date(f2.createdAt).getTime())?new Intl.DateTimeFormat(i2,{weekday:"short",hour:"numeric",minute:"2-digit",timeZone:a2}).format(new Date(f2.createdAt)):"",V2=pt(f2.eventHref),H2=_2===null,U2=async e2=>{let{ok:t2}=await g2("assign",{targetId:e2.id,...A2?{keepPrivate:true}:{},...e2.data&&typeof e2.data=="object"&&"kind"in e2.data?{targetKind:e2.data.kind}:{}});t2&&(I2(e2.label),S2("assigned"),R2(false))},W2=async()=>{let{ok:e2}=await g2("make_event");e2&&S2("started")},G2=()=>{let e2=async()=>{O2.current=null,D2.current=null;let{ok:e3}=await g2("archive");E2(false),e3&&S2("archived")};O2.current=()=>void e2(),D2.current=setTimeout(()=>void e2(),Wa),E2(true)},te2=()=>{D2.current&&clearTimeout(D2.current),D2.current=null,O2.current=null,E2(false)},ne2=async()=>{let{ok:e2}=await g2("discard");N2(false),e2&&S2("discarded")},re2=async()=>{let{ok:e2}=await g2("ask_instead");e2&&S2("asked")},ie2=T2?"Archived":B2?"Saved as note":w2==="asked"?"Sent to the assistant instead":w2==="assigned"?`Assigned${F2??f2.assignedToName?` to ${F2??f2.assignedToName}`:""}`:w2==="event"?"Made into an event":w2==="started"?"Event started below":w2==="discarded"?"Discarded":"Archived";return n("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-quick-note-card","core-note-card",c2),style:d2,"data-state":T2?"archived":w2,"aria-busy":_2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:ie2}),t("p",{className:"core-note-card__body",children:f2.body}),n("span",{className:"core-note-card__private",children:["Private",ee2?` · saved ${ee2}`:""]})]}),w2==="event"&&V2?t("a",{className:"core-note-card__go",href:V2,children:"Go to event"}):null,v2?t("p",{className:"core-intent-card__message",role:"alert",children:v2}):null,T2?t("div",{className:"core-intent-card__actions",children:t("button",{ref:k2,type:"button",className:"core-intent-card__button",onClick:te2,children:"Undo"})}):null,B2?n(e,{children:[L2&&o2?n("div",{className:"core-note-card__picker",children:[t(Ha,{label:"Assign to a client or project",placeholder:"Search clients and projects",loadOptions:o2,onSelect:e2=>void U2(e2),defaultOpen:false}),n("label",{className:"core-note-card__private-check",children:[t("input",{type:"checkbox",checked:A2,disabled:!H2,onChange:e2=>j2(e2.target.checked)}),t("span",{children:"Keep this note private"})]})]}):null,t("p",{className:"core-intent-card__does",id:`${p2}-does`,children:(e2=>b2?e2:dt)("Assign moves this note to the client or project you choose. Make event turns it into an event. Archive takes it out of Needs me, and you can undo it for a few seconds. Discard deletes it for good.")}),n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!b2||!o2||!H2,"aria-expanded":L2,"aria-describedby":`${p2}-does`,onClick:()=>R2(e2=>!e2),children:"Assign"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!H2,"aria-describedby":`${p2}-does`,onClick:()=>void W2(),children:"Make event"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!H2,"aria-describedby":`${p2}-does`,onClick:G2,children:"Archive"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!H2,"aria-describedby":`${p2}-does`,onClick:()=>N2(true),children:"Discard"})]}),M2?n("div",{className:"core-note-card__confirm",role:"group","aria-label":"Discard this note",children:[t("p",{className:"core-intent-card__does",children:"Discard this note? It can’t be brought back from here."}),n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!H2,onClick:()=>void ne2(),children:_2==="discard"?"Discarding…":"Yes, discard"}),t("button",{ref:P2,type:"button",className:"core-intent-card__button",disabled:!H2,onClick:()=>N2(false),children:"Cancel"})]})]}):null,t("button",{type:"button",className:"core-note-card__instead",disabled:!b2||!H2,onClick:()=>void re2(),children:"Ask the assistant instead"})]}):null]})}var Ka=[15,30,45,60,90],qa=30,Ja=200,Ya=50,Xa=3,Za=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`;function Qa(r2){let{locale:i2,timeZone:a2,onIntent:o2,className:s2,style:c2}=r2,d2=X(r2.subjectName),f2=(Array.isArray(r2.types)?r2.types:[]).filter(e2=>!!e2&&typeof e2=="object"&&typeof e2.id=="string"&&typeof e2.name=="string"&&e2.name.trim()!==""&&e2.kind!=="record"),p2=(Array.isArray(r2.people)?r2.people:[]).filter(e2=>!!e2&&typeof e2=="object"&&typeof e2.id=="string"&&typeof e2.name=="string"&&e2.name.trim()!=="").slice(0,Ya),g2=(Array.isArray(r2.assignees)?r2.assignees:[]).filter(e2=>!!e2&&typeof e2=="object"&&typeof e2.id=="string"&&typeof e2.name=="string"&&e2.name.trim()!=="").slice(0,Ya),_2=r2.canShare===true,v2=r2.prefill&&typeof r2.prefill=="object"?r2.prefill:{},b2=u(),{run:x2,busy:S2,message:C2,available:w2}=ft(o2),T2=va(v2.startsAt,a2),[E2,D2]=h(f2.find(e2=>e2.id===v2.typeId)?.id??f2[0]?.id??""),[O2,k2]=h((typeof v2.title=="string"?v2.title:"").slice(0,Ja)),A2=a2??rt(),j2=!(typeof v2.startOn=="string"&&ma.test(v2.startOn))&&!T2,[M2,N2]=h(typeof v2.startOn=="string"&&ma.test(v2.startOn)?v2.startOn:T2?.date??ba(A2)),[P2,F2]=h(T2?.time??""),[I2,L2]=h(String(typeof v2.durationMin=="number"&&v2.durationMin>0?Math.round(v2.durationMin):qa)),[R2,z2]=h(new Set((Array.isArray(v2.attendeeIds)?v2.attendeeIds:[]).filter(e2=>typeof e2=="string"))),[B2,ee2]=h(false),[V2,H2]=h(""),[U2,W2]=h(false),[G2,te2]=h(null),ne2=m(null),re2=m(null),ie2=m(false);l(()=>{if(ie2.current)return;if(j2){N2(ba(A2));return}if(!v2.startsAt)return;let e2=va(v2.startsAt,a2);e2&&(N2(e2.date),F2(e2.time))},[v2.startsAt,a2,j2,A2]),l(()=>{U2&&re2.current?.focus({preventScroll:true})},[U2]),l(()=>{G2&&ne2.current?.focus({preventScroll:true})},[G2]);let K2=G2??(r2.booked&&typeof r2.booked=="object"?r2.booked:null);if(K2){let e2=pt(K2.href);return n("section",{ref:ne2,tabIndex:-1,"aria-labelledby":`${b2}-status`,className:y("core-intent-card","core-book-event-card",s2),style:c2,"data-state":"booked",children:[n("div",{className:"core-intent-card__head",children:[n("span",{id:`${b2}-status`,className:"core-intent-card__eyebrow",children:["Booked",d2?` · ${d2}`:""]}),t("p",{className:"core-intent-card__title",children:K2.name??"Booked"}),K2.when?t("span",{className:"core-book-event-card__when",children:K2.when}):null]}),e2?t("a",{className:"core-book-event-card__go",href:e2,children:"Go to event"}):null]})}if(f2.length===0)return t("p",{className:y("core-intent-card","core-book-event-card","core-book-event-card__empty",s2),style:c2,children:"There’s nothing you can book here."});let ae2=f2.find(e2=>e2.id===E2),q2=w2&&S2===null,oe2=w2&&!!d2&&!!ae2&&ma.test(M2),se2=w2?d2?M2?"":"Choose a day to book.":"Choose whose file this goes in first.":dt,ce2=ma.test(M2)&&/^\d{2}:\d{2}$/.test(P2),le2=ce2?ya(M2,P2):void 0,ue2=Number(I2),de2=le2?new Date(le2).getTime()<Date.now():ma.test(M2)?M2<new Intl.DateTimeFormat("en-CA").format(new Date):false,fe2=[...new Set([...Ka,...Number.isInteger(ue2)&&ue2>0?[ue2]:[]])].sort((e2,t2)=>e2-t2),pe2=p2.filter(e2=>R2.has(e2.id)),me2=`${ga(M2,i2)}${ce2?`, ${_a(P2,i2)}`:""}`,he2=ce2?` (${Za(ue2||qa)})`:" (all day)",ge2=pe2.length?` With ${pe2.slice(0,Xa).map(e2=>e2.name).join(", ")}${pe2.length>Xa?` and ${pe2.length-Xa} more`:""}.`:"",_e2=g2.find(e2=>e2.id===V2),ve2=`Book this? It goes on the schedule for ${me2}${he2}.${ge2}${_e2?` Assigned to ${_e2.name}.`:""}${_2&&B2?" The client can see it.":""}${r2.invitesSent===true&&pe2.length?" They are invited.":""}`,ye2=async()=>{if(!oe2||S2!==null||!ae2)return;let e2={typeId:ae2.id};O2.trim()&&(e2.title=O2.trim()),e2.tzid=rt(),le2?(e2.startsAt=le2,e2.durationMin=ue2>0?ue2:qa):e2.startOn=M2,pe2.length&&(e2.attendeeIds=pe2.map(e3=>e3.id)),_2&&B2&&(e2.shareWithClient=true),_e2&&(e2.assigneeId=_e2.id);let{ok:t2,result:n2}=await x2("book_event",e2);W2(false),t2&&te2({name:O2.trim()||ae2.name,when:me2,href:n2&&typeof n2=="object"?n2.data?.href:void 0})},be2=e2=>{e2.preventDefault(),oe2&&S2===null&&W2(true)},xe2=e2=>t2=>{ie2.current=true,e2(t2)};return n("form",{tabIndex:-1,ref:ne2,"aria-labelledby":`${b2}-status`,className:y("core-intent-card","core-book-event-card",s2),style:c2,"data-state":U2?"confirming":"proposed",onSubmit:be2,"aria-busy":S2!==null||void 0,children:[t("div",{className:"core-intent-card__head",children:n("span",{id:`${b2}-status`,className:"core-intent-card__eyebrow",children:["Book a meeting",d2?` · ${d2}`:""]})}),n("div",{className:"core-intent-card__row",children:[f2.length>1?n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Type"}),t("select",{value:E2,disabled:!q2||U2,onChange:e2=>D2(e2.target.value),children:f2.map(e2=>t("option",{value:e2.id,children:e2.name},e2.id))})]}):null,n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Title (optional)"}),t("input",{value:O2,maxLength:Ja,readOnly:!q2||U2,placeholder:ae2?.name,onChange:e2=>k2(e2.target.value)})]})]}),n("div",{className:"core-intent-card__row",children:[n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Day"}),t("input",{type:"date",value:M2,required:true,readOnly:!q2||U2,onChange:e2=>xe2(N2)(e2.target.value)})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Time (optional)"}),t("input",{type:"time",value:M2?P2:"",readOnly:!q2||U2,disabled:!M2,onChange:e2=>xe2(F2)(e2.target.value)})]})]}),t("div",{className:"core-intent-card__row",children:n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"How long"}),t("select",{value:I2,disabled:!q2||U2||!ce2,onChange:e2=>L2(e2.target.value),children:fe2.map(e2=>t("option",{value:e2,children:Za(e2)},e2))})]})}),p2.length>0?n("fieldset",{className:"core-book-event-card__guests",disabled:!q2||U2,children:[t("legend",{className:"core-intent-card__label",children:"Attendees (optional)"}),p2.map(e2=>n("label",{className:"core-book-event-card__guest",children:[t("input",{type:"checkbox",checked:R2.has(e2.id),onChange:t2=>z2(n2=>t2.target.checked?new Set([...n2,e2.id]):new Set([...n2].filter(t3=>t3!==e2.id)))}),t("span",{className:"core-book-event-card__guest-name",children:e2.name}),e2.role?t("span",{className:"core-book-event-card__guest-role",children:X(e2.role)}):null]},e2.id))]}):null,g2.length>0?t("div",{className:"core-intent-card__row",children:n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Assigned to (optional)"}),n("select",{value:V2,disabled:!q2||U2,onChange:e2=>H2(e2.target.value),children:[t("option",{value:"",children:"No one"}),g2.map(e2=>t("option",{value:e2.id,children:e2.name},e2.id))]})]})}):null,_2?n("label",{className:"core-book-event-card__guest core-book-event-card__share","data-disabled":!q2||U2?"":void 0,children:[t("input",{type:"checkbox",checked:B2,disabled:!q2||U2,onChange:e2=>ee2(e2.target.checked)}),t("span",{className:"core-book-event-card__guest-name",children:"Share with client"})]}):null,de2&&!U2?t("p",{className:"core-book-event-card__note",children:"That time has passed."}):null,C2?t("p",{className:"core-intent-card__message",role:"alert",children:C2}):null,U2?n(e,{children:[t("p",{className:"core-intent-card__does",id:`${b2}-does`,role:"group","aria-label":"Confirm booking",children:ve2}),n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:S2!==null,onClick:()=>void ye2(),children:S2==="book_event"?"Booking…":"Yes, book"}),t("button",{ref:re2,type:"button",className:"core-intent-card__button",disabled:S2!==null,onClick:()=>W2(false),children:"Cancel"})]})]}):n(e,{children:[se2?t("p",{className:"core-intent-card__does",id:`${b2}-does`,children:se2}):null,t("div",{className:"core-intent-card__actions",children:t("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!oe2||S2!==null,"aria-describedby":se2?`${b2}-does`:void 0,children:"Book"})})]})]})}var $a=["proposed","created","done"],eo=200;function to(r2){let{locale:i2,timeZone:a2,onIntent:o2,className:s2,style:c2}=r2,d2=(Array.isArray(r2.types)?r2.types:[]).filter(e2=>!!e2&&typeof e2=="object"&&typeof e2.id=="string"&&typeof e2.name=="string"&&e2.name.trim()!==""),f2=X(r2.subjectName),p2=r2.task&&typeof r2.task=="object"&&typeof r2.task.title=="string"?r2.task:null,g2=u(),{run:_2,busy:v2,message:b2,available:x2}=ft(o2),[S2,C2]=h((p2?.title??"").slice(0,eo)),w2=va(p2?.dueAt,a2),T2=a2??rt(),E2=!(p2?.dueOn&&ma.test(p2.dueOn))&&!w2,[D2,O2]=h(p2?.dueOn&&ma.test(p2.dueOn)?p2.dueOn:w2?.date??ba(T2)),[k2,A2]=h(w2?.time??""),j2=m(false);l(()=>{if(j2.current)return;if(E2){O2(ba(T2));return}if(!p2?.dueAt)return;let e2=va(p2.dueAt,a2);e2&&(p2.dueOn&&ma.test(p2.dueOn)||O2(e2.date),A2(e2.time))},[p2?.dueAt,p2?.dueOn,a2,E2,T2]);let[M2,N2]=h(d2.find(e2=>e2.id===p2?.typeId)?.id??d2[0]?.id??""),[P2,F2]=h(null),I2=p2?.state&&$a.includes(p2.state)?p2.state:"proposed",L2=P2&&$a.indexOf(P2)>$a.indexOf(I2)?P2:I2,R2=m(null),z2=m(null),[B2,ee2]=h(false);if(l(()=>{B2&&z2.current?.focus({preventScroll:true})},[B2]),l(()=>{P2&&R2.current?.focus({preventScroll:true})},[P2]),!p2)return null;let V2=L2==="proposed"&&x2&&v2===null,H2=x2&&!!f2&&S2.trim()!=="",U2=async e2=>{if(e2.preventDefault(),!H2||v2!==null)return;let t2=D2||ba(T2),n2=k2?ya(t2,k2):void 0,{ok:r3}=await _2("log_event",{title:S2.trim(),...d2.length>0&&M2?{typeId:M2}:{},dueOn:t2,...n2?{dueAt:n2}:{},tzid:rt()});r3&&F2("created")},W2=async()=>{let{ok:e2}=await _2("complete");ee2(false),e2&&F2("done")},G2=L2==="proposed"?{date:D2||ba(T2),time:k2}:{date:p2.dueOn&&ma.test(p2.dueOn)?p2.dueOn:va(p2.dueAt,a2)?.date??"",time:va(p2.dueAt,a2)?.time??""},te2=[G2.date===ba(T2)?"today":ga(G2.date,i2),G2.date&&G2.time?_a(G2.time,i2):""].filter(Boolean).join(", "),ne2=L2==="proposed"?"Task · suggested":L2==="done"?"Task · done":"Task",re2=L2==="proposed"?H2?`Create task adds this to ${f2}’s tasks.`:x2?f2?"":"Choose whose file this goes in first.":dt:L2==="created"?B2?"Mark this task done? It can’t be reopened from here.":"Mark done closes this task.":"";return n("form",{ref:R2,tabIndex:-1,"aria-labelledby":`${g2}-status`,className:y("core-intent-card","core-task-card",s2),style:c2,"data-state":L2,onSubmit:e2=>void U2(e2),"aria-busy":v2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[n("span",{id:`${g2}-status`,className:"core-intent-card__eyebrow",children:[ne2,f2?` · ${f2}`:""]}),L2==="proposed"&&d2.length>1?n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Type"}),t("select",{value:M2,disabled:!V2,onChange:e2=>N2(e2.target.value),children:d2.map(e2=>t("option",{value:e2.id,children:e2.name},e2.id))})]}):null,L2==="proposed"?n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"What needs doing"}),t("input",{value:S2,maxLength:eo,readOnly:!V2,onChange:e2=>C2(e2.target.value),required:true})]}):t("p",{className:"core-intent-card__title core-task-card__title","data-done":L2==="done"?"":void 0,children:p2.title})]}),L2==="proposed"?n("div",{className:"core-intent-card__row",children:[n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Due"}),t("input",{type:"date",value:D2,readOnly:!V2,onChange:e2=>(j2.current=true,O2(e2.target.value))})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Time (optional)"}),t("input",{type:"time",value:D2?k2:"",readOnly:!V2,disabled:!D2,onChange:e2=>(j2.current=true,A2(e2.target.value))})]})]}):null,t("p",{className:"core-task-card__meta",children:[te2?`Due ${te2}`:"",p2.assigneeName?`For ${p2.assigneeName}`:""].filter(Boolean).join(" · ")||(L2==="proposed"?"":"No due date")}),b2?t("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,re2?t("p",{className:"core-intent-card__does",id:`${g2}-does`,children:re2}):null,L2==="done"?null:t("div",{className:"core-intent-card__actions",children:L2==="proposed"?t("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!H2||v2!==null,"aria-describedby":`${g2}-does`,children:v2==="log_event"?"Creating…":"Create task"}):B2?n(e,{children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void W2(),children:v2==="complete"?"Saving…":"Yes, mark done"}),t("button",{ref:z2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>ee2(false),children:"Cancel"})]}):t("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,"aria-describedby":`${g2}-does`,onClick:()=>ee2(true),children:"Mark done"})})]})}function no(r2){let{locale:i2,timeZone:a2,onIntent:o2,className:s2,style:c2}=r2,d2=X(r2.scopeName),f2=u(),{run:p2,busy:g2,message:_2,available:v2}=ft(o2),[b2,x2]=h(null),S2=m(null);if(l(()=>{b2&&S2.current?.focus({preventScroll:true})},[b2]),!d2)return null;let C2=r2.pointer&&typeof r2.pointer=="object"?r2.pointer:void 0,w2="";if(C2?.kind==="conversation"){let e2=typeof C2.at=="string"?new Date(C2.at):null;w2=e2&&!Number.isNaN(e2.getTime())?`Conversation · ${new Intl.DateTimeFormat(i2,{month:"short",day:"numeric",timeZone:a2}).format(e2)}`:"Conversation"}else C2?.kind==="event"&&(w2=X(C2.name)??"Event");let T2=g2===null,E2=async e2=>{let{ok:t2}=await p2(e2);t2&&x2(e2==="dismiss"?"dismissed":"continued")},D2=b2==="continued"?"Picked up":b2==="dismissed"?"Dismissed":"Pick up where you left off";return n("div",{ref:S2,tabIndex:-1,role:"group","aria-labelledby":`${f2}-status`,className:y("core-intent-card","core-handover-card",s2),style:c2,"data-state":b2??(v2?"offered":"display"),"aria-busy":g2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${f2}-status`,className:"core-intent-card__eyebrow",children:D2}),t("p",{className:"core-intent-card__title",children:d2}),w2?t("span",{className:"core-handover-card__where",children:w2}):null]}),_2?t("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,b2?null:n(e,{children:[t("p",{className:"core-intent-card__does",id:`${f2}-does`,children:v2?`Continue opens your earlier conversation about ${d2}. Dismiss hides this.`:dt}),n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!v2||!T2,"aria-describedby":`${f2}-does`,onClick:()=>void E2("handover_continue"),children:g2==="handover_continue"?"Opening…":"Continue"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!v2||!T2,"aria-describedby":`${f2}-does`,onClick:()=>void E2("dismiss"),children:"Dismiss"})]})]})]})}var ro=12,io=(e2,t2=200)=>typeof e2=="string"?e2.replace(/\s+/g," ").trim().slice(0,t2):"";function ao(r2){let{typicalTime:i2,typicalCost:a2,costCap:o2,onIntent:s2,className:c2,style:d2}=r2,f2=X(r2.processName),p2=X(r2.subjectName),g2=u(),{run:_2,busy:v2,message:b2,available:x2}=ft(s2),[S2,C2]=h(false),w2=m(null);if(l(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]),!f2)return null;let T2=io(r2.description),E2=(Array.isArray(r2.needs)?r2.needs:[]).filter(e2=>e2&&typeof e2=="object"&&io(e2.label)).slice(0,ro),D2=[i2&&`Typical time: ${io(i2,60)}`,a2&&`Typical cost: ${io(a2,60)}`,o2&&`Cost cap: ${io(o2,60)}`].filter(Boolean).join(" · "),O2=r2.running&&typeof r2.running=="object"?r2.running:null,k2=pt(O2?.href),A2=x2&&!!p2,j2=x2?p2?"":"Choose who this is for before starting.":dt,M2=S2?"Started":O2?"Running":"Start a service",N2=async()=>{if(!A2||v2!==null)return;let{ok:e2}=await _2("start_process");e2&&C2(true)};return n("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${g2}-status`,className:y("core-intent-card","core-start-process-card",c2),style:d2,"data-state":S2?"started":O2?"running":x2?"offered":"display","aria-busy":v2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${g2}-status`,className:"core-intent-card__eyebrow",children:M2}),t("p",{className:"core-intent-card__title",children:f2}),p2?n("span",{className:"core-start-process-card__for",children:["For ",p2]}):null]}),T2?t("p",{className:"core-start-process-card__description",children:T2}):null,E2.length>0?n("div",{className:"core-start-process-card__needs",children:[t("span",{className:"core-start-process-card__label",children:"What it needs"}),t("ul",{children:E2.map((e2,r3)=>n("li",{"data-have":e2.have===true?"":void 0,children:[t("span",{className:"core-start-process-card__mark","aria-hidden":"true"}),t("span",{children:io(e2.label)}),t("span",{className:"core-start-process-card__have",children:e2.have===true?"Have":"Needed"})]},r3))})]}):null,D2?t("p",{className:"core-start-process-card__meta",children:D2}):null,b2?t("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,S2?t("p",{className:"core-intent-card__does",children:"Started. Progress will arrive in the conversation."}):O2?k2?t("a",{className:"core-start-process-card__go",href:k2,children:"Open"}):null:n(e,{children:[t("p",{className:"core-intent-card__does",id:`${g2}-does`,children:A2?`Start begins ${f2} for ${p2}. Nothing is shared with ${p2} until you choose to share it.`:j2}),t("div",{className:"core-intent-card__actions",children:t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!A2||v2!==null,"aria-describedby":`${g2}-does`,onClick:()=>void N2(),children:v2==="start_process"?"Starting…":"Start"})})]})]})}var oo=12,so=8,co=600;function lo(r2){let{onIntent:i2,className:a2,style:o2}=r2,s2=u(),{run:c2,busy:d2,message:f2,available:p2}=ft(i2),[g2,_2]=h({}),[v2,b2]=h({}),[x2,S2]=h(null),C2=m(null),w2=m(false);l(()=>{w2.current&&C2.current?.focus({preventScroll:true})},[g2]);let T2=new Set,E2=(Array.isArray(r2.parts)?r2.parts:[]).filter(e2=>!e2||typeof e2!="object"||typeof e2.id!="string"||typeof e2.text!="string"||!e2.text.trim()||T2.has(e2.id)?false:(T2.add(e2.id),true)).slice(0,oo);if(E2.length===0)return null;let D2=e2=>(Array.isArray(e2.matches)?e2.matches:[]).filter(e3=>e3&&typeof e3.id=="string"&&X(e3.name)&&(e3.kind==="client"||e3.kind==="project")).slice(0,so),O2=e2=>g2[e2.id]??(e2.state==="assigned"||e2.state==="dropped"?{state:e2.state,name:X(e2.assignedToName)}:null),k2=E2.filter(e2=>!O2(e2)),A2=k2.length===0,j2=async(e2,t2)=>{S2(e2.id);let{ok:n2}=await c2("confirm_part",{partId:e2.id,targetId:t2.id,targetKind:t2.kind});n2&&(w2.current=true,_2(n3=>({...n3,[e2.id]:{state:"assigned",name:X(t2.name)}})))},M2=async e2=>{S2(e2.id);let{ok:t2}=await c2("drop_part",{partId:e2.id});t2&&(w2.current=true,_2(t3=>({...t3,[e2.id]:{state:"dropped"}})))},N2=d2===null;return n("div",{ref:C2,tabIndex:-1,role:"group","aria-labelledby":`${s2}-status`,className:y("core-intent-card","core-note-split-card",a2),style:o2,"data-state":A2?"sorted":p2?"open":"display","aria-busy":d2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${s2}-status`,className:"core-intent-card__eyebrow",children:A2?"Note sorted":"Note to sort"}),t("p",{className:"core-intent-card__title",children:A2?"Every part is sorted":`${k2.length} of ${E2.length} ${E2.length===1?"part":"parts"} to sort`})]}),t("ol",{className:"core-note-split-card__parts",children:E2.map((r3,i3)=>{let a3=O2(r3),o3=D2(r3),c3=v2[r3.id]??(o3.length===1?o3[0].id:""),l2=o3.find(e2=>e2.id===c3),u2=r3.text.length>co?`${r3.text.slice(0,599)}…`:r3.text,m2=`Part ${i3+1}`;return n("li",{className:"core-note-split-card__part","data-state":a3?.state??"open",children:[t("span",{className:"core-note-split-card__label",children:m2}),t("p",{className:"core-note-split-card__text",children:u2}),a3?t("p",{className:"core-note-split-card__result",children:a3.state==="dropped"?"Dropped":`Assigned${a3.name?` to ${a3.name}`:""}`}):n(e,{children:[o3.length===0?t("p",{className:"core-note-split-card__hint",children:"No client or project matches. You can drop this part."}):o3.length===1?n("p",{className:"core-note-split-card__hint",children:["Looks like ",t("strong",{children:X(o3[0].name)}),o3[0].detail?` · ${X(o3[0].detail)}`:"",". Confirm it, or drop the part."]}):n("fieldset",{className:"core-note-split-card__choices",disabled:!p2||!N2,children:[n("legend",{className:"core-note-split-card__hint",children:[o3.length," match: choose who this is for."]}),o3.map(e2=>n("label",{className:"core-note-split-card__choice",children:[t("input",{type:"radio",name:`${s2}-${r3.id}`,value:e2.id,checked:c3===e2.id,onChange:()=>b2(t2=>({...t2,[r3.id]:e2.id}))}),n("span",{children:[t("span",{className:"core-note-split-card__name",children:X(e2.name)}),t("span",{className:"core-note-split-card__detail",children:[e2.kind==="project"?"Project":"Client",X(e2.detail)].filter(Boolean).join(" · ")})]})]},e2.id))]}),x2===r3.id&&f2?t("p",{className:"core-intent-card__message",role:"alert",children:f2}):null,n("div",{className:"core-intent-card__actions",children:[o3.length>0?t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!p2||!N2||!l2,"aria-label":`Confirm ${m2}${l2?` for ${X(l2.name)}`:""}`,onClick:()=>l2&&void j2(r3,l2),children:d2==="confirm_part"&&x2===r3.id?"Confirming…":"Confirm"}):null,t("button",{type:"button",className:"core-intent-card__button",disabled:!p2||!N2,"aria-label":`Drop ${m2}`,onClick:()=>void M2(r3),children:"Drop"})]})]})]},r3.id)})}),A2?null:t("p",{className:"core-intent-card__does",children:p2?"Confirm sends that part to the client or project you choose. Drop leaves it out. The original note stays as the record.":dt})]})}var uo=20;function fo(r2){let{onIntent:i2,onCancel:a2,className:o2,style:s2}=r2,c2=r2.mode==="withdraw"?"withdraw":"share",d2=X(r2.clientName),f2=u(),{run:p2,busy:g2,message:_2,available:v2}=ft(i2),[b2,x2]=h(false),[S2,C2]=h(false),w2=m(null);l(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=(Array.isArray(r2.items)?r2.items:[]).filter(e2=>e2&&typeof e2=="object"&&X(e2.name)).slice(0,uo);if(T2.length===0)return null;let E2=c2==="share",D2=v2&&!!d2&&(!E2||b2),O2=v2?d2?E2&&!b2?"Tick “I’ve reviewed this” to share.":"":"Choose who this is for before sending.":dt,k2=E2?"Share":"Stop sharing",A2=S2?E2?"Shared":"Sharing stopped":E2?"Share for approval":"Stop sharing",j2=async()=>{if(!D2||g2!==null)return;let{ok:e2}=await p2(E2?"share":"withdraw",E2?{reviewed:true}:void 0);e2&&C2(true)};return n("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${f2}-status`,className:y("core-intent-card","core-share-approval-card",o2),style:s2,"data-state":S2?"done":v2?"asking":"display","data-mode":c2,"aria-busy":g2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${f2}-status`,className:"core-intent-card__eyebrow",children:A2}),t("p",{className:"core-intent-card__title",children:d2?E2?`Share with ${d2}`:`Stop sharing with ${d2}`:E2?"Share with whom?":"Stop sharing with whom?"})]}),t("ul",{className:"core-share-approval-card__items",children:T2.map((e2,r3)=>n("li",{children:[t("span",{className:"core-share-approval-card__name",children:X(e2.name)}),X(e2.projectName)?t("span",{className:"core-share-approval-card__project",children:X(e2.projectName)}):null]},r3))}),_2?t("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,S2?t("p",{className:"core-intent-card__does",children:E2?`${T2.length===1?"This is":"These are"} now shared with ${d2}.`:`${T2.length===1?"This is":"These are"} no longer shared with ${d2}.`}):n(e,{children:[t("p",{className:"core-intent-card__does",id:`${f2}-does`,children:d2?E2?`Sharing makes ${T2.length===1?"this":"these"} visible to ${d2} in their portal. You can stop sharing later.`:`Stop sharing takes ${T2.length===1?"this":"these"} out of ${d2}’s portal.`:O2}),E2?n("label",{className:"core-share-approval-card__review",children:[t("input",{type:"checkbox",checked:b2,disabled:!v2||g2!==null,onChange:e2=>x2(e2.target.checked)}),t("span",{children:"I’ve reviewed this"})]}):null,O2&&d2?t("p",{className:"core-share-approval-card__reason",id:`${f2}-reason`,children:O2}):null,n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!D2||g2!==null,"aria-describedby":`${f2}-does`,onClick:()=>void j2(),children:g2===null?k2:"Saving…"}),typeof a2=="function"?t("button",{type:"button",className:"core-intent-card__button",disabled:g2!==null,onClick:a2,children:"Not now"}):null]})]})]})}var po={save_as_note:{label:"Save as note",busy:"Saving…",done:"Saved as note"},make_follow_up:{label:"Make follow-up",busy:"Making…",done:"Follow-up made"}},mo=["save_as_note","make_follow_up"];function ho(e2){let{onIntent:r2,className:i2,style:a2}=e2,o2=Array.isArray(e2.actions)?mo.filter(t2=>e2.actions.includes(t2)):mo,s2=u(),{run:c2,busy:l2,message:d2,available:f2}=ft(r2),[p2,m2]=h(new Set);if(o2.length===0)return null;let g2=async e3=>{let{ok:t2}=await c2(e3);t2&&m2(t3=>new Set(t3).add(e3))};return n("div",{role:"group","aria-label":"Suggested actions",className:y("core-suggested-actions",i2),style:a2,"aria-busy":l2!==null||void 0,children:[t("div",{className:"core-suggested-actions__row",children:o2.map(e3=>{let n2=p2.has(e3);return t("button",{type:"button",className:"core-suggested-actions__chip","data-done":n2||void 0,disabled:!f2||l2!==null||n2,"aria-describedby":f2?void 0:`${s2}-does`,onClick:()=>void g2(e3),children:n2?po[e3].done:l2===e3?po[e3].busy:po[e3].label},e3)})}),d2?t("p",{className:"core-intent-card__message",role:"alert",children:d2}):null,f2?null:t("p",{id:`${s2}-does`,className:"core-suggested-actions__does",children:dt})]})}var go=new Set(["http:","https:","mailto:","tel:"]);function _o(e2){let t2=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e2.replace(/[\u0000- ]/g,""));return t2?`${t2[1].toLowerCase()}:`:null}function vo(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=_o(e2.trim());return t2===null||go.has(t2)?e2.trim():(q(`unsafe-href:${t2}`,`Refused a link with the "${t2}" scheme; links are relative, http(s):, mailto: or tel:`),null)}function yo(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=e2.trim(),n2=_o(t2);return n2===null||n2==="https:"||n2==="data:"&&/^data:image\//i.test(t2.replace(/[\u0000- ]/g,""))?t2:(q(`unsafe-src:${n2}`,`Refused an image with the "${n2}" scheme; images are relative, https: or data:image/`),null)}var bo=e2=>!!e2&&typeof e2=="object"&&typeof e2.label=="string"&&vo(e2.href)!==null;function xo(e2){return(Array.isArray(e2)?e2:e2?[e2]:[]).filter(bo)}function So({action:e2,className:n2}){let r2=vo(e2.href);if(r2===null)return null;let i2=e2.variant==="secondary"?"secondary":"primary";return t("a",{className:y("core-public-action",n2),"data-variant":i2,href:r2,children:e2.label})}function Co({actions:e2,className:n2}){return e2.length?t("div",{className:y("core-public-actions",n2),children:e2.map((e3,n3)=>t(So,{action:e3},`${e3.href}-${n3}`))}):null}function wo(e2){if(!e2||typeof e2!="object")return null;let t2=e2,n2=yo(t2.src);return n2===null?null:{src:n2,alt:t2.decorative?"":typeof t2.alt=="string"?t2.alt:""}}function To({eyebrow:e2,title:r2,intro:i2,actions:a2,media:o2,align:s2,className:c2,style:l2}){let u2=wo(o2),d2=s2==="center";return n("section",{className:y("core-hero",c2),"data-align":d2?"center":"start","data-media":u2?"yes":"no",style:l2,children:[n("div",{className:"core-hero__text",children:[e2?t("p",{className:"core-hero__eyebrow",children:e2}):null,t("h1",{className:"core-hero__title",children:r2}),i2?t("p",{className:"core-hero__intro",children:i2}):null,t(Co,{actions:xo(a2).slice(0,2),className:"core-hero__actions"})]}),u2?t("div",{className:"core-hero__media",children:t("img",{src:u2.src,alt:u2.alt,loading:"eager",decoding:"async"})}):null]})}function Eo({text:e2,src:n2,href:r2,size:i2,className:a2,style:o2}){let s2=i2==="sm"||i2==="lg"?i2:"md",c2=yo(n2),l2=vo(r2),u2=c2?t("img",{className:"core-logo-mark__img",src:c2,alt:e2}):t("span",{className:"core-logo-mark__text",children:e2});return l2?t("a",{className:y("core-logo-mark",a2),"data-size":s2,href:l2,style:o2,children:u2}):t("span",{className:y("core-logo-mark",a2),"data-size":s2,style:o2,children:u2})}var Do=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.label=="string"&&vo(e3.href)!==null).map(e3=>({label:e3.label,href:vo(e3.href)}));function Oo({logo:e2,links:r2,signIn:i2,className:a2,style:o2}){let s2=Do(r2).slice(0,5),c2=i2===false?null:{label:"Sign in",href:"/auth/login",variant:"secondary",...i2??{}};return n("header",{className:y("core-public-header",a2),style:o2,children:[e2?t(Eo,{...e2}):t("span",{}),s2.length?n("nav",{className:"core-public-header__nav","aria-label":"Main",children:[t("ul",{className:"core-public-header__links",children:s2.map(e3=>t("li",{children:t("a",{href:e3.href,children:e3.label})},e3.href))}),n("details",{className:"core-public-header__menu",children:[t("summary",{children:"Menu"}),t("ul",{children:s2.map(e3=>t("li",{children:t("a",{href:e3.href,children:e3.label})},e3.href))})]})]}):null,c2?t(So,{action:c2,className:"core-public-header__sign-in"}):null]})}var ko=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string"&&Array.isArray(e3.links)).map(e3=>({title:e3.title,links:Do(e3.links)}));function Ao({logo:e2,groups:r2,legal:i2,className:a2,style:o2}){let s2=ko(r2).slice(0,4);return n("footer",{className:y("core-public-footer",a2),style:o2,children:[n("div",{className:"core-public-footer__top",children:[e2?t(Eo,{size:"sm",...e2}):null,s2.length?t("div",{className:"core-public-footer__groups",children:s2.map(e3=>n("nav",{"aria-label":e3.title,className:"core-public-footer__group",children:[t("p",{className:"core-public-footer__title",children:e3.title}),t("ul",{children:e3.links.map(e4=>t("li",{children:t("a",{href:e4.href,children:e4.label})},e4.href))})]},e3.title))}):null]}),i2?t("p",{className:"core-public-footer__legal",children:i2}):null]})}var jo=/^\d+(\.\d+)?\s*\/\s*\d+(\.\d+)?$/;function Mo({src:e2,alt:r2,decorative:i2,ratio:a2,caption:o2,priority:s2,className:c2,style:l2}){let u2=yo(e2);if(u2===null)return null;!i2&&!r2&&q(`image-alt:${e2}`,`Image: "${e2}" has no alt text; give alt or set decorative`);let d2=a2&&jo.test(a2)?{aspectRatio:a2.replace(/\s/g,"")}:void 0;return n("figure",{className:y("core-image",c2),style:l2,children:[t("div",{className:"core-image__frame","data-ratio":d2?"set":"auto",style:d2,children:t("img",{src:u2,alt:i2?"":r2??"",loading:s2?"eager":"lazy",decoding:"async"})}),o2?t("figcaption",{className:"core-image__caption",children:o2}):null]})}var No=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string");function Po({title:e2,intro:r2,items:i2,columns:a2,className:o2,style:s2}){let c2=No(i2);if(!c2.length)return null;let l2=a2===2||a2===4?a2:3;return n("section",{className:y("core-feature-grid",o2),"data-columns":l2,style:s2,children:[e2||r2?n("div",{className:"core-feature-grid__head",children:[e2?t("h2",{className:"core-feature-grid__title",children:e2}):null,r2?t("p",{className:"core-feature-grid__intro",children:r2}):null]}):null,t("ul",{className:"core-feature-grid__items",children:c2.map((e3,r3)=>n("li",{className:"core-feature-grid__item",children:[e3.icon?t("span",{className:"core-feature-grid__icon","aria-hidden":"true",children:e3.icon}):null,t("h3",{className:"core-feature-grid__item-title",children:e3.title}),e3.text?t("p",{className:"core-feature-grid__text",children:e3.text}):null]},`${e3.title}-${r3}`))})]})}var Fo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.name=="string"),Io=e2=>e2.split(/\s+/).filter(Boolean).slice(0,2).map(e3=>e3[0].toUpperCase()).join("");function Lo({title:e2,intro:r2,members:i2,className:a2,style:o2}){let s2=Fo(i2);return s2.length?n("section",{className:y("core-team-grid",a2),style:o2,children:[e2||r2?n("div",{className:"core-team-grid__head",children:[e2?t("h2",{className:"core-team-grid__title",children:e2}):null,r2?t("p",{className:"core-team-grid__intro",children:r2}):null]}):null,t("ul",{className:"core-team-grid__members",children:s2.map((e3,r3)=>{let i3=wo(e3.photo);return n("li",{className:"core-team-grid__member",children:[t("div",{className:"core-team-grid__photo",children:i3?t("img",{src:i3.src,alt:i3.alt||e3.name,loading:"lazy",decoding:"async"}):t("span",{"aria-hidden":"true",children:Io(e3.name)})}),t("p",{className:"core-team-grid__name",children:e3.name}),e3.role?t("p",{className:"core-team-grid__role",children:e3.role}):null,e3.bio?t("p",{className:"core-team-grid__bio",children:e3.bio}):null]},`${e3.name}-${r3}`)})})]}):null}function Ro({quote:e2,name:r2,role:i2,photo:a2,className:o2,style:s2}){if(typeof e2!="string"||!e2)return null;let c2=wo(a2);return n("figure",{className:y("core-testimonial",o2),style:s2,children:[t("blockquote",{className:"core-testimonial__quote",children:t("p",{children:e2})}),n("figcaption",{className:"core-testimonial__by",children:[c2?t("img",{className:"core-testimonial__photo",src:c2.src,alt:c2.alt||r2,loading:"lazy",decoding:"async"}):null,n("span",{children:[t("span",{className:"core-testimonial__name",children:r2}),i2?t("span",{className:"core-testimonial__role",children:i2}):null]})]})]})}function zo({title:e2,text:r2,actions:i2,tone:a2,className:o2,style:s2}){let c2=a2==="strong"||a2==="neutral"?a2:"accent";return n("section",{className:y("core-cta-band",o2),"data-tone":c2,style:s2,children:[n("div",{className:"core-cta-band__text",children:[t("h2",{className:"core-cta-band__title",children:e2}),r2?t("p",{className:"core-cta-band__body",children:r2}):null]}),t(Co,{actions:xo(i2).slice(0,2)})]})}function Bo({title:e2,intro:r2,askPhone:i2,consent:a2,submitLabel:o2,thanks:s2,actions:c2,className:l2,style:d2}){let f2=u(),[p2,m2]=h({name:"",email:"",phone:"",message:"",consent:false,website:""}),[g2,_2]=h(false),[v2,b2]=h(false),[x2,S2]=h(""),C2=c2?.submitRequest,w2=e3=>t2=>m2(n2=>({...n2,[e3]:t2.target.type==="checkbox"?!!t2.target.checked:t2.target.value}));return v2?t("section",{className:y("core-contact-form",l2),style:d2,children:t("p",{className:"core-contact-form__thanks",role:"status",children:s2||"Thanks. We'll be in touch within one business day."})}):n("section",{className:y("core-contact-form",l2),style:d2,children:[e2?t("h2",{className:"core-contact-form__title",children:e2}):null,r2?t("p",{className:"core-contact-form__intro",children:r2}):null,n("form",{className:"core-contact-form__form",onSubmit:async e3=>{if(e3.preventDefault(),C2&&!g2){if(!p2.consent){S2("Please tick the box to agree to be contacted.");return}_2(true),S2("");try{let e4=await C2({name:p2.name.trim(),email:p2.email.trim(),...i2&&p2.phone.trim()?{phone:p2.phone.trim()}:{},...p2.message.trim()?{message:p2.message.trim()}:{},consent:p2.consent,website:p2.website});e4.success?b2(true):S2(ot(e4))}catch{S2("Something went wrong. Try again.")}finally{_2(false)}}},children:[n("div",{className:"core-contact-form__row",children:[n("label",{className:"core-contact-form__field",children:[t("span",{children:"Name"}),t("input",{name:"name",autoComplete:"name",required:true,value:p2.name,onChange:w2("name")})]}),n("label",{className:"core-contact-form__field",children:[t("span",{children:"Email"}),t("input",{name:"email",type:"email",autoComplete:"email",required:true,value:p2.email,onChange:w2("email")})]})]}),i2?n("label",{className:"core-contact-form__field",children:[t("span",{children:"Phone (optional)"}),t("input",{name:"phone",type:"tel",autoComplete:"tel",value:p2.phone,onChange:w2("phone")})]}):null,n("label",{className:"core-contact-form__field",children:[t("span",{children:"Message (optional)"}),t("textarea",{name:"message",rows:4,value:p2.message,onChange:w2("message")})]}),n("div",{className:"core-contact-form__trap","aria-hidden":"true",children:[t("label",{htmlFor:`${f2}-website`,children:"Website"}),t("input",{id:`${f2}-website`,name:"website",tabIndex:-1,autoComplete:"off",value:p2.website,onChange:w2("website")})]}),n("label",{className:"core-contact-form__check",children:[t("input",{type:"checkbox",name:"consent",checked:p2.consent,onChange:w2("consent")}),t("span",{children:a2||"I agree to be contacted about my request."})]}),x2?t("p",{className:"core-contact-form__error",role:"alert",children:x2}):null,C2?null:t("p",{className:"core-contact-form__error",children:"This form isn't connected yet."}),t("div",{className:"core-contact-form__actions",children:t("button",{type:"submit",className:"core-contact-form__submit",disabled:g2||!C2,children:g2?"Sending…":o2||"Send"})})]})]})}function Vo({length:e2=6,label:r2,value:i2,onChange:a2,onComplete:o2,error:s2,disabled:c2,autoFocus:l2,name:d2="code",className:f2,style:p2}){let m2=u(),g2=Number.isInteger(e2)&&e2>0&&e2<=12?e2:6,[_2,v2]=h(""),b2=(i2??_2).replace(/\D/g,"").slice(0,g2),x2=e3=>{let t2=e3.target.value.replace(/\D/g,"").slice(0,g2);i2===void 0&&v2(t2),a2?.(t2),t2.length===g2&&b2.length!==g2&&o2?.(t2)};return n("div",{className:y("core-code-field",f2),style:{...p2,"--core-code-field-n":g2},children:[t("label",{className:"core-code-field__label",htmlFor:m2,children:r2||"Code"}),n("div",{className:"core-code-field__boxes","data-error":s2?"yes":"no",children:[t("input",{id:m2,className:"core-code-field__input",name:d2,value:b2,onChange:x2,inputMode:"numeric",autoComplete:"one-time-code",pattern:`\\d{${g2}}`,maxLength:g2,disabled:c2,autoFocus:l2,"aria-invalid":s2?true:void 0,"aria-describedby":s2?`${m2}-error`:void 0}),t("div",{className:"core-code-field__cells","aria-hidden":"true",children:Array.from({length:g2},(e3,n2)=>t("span",{className:"core-code-field__cell","data-filled":n2<b2.length?"yes":"no","data-caret":n2===Math.min(b2.length,g2-1)?"yes":"no",children:b2[n2]??""},n2))})]}),s2?t("p",{id:`${m2}-error`,className:"core-code-field__error",role:"alert",children:s2}):null]})}export{Cr as ANSWER_COLUMN_PX,tn as Accordion,So as ActionLink,Co as ActionRow,wr as AnswerRows,Hn as Aside,bt as Avatar,Mn as BLOCK_KINDS,Qr as BLOCK_SCHEMAS,Ht as Badge,Qa as BookEventCard,S as Box,Xt as Button,Ca as CalendarFilters,Aa as CalendarView,nn as Card,C as Center,kt as Checkbox,At as CheckboxGroup,Zt as Chip,xt as Code,Vo as CodeField,an as Columns,Ha as Combobox,Er as ComparisonBars,Bo as ContactForm,w as Container,Gr as Contents,zo as CtaBand,Ji as DAY_MINUTES,pr as DEFAULT_DISPLAY_LOCALE,xn as DEFAULT_PROFILE_ID,Ue as DEFAULT_VIEWER,Li as DataTable,jt as DateRange,Gn as Definition,Te as Dialog,ui as DisclaimerBlock,sn as Disclosure,T as Divider,Yr as DocumentBlocks,ar as DocumentLabel,Zr as DocumentSection,Ur as DocumentShell,fr as DocumentTable,Ut as EmptyState,Ri as EventCard,Vi as EventDetail,Ui as EventLogForm,Bi as EventRespond,Gi as EventSchedule,qi as EventTimeline,qr as ExecutionBlock,Re as Eyebrow,Po as FeatureGrid,rr as Figure,Nt as FileField,nr as Footnote,Et as FormField,cn as Grid,no as HandoverCard,Ct as Heading,To as Hero,E as Hide,li as HighlightBox,Va as Highlighted,fa as HourGrid,Qt as IconButton,Mo as Image,D as Inline,wi as KpiCardGrid,$t as Link,je as ListRow,Ia as LogCard,Eo as LogoMark,Rr as Masthead,Zn as Math,K as Menu,Br as MetaRail,Ea as MiniMonth,dt as NOT_AVAILABLE,kr as NextSteps,lo as NoteSplitCard,jr as Notes,Gt as Notice,vi as OptionCard,Sa as OverlapNotice,un as PAGINATOR_BINDINGS,ir as PageBreak,Me as PageFrame,ze as PageHead,gt as PageStaffTools,ee as Popover,yi as ProfileCard,Kt as Progress,Un as Prose,Ao as PublicFooter,Oo as PublicHeader,Ga as QuickNoteCard,Wn as Quote,Pt as RadioGroup,M as Rail,dr as Reference,ln as Repeat,Sr as RowList,_t as RuleSection,Hr as RunningFooter,ra as SERIES_SHAPES,Lt as SearchField,ci as SectionHeader,en as SegmentedControl,Rt as Select,sa as SeriesGlyph,fo as ShareApprovalCard,G as Sheet,N as Show,qt as Skeleton,Nr as SkippedSection,zt as Slider,Ee as Spacer,Jt as Spinner,on as Split,De as Stack,ao as StartProcessCard,ii as Stat,ai as StatGroup,fi as StatStrip,ho as SuggestedActions,Bt as Switch,Ne as TONES,Fr as TalkItThrough,to as TaskCard,Lo as TeamGrid,Ro as Testimonial,Tt as Text,Vt as TextArea,It as TextField,Se as Toast,we as ToastRegion,Yt as Tooltip,vt as UnderlinedAction,qe as ViewerProvider,Ir as WRITE_HEIGHT_PX,Ar as WRITE_LINE_HEIGHT_PX,Oa as WeekStrip,Lr as WriteInField,xo as actionsOf,y as cx,he as dismissToast,gr as displayLocale,bn as documentProfiles,nt as eventWhen,Mt as fileSize,br as formatValue,Xe as hasRole,ut as hrefFrom,wo as imageOf,yt as initialsOf,Ie as inkToneOf,Zi as isBusyOnly,Ye as isStaff,$i as layoutDay,b as length,ya as localWithOffset,We as normalizeViewer,na as overlapDays,jn as profileCss,_n as profileIds,kn as profileTokens,gn as registerProfile,$ as renderFormatted,vn as resolveProfile,yn as resolvedProfiles,pt as sameOriginPath,oa as seriesNumber,aa as seriesShape,Ft as toNumber,me as toast,J as toneOf,Ze as typeCard,Ba as useCombobox,ft as useIntent,xe as useToast,Je as useViewer,x as vars,ea as visibleRange,Xi as wallOf,ta as weekDates};
3
+ }`;function Bn(e2,t2){return e2.map(e3=>zn(e3.id===t2?`:root,
4
+ [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,Rn(e3))).join("\n\n")}var Vn=["prose","clause","definitions","table","notice","figure","execution"],Hn=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,Un="[a-z0-9][a-z0-9_-]*",Wn=RegExp(`^(?:(${Un}):)?(${Un}(?:\\.${Un})*)(?:#(${Un}))?$`);RegExp(`^${Un}$`);function Gn(e2,t2){let n2=e2.trim(),r2=Wn.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function Kn(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function qn(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(Hn.source,"g"))){let i2=Gn(r2[1],r2[2]);i2&&(r2.index>n2&&t2.push({kind:"text",text:e2.slice(n2,r2.index)}),t2.push({kind:"ref",...i2}),n2=r2.index+r2[0].length)}return n2<e2.length&&t2.push({kind:"text",text:e2.slice(n2)}),t2}function Jn(e2){return e2.includes("{{ref:")}var Q=e2=>e2?{"data-profile":e2}:{},Yn=e2=>e2?.fills===false?{"data-fills":"none"}:{},Xn={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function Zn({children:e2,tone:t2="note",title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Aside"),c2=s2?.fills===false;return g("aside",{role:"note",className:y("core-aside",a2),"data-tone":t2,...Q(i2?.id??r2),...Yn(s2),style:o2,children:[c2?null:h("span",{className:"core-aside__icon","aria-hidden":true,children:Xn[t2]}),g("div",{className:"core-aside__body",children:[n2&&h("div",{className:"core-aside__title",children:n2}),h("div",{className:"core-aside__text",children:e2})]})]})}function Qn({children:e2,profileId:t2,profile:n2,full:r2=false,className:i2,style:a2}){return n2||Z(t2,"Prose"),h("div",{className:y("core-prose",i2),"data-full":r2?"":void 0,...Q(n2?.id??t2),style:a2,children:e2})}function $n({children:e2,citation:t2,className:n2,style:r2}){return g("figure",{className:y("core-quote",n2),style:r2,children:[h("blockquote",{className:"core-quote__body",children:e2}),t2&&g("figcaption",{className:"core-quote__citation",children:["— ",t2]})]})}function er({term:e2,description:t2,pairs:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"Definition");let s2=n2??(e2===void 0?[]:[{term:e2,description:t2}]);return h("dl",{className:y("core-definition",a2),...Q(i2?.id??r2),style:o2,children:s2.map((e3,t3)=>g("div",{className:"core-definition__item",children:[h("dt",{className:"core-definition__term",children:e3.term}),h("dd",{className:"core-definition__description",children:e3.description})]},t3))})}var tr="katex";function nr(e2){if(typeof document>"u")return false;for(let t2 of document.querySelectorAll('script[type="importmap"]'))try{if(JSON.parse(t2.textContent??"").imports?.[e2])return true}catch{}return false}var rr=e2=>import(e2),ir;function ar(){return ir??=nr(tr)?rr(tr).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),ir}function or({children:e2="",mode:t2="inline",className:n2}){let r2=d(null),[i2,a2]=f(null),[s2,c2]=f(null),l2=`${t2}:${e2}`;return o(()=>{let e3=true;return ar().then(t3=>{e3&&t3&&a2(()=>t3)}),()=>{e3=false}},[]),o(()=>{if(i2&&r2.current&&s2!==l2)try{i2.render(e2,r2.current,{displayMode:t2==="block",throwOnError:false})}catch{c2(l2)}},[i2,e2,t2,l2,s2]),!i2||s2===l2?h("span",{className:y("core-math",n2),"data-mode":t2,"data-fallback":"",title:"KaTeX not available — showing TeX source",children:e2}):h("span",{ref:r2,className:y("core-math",n2),"data-mode":t2})}function sr(e2,t2){switch(t2.type){case"register":return e2.footnotes.some(e3=>e3.id===t2.entry.id)?e2:{footnotes:[...e2.footnotes,t2.entry]};case"unregister":return{footnotes:e2.footnotes.filter(e3=>e3.id!==t2.id)};default:return e2}}var cr=n(null);function lr(){return a(cr)}function ur({children:e2}){let[t2,n2]=u(sr,{footnotes:[]}),r2=d(0),a2=i(e3=>{r2.current+=1;let t3=r2.current;return n2({type:"register",entry:{...e3,number:t3}}),t3},[]),o2=i(e3=>n2({type:"unregister",id:e3}),[]),s2=l(()=>({state:t2,registerFootnote:a2,unregisterFootnote:o2}),[t2,a2,o2]);return h(cr.Provider,{value:s2,children:e2})}function dr({children:e2}){let t2=s(),n2=lr(),[r2,i2]=f(null);return o(()=>{if(!n2)return;let r3=n2.registerFootnote({id:t2,content:e2});return i2(r3),()=>n2.unregisterFootnote(t2)},[t2]),n2?r2===null?null:h("sup",{id:`core-footnote-ref-${r2}`,className:"core-footnote",children:g("a",{href:`#core-footnote-${r2}`,className:"core-footnote__link",children:["[",r2,"]"]})}):g("span",{className:"core-footnote","data-fallback":"",children:[" ","(",e2,")"]})}function fr({children:e2,caption:t2,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Figure"),g("figure",{className:y("core-figure",i2),...Q(r2?.id??n2),style:a2,children:[h("div",{className:"core-figure__body",children:e2}),t2&&h("figcaption",{className:"core-figure__caption",children:t2})]})}function pr({className:e2}){return h("div",{className:y("core-page-break",e2),"aria-hidden":true})}function mr({children:e2,as:t2="div",profileId:n2,profile:r2,tone:i2="subtle",className:a2,style:o2}){return r2||Z(n2,"DocumentLabel"),h(t2,{className:y("core-document-label",a2),"data-tone":i2,...Q(r2?.id??n2),style:o2,children:e2})}var hr=["one","two","three","four","five","six","seven","eight","nine","ten"];function gr(e2){if(e2.length!==1)return null;let t2=e2[0],n2=hr[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function _r(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function vr(e2,t2,n2){let r2=n2==="ladder"&&e2!==void 0&&e2.length>0,i2=[];return t2.map(({level:t3,marker:n3})=>{let a2=Math.min(Number.isInteger(t3)&&t3>=1?t3:1,i2.length+1);return i2.length=a2,i2[a2-1]=(i2[a2-1]??0)+1,n3===void 0?r2?[...e2,...i2].join("."):void 0:n3})}function yr(e2,t2){return e2?.[t2]??t2}function br({target:e2,form:t2,sectionReferences:n2,sectionNumbers:r2,sectionTitles:i2,sectionAnchors:a2,profileId:o2,profile:s2,className:c2,style:l2}){let u2=s2??Z(o2,"Reference"),d2=Gn(e2),f2=n2?.[e2],p2=f2?.openable===false,m2=d2!==null&&d2.doc===void 0,g2=d2?Kn(d2.unit):e2,_2=f2?.number??(m2&&d2.element===void 0?r2?.[g2]:void 0),v2=f2?.title??(m2&&d2.element===void 0?i2?.[g2]:void 0),b2=null;if(d2?.element!==void 0){let e3=f2?.element;b2=e3?vr(f2.number,e3.shape,u2?.depth.numbering)[e3.index]??null:null}else _2&&(b2=_r(_2));let x2=t2==="full"||d2?.doc!==void 0&&t2!=="title",S2;S2=p2?null:t2==="title"?v2??b2:x2&&b2&&v2&&d2?.element===void 0?`${b2} (${v2})`:b2??v2??null;let C2=S2!==null,w2=C2?f2?f2.href:`#${yr(a2,g2)}`:void 0,T2={className:y("core-reference",c2),"data-target":e2,"data-unresolved":C2||p2?void 0:"","data-closed":p2?"":void 0,...Q(s2?.id??o2),style:l2};return w2?h("a",{href:w2,...T2,children:S2}):h("span",{...T2,children:S2??e2})}function xr({columns:e2,rows:t2,caption:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"DocumentTable"),e2.length===0?null:g("div",{className:y("core-document-table",a2),...Q(i2?.id??r2),style:o2,children:[n2===void 0?null:h("div",{className:"core-document-table__caption",children:n2}),g("table",{className:"core-document-table__table",children:[h("thead",{children:h("tr",{children:e2.map((e3,t3)=>h("th",{scope:"col",className:"core-document-table__head","data-align":e3.align??"left",children:e3.header},t3))})}),h("tbody",{children:t2.map((t3,n3)=>h("tr",{children:e2.map((e3,n4)=>h("td",{className:"core-document-table__cell","data-align":e3.align??"left",children:t3[n4]??null},n4))},n3))})]})]})}var Sr={locale:"en-CA",currency:"CAD"},Cr=e2=>{if(typeof e2!="string"||!e2)return false;try{return Intl.NumberFormat.supportedLocalesOf(e2).length>0}catch{return false}},wr=e2=>{if(typeof e2!="string"||!/^[A-Za-z]{3}$/.test(e2))return false;try{return new Intl.NumberFormat("en-CA",{style:"currency",currency:e2}),true}catch{return false}};function Tr(e2){let t2=typeof e2=="object"&&e2?e2:{};return{locale:Cr(t2.locale)?t2.locale:Sr.locale,currency:wr(t2.currency)?t2.currency.toUpperCase():Sr.currency}}var Er=new Map;function Dr(e2){let t2=`${e2.locale}|${e2.currency}`,n2=Er.get(t2);if(!n2){let r2=new Intl.NumberFormat(e2.locale,{style:"currency",currency:e2.currency,maximumFractionDigits:0}).formatToParts(1),i2=r2.findIndex(e3=>e3.type==="integer"),a2=r2.length-1-[...r2].reverse().findIndex(e3=>e3.type==="integer");n2={prefix:r2.slice(0,i2).filter(e3=>e3.type!=="minusSign"&&e3.type!=="plusSign").map(e3=>e3.value).join(""),suffix:r2.slice(a2+1).map(e3=>e3.value).join("")},Er.set(t2,n2)}return n2}function Or(e2,t2){if(e2==null)return"";if(typeof e2=="string")return e2;let n2=e2.precision??(e2.format==="number"?kr(e2.value):void 0),r2=Ar(e2.format,e2.value,{precision:n2,signed:e2.signed,locale:t2});return e2.unit&&r2!=="—"?`${r2} ${e2.unit}`:r2}function kr(e2){if(typeof e2!="number"||!Number.isFinite(e2))return 0;let t2=String(Number(e2.toFixed(3))),n2=t2.indexOf(".");return n2===-1||t2.includes("e")?0:t2.length-n2-1}function Ar(e2,t2,n2={}){if(!Number.isFinite(t2))return"—";let r2=n2.signed===true,i2=t2<0,a2=Math.abs(t2),o2=i2?"-":r2?"+":"",s2=n2.locale??Sr,c2=(e3,t3)=>e3.toLocaleString(s2.locale,{minimumFractionDigits:t3,maximumFractionDigits:t3}),l2=(e3,t3="")=>{let{prefix:n3,suffix:r3}=Dr(s2);return`${o2}${n3}${e3}${t3}${r3}`};switch(e2){case"currency":return l2(c2(a2,n2.precision??0));case"currency-k":{let e3=n2.precision??0;return a2>=1e3?l2((a2/1e3).toFixed(e3),"k"):l2(a2.toFixed(0))}case"currency-m":{let e3=n2.precision??1;return a2>=1e6?l2((a2/1e6).toFixed(e3),"M"):a2>=1e3?l2((a2/1e3).toFixed(0),"k"):l2(a2.toFixed(0))}case"currency-compact":return a2>=1e9?l2((a2/1e9).toFixed(n2.precision??1),"B"):a2>=1e6?l2((a2/1e6).toFixed(n2.precision??1),"M"):a2>=1e3?l2((a2/1e3).toFixed(n2.precision??1),"k"):l2(a2.toFixed(n2.precision??0));case"currency-monthly":return`${l2(c2(a2,n2.precision??0))}/mo`;case"percent":{let e3=n2.precision??1;return`${o2}${a2.toFixed(e3)}%`}case"fraction-percent":return`${o2}${new Intl.NumberFormat(s2.locale,{style:"percent",minimumFractionDigits:n2.precision??0,maximumFractionDigits:n2.precision??1}).format(a2)}`;case"age":return`Age ${Math.round(t2)}`;case"years":{let e3=n2.precision??0;return`${o2}${a2.toFixed(e3)} yrs`}case"year":return String(Math.round(t2));case"number":return`${o2}${c2(a2,n2.precision??0)}`;default:{let e3=n2.precision??0;return l2((a2/1e3).toFixed(e3),"k")}}}var jr=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2);function Mr({items:e2,profileId:t2,profile:n2,markerWidth:r2=44,secondaryWidth:i2=190,missingLabel:a2="Not answered yet",baseProps:o2,className:s2,style:c2}){if(n2||Z(t2,"RowList"),!Array.isArray(e2)||e2.length===0)return null;let l2=Tr(o2),u2=e3=>jr(e3)?Or(e3,l2):e3;return h("div",{className:y("core-row-list",s2),...Q(n2?.id??t2),style:x({"--core-row-list-marker-width":b(r2),"--core-row-list-secondary-width":b(i2)},c2),children:e2.map((e3,t3)=>g("div",{className:"core-row-list__row",children:[e3.marker!==void 0&&h("div",{className:"core-row-list__marker",children:u2(e3.marker)}),h("div",{className:"core-row-list__primary",children:e3.primary}),(e3.secondary!==void 0||e3.missing)&&h("div",{className:"core-row-list__secondary","data-missing":e3.missing?"":void 0,children:e3.missing?a2:u2(e3.secondary)})]},t3))})}var Nr=190;function Pr({items:e2,profileId:t2,profile:n2,missingLabel:r2="Not answered yet",answerWidth:i2=190,className:a2,style:o2}){let s2=e2.map(e3=>{let t3=typeof e3.answer=="string"&&e3.answer.trim().length>0;return{marker:e3.reference,primary:e3.question,secondary:t3?e3.answer:void 0,missing:!t3}});return h("div",{className:y("core-answer-rows",a2),...Q(n2?.id??t2),style:o2,children:h(Mr,{items:s2,profileId:t2,profile:n2,secondaryWidth:i2,missingLabel:r2})})}var Fr=40;function Ir({bars:e2,target:t2,targetLabel:n2,max:r2,profileId:i2,profile:a2,baseProps:o2,className:s2,style:c2}){let l2=Tr(o2),u2=a2??Z(i2,"ComparisonBars");if(e2.length===0)return null;let d2=e2.map(e3=>e3.value),f2=r2??Math.max(...d2,t2??0);if(!Number.isFinite(f2)||f2<=0)return q("ComparisonBars:no-scale","[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."),null;let p2=t2!==void 0&&t2>0&&t2<=f2?t2/f2*100:void 0;return g("figure",{className:y("core-comparison-bars",s2),...Q(a2?.id??i2),...Yn(u2),style:c2,children:[e2.map(e3=>{let t3=Math.max(0,Math.min(100,e3.value/f2*100));return g("div",{className:"core-comparison-bars__bar",style:x({"--core-comparison-bars-value":`${t3}%`}),children:[h("div",{className:"core-comparison-bars__label",children:e3.label}),g("div",{className:"core-comparison-bars__track",style:x({"--core-comparison-bars-target":p2===void 0?void 0:`${p2}%`}),children:[h("div",{className:"core-comparison-bars__fill"}),h("span",{className:"core-comparison-bars__value","data-placement":t3>Fr?"inside":"outside",children:Or(e3.display,l2)}),p2!==void 0&&h("div",{className:"core-comparison-bars__target","aria-hidden":"true"})]})]},e3.label)}),t2!==void 0&&n2&&h("figcaption",{className:"core-comparison-bars__target-label",children:n2})]})}var Lr=3,Rr=5;function zr({items:e2,profileId:t2,profile:n2,checkboxes:r2=true,className:i2,style:a2}){return n2||Z(t2,"NextSteps"),e2.length===0?null:((e2.length<Lr||e2.length>Rr)&&q(`NextSteps:count:${e2.length}`,`[NextSteps] ${e2.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`),h("ol",{className:y("core-next-steps",i2),...Q(n2?.id??t2),style:a2,children:e2.map((e3,t3)=>g("li",{className:"core-next-steps__step",children:[h("span",{className:"core-next-steps__marker",children:e3.marker??String(t3+1).padStart(2,"0")}),r2&&h("span",{className:"core-next-steps__box","aria-hidden":"true"}),h("span",{className:"core-next-steps__body",children:e3.body})]},t3))}))}var Br=38;function Vr({title:e2="Notes",lines:t2=4,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"Notes"),t2<1?null:g("section",{className:y("core-notes",i2),...Q(r2?.id??n2),style:a2,children:[h("div",{className:"core-notes__title",children:e2}),h("div",{className:"core-notes__lines","aria-hidden":"true",children:Array.from({length:t2},(e3,t3)=>h("div",{className:"core-notes__line"},t3))})]})}var Hr="You left this section open, so it is not covered here.";function Ur({wouldTell:e2,openingLine:t2=Hr,profileId:n2,profile:r2,className:i2,style:a2}){return r2||Z(n2,"SkippedSection"),g("div",{className:y("core-skipped-section",i2),...Q(r2?.id??n2),style:a2,children:[h("span",{className:"core-skipped-section__standard",children:t2})," ",h("span",{className:"core-skipped-section__would-tell",children:e2})]})}var Wr="Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";function Gr({advisor:e2,title:t2="Talk it through",invitation:n2=Wr,profileId:r2,profile:i2,className:a2,style:o2}){if(i2||Z(r2,"TalkItThrough"),!e2?.name?.trim())return q("TalkItThrough:no-advisor","[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."),null;let s2=[e2.phone,e2.email].filter(e3=>typeof e3=="string"&&e3.trim().length>0);return s2.length===0&&q("TalkItThrough:no-contact",`[TalkItThrough] "${e2.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`),g("section",{className:y("core-talk-it-through",a2),...Q(i2?.id??r2),style:o2,children:[h("h3",{className:"core-talk-it-through__title",children:t2}),h("p",{className:"core-talk-it-through__invitation",children:n2}),g("div",{className:"core-talk-it-through__advisor",children:[h("div",{className:"core-talk-it-through__name",children:e2.name}),e2.role&&h("div",{className:"core-talk-it-through__role",children:e2.role}),s2.length>0&&h("div",{className:"core-talk-it-through__contact",children:s2.map(e3=>h("span",{children:e3},e3))})]})]})}var Kr=38;function qr({question:e2,answer:t2,lines:n2=1,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"WriteInField");let s2=typeof t2=="string"&&t2.trim().length>0,c2=Math.max(1,n2);return g("div",{className:y("core-write-in-field",a2),"data-answered":s2?"":void 0,...Q(i2?.id??r2),style:o2,children:[e2&&h("div",{className:"core-write-in-field__question",children:e2}),s2?h("div",{className:"core-write-in-field__answer",children:t2}):Array.from({length:c2},(e3,t3)=>h("div",{className:"core-write-in-field__line","aria-hidden":"true"},t3))]})}function Jr({mark:e2,identity:t2,codes:n2,profileId:r2,profile:i2,className:a2,style:o2}){return i2||Z(r2,"Masthead"),e2===void 0&&t2===void 0&&n2===void 0?null:g("header",{className:y("core-masthead",a2),"data-page-region":"page-header",...Q(i2?.id??r2),style:o2,children:[e2!==void 0&&h("div",{className:"core-masthead__mark","data-slot":"mark",children:e2}),t2!==void 0&&h("div",{className:"core-masthead__identity","data-slot":"identity",children:t2}),n2!==void 0&&h("div",{className:"core-masthead__codes","data-slot":"codes",children:n2})]})}var Yr=4;function Xr({fields:e2,profileId:t2,profile:n2,className:r2,style:i2}){let a2=(n2??Z(t2,"MetaRail"))?.rail.placement??"strip";return a2==="none"||e2.length===0?null:(a2!=="column"&&e2.length>Yr&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${Yr}. Rendering all of them — check the layout.`),h("div",{className:y("core-meta-rail",r2),"data-placement":a2,...Q(n2?.id??t2),style:i2,children:e2.map(e3=>g("div",{className:"core-meta-rail__field",children:[h("div",{className:"core-meta-rail__label",children:e3.label}),h("div",{className:"core-meta-rail__value",children:e3.value})]},`${e3.label}:${e3.value}`))}))}var Zr={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function Qr({left:e2,centre:t2,right:n2,profileId:r2,profile:i2,className:a2,style:o2}){i2||Z(r2,"RunningFooter");let s2=[["left",e2],["centre",t2],["right",n2]].filter(([,e3])=>e3!=null);return s2.length===0?null:h("footer",{className:y("core-running-footer",a2),"data-page-region":"page-footer",...Q(i2?.id??r2),style:o2,children:s2.map(([e3,t3])=>h("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":Zr[e3],children:t3},e3))})}function $r({children:e2,rail:t2,profileId:n2,profile:r2,className:i2,style:a2}){let o2=r2??Z(n2,"DocumentShell"),s2=o2?.rail.placement==="column"&&t2!==void 0;return h(ur,{children:g("div",{className:y("core-document-shell",i2),...Q(o2?.id??n2),"data-has-rail":s2?"":void 0,style:a2,children:[h("div",{className:"core-document-shell__body",children:e2}),s2&&g(m,{children:[h("div",{className:"core-document-shell__gutter","aria-hidden":true}),h("aside",{className:"core-document-shell__rail",children:t2})]})]})})}function ei(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function ti({entries:e2,depth:t2,title:n2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=i2??Z(r2,"Contents"),c2=s2?.depth.max??Infinity,l2=e2??[],u2=t2===void 0?l2:l2.filter(e3=>e3.level<t2);if(u2.length===0)return null;let d2=s2?.depth.numbering??"none",f2=u2.some(e3=>e3.page!==void 0);return g("nav",{"aria-label":"Table of contents",className:y("core-contents",a2),...Q(i2?.id??r2),style:o2,children:[n2&&h("div",{className:"core-contents__title",children:n2}),h("ol",{className:"core-contents__list",children:u2.map(e3=>{let t3=d2==="none"?null:ei(e3.ordinal,e3.level);return g("li",{className:"core-contents__entry","data-level":e3.level,"data-overdeep":e3.level>=c2?"":void 0,style:x({"--core-contents-level":String(e3.level)}),children:[t3&&h("span",{className:"core-contents__ordinal",children:t3}),h("a",{href:`#${e3.id}`,className:"core-contents__link",children:e3.title}),f2&&h("span",{className:"core-contents__page",children:e3.page??""})]},e3.id)})})]})}function ni({s:e2,dated:t2}){return g("div",{className:"core-execution-block__signature",children:[g("div",{className:"core-execution-block__lines",children:[h("div",{className:"core-execution-block__line","data-line":"sign"}),t2?h("div",{className:"core-execution-block__line","data-line":"date"}):null]}),g("div",{className:"core-execution-block__captions",children:[g("div",{className:"core-execution-block__party",children:[e2.role?h("div",{className:"core-execution-block__role",children:e2.role}):null,e2.name?h("div",{className:"core-execution-block__name",children:e2.name}):null,e2.detail?h("div",{className:"core-execution-block__detail",children:e2.detail}):null]}),t2?h("div",{className:"core-execution-block__date-label",children:"Date"}):null]})]})}function ri({attestation:e2,label:t2,signatories:n2,columns:r2=1,note:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||Z(a2,"ExecutionBlock");let l2=Array.isArray(n2)?n2:[];return g("section",{className:y("core-execution-block",s2),...Q(o2?.id??a2),style:c2,children:[t2?h("div",{className:"core-execution-block__label",children:t2}):null,e2?h("div",{className:"core-execution-block__attestation",children:e2}):null,h("div",{className:"core-execution-block__signatories","data-columns":r2,children:l2.map((e3,t3)=>h(ni,{s:e3,dated:e3.dated===true},t3))}),i2?h("div",{className:"core-execution-block__note",children:i2}):null]})}function ii({kind:e2}){return g("div",{className:"core-document-blocks__unrenderable","data-unrenderable-block":e2,role:"alert",children:[h("strong",{children:"This provision could not be rendered."})," The document contains a block of type “",e2,"”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."]})}function ai({blocks:e2,profileId:t2,sectionNumbers:n2,sectionAnchors:r2,sectionTitles:i2,sectionReferences:a2,sectionOrdinal:o2,className:s2,style:c2}){let l2=Z(t2,"DocumentBlocks");if(e2.length===0)return null;let u2=vr(o2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),l2?.depth.numbering),d2=0,f2=(e3,o3)=>Jn(e3)?qn(e3).map((e4,s3)=>e4.kind==="text"?e4.text:h(br,{target:e4.key,form:e4.form,sectionReferences:a2,sectionNumbers:n2,sectionTitles:i2,sectionAnchors:r2,profileId:t2},`${o3}-ref-${s3}`)):e3,p2=e2.some(e3=>e3.kind==="execution");return h("div",{className:y("core-document-blocks",s2),"data-pinned":p2?"execution":void 0,...Q(t2),style:c2,children:e2.map((e3,n3)=>{let r3=`${e3.kind}-${n3}`;switch(e3.kind){case"prose":return h(Qn,{profileId:t2,full:e3.full,children:f2(e3.text,r3)},r3);case"clause":return h(Mr,{profileId:t2,items:e3.items.map((e4,t3)=>({marker:u2[d2++],primary:f2(e4.text,`${r3}-${t3}`),secondary:e4.note?f2(e4.note,`${r3}-${t3}-n`):void 0,missing:e4.missing}))},r3);case"definitions":return h(er,{profileId:t2,pairs:e3.pairs.map((e4,t3)=>({term:e4.term,description:f2(e4.description,`${r3}-${t3}`)}))},r3);case"table":return h(xr,{profileId:t2,caption:e3.caption?f2(e3.caption,`${r3}-cap`):void 0,columns:e3.columns,rows:e3.rows.map((e4,t3)=>e4.map((e5,n4)=>f2(e5,`${r3}-${t3}-${n4}`)))},r3);case"notice":return h(Zn,{profileId:t2,tone:e3.tone,title:e3.title,children:f2(e3.text,r3)},r3);case"figure":return h(fr,{profileId:t2,caption:f2(e3.caption,r3),children:e3.placeholder??null},r3);case"execution":return h(ri,{profileId:t2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},r3);default:return h(ii,{kind:String(e3.kind)},r3)}})})}var oi=["h2","h3","h4","h5","h6"];function si({sectionId:e2,title:t2,level:n2=0,ordinal:r2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionLevels:c2,continued:l2=false,continuedCount:u2,children:d2,blocks:f2,profileId:p2,profile:m2,className:_2,style:v2}){let b2=m2??Z(p2,"DocumentSection"),S2=i2?.[e2],C2=c2?.[e2],w2=S2??r2,T2=C2===void 0?n2:Math.max(0,C2-1),E2=T2>=(b2?.depth.max??Infinity),D2=Math.min(T2,(b2?.depth.indent.length??1)-1)+1,O2=b2?.depth.numbering==="ladder"&&w2!==void 0&&w2.length>0,k2=O2?gr(w2):null,A2=oi[Math.min(T2,oi.length-1)],j2=yr(a2,e2),M2=`${j2}-doc-heading`;return g("section",{id:j2,className:y("core-document-section",_2),"data-level":T2,"data-ordinal-source":w2?S2?"derived":"baked":void 0,"data-overdeep":E2?"":void 0,"aria-labelledby":M2,...Q(m2?.id??p2),style:x({"--core-document-section-indent":`var(--doc-indent-${D2}, 0)`},v2),children:[k2&&h("div",{className:"core-document-section__article",children:k2}),g(A2,{id:M2,className:"core-document-section__heading",children:[O2&&!k2&&h("span",{className:"core-document-section__ordinal",children:w2.join(".")}),t2,l2&&h("span",{className:"core-document-section__continued",children:"continued"})]}),l2&&u2&&h("div",{className:"core-document-section__count",children:`Items ${u2.from} to ${u2.to} of ${u2.of}`}),h("div",{className:"core-document-section__body",children:d2??(f2?h(ai,{blocks:f2,profileId:p2,sectionNumbers:i2,sectionAnchors:a2,sectionTitles:o2,sectionReferences:s2,sectionOrdinal:O2?w2:void 0}):null)})]})}var ci={prose:{type:"object",required:["kind","text"],additionalProperties:false,properties:{kind:{const:"prose"},text:{type:"string",description:"ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."},full:{type:"boolean",description:"Fill the measure rather than the reading-width cap. For a caption or text beside a table."}}},clause:{type:"object",required:["kind","items"],additionalProperties:false,properties:{kind:{const:"clause"},items:{type:"array",minItems:1,items:{type:"object",required:["text"],additionalProperties:false,properties:{marker:{type:"string",description:'An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article ("6.3").'},level:{type:"integer",minimum:1,description:"Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."},id:{type:"string",pattern:"^[a-z0-9][a-z0-9_-]*$",description:"A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."},text:{type:"string"},note:{type:"string",description:"A parenthetical, cross-reference or jurisdictional note set beside the text."},missing:{type:"boolean",description:"The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."}}}}}},definitions:{type:"object",required:["kind","pairs"],additionalProperties:false,properties:{kind:{const:"definitions"},pairs:{type:"array",minItems:1,items:{type:"object",required:["term","description"],additionalProperties:false,properties:{term:{type:"string"},description:{type:"string"}}}}}},table:{type:"object",required:["kind","columns","rows"],additionalProperties:false,properties:{kind:{const:"table"},caption:{type:"string"},columns:{type:"array",minItems:1,items:{type:"object",required:["header"],additionalProperties:false,properties:{header:{type:"string"},align:{enum:["left","right","center"],description:"Right-align money and any other figure column."}}}},rows:{type:"array",items:{type:"array",items:{type:"string"}},description:"One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."}}},notice:{type:"object",required:["kind","tone","text"],additionalProperties:false,properties:{kind:{const:"notice"},tone:{enum:["note","warning","important"]},title:{type:"string"},text:{type:"string"}}},figure:{type:"object",required:["kind","caption"],additionalProperties:false,properties:{kind:{const:"figure"},caption:{type:"string",description:"Required. An uncaptioned exhibit cannot be cited from the text that relies on it."},src:{type:"string",description:"Reference the host resolves. Never a data URI."},placeholder:{type:"string",description:"Text stand-in when src is absent, so a figure never renders empty."}}},execution:{type:"object",required:["kind","signatories"],additionalProperties:false,properties:{kind:{const:"execution"},label:{type:"string"},attestation:{type:"string",description:"The attestation clause, as running text."},signatories:{type:"array",minItems:1,items:{type:"object",required:["role"],additionalProperties:false,properties:{role:{type:"string",description:'Capacity: "Testator", "Witness", "Grantor".'},name:{type:"string",description:"Printed BELOW the signing rule, never on it."},detail:{type:"string"},dated:{type:"boolean",description:"Add a second, shorter rule for the date."}}}},columns:{enum:[1,2]},note:{type:"string"}}}},li=["md","lg","xl"],ui=5;function di(e2){let t2=li.indexOf(e2);return t2>0?li[t2-1]:e2}var fi=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function pi(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function mi({value:e2,label:t2,size:n2="lg",tone:r2,progress:i2,progressLabel:a2,autoStepDown:o2=true,baseProps:s2,className:c2,style:l2}){let u2=fi(e2)?Or(e2,Tr(s2)):e2,d2=typeof u2=="string"||typeof u2=="number"?String(u2).length:0,f2=o2&&d2>ui?di(n2):n2,p2=Be(r2,"strong"),{toned:m2,..._2}=Ve(p2),v2=i2==null?null:pi(i2);return g("div",{className:y("core-stat",m2&&"core-toned",c2),..._2,"data-size":f2,style:l2,children:[h("div",{className:"core-stat__value",children:u2}),t2!=null&&h(He,{className:"core-stat__label",tone:p2==="on-dark"||p2==="inherit"?p2:"subtle",children:t2}),v2!==null&&h("div",{className:"core-stat__progress",role:"progressbar","aria-label":a2??(typeof t2=="string"?t2:"Progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":v2,style:x({"--core-stat-progress":`${v2}%`}),children:h("div",{className:"core-stat__progress-fill"})})]})}function hi({children:e2,minColumnWidth:t2=200,maxColumns:n2=4,gap:r2=32,className:i2,style:a2}){return h("div",{className:y("core-stat-group",i2),style:x({"--core-stat-group-min":`${t2}px`,"--core-stat-group-max":String(Math.max(1,n2)),"--core-stat-group-gap":`${r2}px`},a2),children:e2})}var gi={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function _i({direction:e2="up",delay:t2=0,duration:n2=.5,threshold:r2=.15,once:i2=true,className:a2,style:s2,children:c2}){let l2=d(null),[u2,p2]=f(false);o(()=>{let e3=l2.current;if(!e3)return;if(typeof IntersectionObserver>"u"){p2(true);return}let t3=new IntersectionObserver(e4=>{let n3=e4[e4.length-1];n3&&(n3.isIntersecting?(p2(true),i2&&t3.disconnect()):i2||p2(false))},{threshold:Math.min(1,Math.max(0,r2))});return t3.observe(e3),()=>t3.disconnect()},[i2,r2]);let[m2,g2]=gi[e2];return h("div",{ref:l2,className:y("core-reveal",a2),"data-revealed":u2?"true":"false",style:x({"--core-reveal-x":`${m2}px`,"--core-reveal-y":`${g2}px`,"--core-reveal-duration":`${n2}s`,"--core-reveal-delay":`${t2}s`},s2),children:c2})}function vi({eyebrow:e2,title:t2,description:n2,trailing:r2,level:i2=2,revealDelay:a2=0,className:o2,style:s2}){let c2=i2===3,l2=c2?"h3":"h2";return h(_i,{direction:"up",delay:a2,className:y("core-section-header",o2),style:s2,children:g("div",{className:"core-section-header__inner","data-described":n2?"true":void 0,"data-level":c2?"3":void 0,children:[g("div",{className:"core-section-header__text",children:[e2?h(He,{className:"core-section-header__eyebrow",children:e2}):null,h(l2,{className:"core-section-header__title",children:t2}),n2?h("p",{className:"core-section-header__description",children:n2}):null]}),r2!=null&&r2!==""?h("div",{className:"core-section-header__trailing",children:r2}):null]})})}function yi({tone:e2,label:t2,headline:n2,children:r2,trailing:i2,className:a2,style:o2}){let s2=Re(e2,"accent"),c2=i2!=null&&i2!=="";return g("div",{className:y("core-highlight-box","core-toned",a2),"data-tone":s2,style:o2,children:[g("div",{className:"core-highlight-box__text",children:[t2?h("div",{className:"core-highlight-box__label",children:t2}):null,n2?h("div",{className:"core-highlight-box__headline",children:n2}):null,r2!=null&&r2!==""?h("div",{className:"core-highlight-box__body",children:r2}):null]}),c2?h("div",{className:"core-highlight-box__trailing",children:i2}):null]})}var bi=60,xi=400,Si=12,Ci=(e2,t2)=>{if(typeof e2!="string")return"";let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2},wi=e2=>typeof e2=="string"&&/^\/(?![/\\])[^\s\u0000-\u001f]*$/.test(e2)?e2:null,Ti=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>0?Math.round(e2):void 0;function Ei({name:e2,description:t2,takes:n2,sketch:r2,className:i2,style:a2}){let o2=Ci(e2,bi);if(!o2)return null;let s2=Ci(t2,xi),c2=(Array.isArray(n2)?n2:[]).map(e3=>({name:Ci(e3?.name,bi),type:Ci(e3?.type,60),note:Ci(e3?.note,160)})).filter(e3=>e3.name).slice(0,Si),l2=wi(r2?.src),u2=Ti(r2?.w),d2=Ti(r2?.h);return g("section",{className:y("core-proposed-component",i2),style:a2,"aria-label":`Proposed component: ${o2}`,children:[h("p",{className:"core-proposed-component__mark",children:"Proposed"}),h("h3",{className:"core-proposed-component__name",children:o2}),s2?h("p",{className:"core-proposed-component__description",children:s2}):null,l2?h("img",{className:"core-proposed-component__sketch",src:l2,alt:Ci(r2?.alt,160),loading:"lazy",...u2&&d2?{width:u2,height:d2}:{}}):null,c2.length?g("div",{className:"core-proposed-component__takes",children:[h("p",{className:"core-proposed-component__heading",children:"Would take"}),h("ul",{children:c2.map(e3=>g("li",{children:[h("code",{children:e3.name}),e3.type?h("span",{className:"core-proposed-component__type",children:e3.type}):null,e3.note?h("span",{className:"core-proposed-component__note",children:e3.note}):null]},e3.name))})]}):null]})}function Di({label:e2,children:t2,className:n2,style:r2}){return g("div",{className:y("core-disclaimer-block",n2),style:r2,children:[e2?g(m,{children:[h("strong",{className:"core-disclaimer-block__label",children:e2})," "]}):null,t2]})}function Oi(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function ki({label:e2,value:t2,fillPercent:n2,subtitle:r2,tone:i2,baseProps:a2,className:o2,style:s2}){let c2=Tr(a2),l2=Oi(n2);return g("div",{className:y("core-stat-strip","core-toned",o2),"data-tone":Re(i2,"info"),style:x({"--core-stat-strip-fill":`${l2}%`},s2),children:[g("div",{className:"core-stat-strip__row",children:[h("span",{className:"core-stat-strip__label",children:e2}),h("span",{className:"core-stat-strip__value",children:Or(t2,c2)})]}),h("div",{className:"core-stat-strip__track",children:h("div",{className:"core-stat-strip__fill"})}),r2?h("div",{className:"core-stat-strip__subtitle",children:Or(r2,c2)}):null]})}function Ai({text:e2,tone:t2,locale:n2,className:r2}){return h("span",{className:y("core-value-badge","core-toned",r2),"data-tone":Re(t2),children:Or(e2,n2)})}var ji=8,Mi={good:"success",warn:"warning",critical:"danger"};function Ni(e2,t2,n2){let r2={series:String(n2%ji+1)},i2=e2??t2;if(typeof i2!="string"||i2==="")return r2;if(i2==="muted")return{series:"muted"};let a2=/^series-([1-9]\d*)$/.exec(i2);if(a2)return{series:String((Number(a2[1])-1)%ji+1)};let o2=Mi[i2];return o2?{tone:o2}:Ie.includes(i2)?{tone:i2}:(q("OptionCard:colour",`[OptionCard] bar fill "${i2}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`),r2)}function Pi(e2){return typeof e2=="number"&&Number.isFinite(e2)?{text:String(e2).padStart(2,"0"),kind:"numeral"}:typeof e2!="string"||e2.trim()===""?null:/^\d+$/.test(e2.trim())?{text:e2.trim().padStart(2,"0"),kind:"numeral"}:{text:e2,kind:"label"}}function Fi(e2){let{number:t2,title:n2,description:r2,badgeText:i2,badgeTone:a2,bars:o2,tone:s2,isSelected:c2=false,className:l2,style:u2}=e2,d2=Tr(e2.baseProps),f2=Array.isArray(o2)?o2:[],p2=Pi(t2);return g("div",{className:y("core-option-card",l2),"data-selected":c2?"true":void 0,"data-described":r2?"true":void 0,style:u2,children:[g("div",{className:"core-option-card__head",children:[p2?h("div",{className:"core-option-card__number","data-kind":p2.kind,children:p2.text}):h("span",{}),i2!=null&&i2!==""?h(Ai,{text:i2,tone:Re(a2),locale:d2}):null]}),n2?h("div",{className:"core-option-card__title",children:n2}):null,r2?h("p",{className:"core-option-card__description",children:r2}):null,f2.map((e3,t3)=>{let n3=Ni(e3.tone,s2,t3),r3=Math.min(100,Math.max(0,Number(e3.fillPercent)||0)),i3=e3.valueTone===void 0||e3.valueTone==="default"?void 0:Re(e3.valueTone);return g("div",{className:"core-option-card__bar",children:[g("div",{className:"core-option-card__bar-head",children:[h("span",{className:"core-option-card__bar-label",children:e3.label}),h("span",{className:y("core-option-card__bar-value",i3&&"core-toned"),"data-tone":i3,children:Or(e3.value,d2)})]}),h("div",{className:"core-option-card__track",children:h("div",{className:y("core-option-card__fill","tone"in n3&&"core-toned"),"data-tone":"tone"in n3?n3.tone:void 0,"data-series":"series"in n3?n3.series:void 0,style:x({"--core-option-card-fill":`${r3}%`})})})]},t3)})]})}function Ii(e2){let{title:t2,subtitle:n2,rows:r2,className:i2,style:a2}=e2,o2=Tr(e2.baseProps),s2=e2.tone??"info",c2=s2==="none",l2=Array.isArray(r2)?r2:[];return g("div",{className:y("core-profile-card",!c2&&"core-toned",i2),"data-tone":c2?void 0:Re(s2,"info"),"data-marker":c2?"none":void 0,style:a2,children:[g("div",{className:"core-profile-card__head",children:[h("div",{className:"core-profile-card__title",children:t2}),n2?h("div",{className:"core-profile-card__subtitle",children:n2}):null]}),l2.map((e3,t3)=>g("div",{className:"core-profile-card__row",children:[h("span",{className:"core-profile-card__label",children:e3.label}),g("div",{className:"core-profile-card__end",children:[h("span",{className:"core-profile-card__value",children:Or(e3.value,o2)}),e3.badge?h(Ai,{text:e3.badge.text,tone:Re(e3.badge.tone),locale:o2}):null]})]},t3))]})}function Li(e2){if(typeof e2=="string"){let t2=e2.trim();return t2.startsWith("+")?"up":t2.startsWith("-")||t2.startsWith("−")?"down":"flat"}return e2&&typeof e2=="object"&&typeof e2.value=="number"?e2.value>0?"up":e2.value<0?"down":"flat":"flat"}var Ri={up:"▲",down:"▼",flat:"—"},zi={up:"success",down:"danger",flat:void 0},Bi=e2=>e2!=null&&e2!=="";function Vi(e2){let{columns:t2=4,gap:n2="tight",minColumnWidth:r2,className:i2,style:a2}=e2,o2=Tr(e2.baseProps),s2=Array.isArray(e2.cards)?e2.cards:[],c2=Math.max(1,Math.min(6,Math.round(Number(t2))||4));return h("div",{className:y("core-kpi-card-grid",i2),"data-gap":n2==="normal"?"normal":"tight",style:x({"--core-kpi-card-grid-columns":String(c2),"--core-kpi-card-grid-min":typeof r2=="number"&&r2>0?`${r2}px`:void 0},a2),children:s2.map((e3,t3)=>{let{subtitle:n3,badge:r3}=e3,i3=Bi(e3.tone)?Re(e3.tone):void 0,a3=Bi(e3.delta)?Li(e3.delta):void 0,s3=a3?zi[a3]:void 0;return h(_i,{direction:"up",className:"core-kpi-card-grid__item",children:g("div",{className:y("core-kpi-card-grid__card",i3&&"core-toned"),"data-tone":i3,children:[g("div",{className:"core-kpi-card-grid__head",children:[h("div",{className:"core-kpi-card-grid__label",children:e3.label}),r3&&Bi(r3.text)?h(Ai,{text:r3.text,tone:Re(r3.tone),locale:o2}):null]}),h("div",{className:"core-kpi-card-grid__value",children:Or(e3.value,o2)}),a3?g("div",{className:y("core-kpi-card-grid__delta",s3&&"core-toned"),"data-tone":s3,"data-direction":a3,children:[h("span",{"aria-hidden":"true",children:Ri[a3]})," ",Or(e3.delta,o2)]}):null,Bi(n3)?h("div",{className:"core-kpi-card-grid__subtitle",children:Or(n3,o2)}):null]})},t3)})})}function Hi(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return Re(e2)}var Ui=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),Wi=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!r(e2)&&"value"in e2&&!("format"in e2));function Gi(e2){return Wi(e2)?e2:{value:e2}}var Ki=/^\d{4}-\d{2}-\d{2}$/,qi=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function Ji(e2,t2,n2){if(!qi.test(e2))return e2;let r2=Ki.test(e2),i2=new Date(r2?`${e2}T00:00:00Z`:e2.replace(" ","T"));return Number.isNaN(i2.getTime())?e2:i2.toLocaleString(n2,{year:"numeric",month:"short",day:"numeric",...t2==="datetime"&&!r2?{hour:"numeric",minute:"2-digit"}:{},...r2?{timeZone:"UTC"}:{}})}function Yi(e2){if(!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e2))return e2;let t2=e2.replace(/[_-]+/g," ");return t2[0].toUpperCase()+t2.slice(1)}var Xi=new Set(["currency","currency-k","currency-m","currency-compact","currency-monthly","percent","fraction-percent","age","years","year","number"]),Zi={fraction:"fraction-percent"};function Qi(e2,t2,n2,r2){if(t2==="unit"){let t3=typeof n2=="string"?n2.trim():"",i2=Zi[t3]??(Xi.has(t3)?t3:void 0);return Or(i2?{value:e2,format:i2}:{value:e2,format:"number",...t3?{unit:t3}:{}},r2)}return t2&&Xi.has(t2)?Ar(t2,e2,{locale:r2}):String(e2)}function $i(e2,t2,n2,i2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&(t2==="date"||t2==="datetime")?Ji(e2,t2,i2.locale):typeof e2=="string"?Or(Yi(e2),i2):Ui(e2)?Or(e2,i2):typeof e2=="number"?Qi(e2,t2,n2,i2):r(e2)?e2:null}function ea({title:e2,subtitle:t2,columns:n2,rows:r2,baseProps:i2,className:a2,style:o2}){let c2=Tr(i2),l2=`${s()}-title`,u2=Array.isArray(n2)?n2:[],d2=Array.isArray(r2)?r2:[],f2=e3=>u2[e3]?.align??(e3===0?"left":"right");return h(_i,{direction:"up",children:g("div",{className:y("core-data-table",a2),style:o2,children:[e2||t2?g("div",{className:"core-data-table__head",children:[e2?h("div",{id:l2,className:"core-data-table__title",children:e2}):null,t2?h("div",{className:"core-data-table__subtitle",children:t2}):null]}):null,h("div",{className:"core-data-table__scroll",role:"region","aria-label":e2?void 0:"Data table, scrollable","aria-labelledby":e2?l2:void 0,tabIndex:0,children:g("table",{className:"core-data-table__table",children:[h("thead",{children:h("tr",{children:u2.map((e3,t3)=>g("th",{scope:"col",className:"core-data-table__col","data-align":f2(t3),style:x({"--core-data-table-min":typeof e3.minWidth=="number"&&e3.minWidth>0?`${e3.minWidth}px`:void 0}),children:[e3.header,e3.sublabel?h("span",{className:"core-data-table__sublabel",children:e3.sublabel}):null]},t3))})}),h("tbody",{children:d2.map((e3,t3)=>{let{highlighted:n3,total:r3}=e3,i3=e3.cells,a3=Array.isArray(i3)?i3:i3&&typeof i3=="object"?u2.map(e4=>i3[e4.key]):[];return h("tr",{className:"core-data-table__row","data-highlighted":n3?"true":void 0,"data-total":r3?"true":void 0,children:a3.map((t4,n4)=>{let r4=Gi(t4),i4=Hi(r4.tone),a4={className:y("core-data-table__cell",i4&&"core-toned"),"data-align":f2(n4),"data-tone":i4};return n4===0?h("th",{scope:"row",...a4,children:$i(r4.value,u2[n4]?.format,e3.unit,c2)},n4):h("td",{...a4,children:$i(r4.value,u2[n4]?.format,e3.unit,c2)},n4)})},t3)})})]})})]})})}function ta(e2){let{event:t2,href:n2,locale:r2,timeZone:i2,size:a2,className:o2,style:s2}=e2,c2=t2&&typeof t2=="object"?t2:{name:""},l2=ct(c2,r2,i2),u2=c2.status&&c2.status!=="confirmed"?c2.status:void 0,d2=g(m,{children:[g("div",{className:"core-event-card__top",children:[c2.typeName?h("span",{className:"core-event-card__type",children:c2.typeName}):null,u2?h("span",{className:"core-event-card__status","data-status":u2,children:u2}):null]}),h("div",{className:"core-event-card__name",children:c2.name}),l2?h("div",{className:"core-event-card__when",children:l2}):null,c2.location?h("div",{className:"core-event-card__where",children:c2.location}):null]});return h("div",{className:y("core-event-card",o2),"data-kind":c2.kind,"data-status":c2.status,"data-size":a2==="compact"?"compact":void 0,style:s2,children:n2?h("a",{className:"core-event-card__link",href:n2,children:d2}):d2})}var na={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function ra(e2){let{actions:t2,className:n2,style:r2}=e2,[i2,a2]=f(e2.response),[o2,s2]=f(false),[c2,l2]=f(""),u2=t2?.respond,d2=async e3=>{if(!u2||o2)return;s2(true),l2("");let t3=await u2({response:e3});s2(false),t3.success?a2(e3):l2(ft(t3))};return g("div",{className:y("core-event-respond",n2),style:r2,children:[h("div",{className:"core-event-respond__choices",role:"group","aria-label":"Your response",children:rt.map(e3=>h("button",{type:"button",className:"core-event-respond__choice","aria-pressed":i2===e3,disabled:!u2||o2,onClick:()=>void d2(e3),children:na[e3]},e3))}),c2?h("p",{className:"core-event-respond__message",role:"alert",children:c2}):null]})}function ia(e2){let{event:t2,actions:n2,viewerResponse:r2,locale:i2,timeZone:a2,className:o2,style:s2}=e2,c2=[["Edit",e2.editHref],["Reschedule",e2.rescheduleHref],["Add note",e2.noteHref],["Cancel the event",e2.cancelHref]].filter(e3=>typeof e3[1]=="string"&&e3[1]!==""),l2=t2&&typeof t2=="object"?t2:{name:""},u2=Array.isArray(e2.notes)?e2.notes:[],d2=Array.isArray(e2.participants)?e2.participants:[],f2=ct(l2,i2,a2);return g("article",{className:y("core-event-detail",o2),"data-status":l2.status,style:s2,children:[g("header",{className:"core-event-detail__head",children:[l2.typeName?h("div",{className:"core-event-detail__type",children:l2.typeName}):null,h("h2",{className:"core-event-detail__name",children:l2.name}),f2?h("div",{className:"core-event-detail__meta",children:f2}):null,l2.location?h("div",{className:"core-event-detail__meta",children:l2.location}):null,l2.status&&l2.status!=="confirmed"?h("div",{className:"core-event-detail__status",children:l2.status}):null]}),c2.length>0?h("div",{className:"core-event-detail__manage",role:"group","aria-label":"Change this event",children:c2.map(([e3,t3])=>h("a",{className:"core-event-detail__action",href:t3,children:e3},e3))}):null,r2===void 0?null:h(ra,{response:r2,actions:n2,className:"core-event-detail__respond"}),d2.length?g("section",{className:"core-event-detail__section","aria-label":"Participants",children:[h("h3",{className:"core-event-detail__heading",children:"Participants"}),h("ul",{className:"core-event-detail__list",children:d2.map((e3,t3)=>g("li",{className:"core-event-detail__person",children:[h("span",{children:e3.name}),h("span",{className:"core-event-detail__muted",children:[e3.role,e3.response&&e3.response!=="needs_action"?e3.response:void 0].filter(Boolean).join(" · ")})]},t3))})]}):null,u2.length?g("section",{className:"core-event-detail__section","aria-label":"Notes",children:[h("h3",{className:"core-event-detail__heading",children:"Notes"}),u2.map((e3,t3)=>g("div",{className:"core-event-detail__note","data-audience":e3.audience,children:[e3.audience==="staff"?h("div",{className:"core-event-detail__badge",children:"Staff only"}):null,h("p",{className:"core-event-detail__body",children:e3.body}),e3.author||e3.createdAt?h("div",{className:"core-event-detail__muted",children:[e3.author,e3.createdAt?new Date(e3.createdAt).toLocaleString(i2,{timeZone:a2}):void 0].filter(Boolean).join(" · ")}):null]},t3))]}):null]})}var aa=e2=>{let t2=e2?.dataSchema?.properties??{},n2=new Set(e2?.dataSchema?.required??[]);return Object.entries(t2).map(([e3,t3])=>[e3,t3,n2.has(e3)])};function oa(e2){let{orgId:t2,projectId:n2,actions:r2,onDone:i2,canWriteStaffNotes:a2,className:o2,style:c2}=e2,u2=Array.isArray(e2.types)?e2.types:[],d2=s(),[p2,m2]=f(e2.defaultTypeId??u2[0]?.id??""),_2=u2.find(e3=>e3.id===p2),v2=_2?.kind==="scheduled",[b2,x2]=f(""),[S2,C2]=f(dt()),[w2,T2]=f(""),[E2,D2]=f(""),[O2,k2]=f({}),[A2,j2]=f(""),[M2,N2]=f(!!a2),[P2,F2]=f(false),[I2,L2]=f(""),R2=l(()=>aa(_2),[_2]);if(!u2.length)return h("p",{className:y("core-event-log","core-event-log__empty",o2),style:c2,children:"There's nothing you can log here."});let z2=async o3=>{if(o3.preventDefault(),!r2?.logEvent||P2||!_2)return;F2(true),L2("");let s2=ut(S2),c3={event_type_id:_2.id,org_id:t2,name:b2.trim()||_2.name,starts_at:s2,tzid:lt(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};n2&&(c3.project_id=n2),v2&&w2&&(c3.ends_at=ut(w2)),E2.trim()&&(c3.location=E2.trim());let l2=A2.trim()?[{body:A2.trim(),audience:a2&&M2?"staff":"shared"}]:void 0,u3=await r2.logEvent(l2?{event:c3,notes:l2}:{event:c3});F2(false),u3.success?(x2(""),j2(""),k2({}),i2?.(u3)):L2(ft(u3))},B2=(e3,t3)=>k2(n3=>({...n3,[e3]:t3}));return g("form",{className:y("core-event-log",o2),style:c2,onSubmit:e3=>void z2(e3),children:[g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Type"}),h("select",{value:p2,onChange:e3=>{m2(e3.target.value),k2({})},children:u2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))})]}),g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Title"}),h("input",{value:b2,onChange:e3=>x2(e3.target.value),placeholder:_2?.name})]}),g("div",{className:"core-event-log__row",children:[g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:v2?"Starts":"When"}),h("input",{type:"datetime-local",required:true,value:S2,onChange:e3=>C2(e3.target.value)})]}),v2?g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Ends"}),h("input",{type:"datetime-local",value:w2,min:S2,onChange:e3=>T2(e3.target.value)})]}):null]}),g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Where"}),h("input",{value:E2,onChange:e3=>D2(e3.target.value)})]}),R2.map(([e3,t3,n3])=>{let r3=t3.title??e3;if(t3.enum)return g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:r3}),g("select",{required:n3,value:String(O2[e3]??""),onChange:t4=>B2(e3,t4.target.value||void 0),children:[h("option",{value:"",children:"—"}),t3.enum.map(e4=>h("option",{value:e4,children:e4},e4))]})]},e3);if(t3.type==="boolean")return g("label",{className:"core-event-log__check",children:[h("input",{type:"checkbox",checked:!!O2[e3],onChange:t4=>B2(e3,t4.target.checked)}),h("span",{children:r3})]},e3);let i3=t3.type==="number"||t3.type==="integer";return g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:r3}),h("input",{type:i3?"number":"text",step:t3.type==="integer"?1:"any",required:n3,value:O2[e3]===void 0?"":String(O2[e3]),onChange:t4=>B2(e3,t4.target.value===""?void 0:i3?Number(t4.target.value):t4.target.value)})]},e3)}),g("label",{className:"core-event-log__field",children:[h("span",{className:"core-event-log__label",children:"Note"}),h("textarea",{rows:3,value:A2,onChange:e3=>j2(e3.target.value)})]}),a2&&A2.trim()?g("label",{className:"core-event-log__check",children:[h("input",{type:"checkbox",checked:M2,onChange:e3=>N2(e3.target.checked)}),h("span",{children:"Staff only: the client won't see this note"})]}):null,I2?h("p",{id:`${d2}-error`,className:"core-event-log__message",role:"alert",children:I2}):null,h("div",{className:"core-event-log__actions",children:h("button",{type:"submit",className:"core-event-log__submit",disabled:P2||!r2?.logEvent,children:P2?"Saving…":v2?"Schedule":"Log"})})]})}var sa=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function ca(e2){let t2=T(),{view:n2="week",weekParam:r2="week",linkParams:i2,eventHref:a2="?panel=event:{id}",locale:o2,timeZone:s2,renderComponent:c2,label:l2="Schedule",className:u2,style:d2}=e2,f2=e3=>`?${i2?new URLSearchParams({...i2,[r2]:e3}).toString():`${r2}=${e3}`}`,p2=Array.isArray(e2.occurrences)?e2.occurrences:[],m2=pt(new Date,s2),_2=mt(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:m2),v2=Array.from({length:7},(e3,t3)=>Y(_2,t3)),b2=new Map(v2.map(e3=>[e3,[]]));for(let e3 of p2)for(let t3 of ht(e3,s2))b2.get(t3)?.push(e3);for(let e3 of b2.values())e3.sort((e4,t3)=>+!e4.startOn-!t3.startOn||(e4.startsAt??"").localeCompare(t3.startsAt??""));let x2=n2==="agenda"?v2.filter(e3=>b2.get(e3).length):v2;return g("section",{className:y("core-event-schedule",u2),"data-view":n2,style:d2,"aria-label":l2,children:[g("div",{className:"core-event-schedule__nav",children:[t2?null:h("a",{className:"core-event-schedule__step",href:f2(Y(_2,-7)),"aria-label":"Previous week",children:"‹"}),h("span",{className:"core-event-schedule__range",children:`${sa(v2[0],o2)} – ${sa(v2[6],o2)}`}),t2?null:h("a",{className:"core-event-schedule__step",href:f2(Y(_2,7)),"aria-label":"Next week",children:"›"})]}),x2.length===0?h("p",{className:"core-event-schedule__empty",children:"Nothing scheduled this week."}):null,h("ol",{className:"core-event-schedule__days",children:x2.map(e3=>{let t3=b2.get(e3);return g("li",{className:"core-event-schedule__day","data-today":e3===m2||void 0,children:[h("h3",{className:"core-event-schedule__date",children:sa(e3,o2)}),t3.length?h("ul",{className:"core-event-schedule__events",children:t3.map((e4,t4)=>h("li",{children:tt(e4,c2,{href:gt(a2,e4.id),locale:o2,timeZone:s2})??h(ta,{event:e4,href:gt(a2,e4.id),locale:o2,timeZone:s2})},`${e4.id??t4}-${e4.startsAt??e4.startOn??t4}`))}):h("p",{className:"core-event-schedule__none",children:"—"})]},e3)})})]})}var la=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function ua(e2){let{eventHref:t2="?panel=event:{id}",emptyText:n2="No activity yet.",locale:r2,timeZone:i2,renderComponent:a2,className:o2,style:s2}=e2,c2=[...(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&!Number.isNaN(new Date(e3.at).getTime()))].sort((e3,t3)=>new Date(t3.at).getTime()-new Date(e3.at).getTime()),l2=[];for(let e3 of c2){let t3=pt(e3.at,i2),n3=l2[l2.length-1];n3&&n3[0]===t3?n3[1].push(e3):l2.push([t3,[e3]])}let u2=new Intl.DateTimeFormat(r2,{hour:"numeric",minute:"2-digit",timeZone:i2});return g("section",{className:y("core-event-timeline",o2),style:s2,"aria-label":"Activity",children:[l2.length===0?h("p",{className:"core-event-timeline__empty",children:n2}):null,l2.map(([e3,n3])=>g("section",{className:"core-event-timeline__day",children:[h("h3",{className:"core-event-timeline__date",children:la(e3,r2)}),h("ol",{className:"core-event-timeline__items",children:n3.map((e4,n4)=>g("li",{className:"core-event-timeline__item","data-op":e4.op||void 0,children:[g("div",{className:"core-event-timeline__line",children:[h("time",{className:"core-event-timeline__time",dateTime:e4.at,children:u2.format(new Date(e4.at))}),e4.summary?h("span",{className:"core-event-timeline__summary",children:e4.summary}):null,e4.actor?h("span",{className:"core-event-timeline__actor",children:e4.actor}):null]}),e4.event?tt(e4.event,a2,{href:gt(t2,e4.event.id),locale:r2,timeZone:i2})??h(ta,{event:e4.event,href:gt(t2,e4.event.id),locale:r2,timeZone:i2}):null]},e4.id??`${e4.at}-${n4}`))})]},e3))]})}var da=1440;function fa(e2){return new Intl.DateTimeFormat("en-CA",{timeZone:e2,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function pa(e2,t2){let n2=e2 instanceof Date?e2:new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=Object.fromEntries(fa(t2).formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${r2.year}-${r2.month}-${r2.day}`,minutes:Number(r2.hour)*60+Number(r2.minute)+Number(r2.second)/60}}var ma=e2=>e2.busyOnly===true;function ha(e2,t2){if(!e2.startsAt)return null;let n2=pa(e2.startsAt,t2);if(!n2)return null;let r2=new Date(e2.startsAt).getTime(),i2=e2.endsAt?new Date(e2.endsAt).getTime():NaN,a2=pa(Number.isFinite(i2)&&i2>r2?i2:r2+18e5,t2);return a2?{start:n2,end:a2}:null}function ga(e2,t2,{timeZone:n2,minMinutes:r2=42}={}){let i2=[],a2=[];for(let r3 of e2){if(!r3||typeof r3!="object")continue;if(r3.startOn){ht(r3).includes(t2)&&i2.push(r3);continue}let e3=ha(r3,n2);if(!e3||e3.start.date>t2||e3.end.date<t2||e3.end.date===t2&&e3.end.minutes===0&&e3.start.date<t2)continue;let o3=e3.start.date<t2?0:e3.start.minutes,s3=e3.end.date>t2?da:e3.end.minutes;a2.push({event:r3,startMin:o3,endMin:Math.max(s3,o3+1),continuesBefore:e3.start.date<t2,continuesAfter:e3.end.date>t2,busyOnly:ma(r3)})}a2.sort((e3,t3)=>e3.startMin-t3.startMin||t3.endMin-e3.endMin);let o2=[],s2=[],c2=-1,l2=[],u2=()=>{for(let e4 of s2)e4.cols=l2.length;let e3=s2.filter(e4=>!e4.busyOnly);for(let t3 of e3)t3.overlaps=e3.some(e4=>e4!==t3&&e4.startMin<t3.endMin&&t3.startMin<e4.endMin);o2.push(...s2),s2=[],l2=[],c2=-1};for(let e3 of a2){s2.length&&e3.startMin>=c2&&u2();let t3=Math.min(Math.max(e3.endMin,e3.startMin+r2),da),n3=l2.findIndex(t4=>t4<=e3.startMin);n3<0&&(n3=l2.length),l2[n3]=t3,c2=Math.max(c2,t3),s2.push({...e3,shownEndMin:t3,col:n3,cols:1,overlaps:false})}return u2(),i2.sort((e3,t3)=>(e3.name??"").localeCompare(t3.name??"")),{date:t2,blocks:o2,allDay:i2}}function _a(e2,t2=7,n2=19){let r2=Math.max(0,Math.min(23,t2))*60,i2=Math.max(r2/60+1,Math.min(24,n2))*60;for(let t3 of e2)for(let e3 of t3.blocks)r2=Math.min(r2,Math.floor(e3.startMin/60)*60),i2=Math.max(i2,Math.ceil(e3.shownEndMin/60)*60);return{fromMin:r2,toMin:Math.min(i2,da)}}function va(e2,t2=1){let n2=Y(mt(e2),(t2%7+6)%7);return n2>e2&&(n2=Y(n2,-7)),Array.from({length:7},(e3,t3)=>Y(n2,t3))}function ya(e2,t2,n2){return t2.filter(t3=>ga(e2,t3,{timeZone:n2,minMinutes:0}).blocks.some(e3=>e3.overlaps))}var ba=["circle","square","triangle","diamond","plus","hexagon"],xa={circle:"M5 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z",square:"M1.5 1.5h7v7h-7z",triangle:"M5 1.2 9 8.5H1z",diamond:"M5 .8 9.2 5 5 9.2.8 5z",plus:"M3.5 1h3v2.5H9v3H6.5V9h-3V6.5H1v-3h2.5z",hexagon:"M5 .8 8.6 2.9v4.2L5 9.2 1.4 7.1V2.9z"},Sa=e2=>ba[(Math.max(1,Math.floor(e2))-1)%ba.length],Ca=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>=1?(Math.floor(e2)-1)%8+1:1;function wa({series:e2,className:t2}){let n2=Ca(e2);return h("svg",{className:t2?`core-series-glyph ${t2}`:"core-series-glyph",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false","data-series":n2,"data-shape":Sa(n2),children:h("path",{d:xa[Sa(n2)]})})}var Ta=44,Ea=28,Da=(e2,t2,n2)=>`${((e2-t2)/n2*100).toFixed(3)}%`;function Oa(e2){let t2=e2===void 0?void 0:typeof e2=="number"?e2:new Date(e2).getTime(),[n2,r2]=f(()=>Date.now());return o(()=>{if(t2!==void 0)return;let e3=setInterval(()=>r2(Date.now()),6e4);return()=>clearInterval(e3)},[t2]),t2!==void 0&&Number.isFinite(t2)?t2:n2}function ka(e2){let{label:t2="Schedule",startHour:n2=7,endHour:r2=19,hourHeight:i2=64,eventHref:a2="?panel=event:{id}",locale:s2,timeZone:c2,className:l2,style:u2}=e2,p2=(Array.isArray(e2.columns)?e2.columns:[]).filter(e3=>e3&&typeof e3.date=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e3.date)),_2=Oa(e2.now),v2=d(null),[b2,S2]=f(false);o(()=>{let e3=v2.current;if(!e3)return;let t3=()=>S2(e3.scrollWidth>e3.clientWidth+1);t3();let n3=new ResizeObserver(t3);return n3.observe(e3),()=>n3.disconnect()},[p2.length]);let C2=pa(_2,c2),w2=Math.ceil(Ta/Math.max(i2,24)*60),T2=p2.map(e3=>ga(Array.isArray(e3.events)?e3.events:[],e3.date,{timeZone:c2,minMinutes:w2})),E2=T2.map(e3=>Math.max(Ta,Ea*Math.max(1,...e3.blocks.map(e4=>e4.cols)))),{fromMin:D2,toMin:O2}=_a(T2,n2,r2),k2=O2-D2,A2=Array.from({length:Math.floor(k2/60)+1},(e3,t3)=>D2+t3*60),j2=new Intl.DateTimeFormat(s2,{hour:"numeric",timeZone:"UTC"}),M2=new Intl.DateTimeFormat(s2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}),N2=e3=>M2.format(new Date(Date.UTC(2e3,0,1,0,Math.min(e3,da-1)))),P2=e3=>e3.continuesBefore?e3.continuesAfter?"All day":`Until ${N2(e3.endMin)}`:e3.continuesAfter?`From ${N2(e3.startMin)}`:`${N2(e3.startMin)} – ${N2(e3.endMin)}`;return g("div",{ref:v2,className:y("core-hour-grid",l2),role:"group","aria-label":t2,tabIndex:b2?0:void 0,style:x({"--core-hour-grid-cols":String(p2.length),"--core-hour-grid-tracks":E2.map(e3=>`minmax(${e3}px, 1fr)`).join(" "),"--core-hour-grid-min":`${E2.reduce((e3,t3)=>e3+t3,0)}px`,"--core-hour-grid-hour":`${i2}px`,"--core-hour-grid-hours":String(k2/60)},u2),children:[g("div",{className:"core-hour-grid__head",children:[h("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),p2.map(e3=>{let t3=C2?.date===e3.date,n3=g(m,{children:[h("span",{className:"core-hour-grid__label",children:e3.label}),e3.sublabel?h("span",{className:"core-hour-grid__sublabel",children:e3.sublabel}):null]}),r3=yt(e3.href);return r3?h("a",{className:"core-hour-grid__day",href:r3,"data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id):h("div",{className:"core-hour-grid__day","data-today":t3||void 0,"aria-current":t3?"date":void 0,children:n3},e3.id)})]}),T2.some(e3=>e3.allDay.length)?g("div",{className:"core-hour-grid__allday",children:[h("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),T2.map((e3,t3)=>h("ul",{className:"core-hour-grid__chips","aria-label":`All day, ${p2[t3].label}`,children:e3.allDay.map((e4,t4)=>{let n3=Aa(e4)?void 0:yt(gt(a2,e4.id));return h("li",{className:"core-hour-grid__chip","data-busy":Aa(e4)||void 0,children:Aa(e4)?h("span",{className:"core-hour-grid__sr",children:"Busy all day"}):n3?h("a",{href:n3,children:e4.name}):e4.name},`${e4.id??t4}`)})},p2[t3].id))]}):null,g("div",{className:"core-hour-grid__body",children:[h("div",{className:"core-hour-grid__axis","aria-hidden":"true",children:A2.map((e3,t3)=>h("span",{className:"core-hour-grid__tick",style:{top:Da(e3,D2,k2)},"data-first":t3===0||void 0,children:t3===0?"":j2.format(new Date(Date.UTC(2e3,0,1,e3/60)))},e3))}),T2.map((e3,t3)=>{let n3=p2[t3],r3=C2?.date===n3.date;return g("section",{className:"core-hour-grid__col","aria-label":n3.label,"data-today":r3||void 0,children:[h("ol",{className:"core-hour-grid__events",children:e3.blocks.map((e4,t4)=>{let n4=e4.event,r4={"--core-hour-grid-top":Da(e4.startMin,D2,k2),"--core-hour-grid-height":`${((e4.shownEndMin-e4.startMin)/k2*100).toFixed(3)}%`,"--core-hour-grid-left":`${(e4.col/e4.cols*100).toFixed(3)}%`,"--core-hour-grid-width":`${(100/e4.cols).toFixed(3)}%`};if(e4.busyOnly)return h("li",{className:"core-hour-grid__block","data-busy":"",style:x(r4),children:h("span",{className:"core-hour-grid__sr",children:`Busy, ${P2(e4)}`})},t4);let i3=yt(gt(a2,n4.id)),o2=e4.endMin-e4.startMin,s3=o2<45?"short":o2<90?"medium":"long",c3=g(m,{children:[e4.overlaps?h("span",{className:"core-hour-grid__overlap",children:"Overlaps"}):null,g("span",{className:"core-hour-grid__name",children:[typeof n4.series=="number"?h(wa,{series:n4.series,className:"core-hour-grid__series"}):null,n4.name]}),h("span",{className:"core-hour-grid__time",children:P2(e4)}),s3==="long"&&n4.typeName?h("span",{className:"core-hour-grid__type",children:n4.typeName}):null]}),l3={className:"core-hour-grid__event","data-kind":n4.kind,"data-status":n4.status,"data-size":s3,"data-overlaps":e4.overlaps||void 0};return h("li",{className:"core-hour-grid__block","data-before":e4.continuesBefore||void 0,"data-after":e4.continuesAfter||void 0,style:x(r4),children:i3?h("a",{...l3,href:i3,children:c3}):h("div",{...l3,children:c3})},`${n4.id??"e"}-${t4}`)})}),r3&&C2&&C2.minutes>=D2&&C2.minutes<=O2?h("div",{className:"core-hour-grid__now","aria-hidden":"true",style:{top:Da(C2.minutes,D2,k2)}}):null]},n3.id)})]})]})}var Aa=e2=>e2.busyOnly===true,$=/^\d{4}-\d{2}-\d{2}$/,ja=/^\d{2}:\d{2}$/,Ma=(e2,t2)=>!e2||!$.test(e2)?"":new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`)),Na=(e2,t2)=>new Intl.DateTimeFormat(t2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(new Date(`1970-01-01T${e2}:00Z`));function Pa(e2,t2){if(!e2)return null;let n2=new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",timeZone:t2}),i2=Object.fromEntries(r2.formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${i2.year}-${i2.month}-${i2.day}`,time:`${i2.hour}:${i2.minute}`}}function Fa(e2,t2){if(!$.test(e2)||!ja.test(t2))return;let n2=new Date(`${e2}T${t2}:00`);if(Number.isNaN(n2.getTime()))return;let r2=-n2.getTimezoneOffset(),i2=r2<0?"-":"+",a2=Math.abs(r2);return`${e2}T${t2}:00${i2}${String(Math.floor(a2/60)).padStart(2,"0")}:${String(a2%60).padStart(2,"0")}`}function Ia(e2,t2){let n2=Pa(new Date(t2).toISOString(),e2);if(!n2)return 0;let[r2,i2,a2]=n2.date.split("-").map(Number),[o2,s2]=n2.time.split(":").map(Number);return Math.round((Date.UTC(r2,i2-1,a2,o2,s2)-Math.floor(t2/6e4)*6e4)/6e4)}function La(e2,t2,n2){if($.test(e2)&&ja.test(t2)){if(!n2)return Fa(e2,t2);try{let[r2,i2,a2]=e2.split("-").map(Number),[o2,s2]=t2.split(":").map(Number),c2=Date.UTC(r2,i2-1,a2,o2,s2),l2=c2;for(let e3=0;e3<4;e3++){let e4=c2-Ia(n2,l2)*6e4;if(e4===l2)break;l2=e4}let u2=Ia(n2,l2),d2=u2<0?"-":"+",f2=Math.abs(u2);return`${e2}T${t2}:00${d2}${String(Math.floor(f2/60)).padStart(2,"0")}:${String(f2%60).padStart(2,"0")}`}catch{return Fa(e2,t2)}}}function Ra(e2,t2=Date.now()){let n2=e3=>new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",...e3?{timeZone:e3}:{}}).format(t2);try{return n2(e2)}catch{return n2()}}var za=(e2,t2,n2,r2)=>`?${new URLSearchParams({...r2,[n2]:"day",[t2]:e2}).toString()}`;function Ba({days:e2,param:t2="date",viewParam:n2="view",keep:r2,locale:i2,className:a2,style:o2}){let s2=T(),c2=[...new Set(e2.filter(e3=>$.test(e3)))].sort();if(c2.length===0)return null;let l2=c2.length===1,u2=l2?`Events overlap on ${Ma(c2[0],i2)}.`:`Events overlap on ${c2.length} days.`;return h("div",{className:y("core-overlap-notice",a2),style:o2,children:h($t,{tone:"warning",message:u2,action:s2?void 0:g("span",{className:"core-overlap-notice__links",children:[l2?null:h("span",{className:"core-overlap-notice__lead",children:"Review:"}),c2.map(e3=>h("a",{className:"core-overlap-notice__review",href:za(e3,t2,n2,r2),"aria-label":`Review ${Ma(e3,i2)}`,children:l2?"Review":Ma(e3,i2)},e3))]})})})}function Va(e2){let{param:t2="type",cancelledParam:n2="cancelled",keep:r2,label:i2="Show",onChange:a2,className:o2,style:c2}=e2,l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!==""),u2=s(),d2=l2.map(e3=>e3.id),f2=Array.isArray(e2.selected)?e2.selected:d2,p2=e2.showCancelled===true;if(l2.length===0)return null;let m2=e3=>{let r3=new FormData(e3);return{selected:r3.getAll(t2).map(String),showCancelled:r3.has(n2)}};return g("form",{className:y("core-calendar-filters",o2),style:c2,method:"get",action:"",onChange:e3=>{a2?a2(m2(e3.currentTarget)):typeof e3.currentTarget.requestSubmit=="function"&&e3.currentTarget.requestSubmit()},onSubmit:e3=>a2&&e3.preventDefault(),children:[Object.entries(r2??{}).map(([e3,t3])=>h("input",{type:"hidden",name:e3,value:t3},e3)),g("fieldset",{className:"core-calendar-filters__set",children:[h("legend",{className:"core-calendar-filters__legend",children:i2}),l2.map((e3,n3)=>g("label",{className:"core-calendar-filters__option",children:[h("input",{type:"checkbox",name:t2,value:e3.id,defaultChecked:f2.includes(e3.id)}),h(wa,{series:Ca(e3.series??n3+1)}),h("span",{className:"core-calendar-filters__label",children:e3.label})]},e3.id)),g("label",{className:"core-calendar-filters__option core-calendar-filters__option--cancelled",children:[h("input",{type:"checkbox",name:n2,value:"1",defaultChecked:p2}),h("span",{className:"core-calendar-filters__label",children:"Cancelled"})]})]}),h("button",{type:"submit",className:"core-calendar-filters__apply",id:`${u2}-apply`,children:"Apply"})]})}var Ha=(e2,t2,n2)=>`?${new URLSearchParams({...e2??{},[t2]:n2}).toString()}`,Ua=(e2,t2)=>{let[n2,r2]=e2.split("-").map(Number),i2=new Date(Date.UTC(n2,r2-1+t2,1));return`${i2.getUTCFullYear()}-${String(i2.getUTCMonth()+1).padStart(2,"0")}`};function Wa({month:e2,date:t2,highlight:n2="week",occurrences:r2,weekStartsOn:i2=1,param:a2="date",monthParam:o2="month",keep:s2,locale:c2,timeZone:l2,now:u2,className:p2,style:m2}){let _2=T(),v2=_2?"span":"a",b2=u2===void 0?Date.now():typeof u2=="number"?u2:new Date(u2).getTime(),x2=pa(Number.isFinite(b2)?b2:Date.now(),l2)?.date??"1970-01-01",S2=t2&&/^\d{4}-\d{2}-\d{2}$/.test(t2)?t2:x2,C2=e2&&/^\d{4}-\d{2}$/.test(e2)?e2:S2.slice(0,7),w2=`${C2}-01`,E2=va(w2,i2)[0],D2=Array.from({length:42},(e3,t3)=>Y(E2,t3)),O2=Array.from({length:6},(e3,t3)=>D2.slice(t3*7,t3*7+7)),k2=n2==="week"?new Set(va(S2,i2)):new Set([S2]),A2=Array.isArray(r2)?r2:[],j2=new Map(D2.map(e3=>{let t3=ga(A2,e3,{timeZone:l2,minMinutes:0});return[e3,t3.blocks.length+t3.allDay.length]})),M2=(e3,t3)=>new Intl.DateTimeFormat(c2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),N2=M2({month:"long",year:"numeric"},w2),P2=O2[0].map(e3=>({short:M2({weekday:"narrow"},e3),long:M2({weekday:"long"},e3)})),F2=D2.includes(S2)?S2:D2.includes(x2)?x2:w2,[I2,L2]=f(null),R2=I2&&D2.includes(I2)?I2:F2,z2=d(null),B2=e3=>{D2.includes(e3)&&(L2(e3),z2.current?.querySelector(`[data-date="${e3}"]`)?.focus())};return g("div",{className:y("core-mini-month",p2),style:m2,children:[g("div",{className:"core-mini-month__head",children:[_2?null:h("a",{className:"core-mini-month__step","data-step":"prev",href:Ha(s2,o2,Ua(C2,-1)),"aria-label":"Previous month",children:"‹"}),h("div",{className:"core-mini-month__title",id:`mm-${C2}`,"aria-live":"polite",children:N2}),_2?null:h("a",{className:"core-mini-month__step","data-step":"next",href:Ha(s2,o2,Ua(C2,1)),"aria-label":"Next month",children:"›"})]}),g("div",{ref:z2,role:"grid","aria-labelledby":`mm-${C2}`,className:"core-mini-month__grid",onKeyDown:e3=>{let t3=e3.target.closest("[data-date]")?.dataset.date;if(!t3)return;let n3=O2.find(e4=>e4.includes(t3)),r3={ArrowLeft:Y(t3,-1),ArrowRight:Y(t3,1),ArrowUp:Y(t3,-7),ArrowDown:Y(t3,7),Home:n3[0],End:n3[6]};r3[e3.key]?(e3.preventDefault(),B2(r3[e3.key])):(e3.key==="PageUp"||e3.key==="PageDown")&&(e3.preventDefault(),z2.current?.parentElement?.querySelector(`a[data-step="${e3.key==="PageUp"?"prev":"next"}"]`)?.click())},children:[h("div",{role:"row",className:"core-mini-month__row core-mini-month__row--head",children:P2.map((e3,t3)=>h("span",{role:"columnheader","aria-label":e3.long,className:"core-mini-month__weekday",children:e3.short},t3))}),O2.map(e3=>h("div",{role:"row",className:"core-mini-month__row",children:e3.map(e4=>{let t3=j2.get(e4)??0,n3=`${M2({weekday:"long",month:"long",day:"numeric"},e4)}${e4===x2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`;return h("span",{role:"gridcell","aria-selected":e4===S2,className:"core-mini-month__cell","data-range":k2.has(e4)||void 0,"data-outside":e4.slice(0,7)!==C2||void 0,children:g(v2,{className:"core-mini-month__day",href:_2?void 0:Ha(s2,a2,e4),"data-date":e4,"data-today":e4===x2||void 0,"data-selected":e4===S2||void 0,"aria-current":e4===S2?"date":void 0,"aria-label":_2?void 0:n3,tabIndex:_2?void 0:e4===R2?0:-1,onFocus:()=>L2(e4),children:[_2?h("span",{className:"core-mini-month__sr",children:n3}):null,h("span",{"aria-hidden":"true",children:Number(e4.slice(8))}),h("span",{className:"core-mini-month__dot","aria-hidden":"true","data-has":t3>0||void 0})]})},e4)})},e3[0]))]})]})}var Ga=(e2,t2,n2)=>`?${new URLSearchParams({...n2??{},[e2]:t2}).toString()}`;function Ka({date:e2,occurrences:t2,weekStartsOn:n2=1,param:r2="date",steps:i2=true,keep:a2,locale:o2,timeZone:s2,now:c2,className:l2,style:u2}){let d2=T(),f2=d2?"span":"a",p2=c2===void 0?Date.now():typeof c2=="number"?c2:new Date(c2).getTime(),m2=pa(Number.isFinite(p2)?p2:Date.now(),s2)?.date??"1970-01-01",_2=e2&&/^\d{4}-\d{2}-\d{2}$/.test(e2)?e2:m2,v2=va(_2,n2),b2=Array.isArray(t2)?t2:[],x2=new Intl.DateTimeFormat(o2,{weekday:"short",timeZone:"UTC"}),S2=new Intl.DateTimeFormat(o2,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}),C2=e3=>new Date(`${e3}T00:00:00Z`),w2=(e3,t3)=>`${S2.format(C2(e3))}${e3===m2?", today":""}${t3?`, ${t3} ${t3===1?"event":"events"}`:""}`,E2=new Map(v2.map(e3=>{let t3=ga(b2,e3,{timeZone:s2});return[e3,t3.blocks.length+t3.allDay.length]}));return h("nav",{className:y("core-week-strip",l2),style:u2,"aria-label":"Week",children:g("div",{className:"core-week-strip__frame",children:[i2&&!d2?h("a",{className:"core-week-strip__step",href:Ga(r2,Y(_2,-7),a2),"aria-label":"Previous week",children:"‹"}):null,h("ol",{className:"core-week-strip__days",children:v2.map(e3=>{let t3=E2.get(e3)??0;return h("li",{children:g(f2,{className:"core-week-strip__day",href:d2?void 0:Ga(r2,e3,a2),"aria-current":e3===_2?"date":void 0,"aria-label":d2?void 0:w2(e3,t3),"data-selected":e3===_2||void 0,"data-today":e3===m2||void 0,children:[d2?h("span",{className:"core-week-strip__sr",children:w2(e3,t3)}):null,h("span",{className:"core-week-strip__weekday","aria-hidden":"true",children:x2.format(C2(e3))}),h("span",{className:"core-week-strip__date","aria-hidden":"true",children:Number(e3.slice(8))}),h("span",{className:"core-week-strip__mark","aria-hidden":"true","data-has":t3>0||void 0})]})},e3)})}),i2&&!d2?h("a",{className:"core-week-strip__step",href:Ga(r2,Y(_2,7),a2),"aria-label":"Next week",children:"›"}):null]})})}var qa=[["day","Day"],["week","Week"],["agenda","Agenda"]];function Ja(e2){let t2=T(),{weekStartsOn:n2=1,viewParam:r2="view",dateParam:i2="date",eventHref:a2,newEventHref:o2,summary:s2,notice:c2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,className:p2,style:_2}=e2,v2=e2.view==="day"||e2.view==="agenda"?e2.view:"week",b2=Array.isArray(e2.occurrences)?e2.occurrences:[],x2=e2.now===void 0?Date.now():typeof e2.now=="number"?e2.now:new Date(e2.now).getTime(),S2=pa(Number.isFinite(x2)?x2:Date.now(),f2)?.date??"1970-01-01",C2=e2.date&&/^\d{4}-\d{2}-\d{2}$/.test(e2.date)?e2.date:S2,w2=(e3,t3)=>`?${new URLSearchParams({[r2]:e3,[i2]:t3}).toString()}`,E2=v2==="day"?1:7,D2=yt(o2),O2=(e3,t3)=>new Intl.DateTimeFormat(d2,{...e3,timeZone:"UTC"}).format(new Date(`${t3}T00:00:00Z`)),k2=va(C2,n2),A2=v2==="day"?O2({weekday:"long",month:"long",day:"numeric"},C2):`${O2({month:"short",day:"numeric"},k2[0])} – ${O2({month:"short",day:"numeric",year:"numeric"},k2[6])}`,j2=(t3,n3)=>h(ka,{columns:t3,label:n3,eventHref:a2,startHour:l2,endHour:u2,locale:d2,timeZone:f2,now:e2.now}),M2=e3=>({id:e3,date:e3,label:`${O2({weekday:"short"},e3)} ${Number(e3.slice(8))}`,sublabel:e3===S2?"Today":void 0,events:b2}),N2=k2.map(e3=>({...M2(e3),href:t2?void 0:w2("day",e3)}));return g("section",{className:y("core-calendar","core-calendar-view",p2),style:_2,"aria-label":"Schedule","data-view":v2,children:[g("header",{className:"core-calendar__head",children:[h("h2",{className:"core-calendar__title",children:A2}),t2?null:g("nav",{className:"core-calendar__nav","aria-label":"Calendar",children:[v2==="agenda"?null:h("a",{className:"core-calendar__step",href:w2(v2,Y(C2,-E2)),"aria-label":v2==="day"?"Previous day":"Previous week",children:"‹"}),h("a",{className:"core-calendar__today",href:w2(v2,S2),"aria-current":C2===S2||k2.includes(S2)?"date":void 0,children:"Today"}),v2==="agenda"?null:h("a",{className:"core-calendar__step",href:w2(v2,Y(C2,E2)),"aria-label":v2==="day"?"Next day":"Next week",children:"›"})]}),t2?null:h("nav",{className:"core-calendar__views","aria-label":"View",children:qa.map(([e3,t3])=>h("a",{className:"core-calendar__view",href:w2(e3,C2),"aria-current":e3===v2?"page":void 0,children:t3},e3))}),D2?h("a",{className:"core-calendar__new",href:D2,children:"New event"}):null]}),s2?h("p",{className:"core-calendar__summary",children:s2}):null,c2?h("div",{className:"core-calendar__notice",children:c2}):null,v2==="day"?j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2)):null,v2==="week"?g(m,{children:[h("div",{className:"core-calendar__wide",children:j2(N2,`Week of ${O2({month:"long",day:"numeric"},k2[0])}`)}),g("div",{className:"core-calendar__narrow",children:[h(Ka,{date:C2,occurrences:b2,weekStartsOn:n2,param:i2,steps:false,keep:{[r2]:"week"},locale:d2,timeZone:f2,now:e2.now}),j2([M2(C2)],O2({weekday:"long",month:"long",day:"numeric"},C2))]})]}):null,v2==="agenda"?h(ca,{label:"Agenda",occurrences:b2,view:"agenda",weekOf:C2,weekParam:i2,linkParams:{[r2]:"agenda"},eventHref:a2,locale:d2,timeZone:f2}):null]})}var Ya=new Set(["field","select","expand"]),Xa=(e2,t2)=>{let n2=e2.replace(/\s+/g," ").trim();return n2.length>t2?`${n2.slice(0,t2-1)}…`:n2};function Za(e2,t2){if(typeof e2!="function"||!Ya.has(t2.kind)||typeof t2.name!="string")return;let n2=Xa(t2.name,80);if(n2==="")return;let r2=t2.value,i2=typeof r2=="string"?Xa(r2,200):typeof r2=="boolean"||typeof r2=="number"&&Number.isFinite(r2)?r2:void 0;try{e2(i2===void 0?{kind:t2.kind,name:n2}:{kind:t2.kind,name:n2,value:i2})}catch{}}var Qa=["private","team","client"];function $a(e2){let t2=Array.isArray(e2?.audiences)?e2.audiences:[];return Qa.filter(e3=>t2.includes(e3))}function eo(e2,t2){if(t2.length!==0)return t2.includes(e2)?e2:t2.includes("team")?"team":t2[0]}function to(e2,t2="team"){let[n2,r2]=f(t2);return{value:eo(n2,e2),setValue:r2}}function no(e2,t2){if(e2==="private")return"Only me and the people I add";if(e2==="team")return"My team";let n2=X(t2);return n2?`My team and ${n2}`:"My team and the client"}function ro(e2){return e2==="client"?" The client can see it.":e2==="private"?" Only you and the people you add can see it.":""}function io({id:e2,audiences:t2,value:n2,onChange:r2,subjectName:i2,disabled:a2}){return t2.length===0||!n2?null:t2.length===1?g("p",{className:"core-intent-card__audience-fixed","data-audience":n2,children:[h("span",{className:"core-intent-card__label",children:"Who can see it"})," ",no(n2,i2)]}):g("fieldset",{className:"core-intent-card__audience",disabled:a2,children:[h("legend",{className:"core-intent-card__label",children:"Who can see it"}),t2.map(t3=>g("label",{className:"core-intent-card__audience-row",children:[h("input",{type:"radio",name:`${e2}-audience`,value:t3,checked:n2===t3,onChange:()=>r2(t3)}),h("span",{children:no(t3,i2)})]},t3))]})}var ao=50,oo=["project","process","run","node","event"],so=e2=>typeof e2=="string"&&e2.trim()!=="",co=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&so(e3.name)).slice(0,ao),lo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&so(e3.name)).slice(0,ao),uo=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3=="object"&&oo.includes(e3.kind)&&typeof e3.id=="string"&&so(e3.label)).slice(0,ao);function fo(e2){let t2=co(e2.people),n2=lo(e2.assignees),r2=uo(e2.linkCandidates),[i2,a2]=f(new Set((Array.isArray(e2.attendeeIds)?e2.attendeeIds:[]).filter(e3=>typeof e3=="string"))),[o2,s2]=f(typeof e2.assigneeId=="string"&&n2.some(t3=>t3.id===e2.assigneeId)?e2.assigneeId:""),[c2,l2]=f(()=>uo(e2.links).slice(0,10)),u2=t2.filter(e3=>i2.has(e3.id)),d2=n2.find(e3=>e3.id===o2),p2=r2.length>0?c2:[];return{people:t2,assignees:n2,candidates:r2,guests:i2,setGuests:a2,assigneeId:o2,setAssigneeId:s2,links:p2,setLinks:l2,picked:u2,assignee:d2,write(e3){u2.length&&(e3.attendeeIds=u2.map(e4=>e4.id)),d2&&(e3.assigneeId=d2.id),p2.length&&(e3.links=p2.slice(0,10).map(e4=>({kind:e4.kind,id:e4.id})))}}}function po({extras:e2,disabled:t2}){let n2=s(),{people:r2,assignees:i2,candidates:a2,guests:o2,setGuests:c2,assigneeId:l2,setAssigneeId:u2,links:d2,setLinks:f2}=e2,p2=a2.filter(e3=>!d2.some(t3=>t3.kind===e3.kind&&t3.id===e3.id));return g(m,{children:[r2.length>0?g("fieldset",{className:"core-intent-card__people",disabled:t2,children:[h("legend",{className:"core-intent-card__label",children:"Attendees (optional)"}),r2.map(e3=>g("label",{className:"core-intent-card__person",children:[h("input",{type:"checkbox",checked:o2.has(e3.id),onChange:t3=>c2(n3=>t3.target.checked?new Set([...n3,e3.id]):new Set([...n3].filter(t4=>t4!==e3.id)))}),h("span",{className:"core-intent-card__person-name",children:e3.name}),e3.role?h("span",{className:"core-intent-card__person-role",children:X(e3.role)}):null]},e3.id))]}):null,i2.length>0?h("div",{className:"core-intent-card__row",children:g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Assigned to (optional)"}),g("select",{value:l2,disabled:t2,onChange:e3=>u2(e3.target.value),children:[h("option",{value:"",children:"No one"}),i2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))]})]})}):null,a2.length>0?g("fieldset",{className:"core-intent-card__links",disabled:t2,children:[h("legend",{className:"core-intent-card__label",children:"Linked to (optional)"}),d2.length>0?h("ul",{className:"core-intent-card__chips",children:d2.map(e3=>g("li",{className:"core-intent-card__chip",children:[h("span",{className:"core-intent-card__chip-label",children:e3.label}),h("button",{type:"button",className:"core-intent-card__chip-remove","aria-label":`Remove link: ${e3.label}`,onClick:()=>f2(t3=>t3.filter(t4=>t4.kind!==e3.kind||t4.id!==e3.id)),children:h("span",{"aria-hidden":"true",children:"×"})})]},`${e3.kind}:${e3.id}`))}):null,p2.length>0&&d2.length<10?g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",id:`${n2}-add`,children:"Add a link"}),g("select",{"aria-labelledby":`${n2}-add`,value:"",onChange:e3=>{let t3=p2.find(t4=>`${t4.kind}:${t4.id}`===e3.target.value);t3&&f2(e4=>[...e4,t3])},children:[h("option",{value:"",children:"Choose…"}),p2.map(e3=>h("option",{value:`${e3.kind}:${e3.id}`,children:e3.label},`${e3.kind}:${e3.id}`))]})]}):null]}):null]})}var mo=[5,10,15,20,30,45,60,90],ho={line:300,note:2e3},go=(e2,t2)=>typeof e2=="string"?e2.slice(0,t2):"";function _o(e2){if(!e2)return dt();let t2=new Date(e2);return Number.isNaN(t2.getTime())?dt():(t2.setMinutes(t2.getMinutes()-t2.getTimezoneOffset()),t2.toISOString().slice(0,16))}function vo(e2){let{canWriteStaffNotes:t2=false,onIntent:n2,className:r2,style:i2}=e2,a2=X(e2.subjectName),c2=Array.isArray(e2.types)?e2.types.filter(e3=>e3&&typeof e3.id=="string"):[],l2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},u2=s(),{run:p2,busy:m2,message:_2,available:v2}=vt(n2),[b2,x2]=f(c2.find(e3=>e3.id===l2.typeId)?.id??c2[0]?.id??""),S2=$a(c2.find(e3=>e3.id===b2)),C2=to(S2),[w2,T2]=f(_o(l2.startsAt)),[E2,D2]=f(typeof l2.durationMin=="number"&&l2.durationMin>0?String(Math.round(l2.durationMin)):""),O2=fo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:l2.attendeeIds}),[k2,A2]=f(go(l2.outcome,ho.line)),[j2,M2]=f(go(l2.followUp,ho.line)),[N2,P2]=f(go(l2.note,ho.note)),[F2,I2]=f(t2),[L2,R2]=f(null),z2=d(null);o(()=>{L2&&z2.current?.focus({preventScroll:true})},[L2]);let B2=L2??(e2.logged&&typeof e2.logged=="object"?e2.logged:null);if(B2){let e3=yt(B2.href);return g("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:y("core-intent-card","core-log-card",r2),style:i2,"data-state":"logged",children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:["Logged",a2?` · ${a2}`:""]}),h("p",{className:"core-intent-card__title",children:B2.name??"Logged"})]}),e3?h("a",{className:"core-log-card__go",href:e3,children:"Go to event"}):null]})}if(c2.length===0)return h("p",{className:y("core-intent-card","core-log-card","core-log-card__empty",r2),style:i2,children:"There’s nothing you can log here."});let ee2=c2.find(e3=>e3.id===b2),te2=v2&&m2===null,V2=v2&&!!a2&&!!ee2&&!!w2,H2=v2?a2?"":"Choose who this is about before logging.":_t,U2=async e3=>{if(e3.preventDefault(),!V2||m2!==null||!ee2)return;let n3={typeId:ee2.id,startsAt:ut(w2),tzid:lt()};C2.value&&(n3.audience=C2.value),E2&&(n3.durationMin=Number(E2)),O2.write(n3),k2.trim()&&(n3.outcome=k2.trim()),j2.trim()&&(n3.followUp=j2.trim()),N2.trim()&&(n3.note=N2.trim(),n3.staffOnly=t2&&F2);let{ok:r3,result:i3}=await p2("log_event",n3);r3&&R2({name:ee2.name,href:i3&&typeof i3=="object"?i3.data?.href:void 0})},W2=!te2;return g("form",{className:y("core-intent-card","core-log-card",r2),style:i2,"data-state":v2?"editing":"display",onSubmit:e3=>void U2(e3),"aria-busy":m2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{className:"core-intent-card__eyebrow",children:"Log"}),h("p",{className:"core-intent-card__title",children:a2??"Who is this about?"})]}),g("div",{className:"core-intent-card__row",children:[g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Type"}),h("select",{value:b2,disabled:W2,onChange:e3=>x2(e3.target.value),children:c2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"When"}),h("input",{type:"datetime-local",required:true,value:w2,readOnly:W2,onChange:e3=>T2(e3.target.value)})]})]}),h("div",{className:"core-intent-card__row",children:g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"How long"}),g("select",{value:E2,disabled:W2,onChange:e3=>D2(e3.target.value),children:[h("option",{value:"",children:"—"}),[...new Set([...mo,...E2?[Number(E2)]:[]])].sort((e3,t3)=>e3-t3).map(e3=>h("option",{value:e3,children:`${e3} min`},e3))]})]})}),h(po,{extras:O2,disabled:W2}),h(io,{id:u2,audiences:S2,value:C2.value,onChange:C2.setValue,subjectName:a2,disabled:W2}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Outcome"}),h("input",{value:k2,maxLength:ho.line,readOnly:W2,onChange:e3=>A2(e3.target.value)})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Follow-up"}),h("input",{value:j2,maxLength:ho.line,readOnly:W2,onChange:e3=>M2(e3.target.value)})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Note"}),h("textarea",{rows:Math.min(10,Math.max(2,N2.split("\n").length+Math.floor(N2.length/40))),maxLength:ho.note,value:N2,readOnly:W2,onChange:e3=>P2(e3.target.value)})]}),t2&&N2.trim()?g("label",{className:"core-log-card__check",children:[h("input",{type:"checkbox",checked:F2,disabled:W2,onChange:e3=>I2(e3.target.checked)}),h("span",{children:"Staff only: the client won’t see this note"})]}):null,_2?h("p",{id:`${u2}-message`,className:"core-intent-card__message",role:"alert",children:_2}):null,h("p",{className:"core-intent-card__does",id:`${u2}-does`,children:V2?`Log saves this to ${a2}’s file.`:H2}),h("div",{className:"core-intent-card__actions",children:h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!V2||m2!==null,"aria-describedby":`${u2}-does`,children:m2==="log_event"?"Logging…":"Log"})})]})}var yo=250,bo=500,xo=(e2,t2)=>{let n2=t2.trim().toLowerCase();return n2===""||e2.label.toLowerCase().includes(n2)||!!e2.description?.toLowerCase().includes(n2)};function So({label:e2,options:t2,loadOptions:n2,value:r2,defaultValue:a2="",onValueChange:c2,onSelect:u2,orientation:p2="vertical",debounceMs:m2=150,minChars:h2=0,closeOnSelect:g2=true,fillOnSelect:_2=false,openOnFocus:v2=false,defaultOpen:y2=false,emptyText:b2="No results",errorText:x2="Could not load results"}){let S2=s(),C2=`${S2}-list`,[w2,T2]=f(a2),E2=r2??w2,[D2,O2]=f(y2),[k2,A2]=f(y2),[j2,M2]=f([]),[N2,P2]=f("idle"),[F2,I2]=f(null),[L2,R2]=f(""),z2=d(0),B2=d({onValueChange:c2,onSelect:u2,loadOptions:n2});B2.current={onValueChange:c2,onSelect:u2,loadOptions:n2};let ee2=l(()=>n2?j2:(t2??[]).filter(e3=>xo(e3,E2)),[n2,j2,t2,E2]),te2=!!n2,V2=E2.trim().length>=h2,H2=V2?ee2:[];o(()=>{if(!te2||!D2)return;if(!V2){z2.current+=1,M2([]),P2("idle");return}let e3=++z2.current,t3=new AbortController;P2("loading");let n3=setTimeout(()=>{B2.current.loadOptions?.(E2,t3.signal).then(t4=>{e3===z2.current&&(M2(t4),P2(t4.length?"ready":"empty"))},t4=>{e3===z2.current&&t4?.name!=="AbortError"&&(M2([]),P2("error"))})},m2);return()=>{clearTimeout(n3),t3.abort()}},[E2,D2,V2,te2,m2]);let U2=te2?N2:!D2||!V2?"idle":H2.length?"ready":"empty";o(()=>{F2!==null&&!H2.some(e3=>e3.id===F2)&&I2(null)},[H2,F2]),o(()=>{if(!k2||U2==="idle"){R2("");return}let e3=E2.trim().slice(0,60),t3=U2==="loading"?"Loading results":U2==="error"?x2.split("{query}").join(e3):U2==="empty"?b2.split("{query}").join(e3):`${H2.length} ${H2.length===1?"result":"results"}`,n3=setTimeout(()=>R2(t3),U2==="loading"?bo:yo);return()=>clearTimeout(n3)},[U2,H2.length,k2,E2,b2,x2]);let W2=i(e3=>{r2===void 0&&T2(e3),B2.current.onValueChange?.(e3)},[r2]),G2=i(()=>{A2(false),I2(null)},[]),ne2=i(e3=>{e3.disabled||(_2&&W2(e3.label),B2.current.onSelect?.(e3),g2&&G2())},[_2,W2,g2,G2]),re2=e3=>`${S2}-opt-${e3.id}`,ie2=k2&&H2.length>0,ae2=ie2?H2.find(e3=>e3.id===F2):void 0,K2=e3=>{if(H2.length===0)return;let t3=H2.filter(e4=>!e4.disabled);if(t3.length===0)return;let n3=t3.findIndex(e4=>e4.id===F2),r3=n3<0?e3===1?0:t3.length-1:(n3+e3+t3.length)%t3.length;I2(t3[r3].id)};return{options:H2,status:U2,statusText:L2,open:ie2,activeId:F2,close:G2,inputProps:{role:"combobox","aria-label":e2,"aria-expanded":ie2,"aria-controls":C2,"aria-autocomplete":"list","aria-activedescendant":ae2?re2(ae2):void 0,autoComplete:"off",value:E2,onChange:e3=>{O2(true),A2(true),I2(null),W2(e3.target.value)},onKeyDown:e3=>{if(e3.nativeEvent.isComposing||e3.altKey||e3.ctrlKey||e3.metaKey)return;let t3=p2==="horizontal"?"ArrowRight":"ArrowDown",n3=p2==="horizontal"?"ArrowLeft":"ArrowUp";e3.key==="ArrowDown"||e3.key==="ArrowUp"?(e3.preventDefault(),O2(true),k2?K2(e3.key==="ArrowDown"?1:-1):A2(true)):(e3.key===t3||e3.key===n3)&&ie2&&ae2?(e3.preventDefault(),K2(e3.key===t3?1:-1)):e3.key==="Enter"&&ae2?(e3.preventDefault(),ne2(ae2)):e3.key==="Escape"&&k2?(e3.preventDefault(),e3.stopPropagation(),G2()):e3.key==="Tab"&&G2()},onFocus:()=>{v2&&(O2(true),A2(true))},onBlur:()=>G2()},listboxProps:{id:C2,role:"listbox","aria-label":e2,"aria-orientation":p2},statusProps:{role:"status","aria-live":"polite","aria-atomic":true},getOptionProps:e3=>({id:re2(e3),role:"option","aria-selected":e3.id===ae2?.id,"aria-disabled":e3.disabled||void 0,"data-active":e3.id===ae2?.id?"":void 0,onPointerDown:e4=>e4.preventDefault(),onClick:()=>ne2(e3)}),query:E2}}function Co({text:e2,match:t2}){let n2=t2?e2.toLowerCase().indexOf(t2.trim().toLowerCase()):-1;if(n2<0||!t2.trim())return h(m,{children:e2});let r2=n2+t2.trim().length;return g(m,{children:[e2.slice(0,n2),h("mark",{className:"core-combobox__match",children:e2.slice(n2,r2)}),e2.slice(r2)]})}function wo({placeholder:e2,emptyText:t2="No results",errorText:n2="Could not load results",renderOption:r2,className:i2,style:a2,...c2}){let l2=So({...c2,emptyText:t2,errorText:n2}),u2=l2.query.trim().slice(0,60),f2=d(null),p2=c2.orientation==="horizontal",_2=s(),v2=[];for(let e3 of l2.options){let t3=p2?void 0:e3.group,n3=v2[v2.length-1];n3&&n3.group===t3?n3.options.push(e3):v2.push({group:t3,options:[e3]})}o(()=>{l2.activeId!==null&&f2.current?.querySelector("[data-active]")?.scrollIntoView({block:"nearest",inline:"nearest"})},[l2.activeId]);let b2=l2.status==="empty"?t2.split("{query}").join(u2):l2.status==="error"?n2.split("{query}").join(u2):l2.status==="loading"?"Loading…":null;return g("div",{className:y("core-combobox",i2),style:a2,"data-orientation":c2.orientation??"vertical","data-status":l2.status,children:[h("input",{...l2.inputProps,type:"text",className:"core-combobox__input",placeholder:e2}),h("ul",{ref:f2,...l2.listboxProps,className:"core-combobox__list",hidden:!l2.open,children:v2.map((e3,t3)=>{let n3=e3.options.map(e4=>h("li",{...l2.getOptionProps(e4),className:"core-combobox__option",children:r2?r2(e4,l2.query):g(m,{children:[h("span",{className:"core-combobox__label",children:h(Co,{text:e4.label,match:e4.highlight??l2.query})}),e4.description?h("span",{className:"core-combobox__description",children:e4.description}):null]})},e4.id));return e3.group?g("li",{role:"presentation",className:"core-combobox__section",children:[h("span",{id:`${_2}-${t3}`,className:"core-combobox__heading",children:e3.group}),h("ul",{role:"group","aria-labelledby":`${_2}-${t3}`,className:"core-combobox__group",children:n3})]},`g${t3}`):n3})}),b2&&!l2.open?h("p",{className:"core-combobox__note","data-status":l2.status,"aria-hidden":"true",children:b2}):null,h("span",{...l2.statusProps,className:"core-combobox__status",children:l2.statusText})]})}var To=["saved","assigned","event","archived","discarded","unavailable"],Eo=6e3;function Do(e2){let{locale:t2,timeZone:n2,searchTargets:r2,onIntent:i2,className:a2,style:c2}=e2,l2=e2.note&&typeof e2.note=="object"&&(e2.note.state==="unavailable"||typeof e2.note.body=="string")?e2.note:null,u2=s(),{run:p2,busy:_2,message:v2,available:b2}=vt(i2),[x2,S2]=f(null),C2=l2?.state&&To.includes(l2.state)?l2.state:"saved",w2=x2&&C2==="saved"?x2:C2,[T2,E2]=f(false),D2=d(null),O2=d(null),k2=d(null);o(()=>()=>{D2.current&&clearTimeout(D2.current),O2.current?.()},[]),o(()=>{T2&&k2.current?.focus({preventScroll:true})},[T2]);let[A2,j2]=f(false),[M2,N2]=f(false),P2=d(null);o(()=>{M2&&P2.current?.focus({preventScroll:true})},[M2]);let[F2,I2]=f(void 0),[L2,R2]=f(false),z2=d(null);if(o(()=>{x2&&z2.current?.focus({preventScroll:true})},[x2]),!l2)return null;if(C2==="unavailable")return h("div",{role:"group","aria-label":"Note",className:y("core-intent-card","core-quick-note-card","core-note-card",a2),style:c2,"data-state":"unavailable",children:h("p",{className:"core-note-card__unavailable",children:"This note is no longer available"})});let B2=w2==="saved"&&!T2,ee2=l2.createdAt&&!Number.isNaN(new Date(l2.createdAt).getTime())?new Intl.DateTimeFormat(t2,{weekday:"short",hour:"numeric",minute:"2-digit",timeZone:n2}).format(new Date(l2.createdAt)):"",te2=yt(l2.eventHref),V2=_2===null,H2=async e3=>{let{ok:t3}=await p2("assign",{targetId:e3.id,...A2?{keepPrivate:true}:{},...e3.data&&typeof e3.data=="object"&&"kind"in e3.data?{targetKind:e3.data.kind}:{}});t3&&(I2(e3.label),S2("assigned"),R2(false))},U2=async()=>{let{ok:e3}=await p2("make_event");e3&&S2("started")},W2=()=>{let e3=async()=>{O2.current=null,D2.current=null;let{ok:e4}=await p2("archive");E2(false),e4&&S2("archived")};O2.current=()=>void e3(),D2.current=setTimeout(()=>void e3(),Eo),E2(true)},G2=()=>{D2.current&&clearTimeout(D2.current),D2.current=null,O2.current=null,E2(false)},ne2=async()=>{let{ok:e3}=await p2("discard");N2(false),e3&&S2("discarded")},re2=async()=>{let{ok:e3}=await p2("ask_instead");e3&&S2("asked")},ie2=T2?"Archived":B2?"Saved as note":w2==="asked"?"Sent to the assistant instead":w2==="assigned"?`Assigned${F2??l2.assignedToName?` to ${F2??l2.assignedToName}`:""}`:w2==="event"?"Made into an event":w2==="started"?"Event started below":w2==="discarded"?"Discarded":"Archived";return g("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${u2}-status`,className:y("core-intent-card","core-quick-note-card","core-note-card",a2),style:c2,"data-state":T2?"archived":w2,"aria-busy":_2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${u2}-status`,className:"core-intent-card__eyebrow",children:ie2}),h("p",{className:"core-note-card__body",children:l2.body}),g("span",{className:"core-note-card__private",children:["Private",ee2?` · saved ${ee2}`:""]})]}),w2==="event"&&te2?h("a",{className:"core-note-card__go",href:te2,children:"Go to event"}):null,v2?h("p",{className:"core-intent-card__message",role:"alert",children:v2}):null,T2?h("div",{className:"core-intent-card__actions",children:h("button",{ref:k2,type:"button",className:"core-intent-card__button",onClick:G2,children:"Undo"})}):null,B2?g(m,{children:[L2&&r2?g("div",{className:"core-note-card__picker",children:[h(wo,{label:"Assign to a client or project",placeholder:"Search clients and projects",loadOptions:r2,onSelect:e3=>void H2(e3),defaultOpen:false}),g("label",{className:"core-note-card__private-check",children:[h("input",{type:"checkbox",checked:A2,disabled:!V2,onChange:e3=>j2(e3.target.checked)}),h("span",{children:"Keep this note private"})]})]}):null,h("p",{className:"core-intent-card__does",id:`${u2}-does`,children:(e3=>b2?e3:_t)("Assign moves this note to the client or project you choose. Make event turns it into an event. Archive takes it out of Needs me, and you can undo it for a few seconds. Discard deletes it for good.")}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!b2||!r2||!V2,"aria-expanded":L2,"aria-describedby":`${u2}-does`,onClick:()=>R2(e3=>!e3),children:"Assign"}),h("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"aria-describedby":`${u2}-does`,onClick:()=>void U2(),children:"Make event"}),h("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"aria-describedby":`${u2}-does`,onClick:W2,children:"Archive"}),h("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"aria-describedby":`${u2}-does`,onClick:()=>N2(true),children:"Discard"})]}),M2?g("div",{className:"core-note-card__confirm",role:"group","aria-label":"Discard this note",children:[h("p",{className:"core-intent-card__does",children:"Discard this note? It can’t be brought back from here."}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!V2,onClick:()=>void ne2(),children:_2==="discard"?"Discarding…":"Yes, discard"}),h("button",{ref:P2,type:"button",className:"core-intent-card__button",disabled:!V2,onClick:()=>N2(false),children:"Cancel"})]})]}):null,h("button",{type:"button",className:"core-note-card__instead",disabled:!b2||!V2,onClick:()=>void re2(),children:"Ask the assistant instead"})]}):null]})}var Oo=[15,30,45,60,90],ko=30,Ao=200,jo=3,Mo=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`;function No(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,c2=X(e2.subjectName),l2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""&&e3.kind!=="record"),u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},p2=s(),{run:_2,busy:v2,message:b2,available:x2}=vt(r2),S2=Pa(u2.startsAt,n2),[C2,w2]=f(l2.find(e3=>e3.id===u2.typeId)?.id??l2[0]?.id??""),[T2,E2]=f((typeof u2.title=="string"?u2.title:"").slice(0,Ao)),D2=n2??lt(),O2=!(typeof u2.startOn=="string"&&$.test(u2.startOn))&&!S2,[k2,A2]=f(typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:S2?.date??Ra(D2)),[j2,M2]=f(S2?.time??""),[N2,P2]=f(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):ko)),F2=fo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links,attendeeIds:u2.attendeeIds}),I2=$a(l2.find(e3=>e3.id===C2)),L2=to(I2),[R2,z2]=f(false),[B2,ee2]=f(null),te2=d(null),V2=d(null),H2=d(false);o(()=>{if(H2.current)return;if(O2){A2(Ra(D2));return}if(!u2.startsAt)return;let e3=Pa(u2.startsAt,n2);e3&&(A2(e3.date),M2(e3.time))},[u2.startsAt,n2,O2,D2]),o(()=>{R2&&V2.current?.focus({preventScroll:true})},[R2]),o(()=>{B2&&te2.current?.focus({preventScroll:true})},[B2]);let U2=B2??(e2.booked&&typeof e2.booked=="object"?e2.booked:null);if(U2){let e3=yt(U2.href);return g("section",{ref:te2,tabIndex:-1,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-book-event-card",i2),style:a2,"data-state":"booked",children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:["Booked",c2?` · ${c2}`:""]}),h("p",{className:"core-intent-card__title",children:U2.name??"Booked"}),U2.when?h("span",{className:"core-book-event-card__when",children:U2.when}):null]}),e3?h("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}if(l2.length===0)return h("p",{className:y("core-intent-card","core-book-event-card","core-book-event-card__empty",i2),style:a2,children:"There’s nothing you can book here."});let W2=l2.find(e3=>e3.id===C2),G2=x2&&v2===null,ne2=x2&&!!c2&&!!W2&&$.test(k2),re2=x2?c2?k2?"":"Choose a day to book.":"Choose whose file this goes in first.":_t,ie2=$.test(k2)&&/^\d{2}:\d{2}$/.test(j2),ae2=ie2?La(k2,j2,D2):void 0,K2=Number(N2),oe2=ae2?new Date(ae2).getTime()<Date.now():$.test(k2)?k2<new Intl.DateTimeFormat("en-CA").format(new Date):false,se2=[...new Set([...Oo,...Number.isInteger(K2)&&K2>0?[K2]:[]])].sort((e3,t3)=>e3-t3),ce2=F2.picked,le2=`${Ma(k2,t2)}${ie2?`, ${Na(j2,t2)}`:""}`,q2=ie2?` (${Mo(K2||ko)})`:" (all day)",ue2=ce2.length?` With ${ce2.slice(0,jo).map(e3=>e3.name).join(", ")}${ce2.length>jo?` and ${ce2.length-jo} more`:""}.`:"",de2=F2.assignee,fe2=`Book this? It goes on the schedule for ${le2}${q2}.${ue2}${de2?` Assigned to ${de2.name}.`:""}${ro(L2.value)}${e2.invitesSent===true&&ce2.length?" They are invited.":""}`,pe2=async()=>{if(!ne2||v2!==null||!W2)return;let e3={typeId:W2.id};T2.trim()&&(e3.title=T2.trim()),e3.tzid=D2,ae2?(e3.startsAt=ae2,e3.durationMin=K2>0?K2:ko):e3.startOn=k2,L2.value&&(e3.audience=L2.value),F2.write(e3);let{ok:t3,result:n3}=await _2("book_event",e3);z2(false),t3&&ee2({name:T2.trim()||W2.name,when:le2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},me2=e3=>{e3.preventDefault(),ne2&&v2===null&&z2(true)},he2=e3=>t3=>{H2.current=true,e3(t3)};return g("form",{tabIndex:-1,ref:te2,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-book-event-card",i2),style:a2,"data-state":R2?"confirming":"proposed",onSubmit:me2,"aria-busy":v2!==null||void 0,children:[h("div",{className:"core-intent-card__head",children:g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:["Book a meeting",c2?` · ${c2}`:""]})}),g("div",{className:"core-intent-card__row",children:[l2.length>1?g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Type"}),h("select",{value:C2,disabled:!G2||R2,onChange:e3=>w2(e3.target.value),children:l2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))})]}):null,g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Title (optional)"}),h("input",{value:T2,maxLength:Ao,readOnly:!G2||R2,placeholder:W2?.name,onChange:e3=>E2(e3.target.value)})]})]}),g("div",{className:"core-intent-card__row",children:[g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Day"}),h("input",{type:"date",value:k2,required:true,readOnly:!G2||R2,onChange:e3=>he2(A2)(e3.target.value)})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Time (optional)"}),h("input",{type:"time",value:k2?j2:"",readOnly:!G2||R2,disabled:!k2,onChange:e3=>he2(M2)(e3.target.value)})]})]}),h("div",{className:"core-intent-card__row",children:g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"How long"}),h("select",{value:N2,disabled:!G2||R2||!ie2,onChange:e3=>P2(e3.target.value),children:se2.map(e3=>h("option",{value:e3,children:Mo(e3)},e3))})]})}),h(po,{extras:F2,disabled:!G2||R2}),h(io,{id:p2,audiences:I2,value:L2.value,onChange:L2.setValue,subjectName:c2,disabled:!G2||R2}),oe2&&!R2?h("p",{className:"core-book-event-card__note",children:"That time has passed."}):null,b2?h("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,R2?g(m,{children:[h("p",{className:"core-intent-card__does",id:`${p2}-does`,role:"group","aria-label":"Confirm booking",children:fe2}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void pe2(),children:v2==="book_event"?"Booking…":"Yes, book"}),h("button",{ref:V2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>z2(false),children:"Cancel"})]},"confirm-actions")]}):g(m,{children:[re2?h("p",{className:"core-intent-card__does",id:`${p2}-does`,children:re2}):null,h("div",{className:"core-intent-card__actions",children:h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!ne2||v2!==null,"aria-describedby":re2?`${p2}-does`:void 0,children:"Book"})},"book-actions")]})]})}var Po=[15,30,45,60,90],Fo=30,Io=200,Lo=200,Ro=e2=>e2%60==0&&e2>=60?`${e2/60} h`:`${e2} min`,zo={title:"title",name:"title",startsAt:"when",startOn:"when",date:"when",time:"when",durationMin:"duration",assigneeId:"assignee",location:"location",audience:"audience"};function Bo(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,c2=X(e2.subjectName),l2=e2.current&&typeof e2.current=="object"?e2.current:{},u2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},p2=s(),{run:_2,busy:v2,message:b2,available:x2}=vt(r2),S2=n2??l2.tzid??lt(),C2=Pa(l2.startsAt,S2),w2=C2?.date??(typeof l2.startOn=="string"&&$.test(l2.startOn)?l2.startOn:""),T2=C2?.time??"",E2=typeof l2.durationMin=="number"&&l2.durationMin>0?Math.round(l2.durationMin):Fo,D2=(typeof l2.name=="string"?l2.name:"").slice(0,Io),O2=(Array.isArray(e2.assignees)?e2.assignees:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"),k2=l2.assigneeId?O2.find(e3=>e3.id===l2.assigneeId)?.id??"":O2.find(e3=>e3.name===l2.assigneeName)?.id??"",A2=Pa(u2.startsAt,S2),j2=typeof u2.startOn=="string"&&$.test(u2.startOn)?u2.startOn:void 0,[M2,N2]=f(typeof u2.title=="string"?u2.title.slice(0,Io):D2),[P2,F2]=f(A2?.date??j2??w2),[I2,L2]=f(A2?A2.time:j2?"":T2),R2=(typeof l2.location=="string"?l2.location:"").slice(0,Lo),[z2,B2]=f(typeof u2.location=="string"?u2.location.slice(0,Lo):R2),[ee2,te2]=f(String(typeof u2.durationMin=="number"&&u2.durationMin>0?Math.round(u2.durationMin):E2)),V2=fo({assignees:O2,assigneeId:typeof u2.assigneeId=="string"?u2.assigneeId:k2}),H2=$a((Array.isArray(e2.types)?e2.types:[]).find(e3=>e3&&typeof e3=="object"&&(e3.id===l2.typeId||!l2.typeId&&e3.name===l2.typeName))),U2=to(H2,H2.includes(l2.audience)?l2.audience:"team"),[W2,G2]=f(false),[ne2,re2]=f(null),ie2=d(null),ae2=d(null);o(()=>{W2&&ae2.current?.focus({preventScroll:true})},[W2]),o(()=>{ne2&&ie2.current?.focus({preventScroll:true})},[ne2]);let K2=ne2??(e2.updated&&typeof e2.updated=="object"?{kind:"updated",...e2.updated}:e2.cancelled&&typeof e2.cancelled=="object"?{kind:"cancelled",...e2.cancelled}:e2.assigned&&typeof e2.assigned=="object"?{kind:"assigned",...e2.assigned}:l2.status==="cancelled"?{kind:"cancelled",name:l2.name}:null);if(K2){let e3=K2.kind==="updated"?yt(K2.href):void 0;return g("section",{ref:ie2,tabIndex:-1,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":K2.kind,children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:[K2.kind==="updated"?"Updated":K2.kind==="assigned"?"Assigned to you":"Cancelled",c2?` · ${c2}`:""]}),h("p",{className:y("core-intent-card__title",K2.kind==="cancelled"&&"core-edit-event-card__struck"),children:K2.name??l2.name??"Done"})]}),e3?h("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let oe2=!(x2&&v2===null)||W2,se2=$.test(P2)&&/^\d{2}:\d{2}$/.test(I2),ce2=Number(ee2),le2=[...new Set([...Po,...Number.isInteger(ce2)&&ce2>0?[ce2]:[],E2])].sort((e3,t3)=>e3-t3),q2=new Set((Array.isArray(e2.changed)?e2.changed:[]).map(e3=>zo[e3]).filter(Boolean)),ue2=P2!==w2||I2!==T2,de2=se2&&ce2!==E2,fe2=V2.assigneeId!==k2,pe2=U2.value!==void 0&&U2.value!==(H2.includes(l2.audience)?l2.audience:"team"),me2=M2.trim()!==D2.trim(),he2=z2.trim()!==R2.trim(),J2={title:me2||q2.has("title"),when:ue2||q2.has("when"),duration:de2||q2.has("duration"),location:he2||q2.has("location"),assignee:fe2||q2.has("assignee"),audience:pe2||q2.has("audience")},ge2=me2||ue2||de2||he2||fe2||pe2,_e2=x2&&!!$.test(P2)&&M2.trim()!==""&&ge2,ve2=x2?M2.trim()?$.test(P2)?ge2?"":"Change something to save it.":"Choose a day.":"The event needs a title.":_t,ye2=w2?`${Ma(w2,t2)}${T2?`, ${Na(T2,t2)}`:" (all day)"}`:"No time set",be2=(e3,t3,n3)=>J2[e3]?g("span",{className:"core-edit-event-card__was",id:n3,children:[h("span",{className:"core-edit-event-card__was-label",children:"Was"})," ",t3]}):null,xe2=e3=>y("core-intent-card__field",J2[e3]&&"core-edit-event-card__changed"),Se2=async()=>{if(!_e2||v2!==null)return;let e3={};me2&&(e3.title=M2.trim()),ue2&&(S2!==l2.tzid&&(e3.tzid=S2),se2?e3.startsAt=La(P2,I2,S2):e3.startOn=P2),de2&&(e3.durationMin=ce2>0?ce2:Fo),he2&&(e3.location=z2.trim()),fe2&&(e3.assigneeId=V2.assigneeId===""?null:V2.assigneeId),pe2&&U2.value&&(e3.audience=U2.value);let{ok:t3,result:n3}=await _2("update_event",e3);t3&&re2({kind:"updated",name:M2.trim()||D2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})},Ce2=!l2.assigneeId&&!l2.assigneeName,we2=async()=>{if(v2!==null)return;let{ok:e3}=await _2("assign_self");e3&&re2({kind:"assigned",name:D2})},Te2=async()=>{if(v2!==null)return;let{ok:e3}=await _2("cancel_event");G2(false),e3&&re2({kind:"cancelled",name:D2})};return g("form",{tabIndex:-1,ref:ie2,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-book-event-card","core-edit-event-card",i2),style:a2,"data-state":W2?"cancelling":"editing",onSubmit:e3=>{e3.preventDefault(),_e2&&v2===null&&Se2()},"aria-busy":v2!==null||void 0,children:[h("div",{className:"core-intent-card__head",children:g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:["Change a meeting",c2?` · ${c2}`:""]})}),g("div",{className:"core-intent-card__row",children:[l2.typeName?g("div",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Type"}),h("span",{className:"core-edit-event-card__fixed",children:l2.typeName})]}):null,g("div",{className:xe2("title"),"data-changed":J2.title?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-title`,children:"Title"}),h("input",{id:`${p2}-title`,value:M2,maxLength:Io,readOnly:oe2,placeholder:l2.typeName,"aria-describedby":J2.title?`${p2}-title-was`:void 0,onChange:e3=>N2(e3.target.value)}),be2("title",D2||"No title",`${p2}-title-was`)]})]}),g("div",{className:"core-intent-card__row",children:[g("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-day`,children:"Day"}),h("input",{id:`${p2}-day`,type:"date",value:P2,required:true,readOnly:oe2,"aria-describedby":J2.when?`${p2}-when-was`:void 0,onChange:e3=>F2(e3.target.value)}),be2("when",ye2,`${p2}-when-was`)]}),g("div",{className:xe2("when"),"data-changed":J2.when?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-time`,children:"Time (optional)"}),h("input",{id:`${p2}-time`,type:"time",value:P2?I2:"",readOnly:oe2,disabled:!P2,"aria-describedby":J2.when?`${p2}-when-was`:void 0,onChange:e3=>L2(e3.target.value)})]})]}),h("div",{className:"core-intent-card__row",children:g("div",{className:xe2("duration"),"data-changed":J2.duration?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-length`,children:"How long"}),h("select",{id:`${p2}-length`,value:ee2,disabled:oe2||!se2,"aria-describedby":J2.duration?`${p2}-duration-was`:void 0,onChange:e3=>te2(e3.target.value),children:le2.map(e3=>h("option",{value:e3,children:Ro(e3)},e3))}),be2("duration",T2?Ro(E2):"All day",`${p2}-duration-was`)]})}),h("div",{className:"core-intent-card__row",children:g("div",{className:xe2("location"),"data-changed":J2.location?"":void 0,children:[h("label",{className:"core-intent-card__label",htmlFor:`${p2}-location`,children:"Location (optional)"}),h("input",{id:`${p2}-location`,value:z2,maxLength:Lo,readOnly:oe2,"aria-describedby":J2.location?`${p2}-location-was`:void 0,onChange:e3=>B2(e3.target.value)}),be2("location",R2||"No location",`${p2}-location-was`)]})}),g("div",{className:y(J2.assignee&&"core-edit-event-card__changed-block"),"data-changed":J2.assignee?"":void 0,children:[h(po,{extras:V2,disabled:oe2}),be2("assignee",l2.assigneeName??"No one")]}),g("div",{className:y(J2.audience&&"core-edit-event-card__changed-block"),"data-changed":J2.audience?"":void 0,children:[h(io,{id:p2,audiences:H2,value:U2.value,onChange:U2.setValue,subjectName:c2,disabled:oe2}),be2("audience",l2.audience?no(l2.audience,c2):"")]}),b2?h("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,W2?g(m,{children:[h("p",{className:"core-intent-card__does",id:`${p2}-does`,role:"group","aria-label":"Confirm cancelling",children:"Cancel this event? It can’t be undone from here."}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void Te2(),children:v2==="cancel_event"?"Cancelling…":"Yes, cancel the event"}),h("button",{ref:ae2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>G2(false),children:"Keep it"})]},"cancel-actions")]}):g(m,{children:[ve2?h("p",{className:"core-intent-card__does",id:`${p2}-does`,children:ve2}):null,g("div",{className:"core-intent-card__actions",children:[h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!_e2||v2!==null,"aria-describedby":ve2?`${p2}-does`:void 0,children:v2==="update_event"?"Saving…":"Save changes"}),Ce2?h("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>void we2(),children:v2==="assign_self"?"Assigning…":"Assign to me"}):null,h("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,onClick:()=>G2(true),children:"Cancel the event"})]},"save-actions")]})]})}var Vo=4e3;function Ho(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=X(e2.eventName),a2=X(e2.subjectName),c2=s(),{run:l2,busy:u2,message:p2,available:m2}=vt(t2),[_2,v2]=f((typeof e2.body=="string"?e2.body:"").slice(0,Vo)),[b2,x2]=f(false),[S2,C2]=f(null),w2=d(null);o(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=S2??(e2.noted&&typeof e2.noted=="object"?e2.noted:null);if(T2){let e3=yt(T2.href);return g("section",{ref:w2,tabIndex:-1,"aria-labelledby":`${c2}-status`,className:y("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"noted",children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${c2}-status`,className:"core-intent-card__eyebrow",children:["Noted",i2?` · ${i2}`:""]}),h("p",{className:"core-intent-card__title",children:T2.name??i2??"Noted"})]}),e3?h("a",{className:"core-book-event-card__go",href:e3,children:"Go to event"}):null]})}let E2=m2&&u2===null,D2=m2&&!!i2&&_2.trim()!=="",O2=m2?i2?_2.trim()===""?"Write the note first.":"":"Choose the event first.":_t,k2=async()=>{if(!D2||u2!==null)return;let e3={body:_2.trim()};b2&&(e3.audience="client");let{ok:t3,result:n3}=await l2("add_note",e3);t3&&C2({name:i2,href:n3&&typeof n3=="object"?n3.data?.href:void 0})};return g("form",{tabIndex:-1,ref:w2,"aria-labelledby":`${c2}-status`,className:y("core-intent-card","core-book-event-card","core-event-note-card",n2),style:r2,"data-state":"proposed",onSubmit:e3=>{e3.preventDefault(),k2()},"aria-busy":u2!==null||void 0,children:[h("div",{className:"core-intent-card__head",children:g("span",{id:`${c2}-status`,className:"core-intent-card__eyebrow",children:["Add a note",i2?` · ${i2}`:""]})}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Note"}),h("textarea",{value:_2,rows:4,maxLength:Vo,readOnly:!E2,onChange:e3=>v2(e3.target.value)})]}),a2?g("label",{className:"core-intent-card__person",children:[h("input",{type:"checkbox",checked:b2,disabled:!E2,onChange:e3=>x2(e3.target.checked)}),g("span",{className:"core-intent-card__person-name",children:["Share with ",a2]})]}):null,h("p",{className:"core-intent-card__does",id:`${c2}-does`,children:O2||(b2?`${a2} will see this note.`:"Only staff will see this note.")}),p2?h("p",{className:"core-intent-card__message",role:"alert",children:p2}):null,h("div",{className:"core-intent-card__actions",children:h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!D2||u2!==null,"aria-describedby":`${c2}-does`,children:u2==="add_note"?"Adding…":"Add note"})},"note-actions")]})}var Uo=["proposed","created","done"],Wo=200;function Go(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,c2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>!!e3&&typeof e3=="object"&&typeof e3.id=="string"&&typeof e3.name=="string"&&e3.name.trim()!==""),l2=X(e2.subjectName),u2=e2.task&&typeof e2.task=="object"&&typeof e2.task.title=="string"?e2.task:null,p2=s(),{run:_2,busy:v2,message:b2,available:x2}=vt(r2),[S2,C2]=f((u2?.title??"").slice(0,Wo)),w2=Pa(u2?.dueAt,n2),T2=n2??lt(),E2=!(u2?.dueOn&&$.test(u2.dueOn))&&!w2,[D2,O2]=f(u2?.dueOn&&$.test(u2.dueOn)?u2.dueOn:w2?.date??Ra(T2)),[k2,A2]=f(w2?.time??""),j2=d(false);o(()=>{if(j2.current)return;if(E2){O2(Ra(T2));return}if(!u2?.dueAt)return;let e3=Pa(u2.dueAt,n2);e3&&(u2.dueOn&&$.test(u2.dueOn)||O2(e3.date),A2(e3.time))},[u2?.dueAt,u2?.dueOn,n2,E2,T2]);let M2=fo({people:e2.people,assignees:e2.assignees,linkCandidates:e2.linkCandidates,links:e2.links}),[N2,P2]=f(c2.find(e3=>e3.id===u2?.typeId)?.id??c2[0]?.id??""),F2=$a(c2.find(e3=>e3.id===N2)),I2=to(F2),[L2,R2]=f(null),z2=u2?.state&&Uo.includes(u2.state)?u2.state:"proposed",B2=L2&&Uo.indexOf(L2)>Uo.indexOf(z2)?L2:z2,ee2=d(null),te2=d(null),[V2,H2]=f(false);if(o(()=>{V2&&te2.current?.focus({preventScroll:true})},[V2]),o(()=>{L2&&ee2.current?.focus({preventScroll:true})},[L2]),!u2)return null;let U2=B2==="proposed"&&x2&&v2===null,W2=x2&&!!l2&&S2.trim()!=="",G2=async e3=>{if(e3.preventDefault(),!W2||v2!==null)return;let t3=D2||Ra(T2),n3=k2?La(t3,k2,T2):void 0,r3={title:S2.trim(),...c2.length>0&&N2?{typeId:N2}:{},dueOn:t3,...n3?{dueAt:n3}:{},...I2.value?{audience:I2.value}:{},tzid:T2};M2.write(r3);let{ok:i3}=await _2("log_event",r3);i3&&R2("created")},ne2=async()=>{let{ok:e3}=await _2("complete");H2(false),e3&&R2("done")},re2=B2==="proposed"?{date:D2||Ra(T2),time:k2}:{date:u2.dueOn&&$.test(u2.dueOn)?u2.dueOn:Pa(u2.dueAt,n2)?.date??"",time:Pa(u2.dueAt,n2)?.time??""},ie2=[re2.date===Ra(T2)?"today":Ma(re2.date,t2),re2.date&&re2.time?Na(re2.time,t2):""].filter(Boolean).join(", "),ae2=B2==="proposed"?"Task · suggested":B2==="done"?"Task · done":"Task",K2=B2==="proposed"?W2?`Create task adds this to ${l2}’s tasks.`:x2?l2?"":"Choose whose file this goes in first.":_t:B2==="created"?V2?"Mark this task done? It can’t be reopened from here.":"Mark done closes this task.":"";return g("form",{ref:ee2,tabIndex:-1,"aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-task-card",i2),style:a2,"data-state":B2,onSubmit:e3=>void G2(e3),"aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[g("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:[ae2,l2?` · ${l2}`:""]}),B2==="proposed"&&c2.length>1?g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Type"}),h("select",{value:N2,disabled:!U2,onChange:e3=>P2(e3.target.value),children:c2.map(e3=>h("option",{value:e3.id,children:e3.name},e3.id))})]}):null,B2==="proposed"?g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"What needs doing"}),h("input",{value:S2,maxLength:Wo,readOnly:!U2,onChange:e3=>C2(e3.target.value),required:true})]}):h("p",{className:"core-intent-card__title core-task-card__title","data-done":B2==="done"?"":void 0,children:u2.title})]}),B2==="proposed"?g("div",{className:"core-intent-card__row",children:[g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Due"}),h("input",{type:"date",value:D2,readOnly:!U2,onChange:e3=>(j2.current=true,O2(e3.target.value))})]}),g("label",{className:"core-intent-card__field",children:[h("span",{className:"core-intent-card__label",children:"Time (optional)"}),h("input",{type:"time",value:D2?k2:"",readOnly:!U2,disabled:!D2,onChange:e3=>(j2.current=true,A2(e3.target.value))})]})]}):null,B2==="proposed"?h(po,{extras:M2,disabled:!U2}):null,B2==="proposed"?h(io,{id:p2,audiences:F2,value:I2.value,onChange:I2.setValue,subjectName:l2,disabled:!U2}):null,h("p",{className:"core-task-card__meta",children:[ie2?`Due ${ie2}`:"",u2.assigneeName?`For ${u2.assigneeName}`:""].filter(Boolean).join(" · ")||(B2==="proposed"?"":"No due date")}),b2?h("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,K2?h("p",{className:"core-intent-card__does",id:`${p2}-does`,children:K2}):null,B2==="done"?null:h("div",{className:"core-intent-card__actions",children:B2==="proposed"?h("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!W2||v2!==null,"aria-describedby":`${p2}-does`,children:v2==="log_event"?"Creating…":"Create task"}):V2?g(m,{children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:v2!==null,onClick:()=>void ne2(),children:v2==="complete"?"Saving…":"Yes, mark done"}),h("button",{ref:te2,type:"button",className:"core-intent-card__button",disabled:v2!==null,onClick:()=>H2(false),children:"Cancel"})]}):h("button",{type:"button",className:"core-intent-card__button",disabled:!x2||v2!==null,"aria-describedby":`${p2}-does`,onClick:()=>H2(true),children:"Mark done"})})]})}function Ko(e2){let{locale:t2,timeZone:n2,onIntent:r2,className:i2,style:a2}=e2,c2=X(e2.scopeName),l2=s(),{run:u2,busy:p2,message:_2,available:v2}=vt(r2),[b2,x2]=f(null),S2=d(null);if(o(()=>{b2&&S2.current?.focus({preventScroll:true})},[b2]),!c2)return null;let C2=e2.pointer&&typeof e2.pointer=="object"?e2.pointer:void 0,w2="";if(C2?.kind==="conversation"){let e3=typeof C2.at=="string"?new Date(C2.at):null;w2=e3&&!Number.isNaN(e3.getTime())?`Conversation · ${new Intl.DateTimeFormat(t2,{month:"short",day:"numeric",timeZone:n2}).format(e3)}`:"Conversation"}else C2?.kind==="event"&&(w2=X(C2.name)??"Event");let T2=p2===null,E2=async e3=>{let{ok:t3}=await u2(e3);t3&&x2(e3==="dismiss"?"dismissed":"continued")},D2=b2==="continued"?"Picked up":b2==="dismissed"?"Dismissed":"Pick up where you left off";return g("div",{ref:S2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:y("core-intent-card","core-handover-card",i2),style:a2,"data-state":b2??(v2?"offered":"display"),"aria-busy":p2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:D2}),h("p",{className:"core-intent-card__title",children:c2}),w2?h("span",{className:"core-handover-card__where",children:w2}):null]}),_2?h("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,b2?null:g(m,{children:[h("p",{className:"core-intent-card__does",id:`${l2}-does`,children:v2?`Continue opens your earlier conversation about ${c2}. Dismiss hides this.`:_t}),g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("handover_continue"),children:p2==="handover_continue"?"Opening…":"Continue"}),h("button",{type:"button",className:"core-intent-card__button",disabled:!v2||!T2,"aria-describedby":`${l2}-does`,onClick:()=>void E2("dismiss"),children:"Dismiss"})]})]})]})}var qo=12,Jo=(e2,t2=200)=>typeof e2=="string"?e2.replace(/\s+/g," ").trim().slice(0,t2):"";function Yo(e2){let{typicalTime:t2,typicalCost:n2,costCap:r2,onIntent:i2,className:a2,style:c2}=e2,l2=X(e2.processName),u2=X(e2.subjectName),p2=s(),{run:_2,busy:v2,message:b2,available:x2}=vt(i2),[S2,C2]=f(false),w2=d(null);if(o(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]),!l2)return null;let T2=Jo(e2.description),E2=(Array.isArray(e2.needs)?e2.needs:[]).filter(e3=>e3&&typeof e3=="object"&&Jo(e3.label)).slice(0,qo),D2=[t2&&`Typical time: ${Jo(t2,60)}`,n2&&`Typical cost: ${Jo(n2,60)}`,r2&&`Cost cap: ${Jo(r2,60)}`].filter(Boolean).join(" · "),O2=e2.running&&typeof e2.running=="object"?e2.running:null,k2=yt(O2?.href),A2=x2&&!!u2,j2=x2?u2?"":"Choose who this is for before starting.":_t,M2=S2?"Started":O2?"Running":"Start a service",N2=async()=>{if(!A2||v2!==null)return;let{ok:e3}=await _2("start_process");e3&&C2(true)};return g("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-start-process-card",a2),style:c2,"data-state":S2?"started":O2?"running":x2?"offered":"display","aria-busy":v2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:M2}),h("p",{className:"core-intent-card__title",children:l2}),u2?g("span",{className:"core-start-process-card__for",children:["For ",u2]}):null]}),T2?h("p",{className:"core-start-process-card__description",children:T2}):null,E2.length>0?g("div",{className:"core-start-process-card__needs",children:[h("span",{className:"core-start-process-card__label",children:"What it needs"}),h("ul",{children:E2.map((e3,t3)=>g("li",{"data-have":e3.have===true?"":void 0,children:[h("span",{className:"core-start-process-card__mark","aria-hidden":"true"}),h("span",{children:Jo(e3.label)}),h("span",{className:"core-start-process-card__have",children:e3.have===true?"Have":"Needed"})]},t3))})]}):null,D2?h("p",{className:"core-start-process-card__meta",children:D2}):null,b2?h("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,S2?h("p",{className:"core-intent-card__does",children:"Started. Progress will arrive in the conversation."}):O2?k2?h("a",{className:"core-start-process-card__go",href:k2,children:"Open"}):null:g(m,{children:[h("p",{className:"core-intent-card__does",id:`${p2}-does`,children:A2?`Start begins ${l2} for ${u2}. Nothing is shared with ${u2} until you choose to share it.`:j2}),h("div",{className:"core-intent-card__actions",children:h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!A2||v2!==null,"aria-describedby":`${p2}-does`,onClick:()=>void N2(),children:v2==="start_process"?"Starting…":"Start"})})]})]})}var Xo=12,Zo=8,Qo=600;function $o(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=s(),{run:a2,busy:c2,message:l2,available:u2}=vt(t2),[p2,_2]=f({}),[v2,b2]=f({}),[x2,S2]=f(null),C2=d(null),w2=d(false);o(()=>{w2.current&&C2.current?.focus({preventScroll:true})},[p2]);let T2=new Set,E2=(Array.isArray(e2.parts)?e2.parts:[]).filter(e3=>!e3||typeof e3!="object"||typeof e3.id!="string"||typeof e3.text!="string"||!e3.text.trim()||T2.has(e3.id)?false:(T2.add(e3.id),true)).slice(0,Xo);if(E2.length===0)return null;let D2=e3=>(Array.isArray(e3.matches)?e3.matches:[]).filter(e4=>e4&&typeof e4.id=="string"&&X(e4.name)&&(e4.kind==="client"||e4.kind==="project")).slice(0,Zo),O2=e3=>p2[e3.id]??(e3.state==="assigned"||e3.state==="dropped"?{state:e3.state,name:X(e3.assignedToName)}:null),k2=E2.filter(e3=>!O2(e3)),A2=k2.length===0,j2=async(e3,t3)=>{S2(e3.id);let{ok:n3}=await a2("confirm_part",{partId:e3.id,targetId:t3.id,targetKind:t3.kind});n3&&(w2.current=true,_2(n4=>({...n4,[e3.id]:{state:"assigned",name:X(t3.name)}})))},M2=async e3=>{S2(e3.id);let{ok:t3}=await a2("drop_part",{partId:e3.id});t3&&(w2.current=true,_2(t4=>({...t4,[e3.id]:{state:"dropped"}})))},N2=c2===null;return g("div",{ref:C2,tabIndex:-1,role:"group","aria-labelledby":`${i2}-status`,className:y("core-intent-card","core-note-split-card",n2),style:r2,"data-state":A2?"sorted":u2?"open":"display","aria-busy":c2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${i2}-status`,className:"core-intent-card__eyebrow",children:A2?"Note sorted":"Note to sort"}),h("p",{className:"core-intent-card__title",children:A2?"Every part is sorted":`${k2.length} of ${E2.length} ${E2.length===1?"part":"parts"} to sort`})]}),h("ol",{className:"core-note-split-card__parts",children:E2.map((e3,t3)=>{let n3=O2(e3),r3=D2(e3),a3=v2[e3.id]??(r3.length===1?r3[0].id:""),o2=r3.find(e4=>e4.id===a3),s2=e3.text.length>Qo?`${e3.text.slice(0,599)}…`:e3.text,d2=`Part ${t3+1}`;return g("li",{className:"core-note-split-card__part","data-state":n3?.state??"open",children:[h("span",{className:"core-note-split-card__label",children:d2}),h("p",{className:"core-note-split-card__text",children:s2}),n3?h("p",{className:"core-note-split-card__result",children:n3.state==="dropped"?"Dropped":`Assigned${n3.name?` to ${n3.name}`:""}`}):g(m,{children:[r3.length===0?h("p",{className:"core-note-split-card__hint",children:"No client or project matches. You can drop this part."}):r3.length===1?g("p",{className:"core-note-split-card__hint",children:["Looks like ",h("strong",{children:X(r3[0].name)}),r3[0].detail?` · ${X(r3[0].detail)}`:"",". Confirm it, or drop the part."]}):g("fieldset",{className:"core-note-split-card__choices",disabled:!u2||!N2,children:[g("legend",{className:"core-note-split-card__hint",children:[r3.length," match: choose who this is for."]}),r3.map(t4=>g("label",{className:"core-note-split-card__choice",children:[h("input",{type:"radio",name:`${i2}-${e3.id}`,value:t4.id,checked:a3===t4.id,onChange:()=>b2(n4=>({...n4,[e3.id]:t4.id}))}),g("span",{children:[h("span",{className:"core-note-split-card__name",children:X(t4.name)}),h("span",{className:"core-note-split-card__detail",children:[t4.kind==="project"?"Project":"Client",X(t4.detail)].filter(Boolean).join(" · ")})]})]},t4.id))]}),x2===e3.id&&l2?h("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,g("div",{className:"core-intent-card__actions",children:[r3.length>0?h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!u2||!N2||!o2,"aria-label":`Confirm ${d2}${o2?` for ${X(o2.name)}`:""}`,onClick:()=>o2&&void j2(e3,o2),children:c2==="confirm_part"&&x2===e3.id?"Confirming…":"Confirm"}):null,h("button",{type:"button",className:"core-intent-card__button",disabled:!u2||!N2,"aria-label":`Drop ${d2}`,onClick:()=>void M2(e3),children:"Drop"})]})]})]},e3.id)})}),A2?null:h("p",{className:"core-intent-card__does",children:u2?"Confirm sends that part to the client or project you choose. Drop leaves it out. The original note stays as the record.":_t})]})}var es=20;function ts(e2){let{onIntent:t2,onCancel:n2,className:r2,style:i2}=e2,a2=e2.mode==="withdraw"?"withdraw":"share",c2=X(e2.clientName),l2=s(),{run:u2,busy:p2,message:_2,available:v2}=vt(t2),[b2,x2]=f(false),[S2,C2]=f(false),w2=d(null);o(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&typeof e3=="object"&&X(e3.name)).slice(0,es);if(T2.length===0)return null;let E2=a2==="share",D2=v2&&!!c2&&(!E2||b2),O2=v2?c2?E2&&!b2?"Tick “I’ve reviewed this” to share.":"":"Choose who this is for before sending.":_t,k2=E2?"Share":"Stop sharing",A2=S2?E2?"Shared":"Sharing stopped":E2?"Share for approval":"Stop sharing",j2=async()=>{if(!D2||p2!==null)return;let{ok:e3}=await u2(E2?"share":"withdraw",E2?{reviewed:true}:void 0);e3&&C2(true)};return g("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${l2}-status`,className:y("core-intent-card","core-share-approval-card",r2),style:i2,"data-state":S2?"done":v2?"asking":"display","data-mode":a2,"aria-busy":p2!==null||void 0,children:[g("div",{className:"core-intent-card__head",children:[h("span",{id:`${l2}-status`,className:"core-intent-card__eyebrow",children:A2}),h("p",{className:"core-intent-card__title",children:c2?E2?`Share with ${c2}`:`Stop sharing with ${c2}`:E2?"Share with whom?":"Stop sharing with whom?"})]}),h("ul",{className:"core-share-approval-card__items",children:T2.map((e3,t3)=>g("li",{children:[h("span",{className:"core-share-approval-card__name",children:X(e3.name)}),X(e3.projectName)?h("span",{className:"core-share-approval-card__project",children:X(e3.projectName)}):null]},t3))}),_2?h("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,S2?h("p",{className:"core-intent-card__does",children:E2?`${T2.length===1?"This is":"These are"} now shared with ${c2}.`:`${T2.length===1?"This is":"These are"} no longer shared with ${c2}.`}):g(m,{children:[h("p",{className:"core-intent-card__does",id:`${l2}-does`,children:c2?E2?`Sharing makes ${T2.length===1?"this":"these"} visible to ${c2} in their portal. You can stop sharing later.`:`Stop sharing takes ${T2.length===1?"this":"these"} out of ${c2}’s portal.`:O2}),E2?g("label",{className:"core-share-approval-card__review",children:[h("input",{type:"checkbox",checked:b2,disabled:!v2||p2!==null,onChange:e3=>x2(e3.target.checked)}),h("span",{children:"I’ve reviewed this"})]}):null,O2&&c2?h("p",{className:"core-share-approval-card__reason",id:`${l2}-reason`,children:O2}):null,g("div",{className:"core-intent-card__actions",children:[h("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!D2||p2!==null,"aria-describedby":`${l2}-does`,onClick:()=>void j2(),children:p2===null?k2:"Saving…"}),typeof n2=="function"?h("button",{type:"button",className:"core-intent-card__button",disabled:p2!==null,onClick:n2,children:"Not now"}):null]})]})]})}var ns={save_as_note:{label:"Save as note",busy:"Saving…",done:"Saved as note"},make_follow_up:{label:"Make follow-up",busy:"Making…",done:"Follow-up made"}},rs=["save_as_note","make_follow_up"];function is(e2){let{onIntent:t2,className:n2,style:r2}=e2,i2=Array.isArray(e2.actions)?rs.filter(t3=>e2.actions.includes(t3)):rs,a2=s(),{run:o2,busy:c2,message:l2,available:u2}=vt(t2),[d2,p2]=f(new Set);if(i2.length===0)return null;let m2=async e3=>{let{ok:t3}=await o2(e3);t3&&p2(t4=>new Set(t4).add(e3))};return g("div",{role:"group","aria-label":"Suggested actions",className:y("core-suggested-actions",n2),style:r2,"aria-busy":c2!==null||void 0,children:[h("div",{className:"core-suggested-actions__row",children:i2.map(e3=>{let t3=d2.has(e3);return h("button",{type:"button",className:"core-suggested-actions__chip","data-done":t3||void 0,disabled:!u2||c2!==null||t3,"aria-describedby":u2?void 0:`${a2}-does`,onClick:()=>void m2(e3),children:t3?ns[e3].done:c2===e3?ns[e3].busy:ns[e3].label},e3)})}),l2?h("p",{className:"core-intent-card__message",role:"alert",children:l2}):null,u2?null:h("p",{id:`${a2}-does`,className:"core-suggested-actions__does",children:_t})]})}var as=new Set(["http:","https:","mailto:","tel:"]);function os(e2){let t2=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e2.replace(/[\u0000- ]/g,""));return t2?`${t2[1].toLowerCase()}:`:null}function ss(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=os(e2.trim());return t2===null||as.has(t2)?e2.trim():(q(`unsafe-href:${t2}`,`Refused a link with the "${t2}" scheme; links are relative, http(s):, mailto: or tel:`),null)}function cs(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=e2.trim(),n2=os(t2);return n2===null||n2==="https:"||n2==="data:"&&/^data:image\//i.test(t2.replace(/[\u0000- ]/g,""))?t2:(q(`unsafe-src:${n2}`,`Refused an image with the "${n2}" scheme; images are relative, https: or data:image/`),null)}var ls=e2=>!!e2&&typeof e2=="object"&&typeof e2.label=="string"&&ss(e2.href)!==null;function us(e2){return(Array.isArray(e2)?e2:e2?[e2]:[]).filter(ls)}function ds({action:e2,className:t2}){let n2=ss(e2.href);if(n2===null)return null;let r2=e2.variant==="secondary"?"secondary":"primary";return h("a",{className:y("core-public-action",t2),"data-variant":r2,href:n2,children:e2.label})}function fs({actions:e2,className:t2}){return e2.length?h("div",{className:y("core-public-actions",t2),children:e2.map((e3,t3)=>h(ds,{action:e3},`${e3.href}-${t3}`))}):null}function ps(e2){if(!e2||typeof e2!="object")return null;let t2=e2,n2=cs(t2.src);return n2===null?null:{src:n2,alt:t2.decorative?"":typeof t2.alt=="string"?t2.alt:""}}function ms({eyebrow:e2,title:t2,intro:n2,actions:r2,media:i2,align:a2,className:o2,style:s2}){let c2=ps(i2),l2=a2==="center";return g("section",{className:y("core-hero",o2),"data-align":l2?"center":"start","data-media":c2?"yes":"no",style:s2,children:[g("div",{className:"core-hero__text",children:[e2?h("p",{className:"core-hero__eyebrow",children:e2}):null,h("h1",{className:"core-hero__title",children:t2}),n2?h("p",{className:"core-hero__intro",children:n2}):null,h(fs,{actions:us(r2).slice(0,2),className:"core-hero__actions"})]}),c2?h("div",{className:"core-hero__media",children:h("img",{src:c2.src,alt:c2.alt,loading:"eager",decoding:"async"})}):null]})}function hs({text:e2,src:t2,href:n2,size:r2,className:i2,style:a2}){let o2=r2==="sm"||r2==="lg"?r2:"md",s2=cs(t2),c2=ss(n2),l2=s2?h("img",{className:"core-logo-mark__img",src:s2,alt:e2}):h("span",{className:"core-logo-mark__text",children:e2});return c2?h("a",{className:y("core-logo-mark",i2),"data-size":o2,href:c2,style:a2,children:l2}):h("span",{className:y("core-logo-mark",i2),"data-size":o2,style:a2,children:l2})}var gs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.label=="string"&&ss(e3.href)!==null).map(e3=>({label:e3.label,href:ss(e3.href)}));function _s({logo:e2,links:t2,signIn:n2,className:r2,style:i2}){let a2=gs(t2).slice(0,5),o2=n2===false?null:{label:"Sign in",href:"/auth/login",variant:"secondary",...n2??{}};return g("header",{className:y("core-public-header",r2),style:i2,children:[e2?h(hs,{...e2}):h("span",{}),a2.length?g("nav",{className:"core-public-header__nav","aria-label":"Main",children:[h("ul",{className:"core-public-header__links",children:a2.map(e3=>h("li",{children:h("a",{href:e3.href,children:e3.label})},e3.href))}),g("details",{className:"core-public-header__menu",children:[h("summary",{children:"Menu"}),h("ul",{children:a2.map(e3=>h("li",{children:h("a",{href:e3.href,children:e3.label})},e3.href))})]})]}):null,o2?h(ds,{action:o2,className:"core-public-header__sign-in"}):null]})}var vs=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string"&&Array.isArray(e3.links)).map(e3=>({title:e3.title,links:gs(e3.links)}));function ys({logo:e2,groups:t2,legal:n2,className:r2,style:i2}){let a2=vs(t2).slice(0,4);return g("footer",{className:y("core-public-footer",r2),style:i2,children:[g("div",{className:"core-public-footer__top",children:[e2?h(hs,{size:"sm",...e2}):null,a2.length?h("div",{className:"core-public-footer__groups",children:a2.map(e3=>g("nav",{"aria-label":e3.title,className:"core-public-footer__group",children:[h("p",{className:"core-public-footer__title",children:e3.title}),h("ul",{children:e3.links.map(e4=>h("li",{children:h("a",{href:e4.href,children:e4.label})},e4.href))})]},e3.title))}):null]}),n2?h("p",{className:"core-public-footer__legal",children:n2}):null]})}var bs=/^\d+(\.\d+)?\s*\/\s*\d+(\.\d+)?$/;function xs({src:e2,alt:t2,decorative:n2,ratio:r2,caption:i2,priority:a2,className:o2,style:s2}){let c2=cs(e2);if(c2===null)return null;!n2&&!t2&&q(`image-alt:${e2}`,`Image: "${e2}" has no alt text; give alt or set decorative`);let l2=r2&&bs.test(r2)?{aspectRatio:r2.replace(/\s/g,"")}:void 0;return g("figure",{className:y("core-image",o2),style:s2,children:[h("div",{className:"core-image__frame","data-ratio":l2?"set":"auto",style:l2,children:h("img",{src:c2,alt:n2?"":t2??"",loading:a2?"eager":"lazy",decoding:"async"})}),i2?h("figcaption",{className:"core-image__caption",children:i2}):null]})}var Ss=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string");function Cs({title:e2,intro:t2,items:n2,columns:r2,className:i2,style:a2}){let o2=Ss(n2);if(!o2.length)return null;let s2=r2===2||r2===4?r2:3;return g("section",{className:y("core-feature-grid",i2),"data-columns":s2,style:a2,children:[e2||t2?g("div",{className:"core-feature-grid__head",children:[e2?h("h2",{className:"core-feature-grid__title",children:e2}):null,t2?h("p",{className:"core-feature-grid__intro",children:t2}):null]}):null,h("ul",{className:"core-feature-grid__items",children:o2.map((e3,t3)=>g("li",{className:"core-feature-grid__item",children:[e3.icon?h("span",{className:"core-feature-grid__icon","aria-hidden":"true",children:e3.icon}):null,h("h3",{className:"core-feature-grid__item-title",children:e3.title}),e3.text?h("p",{className:"core-feature-grid__text",children:e3.text}):null]},`${e3.title}-${t3}`))})]})}var ws=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.name=="string"),Ts=e2=>e2.split(/\s+/).filter(Boolean).slice(0,2).map(e3=>e3[0].toUpperCase()).join("");function Es({title:e2,intro:t2,members:n2,className:r2,style:i2}){let a2=ws(n2);return a2.length?g("section",{className:y("core-team-grid",r2),style:i2,children:[e2||t2?g("div",{className:"core-team-grid__head",children:[e2?h("h2",{className:"core-team-grid__title",children:e2}):null,t2?h("p",{className:"core-team-grid__intro",children:t2}):null]}):null,h("ul",{className:"core-team-grid__members",children:a2.map((e3,t3)=>{let n3=ps(e3.photo);return g("li",{className:"core-team-grid__member",children:[h("div",{className:"core-team-grid__photo",children:n3?h("img",{src:n3.src,alt:n3.alt||e3.name,loading:"lazy",decoding:"async"}):h("span",{"aria-hidden":"true",children:Ts(e3.name)})}),h("p",{className:"core-team-grid__name",children:e3.name}),e3.role?h("p",{className:"core-team-grid__role",children:e3.role}):null,e3.bio?h("p",{className:"core-team-grid__bio",children:e3.bio}):null]},`${e3.name}-${t3}`)})})]}):null}function Ds({quote:e2,name:t2,role:n2,photo:r2,className:i2,style:a2}){if(typeof e2!="string"||!e2)return null;let o2=ps(r2);return g("figure",{className:y("core-testimonial",i2),style:a2,children:[h("blockquote",{className:"core-testimonial__quote",children:h("p",{children:e2})}),g("figcaption",{className:"core-testimonial__by",children:[o2?h("img",{className:"core-testimonial__photo",src:o2.src,alt:o2.alt||t2,loading:"lazy",decoding:"async"}):null,g("span",{children:[h("span",{className:"core-testimonial__name",children:t2}),n2?h("span",{className:"core-testimonial__role",children:n2}):null]})]})]})}function Os({title:e2,text:t2,actions:n2,tone:r2,className:i2,style:a2}){let o2=r2==="strong"||r2==="neutral"?r2:"accent";return g("section",{className:y("core-cta-band",i2),"data-tone":o2,style:a2,children:[g("div",{className:"core-cta-band__text",children:[h("h2",{className:"core-cta-band__title",children:e2}),t2?h("p",{className:"core-cta-band__body",children:t2}):null]}),h(fs,{actions:us(n2).slice(0,2)})]})}function ks({title:e2,intro:t2,askPhone:n2,consent:r2,submitLabel:i2,thanks:a2,actions:o2,className:c2,style:l2}){let u2=s(),[d2,p2]=f({name:"",email:"",phone:"",message:"",consent:false,website:""}),[m2,_2]=f(false),[v2,b2]=f(false),[x2,S2]=f(""),C2=o2?.submitRequest,w2=e3=>t3=>p2(n3=>({...n3,[e3]:t3.target.type==="checkbox"?!!t3.target.checked:t3.target.value}));return v2?h("section",{className:y("core-contact-form",c2),style:l2,children:h("p",{className:"core-contact-form__thanks",role:"status",children:a2||"Thanks. We'll be in touch within one business day."})}):g("section",{className:y("core-contact-form",c2),style:l2,children:[e2?h("h2",{className:"core-contact-form__title",children:e2}):null,t2?h("p",{className:"core-contact-form__intro",children:t2}):null,g("form",{className:"core-contact-form__form",onSubmit:async e3=>{if(e3.preventDefault(),C2&&!m2){if(!d2.consent){S2("Please tick the box to agree to be contacted.");return}_2(true),S2("");try{let e4=await C2({name:d2.name.trim(),email:d2.email.trim(),...n2&&d2.phone.trim()?{phone:d2.phone.trim()}:{},...d2.message.trim()?{message:d2.message.trim()}:{},consent:d2.consent,website:d2.website});e4.success?b2(true):S2(ft(e4))}catch{S2("Something went wrong. Try again.")}finally{_2(false)}}},children:[g("div",{className:"core-contact-form__row",children:[g("label",{className:"core-contact-form__field",children:[h("span",{children:"Name"}),h("input",{name:"name",autoComplete:"name",required:true,value:d2.name,onChange:w2("name")})]}),g("label",{className:"core-contact-form__field",children:[h("span",{children:"Email"}),h("input",{name:"email",type:"email",autoComplete:"email",required:true,value:d2.email,onChange:w2("email")})]})]}),n2?g("label",{className:"core-contact-form__field",children:[h("span",{children:"Phone (optional)"}),h("input",{name:"phone",type:"tel",autoComplete:"tel",value:d2.phone,onChange:w2("phone")})]}):null,g("label",{className:"core-contact-form__field",children:[h("span",{children:"Message (optional)"}),h("textarea",{name:"message",rows:4,value:d2.message,onChange:w2("message")})]}),g("div",{className:"core-contact-form__trap","aria-hidden":"true",children:[h("label",{htmlFor:`${u2}-website`,children:"Website"}),h("input",{id:`${u2}-website`,name:"website",tabIndex:-1,autoComplete:"off",value:d2.website,onChange:w2("website")})]}),g("label",{className:"core-contact-form__check",children:[h("input",{type:"checkbox",name:"consent",checked:d2.consent,onChange:w2("consent")}),h("span",{children:r2||"I agree to be contacted about my request."})]}),x2?h("p",{className:"core-contact-form__error",role:"alert",children:x2}):null,C2?null:h("p",{className:"core-contact-form__error",children:"This form isn't connected yet."}),h("div",{className:"core-contact-form__actions",children:h("button",{type:"submit",className:"core-contact-form__submit",disabled:m2||!C2,children:m2?"Sending…":i2||"Send"})})]})]})}function As({length:e2=6,label:t2,value:n2,onChange:r2,onComplete:i2,error:a2,disabled:o2,autoFocus:c2,name:l2="code",className:u2,style:d2}){let p2=s(),m2=Number.isInteger(e2)&&e2>0&&e2<=12?e2:6,[_2,v2]=f(""),b2=(n2??_2).replace(/\D/g,"").slice(0,m2),x2=e3=>{let t3=e3.target.value.replace(/\D/g,"").slice(0,m2);n2===void 0&&v2(t3),r2?.(t3),t3.length===m2&&b2.length!==m2&&i2?.(t3)};return g("div",{className:y("core-code-field",u2),style:{...d2,"--core-code-field-n":m2},children:[h("label",{className:"core-code-field__label",htmlFor:p2,children:t2||"Code"}),g("div",{className:"core-code-field__boxes","data-error":a2?"yes":"no",children:[h("input",{id:p2,className:"core-code-field__input",name:l2,value:b2,onChange:x2,inputMode:"numeric",autoComplete:"one-time-code",pattern:`\\d{${m2}}`,maxLength:m2,disabled:o2,autoFocus:c2,"aria-invalid":a2?true:void 0,"aria-describedby":a2?`${p2}-error`:void 0}),h("div",{className:"core-code-field__cells","aria-hidden":"true",children:Array.from({length:m2},(e3,t3)=>h("span",{className:"core-code-field__cell","data-filled":t3<b2.length?"yes":"no","data-caret":t3===Math.min(b2.length,m2-1)?"yes":"no",children:b2[t3]??""},t3))})]}),a2?h("p",{id:`${p2}-error`,className:"core-code-field__error",role:"alert",children:a2}):null]})}export{Nr as ANSWER_COLUMN_PX,dn as Accordion,ds as ActionLink,fs as ActionRow,Pr as AnswerRows,Zn as Aside,Et as Avatar,Vn as BLOCK_KINDS,ci as BLOCK_SCHEMAS,Xt as Badge,No as BookEventCard,E as Box,an as Button,Va as CalendarFilters,Ja as CalendarView,fn as Card,D as Center,Lt as Checkbox,Rt as CheckboxGroup,on as Chip,Dt as Code,As as CodeField,mn as Columns,wo as Combobox,Ir as ComparisonBars,ks as ContactForm,O as Container,ti as Contents,Os as CtaBand,da as DAY_MINUTES,Sr as DEFAULT_DISPLAY_LOCALE,An as DEFAULT_PROFILE_ID,qe as DEFAULT_VIEWER,ea as DataTable,zt as DateRange,er as Definition,Oe as Dialog,Di as DisclaimerBlock,gn as Disclosure,k as Divider,ai as DocumentBlocks,mr as DocumentLabel,si as DocumentSection,$r as DocumentShell,xr as DocumentTable,Bo as EditEventCard,w as EmbedContext,Zt as EmptyState,ta as EventCard,ia as EventDetail,oa as EventLogForm,Ho as EventNoteCard,ra as EventRespond,ca as EventSchedule,ua as EventTimeline,ri as ExecutionBlock,He as Eyebrow,Cs as FeatureGrid,fr as Figure,Vt as FileField,ln as FilterChips,dr as Footnote,Mt as FormField,_n as Grid,Ko as HandoverCard,kt as Heading,ms as Hero,A as Hide,yi as HighlightBox,Co as Highlighted,ka as HourGrid,sn as IconButton,xs as Image,j as Inline,Vi as KpiCardGrid,cn as Link,Pe as ListRow,vo as LogCard,hs as LogoMark,Jr as Masthead,or as Math,ce as Menu,Xr as MetaRail,Wa as MiniMonth,_t as NOT_AVAILABLE,zr as NextSteps,$o as NoteSplitCard,Vr as Notes,$t as Notice,Fi as OptionCard,Ba as OverlapNotice,yn as PAGINATOR_BINDINGS,pr as PageBreak,Fe as PageFrame,Ue as PageHead,St as PageStaffTools,U as Popover,Ii as ProfileCard,en as Progress,Ei as ProposedComponent,Qn as Prose,ys as PublicFooter,_s as PublicHeader,Do as QuickNoteCard,$n as Quote,Ht as RadioGroup,I as Rail,br as Reference,vn as Repeat,Mr as RowList,Ct as RuleSection,Qr as RunningFooter,ba as SERIES_SHAPES,Gt as SearchField,vi as SectionHeader,un as SegmentedControl,Kt as Select,wa as SeriesGlyph,ts as ShareApprovalCard,ie as Sheet,L as Show,tn as Skeleton,Ur as SkippedSection,qt as Slider,ke as Spacer,nn as Spinner,hn as Split,Ae as Stack,Yo as StartProcessCard,mi as Stat,hi as StatGroup,ki as StatStrip,is as SuggestedActions,Jt as Switch,Ie as TONES,Gr as TalkItThrough,Go as TaskCard,Es as TeamGrid,Ds as Testimonial,jt as Text,Yt as TextArea,Wt as TextField,Te as Toast,De as ToastRegion,rn as Tooltip,wt as UnderlinedAction,Ze as ViewerProvider,Kr as WRITE_HEIGHT_PX,Br as WRITE_LINE_HEIGHT_PX,Ka as WeekStrip,qr as WriteInField,us as actionsOf,y as cx,ve as dismissToast,Tr as displayLocale,kn as documentProfiles,ct as eventWhen,Bt as fileSize,Ar as formatValue,et as hasRole,gt as hrefFrom,ps as imageOf,Tt as initialsOf,Be as inkToneOf,Za as interact,ma as isBusyOnly,$e as isStaff,ga as layoutDay,b as length,Fa as localWithOffset,Je as normalizeViewer,ya as overlapDays,Bn as profileCss,En as profileIds,Rn as profileTokens,Tn as registerProfile,Or as renderFormatted,Dn as resolveProfile,On as resolvedProfiles,yt as sameOriginPath,Ca as seriesNumber,Sa as seriesShape,Ut as toNumber,_e as toast,Re as toneOf,tt as typeCard,So as useCombobox,T as useEmbedded,vt as useIntent,we as useToast,Qe as useViewer,x as vars,_a as visibleRange,pa as wallOf,va as weekDates};