@snagset/server 0.1.54 → 0.1.55
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/app.js +5 -0
- package/dist/app.js.map +1 -1
- package/dist/config.generated.js +2 -1
- package/dist/config.generated.js.map +1 -1
- package/dist/db/migrations/0018_integration_inbound.sql +24 -0
- package/dist/integrations/github.js +17 -0
- package/dist/integrations/github.js.map +1 -1
- package/dist/integrations/jira.js +17 -1
- package/dist/integrations/jira.js.map +1 -1
- package/dist/integrations/linear.js +10 -0
- package/dist/integrations/linear.js.map +1 -1
- package/dist/integrations/outbox.js +2 -2
- package/dist/integrations/outbox.js.map +1 -1
- package/dist/integrations/store.js +51 -2
- package/dist/integrations/store.js.map +1 -1
- package/dist/jobs/set.js +1 -0
- package/dist/jobs/set.js.map +1 -1
- package/dist/net/publicFetch.js +144 -5
- package/dist/net/publicFetch.js.map +1 -1
- package/dist/routes/integrations.js +150 -39
- package/dist/routes/integrations.js.map +1 -1
- package/package.json +1 -1
- package/static/dashboard/assets/{CompositeItem-D7Q5QVvi.js → CompositeItem-CvulL3yx.js} +1 -1
- package/static/dashboard/assets/{CompositeList-w7YcjHbo.js → CompositeList-Cc2N74pm.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-CHiXSDkR.js → ConfirmDialog-U7sGR-7r.js} +1 -1
- package/static/dashboard/assets/{CopyButton-DkXHOvAs.js → CopyButton-BPRG72bK.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-BWEjbC5Z.js → FieldItemContext-BB4olvUX.js} +1 -1
- package/static/dashboard/assets/{InstallTag-DlqXIhqI.js → InstallTag-07IMzmgd.js} +1 -1
- package/static/dashboard/assets/{InstanceRows-DwXLnXU2.js → InstanceRows-2HV0g2Tc.js} +1 -1
- package/static/dashboard/assets/McpTokens-j7R5vQdJ.js +1 -0
- package/static/dashboard/assets/Picker-DWjVDWI6.js +6 -0
- package/static/dashboard/assets/{SaveState-DzX_pKjo.js → SaveState-BhDPRdEB.js} +1 -1
- package/static/dashboard/assets/{_app-B-X6wLWA.js → _app-CmSSR7Fr.js} +1 -1
- package/static/dashboard/assets/{_app-DW5KDMy_.js → _app-CsF903Bg.js} +2 -2
- package/static/dashboard/assets/activity-CiElrW9b.js +1 -0
- package/static/dashboard/assets/{arrow-left-DbWDuhAv.js → arrow-left-BpbzTF1L.js} +1 -1
- package/static/dashboard/assets/{avatar-BL6yPDkc.js → avatar-B1TDu8wQ.js} +1 -1
- package/static/dashboard/assets/{badge-Dybw0_bq.js → badge-DNL0s8ND.js} +1 -1
- package/static/dashboard/assets/{card-DwOk-mSd.js → card-BV6fjgTi.js} +1 -1
- package/static/dashboard/assets/{check-Dfkv0gma.js → check-nWqm4QA9.js} +1 -1
- package/static/dashboard/assets/{chevron-down-BFQamcZy.js → chevron-down-B0SxNOjK.js} +1 -1
- package/static/dashboard/assets/{chevron-right-v0My-Qwf.js → chevron-right-5IvSSfyx.js} +1 -1
- package/static/dashboard/assets/{copy-Bnl05Zl3.js → copy-BlkC45lz.js} +1 -1
- package/static/dashboard/assets/{createBaseUIEventDetails-DviWdj-N.js → createBaseUIEventDetails-DJQs5QD1.js} +1 -1
- package/static/dashboard/assets/{dialog-B1TvUOp8.js → dialog-wNx4TYmI.js} +2 -2
- package/static/dashboard/assets/{dropdown-menu-DQDS-MXM.js → dropdown-menu-Dg6I8B9T.js} +2 -2
- package/static/dashboard/assets/{forgot-B13MZpbf.js → forgot-BskfFbWy.js} +1 -1
- package/static/dashboard/assets/getPseudoElementBounds-BI6SgJKV.js +1 -0
- package/static/dashboard/assets/{image-off-4dn7EbeZ.js → image-off-CmXQl4Bm.js} +1 -1
- package/static/dashboard/assets/index-BQBdFBZG.css +1 -0
- package/static/dashboard/assets/{index-_7kIe8FW.js → index-DJIyUCPa.js} +3 -3
- package/static/dashboard/assets/{inertValue-BSe8K39O.js → inertValue-DFM3yqxg.js} +1 -1
- package/static/dashboard/assets/{invite-nV6ykkp0.js → invite-Gb1SSWEm.js} +1 -1
- package/static/dashboard/assets/{label-BkHFb2_L.js → label-BO35zXgP.js} +1 -1
- package/static/dashboard/assets/{layout-grid-Dt1Q4YQ_.js → layout-grid-DHSlCLw7.js} +1 -1
- package/static/dashboard/assets/me-Bu3DC102.js +1 -0
- package/static/dashboard/assets/{parts-DGVjMHe8.js → parts-Cf55Yb70.js} +1 -1
- package/static/dashboard/assets/{plus-hkwBCzos.js → plus-AlvHtj_r.js} +1 -1
- package/static/dashboard/assets/{reset-BNNJmqWL.js → reset-VLjsnDUf.js} +1 -1
- package/static/dashboard/assets/{s._site-MSdo-oKn.js → s._site-BOIQF8cS.js} +1 -1
- package/static/dashboard/assets/s._site.comments-CTk77ILo.js +49 -0
- package/static/dashboard/assets/s._site.reviewers-C2y2wYcP.js +1 -0
- package/static/dashboard/assets/{s._site.settings-_fxdLl8T.js → s._site.settings-Cp8YeA4h.js} +1 -1
- package/static/dashboard/assets/{setup-Ccth7CNk.js → setup-DZSbxR5u.js} +1 -1
- package/static/dashboard/assets/{sign-in-BeNKRQ7N.js → sign-in-BP-OTd-h.js} +1 -1
- package/static/dashboard/assets/{sign-up-B8239y6x.js → sign-up-Jei-X8L6.js} +1 -1
- package/static/dashboard/assets/{sites-CekL50U1.js → sites-nxU5wRJD.js} +1 -1
- package/static/dashboard/assets/{studio-pysRGF6Z.js → studio-BXjjp00e.js} +1 -1
- package/static/dashboard/assets/studio-C1Um7zxi.js +1 -0
- package/static/dashboard/assets/{studio.index-D1Utbxqz.js → studio.index-5Z2JWyir.js} +1 -1
- package/static/dashboard/assets/studio.integrations-BjFXv6iz.js +16 -0
- package/static/dashboard/assets/studio.members-UOCj4scg.js +6 -0
- package/static/dashboard/assets/{studio.plan-CVZcQmU2.js → studio.plan-CXzTImV1.js} +1 -1
- package/static/dashboard/assets/{sun-Ciy3ROc0.js → sun-DhMBVtvb.js} +1 -1
- package/static/dashboard/assets/{switch-wRlAfGsi.js → switch-BbV1tcPM.js} +1 -1
- package/static/dashboard/assets/{table-Bd53YpCs.js → table-BlJV8zDx.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-Dt1pmXDF.js → useAriaLabelledBy-DfnIJQvt.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-DVrotnH-.js → useBaseQuery-ic0hLoWO.js} +1 -1
- package/static/dashboard/assets/useCompositeItem-Dj-Nx-92.js +1 -0
- package/static/dashboard/assets/useQuery-qBadQDJJ.js +1 -0
- package/static/dashboard/assets/useRender-TrgqqhB3.js +1 -0
- package/static/dashboard/assets/{useScrollLock-DdWilGdG.js → useScrollLock-tzg3KUOw.js} +1 -1
- package/static/dashboard/assets/{useValueChanged-Cm4_pRNG.js → useValueChanged-S18DT6ky.js} +1 -1
- package/static/dashboard/assets/{users-BDCRp6bm.js → users-CklOnVh9.js} +1 -1
- package/static/dashboard/assets/{welcome-CcxTkiVu.js → welcome-DmIcYw0Y.js} +1 -1
- package/static/dashboard/assets/{widget-signin-CpAmvjAU.js → widget-signin-B3lImWqb.js} +1 -1
- package/static/dashboard/assets/you-CIO1vIEc.js +1 -0
- package/static/dashboard/assets/zod-C59-1wE1.js +1 -0
- package/static/dashboard/index.html +2 -2
- package/static/widget/build.json +2 -2
- package/static/widget/snag.capture.js +3 -3
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +1 -1
- package/static/dashboard/assets/McpTokens-BvQnjHcP.js +0 -1
- package/static/dashboard/assets/Picker-CtjWzkpT.js +0 -1
- package/static/dashboard/assets/activity-C8vHHVVs.js +0 -1
- package/static/dashboard/assets/getPseudoElementBounds-Bv3Ra6Wj.js +0 -1
- package/static/dashboard/assets/index-PP-fkxl1.css +0 -1
- package/static/dashboard/assets/me-BDpKAhA-.js +0 -1
- package/static/dashboard/assets/s._site.comments-0jkl72Ja.js +0 -49
- package/static/dashboard/assets/s._site.reviewers-BWi4M9dg.js +0 -1
- package/static/dashboard/assets/select-DjpYopV7.js +0 -6
- package/static/dashboard/assets/studio-5pj2ZjeU.js +0 -1
- package/static/dashboard/assets/studio.integrations-M2aLKrz5.js +0 -1
- package/static/dashboard/assets/studio.members-C9Gigy9Y.js +0 -6
- package/static/dashboard/assets/useCompositeItem-fDEe_Juq.js +0 -1
- package/static/dashboard/assets/useQuery-ClGlUO36.js +0 -1
- package/static/dashboard/assets/useRender-BO4-nlty.js +0 -1
- package/static/dashboard/assets/you-guotGi3r.js +0 -1
- package/static/dashboard/assets/zod-Q9KJcyiZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as y,j as e,t as C,a4 as k,r as c,B as x,S as A,d as E,a5 as F,a2 as O,A as h,a6 as R,s as D,a7 as I}from"./index-
|
|
1
|
+
import{q as y,j as e,t as C,a4 as k,r as c,B as x,S as A,d as E,a5 as F,a2 as O,A as h,a6 as R,s as D,a7 as I}from"./index-DJIyUCPa.js";import{u as p}from"./useQuery-qBadQDJJ.js";import{L as P,I as N}from"./label-BO35zXgP.js";import{I as U,S as L}from"./InstanceRows-2HV0g2Tc.js";import{A as T,P as q,a as f}from"./parts-Cf55Yb70.js";import{u as S}from"./me-Bu3DC102.js";import{S as z}from"./SaveState-BhDPRdEB.js";import{C as B}from"./ConfirmDialog-U7sGR-7r.js";import{b as _}from"./studio-BXjjp00e.js";import{c as M}from"./update-duXzIzFS.js";import"./useBaseQuery-ic0hLoWO.js";import"./createBaseUIEventDetails-DJQs5QD1.js";import"./dialog-wNx4TYmI.js";import"./useScrollLock-tzg3KUOw.js";import"./inertValue-DFM3yqxg.js";import"./card-BV6fjgTi.js";import"./check-nWqm4QA9.js";import"./copy-BlkC45lz.js";function Q(){const t=S(),s=p(h.meta()),o=p(h.members()),a=_(),r=y(t.user.role,"studio"),u=C(t),m=k(t),i=p(h.setupState()),l=!i.data?.billingUrl,d=t.user.role==="owner"?i.data?.closeUrl??null:null,[n,j]=c.useState(t.org.name),[b,w]=c.useState(null);c.useEffect(()=>j(t.org.name),[t.org.name]);const v=r&&n.trim().length>0&&n.trim()!==t.org.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(q,{title:"Studio settings",sub:t.org.name,actions:e.jsx(z,{saving:a.isPending,savedAt:b})}),e.jsx(f,{title:"Studio",description:"The name at the top of every screen.",children:e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:g=>{g.preventDefault(),v&&a.mutate(n.trim(),{onSuccess:()=>w(Date.now())})},children:[e.jsx(P,{htmlFor:"studio-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{id:"studio-name",value:n,readOnly:!r,onChange:g=>j(g.target.value)}),v&&e.jsx(x,{type:"submit",variant:"outline",children:"Save"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:r?"Shown at the top of the sidebar, above every site.":"Only an owner can change it."})]})}),u?e.jsx(f,{title:"This instance",description:"What is running, and where.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Version"}),e.jsxs("dd",{className:"m-0",children:[s.data?.version??"—"," ",e.jsx(G,{version:s.data?.version??""})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Address"}),e.jsx("dd",{className:"m-0",children:e.jsx(H,{owner:r})}),s.data?.commit&&s.data.commit!=="unknown"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Commit"}),e.jsxs("dd",{className:"m-0 font-mono text-[12px] text-ink-soft",children:[s.data.commit.slice(0,12),s.data.modified?" · modified":""]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Sites · members"}),e.jsxs("dd",{className:"m-0",children:[t.projects.length," · ",o.data?.data.length??"—"]})]})]})}):l?e.jsx(f,{title:"This studio",description:"What is in it.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Sites"}),e.jsx("dd",{className:"m-0",children:t.projects.length}),e.jsx("dt",{className:"text-muted-foreground",children:"Members"}),e.jsx("dd",{className:"m-0",children:o.data?.data.length??"—"})]})}):null,m==="instance"?e.jsx(U,{owner:r}):m==="usage"?e.jsx(L,{}):null,d&&e.jsx(W,{url:d,name:t.org.name})]})}function W({url:t,name:s}){const[o,a]=c.useState(!1),[r,u]=c.useState(!1),m=()=>{u(!0);const i=document.createElement("form");i.method="post",i.action=t;for(const[l,d]of[["csrf",I()],["confirm",s]]){const n=document.createElement("input");n.type="hidden",n.name=l,n.value=d,i.append(n)}document.body.append(i),i.submit()};return e.jsxs(f,{danger:!0,title:"Close this studio",description:"Its sites stop, and after a grace period it is erased with everything in it.",children:[e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-4",children:e.jsxs(x,{variant:"outline",className:"border-destructive text-destructive",onClick:()=>a(!0),children:["Close ",s,"…"]})}),e.jsx(B,{open:o,onOpenChange:a,title:`Close ${s}`,description:"Closing stops the studio now and erases it thirty days later.",confirmLabel:"Close this studio",confirmWord:s,busy:r,onConfirm:m,children:e.jsxs("ul",{className:"m-0 flex list-disc flex-col gap-1.5 pl-5 text-[13px] text-ink-soft",children:[e.jsx("li",{children:"Every site stops at once: the widget leaves your clients' pages, nobody can comment, and the dashboard closes for everyone in the studio."}),e.jsx("li",{children:"If the studio pays for a plan, it is cancelled now, with no refund for the rest of the period."}),e.jsx("li",{children:"For thirty days you can reopen it, with every site as it was."}),e.jsx("li",{children:"After that it is erased for good: its sites, threads, comments and screenshots. People who belong to no other studio lose their account with it."})]})})]})}function G({version:t}){const[s,o]=c.useState({s:"idle"});return s.s==="idle"?e.jsxs(e.Fragment,{children:["·"," ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>{o({s:"checking"}),M(t).then(a=>o({s:"done",r:a})).catch(()=>o({s:"failed"}))},children:"Check for updates"})," ",e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"— from your browser, never from the server"})]}):s.s==="checking"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:["· ",e.jsx(A,{className:"size-3"})," checking…"]}):s.s==="failed"?e.jsx("span",{className:"text-muted-foreground",children:"· could not reach npm"}):e.jsx("span",{className:"text-muted-foreground",children:s.r?.newer?`· ${s.r.latest} is out`:"· up to date"})}function H({owner:t}){const s=E(),o=p(h.instance()),[a,r]=c.useState(null),[u,m]=c.useState(""),i=F({mutationFn:n=>D.setAddress(n),onSuccess:n=>{s.setQueryData(h.instance().queryKey,n),r(null),m(""),R.success("Address saved — every new link is built from it")},onError:n=>m(O(n))}),l=o.data?.address;if(!l)return e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:location.origin});const d=l.source==="env";return a===null||!t||d?e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:l.url}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:d?"· set by the environment (SNAGSET_BASE_URL)":l.source==="stored"?"· set at claim; every link is built from it":"· this machine's default"}),t&&!d&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>r(l.url),children:"Change…"})]}):e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:n=>{n.preventDefault(),i.mutate(a.trim())},children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(N,{"aria-label":"Address",value:a,onChange:n=>r(n.target.value),className:"h-8 max-w-[360px] font-mono text-[12px]",autoFocus:!0}),e.jsx(x,{type:"submit",size:"sm",loading:i.isPending,disabled:!a.trim(),children:i.isPending?"Saving…":"Save"}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(null),children:"Cancel"})]}),u&&e.jsx("span",{className:"text-[12px] text-destructive",children:u}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"https:// unless it is this machine; the origin only. Review links, issues and emails are built from it."})]})}const me=()=>y(S().user.role,"settings")?e.jsx(Q,{}):e.jsx(T,{title:"Studio settings"});export{me as component};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{c as K,d as U,r as l,a5 as R,s as F,a6 as E,a8 as S,j as e,B as g,C as xe,h as pe,A as ge,a9 as Ae,q,L as B,t as ce,a2 as de,$ as Fe}from"./index-DJIyUCPa.js";import{P as J}from"./Picker-DWjVDWI6.js";import{u as Q}from"./useQuery-qBadQDJJ.js";import{B as me}from"./badge-DNL0s8ND.js";import{i as Y,j as V,l as X,k as Z,m as ee,n as te}from"./dialog-wNx4TYmI.js";import{I as O,L as _}from"./label-BO35zXgP.js";import{C as $e}from"./ConfirmDialog-U7sGR-7r.js";import{A as Te,P as Pe,a as Ie}from"./parts-Cf55Yb70.js";import{u as fe}from"./me-Bu3DC102.js";import{v as P}from"./useScrollLock-tzg3KUOw.js";import{M as De}from"./McpTokens-j7R5vQdJ.js";import{C as he}from"./CopyButton-BPRG72bK.js";import{C as je}from"./check-nWqm4QA9.js";import"./chevron-down-B0SxNOjK.js";import"./isElementDisabled-CwHw_lZC.js";import"./createBaseUIEventDetails-DJQs5QD1.js";import"./inertValue-DFM3yqxg.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-S18DT6ky.js";import"./getPseudoElementBounds-BI6SgJKV.js";import"./CompositeList-Cc2N74pm.js";import"./useBaseQuery-ic0hLoWO.js";import"./useRender-TrgqqhB3.js";import"./copy-BlkC45lz.js";import"./card-BV6fjgTi.js";import"./switch-BbV1tcPM.js";import"./useAriaLabelledBy-DfnIJQvt.js";/**
|
|
2
|
+
* @license lucide-react v1.39.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 Oe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ee=K("circle-alert",Oe);/**
|
|
7
|
+
* @license lucide-react v1.39.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 Re=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],We=K("eye-off",Re);/**
|
|
12
|
+
* @license lucide-react v1.39.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Le=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_e=K("eye",Le),be="https://snagset.com/docs/integrations/",ue={github:"Repository",linear:"Team",jira:"Project"};function se({id:t,value:o,onChange:c,placeholder:r}){const[m,f]=l.useState(!1);return e.jsxs("div",{className:"relative",children:[e.jsx(O,{id:t,type:m?"text":"password",placeholder:r,value:o,onChange:d=>c(d.target.value),autoComplete:"off",spellCheck:!1,className:"pr-9 font-mono text-[12.5px]"}),e.jsx("button",{type:"button",onClick:()=>f(d=>!d),"aria-label":m?"Hide":"Show","aria-pressed":m,className:"absolute inset-y-0 right-0 flex w-9 items-center justify-center rounded-r-md text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:m?e.jsx(We,{className:"size-4"}):e.jsx(_e,{className:"size-4"})})]})}function ze({at:t}){const o=["Access","Connect","Way back"];return e.jsx("ol",{className:"m-0 flex list-none items-center gap-2 p-0 text-[12px]","aria-label":"Steps",children:o.map((c,r)=>{const m=r+1;return e.jsxs("li",{"aria-current":m===t?"step":void 0,className:"flex items-center gap-2",children:[e.jsx("span",{className:pe("flex size-5 items-center justify-center rounded-full border text-[11px] tabular-nums",m<t&&"border-transparent bg-primary text-primary-foreground",m===t&&"border-primary text-foreground",m>t&&"border-border text-muted-foreground"),children:m<t?e.jsx(je,{className:"size-3"}):m}),e.jsx("span",{className:m===t?"font-medium text-foreground":"text-muted-foreground",children:c}),r<o.length-1&&e.jsx("span",{className:"h-px w-5 bg-border","aria-hidden":!0})]},c)})})}function $({id:t,label:o,hint:c,children:r}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(_,{htmlFor:t,children:o}),r,c&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:c})]})}function ke({children:t}){return e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:t})}function T({href:t,children:o}){return e.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-2",children:o})}const G=t=>t instanceof xe?t.message:"Could not reach the server.";function He({provider:t,jiraSite:o}){const c=t==="github"?[e.jsxs(e.Fragment,{children:["Open ",e.jsx(T,{href:"https://github.com/settings/personal-access-tokens/new",children:"GitHub › Fine-grained tokens › Generate new token"}),"."]}),e.jsx(e.Fragment,{children:"Repository access: only the site's repository. Permissions › Issues: Read and write."}),e.jsx(e.Fragment,{children:"Generate, copy the token, paste it below."})]:t==="linear"?[e.jsxs(e.Fragment,{children:["Open ",e.jsx(T,{href:"https://linear.app/settings/account/security",children:"Linear › Settings › Security & access"}),"."]}),e.jsx(e.Fragment,{children:"Under Personal API keys, make a new key. It acts as you, so you must be in the team."}),e.jsx(e.Fragment,{children:"Copy the key, paste it below."})]:[e.jsxs(e.Fragment,{children:["Open ",e.jsx(T,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:"Atlassian account › Security › API tokens"}),"."]}),e.jsx(e.Fragment,{children:'Create API token — the plain one, not "with scopes". Name it Snagset.'}),e.jsxs(e.Fragment,{children:["Copy it, paste it below with the email you sign in to ",o?o.replace(/^https?:\/\//,""):"Jira"," with."]})];return e.jsx("ol",{className:"m-0 flex list-decimal flex-col gap-1 pl-5 text-[13px] text-muted-foreground",children:c.map((r,m)=>e.jsx("li",{children:r},m))})}function ye({provider:t,site:o,shownSecret:c,target:r,onSecret:m}){const f=U(),d=`${location.origin}/api/v1/integrations/${t}/inbound`,[k]=l.useState(()=>Date.now()),[p,v]=l.useState(""),[j,N]=l.useState(""),u=Q({...ge.integrations(),refetchInterval:3e3}).data?.data.find(a=>a.site===o&&a.provider===t),b=R({mutationFn:a=>F.setWebhookSecret(o,t,a),onSuccess:a=>{N(""),v(""),m(a.webhook.secret??null),f.invalidateQueries({queryKey:["integrations"]}),E.success(t==="linear"?"Signing secret saved":"New secret made — the old one has stopped working")},onError:a=>N(G(a))}),y=u?.lastDeliveryAt?Date.parse(u.lastDeliveryAt):0,w=u?.lastRefusedAt?Date.parse(u.lastRefusedAt):0,x=t==="linear"&&u&&!u.hasWebhookSecret?"nosecret":y?"ok":w?"refused":"waiting",h=x==="ok"&&w>y,s=t==="github"?"GitHub sends a test delivery the moment the webhook is saved.":t==="linear"?`Then move any issue in ${r.label} to another status once.`:`Then move any issue in ${r.label} once.`;return e.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[j&&e.jsx(ke,{children:j}),e.jsx("ol",{className:"m-0 flex list-decimal flex-col gap-1 pl-5 text-[13px] text-muted-foreground",children:t==="github"?e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open"," ",e.jsx(T,{href:r.repo?`https://github.com/${r.repo}/settings/hooks/new`:"https://github.com",children:"the repository's Settings › Webhooks › Add webhook"}),"."]}),e.jsx("li",{children:"Paste the address and the secret below; content type application/json."}),e.jsx("li",{children:'"Let me select individual events" → tick Issues only. Add webhook.'})]}):t==="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open ",e.jsx(T,{href:"https://linear.app/settings/api",children:"Linear › Settings › API"}),", then Webhooks › New webhook."]}),e.jsxs("li",{children:["Paste the address; pick the team ",r.label,"; under data change events tick Issues. Create."]}),e.jsx("li",{children:"Linear shows a signing secret: copy it and paste it below."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open"," ",e.jsx(T,{href:r.jiraSite?`${r.jiraSite}/plugins/servlet/webhooks`:"https://admin.atlassian.com",children:"Jira › Settings › System › WebHooks"})," ","› Create a WebHook. It needs a Jira admin."]}),e.jsx("li",{children:"Paste the address and the secret below."}),e.jsx("li",{children:"Under Issue, tick updated and deleted. Create."})]})}),e.jsxs("dl",{className:"m-0 grid grid-cols-[88px_minmax(0,1fr)] items-center gap-x-3 gap-y-2.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Address"}),e.jsxs("dd",{className:"m-0 flex min-w-0 items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-2 py-1 font-mono text-[12px]","data-testid":"webhook-url",children:d}),e.jsx(he,{text:d,label:"Copy the address"})]}),t!=="linear"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Secret"}),e.jsx("dd",{className:"m-0 flex min-w-0 items-center gap-2",children:c?e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-2 py-1 font-mono text-[12px]","data-testid":"webhook-secret",children:c}),e.jsx(he,{text:c,label:"Copy the secret"})]}):e.jsxs("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 text-muted-foreground",children:["Shown once, when it was made.",e.jsx(g,{type:"button",size:"sm",variant:"outline",loading:b.isPending,onClick:()=>b.mutate(void 0),children:"Make a new secret"})]})})]}),t==="github"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Content type"}),e.jsx("dd",{className:"m-0 font-mono text-[12px]",children:"application/json"})]})]}),c&&e.jsx("p",{className:"m-0 -mt-2 text-[12px] text-muted-foreground",children:"Copy it now: it is not shown again. A new one can be made here any time."}),t==="linear"&&e.jsx($,{id:"wb-secret",label:"Signing secret",hint:u?.hasWebhookSecret?"Saved. Paste a new one to replace it.":"From the webhook Linear just made.",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(se,{id:"wb-secret",value:p,onChange:v,placeholder:"lin_wh_…"})}),e.jsx(g,{type:"button",variant:"outline",disabled:!p.trim(),loading:b.isPending,onClick:()=>b.mutate(p.trim()),children:"Save"})]})}),e.jsxs("div",{role:"status","aria-live":"polite","data-testid":"webhook-check","data-state":x,className:pe("flex items-start gap-2.5 rounded-md border px-3 py-2.5 text-[13px]",x==="ok"&&"border-emerald-500/40 bg-emerald-500/10",x==="refused"&&"border-destructive/40 bg-warn-soft",(x==="waiting"||x==="nosecret")&&"border-border bg-muted/40"),children:[x==="ok"?e.jsx(je,{className:"mt-0.5 size-4 shrink-0 text-emerald-600"}):x==="refused"?e.jsx(Ee,{className:"mt-0.5 size-4 shrink-0 text-destructive"}):e.jsx(Ae,{className:"mt-0.5 size-4 shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none"}),e.jsx("span",{className:"min-w-0",children:x==="ok"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"The webhook works."})," Last delivery ",P(u.lastDeliveryAt),y>=k?", just now.":".",h&&e.jsxs("span",{className:"mt-1 block text-muted-foreground",children:["A later delivery was refused (",P(u.lastRefusedAt),"): ",u.lastRefusedError," If you did not change the secret, it may not have come from ",S[t],"."]})]}):x==="refused"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"A delivery arrived and was refused"})," (",P(u.lastRefusedAt),"). ",u.lastRefusedError,e.jsxs("span",{className:"mt-1 block text-muted-foreground",children:["A refused delivery is unsigned, so it may not be from ",S[t],". Check the delivery log on ",S[t],"'s webhook before changing anything."]})]}):x==="nosecret"?e.jsx(e.Fragment,{children:"Waiting for the signing secret. Without it, Linear's deliveries are refused."}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Waiting for the first delivery."})," ",s]})})]})]})}function Me({provider:t,open:o,onOpenChange:c,sites:r}){const m=U(),f=S[t],[d,k]=l.useState(1),[p,v]=l.useState(""),[j,N]=l.useState(""),[C,u]=l.useState(""),[b,y]=l.useState(""),[w,x]=l.useState(""),[h,s]=l.useState([]),[a,A]=l.useState(""),[n,I]=l.useState(""),[ne,ae]=l.useState(!1),[we,z]=l.useState(null),[ve,ie]=l.useState(""),[oe,W]=l.useState("");l.useEffect(()=>{o||(k(1),v(""),N(""),u(""),y(""),x(""),s([]),A(""),I(""),ae(!1),z(null),ie(""),W(""))},[o]);const D=p||r[0]?.uid||"",L=C.trim().replace(/\/+$/,"").replace(/^(?!https?:\/\/)/,"https://"),Ne=t==="github"?{token:j.trim()}:t==="linear"?{apiKey:j.trim()}:{siteUrl:L,email:b.trim(),apiToken:j.trim()},H=R({mutationFn:()=>F.discoverTracker(t,Ne),onSuccess:i=>{W(""),x(i.who),s(i.options),A(i.options.find(Ce=>Ce.canWrite!==!1)?.value??i.options[0]?.value??""),k(2)},onError:i=>W(G(i))}),M=R({mutationFn:()=>{const i=ne?"thread.created":"manual";return t==="github"?F.connectTracker(D,"github",{repository:a.trim(),token:j.trim(),labels:n.trim(),createOn:i}):t==="linear"?F.connectTracker(D,"linear",{team:a.trim(),apiKey:j.trim(),createOn:i}):F.connectTracker(D,"jira",{siteUrl:L,project:a.trim(),email:b.trim(),apiToken:j.trim(),createOn:i})},onSuccess:i=>{W(""),N(""),z(i.webhook?.secret??null),ie(D),m.invalidateQueries({queryKey:["integrations"]}),E.success(`${f} connected`),k(3)},onError:i=>W(G(i))}),re=!!D&&!!j.trim()&&(t!=="jira"||!!C.trim()&&!!b.trim()),le=h.find(i=>i.value===a),Se=le?.label??a;return e.jsx(Y,{open:o,onOpenChange:c,children:e.jsx(V,{className:"sm:max-w-[560px]",children:e.jsxs("form",{className:"flex min-w-0 flex-col gap-4",noValidate:!0,onSubmit:i=>{i.preventDefault(),d===1&&re?H.mutate():d===2&&a.trim()?M.mutate():d===3&&c(!1)},children:[e.jsxs(X,{children:[e.jsxs(Z,{children:["Connect a site to ",f]}),e.jsxs(ee,{children:[d===1?`Give Snagset access to ${f}. The key is checked now and stored encrypted with this instance's secret key.`:d===2?`Signed in to ${f}${w?` as ${w}`:""}. Choose where this site's comments go.`:`Connected. Now the way back: a webhook, so that moving an issue in ${f} moves the comment here.`," ",e.jsx(T,{href:`${be}#${t}`,children:"Step-by-step guide"})]})]}),e.jsx(ze,{at:d}),oe&&d!==3&&e.jsx(ke,{children:oe}),d===1&&e.jsxs(e.Fragment,{children:[e.jsx($,{id:"ct-site",label:"Site",children:e.jsx(J,{id:"ct-site",value:D,onChange:v,options:r.map(i=>({value:i.uid,label:i.name}))})}),e.jsx(He,{provider:t,jiraSite:L}),t==="jira"&&e.jsxs(e.Fragment,{children:[e.jsx($,{id:"ct-jira-site",label:"Jira site",hint:"The address you open Jira at.",children:e.jsx(O,{id:"ct-jira-site",placeholder:"https://kilnwork.atlassian.net",value:C,onChange:i=>u(i.target.value),autoComplete:"off"})}),e.jsx($,{id:"ct-email",label:"Account email",children:e.jsx(O,{id:"ct-email",type:"email",placeholder:"you@kilnwork.studio",value:b,onChange:i=>y(i.target.value),autoComplete:"off"})})]}),e.jsx($,{id:"ct-token",label:t==="github"?"Token":t==="linear"?"API key":"API token",children:e.jsx(se,{id:"ct-token",value:j,onChange:N,placeholder:t==="github"?"github_pat_…":t==="linear"?"lin_api_…":""})})]}),d===2&&e.jsxs(e.Fragment,{children:[h.length>0?e.jsx($,{id:"ct-target",label:ue[t],hint:le?.canWrite===!1?"This token can only read that repository: give it Issues › Read and write, or pick another.":t==="jira"?"Jira calls these spaces; the key in brackets is the prefix on its issues.":void 0,children:e.jsx(J,{id:"ct-target",value:a,onChange:A,options:h.map(i=>({value:i.value,label:i.label}))})}):e.jsx($,{id:"ct-target",label:ue[t],hint:`${f} listed nothing this key can see. Type it instead: ${t==="github"?"owner/name":"the prefix on its issues, like ENG"}.`,children:e.jsx(O,{id:"ct-target",value:a,onChange:i=>A(i.target.value),autoComplete:"off"})}),t==="github"&&e.jsx($,{id:"ct-labels",label:"Labels",hint:"Optional, comma-separated. Put on every issue Snagset opens.",children:e.jsx(O,{id:"ct-labels",placeholder:"review",value:n,onChange:i=>I(i.target.value),autoComplete:"off"})}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-3 py-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:ne,onChange:i=>ae(i.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off: you make an issue from a comment's brief when you mean it. On: every new comment opens one."})]})]})]}),d===3&&e.jsx(ye,{provider:t,site:ve,shownSecret:we,onSecret:z,target:{label:Se,...t==="jira"?{jiraSite:L}:{},...t==="github"?{repo:a}:{}}}),e.jsxs(te,{children:[d===1&&e.jsxs(e.Fragment,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:H.isPending,disabled:!re,children:H.isPending?"Checking…":"Check access"})]}),d===2&&e.jsxs(e.Fragment,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>k(1),children:"Back"}),e.jsx(g,{type:"submit",loading:M.isPending,disabled:!a.trim(),children:M.isPending?"Connecting…":"Connect"})]}),d===3&&e.jsx(g,{type:"submit",children:"Done"})]})]})})})}function qe({state:t,onClose:o}){const[c,r]=l.useState(null);return l.useEffect(()=>{t||r(null)},[t]),e.jsx(Y,{open:t!==null,onOpenChange:m=>!m&&o(),children:e.jsx(V,{className:"sm:max-w-[560px]",children:t&&e.jsxs(e.Fragment,{children:[e.jsxs(X,{children:[e.jsxs(Z,{children:[S[t.provider]," webhook for ",t.siteName]}),e.jsxs(ee,{children:["The way back: moving an issue in ",S[t.provider]," moves the comment here. ",e.jsx(T,{href:`${be}#${t.provider}`,children:"Step-by-step guide"})]})]}),e.jsx(ye,{provider:t.provider,site:t.site,shownSecret:c,onSecret:r,target:t.target}),e.jsx(te,{children:e.jsx(g,{type:"button",onClick:o,children:"Done"})})]})})})}const Be={ok:{label:"Healthy",tone:"ok"},needs_reauth:{label:"Needs a new token",tone:"bad"},error:{label:"Failing",tone:"bad"}};function Je(){const t=fe(),o=q(t.user.role,"settings"),c=q(t.user.role,"studio")&&ce(t),r=Q(ge.integrations()),m=U(),f=()=>m.invalidateQueries({queryKey:["integrations"]}),[d,k]=l.useState(null),[p,v]=l.useState(null),[j,N]=l.useState(null),C=R({mutationFn:({uid:s,provider:a})=>F.testTracker(s,a).then(A=>({...A,provider:a})),onSuccess:s=>{E[s.ok?"success":"error"](s.ok?`${S[s.provider]} can see ${s.target}`:s.detail??`${S[s.provider]} refused the token`),f()},onError:s=>E.error(de(s))}),u=R({mutationFn:({uid:s,provider:a})=>F.disconnectTracker(s,a),onSuccess:()=>{v(null),f()},onError:s=>E.error(de(s))}),b=r.data?.data??[],y=s=>b.filter(a=>a.provider===s),w=t.projects.filter(s=>!s.archived&&!s.locked),x=s=>w.filter(a=>!y(s).some(A=>A.site===a.uid)),h=o?t.limits.integrations?w.length===0?"site":null:"plan":null;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(Pe,{title:"Integrations",sub:"Your coding agent first, then the trackers that mirror a comment's status, then Slack, which only announces"}),e.jsx(De,{owner:o,instanceOwner:c,operator:ce(t),sites:t.projects}),h&&e.jsxs("div",{role:"note",className:"flex max-w-[1040px] flex-wrap items-center gap-x-4 gap-y-2 rounded-lg border border-border bg-muted/40 px-4 py-3 text-[13px]",children:[e.jsx("span",{className:"min-w-0 flex-1",children:h==="plan"?t.user.role==="owner"?"This studio's plan does not include integrations. A plan that does lets you connect each site to GitHub, Linear, Jira and Slack.":"This studio's plan does not include integrations. An owner can change the plan.":t.projects.length===0?"An integration connects one site to one repository, team, project or channel. Add a site first, then connect it here.":"An integration connects one site at a time, and every site here is archived or read-only. Restore one, or add a site, then connect it here."}),h==="plan"?t.user.role==="owner"&&e.jsx(g,{variant:"outline",size:"sm",render:e.jsx(B,{to:"/studio/plan"}),children:"See plans"}):e.jsx(g,{variant:"outline",size:"sm",render:e.jsx(B,{to:"/sites"}),children:"Go to Sites"})]}),["github","linear","jira","slack"].map(s=>{const a=y(s),A=x(s);return e.jsxs(Ie,{title:S[s],description:s==="github"?"A comment becomes an issue in the site's repository, with the brief as its body; resolving it here closes the issue there, and closing it there resolves it here. A fine-grained token per site — no OAuth app to register.":s==="linear"?"A comment becomes an issue in the site's team, with the brief as its body; our status moves it between the team's workflow states by type, and a webhook from Linear moves it back. A personal API key per site — no OAuth app to register.":s==="jira"?"A comment becomes an issue in the site's Jira project, with the brief as its description; our status moves it through the workflow by status category, and a webhook from Jira moves it back. An API token with the account's email — what Atlassian gives a self-hoster.":"One message per comment in a channel, edited in place as the status moves — never a second message, never a reply. A bot token from an app you create in a click from our manifest; Slack sends nothing back.",children:[r.isPending&&e.jsx(Fe,{rows:2}),r.isSuccess&&a.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(me,{variant:"outline",children:"Not connected"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:s==="github"?"No site is connected to a repository yet.":s==="linear"?"No site is connected to a team yet.":s==="jira"?"No site is connected to a project yet.":"No site is connected to a channel yet."})]}),a.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:a.map(n=>{const I=Be[n.health]??{label:n.health,tone:"warn"};return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px]",children:[e.jsx("span",{className:"font-medium",children:n.siteName??n.site}),e.jsx("span",{className:"text-muted-foreground",children:"→"}),e.jsx("code",{className:"font-mono text-[12.5px]",children:n.provider==="github"?`${n.owner}/${n.repo}`:n.provider==="linear"?`${n.teamKey} · ${n.teamName}`:n.provider==="jira"?`${n.projectKey} · ${n.projectName}`:`#${n.channelName} · ${n.teamName}`}),e.jsx(me,{variant:"outline",className:I.tone==="ok"?"border-ok text-ok":I.tone==="bad"?"border-destructive text-destructive":"",children:I.label}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[n.provider==="slack"?n.createOn==="thread.created"?"A message for every new comment":"Messages when you ask, from the brief":n.createOn==="thread.created"?"An issue for every new comment":"Issues when you ask, from the brief",n.provider==="github"&&n.labels.length?` · labels ${n.labels.join(", ")}`:""," · ",P(n.updatedAt)]}),n.provider!=="slack"&&e.jsx(Ke,{r:n}),n.lastError&&e.jsx("span",{className:"basis-full text-[12px] text-destructive",children:n.lastError}),o&&e.jsxs("span",{className:"ml-auto flex gap-1",children:[n.provider!=="slack"&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>N({provider:n.provider,site:n.site,siteName:n.siteName??n.site,target:n.provider==="github"?{label:`${n.owner}/${n.repo}`,repo:`${n.owner}/${n.repo}`}:n.provider==="linear"?{label:n.teamName}:{label:n.projectName,jiraSite:n.siteUrl}}),children:"Webhook…"}),e.jsx(g,{variant:"ghost",size:"sm",loading:C.isPending,onClick:()=>C.mutate({uid:n.site,provider:n.provider}),children:"Test"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>v(n),children:"Disconnect"})]})]},`${n.provider}:${n.site}`)})}),o&&!h&&A.length>0&&e.jsx("div",{children:e.jsx(g,{variant:"outline",size:"sm",onClick:()=>k(s),children:"Connect a site…"})})]},s)}),["github","linear","jira"].map(s=>e.jsx(Me,{provider:s,open:d===s,onOpenChange:a=>!a&&k(null),sites:x(s)},s)),e.jsx(Ge,{open:d==="slack",onOpenChange:s=>!s&&k(null),sites:x("slack"),onDone:()=>void f()}),e.jsx(qe,{state:j,onClose:()=>N(null)}),e.jsx($e,{open:p!==null,onOpenChange:s=>!s&&v(null),title:`Disconnect ${p?.siteName??"this site"} from ${p?S[p.provider]:"the tracker"}?`,description:p?.provider==="slack"?e.jsx(e.Fragment,{children:"Messages already posted stay in the channel; no new ones are posted and they stop being updated. The token is forgotten."}):e.jsx(e.Fragment,{children:"Issues already made keep their links; no new ones are made and status stops mirroring. The token is forgotten."}),confirmLabel:"Disconnect",busy:u.isPending,onConfirm:async()=>{p&&await u.mutateAsync({uid:p.site,provider:p.provider})}})]})}function Ge({open:t,onOpenChange:o,sites:c,onDone:r}){const[m,f]=l.useState(""),[d,k]=l.useState(""),[p,v]=l.useState(""),[j,N]=l.useState(!0),[C,u]=l.useState(""),b=Q({queryKey:["integrations","slack","manifest"],queryFn:()=>F.slackManifest(),enabled:t,staleTime:1/0}),y=R({mutationFn:h=>F.connectTracker(h,"slack",{channel:d.trim(),token:p.trim(),createOn:j?"thread.created":"manual"})}),w=m||c[0]?.uid||"",x=async h=>{h.preventDefault(),u("");try{await y.mutateAsync(w),k(""),v(""),N(!0),o(!1),r(w),E.success("Slack connected")}catch(s){u(s instanceof xe?s.message:"Could not reach the server.")}};return e.jsx(Y,{open:t,onOpenChange:o,children:e.jsx(V,{children:e.jsxs("form",{onSubmit:h=>void x(h),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(X,{children:[e.jsx(Z,{children:"Connect a site to Slack"}),e.jsx(ee,{children:"Create the app in your workspace from our manifest — one click, the scopes are filled in — install it, and paste its Bot User OAuth Token. The token is checked against the channel before it is saved, and stored encrypted with this instance's secret key."})]}),C&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:C}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(_,{htmlFor:"sl-site",children:"Site"}),e.jsx(J,{id:"sl-site",value:w,onChange:f,options:c.map(h=>({value:h.uid,label:h.name}))})]}),e.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border px-3 py-2 text-[13px]",children:[e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block font-medium",children:"1. Create the app"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Opens api.slack.com with the manifest pasted; then Install to Workspace."})]}),e.jsx(g,{type:"button",variant:"outline",size:"sm",disabled:!b.data,render:e.jsx("a",{href:b.data?.url??"#",target:"_blank",rel:"noreferrer"}),children:"Create app…"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(_,{htmlFor:"sl-token",children:"2. Bot User OAuth Token"}),e.jsx(se,{id:"sl-token",placeholder:"xoxb-…",value:p,onChange:v}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"On the app's OAuth & Permissions page after installing."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(_,{htmlFor:"sl-channel",children:"3. Channel"}),e.jsx(O,{id:"sl-channel",placeholder:"#reviews",value:d,onChange:h=>k(h.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"A public channel by name; a private one needs the app invited first, then its name works too."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:j,onChange:h=>N(h.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"A message for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"On by default: a channel is where people are told. Turn it off to post from the brief when you mean it."})]})]}),e.jsxs(te,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:y.isPending,disabled:!d.trim()||!p.trim()||!w,children:y.isPending?"Checking…":"Connect"})]})]})})})}function Ke({r:t}){const o=S[t.provider];if(t.lastDeliveryAt){const c=t.lastRefusedAt&&Date.parse(t.lastRefusedAt)>Date.parse(t.lastDeliveryAt);return e.jsxs("span",{className:"basis-full text-[12px] text-muted-foreground",children:["Webhook works · last delivery ",P(t.lastDeliveryAt),c?` · a later one was refused ${P(t.lastRefusedAt)}`:""]})}return t.lastRefusedAt?e.jsxs("span",{className:"basis-full text-[12px] text-destructive",children:["Webhook refused ",P(t.lastRefusedAt),": ",t.lastRefusedError," Unsigned, so check ",o,"'s webhook log first."]}):t.provider==="linear"&&!t.hasWebhookSecret?e.jsxs("span",{className:"basis-full text-[12px] text-muted-foreground",children:["No webhook yet, so ",o," cannot move comments here. Webhook… sets it up."]}):e.jsx("span",{className:"basis-full text-[12px] text-muted-foreground",children:"No webhook delivery seen yet. Webhook… shows how to set it up."})}const yt=()=>q(fe().user.role,"settings")?e.jsx(Je,{}):e.jsx(Te,{title:"Integrations",children:e.jsxs("p",{className:"m-0",children:["Connecting a site to GitHub, Linear, Jira or Slack is done by an owner or an admin. Your own agent tokens are on"," ",e.jsx(B,{to:"/you",className:"text-brand hover:underline",children:"You"}),"."]})});export{yt as component};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as W,q as M,j as e,ab as X,r as f,B as h,ac as g,ad as P,a2 as C,I as J,D as K,ae as Z,af as ee,ag as se,F as te,A as S}from"./index-DJIyUCPa.js";import{u as k}from"./useQuery-qBadQDJJ.js";import{u as ae,a as ie,C as ne}from"./zod-C59-1wE1.js";import{S as le,a as re,b as oe,c as me,d as de,P as ce}from"./Picker-DWjVDWI6.js";import{A as xe,a as he}from"./avatar-B1TDu8wQ.js";import{B as ue}from"./badge-DNL0s8ND.js";import{C as E}from"./card-BV6fjgTi.js";import{X as pe,i as je,j as fe,l as R,k as A,m as I,n as D}from"./dialog-wNx4TYmI.js";import{L,I as ge}from"./label-BO35zXgP.js";import{T,a as $,b as v,c,d as B,e as x}from"./table-BlJV8zDx.js";import{C as ve}from"./ConfirmDialog-U7sGR-7r.js";import{C as be}from"./CopyButton-BPRG72bK.js";import{A as ye,P as we,b as Ne}from"./parts-Cf55Yb70.js";import{u as O}from"./me-Bu3DC102.js";import{s as Ce}from"./useScrollLock-tzg3KUOw.js";import{c as Se,d as ke,e as Re,f as Ae,g as Ie}from"./studio-BXjjp00e.js";import{P as De}from"./plus-AlvHtj_r.js";import"./useBaseQuery-ic0hLoWO.js";import"./chevron-down-B0SxNOjK.js";import"./check-nWqm4QA9.js";import"./isElementDisabled-CwHw_lZC.js";import"./createBaseUIEventDetails-DJQs5QD1.js";import"./inertValue-DFM3yqxg.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-S18DT6ky.js";import"./getPseudoElementBounds-BI6SgJKV.js";import"./CompositeList-Cc2N74pm.js";import"./useRender-TrgqqhB3.js";import"./copy-BlkC45lz.js";/**
|
|
2
|
+
* @license lucide-react v1.39.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 Le=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Me=W("mail",Le);function Pe(){const s=O(),l=M(s.user.role,"people"),n=X(s.user.role),d=k(S.members()),t=k(S.invites()),[m,a]=f.useState(!1),r=s.limits.members.limit,i=r!==null&&s.limits.members.used>=r;return e.jsxs("div",{className:"p-7",children:[e.jsx(we,{title:"Members",sub:`${l?"Only owners change roles or remove people.":"Admins invite members. Ask an owner to change a role or remove someone."}${r!==null?` ${s.limits.members.used} of ${r} members.`:""}`,actions:n.length?e.jsxs(h,{onClick:()=>a(!0),disabled:i,title:i?`This studio's plan allows ${r} members.`:void 0,children:[e.jsx(De,{}),"Invite"]}):void 0}),e.jsx(E,{className:"max-w-[1040px] overflow-hidden py-0",children:e.jsxs(T,{children:[e.jsx($,{children:e.jsxs(v,{children:[e.jsx(c,{children:"Name"}),e.jsx(c,{children:"Email"}),e.jsx(c,{children:"Role"}),l&&e.jsx(c,{className:"w-0"})]})}),e.jsx(B,{children:(d.data?.data??[]).map(p=>e.jsx($e,{m:p,owner:l},p.email))})]})}),e.jsx(Ee,{}),(t.data?.data.length??0)>0&&e.jsx(Te,{invites:t.data.data,roles:n}),e.jsxs("p",{className:"m-0 mt-3 max-w-[1040px] text-[12.5px] text-muted-foreground",children:["People join through an invite link and choose their own password. A forgotten one is reset on the server with ",e.jsx("code",{className:"font-mono text-[12px]",children:"snagset passwd"}),"."]}),n.length>0&&e.jsx(Oe,{open:m,onOpenChange:a,mail:t.data?.mail??!1,roles:n})]})}const z=s=>new Date(s).toLocaleDateString(void 0,{day:"numeric",month:"short"}),b={owner:"Owner",admin:"Admin",member:"Member"};function Ee(){return e.jsx("dl",{className:"m-0 mt-3 grid max-w-[1040px] grid-cols-[70px_1fr] gap-x-3 gap-y-1 text-[12.5px]","aria-label":"Roles",children:g.map(s=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"font-medium",children:b[s]}),e.jsx("dd",{className:"m-0 text-muted-foreground",children:P[s]})]},s))})}function Te({invites:s,roles:l}){const n=Re(),d=l.length>0;return e.jsxs("section",{className:"mt-6 max-w-[1040px]","aria-labelledby":"pending-invites",children:[e.jsx("div",{id:"pending-invites",className:"mb-2",children:e.jsx(Ne,{children:"Pending invites"})}),e.jsx(E,{className:"overflow-hidden py-0",children:e.jsxs(T,{children:[e.jsx($,{children:e.jsxs(v,{children:[e.jsx(c,{children:"For"}),e.jsx(c,{children:"Role"}),e.jsx(c,{children:"Invited by"}),e.jsx(c,{children:"Expires"}),d&&e.jsx(c,{className:"w-0"})]})}),e.jsx(B,{children:s.map(t=>e.jsxs(v,{children:[e.jsx(x,{className:t.email?"":"text-muted-foreground",children:t.email??"Anyone with the link"}),e.jsx(x,{className:"capitalize",children:t.role}),e.jsx(x,{className:"text-muted-foreground",children:t.createdBy?t.createdBy.name||t.createdBy.email:"—"}),e.jsx(x,{className:"text-muted-foreground",children:z(t.expiresAt)}),d&&e.jsx(x,{className:"text-right",children:l.includes(t.role)&&e.jsx(h,{variant:"ghost",size:"sm","aria-label":`Revoke the invite for ${t.email??"anyone with the link"}`,disabled:n.isPending&&n.variables===t.id,onClick:()=>n.mutate(t.id),children:"Revoke"})})]},t.id))})]})})]})}function $e({m:s,owner:l}){const n=Se(),d=ke(),[t,m]=f.useState(!1);return e.jsxs(v,{children:[e.jsx(x,{children:e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx(xe,{className:"size-6",children:e.jsx(he,{className:"bg-brand-soft text-[10px] font-semibold text-brand",children:Ce(s.name,s.email)})}),e.jsx("span",{className:"font-medium",children:s.name||s.email}),s.you&&e.jsx(ue,{variant:"outline",className:"text-[11px]",children:"you"})]})}),e.jsx(x,{className:"text-muted-foreground",children:s.email}),e.jsx(x,{children:l?e.jsxs(le,{items:g.map(a=>({value:a,label:b[a]})),value:s.role,onValueChange:a=>a&&a!==s.role&&n.mutate({email:s.email,role:a}),children:[e.jsx(re,{size:"sm","aria-label":`Role for ${s.email}`,className:"min-w-[104px] bg-card",children:e.jsx(oe,{})}),e.jsx(me,{children:g.map(a=>e.jsx(de,{value:a,children:b[a]},a))})]}):e.jsx("span",{className:"capitalize",children:s.role})}),l&&e.jsxs(x,{className:"text-right",children:[!s.you&&e.jsx(h,{variant:"ghost",size:"icon-sm","aria-label":`Remove ${s.email}`,onClick:()=>m(!0),children:e.jsx(pe,{})}),e.jsx(ve,{open:t,onOpenChange:m,title:`Remove ${s.name||s.email}?`,description:"Every session of theirs ends now. Nothing they wrote is destroyed.",confirmLabel:"Remove",busy:d.isPending,onConfirm:()=>{m(!1),d.mutate(s.email)}})]})]})}const Be=K({email:ee([se(""),te().trim().email("An email address, or leave it empty")]),role:Z(g)});function Oe({open:s,onOpenChange:l,mail:n,roles:d}){const t=Ae(),m=Ie(),[a,r]=f.useState(""),[i,p]=f.useState(null),[w,N]=f.useState(null),{register:F,handleSubmit:_,formState:j,reset:q,watch:H,control:V}=ae({resolver:ie(Be),defaultValues:{role:"member",email:""}}),G=H("role"),y=o=>{l(o),o||(p(null),N(null),r(""),m.reset(),q())},Y=_(async o=>{r("");try{p(await t.mutateAsync({role:o.role,...o.email?{email:o.email}:{}}))}catch(u){r(C(u))}}),Q=async()=>{if(i){r("");try{N((await m.mutateAsync({id:i.invite.id,token:i.token})).to)}catch(o){r(C(o))}}},U=(i?.mail??n)&&!!i?.invite.email;return e.jsx(je,{open:s,onOpenChange:y,children:e.jsx(fe,{children:i?e.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[e.jsxs(R,{children:[e.jsx(A,{children:"Invite link"}),e.jsxs(I,{children:[i.invite.email?`${i.invite.email} can`:"Anyone with this link can"," join as ",J(i.invite.role)," ","until ",z(i.invite.expiresAt),". It works once, and this is the only time it is shown."]})]}),a&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:a}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"invite-url",children:i.url}),e.jsx(be,{text:i.url,label:"Copy link",withText:!0})]}),U&&(w?e.jsxs("p",{role:"status",className:"m-0 text-[13px] [overflow-wrap:anywhere] text-muted-foreground",children:["Sent to ",w,"."]}):e.jsxs(h,{type:"button",variant:"outline",className:"max-w-full min-w-0 self-start",title:i.invite.email?`Send by email to ${i.invite.email}`:void 0,loading:m.isPending,onClick:()=>void Q(),children:[e.jsx(Me,{}),e.jsx("span",{className:"min-w-0 truncate",children:m.isPending?"Sending…":`Send by email to ${i.invite.email}`})]})),e.jsx(D,{children:e.jsx(h,{type:"button",onClick:()=>y(!1),children:"Done"})})]}):e.jsxs("form",{onSubmit:Y,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(A,{children:"Invite someone"}),e.jsx(I,{children:"You get a link to send them. Whoever opens it chooses their own name and password, and is signed in. It works once and lasts seven days."})]}),a&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:a}),e.jsxs("fieldset",{disabled:j.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(L,{htmlFor:"invite-role",children:"Role"}),e.jsx(ne,{control:V,name:"role",render:({field:o})=>e.jsx(ce,{id:"invite-role",value:o.value,onChange:o.onChange,options:["member","admin","owner"].filter(u=>d.includes(u)).map(u=>({value:u,label:b[u]}))})}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground","data-testid":"invite-role-summary",children:P[G]??""})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(L,{htmlFor:"invite-email",children:["Email ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(ge,{id:"invite-email",type:"email",autoComplete:"off","aria-invalid":!!j.errors.email,...F("email")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:j.errors.email?.message??(n?"Given, only that address can use the link, and you can mail it to them.":"Given, only that address can use the link.")})]}),e.jsxs(D,{children:[e.jsx(h,{type:"button",variant:"outline",onClick:()=>y(!1),children:"Cancel"}),e.jsx(h,{type:"submit",loading:j.isSubmitting,children:j.isSubmitting?"Creating…":"Create invite"})]})]})]})})})}const us=()=>M(O().user.role,"settings")?e.jsx(Pe,{}):e.jsx(ye,{title:"Members"});export{us as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,
|
|
1
|
+
import{j as e,ah as Y,r as d,p as M,d as A,A as $,S as B,h as m,B as P}from"./index-DJIyUCPa.js";import{u as _}from"./useQuery-qBadQDJJ.js";import{b as j}from"./InstanceRows-2HV0g2Tc.js";import{A as D,P as K}from"./parts-Cf55Yb70.js";import{u as y}from"./me-Bu3DC102.js";import{C as U}from"./check-nWqm4QA9.js";import"./useBaseQuery-ic0hLoWO.js";import"./dialog-wNx4TYmI.js";import"./useScrollLock-tzg3KUOw.js";import"./inertValue-DFM3yqxg.js";import"./createBaseUIEventDetails-DJQs5QD1.js";import"./label-BO35zXgP.js";import"./ConfirmDialog-U7sGR-7r.js";import"./copy-BlkC45lz.js";import"./card-BV6fjgTi.js";function L(){const s=y(),{said:r}=Y.useSearch(),[a,o]=d.useState(r),[c]=d.useState(()=>Date.now()),u=M(),p=A();d.useEffect(()=>{r&&u({to:"/studio/plan",search:{},replace:!0})},[r,u]);const w=_($.setupState()),i=w.data?.billingUrl??null,v=_({queryKey:["plan-state",i],enabled:!!i,refetchInterval:()=>a&&Date.now()-c<3e4?3e3:!1,queryFn:async()=>{const t=await fetch(`${i.replace(/\/+$/,"")}/state`,{credentials:"include",headers:{accept:"application/json"}});if(!t.ok)throw new Error(String(t.status));return await t.json()}}),n=v.data,b=d.useRef(null),f=n?.current?.name??null;d.useEffect(()=>{f&&(b.current===null?b.current=f:f!==b.current&&(o(void 0),p.invalidateQueries({queryKey:$.me().queryKey})))},[f,p]);const[h,R]=d.useState(!1),q=!!n?.plans.some(t=>t.yearly),S=n?.plans.find(t=>t.current);return e.jsxs("div",{className:"flex flex-col gap-8 p-7",children:[e.jsx(K,{title:"Plan & billing",sub:s.org.name}),a&&e.jsx("p",{role:"status",className:"m-0 max-w-[1040px] rounded-md border border-border bg-card px-3 py-2 text-[13px]",children:a}),w.isSuccess&&!i?e.jsx("p",{className:"m-0 text-muted-foreground",children:"This instance has no plans: everything is included."}):v.isError?e.jsx("p",{className:"m-0 text-muted-foreground",children:"The plans could not be loaded. Reload to try again."}):n?e.jsxs("div",{className:"flex max-w-[1040px] flex-col",children:[e.jsxs("section",{"aria-label":"Your plan",className:"grid grid-cols-1 gap-5 rounded-xl border border-border bg-card px-6 py-5 sm:grid-cols-[minmax(0,1fr)_auto]",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"m-0 text-[11.5px] font-medium uppercase tracking-wider text-muted-foreground",children:"Your plan"}),e.jsxs("p",{className:"m-0 mt-1 text-[28px] font-bold leading-tight",children:[n.current?.name??S?.name,e.jsx("span",{className:"ml-2 text-[15px] font-normal text-muted-foreground",children:n.current?.price??S?.price})]}),n.current?.period&&e.jsx("p",{className:"m-0 mt-1 text-[13px] text-ink-soft",children:n.current.period})]}),n.manage&&e.jsx("div",{children:e.jsx(g,{base:i,form:n.manage})}),e.jsx("div",{className:"sm:col-span-2",children:e.jsx(Q,{})}),n.current?.warning&&e.jsx("p",{role:"status",className:"m-0 rounded-md bg-warn-soft px-3.5 py-2.5 text-[13px] sm:col-span-2",children:n.current.warning}),n.nudge&&e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-lg bg-brand-soft px-3.5 py-2.5 sm:col-span-2",children:[e.jsx("p",{className:"m-0 min-w-[220px] flex-1 text-[13px]",children:n.nudge.text}),e.jsx(g,{base:i,form:n.nudge.action})]})]}),e.jsxs("div",{className:"mb-4 mt-9 flex flex-wrap items-center justify-between gap-3",children:[e.jsx("h2",{id:"compare",className:"m-0 text-[17px] font-semibold",children:"Compare plans"}),q&&e.jsx("div",{role:"radiogroup","aria-label":"Billing period",className:"inline-flex rounded-full border border-border bg-card p-0.5",children:[!1,!0].map(t=>e.jsx("button",{type:"button",role:"radio","aria-checked":h===t,onClick:()=>R(t),className:m("rounded-full px-3.5 py-1 text-[13px]",h===t?"bg-foreground text-background":"text-ink-soft"),children:t?e.jsxs(e.Fragment,{children:["Yearly ",e.jsx("span",{className:m("font-medium",h?"opacity-80":"text-brand"),children:"2 months free"})]}):"Monthly"},String(t)))})]}),e.jsx("div",{"aria-labelledby":"compare",className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:n.plans.map(t=>{const x=h&&t.yearly?t.yearly:null,k=x?x.actions:t.actions,E=t.relation==="downgrade";return e.jsxs("div",{className:m("relative flex min-w-0 flex-col gap-4 rounded-xl border bg-card p-5",t.recommended?"border-brand shadow-[0_0_0_1px_var(--color-brand),0_10px_30px_rgb(61_97_217/.12)]":"border-border"),children:[(t.current||t.recommended)&&e.jsx("span",{className:m("absolute -top-2.5 left-5 rounded-full px-2.5 py-px text-[11.5px] font-semibold",t.current?"bg-foreground text-background":"bg-brand text-white"),children:t.current?"Your plan":"Recommended"}),e.jsxs("div",{children:[e.jsx("h3",{className:"m-0 text-[16px] font-semibold",children:t.name}),t.pitch&&e.jsx("p",{className:"m-0 mt-0.5 text-[13px] text-muted-foreground",children:t.pitch})]}),e.jsxs("p",{className:"m-0 text-[34px] font-bold leading-none tracking-tight",children:[x?.amount??t.amount??t.price,(x?.unit??t.unit)&&e.jsx("span",{className:"ml-1 text-[13px] font-normal tracking-normal text-muted-foreground",children:x?.unit??t.unit})]}),e.jsx("ul",{className:"m-0 flex flex-1 list-none flex-col gap-2 p-0",children:t.features.map(l=>e.jsxs("li",{className:m("flex gap-2 text-[13.5px]",t.added?.includes(l)&&"font-semibold"),children:[e.jsx(U,{className:"mt-0.5 size-4 shrink-0 text-ok","aria-hidden":!0}),l]},l))}),t.current?e.jsx(P,{type:"button",variant:"outline",disabled:!0,className:"w-full",children:"Current plan"}):E?k.map(l=>e.jsx(O,{base:i,form:l,warning:t.warning??null},l.label)):k.map(l=>e.jsx(g,{base:i,form:{...l,primary:!!t.recommended||l.primary},wide:!0},l.label))]},t.id)})}),e.jsxs("p",{className:"m-0 mt-5 text-center text-[13px] text-muted-foreground",children:[n.footer?e.jsxs("b",{className:"font-semibold text-foreground",children:[n.footer.split(". ")[0],"."]}):n.intro," ",n.footer?.split(". ").slice(1).join(". ")]}),n.notes.length>0&&e.jsx("p",{className:"m-0 mt-1.5 text-center text-[12px] text-muted-foreground",children:n.notes.join(" ")})]}):e.jsx(B,{})]})}function O({base:s,form:r,warning:a}){const[o,c]=d.useState(!1);return a&&o?e.jsxs("div",{className:"flex flex-col gap-2 rounded-md bg-warn-soft px-3 py-2.5 text-[12.5px]",children:[e.jsx("p",{className:"m-0",children:a}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(g,{base:s,form:{...r,label:"Downgrade anyway",primary:!1}}),e.jsx("button",{type:"button",className:"text-[13px] text-muted-foreground underline underline-offset-2",onClick:()=>c(!1),children:"Keep my plan"})]})]}):a?e.jsx("button",{type:"button",className:"self-center text-[13px] text-muted-foreground underline underline-offset-[3px]",onClick:()=>c(!0),children:r.label}):e.jsxs("form",{method:"post",action:new URL(r.action,s).toString(),className:"m-0 self-center",children:[Object.entries(r.fields).map(([u,p])=>e.jsx("input",{type:"hidden",name:u,value:p},u)),e.jsx("button",{type:"submit",className:"text-[13px] text-muted-foreground underline underline-offset-[3px]",children:r.label})]})}function g({base:s,form:r,wide:a}){return e.jsxs("form",{method:"post",action:new URL(r.action,s).toString(),className:"m-0",children:[Object.entries(r.fields).map(([o,c])=>e.jsx("input",{type:"hidden",name:o,value:c},o)),e.jsx(P,{type:"submit",variant:r.primary?"default":"outline",className:a?"w-full":void 0,children:r.label})]})}function Q(){const{limits:s}=y(),r=[{label:"Sites",text:C(s.projects.used,s.projects.limit,"site","sites"),share:N(s.projects.used,s.projects.limit)},{label:"Members",text:C(s.members.used,s.members.limit,"member","members"),share:N(s.members.used,s.members.limit)},{label:"Screenshots",text:s.screenshots?s.storage.limit===null?`${j(s.storage.used)} used`:`${j(s.storage.used)} of ${j(s.storage.limit)}`:"Not on this plan",share:s.screenshots?N(s.storage.used,s.storage.limit):null}];return e.jsx("dl",{className:"m-0 grid grid-cols-1 gap-5 border-t border-border pt-4 sm:grid-cols-3",children:r.map(a=>e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("dt",{className:"text-[12px] text-muted-foreground",children:a.label}),e.jsx("dd",{className:"m-0 text-[13px]",children:a.text}),a.share!==null&&e.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted","aria-hidden":!0,children:e.jsx("div",{className:m("h-full rounded-full",a.share>=1?"bg-destructive":"bg-brand"),style:{width:`${Math.min(100,Math.round(a.share*100))}%`}})})]},a.label))})}const N=(s,r)=>r===null||r===0?null:s/r,C=(s,r,a,o)=>r===null?`${s} ${s===1?a:o}, unlimited`:`${s} of ${r} ${r===1?a:o}`,ne=()=>y().user.role==="owner"?e.jsx(L,{}):e.jsx(D,{title:"Plan & billing"});export{ne as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as i,i as ae,al as re,e as se,aj as ie,E as ne,k as j,j as f,am as oe,h as de}from"./index-DJIyUCPa.js";import{f as ce,e as le,h as ue,j as fe,u as pe,A as he,k as be,l as me,c as ge,n as ve}from"./createBaseUIEventDetails-DJQs5QD1.js";import{x as ke,y as xe}from"./useScrollLock-tzg3KUOw.js";import{u as we}from"./useAriaLabelledBy-DfnIJQvt.js";import{u as ye}from"./useValueChanged-S18DT6ky.js";const M=i.createContext(void 0);function Ce(){const r=i.useContext(M);if(r===void 0)throw new Error(ae(63));return r}const D={...ce,checked(r){return r?{"data-checked":""}:{"data-unchecked":""}}},Re=i.forwardRef(function(s,o){const{checked:k,className:F,defaultChecked:x,"aria-labelledby":g,form:p,id:L,inputRef:T,name:w,nativeButton:h=!1,onCheckedChange:V,readOnly:d=!1,required:b=!1,disabled:N=!1,render:ze,uncheckedValue:y,value:C,style:Ee,...A}=s,{clearErrors:H}=le(),{state:R,setTouched:q,setDirty:O,validityData:W,setFilled:v,setFocused:P,validationMode:J,disabled:U,name:Y,validation:c}=ue(),{labelId:_}=fe(),t=U||N,l=Y??w,n=i.useRef(null),G=re(n,T,c.inputRef),m=i.useRef(null),z=pe(),E=he({id:L,implicit:!1,controlRef:m}),B=h?void 0:E,[a,K]=be({controlled:k,default:!!x,name:"Switch",state:"checked"});me(m,z,a,void 0,!t,w),se(()=>{n.current&&v(n.current.checked)},[v]),ye(a,()=>{H(l),O(a!==W.initialValue),v(a),c.change(a)});const{getButtonProps:Q,buttonRef:X}=ie({disabled:t,native:h}),Z=we(g,_,n,!h,B),$={id:h?E:z,role:"switch","aria-checked":a,"aria-readonly":d||void 0,"aria-required":b||void 0,"aria-labelledby":Z,onFocus(){t||P(!0)},onBlur(){const e=n.current;!e||t||(q(!0),P(!1),J==="onBlur"&&c.commit(e.checked))},onClick(e){if(d||t)return;e.preventDefault();const u=n.current;u&&oe(u,e)}},ee={...c.getValidationProps(t),checked:a,disabled:t,form:p,id:B,name:l,required:b,style:l?ke:xe,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:G,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(d){e.preventDefault();return}const u=e.currentTarget.checked,S=ge(ve,e.nativeEvent);V?.(u,S),!S.isCanceled&&K(u)},onClick(e){e.stopPropagation()},onFocus(){m.current?.focus()},...C!==void 0?{value:C}:ne},I=i.useMemo(()=>({...R,checked:a,disabled:t,readOnly:d,required:b}),[R,a,t,d,b]),te=j("span",s,{state:I,ref:[o,m,X],props:[$,A,Q,e=>c.getValidationProps(t,e)],stateAttributesMapping:D});return f.jsxs(M.Provider,{value:I,children:[te,!a&&l&&y!==void 0&&f.jsx("input",{type:"hidden",form:p,name:l,value:y,disabled:t}),f.jsx("input",{...ee,suppressHydrationWarning:!0})]})}),Pe=i.forwardRef(function(s,o){const{render:k,className:F,style:x,...g}=s,p=Ce();return j("span",s,{state:p,ref:o,stateAttributesMapping:D,props:g})});function De({className:r,size:s="default",...o}){return f.jsx(Re,{"data-slot":"switch","data-size":s,className:de("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",r),...o,children:f.jsx(Pe,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}export{De as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,h as l}from"./index-
|
|
1
|
+
import{j as t,h as l}from"./index-DJIyUCPa.js";function o({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function r({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function n({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",a),...e})}function b({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",a),...e})}function c({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a),...e})}export{o as T,r as a,n as b,b as c,d,c as e};
|
package/static/dashboard/assets/{useAriaLabelledBy-Dt1pmXDF.js → useAriaLabelledBy-DfnIJQvt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,e as l}from"./index-
|
|
1
|
+
import{r as u,e as l}from"./index-DJIyUCPa.js";import{u as c}from"./createBaseUIEventDetails-DJQs5QD1.js";function y(e,n,t,r=!0,i){const[a,d]=u.useState(),f=c(i?`${i}-label`:void 0),o=e??n??a;return l(()=>{const s=e||n||!r?void 0:L(t.current,f);a!==s&&d(s)}),o}function L(e,n){const t=b(e);if(t)return!t.id&&n&&(t.id=n),t.id||void 0}function b(e){if(!e)return;const n=e.parentElement;if(n&&n.tagName==="LABEL")return n;const t=e.id;if(t){const i=e.nextElementSibling;if(i&&i.htmlFor===t)return i}const r=e.labels;return r&&r[0]}export{y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bc as N,bd as h,be as O,bf as U,bg as k,bh as B,bi as A,bj as y,bk as H,bl as V,bm as M,bn as x,r as p,bo as F,d as j}from"./index-
|
|
1
|
+
import{bc as N,bd as h,be as O,bf as U,bg as k,bh as B,bi as A,bj as y,bk as H,bl as V,bm as M,bn as x,r as p,bo as F,d as j}from"./index-DJIyUCPa.js";var st=class extends N{#e;#t=void 0;#f=void 0;#s=void 0;#n;#c;#i;#p;#u;#l;#a;#o;#r;#d=new Set;constructor(t,e){super(),this.options=e,this.#e=t,this.#i=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Q(this.#t,this.options)?this.#h():this.updateResult(),this.#m())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#g(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof h(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!O(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&P(this.#t,s,this.options,e)&&this.#h(),this.updateResult(),i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(e.staleTime,this.#t))&&this.#R();const r=this.#v();i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||r!==this.#r)&&this.#y(r)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return O(this.getCurrentResult(),s)||(this.#s=s,this.#c=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),Reflect.get(s,i))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);let i=()=>{},r;const c=new Promise(a=>{r=a,i=this.#e.getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===s.queryHash&&s.state.data!==void 0&&(i(),a(this.createResult(s,e)))})});return Promise.race([s.fetch().then(()=>{const a=this.createResult(s,e);return r?.(a),a}).finally(()=>{i()}),c])}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(U)),e}#b(t){return!k()&&h(this.options.enabled,this.#t)!==!1&&B(t)}#R(){this.#S();const t=h(this.options.staleTime,this.#t);if(this.#s.isStale||!this.#b(t))return;const e=A(this.#s.dataUpdatedAt,t)+1;this.#a=y.setTimeout(()=>{this.#s.isStale||this.updateResult()},e)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#g(),this.#r=t,!(this.#r===0||!this.#b(this.#r))&&(this.#o=y.setInterval(()=>{(this.options.refetchIntervalInBackground||H.isFocused())&&this.#h()},this.#r))}#m(){this.#R(),this.#y(this.#v())}#S(){this.#a!==void 0&&(y.clearTimeout(this.#a),this.#a=void 0)}#g(){this.#o!==void 0&&(y.clearInterval(this.#o),this.#o=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#s,c=this.#n,a=this.#c,u=t!==s?t.state:this.#f,{state:l}=t;let n={...l},d=!1,o;if(e._optimisticResults){const f=this.hasListeners(),D=!f&&Q(t,e),L=f&&P(t,s,e,i);(D||L)&&(n={...n,...V(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:R,errorUpdatedAt:v,status:b}=n;o=n.data;let I=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let f;r?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(f=r.data,I=!0):f=typeof e.placeholderData=="function"?e.placeholderData(this.#l?.state.data,this.#l):e.placeholderData,f!==void 0&&(b="success",o=M(r?.data,f,e),d=!0)}if(e.select&&o!==void 0&&!I)if(r&&o===c?.data&&e.select===this.#p)o=this.#u;else try{this.#p=e.select,o=e.select(o),o=M(r?.data,o,e),this.#u=o,this.#i=null}catch(f){this.#i=f}else o===void 0&&(this.#i=null);this.#i&&(R=this.#i,o=this.#u,v=Date.now(),b="error",d=!1);const m=n.fetchStatus==="fetching",S=b==="pending",g=b==="error",T=S&&m,w=o!==void 0;return{status:b,fetchStatus:n.fetchStatus,isPending:S,isSuccess:b==="success",isError:g,isInitialLoading:T,isLoading:T,data:o,dataUpdatedAt:n.dataUpdatedAt,error:R,errorUpdatedAt:v,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:n.dataUpdateCount>u.dataUpdateCount||n.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!S,isLoadingError:g&&!w,isPaused:n.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:g&&w,isStale:C(t,e),refetch:this.refetch,isEnabled:h(e.enabled,t)!==!1}}updateResult(){const t=this.#s,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#c=this.options,this.#n.data!==void 0&&(this.#l=this.#t),O(e,t))return;this.#s=e;const i=(()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,c=typeof r=="function"?r():r;if(c==="all"||!c&&!this.#d.size)return!0;const a=new Set(c??this.#d);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(u=>{const l=u;return this.#s[l]!==t[l]&&a.has(l)})})();x.batch(()=>{i&&this.listeners.forEach(r=>{r(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#O(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#f=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#m()}};function W(t,e){return h(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&h(e.retryOnMount,t)===!1)}function Q(t,e){return W(t,e)||t.state.data!==void 0&&E(t,e,e.refetchOnMount)}function E(t,e,s){if(h(e.enabled,t)!==!1&&h(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&C(t,e)}return!1}function P(t,e,s,i){return(t!==e||h(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&C(t,s)}function C(t,e){return h(e.enabled,t)!==!1&&t.isStaleByTime(h(e.staleTime,t))}const _=p.createContext(!1),z=()=>p.useContext(_);_.Provider;function K(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const G=p.createContext(K()),J=()=>p.useContext(G),X=(t,e,s)=>{const i=s?.state.error&&typeof t.throwOnError=="function"?F(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||i)&&(e.isReset()||(t.retryOnMount=!1))},Y=t=>{p.useEffect(()=>{t.clearReset()},[t])},Z=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||F(s,[t.error,i])),it=(t,e)=>e.state.data===void 0,$=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>s(i(...r)):s(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},q=(t,e)=>t?.suspense&&e.isPending,tt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function rt(t,e,s){const i=z(),r=J(),c=j(),a=c.defaultQueryOptions(t),u=c.getQueryCache().get(a.queryHash),l=t.subscribed!==!1;a._optimisticResults=i?"isRestoring":l?"optimistic":void 0,$(a),X(a,r,u),Y(r);const[n]=p.useState(()=>new e(c,a)),d=n.getOptimisticResult(a),o=!i&&l;if(p.useSyncExternalStore(p.useCallback(R=>{const v=o?n.subscribe(x.batchCalls(R)):U;return n.updateResult(),v},[n,o]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),p.useEffect(()=>{n.setOptions(a)},[a,n]),q(a,d))throw tt(a,n,r);if(Z({result:d,errorResetBoundary:r,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw d.error;return a.notifyOnChangeProps?d:n.trackResult(d)}export{st as Q,it as d,rt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aJ as d,r as f,al as h}from"./index-DJIyUCPa.js";import{u as p}from"./CompositeList-Cc2N74pm.js";function I(i={}){const{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:u}=d(),{ref:a,index:t}=p(i),o=r===t,s=f.useRef(null),c=h(a,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){u(t)},onMouseMove(){const e=s.current;if(!n||!e)return;const m=e.hasAttribute("disabled")||e.ariaDisabled==="true";!o&&!m&&e.focus()}},compositeRef:c,index:t}}export{I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as r,Q as u}from"./useBaseQuery-ic0hLoWO.js";function a(e,s){return r(e,u)}export{a as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as n}from"./index-DJIyUCPa.js";function u(e){return n(e.defaultTagName??"div",e,e)}export{u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as Dt,c as Tn,T as bt,t as Rn,b as vn,r as he,a as xn,u as Cn,p as In}from"./inertValue-BSe8K39O.js";import{aF as te,l as ve,aP as se,b6 as ct,aK as Ht,ag as De,e as D,r as a,j as ne,al as Wt,n as ut,E as Be,f as G,b7 as On,k as wn,ai as mt,g as Ge,aG as qe,aH as Pn,b8 as kn,b9 as An,ba as Fn,aQ as Mn}from"./index-_7kIe8FW.js";import{a as w,r as _,x as pe,c as xe,m as _t,e as at,b as Vt,o as Bt,g as Se,t as Ut,z as Yt,n as Nn,y as Ln}from"./createBaseUIEventDetails-DviWdj-N.js";const Dn=["open","progress","review","resolved"],Kr={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"},$r={open:"bg-status-open text-white",progress:"bg-status-progress text-[#16161a]",review:"bg-status-review text-white",resolved:"bg-status-resolved text-[#16161a]"};function qr(e){return Dn.includes(e)}function zr(e,t=Date.now()){if(!e)return"";const n=Math.max(0,(t-new Date(e).getTime())/1e3);return n<60?"now":n<3600?`${Math.floor(n/60)} min`:n<86400?`${Math.floor(n/3600)} h`:n<86400*30?`${Math.floor(n/86400)} d`:new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short"})}function Jr(e,t=""){const n=e.trim().split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():n.length===1&&n[0].length>0?n[0].slice(0,2).toUpperCase():(t[0]??"?").toUpperCase()}function Hn(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Wn,platform:_n,maxTouchPoints:Vn}=Hn(),Xe=Wn.toLowerCase(),Ne=_n.toLowerCase(),lt=/^i(os$|p)/.test(Ne)||Ne==="macintel"&&Vn>1,yt="android",tt=Ne===yt||Xe.includes(yt),Bn=!lt&&Ne.startsWith("mac");Ne.startsWith("win");const Un=Bn||lt,Ie=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ie&&Xe.includes("firefox");!Ie&&Xe.includes("chrom");const Yn=Un,jt=/jsdom|happydom/.test(Xe),nt="data-base-ui-focusable",Gt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Qr="ArrowLeft",Zr="ArrowRight",es="ArrowUp",ts="ArrowDown";function ns(e,t){if(!ve(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(w(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function ze(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function jn(e){return e.matches("html,body")}function Xt(e){return te(e)&&e.matches(Gt)}function rs(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Gt}`)!=null}function Et(e){return e?e.getAttribute("role")==="combobox"&&Xt(e):!1}function ss(e){if(!e||jt)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function St(e){return e?e.hasAttribute(nt)?e:e.querySelector(`[${nt}]`)||e:null}function Le(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Le(e,s.id,n)])}function Tt(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function Gn(e){e.preventDefault(),e.stopPropagation()}function Xn(e){return"nativeEvent"in e}function Kn(e){return e.pointerType===""&&e.isTrusted?!0:tt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $n(e){return jt?!1:!tt&&e.width===0&&e.height===0||tt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function os(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const zn='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Jn(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return ct(n)?n.host:null}function rt(e){for(const t of Array.from(e.children))if(se(t)==="summary")return t;return null}function Qn(e,t){const n=rt(t);return!!n&&(e===n||w(n,e))}function Kt(e){const t=e?se(e):"";return e!=null&&e.matches(zn)&&(t!=="summary"||e.parentElement!=null&&se(e.parentElement)==="details"&&rt(e.parentElement)===e)&&(t!=="details"||rt(e)==null)&&(t!=="input"||e.type!=="hidden")}function $t(e){if(!Kt(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Jn(t)){const n=t!==e,r=se(t)==="slot";if(t.hasAttribute("inert")||n&&se(t)==="details"&&!t.open&&!Qn(e,t)||t.hasAttribute("hidden")||!r&&!Zn(t,n))return!1}return!0}function Zn(e,t){const n=Ht(e);return t?n.display!=="none":Dt(e,n)}function qt(e){const t=e.tabIndex;if(t<0){const n=se(e);if(n==="details"||n==="audio"||n==="video"||te(e)&&e.isContentEditable)return 0}return t}function Je(e){if(se(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function er(e,t){const n=Je(e);if(!n)return!0;const r=t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form})===n}function zt(e){if(te(e)&&se(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return te(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Jt(e,t){zt(e).forEach(n=>{Kt(n)&&t.push(n),Jt(n,t)})}function Qt(e,t,n){zt(e).forEach(r=>{te(r)&&r.matches(t)&&n.push(r),Qt(r,t,n)})}function ft(e){return $t(e)&&qt(e)>=0}function Zt(e){const t=[];return Jt(e,t),t.filter($t)}function He(e){const t=Zt(e);return t.filter(n=>qt(n)>=0&&er(n,t))}function en(e,t){const n=He(e),r=n.length;if(r===0)return;const s=pe(_(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function tn(e){return en(_(e).body,1)||e}function nn(e){return en(_(e).body,-1)||e}function rn(e,t){if(!e)return null;const n=He(_(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function is(e){return rn(e,1)}function cs(e){return rn(e,-1)}function Me(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!w(n,r)}function tr(e){He(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rt(e){const t=[];Qt(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Ae=0;class Te{static create(){return new Te}currentId=Ae;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ae,n()},t)}isStarted(){return this.currentId!==Ae}clear=()=>{this.currentId!==Ae&&(clearTimeout(this.currentId),this.currentId=Ae)};disposeEffect=()=>this.clear}function Ue(){const e=De(Te.create).current;return Tn(e.disposeEffect),e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=bt.startingStyle]="startingStyle",e[e.endingStyle=bt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const nr={"data-popup-open":""},rr={"data-popup-open":"","data-pressed":""},sr={"data-open":""},or={"data-closed":""},ir={"data-anchor-hidden":""},us={open(e){return e?nr:null}},as={open(e){return e?rr:null}},cr={open(e){return e?sr:or},anchorHidden(e){return e?ir:null}},ls={...cr,...Rn};function P(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ce(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function _e(e){const t=De(ur,e).current;return t.next=e,D(t.effect),t}function ur(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const sn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ar={...sn,position:"fixed",top:0,left:0},fs={...sn,position:"absolute"},Ye=a.forwardRef(function(t,n){const[r,s]=a.useState();D(()=>{Yn&&Ie&&s("button")},[]);const o={tabIndex:0,role:r};return ne.jsx("span",{...t,ref:n,style:ar,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});function je(e){return`data-base-ui-${e}`}let Ve=0;function Qe(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(Ve);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),Wt;const i=requestAnimationFrame(o);return Ve=i,()=>{Ve===i&&(cancelAnimationFrame(i),Ve=0)}}const Ze={inert:new WeakMap,"aria-hidden":new WeakMap},vt="data-base-ui-inert",st={inert:new WeakSet,"aria-hidden":new WeakSet};let Fe=new WeakMap,et=0;function lr(e){return st[e]}function on(e){return e?ct(e)?e.host:on(e.parentNode):null}const xt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=on(n);return e.contains(r)?r:null}).filter(n=>n!=null),Ct=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},It=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{se(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function fr(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const p=xt(t,e),c=s?It(t,Ct(p),new Set(p)):[],y=[],C=[];if(o){const d=Ze[o],g=lr(o);u=g,i=d;const v=xt(t,Array.from(t.querySelectorAll("[aria-live]"))),k=p.concat(v);It(t,Ct(k),new Set(k)).forEach(R=>{const b=R.getAttribute(o),q=b!==null&&b!=="false",W=(d.get(R)||0)+1;d.set(R,W),y.push(R),W===1&&q&&g.add(R),q||R.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(d=>{const g=(Fe.get(d)||0)+1;Fe.set(d,g),C.push(d),g===1&&d.setAttribute(vt,"")}),et+=1,()=>{i&&y.forEach(d=>{const v=(i.get(d)||0)-1;i.set(d,v),v||(!u?.has(d)&&o&&d.removeAttribute(o),u?.delete(d))}),s&&C.forEach(d=>{const g=(Fe.get(d)||0)-1;Fe.set(d,g),g||d.removeAttribute(vt)}),et-=1,et||(Ze.inert=new WeakMap,Ze["aria-hidden"]=new WeakMap,st.inert=new WeakSet,st["aria-hidden"]=new WeakSet,Fe=new WeakMap)}}function Ot(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=_(e[0]).body;return fr(e,o,n,r,{mark:s})}const ds=500,ps=500,gs={style:{transition:"none"}},dr="data-base-ui-click-trigger",hs={fallbackAxisSide:"none"},bs={fallbackAxisSide:"end"},pr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},cn=a.createContext(null),un=()=>a.useContext(cn),gr=je("portal");function hr(e={}){const{ref:t,container:n,componentProps:r=Be,elementProps:s}=e,o=at(),u=un()?.portalNode,[p,c]=a.useState(null),[y,C]=a.useState(null),d=G(S=>{S!==null&&C(S)}),g=a.useRef(null);D(()=>{if(n===null){g.current&&(g.current=null,C(null),c(null));return}const S=(n&&(On(n)?n:n.current))??u??document.body;if(S==null){g.current&&(g.current=null,C(null),c(null));return}g.current!==S&&(g.current=S,C(null),c(S))},[n,u]);const v=wn("div",r,{ref:[t,d],props:[{id:o,[gr]:""},s]}),k=p&&v?ut.createPortal(v,p):null;return{node:y,nodeId:a.isValidElement(v)?v.props.id:void 0,subtree:k}}const ms=a.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:u,...p}=t,{node:c,nodeId:y,subtree:C}=hr({container:u,ref:n,componentProps:t,elementProps:p}),d=a.useRef(null),g=a.useRef(null),v=a.useRef(null),k=a.useRef(null),[S,R]=a.useState(null),b=a.useRef(!1),q=S?.modal,W=S?.open,Y=!!S&&!S.modal&&S.open&&!!c;a.useEffect(()=>{if(!c||q)return;function A(j){c&&j.relatedTarget&&Me(j)&&(j.type==="focusin"?b.current&&(Rt(c),b.current=!1):(tr(c),b.current=!0))}return Ce(P(c,"focusin",A,!0),P(c,"focusout",A,!0))},[c,q]),D(()=>{!c||W!==!0||!b.current||(Rt(c),b.current=!1)},[W,c]);const z=a.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:g,beforeInsideRef:v,afterInsideRef:k,portalNode:c,setFocusManagerState:R}),[c]);return ne.jsxs(a.Fragment,{children:[C,ne.jsxs(cn.Provider,{value:z,children:[Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:d,onFocus:A=>{if(Me(A,c))v.current?.focus();else{const j=S?S.domReference:null;nn(j)?.focus()}}}),Y&&c&&ne.jsx("span",{"aria-owns":y,style:pr}),c&&ut.createPortal(i,c),Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:g,onFocus:A=>{if(Me(A,c))k.current?.focus();else{const j=S?S.domReference:null;tn(j)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,xe(_t,A.nativeEvent))}}})]})]})});function an(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class br{nodesRef={current:[]};events=an();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ln=a.createContext(null),fn=a.createContext(null),dt=()=>a.useContext(ln)?.id||null,pt=e=>{const t=a.useContext(fn);return e??t};function ys(e){const t=at(),n=pt(e),r=dt();return D(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function Es(e){const{children:t,id:n}=e,r=dt();return ne.jsx(ln.Provider,{value:a.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Ss(e){const{children:t,externalTree:n}=e,r=De(()=>n??new br).current;return ne.jsx(fn.Provider,{value:r,children:t})}function mr(e,t){const n=Ge(Se(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const wt=20;let be=[];function gt(){be=be.filter(e=>e.deref()?.isConnected)}function Pt(e){gt(),e&&se(e)!=="body"&&(be.push(new WeakRef(e)),be.length>wt&&(be=be.slice(-wt)))}function kt(){return gt(),be[be.length-1]?.deref()}function yr(e){return e?ft(e)?e:He(e)[0]||e:null}function At(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return ft(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ts(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:p=!0,openInteractionType:c="",nextFocusableElement:y,previousFocusableElement:C,beforeContentFocusGuardRef:d,externalTree:g,getInsideElements:v}=e,k="rootStore"in t?t.rootStore:t,S=k.useState("open"),R=k.useState("domReferenceElement"),b=k.useState("floatingElement"),{events:q,dataRef:W}=k.context,Y=G(()=>W.current.floatingContext?.nodeId),z=s===!1,A=Et(R)&&z,j=_e(s),M=_e(o),J=_e(c),Oe=_e(S),V=pt(g),x=un(),U=a.useRef(!1),ae=a.useRef(!1),oe=a.useRef(!1),ie=a.useRef(null),me=a.useRef(""),ge=a.useRef(""),ye=a.useRef(null),Re=a.useRef(null),I=mt(ye,d,x?.beforeInsideRef),Q=mt(Re,x?.afterInsideRef),le=Ue(),fe=Ue(),we=vn(),We=x!=null,E=St(b),ce=G((T=E)=>T?He(T):[]),re=G(()=>v?.().filter(T=>T!=null)??[]);a.useEffect(()=>{if(r||!u)return;function T(B){B.key==="Tab"&&w(E,pe(_(E)))&&ce().length===0&&!A&&Gn(B)}const L=_(E);return P(L,"keydown",T)},[r,E,u,A,ce]),a.useEffect(()=>{if(r||!S)return;const T=_(E);function L(){oe.current=!1}function B(Z){const m=Se(Z),F=re(),h=w(b,m)||w(R,m)||w(x?.portalNode,m)||F.some(H=>H===m||w(H,m));oe.current=!h,ge.current=Z.pointerType||"keyboard",m?.closest(`[${dr}]`)&&(ae.current=!0,fe.start(0,()=>{ae.current=!1}))}function X(){ge.current="keyboard"}return Ce(P(T,"pointerdown",B,!0),P(T,"pointerup",L,!0),P(T,"pointercancel",L,!0),P(T,"keydown",X,!0),L)},[r,b,R,E,S,x,fe,re]),a.useEffect(()=>{if(r||!p)return;const T=_(E);function L(){ae.current=!0,fe.start(0,()=>{ae.current=!1})}function B(F){const h=Se(F);ft(h)&&(ie.current=h)}function X(F){const h=F.relatedTarget,H=F.currentTarget,K=Se(F);u&&h==null&&K!=null&&w(b,K)&&Pt(K),queueMicrotask(()=>{const N=Y(),ee=k.context.triggerElements,l=re(),f=h?.hasAttribute(je("focus-guard"))&&[ye.current,Re.current,x?.beforeInsideRef.current,x?.afterInsideRef.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,he(C),he(y)].includes(h),$=!(w(R,h)||w(b,h)||w(h,b)||w(x?.portalNode,h)||l.some(O=>O===h||w(O,h))||ee.hasMatchingElement(O=>w(O,h))||f||V&&(Le(V.nodesRef.current,N).find(O=>w(O.context?.elements.floating,h)||w(O.context?.elements.domReference,h))||Tt(V.nodesRef.current,N).find(O=>[O.context?.elements.floating,St(O.context?.elements.floating)].includes(h)||O.context?.elements.domReference===h)));if(H===R&&E&&At(E),i&&H!==R&&!Dt(K)&&pe(T)===T.body){if(te(E)&&(E.focus(),i==="popup")){we.request(()=>{E.focus()});return}const O=ce(),de=ie.current,Pe=(de&&O.includes(de)?de:null)||O[O.length-1]||E;te(Pe)&&Pe.focus()}if(W.current.insideReactTree){W.current.insideReactTree=!1;return}(A||!u)&&h&&$&&!ae.current&&(A||h!==kt())&&(U.current=!0,k.setOpen(!1,xe(_t,F)))})}function Z(){oe.current||(W.current.insideReactTree=!0,le.start(0,()=>{W.current.insideReactTree=!1}))}const m=te(R)?R:null;if(!(!b&&!m))return Ce(m&&P(m,"focusout",X),m&&P(m,"pointerdown",L),b&&P(b,"focusin",B),b&&P(b,"focusout",X),b&&x&&P(b,"focusout",Z,!0))},[r,R,b,E,u,V,x,k,p,i,ce,A,Y,W,le,fe,we,y,C,re]),a.useEffect(()=>{if(r||!b||!S)return;const T=Array.from(x?.portalNode?.querySelectorAll(`[${je("portal")}]`)||[]),B=(V?Tt(V.nodesRef.current,Y()):[]).find(H=>Et(H.context?.elements.domReference||null))?.context?.elements.domReference,Z=[...[b,...T,ye.current,Re.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,...re()],B,he(C),he(y),A?R:null].filter(H=>H!=null),m=Ot(Z,{ariaHidden:u||A,mark:!1}),F=[b,...T].filter(H=>H!=null),h=Ot(F);return()=>{h(),m()}},[S,r,R,b,u,x,A,V,Y,y,C,re]),D(()=>{if(!S||r||!te(E))return;me.current="",ge.current="";const T=_(E),L=pe(T);queueMicrotask(()=>{const B=j.current,X=typeof B=="function"?B(J.current||""):B;if(X===void 0||X===!1||w(E,L))return;let m=null;const F=()=>(m==null&&(m=ce(E)),m[0]||E);let h;X===!0||X===null?h=F():h=he(X),h=h||F();const H=w(E,pe(T));Qe(h,{preventScroll:h===E,shouldFocus(){if(!Oe.current)return!1;if(H)return!0;const K=pe(T);return!(K!==h&&w(E,K))}})})},[r,S,E,ce,j,J,Oe]),D(()=>{if(r||!E)return;const T=_(E),L=pe(T),B=J.current==null;Pt(L);function X(m){if(m.open||(me.current=mr(m.nativeEvent,ge.current)),m.reason===Vt&&m.nativeEvent.type==="mouseleave"&&(U.current=!0),m.reason===Bt)if(m.nested)U.current=!1;else if(Kn(m.nativeEvent)||$n(m.nativeEvent))U.current=!1;else{let F=!1;_(E).createElement("div").focus({get preventScroll(){return F=!0,!1}}),F?U.current=!1:U.current=!0}}q.on("openchange",X);function Z(m){const F=M.current;let h=typeof F=="function"?F(m):F;if(h===void 0||h===!1)return null;h===null&&(h=!0);const H=R?.isConnected?R:null,K=L?.isConnected&&se(L)!=="body"?L:null;let N=B?K||H:H||K;return N||(N=kt()||null),typeof h=="boolean"?N:he(h)||N||null}return()=>{q.off("openchange",X);const m=pe(T),F=re(),h=w(b,m)||F.some(ee=>ee===m||w(ee,m))||V&&Le(V.nodesRef.current,Y(),!1).some(ee=>w(ee.context?.elements.floating,m)),H=M.current,K=me.current,N=Z(K);queueMicrotask(()=>{const ee=yr(N),l=typeof H!="boolean";if(H&&!U.current&&te(ee)&&(!(!l&&ee!==m&&m!==T.body)||h)){const f={preventScroll:!0};K==="keyboard"&&(f.focusVisible=!0),ee.focus(f)}U.current=!1})}},[r,b,E,M,J,q,V,R,Y,re]),D(()=>{if(!Ie||S||!b)return;const T=pe(_(b));!te(T)||!Xt(T)||w(b,T)&&T.blur()},[S,b]),D(()=>{if(!(r||!x))return x.setFocusManagerState({modal:u,closeOnFocusOut:p,open:S,onOpenChange:k.setOpen,domReference:R}),()=>{x.setFocusManagerState(null)}},[r,x,u,S,k,p,R]),D(()=>{if(!(r||!E))return At(E),()=>{queueMicrotask(gt)}},[r,E]);const Ee=!r&&(u?!A:!0)&&(We||u);return ne.jsxs(a.Fragment,{children:[Ee&&ne.jsx(Ye,{"data-type":"inside",ref:I,onFocus:T=>{if(u){const L=ce();Qe(L[L.length-1])}else x?.portalNode&&(U.current=!1,Me(T,x.portalNode)?tn(R)?.focus():he(C??x.beforeOutsideRef)?.focus())}}),n,Ee&&ne.jsx(Ye,{"data-type":"inside",ref:Q,onFocus:T=>{u?Qe(ce()[0]):x?.portalNode&&(p&&(U.current=!0),Me(T,x.portalNode)?nn(R)?.focus():he(y??x.afterOutsideRef)?.focus())}})]})}function Er(){return!1}function Sr(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Rs(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=Er,bubbles:u,externalTree:p}=t,c="rootStore"in e?e.rootStore:e,y=c.useState("open"),C=c.useState("floatingElement"),{dataRef:d}=c.context,g=pt(p),v=G(typeof s=="function"?s:()=>!1),k=typeof s=="function"?v:s,S=k!==!1,R=G(()=>o),{escapeKey:b,outsidePress:q}=Sr(u),W=a.useRef(!1),Y=a.useRef(!1),z=a.useRef(!1),A=a.useRef(!1),j=a.useRef(""),M=a.useRef(null),J=Ue(),Oe=Ue(),V=G(()=>{Oe.clear(),d.current.insideReactTree=!1}),x=G(I=>{const Q=d.current.floatingContext?.nodeId;return(g?Le(g.nodesRef.current,Q):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[I])}),U=G(I=>ze(I,c.select("floatingElement"))||ze(I,c.select("domReferenceElement"))),ae=G(I=>{i()&&c.setOpen(!1,xe(Ut,I.nativeEvent))}),oe=G(I=>{if(!y||!n||!r||I.key!=="Escape"||A.current||!b&&x("__escapeKeyBubbles"))return;const Q=Xn(I)?I.nativeEvent:I,le=xe(Yt,Q);c.setOpen(!1,le),le.isCanceled||I.preventDefault(),!b&&!le.isPropagationAllowed&&I.stopPropagation()}),ie=G(()=>{d.current.insideReactTree=!0,Oe.start(0,V)}),me=G(I=>{if(!y||!n||I.button!==0)return;const Q=Se(I.nativeEvent);w(c.select("floatingElement"),Q)&&(W.current||(W.current=!0,Y.current=!1))}),ge=G(I=>{!y||!n||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&W.current&&(Y.current=!0)});a.useEffect(()=>{if(!y||!n)return V;d.current.__escapeKeyBubbles=b,d.current.__outsidePressBubbles=q;const I=new Te,Q=new Te;function le(){I.clear(),A.current=!0}function fe(){I.start(Ie?5:0,()=>{A.current=!1})}function we(){z.current=!0,Q.start(0,()=>{z.current=!1})}function We(){W.current=!1,Y.current=!1}function E(){const l=j.current,f=l==="pen"||!l?"mouse":l,$=R(),O=typeof $=="function"?$():$;return typeof O=="string"?O:O[f]}function ce(l){const f=E();return f==="intentional"&&l.type!=="click"||f==="sloppy"&&l.type==="click"}function re(l){const f=d.current.floatingContext?.nodeId,$=g&&Le(g.nodesRef.current,f).some(O=>ze(l,O.context?.elements.floating));return U(l)||$}function Ee(l){if(ce(l)){l.type!=="click"&&!U(l)&&(Q.clear(),z.current=!1),V();return}if(d.current.insideReactTree){V();return}const f=Se(l),$=`[${je("inert")}]`,O=ve(f)?f.getRootNode():null,de=Array.from((ct(O)?O:_(c.select("floatingElement"))).querySelectorAll($)),Pe=c.context.triggerElements;if(f&&(Pe.hasElement(f)||Pe.hasMatchingElement(ue=>w(ue,f))))return;let ke=ve(f)?f:null;for(;ke&&!qe(ke);){const ue=Pn(ke);if(qe(ue)||!ve(ue))break;ke=ue}if(!(de.length&&ve(f)&&!jn(f)&&!w(f,c.select("floatingElement"))&&de.every(ue=>!w(ke,ue)))){if(te(f)&&!("touches"in l)){const ue=qe(f),$e=Ht(f),ht=/auto|scroll/,gn=ue||ht.test($e.overflowX),hn=ue||ht.test($e.overflowY),bn=gn&&f.clientWidth>0&&f.scrollWidth>f.clientWidth,mn=hn&&f.clientHeight>0&&f.scrollHeight>f.clientHeight,yn=$e.direction==="rtl",En=mn&&(yn?l.offsetX<=f.offsetWidth-f.clientWidth:l.offsetX>f.clientWidth),Sn=bn&&l.offsetY>f.clientHeight;if(En||Sn)return}if(!re(l)){if(E()==="intentional"&&z.current){Q.clear(),z.current=!1;return}typeof k=="function"&&!k(l)||x("__outsidePressBubbles")||(c.setOpen(!1,xe(Bt,l)),V())}}}function T(l){E()!=="sloppy"||l.pointerType==="touch"||!c.select("open")||!n||U(l)||Ee(l)}function L(l){if(E()!=="sloppy"||!c.select("open")||!n||U(l))return;const f=l.touches[0];f&&(M.current={startTime:Date.now(),startX:f.clientX,startY:f.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},J.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function B(l,f){const $=Se(l);if(!$)return;const O=P($,l.type,()=>{f(l),O()})}function X(l){j.current="touch",B(l,L)}function Z(l){J.clear(),l.type==="pointerdown"&&(j.current=l.pointerType),!(l.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&B(l,f=>{f.type==="pointerdown"?T(f):Ee(f)})}function m(l){if(!W.current)return;const f=Y.current;if(We(),E()==="intentional"){if(l.type==="pointercancel"){f&&we();return}if(!re(l)){if(f){we();return}typeof k=="function"&&!k(l)||(Q.clear(),z.current=!0,V())}}}function F(l){if(E()!=="sloppy"||!M.current||U(l))return;const f=l.touches[0];if(!f)return;const $=Math.abs(f.clientX-M.current.startX),O=Math.abs(f.clientY-M.current.startY),de=Math.sqrt($*$+O*O);de>5&&(M.current.dismissOnTouchEnd=!0),de>10&&(Ee(l),J.clear(),M.current=null)}function h(l){B(l,F)}function H(l){E()!=="sloppy"||!M.current||U(l)||(M.current.dismissOnTouchEnd&&Ee(l),J.clear(),M.current=null)}function K(l){B(l,H)}const N=_(C),ee=Ce(r&&Ce(P(N,"keydown",oe),P(N,"compositionstart",le),P(N,"compositionend",fe)),S&&Ce(P(N,"click",Z,!0),P(N,"pointerdown",Z,!0),P(N,"pointerup",m,!0),P(N,"pointercancel",m,!0),P(N,"mousedown",Z,!0),P(N,"mouseup",m,!0),P(N,"touchstart",X,!0),P(N,"touchmove",h,!0),P(N,"touchend",K,!0)));return()=>{ee(),I.clear(),Q.clear(),We(),z.current=!1,V()}},[d,C,r,S,k,y,n,b,q,oe,V,R,x,U,g,c,J]);const ye=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ae,onClick:ae}),[oe,ae]),Re=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ge,onMouseDown:ge,onClickCapture:ie,onMouseDownCapture(I){ie(),me(I)},onPointerDownCapture(I){ie(),me(I)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[oe,ie,me,ge]);return a.useMemo(()=>n?{reference:ye,floating:Re,trigger:ye}:{},[n,ye,Re])}var dn=kn();const ot=[];let it;function Tr(){return it}function Rr(e){ot.push(e)}function vr(e){const t=(n,r)=>{const s=De(xr).current;let o;try{it=s;for(const i of ot)i.before(s);o=e(n,r);for(const i of ot)i.after(s);s.didInitialize=!0}finally{it=void 0}return o};return t.displayName=e.displayName||e.name,t}function vs(e){return a.forwardRef(vr(e))}function xr(){return{didInitialize:!1}}const Cr=An(19),Ir=Cr?wr:Pr;function pn(e,t,n,r,s){return Ir(e,t,n,r,s)}function Or(e,t,n,r,s){const o=a.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return dn.useSyncExternalStore(e.subscribe,o,o)}Rr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),dn.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function wr(e,t,n,r,s){const o=Tr();if(!o)return Or(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let u;return o.didInitialize?(u=o.syncHooks[i],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(o.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(u)),u.value}function Pr(e,t,n,r,s){return Fn.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class kr{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return pn(this,t,n,r,s)}}class Ar extends kr{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){a.useDebugValue(t);const r=this;D(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;D(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);D(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){a.useDebugValue(t);const r=this,s=n!==void 0;D(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return a.useDebugValue(t),pn(this,this.selectors[t],n,r,s)}useContextCallback(t,n){a.useDebugValue(t);const r=G(n??Wt);this.context[t]=r}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const u=s;s=i,n(i,u,this)}})}}const Fr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Mr extends Ar{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:an(),nested:r,triggerElements:o},Fr),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&qn(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function Nr(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),p=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),y=t.context.triggerElements,C=i,d=a.useRef(null);r===void 0&&d.current===null&&(d.current=new Mr({open:u,transitionStatus:void 0,referenceElement:p,floatingElement:c,triggerElements:y,onOpenChange:C,floatingId:s,syncOnly:!0,nested:o}));const g=r??d.current;return t.useSyncedValue("floatingId",s),D(()=>{const v={open:u,floatingId:s,referenceElement:p,floatingElement:c};ve(p)&&(v.domReferenceElement=p),g.state.positionReference===g.state.referenceElement&&(v.positionReference=p),g.update(v)},[u,s,p,c,g]),g.context.onOpenChange=C,g.context.nested=o,g}const xs={tabIndex:-1,[nt]:""};function Cs(e){return t=>t==="touch"?e.current:!0}function Is(e,t=!1){const n=at(),r=dt()!=null,s=De(()=>e(n,r)).current;return Nr({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Os({handle:e,store:t}){return D(()=>e.attachStore(t),[e,t]),null}function Lr(e,t){const n=a.useRef(null),r=a.useRef(null);return a.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,p=t.context.triggerElements.getById(i);u&&p===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Dr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function Hr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ws(e,t,n,r={}){const s=n.reason,o=s===Vt,i=t&&s===Ln,u=!t&&(s===Ut||s===Yt),p=Hr(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const y={...r.extraState,open:t};i?y.instantType="focus":u?y.instantType="dismiss":o&&(y.instantType=void 0),Dr(y,t,n.trigger,p()),e.update(y)};o?ut.flushSync(c):c()}function Ps(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Lr(e,n),i=G(p=>{const c=n.select("open"),y=n.select("activeTriggerId");if(y===e){n.update({activeTriggerElement:p,...c?r:null});return}y==null&&c&&n.update({activeTriggerId:e,activeTriggerElement:p,...r})}),u=a.useCallback(p=>{o(p),p&&i(p)},[o,i]);return D(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:s}}function ks(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=a.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),u=e.useState("activeTriggerElement");D(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const p=e.context.triggerElements.size,c={};e.state.triggerCount!==p&&(c.triggerCount=p);const y=e.select("activeTriggerId");let C=null;if(y){const d=e.context.triggerElements.getById(y);if(d)r.current=y,d!==e.state.activeTriggerElement&&(c.activeTriggerElement=d);else{for(const[g,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g;break}c.activeTriggerId===void 0&&(r.current===y?C=y:r.current=null)}}else r.current=null;if(!C&&!y&&p===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[g,v]=d.value;c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),C&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===C&&!e.context.triggerElements.getById(C)){const d=xe(Nn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,u,n])}function As(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=xn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const p=G(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Cn({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||p()}}),{forceUnmount:p,transitionStatus:o}}function Fs(e,t){e.useSyncedValues(t),D(()=>()=>{e.update({activeTriggerProps:Be,inactiveTriggerProps:Be,popupProps:Be})},[e])}function Ms(e,t){D(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),D(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Ns{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}const Ls=a.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return ne.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let Ft={},Mt={},Nt="";function Ke(e,t){return Mn(e)?e:t}function Lt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ke(t,n)).overflowY)}function Wr(e){if(typeof document>"u")return!1;const t=_(e);return Ge(t).innerWidth-t.documentElement.clientWidth>0}function _r(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=_(e),r=n.documentElement,s=n.body,o=Ke(r,s),i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const p=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,p===c}function Vr(e){const t=_(e),n=t.documentElement,r=t.body,s=Ke(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Br(e){const t=_(e),n=t.documentElement,r=t.body,s=Ge(n);let o=0,i=0,u=!1;const p=In.create();if(Ie&&(s.visualViewport?.scale??1)!==1)return()=>{};function c(){const g=s.getComputedStyle(n),v=s.getComputedStyle(r),R=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Ft={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nt=n.style.scrollBehavior,Mt={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,q=n.scrollWidth>n.clientWidth,W=g.overflowY==="scroll"||v.overflowY==="scroll",Y=g.overflowX==="scroll"||v.overflowX==="scroll",z=Math.max(0,s.innerWidth-r.clientWidth),A=Math.max(0,s.innerHeight-r.clientHeight),j=parseFloat(v.marginTop)+parseFloat(v.marginBottom),M=parseFloat(v.marginLeft)+parseFloat(v.marginRight),J=Ke(n,r);if(u=_r(e),u){n.style.scrollbarGutter=R,J.style.overflowY="hidden",J.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(b||W)&&(n.style.overflowY="scroll"),(q||Y)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:j||A?`calc(100dvh - ${j+A}px)`:"100dvh",width:M||z?`calc(100vw - ${M+z}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function y(){Object.assign(n.style,Ft),Object.assign(r.style,Mt),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Nt)}function C(){y(),p.request(c)}c();const d=P(s,"resize",C);return()=>{p.cancel(),y(),typeof s.removeEventListener=="function"&&d()}}class Ur{lockCount=0;restore=null;timeoutLock=Te.create();timeoutUnlock=Te.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=_(t),r=n.documentElement,s=n.body,o=Ge(r);if(Lt(o,r,s)){const u=new o.MutationObserver(()=>{Lt(o,r,s)||(u.disconnect(),this.restore=null,this.lock(t))}),p={attributes:!0};u.observe(r,p),u.observe(s,p),this.restore=()=>u.disconnect();return}const i=lt||!Wr(t);this.restore=i?Vr(t):Br(t)}}const Yr=new Ur;function Ds(e=!0,t=null){D(()=>{if(e)return Yr.acquire(t)},[e,t])}export{ys as $,fs as A,ar as B,St as C,as as D,ms as E,xs as F,hs as G,Ie as H,Ls as I,Ts as J,Kn as K,dn as L,Ce as M,Bn as N,je as O,Ns as P,ns as Q,Ar as R,Kr as S,Te as T,Xt as U,ss as V,pt as W,rs as X,Le as Y,Es as Z,br as _,P as a,Hr as a0,Dr as a1,Nr as a2,ds as a3,Ss as a4,Me as a5,is as a6,tn as a7,cs as a8,Ye as a9,ps as aa,$n as ab,Et as ac,Qe as ad,Gn as ae,Qr as af,Zr as ag,es as ah,ts as ai,lt as aj,gs as ak,Ds as al,jt as am,Cs as an,Ms as ao,$r as ap,ws as b,ks as c,As as d,Os as e,vr as f,Rs as g,Fs as h,os as i,vs as j,Ps as k,_e as l,Ue as m,hr as n,bs as o,ls as p,cr as q,qr as r,Jr as s,us as t,Is as u,zr as v,Dn as w,dt as x,Mr as y,pn as z};
|
|
1
|
+
import{j as Dt,b as Tn,T as bt,t as Rn,d as vn,r as he,a as xn,u as Cn,p as In}from"./inertValue-DFM3yqxg.js";import{aF as te,l as ve,aU as se,b6 as ct,aP as Ht,ai as De,e as D,r as a,j as ne,ak as Vt,n as ut,E as Be,f as G,b7 as On,k as wn,al as mt,g as Ge,aH as qe,aI as Pn,b8 as kn,b9 as An,ba as Fn,aV as Mn}from"./index-DJIyUCPa.js";import{a as w,o as W,m as pe,c as xe,x as Wt,w as at,b as _t,s as Bt,g as Se,t as Ut,q as Yt,n as Nn,p as Ln}from"./createBaseUIEventDetails-DJQs5QD1.js";const Dn=["open","progress","review","resolved"],Kr={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"},$r={open:"bg-status-open text-white",progress:"bg-status-progress text-[#16161a]",review:"bg-status-review text-white",resolved:"bg-status-resolved text-[#16161a]"};function qr(e){return Dn.includes(e)}function zr(e,t=Date.now()){if(!e)return"";const n=Math.max(0,(t-new Date(e).getTime())/1e3);return n<60?"now":n<3600?`${Math.floor(n/60)} min`:n<86400?`${Math.floor(n/3600)} h`:n<86400*30?`${Math.floor(n/86400)} d`:new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short"})}function Jr(e,t=""){const n=e.trim().split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():n.length===1&&n[0].length>0?n[0].slice(0,2).toUpperCase():(t[0]??"?").toUpperCase()}function Hn(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Vn,platform:Wn,maxTouchPoints:_n}=Hn(),Xe=Vn.toLowerCase(),Ne=Wn.toLowerCase(),lt=/^i(os$|p)/.test(Ne)||Ne==="macintel"&&_n>1,yt="android",tt=Ne===yt||Xe.includes(yt),Bn=!lt&&Ne.startsWith("mac");Ne.startsWith("win");const Un=Bn||lt,Ie=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ie&&Xe.includes("firefox");!Ie&&Xe.includes("chrom");const Yn=Un,jt=/jsdom|happydom/.test(Xe),nt="data-base-ui-focusable",Gt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Qr="ArrowLeft",Zr="ArrowRight",es="ArrowUp",ts="ArrowDown";function ns(e,t){if(!ve(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(w(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function ze(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function jn(e){return e.matches("html,body")}function Xt(e){return te(e)&&e.matches(Gt)}function rs(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Gt}`)!=null}function Et(e){return e?e.getAttribute("role")==="combobox"&&Xt(e):!1}function ss(e){if(!e||jt)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function St(e){return e?e.hasAttribute(nt)?e:e.querySelector(`[${nt}]`)||e:null}function Le(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Le(e,s.id,n)])}function Tt(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function Gn(e){e.preventDefault(),e.stopPropagation()}function Xn(e){return"nativeEvent"in e}function Kn(e){return e.pointerType===""&&e.isTrusted?!0:tt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $n(e){return jt?!1:!tt&&e.width===0&&e.height===0||tt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function os(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const zn='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Jn(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return ct(n)?n.host:null}function rt(e){for(const t of Array.from(e.children))if(se(t)==="summary")return t;return null}function Qn(e,t){const n=rt(t);return!!n&&(e===n||w(n,e))}function Kt(e){const t=e?se(e):"";return e!=null&&e.matches(zn)&&(t!=="summary"||e.parentElement!=null&&se(e.parentElement)==="details"&&rt(e.parentElement)===e)&&(t!=="details"||rt(e)==null)&&(t!=="input"||e.type!=="hidden")}function $t(e){if(!Kt(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Jn(t)){const n=t!==e,r=se(t)==="slot";if(t.hasAttribute("inert")||n&&se(t)==="details"&&!t.open&&!Qn(e,t)||t.hasAttribute("hidden")||!r&&!Zn(t,n))return!1}return!0}function Zn(e,t){const n=Ht(e);return t?n.display!=="none":Dt(e,n)}function qt(e){const t=e.tabIndex;if(t<0){const n=se(e);if(n==="details"||n==="audio"||n==="video"||te(e)&&e.isContentEditable)return 0}return t}function Je(e){if(se(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function er(e,t){const n=Je(e);if(!n)return!0;const r=t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=Je(s);return o?.name===n.name&&o.form===n.form})===n}function zt(e){if(te(e)&&se(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return te(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Jt(e,t){zt(e).forEach(n=>{Kt(n)&&t.push(n),Jt(n,t)})}function Qt(e,t,n){zt(e).forEach(r=>{te(r)&&r.matches(t)&&n.push(r),Qt(r,t,n)})}function ft(e){return $t(e)&&qt(e)>=0}function Zt(e){const t=[];return Jt(e,t),t.filter($t)}function He(e){const t=Zt(e);return t.filter(n=>qt(n)>=0&&er(n,t))}function en(e,t){const n=He(e),r=n.length;if(r===0)return;const s=pe(W(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function tn(e){return en(W(e).body,1)||e}function nn(e){return en(W(e).body,-1)||e}function rn(e,t){if(!e)return null;const n=He(W(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function is(e){return rn(e,1)}function cs(e){return rn(e,-1)}function Me(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!w(n,r)}function tr(e){He(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rt(e){const t=[];Qt(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Ae=0;class Te{static create(){return new Te}currentId=Ae;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ae,n()},t)}isStarted(){return this.currentId!==Ae}clear=()=>{this.currentId!==Ae&&(clearTimeout(this.currentId),this.currentId=Ae)};disposeEffect=()=>this.clear}function Ue(){const e=De(Te.create).current;return Tn(e.disposeEffect),e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=bt.startingStyle]="startingStyle",e[e.endingStyle=bt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const nr={"data-popup-open":""},rr={"data-popup-open":"","data-pressed":""},sr={"data-open":""},or={"data-closed":""},ir={"data-anchor-hidden":""},us={open(e){return e?nr:null}},as={open(e){return e?rr:null}},cr={open(e){return e?sr:or},anchorHidden(e){return e?ir:null}},ls={...cr,...Rn};function P(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ce(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function We(e){const t=De(ur,e).current;return t.next=e,D(t.effect),t}function ur(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const sn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ar={...sn,position:"fixed",top:0,left:0},fs={...sn,position:"absolute"},Ye=a.forwardRef(function(t,n){const[r,s]=a.useState();D(()=>{Yn&&Ie&&s("button")},[]);const o={tabIndex:0,role:r};return ne.jsx("span",{...t,ref:n,style:ar,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});function je(e){return`data-base-ui-${e}`}let _e=0;function Qe(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(_e);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),Vt;const i=requestAnimationFrame(o);return _e=i,()=>{_e===i&&(cancelAnimationFrame(i),_e=0)}}const Ze={inert:new WeakMap,"aria-hidden":new WeakMap},vt="data-base-ui-inert",st={inert:new WeakSet,"aria-hidden":new WeakSet};let Fe=new WeakMap,et=0;function lr(e){return st[e]}function on(e){return e?ct(e)?e.host:on(e.parentNode):null}const xt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=on(n);return e.contains(r)?r:null}).filter(n=>n!=null),Ct=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},It=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{se(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function fr(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const p=xt(t,e),c=s?It(t,Ct(p),new Set(p)):[],y=[],C=[];if(o){const d=Ze[o],g=lr(o);u=g,i=d;const v=xt(t,Array.from(t.querySelectorAll("[aria-live]"))),k=p.concat(v);It(t,Ct(k),new Set(k)).forEach(R=>{const b=R.getAttribute(o),q=b!==null&&b!=="false",V=(d.get(R)||0)+1;d.set(R,V),y.push(R),V===1&&q&&g.add(R),q||R.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(d=>{const g=(Fe.get(d)||0)+1;Fe.set(d,g),C.push(d),g===1&&d.setAttribute(vt,"")}),et+=1,()=>{i&&y.forEach(d=>{const v=(i.get(d)||0)-1;i.set(d,v),v||(!u?.has(d)&&o&&d.removeAttribute(o),u?.delete(d))}),s&&C.forEach(d=>{const g=(Fe.get(d)||0)-1;Fe.set(d,g),g||d.removeAttribute(vt)}),et-=1,et||(Ze.inert=new WeakMap,Ze["aria-hidden"]=new WeakMap,st.inert=new WeakSet,st["aria-hidden"]=new WeakSet,Fe=new WeakMap)}}function Ot(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=W(e[0]).body;return fr(e,o,n,r,{mark:s})}const ds=500,ps=500,gs={style:{transition:"none"}},dr="data-base-ui-click-trigger",hs={fallbackAxisSide:"none"},bs={fallbackAxisSide:"end"},pr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},cn=a.createContext(null),un=()=>a.useContext(cn),gr=je("portal");function hr(e={}){const{ref:t,container:n,componentProps:r=Be,elementProps:s}=e,o=at(),u=un()?.portalNode,[p,c]=a.useState(null),[y,C]=a.useState(null),d=G(S=>{S!==null&&C(S)}),g=a.useRef(null);D(()=>{if(n===null){g.current&&(g.current=null,C(null),c(null));return}const S=(n&&(On(n)?n:n.current))??u??document.body;if(S==null){g.current&&(g.current=null,C(null),c(null));return}g.current!==S&&(g.current=S,C(null),c(S))},[n,u]);const v=wn("div",r,{ref:[t,d],props:[{id:o,[gr]:""},s]}),k=p&&v?ut.createPortal(v,p):null;return{node:y,nodeId:a.isValidElement(v)?v.props.id:void 0,subtree:k}}const ms=a.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:u,...p}=t,{node:c,nodeId:y,subtree:C}=hr({container:u,ref:n,componentProps:t,elementProps:p}),d=a.useRef(null),g=a.useRef(null),v=a.useRef(null),k=a.useRef(null),[S,R]=a.useState(null),b=a.useRef(!1),q=S?.modal,V=S?.open,Y=!!S&&!S.modal&&S.open&&!!c;a.useEffect(()=>{if(!c||q)return;function A(j){c&&j.relatedTarget&&Me(j)&&(j.type==="focusin"?b.current&&(Rt(c),b.current=!1):(tr(c),b.current=!0))}return Ce(P(c,"focusin",A,!0),P(c,"focusout",A,!0))},[c,q]),D(()=>{!c||V!==!0||!b.current||(Rt(c),b.current=!1)},[V,c]);const z=a.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:g,beforeInsideRef:v,afterInsideRef:k,portalNode:c,setFocusManagerState:R}),[c]);return ne.jsxs(a.Fragment,{children:[C,ne.jsxs(cn.Provider,{value:z,children:[Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:d,onFocus:A=>{if(Me(A,c))v.current?.focus();else{const j=S?S.domReference:null;nn(j)?.focus()}}}),Y&&c&&ne.jsx("span",{"aria-owns":y,style:pr}),c&&ut.createPortal(i,c),Y&&c&&ne.jsx(Ye,{"data-type":"outside",ref:g,onFocus:A=>{if(Me(A,c))k.current?.focus();else{const j=S?S.domReference:null;tn(j)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,xe(Wt,A.nativeEvent))}}})]})]})});function an(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class br{nodesRef={current:[]};events=an();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ln=a.createContext(null),fn=a.createContext(null),dt=()=>a.useContext(ln)?.id||null,pt=e=>{const t=a.useContext(fn);return e??t};function ys(e){const t=at(),n=pt(e),r=dt();return D(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function Es(e){const{children:t,id:n}=e,r=dt();return ne.jsx(ln.Provider,{value:a.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Ss(e){const{children:t,externalTree:n}=e,r=De(()=>n??new br).current;return ne.jsx(fn.Provider,{value:r,children:t})}function mr(e,t){const n=Ge(Se(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const wt=20;let be=[];function gt(){be=be.filter(e=>e.deref()?.isConnected)}function Pt(e){gt(),e&&se(e)!=="body"&&(be.push(new WeakRef(e)),be.length>wt&&(be=be.slice(-wt)))}function kt(){return gt(),be[be.length-1]?.deref()}function yr(e){return e?ft(e)?e:He(e)[0]||e:null}function At(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return ft(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ts(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:p=!0,openInteractionType:c="",nextFocusableElement:y,previousFocusableElement:C,beforeContentFocusGuardRef:d,externalTree:g,getInsideElements:v}=e,k="rootStore"in t?t.rootStore:t,S=k.useState("open"),R=k.useState("domReferenceElement"),b=k.useState("floatingElement"),{events:q,dataRef:V}=k.context,Y=G(()=>V.current.floatingContext?.nodeId),z=s===!1,A=Et(R)&&z,j=We(s),M=We(o),J=We(c),Oe=We(S),_=pt(g),x=un(),U=a.useRef(!1),ae=a.useRef(!1),oe=a.useRef(!1),ie=a.useRef(null),me=a.useRef(""),ge=a.useRef(""),ye=a.useRef(null),Re=a.useRef(null),I=mt(ye,d,x?.beforeInsideRef),Q=mt(Re,x?.afterInsideRef),le=Ue(),fe=Ue(),we=vn(),Ve=x!=null,E=St(b),ce=G((T=E)=>T?He(T):[]),re=G(()=>v?.().filter(T=>T!=null)??[]);a.useEffect(()=>{if(r||!u)return;function T(B){B.key==="Tab"&&w(E,pe(W(E)))&&ce().length===0&&!A&&Gn(B)}const L=W(E);return P(L,"keydown",T)},[r,E,u,A,ce]),a.useEffect(()=>{if(r||!S)return;const T=W(E);function L(){oe.current=!1}function B(Z){const m=Se(Z),F=re(),h=w(b,m)||w(R,m)||w(x?.portalNode,m)||F.some(H=>H===m||w(H,m));oe.current=!h,ge.current=Z.pointerType||"keyboard",m?.closest(`[${dr}]`)&&(ae.current=!0,fe.start(0,()=>{ae.current=!1}))}function X(){ge.current="keyboard"}return Ce(P(T,"pointerdown",B,!0),P(T,"pointerup",L,!0),P(T,"pointercancel",L,!0),P(T,"keydown",X,!0),L)},[r,b,R,E,S,x,fe,re]),a.useEffect(()=>{if(r||!p)return;const T=W(E);function L(){ae.current=!0,fe.start(0,()=>{ae.current=!1})}function B(F){const h=Se(F);ft(h)&&(ie.current=h)}function X(F){const h=F.relatedTarget,H=F.currentTarget,K=Se(F);u&&h==null&&K!=null&&w(b,K)&&Pt(K),queueMicrotask(()=>{const N=Y(),ee=k.context.triggerElements,l=re(),f=h?.hasAttribute(je("focus-guard"))&&[ye.current,Re.current,x?.beforeInsideRef.current,x?.afterInsideRef.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,he(C),he(y)].includes(h),$=!(w(R,h)||w(b,h)||w(h,b)||w(x?.portalNode,h)||l.some(O=>O===h||w(O,h))||ee.hasMatchingElement(O=>w(O,h))||f||_&&(Le(_.nodesRef.current,N).find(O=>w(O.context?.elements.floating,h)||w(O.context?.elements.domReference,h))||Tt(_.nodesRef.current,N).find(O=>[O.context?.elements.floating,St(O.context?.elements.floating)].includes(h)||O.context?.elements.domReference===h)));if(H===R&&E&&At(E),i&&H!==R&&!Dt(K)&&pe(T)===T.body){if(te(E)&&(E.focus(),i==="popup")){we.request(()=>{E.focus()});return}const O=ce(),de=ie.current,Pe=(de&&O.includes(de)?de:null)||O[O.length-1]||E;te(Pe)&&Pe.focus()}if(V.current.insideReactTree){V.current.insideReactTree=!1;return}(A||!u)&&h&&$&&!ae.current&&(A||h!==kt())&&(U.current=!0,k.setOpen(!1,xe(Wt,F)))})}function Z(){oe.current||(V.current.insideReactTree=!0,le.start(0,()=>{V.current.insideReactTree=!1}))}const m=te(R)?R:null;if(!(!b&&!m))return Ce(m&&P(m,"focusout",X),m&&P(m,"pointerdown",L),b&&P(b,"focusin",B),b&&P(b,"focusout",X),b&&x&&P(b,"focusout",Z,!0))},[r,R,b,E,u,_,x,k,p,i,ce,A,Y,V,le,fe,we,y,C,re]),a.useEffect(()=>{if(r||!b||!S)return;const T=Array.from(x?.portalNode?.querySelectorAll(`[${je("portal")}]`)||[]),B=(_?Tt(_.nodesRef.current,Y()):[]).find(H=>Et(H.context?.elements.domReference||null))?.context?.elements.domReference,Z=[...[b,...T,ye.current,Re.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,...re()],B,he(C),he(y),A?R:null].filter(H=>H!=null),m=Ot(Z,{ariaHidden:u||A,mark:!1}),F=[b,...T].filter(H=>H!=null),h=Ot(F);return()=>{h(),m()}},[S,r,R,b,u,x,A,_,Y,y,C,re]),D(()=>{if(!S||r||!te(E))return;me.current="",ge.current="";const T=W(E),L=pe(T);queueMicrotask(()=>{const B=j.current,X=typeof B=="function"?B(J.current||""):B;if(X===void 0||X===!1||w(E,L))return;let m=null;const F=()=>(m==null&&(m=ce(E)),m[0]||E);let h;X===!0||X===null?h=F():h=he(X),h=h||F();const H=w(E,pe(T));Qe(h,{preventScroll:h===E,shouldFocus(){if(!Oe.current)return!1;if(H)return!0;const K=pe(T);return!(K!==h&&w(E,K))}})})},[r,S,E,ce,j,J,Oe]),D(()=>{if(r||!E)return;const T=W(E),L=pe(T),B=J.current==null;Pt(L);function X(m){if(m.open||(me.current=mr(m.nativeEvent,ge.current)),m.reason===_t&&m.nativeEvent.type==="mouseleave"&&(U.current=!0),m.reason===Bt)if(m.nested)U.current=!1;else if(Kn(m.nativeEvent)||$n(m.nativeEvent))U.current=!1;else{let F=!1;W(E).createElement("div").focus({get preventScroll(){return F=!0,!1}}),F?U.current=!1:U.current=!0}}q.on("openchange",X);function Z(m){const F=M.current;let h=typeof F=="function"?F(m):F;if(h===void 0||h===!1)return null;h===null&&(h=!0);const H=R?.isConnected?R:null,K=L?.isConnected&&se(L)!=="body"?L:null;let N=B?K||H:H||K;return N||(N=kt()||null),typeof h=="boolean"?N:he(h)||N||null}return()=>{q.off("openchange",X);const m=pe(T),F=re(),h=w(b,m)||F.some(ee=>ee===m||w(ee,m))||_&&Le(_.nodesRef.current,Y(),!1).some(ee=>w(ee.context?.elements.floating,m)),H=M.current,K=me.current,N=Z(K);queueMicrotask(()=>{const ee=yr(N),l=typeof H!="boolean";if(H&&!U.current&&te(ee)&&(!(!l&&ee!==m&&m!==T.body)||h)){const f={preventScroll:!0};K==="keyboard"&&(f.focusVisible=!0),ee.focus(f)}U.current=!1})}},[r,b,E,M,J,q,_,R,Y,re]),D(()=>{if(!Ie||S||!b)return;const T=pe(W(b));!te(T)||!Xt(T)||w(b,T)&&T.blur()},[S,b]),D(()=>{if(!(r||!x))return x.setFocusManagerState({modal:u,closeOnFocusOut:p,open:S,onOpenChange:k.setOpen,domReference:R}),()=>{x.setFocusManagerState(null)}},[r,x,u,S,k,p,R]),D(()=>{if(!(r||!E))return At(E),()=>{queueMicrotask(gt)}},[r,E]);const Ee=!r&&(u?!A:!0)&&(Ve||u);return ne.jsxs(a.Fragment,{children:[Ee&&ne.jsx(Ye,{"data-type":"inside",ref:I,onFocus:T=>{if(u){const L=ce();Qe(L[L.length-1])}else x?.portalNode&&(U.current=!1,Me(T,x.portalNode)?tn(R)?.focus():he(C??x.beforeOutsideRef)?.focus())}}),n,Ee&&ne.jsx(Ye,{"data-type":"inside",ref:Q,onFocus:T=>{u?Qe(ce()[0]):x?.portalNode&&(p&&(U.current=!0),Me(T,x.portalNode)?nn(R)?.focus():he(y??x.afterOutsideRef)?.focus())}})]})}function Er(){return!1}function Sr(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Rs(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=Er,bubbles:u,externalTree:p}=t,c="rootStore"in e?e.rootStore:e,y=c.useState("open"),C=c.useState("floatingElement"),{dataRef:d}=c.context,g=pt(p),v=G(typeof s=="function"?s:()=>!1),k=typeof s=="function"?v:s,S=k!==!1,R=G(()=>o),{escapeKey:b,outsidePress:q}=Sr(u),V=a.useRef(!1),Y=a.useRef(!1),z=a.useRef(!1),A=a.useRef(!1),j=a.useRef(""),M=a.useRef(null),J=Ue(),Oe=Ue(),_=G(()=>{Oe.clear(),d.current.insideReactTree=!1}),x=G(I=>{const Q=d.current.floatingContext?.nodeId;return(g?Le(g.nodesRef.current,Q):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[I])}),U=G(I=>ze(I,c.select("floatingElement"))||ze(I,c.select("domReferenceElement"))),ae=G(I=>{i()&&c.setOpen(!1,xe(Ut,I.nativeEvent))}),oe=G(I=>{if(!y||!n||!r||I.key!=="Escape"||A.current||!b&&x("__escapeKeyBubbles"))return;const Q=Xn(I)?I.nativeEvent:I,le=xe(Yt,Q);c.setOpen(!1,le),le.isCanceled||I.preventDefault(),!b&&!le.isPropagationAllowed&&I.stopPropagation()}),ie=G(()=>{d.current.insideReactTree=!0,Oe.start(0,_)}),me=G(I=>{if(!y||!n||I.button!==0)return;const Q=Se(I.nativeEvent);w(c.select("floatingElement"),Q)&&(V.current||(V.current=!0,Y.current=!1))}),ge=G(I=>{!y||!n||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&V.current&&(Y.current=!0)});a.useEffect(()=>{if(!y||!n)return _;d.current.__escapeKeyBubbles=b,d.current.__outsidePressBubbles=q;const I=new Te,Q=new Te;function le(){I.clear(),A.current=!0}function fe(){I.start(Ie?5:0,()=>{A.current=!1})}function we(){z.current=!0,Q.start(0,()=>{z.current=!1})}function Ve(){V.current=!1,Y.current=!1}function E(){const l=j.current,f=l==="pen"||!l?"mouse":l,$=R(),O=typeof $=="function"?$():$;return typeof O=="string"?O:O[f]}function ce(l){const f=E();return f==="intentional"&&l.type!=="click"||f==="sloppy"&&l.type==="click"}function re(l){const f=d.current.floatingContext?.nodeId,$=g&&Le(g.nodesRef.current,f).some(O=>ze(l,O.context?.elements.floating));return U(l)||$}function Ee(l){if(ce(l)){l.type!=="click"&&!U(l)&&(Q.clear(),z.current=!1),_();return}if(d.current.insideReactTree){_();return}const f=Se(l),$=`[${je("inert")}]`,O=ve(f)?f.getRootNode():null,de=Array.from((ct(O)?O:W(c.select("floatingElement"))).querySelectorAll($)),Pe=c.context.triggerElements;if(f&&(Pe.hasElement(f)||Pe.hasMatchingElement(ue=>w(ue,f))))return;let ke=ve(f)?f:null;for(;ke&&!qe(ke);){const ue=Pn(ke);if(qe(ue)||!ve(ue))break;ke=ue}if(!(de.length&&ve(f)&&!jn(f)&&!w(f,c.select("floatingElement"))&&de.every(ue=>!w(ke,ue)))){if(te(f)&&!("touches"in l)){const ue=qe(f),$e=Ht(f),ht=/auto|scroll/,gn=ue||ht.test($e.overflowX),hn=ue||ht.test($e.overflowY),bn=gn&&f.clientWidth>0&&f.scrollWidth>f.clientWidth,mn=hn&&f.clientHeight>0&&f.scrollHeight>f.clientHeight,yn=$e.direction==="rtl",En=mn&&(yn?l.offsetX<=f.offsetWidth-f.clientWidth:l.offsetX>f.clientWidth),Sn=bn&&l.offsetY>f.clientHeight;if(En||Sn)return}if(!re(l)){if(E()==="intentional"&&z.current){Q.clear(),z.current=!1;return}typeof k=="function"&&!k(l)||x("__outsidePressBubbles")||(c.setOpen(!1,xe(Bt,l)),_())}}}function T(l){E()!=="sloppy"||l.pointerType==="touch"||!c.select("open")||!n||U(l)||Ee(l)}function L(l){if(E()!=="sloppy"||!c.select("open")||!n||U(l))return;const f=l.touches[0];f&&(M.current={startTime:Date.now(),startX:f.clientX,startY:f.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},J.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function B(l,f){const $=Se(l);if(!$)return;const O=P($,l.type,()=>{f(l),O()})}function X(l){j.current="touch",B(l,L)}function Z(l){J.clear(),l.type==="pointerdown"&&(j.current=l.pointerType),!(l.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&B(l,f=>{f.type==="pointerdown"?T(f):Ee(f)})}function m(l){if(!V.current)return;const f=Y.current;if(Ve(),E()==="intentional"){if(l.type==="pointercancel"){f&&we();return}if(!re(l)){if(f){we();return}typeof k=="function"&&!k(l)||(Q.clear(),z.current=!0,_())}}}function F(l){if(E()!=="sloppy"||!M.current||U(l))return;const f=l.touches[0];if(!f)return;const $=Math.abs(f.clientX-M.current.startX),O=Math.abs(f.clientY-M.current.startY),de=Math.sqrt($*$+O*O);de>5&&(M.current.dismissOnTouchEnd=!0),de>10&&(Ee(l),J.clear(),M.current=null)}function h(l){B(l,F)}function H(l){E()!=="sloppy"||!M.current||U(l)||(M.current.dismissOnTouchEnd&&Ee(l),J.clear(),M.current=null)}function K(l){B(l,H)}const N=W(C),ee=Ce(r&&Ce(P(N,"keydown",oe),P(N,"compositionstart",le),P(N,"compositionend",fe)),S&&Ce(P(N,"click",Z,!0),P(N,"pointerdown",Z,!0),P(N,"pointerup",m,!0),P(N,"pointercancel",m,!0),P(N,"mousedown",Z,!0),P(N,"mouseup",m,!0),P(N,"touchstart",X,!0),P(N,"touchmove",h,!0),P(N,"touchend",K,!0)));return()=>{ee(),I.clear(),Q.clear(),Ve(),z.current=!1,_()}},[d,C,r,S,k,y,n,b,q,oe,_,R,x,U,g,c,J]);const ye=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ae,onClick:ae}),[oe,ae]),Re=a.useMemo(()=>({onKeyDown:oe,onPointerDown:ge,onMouseDown:ge,onClickCapture:ie,onMouseDownCapture(I){ie(),me(I)},onPointerDownCapture(I){ie(),me(I)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[oe,ie,me,ge]);return a.useMemo(()=>n?{reference:ye,floating:Re,trigger:ye}:{},[n,ye,Re])}var dn=kn();const ot=[];let it;function Tr(){return it}function Rr(e){ot.push(e)}function vr(e){const t=(n,r)=>{const s=De(xr).current;let o;try{it=s;for(const i of ot)i.before(s);o=e(n,r);for(const i of ot)i.after(s);s.didInitialize=!0}finally{it=void 0}return o};return t.displayName=e.displayName||e.name,t}function vs(e){return a.forwardRef(vr(e))}function xr(){return{didInitialize:!1}}const Cr=An(19),Ir=Cr?wr:Pr;function pn(e,t,n,r,s){return Ir(e,t,n,r,s)}function Or(e,t,n,r,s){const o=a.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return dn.useSyncExternalStore(e.subscribe,o,o)}Rr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),dn.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function wr(e,t,n,r,s){const o=Tr();if(!o)return Or(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let u;return o.didInitialize?(u=o.syncHooks[i],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(o.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(u)),u.value}function Pr(e,t,n,r,s){return Fn.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class kr{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return pn(this,t,n,r,s)}}class Ar extends kr{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){a.useDebugValue(t);const r=this;D(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;D(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);D(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){a.useDebugValue(t);const r=this,s=n!==void 0;D(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return a.useDebugValue(t),pn(this,this.selectors[t],n,r,s)}useContextCallback(t,n){a.useDebugValue(t);const r=G(n??Vt);this.context[t]=r}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const u=s;s=i,n(i,u,this)}})}}const Fr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Mr extends Ar{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:an(),nested:r,triggerElements:o},Fr),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&qn(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function Nr(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),p=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),y=t.context.triggerElements,C=i,d=a.useRef(null);r===void 0&&d.current===null&&(d.current=new Mr({open:u,transitionStatus:void 0,referenceElement:p,floatingElement:c,triggerElements:y,onOpenChange:C,floatingId:s,syncOnly:!0,nested:o}));const g=r??d.current;return t.useSyncedValue("floatingId",s),D(()=>{const v={open:u,floatingId:s,referenceElement:p,floatingElement:c};ve(p)&&(v.domReferenceElement=p),g.state.positionReference===g.state.referenceElement&&(v.positionReference=p),g.update(v)},[u,s,p,c,g]),g.context.onOpenChange=C,g.context.nested=o,g}const xs={tabIndex:-1,[nt]:""};function Cs(e){return t=>t==="touch"?e.current:!0}function Is(e,t=!1){const n=at(),r=dt()!=null,s=De(()=>e(n,r)).current;return Nr({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Os({handle:e,store:t}){return D(()=>e.attachStore(t),[e,t]),null}function Lr(e,t){const n=a.useRef(null),r=a.useRef(null);return a.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,p=t.context.triggerElements.getById(i);u&&p===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Dr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function Hr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ws(e,t,n,r={}){const s=n.reason,o=s===_t,i=t&&s===Ln,u=!t&&(s===Ut||s===Yt),p=Hr(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const y={...r.extraState,open:t};i?y.instantType="focus":u?y.instantType="dismiss":o&&(y.instantType=void 0),Dr(y,t,n.trigger,p()),e.update(y)};o?ut.flushSync(c):c()}function Ps(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Lr(e,n),i=G(p=>{const c=n.select("open"),y=n.select("activeTriggerId");if(y===e){n.update({activeTriggerElement:p,...c?r:null});return}y==null&&c&&n.update({activeTriggerId:e,activeTriggerElement:p,...r})}),u=a.useCallback(p=>{o(p),p&&i(p)},[o,i]);return D(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:s}}function ks(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=a.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),u=e.useState("activeTriggerElement");D(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const p=e.context.triggerElements.size,c={};e.state.triggerCount!==p&&(c.triggerCount=p);const y=e.select("activeTriggerId");let C=null;if(y){const d=e.context.triggerElements.getById(y);if(d)r.current=y,d!==e.state.activeTriggerElement&&(c.activeTriggerElement=d);else{for(const[g,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g;break}c.activeTriggerId===void 0&&(r.current===y?C=y:r.current=null)}}else r.current=null;if(!C&&!y&&p===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[g,v]=d.value;c.activeTriggerId=g,c.activeTriggerElement=v,r.current=g}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),C&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===C&&!e.context.triggerElements.getById(C)){const d=xe(Nn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,u,n])}function As(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=xn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const p=G(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Cn({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||p()}}),{forceUnmount:p,transitionStatus:o}}function Fs(e,t){e.useSyncedValues(t),D(()=>()=>{e.update({activeTriggerProps:Be,inactiveTriggerProps:Be,popupProps:Be})},[e])}function Ms(e,t){D(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),D(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Ns{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}const Ls=a.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return ne.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let Ft={},Mt={},Nt="";function Ke(e,t){return Mn(e)?e:t}function Lt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ke(t,n)).overflowY)}function Vr(e){if(typeof document>"u")return!1;const t=W(e);return Ge(t).innerWidth-t.documentElement.clientWidth>0}function Wr(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=W(e),r=n.documentElement,s=n.body,o=Ke(r,s),i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const p=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,p===c}function _r(e){const t=W(e),n=t.documentElement,r=t.body,s=Ke(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Br(e){const t=W(e),n=t.documentElement,r=t.body,s=Ge(n);let o=0,i=0,u=!1;const p=In.create();if(Ie&&(s.visualViewport?.scale??1)!==1)return()=>{};function c(){const g=s.getComputedStyle(n),v=s.getComputedStyle(r),R=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Ft={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nt=n.style.scrollBehavior,Mt={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,q=n.scrollWidth>n.clientWidth,V=g.overflowY==="scroll"||v.overflowY==="scroll",Y=g.overflowX==="scroll"||v.overflowX==="scroll",z=Math.max(0,s.innerWidth-r.clientWidth),A=Math.max(0,s.innerHeight-r.clientHeight),j=parseFloat(v.marginTop)+parseFloat(v.marginBottom),M=parseFloat(v.marginLeft)+parseFloat(v.marginRight),J=Ke(n,r);if(u=Wr(e),u){n.style.scrollbarGutter=R,J.style.overflowY="hidden",J.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(b||V)&&(n.style.overflowY="scroll"),(q||Y)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:j||A?`calc(100dvh - ${j+A}px)`:"100dvh",width:M||z?`calc(100vw - ${M+z}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function y(){Object.assign(n.style,Ft),Object.assign(r.style,Mt),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Nt)}function C(){y(),p.request(c)}c();const d=P(s,"resize",C);return()=>{p.cancel(),y(),typeof s.removeEventListener=="function"&&d()}}class Ur{lockCount=0;restore=null;timeoutLock=Te.create();timeoutUnlock=Te.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=W(t),r=n.documentElement,s=n.body,o=Ge(r);if(Lt(o,r,s)){const u=new o.MutationObserver(()=>{Lt(o,r,s)||(u.disconnect(),this.restore=null,this.lock(t))}),p={attributes:!0};u.observe(r,p),u.observe(s,p),this.restore=()=>u.disconnect();return}const i=lt||!Vr(t);this.restore=i?_r(t):Br(t)}}const Yr=new Ur;function Ds(e=!0,t=null){D(()=>{if(e)return Yr.acquire(t)},[e,t])}export{Ss as $,Ce as A,Bn as B,Ie as C,je as D,ns as E,xs as F,Xt as G,ss as H,pt as I,dt as J,rs as K,Le as L,Ts as M,ms as N,hs as O,Ns as P,Ls as Q,Ar as R,Kr as S,Te as T,Es as U,br as V,ys as W,Hr as X,Dr as Y,Nr as Z,ds as _,P as a,Me as a0,is as a1,tn as a2,cs as a3,as as a4,Ye as a5,ps as a6,Mr as a7,pn as a8,St as a9,Kn as aa,$n as ab,Et as ac,Qe as ad,Gn as ae,Qr as af,Zr as ag,es as ah,ts as ai,lt as aj,gs as ak,Ds as al,jt as am,Cs as an,Ms as ao,$r as ap,ws as b,ks as c,As as d,Os as e,vr as f,Rs as g,Fs as h,os as i,vs as j,Ps as k,We as l,Ue as m,hr as n,bs as o,ls as p,cr as q,qr as r,Jr as s,us as t,Is as u,zr as v,Dn as w,fs as x,ar as y,dn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,f as c,e as n}from"./index-
|
|
1
|
+
import{r as s,f as c,e as n}from"./index-DJIyUCPa.js";function u(e,r){const t=s.useRef(e),a=c(r);n(()=>{t.current!==e&&a(t.current),t.current=e},[e,a])}export{u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as z,V as E,p as F,d as B,r as l,j as e,G as L,h as k,B as n,s as w,A as x,C as S}from"./index-
|
|
1
|
+
import{c as z,V as E,p as F,d as B,r as l,j as e,G as L,h as k,B as n,s as w,A as x,C as S}from"./index-DJIyUCPa.js";import{C as f}from"./card-BV6fjgTi.js";import{L as C,I as q}from"./label-BO35zXgP.js";import{I as P}from"./InstallTag-07IMzmgd.js";import{C as R}from"./check-nWqm4QA9.js";import{A}from"./arrow-left-BpbzTF1L.js";import"./createBaseUIEventDetails-DJQs5QD1.js";import"./CompositeList-Cc2N74pm.js";import"./isElementDisabled-CwHw_lZC.js";import"./inertValue-DFM3yqxg.js";import"./useCompositeItem-Dj-Nx-92.js";import"./copy-BlkC45lz.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|