@opengis/widgets 0.0.55 → 0.0.57

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.
@@ -1,4 +1,4 @@
1
- (function(ge,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(ge=typeof globalThis<"u"?globalThis:ge||self,e(ge.WidgetLib={},ge.Vue,ge.OpenGISCore))})(this,(function(ge,e,xe){"use strict";function Cr(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Sr=Cr(e);const zo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_r=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Br=t=>{const n=_r(t);return n.charAt(0).toUpperCase()+n.slice(1)},$r=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var on={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Tr=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>e.h("svg",{...on,width:t||on.width,height:t||on.height,stroke:s||on.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:$r("lucide",...l?[`lucide-${zo(Br(l))}-icon`,`lucide-${zo(l)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const ce=(t,n)=>(o,{slots:s})=>e.h(Tr,{...o,iconNode:n,name:t},s);const Lr=ce("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const Ar=ce("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Ir=ce("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const jo=ce("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);const Dr=ce("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const Nt=ce("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Or=ce("file",[["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"}]]);const Mr=ce("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Rr=ce("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);const Fr=ce("history",[["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"}]]);const Pr=ce("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const Ho=ce("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const zr=ce("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);const jr=ce("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const Uo=ce("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Hr=ce("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);const qo=ce("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Ur=ce("sheet",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]);const qr=ce("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);const Rn=ce("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Wr=ce("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const Fn=ce("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const Kr=ce("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);const Pn=ce("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Gr={class:"border-t pt-3 mt-4"},Zr={class:"flex gap-2"},Jr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Yr={class:"flex-1 space-y-2"},Xr={class:"flex justify-between items-center"},Qr={class:"flex gap-2"},Vr=["disabled"],Wo=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(t,{emit:n}){const o=e.useModel(t,"isReply"),s=e.ref(""),r=n,l=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},i=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),l())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Gr,[e.createElementVNode("div",Zr,[e.createElementVNode("span",Jr,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Yr,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),onKeydown:i,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[e.vModelText,s.value]]),e.createElementVNode("div",Xr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",Qr,[o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:c[1]||(c[1]=d=>o.value=!1)},[e.createVNode(e.unref(Pn),{class:"h-3 w-3"}),c[2]||(c[2]=e.createTextVNode(" Cancel ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!s.value.trim(),onClick:l},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Vr)])])])])]))}}),ei={class:"z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto"},ti=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(t,{emit:n}){const o=n,s=e.useModel(t,"showMoreOptions"),r=e.ref(),l=e.ref(!0),i=async d=>{s.value&&r.value&&!r.value.contains(d.target)&&!l.value&&(s.value=!1),l.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",i)}),e.onUnmounted(()=>{document.removeEventListener("click",i)}),(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:r},[e.createElementVNode("div",ei,[e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",onClick:a},[e.createVNode(e.unref(qr),{class:"h-3 w-3 mr-2"}),m[0]||(m[0]=e.createTextVNode(" Edit ",-1))]),e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",onClick:c},[e.createVNode(e.unref(Rn),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),ni={class:"space-y-2"},oi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},si={class:"flex-1 min-w-0 space-y-1 relative"},ri={class:"flex items-center gap-2"},ii={class:"font-medium text-xs"},li={class:"text-xs text-gray-500"},ai={key:0,class:"text-xs text-gray-700 leading-relaxed"},ci={class:"flex justify-between text-xs"},di={class:"flex items-center gap-2"},fi={key:0,class:"flex gap-2"},pi=["disabled"],ui={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},mi=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(t,{emit:n}){const o=n,s=t,r=e.ref(s.comment.text),l=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),i=e.ref("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"),a=e.ref(!1),c=e.ref(!1),d=e.ref(!1),m=e.ref(!1),f=x=>{const E=new Date,j=Math.floor((E.getTime()-x.getTime())/(1e3*60*60));return j<1?`${Math.floor((E.getTime()-x.getTime())/6e4)}m`:j<24?`${j}h`:`${Math.floor(j/24)}d`},g=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},b=()=>{o("edit",s.comment.id,r.value),d.value=!1},k=(x,E)=>{o("like",x,E)},v=(x,E)=>{o("edit",x,E)};return(x,E)=>{const j=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",ni,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",d.value?"bg-gray-50":""])},[e.createElementVNode("span",oi,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",si,[e.createElementVNode("div",ri,[e.createElementVNode("span",ii,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",li,e.toDisplayString(f(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":E[0]||(E[0]=S=>r.value=S),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",ai,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",m.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:E[1]||(E[1]=S=>g())},[e.createVNode(e.unref(Rr),{class:e.normalizeClass(["h-3 w-3",m.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.comment?.likes),1)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:E[2]||(E[2]=S=>c.value=!0)},[e.createVNode(e.unref(Hr),{class:"h-3 w-3"})])),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:E[3]||(E[3]=S=>a.value=!0)},[e.createVNode(e.unref(Dr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",fi,[e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:E[4]||(E[4]=S=>d.value=!1)},[e.createVNode(e.unref(Pn),{class:"h-3 w-3"}),E[11]||(E[11]=e.createTextVNode(" Cancel ",-1))]),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!r.value.trim(),onClick:E[5]||(E[5]=S=>b())},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),E[12]||(E[12]=e.createTextVNode(" Send ",-1))],8,pi)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(ti,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":E[6]||(E[6]=S=>a.value=S),onEdit:E[7]||(E[7]=S=>d.value=!0),onDelete:E[8]||(E[8]=S=>x.$emit("delete",t.comment?.id)),comment:t.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,S=>(e.openBlock(),e.createBlock(j,{key:S.id,comment:S,isInside:!0,onDelete:L=>x.$emit("delete",S.id),onLike:k,onEdit:v},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Wo,{key:0,onSendComment:E[9]||(E[9]=S=>x.$emit("reply",t.comment?.id,S)),isReply:c.value,"onUpdate:isReply":E[10]||(E[10]=S=>c.value=S)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),hi=["id"],gi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},sn=e.defineComponent({__name:"CommentsWidget",props:{title:{},comments:{},maxHeight:{},onAddComment:{type:Function},onReply:{type:Function},onLike:{type:Function},onDelete:{type:Function},onEdit:{type:Function},id:{},className:{},style:{}},emits:["add","reply","like","delete","edit"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(o.comments??[]);async function l(){if(!o.id)return;const f=await fetch(`/api/widget/comment/${o.id}`).then(g=>g.json());r.value=f.rows.map(g=>({id:g.communication_id,author:g.username,text:g.body,createdAt:new Date(g.cdate)}))}r.value.length===0&&l();const i=async f=>{o.onAddComment?o.onAddComment(f):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:f})}),await l()),s("add",f)},a=(f,g)=>{o?.onLike?.(f,g),s("like",f,g)},c=(f,g)=>{o.onReply?.(f,g),s("reply",f,g)},d=async(f,g)=>{o.onEdit?o.onEdit(f,g):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:g})}),await l()),s("edit",f,g)},m=async f=>{o.onDelete?o.onDelete(f):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"DELETE"}),await l()),s("delete",f)};return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",gi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([t.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,b=>(e.openBlock(),e.createBlock(mi,{key:b.id,comment:b,onReply:c,onLike:a,onDelete:g[0]||(g[0]=k=>m(k)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Wo,{onSendComment:g[1]||(g[1]=b=>i(b))})],14,hi))}}),Ko=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Nt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ur}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Wr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Fr}]]),yi={class:"mx-auto font-sans"},vi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},bi={class:"relative"},ki={class:"space-y-3"},Ei={class:"flex-1 min-w-0 pb-2"},wi={class:"flex items-center gap-1.5 mb-1 mt-0.5"},xi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Ni={class:"font-medium text-xs"},Ci={class:"text-xs text-gray-500"},Si={class:"space-y-1"},_i={class:"text-xs text-gray-700"},Bi={class:"capitalize mr-1"},$i={key:0,class:"inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"},Ti={key:0,class:"flex items-center gap-1 text-xs"},Li={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Ai={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},rn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?n.data:[]);o.value.length===0&&n.id&&s();async function s(){const r=await fetch(`/api/widget/history/${n.id}`);if(!r.ok)return{data:[]};const l=await r.json();l.rows.forEach(i=>{i.timestamp=new Date(i.cdate),i.id=i.entity_id,i.entityType=i.entity_type,i.entityId=i.entity_id,i.action=i.change_type,i.userId=i.change_user_id,i.userName=i.username,i.timestamp=new Date(i.cdate),i.description=i.username,i.status=i.username}),o.value=l.rows}return(r,l)=>(e.openBlock(),e.createElementBlock("div",yi,[t.title?(e.openBlock(),e.createElementBlock("h3",vi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[e.createElementVNode("div",bi,[l[0]||(l[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:i?.id},[e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${e.unref(Ko).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ko).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",Ei,[e.createElementVNode("div",wi,[e.createElementVNode("span",xi,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",Ni,e.toDisplayString(i?.userName),1),e.createElementVNode("span",Ci,e.toDisplayString(i?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+e.toDisplayString(i?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",Si,[e.createElementVNode("div",_i,[e.createElementVNode("span",Bi,e.toDisplayString(i?.action),1),i?.entityId?(e.openBlock(),e.createElementBlock("span",$i,e.toDisplayString(i?.entityId),1)):e.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(e.openBlock(),e.createElementBlock("div",Ti,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",Li,e.toDisplayString(i?.changes?.[i?.entityId]?.old),1)):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.old&&i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(Ar),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Ai,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Ii={key:0,class:"text-xl font-semibold"},Di={class:"flex gap-1"},Oi={key:0},Mi=["accept"],Ri={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer"},Fi=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{},accept:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(t){const n=e.useModel(t,"modelValue"),o={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Ii,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?o.active:o.inactive]),onClick:r[0]||(r[0]=l=>n.value="list")},[e.createVNode(e.unref(zr),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?o.active:o.inactive]),onClick:r[1]||(r[1]=l=>n.value="grid")},[e.createVNode(e.unref(Mr),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Oi,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,40,Mi),e.createElementVNode("div",Ri,[e.createVNode(e.unref(Uo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),zn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Nt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Or,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Kr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Nt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Lr,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Nt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Nt,label:"PPT"}};function Go(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function Zo(t){if(t===0)return"0 B";const n=1024,o=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,s)).toFixed(1))} ${o[s]}`}const Pi={class:"space-y-0.5"},zi=["onClick"],ji=["onClick"],Hi={class:"flex items-center gap-2"},Ui={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},qi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Wi={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ki={class:"flex items-center gap-1"},Gi=["onClick"],Zi=["onClick"],Ji=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,s=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(zn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(zn)[s?.ext]?.icon||e.unref(zn).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:r=>n.$emit("openLightbox",s)},[e.createElementVNode("div",Hi,[e.createElementVNode("span",Ui,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,ji),e.createElementVNode("div",qi,e.toDisplayString(e.unref(Zo)(s.size)),1),e.createElementVNode("div",Wi,e.toDisplayString(e.unref(Go)(s.createdAt)),1),e.createElementVNode("div",Ki,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"},[e.createVNode(e.unref(jo),{class:"h-3 w-3"})],8,Gi),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",onClick:e.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"})],8,Zi)])],8,zi))),128))]))}}),Yi={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Xi=["onClick"],Qi={class:"space-y-2"},Vi={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},el=["src"],tl={class:"space-y-1"},nl=["title"],ol={class:"text-xs text-gray-500 text-left"},sl={class:"absolute top-2 right-1 flex items-center gap-1"},rl=["onClick"],il=["onClick"],ll=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"]),class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",Qi,[e.createElementVNode("div",Vi,[s.ext==="png"||s.ext==="jpg"||s.ext==="jpeg"||s.ext==="gif"||s.ext==="svg"||s.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${s?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,el)):(e.openBlock(),e.createBlock(e.unref(Nt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",tl,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:s.uploaded_name||s.name},e.toDisplayString(s.uploaded_name||s.name),9,nl),e.createElementVNode("p",ol,e.toDisplayString(e.unref(Go)(s.createdAt))+", "+e.toDisplayString(e.unref(Zo)(s.size)),1)])]),e.createElementVNode("div",sl,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50"},[e.createVNode(e.unref(jo),{class:"h-3 w-3"})],8,rl),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",onClick:e.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"})],8,il)])],8,Xi))),128))]))}}),al={class:"mx-auto font-sans"},cl={key:1},ln=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},format:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=e.ref(!1),r=e.ref(null),l=e.ref(!1),i=e.ref(0),a=e.ref(o.files??[]),c=e.computed(()=>{const h=(o.format??[]).map(F=>typeof F=="string"?F.trim():F==null?"":String(F).trim()).filter(F=>F.length>0),T=[];return h.forEach(F=>{const P=F.toLowerCase(),K=P.indexOf("/"),Z=K>=0;let B,M=!1,w;if(Z){B=P;const ne=P.slice(K+1);M=ne==="*",!M&&ne&&(w=`.${ne.replace(/^\.+/,"")}`)}else w=P.startsWith(".")?P:`.${P.replace(/^\.+/,"")}`;const z=Z?B:w??"";z&&T.push({acceptValue:z,mime:B,wildcard:M,extension:w})}),T.length?T:null}),d=e.computed(()=>{const A=c.value;if(!A)return;const h=A.map(T=>T.acceptValue).filter(Boolean);return h.length?h.join(","):void 0}),m=A=>{if(!c.value)return!0;const h=A.type?.toLowerCase(),T=A.name?.toLowerCase();return c.value.some(F=>{if(F.mime){if(h){if(F.wildcard){const P=F.mime.split("/")[0];if(h.startsWith(`${P}/`))return!0}else if(h===F.mime)return!0}return!!(F.extension&&T?.endsWith(F.extension))}return!!(F.extension&&T?.endsWith(F.extension))})},f=n;a.value.length===0&&L();const g=(A,h)=>{r.value=h,s.value=!0},b=()=>{r.value&&(E(r.value),r.value=null,s.value=!1)},k=e.computed(()=>Array.isArray(a.value)?a.value.map(A=>A?.file_path):[]),v=A=>{const h=k.value.findIndex(T=>T===A.file_path);h!==-1&&(l.value=!0,i.value=h)},x=A=>{o.onAddFile?o.onAddFile(A):R(A),f("add",A)},E=A=>{o.onDelete?o.onDelete(A):I(A),f("delete",A)},j=A=>{const h=document.createElement("a");h.setAttribute("download",A?.uploaded_name||A?.name),h.href=A?.file_path||A?.path,h.click()},S=e.ref("list");async function L(){if(!o.id)return;const A=await fetch(`/api/widget/file/${o.id}`).then(h=>h.json());A.rows.forEach(h=>{h.timestamp=new Date(h.cdate),h.id=h.entity_id,h.entityType=h.entity_type,h.entityId=h.entity_id,h.entityType=h.entity_type,h.action=h.change_type,h.userId=h.change_user_id,h.userName=h.username,h.timestamp=new Date(h.cdate),h.description=h.username,h.status=h.username}),a.value=A.rows}const R=async A=>{const T=A.target?.files;if(!T||T.length===0)return;const F=Array.from(T),P=[],K=[];if(F.forEach(Z=>{m(Z)?P.push(Z):K.push(Z)}),K.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${K.map(Z=>Z.name).join(", ")}`),P.length!==0)try{await Promise.all(P.map(async Z=>{const B=new FormData;B.append("file",Z);const M=`/api/widget/file/${o.id}`,w=await fetch(M,{method:"POST",body:B});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);return Z})),await L()}catch(Z){console.error("Помилка при завантаженні файлів:",Z)}},I=async A=>{try{await fetch(`/api/widget/file/${o.id}/${A}`,{method:"DELETE"}),await L()}catch(h){console.error(h)}};return(A,h)=>{const T=e.resolveComponent("MessageBox"),F=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",al,[e.createVNode(Fi,{modelValue:S.value,"onUpdate:modelValue":h[0]||(h[0]=P=>S.value=P),title:o.title,onOnAddFile:h[1]||(h[1]=P=>x(P)),editable:o.editable,accept:d.value},null,8,["modelValue","title","editable","accept"]),a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[S.value==="list"?(e.openBlock(),e.createBlock(Ji,{key:0,onDelete:g,onDownload:j,onOpenLightbox:h[2]||(h[2]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),S.value==="grid"?(e.openBlock(),e.createBlock(ll,{key:1,onDelete:g,onDownload:j,onOpenLightbox:h[3]||(h[3]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",cl,[...h[6]||(h[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),e.createVNode(T,{modelValue:s.value,"onUpdate:modelValue":h[4]||(h[4]=P=>s.value=P),onConfirm:b,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(F,{modelValue:l.value,"onUpdate:modelValue":h[5]||(h[5]=P=>l.value=P),images:k.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),dl={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},fl=["onClick"],pl={key:0,rel:"noreferrer",class:"relative block h-full w-full"},ul=["src"],ml={key:0,class:"thumb-cover"},hl=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},format:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(t,{emit:n}){const o=n,s=e.ref(!1),r=e.ref(0),l=t,i=e.computed(()=>Array.isArray(l.items)?l.items.map(c=>c?.file_path):[]),a=c=>{const d=i.value.findIndex(m=>m===c.file_path);d!==-1&&(s.value=!0,r.value=d)};return(c,d)=>{const m=e.resolveComponent("Lightbox");return t.items?.length>=1?(e.openBlock(),e.createElementBlock("div",dl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+g,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:g,onClick:e.withModifiers(b=>a(f),["stop"])},[g<5?(e.openBlock(),e.createElementBlock("div",pl,[e.createElementVNode("img",{src:`/file/resize?filepath=${f?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",g===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,ul),g===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",ml," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,fl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-t.items.length),f=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+f,class:e.normalizeClass(["h-full w-full image"+(t.items.length+f-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=f=>o("delete",f))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),gl={key:0,class:"text-xl font-semibold"},yl={class:"flex gap-1"},vl=["accept"],bl={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer"},kl=e.defineComponent({__name:"widgetHeader",props:{title:{},accept:{}},emits:["onAddImage"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",gl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",yl,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",accept:t.accept??"image/*",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s)),multiple:""},null,40,vl),e.createElementVNode("div",bl,[e.createVNode(e.unref(Uo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),El={class:"w-full mx-auto font-sans",ref:"containerRef"},wl={key:1},an=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},format:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=L=>{if(!L)return[];const R=Array.isArray(L)?L:L.split(",");return Array.from(new Set(R.map(I=>I.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],l=e.computed(()=>{const L=s(o.format);return L.length>0?L:void 0}),i=e.computed(()=>{const L=l.value;return!L||L.length===0?"image/*":L.map(R=>R.startsWith(".")?R:`.${R}`).join(",")}),a=L=>L?.split(".").pop()?.toLowerCase()??"",c=L=>{const R=L?.toLowerCase();return!!R&&!!l.value&&l.value.includes(R)},d=L=>{const R=L?.toLowerCase();return!!R&&r.includes(R)},m=L=>{const R=L.type?.toLowerCase(),I=L.ext?.toLowerCase();return R?.startsWith("image/")?l.value?c(I):!0:I?l.value?c(I):d(I):!1},f=L=>{if(!L.type?.toLowerCase()?.startsWith("image/"))return!1;if(!l.value)return!0;const I=a(L.name);return c(I)},g=L=>L.filter(m),b=e.ref(g(o.items??[])),k=n;b.value.length===0&&j();const v=L=>{o.onAddImage?o.onAddImage(L):E(L),k("add",L)},x=L=>{const R=b.value.find(I=>I.file_path===L)?.file_id;R&&(o.onDelete?o.onDelete(R):S(R))},E=async L=>{const R=L.target;if(!R?.files||R.files.length===0)return;const I=Array.from(R.files),A=I.filter(T=>f(T)),h=l.value?.join(", ")??"image/*";if(A.length===0){console.warn(`Допустимі формати: ${h}. Завантажте зображення дозволеного типу.`);return}A.length!==I.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${h}.`);try{await Promise.all(A.map(async T=>{const F=new FormData;F.append("file",T);const P=`/api/widget/file/${o.id}`,K=await fetch(P,{method:"POST",body:F});if(!K.ok)throw new Error(`HTTP error! status: ${K.status}`);return T})),await j()}catch(T){console.error("Помилка при завантаженні файлів:",T)}};async function j(){if(!o.id)return;const L=await fetch(`/api/widget/file/${o.id}`).then(R=>R.json());b.value=g(L.rows)}const S=async L=>{try{await fetch(`/api/widget/file/${o.id}/${L}`,{method:"DELETE"}),await j()}catch(R){console.error(R)}};return(L,R)=>(e.openBlock(),e.createElementBlock("div",El,[e.createVNode(kl,{title:t.title,accept:i.value,onOnAddImage:R[0]||(R[0]=I=>v(I))},null,8,["title","accept"]),b.value.length>0?(e.openBlock(),e.createBlock(hl,{key:0,items:b.value,onDelete:R[1]||(R[1]=I=>x(I))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",wl,[...R[2]||(R[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),xl={class:"text-value"},Nl={class:"text-sm text-gray-900"},Cl=e.defineComponent({__name:"TextValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;return typeof s=="boolean"?s?"Так":"Ні":s==null?"—":String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",xl,[e.createElementVNode("span",Nl,e.toDisplayString(o.value),1)]))}}),nt=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},Sl=nt(Cl,[["__scopeId","data-v-34a76c89"]]),_l={class:"link-value"},Bl=["href"],$l=nt(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=String(n.item.value);try{const r=new URL(s);return r.hostname+r.pathname}catch{return s}});return(s,r)=>(e.openBlock(),e.createElementBlock("div",_l,[e.createElementVNode("a",{href:String(t.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(o.value)+" ",1),r[0]||(r[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,Bl)]))}}),[["__scopeId","data-v-932f028c"]]),Tl={class:"date-value"},Ll={class:"text-sm text-gray-900"},Al=nt(e.defineComponent({__name:"DateValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;if(s instanceof Date)return s.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof s=="string"){const r=new Date(s);if(!isNaN(r.getTime()))return r.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",Tl,[e.createElementVNode("span",Ll,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),Il={class:"status-value"},Dl={key:0,class:"mr-1"},Ol=nt(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"bg-green-100 text-green-800";case"inactive":case"неактивний":case"pending":case"очікує":return"bg-yellow-100 text-yellow-800";case"error":case"помилка":case"failed":case"неуспішно":return"bg-red-100 text-red-800";case"draft":case"чернетка":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}}),s=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(r,l)=>(e.openBlock(),e.createElementBlock("div",Il,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.value])},[s.value?(e.openBlock(),e.createElementBlock("span",Dl,[e.createElementVNode("i",{class:e.normalizeClass(s.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(t.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),Ml={class:"custom-value"},Rl={class:"text-sm text-gray-900"},Fl=nt(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ml,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Rl,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),Pl=["id"],zl={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},jl={key:1,class:"overflow-x-auto"},Hl={class:"min-w-full divide-y divide-gray-200"},Ul={class:"bg-white divide-y divide-gray-200"},ql={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Wl={class:"flex items-center gap-2"},Kl=["title"],Gl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Zl={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Jl={class:"flex items-start gap-3"},Yl={key:0,class:"flex-shrink-0"},Xl={class:"flex-1 min-w-0"},Ql={class:"flex items-center gap-2 mb-2"},Vl={class:"text-sm font-medium text-gray-900"},ea=["title"],ta={key:3,class:"overflow-x-auto"},na={class:"min-w-full divide-y divide-gray-200"},oa={class:"bg-white divide-y divide-gray-200"},sa={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ra={class:"flex items-center gap-2"},ia=["title"],la={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},jn=nt(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return $l;case"date":return Al;case"status":return Ol;case"custom":return Fl;default:return Sl}};return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",zl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",jl,[e.createElementVNode("table",Hl,[e.createElementVNode("tbody",Ul,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",ql,[e.createElementVNode("div",Wl,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[0]||(s[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,Kl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Gl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Zl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id||r.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Jl,[r.icon?(e.openBlock(),e.createElementBlock("div",Yl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xl,[e.createElementVNode("div",Ql,[e.createElementVNode("h4",Vl,e.toDisplayString(r.label),1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[1]||(s[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,ea)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",ta,[e.createElementVNode("table",na,[e.createElementVNode("tbody",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",sa,[e.createElementVNode("div",ra,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[2]||(s[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,ia)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",la,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Pl))}}),[["__scopeId","data-v-106790ef"]]);function Jo(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(l=>l.src===t)){n();return}const r=document.createElement("script");r.src=t,r.async=!0,r.onload=()=>n(),r.onerror=()=>o(new Error(`Failed to load ${t}`)),document.body.appendChild(r)})}function aa(t){if(typeof document>"u"||Array.from(document.styleSheets||[]).some(s=>s.href===t))return;const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}const ca="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Hn=null;function da(){if(typeof window>"u")return;const t=window.IMask;if(typeof t=="function")return t;if(t&&typeof t.default=="function")return t.default}function fa(){return Hn||(Hn=Jo(ca).then(()=>{const t=da();if(!t)throw new Error("IMask is not available after loading the script");return t})),Hn}function pa(){return typeof window>"u"?"":window.location?.origin??""}function Yo(){if(!(typeof window>"u"))return window.maplibregl}const Xo=Symbol("vs-widget-map");function Un(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function ua(t){const n=['<div class="map-popup">'];return n.push('<div class="map-popup__body">'),t.forEach(o=>{n.push(`<div class="flex flex-col"><span class="font-bold text-slate-700">${o.label}: </span><span class="text-slate-700">${o.value}</span></div>`)}),n.push("</div></div>"),n.join("")}function ma(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function qn(t){if(!t)return"";const n=t.trim();if(!n)return"";const s=n.replace(/\\n/g,"").replace(/\\r/g,"").replace(/\\t/g,"").replace(/\s+/g,"");if(!s)return"";if(/^https?:\/\//i.test(s))return s;const r=pa(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function ha(t){const n=(t?.service??"").toLowerCase();if(n)return n;const o=(t?.url??"").toLowerCase();return/(\.mvt|\.pbf|\.vtile|\.vmt)(\?|$)/.test(o)?"vtile":/(\.png|\.jpg|\.jpeg|\.webp)(\?|$)/.test(o)?"raster":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(o)?"wms":""}function ga(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function cn(t){if(t!=null){if(typeof t=="number")return t;if(typeof t=="string"){const n=t.trim();if(!n)return;const o=Number(n);return Number.isFinite(o)?o:void 0}}}const Qo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function ya(t){const n=t?.color??Qo[0],o=(t?.colorAttr??"").trim();if(!o)return n;const s=t?.colorSet&&Object.keys(t.colorSet).length>0,r={};if(s&&t?.colorSet?Object.entries(t.colorSet).forEach(([i,a])=>{const c=typeof a=="string"?a.trim():"",d=String(i).trim();c&&d&&(r[d]=c)}):Qo.forEach((i,a)=>{r[String(a+1)]=i}),!Object.keys(r).length)return n;const l=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([i,a])=>{l.push(String(i),a)}),l.push(n),l}const zt="map-highlight-source",va="map-highlight-fill",ba="map-highlight-line";function ka(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function Vo(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function Ea(){return aa("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Jo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Yo()}function dn(t){const n=e.inject(Xo,void 0);if(!t){if(!n)throw new Error("useMap() must be called inside a map provider");return n}if(n)return n;const o=e.ref(null),s=e.ref(!1),r=e.ref({selectedBasemap:"",geometryVisible:!0,overlays:[]}),l=e.ref([]),i=e.ref([]),a=e.ref(null),c=e.ref(null),d=e.ref(null);let m=t.style??null,f=null;const g=p=>{p&&(o.value?o.value.setStyle(p):m=p)},b=()=>{r.value.overlays=i.value.map(p=>({id:p.id,name:p.config.name,visible:p.visible}))},k=p=>{const C=Array.isArray(p)?p:[];l.value=C,C.some(U=>U.key===r.value.selectedBasemap)||(r.value.selectedBasemap=C[0]?.key??"")},v=p=>{p&&i.value.forEach(C=>{C.layerIds.forEach(D=>{p.getLayer(D)&&p.removeLayer(D)}),p.getSource(C.sourceId)&&p.removeSource(C.sourceId),C.layerIds=[]})},x=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||(i.value.forEach(C=>{E(p,C)}),P())},E=(p,C)=>{const D=ha(C.config);D==="vtile"?S(p,C):D==="raster"&&j(p,C)},j=(p,C)=>{const D=C.config,U=C.sourceId,J=qn(D.url);if(!J)return;p.getSource(U)||p.addSource(U,{type:"raster",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const q=`${C.id}-raster`;p.getLayer(q)||p.addLayer({id:q,type:"raster",source:U,layout:{visibility:C.visible?"visible":"none"}}),C.layerIds=[q],L(p,C)},S=(p,C)=>{const D=C.config,U=C.sourceId,J=qn(D.url);if(!J)return;p.getSource(U)||p.addSource(U,{type:"vector",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const q=D.style??{},le=ya(q),he=[],ie={visibility:C.visible?"visible":"none"},et=ga(D),Me={source:U,layout:ie};if(et&&(Me["source-layer"]=et),(q.type??"polygon").toLowerCase()==="point"){const je=`${C.id}-circle`;p.getLayer(je)||p.addLayer({id:je,type:"circle",...Me,paint:{"circle-color":le,"circle-opacity":q.opacity??1,"circle-radius":q.radius??q.width??3,"circle-stroke-color":q.stroke??q.color??"#ffffff","circle-stroke-width":q.width??1}}),he.push(je);const He=q.text??q.label;if(He){const vt=`${C.id}-symbol`,tn=cn(q.textSize)??10,Mt=q.textHaloColor??q.stroke??"#ffffff",Rt=cn(q.textHaloWidth)??1,bt=cn(q.textZoom??q.pointZoom),Ft={"text-color":q.textColor??"#000000","text-halo-color":Mt,"text-halo-width":Rt},Je={id:vt,type:"symbol",...Me,layout:{"text-field":["coalesce",["get",He],""],"text-size":tn,"text-anchor":"top"},paint:Ft};bt!=null&&(Je.minzoom=bt),p.getLayer(vt)||p.addLayer(Je),he.push(vt)}}else{const je=`${C.id}-fill`;p.getLayer(je)||p.addLayer({id:je,type:"fill",...Me,paint:{"fill-color":le,"fill-opacity":q.opacity??.5,"fill-outline-color":q.stroke??q.color??"#0ea5e9"}}),he.push(je);const He=`${C.id}-line`;p.getLayer(He)||p.addLayer({id:He,type:"line",...Me,paint:{"line-color":q.stroke??q.color??"#0b74c4","line-width":cn(q.width??q.border)??1,"line-opacity":q.opacity??1}}),he.push(He)}C.layerIds=he,L(p,C)},L=(p,C)=>{const D=C.visible?"visible":"none";C.layerIds.forEach(U=>{p.getLayer(U)&&p.setLayoutProperty(U,"visibility",D)})},R=p=>{const C=Array.isArray(p)?p:[];v(o.value??void 0),d.value=null,B();const D=C.map((U,J)=>{if(!U)return null;const q=qn(U.url);if(!q)return null;const le=U.id!=null?String(U.id):`overlay-${J}`;return{id:le,config:{...U,id:le,url:q},visible:!1,sourceId:`${le}-source`,layerIds:[]}}).filter(U=>!!U);i.value=D,b(),x()},I=(p,C)=>{const D=i.value.find(J=>J.id===p);if(!D)return;D.visible=C,b();const U=o.value;if(!(!U||typeof U.isStyleLoaded!="function"||!U.isStyleLoaded())){if(!D.layerIds.length){E(U,D);return}L(U,D)}},A=()=>{a.value&&(a.value.remove(),a.value=null)},h=(p,C={})=>!Array.isArray(p.popup)||!p.popup.length?[]:p.popup.map(D=>({label:D.label??D.field,value:Un(C?.[D.field])})).filter(D=>D.label&&D.value!==void 0),T=p=>{const C=o.value;if(!C||!p?.point)return;const D=C.queryRenderedFeatures(p.point);for(const U of D){const J=U.layer?.id??U.sourceLayer;if(!J)continue;const q=ze(J);if(!q)continue;const le=h(q,U.properties??U.layer?.properties??{});if(!le.length)continue;const he=ua(le),ie=Yo();if(!ie)return;const et=p.lngLat;if(c.value===J&&a.value){a.value.setLngLat(et),a.value.setHTML(he);return}c.value=J,A(),a.value=new ie.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(et).setHTML(he).addTo(C);return}c.value=null,A()},F=()=>{c.value=null,A()},P=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||p.getSource(zt)||(p.addSource(zt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),p.addLayer({id:va,type:"fill",source:zt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),p.addLayer({id:ba,type:"line",source:zt,paint:{"line-color":"#1d4ed8","line-width":2}}))},K=p=>{const C=o.value;if(!C||typeof C.isStyleLoaded!="function"||!C.isStyleLoaded())return;P();const D=C.getSource(zt);if(!(!D||typeof D.setData!="function")){if(!p){D.setData({type:"FeatureCollection",features:[]});return}D.setData({type:"FeatureCollection",features:[p]})}},Z=p=>{const C=ka(p);C&&K(C)},B=()=>{K(null)},M=()=>{d.value=null,B()},w=p=>{if(p)return typeof p=="string"?p:p.field??p.name??p.key??p.label},z=p=>{if(p)return typeof p=="string"?p:p.label??p.title??p.field??p.name},ne=(p,C)=>!p||!p.length?[]:p.map(D=>{const U=w(D);if(!U)return null;const J=z(D),q=Un(C?.[U]);return!J||q===""?null:{label:J,value:q}}).filter(D=>!!D),We=(p,C)=>!Array.isArray(p)||!p.length?[]:p.map(D=>{if(!D?.name)return null;const U=D.title??D.name,J=Un(C?.[D.name]);return!U||J===""?null:{label:U,value:J}}).filter(D=>!!D),we=(p,C)=>!Array.isArray(p)||!p.length?[]:p.map(U=>{const J=Vo(U.url,C),q=U.label??U.url;return J?{label:q,url:J,target:U.target}:null}).filter(U=>!!U),pe=async(p,C)=>{const D=Vo(p,C);if(!D)return null;try{const U=await fetch(D);return U.ok?await U.json():null}catch{return null}},Le=async(p,C)=>{const D=C.properties??C.layer?.properties??{},U=ne(p.card?.rows,D);let J,q;if(p.card?.api){const ie=await pe(p.card.api,D);ie&&(typeof ie.html=="string"&&ie.html.trim()&&(J=ie.html),Array.isArray(ie.columns)&&ie.columns.length&&(q=ie.columns))}let le=U;if(!J&&q){const ie=We(q,D);ie.length&&(le=ie)}if(!le.length&&!J)return null;const he=we(p.card?.actions,D);return{title:D?.name??p.name,rows:le,html:J,actions:he.length?he:void 0}},Ke=async p=>{const C=o.value;if(!C||!p?.point)return;const D=C.queryRenderedFeatures(p.point);for(const U of D){const J=U.layer?.id??U.sourceLayer;if(!J)continue;const q=ze(J);if(!q||!q.card)continue;const le=await Le(q,U);if(le){d.value=le,Z(U);return}}d.value=null,B()},Ge=()=>{const p=o.value;p&&(p.on("mousemove",T),p.on("mouseleave",F),p.on("click",Ke))},Ze=()=>{const p=o.value;p&&(p.off("mousemove",T),p.off("mouseleave",F),p.off("click",Ke),A(),B())},ze=p=>{if(p)return i.value.find(C=>C.layerIds.includes(p))?.config},W=async()=>{const p=await Ea(),C=ma(t.container);if(!p||!C)return;const D={container:C,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:m??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new p.Map(D);const U=()=>{x()};f=U,o.value.on("style.load",U),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),x(),Ge()})};e.onMounted(W),e.onBeforeUnmount(()=>{Ze(),o.value&&f&&o.value.off("style.load",f),v(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const G={map:o,ready:s,setStyle:g,flyTo:p=>o.value?.flyTo(p),fitBounds:(p,C)=>o.value?.fitBounds(p,C),setCenter:p=>o.value?.setCenter(p),setZoom:p=>o.value?.setZoom(p),addControl:(p,C)=>o.value?.addControl(p,C),removeControl:p=>o.value?.removeControl(p),on:(p,...C)=>o.value?.on(p,...C),off:(p,...C)=>o.value?.off(p,...C),project:p=>o.value?.project(p),unproject:p=>o.value?.unproject(p),state:r,basemapOptions:l,setOverlays:R,toggleOverlay:I,getOverlayConfig:ze,selectedCard:d,setBasemapOptions:k,clearCard:M};return e.provide(Xo,G),G}const wa={class:"map-base-layer-menu"},xa={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Na={class:"flex items-center justify-between p-2 border-b"},Ca={class:"p-2 border-b"},Sa={class:"flex items-center"},_a=["value","checked","onChange"],Ba={class:"ml-2"},$a={class:"p-2"},Ta={class:"flex items-center"},La=["checked"],Aa=["checked","onChange"],Ia={class:"ml-2"},Da=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=dn(),i=e.ref(!1),a=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>o.value),d=e.computed(()=>n.value.selectedBasemap??""),m=e.computed(()=>n.value.geometryVisible??!0),f=e.computed(()=>n.value.overlays??[]),g=v=>{s?.(v)},b=()=>{r?.(!m.value)},k=v=>{l?.(v.id,!v.visible)};return(v,x)=>(e.openBlock(),e.createElementBlock("div",wa,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=E=>i.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),i.value?(e.openBlock(),e.createElementBlock("div",xa,[e.createElementVNode("div",Na,[x[3]||(x[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:x[1]||(x[1]=E=>i.value=!1)},[...x[2]||(x[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M18 6l-12 12"}),e.createElementVNode("path",{d:"M6 6l12 12"})],-1)])])]),e.createElementVNode("div",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.key},[e.createElementVNode("label",Sa,[e.createElementVNode("input",{type:"radio",name:a,value:E.key,checked:d.value===E.key,onChange:j=>g(E.key)},null,40,_a),e.createElementVNode("span",Ba,e.toDisplayString(E.name||E.key),1)])]))),128))]),e.createElementVNode("div",$a,[e.createElementVNode("label",Ta,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:b},null,40,La),x[4]||(x[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,E=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:E.id},[e.createElementVNode("input",{type:"checkbox",checked:E.visible,onChange:j=>k(E)},null,40,Aa),e.createElementVNode("span",Ia,e.toDisplayString(E.name||E.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),Oa={key:0,class:"absolute bottom-[35px] left-[10px] z-[400] bg-white border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},Ma={class:"leading-tight"},Ra=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",Oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,s=>(e.openBlock(),e.createElementBlock("div",{key:s.key,class:"flex items-center gap-2 text-gray-800"},[e.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",Ma,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Fa={class:"flex items-center gap-2 bg-white border border-gray-200 rounded-lg shadow-[0_10px_22px_rgba(15,23,42,0.16)] px-3 py-2 text-[11px] text-slate-900 max-w-[220px]"},Pa={class:"font-mono"},za=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Fa,[e.createElementVNode("span",Pa,e.toDisplayString(t.coordinates),1)]))}}),ja={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Ha=["title"],Ua={key:0,class:"vs-select__options absolute z-50 mt-1 w-auto min-w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900"},qa=["onClick"],Wa=["placeholder"],Ka={class:"divide-y divide-gray-100"},Ga=["onClick"],Za=600,Ja="0000000000:00:000:0000",Ya=30,Xa=8,Qa="https://data.softpro.ua/api-user/gis-url-proxy",Va="https://geo.rv.ua/api-user/dzk.api",ec="https://nominatim.openstreetmap.org/search",tc=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=dn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const i=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const W=n.config?.tools?.filter(G=>i.includes(G));return W&&W.length?W:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,W=>{W.includes(d.value)||(d.value=W[0])});const m=e.ref(""),f=e.ref(!1),g=e.ref(null),b=e.ref(null),k=e.ref(null),v=e.ref([]),x=e.ref(null),E=e.computed(()=>d.value==="address"&&v.value.length>0);let j=null,S=null,L=null;const R=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function I(){if(!b.value)return;const W=b.value.getBoundingClientRect(),G=W.width+Ya,p=W.left+window.scrollX,C=W.bottom+window.scrollY+Xa;R.left=`${p}px`,R.top=`${C}px`,R.width=`${G}px`,R.display="block"}const A=()=>{E.value&&I()};function h(){j&&(clearTimeout(j),j=null)}function T(){S?.destroy(),S=null}async function F(){if(d.value!=="parcel")return;const W=k.value;if(!W)return;const G=await fa();d.value==="parcel"&&(T(),S=G(W,{mask:Ja,lazy:!1,placeholderChar:"_"}),S.on("accept",()=>{m.value=S?.value??""}))}function P(){return(S?.value??m.value).trim()}function K(){if(!(typeof window>"u"))return window.maplibregl}function Z(W){const G=o.map.value;if(!G)return;const p=K();if(p){if(L){L.setLngLat([W.lat,W.lng]);return}L=new p.Marker({color:"#2563eb"}).setLngLat([W.lat,W.lng]).addTo(G)}}function B(){L&&(L.remove(),L=null)}e.watch(d,W=>{m.value="",f.value=!1,v.value=[],h(),W==="parcel"?e.nextTick(()=>{F().catch(G=>{xe.notify({type:"error",title:"Маска кадастру",message:G?.message||"Не вдалося ініціалізувати маску"})})}):T()}),e.watch(E,W=>{W?e.nextTick(()=>{I()}):R.display="none"}),e.watch(m,W=>{if(d.value!=="address"){v.value=[],h();return}if(!W.trim()){v.value=[],h();return}h(),j=window.setTimeout(()=>{Le(W).catch(G=>{const p=G?.message||"Помилка пошуку адреси";xe.notify({type:"error",title:"Пошук адреси",message:p})})},Za)});function M(W){d.value=W}function w(W){const G=W.target;if(f.value){const p=g.value;p&&!p.contains(G)&&(f.value=!1)}if(E.value){const p=x.value;p&&!p.contains(G)&&(v.value=[])}}e.onMounted(()=>{window.addEventListener("click",w,!0),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),d.value==="parcel"&&e.nextTick(()=>{F().catch(W=>{xe.notify({type:"error",title:"Маска кадастру",message:W?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",w,!0),window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A),h(),T(),B()});function z(W){return W==="xy"?"Координати":W==="parcel"?"Кадастр":"Адреси"}function ne(W){const G=W.replace(/[,]+/g," ").trim();if(!G)return null;const p=G.split(/\s+/).filter(Boolean);if(p.length<2)return null;console.log(p);const C=p.slice(0,2).map(Number);if(console.log(C),!C.every(ie=>Number.isFinite(ie)))return null;let[D,U]=C,J=D,q=U;const le=ie=>Math.abs(ie)<=90,he=ie=>Math.abs(ie)<=180;if(!le(J)||!he(q))if(le(q)&&he(J))J=D,q=U;else return null;return console.log(J,q),{lat:J,lng:q}}function We(W){return(W?.items||[]).map((p,C)=>{const D=Number(p?.position?.lat),U=Number(p?.position?.lng);return!Number.isFinite(D)||!Number.isFinite(U)?null:{id:String(p?.id??C),title:p?.title||p?.address?.label||"Знайдений обʼєкт",lat:D,lng:U}}).filter(p=>!!p)}function we(W){const G=W?.result||W?.data||W;if(!G)return[];const p=G.geom_centroid;if(!p||!Array.isArray(p.coordinates))return[];const[C,D]=p.coordinates;return!Number.isFinite(C)||!Number.isFinite(D)?[]:[{id:"parcel",title:G.cadnum||G.cad_num||"Земельна ділянка",lat:C,lng:D}]}function pe(W){return(Array.isArray(W?.features)?W.features:[]).map((p,C)=>{const D=p?.geometry?.coordinates,U=Number(D?.[0]),J=Number(D?.[1]);if(!Number.isFinite(U)||!Number.isFinite(J))return null;const q=p?.properties||{},le=q?.geocoding?.label||q?.display_name||q?.label||"Адреса";return{id:String(q?.geocoding?.place_id||q?.place_id||C),title:le,lat:U,lng:J}}).filter(p=>!!p)}async function Le(W){v.value=[],h();const G=new URL(ec);G.searchParams.set("format","geojson"),G.searchParams.set("q",W),G.searchParams.set("addressdetails","1"),G.searchParams.set("bounded","1");const p=r();p&&G.searchParams.set("viewbox",p);const C=await fetch(G.toString());if(!C.ok)throw new Error(`HTTP ${C.status}`);const D=await C.json(),U=pe(D);if(!U.length){xe.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}v.value=U}function Ke(W){Ze(W),v.value=[],m.value=""}function Ge(W){const p=W.replace(/\s+/g,"").split(":");if(p.length!==4)return!1;const C=[10,2,3,4];return p.every((D,U)=>D.length===C[U]&&/^\d+$/.test(D))}function Ze(W){const G=n.config?.zoom??17;o.flyTo?.({center:[W.lat,W.lng],zoom:G}),Z(W)}async function ze(){const W=d.value==="parcel"?P():m.value.trim();if(W){if(d.value==="xy"){const G=ne(W);if(console.log(G),!G){xe.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}Ze(G),m.value="";return}if(d.value==="address"){try{await Le(W)}catch(G){const p=G?.message||"Помилка пошуку адреси";xe.notify({type:"error",title:"Пошук адреси",message:p})}return}try{const G=new URL(d.value==="here"?Qa:Va);if(d.value==="here")G.searchParams.set("searchtext",W);else{if(!Ge(W)){xe.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}G.searchParams.set("cad_num",W)}const p=await fetch(G.toString());if(!p.ok)throw new Error(`HTTP ${p.status}`);const C=await p.json(),D=d.value==="here"?We(C):we(C);if(!D.length)xe.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const U=D[0];Ze(U),d.value==="parcel"&&S&&(S.value=""),m.value=""}}catch(G){const p=G?.message||"Помилка пошуку";xe.notify({type:"error",title:"Пошук",message:p})}}}return(W,G)=>(e.openBlock(),e.createElementBlock("div",ja,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(ze,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:g,class:"relative search-type w-[100px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:G[0]||(G[0]=p=>f.value=!f.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:z(d.value)},e.toDisplayString(z(d.value)),9,Ha),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":f.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...G[3]||(G[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),f.value?(e.openBlock(),e.createElementBlock("div",Ua,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:C=>M(p)},e.toDisplayString(z(p)),9,qa))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:b,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[d.value==="parcel"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"parcelInputRef",ref:k,"onUpdate:modelValue":G[1]||(G[1]=p=>m.value=p),placeholder:"0000000000:00:000:0000",inputmode:"numeric",type:"text",class:"vs-input !h-[34px] transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,512)),[[e.vModelText,m.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":G[2]||(G[2]=p=>m.value=p),placeholder:c.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Wa)),[[e.vModelText,m.value,void 0,{trim:!0}]]),G[4]||(G[4]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1)),E.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:x,class:"vs-select__options mt-1 bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900 z-50 max-h-60 overflow-auto",style:e.normalizeStyle(R)},[e.createElementVNode("ul",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:C=>Ke(p)},e.toDisplayString(p.title),9,Ga))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),nc={class:"map-center-control"},oc=["aria-label"],sc=e.defineComponent({directives:{tooltip:xe.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=dn(),r=e.ref(null),l=e.ref(null),i=e.ref(null),a=e.ref(null);function c(k){if(Array.isArray(k)&&k.length>=2){const[v,x]=k.slice(0,2).map(E=>Number(E));return Number.isNaN(v)||Number.isNaN(x)?null:[v,x]}if(k&&typeof k=="object"){const v=k,x=v.lng??v.lon??v.long??v.x,E=v.lat??v.y;if(x!=null&&E!=null){const j=Number(x),S=Number(E);if(!Number.isNaN(j)&&!Number.isNaN(S))return[j,S]}}if(typeof k=="string"){const v=k.split(",").map(x=>Number(x.trim()));if(v.length>=2&&v.every(x=>!Number.isNaN(x)))return[v[0],v[1]]}return null}e.watch(()=>n.center,k=>{const v=c(k);v&&(r.value=v)},{immediate:!0}),e.watch(()=>n.zoom,k=>{const v=Number(k);Number.isNaN(v)||(l.value=v)},{immediate:!0}),e.watch(()=>n.targetCenter,k=>{i.value=c(k)},{immediate:!0}),e.watch(()=>n.targetZoom,k=>{const v=Number(k);a.value=Number.isNaN(v)?null:v},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),m=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),f=e.computed(()=>!!i.value);e.onMounted(async()=>{const k=o.value;if(k){if(!r.value){const v=k.getCenter();r.value=[v.lng,v.lat]}l.value==null&&(l.value=k.getZoom())}});function g(){const k=o.value;if(!k)return;const v=r.value||(()=>{const E=k.getCenter();return[E.lng,E.lat]})(),x=l.value??k.getZoom();k.flyTo({center:v,zoom:x})}function b(){const k=o.value;if(!k||!i.value)return;const v=a.value??l.value??k.getZoom();k.flyTo({center:i.value,zoom:v})}return(k,v)=>{const x=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",nc,[f.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,id:"center-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":"Повернути центр",onClick:e.withModifiers(g,["stop"])},[e.createVNode(e.unref(Pr),{class:"w-4 h-4"})])),[[x,"Центр мапи"]]),f.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:1,id:"goto-target-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":m.value,onClick:e.withModifiers(b,["stop"])},[e.createVNode(e.unref(jr),{class:"w-4 h-4"})],8,oc)),[[x,d.value]]):e.createCommentVNode("",!0)])}}}),es=nt(sc,[["__scopeId","data-v-bc627616"]]),rc={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},ic={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},lc=["aria-label"],ac={key:2,class:"absolute top-[10px] right-[10px] z-[600] min-w-[220px] max-w-[320px] bg-white border border-gray-200 rounded-[0.75rem] p-3 shadow-[0_25px_45px_rgba(15,23,42,0.2)]"},cc={class:"text-slate-900 font-semibold mb-1"},dc=["innerHTML"],fc={key:1,class:"space-y-2"},pc={class:"text-gray-500"},uc={class:"font-medium text-slate-900"},mc={key:2,class:"mt-2 flex flex-col gap-2"},hc=["href","target"],fn="map-basemap-source",Wn="map-basemap-layer",gc=20,Ct="map-katottg-geometry-source",pn="map-katottg-geometry-line",ot="map-geometry-source",St="map-geometry-fill",_t="map-geometry-line",Bt="map-geometry-circle",un=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},layers:{},legend:{},tools:{},katottg:{}},setup(t){const n=t,o=[{key:"topo100",name:"Topographic 100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",name:"Орто 10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",name:"OSM Bright",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}],l=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{};function i(u){if(u){if(Array.isArray(u)&&u.length>=2){const O=Number(u[0]),H=Number(u[1]);return!Number.isFinite(O)||!Number.isFinite(H)?void 0:[O,H]}if(typeof u=="object"){const O=u,H=O.lng??O.lon??O.long??O.x,Y=O.lat??O.y;if(H!=null&&Y!=null){const Se=Number(H),Ye=Number(Y);if(Number.isFinite(Se)&&Number.isFinite(Ye))return[Se,Ye]}}}}function a(u){if(u==null)return;const O=Number(u);return Number.isFinite(O)?O:void 0}const c=e.computed(()=>n.katottg!=null?n.katottg:l.katottg),d=e.computed(()=>(Array.isArray(l.basemaps)&&l.basemaps.length?l.basemaps:o).map((H,Y)=>{const Se=typeof H.url=="string"?H.url.trim():"";return Se?{key:(H.key??H.name??`base-${Y}`).trim()||`base-${Y}`,url:Se,name:H.name??H.key??`Layer ${Y+1}`}:null}).filter(H=>!!H)),m=i(l.center),f=a(l.zoom),g=Po(n.geom),b=xr(g),k=b?[(b[0]+b[2])/2,(b[1]+b[3])/2]:void 0,v=e.ref(null),x=e.computed(()=>i(n.center)??null),E=e.computed(()=>x.value??m??null),j=dn({container:v,center:k??E.value??void 0,zoom:n.zoom??f}),{map:S,setCenter:L,setZoom:R,state:I,getOverlayConfig:A,selectedCard:h,setBasemapOptions:T,clearCard:F,addControl:P,removeControl:K,ready:Z}=j,B=e.computed({get:()=>I.value.selectedBasemap??"",set:u=>{I.value.selectedBasemap=u}}),M=e.computed({get:()=>I.value.geometryVisible??!0,set:u=>{I.value.geometryVisible=u}}),w=e.computed(()=>{const u=n.height;return{height:typeof u=="number"?`${u}px`:String(u)}}),z=e.ref(!1),ne=e.ref(!1),We=e.computed(()=>z.value?"fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),we=e.computed(()=>{const u=["w-full","h-full"];return z.value||u.push(`min-h-[${w.value.height}]`),u.join(" ")}),pe=e.computed(()=>h.value),Le=()=>F?.(),Ke=e.ref(k??E.value??null),Ge=e.ref(n.zoom??f??null),Ze=e.ref(E.value);e.watch(E,u=>{Ze.value=u},{immediate:!0});const ze=e.computed(()=>Ze.value??null),W=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof Ge.value=="number"?Ge.value:gc),G=["home","fullscreen","scale","position"],p=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?G:n.tools.filter(u=>G.includes(u))),C=u=>p.value.includes(u);e.watch([S,Z],([u,O])=>{if(!(!u||!O)){if(!Ke.value){const H=u.getCenter();Ke.value=[H.lng,H.lat]}Ge.value==null&&(Ge.value=u.getZoom())}},{immediate:!0});const D=e.ref(null),U=e.ref(""),J=e.ref(null),q=u=>u?ne.value?!0:typeof u.isStyleLoaded=="function"&&u.isStyleLoaded()?(ne.value=!0,!0):!1:!1,le=u=>{if(!u)return"";const O=Number(u.lat??u[1]),H=Number(u.lng??u[0]);return!Number.isFinite(O)||!Number.isFinite(H)?"":`${H.toFixed(5)}, ${O.toFixed(5)}`},he=u=>{u?.lngLat&&(U.value=le(u.lngLat))},ie=()=>{U.value=""},et=u=>{u&&(u.on("mousemove",he),u.on("mouseleave",ie),J.value=u)},Me=u=>{u&&(u.off("mousemove",he),u.off("mouseleave",ie),J.value=null)},Mn=e.computed(()=>C("scale"));e.watch([S,Z],([u,O],[H])=>{H&&Me(H),!(!u||!O)&&et(u)},{immediate:!0}),e.watch([S,Z,Mn],([u,O,H])=>{if(D.value&&K&&(K(D.value),D.value=null),!u||!O||!H)return;const Y=window?.maplibregl;Y&&(D.value=new Y.ScaleControl({unit:"metric"}),P?.(D.value,"bottom-left"))},{immediate:!0});const je=e.computed(()=>Array.isArray(n.legend)?n.legend.map((u,O)=>{const H=typeof u?.color=="string"?u.color.trim():"",Y=typeof u?.label=="string"?u.label.trim():"";return!H||!Y?null:{color:H,label:Y,key:`${Y}-${O}`}}).filter(u=>!!u):[]),He=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(l.layers)&&l.layers.length?l.layers:[]);e.watch(d,u=>{if(T?.(u),!u.length){B.value="";return}u.some(O=>O.key===B.value)||(B.value=u[0].key)},{immediate:!0});const vt=()=>typeof window>"u"?"":window.location?.origin??"",tn=u=>{if(!u)return"";const O=u.trim();if(!O)return"";const Y=O.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!Y)return"";if(/^https?:\/\//i.test(Y))return Y;const Se=vt(),Ye=Y.replace(/^\/+/,"");return Se?`${Se}/${Ye}`:Ye?`/${Ye}`:""},Mt=u=>{if(!u?.getStyle)return;const O=u.getStyle()??{},H=Array.isArray(O.layers)?O.layers:[];return H.length?H.find(Se=>Se.type!=="background")?.id??H[0]?.id:void 0},Rt=u=>{u&&(u.getLayer(Wn)&&u.removeLayer(Wn),u.getSource(fn)&&u.removeSource(fn))},bt=(u,O)=>{if(!u)return;const H=Mt(u);u.addSource(fn,{type:"raster",tiles:[O],tileSize:256}),u.addLayer({id:Wn,type:"raster",source:fn,layout:{visibility:"visible"}},H)},Ft=u=>{if(!u)return;const O=tn(u.url);if(!O){Je.value=null;return}Je.value=O,Rt(S.value),kt()},Je=e.ref(null),Mo=u=>{if(!u||u.__pendingBasemapHooked)return;u.__pendingBasemapHooked=!0;const O=()=>{u.__pendingBasemapHooked=!1,kt()};u.once("style.load",O),u.once("styledata",O)},kt=()=>{const u=S.value,O=Je.value;if(!O||!u)return;if(!(typeof u.isStyleLoaded=="function"?u.isStyleLoaded():!0)){Mo(u);return}Rt(u),bt(u,O)},y=()=>{const u=B.value;if(!u)return;const O=d.value.find(H=>H.key===u);O&&Ft(O)};e.watch(B,()=>{y()},{immediate:!0}),e.watch(He,u=>{j.setOverlays?.(u)},{immediate:!0,deep:!0});const $=e.ref(null);let N=0;const _=e.computed(()=>Po($.value)),X={fill:{"fill-color":"#0ea5e9","fill-opacity":.25},line:{"line-color":"#0b74c4","line-width":2},circle:{"circle-color":"#0ea5e9","circle-stroke-color":"#ffffff","circle-stroke-width":2,"circle-radius":7,"circle-opacity":.95}},ae={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},te=e.ref(g),ue=e.ref(b),Re=e.ref(!1),se=e.computed(()=>{if(!ue.value)return null;const[u,O,H,Y]=ue.value;return[(u+H)/2,(O+Y)/2]}),Pt=e.computed(()=>!!ue.value),be=e.ref(!!b);e.ref(!1);const dt=()=>{z.value=!z.value},tt=e.ref(!1),Ue=()=>{const u=S.value;if(!u||!q(u))return;const O=te.value;if(!O){Et(u);return}let H=u.getSource(ot);H?H.setData(O):(u.addSource(ot,{type:"geojson",data:O}),Ro(u),H=u.getSource(ot)),kr(u,M.value?"visible":"none"),hu(),wr(),ue.value&&(!be.value&&(Re.value||!tt.value)?(u.fitBounds(ue.value,{padding:40,maxZoom:16,duration:0}),tt.value=!0,Re.value=!1):be.value&&(be.value=!1,Re.value=!1,tt.value=!0))},Ro=u=>{const O=X;u.getLayer(St)||u.addLayer({id:St,type:"fill",source:ot,paint:O.fill}),u.getLayer(_t)||u.addLayer({id:_t,type:"line",source:ot,paint:O.line}),u.getLayer(Bt)||u.addLayer({id:Bt,type:"circle",source:ot,paint:O.circle,filter:["==","$type","Point"]})},Et=u=>{[Bt,_t,St].forEach(O=>{u.getLayer(O)&&u.removeLayer(O)}),u.getSource(ot)&&u.removeSource(ot)},kr=(u,O)=>{q(u)&&[Bt,_t,St].forEach(H=>{u.getLayer(H)&&u.setLayoutProperty(H,"visibility",O)})},hu=()=>{const u=S.value;if(!u||!q(u))return;const O=X;u.getLayer(St)&&Object.entries(O.fill).forEach(([H,Y])=>{u.setPaintProperty(St,H,Y)}),u.getLayer(_t)&&Object.entries(O.line).forEach(([H,Y])=>{u.setPaintProperty(_t,H,Y)}),u.getLayer(Bt)&&Object.entries(O.circle).forEach(([H,Y])=>{u.setPaintProperty(Bt,H,Y)})},Er=u=>{u.getLayer(pn)||u.addLayer({id:pn,type:"line",source:Ct,layout:{visibility:"visible"},paint:ae})},wr=()=>{const u=S.value;if(!u||!q(u))return;const O=_.value??{type:"FeatureCollection",features:[]};if(!u.getSource(Ct)){u.addSource(Ct,{type:"geojson",data:O}),Er(u);return}const H=u.getSource(Ct);H&&typeof H.setData=="function"&&H.setData(O),Er(u)},gu=u=>{u.getLayer(pn)&&u.removeLayer(pn),u.getSource(Ct)&&u.removeSource(Ct)},yu=async u=>{const O=typeof u=="string"?u.trim():"",H=++N;if(!O){$.value=null;return}try{const Y=await fetch(`https://data.gki.com.ua/api-user/atu/${O}`);if(N!==H)return;if(!Y.ok){$.value=null;return}const Se=await Y.json();if(N!==H)return;$.value=Se}catch{if(N!==H)return;$.value=null}};e.watch(c,u=>{yu(u)},{immediate:!0}),e.watch(_,()=>{wr()},{immediate:!0}),e.watch(()=>n.geom,u=>{te.value=Po(u),ue.value=xr(te.value),se.value&&(Ke.value=se.value),tt.value=!1,Re.value=!0,Ue()},{deep:!0,immediate:!0}),e.watch(M,()=>{const u=S.value;u&&q(u)&&kr(u,M.value?"visible":"none")});const wt=()=>{ne.value=!0,Ue(),kt()},Fo=()=>{Ue()};e.watch(S,(u,O)=>{O&&(O.off("style.load",wt),O.off("load",wt),O.off("idle",Fo)),ne.value=!1,u&&(u.on("load",wt),u.on("style.load",wt),u.on("idle",Fo),typeof u.isStyleLoaded=="function"&&u.isStyleLoaded()&&wt())}),e.watch(x,u=>{!S.value||!u||Pt.value||L(u)}),e.watch(()=>n.zoom,u=>{!S.value||typeof u!="number"||R(u)}),e.onBeforeUnmount(()=>{D.value&&K&&K(D.value),J.value?Me(J.value):S.value&&Me(S.value);const u=S.value;u&&(gu(u),u.off("style.load",wt),u.off("load",wt),u.off("idle",Fo))});function vu(u){u&&(B.value=u)}function bu(u){M.value=u}j.setBasemap=vu,j.toggleGeometry=bu,j.setOverlays?.(He.value);function Po(u){if(!u)return null;if(u.type==="FeatureCollection")return u;if(u.type==="Feature")return{type:"FeatureCollection",features:[u]};const O=u.geometry??u;if(!O?.type)return null;if(O.type==="GeometryCollection"&&Array.isArray(O.geometries)){const H=O.geometries.filter(Y=>Y&&typeof Y.type=="string").map(Y=>({type:"Feature",geometry:Y}));return H.length?{type:"FeatureCollection",features:H}:null}if(O.type==="MultiPoint"&&Array.isArray(O.coordinates)){const H=O.coordinates.filter(Y=>Array.isArray(Y)&&Y.length>=2).map(Y=>({type:"Feature",geometry:{type:"Point",coordinates:Y}}));return H.length?{type:"FeatureCollection",features:H}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:O}]}}function xr(u){if(!u?.features?.length)return null;let O=1/0,H=1/0,Y=-1/0,Se=-1/0;const Ye=nn=>{if(typeof nn[0]=="number"){const[xt,Nr]=nn;O=Math.min(O,xt),H=Math.min(H,Nr),Y=Math.max(Y,xt),Se=Math.max(Se,Nr);return}nn.forEach(xt=>Ye(xt))};return u.features.forEach(nn=>{const xt=nn?.geometry?.coordinates;xt&&Ye(xt)}),O===1/0||H===1/0?null:[O,H,Y,Se]}return(u,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(We.value),style:e.normalizeStyle(z.value?void 0:w.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:v,class:e.normalizeClass(we.value)},null,2),e.createVNode(Ra,{items:je.value},null,8,["items"]),C("search")?(e.openBlock(),e.createBlock(tc,{key:0})):e.createCommentVNode("",!0),C("home")||C("fullscreen")?(e.openBlock(),e.createElementBlock("div",rc,[C("home")?(e.openBlock(),e.createElementBlock("div",ic,[e.createVNode(es,{center:ze.value,zoom:W.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(es,{key:0,"target-center":se.value,"target-zoom":W.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C("fullscreen")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 pointer-events-auto",onClick:dt,"aria-label":z.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...O[0]||(O[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)])],8,lc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),pe.value?(e.openBlock(),e.createElementBlock("div",ac,[e.createElementVNode("button",{type:"button",class:"absolute top-2 right-2 h-6 w-6 flex items-center justify-center rounded-full text-slate-500 hover:text-slate-900","aria-label":"Закрити",onClick:Le},[...O[1]||(O[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",cc,e.toDisplayString(pe.value.title||"Об'єкт"),1),pe.value.html?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["text-[0.75rem] text-slate-700 leading-relaxed overflow-auto",`max-h-[calc(${w.value.height}-120px)]`]),innerHTML:pe.value.html},null,10,dc)):(e.openBlock(),e.createElementBlock("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.rows,H=>(e.openBlock(),e.createElementBlock("div",{key:H.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",pc,e.toDisplayString(H.label)+":",1),e.createElementVNode("span",uc,e.toDisplayString(H.value),1)]))),128))])),pe.value.actions?.length?(e.openBlock(),e.createElementBlock("div",mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.actions,H=>(e.openBlock(),e.createElementBlock("a",{key:H.url,class:"bg-sky-600 hover:bg-sky-700 transition-colors text-white font-semibold text-center py-[0.55rem] rounded-md w-full",href:H.url,target:H.target??void 0,rel:"noreferrer"},e.toDisplayString(H.label),9,hc))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Da),C("position")&&U.value?(e.openBlock(),e.createBlock(za,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:U.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});function qe(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const yc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kn=()=>{},mn=()=>!1,Gn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),st=Object.assign,Xe=Array.isArray,ve=t=>typeof t=="string",Zn=t=>typeof t=="symbol",vc=t=>t!==null&&typeof t=="object",ts=qe(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),bc=qe("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Jn=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},kc=/-\w/g,rt=Jn(t=>t.replace(kc,n=>n.slice(1).toUpperCase())),Yn=Jn(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ec=Jn(t=>t?`on${Yn(t)}`:""),jt={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"NEED_HYDRATION",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"CACHED",[-2]:"BAIL"},wc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},xc=/;(?![^(]*\))/g,Nc=/:([^]+)/,Cc=/\/\*[^]*?\*\//g;function Sc(t){const n={};return t.replace(Cc,"").split(xc).forEach(o=>{if(o){const s=o.split(Nc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const _c="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Bc="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",$c="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Tc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Lc=qe(_c),Ac=qe(Bc),Ic=qe($c),Dc=qe(Tc);const Ht=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Ut=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),hn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),ns=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),ft=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),os=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),ss=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),qt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),eo=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),rs=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),to=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),no=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),oo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),so=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),ro=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),io=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),is=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),ls=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),gn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),yn=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),lo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),ao=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Wt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Kt=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),co=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),fo=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Oc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),po=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),vn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Mc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Rc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),uo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Fc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Pc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),mo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),as=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),$t={[Ht]:"Fragment",[Ut]:"Teleport",[Xn]:"Suspense",[hn]:"KeepAlive",[ns]:"BaseTransition",[ft]:"openBlock",[os]:"createBlock",[ss]:"createElementBlock",[Qn]:"createVNode",[Vn]:"createElementVNode",[qt]:"createCommentVNode",[eo]:"createTextVNode",[rs]:"createStaticVNode",[to]:"resolveComponent",[no]:"resolveDynamicComponent",[oo]:"resolveDirective",[so]:"resolveFilter",[ro]:"withDirectives",[io]:"renderList",[is]:"renderSlot",[ls]:"createSlots",[gn]:"toDisplayString",[yn]:"mergeProps",[lo]:"normalizeClass",[ao]:"normalizeStyle",[Wt]:"normalizeProps",[Kt]:"guardReactiveProps",[co]:"toHandlers",[fo]:"camelize",[Oc]:"capitalize",[po]:"toHandlerKey",[vn]:"setBlockTracking",[Mc]:"pushScopeId",[Rc]:"popScopeId",[uo]:"withCtx",[Fc]:"unref",[Pc]:"isRef",[mo]:"withMemo",[as]:"isMemoSame"};function zc(t){Object.getOwnPropertySymbols(t).forEach(n=>{$t[n]=t[n]})}const Ae={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function jc(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Ae}}function Gt(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,m=Ae){return t&&(a?(t.helper(ft),t.helper(At(t.inSSR,d))):t.helper(Lt(t.inSSR,d)),i&&t.helper(ro)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function pt(t,n=Ae){return{type:17,loc:n,elements:t}}function Oe(t,n=Ae){return{type:15,loc:n,properties:t}}function me(t,n){return{type:16,loc:Ae,key:ve(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Ae,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function Fe(t,n=Ae){return{type:8,loc:n,children:t}}function ye(t,n=[],o=Ae){return{type:14,loc:o,callee:t,arguments:n}}function Tt(t,n=void 0,o=!1,s=!1,r=Ae){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function ho(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Ae}}function Hc(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Ae}}function Uc(t){return{type:21,body:t,loc:Ae}}function Lt(t,n){return t||n?Qn:Vn}function At(t,n){return t||n?os:ss}function go(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(Lt(s,t.isComponent)),n(ft),n(At(s,t.isComponent)))}const cs=new Uint8Array([123,123]),ds=new Uint8Array([125,125]);function fs(t){return t>=97&&t<=122||t>=65&&t<=90}function Ie(t){return t===32||t===10||t===9||t===12||t===13}function it(t){return t===47||t===62||Ie(t)}function bn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const ke={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class qc{constructor(n,o){this.stack=n,this.cbs=o,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=cs,this.delimiterClose=ds,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return this.mode===2&&this.stack.length===0}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=cs,this.delimiterClose=ds}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let l=-1;if(r>100){let i=-1,a=r;for(;i+1<a;){const c=i+a>>>1;this.newlines[c]<n?i=c:a=c}l=i}else for(let i=r-1;i>=0;i--)if(n>this.newlines[i]){l=i;break}return l>=0&&(o=l+2,s=n-this.newlines[l]),{column:s,line:o,offset:n}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(n){n===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n))}stateInterpolationOpen(n){if(n===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const o=this.index+1-this.delimiterOpen.length;o>this.sectionStart&&this.cbs.ontext(this.sectionStart,o),this.state=3,this.sectionStart=o}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(n)):(this.state=1,this.stateText(n))}stateInterpolation(n){n===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(n))}stateInterpolationClose(n){n===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(n))}stateSpecialStartSequence(n){const o=this.sequenceIndex===this.currentSequence.length;if(!(o?it(n):(n|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!o){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(n)}stateInRCDATA(n){if(this.sequenceIndex===this.currentSequence.length){if(n===62||Ie(n)){const o=this.index-this.currentSequence.length;if(this.sectionStart<o){const s=this.index;this.index=o,this.cbs.ontext(this.sectionStart,o),this.index=s}this.sectionStart=o+2,this.stateInClosingTagName(n),this.inRCDATA=!1;return}this.sequenceIndex=0}(n|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===ke.TitleEnd||this.currentSequence===ke.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(n===60)}stateCDATASequence(n){n===ke.Cdata[this.sequenceIndex]?++this.sequenceIndex===ke.Cdata.length&&(this.state=28,this.currentSequence=ke.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(n))}fastForwardTo(n){for(;++this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);if(o===10&&this.newlines.push(this.index),o===n)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(n){n===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===ke.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):n!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(n,o){this.enterRCDATA(n,o),this.state=31}enterRCDATA(n,o){this.inRCDATA=!0,this.currentSequence=n,this.sequenceIndex=o}stateBeforeTagName(n){n===33?(this.state=22,this.sectionStart=this.index+1):n===63?(this.state=24,this.sectionStart=this.index+1):fs(n)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:n===116?this.state=30:this.state=n===115?29:6):n===47?this.state=8:(this.state=1,this.stateText(n))}stateInTagName(n){it(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(it(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(bn("</"+o),0),this.handleTagName(n)}}handleTagName(n){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)}stateBeforeClosingTagName(n){Ie(n)||(n===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=fs(n)?9:27,this.sectionStart=this.index))}stateInClosingTagName(n){(n===62||Ie(n))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(n))}stateAfterClosingTagName(n){n===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(n){n===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):n===47?(this.state=7,process.env.NODE_ENV!=="production"&&this.peek()!==62&&this.cbs.onerr(22,this.index)):n===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):Ie(n)||(process.env.NODE_ENV!=="production"&&n===61&&this.cbs.onerr(19,this.index),this.handleAttrStart(n))}handleAttrStart(n){n===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):n===46||n===58||n===64||n===35?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(n){n===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):Ie(n)||(this.state=11,this.stateBeforeAttrName(n))}stateInAttrName(n){n===61||it(n)?(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):process.env.NODE_ENV!=="production"&&(n===34||n===39||n===60)&&this.cbs.onerr(17,this.index)}stateInDirName(n){n===61||it(n)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):n===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(n){n===61||it(n)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===91?this.state=15:n===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(n){n===93?this.state=14:(n===61||it(n))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(n),process.env.NODE_ENV!=="production"&&this.cbs.onerr(27,this.index))}stateInDirModifier(n){n===61||it(n)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(n){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(n)}stateAfterAttrName(n){n===61?this.state=18:n===47||n===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)):Ie(n)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(n))}stateBeforeAttrValue(n){n===34?(this.state=19,this.sectionStart=this.index+1):n===39?(this.state=20,this.sectionStart=this.index+1):Ie(n)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(n))}handleInAttrValue(n,o){(n===o||this.fastForwardTo(o))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(n){this.handleInAttrValue(n,34)}stateInAttrValueSingleQuotes(n){this.handleInAttrValue(n,39)}stateInAttrValueNoQuotes(n){Ie(n)||n===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(n)):(process.env.NODE_ENV!=="production"&&n===34||n===39||n===60||n===61||n===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(n){n===91?(this.state=26,this.sequenceIndex=0):this.state=n===45?25:23}stateInDeclaration(n){(n===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(n){(n===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(n){n===45?(this.state=28,this.currentSequence=ke.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(n){(n===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(n){n===ke.ScriptEnd[3]?this.startSpecial(ke.ScriptEnd,4):n===ke.StyleEnd[3]?this.startSpecial(ke.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===ke.TitleEnd[3]?this.startSpecial(ke.TitleEnd,4):n===ke.TextareaEnd[3]?this.startSpecial(ke.TextareaEnd,4):(this.state=6,this.stateInTagName(n))}startEntity(){}stateInEntity(){}parse(n){for(this.buffer=n;this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);switch(o===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(o);break}case 2:{this.stateInterpolationOpen(o);break}case 3:{this.stateInterpolation(o);break}case 4:{this.stateInterpolationClose(o);break}case 31:{this.stateSpecialStartSequence(o);break}case 32:{this.stateInRCDATA(o);break}case 26:{this.stateCDATASequence(o);break}case 19:{this.stateInAttrValueDoubleQuotes(o);break}case 12:{this.stateInAttrName(o);break}case 13:{this.stateInDirName(o);break}case 14:{this.stateInDirArg(o);break}case 15:{this.stateInDynamicDirArg(o);break}case 16:{this.stateInDirModifier(o);break}case 28:{this.stateInCommentLike(o);break}case 27:{this.stateInSpecialComment(o);break}case 11:{this.stateBeforeAttrName(o);break}case 6:{this.stateInTagName(o);break}case 34:{this.stateInSFCRootTagName(o);break}case 9:{this.stateInClosingTagName(o);break}case 5:{this.stateBeforeTagName(o);break}case 17:{this.stateAfterAttrName(o);break}case 20:{this.stateInAttrValueSingleQuotes(o);break}case 18:{this.stateBeforeAttrValue(o);break}case 8:{this.stateBeforeClosingTagName(o);break}case 10:{this.stateAfterClosingTagName(o);break}case 29:{this.stateBeforeSpecialS(o);break}case 30:{this.stateBeforeSpecialT(o);break}case 21:{this.stateInAttrValueNoQuotes(o);break}case 7:{this.stateInSelfClosingTag(o);break}case 23:{this.stateInDeclaration(o);break}case 22:{this.stateBeforeDeclaration(o);break}case 25:{this.stateBeforeComment(o);break}case 24:{this.stateInProcessingInstruction(o);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const n=this.buffer.length;this.sectionStart>=n||(this.state===28?this.currentSequence===ke.CdataEnd?this.cbs.oncdata(this.sectionStart,n):this.cbs.oncomment(this.sectionStart,n):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,n))}emitCodePoint(n,o){}}const Wc={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:t=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${t}.sync\` should be changed to \`v-model:${t}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function yo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function lt(t,n){const o=yo("MODE",n),s=yo(t,n);return o===3?s===!0:s!==!1}function It(t,n,o,...s){const r=lt(t,n);return process.env.NODE_ENV!=="production"&&r&&kn(t,n,o,...s),r}function kn(t,n,o,...s){if(yo(t,n)==="suppress-warning")return;const{message:l,link:i}=Wc[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
1
+ (function(ge,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(ge=typeof globalThis<"u"?globalThis:ge||self,e(ge.WidgetLib={},ge.Vue,ge.OpenGISCore))})(this,(function(ge,e,xe){"use strict";function Cr(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Sr=Cr(e);const zo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_r=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Br=t=>{const n=_r(t);return n.charAt(0).toUpperCase()+n.slice(1)},$r=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var on={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Tr=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>e.h("svg",{...on,width:t||on.width,height:t||on.height,stroke:s||on.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:$r("lucide",...l?[`lucide-${zo(Br(l))}-icon`,`lucide-${zo(l)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const ce=(t,n)=>(o,{slots:s})=>e.h(Tr,{...o,iconNode:n,name:t},s);const Lr=ce("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const Ar=ce("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Ir=ce("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const jo=ce("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);const Dr=ce("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const Nt=ce("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Or=ce("file",[["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"}]]);const Mr=ce("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Rr=ce("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);const Fr=ce("history",[["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"}]]);const Pr=ce("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const Ho=ce("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const zr=ce("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);const jr=ce("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const Uo=ce("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Hr=ce("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);const qo=ce("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Ur=ce("sheet",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]);const qr=ce("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);const Rn=ce("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Wr=ce("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const Fn=ce("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const Kr=ce("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);const Pn=ce("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Gr={class:"border-t pt-3 mt-4"},Zr={class:"flex gap-2"},Jr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Yr={class:"flex-1 space-y-2"},Xr={class:"flex justify-between items-center"},Qr={class:"flex gap-2"},Vr=["disabled"],Wo=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(t,{emit:n}){const o=e.useModel(t,"isReply"),s=e.ref(""),r=n,l=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},i=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),l())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Gr,[e.createElementVNode("div",Zr,[e.createElementVNode("span",Jr,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Yr,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),onKeydown:i,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[e.vModelText,s.value]]),e.createElementVNode("div",Xr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",Qr,[o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:c[1]||(c[1]=d=>o.value=!1)},[e.createVNode(e.unref(Pn),{class:"h-3 w-3"}),c[2]||(c[2]=e.createTextVNode(" Cancel ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!s.value.trim(),onClick:l},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Vr)])])])])]))}}),ei={class:"z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto"},ti=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(t,{emit:n}){const o=n,s=e.useModel(t,"showMoreOptions"),r=e.ref(),l=e.ref(!0),i=async d=>{s.value&&r.value&&!r.value.contains(d.target)&&!l.value&&(s.value=!1),l.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",i)}),e.onUnmounted(()=>{document.removeEventListener("click",i)}),(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:r},[e.createElementVNode("div",ei,[e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",onClick:a},[e.createVNode(e.unref(qr),{class:"h-3 w-3 mr-2"}),m[0]||(m[0]=e.createTextVNode(" Edit ",-1))]),e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",onClick:c},[e.createVNode(e.unref(Rn),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),ni={class:"space-y-2"},oi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},si={class:"flex-1 min-w-0 space-y-1 relative"},ri={class:"flex items-center gap-2"},ii={class:"font-medium text-xs"},li={class:"text-xs text-gray-500"},ai={key:0,class:"text-xs text-gray-700 leading-relaxed"},ci={class:"flex justify-between text-xs"},di={class:"flex items-center gap-2"},fi={key:0,class:"flex gap-2"},pi=["disabled"],ui={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},mi=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(t,{emit:n}){const o=n,s=t,r=e.ref(s.comment.text),l=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),i=e.ref("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"),a=e.ref(!1),c=e.ref(!1),d=e.ref(!1),m=e.ref(!1),f=x=>{const E=new Date,j=Math.floor((E.getTime()-x.getTime())/(1e3*60*60));return j<1?`${Math.floor((E.getTime()-x.getTime())/6e4)}m`:j<24?`${j}h`:`${Math.floor(j/24)}d`},g=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},b=()=>{o("edit",s.comment.id,r.value),d.value=!1},k=(x,E)=>{o("like",x,E)},v=(x,E)=>{o("edit",x,E)};return(x,E)=>{const j=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",ni,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",d.value?"bg-gray-50":""])},[e.createElementVNode("span",oi,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",si,[e.createElementVNode("div",ri,[e.createElementVNode("span",ii,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",li,e.toDisplayString(f(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":E[0]||(E[0]=S=>r.value=S),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",ai,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",m.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:E[1]||(E[1]=S=>g())},[e.createVNode(e.unref(Rr),{class:e.normalizeClass(["h-3 w-3",m.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.comment?.likes),1)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:E[2]||(E[2]=S=>c.value=!0)},[e.createVNode(e.unref(Hr),{class:"h-3 w-3"})])),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:E[3]||(E[3]=S=>a.value=!0)},[e.createVNode(e.unref(Dr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",fi,[e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:E[4]||(E[4]=S=>d.value=!1)},[e.createVNode(e.unref(Pn),{class:"h-3 w-3"}),E[11]||(E[11]=e.createTextVNode(" Cancel ",-1))]),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!r.value.trim(),onClick:E[5]||(E[5]=S=>b())},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),E[12]||(E[12]=e.createTextVNode(" Send ",-1))],8,pi)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(ti,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":E[6]||(E[6]=S=>a.value=S),onEdit:E[7]||(E[7]=S=>d.value=!0),onDelete:E[8]||(E[8]=S=>x.$emit("delete",t.comment?.id)),comment:t.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,S=>(e.openBlock(),e.createBlock(j,{key:S.id,comment:S,isInside:!0,onDelete:L=>x.$emit("delete",S.id),onLike:k,onEdit:v},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Wo,{key:0,onSendComment:E[9]||(E[9]=S=>x.$emit("reply",t.comment?.id,S)),isReply:c.value,"onUpdate:isReply":E[10]||(E[10]=S=>c.value=S)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),hi=["id"],gi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},sn=e.defineComponent({__name:"CommentsWidget",props:{title:{},comments:{},maxHeight:{},onAddComment:{type:Function},onReply:{type:Function},onLike:{type:Function},onDelete:{type:Function},onEdit:{type:Function},id:{},className:{},style:{}},emits:["add","reply","like","delete","edit"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(o.comments??[]);async function l(){if(!o.id)return;const f=await fetch(`/api/widget/comment/${o.id}`).then(g=>g.json());r.value=f.rows.map(g=>({id:g.communication_id,author:g.username,text:g.body,createdAt:new Date(g.cdate)}))}r.value.length===0&&l();const i=async f=>{o.onAddComment?o.onAddComment(f):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:f})}),await l()),s("add",f)},a=(f,g)=>{o?.onLike?.(f,g),s("like",f,g)},c=(f,g)=>{o.onReply?.(f,g),s("reply",f,g)},d=async(f,g)=>{o.onEdit?o.onEdit(f,g):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:g})}),await l()),s("edit",f,g)},m=async f=>{o.onDelete?o.onDelete(f):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"DELETE"}),await l()),s("delete",f)};return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",gi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([t.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,b=>(e.openBlock(),e.createBlock(mi,{key:b.id,comment:b,onReply:c,onLike:a,onDelete:g[0]||(g[0]=k=>m(k)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Wo,{onSendComment:g[1]||(g[1]=b=>i(b))})],14,hi))}}),Ko=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Nt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ur}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Wr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Fr}]]),yi={class:"mx-auto font-sans"},vi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},bi={class:"relative"},ki={class:"space-y-3"},Ei={class:"flex-1 min-w-0 pb-2"},wi={class:"flex items-center gap-1.5 mb-1 mt-0.5"},xi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Ni={class:"font-medium text-xs"},Ci={class:"text-xs text-gray-500"},Si={class:"space-y-1"},_i={class:"text-xs text-gray-700"},Bi={class:"capitalize mr-1"},$i={key:0,class:"inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"},Ti={key:0,class:"flex items-center gap-1 text-xs"},Li={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Ai={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},rn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?n.data:[]);o.value.length===0&&n.id&&s();async function s(){const r=await fetch(`/api/widget/history/${n.id}`);if(!r.ok)return{data:[]};const l=await r.json();l.rows.forEach(i=>{i.timestamp=new Date(i.cdate),i.id=i.entity_id,i.entityType=i.entity_type,i.entityId=i.entity_id,i.action=i.change_type,i.userId=i.change_user_id,i.userName=i.username,i.timestamp=new Date(i.cdate),i.description=i.username,i.status=i.username}),o.value=l.rows}return(r,l)=>(e.openBlock(),e.createElementBlock("div",yi,[t.title?(e.openBlock(),e.createElementBlock("h3",vi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[e.createElementVNode("div",bi,[l[0]||(l[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:i?.id},[e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${e.unref(Ko).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ko).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",Ei,[e.createElementVNode("div",wi,[e.createElementVNode("span",xi,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",Ni,e.toDisplayString(i?.userName),1),e.createElementVNode("span",Ci,e.toDisplayString(i?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+e.toDisplayString(i?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",Si,[e.createElementVNode("div",_i,[e.createElementVNode("span",Bi,e.toDisplayString(i?.action),1),i?.entityId?(e.openBlock(),e.createElementBlock("span",$i,e.toDisplayString(i?.entityId),1)):e.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(e.openBlock(),e.createElementBlock("div",Ti,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",Li,e.toDisplayString(i?.changes?.[i?.entityId]?.old),1)):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.old&&i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(Ar),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Ai,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Ii={key:0,class:"text-xl font-semibold"},Di={class:"flex gap-1"},Oi={key:0},Mi=["accept"],Ri={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer"},Fi=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{},accept:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(t){const n=e.useModel(t,"modelValue"),o={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Ii,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?o.active:o.inactive]),onClick:r[0]||(r[0]=l=>n.value="list")},[e.createVNode(e.unref(zr),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?o.active:o.inactive]),onClick:r[1]||(r[1]=l=>n.value="grid")},[e.createVNode(e.unref(Mr),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Oi,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,40,Mi),e.createElementVNode("div",Ri,[e.createVNode(e.unref(Uo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),zn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Nt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Or,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Kr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Nt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Lr,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Nt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Nt,label:"PPT"}};function Go(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function Zo(t){if(t===0)return"0 B";const n=1024,o=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,s)).toFixed(1))} ${o[s]}`}const Pi={class:"space-y-0.5"},zi=["onClick"],ji=["onClick"],Hi={class:"flex items-center gap-2"},Ui={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},qi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Wi={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ki={class:"flex items-center gap-1"},Gi=["onClick"],Zi=["onClick"],Ji=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,s=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(zn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(zn)[s?.ext]?.icon||e.unref(zn).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:r=>n.$emit("openLightbox",s)},[e.createElementVNode("div",Hi,[e.createElementVNode("span",Ui,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,ji),e.createElementVNode("div",qi,e.toDisplayString(e.unref(Zo)(s.size)),1),e.createElementVNode("div",Wi,e.toDisplayString(e.unref(Go)(s.createdAt)),1),e.createElementVNode("div",Ki,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"},[e.createVNode(e.unref(jo),{class:"h-3 w-3"})],8,Gi),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",onClick:e.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"})],8,Zi)])],8,zi))),128))]))}}),Yi={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Xi=["onClick"],Qi={class:"space-y-2"},Vi={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},el=["src"],tl={class:"space-y-1"},nl=["title"],ol={class:"text-xs text-gray-500 text-left"},sl={class:"absolute top-2 right-1 flex items-center gap-1"},rl=["onClick"],il=["onClick"],ll=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"]),class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",Qi,[e.createElementVNode("div",Vi,[s.ext==="png"||s.ext==="jpg"||s.ext==="jpeg"||s.ext==="gif"||s.ext==="svg"||s.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${s?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,el)):(e.openBlock(),e.createBlock(e.unref(Nt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",tl,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:s.uploaded_name||s.name},e.toDisplayString(s.uploaded_name||s.name),9,nl),e.createElementVNode("p",ol,e.toDisplayString(e.unref(Go)(s.createdAt))+", "+e.toDisplayString(e.unref(Zo)(s.size)),1)])]),e.createElementVNode("div",sl,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50"},[e.createVNode(e.unref(jo),{class:"h-3 w-3"})],8,rl),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",onClick:e.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"})],8,il)])],8,Xi))),128))]))}}),al={class:"mx-auto font-sans"},cl={key:1},ln=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},format:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=e.ref(!1),r=e.ref(null),l=e.ref(!1),i=e.ref(0),a=e.ref(o.files??[]),c=e.computed(()=>{const h=(o.format??[]).map(F=>typeof F=="string"?F.trim():F==null?"":String(F).trim()).filter(F=>F.length>0),T=[];return h.forEach(F=>{const P=F.toLowerCase(),K=P.indexOf("/"),Z=K>=0;let B,M=!1,w;if(Z){B=P;const ne=P.slice(K+1);M=ne==="*",!M&&ne&&(w=`.${ne.replace(/^\.+/,"")}`)}else w=P.startsWith(".")?P:`.${P.replace(/^\.+/,"")}`;const z=Z?B:w??"";z&&T.push({acceptValue:z,mime:B,wildcard:M,extension:w})}),T.length?T:null}),d=e.computed(()=>{const A=c.value;if(!A)return;const h=A.map(T=>T.acceptValue).filter(Boolean);return h.length?h.join(","):void 0}),m=A=>{if(!c.value)return!0;const h=A.type?.toLowerCase(),T=A.name?.toLowerCase();return c.value.some(F=>{if(F.mime){if(h){if(F.wildcard){const P=F.mime.split("/")[0];if(h.startsWith(`${P}/`))return!0}else if(h===F.mime)return!0}return!!(F.extension&&T?.endsWith(F.extension))}return!!(F.extension&&T?.endsWith(F.extension))})},f=n;a.value.length===0&&L();const g=(A,h)=>{r.value=h,s.value=!0},b=()=>{r.value&&(E(r.value),r.value=null,s.value=!1)},k=e.computed(()=>Array.isArray(a.value)?a.value.map(A=>A?.file_path):[]),v=A=>{const h=k.value.findIndex(T=>T===A.file_path);h!==-1&&(l.value=!0,i.value=h)},x=A=>{o.onAddFile?o.onAddFile(A):R(A),f("add",A)},E=A=>{o.onDelete?o.onDelete(A):I(A),f("delete",A)},j=A=>{const h=document.createElement("a");h.setAttribute("download",A?.uploaded_name||A?.name),h.href=A?.file_path||A?.path,h.click()},S=e.ref("list");async function L(){if(!o.id)return;const A=await fetch(`/api/widget/file/${o.id}`).then(h=>h.json());A.rows.forEach(h=>{h.timestamp=new Date(h.cdate),h.id=h.entity_id,h.entityType=h.entity_type,h.entityId=h.entity_id,h.entityType=h.entity_type,h.action=h.change_type,h.userId=h.change_user_id,h.userName=h.username,h.timestamp=new Date(h.cdate),h.description=h.username,h.status=h.username}),a.value=A.rows}const R=async A=>{const T=A.target?.files;if(!T||T.length===0)return;const F=Array.from(T),P=[],K=[];if(F.forEach(Z=>{m(Z)?P.push(Z):K.push(Z)}),K.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${K.map(Z=>Z.name).join(", ")}`),P.length!==0)try{await Promise.all(P.map(async Z=>{const B=new FormData;B.append("file",Z);const M=`/api/widget/file/${o.id}`,w=await fetch(M,{method:"POST",body:B});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);return Z})),await L()}catch(Z){console.error("Помилка при завантаженні файлів:",Z)}},I=async A=>{try{await fetch(`/api/widget/file/${o.id}/${A}`,{method:"DELETE"}),await L()}catch(h){console.error(h)}};return(A,h)=>{const T=e.resolveComponent("MessageBox"),F=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",al,[e.createVNode(Fi,{modelValue:S.value,"onUpdate:modelValue":h[0]||(h[0]=P=>S.value=P),title:o.title,onOnAddFile:h[1]||(h[1]=P=>x(P)),editable:o.editable,accept:d.value},null,8,["modelValue","title","editable","accept"]),a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[S.value==="list"?(e.openBlock(),e.createBlock(Ji,{key:0,onDelete:g,onDownload:j,onOpenLightbox:h[2]||(h[2]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),S.value==="grid"?(e.openBlock(),e.createBlock(ll,{key:1,onDelete:g,onDownload:j,onOpenLightbox:h[3]||(h[3]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",cl,[...h[6]||(h[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),e.createVNode(T,{modelValue:s.value,"onUpdate:modelValue":h[4]||(h[4]=P=>s.value=P),onConfirm:b,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(F,{modelValue:l.value,"onUpdate:modelValue":h[5]||(h[5]=P=>l.value=P),images:k.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),dl={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},fl=["onClick"],pl={key:0,rel:"noreferrer",class:"relative block h-full w-full"},ul=["src"],ml={key:0,class:"thumb-cover"},hl=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},format:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(t,{emit:n}){const o=n,s=e.ref(!1),r=e.ref(0),l=t,i=e.computed(()=>Array.isArray(l.items)?l.items.map(c=>c?.file_path):[]),a=c=>{const d=i.value.findIndex(m=>m===c.file_path);d!==-1&&(s.value=!0,r.value=d)};return(c,d)=>{const m=e.resolveComponent("Lightbox");return t.items?.length>=1?(e.openBlock(),e.createElementBlock("div",dl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+g,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:g,onClick:e.withModifiers(b=>a(f),["stop"])},[g<5?(e.openBlock(),e.createElementBlock("div",pl,[e.createElementVNode("img",{src:`/file/resize?filepath=${f?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",g===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,ul),g===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",ml," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,fl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-t.items.length),f=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+f,class:e.normalizeClass(["h-full w-full image"+(t.items.length+f-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=f=>o("delete",f))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),gl={key:0,class:"text-xl font-semibold"},yl={class:"flex gap-1"},vl=["accept"],bl={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer"},kl=e.defineComponent({__name:"widgetHeader",props:{title:{},accept:{}},emits:["onAddImage"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",gl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",yl,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",accept:t.accept??"image/*",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s)),multiple:""},null,40,vl),e.createElementVNode("div",bl,[e.createVNode(e.unref(Uo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),El={class:"w-full mx-auto font-sans",ref:"containerRef"},wl={key:1},an=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},format:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=L=>{if(!L)return[];const R=Array.isArray(L)?L:L.split(",");return Array.from(new Set(R.map(I=>I.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],l=e.computed(()=>{const L=s(o.format);return L.length>0?L:void 0}),i=e.computed(()=>{const L=l.value;return!L||L.length===0?"image/*":L.map(R=>R.startsWith(".")?R:`.${R}`).join(",")}),a=L=>L?.split(".").pop()?.toLowerCase()??"",c=L=>{const R=L?.toLowerCase();return!!R&&!!l.value&&l.value.includes(R)},d=L=>{const R=L?.toLowerCase();return!!R&&r.includes(R)},m=L=>{const R=L.type?.toLowerCase(),I=L.ext?.toLowerCase();return R?.startsWith("image/")?l.value?c(I):!0:I?l.value?c(I):d(I):!1},f=L=>{if(!L.type?.toLowerCase()?.startsWith("image/"))return!1;if(!l.value)return!0;const I=a(L.name);return c(I)},g=L=>L.filter(m),b=e.ref(g(o.items??[])),k=n;b.value.length===0&&j();const v=L=>{o.onAddImage?o.onAddImage(L):E(L),k("add",L)},x=L=>{const R=b.value.find(I=>I.file_path===L)?.file_id;R&&(o.onDelete?o.onDelete(R):S(R))},E=async L=>{const R=L.target;if(!R?.files||R.files.length===0)return;const I=Array.from(R.files),A=I.filter(T=>f(T)),h=l.value?.join(", ")??"image/*";if(A.length===0){console.warn(`Допустимі формати: ${h}. Завантажте зображення дозволеного типу.`);return}A.length!==I.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${h}.`);try{await Promise.all(A.map(async T=>{const F=new FormData;F.append("file",T);const P=`/api/widget/file/${o.id}`,K=await fetch(P,{method:"POST",body:F});if(!K.ok)throw new Error(`HTTP error! status: ${K.status}`);return T})),await j()}catch(T){console.error("Помилка при завантаженні файлів:",T)}};async function j(){if(!o.id)return;const L=await fetch(`/api/widget/file/${o.id}`).then(R=>R.json());b.value=g(L.rows)}const S=async L=>{try{await fetch(`/api/widget/file/${o.id}/${L}`,{method:"DELETE"}),await j()}catch(R){console.error(R)}};return(L,R)=>(e.openBlock(),e.createElementBlock("div",El,[e.createVNode(kl,{title:t.title,accept:i.value,onOnAddImage:R[0]||(R[0]=I=>v(I))},null,8,["title","accept"]),b.value.length>0?(e.openBlock(),e.createBlock(hl,{key:0,items:b.value,onDelete:R[1]||(R[1]=I=>x(I))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",wl,[...R[2]||(R[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),xl={class:"text-value"},Nl={class:"text-sm text-gray-900"},Cl=e.defineComponent({__name:"TextValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;return typeof s=="boolean"?s?"Так":"Ні":s==null?"—":String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",xl,[e.createElementVNode("span",Nl,e.toDisplayString(o.value),1)]))}}),nt=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},Sl=nt(Cl,[["__scopeId","data-v-34a76c89"]]),_l={class:"link-value"},Bl=["href"],$l=nt(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=String(n.item.value);try{const r=new URL(s);return r.hostname+r.pathname}catch{return s}});return(s,r)=>(e.openBlock(),e.createElementBlock("div",_l,[e.createElementVNode("a",{href:String(t.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(o.value)+" ",1),r[0]||(r[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,Bl)]))}}),[["__scopeId","data-v-932f028c"]]),Tl={class:"date-value"},Ll={class:"text-sm text-gray-900"},Al=nt(e.defineComponent({__name:"DateValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;if(s instanceof Date)return s.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof s=="string"){const r=new Date(s);if(!isNaN(r.getTime()))return r.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",Tl,[e.createElementVNode("span",Ll,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),Il={class:"status-value"},Dl={key:0,class:"mr-1"},Ol=nt(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"bg-green-100 text-green-800";case"inactive":case"неактивний":case"pending":case"очікує":return"bg-yellow-100 text-yellow-800";case"error":case"помилка":case"failed":case"неуспішно":return"bg-red-100 text-red-800";case"draft":case"чернетка":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}}),s=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(r,l)=>(e.openBlock(),e.createElementBlock("div",Il,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.value])},[s.value?(e.openBlock(),e.createElementBlock("span",Dl,[e.createElementVNode("i",{class:e.normalizeClass(s.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(t.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),Ml={class:"custom-value"},Rl={class:"text-sm text-gray-900"},Fl=nt(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ml,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Rl,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),Pl=["id"],zl={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},jl={key:1,class:"overflow-x-auto"},Hl={class:"min-w-full divide-y divide-gray-200"},Ul={class:"bg-white divide-y divide-gray-200"},ql={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Wl={class:"flex items-center gap-2"},Kl=["title"],Gl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Zl={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Jl={class:"flex items-start gap-3"},Yl={key:0,class:"flex-shrink-0"},Xl={class:"flex-1 min-w-0"},Ql={class:"flex items-center gap-2 mb-2"},Vl={class:"text-sm font-medium text-gray-900"},ea=["title"],ta={key:3,class:"overflow-x-auto"},na={class:"min-w-full divide-y divide-gray-200"},oa={class:"bg-white divide-y divide-gray-200"},sa={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ra={class:"flex items-center gap-2"},ia=["title"],la={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},jn=nt(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return $l;case"date":return Al;case"status":return Ol;case"custom":return Fl;default:return Sl}};return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",zl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",jl,[e.createElementVNode("table",Hl,[e.createElementVNode("tbody",Ul,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",ql,[e.createElementVNode("div",Wl,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[0]||(s[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,Kl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Gl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Zl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id||r.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Jl,[r.icon?(e.openBlock(),e.createElementBlock("div",Yl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xl,[e.createElementVNode("div",Ql,[e.createElementVNode("h4",Vl,e.toDisplayString(r.label),1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[1]||(s[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,ea)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",ta,[e.createElementVNode("table",na,[e.createElementVNode("tbody",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",sa,[e.createElementVNode("div",ra,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[2]||(s[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,ia)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",la,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Pl))}}),[["__scopeId","data-v-106790ef"]]);function Jo(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(l=>l.src===t)){n();return}const r=document.createElement("script");r.src=t,r.async=!0,r.onload=()=>n(),r.onerror=()=>o(new Error(`Failed to load ${t}`)),document.body.appendChild(r)})}function aa(t){if(typeof document>"u"||Array.from(document.styleSheets||[]).some(s=>s.href===t))return;const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}const ca="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Hn=null;function da(){if(typeof window>"u")return;const t=window.IMask;if(typeof t=="function")return t;if(t&&typeof t.default=="function")return t.default}function fa(){return Hn||(Hn=Jo(ca).then(()=>{const t=da();if(!t)throw new Error("IMask is not available after loading the script");return t})),Hn}function pa(){return typeof window>"u"?"":window.location?.origin??""}function Yo(){if(!(typeof window>"u"))return window.maplibregl}const Xo=Symbol("vs-widget-map");function Un(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function ua(t){const n=['<div class="map-popup">'];return n.push('<div class="map-popup__body">'),t.forEach(o=>{n.push(`<div class="flex flex-col"><span class="font-bold text-slate-700">${o.label}: </span><span class="text-slate-700">${o.value}</span></div>`)}),n.push("</div></div>"),n.join("")}function ma(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function qn(t){if(!t)return"";const n=t.trim();if(!n)return"";const s=n.replace(/\\n/g,"").replace(/\\r/g,"").replace(/\\t/g,"").replace(/\s+/g,"");if(!s)return"";if(/^https?:\/\//i.test(s))return s;const r=pa(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function ha(t){const n=(t?.service??"").toLowerCase();if(n)return n;const o=(t?.url??"").toLowerCase();return/(\.mvt|\.pbf|\.vtile|\.vmt)(\?|$)/.test(o)?"vtile":/(\.png|\.jpg|\.jpeg|\.webp)(\?|$)/.test(o)?"raster":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(o)?"wms":""}function ga(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function cn(t){if(t!=null){if(typeof t=="number")return t;if(typeof t=="string"){const n=t.trim();if(!n)return;const o=Number(n);return Number.isFinite(o)?o:void 0}}}const Qo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function ya(t){const n=t?.color??Qo[0],o=(t?.colorAttr??"").trim();if(!o)return n;const s=t?.colorSet&&Object.keys(t.colorSet).length>0,r={};if(s&&t?.colorSet?Object.entries(t.colorSet).forEach(([i,a])=>{const c=typeof a=="string"?a.trim():"",d=String(i).trim();c&&d&&(r[d]=c)}):Qo.forEach((i,a)=>{r[String(a+1)]=i}),!Object.keys(r).length)return n;const l=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([i,a])=>{l.push(String(i),a)}),l.push(n),l}const zt="map-highlight-source",va="map-highlight-fill",ba="map-highlight-line";function ka(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function Vo(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function Ea(){return aa("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Jo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Yo()}function dn(t){const n=e.inject(Xo,void 0);if(!t){if(!n)throw new Error("useMap() must be called inside a map provider");return n}if(n)return n;const o=e.ref(null),s=e.ref(!1),r=e.ref({selectedBasemap:"",geometryVisible:!0,overlays:[]}),l=e.ref([]),i=e.ref([]),a=e.ref(null),c=e.ref(null),d=e.ref(null);let m=t.style??null,f=null;const g=p=>{p&&(o.value?o.value.setStyle(p):m=p)},b=()=>{r.value.overlays=i.value.map(p=>({id:p.id,name:p.config.name,visible:p.visible}))},k=p=>{const C=Array.isArray(p)?p:[];l.value=C,C.some(H=>H.key===r.value.selectedBasemap)||(r.value.selectedBasemap=C[0]?.key??"")},v=p=>{p&&i.value.forEach(C=>{C.layerIds.forEach(D=>{p.getLayer(D)&&p.removeLayer(D)}),p.getSource(C.sourceId)&&p.removeSource(C.sourceId),C.layerIds=[]})},x=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||(i.value.forEach(C=>{E(p,C)}),P())},E=(p,C)=>{const D=ha(C.config);D==="vtile"?S(p,C):D==="raster"&&j(p,C)},j=(p,C)=>{const D=C.config,H=C.sourceId,J=qn(D.url);if(!J)return;p.getSource(H)||p.addSource(H,{type:"raster",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const q=`${C.id}-raster`;p.getLayer(q)||p.addLayer({id:q,type:"raster",source:H,layout:{visibility:C.visible?"visible":"none"}}),C.layerIds=[q],L(p,C)},S=(p,C)=>{const D=C.config,H=C.sourceId,J=qn(D.url);if(!J)return;p.getSource(H)||p.addSource(H,{type:"vector",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const q=D.style??{},le=ya(q),he=[],ie={visibility:C.visible?"visible":"none"},et=ga(D),Me={source:H,layout:ie};if(et&&(Me["source-layer"]=et),(q.type??"polygon").toLowerCase()==="point"){const je=`${C.id}-circle`;p.getLayer(je)||p.addLayer({id:je,type:"circle",...Me,paint:{"circle-color":le,"circle-opacity":q.opacity??1,"circle-radius":q.radius??q.width??3,"circle-stroke-color":q.stroke??q.color??"#ffffff","circle-stroke-width":q.width??1}}),he.push(je);const He=q.text??q.label;if(He){const vt=`${C.id}-symbol`,tn=cn(q.textSize)??10,Mt=q.textHaloColor??q.stroke??"#ffffff",Rt=cn(q.textHaloWidth)??1,bt=cn(q.textZoom??q.pointZoom),Ft={"text-color":q.textColor??"#000000","text-halo-color":Mt,"text-halo-width":Rt},Je={id:vt,type:"symbol",...Me,layout:{"text-field":["coalesce",["get",He],""],"text-size":tn,"text-anchor":"top"},paint:Ft};bt!=null&&(Je.minzoom=bt),p.getLayer(vt)||p.addLayer(Je),he.push(vt)}}else{const je=`${C.id}-fill`;p.getLayer(je)||p.addLayer({id:je,type:"fill",...Me,paint:{"fill-color":le,"fill-opacity":q.opacity??.5,"fill-outline-color":q.stroke??q.color??"#0ea5e9"}}),he.push(je);const He=`${C.id}-line`;p.getLayer(He)||p.addLayer({id:He,type:"line",...Me,paint:{"line-color":q.stroke??q.color??"#0b74c4","line-width":cn(q.width??q.border)??1,"line-opacity":q.opacity??1}}),he.push(He)}C.layerIds=he,L(p,C)},L=(p,C)=>{const D=C.visible?"visible":"none";C.layerIds.forEach(H=>{p.getLayer(H)&&p.setLayoutProperty(H,"visibility",D)})},R=p=>{const C=Array.isArray(p)?p:[];v(o.value??void 0),d.value=null,B();const D=C.map((H,J)=>{if(!H)return null;const q=qn(H.url);if(!q)return null;const le=H.id!=null?String(H.id):`overlay-${J}`;return{id:le,config:{...H,id:le,url:q},visible:!1,sourceId:`${le}-source`,layerIds:[]}}).filter(H=>!!H);i.value=D,b(),x()},I=(p,C)=>{const D=i.value.find(J=>J.id===p);if(!D)return;D.visible=C,b();const H=o.value;if(!(!H||typeof H.isStyleLoaded!="function"||!H.isStyleLoaded())){if(!D.layerIds.length){E(H,D);return}L(H,D)}},A=()=>{a.value&&(a.value.remove(),a.value=null)},h=(p,C={})=>!Array.isArray(p.popup)||!p.popup.length?[]:p.popup.map(D=>({label:D.label??D.field,value:Un(C?.[D.field])})).filter(D=>D.label&&D.value!==void 0),T=p=>{const C=o.value;if(!C||!p?.point)return;const D=C.queryRenderedFeatures(p.point);for(const H of D){const J=H.layer?.id??H.sourceLayer;if(!J)continue;const q=ze(J);if(!q)continue;const le=h(q,H.properties??H.layer?.properties??{});if(!le.length)continue;const he=ua(le),ie=Yo();if(!ie)return;const et=p.lngLat;if(c.value===J&&a.value){a.value.setLngLat(et),a.value.setHTML(he);return}c.value=J,A(),a.value=new ie.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(et).setHTML(he).addTo(C);return}c.value=null,A()},F=()=>{c.value=null,A()},P=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||p.getSource(zt)||(p.addSource(zt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),p.addLayer({id:va,type:"fill",source:zt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),p.addLayer({id:ba,type:"line",source:zt,paint:{"line-color":"#1d4ed8","line-width":2}}))},K=p=>{const C=o.value;if(!C||typeof C.isStyleLoaded!="function"||!C.isStyleLoaded())return;P();const D=C.getSource(zt);if(!(!D||typeof D.setData!="function")){if(!p){D.setData({type:"FeatureCollection",features:[]});return}D.setData({type:"FeatureCollection",features:[p]})}},Z=p=>{const C=ka(p);C&&K(C)},B=()=>{K(null)},M=()=>{d.value=null,B()},w=p=>{if(p)return typeof p=="string"?p:p.field??p.name??p.key??p.label},z=p=>{if(p)return typeof p=="string"?p:p.label??p.title??p.field??p.name},ne=(p,C)=>!p||!p.length?[]:p.map(D=>{const H=w(D);if(!H)return null;const J=z(D),q=Un(C?.[H]);return!J||q===""?null:{label:J,value:q}}).filter(D=>!!D),We=(p,C)=>!Array.isArray(p)||!p.length?[]:p.map(D=>{if(!D?.name)return null;const H=D.title??D.name,J=Un(C?.[D.name]);return!H||J===""?null:{label:H,value:J}}).filter(D=>!!D),we=(p,C)=>!Array.isArray(p)||!p.length?[]:p.map(H=>{const J=Vo(H.url,C),q=H.label??H.url;return J?{label:q,url:J,target:H.target}:null}).filter(H=>!!H),pe=async(p,C)=>{const D=Vo(p,C);if(!D)return null;try{const H=await fetch(D);return H.ok?await H.json():null}catch{return null}},Le=async(p,C)=>{const D=C.properties??C.layer?.properties??{},H=ne(p.card?.rows,D);let J,q;if(p.card?.api){const ie=await pe(p.card.api,D);ie&&(typeof ie.html=="string"&&ie.html.trim()&&(J=ie.html),Array.isArray(ie.columns)&&ie.columns.length&&(q=ie.columns))}let le=H;if(!J&&q){const ie=We(q,D);ie.length&&(le=ie)}if(!le.length&&!J)return null;const he=we(p.card?.actions,D);return{title:D?.name??p.name,rows:le,html:J,actions:he.length?he:void 0}},Ke=async p=>{const C=o.value;if(!C||!p?.point)return;const D=C.queryRenderedFeatures(p.point);for(const H of D){const J=H.layer?.id??H.sourceLayer;if(!J)continue;const q=ze(J);if(!q||!q.card)continue;const le=await Le(q,H);if(le){d.value=le,Z(H);return}}d.value=null,B()},Ge=()=>{const p=o.value;p&&(p.on("mousemove",T),p.on("mouseleave",F),p.on("click",Ke))},Ze=()=>{const p=o.value;p&&(p.off("mousemove",T),p.off("mouseleave",F),p.off("click",Ke),A(),B())},ze=p=>{if(p)return i.value.find(C=>C.layerIds.includes(p))?.config},W=async()=>{const p=await Ea(),C=ma(t.container);if(!p||!C)return;const D={container:C,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:m??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new p.Map(D);const H=()=>{x()};f=H,o.value.on("style.load",H),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),x(),Ge()})};e.onMounted(W),e.onBeforeUnmount(()=>{Ze(),o.value&&f&&o.value.off("style.load",f),v(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const G={map:o,ready:s,setStyle:g,flyTo:p=>o.value?.flyTo(p),fitBounds:(p,C)=>o.value?.fitBounds(p,C),setCenter:p=>o.value?.setCenter(p),setZoom:p=>o.value?.setZoom(p),addControl:(p,C)=>o.value?.addControl(p,C),removeControl:p=>o.value?.removeControl(p),on:(p,...C)=>o.value?.on(p,...C),off:(p,...C)=>o.value?.off(p,...C),project:p=>o.value?.project(p),unproject:p=>o.value?.unproject(p),state:r,basemapOptions:l,setOverlays:R,toggleOverlay:I,getOverlayConfig:ze,selectedCard:d,setBasemapOptions:k,clearCard:M};return e.provide(Xo,G),G}const wa={class:"map-base-layer-menu"},xa={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Na={class:"flex items-center justify-between p-2 border-b"},Ca={class:"p-2 border-b"},Sa={class:"flex items-center"},_a=["value","checked","onChange"],Ba={class:"ml-2"},$a={class:"p-2"},Ta={class:"flex items-center"},La=["checked"],Aa=["checked","onChange"],Ia={class:"ml-2"},Da=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=dn(),i=e.ref(!1),a=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>o.value),d=e.computed(()=>n.value.selectedBasemap??""),m=e.computed(()=>n.value.geometryVisible??!0),f=e.computed(()=>n.value.overlays??[]),g=v=>{s?.(v)},b=()=>{r?.(!m.value)},k=v=>{l?.(v.id,!v.visible)};return(v,x)=>(e.openBlock(),e.createElementBlock("div",wa,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=E=>i.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),i.value?(e.openBlock(),e.createElementBlock("div",xa,[e.createElementVNode("div",Na,[x[3]||(x[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:x[1]||(x[1]=E=>i.value=!1)},[...x[2]||(x[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M18 6l-12 12"}),e.createElementVNode("path",{d:"M6 6l12 12"})],-1)])])]),e.createElementVNode("div",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.key},[e.createElementVNode("label",Sa,[e.createElementVNode("input",{type:"radio",name:a,value:E.key,checked:d.value===E.key,onChange:j=>g(E.key)},null,40,_a),e.createElementVNode("span",Ba,e.toDisplayString(E.name||E.key),1)])]))),128))]),e.createElementVNode("div",$a,[e.createElementVNode("label",Ta,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:b},null,40,La),x[4]||(x[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,E=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:E.id},[e.createElementVNode("input",{type:"checkbox",checked:E.visible,onChange:j=>k(E)},null,40,Aa),e.createElementVNode("span",Ia,e.toDisplayString(E.name||E.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),Oa={key:0,class:"absolute bottom-[35px] left-[10px] z-[400] bg-white border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},Ma={class:"leading-tight"},Ra=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",Oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,s=>(e.openBlock(),e.createElementBlock("div",{key:s.key,class:"flex items-center gap-2 text-gray-800"},[e.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",Ma,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Fa={class:"flex items-center gap-2 bg-white border border-gray-200 rounded-lg shadow-[0_10px_22px_rgba(15,23,42,0.16)] px-3 py-2 text-[11px] text-slate-900 max-w-[220px]"},Pa={class:"font-mono"},za=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Fa,[e.createElementVNode("span",Pa,e.toDisplayString(t.coordinates),1)]))}}),ja={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Ha=["title"],Ua={key:0,class:"vs-select__options absolute z-50 mt-1 w-auto min-w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900"},qa=["onClick"],Wa=["placeholder"],Ka={class:"divide-y divide-gray-100"},Ga=["onClick"],Za=600,Ja="0000000000:00:000:0000",Ya=30,Xa=8,Qa="https://data.softpro.ua/api-user/gis-url-proxy",Va="https://geo.rv.ua/api-user/dzk.api",ec="https://nominatim.openstreetmap.org/search",tc=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=dn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const i=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const W=n.config?.tools?.filter(G=>i.includes(G));return W&&W.length?W:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,W=>{W.includes(d.value)||(d.value=W[0])});const m=e.ref(""),f=e.ref(!1),g=e.ref(null),b=e.ref(null),k=e.ref(null),v=e.ref([]),x=e.ref(null),E=e.computed(()=>d.value==="address"&&v.value.length>0);let j=null,S=null,L=null;const R=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function I(){if(!b.value)return;const W=b.value.getBoundingClientRect(),G=W.width+Ya,p=W.left+window.scrollX,C=W.bottom+window.scrollY+Xa;R.left=`${p}px`,R.top=`${C}px`,R.width=`${G}px`,R.display="block"}const A=()=>{E.value&&I()};function h(){j&&(clearTimeout(j),j=null)}function T(){S?.destroy(),S=null}async function F(){if(d.value!=="parcel")return;const W=k.value;if(!W)return;const G=await fa();d.value==="parcel"&&(T(),S=G(W,{mask:Ja,lazy:!1,placeholderChar:"_"}),S.on("accept",()=>{m.value=S?.value??""}))}function P(){return(S?.value??m.value).trim()}function K(){if(!(typeof window>"u"))return window.maplibregl}function Z(W){const G=o.map.value;if(!G)return;const p=K();if(p){if(L){L.setLngLat([W.lat,W.lng]);return}L=new p.Marker({color:"#2563eb"}).setLngLat([W.lat,W.lng]).addTo(G)}}function B(){L&&(L.remove(),L=null)}e.watch(d,W=>{m.value="",f.value=!1,v.value=[],h(),W==="parcel"?e.nextTick(()=>{F().catch(G=>{xe.notify({type:"error",title:"Маска кадастру",message:G?.message||"Не вдалося ініціалізувати маску"})})}):T()}),e.watch(E,W=>{W?e.nextTick(()=>{I()}):R.display="none"}),e.watch(m,W=>{if(d.value!=="address"){v.value=[],h();return}if(!W.trim()){v.value=[],h();return}h(),j=window.setTimeout(()=>{Le(W).catch(G=>{const p=G?.message||"Помилка пошуку адреси";xe.notify({type:"error",title:"Пошук адреси",message:p})})},Za)});function M(W){d.value=W}function w(W){const G=W.target;if(f.value){const p=g.value;p&&!p.contains(G)&&(f.value=!1)}if(E.value){const p=x.value;p&&!p.contains(G)&&(v.value=[])}}e.onMounted(()=>{window.addEventListener("click",w,!0),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),d.value==="parcel"&&e.nextTick(()=>{F().catch(W=>{xe.notify({type:"error",title:"Маска кадастру",message:W?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",w,!0),window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A),h(),T(),B()});function z(W){return W==="xy"?"Координати":W==="parcel"?"Кадастр":"Адреси"}function ne(W){const G=W.replace(/[,]+/g," ").trim();if(!G)return null;const p=G.split(/\s+/).filter(Boolean);if(p.length<2)return null;console.log(p);const C=p.slice(0,2).map(Number);if(console.log(C),!C.every(ie=>Number.isFinite(ie)))return null;let[D,H]=C,J=D,q=H;const le=ie=>Math.abs(ie)<=90,he=ie=>Math.abs(ie)<=180;if(!le(J)||!he(q))if(le(q)&&he(J))J=D,q=H;else return null;return console.log(J,q),{lat:J,lng:q}}function We(W){return(W?.items||[]).map((p,C)=>{const D=Number(p?.position?.lat),H=Number(p?.position?.lng);return!Number.isFinite(D)||!Number.isFinite(H)?null:{id:String(p?.id??C),title:p?.title||p?.address?.label||"Знайдений обʼєкт",lat:D,lng:H}}).filter(p=>!!p)}function we(W){const G=W?.result||W?.data||W;if(!G)return[];const p=G.geom_centroid;if(!p||!Array.isArray(p.coordinates))return[];const[C,D]=p.coordinates;return!Number.isFinite(C)||!Number.isFinite(D)?[]:[{id:"parcel",title:G.cadnum||G.cad_num||"Земельна ділянка",lat:C,lng:D}]}function pe(W){return(Array.isArray(W?.features)?W.features:[]).map((p,C)=>{const D=p?.geometry?.coordinates,H=Number(D?.[0]),J=Number(D?.[1]);if(!Number.isFinite(H)||!Number.isFinite(J))return null;const q=p?.properties||{},le=q?.geocoding?.label||q?.display_name||q?.label||"Адреса";return{id:String(q?.geocoding?.place_id||q?.place_id||C),title:le,lat:H,lng:J}}).filter(p=>!!p)}async function Le(W){v.value=[],h();const G=new URL(ec);G.searchParams.set("format","geojson"),G.searchParams.set("q",W),G.searchParams.set("addressdetails","1"),G.searchParams.set("bounded","1");const p=r();p&&G.searchParams.set("viewbox",p);const C=await fetch(G.toString());if(!C.ok)throw new Error(`HTTP ${C.status}`);const D=await C.json(),H=pe(D);if(!H.length){xe.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}v.value=H}function Ke(W){Ze(W),v.value=[],m.value=""}function Ge(W){const p=W.replace(/\s+/g,"").split(":");if(p.length!==4)return!1;const C=[10,2,3,4];return p.every((D,H)=>D.length===C[H]&&/^\d+$/.test(D))}function Ze(W){const G=n.config?.zoom??17;o.flyTo?.({center:[W.lat,W.lng],zoom:G}),Z(W)}async function ze(){const W=d.value==="parcel"?P():m.value.trim();if(W){if(d.value==="xy"){const G=ne(W);if(console.log(G),!G){xe.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}Ze(G),m.value="";return}if(d.value==="address"){try{await Le(W)}catch(G){const p=G?.message||"Помилка пошуку адреси";xe.notify({type:"error",title:"Пошук адреси",message:p})}return}try{const G=new URL(d.value==="here"?Qa:Va);if(d.value==="here")G.searchParams.set("searchtext",W);else{if(!Ge(W)){xe.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}G.searchParams.set("cad_num",W)}const p=await fetch(G.toString());if(!p.ok)throw new Error(`HTTP ${p.status}`);const C=await p.json(),D=d.value==="here"?We(C):we(C);if(!D.length)xe.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const H=D[0];Ze(H),d.value==="parcel"&&S&&(S.value=""),m.value=""}}catch(G){const p=G?.message||"Помилка пошуку";xe.notify({type:"error",title:"Пошук",message:p})}}}return(W,G)=>(e.openBlock(),e.createElementBlock("div",ja,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(ze,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:g,class:"relative search-type w-[100px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:G[0]||(G[0]=p=>f.value=!f.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:z(d.value)},e.toDisplayString(z(d.value)),9,Ha),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":f.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...G[3]||(G[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),f.value?(e.openBlock(),e.createElementBlock("div",Ua,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:C=>M(p)},e.toDisplayString(z(p)),9,qa))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:b,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[d.value==="parcel"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"parcelInputRef",ref:k,"onUpdate:modelValue":G[1]||(G[1]=p=>m.value=p),placeholder:"0000000000:00:000:0000",inputmode:"numeric",type:"text",class:"vs-input !h-[34px] transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,512)),[[e.vModelText,m.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":G[2]||(G[2]=p=>m.value=p),placeholder:c.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Wa)),[[e.vModelText,m.value,void 0,{trim:!0}]]),G[4]||(G[4]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1)),E.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:x,class:"vs-select__options mt-1 bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900 z-50 max-h-60 overflow-auto",style:e.normalizeStyle(R)},[e.createElementVNode("ul",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:C=>Ke(p)},e.toDisplayString(p.title),9,Ga))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),nc={class:"map-center-control"},oc=["aria-label"],sc=e.defineComponent({directives:{tooltip:xe.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=dn(),r=e.ref(null),l=e.ref(null),i=e.ref(null),a=e.ref(null);function c(k){if(Array.isArray(k)&&k.length>=2){const[v,x]=k.slice(0,2).map(E=>Number(E));return Number.isNaN(v)||Number.isNaN(x)?null:[v,x]}if(k&&typeof k=="object"){const v=k,x=v.lng??v.lon??v.long??v.x,E=v.lat??v.y;if(x!=null&&E!=null){const j=Number(x),S=Number(E);if(!Number.isNaN(j)&&!Number.isNaN(S))return[j,S]}}if(typeof k=="string"){const v=k.split(",").map(x=>Number(x.trim()));if(v.length>=2&&v.every(x=>!Number.isNaN(x)))return[v[0],v[1]]}return null}e.watch(()=>n.center,k=>{const v=c(k);v&&(r.value=v)},{immediate:!0}),e.watch(()=>n.zoom,k=>{const v=Number(k);Number.isNaN(v)||(l.value=v)},{immediate:!0}),e.watch(()=>n.targetCenter,k=>{i.value=c(k)},{immediate:!0}),e.watch(()=>n.targetZoom,k=>{const v=Number(k);a.value=Number.isNaN(v)?null:v},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),m=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),f=e.computed(()=>!!i.value);e.onMounted(async()=>{const k=o.value;if(k){if(!r.value){const v=k.getCenter();r.value=[v.lng,v.lat]}l.value==null&&(l.value=k.getZoom())}});function g(){const k=o.value;if(!k)return;const v=r.value||(()=>{const E=k.getCenter();return[E.lng,E.lat]})(),x=l.value??k.getZoom();k.flyTo({center:v,zoom:x})}function b(){const k=o.value;if(!k||!i.value)return;const v=a.value??l.value??k.getZoom();k.flyTo({center:i.value,zoom:v})}return(k,v)=>{const x=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",nc,[f.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,id:"center-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":"Повернути центр",onClick:e.withModifiers(g,["stop"])},[e.createVNode(e.unref(Pr),{class:"w-4 h-4"})])),[[x,"Центр мапи"]]),f.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:1,id:"goto-target-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":m.value,onClick:e.withModifiers(b,["stop"])},[e.createVNode(e.unref(jr),{class:"w-4 h-4"})],8,oc)),[[x,d.value]]):e.createCommentVNode("",!0)])}}}),es=nt(sc,[["__scopeId","data-v-bc627616"]]),rc={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},ic={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},lc=["aria-label"],ac={key:2,class:"absolute top-[10px] right-[10px] z-[600] min-w-[220px] max-w-[320px] bg-white border border-gray-200 rounded-[0.75rem] p-3 shadow-[0_25px_45px_rgba(15,23,42,0.2)]"},cc={class:"text-slate-900 font-semibold mb-1"},dc=["innerHTML"],fc={key:1,class:"space-y-2"},pc={class:"text-gray-500"},uc={class:"font-medium text-slate-900"},mc={key:2,class:"mt-2 flex flex-col gap-2"},hc=["href","target"],fn="map-basemap-source",Wn="map-basemap-layer",gc=20,Ct="map-katottg-geometry-source",pn="map-katottg-geometry-line",ot="map-geometry-source",St="map-geometry-fill",_t="map-geometry-line",Bt="map-geometry-circle",un=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},layers:{},legend:{},tools:{},katottg:{}},setup(t){const n=t,o=[{key:"topo100",name:"Topographic 100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",name:"Орто 10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",name:"OSM Bright",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}],l=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{};function i(u){if(u){if(Array.isArray(u)&&u.length>=2){const O=Number(u[0]),U=Number(u[1]);return!Number.isFinite(O)||!Number.isFinite(U)?void 0:[O,U]}if(typeof u=="object"){const O=u,U=O.lng??O.lon??O.long??O.x,Y=O.lat??O.y;if(U!=null&&Y!=null){const Se=Number(U),Ye=Number(Y);if(Number.isFinite(Se)&&Number.isFinite(Ye))return[Se,Ye]}}}}function a(u){if(u==null)return;const O=Number(u);return Number.isFinite(O)?O:void 0}const c=e.computed(()=>n.katottg!=null?n.katottg:l.katottg),d=e.computed(()=>(Array.isArray(l.basemaps)&&l.basemaps.length?l.basemaps:o).map((U,Y)=>{const Se=typeof U.url=="string"?U.url.trim():"";return Se?{key:(U.key??U.name??`base-${Y}`).trim()||`base-${Y}`,url:Se,name:U.name??U.key??`Layer ${Y+1}`}:null}).filter(U=>!!U)),m=i(l.center),f=a(l.zoom),g=Po(n.geom),b=xr(g),k=b?[(b[0]+b[2])/2,(b[1]+b[3])/2]:void 0,v=e.ref(null),x=e.computed(()=>i(n.center)??null),E=e.computed(()=>x.value??m??null),j=dn({container:v,center:k??E.value??void 0,zoom:n.zoom??f}),{map:S,setCenter:L,setZoom:R,state:I,getOverlayConfig:A,selectedCard:h,setBasemapOptions:T,clearCard:F,addControl:P,removeControl:K,ready:Z}=j,B=e.computed({get:()=>I.value.selectedBasemap??"",set:u=>{I.value.selectedBasemap=u}}),M=e.computed({get:()=>I.value.geometryVisible??!0,set:u=>{I.value.geometryVisible=u}}),w=e.computed(()=>{const u=n.height;return{height:typeof u=="number"?`${u}px`:String(u)}}),z=e.ref(!1),ne=e.ref(!1),We=e.computed(()=>z.value?"!fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),we=e.computed(()=>{const u=["w-full","h-full"];return z.value||u.push(`min-h-[${w.value.height}]`),u.join(" ")}),pe=e.computed(()=>h.value),Le=()=>F?.(),Ke=e.ref(k??E.value??null),Ge=e.ref(n.zoom??f??null),Ze=e.ref(E.value);e.watch(E,u=>{Ze.value=u},{immediate:!0});const ze=e.computed(()=>Ze.value??null),W=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof Ge.value=="number"?Ge.value:gc),G=["home","fullscreen","scale","position"],p=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?G:n.tools.filter(u=>G.includes(u))),C=u=>p.value.includes(u);e.watch([S,Z],([u,O])=>{if(!(!u||!O)){if(!Ke.value){const U=u.getCenter();Ke.value=[U.lng,U.lat]}Ge.value==null&&(Ge.value=u.getZoom())}},{immediate:!0});const D=e.ref(null),H=e.ref(""),J=e.ref(null),q=u=>u?ne.value?!0:typeof u.isStyleLoaded=="function"&&u.isStyleLoaded()?(ne.value=!0,!0):!1:!1,le=u=>{if(!u)return"";const O=Number(u.lat??u[1]),U=Number(u.lng??u[0]);return!Number.isFinite(O)||!Number.isFinite(U)?"":`${U.toFixed(5)}, ${O.toFixed(5)}`},he=u=>{u?.lngLat&&(H.value=le(u.lngLat))},ie=()=>{H.value=""},et=u=>{u&&(u.on("mousemove",he),u.on("mouseleave",ie),J.value=u)},Me=u=>{u&&(u.off("mousemove",he),u.off("mouseleave",ie),J.value=null)},Mn=e.computed(()=>C("scale"));e.watch([S,Z],([u,O],[U])=>{U&&Me(U),!(!u||!O)&&et(u)},{immediate:!0}),e.watch([S,Z,Mn],([u,O,U])=>{if(D.value&&K&&(K(D.value),D.value=null),!u||!O||!U)return;const Y=window?.maplibregl;Y&&(D.value=new Y.ScaleControl({unit:"metric"}),P?.(D.value,"bottom-left"))},{immediate:!0});const je=e.computed(()=>Array.isArray(n.legend)?n.legend.map((u,O)=>{const U=typeof u?.color=="string"?u.color.trim():"",Y=typeof u?.label=="string"?u.label.trim():"";return!U||!Y?null:{color:U,label:Y,key:`${Y}-${O}`}}).filter(u=>!!u):[]),He=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(l.layers)&&l.layers.length?l.layers:[]);e.watch(d,u=>{if(T?.(u),!u.length){B.value="";return}u.some(O=>O.key===B.value)||(B.value=u[0].key)},{immediate:!0});const vt=()=>typeof window>"u"?"":window.location?.origin??"",tn=u=>{if(!u)return"";const O=u.trim();if(!O)return"";const Y=O.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!Y)return"";if(/^https?:\/\//i.test(Y))return Y;const Se=vt(),Ye=Y.replace(/^\/+/,"");return Se?`${Se}/${Ye}`:Ye?`/${Ye}`:""},Mt=u=>{if(!u?.getStyle)return;const O=u.getStyle()??{},U=Array.isArray(O.layers)?O.layers:[];return U.length?U.find(Se=>Se.type!=="background")?.id??U[0]?.id:void 0},Rt=u=>{u&&(u.getLayer(Wn)&&u.removeLayer(Wn),u.getSource(fn)&&u.removeSource(fn))},bt=(u,O)=>{if(!u)return;const U=Mt(u);u.addSource(fn,{type:"raster",tiles:[O],tileSize:256}),u.addLayer({id:Wn,type:"raster",source:fn,layout:{visibility:"visible"}},U)},Ft=u=>{if(!u)return;const O=tn(u.url);if(!O){Je.value=null;return}Je.value=O,Rt(S.value),kt()},Je=e.ref(null),Mo=u=>{if(!u||u.__pendingBasemapHooked)return;u.__pendingBasemapHooked=!0;const O=()=>{u.__pendingBasemapHooked=!1,kt()};u.once("style.load",O),u.once("styledata",O)},kt=()=>{const u=S.value,O=Je.value;if(!(!O||!u)){if(!q(u)){Mo(u);return}Rt(u),bt(u,O)}},y=()=>{const u=B.value;if(!u)return;const O=d.value.find(U=>U.key===u);O&&Ft(O)};e.watch(B,()=>{y()},{immediate:!0}),e.watch(He,u=>{j.setOverlays?.(u)},{immediate:!0,deep:!0});const $=e.ref(null);let N=0;const _=e.computed(()=>Po($.value)),X={fill:{"fill-color":"#0ea5e9","fill-opacity":.25},line:{"line-color":"#0b74c4","line-width":2},circle:{"circle-color":"#0ea5e9","circle-stroke-color":"#ffffff","circle-stroke-width":2,"circle-radius":7,"circle-opacity":.95}},ae={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},te=e.ref(g),ue=e.ref(b),Re=e.ref(!1),se=e.computed(()=>{if(!ue.value)return null;const[u,O,U,Y]=ue.value;return[(u+U)/2,(O+Y)/2]}),Pt=e.computed(()=>!!ue.value),be=e.ref(!!b);e.ref(!1);const dt=()=>{z.value=!z.value},tt=e.ref(!1),Ue=()=>{const u=S.value;if(!u||!q(u))return;const O=te.value;if(!O){Et(u);return}let U=u.getSource(ot);U?U.setData(O):(u.addSource(ot,{type:"geojson",data:O}),Ro(u),U=u.getSource(ot)),kr(u,M.value?"visible":"none"),hu(),wr(),ue.value&&(!be.value&&(Re.value||!tt.value)?(u.fitBounds(ue.value,{padding:40,maxZoom:16,duration:0}),tt.value=!0,Re.value=!1):be.value&&(be.value=!1,Re.value=!1,tt.value=!0))},Ro=u=>{const O=X;u.getLayer(St)||u.addLayer({id:St,type:"fill",source:ot,paint:O.fill}),u.getLayer(_t)||u.addLayer({id:_t,type:"line",source:ot,paint:O.line}),u.getLayer(Bt)||u.addLayer({id:Bt,type:"circle",source:ot,paint:O.circle,filter:["==","$type","Point"]})},Et=u=>{[Bt,_t,St].forEach(O=>{u.getLayer(O)&&u.removeLayer(O)}),u.getSource(ot)&&u.removeSource(ot)},kr=(u,O)=>{q(u)&&[Bt,_t,St].forEach(U=>{u.getLayer(U)&&u.setLayoutProperty(U,"visibility",O)})},hu=()=>{const u=S.value;if(!u||!q(u))return;const O=X;u.getLayer(St)&&Object.entries(O.fill).forEach(([U,Y])=>{u.setPaintProperty(St,U,Y)}),u.getLayer(_t)&&Object.entries(O.line).forEach(([U,Y])=>{u.setPaintProperty(_t,U,Y)}),u.getLayer(Bt)&&Object.entries(O.circle).forEach(([U,Y])=>{u.setPaintProperty(Bt,U,Y)})},Er=u=>{u.getLayer(pn)||u.addLayer({id:pn,type:"line",source:Ct,layout:{visibility:"visible"},paint:ae})},wr=()=>{const u=S.value;if(!u||!q(u))return;const O=_.value??{type:"FeatureCollection",features:[]};if(!u.getSource(Ct)){u.addSource(Ct,{type:"geojson",data:O}),Er(u);return}const U=u.getSource(Ct);U&&typeof U.setData=="function"&&U.setData(O),Er(u)},gu=u=>{u.getLayer(pn)&&u.removeLayer(pn),u.getSource(Ct)&&u.removeSource(Ct)},yu=async u=>{const O=typeof u=="string"?u.trim():"",U=++N;if(!O){$.value=null;return}try{const Y=await fetch(`https://data.gki.com.ua/api-user/atu/${O}`);if(N!==U)return;if(!Y.ok){$.value=null;return}const Se=await Y.json();if(N!==U)return;$.value=Se}catch{if(N!==U)return;$.value=null}};e.watch(c,u=>{yu(u)},{immediate:!0}),e.watch(_,()=>{wr()},{immediate:!0}),e.watch(()=>n.geom,u=>{te.value=Po(u),ue.value=xr(te.value),se.value&&(Ke.value=se.value),tt.value=!1,Re.value=!0,Ue()},{deep:!0,immediate:!0}),e.watch(M,()=>{const u=S.value;u&&q(u)&&kr(u,M.value?"visible":"none")});const wt=()=>{ne.value=!0,Ue(),kt()},Fo=()=>{Ue()};e.watch(S,(u,O)=>{O&&(O.off("style.load",wt),O.off("load",wt),O.off("idle",Fo)),ne.value=!1,u&&(u.on("load",wt),u.on("style.load",wt),u.on("idle",Fo),typeof u.isStyleLoaded=="function"&&u.isStyleLoaded()&&wt())}),e.watch(x,u=>{!S.value||!u||Pt.value||L(u)}),e.watch(()=>n.zoom,u=>{!S.value||typeof u!="number"||R(u)}),e.onBeforeUnmount(()=>{D.value&&K&&K(D.value),J.value?Me(J.value):S.value&&Me(S.value);const u=S.value;u&&(gu(u),u.off("style.load",wt),u.off("load",wt),u.off("idle",Fo))});function vu(u){u&&(B.value=u)}function bu(u){M.value=u}j.setBasemap=vu,j.toggleGeometry=bu,j.setOverlays?.(He.value);function Po(u){if(!u)return null;if(u.type==="FeatureCollection")return u;if(u.type==="Feature")return{type:"FeatureCollection",features:[u]};const O=u.geometry??u;if(!O?.type)return null;if(O.type==="GeometryCollection"&&Array.isArray(O.geometries)){const U=O.geometries.filter(Y=>Y&&typeof Y.type=="string").map(Y=>({type:"Feature",geometry:Y}));return U.length?{type:"FeatureCollection",features:U}:null}if(O.type==="MultiPoint"&&Array.isArray(O.coordinates)){const U=O.coordinates.filter(Y=>Array.isArray(Y)&&Y.length>=2).map(Y=>({type:"Feature",geometry:{type:"Point",coordinates:Y}}));return U.length?{type:"FeatureCollection",features:U}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:O}]}}function xr(u){if(!u?.features?.length)return null;let O=1/0,U=1/0,Y=-1/0,Se=-1/0;const Ye=nn=>{if(typeof nn[0]=="number"){const[xt,Nr]=nn;O=Math.min(O,xt),U=Math.min(U,Nr),Y=Math.max(Y,xt),Se=Math.max(Se,Nr);return}nn.forEach(xt=>Ye(xt))};return u.features.forEach(nn=>{const xt=nn?.geometry?.coordinates;xt&&Ye(xt)}),O===1/0||U===1/0?null:[O,U,Y,Se]}return(u,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(We.value),style:e.normalizeStyle(z.value?void 0:w.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:v,class:e.normalizeClass(we.value)},null,2),e.createVNode(Ra,{items:je.value},null,8,["items"]),C("search")?(e.openBlock(),e.createBlock(tc,{key:0})):e.createCommentVNode("",!0),C("home")||C("fullscreen")?(e.openBlock(),e.createElementBlock("div",rc,[C("home")?(e.openBlock(),e.createElementBlock("div",ic,[e.createVNode(es,{center:ze.value,zoom:W.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(es,{key:0,"target-center":se.value,"target-zoom":W.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C("fullscreen")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 pointer-events-auto",onClick:dt,"aria-label":z.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...O[0]||(O[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)])],8,lc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),pe.value?(e.openBlock(),e.createElementBlock("div",ac,[e.createElementVNode("button",{type:"button",class:"absolute top-2 right-2 h-6 w-6 flex items-center justify-center rounded-full text-slate-500 hover:text-slate-900","aria-label":"Закрити",onClick:Le},[...O[1]||(O[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",cc,e.toDisplayString(pe.value.title||"Об'єкт"),1),pe.value.html?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["text-[0.75rem] text-slate-700 leading-relaxed overflow-auto",`max-h-[calc(${w.value.height}-120px)]`]),innerHTML:pe.value.html},null,10,dc)):(e.openBlock(),e.createElementBlock("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.rows,U=>(e.openBlock(),e.createElementBlock("div",{key:U.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",pc,e.toDisplayString(U.label)+":",1),e.createElementVNode("span",uc,e.toDisplayString(U.value),1)]))),128))])),pe.value.actions?.length?(e.openBlock(),e.createElementBlock("div",mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.actions,U=>(e.openBlock(),e.createElementBlock("a",{key:U.url,class:"bg-sky-600 hover:bg-sky-700 transition-colors text-white font-semibold text-center py-[0.55rem] rounded-md w-full",href:U.url,target:U.target??void 0,rel:"noreferrer"},e.toDisplayString(U.label),9,hc))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Da),C("position")&&H.value?(e.openBlock(),e.createBlock(za,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:H.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});function qe(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const yc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kn=()=>{},mn=()=>!1,Gn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),st=Object.assign,Xe=Array.isArray,ve=t=>typeof t=="string",Zn=t=>typeof t=="symbol",vc=t=>t!==null&&typeof t=="object",ts=qe(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),bc=qe("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Jn=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},kc=/-\w/g,rt=Jn(t=>t.replace(kc,n=>n.slice(1).toUpperCase())),Yn=Jn(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ec=Jn(t=>t?`on${Yn(t)}`:""),jt={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"NEED_HYDRATION",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"CACHED",[-2]:"BAIL"},wc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},xc=/;(?![^(]*\))/g,Nc=/:([^]+)/,Cc=/\/\*[^]*?\*\//g;function Sc(t){const n={};return t.replace(Cc,"").split(xc).forEach(o=>{if(o){const s=o.split(Nc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const _c="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Bc="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",$c="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Tc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Lc=qe(_c),Ac=qe(Bc),Ic=qe($c),Dc=qe(Tc);const Ht=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Ut=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),hn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),ns=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),ft=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),os=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),ss=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),qt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),eo=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),rs=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),to=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),no=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),oo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),so=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),ro=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),io=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),is=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),ls=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),gn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),yn=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),lo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),ao=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Wt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Kt=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),co=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),fo=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Oc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),po=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),vn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Mc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Rc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),uo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Fc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Pc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),mo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),as=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),$t={[Ht]:"Fragment",[Ut]:"Teleport",[Xn]:"Suspense",[hn]:"KeepAlive",[ns]:"BaseTransition",[ft]:"openBlock",[os]:"createBlock",[ss]:"createElementBlock",[Qn]:"createVNode",[Vn]:"createElementVNode",[qt]:"createCommentVNode",[eo]:"createTextVNode",[rs]:"createStaticVNode",[to]:"resolveComponent",[no]:"resolveDynamicComponent",[oo]:"resolveDirective",[so]:"resolveFilter",[ro]:"withDirectives",[io]:"renderList",[is]:"renderSlot",[ls]:"createSlots",[gn]:"toDisplayString",[yn]:"mergeProps",[lo]:"normalizeClass",[ao]:"normalizeStyle",[Wt]:"normalizeProps",[Kt]:"guardReactiveProps",[co]:"toHandlers",[fo]:"camelize",[Oc]:"capitalize",[po]:"toHandlerKey",[vn]:"setBlockTracking",[Mc]:"pushScopeId",[Rc]:"popScopeId",[uo]:"withCtx",[Fc]:"unref",[Pc]:"isRef",[mo]:"withMemo",[as]:"isMemoSame"};function zc(t){Object.getOwnPropertySymbols(t).forEach(n=>{$t[n]=t[n]})}const Ae={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function jc(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Ae}}function Gt(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,m=Ae){return t&&(a?(t.helper(ft),t.helper(At(t.inSSR,d))):t.helper(Lt(t.inSSR,d)),i&&t.helper(ro)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function pt(t,n=Ae){return{type:17,loc:n,elements:t}}function Oe(t,n=Ae){return{type:15,loc:n,properties:t}}function me(t,n){return{type:16,loc:Ae,key:ve(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Ae,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function Fe(t,n=Ae){return{type:8,loc:n,children:t}}function ye(t,n=[],o=Ae){return{type:14,loc:o,callee:t,arguments:n}}function Tt(t,n=void 0,o=!1,s=!1,r=Ae){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function ho(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Ae}}function Hc(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Ae}}function Uc(t){return{type:21,body:t,loc:Ae}}function Lt(t,n){return t||n?Qn:Vn}function At(t,n){return t||n?os:ss}function go(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(Lt(s,t.isComponent)),n(ft),n(At(s,t.isComponent)))}const cs=new Uint8Array([123,123]),ds=new Uint8Array([125,125]);function fs(t){return t>=97&&t<=122||t>=65&&t<=90}function Ie(t){return t===32||t===10||t===9||t===12||t===13}function it(t){return t===47||t===62||Ie(t)}function bn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const ke={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class qc{constructor(n,o){this.stack=n,this.cbs=o,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=cs,this.delimiterClose=ds,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return this.mode===2&&this.stack.length===0}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=cs,this.delimiterClose=ds}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let l=-1;if(r>100){let i=-1,a=r;for(;i+1<a;){const c=i+a>>>1;this.newlines[c]<n?i=c:a=c}l=i}else for(let i=r-1;i>=0;i--)if(n>this.newlines[i]){l=i;break}return l>=0&&(o=l+2,s=n-this.newlines[l]),{column:s,line:o,offset:n}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(n){n===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n))}stateInterpolationOpen(n){if(n===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const o=this.index+1-this.delimiterOpen.length;o>this.sectionStart&&this.cbs.ontext(this.sectionStart,o),this.state=3,this.sectionStart=o}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(n)):(this.state=1,this.stateText(n))}stateInterpolation(n){n===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(n))}stateInterpolationClose(n){n===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(n))}stateSpecialStartSequence(n){const o=this.sequenceIndex===this.currentSequence.length;if(!(o?it(n):(n|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!o){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(n)}stateInRCDATA(n){if(this.sequenceIndex===this.currentSequence.length){if(n===62||Ie(n)){const o=this.index-this.currentSequence.length;if(this.sectionStart<o){const s=this.index;this.index=o,this.cbs.ontext(this.sectionStart,o),this.index=s}this.sectionStart=o+2,this.stateInClosingTagName(n),this.inRCDATA=!1;return}this.sequenceIndex=0}(n|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===ke.TitleEnd||this.currentSequence===ke.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(n===60)}stateCDATASequence(n){n===ke.Cdata[this.sequenceIndex]?++this.sequenceIndex===ke.Cdata.length&&(this.state=28,this.currentSequence=ke.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(n))}fastForwardTo(n){for(;++this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);if(o===10&&this.newlines.push(this.index),o===n)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(n){n===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===ke.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):n!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(n,o){this.enterRCDATA(n,o),this.state=31}enterRCDATA(n,o){this.inRCDATA=!0,this.currentSequence=n,this.sequenceIndex=o}stateBeforeTagName(n){n===33?(this.state=22,this.sectionStart=this.index+1):n===63?(this.state=24,this.sectionStart=this.index+1):fs(n)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:n===116?this.state=30:this.state=n===115?29:6):n===47?this.state=8:(this.state=1,this.stateText(n))}stateInTagName(n){it(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(it(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(bn("</"+o),0),this.handleTagName(n)}}handleTagName(n){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)}stateBeforeClosingTagName(n){Ie(n)||(n===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=fs(n)?9:27,this.sectionStart=this.index))}stateInClosingTagName(n){(n===62||Ie(n))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(n))}stateAfterClosingTagName(n){n===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(n){n===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):n===47?(this.state=7,process.env.NODE_ENV!=="production"&&this.peek()!==62&&this.cbs.onerr(22,this.index)):n===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):Ie(n)||(process.env.NODE_ENV!=="production"&&n===61&&this.cbs.onerr(19,this.index),this.handleAttrStart(n))}handleAttrStart(n){n===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):n===46||n===58||n===64||n===35?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(n){n===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):Ie(n)||(this.state=11,this.stateBeforeAttrName(n))}stateInAttrName(n){n===61||it(n)?(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):process.env.NODE_ENV!=="production"&&(n===34||n===39||n===60)&&this.cbs.onerr(17,this.index)}stateInDirName(n){n===61||it(n)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):n===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(n){n===61||it(n)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===91?this.state=15:n===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(n){n===93?this.state=14:(n===61||it(n))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(n),process.env.NODE_ENV!=="production"&&this.cbs.onerr(27,this.index))}stateInDirModifier(n){n===61||it(n)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(n){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(n)}stateAfterAttrName(n){n===61?this.state=18:n===47||n===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)):Ie(n)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(n))}stateBeforeAttrValue(n){n===34?(this.state=19,this.sectionStart=this.index+1):n===39?(this.state=20,this.sectionStart=this.index+1):Ie(n)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(n))}handleInAttrValue(n,o){(n===o||this.fastForwardTo(o))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(n){this.handleInAttrValue(n,34)}stateInAttrValueSingleQuotes(n){this.handleInAttrValue(n,39)}stateInAttrValueNoQuotes(n){Ie(n)||n===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(n)):(process.env.NODE_ENV!=="production"&&n===34||n===39||n===60||n===61||n===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(n){n===91?(this.state=26,this.sequenceIndex=0):this.state=n===45?25:23}stateInDeclaration(n){(n===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(n){(n===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(n){n===45?(this.state=28,this.currentSequence=ke.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(n){(n===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(n){n===ke.ScriptEnd[3]?this.startSpecial(ke.ScriptEnd,4):n===ke.StyleEnd[3]?this.startSpecial(ke.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===ke.TitleEnd[3]?this.startSpecial(ke.TitleEnd,4):n===ke.TextareaEnd[3]?this.startSpecial(ke.TextareaEnd,4):(this.state=6,this.stateInTagName(n))}startEntity(){}stateInEntity(){}parse(n){for(this.buffer=n;this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);switch(o===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(o);break}case 2:{this.stateInterpolationOpen(o);break}case 3:{this.stateInterpolation(o);break}case 4:{this.stateInterpolationClose(o);break}case 31:{this.stateSpecialStartSequence(o);break}case 32:{this.stateInRCDATA(o);break}case 26:{this.stateCDATASequence(o);break}case 19:{this.stateInAttrValueDoubleQuotes(o);break}case 12:{this.stateInAttrName(o);break}case 13:{this.stateInDirName(o);break}case 14:{this.stateInDirArg(o);break}case 15:{this.stateInDynamicDirArg(o);break}case 16:{this.stateInDirModifier(o);break}case 28:{this.stateInCommentLike(o);break}case 27:{this.stateInSpecialComment(o);break}case 11:{this.stateBeforeAttrName(o);break}case 6:{this.stateInTagName(o);break}case 34:{this.stateInSFCRootTagName(o);break}case 9:{this.stateInClosingTagName(o);break}case 5:{this.stateBeforeTagName(o);break}case 17:{this.stateAfterAttrName(o);break}case 20:{this.stateInAttrValueSingleQuotes(o);break}case 18:{this.stateBeforeAttrValue(o);break}case 8:{this.stateBeforeClosingTagName(o);break}case 10:{this.stateAfterClosingTagName(o);break}case 29:{this.stateBeforeSpecialS(o);break}case 30:{this.stateBeforeSpecialT(o);break}case 21:{this.stateInAttrValueNoQuotes(o);break}case 7:{this.stateInSelfClosingTag(o);break}case 23:{this.stateInDeclaration(o);break}case 22:{this.stateBeforeDeclaration(o);break}case 25:{this.stateBeforeComment(o);break}case 24:{this.stateInProcessingInstruction(o);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const n=this.buffer.length;this.sectionStart>=n||(this.state===28?this.currentSequence===ke.CdataEnd?this.cbs.oncdata(this.sectionStart,n):this.cbs.oncomment(this.sectionStart,n):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,n))}emitCodePoint(n,o){}}const Wc={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:t=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${t}.sync\` should be changed to \`v-model:${t}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function yo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function lt(t,n){const o=yo("MODE",n),s=yo(t,n);return o===3?s===!0:s!==!1}function It(t,n,o,...s){const r=lt(t,n);return process.env.NODE_ENV!=="production"&&r&&kn(t,n,o,...s),r}function kn(t,n,o,...s){if(yo(t,n)==="suppress-warning")return;const{message:l,link:i}=Wc[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
2
2
  Details: ${i}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function vo(t){throw t}function ps(t){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${t.message}`)}function oe(t,n,o,s){const r=process.env.NODE_ENV!=="production"?(o||Kc)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,l=new SyntaxError(String(r));return l.code=t,l.loc=n,l}const Kc={0:"Illegal comment.",1:"CDATA section is allowed only in XML context.",2:"Duplicate attribute.",3:"End tag cannot have attributes.",4:"Illegal '/' in tags.",5:"Unexpected EOF in tag.",6:"Unexpected EOF in CDATA section.",7:"Unexpected EOF in comment.",8:"Unexpected EOF in script.",9:"Unexpected EOF in tag.",10:"Incorrectly closed comment.",11:"Incorrectly opened comment.",12:"Illegal tag name. Use '&lt;' to print '<'.",13:"Attribute value was expected.",14:"End tag name was expected.",15:"Whitespace was expected.",16:"Unexpected '<!--' in comment.",17:`Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,18:"Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",19:"Attribute name cannot start with '='.",21:"'<?' is allowed only in XML context.",20:"Unexpected null character.",22:"Illegal '/' in tags.",23:"Invalid end tag.",24:"Element is missing end tag.",25:"Interpolation end sign was not found.",27:"End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",26:"Legal directive name was expected.",28:"v-if/v-else-if is missing expression.",29:"v-if/else branches must use unique keys.",30:"v-else/v-else-if has no adjacent v-if or v-else-if.",31:"v-for is missing expression.",32:"v-for has invalid expression.",33:"<template v-for> key should be placed on the <template> tag.",34:"v-bind is missing expression.",53:"v-bind with same-name shorthand only allows static argument.",35:"v-on is missing expression.",36:"Unexpected custom directive on <slot> outlet.",37:"Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",38:"Duplicate slot names found. ",39:"Extraneous children found when component already has explicitly named default slot. These children will be ignored.",40:"v-slot can only be used on components or <template> tags.",41:"v-model is missing expression.",42:"v-model value must be a valid JavaScript member expression.",43:"v-model cannot be used on v-for or v-slot scope variables because they are not writable.",44:`v-model cannot be used on a prop, because local prop bindings are not writable.
3
3
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"v-model cannot be used on a const binding because it is not writable.",46:"Error parsing JavaScript expression: ",47:"<KeepAlive> expects exactly one child component.",52:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",48:'"prefixIdentifiers" option is not supported in this build of compiler.',49:"ES module mode is not supported in this build of compiler.",50:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',51:'"scopeId" option is only supported in module mode.',54:""},_e=t=>t.type===4&&t.isStatic;function us(t){switch(t){case"Teleport":case"teleport":return Ut;case"Suspense":case"suspense":return Xn;case"KeepAlive":case"keep-alive":return hn;case"BaseTransition":case"base-transition":return ns}}const Gc=/^$|^\d|[^\$\w\xA0-\uFFFF]/,bo=t=>!Gc.test(t),ms=/[A-Za-z_$\xA0-\uFFFF]/,Zc=/[\.\?\w$\xA0-\uFFFF]/,Jc=/\s+[.[]\s*|\s*[.[]\s+/g,hs=t=>t.type===4?t.content:t.loc.source,gs=t=>{const n=hs(t).trim().replace(Jc,a=>a.trim());let o=0,s=[],r=0,l=0,i=null;for(let a=0;a<n.length;a++){const c=n.charAt(a);switch(o){case 0:if(c==="[")s.push(o),o=1,r++;else if(c==="(")s.push(o),o=2,l++;else if(!(a===0?ms:Zc).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(s.push(o),o=3,i=c):c==="["?r++:c==="]"&&(--r||(o=s.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")s.push(o),o=3,i=c;else if(c==="(")l++;else if(c===")"){if(a===n.length-1)return!1;--l||(o=s.pop())}break;case 3:c===i&&(o=s.pop(),i=null);break}}return!r&&!l},Yc=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,Xc=t=>Yc.test(hs(t));function ys(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function Be(t,n,o=!1){for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&(o||r.exp)&&(ve(n)?r.name===n:n.test(r.name)))return r}}function Zt(t,n,o=!1,s=!1){for(let r=0;r<t.props.length;r++){const l=t.props[r];if(l.type===6){if(o)continue;if(l.name===n&&(l.value||s))return l}else if(l.name==="bind"&&(l.exp||s)&&at(l.arg,n))return l}}function at(t,n){return!!(t&&_e(t)&&t.content===n)}function Qc(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function ko(t){return t.type===5||t.type===2}function vs(t){return t.type===7&&t.name==="pre"}function Vc(t){return t.type===7&&t.name==="slot"}function En(t){return t.type===1&&t.tagType===3}function wn(t){return t.type===1&&t.tagType===2}const ed=new Set([Wt,Kt]);function bs(t,n=[]){if(t&&!ve(t)&&t.type===14){const o=t.callee;if(!ve(o)&&ed.has(o))return bs(t.arguments[0],n.concat(t))}return[t,n]}function xn(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],l=[],i;if(r&&!ve(r)&&r.type===14){const a=bs(r);r=a[0],l=a[1],i=l[l.length-1]}if(r==null||ve(r))s=Oe([n]);else if(r.type===14){const a=r.arguments[0];!ve(a)&&a.type===15?ks(n,a)||a.properties.unshift(n):r.callee===co?s=ye(o.helper(yn),[Oe([n]),r]):r.arguments.unshift(Oe([n])),!s&&(s=r)}else r.type===15?(ks(n,r)||r.properties.unshift(n),s=r):(s=ye(o.helper(yn),[Oe([n]),r]),i&&i.callee===Kt&&(i=l[l.length-2]));t.type===13?i?i.arguments[0]=s:t.props=s:i?i.arguments[0]=s:t.arguments[2]=s}function ks(t,n){let o=!1;if(t.key.type===4){const s=t.key.content;o=n.properties.some(r=>r.key.type===4&&r.key.content===s)}return o}function Jt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function td(t){return t.type===14&&t.callee===mo?t.arguments[1].returns:t}const nd=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Es(t){for(let n=0;n<t.length;n++)if(!Ie(t.charCodeAt(n)))return!1;return!0}function Eo(t){return t.type===2&&Es(t.content)||t.type===12&&Eo(t.content)}function wo(t){return t.type===3||Eo(t)}const ws={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:mn,isPreTag:mn,isIgnoreNewlineTag:mn,isCustomElement:mn,onError:vo,onWarn:ps,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let ee=ws,Yt=null,Qe="",Ne=null,V=null,$e="",Ve=-1,ut=-1,xo=0,ct=!1,No=null;const de=[],re=new qc(de,{onerr:Te,ontext(t,n){Nn(Ee(t,n),t,n)},ontextentity(t,n,o){Nn(t,n,o)},oninterpolation(t,n){if(ct)return Nn(Ee(t,n),t,n);let o=t+re.delimiterOpen.length,s=n-re.delimiterClose.length;for(;Ie(Qe.charCodeAt(o));)o++;for(;Ie(Qe.charCodeAt(s-1));)s--;let r=Ee(o,s);r.includes("&")&&(r=ee.decodeEntities(r,!1)),Co({type:5,content:Sn(r,!1,fe(o,s)),loc:fe(t,n)})},onopentagname(t,n){const o=Ee(t,n);Ne={type:1,tag:o,ns:ee.getNamespace(o,de[0],ee.ns),tagType:0,props:[],children:[],loc:fe(t-1,n),codegenNode:void 0}},onopentagend(t){Ns(t)},onclosetag(t,n){const o=Ee(t,n);if(!ee.isVoidTag(o)){let s=!1;for(let r=0;r<de.length;r++)if(de[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&Te(24,de[0].loc.start.offset);for(let i=0;i<=r;i++){const a=de.shift();Cn(a,n,i<r)}break}s||Te(23,Cs(t,60))}},onselfclosingtag(t){const n=Ne.tag;Ne.isSelfClosing=!0,Ns(t),de[0]&&de[0].tag===n&&Cn(de.shift(),t)},onattribname(t,n){V={type:6,name:Ee(t,n),nameLoc:fe(t,n),value:void 0,loc:fe(t)}},ondirname(t,n){const o=Ee(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!ct&&s===""&&Te(26,t),ct||s==="")V={type:6,name:o,nameLoc:fe(t,n),value:void 0,loc:fe(t)};else if(V={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[Q("prop")]:[],loc:fe(t)},s==="pre"){ct=re.inVPre=!0,No=Ne;const r=Ne.props;for(let l=0;l<r.length;l++)r[l].type===7&&(r[l]=pd(r[l]))}},ondirarg(t,n){if(t===n)return;const o=Ee(t,n);if(ct&&!vs(V))V.name+=o,mt(V.nameLoc,n);else{const s=o[0]!=="[";V.arg=Sn(s?o:o.slice(1,-1),s,fe(t,n),s?3:0)}},ondirmodifier(t,n){const o=Ee(t,n);if(ct&&!vs(V))V.name+="."+o,mt(V.nameLoc,n);else if(V.name==="slot"){const s=V.arg;s&&(s.content+="."+o,mt(s.loc,n))}else{const s=Q(o,!0,fe(t,n));V.modifiers.push(s)}},onattribdata(t,n){$e+=Ee(t,n),Ve<0&&(Ve=t),ut=n},onattribentity(t,n,o){$e+=t,Ve<0&&(Ve=n),ut=o},onattribnameend(t){const n=V.loc.start.offset,o=Ee(n,t);V.type===7&&(V.rawName=o),Ne.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&Te(2,n)},onattribend(t,n){if(Ne&&V){if(mt(V.loc,n),t!==0)if($e.includes("&")&&($e=ee.decodeEntities($e,!0)),V.type===6)V.name==="class"&&($e=Bs($e).trim()),t===1&&!$e&&Te(13,n),V.value={type:2,content:$e,loc:t===1?fe(Ve,ut):fe(Ve-1,ut+1)},re.inSFCRoot&&Ne.tag==="template"&&V.name==="lang"&&$e&&$e!=="html"&&re.enterRCDATA(bn("</template"),0);else{let o=0;V.exp=Sn($e,!1,fe(Ve,ut),0,o),V.name==="for"&&(V.forParseResult=sd(V.exp));let s=-1;V.name==="bind"&&(s=V.modifiers.findIndex(r=>r.content==="sync"))>-1&&It("COMPILER_V_BIND_SYNC",ee,V.loc,V.arg.loc.source)&&(V.name="model",V.modifiers.splice(s,1))}(V.type!==7||V.name!=="pre")&&Ne.props.push(V)}$e="",Ve=ut=-1},oncomment(t,n){ee.comments&&Co({type:3,content:Ee(t,n),loc:fe(t-4,n+3)})},onend(){const t=Qe.length;if(process.env.NODE_ENV!=="production"&&re.state!==1)switch(re.state){case 5:case 8:Te(5,t);break;case 3:case 4:Te(25,re.sectionStart);break;case 28:re.currentSequence===ke.CdataEnd?Te(6,t):Te(7,t);break;case 6:case 7:case 9:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:Te(9,t);break}for(let n=0;n<de.length;n++)Cn(de[n],t-1),Te(24,de[n].loc.start.offset)},oncdata(t,n){de[0].ns!==0?Nn(Ee(t,n),t,n):Te(1,t-9)},onprocessinginstruction(t){(de[0]?de[0].ns:ee.ns)===0&&Te(21,t-1)}}),xs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,od=/^\(|\)$/g;function sd(t){const n=t.loc,o=t.content,s=o.match(nd);if(!s)return;const[,r,l]=s,i=(f,g,b=!1)=>{const k=n.start.offset+g,v=k+f.length;return Sn(f,!1,fe(k,v),0,b?1:0)},a={source:i(l.trim(),o.indexOf(l,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=r.trim().replace(od,"").trim();const d=r.indexOf(c),m=c.match(xs);if(m){c=c.replace(xs,"").trim();const f=m[1].trim();let g;if(f&&(g=o.indexOf(f,d+c.length),a.key=i(f,g,!0)),m[2]){const b=m[2].trim();b&&(a.index=i(b,o.indexOf(b,a.key?g+f.length:d+c.length),!0))}}return c&&(a.value=i(c,d,!0)),a}function Ee(t,n){return Qe.slice(t,n)}function Ns(t){re.inSFCRoot&&(Ne.innerLoc=fe(t+1,t+1)),Co(Ne);const{tag:n,ns:o}=Ne;o===0&&ee.isPreTag(n)&&xo++,ee.isVoidTag(n)?Cn(Ne,t):(de.unshift(Ne),(o===1||o===2)&&(re.inXML=!0)),Ne=null}function Nn(t,n,o){{const l=de[0]&&de[0].tag;l!=="script"&&l!=="style"&&t.includes("&")&&(t=ee.decodeEntities(t,!1))}const s=de[0]||Yt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,mt(r.loc,o)):s.children.push({type:2,content:t,loc:fe(n,o)})}function Cn(t,n,o=!1){o?mt(t.loc,Cs(n,60)):mt(t.loc,rd(n,62)+1),re.inSFCRoot&&(t.children.length?t.innerLoc.end=st({},t.children[t.children.length-1].loc.end):t.innerLoc.end=st({},t.innerLoc.start),t.innerLoc.source=Ee(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:l}=t;if(ct||(s==="slot"?t.tagType=2:Ss(t)?t.tagType=3:ld(t)&&(t.tagType=1)),re.inRCDATA||(t.children=_s(l)),r===0&&ee.isIgnoreNewlineTag(s)){const i=l[0];i&&i.type===2&&(i.content=i.content.replace(/^\r?\n/,""))}r===0&&ee.isPreTag(s)&&xo--,No===t&&(ct=re.inVPre=!1,No=null),re.inXML&&(de[0]?de[0].ns:ee.ns)===0&&(re.inXML=!1);{const i=t.props;if(process.env.NODE_ENV!=="production"&&lt("COMPILER_V_IF_V_FOR_PRECEDENCE",ee)){let c=!1,d=!1;for(let m=0;m<i.length;m++){const f=i[m];if(f.type===7&&(f.name==="if"?c=!0:f.name==="for"&&(d=!0)),c&&d){kn("COMPILER_V_IF_V_FOR_PRECEDENCE",ee,t.loc);break}}}if(!re.inSFCRoot&&lt("COMPILER_NATIVE_TEMPLATE",ee)&&t.tag==="template"&&!Ss(t)){process.env.NODE_ENV!=="production"&&kn("COMPILER_NATIVE_TEMPLATE",ee,t.loc);const c=de[0]||Yt,d=c.children.indexOf(t);c.children.splice(d,1,...t.children)}const a=i.find(c=>c.type===6&&c.name==="inline-template");a&&It("COMPILER_INLINE_TEMPLATE",ee,a.loc)&&t.children.length&&(a.value={type:2,content:Ee(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:a.loc})}}function rd(t,n){let o=t;for(;Qe.charCodeAt(o)!==n&&o<Qe.length-1;)o++;return o}function Cs(t,n){let o=t;for(;Qe.charCodeAt(o)!==n&&o>=0;)o--;return o}const id=new Set(["if","else","else-if","for","slot"]);function Ss({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&id.has(n[o].name))return!0}return!1}function ld({tag:t,props:n}){if(ee.isCustomElement(t))return!1;if(t==="component"||ad(t.charCodeAt(0))||us(t)||ee.isBuiltInComponent&&ee.isBuiltInComponent(t)||ee.isNativeTag&&!ee.isNativeTag(t))return!0;for(let o=0;o<n.length;o++){const s=n[o];if(s.type===6){if(s.name==="is"&&s.value){if(s.value.content.startsWith("vue:"))return!0;if(It("COMPILER_IS_ON_ELEMENT",ee,s.loc))return!0}}else if(s.name==="bind"&&at(s.arg,"is")&&It("COMPILER_IS_ON_ELEMENT",ee,s.loc))return!0}return!1}function ad(t){return t>64&&t<91}const cd=/\r\n/g;function _s(t){const n=ee.whitespace!=="preserve";let o=!1;for(let s=0;s<t.length;s++){const r=t[s];if(r.type===2)if(xo)r.content=r.content.replace(cd,`
4
4
  `);else if(Es(r.content)){const l=t[s-1]&&t[s-1].type,i=t[s+1]&&t[s+1].type;!l||!i||n&&(l===3&&(i===3||i===1)||l===1&&(i===3||i===1&&dd(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=Bs(r.content))}return o?t.filter(Boolean):t}function dd(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function Bs(t){let n="",o=!1;for(let s=0;s<t.length;s++)Ie(t.charCodeAt(s))?o||(n+=" ",o=!0):(n+=t[s],o=!1);return n}function Co(t){(de[0]||Yt).children.push(t)}function fe(t,n){return{start:re.getPos(t),end:n==null?n:re.getPos(n),source:n==null?n:Ee(t,n)}}function fd(t){return fe(t.start.offset,t.end.offset)}function mt(t,n){t.end=re.getPos(n),t.source=Ee(t.start.offset,n)}function pd(t){const n={type:6,name:t.rawName,nameLoc:fe(t.loc.start.offset,t.loc.start.offset+t.rawName.length),value:void 0,loc:t.loc};if(t.exp){const o=t.exp.loc;o.end.offset<t.loc.end.offset&&(o.start.offset--,o.start.column--,o.end.offset++,o.end.column++),n.value={type:2,content:t.exp.content,loc:o}}return n}function Sn(t,n=!1,o,s=0,r=0){return Q(t,n,o,s)}function Te(t,n,o){ee.onError(oe(t,fe(n,n),void 0,o))}function ud(){re.reset(),Ne=null,V=null,$e="",Ve=-1,ut=-1,de.length=0}function md(t,n){if(ud(),Qe=t,ee=st({},ws),n){let r;for(r in n)n[r]!=null&&(ee[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!ee.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");re.mode=ee.parseMode==="html"?1:ee.parseMode==="sfc"?2:0,re.inXML=ee.ns===1||ee.ns===2;const o=n&&n.delimiters;o&&(re.delimiterOpen=bn(o[0]),re.delimiterClose=bn(o[1]));const s=Yt=jc([],t);return re.parse(Qe),s.loc=fe(0,t.length),s.children=_s(s.children),Yt=null,s}function hd(t,n){_n(t,void 0,n,!!$s(t))}function $s(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!wn(n[0])?n[0]:null}function _n(t,n,o,s=!1,r=!1){const{children:l}=t,i=[];for(let m=0;m<l.length;m++){const f=l[m];if(f.type===1&&f.tagType===0){const g=s?0:De(f,o);if(g>0){if(g>=2){f.codegenNode.patchFlag=-1,i.push(f);continue}}else{const b=f.codegenNode;if(b.type===13){const k=b.patchFlag;if((k===void 0||k===512||k===1)&&Ls(f,o)>=2){const v=As(f);v&&(b.props=o.hoist(v))}b.dynamicProps&&(b.dynamicProps=o.hoist(b.dynamicProps))}}}else if(f.type===12&&(s?0:De(f,o))>=2){f.codegenNode.type===14&&f.codegenNode.arguments.length>0&&f.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${jt[-1]} */`:"")),i.push(f);continue}if(f.type===1){const g=f.tagType===1;g&&o.scopes.vSlot++,_n(f,t,o,!1,r),g&&o.scopes.vSlot--}else if(f.type===11)_n(f,t,o,f.children.length===1,!0);else if(f.type===9)for(let g=0;g<f.branches.length;g++)_n(f.branches[g],t,o,f.branches[g].children.length===1,r)}let a=!1;if(i.length===l.length&&t.type===1){if(t.tagType===0&&t.codegenNode&&t.codegenNode.type===13&&Xe(t.codegenNode.children))t.codegenNode.children=c(pt(t.codegenNode.children)),a=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Xe(t.codegenNode.children)&&t.codegenNode.children.type===15){const m=d(t.codegenNode,"default");m&&(m.returns=c(pt(m.returns)),a=!0)}else if(t.tagType===3&&n&&n.type===1&&n.tagType===1&&n.codegenNode&&n.codegenNode.type===13&&n.codegenNode.children&&!Xe(n.codegenNode.children)&&n.codegenNode.children.type===15){const m=Be(t,"slot",!0),f=m&&m.arg&&d(n.codegenNode,m.arg);f&&(f.returns=c(pt(f.returns)),a=!0)}}if(!a)for(const m of i)m.codegenNode=o.cache(m.codegenNode);function c(m){const f=o.cache(m);return f.needArraySpread=!0,f}function d(m,f){if(m.children&&!Xe(m.children)&&m.children.type===15){const g=m.children.properties.find(b=>b.key===f||b.key.content===f);return g&&g.value}}i.length&&o.transformHoist&&o.transformHoist(l,o,t)}function De(t,n){const{constantCache:o}=n;switch(t.type){case 1:if(t.tagType!==0)return 0;const s=o.get(t);if(s!==void 0)return s;const r=t.codegenNode;if(r.type!==13||r.isBlock&&t.tag!=="svg"&&t.tag!=="foreignObject"&&t.tag!=="math")return 0;if(r.patchFlag===void 0){let i=3;const a=Ls(t,n);if(a===0)return o.set(t,0),0;a<i&&(i=a);for(let c=0;c<t.children.length;c++){const d=De(t.children[c],n);if(d===0)return o.set(t,0),0;d<i&&(i=d)}if(i>1)for(let c=0;c<t.props.length;c++){const d=t.props[c];if(d.type===7&&d.name==="bind"&&d.exp){const m=De(d.exp,n);if(m===0)return o.set(t,0),0;m<i&&(i=m)}}if(r.isBlock){for(let c=0;c<t.props.length;c++)if(t.props[c].type===7)return o.set(t,0),0;n.removeHelper(ft),n.removeHelper(At(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper(Lt(n.inSSR,r.isComponent))}return o.set(t,i),i}else return o.set(t,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return De(t.content,n);case 4:return t.constType;case 8:let l=3;for(let i=0;i<t.children.length;i++){const a=t.children[i];if(ve(a)||Zn(a))continue;const c=De(a,n);if(c===0)return 0;c<l&&(l=c)}return l;case 20:return 2;default:return process.env.NODE_ENV,0}}const gd=new Set([lo,ao,Wt,Kt]);function Ts(t,n){if(t.type===14&&!ve(t.callee)&&gd.has(t.callee)){const o=t.arguments[0];if(o.type===4)return De(o,n);if(o.type===14)return Ts(o,n)}return 0}function Ls(t,n){let o=3;const s=As(t);if(s&&s.type===15){const{properties:r}=s;for(let l=0;l<r.length;l++){const{key:i,value:a}=r[l],c=De(i,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=De(a,n):a.type===14?d=Ts(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function As(t){const n=t.codegenNode;if(n.type===13)return n.props}function yd(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:l=!1,nodeTransforms:i=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=Kn,isCustomElement:m=Kn,expressionPlugins:f=[],scopeId:g=null,slotted:b=!0,ssr:k=!1,inSSR:v=!1,ssrCssVars:x="",bindingMetadata:E=yc,inline:j=!1,isTS:S=!1,onError:L=vo,onWarn:R=ps,compatConfig:I}){const A=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),h={filename:n,selfName:A&&Yn(rt(A[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:l,nodeTransforms:i,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:m,expressionPlugins:f,scopeId:g,slotted:b,ssr:k,inSSR:v,ssrCssVars:x,bindingMetadata:E,inline:j,isTS:S,onError:L,onWarn:R,compatConfig:I,root:t,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:t,childIndex:0,inVOnce:!1,helper(T){const F=h.helpers.get(T)||0;return h.helpers.set(T,F+1),T},removeHelper(T){const F=h.helpers.get(T);if(F){const P=F-1;P?h.helpers.set(T,P):h.helpers.delete(T)}},helperString(T){return`_${$t[h.helper(T)]}`},replaceNode(T){if(process.env.NODE_ENV!=="production"){if(!h.currentNode)throw new Error("Node being replaced is already removed.");if(!h.parent)throw new Error("Cannot replace root node.")}h.parent.children[h.childIndex]=h.currentNode=T},removeNode(T){if(process.env.NODE_ENV!=="production"&&!h.parent)throw new Error("Cannot remove root node.");const F=h.parent.children,P=T?F.indexOf(T):h.currentNode?h.childIndex:-1;if(process.env.NODE_ENV!=="production"&&P<0)throw new Error("node being removed is not a child of current parent");!T||T===h.currentNode?(h.currentNode=null,h.onNodeRemoved()):h.childIndex>P&&(h.childIndex--,h.onNodeRemoved()),h.parent.children.splice(P,1)},onNodeRemoved:Kn,addIdentifiers(T){},removeIdentifiers(T){},hoist(T){ve(T)&&(T=Q(T)),h.hoists.push(T);const F=Q(`_hoisted_${h.hoists.length}`,!1,T.loc,2);return F.hoisted=T,F},cache(T,F=!1,P=!1){const K=Hc(h.cached.length,T,F,P);return h.cached.push(K),K}};return h.filters=new Set,h}function vd(t,n){const o=yd(t,n);Bn(t,o),n.hoistStatic&&hd(t,o),n.ssr||bd(t,o),t.helpers=new Set([...o.helpers.keys()]),t.components=[...o.components],t.directives=[...o.directives],t.imports=o.imports,t.hoists=o.hoists,t.temps=o.temps,t.cached=o.cached,t.transformed=!0,t.filters=[...o.filters]}function bd(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=$s(t);if(r&&r.codegenNode){const l=r.codegenNode;l.type===13&&go(l,n),t.codegenNode=l}else t.codegenNode=s[0]}else if(s.length>1){let r=64;process.env.NODE_ENV!=="production"&&s.filter(l=>l.type!==3).length===1&&(r|=2048),t.codegenNode=Gt(n,o(Ht),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function kd(t,n){let o=0;const s=()=>{o--};for(;o<t.children.length;o++){const r=t.children[o];ve(r)||(n.grandParent=n.parent,n.parent=t,n.childIndex=o,n.onNodeRemoved=s,Bn(r,n))}}function Bn(t,n){n.currentNode=t;const{nodeTransforms:o}=n,s=[];for(let l=0;l<o.length;l++){const i=o[l](t,n);if(i&&(Xe(i)?s.push(...i):s.push(i)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(qt);break;case 5:n.ssr||n.helper(gn);break;case 9:for(let l=0;l<t.branches.length;l++)Bn(t.branches[l],n);break;case 10:case 11:case 1:case 0:kd(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function Is(t,n){const o=ve(t)?s=>s===t:s=>t.test(s);return(s,r)=>{if(s.type===1){const{props:l}=s;if(s.tagType===3&&l.some(Vc))return;const i=[];for(let a=0;a<l.length;a++){const c=l[a];if(c.type===7&&o(c.name)){l.splice(a,1),a--;const d=n(s,c,r);d&&i.push(d)}}return i}}}const $n="/*@__PURE__*/",Ds=t=>`${$t[t]}: _${$t[t]}`;function Ed(t,{mode:n="function",prefixIdentifiers:o=n==="module",sourceMap:s=!1,filename:r="template.vue.html",scopeId:l=null,optimizeImports:i=!1,runtimeGlobalName:a="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:d="vue/server-renderer",ssr:m=!1,isTS:f=!1,inSSR:g=!1}){const b={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:l,optimizeImports:i,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:m,isTS:f,inSSR:g,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(v){return`_${$t[v]}`},push(v,x=-2,E){b.code+=v},indent(){k(++b.indentLevel)},deindent(v=!1){v?--b.indentLevel:k(--b.indentLevel)},newline(){k(b.indentLevel)}};function k(v){b.push(`
@@ -6,4 +6,4 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6
6
  `,-1),c())),t.components.length&&(So(t.components,"component",o),(t.directives.length||t.temps>0)&&c()),t.directives.length&&(So(t.directives,"directive",o),t.temps>0&&c()),t.filters&&t.filters.length&&(c(),So(t.filters,"filter",o),c()),t.temps>0){r("let ");for(let j=0;j<t.temps;j++)r(`${j>0?", ":""}_temp${j}`)}return(t.components.length||t.directives.length||t.temps)&&(r(`
7
7
  `,0),c()),m||r("return "),t.codegenNode?Ce(t.codegenNode,o):r("null"),b&&(a(),r("}")),a(),r("}"),{ast:t,code:o.code,preamble:"",map:o.map?o.map.toJSON():void 0}}function xd(t,n){const{ssr:o,prefixIdentifiers:s,push:r,newline:l,runtimeModuleName:i,runtimeGlobalName:a,ssrRuntimeModuleName:c}=n,d=a,m=Array.from(t.helpers);if(m.length>0&&(r(`const _Vue = ${d}
8
8
  `,-1),t.hoists.length)){const f=[Qn,Vn,qt,eo,rs].filter(g=>m.includes(g)).map(Ds).join(", ");r(`const { ${f} } = _Vue
9
- `,-1)}Nd(t.hoists,n),l(),r("return ")}function So(t,n,{helper:o,push:s,newline:r,isTS:l}){const i=o(n==="filter"?so:n==="component"?to:oo);for(let a=0;a<t.length;a++){let c=t[a];const d=c.endsWith("__self");d&&(c=c.slice(0,-6)),s(`const ${Jt(c,n)} = ${i}(${JSON.stringify(c)}${d?", true":""})${l?"!":""}`),a<t.length-1&&r()}}function Nd(t,n){if(!t.length)return;n.pure=!0;const{push:o,newline:s}=n;s();for(let r=0;r<t.length;r++){const l=t[r];l&&(o(`const _hoisted_${r+1} = `),Ce(l,n),s())}n.pure=!1}function Cd(t){return ve(t)||t.type===4||t.type===2||t.type===5||t.type===8}function _o(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Xe(s)||!Cd(s));n.push("["),o&&n.indent(),Xt(t,n,o),o&&n.deindent(),n.push("]")}function Xt(t,n,o=!1,s=!0){const{push:r,newline:l}=n;for(let i=0;i<t.length;i++){const a=t[i];ve(a)?r(a,-3):Xe(a)?_o(a,n):Ce(a,n),i<t.length-1&&(o?(s&&r(","),l()):s&&r(", "))}}function Ce(t,n){if(ve(t)){n.push(t,-3);return}if(Zn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&ys(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Ce(t.codegenNode,n);break;case 2:Sd(t,n);break;case 4:Os(t,n);break;case 5:_d(t,n);break;case 12:Ce(t.codegenNode,n);break;case 8:Ms(t,n);break;case 3:$d(t,n);break;case 13:Td(t,n);break;case 14:Ad(t,n);break;case 15:Id(t,n);break;case 17:Dd(t,n);break;case 18:Od(t,n);break;case 19:Md(t,n);break;case 20:Rd(t,n);break;case 21:Xt(t.body,n,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return ys(!1,`unhandled codegen node type: ${t.type}`),t}}function Sd(t,n){n.push(JSON.stringify(t.content),-3,t)}function Os(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function _d(t,n){const{push:o,helper:s,pure:r}=n;r&&o($n),o(`${s(gn)}(`),Ce(t.content,n),o(")")}function Ms(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];ve(s)?n.push(s,-3):Ce(s,n)}}function Bd(t,n){const{push:o}=n;if(t.type===8)o("["),Ms(t,n),o("]");else if(t.isStatic){const s=bo(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function $d(t,n){const{push:o,helper:s,pure:r}=n;r&&o($n),o(`${s(qt)}(${JSON.stringify(t.content)})`,-3,t)}function Td(t,n){const{push:o,helper:s,pure:r}=n,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:d,directives:m,isBlock:f,disableTracking:g,isComponent:b}=t;let k;if(c)if(process.env.NODE_ENV!=="production")if(c<0)k=c+` /* ${jt[c]} */`;else{const x=Object.keys(jt).map(Number).filter(E=>E>0&&c&E).map(E=>jt[E]).join(", ");k=c+` /* ${x} */`}else k=String(c);m&&o(s(ro)+"("),f&&o(`(${s(ft)}(${g?"true":""}), `),r&&o($n);const v=f?At(n.inSSR,b):Lt(n.inSSR,b);o(s(v)+"(",-2,t),Xt(Ld([l,i,a,k,d]),n),o(")"),f&&o(")"),m&&(o(", "),Ce(m,n),o(")"))}function Ld(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function Ad(t,n){const{push:o,helper:s,pure:r}=n,l=ve(t.callee)?t.callee:s(t.callee);r&&o($n),o(l+"(",-2,t),Xt(t.arguments,n),o(")")}function Id(t,n){const{push:o,indent:s,deindent:r,newline:l}=n,{properties:i}=t;if(!i.length){o("{}",-2,t);return}const a=i.length>1||process.env.NODE_ENV!=="production"&&i.some(c=>c.value.type!==4);o(a?"{":"{ "),a&&s();for(let c=0;c<i.length;c++){const{key:d,value:m}=i[c];Bd(d,n),o(": "),Ce(m,n),c<i.length-1&&(o(","),l())}a&&r(),o(a?"}":" }")}function Dd(t,n){_o(t.elements,n)}function Od(t,n){const{push:o,indent:s,deindent:r}=n,{params:l,returns:i,body:a,newline:c,isSlot:d}=t;d&&o(`_${$t[uo]}(`),o("(",-2,t),Xe(l)?Xt(l,n):l&&Ce(l,n),o(") => "),(c||a)&&(o("{"),s()),i?(c&&o("return "),Xe(i)?_o(i,n):Ce(i,n)):a&&Ce(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function Md(t,n){const{test:o,consequent:s,alternate:r,newline:l}=t,{push:i,indent:a,deindent:c,newline:d}=n;if(o.type===4){const f=!bo(o.content);f&&i("("),Os(o,n),f&&i(")")}else i("("),Ce(o,n),i(")");l&&a(),n.indentLevel++,l||i(" "),i("? "),Ce(s,n),n.indentLevel--,l&&d(),l||i(" "),i(": ");const m=r.type===19;m||n.indentLevel++,Ce(r,n),m||n.indentLevel--,l&&c(!0)}function Rd(t,n){const{push:o,helper:s,indent:r,deindent:l,newline:i}=n,{needPauseTracking:a,needArraySpread:c}=t;c&&o("[...("),o(`_cache[${t.index}] || (`),a&&(r(),o(`${s(vn)}(-1`),t.inVOnce&&o(", true"),o("),"),i(),o("(")),o(`_cache[${t.index}] = `),Ce(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),i(),o(`${s(vn)}(1),`),i(),o(`_cache[${t.index}]`),l()),o(")"),c&&o(")]")}const Fd=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),Pd=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function ht(t,n,o=!1,s=!1){const r=t.content;if(r.trim())try{new Function(s?` ${r} `:`return ${o?`(${r}) => {}`:`(${r})`}`)}catch(l){let i=l.message;const a=r.replace(Pd,"").match(Fd);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(oe(46,t.loc,void 0,i))}}const zd=(t,n)=>{if(t.type===5)t.content=Bo(t.content,n);else if(t.type===1){const o=Be(t,"memo");for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&r.name!=="for"){const l=r.exp,i=r.arg;l&&l.type===4&&!(r.name==="on"&&i)&&!(o&&i&&i.type===4&&i.content==="key")&&(r.exp=Bo(l,n,r.name==="slot")),i&&i.type===4&&!i.isStatic&&(r.arg=Bo(i,n))}}}};function Bo(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&ht(t,n,o,s),t}const jd=Is(/^(?:if|else|else-if)$/,(t,n,o)=>Hd(t,n,o,(s,r,l)=>{const i=o.parent.children;let a=i.indexOf(s),c=0;for(;a-->=0;){const d=i[a];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(l)s.codegenNode=Fs(r,c,o);else{const d=qd(s.codegenNode);d.alternate=Fs(r,c+s.branches.length-1,o)}}}));function Hd(t,n,o,s){if(n.name!=="else"&&(!n.exp||!n.exp.content.trim())){const r=n.exp?n.exp.loc:t.loc;o.onError(oe(28,n.loc)),n.exp=Q("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&ht(n.exp,o),n.name==="if"){const r=Rs(t,n),l={type:9,loc:fd(t.loc),branches:[r]};if(o.replaceNode(l),s)return s(l,r,!0)}else{const r=o.parent.children,l=[];let i=r.indexOf(t);for(;i-->=-1;){const a=r[i];if(a&&wo(a)){o.removeNode(a),process.env.NODE_ENV!=="production"&&a.type===3&&l.unshift(a);continue}if(a&&a.type===9){(n.name==="else-if"||n.name==="else")&&a.branches[a.branches.length-1].condition===void 0&&o.onError(oe(30,t.loc)),o.removeNode();const c=Rs(t,n);if(process.env.NODE_ENV!=="production"&&l.length&&!(o.parent&&o.parent.type===1&&(o.parent.tag==="transition"||o.parent.tag==="Transition"))&&(c.children=[...l,...c.children]),process.env.NODE_ENV!=="production"){const m=c.userKey;m&&a.branches.forEach(({userKey:f})=>{Ud(f,m)&&o.onError(oe(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);Bn(c,o),d&&d(),o.currentNode=null}else o.onError(oe(30,t.loc));break}}}function Rs(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!Be(t,"for")?t.children:[t],userKey:Zt(t,"key"),isTemplateIf:o}}function Fs(t,n,o){return t.condition?ho(t.condition,Ps(t,n,o),ye(o.helper(qt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Ps(t,n,o)}function Ps(t,n,o){const{helper:s}=o,r=me("key",Q(`${n}`,!1,Ae,2)),{children:l}=t,i=l[0];if(l.length!==1||i.type!==1)if(l.length===1&&i.type===11){const c=i.codegenNode;return xn(c,r,o),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!t.isTemplateIf&&l.filter(d=>d.type!==3).length===1&&(c|=2048),Gt(o,s(Ht),Oe([r]),l,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=i.codegenNode,d=td(c);return d.type===13&&go(d,o),xn(d,r,o),c}}function Ud(t,n){if(!t||t.type!==n.type)return!1;if(t.type===6){if(t.value.content!==n.value.content)return!1}else{const o=t.exp,s=n.exp;if(o.type!==s.type||o.type!==4||o.isStatic!==s.isStatic||o.content!==s.content)return!1}return!0}function qd(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const Wd=Is("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return Kd(t,n,o,l=>{const i=ye(s(io),[l.source]),a=En(t),c=Be(t,"memo"),d=Zt(t,"key",!1,!0);d&&d.type;let m=d&&(d.type===6?d.value?Q(d.value.content,!0):void 0:d.exp);const f=d&&m?me("key",m):null,g=l.source.type===4&&l.source.constType>0,b=g?64:d?128:256;return l.codegenNode=Gt(o,s(Ht),void 0,i,b,void 0,void 0,!0,!g,!1,t.loc),()=>{let k;const{children:v}=l;process.env.NODE_ENV!=="production"&&a&&t.children.some(j=>{if(j.type===1){const S=Zt(j,"key");if(S)return o.onError(oe(33,S.loc)),!0}});const x=v.length!==1||v[0].type!==1,E=wn(t)?t:a&&t.children.length===1&&wn(t.children[0])?t.children[0]:null;if(E?(k=E.codegenNode,a&&f&&xn(k,f,o)):x?k=Gt(o,s(Ht),f?Oe([f]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(k=v[0].codegenNode,a&&f&&xn(k,f,o),k.isBlock!==!g&&(k.isBlock?(r(ft),r(At(o.inSSR,k.isComponent))):r(Lt(o.inSSR,k.isComponent))),k.isBlock=!g,k.isBlock?(s(ft),s(At(o.inSSR,k.isComponent))):s(Lt(o.inSSR,k.isComponent))),c){const j=Tt($o(l.parseResult,[Q("_cached")]));j.body=Uc([Fe(["const _memo = (",c.exp,")"]),Fe(["if (_cached",...m?[" && _cached.key === ",m]:[],` && ${o.helperString(as)}(_cached, _memo)) return _cached`]),Fe(["const _item = ",k]),Q("_item.memo = _memo"),Q("return _item")]),i.arguments.push(j,Q("_cache"),Q(String(o.cached.length))),o.cached.push(null)}else i.arguments.push(Tt($o(l.parseResult),k,!0))}})});function Kd(t,n,o,s){if(!n.exp){o.onError(oe(31,n.loc));return}const r=n.forParseResult;if(!r){o.onError(oe(32,n.loc));return}zs(r,o);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=o,{source:c,value:d,key:m,index:f}=r,g={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:m,objectIndexAlias:f,parseResult:r,children:En(t)?t.children:[t]};o.replaceNode(g),a.vFor++;const b=s&&s(g);return()=>{a.vFor--,b&&b()}}function zs(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(ht(t.source,n),t.key&&ht(t.key,n,!0),t.index&&ht(t.index,n,!0),t.value&&ht(t.value,n,!0)),t.finalized=!0)}function $o({value:t,key:n,index:o},s=[]){return Gd([t,n,o,...s])}function Gd(t){let n=t.length;for(;n--&&!t[n];);return t.slice(0,n+1).map((o,s)=>o||Q("_".repeat(s+1),!1))}const js=Q("undefined",!1),Zd=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=Be(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},Jd=(t,n,o,s)=>Tt(t,o,!1,!0,o.length?o[0].loc:s);function Yd(t,n,o=Jd){n.helper(uo);const{children:s,loc:r}=t,l=[],i=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=Be(t,"slot",!0);if(c){const{arg:x,exp:E}=c;x&&!_e(x)&&(a=!0),l.push(me(x||Q("default",!0),o(E,void 0,s,r)))}let d=!1,m=!1;const f=[],g=new Set;let b=0;for(let x=0;x<s.length;x++){const E=s[x];let j;if(!En(E)||!(j=Be(E,"slot",!0))){E.type!==3&&f.push(E);continue}if(c){n.onError(oe(37,j.loc));break}d=!0;const{children:S,loc:L}=E,{arg:R=Q("default",!0),exp:I,loc:A}=j;let h;_e(R)?h=R?R.content:"default":a=!0;const T=Be(E,"for"),F=o(I,T,S,L);let P,K;if(P=Be(E,"if"))a=!0,i.push(ho(P.exp,Tn(R,F,b++),js));else if(K=Be(E,/^else(?:-if)?$/,!0)){let Z=x,B;for(;Z--&&(B=s[Z],!!wo(B)););if(B&&En(B)&&Be(B,/^(?:else-)?if$/)){let M=i[i.length-1];for(;M.alternate.type===19;)M=M.alternate;M.alternate=K.exp?ho(K.exp,Tn(R,F,b++),js):Tn(R,F,b++)}else n.onError(oe(30,K.loc))}else if(T){a=!0;const Z=T.forParseResult;Z?(zs(Z,n),i.push(ye(n.helper(io),[Z.source,Tt($o(Z),Tn(R,F),!0)]))):n.onError(oe(32,T.loc))}else{if(h){if(g.has(h)){n.onError(oe(38,A));continue}g.add(h),h==="default"&&(m=!0)}l.push(me(R,F))}}if(!c){const x=(E,j)=>{const S=o(E,void 0,j,r);return n.compatConfig&&(S.isNonScopedSlot=!0),me("default",S)};d?f.length&&!f.every(Eo)&&(m?n.onError(oe(39,f[0].loc)):l.push(x(void 0,f))):l.push(x(void 0,s))}const k=a?2:Ln(t.children)?3:1;let v=Oe(l.concat(me("_",Q(k+(process.env.NODE_ENV!=="production"?` /* ${wc[k]} */`:""),!1))),r);return i.length&&(v=ye(n.helper(ls),[v,pt(i)])),{slots:v,hasDynamicSlots:a}}function Tn(t,n,o){const s=[me("name",t),me("fn",n)];return o!=null&&s.push(me("key",Q(String(o),!0))),Oe(s)}function Ln(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||Ln(o.children))return!0;break;case 9:if(Ln(o.branches))return!0;break;case 10:case 11:if(Ln(o.children))return!0;break}}return!1}const Hs=new WeakMap,Xd=(t,n)=>function(){if(t=n.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:s,props:r}=t,l=t.tagType===1;let i=l?Qd(t,n):`"${s}"`;const a=vc(i)&&i.callee===no;let c,d,m=0,f,g,b,k=a||i===Ut||i===Xn||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const v=Us(t,n,void 0,l,a);c=v.props,m=v.patchFlag,g=v.dynamicPropNames;const x=v.directives;b=x&&x.length?pt(x.map(E=>ef(E,n))):void 0,v.shouldUseBlock&&(k=!0)}if(t.children.length>0)if(i===hn&&(k=!0,m|=1024,process.env.NODE_ENV!=="production"&&t.children.length>1&&n.onError(oe(47,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}))),l&&i!==Ut&&i!==hn){const{slots:x,hasDynamicSlots:E}=Yd(t,n);d=x,E&&(m|=1024)}else if(t.children.length===1&&i!==Ut){const x=t.children[0],E=x.type,j=E===5||E===8;j&&De(x,n)===0&&(m|=1),j||E===2?d=x:d=t.children}else d=t.children;g&&g.length&&(f=tf(g)),t.codegenNode=Gt(n,i,c,d,m===0?void 0:m,f,b,!!k,!1,l,t.loc)};function Qd(t,n,o=!1){let{tag:s}=t;const r=To(s),l=Zt(t,"is",!1,!0);if(l)if(r||lt("COMPILER_IS_ON_ELEMENT",n)){let a;if(l.type===6?a=l.value&&Q(l.value.content,!0):(a=l.exp,a||(a=Q("is",!1,l.arg.loc))),a)return ye(n.helper(no),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=us(s)||n.isBuiltInComponent(s);return i?(o||n.helper(i),i):(n.helper(to),n.components.add(s),Jt(s,"component"))}function Us(t,n,o=t.props,s,r,l=!1){const{tag:i,loc:a,children:c}=t;let d=[];const m=[],f=[],g=c.length>0;let b=!1,k=0,v=!1,x=!1,E=!1,j=!1,S=!1,L=!1;const R=[],I=F=>{d.length&&(m.push(Oe(qs(d),a)),d=[]),F&&m.push(F)},A=()=>{n.scopes.vFor>0&&d.push(me(Q("ref_for",!0),Q("true")))},h=({key:F,value:P})=>{if(_e(F)){const K=F.content,Z=Gn(K);if(Z&&(!s||r)&&K.toLowerCase()!=="onclick"&&K!=="onUpdate:modelValue"&&!ts(K)&&(j=!0),Z&&ts(K)&&(L=!0),Z&&P.type===14&&(P=P.arguments[0]),P.type===20||(P.type===4||P.type===8)&&De(P,n)>0)return;K==="ref"?v=!0:K==="class"?x=!0:K==="style"?E=!0:K!=="key"&&!R.includes(K)&&R.push(K),s&&(K==="class"||K==="style")&&!R.includes(K)&&R.push(K)}else S=!0};for(let F=0;F<o.length;F++){const P=o[F];if(P.type===6){const{loc:K,name:Z,nameLoc:B,value:M}=P;let w=!0;if(Z==="ref"&&(v=!0,A()),Z==="is"&&(To(i)||M&&M.content.startsWith("vue:")||lt("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(me(Q(Z,!0,B),Q(M?M.content:"",w,M?M.loc:K)))}else{const{name:K,arg:Z,exp:B,loc:M,modifiers:w}=P,z=K==="bind",ne=K==="on";if(K==="slot"){s||n.onError(oe(40,M));continue}if(K==="once"||K==="memo"||K==="is"||z&&at(Z,"is")&&(To(i)||lt("COMPILER_IS_ON_ELEMENT",n))||ne&&l)continue;if((z&&at(Z,"key")||ne&&g&&at(Z,"vue:before-update"))&&(b=!0),z&&at(Z,"ref")&&A(),!Z&&(z||ne)){if(S=!0,B)if(z){if(I(),process.env.NODE_ENV!=="production"&&m.some(pe=>pe.type===15?pe.properties.some(({key:Le})=>Le.type!==4||!Le.isStatic?!0:Le.content!=="class"&&Le.content!=="style"&&!Gn(Le.content)):!0)&&It("COMPILER_V_BIND_OBJECT_ORDER",n,M),lt("COMPILER_V_BIND_OBJECT_ORDER",n)){m.unshift(B);continue}A(),I(),m.push(B)}else I({type:14,loc:M,callee:n.helper(co),arguments:s?[B]:[B,"true"]});else n.onError(oe(z?34:35,M));continue}z&&w.some(we=>we.content==="prop")&&(k|=32);const We=n.directiveTransforms[K];if(We){const{props:we,needRuntime:pe}=We(P,t,n);!l&&we.forEach(h),ne&&Z&&!_e(Z)?I(Oe(we,a)):d.push(...we),pe&&(f.push(P),Zn(pe)&&Hs.set(P,pe))}else bc(K)||(f.push(P),g&&(b=!0))}}let T;if(m.length?(I(),m.length>1?T=ye(n.helper(yn),m,a):T=m[0]):d.length&&(T=Oe(qs(d),a)),S?k|=16:(x&&!s&&(k|=2),E&&!s&&(k|=4),R.length&&(k|=8),j&&(k|=32)),!b&&(k===0||k===32)&&(v||L||f.length>0)&&(k|=512),!n.inSSR&&T)switch(T.type){case 15:let F=-1,P=-1,K=!1;for(let M=0;M<T.properties.length;M++){const w=T.properties[M].key;_e(w)?w.content==="class"?F=M:w.content==="style"&&(P=M):w.isHandlerKey||(K=!0)}const Z=T.properties[F],B=T.properties[P];K?T=ye(n.helper(Wt),[T]):(Z&&!_e(Z.value)&&(Z.value=ye(n.helper(lo),[Z.value])),B&&(E||B.value.type===4&&B.value.content.trim()[0]==="["||B.value.type===17)&&(B.value=ye(n.helper(ao),[B.value])));break;case 14:break;default:T=ye(n.helper(Wt),[ye(n.helper(Kt),[T])]);break}return{props:T,directives:f,patchFlag:k,dynamicPropNames:R,shouldUseBlock:b}}function qs(t){const n=new Map,o=[];for(let s=0;s<t.length;s++){const r=t[s];if(r.key.type===8||!r.key.isStatic){o.push(r);continue}const l=r.key.content,i=n.get(l);i?(l==="style"||l==="class"||Gn(l))&&Vd(i,r):(n.set(l,r),o.push(r))}return o}function Vd(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=pt([t.value,n.value],t.loc)}function ef(t,n){const o=[],s=Hs.get(t);s?o.push(n.helperString(s)):(n.helper(oo),n.directives.add(t.name),o.push(Jt(t.name,"directive")));const{loc:r}=t;if(t.exp&&o.push(t.exp),t.arg&&(t.exp||o.push("void 0"),o.push(t.arg)),Object.keys(t.modifiers).length){t.arg||(t.exp||o.push("void 0"),o.push("void 0"));const l=Q("true",!1,r);o.push(Oe(t.modifiers.map(i=>me(i,l)),r))}return pt(o,t.loc)}function tf(t){let n="[";for(let o=0,s=t.length;o<s;o++)n+=JSON.stringify(t[o]),o<s-1&&(n+=", ");return n+"]"}function To(t){return t==="component"||t==="Component"}const nf=(t,n)=>{if(wn(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:l}=of(t,n),i=[n.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;l&&(i[2]=l,a=3),o.length&&(i[3]=Tt([],o,!1,!1,s),a=4),n.scopeId&&!n.slotted&&(a=5),i.splice(a),t.codegenNode=ye(n.helper(is),i,s)}};function of(t,n){let o='"default"',s;const r=[];for(let l=0;l<t.props.length;l++){const i=t.props[l];if(i.type===6)i.value&&(i.name==="name"?o=JSON.stringify(i.value.content):(i.name=rt(i.name),r.push(i)));else if(i.name==="bind"&&at(i.arg,"name")){if(i.exp)o=i.exp;else if(i.arg&&i.arg.type===4){const a=rt(i.arg.content);o=i.exp=Q(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&_e(i.arg)&&(i.arg.content=rt(i.arg.content)),r.push(i)}if(r.length>0){const{props:l,directives:i}=Us(t,n,r,!1,!1);s=l,i.length&&n.onError(oe(36,i[0].loc))}return{slotName:o,slotProps:s}}const Ws=(t,n,o,s)=>{const{loc:r,modifiers:l,arg:i}=t;!t.exp&&!l.length&&o.onError(oe(35,r));let a;if(i.type===4)if(i.isStatic){let f=i.content;process.env.NODE_ENV!=="production"&&f.startsWith("vnode")&&o.onError(oe(52,i.loc)),f.startsWith("vue:")&&(f=`vnode-${f.slice(4)}`);const g=n.tagType!==0||f.startsWith("vnode")||!/[A-Z]/.test(f)?Ec(rt(f)):`on:${f}`;a=Q(g,!0,i.loc)}else a=Fe([`${o.helperString(po)}(`,i,")"]);else a=i,a.children.unshift(`${o.helperString(po)}(`),a.children.push(")");let c=t.exp;c&&!c.content.trim()&&(c=void 0);let d=o.cacheHandlers&&!c&&!o.inVOnce;if(c){const f=gs(c),g=!(f||Xc(c)),b=c.content.includes(";");process.env.NODE_ENV!=="production"&&ht(c,o,!1,b),(g||d&&f)&&(c=Fe([`${g?"$event":"(...args)"} => ${b?"{":"("}`,c,b?"}":")"]))}let m={props:[me(a,c||Q("() => {}",!1,r))]};return s&&(m=s(m)),d&&(m.props[0].value=o.cache(m.props[0].value)),m.props.forEach(f=>f.key.isHandlerKey=!0),m},sf=(t,n,o)=>{const{modifiers:s,loc:r}=t,l=t.arg;let{exp:i}=t;return i&&i.type===4&&!i.content.trim()&&(i=void 0),l.type!==4?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=l.content?`${l.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(l.type===4?l.isStatic?l.content=rt(l.content):l.content=`${o.helperString(fo)}(${l.content})`:(l.children.unshift(`${o.helperString(fo)}(`),l.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&Ks(l,"."),s.some(a=>a.content==="attr")&&Ks(l,"^")),{props:[me(l,i)]}},Ks=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},rf=(t,n)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const o=t.children;let s,r=!1;for(let l=0;l<o.length;l++){const i=o[l];if(ko(i)){r=!0;for(let a=l+1;a<o.length;a++){const c=o[a];if(ko(c))s||(s=o[l]=Fe([i],i.loc)),s.children.push(" + ",c),o.splice(a,1),a--;else{s=void 0;break}}}}if(!(!r||o.length===1&&(t.type===0||t.type===1&&t.tagType===0&&!t.props.find(l=>l.type===7&&!n.directiveTransforms[l.name])&&t.tag!=="template")))for(let l=0;l<o.length;l++){const i=o[l];if(ko(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!n.ssr&&De(i,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${jt[1]} */`:"")),o[l]={type:12,content:i,loc:i.loc,codegenNode:ye(n.helper(eo),a)}}}}},Gs=new WeakSet,lf=(t,n)=>{if(t.type===1&&Be(t,"once",!0))return Gs.has(t)||n.inVOnce||n.inSSR?void 0:(Gs.add(t),n.inVOnce=!0,n.helper(vn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},Zs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(oe(41,t.loc)),Qt();const l=s.loc.source.trim(),i=s.type===4?s.content:l,a=o.bindingMetadata[l];if(a==="props"||a==="props-aliased")return o.onError(oe(44,s.loc)),Qt();if(a==="literal-const"||a==="setup-const")return o.onError(oe(45,s.loc)),Qt();if(!i.trim()||!gs(s))return o.onError(oe(42,s.loc)),Qt();const c=r||Q("modelValue",!0),d=r?_e(r)?`onUpdate:${rt(r.content)}`:Fe(['"onUpdate:" + ',r]):"onUpdate:modelValue";let m;const f=o.isTS?"($event: any)":"$event";m=Fe([`${f} => ((`,s,") = $event)"]);const g=[me(c,t.exp),me(d,m)];if(t.modifiers.length&&n.tagType===1){const b=t.modifiers.map(v=>v.content).map(v=>(bo(v)?v:JSON.stringify(v))+": true").join(", "),k=r?_e(r)?`${r.content}Modifiers`:Fe([r,' + "Modifiers"']):"modelModifiers";g.push(me(k,Q(`{ ${b} }`,!1,t.loc,2)))}return Qt(g)};function Qt(t=[]){return{props:t}}const af=/[\w).+\-_$\]]/,cf=(t,n)=>{lt("COMPILER_FILTERS",n)&&(t.type===5?An(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&An(o.exp,n)}))};function An(t,n){if(t.type===4)Js(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?Js(s,n):s.type===8?An(t,n):s.type===5&&An(s.content,n))}}function Js(t,n){const o=t.content;let s=!1,r=!1,l=!1,i=!1,a=0,c=0,d=0,m=0,f,g,b,k,v=[];for(b=0;b<o.length;b++)if(g=f,f=o.charCodeAt(b),s)f===39&&g!==92&&(s=!1);else if(r)f===34&&g!==92&&(r=!1);else if(l)f===96&&g!==92&&(l=!1);else if(i)f===47&&g!==92&&(i=!1);else if(f===124&&o.charCodeAt(b+1)!==124&&o.charCodeAt(b-1)!==124&&!a&&!c&&!d)k===void 0?(m=b+1,k=o.slice(0,b).trim()):x();else{switch(f){case 34:r=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:d++;break;case 41:d--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(f===47){let E=b-1,j;for(;E>=0&&(j=o.charAt(E),j===" ");E--);(!j||!af.test(j))&&(i=!0)}}k===void 0?k=o.slice(0,b).trim():m!==0&&x();function x(){v.push(o.slice(m,b).trim()),m=b+1}if(v.length){for(process.env.NODE_ENV!=="production"&&kn("COMPILER_FILTERS",n,t.loc),b=0;b<v.length;b++)k=df(k,v[b],n);t.content=k,t.ast=void 0}}function df(t,n,o){o.helper(so);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Jt(n,"filter")}(${t})`;{const r=n.slice(0,s),l=n.slice(s+1);return o.filters.add(r),`${Jt(r,"filter")}(${t}${l!==")"?","+l:l}`}}const Ys=new WeakSet,ff=(t,n)=>{if(t.type===1){const o=Be(t,"memo");return!o||Ys.has(t)||n.inSSR?void 0:(Ys.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&go(s,n),t.codegenNode=ye(n.helper(mo),[o.exp,Tt(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}},pf=(t,n)=>{if(t.type===1){for(const o of t.props)if(o.type===7&&o.name==="bind"&&(!o.exp||o.exp.type===4&&!o.exp.content.trim())&&o.arg){const s=o.arg;if(s.type!==4||!s.isStatic)n.onError(oe(53,s.loc)),o.exp=Q("",!0,s.loc);else{const r=rt(s.content);(ms.test(r[0])||r[0]==="-")&&(o.exp=Q(r,!1,s.loc))}}}};function uf(t){return[[pf,lf,jd,ff,Wd,cf,...process.env.NODE_ENV!=="production"?[zd]:[],nf,Xd,Zd,rf],{on:Ws,bind:sf,model:Zs}]}function mf(t,n={}){const o=n.onError||vo,s=n.mode==="module";n.prefixIdentifiers===!0?o(oe(48)):s&&o(oe(49));const r=!1;n.cacheHandlers&&o(oe(50)),n.scopeId&&!s&&o(oe(51));const l=st({},n,{prefixIdentifiers:r}),i=ve(t)?md(t,l):t,[a,c]=uf();return vd(i,st({},l,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:st({},c,n.directiveTransforms||{})})),wd(i,l)}const hf=()=>({props:[]});const Xs=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),Qs=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Vs=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),er=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Lo=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),tr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),nr=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),or=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Ao=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),sr=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");zc({[Xs]:"vModelRadio",[Qs]:"vModelCheckbox",[Vs]:"vModelText",[er]:"vModelSelect",[Lo]:"vModelDynamic",[tr]:"withModifiers",[nr]:"withKeys",[or]:"vShow",[Ao]:"Transition",[sr]:"TransitionGroup"});let Dt;function gf(t,n=!1){return Dt||(Dt=document.createElement("div")),n?(Dt.innerHTML=`<div foo="${t.replace(/"/g,"&quot;")}">`,Dt.children[0].getAttribute("foo")):(Dt.innerHTML=t,Dt.textContent)}const yf={parseMode:"html",isVoidTag:Dc,isNativeTag:t=>Lc(t)||Ac(t)||Ic(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:gf,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return Ao;if(t==="TransitionGroup"||t==="transition-group")return sr},getNamespace(t,n,o){let s=n?n.ns:o;if(n&&s===2)if(n.tag==="annotation-xml"){if(t==="svg")return 1;n.props.some(r=>r.type===6&&r.name==="encoding"&&r.value!=null&&(r.value.content==="text/html"||r.value.content==="application/xhtml+xml"))&&(s=0)}else/^m(?:[ions]|text)$/.test(n.tag)&&t!=="mglyph"&&t!=="malignmark"&&(s=0);else n&&s===1&&(n.tag==="foreignObject"||n.tag==="desc"||n.tag==="title")&&(s=0);if(s===0){if(t==="svg")return 1;if(t==="math")return 2}return s}},vf=t=>{t.type===1&&t.props.forEach((n,o)=>{n.type===6&&n.name==="style"&&n.value&&(t.props[o]={type:7,name:"bind",arg:Q("style",!0,n.loc),exp:bf(n.value.content,n.loc),modifiers:[],loc:n.loc})})},bf=(t,n)=>{const o=Sc(t);return Q(JSON.stringify(o),!1,n,3)};function Pe(t,n){return oe(t,n,process.env.NODE_ENV!=="production"?kf:void 0)}const kf={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},Ef=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Pe(54,r)),n.children.length&&(o.onError(Pe(55,r)),n.children.length=0),{props:[me(Q("innerHTML",!0,r),s||Q("",!0))]}},wf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Pe(56,r)),n.children.length&&(o.onError(Pe(57,r)),n.children.length=0),{props:[me(Q("textContent",!0),s?De(s,o)>0?s:ye(o.helperString(gn),[s],r):Q("",!0))]}},xf=(t,n,o)=>{const s=Zs(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(Pe(59,t.arg.loc));function r(){const a=Be(n,"bind");a&&at(a.arg,"value")&&o.onError(Pe(61,a.loc))}const{tag:l}=n,i=o.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||i){let a=Vs,c=!1;if(l==="input"||i){const d=Zt(n,"type");if(d){if(d.type===7)a=Lo;else if(d.value)switch(d.value.content){case"radio":a=Xs;break;case"checkbox":a=Qs;break;case"file":c=!0,o.onError(Pe(60,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else Qc(n)?a=Lo:process.env.NODE_ENV!=="production"&&r()}else l==="select"?a=er:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(Pe(58,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},Nf=qe("passive,once,capture"),Cf=qe("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Sf=qe("left,right"),rr=qe("onkeyup,onkeydown,onkeypress"),_f=(t,n,o,s)=>{const r=[],l=[],i=[];for(let a=0;a<n.length;a++){const c=n[a].content;c==="native"&&It("COMPILER_V_ON_NATIVE",o,s)||Nf(c)?i.push(c):Sf(c)?_e(t)?rr(t.content.toLowerCase())?r.push(c):l.push(c):(r.push(c),l.push(c)):Cf(c)?l.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:l,eventOptionModifiers:i}},ir=(t,n)=>_e(t)&&t.content.toLowerCase()==="onclick"?Q(n,!0):t.type!==4?Fe(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,Bf=(t,n,o)=>Ws(t,n,o,s=>{const{modifiers:r}=t;if(!r.length)return s;let{key:l,value:i}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:d}=_f(l,r,o,t.loc);if(c.includes("right")&&(l=ir(l,"onContextmenu")),c.includes("middle")&&(l=ir(l,"onMouseup")),c.length&&(i=ye(o.helper(tr),[i,JSON.stringify(c)])),a.length&&(!_e(l)||rr(l.content.toLowerCase()))&&(i=ye(o.helper(nr),[i,JSON.stringify(a)])),d.length){const m=d.map(Yn).join("");l=_e(l)?Q(`${l.content}${m}`,!0):Fe(["(",l,`) + "${m}"`])}return{props:[me(l,i)]}}),$f=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Pe(62,r)),{props:[],needRuntime:o.helper(or)}},Tf=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===Ao)return()=>{if(!t.children.length)return;lr(t)&&n.onError(Pe(63,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}));const s=t.children[0];if(s.type===1)for(const r of s.props)r.type===7&&r.name==="show"&&t.props.push({type:6,name:"persisted",nameLoc:t.loc,value:void 0,loc:t.loc})}};function lr(t){const n=t.children=t.children.filter(s=>!wo(s)),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(lr)}const Lf=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(Pe(64,t.loc)),n.removeNode())};function Af(t,n){return t==="template"?!0:t in ar?ar[t].has(n):n in cr?cr[n].has(t):!(t in dr&&dr[t].has(n)||n in fr&&fr[n].has(t))}const Ot=new Set(["h1","h2","h3","h4","h5","h6"]),gt=new Set([]),ar={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:gt,iframe:gt,option:gt,textarea:gt,style:gt,title:gt},cr={html:gt,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},dr={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},fr={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:Ot,h2:Ot,h3:Ot,h4:Ot,h5:Ot,h6:Ot},If=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!Af(n.parent.tag,t.tag)){const o=new SyntaxError(`<${t.tag}> cannot be child of <${n.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);o.loc=t.loc,n.onWarn(o)}},Df=[vf,...process.env.NODE_ENV!=="production"?[Tf,If]:[]],Of={cloak:hf,html:Ef,text:wf,model:xf,on:Bf,show:$f};function Mf(t,n={}){return mf(t,st({},yf,n,{nodeTransforms:[Lf,...Df,...n.nodeTransforms||[]],directiveTransforms:st({},Of,n.directiveTransforms||{}),transformHoist:null}))}function Rf(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=Mf(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)(Sr);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const Io={};function Ff(t){return Io[t]||(Io[t]=Rf(t,{props:{row:{type:Object,default:void 0},value:{type:null,default:void 0},data:{type:Object,default:void 0},column:{type:Object,default:void 0}}})),Io[t]}const Pf={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},zf={class:"flex items-center gap-2"},jf=["disabled"],Hf={class:"text-sm"},Uf=["disabled"],qf=e.defineComponent({__name:"TablePagination",props:{currentPage:{},totalPages:{},label:{}},setup(t){const n=t,o=e.computed(()=>n.currentPage<=1),s=e.computed(()=>n.currentPage>=n.totalPages);return(r,l)=>(e.openBlock(),e.createElementBlock("div",Pf,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",zf,[e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:o.value,onClick:l[0]||(l[0]=i=>r.$emit("previous"))}," Назад ",8,jf),e.createElementVNode("span",Hf,"Сторінка "+e.toDisplayString(t.currentPage)+" з "+e.toDisplayString(t.totalPages),1),e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:s.value,onClick:l[1]||(l[1]=i=>r.$emit("next"))}," Далі ",8,Uf)])]))}}),Wf={class:"relative inline-flex"},Kf=["aria-label"],Gf={class:"px-3 pb-2"},Zf={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Jf=["onClick"],Yf={class:"truncate"},Xf={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Qf="inline-flex items-center justify-center size-8 rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",Vf=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(t,{emit:n}){const o=t,s=n,r=e.useAttrs(),l=e.ref(!1),i=e.ref(""),a=e.ref([...o.columns]),c=e.ref(null),d=e.ref(null),m=e.ref(null),f=e.ref({top:0,left:0}),g=e.computed(()=>{if(!i.value)return a.value;const S=i.value.toLowerCase();return a.value.filter(L=>b(L).toLowerCase().includes(S))});e.watch(()=>o.columns,S=>{if(!S){a.value=[];return}const L=JSON.stringify(S),R=JSON.stringify(a.value);L!==R&&(a.value=[...S])},{deep:!0}),e.watch(a,S=>{s("update:columns",S)},{deep:!0});function b(S){return S.ua||S.label||S.name||"Колонка"}function k(S){const L=!S.hidden;L&&a.value.filter(R=>!R.hidden).length<=1||(S.hidden=L)}function v(){l.value=!l.value,l.value&&e.nextTick(()=>{m.value?.focus(),x()})}function x(){if(!c.value)return;const S=c.value.getBoundingClientRect();f.value={top:S.bottom+window.scrollY+6,left:S.left+window.scrollX-200}}function E(S){if(!l.value)return;const L=S.target;L&&(d.value?.contains(L)||c.value?.contains(L)||(l.value=!1))}function j(S){S.key==="Escape"&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",E,!0),document.addEventListener("keydown",j)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E,!0),document.removeEventListener("keydown",j)}),(S,L)=>(e.openBlock(),e.createElementBlock("div",Wf,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:v,class:e.normalizeClass([Qf,e.unref(r).class]),"aria-label":e.unref(r)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},[...L[2]||(L[2]=[e.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-columns" height="18" width="18" aria-hidden="true"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6h5.5"></path><path d="M4 10h5.5"></path><path d="M4 14h5.5"></path><path d="M4 18h5.5"></path><path d="M14.5 6h5.5"></path><path d="M14.5 10h5.5"></path><path d="M14.5 14h5.5"></path><path d="M14.5 18h5.5"></path></svg>',1)])],10,Kf),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:d,class:"fixed z-50 w-64 bg-white rounded-xl shadow-lg border border-gray-200 dark:bg-neutral-900 dark:border-neutral-700",style:e.normalizeStyle({top:`${f.value.top}px`,left:`${f.value.left}px`})},[L[5]||(L[5]=e.createElementVNode("div",{class:"flex items-center justify-between h-12 px-4 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Налаштування колонок ",-1)),e.createElementVNode("div",Gf,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,"onUpdate:modelValue":L[0]||(L[0]=R=>i.value=R),type:"text",class:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200",placeholder:"Пошук колонок"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Zf,[L[4]||(L[4]=e.createElementVNode("p",{class:"px-1 pb-2 text-xs text-gray-500 uppercase tracking-wide"},"Виберіть колонки",-1)),e.createElementVNode("ul",{class:"space-y-1",onClick:L[1]||(L[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,R=>(e.openBlock(),e.createElementBlock("li",{key:R.name,class:"flex items-center justify-between rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 cursor-pointer",onClick:I=>k(R)},[e.createElementVNode("span",Yf,e.toDisplayString(b(R)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",R.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[R.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Xf,[...L[3]||(L[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])]))],2)],8,Jf))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),ep=["data-action-key"],tp=["onClick"],np={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},op={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},sp={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},rp={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ip=e.defineComponent({__name:"RowActionsButton",props:{row:{},actions:{},isOpen:{type:Boolean},actionKey:{}},emits:["toggle"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(null),l=e.computed(()=>!!o.actions?.length),i=e.ref({scrollX:0,scrollY:0,width:0,height:0}),a=e.ref(!1);function c(){s("toggle")}function d(k){k.handler?.(o.row)}const m=e.computed(()=>{if(!o.isOpen)return{};const k=r.value;if(!k)return{};const v=k.getBoundingClientRect(),x=8,E=160,L=(o.actions?.length??0)*36+x*2,R=i.value.height||(typeof window<"u"?window.innerHeight:0),I=i.value.width||(typeof window<"u"?window.innerWidth:0),A=i.value.scrollX||(typeof window<"u"?window.scrollX:0),h=i.value.scrollY||(typeof window<"u"?window.scrollY:0);let T=v.bottom+h+x,F=v.right+A-E;const P=A+I-E-x;return F>P&&(F=P),F<A+x&&(F=A+x),T+L>h+R-x&&(T=v.top+h-L-x),T<h+x&&(T=h+x),{top:`${T}px`,left:`${F}px`,width:"auto"}});function f(){typeof window>"u"||(i.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function g(){typeof window>"u"||a.value||(a.value=!0,f(),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f))}function b(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",f),window.removeEventListener("resize",f))}return e.watch(()=>o.isOpen,k=>{k?g():b()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&g()}),e.onBeforeUnmount(()=>{b()}),(k,v)=>l.value&&t.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":t.actionKey,ref_key:"anchorRef",ref:r},[e.createElementVNode("button",{type:"button",class:"inline-flex size-7 items-center justify-center rounded-md border border-gray-200 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:e.withModifiers(c,["stop"])},[...v[1]||(v[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"19",r:"1"})],-1)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-50 w-40 overflow-hidden rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:e.normalizeStyle(m.value),onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,x=>(e.openBlock(),e.createElementBlock("button",{key:x.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",x.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:E=>d(x)},[e.renderSlot(k.$slots,"icon",{action:x},()=>[x.type==="view"?(e.openBlock(),e.createElementBlock("svg",np,[...v[2]||(v[2]=[e.createElementVNode("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):x.type==="edit"?(e.openBlock(),e.createElementBlock("svg",op,[...v[3]||(v[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)])])):x.type==="delete"?(e.openBlock(),e.createElementBlock("svg",sp,[...v[4]||(v[4]=[e.createElementVNode("path",{d:"M3 6h18"},null,-1),e.createElementVNode("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},null,-1),e.createElementVNode("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},null,-1),e.createElementVNode("line",{x1:"10",x2:"10",y1:"11",y2:"17"},null,-1),e.createElementVNode("line",{x1:"14",x2:"14",y1:"11",y2:"17"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",rp,[...v[5]||(v[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])]))]),e.createTextVNode(" "+e.toDisplayString(x.label),1)],10,tp))),128))],4)):e.createCommentVNode("",!0)]))],8,ep)):e.createCommentVNode("",!0)}}),pr=typeof window<"u",ur=typeof document<"u";function lp(t){if(!ur)throw new Error("Tooltip requires document to be defined");const n=document.createElement("div");return n.className="fixed z-[9999] p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-150",n.style.opacity="0",n.style.visibility="hidden",n.style.maxWidth="240px",n.style.whiteSpace="normal",n.style.wordBreak="break-word",document.body.appendChild(n),n}function mr(t){if(!t)return null;if(typeof t=="string"){const o=t.trim();return o?{text:o,wrap:!0}:null}const n=typeof t.text=="string"&&t.text.trim()?t.text.trim():void 0;return n?{text:n,wrap:t.wrap!==!1}:null}function Do(t,n){if(!ur||!pr)return;const o=lp(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!pr)return;o.textContent=s.options.text;const i=(r.currentTarget??t).getBoundingClientRect(),a=o.getBoundingClientRect(),c=window.innerWidth-a.width-12,d=Math.max(12,Math.min(i.left,c));o.style.left=`${d}px`,o.style.top=`${i.bottom+4}px`,o.style.opacity="1",o.style.visibility="visible"},hide:()=>{o.style.opacity="0",o.style.visibility="hidden"}};t.addEventListener("mouseenter",s.show),t.addEventListener("mouseleave",s.hide),t.addEventListener("focus",s.show),t.addEventListener("blur",s.hide),t.__tooltipState__=s}function Oo(t){const n=t.__tooltipState__;n&&(t.removeEventListener("mouseenter",n.show),t.removeEventListener("mouseleave",n.hide),t.removeEventListener("focus",n.show),t.removeEventListener("blur",n.hide),n.tooltipEl.remove(),delete t.__tooltipState__)}const ap={mounted(t,n){const o=mr(n.value);o&&Do(t,o)},updated(t,n){const o=mr(n.value),s=t;if(!o){Oo(s);return}const r=s.__tooltipState__;if(!r){Do(s,o);return}if(r.options.wrap!==o.wrap){Oo(s),Do(s,o);return}r.options=o},unmounted(t){Oo(t)}},cp={class:"flex flex-col gap-4 mb-[15px]"},dp={class:"flex flex-wrap items-center gap-4"},fp={class:"relative"},pp={class:"ml-auto flex items-center gap-2"},up={class:"overflow-x-auto"},mp={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},hp={class:"text-left font-medium text-gray-700"},gp={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},yp={class:"divide-y divide-gray-200"},vp=["href"],bp={key:2},kp={key:3},Ep={key:0,class:"py-2 pr-4 text-right"},wp={key:0},xp={key:0},Np=["colspan"],hr=e.defineComponent({__name:"TableWidget",props:{addButton:{type:Boolean,default:!0},actions:{},columns:{},name:{},label:{},component:{},path:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(t){const n=e.getCurrentInstance(),o=e.ref([]),s=e.ref([]),r=ap,l=t,i=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),m=e.ref(1),f=e.ref(10),g=e.ref(0),b=e.ref(0),k=e.ref("id"),v=e.ref("");let x=null,E=0;const j=e.ref(null);async function S(){const y=m.value,$=++E,N=l.columns!==void 0,_=N?Array.isArray(l.columns)?l.columns:[]:void 0;N&&(s.value=K(_??[]));const X=l.actions!==void 0,ae=X?Array.isArray(l.actions)?l.actions:[]:void 0;X&&(i.value=ae??[]);const te=new URLSearchParams,ue=d.value.trim();ue&&te.set("search",ue),te.set("page",String(y)),te.set("limit",String(f.value));const Re=`/api/data/${l.token}${te.toString()?`?${te.toString()}`:""}`;let se;try{const Et=await fetch(Re);if(!Et.ok)throw new Error(`Request failed with status ${Et.status}`);se=await Et.json()}catch(Et){$===E&&(o.value=[],b.value=0,g.value=0),console.error("Failed to load table data",Et);return}if($!==E)return;o.value=Array.isArray(se?.rows)?se.rows:[];const Pt=Array.isArray(se?.columns)?se.columns:[];s.value=K(_??Pt),i.value=ae!==void 0?Array.isArray(ae)?ae:[]:Array.isArray(se?.actions)?se.actions:[],a.value=se?.form,c.value=se?.addToken,k.value=typeof se?.pk=="string"&&se.pk?se.pk:k.value,typeof se?.form=="string"&&se.form&&(v.value=se.form.replace(/\.form$/,".table")),q();const be=Number(se?.total??se?.count??se?.totalCount),dt=Number(se?.filtered??se?.filteredCount);g.value=Number.isFinite(be)&&be>0?be:o.value.length,b.value=Number.isFinite(dt)&&dt>0?dt:Math.max(o.value.length,g.value);const tt=Math.max(1,Math.ceil((b.value||o.value.length||1)/f.value));let Ue=y;typeof se?.page=="number"&&se.page>0&&(Ue=se.page),Ue>tt&&(Ue=tt),Ue<1&&(Ue=1);const Ro=Ue!==y;if(m.value=Ue,Ro&&b.value>0)return S()}const{$notify:L,$confirm:R,$form:I}=n?.appContext?.config?.globalProperties||{};function A(){if(xe.emitter?.emit){xe.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}S()}async function h(y){typeof I=="function"&&(await I({token:y.token}),A())}async function T(){typeof I=="function"&&(await I({token:c.value}),A())}function F(y){R({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const $=await fetch(`/api/table/${y.token}`,{method:"DELETE"});if(!$.ok){const{error:N}=await $.json();L({title:"Помилка",type:"warning",message:N});return}L({title:"Видаленно",message:"Успішно видалено"}),await S()}})}e.onMounted(async()=>{await S(),xe.emitter?.on?.("updateCard",S)}),e.onBeforeUnmount(()=>{xe.emitter?.off?.("updateCard",S)});function P(y){return typeof y?.format=="string"?y.format.toLowerCase():""}function K(y){const $=new Map;s.value.forEach(_=>{_?.name&&$.set(_.name,!!_.hidden)});const N=y.map(_=>{const X=$.has(_.name)?$.get(_.name):!!_.hidden;return{..._,hidden:X}});return N.length&&!N.some(_=>!_.hidden)&&(N[0].hidden=!1),N}const Z=e.computed(()=>{const y=s.value.filter($=>!$.hidden);return y.length?y:s.value}),B=e.computed(()=>{const y=[],$=new Set;for(const N of i.value){if(typeof N=="string"){if(N==="edit"){const _="row:edit";$.has(_)||(y.push({key:_,type:"edit",label:"Редагувати",scope:"row",handler:he}),$.add(_));continue}if(N==="delete"||N==="del"){const _="row:delete";$.has(_)||(y.push({key:_,type:"delete",label:"Видалити",scope:"row",handler:ie,variant:"danger"}),$.add(_));continue}if(N==="add"){const _="toolbar:add";$.has(_)||(y.push({key:_,type:"add",label:"Додати",scope:"toolbar"}),$.add(_))}continue}if(N&&typeof N=="object"){const _=String(N.name??N.type??"action"),X=String(N.label??N.title??_),ae=N.scope==="toolbar"?"toolbar":"row",te=`${ae}:${_}`;if($.has(te))continue;$.add(te),y.push({key:te,type:_,label:X,scope:ae,handler:ae==="row"?ue=>et(N,ue):void 0,variant:N.variant==="danger"?"danger":"default",original:N})}}return y}),M=e.computed(()=>B.value.filter(y=>y.scope==="row"&&typeof y.handler=="function")),w=e.computed(()=>B.value.filter(y=>y.scope==="toolbar")),z=e.computed(()=>M.value.length>0),ne=e.computed(()=>w.value.some(y=>y.type==="add")),We=e.computed(()=>{const y=!!c.value;return l.addButton!==void 0?l.addButton&&y:ne.value&&y}),we=e.computed(()=>o.value),pe=e.computed(()=>{const y=b.value||we.value.length,$=Math.ceil(y/f.value);return $>0?$:1}),Le=e.computed(()=>{const y=we.value.length,$=b.value||y,N=g.value||$;return`Показано ${y} з ${$} (усього ${N})`});function Ke(){m.value<pe.value&&(m.value+=1,S())}function Ge(){m.value>1&&(m.value-=1,S())}e.watch(s,y=>{y?.length&&(y.some($=>!$.hidden)||(y[0].hidden=!1))},{deep:!0}),e.watch(()=>l.columns,y=>{if(y===void 0){S();return}const $=Array.isArray(y)?y:[];s.value=K($)},{deep:!0}),e.watch(()=>l.actions,y=>{if(y===void 0){S();return}i.value=Array.isArray(y)?y:[]},{deep:!0});function Ze(){x&&clearTimeout(x),q(),x=setTimeout(()=>{m.value=1,S()},300)}function ze(y){const $=k.value||"id",N=y?.token??y?.[$]??y?.id;return N?String(N):""}function W(y){const $=Z.value[y],N=["py-2",...C($)];y===0&&N.push("pl-4");const _=y===Z.value.length-1&&!z.value;return N.push(_?"pr-4":"pr-5"),N.join(" ")}function G(y,$){const N=["py-2",...C($)];P($)==="badge"&&N.push("center"),p($)==="wrap"?N.push("whitespace-normal","break-words"):N.push("truncate"),y===0&&N.push("pl-4");const _=y===Z.value.length-1&&!z.value;return N.push(_?"pr-4":"pr-5"),N.join(" ")}function p(y){return(typeof y?.overflow=="string"?y.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function C(y){const $=[],N=te=>{if(te==null||te==="")return;const ue=Number(te);return Number.isFinite(ue)&&ue>0?`${ue}px`:String(te).replace(/\s+/g,"")},_=N(y?.width),X=N(y?.minWidth),ae=N(y?.maxWidth);return _?($.push(`min-w-[${_}]`,`max-w-[${_}]`),$):($.push(`min-w-[${X??"100px"}]`),$.push(`max-w-[${ae??"350px"}]`),$)}function D(y){if(!M.value.length)return!1;const $=k.value||"id";return!!(y?.token||y?.[$]||y?.id)}function U(y){return j.value===ze(y)}function J(y){const $=ze(y);$&&(j.value=j.value===$?null:$)}function q(){j.value=null}function le(y,$){const N=$?.tooltip;if(!N)return;const _=kt(y,$);let X,ae=$?.tooltipWrap!==!1;if(typeof N=="string"){const te=N.trim();if(!te)return;const ue=te.toLowerCase();if(["true","1","yes"].includes(ue))X=typeof _=="string"?_:String(_??"");else{if(["false","0","no"].includes(ue))return;X=te}}else N===!0?X=_:typeof N=="object"&&(typeof N.text=="string"&&(X=N.text.trim()),typeof N.wrap=="boolean"&&(ae=N.wrap!==!1));if(!X){if(_==null||_==="")return;X=String(_)}if(X.trim())return ae?{text:X,wrap:!0}:X}function he(y){q(),h(y)}function ie(y){q(),F(y)}async function et(y,$){q();const N=k.value||"id",_=y.isId?$?.[N]??$?.id:$?.token??$?.[N]??$?.id;if(!_){console.warn("Cannot execute action without identifier",y);return}if(y.form&&typeof y.api=="string"&&y.api&&typeof I=="function"){await vt(y,$,_);return}if(y.form&&typeof I=="function"){const X=await Mn(y.form,_),ae={form:y.form,token:X?.token??$?.token??_,schema:X?.schema,mode:X?.mode??"edit"};X?.data!==void 0&&(ae.defaultValue=X.data);try{await I(ae),A()}catch(te){console.error("Failed to execute form action",te)}return}if(typeof y.api=="string"&&y.api){const X=Me(y.api,_);window.location.href=X;return}$?.token&&typeof I=="function"&&(await I({token:$.token}),A())}function Me(y,$){return`${y.endsWith("/")?y:`${y}/`}${$}`}async function Mn(y,$){const N=`/api/form/${y}/${$}`;try{const _=await fetch(N);if(!_.ok)throw new Error(`Request failed with status ${_.status}`);return await _.json()}catch(_){console.error("Failed to load form config",_),L({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function je(y){const $=`/api/template/form/${y}`;try{const N=await fetch($);if(!N.ok)throw new Error(`Request failed with status ${N.status}`);return(await N.json())?.schema}catch(N){console.error("Failed to load form template",N);return}}function He(y){if(y!=null){if(y?.data!==void 0)return y.data;if(y?.defaultValue!==void 0)return y.defaultValue;if(y?.values!==void 0)return y.values;if(typeof y=="object"&&!Array.isArray(y)){const{schema:$,token:N,mode:_,message:X,successMessage:ae,...te}=y;if(Object.keys(te).length)return te}}}async function vt(y,$,N){const _=Me(y.api,N),X=(typeof y.method=="string"?y.method:"PUT").toUpperCase();let ae;try{const be=await fetch(_);if(!be.ok)throw new Error(`Request failed with status ${be.status}`);ae=await be.json()}catch(be){console.error("Failed to load action data",be),Mt("Не вдалося отримати дані форми.");return}const te=typeof y.form=="string"?y.form.replace(/\.table$/,".form"):void 0,ue=ae?.schema??(te?await je(te):void 0),Re={mode:ae?.mode??"edit"};te&&(Re.form=te),ue&&(Re.schema=ue);const se=He(ae);se!==void 0&&(Re.defaultValue=se);const Pt=await I(Re);if(Pt)try{const be=await fetch(_,{method:X,headers:{"Content-Type":"application/json"},body:JSON.stringify(Pt)});if(!be.ok){const dt=await tn(be),tt=dt?.error??dt?.message??"Не вдалося зберегти дані.";throw new Error(tt)}Rt(`Дані успішно ${Re.value==="add"?"збережено":"оновлено"}`),A()}catch(be){console.error("Failed to submit action data",be),Mt("Не вдалося зберегти дані.")}}async function tn(y){try{return await y.json()}catch{return}}function Mt(y){L({title:"Помилка",type:"error",message:y})}function Rt(y){L({title:"Успіх",type:"success",message:y})}function bt(y){if(!j.value)return;const $=y.target;if(!$)return;const N=$.closest("[data-action-key]");N&&N.getAttribute("data-action-key")===j.value||q()}e.onMounted(()=>{document.addEventListener("click",bt,!0)}),e.onBeforeUnmount(()=>{x&&clearTimeout(x),document.removeEventListener("click",bt,!0),xe.emitter?.off?.("updateCard",S)});function Ft(y,$){const _=y?.[`${$.name}_text`];if(Array.isArray(_))return _.length?_.join(", "):"-";if(_!=null&&_!=="")return _;const X=y?.[$.name];return Array.isArray(X)?X.length?X.join(", "):"-":X??"-"}function Je(y,$){const _=y?.[`${$.name}_data`];if(_&&typeof _=="object")return{text:_.text??_.label??_.name??_.title??"-",color:_.color,textColor:_.textColor};const X=y?.[`${$.name}_text`]??y?.[$.name];return{text:(Array.isArray(X)?X.join(", "):X)??"-"}}function Mo(y,$){const N=Je(y,$);return N.color?{backgroundColor:N.color,color:N.textColor??"#ffffff"}:{}}function kt(y,$){const N=P($);if(N==="badge")return Je(y,$).text;if(N==="select")return Ft(y,$);if(N==="slot")return"-";if(N==="text")return y?.[$.name]??"-";const _=y?.[`${$.name}_data`];return _!=null&&typeof _!="object"?_:y?.[`${$.name}_text`]??y?.[$.name]??"-"}return(y,$)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",cp,[e.createElementVNode("div",dp,[e.createElementVNode("div",fp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":$[0]||($[0]=N=>d.value=N),type:"text",class:"w-52 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",onInput:Ze},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",pp,[e.createVNode(Vf,{columns:s.value,"onUpdate:columns":$[1]||($[1]=N=>s.value=N)},null,8,["columns"]),We.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:T,class:"inline-flex size-8 items-center justify-center rounded-lg bg-blue-500 text-white shadow-sm transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",title:"Додати запис","aria-label":"Додати запис"},[...$[2]||($[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)])])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",up,[e.createElementVNode("table",mp,[e.createElementVNode("thead",hp,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(N,_)=>(e.openBlock(),e.createElementBlock("th",{key:N.name,class:e.normalizeClass(W(_))},e.toDisplayString(N.ua),3))),128)),z.value?(e.openBlock(),e.createElementBlock("th",gp," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",yp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,N=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:N.id??JSON.stringify(N)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(_,X)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:_.name,class:e.normalizeClass(G(X,_))},[_.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:_.link.replace("{{id}}",N.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(kt(N,_)),9,vp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[P(_)==="slot"&&(_.slot?.content||_.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ff)(_.slot.content||_.slot)),{key:0,data:N,row:N,column:_,value:N?.[_.name]},null,8,["data","row","column","value"])):P(_)==="badge"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"items-center px-2 py-1 rounded-full text-xs font-semibold text-center justify-center flex",style:e.normalizeStyle(Mo(N,_))},e.toDisplayString(Je(N,_).text),5)):P(_)==="select"?(e.openBlock(),e.createElementBlock("span",bp,e.toDisplayString(Ft(N,_)),1)):(e.openBlock(),e.createElementBlock("span",kp,e.toDisplayString(kt(N,_)),1))],64))],2)),[[e.unref(r),le(N,_)]])),128)),z.value?(e.openBlock(),e.createElementBlock("td",Ep,[D(N)?(e.openBlock(),e.createElementBlock("div",wp,[e.createVNode(ip,{row:N,actions:M.value,"is-open":U(N),"action-key":ze(N),onToggle:_=>J(N)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),we.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",xp,[e.createElementVNode("td",{colspan:Z.value.length+(z.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,Np)]))])])]),e.createVNode(qf,{"current-page":m.value,"total-pages":pe.value,label:Le.value,onPrevious:Ge,onNext:Ke},null,8,["current-page","total-pages","label"])]))}}),Cp={class:"p-[20px]"},Sp={class:"flex gap-[6px] mb-5"},_p={class:"vs-form-text relative bg-white rounded-lg flex-grow"},Bp={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},$p={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Tp={class:"space-y-8"},Lp={key:0},Ap={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Ip=["onClick"],Dp={class:"md:col-span-2"},Op={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Mp={class:"text-sm text-gray-500 dark:text-neutral-500"},Rp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Fp=["checked","onChange"],Pp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},zp={class:"md:col-span-2"},jp={class:"font-semibold text-gray-800 dark:text-neutral-200"},Hp=["onClick"],Up={class:"md:col-span-2"},qp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Wp={class:"text-sm text-gray-500 dark:text-neutral-500"},Kp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Gp=["checked","onChange"],In="uk",Dn=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return In;const I=localStorage.language,A=typeof navigator<"u"?navigator.language:In;return(I||A||In).split(/[-_]/)[0].toLowerCase()||In},s=t,r=e.ref(""),l=["view","add","edit","del"],i=e.ref({}),a=e.ref(o()),c={view:"Перегляд",add:"Додавання",edit:"Редагування",del:"Видалення"},d=I=>c[I]??I,m=()=>{a.value=o()},f=()=>{const I=[];return a.value&&I.push(a.value),n.forEach(A=>{A&&!I.includes(A)&&I.push(A)}),I.includes("path")||I.push("path"),I},g=I=>{const A=f();for(const h of A){const T=I[h];if(typeof T=="string"&&T.trim())return T}return""};e.onMounted(async()=>{m();const A=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();A.routes&&A.routes.forEach(h=>{i.value[h.path]=new Set(h.actions)})});const b=(I,A)=>i.value[I]?.has(A)??!1,k=(I,A)=>{i.value[I]||(i.value[I]=new Set),i.value[I].has(A)?i.value[I].delete(A):i.value[I].add(A)},v=(I,A)=>{I.forEach(h=>{h.path&&(i.value[h.path]||(i.value[h.path]=new Set),i.value[h.path].has(A)?i.value[h.path].delete(A):i.value[h.path].add(A))})},x=e.computed(()=>Object.entries(i.value).map(([I,A])=>({path:I,actions:Array.from(A)})).filter(I=>I.actions.length)),E=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:x.value})}),xe.notify({title:"Success!",message:"Permissions saved."})},j=()=>{i.value={}},S=I=>{if(!r.value.trim())return I;const A=r.value.toLowerCase();return I.filter(h=>g(h).toLowerCase().includes(A)||(h.path?.toLowerCase().includes(A)??!1))},L=e.computed(()=>S(s.data.routers.filter(I=>!I.menu))),R=e.computed(()=>s.data.routers.filter(I=>I.menu).map(I=>({...I,menu:S(I.menu||[])})).filter(I=>I.menu&&I.menu.length>0));return(I,A)=>(e.openBlock(),e.createElementBlock("div",Cp,[e.createElementVNode("div",Sp,[e.createElementVNode("div",_p,[A[1]||(A[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":A[0]||(A[0]=h=>r.value=h),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("button",{onClick:j,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:E,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",Bp,[A[2]||(A[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(h,T)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:T},[e.createElementVNode("h3",$p,e.toDisplayString(d(h)),1)])),64))]),e.createElementVNode("div",Tp,[L.value.length?(e.openBlock(),e.createElementBlock("div",Lp,[e.createElementVNode("ul",Ap,[A[3]||(A[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(h,T)=>e.createElementVNode("li",{key:T,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:F=>v(L.value,l[T])}," Перемкнути всі ",8,Ip)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(h,T)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+T,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Dp,[e.createElementVNode("p",Op,e.toDisplayString(g(h)),1),e.createElementVNode("p",Mp,e.toDisplayString(h.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(F,P)=>e.createElementVNode("li",{key:P,class:"col-span-1"},[e.createElementVNode("div",Rp,[e.createElementVNode("input",{type:"checkbox",checked:b(h.path,F),onChange:K=>k(h.path,F),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Fp)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(h,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:"space-y-5"},[e.createElementVNode("ul",Pp,[e.createElementVNode("li",zp,[e.createElementVNode("h3",jp,e.toDisplayString(g(h)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(F,P)=>e.createElementVNode("li",{key:P,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:K=>v(h.menu,l[P])}," Перемкнути всі ",8,Hp)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.menu,(F,P)=>(e.openBlock(),e.createElementBlock("ul",{key:P,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Up,[e.createElementVNode("p",qp,e.toDisplayString(g(F)),1),e.createElementVNode("p",Wp,e.toDisplayString(F.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(K,Z)=>e.createElementVNode("li",{key:Z,class:"col-span-1"},[e.createElementVNode("div",Kp,[e.createElementVNode("input",{type:"checkbox",checked:b(F.path,K),onChange:B=>k(F.path,K),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Gp)])])),64))]))),128))]))),128))])]))}}),yt={"vs-widget-comments":sn,"vs-widget-history":rn,"vs-widget-gallery":an,"vs-widget-file":ln,"vs-widget-list":jn,"vs-widget-map":un,"vs-widget-table":hr,"vs-group-interface":Dn};function gr(t){if(t==null)return null;const n=Number(t);return Number.isFinite(n)?Math.max(1,Math.min(12,Math.floor(n))):null}function yr(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>yr(o))),n}function Zp(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=gr(c.col);d?(c.col=d,o.push({item:c,span:d})):s.push(c)}),!o.length&&s.length){s.forEach(c=>{c.col=12});return}const r=o.reduce((c,d)=>c+d.span,0);let l=n-r;if(s.length===0)return;l<=0&&(l=n);const i=Math.max(1,Math.floor(l/s.length));let a=Math.max(0,l-i*s.length);s.forEach(c=>{let d=i;a>0&&(d+=1,a-=1),c.col=Math.max(1,Math.min(12,d))})}function On(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>yr(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=On(s.items,12))}),Zp(o,n),o}function vr(t){const n=gr(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const Jp={class:"text-lg font-semibold text-gray-900"},Yp=["innerHTML"],Xp={key:0,class:"grid grid-cols-12 gap-4"},Qp={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Vp={class:"text-lg font-semibold text-gray-900"},eu=["innerHTML"],Vt=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},hideTitle:{type:Boolean},styling:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.computed(()=>{if(!n.col)return{};const d=Math.max(1,Math.min(12,Number(n.col)));return{[`md:col-span-${d}`]:!0,[`lg:col-span-${d}`]:!0}}),s=e.computed(()=>On(n.items));function r(d){const m=["col-span-12"],f=vr(d.col);return f.length&&m.push(...f),m}function l(d){return yt[d]||d}function i(d,m){if(!d||typeof m!="string"||!m)return{found:!1,value:void 0};const f=m.split(".");let g=d;for(const b of f){if(g==null||typeof g!="object"&&!Array.isArray(g))return{found:!1,value:void 0};if(!(b in g))return{found:!1,value:void 0};g=g[b]}return{found:!0,value:g}}const a=function(d={}){const m={...d};return Object.entries(m).forEach(([f,g])=>{if(f!=="props"&&typeof g=="string"){const b=i(n.data,g);b.found&&(m[f]=b.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([f,g])=>{if(typeof g=="string"){const b=i(n.data,g);m[f]=b.found?b.value:g}else m[f]=g}),delete m.props,m},c=e.computed(()=>{const d={};return n.col&&(d.col=n.col),d});return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[o.value,t.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!t.hideTitle&&t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",t.styling?.classItemTitle])},[e.createElementVNode("h3",Jp,e.toDisplayString(t.title),1)],2)):e.createCommentVNode("",!0),t.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:t.html,class:"text-gray-900 leading-relaxed"},null,8,Yp)):t.type?.includes("tabs")?(e.openBlock(),e.createBlock(en,{key:2,view:t.type,panels:t.items,data:t.data,styling:t.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[s.value.length?(e.openBlock(),e.createElementBlock("div",Xp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:f.name||f.component||g,class:e.normalizeClass(r(f))},[f.title||f.label?(e.openBlock(),e.createElementBlock("div",Qp,[e.createElementVNode("h3",Vp,e.toDisplayString(f.title||f.label),1)])):e.createCommentVNode("",!0),f.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:f.html,class:"text-gray-900 leading-relaxed"},null,8,eu)):f.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(f.component)),e.mergeProps({key:2,ref_for:!0},{geom:t.data.geom,id:t.data.id,...c.value,...a(f),data:t.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),tu={class:"grid grid-cols-12 gap-[20px]"},nu={key:0,class:"col-span-4"},ou=["innerHTML"],su=["onClick"],ru=["innerHTML"],iu={key:1,class:"flex w-full"},lu={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},au=["onClick"],cu={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},du={class:"flex-1 p-4"},fu=["innerHTML"],pu={class:"grid grid-cols-12 gap-4"},uu={key:3,class:"w-full h-full"},en=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},styling:{},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},backgroundClass:{},tabContentWrapperClass:{},tabPanelClass:{},id:{},className:{},style:{}},setup(t){const n=t;function o(){const B=typeof window<"u"?window:globalThis,M="__vsCardAnonymousCounter__",w=B[M]??0;return B[M]=w+1,w===0?"tab":`tab${w}`}const s=e.ref(0),r=e.ref([]);let l=!1,i=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,B=>{B&&(a.value=B)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function m(B,M){const w=M?.path;return w?(c.has(w)||c.set(w,e.defineAsyncComponent(()=>import(w))),c.get(w)):typeof B=="string"&&yt[B]?yt[B]:M?.component&&yt[M.component]?yt[M.component]:M?.name&&yt[M.name]?yt[M.name]:B}function f(B){return B.forEach(M=>{M.type&&(M.view=M.type)}),r.value=B.filter(M=>M.type==="pin"),B.filter(M=>M.type!=="pin")}const g=e.computed(()=>{let B;return n.panels&&n.panels.length>0?B=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(B=n.data.filter(w=>w.type.includes("tabs"))[0]?.items),On(B,12)}),b=e.computed(()=>a.value);function k(){i||(i=!0)}const v=e.computed(()=>{let B;return n.panels&&n.panels.length>0?B=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(B=n.data),On(B,12)}),x=e.computed(()=>({[`view-${n.view}`]:!0}));function E(B,M){if(!B||typeof M!="string"||!M)return{found:!1,value:void 0};const w=M.split(".");let z=B;for(const ne of w){if(z==null||typeof z!="object"&&!Array.isArray(z))return{found:!1,value:void 0};if(!(ne in z))return{found:!1,value:void 0};z=z[ne]}return{found:!0,value:z}}const j=B=>{const M={...B};return Object.entries(M).forEach(([w,z])=>{if(w!=="props"&&typeof z=="string"){const ne=E(n.data,z);ne.found&&(M[w]=ne.value)}}),B.props&&typeof B.props=="object"&&Object.entries(B.props).forEach(([w,z])=>{if(typeof z=="string"){const ne=E(n.data,z);M[w]=ne.found?ne.value:z}else M[w]=z}),delete M.props,n.data&&(M.data=n.data),M};function S(B){const M=["col-span-12"],w=vr(B.col);return w.length&&M.push(...w),M}const L=e.ref([]),R=e.ref([]),I=e.ref([]);function A(B,M){B&&B instanceof HTMLElement&&(L.value[M]=B)}function h(){R.value=L.value.map(B=>B.offsetWidth),I.value=L.value.map(B=>B.offsetLeft)}function T(){if(typeof window>"u")return null;const B=b.value;if(!B)return null;const w=new URL(window.location.href).searchParams.get(B);if(w===null)return null;const z=Number.parseInt(w,10);return Number.isNaN(z)?null:z}function F(B){if(typeof window>"u")return;const M=b.value;if(!M||!i)return;const w=new URL(window.location.href);B<=0?w.searchParams.delete(M):w.searchParams.set(M,String(B));const z=window.history.state??{};window.history.replaceState(z,document.title,w)}function P(){if(l||!g.value.length)return;k();const B=T();if(B===null)return;const M=Math.min(Math.max(B,0),g.value.length-1);M!==B&&F(M),M!==s.value&&(s.value=M),l=!0}function K(){l=!1,P()}let Z=null;return e.onMounted(()=>{e.nextTick(()=>{P(),h()}),typeof window<"u"&&window.addEventListener("popstate",K),Z=new ResizeObserver(()=>h()),Z.observe(document.body)}),e.onBeforeUnmount(()=>{Z?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",K)}),e.watch(s,B=>{e.nextTick(()=>{h()}),F(B)}),e.watch(g,()=>{l=!1,P()}),(B,M)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.classWrapper||x.value)},[e.createElementVNode("div",tu,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(w,z)=>(e.openBlock(),e.createElementBlock("div",{key:w.name||z,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[w.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:w.html,class:"text-gray-900 leading-relaxed"},null,8,ou)):w.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(w.component,w)),e.mergeProps({key:1,ref_for:!0},w.component==="Card"?w:j(w),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(r.value.length!==0?"col-span-8":"col-span-12")},[t.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",t.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",t.styling?.classTabHeader])},[R.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:R.value[s.value]+"px",left:I.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(w,z)=>(e.openBlock(),e.createElementBlock("button",{key:w.name||z,ref_for:!0,ref:ne=>A(ne,z),onClick:ne=>s.value=z,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===z?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(w.title||w.label||w.name||`Tab ${z+1}`),11,su))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([t.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(w,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:w.name||z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100"])},[w.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:w.html,class:"text-gray-900 leading-relaxed"},null,8,ru)):B.$slots[`tab-${z}`]?e.renderSlot(B.$slots,`tab-${z}`,{key:1,item:w,data:t.data}):w.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Vt),e.mergeProps({key:2,ref_for:!0},j(w),{items:w.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):w.component||w.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(w.component||w.name,w)),e.mergeProps({key:3,ref_for:!0},w.component==="Card"?w:j(w),{styling:t.styling,id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(B.$slots,w.slot||`tab-${z}`,{key:4,item:w,data:t.data})],2)),[[e.vShow,s.value===z]])),128))],2)],2)):t.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("div",lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(w,z)=>(e.openBlock(),e.createElementBlock("button",{key:w.name||z,onClick:ne=>s.value=z,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===z?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(w.title||w.label||w.name||`Tab ${z+1}`)+" ",1),s.value===z?(e.openBlock(),e.createElementBlock("span",cu,[...M[0]||(M[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)])])):e.createCommentVNode("",!0)],10,au))),128))]),e.createElementVNode("div",du,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(w,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:w.name||z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100 py-2"])},[w.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:w.html,class:"text-gray-900 leading-relaxed"},null,8,fu)):B.$slots[`tab-${z}`]?e.renderSlot(B.$slots,`tab-${z}`,{key:1,item:w,data:t.data}):w.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Vt),e.mergeProps({key:2,ref_for:!0},j(w),{items:w.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):w.component||w.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(w.component||w.name,w)),e.mergeProps({key:3,ref_for:!0},w.component==="Card"?w:j(w),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(B.$slots,w.slot||`tab-${z}`,{key:4,item:w,data:t.data})],2)),[[e.vShow,s.value===z]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",pu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(w,z)=>(e.openBlock(),e.createElementBlock("div",{key:w.name||w.component||z,class:e.normalizeClass(S(w))},[B.$slots[`panel-${z}`]?e.renderSlot(B.$slots,`panel-${z}`,{key:0,item:w,data:t.data}):w.items||w.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Vt),e.mergeProps({key:1,ref_for:!0},j(w),{items:w.items||[],class:["w-full h-auto",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):w.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(w.component,w)),e.mergeProps({key:2,ref_for:!0},j(w),{class:["w-full h-auto",[t.styling?.classItem]],styling:t.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",uu,[e.renderSlot(B.$slots,w.slot||`panel-${z}`,{item:w,data:t.data})]))],2))),128))])],2))],2)])],2))}}),mu=["onClick"],br=nt(e.defineComponent({__name:"CopyNotification",setup(t,{expose:n}){const o=e.ref([]);let s=1;const r=()=>{if(o.value.length>=10){const a=o.value[0];clearTimeout(a.timer),o.value.shift()}const i={id:s++,timer:setTimeout(()=>{l(i.id)},1500)};o.value.push(i)},l=i=>{const a=o.value.findIndex(c=>c.id===i);if(a!==-1){const c=o.value[a];clearTimeout(c.timer),o.value.splice(a,1)}};return n({addNotification:r}),e.onUnmounted(()=>{o.value.forEach(i=>{clearTimeout(i.timer)})}),(i,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(Ir),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),a[0]||(a[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:d=>l(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Pn),{class:"h-4 w-4"})],8,mu)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);en.install=function(t){t.component("vs-widget-file",ln),t.component("vs-widget-comments",sn),t.component("vs-widget-history",rn),t.component("vs-widget-gallery",an),t.component("vs-widget-map",un),t.component("vs-group-interface",Dn),t.component("CommentsWidget",sn),t.component("HistoryWidget",rn),t.component("GalleryWidget",an),t.component("FilesWidget",ln),t.component("MapWidget",un),t.component("Card",en),t.component("CardItem",Vt),t.component("DescriptionListWidget",jn),t.component("CopyNotification",br),t.component("GroupInterfaceWidget",Dn)},ge.Card=en,ge.CardItem=Vt,ge.CommentsWidget=sn,ge.CopyNotification=br,ge.DescriptionListWidget=jn,ge.FilesWidget=ln,ge.GalleryWidget=an,ge.GroupInterfaceWidget=Dn,ge.HistoryWidget=rn,ge.MapWidget=un,ge.TableWidget=hr,ge.default=en,Object.defineProperties(ge,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
9
+ `,-1)}Nd(t.hoists,n),l(),r("return ")}function So(t,n,{helper:o,push:s,newline:r,isTS:l}){const i=o(n==="filter"?so:n==="component"?to:oo);for(let a=0;a<t.length;a++){let c=t[a];const d=c.endsWith("__self");d&&(c=c.slice(0,-6)),s(`const ${Jt(c,n)} = ${i}(${JSON.stringify(c)}${d?", true":""})${l?"!":""}`),a<t.length-1&&r()}}function Nd(t,n){if(!t.length)return;n.pure=!0;const{push:o,newline:s}=n;s();for(let r=0;r<t.length;r++){const l=t[r];l&&(o(`const _hoisted_${r+1} = `),Ce(l,n),s())}n.pure=!1}function Cd(t){return ve(t)||t.type===4||t.type===2||t.type===5||t.type===8}function _o(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Xe(s)||!Cd(s));n.push("["),o&&n.indent(),Xt(t,n,o),o&&n.deindent(),n.push("]")}function Xt(t,n,o=!1,s=!0){const{push:r,newline:l}=n;for(let i=0;i<t.length;i++){const a=t[i];ve(a)?r(a,-3):Xe(a)?_o(a,n):Ce(a,n),i<t.length-1&&(o?(s&&r(","),l()):s&&r(", "))}}function Ce(t,n){if(ve(t)){n.push(t,-3);return}if(Zn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&ys(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Ce(t.codegenNode,n);break;case 2:Sd(t,n);break;case 4:Os(t,n);break;case 5:_d(t,n);break;case 12:Ce(t.codegenNode,n);break;case 8:Ms(t,n);break;case 3:$d(t,n);break;case 13:Td(t,n);break;case 14:Ad(t,n);break;case 15:Id(t,n);break;case 17:Dd(t,n);break;case 18:Od(t,n);break;case 19:Md(t,n);break;case 20:Rd(t,n);break;case 21:Xt(t.body,n,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return ys(!1,`unhandled codegen node type: ${t.type}`),t}}function Sd(t,n){n.push(JSON.stringify(t.content),-3,t)}function Os(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function _d(t,n){const{push:o,helper:s,pure:r}=n;r&&o($n),o(`${s(gn)}(`),Ce(t.content,n),o(")")}function Ms(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];ve(s)?n.push(s,-3):Ce(s,n)}}function Bd(t,n){const{push:o}=n;if(t.type===8)o("["),Ms(t,n),o("]");else if(t.isStatic){const s=bo(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function $d(t,n){const{push:o,helper:s,pure:r}=n;r&&o($n),o(`${s(qt)}(${JSON.stringify(t.content)})`,-3,t)}function Td(t,n){const{push:o,helper:s,pure:r}=n,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:d,directives:m,isBlock:f,disableTracking:g,isComponent:b}=t;let k;if(c)if(process.env.NODE_ENV!=="production")if(c<0)k=c+` /* ${jt[c]} */`;else{const x=Object.keys(jt).map(Number).filter(E=>E>0&&c&E).map(E=>jt[E]).join(", ");k=c+` /* ${x} */`}else k=String(c);m&&o(s(ro)+"("),f&&o(`(${s(ft)}(${g?"true":""}), `),r&&o($n);const v=f?At(n.inSSR,b):Lt(n.inSSR,b);o(s(v)+"(",-2,t),Xt(Ld([l,i,a,k,d]),n),o(")"),f&&o(")"),m&&(o(", "),Ce(m,n),o(")"))}function Ld(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function Ad(t,n){const{push:o,helper:s,pure:r}=n,l=ve(t.callee)?t.callee:s(t.callee);r&&o($n),o(l+"(",-2,t),Xt(t.arguments,n),o(")")}function Id(t,n){const{push:o,indent:s,deindent:r,newline:l}=n,{properties:i}=t;if(!i.length){o("{}",-2,t);return}const a=i.length>1||process.env.NODE_ENV!=="production"&&i.some(c=>c.value.type!==4);o(a?"{":"{ "),a&&s();for(let c=0;c<i.length;c++){const{key:d,value:m}=i[c];Bd(d,n),o(": "),Ce(m,n),c<i.length-1&&(o(","),l())}a&&r(),o(a?"}":" }")}function Dd(t,n){_o(t.elements,n)}function Od(t,n){const{push:o,indent:s,deindent:r}=n,{params:l,returns:i,body:a,newline:c,isSlot:d}=t;d&&o(`_${$t[uo]}(`),o("(",-2,t),Xe(l)?Xt(l,n):l&&Ce(l,n),o(") => "),(c||a)&&(o("{"),s()),i?(c&&o("return "),Xe(i)?_o(i,n):Ce(i,n)):a&&Ce(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function Md(t,n){const{test:o,consequent:s,alternate:r,newline:l}=t,{push:i,indent:a,deindent:c,newline:d}=n;if(o.type===4){const f=!bo(o.content);f&&i("("),Os(o,n),f&&i(")")}else i("("),Ce(o,n),i(")");l&&a(),n.indentLevel++,l||i(" "),i("? "),Ce(s,n),n.indentLevel--,l&&d(),l||i(" "),i(": ");const m=r.type===19;m||n.indentLevel++,Ce(r,n),m||n.indentLevel--,l&&c(!0)}function Rd(t,n){const{push:o,helper:s,indent:r,deindent:l,newline:i}=n,{needPauseTracking:a,needArraySpread:c}=t;c&&o("[...("),o(`_cache[${t.index}] || (`),a&&(r(),o(`${s(vn)}(-1`),t.inVOnce&&o(", true"),o("),"),i(),o("(")),o(`_cache[${t.index}] = `),Ce(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),i(),o(`${s(vn)}(1),`),i(),o(`_cache[${t.index}]`),l()),o(")"),c&&o(")]")}const Fd=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),Pd=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function ht(t,n,o=!1,s=!1){const r=t.content;if(r.trim())try{new Function(s?` ${r} `:`return ${o?`(${r}) => {}`:`(${r})`}`)}catch(l){let i=l.message;const a=r.replace(Pd,"").match(Fd);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(oe(46,t.loc,void 0,i))}}const zd=(t,n)=>{if(t.type===5)t.content=Bo(t.content,n);else if(t.type===1){const o=Be(t,"memo");for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&r.name!=="for"){const l=r.exp,i=r.arg;l&&l.type===4&&!(r.name==="on"&&i)&&!(o&&i&&i.type===4&&i.content==="key")&&(r.exp=Bo(l,n,r.name==="slot")),i&&i.type===4&&!i.isStatic&&(r.arg=Bo(i,n))}}}};function Bo(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&ht(t,n,o,s),t}const jd=Is(/^(?:if|else|else-if)$/,(t,n,o)=>Hd(t,n,o,(s,r,l)=>{const i=o.parent.children;let a=i.indexOf(s),c=0;for(;a-->=0;){const d=i[a];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(l)s.codegenNode=Fs(r,c,o);else{const d=qd(s.codegenNode);d.alternate=Fs(r,c+s.branches.length-1,o)}}}));function Hd(t,n,o,s){if(n.name!=="else"&&(!n.exp||!n.exp.content.trim())){const r=n.exp?n.exp.loc:t.loc;o.onError(oe(28,n.loc)),n.exp=Q("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&ht(n.exp,o),n.name==="if"){const r=Rs(t,n),l={type:9,loc:fd(t.loc),branches:[r]};if(o.replaceNode(l),s)return s(l,r,!0)}else{const r=o.parent.children,l=[];let i=r.indexOf(t);for(;i-->=-1;){const a=r[i];if(a&&wo(a)){o.removeNode(a),process.env.NODE_ENV!=="production"&&a.type===3&&l.unshift(a);continue}if(a&&a.type===9){(n.name==="else-if"||n.name==="else")&&a.branches[a.branches.length-1].condition===void 0&&o.onError(oe(30,t.loc)),o.removeNode();const c=Rs(t,n);if(process.env.NODE_ENV!=="production"&&l.length&&!(o.parent&&o.parent.type===1&&(o.parent.tag==="transition"||o.parent.tag==="Transition"))&&(c.children=[...l,...c.children]),process.env.NODE_ENV!=="production"){const m=c.userKey;m&&a.branches.forEach(({userKey:f})=>{Ud(f,m)&&o.onError(oe(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);Bn(c,o),d&&d(),o.currentNode=null}else o.onError(oe(30,t.loc));break}}}function Rs(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!Be(t,"for")?t.children:[t],userKey:Zt(t,"key"),isTemplateIf:o}}function Fs(t,n,o){return t.condition?ho(t.condition,Ps(t,n,o),ye(o.helper(qt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Ps(t,n,o)}function Ps(t,n,o){const{helper:s}=o,r=me("key",Q(`${n}`,!1,Ae,2)),{children:l}=t,i=l[0];if(l.length!==1||i.type!==1)if(l.length===1&&i.type===11){const c=i.codegenNode;return xn(c,r,o),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!t.isTemplateIf&&l.filter(d=>d.type!==3).length===1&&(c|=2048),Gt(o,s(Ht),Oe([r]),l,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=i.codegenNode,d=td(c);return d.type===13&&go(d,o),xn(d,r,o),c}}function Ud(t,n){if(!t||t.type!==n.type)return!1;if(t.type===6){if(t.value.content!==n.value.content)return!1}else{const o=t.exp,s=n.exp;if(o.type!==s.type||o.type!==4||o.isStatic!==s.isStatic||o.content!==s.content)return!1}return!0}function qd(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const Wd=Is("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return Kd(t,n,o,l=>{const i=ye(s(io),[l.source]),a=En(t),c=Be(t,"memo"),d=Zt(t,"key",!1,!0);d&&d.type;let m=d&&(d.type===6?d.value?Q(d.value.content,!0):void 0:d.exp);const f=d&&m?me("key",m):null,g=l.source.type===4&&l.source.constType>0,b=g?64:d?128:256;return l.codegenNode=Gt(o,s(Ht),void 0,i,b,void 0,void 0,!0,!g,!1,t.loc),()=>{let k;const{children:v}=l;process.env.NODE_ENV!=="production"&&a&&t.children.some(j=>{if(j.type===1){const S=Zt(j,"key");if(S)return o.onError(oe(33,S.loc)),!0}});const x=v.length!==1||v[0].type!==1,E=wn(t)?t:a&&t.children.length===1&&wn(t.children[0])?t.children[0]:null;if(E?(k=E.codegenNode,a&&f&&xn(k,f,o)):x?k=Gt(o,s(Ht),f?Oe([f]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(k=v[0].codegenNode,a&&f&&xn(k,f,o),k.isBlock!==!g&&(k.isBlock?(r(ft),r(At(o.inSSR,k.isComponent))):r(Lt(o.inSSR,k.isComponent))),k.isBlock=!g,k.isBlock?(s(ft),s(At(o.inSSR,k.isComponent))):s(Lt(o.inSSR,k.isComponent))),c){const j=Tt($o(l.parseResult,[Q("_cached")]));j.body=Uc([Fe(["const _memo = (",c.exp,")"]),Fe(["if (_cached",...m?[" && _cached.key === ",m]:[],` && ${o.helperString(as)}(_cached, _memo)) return _cached`]),Fe(["const _item = ",k]),Q("_item.memo = _memo"),Q("return _item")]),i.arguments.push(j,Q("_cache"),Q(String(o.cached.length))),o.cached.push(null)}else i.arguments.push(Tt($o(l.parseResult),k,!0))}})});function Kd(t,n,o,s){if(!n.exp){o.onError(oe(31,n.loc));return}const r=n.forParseResult;if(!r){o.onError(oe(32,n.loc));return}zs(r,o);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=o,{source:c,value:d,key:m,index:f}=r,g={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:m,objectIndexAlias:f,parseResult:r,children:En(t)?t.children:[t]};o.replaceNode(g),a.vFor++;const b=s&&s(g);return()=>{a.vFor--,b&&b()}}function zs(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(ht(t.source,n),t.key&&ht(t.key,n,!0),t.index&&ht(t.index,n,!0),t.value&&ht(t.value,n,!0)),t.finalized=!0)}function $o({value:t,key:n,index:o},s=[]){return Gd([t,n,o,...s])}function Gd(t){let n=t.length;for(;n--&&!t[n];);return t.slice(0,n+1).map((o,s)=>o||Q("_".repeat(s+1),!1))}const js=Q("undefined",!1),Zd=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=Be(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},Jd=(t,n,o,s)=>Tt(t,o,!1,!0,o.length?o[0].loc:s);function Yd(t,n,o=Jd){n.helper(uo);const{children:s,loc:r}=t,l=[],i=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=Be(t,"slot",!0);if(c){const{arg:x,exp:E}=c;x&&!_e(x)&&(a=!0),l.push(me(x||Q("default",!0),o(E,void 0,s,r)))}let d=!1,m=!1;const f=[],g=new Set;let b=0;for(let x=0;x<s.length;x++){const E=s[x];let j;if(!En(E)||!(j=Be(E,"slot",!0))){E.type!==3&&f.push(E);continue}if(c){n.onError(oe(37,j.loc));break}d=!0;const{children:S,loc:L}=E,{arg:R=Q("default",!0),exp:I,loc:A}=j;let h;_e(R)?h=R?R.content:"default":a=!0;const T=Be(E,"for"),F=o(I,T,S,L);let P,K;if(P=Be(E,"if"))a=!0,i.push(ho(P.exp,Tn(R,F,b++),js));else if(K=Be(E,/^else(?:-if)?$/,!0)){let Z=x,B;for(;Z--&&(B=s[Z],!!wo(B)););if(B&&En(B)&&Be(B,/^(?:else-)?if$/)){let M=i[i.length-1];for(;M.alternate.type===19;)M=M.alternate;M.alternate=K.exp?ho(K.exp,Tn(R,F,b++),js):Tn(R,F,b++)}else n.onError(oe(30,K.loc))}else if(T){a=!0;const Z=T.forParseResult;Z?(zs(Z,n),i.push(ye(n.helper(io),[Z.source,Tt($o(Z),Tn(R,F),!0)]))):n.onError(oe(32,T.loc))}else{if(h){if(g.has(h)){n.onError(oe(38,A));continue}g.add(h),h==="default"&&(m=!0)}l.push(me(R,F))}}if(!c){const x=(E,j)=>{const S=o(E,void 0,j,r);return n.compatConfig&&(S.isNonScopedSlot=!0),me("default",S)};d?f.length&&!f.every(Eo)&&(m?n.onError(oe(39,f[0].loc)):l.push(x(void 0,f))):l.push(x(void 0,s))}const k=a?2:Ln(t.children)?3:1;let v=Oe(l.concat(me("_",Q(k+(process.env.NODE_ENV!=="production"?` /* ${wc[k]} */`:""),!1))),r);return i.length&&(v=ye(n.helper(ls),[v,pt(i)])),{slots:v,hasDynamicSlots:a}}function Tn(t,n,o){const s=[me("name",t),me("fn",n)];return o!=null&&s.push(me("key",Q(String(o),!0))),Oe(s)}function Ln(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||Ln(o.children))return!0;break;case 9:if(Ln(o.branches))return!0;break;case 10:case 11:if(Ln(o.children))return!0;break}}return!1}const Hs=new WeakMap,Xd=(t,n)=>function(){if(t=n.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:s,props:r}=t,l=t.tagType===1;let i=l?Qd(t,n):`"${s}"`;const a=vc(i)&&i.callee===no;let c,d,m=0,f,g,b,k=a||i===Ut||i===Xn||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const v=Us(t,n,void 0,l,a);c=v.props,m=v.patchFlag,g=v.dynamicPropNames;const x=v.directives;b=x&&x.length?pt(x.map(E=>ef(E,n))):void 0,v.shouldUseBlock&&(k=!0)}if(t.children.length>0)if(i===hn&&(k=!0,m|=1024,process.env.NODE_ENV!=="production"&&t.children.length>1&&n.onError(oe(47,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}))),l&&i!==Ut&&i!==hn){const{slots:x,hasDynamicSlots:E}=Yd(t,n);d=x,E&&(m|=1024)}else if(t.children.length===1&&i!==Ut){const x=t.children[0],E=x.type,j=E===5||E===8;j&&De(x,n)===0&&(m|=1),j||E===2?d=x:d=t.children}else d=t.children;g&&g.length&&(f=tf(g)),t.codegenNode=Gt(n,i,c,d,m===0?void 0:m,f,b,!!k,!1,l,t.loc)};function Qd(t,n,o=!1){let{tag:s}=t;const r=To(s),l=Zt(t,"is",!1,!0);if(l)if(r||lt("COMPILER_IS_ON_ELEMENT",n)){let a;if(l.type===6?a=l.value&&Q(l.value.content,!0):(a=l.exp,a||(a=Q("is",!1,l.arg.loc))),a)return ye(n.helper(no),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=us(s)||n.isBuiltInComponent(s);return i?(o||n.helper(i),i):(n.helper(to),n.components.add(s),Jt(s,"component"))}function Us(t,n,o=t.props,s,r,l=!1){const{tag:i,loc:a,children:c}=t;let d=[];const m=[],f=[],g=c.length>0;let b=!1,k=0,v=!1,x=!1,E=!1,j=!1,S=!1,L=!1;const R=[],I=F=>{d.length&&(m.push(Oe(qs(d),a)),d=[]),F&&m.push(F)},A=()=>{n.scopes.vFor>0&&d.push(me(Q("ref_for",!0),Q("true")))},h=({key:F,value:P})=>{if(_e(F)){const K=F.content,Z=Gn(K);if(Z&&(!s||r)&&K.toLowerCase()!=="onclick"&&K!=="onUpdate:modelValue"&&!ts(K)&&(j=!0),Z&&ts(K)&&(L=!0),Z&&P.type===14&&(P=P.arguments[0]),P.type===20||(P.type===4||P.type===8)&&De(P,n)>0)return;K==="ref"?v=!0:K==="class"?x=!0:K==="style"?E=!0:K!=="key"&&!R.includes(K)&&R.push(K),s&&(K==="class"||K==="style")&&!R.includes(K)&&R.push(K)}else S=!0};for(let F=0;F<o.length;F++){const P=o[F];if(P.type===6){const{loc:K,name:Z,nameLoc:B,value:M}=P;let w=!0;if(Z==="ref"&&(v=!0,A()),Z==="is"&&(To(i)||M&&M.content.startsWith("vue:")||lt("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(me(Q(Z,!0,B),Q(M?M.content:"",w,M?M.loc:K)))}else{const{name:K,arg:Z,exp:B,loc:M,modifiers:w}=P,z=K==="bind",ne=K==="on";if(K==="slot"){s||n.onError(oe(40,M));continue}if(K==="once"||K==="memo"||K==="is"||z&&at(Z,"is")&&(To(i)||lt("COMPILER_IS_ON_ELEMENT",n))||ne&&l)continue;if((z&&at(Z,"key")||ne&&g&&at(Z,"vue:before-update"))&&(b=!0),z&&at(Z,"ref")&&A(),!Z&&(z||ne)){if(S=!0,B)if(z){if(I(),process.env.NODE_ENV!=="production"&&m.some(pe=>pe.type===15?pe.properties.some(({key:Le})=>Le.type!==4||!Le.isStatic?!0:Le.content!=="class"&&Le.content!=="style"&&!Gn(Le.content)):!0)&&It("COMPILER_V_BIND_OBJECT_ORDER",n,M),lt("COMPILER_V_BIND_OBJECT_ORDER",n)){m.unshift(B);continue}A(),I(),m.push(B)}else I({type:14,loc:M,callee:n.helper(co),arguments:s?[B]:[B,"true"]});else n.onError(oe(z?34:35,M));continue}z&&w.some(we=>we.content==="prop")&&(k|=32);const We=n.directiveTransforms[K];if(We){const{props:we,needRuntime:pe}=We(P,t,n);!l&&we.forEach(h),ne&&Z&&!_e(Z)?I(Oe(we,a)):d.push(...we),pe&&(f.push(P),Zn(pe)&&Hs.set(P,pe))}else bc(K)||(f.push(P),g&&(b=!0))}}let T;if(m.length?(I(),m.length>1?T=ye(n.helper(yn),m,a):T=m[0]):d.length&&(T=Oe(qs(d),a)),S?k|=16:(x&&!s&&(k|=2),E&&!s&&(k|=4),R.length&&(k|=8),j&&(k|=32)),!b&&(k===0||k===32)&&(v||L||f.length>0)&&(k|=512),!n.inSSR&&T)switch(T.type){case 15:let F=-1,P=-1,K=!1;for(let M=0;M<T.properties.length;M++){const w=T.properties[M].key;_e(w)?w.content==="class"?F=M:w.content==="style"&&(P=M):w.isHandlerKey||(K=!0)}const Z=T.properties[F],B=T.properties[P];K?T=ye(n.helper(Wt),[T]):(Z&&!_e(Z.value)&&(Z.value=ye(n.helper(lo),[Z.value])),B&&(E||B.value.type===4&&B.value.content.trim()[0]==="["||B.value.type===17)&&(B.value=ye(n.helper(ao),[B.value])));break;case 14:break;default:T=ye(n.helper(Wt),[ye(n.helper(Kt),[T])]);break}return{props:T,directives:f,patchFlag:k,dynamicPropNames:R,shouldUseBlock:b}}function qs(t){const n=new Map,o=[];for(let s=0;s<t.length;s++){const r=t[s];if(r.key.type===8||!r.key.isStatic){o.push(r);continue}const l=r.key.content,i=n.get(l);i?(l==="style"||l==="class"||Gn(l))&&Vd(i,r):(n.set(l,r),o.push(r))}return o}function Vd(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=pt([t.value,n.value],t.loc)}function ef(t,n){const o=[],s=Hs.get(t);s?o.push(n.helperString(s)):(n.helper(oo),n.directives.add(t.name),o.push(Jt(t.name,"directive")));const{loc:r}=t;if(t.exp&&o.push(t.exp),t.arg&&(t.exp||o.push("void 0"),o.push(t.arg)),Object.keys(t.modifiers).length){t.arg||(t.exp||o.push("void 0"),o.push("void 0"));const l=Q("true",!1,r);o.push(Oe(t.modifiers.map(i=>me(i,l)),r))}return pt(o,t.loc)}function tf(t){let n="[";for(let o=0,s=t.length;o<s;o++)n+=JSON.stringify(t[o]),o<s-1&&(n+=", ");return n+"]"}function To(t){return t==="component"||t==="Component"}const nf=(t,n)=>{if(wn(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:l}=of(t,n),i=[n.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;l&&(i[2]=l,a=3),o.length&&(i[3]=Tt([],o,!1,!1,s),a=4),n.scopeId&&!n.slotted&&(a=5),i.splice(a),t.codegenNode=ye(n.helper(is),i,s)}};function of(t,n){let o='"default"',s;const r=[];for(let l=0;l<t.props.length;l++){const i=t.props[l];if(i.type===6)i.value&&(i.name==="name"?o=JSON.stringify(i.value.content):(i.name=rt(i.name),r.push(i)));else if(i.name==="bind"&&at(i.arg,"name")){if(i.exp)o=i.exp;else if(i.arg&&i.arg.type===4){const a=rt(i.arg.content);o=i.exp=Q(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&_e(i.arg)&&(i.arg.content=rt(i.arg.content)),r.push(i)}if(r.length>0){const{props:l,directives:i}=Us(t,n,r,!1,!1);s=l,i.length&&n.onError(oe(36,i[0].loc))}return{slotName:o,slotProps:s}}const Ws=(t,n,o,s)=>{const{loc:r,modifiers:l,arg:i}=t;!t.exp&&!l.length&&o.onError(oe(35,r));let a;if(i.type===4)if(i.isStatic){let f=i.content;process.env.NODE_ENV!=="production"&&f.startsWith("vnode")&&o.onError(oe(52,i.loc)),f.startsWith("vue:")&&(f=`vnode-${f.slice(4)}`);const g=n.tagType!==0||f.startsWith("vnode")||!/[A-Z]/.test(f)?Ec(rt(f)):`on:${f}`;a=Q(g,!0,i.loc)}else a=Fe([`${o.helperString(po)}(`,i,")"]);else a=i,a.children.unshift(`${o.helperString(po)}(`),a.children.push(")");let c=t.exp;c&&!c.content.trim()&&(c=void 0);let d=o.cacheHandlers&&!c&&!o.inVOnce;if(c){const f=gs(c),g=!(f||Xc(c)),b=c.content.includes(";");process.env.NODE_ENV!=="production"&&ht(c,o,!1,b),(g||d&&f)&&(c=Fe([`${g?"$event":"(...args)"} => ${b?"{":"("}`,c,b?"}":")"]))}let m={props:[me(a,c||Q("() => {}",!1,r))]};return s&&(m=s(m)),d&&(m.props[0].value=o.cache(m.props[0].value)),m.props.forEach(f=>f.key.isHandlerKey=!0),m},sf=(t,n,o)=>{const{modifiers:s,loc:r}=t,l=t.arg;let{exp:i}=t;return i&&i.type===4&&!i.content.trim()&&(i=void 0),l.type!==4?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=l.content?`${l.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(l.type===4?l.isStatic?l.content=rt(l.content):l.content=`${o.helperString(fo)}(${l.content})`:(l.children.unshift(`${o.helperString(fo)}(`),l.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&Ks(l,"."),s.some(a=>a.content==="attr")&&Ks(l,"^")),{props:[me(l,i)]}},Ks=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},rf=(t,n)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const o=t.children;let s,r=!1;for(let l=0;l<o.length;l++){const i=o[l];if(ko(i)){r=!0;for(let a=l+1;a<o.length;a++){const c=o[a];if(ko(c))s||(s=o[l]=Fe([i],i.loc)),s.children.push(" + ",c),o.splice(a,1),a--;else{s=void 0;break}}}}if(!(!r||o.length===1&&(t.type===0||t.type===1&&t.tagType===0&&!t.props.find(l=>l.type===7&&!n.directiveTransforms[l.name])&&t.tag!=="template")))for(let l=0;l<o.length;l++){const i=o[l];if(ko(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!n.ssr&&De(i,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${jt[1]} */`:"")),o[l]={type:12,content:i,loc:i.loc,codegenNode:ye(n.helper(eo),a)}}}}},Gs=new WeakSet,lf=(t,n)=>{if(t.type===1&&Be(t,"once",!0))return Gs.has(t)||n.inVOnce||n.inSSR?void 0:(Gs.add(t),n.inVOnce=!0,n.helper(vn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},Zs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(oe(41,t.loc)),Qt();const l=s.loc.source.trim(),i=s.type===4?s.content:l,a=o.bindingMetadata[l];if(a==="props"||a==="props-aliased")return o.onError(oe(44,s.loc)),Qt();if(a==="literal-const"||a==="setup-const")return o.onError(oe(45,s.loc)),Qt();if(!i.trim()||!gs(s))return o.onError(oe(42,s.loc)),Qt();const c=r||Q("modelValue",!0),d=r?_e(r)?`onUpdate:${rt(r.content)}`:Fe(['"onUpdate:" + ',r]):"onUpdate:modelValue";let m;const f=o.isTS?"($event: any)":"$event";m=Fe([`${f} => ((`,s,") = $event)"]);const g=[me(c,t.exp),me(d,m)];if(t.modifiers.length&&n.tagType===1){const b=t.modifiers.map(v=>v.content).map(v=>(bo(v)?v:JSON.stringify(v))+": true").join(", "),k=r?_e(r)?`${r.content}Modifiers`:Fe([r,' + "Modifiers"']):"modelModifiers";g.push(me(k,Q(`{ ${b} }`,!1,t.loc,2)))}return Qt(g)};function Qt(t=[]){return{props:t}}const af=/[\w).+\-_$\]]/,cf=(t,n)=>{lt("COMPILER_FILTERS",n)&&(t.type===5?An(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&An(o.exp,n)}))};function An(t,n){if(t.type===4)Js(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?Js(s,n):s.type===8?An(t,n):s.type===5&&An(s.content,n))}}function Js(t,n){const o=t.content;let s=!1,r=!1,l=!1,i=!1,a=0,c=0,d=0,m=0,f,g,b,k,v=[];for(b=0;b<o.length;b++)if(g=f,f=o.charCodeAt(b),s)f===39&&g!==92&&(s=!1);else if(r)f===34&&g!==92&&(r=!1);else if(l)f===96&&g!==92&&(l=!1);else if(i)f===47&&g!==92&&(i=!1);else if(f===124&&o.charCodeAt(b+1)!==124&&o.charCodeAt(b-1)!==124&&!a&&!c&&!d)k===void 0?(m=b+1,k=o.slice(0,b).trim()):x();else{switch(f){case 34:r=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:d++;break;case 41:d--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(f===47){let E=b-1,j;for(;E>=0&&(j=o.charAt(E),j===" ");E--);(!j||!af.test(j))&&(i=!0)}}k===void 0?k=o.slice(0,b).trim():m!==0&&x();function x(){v.push(o.slice(m,b).trim()),m=b+1}if(v.length){for(process.env.NODE_ENV!=="production"&&kn("COMPILER_FILTERS",n,t.loc),b=0;b<v.length;b++)k=df(k,v[b],n);t.content=k,t.ast=void 0}}function df(t,n,o){o.helper(so);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Jt(n,"filter")}(${t})`;{const r=n.slice(0,s),l=n.slice(s+1);return o.filters.add(r),`${Jt(r,"filter")}(${t}${l!==")"?","+l:l}`}}const Ys=new WeakSet,ff=(t,n)=>{if(t.type===1){const o=Be(t,"memo");return!o||Ys.has(t)||n.inSSR?void 0:(Ys.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&go(s,n),t.codegenNode=ye(n.helper(mo),[o.exp,Tt(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}},pf=(t,n)=>{if(t.type===1){for(const o of t.props)if(o.type===7&&o.name==="bind"&&(!o.exp||o.exp.type===4&&!o.exp.content.trim())&&o.arg){const s=o.arg;if(s.type!==4||!s.isStatic)n.onError(oe(53,s.loc)),o.exp=Q("",!0,s.loc);else{const r=rt(s.content);(ms.test(r[0])||r[0]==="-")&&(o.exp=Q(r,!1,s.loc))}}}};function uf(t){return[[pf,lf,jd,ff,Wd,cf,...process.env.NODE_ENV!=="production"?[zd]:[],nf,Xd,Zd,rf],{on:Ws,bind:sf,model:Zs}]}function mf(t,n={}){const o=n.onError||vo,s=n.mode==="module";n.prefixIdentifiers===!0?o(oe(48)):s&&o(oe(49));const r=!1;n.cacheHandlers&&o(oe(50)),n.scopeId&&!s&&o(oe(51));const l=st({},n,{prefixIdentifiers:r}),i=ve(t)?md(t,l):t,[a,c]=uf();return vd(i,st({},l,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:st({},c,n.directiveTransforms||{})})),wd(i,l)}const hf=()=>({props:[]});const Xs=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),Qs=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Vs=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),er=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Lo=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),tr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),nr=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),or=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Ao=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),sr=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");zc({[Xs]:"vModelRadio",[Qs]:"vModelCheckbox",[Vs]:"vModelText",[er]:"vModelSelect",[Lo]:"vModelDynamic",[tr]:"withModifiers",[nr]:"withKeys",[or]:"vShow",[Ao]:"Transition",[sr]:"TransitionGroup"});let Dt;function gf(t,n=!1){return Dt||(Dt=document.createElement("div")),n?(Dt.innerHTML=`<div foo="${t.replace(/"/g,"&quot;")}">`,Dt.children[0].getAttribute("foo")):(Dt.innerHTML=t,Dt.textContent)}const yf={parseMode:"html",isVoidTag:Dc,isNativeTag:t=>Lc(t)||Ac(t)||Ic(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:gf,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return Ao;if(t==="TransitionGroup"||t==="transition-group")return sr},getNamespace(t,n,o){let s=n?n.ns:o;if(n&&s===2)if(n.tag==="annotation-xml"){if(t==="svg")return 1;n.props.some(r=>r.type===6&&r.name==="encoding"&&r.value!=null&&(r.value.content==="text/html"||r.value.content==="application/xhtml+xml"))&&(s=0)}else/^m(?:[ions]|text)$/.test(n.tag)&&t!=="mglyph"&&t!=="malignmark"&&(s=0);else n&&s===1&&(n.tag==="foreignObject"||n.tag==="desc"||n.tag==="title")&&(s=0);if(s===0){if(t==="svg")return 1;if(t==="math")return 2}return s}},vf=t=>{t.type===1&&t.props.forEach((n,o)=>{n.type===6&&n.name==="style"&&n.value&&(t.props[o]={type:7,name:"bind",arg:Q("style",!0,n.loc),exp:bf(n.value.content,n.loc),modifiers:[],loc:n.loc})})},bf=(t,n)=>{const o=Sc(t);return Q(JSON.stringify(o),!1,n,3)};function Pe(t,n){return oe(t,n,process.env.NODE_ENV!=="production"?kf:void 0)}const kf={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},Ef=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Pe(54,r)),n.children.length&&(o.onError(Pe(55,r)),n.children.length=0),{props:[me(Q("innerHTML",!0,r),s||Q("",!0))]}},wf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Pe(56,r)),n.children.length&&(o.onError(Pe(57,r)),n.children.length=0),{props:[me(Q("textContent",!0),s?De(s,o)>0?s:ye(o.helperString(gn),[s],r):Q("",!0))]}},xf=(t,n,o)=>{const s=Zs(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(Pe(59,t.arg.loc));function r(){const a=Be(n,"bind");a&&at(a.arg,"value")&&o.onError(Pe(61,a.loc))}const{tag:l}=n,i=o.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||i){let a=Vs,c=!1;if(l==="input"||i){const d=Zt(n,"type");if(d){if(d.type===7)a=Lo;else if(d.value)switch(d.value.content){case"radio":a=Xs;break;case"checkbox":a=Qs;break;case"file":c=!0,o.onError(Pe(60,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else Qc(n)?a=Lo:process.env.NODE_ENV!=="production"&&r()}else l==="select"?a=er:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(Pe(58,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},Nf=qe("passive,once,capture"),Cf=qe("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Sf=qe("left,right"),rr=qe("onkeyup,onkeydown,onkeypress"),_f=(t,n,o,s)=>{const r=[],l=[],i=[];for(let a=0;a<n.length;a++){const c=n[a].content;c==="native"&&It("COMPILER_V_ON_NATIVE",o,s)||Nf(c)?i.push(c):Sf(c)?_e(t)?rr(t.content.toLowerCase())?r.push(c):l.push(c):(r.push(c),l.push(c)):Cf(c)?l.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:l,eventOptionModifiers:i}},ir=(t,n)=>_e(t)&&t.content.toLowerCase()==="onclick"?Q(n,!0):t.type!==4?Fe(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,Bf=(t,n,o)=>Ws(t,n,o,s=>{const{modifiers:r}=t;if(!r.length)return s;let{key:l,value:i}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:d}=_f(l,r,o,t.loc);if(c.includes("right")&&(l=ir(l,"onContextmenu")),c.includes("middle")&&(l=ir(l,"onMouseup")),c.length&&(i=ye(o.helper(tr),[i,JSON.stringify(c)])),a.length&&(!_e(l)||rr(l.content.toLowerCase()))&&(i=ye(o.helper(nr),[i,JSON.stringify(a)])),d.length){const m=d.map(Yn).join("");l=_e(l)?Q(`${l.content}${m}`,!0):Fe(["(",l,`) + "${m}"`])}return{props:[me(l,i)]}}),$f=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Pe(62,r)),{props:[],needRuntime:o.helper(or)}},Tf=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===Ao)return()=>{if(!t.children.length)return;lr(t)&&n.onError(Pe(63,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}));const s=t.children[0];if(s.type===1)for(const r of s.props)r.type===7&&r.name==="show"&&t.props.push({type:6,name:"persisted",nameLoc:t.loc,value:void 0,loc:t.loc})}};function lr(t){const n=t.children=t.children.filter(s=>!wo(s)),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(lr)}const Lf=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(Pe(64,t.loc)),n.removeNode())};function Af(t,n){return t==="template"?!0:t in ar?ar[t].has(n):n in cr?cr[n].has(t):!(t in dr&&dr[t].has(n)||n in fr&&fr[n].has(t))}const Ot=new Set(["h1","h2","h3","h4","h5","h6"]),gt=new Set([]),ar={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:gt,iframe:gt,option:gt,textarea:gt,style:gt,title:gt},cr={html:gt,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},dr={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},fr={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:Ot,h2:Ot,h3:Ot,h4:Ot,h5:Ot,h6:Ot},If=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!Af(n.parent.tag,t.tag)){const o=new SyntaxError(`<${t.tag}> cannot be child of <${n.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);o.loc=t.loc,n.onWarn(o)}},Df=[vf,...process.env.NODE_ENV!=="production"?[Tf,If]:[]],Of={cloak:hf,html:Ef,text:wf,model:xf,on:Bf,show:$f};function Mf(t,n={}){return mf(t,st({},yf,n,{nodeTransforms:[Lf,...Df,...n.nodeTransforms||[]],directiveTransforms:st({},Of,n.directiveTransforms||{}),transformHoist:null}))}function Rf(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=Mf(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)(Sr);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const Io={};function Ff(t){return Io[t]||(Io[t]=Rf(t,{props:{row:{type:Object,default:void 0},value:{type:null,default:void 0},data:{type:Object,default:void 0},column:{type:Object,default:void 0}}})),Io[t]}const Pf={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},zf={class:"flex items-center gap-2"},jf=["disabled"],Hf={class:"text-sm"},Uf=["disabled"],qf=e.defineComponent({__name:"TablePagination",props:{currentPage:{},totalPages:{},label:{}},setup(t){const n=t,o=e.computed(()=>n.currentPage<=1),s=e.computed(()=>n.currentPage>=n.totalPages);return(r,l)=>(e.openBlock(),e.createElementBlock("div",Pf,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",zf,[e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:o.value,onClick:l[0]||(l[0]=i=>r.$emit("previous"))}," Назад ",8,jf),e.createElementVNode("span",Hf,"Сторінка "+e.toDisplayString(t.currentPage)+" з "+e.toDisplayString(t.totalPages),1),e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:s.value,onClick:l[1]||(l[1]=i=>r.$emit("next"))}," Далі ",8,Uf)])]))}}),Wf={class:"relative inline-flex"},Kf=["aria-label"],Gf={class:"px-3 pb-2"},Zf={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Jf=["onClick"],Yf={class:"truncate"},Xf={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Qf="inline-flex items-center justify-center size-8 rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",Vf=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(t,{emit:n}){const o=t,s=n,r=e.useAttrs(),l=e.ref(!1),i=e.ref(""),a=e.ref([...o.columns]),c=e.ref(null),d=e.ref(null),m=e.ref(null),f=e.ref({top:0,left:0}),g=e.computed(()=>{if(!i.value)return a.value;const S=i.value.toLowerCase();return a.value.filter(L=>b(L).toLowerCase().includes(S))});e.watch(()=>o.columns,S=>{if(!S){a.value=[];return}const L=JSON.stringify(S),R=JSON.stringify(a.value);L!==R&&(a.value=[...S])},{deep:!0}),e.watch(a,S=>{s("update:columns",S)},{deep:!0});function b(S){return S.ua||S.label||S.name||"Колонка"}function k(S){const L=!S.hidden;L&&a.value.filter(R=>!R.hidden).length<=1||(S.hidden=L)}function v(){l.value=!l.value,l.value&&e.nextTick(()=>{m.value?.focus(),x()})}function x(){if(!c.value)return;const S=c.value.getBoundingClientRect();f.value={top:S.bottom+window.scrollY+6,left:S.left+window.scrollX-200}}function E(S){if(!l.value)return;const L=S.target;L&&(d.value?.contains(L)||c.value?.contains(L)||(l.value=!1))}function j(S){S.key==="Escape"&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",E,!0),document.addEventListener("keydown",j)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E,!0),document.removeEventListener("keydown",j)}),(S,L)=>(e.openBlock(),e.createElementBlock("div",Wf,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:v,class:e.normalizeClass([Qf,e.unref(r).class]),"aria-label":e.unref(r)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},[...L[2]||(L[2]=[e.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-columns" height="18" width="18" aria-hidden="true"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6h5.5"></path><path d="M4 10h5.5"></path><path d="M4 14h5.5"></path><path d="M4 18h5.5"></path><path d="M14.5 6h5.5"></path><path d="M14.5 10h5.5"></path><path d="M14.5 14h5.5"></path><path d="M14.5 18h5.5"></path></svg>',1)])],10,Kf),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:d,class:"fixed z-50 w-64 bg-white rounded-xl shadow-lg border border-gray-200 dark:bg-neutral-900 dark:border-neutral-700",style:e.normalizeStyle({top:`${f.value.top}px`,left:`${f.value.left}px`})},[L[5]||(L[5]=e.createElementVNode("div",{class:"flex items-center justify-between h-12 px-4 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Налаштування колонок ",-1)),e.createElementVNode("div",Gf,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,"onUpdate:modelValue":L[0]||(L[0]=R=>i.value=R),type:"text",class:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200",placeholder:"Пошук колонок"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Zf,[L[4]||(L[4]=e.createElementVNode("p",{class:"px-1 pb-2 text-xs text-gray-500 uppercase tracking-wide"},"Виберіть колонки",-1)),e.createElementVNode("ul",{class:"space-y-1",onClick:L[1]||(L[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,R=>(e.openBlock(),e.createElementBlock("li",{key:R.name,class:"flex items-center justify-between rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 cursor-pointer",onClick:I=>k(R)},[e.createElementVNode("span",Yf,e.toDisplayString(b(R)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",R.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[R.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Xf,[...L[3]||(L[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])]))],2)],8,Jf))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),ep=["data-action-key"],tp=["onClick"],np={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},op={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},sp={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},rp={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ip=e.defineComponent({__name:"RowActionsButton",props:{row:{},actions:{},isOpen:{type:Boolean},actionKey:{}},emits:["toggle"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(null),l=e.computed(()=>!!o.actions?.length),i=e.ref({scrollX:0,scrollY:0,width:0,height:0}),a=e.ref(!1);function c(){s("toggle")}function d(k){k.handler?.(o.row)}const m=e.computed(()=>{if(!o.isOpen)return{};const k=r.value;if(!k)return{};const v=k.getBoundingClientRect(),x=8,E=160,L=(o.actions?.length??0)*36+x*2,R=i.value.height||(typeof window<"u"?window.innerHeight:0),I=i.value.width||(typeof window<"u"?window.innerWidth:0),A=i.value.scrollX||(typeof window<"u"?window.scrollX:0),h=i.value.scrollY||(typeof window<"u"?window.scrollY:0);let T=v.bottom+h+x,F=v.right+A-E;const P=A+I-E-x;return F>P&&(F=P),F<A+x&&(F=A+x),T+L>h+R-x&&(T=v.top+h-L-x),T<h+x&&(T=h+x),{top:`${T}px`,left:`${F}px`,width:"auto"}});function f(){typeof window>"u"||(i.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function g(){typeof window>"u"||a.value||(a.value=!0,f(),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f))}function b(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",f),window.removeEventListener("resize",f))}return e.watch(()=>o.isOpen,k=>{k?g():b()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&g()}),e.onBeforeUnmount(()=>{b()}),(k,v)=>l.value&&t.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":t.actionKey,ref_key:"anchorRef",ref:r},[e.createElementVNode("button",{type:"button",class:"inline-flex size-7 items-center justify-center rounded-md border border-gray-200 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:e.withModifiers(c,["stop"])},[...v[1]||(v[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"19",r:"1"})],-1)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-50 w-40 overflow-hidden rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:e.normalizeStyle(m.value),onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,x=>(e.openBlock(),e.createElementBlock("button",{key:x.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",x.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:E=>d(x)},[e.renderSlot(k.$slots,"icon",{action:x},()=>[x.type==="view"?(e.openBlock(),e.createElementBlock("svg",np,[...v[2]||(v[2]=[e.createElementVNode("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):x.type==="edit"?(e.openBlock(),e.createElementBlock("svg",op,[...v[3]||(v[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)])])):x.type==="delete"?(e.openBlock(),e.createElementBlock("svg",sp,[...v[4]||(v[4]=[e.createElementVNode("path",{d:"M3 6h18"},null,-1),e.createElementVNode("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},null,-1),e.createElementVNode("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},null,-1),e.createElementVNode("line",{x1:"10",x2:"10",y1:"11",y2:"17"},null,-1),e.createElementVNode("line",{x1:"14",x2:"14",y1:"11",y2:"17"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",rp,[...v[5]||(v[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])]))]),e.createTextVNode(" "+e.toDisplayString(x.label),1)],10,tp))),128))],4)):e.createCommentVNode("",!0)]))],8,ep)):e.createCommentVNode("",!0)}}),pr=typeof window<"u",ur=typeof document<"u";function lp(t){if(!ur)throw new Error("Tooltip requires document to be defined");const n=document.createElement("div");return n.className="fixed z-[9999] p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-150",n.style.opacity="0",n.style.visibility="hidden",n.style.maxWidth="240px",n.style.whiteSpace="normal",n.style.wordBreak="break-word",document.body.appendChild(n),n}function mr(t){if(!t)return null;if(typeof t=="string"){const o=t.trim();return o?{text:o,wrap:!0}:null}const n=typeof t.text=="string"&&t.text.trim()?t.text.trim():void 0;return n?{text:n,wrap:t.wrap!==!1}:null}function Do(t,n){if(!ur||!pr)return;const o=lp(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!pr)return;o.textContent=s.options.text;const i=(r.currentTarget??t).getBoundingClientRect(),a=o.getBoundingClientRect(),c=window.innerWidth-a.width-12,d=Math.max(12,Math.min(i.left,c));o.style.left=`${d}px`,o.style.top=`${i.bottom+4}px`,o.style.opacity="1",o.style.visibility="visible"},hide:()=>{o.style.opacity="0",o.style.visibility="hidden"}};t.addEventListener("mouseenter",s.show),t.addEventListener("mouseleave",s.hide),t.addEventListener("focus",s.show),t.addEventListener("blur",s.hide),t.__tooltipState__=s}function Oo(t){const n=t.__tooltipState__;n&&(t.removeEventListener("mouseenter",n.show),t.removeEventListener("mouseleave",n.hide),t.removeEventListener("focus",n.show),t.removeEventListener("blur",n.hide),n.tooltipEl.remove(),delete t.__tooltipState__)}const ap={mounted(t,n){const o=mr(n.value);o&&Do(t,o)},updated(t,n){const o=mr(n.value),s=t;if(!o){Oo(s);return}const r=s.__tooltipState__;if(!r){Do(s,o);return}if(r.options.wrap!==o.wrap){Oo(s),Do(s,o);return}r.options=o},unmounted(t){Oo(t)}},cp={class:"flex flex-col gap-4 mb-[15px]"},dp={class:"flex flex-wrap items-center gap-4"},fp={class:"relative"},pp={class:"ml-auto flex items-center gap-2"},up={class:"overflow-x-auto"},mp={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},hp={class:"text-left font-medium text-gray-700"},gp={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},yp={class:"divide-y divide-gray-200"},vp=["href"],bp={key:2},kp={key:3},Ep={key:0,class:"py-2 pr-4 text-right"},wp={key:0},xp={key:0},Np=["colspan"],hr=e.defineComponent({__name:"TableWidget",props:{addButton:{type:Boolean,default:!0},actions:{},columns:{},name:{},label:{},component:{},path:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(t){const n=e.getCurrentInstance(),o=e.ref([]),s=e.ref([]),r=ap,l=t,i=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),m=e.ref(1),f=e.ref(10),g=e.ref(0),b=e.ref(0),k=e.ref("id"),v=e.ref("");let x=null,E=0;const j=e.ref(null);async function S(){const y=m.value,$=++E,N=l.columns!==void 0,_=N?Array.isArray(l.columns)?l.columns:[]:void 0;N&&(s.value=K(_??[]));const X=l.actions!==void 0,ae=X?Array.isArray(l.actions)?l.actions:[]:void 0;X&&(i.value=ae??[]);const te=new URLSearchParams,ue=d.value.trim();ue&&te.set("search",ue),te.set("page",String(y)),te.set("limit",String(f.value));const Re=`/api/data/${l.token}${te.toString()?`?${te.toString()}`:""}`;let se;try{const Et=await fetch(Re);if(!Et.ok)throw new Error(`Request failed with status ${Et.status}`);se=await Et.json()}catch(Et){$===E&&(o.value=[],b.value=0,g.value=0),console.error("Failed to load table data",Et);return}if($!==E)return;o.value=Array.isArray(se?.rows)?se.rows:[];const Pt=Array.isArray(se?.columns)?se.columns:[];s.value=K(_??Pt),i.value=ae!==void 0?Array.isArray(ae)?ae:[]:Array.isArray(se?.actions)?se.actions:[],a.value=se?.form,c.value=se?.addToken,k.value=typeof se?.pk=="string"&&se.pk?se.pk:k.value,typeof se?.form=="string"&&se.form&&(v.value=se.form.replace(/\.form$/,".table")),q();const be=Number(se?.total??se?.count??se?.totalCount),dt=Number(se?.filtered??se?.filteredCount);g.value=Number.isFinite(be)&&be>0?be:o.value.length,b.value=Number.isFinite(dt)&&dt>0?dt:Math.max(o.value.length,g.value);const tt=Math.max(1,Math.ceil((b.value||o.value.length||1)/f.value));let Ue=y;typeof se?.page=="number"&&se.page>0&&(Ue=se.page),Ue>tt&&(Ue=tt),Ue<1&&(Ue=1);const Ro=Ue!==y;if(m.value=Ue,Ro&&b.value>0)return S()}const{$notify:L,$confirm:R,$form:I}=n?.appContext?.config?.globalProperties||{};function A(){if(xe.emitter?.emit){xe.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}S()}async function h(y){typeof I=="function"&&(await I({token:y.token}),A())}async function T(){typeof I=="function"&&(await I({token:c.value}),A())}function F(y){R({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const $=await fetch(`/api/table/${y.token}`,{method:"DELETE"});if(!$.ok){const{error:N}=await $.json();L({title:"Помилка",type:"warning",message:N});return}L({title:"Видаленно",message:"Успішно видалено"}),await S()}})}e.onMounted(async()=>{await S(),xe.emitter?.on?.("updateCard",S)}),e.onBeforeUnmount(()=>{xe.emitter?.off?.("updateCard",S)});function P(y){return typeof y?.format=="string"?y.format.toLowerCase():""}function K(y){const $=new Map;s.value.forEach(_=>{_?.name&&$.set(_.name,!!_.hidden)});const N=y.map(_=>{const X=$.has(_.name)?$.get(_.name):!!_.hidden;return{..._,hidden:X}});return N.length&&!N.some(_=>!_.hidden)&&(N[0].hidden=!1),N}const Z=e.computed(()=>{const y=s.value.filter($=>!$.hidden);return y.length?y:s.value}),B=e.computed(()=>{const y=[],$=new Set;for(const N of i.value){if(typeof N=="string"){if(N==="edit"){const _="row:edit";$.has(_)||(y.push({key:_,type:"edit",label:"Редагувати",scope:"row",handler:he}),$.add(_));continue}if(N==="delete"||N==="del"){const _="row:delete";$.has(_)||(y.push({key:_,type:"delete",label:"Видалити",scope:"row",handler:ie,variant:"danger"}),$.add(_));continue}if(N==="add"){const _="toolbar:add";$.has(_)||(y.push({key:_,type:"add",label:"Додати",scope:"toolbar"}),$.add(_))}continue}if(N&&typeof N=="object"){const _=String(N.name??N.type??"action"),X=String(N.label??N.title??_),ae=N.scope==="toolbar"?"toolbar":"row",te=`${ae}:${_}`;if($.has(te))continue;$.add(te),y.push({key:te,type:_,label:X,scope:ae,handler:ae==="row"?ue=>et(N,ue):void 0,variant:N.variant==="danger"?"danger":"default",original:N})}}return y}),M=e.computed(()=>B.value.filter(y=>y.scope==="row"&&typeof y.handler=="function")),w=e.computed(()=>B.value.filter(y=>y.scope==="toolbar")),z=e.computed(()=>M.value.length>0),ne=e.computed(()=>w.value.some(y=>y.type==="add")),We=e.computed(()=>{const y=!!c.value;return l.addButton!==void 0?l.addButton&&y:ne.value&&y}),we=e.computed(()=>o.value),pe=e.computed(()=>{const y=b.value||we.value.length,$=Math.ceil(y/f.value);return $>0?$:1}),Le=e.computed(()=>{const y=we.value.length,$=b.value||y,N=g.value||$;return`Показано ${y} з ${$} (усього ${N})`});function Ke(){m.value<pe.value&&(m.value+=1,S())}function Ge(){m.value>1&&(m.value-=1,S())}e.watch(s,y=>{y?.length&&(y.some($=>!$.hidden)||(y[0].hidden=!1))},{deep:!0}),e.watch(()=>l.columns,y=>{if(y===void 0){S();return}const $=Array.isArray(y)?y:[];s.value=K($)},{deep:!0}),e.watch(()=>l.actions,y=>{if(y===void 0){S();return}i.value=Array.isArray(y)?y:[]},{deep:!0});function Ze(){x&&clearTimeout(x),q(),x=setTimeout(()=>{m.value=1,S()},300)}function ze(y){const $=k.value||"id",N=y?.token??y?.[$]??y?.id;return N?String(N):""}function W(y){const $=Z.value[y],N=["py-2",...C($)];y===0&&N.push("pl-4");const _=y===Z.value.length-1&&!z.value;return N.push(_?"pr-4":"pr-5"),N.join(" ")}function G(y,$){const N=["py-2",...C($)];P($)==="badge"&&N.push("center"),p($)==="wrap"?N.push("whitespace-normal","break-words"):N.push("truncate"),y===0&&N.push("pl-4");const _=y===Z.value.length-1&&!z.value;return N.push(_?"pr-4":"pr-5"),N.join(" ")}function p(y){return(typeof y?.overflow=="string"?y.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function C(y){const $=[],N=te=>{if(te==null||te==="")return;const ue=Number(te);return Number.isFinite(ue)&&ue>0?`${ue}px`:String(te).replace(/\s+/g,"")},_=N(y?.width),X=N(y?.minWidth),ae=N(y?.maxWidth);return _?($.push(`min-w-[${_}]`,`max-w-[${_}]`),$):($.push(`min-w-[${X??"100px"}]`),$.push(`max-w-[${ae??"350px"}]`),$)}function D(y){if(!M.value.length)return!1;const $=k.value||"id";return!!(y?.token||y?.[$]||y?.id)}function H(y){return j.value===ze(y)}function J(y){const $=ze(y);$&&(j.value=j.value===$?null:$)}function q(){j.value=null}function le(y,$){const N=$?.tooltip;if(!N)return;const _=kt(y,$);let X,ae=$?.tooltipWrap!==!1;if(typeof N=="string"){const te=N.trim();if(!te)return;const ue=te.toLowerCase();if(["true","1","yes"].includes(ue))X=typeof _=="string"?_:String(_??"");else{if(["false","0","no"].includes(ue))return;X=te}}else N===!0?X=_:typeof N=="object"&&(typeof N.text=="string"&&(X=N.text.trim()),typeof N.wrap=="boolean"&&(ae=N.wrap!==!1));if(!X){if(_==null||_==="")return;X=String(_)}if(X.trim())return ae?{text:X,wrap:!0}:X}function he(y){q(),h(y)}function ie(y){q(),F(y)}async function et(y,$){q();const N=k.value||"id",_=y.isId?$?.[N]??$?.id:$?.token??$?.[N]??$?.id;if(!_){console.warn("Cannot execute action without identifier",y);return}if(y.form&&typeof y.api=="string"&&y.api&&typeof I=="function"){await vt(y,$,_);return}if(y.form&&typeof I=="function"){const X=await Mn(y.form,_),ae={form:y.form,token:X?.token??$?.token??_,schema:X?.schema,mode:X?.mode??"edit"};X?.data!==void 0&&(ae.defaultValue=X.data);try{await I(ae),A()}catch(te){console.error("Failed to execute form action",te)}return}if(typeof y.api=="string"&&y.api){const X=Me(y.api,_);window.location.href=X;return}$?.token&&typeof I=="function"&&(await I({token:$.token}),A())}function Me(y,$){return`${y.endsWith("/")?y:`${y}/`}${$}`}async function Mn(y,$){const N=`/api/form/${y}/${$}`;try{const _=await fetch(N);if(!_.ok)throw new Error(`Request failed with status ${_.status}`);return await _.json()}catch(_){console.error("Failed to load form config",_),L({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function je(y){const $=`/api/template/form/${y}`;try{const N=await fetch($);if(!N.ok)throw new Error(`Request failed with status ${N.status}`);return(await N.json())?.schema}catch(N){console.error("Failed to load form template",N);return}}function He(y){if(y!=null){if(y?.data!==void 0)return y.data;if(y?.defaultValue!==void 0)return y.defaultValue;if(y?.values!==void 0)return y.values;if(typeof y=="object"&&!Array.isArray(y)){const{schema:$,token:N,mode:_,message:X,successMessage:ae,...te}=y;if(Object.keys(te).length)return te}}}async function vt(y,$,N){const _=Me(y.api,N),X=(typeof y.method=="string"?y.method:"PUT").toUpperCase();let ae;try{const be=await fetch(_);if(!be.ok)throw new Error(`Request failed with status ${be.status}`);ae=await be.json()}catch(be){console.error("Failed to load action data",be),Mt("Не вдалося отримати дані форми.");return}const te=typeof y.form=="string"?y.form.replace(/\.table$/,".form"):void 0,ue=ae?.schema??(te?await je(te):void 0),Re={mode:ae?.mode??"edit"};te&&(Re.form=te),ue&&(Re.schema=ue);const se=He(ae);se!==void 0&&(Re.defaultValue=se);const Pt=await I(Re);if(Pt)try{const be=await fetch(_,{method:X,headers:{"Content-Type":"application/json"},body:JSON.stringify(Pt)});if(!be.ok){const dt=await tn(be),tt=dt?.error??dt?.message??"Не вдалося зберегти дані.";throw new Error(tt)}Rt(`Дані успішно ${Re.value==="add"?"збережено":"оновлено"}`),A()}catch(be){console.error("Failed to submit action data",be),Mt("Не вдалося зберегти дані.")}}async function tn(y){try{return await y.json()}catch{return}}function Mt(y){L({title:"Помилка",type:"error",message:y})}function Rt(y){L({title:"Успіх",type:"success",message:y})}function bt(y){if(!j.value)return;const $=y.target;if(!$)return;const N=$.closest("[data-action-key]");N&&N.getAttribute("data-action-key")===j.value||q()}e.onMounted(()=>{document.addEventListener("click",bt,!0)}),e.onBeforeUnmount(()=>{x&&clearTimeout(x),document.removeEventListener("click",bt,!0),xe.emitter?.off?.("updateCard",S)});function Ft(y,$){const _=y?.[`${$.name}_text`];if(Array.isArray(_))return _.length?_.join(", "):"-";if(_!=null&&_!=="")return _;const X=y?.[$.name];return Array.isArray(X)?X.length?X.join(", "):"-":X??"-"}function Je(y,$){const _=y?.[`${$.name}_data`];if(_&&typeof _=="object")return{text:_.text??_.label??_.name??_.title??"-",color:_.color,textColor:_.textColor};const X=y?.[`${$.name}_text`]??y?.[$.name];return{text:(Array.isArray(X)?X.join(", "):X)??"-"}}function Mo(y,$){const N=Je(y,$);return N.color?{backgroundColor:N.color,color:N.textColor??"#ffffff"}:{}}function kt(y,$){const N=P($);if(N==="badge")return Je(y,$).text;if(N==="select")return Ft(y,$);if(N==="slot")return"-";if(N==="text")return y?.[$.name]??"-";const _=y?.[`${$.name}_data`];return _!=null&&typeof _!="object"?_:y?.[`${$.name}_text`]??y?.[$.name]??"-"}return(y,$)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",cp,[e.createElementVNode("div",dp,[e.createElementVNode("div",fp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":$[0]||($[0]=N=>d.value=N),type:"text",class:"w-52 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",onInput:Ze},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",pp,[e.createVNode(Vf,{columns:s.value,"onUpdate:columns":$[1]||($[1]=N=>s.value=N)},null,8,["columns"]),We.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:T,class:"inline-flex size-8 items-center justify-center rounded-lg bg-blue-500 text-white shadow-sm transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",title:"Додати запис","aria-label":"Додати запис"},[...$[2]||($[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)])])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",up,[e.createElementVNode("table",mp,[e.createElementVNode("thead",hp,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(N,_)=>(e.openBlock(),e.createElementBlock("th",{key:N.name,class:e.normalizeClass(W(_))},e.toDisplayString(N.ua),3))),128)),z.value?(e.openBlock(),e.createElementBlock("th",gp," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",yp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,N=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:N.id??JSON.stringify(N)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(_,X)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:_.name,class:e.normalizeClass(G(X,_))},[_.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:_.link.replace("{{id}}",N.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(kt(N,_)),9,vp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[P(_)==="slot"&&(_.slot?.content||_.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ff)(_.slot.content||_.slot)),{key:0,data:N,row:N,column:_,value:N?.[_.name]},null,8,["data","row","column","value"])):P(_)==="badge"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"items-center px-2 py-1 rounded-full text-xs font-semibold text-center justify-center flex",style:e.normalizeStyle(Mo(N,_))},e.toDisplayString(Je(N,_).text),5)):P(_)==="select"?(e.openBlock(),e.createElementBlock("span",bp,e.toDisplayString(Ft(N,_)),1)):(e.openBlock(),e.createElementBlock("span",kp,e.toDisplayString(kt(N,_)),1))],64))],2)),[[e.unref(r),le(N,_)]])),128)),z.value?(e.openBlock(),e.createElementBlock("td",Ep,[D(N)?(e.openBlock(),e.createElementBlock("div",wp,[e.createVNode(ip,{row:N,actions:M.value,"is-open":H(N),"action-key":ze(N),onToggle:_=>J(N)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),we.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",xp,[e.createElementVNode("td",{colspan:Z.value.length+(z.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,Np)]))])])]),e.createVNode(qf,{"current-page":m.value,"total-pages":pe.value,label:Le.value,onPrevious:Ge,onNext:Ke},null,8,["current-page","total-pages","label"])]))}}),Cp={class:"p-[20px]"},Sp={class:"flex gap-[6px] mb-5"},_p={class:"vs-form-text relative bg-white rounded-lg flex-grow"},Bp={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},$p={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Tp={class:"space-y-8"},Lp={key:0},Ap={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Ip=["onClick"],Dp={class:"md:col-span-2"},Op={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Mp={class:"text-sm text-gray-500 dark:text-neutral-500"},Rp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Fp=["checked","onChange"],Pp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},zp={class:"md:col-span-2"},jp={class:"font-semibold text-gray-800 dark:text-neutral-200"},Hp=["onClick"],Up={class:"md:col-span-2"},qp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Wp={class:"text-sm text-gray-500 dark:text-neutral-500"},Kp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Gp=["checked","onChange"],In="uk",Dn=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return In;const I=localStorage.language,A=typeof navigator<"u"?navigator.language:In;return(I||A||In).split(/[-_]/)[0].toLowerCase()||In},s=t,r=e.ref(""),l=["view","add","edit","del"],i=e.ref({}),a=e.ref(o()),c={view:"Перегляд",add:"Додавання",edit:"Редагування",del:"Видалення"},d=I=>c[I]??I,m=()=>{a.value=o()},f=()=>{const I=[];return a.value&&I.push(a.value),n.forEach(A=>{A&&!I.includes(A)&&I.push(A)}),I.includes("path")||I.push("path"),I},g=I=>{const A=f();for(const h of A){const T=I[h];if(typeof T=="string"&&T.trim())return T}return""};e.onMounted(async()=>{m();const A=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();A.routes&&A.routes.forEach(h=>{i.value[h.path]=new Set(h.actions)})});const b=(I,A)=>i.value[I]?.has(A)??!1,k=(I,A)=>{i.value[I]||(i.value[I]=new Set),i.value[I].has(A)?i.value[I].delete(A):i.value[I].add(A)},v=(I,A)=>{I.forEach(h=>{h.path&&(i.value[h.path]||(i.value[h.path]=new Set),i.value[h.path].has(A)?i.value[h.path].delete(A):i.value[h.path].add(A))})},x=e.computed(()=>Object.entries(i.value).map(([I,A])=>({path:I,actions:Array.from(A)})).filter(I=>I.actions.length)),E=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:x.value})}),xe.notify({title:"Success!",message:"Permissions saved."})},j=()=>{i.value={}},S=I=>{if(!r.value.trim())return I;const A=r.value.toLowerCase();return I.filter(h=>g(h).toLowerCase().includes(A)||(h.path?.toLowerCase().includes(A)??!1))},L=e.computed(()=>S(s.data.routers.filter(I=>!I.menu))),R=e.computed(()=>s.data.routers.filter(I=>I.menu).map(I=>({...I,menu:S(I.menu||[])})).filter(I=>I.menu&&I.menu.length>0));return(I,A)=>(e.openBlock(),e.createElementBlock("div",Cp,[e.createElementVNode("div",Sp,[e.createElementVNode("div",_p,[A[1]||(A[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":A[0]||(A[0]=h=>r.value=h),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("button",{onClick:j,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:E,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",Bp,[A[2]||(A[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(h,T)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:T},[e.createElementVNode("h3",$p,e.toDisplayString(d(h)),1)])),64))]),e.createElementVNode("div",Tp,[L.value.length?(e.openBlock(),e.createElementBlock("div",Lp,[e.createElementVNode("ul",Ap,[A[3]||(A[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(h,T)=>e.createElementVNode("li",{key:T,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:F=>v(L.value,l[T])}," Перемкнути всі ",8,Ip)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(h,T)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+T,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Dp,[e.createElementVNode("p",Op,e.toDisplayString(g(h)),1),e.createElementVNode("p",Mp,e.toDisplayString(h.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(F,P)=>e.createElementVNode("li",{key:P,class:"col-span-1"},[e.createElementVNode("div",Rp,[e.createElementVNode("input",{type:"checkbox",checked:b(h.path,F),onChange:K=>k(h.path,F),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Fp)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(h,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:"space-y-5"},[e.createElementVNode("ul",Pp,[e.createElementVNode("li",zp,[e.createElementVNode("h3",jp,e.toDisplayString(g(h)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(F,P)=>e.createElementVNode("li",{key:P,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:K=>v(h.menu,l[P])}," Перемкнути всі ",8,Hp)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.menu,(F,P)=>(e.openBlock(),e.createElementBlock("ul",{key:P,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Up,[e.createElementVNode("p",qp,e.toDisplayString(g(F)),1),e.createElementVNode("p",Wp,e.toDisplayString(F.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(K,Z)=>e.createElementVNode("li",{key:Z,class:"col-span-1"},[e.createElementVNode("div",Kp,[e.createElementVNode("input",{type:"checkbox",checked:b(F.path,K),onChange:B=>k(F.path,K),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Gp)])])),64))]))),128))]))),128))])]))}}),yt={"vs-widget-comments":sn,"vs-widget-history":rn,"vs-widget-gallery":an,"vs-widget-file":ln,"vs-widget-list":jn,"vs-widget-map":un,"vs-widget-table":hr,"vs-group-interface":Dn};function gr(t){if(t==null)return null;const n=Number(t);return Number.isFinite(n)?Math.max(1,Math.min(12,Math.floor(n))):null}function yr(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>yr(o))),n}function Zp(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=gr(c.col);d?(c.col=d,o.push({item:c,span:d})):s.push(c)}),!o.length&&s.length){s.forEach(c=>{c.col=12});return}const r=o.reduce((c,d)=>c+d.span,0);let l=n-r;if(s.length===0)return;l<=0&&(l=n);const i=Math.max(1,Math.floor(l/s.length));let a=Math.max(0,l-i*s.length);s.forEach(c=>{let d=i;a>0&&(d+=1,a-=1),c.col=Math.max(1,Math.min(12,d))})}function On(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>yr(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=On(s.items,12))}),Zp(o,n),o}function vr(t){const n=gr(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const Jp={class:"text-lg font-semibold text-gray-900"},Yp=["innerHTML"],Xp={key:0,class:"grid grid-cols-12 gap-4"},Qp={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Vp={class:"text-lg font-semibold text-gray-900"},eu=["innerHTML"],Vt=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},hideTitle:{type:Boolean},styling:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.computed(()=>{if(!n.col)return{};const d=Math.max(1,Math.min(12,Number(n.col)));return{[`md:col-span-${d}`]:!0,[`lg:col-span-${d}`]:!0}}),s=e.computed(()=>On(n.items));function r(d){const m=["col-span-12"],f=vr(d.col);return f.length&&m.push(...f),m}function l(d){return yt[d]||d}function i(d,m){if(!d||typeof m!="string"||!m)return{found:!1,value:void 0};const f=m.split(".");let g=d;for(const b of f){if(g==null||typeof g!="object"&&!Array.isArray(g))return{found:!1,value:void 0};if(!(b in g))return{found:!1,value:void 0};g=g[b]}return{found:!0,value:g}}const a=function(d={}){const m={...d};return Object.entries(m).forEach(([f,g])=>{if(f!=="props"&&typeof g=="string"){const b=i(n.data,g);b.found&&(m[f]=b.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([f,g])=>{if(typeof g=="string"){const b=i(n.data,g);m[f]=b.found?b.value:g}else m[f]=g}),delete m.props,m},c=e.computed(()=>{const d={};return n.col&&(d.col=n.col),d});return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[o.value,t.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!t.hideTitle&&t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",t.styling?.classItemTitle])},[e.createElementVNode("h3",Jp,e.toDisplayString(t.title),1)],2)):e.createCommentVNode("",!0),t.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:t.html,class:"text-gray-900 leading-relaxed"},null,8,Yp)):t.type?.includes("tabs")?(e.openBlock(),e.createBlock(en,{key:2,view:t.type,panels:t.items,data:t.data,styling:t.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[s.value.length?(e.openBlock(),e.createElementBlock("div",Xp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:f.name||f.component||g,class:e.normalizeClass(r(f))},[f.title||f.label?(e.openBlock(),e.createElementBlock("div",Qp,[e.createElementVNode("h3",Vp,e.toDisplayString(f.title||f.label),1)])):e.createCommentVNode("",!0),f.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:f.html,class:"text-gray-900 leading-relaxed"},null,8,eu)):f.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(f.component)),e.mergeProps({key:2,ref_for:!0},{geom:t.data.geom,id:t.data.id,...c.value,...a(f),data:t.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),tu={class:"grid grid-cols-12 gap-[20px]"},nu={key:0,class:"col-span-4"},ou=["innerHTML"],su=["onClick"],ru=["innerHTML"],iu={key:1,class:"flex w-full"},lu={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},au=["onClick"],cu={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},du={class:"flex-1 p-4"},fu=["innerHTML"],pu={class:"grid grid-cols-12 gap-4"},uu={key:3,class:"w-full h-full"},en=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},styling:{},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},backgroundClass:{},tabContentWrapperClass:{},tabPanelClass:{},id:{},className:{},style:{}},setup(t){const n=t;function o(){const B=typeof window<"u"?window:globalThis,M="__vsCardAnonymousCounter__",w=B[M]??0;return B[M]=w+1,w===0?"tab":`tab${w}`}const s=e.ref(0),r=e.ref([]);let l=!1,i=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,B=>{B&&(a.value=B)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function m(B,M){const w=M?.path;return w?(c.has(w)||c.set(w,e.defineAsyncComponent(()=>import(w))),c.get(w)):typeof B=="string"&&yt[B]?yt[B]:M?.component&&yt[M.component]?yt[M.component]:M?.name&&yt[M.name]?yt[M.name]:B}function f(B){return B.forEach(M=>{M.type&&(M.view=M.type)}),r.value=B.filter(M=>M.type==="pin"),B.filter(M=>M.type!=="pin")}const g=e.computed(()=>{let B;return n.panels&&n.panels.length>0?B=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(B=n.data.filter(w=>w.type.includes("tabs"))[0]?.items),On(B,12)}),b=e.computed(()=>a.value);function k(){i||(i=!0)}const v=e.computed(()=>{let B;return n.panels&&n.panels.length>0?B=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(B=n.data),On(B,12)}),x=e.computed(()=>({[`view-${n.view}`]:!0}));function E(B,M){if(!B||typeof M!="string"||!M)return{found:!1,value:void 0};const w=M.split(".");let z=B;for(const ne of w){if(z==null||typeof z!="object"&&!Array.isArray(z))return{found:!1,value:void 0};if(!(ne in z))return{found:!1,value:void 0};z=z[ne]}return{found:!0,value:z}}const j=B=>{const M={...B};return Object.entries(M).forEach(([w,z])=>{if(w!=="props"&&typeof z=="string"){const ne=E(n.data,z);ne.found&&(M[w]=ne.value)}}),B.props&&typeof B.props=="object"&&Object.entries(B.props).forEach(([w,z])=>{if(typeof z=="string"){const ne=E(n.data,z);M[w]=ne.found?ne.value:z}else M[w]=z}),delete M.props,n.data&&(M.data=n.data),M};function S(B){const M=["col-span-12"],w=vr(B.col);return w.length&&M.push(...w),M}const L=e.ref([]),R=e.ref([]),I=e.ref([]);function A(B,M){B&&B instanceof HTMLElement&&(L.value[M]=B)}function h(){R.value=L.value.map(B=>B.offsetWidth),I.value=L.value.map(B=>B.offsetLeft)}function T(){if(typeof window>"u")return null;const B=b.value;if(!B)return null;const w=new URL(window.location.href).searchParams.get(B);if(w===null)return null;const z=Number.parseInt(w,10);return Number.isNaN(z)?null:z}function F(B){if(typeof window>"u")return;const M=b.value;if(!M||!i)return;const w=new URL(window.location.href);B<=0?w.searchParams.delete(M):w.searchParams.set(M,String(B));const z=window.history.state??{};window.history.replaceState(z,document.title,w)}function P(){if(l||!g.value.length)return;k();const B=T();if(B===null)return;const M=Math.min(Math.max(B,0),g.value.length-1);M!==B&&F(M),M!==s.value&&(s.value=M),l=!0}function K(){l=!1,P()}let Z=null;return e.onMounted(()=>{e.nextTick(()=>{P(),h()}),typeof window<"u"&&window.addEventListener("popstate",K),Z=new ResizeObserver(()=>h()),Z.observe(document.body)}),e.onBeforeUnmount(()=>{Z?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",K)}),e.watch(s,B=>{e.nextTick(()=>{h()}),F(B)}),e.watch(g,()=>{l=!1,P()}),(B,M)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.classWrapper||x.value)},[e.createElementVNode("div",tu,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(w,z)=>(e.openBlock(),e.createElementBlock("div",{key:w.name||z,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[w.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:w.html,class:"text-gray-900 leading-relaxed"},null,8,ou)):w.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(w.component,w)),e.mergeProps({key:1,ref_for:!0},w.component==="Card"?w:j(w),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(r.value.length!==0?"col-span-8":"col-span-12")},[t.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",t.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",t.styling?.classTabHeader])},[R.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:R.value[s.value]+"px",left:I.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(w,z)=>(e.openBlock(),e.createElementBlock("button",{key:w.name||z,ref_for:!0,ref:ne=>A(ne,z),onClick:ne=>s.value=z,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===z?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(w.title||w.label||w.name||`Tab ${z+1}`),11,su))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([t.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(w,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:w.name||z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100"])},[w.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:w.html,class:"text-gray-900 leading-relaxed"},null,8,ru)):B.$slots[`tab-${z}`]?e.renderSlot(B.$slots,`tab-${z}`,{key:1,item:w,data:t.data}):w.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Vt),e.mergeProps({key:2,ref_for:!0},j(w),{items:w.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):w.component||w.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(w.component||w.name,w)),e.mergeProps({key:3,ref_for:!0},w.component==="Card"?w:j(w),{styling:t.styling,id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(B.$slots,w.slot||`tab-${z}`,{key:4,item:w,data:t.data})],2)),[[e.vShow,s.value===z]])),128))],2)],2)):t.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("div",lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(w,z)=>(e.openBlock(),e.createElementBlock("button",{key:w.name||z,onClick:ne=>s.value=z,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===z?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(w.title||w.label||w.name||`Tab ${z+1}`)+" ",1),s.value===z?(e.openBlock(),e.createElementBlock("span",cu,[...M[0]||(M[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)])])):e.createCommentVNode("",!0)],10,au))),128))]),e.createElementVNode("div",du,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(w,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:w.name||z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100 py-2"])},[w.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:w.html,class:"text-gray-900 leading-relaxed"},null,8,fu)):B.$slots[`tab-${z}`]?e.renderSlot(B.$slots,`tab-${z}`,{key:1,item:w,data:t.data}):w.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Vt),e.mergeProps({key:2,ref_for:!0},j(w),{items:w.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):w.component||w.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(w.component||w.name,w)),e.mergeProps({key:3,ref_for:!0},w.component==="Card"?w:j(w),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(B.$slots,w.slot||`tab-${z}`,{key:4,item:w,data:t.data})],2)),[[e.vShow,s.value===z]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",pu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(w,z)=>(e.openBlock(),e.createElementBlock("div",{key:w.name||w.component||z,class:e.normalizeClass(S(w))},[B.$slots[`panel-${z}`]?e.renderSlot(B.$slots,`panel-${z}`,{key:0,item:w,data:t.data}):w.items||w.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Vt),e.mergeProps({key:1,ref_for:!0},j(w),{items:w.items||[],class:["w-full h-auto",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):w.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(w.component,w)),e.mergeProps({key:2,ref_for:!0},j(w),{class:["w-full h-auto",[t.styling?.classItem]],styling:t.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",uu,[e.renderSlot(B.$slots,w.slot||`panel-${z}`,{item:w,data:t.data})]))],2))),128))])],2))],2)])],2))}}),mu=["onClick"],br=nt(e.defineComponent({__name:"CopyNotification",setup(t,{expose:n}){const o=e.ref([]);let s=1;const r=()=>{if(o.value.length>=10){const a=o.value[0];clearTimeout(a.timer),o.value.shift()}const i={id:s++,timer:setTimeout(()=>{l(i.id)},1500)};o.value.push(i)},l=i=>{const a=o.value.findIndex(c=>c.id===i);if(a!==-1){const c=o.value[a];clearTimeout(c.timer),o.value.splice(a,1)}};return n({addNotification:r}),e.onUnmounted(()=>{o.value.forEach(i=>{clearTimeout(i.timer)})}),(i,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(Ir),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),a[0]||(a[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:d=>l(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Pn),{class:"h-4 w-4"})],8,mu)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);en.install=function(t){t.component("vs-widget-file",ln),t.component("vs-widget-comments",sn),t.component("vs-widget-history",rn),t.component("vs-widget-gallery",an),t.component("vs-widget-map",un),t.component("vs-group-interface",Dn),t.component("CommentsWidget",sn),t.component("HistoryWidget",rn),t.component("GalleryWidget",an),t.component("FilesWidget",ln),t.component("MapWidget",un),t.component("Card",en),t.component("CardItem",Vt),t.component("DescriptionListWidget",jn),t.component("CopyNotification",br),t.component("GroupInterfaceWidget",Dn)},ge.Card=en,ge.CardItem=Vt,ge.CommentsWidget=sn,ge.CopyNotification=br,ge.DescriptionListWidget=jn,ge.FilesWidget=ln,ge.GalleryWidget=an,ge.GroupInterfaceWidget=Dn,ge.HistoryWidget=rn,ge.MapWidget=un,ge.TableWidget=hr,ge.default=en,Object.defineProperties(ge,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));