contentrain 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +168 -0
  3. package/dist/context-An3xrvcP.mjs +50 -0
  4. package/dist/diff-otz0kGqT.mjs +116 -0
  5. package/dist/doctor-DyKjAIKH.mjs +187 -0
  6. package/dist/generate-DDEDRLdy.mjs +76 -0
  7. package/dist/index.mjs +21 -0
  8. package/dist/init-D5L_7bKE.mjs +415 -0
  9. package/dist/serve-CaCZMeHF.mjs +111 -0
  10. package/dist/serve-ui/assets/AgentPromptGroup.vue_vue_type_script_setup_true_lang-Dy-5bpEY.js +16 -0
  11. package/dist/serve-ui/assets/AppLayout-CJFq2ApF.js +16 -0
  12. package/dist/serve-ui/assets/BranchDetailPage-DzSu3JlE.js +17 -0
  13. package/dist/serve-ui/assets/BranchesPage-ZSG-l44J.js +6 -0
  14. package/dist/serve-ui/assets/CollapsibleTrigger.vue_vue_type_script_setup_true_lang-C4oejwcu.js +1 -0
  15. package/dist/serve-ui/assets/Collection-zzx9pNd2.js +6 -0
  16. package/dist/serve-ui/assets/ConfigProvider-BGjDLViI.js +1 -0
  17. package/dist/serve-ui/assets/ContentListPage-DTFaQB8N.js +51 -0
  18. package/dist/serve-ui/assets/ContentListPage-vXxAeSg8.css +1 -0
  19. package/dist/serve-ui/assets/ContentPage-4sQsAlY2.js +1 -0
  20. package/dist/serve-ui/assets/DashboardPage-CZDlnvAE.js +21 -0
  21. package/dist/serve-ui/assets/DialogTitle.vue_vue_type_script_setup_true_lang-CBu_dmA6.js +1 -0
  22. package/dist/serve-ui/assets/Input.vue_vue_type_script_setup_true_lang-otPltlZG.js +6 -0
  23. package/dist/serve-ui/assets/ModelDetailPage-BMquKCtH.js +49 -0
  24. package/dist/serve-ui/assets/ModelsPage-C_K-aWXf.js +1 -0
  25. package/dist/serve-ui/assets/NormalizePage-CHkT6yLV.js +11 -0
  26. package/dist/serve-ui/assets/PageHeader.vue_vue_type_script_setup_true_lang-C7aWxNSw.js +11 -0
  27. package/dist/serve-ui/assets/Presence-cbB6AqkQ.js +3 -0
  28. package/dist/serve-ui/assets/Separator.vue_vue_type_script_setup_true_lang-fePFl24S.js +1 -0
  29. package/dist/serve-ui/assets/StudioHint.vue_vue_type_script_setup_true_lang-B45TG2r1.js +6 -0
  30. package/dist/serve-ui/assets/TrustBadge.vue_vue_type_script_setup_true_lang-CgoQGS6k.js +11 -0
  31. package/dist/serve-ui/assets/ValidatePage-BW8DO6WC.js +21 -0
  32. package/dist/serve-ui/assets/arrow-down-DqOfGL7C.js +6 -0
  33. package/dist/serve-ui/assets/arrow-left-BRvgeveW.js +6 -0
  34. package/dist/serve-ui/assets/book-marked-D8StxRZP.js +6 -0
  35. package/dist/serve-ui/assets/book-open-BrGAe3tk.js +6 -0
  36. package/dist/serve-ui/assets/box-7olVZr5D.js +6 -0
  37. package/dist/serve-ui/assets/chevron-down-B9YdCtsj.js +6 -0
  38. package/dist/serve-ui/assets/chevron-right-DFKsmZVd.js +6 -0
  39. package/dist/serve-ui/assets/content-BQE3NEm5.js +1 -0
  40. package/dist/serve-ui/assets/database-BGEFn4Oq.js +6 -0
  41. package/dist/serve-ui/assets/file-code-BGiS4dun.js +6 -0
  42. package/dist/serve-ui/assets/file-text-BDHXQ95W.js +6 -0
  43. package/dist/serve-ui/assets/getActiveElement-FUKBWQwh.js +1 -0
  44. package/dist/serve-ui/assets/git-branch-DdE7bk9-.js +6 -0
  45. package/dist/serve-ui/assets/git-merge-iStuJS69.js +6 -0
  46. package/dist/serve-ui/assets/hash-B-ibLpM1.js +6 -0
  47. package/dist/serve-ui/assets/index-C-RjMzFm.css +1 -0
  48. package/dist/serve-ui/assets/index-CoUshYEB.js +80 -0
  49. package/dist/serve-ui/assets/index-WHgvdYOs.js +1 -0
  50. package/dist/serve-ui/assets/languages-BTcd2Rl1.js +6 -0
  51. package/dist/serve-ui/assets/model-empty-state-B6AM4bil.js +1 -0
  52. package/dist/serve-ui/assets/plus-D8Nd3YnG.js +11 -0
  53. package/dist/serve-ui/assets/project-B1qSm0Fz.js +1 -0
  54. package/dist/serve-ui/assets/scan-search-DGPL_VJu.js +6 -0
  55. package/dist/serve-ui/assets/settings-DL-0RaxD.js +6 -0
  56. package/dist/serve-ui/assets/shield-check-CUL7KkSA.js +6 -0
  57. package/dist/serve-ui/assets/trash-2-83QhL6-T.js +11 -0
  58. package/dist/serve-ui/assets/useDirection-Cd3C7VdT.js +1 -0
  59. package/dist/serve-ui/assets/useFormatters-DgWFpsAv.js +1 -0
  60. package/dist/serve-ui/assets/useId-C0uR6mdj.js +1 -0
  61. package/dist/serve-ui/assets/useNonce-DTGvzOJz.js +1 -0
  62. package/dist/serve-ui/assets/useWatch-COpVIQvm.js +1 -0
  63. package/dist/serve-ui/favicon.svg +19 -0
  64. package/dist/serve-ui/for-developers-1.svg +65 -0
  65. package/dist/serve-ui/icon-color.svg +18 -0
  66. package/dist/serve-ui/index.html +17 -0
  67. package/dist/serve-ui/logo/color-icon-black-text.svg +65 -0
  68. package/dist/serve-ui/logo/color-icon-white-text.svg +61 -0
  69. package/dist/serve-ui/merge-1.svg +131 -0
  70. package/dist/serve-ui/merge-2.svg +161 -0
  71. package/dist/serve-ui/model-empty-state.svg +12 -0
  72. package/dist/serve-ui/select-data-type.svg +23 -0
  73. package/dist/server-DW0KXB0T.mjs +607 -0
  74. package/dist/status-kF5miVty.mjs +122 -0
  75. package/dist/ui-B5mXontH.mjs +33 -0
  76. package/dist/validate-DnVamp3p.mjs +155 -0
  77. package/package.json +66 -0
@@ -0,0 +1,17 @@
1
+ import{c as M,a as w,o as n,b as m,e as s,f as j,m as N,u as e,i as te,z as O,p as f,y as L,j as t,s as d,g as z,E as D,q as u,B as o,L as R,F as T,x as E,h as k,r as A,X as V,C as ue,v as de}from"./index-CoUshYEB.js";import{u as pe}from"./content-BQE3NEm5.js";import{a as C,_ as fe}from"./PageHeader.vue_vue_type_script_setup_true_lang-C7aWxNSw.js";import{_ as me,C as _e,a as W}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-Dy-5bpEY.js";import{_ as he}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CgoQGS6k.js";import{_ as G,a as ve,b as ge,c as ye,d as be}from"./CollapsibleTrigger.vue_vue_type_script_setup_true_lang-C4oejwcu.js";import{_ as xe}from"./Separator.vue_vue_type_script_setup_true_lang-fePFl24S.js";import{i as se,D as ke,_ as U,b as X,c as H,d as Z}from"./DialogTitle.vue_vue_type_script_setup_true_lang-CBu_dmA6.js";import{b as ze,u as Ce}from"./useId-C0uR6mdj.js";import{u as ae}from"./Presence-cbB6AqkQ.js";import{P as le,r as we,d as $e}from"./useWatch-COpVIQvm.js";import{A as Be}from"./arrow-left-BRvgeveW.js";import{G as J}from"./git-merge-iStuJS69.js";import{G as K}from"./git-branch-DdE7bk9-.js";import{P as De,M as je}from"./plus-D8Nd3YnG.js";import{F as Fe}from"./file-text-BDHXQ95W.js";import"./shield-check-CUL7KkSA.js";import"./getActiveElement-FUKBWQwh.js";import"./ConfigProvider-BGjDLViI.js";/**
2
+ * @license lucide-vue-next v0.474.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 qe=M("CircleCheckBigIcon",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
7
+ * @license lucide-vue-next v0.474.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 Ie=M("CircleXIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
12
+ * @license lucide-vue-next v0.474.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 Pe=M("FileIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);var Te=w({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(g){const _=g;ae();const i=se();return(p,a)=>(n(),m(e(le),N(_,{id:e(i).descriptionId}),{default:s(()=>[j(p.$slots,"default")]),_:3},16,["id"]))}}),Ae=Te,Ne=w({__name:"DialogTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(g){const _=g,i=se(),{forwardRef:p,currentElement:a}=ae();return i.contentId||(i.contentId=ze(void 0,"reka-dialog-content")),te(()=>{i.triggerElement.value=a.value}),(h,v)=>(n(),m(e(le),N(_,{ref:e(p),type:h.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":e(i).open.value||!1,"aria-controls":e(i).open.value?e(i).contentId:void 0,"data-state":e(i).open.value?"open":"closed",onClick:e(i).onOpenToggle}),{default:s(()=>[j(h.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","onClick"]))}}),Re=Ne;const Q=w({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(g){const _=g,i=we(_,"class"),p=Ce(i);return(a,h)=>(n(),m(e(Ae),N({"data-slot":"dialog-description"},e(p),{class:e(O)("text-muted-foreground text-sm",_.class)}),{default:s(()=>[j(a.$slots,"default")]),_:3},16,["class"]))}}),Y=w({__name:"DialogFooter",props:{class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!1}},setup(g){const _=g;return(i,p)=>(n(),f("div",{"data-slot":"dialog-footer",class:L(e(O)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",_.class))},[j(i.$slots,"default"),g.showCloseButton?(n(),m(e(ke),{key:0,"as-child":""},{default:s(()=>[t(e(C),{variant:"outline"},{default:s(()=>[...p[0]||(p[0]=[d(" Close ",-1)])]),_:1})]),_:1})):z("",!0)],2))}}),ee=w({__name:"DialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(g){const _=g;return(i,p)=>(n(),m(e(Re),N({"data-slot":"dialog-trigger"},_),{default:s(()=>[j(i.$slots,"default")]),_:3},16))}}),We="/merge-2.svg",Le={class:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs"},Me={class:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs"},Oe={class:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs"},Se={class:"px-6 py-6 space-y-4"},Ee={class:"text-sm"},Ve={key:1,class:"flex justify-center py-12"},Ge={class:"flex items-center gap-4 flex-wrap"},Ue={class:"flex items-center gap-2"},Xe={class:"text-xs font-mono bg-muted px-2 py-1 rounded"},He={class:"flex items-center gap-2"},Ze={class:"text-xs font-mono bg-primary/10 text-primary px-2 py-1 rounded"},Je={class:"ml-auto flex items-center gap-3 text-xs text-muted-foreground"},Ke={class:"flex items-center gap-1"},Qe={class:"flex items-center gap-1 text-status-success"},Ye={class:"flex items-center gap-1 text-status-error"},et={key:0,class:"rounded-lg border border-border bg-muted/30 p-4 font-mono text-xs text-muted-foreground overflow-x-auto whitespace-pre-wrap"},tt={key:1,class:"space-y-3"},st={class:"font-mono text-xs text-foreground flex-1 truncate"},at={class:"flex items-center gap-2 text-xs shrink-0"},lt={key:0,class:"text-status-success font-mono"},rt={key:1,class:"text-status-error font-mono"},ot={class:"max-h-96 overflow-auto custom-scrollbar"},nt={class:"p-0 m-0"},it={class:"block text-xs leading-5"},ct={key:2,class:"flex flex-col items-center py-12 text-center"},ut={class:"text-sm text-muted-foreground"},Ft=w({__name:"BranchDetailPage",setup(g){const _=de(),i=ue(),p=pe(),a=$e("serve-ui-texts").locale("en").get(),h=k(()=>decodeURIComponent(_.params.branchName)),v=k(()=>p.branchDiff),y=A(!1),b=A(null),F=A(!1),q=A(!1),I=k(()=>{const l=h.value.replace("contentrain/","").split("/");return{scope:l[0]??"unknown",target:l.length>2?l.slice(1,-1).join("/"):l[1]??"",timestamp:l.length>2?l[l.length-1]??"":""}}),$=k(()=>{var P;if(!((P=v.value)!=null&&P.diff))return[];const x=v.value.diff,l=[];let r=null;for(const c of x.split(`
17
+ `))if(c.startsWith("diff --git")){r&&l.push(r);const B=c.match(/b\/(.+)$/);r={path:(B==null?void 0:B[1])??"unknown",additions:0,deletions:0,lines:[]},r.lines.push({text:c,type:"header"})}else r&&(c.startsWith("+++")||c.startsWith("---")||c.startsWith("index ")?r.lines.push({text:c,type:"header"}):c.startsWith("@@")?r.lines.push({text:c,type:"hunk"}):c.startsWith("+")?(r.additions++,r.lines.push({text:c,type:"add"})):c.startsWith("-")?(r.deletions++,r.lines.push({text:c,type:"remove"})):r.lines.push({text:c,type:"context"}));return r&&l.push(r),l}),re=k(()=>$.value.reduce((x,l)=>x+l.additions,0)),oe=k(()=>$.value.reduce((x,l)=>x+l.deletions,0)),ne=k(()=>h.value.includes("normalize")),S=k(()=>{var l;if(!((l=v.value)!=null&&l.stat))return 0;const x=v.value.stat.match(/(\d+)\s+files?\s+changed/);return x?Number.parseInt(x[1],10):$.value.length});async function ie(){y.value=!0,b.value=null,F.value=!1;try{await p.approveBranch(h.value),b.value={type:"success",message:a["branch-detail.branch-merged-successfully"]},D.success(a["branch-detail.branch-merged-successfully"]),setTimeout(()=>i.push("/branches"),1500)}catch{b.value={type:"error",message:a["branch-detail.failed-to-merge-branch"]},D.error(a["branch-detail.failed-to-merge-branch"])}finally{y.value=!1}}async function ce(){y.value=!0,b.value=null,q.value=!1;try{await p.rejectBranch(h.value),b.value={type:"success",message:a["branch-detail.branch-rejected-and-deleted"]},D.success(a["branch-detail.branch-rejected-and-deleted"]),setTimeout(()=>i.push("/branches"),1500)}catch{b.value={type:"error",message:a["branch-detail.failed-to-delete-branch"]},D.error(a["branch-detail.failed-to-delete-branch"])}finally{y.value=!1}}return te(async()=>{try{await p.fetchBranchDiff(h.value)}catch{D.error("Failed to load branch data.")}}),(x,l)=>(n(),f("div",null,[t(fe,{title:I.value.target||I.value.scope,description:e(a)["branch-detail.branch-review-and-diff"]},{actions:s(()=>[t(e(C),{variant:"ghost",size:"sm",onClick:l[0]||(l[0]=r=>e(i).push("/branches"))},{default:s(()=>[t(e(Be),{class:"mr-1.5 size-4"}),d(" "+o(e(a)["branch-detail.back"]),1)]),_:1}),t(e(U),{open:F.value,"onUpdate:open":l[2]||(l[2]=r=>F.value=r)},{default:s(()=>[t(e(ee),{"as-child":""},{default:s(()=>[t(e(C),{variant:"default",size:"sm",disabled:y.value||!v.value},{default:s(()=>[t(e(J),{class:"mr-1.5 size-4"}),d(" "+o(e(a)["branch-detail.approve-merge"]),1)]),_:1},8,["disabled"])]),_:1}),t(e(X),null,{default:s(()=>[t(e(H),null,{default:s(()=>[t(e(Z),null,{default:s(()=>[d(o(e(a)["branch-detail.confirm-merge"]),1)]),_:1}),t(e(Q),null,{default:s(()=>{var r;return[d(o(e(a)["branch-detail.this-will-merge"])+" ",1),u("code",Le,o(h.value),1),d(" "+o(e(a)["branch-detail.into"])+" ",1),u("code",Me,o(((r=v.value)==null?void 0:r.base)??"main"),1),d(" "+o(e(a)["branch-detail.and-delete-the-source"]),1)]}),_:1})]),_:1}),t(e(Y),null,{default:s(()=>[t(e(C),{variant:"outline",size:"sm",onClick:l[1]||(l[1]=r=>F.value=!1)},{default:s(()=>[d(o(e(a)["branch-detail.cancel"]),1)]),_:1}),t(e(C),{variant:"default",size:"sm",disabled:y.value,onClick:ie},{default:s(()=>[y.value?(n(),m(e(R),{key:0,class:"mr-1.5 size-4 animate-spin"})):(n(),m(e(_e),{key:1,class:"mr-1.5 size-4"})),d(" "+o(e(a)["branch-detail.merge"]),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]),t(e(U),{open:q.value,"onUpdate:open":l[4]||(l[4]=r=>q.value=r)},{default:s(()=>[t(e(ee),{"as-child":""},{default:s(()=>[t(e(C),{variant:"destructive",size:"sm",disabled:y.value||!v.value},{default:s(()=>[t(e(V),{class:"mr-1.5 size-4"}),d(" "+o(e(a)["branch-detail.reject"]),1)]),_:1},8,["disabled"])]),_:1}),t(e(X),null,{default:s(()=>[t(e(H),null,{default:s(()=>[t(e(Z),null,{default:s(()=>[d(o(e(a)["branch-detail.confirm-rejection"]),1)]),_:1}),t(e(Q),null,{default:s(()=>[d(o(e(a)["branch-detail.this-will-permanently-delete"])+" ",1),u("code",Oe,o(h.value),1),l[5]||(l[5]=d(". All changes in this branch will be lost. ",-1))]),_:1})]),_:1}),t(e(Y),null,{default:s(()=>[t(e(C),{variant:"outline",size:"sm",onClick:l[3]||(l[3]=r=>q.value=!1)},{default:s(()=>[d(o(e(a)["branch-detail.cancel"]),1)]),_:1}),t(e(C),{variant:"destructive",size:"sm",disabled:y.value,onClick:ce},{default:s(()=>[y.value?(n(),m(e(R),{key:0,class:"mr-1.5 size-4 animate-spin"})):(n(),m(e(V),{key:1,class:"mr-1.5 size-4"})),d(" "+o(e(a)["branch-detail.delete-branch"]),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])]),_:1},8,["title","description"]),u("div",Se,[b.value?(n(),f("div",{key:0,class:L(e(O)("flex items-center gap-3 rounded-lg border p-4",b.value.type==="success"?"border-status-success/30 bg-status-success/5":"border-status-error/30 bg-status-error/5"))},[b.value.type==="success"?(n(),m(e(qe),{key:0,class:"size-5 text-status-success shrink-0"})):(n(),m(e(Ie),{key:1,class:"size-5 text-status-error shrink-0"})),u("span",Ee,o(b.value.message),1)],2)):z("",!0),e(p).loading?(n(),f("div",Ve,[t(e(R),{class:"size-6 animate-spin text-primary"})])):v.value?(n(),f(T,{key:2},[t(e(G),null,{default:s(()=>[t(e(ve),{class:"p-4"},{default:s(()=>[u("div",Ge,[u("div",Ue,[t(e(K),{class:"size-4 text-muted-foreground"}),u("code",Xe,o(v.value.base),1)]),t(e(J),{class:"size-4 text-primary"}),u("div",He,[t(e(K),{class:"size-4 text-primary"}),u("code",Ze,o(h.value.replace("contentrain/","")),1)]),u("div",Je,[t(e(he),{status:I.value.scope==="normalize"?"pending":"partial",reason:I.value.scope==="normalize"?"Review required":void 0},null,8,["status","reason"]),u("span",Ke,[t(e(Pe),{class:"size-3"}),d(" "+o(S.value)+" "+o(e(a)["branch-detail.file"])+o(S.value!==1?"s":""),1)]),u("span",Qe,[t(e(De),{class:"size-3"}),d(" "+o(re.value),1)]),u("span",Ye,[t(e(je),{class:"size-3"}),d(" "+o(oe.value),1)])])])]),_:1})]),_:1}),v.value.stat?(n(),f("pre",et,o(v.value.stat),1)):z("",!0),$.value.length>0?(n(),f("div",tt,[(n(!0),f(T,null,E($.value,(r,P)=>(n(),m(e(be),{key:P,"default-open":!0},{default:s(()=>[t(e(G),{class:"overflow-hidden"},{default:s(()=>[t(e(ge),{class:"flex w-full items-center gap-3 p-3 hover:bg-muted/50 transition-colors text-left"},{default:s(()=>[t(e(Fe),{class:"size-4 text-muted-foreground shrink-0"}),u("span",st,o(r.path),1),u("div",at,[r.additions>0?(n(),f("span",lt,"+"+o(r.additions),1)):z("",!0),r.deletions>0?(n(),f("span",rt,"-"+o(r.deletions),1)):z("",!0)])]),_:2},1024),t(e(ye),null,{default:s(()=>[t(e(xe)),u("div",ot,[u("pre",nt,[u("code",it,[(n(!0),f(T,null,E(r.lines,(c,B)=>(n(),f(T,{key:B},[c.type!=="header"?(n(),f("span",{key:0,class:L([{"bg-status-success/10 text-status-success":c.type==="add","bg-status-error/10 text-status-error":c.type==="remove","bg-primary/5 text-primary font-medium":c.type==="hunk","text-muted-foreground":c.type==="context"},"block px-4 font-mono"])},o(c.text),3)):z("",!0)],64))),128))])])])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),t(me,{title:e(a)["branch-detail.ask-your-agent"],class:"mt-4"},{default:s(()=>[t(W,{prompt:e(a)["branch-detail.review-the-changes-on"]},null,8,["prompt"]),t(W,{prompt:e(a)["branch-detail.check-the-content-quality"]},null,8,["prompt"]),ne.value?(n(),m(W,{key:0,prompt:e(a)["branch-detail.continue-with-phase-2"]},null,8,["prompt"])):z("",!0)]),_:1},8,["title"])])):(n(),f("div",ct,[l[6]||(l[6]=u("img",{src:We,alt:"",class:"empty-illustration mb-4"},null,-1)),u("p",ut,o(e(a)["branch-detail.no-diff-available-for"]),1)]))],64)):z("",!0)])]))}});export{Ft as default};
@@ -0,0 +1,6 @@
1
+ import{c as he,a as I,t as J,o as d,b as C,e as c,j as p,u as e,f as k,r as $,i as W,l as _e,h as T,K as ye,U as xe,M as we,n as Ce,g as Y,P as Se,H as Te,m as O,z as F,I as Ie,J as ke,p as S,q as m,E as Be,L as K,s as R,B as w,F as U,x as H,y as z,A as X,C as Fe}from"./index-CoUshYEB.js";import{u as qe}from"./content-BQE3NEm5.js";import{P as A,r as D,d as Re,u as $e}from"./useWatch-COpVIQvm.js";import{_ as Ae,a as Z}from"./PageHeader.vue_vue_type_script_setup_true_lang-C7aWxNSw.js";import{_ as Ve}from"./StudioHint.vue_vue_type_script_setup_true_lang-B45TG2r1.js";import{_ as ee,a as E}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-Dy-5bpEY.js";import{_ as N}from"./index-WHgvdYOs.js";import{b as le,a as Me,u as ze}from"./useId-C0uR6mdj.js";import{f as ie,c as ue,u as L,P as Pe}from"./Presence-cbB6AqkQ.js";import{u as de}from"./useDirection-Cd3C7VdT.js";import{u as ce,R as Ee}from"./Collection-zzx9pNd2.js";import{g as te}from"./getActiveElement-FUKBWQwh.js";import{G}from"./git-branch-DdE7bk9-.js";import{C as Oe}from"./chevron-right-DFKsmZVd.js";import{S as De}from"./shield-check-CUL7KkSA.js";import{S as Le}from"./scan-search-DGPL_VJu.js";import{D as je}from"./database-BGEFn4Oq.js";import{F as ae}from"./file-text-BDHXQ95W.js";import{S as se}from"./settings-DL-0RaxD.js";import{L as Ke,T as Ue}from"./trash-2-83QhL6-T.js";import{G as He}from"./git-merge-iStuJS69.js";import{B as Ne}from"./box-7olVZr5D.js";import"./ConfigProvider-BGjDLViI.js";/**
2
+ * @license lucide-vue-next v0.474.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=he("HistoryIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),Ge="rovingFocusGroup.onEntryFocus",Ye={bubbles:!1,cancelable:!0},Je={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function We(r,t){return t!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function Qe(r,t,o){const a=We(r.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return Je[a]}function pe(r,t=!1){const o=te();for(const a of r)if(a===o||(a.focus({preventScroll:t}),te()!==o))return}function Xe(r,t){return r.map((o,a)=>r[(t+a)%r.length])}const[Ze,et]=ue("RovingFocusGroup");var tt=I({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(r,{expose:t,emit:o}){const a=r,s=o,{loop:h,orientation:_,dir:g}=J(a),b=de(g),l=ie(a,"currentTabStopId",s,{defaultValue:a.defaultCurrentTabStopId,passive:a.currentTabStopId===void 0}),i=$(!1),u=$(!1),x=$(0),{getItems:P,CollectionSlot:q}=ce({isProvider:!0});function j(f){const v=!u.value;if(f.currentTarget&&f.target===f.currentTarget&&v&&!i.value){const n=new CustomEvent(Ge,Ye);if(f.currentTarget.dispatchEvent(n),s("entryFocus",n),!n.defaultPrevented){const y=P().map(B=>B.ref).filter(B=>B.dataset.disabled!==""),M=y.find(B=>B.getAttribute("data-active")===""),ge=y.find(B=>B.getAttribute("data-highlighted")===""),ve=y.find(B=>B.id===l.value),be=[M,ge,ve,...y].filter(Boolean);pe(be,a.preventScrollOnEntryFocus)}}u.value=!1}function V(){setTimeout(()=>{u.value=!1},1)}return t({getItems:P}),et({loop:h,dir:b,orientation:_,currentTabStopId:l,onItemFocus:f=>{l.value=f},onItemShiftTab:()=>{i.value=!0},onFocusableItemAdd:()=>{x.value++},onFocusableItemRemove:()=>{x.value--}}),(f,v)=>(d(),C(e(q),null,{default:c(()=>[p(e(A),{tabindex:i.value||x.value===0?-1:0,"data-orientation":e(_),as:f.as,"as-child":f.asChild,dir:e(b),style:{outline:"none"},onMousedown:v[0]||(v[0]=n=>u.value=!0),onMouseup:V,onFocus:j,onBlur:v[1]||(v[1]=n=>i.value=!1)},{default:c(()=>[k(f.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),at=tt,st=I({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){const t=r,o=Ze(),a=le(),s=T(()=>t.tabStopId||a),h=T(()=>o.currentTabStopId.value===s.value),{getItems:_,CollectionItem:g}=ce();W(()=>{t.focusable&&o.onFocusableItemAdd()}),_e(()=>{t.focusable&&o.onFocusableItemRemove()});function b(l){if(l.key==="Tab"&&l.shiftKey){o.onItemShiftTab();return}if(l.target!==l.currentTarget)return;const i=Qe(l,o.orientation.value,o.dir.value);if(i!==void 0){if(l.metaKey||l.ctrlKey||l.altKey||!t.allowShiftKey&&l.shiftKey)return;l.preventDefault();let u=[..._().map(x=>x.ref).filter(x=>x.dataset.disabled!=="")];if(i==="last")u.reverse();else if(i==="prev"||i==="next"){i==="prev"&&u.reverse();const x=u.indexOf(l.currentTarget);u=o.loop.value?Xe(u,x+1):u.slice(x+1)}ye(()=>pe(u))}}return(l,i)=>(d(),C(e(g),null,{default:c(()=>[p(e(A),{tabindex:h.value?0:-1,"data-orientation":e(o).orientation.value,"data-active":l.active?"":void 0,"data-disabled":l.focusable?void 0:"",as:l.as,"as-child":l.asChild,onMousedown:i[0]||(i[0]=u=>{l.focusable?e(o).onItemFocus(s.value):u.preventDefault()}),onFocus:i[1]||(i[1]=u=>e(o).onItemFocus(s.value)),onKeydown:b},{default:c(()=>[k(l.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),ot=st;const[Q,rt]=ue("TabsRoot");var nt=I({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(r,{emit:t}){const o=r,a=t,{orientation:s,unmountOnHide:h,dir:_}=J(o),g=de(_);L();const b=ie(o,"modelValue",a,{defaultValue:o.defaultValue,passive:o.modelValue===void 0}),l=$(),i=xe(new Set);return rt({modelValue:b,changeModelValue:u=>{b.value=u},orientation:s,dir:g,unmountOnHide:h,activationMode:o.activationMode,baseId:le(void 0,"reka-tabs"),tabsList:l,contentIds:i,registerContent:u=>{i.value=new Set([...i.value,u])},unregisterContent:u=>{const x=new Set(i.value);x.delete(u),i.value=x}}),(u,x)=>(d(),C(e(A),{dir:e(g),"data-orientation":e(s),"as-child":u.asChild,as:u.as},{default:c(()=>[k(u.$slots,"default",{modelValue:e(b)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),lt=nt;function fe(r,t){return`${r}-trigger-${t}`}function me(r,t){return`${r}-content-${t}`}var it=I({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const t=r,{forwardRef:o}=L(),a=Q(),s=T(()=>fe(a.baseId,t.value)),h=T(()=>me(a.baseId,t.value)),_=T(()=>t.value===a.modelValue.value),g=$(_.value);return W(()=>{a.registerContent(t.value),requestAnimationFrame(()=>{g.value=!1})}),we(()=>{a.unregisterContent(t.value)}),(b,l)=>(d(),C(e(Pe),{present:b.forceMount||_.value,"force-mount":""},{default:c(({present:i})=>[p(e(A),{id:h.value,ref:e(o),"as-child":b.asChild,as:b.as,role:"tabpanel","data-state":_.value?"active":"inactive","data-orientation":e(a).orientation.value,"aria-labelledby":s.value,hidden:!i,tabindex:"0",style:Ce({animationDuration:g.value?"0s":void 0})},{default:c(()=>[!e(a).unmountOnHide.value||i?k(b.$slots,"default",{key:0}):Y("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ut=it,dt=I({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const t=r,{loop:o}=J(t),{forwardRef:a,currentElement:s}=L(),h=Q();return h.tabsList=s,(_,g)=>(d(),C(e(at),{"as-child":"",orientation:e(h).orientation.value,dir:e(h).dir.value,loop:e(o)},{default:c(()=>[p(e(A),{ref:e(a),role:"tablist","as-child":_.asChild,as:_.as,"aria-orientation":e(h).orientation.value},{default:c(()=>[k(_.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),ct=dt,pt=I({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const t=r,{forwardRef:o}=L(),a=Q(),s=T(()=>fe(a.baseId,t.value)),h=T(()=>a.contentIds.value.has(t.value)?me(a.baseId,t.value):void 0),_=T(()=>t.value===a.modelValue.value);return(g,b)=>(d(),C(e(ot),{"as-child":"",focusable:!g.disabled,active:_.value},{default:c(()=>[p(e(A),{id:s.value,ref:e(o),role:"tab",type:g.as==="button"?"button":void 0,as:g.as,"as-child":g.asChild,"aria-selected":_.value?"true":"false","aria-controls":h.value,"data-state":_.value?"active":"inactive",disabled:g.disabled,"data-disabled":g.disabled?"":void 0,"data-orientation":e(a).orientation.value,onMousedown:b[0]||(b[0]=Te(l=>{!g.disabled&&l.ctrlKey===!1?e(a).changeModelValue(g.value):l.preventDefault()},["left"])),onKeydown:b[1]||(b[1]=Se(l=>e(a).changeModelValue(g.value),["enter","space"])),onFocus:b[2]||(b[2]=()=>{const l=e(a).activationMode!=="manual";!_.value&&!g.disabled&&l&&e(a).changeModelValue(g.value)})},{default:c(()=>[k(g.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),ft=pt;const mt="/merge-1.svg",gt=I({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(r,{emit:t}){const o=r,a=t,s=D(o,"class"),h=Me(s,a);return(_,g)=>(d(),C(e(lt),O({"data-slot":"tabs"},e(h),{class:e(F)("flex flex-col gap-2",o.class)}),{default:c(b=>[k(_.$slots,"default",Ie(ke(b)))]),_:3},16,["class"]))}}),re=I({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(r){const t=r,o=D(t,"class");return(a,s)=>(d(),C(e(ut),O({"data-slot":"tabs-content",class:e(F)("flex-1 outline-none",t.class)},e(o)),{default:c(()=>[k(a.$slots,"default")]),_:3},16,["class"]))}}),vt=I({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(r){const t=r,o=D(t,"class");return(a,s)=>(d(),C(e(ct),O({"data-slot":"tabs-list"},e(o),{class:e(F)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t.class)}),{default:c(()=>[k(a.$slots,"default")]),_:3},16,["class"]))}}),ne=I({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(r){const t=r,o=D(t,"class"),a=ze(o);return(s,h)=>(d(),C(e(ft),O({"data-slot":"tabs-trigger",class:e(F)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t.class)},e(a)),{default:c(()=>[k(s.$slots,"default")]),_:3},16,["class"]))}}),bt={class:"px-6 py-6"},ht={key:0,class:"flex justify-center py-12"},_t={key:1,class:"flex flex-col items-center py-16 text-center"},yt={class:"text-lg font-semibold"},xt={class:"mt-2 max-w-sm text-sm text-muted-foreground"},wt={key:2,class:"space-y-2"},Ct={class:"flex-1 min-w-0"},St={class:"flex items-center gap-2 flex-wrap"},Tt={class:"font-mono text-sm font-medium text-foreground truncate"},It={class:"font-mono text-xs text-muted-foreground truncate"},kt={key:0,class:"flex justify-center py-12"},Bt={key:1,class:"flex flex-col items-center py-16 text-center"},Ft={class:"text-lg font-semibold"},qt={class:"mt-2 text-sm text-muted-foreground"},Rt={key:2,class:"space-y-8"},$t={class:"sticky top-0 z-10 mb-3 flex items-center gap-2 bg-background/95 backdrop-blur py-1"},At={class:"shrink-0 text-xs font-medium text-muted-foreground"},Vt={class:"relative ml-5 border-l-2 border-border pl-6 space-y-4"},Mt={class:"rounded-lg border border-border bg-card p-3"},zt={class:"flex items-start gap-2"},Pt={class:"flex-1 min-w-0"},Et={class:"flex items-center gap-2 flex-wrap"},Ot={key:0,class:"font-mono text-xs font-medium text-foreground truncate"},Dt={class:"mt-1 text-xs text-muted-foreground truncate"},Lt={class:"flex flex-col items-end gap-0.5 shrink-0"},jt={class:"text-[10px] text-muted-foreground"},Kt={class:"font-mono text-[10px] text-muted-foreground/50"},Ut={class:"mt-1.5 flex items-center gap-2 text-[10px] text-muted-foreground"},ma=I({__name:"BranchesPage",setup(r){const t=qe(),o=Fe(),a=$("pending"),s=Re("serve-ui-texts").locale("en").get(),h=T(()=>t.branches);function _(f){const n=f.name.replace("contentrain/","").split("/");return{name:f.name,scope:n[0]??"unknown",target:n.length>2?n.slice(1,-1).join("/"):n[1]??"",timestamp:n.length>2?n[n.length-1]??"":"",current:f.current}}const g=T(()=>h.value.map(_)),b={content:{icon:ae,color:"text-primary",bg:"bg-primary/10",label:s["branches.content"]},model:{icon:je,color:"text-status-info",bg:"bg-status-info/10",label:s["branches.model"]},normalize:{icon:Le,color:"text-status-warning",bg:"bg-status-warning/10",label:s["branches.normalize"]},validate:{icon:De,color:"text-status-success",bg:"bg-status-success/10",label:s["branches.validate"]}},l={icon:G,color:"text-muted-foreground",bg:"bg-muted",label:s["branches.branch"]};function i(f){return b[f]??l}const u=T(()=>t.history),x={model_create:{icon:Ne,color:"text-status-info",bg:"bg-status-info/10",label:s["branches.model-created"]},model_update:{icon:se,color:"text-status-info",bg:"bg-status-info/10",label:s["branches.model-updated"]},content_save:{icon:ae,color:"text-primary",bg:"bg-primary/10",label:s["branches.content-saved"]},delete:{icon:Ue,color:"text-status-error",bg:"bg-status-error/10",label:s["branches.deleted"]},merge:{icon:He,color:"text-status-success",bg:"bg-status-success/10",label:s["branches.merged"]},context_update:{icon:Ke,color:"text-muted-foreground",bg:"bg-muted",label:"Context"},operation:{icon:se,color:"text-muted-foreground",bg:"bg-muted",label:s["branches.operation"]}},P={icon:G,color:"text-muted-foreground",bg:"bg-muted",label:"Other"};function q(f){return x[f]??P}const j=T(()=>{const f=[];let v="";for(const n of u.value){const M=new Date(n.date).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});M!==v&&(v=M,f.push({date:M,entries:[]})),f[f.length-1].entries.push(n)}return f});async function V(){try{await Promise.all([t.fetchBranches(),t.fetchHistory()])}catch{Be.error("Failed to load branches or history")}}return W(()=>{V()}),$e(f=>{(f.type==="branch:created"||f.type==="branch:merged")&&V()}),(f,v)=>(d(),S("div",null,[p(Ae,{title:e(s)["branches.branches-history"],description:e(s)["branches.review-pending-changes-and"]},{actions:c(()=>[p(e(Z),{variant:"outline",size:"sm",disabled:e(t).loading,onClick:v[0]||(v[0]=n=>V())},{default:c(()=>[e(t).loading?(d(),C(e(K),{key:0,class:"size-4 animate-spin"})):(d(),C(e(Ee),{key:1,class:"size-4"})),R(" "+w(e(s)["branches.refresh"]),1)]),_:1},8,["disabled"])]),_:1},8,["title","description"]),m("div",bt,[p(e(gt),{modelValue:a.value,"onUpdate:modelValue":v[1]||(v[1]=n=>a.value=n),class:"w-full"},{default:c(()=>[p(e(vt),{class:"mb-6"},{default:c(()=>[p(e(ne),{value:"pending",class:"gap-1.5"},{default:c(()=>[p(e(G),{class:"size-3.5"}),v[2]||(v[2]=R(" Pending ",-1)),h.value.length>0?(d(),C(e(N),{key:0,variant:"secondary",class:"ml-1 h-5 px-1.5 text-[10px]"},{default:c(()=>[R(w(h.value.length),1)]),_:1})):Y("",!0)]),_:1}),p(e(ne),{value:"history",class:"gap-1.5"},{default:c(()=>[p(e(oe),{class:"size-3.5"}),v[3]||(v[3]=R(" History ",-1))]),_:1})]),_:1}),p(e(re),{value:"pending"},{default:c(()=>[e(t).loading&&h.value.length===0?(d(),S("div",ht,[p(e(K),{class:"size-6 animate-spin text-primary"})])):h.value.length===0?(d(),S("div",_t,[v[4]||(v[4]=m("img",{src:mt,alt:"",class:"empty-illustration mb-6"},null,-1)),m("h2",yt,w(e(s)["branches.no-pending-branches"]),1),m("p",xt,w(e(s)["branches.aigenerated-changes-from-your"]),1),p(ee,{title:e(s)["branches.try-asking-your-ai"],class:"mt-6 w-full max-w-md"},{default:c(()=>[p(E,{prompt:e(s)["branches.create-a-new-content"]},null,8,["prompt"]),p(E,{prompt:e(s)["branches.normalize-my-project-extract"]},null,8,["prompt"]),p(E,{prompt:e(s)["branches.add-sample-content-to"]},null,8,["prompt"])]),_:1},8,["title"])])):(d(),S("div",wt,[(d(!0),S(U,null,H(g.value,n=>(d(),C(e(Z),{key:n.name,variant:"ghost",class:"group flex w-full h-auto items-center gap-4 rounded-xl border border-border bg-card p-4 text-left transition-all hover:border-primary/30 hover:shadow-sm",onClick:y=>e(o).push(`/branches/${encodeURIComponent(n.name)}`)},{default:c(()=>[m("div",{class:z(e(F)("flex size-10 items-center justify-center rounded-lg",i(n.scope).bg))},[(d(),C(X(i(n.scope).icon),{class:z(e(F)("size-5",i(n.scope).color))},null,8,["class"]))],2),m("div",Ct,[m("div",St,[m("span",Tt,w(n.target||n.scope),1)]),m("span",It,w(n.name),1)]),p(e(N),{class:z([e(F)(i(n.scope).bg,i(n.scope).color),"text-[10px] uppercase shrink-0"])},{default:c(()=>[R(w(i(n.scope).label),1)]),_:2},1032,["class"]),p(e(Oe),{class:"size-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]),_:2},1032,["onClick"]))),128))]))]),_:1}),p(e(re),{value:"history"},{default:c(()=>[e(t).loading&&u.value.length===0?(d(),S("div",kt,[p(e(K),{class:"size-6 animate-spin text-primary"})])):u.value.length===0?(d(),S("div",Bt,[p(e(oe),{class:"mb-4 size-12 text-muted-foreground/30"}),m("h2",Ft,w(e(s)["branches.no-history-yet"]),1),m("p",qt,w(e(s)["branches.contentrain-operations-will-appear"]),1),p(ee,{title:e(s)["branches.get-started"],class:"mt-6 w-full max-w-md"},{default:c(()=>[p(E,{prompt:e(s)["branches.initialize-my-contentrain-project"]},null,8,["prompt"])]),_:1},8,["title"])])):(d(),S("div",Rt,[(d(!0),S(U,null,H(j.value,n=>(d(),S("section",{key:n.date},[m("div",$t,[v[5]||(v[5]=m("div",{class:"h-px flex-1 bg-border"},null,-1)),m("span",At,w(n.date),1),v[6]||(v[6]=m("div",{class:"h-px flex-1 bg-border"},null,-1))]),m("div",Vt,[(d(!0),S(U,null,H(n.entries,y=>(d(),S("div",{key:y.hash,class:"relative"},[m("div",{class:z(e(F)("absolute -left-7.75 flex size-5 items-center justify-center rounded-full border-2 border-background",q(y.type).bg))},[(d(),C(X(q(y.type).icon),{class:z(e(F)("size-2.5",q(y.type).color))},null,8,["class"]))],2),m("div",Mt,[m("div",zt,[m("div",Pt,[m("div",Et,[p(e(N),{variant:"secondary",class:"text-[10px]"},{default:c(()=>[R(w(q(y.type).label),1)]),_:2},1024),y.target?(d(),S("span",Ot,w(y.target),1)):Y("",!0)]),m("p",Dt,w(y.message),1)]),m("div",Lt,[m("span",jt,w(y.relativeDate),1),m("span",Kt,w(y.hash),1)])]),m("div",Ut,[m("span",null,"by "+w(y.author),1)])])]))),128))])]))),128))]))]),_:1})]),_:1},8,["modelValue"]),p(Ve,{message:e(s)["branches.share-branch-reviews-with"],class:"mt-6"},null,8,["message"])])]))}});export{ma as default};
@@ -0,0 +1 @@
1
+ import{a as d,t as N,o as u,b as m,e as c,f as p,u as e,r as v,w as F,i as I,j as M,m as y,g as D,h as w,K as E,p as R,y as x,z as P,I as H,J as j}from"./index-CoUshYEB.js";import{b as S,a as V}from"./useId-C0uR6mdj.js";import{f as z,u as B,c as J,k as K,P as L}from"./Presence-cbB6AqkQ.js";import{P as $}from"./useWatch-COpVIQvm.js";const[T,G]=J("CollapsibleRoot");var Q=d({__name:"CollapsibleRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:open"],setup(n,{expose:l,emit:a}){const o=n,r=z(o,"open",a,{defaultValue:o.defaultOpen,passive:o.open===void 0}),{disabled:i,unmountOnHide:f}=N(o);return G({contentId:"",disabled:i,open:r,unmountOnHide:f,onOpenToggle:()=>{i.value||(r.value=!r.value)}}),l({open:r}),B(),(_,C)=>(u(),m(e($),{as:_.as,"as-child":o.asChild,"data-state":e(r)?"open":"closed","data-disabled":e(i)?"":void 0},{default:c(()=>[p(_.$slots,"default",{open:e(r)})]),_:3},8,["as","as-child","data-state","data-disabled"]))}}),U=Q,W=d({inheritAttrs:!1,__name:"CollapsibleContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["contentFound"],setup(n,{emit:l}){const a=n,o=l,s=T();s.contentId||(s.contentId=S(void 0,"reka-collapsible-content"));const r=v(),{forwardRef:i,currentElement:f}=B(),_=v(0),C=v(0),O=w(()=>s.open.value),h=v(O.value),b=v();F(()=>{var t;return[O.value,(t=r.value)==null?void 0:t.present]},async()=>{await E();const t=f.value;if(!t)return;b.value=b.value||{transitionDuration:t.style.transitionDuration,animationName:t.style.animationName},t.style.transitionDuration="0s",t.style.animationName="none";const g=t.getBoundingClientRect();C.value=g.height,_.value=g.width,h.value||(t.style.transitionDuration=b.value.transitionDuration,t.style.animationName=b.value.animationName)},{immediate:!0});const A=w(()=>h.value&&s.open.value);return I(()=>{requestAnimationFrame(()=>{h.value=!1})}),K(f,"beforematch",t=>{requestAnimationFrame(()=>{s.onOpenToggle(),o("contentFound")})}),(t,g)=>(u(),m(e(L),{ref_key:"presentRef",ref:r,present:t.forceMount||e(s).open.value,"force-mount":!0},{default:c(({present:k})=>{var q;return[M(e($),y(t.$attrs,{id:e(s).contentId,ref:e(i),"as-child":a.asChild,as:t.as,hidden:k?void 0:e(s).unmountOnHide.value?"":"until-found","data-state":A.value?void 0:e(s).open.value?"open":"closed","data-disabled":(q=e(s).disabled)!=null&&q.value?"":void 0,style:{"--reka-collapsible-content-height":`${C.value}px`,"--reka-collapsible-content-width":`${_.value}px`}}),{default:c(()=>[!e(s).unmountOnHide.value||k?p(t.$slots,"default",{key:0}):D("v-if",!0)]),_:2},1040,["id","as-child","as","hidden","data-state","data-disabled","style"])]}),_:3},8,["present"]))}}),X=W,Y=d({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(n){const l=n;B();const a=T();return(o,s)=>{var r,i;return u(),m(e($),{type:o.as==="button"?"button":void 0,as:o.as,"as-child":l.asChild,"aria-controls":e(a).contentId,"aria-expanded":e(a).open.value,"data-state":e(a).open.value?"open":"closed","data-disabled":(r=e(a).disabled)!=null&&r.value?"":void 0,disabled:(i=e(a).disabled)==null?void 0:i.value,onClick:e(a).onOpenToggle},{default:c(()=>[p(o.$slots,"default")]),_:3},8,["type","as","as-child","aria-controls","aria-expanded","data-state","data-disabled","disabled","onClick"])}}}),Z=Y;const se=d({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(n){const l=n;return(a,o)=>(u(),R("div",{"data-slot":"card",class:x(e(P)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",l.class))},[p(a.$slots,"default")],2))}}),ne=d({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(n){const l=n;return(a,o)=>(u(),R("div",{"data-slot":"card-content",class:x(e(P)("px-6",l.class))},[p(a.$slots,"default")],2))}}),le=d({__name:"Collapsible",props:{defaultOpen:{type:Boolean},open:{type:Boolean},disabled:{type:Boolean},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:open"],setup(n,{emit:l}){const s=V(n,l);return(r,i)=>(u(),m(e(U),y({"data-slot":"collapsible"},e(s)),{default:c(f=>[p(r.$slots,"default",H(j(f)))]),_:3},16))}}),re=d({__name:"CollapsibleContent",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(n){const l=n;return(a,o)=>(u(),m(e(X),y({"data-slot":"collapsible-content"},l),{default:c(()=>[p(a.$slots,"default")]),_:3},16))}}),ie=d({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean},as:{}},setup(n){const l=n;return(a,o)=>(u(),m(e(Z),y({"data-slot":"collapsible-trigger"},l),{default:c(()=>[p(a.$slots,"default")]),_:3},16))}});export{se as _,ne as a,ie as b,re as c,le as d};
@@ -0,0 +1,6 @@
1
+ import{c as I,h as f,r as v,Z as w,a as d,k as S,_ as p,w as x,$,a0 as T}from"./index-CoUshYEB.js";import{S as h}from"./useWatch-COpVIQvm.js";import{e as _}from"./Presence-cbB6AqkQ.js";/**
2
+ * @license lucide-vue-next v0.474.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 b=I("RefreshCwIcon",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);function M(){const n=v(),u=f(()=>{var s,a;return["#text","#comment"].includes((s=n.value)==null?void 0:s.$el.nodeName)?(a=n.value)==null?void 0:a.$el.nextElementSibling:_(n)});return{primitiveElement:n,currentElement:u}}const y="data-reka-collection-item";function g(n={}){const{key:u="",isProvider:s=!1}=n,a=`${u}CollectionProvider`;let e;if(s){const r=v(new Map);e={collectionRef:v(),itemMap:r},T(a,e)}else e=w(a);const E=(r=!1)=>{const o=e.collectionRef.value;if(!o)return[];const l=Array.from(o.querySelectorAll(`[${y}]`)),t=Array.from(e.itemMap.value.values()).sort((i,m)=>l.indexOf(i.ref)-l.indexOf(m.ref));return r?t:t.filter(i=>i.ref.dataset.disabled!=="")},k=d({name:"CollectionSlot",inheritAttrs:!1,setup(r,{slots:o,attrs:l}){const{primitiveElement:c,currentElement:t}=M();return x(t,()=>{e.collectionRef.value=t.value}),()=>p(h,{ref:c,...l},o)}}),A=d({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(r,{slots:o,attrs:l}){const{primitiveElement:c,currentElement:t}=M();return S(i=>{if(t.value){const m=$(t.value);e.itemMap.value.set(m,{ref:t.value,value:r.value}),i(()=>e.itemMap.value.delete(m))}}),()=>p(h,{...l,[y]:"",ref:c},o)}}),C=f(()=>Array.from(e.itemMap.value.values())),R=f(()=>e.itemMap.value.size);return{getItems:E,reactiveItems:C,itemMapSize:R,CollectionSlot:k,CollectionItem:A}}export{b as R,g as u};
@@ -0,0 +1 @@
1
+ import{c as o}from"./Presence-cbB6AqkQ.js";const[e]=o("ConfigProvider");export{e as i};
@@ -0,0 +1,51 @@
1
+ var vt=r=>{throw TypeError(r)};var oo=(r,o,t)=>o.has(r)||vt("Cannot "+t);var ze=(r,o,t)=>(oo(r,o,"read from private field"),t?t.call(r):o.get(r)),mt=(r,o,t)=>o.has(r)?vt("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(r):o.set(r,t);import{c as me,k as Re,h as U,G as ao,a as E,t as Ye,o as l,b as k,e as i,f as T,u as e,r as $,j as g,m as G,H as Z,I as Ve,J as Ne,i as he,A as Se,p as S,g as X,x as fe,F as te,w as ve,q as w,K as Fe,n as Je,T as ro,s as R,l as so,M as no,B as b,y as Q,z as K,L as gt,N as lo,O as io,P as uo,E as De,Q as yt,v as co}from"./index-CoUshYEB.js";import{u as po}from"./content-BQE3NEm5.js";import{u as fo}from"./project-B1qSm0Fz.js";import{P as le,r as $e,d as vo,u as mo}from"./useWatch-COpVIQvm.js";import{f as We,t as go,d as yo,c as ht}from"./useFormatters-DgWFpsAv.js";import{_ as ho,a as se}from"./PageHeader.vue_vue_type_script_setup_true_lang-C7aWxNSw.js";import{_ as _o}from"./StudioHint.vue_vue_type_script_setup_true_lang-B45TG2r1.js";import{C as lt,_ as _t,a as Pe,b as xt}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-Dy-5bpEY.js";import{_ as re}from"./index-WHgvdYOs.js";import{P as At,D as Tt,a as It,T as Et,b as zt,i as bt,V as xo,h as bo,_ as wo,c as So,d as ko,e as qo,f as Co}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CgoQGS6k.js";import{S as Bo,_ as Po}from"./Input.vue_vue_type_script_setup_true_lang-otPltlZG.js";import{u as ke,a as _e,b as Qe}from"./useId-C0uR6mdj.js";import{i as $o,e as Dt,r as Oo,f as it,c as Le,g as Ao,u as ie,P as Mt,a as To}from"./Presence-cbB6AqkQ.js";import{u as Io}from"./useDirection-Cd3C7VdT.js";import{u as Oe,R as Eo}from"./Collection-zzx9pNd2.js";import{F as Ft,u as jt,a as Rt,f as wt,_ as zo,b as Do,c as Mo,d as Fo}from"./DialogTitle.vue_vue_type_script_setup_true_lang-CBu_dmA6.js";import{g as dt}from"./getActiveElement-FUKBWQwh.js";import{c as St,u as jo}from"./useNonce-DTGvzOJz.js";import{C as ct}from"./chevron-down-B9YdCtsj.js";import{F as Ro}from"./file-text-BDHXQ95W.js";import{A as Vo}from"./arrow-down-DqOfGL7C.js";import{C as No}from"./chevron-right-DFKsmZVd.js";import"./shield-check-CUL7KkSA.js";import"./ConfigProvider-BGjDLViI.js";/**
2
+ * @license lucide-vue-next v0.474.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 Lo=me("ArrowUpIcon",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
7
+ * @license lucide-vue-next v0.474.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 Ho=me("ChevronLeftIcon",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
12
+ * @license lucide-vue-next v0.474.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 Vt=me("ChevronUpIcon",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
17
+ * @license lucide-vue-next v0.474.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Uo=me("EyeOffIcon",[["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"}]]);/**
22
+ * @license lucide-vue-next v0.474.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Ko=me("EyeIcon",[["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"}]]);/**
27
+ * @license lucide-vue-next v0.474.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Wo=me("GripVerticalIcon",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
32
+ * @license lucide-vue-next v0.474.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Go=me("Maximize2Icon",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
37
+ * @license lucide-vue-next v0.474.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const Jo=me("PinOffIcon",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);/**
42
+ * @license lucide-vue-next v0.474.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const kt=me("PinIcon",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
47
+ * @license lucide-vue-next v0.474.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const Yo=me("SlidersHorizontalIcon",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);function qt(r){return typeof r=="string"?`'${r}'`:new Qo().serialize(r)}const Qo=(function(){var o;class r{constructor(){mt(this,o,new Map)}compare(a,s){const n=typeof a,v=typeof s;return n==="string"&&v==="string"?a.localeCompare(s):n==="number"&&v==="number"?a-s:String.prototype.localeCompare.call(this.serialize(a,!0),this.serialize(s,!0))}serialize(a,s){if(a===null)return"null";switch(typeof a){case"string":return s?a:`'${a}'`;case"bigint":return`${a}n`;case"object":return this.$object(a);case"function":return this.$function(a)}return String(a)}serializeObject(a){const s=Object.prototype.toString.call(a);if(s!=="[object Object]")return this.serializeBuiltInType(s.length<10?`unknown:${s}`:s.slice(8,-1),a);const n=a.constructor,v=n===Object||n===void 0?"":n.name;if(v!==""&&globalThis[v]===n)return this.serializeBuiltInType(v,a);if(typeof a.toJSON=="function"){const y=a.toJSON();return v+(y!==null&&typeof y=="object"?this.$object(y):`(${this.serialize(y)})`)}return this.serializeObjectEntries(v,Object.entries(a))}serializeBuiltInType(a,s){const n=this["$"+a];if(n)return n.call(this,s);if(typeof(s==null?void 0:s.entries)=="function")return this.serializeObjectEntries(a,s.entries());throw new Error(`Cannot serialize ${a}`)}serializeObjectEntries(a,s){const n=Array.from(s).sort((y,p)=>this.compare(y[0],p[0]));let v=`${a}{`;for(let y=0;y<n.length;y++){const[p,d]=n[y];v+=`${this.serialize(p,!0)}:${this.serialize(d)}`,y<n.length-1&&(v+=",")}return v+"}"}$object(a){let s=ze(this,o).get(a);return s===void 0&&(ze(this,o).set(a,`#${ze(this,o).size}`),s=this.serializeObject(a),ze(this,o).set(a,s)),s}$function(a){const s=Function.prototype.toString.call(a);return s.slice(-15)==="[native code] }"?`${a.name||""}()[native]`:`${a.name}(${a.length})${s.replace(/\s*\n\s*/g,"")}`}$Array(a){let s="[";for(let n=0;n<a.length;n++)s+=this.serialize(a[n]),n<a.length-1&&(s+=",");return s+"]"}$Date(a){try{return`Date(${a.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(a){return`ArrayBuffer[${new Uint8Array(a).join(",")}]`}$Set(a){return`Set${this.$Array(Array.from(a).sort((s,n)=>this.compare(s,n)))}`}$Map(a){return this.serializeObjectEntries("Map",a.entries())}}o=new WeakMap;for(const t of["Error","RegExp","URL"])r.prototype["$"+t]=function(a){return`${t}(${a})`};for(const t of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])r.prototype["$"+t]=function(a){return`${t}[${a.join(",")}]`};for(const t of["BigInt64Array","BigUint64Array"])r.prototype["$"+t]=function(a){return`${t}[${a.join("n,")}${a.length>0?"n":""}]`};return r})();function Xo(r,o){return r===o||qt(r)===qt(o)}let rt=0;function Nt(){Re(r=>{if(!$o)return;const o=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",o[0]??Ct()),document.body.insertAdjacentElement("beforeend",o[1]??Ct()),rt++,r(()=>{rt===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(t=>t.remove()),rt--})})}function Ct(){const r=document.createElement("span");return r.setAttribute("data-reka-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}function Zo(r){return U(()=>{var o;return ao(r)?!!((o=Dt(r))!=null&&o.closest("form")):!0})}function Lt(r){const o=Oo("",1e3);return{search:o,handleTypeaheadSearch:(s,n)=>{o.value=o.value+s;{const v=dt(),y=n.map(_=>{var P,N;return{..._,textValue:((P=_.value)==null?void 0:P.textValue)??((N=_.ref.textContent)==null?void 0:N.trim())??""}}),p=y.find(_=>_.ref===v),d=y.map(_=>_.textValue),x=ta(d,o.value,p==null?void 0:p.textValue),q=y.find(_=>_.textValue===x);return q&&q.ref.focus(),q==null?void 0:q.ref}},resetTypeahead:()=>{o.value=""}}}function ea(r,o){return r.map((t,a)=>r[(o+a)%r.length])}function ta(r,o,t){const s=o.length>1&&Array.from(o).every(d=>d===o[0])?o[0]:o,n=t?r.indexOf(t):-1;let v=ea(r,Math.max(n,0));s.length===1&&(v=v.filter(d=>d!==t));const p=v.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return p!==t?p:void 0}const[He,oa]=Le("PopoverRoot");var aa=E({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(r,{emit:o}){const t=r,a=o,{modal:s}=Ye(t),n=it(t,"open",a,{defaultValue:t.defaultOpen,passive:t.open===void 0}),v=$(),y=$(!1);return oa({contentId:"",triggerId:"",modal:s,open:n,onOpenChange:p=>{n.value=p},onOpenToggle:()=>{n.value=!n.value},triggerElement:v,hasCustomAnchor:y}),(p,d)=>(l(),k(e(At),null,{default:i(()=>[T(p.$slots,"default",{open:e(n),close:()=>n.value=!1})]),_:3}))}}),ra=aa,sa=E({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:o}){const t=r,a=o,s=ke(Ao(t,"trapFocus","disableOutsidePointerEvents")),{forwardRef:n}=ie(),v=He();return Nt(),(y,p)=>(l(),k(e(Ft),{"as-child":"",loop:"",trapped:y.trapFocus,onMountAutoFocus:p[5]||(p[5]=d=>a("openAutoFocus",d)),onUnmountAutoFocus:p[6]||(p[6]=d=>a("closeAutoFocus",d))},{default:i(()=>[g(e(Tt),{"as-child":"","disable-outside-pointer-events":y.disableOutsidePointerEvents,onPointerDownOutside:p[0]||(p[0]=d=>a("pointerDownOutside",d)),onInteractOutside:p[1]||(p[1]=d=>a("interactOutside",d)),onEscapeKeyDown:p[2]||(p[2]=d=>a("escapeKeyDown",d)),onFocusOutside:p[3]||(p[3]=d=>a("focusOutside",d)),onDismiss:p[4]||(p[4]=d=>e(v).onOpenChange(!1))},{default:i(()=>[g(e(It),G(e(s),{id:e(v).contentId,ref:e(n),"data-state":e(v).open.value?"open":"closed","aria-labelledby":e(v).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:i(()=>[T(y.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),Ht=sa,na=E({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:o}){const t=r,a=o,s=He(),n=$(!1);jt(!0);const v=_e(t,a),{forwardRef:y,currentElement:p}=ie();return Rt(p),(d,x)=>(l(),k(Ht,G(e(v),{ref:e(y),"trap-focus":e(s).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:x[0]||(x[0]=Z(q=>{var _;a("closeAutoFocus",q),n.value||(_=e(s).triggerElement.value)==null||_.focus()},["prevent"])),onPointerDownOutside:x[1]||(x[1]=q=>{a("pointerDownOutside",q);const _=q.detail.originalEvent,P=_.button===0&&_.ctrlKey===!0,N=_.button===2||P;n.value=N}),onFocusOutside:x[2]||(x[2]=Z(()=>{},["prevent"]))}),{default:i(()=>[T(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),la=na,ia=E({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:o}){const t=r,a=o,s=He(),n=$(!1),v=$(!1),y=_e(t,a);return(p,d)=>(l(),k(Ht,G(e(y),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=x=>{var q;a("closeAutoFocus",x),x.defaultPrevented||(n.value||(q=e(s).triggerElement.value)==null||q.focus(),x.preventDefault()),n.value=!1,v.value=!1}),onInteractOutside:d[1]||(d[1]=async x=>{var P;a("interactOutside",x),x.defaultPrevented||(n.value=!0,x.detail.originalEvent.type==="pointerdown"&&(v.value=!0));const q=x.target;((P=e(s).triggerElement.value)==null?void 0:P.contains(q))&&x.preventDefault(),x.detail.originalEvent.type==="focusin"&&v.value&&x.preventDefault()})}),{default:i(()=>[T(p.$slots,"default")]),_:3},16))}}),ua=ia,da=E({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:o}){const t=r,a=o,s=He(),n=_e(t,a),{forwardRef:v}=ie();return s.contentId||(s.contentId=Qe(void 0,"reka-popover-content")),(y,p)=>(l(),k(e(Mt),{present:y.forceMount||e(s).open.value},{default:i(()=>[e(s).modal.value?(l(),k(la,G({key:0},e(n),{ref:e(v)}),{default:i(()=>[T(y.$slots,"default")]),_:3},16)):(l(),k(ua,G({key:1},e(n),{ref:e(v)}),{default:i(()=>[T(y.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),ca=da,pa=E({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const o=r;return(t,a)=>(l(),k(e(Et),Ve(Ne(o)),{default:i(()=>[T(t.$slots,"default")]),_:3},16))}}),fa=pa,va=E({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const o=r,t=He(),{forwardRef:a,currentElement:s}=ie();return t.triggerId||(t.triggerId=Qe(void 0,"reka-popover-trigger")),he(()=>{t.triggerElement.value=s.value}),(n,v)=>(l(),k(Se(e(t).hasCustomAnchor.value?e(le):e(zt)),{"as-child":""},{default:i(()=>[g(e(le),{id:e(t).triggerId,ref:e(a),type:n.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":e(t).open.value,"aria-controls":e(t).contentId,"data-state":e(t).open.value?"open":"closed",as:n.as,"as-child":o.asChild,onClick:e(t).onOpenToggle},{default:i(()=>[T(n.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),ma=va;const ga=[" ","Enter","ArrowUp","ArrowDown"],ya=[" ","Enter"],ce=10;function je(r,o,t){return r===void 0?!1:Array.isArray(r)?r.some(a=>ut(a,o,t)):ut(r,o,t)}function ut(r,o,t){return r===void 0||o===void 0?!1:typeof r=="string"?r===o:typeof t=="function"?t(r,o):typeof t=="string"?(r==null?void 0:r[t])===(o==null?void 0:o[t]):Xo(r,o)}function ha(r){return r==null||r===""||Array.isArray(r)&&r.length===0}const _a={key:0,value:""},[xe,Ut]=Le("SelectRoot");var xa=E({inheritAttrs:!1,__name:"SelectRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:open"],setup(r,{emit:o}){const t=r,a=o,{required:s,disabled:n,multiple:v,dir:y}=Ye(t),p=it(t,"modelValue",a,{defaultValue:t.defaultValue??(v.value?[]:void 0),passive:t.modelValue===void 0,deep:!0}),d=it(t,"open",a,{defaultValue:t.defaultOpen,passive:t.open===void 0}),x=$(),q=$(),_=$({x:0,y:0}),P=U(()=>{var h;return v.value&&Array.isArray(p.value)?((h=p.value)==null?void 0:h.length)===0:bt(p.value)});Oe({isProvider:!0});const N=Io(y),L=Zo(x),H=$(new Set),W=U(()=>Array.from(H.value).map(h=>h.value).join(";"));function A(h){if(v.value){const O=Array.isArray(p.value)?[...p.value]:[],C=O.findIndex(D=>ut(D,h,t.by));C===-1?O.push(h):O.splice(C,1),p.value=[...O]}else p.value=h}function z(h){return Array.from(H.value).find(O=>je(h,O.value,t.by))}return Ut({triggerElement:x,onTriggerChange:h=>{x.value=h},valueElement:q,onValueElementChange:h=>{q.value=h},contentId:"",modelValue:p,onValueChange:A,by:t.by,open:d,multiple:v,required:s,onOpenChange:h=>{d.value=h},dir:N,triggerPointerDownPosRef:_,disabled:n,isEmptyModelValue:P,optionsSet:H,onOptionAdd:h=>{const O=z(h.value);O&&H.value.delete(O),H.value.add(h)},onOptionRemove:h=>{const O=z(h.value);O&&H.value.delete(O)}}),(h,O)=>(l(),k(e(At),null,{default:i(()=>[T(h.$slots,"default",{modelValue:e(p),open:e(d)}),e(L)?(l(),k(Sa,{key:W.value,"aria-hidden":"true",tabindex:"-1",multiple:e(v),required:e(s),name:h.name,autocomplete:h.autocomplete,disabled:e(n),value:e(p)},{default:i(()=>[e(bt)(e(p))?(l(),S("option",_a)):X("v-if",!0),(l(!0),S(te,null,fe(Array.from(H.value),C=>(l(),S("option",G({key:C.value??""},{ref_for:!0},C),null,16))),128))]),_:1},8,["multiple","required","name","autocomplete","disabled","value"])):X("v-if",!0)]),_:3}))}}),ba=xa,wa=E({__name:"BubbleSelect",props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(r){const o=r,t=$(),a=xe();ve(()=>o.value,(n,v)=>{const y=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(y,"value").set;if(n!==v&&d&&t.value){const x=new Event("change",{bubbles:!0});d.call(t.value,n),t.value.dispatchEvent(x)}});function s(n){a.onValueChange(n.target.value)}return(n,v)=>(l(),k(e(xo),{"as-child":""},{default:i(()=>[w("select",G({ref_key:"selectElement",ref:t},o,{onInput:s}),[T(n.$slots,"default")],16)]),_:3}))}}),Sa=wa,ka=E({__name:"SelectPopperPosition",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:ce},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const t=ke(r);return(a,s)=>(l(),k(e(It),G(e(t),{style:{boxSizing:"border-box","--reka-select-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-select-content-available-width":"var(--reka-popper-available-width)","--reka-select-content-available-height":"var(--reka-popper-available-height)","--reka-select-trigger-width":"var(--reka-popper-anchor-width)","--reka-select-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:i(()=>[T(a.$slots,"default")]),_:3},16))}}),qa=ka;const Ca={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[qe,Kt]=Le("SelectContent");var Ba=E({__name:"SelectContentImpl",props:{position:{type:String,required:!1,default:"item-aligned"},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(r,{emit:o}){const t=r,a=o,s=xe();Nt(),jt(t.bodyLock);const{CollectionSlot:n,getItems:v}=Oe(),y=$();Rt(y);const{search:p,handleTypeaheadSearch:d}=Lt(),x=$(),q=$(),_=$(),P=$(!1),N=$(!1),L=$(!1);function H(){q.value&&y.value&&wt([q.value,y.value])}ve(P,()=>{H()});const{onOpenChange:W,triggerPointerDownPosRef:A}=s;Re(C=>{if(!y.value)return;let D={x:0,y:0};const V=M=>{var J,oe;D={x:Math.abs(Math.round(M.pageX)-(((J=A.value)==null?void 0:J.x)??0)),y:Math.abs(Math.round(M.pageY)-(((oe=A.value)==null?void 0:oe.y)??0))}},I=M=>{var J;M.pointerType!=="touch"&&(D.x<=10&&D.y<=10?M.preventDefault():(J=y.value)!=null&&J.contains(M.target)||W(!1),document.removeEventListener("pointermove",V),A.value=null)};A.value!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",I,{capture:!0,once:!0})),C(()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",I,{capture:!0})})});function z(C){const D=C.ctrlKey||C.altKey||C.metaKey;if(C.key==="Tab"&&C.preventDefault(),!D&&C.key.length===1&&d(C.key,v()),["ArrowUp","ArrowDown","Home","End"].includes(C.key)){let I=[...v().map(M=>M.ref)];if(["ArrowUp","End"].includes(C.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(C.key)){const M=C.target,J=I.indexOf(M);I=I.slice(J+1)}setTimeout(()=>wt(I)),C.preventDefault()}}const h=U(()=>t.position==="popper"?t:{}),O=ke(h.value);return Kt({content:y,viewport:x,onViewportChange:C=>{x.value=C},itemRefCallback:(C,D,V)=>{const I=!N.value&&!V,M=je(s.modelValue.value,D,s.by);if(s.multiple.value){if(L.value)return;(M||I)&&(q.value=C,M&&(L.value=!0))}else(M||I)&&(q.value=C);I&&(N.value=!0)},selectedItem:q,selectedItemText:_,onItemLeave:()=>{var C;(C=y.value)==null||C.focus()},itemTextRefCallback:(C,D,V)=>{const I=!N.value&&!V;(je(s.modelValue.value,D,s.by)||I)&&(_.value=C)},focusSelectedItem:H,position:t.position,isPositioned:P,searchRef:p}),(C,D)=>(l(),k(e(n),null,{default:i(()=>[g(e(Ft),{"as-child":"",onMountAutoFocus:D[6]||(D[6]=Z(()=>{},["prevent"])),onUnmountAutoFocus:D[7]||(D[7]=V=>{var I;a("closeAutoFocus",V),!V.defaultPrevented&&((I=e(s).triggerElement.value)==null||I.focus({preventScroll:!0}),V.preventDefault())})},{default:i(()=>[g(e(Tt),{"as-child":"","disable-outside-pointer-events":C.disableOutsidePointerEvents,onFocusOutside:D[2]||(D[2]=Z(()=>{},["prevent"])),onDismiss:D[3]||(D[3]=V=>e(s).onOpenChange(!1)),onEscapeKeyDown:D[4]||(D[4]=V=>a("escapeKeyDown",V)),onPointerDownOutside:D[5]||(D[5]=V=>a("pointerDownOutside",V))},{default:i(()=>[(l(),k(Se(C.position==="popper"?qa:Aa),G({...C.$attrs,...e(O)},{id:e(s).contentId,ref:V=>{const I=e(Dt)(V);I!=null&&I.hasAttribute("data-reka-popper-content-wrapper")?y.value=I.firstElementChild:y.value=I},role:"listbox","data-state":e(s).open.value?"open":"closed",dir:e(s).dir.value,style:{display:"flex",flexDirection:"column",outline:"none"},onContextmenu:D[0]||(D[0]=Z(()=>{},["prevent"])),onPlaced:D[1]||(D[1]=V=>P.value=!0),onKeydown:z}),{default:i(()=>[T(C.$slots,"default")]),_:3},16,["id","data-state","dir","onKeydown"]))]),_:3},8,["disable-outside-pointer-events"])]),_:3})]),_:3}))}}),Pa=Ba;const[pt,$a]=Le("SelectItemAlignedPosition");var Oa=E({inheritAttrs:!1,__name:"SelectItemAlignedPosition",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["placed"],setup(r,{emit:o}){const t=r,a=o,{getItems:s}=Oe(),n=xe(),v=qe(),y=$(!1),p=$(!0),d=$(),{forwardRef:x,currentElement:q}=ie(),{viewport:_,selectedItem:P,selectedItemText:N,focusSelectedItem:L}=v;function H(){if(n.triggerElement.value&&n.valueElement.value&&d.value&&q.value&&(_!=null&&_.value)&&(P!=null&&P.value)&&(N!=null&&N.value)){const z=n.triggerElement.value.getBoundingClientRect(),h=q.value.getBoundingClientRect(),O=n.valueElement.value.getBoundingClientRect(),C=N.value.getBoundingClientRect();if(n.dir.value!=="rtl"){const ne=C.left-h.left,ae=O.left-ne,ge=z.left-ae,ue=z.width+ge,Be=Math.max(ue,h.width),de=window.innerWidth-ce,ye=St(ae,ce,Math.max(ce,de-Be));d.value.style.minWidth=`${ue}px`,d.value.style.left=`${ye}px`}else{const ne=h.right-C.right,ae=window.innerWidth-O.right-ne,ge=window.innerWidth-z.right-ae,ue=z.width+ge,Be=Math.max(ue,h.width),de=window.innerWidth-ce,ye=St(ae,ce,Math.max(ce,de-Be));d.value.style.minWidth=`${ue}px`,d.value.style.right=`${ye}px`}const D=s().map(ne=>ne.ref),V=window.innerHeight-ce*2,I=_.value.scrollHeight,M=window.getComputedStyle(q.value),J=Number.parseInt(M.borderTopWidth,10),oe=Number.parseInt(M.paddingTop,10),Ae=Number.parseInt(M.borderBottomWidth,10),Te=Number.parseInt(M.paddingBottom,10),be=J+oe+I+Te+Ae,Xe=Math.min(P.value.offsetHeight*5,be),Ue=window.getComputedStyle(_.value),Ze=Number.parseInt(Ue.paddingTop,10),et=Number.parseInt(Ue.paddingBottom,10),we=z.top+z.height/2-ce,tt=V-we,Ie=P.value.offsetHeight/2,ot=P.value.offsetTop+Ie,Ce=J+oe+ot,F=be-Ce;if(Ce<=we){const ne=P.value===D[D.length-1];d.value.style.bottom="0px";const ae=q.value.clientHeight-_.value.offsetTop-_.value.offsetHeight,ge=Math.max(tt,Ie+(ne?et:0)+ae+Ae),ue=Ce+ge;d.value.style.height=`${ue}px`}else{const ne=P.value===D[0];d.value.style.top="0px";const ge=Math.max(we,J+_.value.offsetTop+(ne?Ze:0)+Ie)+F;d.value.style.height=`${ge}px`,_.value.scrollTop=Ce-we+_.value.offsetTop}d.value.style.margin=`${ce}px 0`,d.value.style.minHeight=`${Xe}px`,d.value.style.maxHeight=`${V}px`,a("placed"),requestAnimationFrame(()=>y.value=!0)}}const W=$("");he(async()=>{await Fe(),H(),q.value&&(W.value=window.getComputedStyle(q.value).zIndex)});function A(z){z&&p.value===!0&&(H(),L==null||L(),p.value=!1)}return To(n.triggerElement,()=>{H()}),$a({contentWrapper:d,shouldExpandOnScrollRef:y,onScrollButtonChange:A}),(z,h)=>(l(),S("div",{ref_key:"contentWrapperElement",ref:d,style:Je({display:"flex",flexDirection:"column",position:"fixed",zIndex:W.value})},[g(e(le),G({ref:e(x),style:{boxSizing:"border-box",maxHeight:"100%"}},{...z.$attrs,...t}),{default:i(()=>[T(z.$slots,"default")]),_:3},16)],4))}}),Aa=Oa,Ta=E({inheritAttrs:!1,__name:"SelectProvider",props:{context:{type:Object,required:!0}},setup(r){return Ut(r.context),Kt(Ca),(t,a)=>T(t.$slots,"default")}}),Ia=Ta;const Ea={key:1};var za=E({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(r,{emit:o}){const t=r,s=_e(t,o),n=xe(),v=$();he(()=>{v.value=new DocumentFragment});const y=$(),p=U(()=>t.forceMount||n.open.value),d=$(p.value);return ve(p,()=>{setTimeout(()=>d.value=p.value)}),(x,q)=>{var _;return p.value||d.value||(_=y.value)!=null&&_.present?(l(),k(e(Mt),{key:0,ref_key:"presenceRef",ref:y,present:p.value},{default:i(()=>[g(Pa,Ve(Ne({...e(s),...x.$attrs})),{default:i(()=>[T(x.$slots,"default")]),_:3},16)]),_:3},8,["present"])):v.value?(l(),S("div",Ea,[(l(),k(ro,{to:v.value},[g(Ia,{context:e(n)},{default:i(()=>[T(x.$slots,"default")]),_:3},8,["context"])],8,["to"]))])):X("v-if",!0)}}}),Da=za,Ma=E({__name:"SelectIcon",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){return(o,t)=>(l(),k(e(le),{"aria-hidden":"true",as:o.as,"as-child":o.asChild},{default:i(()=>[T(o.$slots,"default",{},()=>[t[0]||(t[0]=R("▼"))])]),_:3},8,["as","as-child"]))}}),Fa=Ma;const[Wt,ja]=Le("SelectItem");var Ra=E({__name:"SelectItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(r,{emit:o}){const t=r,a=o,{disabled:s}=Ye(t),n=xe(),v=qe(),{forwardRef:y,currentElement:p}=ie(),{CollectionItem:d}=Oe(),x=U(()=>{var h;return je((h=n.modelValue)==null?void 0:h.value,t.value,n.by)}),q=$(!1),_=$(t.textValue??""),P=Qe(void 0,"reka-select-item-text"),N="select.select";async function L(h){if(h.defaultPrevented)return;const O={originalEvent:h,value:t.value};bo(N,H,O)}async function H(h){await Fe(),a("select",h),!h.defaultPrevented&&(s.value||(n.onValueChange(t.value),n.multiple.value||n.onOpenChange(!1)))}async function W(h){var O,C;await Fe(),!h.defaultPrevented&&(s.value?(O=v.onItemLeave)==null||O.call(v):(C=h.currentTarget)==null||C.focus({preventScroll:!0}))}async function A(h){var O;await Fe(),!h.defaultPrevented&&h.currentTarget===dt()&&((O=v.onItemLeave)==null||O.call(v))}async function z(h){var C;await Fe(),!(h.defaultPrevented||((C=v.searchRef)==null?void 0:C.value)!==""&&h.key===" ")&&(ya.includes(h.key)&&L(h),h.key===" "&&h.preventDefault())}if(t.value==="")throw new Error("A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return he(()=>{p.value&&v.itemRefCallback(p.value,t.value,t.disabled)}),ja({value:t.value,disabled:s,textId:P,isSelected:x,onItemTextChange:h=>{_.value=((_.value||(h==null?void 0:h.textContent))??"").trim()}}),(h,O)=>(l(),k(e(d),{value:{textValue:_.value}},{default:i(()=>[g(e(le),{ref:e(y),role:"option","aria-labelledby":e(P),"data-highlighted":q.value?"":void 0,"aria-selected":x.value,"data-state":x.value?"checked":"unchecked","aria-disabled":e(s)||void 0,"data-disabled":e(s)?"":void 0,tabindex:e(s)?void 0:-1,as:h.as,"as-child":h.asChild,onFocus:O[0]||(O[0]=C=>q.value=!0),onBlur:O[1]||(O[1]=C=>q.value=!1),onPointerup:L,onPointerdown:O[2]||(O[2]=C=>{C.currentTarget.focus({preventScroll:!0})}),onTouchend:O[3]||(O[3]=Z(()=>{},["prevent","stop"])),onPointermove:W,onPointerleave:A,onKeydown:z},{default:i(()=>[T(h.$slots,"default")]),_:3},8,["aria-labelledby","data-highlighted","aria-selected","data-state","aria-disabled","data-disabled","tabindex","as","as-child"])]),_:3},8,["value"]))}}),Va=Ra,Na=E({__name:"SelectItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){const o=r,t=Wt();return(a,s)=>e(t).isSelected.value?(l(),k(e(le),G({key:0,"aria-hidden":"true"},o),{default:i(()=>[T(a.$slots,"default")]),_:3},16)):X("v-if",!0)}}),La=Na,Ha=E({inheritAttrs:!1,__name:"SelectItemText",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){const o=r,t=xe(),a=qe(),s=Wt(),{forwardRef:n,currentElement:v}=ie(),y=U(()=>{var p,d;return{value:s.value,disabled:s.disabled.value,textContent:((p=v.value)==null?void 0:p.textContent)??((d=s.value)==null?void 0:d.toString())??""}});return he(()=>{v.value&&(s.onItemTextChange(v.value),a.itemTextRefCallback(v.value,s.value,s.disabled.value),t.onOptionAdd(y.value))}),so(()=>{t.onOptionRemove(y.value)}),(p,d)=>(l(),k(e(le),G({id:e(s).textId,ref:e(n)},{...o,...p.$attrs}),{default:i(()=>[T(p.$slots,"default")]),_:3},16,["id"]))}}),Ua=Ha,Ka=E({__name:"SelectPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const o=r;return(t,a)=>(l(),k(e(Et),Ve(Ne(o)),{default:i(()=>[T(t.$slots,"default")]),_:3},16))}}),Wa=Ka,Ga=E({__name:"SelectScrollButtonImpl",emits:["autoScroll"],setup(r,{emit:o}){const t=o,{getItems:a}=Oe(),s=qe(),n=$(null);function v(){n.value!==null&&(window.clearInterval(n.value),n.value=null)}Re(()=>{const d=a().map(x=>x.ref).find(x=>x===dt());d==null||d.scrollIntoView({block:"nearest"})});function y(){n.value===null&&(n.value=window.setInterval(()=>{t("autoScroll")},50))}function p(){var d;(d=s.onItemLeave)==null||d.call(s),n.value===null&&(n.value=window.setInterval(()=>{t("autoScroll")},50))}return no(()=>v()),(d,x)=>{var q;return l(),k(e(le),G({"aria-hidden":"true",style:{flexShrink:0}},(q=d.$parent)==null?void 0:q.$props,{onPointerdown:y,onPointermove:p,onPointerleave:x[0]||(x[0]=()=>{v()})}),{default:i(()=>[T(d.$slots,"default")]),_:3},16)}}}),Gt=Ga,Ja=E({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const o=qe(),t=o.position==="item-aligned"?pt():void 0,{forwardRef:a,currentElement:s}=ie(),n=$(!1);return Re(v=>{var y,p;if((y=o.viewport)!=null&&y.value&&((p=o.isPositioned)!=null&&p.value)){let x=function(){const q=d.scrollHeight-d.clientHeight;n.value=Math.ceil(d.scrollTop)<q};const d=o.viewport.value;x(),d.addEventListener("scroll",x),v(()=>d.removeEventListener("scroll",x))}}),ve(s,()=>{s.value&&(t==null||t.onScrollButtonChange(s.value))}),(v,y)=>n.value?(l(),k(Gt,{key:0,ref:e(a),onAutoScroll:y[0]||(y[0]=()=>{const{viewport:p,selectedItem:d}=e(o);p!=null&&p.value&&(d!=null&&d.value)&&(p.value.scrollTop=p.value.scrollTop+d.value.offsetHeight)})},{default:i(()=>[T(v.$slots,"default")]),_:3},512)):X("v-if",!0)}}),Ya=Ja,Qa=E({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const o=qe(),t=o.position==="item-aligned"?pt():void 0,{forwardRef:a,currentElement:s}=ie(),n=$(!1);return Re(v=>{var y,p;if((y=o.viewport)!=null&&y.value&&((p=o.isPositioned)!=null&&p.value)){let x=function(){n.value=d.scrollTop>0};const d=o.viewport.value;x(),d.addEventListener("scroll",x),v(()=>d.removeEventListener("scroll",x))}}),ve(s,()=>{s.value&&(t==null||t.onScrollButtonChange(s.value))}),(v,y)=>n.value?(l(),k(Gt,{key:0,ref:e(a),onAutoScroll:y[0]||(y[0]=()=>{const{viewport:p,selectedItem:d}=e(o);p!=null&&p.value&&(d!=null&&d.value)&&(p.value.scrollTop=p.value.scrollTop-d.value.offsetHeight)})},{default:i(()=>[T(v.$slots,"default")]),_:3},512)):X("v-if",!0)}}),Xa=Qa,Za=E({__name:"SelectTrigger",props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const o=r,t=xe(),{forwardRef:a,currentElement:s}=ie(),n=U(()=>{var _;return((_=t.disabled)==null?void 0:_.value)||o.disabled});t.contentId||(t.contentId=Qe(void 0,"reka-select-content")),he(()=>{t.onTriggerChange(s.value)});const{getItems:v}=Oe(),{search:y,handleTypeaheadSearch:p,resetTypeahead:d}=Lt();function x(){n.value||(t.onOpenChange(!0),d())}function q(_){x(),t.triggerPointerDownPosRef.value={x:Math.round(_.pageX),y:Math.round(_.pageY)}}return(_,P)=>(l(),k(e(zt),{"as-child":"",reference:_.reference},{default:i(()=>{var N,L,H,W;return[g(e(le),{ref:e(a),role:"combobox",type:_.as==="button"?"button":void 0,"aria-controls":e(t).contentId,"aria-expanded":e(t).open.value||!1,"aria-required":(N=e(t).required)==null?void 0:N.value,"aria-autocomplete":"none",disabled:n.value,dir:(L=e(t))==null?void 0:L.dir.value,"data-state":(H=e(t))!=null&&H.open.value?"open":"closed","data-disabled":n.value?"":void 0,"data-placeholder":e(ha)((W=e(t).modelValue)==null?void 0:W.value)?"":void 0,"as-child":_.asChild,as:_.as,onClick:P[0]||(P[0]=A=>{var z;(z=A==null?void 0:A.currentTarget)==null||z.focus()}),onPointerdown:P[1]||(P[1]=A=>{if(A.pointerType==="touch")return A.preventDefault();const z=A.target;z.hasPointerCapture(A.pointerId)&&z.releasePointerCapture(A.pointerId),A.button===0&&A.ctrlKey===!1&&(q(A),A.preventDefault())}),onPointerup:P[2]||(P[2]=Z(A=>{A.pointerType==="touch"&&q(A)},["prevent"])),onKeydown:P[3]||(P[3]=A=>{const z=e(y)!=="";!(A.ctrlKey||A.altKey||A.metaKey)&&A.key.length===1&&z&&A.key===" "||(e(p)(A.key,e(v)()),e(ga).includes(A.key)&&(x(),A.preventDefault()))})},{default:i(()=>[T(_.$slots,"default")]),_:3},8,["type","aria-controls","aria-expanded","aria-required","disabled","dir","data-state","data-disabled","data-placeholder","as-child","as"])]}),_:3},8,["reference"]))}}),er=Za,tr=E({__name:"SelectValue",props:{placeholder:{type:String,required:!1,default:""},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){const o=r,{forwardRef:t,currentElement:a}=ie(),s=xe();he(()=>{s.valueElement=a});const n=U(()=>{var x;let y=[];const p=Array.from(s.optionsSet.value),d=q=>p.find(_=>je(q,_.value,s.by));return Array.isArray(s.modelValue.value)?y=s.modelValue.value.map(q=>{var _;return((_=d(q))==null?void 0:_.textContent)??""}):y=[((x=d(s.modelValue.value))==null?void 0:x.textContent)??""],y.filter(Boolean)}),v=U(()=>n.value.length?n.value.join(", "):o.placeholder);return(y,p)=>(l(),k(e(le),{ref:e(t),as:y.as,"as-child":y.asChild,style:{pointerEvents:"none"},"data-placeholder":n.value.length?void 0:o.placeholder},{default:i(()=>[T(y.$slots,"default",{selectedLabel:n.value,modelValue:e(s).modelValue.value},()=>[R(b(v.value),1)])]),_:3},8,["as","as-child","data-placeholder"]))}}),or=tr,ar=E({__name:"SelectViewport",props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const o=r,{nonce:t}=Ye(o),a=jo(t),s=qe(),n=s.position==="item-aligned"?pt():void 0,{forwardRef:v,currentElement:y}=ie();he(()=>{s==null||s.onViewportChange(y.value)});const p=$(0);function d(x){const q=x.currentTarget,{shouldExpandOnScrollRef:_,contentWrapper:P}=n??{};if(_!=null&&_.value&&(P!=null&&P.value)){const N=Math.abs(p.value-q.scrollTop);if(N>0){const L=window.innerHeight-ce*2,H=Number.parseFloat(P.value.style.minHeight),W=Number.parseFloat(P.value.style.height),A=Math.max(H,W);if(A<L){const z=A+N,h=Math.min(L,z),O=z-h;P.value.style.height=`${h}px`,P.value.style.bottom==="0px"&&(q.scrollTop=O>0?O:0,P.value.style.justifyContent="flex-end")}}}p.value=q.scrollTop}return(x,q)=>(l(),S(te,null,[g(e(le),G({ref:e(v),"data-reka-select-viewport":"",role:"presentation"},{...x.$attrs,...o},{style:{position:"relative",flex:1,overflow:"hidden auto"},onScroll:d}),{default:i(()=>[T(x.$slots,"default")]),_:3},16),g(e(le),{as:"style",nonce:e(a)},{default:i(()=>q[0]||(q[0]=[R(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } ")])),_:1,__:[0]},8,["nonce"])],64))}}),rr=ar;const sr={"data-slot":"table-container",class:"relative w-full overflow-auto"},nr=E({__name:"Table",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r;return(t,a)=>(l(),S("div",sr,[w("table",{"data-slot":"table",class:Q(e(K)("w-full caption-bottom text-sm",o.class))},[T(t.$slots,"default")],2)]))}}),lr=E({__name:"TableBody",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r;return(t,a)=>(l(),S("tbody",{"data-slot":"table-body",class:Q(e(K)("[&_tr:last-child]:border-0",o.class))},[T(t.$slots,"default")],2))}}),Ge=E({__name:"TableCell",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r;return(t,a)=>(l(),S("td",{"data-slot":"table-cell",class:Q(e(K)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",o.class))},[T(t.$slots,"default")],2))}}),st=E({__name:"TableRow",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r;return(t,a)=>(l(),S("tr",{"data-slot":"table-row",class:Q(e(K)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",o.class))},[T(t.$slots,"default")],2))}}),nt=E({__name:"TableHead",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r;return(t,a)=>(l(),S("th",{"data-slot":"table-head",class:Q(e(K)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",o.class))},[T(t.$slots,"default")],2))}}),ir=E({__name:"TableHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r;return(t,a)=>(l(),S("thead",{"data-slot":"table-header",class:Q(e(K)("[&_tr]:border-b",o.class))},[T(t.$slots,"default")],2))}}),Bt=E({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(r,{emit:o}){const s=_e(r,o);return(n,v)=>(l(),k(e(ba),G({"data-slot":"select"},e(s)),{default:i(y=>[T(n.$slots,"default",Ve(Ne(y)))]),_:3},16))}}),Pt=E({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(r,{emit:o}){const t=r,a=o,s=$e(t,"class"),n=_e(s,a);return(v,y)=>(l(),k(e(Wa),null,{default:i(()=>[g(e(Da),G({"data-slot":"select-content"},{...v.$attrs,...e(n)},{class:e(K)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--reka-select-content-available-height) min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t.class)}),{default:i(()=>[g(e(cr)),g(e(rr),{class:Q(e(K)("p-1",r.position==="popper"&&"h-[var(--reka-select-trigger-height)] w-full min-w-[var(--reka-select-trigger-width)] scroll-my-1"))},{default:i(()=>[T(v.$slots,"default")]),_:3},8,["class"]),g(e(dr))]),_:3},16,["class"])]),_:3}))}}),ur={class:"absolute right-2 flex size-3.5 items-center justify-center"},Me=E({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r,t=$e(o,"class"),a=ke(t);return(s,n)=>(l(),k(e(Va),G({"data-slot":"select-item"},e(a),{class:e(K)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o.class)}),{default:i(()=>[w("span",ur,[g(e(La),null,{default:i(()=>[T(s.$slots,"indicator-icon",{},()=>[g(e(lt),{class:"size-4"})])]),_:3})]),g(e(Ua),null,{default:i(()=>[T(s.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),dr=E({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r,t=$e(o,"class"),a=ke(t);return(s,n)=>(l(),k(e(Ya),G({"data-slot":"select-scroll-down-button"},e(a),{class:e(K)("flex cursor-default items-center justify-center py-1",o.class)}),{default:i(()=>[T(s.$slots,"default",{},()=>[g(e(ct),{class:"size-4"})])]),_:3},16,["class"]))}}),cr=E({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(r){const o=r,t=$e(o,"class"),a=ke(t);return(s,n)=>(l(),k(e(Xa),G({"data-slot":"select-scroll-up-button"},e(a),{class:e(K)("flex cursor-default items-center justify-center py-1",o.class)}),{default:i(()=>[T(s.$slots,"default",{},()=>[g(e(Vt),{class:"size-4"})])]),_:3},16,["class"]))}}),$t=E({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},size:{default:"default"}},setup(r){const o=r,t=$e(o,"class","size"),a=ke(t);return(s,n)=>(l(),k(e(er),G({"data-slot":"select-trigger","data-size":r.size},e(a),{class:e(K)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o.class)}),{default:i(()=>[T(s.$slots,"default"),g(e(Fa),{"as-child":""},{default:i(()=>[g(e(ct),{class:"size-4 opacity-50"})]),_:1})]),_:3},16,["data-size","class"]))}}),Ot=E({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(r){const o=r;return(t,a)=>(l(),k(e(or),G({"data-slot":"select-value"},o),{default:i(()=>[T(t.$slots,"default")]),_:3},16))}}),pr=E({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(r,{emit:o}){const s=_e(r,o);return(n,v)=>(l(),k(e(ra),G({"data-slot":"popover"},e(s)),{default:i(y=>[T(n.$slots,"default",Ve(Ne(y)))]),_:3},16))}}),fr=E({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{default:"center"},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:o}){const t=r,a=o,s=$e(t,"class"),n=_e(s,a);return(v,y)=>(l(),k(e(fa),null,{default:i(()=>[g(e(ca),G({"data-slot":"popover-content"},{...v.$attrs,...e(n)},{class:e(K)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md origin-(--reka-popover-content-transform-origin) outline-hidden",t.class)}),{default:i(()=>[T(v.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),vr=E({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(r){const o=r;return(t,a)=>(l(),k(e(ma),G({"data-slot":"popover-trigger"},o),{default:i(()=>[T(t.$slots,"default")]),_:3},16))}});function mr(r){const o=U(()=>{if(!r.value)return"pending";const{errors:a,warnings:s}=r.value.summary;return a>0?"warning":s>0?"partial":"validated"}),t=U(()=>r.value?r.value.summary.errors+r.value.summary.warnings:0);return{trustStatus:o,trustCount:t}}const gr={class:"flex h-full flex-col"},yr={class:"flex flex-1 flex-col overflow-hidden px-6 py-4"},hr={class:"mb-4 flex items-center gap-3"},_r={class:"border-b border-border px-3 py-2.5"},xr={class:"flex items-center justify-between"},br={class:"text-xs font-medium text-foreground"},wr={class:"flex gap-1"},Sr={class:"max-h-85 overflow-y-auto custom-scrollbar p-1.5"},kr=["onDragstart","onDrop"],qr={class:"flex shrink-0 items-center"},Cr={class:"flex flex-col -space-y-0.5 ml-0.5"},Br={class:"text-xs text-muted-foreground"},Pr={class:"grid gap-1.5 sm:grid-cols-2 lg:grid-cols-4"},$r={key:0,class:"flex flex-1 items-center justify-center"},Or={key:1,class:"flex flex-1 flex-col items-center justify-center text-center"},Ar={class:"mb-4 flex size-14 items-center justify-center rounded-full bg-muted"},Tr={class:"text-lg font-semibold"},Ir={class:"mt-2 max-w-sm text-sm text-muted-foreground"},Er={key:2,class:"flex flex-1 flex-col items-center justify-center text-center"},zr={class:"text-sm text-muted-foreground"},Dr={class:"flex-1 overflow-auto rounded-lg border border-border"},Mr={class:"flex items-center gap-1"},Fr={class:"flex items-center justify-center gap-1"},jr={class:"text-[11px] text-muted-foreground"},Rr={key:0,class:"inline-flex items-center gap-1 text-[11px] text-status-warning"},Vr={key:1,class:"text-[11px] text-muted-foreground/40"},Nr={key:3,class:"font-mono text-sm text-foreground tabular-nums text-right block"},Lr={key:4,class:"max-w-60"},Hr={class:"truncate text-sm font-medium text-foreground"},Ur={class:"truncate text-[11px] text-muted-foreground"},Kr={key:5,class:"flex items-center gap-2"},Wr={class:"font-mono text-xs text-muted-foreground"},Gr={key:8,class:"block max-w-60 truncate text-sm text-foreground"},Jr={class:"text-xs"},Yr={class:"border-t border-border/50 px-6 py-5"},Qr={class:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3"},Xr={class:"flex items-center gap-1.5"},Zr={class:"font-mono text-[11px] font-medium text-muted-foreground"},es={class:"ml-auto flex items-center gap-1 opacity-0 group-hover/card:opacity-100 transition-opacity"},ts={key:0,class:"inline-flex items-center gap-1 text-xs text-status-warning"},os={key:1,class:"text-xs text-muted-foreground/40"},as={key:1,class:"flex items-center gap-2"},rs={class:"text-xs text-muted-foreground"},ss={key:2,class:"flex items-center gap-2"},ns={class:"font-mono text-xs text-foreground"},ls={key:3,class:"flex items-center gap-0.5"},is={class:"ml-1.5 text-xs text-muted-foreground"},us={key:4,class:"flex items-center gap-2"},ds={class:"h-2 flex-1 rounded-full bg-muted overflow-hidden"},cs={class:"text-xs font-medium text-foreground tabular-nums"},ps=["href"],fs=["href"],vs=["href"],ms={key:8,class:"flex items-center gap-2"},gs={class:"flex size-10 items-center justify-center rounded-md border border-border bg-muted"},ys=["src","alt"],hs={class:"text-xs text-muted-foreground truncate"},_s={key:9,class:"flex items-center gap-2"},xs={class:"text-xs text-muted-foreground truncate"},bs={key:11,class:"flex flex-wrap gap-1"},ws={key:12,class:"flex flex-wrap gap-1"},Ss={key:14,class:"text-xs text-foreground"},ks={key:0,class:"text-muted-foreground ml-1"},qs={key:15,class:"font-mono text-xs text-foreground"},Cs={key:16,class:"line-clamp-2 rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground"},Bs={key:17,class:"flex items-center gap-2"},Ps={class:"line-clamp-1 text-xs text-muted-foreground"},$s={key:18,class:"font-mono text-xs font-medium text-foreground tabular-nums"},Os={key:19,class:"line-clamp-2 text-xs text-foreground"},As={key:0,class:"mt-4 flex items-center justify-between border-t border-border pt-4"},Ts={class:"flex items-center gap-2"},Is={class:"text-xs text-muted-foreground"},Es={class:"flex items-center gap-2"},zs={class:"flex items-center gap-1.5 text-xs text-muted-foreground"},Ds={class:"font-mono text-sm"},Ms={class:"flex-1 overflow-auto custom-scrollbar rounded-md border border-border bg-muted/30 p-4"},Fs=["innerHTML"],js=["innerHTML"],Rs={key:2,class:"font-mono text-sm text-foreground whitespace-pre-wrap"},Vs={key:3,class:"font-mono text-xs text-foreground whitespace-pre-wrap"},Ns={key:4,class:"whitespace-pre-wrap font-mono text-sm text-foreground"},Ls=E({__name:"ContentListPage",setup(r){const o=vo("serve-ui-texts").locale("en").get(),t=co(),a=po(),s=fo(),n=U(()=>t.params.modelId),v=U(()=>{var u,c;return(c=(u=s.status)==null?void 0:u.models)==null?void 0:c.find(B=>B.id===n.value)}),{trustStatus:y,trustCount:p}=mr(U(()=>a.validation)),d=U(()=>{var u,c;return((c=(u=s.status)==null?void 0:u.config)==null?void 0:c.locales.supported)??[]}),x=U(()=>{var u;return((u=v.value)==null?void 0:u.i18n)??!1}),q=$(void 0),_=$(""),P=$(!1),N=$(20),L=$(1),H=$("1"),W=$(null),A=$(null),z=U(()=>{const u=a.contentList;return u?u.kind==="collection"||u.kind==="document"?Array.isArray(u.data)?u.data:[]:u.kind==="singleton"?[u.data]:u.kind==="dictionary"?Object.entries(u.data).map(([c,B])=>({key:c,value:B})):[]:[]}),h=U(()=>{if(!_.value)return z.value;const u=_.value.toLowerCase();return z.value.filter(c=>Object.values(c).some(B=>B==null?!1:String(B).toLowerCase().includes(u)))}),O=U(()=>h.value.length),C=U(()=>Math.max(1,Math.ceil(O.value/N.value))),D=U(()=>{const u=(L.value-1)*N.value;return h.value.slice(u,u+N.value)}),V=U(()=>{const u=a.modelDescription;if(u!=null&&u.fields)return Object.keys(u.fields);if(z.value.length===0)return[];const c=z.value[0];return!c||typeof c!="object"?[]:Object.keys(c).filter(B=>B!=="id"&&!B.startsWith("_"))}),I=$(new Set),M=$(new Set),J=$([]),oe=$(null),Ae=U(()=>{const u=a.modelDescription;if(!(u!=null&&u.fields))return V.value.slice(0,6);const c={string:1,text:2,email:3,url:3,slug:3,select:4,number:5,integer:5,decimal:5,percent:5,rating:5,boolean:6,date:7,datetime:7,color:8,phone:8,code:9,icon:9,image:10,video:10,file:10,markdown:11,richtext:11,relation:12,relations:12,array:13,object:14};return Object.entries(u.fields).map(([B,f])=>({name:B,priority:(f.required?0:100)+(c[f.type]??50)})).toSorted((B,f)=>B.priority-f.priority).slice(0,6).map(B=>B.name)});ve(V,u=>{if(u.length>0&&J.value.length===0){J.value=[...u];const c=new Set(Ae.value);I.value.clear();for(const B of u)c.has(B)||I.value.add(B)}},{immediate:!0});const Te=U(()=>J.value.length===0?V.value:J.value.filter(u=>V.value.includes(u))),be=U(()=>{const u=Te.value.filter(f=>!I.value.has(f)),c=u.filter(f=>M.value.has(f)),B=u.filter(f=>!M.value.has(f));return[...c,...B]});function Xe(u){M.value.has(u)||(I.value.has(u)?I.value.delete(u):I.value.add(u))}function Ue(u){M.value.has(u)?M.value.delete(u):(M.value.add(u),I.value.delete(u))}function Ze(){I.value.clear()}function et(){I.value.clear(),M.value.clear(),J.value=[...V.value];const u=new Set(Ae.value);for(const c of V.value)u.has(c)||I.value.add(c)}function we(u,c){const B=[...J.value],f=B.indexOf(u);if(f===-1)return;const Y=c==="up"?f-1:f+1;if(Y<0||Y>=B.length)return;const m=B[Y];B[Y]=u,B[f]=m,J.value=B}function tt(u,c){oe.value=c,u.dataTransfer&&(u.dataTransfer.effectAllowed="move",u.dataTransfer.setData("text/plain",c))}function Ie(u){u.preventDefault(),u.dataTransfer&&(u.dataTransfer.dropEffect="move")}function ot(u,c){if(u.preventDefault(),!oe.value||oe.value===c)return;const B=[...J.value],f=B.indexOf(oe.value),Y=B.indexOf(c);f===-1||Y===-1||(B.splice(f,1),B.splice(Y,0,oe.value),J.value=B,oe.value=null)}function Ce(){oe.value=null}const F=U(()=>{const u=a.modelDescription;if(!(u!=null&&u.fields))return{};const c={};for(const[B,f]of Object.entries(u.fields))c[B]=f.type;return c}),ft=U(()=>{const u=a.modelDescription;if(!(u!=null&&u.fields))return{};const c={};for(const[B,f]of Object.entries(u.fields))c[B]=f.required===!0;return c});function ne(u){return ft.value[u]===!0}const ae=$(null);async function ge(u){const c=JSON.stringify(u,null,2);await ht(c)?(ae.value=u.id??Object.values(u)[0],De.success("Entry copied to clipboard."),setTimeout(()=>{ae.value=null},2e3)):De.error("Failed to copy entry.")}const ue=$(!1),Be=$(""),de=$(""),ye=$("");function Jt(u,c){Be.value=u,de.value=c,ye.value=F.value[u]??"string",ue.value=!0}function Yt(u){return u.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,"<code>$1</code>").replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2" target="_blank" rel="noopener">$1</a>').replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>").replace(/^(.+)$/gm,c=>c.startsWith("<")?c:`<p>${c}</p>`)}function Qt(u,c){const B=F.value[c];return B==="markdown"||B==="richtext"||B==="code"||B==="text"||typeof u=="string"&&u.length>100||typeof u=="object"&&u!==null&&!Array.isArray(u)}async function Ee(){try{await Promise.all([a.fetchContent(n.value,q.value),a.fetchModelDescription(n.value),a.fetchValidation(n.value)])}catch{De.error("Failed to load content. Please try again.")}}async function Xt(){W.value=null,await Ee()}function Zt(u){W.value=W.value===u?null:u}function Ke(u){const c=Math.max(1,Math.min(u,C.value));L.value=c,H.value=String(c),W.value=null}function eo(u){const c=u.target,B=Number.parseInt(c.value,10);Number.isNaN(B)?H.value=String(L.value):Ke(B)}async function to(u){await ht(u)?(A.value=u,De.success("ID copied to clipboard."),setTimeout(()=>{A.value=null},2e3)):De.error("Failed to copy ID.")}function pe(u,c){return yo(u,F.value[c])}return he(Ee),ve(n,()=>{L.value=1,H.value="1",_.value="",W.value=null,J.value=[],I.value.clear(),M.value.clear(),Ee()}),ve(q,()=>{L.value=1,H.value="1",W.value=null,Ee()}),ve(_,()=>{L.value=1,H.value="1",W.value=null}),ve(L,u=>{H.value=String(u)}),mo(u=>{u.type==="content:changed"&&u.modelId===n.value&&Ee()}),(u,c)=>{var B;return l(),S("div",gr,[g(ho,{title:n.value,description:`${O.value} ${O.value===1?"entry":"entries"}${(B=e(a).contentList)!=null&&B.kind?` · ${e(a).contentList.kind}`:""}`},{actions:i(()=>[x.value&&d.value.length>1?(l(),k(e(Bt),{key:0,"model-value":q.value??"__all__","onUpdate:modelValue":c[0]||(c[0]=f=>q.value=f==="__all__"?void 0:String(f))},{default:i(()=>[g(e($t),{size:"sm",class:"h-8 w-auto gap-1.5 text-xs"},{default:i(()=>[g(e(Ot),{placeholder:e(o)["content-list.all-locales"]},null,8,["placeholder"])]),_:1}),g(e(Pt),null,{default:i(()=>[g(e(Me),{value:"__all__"},{default:i(()=>[R(b(e(o)["content-list.all-locales"]),1)]),_:1}),(l(!0),S(te,null,fe(d.value,f=>(l(),k(e(Me),{key:f,value:f},{default:i(()=>[R(b(f),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])):X("",!0),g(e(se),{variant:"outline",size:"sm",class:"h-8",disabled:e(a).loading,onClick:Xt},{default:i(()=>[e(a).loading?(l(),k(e(gt),{key:0,class:"mr-1.5 size-3.5 animate-spin"})):(l(),k(e(Eo),{key:1,class:"mr-1.5 size-3.5"})),R(" "+b(e(o)["content-list.refresh"]),1)]),_:1},8,["disabled"])]),_:1},8,["title","description"]),w("div",yr,[w("div",hr,[g(e(wo),{status:e(y),count:e(p)},null,8,["status","count"]),w("div",{class:Q(e(K)("relative transition-all duration-200",P.value||_.value?"w-72":"w-48"))},[g(e(Bo),{class:"absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),g(e(Po),{modelValue:_.value,"onUpdate:modelValue":c[1]||(c[1]=f=>_.value=f),placeholder:e(o)["content-list.search-entries"],class:"h-8 pl-8 text-xs",onFocus:c[2]||(c[2]=f=>P.value=!0),onBlur:c[3]||(c[3]=f=>P.value=!1)},null,8,["modelValue","placeholder"])],2),c[15]||(c[15]=w("div",{class:"flex-1"},null,-1)),g(e(pr),null,{default:i(()=>[g(e(vr),{"as-child":""},{default:i(()=>[g(e(se),{variant:"outline",size:"sm",class:"h-8 gap-1.5 text-xs"},{default:i(()=>[g(e(Yo),{class:"size-3.5"}),R(" "+b(e(o)["content-list.columns"])+" ",1),I.value.size>0?(l(),k(e(re),{key:0,variant:"secondary",class:"h-4 px-1 text-[10px]"},{default:i(()=>[R(b(be.value.length)+"/"+b(V.value.length),1)]),_:1})):X("",!0)]),_:1})]),_:1}),g(e(fr),{align:"end",class:"w-65 p-0"},{default:i(()=>[w("div",_r,[w("div",xr,[w("span",br,b(e(o)["content-list.toggle-columns"]),1),w("div",wr,[g(e(se),{variant:"link",size:"sm",class:"h-auto p-0 text-[10px] text-primary hover:underline",onClick:Ze},{default:i(()=>[R(b(e(o)["content-list.show-all"]),1)]),_:1}),c[14]||(c[14]=w("span",{class:"text-[10px] text-muted-foreground"},"·",-1)),g(e(se),{variant:"link",size:"sm",class:"h-auto p-0 text-[10px] text-muted-foreground hover:text-foreground hover:underline",onClick:et},{default:i(()=>[R(b(e(o)["content-list.reset"]),1)]),_:1})])])]),w("div",Sr,[(l(!0),S(te,null,fe(Te.value,(f,Y)=>(l(),S("div",{key:f,draggable:!0,class:Q(e(K)("flex w-full items-center gap-1 rounded-md px-1.5 py-1.5 text-xs transition-all",oe.value===f?"opacity-30 bg-accent scale-95":"hover:bg-accent",M.value.has(f)&&"bg-primary/5 border border-primary/10")),onDragstart:m=>tt(m,f),onDragover:Ie,onDrop:m=>ot(m,f),onDragend:Ce},[w("div",qr,[g(e(Wo),{class:"size-3.5 cursor-grab text-muted-foreground/40 active:cursor-grabbing"}),w("div",Cr,[g(e(se),{variant:"ghost",size:"sm",class:"h-auto p-0 text-muted-foreground/30 hover:text-foreground disabled:opacity-20",disabled:Y===0,onClick:Z(m=>we(f,"up"),["stop"])},{default:i(()=>[g(e(Lo),{class:"size-2.5"})]),_:1},8,["disabled","onClick"]),g(e(se),{variant:"ghost",size:"sm",class:"h-auto p-0 text-muted-foreground/30 hover:text-foreground disabled:opacity-20",disabled:Y===Te.value.length-1,onClick:Z(m=>we(f,"down"),["stop"])},{default:i(()=>[g(e(Vo),{class:"size-2.5"})]),_:1},8,["disabled","onClick"])])]),g(e(se),{variant:"ghost",size:"sm",class:"shrink-0 h-auto p-0.5",onClick:Z(m=>Xe(f),["stop"])},{default:i(()=>[(l(),k(Se(I.value.has(f)?e(Uo):e(Ko)),{class:Q(e(K)("size-3.5",I.value.has(f)?"text-muted-foreground/30":"text-foreground"))},null,8,["class"]))]),_:2},1032,["onClick"]),w("span",{class:Q(e(K)("flex-1 truncate",I.value.has(f)&&"text-muted-foreground/50 line-through"))},b(f),3),F.value[f]?(l(),k(e(re),{key:0,variant:"secondary",class:Q(e(K)("text-[9px] h-4 px-1 shrink-0",I.value.has(f)&&"opacity-30"))},{default:i(()=>[R(b(F.value[f]),1)]),_:2},1032,["class"])):X("",!0),g(e(se),{variant:"ghost",size:"sm",class:"shrink-0 h-auto p-0.5",onClick:Z(m=>Ue(f),["stop"])},{default:i(()=>[(l(),k(Se(M.value.has(f)?e(kt):e(Jo)),{class:Q(e(K)("size-3",M.value.has(f)?"text-primary":"text-muted-foreground/30 hover:text-muted-foreground"))},null,8,["class"]))]),_:2},1032,["onClick"])],42,kr))),128))])]),_:1})]),_:1}),w("span",Br,b(O.value)+" "+b(O.value===1?"entry":"entries"),1)]),g(_t,{title:e(o)["content-list.ask-your-agent"],class:"mb-4"},{default:i(()=>[w("div",Pr,[g(Pe,{prompt:`Add a new entry to ${n.value}`},null,8,["prompt"]),g(Pe,{prompt:`Update the content of ${n.value}`},null,8,["prompt"]),g(Pe,{prompt:`Translate ${n.value} content to Turkish`},null,8,["prompt"]),g(Pe,{prompt:`Delete draft entries from ${n.value}`},null,8,["prompt"])])]),_:1},8,["title"]),e(a).loading&&z.value.length===0?(l(),S("div",$r,[g(e(gt),{class:"size-6 animate-spin text-primary"})])):z.value.length===0?(l(),S("div",Or,[w("div",Ar,[g(e(Ro),{class:"size-6 text-muted-foreground"})]),w("h2",Tr,b(e(o)["content-list.no-entries-yet"]),1),w("p",Ir,b(e(o)["content-list.create-content-using-ai"]),1),g(_t,{title:e(o)["content-list.ask-your-agent"],class:"mt-6 w-full max-w-md"},{default:i(()=>[g(Pe,{prompt:`Create sample content for ${n.value}`},null,8,["prompt"]),g(Pe,{prompt:`Generate 5 entries for ${n.value}`},null,8,["prompt"])]),_:1},8,["title"])])):h.value.length===0?(l(),S("div",Er,[w("p",zr,b(e(o)["content-list.no-entries-matching"])+b(_.value)+'" ',1)])):(l(),S(te,{key:3},[w("div",Dr,[g(e(nr),null,{default:i(()=>[g(e(ir),null,{default:i(()=>[g(e(st),{class:"hover:bg-transparent"},{default:i(()=>[g(e(nt),{class:"w-10 text-center text-[11px] font-medium text-muted-foreground"},{default:i(()=>[...c[16]||(c[16]=[R("#",-1)])]),_:1}),(l(!0),S(te,null,fe(be.value,f=>(l(),k(e(nt),{key:f,class:Q(e(K)("text-[11px] font-medium uppercase tracking-wider text-muted-foreground",M.value.has(f)&&"bg-background/95 backdrop-blur"))},{default:i(()=>[w("div",Mr,[M.value.has(f)?(l(),k(e(kt),{key:0,class:"size-2.5 text-primary/50"})):X("",!0),R(" "+b(f),1)])]),_:2},1032,["class"]))),128)),g(e(nt),{class:"w-10"})]),_:1})]),_:1}),g(e(lr),null,{default:i(()=>[(l(!0),S(te,null,fe(D.value,(f,Y)=>(l(),S(te,{key:Y},[g(e(st),{class:Q(e(K)("group/row cursor-pointer transition-colors",W.value===Y?"bg-muted/50":"hover:bg-muted/30",Y%2===1&&W.value!==Y&&"bg-muted/15")),onClick:m=>Zt(Y)},{default:i(()=>[g(e(Ge),{class:"w-10 text-center"},{default:i(()=>[w("div",Fr,[w("span",jr,b((L.value-1)*N.value+Y+1),1),(l(),k(Se(W.value===Y?e(Vt):e(ct)),{class:"size-3 text-muted-foreground/50"}))])]),_:2},1024),(l(!0),S(te,null,fe(be.value,m=>(l(),k(e(Ge),{key:m,class:"max-w-60"},{default:i(()=>[pe(f[m],m)==="empty"?(l(),S(te,{key:0},[ne(m)?(l(),S("span",Rr,[g(e(yt),{class:"size-3"}),R(" "+b(e(o)["content-list.missing"]),1)])):(l(),S("span",Vr,"—"))],64)):pe(f[m],m)==="boolean"?(l(),S("div",{key:1,class:Q(e(K)("inline-flex h-5 w-9 items-center rounded-full px-0.5 transition-colors",f[m]?"bg-primary/20":"bg-muted"))},[w("div",{class:Q(e(K)("size-4 rounded-full shadow-sm transition-transform",f[m]?"translate-x-4 bg-primary":"translate-x-0 bg-muted-foreground/40"))},null,2)],2)):pe(f[m],m)==="array"?(l(),k(e(re),{key:2,variant:"secondary",class:"text-[10px]"},{default:i(()=>[R(b(f[m].length)+" "+b(f[m].length===1?"item":"items"),1)]),_:2},1024)):pe(f[m],m)==="number"?(l(),S("span",Nr,b(f[m]),1)):pe(f[m],m)==="date"?(l(),S("div",Lr,[w("p",Hr,b(e(We)(f[m]).title),1),w("p",Ur,b(e(We)(f[m]).subtitle),1)])):pe(f[m],m)==="color"?(l(),S("div",Kr,[w("span",{class:"inline-block size-4 rounded border border-border shadow-sm",style:Je({backgroundColor:String(f[m])})},null,4),w("span",Wr,b(f[m]),1)])):pe(f[m],m)==="markdown"||pe(f[m],m)==="richtext"?(l(),k(e(re),{key:6,variant:"outline",class:"text-[10px]"},{default:i(()=>[R(b(pe(f[m],m)==="markdown"?"MD":"Rich"),1)]),_:2},1024)):pe(f[m],m)==="relation"?(l(),k(e(re),{key:7,variant:"outline",class:"text-[10px] font-mono"},{default:i(()=>[R(b(Array.isArray(f[m])?`${f[m].length} refs`:"ref"),1)]),_:2},1024)):(l(),S("span",Gr,b(e(go)(f[m],60)),1))]),_:2},1024))),128)),g(e(Ge),{class:"w-10 text-center"},{default:i(()=>[g(e(So),null,{default:i(()=>[g(e(ko),null,{default:i(()=>[g(e(qo),{"as-child":""},{default:i(()=>[g(e(se),{variant:"ghost",size:"sm",class:"size-7 p-0 text-muted-foreground opacity-0 transition-all group-hover/row:opacity-100 hover:bg-accent hover:text-foreground",onClick:Z(m=>ge(f),["stop"])},{default:i(()=>[(l(),k(Se(ae.value===(f.id??Y)?e(lt):e(xt)),{class:Q(["size-3.5",ae.value===(f.id??Y)&&"text-status-success"])},null,8,["class"]))]),_:2},1032,["onClick"])]),_:2},1024),g(e(Co),{side:"left"},{default:i(()=>[w("p",Jr,b(ae.value===(f.id??Y)?"Copied!":"Copy entry as JSON"),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["class","onClick"]),W.value===Y?(l(),k(e(st),{key:0,class:"bg-muted/30 hover:bg-muted/30"},{default:i(()=>[g(e(Ge),{colspan:be.value.length+2,class:"p-0"},{default:i(()=>[w("div",Yr,[w("div",Qr,[(l(!0),S(te,null,fe(f,(m,j)=>(l(),S("div",{key:String(j),class:"group/card flex flex-col gap-1 rounded-md border border-border/50 bg-background/50 px-3 py-2 overflow-hidden"},[w("div",Xr,[w("span",Zr,b(j),1),F.value[String(j)]?(l(),k(e(re),{key:0,variant:"secondary",class:"text-[8px] h-3.5 px-1"},{default:i(()=>[R(b(F.value[String(j)]),1)]),_:2},1024)):X("",!0),w("div",es,[String(j)==="id"?(l(),k(e(se),{key:0,variant:"ghost",size:"sm",class:"size-5 p-0 text-muted-foreground hover:bg-accent hover:text-foreground",onClick:Z(ee=>to(String(m)),["stop"])},{default:i(()=>[(l(),k(Se(A.value===String(m)?e(lt):e(xt)),{class:Q(["size-3",A.value===String(m)&&"text-status-success"])},null,8,["class"]))]),_:2},1032,["onClick"])):X("",!0),m!=null&&m!==""&&Qt(m,String(j))?(l(),k(e(se),{key:1,variant:"ghost",size:"sm",class:"size-5 p-0 text-muted-foreground hover:bg-accent hover:text-foreground",onClick:Z(ee=>Jt(String(j),m),["stop"])},{default:i(()=>[g(e(Go),{class:"size-3"})]),_:1},8,["onClick"])):X("",!0)])]),m==null||m===""?(l(),S(te,{key:0},[ne(String(j))?(l(),S("span",ts,[g(e(yt),{class:"size-3"}),R(" "+b(e(o)["content-list.required"]),1)])):(l(),S("span",os,"—"))],64)):F.value[String(j)]==="boolean"||typeof m=="boolean"?(l(),S("div",as,[w("div",{class:Q(e(K)("h-5 w-9 rounded-full p-0.5 transition-colors",m?"bg-primary":"bg-muted"))},[w("div",{class:Q(e(K)("size-4 rounded-full bg-white shadow transition-transform",m?"translate-x-4":"translate-x-0"))},null,2)],2),w("span",rs,b(m?"Yes":"No"),1)])):F.value[String(j)]==="color"?(l(),S("div",ss,[w("span",{class:"size-6 rounded-md border border-border shadow-sm",style:Je({backgroundColor:String(m)})},null,4),w("span",ns,b(m),1)])):F.value[String(j)]==="rating"?(l(),S("div",ls,[(l(),S(te,null,fe(5,ee=>w("span",{key:ee,class:Q(e(K)("text-base",ee<=Number(m)?"text-amber-400":"text-muted/50"))},"★",2)),64)),w("span",is,b(m)+"/5",1)])):F.value[String(j)]==="percent"?(l(),S("div",us,[w("div",ds,[w("div",{class:"h-full rounded-full bg-primary transition-all",style:Je({width:`${Math.min(Number(m),100)}%`})},null,4)]),w("span",cs,b(m)+"%",1)])):F.value[String(j)]==="email"?(l(),S("a",{key:5,href:`mailto:${m}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline",onClick:c[4]||(c[4]=Z(()=>{},["stop"]))},b(m),9,ps)):F.value[String(j)]==="url"?(l(),S("a",{key:6,href:String(m),target:"_blank",rel:"noopener",class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline truncate max-w-full",onClick:c[5]||(c[5]=Z(()=>{},["stop"]))},b(String(m).replace(/^https?:\/\//,"")),9,fs)):F.value[String(j)]==="phone"?(l(),S("a",{key:7,href:`tel:${m}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline",onClick:c[6]||(c[6]=Z(()=>{},["stop"]))},b(m),9,vs)):F.value[String(j)]==="image"?(l(),S("div",ms,[w("div",gs,[w("img",{src:String(m),alt:String(j),class:"size-10 rounded-md object-cover",onError:c[7]||(c[7]=ee=>ee.target.style.display="none")},null,40,ys)]),w("span",hs,b(String(m).split("/").pop()),1)])):F.value[String(j)]==="video"||F.value[String(j)]==="file"?(l(),S("div",_s,[g(e(re),{variant:"outline",class:"text-[10px] shrink-0"},{default:i(()=>{var ee;return[R(b(F.value[String(j)]==="video"?"▶":"📎")+" "+b((ee=String(m).split(".").pop())==null?void 0:ee.toUpperCase()),1)]}),_:2},1024),w("span",xs,b(String(m).split("/").pop()),1)])):F.value[String(j)]==="relation"?(l(),k(e(re),{key:10,variant:"outline",class:"text-[10px] font-mono gap-1"},{default:i(()=>[R(" 🔗 "+b(m),1)]),_:2},1024)):F.value[String(j)]==="relations"&&Array.isArray(m)?(l(),S("div",bs,[(l(!0),S(te,null,fe(m,(ee,at)=>(l(),k(e(re),{key:at,variant:"outline",class:"text-[10px] font-mono gap-1"},{default:i(()=>[R(" 🔗 "+b(ee),1)]),_:2},1024))),128))])):Array.isArray(m)?(l(),S("div",ws,[(l(!0),S(te,null,fe(m.slice(0,8),(ee,at)=>(l(),k(e(re),{key:at,variant:"outline",class:"text-[10px]"},{default:i(()=>[R(b(typeof ee=="string"?ee:JSON.stringify(ee)),1)]),_:2},1024))),128)),m.length>8?(l(),k(e(re),{key:0,variant:"secondary",class:"text-[10px]"},{default:i(()=>[R("+"+b(m.length-8),1)]),_:2},1024)):X("",!0)])):F.value[String(j)]==="select"?(l(),k(e(re),{key:13,variant:"secondary",class:"text-[10px] w-fit"},{default:i(()=>[R(b(m),1)]),_:2},1024)):F.value[String(j)]==="date"||F.value[String(j)]==="datetime"?(l(),S("span",Ss,[R(b(e(We)(String(m)).title)+" ",1),F.value[String(j)]==="datetime"?(l(),S("span",ks,b(e(We)(String(m)).subtitle),1)):X("",!0)])):F.value[String(j)]==="slug"?(l(),S("span",qs,"/"+b(m),1)):F.value[String(j)]==="code"?(l(),S("code",Cs,b(m),1)):F.value[String(j)]==="markdown"||F.value[String(j)]==="richtext"?(l(),S("div",Bs,[g(e(re),{variant:"secondary",class:"text-[9px] shrink-0"},{default:i(()=>[R(b(F.value[String(j)]==="markdown"?"MD":"HTML"),1)]),_:2},1024),w("span",Ps,b(String(m).replace(/<[^>]*>/g,"").replace(/[#*`_\[\]]/g,"")),1)])):["number","integer","decimal"].includes(F.value[String(j)]??"")?(l(),S("span",$s,b(m),1)):(l(),S("span",Os,b(typeof m=="string"?m:JSON.stringify(m)),1))]))),128))])])]),_:2},1032,["colspan"])]),_:2},1024)):X("",!0)],64))),128))]),_:1})]),_:1})]),C.value>1||O.value>10?(l(),S("div",As,[w("div",Ts,[w("span",Is,b(e(o)["content-list.show"]),1),g(e(Bt),{"model-value":String(N.value),"onUpdate:modelValue":c[8]||(c[8]=f=>{N.value=Number(f),Ke(1)})},{default:i(()=>[g(e($t),{size:"sm",class:"h-7 w-16 text-xs"},{default:i(()=>[g(e(Ot))]),_:1}),g(e(Pt),null,{default:i(()=>[g(e(Me),{value:"10"},{default:i(()=>[...c[17]||(c[17]=[R("10",-1)])]),_:1}),g(e(Me),{value:"20"},{default:i(()=>[...c[18]||(c[18]=[R("20",-1)])]),_:1}),g(e(Me),{value:"50"},{default:i(()=>[...c[19]||(c[19]=[R("50",-1)])]),_:1})]),_:1})]),_:1},8,["model-value"])]),w("div",Es,[g(e(se),{variant:"outline",size:"sm",class:"size-7 p-0",disabled:L.value<=1,onClick:c[9]||(c[9]=f=>Ke(L.value-1))},{default:i(()=>[g(e(Ho),{class:"size-4"})]),_:1},8,["disabled"]),w("div",zs,[w("span",null,b(e(o)["content-list.page"]),1),lo(w("input",{"onUpdate:modelValue":c[10]||(c[10]=f=>H.value=f),type:"text",inputmode:"numeric",class:"h-7 w-10 rounded-md border border-input bg-background text-center text-xs text-foreground outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50",onBlur:eo,onKeydown:c[11]||(c[11]=uo(f=>f.target.blur(),["enter"]))},null,544),[[io,H.value]]),w("span",null,"of "+b(C.value),1)]),g(e(se),{variant:"outline",size:"sm",class:"size-7 p-0",disabled:L.value>=C.value,onClick:c[12]||(c[12]=f=>Ke(L.value+1))},{default:i(()=>[g(e(No),{class:"size-4"})]),_:1},8,["disabled"])]),c[20]||(c[20]=w("div",{class:"w-24"},null,-1))])):X("",!0)],64)),g(_o,{message:e(o)["content-list.content-mutations-are-agent"],class:"mt-4"},null,8,["message"]),g(e(zo),{open:ue.value,"onUpdate:open":c[13]||(c[13]=f=>ue.value=f)},{default:i(()=>[g(e(Do),{class:"max-w-2xl max-h-[80vh] flex flex-col"},{default:i(()=>[g(e(Mo),null,{default:i(()=>[g(e(Fo),{class:"flex items-center gap-2"},{default:i(()=>[w("span",Ds,b(Be.value),1),g(e(re),{variant:"secondary",class:"text-[10px]"},{default:i(()=>[R(b(ye.value),1)]),_:1})]),_:1})]),_:1}),w("div",Ms,[ye.value==="markdown"?(l(),S("div",{key:0,class:"prose prose-sm dark:prose-invert max-w-none",innerHTML:Yt(String(de.value))},null,8,Fs)):ye.value==="richtext"?(l(),S("div",{key:1,class:"prose prose-sm dark:prose-invert max-w-none",innerHTML:de.value},null,8,js)):ye.value==="code"?(l(),S("pre",Rs,[w("code",null,b(de.value),1)])):typeof de.value=="object"?(l(),S("pre",Vs,[c[21]||(c[21]=R(" ",-1)),w("code",null,b(JSON.stringify(de.value,null,2)),1)])):(l(),S("p",Ns,b(de.value),1))])]),_:1})]),_:1},8,["open"])])])}}}),Hs=(r,o)=>{const t=r.__vccOpts||r;for(const[a,s]of o)t[a]=s;return t},yn=Hs(Ls,[["__scopeId","data-v-7eb41568"]]);export{yn as default};
@@ -0,0 +1 @@
1
+ input[type=text][inputmode=numeric][data-v-7eb41568]{-moz-appearance:textfield}input[type=text][inputmode=numeric][data-v-7eb41568]::-webkit-outer-spin-button,input[type=text][inputmode=numeric][data-v-7eb41568]::-webkit-inner-spin-button{-webkit-appearance:none}
@@ -0,0 +1 @@
1
+ import{a as $,p as l,j as d,u as t,q as s,B as n,F as p,x as C,g as w,r as F,h as z,o as a,y as B,z as V,b as L,A as N,e as x,s as _,C as S}from"./index-CoUshYEB.js";import{u as q}from"./project-B1qSm0Fz.js";import{_ as P}from"./PageHeader.vue_vue_type_script_setup_true_lang-C7aWxNSw.js";import{_ as g}from"./index-WHgvdYOs.js";import{S as T,_ as A}from"./Input.vue_vue_type_script_setup_true_lang-otPltlZG.js";import{d as E}from"./useWatch-COpVIQvm.js";import{F as h}from"./file-text-BDHXQ95W.js";import{L as K}from"./languages-BTcd2Rl1.js";import{B as O}from"./book-open-BrGAe3tk.js";import{D as R}from"./database-BGEFn4Oq.js";const U={class:"px-6 py-6"},G={key:0,class:"flex flex-col items-center py-16 text-center"},H={class:"mb-4 flex size-14 items-center justify-center rounded-full bg-muted"},I={class:"text-lg font-semibold"},J={class:"mt-2 max-w-sm text-sm text-muted-foreground"},M={class:"relative mb-6 max-w-sm"},Q={class:"mb-3 text-xs font-medium uppercase tracking-wider text-muted-foreground"},W={class:"space-y-1.5"},X=["onClick"],Y={class:"min-w-0 flex-1"},Z={class:"font-medium text-foreground"},tt={class:"flex items-center gap-2 shrink-0"},et={key:0,class:"py-12 text-center text-sm text-muted-foreground"},pt=$({__name:"ContentPage",setup(st){const e=E("serve-ui-texts").locale("en").get(),v=q(),j=S(),u=F(""),b=z(()=>{var r;const o=((r=v.status)==null?void 0:r.models)??[];if(!u.value)return o;const i=u.value.toLowerCase();return o.filter(m=>m.id.toLowerCase().includes(i)||m.domain.toLowerCase().includes(i))}),D=z(()=>{const o={};for(const i of b.value){const r=i.domain||"default";o[r]||(o[r]=[]),o[r].push(i)}return o}),y={collection:{icon:R,color:"bg-primary/10 text-primary",label:e["content.collection"]},singleton:{icon:h,color:"bg-status-info/10 text-status-info",label:e["content.singleton"]},document:{icon:O,color:"bg-status-success/10 text-status-success",label:e["content.document"]},dictionary:{icon:h,color:"bg-status-warning/10 text-status-warning",label:e["content.dictionary"]}};function f(o){return y[o]??y.collection}return(o,i)=>{var r;return a(),l("div",null,[d(P,{title:t(e)["content.content"],description:t(e)["content.browse-and-inspect-content"]},null,8,["title","description"]),s("div",U,[(((r=t(v).status)==null?void 0:r.models)??[]).length===0?(a(),l("div",G,[s("div",H,[d(t(h),{class:"size-6 text-muted-foreground"})]),s("h2",I,n(t(e)["content.no-models-yet"]),1),s("p",J,n(t(e)["content.create-models-using-your"]),1)])):(a(),l(p,{key:1},[s("div",M,[d(t(T),{class:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),d(t(A),{modelValue:u.value,"onUpdate:modelValue":i[0]||(i[0]=m=>u.value=m),placeholder:t(e)["content.filter-models"],class:"h-9 pl-9 text-sm"},null,8,["modelValue","placeholder"])]),(a(!0),l(p,null,C(D.value,(m,k)=>(a(),l("div",{key:k,class:"mb-8 last:mb-0"},[s("h3",Q,n(k),1),s("div",W,[(a(!0),l(p,null,C(m,c=>(a(),l("button",{key:c.id,class:B(t(V)("group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-4 py-3 text-left transition-all","hover:border-primary/30 hover:shadow-sm")),onClick:ot=>t(j).push(`/content/${c.id}`)},[s("div",{class:B(t(V)("flex size-8 shrink-0 items-center justify-center rounded-md",f(c.kind).color))},[(a(),L(N(f(c.kind).icon),{class:"size-4"}))],2),s("div",Y,[s("span",Z,n(c.id),1)]),s("div",tt,[d(t(g),{variant:"secondary",class:"text-[10px]"},{default:x(()=>[_(n(f(c.kind).label),1)]),_:2},1024),d(t(g),{variant:"outline",class:"text-[10px]"},{default:x(()=>[_(n(c.fields)+" "+n(t(e)["content.fields"]),1)]),_:2},1024),c.i18n?(a(),L(t(g),{key:0,variant:"outline",class:"text-[10px] text-status-info border-status-info/30"},{default:x(()=>[d(t(K),{class:"mr-0.5 size-3"}),_(" "+n(t(e)["content.i18n"]),1)]),_:1})):w("",!0)])],10,X))),128))])]))),128)),b.value.length===0&&u.value?(a(),l("div",et,n(t(e)["content.no-models-matching"])+n(u.value)+'" ',1)):w("",!0)],64))])])}}});export{pt as default};
@@ -0,0 +1,21 @@
1
+ import{_ as O}from"./model-empty-state-B6AM4bil.js";import{c as $,a as oe,w as re,i as ae,p as d,j as c,u as e,q as o,L as P,B as l,s as m,F as h,b,e as y,g as u,x as k,C as ne,h as g,r as H,E as W,o as n,y as f,z as x,A as S}from"./index-CoUshYEB.js";import{u as le}from"./project-B1qSm0Fz.js";import{u as ie}from"./content-BQE3NEm5.js";import{d as de,u as ce}from"./useWatch-COpVIQvm.js";import{_ as ue}from"./PageHeader.vue_vue_type_script_setup_true_lang-C7aWxNSw.js";import{A as w,_ as me}from"./StudioHint.vue_vue_type_script_setup_true_lang-B45TG2r1.js";import{_ as be,a as pe}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-Dy-5bpEY.js";import{_ as j}from"./index-WHgvdYOs.js";import{_ as ge,C as fe}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CgoQGS6k.js";import{S as q}from"./settings-DL-0RaxD.js";import{G as K}from"./git-branch-DdE7bk9-.js";import{B as J}from"./book-marked-D8StxRZP.js";import{B as F}from"./box-7olVZr5D.js";import{B as xe}from"./book-open-BrGAe3tk.js";import{F as he}from"./file-code-BGiS4dun.js";import{L as ve,T as _e}from"./trash-2-83QhL6-T.js";import{G as ye}from"./git-merge-iStuJS69.js";import{F as Q}from"./file-text-BDHXQ95W.js";import{L as ke}from"./languages-BTcd2Rl1.js";import"./useId-C0uR6mdj.js";import"./Presence-cbB6AqkQ.js";import"./shield-check-CUL7KkSA.js";/**
2
+ * @license lucide-vue-next v0.474.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 U=$("ActivityIcon",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
7
+ * @license lucide-vue-next v0.474.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 X=$("CircleDotIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
12
+ * @license lucide-vue-next v0.474.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 Y=$("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
17
+ * @license lucide-vue-next v0.474.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const T=$("ShieldAlertIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),we={class:"px-6 py-6 space-y-8"},ze={key:0,class:"flex items-center justify-center py-20"},Ce={key:1,class:"rounded-xl border border-destructive/20 bg-destructive/5 p-6 text-center"},je={class:"text-sm font-medium text-destructive"},$e={key:2,class:"flex flex-col items-center justify-center py-20 text-center"},Be={class:"text-lg font-semibold text-foreground"},Le={class:"mt-2 max-w-sm text-sm text-muted-foreground"},Me={class:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs"},Ae={class:"flex flex-wrap items-center gap-3"},Se={key:0,class:"text-muted-foreground"},Fe={class:"grid grid-cols-2 gap-4 lg:grid-cols-5"},Te=["onClick"],De={class:"flex items-center justify-between"},Ge={class:"text-2xl font-bold text-foreground"},Ee={class:"text-xs font-medium text-muted-foreground"},Ie={key:0,class:"mt-0.5 text-[10px] text-muted-foreground/70"},Ve={class:"mb-4 flex items-center justify-between"},Ne={class:"text-sm font-semibold text-foreground"},Re={key:0,class:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4"},Oe=["onClick"],Pe={class:"flex items-center justify-between gap-2"},He={class:"flex items-center gap-2 min-w-0"},We={class:"truncate font-medium text-foreground"},qe={class:"flex items-center gap-3 text-xs text-muted-foreground"},Ke={class:"flex items-center gap-1"},Je={class:"rounded bg-muted px-1.5 py-0.5 text-[10px]"},Qe={key:0,class:"flex items-center gap-1"},Ue={class:"flex items-center justify-end"},Xe={key:1,class:"flex flex-col items-center rounded-xl border border-dashed border-border py-16 text-center"},Ye={class:"text-sm font-semibold text-foreground"},Ze={class:"mt-1.5 max-w-xs text-xs text-muted-foreground"},et={class:"mb-4 flex items-center justify-between"},tt={class:"flex items-center gap-2"},st={class:"text-sm font-semibold text-foreground"},ot={key:0,class:"flex justify-center py-8"},rt={key:1,class:"flex flex-col items-center rounded-xl border border-dashed border-border py-10 text-center"},at={class:"text-xs text-muted-foreground"},nt={key:2,class:"relative space-y-0"},lt={class:"flex-1 min-w-0 pt-1"},it={class:"flex items-center gap-2"},dt={class:"text-xs font-medium text-foreground"},ct={key:0,class:"truncate font-mono text-xs text-muted-foreground"},ut={class:"flex items-center gap-2 mt-0.5"},mt={class:"text-[10px] text-muted-foreground"},bt={class:"text-[10px] text-muted-foreground/50"},pt={key:0},gt={class:"mb-4 flex items-center justify-between"},ft={class:"flex items-center gap-2"},xt={class:"text-sm font-semibold text-foreground"},ht={class:"rounded-xl border border-status-warning/20 bg-linear-to-b from-status-warning/5 to-card p-4"},vt={class:"space-y-1.5"},Ht=oe({__name:"DashboardPage",setup(_t){const i=le(),v=ne(),D=ie(),r=de("serve-ui-texts").locale("en").get(),G=g(()=>{var p;const t=(p=i.status)==null?void 0:p.context;if(!(t!=null&&t.stats))return 0;const a=t.stats;return typeof a.total_entries=="number"?a.total_entries:0}),Z=g(()=>{var a,p,s;const t=i.status;return t?[{icon:F,label:r["dashboard.models"],value:t.models.length,to:"/models",color:"text-blue-500",bg:"bg-blue-500/10"},{icon:Q,label:r["dashboard.entries"],value:G.value,to:void 0,color:"text-emerald-500",bg:"bg-emerald-500/10"},{icon:ke,label:r["dashboard.locales"],value:((a=t.config)==null?void 0:a.locales.supported.length)??0,subtitle:((p=t.config)==null?void 0:p.locales.supported.join(", "))??"—",to:void 0,color:"text-violet-500",bg:"bg-violet-500/10"},{icon:K,label:r["dashboard.branches"],value:((s=t.branches)==null?void 0:s.unmerged)??0,subtitle:t.branches?`${t.branches.total} ${r["dashboard.total"]}`:void 0,to:"/branches",color:"text-orange-500",bg:"bg-orange-500/10"},...t.validation&&(t.validation.errors>0||t.validation.warnings>0)?[{icon:T,label:r["dashboard.issues"],value:t.validation.errors+t.validation.warnings,subtitle:`${t.validation.errors}E ${t.validation.warnings}W`,to:"/validate",color:"text-red-500",bg:"bg-red-500/10",warn:!0}]:[]]:[]}),B=g(()=>{var t,a;return((a=(t=i.status)==null?void 0:t.config)==null?void 0:a.workflow)??null}),ee=g(()=>{var a;const t=(a=i.status)==null?void 0:a.validation;return t?t.errors>0?"warning":t.warnings>0?"partial":"validated":"pending"}),te=g(()=>{var a;const t=(a=i.status)==null?void 0:a.validation;return t?t.errors+t.warnings:0}),E={collection:{icon:ve,color:"text-blue-500",badgeCls:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-300"},singleton:{icon:he,color:"text-teal-500",badgeCls:"border-teal-200 bg-teal-50 text-teal-700 dark:border-teal-800 dark:bg-teal-950 dark:text-teal-300"},document:{icon:xe,color:"text-green-500",badgeCls:"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-300"},dictionary:{icon:J,color:"text-amber-500",badgeCls:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300"}};function L(t){return E[t]??E.collection}function se(t){return"border-border bg-linear-to-b from-secondary/30 to-card hover:from-primary/8 hover:border-primary/20 hover:shadow-md"}const M=g(()=>{var t;return((t=i.status)==null?void 0:t.models)??[]}),A=H(!1),z=H([]);re(()=>i.error,t=>{t&&W.error(t)});async function I(){A.value=!0;try{await D.fetchHistory(15),z.value=D.history}catch(t){W.error(t instanceof Error?t.message:"Failed to load recent operations")}finally{A.value=!1}}ae(()=>{I()}),ce(t=>{["branch:created","branch:merged","context:changed"].includes(t.type)&&I()});const V={model_create:{icon:F,color:"text-blue-500",bg:"bg-blue-500/10",label:r["dashboard.model-created"]},model_update:{icon:q,color:"text-blue-400",bg:"bg-blue-400/10",label:r["dashboard.model-updated"]},content_save:{icon:Q,color:"text-emerald-500",bg:"bg-emerald-500/10",label:r["dashboard.content-saved"]},delete:{icon:_e,color:"text-red-500",bg:"bg-red-500/10",label:r["dashboard.deleted"]},merge:{icon:ye,color:"text-violet-500",bg:"bg-violet-500/10",label:r["dashboard.merged"]},context_update:{icon:U,color:"text-gray-400",bg:"bg-gray-400/10",label:r["dashboard.context-updated"]},operation:{icon:X,color:"text-primary",bg:"bg-primary/10",label:r["dashboard.operation"]},other:{icon:X,color:"text-muted-foreground",bg:"bg-muted",label:"Other"}};function C(t){return V[t]??V.other}const N=g(()=>{var t,a;return((a=(t=i.status)==null?void 0:t.config)==null?void 0:a.stack)??null}),R=g(()=>{const t=i.status;if(!t)return[];const a=[];return t.models.length===0?a.push({prompt:r["dashboard.create-a-blog-model"],label:r["dashboard.get-started"]}):G.value<3&&a.push({prompt:r["dashboard.generate-sample-content-for"],label:r["dashboard.populate"]}),t.validation&&t.validation.errors>0&&a.push({prompt:r["dashboard.fix-validation-errors-in"],label:r["dashboard.fix-issues"]}),a.push({prompt:r["dashboard.normalize-my-project-extract"]},{prompt:r["dashboard.review-pending-content-changes"]}),a.slice(0,5)});return(t,a)=>{var p;return n(),d("div",null,[c(ue,{title:e(r)["dashboard.dashboard"],description:e(r)["dashboard.your-project-at-a"]},null,8,["title","description"]),o("div",we,[e(i).loading&&!e(i).status?(n(),d("div",ze,[c(e(P),{class:"size-6 animate-spin text-primary"})])):e(i).error?(n(),d("div",Ce,[c(e(T),{class:"mx-auto mb-3 size-8 text-destructive/60"}),o("p",je,l(e(i).error),1)])):e(i).status&&!e(i).status.initialized?(n(),d("div",$e,[a[4]||(a[4]=o("img",{src:O,alt:"",class:"empty-illustration mb-6"},null,-1)),o("h2",Be,l(e(r)["dashboard.not-a-contentrain-project"]),1),o("p",Le,[a[3]||(a[3]=m(" Run ",-1)),o("code",Me,l(e(r)["dashboard.contentrain-init"]),1),m(" "+l(e(r)["dashboard.to-initialize"]),1)])])):e(i).status?(n(),d(h,{key:3},[o("div",Ae,[N.value?(n(),b(e(j),{key:0,variant:"secondary",class:"gap-1.5"},{default:y(()=>[c(e(q),{class:"size-3"}),m(" "+l(N.value),1)]),_:1})):u("",!0),B.value?(n(),b(e(j),{key:1,variant:B.value==="review"?"outline":"secondary",class:"gap-1.5"},{default:y(()=>[c(e(K),{class:"size-3"}),m(" "+l(B.value==="review"?"Review workflow":"Auto-merge"),1)]),_:1},8,["variant"])):u("",!0),(p=e(i).status.config)!=null&&p.locales?(n(),b(e(j),{key:2,variant:"secondary",class:"gap-1.5"},{default:y(()=>[c(e(Y),{class:"size-3"}),m(" "+l(e(i).status.config.locales.default)+" ",1),e(i).status.config.locales.supported.length>1?(n(),d("span",Se," +"+l(e(i).status.config.locales.supported.length-1),1)):u("",!0)]),_:1})):u("",!0),e(i).status.vocabulary_size>0?(n(),b(e(j),{key:3,variant:"secondary",class:"gap-1.5"},{default:y(()=>[c(e(J),{class:"size-3"}),m(" "+l(e(i).status.vocabulary_size)+" "+l(e(r)["dashboard.terms"]),1)]),_:1})):u("",!0),c(e(ge),{status:ee.value,count:te.value},null,8,["status","count"])]),o("div",Fe,[(n(!0),d(h,null,k(Z.value,s=>(n(),d("button",{key:s.label,class:f(e(x)("group flex flex-col gap-2 rounded-xl border p-4 text-left transition-all duration-200",s.warn?"border-status-warning/30 bg-linear-to-b from-status-warning/8 to-card":"border-border bg-card hover:border-primary/20 hover:shadow-sm",s.to?"cursor-pointer":"cursor-default")),onClick:_=>s.to&&e(v).push(s.to)},[o("div",De,[o("div",{class:f(e(x)("flex size-8 items-center justify-center rounded-lg",s.warn?"bg-status-warning/10":s.bg))},[(n(),b(S(s.icon),{class:f(e(x)("size-4",s.warn?"text-status-warning":s.color))},null,8,["class"]))],2),s.to?(n(),b(e(w),{key:0,class:"size-3.5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"})):u("",!0)]),o("div",null,[o("span",Ge,l(s.value),1),o("p",Ee,l(s.label),1),"subtitle"in s&&s.subtitle?(n(),d("p",Ie,l(s.subtitle),1)):u("",!0)])],10,Te))),128))]),o("section",null,[o("div",Ve,[o("h2",Ne,l(e(r)["dashboard.content-models"]),1),M.value.length>0?(n(),d("button",{key:0,class:"flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-primary",onClick:a[0]||(a[0]=s=>e(v).push("/models"))},[m(l(e(r)["dashboard.view-all"])+" ",1),c(e(w),{class:"size-3"})])):u("",!0)]),M.value.length>0?(n(),d("div",Re,[(n(!0),d(h,null,k(M.value,s=>(n(),d("button",{key:s.id,class:f(e(x)("group flex flex-col gap-3 rounded-xl border p-4 text-left transition-all duration-200",se())),onClick:_=>e(v).push(`/content/${s.id}`)},[o("div",Pe,[o("div",He,[(n(),b(S(L(s.kind).icon),{class:f(e(x)("size-4 shrink-0",L(s.kind).color))},null,8,["class"])),o("span",We,l(s.id),1)]),o("span",{class:f(e(x)("shrink-0 rounded-full border px-2 py-0.5 text-[10px] font-medium",L(s.kind).badgeCls))},l(s.kind),3)]),o("div",qe,[o("span",Ke,[c(e(F),{class:"size-3 opacity-50"}),m(" "+l(s.fields)+" "+l(e(r)["dashboard.fields"]),1)]),o("span",Je,l(s.domain),1),s.i18n?(n(),d("span",Qe,[c(e(Y),{class:"size-3 opacity-50"}),m(" "+l(e(r)["dashboard.i18n"]),1)])):u("",!0)]),o("div",Ue,[c(e(w),{class:"size-3.5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"})])],10,Oe))),128))])):(n(),d("div",Xe,[a[5]||(a[5]=o("img",{src:O,alt:"",class:"empty-illustration mb-5"},null,-1)),o("h3",Ye,l(e(r)["dashboard.no-content-models-yet"]),1),o("p",Ze,l(e(r)["dashboard.create-models-using-ai"]),1)]))]),o("section",null,[o("div",et,[o("div",tt,[c(e(U),{class:"size-4 text-muted-foreground"}),o("h2",st,l(e(r)["dashboard.recent-operations"]),1)]),o("button",{class:"flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-primary",onClick:a[1]||(a[1]=s=>e(v).push("/branches"))},[m(l(e(r)["dashboard.view-all"])+" ",1),c(e(w),{class:"size-3"})])]),A.value&&z.value.length===0?(n(),d("div",ot,[c(e(P),{class:"size-5 animate-spin text-primary"})])):z.value.length===0?(n(),d("div",rt,[c(e(fe),{class:"size-6 text-muted-foreground/50 mb-2"}),o("p",at,l(e(r)["dashboard.no-operations-yet-start"]),1)])):(n(),d("div",nt,[a[6]||(a[6]=o("div",{class:"absolute left-4.75 top-2 bottom-2 w-px bg-border"},null,-1)),(n(!0),d(h,null,k(z.value.slice(0,10),s=>(n(),d("div",{key:s.hash,class:"relative flex items-start gap-3 py-2.5 pl-0"},[o("div",{class:f(e(x)("relative z-10 flex size-10 shrink-0 items-center justify-center rounded-lg",C(s.type).bg))},[(n(),b(S(C(s.type).icon),{class:f(e(x)("size-4",C(s.type).color))},null,8,["class"]))],2),o("div",lt,[o("div",it,[o("span",dt,l(C(s.type).label),1),s.target?(n(),d("span",ct,l(s.target),1)):u("",!0)]),o("div",ut,[o("span",mt,l(s.relativeDate),1),o("span",bt,l(s.hash),1)])])]))),128))]))]),e(i).status.validation&&e(i).status.validation.summary.length>0?(n(),d("section",pt,[o("div",gt,[o("div",ft,[c(e(T),{class:"size-4 text-status-warning"}),o("h2",xt,l(e(r)["dashboard.validation-summary"]),1)]),o("button",{class:"flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-primary",onClick:a[2]||(a[2]=s=>e(v).push("/validate"))},[m(l(e(r)["dashboard.full-report"])+" ",1),c(e(w),{class:"size-3"})])]),o("div",ht,[o("ul",vt,[(n(!0),d(h,null,k(e(i).status.validation.summary.slice(0,5),(s,_)=>(n(),d("li",{key:_,class:"flex items-start gap-2 text-xs text-muted-foreground"},[a[7]||(a[7]=o("span",{class:"mt-1.5 size-1 shrink-0 rounded-full bg-status-warning"},null,-1)),m(" "+l(s),1)]))),128))])])])):u("",!0),R.value.length>0?(n(),b(be,{key:1,title:e(r)["dashboard.try-with-your-ai"]},{default:y(()=>[(n(!0),d(h,null,k(R.value,(s,_)=>(n(),b(pe,{key:_,prompt:s.prompt,label:s.label},null,8,["prompt","label"]))),128))]),_:1},8,["title"])):u("",!0),c(me,{message:e(r)["dashboard.manage-content-with-ai"]},null,8,["message"])],64)):u("",!0)])])}}});export{Ht as default};
@@ -0,0 +1 @@
1
+ import{b as x,c as L,a as V,u as re}from"./useId-C0uR6mdj.js";import{h as Y,r as w,w as X,K as G,l as le,a as h,t as ue,f as g,u as r,o as m,b as y,e as v,m as C,k as U,a1 as ie,i as de,j as q,g as J,I as Q,J as Z,z as M,X as ce,q as fe,p as pe,y as ve}from"./index-CoUshYEB.js";import{t as me,h as ye,i as ee,j as W,k as ge,e as _e,f as he,c as be,u as B,l as Ee,P as te}from"./Presence-cbB6AqkQ.js";import{P as T,r as K}from"./useWatch-COpVIQvm.js";import{g as D}from"./getActiveElement-FUKBWQwh.js";import{g as Oe,D as Ce,T as De}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CgoQGS6k.js";import{i as we}from"./ConfigProvider-BGjDLViI.js";const Be=ye(()=>{const e=w(new Map),o=w(),t=Y(()=>{for(const p of e.value.values())if(p)return!0;return!1}),s=we({scrollBody:w(!0)});let a=null;const f=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=o.value??"",W&&(a==null||a()),o.value=void 0};return X(t,(p,i)=>{var n;if(!ee)return;if(!p){i&&f();return}o.value===void 0&&(o.value=document.body.style.overflow);const u=window.innerWidth-document.documentElement.clientWidth,d={padding:u,margin:0},l=(n=s.scrollBody)!=null&&n.value?typeof s.scrollBody.value=="object"?Oe({padding:s.scrollBody.value.padding===!0?u:s.scrollBody.value.padding,margin:s.scrollBody.value.margin===!0?u:s.scrollBody.value.margin},d):d:{padding:0,margin:0};u>0&&(document.body.style.paddingRight=typeof l.padding=="number"?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin=="number"?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty("--scrollbar-width",`${u}px`),document.body.style.overflow="hidden"),W&&(a=ge(document,"touchmove",c=>Ae(c),{passive:!1})),G(()=>{t.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),e});function Fe(e){const o=Math.random().toString(36).substring(2,7),t=Be();t.value.set(o,e??!1);const s=Y({get:()=>t.value.get(o)??!1,set:a=>t.value.set(o,a)});return me(()=>{t.value.delete(o)}),s}function oe(e){const o=window.getComputedStyle(e);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&e.clientWidth<e.scrollWidth||o.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const t=e.parentNode;return!(t instanceof Element)||t.tagName==="BODY"?!1:oe(t)}}function Ae(e){const o=e||window.event,t=o.target;return t instanceof Element&&oe(t)?!1:o.touches.length>1?!0:(o.preventDefault&&o.cancelable&&o.preventDefault(),!1)}var Pe=function(e){if(typeof document>"u")return null;var o=Array.isArray(e)?e[0]:e;return o.ownerDocument.body},S=new WeakMap,k=new WeakMap,I={},$=0,se=function(e){return e&&(e.host||se(e.parentNode))},Se=function(e,o){return o.map(function(t){if(e.contains(t))return t;var s=se(t);return s&&e.contains(s)?s:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},qe=function(e,o,t,s){var a=Se(o,Array.isArray(e)?e:[e]);I[t]||(I[t]=new WeakMap);var f=I[t],p=[],i=new Set,u=new Set(a),d=function(n){!n||i.has(n)||(i.add(n),d(n.parentNode))};a.forEach(d);var l=function(n){!n||u.has(n)||Array.prototype.forEach.call(n.children,function(c){if(i.has(c))l(c);else try{var _=c.getAttribute(s),b=_!==null&&_!=="false",E=(S.get(c)||0)+1,O=(f.get(c)||0)+1;S.set(c,E),f.set(c,O),p.push(c),E===1&&b&&k.set(c,!0),O===1&&c.setAttribute(t,"true"),b||c.setAttribute(s,"true")}catch(F){console.error("aria-hidden: cannot operate on ",c,F)}})};return l(o),i.clear(),$++,function(){p.forEach(function(n){var c=S.get(n)-1,_=f.get(n)-1;S.set(n,c),f.set(n,_),c||(k.has(n)||n.removeAttribute(s),k.delete(n)),_||n.removeAttribute(t)}),$--,$||(S=new WeakMap,S=new WeakMap,k=new WeakMap,I={})}},ke=function(e,o,t){t===void 0&&(t="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=Pe(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live], script"))),qe(s,a,t,"aria-hidden")):function(){return null}};function Ie(e){let o;X(()=>_e(e),t=>{let s=!1;try{s=!!(t!=null&&t.closest("[popover]:not(:popover-open)"))}catch{}t&&!s?o=ke(t):o&&o()}),le(()=>{o&&o()})}const[P,Me]=be("DialogRoot");var Te=h({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:o}){const t=e,a=he(t,"open",o,{defaultValue:t.defaultOpen,passive:t.open===void 0}),f=w(),p=w(),{modal:i}=ue(t);return Me({open:a,modal:i,openModal:()=>{a.value=!0},onOpenChange:u=>{a.value=u},onOpenToggle:()=>{a.value=!a.value},contentId:"",titleId:"",descriptionId:"",triggerElement:f,contentElement:p}),(u,d)=>g(u.$slots,"default",{open:r(a),close:()=>a.value=!1})}}),$e=Te,Re=h({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const o=e;B();const t=P();return(s,a)=>(m(),y(r(T),C(o,{type:s.as==="button"?"button":void 0,onClick:a[0]||(a[0]=f=>r(t).onOpenChange(!1))}),{default:v(()=>[g(s.$slots,"default")]),_:3},16,["type"]))}}),Ne=Re;const Le=Ee(()=>w([]));function Ke(){const e=Le();return{add(o){const t=e.value[0];o!==t&&(t==null||t.pause()),e.value=j(e.value,o),e.value.unshift(o)},remove(o){var t;e.value=j(e.value,o),(t=e.value[0])==null||t.resume()}}}function j(e,o){const t=[...e],s=t.indexOf(o);return s!==-1&&t.splice(s,1),t}const R="focusScope.autoFocusOnMount",N="focusScope.autoFocusOnUnmount",z={bubbles:!1,cancelable:!0};function xe(e,{select:o=!1}={}){const t=D();for(const s of e)if(A(s,{select:o}),D()!==t)return!0}function Ue(e){const o=ae(e),t=H(o,e),s=H(o.reverse(),e);return[t,s]}function ae(e){const o=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)o.push(t.currentNode);return o}function H(e,o){for(const t of e)if(!We(t,{upTo:o}))return t}function We(e,{upTo:o}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(o!==void 0&&e===o)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function je(e){return e instanceof HTMLInputElement&&"select"in e}function A(e,{select:o=!1}={}){if(e&&e.focus){const t=D();e.focus({preventScroll:!0}),e!==t&&je(e)&&o&&e.select()}}var ze=h({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:o}){const t=e,s=o,{currentRef:a,currentElement:f}=B(),p=w(null),i=Ke(),u=ie({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});U(l=>{if(!ee)return;const n=f.value;if(!t.trapped)return;function c(O){if(u.paused||!n)return;const F=O.target;n.contains(F)?p.value=F:A(p.value,{select:!0})}function _(O){if(u.paused||!n)return;const F=O.relatedTarget;F!==null&&(n.contains(F)||A(p.value,{select:!0}))}function b(O){n.contains(p.value)||A(n)}document.addEventListener("focusin",c),document.addEventListener("focusout",_);const E=new MutationObserver(b);n&&E.observe(n,{childList:!0,subtree:!0}),l(()=>{document.removeEventListener("focusin",c),document.removeEventListener("focusout",_),E.disconnect()})}),U(async l=>{const n=f.value;if(await G(),!n)return;i.add(u);const c=D();if(!n.contains(c)){const b=new CustomEvent(R,z);n.addEventListener(R,E=>s("mountAutoFocus",E)),n.dispatchEvent(b),b.defaultPrevented||(xe(ae(n),{select:!0}),D()===c&&A(n))}l(()=>{n.removeEventListener(R,O=>s("mountAutoFocus",O));const b=new CustomEvent(N,z),E=O=>{s("unmountAutoFocus",O)};n.addEventListener(N,E),n.dispatchEvent(b),setTimeout(()=>{b.defaultPrevented||A(c??document.body,{select:!0}),n.removeEventListener(N,E),i.remove(u)},0)})});function d(l){if(!t.loop&&!t.trapped||u.paused)return;const n=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,c=D();if(n&&c){const _=l.currentTarget,[b,E]=Ue(_);b&&E?!l.shiftKey&&c===E?(l.preventDefault(),t.loop&&A(b,{select:!0})):l.shiftKey&&c===b&&(l.preventDefault(),t.loop&&A(E,{select:!0})):c===_&&l.preventDefault()}}return(l,n)=>(m(),y(r(T),{ref_key:"currentRef",ref:a,tabindex:"-1","as-child":l.asChild,as:l.as,onKeydown:d},{default:v(()=>[g(l.$slots,"default")]),_:3},8,["as-child","as"]))}}),He=ze;function Ve(e){return e?"open":"closed"}function gt(e){const o=D();for(const t of e)if(t===o||(t.focus(),D()!==o))return}var Ye=h({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:o}){const t=e,s=o,a=P(),{forwardRef:f,currentElement:p}=B();return a.titleId||(a.titleId=x(void 0,"reka-dialog-title")),a.descriptionId||(a.descriptionId=x(void 0,"reka-dialog-description")),de(()=>{a.contentElement=p,D()!==document.body&&(a.triggerElement.value=D())}),(i,u)=>(m(),y(r(He),{"as-child":"",loop:"",trapped:t.trapFocus,onMountAutoFocus:u[5]||(u[5]=d=>s("openAutoFocus",d)),onUnmountAutoFocus:u[6]||(u[6]=d=>s("closeAutoFocus",d))},{default:v(()=>[q(r(Ce),C({id:r(a).contentId,ref:r(f),as:i.as,"as-child":i.asChild,"disable-outside-pointer-events":i.disableOutsidePointerEvents,role:"dialog","aria-describedby":r(a).descriptionId,"aria-labelledby":r(a).titleId,"data-state":r(Ve)(r(a).open.value)},i.$attrs,{onDismiss:u[0]||(u[0]=d=>r(a).onOpenChange(!1)),onEscapeKeyDown:u[1]||(u[1]=d=>s("escapeKeyDown",d)),onFocusOutside:u[2]||(u[2]=d=>s("focusOutside",d)),onInteractOutside:u[3]||(u[3]=d=>s("interactOutside",d)),onPointerDownOutside:u[4]||(u[4]=d=>s("pointerDownOutside",d))}),{default:v(()=>[g(i.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),ne=Ye,Xe=h({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:o}){const t=e,s=o,a=P(),f=L(s),{forwardRef:p,currentElement:i}=B();return Ie(i),(u,d)=>(m(),y(ne,C({...t,...r(f)},{ref:r(p),"trap-focus":r(a).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:d[0]||(d[0]=l=>{var n;l.defaultPrevented||(l.preventDefault(),(n=r(a).triggerElement.value)==null||n.focus())}),onPointerDownOutside:d[1]||(d[1]=l=>{const n=l.detail.originalEvent,c=n.button===0&&n.ctrlKey===!0;(n.button===2||c)&&l.preventDefault()}),onFocusOutside:d[2]||(d[2]=l=>{l.preventDefault()})}),{default:v(()=>[g(u.$slots,"default")]),_:3},16,["trap-focus"]))}}),Ge=Xe,Je=h({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:o}){const t=e,a=L(o);B();const f=P(),p=w(!1),i=w(!1);return(u,d)=>(m(),y(ne,C({...t,...r(a)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=l=>{var n;l.defaultPrevented||(p.value||(n=r(f).triggerElement.value)==null||n.focus(),l.preventDefault()),p.value=!1,i.value=!1}),onInteractOutside:d[1]||(d[1]=l=>{var _;l.defaultPrevented||(p.value=!0,l.detail.originalEvent.type==="pointerdown"&&(i.value=!0));const n=l.target;((_=r(f).triggerElement.value)==null?void 0:_.contains(n))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.value&&l.preventDefault()})}),{default:v(()=>[g(u.$slots,"default")]),_:3},16))}}),Qe=Je,Ze=h({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:o}){const t=e,s=o,a=P(),f=L(s),{forwardRef:p}=B();return(i,u)=>(m(),y(r(te),{present:i.forceMount||r(a).open.value},{default:v(()=>[r(a).modal.value?(m(),y(Ge,C({key:0,ref:r(p)},{...t,...r(f),...i.$attrs}),{default:v(()=>[g(i.$slots,"default")]),_:3},16)):(m(),y(Qe,C({key:1,ref:r(p)},{...t,...r(f),...i.$attrs}),{default:v(()=>[g(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),et=Ze,tt=h({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const o=P();return Fe(!0),B(),(t,s)=>(m(),y(r(T),{as:t.as,"as-child":t.asChild,"data-state":r(o).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:v(()=>[g(t.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),ot=tt,st=h({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const o=P(),{forwardRef:t}=B();return(s,a)=>{var f;return(f=r(o))!=null&&f.modal.value?(m(),y(r(te),{key:0,present:s.forceMount||r(o).open.value},{default:v(()=>[q(ot,C(s.$attrs,{ref:r(t),as:s.as,"as-child":s.asChild}),{default:v(()=>[g(s.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):J("v-if",!0)}}}),at=st,nt=h({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const o=e;return(t,s)=>(m(),y(r(De),Q(Z(o)),{default:v(()=>[g(t.$slots,"default")]),_:3},16))}}),rt=nt,lt=h({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(e){const o=e,t=P();return B(),(s,a)=>(m(),y(r(T),C(o,{id:r(t).titleId}),{default:v(()=>[g(s.$slots,"default")]),_:3},16,["id"]))}}),ut=lt;const _t=h({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:o}){const a=V(e,o);return(f,p)=>(m(),y(r($e),C({"data-slot":"dialog"},r(a)),{default:v(i=>[g(f.$slots,"default",Q(Z(i)))]),_:3},16))}}),it=h({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const o=e,t=K(o,"class");return(s,a)=>(m(),y(r(at),C({"data-slot":"dialog-overlay"},r(t),{class:r(M)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",o.class)}),{default:v(()=>[g(s.$slots,"default")]),_:3},16,["class"]))}}),ht=h({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!0}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:o}){const t=e,s=o,a=K(t,"class"),f=V(a,s);return(p,i)=>(m(),y(r(rt),null,{default:v(()=>[q(it),q(r(et),C({"data-slot":"dialog-content"},{...p.$attrs,...r(f)},{class:r(M)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t.class)}),{default:v(()=>[g(p.$slots,"default"),e.showCloseButton?(m(),y(r(Ne),{key:0,"data-slot":"dialog-close",class:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"},{default:v(()=>[q(r(ce)),i[0]||(i[0]=fe("span",{class:"sr-only"},"Close",-1))]),_:1})):J("",!0)]),_:3},16,["class"])]),_:3}))}}),bt=h({__name:"DialogHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const o=e;return(t,s)=>(m(),pe("div",{"data-slot":"dialog-header",class:ve(r(M)("flex flex-col gap-2 text-center sm:text-left",o.class))},[g(t.$slots,"default")],2))}}),Et=h({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const o=e,t=K(o,"class"),s=re(t);return(a,f)=>(m(),y(r(ut),C({"data-slot":"dialog-title"},r(s),{class:r(M)("text-lg leading-none font-semibold",o.class)}),{default:v(()=>[g(a.$slots,"default")]),_:3},16,["class"]))}});export{Ne as D,He as F,_t as _,Ie as a,ht as b,bt as c,Et as d,gt as f,P as i,Fe as u};
@@ -0,0 +1,6 @@
1
+ import{c as Q,w as D,h as O,S as F,r as H,U as A,G as N,k as q,V as G,i as X,u as J,K as $,a as Y,N as Z,O as ee,p as te,y as ne,z as ae,W as oe,o as se}from"./index-CoUshYEB.js";import{i as ie,t as re,a as K,b as le,w as ue,c as ce,e as de,f as fe,g as me,h as L,p as B}from"./useWatch-COpVIQvm.js";/**
2
+ * @license lucide-vue-next v0.474.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 Te=Q("SearchIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),z=le?window:void 0;function P(e){var a;const n=N(e);return(a=n==null?void 0:n.$el)!=null?a:n}function R(...e){const a=[],n=()=>{a.forEach(o=>o()),a.length=0},g=(o,l,i,f)=>(o.addEventListener(l,i,f),()=>o.removeEventListener(l,i,f)),s=O(()=>{const o=L(N(e[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),b=de(()=>{var o,l;return[(l=(o=s.value)==null?void 0:o.map(i=>P(i)))!=null?l:[z].filter(i=>i!=null),L(N(s.value?e[1]:e[0])),L(J(s.value?e[2]:e[1])),N(s.value?e[3]:e[2])]},([o,l,i,f])=>{if(n(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(i!=null&&i.length))return;const y=me(f)?{...f}:f;a.push(...o.flatMap(C=>l.flatMap(r=>i.map(c=>g(C,r,c,y)))))},{flush:"post"}),h=()=>{b(),n()};return fe(n),h}function pe(){const e=A(!1),a=F();return a&&X(()=>{e.value=!0},a),e}function ve(e){const a=pe();return O(()=>(a.value,!!e()))}const he=Symbol("vueuse-ssr-width");function ge(){const e=G()?ce(he,null):null;return typeof e=="number"?e:void 0}function ye(e,a={}){const{window:n=z,ssrWidth:g=ge()}=a,s=ve(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),b=A(typeof g=="number"),h=A(),o=A(!1),l=i=>{o.value=i.matches};return q(()=>{if(b.value){b.value=!s.value;const i=N(e).split(",");o.value=i.some(f=>{const y=f.includes("not all"),C=f.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),r=f.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let c=!!(C||r);return C&&c&&(c=g>=B(C[1])),r&&c&&(c=g<=B(r[1])),y?!c:c});return}s.value&&(h.value=n.matchMedia(N(e)),o.value=h.value.matches)}),R(h,"change",l,{passive:!0}),O(()=>o.value)}function be(e){return JSON.parse(JSON.stringify(e))}const W=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j="__vueuse_ssr_handlers__",Se=we();function we(){return j in W||(W[j]=W[j]||{}),W[j]}function U(e,a){return Se[e]||a}function xe(e){return ye("(prefers-color-scheme: dark)",e)}function Ce(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Me={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},I="vueuse-storage";function Ve(e,a,n,g={}){var s;const{flush:b="pre",deep:h=!0,listenToStorageChanges:o=!0,writeDefaults:l=!0,mergeDefaults:i=!1,shallow:f,window:y=z,eventFilter:C,onError:r=t=>{console.error(t)},initOnMounted:c}=g,m=(f?A:H)(typeof a=="function"?a():a),S=O(()=>N(e));if(!n)try{n=U("getDefaultStorage",()=>{var t;return(t=z)==null?void 0:t.localStorage})()}catch(t){r(t)}if(!n)return m;const w=N(a),E=Ce(w),d=(s=g.serializer)!=null?s:Me[E],{pause:p,resume:x}=ue(m,()=>T(m.value),{flush:b,deep:h,eventFilter:C});D(S,()=>V(),{flush:b}),y&&o&&K(()=>{n instanceof Storage?R(y,"storage",V,{passive:!0}):R(y,I,k),c&&V()}),c||V();function M(t,u){if(y){const v={key:S.value,oldValue:t,newValue:u,storageArea:n};y.dispatchEvent(n instanceof Storage?new StorageEvent("storage",v):new CustomEvent(I,{detail:v}))}}function T(t){try{const u=n.getItem(S.value);if(t==null)M(u,null),n.removeItem(S.value);else{const v=d.write(t);u!==v&&(n.setItem(S.value,v),M(u,v))}}catch(u){r(u)}}function _(t){const u=t?t.newValue:n.getItem(S.value);if(u==null)return l&&w!=null&&n.setItem(S.value,d.write(w)),w;if(!t&&i){const v=d.read(u);return typeof i=="function"?i(v,w):E==="object"&&!Array.isArray(v)?{...w,...v}:v}else return typeof u!="string"?u:d.read(u)}function V(t){if(!(t&&t.storageArea!==n)){if(t&&t.key==null){m.value=w;return}if(!(t&&t.key!==S.value)){p();try{(t==null?void 0:t.newValue)!==d.write(m.value)&&(m.value=_(t))}catch(u){r(u)}finally{t?$(x):x()}}}}function k(t){V(t.detail)}return m}const Ee="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function _e(e={}){const{selector:a="html",attribute:n="class",initialValue:g="auto",window:s=z,storage:b,storageKey:h="vueuse-color-scheme",listenToStorageChanges:o=!0,storageRef:l,emitAuto:i,disableTransition:f=!0}=e,y={auto:"",light:"light",dark:"dark",...e.modes||{}},C=xe({window:s}),r=O(()=>C.value?"dark":"light"),c=l||(h==null?re(g):Ve(h,g,b,{window:s,listenToStorageChanges:o})),m=O(()=>c.value==="auto"?r.value:c.value),S=U("updateHTMLAttrs",(p,x,M)=>{const T=typeof p=="string"?s==null?void 0:s.document.querySelector(p):P(p);if(!T)return;const _=new Set,V=new Set;let k=null;if(x==="class"){const u=M.split(/\s/g);Object.values(y).flatMap(v=>(v||"").split(/\s/g)).filter(Boolean).forEach(v=>{u.includes(v)?_.add(v):V.add(v)})}else k={key:x,value:M};if(_.size===0&&V.size===0&&k===null)return;let t;f&&(t=s.document.createElement("style"),t.appendChild(document.createTextNode(Ee)),s.document.head.appendChild(t));for(const u of _)T.classList.add(u);for(const u of V)T.classList.remove(u);k&&T.setAttribute(k.key,k.value),f&&(s.getComputedStyle(t).opacity,document.head.removeChild(t))});function w(p){var x;S(a,n,(x=y[p])!=null?x:p)}function E(p){e.onChanged?e.onChanged(p,w):w(p)}D(m,E,{flush:"post",immediate:!0}),K(()=>E(m.value));const d=O({get(){return i?c.value:m.value},set(p){c.value=p}});return Object.assign(d,{store:c,system:r,state:m})}function Oe(e,a,n,g={}){var s,b,h;const{clone:o=!1,passive:l=!1,eventName:i,deep:f=!1,defaultValue:y,shouldEmit:C}=g,r=F(),c=n||(r==null?void 0:r.emit)||((s=r==null?void 0:r.$emit)==null?void 0:s.bind(r))||((h=(b=r==null?void 0:r.proxy)==null?void 0:b.$emit)==null?void 0:h.bind(r==null?void 0:r.proxy));let m=i;m=m||`update:${a.toString()}`;const S=d=>o?typeof o=="function"?o(d):be(d):d,w=()=>ie(e[a])?S(e[a]):y,E=d=>{C?C(d)&&c(m,d):c(m,d)};if(l){const d=w(),p=H(d);let x=!1;return D(()=>e[a],M=>{x||(x=!0,p.value=S(M),$(()=>x=!1))}),D(p,M=>{!x&&(M!==e[a]||f)&&E(M)},{deep:f}),p}else return O({get(){return w()},set(d){E(d)}})}const Ae=Y({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:a}){const n=e,s=Oe(n,"modelValue",a,{passive:!0,defaultValue:n.defaultValue});return(b,h)=>Z((se(),te("input",{"onUpdate:modelValue":h[0]||(h[0]=o=>oe(s)?s.value=o:null),"data-slot":"input",class:ne(J(ae)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n.class))},null,2)),[[ee,J(s)]])}});export{Te as S,Ae as _,_e as u};