@peripheries/core 0.4.1 → 0.5.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 (65) 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/Rail/Rail.d.ts +9 -0
  6. package/types/core/_shared/formatters.d.ts +9 -2
  7. package/types/core/_shared/overlay/focusables.d.ts +2 -0
  8. package/types/core/_shared/overlay/hooks.d.ts +4 -0
  9. package/types/core/_shared/overlay/placement.d.ts +28 -0
  10. package/types/core/_shared/overlay/scroll-lock.d.ts +1 -0
  11. package/types/core/_shared/safe-url.d.ts +2 -0
  12. package/types/core/_shared/viewer.d.ts +15 -0
  13. package/types/core/display/DataTable/DataTable.d.ts +5 -3
  14. package/types/core/display/KpiCardGrid/KpiCardGrid.d.ts +1 -0
  15. package/types/core/display/OptionCard/OptionCard.d.ts +1 -0
  16. package/types/core/display/ProfileCard/ProfileCard.d.ts +1 -0
  17. package/types/core/display/SectionHeader/SectionHeader.d.ts +2 -1
  18. package/types/core/display/Stat/Stat.d.ts +2 -1
  19. package/types/core/display/StatStrip/StatStrip.d.ts +2 -1
  20. package/types/core/display/_shared/ValueBadge.d.ts +3 -2
  21. package/types/core/document/ComparisonBars/ComparisonBars.d.ts +2 -1
  22. package/types/core/document/RowList/RowList.d.ts +5 -3
  23. package/types/core/events/CalendarFilters/CalendarFilters.d.ts +22 -0
  24. package/types/core/events/CalendarView/CalendarView.d.ts +23 -0
  25. package/types/core/events/EventCard/EventCard.d.ts +1 -0
  26. package/types/core/events/EventSchedule/EventSchedule.d.ts +2 -0
  27. package/types/core/events/HandoverCard/HandoverCard.d.ts +19 -0
  28. package/types/core/events/HourGrid/HourGrid.d.ts +24 -0
  29. package/types/core/events/LogCard/LogCard.d.ts +27 -0
  30. package/types/core/events/MiniMonth/MiniMonth.d.ts +18 -0
  31. package/types/core/events/NoteSplitCard/NoteSplitCard.d.ts +22 -0
  32. package/types/core/events/QuickNoteCard/QuickNoteCard.d.ts +21 -0
  33. package/types/core/events/ShareApprovalCard/ShareApprovalCard.d.ts +16 -0
  34. package/types/core/events/StartProcessCard/StartProcessCard.d.ts +22 -0
  35. package/types/core/events/SuggestedActions/SuggestedActions.d.ts +10 -0
  36. package/types/core/events/TaskCard/TaskCard.d.ts +17 -0
  37. package/types/core/events/WeekStrip/WeekStrip.d.ts +16 -0
  38. package/types/core/events/_shared/SeriesGlyph.d.ts +9 -0
  39. package/types/core/events/_shared/calendar.d.ts +36 -0
  40. package/types/core/events/_shared/event.d.ts +7 -1
  41. package/types/core/events/_shared/intent.d.ts +18 -0
  42. package/types/core/events/_shared/path.d.ts +1 -0
  43. package/types/core/forms/CodeField/CodeField.d.ts +15 -0
  44. package/types/core/forms/Combobox/Combobox.d.ts +17 -0
  45. package/types/core/forms/Combobox/useCombobox.d.ts +74 -0
  46. package/types/core/overlay/Dialog/Dialog.d.ts +16 -0
  47. package/types/core/overlay/Menu/Menu.d.ts +26 -0
  48. package/types/core/overlay/Popover/Popover.d.ts +19 -0
  49. package/types/core/overlay/Sheet/Sheet.d.ts +21 -0
  50. package/types/core/overlay/Toast/Toast.d.ts +20 -0
  51. package/types/core/overlay/Toast/toast-store.d.ts +51 -0
  52. package/types/core/overlay/_shared/Modal.d.ts +19 -0
  53. package/types/core/public/ContactForm/ContactForm.d.ts +24 -0
  54. package/types/core/public/CtaBand/CtaBand.d.ts +11 -0
  55. package/types/core/public/FeatureGrid/FeatureGrid.d.ts +15 -0
  56. package/types/core/public/Hero/Hero.d.ts +14 -0
  57. package/types/core/public/Image/Image.d.ts +12 -0
  58. package/types/core/public/LogoMark/LogoMark.d.ts +10 -0
  59. package/types/core/public/PublicFooter/PublicFooter.d.ts +15 -0
  60. package/types/core/public/PublicHeader/PublicHeader.d.ts +16 -0
  61. package/types/core/public/TeamGrid/TeamGrid.d.ts +16 -0
  62. package/types/core/public/Testimonial/Testimonial.d.ts +11 -0
  63. package/types/core/public/_shared/actions.d.ts +15 -0
  64. package/types/core/public/_shared/media.d.ts +9 -0
  65. package/types/index.core.d.ts +40 -2
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,createContext as i,isValidElement as a,useCallback as o,useContext as s,useEffect as c,useId as l,useLayoutEffect as u,useMemo as d,useReducer as f,useRef as p,useState as m}from"react";var h=new Set(["baseProps","data","status","actions","_traversal","isLoading","error","navigate","onNavigate","size","store"]);function g(e2){let t2={};for(let n2 in e2)h.has(n2)||(t2[n2]=e2[n2]);return t2}var _=(...e2)=>e2.filter(Boolean).join(" ")||void 0,v=e2=>e2===void 0?void 0:typeof e2=="number"?`${e2}px`:e2;function y(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 b({as:e2,className:n2,children:r2,...i2}){return t(e2??"div",{className:_("core-box",n2),...g(i2),children:r2})}function x({minHeight:e2,className:n2,style:r2,children:i2,...a2}){return t(b,{...a2,className:_("core-center",n2),style:y({"--core-center-min-height":v(e2)},r2),children:i2})}function S({name:e2,className:n2,style:r2,children:i2,...a2}){return t(b,{...a2,className:_("core-container",n2),style:y({"--core-container-name":e2},r2),children:i2})}function C({orientation:e2="horizontal",weight:n2="subtle",spacing:r2,className:i2,style:a2,ref:o2,...s2}){let c2={className:_("core-divider",i2),"data-weight":n2,"data-orientation":e2,style:y({"--core-divider-spacing":v(r2)},a2)};return e2==="vertical"?t("span",{role:"separator","aria-orientation":"vertical",...c2}):t("hr",{ref:o2,...g(s2),...c2})}function w({when:e2,children:n2,as:r2="span"}){return t(r2,{className:"core-hide","data-when":e2,children:n2})}function T({gap:e2,align:n2="center",justify:r2="start",wrap:i2=true,stackWhen:a2,className:o2,style:s2,children:c2,...l2}){return t(b,{...l2,className:_("core-inline",o2),"data-align":n2,"data-justify":r2,"data-wrap":i2?"true":"false","data-stack-when":a2,style:y({"--core-inline-gap":v(e2)},s2),children:c2})}function E({when:e2,children:n2,as:r2="span"}){return t(r2,{className:"core-show","data-when":e2,children:n2})}function D({size:e2,className:n2,style:r2}){return t("span",{"aria-hidden":true,className:_("core-spacer",n2),style:y({"--core-spacer-size":v(e2)},r2)})}function O({gap:e2,align:n2="stretch",justify:r2="start",className:i2,style:a2,children:o2,...s2}){return t(b,{...s2,className:_("core-stack",i2),"data-align":n2,"data-justify":r2,style:y({"--core-stack-gap":v(e2)},a2),children:o2})}var k=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),A=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function j({href:e2,action:t2,input:n2,actions:r2,navigate:i2,onClick:a2}){let[o2,s2]=m(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&&k(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!k(e2)&&!A(e2)}}function M({title:e2,meta:r2,leading:i2,value:a2,trailing:o2,href:s2,navigate:c2,onClick:l2,as:u2="div",className:d2,...f2}){let p2=j({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,{...g(f2),className:_("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 N({header:e2,children:r2,measure:i2="page",className:a2,...o2}){return t("div",{...g(o2),className:_("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 P=new Set;function F(e2,t2){P.has(e2)||(P.add(e2),typeof console<"u"&&console.warn(t2))}var I=["neutral","strong","accent","info","success","warning","danger"],L=()=>typeof process>"u"||false;function R(e2,t2="neutral"){return typeof e2=="string"&&I.includes(e2)?e2:(typeof e2=="string"&&e2&&L()&&F(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${I.join(", ")}); using "${t2}".`),t2)}var z=["subtle","on-dark","inherit"];function B(e2,t2){return typeof e2=="string"&&(z.includes(e2)||I.includes(e2))?e2:t2}function ee(e2){return{"data-tone":e2,toned:!z.includes(e2)}}function V({children:e2,as:n2="span",tone:r2,tabular:i2=false,className:a2,style:o2}){let{toned:s2,...c2}=ee(B(r2,"subtle"));return t(n2,{className:_("core-eyebrow",s2&&"core-toned",a2),...c2,"data-tabular":i2?"true":void 0,style:o2,children:e2})}function te({title:e2,eyebrow:r2,intro:i2,actions:a2,className:o2,...s2}){return n("header",{...g(s2),className:_("core-page-head",o2),children:[r2&&t(V,{as:"p",children:r2}),n("div",{className:"core-page-head__row",children:[t("h1",{className:"core-page-head__title",children:e2}),a2!=null&&t("div",{className:"core-page-head__actions",children:a2})]}),i2!=null&&t("p",{className:"core-page-head__intro",children:i2})]})}function ne({label:e2,actions:r2,children:i2,rail:a2=false,anchor:o2,className:s2,...c2}){return t("section",{...g(c2),id:o2,"aria-label":e2,className:_("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(V,{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 re({label:r2,children:i2,arrow:a2=true,className:o2,href:s2,action:c2,input:l2,actions:u2,navigate:d2,onClick:f2,...p2}){let m2=j({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"})})]}),v2={...g(p2),className:_("core-underlined-action",o2)};return s2?t("a",{...v2,href:s2,onClick:m2.onClick,...m2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:h2}):t("button",{...v2,type:"button",onClick:m2.onClick,disabled:m2.busy,children:h2})}var ie=(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 ae({name:e2,initials:n2,src:r2,alt:i2,size:a2="md",className:o2,...s2}){let[c2,l2]=m(false),u2=i2??e2??"";return t("span",{...g(s2),className:_("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??ie(e2)})})}function oe({code:e2,children:n2,block:r2=false,className:i2,...a2}){let o2=n2??e2;return r2?t("pre",{...g(a2),className:_("core-code",i2),"data-block":"",children:t("code",{children:o2})}):t("code",{...g(a2),className:_("core-code",i2),children:o2})}var se={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function ce({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,{...g(s2),id:a2,className:_("core-heading",o2),"data-size":i2??se[c2],children:n2??e2})}var le={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function ue({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,{...g(d2),className:_("core-text",u2),"data-role":le[i2]??"body","data-weight":a2,"data-tone":o2,"data-align":s2,"data-truncate":c2||void 0,"data-lines":p2,children:n2??e2})}function H({label:e2,hint:r2,error:i2,required:a2,htmlFor:o2,hintId:s2,errorId:c2,as:u2="div",children:d2,className:f2,style:p2}){let m2=l().replace(/:/g,""),h2=s2??(r2?`${o2??m2}-hint`:void 0),g2=c2??(i2?`${o2??m2}-error`:void 0),v2=u2,y2=u2==="fieldset"?"legend":"label";return n(v2,{className:_("core-field",f2),style:p2,"data-invalid":i2?"":void 0,children:[e2&&n(y2,{className:"core-field__label",...y2==="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 U(e2,t2,n2){let r2=l(),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 W(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function de({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:h2,className:g2,style:v2,ref:y2}){let b2=U(o2,u2,d2),[x2,S2]=m(r2??false),C2=e2??x2,w2=W(i2,a2);return t(H,{className:_("core-checkbox",g2),style:v2,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:y2,id:b2.control,type:"checkbox",name:s2,checked:C2,required:f2,"aria-required":f2||void 0,disabled:p2,"aria-readonly":h2||void 0,onChange:t2=>{h2||(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 fe({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:h2,orientation:g2="vertical",min:v2,max:y2,className:b2,style:x2,ref:S2}){let C2=[v2===void 0?"":`at least ${v2}`,y2===void 0?"":`at most ${y2}`].filter(Boolean).join(", "),w2=[u2,C2?`Choose ${C2}.`:""].filter(Boolean).join(" ")||void 0,T2=U(s2,w2,d2),[E2,D2]=m(i2??[]),O2=r2??E2,k2=W(a2,o2),A2=y2!==void 0&&O2.length>=y2;return t(H,{as:"fieldset",className:_("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||h2&&!o3,"aria-readonly":h2||void 0,onChange:()=>{if(h2)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 pe({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:h2,max:g2,fromLabel:v2="From",toLabel:y2="To",className:b2,style:x2,ref:S2}){let C2=U(o2,l2,u2),[w2,T2]=m(r2??{from:null,to:null}),E2=e2??w2,D2=W(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(H,{as:"fieldset",className:_("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:v2}),t("input",{ref:S2,id:C2.control,type:"date",name:s2?`${s2}.from`:void 0,value:E2.from??"",min:h2,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:y2}),t("input",{type:"date",name:s2?`${s2}.to`:void 0,value:E2.to??"",min:E2.from??h2,max:g2,onChange:e3=>O2("to",e3.target.value),...k2})]})]})})}function me(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 he({value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:h2,readOnly:g2,upload:v2,accept:y2,hash:b2=false,className:x2,style:S2,ref:C2}){let w2=U(s2,u2,d2),[T2,E2]=m(i2??null),D2=r2===void 0?T2:r2,O2=W(a2,o2),[k2,A2]=m({busy:false,dragging:false}),j2=p(null),M2=e2=>{r2===void 0&&E2(e2),O2(e2)},N2=async e2=>{if(e2&&v2&&!g2&&!h2){A2({busy:true,dragging:false});try{let t2=await v2(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(H,{className:_("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||h2||!v2||(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:me(D2.file.size)}),!g2&&!h2&&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:h2||g2||!v2,"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:y2,hidden:true,tabIndex:-1,onChange:e2=>void N2(e2.target.files?.[0])})]})})}function ge({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:h2,orientation:g2="vertical",className:v2,style:y2,ref:b2}){let x2=U(s2,u2,d2),[S2,C2]=m(i2??null),w2=r2===void 0?S2:r2,T2=W(a2,o2),E2=c2??x2.control;return t(H,{as:"fieldset",className:_("core-choices",v2),style:y2,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||h2&&w2!==e3.value,onChange:()=>{h2||(r2===void 0&&C2(e3.value),T2(e3.value))}}),t("span",{children:e3.label})]},e3.value))})})}var _e=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function ve({type:e2="text",value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:l2,label:u2,hint:d2,error:f2,required:p2,disabled:h2,readOnly:g2,placeholder:v2,inputMode:y2,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=U(s2,d2,f2),[N2,P2]=m(i2),F2=r2===void 0?N2:r2,I2=W(a2,o2),L2=e3=>e3==null?"":String(e3),[R2,z2]=m(L2(F2));c(()=>{e2==="number"&&_e(R2)!==(F2??null)&&z2(L2(F2))},[F2]);let B2=t("input",{ref:j2,id:M2.control,name:l2,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"?_e(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:v2,inputMode:y2??(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:h2,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(H,{className:_("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 ye({value:e2,defaultValue:r2,onChange:i2,setValue:a2,label:o2="Search",onSearch:s2,size:c2="md",className:l2,...u2}){let[d2,f2]=m(r2??""),p2=e2??d2,h2=t2=>{e2===void 0&&f2(t2),i2?.(t2),a2?.(t2)};return n("div",{className:_("core-search-field",l2),"data-filled":p2?"":void 0,"data-size":c2,children:[t(ve,{...u2,label:o2,value:p2,onChange:e3=>h2(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:()=>h2(""),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 be({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:h2,placeholder:g2="Choose…",className:v2,style:y2,ref:b2}){let x2=U(s2,u2,d2),[S2,C2]=m(i2??null),w2=r2===void 0?S2:r2,T2=W(a2,o2);return t(H,{className:_("core-select",v2),style:y2,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||h2,"aria-readonly":h2||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 xe({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:h2=0,max:g2=100,step:v2=1,format:y2=String,className:b2,style:x2,ref:S2}){let C2=U(o2,l2,u2),[w2,T2]=m(r2??h2),E2=e2??w2,D2=W(i2,a2);return t(H,{className:_("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:h2,max:g2,step:v2,value:E2,disabled:f2,"aria-readonly":p2||void 0,"aria-valuetext":y2(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:y2(E2)})]})})}function Se({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:h2,ref:g2}){let v2=U(o2,l2,u2),[y2,b2]=m(r2??false),x2=e2??y2,S2=W(i2,a2);return n("div",{className:_("core-switch",p2),style:h2,children:[n("button",{ref:g2,id:v2.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))},...v2.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:v2.hintId,children:l2}),u2&&t("p",{className:"core-field__error",id:v2.errorId,children:u2})]})}function Ce({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:d2,required:f2,disabled:h2,readOnly:g2,placeholder:v2,rows:y2=3,autoGrow:b2=true,maxLength:x2,onKeyDown:S2,onBlur:C2,className:w2,style:T2,ref:E2}){let D2=U(o2,l2,d2),[O2,k2]=m(r2??""),A2=e2??O2,j2=W(i2,a2),M2=p(null);return u(()=>{let e3=M2.current;b2&&e3&&(e3.style.height="auto",e3.style.height=`${e3.scrollHeight+2}px`)},[A2,b2]),n(H,{className:_("core-text-area",w2),style:T2,label:c2,hint:l2,error:d2,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:y2,value:A2,onChange:t2=>{e2===void 0&&k2(t2.target.value),j2(t2.target.value)},onKeyDown:S2,onBlur:C2,placeholder:v2,maxLength:x2,required:f2,"aria-required":f2||void 0,disabled:h2,readOnly:g2,...D2.aria}),x2!==void 0&&n("span",{className:"core-field__hint","aria-live":"polite",children:[A2.length," / ",x2]})]})}function we({label:e2,children:n2,tone:r2,variant:i2="soft",className:a2,...o2}){return t("span",{...g(o2),className:_("core-badge","core-toned",a2),"data-tone":R(r2),"data-variant":i2,children:n2??e2})}function Te({message:e2,title:r2,action:i2,className:a2,...o2}){return n("div",{...g(o2),className:_("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 Ee={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 De({title:e2,message:r2,children:i2,tone:a2,action:o2,onDismiss:s2,className:c2,...l2}){let u2=R(a2,"info"),d2=u2==="warning"||u2==="danger";return n("div",{...g(l2),role:d2?"alert":"status",className:_("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:Ee[u2]??Ee.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 Oe({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",{...g(u2),className:_("core-progress","core-toned",c2),"data-tone":R(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:y({"--core-progress-fill":`${f2}%`}),children:t("div",{className:"core-progress__fill"})})]})}function ke({shape:e2="text",lines:n2=3,width:r2,height:i2,className:a2,style:o2,...s2}){let c2=y({"--core-skeleton-w":v(r2),"--core-skeleton-h":v(i2)},o2);if(e2!=="text")return t("span",{...g(s2),"aria-hidden":"true",className:_("core-skeleton",a2),"data-shape":e2,style:c2});let l2=Math.max(1,Math.min(12,Math.round(n2)));return t("span",{...g(s2),"aria-hidden":"true",className:_("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 Ae({label:e2="Loading",size:n2="md",className:r2,...i2}){return t("span",{...g(i2),role:"status","aria-label":e2,className:_("core-spinner",r2),"data-size":n2})}function je({content:e2,text:r2,children:i2,side:a2="top",className:o2,...s2}){let[u2,d2]=m(false),f2=l();return c(()=>{if(!u2)return;let e3=e4=>{e4.key==="Escape"&&d2(false)};return document.addEventListener("keydown",e3),()=>document.removeEventListener("keydown",e3)},[u2]),n("span",{...g(s2),className:_("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":u2?"":void 0,children:e2??r2})]})}function Me({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:v2,input:y2,actions:b2,navigate:x2,onClick:S2,...C2}){let w2=j({href:h2,action:v2,input:y2,actions:b2,navigate:x2,onClick:S2}),T2=u2||w2.busy,E2={...g(C2),className:_("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 Ne({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:v2,...y2}){let b2=o2!==void 0||s2!==void 0,x2=j({href:d2,action:f2,input:p2,actions:m2,navigate:h2,onClick:v2??(s2?()=>s2(!o2):void 0)});return n("button",{...g(y2),type:"button",className:_("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 Pe({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 v2=j({href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2}),y2={...g(h2),className:_("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",{...y2,href:l2,onClick:v2.onClick,...v2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:b2}):t("button",{...y2,type:"button","aria-pressed":o2,disabled:s2||v2.busy,onClick:v2.onClick,children:b2})}function Fe({href:r2,children:i2,label:a2,variant:o2="default",className:s2,navigate:c2,onClick:l2,...u2}){let d2=j({href:r2,navigate:c2,onClick:l2});return k(r2)||A(r2)||/^(https?:|mailto:)/i.test(r2)?n("a",{...g(u2),className:_("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:_("core-link",s2),children:i2??a2})}function Ie({options:e2,value:n2,defaultValue:r2,onChange:i2,label:a2,fullWidth:o2=false,size:s2="md",className:c2,setValue:u2,...d2}){let[f2,h2]=m(r2??e2[0]?.value),v2=n2??f2,y2=l(),b2=p([]),x2=e3=>{n2===void 0&&h2(e3),i2?.(e3),u2?.(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",{...g(d2),role:"radiogroup","aria-label":a2,className:_("core-segmented",c2),"data-full":o2||void 0,"data-size":s2,children:e2.map((e3,n3)=>{let r3=e3.value===v2;return t("button",{ref:e4=>{b2.current[n3]=e4},type:"button",role:"radio",name:y2,"aria-checked":r3,tabIndex:r3||v2===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 Le({items:e2=[],children:r2,numbered:i2=false,single:a2=false,rules:o2="subtle",className:s2,...c2}){let u2=l(),d2=i2?"ol":"ul";return n("div",{...g(c2),className:_("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?u2: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 Re({media:e2,header:r2,body:i2,footer:a2,children:o2,tone:s2="plain",className:c2,...l2}){return n("article",{...g(l2),className:_("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 ze={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function Be({start:e2,end:r2,children:i2,ratio:a2="1:1",gap:o2,stackBelow:s2="compact",className:c2,...l2}){return n("div",{...g(l2),className:_("core-columns",c2),"data-stack":s2,children:[n("div",{className:"core-columns__grid",style:y({"--core-columns-template":ze[a2]??ze["1:1"],"--core-columns-gap":v(o2)}),children:[t("div",{className:"core-columns__start",children:e2}),t("div",{className:"core-columns__end",children:r2})]}),i2]})}var Ve=Be;function He({summary:e2,content:r2,children:i2,open:a2=false,onToggle:o2,className:s2,...c2}){return n("details",{...g(c2),className:_("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 Ue({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",{...g(l2),className:_("core-grid",s2),"data-capped":a2&&a2>0?"":void 0,style:y({"--core-grid-min":v(i2),"--core-grid-gap":v(o2),"--core-grid-cols":a2&&a2>0?String(Math.round(a2)):void 0},c2),children:u2})}function We({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",{...g(d2),className:_("core-repeat",l2),"data-layout":a2,style:y({"--core-repeat-gap":v(o2),"--core-repeat-min":v(s2)},u2),children:f2}):c2?t("p",{className:"core-repeat__empty",children:c2}):null}var Ge=["page-x-of-y","page-number","page-count"],Ke={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:11,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},qe={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)"},Je=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],Ye=[{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:qe,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:Ke,floorPx:11,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:Je,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:Je,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.45)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...Ke,eyebrow:{...Ke.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:[]}}],G=new Map;function Xe(e2){G.set(e2.id,e2)}for(let e2 of Ye)Xe(e2);function Ze(){return[...G.keys()].sort()}function Qe(e2){let t2=G.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${Ze().join(", ")}`);if(!t2.extends)return t2;let n2=G.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 $e(){let e2={};for(let t2 of Ze())try{e2[t2]=Qe(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var et=Object.freeze($e()),tt="workbook";function nt(e2,t2){try{return Qe(e2)}catch{return F(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function K(e2,t2){return e2===void 0?(F("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${tt}". If this document is an instrument, its numbering and depth are being dropped.`),nt(tt,t2)):nt(e2,t2)}var rt=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),it=["full","muted","subtle","border","accent","accentText","sunken"],at=["structural","hairline","head","row"],ot=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],st=3,q="initial";function ct(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??q,"--doc-rail-width":e2.rail.width??q,"--doc-rail-gutter":e2.rail.gutter??q,"--doc-floor":`${e2.floorPx}px`};for(let n2 of it)t2[`--doc-ink-${rt(n2)}`]=e2.ink[n2];for(let n2 of at)t2[`--doc-rule-${n2}`]=e2.rules[n2]??q;for(let n2 of ot){let r2=e2.type[n2],i2=`--doc-type-${rt(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<=st;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??q;return t2}var lt=(e2,t2)=>`${e2} {
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 te=Symbol.for("peripheries.overlay.scrollLock.v1"),V=globalThis;function H(){if(typeof document>"u")return()=>{};let e2=V[te]??={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 U({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=H(),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 ne({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(U,{variant:e2==="end"?"sheet-end":"sheet-bottom",headerStart:i2,...r2})}var re="(max-width: 640px)",ie=600,ae=e2=>"type"in e2;function oe({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>ie?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(ae(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 se({trigger:r2,items:a2,label:o2,placement:s2="bottom-start",presentation:c2="auto",defaultOpen:l2=false,onOpenChange:u2,className:d2}){let f2=I(re),p2=c2==="sheet"||c2==="auto"&&f2,[m2,g2]=P(void 0,l2,u2),[_2,v2]=h("first"),y2=t(oe,{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(ne,{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 ce=new Set;function W(e2,t2){ce.has(e2)||(ce.add(e2),typeof console<"u"&&console.warn(t2))}var G={title:120,description:280,label:40,visible:4,perSource:2,burst:5,windowMs:1e4,defaultDuration:6e3},le=1,ue=Symbol.for("peripheries.toast.v1"),de=["neutral","info","success","warning","danger"],fe=globalThis;function pe(){let e2=fe[ue];if(e2===void 0){let e3={version:le,snapshot:{toasts:[],actions:[]},listeners:new Set,handlers:new Map,sent:new Map,regionClaim:null,next:1};return fe[ue]=e3,e3}return e2.version!==le||!e2.listeners||!e2.handlers?(W("toast:version",`[toast] A toast store of version ${String(e2.version)} is on this page; this copy expects ${le}. Toasts from this copy are ignored.`),null):e2}function me(e2,t2){e2.snapshot={toasts:t2,actions:[...e2.handlers.keys()]};for(let t3 of[...e2.listeners])t3()}var he=(e2,t2)=>e2.length>t2?`${e2.slice(0,t2-1)}…`:e2;function ge(e2){let t2=pe();if(!t2)return null;if(!e2||typeof e2.title!="string"||e2.title.trim()==="")return W("toast:title","[toast] A toast needs a title of text; nothing was shown."),null;if(t2.regionClaim===null)return W("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?he(e2.source,40):"app",r2=Date.now(),i2=(t2.sent.get(n2)??[]).filter(e3=>r2-e3<G.windowMs);if(i2.length>=G.burst)return W(`toast:burst:${n2}`,`[toast] "${n2}" sent more than ${G.burst} toasts in ${G.windowMs/1e3}s; the rest are dropped.`),t2.sent.set(n2,i2),null;t2.sent.set(n2,[...i2,r2]);let a2=de.includes(e2.tone)?e2.tone:"neutral",o2=he(e2.title.trim(),G.title),s2=typeof e2.description=="string"&&e2.description.trim()?he(e2.description.trim(),G.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:he(e2.action.label.trim(),G.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:G.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>G.perSource;)d2.splice(d2.findIndex(e3=>e3.source===n2),1);for(;d2.length>G.visible;)d2=d2.slice(1)}return me(t2,d2),l2}function _e(e2){let t2=pe();t2&&t2.snapshot.toasts.some(t3=>t3.id===e2)&&me(t2,t2.snapshot.toasts.filter(t3=>t3.id!==e2))}function ve(e2){let t2=pe()?.handlers.get(e2);return t2?.(),!!t2}var ye={toasts:[],actions:[]},be=e2=>{let t2=pe();return t2?.listeners.add(e2),()=>void t2?.listeners.delete(e2)},xe=()=>pe()?.snapshot??ye;function Se(){let e2=pe();if(!e2)return null;if(e2.regionClaim!==null)return W("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(),me(e2,[]))},setActions(n2){e2.regionClaim===t2&&(e2.handlers=new Map(Object.entries(n2)),me(e2,e2.snapshot.toasts))}}}function Ce(){return{toast:ge,dismiss:_e}}function we({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 Te({item:e2,actionAvailable:n2}){let[r2,i2]=h(false);return l(()=>{if(e2.duration===0||r2)return;let t2=setTimeout(()=>_e(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(we,{toast:e2,actionAvailable:n2,onAction:()=>{e2.action&&ve(e2.action.id),_e(e2.id)},onDismiss:()=>_e(e2.id)})})}function Ee({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(be,xe,xe);l(()=>{let e3=Se();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(Te,{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 De({role:e2="dialog",dismissOnBackdrop:n2,...r2}){return t(U,{variant:"dialog",role:e2,dismissOnBackdrop:n2??e2!=="alertdialog",...r2})}function Oe({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 ke({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 Ae=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),je=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function Me({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&&Ae(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!Ae(e2)&&!je(e2)}}function Ne({title:e2,meta:r2,leading:i2,value:a2,trailing:o2,href:s2,navigate:c2,onClick:l2,as:u2="div",className:d2,...f2}){let p2=Me({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 Pe({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 Fe=["neutral","strong","accent","info","success","warning","danger"],Ie=()=>typeof process>"u"||false;function K(e2,t2="neutral"){return typeof e2=="string"&&Fe.includes(e2)?e2:(typeof e2=="string"&&e2&&Ie()&&W(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${Fe.join(", ")}); using "${t2}".`),t2)}var Le=["subtle","on-dark","inherit"];function Re(e2,t2){return typeof e2=="string"&&(Le.includes(e2)||Fe.includes(e2))?e2:t2}function ze(e2){return{"data-tone":e2,toned:!Le.includes(e2)}}function Be({children:e2,as:n2="span",tone:r2,tabular:i2=false,className:a2,style:o2}){let{toned:s2,...c2}=ze(Re(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 Ve({title:e2,eyebrow:r2,intro:i2,actions:a2,className:o2,...s2}){return n("header",{...v(s2),className:y("core-page-head",o2),children:[r2&&t(Be,{as:"p",children:r2}),n("div",{className:"core-page-head__row",children:[t("h1",{className:"core-page-head__title",children:e2}),a2!=null&&t("div",{className:"core-page-head__actions",children:a2})]}),i2!=null&&t("p",{className:"core-page-head__intro",children:i2})]})}function He({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(Be,{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 Ue({label:r2,children:i2,arrow:a2=true,className:o2,href:s2,action:c2,input:l2,actions:u2,navigate:d2,onClick:f2,...p2}){let m2=Me({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 We=(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 Ge({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??We(e2)})})}function Ke({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 qe={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function Je({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??qe[c2],children:n2??e2})}var Ye={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function Xe({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":Ye[i2]??"body","data-weight":a2,"data-tone":o2,"data-align":s2,"data-truncate":c2||void 0,"data-lines":p2,children:n2??e2})}function Ze({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 q(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 J(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function Qe({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=q(o2,u2,d2),[x2,S2]=h(r2??false),C2=e2??x2,w2=J(i2,a2);return t(Ze,{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 $e({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=q(s2,w2,d2),[E2,D2]=h(i2??[]),O2=r2??E2,k2=J(a2,o2),A2=v2!==void 0&&O2.length>=v2;return t(Ze,{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 et({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=q(o2,l2,u2),[w2,T2]=h(r2??{from:null,to:null}),E2=e2??w2,D2=J(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(Ze,{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 tt(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=q(s2,u2,d2),[T2,E2]=h(i2??null),D2=r2===void 0?T2:r2,O2=J(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(Ze,{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:tt(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 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,orientation:g2="vertical",className:_2,style:v2,ref:b2}){let x2=q(s2,u2,d2),[S2,C2]=h(i2??null),w2=r2===void 0?S2:r2,T2=J(a2,o2),E2=c2??x2.control;return t(Ze,{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 it=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function at({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=q(s2,d2,f2),[N2,P2]=h(i2),F2=r2===void 0?N2:r2,I2=J(a2,o2),L2=e3=>e3==null?"":String(e3),[R2,z2]=h(L2(F2));l(()=>{e2==="number"&&it(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"?it(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(Ze,{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 ot({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(at,{...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 st({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=q(s2,u2,d2),[S2,C2]=h(i2??null),w2=r2===void 0?S2:r2,T2=J(a2,o2);return t(Ze,{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 ct({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=q(o2,l2,u2),[w2,T2]=h(r2??m2),E2=e2??w2,D2=J(i2,a2);return t(Ze,{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 lt({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=q(o2,l2,u2),[v2,b2]=h(r2??false),x2=e2??v2,S2=J(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 ut({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=q(o2,l2,u2),[O2,k2]=h(r2??""),A2=e2??O2,j2=J(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(Ze,{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 dt({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":K(r2),"data-variant":i2,children:n2??e2})}function ft({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 pt={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 mt({title:e2,message:r2,children:i2,tone:a2,action:o2,onDismiss:s2,className:c2,...l2}){let u2=K(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:pt[u2]??pt.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 ht({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":K(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 gt({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 _t({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 vt({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 yt({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=Me({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 bt({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=Me({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 xt({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=Me({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 St({href:r2,children:i2,label:a2,variant:o2="default",className:s2,navigate:c2,onClick:l2,...u2}){let d2=Me({href:r2,navigate:c2,onClick:l2});return Ae(r2)||je(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 Ct({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 wt({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 Tt({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 Et={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function Dt({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":Et[a2]??Et["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 Ot=Dt;function kt({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 At({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 jt({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 Mt=["page-x-of-y","page-number","page-count"],Nt={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:11,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},Pt={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)"},Ft=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],It=[{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:Pt,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:Nt,floorPx:11,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:Ft,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:Ft,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.45)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...Nt,eyebrow:{...Nt.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:[]}}],Lt=new Map;function Rt(e2){Lt.set(e2.id,e2)}for(let e2 of It)Rt(e2);function zt(){return[...Lt.keys()].sort()}function Bt(e2){let t2=Lt.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${zt().join(", ")}`);if(!t2.extends)return t2;let n2=Lt.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 Vt(){let e2={};for(let t2 of zt())try{e2[t2]=Bt(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var Ht=Object.freeze(Vt()),Ut="workbook";function Wt(e2,t2){try{return Bt(e2)}catch{return W(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function Y(e2,t2){return e2===void 0?(W("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${Ut}". If this document is an instrument, its numbering and depth are being dropped.`),Wt(Ut,t2)):Wt(e2,t2)}var Gt=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),Kt=["full","muted","subtle","border","accent","accentText","sunken"],qt=["structural","hairline","head","row"],Jt=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],Yt=3,Xt="initial";function Zt(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??Xt,"--doc-rail-width":e2.rail.width??Xt,"--doc-rail-gutter":e2.rail.gutter??Xt,"--doc-floor":`${e2.floorPx}px`};for(let n2 of Kt)t2[`--doc-ink-${Gt(n2)}`]=e2.ink[n2];for(let n2 of qt)t2[`--doc-rule-${n2}`]=e2.rules[n2]??Xt;for(let n2 of Jt){let r2=e2.type[n2],i2=`--doc-type-${Gt(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<=Yt;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??Xt;return t2}var Qt=(e2,t2)=>`${e2} {
2
2
  ${Object.entries(t2).map(([e3,t3])=>` ${e3}: ${t3};`).join("\n")}
3
- }`;function ut(e2,t2){return e2.map(e3=>lt(e3.id===t2?`:root,
4
- [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,ct(e3))).join("\n\n")}var dt=["prose","clause","definitions","table","notice","figure","execution"],ft=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,J="[a-z0-9][a-z0-9_-]*",pt=RegExp(`^(?:(${J}):)?(${J}(?:\\.${J})*)(?:#(${J}))?$`);RegExp(`^${J}$`);function mt(e2,t2){let n2=e2.trim(),r2=pt.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function ht(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function gt(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(ft.source,"g"))){let i2=mt(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 _t(e2){return e2.includes("{{ref:")}var Y=e2=>e2?{"data-profile":e2}:{},vt=e2=>e2?.fills===false?{"data-fills":"none"}:{},yt={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function bt({children:e2,tone:r2="note",title:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??K(a2,"Aside"),u2=l2?.fills===false;return n("aside",{className:_("core-aside",s2),"data-tone":r2,...Y(o2?.id??a2),...vt(l2),style:c2,children:[u2?null:t("span",{className:"core-aside__icon","aria-hidden":true,children:yt[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 xt({children:e2,profileId:n2,profile:r2,full:i2=false,className:a2,style:o2}){return r2||K(n2,"Prose"),t("div",{className:_("core-prose",a2),"data-full":i2?"":void 0,...Y(r2?.id??n2),style:o2,children:e2})}function St({children:e2,citation:r2,className:i2,style:a2}){return n("figure",{className:_("core-quote",i2),style:a2,children:[t("blockquote",{className:"core-quote__body",children:e2}),r2&&n("figcaption",{className:"core-quote__citation",children:["— ",r2]})]})}function Ct({term:e2,description:r2,pairs:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||K(a2,"Definition");let l2=i2??(e2===void 0?[]:[{term:e2,description:r2}]);return t("dl",{className:_("core-definition",s2),...Y(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 wt="katex";function Tt(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 Et=e2=>import(e2),Dt;function Ot(){return Dt??=Tt(wt)?Et(wt).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),Dt}function kt({children:e2="",mode:n2="inline",className:r2}){let i2=p(null),[a2,o2]=m(null),[s2,l2]=m(null),u2=`${n2}:${e2}`;return c(()=>{let e3=true;return Ot().then(t2=>{e3&&t2&&o2(()=>t2)}),()=>{e3=false}},[]),c(()=>{if(a2&&i2.current&&s2!==u2)try{a2.render(e2,i2.current,{displayMode:n2==="block",throwOnError:false})}catch{l2(u2)}},[a2,e2,n2,u2,s2]),!a2||s2===u2?t("span",{className:_("core-math",r2),"data-mode":n2,"data-fallback":"",title:"KaTeX not available — showing TeX source",children:e2}):t("span",{ref:i2,className:_("core-math",r2),"data-mode":n2})}function At(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 jt=i(null);function Mt(){return s(jt)}function Nt({children:e2}){let[n2,r2]=f(At,{footnotes:[]}),i2=p(0),a2=o(e3=>{i2.current+=1;let t2=i2.current;return r2({type:"register",entry:{...e3,number:t2}}),t2},[]),s2=o(e3=>r2({type:"unregister",id:e3}),[]),c2=d(()=>({state:n2,registerFootnote:a2,unregisterFootnote:s2}),[n2,a2,s2]);return t(jt.Provider,{value:c2,children:e2})}function Pt({children:e2}){let r2=l(),i2=Mt(),[a2,o2]=m(null);return c(()=>{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 Ft({children:e2,caption:r2,profileId:i2,profile:a2,className:o2,style:s2}){return a2||K(i2,"Figure"),n("figure",{className:_("core-figure",o2),...Y(a2?.id??i2),style:s2,children:[t("div",{className:"core-figure__body",children:e2}),r2&&t("figcaption",{className:"core-figure__caption",children:r2})]})}function It({className:e2}){return t("div",{className:_("core-page-break",e2),"aria-hidden":true})}function Lt({children:e2,as:n2="div",profileId:r2,profile:i2,tone:a2="subtle",className:o2,style:s2}){return i2||K(r2,"DocumentLabel"),t(n2,{className:_("core-document-label",o2),"data-tone":a2,...Y(i2?.id??r2),style:s2,children:e2})}var Rt=["one","two","three","four","five","six","seven","eight","nine","ten"];function zt(e2){if(e2.length!==1)return null;let t2=e2[0],n2=Rt[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function Bt(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function Vt(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 Ht(e2,t2){return e2?.[t2]??t2}function Ut({target:e2,form:n2,sectionReferences:r2,sectionNumbers:i2,sectionTitles:a2,sectionAnchors:o2,profileId:s2,profile:c2,className:l2,style:u2}){let d2=c2??K(s2,"Reference"),f2=mt(e2),p2=r2?.[e2],m2=p2?.openable===false,h2=f2!==null&&f2.doc===void 0,g2=f2?ht(f2.unit):e2,v2=p2?.number??(h2&&f2.element===void 0?i2?.[g2]:void 0),y2=p2?.title??(h2&&f2.element===void 0?a2?.[g2]:void 0),b2=null;if(f2?.element!==void 0){let e3=p2?.element;b2=e3?Vt(p2.number,e3.shape,d2?.depth.numbering)[e3.index]??null:null}else v2&&(b2=Bt(v2));let x2=n2==="full"||f2?.doc!==void 0&&n2!=="title",S2;S2=m2?null:n2==="title"?y2??b2:x2&&b2&&y2&&f2?.element===void 0?`${b2} (${y2})`:b2??y2??null;let C2=S2!==null,w2=C2?p2?p2.href:`#${Ht(o2,g2)}`:void 0,T2={className:_("core-reference",l2),"data-target":e2,"data-unresolved":C2||m2?void 0:"","data-closed":m2?"":void 0,...Y(c2?.id??s2),style:u2};return w2?t("a",{href:w2,...T2,children:S2}):t("span",{...T2,children:S2??e2})}function Wt({columns:e2,rows:r2,caption:i2,profileId:a2,profile:o2,className:s2,style:c2}){return o2||K(a2,"DocumentTable"),e2.length===0?null:n("div",{className:_("core-document-table",s2),...Y(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))})]})]})}function Gt({items:e2,profileId:r2,profile:i2,markerWidth:a2=44,secondaryWidth:o2=190,missingLabel:s2="Not answered yet",className:c2,style:l2}){return i2||K(r2,"RowList"),e2.length===0?null:t("div",{className:_("core-row-list",c2),...Y(i2?.id??r2),style:y({"--core-row-list-marker-width":v(a2),"--core-row-list-secondary-width":v(o2)},l2),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: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:e3.secondary})]},r3))})}var Kt=190;function qt({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:_("core-answer-rows",o2),...Y(r2?.id??n2),style:s2,children:t(Gt,{items:c2,profileId:n2,profile:r2,secondaryWidth:a2,missingLabel:i2})})}function X(e2){if(e2==null)return"";if(typeof e2=="string")return e2;let t2=e2.precision??(e2.format==="number"?Jt(e2.value):void 0),n2=Yt(e2.format,e2.value,{precision:t2,signed:e2.signed});return e2.unit&&n2!=="—"?`${n2} ${e2.unit}`:n2}function Jt(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 Yt(e2,t2,n2={}){if(!Number.isFinite(t2))return"—";let r2=n2.signed===true,i2=t2<0,a2=Math.abs(t2),o2=i2?"-":r2?"+":"";switch(e2){case"currency":{let e3=n2.precision??0;return`${o2}$${a2.toLocaleString("en-CA",{minimumFractionDigits:e3,maximumFractionDigits:e3})}`}case"currency-k":{let e3=n2.precision??0;return a2>=1e3?`${o2}$${(a2/1e3).toFixed(e3)}k`:`${o2}$${a2.toFixed(0)}`}case"currency-m":{let e3=n2.precision??1;return a2>=1e6?`${o2}$${(a2/1e6).toFixed(e3)}M`:a2>=1e3?`${o2}$${(a2/1e3).toFixed(0)}k`:`${o2}$${a2.toFixed(0)}`}case"currency-compact":{if(a2>=1e9){let e4=n2.precision??1;return`${o2}$${(a2/1e9).toFixed(e4)}B`}if(a2>=1e6){let e4=n2.precision??1;return`${o2}$${(a2/1e6).toFixed(e4)}M`}if(a2>=1e3){let e4=n2.precision??1;return`${o2}$${(a2/1e3).toFixed(e4)}k`}let e3=n2.precision??0;return`${o2}$${a2.toFixed(e3)}`}case"currency-monthly":{let e3=n2.precision??0;return`${o2}$${a2.toLocaleString("en-CA",{minimumFractionDigits:e3,maximumFractionDigits:e3})}/mo`}case"percent":{let e3=n2.precision??1;return`${o2}${a2.toFixed(e3)}%`}case"age":return`Age ${Math.round(t2)}`;case"years":{let e3=n2.precision??0;return`${o2}${a2.toFixed(e3)} yrs`}case"number":{let e3=n2.precision??0;return`${o2}${a2.toLocaleString("en-CA",{minimumFractionDigits:e3,maximumFractionDigits:e3})}`}default:{let e3=n2.precision??0;return`${o2}$${(a2/1e3).toFixed(e3)}k`}}}var Xt=40;function Zt({bars:e2,target:r2,targetLabel:i2,max:a2,profileId:o2,profile:s2,className:c2,style:l2}){let u2=s2??K(o2,"ComparisonBars");if(e2.length===0)return null;let d2=e2.map(e3=>e3.value),f2=a2??Math.max(...d2,r2??0);if(!Number.isFinite(f2)||f2<=0)return F("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=r2!==void 0&&r2>0&&r2<=f2?r2/f2*100:void 0;return n("figure",{className:_("core-comparison-bars",c2),...Y(s2?.id??o2),...vt(u2),style:l2,children:[e2.map(e3=>{let r3=Math.max(0,Math.min(100,e3.value/f2*100));return n("div",{className:"core-comparison-bars__bar",style:y({"--core-comparison-bars-value":`${r3}%`}),children:[t("div",{className:"core-comparison-bars__label",children:e3.label}),n("div",{className:"core-comparison-bars__track",style:y({"--core-comparison-bars-target":p2===void 0?void 0:`${p2}%`}),children:[t("div",{className:"core-comparison-bars__fill"}),t("span",{className:"core-comparison-bars__value","data-placement":r3>Xt?"inside":"outside",children:X(e3.display)}),p2!==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 Qt=3,$t=5;function en({items:e2,profileId:r2,profile:i2,checkboxes:a2=true,className:o2,style:s2}){return i2||K(r2,"NextSteps"),e2.length===0?null:((e2.length<Qt||e2.length>$t)&&F(`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:_("core-next-steps",o2),...Y(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 tn=38;function nn({title:e2="Notes",lines:r2=4,profileId:i2,profile:a2,className:o2,style:s2}){return a2||K(i2,"Notes"),r2<1?null:n("section",{className:_("core-notes",o2),...Y(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 rn="You left this section open, so it is not covered here.";function an({wouldTell:e2,openingLine:r2=rn,profileId:i2,profile:a2,className:o2,style:s2}){return a2||K(i2,"SkippedSection"),n("div",{className:_("core-skipped-section",o2),...Y(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 on="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 sn({advisor:e2,title:r2="Talk it through",invitation:i2=on,profileId:a2,profile:o2,className:s2,style:c2}){if(o2||K(a2,"TalkItThrough"),!e2?.name?.trim())return F("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&&F("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:_("core-talk-it-through",s2),...Y(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 cn=38;function ln({question:e2,answer:r2,lines:i2=1,profileId:a2,profile:o2,className:s2,style:c2}){o2||K(a2,"WriteInField");let l2=typeof r2=="string"&&r2.trim().length>0,u2=Math.max(1,i2);return n("div",{className:_("core-write-in-field",s2),"data-answered":l2?"":void 0,...Y(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 un({mark:e2,identity:r2,codes:i2,profileId:a2,profile:o2,className:s2,style:c2}){return o2||K(a2,"Masthead"),e2===void 0&&r2===void 0&&i2===void 0?null:n("header",{className:_("core-masthead",s2),"data-page-region":"page-header",...Y(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 dn=4;function fn({fields:e2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=(i2??K(r2,"MetaRail"))?.rail.placement??"strip";return s2==="none"||e2.length===0?null:(s2!=="column"&&e2.length>dn&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${dn}. Rendering all of them — check the layout.`),t("div",{className:_("core-meta-rail",a2),"data-placement":s2,...Y(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 pn={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function mn({left:e2,centre:n2,right:r2,profileId:i2,profile:a2,className:o2,style:s2}){a2||K(i2,"RunningFooter");let c2=[["left",e2],["centre",n2],["right",r2]].filter(([,e3])=>e3!=null);return c2.length===0?null:t("footer",{className:_("core-running-footer",o2),"data-page-region":"page-footer",...Y(a2?.id??i2),style:s2,children:c2.map(([e3,n3])=>t("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":pn[e3],children:n3},e3))})}function hn({children:r2,rail:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??K(a2,"DocumentShell"),u2=l2?.rail.placement==="column"&&i2!==void 0;return t(Nt,{children:n("div",{className:_("core-document-shell",s2),...Y(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 gn(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function _n({entries:e2,depth:r2,title:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??K(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:_("core-contents",s2),...Y(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:gn(e3.ordinal,e3.level);return n("li",{className:"core-contents__entry","data-level":e3.level,"data-overdeep":e3.level>=u2?"":void 0,style:y({"--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 vn({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 yn({attestation:e2,label:r2,signatories:i2,columns:a2=1,note:o2,profileId:s2,profile:c2,className:l2,style:u2}){c2||K(s2,"ExecutionBlock");let d2=Array.isArray(i2)?i2:[];return n("section",{className:_("core-execution-block",l2),...Y(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(vn,{s:e3,dated:e3.dated===true},n2))}),o2?t("div",{className:"core-execution-block__note",children:o2}):null]})}function bn({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 xn({blocks:e2,profileId:n2,sectionNumbers:r2,sectionAnchors:i2,sectionTitles:a2,sectionReferences:o2,sectionOrdinal:s2,className:c2,style:l2}){let u2=K(n2,"DocumentBlocks");if(e2.length===0)return null;let d2=Vt(s2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),u2?.depth.numbering),f2=0,p2=(e3,s3)=>_t(e3)?gt(e3).map((e4,c3)=>e4.kind==="text"?e4.text:t(Ut,{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:_("core-document-blocks",c2),"data-pinned":m2?"execution":void 0,...Y(n2),style:l2,children:e2.map((e3,r3)=>{let i3=`${e3.kind}-${r3}`;switch(e3.kind){case"prose":return t(xt,{profileId:n2,full:e3.full,children:p2(e3.text,i3)},i3);case"clause":return t(Gt,{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(Ct,{profileId:n2,pairs:e3.pairs.map((e4,t2)=>({term:e4.term,description:p2(e4.description,`${i3}-${t2}`)}))},i3);case"table":return t(Wt,{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(bt,{profileId:n2,tone:e3.tone,title:e3.title,children:p2(e3.text,i3)},i3);case"figure":return t(Ft,{profileId:n2,caption:p2(e3.caption,i3),children:e3.placeholder??null},i3);case"execution":return t(yn,{profileId:n2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},i3);default:return t(bn,{kind:String(e3.kind)},i3)}})})}var Sn=["h2","h3","h4","h5","h6"];function Cn({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:v2,style:b2}){let x2=g2??K(h2,"DocumentSection"),S2=o2?.[e2],C2=u2?.[e2],w2=S2??a2,T2=C2===void 0?i2:Math.max(0,C2-1),E2=T2>=(x2?.depth.max??Infinity),D2=Math.min(T2,(x2?.depth.indent.length??1)-1)+1,O2=x2?.depth.numbering==="ladder"&&w2!==void 0&&w2.length>0,k2=O2?zt(w2):null,A2=Sn[Math.min(T2,Sn.length-1)],j2=Ht(s2,e2),M2=`${j2}-doc-heading`;return n("section",{id:j2,className:_("core-document-section",v2),"data-level":T2,"data-ordinal-source":w2?S2?"derived":"baked":void 0,"data-overdeep":E2?"":void 0,"aria-labelledby":M2,...Y(g2?.id??h2),style:y({"--core-document-section-indent":`var(--doc-indent-${D2}, 0)`},b2),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(xn,{blocks:m2,profileId:h2,sectionNumbers:o2,sectionAnchors:s2,sectionTitles:c2,sectionReferences:l2,sectionOrdinal:O2?w2:void 0}):null)})]})}var wn={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"}}}},Tn=["md","lg","xl"],En=5;function Dn(e2){let t2=Tn.indexOf(e2);return t2>0?Tn[t2-1]:e2}var On=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function kn(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function An({value:e2,label:r2,size:i2="lg",tone:a2,progress:o2,progressLabel:s2,autoStepDown:c2=true,className:l2,style:u2}){let d2=On(e2)?X(e2):e2,f2=typeof d2=="string"||typeof d2=="number"?String(d2).length:0,p2=c2&&f2>En?Dn(i2):i2,m2=B(a2,"strong"),{toned:h2,...g2}=ee(m2),v2=o2==null?null:kn(o2);return n("div",{className:_("core-stat",h2&&"core-toned",l2),...g2,"data-size":p2,style:u2,children:[t("div",{className:"core-stat__value",children:d2}),r2!=null&&t(V,{className:"core-stat__label",tone:m2==="on-dark"||m2==="inherit"?m2:"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:y({"--core-stat-progress":`${v2}%`}),children:t("div",{className:"core-stat__progress-fill"})})]})}function jn({children:e2,minColumnWidth:n2=200,maxColumns:r2=4,gap:i2=32,className:a2,style:o2}){return t("div",{className:_("core-stat-group",a2),style:y({"--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 Mn={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function Nn({direction:e2="up",delay:n2=0,duration:r2=.5,threshold:i2=.15,once:a2=true,className:o2,style:s2,children:l2}){let u2=p(null),[d2,f2]=m(false);c(()=>{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[h2,g2]=Mn[e2];return t("div",{ref:u2,className:_("core-reveal",o2),"data-revealed":d2?"true":"false",style:y({"--core-reveal-x":`${h2}px`,"--core-reveal-y":`${g2}px`,"--core-reveal-duration":`${r2}s`,"--core-reveal-delay":`${n2}s`},s2),children:l2})}function Pn({eyebrow:e2,title:r2,description:i2,trailing:a2,revealDelay:o2=0,className:s2,style:c2}){return t(Nn,{direction:"up",delay:o2,className:_("core-section-header",s2),style:c2,children:n("div",{className:"core-section-header__inner","data-described":i2?"true":void 0,children:[n("div",{className:"core-section-header__text",children:[e2?t(V,{className:"core-section-header__eyebrow",children:e2}):null,t("h2",{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 Fn({tone:e2,label:r2,headline:i2,children:a2,trailing:o2,className:s2,style:c2}){let l2=R(e2,"accent"),u2=o2!=null&&o2!=="";return n("div",{className:_("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 In({label:r2,children:i2,className:a2,style:o2}){return n("div",{className:_("core-disclaimer-block",a2),style:o2,children:[r2?n(e,{children:[t("strong",{className:"core-disclaimer-block__label",children:r2})," "]}):null,i2]})}function Ln(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Rn({label:e2,value:r2,fillPercent:i2,subtitle:a2,tone:o2,className:s2,style:c2}){let l2=Ln(i2);return n("div",{className:_("core-stat-strip","core-toned",s2),"data-tone":R(o2,"info"),style:y({"--core-stat-strip-fill":`${l2}%`},c2),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:X(r2)})]}),t("div",{className:"core-stat-strip__track",children:t("div",{className:"core-stat-strip__fill"})}),a2?t("div",{className:"core-stat-strip__subtitle",children:X(a2)}):null]})}function zn({text:e2,tone:n2,className:r2}){return t("span",{className:_("core-value-badge","core-toned",r2),"data-tone":R(n2),children:X(e2)})}var Bn=8,Vn={good:"success",warn:"warning",critical:"danger"};function Hn(e2,t2,n2){let r2={series:String(n2%Bn+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)%Bn+1)};let o2=Vn[i2];return o2?{tone:o2}:I.includes(i2)?{tone:i2}:(F("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 Un(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 Wn(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=Array.isArray(c2)?c2:[],m2=Un(r2);return n("div",{className:_("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:[m2?t("div",{className:"core-option-card__number","data-kind":m2.kind,children:m2.text}):t("span",{}),o2!=null&&o2!==""?t(zn,{text:o2,tone:R(s2)}):null]}),i2?t("div",{className:"core-option-card__title",children:i2}):null,a2?t("p",{className:"core-option-card__description",children:a2}):null,p2.map((e3,r3)=>{let i3=Hn(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:R(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:_("core-option-card__bar-value",o3&&"core-toned"),"data-tone":o3,children:X(e3.value)})]}),t("div",{className:"core-option-card__track",children:t("div",{className:_("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:y({"--core-option-card-fill":`${a3}%`})})})]},r3)})]})}function Gn(e2){let{title:r2,subtitle:i2,rows:a2,className:o2,style:s2}=e2,c2=e2.tone??"info",l2=c2==="none",u2=Array.isArray(a2)?a2:[];return n("div",{className:_("core-profile-card",!l2&&"core-toned",o2),"data-tone":l2?void 0:R(c2,"info"),"data-marker":l2?"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]}),u2.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:X(e3.value)}),e3.badge?t(zn,{text:e3.badge.text,tone:R(e3.badge.tone)}):null]})]},r3))]})}function Kn(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 qn={up:"▲",down:"▼",flat:"—"},Jn={up:"success",down:"danger",flat:void 0},Z=e2=>e2!=null&&e2!=="";function Yn(e2){let{columns:r2=4,gap:i2="tight",minColumnWidth:a2,className:o2,style:s2}=e2,c2=Array.isArray(e2.cards)?e2.cards:[],l2=Math.max(1,Math.min(6,Math.round(Number(r2))||4));return t("div",{className:_("core-kpi-card-grid",o2),"data-gap":i2==="normal"?"normal":"tight",style:y({"--core-kpi-card-grid-columns":String(l2),"--core-kpi-card-grid-min":typeof a2=="number"&&a2>0?`${a2}px`:void 0},s2),children:c2.map((e3,r3)=>{let{subtitle:i3,badge:a3}=e3,o3=Z(e3.tone)?R(e3.tone):void 0,s3=Z(e3.delta)?Kn(e3.delta):void 0,c3=s3?Jn[s3]:void 0;return t(Nn,{direction:"up",delay:r3*.06,className:"core-kpi-card-grid__item",children:n("div",{className:_("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&&Z(a3.text)?t(zn,{text:a3.text,tone:R(a3.tone)}):null]}),t("div",{className:"core-kpi-card-grid__value",children:X(e3.value)}),s3?n("div",{className:_("core-kpi-card-grid__delta",c3&&"core-toned"),"data-tone":c3,"data-direction":s3,children:[t("span",{"aria-hidden":"true",children:qn[s3]})," ",X(e3.delta)]}):null,Z(i3)?t("div",{className:"core-kpi-card-grid__subtitle",children:X(i3)}):null]})},r3)})})}function Xn(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return R(e2)}var Zn=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),Qn=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!a(e2)&&"value"in e2&&!("format"in e2));function $n(e2){return Qn(e2)?e2:{value:e2}}var er=/^\d{4}-\d{2}-\d{2}$/,tr=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function nr(e2,t2){if(!tr.test(e2))return e2;let n2=er.test(e2),r2=new Date(n2?`${e2}T00:00:00Z`:e2.replace(" ","T"));return Number.isNaN(r2.getTime())?e2:r2.toLocaleString("en-CA",{year:"numeric",month:"short",day:"numeric",...t2==="datetime"&&!n2?{hour:"numeric",minute:"2-digit"}:{},...n2?{timeZone:"UTC"}:{}})}function rr(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)}function ir(e2,t2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&t2?nr(e2,t2):typeof e2=="string"&&!t2?X(rr(e2)):typeof e2=="string"||Zn(e2)?X(e2):typeof e2=="number"?String(e2):a(e2)?e2:null}function ar({title:e2,subtitle:r2,columns:i2,rows:a2,className:o2,style:s2}){let c2=`${l()}-title`,u2=Array.isArray(i2)?i2:[],d2=Array.isArray(a2)?a2:[],f2=e3=>u2[e3]?.align??(e3===0?"left":"right");return t(Nn,{direction:"up",children:n("div",{className:_("core-data-table",o2),style:s2,children:[e2||r2?n("div",{className:"core-data-table__head",children:[e2?t("div",{id:c2,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?c2:void 0,tabIndex:0,children:n("table",{className:"core-data-table__table",children:[t("thead",{children:t("tr",{children:u2.map((e3,r3)=>n("th",{scope:"col",className:"core-data-table__col","data-align":f2(r3),style:y({"--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:d2.map((e3,n2)=>{let{highlighted:r3,total:i3}=e3,a3=e3.cells,o3=Array.isArray(a3)?a3:a3&&typeof a3=="object"?u2.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((e4,n3)=>{let r4=$n(e4),i4=Xn(r4.tone),a4={className:_("core-data-table__cell",i4&&"core-toned"),"data-align":f2(n3),"data-tone":i4};return n3===0?t("th",{scope:"row",...a4,children:ir(r4.value,u2[n3]?.format)},n3):t("td",{...a4,children:ir(r4.value,u2[n3]?.format)},n3)})},n2)})})]})})]})})}function or(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}var sr=["accepted","tentative","declined"],cr=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),lr=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2});function ur(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=cr(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} – ${cr(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=cr(t2,n2).format(r2),a2=lr(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} – ${lr(t2,n2).format(o2)}`}var dr=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function fr(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function pr(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function mr(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"?e2.errors||"Some details are missing or not valid.":e2.errors||"Something went wrong. Try again."}function hr(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 Q(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function gr(e2){return Q(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function _r(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Q(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Q(r2,1))n2.push(r2);return n2}return e2.startsAt?[hr(e2.startsAt,t2)]:[]}var $=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function vr(r2){let{event:i2,href:a2,locale:o2,timeZone:s2,className:c2,style:l2}=r2,u2=i2&&typeof i2=="object"?i2:{name:""},d2=ur(u2,o2,s2),f2=u2.status&&u2.status!=="confirmed"?u2.status:void 0,p2=n(e,{children:[n("div",{className:"core-event-card__top",children:[u2.typeName?t("span",{className:"core-event-card__type",children:u2.typeName}):null,f2?t("span",{className:"core-event-card__status","data-status":f2,children:f2}):null]}),t("div",{className:"core-event-card__name",children:u2.name}),d2?t("div",{className:"core-event-card__when",children:d2}):null,u2.location?t("div",{className:"core-event-card__where",children:u2.location}):null]});return t("div",{className:_("core-event-card",c2),"data-kind":u2.kind,"data-status":u2.status,style:l2,children:a2?t("a",{className:"core-event-card__link",href:a2,children:p2}):p2})}var yr={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function br(e2){let{actions:r2,className:i2,style:a2}=e2,[o2,s2]=m(e2.response),[c2,l2]=m(false),[u2,d2]=m(""),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(mr(t2))};return n("div",{className:_("core-event-respond",i2),style:a2,children:[t("div",{className:"core-event-respond__choices",role:"group","aria-label":"Your response",children:sr.map(e3=>t("button",{type:"button",className:"core-event-respond__choice","aria-pressed":o2===e3,disabled:!f2||c2,onClick:()=>void p2(e3),children:yr[e3]},e3))}),u2?t("p",{className:"core-event-respond__message",role:"alert",children:u2}):null]})}function xr(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=ur(u2,o2,s2);return n("article",{className:_("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(br,{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 Sr=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 Cr(e2){let{orgId:r2,projectId:i2,actions:a2,onDone:o2,canWriteStaffNotes:s2,className:c2,style:u2}=e2,f2=Array.isArray(e2.types)?e2.types:[],p2=l(),[h2,g2]=m(e2.defaultTypeId??f2[0]?.id??""),v2=f2.find(e3=>e3.id===h2),y2=v2?.kind==="scheduled",[b2,x2]=m(""),[S2,C2]=m(pr()),[w2,T2]=m(""),[E2,D2]=m(""),[O2,k2]=m({}),[A2,j2]=m(""),[M2,N2]=m(!!s2),[P2,F2]=m(false),[I2,L2]=m(""),R2=d(()=>Sr(v2),[v2]);if(!f2.length)return t("p",{className:_("core-event-log","core-event-log__empty",c2),style:u2,children:"There's nothing you can log here."});let z2=async t2=>{if(t2.preventDefault(),!a2?.logEvent||P2||!v2)return;F2(true),L2("");let n2=fr(S2),c3={event_type_id:v2.id,org_id:r2,name:b2.trim()||v2.name,starts_at:n2,tzid:dr(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};i2&&(c3.project_id=i2),y2&&w2&&(c3.ends_at=fr(w2)),E2.trim()&&(c3.location=E2.trim());let l2=A2.trim()?[{body:A2.trim(),audience:s2&&M2?"staff":"shared"}]:void 0,u3=await a2.logEvent(l2?{event:c3,notes:l2}:{event:c3});F2(false),u3.success?(x2(""),j2(""),k2({}),o2?.(u3)):L2(mr(u3))},B2=(e3,t2)=>k2(n2=>({...n2,[e3]:t2}));return n("form",{className:_("core-event-log",c2),style:u2,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:h2,onChange:e3=>{g2(e3.target.value),k2({})},children:f2.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:v2?.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:y2?"Starts":"When"}),t("input",{type:"datetime-local",required:true,value:S2,onChange:e3=>C2(e3.target.value)})]}),y2?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…":y2?"Schedule":"Log"})})]})}var wr=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Tr(e2){let{view:r2="week",weekParam:i2="week",eventHref:a2="?panel=event:{id}",locale:o2,timeZone:s2,renderComponent:c2,className:l2,style:u2}=e2,d2=Array.isArray(e2.occurrences)?e2.occurrences:[],f2=hr(new Date,s2),p2=gr(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:f2),m2=Array.from({length:7},(e3,t2)=>Q(p2,t2)),h2=new Map(m2.map(e3=>[e3,[]]));for(let e3 of d2)for(let t2 of _r(e3,s2))h2.get(t2)?.push(e3);for(let e3 of h2.values())e3.sort((e4,t2)=>+!e4.startOn-!t2.startOn||(e4.startsAt??"").localeCompare(t2.startsAt??""));let g2=r2==="agenda"?m2.filter(e3=>h2.get(e3).length):m2;return n("section",{className:_("core-event-schedule",l2),"data-view":r2,style:u2,"aria-label":"Schedule",children:[n("div",{className:"core-event-schedule__nav",children:[t("a",{className:"core-event-schedule__step",href:`?${i2}=${Q(p2,-7)}`,"aria-label":"Previous week",children:"‹"}),t("span",{className:"core-event-schedule__range",children:`${wr(m2[0],o2)} – ${wr(m2[6],o2)}`}),t("a",{className:"core-event-schedule__step",href:`?${i2}=${Q(p2,7)}`,"aria-label":"Next week",children:"›"})]}),g2.length===0?t("p",{className:"core-event-schedule__empty",children:"Nothing scheduled this week."}):null,t("ol",{className:"core-event-schedule__days",children:g2.map(e3=>{let r3=h2.get(e3);return n("li",{className:"core-event-schedule__day","data-today":e3===f2||void 0,children:[t("h3",{className:"core-event-schedule__date",children:wr(e3,o2)}),r3.length?t("ul",{className:"core-event-schedule__events",children:r3.map((e4,n2)=>t("li",{children:or(e4,c2,{href:$(a2,e4.id),locale:o2,timeZone:s2})??t(vr,{event:e4,href:$(a2,e4.id),locale:o2,timeZone:s2})},`${e4.id??n2}-${e4.startsAt??e4.startOn??n2}`))}):t("p",{className:"core-event-schedule__none",children:"—"})]},e3)})})]})}var Er=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Dr(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=hr(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:_("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:Er(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?or(e4.event,s2,{href:$(r2,e4.event.id),locale:a2,timeZone:o2})??t(vr,{event:e4.event,href:$(r2,e4.event.id),locale:a2,timeZone:o2}):null]},e4.id??`${e4.at}-${i4}`))})]},e3))]})}export{Kt as ANSWER_COLUMN_PX,Le as Accordion,qt as AnswerRows,bt as Aside,ae as Avatar,dt as BLOCK_KINDS,wn as BLOCK_SCHEMAS,we as Badge,b as Box,Me as Button,Re as Card,x as Center,de as Checkbox,fe as CheckboxGroup,Ne as Chip,oe as Code,Be as Columns,Zt as ComparisonBars,S as Container,_n as Contents,tt as DEFAULT_PROFILE_ID,ar as DataTable,pe as DateRange,Ct as Definition,In as DisclaimerBlock,He as Disclosure,C as Divider,xn as DocumentBlocks,Lt as DocumentLabel,Cn as DocumentSection,hn as DocumentShell,Wt as DocumentTable,Te as EmptyState,vr as EventCard,xr as EventDetail,Cr as EventLogForm,br as EventRespond,Tr as EventSchedule,Dr as EventTimeline,yn as ExecutionBlock,V as Eyebrow,Ft as Figure,he as FileField,Pt as Footnote,H as FormField,Ue as Grid,ce as Heading,w as Hide,Fn as HighlightBox,Pe as IconButton,T as Inline,Yn as KpiCardGrid,Fe as Link,M as ListRow,un as Masthead,kt as Math,fn as MetaRail,en as NextSteps,nn as Notes,De as Notice,Wn as OptionCard,Ge as PAGINATOR_BINDINGS,It as PageBreak,N as PageFrame,te as PageHead,Gn as ProfileCard,Oe as Progress,xt as Prose,St as Quote,ge as RadioGroup,Ut as Reference,We as Repeat,Gt as RowList,ne as RuleSection,mn as RunningFooter,ye as SearchField,Pn as SectionHeader,Ie as SegmentedControl,be as Select,E as Show,ke as Skeleton,an as SkippedSection,xe as Slider,D as Spacer,Ae as Spinner,Ve as Split,O as Stack,An as Stat,jn as StatGroup,Rn as StatStrip,Se as Switch,I as TONES,sn as TalkItThrough,ue as Text,Ce as TextArea,ve as TextField,je as Tooltip,re as UnderlinedAction,cn as WRITE_HEIGHT_PX,tn as WRITE_LINE_HEIGHT_PX,ln as WriteInField,_ as cx,et as documentProfiles,ur as eventWhen,me as fileSize,Yt as formatValue,ie as initialsOf,B as inkToneOf,v as length,ut as profileCss,Ze as profileIds,ct as profileTokens,Xe as registerProfile,X as renderFormatted,Qe as resolveProfile,$e as resolvedProfiles,_e as toNumber,R as toneOf,or as typeCard,y as vars};
3
+ }`;function $t(e2,t2){return e2.map(e3=>Qt(e3.id===t2?`:root,
4
+ [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,Zt(e3))).join("\n\n")}var en=["prose","clause","definitions","table","notice","figure","execution"],tn=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,nn="[a-z0-9][a-z0-9_-]*",rn=RegExp(`^(?:(${nn}):)?(${nn}(?:\\.${nn})*)(?:#(${nn}))?$`);RegExp(`^${nn}$`);function an(e2,t2){let n2=e2.trim(),r2=rn.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function on(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function sn(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(tn.source,"g"))){let i2=an(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 cn(e2){return e2.includes("{{ref:")}var X=e2=>e2?{"data-profile":e2}:{},ln=e2=>e2?.fills===false?{"data-fills":"none"}:{},un={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function dn({children:e2,tone:r2="note",title:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Y(a2,"Aside"),u2=l2?.fills===false;return n("aside",{className:y("core-aside",s2),"data-tone":r2,...X(o2?.id??a2),...ln(l2),style:c2,children:[u2?null:t("span",{className:"core-aside__icon","aria-hidden":true,children:un[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 fn({children:e2,profileId:n2,profile:r2,full:i2=false,className:a2,style:o2}){return r2||Y(n2,"Prose"),t("div",{className:y("core-prose",a2),"data-full":i2?"":void 0,...X(r2?.id??n2),style:o2,children:e2})}function pn({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 mn({term:e2,description:r2,pairs:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||Y(a2,"Definition");let l2=i2??(e2===void 0?[]:[{term:e2,description:r2}]);return t("dl",{className:y("core-definition",s2),...X(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 hn="katex";function gn(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 _n=e2=>import(e2),vn;function yn(){return vn??=gn(hn)?_n(hn).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),vn}function bn({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 yn().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 xn(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 Sn=a(null);function Cn(){return c(Sn)}function wn({children:e2}){let[n2,r2]=p(xn,{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(Sn.Provider,{value:c2,children:e2})}function Tn({children:e2}){let r2=u(),i2=Cn(),[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 En({children:e2,caption:r2,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Y(i2,"Figure"),n("figure",{className:y("core-figure",o2),...X(a2?.id??i2),style:s2,children:[t("div",{className:"core-figure__body",children:e2}),r2&&t("figcaption",{className:"core-figure__caption",children:r2})]})}function Dn({className:e2}){return t("div",{className:y("core-page-break",e2),"aria-hidden":true})}function On({children:e2,as:n2="div",profileId:r2,profile:i2,tone:a2="subtle",className:o2,style:s2}){return i2||Y(r2,"DocumentLabel"),t(n2,{className:y("core-document-label",o2),"data-tone":a2,...X(i2?.id??r2),style:s2,children:e2})}var kn=["one","two","three","four","five","six","seven","eight","nine","ten"];function An(e2){if(e2.length!==1)return null;let t2=e2[0],n2=kn[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function jn(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function Mn(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 Nn(e2,t2){return e2?.[t2]??t2}function Pn({target:e2,form:n2,sectionReferences:r2,sectionNumbers:i2,sectionTitles:a2,sectionAnchors:o2,profileId:s2,profile:c2,className:l2,style:u2}){let d2=c2??Y(s2,"Reference"),f2=an(e2),p2=r2?.[e2],m2=p2?.openable===false,h2=f2!==null&&f2.doc===void 0,g2=f2?on(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?Mn(p2.number,e3.shape,d2?.depth.numbering)[e3.index]??null:null}else _2&&(b2=jn(_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:`#${Nn(o2,g2)}`:void 0,T2={className:y("core-reference",l2),"data-target":e2,"data-unresolved":C2||m2?void 0:"","data-closed":m2?"":void 0,...X(c2?.id??s2),style:u2};return w2?t("a",{href:w2,...T2,children:S2}):t("span",{...T2,children:S2??e2})}function Fn({columns:e2,rows:r2,caption:i2,profileId:a2,profile:o2,className:s2,style:c2}){return o2||Y(a2,"DocumentTable"),e2.length===0?null:n("div",{className:y("core-document-table",s2),...X(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 In={locale:"en-CA",currency:"CAD"},Ln=e2=>{if(typeof e2!="string"||!e2)return false;try{return Intl.NumberFormat.supportedLocalesOf(e2).length>0}catch{return false}},Rn=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 zn(e2){let t2=typeof e2=="object"&&e2?e2:{};return{locale:Ln(t2.locale)?t2.locale:In.locale,currency:Rn(t2.currency)?t2.currency.toUpperCase():In.currency}}var Bn=new Map;function Vn(e2){let t2=`${e2.locale}|${e2.currency}`,n2=Bn.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("")},Bn.set(t2,n2)}return n2}function Z(e2,t2){if(e2==null)return"";if(typeof e2=="string")return e2;let n2=e2.precision??(e2.format==="number"?Hn(e2.value):void 0),r2=Un(e2.format,e2.value,{precision:n2,signed:e2.signed,locale:t2});return e2.unit&&r2!=="—"?`${r2} ${e2.unit}`:r2}function Hn(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 Un(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??In,c2=(e3,t3)=>e3.toLocaleString(s2.locale,{minimumFractionDigits:t3,maximumFractionDigits:t3}),l2=(e3,t3="")=>{let{prefix:n3,suffix:r3}=Vn(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 Wn=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2);function Gn({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||Y(r2,"RowList"),!Array.isArray(e2)||e2.length===0)return null;let d2=zn(c2),f2=e3=>Wn(e3)?Z(e3,d2):e3;return t("div",{className:y("core-row-list",l2),...X(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 Kn=190;function qn({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),...X(r2?.id??n2),style:s2,children:t(Gn,{items:c2,profileId:n2,profile:r2,secondaryWidth:a2,missingLabel:i2})})}var Jn=40;function Yn({bars:e2,target:r2,targetLabel:i2,max:a2,profileId:o2,profile:s2,baseProps:c2,className:l2,style:u2}){let d2=zn(c2),f2=s2??Y(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 W("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),...X(s2?.id??o2),...ln(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>Jn?"inside":"outside",children:Z(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 Xn=3,Zn=5;function Qn({items:e2,profileId:r2,profile:i2,checkboxes:a2=true,className:o2,style:s2}){return i2||Y(r2,"NextSteps"),e2.length===0?null:((e2.length<Xn||e2.length>Zn)&&W(`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),...X(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 $n=38;function er({title:e2="Notes",lines:r2=4,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Y(i2,"Notes"),r2<1?null:n("section",{className:y("core-notes",o2),...X(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 tr="You left this section open, so it is not covered here.";function nr({wouldTell:e2,openingLine:r2=tr,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Y(i2,"SkippedSection"),n("div",{className:y("core-skipped-section",o2),...X(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 rr="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 ir({advisor:e2,title:r2="Talk it through",invitation:i2=rr,profileId:a2,profile:o2,className:s2,style:c2}){if(o2||Y(a2,"TalkItThrough"),!e2?.name?.trim())return W("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&&W("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),...X(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 ar=38;function or({question:e2,answer:r2,lines:i2=1,profileId:a2,profile:o2,className:s2,style:c2}){o2||Y(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,...X(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 sr({mark:e2,identity:r2,codes:i2,profileId:a2,profile:o2,className:s2,style:c2}){return o2||Y(a2,"Masthead"),e2===void 0&&r2===void 0&&i2===void 0?null:n("header",{className:y("core-masthead",s2),"data-page-region":"page-header",...X(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 cr=4;function lr({fields:e2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=(i2??Y(r2,"MetaRail"))?.rail.placement??"strip";return s2==="none"||e2.length===0?null:(s2!=="column"&&e2.length>cr&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${cr}. Rendering all of them — check the layout.`),t("div",{className:y("core-meta-rail",a2),"data-placement":s2,...X(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 ur={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function dr({left:e2,centre:n2,right:r2,profileId:i2,profile:a2,className:o2,style:s2}){a2||Y(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",...X(a2?.id??i2),style:s2,children:c2.map(([e3,n3])=>t("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":ur[e3],children:n3},e3))})}function fr({children:r2,rail:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Y(a2,"DocumentShell"),u2=l2?.rail.placement==="column"&&i2!==void 0;return t(wn,{children:n("div",{className:y("core-document-shell",s2),...X(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 pr(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function mr({entries:e2,depth:r2,title:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Y(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),...X(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:pr(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 hr({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 gr({attestation:e2,label:r2,signatories:i2,columns:a2=1,note:o2,profileId:s2,profile:c2,className:l2,style:u2}){c2||Y(s2,"ExecutionBlock");let d2=Array.isArray(i2)?i2:[];return n("section",{className:y("core-execution-block",l2),...X(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(hr,{s:e3,dated:e3.dated===true},n2))}),o2?t("div",{className:"core-execution-block__note",children:o2}):null]})}function _r({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 vr({blocks:e2,profileId:n2,sectionNumbers:r2,sectionAnchors:i2,sectionTitles:a2,sectionReferences:o2,sectionOrdinal:s2,className:c2,style:l2}){let u2=Y(n2,"DocumentBlocks");if(e2.length===0)return null;let d2=Mn(s2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),u2?.depth.numbering),f2=0,p2=(e3,s3)=>cn(e3)?sn(e3).map((e4,c3)=>e4.kind==="text"?e4.text:t(Pn,{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,...X(n2),style:l2,children:e2.map((e3,r3)=>{let i3=`${e3.kind}-${r3}`;switch(e3.kind){case"prose":return t(fn,{profileId:n2,full:e3.full,children:p2(e3.text,i3)},i3);case"clause":return t(Gn,{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(mn,{profileId:n2,pairs:e3.pairs.map((e4,t2)=>({term:e4.term,description:p2(e4.description,`${i3}-${t2}`)}))},i3);case"table":return t(Fn,{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(dn,{profileId:n2,tone:e3.tone,title:e3.title,children:p2(e3.text,i3)},i3);case"figure":return t(En,{profileId:n2,caption:p2(e3.caption,i3),children:e3.placeholder??null},i3);case"execution":return t(gr,{profileId:n2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},i3);default:return t(_r,{kind:String(e3.kind)},i3)}})})}var yr=["h2","h3","h4","h5","h6"];function br({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??Y(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?An(w2):null,A2=yr[Math.min(T2,yr.length-1)],j2=Nn(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,...X(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(vr,{blocks:m2,profileId:h2,sectionNumbers:o2,sectionAnchors:s2,sectionTitles:c2,sectionReferences:l2,sectionOrdinal:O2?w2:void 0}):null)})]})}var xr={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"}}}},Sr=["md","lg","xl"],Cr=5;function wr(e2){let t2=Sr.indexOf(e2);return t2>0?Sr[t2-1]:e2}var Tr=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function Er(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Dr({value:e2,label:r2,size:i2="lg",tone:a2,progress:o2,progressLabel:s2,autoStepDown:c2=true,baseProps:l2,className:u2,style:d2}){let f2=Tr(e2)?Z(e2,zn(l2)):e2,p2=typeof f2=="string"||typeof f2=="number"?String(f2).length:0,m2=c2&&p2>Cr?wr(i2):i2,h2=Re(a2,"strong"),{toned:g2,..._2}=ze(h2),v2=o2==null?null:Er(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(Be,{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 Or({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 kr={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function Ar({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]=kr[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 jr({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(Ar,{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(Be,{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 Mr({tone:e2,label:r2,headline:i2,children:a2,trailing:o2,className:s2,style:c2}){let l2=K(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 Nr({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 Pr(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Fr({label:e2,value:r2,fillPercent:i2,subtitle:a2,tone:o2,baseProps:s2,className:c2,style:l2}){let u2=zn(s2),d2=Pr(i2);return n("div",{className:y("core-stat-strip","core-toned",c2),"data-tone":K(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:Z(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:Z(a2,u2)}):null]})}function Ir({text:e2,tone:n2,locale:r2,className:i2}){return t("span",{className:y("core-value-badge","core-toned",i2),"data-tone":K(n2),children:Z(e2,r2)})}var Lr=8,Rr={good:"success",warn:"warning",critical:"danger"};function zr(e2,t2,n2){let r2={series:String(n2%Lr+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)%Lr+1)};let o2=Rr[i2];return o2?{tone:o2}:Fe.includes(i2)?{tone:i2}:(W("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 Br(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 Vr(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=zn(e2.baseProps),m2=Array.isArray(c2)?c2:[],h2=Br(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(Ir,{text:o2,tone:K(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=zr(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:K(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:Z(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 Hr(e2){let{title:r2,subtitle:i2,rows:a2,className:o2,style:s2}=e2,c2=zn(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:K(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:Z(e3.value,c2)}),e3.badge?t(Ir,{text:e3.badge.text,tone:K(e3.badge.tone),locale:c2}):null]})]},r3))]})}function Ur(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 Wr={up:"▲",down:"▼",flat:"—"},Gr={up:"success",down:"danger",flat:void 0},Kr=e2=>e2!=null&&e2!=="";function qr(e2){let{columns:r2=4,gap:i2="tight",minColumnWidth:a2,className:o2,style:s2}=e2,c2=zn(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=Kr(e3.tone)?K(e3.tone):void 0,s3=Kr(e3.delta)?Ur(e3.delta):void 0,l3=s3?Gr[s3]:void 0;return t(Ar,{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&&Kr(a3.text)?t(Ir,{text:a3.text,tone:K(a3.tone),locale:c2}):null]}),t("div",{className:"core-kpi-card-grid__value",children:Z(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:Wr[s3]})," ",Z(e3.delta,c2)]}):null,Kr(i3)?t("div",{className:"core-kpi-card-grid__subtitle",children:Z(i3,c2)}):null]})},r3)})})}function Jr(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return K(e2)}var Yr=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),Xr=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!o(e2)&&"value"in e2&&!("format"in e2));function Zr(e2){return Xr(e2)?e2:{value:e2}}var Qr=/^\d{4}-\d{2}-\d{2}$/,$r=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function ei(e2,t2,n2){if(!$r.test(e2))return e2;let r2=Qr.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 ti(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"]),ri={fraction:"fraction-percent"};function ii(e2,t2,n2,r2){if(t2==="unit"){let t3=typeof n2=="string"?n2.trim():"",i2=ri[t3]??(ni.has(t3)?t3:void 0);return Z(i2?{value:e2,format:i2}:{value:e2,format:"number",...t3?{unit:t3}:{}},r2)}return t2&&ni.has(t2)?Un(t2,e2,{locale:r2}):String(e2)}function ai(e2,t2,n2,r2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&(t2==="date"||t2==="datetime")?ei(e2,t2,r2.locale):typeof e2=="string"?Z(ti(e2),r2):Yr(e2)?Z(e2,r2):typeof e2=="number"?ii(e2,t2,n2,r2):o(e2)?e2:null}function oi({title:e2,subtitle:r2,columns:i2,rows:a2,baseProps:o2,className:s2,style:c2}){let l2=zn(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(Ar,{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=Zr(n3),a4=Jr(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:ai(i4.value,f2[r4]?.format,e3.unit,l2)},r4):t("td",{...o4,children:ai(i4.value,f2[r4]?.format,e3.unit,l2)},r4)})},n2)})})]})})]})})}function si(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}function ci(e2){return e2?typeof e2=="string"?e2:e2.map(e3=>e3&&typeof e3.message=="string"?e3.message:"").filter(Boolean).join(" "):""}var li=["accepted","tentative","declined"],ui=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),di=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2});function fi(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=ui(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} – ${ui(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=ui(t2,n2).format(r2),a2=di(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} – ${di(t2,n2).format(o2)}`}var pi=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function mi(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function hi(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function gi(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"?ci(e2.errors)||"Some details are missing or not valid.":ci(e2.errors)||"Something went wrong. Try again."}function _i(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 Q(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function vi(e2){return Q(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function yi(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Q(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Q(r2,1))n2.push(r2);return n2}return e2.startsAt?[_i(e2.startsAt,t2)]:[]}var bi=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function xi(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=fi(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 Si={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function Ci(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(gi(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:li.map(e3=>t("button",{type:"button",className:"core-event-respond__choice","aria-pressed":o2===e3,disabled:!f2||c2,onClick:()=>void p2(e3),children:Si[e3]},e3))}),u2?t("p",{className:"core-event-respond__message",role:"alert",children:u2}):null]})}function wi(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=fi(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(Ci,{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 Ti=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 Ei(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(hi()),[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(()=>Ti(_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=mi(S2),c3={event_type_id:_2.id,org_id:r2,name:b2.trim()||_2.name,starts_at:n2,tzid:pi(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};i2&&(c3.project_id=i2),v2&&w2&&(c3.ends_at=mi(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(gi(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 Di=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Oi(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=_i(new Date,c2),g2=vi(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:h2),_2=Array.from({length:7},(e3,t2)=>Q(g2,t2)),v2=new Map(_2.map(e3=>[e3,[]]));for(let e3 of m2)for(let t2 of yi(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(Q(g2,-7)),"aria-label":"Previous week",children:"‹"}),t("span",{className:"core-event-schedule__range",children:`${Di(_2[0],s2)} – ${Di(_2[6],s2)}`}),t("a",{className:"core-event-schedule__step",href:p2(Q(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:Di(e3,s2)}),r3.length?t("ul",{className:"core-event-schedule__events",children:r3.map((e4,n2)=>t("li",{children:si(e4,l2,{href:bi(o2,e4.id),locale:s2,timeZone:c2})??t(xi,{event:e4,href:bi(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 Ai(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=_i(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?si(e4.event,s2,{href:bi(r2,e4.event.id),locale:a2,timeZone:o2})??t(xi,{event:e4.event,href:bi(r2,e4.event.id),locale:a2,timeZone:o2}):null]},e4.id??`${e4.at}-${i4}`))})]},e3))]})}var ji=1440,Mi=e2=>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 Ni(e2,t2){let n2=e2 instanceof Date?e2:new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=Object.fromEntries(Mi(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 Pi=e2=>e2.busyOnly===true;function Fi(e2,t2){if(!e2.startsAt)return null;let n2=Ni(e2.startsAt,t2);if(!n2)return null;let r2=new Date(e2.startsAt).getTime(),i2=e2.endsAt?new Date(e2.endsAt).getTime():NaN,a2=Ni(Number.isFinite(i2)&&i2>r2?i2:r2+18e5,t2);return a2?{start:n2,end:a2}:null}function Ii(e2,t2,{timeZone:n2,minMinutes:r2=42}={}){let i2=[],a2=[];for(let r3 of e2){if(!r3||typeof r3!="object")continue;if(r3.startOn){yi(r3).includes(t2)&&i2.push(r3);continue}let e3=Fi(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:Pi(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 Li(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 Ri(e2,t2=1){let n2=Q(vi(e2),(t2%7+6)%7);return n2>e2&&(n2=Q(n2,-7)),Array.from({length:7},(e3,t3)=>Q(n2,t3))}function zi(e2,t2,n2){return t2.filter(t3=>Ii(e2,t3,{timeZone:n2,minMinutes:0}).blocks.some(e3=>e3.overlaps))}function Bi(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 Vi=["circle","square","triangle","diamond","plus","hexagon"],Hi={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"},Ui=e2=>Vi[(Math.max(1,Math.floor(e2))-1)%Vi.length],Wi=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>=1?(Math.floor(e2)-1)%8+1:1;function Gi({series:e2,className:n2}){let r2=Wi(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":Ui(r2),children:t("path",{d:Hi[Ui(r2)]})})}var Ki=44,qi=28,Ji=(e2,t2,n2)=>`${((e2-t2)/n2*100).toFixed(3)}%`;function Yi(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 Xi(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=Yi(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=Ni(_2,d2),w2=Math.ceil(Ki/Math.max(s2,24)*60),T2=g2.map(e2=>Ii(Array.isArray(e2.events)?e2.events:[],e2.date,{timeZone:d2,minMinutes:w2})),E2=T2.map(e2=>Math.max(Ki,qi*Math.max(1,...e2.blocks.map(e3=>e3.cols)))),{fromMin:D2,toMin:O2}=Li(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=Bi(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=Zi(e3)?void 0:Bi(bi(c2,e3.id));return t("li",{className:"core-hour-grid__chip","data-busy":Zi(e3)||void 0,children:Zi(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:Ji(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":Ji(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=Bi(bi(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(Gi,{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:Ji(C2.minutes,D2,k2)}}):null]},a3.id)})]})]})}var Zi=e2=>e2.busyOnly===true;function Qi(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(Gi,{series:Wi(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 $i=(e2,t2,n2)=>`?${new URLSearchParams({...e2??{},[t2]:n2}).toString()}`,ea=(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 ta({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=Ni(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=Ri(S2,o2)[0],w2=Array.from({length:42},(e3,t2)=>Q(C2,t2)),T2=Array.from({length:6},(e3,t2)=>w2.slice(t2*7,t2*7+7)),E2=i2==="week"?new Set(Ri(b2,o2)):new Set([b2]),D2=Array.isArray(a2)?a2:[],O2=new Map(w2.map(e3=>{let t2=Ii(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:$i(l2,c2,ea(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:$i(l2,c2,ea(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:Q(t2,-1),ArrowRight:Q(t2,1),ArrowUp:Q(t2,-7),ArrowDown:Q(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:$i(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 na=(e2,t2,n2)=>`?${new URLSearchParams({...n2??{},[e2]:t2}).toString()}`;function ra({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=Ni(Number.isFinite(p2)?p2:Date.now(),l2)?.date??"1970-01-01",h2=e2&&/^\d{4}-\d{2}-\d{2}$/.test(e2)?e2:m2,g2=Ri(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=Ii(_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:na(a2,Q(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:na(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:na(a2,Q(h2,7),s2),"aria-label":"Next week",children:"›"}):null]})})}var ia=[["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=Ni(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=Bi(c2),E2=(e2,t2)=>new Intl.DateTimeFormat(p2,{...e2,timeZone:"UTC"}).format(new Date(`${t2}T00:00:00Z`)),D2=Ri(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(Xi,{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,Q(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,Q(S2,w2)),"aria-label":_2==="day"?"Next day":"Next week",children:"›"})]}),t("nav",{className:"core-calendar__views","aria-label":"View",children:ia.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(ra,{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(Oi,{label:"Agenda",occurrences:v2,view:"agenda",weekOf:S2,weekParam:o2,linkParams:{[a2]:"agenda"},eventHref:s2,locale:p2,timeZone:m2}):null]})}function $(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 oa="This can’t be done from here yet.";function sa(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(gi(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("")}}var ca=[5,10,15,20,30,45,60,90],la={line:300,note:2e3,attendees:20,attendee:80},ua=(e2,t2)=>typeof e2=="string"?e2.slice(0,t2):"",da=e2=>e2.split(/[,\n]/).map(e3=>e3.trim()).filter(Boolean);function fa(e2){if(!e2)return hi();let t2=new Date(e2);return Number.isNaN(t2.getTime())?hi():(t2.setMinutes(t2.getMinutes()-t2.getTimezoneOffset()),t2.toISOString().slice(0,16))}function pa(e2){let{canWriteStaffNotes:r2=false,onIntent:i2,className:a2,style:o2}=e2,s2=$(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}=sa(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,la.attendees).map(e3=>ua(e3,la.attendee)).join(", "):""),[O2,k2]=h(ua(d2.outcome,la.line)),[A2,j2]=h(ua(d2.followUp,la.line)),[M2,N2]=h(ua(d2.note,la.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=Bi(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,te2=v2&&!!s2&&!!B2&&!!S2,V2=v2?s2?"":"Choose who this is about before logging.":oa,H2=async e3=>{if(e3.preventDefault(),!te2||g2!==null||!B2)return;let t2={typeId:B2.id,startsAt:mi(S2),tzid:pi()};w2&&(t2.durationMin=Number(w2)),da(E2).length&&(t2.attendees=da(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})},U2=!ee2;return n("form",{className:y("core-intent-card","core-log-card",a2),style:o2,"data-state":v2?"editing":"display",onSubmit:e3=>void H2(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:U2,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:U2,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:U2,onChange:e3=>T2(e3.target.value),children:[t("option",{value:"",children:"—"}),[...new Set([...ca,...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:la.attendees*(la.attendee+2),readOnly:U2,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:la.line,readOnly:U2,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:la.line,readOnly:U2,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:la.note,value:M2,readOnly:U2,onChange:e3=>N2(e3.target.value)})]}),r2&&M2.trim()?n("label",{className:"core-log-card__check",children:[t("input",{type:"checkbox",checked:P2,disabled:U2,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:te2?`Log saves this to ${s2}’s file.`:V2}),t("div",{className:"core-intent-card__actions",children:t("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!te2||g2!==null,"aria-describedby":`${f2}-does`,children:g2==="log_event"?"Logging…":"Log"})})]})}var ma=250,ha=500,ga=(e2,t2)=>{let n2=t2.trim().toLowerCase();return n2===""||e2.label.toLowerCase().includes(n2)||!!e2.description?.toLowerCase().includes(n2)};function _a({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=>ga(e3,E2)),[n2,j2,t2,E2]),te2=!!n2,V2=E2.trim().length>=p2,H2=V2?ee2:[];l(()=>{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"))})},d2);return()=>{clearTimeout(n3),t3.abort()}},[E2,D2,V2,te2,d2]);let U2=te2?N2:!D2||!V2?"idle":H2.length?"ready":"empty";l(()=>{F2!==null&&!H2.some(e3=>e3.id===F2)&&I2(null)},[H2,F2]),l(()=>{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"?ha:ma);return()=>clearTimeout(n3)},[U2,H2.length,k2,E2,b2,x2]);let ne2=s(e3=>{r2===void 0&&T2(e3),B2.current.onValueChange?.(e3)},[r2]),re2=s(()=>{A2(false),I2(null)},[]),ie2=s(e3=>{e3.disabled||(_2&&ne2(e3.label),B2.current.onSelect?.(e3),g2&&re2())},[_2,ne2,g2,re2]),ae2=e3=>`${S2}-opt-${e3.id}`,oe2=k2&&H2.length>0,se2=oe2?H2.find(e3=>e3.id===F2):void 0,ce2=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:oe2,activeId:F2,close:re2,inputProps:{role:"combobox","aria-label":e2,"aria-expanded":oe2,"aria-controls":C2,"aria-autocomplete":"list","aria-activedescendant":se2?ae2(se2):void 0,autoComplete:"off",value:E2,onChange:e3=>{O2(true),A2(true),I2(null),ne2(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?ce2(e3.key==="ArrowDown"?1:-1):A2(true)):(e3.key===t3||e3.key===n3)&&oe2&&se2?(e3.preventDefault(),ce2(e3.key===t3?1:-1)):e3.key==="Enter"&&se2?(e3.preventDefault(),ie2(se2)):e3.key==="Escape"&&k2?(e3.preventDefault(),e3.stopPropagation(),re2()):e3.key==="Tab"&&re2()},onFocus:()=>{v2&&(O2(true),A2(true))},onBlur:()=>re2()},listboxProps:{id:C2,role:"listbox","aria-label":e2,"aria-orientation":c2},statusProps:{role:"status","aria-live":"polite","aria-atomic":true},getOptionProps:e3=>({id:ae2(e3),role:"option","aria-selected":e3.id===se2?.id,"aria-disabled":e3.disabled||void 0,"data-active":e3.id===se2?.id?"":void 0,onPointerDown:e4=>e4.preventDefault(),onClick:()=>ie2(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 ya({placeholder:r2,emptyText:i2="No results",errorText:a2="Could not load results",renderOption:o2,className:s2,style:c2,...d2}){let f2=_a({...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 ba=["saved","assigned","event","archived","discarded","unavailable"],xa=6e3;function Sa(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}=sa(s2),[x2,S2]=h(null),C2=f2?.state&&ba.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)):"",te2=Bi(f2.eventHref),V2=_2===null,H2=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))},U2=async()=>{let{ok:e2}=await g2("make_event");e2&&S2("started")},ne2=()=>{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(),xa),E2(true)},re2=()=>{D2.current&&clearTimeout(D2.current),D2.current=null,O2.current=null,E2(false)},ie2=async()=>{let{ok:e2}=await g2("discard");N2(false),e2&&S2("discarded")},ae2=async()=>{let{ok:e2}=await g2("ask_instead");e2&&S2("asked")},oe2=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:oe2}),t("p",{className:"core-note-card__body",children:f2.body}),n("span",{className:"core-note-card__private",children:["Private",ee2?` · saved ${ee2}`:""]})]}),w2==="event"&&te2?t("a",{className:"core-note-card__go",href:te2,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:re2,children:"Undo"})}):null,B2?n(e,{children:[L2&&o2?n("div",{className:"core-note-card__picker",children:[t(ya,{label:"Assign to a client or project",placeholder:"Search clients and projects",loadOptions:o2,onSelect:e2=>void H2(e2),defaultOpen:false}),n("label",{className:"core-note-card__private-check",children:[t("input",{type:"checkbox",checked:A2,disabled:!V2,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:oa)("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||!V2,"aria-expanded":L2,"aria-describedby":`${p2}-does`,onClick:()=>R2(e2=>!e2),children:"Assign"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"aria-describedby":`${p2}-does`,onClick:()=>void U2(),children:"Make event"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"aria-describedby":`${p2}-does`,onClick:ne2,children:"Archive"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"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:!V2,onClick:()=>void ie2(),children:_2==="discard"?"Discarding…":"Yes, discard"}),t("button",{ref:P2,type:"button",className:"core-intent-card__button",disabled:!V2,onClick:()=>N2(false),children:"Cancel"})]})]}):null,t("button",{type:"button",className:"core-note-card__instead",disabled:!b2||!V2,onClick:()=>void ae2(),children:"Ask the assistant instead"})]}):null]})}var Ca=["proposed","created","done"],wa=200,Ta=(e2,t2)=>!e2||!/^\d{4}-\d{2}-\d{2}$/.test(e2)?"":new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Ea(r2){let{locale:i2,onIntent:a2,className:o2,style:s2}=r2,c2=$(r2.subjectName),d2=r2.task&&typeof r2.task=="object"&&typeof r2.task.title=="string"?r2.task:null,f2=u(),{run:p2,busy:g2,message:_2,available:v2}=sa(a2),[b2,x2]=h((d2?.title??"").slice(0,wa)),[S2,C2]=h(d2?.dueOn&&/^\d{4}-\d{2}-\d{2}$/.test(d2.dueOn)?d2.dueOn:""),[w2,T2]=h(null),E2=d2?.state&&Ca.includes(d2.state)?d2.state:"proposed",D2=w2&&Ca.indexOf(w2)>Ca.indexOf(E2)?w2:E2,O2=m(null),k2=m(null),[A2,j2]=h(false);if(l(()=>{A2&&k2.current?.focus({preventScroll:true})},[A2]),l(()=>{w2&&O2.current?.focus({preventScroll:true})},[w2]),!d2)return null;let M2=D2==="proposed"&&v2&&g2===null,N2=v2&&!!c2&&b2.trim()!=="",P2=async e2=>{if(e2.preventDefault(),!N2||g2!==null)return;let{ok:t2}=await p2("log_event",{title:b2.trim(),...S2?{dueOn:S2}:{}});t2&&T2("created")},F2=async()=>{let{ok:e2}=await p2("complete");j2(false),e2&&T2("done")},I2=Ta(D2==="proposed"?S2:d2.dueOn,i2),L2=D2==="proposed"?"Task · suggested":D2==="done"?"Task · done":"Task",R2=D2==="proposed"?N2?`Create task adds this to ${c2}’s tasks.`:v2?c2?"":"Choose whose file this goes in first.":oa:D2==="created"?A2?"Mark this task done? It can’t be reopened from here.":"Mark done closes this task.":"";return n("form",{ref:O2,tabIndex:-1,"aria-labelledby":`${f2}-status`,className:y("core-intent-card","core-task-card",o2),style:s2,"data-state":D2,onSubmit:e2=>void P2(e2),"aria-busy":g2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[n("span",{id:`${f2}-status`,className:"core-intent-card__eyebrow",children:[L2,c2?` · ${c2}`:""]}),D2==="proposed"?n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"What needs doing"}),t("input",{value:b2,maxLength:wa,readOnly:!M2,onChange:e2=>x2(e2.target.value),required:true})]}):t("p",{className:"core-intent-card__title core-task-card__title","data-done":D2==="done"?"":void 0,children:d2.title})]}),D2==="proposed"?n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Due"}),t("input",{type:"date",value:S2,readOnly:!M2,onChange:e2=>C2(e2.target.value)})]}):null,t("p",{className:"core-task-card__meta",children:[I2?`Due ${I2}`:"",d2.assigneeName?`For ${d2.assigneeName}`:""].filter(Boolean).join(" · ")||(D2==="proposed"?"":"No due date")}),_2?t("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,R2?t("p",{className:"core-intent-card__does",id:`${f2}-does`,children:R2}):null,D2==="done"?null:t("div",{className:"core-intent-card__actions",children:D2==="proposed"?t("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!N2||g2!==null,"aria-describedby":`${f2}-does`,children:g2==="log_event"?"Creating…":"Create task"}):A2?n(e,{children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:g2!==null,onClick:()=>void F2(),children:g2==="complete"?"Saving…":"Yes, mark done"}),t("button",{ref:k2,type:"button",className:"core-intent-card__button",disabled:g2!==null,onClick:()=>j2(false),children:"Cancel"})]}):t("button",{type:"button",className:"core-intent-card__button",disabled:!v2||g2!==null,"aria-describedby":`${f2}-does`,onClick:()=>j2(true),children:"Mark done"})})]})}function Da(r2){let{locale:i2,timeZone:a2,onIntent:o2,className:s2,style:c2}=r2,d2=$(r2.scopeName),f2=u(),{run:p2,busy:g2,message:_2,available:v2}=sa(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=$(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.`:oa}),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 Oa=12,ka=(e2,t2=200)=>typeof e2=="string"?e2.replace(/\s+/g," ").trim().slice(0,t2):"";function Aa(r2){let{typicalTime:i2,typicalCost:a2,costCap:o2,onIntent:s2,className:c2,style:d2}=r2,f2=$(r2.processName),p2=$(r2.subjectName),g2=u(),{run:_2,busy:v2,message:b2,available:x2}=sa(s2),[S2,C2]=h(false),w2=m(null);if(l(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]),!f2)return null;let T2=ka(r2.description),E2=(Array.isArray(r2.needs)?r2.needs:[]).filter(e2=>e2&&typeof e2=="object"&&ka(e2.label)).slice(0,Oa),D2=[i2&&`Typical time: ${ka(i2,60)}`,a2&&`Typical cost: ${ka(a2,60)}`,o2&&`Cost cap: ${ka(o2,60)}`].filter(Boolean).join(" · "),O2=r2.running&&typeof r2.running=="object"?r2.running:null,k2=Bi(O2?.href),A2=x2&&!!p2,j2=x2?p2?"":"Choose who this is for before starting.":oa,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:ka(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 ja=12,Ma=8,Na=600;function Pa(r2){let{onIntent:i2,className:a2,style:o2}=r2,s2=u(),{run:c2,busy:d2,message:f2,available:p2}=sa(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,ja);if(E2.length===0)return null;let D2=e2=>(Array.isArray(e2.matches)?e2.matches:[]).filter(e3=>e3&&typeof e3.id=="string"&&$(e3.name)&&(e3.kind==="client"||e3.kind==="project")).slice(0,Ma),O2=e2=>g2[e2.id]??(e2.state==="assigned"||e2.state==="dropped"?{state:e2.state,name:$(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:$(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>Na?`${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:$(o3[0].name)}),o3[0].detail?` · ${$(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:$(e2.name)}),t("span",{className:"core-note-split-card__detail",children:[e2.kind==="project"?"Project":"Client",$(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 ${$(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.":oa})]})}var Fa=20;function Ia(r2){let{onIntent:i2,onCancel:a2,className:o2,style:s2}=r2,c2=r2.mode==="withdraw"?"withdraw":"share",d2=$(r2.clientName),f2=u(),{run:p2,busy:g2,message:_2,available:v2}=sa(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"&&$(e2.name)).slice(0,Fa);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.":oa,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:$(e2.name)}),$(e2.projectName)?t("span",{className:"core-share-approval-card__project",children:$(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 La={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"}},Ra=["save_as_note","make_follow_up"];function za(e2){let{onIntent:r2,className:i2,style:a2}=e2,o2=Array.isArray(e2.actions)?Ra.filter(t2=>e2.actions.includes(t2)):Ra,s2=u(),{run:c2,busy:l2,message:d2,available:f2}=sa(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?La[e3].done:l2===e3?La[e3].busy:La[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:oa})]})}var Ba=new Set(["http:","https:","mailto:","tel:"]);function Va(e2){let t2=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e2.replace(/[\u0000- ]/g,""));return t2?`${t2[1].toLowerCase()}:`:null}function Ha(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=Va(e2.trim());return t2===null||Ba.has(t2)?e2.trim():(W(`unsafe-href:${t2}`,`Refused a link with the "${t2}" scheme; links are relative, http(s):, mailto: or tel:`),null)}function Ua(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=e2.trim(),n2=Va(t2);return n2===null||n2==="https:"||n2==="data:"&&/^data:image\//i.test(t2.replace(/[\u0000- ]/g,""))?t2:(W(`unsafe-src:${n2}`,`Refused an image with the "${n2}" scheme; images are relative, https: or data:image/`),null)}var Wa=e2=>!!e2&&typeof e2=="object"&&typeof e2.label=="string"&&Ha(e2.href)!==null;function Ga(e2){return(Array.isArray(e2)?e2:e2?[e2]:[]).filter(Wa)}function Ka({action:e2,className:n2}){let r2=Ha(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 qa({actions:e2,className:n2}){return e2.length?t("div",{className:y("core-public-actions",n2),children:e2.map((e3,n3)=>t(Ka,{action:e3},`${e3.href}-${n3}`))}):null}function Ja(e2){if(!e2||typeof e2!="object")return null;let t2=e2,n2=Ua(t2.src);return n2===null?null:{src:n2,alt:t2.decorative?"":typeof t2.alt=="string"?t2.alt:""}}function Ya({eyebrow:e2,title:r2,intro:i2,actions:a2,media:o2,align:s2,className:c2,style:l2}){let u2=Ja(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(qa,{actions:Ga(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 Xa({text:e2,src:n2,href:r2,size:i2,className:a2,style:o2}){let s2=i2==="sm"||i2==="lg"?i2:"md",c2=Ua(n2),l2=Ha(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 Za=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.label=="string"&&Ha(e3.href)!==null).map(e3=>({label:e3.label,href:Ha(e3.href)}));function Qa({logo:e2,links:r2,signIn:i2,className:a2,style:o2}){let s2=Za(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(Xa,{...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(Ka,{action:c2,className:"core-public-header__sign-in"}):null]})}var $a=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string"&&Array.isArray(e3.links)).map(e3=>({title:e3.title,links:Za(e3.links)}));function eo({logo:e2,groups:r2,legal:i2,className:a2,style:o2}){let s2=$a(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(Xa,{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 to=/^\d+(\.\d+)?\s*\/\s*\d+(\.\d+)?$/;function no({src:e2,alt:r2,decorative:i2,ratio:a2,caption:o2,priority:s2,className:c2,style:l2}){let u2=Ua(e2);if(u2===null)return null;!i2&&!r2&&W(`image-alt:${e2}`,`Image: "${e2}" has no alt text; give alt or set decorative`);let d2=a2&&to.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 ro=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string");function io({title:e2,intro:r2,items:i2,columns:a2,className:o2,style:s2}){let c2=ro(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 ao=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.name=="string"),oo=e2=>e2.split(/\s+/).filter(Boolean).slice(0,2).map(e3=>e3[0].toUpperCase()).join("");function so({title:e2,intro:r2,members:i2,className:a2,style:o2}){let s2=ao(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=Ja(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:oo(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 co({quote:e2,name:r2,role:i2,photo:a2,className:o2,style:s2}){if(typeof e2!="string"||!e2)return null;let c2=Ja(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 lo({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(qa,{actions:Ga(i2).slice(0,2)})]})}function uo({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(gi(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 fo({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]})}var po=Symbol.for("peripheries.viewer.context.v1"),mo=20,ho=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/,go=Object.freeze({audience:"client",roles:Object.freeze([])});function _o(e2){if(!e2||typeof e2!="object")return go;let t2=e2,n2=[...new Set((Array.isArray(t2.roles)?t2.roles:[]).filter(e3=>typeof e3=="string"&&ho.test(e3)&&e3.length<=40))].sort().slice(0,mo);return{audience:t2.audience==="staff"?"staff":"client",roles:n2,...t2.previewing===true?{previewing:true}:{}}}var vo=globalThis,yo=vo[po]??=a(go);function bo({value:e2,children:n2}){return t(yo.Provider,{value:_o(e2),children:n2})}function xo(){return c(yo)}var So=e2=>e2.audience==="staff",Co=(e2,t2)=>e2.roles.includes(t2);export{Kn as ANSWER_COLUMN_PX,wt as Accordion,Ka as ActionLink,qa as ActionRow,qn as AnswerRows,dn as Aside,Ge as Avatar,en as BLOCK_KINDS,xr as BLOCK_SCHEMAS,dt as Badge,S as Box,yt as Button,Qi as CalendarFilters,aa as CalendarView,Tt as Card,C as Center,Qe as Checkbox,$e as CheckboxGroup,bt as Chip,Ke as Code,fo as CodeField,Dt as Columns,ya as Combobox,Yn as ComparisonBars,uo as ContactForm,w as Container,mr as Contents,lo as CtaBand,ji as DAY_MINUTES,In as DEFAULT_DISPLAY_LOCALE,Ut as DEFAULT_PROFILE_ID,go as DEFAULT_VIEWER,oi as DataTable,et as DateRange,mn as Definition,De as Dialog,Nr as DisclaimerBlock,kt as Disclosure,T as Divider,vr as DocumentBlocks,On as DocumentLabel,br as DocumentSection,fr as DocumentShell,Fn as DocumentTable,ft as EmptyState,xi as EventCard,wi as EventDetail,Ei as EventLogForm,Ci as EventRespond,Oi as EventSchedule,Ai as EventTimeline,gr as ExecutionBlock,Be as Eyebrow,io as FeatureGrid,En as Figure,nt as FileField,Tn as Footnote,Ze as FormField,At as Grid,Da as HandoverCard,Je as Heading,Ya as Hero,E as Hide,Mr as HighlightBox,va as Highlighted,Xi as HourGrid,xt as IconButton,no as Image,D as Inline,qr as KpiCardGrid,St as Link,Ne as ListRow,pa as LogCard,Xa as LogoMark,sr as Masthead,bn as Math,se as Menu,lr as MetaRail,ta as MiniMonth,oa as NOT_AVAILABLE,Qn as NextSteps,Pa as NoteSplitCard,er as Notes,mt as Notice,Vr as OptionCard,Mt as PAGINATOR_BINDINGS,Dn as PageBreak,Pe as PageFrame,Ve as PageHead,ee as Popover,Hr as ProfileCard,ht as Progress,fn as Prose,eo as PublicFooter,Qa as PublicHeader,Sa as QuickNoteCard,pn as Quote,rt as RadioGroup,M as Rail,Pn as Reference,jt as Repeat,Gn as RowList,He as RuleSection,dr as RunningFooter,Vi as SERIES_SHAPES,ot as SearchField,jr as SectionHeader,Ct as SegmentedControl,st as Select,Gi as SeriesGlyph,Ia as ShareApprovalCard,ne as Sheet,N as Show,gt as Skeleton,nr as SkippedSection,ct as Slider,Oe as Spacer,_t as Spinner,Ot as Split,ke as Stack,Aa as StartProcessCard,Dr as Stat,Or as StatGroup,Fr as StatStrip,za as SuggestedActions,lt as Switch,Fe as TONES,ir as TalkItThrough,Ea as TaskCard,so as TeamGrid,co as Testimonial,Xe as Text,ut as TextArea,at as TextField,we as Toast,Ee as ToastRegion,vt as Tooltip,Ue as UnderlinedAction,bo as ViewerProvider,ar as WRITE_HEIGHT_PX,$n as WRITE_LINE_HEIGHT_PX,ra as WeekStrip,or as WriteInField,Ga as actionsOf,y as cx,_e as dismissToast,zn as displayLocale,Ht as documentProfiles,fi as eventWhen,tt as fileSize,Un as formatValue,Co as hasRole,bi as hrefFrom,Ja as imageOf,We as initialsOf,Re as inkToneOf,Pi as isBusyOnly,So as isStaff,Ii as layoutDay,b as length,_o as normalizeViewer,zi as overlapDays,$t as profileCss,zt as profileIds,Zt as profileTokens,Rt as registerProfile,Z as renderFormatted,Bt as resolveProfile,Vt as resolvedProfiles,Bi as sameOriginPath,Wi as seriesNumber,Ui as seriesShape,it as toNumber,ge as toast,K as toneOf,si as typeCard,_a as useCombobox,sa as useIntent,Ce as useToast,xo as useViewer,x as vars,Li as visibleRange,Ni as wallOf,Ri as weekDates};