@cloudhal/cli 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/starters/blog/package.json +7 -7
- package/dist/assets/starters/blog/src/styles/features/chrome-menus.css +1 -1
- package/dist/assets/starters/blog/src/styles/features/motion.css +2 -2
- package/dist/assets/starters/blog/src/styles/features/surfaces.css +8 -7
- package/dist/assets/studio/assets/{AccountPage-NTvVQ9j4.js → AccountPage-Dgdy4H1z.js} +2 -2
- package/dist/assets/studio/assets/{ActivityPage-DQSyrOOA.js → ActivityPage-Bu56R6E7.js} +2 -2
- package/dist/assets/studio/assets/{AgentModes-KSlPlZBo.js → AgentModes-D695kSbw.js} +2 -2
- package/dist/assets/studio/assets/{AgentsPage-5NPtJdv3.js → AgentsPage-BWlLRFPH.js} +2 -2
- package/dist/assets/studio/assets/{AnalyticsPage-CeeJ1CyW.js → AnalyticsPage-C0RPBuUR.js} +2 -2
- package/dist/assets/studio/assets/{ApprovalsPage-BAb_T-Yg.js → ApprovalsPage-B1398iby.js} +3 -3
- package/dist/assets/studio/assets/{ArticleEditorPage-Ggx_BDgH.js → ArticleEditorPage-jOUCZ_79.js} +3 -3
- package/dist/assets/studio/assets/{ArticlesPage-B7pYvOqZ.js → ArticlesPage-CbpeF5qT.js} +3 -3
- package/dist/assets/studio/assets/{AssetPage-CoLQ7g6-.js → AssetPage-DZr_G7__.js} +2 -2
- package/dist/assets/studio/assets/{Audit-DzVhy7HF.js → Audit-DrQvb5mu.js} +2 -2
- package/dist/assets/studio/assets/{AuditBadges-fg0FKAHS.js → AuditBadges-BVr05Xyt.js} +2 -2
- package/dist/assets/studio/assets/{AutomationsPage-ClhZd5Ds.js → AutomationsPage-CfS05QHu.js} +2 -2
- package/dist/assets/studio/assets/{BodyChanges-BV19ywfj.js → BodyChanges-Kz6YliT_.js} +2 -2
- package/dist/assets/studio/assets/{BodyEditor-nuTuUMKM.js → BodyEditor-Dk-GQfp9.js} +3 -3
- package/dist/assets/studio/assets/{BuildPage-CP6uMSA_.js → BuildPage-ohS6E6nm.js} +2 -2
- package/dist/assets/studio/assets/{CollectionSettingsPage-B5s4v1Iz.js → CollectionSettingsPage-3e_npZNv.js} +3 -3
- package/dist/assets/studio/assets/{CollectionsPage-BzY00I6q.js → CollectionsPage-DqM5_dJR.js} +2 -2
- package/dist/assets/studio/assets/{CommandMenu-CO5U3JH5.js → CommandMenu-Cedh4xtl.js} +2 -2
- package/dist/assets/studio/assets/{CommentThreadControls-Cmh1R66Y.js → CommentThreadControls-CmD52U5z.js} +2 -2
- package/dist/assets/studio/assets/{CommentThreadPage-UiAi6-KV.js → CommentThreadPage-CX87ADPi.js} +2 -2
- package/dist/assets/studio/assets/{CommenterPage-5j673AfC.js → CommenterPage-C-Vv0BQK.js} +2 -2
- package/dist/assets/studio/assets/{Comments-DvqfPRIm.js → Comments-4cWUXtON.js} +2 -2
- package/dist/assets/studio/assets/{CommentsPage-Dq6ZPgBd.js → CommentsPage-Bc2nVm6x.js} +2 -2
- package/dist/assets/studio/assets/{ConfirmDialog-OVRiEm85.js → ConfirmDialog-DH2jGk29.js} +2 -2
- package/dist/assets/studio/assets/{Crumbs-DcQ6-fG2.js → Crumbs-Bg-oOv-g.js} +2 -2
- package/dist/assets/studio/assets/{DateTimeField-COCBK21M.js → DateTimeField-DlaSbbAW.js} +2 -2
- package/dist/assets/studio/assets/{EditorPreview-CkyWXFtR.js → EditorPreview-CLPIy9Da.js} +2 -2
- package/dist/assets/studio/assets/{Elevation-DkpPCdiH.js → Elevation-CpzbzjZ1.js} +2 -2
- package/dist/assets/studio/assets/{ElevationRequest-CmgLclFL.js → ElevationRequest-DGZR_Qu7.js} +2 -2
- package/dist/assets/studio/assets/{EndedBadge-BDwG33LH.js → EndedBadge-CuESOF9v.js} +2 -2
- package/dist/assets/studio/assets/{EntryFieldsCard-D5y1dpXL.js → EntryFieldsCard-DpfwTRoT.js} +2 -2
- package/dist/assets/studio/assets/{FieldsSection-B_CkinDZ.js → FieldsSection-B-_c-cLU.js} +2 -2
- package/dist/assets/studio/assets/{ForgotPasswordPage-WCD-LFli.js → ForgotPasswordPage-4T_xsZc7.js} +2 -2
- package/dist/assets/studio/assets/{Gating-Dh2NroLN.js → Gating-BKw9x3OA.js} +2 -2
- package/dist/assets/studio/assets/{GovernanceDialog-ZGDW8GHB.js → GovernanceDialog-WI6muWSG.js} +2 -2
- package/dist/assets/studio/assets/{InvitePage-nDt4YwRU.js → InvitePage-BWcoBszO.js} +2 -2
- package/dist/assets/studio/assets/{ListFieldColumns-JgalLO4N.js → ListFieldColumns-DLqDR_nL.js} +2 -2
- package/dist/assets/studio/assets/{ListToolbar-BJEEg5eE.js → ListToolbar-_lpYaeal.js} +2 -2
- package/dist/assets/studio/assets/{ListingSections-oP_0yN1S.js → ListingSections-lyTz_PaH.js} +2 -2
- package/dist/assets/studio/assets/{LoginPage-L984KqI8.js → LoginPage-blPVGXvN.js} +2 -2
- package/dist/assets/studio/assets/{MediaPage-YcmyGDWC.js → MediaPage-DaCldFys.js} +2 -2
- package/dist/assets/studio/assets/{MediaPicker-D0dErr8k.js → MediaPicker-DYJj3Gtp.js} +2 -2
- package/dist/assets/studio/assets/{MediaUpload-Dz_c75sO.js → MediaUpload-DuQnkN1u.js} +2 -2
- package/dist/assets/studio/assets/{MembersPage-loaFEpdr.js → MembersPage-fMlwYa1x.js} +2 -2
- package/dist/assets/studio/assets/{Menus-BLkbHiMI.js → Menus-Dym_0ijH.js} +2 -2
- package/dist/assets/studio/assets/{NavigationPage-Da7rjZRB.js → NavigationPage-CTQt0njO.js} +2 -2
- package/dist/assets/studio/assets/{NewSiteDialog-BHHd21ht.js → NewSiteDialog-DVWeKGsw.js} +2 -2
- package/dist/assets/studio/assets/{NotificationItems-CZg5_NHZ.js → NotificationItems--5FaR3tN.js} +2 -2
- package/dist/assets/studio/assets/{PageEditorPage-Dj-U2pjK.js → PageEditorPage-BlG2sPAB.js} +2 -2
- package/dist/assets/studio/assets/{PagesPage-nsroU5tN.js → PagesPage-BXU3jxTQ.js} +2 -2
- package/dist/assets/studio/assets/{PreviewPanel-Cji7Fp5q.js → PreviewPanel-3eVWgDDN.js} +2 -2
- package/dist/assets/studio/assets/{ProjectPage-BQxm4g99.js → ProjectPage-CdYFYMv3.js} +2 -2
- package/dist/assets/studio/assets/{Readers-CcVVgmpi.js → Readers-BwBWWzB-.js} +3 -3
- package/dist/assets/studio/assets/{RedirectDialog-B5yl4oD-.js → RedirectDialog-BqlclE-n.js} +2 -2
- package/dist/assets/studio/assets/{RedirectsPage-B1pa4mQJ.js → RedirectsPage-Bpnn14p_.js} +2 -2
- package/dist/assets/studio/assets/{RelativeTime-C_SQCdsk.js → RelativeTime-B3WDq_Ti.js} +2 -2
- package/dist/assets/studio/assets/{ReleaseApproval-DT1ecFLG.js → ReleaseApproval-CEM7iJKI.js} +2 -2
- package/dist/assets/studio/assets/{ReleasePage-DVSL_YM-.js → ReleasePage-B9db-dEu.js} +2 -2
- package/dist/assets/studio/assets/{ReleaseParts-D8k7e2qx.js → ReleaseParts-CI9sIfLw.js} +2 -2
- package/dist/assets/studio/assets/{ResetPasswordPage-p1BeXN56.js → ResetPasswordPage-C24Mv9le.js} +2 -2
- package/dist/assets/studio/assets/{RowMenu-D0g1yTqW.js → RowMenu-CvvLvp2V.js} +2 -2
- package/dist/assets/studio/assets/{ScheduleCard-DsR36_fP.js → ScheduleCard-CTZ7DyA9.js} +2 -2
- package/dist/assets/studio/assets/{ScheduleDialog-C_bduc0o.js → ScheduleDialog-TQgKxIsr.js} +2 -2
- package/dist/assets/studio/assets/{ScheduleHistoryPage-BzmQSThY.js → ScheduleHistoryPage-9lUX1OC9.js} +2 -2
- package/dist/assets/studio/assets/{ScheduleStatusBadge-t8qrRkdh.js → ScheduleStatusBadge-CLqNp1Rc.js} +2 -2
- package/dist/assets/studio/assets/{Schedules-6cMSrwUb.js → Schedules-7od0mh_y.js} +2 -2
- package/dist/assets/studio/assets/{SchedulesPage-LN1rNJ_S.js → SchedulesPage-Cj-QwGdy.js} +2 -2
- package/dist/assets/studio/assets/{Seo-DffNYWOM.js → Seo-YV7wVEPY.js} +2 -2
- package/dist/assets/studio/assets/{SeoPreview-VTTiQ0Ig.js → SeoPreview-CAaNUyjg.js} +2 -2
- package/dist/assets/studio/assets/{Settings-Bgn96K2D.js → Settings-DX31HFBM.js} +2 -2
- package/dist/assets/studio/assets/{SiteOverviewPage-Dz8vVdMJ.js → SiteOverviewPage-lk4wap0q.js} +2 -2
- package/dist/assets/studio/assets/{SiteSettingsPage-vve5XcFj.js → SiteSettingsPage-mCQPDJzA.js} +3 -3
- package/dist/assets/studio/assets/{SitesPage-CYccS5X4.js → SitesPage-gxcSR0ad.js} +3 -3
- package/dist/assets/studio/assets/{SkillsPage-DIeleLju.js → SkillsPage-_ZUdPF2E.js} +2 -2
- package/dist/assets/studio/assets/{SnapshotsPage-FUNSFjvW.js → SnapshotsPage-DLUbZ563.js} +2 -2
- package/dist/assets/studio/assets/{StatTile-CN_o8uLc.js → StatTile-KhE3fINB.js} +2 -2
- package/dist/assets/studio/assets/{StatusActions-UX4cJWR0.js → StatusActions-CqCXSQ46.js} +3 -3
- package/dist/assets/studio/assets/{TableSkeleton-BDGXoCWS.js → TableSkeleton-SmOOTzX3.js} +2 -2
- package/dist/assets/studio/assets/{TagsMigration-CDN47duJ.js → TagsMigration-rd5JiDwq.js} +2 -2
- package/dist/assets/studio/assets/{TaxonomyPage-DsTl6LUJ.js → TaxonomyPage-DqlGIFcb.js} +2 -2
- package/dist/assets/studio/assets/{TaxonomySettingsDialog-BdXSJnYn.js → TaxonomySettingsDialog-Bn2QdsNY.js} +2 -2
- package/dist/assets/studio/assets/{TermEditorPage-CpY3StQ8.js → TermEditorPage-BoW7eXoX.js} +2 -2
- package/dist/assets/studio/assets/{TermPickers-De-2BW8j.js → TermPickers-BMXiPCa0.js} +2 -2
- package/dist/assets/studio/assets/{TranslationList-0QP6cnHn.js → TranslationList-7PC6LAd9.js} +2 -2
- package/dist/assets/studio/assets/{TranslationsPage-vhO1MEXc.js → TranslationsPage--a62-gT6.js} +2 -2
- package/dist/assets/studio/assets/{charts-C_1bsD44.js → charts-DS4cDmaj.js} +2 -2
- package/dist/assets/studio/assets/{collapsible-l8g94on4w7qfosmn-CcuxOZc3.js → collapsible-l8g94on4w7qfosmn-ClVVSlmf.js} +2 -2
- package/dist/assets/studio/assets/{collection-icons-vQBNxoLg.js → collection-icons-D-IZFMkB.js} +2 -2
- package/dist/assets/studio/assets/{combobox-hdxtsm2gqcxxgfju-DZri6Aur.js → combobox-hdxtsm2gqcxxgfju-DhX6ZIcI.js} +2 -2
- package/dist/assets/studio/assets/{deleteLabels-DFkO1iOx.js → deleteLabels-DH7Oba8-.js} +2 -2
- package/dist/assets/studio/assets/{editor-a2ZIJiuW.js → editor-BrVbznPe.js} +59 -59
- package/dist/assets/studio/assets/{index-CZfdz1iP.js → index-CRaauoqY.js} +3 -3
- package/dist/assets/studio/assets/{layer-dialog-j5ywmzs46ccg6oqy-DkKZqCVk.js → layer-dialog-j5ywmzs46ccg6oqy-a5UYrx-X.js} +2 -2
- package/dist/assets/studio/assets/{tag-input-ohfybx5dbxy3houy-tsg1b-Oa.js → tag-input-ohfybx5dbxy3houy-Bfh3Yb-x.js} +2 -2
- package/dist/assets/studio/assets/{useCollectionView-DX7hhan1.js → useCollectionView-Cj_hlmHt.js} +3 -3
- package/dist/assets/studio/index.html +1 -1
- package/dist/src/cli/commands-local.js +9 -1
- package/dist/src/cli/help.d.ts +1 -1
- package/dist/src/cli/help.js +11 -2
- package/dist/src/cli.d.ts +10 -0
- package/dist/src/cli.js +33 -2
- package/dist/src/commands/astro.d.ts +2 -1
- package/dist/src/commands/astro.js +3 -2
- package/dist/src/commands/studio-options.d.ts +62 -0
- package/dist/src/commands/studio-options.js +161 -0
- package/dist/src/commands/studio.d.ts +5 -2
- package/dist/src/commands/studio.js +35 -13
- package/package.json +14 -14
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./vendor-styling-da1xibnxfkjmtglr-f72JA6U4.js";import{At as n,C as r,Hn as i,Ht as a,N as o,T as s,Un as c,Ut as l,Vt as u,Wt as d,_r as f,at as p,bn as m,ct as h,dr as g,hr as _,ir as v,mt as y,nr as b,o as x,or as ee,rr as S,st as C,tn as w,vn as T}from"./useBaseUiId-lg1teubxudgin0w2-DE9psqVX.js";import{i as E,n as D,r as O}from"./react-iRJfyluG.js";import{t as k}from"./button-pa1bq9b85hawg41a-CTLAwRb5.js";import{w as te}from"./tanstack-8GMTaj0M.js";import{n as A,p as j}from"./skeleton-line-m9dyh126t9k07jvg-C0LAvXNf.js";import{c as M,u as N}from"./useButton-h7s9aq1sfw6arawe-CDg3MSn7.js";import{t as P}from"./clamp-jcjhzx71s6wt1rnc-D0kAXd-u.js";import{t as F}from"./scrollable-b6m9ze1u7ps0q1qn-CsARZWmE.js";import{n as ne,r as re,t as I}from"./useSwipeDismiss-m1s13x9t9ey9ax3p-D7CLht-d.js";import{n as L}from"./useClick-l0p0endoxrlp0ae5-dDySeZPV.js";import{a as ie}from"./composite-ab8dmdfoj6tmhcn1-BnZxF-Cq.js";import{t as R}from"./layer-card-idh3863vdgprgqai-ByBfeMqc.js";import{a as ae,i as z,n as oe,r as B,t as V}from"./useRenderDialogRoot-lddunc01twftravv-YHj8p0Db.js";import{i as H,n as U,r as W,t as se}from"./DialogTrigger-g44cuem7n4wez533-EhxANqX5.js";import{at as ce,it as G,nt as K,ot as le,rt as ue,ut as de}from"./index-CZfdz1iP.js";var q=e(E(),1),fe=q.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=B(),c=z(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return _(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:oe,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})});fe.displayName=`DialogViewport`;var J=O(),pe=e(D(),1),me=`--nested-drawers`,he=`--drawer-height`,ge=`--drawer-frontmost-height`,_e=`--drawer-swipe-movement-x`,ve=`--drawer-swipe-movement-y`,ye=`--drawer-snap-point-offset`,be=`--drawer-swipe-strength`,Y=`--drawer-swipe-progress`,X=q.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=z(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return _(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:m,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[Y]:`0`,[be]:`1`}},o],enabled:a||!l})});X.displayName=`DrawerBackdrop`;var Z=se,xe=`data-drawer-content`,Se=q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return z(),_(`div`,e,{ref:t,props:[{[xe]:``},a]})});Se.displayName=`DrawerContent`;var Ce=U,Q=q.createContext(void 0);Q.displayName=`DrawerProviderContext`;function we(){return q.useContext(Q)}var Te=`data-expanded`,Ee=`data-nested-drawer-open`,De=`data-nested-drawer-swiping`,Oe=`data-swipe-dismiss`,ke=`data-swipe-direction`,$=`data-swiping`,Ae=q.createContext(void 0);Ae.displayName=`DrawerRootContext`;function je(e){let t=q.useContext(Ae);if(e!==!0&&t===void 0)throw Error(`Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.`);return t}function Me(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function Ne(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?P(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function Pe(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function Fe(){let e=z(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i}=je(),a=e.useState(`viewportElement`),[o,s]=q.useState(0),[c,l]=q.useState(16),u=p(()=>{let e=T(a).documentElement;s(a?a.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&l(t)});S(()=>{if(u(),!a||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(u);return e.observe(a),()=>{e.disconnect()}},[u,a]);let d=q.useMemo(()=>{if(!t||t.length===0||o<=0||i<=0)return[];let e=Math.min(i,o),n=t.map(t=>{let n=Ne(t,o,c);if(n===null)return null;let r=P(n,0,e);return{value:t,height:r,offset:Math.max(0,i-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],a=[];for(let e=n.length-1;e>=0;--e){let t=n[e];a.some(e=>Math.abs(e-t.height)<=1)||(a.push(t.height),r.push(t))}return r.reverse(),r},[i,c,t,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i,viewportHeight:o,resolvedSnapPoints:d,activeSnapPointOffset:q.useMemo(()=>{if(n===null)return;let e=d.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(i,o),r=Ne(n,o,c);if(r===null)return;let a=P(r,0,t);return d[Pe(d.map(e=>e.height),a)]},[n,i,d,c,o])?.offset??null}}var Ie=q.createContext(null);Ie.displayName=`DrawerViewportContext`;function Le(){return q.useContext(Ie)}var Re=!1;function ze(){Re||=(typeof CSS<`u`&&`registerProperty`in CSS&&([_e,ve,ye].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:Y,initialValue:`0`},{name:be,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var Be={...m,expanded(e){return e?{[Te]:``}:null},nestedDrawerOpen(e){return e?{[Ee]:``}:null},nestedDrawerSwiping(e){return e?{[De]:``}:null},swipeDirection(e){return{[ke]:e}},swiping(e){return e?{[$]:``}:null}},Ve=q.forwardRef(function(e,t){let{render:n,className:i,style:a,finalFocus:o,initialFocus:s,...c}=e,l=z(),u=l.context.popupRef,{swipeDirection:d,frontmostHeight:f,hasNestedDrawer:m,nestedSwiping:h,nestedSwipeProgressStore:g,onPopupHeightChange:v,notifyParentFrontmostHeight:y,notifyParentHasNestedDrawer:C}=je(),w=l.useState(`descriptionElementId`),T=l.useState(`disablePointerDismissal`),E=l.useState(`floatingRootContext`),D=l.useState(`popupProps`),O=l.useState(`modal`),k=l.useState(`mounted`),te=l.useState(`nested`),A=l.useState(`nestedOpenDrawerCount`),j=l.useState(`transitionStatus`),M=l.useState(`open`),P=l.useState(`openMethod`),F=l.useState(`titleElementId`),ne=l.useState(`role`),re=E.useState(`floatingId`),I=c.id??re,R=Le();B();let{snapPoints:ae,activeSnapPoint:oe,activeSnapPointOffset:V}=Fe(),H=A>0,U=R?.swiping??!1,W=R?.swipeStrength??null,[se,ce]=q.useState(0),G=q.useRef(0);q.useEffect(()=>{if(R)return;let e=b.captureOwnerStack?.()||``;N(`<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the viewport disables drawer swipe handling and touch scroll locking. Wrap <Drawer.Popup> in <Drawer.Viewport>.${e}`)},[R]);let K=p(()=>{let e=u.current;if(!e)return;let t=e.offsetHeight;if(G.current>0&&f>G.current&&t>G.current)return;if(G.current>0&&m){let e=G.current;ce(e),v(e);return}let n=t;n!==G.current&&(G.current=n,ce(n),v(n))});S(()=>{if(!k){G.current=0,ce(0),v(0);return}let e=u.current;if(!e||(ze(),K(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(K);return t.observe(e),()=>{t.disconnect()}},[K,k,H,v,u]),S(()=>{let e=()=>{let e=u.current;if(!e)return;let t=g.getSnapshot();t>0?e.style.setProperty(Y,`${t}`):e.style.setProperty(Y,`0`)};e();let t=g.subscribe(e),n=u.current;return()=>{t(),n&&n.style.setProperty(Y,`0`)}},[g,u]),S(()=>{if(M)return y?.(f),()=>{y?.(0)}},[f,M,y]),S(()=>{if(C)return C(M||j===`ending`),()=>{C(!1)}},[C,M,j]),r({open:M,ref:u,onComplete(){M&&l.context.onOpenChangeComplete?.(!0)}});let le=s===void 0?u:s,ue=l.useStateSetter(`popupElement`),de={open:M,nested:te,transitionStatus:j,expanded:oe===1,nestedDrawerOpen:H,nestedDrawerSwiping:h,swipeDirection:d,swiping:U},fe;se&&(m||j===`ending`)&&(fe=`${se}px`);let pe=ae&&ae.length>0&&(d===`down`||d===`up`),_e=null;pe&&V!==null&&(_e=d===`up`?-V:V);let X=R?R.getDragStyles():ee;if(pe&&d===`down`){let e=V??0,t=Number.parseFloat(String(X[ve]));X=U&&Number.isFinite(t)?{...X,transform:void 0,[ve]:`${Me(e,t)}px`}:{...X,transform:void 0}}let Z=_(`div`,e,{state:de,props:[D,{id:I,"aria-labelledby":F,"aria-describedby":w,role:ne,...x,hidden:!k,onKeyDown(e){ie.has(e.key)&&e.stopPropagation()},style:{...X,[Y]:`0`,[me]:A,[he]:fe,[ye]:typeof _e==`number`?`${_e}px`:`0px`,[ge]:f?`${f}px`:void 0,[be]:typeof W==`number`&&Number.isFinite(W)&&W>0?`${W}`:`1`}},c],ref:[t,u,ue],stateAttributesMapping:Be});return(0,J.jsx)(L,{context:E,openInteractionType:P,disabled:!k,closeOnFocusOut:!T,initialFocus:le,returnFocus:o,modal:O!==!1,restoreFocus:`popup`,children:Z})});Ve.displayName=`DrawerPopup`;var He=V,Ue,We;function Ge(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null,swipeDirection:f=`down`,snapToSequentialPoints:m=!1,snapPoints:g,snapPoint:_,defaultSnapPoint:v,onSnapPointChange:y}=e,b=je(!0),x=b?.onNestedSwipeProgressChange,ee=b?.onNestedFrontmostHeightChange,S=b?.onNestedSwipingChange,C=b?.onNestedDrawerPresenceChange,[w,T]=q.useState(0),[E,D]=q.useState(0),[O,k]=q.useState(!1),[te,A]=q.useState(!1),[j]=q.useState(Ke),N=v===void 0?g?.[0]??null:v,P=_!==void 0,[F,ne]=M({controlled:_,default:N,name:`Drawer`,state:`snapPoint`}),re=q.useRef(!1),I=q.useRef(!1),L=p((e,t)=>{let n=t??h(`none`);y?.(e,n),!n.isCanceled&&ne(e)}),ie=q.useMemo(()=>P||!g||g.length===0?F:F===null||!g.some(e=>Object.is(e,F))?N:F,[F,P,N,g]),R=p(e=>{T(e),!re.current&&e>0&&D(e)}),z=p(e=>{e>0?(re.current=!0,D(e)):(re.current=!1,w>0&&D(w))}),oe=p(e=>{k(e)}),B=p(e=>{j.set(e),x?.(e)}),V=p(e=>{A(e),S?.(e)}),H=p((e,t)=>{i?.(e,t),!t.isCanceled&&!e&&g&&g.length>0&&L(N,h(t.reason,t.event,t.trigger))}),U=q.useMemo(()=>({swipeDirection:f,swipeAreaActiveRef:I,snapToSequentialPoints:m,snapPoints:g,activeSnapPoint:ie,setActiveSnapPoint:L,frontmostHeight:E,popupHeight:w,hasNestedDrawer:O,nestedSwiping:te,nestedSwipeProgressStore:j,onNestedDrawerPresenceChange:oe,onPopupHeightChange:R,onNestedFrontmostHeightChange:z,onNestedSwipingChange:V,onNestedSwipeProgressChange:B,notifyParentFrontmostHeight:ee,notifyParentSwipingChange:S,notifyParentSwipeProgressChange:x,notifyParentHasNestedDrawer:C}),[ie,E,O,te,j,C,x,S,ee,oe,z,B,V,R,w,L,g,m,I,f]),W=typeof t==`function`?e=>(0,J.jsxs)(q.Fragment,{children:[Ue||=(0,J.jsx)(qe,{}),t(e)]}):(0,J.jsxs)(q.Fragment,{children:[We||=(0,J.jsx)(qe,{}),t]}),se=ae(`drawer`,{open:n,defaultOpen:r,onOpenChange:H,onOpenChangeComplete:a,disablePointerDismissal:o,modal:s,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d,children:W});return(0,J.jsx)(Ae.Provider,{value:U,children:se})}function Ke(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function qe(){let e=we(),t=z(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,o=t.useState(`open`),s=t.useState(`nestedOpenDialogCount`),c=t.useState(`popupElement`),l=s===0;return S(()=>{if(r)return()=>{r(t)}},[r,t]),S(()=>{n?.(t,o)},[o,n,t]),q.useEffect(()=>{if(!o||!l||!a)return;let e=i(c).CloseWatcher;if(!e)return;function n(e){t.select(`open`)&&t.setOpen(!1,h(y,e))}let r=new e,s=C(r,`close`,n);return()=>{s(),r.destroy()}},[t,l,o,c]),null}var Je=W,Ye=H,Xe=`data-nested-dialog-open`,Ze=q.createContext(void 0);Ze.displayName=`DrawerVirtualKeyboardContext`;function Qe(){return q.useContext(Ze)}var $e=10,et=.5,tt=.5,nt=300,rt=4,it=.2,at=4,ot=80,st=360,ct=.1,lt=6,ut=2,dt=`[${xe}]`,ft=q.forwardRef(function(e,t){let{render:r,className:i,style:a,children:o,...u}=e,f=z(),m=f.context.popupRef,_=f.context.backdropRef,{swipeDirection:v,notifyParentSwipingChange:y,notifyParentSwipeProgressChange:b,frontmostHeight:x,snapToSequentialPoints:ee,swipeAreaActiveRef:E}=je(),D=we(),{snapPoints:O,resolvedSnapPoints:k,activeSnapPoint:te,activeSnapPointOffset:A,setActiveSnapPoint:j,popupHeight:M}=Fe(),N=f.useState(`open`),L=f.useState(`mounted`),ie=f.useState(`nested`),R=f.useState(`nestedOpenDrawerCount`),ae=f.useState(`viewportElement`),oe=f.useState(`popupElement`),B=D?.visualStateStore,V=R>0,H=v===`left`||v===`right`?`horizontal`:`vertical`,U=H===`vertical`,W=U?`horizontal`:`vertical`,[se,ce]=q.useState(null),G=q.useRef(void 0),K=q.useRef(null),le=s(),ue=q.useRef(!1),de=q.useRef(!1),me=q.useRef(``),ge=q.useRef(!1),ye=q.useRef(!1),be=q.useRef(null),X=Qe(),Z=q.useMemo(()=>{if(!O||O.length<2||k.length<2||v!==`down`&&v!==`up`)return null;let e=k.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[k,O,v]),xe=q.useMemo(()=>!Z||A===null?null:P((A-Z.minOffset)/Z.range,0,1),[A,Z]),Se=q.useMemo(()=>O&&O.length>0&&(v===`down`||v===`up`)?v===`down`?[`down`,`up`]:[`up`,`down`]:[v],[O,v]),Ce=p(e=>{m.current?.toggleAttribute(Oe,e),_.current?.toggleAttribute(Oe,e)}),Q=p(()=>{Ce(!1),m.current?.removeAttribute(d),ce(null)}),Te=p(()=>{de.current&&(de.current=!1,y?.(!1))}),Ee=p((e,t,n)=>{let r=N&&!ie&&t,i=r?e:0,a=N&&t?e:0;n&&b&&(b(a),a<=0&&Te()),B?.set({swipeProgress:i,frontmostHeight:i>0?x:0});let o=_.current;if(!o)return;let s=r&&i>0;o.style.setProperty(Y,s?`${i}`:`0`),s&&x>0?o.style.setProperty(he,`${x}px`):o.style.removeProperty(he)});function De(e,t,n,r,i,a,o,s){let c=gt(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&O&&O.length>0?A??0:0)+I(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=I(t,o,s),f=Math.abs(d)>0?d:I(t,i,a);if(f<=it)return null;let p=P(f,it,at);return ct+(P(u/p,ot,st)-ot)/280*.9}function ke(e){if(de.current||!e)return;let t=e.direction??v,n=I(t,e.deltaX,e.deltaY);Math.abs(n)<$e||(de.current=!0,y?.(!0))}let $=re({enabled:L&&!V,directions:Se,elementRef:f.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:_e,y:ve},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=m.current,n=T(t).getSelection?.();if(!n||n.isCollapsed)return;let r=c(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=c(n.focusNode)?n.focusNode:n.focusNode?.parentElement;(l(t,r)||l(t,i))&&n.removeAllRanges()},onSwipingChange(e){ue.current=e,pt(f.context.backdropRef.current,e),!e&&!b&&Te()},swipeThreshold({element:e,direction:t}){return _t(e,t)},canStart(e,t){let n=f.context.popupRef.current;if(!n)return!1;let r=n.ownerDocument,i=ne(n.getRootNode(),e.x,e.y);if(!i||!l(n,i))return!1;let a=t.nativeEvent;return!((`touches`in a||a.pointerType===`touch`)&&xt(r,n))},onProgress(e,t){let n=ue.current;n&&ke(t);let r=!!(O&&O.length>0);if(n&&v===`down`&&r&&t){let e=f.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(ve,`${Me(A??0,t.deltaY)}px`))}let i=e;if(Z&&M>0){let e=A??Z.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>P((e-Z.minOffset)/Z.range,0,1))(P(e+t.deltaY,0,M)):xe!==null&&(i=xe)}n||(b?.(0),Te()),Ee(i,!0,n)},onRelease({event:e,deltaX:t,deltaY:r,direction:i,velocityX:a,velocityY:o,releaseVelocityX:s,releaseVelocityY:c}){let l=f.context.popupRef.current;if(!l){Q();return}let u=l;function p(e){Te(),Ce(!0),u.style.removeProperty(`transition`),u.setAttribute(d,``),pe.flushSync(()=>{ce(De(u,e,t,r,a,o,s,c))})}if(!O||O.length===0){if(!i){Q();return}let e=I(i,t,r);if(e<=0)return Q(),!1;if(I(i,a,o)>=et)return p(i),!0;let n=e>_t(u,i);return n?p(i):Q(),n}if(v!==`down`&&v!==`up`){Q();return}if(!M)return Q(),!1;if(k.length===0){Q();return}let m=v===`down`?r:-r,g=Math.sign(m),_=v===`down`?c:-c,y=v===`down`?o:-o,b=_;if(g!==0&&Math.abs(m)>=$e){let e=Math.sign(b);e!==0&&e!==g&&(b=y)}let x=A??0,S=P(x+m,0,M),C=Math.abs(b)>=tt?P(b,-4,rt)*nt:0,w=ee?S:P(S+C,0,M),T=h(n,e),E=()=>(Ee(0,!0,!0),Q(),!1),D=e=>(j(e.value,T),E()),N=e=>i?(j(null,T),T.isCanceled?E():(G.current=te,p(v),!0)):D(e);if(ee){let e=[...k].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=Pe(t,x),r=e[Pe(t,w)],i=Math.sign(b),a=g!==0&&i!==0&&i===g&&Math.abs(b)>=tt,o=w;if(a){let t=P(n+g,0,e.length-1);if(t!==n){let n=e[t];(g>0?w<n.offset:w>n.offset)&&(r=n,o=n.offset)}else if(g>0)return N(r)}return Math.abs(o-M)<Math.abs(o-r.offset)?N(r):D(r)}let F=k[Pe(k.map(e=>e.offset),w)];return b>=et&&m>0||Math.abs(w-M)<Math.abs(w-F.offset)?N(F):D(F)},onDismiss(e){B?.set({swipeProgress:0,frontmostHeight:0});let t=f.context.backdropRef.current;t&&(t.style.setProperty(Y,`0`),t.style.removeProperty(he));let r=h(n,e);if(f.setOpen(!1,r),r.isCanceled){let t=G.current;t!==void 0&&j(t,h(n,e)),G.current=void 0,K.current?.(),Q()}else if(f.select(`open`)){let t=e;le.request(()=>{if(f.select(`open`)){let e=G.current;e!==void 0&&j(e,h(n,t)),G.current=void 0,Q(),K.current?.()}else G.current=void 0})}else G.current=void 0,Ce(!0)}}),Ae=$.getPointerProps(),Ne=$.getTouchProps(),{moveNative:Le,reset:Re}=$;K.current=Re,q.useEffect(()=>{let e=ae??oe;if(!e)return;let t=e,n=T(t);function r(e,r,i){let a=U?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||xt(n,t)||!N||!L||V||Tt(r,e,i,U))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body)e.cancelable&&e.preventDefault(),e.stopPropagation(),Le(e,t);else if(!Et(o,H))e.cancelable&&e.preventDefault(),e.stopPropagation();else{if(a!==0){let t=kt(o,H,v,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),Le(e,t))}}function i(e){if(X?.onTouchMove(e),ye.current)return;let t=be.current,n=e.touches[0];n&&t&&(r(e,t,n),wt(t,n))}return C(n,`touchmove`,i,{passive:!1,capture:!0})},[L,V,N,oe,U,H,v,Le,ae,X]),S(()=>{Z&&!$.swiping&&Ee(!N||ie?0:xe??0,!0,!1)},[Ee,x,ie,b,N,xe,Z,$.swiping,f,B]),S(()=>{if(b)return N||b(0),()=>{b(0)}},[b,N]),S(()=>{N&&(E.current||Re(),Q())},[Q,N,Re,E]),S(()=>{let e=_.current;return()=>{B?.set({swipeProgress:0,frontmostHeight:0}),pt(e,!1);let t=_.current;t!==e&&pt(t,!1),Te()}},[_,Te,B]);let ze=q.useMemo(()=>({swiping:$.swiping,getDragStyles:$.getDragStyles,swipeStrength:se??null,setSwipeDismissed:Ce}),[Ce,$.getDragStyles,$.swiping,se]);function Be(e){ye.current=e,be.current=null}function Ve(){Be(!1),me.current=``,ge.current=!1}function He(e){return me.current=``,e.pointerType!==`touch`}return(0,J.jsx)(fe,{ref:t,className:i,style:a,render:r,...g(u,{onPointerDown(e){if(me.current=e.pointerType,ge.current=e.pointerType===`pen`,!N||!L||V)return;let t=ne(e.currentTarget.getRootNode(),e.clientX,e.clientY);mt(t)||ht(t)||e.pointerType!==`touch`&&Ae.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&Ae.onPointerMove?.(e)},onPointerUp(e){He(e)&&Ae.onPointerUp?.(e)},onPointerCancel(e){He(e)&&Ae.onPointerCancel?.(e)},onTouchStart(e){if(me.current===`pen`&&ge.current){ge.current=!1,Be(!1);return}if(!N||!L||V){Be(!1);return}let t=e.touches[0];if(!t)return;if(Ct(e)){Be(!1);return}let n=e.currentTarget,r=ne(n.getRootNode(),t.clientX,t.clientY),i=w(e.nativeEvent),a=c(i)?i:n;if(!l(n,a)||(X?.onTouchStart(e),mt(r))){Be(!0);return}ye.current=!1;let o=F(a,n,H),s=F(a,n,W)!=null,u=null;o&&(u=Ot(o,H,v)?null:!1),be.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,scrollTarget:o,hasCrossAxisScrollableContent:s,allowSwipe:u,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},Ne.onTouchStart?.(e)},onTouchEnd(e){X?.onTouchEnd(e),Ve(),Ne.onTouchEnd?.(e)},onTouchCancel(e){X?.onTouchCancel(),Ve(),Ne.onTouchCancel?.(e)},[Xe]:void 0}),children:(0,J.jsx)(Ie.Provider,{value:ze,children:o})})});ft.displayName=`DrawerViewport`;function pt(e,t){e?.toggleAttribute($,t)}function mt(e){return!!e?.closest(o)}function ht(e){return!!e?.closest(dt)}function gt(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function _t(e,t){return Math.max(gt(e,t)*.5,$e)}function vt(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function yt(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function bt(e,t){let n=c(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=c(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||l(t,n)||l(t,r)}function xt(e,t){let n=u(e);if(n&&l(t,n)&&yt(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:bt(r,t)}function St(e,t){return e.composedPath().some(e=>vt(e,t))}function Ct(e){return St(e.nativeEvent,i(e.currentTarget))}function wt(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function Tt(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=lt&&s>o+ut?(e.preserveNativeCrossAxisScroll=!0,!0):o>=lt?(e.drawerAxisAttributed=!0,!1):!0}function Et(e,t){return Dt(e,t).max>0}function Dt(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function Ot(e,t,n){let r=At(n,t),{offset:i,max:a}=Dt(e,t);return r?i<=0:i>=a}function kt(e,t,n,r){return(At(n,t)?r>0:r<0)&&Ot(e,t,n)}function At(e,t){return t===`vertical`?e===`down`:e===`right`}var jt=te();function Mt(e,t){let n=typeof window<`u`&&window.matchMedia!==void 0;e=e.replace(/^@media( ?)/m,``);let{defaultMatches:r=!1,matchMedia:i=n?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:o=!1}=t,s=q.useCallback(()=>r,[r]),c=q.useMemo(()=>{if(o&&i)return()=>i(e).matches;if(a!==null){let{matches:t}=a(e);return()=>t}return s},[s,e,a,o,i]),[l,u]=q.useMemo(()=>{if(i===null)return[s,()=>()=>{}];let t=i(e);return[()=>t.matches,e=>C(t,`change`,e)]},[s,i,e]),d=(0,jt.useSyncExternalStore)(u,l,c);return q.useDebugValue({query:e,match:d}),d}var Nt={size:{sm:{classes:`sm:max-w-md`,description:`Compact desktop dialog width (448px)`},base:{classes:`sm:max-w-xl`,description:`Default desktop dialog width (576px)`},lg:{classes:`sm:max-w-2xl`,description:`Large desktop dialog width (672px)`},xl:{classes:`sm:max-w-3xl`,description:`Extra large desktop dialog width (768px)`}},verticalAlign:{top:{classes:`sm:items-start sm:pt-16 sm:pb-6`,description:`Align the desktop dialog near the top of the viewport`},center:{classes:`sm:items-center sm:py-6`,description:`Center the desktop dialog vertically`}}},Pt={size:`base`,verticalAlign:`center`},Ft=(0,q.createContext)(!1),It=(0,q.createContext)(!1),Lt=(0,q.createContext)(!1),Rt=(0,q.createContext)({title:null,description:null,actions:null,showCloseButton:!1,closeLabel:``}),zt=new Set([`close-press`,`close-watcher`,`escape-key`,`outside-press`,`swipe`,`trigger-press`]);function Bt({alert:e,children:t,dismissDisabled:n=!1,onOpenChange:r,disablePointerDismissal:i,modal:a,...o}){let s=Mt(`(min-width: 640px)`,{defaultMatches:!1}),c=(e,t)=>{!e&&n&&zt.has(t.reason)?t.cancel():r?.(e,t)},l={...o,disablePointerDismissal:e||n||i,modal:e?!0:a,onOpenChange:c};return(0,J.jsx)(Lt.Provider,{value:e,children:(0,J.jsx)(Ft.Provider,{value:s,children:(0,J.jsx)(It.Provider,{value:n,children:(0,J.jsx)(Ge,{...l,children:t})})})})}function Vt(e){return(0,J.jsx)(Bt,{...e,alert:!1})}Vt.displayName=`LayerDialog.Root`;function Ht(e){return(0,J.jsx)(Bt,{...e,alert:!0})}Ht.displayName=`LayerDialog.Alert`;function Ut(e){return(0,J.jsx)(Ye,{...e})}Ut.displayName=`LayerDialog.Trigger`;function Wt(e,t){let n=e.filter(e=>(0,q.isValidElement)(e)&&e.type===t);return{element:n[0],count:n.length}}function Gt({children:e,closeLabel:n,container:r,size:i=Pt.size,verticalAlign:a=Pt.verticalAlign}){let{layerDialog:o}=j(),s=v(),c=r??s??void 0,l=(0,q.useContext)(Ft),u=(0,q.useContext)(It),d=(0,q.useContext)(Lt),p=q.Children.toArray(e),m=Wt(p,Kt),h=Wt(p,qt),g=Wt(p,Xt),_=Wt(p,$t);if(p.some(e=>!(0,q.isValidElement)(e)||e.type!==Kt&&e.type!==qt&&e.type!==Xt&&e.type!==$t)||m.count!==1||g.count!==1||h.count>1||_.count>1||d&&_.count!==1)throw Error(d?`LayerDialog.Alert requires exactly one direct LayerDialog.Title, LayerDialog.Body, and LayerDialog.Actions, with an optional direct LayerDialog.Description.`:`LayerDialog.Content requires exactly one direct LayerDialog.Title and LayerDialog.Body, with an optional direct LayerDialog.Description and LayerDialog.Actions.`);let y=f(Nt.size,i,Pt.size),b=f(Nt.verticalAlign,a,Pt.verticalAlign),x={title:m.element,description:h.element??null,actions:_.element??null,showCloseButton:_.count===0,closeLabel:n??o.close};return(0,J.jsxs)(He,{container:c,children:[(0,J.jsx)(X,{forceRender:!0,"data-layer-dialog-backdrop":!0,className:`fixed inset-0 bg-kumo-recessed opacity-80 transition-opacity duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)] data-[ending-style]:opacity-0 data-[ending-style]:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-[starting-style]:opacity-0 data-[swiping]:duration-0 motion-reduce:transition-none sm:duration-200 sm:data-[ending-style]:duration-200`}),(0,J.jsx)(ft,{className:t(`fixed inset-0 flex items-end justify-center sm:px-4`,b.classes),"data-base-ui-swipe-ignore":l||u||d?``:void 0,children:(0,J.jsx)(Ve,{render:d?(0,J.jsx)(`div`,{role:`alertdialog`}):(0,J.jsx)(`div`,{}),className:t(`fixed inset-x-0 bottom-0 flex max-h-[85dvh] min-h-0 w-full max-w-none [transform:translate3d(0,var(--drawer-swipe-movement-y,0px),0)] transform-gpu overflow-visible transition-[transform,opacity] duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)] will-change-transform outline-none data-[ending-style]:[transform:translate3d(0,100%,0)] data-[ending-style]:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-[starting-style]:[transform:translate3d(0,100%,0)] data-[swiping]:duration-0 data-[swiping]:select-none motion-reduce:transition-none sm:static sm:max-h-full sm:[transform:translate3d(0,0,0)] sm:duration-200 sm:data-[ending-style]:[transform:translate3d(0,8px,0)] sm:data-[ending-style]:opacity-0 sm:data-[ending-style]:duration-200 sm:data-[starting-style]:[transform:translate3d(0,8px,0)] sm:data-[starting-style]:opacity-0`,y.classes),children:(0,J.jsxs)(R,{className:`flex max-h-[85dvh] min-h-0 w-full flex-col overflow-hidden rounded-none bg-kumo-elevated p-1.5 shadow-[0_20px_25px_-5px_rgb(0_0_0/0.03),0_8px_10px_-6px_rgb(0_0_0/0.03)] max-sm:border-t max-sm:border-kumo-hairline max-sm:shadow-xs max-sm:ring-0 sm:max-h-full sm:rounded-xl`,children:[!l&&!d&&(0,J.jsx)(`div`,{"aria-hidden":!0,className:`flex justify-center pt-1.5 pb-3`,children:(0,J.jsx)(`div`,{className:`h-1 w-10 rounded-full bg-kumo-fill`})}),(0,J.jsxs)(Se,{className:`flex min-h-0 flex-col overflow-visible`,children:[(0,J.jsx)(Rt.Provider,{value:x,children:g.element}),l&&_.element]})]})})})]})}Gt.displayName=`LayerDialog.Content`;function Kt({children:e}){return(0,J.jsx)(Je,{render:t=>(0,J.jsx)(A,{...t,as:`h2`,variant:`heading`,DANGEROUS_className:`font-medium`,children:e})})}Kt.displayName=`LayerDialog.Title`;function qt({children:e}){return(0,J.jsx)(Ce,{render:t=>(0,J.jsx)(A,{...t,as:`p`,variant:`secondary`,children:e})})}qt.displayName=`LayerDialog.Description`;var Jt=8,Yt=16;function Xt({children:e}){let[n,r]=(0,q.useState)(!1),i=(0,q.useRef)(null),a=(0,q.useContext)(It),{title:o,description:s,actions:c,showCloseButton:l,closeLabel:u}=(0,q.useContext)(Rt),d=(0,q.useContext)(Ft),f=e=>{let{scrollTop:t,scrollHeight:a,clientHeight:o}=e.currentTarget;if(!(t>Jt)){r(!1);return}if(n)return;let s=i.current?.offsetHeight??0;a-o-s>Yt&&r(!0)},p=s?e:(0,J.jsx)(Ce,{render:(0,J.jsx)(`div`,{}),children:e});return(0,J.jsxs)(R.Primary,{className:`min-h-0 flex-1 gap-0 p-0`,children:[(0,J.jsxs)(`div`,{className:`z-10 flex shrink-0 items-start justify-between gap-4 rounded-t-lg bg-kumo-base px-4 py-4 sm:px-4.5`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[o,s&&(0,J.jsx)(`div`,{className:t(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none`,n?`grid-rows-[0fr] opacity-0`:`grid-rows-[1fr] opacity-100`),"data-condensed":n||void 0,children:(0,J.jsx)(`div`,{ref:i,className:`min-h-0 overflow-hidden`,children:(0,J.jsx)(`div`,{className:`pt-1`,children:s})})})]}),l&&(0,J.jsx)(Zt,{disabled:a,label:u})]}),(0,J.jsxs)(ue,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,J.jsx)(le,{className:`min-h-0 flex-1 overscroll-none [mask-image:linear-gradient(to_bottom,transparent_0,black_min(24px,var(--scroll-area-overflow-y-start,24px)),black_calc(100%-min(24px,var(--scroll-area-overflow-y-end,24px))),transparent_100%)]`,onScroll:f,children:d?(0,J.jsx)(K,{className:`px-4.5 pb-4.5`,children:p}):(0,J.jsx)(K,{className:`px-4 pb-4`,children:p})}),(0,J.jsx)(G,{keepMounted:!0,orientation:`vertical`,className:`my-1.5 me-0.5 hidden w-2 p-px opacity-0 transition-opacity data-[has-overflow-y]:block data-[hovering]:opacity-100 data-[scrolling]:opacity-100`,children:(0,J.jsx)(ce,{className:`w-full rounded-full bg-kumo-contrast opacity-10 transition-opacity hover:opacity-20 active:opacity-30`})})]}),!d&&c&&(0,J.jsx)(`div`,{className:`shrink-0 border-t border-kumo-hairline p-4`,children:c})]})}Xt.displayName=`LayerDialog.Body`;function Zt({disabled:e,label:t}){return(0,J.jsx)(Z,{render:n=>(0,J.jsx)(k,{...n,"aria-label":t,className:`-mt-1.5 -me-1.5 rounded-lg`,disabled:e,icon:(0,J.jsx)(de,{size:15}),shape:`square`,size:`sm`,variant:`ghost`})})}function Qt({children:e,loading:t,variant:n=`primary`,...r}){return(0,J.jsx)(k,{...r,loading:t,variant:n,children:e})}Qt.displayName=`LayerDialog.Actions.Primary`;var $t=Object.assign(function({children:e,dismissLabel:n}){let r=(0,q.useContext)(It),i=(0,q.useContext)(Lt),a=(0,q.useContext)(Ft),{layerDialog:o}=j(),s=n??(i?o.cancel:o.close);if(!(0,q.isValidElement)(e)||e.type!==Qt)throw Error(`LayerDialog.Actions requires exactly one direct LayerDialog.Actions.Primary.`);return(0,J.jsxs)(`div`,{className:t(`flex w-full items-center justify-between gap-2`,a&&`shrink-0 pt-1.75`),children:[(0,J.jsx)(en,{disabled:r,label:s}),e]})},{Primary:Qt,displayName:`LayerDialog.Actions`});function en({disabled:e,label:t}){let n=(0,q.useContext)(Ft);return(0,J.jsx)(Z,{render:r=>(0,J.jsx)(k,{...r,className:`hover:bg-kumo-fill/50`,disabled:e,variant:n?`ghost`:`secondary`,children:t})})}var tn=Object.assign(Vt,{Root:Vt,Alert:Ht,Trigger:Ut,Content:Gt,Title:Kt,Description:qt,Body:Xt,Actions:$t});export{tn as t};
|
|
2
|
-
//# sourceMappingURL=layer-dialog-j5ywmzs46ccg6oqy-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./vendor-styling-da1xibnxfkjmtglr-f72JA6U4.js";import{At as n,C as r,Hn as i,Ht as a,N as o,T as s,Un as c,Ut as l,Vt as u,Wt as d,_r as f,at as p,bn as m,ct as h,dr as g,hr as _,ir as v,mt as y,nr as b,o as x,or as ee,rr as S,st as C,tn as w,vn as T}from"./useBaseUiId-lg1teubxudgin0w2-DE9psqVX.js";import{i as E,n as D,r as O}from"./react-iRJfyluG.js";import{t as k}from"./button-pa1bq9b85hawg41a-CTLAwRb5.js";import{w as te}from"./tanstack-8GMTaj0M.js";import{n as A,p as j}from"./skeleton-line-m9dyh126t9k07jvg-C0LAvXNf.js";import{c as M,u as N}from"./useButton-h7s9aq1sfw6arawe-CDg3MSn7.js";import{t as P}from"./clamp-jcjhzx71s6wt1rnc-D0kAXd-u.js";import{t as F}from"./scrollable-b6m9ze1u7ps0q1qn-CsARZWmE.js";import{n as ne,r as re,t as I}from"./useSwipeDismiss-m1s13x9t9ey9ax3p-D7CLht-d.js";import{n as L}from"./useClick-l0p0endoxrlp0ae5-dDySeZPV.js";import{a as ie}from"./composite-ab8dmdfoj6tmhcn1-BnZxF-Cq.js";import{t as R}from"./layer-card-idh3863vdgprgqai-ByBfeMqc.js";import{a as ae,i as z,n as oe,r as B,t as V}from"./useRenderDialogRoot-lddunc01twftravv-YHj8p0Db.js";import{i as H,n as U,r as W,t as se}from"./DialogTrigger-g44cuem7n4wez533-EhxANqX5.js";import{at as ce,it as G,nt as K,ot as le,rt as ue,ut as de}from"./index-CRaauoqY.js";var q=e(E(),1),fe=q.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=B(),c=z(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return _(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:oe,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})});fe.displayName=`DialogViewport`;var J=O(),pe=e(D(),1),me=`--nested-drawers`,he=`--drawer-height`,ge=`--drawer-frontmost-height`,_e=`--drawer-swipe-movement-x`,ve=`--drawer-swipe-movement-y`,ye=`--drawer-snap-point-offset`,be=`--drawer-swipe-strength`,Y=`--drawer-swipe-progress`,X=q.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=z(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return _(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:m,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[Y]:`0`,[be]:`1`}},o],enabled:a||!l})});X.displayName=`DrawerBackdrop`;var Z=se,xe=`data-drawer-content`,Se=q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return z(),_(`div`,e,{ref:t,props:[{[xe]:``},a]})});Se.displayName=`DrawerContent`;var Ce=U,Q=q.createContext(void 0);Q.displayName=`DrawerProviderContext`;function we(){return q.useContext(Q)}var Te=`data-expanded`,Ee=`data-nested-drawer-open`,De=`data-nested-drawer-swiping`,Oe=`data-swipe-dismiss`,ke=`data-swipe-direction`,$=`data-swiping`,Ae=q.createContext(void 0);Ae.displayName=`DrawerRootContext`;function je(e){let t=q.useContext(Ae);if(e!==!0&&t===void 0)throw Error(`Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.`);return t}function Me(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function Ne(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?P(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function Pe(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function Fe(){let e=z(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i}=je(),a=e.useState(`viewportElement`),[o,s]=q.useState(0),[c,l]=q.useState(16),u=p(()=>{let e=T(a).documentElement;s(a?a.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&l(t)});S(()=>{if(u(),!a||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(u);return e.observe(a),()=>{e.disconnect()}},[u,a]);let d=q.useMemo(()=>{if(!t||t.length===0||o<=0||i<=0)return[];let e=Math.min(i,o),n=t.map(t=>{let n=Ne(t,o,c);if(n===null)return null;let r=P(n,0,e);return{value:t,height:r,offset:Math.max(0,i-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],a=[];for(let e=n.length-1;e>=0;--e){let t=n[e];a.some(e=>Math.abs(e-t.height)<=1)||(a.push(t.height),r.push(t))}return r.reverse(),r},[i,c,t,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i,viewportHeight:o,resolvedSnapPoints:d,activeSnapPointOffset:q.useMemo(()=>{if(n===null)return;let e=d.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(i,o),r=Ne(n,o,c);if(r===null)return;let a=P(r,0,t);return d[Pe(d.map(e=>e.height),a)]},[n,i,d,c,o])?.offset??null}}var Ie=q.createContext(null);Ie.displayName=`DrawerViewportContext`;function Le(){return q.useContext(Ie)}var Re=!1;function ze(){Re||=(typeof CSS<`u`&&`registerProperty`in CSS&&([_e,ve,ye].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:Y,initialValue:`0`},{name:be,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var Be={...m,expanded(e){return e?{[Te]:``}:null},nestedDrawerOpen(e){return e?{[Ee]:``}:null},nestedDrawerSwiping(e){return e?{[De]:``}:null},swipeDirection(e){return{[ke]:e}},swiping(e){return e?{[$]:``}:null}},Ve=q.forwardRef(function(e,t){let{render:n,className:i,style:a,finalFocus:o,initialFocus:s,...c}=e,l=z(),u=l.context.popupRef,{swipeDirection:d,frontmostHeight:f,hasNestedDrawer:m,nestedSwiping:h,nestedSwipeProgressStore:g,onPopupHeightChange:v,notifyParentFrontmostHeight:y,notifyParentHasNestedDrawer:C}=je(),w=l.useState(`descriptionElementId`),T=l.useState(`disablePointerDismissal`),E=l.useState(`floatingRootContext`),D=l.useState(`popupProps`),O=l.useState(`modal`),k=l.useState(`mounted`),te=l.useState(`nested`),A=l.useState(`nestedOpenDrawerCount`),j=l.useState(`transitionStatus`),M=l.useState(`open`),P=l.useState(`openMethod`),F=l.useState(`titleElementId`),ne=l.useState(`role`),re=E.useState(`floatingId`),I=c.id??re,R=Le();B();let{snapPoints:ae,activeSnapPoint:oe,activeSnapPointOffset:V}=Fe(),H=A>0,U=R?.swiping??!1,W=R?.swipeStrength??null,[se,ce]=q.useState(0),G=q.useRef(0);q.useEffect(()=>{if(R)return;let e=b.captureOwnerStack?.()||``;N(`<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the viewport disables drawer swipe handling and touch scroll locking. Wrap <Drawer.Popup> in <Drawer.Viewport>.${e}`)},[R]);let K=p(()=>{let e=u.current;if(!e)return;let t=e.offsetHeight;if(G.current>0&&f>G.current&&t>G.current)return;if(G.current>0&&m){let e=G.current;ce(e),v(e);return}let n=t;n!==G.current&&(G.current=n,ce(n),v(n))});S(()=>{if(!k){G.current=0,ce(0),v(0);return}let e=u.current;if(!e||(ze(),K(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(K);return t.observe(e),()=>{t.disconnect()}},[K,k,H,v,u]),S(()=>{let e=()=>{let e=u.current;if(!e)return;let t=g.getSnapshot();t>0?e.style.setProperty(Y,`${t}`):e.style.setProperty(Y,`0`)};e();let t=g.subscribe(e),n=u.current;return()=>{t(),n&&n.style.setProperty(Y,`0`)}},[g,u]),S(()=>{if(M)return y?.(f),()=>{y?.(0)}},[f,M,y]),S(()=>{if(C)return C(M||j===`ending`),()=>{C(!1)}},[C,M,j]),r({open:M,ref:u,onComplete(){M&&l.context.onOpenChangeComplete?.(!0)}});let le=s===void 0?u:s,ue=l.useStateSetter(`popupElement`),de={open:M,nested:te,transitionStatus:j,expanded:oe===1,nestedDrawerOpen:H,nestedDrawerSwiping:h,swipeDirection:d,swiping:U},fe;se&&(m||j===`ending`)&&(fe=`${se}px`);let pe=ae&&ae.length>0&&(d===`down`||d===`up`),_e=null;pe&&V!==null&&(_e=d===`up`?-V:V);let X=R?R.getDragStyles():ee;if(pe&&d===`down`){let e=V??0,t=Number.parseFloat(String(X[ve]));X=U&&Number.isFinite(t)?{...X,transform:void 0,[ve]:`${Me(e,t)}px`}:{...X,transform:void 0}}let Z=_(`div`,e,{state:de,props:[D,{id:I,"aria-labelledby":F,"aria-describedby":w,role:ne,...x,hidden:!k,onKeyDown(e){ie.has(e.key)&&e.stopPropagation()},style:{...X,[Y]:`0`,[me]:A,[he]:fe,[ye]:typeof _e==`number`?`${_e}px`:`0px`,[ge]:f?`${f}px`:void 0,[be]:typeof W==`number`&&Number.isFinite(W)&&W>0?`${W}`:`1`}},c],ref:[t,u,ue],stateAttributesMapping:Be});return(0,J.jsx)(L,{context:E,openInteractionType:P,disabled:!k,closeOnFocusOut:!T,initialFocus:le,returnFocus:o,modal:O!==!1,restoreFocus:`popup`,children:Z})});Ve.displayName=`DrawerPopup`;var He=V,Ue,We;function Ge(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null,swipeDirection:f=`down`,snapToSequentialPoints:m=!1,snapPoints:g,snapPoint:_,defaultSnapPoint:v,onSnapPointChange:y}=e,b=je(!0),x=b?.onNestedSwipeProgressChange,ee=b?.onNestedFrontmostHeightChange,S=b?.onNestedSwipingChange,C=b?.onNestedDrawerPresenceChange,[w,T]=q.useState(0),[E,D]=q.useState(0),[O,k]=q.useState(!1),[te,A]=q.useState(!1),[j]=q.useState(Ke),N=v===void 0?g?.[0]??null:v,P=_!==void 0,[F,ne]=M({controlled:_,default:N,name:`Drawer`,state:`snapPoint`}),re=q.useRef(!1),I=q.useRef(!1),L=p((e,t)=>{let n=t??h(`none`);y?.(e,n),!n.isCanceled&&ne(e)}),ie=q.useMemo(()=>P||!g||g.length===0?F:F===null||!g.some(e=>Object.is(e,F))?N:F,[F,P,N,g]),R=p(e=>{T(e),!re.current&&e>0&&D(e)}),z=p(e=>{e>0?(re.current=!0,D(e)):(re.current=!1,w>0&&D(w))}),oe=p(e=>{k(e)}),B=p(e=>{j.set(e),x?.(e)}),V=p(e=>{A(e),S?.(e)}),H=p((e,t)=>{i?.(e,t),!t.isCanceled&&!e&&g&&g.length>0&&L(N,h(t.reason,t.event,t.trigger))}),U=q.useMemo(()=>({swipeDirection:f,swipeAreaActiveRef:I,snapToSequentialPoints:m,snapPoints:g,activeSnapPoint:ie,setActiveSnapPoint:L,frontmostHeight:E,popupHeight:w,hasNestedDrawer:O,nestedSwiping:te,nestedSwipeProgressStore:j,onNestedDrawerPresenceChange:oe,onPopupHeightChange:R,onNestedFrontmostHeightChange:z,onNestedSwipingChange:V,onNestedSwipeProgressChange:B,notifyParentFrontmostHeight:ee,notifyParentSwipingChange:S,notifyParentSwipeProgressChange:x,notifyParentHasNestedDrawer:C}),[ie,E,O,te,j,C,x,S,ee,oe,z,B,V,R,w,L,g,m,I,f]),W=typeof t==`function`?e=>(0,J.jsxs)(q.Fragment,{children:[Ue||=(0,J.jsx)(qe,{}),t(e)]}):(0,J.jsxs)(q.Fragment,{children:[We||=(0,J.jsx)(qe,{}),t]}),se=ae(`drawer`,{open:n,defaultOpen:r,onOpenChange:H,onOpenChangeComplete:a,disablePointerDismissal:o,modal:s,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d,children:W});return(0,J.jsx)(Ae.Provider,{value:U,children:se})}function Ke(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function qe(){let e=we(),t=z(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,o=t.useState(`open`),s=t.useState(`nestedOpenDialogCount`),c=t.useState(`popupElement`),l=s===0;return S(()=>{if(r)return()=>{r(t)}},[r,t]),S(()=>{n?.(t,o)},[o,n,t]),q.useEffect(()=>{if(!o||!l||!a)return;let e=i(c).CloseWatcher;if(!e)return;function n(e){t.select(`open`)&&t.setOpen(!1,h(y,e))}let r=new e,s=C(r,`close`,n);return()=>{s(),r.destroy()}},[t,l,o,c]),null}var Je=W,Ye=H,Xe=`data-nested-dialog-open`,Ze=q.createContext(void 0);Ze.displayName=`DrawerVirtualKeyboardContext`;function Qe(){return q.useContext(Ze)}var $e=10,et=.5,tt=.5,nt=300,rt=4,it=.2,at=4,ot=80,st=360,ct=.1,lt=6,ut=2,dt=`[${xe}]`,ft=q.forwardRef(function(e,t){let{render:r,className:i,style:a,children:o,...u}=e,f=z(),m=f.context.popupRef,_=f.context.backdropRef,{swipeDirection:v,notifyParentSwipingChange:y,notifyParentSwipeProgressChange:b,frontmostHeight:x,snapToSequentialPoints:ee,swipeAreaActiveRef:E}=je(),D=we(),{snapPoints:O,resolvedSnapPoints:k,activeSnapPoint:te,activeSnapPointOffset:A,setActiveSnapPoint:j,popupHeight:M}=Fe(),N=f.useState(`open`),L=f.useState(`mounted`),ie=f.useState(`nested`),R=f.useState(`nestedOpenDrawerCount`),ae=f.useState(`viewportElement`),oe=f.useState(`popupElement`),B=D?.visualStateStore,V=R>0,H=v===`left`||v===`right`?`horizontal`:`vertical`,U=H===`vertical`,W=U?`horizontal`:`vertical`,[se,ce]=q.useState(null),G=q.useRef(void 0),K=q.useRef(null),le=s(),ue=q.useRef(!1),de=q.useRef(!1),me=q.useRef(``),ge=q.useRef(!1),ye=q.useRef(!1),be=q.useRef(null),X=Qe(),Z=q.useMemo(()=>{if(!O||O.length<2||k.length<2||v!==`down`&&v!==`up`)return null;let e=k.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[k,O,v]),xe=q.useMemo(()=>!Z||A===null?null:P((A-Z.minOffset)/Z.range,0,1),[A,Z]),Se=q.useMemo(()=>O&&O.length>0&&(v===`down`||v===`up`)?v===`down`?[`down`,`up`]:[`up`,`down`]:[v],[O,v]),Ce=p(e=>{m.current?.toggleAttribute(Oe,e),_.current?.toggleAttribute(Oe,e)}),Q=p(()=>{Ce(!1),m.current?.removeAttribute(d),ce(null)}),Te=p(()=>{de.current&&(de.current=!1,y?.(!1))}),Ee=p((e,t,n)=>{let r=N&&!ie&&t,i=r?e:0,a=N&&t?e:0;n&&b&&(b(a),a<=0&&Te()),B?.set({swipeProgress:i,frontmostHeight:i>0?x:0});let o=_.current;if(!o)return;let s=r&&i>0;o.style.setProperty(Y,s?`${i}`:`0`),s&&x>0?o.style.setProperty(he,`${x}px`):o.style.removeProperty(he)});function De(e,t,n,r,i,a,o,s){let c=gt(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&O&&O.length>0?A??0:0)+I(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=I(t,o,s),f=Math.abs(d)>0?d:I(t,i,a);if(f<=it)return null;let p=P(f,it,at);return ct+(P(u/p,ot,st)-ot)/280*.9}function ke(e){if(de.current||!e)return;let t=e.direction??v,n=I(t,e.deltaX,e.deltaY);Math.abs(n)<$e||(de.current=!0,y?.(!0))}let $=re({enabled:L&&!V,directions:Se,elementRef:f.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:_e,y:ve},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=m.current,n=T(t).getSelection?.();if(!n||n.isCollapsed)return;let r=c(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=c(n.focusNode)?n.focusNode:n.focusNode?.parentElement;(l(t,r)||l(t,i))&&n.removeAllRanges()},onSwipingChange(e){ue.current=e,pt(f.context.backdropRef.current,e),!e&&!b&&Te()},swipeThreshold({element:e,direction:t}){return _t(e,t)},canStart(e,t){let n=f.context.popupRef.current;if(!n)return!1;let r=n.ownerDocument,i=ne(n.getRootNode(),e.x,e.y);if(!i||!l(n,i))return!1;let a=t.nativeEvent;return!((`touches`in a||a.pointerType===`touch`)&&xt(r,n))},onProgress(e,t){let n=ue.current;n&&ke(t);let r=!!(O&&O.length>0);if(n&&v===`down`&&r&&t){let e=f.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(ve,`${Me(A??0,t.deltaY)}px`))}let i=e;if(Z&&M>0){let e=A??Z.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>P((e-Z.minOffset)/Z.range,0,1))(P(e+t.deltaY,0,M)):xe!==null&&(i=xe)}n||(b?.(0),Te()),Ee(i,!0,n)},onRelease({event:e,deltaX:t,deltaY:r,direction:i,velocityX:a,velocityY:o,releaseVelocityX:s,releaseVelocityY:c}){let l=f.context.popupRef.current;if(!l){Q();return}let u=l;function p(e){Te(),Ce(!0),u.style.removeProperty(`transition`),u.setAttribute(d,``),pe.flushSync(()=>{ce(De(u,e,t,r,a,o,s,c))})}if(!O||O.length===0){if(!i){Q();return}let e=I(i,t,r);if(e<=0)return Q(),!1;if(I(i,a,o)>=et)return p(i),!0;let n=e>_t(u,i);return n?p(i):Q(),n}if(v!==`down`&&v!==`up`){Q();return}if(!M)return Q(),!1;if(k.length===0){Q();return}let m=v===`down`?r:-r,g=Math.sign(m),_=v===`down`?c:-c,y=v===`down`?o:-o,b=_;if(g!==0&&Math.abs(m)>=$e){let e=Math.sign(b);e!==0&&e!==g&&(b=y)}let x=A??0,S=P(x+m,0,M),C=Math.abs(b)>=tt?P(b,-4,rt)*nt:0,w=ee?S:P(S+C,0,M),T=h(n,e),E=()=>(Ee(0,!0,!0),Q(),!1),D=e=>(j(e.value,T),E()),N=e=>i?(j(null,T),T.isCanceled?E():(G.current=te,p(v),!0)):D(e);if(ee){let e=[...k].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=Pe(t,x),r=e[Pe(t,w)],i=Math.sign(b),a=g!==0&&i!==0&&i===g&&Math.abs(b)>=tt,o=w;if(a){let t=P(n+g,0,e.length-1);if(t!==n){let n=e[t];(g>0?w<n.offset:w>n.offset)&&(r=n,o=n.offset)}else if(g>0)return N(r)}return Math.abs(o-M)<Math.abs(o-r.offset)?N(r):D(r)}let F=k[Pe(k.map(e=>e.offset),w)];return b>=et&&m>0||Math.abs(w-M)<Math.abs(w-F.offset)?N(F):D(F)},onDismiss(e){B?.set({swipeProgress:0,frontmostHeight:0});let t=f.context.backdropRef.current;t&&(t.style.setProperty(Y,`0`),t.style.removeProperty(he));let r=h(n,e);if(f.setOpen(!1,r),r.isCanceled){let t=G.current;t!==void 0&&j(t,h(n,e)),G.current=void 0,K.current?.(),Q()}else if(f.select(`open`)){let t=e;le.request(()=>{if(f.select(`open`)){let e=G.current;e!==void 0&&j(e,h(n,t)),G.current=void 0,Q(),K.current?.()}else G.current=void 0})}else G.current=void 0,Ce(!0)}}),Ae=$.getPointerProps(),Ne=$.getTouchProps(),{moveNative:Le,reset:Re}=$;K.current=Re,q.useEffect(()=>{let e=ae??oe;if(!e)return;let t=e,n=T(t);function r(e,r,i){let a=U?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||xt(n,t)||!N||!L||V||Tt(r,e,i,U))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body)e.cancelable&&e.preventDefault(),e.stopPropagation(),Le(e,t);else if(!Et(o,H))e.cancelable&&e.preventDefault(),e.stopPropagation();else{if(a!==0){let t=kt(o,H,v,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),Le(e,t))}}function i(e){if(X?.onTouchMove(e),ye.current)return;let t=be.current,n=e.touches[0];n&&t&&(r(e,t,n),wt(t,n))}return C(n,`touchmove`,i,{passive:!1,capture:!0})},[L,V,N,oe,U,H,v,Le,ae,X]),S(()=>{Z&&!$.swiping&&Ee(!N||ie?0:xe??0,!0,!1)},[Ee,x,ie,b,N,xe,Z,$.swiping,f,B]),S(()=>{if(b)return N||b(0),()=>{b(0)}},[b,N]),S(()=>{N&&(E.current||Re(),Q())},[Q,N,Re,E]),S(()=>{let e=_.current;return()=>{B?.set({swipeProgress:0,frontmostHeight:0}),pt(e,!1);let t=_.current;t!==e&&pt(t,!1),Te()}},[_,Te,B]);let ze=q.useMemo(()=>({swiping:$.swiping,getDragStyles:$.getDragStyles,swipeStrength:se??null,setSwipeDismissed:Ce}),[Ce,$.getDragStyles,$.swiping,se]);function Be(e){ye.current=e,be.current=null}function Ve(){Be(!1),me.current=``,ge.current=!1}function He(e){return me.current=``,e.pointerType!==`touch`}return(0,J.jsx)(fe,{ref:t,className:i,style:a,render:r,...g(u,{onPointerDown(e){if(me.current=e.pointerType,ge.current=e.pointerType===`pen`,!N||!L||V)return;let t=ne(e.currentTarget.getRootNode(),e.clientX,e.clientY);mt(t)||ht(t)||e.pointerType!==`touch`&&Ae.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&Ae.onPointerMove?.(e)},onPointerUp(e){He(e)&&Ae.onPointerUp?.(e)},onPointerCancel(e){He(e)&&Ae.onPointerCancel?.(e)},onTouchStart(e){if(me.current===`pen`&&ge.current){ge.current=!1,Be(!1);return}if(!N||!L||V){Be(!1);return}let t=e.touches[0];if(!t)return;if(Ct(e)){Be(!1);return}let n=e.currentTarget,r=ne(n.getRootNode(),t.clientX,t.clientY),i=w(e.nativeEvent),a=c(i)?i:n;if(!l(n,a)||(X?.onTouchStart(e),mt(r))){Be(!0);return}ye.current=!1;let o=F(a,n,H),s=F(a,n,W)!=null,u=null;o&&(u=Ot(o,H,v)?null:!1),be.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,scrollTarget:o,hasCrossAxisScrollableContent:s,allowSwipe:u,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},Ne.onTouchStart?.(e)},onTouchEnd(e){X?.onTouchEnd(e),Ve(),Ne.onTouchEnd?.(e)},onTouchCancel(e){X?.onTouchCancel(),Ve(),Ne.onTouchCancel?.(e)},[Xe]:void 0}),children:(0,J.jsx)(Ie.Provider,{value:ze,children:o})})});ft.displayName=`DrawerViewport`;function pt(e,t){e?.toggleAttribute($,t)}function mt(e){return!!e?.closest(o)}function ht(e){return!!e?.closest(dt)}function gt(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function _t(e,t){return Math.max(gt(e,t)*.5,$e)}function vt(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function yt(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function bt(e,t){let n=c(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=c(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||l(t,n)||l(t,r)}function xt(e,t){let n=u(e);if(n&&l(t,n)&&yt(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:bt(r,t)}function St(e,t){return e.composedPath().some(e=>vt(e,t))}function Ct(e){return St(e.nativeEvent,i(e.currentTarget))}function wt(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function Tt(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=lt&&s>o+ut?(e.preserveNativeCrossAxisScroll=!0,!0):o>=lt?(e.drawerAxisAttributed=!0,!1):!0}function Et(e,t){return Dt(e,t).max>0}function Dt(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function Ot(e,t,n){let r=At(n,t),{offset:i,max:a}=Dt(e,t);return r?i<=0:i>=a}function kt(e,t,n,r){return(At(n,t)?r>0:r<0)&&Ot(e,t,n)}function At(e,t){return t===`vertical`?e===`down`:e===`right`}var jt=te();function Mt(e,t){let n=typeof window<`u`&&window.matchMedia!==void 0;e=e.replace(/^@media( ?)/m,``);let{defaultMatches:r=!1,matchMedia:i=n?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:o=!1}=t,s=q.useCallback(()=>r,[r]),c=q.useMemo(()=>{if(o&&i)return()=>i(e).matches;if(a!==null){let{matches:t}=a(e);return()=>t}return s},[s,e,a,o,i]),[l,u]=q.useMemo(()=>{if(i===null)return[s,()=>()=>{}];let t=i(e);return[()=>t.matches,e=>C(t,`change`,e)]},[s,i,e]),d=(0,jt.useSyncExternalStore)(u,l,c);return q.useDebugValue({query:e,match:d}),d}var Nt={size:{sm:{classes:`sm:max-w-md`,description:`Compact desktop dialog width (448px)`},base:{classes:`sm:max-w-xl`,description:`Default desktop dialog width (576px)`},lg:{classes:`sm:max-w-2xl`,description:`Large desktop dialog width (672px)`},xl:{classes:`sm:max-w-3xl`,description:`Extra large desktop dialog width (768px)`}},verticalAlign:{top:{classes:`sm:items-start sm:pt-16 sm:pb-6`,description:`Align the desktop dialog near the top of the viewport`},center:{classes:`sm:items-center sm:py-6`,description:`Center the desktop dialog vertically`}}},Pt={size:`base`,verticalAlign:`center`},Ft=(0,q.createContext)(!1),It=(0,q.createContext)(!1),Lt=(0,q.createContext)(!1),Rt=(0,q.createContext)({title:null,description:null,actions:null,showCloseButton:!1,closeLabel:``}),zt=new Set([`close-press`,`close-watcher`,`escape-key`,`outside-press`,`swipe`,`trigger-press`]);function Bt({alert:e,children:t,dismissDisabled:n=!1,onOpenChange:r,disablePointerDismissal:i,modal:a,...o}){let s=Mt(`(min-width: 640px)`,{defaultMatches:!1}),c=(e,t)=>{!e&&n&&zt.has(t.reason)?t.cancel():r?.(e,t)},l={...o,disablePointerDismissal:e||n||i,modal:e?!0:a,onOpenChange:c};return(0,J.jsx)(Lt.Provider,{value:e,children:(0,J.jsx)(Ft.Provider,{value:s,children:(0,J.jsx)(It.Provider,{value:n,children:(0,J.jsx)(Ge,{...l,children:t})})})})}function Vt(e){return(0,J.jsx)(Bt,{...e,alert:!1})}Vt.displayName=`LayerDialog.Root`;function Ht(e){return(0,J.jsx)(Bt,{...e,alert:!0})}Ht.displayName=`LayerDialog.Alert`;function Ut(e){return(0,J.jsx)(Ye,{...e})}Ut.displayName=`LayerDialog.Trigger`;function Wt(e,t){let n=e.filter(e=>(0,q.isValidElement)(e)&&e.type===t);return{element:n[0],count:n.length}}function Gt({children:e,closeLabel:n,container:r,size:i=Pt.size,verticalAlign:a=Pt.verticalAlign}){let{layerDialog:o}=j(),s=v(),c=r??s??void 0,l=(0,q.useContext)(Ft),u=(0,q.useContext)(It),d=(0,q.useContext)(Lt),p=q.Children.toArray(e),m=Wt(p,Kt),h=Wt(p,qt),g=Wt(p,Xt),_=Wt(p,$t);if(p.some(e=>!(0,q.isValidElement)(e)||e.type!==Kt&&e.type!==qt&&e.type!==Xt&&e.type!==$t)||m.count!==1||g.count!==1||h.count>1||_.count>1||d&&_.count!==1)throw Error(d?`LayerDialog.Alert requires exactly one direct LayerDialog.Title, LayerDialog.Body, and LayerDialog.Actions, with an optional direct LayerDialog.Description.`:`LayerDialog.Content requires exactly one direct LayerDialog.Title and LayerDialog.Body, with an optional direct LayerDialog.Description and LayerDialog.Actions.`);let y=f(Nt.size,i,Pt.size),b=f(Nt.verticalAlign,a,Pt.verticalAlign),x={title:m.element,description:h.element??null,actions:_.element??null,showCloseButton:_.count===0,closeLabel:n??o.close};return(0,J.jsxs)(He,{container:c,children:[(0,J.jsx)(X,{forceRender:!0,"data-layer-dialog-backdrop":!0,className:`fixed inset-0 bg-kumo-recessed opacity-80 transition-opacity duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)] data-[ending-style]:opacity-0 data-[ending-style]:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-[starting-style]:opacity-0 data-[swiping]:duration-0 motion-reduce:transition-none sm:duration-200 sm:data-[ending-style]:duration-200`}),(0,J.jsx)(ft,{className:t(`fixed inset-0 flex items-end justify-center sm:px-4`,b.classes),"data-base-ui-swipe-ignore":l||u||d?``:void 0,children:(0,J.jsx)(Ve,{render:d?(0,J.jsx)(`div`,{role:`alertdialog`}):(0,J.jsx)(`div`,{}),className:t(`fixed inset-x-0 bottom-0 flex max-h-[85dvh] min-h-0 w-full max-w-none [transform:translate3d(0,var(--drawer-swipe-movement-y,0px),0)] transform-gpu overflow-visible transition-[transform,opacity] duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)] will-change-transform outline-none data-[ending-style]:[transform:translate3d(0,100%,0)] data-[ending-style]:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-[starting-style]:[transform:translate3d(0,100%,0)] data-[swiping]:duration-0 data-[swiping]:select-none motion-reduce:transition-none sm:static sm:max-h-full sm:[transform:translate3d(0,0,0)] sm:duration-200 sm:data-[ending-style]:[transform:translate3d(0,8px,0)] sm:data-[ending-style]:opacity-0 sm:data-[ending-style]:duration-200 sm:data-[starting-style]:[transform:translate3d(0,8px,0)] sm:data-[starting-style]:opacity-0`,y.classes),children:(0,J.jsxs)(R,{className:`flex max-h-[85dvh] min-h-0 w-full flex-col overflow-hidden rounded-none bg-kumo-elevated p-1.5 shadow-[0_20px_25px_-5px_rgb(0_0_0/0.03),0_8px_10px_-6px_rgb(0_0_0/0.03)] max-sm:border-t max-sm:border-kumo-hairline max-sm:shadow-xs max-sm:ring-0 sm:max-h-full sm:rounded-xl`,children:[!l&&!d&&(0,J.jsx)(`div`,{"aria-hidden":!0,className:`flex justify-center pt-1.5 pb-3`,children:(0,J.jsx)(`div`,{className:`h-1 w-10 rounded-full bg-kumo-fill`})}),(0,J.jsxs)(Se,{className:`flex min-h-0 flex-col overflow-visible`,children:[(0,J.jsx)(Rt.Provider,{value:x,children:g.element}),l&&_.element]})]})})})]})}Gt.displayName=`LayerDialog.Content`;function Kt({children:e}){return(0,J.jsx)(Je,{render:t=>(0,J.jsx)(A,{...t,as:`h2`,variant:`heading`,DANGEROUS_className:`font-medium`,children:e})})}Kt.displayName=`LayerDialog.Title`;function qt({children:e}){return(0,J.jsx)(Ce,{render:t=>(0,J.jsx)(A,{...t,as:`p`,variant:`secondary`,children:e})})}qt.displayName=`LayerDialog.Description`;var Jt=8,Yt=16;function Xt({children:e}){let[n,r]=(0,q.useState)(!1),i=(0,q.useRef)(null),a=(0,q.useContext)(It),{title:o,description:s,actions:c,showCloseButton:l,closeLabel:u}=(0,q.useContext)(Rt),d=(0,q.useContext)(Ft),f=e=>{let{scrollTop:t,scrollHeight:a,clientHeight:o}=e.currentTarget;if(!(t>Jt)){r(!1);return}if(n)return;let s=i.current?.offsetHeight??0;a-o-s>Yt&&r(!0)},p=s?e:(0,J.jsx)(Ce,{render:(0,J.jsx)(`div`,{}),children:e});return(0,J.jsxs)(R.Primary,{className:`min-h-0 flex-1 gap-0 p-0`,children:[(0,J.jsxs)(`div`,{className:`z-10 flex shrink-0 items-start justify-between gap-4 rounded-t-lg bg-kumo-base px-4 py-4 sm:px-4.5`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[o,s&&(0,J.jsx)(`div`,{className:t(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none`,n?`grid-rows-[0fr] opacity-0`:`grid-rows-[1fr] opacity-100`),"data-condensed":n||void 0,children:(0,J.jsx)(`div`,{ref:i,className:`min-h-0 overflow-hidden`,children:(0,J.jsx)(`div`,{className:`pt-1`,children:s})})})]}),l&&(0,J.jsx)(Zt,{disabled:a,label:u})]}),(0,J.jsxs)(ue,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,J.jsx)(le,{className:`min-h-0 flex-1 overscroll-none [mask-image:linear-gradient(to_bottom,transparent_0,black_min(24px,var(--scroll-area-overflow-y-start,24px)),black_calc(100%-min(24px,var(--scroll-area-overflow-y-end,24px))),transparent_100%)]`,onScroll:f,children:d?(0,J.jsx)(K,{className:`px-4.5 pb-4.5`,children:p}):(0,J.jsx)(K,{className:`px-4 pb-4`,children:p})}),(0,J.jsx)(G,{keepMounted:!0,orientation:`vertical`,className:`my-1.5 me-0.5 hidden w-2 p-px opacity-0 transition-opacity data-[has-overflow-y]:block data-[hovering]:opacity-100 data-[scrolling]:opacity-100`,children:(0,J.jsx)(ce,{className:`w-full rounded-full bg-kumo-contrast opacity-10 transition-opacity hover:opacity-20 active:opacity-30`})})]}),!d&&c&&(0,J.jsx)(`div`,{className:`shrink-0 border-t border-kumo-hairline p-4`,children:c})]})}Xt.displayName=`LayerDialog.Body`;function Zt({disabled:e,label:t}){return(0,J.jsx)(Z,{render:n=>(0,J.jsx)(k,{...n,"aria-label":t,className:`-mt-1.5 -me-1.5 rounded-lg`,disabled:e,icon:(0,J.jsx)(de,{size:15}),shape:`square`,size:`sm`,variant:`ghost`})})}function Qt({children:e,loading:t,variant:n=`primary`,...r}){return(0,J.jsx)(k,{...r,loading:t,variant:n,children:e})}Qt.displayName=`LayerDialog.Actions.Primary`;var $t=Object.assign(function({children:e,dismissLabel:n}){let r=(0,q.useContext)(It),i=(0,q.useContext)(Lt),a=(0,q.useContext)(Ft),{layerDialog:o}=j(),s=n??(i?o.cancel:o.close);if(!(0,q.isValidElement)(e)||e.type!==Qt)throw Error(`LayerDialog.Actions requires exactly one direct LayerDialog.Actions.Primary.`);return(0,J.jsxs)(`div`,{className:t(`flex w-full items-center justify-between gap-2`,a&&`shrink-0 pt-1.75`),children:[(0,J.jsx)(en,{disabled:r,label:s}),e]})},{Primary:Qt,displayName:`LayerDialog.Actions`});function en({disabled:e,label:t}){let n=(0,q.useContext)(Ft);return(0,J.jsx)(Z,{render:r=>(0,J.jsx)(k,{...r,className:`hover:bg-kumo-fill/50`,disabled:e,variant:n?`ghost`:`secondary`,children:t})})}var tn=Object.assign(Vt,{Root:Vt,Alert:Ht,Trigger:Ut,Content:Gt,Title:Kt,Description:qt,Body:Xt,Actions:$t});export{tn as t};
|
|
2
|
+
//# sourceMappingURL=layer-dialog-j5ywmzs46ccg6oqy-a5UYrx-X.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./vendor-styling-da1xibnxfkjmtglr-f72JA6U4.js";import{i as n,r}from"./react-iRJfyluG.js";import{t as i}from"./button-pa1bq9b85hawg41a-CTLAwRb5.js";import{a,o,r as s,s as c}from"./input-c8lv9ulv0kortliq-eB01WT1D.js";import{lt as l}from"./index-
|
|
2
|
-
//# sourceMappingURL=tag-input-ohfybx5dbxy3houy-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./vendor-styling-da1xibnxfkjmtglr-f72JA6U4.js";import{i as n,r}from"./react-iRJfyluG.js";import{t as i}from"./button-pa1bq9b85hawg41a-CTLAwRb5.js";import{a,o,r as s,s as c}from"./input-c8lv9ulv0kortliq-eB01WT1D.js";import{lt as l}from"./index-CRaauoqY.js";var u=e(n(),1),d=r(),f={input:`Add tag`,removeValue:e=>`Remove ${e}`,invalidValue:e=>`"${e}" is not valid.`,maxValuesReached:e=>`Limit of ${e} tags reached.`};function p(e){return e.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean)}var m=(0,u.forwardRef)(({value:e,defaultValue:n=[],onValueChange:r,validateValue:m,maxValues:h,labels:g,label:_,labelTooltip:v,description:y,error:b,variant:x,disabled:S,className:C,placeholder:w,id:T,autoComplete:E=`off`,onBlur:D,onChange:O,onKeyDown:k,onPaste:A,...j},M)=>{let[N,P]=(0,u.useState)(n),[F,I]=(0,u.useState)(``),[L,R]=(0,u.useState)(),z=(0,u.useId)(),B=e??N,V=t=>{e===void 0&&P(t),r?.(t)},H=e=>{let t=p(e),n=[...B];for(let e=0;e<t.length;e+=1){let r=t[e];if(!n.includes(r)){if(h!==void 0&&n.length>=h)return I(t.slice(e).join(`, `)),R((g?.maxValuesReached??f.maxValuesReached)(h)),V(n),!1;if(m&&!m(r,n))return I(t.slice(e).join(`, `)),R((g?.invalidValue??f.invalidValue)(r)),V(n),!1;n.push(r)}}return V(n),I(``),R(void 0),!0},U=e=>{if(k?.(e),e.defaultPrevented)return;if(!F&&e.key===`Backspace`){V(B.slice(0,-1));return}if(!F||![`Enter`,`,`,`Tab`].includes(e.key))return;let t=H(F);(e.key!==`Tab`||t)&&e.preventDefault()},W=e=>{if(A?.(e),e.defaultPrevented)return;let t=e.clipboardData.getData(`text`);/[\n,]/.test(t)&&(e.preventDefault(),H(t))},G=c(b)??c(L),K=x??(G?`error`:`default`),q=t(`flex w-fit max-w-full shrink-0 items-center gap-2.5 rounded-sm bg-kumo-overlay ring-1 ring-kumo-hairline`,`h-6 py-0 pe-[3px] ps-2 text-sm`),J=e=>(0,d.jsx)(`input`,{...e,...j,ref:M,"aria-invalid":!!G,"aria-label":j[`aria-label`]??(typeof _==`string`?_:g?.input??f.input),className:t(`min-w-32 flex-1 border-0 bg-transparent outline-none`,`px-1 py-0.5`),disabled:S,autoComplete:E,id:e?.id??T??z,placeholder:w,value:F,onBlur:e=>{D?.(e),e.defaultPrevented||H(F)},onChange:e=>{I(e.target.value),R(void 0),O?.(e)},onKeyDown:U,onPaste:W}),Y=!!(_||y||G),X=(0,d.jsxs)(`div`,{className:t(s({variant:K,parentFocusIndicator:!0}),`flex h-auto min-h-9 flex-wrap items-center gap-x-2 gap-y-1.5 px-2 py-1.5`,C),children:[B.map(e=>(0,d.jsxs)(`span`,{className:t(q,`text-kumo-default`),children:[(0,d.jsx)(`span`,{className:`truncate`,children:e}),(0,d.jsx)(i,{"aria-label":(g?.removeValue??f.removeValue)(e),icon:(0,d.jsx)(l,{size:10}),shape:`square`,size:`xs`,variant:`ghost`,disabled:S,onMouseDown:e=>e.preventDefault(),onClick:()=>V(B.filter(t=>t!==e))})]},e)),Y?(0,d.jsx)(a,{render:e=>J(e)}):J()]});return Y?(0,d.jsx)(o,{label:_??``,labelTooltip:v,description:y,error:G,children:X}):X});m.displayName=`TagInput`;export{m as t};
|
|
2
|
+
//# sourceMappingURL=tag-input-ohfybx5dbxy3houy-Bfh3Yb-x.js.map
|
package/dist/assets/studio/assets/{useCollectionView-DX7hhan1.js → useCollectionView-Cj_hlmHt.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EndedBadge-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./react-iRJfyluG.js";import{S as r,_ as i,d as a,h as o,l as s}from"./tanstack-8GMTaj0M.js";import{t as c}from"./collection-icons-
|
|
3
|
-
//# sourceMappingURL=useCollectionView-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EndedBadge-CuESOF9v.js","assets/rolldown-runtime-XKyaHtl9.js","assets/vendor-styling-da1xibnxfkjmtglr-f72JA6U4.js","assets/react-iRJfyluG.js","assets/badge-dq8bx752b9dp7dst-BSe3ItaV.js","assets/useBaseUiId-lg1teubxudgin0w2-DE9psqVX.js","assets/tanstack-8GMTaj0M.js","assets/tooltip-o4natsv01lpq8oq2-BXAIiJ4Y.js","assets/CalendarX.es-Dog7ncNo.js","assets/IconBase.es-BXBadb8L.js","assets/intl-C22KAx_l.js","assets/schedules-CEWibmQf.js","assets/entry-href-BvhAhTJo.js","assets/collections-CjXIa-in.js","assets/props-mn0mAlcP.js","assets/fields-3PygkO_o.js","assets/blocks-CGhmSv2M.js","assets/body-blocks-DCP3w1pD.js","assets/marked.esm-CO-4B_gx.js","assets/surfaces-JLobTTzl.js","assets/filter-B_r-t96-.js","assets/i18n-BsaF_Usk.js","assets/format-BOWG2Mwk.js","assets/preload-helper-BLdHbfdN.js","assets/api-CHfbfW94.js","assets/index-CRaauoqY.js","assets/button-pa1bq9b85hawg41a-CTLAwRb5.js","assets/loader-j2v6fab8iucuxz1z-Cc_2xU85.js","assets/inertValue-e0o6qvuef83v78fk-D0BI_tKj.js","assets/ArrowClockwise.es-CBDiTqBo.js","assets/ArrowCounterClockwise.es-DTfZr_jW.js","assets/DirectionalIcon-BitUORGN.js","assets/Article.es-B1mhw0Yg.js","assets/CaretRight.es-BMaNDJ5e.js","assets/resolveAriaLabelledBy-nc8mdie5shy87nsb-BodbanlU.js","assets/skeleton-line-m9dyh126t9k07jvg-C0LAvXNf.js","assets/useButton-h7s9aq1sfw6arawe-CDg3MSn7.js","assets/Files.es-BwAHmY88.js","assets/checkbox-lbo436duy7krxcsk-U7-T3UJ5.js","assets/useAriaLabelledBy-ox8dum59shmgypq1-q9R7Klb2.js","assets/areArraysEqual-bcx201k1x9ziizym-DpJhDMgE.js","assets/RocketLaunch.es-BbmkW8GS.js","assets/banner-msnmqm7of2lck01x-BG4Z0Wo2.js","assets/link-cqyfjezntvr53rh7-hX7iswfD.js","assets/useRender-onwjigxa00uch2ip-BMxnvLE_.js","assets/clamp-jcjhzx71s6wt1rnc-D0kAXd-u.js","assets/Toast-B-YQLwgT.js","assets/createToastManager-onmoqrmr8zo02rif-BKvFbhid.js","assets/getElementTransform-cuiqmjglkrz4db6c-1fD5DQn4.js","assets/useSwipeDismiss-m1s13x9t9ey9ax3p-D7CLht-d.js","assets/scrollable-b6m9ze1u7ps0q1qn-CsARZWmE.js","assets/useClick-l0p0endoxrlp0ae5-dDySeZPV.js","assets/composite-ab8dmdfoj6tmhcn1-BnZxF-Cq.js","assets/ToolbarRootContext-eqk40r8uh4h6r211-BkyB9D6c.js","assets/layer-card-idh3863vdgprgqai-ByBfeMqc.js","assets/dropdown-m53ji1d66mws89wh-Dz3jCHEA.js","assets/useListNavigation-3nyjs362qcau34in-BDg8RPai.js","assets/isElementDisabled-o0j7po84u0xjuwgg-KSuuBj8D.js","assets/CompositeItem-hzuk5x3e5zsfgnyj-DaKnXsNK.js","assets/useCompositeItem-p7090ga00dpqcg5j-DtFwg5rU.js","assets/useTriggerFocusGuards-lz7wt484xltizro4-5lIVnRXF.js","assets/select-futox5zqr3r80y9a-4PRIJl2s.js","assets/input-c8lv9ulv0kortliq-eB01WT1D.js","assets/resolveValueLabel-hpmsash3ektitvnb-CCmVsV0t.js","assets/serializeValue-ipcakiw32jb7kany-B_EucO5O.js","assets/styles-kl02oyrlnld7arja-BOYSmemT.js","assets/CSPContext-ctyrgg64girv38ls-CFLKuzrY.js","assets/tabs-gf57qqf1wcclaejq-DZt0FNBy.js","assets/constants-flxfd6q03phtu007-DkiaRZ18.js","assets/CompositeRoot-g72lchaerolf5dc9-BMCp-sQO.js","assets/empty-hkvg3is3uc6dj1at-i0Hdi_nk.js","assets/Copy.es-DUeQTRuS.js","assets/analytics-range-BqKm9TTo.js","assets/ApprovalDialog-CSB0ewQo.js","assets/dialog-glpnivujociqs9lh-RRpeKfY_.js","assets/useRenderDialogRoot-lddunc01twftravv-YHj8p0Db.js","assets/DialogRoot-hl3genvzl9h8ridm-BGNgsVHc.js","assets/DialogTrigger-g44cuem7n4wez533-EhxANqX5.js","assets/names-R-Dypr9Y.js","assets/api-errors-tZYwLeo6.js","assets/auth-BsoY4NJQ.js","assets/roles-UXx4Dl3q.js","assets/elevation-DYfiRNLi.js","assets/useMe-CxI04z9a.js","assets/useLiveSite-BCjxnCp4.js","assets/site-settings-Cmq0DkaT.js","assets/taxonomy-keys-CBK_h9-x.js","assets/usePendingApprovals-DegVt90y.js","assets/approvals-NA7tFTjw.js","assets/index-3jBmW4l9.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./react-iRJfyluG.js";import{S as r,_ as i,d as a,h as o,l as s}from"./tanstack-8GMTaj0M.js";import{t as c}from"./collection-icons-D-IZFMkB.js";import{t as l}from"./preload-helper-BLdHbfdN.js";import{t as u}from"./Status-W9nLsw86.js";import{c as d,d as f}from"./i18n-BsaF_Usk.js";import{t as p}from"./api-CHfbfW94.js";import"./collections-CjXIa-in.js";import{n as m}from"./entry-href-BvhAhTJo.js";import{c as h,o as g}from"./index-CRaauoqY.js";var _=e(t(),1),v=n(),y=(0,_.lazy)(()=>f(l(()=>import(`./EndedBadge-CuESOF9v.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89])),[`listings`]).then(e=>({default:e.EndedBadge})));function b({siteId:e,entry:t,saved:n=t}){let r=i({queryKey:[`site`,e],queryFn:()=>p.sites.get(e),enabled:e!==``}).data;return(0,v.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-1.5`,children:[(0,v.jsx)(u,{status:t.status}),r?.collections?.[n.collection]?.expiry&&(0,v.jsx)(_.Suspense,{fallback:null,children:(0,v.jsx)(y,{siteId:e,site:r,entry:n})})]})}function x(){return a({strict:!1}).collection??`posts`}function S(e,t){return e!==void 0&&(!e.collections||e.collections.includes(t))}function C(e,t){let{category:n,tag:r}=e.defaults;return{...e,defaults:{...e.defaults,category:S(n,t)?n:void 0,tag:S(r,t)?r:void 0}}}function w(e,t){let{t:n,locale:r}=d(),a=i({queryKey:[`site`,e],queryFn:()=>p.sites.get(e)}),o=h(a.data,t,r),s=t===`posts`&&!o,l=a.data?.collections?.[t]?.labels?.[r]?.description;return{title:s?n(`pageHeaders.articles.title`):o?.plural??t,description:s?n(`pageHeaders.articles.description`):l??n(`collectionList.description`,{key:t}),newLabel:n(s?`articles.newArticle`:`collectionList.newEntry`),search:n(s?`articles.search`:`collectionList.search`),empty:n(s?`articles.empty`:`collectionList.empty`),Icon:g({key:t,settings:a.data?.collections?.[t]??{}},c)}}function T(e,t,n){let{t:i}=d(),a=r(),c=s();return o({mutationFn:()=>p.entries.create(e,{collection:t,slug:`untitled-${Date.now().toString(36)}`,locale:n,status:`draft`,title:i(`articles.untitled`),body:{format:`markdown`,value:``},fields:{},tags:[]}),onSuccess:async t=>{await a.invalidateQueries({queryKey:[`entries`,e]}),await c(m(e,t.id,t.collection))}})}function E(e,t,n,r){let i=s();(0,_.useEffect)(()=>{r&&r!==n&&i({...m(e,t,r),replace:!0})},[i,e,t,n,r])}function D(e,t){let n=t??`posts`,{title:r}=w(e,n);return{label:r,href:`/sites/${e}/collections/${n}`}}export{E as a,x as i,D as n,T as o,w as r,b as s,C as t};
|
|
3
|
+
//# sourceMappingURL=useCollectionView-Cj_hlmHt.js.map
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
document.documentElement.style.colorScheme = mode;
|
|
22
22
|
})();
|
|
23
23
|
</script>
|
|
24
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-CRaauoqY.js"></script>
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/vendor-styling-da1xibnxfkjmtglr-f72JA6U4.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/react-iRJfyluG.js">
|
|
@@ -31,7 +31,7 @@ const devCommand = async (_rest, values, { projectDir }) => {
|
|
|
31
31
|
const server = await dev({
|
|
32
32
|
projectDir,
|
|
33
33
|
...(values.port ? { port: Number(values.port) } : {}),
|
|
34
|
-
...(values.host ? { host:
|
|
34
|
+
...(values.host ? { host: values.host } : {}),
|
|
35
35
|
});
|
|
36
36
|
if (server.url) console.log(`cloudhal dev → ${server.url}`);
|
|
37
37
|
await untilSignal();
|
|
@@ -69,6 +69,14 @@ const studioCommand = async (_rest, values, { projectDir }) => {
|
|
|
69
69
|
projectDir,
|
|
70
70
|
...(values.port ? { port: Number(values.port) } : {}),
|
|
71
71
|
...(values["no-auth"] ? { noAuth: true } : {}),
|
|
72
|
+
// Self-hosting (#143); the environment fills what the flags leave out (studio-options.ts).
|
|
73
|
+
...(values.host ? { host: values.host } : {}),
|
|
74
|
+
...(values["base-url"] ? { baseUrl: values["base-url"] } : {}),
|
|
75
|
+
...(values["behind-proxy"] ? { behindProxy: true } : {}),
|
|
76
|
+
...(values["init-if-empty"] ? { initIfEmpty: true } : {}),
|
|
77
|
+
...(values.starter ? { starter: values.starter } : {}),
|
|
78
|
+
...(values.name ? { name: values.name } : {}),
|
|
79
|
+
log: (l) => console.log(` ${l}`),
|
|
72
80
|
});
|
|
73
81
|
console.log(`cloudhal studio → ${s.url}`);
|
|
74
82
|
await untilSignal();
|
package/dist/src/cli/help.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** `cloudhal --help`; every command it names has an entry in `COMMANDS` (cli.ts). */
|
|
2
|
-
export declare const HELP = "cloudhal \u2014 agent-native sites\n\nUsage:\n cloudhal init <dir> [--name <name>] [--starter blog] create a site project with a seeded local store\n cloudhal dev [--port <n>] [--host] live preview (drafts visible)\n cloudhal snapshot [--label <text>] [--publish] freeze the current graph (optionally publish)\n cloudhal build [--snapshot <id>] static HTML from the published/latest snapshot\n cloudhal studio [--port <n>] [--no-auth] API + Studio UI for this project (default :8787)\n cloudhal mcp [--mode plan|manual|edits|auto|bypass] [--scopes a,b] [--skills <dir>] [--preview-url <url>]\n MCP server over stdio for this project\n cloudhal deploy [--name <base>] [--dry-run] [--jurisdiction eu] [--scheduler cron|alarm] [--plan free|paid]\n [--force-downgrade] [--no-build-studio]\n site + admin Workers on Cloudflare (uses wrangler login);\n --jurisdiction eu keeps a newly created D1 database\n in the EU (cannot be changed later); --scheduler picks\n the minute cron trigger or the Durable Object alarm;\n --plan sizes scheduler ticks for the account's Workers\n plan (default free; remembered);\n --force-downgrade deploys older schedules code over\n open releases and time gates; from the monorepo a\n stale apps/studio/dist is rebuilt first\n (--no-build-studio: fail instead)\n cloudhal domain [set <hostname>] [--studio <hostname>] [--redirect <hostname>]\u2026 | remove [site|studio|redirects|all]\n custom domains for the next deploy\n cloudhal push [--replace] [--cancel-schedules] [--admin-url <url>]\n local site \u2192 deployment (refused while releases are\n open unless --cancel-schedules cancels them)\n cloudhal pull [--replace] [--admin-url <url>] deployment \u2192 local site\n cloudhal export [--out <file>] [--site <id>] [--no-media] [--latest-only]\n one site as a .cloudhal file (RFC-0039): its graph,\n snapshots and media; never user accounts, comments,\n analytics or secrets (its history names who made each\n change). Default <site-slug>-<YYYYMMDD>.cloudhal, dated\n by the newest row it holds (a deletion alone does not\n move it); a file there is replaced only by the same\n archive, --out <file> replaces any;\n --site: a site listed in cloudhal.json sites;\n --no-media: the graph only; --latest-only: only the\n published and the latest snapshot\n cloudhal import <file> [--replace] [--dry-run] | --revert <snapshot-id> [--dry-run]\n a .cloudhal file into this project (RFC-0039), its site\n id kept; every file is verified before anything is\n written. By default the archive's site must be\n cloudhal.json's siteId or listed in sites, and absent\n here or holding exactly the archive's nodes (missing\n snapshots and media are added); --replace: the local\n nodes become the archive's, its published snapshot\n included, after a \"before import <file>\" snapshot of\n them; an archive of another site switches cloudhal.json\n siteId to it (the old site stays in the local store,\n unlisted; write its id back to undo); --revert <id>:\n back to such a snapshot, revs moved forward, saving the\n current graph first; --dry-run prints the manifest and\n the difference and writes nothing\n cloudhal owner transfer --to <email> [--admin-url <url>]\n make a member the deployment's Owner\n (lockout recovery; uses the deployment token)\n cloudhal site list | create --name <name> --slug <slug> [--locale <tag>] [--project <id>] [--theme <name>] [--from <siteId>]\n | delete <siteId> --confirm <slug> [--remote] [--admin-url <url>]\n the installation's sites (RFC-0034): one Studio,\n many isolated sites; nothing is published\n cloudhal migrate tags-to-terms [--dry-run] [--revert <id>]\n move entry tags into tag terms (RFC-0002);\n resumable; --revert <id> undoes a run\n cloudhal fields rename <c> <from> <to> | retype <c> <key> <type> [--options a,b] [--multiple] [--clear] | localize <c> <key> on|off | remove <c> <key> | continue|revert <c> <id> [--dry-run] [--remote]\n change a collection's typed fields with their values\n (RFC-0041): snapshotted, resumable; --dry-run reports\n and greps the theme; revert <id> undoes a run\n cloudhal media import-urls [--dry-run] [--include-markdown] [--allow-host <host>]\u2026 | --revert <id>\n copy linked images into the media library\n (RFC-0004); revertible\n cloudhal media verify [<assetId>] recompute media checksums\n cloudhal media gc [--dry-run] delete unreferenced media bytes (> 24 h old)\n cloudhal media placeholders [--remote] [--all] [--dry-run]\n draw missing image placeholders in local Chrome\n cloudhal analytics status [--remote] site analytics: settings, daily totals, budget\n cloudhal analytics rollup [--days <n>] [--remote] [--redo]\n compute daily totals (--remote backfills the\n deployment from WAE, up to 92 days)\n cloudhal analytics seed [--days <n>] [--views <n>] demo traffic in the local SQLite only\n cloudhal analytics export [--from <date> --to <date>] [--remote] [--out <file>]\n daily totals as CSV (default: 30 days)\n cloudhal comments status [--remote] reader comments: counts, pending, daily cap, purges\n cloudhal comments export [--remote] [--with-personal-data --out <file>]\n comments as JSON lines (stdout or --out)\n cloudhal comments import --in <file> [--remote] JSON lines back in; idempotent, safe to rerun\n cloudhal schedules status [--remote] the scheduler's health, open releases, gated pages\n cloudhal schedules list [--remote] [--limit <n>] the site's releases\n cloudhal schedules run-due [--remote] one scheduler tick now (self-hosting: run it from\n the system's cron every minute)\n cloudhal ai build-eval [--remote] [--models a,b] [--briefs landing,faq] [--out <file>]\n [--design] [--look] [--judge <model>|none]\n compare models on Build chat's turn, in memory\n (real model calls; RFC-0020 open question 7);\n --design renders each result: failed checks and\n a vision model's score (RFC-0021 21c); --look lets\n the model see its render first, as Build chat does\n cloudhal ai judge-check [--remote] [--judge <model>] score the reference pages (empty \u2192 strong) with the\n design judge; fails when it does not rank them\n cloudhal render <path|url> [--width 1440,390] [--scheme dark] [--motion static|reduce|full]\n [--frames <n>] [--base <url>] [--out <dir>]\n screenshots and render_page's checks for a page\n (of cloudhal dev by default; RFC-0024)\n cloudhal motion audit [--path <p>] the motion each page asks for, against its budgets\n cloudhal tokens export [--format dtcg] [--out <file>] the site's design tokens as a W3C Design Tokens file\n (Figma, Style Dictionary; RFC-0023)\n cloudhal chrome get [--file <f>] | set --file <f> the site's header, footer and brand as JSON\n (RFC-0025)\n cloudhal search reindex [--remote] rebuild the search index from the live snapshot\n (publishing keeps it current; for restored backups)\n cloudhal --help\n";
|
|
2
|
+
export declare const HELP = "cloudhal \u2014 agent-native sites\n\nUsage:\n cloudhal init <dir> [--name <name>] [--starter blog] create a site project with a seeded local store\n cloudhal dev [--port <n>] [--host [<addr>]] live preview (drafts visible)\n cloudhal snapshot [--label <text>] [--publish] freeze the current graph (optionally publish)\n cloudhal build [--snapshot <id>] static HTML from the published/latest snapshot\n cloudhal studio [--port <n>] [--host [<addr>]] [--base-url <url>] [--behind-proxy] [--no-auth]\n [--init-if-empty [--starter blog] [--name <name>]]\n API + Studio UI for this project (default :8787);\n self-hosting: --host 0.0.0.0 (CLOUDHAL_HOST) listens\n beyond this machine, --base-url (CLOUDHAL_BASE_URL)\n is the public origin behind a reverse proxy,\n --behind-proxy (CLOUDHAL_BEHIND_PROXY=1) trusts its\n X-Forwarded-Proto/Host, --init-if-empty\n (CLOUDHAL_INIT=<starter>) creates the project first\n when the folder has no cloudhal.json\n cloudhal mcp [--mode plan|manual|edits|auto|bypass] [--scopes a,b] [--skills <dir>] [--preview-url <url>]\n MCP server over stdio for this project\n cloudhal deploy [--name <base>] [--dry-run] [--jurisdiction eu] [--scheduler cron|alarm] [--plan free|paid]\n [--force-downgrade] [--no-build-studio]\n site + admin Workers on Cloudflare (uses wrangler login);\n --jurisdiction eu keeps a newly created D1 database\n in the EU (cannot be changed later); --scheduler picks\n the minute cron trigger or the Durable Object alarm;\n --plan sizes scheduler ticks for the account's Workers\n plan (default free; remembered);\n --force-downgrade deploys older schedules code over\n open releases and time gates; from the monorepo a\n stale apps/studio/dist is rebuilt first\n (--no-build-studio: fail instead)\n cloudhal domain [set <hostname>] [--studio <hostname>] [--redirect <hostname>]\u2026 | remove [site|studio|redirects|all]\n custom domains for the next deploy\n cloudhal push [--replace] [--cancel-schedules] [--admin-url <url>]\n local site \u2192 deployment (refused while releases are\n open unless --cancel-schedules cancels them)\n cloudhal pull [--replace] [--admin-url <url>] deployment \u2192 local site\n cloudhal export [--out <file>] [--site <id>] [--no-media] [--latest-only]\n one site as a .cloudhal file (RFC-0039): its graph,\n snapshots and media; never user accounts, comments,\n analytics or secrets (its history names who made each\n change). Default <site-slug>-<YYYYMMDD>.cloudhal, dated\n by the newest row it holds (a deletion alone does not\n move it); a file there is replaced only by the same\n archive, --out <file> replaces any;\n --site: a site listed in cloudhal.json sites;\n --no-media: the graph only; --latest-only: only the\n published and the latest snapshot\n cloudhal import <file> [--replace] [--dry-run] | --revert <snapshot-id> [--dry-run]\n a .cloudhal file into this project (RFC-0039), its site\n id kept; every file is verified before anything is\n written. By default the archive's site must be\n cloudhal.json's siteId or listed in sites, and absent\n here or holding exactly the archive's nodes (missing\n snapshots and media are added); --replace: the local\n nodes become the archive's, its published snapshot\n included, after a \"before import <file>\" snapshot of\n them; an archive of another site switches cloudhal.json\n siteId to it (the old site stays in the local store,\n unlisted; write its id back to undo); --revert <id>:\n back to such a snapshot, revs moved forward, saving the\n current graph first; --dry-run prints the manifest and\n the difference and writes nothing\n cloudhal owner transfer --to <email> [--admin-url <url>]\n make a member the deployment's Owner\n (lockout recovery; uses the deployment token)\n cloudhal site list | create --name <name> --slug <slug> [--locale <tag>] [--project <id>] [--theme <name>] [--from <siteId>]\n | delete <siteId> --confirm <slug> [--remote] [--admin-url <url>]\n the installation's sites (RFC-0034): one Studio,\n many isolated sites; nothing is published\n cloudhal migrate tags-to-terms [--dry-run] [--revert <id>]\n move entry tags into tag terms (RFC-0002);\n resumable; --revert <id> undoes a run\n cloudhal fields rename <c> <from> <to> | retype <c> <key> <type> [--options a,b] [--multiple] [--clear] | localize <c> <key> on|off | remove <c> <key> | continue|revert <c> <id> [--dry-run] [--remote]\n change a collection's typed fields with their values\n (RFC-0041): snapshotted, resumable; --dry-run reports\n and greps the theme; revert <id> undoes a run\n cloudhal media import-urls [--dry-run] [--include-markdown] [--allow-host <host>]\u2026 | --revert <id>\n copy linked images into the media library\n (RFC-0004); revertible\n cloudhal media verify [<assetId>] recompute media checksums\n cloudhal media gc [--dry-run] delete unreferenced media bytes (> 24 h old)\n cloudhal media placeholders [--remote] [--all] [--dry-run]\n draw missing image placeholders in local Chrome\n cloudhal analytics status [--remote] site analytics: settings, daily totals, budget\n cloudhal analytics rollup [--days <n>] [--remote] [--redo]\n compute daily totals (--remote backfills the\n deployment from WAE, up to 92 days)\n cloudhal analytics seed [--days <n>] [--views <n>] demo traffic in the local SQLite only\n cloudhal analytics export [--from <date> --to <date>] [--remote] [--out <file>]\n daily totals as CSV (default: 30 days)\n cloudhal comments status [--remote] reader comments: counts, pending, daily cap, purges\n cloudhal comments export [--remote] [--with-personal-data --out <file>]\n comments as JSON lines (stdout or --out)\n cloudhal comments import --in <file> [--remote] JSON lines back in; idempotent, safe to rerun\n cloudhal schedules status [--remote] the scheduler's health, open releases, gated pages\n cloudhal schedules list [--remote] [--limit <n>] the site's releases\n cloudhal schedules run-due [--remote] one scheduler tick now (self-hosting: run it from\n the system's cron every minute)\n cloudhal ai build-eval [--remote] [--models a,b] [--briefs landing,faq] [--out <file>]\n [--design] [--look] [--judge <model>|none]\n compare models on Build chat's turn, in memory\n (real model calls; RFC-0020 open question 7);\n --design renders each result: failed checks and\n a vision model's score (RFC-0021 21c); --look lets\n the model see its render first, as Build chat does\n cloudhal ai judge-check [--remote] [--judge <model>] score the reference pages (empty \u2192 strong) with the\n design judge; fails when it does not rank them\n cloudhal render <path|url> [--width 1440,390] [--scheme dark] [--motion static|reduce|full]\n [--frames <n>] [--base <url>] [--out <dir>]\n screenshots and render_page's checks for a page\n (of cloudhal dev by default; RFC-0024)\n cloudhal motion audit [--path <p>] the motion each page asks for, against its budgets\n cloudhal tokens export [--format dtcg] [--out <file>] the site's design tokens as a W3C Design Tokens file\n (Figma, Style Dictionary; RFC-0023)\n cloudhal chrome get [--file <f>] | set --file <f> the site's header, footer and brand as JSON\n (RFC-0025)\n cloudhal search reindex [--remote] rebuild the search index from the live snapshot\n (publishing keeps it current; for restored backups)\n cloudhal --help\n";
|
package/dist/src/cli/help.js
CHANGED
|
@@ -3,10 +3,19 @@ export const HELP = `cloudhal — agent-native sites
|
|
|
3
3
|
|
|
4
4
|
Usage:
|
|
5
5
|
cloudhal init <dir> [--name <name>] [--starter blog] create a site project with a seeded local store
|
|
6
|
-
cloudhal dev [--port <n>] [--host]
|
|
6
|
+
cloudhal dev [--port <n>] [--host [<addr>]] live preview (drafts visible)
|
|
7
7
|
cloudhal snapshot [--label <text>] [--publish] freeze the current graph (optionally publish)
|
|
8
8
|
cloudhal build [--snapshot <id>] static HTML from the published/latest snapshot
|
|
9
|
-
cloudhal studio [--port <n>] [--
|
|
9
|
+
cloudhal studio [--port <n>] [--host [<addr>]] [--base-url <url>] [--behind-proxy] [--no-auth]
|
|
10
|
+
[--init-if-empty [--starter blog] [--name <name>]]
|
|
11
|
+
API + Studio UI for this project (default :8787);
|
|
12
|
+
self-hosting: --host 0.0.0.0 (CLOUDHAL_HOST) listens
|
|
13
|
+
beyond this machine, --base-url (CLOUDHAL_BASE_URL)
|
|
14
|
+
is the public origin behind a reverse proxy,
|
|
15
|
+
--behind-proxy (CLOUDHAL_BEHIND_PROXY=1) trusts its
|
|
16
|
+
X-Forwarded-Proto/Host, --init-if-empty
|
|
17
|
+
(CLOUDHAL_INIT=<starter>) creates the project first
|
|
18
|
+
when the folder has no cloudhal.json
|
|
10
19
|
cloudhal mcp [--mode plan|manual|edits|auto|bypass] [--scopes a,b] [--skills <dir>] [--preview-url <url>]
|
|
11
20
|
MCP server over stdio for this project
|
|
12
21
|
cloudhal deploy [--name <base>] [--dry-run] [--jurisdiction eu] [--scheduler cron|alarm] [--plan free|paid]
|
package/dist/src/cli.d.ts
CHANGED
|
@@ -15,6 +15,15 @@ export declare const OPTIONS: {
|
|
|
15
15
|
readonly type: "string";
|
|
16
16
|
};
|
|
17
17
|
readonly host: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
};
|
|
20
|
+
readonly "base-url": {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
};
|
|
23
|
+
readonly "behind-proxy": {
|
|
24
|
+
readonly type: "boolean";
|
|
25
|
+
};
|
|
26
|
+
readonly "init-if-empty": {
|
|
18
27
|
readonly type: "boolean";
|
|
19
28
|
};
|
|
20
29
|
readonly label: {
|
|
@@ -191,6 +200,7 @@ export declare const OPTIONS: {
|
|
|
191
200
|
readonly type: "boolean";
|
|
192
201
|
};
|
|
193
202
|
};
|
|
203
|
+
export declare function fillOptionalValues(argv: string[]): string[];
|
|
194
204
|
/** `cloudhal <command>` → its handler. */
|
|
195
205
|
export declare const COMMANDS: Record<string, CliCommand>;
|
|
196
206
|
export declare function main(argv: string[]): Promise<number>;
|
package/dist/src/cli.js
CHANGED
|
@@ -13,7 +13,10 @@ export const OPTIONS = {
|
|
|
13
13
|
name: { type: "string" },
|
|
14
14
|
starter: { type: "string" },
|
|
15
15
|
port: { type: "string" },
|
|
16
|
-
host: { type: "
|
|
16
|
+
host: { type: "string" },
|
|
17
|
+
"base-url": { type: "string" },
|
|
18
|
+
"behind-proxy": { type: "boolean" },
|
|
19
|
+
"init-if-empty": { type: "boolean" },
|
|
17
20
|
label: { type: "string" },
|
|
18
21
|
publish: { type: "boolean" },
|
|
19
22
|
snapshot: { type: "string" },
|
|
@@ -84,8 +87,36 @@ const ONLY_FOR
|
|
|
84
87
|
"no-media": { commands: ["export"] },
|
|
85
88
|
"latest-only": { commands: ["export"] },
|
|
86
89
|
"cancel-schedules": { commands: ["push"] },
|
|
90
|
+
"base-url": { commands: ["studio"] },
|
|
91
|
+
"behind-proxy": { commands: ["studio"] },
|
|
92
|
+
"init-if-empty": { commands: ["studio"] },
|
|
87
93
|
};
|
|
88
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Flags whose value may be left out (`cloudhal dev --host`, as before `--host` took an address):
|
|
97
|
+
* the value they then stand for. `parseArgs` has no optional values, so a bare flag — at the end,
|
|
98
|
+
* or followed by another flag — gets it filled in first.
|
|
99
|
+
*/
|
|
100
|
+
const OPTIONAL_VALUE = { host: "0.0.0.0" };
|
|
101
|
+
|
|
102
|
+
export function fillOptionalValues(argv ) {
|
|
103
|
+
const out = [];
|
|
104
|
+
for (let i = 0; i < argv.length; i++) {
|
|
105
|
+
const arg = argv[i] ;
|
|
106
|
+
out.push(arg);
|
|
107
|
+
if (arg === "--") {
|
|
108
|
+
out.push(...argv.slice(i + 1));
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
const flag = arg.startsWith("--") ? arg.slice(2) : undefined;
|
|
112
|
+
const fill = flag && Object.hasOwn(OPTIONAL_VALUE, flag) ? OPTIONAL_VALUE[flag] : undefined;
|
|
113
|
+
if (fill === undefined) continue;
|
|
114
|
+
const next = argv[i + 1];
|
|
115
|
+
if (next === undefined || next.startsWith("-")) out.push(fill);
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
|
|
89
120
|
function refuseForeignFlags(command , values ) {
|
|
90
121
|
for (const [flag, only] of Object.entries(ONLY_FOR))
|
|
91
122
|
if (values[flag] !== undefined && !only.commands.includes(command))
|
|
@@ -105,7 +136,7 @@ export const COMMANDS = {
|
|
|
105
136
|
|
|
106
137
|
export async function main(argv ) {
|
|
107
138
|
const { values, positionals } = parseArgs({
|
|
108
|
-
args: argv,
|
|
139
|
+
args: fillOptionalValues(argv),
|
|
109
140
|
allowPositionals: true,
|
|
110
141
|
options: OPTIONS,
|
|
111
142
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export interface DevOptions {
|
|
2
2
|
readonly projectDir: string;
|
|
3
3
|
readonly port?: number;
|
|
4
|
-
|
|
4
|
+
/** `true` (every interface) or an address to listen on; default: this machine only. */
|
|
5
|
+
readonly host?: boolean | string;
|
|
5
6
|
/** `false` skips the scheduler's Node ticker (RFC-0008 §8.4). */
|
|
6
7
|
readonly scheduler?: boolean;
|
|
7
8
|
}
|
|
@@ -7,7 +7,8 @@ import { resolveBuildSnapshot } from "./snapshot.js";
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
@@ -27,7 +28,7 @@ export async function dev(
|
|
|
27
28
|
logLevel: "info",
|
|
28
29
|
server: {
|
|
29
30
|
...(options.port !== undefined ? { port: options.port } : {}),
|
|
30
|
-
...(options.host ? { host:
|
|
31
|
+
...(options.host ? { host: options.host } : {}),
|
|
31
32
|
},
|
|
32
33
|
});
|
|
33
34
|
const addr = server.address;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
type Env = Readonly<Record<string, string | undefined>>;
|
|
2
|
+
/** The flags `cloudhal studio` takes for where and how it is served. */
|
|
3
|
+
export interface StudioServerFlags {
|
|
4
|
+
readonly port?: number;
|
|
5
|
+
/** `--host`: the address to listen on (default `127.0.0.1`; `0.0.0.0` for every interface). */
|
|
6
|
+
readonly host?: string;
|
|
7
|
+
/** `--base-url`: the public origin (scheme, host, port), e.g. `https://studio.example.com`. */
|
|
8
|
+
readonly baseUrl?: string;
|
|
9
|
+
/** `--behind-proxy`: trust `X-Forwarded-Proto` / `X-Forwarded-Host`. */
|
|
10
|
+
readonly behindProxy?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** What `studio()` serves with: flags, then the environment, then the defaults. */
|
|
13
|
+
export interface StudioServer {
|
|
14
|
+
readonly port: number;
|
|
15
|
+
readonly hostname: string | undefined;
|
|
16
|
+
/** The public origin, without a trailing slash; undefined means `http://localhost:<port>`. */
|
|
17
|
+
readonly baseUrl: string | undefined;
|
|
18
|
+
readonly behindProxy: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* `--base-url` / `CLOUDHAL_BASE_URL` as an origin: http or https, host, optional port; a path,
|
|
22
|
+
* query or fragment is refused (Studio is served at the root, and Better Auth's `baseURL` is an
|
|
23
|
+
* origin).
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseBaseUrl(value: string): string;
|
|
26
|
+
/** Resolves the server options from flags and the environment. */
|
|
27
|
+
export declare function resolveStudioServer(flags: StudioServerFlags, env?: Env): StudioServer;
|
|
28
|
+
/** Where to open Studio: the public origin when there is one, else this machine. */
|
|
29
|
+
export declare function studioUrl(server: StudioServer, port: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* Better Auth's `baseURL` (the origin browsers use; its cookies are `Secure` for https) and the
|
|
32
|
+
* origins the API accepts state-changing requests from: the Studio dev server, the public origin
|
|
33
|
+
* (so a proxy that keeps the request on http still passes the API's CSRF check), and
|
|
34
|
+
* `CLOUDHAL_TRUSTED_ORIGINS`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function studioAuthOrigins(server: StudioServer, env?: Env): {
|
|
37
|
+
baseURL: string;
|
|
38
|
+
trustedOrigins: string[];
|
|
39
|
+
};
|
|
40
|
+
/** `--init-if-empty` and its `--starter` / `--name`; from the environment, `CLOUDHAL_INIT=<starter>`. */
|
|
41
|
+
export interface StudioInitFlags {
|
|
42
|
+
readonly initIfEmpty?: boolean;
|
|
43
|
+
readonly starter?: string;
|
|
44
|
+
readonly name?: string;
|
|
45
|
+
}
|
|
46
|
+
/** The first-run scaffold to perform, or undefined when none was asked for. */
|
|
47
|
+
export declare function resolveStudioInit(flags: StudioInitFlags, env?: Env): {
|
|
48
|
+
starter: string;
|
|
49
|
+
name: string | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Creates the project the way `cloudhal init` does when the folder has no `cloudhal.json` (a
|
|
53
|
+
* container starting on an empty volume). A folder that has other files but no config is left
|
|
54
|
+
* alone: `init` refuses it, so a volume mounted at the wrong path is never written over.
|
|
55
|
+
* Returns whether a project was created.
|
|
56
|
+
*/
|
|
57
|
+
export declare function initIfEmpty(projectDir: string, options: {
|
|
58
|
+
starter: string;
|
|
59
|
+
name?: string | undefined;
|
|
60
|
+
log?: (line: string) => void;
|
|
61
|
+
}): Promise<boolean>;
|
|
62
|
+
export {};
|