@opengis/widgets 0.0.51 → 0.0.52

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,9 +1,9 @@
1
- (function(he,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):(he=typeof globalThis<"u"?globalThis:he||self,e(he.WidgetLib={},he.Vue,he.OpenGISCore))})(this,(function(he,e,we){"use strict";function gr(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 yr=gr(e);const Do=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vr=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),br=t=>{const n=vr(t);return n.charAt(0).toUpperCase()+n.slice(1)},kr=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var en={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 Er=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>e.h("svg",{...en,width:t||en.width,height:t||en.height,stroke:s||en.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:kr("lucide",...l?[`lucide-${Do(br(l))}-icon`,`lucide-${Do(l)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const ae=(t,n)=>(o,{slots:s})=>e.h(Er,{...o,iconNode:n,name:t},s);const wr=ae("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 xr=ae("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Nr=ae("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 Oo=ae("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 Cr=ae("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 xt=ae("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 Sr=ae("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 _r=ae("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 Br=ae("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 Tr=ae("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 $r=ae("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 Mo=ae("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 Lr=ae("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 Ir=ae("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 Ro=ae("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Ar=ae("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 Po=ae("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 Dr=ae("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 Or=ae("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 Dn=ae("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 Mr=ae("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 On=ae("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 Rr=ae("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 Mn=ae("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Pr={class:"border-t pt-3 mt-4"},Fr={class:"flex gap-2"},zr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},jr={class:"flex-1 space-y-2"},Hr={class:"flex justify-between items-center"},Ur={class:"flex gap-2"},qr=["disabled"],Fo=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",Pr,[e.createElementVNode("div",Fr,[e.createElementVNode("span",zr,[e.createVNode(e.unref(On),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",jr,[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",Hr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",Ur,[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(Mn),{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(Po),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,qr)])])])])]))}}),Wr={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"},Kr=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,u)=>(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",Wr,[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(Or),{class:"h-3 w-3 mr-2"}),u[0]||(u[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(Dn),{class:"h-3 w-3 mr-2"}),u[1]||(u[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),Gr={class:"space-y-2"},Zr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Jr={class:"flex-1 min-w-0 space-y-1 relative"},Yr={class:"flex items-center gap-2"},Xr={class:"font-medium text-xs"},Qr={class:"text-xs text-gray-500"},Vr={key:0,class:"text-xs text-gray-700 leading-relaxed"},ei={class:"flex justify-between text-xs"},ti={class:"flex items-center gap-2"},ni={key:0,class:"flex gap-2"},oi=["disabled"],si={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},ri=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),u=e.ref(!1),f=S=>{const E=new Date,F=Math.floor((E.getTime()-S.getTime())/(1e3*60*60));return F<1?`${Math.floor((E.getTime()-S.getTime())/6e4)}m`:F<24?`${F}h`:`${Math.floor(F/24)}d`},h=()=>{u.value=!u.value,u.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},x=()=>{o("edit",s.comment.id,r.value),d.value=!1},k=(S,E)=>{o("like",S,E)},y=(S,E)=>{o("edit",S,E)};return(S,E)=>{const F=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",Gr,[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",Zr,[e.createVNode(e.unref(On),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Jr,[e.createElementVNode("div",Yr,[e.createElementVNode("span",Xr,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",Qr,e.toDisplayString(f(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":E[0]||(E[0]=I=>r.value=I),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",Vr,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",u.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:E[1]||(E[1]=I=>h())},[e.createVNode(e.unref(Br),{class:e.normalizeClass(["h-3 w-3",u.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]=I=>c.value=!0)},[e.createVNode(e.unref(Ar),{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]=I=>a.value=!0)},[e.createVNode(e.unref(Cr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",ni,[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]=I=>d.value=!1)},[e.createVNode(e.unref(Mn),{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]=I=>x())},[e.createVNode(e.unref(Po),{class:"h-3 w-3 mr-1"}),E[12]||(E[12]=e.createTextVNode(" Send ",-1))],8,oi)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(Kr,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":E[6]||(E[6]=I=>a.value=I),onEdit:E[7]||(E[7]=I=>d.value=!0),onDelete:E[8]||(E[8]=I=>S.$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",si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,I=>(e.openBlock(),e.createBlock(F,{key:I.id,comment:I,isInside:!0,onDelete:g=>S.$emit("delete",I.id),onLike:k,onEdit:y},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Fo,{key:0,onSendComment:E[9]||(E[9]=I=>S.$emit("reply",t.comment?.id,I)),isReply:c.value,"onUpdate:isReply":E[10]||(E[10]=I=>c.value=I)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),ii=["id"],li={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},tn=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(h=>h.json());r.value=f.rows.map(h=>({id:h.communication_id,author:h.username,text:h.body,createdAt:new Date(h.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,h)=>{o?.onLike?.(f,h),s("like",f,h)},c=(f,h)=>{o.onReply?.(f,h),s("reply",f,h)},d=async(f,h)=>{o.onEdit?o.onEdit(f,h):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:h})}),await l()),s("edit",f,h)},u=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,h)=>(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",li,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,x=>(e.openBlock(),e.createBlock(ri,{key:x.id,comment:x,onReply:c,onLike:a,onDelete:h[0]||(h[0]=k=>u(k)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Fo,{onSendComment:h[1]||(h[1]=x=>i(x))})],14,ii))}}),zo=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:xt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Dr}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Mr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Tr}]]),ai={class:"mx-auto font-sans"},ci={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},di={class:"relative"},fi={class:"space-y-3"},pi={class:"flex-1 min-w-0 pb-2"},ui={class:"flex items-center gap-1.5 mb-1 mt-0.5"},mi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},hi={class:"font-medium text-xs"},gi={class:"text-xs text-gray-500"},yi={class:"space-y-1"},vi={class:"text-xs text-gray-700"},bi={class:"capitalize mr-1"},ki={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"},Ei={key:0,class:"flex items-center gap-1 text-xs"},wi={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},xi={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},nn=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",ai,[t.title?(e.openBlock(),e.createElementBlock("h3",ci,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",di,[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",fi,[(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(zo).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(zo).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",pi,[e.createElementVNode("div",ui,[e.createElementVNode("span",mi,[e.createVNode(e.unref(On),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",hi,e.toDisplayString(i?.userName),1),e.createElementVNode("span",gi,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",yi,[e.createElementVNode("div",vi,[e.createElementVNode("span",bi,e.toDisplayString(i?.action),1),i?.entityId?(e.openBlock(),e.createElementBlock("span",ki,e.toDisplayString(i?.entityId),1)):e.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(e.openBlock(),e.createElementBlock("div",Ei,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",wi,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(xr),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",xi,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Ni={key:0,class:"text-xl font-semibold"},Ci={class:"flex gap-1"},Si={key:0},_i=["accept"],Bi={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"},Ti=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",Ni,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ci,[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(Lr),{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(_r),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Si,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,40,_i),e.createElementVNode("div",Bi,[e.createVNode(e.unref(Ro),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),Rn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:xt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Sr,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Rr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:xt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:wr,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Mo,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Mo,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:xt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:xt,label:"PPT"}};function jo(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function Ho(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 $i={class:"space-y-0.5"},Li=["onClick"],Ii=["onClick"],Ai={class:"flex items-center gap-2"},Di={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},Oi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Mi={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ri={class:"flex items-center gap-1"},Pi=["onClick"],Fi=["onClick"],zi=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",$i,[(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(Rn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Rn)[s?.ext]?.icon||e.unref(Rn).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",Ai,[e.createElementVNode("span",Di,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,Ii),e.createElementVNode("div",Oi,e.toDisplayString(e.unref(Ho)(s.size)),1),e.createElementVNode("div",Mi,e.toDisplayString(e.unref(jo)(s.createdAt)),1),e.createElementVNode("div",Ri,[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(Oo),{class:"h-3 w-3"})],8,Pi),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(Dn),{class:"h-3 w-3"})],8,Fi)])],8,Li))),128))]))}}),ji={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Hi=["onClick"],Ui={class:"space-y-2"},qi={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},Wi=["src"],Ki={class:"space-y-1"},Gi=["title"],Zi={class:"text-xs text-gray-500 text-left"},Ji={class:"absolute top-2 right-1 flex items-center gap-1"},Yi=["onClick"],Xi=["onClick"],Qi=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",ji,[(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",Ui,[e.createElementVNode("div",qi,[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,Wi)):(e.openBlock(),e.createBlock(e.unref(xt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Ki,[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,Gi),e.createElementVNode("p",Zi,e.toDisplayString(e.unref(jo)(s.createdAt))+", "+e.toDisplayString(e.unref(Ho)(s.size)),1)])]),e.createElementVNode("div",Ji,[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(Oo),{class:"h-3 w-3"})],8,Yi),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(Dn),{class:"h-3 w-3"})],8,Xi)])],8,Hi))),128))]))}}),Vi={class:"mx-auto font-sans"},el={key:1},on=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 v=(o.format??[]).map(R=>typeof R=="string"?R.trim():R==null?"":String(R).trim()).filter(R=>R.length>0),L=[];return v.forEach(R=>{const z=R.toLowerCase(),Z=z.indexOf("/"),W=Z>=0;let T,D=!1,w;if(W){T=z;const se=z.slice(Z+1);D=se==="*",!D&&se&&(w=`.${se.replace(/^\.+/,"")}`)}else w=z.startsWith(".")?z:`.${z.replace(/^\.+/,"")}`;const j=W?T:w??"";j&&L.push({acceptValue:j,mime:T,wildcard:D,extension:w})}),L.length?L:null}),d=e.computed(()=>{const A=c.value;if(!A)return;const v=A.map(L=>L.acceptValue).filter(Boolean);return v.length?v.join(","):void 0}),u=A=>{if(!c.value)return!0;const v=A.type?.toLowerCase(),L=A.name?.toLowerCase();return c.value.some(R=>{if(R.mime){if(v){if(R.wildcard){const z=R.mime.split("/")[0];if(v.startsWith(`${z}/`))return!0}else if(v===R.mime)return!0}return!!(R.extension&&L?.endsWith(R.extension))}return!!(R.extension&&L?.endsWith(R.extension))})},f=n;a.value.length===0&&g();const h=(A,v)=>{r.value=v,s.value=!0},x=()=>{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):[]),y=A=>{const v=k.value.findIndex(L=>L===A.file_path);v!==-1&&(l.value=!0,i.value=v)},S=A=>{o.onAddFile?o.onAddFile(A):N(A),f("add",A)},E=A=>{o.onDelete?o.onDelete(A):M(A),f("delete",A)},F=A=>{const v=document.createElement("a");v.setAttribute("download",A?.uploaded_name||A?.name),v.href=A?.file_path||A?.path,v.click()},I=e.ref("list");async function g(){if(!o.id)return;const A=await fetch(`/api/widget/file/${o.id}`).then(v=>v.json());A.rows.forEach(v=>{v.timestamp=new Date(v.cdate),v.id=v.entity_id,v.entityType=v.entity_type,v.entityId=v.entity_id,v.entityType=v.entity_type,v.action=v.change_type,v.userId=v.change_user_id,v.userName=v.username,v.timestamp=new Date(v.cdate),v.description=v.username,v.status=v.username}),a.value=A.rows}const N=async A=>{const L=A.target?.files;if(!L||L.length===0)return;const R=Array.from(L),z=[],Z=[];if(R.forEach(W=>{u(W)?z.push(W):Z.push(W)}),Z.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${Z.map(W=>W.name).join(", ")}`),z.length!==0)try{await Promise.all(z.map(async W=>{const T=new FormData;T.append("file",W);const D=`/api/widget/file/${o.id}`,w=await fetch(D,{method:"POST",body:T});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);return W})),await g()}catch(W){console.error("Помилка при завантаженні файлів:",W)}},M=async A=>{try{await fetch(`/api/widget/file/${o.id}/${A}`,{method:"DELETE"}),await g()}catch(v){console.error(v)}};return(A,v)=>{const L=e.resolveComponent("MessageBox"),R=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Vi,[e.createVNode(Ti,{modelValue:I.value,"onUpdate:modelValue":v[0]||(v[0]=z=>I.value=z),title:o.title,onOnAddFile:v[1]||(v[1]=z=>S(z)),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"})},[I.value==="list"?(e.openBlock(),e.createBlock(zi,{key:0,onDelete:h,onDownload:F,onOpenLightbox:v[2]||(v[2]=z=>y(z)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),I.value==="grid"?(e.openBlock(),e.createBlock(Qi,{key:1,onDelete:h,onDownload:F,onOpenLightbox:v[3]||(v[3]=z=>y(z)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",el,[...v[6]||(v[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),e.createVNode(L,{modelValue:s.value,"onUpdate:modelValue":v[4]||(v[4]=z=>s.value=z),onConfirm:x,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(R,{modelValue:l.value,"onUpdate:modelValue":v[5]||(v[5]=z=>l.value=z),images:k.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),tl={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},nl=["onClick"],ol={key:0,rel:"noreferrer",class:"relative block h-full w-full"},sl=["src"],rl={key:0,class:"thumb-cover"},il=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(u=>u===c.file_path);d!==-1&&(s.value=!0,r.value=d)};return(c,d)=>{const u=e.resolveComponent("Lightbox");return t.items?.length>=1?(e.openBlock(),e.createElementBlock("div",tl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+h,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:h,onClick:e.withModifiers(x=>a(f),["stop"])},[h<5?(e.openBlock(),e.createElementBlock("div",ol,[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]",h===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,sl),h===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",rl," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,nl))),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(u,{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)}}}),ll={key:0,class:"text-xl font-semibold"},al={class:"flex gap-1"},cl=["accept"],dl={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"},fl=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",ll,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",al,[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,cl),e.createElementVNode("div",dl,[e.createVNode(e.unref(Ro),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),pl={class:"w-full mx-auto font-sans",ref:"containerRef"},ul={key:1},sn=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=g=>{if(!g)return[];const N=Array.isArray(g)?g:g.split(",");return Array.from(new Set(N.map(M=>M.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],l=e.computed(()=>{const g=s(o.format);return g.length>0?g:void 0}),i=e.computed(()=>{const g=l.value;return!g||g.length===0?"image/*":g.map(N=>N.startsWith(".")?N:`.${N}`).join(",")}),a=g=>g?.split(".").pop()?.toLowerCase()??"",c=g=>{const N=g?.toLowerCase();return!!N&&!!l.value&&l.value.includes(N)},d=g=>{const N=g?.toLowerCase();return!!N&&r.includes(N)},u=g=>{const N=g.type?.toLowerCase(),M=g.ext?.toLowerCase();return N?.startsWith("image/")?l.value?c(M):!0:M?l.value?c(M):d(M):!1},f=g=>{if(!g.type?.toLowerCase()?.startsWith("image/"))return!1;if(!l.value)return!0;const M=a(g.name);return c(M)},h=g=>g.filter(u),x=e.ref(h(o.items??[])),k=n;x.value.length===0&&F();const y=g=>{o.onAddImage?o.onAddImage(g):E(g),k("add",g)},S=g=>{const N=x.value.find(M=>M.file_path===g)?.file_id;N&&(o.onDelete?o.onDelete(N):I(N))},E=async g=>{const N=g.target;if(!N?.files||N.files.length===0)return;const M=Array.from(N.files),A=M.filter(L=>f(L)),v=l.value?.join(", ")??"image/*";if(A.length===0){console.warn(`Допустимі формати: ${v}. Завантажте зображення дозволеного типу.`);return}A.length!==M.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${v}.`);try{await Promise.all(A.map(async L=>{const R=new FormData;R.append("file",L);const z=`/api/widget/file/${o.id}`,Z=await fetch(z,{method:"POST",body:R});if(!Z.ok)throw new Error(`HTTP error! status: ${Z.status}`);return L})),await F()}catch(L){console.error("Помилка при завантаженні файлів:",L)}};async function F(){if(!o.id)return;const g=await fetch(`/api/widget/file/${o.id}`).then(N=>N.json());x.value=h(g.rows)}const I=async g=>{try{await fetch(`/api/widget/file/${o.id}/${g}`,{method:"DELETE"}),await F()}catch(N){console.error(N)}};return(g,N)=>(e.openBlock(),e.createElementBlock("div",pl,[e.createVNode(fl,{title:t.title,accept:i.value,onOnAddImage:N[0]||(N[0]=M=>y(M))},null,8,["title","accept"]),x.value.length>0?(e.openBlock(),e.createBlock(il,{key:0,items:x.value,onDelete:N[1]||(N[1]=M=>S(M))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",ul,[...N[2]||(N[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),ml={class:"text-value"},hl={class:"text-sm text-gray-900"},gl=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",ml,[e.createElementVNode("span",hl,e.toDisplayString(o.value),1)]))}}),ot=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},yl=ot(gl,[["__scopeId","data-v-34a76c89"]]),vl={class:"link-value"},bl=["href"],kl=ot(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",vl,[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"]]),El={class:"date-value"},wl={class:"text-sm text-gray-900"},xl=ot(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",El,[e.createElementVNode("span",wl,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),Nl={class:"status-value"},Cl={key:0,class:"mr-1"},Sl=ot(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",Nl,[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",Cl,[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"]]),_l={class:"custom-value"},Bl={class:"text-sm text-gray-900"},Tl=ot(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",_l,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Bl,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),$l=["id"],Ll={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Il={key:1,class:"overflow-x-auto"},Al={class:"min-w-full divide-y divide-gray-200"},Dl={class:"bg-white divide-y divide-gray-200"},Ol={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Ml={class:"flex items-center gap-2"},Rl=["title"],Pl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Fl={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},zl={class:"flex items-start gap-3"},jl={key:0,class:"flex-shrink-0"},Hl={class:"flex-1 min-w-0"},Ul={class:"flex items-center gap-2 mb-2"},ql={class:"text-sm font-medium text-gray-900"},Wl=["title"],Kl={key:3,class:"overflow-x-auto"},Gl={class:"min-w-full divide-y divide-gray-200"},Zl={class:"bg-white divide-y divide-gray-200"},Jl={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Yl={class:"flex items-center gap-2"},Xl=["title"],Ql={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Pn=ot(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return kl;case"date":return xl;case"status":return Sl;case"custom":return Tl;default:return yl}};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",Ll,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",Il,[e.createElementVNode("table",Al,[e.createElementVNode("tbody",Dl,[(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",Ol,[e.createElementVNode("div",Ml,[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,Rl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Pl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Fl,[(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",zl,[r.icon?(e.openBlock(),e.createElementBlock("div",jl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Hl,[e.createElementVNode("div",Ul,[e.createElementVNode("h4",ql,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,Wl)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Kl,[e.createElementVNode("table",Gl,[e.createElementVNode("tbody",Zl,[(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",Jl,[e.createElementVNode("div",Yl,[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,Xl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Ql,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,$l))}}),[["__scopeId","data-v-106790ef"]]);function Uo(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 Vl(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 ea="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Fn=null;function ta(){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 na(){return Fn||(Fn=Uo(ea).then(()=>{const t=ta();if(!t)throw new Error("IMask is not available after loading the script");return t})),Fn}function oa(){return typeof window>"u"?"":window.location?.origin??""}function qo(){if(!(typeof window>"u"))return window.maplibregl}const Wo=Symbol("vs-widget-map");function zn(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function sa(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 ra(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function jn(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=oa(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function ia(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 la(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function rn(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 Ko=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function aa(t){const n=t?.color??Ko[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)}):Ko.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 Rt="map-highlight-source",ca="map-highlight-fill",da="map-highlight-line";function fa(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function Go(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function pa(){return Vl("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Uo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),qo()}function ln(t){const n=e.inject(Wo,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 u=t.style??null,f=null;const h=p=>{p&&(o.value?o.value.setStyle(p):u=p)},x=()=>{r.value.overlays=i.value.map(p=>({id:p.id,name:p.config.name,visible:p.visible}))},k=p=>{const B=Array.isArray(p)?p:[];l.value=B,B.some(H=>H.key===r.value.selectedBasemap)||(r.value.selectedBasemap=B[0]?.key??"")},y=p=>{p&&i.value.forEach(B=>{B.layerIds.forEach(O=>{p.getLayer(O)&&p.removeLayer(O)}),p.getSource(B.sourceId)&&p.removeSource(B.sourceId),B.layerIds=[]})},S=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||(i.value.forEach(B=>{E(p,B)}),z())},E=(p,B)=>{const O=ia(B.config);O==="vtile"?I(p,B):O==="raster"&&F(p,B)},F=(p,B)=>{const O=B.config,H=B.sourceId,J=jn(O.url);if(!J)return;p.getSource(H)||p.addSource(H,{type:"raster",tiles:[J],minzoom:O.minzoom??0,maxzoom:O.maxzoom??24});const G=`${B.id}-raster`;p.getLayer(G)||p.addLayer({id:G,type:"raster",source:H,layout:{visibility:B.visible?"visible":"none"}}),B.layerIds=[G],g(p,B)},I=(p,B)=>{const O=B.config,H=B.sourceId,J=jn(O.url);if(!J)return;p.getSource(H)||p.addSource(H,{type:"vector",tiles:[J],minzoom:O.minzoom??0,maxzoom:O.maxzoom??24});const G=O.style??{},ie=aa(G),me=[],le={visibility:B.visible?"visible":"none"},Ze=la(O),He={source:H,layout:le};if(Ze&&(He["source-layer"]=Ze),(G.type??"polygon").toLowerCase()==="point"){const De=`${B.id}-circle`;p.getLayer(De)||p.addLayer({id:De,type:"circle",...He,paint:{"circle-color":ie,"circle-opacity":G.opacity??1,"circle-radius":G.radius??G.width??3,"circle-stroke-color":G.stroke??G.color??"#ffffff","circle-stroke-width":G.width??1}}),me.push(De);const Je=G.text??G.label;if(Je){const Ue=`${B.id}-symbol`,nt=rn(G.textSize)??10,Ot=G.textHaloColor??G.stroke??"#ffffff",vt=rn(G.textHaloWidth)??1,bt=rn(G.textZoom??G.pointZoom),Ye={"text-color":G.textColor??"#000000","text-halo-color":Ot,"text-halo-width":vt},Xe={id:Ue,type:"symbol",...He,layout:{"text-field":["coalesce",["get",Je],""],"text-size":nt,"text-anchor":"top"},paint:Ye};bt!=null&&(Xe.minzoom=bt),p.getLayer(Ue)||p.addLayer(Xe),me.push(Ue)}}else{const De=`${B.id}-fill`;p.getLayer(De)||p.addLayer({id:De,type:"fill",...He,paint:{"fill-color":ie,"fill-opacity":G.opacity??.5,"fill-outline-color":G.stroke??G.color??"#0ea5e9"}}),me.push(De);const Je=`${B.id}-line`;p.getLayer(Je)||p.addLayer({id:Je,type:"line",...He,paint:{"line-color":G.stroke??G.color??"#0b74c4","line-width":rn(G.width??G.border)??1,"line-opacity":G.opacity??1}}),me.push(Je)}B.layerIds=me,g(p,B)},g=(p,B)=>{const O=B.visible?"visible":"none";B.layerIds.forEach(H=>{p.getLayer(H)&&p.setLayoutProperty(H,"visibility",O)})},N=p=>{const B=Array.isArray(p)?p:[];y(o.value??void 0),d.value=null,T();const O=B.map((H,J)=>{if(!H)return null;const G=jn(H.url);if(!G)return null;const ie=H.id!=null?String(H.id):`overlay-${J}`;return{id:ie,config:{...H,id:ie,url:G},visible:!1,sourceId:`${ie}-source`,layerIds:[]}}).filter(H=>!!H);i.value=O,x(),S()},M=(p,B)=>{const O=i.value.find(J=>J.id===p);if(!O)return;O.visible=B,x();const H=o.value;if(!(!H||typeof H.isStyleLoaded!="function"||!H.isStyleLoaded())){if(!O.layerIds.length){E(H,O);return}g(H,O)}},A=()=>{a.value&&(a.value.remove(),a.value=null)},v=(p,B={})=>!Array.isArray(p.popup)||!p.popup.length?[]:p.popup.map(O=>({label:O.label??O.field,value:zn(B?.[O.field])})).filter(O=>O.label&&O.value!==void 0),L=p=>{const B=o.value;if(!B||!p?.point)return;const O=B.queryRenderedFeatures(p.point);for(const H of O){const J=H.layer?.id??H.sourceLayer;if(!J)continue;const G=Ge(J);if(!G)continue;const ie=v(G,H.properties??H.layer?.properties??{});if(!ie.length)continue;const me=sa(ie),le=qo();if(!le)return;const Ze=p.lngLat;if(c.value===J&&a.value){a.value.setLngLat(Ze),a.value.setHTML(me);return}c.value=J,A(),a.value=new le.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(Ze).setHTML(me).addTo(B);return}c.value=null,A()},R=()=>{c.value=null,A()},z=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||p.getSource(Rt)||(p.addSource(Rt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),p.addLayer({id:ca,type:"fill",source:Rt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),p.addLayer({id:da,type:"line",source:Rt,paint:{"line-color":"#1d4ed8","line-width":2}}))},Z=p=>{const B=o.value;if(!B||typeof B.isStyleLoaded!="function"||!B.isStyleLoaded())return;z();const O=B.getSource(Rt);if(!(!O||typeof O.setData!="function")){if(!p){O.setData({type:"FeatureCollection",features:[]});return}O.setData({type:"FeatureCollection",features:[p]})}},W=p=>{const B=fa(p);B&&Z(B)},T=()=>{Z(null)},D=()=>{d.value=null,T()},w=p=>{if(p)return typeof p=="string"?p:p.field??p.name??p.key??p.label},j=p=>{if(p)return typeof p=="string"?p:p.label??p.title??p.field??p.name},se=(p,B)=>!p||!p.length?[]:p.map(O=>{const H=w(O);if(!H)return null;const J=j(O),G=zn(B?.[H]);return!J||G===""?null:{label:J,value:G}}).filter(O=>!!O),$e=(p,B)=>!Array.isArray(p)||!p.length?[]:p.map(O=>{if(!O?.name)return null;const H=O.title??O.name,J=zn(B?.[O.name]);return!H||J===""?null:{label:H,value:J}}).filter(O=>!!O),Ce=(p,B)=>!Array.isArray(p)||!p.length?[]:p.map(H=>{const J=Go(H.url,B),G=H.label??H.url;return J?{label:G,url:J,target:H.target}:null}).filter(H=>!!H),pe=async(p,B)=>{const O=Go(p,B);if(!O)return null;try{const H=await fetch(O);return H.ok?await H.json():null}catch{return null}},ue=async(p,B)=>{const O=B.properties??B.layer?.properties??{},H=se(p.card?.rows,O);let J,G;if(p.card?.api){const le=await pe(p.card.api,O);le&&(typeof le.html=="string"&&le.html.trim()&&(J=le.html),Array.isArray(le.columns)&&le.columns.length&&(G=le.columns))}let ie=H;if(!J&&G){const le=$e(G,O);le.length&&(ie=le)}if(!ie.length&&!J)return null;const me=Ce(p.card?.actions,O);return{title:O?.name??p.name,rows:ie,html:J,actions:me.length?me:void 0}},ze=async p=>{const B=o.value;if(!B||!p?.point)return;const O=B.queryRenderedFeatures(p.point);for(const H of O){const J=H.layer?.id??H.sourceLayer;if(!J)continue;const G=Ge(J);if(!G||!G.card)continue;const ie=await ue(G,H);if(ie){d.value=ie,W(H);return}}d.value=null,T()},Ke=()=>{const p=o.value;p&&(p.on("mousemove",L),p.on("mouseleave",R),p.on("click",ze))},je=()=>{const p=o.value;p&&(p.off("mousemove",L),p.off("mouseleave",R),p.off("click",ze),A(),T())},Ge=p=>{if(p)return i.value.find(B=>B.layerIds.includes(p))?.config},q=async()=>{const p=await pa(),B=ra(t.container);if(!p||!B)return;const O={container:B,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:u??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new p.Map(O);const H=()=>{S()};f=H,o.value.on("style.load",H),o.value.on("load",()=>{s.value=!0,u&&o.value&&(o.value.setStyle(u),u=null),S(),Ke()})};e.onMounted(q),e.onBeforeUnmount(()=>{je(),o.value&&f&&o.value.off("style.load",f),y(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const K={map:o,ready:s,setStyle:h,flyTo:p=>o.value?.flyTo(p),fitBounds:(p,B)=>o.value?.fitBounds(p,B),setCenter:p=>o.value?.setCenter(p),setZoom:p=>o.value?.setZoom(p),addControl:(p,B)=>o.value?.addControl(p,B),removeControl:p=>o.value?.removeControl(p),on:(p,...B)=>o.value?.on(p,...B),off:(p,...B)=>o.value?.off(p,...B),project:p=>o.value?.project(p),unproject:p=>o.value?.unproject(p),state:r,basemapOptions:l,setOverlays:N,toggleOverlay:M,getOverlayConfig:Ge,selectedCard:d,setBasemapOptions:k,clearCard:D};return e.provide(Wo,K),K}const ua={class:"map-base-layer-menu"},ma={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},ha={class:"flex items-center justify-between p-2 border-b"},ga={class:"p-2 border-b"},ya={class:"flex items-center"},va=["value","checked","onChange"],ba={class:"ml-2"},ka={class:"p-2"},Ea={class:"flex items-center"},wa=["checked"],xa=["checked","onChange"],Na={class:"ml-2"},Ca=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=ln(),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??""),u=e.computed(()=>n.value.geometryVisible??!0),f=e.computed(()=>n.value.overlays??[]),h=y=>{s?.(y)},x=()=>{r?.(!u.value)},k=y=>{l?.(y.id,!y.visible)};return(y,S)=>(e.openBlock(),e.createElementBlock("div",ua,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:S[0]||(S[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",ma,[e.createElementVNode("div",ha,[S[3]||(S[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:S[1]||(S[1]=E=>i.value=!1)},[...S[2]||(S[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",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.key},[e.createElementVNode("label",ya,[e.createElementVNode("input",{type:"radio",name:a,value:E.key,checked:d.value===E.key,onChange:F=>h(E.key)},null,40,va),e.createElementVNode("span",ba,e.toDisplayString(E.name||E.key),1)])]))),128))]),e.createElementVNode("div",ka,[e.createElementVNode("label",Ea,[e.createElementVNode("input",{type:"checkbox",checked:u.value,onChange:x},null,40,wa),S[4]||(S[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:F=>k(E)},null,40,xa),e.createElementVNode("span",Na,e.toDisplayString(E.name||E.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),Sa={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]"},_a={class:"leading-tight"},Ba=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",Sa,[(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",_a,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Ta={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]"},$a={class:"font-mono"},La=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ta,[e.createElementVNode("span",$a,e.toDisplayString(t.coordinates),1)]))}}),Ia={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Aa=["title"],Da={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"},Oa=["onClick"],Ma=["placeholder"],Ra={class:"divide-y divide-gray-100"},Pa=["onClick"],Fa=600,za="0000000000:00:000:0000",ja=30,Ha=8,Ua="https://data.softpro.ua/api-user/gis-url-proxy",qa="https://geo.rv.ua/api-user/dzk.api",Wa="https://nominatim.openstreetmap.org/search",Ka=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=ln(),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 q=n.config?.tools?.filter(K=>i.includes(K));return q&&q.length?q:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,q=>{q.includes(d.value)||(d.value=q[0])});const u=e.ref(""),f=e.ref(!1),h=e.ref(null),x=e.ref(null),k=e.ref(null),y=e.ref([]),S=e.ref(null),E=e.computed(()=>d.value==="address"&&y.value.length>0);let F=null,I=null,g=null;const N=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function M(){if(!x.value)return;const q=x.value.getBoundingClientRect(),K=q.width+ja,p=q.left+window.scrollX,B=q.bottom+window.scrollY+Ha;N.left=`${p}px`,N.top=`${B}px`,N.width=`${K}px`,N.display="block"}const A=()=>{E.value&&M()};function v(){F&&(clearTimeout(F),F=null)}function L(){I?.destroy(),I=null}async function R(){if(d.value!=="parcel")return;const q=k.value;if(!q)return;const K=await na();d.value==="parcel"&&(L(),I=K(q,{mask:za,lazy:!1,placeholderChar:"_"}),I.on("accept",()=>{u.value=I?.value??""}))}function z(){return(I?.value??u.value).trim()}function Z(){if(!(typeof window>"u"))return window.maplibregl}function W(q){const K=o.map.value;if(!K)return;const p=Z();if(p){if(g){g.setLngLat([q.lat,q.lng]);return}g=new p.Marker({color:"#2563eb"}).setLngLat([q.lat,q.lng]).addTo(K)}}function T(){g&&(g.remove(),g=null)}e.watch(d,q=>{u.value="",f.value=!1,y.value=[],v(),q==="parcel"?e.nextTick(()=>{R().catch(K=>{we.notify({type:"error",title:"Маска кадастру",message:K?.message||"Не вдалося ініціалізувати маску"})})}):L()}),e.watch(E,q=>{q?e.nextTick(()=>{M()}):N.display="none"}),e.watch(u,q=>{if(d.value!=="address"){y.value=[],v();return}if(!q.trim()){y.value=[],v();return}v(),F=window.setTimeout(()=>{ue(q).catch(K=>{const p=K?.message||"Помилка пошуку адреси";we.notify({type:"error",title:"Пошук адреси",message:p})})},Fa)});function D(q){d.value=q}function w(q){const K=q.target;if(f.value){const p=h.value;p&&!p.contains(K)&&(f.value=!1)}if(E.value){const p=S.value;p&&!p.contains(K)&&(y.value=[])}}e.onMounted(()=>{window.addEventListener("click",w,!0),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),d.value==="parcel"&&e.nextTick(()=>{R().catch(q=>{we.notify({type:"error",title:"Маска кадастру",message:q?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",w,!0),window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A),v(),L(),T()});function j(q){return q==="xy"?"Координати":q==="parcel"?"Кадастр":"Адреси"}function se(q){const K=q.replace(/[,]+/g," ").trim();if(!K)return null;const p=K.split(/\s+/).filter(Boolean);if(p.length<2)return null;console.log(p);const B=p.slice(0,2).map(Number);if(console.log(B),!B.every(le=>Number.isFinite(le)))return null;let[O,H]=B,J=O,G=H;const ie=le=>Math.abs(le)<=90,me=le=>Math.abs(le)<=180;if(!ie(J)||!me(G))if(ie(G)&&me(J))J=O,G=H;else return null;return console.log(J,G),{lat:J,lng:G}}function $e(q){return(q?.items||[]).map((p,B)=>{const O=Number(p?.position?.lat),H=Number(p?.position?.lng);return!Number.isFinite(O)||!Number.isFinite(H)?null:{id:String(p?.id??B),title:p?.title||p?.address?.label||"Знайдений обʼєкт",lat:O,lng:H}}).filter(p=>!!p)}function Ce(q){const K=q?.result||q?.data||q;if(!K)return[];const p=K.geom_centroid;if(!p||!Array.isArray(p.coordinates))return[];const[B,O]=p.coordinates;return!Number.isFinite(B)||!Number.isFinite(O)?[]:[{id:"parcel",title:K.cadnum||K.cad_num||"Земельна ділянка",lat:B,lng:O}]}function pe(q){return(Array.isArray(q?.features)?q.features:[]).map((p,B)=>{const O=p?.geometry?.coordinates,H=Number(O?.[0]),J=Number(O?.[1]);if(!Number.isFinite(H)||!Number.isFinite(J))return null;const G=p?.properties||{},ie=G?.geocoding?.label||G?.display_name||G?.label||"Адреса";return{id:String(G?.geocoding?.place_id||G?.place_id||B),title:ie,lat:H,lng:J}}).filter(p=>!!p)}async function ue(q){y.value=[],v();const K=new URL(Wa);K.searchParams.set("format","geojson"),K.searchParams.set("q",q),K.searchParams.set("addressdetails","1"),K.searchParams.set("bounded","1");const p=r();p&&K.searchParams.set("viewbox",p);const B=await fetch(K.toString());if(!B.ok)throw new Error(`HTTP ${B.status}`);const O=await B.json(),H=pe(O);if(!H.length){we.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}y.value=H}function ze(q){je(q),y.value=[],u.value=""}function Ke(q){const p=q.replace(/\s+/g,"").split(":");if(p.length!==4)return!1;const B=[10,2,3,4];return p.every((O,H)=>O.length===B[H]&&/^\d+$/.test(O))}function je(q){const K=n.config?.zoom??17;o.flyTo?.({center:[q.lat,q.lng],zoom:K}),W(q)}async function Ge(){const q=d.value==="parcel"?z():u.value.trim();if(q){if(d.value==="xy"){const K=se(q);if(console.log(K),!K){we.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}je(K),u.value="";return}if(d.value==="address"){try{await ue(q)}catch(K){const p=K?.message||"Помилка пошуку адреси";we.notify({type:"error",title:"Пошук адреси",message:p})}return}try{const K=new URL(d.value==="here"?Ua:qa);if(d.value==="here")K.searchParams.set("searchtext",q);else{if(!Ke(q)){we.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}K.searchParams.set("cad_num",q)}const p=await fetch(K.toString());if(!p.ok)throw new Error(`HTTP ${p.status}`);const B=await p.json(),O=d.value==="here"?$e(B):Ce(B);if(!O.length)we.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const H=O[0];je(H),d.value==="parcel"&&I&&(I.value=""),u.value=""}}catch(K){const p=K?.message||"Помилка пошуку";we.notify({type:"error",title:"Пошук",message:p})}}}return(q,K)=>(e.openBlock(),e.createElementBlock("div",Ia,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(Ge,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:h,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:K[0]||(K[0]=p=>f.value=!f.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:j(d.value)},e.toDisplayString(j(d.value)),9,Aa),(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"},[...K[3]||(K[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",Da,[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:B=>D(p)},e.toDisplayString(j(p)),9,Oa))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:x,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":K[1]||(K[1]=p=>u.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,u.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":K[2]||(K[2]=p=>u.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,Ma)),[[e.vModelText,u.value,void 0,{trim:!0}]]),K[4]||(K[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:S,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(N)},[e.createElementVNode("ul",Ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:B=>ze(p)},e.toDisplayString(p.title),9,Pa))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),Ga={class:"map-center-control"},Za=["aria-label"],Ja=e.defineComponent({directives:{tooltip:we.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=ln(),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[y,S]=k.slice(0,2).map(E=>Number(E));return Number.isNaN(y)||Number.isNaN(S)?null:[y,S]}if(k&&typeof k=="object"){const y=k,S=y.lng??y.lon??y.long??y.x,E=y.lat??y.y;if(S!=null&&E!=null){const F=Number(S),I=Number(E);if(!Number.isNaN(F)&&!Number.isNaN(I))return[F,I]}}if(typeof k=="string"){const y=k.split(",").map(S=>Number(S.trim()));if(y.length>=2&&y.every(S=>!Number.isNaN(S)))return[y[0],y[1]]}return null}e.watch(()=>n.center,k=>{const y=c(k);y&&(r.value=y)},{immediate:!0}),e.watch(()=>n.zoom,k=>{const y=Number(k);Number.isNaN(y)||(l.value=y)},{immediate:!0}),e.watch(()=>n.targetCenter,k=>{i.value=c(k)},{immediate:!0}),e.watch(()=>n.targetZoom,k=>{const y=Number(k);a.value=Number.isNaN(y)?null:y},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),u=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),f=e.computed(()=>!!i.value);e.onMounted(async()=>{const k=o.value;if(k){if(!r.value){const y=k.getCenter();r.value=[y.lng,y.lat]}l.value==null&&(l.value=k.getZoom())}});function h(){const k=o.value;if(!k)return;const y=r.value||(()=>{const E=k.getCenter();return[E.lng,E.lat]})(),S=l.value??k.getZoom();k.flyTo({center:y,zoom:S})}function x(){const k=o.value;if(!k||!i.value)return;const y=a.value??l.value??k.getZoom();k.flyTo({center:i.value,zoom:y})}return(k,y)=>{const S=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",Ga,[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(h,["stop"])},[e.createVNode(e.unref($r),{class:"w-4 h-4"})])),[[S,"Центр мапи"]]),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":u.value,onClick:e.withModifiers(x,["stop"])},[e.createVNode(e.unref(Ir),{class:"w-4 h-4"})],8,Za)),[[S,d.value]]):e.createCommentVNode("",!0)])}}}),Zo=ot(Ja,[["__scopeId","data-v-bc627616"]]),Ya={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},Xa={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},Qa=["aria-label"],Va={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)]"},ec={class:"text-slate-900 font-semibold mb-1"},tc=["innerHTML"],nc={key:1,class:"space-y-2"},oc={class:"text-gray-500"},sc={class:"font-medium text-slate-900"},rc={key:2,class:"mt-2 flex flex-col gap-2"},ic=["href","target"],an="map-basemap-source",Hn="map-basemap-layer",lc=20,Nt="map-katottg-geometry-source",cn="map-katottg-geometry-line",st="map-geometry-source",Ct="map-geometry-fill",St="map-geometry-line",_t="map-geometry-circle",dn=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??{},i=e.computed(()=>n.katottg!=null?n.katottg:l.katottg),a=e.computed(()=>(Array.isArray(l.basemaps)&&l.basemaps.length?l.basemaps:o).map((U,V)=>{const Me=typeof U.url=="string"?U.url.trim():"";return Me?{key:(U.key??U.name??`base-${V}`).trim()||`base-${V}`,url:Me,name:U.name??U.key??`Layer ${V+1}`}:null}).filter(U=>!!U)),c=Array.isArray(l.center)&&l.center.length>=2?[Number(l.center[0]),Number(l.center[1])]:void 0,d=typeof l.zoom=="number"?l.zoom:void 0,u=e.ref(null),f=ln({container:u,center:n.center??c,zoom:n.zoom??d}),{map:h,setCenter:x,setZoom:k,state:y,getOverlayConfig:S,selectedCard:E,setBasemapOptions:F,clearCard:I,addControl:g,removeControl:N,ready:M}=f,A=e.computed({get:()=>y.value.selectedBasemap??"",set:m=>{y.value.selectedBasemap=m}}),v=e.computed({get:()=>y.value.geometryVisible??!0,set:m=>{y.value.geometryVisible=m}}),L=e.computed(()=>{const m=n.height;return{height:typeof m=="number"?`${m}px`:String(m)}}),R=e.ref(!1),z=e.computed(()=>R.value?"fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),Z=e.computed(()=>{const m=["w-full","h-full"];return R.value||m.push(`min-h-[${L.value.height}]`),m.join(" ")}),W=e.computed(()=>E.value),T=()=>I?.(),D=e.ref(n.center??c??null),w=e.ref(n.zoom??d??null),j=e.computed(()=>n.center??D.value??null),se=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof w.value=="number"?w.value:lc),$e=["home","fullscreen","scale","position","search"],Ce=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?$e:n.tools.filter(m=>$e.includes(m))),pe=m=>Ce.value.includes(m);e.watch([h,M],([m,P])=>{if(!(!m||!P)){if(!D.value){const U=m.getCenter();D.value=[U.lng,U.lat]}w.value==null&&(w.value=m.getZoom())}},{immediate:!0});const ue=e.ref(null),ze=e.ref(""),Ke=e.ref(null),je=m=>{if(!m)return"";const P=Number(m.lat??m[1]),U=Number(m.lng??m[0]);return!Number.isFinite(P)||!Number.isFinite(U)?"":`${U.toFixed(5)}, ${P.toFixed(5)}`},Ge=m=>{m?.lngLat&&(ze.value=je(m.lngLat))},q=()=>{ze.value=""},K=m=>{m&&(m.on("mousemove",Ge),m.on("mouseleave",q),Ke.value=m)},p=m=>{m&&(m.off("mousemove",Ge),m.off("mouseleave",q),Ke.value=null)},B=e.computed(()=>pe("scale"));e.watch([h,M],([m,P],[U])=>{U&&p(U),!(!m||!P)&&K(m)},{immediate:!0}),e.watch([h,M,B],([m,P,U])=>{if(ue.value&&N&&(N(ue.value),ue.value=null),!m||!P||!U)return;const V=window?.maplibregl;V&&(ue.value=new V.ScaleControl({unit:"metric"}),g?.(ue.value,"bottom-left"))},{immediate:!0});const O=e.computed(()=>Array.isArray(n.legend)?n.legend.map((m,P)=>{const U=typeof m?.color=="string"?m.color.trim():"",V=typeof m?.label=="string"?m.label.trim():"";return!U||!V?null:{color:U,label:V,key:`${V}-${P}`}}).filter(m=>!!m):[]),H=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(l.layers)&&l.layers.length?l.layers:[]);e.watch(a,m=>{if(F?.(m),!m.length){A.value="";return}m.some(P=>P.key===A.value)||(A.value=m[0].key)},{immediate:!0});const J=()=>typeof window>"u"?"":window.location?.origin??"",G=m=>{if(!m)return"";const P=m.trim();if(!P)return"";const V=P.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!V)return"";if(/^https?:\/\//i.test(V))return V;const Me=J(),Et=V.replace(/^\/+/,"");return Me?`${Me}/${Et}`:Et?`/${Et}`:""},ie=m=>{if(!m?.getStyle)return;const P=m.getStyle()??{},U=Array.isArray(P.layers)?P.layers:[];return U.length?U.find(Me=>Me.type!=="background")?.id??U[0]?.id:void 0},me=m=>{m&&(m.getLayer(Hn)&&m.removeLayer(Hn),m.getSource(an)&&m.removeSource(an))},le=(m,P)=>{if(!m)return;const U=ie(m);m.addSource(an,{type:"raster",tiles:[P],tileSize:256}),m.addLayer({id:Hn,type:"raster",source:an,layout:{visibility:"visible"}},U)},Ze=m=>{if(!m)return;const P=G(m.url);if(!P){He.value=null;return}He.value=P,me(h.value),De()},He=e.ref(null),An=m=>{if(!m||m.__pendingBasemapHooked)return;m.__pendingBasemapHooked=!0;const P=()=>{m.__pendingBasemapHooked=!1,De()};m.once("style.load",P),m.once("styledata",P)},De=()=>{const m=h.value,P=He.value;if(!P||!m)return;if(!(typeof m.isStyleLoaded=="function"?m.isStyleLoaded():!0)){An(m);return}me(m),le(m,P)},Je=()=>{const m=A.value;if(!m)return;const P=a.value.find(U=>U.key===m);P&&Ze(P)};e.watch(A,()=>{Je()},{immediate:!0}),e.watch(H,m=>{f.setOverlays?.(m)},{immediate:!0,deep:!0});const Ue=e.ref(null);let nt=0;const Ot=e.computed(()=>Ao(Ue.value)),vt={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}},bt={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},Ye=e.ref(Ao(n.geom)),Xe=e.ref(mr(Ye.value)),kt=e.ref(!1),b=e.computed(()=>{if(!Xe.value)return null;const[m,P,U,V]=Xe.value;return[(m+U)/2,(P+V)/2]});e.ref(!1);const $=()=>{R.value=!R.value},C=e.ref(!1),_=()=>{const m=h.value;if(!m||!m.isStyleLoaded())return;const P=Ye.value;if(!P){Y(m);return}let U=m.getSource(st);U?U.setData(P):(m.addSource(st,{type:"geojson",data:P}),Q(m),U=m.getSource(st)),ne(m,v.value?"visible":"none"),Ee(),Oe(),Xe.value&&(kt.value||!C.value)&&(m.fitBounds(Xe.value,{padding:40,maxZoom:16,duration:0}),C.value=!0,kt.value=!1)},Q=m=>{const P=vt;m.getLayer(Ct)||m.addLayer({id:Ct,type:"fill",source:st,paint:P.fill}),m.getLayer(St)||m.addLayer({id:St,type:"line",source:st,paint:P.line}),m.getLayer(_t)||m.addLayer({id:_t,type:"circle",source:st,paint:P.circle,filter:["==","$type","Point"]})},Y=m=>{[_t,St,Ct].forEach(P=>{m.getLayer(P)&&m.removeLayer(P)}),m.getSource(st)&&m.removeSource(st)},ne=(m,P)=>{[_t,St,Ct].forEach(U=>{m.getLayer(U)&&m.setLayoutProperty(U,"visibility",P)})},Ee=()=>{const m=h.value;if(!m||!m.isStyleLoaded())return;const P=vt;m.getLayer(Ct)&&Object.entries(P.fill).forEach(([U,V])=>{m.setPaintProperty(Ct,U,V)}),m.getLayer(St)&&Object.entries(P.line).forEach(([U,V])=>{m.setPaintProperty(St,U,V)}),m.getLayer(_t)&&Object.entries(P.circle).forEach(([U,V])=>{m.setPaintProperty(_t,U,V)})},qe=m=>{m.getLayer(cn)||m.addLayer({id:cn,type:"line",source:Nt,layout:{visibility:"visible"},paint:bt})},Oe=()=>{const m=h.value;if(!m)return;const P=Ot.value??{type:"FeatureCollection",features:[]};if(!m.getSource(Nt)){m.addSource(Nt,{type:"geojson",data:P}),qe(m);return}const U=m.getSource(Nt);U&&typeof U.setData=="function"&&U.setData(P),qe(m)},Mt=m=>{m.getLayer(cn)&&m.removeLayer(cn),m.getSource(Nt)&&m.removeSource(Nt)},ve=async m=>{const P=typeof m=="string"?m.trim():"",U=++nt;if(!P){Ue.value=null;return}try{const V=await fetch(`https://data.gki.com.ua/api-user/atu/${P}`);if(nt!==U)return;if(!V.ok){Ue.value=null;return}const Me=await V.json();if(nt!==U)return;Ue.value=Me}catch{if(nt!==U)return;Ue.value=null}};e.watch(i,m=>{ve(m)},{immediate:!0}),e.watch(Ot,()=>{Oe()},{immediate:!0}),e.watch(()=>n.geom,m=>{Ye.value=Ao(m),Xe.value=mr(Ye.value),C.value=!1,kt.value=!0,_()},{deep:!0,immediate:!0}),e.watch(v,()=>{const m=h.value;m&&m.isStyleLoaded()&&ne(m,v.value?"visible":"none")});const Qe=()=>{_(),De()},Qt=()=>{_()};e.watch(h,(m,P)=>{P&&(P.off("style.load",Qe),P.off("load",Qe),P.off("idle",Qt)),m&&(m.on("load",Qe),m.on("style.load",Qe),m.on("idle",Qt),Qe())}),e.watch(()=>n.center,m=>{!h.value||!Array.isArray(m)||m.length<2||x([m[0],m[1]])},{deep:!0}),e.watch(()=>n.zoom,m=>{!h.value||typeof m!="number"||k(m)}),e.onBeforeUnmount(()=>{ue.value&&N&&N(ue.value),Ke.value?p(Ke.value):h.value&&p(h.value);const m=h.value;m&&(Mt(m),m.off("style.load",Qe),m.off("load",Qe),m.off("idle",Qt))});function iu(m){m&&(A.value=m)}function lu(m){v.value=m}f.setBasemap=iu,f.toggleGeometry=lu,f.setOverlays?.(H.value);function Ao(m){if(!m)return null;if(m.type==="FeatureCollection")return m;if(m.type==="Feature")return{type:"FeatureCollection",features:[m]};const P=m.geometry??m;if(!P?.type)return null;if(P.type==="GeometryCollection"&&Array.isArray(P.geometries)){const U=P.geometries.filter(V=>V&&typeof V.type=="string").map(V=>({type:"Feature",geometry:V}));return U.length?{type:"FeatureCollection",features:U}:null}if(P.type==="MultiPoint"&&Array.isArray(P.coordinates)){const U=P.coordinates.filter(V=>Array.isArray(V)&&V.length>=2).map(V=>({type:"Feature",geometry:{type:"Point",coordinates:V}}));return U.length?{type:"FeatureCollection",features:U}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:P}]}}function mr(m){if(!m?.features?.length)return null;let P=1/0,U=1/0,V=-1/0,Me=-1/0;const Et=Vt=>{if(typeof Vt[0]=="number"){const[wt,hr]=Vt;P=Math.min(P,wt),U=Math.min(U,hr),V=Math.max(V,wt),Me=Math.max(Me,hr);return}Vt.forEach(wt=>Et(wt))};return m.features.forEach(Vt=>{const wt=Vt?.geometry?.coordinates;wt&&Et(wt)}),P===1/0||U===1/0?null:[P,U,V,Me]}return(m,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(z.value),style:e.normalizeStyle(R.value?void 0:L.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:u,class:e.normalizeClass(Z.value)},null,2),e.createVNode(Ba,{items:O.value},null,8,["items"]),pe("search")?(e.openBlock(),e.createBlock(Ka,{key:0})):e.createCommentVNode("",!0),pe("home")||pe("fullscreen")?(e.openBlock(),e.createElementBlock("div",Ya,[pe("home")?(e.openBlock(),e.createElementBlock("div",Xa,[e.createVNode(Zo,{center:j.value,zoom:se.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(Zo,{key:0,"target-center":b.value,"target-zoom":n.zoom,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),pe("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:$,"aria-label":R.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...P[0]||(P[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,Qa)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),W.value?(e.openBlock(),e.createElementBlock("div",Va,[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:T},[...P[1]||(P[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",ec,e.toDisplayString(W.value.title||"Об'єкт"),1),W.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(${L.value.height}-120px)]`]),innerHTML:W.value.html},null,10,tc)):(e.openBlock(),e.createElementBlock("div",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value.rows,U=>(e.openBlock(),e.createElementBlock("div",{key:U.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",oc,e.toDisplayString(U.label)+":",1),e.createElementVNode("span",sc,e.toDisplayString(U.value),1)]))),128))])),W.value.actions?.length?(e.openBlock(),e.createElementBlock("div",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.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,ic))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Ca),pe("position")&&ze.value?(e.openBlock(),e.createBlock(La,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:ze.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});function We(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const ac=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Un=()=>{},fn=()=>!1,qn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),rt=Object.assign,Ve=Array.isArray,ye=t=>typeof t=="string",Wn=t=>typeof t=="symbol",cc=t=>t!==null&&typeof t=="object",Jo=We(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),dc=We("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Kn=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},fc=/-\w/g,it=Kn(t=>t.replace(fc,n=>n.slice(1).toUpperCase())),Gn=Kn(t=>t.charAt(0).toUpperCase()+t.slice(1)),pc=Kn(t=>t?`on${Gn(t)}`:""),Pt={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"},uc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},mc=/;(?![^(]*\))/g,hc=/:([^]+)/,gc=/\/\*[^]*?\*\//g;function yc(t){const n={};return t.replace(gc,"").split(mc).forEach(o=>{if(o){const s=o.split(hc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const vc="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",kc="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",Ec="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",wc=We(vc),xc=We(bc),Nc=We(kc),Cc=We(Ec);const Ft=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),zt=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Zn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),pn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),Yo=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),ft=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),Xo=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),Qo=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Jn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Yn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),jt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),Vo=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),eo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),to=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),no=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),oo=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),es=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),ts=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),un=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),mn=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),so=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),ro=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Ht=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Ut=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),io=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),lo=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Sc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),ao=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),hn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),_c=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Bc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),co=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Tc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),$c=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),fo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),ns=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Bt={[Ft]:"Fragment",[zt]:"Teleport",[Zn]:"Suspense",[pn]:"KeepAlive",[Yo]:"BaseTransition",[ft]:"openBlock",[Xo]:"createBlock",[Qo]:"createElementBlock",[Jn]:"createVNode",[Yn]:"createElementVNode",[jt]:"createCommentVNode",[Xn]:"createTextVNode",[Vo]:"createStaticVNode",[Qn]:"resolveComponent",[Vn]:"resolveDynamicComponent",[eo]:"resolveDirective",[to]:"resolveFilter",[no]:"withDirectives",[oo]:"renderList",[es]:"renderSlot",[ts]:"createSlots",[un]:"toDisplayString",[mn]:"mergeProps",[so]:"normalizeClass",[ro]:"normalizeStyle",[Ht]:"normalizeProps",[Ut]:"guardReactiveProps",[io]:"toHandlers",[lo]:"camelize",[Sc]:"capitalize",[ao]:"toHandlerKey",[hn]:"setBlockTracking",[_c]:"pushScopeId",[Bc]:"popScopeId",[co]:"withCtx",[Tc]:"unref",[$c]:"isRef",[fo]:"withMemo",[ns]:"isMemoSame"};function Lc(t){Object.getOwnPropertySymbols(t).forEach(n=>{Bt[n]=t[n]})}const Le={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function Ic(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Le}}function qt(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,u=Le){return t&&(a?(t.helper(ft),t.helper(Lt(t.inSSR,d))):t.helper($t(t.inSSR,d)),i&&t.helper(no)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:u}}function pt(t,n=Le){return{type:17,loc:n,elements:t}}function Re(t,n=Le){return{type:15,loc:n,properties:t}}function fe(t,n){return{type:16,loc:Le,key:ye(t)?X(t,!0):t,value:n}}function X(t,n=!1,o=Le,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function Pe(t,n=Le){return{type:8,loc:n,children:t}}function ge(t,n=[],o=Le){return{type:14,loc:o,callee:t,arguments:n}}function Tt(t,n=void 0,o=!1,s=!1,r=Le){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function po(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Le}}function Ac(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Le}}function Dc(t){return{type:21,body:t,loc:Le}}function $t(t,n){return t||n?Jn:Yn}function Lt(t,n){return t||n?Xo:Qo}function uo(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o($t(s,t.isComponent)),n(ft),n(Lt(s,t.isComponent)))}const os=new Uint8Array([123,123]),ss=new Uint8Array([125,125]);function rs(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 lt(t){return t===47||t===62||Ie(t)}function gn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const be={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 Oc{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=os,this.delimiterClose=ss,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=os,this.delimiterClose=ss}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?lt(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===be.TitleEnd||this.currentSequence===be.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===be.Cdata[this.sequenceIndex]?++this.sequenceIndex===be.Cdata.length&&(this.state=28,this.currentSequence=be.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===be.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):rs(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){lt(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(lt(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(gn("</"+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=rs(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||lt(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||lt(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||lt(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||lt(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||lt(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=be.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===be.ScriptEnd[3]?this.startSpecial(be.ScriptEnd,4):n===be.StyleEnd[3]?this.startSpecial(be.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===be.TitleEnd[3]?this.startSpecial(be.TitleEnd,4):n===be.TextareaEnd[3]?this.startSpecial(be.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===be.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 Mc={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 mo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function at(t,n){const o=mo("MODE",n),s=mo(t,n);return o===3?s===!0:s!==!1}function It(t,n,o,...s){const r=at(t,n);return process.env.NODE_ENV!=="production"&&r&&yn(t,n,o,...s),r}function yn(t,n,o,...s){if(mo(t,n)==="suppress-warning")return;const{message:l,link:i}=Mc[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
2
- Details: ${i}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function ho(t){throw t}function is(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||Rc)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,l=new SyntaxError(String(r));return l.code=t,l.loc=n,l}const Rc={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
- 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:""},Se=t=>t.type===4&&t.isStatic;function ls(t){switch(t){case"Teleport":case"teleport":return zt;case"Suspense":case"suspense":return Zn;case"KeepAlive":case"keep-alive":return pn;case"BaseTransition":case"base-transition":return Yo}}const Pc=/^$|^\d|[^\$\w\xA0-\uFFFF]/,go=t=>!Pc.test(t),as=/[A-Za-z_$\xA0-\uFFFF]/,Fc=/[\.\?\w$\xA0-\uFFFF]/,zc=/\s+[.[]\s*|\s*[.[]\s+/g,cs=t=>t.type===4?t.content:t.loc.source,ds=t=>{const n=cs(t).trim().replace(zc,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?as:Fc).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},jc=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,Hc=t=>jc.test(cs(t));function fs(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function _e(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)&&(ye(n)?r.name===n:n.test(r.name)))return r}}function Wt(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)&&ct(l.arg,n))return l}}function ct(t,n){return!!(t&&Se(t)&&t.content===n)}function Uc(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function yo(t){return t.type===5||t.type===2}function ps(t){return t.type===7&&t.name==="pre"}function qc(t){return t.type===7&&t.name==="slot"}function vn(t){return t.type===1&&t.tagType===3}function bn(t){return t.type===1&&t.tagType===2}const Wc=new Set([Ht,Ut]);function us(t,n=[]){if(t&&!ye(t)&&t.type===14){const o=t.callee;if(!ye(o)&&Wc.has(o))return us(t.arguments[0],n.concat(t))}return[t,n]}function kn(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],l=[],i;if(r&&!ye(r)&&r.type===14){const a=us(r);r=a[0],l=a[1],i=l[l.length-1]}if(r==null||ye(r))s=Re([n]);else if(r.type===14){const a=r.arguments[0];!ye(a)&&a.type===15?ms(n,a)||a.properties.unshift(n):r.callee===io?s=ge(o.helper(mn),[Re([n]),r]):r.arguments.unshift(Re([n])),!s&&(s=r)}else r.type===15?(ms(n,r)||r.properties.unshift(n),s=r):(s=ge(o.helper(mn),[Re([n]),r]),i&&i.callee===Ut&&(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 ms(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 Kt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function Kc(t){return t.type===14&&t.callee===fo?t.arguments[1].returns:t}const Gc=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function hs(t){for(let n=0;n<t.length;n++)if(!Ie(t.charCodeAt(n)))return!1;return!0}function vo(t){return t.type===2&&hs(t.content)||t.type===12&&vo(t.content)}function bo(t){return t.type===3||vo(t)}const gs={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:fn,isPreTag:fn,isIgnoreNewlineTag:fn,isCustomElement:fn,onError:ho,onWarn:is,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let te=gs,Gt=null,et="",xe=null,ee=null,Be="",tt=-1,ut=-1,ko=0,dt=!1,Eo=null;const ce=[],re=new Oc(ce,{onerr:Te,ontext(t,n){En(ke(t,n),t,n)},ontextentity(t,n,o){En(t,n,o)},oninterpolation(t,n){if(dt)return En(ke(t,n),t,n);let o=t+re.delimiterOpen.length,s=n-re.delimiterClose.length;for(;Ie(et.charCodeAt(o));)o++;for(;Ie(et.charCodeAt(s-1));)s--;let r=ke(o,s);r.includes("&")&&(r=te.decodeEntities(r,!1)),wo({type:5,content:xn(r,!1,de(o,s)),loc:de(t,n)})},onopentagname(t,n){const o=ke(t,n);xe={type:1,tag:o,ns:te.getNamespace(o,ce[0],te.ns),tagType:0,props:[],children:[],loc:de(t-1,n),codegenNode:void 0}},onopentagend(t){vs(t)},onclosetag(t,n){const o=ke(t,n);if(!te.isVoidTag(o)){let s=!1;for(let r=0;r<ce.length;r++)if(ce[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&Te(24,ce[0].loc.start.offset);for(let i=0;i<=r;i++){const a=ce.shift();wn(a,n,i<r)}break}s||Te(23,bs(t,60))}},onselfclosingtag(t){const n=xe.tag;xe.isSelfClosing=!0,vs(t),ce[0]&&ce[0].tag===n&&wn(ce.shift(),t)},onattribname(t,n){ee={type:6,name:ke(t,n),nameLoc:de(t,n),value:void 0,loc:de(t)}},ondirname(t,n){const o=ke(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!dt&&s===""&&Te(26,t),dt||s==="")ee={type:6,name:o,nameLoc:de(t,n),value:void 0,loc:de(t)};else if(ee={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[X("prop")]:[],loc:de(t)},s==="pre"){dt=re.inVPre=!0,Eo=xe;const r=xe.props;for(let l=0;l<r.length;l++)r[l].type===7&&(r[l]=od(r[l]))}},ondirarg(t,n){if(t===n)return;const o=ke(t,n);if(dt&&!ps(ee))ee.name+=o,mt(ee.nameLoc,n);else{const s=o[0]!=="[";ee.arg=xn(s?o:o.slice(1,-1),s,de(t,n),s?3:0)}},ondirmodifier(t,n){const o=ke(t,n);if(dt&&!ps(ee))ee.name+="."+o,mt(ee.nameLoc,n);else if(ee.name==="slot"){const s=ee.arg;s&&(s.content+="."+o,mt(s.loc,n))}else{const s=X(o,!0,de(t,n));ee.modifiers.push(s)}},onattribdata(t,n){Be+=ke(t,n),tt<0&&(tt=t),ut=n},onattribentity(t,n,o){Be+=t,tt<0&&(tt=n),ut=o},onattribnameend(t){const n=ee.loc.start.offset,o=ke(n,t);ee.type===7&&(ee.rawName=o),xe.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&Te(2,n)},onattribend(t,n){if(xe&&ee){if(mt(ee.loc,n),t!==0)if(Be.includes("&")&&(Be=te.decodeEntities(Be,!0)),ee.type===6)ee.name==="class"&&(Be=ws(Be).trim()),t===1&&!Be&&Te(13,n),ee.value={type:2,content:Be,loc:t===1?de(tt,ut):de(tt-1,ut+1)},re.inSFCRoot&&xe.tag==="template"&&ee.name==="lang"&&Be&&Be!=="html"&&re.enterRCDATA(gn("</template"),0);else{let o=0;ee.exp=xn(Be,!1,de(tt,ut),0,o),ee.name==="for"&&(ee.forParseResult=Jc(ee.exp));let s=-1;ee.name==="bind"&&(s=ee.modifiers.findIndex(r=>r.content==="sync"))>-1&&It("COMPILER_V_BIND_SYNC",te,ee.loc,ee.arg.loc.source)&&(ee.name="model",ee.modifiers.splice(s,1))}(ee.type!==7||ee.name!=="pre")&&xe.props.push(ee)}Be="",tt=ut=-1},oncomment(t,n){te.comments&&wo({type:3,content:ke(t,n),loc:de(t-4,n+3)})},onend(){const t=et.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===be.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<ce.length;n++)wn(ce[n],t-1),Te(24,ce[n].loc.start.offset)},oncdata(t,n){ce[0].ns!==0?En(ke(t,n),t,n):Te(1,t-9)},onprocessinginstruction(t){(ce[0]?ce[0].ns:te.ns)===0&&Te(21,t-1)}}),ys=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Zc=/^\(|\)$/g;function Jc(t){const n=t.loc,o=t.content,s=o.match(Gc);if(!s)return;const[,r,l]=s,i=(f,h,x=!1)=>{const k=n.start.offset+h,y=k+f.length;return xn(f,!1,de(k,y),0,x?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(Zc,"").trim();const d=r.indexOf(c),u=c.match(ys);if(u){c=c.replace(ys,"").trim();const f=u[1].trim();let h;if(f&&(h=o.indexOf(f,d+c.length),a.key=i(f,h,!0)),u[2]){const x=u[2].trim();x&&(a.index=i(x,o.indexOf(x,a.key?h+f.length:d+c.length),!0))}}return c&&(a.value=i(c,d,!0)),a}function ke(t,n){return et.slice(t,n)}function vs(t){re.inSFCRoot&&(xe.innerLoc=de(t+1,t+1)),wo(xe);const{tag:n,ns:o}=xe;o===0&&te.isPreTag(n)&&ko++,te.isVoidTag(n)?wn(xe,t):(ce.unshift(xe),(o===1||o===2)&&(re.inXML=!0)),xe=null}function En(t,n,o){{const l=ce[0]&&ce[0].tag;l!=="script"&&l!=="style"&&t.includes("&")&&(t=te.decodeEntities(t,!1))}const s=ce[0]||Gt,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:de(n,o)})}function wn(t,n,o=!1){o?mt(t.loc,bs(n,60)):mt(t.loc,Yc(n,62)+1),re.inSFCRoot&&(t.children.length?t.innerLoc.end=rt({},t.children[t.children.length-1].loc.end):t.innerLoc.end=rt({},t.innerLoc.start),t.innerLoc.source=ke(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:l}=t;if(dt||(s==="slot"?t.tagType=2:ks(t)?t.tagType=3:Qc(t)&&(t.tagType=1)),re.inRCDATA||(t.children=Es(l)),r===0&&te.isIgnoreNewlineTag(s)){const i=l[0];i&&i.type===2&&(i.content=i.content.replace(/^\r?\n/,""))}r===0&&te.isPreTag(s)&&ko--,Eo===t&&(dt=re.inVPre=!1,Eo=null),re.inXML&&(ce[0]?ce[0].ns:te.ns)===0&&(re.inXML=!1);{const i=t.props;if(process.env.NODE_ENV!=="production"&&at("COMPILER_V_IF_V_FOR_PRECEDENCE",te)){let c=!1,d=!1;for(let u=0;u<i.length;u++){const f=i[u];if(f.type===7&&(f.name==="if"?c=!0:f.name==="for"&&(d=!0)),c&&d){yn("COMPILER_V_IF_V_FOR_PRECEDENCE",te,t.loc);break}}}if(!re.inSFCRoot&&at("COMPILER_NATIVE_TEMPLATE",te)&&t.tag==="template"&&!ks(t)){process.env.NODE_ENV!=="production"&&yn("COMPILER_NATIVE_TEMPLATE",te,t.loc);const c=ce[0]||Gt,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",te,a.loc)&&t.children.length&&(a.value={type:2,content:ke(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:a.loc})}}function Yc(t,n){let o=t;for(;et.charCodeAt(o)!==n&&o<et.length-1;)o++;return o}function bs(t,n){let o=t;for(;et.charCodeAt(o)!==n&&o>=0;)o--;return o}const Xc=new Set(["if","else","else-if","for","slot"]);function ks({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&Xc.has(n[o].name))return!0}return!1}function Qc({tag:t,props:n}){if(te.isCustomElement(t))return!1;if(t==="component"||Vc(t.charCodeAt(0))||ls(t)||te.isBuiltInComponent&&te.isBuiltInComponent(t)||te.isNativeTag&&!te.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",te,s.loc))return!0}}else if(s.name==="bind"&&ct(s.arg,"is")&&It("COMPILER_IS_ON_ELEMENT",te,s.loc))return!0}return!1}function Vc(t){return t>64&&t<91}const ed=/\r\n/g;function Es(t){const n=te.whitespace!=="preserve";let o=!1;for(let s=0;s<t.length;s++){const r=t[s];if(r.type===2)if(ko)r.content=r.content.replace(ed,`
4
- `);else if(hs(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&&td(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=ws(r.content))}return o?t.filter(Boolean):t}function td(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function ws(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 wo(t){(ce[0]||Gt).children.push(t)}function de(t,n){return{start:re.getPos(t),end:n==null?n:re.getPos(n),source:n==null?n:ke(t,n)}}function nd(t){return de(t.start.offset,t.end.offset)}function mt(t,n){t.end=re.getPos(n),t.source=ke(t.start.offset,n)}function od(t){const n={type:6,name:t.rawName,nameLoc:de(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 xn(t,n=!1,o,s=0,r=0){return X(t,n,o,s)}function Te(t,n,o){te.onError(oe(t,de(n,n),void 0,o))}function sd(){re.reset(),xe=null,ee=null,Be="",tt=-1,ut=-1,ce.length=0}function rd(t,n){if(sd(),et=t,te=rt({},gs),n){let r;for(r in n)n[r]!=null&&(te[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!te.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");re.mode=te.parseMode==="html"?1:te.parseMode==="sfc"?2:0,re.inXML=te.ns===1||te.ns===2;const o=n&&n.delimiters;o&&(re.delimiterOpen=gn(o[0]),re.delimiterClose=gn(o[1]));const s=Gt=Ic([],t);return re.parse(et),s.loc=de(0,t.length),s.children=Es(s.children),Gt=null,s}function id(t,n){Nn(t,void 0,n,!!xs(t))}function xs(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!bn(n[0])?n[0]:null}function Nn(t,n,o,s=!1,r=!1){const{children:l}=t,i=[];for(let u=0;u<l.length;u++){const f=l[u];if(f.type===1&&f.tagType===0){const h=s?0:Ae(f,o);if(h>0){if(h>=2){f.codegenNode.patchFlag=-1,i.push(f);continue}}else{const x=f.codegenNode;if(x.type===13){const k=x.patchFlag;if((k===void 0||k===512||k===1)&&Cs(f,o)>=2){const y=Ss(f);y&&(x.props=o.hoist(y))}x.dynamicProps&&(x.dynamicProps=o.hoist(x.dynamicProps))}}}else if(f.type===12&&(s?0:Ae(f,o))>=2){f.codegenNode.type===14&&f.codegenNode.arguments.length>0&&f.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${Pt[-1]} */`:"")),i.push(f);continue}if(f.type===1){const h=f.tagType===1;h&&o.scopes.vSlot++,Nn(f,t,o,!1,r),h&&o.scopes.vSlot--}else if(f.type===11)Nn(f,t,o,f.children.length===1,!0);else if(f.type===9)for(let h=0;h<f.branches.length;h++)Nn(f.branches[h],t,o,f.branches[h].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&&Ve(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&&!Ve(t.codegenNode.children)&&t.codegenNode.children.type===15){const u=d(t.codegenNode,"default");u&&(u.returns=c(pt(u.returns)),a=!0)}else if(t.tagType===3&&n&&n.type===1&&n.tagType===1&&n.codegenNode&&n.codegenNode.type===13&&n.codegenNode.children&&!Ve(n.codegenNode.children)&&n.codegenNode.children.type===15){const u=_e(t,"slot",!0),f=u&&u.arg&&d(n.codegenNode,u.arg);f&&(f.returns=c(pt(f.returns)),a=!0)}}if(!a)for(const u of i)u.codegenNode=o.cache(u.codegenNode);function c(u){const f=o.cache(u);return f.needArraySpread=!0,f}function d(u,f){if(u.children&&!Ve(u.children)&&u.children.type===15){const h=u.children.properties.find(x=>x.key===f||x.key.content===f);return h&&h.value}}i.length&&o.transformHoist&&o.transformHoist(l,o,t)}function Ae(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=Cs(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=Ae(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 u=Ae(d.exp,n);if(u===0)return o.set(t,0),0;u<i&&(i=u)}}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(Lt(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper($t(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 Ae(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(ye(a)||Wn(a))continue;const c=Ae(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 ld=new Set([so,ro,Ht,Ut]);function Ns(t,n){if(t.type===14&&!ye(t.callee)&&ld.has(t.callee)){const o=t.arguments[0];if(o.type===4)return Ae(o,n);if(o.type===14)return Ns(o,n)}return 0}function Cs(t,n){let o=3;const s=Ss(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=Ae(i,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=Ae(a,n):a.type===14?d=Ns(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function Ss(t){const n=t.codegenNode;if(n.type===13)return n.props}function ad(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:l=!1,nodeTransforms:i=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=Un,isCustomElement:u=Un,expressionPlugins:f=[],scopeId:h=null,slotted:x=!0,ssr:k=!1,inSSR:y=!1,ssrCssVars:S="",bindingMetadata:E=ac,inline:F=!1,isTS:I=!1,onError:g=ho,onWarn:N=is,compatConfig:M}){const A=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),v={filename:n,selfName:A&&Gn(it(A[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:l,nodeTransforms:i,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:u,expressionPlugins:f,scopeId:h,slotted:x,ssr:k,inSSR:y,ssrCssVars:S,bindingMetadata:E,inline:F,isTS:I,onError:g,onWarn:N,compatConfig:M,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(L){const R=v.helpers.get(L)||0;return v.helpers.set(L,R+1),L},removeHelper(L){const R=v.helpers.get(L);if(R){const z=R-1;z?v.helpers.set(L,z):v.helpers.delete(L)}},helperString(L){return`_${Bt[v.helper(L)]}`},replaceNode(L){if(process.env.NODE_ENV!=="production"){if(!v.currentNode)throw new Error("Node being replaced is already removed.");if(!v.parent)throw new Error("Cannot replace root node.")}v.parent.children[v.childIndex]=v.currentNode=L},removeNode(L){if(process.env.NODE_ENV!=="production"&&!v.parent)throw new Error("Cannot remove root node.");const R=v.parent.children,z=L?R.indexOf(L):v.currentNode?v.childIndex:-1;if(process.env.NODE_ENV!=="production"&&z<0)throw new Error("node being removed is not a child of current parent");!L||L===v.currentNode?(v.currentNode=null,v.onNodeRemoved()):v.childIndex>z&&(v.childIndex--,v.onNodeRemoved()),v.parent.children.splice(z,1)},onNodeRemoved:Un,addIdentifiers(L){},removeIdentifiers(L){},hoist(L){ye(L)&&(L=X(L)),v.hoists.push(L);const R=X(`_hoisted_${v.hoists.length}`,!1,L.loc,2);return R.hoisted=L,R},cache(L,R=!1,z=!1){const Z=Ac(v.cached.length,L,R,z);return v.cached.push(Z),Z}};return v.filters=new Set,v}function cd(t,n){const o=ad(t,n);Cn(t,o),n.hoistStatic&&id(t,o),n.ssr||dd(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 dd(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=xs(t);if(r&&r.codegenNode){const l=r.codegenNode;l.type===13&&uo(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=qt(n,o(Ft),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function fd(t,n){let o=0;const s=()=>{o--};for(;o<t.children.length;o++){const r=t.children[o];ye(r)||(n.grandParent=n.parent,n.parent=t,n.childIndex=o,n.onNodeRemoved=s,Cn(r,n))}}function Cn(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&&(Ve(i)?s.push(...i):s.push(i)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(jt);break;case 5:n.ssr||n.helper(un);break;case 9:for(let l=0;l<t.branches.length;l++)Cn(t.branches[l],n);break;case 10:case 11:case 1:case 0:fd(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function _s(t,n){const o=ye(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(qc))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 Sn="/*@__PURE__*/",Bs=t=>`${Bt[t]}: _${Bt[t]}`;function pd(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:u=!1,isTS:f=!1,inSSR:h=!1}){const x={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:l,optimizeImports:i,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:u,isTS:f,inSSR:h,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(y){return`_${Bt[y]}`},push(y,S=-2,E){x.code+=y},indent(){k(++x.indentLevel)},deindent(y=!1){y?--x.indentLevel:k(--x.indentLevel)},newline(){k(x.indentLevel)}};function k(y){x.push(`
5
- `+" ".repeat(y),0)}return x}function ud(t,n={}){const o=pd(t,n);n.onContextCreated&&n.onContextCreated(o);const{mode:s,push:r,prefixIdentifiers:l,indent:i,deindent:a,newline:c,scopeId:d,ssr:u}=o,f=Array.from(t.helpers),h=f.length>0,x=!l&&s!=="module";md(t,o);const y=u?"ssrRender":"render",E=(u?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${y}(${E}) {`),i(),x&&(r("with (_ctx) {"),i(),h&&(r(`const { ${f.map(Bs).join(", ")} } = _Vue
6
- `,-1),c())),t.components.length&&(xo(t.components,"component",o),(t.directives.length||t.temps>0)&&c()),t.directives.length&&(xo(t.directives,"directive",o),t.temps>0&&c()),t.filters&&t.filters.length&&(c(),xo(t.filters,"filter",o),c()),t.temps>0){r("let ");for(let F=0;F<t.temps;F++)r(`${F>0?", ":""}_temp${F}`)}return(t.components.length||t.directives.length||t.temps)&&(r(`
7
- `,0),c()),u||r("return "),t.codegenNode?Ne(t.codegenNode,o):r("null"),x&&(a(),r("}")),a(),r("}"),{ast:t,code:o.code,preamble:"",map:o.map?o.map.toJSON():void 0}}function md(t,n){const{ssr:o,prefixIdentifiers:s,push:r,newline:l,runtimeModuleName:i,runtimeGlobalName:a,ssrRuntimeModuleName:c}=n,d=a,u=Array.from(t.helpers);if(u.length>0&&(r(`const _Vue = ${d}
8
- `,-1),t.hoists.length)){const f=[Jn,Yn,jt,Xn,Vo].filter(h=>u.includes(h)).map(Bs).join(", ");r(`const { ${f} } = _Vue
9
- `,-1)}hd(t.hoists,n),l(),r("return ")}function xo(t,n,{helper:o,push:s,newline:r,isTS:l}){const i=o(n==="filter"?to:n==="component"?Qn:eo);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 ${Kt(c,n)} = ${i}(${JSON.stringify(c)}${d?", true":""})${l?"!":""}`),a<t.length-1&&r()}}function hd(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} = `),Ne(l,n),s())}n.pure=!1}function gd(t){return ye(t)||t.type===4||t.type===2||t.type===5||t.type===8}function No(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Ve(s)||!gd(s));n.push("["),o&&n.indent(),Zt(t,n,o),o&&n.deindent(),n.push("]")}function Zt(t,n,o=!1,s=!0){const{push:r,newline:l}=n;for(let i=0;i<t.length;i++){const a=t[i];ye(a)?r(a,-3):Ve(a)?No(a,n):Ne(a,n),i<t.length-1&&(o?(s&&r(","),l()):s&&r(", "))}}function Ne(t,n){if(ye(t)){n.push(t,-3);return}if(Wn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&fs(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Ne(t.codegenNode,n);break;case 2:yd(t,n);break;case 4:Ts(t,n);break;case 5:vd(t,n);break;case 12:Ne(t.codegenNode,n);break;case 8:$s(t,n);break;case 3:kd(t,n);break;case 13:Ed(t,n);break;case 14:xd(t,n);break;case 15:Nd(t,n);break;case 17:Cd(t,n);break;case 18:Sd(t,n);break;case 19:_d(t,n);break;case 20:Bd(t,n);break;case 21:Zt(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 fs(!1,`unhandled codegen node type: ${t.type}`),t}}function yd(t,n){n.push(JSON.stringify(t.content),-3,t)}function Ts(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function vd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Sn),o(`${s(un)}(`),Ne(t.content,n),o(")")}function $s(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];ye(s)?n.push(s,-3):Ne(s,n)}}function bd(t,n){const{push:o}=n;if(t.type===8)o("["),$s(t,n),o("]");else if(t.isStatic){const s=go(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function kd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Sn),o(`${s(jt)}(${JSON.stringify(t.content)})`,-3,t)}function Ed(t,n){const{push:o,helper:s,pure:r}=n,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:d,directives:u,isBlock:f,disableTracking:h,isComponent:x}=t;let k;if(c)if(process.env.NODE_ENV!=="production")if(c<0)k=c+` /* ${Pt[c]} */`;else{const S=Object.keys(Pt).map(Number).filter(E=>E>0&&c&E).map(E=>Pt[E]).join(", ");k=c+` /* ${S} */`}else k=String(c);u&&o(s(no)+"("),f&&o(`(${s(ft)}(${h?"true":""}), `),r&&o(Sn);const y=f?Lt(n.inSSR,x):$t(n.inSSR,x);o(s(y)+"(",-2,t),Zt(wd([l,i,a,k,d]),n),o(")"),f&&o(")"),u&&(o(", "),Ne(u,n),o(")"))}function wd(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function xd(t,n){const{push:o,helper:s,pure:r}=n,l=ye(t.callee)?t.callee:s(t.callee);r&&o(Sn),o(l+"(",-2,t),Zt(t.arguments,n),o(")")}function Nd(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:u}=i[c];bd(d,n),o(": "),Ne(u,n),c<i.length-1&&(o(","),l())}a&&r(),o(a?"}":" }")}function Cd(t,n){No(t.elements,n)}function Sd(t,n){const{push:o,indent:s,deindent:r}=n,{params:l,returns:i,body:a,newline:c,isSlot:d}=t;d&&o(`_${Bt[co]}(`),o("(",-2,t),Ve(l)?Zt(l,n):l&&Ne(l,n),o(") => "),(c||a)&&(o("{"),s()),i?(c&&o("return "),Ve(i)?No(i,n):Ne(i,n)):a&&Ne(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function _d(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=!go(o.content);f&&i("("),Ts(o,n),f&&i(")")}else i("("),Ne(o,n),i(")");l&&a(),n.indentLevel++,l||i(" "),i("? "),Ne(s,n),n.indentLevel--,l&&d(),l||i(" "),i(": ");const u=r.type===19;u||n.indentLevel++,Ne(r,n),u||n.indentLevel--,l&&c(!0)}function Bd(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(hn)}(-1`),t.inVOnce&&o(", true"),o("),"),i(),o("(")),o(`_cache[${t.index}] = `),Ne(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),i(),o(`${s(hn)}(1),`),i(),o(`_cache[${t.index}]`),l()),o(")"),c&&o(")]")}const Td=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"),$d=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/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($d,"").match(Td);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(oe(46,t.loc,void 0,i))}}const Ld=(t,n)=>{if(t.type===5)t.content=Co(t.content,n);else if(t.type===1){const o=_e(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=Co(l,n,r.name==="slot")),i&&i.type===4&&!i.isStatic&&(r.arg=Co(i,n))}}}};function Co(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&ht(t,n,o,s),t}const Id=_s(/^(?:if|else|else-if)$/,(t,n,o)=>Ad(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=Is(r,c,o);else{const d=Od(s.codegenNode);d.alternate=Is(r,c+s.branches.length-1,o)}}}));function Ad(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=X("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&ht(n.exp,o),n.name==="if"){const r=Ls(t,n),l={type:9,loc:nd(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&&bo(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=Ls(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 u=c.userKey;u&&a.branches.forEach(({userKey:f})=>{Dd(f,u)&&o.onError(oe(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);Cn(c,o),d&&d(),o.currentNode=null}else o.onError(oe(30,t.loc));break}}}function Ls(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!_e(t,"for")?t.children:[t],userKey:Wt(t,"key"),isTemplateIf:o}}function Is(t,n,o){return t.condition?po(t.condition,As(t,n,o),ge(o.helper(jt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):As(t,n,o)}function As(t,n,o){const{helper:s}=o,r=fe("key",X(`${n}`,!1,Le,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 kn(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),qt(o,s(Ft),Re([r]),l,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=i.codegenNode,d=Kc(c);return d.type===13&&uo(d,o),kn(d,r,o),c}}function Dd(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 Od(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 Md=_s("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return Rd(t,n,o,l=>{const i=ge(s(oo),[l.source]),a=vn(t),c=_e(t,"memo"),d=Wt(t,"key",!1,!0);d&&d.type;let u=d&&(d.type===6?d.value?X(d.value.content,!0):void 0:d.exp);const f=d&&u?fe("key",u):null,h=l.source.type===4&&l.source.constType>0,x=h?64:d?128:256;return l.codegenNode=qt(o,s(Ft),void 0,i,x,void 0,void 0,!0,!h,!1,t.loc),()=>{let k;const{children:y}=l;process.env.NODE_ENV!=="production"&&a&&t.children.some(F=>{if(F.type===1){const I=Wt(F,"key");if(I)return o.onError(oe(33,I.loc)),!0}});const S=y.length!==1||y[0].type!==1,E=bn(t)?t:a&&t.children.length===1&&bn(t.children[0])?t.children[0]:null;if(E?(k=E.codegenNode,a&&f&&kn(k,f,o)):S?k=qt(o,s(Ft),f?Re([f]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(k=y[0].codegenNode,a&&f&&kn(k,f,o),k.isBlock!==!h&&(k.isBlock?(r(ft),r(Lt(o.inSSR,k.isComponent))):r($t(o.inSSR,k.isComponent))),k.isBlock=!h,k.isBlock?(s(ft),s(Lt(o.inSSR,k.isComponent))):s($t(o.inSSR,k.isComponent))),c){const F=Tt(So(l.parseResult,[X("_cached")]));F.body=Dc([Pe(["const _memo = (",c.exp,")"]),Pe(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${o.helperString(ns)}(_cached, _memo)) return _cached`]),Pe(["const _item = ",k]),X("_item.memo = _memo"),X("return _item")]),i.arguments.push(F,X("_cache"),X(String(o.cached.length))),o.cached.push(null)}else i.arguments.push(Tt(So(l.parseResult),k,!0))}})});function Rd(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}Ds(r,o);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=o,{source:c,value:d,key:u,index:f}=r,h={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:u,objectIndexAlias:f,parseResult:r,children:vn(t)?t.children:[t]};o.replaceNode(h),a.vFor++;const x=s&&s(h);return()=>{a.vFor--,x&&x()}}function Ds(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 So({value:t,key:n,index:o},s=[]){return Pd([t,n,o,...s])}function Pd(t){let n=t.length;for(;n--&&!t[n];);return t.slice(0,n+1).map((o,s)=>o||X("_".repeat(s+1),!1))}const Os=X("undefined",!1),Fd=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=_e(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},zd=(t,n,o,s)=>Tt(t,o,!1,!0,o.length?o[0].loc:s);function jd(t,n,o=zd){n.helper(co);const{children:s,loc:r}=t,l=[],i=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=_e(t,"slot",!0);if(c){const{arg:S,exp:E}=c;S&&!Se(S)&&(a=!0),l.push(fe(S||X("default",!0),o(E,void 0,s,r)))}let d=!1,u=!1;const f=[],h=new Set;let x=0;for(let S=0;S<s.length;S++){const E=s[S];let F;if(!vn(E)||!(F=_e(E,"slot",!0))){E.type!==3&&f.push(E);continue}if(c){n.onError(oe(37,F.loc));break}d=!0;const{children:I,loc:g}=E,{arg:N=X("default",!0),exp:M,loc:A}=F;let v;Se(N)?v=N?N.content:"default":a=!0;const L=_e(E,"for"),R=o(M,L,I,g);let z,Z;if(z=_e(E,"if"))a=!0,i.push(po(z.exp,_n(N,R,x++),Os));else if(Z=_e(E,/^else(?:-if)?$/,!0)){let W=S,T;for(;W--&&(T=s[W],!!bo(T)););if(T&&vn(T)&&_e(T,/^(?:else-)?if$/)){let D=i[i.length-1];for(;D.alternate.type===19;)D=D.alternate;D.alternate=Z.exp?po(Z.exp,_n(N,R,x++),Os):_n(N,R,x++)}else n.onError(oe(30,Z.loc))}else if(L){a=!0;const W=L.forParseResult;W?(Ds(W,n),i.push(ge(n.helper(oo),[W.source,Tt(So(W),_n(N,R),!0)]))):n.onError(oe(32,L.loc))}else{if(v){if(h.has(v)){n.onError(oe(38,A));continue}h.add(v),v==="default"&&(u=!0)}l.push(fe(N,R))}}if(!c){const S=(E,F)=>{const I=o(E,void 0,F,r);return n.compatConfig&&(I.isNonScopedSlot=!0),fe("default",I)};d?f.length&&!f.every(vo)&&(u?n.onError(oe(39,f[0].loc)):l.push(S(void 0,f))):l.push(S(void 0,s))}const k=a?2:Bn(t.children)?3:1;let y=Re(l.concat(fe("_",X(k+(process.env.NODE_ENV!=="production"?` /* ${uc[k]} */`:""),!1))),r);return i.length&&(y=ge(n.helper(ts),[y,pt(i)])),{slots:y,hasDynamicSlots:a}}function _n(t,n,o){const s=[fe("name",t),fe("fn",n)];return o!=null&&s.push(fe("key",X(String(o),!0))),Re(s)}function Bn(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||Bn(o.children))return!0;break;case 9:if(Bn(o.branches))return!0;break;case 10:case 11:if(Bn(o.children))return!0;break}}return!1}const Ms=new WeakMap,Hd=(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?Ud(t,n):`"${s}"`;const a=cc(i)&&i.callee===Vn;let c,d,u=0,f,h,x,k=a||i===zt||i===Zn||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const y=Rs(t,n,void 0,l,a);c=y.props,u=y.patchFlag,h=y.dynamicPropNames;const S=y.directives;x=S&&S.length?pt(S.map(E=>Wd(E,n))):void 0,y.shouldUseBlock&&(k=!0)}if(t.children.length>0)if(i===pn&&(k=!0,u|=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!==zt&&i!==pn){const{slots:S,hasDynamicSlots:E}=jd(t,n);d=S,E&&(u|=1024)}else if(t.children.length===1&&i!==zt){const S=t.children[0],E=S.type,F=E===5||E===8;F&&Ae(S,n)===0&&(u|=1),F||E===2?d=S:d=t.children}else d=t.children;h&&h.length&&(f=Kd(h)),t.codegenNode=qt(n,i,c,d,u===0?void 0:u,f,x,!!k,!1,l,t.loc)};function Ud(t,n,o=!1){let{tag:s}=t;const r=_o(s),l=Wt(t,"is",!1,!0);if(l)if(r||at("COMPILER_IS_ON_ELEMENT",n)){let a;if(l.type===6?a=l.value&&X(l.value.content,!0):(a=l.exp,a||(a=X("is",!1,l.arg.loc))),a)return ge(n.helper(Vn),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=ls(s)||n.isBuiltInComponent(s);return i?(o||n.helper(i),i):(n.helper(Qn),n.components.add(s),Kt(s,"component"))}function Rs(t,n,o=t.props,s,r,l=!1){const{tag:i,loc:a,children:c}=t;let d=[];const u=[],f=[],h=c.length>0;let x=!1,k=0,y=!1,S=!1,E=!1,F=!1,I=!1,g=!1;const N=[],M=R=>{d.length&&(u.push(Re(Ps(d),a)),d=[]),R&&u.push(R)},A=()=>{n.scopes.vFor>0&&d.push(fe(X("ref_for",!0),X("true")))},v=({key:R,value:z})=>{if(Se(R)){const Z=R.content,W=qn(Z);if(W&&(!s||r)&&Z.toLowerCase()!=="onclick"&&Z!=="onUpdate:modelValue"&&!Jo(Z)&&(F=!0),W&&Jo(Z)&&(g=!0),W&&z.type===14&&(z=z.arguments[0]),z.type===20||(z.type===4||z.type===8)&&Ae(z,n)>0)return;Z==="ref"?y=!0:Z==="class"?S=!0:Z==="style"?E=!0:Z!=="key"&&!N.includes(Z)&&N.push(Z),s&&(Z==="class"||Z==="style")&&!N.includes(Z)&&N.push(Z)}else I=!0};for(let R=0;R<o.length;R++){const z=o[R];if(z.type===6){const{loc:Z,name:W,nameLoc:T,value:D}=z;let w=!0;if(W==="ref"&&(y=!0,A()),W==="is"&&(_o(i)||D&&D.content.startsWith("vue:")||at("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(fe(X(W,!0,T),X(D?D.content:"",w,D?D.loc:Z)))}else{const{name:Z,arg:W,exp:T,loc:D,modifiers:w}=z,j=Z==="bind",se=Z==="on";if(Z==="slot"){s||n.onError(oe(40,D));continue}if(Z==="once"||Z==="memo"||Z==="is"||j&&ct(W,"is")&&(_o(i)||at("COMPILER_IS_ON_ELEMENT",n))||se&&l)continue;if((j&&ct(W,"key")||se&&h&&ct(W,"vue:before-update"))&&(x=!0),j&&ct(W,"ref")&&A(),!W&&(j||se)){if(I=!0,T)if(j){if(M(),process.env.NODE_ENV!=="production"&&u.some(pe=>pe.type===15?pe.properties.some(({key:ue})=>ue.type!==4||!ue.isStatic?!0:ue.content!=="class"&&ue.content!=="style"&&!qn(ue.content)):!0)&&It("COMPILER_V_BIND_OBJECT_ORDER",n,D),at("COMPILER_V_BIND_OBJECT_ORDER",n)){u.unshift(T);continue}A(),M(),u.push(T)}else M({type:14,loc:D,callee:n.helper(io),arguments:s?[T]:[T,"true"]});else n.onError(oe(j?34:35,D));continue}j&&w.some(Ce=>Ce.content==="prop")&&(k|=32);const $e=n.directiveTransforms[Z];if($e){const{props:Ce,needRuntime:pe}=$e(z,t,n);!l&&Ce.forEach(v),se&&W&&!Se(W)?M(Re(Ce,a)):d.push(...Ce),pe&&(f.push(z),Wn(pe)&&Ms.set(z,pe))}else dc(Z)||(f.push(z),h&&(x=!0))}}let L;if(u.length?(M(),u.length>1?L=ge(n.helper(mn),u,a):L=u[0]):d.length&&(L=Re(Ps(d),a)),I?k|=16:(S&&!s&&(k|=2),E&&!s&&(k|=4),N.length&&(k|=8),F&&(k|=32)),!x&&(k===0||k===32)&&(y||g||f.length>0)&&(k|=512),!n.inSSR&&L)switch(L.type){case 15:let R=-1,z=-1,Z=!1;for(let D=0;D<L.properties.length;D++){const w=L.properties[D].key;Se(w)?w.content==="class"?R=D:w.content==="style"&&(z=D):w.isHandlerKey||(Z=!0)}const W=L.properties[R],T=L.properties[z];Z?L=ge(n.helper(Ht),[L]):(W&&!Se(W.value)&&(W.value=ge(n.helper(so),[W.value])),T&&(E||T.value.type===4&&T.value.content.trim()[0]==="["||T.value.type===17)&&(T.value=ge(n.helper(ro),[T.value])));break;case 14:break;default:L=ge(n.helper(Ht),[ge(n.helper(Ut),[L])]);break}return{props:L,directives:f,patchFlag:k,dynamicPropNames:N,shouldUseBlock:x}}function Ps(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"||qn(l))&&qd(i,r):(n.set(l,r),o.push(r))}return o}function qd(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=pt([t.value,n.value],t.loc)}function Wd(t,n){const o=[],s=Ms.get(t);s?o.push(n.helperString(s)):(n.helper(eo),n.directives.add(t.name),o.push(Kt(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=X("true",!1,r);o.push(Re(t.modifiers.map(i=>fe(i,l)),r))}return pt(o,t.loc)}function Kd(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 _o(t){return t==="component"||t==="Component"}const Gd=(t,n)=>{if(bn(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:l}=Zd(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=ge(n.helper(es),i,s)}};function Zd(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=it(i.name),r.push(i)));else if(i.name==="bind"&&ct(i.arg,"name")){if(i.exp)o=i.exp;else if(i.arg&&i.arg.type===4){const a=it(i.arg.content);o=i.exp=X(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&Se(i.arg)&&(i.arg.content=it(i.arg.content)),r.push(i)}if(r.length>0){const{props:l,directives:i}=Rs(t,n,r,!1,!1);s=l,i.length&&n.onError(oe(36,i[0].loc))}return{slotName:o,slotProps:s}}const Fs=(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 h=n.tagType!==0||f.startsWith("vnode")||!/[A-Z]/.test(f)?pc(it(f)):`on:${f}`;a=X(h,!0,i.loc)}else a=Pe([`${o.helperString(ao)}(`,i,")"]);else a=i,a.children.unshift(`${o.helperString(ao)}(`),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=ds(c),h=!(f||Hc(c)),x=c.content.includes(";");process.env.NODE_ENV!=="production"&&ht(c,o,!1,x),(h||d&&f)&&(c=Pe([`${h?"$event":"(...args)"} => ${x?"{":"("}`,c,x?"}":")"]))}let u={props:[fe(a,c||X("() => {}",!1,r))]};return s&&(u=s(u)),d&&(u.props[0].value=o.cache(u.props[0].value)),u.props.forEach(f=>f.key.isHandlerKey=!0),u},Jd=(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=it(l.content):l.content=`${o.helperString(lo)}(${l.content})`:(l.children.unshift(`${o.helperString(lo)}(`),l.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&zs(l,"."),s.some(a=>a.content==="attr")&&zs(l,"^")),{props:[fe(l,i)]}},zs=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},Yd=(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(yo(i)){r=!0;for(let a=l+1;a<o.length;a++){const c=o[a];if(yo(c))s||(s=o[l]=Pe([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(yo(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!n.ssr&&Ae(i,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Pt[1]} */`:"")),o[l]={type:12,content:i,loc:i.loc,codegenNode:ge(n.helper(Xn),a)}}}}},js=new WeakSet,Xd=(t,n)=>{if(t.type===1&&_e(t,"once",!0))return js.has(t)||n.inVOnce||n.inSSR?void 0:(js.add(t),n.inVOnce=!0,n.helper(hn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},Hs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(oe(41,t.loc)),Jt();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)),Jt();if(a==="literal-const"||a==="setup-const")return o.onError(oe(45,s.loc)),Jt();if(!i.trim()||!ds(s))return o.onError(oe(42,s.loc)),Jt();const c=r||X("modelValue",!0),d=r?Se(r)?`onUpdate:${it(r.content)}`:Pe(['"onUpdate:" + ',r]):"onUpdate:modelValue";let u;const f=o.isTS?"($event: any)":"$event";u=Pe([`${f} => ((`,s,") = $event)"]);const h=[fe(c,t.exp),fe(d,u)];if(t.modifiers.length&&n.tagType===1){const x=t.modifiers.map(y=>y.content).map(y=>(go(y)?y:JSON.stringify(y))+": true").join(", "),k=r?Se(r)?`${r.content}Modifiers`:Pe([r,' + "Modifiers"']):"modelModifiers";h.push(fe(k,X(`{ ${x} }`,!1,t.loc,2)))}return Jt(h)};function Jt(t=[]){return{props:t}}const Qd=/[\w).+\-_$\]]/,Vd=(t,n)=>{at("COMPILER_FILTERS",n)&&(t.type===5?Tn(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&Tn(o.exp,n)}))};function Tn(t,n){if(t.type===4)Us(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?Us(s,n):s.type===8?Tn(t,n):s.type===5&&Tn(s.content,n))}}function Us(t,n){const o=t.content;let s=!1,r=!1,l=!1,i=!1,a=0,c=0,d=0,u=0,f,h,x,k,y=[];for(x=0;x<o.length;x++)if(h=f,f=o.charCodeAt(x),s)f===39&&h!==92&&(s=!1);else if(r)f===34&&h!==92&&(r=!1);else if(l)f===96&&h!==92&&(l=!1);else if(i)f===47&&h!==92&&(i=!1);else if(f===124&&o.charCodeAt(x+1)!==124&&o.charCodeAt(x-1)!==124&&!a&&!c&&!d)k===void 0?(u=x+1,k=o.slice(0,x).trim()):S();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=x-1,F;for(;E>=0&&(F=o.charAt(E),F===" ");E--);(!F||!Qd.test(F))&&(i=!0)}}k===void 0?k=o.slice(0,x).trim():u!==0&&S();function S(){y.push(o.slice(u,x).trim()),u=x+1}if(y.length){for(process.env.NODE_ENV!=="production"&&yn("COMPILER_FILTERS",n,t.loc),x=0;x<y.length;x++)k=ef(k,y[x],n);t.content=k,t.ast=void 0}}function ef(t,n,o){o.helper(to);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Kt(n,"filter")}(${t})`;{const r=n.slice(0,s),l=n.slice(s+1);return o.filters.add(r),`${Kt(r,"filter")}(${t}${l!==")"?","+l:l}`}}const qs=new WeakSet,tf=(t,n)=>{if(t.type===1){const o=_e(t,"memo");return!o||qs.has(t)||n.inSSR?void 0:(qs.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&uo(s,n),t.codegenNode=ge(n.helper(fo),[o.exp,Tt(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}},nf=(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=X("",!0,s.loc);else{const r=it(s.content);(as.test(r[0])||r[0]==="-")&&(o.exp=X(r,!1,s.loc))}}}};function of(t){return[[nf,Xd,Id,tf,Md,Vd,...process.env.NODE_ENV!=="production"?[Ld]:[],Gd,Hd,Fd,Yd],{on:Fs,bind:Jd,model:Hs}]}function sf(t,n={}){const o=n.onError||ho,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=rt({},n,{prefixIdentifiers:r}),i=ye(t)?rd(t,l):t,[a,c]=of();return cd(i,rt({},l,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:rt({},c,n.directiveTransforms||{})})),ud(i,l)}const rf=()=>({props:[]});const Ws=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),Ks=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Gs=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),Zs=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Bo=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),Js=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),Ys=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),Xs=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),To=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),Qs=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");Lc({[Ws]:"vModelRadio",[Ks]:"vModelCheckbox",[Gs]:"vModelText",[Zs]:"vModelSelect",[Bo]:"vModelDynamic",[Js]:"withModifiers",[Ys]:"withKeys",[Xs]:"vShow",[To]:"Transition",[Qs]:"TransitionGroup"});let At;function lf(t,n=!1){return At||(At=document.createElement("div")),n?(At.innerHTML=`<div foo="${t.replace(/"/g,"&quot;")}">`,At.children[0].getAttribute("foo")):(At.innerHTML=t,At.textContent)}const af={parseMode:"html",isVoidTag:Cc,isNativeTag:t=>wc(t)||xc(t)||Nc(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:lf,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return To;if(t==="TransitionGroup"||t==="transition-group")return Qs},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}},cf=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:X("style",!0,n.loc),exp:df(n.value.content,n.loc),modifiers:[],loc:n.loc})})},df=(t,n)=>{const o=yc(t);return X(JSON.stringify(o),!1,n,3)};function Fe(t,n){return oe(t,n,process.env.NODE_ENV!=="production"?ff:void 0)}const ff={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."},pf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Fe(54,r)),n.children.length&&(o.onError(Fe(55,r)),n.children.length=0),{props:[fe(X("innerHTML",!0,r),s||X("",!0))]}},uf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Fe(56,r)),n.children.length&&(o.onError(Fe(57,r)),n.children.length=0),{props:[fe(X("textContent",!0),s?Ae(s,o)>0?s:ge(o.helperString(un),[s],r):X("",!0))]}},mf=(t,n,o)=>{const s=Hs(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(Fe(59,t.arg.loc));function r(){const a=_e(n,"bind");a&&ct(a.arg,"value")&&o.onError(Fe(61,a.loc))}const{tag:l}=n,i=o.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||i){let a=Gs,c=!1;if(l==="input"||i){const d=Wt(n,"type");if(d){if(d.type===7)a=Bo;else if(d.value)switch(d.value.content){case"radio":a=Ws;break;case"checkbox":a=Ks;break;case"file":c=!0,o.onError(Fe(60,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else Uc(n)?a=Bo:process.env.NODE_ENV!=="production"&&r()}else l==="select"?a=Zs:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(Fe(58,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},hf=We("passive,once,capture"),gf=We("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),yf=We("left,right"),Vs=We("onkeyup,onkeydown,onkeypress"),vf=(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)||hf(c)?i.push(c):yf(c)?Se(t)?Vs(t.content.toLowerCase())?r.push(c):l.push(c):(r.push(c),l.push(c)):gf(c)?l.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:l,eventOptionModifiers:i}},er=(t,n)=>Se(t)&&t.content.toLowerCase()==="onclick"?X(n,!0):t.type!==4?Pe(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,bf=(t,n,o)=>Fs(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}=vf(l,r,o,t.loc);if(c.includes("right")&&(l=er(l,"onContextmenu")),c.includes("middle")&&(l=er(l,"onMouseup")),c.length&&(i=ge(o.helper(Js),[i,JSON.stringify(c)])),a.length&&(!Se(l)||Vs(l.content.toLowerCase()))&&(i=ge(o.helper(Ys),[i,JSON.stringify(a)])),d.length){const u=d.map(Gn).join("");l=Se(l)?X(`${l.content}${u}`,!0):Pe(["(",l,`) + "${u}"`])}return{props:[fe(l,i)]}}),kf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Fe(62,r)),{props:[],needRuntime:o.helper(Xs)}},Ef=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===To)return()=>{if(!t.children.length)return;tr(t)&&n.onError(Fe(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 tr(t){const n=t.children=t.children.filter(s=>!bo(s)),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(tr)}const wf=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(Fe(64,t.loc)),n.removeNode())};function xf(t,n){return t==="template"?!0:t in nr?nr[t].has(n):n in or?or[n].has(t):!(t in sr&&sr[t].has(n)||n in rr&&rr[n].has(t))}const Dt=new Set(["h1","h2","h3","h4","h5","h6"]),gt=new Set([]),nr={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},or={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"])},sr={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"])},rr={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:Dt,h2:Dt,h3:Dt,h4:Dt,h5:Dt,h6:Dt},Nf=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!xf(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)}},Cf=[cf,...process.env.NODE_ENV!=="production"?[Ef,Nf]:[]],Sf={cloak:rf,html:pf,text:uf,model:mf,on:bf,show:kf};function _f(t,n={}){return sf(t,rt({},af,n,{nodeTransforms:[wf,...Cf,...n.nodeTransforms||[]],directiveTransforms:rt({},Sf,n.directiveTransforms||{}),transformHoist:null}))}function Bf(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=_f(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)(yr);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const $o={};function Tf(t){return $o[t]||($o[t]=Bf(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}}})),$o[t]}const $f={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},Lf={class:"flex items-center gap-2"},If=["disabled"],Af={class:"text-sm"},Df=["disabled"],Of=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",$f,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",Lf,[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,If),e.createElementVNode("span",Af,"Сторінка "+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,Df)])]))}}),Mf={class:"relative inline-flex"},Rf=["aria-label"],Pf={class:"px-3 pb-2"},Ff={class:"px-3 pb-3 max-h-64 overflow-y-auto"},zf=["onClick"],jf={class:"truncate"},Hf={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"},Uf="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",qf=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),u=e.ref(null),f=e.ref({top:0,left:0}),h=e.computed(()=>{if(!i.value)return a.value;const I=i.value.toLowerCase();return a.value.filter(g=>x(g).toLowerCase().includes(I))});e.watch(()=>o.columns,I=>{if(!I){a.value=[];return}const g=JSON.stringify(I),N=JSON.stringify(a.value);g!==N&&(a.value=[...I])},{deep:!0}),e.watch(a,I=>{s("update:columns",I)},{deep:!0});function x(I){return I.ua||I.label||I.name||"Колонка"}function k(I){const g=!I.hidden;g&&a.value.filter(N=>!N.hidden).length<=1||(I.hidden=g)}function y(){l.value=!l.value,l.value&&e.nextTick(()=>{u.value?.focus(),S()})}function S(){if(!c.value)return;const I=c.value.getBoundingClientRect();f.value={top:I.bottom+window.scrollY+6,left:I.left+window.scrollX-200}}function E(I){if(!l.value)return;const g=I.target;g&&(d.value?.contains(g)||c.value?.contains(g)||(l.value=!1))}function F(I){I.key==="Escape"&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",E,!0),document.addEventListener("keydown",F)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E,!0),document.removeEventListener("keydown",F)}),(I,g)=>(e.openBlock(),e.createElementBlock("div",Mf,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:y,class:e.normalizeClass([Uf,e.unref(r).class]),"aria-label":e.unref(r)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},[...g[2]||(g[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,Rf),(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`})},[g[5]||(g[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",Pf,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:u,"onUpdate:modelValue":g[0]||(g[0]=N=>i.value=N),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",Ff,[g[4]||(g[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:g[1]||(g[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,N=>(e.openBlock(),e.createElementBlock("li",{key:N.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:M=>k(N)},[e.createElementVNode("span",jf,e.toDisplayString(x(N)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",N.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[N.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Hf,[...g[3]||(g[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])]))],2)],8,zf))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),Wf=["data-action-key"],Kf=["onClick"],Gf={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"},Zf={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"},Jf={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"},Yf={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"},Xf=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 u=e.computed(()=>{if(!o.isOpen)return{};const k=r.value;if(!k)return{};const y=k.getBoundingClientRect(),S=8,E=160,g=(o.actions?.length??0)*36+S*2,N=i.value.height||(typeof window<"u"?window.innerHeight:0),M=i.value.width||(typeof window<"u"?window.innerWidth:0),A=i.value.scrollX||(typeof window<"u"?window.scrollX:0),v=i.value.scrollY||(typeof window<"u"?window.scrollY:0);let L=y.bottom+v+S,R=y.right+A-E;const z=A+M-E-S;return R>z&&(R=z),R<A+S&&(R=A+S),L+g>v+N-S&&(L=y.top+v-g-S),L<v+S&&(L=v+S),{top:`${L}px`,left:`${R}px`,width:"auto"}});function f(){typeof window>"u"||(i.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function h(){typeof window>"u"||a.value||(a.value=!0,f(),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f))}function x(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",f),window.removeEventListener("resize",f))}return e.watch(()=>o.isOpen,k=>{k?h():x()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&h()}),e.onBeforeUnmount(()=>{x()}),(k,y)=>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"])},[...y[1]||(y[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(u.value),onClick:y[0]||(y[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,S=>(e.openBlock(),e.createElementBlock("button",{key:S.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",S.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:E=>d(S)},[e.renderSlot(k.$slots,"icon",{action:S},()=>[S.type==="view"?(e.openBlock(),e.createElementBlock("svg",Gf,[...y[2]||(y[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)])])):S.type==="edit"?(e.openBlock(),e.createElementBlock("svg",Zf,[...y[3]||(y[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)])])):S.type==="delete"?(e.openBlock(),e.createElementBlock("svg",Jf,[...y[4]||(y[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",Yf,[...y[5]||(y[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])]))]),e.createTextVNode(" "+e.toDisplayString(S.label),1)],10,Kf))),128))],4)):e.createCommentVNode("",!0)]))],8,Wf)):e.createCommentVNode("",!0)}}),ir=typeof window<"u",lr=typeof document<"u";function Qf(t){if(!lr)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 ar(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 Lo(t,n){if(!lr||!ir)return;const o=Qf(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!ir)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 Io(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 Vf={mounted(t,n){const o=ar(n.value);o&&Lo(t,o)},updated(t,n){const o=ar(n.value),s=t;if(!o){Io(s);return}const r=s.__tooltipState__;if(!r){Lo(s,o);return}if(r.options.wrap!==o.wrap){Io(s),Lo(s,o);return}r.options=o},unmounted(t){Io(t)}},ep={class:"flex flex-col gap-4 mb-[15px]"},tp={class:"flex flex-wrap items-center gap-4"},np={class:"relative"},op={class:"ml-auto flex items-center gap-2"},sp={class:"overflow-x-auto"},rp={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"},ip={class:"text-left font-medium text-gray-700"},lp={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},ap={class:"divide-y divide-gray-200"},cp=["href"],dp={key:2},fp={key:3},pp={key:0,class:"py-2 pr-4 text-right"},up={key:0},mp={key:0},hp=["colspan"],cr=e.defineComponent({__name:"TableWidget",props:{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=Vf,l=t,i=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),u=e.ref(1),f=e.ref(10),h=e.ref(0),x=e.ref(0),k=e.ref("id"),y=e.ref("");let S=null,E=0;const F=e.ref(null);async function I(){const b=u.value,$=++E,C=new URLSearchParams,_=d.value.trim();_&&C.set("search",_),C.set("page",String(b)),C.set("limit",String(f.value));const Q=`/api/data/${l.token}${C.toString()?`?${C.toString()}`:""}`;let Y;try{const ve=await fetch(Q);if(!ve.ok)throw new Error(`Request failed with status ${ve.status}`);Y=await ve.json()}catch(ve){$===E&&(o.value=[],x.value=0,h.value=0),console.error("Failed to load table data",ve);return}if($!==E)return;o.value=Array.isArray(Y?.rows)?Y.rows:[],s.value=Z(Y?.columns||[]),i.value=Array.isArray(Y?.actions)?Y.actions:[],a.value=Y?.form,c.value=Y?.addToken,k.value=typeof Y?.pk=="string"&&Y.pk?Y.pk:k.value,typeof Y?.form=="string"&&Y.form&&(y.value=Y.form.replace(/\.form$/,".table")),J();const ne=Number(Y?.total??Y?.count??Y?.totalCount),Ee=Number(Y?.filtered??Y?.filteredCount);h.value=Number.isFinite(ne)&&ne>0?ne:o.value.length,x.value=Number.isFinite(Ee)&&Ee>0?Ee:Math.max(o.value.length,h.value);const qe=Math.max(1,Math.ceil((x.value||o.value.length||1)/f.value));let Oe=b;typeof Y?.page=="number"&&Y.page>0&&(Oe=Y.page),Oe>qe&&(Oe=qe),Oe<1&&(Oe=1);const Mt=Oe!==b;if(u.value=Oe,Mt&&x.value>0)return I()}const{$notify:g,$confirm:N,$form:M}=n?.appContext?.config?.globalProperties||{};function A(){if(we.emitter?.emit){we.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}I()}async function v(b){typeof M=="function"&&(await M({token:b.token}),A())}async function L(){typeof M=="function"&&(await M({token:c.value}),A())}function R(b){N({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const $=await fetch(`/api/table/${b.token}`,{method:"DELETE"});if(!$.ok){const{error:C}=await $.json();g({title:"Помилка",type:"warning",message:C});return}g({title:"Видаленно",message:"Успішно видалено"}),await I()}})}e.onMounted(async()=>{await I(),we.emitter?.on?.("updateCard",I)}),e.onBeforeUnmount(()=>{we.emitter?.off?.("updateCard",I)});function z(b){return typeof b?.format=="string"?b.format.toLowerCase():""}function Z(b){const $=new Map;s.value.forEach(_=>{_?.name&&$.set(_.name,!!_.hidden)});const C=b.map(_=>{const Q=$.has(_.name)?$.get(_.name):!!_.hidden;return{..._,hidden:Q}});return C.length&&!C.some(_=>!_.hidden)&&(C[0].hidden=!1),C}const W=e.computed(()=>{const b=s.value.filter($=>!$.hidden);return b.length?b:s.value}),T=e.computed(()=>{const b=[],$=new Set;for(const C of i.value){if(typeof C=="string"){if(C==="edit"){const _="row:edit";$.has(_)||(b.push({key:_,type:"edit",label:"Редагувати",scope:"row",handler:ie}),$.add(_));continue}if(C==="delete"||C==="del"){const _="row:delete";$.has(_)||(b.push({key:_,type:"delete",label:"Видалити",scope:"row",handler:me,variant:"danger"}),$.add(_));continue}if(C==="add"){const _="toolbar:add";$.has(_)||(b.push({key:_,type:"add",label:"Додати",scope:"toolbar"}),$.add(_))}continue}if(C&&typeof C=="object"){const _=String(C.name??C.type??"action"),Q=String(C.label??C.title??_),Y=C.scope==="toolbar"?"toolbar":"row",ne=`${Y}:${_}`;if($.has(ne))continue;$.add(ne),b.push({key:ne,type:_,label:Q,scope:Y,handler:Y==="row"?Ee=>le(C,Ee):void 0,variant:C.variant==="danger"?"danger":"default",original:C})}}return b}),D=e.computed(()=>T.value.filter(b=>b.scope==="row"&&typeof b.handler=="function")),w=e.computed(()=>T.value.filter(b=>b.scope==="toolbar")),j=e.computed(()=>D.value.length>0),se=e.computed(()=>w.value.some(b=>b.type==="add")),$e=e.computed(()=>o.value),Ce=e.computed(()=>{const b=x.value||$e.value.length,$=Math.ceil(b/f.value);return $>0?$:1}),pe=e.computed(()=>{const b=$e.value.length,$=x.value||b,C=h.value||$;return`Показано ${b} з ${$} (усього ${C})`});function ue(){u.value<Ce.value&&(u.value+=1,I())}function ze(){u.value>1&&(u.value-=1,I())}e.watch(s,b=>{b?.length&&(b.some($=>!$.hidden)||(b[0].hidden=!1))},{deep:!0});function Ke(){S&&clearTimeout(S),J(),S=setTimeout(()=>{u.value=1,I()},300)}function je(b){const $=k.value||"id",C=b?.token??b?.[$]??b?.id;return C?String(C):""}function Ge(b){const $=W.value[b],C=["py-2",...p($)];b===0&&C.push("pl-4");const _=b===W.value.length-1&&!j.value;return C.push(_?"pr-4":"pr-5"),C.join(" ")}function q(b,$){const C=["py-2",...p($)];z($)==="badge"&&C.push("center"),K($)==="wrap"?C.push("whitespace-normal","break-words"):C.push("truncate"),b===0&&C.push("pl-4");const _=b===W.value.length-1&&!j.value;return C.push(_?"pr-4":"pr-5"),C.join(" ")}function K(b){return(typeof b?.overflow=="string"?b.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function p(b){const $=[],C=ne=>{if(ne==null||ne==="")return;const Ee=Number(ne);return Number.isFinite(Ee)&&Ee>0?`${Ee}px`:String(ne).replace(/\s+/g,"")},_=C(b?.width),Q=C(b?.minWidth),Y=C(b?.maxWidth);return _?($.push(`min-w-[${_}]`,`max-w-[${_}]`),$):($.push(`min-w-[${Q??"100px"}]`),$.push(`max-w-[${Y??"350px"}]`),$)}function B(b){if(!D.value.length)return!1;const $=k.value||"id";return!!(b?.token||b?.[$]||b?.id)}function O(b){return F.value===je(b)}function H(b){const $=je(b);$&&(F.value=F.value===$?null:$)}function J(){F.value=null}function G(b,$){const C=$?.tooltip;if(!C)return;const _=kt(b,$);let Q,Y=$?.tooltipWrap!==!1;if(typeof C=="string"){const ne=C.trim();if(!ne)return;const Ee=ne.toLowerCase();if(["true","1","yes"].includes(Ee))Q=typeof _=="string"?_:String(_??"");else{if(["false","0","no"].includes(Ee))return;Q=ne}}else C===!0?Q=_:typeof C=="object"&&(typeof C.text=="string"&&(Q=C.text.trim()),typeof C.wrap=="boolean"&&(Y=C.wrap!==!1));if(!Q){if(_==null||_==="")return;Q=String(_)}if(Q.trim())return Y?{text:Q,wrap:!0}:Q}function ie(b){J(),v(b)}function me(b){J(),R(b)}async function le(b,$){J();const C=k.value||"id",_=b.isId?$?.[C]??$?.id:$?.token??$?.[C]??$?.id;if(!_){console.warn("Cannot execute action without identifier",b);return}if(b.form&&typeof b.api=="string"&&b.api&&typeof M=="function"){await Je(b,$,_);return}if(b.form&&typeof M=="function"){const Q=await He(b.form,_),Y={form:b.form,token:Q?.token??$?.token??_,schema:Q?.schema,mode:Q?.mode??"edit"};Q?.data!==void 0&&(Y.defaultValue=Q.data);try{await M(Y),A()}catch(ne){console.error("Failed to execute form action",ne)}return}if(typeof b.api=="string"&&b.api){const Q=Ze(b.api,_);window.location.href=Q;return}$?.token&&typeof M=="function"&&(await M({token:$.token}),A())}function Ze(b,$){return`${b.endsWith("/")?b:`${b}/`}${$}`}async function He(b,$){const C=`/api/form/${b}/${$}`;try{const _=await fetch(C);if(!_.ok)throw new Error(`Request failed with status ${_.status}`);return await _.json()}catch(_){console.error("Failed to load form config",_),g({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function An(b){const $=`/api/template/form/${b}`;try{const C=await fetch($);if(!C.ok)throw new Error(`Request failed with status ${C.status}`);return(await C.json())?.schema}catch(C){console.error("Failed to load form template",C);return}}function De(b){if(b!=null){if(b?.data!==void 0)return b.data;if(b?.defaultValue!==void 0)return b.defaultValue;if(b?.values!==void 0)return b.values;if(typeof b=="object"&&!Array.isArray(b)){const{schema:$,token:C,mode:_,message:Q,successMessage:Y,...ne}=b;if(Object.keys(ne).length)return ne}}}async function Je(b,$,C){const _=Ze(b.api,C),Q=(typeof b.method=="string"?b.method:"PUT").toUpperCase();let Y;try{const ve=await fetch(_);if(!ve.ok)throw new Error(`Request failed with status ${ve.status}`);Y=await ve.json()}catch(ve){console.error("Failed to load action data",ve),nt("Не вдалося отримати дані форми.");return}const ne=typeof b.form=="string"?b.form.replace(/\.table$/,".form"):void 0,Ee=Y?.schema??(ne?await An(ne):void 0),qe={mode:Y?.mode??"edit"};ne&&(qe.form=ne),Ee&&(qe.schema=Ee);const Oe=De(Y);Oe!==void 0&&(qe.defaultValue=Oe);const Mt=await M(qe);if(Mt)try{const ve=await fetch(_,{method:Q,headers:{"Content-Type":"application/json"},body:JSON.stringify(Mt)});if(!ve.ok){const Qe=await Ue(ve),Qt=Qe?.error??Qe?.message??"Не вдалося зберегти дані.";throw new Error(Qt)}Ot(`Дані успішно ${qe.value==="add"?"збережено":"оновлено"}`),A()}catch(ve){console.error("Failed to submit action data",ve),nt("Не вдалося зберегти дані.")}}async function Ue(b){try{return await b.json()}catch{return}}function nt(b){g({title:"Помилка",type:"error",message:b})}function Ot(b){g({title:"Успіх",type:"success",message:b})}function vt(b){if(!F.value)return;const $=b.target;if(!$)return;const C=$.closest("[data-action-key]");C&&C.getAttribute("data-action-key")===F.value||J()}e.onMounted(()=>{document.addEventListener("click",vt,!0)}),e.onBeforeUnmount(()=>{S&&clearTimeout(S),document.removeEventListener("click",vt,!0),we.emitter?.off?.("updateCard",I)});function bt(b,$){const _=b?.[`${$.name}_text`];if(Array.isArray(_))return _.length?_.join(", "):"-";if(_!=null&&_!=="")return _;const Q=b?.[$.name];return Array.isArray(Q)?Q.length?Q.join(", "):"-":Q??"-"}function Ye(b,$){const _=b?.[`${$.name}_data`];if(_&&typeof _=="object")return{text:_.text??_.label??_.name??_.title??"-",color:_.color,textColor:_.textColor};const Q=b?.[`${$.name}_text`]??b?.[$.name];return{text:(Array.isArray(Q)?Q.join(", "):Q)??"-"}}function Xe(b,$){const C=Ye(b,$);return C.color?{backgroundColor:C.color,color:C.textColor??"#ffffff"}:{}}function kt(b,$){const C=z($);if(C==="badge")return Ye(b,$).text;if(C==="select")return bt(b,$);if(C==="slot")return"-";if(C==="text")return b?.[$.name]??"-";const _=b?.[`${$.name}_data`];return _!=null&&typeof _!="object"?_:b?.[`${$.name}_text`]??b?.[$.name]??"-"}return(b,$)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ep,[e.createElementVNode("div",tp,[e.createElementVNode("div",np,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":$[0]||($[0]=C=>d.value=C),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:Ke},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",op,[e.createVNode(qf,{columns:s.value,"onUpdate:columns":$[1]||($[1]=C=>s.value=C)},null,8,["columns"]),se.value&&c.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:L,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",sp,[e.createElementVNode("table",rp,[e.createElementVNode("thead",ip,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(C,_)=>(e.openBlock(),e.createElementBlock("th",{key:C.name,class:e.normalizeClass(Ge(_))},e.toDisplayString(C.ua),3))),128)),j.value?(e.openBlock(),e.createElementBlock("th",lp," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",ap,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,C=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:C.id??JSON.stringify(C)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(_,Q)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:_.name,class:e.normalizeClass(q(Q,_))},[_.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:_.link.replace("{{id}}",C.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(C,_)),9,cp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[z(_)==="slot"&&(_.slot?.content||_.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Tf)(_.slot.content||_.slot)),{key:0,data:C,row:C,column:_,value:C?.[_.name]},null,8,["data","row","column","value"])):z(_)==="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(Xe(C,_))},e.toDisplayString(Ye(C,_).text),5)):z(_)==="select"?(e.openBlock(),e.createElementBlock("span",dp,e.toDisplayString(bt(C,_)),1)):(e.openBlock(),e.createElementBlock("span",fp,e.toDisplayString(kt(C,_)),1))],64))],2)),[[e.unref(r),G(C,_)]])),128)),j.value?(e.openBlock(),e.createElementBlock("td",pp,[B(C)?(e.openBlock(),e.createElementBlock("div",up,[e.createVNode(Xf,{row:C,actions:D.value,"is-open":O(C),"action-key":je(C),onToggle:_=>H(C)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),$e.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",mp,[e.createElementVNode("td",{colspan:W.value.length+(j.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,hp)]))])])]),e.createVNode(Of,{"current-page":u.value,"total-pages":Ce.value,label:pe.value,onPrevious:ze,onNext:ue},null,8,["current-page","total-pages","label"])]))}}),gp={class:"p-[20px]"},yp={class:"flex gap-[6px] mb-5"},vp={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"},kp={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Ep={class:"space-y-8"},wp={key:0},xp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Np=["onClick"],Cp={class:"md:col-span-2"},Sp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},_p={class:"text-sm text-gray-500 dark:text-neutral-500"},Bp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Tp=["checked","onChange"],$p={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Lp={class:"md:col-span-2"},Ip={class:"font-semibold text-gray-800 dark:text-neutral-200"},Ap=["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"},Pp=["checked","onChange"],$n="uk",Ln=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return $n;const g=localStorage.language,N=typeof navigator<"u"?navigator.language:$n;return(g||N||$n).split(/[-_]/)[0].toLowerCase()||$n},s=t,r=e.ref(""),l=["view","add","edit","del"],i=e.ref({}),a=e.ref(o()),c=()=>{a.value=o()},d=()=>{const g=[];return a.value&&g.push(a.value),n.forEach(N=>{N&&!g.includes(N)&&g.push(N)}),g.includes("path")||g.push("path"),g},u=g=>{const N=d();for(const M of N){const A=g[M];if(typeof A=="string"&&A.trim())return A}return""};e.onMounted(async()=>{c();const N=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();N.routes&&N.routes.forEach(M=>{i.value[M.path]=new Set(M.actions)})});const f=(g,N)=>i.value[g]?.has(N)??!1,h=(g,N)=>{i.value[g]||(i.value[g]=new Set),i.value[g].has(N)?i.value[g].delete(N):i.value[g].add(N)},x=(g,N)=>{g.forEach(M=>{M.path&&(i.value[M.path]||(i.value[M.path]=new Set),i.value[M.path].has(N)?i.value[M.path].delete(N):i.value[M.path].add(N))})},k=e.computed(()=>Object.entries(i.value).map(([g,N])=>({path:g,actions:Array.from(N)})).filter(g=>g.actions.length)),y=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:k.value})}),we.notify({title:"Success!",message:"Permissions saved."})},S=()=>{i.value={}},E=g=>{if(!r.value.trim())return g;const N=r.value.toLowerCase();return g.filter(M=>u(M).toLowerCase().includes(N)||(M.path?.toLowerCase().includes(N)??!1))},F=e.computed(()=>E(s.data.routers.filter(g=>!g.menu))),I=e.computed(()=>s.data.routers.filter(g=>g.menu).map(g=>({...g,menu:E(g.menu||[])})).filter(g=>g.menu&&g.menu.length>0));return(g,N)=>(e.openBlock(),e.createElementBlock("div",gp,[e.createElementVNode("div",yp,[e.createElementVNode("div",vp,[N[1]||(N[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":N[0]||(N[0]=M=>r.value=M),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:S,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:y,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,[N[2]||(N[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,(M,A)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:A},[e.createElementVNode("h3",kp,e.toDisplayString(M),1)])),64))]),e.createElementVNode("div",Ep,[F.value.length?(e.openBlock(),e.createElementBlock("div",wp,[e.createElementVNode("ul",xp,[N[3]||(N[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,(M,A)=>e.createElementVNode("li",{key:A,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:v=>x(F.value,l[A])}," Toggle all ",8,Np)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(M,A)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+A,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Cp,[e.createElementVNode("p",Sp,e.toDisplayString(u(M)),1),e.createElementVNode("p",_p,e.toDisplayString(M.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(v,L)=>e.createElementVNode("li",{key:L,class:"col-span-1"},[e.createElementVNode("div",Bp,[e.createElementVNode("input",{type:"checkbox",checked:f(M.path,v),onChange:R=>h(M.path,v),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Tp)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(M,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:"space-y-5"},[e.createElementVNode("ul",$p,[e.createElementVNode("li",Lp,[e.createElementVNode("h3",Ip,e.toDisplayString(u(M)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(v,L)=>e.createElementVNode("li",{key:L,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:R=>x(M.menu,l[L])}," Toggle all ",8,Ap)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.menu,(v,L)=>(e.openBlock(),e.createElementBlock("ul",{key:L,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(u(v)),1),e.createElementVNode("p",Mp,e.toDisplayString(v.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(R,z)=>e.createElementVNode("li",{key:z,class:"col-span-1"},[e.createElementVNode("div",Rp,[e.createElementVNode("input",{type:"checkbox",checked:f(v.path,R),onChange:Z=>h(v.path,R),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Pp)])])),64))]))),128))]))),128))])]))}}),yt={"vs-widget-comments":tn,"vs-widget-history":nn,"vs-widget-gallery":sn,"vs-widget-file":on,"vs-widget-list":Pn,"vs-widget-map":dn,"vs-widget-table":cr,"vs-group-interface":Ln};function dr(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 fr(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>fr(o))),n}function Fp(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=dr(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 In(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>fr(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=In(s.items,12))}),Fp(o,n),o}function pr(t){const n=dr(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const zp={class:"text-lg font-semibold text-gray-900"},jp=["innerHTML"],Hp={key:0,class:"grid grid-cols-12 gap-4"},Up={key:0,class:"mb-4 pb-2 border-b border-gray-200"},qp={class:"text-lg font-semibold text-gray-900"},Wp=["innerHTML"],Yt=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(()=>In(n.items));function r(d){const u=["col-span-12"],f=pr(d.col);return f.length&&u.push(...f),u}function l(d){return yt[d]||d}function i(d,u){if(!d||typeof u!="string"||!u)return{found:!1,value:void 0};const f=u.split(".");let h=d;for(const x of f){if(h==null||typeof h!="object"&&!Array.isArray(h))return{found:!1,value:void 0};if(!(x in h))return{found:!1,value:void 0};h=h[x]}return{found:!0,value:h}}const a=function(d={}){const u={...d};return Object.entries(u).forEach(([f,h])=>{if(f!=="props"&&typeof h=="string"){const x=i(n.data,h);x.found&&(u[f]=x.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([f,h])=>{if(typeof h=="string"){const x=i(n.data,h);u[f]=x.found?x.value:h}else u[f]=h}),delete u.props,u},c=e.computed(()=>{const d={};return n.col&&(d.col=n.col),d});return(d,u)=>(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",zp,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,jp)):t.type?.includes("tabs")?(e.openBlock(),e.createBlock(Xt,{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",Hp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(f,h)=>(e.openBlock(),e.createElementBlock("div",{key:f.name||f.component||h,class:e.normalizeClass(r(f))},[f.title||f.label?(e.openBlock(),e.createElementBlock("div",Up,[e.createElementVNode("h3",qp,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,Wp)):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))}}),Kp={class:"grid grid-cols-12 gap-[20px]"},Gp={key:0,class:"col-span-4"},Zp=["innerHTML"],Jp=["onClick"],Yp=["innerHTML"],Xp={key:1,class:"flex w-full"},Qp={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},Vp=["onClick"],eu={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},tu={class:"flex-1 p-4"},nu=["innerHTML"],ou={class:"grid grid-cols-12 gap-4"},su={key:3,class:"w-full h-full"},Xt=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 T=typeof window<"u"?window:globalThis,D="__vsCardAnonymousCounter__",w=T[D]??0;return T[D]=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,T=>{T&&(a.value=T)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function u(T,D){const w=D?.path;return w?(c.has(w)||c.set(w,e.defineAsyncComponent(()=>import(w))),c.get(w)):typeof T=="string"&&yt[T]?yt[T]:D?.component&&yt[D.component]?yt[D.component]:D?.name&&yt[D.name]?yt[D.name]:T}function f(T){return T.forEach(D=>{D.type&&(D.view=D.type)}),r.value=T.filter(D=>D.type==="pin"),T.filter(D=>D.type!=="pin")}const h=e.computed(()=>{let T;return n.panels&&n.panels.length>0?T=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(T=n.data.filter(w=>w.type.includes("tabs"))[0]?.items),In(T,12)}),x=e.computed(()=>a.value);function k(){i||(i=!0)}const y=e.computed(()=>{let T;return n.panels&&n.panels.length>0?T=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(T=n.data),In(T,12)}),S=e.computed(()=>({[`view-${n.view}`]:!0}));function E(T,D){if(!T||typeof D!="string"||!D)return{found:!1,value:void 0};const w=D.split(".");let j=T;for(const se of w){if(j==null||typeof j!="object"&&!Array.isArray(j))return{found:!1,value:void 0};if(!(se in j))return{found:!1,value:void 0};j=j[se]}return{found:!0,value:j}}const F=T=>{const D={...T};return Object.entries(D).forEach(([w,j])=>{if(w!=="props"&&typeof j=="string"){const se=E(n.data,j);se.found&&(D[w]=se.value)}}),T.props&&typeof T.props=="object"&&Object.entries(T.props).forEach(([w,j])=>{if(typeof j=="string"){const se=E(n.data,j);D[w]=se.found?se.value:j}else D[w]=j}),delete D.props,n.data&&(D.data=n.data),D};function I(T){const D=["col-span-12"],w=pr(T.col);return w.length&&D.push(...w),D}const g=e.ref([]),N=e.ref([]),M=e.ref([]);function A(T,D){T&&T instanceof HTMLElement&&(g.value[D]=T)}function v(){N.value=g.value.map(T=>T.offsetWidth),M.value=g.value.map(T=>T.offsetLeft)}function L(){if(typeof window>"u")return null;const T=x.value;if(!T)return null;const w=new URL(window.location.href).searchParams.get(T);if(w===null)return null;const j=Number.parseInt(w,10);return Number.isNaN(j)?null:j}function R(T){if(typeof window>"u")return;const D=x.value;if(!D||!i)return;const w=new URL(window.location.href);T<=0?w.searchParams.delete(D):w.searchParams.set(D,String(T));const j=window.history.state??{};window.history.replaceState(j,document.title,w)}function z(){if(l||!h.value.length)return;k();const T=L();if(T===null)return;const D=Math.min(Math.max(T,0),h.value.length-1);D!==T&&R(D),D!==s.value&&(s.value=D),l=!0}function Z(){l=!1,z()}let W=null;return e.onMounted(()=>{e.nextTick(()=>{z(),v()}),typeof window<"u"&&window.addEventListener("popstate",Z),W=new ResizeObserver(()=>v()),W.observe(document.body)}),e.onBeforeUnmount(()=>{W?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",Z)}),e.watch(s,T=>{e.nextTick(()=>{v()}),R(T)}),e.watch(h,()=>{l=!1,z()}),(T,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.classWrapper||S.value)},[e.createElementVNode("div",Kp,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",Gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(w,j)=>(e.openBlock(),e.createElementBlock("div",{key:w.name||j,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,Zp)):w.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(w.component,w)),e.mergeProps({key:1,ref_for:!0},w.component==="Card"?w:F(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])},[N.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:N.value[s.value]+"px",left:M.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(w,j)=>(e.openBlock(),e.createElementBlock("button",{key:w.name||j,ref_for:!0,ref:se=>A(se,j),onClick:se=>s.value=j,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===j?"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 ${j+1}`),11,Jp))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([t.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(w,j)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:w.name||j,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===j?"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,Yp)):T.$slots[`tab-${j}`]?e.renderSlot(T.$slots,`tab-${j}`,{key:1,item:w,data:t.data}):w.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Yt),e.mergeProps({key:2,ref_for:!0},F(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(u(w.component||w.name,w)),e.mergeProps({key:3,ref_for:!0},w.component==="Card"?w:F(w),{styling:t.styling,id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(T.$slots,w.slot||`tab-${j}`,{key:4,item:w,data:t.data})],2)),[[e.vShow,s.value===j]])),128))],2)],2)):t.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",Xp,[e.createElementVNode("div",Qp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(w,j)=>(e.openBlock(),e.createElementBlock("button",{key:w.name||j,onClick:se=>s.value=j,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===j?"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 ${j+1}`)+" ",1),s.value===j?(e.openBlock(),e.createElementBlock("span",eu,[...D[0]||(D[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,Vp))),128))]),e.createElementVNode("div",tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(w,j)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:w.name||j,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===j?"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,nu)):T.$slots[`tab-${j}`]?e.renderSlot(T.$slots,`tab-${j}`,{key:1,item:w,data:t.data}):w.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Yt),e.mergeProps({key:2,ref_for:!0},F(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(u(w.component||w.name,w)),e.mergeProps({key:3,ref_for:!0},w.component==="Card"?w:F(w),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(T.$slots,w.slot||`tab-${j}`,{key:4,item:w,data:t.data})],2)),[[e.vShow,s.value===j]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",ou,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(w,j)=>(e.openBlock(),e.createElementBlock("div",{key:w.name||w.component||j,class:e.normalizeClass(I(w))},[T.$slots[`panel-${j}`]?e.renderSlot(T.$slots,`panel-${j}`,{key:0,item:w,data:t.data}):w.items||w.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Yt),e.mergeProps({key:1,ref_for:!0},F(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(u(w.component,w)),e.mergeProps({key:2,ref_for:!0},F(w),{class:["w-full h-auto",[t.styling?.classItem]],styling:t.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",su,[e.renderSlot(T.$slots,w.slot||`panel-${j}`,{item:w,data:t.data})]))],2))),128))])],2))],2)])],2))}}),ru=["onClick"],ur=ot(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(Nr),{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(Mn),{class:"h-4 w-4"})],8,ru)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);Xt.install=function(t){t.component("vs-widget-file",on),t.component("vs-widget-comments",tn),t.component("vs-widget-history",nn),t.component("vs-widget-gallery",sn),t.component("vs-widget-map",dn),t.component("vs-group-interface",Ln),t.component("CommentsWidget",tn),t.component("HistoryWidget",nn),t.component("GalleryWidget",sn),t.component("FilesWidget",on),t.component("MapWidget",dn),t.component("Card",Xt),t.component("CardItem",Yt),t.component("DescriptionListWidget",Pn),t.component("CopyNotification",ur),t.component("GroupInterfaceWidget",Ln)},he.Card=Xt,he.CardItem=Yt,he.CommentsWidget=tn,he.CopyNotification=ur,he.DescriptionListWidget=Pn,he.FilesWidget=on,he.GalleryWidget=sn,he.GroupInterfaceWidget=Ln,he.HistoryWidget=nn,he.MapWidget=dn,he.TableWidget=cr,he.default=Xt,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(me,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):(me=typeof globalThis<"u"?globalThis:me||self,e(me.WidgetLib={},me.Vue,me.OpenGISCore))})(this,(function(me,e,Ee){"use strict";function Er(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 wr=Er(e);const Mo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xr=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Nr=t=>{const n=xr(t);return n.charAt(0).toUpperCase()+n.slice(1)},Cr=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var nn={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 Sr=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>e.h("svg",{...nn,width:t||nn.width,height:t||nn.height,stroke:s||nn.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:Cr("lucide",...l?[`lucide-${Mo(Nr(l))}-icon`,`lucide-${Mo(l)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const ae=(t,n)=>(o,{slots:s})=>e.h(Sr,{...o,iconNode:n,name:t},s);const _r=ae("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 Br=ae("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Tr=ae("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 Ro=ae("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 $r=ae("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 xt=ae("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 Lr=ae("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 Ir=ae("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 Ar=ae("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 Dr=ae("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 Or=ae("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 Fo=ae("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 Mr=ae("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 Rr=ae("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 Po=ae("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Fr=ae("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 zo=ae("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 Pr=ae("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 zr=ae("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 On=ae("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 jr=ae("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 Mn=ae("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 Hr=ae("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 Rn=ae("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ur={class:"border-t pt-3 mt-4"},qr={class:"flex gap-2"},Wr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Kr={class:"flex-1 space-y-2"},Gr={class:"flex justify-between items-center"},Zr={class:"flex gap-2"},Jr=["disabled"],jo=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",Ur,[e.createElementVNode("div",qr,[e.createElementVNode("span",Wr,[e.createVNode(e.unref(Mn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Kr,[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",Gr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",Zr,[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(Rn),{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(zo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Jr)])])])])]))}}),Yr={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"},Xr=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",Yr,[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(zr),{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(On),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),Qr={class:"space-y-2"},Vr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ei={class:"flex-1 min-w-0 space-y-1 relative"},ti={class:"flex items-center gap-2"},ni={class:"font-medium text-xs"},oi={class:"text-xs text-gray-500"},si={key:0,class:"text-xs text-gray-700 leading-relaxed"},ri={class:"flex justify-between text-xs"},ii={class:"flex items-center gap-2"},li={key:0,class:"flex gap-2"},ai=["disabled"],ci={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},di=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),p=C=>{const w=new Date,R=Math.floor((w.getTime()-C.getTime())/(1e3*60*60));return R<1?`${Math.floor((w.getTime()-C.getTime())/6e4)}m`:R<24?`${R}h`:`${Math.floor(R/24)}d`},h=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},v=()=>{o("edit",s.comment.id,r.value),d.value=!1},k=(C,w)=>{o("like",C,w)},b=(C,w)=>{o("edit",C,w)};return(C,w)=>{const R=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",Qr,[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",Vr,[e.createVNode(e.unref(Mn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.createElementVNode("span",ni,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",oi,e.toDisplayString(p(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":w[0]||(w[0]=T=>r.value=T),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",si,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",ri,[e.createElementVNode("div",ii,[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:w[1]||(w[1]=T=>h())},[e.createVNode(e.unref(Ar),{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:w[2]||(w[2]=T=>c.value=!0)},[e.createVNode(e.unref(Fr),{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:w[3]||(w[3]=T=>a.value=!0)},[e.createVNode(e.unref($r),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",li,[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:w[4]||(w[4]=T=>d.value=!1)},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"}),w[11]||(w[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:w[5]||(w[5]=T=>v())},[e.createVNode(e.unref(zo),{class:"h-3 w-3 mr-1"}),w[12]||(w[12]=e.createTextVNode(" Send ",-1))],8,ai)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(Xr,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":w[6]||(w[6]=T=>a.value=T),onEdit:w[7]||(w[7]=T=>d.value=!0),onDelete:w[8]||(w[8]=T=>C.$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",ci,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,T=>(e.openBlock(),e.createBlock(R,{key:T.id,comment:T,isInside:!0,onDelete:g=>C.$emit("delete",T.id),onLike:k,onEdit:b},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(jo,{key:0,onSendComment:w[9]||(w[9]=T=>C.$emit("reply",t.comment?.id,T)),isReply:c.value,"onUpdate:isReply":w[10]||(w[10]=T=>c.value=T)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),fi=["id"],pi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},on=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 p=await fetch(`/api/widget/comment/${o.id}`).then(h=>h.json());r.value=p.rows.map(h=>({id:h.communication_id,author:h.username,text:h.body,createdAt:new Date(h.cdate)}))}r.value.length===0&&l();const i=async p=>{o.onAddComment?o.onAddComment(p):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:p})}),await l()),s("add",p)},a=(p,h)=>{o?.onLike?.(p,h),s("like",p,h)},c=(p,h)=>{o.onReply?.(p,h),s("reply",p,h)},d=async(p,h)=>{o.onEdit?o.onEdit(p,h):o.id&&(await fetch(`/api/widget/comment/${o.id}/${p}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:h})}),await l()),s("edit",p,h)},m=async p=>{o.onDelete?o.onDelete(p):o.id&&(await fetch(`/api/widget/comment/${o.id}/${p}`,{method:"DELETE"}),await l()),s("delete",p)};return(p,h)=>(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",pi,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,v=>(e.openBlock(),e.createBlock(di,{key:v.id,comment:v,onReply:c,onLike:a,onDelete:h[0]||(h[0]=k=>m(k)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(jo,{onSendComment:h[1]||(h[1]=v=>i(v))})],14,fi))}}),Ho=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:xt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Pr}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:jr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Dr}]]),ui={class:"mx-auto font-sans"},mi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},hi={class:"relative"},gi={class:"space-y-3"},yi={class:"flex-1 min-w-0 pb-2"},vi={class:"flex items-center gap-1.5 mb-1 mt-0.5"},bi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ki={class:"font-medium text-xs"},Ei={class:"text-xs text-gray-500"},wi={class:"space-y-1"},xi={class:"text-xs text-gray-700"},Ni={class:"capitalize mr-1"},Ci={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"},Si={key:0,class:"flex items-center gap-1 text-xs"},_i={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Bi={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},sn=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",ui,[t.title?(e.openBlock(),e.createElementBlock("h3",mi,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",hi,[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",gi,[(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(Ho).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ho).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",yi,[e.createElementVNode("div",vi,[e.createElementVNode("span",bi,[e.createVNode(e.unref(Mn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",ki,e.toDisplayString(i?.userName),1),e.createElementVNode("span",Ei,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",wi,[e.createElementVNode("div",xi,[e.createElementVNode("span",Ni,e.toDisplayString(i?.action),1),i?.entityId?(e.openBlock(),e.createElementBlock("span",Ci,e.toDisplayString(i?.entityId),1)):e.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(e.openBlock(),e.createElementBlock("div",Si,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",_i,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(Br),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Bi,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Ti={key:0,class:"text-xl font-semibold"},$i={class:"flex gap-1"},Li={key:0},Ii=["accept"],Ai={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"},Di=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",Ti,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",$i,[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(Mr),{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(Ir),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Li,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,40,Ii),e.createElementVNode("div",Ai,[e.createVNode(e.unref(Po),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),Fn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:xt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Lr,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Hr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:xt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:_r,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Fo,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Fo,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:xt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:xt,label:"PPT"}};function Uo(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function qo(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 Oi={class:"space-y-0.5"},Mi=["onClick"],Ri=["onClick"],Fi={class:"flex items-center gap-2"},Pi={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},zi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},ji={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Hi={class:"flex items-center gap-1"},Ui=["onClick"],qi=["onClick"],Wi=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Oi,[(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(Fn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Fn)[s?.ext]?.icon||e.unref(Fn).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",Fi,[e.createElementVNode("span",Pi,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,Ri),e.createElementVNode("div",zi,e.toDisplayString(e.unref(qo)(s.size)),1),e.createElementVNode("div",ji,e.toDisplayString(e.unref(Uo)(s.createdAt)),1),e.createElementVNode("div",Hi,[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(Ro),{class:"h-3 w-3"})],8,Ui),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(On),{class:"h-3 w-3"})],8,qi)])],8,Mi))),128))]))}}),Ki={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Gi=["onClick"],Zi={class:"space-y-2"},Ji={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},Yi=["src"],Xi={class:"space-y-1"},Qi=["title"],Vi={class:"text-xs text-gray-500 text-left"},el={class:"absolute top-2 right-1 flex items-center gap-1"},tl=["onClick"],nl=["onClick"],ol=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ki,[(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",Zi,[e.createElementVNode("div",Ji,[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,Yi)):(e.openBlock(),e.createBlock(e.unref(xt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Xi,[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,Qi),e.createElementVNode("p",Vi,e.toDisplayString(e.unref(Uo)(s.createdAt))+", "+e.toDisplayString(e.unref(qo)(s.size)),1)])]),e.createElementVNode("div",el,[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(Ro),{class:"h-3 w-3"})],8,tl),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(On),{class:"h-3 w-3"})],8,nl)])],8,Gi))),128))]))}}),sl={class:"mx-auto font-sans"},rl={key:1},rn=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 E=(o.format??[]).map(H=>typeof H=="string"?H.trim():H==null?"":String(H).trim()).filter(H=>H.length>0),I=[];return E.forEach(H=>{const U=H.toLowerCase(),G=U.indexOf("/"),Z=G>=0;let $,O=!1,x;if(Z){$=U;const se=U.slice(G+1);O=se==="*",!O&&se&&(x=`.${se.replace(/^\.+/,"")}`)}else x=U.startsWith(".")?U:`.${U.replace(/^\.+/,"")}`;const P=Z?$:x??"";P&&I.push({acceptValue:P,mime:$,wildcard:O,extension:x})}),I.length?I:null}),d=e.computed(()=>{const F=c.value;if(!F)return;const E=F.map(I=>I.acceptValue).filter(Boolean);return E.length?E.join(","):void 0}),m=F=>{if(!c.value)return!0;const E=F.type?.toLowerCase(),I=F.name?.toLowerCase();return c.value.some(H=>{if(H.mime){if(E){if(H.wildcard){const U=H.mime.split("/")[0];if(E.startsWith(`${U}/`))return!0}else if(E===H.mime)return!0}return!!(H.extension&&I?.endsWith(H.extension))}return!!(H.extension&&I?.endsWith(H.extension))})},p=n;a.value.length===0&&g();const h=(F,E)=>{r.value=E,s.value=!0},v=()=>{r.value&&(w(r.value),r.value=null,s.value=!1)},k=e.computed(()=>Array.isArray(a.value)?a.value.map(F=>F?.file_path):[]),b=F=>{const E=k.value.findIndex(I=>I===F.file_path);E!==-1&&(l.value=!0,i.value=E)},C=F=>{o.onAddFile?o.onAddFile(F):N(F),p("add",F)},w=F=>{o.onDelete?o.onDelete(F):M(F),p("delete",F)},R=F=>{const E=document.createElement("a");E.setAttribute("download",F?.uploaded_name||F?.name),E.href=F?.file_path||F?.path,E.click()},T=e.ref("list");async function g(){if(!o.id)return;const F=await fetch(`/api/widget/file/${o.id}`).then(E=>E.json());F.rows.forEach(E=>{E.timestamp=new Date(E.cdate),E.id=E.entity_id,E.entityType=E.entity_type,E.entityId=E.entity_id,E.entityType=E.entity_type,E.action=E.change_type,E.userId=E.change_user_id,E.userName=E.username,E.timestamp=new Date(E.cdate),E.description=E.username,E.status=E.username}),a.value=F.rows}const N=async F=>{const I=F.target?.files;if(!I||I.length===0)return;const H=Array.from(I),U=[],G=[];if(H.forEach(Z=>{m(Z)?U.push(Z):G.push(Z)}),G.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${G.map(Z=>Z.name).join(", ")}`),U.length!==0)try{await Promise.all(U.map(async Z=>{const $=new FormData;$.append("file",Z);const O=`/api/widget/file/${o.id}`,x=await fetch(O,{method:"POST",body:$});if(!x.ok)throw new Error(`HTTP error! status: ${x.status}`);return Z})),await g()}catch(Z){console.error("Помилка при завантаженні файлів:",Z)}},M=async F=>{try{await fetch(`/api/widget/file/${o.id}/${F}`,{method:"DELETE"}),await g()}catch(E){console.error(E)}};return(F,E)=>{const I=e.resolveComponent("MessageBox"),H=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",sl,[e.createVNode(Di,{modelValue:T.value,"onUpdate:modelValue":E[0]||(E[0]=U=>T.value=U),title:o.title,onOnAddFile:E[1]||(E[1]=U=>C(U)),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"})},[T.value==="list"?(e.openBlock(),e.createBlock(Wi,{key:0,onDelete:h,onDownload:R,onOpenLightbox:E[2]||(E[2]=U=>b(U)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),T.value==="grid"?(e.openBlock(),e.createBlock(ol,{key:1,onDelete:h,onDownload:R,onOpenLightbox:E[3]||(E[3]=U=>b(U)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",rl,[...E[6]||(E[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),e.createVNode(I,{modelValue:s.value,"onUpdate:modelValue":E[4]||(E[4]=U=>s.value=U),onConfirm:v,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(H,{modelValue:l.value,"onUpdate:modelValue":E[5]||(E[5]=U=>l.value=U),images:k.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),il={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},ll=["onClick"],al={key:0,rel:"noreferrer",class:"relative block h-full w-full"},cl=["src"],dl={key:0,class:"thumb-cover"},fl=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",il,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(p,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+h,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:h,onClick:e.withModifiers(v=>a(p),["stop"])},[h<5?(e.openBlock(),e.createElementBlock("div",al,[e.createElementVNode("img",{src:`/file/resize?filepath=${p?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",h===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,cl),h===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",dl," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,ll))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-t.items.length),p=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+p,class:e.normalizeClass(["h-full w-full image"+(t.items.length+p-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=p=>s.value=p),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=p=>o("delete",p))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),pl={key:0,class:"text-xl font-semibold"},ul={class:"flex gap-1"},ml=["accept"],hl={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"},gl=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",pl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ul,[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,ml),e.createElementVNode("div",hl,[e.createVNode(e.unref(Po),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),yl={class:"w-full mx-auto font-sans",ref:"containerRef"},vl={key:1},ln=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=g=>{if(!g)return[];const N=Array.isArray(g)?g:g.split(",");return Array.from(new Set(N.map(M=>M.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],l=e.computed(()=>{const g=s(o.format);return g.length>0?g:void 0}),i=e.computed(()=>{const g=l.value;return!g||g.length===0?"image/*":g.map(N=>N.startsWith(".")?N:`.${N}`).join(",")}),a=g=>g?.split(".").pop()?.toLowerCase()??"",c=g=>{const N=g?.toLowerCase();return!!N&&!!l.value&&l.value.includes(N)},d=g=>{const N=g?.toLowerCase();return!!N&&r.includes(N)},m=g=>{const N=g.type?.toLowerCase(),M=g.ext?.toLowerCase();return N?.startsWith("image/")?l.value?c(M):!0:M?l.value?c(M):d(M):!1},p=g=>{if(!g.type?.toLowerCase()?.startsWith("image/"))return!1;if(!l.value)return!0;const M=a(g.name);return c(M)},h=g=>g.filter(m),v=e.ref(h(o.items??[])),k=n;v.value.length===0&&R();const b=g=>{o.onAddImage?o.onAddImage(g):w(g),k("add",g)},C=g=>{const N=v.value.find(M=>M.file_path===g)?.file_id;N&&(o.onDelete?o.onDelete(N):T(N))},w=async g=>{const N=g.target;if(!N?.files||N.files.length===0)return;const M=Array.from(N.files),F=M.filter(I=>p(I)),E=l.value?.join(", ")??"image/*";if(F.length===0){console.warn(`Допустимі формати: ${E}. Завантажте зображення дозволеного типу.`);return}F.length!==M.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${E}.`);try{await Promise.all(F.map(async I=>{const H=new FormData;H.append("file",I);const U=`/api/widget/file/${o.id}`,G=await fetch(U,{method:"POST",body:H});if(!G.ok)throw new Error(`HTTP error! status: ${G.status}`);return I})),await R()}catch(I){console.error("Помилка при завантаженні файлів:",I)}};async function R(){if(!o.id)return;const g=await fetch(`/api/widget/file/${o.id}`).then(N=>N.json());v.value=h(g.rows)}const T=async g=>{try{await fetch(`/api/widget/file/${o.id}/${g}`,{method:"DELETE"}),await R()}catch(N){console.error(N)}};return(g,N)=>(e.openBlock(),e.createElementBlock("div",yl,[e.createVNode(gl,{title:t.title,accept:i.value,onOnAddImage:N[0]||(N[0]=M=>b(M))},null,8,["title","accept"]),v.value.length>0?(e.openBlock(),e.createBlock(fl,{key:0,items:v.value,onDelete:N[1]||(N[1]=M=>C(M))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",vl,[...N[2]||(N[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),bl={class:"text-value"},kl={class:"text-sm text-gray-900"},El=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",bl,[e.createElementVNode("span",kl,e.toDisplayString(o.value),1)]))}}),Ve=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},wl=Ve(El,[["__scopeId","data-v-34a76c89"]]),xl={class:"link-value"},Nl=["href"],Cl=Ve(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",xl,[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,Nl)]))}}),[["__scopeId","data-v-932f028c"]]),Sl={class:"date-value"},_l={class:"text-sm text-gray-900"},Bl=Ve(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",Sl,[e.createElementVNode("span",_l,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),Tl={class:"status-value"},$l={key:0,class:"mr-1"},Ll=Ve(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",Tl,[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",$l,[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"]]),Il={class:"custom-value"},Al={class:"text-sm text-gray-900"},Dl=Ve(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Il,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Al,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),Ol=["id"],Ml={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Rl={key:1,class:"overflow-x-auto"},Fl={class:"min-w-full divide-y divide-gray-200"},Pl={class:"bg-white divide-y divide-gray-200"},zl={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},jl={class:"flex items-center gap-2"},Hl=["title"],Ul={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},ql={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Wl={class:"flex items-start gap-3"},Kl={key:0,class:"flex-shrink-0"},Gl={class:"flex-1 min-w-0"},Zl={class:"flex items-center gap-2 mb-2"},Jl={class:"text-sm font-medium text-gray-900"},Yl=["title"],Xl={key:3,class:"overflow-x-auto"},Ql={class:"min-w-full divide-y divide-gray-200"},Vl={class:"bg-white divide-y divide-gray-200"},ea={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ta={class:"flex items-center gap-2"},na=["title"],oa={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Pn=Ve(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return Cl;case"date":return Bl;case"status":return Ll;case"custom":return Dl;default:return wl}};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",Ml,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",Rl,[e.createElementVNode("table",Fl,[e.createElementVNode("tbody",Pl,[(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",zl,[e.createElementVNode("div",jl,[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,Hl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Ul,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",ql,[(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",Wl,[r.icon?(e.openBlock(),e.createElementBlock("div",Kl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Gl,[e.createElementVNode("div",Zl,[e.createElementVNode("h4",Jl,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,Yl)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Xl,[e.createElementVNode("table",Ql,[e.createElementVNode("tbody",Vl,[(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",ea,[e.createElementVNode("div",ta,[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,na)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",oa,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Ol))}}),[["__scopeId","data-v-106790ef"]]);function Wo(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 sa(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 ra="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let zn=null;function ia(){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 la(){return zn||(zn=Wo(ra).then(()=>{const t=ia();if(!t)throw new Error("IMask is not available after loading the script");return t})),zn}function aa(){return typeof window>"u"?"":window.location?.origin??""}function Ko(){if(!(typeof window>"u"))return window.maplibregl}const Go=Symbol("vs-widget-map");function jn(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function ca(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 da(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function Hn(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=aa(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function fa(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 pa(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function an(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 Zo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function ua(t){const n=t?.color??Zo[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)}):Zo.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 Mt="map-highlight-source",ma="map-highlight-fill",ha="map-highlight-line";function ga(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function Jo(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function ya(){return sa("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Wo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Ko()}function cn(t){const n=e.inject(Go,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,p=null;const h=f=>{f&&(o.value?o.value.setStyle(f):m=f)},v=()=>{r.value.overlays=i.value.map(f=>({id:f.id,name:f.config.name,visible:f.visible}))},k=f=>{const _=Array.isArray(f)?f:[];l.value=_,_.some(j=>j.key===r.value.selectedBasemap)||(r.value.selectedBasemap=_[0]?.key??"")},b=f=>{f&&i.value.forEach(_=>{_.layerIds.forEach(D=>{f.getLayer(D)&&f.removeLayer(D)}),f.getSource(_.sourceId)&&f.removeSource(_.sourceId),_.layerIds=[]})},C=()=>{const f=o.value;!f||typeof f.isStyleLoaded!="function"||!f.isStyleLoaded()||(i.value.forEach(_=>{w(f,_)}),U())},w=(f,_)=>{const D=fa(_.config);D==="vtile"?T(f,_):D==="raster"&&R(f,_)},R=(f,_)=>{const D=_.config,j=_.sourceId,J=Hn(D.url);if(!J)return;f.getSource(j)||f.addSource(j,{type:"raster",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const K=`${_.id}-raster`;f.getLayer(K)||f.addLayer({id:K,type:"raster",source:j,layout:{visibility:_.visible?"visible":"none"}}),_.layerIds=[K],g(f,_)},T=(f,_)=>{const D=_.config,j=_.sourceId,J=Hn(D.url);if(!J)return;f.getSource(j)||f.addSource(j,{type:"vector",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const K=D.style??{},le=ua(K),ge=[],re={visibility:_.visible?"visible":"none"},We=pa(D),Xe={source:j,layout:re};if(We&&(Xe["source-layer"]=We),(K.type??"polygon").toLowerCase()==="point"){const He=`${_.id}-circle`;f.getLayer(He)||f.addLayer({id:He,type:"circle",...Xe,paint:{"circle-color":le,"circle-opacity":K.opacity??1,"circle-radius":K.radius??K.width??3,"circle-stroke-color":K.stroke??K.color??"#ffffff","circle-stroke-width":K.width??1}}),ge.push(He);const Ke=K.text??K.label;if(Ke){const yt=`${_.id}-symbol`,vt=an(K.textSize)??10,Qt=K.textHaloColor??K.stroke??"#ffffff",Ot=an(K.textHaloWidth)??1,Qe=an(K.textZoom??K.pointZoom),bt={"text-color":K.textColor??"#000000","text-halo-color":Qt,"text-halo-width":Ot},at={id:yt,type:"symbol",...Xe,layout:{"text-field":["coalesce",["get",Ke],""],"text-size":vt,"text-anchor":"top"},paint:bt};Qe!=null&&(at.minzoom=Qe),f.getLayer(yt)||f.addLayer(at),ge.push(yt)}}else{const He=`${_.id}-fill`;f.getLayer(He)||f.addLayer({id:He,type:"fill",...Xe,paint:{"fill-color":le,"fill-opacity":K.opacity??.5,"fill-outline-color":K.stroke??K.color??"#0ea5e9"}}),ge.push(He);const Ke=`${_.id}-line`;f.getLayer(Ke)||f.addLayer({id:Ke,type:"line",...Xe,paint:{"line-color":K.stroke??K.color??"#0b74c4","line-width":an(K.width??K.border)??1,"line-opacity":K.opacity??1}}),ge.push(Ke)}_.layerIds=ge,g(f,_)},g=(f,_)=>{const D=_.visible?"visible":"none";_.layerIds.forEach(j=>{f.getLayer(j)&&f.setLayoutProperty(j,"visibility",D)})},N=f=>{const _=Array.isArray(f)?f:[];b(o.value??void 0),d.value=null,$();const D=_.map((j,J)=>{if(!j)return null;const K=Hn(j.url);if(!K)return null;const le=j.id!=null?String(j.id):`overlay-${J}`;return{id:le,config:{...j,id:le,url:K},visible:!1,sourceId:`${le}-source`,layerIds:[]}}).filter(j=>!!j);i.value=D,v(),C()},M=(f,_)=>{const D=i.value.find(J=>J.id===f);if(!D)return;D.visible=_,v();const j=o.value;if(!(!j||typeof j.isStyleLoaded!="function"||!j.isStyleLoaded())){if(!D.layerIds.length){w(j,D);return}g(j,D)}},F=()=>{a.value&&(a.value.remove(),a.value=null)},E=(f,_={})=>!Array.isArray(f.popup)||!f.popup.length?[]:f.popup.map(D=>({label:D.label??D.field,value:jn(_?.[D.field])})).filter(D=>D.label&&D.value!==void 0),I=f=>{const _=o.value;if(!_||!f?.point)return;const D=_.queryRenderedFeatures(f.point);for(const j of D){const J=j.layer?.id??j.sourceLayer;if(!J)continue;const K=qe(J);if(!K)continue;const le=E(K,j.properties??j.layer?.properties??{});if(!le.length)continue;const ge=ca(le),re=Ko();if(!re)return;const We=f.lngLat;if(c.value===J&&a.value){a.value.setLngLat(We),a.value.setHTML(ge);return}c.value=J,F(),a.value=new re.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(We).setHTML(ge).addTo(_);return}c.value=null,F()},H=()=>{c.value=null,F()},U=()=>{const f=o.value;!f||typeof f.isStyleLoaded!="function"||!f.isStyleLoaded()||f.getSource(Mt)||(f.addSource(Mt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),f.addLayer({id:ma,type:"fill",source:Mt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),f.addLayer({id:ha,type:"line",source:Mt,paint:{"line-color":"#1d4ed8","line-width":2}}))},G=f=>{const _=o.value;if(!_||typeof _.isStyleLoaded!="function"||!_.isStyleLoaded())return;U();const D=_.getSource(Mt);if(!(!D||typeof D.setData!="function")){if(!f){D.setData({type:"FeatureCollection",features:[]});return}D.setData({type:"FeatureCollection",features:[f]})}},Z=f=>{const _=ga(f);_&&G(_)},$=()=>{G(null)},O=()=>{d.value=null,$()},x=f=>{if(f)return typeof f=="string"?f:f.field??f.name??f.key??f.label},P=f=>{if(f)return typeof f=="string"?f:f.label??f.title??f.field??f.name},se=(f,_)=>!f||!f.length?[]:f.map(D=>{const j=x(D);if(!j)return null;const J=P(D),K=jn(_?.[j]);return!J||K===""?null:{label:J,value:K}}).filter(D=>!!D),De=(f,_)=>!Array.isArray(f)||!f.length?[]:f.map(D=>{if(!D?.name)return null;const j=D.title??D.name,J=jn(_?.[D.name]);return!j||J===""?null:{label:j,value:J}}).filter(D=>!!D),fe=(f,_)=>!Array.isArray(f)||!f.length?[]:f.map(j=>{const J=Jo(j.url,_),K=j.label??j.url;return J?{label:K,url:J,target:j.target}:null}).filter(j=>!!j),$e=async(f,_)=>{const D=Jo(f,_);if(!D)return null;try{const j=await fetch(D);return j.ok?await j.json():null}catch{return null}},Ne=async(f,_)=>{const D=_.properties??_.layer?.properties??{},j=se(f.card?.rows,D);let J,K;if(f.card?.api){const re=await $e(f.card.api,D);re&&(typeof re.html=="string"&&re.html.trim()&&(J=re.html),Array.isArray(re.columns)&&re.columns.length&&(K=re.columns))}let le=j;if(!J&&K){const re=De(K,D);re.length&&(le=re)}if(!le.length&&!J)return null;const ge=fe(f.card?.actions,D);return{title:D?.name??f.name,rows:le,html:J,actions:ge.length?ge:void 0}},ze=async f=>{const _=o.value;if(!_||!f?.point)return;const D=_.queryRenderedFeatures(f.point);for(const j of D){const J=j.layer?.id??j.sourceLayer;if(!J)continue;const K=qe(J);if(!K||!K.card)continue;const le=await Ne(K,j);if(le){d.value=le,Z(j);return}}d.value=null,$()},lt=()=>{const f=o.value;f&&(f.on("mousemove",I),f.on("mouseleave",H),f.on("click",ze))},je=()=>{const f=o.value;f&&(f.off("mousemove",I),f.off("mouseleave",H),f.off("click",ze),F(),$())},qe=f=>{if(f)return i.value.find(_=>_.layerIds.includes(f))?.config},q=async()=>{const f=await ya(),_=da(t.container);if(!f||!_)return;const D={container:_,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 f.Map(D);const j=()=>{C()};p=j,o.value.on("style.load",j),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),C(),lt()})};e.onMounted(q),e.onBeforeUnmount(()=>{je(),o.value&&p&&o.value.off("style.load",p),b(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const W={map:o,ready:s,setStyle:h,flyTo:f=>o.value?.flyTo(f),fitBounds:(f,_)=>o.value?.fitBounds(f,_),setCenter:f=>o.value?.setCenter(f),setZoom:f=>o.value?.setZoom(f),addControl:(f,_)=>o.value?.addControl(f,_),removeControl:f=>o.value?.removeControl(f),on:(f,..._)=>o.value?.on(f,..._),off:(f,..._)=>o.value?.off(f,..._),project:f=>o.value?.project(f),unproject:f=>o.value?.unproject(f),state:r,basemapOptions:l,setOverlays:N,toggleOverlay:M,getOverlayConfig:qe,selectedCard:d,setBasemapOptions:k,clearCard:O};return e.provide(Go,W),W}const va={class:"map-base-layer-menu"},ba={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},ka={class:"flex items-center justify-between p-2 border-b"},Ea={class:"p-2 border-b"},wa={class:"flex items-center"},xa=["value","checked","onChange"],Na={class:"ml-2"},Ca={class:"p-2"},Sa={class:"flex items-center"},_a=["checked"],Ba=["checked","onChange"],Ta={class:"ml-2"},$a=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=cn(),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),p=e.computed(()=>n.value.overlays??[]),h=b=>{s?.(b)},v=()=>{r?.(!m.value)},k=b=>{l?.(b.id,!b.visible)};return(b,C)=>(e.openBlock(),e.createElementBlock("div",va,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:C[0]||(C[0]=w=>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",ba,[e.createElementVNode("div",ka,[C[3]||(C[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:C[1]||(C[1]=w=>i.value=!1)},[...C[2]||(C[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",Ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.key},[e.createElementVNode("label",wa,[e.createElementVNode("input",{type:"radio",name:a,value:w.key,checked:d.value===w.key,onChange:R=>h(w.key)},null,40,xa),e.createElementVNode("span",Na,e.toDisplayString(w.name||w.key),1)])]))),128))]),e.createElementVNode("div",Ca,[e.createElementVNode("label",Sa,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:v},null,40,_a),C[4]||(C[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,w=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:w.id},[e.createElementVNode("input",{type:"checkbox",checked:w.visible,onChange:R=>k(w)},null,40,Ba),e.createElementVNode("span",Ta,e.toDisplayString(w.name||w.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),La={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]"},Ia={class:"leading-tight"},Aa=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",La,[(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",Ia,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Da={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]"},Oa={class:"font-mono"},Ma=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Da,[e.createElementVNode("span",Oa,e.toDisplayString(t.coordinates),1)]))}}),Ra={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Fa=["title"],Pa={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"},za=["onClick"],ja=["placeholder"],Ha={class:"divide-y divide-gray-100"},Ua=["onClick"],qa=600,Wa="0000000000:00:000:0000",Ka=30,Ga=8,Za="https://data.softpro.ua/api-user/gis-url-proxy",Ja="https://geo.rv.ua/api-user/dzk.api",Ya="https://nominatim.openstreetmap.org/search",Xa=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=cn(),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 q=n.config?.tools?.filter(W=>i.includes(W));return q&&q.length?q:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,q=>{q.includes(d.value)||(d.value=q[0])});const m=e.ref(""),p=e.ref(!1),h=e.ref(null),v=e.ref(null),k=e.ref(null),b=e.ref([]),C=e.ref(null),w=e.computed(()=>d.value==="address"&&b.value.length>0);let R=null,T=null,g=null;const N=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function M(){if(!v.value)return;const q=v.value.getBoundingClientRect(),W=q.width+Ka,f=q.left+window.scrollX,_=q.bottom+window.scrollY+Ga;N.left=`${f}px`,N.top=`${_}px`,N.width=`${W}px`,N.display="block"}const F=()=>{w.value&&M()};function E(){R&&(clearTimeout(R),R=null)}function I(){T?.destroy(),T=null}async function H(){if(d.value!=="parcel")return;const q=k.value;if(!q)return;const W=await la();d.value==="parcel"&&(I(),T=W(q,{mask:Wa,lazy:!1,placeholderChar:"_"}),T.on("accept",()=>{m.value=T?.value??""}))}function U(){return(T?.value??m.value).trim()}function G(){if(!(typeof window>"u"))return window.maplibregl}function Z(q){const W=o.map.value;if(!W)return;const f=G();if(f){if(g){g.setLngLat([q.lat,q.lng]);return}g=new f.Marker({color:"#2563eb"}).setLngLat([q.lat,q.lng]).addTo(W)}}function $(){g&&(g.remove(),g=null)}e.watch(d,q=>{m.value="",p.value=!1,b.value=[],E(),q==="parcel"?e.nextTick(()=>{H().catch(W=>{Ee.notify({type:"error",title:"Маска кадастру",message:W?.message||"Не вдалося ініціалізувати маску"})})}):I()}),e.watch(w,q=>{q?e.nextTick(()=>{M()}):N.display="none"}),e.watch(m,q=>{if(d.value!=="address"){b.value=[],E();return}if(!q.trim()){b.value=[],E();return}E(),R=window.setTimeout(()=>{Ne(q).catch(W=>{const f=W?.message||"Помилка пошуку адреси";Ee.notify({type:"error",title:"Пошук адреси",message:f})})},qa)});function O(q){d.value=q}function x(q){const W=q.target;if(p.value){const f=h.value;f&&!f.contains(W)&&(p.value=!1)}if(w.value){const f=C.value;f&&!f.contains(W)&&(b.value=[])}}e.onMounted(()=>{window.addEventListener("click",x,!0),window.addEventListener("scroll",F,!0),window.addEventListener("resize",F),d.value==="parcel"&&e.nextTick(()=>{H().catch(q=>{Ee.notify({type:"error",title:"Маска кадастру",message:q?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",x,!0),window.removeEventListener("scroll",F,!0),window.removeEventListener("resize",F),E(),I(),$()});function P(q){return q==="xy"?"Координати":q==="parcel"?"Кадастр":"Адреси"}function se(q){const W=q.replace(/[,]+/g," ").trim();if(!W)return null;const f=W.split(/\s+/).filter(Boolean);if(f.length<2)return null;console.log(f);const _=f.slice(0,2).map(Number);if(console.log(_),!_.every(re=>Number.isFinite(re)))return null;let[D,j]=_,J=D,K=j;const le=re=>Math.abs(re)<=90,ge=re=>Math.abs(re)<=180;if(!le(J)||!ge(K))if(le(K)&&ge(J))J=D,K=j;else return null;return console.log(J,K),{lat:J,lng:K}}function De(q){return(q?.items||[]).map((f,_)=>{const D=Number(f?.position?.lat),j=Number(f?.position?.lng);return!Number.isFinite(D)||!Number.isFinite(j)?null:{id:String(f?.id??_),title:f?.title||f?.address?.label||"Знайдений обʼєкт",lat:D,lng:j}}).filter(f=>!!f)}function fe(q){const W=q?.result||q?.data||q;if(!W)return[];const f=W.geom_centroid;if(!f||!Array.isArray(f.coordinates))return[];const[_,D]=f.coordinates;return!Number.isFinite(_)||!Number.isFinite(D)?[]:[{id:"parcel",title:W.cadnum||W.cad_num||"Земельна ділянка",lat:_,lng:D}]}function $e(q){return(Array.isArray(q?.features)?q.features:[]).map((f,_)=>{const D=f?.geometry?.coordinates,j=Number(D?.[0]),J=Number(D?.[1]);if(!Number.isFinite(j)||!Number.isFinite(J))return null;const K=f?.properties||{},le=K?.geocoding?.label||K?.display_name||K?.label||"Адреса";return{id:String(K?.geocoding?.place_id||K?.place_id||_),title:le,lat:j,lng:J}}).filter(f=>!!f)}async function Ne(q){b.value=[],E();const W=new URL(Ya);W.searchParams.set("format","geojson"),W.searchParams.set("q",q),W.searchParams.set("addressdetails","1"),W.searchParams.set("bounded","1");const f=r();f&&W.searchParams.set("viewbox",f);const _=await fetch(W.toString());if(!_.ok)throw new Error(`HTTP ${_.status}`);const D=await _.json(),j=$e(D);if(!j.length){Ee.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}b.value=j}function ze(q){je(q),b.value=[],m.value=""}function lt(q){const f=q.replace(/\s+/g,"").split(":");if(f.length!==4)return!1;const _=[10,2,3,4];return f.every((D,j)=>D.length===_[j]&&/^\d+$/.test(D))}function je(q){const W=n.config?.zoom??17;o.flyTo?.({center:[q.lat,q.lng],zoom:W}),Z(q)}async function qe(){const q=d.value==="parcel"?U():m.value.trim();if(q){if(d.value==="xy"){const W=se(q);if(console.log(W),!W){Ee.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}je(W),m.value="";return}if(d.value==="address"){try{await Ne(q)}catch(W){const f=W?.message||"Помилка пошуку адреси";Ee.notify({type:"error",title:"Пошук адреси",message:f})}return}try{const W=new URL(d.value==="here"?Za:Ja);if(d.value==="here")W.searchParams.set("searchtext",q);else{if(!lt(q)){Ee.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}W.searchParams.set("cad_num",q)}const f=await fetch(W.toString());if(!f.ok)throw new Error(`HTTP ${f.status}`);const _=await f.json(),D=d.value==="here"?De(_):fe(_);if(!D.length)Ee.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const j=D[0];je(j),d.value==="parcel"&&T&&(T.value=""),m.value=""}}catch(W){const f=W?.message||"Помилка пошуку";Ee.notify({type:"error",title:"Пошук",message:f})}}}return(q,W)=>(e.openBlock(),e.createElementBlock("div",Ra,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(qe,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:h,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:W[0]||(W[0]=f=>p.value=!p.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:P(d.value)},e.toDisplayString(P(d.value)),9,Fa),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":p.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...W[3]||(W[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),p.value?(e.openBlock(),e.createElementBlock("div",Pa,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,f=>(e.openBlock(),e.createElementBlock("li",{key:f,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:_=>O(f)},e.toDisplayString(P(f)),9,za))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:v,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":W[1]||(W[1]=f=>m.value=f),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":W[2]||(W[2]=f=>m.value=f),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,ja)),[[e.vModelText,m.value,void 0,{trim:!0}]]),W[4]||(W[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)),w.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:C,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(N)},[e.createElementVNode("ul",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,f=>(e.openBlock(),e.createElementBlock("li",{key:f.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:_=>ze(f)},e.toDisplayString(f.title),9,Ua))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),Qa={class:"map-center-control"},Va=["aria-label"],ec=e.defineComponent({directives:{tooltip:Ee.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=cn(),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[b,C]=k.slice(0,2).map(w=>Number(w));return Number.isNaN(b)||Number.isNaN(C)?null:[b,C]}if(k&&typeof k=="object"){const b=k,C=b.lng??b.lon??b.long??b.x,w=b.lat??b.y;if(C!=null&&w!=null){const R=Number(C),T=Number(w);if(!Number.isNaN(R)&&!Number.isNaN(T))return[R,T]}}if(typeof k=="string"){const b=k.split(",").map(C=>Number(C.trim()));if(b.length>=2&&b.every(C=>!Number.isNaN(C)))return[b[0],b[1]]}return null}e.watch(()=>n.center,k=>{const b=c(k);b&&(r.value=b)},{immediate:!0}),e.watch(()=>n.zoom,k=>{const b=Number(k);Number.isNaN(b)||(l.value=b)},{immediate:!0}),e.watch(()=>n.targetCenter,k=>{i.value=c(k)},{immediate:!0}),e.watch(()=>n.targetZoom,k=>{const b=Number(k);a.value=Number.isNaN(b)?null:b},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),m=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),p=e.computed(()=>!!i.value);e.onMounted(async()=>{const k=o.value;if(k){if(!r.value){const b=k.getCenter();r.value=[b.lng,b.lat]}l.value==null&&(l.value=k.getZoom())}});function h(){const k=o.value;if(!k)return;const b=r.value||(()=>{const w=k.getCenter();return[w.lng,w.lat]})(),C=l.value??k.getZoom();k.flyTo({center:b,zoom:C})}function v(){const k=o.value;if(!k||!i.value)return;const b=a.value??l.value??k.getZoom();k.flyTo({center:i.value,zoom:b})}return(k,b)=>{const C=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",Qa,[p.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(h,["stop"])},[e.createVNode(e.unref(Or),{class:"w-4 h-4"})])),[[C,"Центр мапи"]]),p.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(v,["stop"])},[e.createVNode(e.unref(Rr),{class:"w-4 h-4"})],8,Va)),[[C,d.value]]):e.createCommentVNode("",!0)])}}}),Yo=Ve(ec,[["__scopeId","data-v-bc627616"]]),tc={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},nc={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},oc=["aria-label"],sc={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)]"},rc={class:"text-slate-900 font-semibold mb-1"},ic=["innerHTML"],lc={key:1,class:"space-y-2"},ac={class:"text-gray-500"},cc={class:"font-medium text-slate-900"},dc={key:2,class:"mt-2 flex flex-col gap-2"},fc=["href","target"],dn="map-basemap-source",Un="map-basemap-layer",pc=20,Nt="map-katottg-geometry-source",fn="map-katottg-geometry-line",et="map-geometry-source",Ct="map-geometry-fill",St="map-geometry-line",_t="map-geometry-circle",pn=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 A=Number(u[0]),z=Number(u[1]);return!Number.isFinite(A)||!Number.isFinite(z)?void 0:[A,z]}if(typeof u=="object"){const A=u,z=A.lng??A.lon??A.long??A.x,X=A.lat??A.y;if(z!=null&&X!=null){const Ce=Number(z),Ge=Number(X);if(Number.isFinite(Ce)&&Number.isFinite(Ge))return[Ce,Ge]}}}}function a(u){if(u==null)return;const A=Number(u);return Number.isFinite(A)?A: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((z,X)=>{const Ce=typeof z.url=="string"?z.url.trim():"";return Ce?{key:(z.key??z.name??`base-${X}`).trim()||`base-${X}`,url:Ce,name:z.name??z.key??`Layer ${X+1}`}:null}).filter(z=>!!z)),m=i(l.center),p=a(l.zoom),h=Oo(n.geom),v=br(h),k=v?[(v[0]+v[2])/2,(v[1]+v[3])/2]:void 0,b=e.ref(null),C=e.computed(()=>i(n.center)??null),w=e.computed(()=>C.value??m??null),R=cn({container:b,center:k??w.value??void 0,zoom:n.zoom??p}),{map:T,setCenter:g,setZoom:N,state:M,getOverlayConfig:F,selectedCard:E,setBasemapOptions:I,clearCard:H,addControl:U,removeControl:G,ready:Z}=R,$=e.computed({get:()=>M.value.selectedBasemap??"",set:u=>{M.value.selectedBasemap=u}}),O=e.computed({get:()=>M.value.geometryVisible??!0,set:u=>{M.value.geometryVisible=u}}),x=e.computed(()=>{const u=n.height;return{height:typeof u=="number"?`${u}px`:String(u)}}),P=e.ref(!1),se=e.computed(()=>P.value?"fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),De=e.computed(()=>{const u=["w-full","h-full"];return P.value||u.push(`min-h-[${x.value.height}]`),u.join(" ")}),fe=e.computed(()=>E.value),$e=()=>H?.(),Ne=e.ref(k??w.value??null),ze=e.ref(n.zoom??p??null),lt=e.ref(w.value);e.watch(w,u=>{lt.value=u},{immediate:!0});const je=e.computed(()=>lt.value??null),qe=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof ze.value=="number"?ze.value:pc),q=["home","fullscreen","scale","position"],W=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?q:n.tools.filter(u=>q.includes(u))),f=u=>W.value.includes(u);e.watch([T,Z],([u,A])=>{if(!(!u||!A)){if(!Ne.value){const z=u.getCenter();Ne.value=[z.lng,z.lat]}ze.value==null&&(ze.value=u.getZoom())}},{immediate:!0});const _=e.ref(null),D=e.ref(""),j=e.ref(null),J=u=>{if(!u)return"";const A=Number(u.lat??u[1]),z=Number(u.lng??u[0]);return!Number.isFinite(A)||!Number.isFinite(z)?"":`${z.toFixed(5)}, ${A.toFixed(5)}`},K=u=>{u?.lngLat&&(D.value=J(u.lngLat))},le=()=>{D.value=""},ge=u=>{u&&(u.on("mousemove",K),u.on("mouseleave",le),j.value=u)},re=u=>{u&&(u.off("mousemove",K),u.off("mouseleave",le),j.value=null)},We=e.computed(()=>f("scale"));e.watch([T,Z],([u,A],[z])=>{z&&re(z),!(!u||!A)&&ge(u)},{immediate:!0}),e.watch([T,Z,We],([u,A,z])=>{if(_.value&&G&&(G(_.value),_.value=null),!u||!A||!z)return;const X=window?.maplibregl;X&&(_.value=new X.ScaleControl({unit:"metric"}),U?.(_.value,"bottom-left"))},{immediate:!0});const Xe=e.computed(()=>Array.isArray(n.legend)?n.legend.map((u,A)=>{const z=typeof u?.color=="string"?u.color.trim():"",X=typeof u?.label=="string"?u.label.trim():"";return!z||!X?null:{color:z,label:X,key:`${X}-${A}`}}).filter(u=>!!u):[]),Xt=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(I?.(u),!u.length){$.value="";return}u.some(A=>A.key===$.value)||($.value=u[0].key)},{immediate:!0});const He=()=>typeof window>"u"?"":window.location?.origin??"",Ke=u=>{if(!u)return"";const A=u.trim();if(!A)return"";const X=A.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!X)return"";if(/^https?:\/\//i.test(X))return X;const Ce=He(),Ge=X.replace(/^\/+/,"");return Ce?`${Ce}/${Ge}`:Ge?`/${Ge}`:""},yt=u=>{if(!u?.getStyle)return;const A=u.getStyle()??{},z=Array.isArray(A.layers)?A.layers:[];return z.length?z.find(Ce=>Ce.type!=="background")?.id??z[0]?.id:void 0},vt=u=>{u&&(u.getLayer(Un)&&u.removeLayer(Un),u.getSource(dn)&&u.removeSource(dn))},Qt=(u,A)=>{if(!u)return;const z=yt(u);u.addSource(dn,{type:"raster",tiles:[A],tileSize:256}),u.addLayer({id:Un,type:"raster",source:dn,layout:{visibility:"visible"}},z)},Ot=u=>{if(!u)return;const A=Ke(u.url);if(!A){Qe.value=null;return}Qe.value=A,vt(T.value),at()},Qe=e.ref(null),bt=u=>{if(!u||u.__pendingBasemapHooked)return;u.__pendingBasemapHooked=!0;const A=()=>{u.__pendingBasemapHooked=!1,at()};u.once("style.load",A),u.once("styledata",A)},at=()=>{const u=T.value,A=Qe.value;if(!A||!u)return;if(!(typeof u.isStyleLoaded=="function"?u.isStyleLoaded():!0)){bt(u);return}vt(u),Qt(u,A)},Vt=()=>{const u=$.value;if(!u)return;const A=d.value.find(z=>z.key===u);A&&Ot(A)};e.watch($,()=>{Vt()},{immediate:!0}),e.watch(Xt,u=>{R.setOverlays?.(u)},{immediate:!0,deep:!0});const y=e.ref(null);let L=0;const S=e.computed(()=>Oo(y.value)),B={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}},V={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},Y=e.ref(h),ne=e.ref(v),ue=e.ref(!1),Me=e.computed(()=>{if(!ne.value)return null;const[u,A,z,X]=ne.value;return[(u+z)/2,(A+X)/2]}),Re=e.computed(()=>!!ne.value),ct=e.ref(!!v);e.ref(!1);const ve=()=>{P.value=!P.value},kt=e.ref(!1),en=()=>{const u=T.value;if(!u||!u.isStyleLoaded())return;const A=Y.value;if(!A){pu(u);return}let z=u.getSource(et);z?z.setData(A):(u.addSource(et,{type:"geojson",data:A}),fu(u),z=u.getSource(et)),gr(u,O.value?"visible":"none"),uu(),vr(),ne.value&&(!ct.value&&(ue.value||!kt.value)?(u.fitBounds(ne.value,{padding:40,maxZoom:16,duration:0}),kt.value=!0,ue.value=!1):ct.value&&(ct.value=!1,ue.value=!1,kt.value=!0))},fu=u=>{const A=B;u.getLayer(Ct)||u.addLayer({id:Ct,type:"fill",source:et,paint:A.fill}),u.getLayer(St)||u.addLayer({id:St,type:"line",source:et,paint:A.line}),u.getLayer(_t)||u.addLayer({id:_t,type:"circle",source:et,paint:A.circle,filter:["==","$type","Point"]})},pu=u=>{[_t,St,Ct].forEach(A=>{u.getLayer(A)&&u.removeLayer(A)}),u.getSource(et)&&u.removeSource(et)},gr=(u,A)=>{[_t,St,Ct].forEach(z=>{u.getLayer(z)&&u.setLayoutProperty(z,"visibility",A)})},uu=()=>{const u=T.value;if(!u||!u.isStyleLoaded())return;const A=B;u.getLayer(Ct)&&Object.entries(A.fill).forEach(([z,X])=>{u.setPaintProperty(Ct,z,X)}),u.getLayer(St)&&Object.entries(A.line).forEach(([z,X])=>{u.setPaintProperty(St,z,X)}),u.getLayer(_t)&&Object.entries(A.circle).forEach(([z,X])=>{u.setPaintProperty(_t,z,X)})},yr=u=>{u.getLayer(fn)||u.addLayer({id:fn,type:"line",source:Nt,layout:{visibility:"visible"},paint:V})},vr=()=>{const u=T.value;if(!u)return;const A=S.value??{type:"FeatureCollection",features:[]};if(!u.getSource(Nt)){u.addSource(Nt,{type:"geojson",data:A}),yr(u);return}const z=u.getSource(Nt);z&&typeof z.setData=="function"&&z.setData(A),yr(u)},mu=u=>{u.getLayer(fn)&&u.removeLayer(fn),u.getSource(Nt)&&u.removeSource(Nt)},hu=async u=>{const A=typeof u=="string"?u.trim():"",z=++L;if(!A){y.value=null;return}try{const X=await fetch(`https://data.gki.com.ua/api-user/atu/${A}`);if(L!==z)return;if(!X.ok){y.value=null;return}const Ce=await X.json();if(L!==z)return;y.value=Ce}catch{if(L!==z)return;y.value=null}};e.watch(c,u=>{hu(u)},{immediate:!0}),e.watch(S,()=>{vr()},{immediate:!0}),e.watch(()=>n.geom,u=>{Y.value=Oo(u),ne.value=br(Y.value),Me.value&&(Ne.value=Me.value),kt.value=!1,ue.value=!0,en()},{deep:!0,immediate:!0}),e.watch(O,()=>{const u=T.value;u&&u.isStyleLoaded()&&gr(u,O.value?"visible":"none")});const Et=()=>{en(),at()},Do=()=>{en()};e.watch(T,(u,A)=>{A&&(A.off("style.load",Et),A.off("load",Et),A.off("idle",Do)),u&&(u.on("load",Et),u.on("style.load",Et),u.on("idle",Do),Et())}),e.watch(C,u=>{!T.value||!u||Re.value||g(u)}),e.watch(()=>n.zoom,u=>{!T.value||typeof u!="number"||N(u)}),e.onBeforeUnmount(()=>{_.value&&G&&G(_.value),j.value?re(j.value):T.value&&re(T.value);const u=T.value;u&&(mu(u),u.off("style.load",Et),u.off("load",Et),u.off("idle",Do))});function gu(u){u&&($.value=u)}function yu(u){O.value=u}R.setBasemap=gu,R.toggleGeometry=yu,R.setOverlays?.(Xt.value);function Oo(u){if(!u)return null;if(u.type==="FeatureCollection")return u;if(u.type==="Feature")return{type:"FeatureCollection",features:[u]};const A=u.geometry??u;if(!A?.type)return null;if(A.type==="GeometryCollection"&&Array.isArray(A.geometries)){const z=A.geometries.filter(X=>X&&typeof X.type=="string").map(X=>({type:"Feature",geometry:X}));return z.length?{type:"FeatureCollection",features:z}:null}if(A.type==="MultiPoint"&&Array.isArray(A.coordinates)){const z=A.coordinates.filter(X=>Array.isArray(X)&&X.length>=2).map(X=>({type:"Feature",geometry:{type:"Point",coordinates:X}}));return z.length?{type:"FeatureCollection",features:z}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:A}]}}function br(u){if(!u?.features?.length)return null;let A=1/0,z=1/0,X=-1/0,Ce=-1/0;const Ge=tn=>{if(typeof tn[0]=="number"){const[wt,kr]=tn;A=Math.min(A,wt),z=Math.min(z,kr),X=Math.max(X,wt),Ce=Math.max(Ce,kr);return}tn.forEach(wt=>Ge(wt))};return u.features.forEach(tn=>{const wt=tn?.geometry?.coordinates;wt&&Ge(wt)}),A===1/0||z===1/0?null:[A,z,X,Ce]}return(u,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(se.value),style:e.normalizeStyle(P.value?void 0:x.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:b,class:e.normalizeClass(De.value)},null,2),e.createVNode(Aa,{items:Xe.value},null,8,["items"]),f("search")?(e.openBlock(),e.createBlock(Xa,{key:0})):e.createCommentVNode("",!0),f("home")||f("fullscreen")?(e.openBlock(),e.createElementBlock("div",tc,[f("home")?(e.openBlock(),e.createElementBlock("div",nc,[e.createVNode(Yo,{center:je.value,zoom:qe.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(Yo,{key:0,"target-center":Me.value,"target-zoom":qe.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),f("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:ve,"aria-label":P.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...A[0]||(A[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,oc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),fe.value?(e.openBlock(),e.createElementBlock("div",sc,[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:$e},[...A[1]||(A[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",rc,e.toDisplayString(fe.value.title||"Об'єкт"),1),fe.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(${x.value.height}-120px)]`]),innerHTML:fe.value.html},null,10,ic)):(e.openBlock(),e.createElementBlock("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value.rows,z=>(e.openBlock(),e.createElementBlock("div",{key:z.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",ac,e.toDisplayString(z.label)+":",1),e.createElementVNode("span",cc,e.toDisplayString(z.value),1)]))),128))])),fe.value.actions?.length?(e.openBlock(),e.createElementBlock("div",dc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value.actions,z=>(e.openBlock(),e.createElementBlock("a",{key:z.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:z.url,target:z.target??void 0,rel:"noreferrer"},e.toDisplayString(z.label),9,fc))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode($a),f("position")&&D.value?(e.openBlock(),e.createBlock(Ma,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:D.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});function Ue(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const uc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const qn=()=>{},un=()=>!1,Wn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),tt=Object.assign,Ze=Array.isArray,ye=t=>typeof t=="string",Kn=t=>typeof t=="symbol",mc=t=>t!==null&&typeof t=="object",Xo=Ue(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),hc=Ue("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Gn=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},gc=/-\w/g,nt=Gn(t=>t.replace(gc,n=>n.slice(1).toUpperCase())),Zn=Gn(t=>t.charAt(0).toUpperCase()+t.slice(1)),yc=Gn(t=>t?`on${Zn(t)}`:""),Rt={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"},vc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},bc=/;(?![^(]*\))/g,kc=/:([^]+)/,Ec=/\/\*[^]*?\*\//g;function wc(t){const n={};return t.replace(Ec,"").split(bc).forEach(o=>{if(o){const s=o.split(kc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const xc="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",Nc="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",Cc="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",Sc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",_c=Ue(xc),Bc=Ue(Nc),Tc=Ue(Cc),$c=Ue(Sc);const Ft=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Pt=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Jn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),mn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),Qo=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),dt=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),Vo=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),es=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Yn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),zt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),ts=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),eo=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),to=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),no=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),oo=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),so=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),ns=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),os=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),hn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),gn=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),ro=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),io=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),jt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Ht=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),lo=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),ao=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Lc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),co=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),yn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Ic=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Ac=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),fo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Dc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Oc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),po=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),ss=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Bt={[Ft]:"Fragment",[Pt]:"Teleport",[Jn]:"Suspense",[mn]:"KeepAlive",[Qo]:"BaseTransition",[dt]:"openBlock",[Vo]:"createBlock",[es]:"createElementBlock",[Yn]:"createVNode",[Xn]:"createElementVNode",[zt]:"createCommentVNode",[Qn]:"createTextVNode",[ts]:"createStaticVNode",[Vn]:"resolveComponent",[eo]:"resolveDynamicComponent",[to]:"resolveDirective",[no]:"resolveFilter",[oo]:"withDirectives",[so]:"renderList",[ns]:"renderSlot",[os]:"createSlots",[hn]:"toDisplayString",[gn]:"mergeProps",[ro]:"normalizeClass",[io]:"normalizeStyle",[jt]:"normalizeProps",[Ht]:"guardReactiveProps",[lo]:"toHandlers",[ao]:"camelize",[Lc]:"capitalize",[co]:"toHandlerKey",[yn]:"setBlockTracking",[Ic]:"pushScopeId",[Ac]:"popScopeId",[fo]:"withCtx",[Dc]:"unref",[Oc]:"isRef",[po]:"withMemo",[ss]:"isMemoSame"};function Mc(t){Object.getOwnPropertySymbols(t).forEach(n=>{Bt[n]=t[n]})}const Le={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function Rc(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Le}}function Ut(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,m=Le){return t&&(a?(t.helper(dt),t.helper(Lt(t.inSSR,d))):t.helper($t(t.inSSR,d)),i&&t.helper(oo)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function ft(t,n=Le){return{type:17,loc:n,elements:t}}function Oe(t,n=Le){return{type:15,loc:n,properties:t}}function pe(t,n){return{type:16,loc:Le,key:ye(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Le,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function Fe(t,n=Le){return{type:8,loc:n,children:t}}function he(t,n=[],o=Le){return{type:14,loc:o,callee:t,arguments:n}}function Tt(t,n=void 0,o=!1,s=!1,r=Le){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function uo(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Le}}function Fc(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Le}}function Pc(t){return{type:21,body:t,loc:Le}}function $t(t,n){return t||n?Yn:Xn}function Lt(t,n){return t||n?Vo:es}function mo(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o($t(s,t.isComponent)),n(dt),n(Lt(s,t.isComponent)))}const rs=new Uint8Array([123,123]),is=new Uint8Array([125,125]);function ls(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 ot(t){return t===47||t===62||Ie(t)}function vn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const be={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 zc{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=rs,this.delimiterClose=is,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=rs,this.delimiterClose=is}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?ot(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===be.TitleEnd||this.currentSequence===be.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===be.Cdata[this.sequenceIndex]?++this.sequenceIndex===be.Cdata.length&&(this.state=28,this.currentSequence=be.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===be.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):ls(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){ot(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(ot(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(vn("</"+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=ls(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||ot(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||ot(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||ot(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||ot(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||ot(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=be.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===be.ScriptEnd[3]?this.startSpecial(be.ScriptEnd,4):n===be.StyleEnd[3]?this.startSpecial(be.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===be.TitleEnd[3]?this.startSpecial(be.TitleEnd,4):n===be.TextareaEnd[3]?this.startSpecial(be.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===be.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 jc={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 ho(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function st(t,n){const o=ho("MODE",n),s=ho(t,n);return o===3?s===!0:s!==!1}function It(t,n,o,...s){const r=st(t,n);return process.env.NODE_ENV!=="production"&&r&&bn(t,n,o,...s),r}function bn(t,n,o,...s){if(ho(t,n)==="suppress-warning")return;const{message:l,link:i}=jc[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
2
+ Details: ${i}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function go(t){throw t}function as(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||Hc)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,l=new SyntaxError(String(r));return l.code=t,l.loc=n,l}const Hc={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
+ 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:""},Se=t=>t.type===4&&t.isStatic;function cs(t){switch(t){case"Teleport":case"teleport":return Pt;case"Suspense":case"suspense":return Jn;case"KeepAlive":case"keep-alive":return mn;case"BaseTransition":case"base-transition":return Qo}}const Uc=/^$|^\d|[^\$\w\xA0-\uFFFF]/,yo=t=>!Uc.test(t),ds=/[A-Za-z_$\xA0-\uFFFF]/,qc=/[\.\?\w$\xA0-\uFFFF]/,Wc=/\s+[.[]\s*|\s*[.[]\s+/g,fs=t=>t.type===4?t.content:t.loc.source,ps=t=>{const n=fs(t).trim().replace(Wc,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?ds:qc).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},Kc=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,Gc=t=>Kc.test(fs(t));function us(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function _e(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)&&(ye(n)?r.name===n:n.test(r.name)))return r}}function qt(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)&&rt(l.arg,n))return l}}function rt(t,n){return!!(t&&Se(t)&&t.content===n)}function Zc(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function vo(t){return t.type===5||t.type===2}function ms(t){return t.type===7&&t.name==="pre"}function Jc(t){return t.type===7&&t.name==="slot"}function kn(t){return t.type===1&&t.tagType===3}function En(t){return t.type===1&&t.tagType===2}const Yc=new Set([jt,Ht]);function hs(t,n=[]){if(t&&!ye(t)&&t.type===14){const o=t.callee;if(!ye(o)&&Yc.has(o))return hs(t.arguments[0],n.concat(t))}return[t,n]}function wn(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],l=[],i;if(r&&!ye(r)&&r.type===14){const a=hs(r);r=a[0],l=a[1],i=l[l.length-1]}if(r==null||ye(r))s=Oe([n]);else if(r.type===14){const a=r.arguments[0];!ye(a)&&a.type===15?gs(n,a)||a.properties.unshift(n):r.callee===lo?s=he(o.helper(gn),[Oe([n]),r]):r.arguments.unshift(Oe([n])),!s&&(s=r)}else r.type===15?(gs(n,r)||r.properties.unshift(n),s=r):(s=he(o.helper(gn),[Oe([n]),r]),i&&i.callee===Ht&&(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 gs(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 Wt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function Xc(t){return t.type===14&&t.callee===po?t.arguments[1].returns:t}const Qc=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function ys(t){for(let n=0;n<t.length;n++)if(!Ie(t.charCodeAt(n)))return!1;return!0}function bo(t){return t.type===2&&ys(t.content)||t.type===12&&bo(t.content)}function ko(t){return t.type===3||bo(t)}const vs={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:un,isPreTag:un,isIgnoreNewlineTag:un,isCustomElement:un,onError:go,onWarn:as,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let te=vs,Kt=null,Je="",we=null,ee=null,Be="",Ye=-1,pt=-1,Eo=0,it=!1,wo=null;const ce=[],ie=new zc(ce,{onerr:Te,ontext(t,n){xn(ke(t,n),t,n)},ontextentity(t,n,o){xn(t,n,o)},oninterpolation(t,n){if(it)return xn(ke(t,n),t,n);let o=t+ie.delimiterOpen.length,s=n-ie.delimiterClose.length;for(;Ie(Je.charCodeAt(o));)o++;for(;Ie(Je.charCodeAt(s-1));)s--;let r=ke(o,s);r.includes("&")&&(r=te.decodeEntities(r,!1)),xo({type:5,content:Cn(r,!1,de(o,s)),loc:de(t,n)})},onopentagname(t,n){const o=ke(t,n);we={type:1,tag:o,ns:te.getNamespace(o,ce[0],te.ns),tagType:0,props:[],children:[],loc:de(t-1,n),codegenNode:void 0}},onopentagend(t){ks(t)},onclosetag(t,n){const o=ke(t,n);if(!te.isVoidTag(o)){let s=!1;for(let r=0;r<ce.length;r++)if(ce[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&Te(24,ce[0].loc.start.offset);for(let i=0;i<=r;i++){const a=ce.shift();Nn(a,n,i<r)}break}s||Te(23,Es(t,60))}},onselfclosingtag(t){const n=we.tag;we.isSelfClosing=!0,ks(t),ce[0]&&ce[0].tag===n&&Nn(ce.shift(),t)},onattribname(t,n){ee={type:6,name:ke(t,n),nameLoc:de(t,n),value:void 0,loc:de(t)}},ondirname(t,n){const o=ke(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!it&&s===""&&Te(26,t),it||s==="")ee={type:6,name:o,nameLoc:de(t,n),value:void 0,loc:de(t)};else if(ee={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[Q("prop")]:[],loc:de(t)},s==="pre"){it=ie.inVPre=!0,wo=we;const r=we.props;for(let l=0;l<r.length;l++)r[l].type===7&&(r[l]=ad(r[l]))}},ondirarg(t,n){if(t===n)return;const o=ke(t,n);if(it&&!ms(ee))ee.name+=o,ut(ee.nameLoc,n);else{const s=o[0]!=="[";ee.arg=Cn(s?o:o.slice(1,-1),s,de(t,n),s?3:0)}},ondirmodifier(t,n){const o=ke(t,n);if(it&&!ms(ee))ee.name+="."+o,ut(ee.nameLoc,n);else if(ee.name==="slot"){const s=ee.arg;s&&(s.content+="."+o,ut(s.loc,n))}else{const s=Q(o,!0,de(t,n));ee.modifiers.push(s)}},onattribdata(t,n){Be+=ke(t,n),Ye<0&&(Ye=t),pt=n},onattribentity(t,n,o){Be+=t,Ye<0&&(Ye=n),pt=o},onattribnameend(t){const n=ee.loc.start.offset,o=ke(n,t);ee.type===7&&(ee.rawName=o),we.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&Te(2,n)},onattribend(t,n){if(we&&ee){if(ut(ee.loc,n),t!==0)if(Be.includes("&")&&(Be=te.decodeEntities(Be,!0)),ee.type===6)ee.name==="class"&&(Be=Ns(Be).trim()),t===1&&!Be&&Te(13,n),ee.value={type:2,content:Be,loc:t===1?de(Ye,pt):de(Ye-1,pt+1)},ie.inSFCRoot&&we.tag==="template"&&ee.name==="lang"&&Be&&Be!=="html"&&ie.enterRCDATA(vn("</template"),0);else{let o=0;ee.exp=Cn(Be,!1,de(Ye,pt),0,o),ee.name==="for"&&(ee.forParseResult=ed(ee.exp));let s=-1;ee.name==="bind"&&(s=ee.modifiers.findIndex(r=>r.content==="sync"))>-1&&It("COMPILER_V_BIND_SYNC",te,ee.loc,ee.arg.loc.source)&&(ee.name="model",ee.modifiers.splice(s,1))}(ee.type!==7||ee.name!=="pre")&&we.props.push(ee)}Be="",Ye=pt=-1},oncomment(t,n){te.comments&&xo({type:3,content:ke(t,n),loc:de(t-4,n+3)})},onend(){const t=Je.length;if(process.env.NODE_ENV!=="production"&&ie.state!==1)switch(ie.state){case 5:case 8:Te(5,t);break;case 3:case 4:Te(25,ie.sectionStart);break;case 28:ie.currentSequence===be.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<ce.length;n++)Nn(ce[n],t-1),Te(24,ce[n].loc.start.offset)},oncdata(t,n){ce[0].ns!==0?xn(ke(t,n),t,n):Te(1,t-9)},onprocessinginstruction(t){(ce[0]?ce[0].ns:te.ns)===0&&Te(21,t-1)}}),bs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Vc=/^\(|\)$/g;function ed(t){const n=t.loc,o=t.content,s=o.match(Qc);if(!s)return;const[,r,l]=s,i=(p,h,v=!1)=>{const k=n.start.offset+h,b=k+p.length;return Cn(p,!1,de(k,b),0,v?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(Vc,"").trim();const d=r.indexOf(c),m=c.match(bs);if(m){c=c.replace(bs,"").trim();const p=m[1].trim();let h;if(p&&(h=o.indexOf(p,d+c.length),a.key=i(p,h,!0)),m[2]){const v=m[2].trim();v&&(a.index=i(v,o.indexOf(v,a.key?h+p.length:d+c.length),!0))}}return c&&(a.value=i(c,d,!0)),a}function ke(t,n){return Je.slice(t,n)}function ks(t){ie.inSFCRoot&&(we.innerLoc=de(t+1,t+1)),xo(we);const{tag:n,ns:o}=we;o===0&&te.isPreTag(n)&&Eo++,te.isVoidTag(n)?Nn(we,t):(ce.unshift(we),(o===1||o===2)&&(ie.inXML=!0)),we=null}function xn(t,n,o){{const l=ce[0]&&ce[0].tag;l!=="script"&&l!=="style"&&t.includes("&")&&(t=te.decodeEntities(t,!1))}const s=ce[0]||Kt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,ut(r.loc,o)):s.children.push({type:2,content:t,loc:de(n,o)})}function Nn(t,n,o=!1){o?ut(t.loc,Es(n,60)):ut(t.loc,td(n,62)+1),ie.inSFCRoot&&(t.children.length?t.innerLoc.end=tt({},t.children[t.children.length-1].loc.end):t.innerLoc.end=tt({},t.innerLoc.start),t.innerLoc.source=ke(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:l}=t;if(it||(s==="slot"?t.tagType=2:ws(t)?t.tagType=3:od(t)&&(t.tagType=1)),ie.inRCDATA||(t.children=xs(l)),r===0&&te.isIgnoreNewlineTag(s)){const i=l[0];i&&i.type===2&&(i.content=i.content.replace(/^\r?\n/,""))}r===0&&te.isPreTag(s)&&Eo--,wo===t&&(it=ie.inVPre=!1,wo=null),ie.inXML&&(ce[0]?ce[0].ns:te.ns)===0&&(ie.inXML=!1);{const i=t.props;if(process.env.NODE_ENV!=="production"&&st("COMPILER_V_IF_V_FOR_PRECEDENCE",te)){let c=!1,d=!1;for(let m=0;m<i.length;m++){const p=i[m];if(p.type===7&&(p.name==="if"?c=!0:p.name==="for"&&(d=!0)),c&&d){bn("COMPILER_V_IF_V_FOR_PRECEDENCE",te,t.loc);break}}}if(!ie.inSFCRoot&&st("COMPILER_NATIVE_TEMPLATE",te)&&t.tag==="template"&&!ws(t)){process.env.NODE_ENV!=="production"&&bn("COMPILER_NATIVE_TEMPLATE",te,t.loc);const c=ce[0]||Kt,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",te,a.loc)&&t.children.length&&(a.value={type:2,content:ke(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:a.loc})}}function td(t,n){let o=t;for(;Je.charCodeAt(o)!==n&&o<Je.length-1;)o++;return o}function Es(t,n){let o=t;for(;Je.charCodeAt(o)!==n&&o>=0;)o--;return o}const nd=new Set(["if","else","else-if","for","slot"]);function ws({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&nd.has(n[o].name))return!0}return!1}function od({tag:t,props:n}){if(te.isCustomElement(t))return!1;if(t==="component"||sd(t.charCodeAt(0))||cs(t)||te.isBuiltInComponent&&te.isBuiltInComponent(t)||te.isNativeTag&&!te.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",te,s.loc))return!0}}else if(s.name==="bind"&&rt(s.arg,"is")&&It("COMPILER_IS_ON_ELEMENT",te,s.loc))return!0}return!1}function sd(t){return t>64&&t<91}const rd=/\r\n/g;function xs(t){const n=te.whitespace!=="preserve";let o=!1;for(let s=0;s<t.length;s++){const r=t[s];if(r.type===2)if(Eo)r.content=r.content.replace(rd,`
4
+ `);else if(ys(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&&id(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=Ns(r.content))}return o?t.filter(Boolean):t}function id(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function Ns(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 xo(t){(ce[0]||Kt).children.push(t)}function de(t,n){return{start:ie.getPos(t),end:n==null?n:ie.getPos(n),source:n==null?n:ke(t,n)}}function ld(t){return de(t.start.offset,t.end.offset)}function ut(t,n){t.end=ie.getPos(n),t.source=ke(t.start.offset,n)}function ad(t){const n={type:6,name:t.rawName,nameLoc:de(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 Cn(t,n=!1,o,s=0,r=0){return Q(t,n,o,s)}function Te(t,n,o){te.onError(oe(t,de(n,n),void 0,o))}function cd(){ie.reset(),we=null,ee=null,Be="",Ye=-1,pt=-1,ce.length=0}function dd(t,n){if(cd(),Je=t,te=tt({},vs),n){let r;for(r in n)n[r]!=null&&(te[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!te.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");ie.mode=te.parseMode==="html"?1:te.parseMode==="sfc"?2:0,ie.inXML=te.ns===1||te.ns===2;const o=n&&n.delimiters;o&&(ie.delimiterOpen=vn(o[0]),ie.delimiterClose=vn(o[1]));const s=Kt=Rc([],t);return ie.parse(Je),s.loc=de(0,t.length),s.children=xs(s.children),Kt=null,s}function fd(t,n){Sn(t,void 0,n,!!Cs(t))}function Cs(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!En(n[0])?n[0]:null}function Sn(t,n,o,s=!1,r=!1){const{children:l}=t,i=[];for(let m=0;m<l.length;m++){const p=l[m];if(p.type===1&&p.tagType===0){const h=s?0:Ae(p,o);if(h>0){if(h>=2){p.codegenNode.patchFlag=-1,i.push(p);continue}}else{const v=p.codegenNode;if(v.type===13){const k=v.patchFlag;if((k===void 0||k===512||k===1)&&_s(p,o)>=2){const b=Bs(p);b&&(v.props=o.hoist(b))}v.dynamicProps&&(v.dynamicProps=o.hoist(v.dynamicProps))}}}else if(p.type===12&&(s?0:Ae(p,o))>=2){p.codegenNode.type===14&&p.codegenNode.arguments.length>0&&p.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${Rt[-1]} */`:"")),i.push(p);continue}if(p.type===1){const h=p.tagType===1;h&&o.scopes.vSlot++,Sn(p,t,o,!1,r),h&&o.scopes.vSlot--}else if(p.type===11)Sn(p,t,o,p.children.length===1,!0);else if(p.type===9)for(let h=0;h<p.branches.length;h++)Sn(p.branches[h],t,o,p.branches[h].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&&Ze(t.codegenNode.children))t.codegenNode.children=c(ft(t.codegenNode.children)),a=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Ze(t.codegenNode.children)&&t.codegenNode.children.type===15){const m=d(t.codegenNode,"default");m&&(m.returns=c(ft(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&&!Ze(n.codegenNode.children)&&n.codegenNode.children.type===15){const m=_e(t,"slot",!0),p=m&&m.arg&&d(n.codegenNode,m.arg);p&&(p.returns=c(ft(p.returns)),a=!0)}}if(!a)for(const m of i)m.codegenNode=o.cache(m.codegenNode);function c(m){const p=o.cache(m);return p.needArraySpread=!0,p}function d(m,p){if(m.children&&!Ze(m.children)&&m.children.type===15){const h=m.children.properties.find(v=>v.key===p||v.key.content===p);return h&&h.value}}i.length&&o.transformHoist&&o.transformHoist(l,o,t)}function Ae(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=_s(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=Ae(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=Ae(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(dt),n.removeHelper(Lt(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper($t(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 Ae(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(ye(a)||Kn(a))continue;const c=Ae(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 pd=new Set([ro,io,jt,Ht]);function Ss(t,n){if(t.type===14&&!ye(t.callee)&&pd.has(t.callee)){const o=t.arguments[0];if(o.type===4)return Ae(o,n);if(o.type===14)return Ss(o,n)}return 0}function _s(t,n){let o=3;const s=Bs(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=Ae(i,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=Ae(a,n):a.type===14?d=Ss(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function Bs(t){const n=t.codegenNode;if(n.type===13)return n.props}function ud(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:l=!1,nodeTransforms:i=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=qn,isCustomElement:m=qn,expressionPlugins:p=[],scopeId:h=null,slotted:v=!0,ssr:k=!1,inSSR:b=!1,ssrCssVars:C="",bindingMetadata:w=uc,inline:R=!1,isTS:T=!1,onError:g=go,onWarn:N=as,compatConfig:M}){const F=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),E={filename:n,selfName:F&&Zn(nt(F[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:l,nodeTransforms:i,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:m,expressionPlugins:p,scopeId:h,slotted:v,ssr:k,inSSR:b,ssrCssVars:C,bindingMetadata:w,inline:R,isTS:T,onError:g,onWarn:N,compatConfig:M,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(I){const H=E.helpers.get(I)||0;return E.helpers.set(I,H+1),I},removeHelper(I){const H=E.helpers.get(I);if(H){const U=H-1;U?E.helpers.set(I,U):E.helpers.delete(I)}},helperString(I){return`_${Bt[E.helper(I)]}`},replaceNode(I){if(process.env.NODE_ENV!=="production"){if(!E.currentNode)throw new Error("Node being replaced is already removed.");if(!E.parent)throw new Error("Cannot replace root node.")}E.parent.children[E.childIndex]=E.currentNode=I},removeNode(I){if(process.env.NODE_ENV!=="production"&&!E.parent)throw new Error("Cannot remove root node.");const H=E.parent.children,U=I?H.indexOf(I):E.currentNode?E.childIndex:-1;if(process.env.NODE_ENV!=="production"&&U<0)throw new Error("node being removed is not a child of current parent");!I||I===E.currentNode?(E.currentNode=null,E.onNodeRemoved()):E.childIndex>U&&(E.childIndex--,E.onNodeRemoved()),E.parent.children.splice(U,1)},onNodeRemoved:qn,addIdentifiers(I){},removeIdentifiers(I){},hoist(I){ye(I)&&(I=Q(I)),E.hoists.push(I);const H=Q(`_hoisted_${E.hoists.length}`,!1,I.loc,2);return H.hoisted=I,H},cache(I,H=!1,U=!1){const G=Fc(E.cached.length,I,H,U);return E.cached.push(G),G}};return E.filters=new Set,E}function md(t,n){const o=ud(t,n);_n(t,o),n.hoistStatic&&fd(t,o),n.ssr||hd(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 hd(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=Cs(t);if(r&&r.codegenNode){const l=r.codegenNode;l.type===13&&mo(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=Ut(n,o(Ft),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function gd(t,n){let o=0;const s=()=>{o--};for(;o<t.children.length;o++){const r=t.children[o];ye(r)||(n.grandParent=n.parent,n.parent=t,n.childIndex=o,n.onNodeRemoved=s,_n(r,n))}}function _n(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&&(Ze(i)?s.push(...i):s.push(i)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(zt);break;case 5:n.ssr||n.helper(hn);break;case 9:for(let l=0;l<t.branches.length;l++)_n(t.branches[l],n);break;case 10:case 11:case 1:case 0:gd(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function Ts(t,n){const o=ye(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(Jc))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 Bn="/*@__PURE__*/",$s=t=>`${Bt[t]}: _${Bt[t]}`;function yd(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:p=!1,inSSR:h=!1}){const v={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:l,optimizeImports:i,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:m,isTS:p,inSSR:h,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(b){return`_${Bt[b]}`},push(b,C=-2,w){v.code+=b},indent(){k(++v.indentLevel)},deindent(b=!1){b?--v.indentLevel:k(--v.indentLevel)},newline(){k(v.indentLevel)}};function k(b){v.push(`
5
+ `+" ".repeat(b),0)}return v}function vd(t,n={}){const o=yd(t,n);n.onContextCreated&&n.onContextCreated(o);const{mode:s,push:r,prefixIdentifiers:l,indent:i,deindent:a,newline:c,scopeId:d,ssr:m}=o,p=Array.from(t.helpers),h=p.length>0,v=!l&&s!=="module";bd(t,o);const b=m?"ssrRender":"render",w=(m?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${b}(${w}) {`),i(),v&&(r("with (_ctx) {"),i(),h&&(r(`const { ${p.map($s).join(", ")} } = _Vue
6
+ `,-1),c())),t.components.length&&(No(t.components,"component",o),(t.directives.length||t.temps>0)&&c()),t.directives.length&&(No(t.directives,"directive",o),t.temps>0&&c()),t.filters&&t.filters.length&&(c(),No(t.filters,"filter",o),c()),t.temps>0){r("let ");for(let R=0;R<t.temps;R++)r(`${R>0?", ":""}_temp${R}`)}return(t.components.length||t.directives.length||t.temps)&&(r(`
7
+ `,0),c()),m||r("return "),t.codegenNode?xe(t.codegenNode,o):r("null"),v&&(a(),r("}")),a(),r("}"),{ast:t,code:o.code,preamble:"",map:o.map?o.map.toJSON():void 0}}function bd(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
+ `,-1),t.hoists.length)){const p=[Yn,Xn,zt,Qn,ts].filter(h=>m.includes(h)).map($s).join(", ");r(`const { ${p} } = _Vue
9
+ `,-1)}kd(t.hoists,n),l(),r("return ")}function No(t,n,{helper:o,push:s,newline:r,isTS:l}){const i=o(n==="filter"?no:n==="component"?Vn:to);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 ${Wt(c,n)} = ${i}(${JSON.stringify(c)}${d?", true":""})${l?"!":""}`),a<t.length-1&&r()}}function kd(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} = `),xe(l,n),s())}n.pure=!1}function Ed(t){return ye(t)||t.type===4||t.type===2||t.type===5||t.type===8}function Co(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Ze(s)||!Ed(s));n.push("["),o&&n.indent(),Gt(t,n,o),o&&n.deindent(),n.push("]")}function Gt(t,n,o=!1,s=!0){const{push:r,newline:l}=n;for(let i=0;i<t.length;i++){const a=t[i];ye(a)?r(a,-3):Ze(a)?Co(a,n):xe(a,n),i<t.length-1&&(o?(s&&r(","),l()):s&&r(", "))}}function xe(t,n){if(ye(t)){n.push(t,-3);return}if(Kn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&us(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),xe(t.codegenNode,n);break;case 2:wd(t,n);break;case 4:Ls(t,n);break;case 5:xd(t,n);break;case 12:xe(t.codegenNode,n);break;case 8:Is(t,n);break;case 3:Cd(t,n);break;case 13:Sd(t,n);break;case 14:Bd(t,n);break;case 15:Td(t,n);break;case 17:$d(t,n);break;case 18:Ld(t,n);break;case 19:Id(t,n);break;case 20:Ad(t,n);break;case 21:Gt(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 us(!1,`unhandled codegen node type: ${t.type}`),t}}function wd(t,n){n.push(JSON.stringify(t.content),-3,t)}function Ls(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function xd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Bn),o(`${s(hn)}(`),xe(t.content,n),o(")")}function Is(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];ye(s)?n.push(s,-3):xe(s,n)}}function Nd(t,n){const{push:o}=n;if(t.type===8)o("["),Is(t,n),o("]");else if(t.isStatic){const s=yo(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function Cd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Bn),o(`${s(zt)}(${JSON.stringify(t.content)})`,-3,t)}function Sd(t,n){const{push:o,helper:s,pure:r}=n,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:d,directives:m,isBlock:p,disableTracking:h,isComponent:v}=t;let k;if(c)if(process.env.NODE_ENV!=="production")if(c<0)k=c+` /* ${Rt[c]} */`;else{const C=Object.keys(Rt).map(Number).filter(w=>w>0&&c&w).map(w=>Rt[w]).join(", ");k=c+` /* ${C} */`}else k=String(c);m&&o(s(oo)+"("),p&&o(`(${s(dt)}(${h?"true":""}), `),r&&o(Bn);const b=p?Lt(n.inSSR,v):$t(n.inSSR,v);o(s(b)+"(",-2,t),Gt(_d([l,i,a,k,d]),n),o(")"),p&&o(")"),m&&(o(", "),xe(m,n),o(")"))}function _d(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function Bd(t,n){const{push:o,helper:s,pure:r}=n,l=ye(t.callee)?t.callee:s(t.callee);r&&o(Bn),o(l+"(",-2,t),Gt(t.arguments,n),o(")")}function Td(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];Nd(d,n),o(": "),xe(m,n),c<i.length-1&&(o(","),l())}a&&r(),o(a?"}":" }")}function $d(t,n){Co(t.elements,n)}function Ld(t,n){const{push:o,indent:s,deindent:r}=n,{params:l,returns:i,body:a,newline:c,isSlot:d}=t;d&&o(`_${Bt[fo]}(`),o("(",-2,t),Ze(l)?Gt(l,n):l&&xe(l,n),o(") => "),(c||a)&&(o("{"),s()),i?(c&&o("return "),Ze(i)?Co(i,n):xe(i,n)):a&&xe(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function Id(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 p=!yo(o.content);p&&i("("),Ls(o,n),p&&i(")")}else i("("),xe(o,n),i(")");l&&a(),n.indentLevel++,l||i(" "),i("? "),xe(s,n),n.indentLevel--,l&&d(),l||i(" "),i(": ");const m=r.type===19;m||n.indentLevel++,xe(r,n),m||n.indentLevel--,l&&c(!0)}function Ad(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(yn)}(-1`),t.inVOnce&&o(", true"),o("),"),i(),o("(")),o(`_cache[${t.index}] = `),xe(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),i(),o(`${s(yn)}(1),`),i(),o(`_cache[${t.index}]`),l()),o(")"),c&&o(")]")}const Dd=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"),Od=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function mt(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(Od,"").match(Dd);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(oe(46,t.loc,void 0,i))}}const Md=(t,n)=>{if(t.type===5)t.content=So(t.content,n);else if(t.type===1){const o=_e(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=So(l,n,r.name==="slot")),i&&i.type===4&&!i.isStatic&&(r.arg=So(i,n))}}}};function So(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&mt(t,n,o,s),t}const Rd=Ts(/^(?:if|else|else-if)$/,(t,n,o)=>Fd(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=Ds(r,c,o);else{const d=zd(s.codegenNode);d.alternate=Ds(r,c+s.branches.length-1,o)}}}));function Fd(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&&mt(n.exp,o),n.name==="if"){const r=As(t,n),l={type:9,loc:ld(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&&ko(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=As(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:p})=>{Pd(p,m)&&o.onError(oe(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);_n(c,o),d&&d(),o.currentNode=null}else o.onError(oe(30,t.loc));break}}}function As(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!_e(t,"for")?t.children:[t],userKey:qt(t,"key"),isTemplateIf:o}}function Ds(t,n,o){return t.condition?uo(t.condition,Os(t,n,o),he(o.helper(zt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Os(t,n,o)}function Os(t,n,o){const{helper:s}=o,r=pe("key",Q(`${n}`,!1,Le,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 wn(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),Ut(o,s(Ft),Oe([r]),l,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=i.codegenNode,d=Xc(c);return d.type===13&&mo(d,o),wn(d,r,o),c}}function Pd(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 zd(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 jd=Ts("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return Hd(t,n,o,l=>{const i=he(s(so),[l.source]),a=kn(t),c=_e(t,"memo"),d=qt(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 p=d&&m?pe("key",m):null,h=l.source.type===4&&l.source.constType>0,v=h?64:d?128:256;return l.codegenNode=Ut(o,s(Ft),void 0,i,v,void 0,void 0,!0,!h,!1,t.loc),()=>{let k;const{children:b}=l;process.env.NODE_ENV!=="production"&&a&&t.children.some(R=>{if(R.type===1){const T=qt(R,"key");if(T)return o.onError(oe(33,T.loc)),!0}});const C=b.length!==1||b[0].type!==1,w=En(t)?t:a&&t.children.length===1&&En(t.children[0])?t.children[0]:null;if(w?(k=w.codegenNode,a&&p&&wn(k,p,o)):C?k=Ut(o,s(Ft),p?Oe([p]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(k=b[0].codegenNode,a&&p&&wn(k,p,o),k.isBlock!==!h&&(k.isBlock?(r(dt),r(Lt(o.inSSR,k.isComponent))):r($t(o.inSSR,k.isComponent))),k.isBlock=!h,k.isBlock?(s(dt),s(Lt(o.inSSR,k.isComponent))):s($t(o.inSSR,k.isComponent))),c){const R=Tt(_o(l.parseResult,[Q("_cached")]));R.body=Pc([Fe(["const _memo = (",c.exp,")"]),Fe(["if (_cached",...m?[" && _cached.key === ",m]:[],` && ${o.helperString(ss)}(_cached, _memo)) return _cached`]),Fe(["const _item = ",k]),Q("_item.memo = _memo"),Q("return _item")]),i.arguments.push(R,Q("_cache"),Q(String(o.cached.length))),o.cached.push(null)}else i.arguments.push(Tt(_o(l.parseResult),k,!0))}})});function Hd(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}Ms(r,o);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=o,{source:c,value:d,key:m,index:p}=r,h={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:m,objectIndexAlias:p,parseResult:r,children:kn(t)?t.children:[t]};o.replaceNode(h),a.vFor++;const v=s&&s(h);return()=>{a.vFor--,v&&v()}}function Ms(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(mt(t.source,n),t.key&&mt(t.key,n,!0),t.index&&mt(t.index,n,!0),t.value&&mt(t.value,n,!0)),t.finalized=!0)}function _o({value:t,key:n,index:o},s=[]){return Ud([t,n,o,...s])}function Ud(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 Rs=Q("undefined",!1),qd=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=_e(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},Wd=(t,n,o,s)=>Tt(t,o,!1,!0,o.length?o[0].loc:s);function Kd(t,n,o=Wd){n.helper(fo);const{children:s,loc:r}=t,l=[],i=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=_e(t,"slot",!0);if(c){const{arg:C,exp:w}=c;C&&!Se(C)&&(a=!0),l.push(pe(C||Q("default",!0),o(w,void 0,s,r)))}let d=!1,m=!1;const p=[],h=new Set;let v=0;for(let C=0;C<s.length;C++){const w=s[C];let R;if(!kn(w)||!(R=_e(w,"slot",!0))){w.type!==3&&p.push(w);continue}if(c){n.onError(oe(37,R.loc));break}d=!0;const{children:T,loc:g}=w,{arg:N=Q("default",!0),exp:M,loc:F}=R;let E;Se(N)?E=N?N.content:"default":a=!0;const I=_e(w,"for"),H=o(M,I,T,g);let U,G;if(U=_e(w,"if"))a=!0,i.push(uo(U.exp,Tn(N,H,v++),Rs));else if(G=_e(w,/^else(?:-if)?$/,!0)){let Z=C,$;for(;Z--&&($=s[Z],!!ko($)););if($&&kn($)&&_e($,/^(?:else-)?if$/)){let O=i[i.length-1];for(;O.alternate.type===19;)O=O.alternate;O.alternate=G.exp?uo(G.exp,Tn(N,H,v++),Rs):Tn(N,H,v++)}else n.onError(oe(30,G.loc))}else if(I){a=!0;const Z=I.forParseResult;Z?(Ms(Z,n),i.push(he(n.helper(so),[Z.source,Tt(_o(Z),Tn(N,H),!0)]))):n.onError(oe(32,I.loc))}else{if(E){if(h.has(E)){n.onError(oe(38,F));continue}h.add(E),E==="default"&&(m=!0)}l.push(pe(N,H))}}if(!c){const C=(w,R)=>{const T=o(w,void 0,R,r);return n.compatConfig&&(T.isNonScopedSlot=!0),pe("default",T)};d?p.length&&!p.every(bo)&&(m?n.onError(oe(39,p[0].loc)):l.push(C(void 0,p))):l.push(C(void 0,s))}const k=a?2:$n(t.children)?3:1;let b=Oe(l.concat(pe("_",Q(k+(process.env.NODE_ENV!=="production"?` /* ${vc[k]} */`:""),!1))),r);return i.length&&(b=he(n.helper(os),[b,ft(i)])),{slots:b,hasDynamicSlots:a}}function Tn(t,n,o){const s=[pe("name",t),pe("fn",n)];return o!=null&&s.push(pe("key",Q(String(o),!0))),Oe(s)}function $n(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||$n(o.children))return!0;break;case 9:if($n(o.branches))return!0;break;case 10:case 11:if($n(o.children))return!0;break}}return!1}const Fs=new WeakMap,Gd=(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?Zd(t,n):`"${s}"`;const a=mc(i)&&i.callee===eo;let c,d,m=0,p,h,v,k=a||i===Pt||i===Jn||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const b=Ps(t,n,void 0,l,a);c=b.props,m=b.patchFlag,h=b.dynamicPropNames;const C=b.directives;v=C&&C.length?ft(C.map(w=>Yd(w,n))):void 0,b.shouldUseBlock&&(k=!0)}if(t.children.length>0)if(i===mn&&(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!==Pt&&i!==mn){const{slots:C,hasDynamicSlots:w}=Kd(t,n);d=C,w&&(m|=1024)}else if(t.children.length===1&&i!==Pt){const C=t.children[0],w=C.type,R=w===5||w===8;R&&Ae(C,n)===0&&(m|=1),R||w===2?d=C:d=t.children}else d=t.children;h&&h.length&&(p=Xd(h)),t.codegenNode=Ut(n,i,c,d,m===0?void 0:m,p,v,!!k,!1,l,t.loc)};function Zd(t,n,o=!1){let{tag:s}=t;const r=Bo(s),l=qt(t,"is",!1,!0);if(l)if(r||st("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 he(n.helper(eo),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=cs(s)||n.isBuiltInComponent(s);return i?(o||n.helper(i),i):(n.helper(Vn),n.components.add(s),Wt(s,"component"))}function Ps(t,n,o=t.props,s,r,l=!1){const{tag:i,loc:a,children:c}=t;let d=[];const m=[],p=[],h=c.length>0;let v=!1,k=0,b=!1,C=!1,w=!1,R=!1,T=!1,g=!1;const N=[],M=H=>{d.length&&(m.push(Oe(zs(d),a)),d=[]),H&&m.push(H)},F=()=>{n.scopes.vFor>0&&d.push(pe(Q("ref_for",!0),Q("true")))},E=({key:H,value:U})=>{if(Se(H)){const G=H.content,Z=Wn(G);if(Z&&(!s||r)&&G.toLowerCase()!=="onclick"&&G!=="onUpdate:modelValue"&&!Xo(G)&&(R=!0),Z&&Xo(G)&&(g=!0),Z&&U.type===14&&(U=U.arguments[0]),U.type===20||(U.type===4||U.type===8)&&Ae(U,n)>0)return;G==="ref"?b=!0:G==="class"?C=!0:G==="style"?w=!0:G!=="key"&&!N.includes(G)&&N.push(G),s&&(G==="class"||G==="style")&&!N.includes(G)&&N.push(G)}else T=!0};for(let H=0;H<o.length;H++){const U=o[H];if(U.type===6){const{loc:G,name:Z,nameLoc:$,value:O}=U;let x=!0;if(Z==="ref"&&(b=!0,F()),Z==="is"&&(Bo(i)||O&&O.content.startsWith("vue:")||st("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(pe(Q(Z,!0,$),Q(O?O.content:"",x,O?O.loc:G)))}else{const{name:G,arg:Z,exp:$,loc:O,modifiers:x}=U,P=G==="bind",se=G==="on";if(G==="slot"){s||n.onError(oe(40,O));continue}if(G==="once"||G==="memo"||G==="is"||P&&rt(Z,"is")&&(Bo(i)||st("COMPILER_IS_ON_ELEMENT",n))||se&&l)continue;if((P&&rt(Z,"key")||se&&h&&rt(Z,"vue:before-update"))&&(v=!0),P&&rt(Z,"ref")&&F(),!Z&&(P||se)){if(T=!0,$)if(P){if(M(),process.env.NODE_ENV!=="production"&&m.some($e=>$e.type===15?$e.properties.some(({key:Ne})=>Ne.type!==4||!Ne.isStatic?!0:Ne.content!=="class"&&Ne.content!=="style"&&!Wn(Ne.content)):!0)&&It("COMPILER_V_BIND_OBJECT_ORDER",n,O),st("COMPILER_V_BIND_OBJECT_ORDER",n)){m.unshift($);continue}F(),M(),m.push($)}else M({type:14,loc:O,callee:n.helper(lo),arguments:s?[$]:[$,"true"]});else n.onError(oe(P?34:35,O));continue}P&&x.some(fe=>fe.content==="prop")&&(k|=32);const De=n.directiveTransforms[G];if(De){const{props:fe,needRuntime:$e}=De(U,t,n);!l&&fe.forEach(E),se&&Z&&!Se(Z)?M(Oe(fe,a)):d.push(...fe),$e&&(p.push(U),Kn($e)&&Fs.set(U,$e))}else hc(G)||(p.push(U),h&&(v=!0))}}let I;if(m.length?(M(),m.length>1?I=he(n.helper(gn),m,a):I=m[0]):d.length&&(I=Oe(zs(d),a)),T?k|=16:(C&&!s&&(k|=2),w&&!s&&(k|=4),N.length&&(k|=8),R&&(k|=32)),!v&&(k===0||k===32)&&(b||g||p.length>0)&&(k|=512),!n.inSSR&&I)switch(I.type){case 15:let H=-1,U=-1,G=!1;for(let O=0;O<I.properties.length;O++){const x=I.properties[O].key;Se(x)?x.content==="class"?H=O:x.content==="style"&&(U=O):x.isHandlerKey||(G=!0)}const Z=I.properties[H],$=I.properties[U];G?I=he(n.helper(jt),[I]):(Z&&!Se(Z.value)&&(Z.value=he(n.helper(ro),[Z.value])),$&&(w||$.value.type===4&&$.value.content.trim()[0]==="["||$.value.type===17)&&($.value=he(n.helper(io),[$.value])));break;case 14:break;default:I=he(n.helper(jt),[he(n.helper(Ht),[I])]);break}return{props:I,directives:p,patchFlag:k,dynamicPropNames:N,shouldUseBlock:v}}function zs(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"||Wn(l))&&Jd(i,r):(n.set(l,r),o.push(r))}return o}function Jd(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=ft([t.value,n.value],t.loc)}function Yd(t,n){const o=[],s=Fs.get(t);s?o.push(n.helperString(s)):(n.helper(to),n.directives.add(t.name),o.push(Wt(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=>pe(i,l)),r))}return ft(o,t.loc)}function Xd(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 Bo(t){return t==="component"||t==="Component"}const Qd=(t,n)=>{if(En(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:l}=Vd(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=he(n.helper(ns),i,s)}};function Vd(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=nt(i.name),r.push(i)));else if(i.name==="bind"&&rt(i.arg,"name")){if(i.exp)o=i.exp;else if(i.arg&&i.arg.type===4){const a=nt(i.arg.content);o=i.exp=Q(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&Se(i.arg)&&(i.arg.content=nt(i.arg.content)),r.push(i)}if(r.length>0){const{props:l,directives:i}=Ps(t,n,r,!1,!1);s=l,i.length&&n.onError(oe(36,i[0].loc))}return{slotName:o,slotProps:s}}const js=(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 p=i.content;process.env.NODE_ENV!=="production"&&p.startsWith("vnode")&&o.onError(oe(52,i.loc)),p.startsWith("vue:")&&(p=`vnode-${p.slice(4)}`);const h=n.tagType!==0||p.startsWith("vnode")||!/[A-Z]/.test(p)?yc(nt(p)):`on:${p}`;a=Q(h,!0,i.loc)}else a=Fe([`${o.helperString(co)}(`,i,")"]);else a=i,a.children.unshift(`${o.helperString(co)}(`),a.children.push(")");let c=t.exp;c&&!c.content.trim()&&(c=void 0);let d=o.cacheHandlers&&!c&&!o.inVOnce;if(c){const p=ps(c),h=!(p||Gc(c)),v=c.content.includes(";");process.env.NODE_ENV!=="production"&&mt(c,o,!1,v),(h||d&&p)&&(c=Fe([`${h?"$event":"(...args)"} => ${v?"{":"("}`,c,v?"}":")"]))}let m={props:[pe(a,c||Q("() => {}",!1,r))]};return s&&(m=s(m)),d&&(m.props[0].value=o.cache(m.props[0].value)),m.props.forEach(p=>p.key.isHandlerKey=!0),m},ef=(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=nt(l.content):l.content=`${o.helperString(ao)}(${l.content})`:(l.children.unshift(`${o.helperString(ao)}(`),l.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&Hs(l,"."),s.some(a=>a.content==="attr")&&Hs(l,"^")),{props:[pe(l,i)]}},Hs=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},tf=(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(vo(i)){r=!0;for(let a=l+1;a<o.length;a++){const c=o[a];if(vo(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(vo(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!n.ssr&&Ae(i,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Rt[1]} */`:"")),o[l]={type:12,content:i,loc:i.loc,codegenNode:he(n.helper(Qn),a)}}}}},Us=new WeakSet,nf=(t,n)=>{if(t.type===1&&_e(t,"once",!0))return Us.has(t)||n.inVOnce||n.inSSR?void 0:(Us.add(t),n.inVOnce=!0,n.helper(yn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},qs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(oe(41,t.loc)),Zt();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)),Zt();if(a==="literal-const"||a==="setup-const")return o.onError(oe(45,s.loc)),Zt();if(!i.trim()||!ps(s))return o.onError(oe(42,s.loc)),Zt();const c=r||Q("modelValue",!0),d=r?Se(r)?`onUpdate:${nt(r.content)}`:Fe(['"onUpdate:" + ',r]):"onUpdate:modelValue";let m;const p=o.isTS?"($event: any)":"$event";m=Fe([`${p} => ((`,s,") = $event)"]);const h=[pe(c,t.exp),pe(d,m)];if(t.modifiers.length&&n.tagType===1){const v=t.modifiers.map(b=>b.content).map(b=>(yo(b)?b:JSON.stringify(b))+": true").join(", "),k=r?Se(r)?`${r.content}Modifiers`:Fe([r,' + "Modifiers"']):"modelModifiers";h.push(pe(k,Q(`{ ${v} }`,!1,t.loc,2)))}return Zt(h)};function Zt(t=[]){return{props:t}}const of=/[\w).+\-_$\]]/,sf=(t,n)=>{st("COMPILER_FILTERS",n)&&(t.type===5?Ln(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&Ln(o.exp,n)}))};function Ln(t,n){if(t.type===4)Ws(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?Ws(s,n):s.type===8?Ln(t,n):s.type===5&&Ln(s.content,n))}}function Ws(t,n){const o=t.content;let s=!1,r=!1,l=!1,i=!1,a=0,c=0,d=0,m=0,p,h,v,k,b=[];for(v=0;v<o.length;v++)if(h=p,p=o.charCodeAt(v),s)p===39&&h!==92&&(s=!1);else if(r)p===34&&h!==92&&(r=!1);else if(l)p===96&&h!==92&&(l=!1);else if(i)p===47&&h!==92&&(i=!1);else if(p===124&&o.charCodeAt(v+1)!==124&&o.charCodeAt(v-1)!==124&&!a&&!c&&!d)k===void 0?(m=v+1,k=o.slice(0,v).trim()):C();else{switch(p){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(p===47){let w=v-1,R;for(;w>=0&&(R=o.charAt(w),R===" ");w--);(!R||!of.test(R))&&(i=!0)}}k===void 0?k=o.slice(0,v).trim():m!==0&&C();function C(){b.push(o.slice(m,v).trim()),m=v+1}if(b.length){for(process.env.NODE_ENV!=="production"&&bn("COMPILER_FILTERS",n,t.loc),v=0;v<b.length;v++)k=rf(k,b[v],n);t.content=k,t.ast=void 0}}function rf(t,n,o){o.helper(no);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Wt(n,"filter")}(${t})`;{const r=n.slice(0,s),l=n.slice(s+1);return o.filters.add(r),`${Wt(r,"filter")}(${t}${l!==")"?","+l:l}`}}const Ks=new WeakSet,lf=(t,n)=>{if(t.type===1){const o=_e(t,"memo");return!o||Ks.has(t)||n.inSSR?void 0:(Ks.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&mo(s,n),t.codegenNode=he(n.helper(po),[o.exp,Tt(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}},af=(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=nt(s.content);(ds.test(r[0])||r[0]==="-")&&(o.exp=Q(r,!1,s.loc))}}}};function cf(t){return[[af,nf,Rd,lf,jd,sf,...process.env.NODE_ENV!=="production"?[Md]:[],Qd,Gd,qd,tf],{on:js,bind:ef,model:qs}]}function df(t,n={}){const o=n.onError||go,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=tt({},n,{prefixIdentifiers:r}),i=ye(t)?dd(t,l):t,[a,c]=cf();return md(i,tt({},l,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:tt({},c,n.directiveTransforms||{})})),vd(i,l)}const ff=()=>({props:[]});const Gs=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),Zs=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Js=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),Ys=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),To=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),Xs=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),Qs=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),Vs=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),$o=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),er=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");Mc({[Gs]:"vModelRadio",[Zs]:"vModelCheckbox",[Js]:"vModelText",[Ys]:"vModelSelect",[To]:"vModelDynamic",[Xs]:"withModifiers",[Qs]:"withKeys",[Vs]:"vShow",[$o]:"Transition",[er]:"TransitionGroup"});let At;function pf(t,n=!1){return At||(At=document.createElement("div")),n?(At.innerHTML=`<div foo="${t.replace(/"/g,"&quot;")}">`,At.children[0].getAttribute("foo")):(At.innerHTML=t,At.textContent)}const uf={parseMode:"html",isVoidTag:$c,isNativeTag:t=>_c(t)||Bc(t)||Tc(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:pf,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return $o;if(t==="TransitionGroup"||t==="transition-group")return er},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}},mf=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:hf(n.value.content,n.loc),modifiers:[],loc:n.loc})})},hf=(t,n)=>{const o=wc(t);return Q(JSON.stringify(o),!1,n,3)};function Pe(t,n){return oe(t,n,process.env.NODE_ENV!=="production"?gf:void 0)}const gf={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."},yf=(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:[pe(Q("innerHTML",!0,r),s||Q("",!0))]}},vf=(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:[pe(Q("textContent",!0),s?Ae(s,o)>0?s:he(o.helperString(hn),[s],r):Q("",!0))]}},bf=(t,n,o)=>{const s=qs(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=_e(n,"bind");a&&rt(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=Js,c=!1;if(l==="input"||i){const d=qt(n,"type");if(d){if(d.type===7)a=To;else if(d.value)switch(d.value.content){case"radio":a=Gs;break;case"checkbox":a=Zs;break;case"file":c=!0,o.onError(Pe(60,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else Zc(n)?a=To:process.env.NODE_ENV!=="production"&&r()}else l==="select"?a=Ys: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},kf=Ue("passive,once,capture"),Ef=Ue("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),wf=Ue("left,right"),tr=Ue("onkeyup,onkeydown,onkeypress"),xf=(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)||kf(c)?i.push(c):wf(c)?Se(t)?tr(t.content.toLowerCase())?r.push(c):l.push(c):(r.push(c),l.push(c)):Ef(c)?l.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:l,eventOptionModifiers:i}},nr=(t,n)=>Se(t)&&t.content.toLowerCase()==="onclick"?Q(n,!0):t.type!==4?Fe(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,Nf=(t,n,o)=>js(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}=xf(l,r,o,t.loc);if(c.includes("right")&&(l=nr(l,"onContextmenu")),c.includes("middle")&&(l=nr(l,"onMouseup")),c.length&&(i=he(o.helper(Xs),[i,JSON.stringify(c)])),a.length&&(!Se(l)||tr(l.content.toLowerCase()))&&(i=he(o.helper(Qs),[i,JSON.stringify(a)])),d.length){const m=d.map(Zn).join("");l=Se(l)?Q(`${l.content}${m}`,!0):Fe(["(",l,`) + "${m}"`])}return{props:[pe(l,i)]}}),Cf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Pe(62,r)),{props:[],needRuntime:o.helper(Vs)}},Sf=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===$o)return()=>{if(!t.children.length)return;or(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 or(t){const n=t.children=t.children.filter(s=>!ko(s)),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(or)}const _f=(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 Bf(t,n){return t==="template"?!0:t in sr?sr[t].has(n):n in rr?rr[n].has(t):!(t in ir&&ir[t].has(n)||n in lr&&lr[n].has(t))}const Dt=new Set(["h1","h2","h3","h4","h5","h6"]),ht=new Set([]),sr={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:ht,iframe:ht,option:ht,textarea:ht,style:ht,title:ht},rr={html:ht,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"])},ir={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"])},lr={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:Dt,h2:Dt,h3:Dt,h4:Dt,h5:Dt,h6:Dt},Tf=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!Bf(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)}},$f=[mf,...process.env.NODE_ENV!=="production"?[Sf,Tf]:[]],Lf={cloak:ff,html:yf,text:vf,model:bf,on:Nf,show:Cf};function If(t,n={}){return df(t,tt({},uf,n,{nodeTransforms:[_f,...$f,...n.nodeTransforms||[]],directiveTransforms:tt({},Lf,n.directiveTransforms||{}),transformHoist:null}))}function Af(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=If(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)(wr);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const Lo={};function Df(t){return Lo[t]||(Lo[t]=Af(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}}})),Lo[t]}const Of={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},Mf={class:"flex items-center gap-2"},Rf=["disabled"],Ff={class:"text-sm"},Pf=["disabled"],zf=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",Of,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",Mf,[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,Rf),e.createElementVNode("span",Ff,"Сторінка "+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,Pf)])]))}}),jf={class:"relative inline-flex"},Hf=["aria-label"],Uf={class:"px-3 pb-2"},qf={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Wf=["onClick"],Kf={class:"truncate"},Gf={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"},Zf="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",Jf=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),p=e.ref({top:0,left:0}),h=e.computed(()=>{if(!i.value)return a.value;const T=i.value.toLowerCase();return a.value.filter(g=>v(g).toLowerCase().includes(T))});e.watch(()=>o.columns,T=>{if(!T){a.value=[];return}const g=JSON.stringify(T),N=JSON.stringify(a.value);g!==N&&(a.value=[...T])},{deep:!0}),e.watch(a,T=>{s("update:columns",T)},{deep:!0});function v(T){return T.ua||T.label||T.name||"Колонка"}function k(T){const g=!T.hidden;g&&a.value.filter(N=>!N.hidden).length<=1||(T.hidden=g)}function b(){l.value=!l.value,l.value&&e.nextTick(()=>{m.value?.focus(),C()})}function C(){if(!c.value)return;const T=c.value.getBoundingClientRect();p.value={top:T.bottom+window.scrollY+6,left:T.left+window.scrollX-200}}function w(T){if(!l.value)return;const g=T.target;g&&(d.value?.contains(g)||c.value?.contains(g)||(l.value=!1))}function R(T){T.key==="Escape"&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",w,!0),document.addEventListener("keydown",R)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",w,!0),document.removeEventListener("keydown",R)}),(T,g)=>(e.openBlock(),e.createElementBlock("div",jf,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:b,class:e.normalizeClass([Zf,e.unref(r).class]),"aria-label":e.unref(r)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},[...g[2]||(g[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,Hf),(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:`${p.value.top}px`,left:`${p.value.left}px`})},[g[5]||(g[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",Uf,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,"onUpdate:modelValue":g[0]||(g[0]=N=>i.value=N),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",qf,[g[4]||(g[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:g[1]||(g[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,N=>(e.openBlock(),e.createElementBlock("li",{key:N.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:M=>k(N)},[e.createElementVNode("span",Kf,e.toDisplayString(v(N)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",N.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[N.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Gf,[...g[3]||(g[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])]))],2)],8,Wf))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),Yf=["data-action-key"],Xf=["onClick"],Qf={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"},Vf={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"},ep={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"},tp={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"},np=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 b=k.getBoundingClientRect(),C=8,w=160,g=(o.actions?.length??0)*36+C*2,N=i.value.height||(typeof window<"u"?window.innerHeight:0),M=i.value.width||(typeof window<"u"?window.innerWidth:0),F=i.value.scrollX||(typeof window<"u"?window.scrollX:0),E=i.value.scrollY||(typeof window<"u"?window.scrollY:0);let I=b.bottom+E+C,H=b.right+F-w;const U=F+M-w-C;return H>U&&(H=U),H<F+C&&(H=F+C),I+g>E+N-C&&(I=b.top+E-g-C),I<E+C&&(I=E+C),{top:`${I}px`,left:`${H}px`,width:"auto"}});function p(){typeof window>"u"||(i.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function h(){typeof window>"u"||a.value||(a.value=!0,p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p))}function v(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",p),window.removeEventListener("resize",p))}return e.watch(()=>o.isOpen,k=>{k?h():v()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&h()}),e.onBeforeUnmount(()=>{v()}),(k,b)=>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"])},[...b[1]||(b[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:b[0]||(b[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,C=>(e.openBlock(),e.createElementBlock("button",{key:C.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",C.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:w=>d(C)},[e.renderSlot(k.$slots,"icon",{action:C},()=>[C.type==="view"?(e.openBlock(),e.createElementBlock("svg",Qf,[...b[2]||(b[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)])])):C.type==="edit"?(e.openBlock(),e.createElementBlock("svg",Vf,[...b[3]||(b[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)])])):C.type==="delete"?(e.openBlock(),e.createElementBlock("svg",ep,[...b[4]||(b[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",tp,[...b[5]||(b[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])]))]),e.createTextVNode(" "+e.toDisplayString(C.label),1)],10,Xf))),128))],4)):e.createCommentVNode("",!0)]))],8,Yf)):e.createCommentVNode("",!0)}}),ar=typeof window<"u",cr=typeof document<"u";function op(t){if(!cr)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 dr(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 Io(t,n){if(!cr||!ar)return;const o=op(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!ar)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 Ao(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 sp={mounted(t,n){const o=dr(n.value);o&&Io(t,o)},updated(t,n){const o=dr(n.value),s=t;if(!o){Ao(s);return}const r=s.__tooltipState__;if(!r){Io(s,o);return}if(r.options.wrap!==o.wrap){Ao(s),Io(s,o);return}r.options=o},unmounted(t){Ao(t)}},rp={class:"flex flex-col gap-4 mb-[15px]"},ip={class:"flex flex-wrap items-center gap-4"},lp={class:"relative"},ap={class:"ml-auto flex items-center gap-2"},cp={class:"overflow-x-auto"},dp={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"},fp={class:"text-left font-medium text-gray-700"},pp={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},up={class:"divide-y divide-gray-200"},mp=["href"],hp={key:2},gp={key:3},yp={key:0,class:"py-2 pr-4 text-right"},vp={key:0},bp={key:0},kp=["colspan"],fr=e.defineComponent({__name:"TableWidget",props:{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=sp,l=t,i=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),m=e.ref(1),p=e.ref(10),h=e.ref(0),v=e.ref(0),k=e.ref("id"),b=e.ref("");let C=null,w=0;const R=e.ref(null);async function T(){const y=m.value,L=++w,S=new URLSearchParams,B=d.value.trim();B&&S.set("search",B),S.set("page",String(y)),S.set("limit",String(p.value));const V=`/api/data/${l.token}${S.toString()?`?${S.toString()}`:""}`;let Y;try{const ve=await fetch(V);if(!ve.ok)throw new Error(`Request failed with status ${ve.status}`);Y=await ve.json()}catch(ve){L===w&&(o.value=[],v.value=0,h.value=0),console.error("Failed to load table data",ve);return}if(L!==w)return;o.value=Array.isArray(Y?.rows)?Y.rows:[],s.value=G(Y?.columns||[]),i.value=Array.isArray(Y?.actions)?Y.actions:[],a.value=Y?.form,c.value=Y?.addToken,k.value=typeof Y?.pk=="string"&&Y.pk?Y.pk:k.value,typeof Y?.form=="string"&&Y.form&&(b.value=Y.form.replace(/\.form$/,".table")),J();const ne=Number(Y?.total??Y?.count??Y?.totalCount),ue=Number(Y?.filtered??Y?.filteredCount);h.value=Number.isFinite(ne)&&ne>0?ne:o.value.length,v.value=Number.isFinite(ue)&&ue>0?ue:Math.max(o.value.length,h.value);const Me=Math.max(1,Math.ceil((v.value||o.value.length||1)/p.value));let Re=y;typeof Y?.page=="number"&&Y.page>0&&(Re=Y.page),Re>Me&&(Re=Me),Re<1&&(Re=1);const ct=Re!==y;if(m.value=Re,ct&&v.value>0)return T()}const{$notify:g,$confirm:N,$form:M}=n?.appContext?.config?.globalProperties||{};function F(){if(Ee.emitter?.emit){Ee.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}T()}async function E(y){typeof M=="function"&&(await M({token:y.token}),F())}async function I(){typeof M=="function"&&(await M({token:c.value}),F())}function H(y){N({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const L=await fetch(`/api/table/${y.token}`,{method:"DELETE"});if(!L.ok){const{error:S}=await L.json();g({title:"Помилка",type:"warning",message:S});return}g({title:"Видаленно",message:"Успішно видалено"}),await T()}})}e.onMounted(async()=>{await T(),Ee.emitter?.on?.("updateCard",T)}),e.onBeforeUnmount(()=>{Ee.emitter?.off?.("updateCard",T)});function U(y){return typeof y?.format=="string"?y.format.toLowerCase():""}function G(y){const L=new Map;s.value.forEach(B=>{B?.name&&L.set(B.name,!!B.hidden)});const S=y.map(B=>{const V=L.has(B.name)?L.get(B.name):!!B.hidden;return{...B,hidden:V}});return S.length&&!S.some(B=>!B.hidden)&&(S[0].hidden=!1),S}const Z=e.computed(()=>{const y=s.value.filter(L=>!L.hidden);return y.length?y:s.value}),$=e.computed(()=>{const y=[],L=new Set;for(const S of i.value){if(typeof S=="string"){if(S==="edit"){const B="row:edit";L.has(B)||(y.push({key:B,type:"edit",label:"Редагувати",scope:"row",handler:le}),L.add(B));continue}if(S==="delete"||S==="del"){const B="row:delete";L.has(B)||(y.push({key:B,type:"delete",label:"Видалити",scope:"row",handler:ge,variant:"danger"}),L.add(B));continue}if(S==="add"){const B="toolbar:add";L.has(B)||(y.push({key:B,type:"add",label:"Додати",scope:"toolbar"}),L.add(B))}continue}if(S&&typeof S=="object"){const B=String(S.name??S.type??"action"),V=String(S.label??S.title??B),Y=S.scope==="toolbar"?"toolbar":"row",ne=`${Y}:${B}`;if(L.has(ne))continue;L.add(ne),y.push({key:ne,type:B,label:V,scope:Y,handler:Y==="row"?ue=>re(S,ue):void 0,variant:S.variant==="danger"?"danger":"default",original:S})}}return y}),O=e.computed(()=>$.value.filter(y=>y.scope==="row"&&typeof y.handler=="function")),x=e.computed(()=>$.value.filter(y=>y.scope==="toolbar")),P=e.computed(()=>O.value.length>0),se=e.computed(()=>x.value.some(y=>y.type==="add")),De=e.computed(()=>o.value),fe=e.computed(()=>{const y=v.value||De.value.length,L=Math.ceil(y/p.value);return L>0?L:1}),$e=e.computed(()=>{const y=De.value.length,L=v.value||y,S=h.value||L;return`Показано ${y} з ${L} (усього ${S})`});function Ne(){m.value<fe.value&&(m.value+=1,T())}function ze(){m.value>1&&(m.value-=1,T())}e.watch(s,y=>{y?.length&&(y.some(L=>!L.hidden)||(y[0].hidden=!1))},{deep:!0});function lt(){C&&clearTimeout(C),J(),C=setTimeout(()=>{m.value=1,T()},300)}function je(y){const L=k.value||"id",S=y?.token??y?.[L]??y?.id;return S?String(S):""}function qe(y){const L=Z.value[y],S=["py-2",...f(L)];y===0&&S.push("pl-4");const B=y===Z.value.length-1&&!P.value;return S.push(B?"pr-4":"pr-5"),S.join(" ")}function q(y,L){const S=["py-2",...f(L)];U(L)==="badge"&&S.push("center"),W(L)==="wrap"?S.push("whitespace-normal","break-words"):S.push("truncate"),y===0&&S.push("pl-4");const B=y===Z.value.length-1&&!P.value;return S.push(B?"pr-4":"pr-5"),S.join(" ")}function W(y){return(typeof y?.overflow=="string"?y.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function f(y){const L=[],S=ne=>{if(ne==null||ne==="")return;const ue=Number(ne);return Number.isFinite(ue)&&ue>0?`${ue}px`:String(ne).replace(/\s+/g,"")},B=S(y?.width),V=S(y?.minWidth),Y=S(y?.maxWidth);return B?(L.push(`min-w-[${B}]`,`max-w-[${B}]`),L):(L.push(`min-w-[${V??"100px"}]`),L.push(`max-w-[${Y??"350px"}]`),L)}function _(y){if(!O.value.length)return!1;const L=k.value||"id";return!!(y?.token||y?.[L]||y?.id)}function D(y){return R.value===je(y)}function j(y){const L=je(y);L&&(R.value=R.value===L?null:L)}function J(){R.value=null}function K(y,L){const S=L?.tooltip;if(!S)return;const B=Vt(y,L);let V,Y=L?.tooltipWrap!==!1;if(typeof S=="string"){const ne=S.trim();if(!ne)return;const ue=ne.toLowerCase();if(["true","1","yes"].includes(ue))V=typeof B=="string"?B:String(B??"");else{if(["false","0","no"].includes(ue))return;V=ne}}else S===!0?V=B:typeof S=="object"&&(typeof S.text=="string"&&(V=S.text.trim()),typeof S.wrap=="boolean"&&(Y=S.wrap!==!1));if(!V){if(B==null||B==="")return;V=String(B)}if(V.trim())return Y?{text:V,wrap:!0}:V}function le(y){J(),E(y)}function ge(y){J(),H(y)}async function re(y,L){J();const S=k.value||"id",B=y.isId?L?.[S]??L?.id:L?.token??L?.[S]??L?.id;if(!B){console.warn("Cannot execute action without identifier",y);return}if(y.form&&typeof y.api=="string"&&y.api&&typeof M=="function"){await Ke(y,L,B);return}if(y.form&&typeof M=="function"){const V=await Xe(y.form,B),Y={form:y.form,token:V?.token??L?.token??B,schema:V?.schema,mode:V?.mode??"edit"};V?.data!==void 0&&(Y.defaultValue=V.data);try{await M(Y),F()}catch(ne){console.error("Failed to execute form action",ne)}return}if(typeof y.api=="string"&&y.api){const V=We(y.api,B);window.location.href=V;return}L?.token&&typeof M=="function"&&(await M({token:L.token}),F())}function We(y,L){return`${y.endsWith("/")?y:`${y}/`}${L}`}async function Xe(y,L){const S=`/api/form/${y}/${L}`;try{const B=await fetch(S);if(!B.ok)throw new Error(`Request failed with status ${B.status}`);return await B.json()}catch(B){console.error("Failed to load form config",B),g({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function Xt(y){const L=`/api/template/form/${y}`;try{const S=await fetch(L);if(!S.ok)throw new Error(`Request failed with status ${S.status}`);return(await S.json())?.schema}catch(S){console.error("Failed to load form template",S);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:L,token:S,mode:B,message:V,successMessage:Y,...ne}=y;if(Object.keys(ne).length)return ne}}}async function Ke(y,L,S){const B=We(y.api,S),V=(typeof y.method=="string"?y.method:"PUT").toUpperCase();let Y;try{const ve=await fetch(B);if(!ve.ok)throw new Error(`Request failed with status ${ve.status}`);Y=await ve.json()}catch(ve){console.error("Failed to load action data",ve),vt("Не вдалося отримати дані форми.");return}const ne=typeof y.form=="string"?y.form.replace(/\.table$/,".form"):void 0,ue=Y?.schema??(ne?await Xt(ne):void 0),Me={mode:Y?.mode??"edit"};ne&&(Me.form=ne),ue&&(Me.schema=ue);const Re=He(Y);Re!==void 0&&(Me.defaultValue=Re);const ct=await M(Me);if(ct)try{const ve=await fetch(B,{method:V,headers:{"Content-Type":"application/json"},body:JSON.stringify(ct)});if(!ve.ok){const kt=await yt(ve),en=kt?.error??kt?.message??"Не вдалося зберегти дані.";throw new Error(en)}Qt(`Дані успішно ${Me.value==="add"?"збережено":"оновлено"}`),F()}catch(ve){console.error("Failed to submit action data",ve),vt("Не вдалося зберегти дані.")}}async function yt(y){try{return await y.json()}catch{return}}function vt(y){g({title:"Помилка",type:"error",message:y})}function Qt(y){g({title:"Успіх",type:"success",message:y})}function Ot(y){if(!R.value)return;const L=y.target;if(!L)return;const S=L.closest("[data-action-key]");S&&S.getAttribute("data-action-key")===R.value||J()}e.onMounted(()=>{document.addEventListener("click",Ot,!0)}),e.onBeforeUnmount(()=>{C&&clearTimeout(C),document.removeEventListener("click",Ot,!0),Ee.emitter?.off?.("updateCard",T)});function Qe(y,L){const B=y?.[`${L.name}_text`];if(Array.isArray(B))return B.length?B.join(", "):"-";if(B!=null&&B!=="")return B;const V=y?.[L.name];return Array.isArray(V)?V.length?V.join(", "):"-":V??"-"}function bt(y,L){const B=y?.[`${L.name}_data`];if(B&&typeof B=="object")return{text:B.text??B.label??B.name??B.title??"-",color:B.color,textColor:B.textColor};const V=y?.[`${L.name}_text`]??y?.[L.name];return{text:(Array.isArray(V)?V.join(", "):V)??"-"}}function at(y,L){const S=bt(y,L);return S.color?{backgroundColor:S.color,color:S.textColor??"#ffffff"}:{}}function Vt(y,L){const S=U(L);if(S==="badge")return bt(y,L).text;if(S==="select")return Qe(y,L);if(S==="slot")return"-";if(S==="text")return y?.[L.name]??"-";const B=y?.[`${L.name}_data`];return B!=null&&typeof B!="object"?B:y?.[`${L.name}_text`]??y?.[L.name]??"-"}return(y,L)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",rp,[e.createElementVNode("div",ip,[e.createElementVNode("div",lp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":L[0]||(L[0]=S=>d.value=S),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:lt},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",ap,[e.createVNode(Jf,{columns:s.value,"onUpdate:columns":L[1]||(L[1]=S=>s.value=S)},null,8,["columns"]),se.value&&c.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:I,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":"Додати запис"},[...L[2]||(L[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",cp,[e.createElementVNode("table",dp,[e.createElementVNode("thead",fp,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(S,B)=>(e.openBlock(),e.createElementBlock("th",{key:S.name,class:e.normalizeClass(qe(B))},e.toDisplayString(S.ua),3))),128)),P.value?(e.openBlock(),e.createElementBlock("th",pp," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",up,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,S=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:S.id??JSON.stringify(S)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(B,V)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:B.name,class:e.normalizeClass(q(V,B))},[B.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:B.link.replace("{{id}}",S.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(Vt(S,B)),9,mp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[U(B)==="slot"&&(B.slot?.content||B.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Df)(B.slot.content||B.slot)),{key:0,data:S,row:S,column:B,value:S?.[B.name]},null,8,["data","row","column","value"])):U(B)==="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(at(S,B))},e.toDisplayString(bt(S,B).text),5)):U(B)==="select"?(e.openBlock(),e.createElementBlock("span",hp,e.toDisplayString(Qe(S,B)),1)):(e.openBlock(),e.createElementBlock("span",gp,e.toDisplayString(Vt(S,B)),1))],64))],2)),[[e.unref(r),K(S,B)]])),128)),P.value?(e.openBlock(),e.createElementBlock("td",yp,[_(S)?(e.openBlock(),e.createElementBlock("div",vp,[e.createVNode(np,{row:S,actions:O.value,"is-open":D(S),"action-key":je(S),onToggle:B=>j(S)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),De.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",bp,[e.createElementVNode("td",{colspan:Z.value.length+(P.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,kp)]))])])]),e.createVNode(zf,{"current-page":m.value,"total-pages":fe.value,label:$e.value,onPrevious:ze,onNext:Ne},null,8,["current-page","total-pages","label"])]))}}),Ep={class:"p-[20px]"},wp={class:"flex gap-[6px] mb-5"},xp={class:"vs-form-text relative bg-white rounded-lg flex-grow"},Np={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},Cp={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Sp={class:"space-y-8"},_p={key:0},Bp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Tp=["onClick"],$p={class:"md:col-span-2"},Lp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Ip={class:"text-sm text-gray-500 dark:text-neutral-500"},Ap={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Dp=["checked","onChange"],Op={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Mp={class:"md:col-span-2"},Rp={class:"font-semibold text-gray-800 dark:text-neutral-200"},Fp=["onClick"],Pp={class:"md:col-span-2"},zp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},jp={class:"text-sm text-gray-500 dark:text-neutral-500"},Hp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Up=["checked","onChange"],In="uk",An=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return In;const g=localStorage.language,N=typeof navigator<"u"?navigator.language:In;return(g||N||In).split(/[-_]/)[0].toLowerCase()||In},s=t,r=e.ref(""),l=["view","add","edit","del"],i=e.ref({}),a=e.ref(o()),c=()=>{a.value=o()},d=()=>{const g=[];return a.value&&g.push(a.value),n.forEach(N=>{N&&!g.includes(N)&&g.push(N)}),g.includes("path")||g.push("path"),g},m=g=>{const N=d();for(const M of N){const F=g[M];if(typeof F=="string"&&F.trim())return F}return""};e.onMounted(async()=>{c();const N=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();N.routes&&N.routes.forEach(M=>{i.value[M.path]=new Set(M.actions)})});const p=(g,N)=>i.value[g]?.has(N)??!1,h=(g,N)=>{i.value[g]||(i.value[g]=new Set),i.value[g].has(N)?i.value[g].delete(N):i.value[g].add(N)},v=(g,N)=>{g.forEach(M=>{M.path&&(i.value[M.path]||(i.value[M.path]=new Set),i.value[M.path].has(N)?i.value[M.path].delete(N):i.value[M.path].add(N))})},k=e.computed(()=>Object.entries(i.value).map(([g,N])=>({path:g,actions:Array.from(N)})).filter(g=>g.actions.length)),b=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:k.value})}),Ee.notify({title:"Success!",message:"Permissions saved."})},C=()=>{i.value={}},w=g=>{if(!r.value.trim())return g;const N=r.value.toLowerCase();return g.filter(M=>m(M).toLowerCase().includes(N)||(M.path?.toLowerCase().includes(N)??!1))},R=e.computed(()=>w(s.data.routers.filter(g=>!g.menu))),T=e.computed(()=>s.data.routers.filter(g=>g.menu).map(g=>({...g,menu:w(g.menu||[])})).filter(g=>g.menu&&g.menu.length>0));return(g,N)=>(e.openBlock(),e.createElementBlock("div",Ep,[e.createElementVNode("div",wp,[e.createElementVNode("div",xp,[N[1]||(N[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":N[0]||(N[0]=M=>r.value=M),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:C,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:b,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",Np,[N[2]||(N[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,(M,F)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:F},[e.createElementVNode("h3",Cp,e.toDisplayString(M),1)])),64))]),e.createElementVNode("div",Sp,[R.value.length?(e.openBlock(),e.createElementBlock("div",_p,[e.createElementVNode("ul",Bp,[N[3]||(N[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,(M,F)=>e.createElementVNode("li",{key:F,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:E=>v(R.value,l[F])}," Toggle all ",8,Tp)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(M,F)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+F,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",$p,[e.createElementVNode("p",Lp,e.toDisplayString(m(M)),1),e.createElementVNode("p",Ip,e.toDisplayString(M.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(E,I)=>e.createElementVNode("li",{key:I,class:"col-span-1"},[e.createElementVNode("div",Ap,[e.createElementVNode("input",{type:"checkbox",checked:p(M.path,E),onChange:H=>h(M.path,E),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Dp)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(M,F)=>(e.openBlock(),e.createElementBlock("div",{key:F,class:"space-y-5"},[e.createElementVNode("ul",Op,[e.createElementVNode("li",Mp,[e.createElementVNode("h3",Rp,e.toDisplayString(m(M)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(E,I)=>e.createElementVNode("li",{key:I,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:H=>v(M.menu,l[I])}," Toggle all ",8,Fp)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.menu,(E,I)=>(e.openBlock(),e.createElementBlock("ul",{key:I,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Pp,[e.createElementVNode("p",zp,e.toDisplayString(m(E)),1),e.createElementVNode("p",jp,e.toDisplayString(E.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(H,U)=>e.createElementVNode("li",{key:U,class:"col-span-1"},[e.createElementVNode("div",Hp,[e.createElementVNode("input",{type:"checkbox",checked:p(E.path,H),onChange:G=>h(E.path,H),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Up)])])),64))]))),128))]))),128))])]))}}),gt={"vs-widget-comments":on,"vs-widget-history":sn,"vs-widget-gallery":ln,"vs-widget-file":rn,"vs-widget-list":Pn,"vs-widget-map":pn,"vs-widget-table":fr,"vs-group-interface":An};function pr(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 ur(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>ur(o))),n}function qp(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=pr(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 Dn(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>ur(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=Dn(s.items,12))}),qp(o,n),o}function mr(t){const n=pr(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const Wp={class:"text-lg font-semibold text-gray-900"},Kp=["innerHTML"],Gp={key:0,class:"grid grid-cols-12 gap-4"},Zp={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Jp={class:"text-lg font-semibold text-gray-900"},Yp=["innerHTML"],Jt=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(()=>Dn(n.items));function r(d){const m=["col-span-12"],p=mr(d.col);return p.length&&m.push(...p),m}function l(d){return gt[d]||d}function i(d,m){if(!d||typeof m!="string"||!m)return{found:!1,value:void 0};const p=m.split(".");let h=d;for(const v of p){if(h==null||typeof h!="object"&&!Array.isArray(h))return{found:!1,value:void 0};if(!(v in h))return{found:!1,value:void 0};h=h[v]}return{found:!0,value:h}}const a=function(d={}){const m={...d};return Object.entries(m).forEach(([p,h])=>{if(p!=="props"&&typeof h=="string"){const v=i(n.data,h);v.found&&(m[p]=v.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([p,h])=>{if(typeof h=="string"){const v=i(n.data,h);m[p]=v.found?v.value:h}else m[p]=h}),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",Wp,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,Kp)):t.type?.includes("tabs")?(e.openBlock(),e.createBlock(Yt,{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",Gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(p,h)=>(e.openBlock(),e.createElementBlock("div",{key:p.name||p.component||h,class:e.normalizeClass(r(p))},[p.title||p.label?(e.openBlock(),e.createElementBlock("div",Zp,[e.createElementVNode("h3",Jp,e.toDisplayString(p.title||p.label),1)])):e.createCommentVNode("",!0),p.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:p.html,class:"text-gray-900 leading-relaxed"},null,8,Yp)):p.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(p.component)),e.mergeProps({key:2,ref_for:!0},{geom:t.data.geom,id:t.data.id,...c.value,...a(p),data:t.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),Xp={class:"grid grid-cols-12 gap-[20px]"},Qp={key:0,class:"col-span-4"},Vp=["innerHTML"],eu=["onClick"],tu=["innerHTML"],nu={key:1,class:"flex w-full"},ou={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},su=["onClick"],ru={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},iu={class:"flex-1 p-4"},lu=["innerHTML"],au={class:"grid grid-cols-12 gap-4"},cu={key:3,class:"w-full h-full"},Yt=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 $=typeof window<"u"?window:globalThis,O="__vsCardAnonymousCounter__",x=$[O]??0;return $[O]=x+1,x===0?"tab":`tab${x}`}const s=e.ref(0),r=e.ref([]);let l=!1,i=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,$=>{$&&(a.value=$)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function m($,O){const x=O?.path;return x?(c.has(x)||c.set(x,e.defineAsyncComponent(()=>import(x))),c.get(x)):typeof $=="string"&&gt[$]?gt[$]:O?.component&&gt[O.component]?gt[O.component]:O?.name&&gt[O.name]?gt[O.name]:$}function p($){return $.forEach(O=>{O.type&&(O.view=O.type)}),r.value=$.filter(O=>O.type==="pin"),$.filter(O=>O.type!=="pin")}const h=e.computed(()=>{let $;return n.panels&&n.panels.length>0?$=n.normalizeTabs?p(n.panels):n.panels:n.data&&Array.isArray(n.data)&&($=n.data.filter(x=>x.type.includes("tabs"))[0]?.items),Dn($,12)}),v=e.computed(()=>a.value);function k(){i||(i=!0)}const b=e.computed(()=>{let $;return n.panels&&n.panels.length>0?$=n.normalizeTabs?p(n.panels):n.panels:n.data&&Array.isArray(n.data)&&($=n.data),Dn($,12)}),C=e.computed(()=>({[`view-${n.view}`]:!0}));function w($,O){if(!$||typeof O!="string"||!O)return{found:!1,value:void 0};const x=O.split(".");let P=$;for(const se of x){if(P==null||typeof P!="object"&&!Array.isArray(P))return{found:!1,value:void 0};if(!(se in P))return{found:!1,value:void 0};P=P[se]}return{found:!0,value:P}}const R=$=>{const O={...$};return Object.entries(O).forEach(([x,P])=>{if(x!=="props"&&typeof P=="string"){const se=w(n.data,P);se.found&&(O[x]=se.value)}}),$.props&&typeof $.props=="object"&&Object.entries($.props).forEach(([x,P])=>{if(typeof P=="string"){const se=w(n.data,P);O[x]=se.found?se.value:P}else O[x]=P}),delete O.props,n.data&&(O.data=n.data),O};function T($){const O=["col-span-12"],x=mr($.col);return x.length&&O.push(...x),O}const g=e.ref([]),N=e.ref([]),M=e.ref([]);function F($,O){$&&$ instanceof HTMLElement&&(g.value[O]=$)}function E(){N.value=g.value.map($=>$.offsetWidth),M.value=g.value.map($=>$.offsetLeft)}function I(){if(typeof window>"u")return null;const $=v.value;if(!$)return null;const x=new URL(window.location.href).searchParams.get($);if(x===null)return null;const P=Number.parseInt(x,10);return Number.isNaN(P)?null:P}function H($){if(typeof window>"u")return;const O=v.value;if(!O||!i)return;const x=new URL(window.location.href);$<=0?x.searchParams.delete(O):x.searchParams.set(O,String($));const P=window.history.state??{};window.history.replaceState(P,document.title,x)}function U(){if(l||!h.value.length)return;k();const $=I();if($===null)return;const O=Math.min(Math.max($,0),h.value.length-1);O!==$&&H(O),O!==s.value&&(s.value=O),l=!0}function G(){l=!1,U()}let Z=null;return e.onMounted(()=>{e.nextTick(()=>{U(),E()}),typeof window<"u"&&window.addEventListener("popstate",G),Z=new ResizeObserver(()=>E()),Z.observe(document.body)}),e.onBeforeUnmount(()=>{Z?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",G)}),e.watch(s,$=>{e.nextTick(()=>{E()}),H($)}),e.watch(h,()=>{l=!1,U()}),($,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.classWrapper||C.value)},[e.createElementVNode("div",Xp,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",Qp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(x,P)=>(e.openBlock(),e.createElementBlock("div",{key:x.name||P,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[x.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:x.html,class:"text-gray-900 leading-relaxed"},null,8,Vp)):x.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(x.component,x)),e.mergeProps({key:1,ref_for:!0},x.component==="Card"?x:R(x),{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])},[N.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:N.value[s.value]+"px",left:M.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(x,P)=>(e.openBlock(),e.createElementBlock("button",{key:x.name||P,ref_for:!0,ref:se=>F(se,P),onClick:se=>s.value=P,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===P?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(x.title||x.label||x.name||`Tab ${P+1}`),11,eu))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([t.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(x,P)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:x.name||P,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===P?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100"])},[x.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:x.html,class:"text-gray-900 leading-relaxed"},null,8,tu)):$.$slots[`tab-${P}`]?e.renderSlot($.$slots,`tab-${P}`,{key:1,item:x,data:t.data}):x.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Jt),e.mergeProps({key:2,ref_for:!0},R(x),{items:x.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):x.component||x.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(x.component||x.name,x)),e.mergeProps({key:3,ref_for:!0},x.component==="Card"?x:R(x),{styling:t.styling,id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot($.$slots,x.slot||`tab-${P}`,{key:4,item:x,data:t.data})],2)),[[e.vShow,s.value===P]])),128))],2)],2)):t.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",nu,[e.createElementVNode("div",ou,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(x,P)=>(e.openBlock(),e.createElementBlock("button",{key:x.name||P,onClick:se=>s.value=P,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===P?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(x.title||x.label||x.name||`Tab ${P+1}`)+" ",1),s.value===P?(e.openBlock(),e.createElementBlock("span",ru,[...O[0]||(O[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,su))),128))]),e.createElementVNode("div",iu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(x,P)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:x.name||P,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===P?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100 py-2"])},[x.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:x.html,class:"text-gray-900 leading-relaxed"},null,8,lu)):$.$slots[`tab-${P}`]?e.renderSlot($.$slots,`tab-${P}`,{key:1,item:x,data:t.data}):x.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Jt),e.mergeProps({key:2,ref_for:!0},R(x),{items:x.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):x.component||x.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(x.component||x.name,x)),e.mergeProps({key:3,ref_for:!0},x.component==="Card"?x:R(x),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.renderSlot($.$slots,x.slot||`tab-${P}`,{key:4,item:x,data:t.data})],2)),[[e.vShow,s.value===P]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",au,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(x,P)=>(e.openBlock(),e.createElementBlock("div",{key:x.name||x.component||P,class:e.normalizeClass(T(x))},[$.$slots[`panel-${P}`]?e.renderSlot($.$slots,`panel-${P}`,{key:0,item:x,data:t.data}):x.items||x.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Jt),e.mergeProps({key:1,ref_for:!0},R(x),{items:x.items||[],class:["w-full h-auto",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):x.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(x.component,x)),e.mergeProps({key:2,ref_for:!0},R(x),{class:["w-full h-auto",[t.styling?.classItem]],styling:t.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",cu,[e.renderSlot($.$slots,x.slot||`panel-${P}`,{item:x,data:t.data})]))],2))),128))])],2))],2)])],2))}}),du=["onClick"],hr=Ve(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(Tr),{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(Rn),{class:"h-4 w-4"})],8,du)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);Yt.install=function(t){t.component("vs-widget-file",rn),t.component("vs-widget-comments",on),t.component("vs-widget-history",sn),t.component("vs-widget-gallery",ln),t.component("vs-widget-map",pn),t.component("vs-group-interface",An),t.component("CommentsWidget",on),t.component("HistoryWidget",sn),t.component("GalleryWidget",ln),t.component("FilesWidget",rn),t.component("MapWidget",pn),t.component("Card",Yt),t.component("CardItem",Jt),t.component("DescriptionListWidget",Pn),t.component("CopyNotification",hr),t.component("GroupInterfaceWidget",An)},me.Card=Yt,me.CardItem=Jt,me.CommentsWidget=on,me.CopyNotification=hr,me.DescriptionListWidget=Pn,me.FilesWidget=rn,me.GalleryWidget=ln,me.GroupInterfaceWidget=An,me.HistoryWidget=sn,me.MapWidget=pn,me.TableWidget=fr,me.default=Yt,Object.defineProperties(me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));