@opengis/admin 0.2.88 → 0.2.89

Sign up to get free protection for your applications and to get access to all the features.
@@ -773,4 +773,4 @@ img.ProseMirror-separator {
773
773
  </div>
774
774
  `}).mount(a)},{Fancybox:Bre}=vm,wv={$form:Pre,$api:Ore,$map:Nre,$preview:({media:t})=>{const e=document.querySelector("#app");if(!e){console.error('Modal root element with id "#app" not found!');return}const n=document.createElement("div");e.appendChild(n),h.createApp({data(){return{items:Array.isArray(t)?t:[t]}},mounted(){this.$nextTick(()=>{Bre.show(this.items.map(i=>{const s=typeof i=="string"&&i.endsWith(".pdf");return{src:i,type:s?"iframe":"image"}}),{groupAll:!0,Thumbs:{autoStart:!0}})})},template:`
775
775
  <div style="display: none;"></div> <!-- Keeps container hidden -->
776
- `}).mount(n)}};window.addEventListener("click",t=>{var n,r,i;const e=(n=t==null?void 0:t.target)==null?void 0:n.closest("[_href]");if(e&&(e==null?void 0:e.tagName)==="A"){const s=e==null?void 0:e.getAttribute("_href");(i=(r=window==null?void 0:window.app)==null?void 0:r.router)==null||i.push(s),t==null||t.preventDefault()}});const zre=h.defineCustomElement(rI);customElements.define("admin-info",zre);const Vre=async()=>{try{const{data:t}=await Ze.get("/api/user-menu");return _s.value=t,yv(t)}catch(t){return console.error(t),[]}},Lre=(t,e)=>{Object.entries(e).forEach(([n,r])=>{t.component(n,r)})},Fre={async install(t,{componentsApp:e={},settings:n,routes:r=[]}){Ln.value={...Ln,...n};try{const s=(await Vre()).filter(o=>o==null?void 0:o.component).map(o=>({...o,component:{...vv,...e}[o==null?void 0:o.component]}));Lre(t,{...vv,...e}),t.component("admin",wO);const{router:a}=await rB(s.concat(r));window.app={...t,router:a},window.v3plugin={...t.config.globalProperties,...wv},t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...pE,componentsApp:e},$router:a,$v3plugin:wv,$utils:{reloadCardPage:Rf}},t.use(a)}catch(i){console.error(i)}},components:vv,plugins:wv},$re={data(){return{formValues:{},scheme:null,table:"",token:"",style:null}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,i;const t=this.flattenMenu(_s.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.query)==null?void 0:o.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:s}}=await Ze.get(`/api/template/table/${n}`),{data:a}=await Ze.get(`/api/table/${this.table}/${(i=(r=this.$route)==null?void 0:r.query)==null?void 0:i.id}`);this.token=(a==null?void 0:a.token)||"",this.formValues=a||{};const{data:o}=await Ze.get(`/api/template/form/${s}`);this.scheme=(o==null?void 0:o.schema)||o,this.style=(o==null?void 0:o.style)||null}catch{}},async onlyEditObject(){var e,n,r,i,s,a,o,f,g;const t=this.$refs.form;try{await t.doValidation(),await Ze.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(f=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:f[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}},async editObjectAndRedirect(){var e,n,r,i,s,a,o,f,g;const t=this.$refs.form;try{await t.doValidation(),await Ze.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(f=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:f[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}}}},jre={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},Hre={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Ure={class:"flex items-center gap-[6px]"},Wre={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},qre={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function Gre(t,e,n,r,i,s){var o;const a=h.resolveComponent("VsForm");return h.openBlock(),h.createElementBlock("div",jre,[h.createElementVNode("div",Hre,[e[3]||(e[3]=h.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),h.createElementVNode("div",Ure,[h.createElementVNode("button",{onClick:e[0]||(e[0]=f=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...f)=>s.editObjectAndRedirect&&s.editObjectAndRedirect(...f)),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"}," Зберегти ")])]),h.createElementVNode("div",Wre,[h.createElementVNode("div",qre,[i.scheme?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,columns:(o=i.style)==null?void 0:o.columns,style:h.normalizeStyle(i.style),modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=f=>i.formValues=f),class:"p-0 mt-[20px]"},null,8,["scheme","columns","style","modelValue"])):h.createCommentVNode("",!0)])])])}const Yre=Object.freeze(Object.defineProperty({__proto__:null,default:Le($re,[["render",Gre]])},Symbol.toStringTag,{value:"Module"})),Zre={data(){return{formValues:{},scheme:null,table:"",token:"",api:"",style:null}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,i;const t=this.flattenMenu(_s.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.query)==null?void 0:o.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const s=await Ze.get(`/api/table-data/${n}`),{data:a}=await Ze.get(`/api/template/form/${(r=s==null?void 0:s.data)==null?void 0:r.form}`);this.scheme=(a==null?void 0:a.schema)||a,this.style=(a==null?void 0:a.style)||null,this.api=(a==null?void 0:a.api)||"",this.token=(i=s==null?void 0:s.data)==null?void 0:i.addToken}catch{}},async createObject(){var e,n,r,i,s,a,o,f,g;const t=this.$refs.form;try{await t.doValidation(),await Ze.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(f=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:f[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}}}},Xre={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},Kre={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Jre={class:"flex items-center gap-[6px]"},Qre={style:{height:"calc(100vh - 165px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},eie={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function tie(t,e,n,r,i,s){const a=h.resolveComponent("VsForm");return h.openBlock(),h.createElementBlock("div",Xre,[h.createElementVNode("div",Kre,[e[3]||(e[3]=h.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),h.createElementVNode("div",Jre,[h.createElementVNode("button",{onClick:e[0]||(e[0]=o=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...o)=>s.createObject&&s.createObject(...o)),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"}," Зберегти ")])]),h.createElementVNode("div",Qre,[h.createElementVNode("div",eie,[i.scheme?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,style:h.normalizeStyle(i.style),modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=o=>i.formValues=o),class:"p-0 mt-[20px]"},null,8,["scheme","style","modelValue"])):h.createCommentVNode("",!0)])])])}const nie=Object.freeze(Object.defineProperty({__proto__:null,default:Le(Zre,[["render",tie]])},Symbol.toStringTag,{value:"Module"})),rie={};function iie(t,e,n,r,i,s){const a=h.resolveComponent("router-view");return h.openBlock(),h.createBlock(a)}const iI=Object.freeze(Object.defineProperty({__proto__:null,default:Le(rie,[["render",iie]])},Symbol.toStringTag,{value:"Module"})),sie={},oie={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-logout"};function aie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",oie,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),h.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),h.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const sI=Le(sie,[["render",aie]]),lie={},cie={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function die(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",cie,e[0]||(e[0]=[h.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const uie=Le(lie,[["render",die]]),hie={components:{IconChevronDown:Jg},props:{route:Object,searchable:String},mounted(){var t,e;(e=(t=this.route)==null?void 0:t.menu)!=null&&e.some(n=>{var r,i;return(n==null?void 0:n.path)===this.$route.path.replace("/","")||((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.table)===(n==null?void 0:n.table)&&(n==null?void 0:n.table)})&&(this.isOpen=!0)},watch:{route:{immediate:!0,handler(t){t!=null&&t.open&&(this.isOpen=!0)}}},data(){return{isOpen:!1,arr:[]}},computed:{darkMode(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.sidebarDark}},methods:{highLight(t){if(!this.searchable)return t;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${e})(\\s*)`,"gi");return t.replace(n,(r,i,s)=>`<span style="color:#1989fa;">${i}</span>${s}`)}}},pie={key:0,class:""},fie={key:0,class:"py-0.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full dark:bg-blue-500/10 dark:text-blue-500"},mie={key:1},gie=["innerHTML"];function yie(t,e,n,r,i,s){var f,g,y,v,E,T,D,N,B,F,X,te,H,ke,me;const a=h.resolveComponent("IconChevronDown"),o=h.resolveComponent("router-link");return(f=n.route)!=null&&f.menu?(h.openBlock(),h.createElementBlock("div",pie,[h.createElementVNode("button",{onClick:e[0]||(e[0]=Se=>i.isOpen=!i.isOpen),class:h.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100",[((y=(g=n.route)==null?void 0:g.menu)==null?void 0:y.some(Se=>{var Pe,Ne;return(Se==null?void 0:Se.path)===t.$route.path.replace("/","")||(Se==null?void 0:Se.table)===((Ne=(Pe=t.$route)==null?void 0:Pe.params)==null?void 0:Ne.table)&&(Se==null?void 0:Se.table)}))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!s.darkMode}]])},[h.createTextVNode(h.toDisplayString((v=n.route)==null?void 0:v.ua)+" ",1),(E=n.route)!=null&&E.new?(h.openBlock(),h.createElementBlock("span",fie,"Нове")):h.createCommentVNode("",!0),h.createVNode(a,{class:h.normalizeClass([[i.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var Se;return[h.withDirectives(h.createElementVNode("ul",{class:h.normalizeClass(["ml-[28px] pt-[6px] before:block before:absolute relative w-[calc(100%-28px)] flex-col gap-y-1.5 inline-flex before:w-[2px] before:h-[100%] before:left-[-10px] cursor-pointer",s.darkMode?"before:bg-white/10":"before:bg-gray-100"])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Se=n.route)==null?void 0:Se.menu,(Pe,Ne)=>{var lt,Qe;return h.openBlock(),h.createElementBlock("li",{key:Ne,class:"w-full"},[h.createVNode(o,{innerHTML:s.highLight(Pe==null?void 0:Pe.ua),to:"/"+(Pe==null?void 0:Pe.path),class:h.normalizeClass([[((Pe==null?void 0:Pe.path)===t.$route.path.replace("/","")||((Qe=(lt=t.$route)==null?void 0:lt.params)==null?void 0:Qe.table)===(Pe==null?void 0:Pe.table)&&(Pe==null?void 0:Pe.table))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!s.darkMode}],"block px-3 py-2 text-sm rounded-lg focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],2),[[h.vShow,i.isOpen]])]}),_:1})])):(T=n.route)!=null&&T.hidden?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",mie,[h.createVNode(o,{to:((N=(D=n.route)==null?void 0:D.path)==null?void 0:N[0])==="/"?(B=n.route)==null?void 0:B.path:"/"+((F=n.route)==null?void 0:F.path),class:h.normalizeClass([[(((X=n.route)==null?void 0:X.path.replace("/",""))===t.$route.path.replace("/","")||((H=(te=t.$route)==null?void 0:te.params)==null?void 0:H.table)===((ke=n.route)==null?void 0:ke.table)&&((me=n.route)==null?void 0:me.table))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10 ":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100 ":!s.darkMode}],"flex items-center w-full px-3 py-2 text-sm text-gray-800 duration-300 rounded-lg gap-x-3"])},{default:h.withCtx(()=>{var Se;return[h.createElementVNode("span",{innerHTML:s.highLight((Se=n.route)==null?void 0:Se.ua)},null,8,gie)]}),_:1},8,["to","class"])]))}const bie=Le(hie,[["render",yie]]),_ie={},xie={class:"flex-shrink-0 size-4",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"};function vie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",xie,e[0]||(e[0]=[h.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),h.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),h.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const oI=Le(_ie,[["render",vie]]),wie={},kie={class:"shrink-0 size-4 rounded-full",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Eie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",kie,e[0]||(e[0]=[h.createStaticVNode('<g fill-rule="evenodd"><g stroke-width="1pt"><path fill="#bd3d44" d="M0 0h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M0 10h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path></g><path fill="#192f5d" d="M0 0h98.8v70H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M8.2 3l1 2.8H12L9.7 7.5l.9 2.7-2.4-1.7L6 10.2l.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7L74 8.5l-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 7.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 24.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 21.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 38.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 35.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 52.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 49.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 66.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 63.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9z" transform="scale(3.9385)"></path></g>',1)]))}const Sie=Le(wie,[["render",Eie]]),Cie={},Tie={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"256",height:"256",viewBox:"0 0 256 256","xml:space":"preserve"};function Aie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Tie,e[0]||(e[0]=[h.createElementVNode("defs",null,null,-1),h.createElementVNode("g",{style:{stroke:"none","stroke-width":"0","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"none","fill-rule":"nonzero",opacity:"1"},transform:"translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"},[h.createElementVNode("path",{d:"M 45 90 C 20.147 90 0 69.853 0 45 h 90 C 90 69.853 69.853 90 45 90 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(255,213,0)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"}),h.createElementVNode("path",{d:"M 45 0 C 20.147 0 0 20.147 0 45 h 90 C 90 20.147 69.853 0 45 0 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(0,91,187)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"})],-1)]))}const Mie=Le(Cie,[["render",Aie]]),Die={},Iie={class:"shrink-0 size-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.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"};function Pie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Iie,e[0]||(e[0]=[h.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))}const Rie={components:{IconQuestion:oI,IconUSA:Sie,IconUkraine:Mie,IconTick:Le(Die,[["render",Pie]])},props:["docs","languages"],data(){return{currentLang:"ukraine",languagesOptions:[{titleEN:"English",titleUA:"Англійська",id:"english",icon:"IconUSA"},{titleEN:"Ukraine",titleUA:"Українська",id:"ukraine",icon:"IconUkraine"}]}},computed:{selectedLang(){return this.languagesOptions.find(t=>t.id===this.currentLang)},darkMode(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.sidebarDark}},methods:{changeLang(t){this.$refs.langPopover.togglePopover(),this.currentLang=t}}},Oie={class:"flex justify-center items-center gap-x-2"},Nie=["onClick"],Bie={class:"text-gray-800"},zie={class:"ms-auto"},Vie={class:"truncate"};function Lie(t,e,n,r,i,s){const a=h.resolveComponent("IconTick"),o=h.resolveComponent("VsPopover");return n.docs||n.languages?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["py-2 px-5 border-t dark:border-neutral-700",s.darkMode?"border-white/10 ":"border-gray-200"])},[h.createElementVNode("div",Oie,[h.createVNode(o,{trigger:"click",placement:"top",ref:"langPopover"},{reference:h.withCtx(()=>{var f,g,y;return[h.createElementVNode("button",{type:"button","aria-expanded":"false",class:h.normalizeClass(["relative py-2 px-3 flex items-center gap-x-2 text-nowrap w-full cursor-pointer border rounded-full text-start text-sm text-gray-800 focus:outline-none",s.darkMode?"border-white/10 bg-transparent text-white/80 hover:bg-white/10 focus:bg-white/10":"border-gray-200 bg-white hover:bg-gray-100 focus:bg-gray-100"])},[h.createElementVNode("div",null,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent((f=s.selectedLang)==null?void 0:f.icon),{class:"w-[16px] h-[16px] rounded-full"}))]),h.createElementVNode("span",Vie,h.toDisplayString(i.currentLang==="ukraine"?(g=s.selectedLang)==null?void 0:g.titleUA:(y=s.selectedLang)==null?void 0:y.titleEN),1)],2)]}),default:h.withCtx(()=>[h.createElementVNode("div",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.languagesOptions,f=>(h.openBlock(),h.createElementBlock("button",{key:f.id,type:"button",onClick:g=>s.changeLang(f.id),class:h.normalizeClass(["flex items-center gap-x-2 cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 selected",(f==null?void 0:f.id)===i.currentLang?"bg-gray-100":""])},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(f==null?void 0:f.icon),{class:"w-[16px] h-[16px] rounded-full"})),h.createElementVNode("div",Bie,h.toDisplayString(i.currentLang==="ukraine"?f==null?void 0:f.titleUA:f==null?void 0:f.titleEN),1),h.createElementVNode("span",zie,[(f==null?void 0:f.id)===i.currentLang?(h.openBlock(),h.createBlock(a,{key:0})):h.createCommentVNode("",!0)])],10,Nie))),128))])]),_:1},512)])],2)):h.createCommentVNode("",!0)}const Fie={components:{IconLogout:sI,NavbarItem:bie,IconLogo:uie,IconSearch:bv,NavbarFooter:Le(Rie,[["render",Lie]])},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t;return(t=this.searchValue)!=null&&t.trim()?this.filterMenu(_s.value,this.searchValue):_s.value},logo(){var t;return((t=Ln.value)==null?void 0:t.logo)||"/assets/logo.svg"},docs(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.docs},languages(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.languages},darkMode(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.sidebarDark},darkColor(){var t,e;return((t=Ln==null?void 0:Ln.value)==null?void 0:t.sidebarColor)||((e=Ln==null?void 0:Ln.value)==null?void 0:e.color)||"blue"}},watch:{"$route.path"(){this.$parent.showMenu=!1}},methods:{filterMenu(t,e){return t.map(n=>{var r,i;if(n.menu){const s=this.filterMenu(n.menu,e);if(s.length>0)return{...n,menu:s,open:!0}}else if((i=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&i.includes(e.toLowerCase()))return n;return null}).filter(Boolean)}}},$ie={class:"h-[46px] w-full px-5 lg:px-8 mb-[10px]"},jie={href:"/"},Hie=["src"],Uie={class:"px-2 lg:px-5"},Wie={class:"px-2 lg:px-5 flex flex-col flex-wrap w-full pb-3"},qie={key:0,class:"flex flex-col gap-y-1"};function Gie(t,e,n,r,i,s){var g;const a=h.resolveComponent("VsText"),o=h.resolveComponent("NavbarItem"),f=h.resolveComponent("NavbarFooter");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] pt-3 border-r w-[260px] top-0 bottom-0 shrink-0 absolute transition left-[-100%] z-[11]",{"left-0":t.$parent.showMenu,["bg-"+s.darkColor+"-950"]:s.darkMode,"bg-white":!s.darkMode}])},[h.createElementVNode("div",$ie,[h.createElementVNode("a",jie,[h.createElementVNode("img",{src:s.logo,class:"object-contain w-full h-full"},null,8,Hie)])]),h.createElementVNode("div",Uie,[h.createVNode(a,{type:"text",modelValue:i.searchValue,"onUpdate:modelValue":e[0]||(e[0]=y=>i.searchValue=y),clearable:!0,icon:"search","icon-position":"left",placeholder:"Пошук по меню",class:h.normalizeClass(["[&>input]:h-[38px]",{"[&>input]:bg-[#172554] [&>input]:text-white/80 [&>input]:placeholder:text-white/40 [&>input]:border [&>input]:border-white/50":s.darkMode,["[&>input]:bg-"+s.darkColor+"-950"]:s.darkMode,["focus:[&>input]:border-"+s.darkColor+"-500"]:s.darkMode}])},null,8,["modelValue","class"])]),h.createElementVNode("div",{class:h.normalizeClass(["py-[10px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",s.languages||s.docs?"h-[calc(100vh-161px)]":"h-[calc(100vh-110px)]"])},[h.createElementVNode("nav",Wie,[(g=s.data)!=null&&g.length?(h.openBlock(),h.createElementBlock("ul",qie,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.data,(y,v)=>(h.openBlock(),h.createElementBlock("li",{key:v,class:"flex flex-col gap-[6px]"},[h.createVNode(o,{route:y,searchable:i.searchValue},null,8,["route","searchable"])]))),128))])):(h.openBlock(),h.createElementBlock("div",{key:1,class:h.normalizeClass(["text-lg mt-[20px]",{"text-white/80":s.darkMode,"text-gray-800":!s.darkMode}])}," Не знайдено ",2))])],2),s.docs||s.languages?(h.openBlock(),h.createBlock(f,{key:0,docs:s.docs,languages:s.languages},null,8,["docs","languages"])):h.createCommentVNode("",!0)],2)}const Yie=Le(Fie,[["render",Gie],["__scopeId","data-v-ebe4c2ff"]]),Zie={components:{IconQuestion:oI,IconUser:sA,AdminNotification:oA,IconUserOutline:rA,IconLogout:sI},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(t){t?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:t}=await Ze.get("/user");this.userData=t}catch{}},async logout(){try{await Ze.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},Xie={class:"h-[58px] border-b flex lg:justify-end justify-between items-center px-[20px]"},Kie={class:"flex items-center gap-[6px]"},Jie={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},Qie={class:"relative"},ese=["src"],tse={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},nse=["src"],rse={key:1,class:"flex items-center justify-center bg-gray-200 rounded-full size-10"},ise={class:"grow"},sse={class:"block text-sm font-medium text-gray-800 dark:text-neutral-200"},ose={class:"text-xs text-gray-500 dark:text-neutral-500"},ase={class:"flex flex-col space-y-0.5"};function lse(t,e,n,r,i,s){var E,T,D,N;const a=h.resolveComponent("IconQuestion"),o=h.resolveComponent("AdminNotification"),f=h.resolveComponent("IconUser"),g=h.resolveComponent("router-link"),y=h.resolveComponent("IconUserOutline"),v=h.resolveComponent("IconLogout");return h.openBlock(),h.createElementBlock("div",Xie,[h.createElementVNode("div",{class:"flex lg:hidden",onClick:e[0]||(e[0]=B=>t.$parent.showMenu=!0)},e[4]||(e[4]=[h.createStaticVNode('<svg 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" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l16 0"></path><path d="M4 12l16 0"></path><path d="M4 18l16 0"></path></svg>',1)])),h.createElementVNode("div",Kie,[h.createElementVNode("a",Jie,[h.createVNode(a,{height:"24",width:"24"})]),h.createVNode(o),e[9]||(e[9]=h.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),h.createElementVNode("div",Qie,[h.createElementVNode("div",{onClick:e[1]||(e[1]=B=>i.isVisible=!0),class:"cursor-pointer"},[(T=(E=i.userData)==null?void 0:E.user)!=null&&T.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(N=(D=i.userData)==null?void 0:D.user)==null?void 0:N.avatar,alt:"Image Description"},null,8,ese)):(h.openBlock(),h.createElementBlock("div",tse,[h.createVNode(f)]))]),i.isVisible?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=h.withModifiers(()=>{},["stop"])),class:"fixed p-2 bg-white w-[240px] top-[55px] right-[20px] rounded-xl z-[1] shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:shadow-[0_10px_40px_10px_rgba(0,0,0,0.2)] dark:bg-neutral-900 block"},[h.createVNode(g,{to:"profile",disabled:!0,class:"py-2 px-2.5 flex items-center gap-3 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800"},{default:h.withCtx(()=>{var B,F,X,te,H,ke,me,Se;return[(F=(B=i.userData)==null?void 0:B.user)!=null&&F.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"rounded-full shrink-0 size-10",src:(te=(X=i.userData)==null?void 0:X.user)==null?void 0:te.avatar,alt:"Image Description"},null,8,nse)):(h.openBlock(),h.createElementBlock("div",rse,[h.createVNode(f,{class:"w-[16px]"})])),h.createElementVNode("div",ise,[h.createElementVNode("span",sse,h.toDisplayString(((ke=(H=i.userData)==null?void 0:H.user)==null?void 0:ke.username)||"User User"),1),h.createElementVNode("p",ose,h.toDisplayString(((Se=(me=i.userData)==null?void 0:me.user)==null?void 0:Se.email)||"email не вказано"),1)])]}),_:1}),e[7]||(e[7]=h.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("ul",ase,[h.createElementVNode("li",null,[h.createVNode(g,{to:"profile",class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",disabled:"true"},{default:h.withCtx(()=>[h.createVNode(y,{class:"size-4"}),e[5]||(e[5]=h.createTextVNode(" Профіль "))]),_:1})])]),e[8]||(e[8]=h.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("p",null,[h.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...B)=>s.logout&&s.logout(...B)),class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-red-500 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 dark:hover:text-red-500 dark:focus:text-red-500"},[h.createVNode(v,{class:"size-4"}),e[6]||(e[6]=h.createTextVNode(" Вийти "))])])])):h.createCommentVNode("",!0)])])])}const cse={components:{navbar:Yie,AdminHeader:Le(Zie,[["render",lse]])},data(){return{showMenu:!1}},computed:{isMenu(){return _s.value||null},header(){var t;return((t=Ln.value)==null?void 0:t.header)||"admin-header"}}},dse={class:"admin-wrapper"},use={class:"flex flex-col w-full"};function hse(t,e,n,r,i,s){const a=h.resolveComponent("navbar"),o=h.resolveComponent("router-view");return h.openBlock(),h.createElementBlock("div",dse,[h.createVNode(a),i.showMenu?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=f=>i.showMenu=!1),class:"z-[10] lg:hidden transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900"})):h.createCommentVNode("",!0),h.createElementVNode("div",use,[s.isMenu?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(s.header))),h.createVNode(o)],64)):h.createCommentVNode("",!0)])])}const pse=Object.freeze(Object.defineProperty({__proto__:null,default:Le(cse,[["render",hse],["__scopeId","data-v-34da2042"]])},Symbol.toStringTag,{value:"Module"})),fse={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var t,e;return((t=this.data)==null?void 0:t.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var t,e;return(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(t){t!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(t){switch(t){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(t){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(t);const e=this.$route.query,{sort:n,...r}=e,i=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...r,...i&&{sort:i}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},mse={scope:"col",class:"pe-2 py-1 text-start"},gse={class:"w-[24px]"},yse={key:1,class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200"};function bse(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("th",mse,[s.getVisibleIcon?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200",onClick:e[0]||(e[0]=a=>s.handleClickSortBtn(i.currentSort))},[h.createTextVNode(h.toDisplayString(s.label)+" ",1),h.createElementVNode("span",gse,[i.currentSort?(h.openBlock(),h.createElementBlock("svg",{key:0,class:h.normalizeClass(["shrink-0 size-3.5",{"rotate-180":i.currentSort==="asc"}]),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"},e[1]||(e[1]=[h.createElementVNode("path",{d:"m5 12 7-7 7 7"},null,-1),h.createElementVNode("path",{d:"M12 19V5"},null,-1)]),2)):h.createCommentVNode("",!0)])])):(h.openBlock(),h.createElementBlock("p",yse,h.toDisplayString(s.label),1))])}const _se=Le(fse,[["render",bse]]),xse={components:{IconMore:fg,IconDelete:nx,IconEdit:rx},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},computed:{getCustomActions(){return this.actions.filter(t=>typeof t=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await Ze.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var t,e;try{const{data:n}=await Ze.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await Ze.delete(`/api/table/${n==null?void 0:n.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch(n){this.$notify({title:"Помилка!",message:(e=n==null?void 0:n.response)==null?void 0:e.data,type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(t){var e,n;document.querySelector("body").click(),t!=null&&t.form?(await this.$v3plugin.$form({form:t==null?void 0:t.form,id:(e=this.item)==null?void 0:e.id,api:t==null?void 0:t.api,title:t==null?void 0:t.title}),await this.$emit("update-table")):await this.$v3plugin.$api({confirm:t==null?void 0:t.confirm,api:t==null?void 0:t.api,method:t==null?void 0:t.method,id:(n=this.item)==null?void 0:n.id,isId:(t==null?void 0:t.isId)||!1})}}},vse={class:"inline-flex"},wse={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},kse={class:"flex flex-col items-start"},Ese=["onClick"],Sse={class:"text-gray-800"},Cse={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},Tse={class:"flex justify-end p-[16px] pr-0 gap-x-3"};function Ase(t,e,n,r,i,s){const a=h.resolveComponent("IconMore"),o=h.resolveComponent("IconEdit"),f=h.resolveComponent("router-link"),g=h.resolveComponent("IconDelete"),y=h.resolveComponent("VsPopover"),v=h.resolveComponent("VsConfirm");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",vse,[h.createVNode(y,{trigger:"click",placement:"bottom-left"},{reference:h.withCtx(()=>[h.createElementVNode("button",wse,[h.createVNode(a,{height:"16",width:"16"})])]),default:h.withCtx(()=>{var E,T,D,N,B;return[h.createElementVNode("div",kse,[(E=n.actions)!=null&&E.includes("edit")&&n.isForm?(h.openBlock(),h.createBlock(f,{key:0,to:`/edit?table=${(D=(T=t.$route)==null?void 0:T.params)==null?void 0:D.catchAll}&id=${(N=n.item)==null?void 0:N.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:h.withCtx(()=>[h.createVNode(o,{color:"#000"}),e[4]||(e[4]=h.createTextVNode(" Редагувати "))]),_:1},8,["to"])):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.getCustomActions,(F,X)=>(h.openBlock(),h.createElementBlock("button",{key:X,onClick:te=>s.customButtonAction(F),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(g,{class:"opacity-0"}),h.createElementVNode("span",Sse,h.toDisplayString(F==null?void 0:F.label),1)],8,Ese))),128)),n.isForm?(h.openBlock(),h.createElementBlock("div",Cse)):h.createCommentVNode("",!0),(B=n.actions)!=null&&B.includes("del")?(h.openBlock(),h.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=h.withModifiers((...F)=>s.openConfirm&&s.openConfirm(...F),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(g),e[5]||(e[5]=h.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):h.createCommentVNode("",!0)])]}),_:1})]),h.createVNode(v,{visible:i.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=E=>i.isDeleteConfirm=E),size:"small",title:"Ви впевнені?"},{default:h.withCtx(()=>[e[6]||(e[6]=h.createElementVNode("p",{class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),h.createElementVNode("div",Tse,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm hover:bg-gray-100 gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[1]||(e[1]=E=>i.isDeleteConfirm=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 hover:bg-red-700 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...E)=>s.deleteElement&&s.deleteElement(...E))}," Так, я впевнена(ий) ")])]),_:1},8,["visible"])],64)}const Mse=Le(xse,[["render",Ase]]),Dse={},Ise={class:"flex-shrink-0 mt-0.5 size-3.5",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"};function Pse(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Ise,e[0]||(e[0]=[h.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),h.createElementVNode("path",{d:"M7 20V4"},null,-1),h.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),h.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const aI=Le(Dse,[["render",Pse]]),Rse={},Ose={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"};function Nse(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Ose,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"},null,-1),h.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const lI=Le(Rse,[["render",Nse]]),Bse={components:{IconExport:aI,IconChevronDown:Jg,IconSuccess:lI},props:{table:String,columns:Array,page:[String,Number],filterCustom:String,filterState:String,filters:String},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[],activeAction:"",isSuccessTemplate:!1,actions:[{name:"choceAll",function:this.choceAll,label:"Вибрати усі"},{name:"choceVisible",function:this.choceVisible,label:"Вибрати поточні"},{name:"clearAll",function:this.clearAll,label:"Жодного"}]}},watch:{isOpen(t){t||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},methods:{async exportTable(){var t;if(!((t=this.cols)!=null&&t.length)){this.$notify({type:"error",title:"Помилка",message:"Оберіть колонки для експорту!"});return}if(!this.format){this.$notify({type:"error",title:"Помилка",message:"Оберіть формат!"});return}try{const e=await Ze.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null},responseType:"blob"}),n=await e.data.text(),r=n!=null&&n.includes(";")?null:JSON==null?void 0:JSON.parse(n),i=new Blob([e.data],{type:"application/octet-stream"}),s=window.URL.createObjectURL(i),a=document.createElement("a");if(a.href=s,a.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(a),typeof r=="string"){this.exportTable();return}a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.log(e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(t){this.format=t},choceAll(){var t;this.cols=(t=this.columns)==null?void 0:t.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var t,e;this.cols=(e=(t=this.columns)==null?void 0:t.filter(n=>(n==null?void 0:n.hidden)!==!0))==null?void 0:e.map(n=>n==null?void 0:n.name),this.activeAction="choceVisible"}}},zse={key:0,class:"flex flex-col items-center"},Vse={key:1,class:"p-4"},Lse={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},Fse={class:"flex items-center gap-[10px] -ml-[10px] my-[10px]"},$se=["onClick"],jse={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},Hse={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},Use={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},Wse={class:"mt-2 space-y-2"},qse=["id","onChange"],Gse=["for"],Yse={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},Zse={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function Xse(t,e,n,r,i,s){const a=h.resolveComponent("IconExport"),o=h.resolveComponent("IconSuccess"),f=h.resolveComponent("VsCheckbox"),g=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=y=>i.isOpen=!0),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"16",width:"16"}),e[7]||(e[7]=h.createTextVNode(" Експорт "))]),h.createVNode(g,{visible:i.isOpen,"onUpdate:visible":e[6]||(e[6]=y=>i.isOpen=y),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:h.withCtx(()=>[i.isSuccessTemplate?(h.openBlock(),h.createElementBlock("div",Yse,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[2]||(e[2]=y=>i.isOpen=!1)}," Закрити "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[3]||(e[3]=y=>i.isSuccessTemplate=!1)}," Вигрузити ще ")])):(h.openBlock(),h.createElementBlock("div",Zse,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=y=>i.isOpen=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[5]||(e[5]=(...y)=>s.exportTable&&s.exportTable(...y))}," Завантажити таблицю ")]))]),default:h.withCtx(()=>[i.isSuccessTemplate?(h.openBlock(),h.createElementBlock("div",zse,[h.createVNode(o,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=h.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(h.openBlock(),h.createElementBlock("div",Vse,[h.createElementVNode("div",Lse,[e[9]||(e[9]=h.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),h.createElementVNode("div",Fse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.actions,y=>(h.openBlock(),h.createElementBlock("button",{key:y==null?void 0:y.name,onClick:y==null?void 0:y.function,class:"inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"},[h.createElementVNode("span",{class:h.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(y==null?void 0:y.name)===i.activeAction}])},[(y==null?void 0:y.name)===i.activeAction?(h.openBlock(),h.createElementBlock("span",jse)):h.createCommentVNode("",!0)],2),h.createTextVNode(" "+h.toDisplayString(y==null?void 0:y.label),1)],8,$se))),128))]),h.createElementVNode("div",Hse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.columns,(y,v)=>(h.openBlock(),h.createElementBlock("div",{class:"flex items-center",key:v,style:{width:"calc((100% - 10px) / 2)"}},[h.createVNode(f,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:i.cols,"onUpdate:modelValue":e[1]||(e[1]=E=>i.cols=E),value:y==null?void 0:y.name,label:y==null?void 0:y.ua},null,8,["modelValue","value","label"])]))),128))])]),h.createElementVNode("div",Use,[e[10]||(e[10]=h.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"},"Виберіть формат таблиці:",-1)),h.createElementVNode("div",Wse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.tableFormats,(y,v)=>(h.openBlock(),h.createElementBlock("div",{class:"flex items-center",key:v},[h.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:y,onChange:E=>s.selectFormat(y)},null,40,qse),h.createElementVNode("label",{for:y,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+h.toDisplayString(y),9,Gse)]))),128))])])]))]),_:1},8,["visible"])],64)}const Kse=Le(Bse,[["render",Xse]]),Jse={components:{IconExport:aI,IconChevronDown:Jg,IconSuccess:lI},props:{data:Object,rows:Array,titleCol:String},data(){return{isOpen:!1,selectedTemplate:null,mode:"base"}},methods:{resetSelections(t){t||(this.selectedTemplate=null,this.mode="base")},getTemplateUrl(){return`/api/print-template/crm.accounts.doc/${this.selectedTemplate}?${this.mode}=1&format=pdf`},downloadPdf(){if(!this.selectedTemplate)return;const t=document.createElement("a");t.href=`/api/print-template/crm.accounts.doc/${this.selectedTemplate}?format=pdf`,t.download=`document_${this.selectedTemplate}.pdf`,t.click()},downloadWord(){if(!this.selectedTemplate)return;const t=document.createElement("a");t.href=`/api/print-template/crm.accounts.doc/${this.selectedTemplate}?format=word`,t.download=`document_${this.selectedTemplate}.docx`,t.click()}},mounted(){console.log("rows",this.rows)}},Qse={class:"p-4 flex flex-col"},eoe={class:"flex mb-4 gap-2 border rounded overflow-hidden"},toe={class:"flex"},noe={class:"overflow-y-auto h-[400px] w-1/2 space-y-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},roe=["id","value"],ioe=["for"],soe={key:0,class:"w-[400px] h-[400px] border ml-4 flex items-center justify-center text-gray-600 text-lg font-medium"},ooe=["src"],aoe={class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function loe(t,e,n,r,i,s){const a=h.resolveComponent("IconExport"),o=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=f=>i.isOpen=!0),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"16",width:"16"}),e[9]||(e[9]=h.createTextVNode(" Друк "))]),h.createVNode(o,{visible:i.isOpen,"onUpdate:visible":[e[8]||(e[8]=f=>i.isOpen=f),s.resetSelections],title:"Друк",size:"small",closeClickBack:!0},{footer:h.withCtx(()=>[h.createElementVNode("div",aoe,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[5]||(e[5]=f=>i.isOpen=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[6]||(e[6]=(...f)=>s.downloadPdf&&s.downloadPdf(...f))}," Завантажити PDF "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[7]||(e[7]=(...f)=>s.downloadWord&&s.downloadWord(...f))}," Завантажити Word ")])]),default:h.withCtx(()=>[h.createElementVNode("div",Qse,[h.createElementVNode("div",eoe,[h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="base","bg-white":i.mode!=="base"},"px-4 py-2 border-r text-black w-full"]),onClick:e[1]||(e[1]=f=>i.mode="base")}," Базовий ",2),h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="demo","bg-white":i.mode!=="demo"},"px-4 py-2 border-r text-black w-full"]),onClick:e[2]||(e[2]=f=>i.mode="demo")}," Демо ",2),h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="preview","bg-white":i.mode!=="preview"},"px-4 py-2 text-black w-full"]),onClick:e[3]||(e[3]=f=>i.mode="preview")}," Перегляд шаблону ",2)]),h.createElementVNode("div",toe,[h.createElementVNode("div",noe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.rows,f=>(h.openBlock(),h.createElementBlock("div",{key:f.id,class:"flex items-center gap-2"},[h.withDirectives(h.createElementVNode("input",{type:"radio",id:f.id,value:f.id,"onUpdate:modelValue":e[4]||(e[4]=g=>i.selectedTemplate=g),class:"cursor-pointer h-5"},null,8,roe),[[h.vModelRadio,i.selectedTemplate]]),h.createElementVNode("label",{for:f.id,class:"cursor-pointer"},h.toDisplayString(f[n.titleCol]),9,ioe)]))),128))]),i.selectedTemplate?(h.openBlock(),h.createElementBlock("iframe",{key:1,class:"w-[400px] h-[400px] border ml-4",src:s.getTemplateUrl()},null,8,ooe)):(h.openBlock(),h.createElementBlock("div",soe," Оберіть для друку та прев'ю "))])])]),_:1},8,["visible","onUpdate:visible"])],64)}const coe=Le(Jse,[["render",loe]]),doe={},uoe={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"};function hoe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",uoe,e[0]||(e[0]=[h.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const poe=Le(doe,[["render",hoe]]),foe={props:{column:Object},emits:["update-column"],components:{IconCheck2:M0},data(){return{value:!1}},watch:{value(t){this.$emit("update-column",{...this.column,hidden:!t})}},mounted(){var t;((t=this.column)==null?void 0:t.hidden)!==!0&&(this.value=!0)}},moe={class:"flex justify-between items-center py-1.5 px-3 cursor-pointer rounded-lg hover:bg-gray-100 has-[:disabled]:opacity-50 has-[:disabled]:pointer-events-none dark:hover:bg-neutral-800"},goe={class:"flex justify-between flex-1 items-center gap-x-2.5 cursor-pointer text-[13px] text-gray-800 dark:text-neutral-300"};function yoe(t,e,n,r,i,s){var o,f;const a=h.resolveComponent("IconCheck2");return h.openBlock(),h.createElementBlock("div",moe,[h.createElementVNode("label",goe,[h.createTextVNode(h.toDisplayString(((o=n.column)==null?void 0:o.ua)||((f=n.column)==null?void 0:f.title))+" ",1),h.withDirectives(h.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=g=>i.value=g),class:"hidden"},null,512),[[h.vModelCheckbox,i.value]]),h.createElementVNode("span",{class:h.normalizeClass(["flex items-center justify-center text-white border border-gray-300 rounded shrink-0 size-4 focus:ring-blue-500",[i.value?"bg-blue-600 border-0":"bg-white"]])},[h.createVNode(a,{height:"12",width:"12"})],2)])])}const boe={components:{IconColumns:poe,AdminTableColumnsHiddenItem:Le(foe,[["render",yoe]])},emits:["update-columns"],props:{columns:Array},data(){return{searchValue:"",visible:!1}},computed:{filteredColumn(){var t;return(t=this.columns)==null?void 0:t.filter(e=>{var n,r,i,s,a,o;return((i=(n=e==null?void 0:e.ua)==null?void 0:n.toLowerCase())==null?void 0:i.includes((r=this.searchValue)==null?void 0:r.toLowerCase()))||((o=(s=e==null?void 0:e.title)==null?void 0:s.toLowerCase())==null?void 0:o.includes((a=this.searchValue)==null?void 0:a.toLowerCase()))})}},methods:{toggleVisible(){this.visible=!this.visible,this.visible?document.addEventListener("click",this.handleClickOutside):document.removeEventListener("click",this.handleClickOutside)},handleClickOutside(t){const e=this.$refs.wrapper;e&&!e.contains(t.target)&&(this.visible=!1,document.removeEventListener("click",this.handleClickOutside))},updateColumn(t){const e=this.columns.findIndex(r=>(r==null?void 0:r.name)===(t==null?void 0:t.name)),n=this.columns;n[e]=t,this.$emit("update-columns",[...n])}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},_oe={class:"relative",ref:"wrapper"},xoe={key:0,class:"absolute left-[50%] top-[110%] translate-x-[-50%] z-10 w-64 transition-[opacity,margin] duration bg-white rounded-xl shadow-lg dark:bg-neutral-900"},voe={class:"relative p-1 border-gray-200 border-y dark:border-neutral-800"},woe={class:"p-1 pt-3 max-h-80 overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},koe={key:0,class:"block px-3 mb-2 text-xs text-gray-500 dark:text-neutral-500"},Eoe={class:"space-y-1"},Soe={key:1,class:"flex items-center px-3 text-[13px] py-1.5 px-3 rounded-md cursor-pointer group"};function Coe(t,e,n,r,i,s){const a=h.resolveComponent("IconColumns"),o=h.resolveComponent("AdminTableColumnsHiddenItem");return h.openBlock(),h.createElementBlock("div",_oe,[h.createElementVNode("button",{onClick:e[0]||(e[0]=(...f)=>s.toggleVisible&&s.toggleVisible(...f)),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"20",width:"16"})]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var f,g;return[i.visible?(h.openBlock(),h.createElementBlock("div",xoe,[e[2]||(e[2]=h.createElementVNode("div",{class:"flex items-center justify-between h-[48px] px-4 py-2 gap-x-2 text-sm font-medium text-gray-800"}," Колонки ",-1)),h.createElementVNode("div",voe,[h.withDirectives(h.createElementVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=y=>i.searchValue=y),type:"text",class:"py-1.5 px-3 block w-full border-transparent rounded-lg sm:text-sm text-base placeholder:text-gray-500 hover:bg-gray-100 focus:outline-none focus:border-transparent focus:ring-0 focus:bg-gray-100 disabled:opacity-100 disabled:pointer-events-none dark:bg-transparent dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:ring-neutral-600 dark:focus:bg-neutral-800",placeholder:"Search",autofocus:""},null,512),[[h.vModelText,i.searchValue]])]),h.createElementVNode("div",woe,[(f=s.filteredColumn)!=null&&f.length?(h.openBlock(),h.createElementBlock("span",koe," Оберіть колонки для відображення ")):h.createCommentVNode("",!0),h.createElementVNode("div",Eoe,[(g=s.filteredColumn)!=null&&g.length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(s.filteredColumn,(y,v)=>(h.openBlock(),h.createBlock(o,{key:v,column:y,onUpdateColumn:s.updateColumn},null,8,["column","onUpdateColumn"]))),128)):(h.openBlock(),h.createElementBlock("div",Soe," Нічого не знайдено "))])])])):h.createCommentVNode("",!0)]}),_:1})],512)}const Toe=Le(boe,[["render",Coe]]),Aoe={},Moe={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-minus"};function Doe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Moe,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const Ioe={components:{IconPlus:Qh,IconMinus:Le(Aoe,[["render",Doe]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},Poe={class:"hs-accordion"},Roe={class:"py-0.5 flex items-center gap-x-0.5 w-full"},Ooe={class:"text-sm font-medium"},Noe={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function Boe(t,e,n,r,i,s){const a=h.resolveComponent("IconPlus"),o=h.resolveComponent("IconMinus");return h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",null,[h.createElementVNode("div",Poe,[h.createElementVNode("div",Roe,[h.createElementVNode("div",{onClick:e[0]||(e[0]=f=>i.expanded=!i.expanded),class:"rounded-md cursor-pointer grow"},[h.createElementVNode("span",Ooe,h.toDisplayString(n.title),1)]),h.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=f=>i.expanded=!i.expanded)},[i.expanded?(h.openBlock(),h.createBlock(o,{key:1,width:"14"})):(h.openBlock(),h.createBlock(a,{key:0}))])]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",Noe,[h.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[h.vShow,i.expanded]])]),_:3})])])])}const zoe={components:{AdminComponentIs:ep,AdminTree:Le(Ioe,[["render",Boe],["__scopeId","data-v-c6318482"]]),VsNoData:_v,VsWidgetComments:tA,VsWidgetMap:db,VsWidgetFileList:m2},props:{table:String,columns:Array,row:Object}},Voe={class:"hs-accordion border-gray-100 w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 310px)"}},Loe={class:"border-l",style:{height:"calc(100vh - 360px)"}},Foe={class:"flow-root mt-[10px]"},$oe={class:"-my-3 text-sm divide-y divide-gray-100"},joe={class:"flex py-3 sm:grid-cols-3 sm:gap-4"},Hoe={class:"font-medium text-black w-[50%]"},Uoe={class:"text-gray-700 sm:col-span-2 w-[50%]"},Woe={class:"table-info-card"},qoe={class:"table-info-card"};function Goe(t,e,n,r,i,s){var E,T,D;const a=h.resolveComponent("AdminComponentIs"),o=h.resolveComponent("AdminTree"),f=h.resolveComponent("VsWidgetMap"),g=h.resolveComponent("VsNoData"),y=h.resolveComponent("VsWidgetComments"),v=h.resolveComponent("VsWidgetFileList");return h.openBlock(),h.createElementBlock("div",Voe,[e[0]||(e[0]=h.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[h.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),h.createElementVNode("div",Loe,[(T=(E=t.$route)==null?void 0:E.query)!=null&&T.card?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[n.row?(h.openBlock(),h.createBlock(o,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>[h.createElementVNode("div",Foe,[h.createElementVNode("dl",$oe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.columns,N=>(h.openBlock(),h.createElementBlock("div",joe,[h.createElementVNode("dt",Hoe,h.toDisplayString((N==null?void 0:N.ua)||(N==null?void 0:N.title)),1),h.createElementVNode("dd",Uoe,[h.createVNode(a,{row:n.row,column:N,table:n.table},null,8,["row","column","table"])])]))),256))])])]),_:1})):h.createCommentVNode("",!0),(D=n.row)!=null&&D.geom?(h.openBlock(),h.createBlock(o,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N,B;return[(N=n.row)!=null&&N.geom?(h.openBlock(),h.createBlock(f,{key:0,geometry:(B=n.row)==null?void 0:B.geom,zoom:14},null,8,["geometry"])):(h.openBlock(),h.createBlock(g,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):h.createCommentVNode("",!0),h.createVNode(o,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N;return[h.createElementVNode("div",Woe,[h.createVNode(y,{id:(N=n.row)==null?void 0:N.id},null,8,["id"])])]}),_:1}),h.createVNode(o,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N,B;return[h.createElementVNode("div",qoe,[(h.openBlock(),h.createBlock(v,{key:(N=n.row)==null?void 0:N.id,id:(B=n.row)==null?void 0:B.id},null,8,["id"]))])]}),_:1})],64)):(h.openBlock(),h.createBlock(g,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const Yoe=Le(zoe,[["render",Goe]]),Zoe={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number},table:{type:String}},components:{IconFilter:iA},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},Xoe={key:0,class:"px-[7px] text-[10px] py-[1px] font-[700] text-white bg-blue-500 rounded-full"},Koe={class:"filter-content h-screen bg-white w-[400px] overflow-x-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function Joe(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter"),o=h.resolveComponent("VsFilter");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=f=>i.isFilters=!i.isFilters),class:"py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium 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"},[h.createVNode(a,{height:"16",width:"16"}),e[4]||(e[4]=h.createTextVNode(" Фільтри ")),n.onFilters?(h.openBlock(),h.createElementBlock("span",Xoe,h.toDisplayString(n.onFilters),1)):h.createCommentVNode("",!0)]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var f;return[(h.openBlock(),h.createBlock(h.Teleport,{to:"#modal"},[h.withDirectives(h.createElementVNode("div",{onClick:e[3]||(e[3]=(...g)=>s.closeFilter&&s.closeFilter(...g)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[12] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.2)]"},[h.createElementVNode("div",Koe,[(f=n.scheme)!=null&&f.length?(h.openBlock(),h.createBlock(o,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",token:n.table,name:"filter",footer:!0,background:!0,onFilterChange:e[1]||(e[1]=g=>t.$emit("filterChange",g)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=g=>i.isFilters=!1)},null,8,["scheme","token"])):h.createCommentVNode("",!0)])],512),[[h.vShow,i.isFilters]])]))]}),_:1})],64)}const Qoe=Le(Zoe,[["render",Joe]]),eae={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},tae={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},nae=["onClick"];function rae(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("nav",tae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.tabsList,a=>(h.openBlock(),h.createElementBlock("button",{onClick:o=>t.$emit("update:filterState",a==null?void 0:a.name),class:h.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(a==null?void 0:a.name)===n.filterState}])},h.toDisplayString(a==null?void 0:a.label),11,nae))),256))])}const iae=Le(eae,[["render",rae]]),sae={},oae={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-filter"};function aae(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",oae,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const lae={components:{IconFilter2:Le(sae,[["render",aae]]),IconCheck2:M0},props:{filterCustom:String,customList:Array}},cae={class:"py-2 max-h-[34px] px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},dae={class:"flex flex-col p-[2px] gap-[2px] w-[170px]"},uae=["onClick"],hae={class:"text-sm text-gray-800"};function pae(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter2"),o=h.resolveComponent("IconCheck2"),f=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(f,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",cae,[h.createVNode(a,{height:"20",width:"20"})])]),default:h.withCtx(()=>[h.createElementVNode("div",dae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.customList,(g,y)=>(h.openBlock(),h.createElementBlock("button",{onClick:v=>{var E;t.$emit("update:filterCustom",g==null?void 0:g.name),(E=t.$refs)==null||E.popover.togglePopover()},key:y,class:h.normalizeClass(["flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",{"bg-gray-100":n.filterCustom===(g==null?void 0:g.name)}])},[h.createElementVNode("span",hae,h.toDisplayString(g==null?void 0:g.label),1),n.filterCustom===(g==null?void 0:g.name)?(h.openBlock(),h.createBlock(o,{key:0,class:"ml-auto size-3 shrink-0"})):h.createCommentVNode("",!0)],10,uae))),128)),h.createElementVNode("button",{class:"flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",onClick:e[0]||(e[0]=g=>{var y;t.$emit("update:filterCustom",void 0),(y=t.$refs)==null||y.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const fae=Le(lae,[["render",pae]]),mae={class:"flex items-center gap-x-2"},gae={__name:"admin-table-custom-buttons",props:{slots:Object},setup(t){var o,f,g,y,v;const{asyncTemplateSlot:e}=(v=(y=(g=(f=(o=h.getCurrentInstance())==null?void 0:o.appContext)==null?void 0:f.app)==null?void 0:g.config)==null?void 0:y.globalProperties)==null?void 0:v.utils,n=h.ref(""),r=h.ref(""),i=t,s=()=>{var E,T,D,N,B;if((E=i.slots)!=null&&E.panelLeft||(r.value="div"),(D=(T=i.slots)==null?void 0:T.panelLeft)!=null&&D.includes("<")){const F=e("PanelLeft",(N=i.slots)==null?void 0:N.panelLeft,["name"]);r.value=F}else r.value=(B=i.slots)==null?void 0:B.panelLeft},a=()=>{var E,T,D,N,B;if((E=i.slots)!=null&&E.panelRight||(n.value="div"),(D=(T=i.slots)==null?void 0:T.panelRight)!=null&&D.includes("<")){const F=e("PanelRight",(N=i.slots)==null?void 0:N.panelRight,["name"]);n.value=F}else n.value=(B=i.slots)==null?void 0:B.panelRight};return s(),a(),(E,T)=>(h.openBlock(),h.createElementBlock("div",mae,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(r.value))),(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value)))]))}},yae=(t,e=300)=>{let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}},bae={__name:"admin-custom-button-add",props:{slots:Object},setup(t){var s,a,o,f,g;const{asyncTemplateSlot:e}=(g=(f=(o=(a=(s=h.getCurrentInstance())==null?void 0:s.appContext)==null?void 0:a.app)==null?void 0:o.config)==null?void 0:f.globalProperties)==null?void 0:g.utils,n=h.ref(""),r=t;return(()=>{var y,v,E,T,D;if((y=r.slots)!=null&&y.addButton||(n.value="div"),(E=(v=r.slots)==null?void 0:v.addButton)!=null&&E.includes("<")){const N=e("addButton",(T=r.slots)==null?void 0:T.addButton,["IconPlus"]);n.value=N}else n.value=(D=r.slots)==null?void 0:D.addButton})(),(y,v)=>n.value?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value),{key:0,IconPlus:Qh})):h.createCommentVNode("",!0)}},_ae={key:0,class:"px-1 py-3 text-gray-800 font-[500]"},xae={key:1,class:"px-1 py-3 text-gray-800 font-[700]"},vae={__name:"admin-table-totals-list",props:{columns:{type:Array,default:()=>[]},agg:{type:Object,default:()=>{}}},setup(t){return(e,n)=>(h.openBlock(),h.createElementBlock("tr",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.columns,r=>{var i;return h.openBlock(),h.createElementBlock(h.Fragment,{key:r==null?void 0:r.name},[(i=t.agg)!=null&&i[r==null?void 0:r.name]?(h.openBlock(),h.createElementBlock("td",_ae,[h.createVNode(ep,{column:r,row:t.agg},null,8,["column","row"])])):(h.openBlock(),h.createElementBlock("td",xae))],64)}),128))]))}},wae={},kae={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-chevron-down"};function Eae(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",kae,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Sae=Le(wae,[["render",Eae]]),Cae={},Tae={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-check"};function Aae(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Tae,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Mae=Le(Cae,[["render",Aae]]),Dae=h.defineComponent({components:{IconChevronDown:Sae,IconCheck:Mae},props:{total:{type:Number,default:()=>0},pageSize:{type:Number,default:()=>20},maxPages:{type:Number,default:()=>10},defaultPage:{type:Number,default:()=>1},pageSizes:{type:Array,default:[]}},data(){return{page:1,pages:[],isDropdownOpen:!1,pageSizeLocal:null}},mounted(){this.pageSizeLocal=this.pageSize},watch:{total:{immediate:!0,handler(){this.initPages()}},defaultPage:{immediate:!0,handler(t){this.page=t,this.updatePages(t)}},pageSizeLocal(t,e){e&&(this.isDropdownOpen=!1,this.setCurrentPage(1))}},computed:{pagesCount(){return Math.ceil(this.total/this.pageSizeLocal)},disableNextClick(){return this.page>=this.pagesCount},disablePrevClick(){return this.page<=1}},methods:{initPages(){if(this.total<=0){this.pages=[1];return}this.updatePages(this.page)},handleSetPage(t){const e=t.replace(/\D/g,"");if(e>this.pagesCount){this.$refs.currentPage.innerText=this.page;return}else this.$refs.currentPage.innerText=e;this.setCurrentPage(e)},updatePages(t){const e=Math.floor(this.maxPages/2);let n=Math.max(t-e,1),r=n+this.maxPages-1;r>this.pagesCount&&(r=this.pagesCount,n=Math.max(r-this.maxPages+1,1)),this.pages=Array.from({length:r-n+1},(i,s)=>n+s)},handleClickPrev(){this.disablePrevClick||(this.setCurrentPage(this.page-1),this.updatePages(this.page),this.$emit("prevClick"))},handleClickNext(){this.disableNextClick||(this.setCurrentPage(parseInt(this.page)+1),this.updatePages(this.page),this.$emit("nextClick"))},setCurrentPage(t){t<1||t>this.pagesCount||this.page===t||(this.page=t,this.$emit("pageChange",this.page,this.pageSizeLocal),this.updatePages(t))}}}),Iae={class:"flex items-center w-full"},Pae={class:"flex items-center mx-[8px]"},Rae={class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},Oae={key:0,class:"flex items-center justify-center ml-3 gap-x-5"},Nae={class:"relative"},Bae={class:"z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 dark:divide-neutral-700 absolute bottom-[100%]"},zae=["onClick"];function Vae(t,e,n,r,i,s){const a=h.resolveComponent("IconChevronDown"),o=h.resolveComponent("IconCheck");return h.openBlock(),h.createElementBlock("nav",Iae,[h.createElementVNode("button",{type:"button",onClick:e[0]||(e[0]=(...f)=>t.handleClickPrev&&t.handleClickPrev(...f)),class:h.normalizeClass(["min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",{"opacity-50 pointer-events-none":t.disablePrevClick}])},[h.createVNode(a,{height:"16",width:"16",class:"rotate-90"})],2),h.createElementVNode("div",Pae,[h.createElementVNode("span",{ref:"currentPage",contenteditable:"true",onBlur:e[1]||(e[1]=f=>t.handleSetPage(f.target.innerText)),class:"min-h-[38px] max-h-[38px] overflow-hidden min-w-[38px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:text-white"},h.toDisplayString(t.page),545),e[4]||(e[4]=h.createElementVNode("span",{class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),h.createElementVNode("span",Rae,h.toDisplayString(t.pagesCount),1)]),h.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...f)=>t.handleClickNext&&t.handleClickNext(...f)),class:h.normalizeClass([{"opacity-50 pointer-events-none":t.disableNextClick},"min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])},[h.createVNode(a,{height:"16",width:"16",class:"-rotate-90"})],2),t.pageSizes.length?(h.openBlock(),h.createElementBlock("div",Oae,[h.createElementVNode("div",Nae,[h.withDirectives(h.createElementVNode("div",Bae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.pageSizes,f=>(h.openBlock(),h.createElementBlock("button",{type:"button",class:"w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm",onClick:g=>t.pageSizeLocal=f},[h.createTextVNode(h.toDisplayString(f)+" ",1),f===t.pageSizeLocal?(h.openBlock(),h.createBlock(o,{key:0,width:"14",height:"14",class:"text-blue-600"})):h.createCommentVNode("",!0)],8,zae))),256))],512),[[h.vShow,t.isDropdownOpen]]),t.pageSizes.length?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"text-sm h-[32px] min-w-8 py-3 px-3.5 inline-flex items-center gap-x-1 rounded-lg border border-gray-200 text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[3]||(e[3]=f=>t.isDropdownOpen=!t.isDropdownOpen)},[h.createTextVNode(h.toDisplayString(t.pageSizeLocal)+" ",1),h.createVNode(a,{height:"16",width:"16"})])):h.createCommentVNode("",!0)])])):h.createCommentVNode("",!0)])}const Lae={props:{table:String,title:String},components:{AdminTableControl:Mse,AdminTableExport:Kse,AdminTablePrint:coe,AdminTableColumnsHidden:Toe,AdminTableColumn:_se,AdminNodata:ix,IconPlus:Qh,IconSearch:bv,AdminTableCardInfo:Yoe,IconOpenCard:eI,AdminComponentIs:ep,AdminTableFilters:Qoe,AdminTableTabs:iae,AdminTableCustomFilters:fae,AdminTableCustomButtons:gae,AdminCustomButtonAdd:bae,AdminTableTotalsList:vae,AdminTablePagination:Le(Dae,[["render",Vae]])},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:""}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters(),window.addEventListener("reloadTablePage",this.getTableData)},unmounted(){window.removeEventListener("reloadTablePage",this.getTableData)},computed:{defaultPage(){var t,e;return((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1},columns(){var t,e;return(e=(t=this.tableData)==null?void 0:t.columns)==null?void 0:e.filter(n=>(n==null?void 0:n.hidden)!==!0)},isForm(){var t,e,n,r,i;return((t=this.tableData)==null?void 0:t.form)&&(((n=(e=this.tableData)==null?void 0:e.actions)==null?void 0:n.includes("add"))||((i=(r=this.tableData)==null?void 0:r.actions)==null?void 0:i.includes("edit")))},isNoData(){var t,e;return!((t=this.tableData)!=null&&t.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var t,e;return((e=(t=this.tableData)==null?void 0:t.rows)==null?void 0:e.find(n=>{var r,i;return(n==null?void 0:n.id)===((i=(r=this.$route)==null?void 0:r.query)==null?void 0:i.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:yae(async function(t){var e;await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:t||void 0}})},500)},$route:{handler(t,e){var n,r;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((r=e==null?void 0:e.params)==null?void 0:r.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,limit:t}})},filterState(t){var e;t&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:t}}),this.getTableData())},filterCustom(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:t}}),this.getTableData()},columns(t){var e,n,r,i;this.visibleColumns=t==null?void 0:t.map(s=>s==null?void 0:s.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,columns:(r=this.visibleColumns)!=null&&r.length?(i=this.visibleColumns)==null?void 0:i.join(","):void 0}})}},methods:{async checkUrlMounted(){var t,e,n,r,i,s,a,o,f,g,y,v,E,T,D,N,B,F,X;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((r=(n=this.$route)==null?void 0:n.query)==null?void 0:r.limit)||20,this.filters=((a=decodeURI((s=(i=this.$route)==null?void 0:i.query)==null?void 0:s.filter))==null?void 0:a.replaceAll("+"," "))||null,this.filters&&(this.onFilters=((f=(o=this.filters)==null?void 0:o.split("="))==null?void 0:f.length)-1),this.filterState=((y=(g=this.$route)==null?void 0:g.query)==null?void 0:y.filterState)||null,this.filterCustom=((E=(v=this.$route)==null?void 0:v.query)==null?void 0:E.custom)||null,this.searchValue=((D=(T=this.$route)==null?void 0:T.query)==null?void 0:D.search)||"",this.visibleColumns=((F=(B=(N=this.$route)==null?void 0:N.query)==null?void 0:B.columns)==null?void 0:F.split(","))||[],(X=this.$route)!=null&&X.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(t){var n,r;const e=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.find(i=>i.name===t);if(e){const i=e==null?void 0:e.width;return typeof i=="number"?`${i}px`:i!=null&&i.includes("px")?i:`${i}px`}},unmountedData(){this.page=1,this.visibleColumns=[],this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0,this.searchValue=""},async getTableData(){var t,e,n,r,i,s,a,o,f,g,y;try{const{data:v}=await Ze.get(`/api/template/table/${this.table}`),E=await Ze.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...v,...(E==null?void 0:E.data)||{}},this.initialHiddenColumns=(s=(i=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.filter(T=>(T==null?void 0:T.hidden)!==!0))==null?void 0:i.map(T=>T==null?void 0:T.name))==null?void 0:s.join(","),(a=this.visibleColumns)!=null&&a.length?(o=this.tableData)==null||o.columns.forEach(T=>{var D;(D=this.visibleColumns)!=null&&D.includes(T==null?void 0:T.name)?T.hidden=!1:T.hidden=!0}):this.visibleColumns=(y=(g=(f=this.tableData)==null?void 0:f.columns)==null?void 0:g.filter(T=>(T==null?void 0:T.hidden)!==!0))==null?void 0:y.map(T=>T==null?void 0:T.name)}catch{}},async getFilters(){var t;try{const{data:e}=await Ze.get(`/api/table-filter/${this.table}`);this.filterScheme=(t=e==null?void 0:e.list)==null?void 0:t.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(t,e){const n=this.$route.query;this.page=t,await this.$router.replace({query:{...n,page:t,limit:e}}),await this.getTableData()},async filterChange({url:t,state:e}){var n;this.filters=t!=="no-url"?t:null,this.onFilters=(n=Object.entries(e))==null?void 0:n.length,this.page=1,await this.getTableData()},changeActiveColumn(t){this.activeColumn=t,this.getTableData()},pushToCard(t){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${t}`)},pushToLinkCard(t,e){t!=null&&t.link&&this.$router.push(`/card/${t==null?void 0:t.link}/${e==null?void 0:e[t==null?void 0:t.name]}`)},changeActiveCardInfo(t){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:t}})},toggleCardInfo(){var t;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,card:void 0}})},getCustomStyles(t){return[t!=null&&t.link?" text-blue-600 hover:underline decoration-2":"",t!=null&&t.align?` text-${(t==null?void 0:t.align)||"left"}`:"",`text-${(t==null?void 0:t.wrap)||"wrap"}`]}}},Fae={class:"w-[calc(100vw - 320px)] bg-gray-50"},$ae={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},jae={class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"},Hae={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},Uae={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},Wae={class:"flex"},qae={class:"flex gap-[6px] ml-auto"},Gae={class:"inline-block w-full align-middle"},Yae={key:0,class:"relative min-w-full text-[13px] divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"},Zae={class:"sticky top-[-1px] z-[2] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},Xae={class:"right-0"},Kae={key:0,class:"w-[70px] sticky right-0 top-0"},Jae={class:"divide-y divide-gray-200 z-[1] relative"},Qae=["onClick"],ele=["onClick"],tle={class:"p-[10px] flex justify-start items-center w-full"},nle={class:"w-[200px] md:inline-flex hidden"},rle={class:"text-sm text-gray-600 dark:text-neutral-400"},ile={class:"font-semibold text-gray-800 dark:text-neutral-200"},sle={key:0},ole={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function ale(t,e,n,r,i,s){var lt,Qe,gt,rt,Tt,jt,Ht,Nt,Gt,wn,yn,An,bn,hr,Hn,zn,Un,Ae,Ue,Ke,dt,Ut,sn,Rt,Pt,dn,Ce,kn,Pi,Xt;const a=h.resolveComponent("AdminCustomButtonAdd"),o=h.resolveComponent("IconPlus"),f=h.resolveComponent("router-link"),g=h.resolveComponent("AdminTableTabs"),y=h.resolveComponent("IconSearch"),v=h.resolveComponent("VsText"),E=h.resolveComponent("AdminTableCustomButtons"),T=h.resolveComponent("AdminTableCustomFilters"),D=h.resolveComponent("AdminTableColumnsHidden"),N=h.resolveComponent("AdminTablePrint"),B=h.resolveComponent("AdminTableExport"),F=h.resolveComponent("AdminTableFilters"),X=h.resolveComponent("IconOpenCard"),te=h.resolveComponent("AdminTableColumn"),H=h.resolveComponent("AdminComponentIs"),ke=h.resolveComponent("AdminTableControl"),me=h.resolveComponent("AdminTableTotalsList"),Se=h.resolveComponent("AdminNodata"),Pe=h.resolveComponent("AdminTablePagination"),Ne=h.resolveComponent("AdminTableCardInfo");return h.openBlock(),h.createElementBlock("div",Fae,[h.createElementVNode("div",$ae,[h.createElementVNode("h2",jae,h.toDisplayString(n.title),1),s.isForm?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(Qe=(lt=i.tableData)==null?void 0:lt.slots)!=null&&Qe.addButton?(h.openBlock(),h.createBlock(a,{key:0,slots:(gt=i.tableData)==null?void 0:gt.slots},null,8,["slots"])):(h.openBlock(),h.createBlock(f,{key:1,to:`/add?table=${(Tt=(rt=t.$route)==null?void 0:rt.params)==null?void 0:Tt.catchAll}`,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"},{default:h.withCtx(()=>[h.createVNode(o,{height:"16",width:"16"}),e[5]||(e[5]=h.createTextVNode(" Додати "))]),_:1},8,["to"]))],64)):h.createCommentVNode("",!0)]),h.createElementVNode("div",Hae,[h.createElementVNode("div",Uae,[(Ht=(jt=i.tableData)==null?void 0:jt.filterState)!=null&&Ht.length?(h.openBlock(),h.createBlock(g,{key:0,tabsList:(Nt=i.tableData)==null?void 0:Nt.filterState,filterState:i.filterState,"onUpdate:filterState":e[0]||(e[0]=tt=>i.filterState=tt)},null,8,["tabsList","filterState"])):h.createCommentVNode("",!0),h.createElementVNode("div",Wae,[h.createElementVNode("div",{class:h.normalizeClass([i.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[h.createElementVNode("div",{class:h.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!i.isVisibleCardInfo}])},[h.createVNode(y,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),h.createVNode(v,{modelValue:i.searchValue,"onUpdate:modelValue":e[1]||(e[1]=tt=>i.searchValue=tt),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:max-h-[36px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue"]),h.createElementVNode("div",qae,[(Gt=i.tableData)!=null&&Gt.slots?(h.openBlock(),h.createBlock(E,{key:0,slots:(wn=i.tableData)==null?void 0:wn.slots},null,8,["slots"])):h.createCommentVNode("",!0),(An=(yn=i.tableData)==null?void 0:yn.filterCustom)!=null&&An.length?(h.openBlock(),h.createBlock(T,{key:1,customList:(bn=i.tableData)==null?void 0:bn.filterCustom,filterCustom:i.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=tt=>i.filterCustom=tt)},null,8,["customList","filterCustom"])):h.createCommentVNode("",!0),h.createVNode(D,{columns:(hr=i.tableData)==null?void 0:hr.columns,onUpdateColumns:e[3]||(e[3]=tt=>i.tableData.columns=tt)},null,8,["columns"]),h.createVNode(N,{rows:(Hn=i.tableData)==null?void 0:Hn.rows,titleCol:(Un=(zn=s.columns)==null?void 0:zn[0])==null?void 0:Un.name},null,8,["rows","titleCol"]),((Ae=i.tableData)==null?void 0:Ae.export)!==!1?(h.openBlock(),h.createBlock(B,{key:2,table:n.table,columns:(Ue=i.tableData)==null?void 0:Ue.columns,page:i.page,"filter-state":i.filterState,"filter-custom":i.filterCustom,filters:i.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):h.createCommentVNode("",!0),(Ke=i.filterScheme)!=null&&Ke.length?(h.openBlock(),h.createBlock(F,{key:3,scheme:i.filterScheme,onFilters:i.onFilters,table:n.table,onFilterChange:s.filterChange},null,8,["scheme","onFilters","table","onFilterChange"])):h.createCommentVNode("",!0),h.createElementVNode("button",{onClick:e[4]||(e[4]=(...tt)=>s.toggleCardInfo&&s.toggleCardInfo(...tt)),class:"py-2 px-2.5 max-h-[34px] md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(X,{class:h.normalizeClass({"rotate-180 duration-300":!i.isVisibleCardInfo})},null,8,["class"])])])],2),h.createElementVNode("div",{class:h.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!i.isVisibleCardInfo}])},[h.createElementVNode("div",{style:h.normalizeStyle({height:(Ut=(dt=i.tableData)==null?void 0:dt.filterState)!=null&&Ut.length?"calc(100vh - 370px)":"calc(100vh - 330px)"}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[h.createElementVNode("div",Gae,[s.isNoData?(h.openBlock(),h.createBlock(Se,{key:1})):(h.openBlock(),h.createElementBlock("table",Yae,[h.createElementVNode("thead",Zae,[h.createElementVNode("tr",Xae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.columns,tt=>(h.openBlock(),h.createBlock(te,{key:tt.name,style:h.normalizeStyle({width:s.rowWidth(tt==null?void 0:tt.name),textAlign:tt==null?void 0:tt.align,wordBreak:tt==null?void 0:tt.wrap}),data:tt,activeColumn:i.activeColumn,onChangeActive:s.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(Rt=(sn=s.getActions)==null?void 0:sn.filter(tt=>tt!=="add"&&tt!=="view"))!=null&&Rt.length?(h.openBlock(),h.createElementBlock("th",Kae)):h.createCommentVNode("",!0)])]),h.createElementVNode("tbody",Jae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Pt=i.tableData)==null?void 0:Pt.rows,(tt,Ur)=>{var Rr,gr,ri,yr,Ri,Oi,$e,ii,br,si,Ni,We;return h.openBlock(),h.createElementBlock("tr",{key:(tt==null?void 0:tt.id)||Ur,class:h.normalizeClass({"bg-gray-50":((gr=(Rr=t.$route)==null?void 0:Rr.query)==null?void 0:gr.card)===(tt==null?void 0:tt.id)})},[h.createElementVNode("td",{class:h.normalizeClass(["px-1 py-3 text-gray-600 pe-4",[(ri=s.columns[0])!=null&&ri.align?`text-${((yr=s.columns[0])==null?void 0:yr.align)||"left"}`:""]])},[h.createElementVNode("button",{onClick:we=>{s.pushToCard(tt==null?void 0:tt.id),s.pushToLinkCard(s.columns[0],tt)},class:h.normalizeClass(["font-medium",[...s.getCustomStyles(s.columns[0]),((Ri=this.tableData)==null?void 0:Ri.card)===!1?"":" text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[h.createVNode(H,{row:tt,column:s.columns[0],table:n.table,onUpdateTable:s.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Qae)],2),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Oi=s.columns)==null?void 0:Oi.slice(1),we=>(h.openBlock(),h.createElementBlock("td",{onClick:Ve=>{s.changeActiveCardInfo(tt==null?void 0:tt.id),s.pushToLinkCard(we,tt)},class:h.normalizeClass(["px-1 py-3 text-gray-600 pe-3",s.getCustomStyles(we)]),key:we.name},[h.createVNode(H,{row:tt,column:we,table:n.table,onUpdateTable:s.getTableData},null,8,["row","column","table","onUpdateTable"])],10,ele))),128)),(ii=($e=s.getActions)==null?void 0:$e.filter(we=>we!=="add"&&we!=="view"))!=null&&ii.length?(h.openBlock(),h.createElementBlock("td",{key:0,class:h.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((si=(br=t.$route)==null?void 0:br.query)==null?void 0:si.card)===(tt==null?void 0:tt.id),"bg-white":((We=(Ni=t.$route)==null?void 0:Ni.query)==null?void 0:We.card)!==(tt==null?void 0:tt.id)}])},[h.createVNode(ke,{actions:s.getActions,isForm:s.isForm,item:tt,table:n.table,onUpdateTable:s.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):h.createCommentVNode("",!0)],2)}),128))]),h.createVNode(me,{columns:s.columns,agg:(dn=i.tableData)==null?void 0:dn.agg},null,8,["columns","agg"])]))])],4)],2),h.createElementVNode("div",tle,[h.createElementVNode("div",nle,[h.createElementVNode("p",rle,[h.createElementVNode("span",ile,[h.createTextVNode(h.toDisplayString(i.filters||i.searchValue?"Відображено":"Об'єктів")+" "+h.toDisplayString(((Ce=i.tableData)==null?void 0:Ce.count)||"0 ")+" ",1),i.filters||i.searchValue?(h.openBlock(),h.createElementBlock("span",sle," з")):h.createCommentVNode("",!0)]),i.filters||i.searchValue?(h.openBlock(),h.createElementBlock("span",ole,h.toDisplayString(" "+((kn=i.tableData)==null?void 0:kn.filtered)||0),1)):h.createCommentVNode("",!0)])]),Math.ceil(((Pi=i.tableData)==null?void 0:Pi.filtered)/i.limit)>1?(h.openBlock(),h.createBlock(Pe,{key:0,class:"justify-end","default-page":parseInt(s.defaultPage),total:((Xt=i.tableData)==null?void 0:Xt.filtered)||0,onPageChange:s.handlePageChange,pageSize:parseInt(i.limit),pageSizes:[10,20,50,100]},null,8,["default-page","total","onPageChange","pageSize"])):h.createCommentVNode("",!0)])],2),h.createVNode(h.Transition,{name:"slide-fade"},{default:h.withCtx(()=>{var tt;return[i.isVisibleCardInfo?(h.openBlock(),h.createBlock(Ne,{key:0,table:n.table,columns:(tt=i.tableData)==null?void 0:tt.columns,row:s.activeCardRow},null,8,["table","columns","row"])):h.createCommentVNode("",!0)]}),_:1})])])])])}const lle={components:{AdminTable:Le(Lae,[["render",ale],["__scopeId","data-v-87a0d788"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){_s!=null&&_s.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){var e;t&&(document.title=(((e=Ln.value)==null?void 0:e.titlePrefix)||"")+t)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async checkPageType(){var r,i;const t=this.flattenMenu(_s.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.params)==null?void 0:o.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.catchAll);const n=e==null?void 0:e.table;this.table=n||!1,!n&&this.getInterface()},async getInterface(){var t,e;try{const{data:n}=await Ze.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},cle=["innerHTML"];function dle(t,e,n,r,i,s){const a=h.resolveComponent("AdminTable");return i.table?(h.openBlock(),h.createBlock(a,{key:0,table:i.table,title:i.title},null,8,["table","title"])):(h.openBlock(),h.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:i.interface},null,8,cle))}const ule=Object.freeze(Object.defineProperty({__proto__:null,default:Le(lle,[["render",dle]])},Symbol.toStringTag,{value:"Module"}));return Fre});
776
+ `}).mount(n)}};window.addEventListener("click",t=>{var n,r,i;const e=(n=t==null?void 0:t.target)==null?void 0:n.closest("[_href]");if(e&&(e==null?void 0:e.tagName)==="A"){const s=e==null?void 0:e.getAttribute("_href");(i=(r=window==null?void 0:window.app)==null?void 0:r.router)==null||i.push(s),t==null||t.preventDefault()}});const zre=h.defineCustomElement(rI);customElements.define("admin-info",zre);const Vre=async()=>{try{const{data:t}=await Ze.get("/api/user-menu");return _s.value=t,yv(t)}catch(t){return console.error(t),[]}},Lre=(t,e)=>{Object.entries(e).forEach(([n,r])=>{t.component(n,r)})},Fre={async install(t,{componentsApp:e={},settings:n,routes:r=[]}){Ln.value={...Ln,...n};try{const s=(await Vre()).filter(o=>o==null?void 0:o.component).map(o=>({...o,component:{...vv,...e}[o==null?void 0:o.component]}));Lre(t,{...vv,...e}),t.component("admin",wO);const{router:a}=await rB(s.concat(r));window.app={...t,router:a},window.v3plugin={...t.config.globalProperties,...wv},t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...pE,componentsApp:e},$router:a,$v3plugin:wv,$utils:{reloadCardPage:Rf}},t.use(a)}catch(i){console.error(i)}},components:vv,plugins:wv},$re={data(){return{formValues:{},scheme:null,table:"",token:"",style:null}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,i;const t=this.flattenMenu(_s.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.query)==null?void 0:o.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:s}}=await Ze.get(`/api/template/table/${n}`),{data:a}=await Ze.get(`/api/table/${this.table}/${(i=(r=this.$route)==null?void 0:r.query)==null?void 0:i.id}`);this.token=(a==null?void 0:a.token)||"",this.formValues=a||{};const{data:o}=await Ze.get(`/api/template/form/${s}`);this.scheme=(o==null?void 0:o.schema)||o,this.style=(o==null?void 0:o.style)||null}catch{}},async onlyEditObject(){var e,n,r,i,s,a,o,f,g;const t=this.$refs.form;try{await t.doValidation(),await Ze.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(f=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:f[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}},async editObjectAndRedirect(){var e,n,r,i,s,a,o,f,g;const t=this.$refs.form;try{await t.doValidation(),await Ze.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(f=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:f[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}}}},jre={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},Hre={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Ure={class:"flex items-center gap-[6px]"},Wre={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},qre={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function Gre(t,e,n,r,i,s){var o;const a=h.resolveComponent("VsForm");return h.openBlock(),h.createElementBlock("div",jre,[h.createElementVNode("div",Hre,[e[3]||(e[3]=h.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),h.createElementVNode("div",Ure,[h.createElementVNode("button",{onClick:e[0]||(e[0]=f=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...f)=>s.editObjectAndRedirect&&s.editObjectAndRedirect(...f)),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"}," Зберегти ")])]),h.createElementVNode("div",Wre,[h.createElementVNode("div",qre,[i.scheme?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,columns:(o=i.style)==null?void 0:o.columns,style:h.normalizeStyle(i.style),modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=f=>i.formValues=f),class:"p-0 mt-[20px]"},null,8,["scheme","columns","style","modelValue"])):h.createCommentVNode("",!0)])])])}const Yre=Object.freeze(Object.defineProperty({__proto__:null,default:Le($re,[["render",Gre]])},Symbol.toStringTag,{value:"Module"})),Zre={data(){return{formValues:{},scheme:null,table:"",token:"",api:"",style:null}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,i;const t=this.flattenMenu(_s.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.query)==null?void 0:o.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const s=await Ze.get(`/api/table-data/${n}`),{data:a}=await Ze.get(`/api/template/form/${(r=s==null?void 0:s.data)==null?void 0:r.form}`);this.scheme=(a==null?void 0:a.schema)||a,this.style=(a==null?void 0:a.style)||null,this.api=(a==null?void 0:a.api)||"",this.token=(i=s==null?void 0:s.data)==null?void 0:i.addToken}catch{}},async createObject(){var e,n,r,i,s,a,o,f,g;const t=this.$refs.form;try{await t.doValidation(),await Ze.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(f=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:f[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}}}},Xre={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},Kre={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Jre={class:"flex items-center gap-[6px]"},Qre={style:{height:"calc(100vh - 165px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},eie={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function tie(t,e,n,r,i,s){const a=h.resolveComponent("VsForm");return h.openBlock(),h.createElementBlock("div",Xre,[h.createElementVNode("div",Kre,[e[3]||(e[3]=h.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),h.createElementVNode("div",Jre,[h.createElementVNode("button",{onClick:e[0]||(e[0]=o=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...o)=>s.createObject&&s.createObject(...o)),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"}," Зберегти ")])]),h.createElementVNode("div",Qre,[h.createElementVNode("div",eie,[i.scheme?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,style:h.normalizeStyle(i.style),modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=o=>i.formValues=o),class:"p-0 mt-[20px]"},null,8,["scheme","style","modelValue"])):h.createCommentVNode("",!0)])])])}const nie=Object.freeze(Object.defineProperty({__proto__:null,default:Le(Zre,[["render",tie]])},Symbol.toStringTag,{value:"Module"})),rie={};function iie(t,e,n,r,i,s){const a=h.resolveComponent("router-view");return h.openBlock(),h.createBlock(a)}const iI=Object.freeze(Object.defineProperty({__proto__:null,default:Le(rie,[["render",iie]])},Symbol.toStringTag,{value:"Module"})),sie={},oie={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-logout"};function aie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",oie,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),h.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),h.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const sI=Le(sie,[["render",aie]]),lie={},cie={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function die(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",cie,e[0]||(e[0]=[h.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const uie=Le(lie,[["render",die]]),hie={components:{IconChevronDown:Jg},props:{route:Object,searchable:String},mounted(){var t,e;(e=(t=this.route)==null?void 0:t.menu)!=null&&e.some(n=>{var r,i;return(n==null?void 0:n.path)===this.$route.path.replace("/","")||((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.table)===(n==null?void 0:n.table)&&(n==null?void 0:n.table)})&&(this.isOpen=!0)},watch:{route:{immediate:!0,handler(t){t!=null&&t.open&&(this.isOpen=!0)}}},data(){return{isOpen:!1,arr:[]}},computed:{darkMode(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.sidebarDark}},methods:{highLight(t){if(!this.searchable)return t;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${e})(\\s*)`,"gi");return t.replace(n,(r,i,s)=>`<span style="color:#1989fa;">${i}</span>${s}`)}}},pie={key:0,class:""},fie={key:0,class:"py-0.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full dark:bg-blue-500/10 dark:text-blue-500"},mie={key:1},gie=["innerHTML"];function yie(t,e,n,r,i,s){var f,g,y,v,E,T,D,N,B,F,X,te,H,ke,me;const a=h.resolveComponent("IconChevronDown"),o=h.resolveComponent("router-link");return(f=n.route)!=null&&f.menu?(h.openBlock(),h.createElementBlock("div",pie,[h.createElementVNode("button",{onClick:e[0]||(e[0]=Se=>i.isOpen=!i.isOpen),class:h.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100",[((y=(g=n.route)==null?void 0:g.menu)==null?void 0:y.some(Se=>{var Pe,Ne;return(Se==null?void 0:Se.path)===t.$route.path.replace("/","")||(Se==null?void 0:Se.table)===((Ne=(Pe=t.$route)==null?void 0:Pe.params)==null?void 0:Ne.table)&&(Se==null?void 0:Se.table)}))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!s.darkMode}]])},[h.createTextVNode(h.toDisplayString((v=n.route)==null?void 0:v.ua)+" ",1),(E=n.route)!=null&&E.new?(h.openBlock(),h.createElementBlock("span",fie,"Нове")):h.createCommentVNode("",!0),h.createVNode(a,{class:h.normalizeClass([[i.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var Se;return[h.withDirectives(h.createElementVNode("ul",{class:h.normalizeClass(["ml-[28px] pt-[6px] before:block before:absolute relative w-[calc(100%-28px)] flex-col gap-y-1.5 inline-flex before:w-[2px] before:h-[100%] before:left-[-10px] cursor-pointer",s.darkMode?"before:bg-white/10":"before:bg-gray-100"])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Se=n.route)==null?void 0:Se.menu,(Pe,Ne)=>{var lt,Qe;return h.openBlock(),h.createElementBlock("li",{key:Ne,class:"w-full"},[h.createVNode(o,{innerHTML:s.highLight(Pe==null?void 0:Pe.ua),to:"/"+(Pe==null?void 0:Pe.path),class:h.normalizeClass([[((Pe==null?void 0:Pe.path)===t.$route.path.replace("/","")||((Qe=(lt=t.$route)==null?void 0:lt.params)==null?void 0:Qe.table)===(Pe==null?void 0:Pe.table)&&(Pe==null?void 0:Pe.table))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!s.darkMode}],"block px-3 py-2 text-sm rounded-lg focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],2),[[h.vShow,i.isOpen]])]}),_:1})])):(T=n.route)!=null&&T.hidden?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",mie,[h.createVNode(o,{to:((N=(D=n.route)==null?void 0:D.path)==null?void 0:N[0])==="/"?(B=n.route)==null?void 0:B.path:"/"+((F=n.route)==null?void 0:F.path),class:h.normalizeClass([[(((X=n.route)==null?void 0:X.path.replace("/",""))===t.$route.path.replace("/","")||((H=(te=t.$route)==null?void 0:te.params)==null?void 0:H.table)===((ke=n.route)==null?void 0:ke.table)&&((me=n.route)==null?void 0:me.table))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10 ":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100 ":!s.darkMode}],"flex items-center w-full px-3 py-2 text-sm text-gray-800 duration-300 rounded-lg gap-x-3"])},{default:h.withCtx(()=>{var Se;return[h.createElementVNode("span",{innerHTML:s.highLight((Se=n.route)==null?void 0:Se.ua)},null,8,gie)]}),_:1},8,["to","class"])]))}const bie=Le(hie,[["render",yie]]),_ie={},xie={class:"flex-shrink-0 size-4",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"};function vie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",xie,e[0]||(e[0]=[h.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),h.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),h.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const oI=Le(_ie,[["render",vie]]),wie={},kie={class:"shrink-0 size-4 rounded-full",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Eie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",kie,e[0]||(e[0]=[h.createStaticVNode('<g fill-rule="evenodd"><g stroke-width="1pt"><path fill="#bd3d44" d="M0 0h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M0 10h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path></g><path fill="#192f5d" d="M0 0h98.8v70H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M8.2 3l1 2.8H12L9.7 7.5l.9 2.7-2.4-1.7L6 10.2l.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7L74 8.5l-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 7.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 24.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 21.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 38.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 35.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 52.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 49.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 66.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 63.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9z" transform="scale(3.9385)"></path></g>',1)]))}const Sie=Le(wie,[["render",Eie]]),Cie={},Tie={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"256",height:"256",viewBox:"0 0 256 256","xml:space":"preserve"};function Aie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Tie,e[0]||(e[0]=[h.createElementVNode("defs",null,null,-1),h.createElementVNode("g",{style:{stroke:"none","stroke-width":"0","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"none","fill-rule":"nonzero",opacity:"1"},transform:"translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"},[h.createElementVNode("path",{d:"M 45 90 C 20.147 90 0 69.853 0 45 h 90 C 90 69.853 69.853 90 45 90 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(255,213,0)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"}),h.createElementVNode("path",{d:"M 45 0 C 20.147 0 0 20.147 0 45 h 90 C 90 20.147 69.853 0 45 0 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(0,91,187)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"})],-1)]))}const Mie=Le(Cie,[["render",Aie]]),Die={},Iie={class:"shrink-0 size-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.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"};function Pie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Iie,e[0]||(e[0]=[h.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))}const Rie={components:{IconQuestion:oI,IconUSA:Sie,IconUkraine:Mie,IconTick:Le(Die,[["render",Pie]])},props:["docs","languages"],data(){return{currentLang:"ukraine",languagesOptions:[{titleEN:"English",titleUA:"Англійська",id:"english",icon:"IconUSA"},{titleEN:"Ukraine",titleUA:"Українська",id:"ukraine",icon:"IconUkraine"}]}},computed:{selectedLang(){return this.languagesOptions.find(t=>t.id===this.currentLang)},darkMode(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.sidebarDark}},methods:{changeLang(t){this.$refs.langPopover.togglePopover(),this.currentLang=t}}},Oie={class:"flex justify-center items-center gap-x-2"},Nie=["onClick"],Bie={class:"text-gray-800"},zie={class:"ms-auto"},Vie={class:"truncate"};function Lie(t,e,n,r,i,s){const a=h.resolveComponent("IconTick"),o=h.resolveComponent("VsPopover");return n.docs||n.languages?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["py-2 px-5 border-t dark:border-neutral-700",s.darkMode?"border-white/10 ":"border-gray-200"])},[h.createElementVNode("div",Oie,[h.createVNode(o,{trigger:"click",placement:"top",ref:"langPopover"},{reference:h.withCtx(()=>{var f,g,y;return[h.createElementVNode("button",{type:"button","aria-expanded":"false",class:h.normalizeClass(["relative py-2 px-3 flex items-center gap-x-2 text-nowrap w-full cursor-pointer border rounded-full text-start text-sm text-gray-800 focus:outline-none",s.darkMode?"border-white/10 bg-transparent text-white/80 hover:bg-white/10 focus:bg-white/10":"border-gray-200 bg-white hover:bg-gray-100 focus:bg-gray-100"])},[h.createElementVNode("div",null,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent((f=s.selectedLang)==null?void 0:f.icon),{class:"w-[16px] h-[16px] rounded-full"}))]),h.createElementVNode("span",Vie,h.toDisplayString(i.currentLang==="ukraine"?(g=s.selectedLang)==null?void 0:g.titleUA:(y=s.selectedLang)==null?void 0:y.titleEN),1)],2)]}),default:h.withCtx(()=>[h.createElementVNode("div",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.languagesOptions,f=>(h.openBlock(),h.createElementBlock("button",{key:f.id,type:"button",onClick:g=>s.changeLang(f.id),class:h.normalizeClass(["flex items-center gap-x-2 cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 selected",(f==null?void 0:f.id)===i.currentLang?"bg-gray-100":""])},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(f==null?void 0:f.icon),{class:"w-[16px] h-[16px] rounded-full"})),h.createElementVNode("div",Bie,h.toDisplayString(i.currentLang==="ukraine"?f==null?void 0:f.titleUA:f==null?void 0:f.titleEN),1),h.createElementVNode("span",zie,[(f==null?void 0:f.id)===i.currentLang?(h.openBlock(),h.createBlock(a,{key:0})):h.createCommentVNode("",!0)])],10,Nie))),128))])]),_:1},512)])],2)):h.createCommentVNode("",!0)}const Fie={components:{IconLogout:sI,NavbarItem:bie,IconLogo:uie,IconSearch:bv,NavbarFooter:Le(Rie,[["render",Lie]])},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t;return(t=this.searchValue)!=null&&t.trim()?this.filterMenu(_s.value,this.searchValue):_s.value},logo(){var t;return((t=Ln.value)==null?void 0:t.logo)||"/assets/logo.svg"},docs(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.docs},languages(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.languages},darkMode(){var t;return(t=Ln==null?void 0:Ln.value)==null?void 0:t.sidebarDark},darkColor(){var t,e;return((t=Ln==null?void 0:Ln.value)==null?void 0:t.sidebarColor)||((e=Ln==null?void 0:Ln.value)==null?void 0:e.color)||"blue"}},watch:{"$route.path"(){this.$parent.showMenu=!1}},methods:{filterMenu(t,e){return t.map(n=>{var r,i;if(n.menu){const s=this.filterMenu(n.menu,e);if(s.length>0)return{...n,menu:s,open:!0}}else if((i=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&i.includes(e.toLowerCase()))return n;return null}).filter(Boolean)}}},$ie={class:"h-[46px] w-full px-5 lg:px-8 mb-[10px]"},jie={href:"/"},Hie=["src"],Uie={class:"px-2 lg:px-5"},Wie={class:"px-2 lg:px-5 flex flex-col flex-wrap w-full pb-3"},qie={key:0,class:"flex flex-col gap-y-1"};function Gie(t,e,n,r,i,s){var g;const a=h.resolveComponent("VsText"),o=h.resolveComponent("NavbarItem"),f=h.resolveComponent("NavbarFooter");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] pt-3 border-r w-[260px] top-0 bottom-0 shrink-0 absolute transition left-[-100%] z-[11]",{"left-0":t.$parent.showMenu,["bg-"+s.darkColor+"-950"]:s.darkMode,"bg-white":!s.darkMode}])},[h.createElementVNode("div",$ie,[h.createElementVNode("a",jie,[h.createElementVNode("img",{src:s.logo,class:"object-contain w-full h-full"},null,8,Hie)])]),h.createElementVNode("div",Uie,[h.createVNode(a,{type:"text",modelValue:i.searchValue,"onUpdate:modelValue":e[0]||(e[0]=y=>i.searchValue=y),clearable:!0,icon:"search","icon-position":"left",placeholder:"Пошук по меню",class:h.normalizeClass(["[&>input]:h-[38px]",{"[&>input]:bg-[#172554] [&>input]:text-white/80 [&>input]:placeholder:text-white/40 [&>input]:border [&>input]:border-white/50":s.darkMode,["[&>input]:bg-"+s.darkColor+"-950"]:s.darkMode,["focus:[&>input]:border-"+s.darkColor+"-500"]:s.darkMode}])},null,8,["modelValue","class"])]),h.createElementVNode("div",{class:h.normalizeClass(["py-[10px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",s.languages||s.docs?"h-[calc(100vh-161px)]":"h-[calc(100vh-110px)]"])},[h.createElementVNode("nav",Wie,[(g=s.data)!=null&&g.length?(h.openBlock(),h.createElementBlock("ul",qie,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.data,(y,v)=>(h.openBlock(),h.createElementBlock("li",{key:v,class:"flex flex-col gap-[6px]"},[h.createVNode(o,{route:y,searchable:i.searchValue},null,8,["route","searchable"])]))),128))])):(h.openBlock(),h.createElementBlock("div",{key:1,class:h.normalizeClass(["text-lg mt-[20px]",{"text-white/80":s.darkMode,"text-gray-800":!s.darkMode}])}," Не знайдено ",2))])],2),s.docs||s.languages?(h.openBlock(),h.createBlock(f,{key:0,docs:s.docs,languages:s.languages},null,8,["docs","languages"])):h.createCommentVNode("",!0)],2)}const Yie=Le(Fie,[["render",Gie],["__scopeId","data-v-ebe4c2ff"]]),Zie={components:{IconQuestion:oI,IconUser:sA,AdminNotification:oA,IconUserOutline:rA,IconLogout:sI},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(t){t?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:t}=await Ze.get("/user");this.userData=t}catch{}},async logout(){try{await Ze.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},Xie={class:"h-[58px] border-b flex lg:justify-end justify-between items-center px-[20px]"},Kie={class:"flex items-center gap-[6px]"},Jie={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},Qie={class:"relative"},ese=["src"],tse={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},nse=["src"],rse={key:1,class:"flex items-center justify-center bg-gray-200 rounded-full size-10"},ise={class:"grow"},sse={class:"block text-sm font-medium text-gray-800 dark:text-neutral-200"},ose={class:"text-xs text-gray-500 dark:text-neutral-500"},ase={class:"flex flex-col space-y-0.5"};function lse(t,e,n,r,i,s){var E,T,D,N;const a=h.resolveComponent("IconQuestion"),o=h.resolveComponent("AdminNotification"),f=h.resolveComponent("IconUser"),g=h.resolveComponent("router-link"),y=h.resolveComponent("IconUserOutline"),v=h.resolveComponent("IconLogout");return h.openBlock(),h.createElementBlock("div",Xie,[h.createElementVNode("div",{class:"flex lg:hidden",onClick:e[0]||(e[0]=B=>t.$parent.showMenu=!0)},e[4]||(e[4]=[h.createStaticVNode('<svg 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" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l16 0"></path><path d="M4 12l16 0"></path><path d="M4 18l16 0"></path></svg>',1)])),h.createElementVNode("div",Kie,[h.createElementVNode("a",Jie,[h.createVNode(a,{height:"24",width:"24"})]),h.createVNode(o),e[9]||(e[9]=h.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),h.createElementVNode("div",Qie,[h.createElementVNode("div",{onClick:e[1]||(e[1]=B=>i.isVisible=!0),class:"cursor-pointer"},[(T=(E=i.userData)==null?void 0:E.user)!=null&&T.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(N=(D=i.userData)==null?void 0:D.user)==null?void 0:N.avatar,alt:"Image Description"},null,8,ese)):(h.openBlock(),h.createElementBlock("div",tse,[h.createVNode(f)]))]),i.isVisible?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=h.withModifiers(()=>{},["stop"])),class:"fixed p-2 bg-white w-[240px] top-[55px] right-[20px] rounded-xl z-[1] shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:shadow-[0_10px_40px_10px_rgba(0,0,0,0.2)] dark:bg-neutral-900 block"},[h.createVNode(g,{to:"profile",disabled:!0,class:"py-2 px-2.5 flex items-center gap-3 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800"},{default:h.withCtx(()=>{var B,F,X,te,H,ke,me,Se;return[(F=(B=i.userData)==null?void 0:B.user)!=null&&F.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"rounded-full shrink-0 size-10",src:(te=(X=i.userData)==null?void 0:X.user)==null?void 0:te.avatar,alt:"Image Description"},null,8,nse)):(h.openBlock(),h.createElementBlock("div",rse,[h.createVNode(f,{class:"w-[16px]"})])),h.createElementVNode("div",ise,[h.createElementVNode("span",sse,h.toDisplayString(((ke=(H=i.userData)==null?void 0:H.user)==null?void 0:ke.username)||"User User"),1),h.createElementVNode("p",ose,h.toDisplayString(((Se=(me=i.userData)==null?void 0:me.user)==null?void 0:Se.email)||"email не вказано"),1)])]}),_:1}),e[7]||(e[7]=h.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("ul",ase,[h.createElementVNode("li",null,[h.createVNode(g,{to:"profile",class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",disabled:"true"},{default:h.withCtx(()=>[h.createVNode(y,{class:"size-4"}),e[5]||(e[5]=h.createTextVNode(" Профіль "))]),_:1})])]),e[8]||(e[8]=h.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("p",null,[h.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...B)=>s.logout&&s.logout(...B)),class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-red-500 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 dark:hover:text-red-500 dark:focus:text-red-500"},[h.createVNode(v,{class:"size-4"}),e[6]||(e[6]=h.createTextVNode(" Вийти "))])])])):h.createCommentVNode("",!0)])])])}const cse={components:{navbar:Yie,AdminHeader:Le(Zie,[["render",lse]])},data(){return{showMenu:!1}},computed:{isMenu(){return _s.value||null},header(){var t;return((t=Ln.value)==null?void 0:t.header)||"admin-header"}}},dse={class:"admin-wrapper"},use={class:"flex flex-col w-full"};function hse(t,e,n,r,i,s){const a=h.resolveComponent("navbar"),o=h.resolveComponent("router-view");return h.openBlock(),h.createElementBlock("div",dse,[h.createVNode(a),i.showMenu?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=f=>i.showMenu=!1),class:"z-[10] lg:hidden transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900"})):h.createCommentVNode("",!0),h.createElementVNode("div",use,[s.isMenu?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(s.header))),h.createVNode(o)],64)):h.createCommentVNode("",!0)])])}const pse=Object.freeze(Object.defineProperty({__proto__:null,default:Le(cse,[["render",hse],["__scopeId","data-v-34da2042"]])},Symbol.toStringTag,{value:"Module"})),fse={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var t,e;return((t=this.data)==null?void 0:t.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var t,e;return(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(t){t!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(t){switch(t){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(t){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(t);const e=this.$route.query,{sort:n,...r}=e,i=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...r,...i&&{sort:i}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},mse={scope:"col",class:"pe-2 py-1 text-start"},gse={class:"w-[24px]"},yse={key:1,class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200"};function bse(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("th",mse,[s.getVisibleIcon?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200",onClick:e[0]||(e[0]=a=>s.handleClickSortBtn(i.currentSort))},[h.createTextVNode(h.toDisplayString(s.label)+" ",1),h.createElementVNode("span",gse,[i.currentSort?(h.openBlock(),h.createElementBlock("svg",{key:0,class:h.normalizeClass(["shrink-0 size-3.5",{"rotate-180":i.currentSort==="asc"}]),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"},e[1]||(e[1]=[h.createElementVNode("path",{d:"m5 12 7-7 7 7"},null,-1),h.createElementVNode("path",{d:"M12 19V5"},null,-1)]),2)):h.createCommentVNode("",!0)])])):(h.openBlock(),h.createElementBlock("p",yse,h.toDisplayString(s.label),1))])}const _se=Le(fse,[["render",bse]]),xse={components:{IconMore:fg,IconDelete:nx,IconEdit:rx},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},computed:{getCustomActions(){return this.actions.filter(t=>typeof t=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await Ze.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var t,e;try{const{data:n}=await Ze.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await Ze.delete(`/api/table/${n==null?void 0:n.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch(n){this.$notify({title:"Помилка!",message:(e=n==null?void 0:n.response)==null?void 0:e.data,type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(t){var e,n;document.querySelector("body").click(),t!=null&&t.form?(await this.$v3plugin.$form({form:t==null?void 0:t.form,id:(e=this.item)==null?void 0:e.id,api:t==null?void 0:t.api,title:t==null?void 0:t.title}),await this.$emit("update-table")):await this.$v3plugin.$api({confirm:t==null?void 0:t.confirm,api:t==null?void 0:t.api,method:t==null?void 0:t.method,id:(n=this.item)==null?void 0:n.id,isId:(t==null?void 0:t.isId)||!1})}}},vse={class:"inline-flex"},wse={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},kse={class:"flex flex-col items-start"},Ese=["onClick"],Sse={class:"text-gray-800"},Cse={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},Tse={class:"flex justify-end p-[16px] pr-0 gap-x-3"};function Ase(t,e,n,r,i,s){const a=h.resolveComponent("IconMore"),o=h.resolveComponent("IconEdit"),f=h.resolveComponent("router-link"),g=h.resolveComponent("IconDelete"),y=h.resolveComponent("VsPopover"),v=h.resolveComponent("VsConfirm");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",vse,[h.createVNode(y,{trigger:"click",placement:"bottom-left"},{reference:h.withCtx(()=>[h.createElementVNode("button",wse,[h.createVNode(a,{height:"16",width:"16"})])]),default:h.withCtx(()=>{var E,T,D,N,B;return[h.createElementVNode("div",kse,[(E=n.actions)!=null&&E.includes("edit")&&n.isForm?(h.openBlock(),h.createBlock(f,{key:0,to:`/edit?table=${(D=(T=t.$route)==null?void 0:T.params)==null?void 0:D.catchAll}&id=${(N=n.item)==null?void 0:N.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:h.withCtx(()=>[h.createVNode(o,{color:"#000"}),e[4]||(e[4]=h.createTextVNode(" Редагувати "))]),_:1},8,["to"])):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.getCustomActions,(F,X)=>(h.openBlock(),h.createElementBlock("button",{key:X,onClick:te=>s.customButtonAction(F),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(g,{class:"opacity-0"}),h.createElementVNode("span",Sse,h.toDisplayString(F==null?void 0:F.label),1)],8,Ese))),128)),n.isForm?(h.openBlock(),h.createElementBlock("div",Cse)):h.createCommentVNode("",!0),(B=n.actions)!=null&&B.includes("del")?(h.openBlock(),h.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=h.withModifiers((...F)=>s.openConfirm&&s.openConfirm(...F),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(g),e[5]||(e[5]=h.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):h.createCommentVNode("",!0)])]}),_:1})]),h.createVNode(v,{visible:i.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=E=>i.isDeleteConfirm=E),size:"small",title:"Ви впевнені?"},{default:h.withCtx(()=>[e[6]||(e[6]=h.createElementVNode("p",{class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),h.createElementVNode("div",Tse,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm hover:bg-gray-100 gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[1]||(e[1]=E=>i.isDeleteConfirm=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 hover:bg-red-700 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...E)=>s.deleteElement&&s.deleteElement(...E))}," Так, я впевнена(ий) ")])]),_:1},8,["visible"])],64)}const Mse=Le(xse,[["render",Ase]]),Dse={},Ise={class:"flex-shrink-0 mt-0.5 size-3.5",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"};function Pse(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Ise,e[0]||(e[0]=[h.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),h.createElementVNode("path",{d:"M7 20V4"},null,-1),h.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),h.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const aI=Le(Dse,[["render",Pse]]),Rse={},Ose={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"};function Nse(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Ose,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"},null,-1),h.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const lI=Le(Rse,[["render",Nse]]),Bse={components:{IconExport:aI,IconChevronDown:Jg,IconSuccess:lI},props:{table:String,columns:Array,page:[String,Number],filterCustom:String,filterState:String,filters:String},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[],activeAction:"",isSuccessTemplate:!1,actions:[{name:"choceAll",function:this.choceAll,label:"Вибрати усі"},{name:"choceVisible",function:this.choceVisible,label:"Вибрати поточні"},{name:"clearAll",function:this.clearAll,label:"Жодного"}]}},watch:{isOpen(t){t||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},methods:{async exportTable(){var t;if(!((t=this.cols)!=null&&t.length)){this.$notify({type:"error",title:"Помилка",message:"Оберіть колонки для експорту!"});return}if(!this.format){this.$notify({type:"error",title:"Помилка",message:"Оберіть формат!"});return}try{const e=await Ze.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null},responseType:"blob"}),n=await e.data.text(),r=n!=null&&n.includes(";")?null:JSON==null?void 0:JSON.parse(n),i=new Blob([e.data],{type:"application/octet-stream"}),s=window.URL.createObjectURL(i),a=document.createElement("a");if(a.href=s,a.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(a),typeof r=="string"){this.exportTable();return}a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.log(e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(t){this.format=t},choceAll(){var t;this.cols=(t=this.columns)==null?void 0:t.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var t,e;this.cols=(e=(t=this.columns)==null?void 0:t.filter(n=>(n==null?void 0:n.hidden)!==!0))==null?void 0:e.map(n=>n==null?void 0:n.name),this.activeAction="choceVisible"}}},zse={key:0,class:"flex flex-col items-center"},Vse={key:1,class:"p-4"},Lse={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},Fse={class:"flex items-center gap-[10px] -ml-[10px] my-[10px]"},$se=["onClick"],jse={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},Hse={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},Use={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},Wse={class:"mt-2 space-y-2"},qse=["id","onChange"],Gse=["for"],Yse={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},Zse={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function Xse(t,e,n,r,i,s){const a=h.resolveComponent("IconExport"),o=h.resolveComponent("IconSuccess"),f=h.resolveComponent("VsCheckbox"),g=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=y=>i.isOpen=!0),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"16",width:"16"}),e[7]||(e[7]=h.createTextVNode(" Експорт "))]),h.createVNode(g,{visible:i.isOpen,"onUpdate:visible":e[6]||(e[6]=y=>i.isOpen=y),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:h.withCtx(()=>[i.isSuccessTemplate?(h.openBlock(),h.createElementBlock("div",Yse,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[2]||(e[2]=y=>i.isOpen=!1)}," Закрити "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[3]||(e[3]=y=>i.isSuccessTemplate=!1)}," Вигрузити ще ")])):(h.openBlock(),h.createElementBlock("div",Zse,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=y=>i.isOpen=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[5]||(e[5]=(...y)=>s.exportTable&&s.exportTable(...y))}," Завантажити таблицю ")]))]),default:h.withCtx(()=>[i.isSuccessTemplate?(h.openBlock(),h.createElementBlock("div",zse,[h.createVNode(o,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=h.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(h.openBlock(),h.createElementBlock("div",Vse,[h.createElementVNode("div",Lse,[e[9]||(e[9]=h.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),h.createElementVNode("div",Fse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.actions,y=>(h.openBlock(),h.createElementBlock("button",{key:y==null?void 0:y.name,onClick:y==null?void 0:y.function,class:"inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"},[h.createElementVNode("span",{class:h.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(y==null?void 0:y.name)===i.activeAction}])},[(y==null?void 0:y.name)===i.activeAction?(h.openBlock(),h.createElementBlock("span",jse)):h.createCommentVNode("",!0)],2),h.createTextVNode(" "+h.toDisplayString(y==null?void 0:y.label),1)],8,$se))),128))]),h.createElementVNode("div",Hse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.columns,(y,v)=>(h.openBlock(),h.createElementBlock("div",{class:"flex items-center",key:v,style:{width:"calc((100% - 10px) / 2)"}},[h.createVNode(f,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:i.cols,"onUpdate:modelValue":e[1]||(e[1]=E=>i.cols=E),value:y==null?void 0:y.name,label:y==null?void 0:y.ua},null,8,["modelValue","value","label"])]))),128))])]),h.createElementVNode("div",Use,[e[10]||(e[10]=h.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"},"Виберіть формат таблиці:",-1)),h.createElementVNode("div",Wse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.tableFormats,(y,v)=>(h.openBlock(),h.createElementBlock("div",{class:"flex items-center",key:v},[h.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:y,onChange:E=>s.selectFormat(y)},null,40,qse),h.createElementVNode("label",{for:y,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+h.toDisplayString(y),9,Gse)]))),128))])])]))]),_:1},8,["visible"])],64)}const Kse=Le(Bse,[["render",Xse]]),Jse={components:{IconExport:aI,IconChevronDown:Jg,IconSuccess:lI},props:{data:Object,rows:Array,titleCol:String},data(){return{isOpen:!1,selectedTemplate:null,mode:"base"}},methods:{resetSelections(t){t||(this.selectedTemplate=null,this.mode="base")},getTemplateUrl(){return`/api/print-template/crm.accounts.doc/${this.selectedTemplate}?${this.mode}=1&format=pdf`},downloadPdf(){if(!this.selectedTemplate)return;const t=document.createElement("a");t.href=`/api/print-template/crm.accounts.doc/${this.selectedTemplate}?format=pdf`,t.download=`document_${this.selectedTemplate}.pdf`,t.click()},downloadWord(){if(!this.selectedTemplate)return;const t=document.createElement("a");t.href=`/api/print-template/crm.accounts.doc/${this.selectedTemplate}?format=word`,t.download=`document_${this.selectedTemplate}.docx`,t.click()}},mounted(){console.log("rows",this.rows)}},Qse={class:"p-4 flex flex-col"},eoe={class:"flex mb-4 gap-2 border rounded overflow-hidden"},toe={class:"flex"},noe={class:"overflow-y-auto h-[400px] w-1/2 space-y-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},roe=["id","value"],ioe=["for"],soe={key:0,class:"w-[400px] h-[400px] border ml-4 flex items-center justify-center text-gray-600 text-lg font-medium"},ooe=["src"],aoe={class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function loe(t,e,n,r,i,s){const a=h.resolveComponent("IconExport"),o=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=f=>i.isOpen=!0),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"16",width:"16"}),e[9]||(e[9]=h.createTextVNode(" Друк "))]),h.createVNode(o,{visible:i.isOpen,"onUpdate:visible":[e[8]||(e[8]=f=>i.isOpen=f),s.resetSelections],title:"Друк",size:"small",closeClickBack:!0},{footer:h.withCtx(()=>[h.createElementVNode("div",aoe,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[5]||(e[5]=f=>i.isOpen=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-500 border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-blue-600 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[6]||(e[6]=(...f)=>s.downloadPdf&&s.downloadPdf(...f))}," Завантажити PDF "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-green-500 border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-green-600 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[7]||(e[7]=(...f)=>s.downloadWord&&s.downloadWord(...f))}," Завантажити Word ")])]),default:h.withCtx(()=>[h.createElementVNode("div",Qse,[h.createElementVNode("div",eoe,[h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="base","bg-white":i.mode!=="base"},"px-4 py-2 border-r text-black w-full"]),onClick:e[1]||(e[1]=f=>i.mode="base")}," Базовий ",2),h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="demo","bg-white":i.mode!=="demo"},"px-4 py-2 border-r text-black w-full"]),onClick:e[2]||(e[2]=f=>i.mode="demo")}," Демо ",2),h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="preview","bg-white":i.mode!=="preview"},"px-4 py-2 text-black w-full"]),onClick:e[3]||(e[3]=f=>i.mode="preview")}," Перегляд шаблону ",2)]),h.createElementVNode("div",toe,[h.createElementVNode("div",noe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.rows,f=>(h.openBlock(),h.createElementBlock("div",{key:f.id,class:"flex items-center gap-2"},[h.withDirectives(h.createElementVNode("input",{type:"radio",id:f.id,value:f.id,"onUpdate:modelValue":e[4]||(e[4]=g=>i.selectedTemplate=g),class:"cursor-pointer h-5"},null,8,roe),[[h.vModelRadio,i.selectedTemplate]]),h.createElementVNode("label",{for:f.id,class:"cursor-pointer"},h.toDisplayString(f[n.titleCol]),9,ioe)]))),128))]),i.selectedTemplate?(h.openBlock(),h.createElementBlock("iframe",{key:1,class:"w-[400px] h-[400px] border ml-4",src:s.getTemplateUrl()},null,8,ooe)):(h.openBlock(),h.createElementBlock("div",soe," Оберіть для друку та прев'ю "))])])]),_:1},8,["visible","onUpdate:visible"])],64)}const coe=Le(Jse,[["render",loe]]),doe={},uoe={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"};function hoe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",uoe,e[0]||(e[0]=[h.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const poe=Le(doe,[["render",hoe]]),foe={props:{column:Object},emits:["update-column"],components:{IconCheck2:M0},data(){return{value:!1}},watch:{value(t){this.$emit("update-column",{...this.column,hidden:!t})}},mounted(){var t;((t=this.column)==null?void 0:t.hidden)!==!0&&(this.value=!0)}},moe={class:"flex justify-between items-center py-1.5 px-3 cursor-pointer rounded-lg hover:bg-gray-100 has-[:disabled]:opacity-50 has-[:disabled]:pointer-events-none dark:hover:bg-neutral-800"},goe={class:"flex justify-between flex-1 items-center gap-x-2.5 cursor-pointer text-[13px] text-gray-800 dark:text-neutral-300"};function yoe(t,e,n,r,i,s){var o,f;const a=h.resolveComponent("IconCheck2");return h.openBlock(),h.createElementBlock("div",moe,[h.createElementVNode("label",goe,[h.createTextVNode(h.toDisplayString(((o=n.column)==null?void 0:o.ua)||((f=n.column)==null?void 0:f.title))+" ",1),h.withDirectives(h.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=g=>i.value=g),class:"hidden"},null,512),[[h.vModelCheckbox,i.value]]),h.createElementVNode("span",{class:h.normalizeClass(["flex items-center justify-center text-white border border-gray-300 rounded shrink-0 size-4 focus:ring-blue-500",[i.value?"bg-blue-600 border-0":"bg-white"]])},[h.createVNode(a,{height:"12",width:"12"})],2)])])}const boe={components:{IconColumns:poe,AdminTableColumnsHiddenItem:Le(foe,[["render",yoe]])},emits:["update-columns"],props:{columns:Array},data(){return{searchValue:"",visible:!1}},computed:{filteredColumn(){var t;return(t=this.columns)==null?void 0:t.filter(e=>{var n,r,i,s,a,o;return((i=(n=e==null?void 0:e.ua)==null?void 0:n.toLowerCase())==null?void 0:i.includes((r=this.searchValue)==null?void 0:r.toLowerCase()))||((o=(s=e==null?void 0:e.title)==null?void 0:s.toLowerCase())==null?void 0:o.includes((a=this.searchValue)==null?void 0:a.toLowerCase()))})}},methods:{toggleVisible(){this.visible=!this.visible,this.visible?document.addEventListener("click",this.handleClickOutside):document.removeEventListener("click",this.handleClickOutside)},handleClickOutside(t){const e=this.$refs.wrapper;e&&!e.contains(t.target)&&(this.visible=!1,document.removeEventListener("click",this.handleClickOutside))},updateColumn(t){const e=this.columns.findIndex(r=>(r==null?void 0:r.name)===(t==null?void 0:t.name)),n=this.columns;n[e]=t,this.$emit("update-columns",[...n])}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},_oe={class:"relative",ref:"wrapper"},xoe={key:0,class:"absolute left-[50%] top-[110%] translate-x-[-50%] z-10 w-64 transition-[opacity,margin] duration bg-white rounded-xl shadow-lg dark:bg-neutral-900"},voe={class:"relative p-1 border-gray-200 border-y dark:border-neutral-800"},woe={class:"p-1 pt-3 max-h-80 overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},koe={key:0,class:"block px-3 mb-2 text-xs text-gray-500 dark:text-neutral-500"},Eoe={class:"space-y-1"},Soe={key:1,class:"flex items-center px-3 text-[13px] py-1.5 px-3 rounded-md cursor-pointer group"};function Coe(t,e,n,r,i,s){const a=h.resolveComponent("IconColumns"),o=h.resolveComponent("AdminTableColumnsHiddenItem");return h.openBlock(),h.createElementBlock("div",_oe,[h.createElementVNode("button",{onClick:e[0]||(e[0]=(...f)=>s.toggleVisible&&s.toggleVisible(...f)),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"20",width:"16"})]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var f,g;return[i.visible?(h.openBlock(),h.createElementBlock("div",xoe,[e[2]||(e[2]=h.createElementVNode("div",{class:"flex items-center justify-between h-[48px] px-4 py-2 gap-x-2 text-sm font-medium text-gray-800"}," Колонки ",-1)),h.createElementVNode("div",voe,[h.withDirectives(h.createElementVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=y=>i.searchValue=y),type:"text",class:"py-1.5 px-3 block w-full border-transparent rounded-lg sm:text-sm text-base placeholder:text-gray-500 hover:bg-gray-100 focus:outline-none focus:border-transparent focus:ring-0 focus:bg-gray-100 disabled:opacity-100 disabled:pointer-events-none dark:bg-transparent dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:ring-neutral-600 dark:focus:bg-neutral-800",placeholder:"Search",autofocus:""},null,512),[[h.vModelText,i.searchValue]])]),h.createElementVNode("div",woe,[(f=s.filteredColumn)!=null&&f.length?(h.openBlock(),h.createElementBlock("span",koe," Оберіть колонки для відображення ")):h.createCommentVNode("",!0),h.createElementVNode("div",Eoe,[(g=s.filteredColumn)!=null&&g.length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(s.filteredColumn,(y,v)=>(h.openBlock(),h.createBlock(o,{key:v,column:y,onUpdateColumn:s.updateColumn},null,8,["column","onUpdateColumn"]))),128)):(h.openBlock(),h.createElementBlock("div",Soe," Нічого не знайдено "))])])])):h.createCommentVNode("",!0)]}),_:1})],512)}const Toe=Le(boe,[["render",Coe]]),Aoe={},Moe={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-minus"};function Doe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Moe,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const Ioe={components:{IconPlus:Qh,IconMinus:Le(Aoe,[["render",Doe]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},Poe={class:"hs-accordion"},Roe={class:"py-0.5 flex items-center gap-x-0.5 w-full"},Ooe={class:"text-sm font-medium"},Noe={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function Boe(t,e,n,r,i,s){const a=h.resolveComponent("IconPlus"),o=h.resolveComponent("IconMinus");return h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",null,[h.createElementVNode("div",Poe,[h.createElementVNode("div",Roe,[h.createElementVNode("div",{onClick:e[0]||(e[0]=f=>i.expanded=!i.expanded),class:"rounded-md cursor-pointer grow"},[h.createElementVNode("span",Ooe,h.toDisplayString(n.title),1)]),h.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=f=>i.expanded=!i.expanded)},[i.expanded?(h.openBlock(),h.createBlock(o,{key:1,width:"14"})):(h.openBlock(),h.createBlock(a,{key:0}))])]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",Noe,[h.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[h.vShow,i.expanded]])]),_:3})])])])}const zoe={components:{AdminComponentIs:ep,AdminTree:Le(Ioe,[["render",Boe],["__scopeId","data-v-c6318482"]]),VsNoData:_v,VsWidgetComments:tA,VsWidgetMap:db,VsWidgetFileList:m2},props:{table:String,columns:Array,row:Object}},Voe={class:"hs-accordion border-gray-100 w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 310px)"}},Loe={class:"border-l",style:{height:"calc(100vh - 360px)"}},Foe={class:"flow-root mt-[10px]"},$oe={class:"-my-3 text-sm divide-y divide-gray-100"},joe={class:"flex py-3 sm:grid-cols-3 sm:gap-4"},Hoe={class:"font-medium text-black w-[50%]"},Uoe={class:"text-gray-700 sm:col-span-2 w-[50%]"},Woe={class:"table-info-card"},qoe={class:"table-info-card"};function Goe(t,e,n,r,i,s){var E,T,D;const a=h.resolveComponent("AdminComponentIs"),o=h.resolveComponent("AdminTree"),f=h.resolveComponent("VsWidgetMap"),g=h.resolveComponent("VsNoData"),y=h.resolveComponent("VsWidgetComments"),v=h.resolveComponent("VsWidgetFileList");return h.openBlock(),h.createElementBlock("div",Voe,[e[0]||(e[0]=h.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[h.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),h.createElementVNode("div",Loe,[(T=(E=t.$route)==null?void 0:E.query)!=null&&T.card?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[n.row?(h.openBlock(),h.createBlock(o,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>[h.createElementVNode("div",Foe,[h.createElementVNode("dl",$oe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.columns,N=>(h.openBlock(),h.createElementBlock("div",joe,[h.createElementVNode("dt",Hoe,h.toDisplayString((N==null?void 0:N.ua)||(N==null?void 0:N.title)),1),h.createElementVNode("dd",Uoe,[h.createVNode(a,{row:n.row,column:N,table:n.table},null,8,["row","column","table"])])]))),256))])])]),_:1})):h.createCommentVNode("",!0),(D=n.row)!=null&&D.geom?(h.openBlock(),h.createBlock(o,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N,B;return[(N=n.row)!=null&&N.geom?(h.openBlock(),h.createBlock(f,{key:0,geometry:(B=n.row)==null?void 0:B.geom,zoom:14},null,8,["geometry"])):(h.openBlock(),h.createBlock(g,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):h.createCommentVNode("",!0),h.createVNode(o,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N;return[h.createElementVNode("div",Woe,[h.createVNode(y,{id:(N=n.row)==null?void 0:N.id},null,8,["id"])])]}),_:1}),h.createVNode(o,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N,B;return[h.createElementVNode("div",qoe,[(h.openBlock(),h.createBlock(v,{key:(N=n.row)==null?void 0:N.id,id:(B=n.row)==null?void 0:B.id},null,8,["id"]))])]}),_:1})],64)):(h.openBlock(),h.createBlock(g,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const Yoe=Le(zoe,[["render",Goe]]),Zoe={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number},table:{type:String}},components:{IconFilter:iA},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},Xoe={key:0,class:"px-[7px] text-[10px] py-[1px] font-[700] text-white bg-blue-500 rounded-full"},Koe={class:"filter-content h-screen bg-white w-[400px] overflow-x-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function Joe(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter"),o=h.resolveComponent("VsFilter");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=f=>i.isFilters=!i.isFilters),class:"py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium 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"},[h.createVNode(a,{height:"16",width:"16"}),e[4]||(e[4]=h.createTextVNode(" Фільтри ")),n.onFilters?(h.openBlock(),h.createElementBlock("span",Xoe,h.toDisplayString(n.onFilters),1)):h.createCommentVNode("",!0)]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var f;return[(h.openBlock(),h.createBlock(h.Teleport,{to:"#modal"},[h.withDirectives(h.createElementVNode("div",{onClick:e[3]||(e[3]=(...g)=>s.closeFilter&&s.closeFilter(...g)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[12] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.2)]"},[h.createElementVNode("div",Koe,[(f=n.scheme)!=null&&f.length?(h.openBlock(),h.createBlock(o,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",token:n.table,name:"filter",footer:!0,background:!0,onFilterChange:e[1]||(e[1]=g=>t.$emit("filterChange",g)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=g=>i.isFilters=!1)},null,8,["scheme","token"])):h.createCommentVNode("",!0)])],512),[[h.vShow,i.isFilters]])]))]}),_:1})],64)}const Qoe=Le(Zoe,[["render",Joe]]),eae={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},tae={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},nae=["onClick"];function rae(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("nav",tae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.tabsList,a=>(h.openBlock(),h.createElementBlock("button",{onClick:o=>t.$emit("update:filterState",a==null?void 0:a.name),class:h.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(a==null?void 0:a.name)===n.filterState}])},h.toDisplayString(a==null?void 0:a.label),11,nae))),256))])}const iae=Le(eae,[["render",rae]]),sae={},oae={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-filter"};function aae(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",oae,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const lae={components:{IconFilter2:Le(sae,[["render",aae]]),IconCheck2:M0},props:{filterCustom:String,customList:Array}},cae={class:"py-2 max-h-[34px] px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},dae={class:"flex flex-col p-[2px] gap-[2px] w-[170px]"},uae=["onClick"],hae={class:"text-sm text-gray-800"};function pae(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter2"),o=h.resolveComponent("IconCheck2"),f=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(f,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",cae,[h.createVNode(a,{height:"20",width:"20"})])]),default:h.withCtx(()=>[h.createElementVNode("div",dae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.customList,(g,y)=>(h.openBlock(),h.createElementBlock("button",{onClick:v=>{var E;t.$emit("update:filterCustom",g==null?void 0:g.name),(E=t.$refs)==null||E.popover.togglePopover()},key:y,class:h.normalizeClass(["flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",{"bg-gray-100":n.filterCustom===(g==null?void 0:g.name)}])},[h.createElementVNode("span",hae,h.toDisplayString(g==null?void 0:g.label),1),n.filterCustom===(g==null?void 0:g.name)?(h.openBlock(),h.createBlock(o,{key:0,class:"ml-auto size-3 shrink-0"})):h.createCommentVNode("",!0)],10,uae))),128)),h.createElementVNode("button",{class:"flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",onClick:e[0]||(e[0]=g=>{var y;t.$emit("update:filterCustom",void 0),(y=t.$refs)==null||y.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const fae=Le(lae,[["render",pae]]),mae={class:"flex items-center gap-x-2"},gae={__name:"admin-table-custom-buttons",props:{slots:Object},setup(t){var o,f,g,y,v;const{asyncTemplateSlot:e}=(v=(y=(g=(f=(o=h.getCurrentInstance())==null?void 0:o.appContext)==null?void 0:f.app)==null?void 0:g.config)==null?void 0:y.globalProperties)==null?void 0:v.utils,n=h.ref(""),r=h.ref(""),i=t,s=()=>{var E,T,D,N,B;if((E=i.slots)!=null&&E.panelLeft||(r.value="div"),(D=(T=i.slots)==null?void 0:T.panelLeft)!=null&&D.includes("<")){const F=e("PanelLeft",(N=i.slots)==null?void 0:N.panelLeft,["name"]);r.value=F}else r.value=(B=i.slots)==null?void 0:B.panelLeft},a=()=>{var E,T,D,N,B;if((E=i.slots)!=null&&E.panelRight||(n.value="div"),(D=(T=i.slots)==null?void 0:T.panelRight)!=null&&D.includes("<")){const F=e("PanelRight",(N=i.slots)==null?void 0:N.panelRight,["name"]);n.value=F}else n.value=(B=i.slots)==null?void 0:B.panelRight};return s(),a(),(E,T)=>(h.openBlock(),h.createElementBlock("div",mae,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(r.value))),(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value)))]))}},yae=(t,e=300)=>{let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}},bae={__name:"admin-custom-button-add",props:{slots:Object},setup(t){var s,a,o,f,g;const{asyncTemplateSlot:e}=(g=(f=(o=(a=(s=h.getCurrentInstance())==null?void 0:s.appContext)==null?void 0:a.app)==null?void 0:o.config)==null?void 0:f.globalProperties)==null?void 0:g.utils,n=h.ref(""),r=t;return(()=>{var y,v,E,T,D;if((y=r.slots)!=null&&y.addButton||(n.value="div"),(E=(v=r.slots)==null?void 0:v.addButton)!=null&&E.includes("<")){const N=e("addButton",(T=r.slots)==null?void 0:T.addButton,["IconPlus"]);n.value=N}else n.value=(D=r.slots)==null?void 0:D.addButton})(),(y,v)=>n.value?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value),{key:0,IconPlus:Qh})):h.createCommentVNode("",!0)}},_ae={key:0,class:"px-1 py-3 text-gray-800 font-[500]"},xae={key:1,class:"px-1 py-3 text-gray-800 font-[700]"},vae={__name:"admin-table-totals-list",props:{columns:{type:Array,default:()=>[]},agg:{type:Object,default:()=>{}}},setup(t){return(e,n)=>(h.openBlock(),h.createElementBlock("tr",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.columns,r=>{var i;return h.openBlock(),h.createElementBlock(h.Fragment,{key:r==null?void 0:r.name},[(i=t.agg)!=null&&i[r==null?void 0:r.name]?(h.openBlock(),h.createElementBlock("td",_ae,[h.createVNode(ep,{column:r,row:t.agg},null,8,["column","row"])])):(h.openBlock(),h.createElementBlock("td",xae))],64)}),128))]))}},wae={},kae={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-chevron-down"};function Eae(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",kae,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Sae=Le(wae,[["render",Eae]]),Cae={},Tae={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-check"};function Aae(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Tae,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Mae=Le(Cae,[["render",Aae]]),Dae=h.defineComponent({components:{IconChevronDown:Sae,IconCheck:Mae},props:{total:{type:Number,default:()=>0},pageSize:{type:Number,default:()=>20},maxPages:{type:Number,default:()=>10},defaultPage:{type:Number,default:()=>1},pageSizes:{type:Array,default:[]}},data(){return{page:1,pages:[],isDropdownOpen:!1,pageSizeLocal:null}},mounted(){this.pageSizeLocal=this.pageSize},watch:{total:{immediate:!0,handler(){this.initPages()}},defaultPage:{immediate:!0,handler(t){this.page=t,this.updatePages(t)}},pageSizeLocal(t,e){e&&(this.isDropdownOpen=!1,this.setCurrentPage(1))}},computed:{pagesCount(){return Math.ceil(this.total/this.pageSizeLocal)},disableNextClick(){return this.page>=this.pagesCount},disablePrevClick(){return this.page<=1}},methods:{initPages(){if(this.total<=0){this.pages=[1];return}this.updatePages(this.page)},handleSetPage(t){const e=t.replace(/\D/g,"");if(e>this.pagesCount){this.$refs.currentPage.innerText=this.page;return}else this.$refs.currentPage.innerText=e;this.setCurrentPage(e)},updatePages(t){const e=Math.floor(this.maxPages/2);let n=Math.max(t-e,1),r=n+this.maxPages-1;r>this.pagesCount&&(r=this.pagesCount,n=Math.max(r-this.maxPages+1,1)),this.pages=Array.from({length:r-n+1},(i,s)=>n+s)},handleClickPrev(){this.disablePrevClick||(this.setCurrentPage(this.page-1),this.updatePages(this.page),this.$emit("prevClick"))},handleClickNext(){this.disableNextClick||(this.setCurrentPage(parseInt(this.page)+1),this.updatePages(this.page),this.$emit("nextClick"))},setCurrentPage(t){t<1||t>this.pagesCount||this.page===t||(this.page=t,this.$emit("pageChange",this.page,this.pageSizeLocal),this.updatePages(t))}}}),Iae={class:"flex items-center w-full"},Pae={class:"flex items-center mx-[8px]"},Rae={class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},Oae={key:0,class:"flex items-center justify-center ml-3 gap-x-5"},Nae={class:"relative"},Bae={class:"z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 dark:divide-neutral-700 absolute bottom-[100%]"},zae=["onClick"];function Vae(t,e,n,r,i,s){const a=h.resolveComponent("IconChevronDown"),o=h.resolveComponent("IconCheck");return h.openBlock(),h.createElementBlock("nav",Iae,[h.createElementVNode("button",{type:"button",onClick:e[0]||(e[0]=(...f)=>t.handleClickPrev&&t.handleClickPrev(...f)),class:h.normalizeClass(["min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",{"opacity-50 pointer-events-none":t.disablePrevClick}])},[h.createVNode(a,{height:"16",width:"16",class:"rotate-90"})],2),h.createElementVNode("div",Pae,[h.createElementVNode("span",{ref:"currentPage",contenteditable:"true",onBlur:e[1]||(e[1]=f=>t.handleSetPage(f.target.innerText)),class:"min-h-[38px] max-h-[38px] overflow-hidden min-w-[38px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:text-white"},h.toDisplayString(t.page),545),e[4]||(e[4]=h.createElementVNode("span",{class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),h.createElementVNode("span",Rae,h.toDisplayString(t.pagesCount),1)]),h.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...f)=>t.handleClickNext&&t.handleClickNext(...f)),class:h.normalizeClass([{"opacity-50 pointer-events-none":t.disableNextClick},"min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])},[h.createVNode(a,{height:"16",width:"16",class:"-rotate-90"})],2),t.pageSizes.length?(h.openBlock(),h.createElementBlock("div",Oae,[h.createElementVNode("div",Nae,[h.withDirectives(h.createElementVNode("div",Bae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.pageSizes,f=>(h.openBlock(),h.createElementBlock("button",{type:"button",class:"w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm",onClick:g=>t.pageSizeLocal=f},[h.createTextVNode(h.toDisplayString(f)+" ",1),f===t.pageSizeLocal?(h.openBlock(),h.createBlock(o,{key:0,width:"14",height:"14",class:"text-blue-600"})):h.createCommentVNode("",!0)],8,zae))),256))],512),[[h.vShow,t.isDropdownOpen]]),t.pageSizes.length?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"text-sm h-[32px] min-w-8 py-3 px-3.5 inline-flex items-center gap-x-1 rounded-lg border border-gray-200 text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[3]||(e[3]=f=>t.isDropdownOpen=!t.isDropdownOpen)},[h.createTextVNode(h.toDisplayString(t.pageSizeLocal)+" ",1),h.createVNode(a,{height:"16",width:"16"})])):h.createCommentVNode("",!0)])])):h.createCommentVNode("",!0)])}const Lae={props:{table:String,title:String},components:{AdminTableControl:Mse,AdminTableExport:Kse,AdminTablePrint:coe,AdminTableColumnsHidden:Toe,AdminTableColumn:_se,AdminNodata:ix,IconPlus:Qh,IconSearch:bv,AdminTableCardInfo:Yoe,IconOpenCard:eI,AdminComponentIs:ep,AdminTableFilters:Qoe,AdminTableTabs:iae,AdminTableCustomFilters:fae,AdminTableCustomButtons:gae,AdminCustomButtonAdd:bae,AdminTableTotalsList:vae,AdminTablePagination:Le(Dae,[["render",Vae]])},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:""}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters(),window.addEventListener("reloadTablePage",this.getTableData)},unmounted(){window.removeEventListener("reloadTablePage",this.getTableData)},computed:{defaultPage(){var t,e;return((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1},columns(){var t,e;return(e=(t=this.tableData)==null?void 0:t.columns)==null?void 0:e.filter(n=>(n==null?void 0:n.hidden)!==!0)},isForm(){var t,e,n,r,i;return((t=this.tableData)==null?void 0:t.form)&&(((n=(e=this.tableData)==null?void 0:e.actions)==null?void 0:n.includes("add"))||((i=(r=this.tableData)==null?void 0:r.actions)==null?void 0:i.includes("edit")))},isNoData(){var t,e;return!((t=this.tableData)!=null&&t.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var t,e;return((e=(t=this.tableData)==null?void 0:t.rows)==null?void 0:e.find(n=>{var r,i;return(n==null?void 0:n.id)===((i=(r=this.$route)==null?void 0:r.query)==null?void 0:i.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:yae(async function(t){var e;await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:t||void 0}})},500)},$route:{handler(t,e){var n,r;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((r=e==null?void 0:e.params)==null?void 0:r.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,limit:t}})},filterState(t){var e;t&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:t}}),this.getTableData())},filterCustom(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:t}}),this.getTableData()},columns(t){var e,n,r,i;this.visibleColumns=t==null?void 0:t.map(s=>s==null?void 0:s.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,columns:(r=this.visibleColumns)!=null&&r.length?(i=this.visibleColumns)==null?void 0:i.join(","):void 0}})}},methods:{async checkUrlMounted(){var t,e,n,r,i,s,a,o,f,g,y,v,E,T,D,N,B,F,X;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((r=(n=this.$route)==null?void 0:n.query)==null?void 0:r.limit)||20,this.filters=((a=decodeURI((s=(i=this.$route)==null?void 0:i.query)==null?void 0:s.filter))==null?void 0:a.replaceAll("+"," "))||null,this.filters&&(this.onFilters=((f=(o=this.filters)==null?void 0:o.split("="))==null?void 0:f.length)-1),this.filterState=((y=(g=this.$route)==null?void 0:g.query)==null?void 0:y.filterState)||null,this.filterCustom=((E=(v=this.$route)==null?void 0:v.query)==null?void 0:E.custom)||null,this.searchValue=((D=(T=this.$route)==null?void 0:T.query)==null?void 0:D.search)||"",this.visibleColumns=((F=(B=(N=this.$route)==null?void 0:N.query)==null?void 0:B.columns)==null?void 0:F.split(","))||[],(X=this.$route)!=null&&X.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(t){var n,r;const e=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.find(i=>i.name===t);if(e){const i=e==null?void 0:e.width;return typeof i=="number"?`${i}px`:i!=null&&i.includes("px")?i:`${i}px`}},unmountedData(){this.page=1,this.visibleColumns=[],this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0,this.searchValue=""},async getTableData(){var t,e,n,r,i,s,a,o,f,g,y;try{const{data:v}=await Ze.get(`/api/template/table/${this.table}`),E=await Ze.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...v,...(E==null?void 0:E.data)||{}},this.initialHiddenColumns=(s=(i=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.filter(T=>(T==null?void 0:T.hidden)!==!0))==null?void 0:i.map(T=>T==null?void 0:T.name))==null?void 0:s.join(","),(a=this.visibleColumns)!=null&&a.length?(o=this.tableData)==null||o.columns.forEach(T=>{var D;(D=this.visibleColumns)!=null&&D.includes(T==null?void 0:T.name)?T.hidden=!1:T.hidden=!0}):this.visibleColumns=(y=(g=(f=this.tableData)==null?void 0:f.columns)==null?void 0:g.filter(T=>(T==null?void 0:T.hidden)!==!0))==null?void 0:y.map(T=>T==null?void 0:T.name)}catch{}},async getFilters(){var t;try{const{data:e}=await Ze.get(`/api/table-filter/${this.table}`);this.filterScheme=(t=e==null?void 0:e.list)==null?void 0:t.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(t,e){const n=this.$route.query;this.page=t,await this.$router.replace({query:{...n,page:t,limit:e}}),await this.getTableData()},async filterChange({url:t,state:e}){var n;this.filters=t!=="no-url"?t:null,this.onFilters=(n=Object.entries(e))==null?void 0:n.length,this.page=1,await this.getTableData()},changeActiveColumn(t){this.activeColumn=t,this.getTableData()},pushToCard(t){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${t}`)},pushToLinkCard(t,e){t!=null&&t.link&&this.$router.push(`/card/${t==null?void 0:t.link}/${e==null?void 0:e[t==null?void 0:t.name]}`)},changeActiveCardInfo(t){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:t}})},toggleCardInfo(){var t;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,card:void 0}})},getCustomStyles(t){return[t!=null&&t.link?" text-blue-600 hover:underline decoration-2":"",t!=null&&t.align?` text-${(t==null?void 0:t.align)||"left"}`:"",`text-${(t==null?void 0:t.wrap)||"wrap"}`]}}},Fae={class:"w-[calc(100vw - 320px)] bg-gray-50"},$ae={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},jae={class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"},Hae={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},Uae={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},Wae={class:"flex"},qae={class:"flex gap-[6px] ml-auto"},Gae={class:"inline-block w-full align-middle"},Yae={key:0,class:"relative min-w-full text-[13px] divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"},Zae={class:"sticky top-[-1px] z-[2] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},Xae={class:"right-0"},Kae={key:0,class:"w-[70px] sticky right-0 top-0"},Jae={class:"divide-y divide-gray-200 z-[1] relative"},Qae=["onClick"],ele=["onClick"],tle={class:"p-[10px] flex justify-start items-center w-full"},nle={class:"w-[200px] md:inline-flex hidden"},rle={class:"text-sm text-gray-600 dark:text-neutral-400"},ile={class:"font-semibold text-gray-800 dark:text-neutral-200"},sle={key:0},ole={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function ale(t,e,n,r,i,s){var lt,Qe,gt,rt,Tt,jt,Ht,Nt,Gt,wn,yn,An,bn,hr,Hn,zn,Un,Ae,Ue,Ke,dt,Ut,sn,Rt,Pt,dn,Ce,kn,Pi,Xt;const a=h.resolveComponent("AdminCustomButtonAdd"),o=h.resolveComponent("IconPlus"),f=h.resolveComponent("router-link"),g=h.resolveComponent("AdminTableTabs"),y=h.resolveComponent("IconSearch"),v=h.resolveComponent("VsText"),E=h.resolveComponent("AdminTableCustomButtons"),T=h.resolveComponent("AdminTableCustomFilters"),D=h.resolveComponent("AdminTableColumnsHidden"),N=h.resolveComponent("AdminTablePrint"),B=h.resolveComponent("AdminTableExport"),F=h.resolveComponent("AdminTableFilters"),X=h.resolveComponent("IconOpenCard"),te=h.resolveComponent("AdminTableColumn"),H=h.resolveComponent("AdminComponentIs"),ke=h.resolveComponent("AdminTableControl"),me=h.resolveComponent("AdminTableTotalsList"),Se=h.resolveComponent("AdminNodata"),Pe=h.resolveComponent("AdminTablePagination"),Ne=h.resolveComponent("AdminTableCardInfo");return h.openBlock(),h.createElementBlock("div",Fae,[h.createElementVNode("div",$ae,[h.createElementVNode("h2",jae,h.toDisplayString(n.title),1),s.isForm?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(Qe=(lt=i.tableData)==null?void 0:lt.slots)!=null&&Qe.addButton?(h.openBlock(),h.createBlock(a,{key:0,slots:(gt=i.tableData)==null?void 0:gt.slots},null,8,["slots"])):(h.openBlock(),h.createBlock(f,{key:1,to:`/add?table=${(Tt=(rt=t.$route)==null?void 0:rt.params)==null?void 0:Tt.catchAll}`,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"},{default:h.withCtx(()=>[h.createVNode(o,{height:"16",width:"16"}),e[5]||(e[5]=h.createTextVNode(" Додати "))]),_:1},8,["to"]))],64)):h.createCommentVNode("",!0)]),h.createElementVNode("div",Hae,[h.createElementVNode("div",Uae,[(Ht=(jt=i.tableData)==null?void 0:jt.filterState)!=null&&Ht.length?(h.openBlock(),h.createBlock(g,{key:0,tabsList:(Nt=i.tableData)==null?void 0:Nt.filterState,filterState:i.filterState,"onUpdate:filterState":e[0]||(e[0]=tt=>i.filterState=tt)},null,8,["tabsList","filterState"])):h.createCommentVNode("",!0),h.createElementVNode("div",Wae,[h.createElementVNode("div",{class:h.normalizeClass([i.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[h.createElementVNode("div",{class:h.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!i.isVisibleCardInfo}])},[h.createVNode(y,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),h.createVNode(v,{modelValue:i.searchValue,"onUpdate:modelValue":e[1]||(e[1]=tt=>i.searchValue=tt),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:max-h-[36px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue"]),h.createElementVNode("div",qae,[(Gt=i.tableData)!=null&&Gt.slots?(h.openBlock(),h.createBlock(E,{key:0,slots:(wn=i.tableData)==null?void 0:wn.slots},null,8,["slots"])):h.createCommentVNode("",!0),(An=(yn=i.tableData)==null?void 0:yn.filterCustom)!=null&&An.length?(h.openBlock(),h.createBlock(T,{key:1,customList:(bn=i.tableData)==null?void 0:bn.filterCustom,filterCustom:i.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=tt=>i.filterCustom=tt)},null,8,["customList","filterCustom"])):h.createCommentVNode("",!0),h.createVNode(D,{columns:(hr=i.tableData)==null?void 0:hr.columns,onUpdateColumns:e[3]||(e[3]=tt=>i.tableData.columns=tt)},null,8,["columns"]),h.createVNode(N,{rows:(Hn=i.tableData)==null?void 0:Hn.rows,titleCol:(Un=(zn=s.columns)==null?void 0:zn[0])==null?void 0:Un.name},null,8,["rows","titleCol"]),((Ae=i.tableData)==null?void 0:Ae.export)!==!1?(h.openBlock(),h.createBlock(B,{key:2,table:n.table,columns:(Ue=i.tableData)==null?void 0:Ue.columns,page:i.page,"filter-state":i.filterState,"filter-custom":i.filterCustom,filters:i.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):h.createCommentVNode("",!0),(Ke=i.filterScheme)!=null&&Ke.length?(h.openBlock(),h.createBlock(F,{key:3,scheme:i.filterScheme,onFilters:i.onFilters,table:n.table,onFilterChange:s.filterChange},null,8,["scheme","onFilters","table","onFilterChange"])):h.createCommentVNode("",!0),h.createElementVNode("button",{onClick:e[4]||(e[4]=(...tt)=>s.toggleCardInfo&&s.toggleCardInfo(...tt)),class:"py-2 px-2.5 max-h-[34px] md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium 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 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(X,{class:h.normalizeClass({"rotate-180 duration-300":!i.isVisibleCardInfo})},null,8,["class"])])])],2),h.createElementVNode("div",{class:h.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!i.isVisibleCardInfo}])},[h.createElementVNode("div",{style:h.normalizeStyle({height:(Ut=(dt=i.tableData)==null?void 0:dt.filterState)!=null&&Ut.length?"calc(100vh - 370px)":"calc(100vh - 330px)"}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[h.createElementVNode("div",Gae,[s.isNoData?(h.openBlock(),h.createBlock(Se,{key:1})):(h.openBlock(),h.createElementBlock("table",Yae,[h.createElementVNode("thead",Zae,[h.createElementVNode("tr",Xae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.columns,tt=>(h.openBlock(),h.createBlock(te,{key:tt.name,style:h.normalizeStyle({width:s.rowWidth(tt==null?void 0:tt.name),textAlign:tt==null?void 0:tt.align,wordBreak:tt==null?void 0:tt.wrap}),data:tt,activeColumn:i.activeColumn,onChangeActive:s.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(Rt=(sn=s.getActions)==null?void 0:sn.filter(tt=>tt!=="add"&&tt!=="view"))!=null&&Rt.length?(h.openBlock(),h.createElementBlock("th",Kae)):h.createCommentVNode("",!0)])]),h.createElementVNode("tbody",Jae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Pt=i.tableData)==null?void 0:Pt.rows,(tt,Ur)=>{var Rr,gr,ri,yr,Ri,Oi,$e,ii,br,si,Ni,We;return h.openBlock(),h.createElementBlock("tr",{key:(tt==null?void 0:tt.id)||Ur,class:h.normalizeClass({"bg-gray-50":((gr=(Rr=t.$route)==null?void 0:Rr.query)==null?void 0:gr.card)===(tt==null?void 0:tt.id)})},[h.createElementVNode("td",{class:h.normalizeClass(["px-1 py-3 text-gray-600 pe-4",[(ri=s.columns[0])!=null&&ri.align?`text-${((yr=s.columns[0])==null?void 0:yr.align)||"left"}`:""]])},[h.createElementVNode("button",{onClick:we=>{s.pushToCard(tt==null?void 0:tt.id),s.pushToLinkCard(s.columns[0],tt)},class:h.normalizeClass(["font-medium",[...s.getCustomStyles(s.columns[0]),((Ri=this.tableData)==null?void 0:Ri.card)===!1?"":" text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[h.createVNode(H,{row:tt,column:s.columns[0],table:n.table,onUpdateTable:s.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Qae)],2),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Oi=s.columns)==null?void 0:Oi.slice(1),we=>(h.openBlock(),h.createElementBlock("td",{onClick:Ve=>{s.changeActiveCardInfo(tt==null?void 0:tt.id),s.pushToLinkCard(we,tt)},class:h.normalizeClass(["px-1 py-3 text-gray-600 pe-3",s.getCustomStyles(we)]),key:we.name},[h.createVNode(H,{row:tt,column:we,table:n.table,onUpdateTable:s.getTableData},null,8,["row","column","table","onUpdateTable"])],10,ele))),128)),(ii=($e=s.getActions)==null?void 0:$e.filter(we=>we!=="add"&&we!=="view"))!=null&&ii.length?(h.openBlock(),h.createElementBlock("td",{key:0,class:h.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((si=(br=t.$route)==null?void 0:br.query)==null?void 0:si.card)===(tt==null?void 0:tt.id),"bg-white":((We=(Ni=t.$route)==null?void 0:Ni.query)==null?void 0:We.card)!==(tt==null?void 0:tt.id)}])},[h.createVNode(ke,{actions:s.getActions,isForm:s.isForm,item:tt,table:n.table,onUpdateTable:s.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):h.createCommentVNode("",!0)],2)}),128))]),h.createVNode(me,{columns:s.columns,agg:(dn=i.tableData)==null?void 0:dn.agg},null,8,["columns","agg"])]))])],4)],2),h.createElementVNode("div",tle,[h.createElementVNode("div",nle,[h.createElementVNode("p",rle,[h.createElementVNode("span",ile,[h.createTextVNode(h.toDisplayString(i.filters||i.searchValue?"Відображено":"Об'єктів")+" "+h.toDisplayString(((Ce=i.tableData)==null?void 0:Ce.count)||"0 ")+" ",1),i.filters||i.searchValue?(h.openBlock(),h.createElementBlock("span",sle," з")):h.createCommentVNode("",!0)]),i.filters||i.searchValue?(h.openBlock(),h.createElementBlock("span",ole,h.toDisplayString(" "+((kn=i.tableData)==null?void 0:kn.filtered)||0),1)):h.createCommentVNode("",!0)])]),Math.ceil(((Pi=i.tableData)==null?void 0:Pi.filtered)/i.limit)>1?(h.openBlock(),h.createBlock(Pe,{key:0,class:"justify-end","default-page":parseInt(s.defaultPage),total:((Xt=i.tableData)==null?void 0:Xt.filtered)||0,onPageChange:s.handlePageChange,pageSize:parseInt(i.limit),pageSizes:[10,20,50,100]},null,8,["default-page","total","onPageChange","pageSize"])):h.createCommentVNode("",!0)])],2),h.createVNode(h.Transition,{name:"slide-fade"},{default:h.withCtx(()=>{var tt;return[i.isVisibleCardInfo?(h.openBlock(),h.createBlock(Ne,{key:0,table:n.table,columns:(tt=i.tableData)==null?void 0:tt.columns,row:s.activeCardRow},null,8,["table","columns","row"])):h.createCommentVNode("",!0)]}),_:1})])])])])}const lle={components:{AdminTable:Le(Lae,[["render",ale],["__scopeId","data-v-87a0d788"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){_s!=null&&_s.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){var e;t&&(document.title=(((e=Ln.value)==null?void 0:e.titlePrefix)||"")+t)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async checkPageType(){var r,i;const t=this.flattenMenu(_s.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.params)==null?void 0:o.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.catchAll);const n=e==null?void 0:e.table;this.table=n||!1,!n&&this.getInterface()},async getInterface(){var t,e;try{const{data:n}=await Ze.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},cle=["innerHTML"];function dle(t,e,n,r,i,s){const a=h.resolveComponent("AdminTable");return i.table?(h.openBlock(),h.createBlock(a,{key:0,table:i.table,title:i.title},null,8,["table","title"])):(h.openBlock(),h.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:i.interface},null,8,cle))}const ule=Object.freeze(Object.defineProperty({__proto__:null,default:Le(lle,[["render",dle]])},Symbol.toStringTag,{value:"Module"}));return Fre});