react-semaphor 0.1.291 → 0.1.293

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/chunks/braces-BwW2HFlB.js +23 -0
  2. package/dist/chunks/braces-C7GP95Fp.js +6 -0
  3. package/dist/chunks/dashboard-controls-DgUc38Tn.js +47 -0
  4. package/dist/chunks/dashboard-controls-jrkoCSY_.js +1982 -0
  5. package/dist/chunks/dashboard-filter-controls-button-B19UWmsK.js +11 -0
  6. package/dist/chunks/{dashboard-filter-controls-button-C4AMu723.js → dashboard-filter-controls-button-DGH4DxJ8.js} +54 -52
  7. package/dist/chunks/{dashboard-json-C13EJaTK.js → dashboard-json-C0NiRL-A.js} +1 -1
  8. package/dist/chunks/{dashboard-json-BKs1UTLL.js → dashboard-json-COjT-zjQ.js} +6 -6
  9. package/dist/chunks/dashboard-summary-settings-dialog-CGuFl7Xe.js +543 -0
  10. package/dist/chunks/dashboard-summary-settings-dialog-CXqaN_zj.js +1 -0
  11. package/dist/chunks/edit-dashboard-visual-CDOz4LWO.js +183 -0
  12. package/dist/chunks/{edit-dashboard-visual-CnVx0Xi7.js → edit-dashboard-visual-ppdXk86H.js} +1110 -1114
  13. package/dist/chunks/{index-Cr9Smn6Q.js → index-9z-jMqN8.js} +29783 -29815
  14. package/dist/chunks/{index-Cwg2SRSi.js → index-K25f5Rqr.js} +249 -249
  15. package/dist/chunks/{resource-management-panel-DJgYduN9.js → resource-management-panel-CP8cegZP.js} +22 -22
  16. package/dist/chunks/resource-management-panel-os6AuEKT.js +6 -0
  17. package/dist/chunks/{use-create-flow-overlay-state-DnI1SSKD.js → use-create-flow-overlay-state-CecnMS_v.js} +1 -1
  18. package/dist/chunks/{use-create-flow-overlay-state-NGb4c5Ye.js → use-create-flow-overlay-state-wpuqRZX5.js} +53 -53
  19. package/dist/chunks/{use-visual-utils-ivCDI1cO.js → use-visual-utils-BTfG-ppd.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-BbxYtbzK.js → use-visual-utils-BhRKGJql.js} +11 -11
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +21 -21
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.cjs +1 -1
  27. package/dist/surfboard/index.js +2 -2
  28. package/dist/types/main.d.ts +3 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/dashboard-controls-BSbG43wo.js +0 -42
  31. package/dist/chunks/dashboard-controls-LtQ98rvL.js +0 -1938
  32. package/dist/chunks/dashboard-filter-controls-button-CgoIPOZZ.js +0 -11
  33. package/dist/chunks/dashboard-summary-settings-dialog-T6aUgPAf.js +0 -536
  34. package/dist/chunks/dashboard-summary-settings-dialog-fL9l0wUO.js +0 -1
  35. package/dist/chunks/edit-dashboard-visual-CKB34ird.js +0 -188
  36. package/dist/chunks/resource-management-panel-Dv18tosO.js +0 -6
@@ -0,0 +1,11 @@
1
+ "use strict";const g=require("react"),e=require("./index-K25f5Rqr.js"),t=require("react/jsx-runtime"),I=require("./use-create-flow-overlay-state-CecnMS_v.js"),M=require("./use-visual-utils-BTfG-ppd.js"),L=require("./date-formatter-CqXdM6JO.js");/**
2
+ * @license lucide-react v0.453.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const T=e.createLucideIcon("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
7
+ * @license lucide-react v0.453.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const P=e.createLucideIcon("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]),V=1e4,z=15e3,O=3e4,R=3e4,H=12e4,k=2*60*60*1e3;function $(s){const r=Date.now()-s.getTime();return r<R?V:r<H?z:O}function _(){const{authToken:s,tokenProps:r}=e.useSemaphorContext(),m=e.useExportStore(p=>p.activeExports),[d,l]=g.useState(typeof document<"u"?!document.hidden:!0),h=g.useRef(null),o=g.useRef(!1),c=g.useRef(void 0),u=r==null?void 0:r.apiServiceUrl,n=s==null?void 0:s.accessToken,f=g.useCallback(()=>{const p=e.useExportStore.getState().activeExports;return Array.from(p.values()).filter(C=>e.isExportInProgress(C.status))},[]);g.useEffect(()=>{if(typeof document>"u")return;const p=()=>{l(!document.hidden)};return document.addEventListener("visibilitychange",p),()=>{document.removeEventListener("visibilitychange",p)}},[]);const b=g.useCallback(async()=>{if(!u||!n){o.current=!1;return}const p=f();if(p.length===0){o.current=!1;return}const C=Date.now(),D=p.filter(a=>C-a.startedAt.getTime()>k);if(D.length>0){const{updateExport:a}=e.useExportStore.getState().actions;for(const i of D)a(i.id,{status:"failed",error:"Export timed out. Please try again or contact support.",lastUpdatedAt:new Date})}const x=p.filter(a=>C-a.startedAt.getTime()<=k);if(x.length===0){o.current=!1;return}const j=await Promise.allSettled(x.map(async a=>{try{const i=await e.getExportStatus(u,n,a.id);let v;if(i.status==="completed")try{v=await e.getDownloadUrl(u,n,a.id)}catch(A){console.error(`[useExportPolling] Failed to get download URL for ${a.id}:`,A)}return{id:a.id,status:i.status,progress:i.progress,completedChunks:i.completedChunks,completedAt:i.completedAt?new Date(i.completedAt):void 0,lastUpdatedAt:new Date,fileSize:i.fileSize,error:i.error,downloadUrl:v}}catch(i){return console.error(`[useExportPolling] Failed to poll export ${a.id}:`,i),null}})),{updateExport:E}=e.useExportStore.getState().actions;for(const a of j)a.status==="fulfilled"&&a.value&&E(a.value.id,a.value);const w=f();if(w.length>0&&!document.hidden){const a=w.reduce((v,A)=>A.startedAt<v?A.startedAt:v,w[0].startedAt),i=$(a);h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{var v;(v=c.current)==null||v.call(c)},i)}else o.current=!1},[u,n,f]);return g.useEffect(()=>{c.current=b},[b]),g.useEffect(()=>{var C;f().length>0&&d&&!o.current&&(o.current=!0,(C=c.current)==null||C.call(c))},[m,d,f]),g.useEffect(()=>{var C;const p=f();d&&p.length>0&&!o.current&&(o.current=!0,(C=c.current)==null||C.call(c))},[d,f]),g.useEffect(()=>{!d&&h.current&&(clearTimeout(h.current),h.current=null,o.current=!1)},[d]),g.useEffect(()=>()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),{isPolling:o.current,isTabVisible:d,inProgressCount:f().length}}function q(){const{authToken:s,tokenProps:r}=e.useSemaphorContext(),m=e.useExportStore(c=>c.activeExports),{addExport:d}=e.useExportActions(),l=g.useRef(!1),h=r==null?void 0:r.apiServiceUrl,o=s==null?void 0:s.accessToken;g.useEffect(()=>{if(l.current||!h||!o)return;(async()=>{try{const{exports:u}=await e.getExports(h,o,{status:["pending","processing","chunking","compacting","completed","failed"],limit:20});for(const n of u){if(m.has(n.id))continue;const f=n.totalChunks?Math.round(n.completedChunks/n.totalChunks*100):0;let b;if(n.status==="completed")try{b=await e.getDownloadUrl(h,o,n.id)}catch(C){console.error(`[useExportRecovery] Failed to get download URL for ${n.id}:`,C)}const p={id:n.id,status:n.status,progress:f,title:X(n),totalRows:n.totalRows,totalChunks:n.totalChunks,completedChunks:n.completedChunks,startedAt:new Date(n.createdAt),lastUpdatedAt:new Date,completedAt:n.completedAt?new Date(n.completedAt):void 0,fileSize:n.fileSize,error:n.error,expiresAt:new Date(n.expiresAt),downloadUrl:b};d(p)}l.current=!0}catch(u){console.error("[useExportRecovery] Failed to recover exports:",u),l.current=!0}})()},[h,o,d,m])}function X(s){return s.title?s.title:e.isExportInProgress(s.status)?"Export in progress...":s.status==="completed"?"Export completed":s.status==="failed"?"Export failed":"Export"}function G({open:s,onOpenChange:r,isLibraryVisual:m,currentVisualName:d,isSaving:l=!1,destinationMode:h="both",onConfirm:o}){const[c,u]=g.useState(m&&d?`Copy of ${d}`:d||""),[n,f]=g.useState("");g.useEffect(()=>{s&&(u(m&&d?`Copy of ${d}`:d||""),f(""))},[s,m,d]);const b=!!c.trim(),p=h==="local"?{saveToLibrary:!1,saveToCurrentDashboard:!0,badgeType:"local",description:"Creates a local copy on the current dashboard.",actionLabel:"Add to Dashboard (Local)"}:h==="library"?{saveToLibrary:!0,saveToCurrentDashboard:!1,badgeType:"library",description:"Creates a reusable visual in Visual Library.",actionLabel:"Save as Library Visual"}:{saveToLibrary:!0,saveToCurrentDashboard:!0,badgeType:"linked",description:"Creates a new library visual and adds a linked copy to this dashboard.",actionLabel:"Save Copy as Linked Visual"},C=()=>{!b||l||o({name:c.trim(),description:n.trim()||void 0,saveToLibrary:p.saveToLibrary,saveToCurrentDashboard:p.saveToCurrentDashboard})};return t.jsx(e.Dialog,{open:s,onOpenChange:r,children:t.jsxs(e.DialogContent,{className:"sm:max-w-[500px]",children:[t.jsxs(e.DialogHeader,{children:[t.jsxs(e.DialogTitle,{className:"flex items-center gap-2",children:[t.jsx("span",{children:"Save Visual As"}),p.badgeType!=="local"&&t.jsx(I.VisualBadge,{type:p.badgeType,showLabel:!0,className:"px-2 py-0.5"})]}),t.jsx(e.DialogDescription,{children:p.description})]}),t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(e.Label,{htmlFor:"name",children:"Name"}),t.jsx(e.Input,{id:"name",value:c,onChange:D=>u(D.target.value),placeholder:"Enter visual name",disabled:l})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsx(e.Label,{htmlFor:"description",children:"Description (optional)"}),t.jsx(e.Textarea,{id:"description",value:n,onChange:D=>f(D.target.value),placeholder:"Enter visual description",rows:3,disabled:l})]})]}),t.jsxs(e.DialogFooter,{children:[t.jsx(e.Button,{variant:"outline",onClick:()=>r(!1),disabled:l,children:"Cancel"}),t.jsxs(e.Button,{onClick:C,disabled:!b||l,children:[l&&t.jsx(e.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),p.actionLabel]})]})]})})}function K(){const[s,r]=g.useState(!1),[m,d]=g.useState(!1),[l,h]=g.useState(null),o=e.useEditorStore(i=>i.frame),c=e.useEditorStore(i=>i.card),u=e.useSelectedVisual(),n=e.useDashboardStore(i=>i.selectedSheetId),f=e.useDashboardStore(i=>i.actions.setIsDashboardPanelOpen),{getUpdatedFrame:b}=M.useVisualUtils(),{selectVisual:p}=e.useManagementActions(),{addFrame:C,setSelectedFrameId:D,setIsVisualEditing:x}=e.useDashboardActions(),j=!!(o!=null&&o.visualId),E=(()=>{var i,v;return((i=o==null?void 0:o.cards)==null?void 0:i.length)===1&&((v=o.cards[0])!=null&&v.title)?o.cards[0].title:u!=null&&u.title?u.title:(c==null?void 0:c.title)||"Untitled Visual"})(),w=e.useCreateVisualWithFrame(i=>{if(i!=null&&i.id){if(p(i),m&&l&&n){const v={...l,id:e.v4(),visualId:i.id};C(n,v,"end"),D(v.id),d(!1),h(null),x(!1)}f(!0),r(!1)}});return{saveAsDialogOpen:s,setSaveAsDialogOpen:r,handleSaveAs:async i=>{if(!n){e.ue.error("No sheet selected");return}const v=b(),A=e.getDynamicFrameSaveIssue(v);if(A){e.ue.error(A);return}const N=v.cards.length===1?{...v,cards:v.cards.map(y=>({...y,title:i.name}))}:v;if(i.saveToLibrary){d(i.saveToCurrentDashboard),h(N);const y={title:i.name,description:i.description,frameObject:N,isPrivate:!1};w.mutate(y)}else if(i.saveToCurrentDashboard){const y={...N,id:e.v4(),visualId:void 0};C(n,y,"end"),D(y.id),e.ue.success("Visual saved to dashboard"),r(!1),x(!1)}},isLibraryVisual:j,currentVisualName:E,isSaving:w.isPending}}function Q(s={}){const r=e.useEditorStore(S=>S.frame),m=e.useManagementStore(S=>S.selectedVisual),d=e.useDashboardStore(S=>S.selectedFrameId),l=e.useDashboardStore(S=>S.selectedSheetId),{setIsVisualEditing:h,updateFrame:o}=e.useDashboardActions(),[c,u]=g.useState(!1),[n,f]=g.useState("both"),b=!!(r!=null&&r.visualId||m!=null&&m.id),p=!!(r!=null&&r.visualId&&d),C=b&&!p,{saveAsDialogOpen:D,setSaveAsDialogOpen:x,handleSaveAs:j,isLibraryVisual:E,currentVisualName:w,isSaving:a}=K(),{getUpdatedFrame:i}=M.useVisualUtils(),v=()=>{if(!l){e.ue.error("No sheet selected");return}if(c)return;u(!0);const S=i(),N=e.getDynamicFrameSaveIssue(S);if(N){u(!1),e.ue.error(N);return}const y={...S,visualId:void 0};o(l,y),setTimeout(()=>{u(!1),e.ue.success("Changes applied. Visual is now local to this dashboard"),h(!1)},300)},A=S=>{f(S),x(!0)};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"inline-flex items-center overflow-hidden rounded-[5px]",children:[!b&&t.jsx(I.EditorAcceptButton,{className:"rounded-none",variant:"default"}),b&&C&&t.jsx(I.VisualSaveButton,{className:"rounded-none",variant:"default"}),b&&p&&t.jsx(I.VisualSaveAndApplyButton,{className:"rounded-none"}),t.jsxs(e.DropdownMenu,{modal:!1,children:[t.jsx(e.DropdownMenuTrigger,{asChild:!0,children:t.jsx(e.Button,{variant:"default",size:"xs",className:"w-7 rounded-none border-l border-primary-foreground/20 px-0","aria-label":"Open visual save options",disabled:a||c,children:t.jsx(e.ChevronDown,{className:"h-3.5 w-3.5"})})}),t.jsxs(e.DropdownMenuContent,{align:"end",className:"min-w-[220px] rounded-[6px] border border-border/60 p-1 shadow-sm",children:[p&&t.jsxs(t.Fragment,{children:[t.jsxs(e.DropdownMenuItem,{onClick:v,disabled:c,children:[t.jsx(e.Check,{className:"h-3.5 w-3.5"}),c?"Applying...":"Apply Locally"]}),t.jsx(e.DropdownMenuSeparator,{})]}),t.jsxs(e.DropdownMenuItem,{onClick:()=>A("local"),disabled:a,children:[t.jsx(e.Plus,{className:"h-3.5 w-3.5"}),"Add to Dashboard (Local)"]}),t.jsxs(e.DropdownMenuItem,{onClick:()=>A("library"),disabled:a,children:[t.jsx(I.Library,{className:"h-3.5 w-3.5"}),"Save as Library Visual"]}),t.jsxs(e.DropdownMenuItem,{onClick:()=>A("both"),disabled:a,children:[t.jsx(I.Link2,{className:"h-3.5 w-3.5"}),"Save Copy as Linked Visual"]})]})]})]}),t.jsx(I.EditorCancelButton,{}),t.jsx(G,{open:D,onOpenChange:S=>{a||x(S)},isLibraryVisual:E,currentVisualName:w,isSaving:a,destinationMode:n,onConfirm:j})]})}function W({className:s}){const r=e.useEditorStore(u=>u.isDevMode),m=e.useDashboardStore(u=>u.isVisualEditing),{setIsDevMode:d}=e.useEditorActions(),{config:l}=g.useContext(e.SemaphorContext).tokenProps,h=(l==null?void 0:l.showAdvancedMode)!==!1;if(!m||!h)return null;const o="h-full rounded-none border-0 bg-transparent px-2.5 shadow-none text-muted-foreground hover:bg-accent/50 hover:text-foreground",c="bg-muted text-foreground hover:bg-muted";return t.jsxs("div",{role:"radiogroup","aria-label":"Editor mode",className:e.cn("inline-flex h-7 items-stretch overflow-hidden rounded-[5px] border border-input bg-background",s),children:[t.jsxs(e.Button,{type:"button",variant:"ghost",size:"xs",role:"radio","aria-checked":!r,className:e.cn(o,!r&&c),onClick:()=>d(!1),children:[t.jsx(e.SlidersHorizontal,{className:"h-3.5 w-3.5"}),"Drag & drop"]}),t.jsxs(e.Button,{type:"button",variant:"ghost",size:"xs",role:"radio","aria-checked":r,className:e.cn(o,"border-l border-border/60",r&&c),onClick:()=>d(!0),children:[t.jsx(e.CodeXml,{className:"h-3.5 w-3.5"}),"SQL"]})]})}function Y({open:s,onOpenChange:r,onSave:m,onDiscard:d,isSaving:l,title:h="Unsaved changes",description:o="You have unsaved changes to this dashboard. What would you like to do?",cancelLabel:c="Cancel",discardLabel:u="Discard",saveLabel:n="Save"}){const f=b=>{!b&&l||r(b)};return t.jsx(e.AlertDialog,{open:s,onOpenChange:f,children:t.jsxs(e.AlertDialogContent,{children:[t.jsxs(e.AlertDialogHeader,{children:[t.jsx(e.AlertDialogTitle,{children:h}),t.jsx(e.AlertDialogDescription,{children:o})]}),t.jsxs(e.AlertDialogFooter,{children:[t.jsx(e.Button,{type:"button",size:"xs",onClick:d,disabled:l,variant:"ghost",className:"mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",children:u}),t.jsx(e.AlertDialogCancel,{disabled:l,children:c}),t.jsx(e.Button,{type:"button",size:"xs",onClick:m,disabled:l,children:l?t.jsxs(t.Fragment,{children:[t.jsx(e.LoaderCircle,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):n})]})]})})}function Z(s,r,m,d){g.useEffect(()=>{s&&!m&&r&&d(e.cloneDeep(r))},[s,m,r,d])}function B({export:s,onRemove:r}){const m=()=>{s.downloadUrl&&window.open(s.downloadUrl,"_blank")},d=c=>{c.stopPropagation(),r==null||r(s.id)},l=()=>{switch(s.status){case"completed":return t.jsx(e.CircleCheck,{className:"mt-0.5 h-5 w-5 shrink-0 text-green-600"});case"failed":return t.jsx(I.CircleX,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"});default:return t.jsx(e.LoaderCircle,{className:"text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin"})}},h=e.isExportInProgress(s.status),o=(()=>{switch(s.status){case"pending":return"Queued...";case"processing":return"Processing...";case"chunking":return"Processing...";case"compacting":return"Finalizing...";default:return"Processing..."}})();return t.jsxs("div",{className:"group p-4 transition-colors hover:bg-muted/50",children:[t.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l(),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h4",{className:"mb-1 truncate text-sm font-medium",children:s.title}),s.status==="completed"&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[s.totalRows.toLocaleString()," rows"]}),s.fileSize&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"•"}),t.jsx("span",{children:e.formatFileSize(s.fileSize)})]})]}),h&&t.jsx("div",{className:"text-xs text-muted-foreground",children:o}),s.status==="failed"&&t.jsx("div",{className:"line-clamp-2 text-xs text-destructive",children:s.error||"Export failed"})]})]}),t.jsx(e.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:d,"aria-label":"Remove notification",children:t.jsx(e.X,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"ml-8",children:[s.status==="completed"&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:L.formatDistanceToNow(s.startedAt,{addSuffix:!0})}),s.downloadUrl&&t.jsxs(e.Button,{size:"sm",variant:"outline",className:"h-8 bg-transparent",onClick:m,children:[t.jsx(e.Download,{className:"mr-1.5 h-3.5 w-3.5"}),"Download"]})]}),h&&t.jsxs("div",{children:[t.jsx(e.Progress,{value:s.progress,className:"h-1.5"}),t.jsxs("span",{className:"mt-1 block text-xs text-muted-foreground",children:[s.progress,"% complete"]})]}),s.status==="failed"&&t.jsx("span",{className:"text-xs text-muted-foreground",children:L.formatDistanceToNow(s.startedAt,{addSuffix:!0})})]})]})}function U(){const{authToken:s,tokenProps:r}=e.useSemaphorContext(),m=e.useExportStore(x=>x.activeExports),{clearCompleted:d,removeExport:l,updateExport:h}=e.useExportActions(),[o,c]=g.useState(!1),[u,n]=g.useState(!1),f=Array.from(m.values()).sort((x,j)=>j.startedAt.getTime()-x.startedAt.getTime()),b=f.some(x=>x.status==="completed"||x.status==="failed"),p=g.useCallback(async()=>{const x=r==null?void 0:r.apiServiceUrl,j=s==null?void 0:s.accessToken;if(!(!x||!j)){c(!0);try{const E=Array.from(m.values());await Promise.all(E.map(async w=>{try{const a=await e.getExportStatus(x,j,w.id);let i;if(a.status==="completed")try{i=await e.getDownloadUrl(x,j,w.id)}catch(v){console.error(`Failed to get download URL for ${w.id}:`,v)}h(w.id,{status:a.status,progress:a.progress,completedChunks:a.completedChunks,completedAt:a.completedAt?new Date(a.completedAt):void 0,lastUpdatedAt:new Date,fileSize:a.fileSize,error:a.error,downloadUrl:i})}catch(a){console.error(`Failed to refresh export ${w.id}:`,a)}}))}finally{c(!1)}}},[m,s==null?void 0:s.accessToken,r==null?void 0:r.apiServiceUrl,h]),C=g.useCallback(async()=>{const x=r==null?void 0:r.apiServiceUrl,j=s==null?void 0:s.accessToken;if(!x||!j){d();return}n(!0);try{const E=f.filter(a=>a.status==="completed"||a.status==="failed"),w=await Promise.allSettled(E.map(async a=>(await e.cancelExport(x,j,a.id),a.id)));for(const a of w)a.status==="fulfilled"?l(a.value):console.error("Failed to delete export:",a.reason)}finally{n(!1)}},[f,r==null?void 0:r.apiServiceUrl,s==null?void 0:s.accessToken,d,l]),D=g.useCallback(async x=>{const j=r==null?void 0:r.apiServiceUrl,E=s==null?void 0:s.accessToken;if(j&&E)try{await e.cancelExport(j,E,x),l(x);return}catch(w){console.error(`Failed to cancel export ${x}:`,w)}l(x)},[r==null?void 0:r.apiServiceUrl,s==null?void 0:s.accessToken,l]);return f.length===0?t.jsxs("div",{className:"p-6 text-center",children:[t.jsx(T,{className:"mx-auto mb-2 h-8 w-8 text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No active exports"}),t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Large exports will appear here"})]}):t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(T,{className:"h-5 w-5 text-muted-foreground"}),t.jsx("h4",{className:"font-semibold",children:"Exports"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(e.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:p,disabled:o,title:"Refresh status",children:t.jsx(e.RefreshCw,{className:`h-4 w-4 ${o?"animate-spin":""}`})}),b&&t.jsx(e.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-sm",onClick:C,disabled:u,children:u?"Clearing...":"Clear all"})]})]}),t.jsx("div",{className:"max-h-[350px] overflow-y-auto",children:t.jsx("div",{className:"divide-y",children:f.map(x=>t.jsx(B,{export:x,onRemove:D},x.id))})})]})}function J({variant:s}){const r=e.useExportStore(u=>u.activeExports),m=e.useInProgressExportsCount(),d=r.size>0,l=Array.from(r.values()).some(u=>u.status==="completed"||u.status==="failed"),o=m>0?m>9?"9+":String(m):null,c=d;return t.jsxs(e.Popover,{children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{variant:s??"ghost",size:"xs",className:"relative w-7 px-0 text-muted-foreground hover:text-foreground","aria-label":"Export notifications",children:[t.jsx(e.Bell,{className:"h-3.5 w-3.5"}),c&&t.jsx("span",{className:`absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${o?"-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold":"right-1 top-1 h-1.5 w-1.5"}`,children:o})]})}),t.jsx(e.PopoverContent,{className:"w-80 p-0",align:"end",sideOffset:8,children:t.jsx(U,{})})]})}function ee(s){if(s)return{renamed:s.type==="rename"?{oldId:s.oldId,newId:s.newId}:void 0,removedControlId:s.type==="remove"?s.controlId:void 0,cardBindingsById:s.type==="add"||s.type==="update"?s.cardBindingsById:void 0,affectedBindingControlIds:s.type==="add"||s.type==="update"?s.affectedBindingControlIds:void 0}}function te({open:s,onOpenChange:r,trigger:m,showTrigger:d=!0,initialMode:l="manage"}){const h=l==="create",{forceClose:o,handleOpenChange:c,isCreateFlowActive:u,preventPassiveDismissDuringCreate:n,resolvedOpen:f,setIsCreateFlowActive:b}=I.useCreateFlowOverlayState({open:s,onOpenChange:r,initialCreateFlowActive:l==="create",dismissMode:d?"passive":"explicit-only"}),p=e.useDashboardStore(N=>N.dashboard),{setDashboardControlsModel:C}=e.useDashboardActions(),{participants:D}=e.useDashboardStructuralParticipants(e.getDashboardCards(p)),x=Array.from(new Map(D.flatMap(N=>N.fieldChoices.map(y=>{var F;return[y.value,{option:y,target:(F=N.fieldTargetMap)==null?void 0:F[y.value]}]}))).values()),j=Array.from(new Map(D.flatMap(N=>N.metricChoices.map(y=>{var F;return[y.value,{option:y,target:(F=N.metricTargetMap)==null?void 0:F[y.value]}]}))).values()),E=e.collectDashboardControlIds({...p||{},controls:[]}),w=e.buildDashboardStructuralParticipantIdsByControlId(p),a=(N,y,F)=>{C(N,y,ee(F))},i=g.useCallback(()=>{if(h){o();return}b(!1)},[h,o,b]),v=t.jsx(I.ControlDefinitionListEditor,{scope:"dashboard",controls:p.controls||[],reservedControlIds:E,defaultValues:p.defaultControlValues||{},usageByControlId:e.buildDashboardControlUsageById(p),availableFieldChoices:x,availableMetricChoices:j,structuralParticipants:D,structuralParticipantIdsByControlId:w,initialCreateFlow:l==="create",onCreateFlowActiveChange:b,onCreateFlowComplete:i,onChange:a,emptyMessage:"No dashboard controls yet."}),A=u?"Add dashboard control":"Dashboard Controls",S=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Dashboard Controls"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."})]}),v]});return d?t.jsxs(e.Popover,{open:f,onOpenChange:c,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:m||t.jsxs(e.Button,{variant:"outline",className:"h-7 px-2",size:"sm",children:[t.jsx(e.SlidersHorizontal,{className:"mr-2 h-4 w-4"}),"Controls"]})}),t.jsx(e.PopoverContent,{className:"w-[620px] max-w-[95vw] space-y-4",align:"end",onEscapeKeyDown:n,onPointerDownOutside:n,children:S})]}):t.jsx(e.Dialog,{open:f,onOpenChange:c,children:t.jsxs(e.DialogContent,{className:"flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",onEscapeKeyDown:n,onPointerDownOutside:n,children:[t.jsxs(e.DialogHeader,{className:u?"space-y-0":void 0,children:[t.jsx(e.DialogTitle,{className:"text-[15px]",children:A}),t.jsx(e.DialogDescription,{className:u?"sr-only":"text-[13px]",children:u?"Configure and add a shared dashboard control.":"Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."})]}),t.jsx("div",{className:"min-h-0 overflow-y-auto pr-1",children:v})]})})}function se({showFilters:s,onToggleFilters:r,onAddFilter:m,onAddControl:d,onManageControls:l,size:h="default",className:o,primaryButtonClassName:c,secondaryButtonClassName:u,dropdownContentClassName:n}){const f=h==="toolbar";return t.jsxs("div",{className:e.cn("relative inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",f?"h-8":"h-7",o),children:[t.jsxs(e.Button,{variant:"ghost",size:"xs",className:e.cn("h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",c),onClick:r,children:[s?t.jsx(P,{className:"h-3.5 w-3.5"}):t.jsx(e.Filter,{className:"h-3.5 w-3.5"}),"Filter"]}),t.jsxs(e.DropdownMenu,{children:[t.jsx(e.DropdownMenuTrigger,{asChild:!0,children:t.jsx(e.Button,{variant:"ghost",size:"xs",className:e.cn("h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",u),"aria-label":"Filter and control actions",children:t.jsx(e.ChevronDown,{className:"h-3.5 w-3.5"})})}),t.jsxs(e.DropdownMenuContent,{align:"start",className:e.cn("min-w-[180px] rounded-[6px] border border-border/60 p-1 shadow-sm",n),children:[t.jsxs(e.DropdownMenuItem,{onSelect:m,children:[t.jsx(e.Filter,{className:"h-3.5 w-3.5"}),"Add filter"]}),t.jsxs(e.DropdownMenuItem,{onSelect:d,children:[t.jsx(e.SlidersHorizontal,{className:"h-3.5 w-3.5"}),"Add control"]}),t.jsxs(e.DropdownMenuItem,{onSelect:l,children:[t.jsx(e.Pencil,{className:"h-3.5 w-3.5"}),"Manage controls"]})]})]})]})}exports.AdvancedModeToggle=W;exports.DashboardControlsSettings=te;exports.DashboardFilterControlsButton=se;exports.ExportNotificationItem=B;exports.ExportNotificationList=U;exports.NotificationBell=J;exports.UnsavedChangesAlert=Y;exports.VisualEditingControls=Q;exports.useExportPolling=_;exports.useExportRecovery=q;exports.usePristineSnapshotInitializer=Z;
@@ -1,16 +1,16 @@
1
- import ge, { useState as L, useRef as O, useCallback as M, useEffect as F, useContext as be } from "react";
2
- import { bM as ee, b as _, aC as k, bJ as $, bF as te, bG as j, aD as ae, bE as xe, d as se, e as re, f as oe, g as ne, h as ie, L as K, I as Ce, d8 as we, v as ye, B as S, w as H, U as R, J as Ne, u as z, K as De, N as X, d9 as Ae, da as W, x as P, b_ as le, af as Se, cC as de, cD as ce, a6 as ue, cF as he, cG as U, s as Ee, cK as Ie, ct as Le, M as Fe, db as Te, c as V, dc as G, dd as ke, cS as Ue, cT as Ve, cU as Me, cV as Pe, cW as ze, cX as Be, cY as Oe, as as Re, bL as _e, X as $e, de as je, df as He, cz as Xe, bH as q, a8 as Ge, aF as Ke, P as me, j as pe, dg as We, l as fe, dh as qe, di as Je, dj as Qe, dk as Ye, dl as Ze, dm as J, dn as et } from "./index-Cr9Smn6Q.js";
1
+ import ge, { useState as L, useRef as O, useCallback as M, useEffect as T, useContext as be } from "react";
2
+ import { c as ee, d as _, aD as k, bK as $, bG as te, bH as H, aE as ae, bF as xe, e as se, f as re, g as oe, h as ne, i as ie, L as K, I as Ce, d8 as we, w as ye, B as S, x as j, V as R, K as Ne, u as z, M as De, O as X, d9 as Ae, da as W, y as P, b_ as le, ag as Se, cC as de, cD as ce, a7 as ue, cF as he, cG as U, t as Ee, cK as Ie, ct as Le, N as Te, db as Fe, b as V, dc as G, dd as ke, cS as Ue, cT as Ve, cU as Me, cV as Pe, cW as ze, cX as Be, cY as Oe, at as Re, bM as _e, X as $e, de as He, df as je, cz as Xe, bI as q, a9 as Ge, aG as Ke, P as me, k as pe, dg as We, m as fe, dh as qe, di as Qe, dj as Ye, dk as Ze, dl as Je, dm as Q, dn as et } from "./index-9z-jMqN8.js";
3
3
  import { jsx as t, jsxs as s, Fragment as B } from "react/jsx-runtime";
4
- import { V as tt, E as at, a as st, b as rt, L as ot, c as nt, d as it, C as lt, u as dt, e as ct } from "./use-create-flow-overlay-state-NGb4c5Ye.js";
5
- import { u as ve } from "./use-visual-utils-BbxYtbzK.js";
6
- import { k as Q } from "./date-formatter-vkCj9Ct-.js";
4
+ import { V as tt, E as at, a as st, b as rt, L as ot, c as nt, d as it, C as lt, u as dt, e as ct } from "./use-create-flow-overlay-state-wpuqRZX5.js";
5
+ import { u as ve } from "./use-visual-utils-BhRKGJql.js";
6
+ import { k as Y } from "./date-formatter-vkCj9Ct-.js";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
9
9
  *
10
10
  * This source code is licensed under the ISC license.
11
11
  * See the LICENSE file in the root directory of this source tree.
12
12
  */
13
- const Y = ee("FileDown", [
13
+ const Z = ee("FileDown", [
14
14
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
15
15
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
16
16
  ["path", { d: "M12 18v-6", key: "17g6i2" }],
@@ -26,12 +26,12 @@ const ut = ee("FilterX", [
26
26
  ["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
27
27
  ["path", { d: "m22 3-5 5", key: "12jva0" }],
28
28
  ["path", { d: "m17 3 5 5", key: "k36vhe" }]
29
- ]), ht = 1e4, mt = 15e3, pt = 3e4, ft = 3e4, vt = 12e4, Z = 2 * 60 * 60 * 1e3;
29
+ ]), ht = 1e4, mt = 15e3, pt = 3e4, ft = 3e4, vt = 12e4, J = 2 * 60 * 60 * 1e3;
30
30
  function gt(e) {
31
31
  const a = Date.now() - e.getTime();
32
32
  return a < ft ? ht : a < vt ? mt : pt;
33
33
  }
34
- function Ft() {
34
+ function Tt() {
35
35
  const { authToken: e, tokenProps: a } = _(), p = k((m) => m.activeExports), [d, l] = L(
36
36
  typeof document < "u" ? !document.hidden : !0
37
37
  ), h = O(null), o = O(!1), c = O(void 0), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken, v = M(() => {
@@ -40,7 +40,7 @@ function Ft() {
40
40
  (x) => $(x.status)
41
41
  );
42
42
  }, []);
43
- F(() => {
43
+ T(() => {
44
44
  if (typeof document > "u") return;
45
45
  const m = () => {
46
46
  l(!document.hidden);
@@ -60,7 +60,7 @@ function Ft() {
60
60
  return;
61
61
  }
62
62
  const x = Date.now(), N = m.filter(
63
- (r) => x - r.startedAt.getTime() > Z
63
+ (r) => x - r.startedAt.getTime() > J
64
64
  );
65
65
  if (N.length > 0) {
66
66
  const { updateExport: r } = k.getState().actions;
@@ -72,7 +72,7 @@ function Ft() {
72
72
  });
73
73
  }
74
74
  const f = m.filter(
75
- (r) => x - r.startedAt.getTime() <= Z
75
+ (r) => x - r.startedAt.getTime() <= J
76
76
  );
77
77
  if (f.length === 0) {
78
78
  o.current = !1;
@@ -85,7 +85,7 @@ function Ft() {
85
85
  let g;
86
86
  if (i.status === "completed")
87
87
  try {
88
- g = await j(u, n, r.id);
88
+ g = await H(u, n, r.id);
89
89
  } catch (I) {
90
90
  console.error(
91
91
  `[useExportPolling] Failed to get download URL for ${r.id}:`,
@@ -126,18 +126,18 @@ function Ft() {
126
126
  } else
127
127
  o.current = !1;
128
128
  }, [u, n, v]);
129
- return F(() => {
129
+ return T(() => {
130
130
  c.current = b;
131
- }, [b]), F(() => {
131
+ }, [b]), T(() => {
132
132
  var x;
133
133
  v().length > 0 && d && !o.current && (o.current = !0, (x = c.current) == null || x.call(c));
134
- }, [p, d, v]), F(() => {
134
+ }, [p, d, v]), T(() => {
135
135
  var x;
136
136
  const m = v();
137
137
  d && m.length > 0 && !o.current && (o.current = !0, (x = c.current) == null || x.call(c));
138
- }, [d, v]), F(() => {
138
+ }, [d, v]), T(() => {
139
139
  !d && h.current && (clearTimeout(h.current), h.current = null, o.current = !1);
140
- }, [d]), F(() => () => {
140
+ }, [d]), T(() => () => {
141
141
  h.current && (clearTimeout(h.current), h.current = null);
142
142
  }, []), {
143
143
  isPolling: o.current,
@@ -145,9 +145,9 @@ function Ft() {
145
145
  inProgressCount: v().length
146
146
  };
147
147
  }
148
- function Tt() {
148
+ function Ft() {
149
149
  const { authToken: e, tokenProps: a } = _(), p = k((c) => c.activeExports), { addExport: d } = ae(), l = O(!1), h = a == null ? void 0 : a.apiServiceUrl, o = e == null ? void 0 : e.accessToken;
150
- F(() => {
150
+ T(() => {
151
151
  if (l.current || !h || !o) return;
152
152
  (async () => {
153
153
  try {
@@ -162,7 +162,7 @@ function Tt() {
162
162
  let b;
163
163
  if (n.status === "completed")
164
164
  try {
165
- b = await j(h, o, n.id);
165
+ b = await H(h, o, n.id);
166
166
  } catch (x) {
167
167
  console.error(
168
168
  `[useExportRecovery] Failed to get download URL for ${n.id}:`,
@@ -297,7 +297,7 @@ function xt({
297
297
  }
298
298
  ),
299
299
  /* @__PURE__ */ s(S, { onClick: x, disabled: !b || l, children: [
300
- l && /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
300
+ l && /* @__PURE__ */ t(j, { className: "mr-2 h-4 w-4 animate-spin" }),
301
301
  m.actionLabel
302
302
  ] })
303
303
  ] })
@@ -505,17 +505,17 @@ function kt(e = {}) {
505
505
  ] });
506
506
  }
507
507
  function Ut({ className: e }) {
508
- const a = R((u) => u.isDevMode), p = z((u) => u.isVisualEditing), { setIsDevMode: d } = Fe(), { config: l } = be(Te).tokenProps, h = (l == null ? void 0 : l.showAdvancedMode) !== !1;
508
+ const a = R((u) => u.isDevMode), p = z((u) => u.isVisualEditing), { setIsDevMode: d } = Te(), { config: l } = be(Fe).tokenProps, h = (l == null ? void 0 : l.showAdvancedMode) !== !1;
509
509
  if (!p || !h)
510
510
  return null;
511
- const o = "h-7 rounded-none border-0 bg-transparent px-2.5 shadow-none text-muted-foreground hover:bg-accent/50 hover:text-foreground", c = "bg-muted text-foreground hover:bg-muted";
511
+ const o = "h-full rounded-none border-0 bg-transparent px-2.5 shadow-none text-muted-foreground hover:bg-accent/50 hover:text-foreground", c = "bg-muted text-foreground hover:bg-muted";
512
512
  return /* @__PURE__ */ s(
513
513
  "div",
514
514
  {
515
515
  role: "radiogroup",
516
516
  "aria-label": "Editor mode",
517
517
  className: V(
518
- "inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
518
+ "inline-flex h-7 items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
519
519
  e
520
520
  ),
521
521
  children: [
@@ -593,14 +593,14 @@ function Vt({
593
593
  ),
594
594
  /* @__PURE__ */ t(Oe, { disabled: l, children: c }),
595
595
  /* @__PURE__ */ t(S, { type: "button", size: "xs", onClick: p, disabled: l, children: l ? /* @__PURE__ */ s(B, { children: [
596
- /* @__PURE__ */ t(H, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
596
+ /* @__PURE__ */ t(j, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
597
597
  "Saving..."
598
598
  ] }) : n })
599
599
  ] })
600
600
  ] }) });
601
601
  }
602
602
  function Mt(e, a, p, d) {
603
- F(() => {
603
+ T(() => {
604
604
  e && !p && a && d(Re(a));
605
605
  }, [e, p, a, d]);
606
606
  }
@@ -619,7 +619,7 @@ function wt({
619
619
  case "failed":
620
620
  return /* @__PURE__ */ t(lt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
621
621
  default:
622
- return /* @__PURE__ */ t(H, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
622
+ return /* @__PURE__ */ t(j, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
623
623
  }
624
624
  }, h = $(e.status), o = (() => {
625
625
  switch (e.status) {
@@ -669,7 +669,7 @@ function wt({
669
669
  ] }),
670
670
  /* @__PURE__ */ s("div", { className: "ml-8", children: [
671
671
  e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
672
- /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Q(e.startedAt, { addSuffix: !0 }) }),
672
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Y(e.startedAt, { addSuffix: !0 }) }),
673
673
  e.downloadUrl && /* @__PURE__ */ s(
674
674
  S,
675
675
  {
@@ -678,20 +678,20 @@ function wt({
678
678
  className: "h-8 bg-transparent",
679
679
  onClick: p,
680
680
  children: [
681
- /* @__PURE__ */ t(je, { className: "mr-1.5 h-3.5 w-3.5" }),
681
+ /* @__PURE__ */ t(He, { className: "mr-1.5 h-3.5 w-3.5" }),
682
682
  "Download"
683
683
  ]
684
684
  }
685
685
  )
686
686
  ] }),
687
687
  h && /* @__PURE__ */ s("div", { children: [
688
- /* @__PURE__ */ t(He, { value: e.progress, className: "h-1.5" }),
688
+ /* @__PURE__ */ t(je, { value: e.progress, className: "h-1.5" }),
689
689
  /* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
690
690
  e.progress,
691
691
  "% complete"
692
692
  ] })
693
693
  ] }),
694
- e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Q(e.startedAt, { addSuffix: !0 }) })
694
+ e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: Y(e.startedAt, { addSuffix: !0 }) })
695
695
  ] })
696
696
  ] });
697
697
  }
@@ -713,7 +713,7 @@ function yt() {
713
713
  let i;
714
714
  if (r.status === "completed")
715
715
  try {
716
- i = await j(
716
+ i = await H(
717
717
  f,
718
718
  w,
719
719
  C.id
@@ -784,13 +784,13 @@ function yt() {
784
784
  [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, l]
785
785
  );
786
786
  return v.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
787
- /* @__PURE__ */ t(Y, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
787
+ /* @__PURE__ */ t(Z, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
788
788
  /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
789
789
  /* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
790
790
  ] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
791
791
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
792
792
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
793
- /* @__PURE__ */ t(Y, { className: "h-5 w-5 text-muted-foreground" }),
793
+ /* @__PURE__ */ t(Z, { className: "h-5 w-5 text-muted-foreground" }),
794
794
  /* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
795
795
  ] }),
796
796
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
@@ -897,16 +897,16 @@ function zt({
897
897
  // create and make consumers use `forceClose()` from a dedicated
898
898
  // button.
899
899
  dismissMode: d ? "passive" : "explicit-only"
900
- }), m = z((A) => A.dashboard), { setDashboardControlsModel: x } = X(), { participants: N } = qe(Je(m)), f = Array.from(
900
+ }), m = z((A) => A.dashboard), { setDashboardControlsModel: x } = X(), { participants: N } = qe(Qe(m)), f = Array.from(
901
901
  new Map(
902
902
  N.flatMap(
903
903
  (A) => A.fieldChoices.map((y) => {
904
- var T;
904
+ var F;
905
905
  return [
906
906
  y.value,
907
907
  {
908
908
  option: y,
909
- target: (T = A.fieldTargetMap) == null ? void 0 : T[y.value]
909
+ target: (F = A.fieldTargetMap) == null ? void 0 : F[y.value]
910
910
  }
911
911
  ];
912
912
  })
@@ -916,25 +916,25 @@ function zt({
916
916
  new Map(
917
917
  N.flatMap(
918
918
  (A) => A.metricChoices.map((y) => {
919
- var T;
919
+ var F;
920
920
  return [
921
921
  y.value,
922
922
  {
923
923
  option: y,
924
- target: (T = A.metricTargetMap) == null ? void 0 : T[y.value]
924
+ target: (F = A.metricTargetMap) == null ? void 0 : F[y.value]
925
925
  }
926
926
  ];
927
927
  })
928
928
  )
929
929
  ).values()
930
- ), E = Qe({
930
+ ), E = Ye({
931
931
  ...m || {},
932
932
  controls: []
933
- }), C = Ye(m), r = (A, y, T) => {
933
+ }), C = Ze(m), r = (A, y, F) => {
934
934
  x(
935
935
  A,
936
936
  y,
937
- Nt(T)
937
+ Nt(F)
938
938
  );
939
939
  }, i = M(() => {
940
940
  if (h) {
@@ -949,7 +949,7 @@ function zt({
949
949
  controls: m.controls || [],
950
950
  reservedControlIds: E,
951
951
  defaultValues: m.defaultControlValues || {},
952
- usageByControlId: Ze(m),
952
+ usageByControlId: Je(m),
953
953
  availableFieldChoices: f,
954
954
  availableMetricChoices: w,
955
955
  structuralParticipants: N,
@@ -1022,12 +1022,16 @@ function Bt({
1022
1022
  secondaryButtonClassName: u,
1023
1023
  dropdownContentClassName: n
1024
1024
  }) {
1025
- const v = h === "toolbar";
1026
1025
  return /* @__PURE__ */ s(
1027
1026
  "div",
1028
1027
  {
1029
1028
  className: V(
1029
+ // Height lives on the shell so the outer border is part of the
1030
+ // h-7 box (matches regular `size="xs"` buttons). Inner buttons
1031
+ // stretch to fill via `h-full`, avoiding the 2px stack-up that
1032
+ // makes the combo taller than a sibling `<Button size="xs">`.
1030
1033
  "relative inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
1034
+ h === "toolbar" ? "h-8" : "h-7",
1031
1035
  o
1032
1036
  ),
1033
1037
  children: [
@@ -1037,13 +1041,12 @@ function Bt({
1037
1041
  variant: "ghost",
1038
1042
  size: "xs",
1039
1043
  className: V(
1040
- v ? "h-8" : "h-7",
1041
- "rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
1044
+ "h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
1042
1045
  c
1043
1046
  ),
1044
1047
  onClick: a,
1045
1048
  children: [
1046
- e ? /* @__PURE__ */ t(ut, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(J, { className: "h-3.5 w-3.5" }),
1049
+ e ? /* @__PURE__ */ t(ut, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Q, { className: "h-3.5 w-3.5" }),
1047
1050
  "Filter"
1048
1051
  ]
1049
1052
  }
@@ -1055,8 +1058,7 @@ function Bt({
1055
1058
  variant: "ghost",
1056
1059
  size: "xs",
1057
1060
  className: V(
1058
- v ? "h-8 w-7" : "h-7 w-7",
1059
- "rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
1061
+ "h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
1060
1062
  u
1061
1063
  ),
1062
1064
  "aria-label": "Filter and control actions",
@@ -1073,7 +1075,7 @@ function Bt({
1073
1075
  ),
1074
1076
  children: [
1075
1077
  /* @__PURE__ */ s(U, { onSelect: p, children: [
1076
- /* @__PURE__ */ t(J, { className: "h-3.5 w-3.5" }),
1078
+ /* @__PURE__ */ t(Q, { className: "h-3.5 w-3.5" }),
1077
1079
  "Add filter"
1078
1080
  ] }),
1079
1081
  /* @__PURE__ */ s(U, { onSelect: d, children: [
@@ -1100,8 +1102,8 @@ export {
1100
1102
  Vt as U,
1101
1103
  kt as V,
1102
1104
  wt as a,
1103
- Tt as b,
1105
+ Ft as b,
1104
1106
  Bt as c,
1105
1107
  Mt as d,
1106
- Ft as u
1108
+ Tt as u
1107
1109
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("react"),s=require("./index-Cwg2SRSi.js");require("react-dom");function b(){const t=s.useDashboardStore(e=>e.dashboard),i=s.useDashboardStore(e=>e.actions.setDashboard),h=s.useDashboardStore(e=>e.showDashboardJSON),u=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),a=r.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,d]=r.useState(a),n=r.useRef(a);return r.useEffect(()=>{a!==n.current&&(d(a),n.current=a)},[a]),o.jsxs("div",{className:s.cn("relative p-2",{hidden:!h}),children:[o.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>u(!1),children:[o.jsx(s.X,{className:"mr-2 h-4 w-4"}),"Close"]}),o.jsx("div",{className:"h-[550px] overflow-hidden",children:o.jsx(s.CodeEditor,{value:l,onValueChange:e=>{d(e);try{const c=JSON.parse(e);n.current=JSON.stringify(c,null,2),i(c)}catch{}},language:"json"})})]})}exports.default=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("react"),s=require("./index-K25f5Rqr.js");require("react-dom");function b(){const t=s.useDashboardStore(e=>e.dashboard),i=s.useDashboardStore(e=>e.actions.setDashboard),h=s.useDashboardStore(e=>e.showDashboardJSON),u=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),a=r.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,d]=r.useState(a),n=r.useRef(a);return r.useEffect(()=>{a!==n.current&&(d(a),n.current=a)},[a]),o.jsxs("div",{className:s.cn("relative p-2",{hidden:!h}),children:[o.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>u(!1),children:[o.jsx(s.X,{className:"mr-2 h-4 w-4"}),"Close"]}),o.jsx("div",{className:"h-[550px] overflow-hidden",children:o.jsx(s.CodeEditor,{value:l,onValueChange:e=>{d(e);try{const c=JSON.parse(e);n.current=JSON.stringify(c,null,2),i(c)}catch{}},language:"json"})})]})}exports.default=b;
@@ -1,9 +1,9 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
2
  import { useMemo as b, useState as f, useRef as m, useEffect as S } from "react";
3
- import { u as e, c as N, B as D, X as p, C as J } from "./index-Cr9Smn6Q.js";
3
+ import { u as e, b as N, B as D, X as p, C as J } from "./index-9z-jMqN8.js";
4
4
  import "react-dom";
5
5
  function x() {
6
- const o = e((s) => s.dashboard), i = e((s) => s.actions.setDashboard), h = e(
6
+ const o = e((s) => s.dashboard), c = e((s) => s.actions.setDashboard), h = e(
7
7
  (s) => s.showDashboardJSON
8
8
  ), l = e(
9
9
  (s) => s.actions.setShowDashboardJSON
@@ -13,14 +13,14 @@ function x() {
13
13
  ), [u, n] = f(a), r = m(a);
14
14
  return S(() => {
15
15
  a !== r.current && (n(a), r.current = a);
16
- }, [a]), /* @__PURE__ */ c(
16
+ }, [a]), /* @__PURE__ */ i(
17
17
  "div",
18
18
  {
19
19
  className: N("relative p-2", {
20
20
  hidden: !h
21
21
  }),
22
22
  children: [
23
- /* @__PURE__ */ c(
23
+ /* @__PURE__ */ i(
24
24
  D,
25
25
  {
26
26
  variant: "secondary",
@@ -45,7 +45,7 @@ function x() {
45
45
  d,
46
46
  null,
47
47
  2
48
- ), i(d);
48
+ ), c(d);
49
49
  } catch {
50
50
  }
51
51
  },